|
@@ -3,30 +3,44 @@
|
|
|
<div class="app-container">
|
|
|
<!-- 搜索 -->
|
|
|
<el-form inline size="mini">
|
|
|
+ <el-form-item label="上下架状态:" prop="forwardType">
|
|
|
+ <el-select v-model="form.status" placeholder="请选择状态" @change="handleStatusChange">
|
|
|
+ <el-option v-for="item in statusList" :key="item.value" :label="item.label"
|
|
|
+ :value="Number(item.value)" />
|
|
|
+ </el-select>
|
|
|
+ </el-form-item>
|
|
|
<el-form-item>
|
|
|
- <el-button type="primary" icon="el-icon-plus" plain @click="getDetail(false, 0, 0)"
|
|
|
+ <el-button type="primary" icon="el-icon-plus" plain @click="getDetail(0, 0, 0)"
|
|
|
v-hasPermi="['operation:wxbanner:add']">新增</el-button>
|
|
|
</el-form-item>
|
|
|
</el-form>
|
|
|
<!-- 列表 -->
|
|
|
<el-table :data="tableData" v-loading="loading">
|
|
|
<el-table-column label="序号" align="center" type="index" />
|
|
|
- <el-table-column label="跳转方式" align="center" prop="name" show-overflow-tooltip />
|
|
|
-
|
|
|
- <el-table-column label="当前状态" prop="categoryName" align="center" />
|
|
|
-
|
|
|
+ <!-- <el-table-column label="跳转方式" align="center" prop="forwardType" show-overflow-tooltip /> -->
|
|
|
+ <el-table-column label="跳转方式" align="center">
|
|
|
+ <template slot-scope="scope">
|
|
|
+ {{ getTypeText(scope.row.forwardType) }}
|
|
|
+ </template>
|
|
|
+ </el-table-column>
|
|
|
+ <!-- <el-table-column label="当前状态" prop="status" align="center" /> -->
|
|
|
+ <el-table-column label="状态" align="center">
|
|
|
+ <template slot-scope="scope">
|
|
|
+ {{ getStatusText(scope.row.status) }}
|
|
|
+ </template>
|
|
|
+ </el-table-column>
|
|
|
<el-table-column label="更新时间" align="center" prop="updateTimeStr" />
|
|
|
<el-table-column label="创建时间" align="center" prop="createTimeStr" />
|
|
|
<el-table-column label="操作" align="center">
|
|
|
<template slot-scope="scope">
|
|
|
- <el-button type="text" @click="getDetail(true, 1, scope.row.id)"
|
|
|
+ <el-button type="text" @click="getDetail(1, 1, scope.row.id)"
|
|
|
v-hasPermi="['operation:wxbannber:check']">查看</el-button>
|
|
|
|
|
|
<span style="margin: 0 10px">
|
|
|
- <el-button type="text" @click="getDetail(false, 2, scope.row.id)"
|
|
|
+ <el-button type="text" @click="getDetail(0, 2, scope.row.id)"
|
|
|
v-hasPermi="['operation:wxbannber:edit']">编辑</el-button>
|
|
|
|
|
|
- <el-button type="delete" @click="getDelete(scope.row)"
|
|
|
+ <el-button type="delete" @click="getDelete(scope.row, scope.$index)"
|
|
|
v-hasPermi="['operation:wxbannber:delete']">删除</el-button>
|
|
|
</span>
|
|
|
</template>
|
|
@@ -52,7 +66,19 @@ export default {
|
|
|
form: {
|
|
|
pageNum: 1,
|
|
|
pageSize: 10,
|
|
|
+ status: null,
|
|
|
},
|
|
|
+ // 状态 0-上架 1-下架 2-删除
|
|
|
+ statusList: [{
|
|
|
+ value: null,
|
|
|
+ label: '全部'
|
|
|
+ }, {
|
|
|
+ value: 0,
|
|
|
+ label: '上架'
|
|
|
+ }, {
|
|
|
+ value: 1,
|
|
|
+ label: '下架'
|
|
|
+ }],
|
|
|
// 总数据
|
|
|
total: 0,
|
|
|
// 列表
|
|
@@ -67,11 +93,31 @@ export default {
|
|
|
|
|
|
methods: {
|
|
|
addData() { },
|
|
|
+ handleStatusChange(value) {
|
|
|
+ this.form.status = value;
|
|
|
+ this.getList();
|
|
|
+ },
|
|
|
+ getStatusText(status) {
|
|
|
+ const statusMap = {
|
|
|
+ 0: '上架',
|
|
|
+ 1: '下架',
|
|
|
+ };
|
|
|
+ return statusMap[status] || '未知状态';
|
|
|
+ }, getTypeText(type) {
|
|
|
+ const statusMap = {
|
|
|
+ 0: 'H5内链',
|
|
|
+ 1: 'H5外链',
|
|
|
+ };
|
|
|
+ return statusMap[type] || '未知连接';
|
|
|
+ },
|
|
|
// 列表
|
|
|
getList() {
|
|
|
this.loading = true;
|
|
|
+ console.log("轮播图列表==" + JSON.stringify(this.form));
|
|
|
+
|
|
|
list(this.form).then((res) => {
|
|
|
if (res.code === 0) {
|
|
|
+ // console.log("轮播图列表==" + JSON.stringify(res));
|
|
|
this.tableData = res.data.records;
|
|
|
this.total = res.data.total;
|
|
|
this.loading = false;
|
|
@@ -92,18 +138,22 @@ export default {
|
|
|
},
|
|
|
|
|
|
// 删除
|
|
|
- getDelete(row) {
|
|
|
+ getDelete(row, index) {
|
|
|
var that = this;
|
|
|
dialogCallBack(that, function () {
|
|
|
that
|
|
|
- .$confirm(`是否删除${row.name}?`, "提示:", {
|
|
|
+ .$confirm(`是否删除序号:${index + 1}?`, "提示:", {
|
|
|
type: "warning",
|
|
|
})
|
|
|
.then(() => {
|
|
|
- deletes(row.id, 2).then((res) => {
|
|
|
+ console.log("打印:" + JSON.stringify(row));
|
|
|
+ const id = String(row.id);
|
|
|
+ deletes(id).then((res) => {
|
|
|
if (res.code === 0) {
|
|
|
that.$message.success("删除成功!");
|
|
|
that.getList();
|
|
|
+ } else {
|
|
|
+ console.log("打印2:" + res);
|
|
|
}
|
|
|
});
|
|
|
});
|