|
@@ -1,15 +1,30 @@
|
|
|
|
+<!-- 运营管理 首页推荐 推荐管理 -->
|
|
<template>
|
|
<template>
|
|
<div class="app-container">
|
|
<div class="app-container">
|
|
<!-- 列表 -->
|
|
<!-- 列表 -->
|
|
- <el-table :data="tableData" ref="tableData" row-key="id" :default-sort="{ prop: 'sort', order: 'ascending' }"
|
|
|
|
- :tree-props="{ children: 'children', hasChildren: 'hasChildren' }">
|
|
|
|
|
|
+ <el-table
|
|
|
|
+ :data="tableData"
|
|
|
|
+ ref="tableData"
|
|
|
|
+ row-key="id"
|
|
|
|
+ :default-sort="{ prop: 'sort', order: 'ascending' }"
|
|
|
|
+ :tree-props="{ children: 'children', hasChildren: 'hasChildren' }"
|
|
|
|
+ >
|
|
<el-table-column width="80px">
|
|
<el-table-column width="80px">
|
|
<template slot-scope="scope">
|
|
<template slot-scope="scope">
|
|
- <el-link v-if="scope.row.hidden" :underline="false" class="el-icon-arrow-right"
|
|
|
|
- @click="getList(scope.row, scope.row.index)" />
|
|
|
|
|
|
+ <el-link
|
|
|
|
+ v-if="scope.row.hidden"
|
|
|
|
+ :underline="false"
|
|
|
|
+ class="el-icon-arrow-right"
|
|
|
|
+ @click="getList(scope.row, scope.row.index)"
|
|
|
|
+ />
|
|
</template>
|
|
</template>
|
|
</el-table-column>
|
|
</el-table-column>
|
|
- <el-table-column label="导航名称" align="center" prop="name" show-overflow-tooltip>
|
|
|
|
|
|
+ <el-table-column
|
|
|
|
+ label="导航名称"
|
|
|
|
+ align="center"
|
|
|
|
+ prop="name"
|
|
|
|
+ show-overflow-tooltip
|
|
|
|
+ >
|
|
<template slot-scope="scope">
|
|
<template slot-scope="scope">
|
|
<span v-if="scope.row.lv === 1">{{ scope.row.name }}</span>
|
|
<span v-if="scope.row.lv === 1">{{ scope.row.name }}</span>
|
|
</template>
|
|
</template>
|
|
@@ -19,10 +34,26 @@
|
|
<span v-if="scope.row.lv === 2">{{ scope.row.sort }}</span>
|
|
<span v-if="scope.row.lv === 2">{{ scope.row.sort }}</span>
|
|
</template>
|
|
</template>
|
|
</el-table-column>
|
|
</el-table-column>
|
|
- <el-table-column label="模块类型" align="center" prop="moduleTypeId" show-overflow-tooltip :formatter="typeFormatter" />
|
|
|
|
- <el-table-column label="模块名称" align="center" prop="moduleName" show-overflow-tooltip />
|
|
|
|
|
|
+ <el-table-column
|
|
|
|
+ label="模块类型"
|
|
|
|
+ align="center"
|
|
|
|
+ prop="moduleTypeId"
|
|
|
|
+ show-overflow-tooltip
|
|
|
|
+ :formatter="typeFormatter"
|
|
|
|
+ />
|
|
|
|
+ <el-table-column
|
|
|
|
+ label="模块名称"
|
|
|
|
+ align="center"
|
|
|
|
+ prop="moduleName"
|
|
|
|
+ show-overflow-tooltip
|
|
|
|
+ />
|
|
<el-table-column label="模块数量" align="center" prop="moduleNum" />
|
|
<el-table-column label="模块数量" align="center" prop="moduleNum" />
|
|
- <el-table-column label="创建时间" align="center" prop="createTime" show-overflow-tooltip />
|
|
|
|
|
|
+ <el-table-column
|
|
|
|
+ label="创建时间"
|
|
|
|
+ align="center"
|
|
|
|
+ prop="createTime"
|
|
|
|
+ show-overflow-tooltip
|
|
|
|
+ />
|
|
<el-table-column label="有效时间" align="center" width="380px">
|
|
<el-table-column label="有效时间" align="center" width="380px">
|
|
<template slot-scope="scope">
|
|
<template slot-scope="scope">
|
|
<span v-if="scope.row.lv === 3">
|
|
<span v-if="scope.row.lv === 3">
|
|
@@ -30,39 +61,101 @@
|
|
</span>
|
|
</span>
|
|
</template>
|
|
</template>
|
|
</el-table-column>
|
|
</el-table-column>
|
|
- <el-table-column label="当前状态" align="center" prop="isProgressStatus" :formatter="statusFormatter" />
|
|
|
|
|
|
+ <el-table-column
|
|
|
|
+ label="当前状态"
|
|
|
|
+ align="center"
|
|
|
|
+ prop="isProgressStatus"
|
|
|
|
+ :formatter="statusFormatter"
|
|
|
|
+ />
|
|
<el-table-column label="操作" align="center">
|
|
<el-table-column label="操作" align="center">
|
|
<template slot-scope="scope">
|
|
<template slot-scope="scope">
|
|
<span v-if="scope.row.lv === 1">
|
|
<span v-if="scope.row.lv === 1">
|
|
- <el-button type="text" @click="getDialog('新增', scope.row)"
|
|
|
|
- v-hasPermi="['operation:recommend:add']">新增</el-button>
|
|
|
|
- <el-button type="text" @click="getHistoryDialog(scope.row.id)">历史记录</el-button>
|
|
|
|
|
|
+ <el-button
|
|
|
|
+ type="text"
|
|
|
|
+ @click="getDialog('新增', scope.row)"
|
|
|
|
+ v-hasPermi="['operation:recommend:add']"
|
|
|
|
+ >新增</el-button
|
|
|
|
+ >
|
|
|
|
+ <el-button type="text" @click="getHistoryDialog(scope.row.id)"
|
|
|
|
+ >历史记录</el-button
|
|
|
|
+ >
|
|
</span>
|
|
</span>
|
|
<span v-else-if="scope.row.lv === 2">
|
|
<span v-else-if="scope.row.lv === 2">
|
|
- <el-button type="text" @click="getDetail(scope.row)" v-hasPermi="['operation:recommend:add']">新增</el-button>
|
|
|
|
- <el-button type="text" @click="getDialog('查看', scope.row)">查看</el-button>
|
|
|
|
- <el-button type="text" @click="getDialog('编辑', scope.row)"
|
|
|
|
- v-hasPermi="['operation:recommend:edit']">编辑</el-button>
|
|
|
|
- <el-button type="delete" @click="getDelete(scope.row)"
|
|
|
|
- v-hasPermi="['operation:recommend:delete']">删除</el-button>
|
|
|
|
|
|
+ <el-button
|
|
|
|
+ type="text"
|
|
|
|
+ @click="getDetail(scope.row)"
|
|
|
|
+ v-hasPermi="['operation:recommend:add']"
|
|
|
|
+ >新增</el-button
|
|
|
|
+ >
|
|
|
|
+ <el-button type="text" @click="getDialog('查看', scope.row)"
|
|
|
|
+ >查看</el-button
|
|
|
|
+ >
|
|
|
|
+ <el-button
|
|
|
|
+ type="text"
|
|
|
|
+ @click="getDialog('编辑', scope.row)"
|
|
|
|
+ v-hasPermi="['operation:recommend:edit']"
|
|
|
|
+ >编辑</el-button
|
|
|
|
+ >
|
|
|
|
+ <el-button
|
|
|
|
+ type="delete"
|
|
|
|
+ @click="getDelete(scope.row)"
|
|
|
|
+ v-hasPermi="['operation:recommend:delete']"
|
|
|
|
+ >删除</el-button
|
|
|
|
+ >
|
|
</span>
|
|
</span>
|
|
<span v-else>
|
|
<span v-else>
|
|
- <el-button type="text" @click="getDetail(scope.row, true)">查看</el-button>
|
|
|
|
- <el-button type="text" @click="getDetail(scope.row)" v-hasPermi="['operation:recommend:edit']">编辑</el-button>
|
|
|
|
- <el-button type="delete" @click="getDelete(scope.row)"
|
|
|
|
- v-hasPermi="['operation:recommend:delete']">删除</el-button>
|
|
|
|
- <el-button type="text" @click="getCopy(scope.row)" v-hasPermi="['operation:recommend:copy']">复制</el-button>
|
|
|
|
|
|
+ <el-button type="text" @click="getDetail(scope.row, true)"
|
|
|
|
+ >查看</el-button
|
|
|
|
+ >
|
|
|
|
+ <el-button
|
|
|
|
+ type="text"
|
|
|
|
+ @click="getDetail(scope.row)"
|
|
|
|
+ v-hasPermi="['operation:recommend:edit']"
|
|
|
|
+ >编辑</el-button
|
|
|
|
+ >
|
|
|
|
+ <el-button
|
|
|
|
+ type="delete"
|
|
|
|
+ @click="getDelete(scope.row)"
|
|
|
|
+ v-hasPermi="['operation:recommend:delete']"
|
|
|
|
+ >删除</el-button
|
|
|
|
+ >
|
|
|
|
+ <el-button
|
|
|
|
+ type="text"
|
|
|
|
+ @click="getCopy(scope.row)"
|
|
|
|
+ v-hasPermi="['operation:recommend:copy']"
|
|
|
|
+ >复制</el-button
|
|
|
|
+ >
|
|
</span>
|
|
</span>
|
|
</template>
|
|
</template>
|
|
</el-table-column>
|
|
</el-table-column>
|
|
</el-table>
|
|
</el-table>
|
|
|
|
|
|
<!-- 弹窗 -->
|
|
<!-- 弹窗 -->
|
|
- <el-dialog :visible.sync="dialogVisible" :title="title" width="500px" :before-close="cancel">
|
|
|
|
- <el-form :model="dialogForm" :rules="rules" ref="dialogForm" label-width="100px" :disabled="title === '查看'">
|
|
|
|
|
|
+ <el-dialog
|
|
|
|
+ :visible.sync="dialogVisible"
|
|
|
|
+ :title="title"
|
|
|
|
+ width="500px"
|
|
|
|
+ :before-close="cancel"
|
|
|
|
+ >
|
|
|
|
+ <el-form
|
|
|
|
+ :model="dialogForm"
|
|
|
|
+ :rules="rules"
|
|
|
|
+ ref="dialogForm"
|
|
|
|
+ label-width="100px"
|
|
|
|
+ :disabled="title === '查看'"
|
|
|
|
+ >
|
|
<el-form-item label="模块类型:" prop="moduleTypeId">
|
|
<el-form-item label="模块类型:" prop="moduleTypeId">
|
|
- <el-select v-model="dialogForm.moduleTypeId" placeholder="请选择模块类型" :disabled="title === '编辑'">
|
|
|
|
- <el-option v-for="item in typeOptions" :key="item.typeId" :value="item.typeId" :label="item.typeName" />
|
|
|
|
|
|
+ <el-select
|
|
|
|
+ v-model="dialogForm.moduleTypeId"
|
|
|
|
+ placeholder="请选择模块类型"
|
|
|
|
+ :disabled="title === '编辑'"
|
|
|
|
+ >
|
|
|
|
+ <el-option
|
|
|
|
+ v-for="item in typeOptions"
|
|
|
|
+ :key="item.typeId"
|
|
|
|
+ :value="item.typeId"
|
|
|
|
+ :label="item.typeName"
|
|
|
|
+ />
|
|
</el-select>
|
|
</el-select>
|
|
</el-form-item>
|
|
</el-form-item>
|
|
<el-form-item label="排序:" prop="sort">
|
|
<el-form-item label="排序:" prop="sort">
|
|
@@ -71,50 +164,105 @@
|
|
</el-form>
|
|
</el-form>
|
|
<div slot="footer">
|
|
<div slot="footer">
|
|
<el-button @click="cancel">取消</el-button>
|
|
<el-button @click="cancel">取消</el-button>
|
|
- <el-button v-if="title !== '查看'" type="primary" @click="getSubmit">确定</el-button>
|
|
|
|
|
|
+ <el-button v-if="title !== '查看'" type="primary" @click="getSubmit"
|
|
|
|
+ >确定</el-button
|
|
|
|
+ >
|
|
</div>
|
|
</div>
|
|
</el-dialog>
|
|
</el-dialog>
|
|
|
|
|
|
<!-- 历史记录 -->
|
|
<!-- 历史记录 -->
|
|
- <el-dialog :visible.sync="dialogVisible_list" title="历史记录" width="1200px">
|
|
|
|
|
|
+ <el-dialog
|
|
|
|
+ :visible.sync="dialogVisible_list"
|
|
|
|
+ title="历史记录"
|
|
|
|
+ width="1200px"
|
|
|
|
+ >
|
|
<el-form inline size="mini">
|
|
<el-form inline size="mini">
|
|
<el-form-item label="创建时间:">
|
|
<el-form-item label="创建时间:">
|
|
- <el-date-picker v-model="dialogForm_list.rsDates" type="datetimerange" start-placeholder="开始日期"
|
|
|
|
- end-placeholder="结束日期" value-format="yyyy-MM-dd HH:mm:ss" format="yyyy-MM-dd HH:mm:ss" />
|
|
|
|
|
|
+ <el-date-picker
|
|
|
|
+ v-model="dialogForm_list.rsDates"
|
|
|
|
+ type="datetimerange"
|
|
|
|
+ start-placeholder="开始日期"
|
|
|
|
+ end-placeholder="结束日期"
|
|
|
|
+ value-format="yyyy-MM-dd HH:mm:ss"
|
|
|
|
+ format="yyyy-MM-dd HH:mm:ss"
|
|
|
|
+ />
|
|
</el-form-item>
|
|
</el-form-item>
|
|
<el-form-item label="模块名称:">
|
|
<el-form-item label="模块名称:">
|
|
- <el-input v-model="dialogForm_list.moduleName" placeholder="请输入模块名称" clearable />
|
|
|
|
|
|
+ <el-input
|
|
|
|
+ v-model="dialogForm_list.moduleName"
|
|
|
|
+ placeholder="请输入模块名称"
|
|
|
|
+ clearable
|
|
|
|
+ />
|
|
</el-form-item>
|
|
</el-form-item>
|
|
<el-form-item>
|
|
<el-form-item>
|
|
- <el-button type="primary" icon="el-icon-search" @click="getSearch">搜索</el-button>
|
|
|
|
|
|
+ <el-button type="primary" icon="el-icon-search" @click="getSearch"
|
|
|
|
+ >搜索</el-button
|
|
|
|
+ >
|
|
<el-button icon="el-icon-refresh" @click="getRefresh">重置</el-button>
|
|
<el-button icon="el-icon-refresh" @click="getRefresh">重置</el-button>
|
|
</el-form-item>
|
|
</el-form-item>
|
|
</el-form>
|
|
</el-form>
|
|
<el-table :data="dialogTableData" v-loading="loading">
|
|
<el-table :data="dialogTableData" v-loading="loading">
|
|
- <el-table-column label="模块名称" prop="moduleName" align="center" show-overflow-tooltip />
|
|
|
|
- <el-table-column label="模块类型" prop="moduleTypeId" align="center" :formatter="typeFormatter" />
|
|
|
|
|
|
+ <el-table-column
|
|
|
|
+ label="模块名称"
|
|
|
|
+ prop="moduleName"
|
|
|
|
+ align="center"
|
|
|
|
+ show-overflow-tooltip
|
|
|
|
+ />
|
|
|
|
+ <el-table-column
|
|
|
|
+ label="模块类型"
|
|
|
|
+ prop="moduleTypeId"
|
|
|
|
+ align="center"
|
|
|
|
+ :formatter="typeFormatter"
|
|
|
|
+ />
|
|
<el-table-column label="模块数量" prop="moduleNum" align="center" />
|
|
<el-table-column label="模块数量" prop="moduleNum" align="center" />
|
|
<el-table-column label="有效时间" align="center" width="380px">
|
|
<el-table-column label="有效时间" align="center" width="380px">
|
|
<template slot-scope="scope">
|
|
<template slot-scope="scope">
|
|
<span>{{ scope.row.rsDates[0] }} - {{ scope.row.rsDates[1] }}</span>
|
|
<span>{{ scope.row.rsDates[0] }} - {{ scope.row.rsDates[1] }}</span>
|
|
</template>
|
|
</template>
|
|
</el-table-column>
|
|
</el-table-column>
|
|
- <el-table-column label="当前状态" prop="isProgressStatus" align="center" :formatter="statusFormatter" />
|
|
|
|
- <el-table-column label="创建时间" prop="createTime" align="center" show-overflow-tooltip />
|
|
|
|
|
|
+ <el-table-column
|
|
|
|
+ label="当前状态"
|
|
|
|
+ prop="isProgressStatus"
|
|
|
|
+ align="center"
|
|
|
|
+ :formatter="statusFormatter"
|
|
|
|
+ />
|
|
|
|
+ <el-table-column
|
|
|
|
+ label="创建时间"
|
|
|
|
+ prop="createTime"
|
|
|
|
+ align="center"
|
|
|
|
+ show-overflow-tooltip
|
|
|
|
+ />
|
|
<el-table-column label="操作" align="center">
|
|
<el-table-column label="操作" align="center">
|
|
<template slot-scope="scope">
|
|
<template slot-scope="scope">
|
|
- <el-button type="text" @click="getDetail(scope.row, true)">查看</el-button>
|
|
|
|
|
|
+ <el-button type="text" @click="getDetail(scope.row, true)"
|
|
|
|
+ >查看</el-button
|
|
|
|
+ >
|
|
</template>
|
|
</template>
|
|
</el-table-column>
|
|
</el-table-column>
|
|
</el-table>
|
|
</el-table>
|
|
- <pagination v-show="total > 0" :total="total" :page.sync="dialogForm_list.pageNum"
|
|
|
|
- :limit.sync="dialogForm_list.pageSize" @pagination="getHistoryList" />
|
|
|
|
|
|
+ <pagination
|
|
|
|
+ v-show="total > 0"
|
|
|
|
+ :total="total"
|
|
|
|
+ :page.sync="dialogForm_list.pageNum"
|
|
|
|
+ :limit.sync="dialogForm_list.pageSize"
|
|
|
|
+ @pagination="getHistoryList"
|
|
|
|
+ />
|
|
</el-dialog>
|
|
</el-dialog>
|
|
</div>
|
|
</div>
|
|
</template>
|
|
</template>
|
|
|
|
|
|
<script>
|
|
<script>
|
|
-import { tabList, typeList, list, submit, listDetail, remove, history, timeChange } from '@/api/operation/recommend'
|
|
|
|
|
|
+import {
|
|
|
|
+history,
|
|
|
|
+list,
|
|
|
|
+listDetail,
|
|
|
|
+remove,
|
|
|
|
+submit,
|
|
|
|
+tabList,
|
|
|
|
+timeChange,
|
|
|
|
+typeList,
|
|
|
|
+} from "@/api/operation/recommend";
|
|
|
|
+import { dialogCallBack } from "@/utils/DialogUtil";
|
|
export default {
|
|
export default {
|
|
data() {
|
|
data() {
|
|
return {
|
|
return {
|
|
@@ -129,10 +277,10 @@ export default {
|
|
dialogForm: {},
|
|
dialogForm: {},
|
|
dialogForm_list: {
|
|
dialogForm_list: {
|
|
pageNum: 1,
|
|
pageNum: 1,
|
|
- pageSize: 10
|
|
|
|
|
|
+ pageSize: 10,
|
|
},
|
|
},
|
|
// 弹窗title
|
|
// 弹窗title
|
|
- title: '新增',
|
|
|
|
|
|
+ title: "新增",
|
|
// 弹窗列表
|
|
// 弹窗列表
|
|
dialogTableData: [],
|
|
dialogTableData: [],
|
|
// 总数据
|
|
// 总数据
|
|
@@ -143,117 +291,135 @@ export default {
|
|
typeOptions: [],
|
|
typeOptions: [],
|
|
// 校验
|
|
// 校验
|
|
rules: {
|
|
rules: {
|
|
- categoryId: [{
|
|
|
|
- required: true, message: '请选择导航', tigger: 'change'
|
|
|
|
- }],
|
|
|
|
- moduleTypeId: [{
|
|
|
|
- required: true, message: '请选择模块类型', tigger: 'change'
|
|
|
|
- }],
|
|
|
|
- sort: [{
|
|
|
|
- required: true, type: 'number', message: '请选择排序', tirgger: 'blur, change'
|
|
|
|
- }]
|
|
|
|
|
|
+ categoryId: [
|
|
|
|
+ {
|
|
|
|
+ required: true,
|
|
|
|
+ message: "请选择导航",
|
|
|
|
+ tigger: "change",
|
|
|
|
+ },
|
|
|
|
+ ],
|
|
|
|
+ moduleTypeId: [
|
|
|
|
+ {
|
|
|
|
+ required: true,
|
|
|
|
+ message: "请选择模块类型",
|
|
|
|
+ tigger: "change",
|
|
|
|
+ },
|
|
|
|
+ ],
|
|
|
|
+ sort: [
|
|
|
|
+ {
|
|
|
|
+ required: true,
|
|
|
|
+ type: "number",
|
|
|
|
+ message: "请选择排序",
|
|
|
|
+ tirgger: "blur, change",
|
|
|
|
+ },
|
|
|
|
+ ],
|
|
},
|
|
},
|
|
// 当前状态
|
|
// 当前状态
|
|
- statusOptions: [{
|
|
|
|
- value: 0,
|
|
|
|
- label: '生效中'
|
|
|
|
- }, {
|
|
|
|
- value: 1,
|
|
|
|
- label: '未生效'
|
|
|
|
- }, {
|
|
|
|
- value: 2,
|
|
|
|
- label: '未配置时间'
|
|
|
|
- }, {
|
|
|
|
- value: 3,
|
|
|
|
- label: '已失效'
|
|
|
|
- }],
|
|
|
|
|
|
+ statusOptions: [
|
|
|
|
+ {
|
|
|
|
+ value: 0,
|
|
|
|
+ label: "生效中",
|
|
|
|
+ },
|
|
|
|
+ {
|
|
|
|
+ value: 1,
|
|
|
|
+ label: "未生效",
|
|
|
|
+ },
|
|
|
|
+ {
|
|
|
|
+ value: 2,
|
|
|
|
+ label: "未配置时间",
|
|
|
|
+ },
|
|
|
|
+ {
|
|
|
|
+ value: 3,
|
|
|
|
+ label: "已失效",
|
|
|
|
+ },
|
|
|
|
+ ],
|
|
// 当前数据缓存
|
|
// 当前数据缓存
|
|
- index: null
|
|
|
|
- }
|
|
|
|
|
|
+ index: null,
|
|
|
|
+ };
|
|
},
|
|
},
|
|
mounted() {
|
|
mounted() {
|
|
- this.getTabList()
|
|
|
|
- this.getTypeList()
|
|
|
|
|
|
+ this.getTabList();
|
|
|
|
+ this.getTypeList();
|
|
},
|
|
},
|
|
methods: {
|
|
methods: {
|
|
// 导航列表
|
|
// 导航列表
|
|
getTabList() {
|
|
getTabList() {
|
|
- tabList().then(res => {
|
|
|
|
|
|
+ tabList().then((res) => {
|
|
if (res.code === 0) {
|
|
if (res.code === 0) {
|
|
res.data.map((i, index) => {
|
|
res.data.map((i, index) => {
|
|
- i.index = index
|
|
|
|
- i.hidden = true
|
|
|
|
- i.children = []
|
|
|
|
- })
|
|
|
|
- this.tabOptions = res.data
|
|
|
|
- this.tableData = res.data
|
|
|
|
|
|
+ i.index = index;
|
|
|
|
+ i.hidden = true;
|
|
|
|
+ i.children = [];
|
|
|
|
+ });
|
|
|
|
+ this.tabOptions = res.data;
|
|
|
|
+ this.tableData = res.data;
|
|
}
|
|
}
|
|
- })
|
|
|
|
|
|
+ });
|
|
},
|
|
},
|
|
|
|
|
|
// 模块列表
|
|
// 模块列表
|
|
getTypeList() {
|
|
getTypeList() {
|
|
- typeList().then(res => {
|
|
|
|
|
|
+ typeList().then((res) => {
|
|
if (res.code === 0) {
|
|
if (res.code === 0) {
|
|
- this.typeOptions = res.data
|
|
|
|
|
|
+ this.typeOptions = res.data;
|
|
}
|
|
}
|
|
- })
|
|
|
|
|
|
+ });
|
|
},
|
|
},
|
|
|
|
|
|
// 首次获取二级列表
|
|
// 首次获取二级列表
|
|
getList(row, index) {
|
|
getList(row, index) {
|
|
- let e = this.tableData[index]
|
|
|
|
- list(row.id).then(res => {
|
|
|
|
|
|
+ let e = this.tableData[index];
|
|
|
|
+ list(row.id).then((res) => {
|
|
if (res.code === 0) {
|
|
if (res.code === 0) {
|
|
if (res.data.length > 0) {
|
|
if (res.data.length > 0) {
|
|
- e.children = res.data
|
|
|
|
- e.hidden = false
|
|
|
|
|
|
+ e.children = res.data;
|
|
|
|
+ e.hidden = false;
|
|
this.$nextTick(() => {
|
|
this.$nextTick(() => {
|
|
- this.$refs.tableData.toggleRowExpansion(row, true)
|
|
|
|
- })
|
|
|
|
|
|
+ this.$refs.tableData.toggleRowExpansion(row, true);
|
|
|
|
+ });
|
|
} else {
|
|
} else {
|
|
- this.$message.warning('暂无模块!')
|
|
|
|
|
|
+ this.$message.warning("暂无模块!");
|
|
}
|
|
}
|
|
}
|
|
}
|
|
- })
|
|
|
|
|
|
+ });
|
|
},
|
|
},
|
|
|
|
|
|
// 提交二级
|
|
// 提交二级
|
|
getSubmit() {
|
|
getSubmit() {
|
|
this.$refs.dialogForm.validate((valid) => {
|
|
this.$refs.dialogForm.validate((valid) => {
|
|
if (valid) {
|
|
if (valid) {
|
|
- submit(this.dialogForm).then(res => {
|
|
|
|
|
|
+ submit(this.dialogForm).then((res) => {
|
|
if (res.code === 0) {
|
|
if (res.code === 0) {
|
|
- this.$message.success('提交成功')
|
|
|
|
- this.cancel()
|
|
|
|
- this.getList(this.tableData[this.index], this.index)
|
|
|
|
|
|
+ this.$message.success("提交成功");
|
|
|
|
+ this.cancel();
|
|
|
|
+ this.getList(this.tableData[this.index], this.index);
|
|
}
|
|
}
|
|
- })
|
|
|
|
|
|
+ });
|
|
} else {
|
|
} else {
|
|
- return false
|
|
|
|
|
|
+ return false;
|
|
}
|
|
}
|
|
- })
|
|
|
|
|
|
+ });
|
|
},
|
|
},
|
|
|
|
|
|
// 取消
|
|
// 取消
|
|
cancel() {
|
|
cancel() {
|
|
- this.dialogVisible = false
|
|
|
|
- this.$refs.dialogForm.resetFields()
|
|
|
|
- this.dialogForm = {}
|
|
|
|
|
|
+ this.dialogVisible = false;
|
|
|
|
+ this.$refs.dialogForm.resetFields();
|
|
|
|
+ this.dialogForm = {};
|
|
},
|
|
},
|
|
|
|
|
|
// 弹窗
|
|
// 弹窗
|
|
getDialog(title, row) {
|
|
getDialog(title, row) {
|
|
- this.index = this.tableData.findIndex(i => i.id == row.id)
|
|
|
|
- this.title = title
|
|
|
|
- this.dialogVisible = true
|
|
|
|
- this.dialogForm.categoryId = row.id
|
|
|
|
|
|
+ this.index = this.tableData.findIndex((i) => i.id == row.id);
|
|
|
|
+ this.title = title;
|
|
|
|
+ this.dialogVisible = true;
|
|
|
|
+ this.dialogForm.categoryId = row.id;
|
|
if (row.lv === 2) {
|
|
if (row.lv === 2) {
|
|
- listDetail(row.id).then(res => {
|
|
|
|
|
|
+ listDetail(row.id).then((res) => {
|
|
if (res.code === 0) {
|
|
if (res.code === 0) {
|
|
- this.dialogForm = res.data
|
|
|
|
|
|
+ this.dialogForm = res.data;
|
|
}
|
|
}
|
|
- })
|
|
|
|
|
|
+ });
|
|
}
|
|
}
|
|
},
|
|
},
|
|
|
|
|
|
@@ -261,55 +427,64 @@ export default {
|
|
getDetail(row, boolean) {
|
|
getDetail(row, boolean) {
|
|
this.$router.push({
|
|
this.$router.push({
|
|
path: `/operation/homePage/recommend/detail`,
|
|
path: `/operation/homePage/recommend/detail`,
|
|
- query: row.lv === 2 ? {
|
|
|
|
- secondId: row.id,
|
|
|
|
- moduleTypeId: row.moduleTypeId
|
|
|
|
- } : {
|
|
|
|
- threeId: row.id,
|
|
|
|
- moduleTypeId: row.moduleTypeId,
|
|
|
|
- boolean: boolean
|
|
|
|
- }
|
|
|
|
- })
|
|
|
|
|
|
+ query:
|
|
|
|
+ row.lv === 2
|
|
|
|
+ ? {
|
|
|
|
+ secondId: row.id,
|
|
|
|
+ moduleTypeId: row.moduleTypeId,
|
|
|
|
+ }
|
|
|
|
+ : {
|
|
|
|
+ threeId: row.id,
|
|
|
|
+ moduleTypeId: row.moduleTypeId,
|
|
|
|
+ boolean: boolean,
|
|
|
|
+ },
|
|
|
|
+ });
|
|
},
|
|
},
|
|
|
|
|
|
// 删除
|
|
// 删除
|
|
getDelete(row) {
|
|
getDelete(row) {
|
|
- this.$confirm(`是否删除?`, '提醒', {
|
|
|
|
- type: 'warning'
|
|
|
|
- }).then(() => {
|
|
|
|
- let index = this.tableData.findIndex(i => i.id == row.categoryId)
|
|
|
|
- remove(row.lv, row.id).then(res => {
|
|
|
|
- if (res.code === 0) {
|
|
|
|
- this.$message.success('删除成功!')
|
|
|
|
- this.getList(this.tableData[index], index)
|
|
|
|
- }
|
|
|
|
- })
|
|
|
|
- }).catch(() => { })
|
|
|
|
|
|
+ var that = this;
|
|
|
|
+ dialogCallBack(that, function () {
|
|
|
|
+ that
|
|
|
|
+ .$confirm(`是否删除?`, "提示:", {
|
|
|
|
+ type: "warning",
|
|
|
|
+ })
|
|
|
|
+ .then(() => {
|
|
|
|
+ let index = that.tableData.findIndex((i) => i.id == row.categoryId);
|
|
|
|
+ remove(row.lv, row.id).then((res) => {
|
|
|
|
+ if (res.code === 0) {
|
|
|
|
+ that.$message.success("删除成功!");
|
|
|
|
+ that.getList(that.tableData[index], index);
|
|
|
|
+ }
|
|
|
|
+ });
|
|
|
|
+ })
|
|
|
|
+ .catch(() => {});
|
|
|
|
+ });
|
|
},
|
|
},
|
|
|
|
|
|
// 历史记录
|
|
// 历史记录
|
|
getHistoryDialog(id) {
|
|
getHistoryDialog(id) {
|
|
- this.dialogVisible_list = true
|
|
|
|
- this.loading = true
|
|
|
|
- this.dialogForm_list.categoryId = id
|
|
|
|
- this.getHistoryList()
|
|
|
|
|
|
+ this.dialogVisible_list = true;
|
|
|
|
+ this.loading = true;
|
|
|
|
+ this.dialogForm_list.categoryId = id;
|
|
|
|
+ this.getHistoryList();
|
|
},
|
|
},
|
|
|
|
|
|
// 历史记录列表
|
|
// 历史记录列表
|
|
getHistoryList() {
|
|
getHistoryList() {
|
|
- history(this.dialogForm_list).then(res => {
|
|
|
|
|
|
+ history(this.dialogForm_list).then((res) => {
|
|
if (res.code === 0) {
|
|
if (res.code === 0) {
|
|
- this.dialogTableData = res.data.records
|
|
|
|
- this.total = res.data.total
|
|
|
|
- this.loading = false
|
|
|
|
|
|
+ this.dialogTableData = res.data.records;
|
|
|
|
+ this.total = res.data.total;
|
|
|
|
+ this.loading = false;
|
|
}
|
|
}
|
|
- })
|
|
|
|
|
|
+ });
|
|
},
|
|
},
|
|
|
|
|
|
// 搜索
|
|
// 搜索
|
|
getSearch() {
|
|
getSearch() {
|
|
- this.dialogForm_list.pageNum = 1
|
|
|
|
- this.getHistoryList()
|
|
|
|
|
|
+ this.dialogForm_list.pageNum = 1;
|
|
|
|
+ this.getHistoryList();
|
|
},
|
|
},
|
|
|
|
|
|
// 重置
|
|
// 重置
|
|
@@ -317,22 +492,22 @@ export default {
|
|
this.dialogForm_list = {
|
|
this.dialogForm_list = {
|
|
pageNum: 1,
|
|
pageNum: 1,
|
|
pageSize: 10,
|
|
pageSize: 10,
|
|
- categoryId: this.dialogForm_list.categoryId
|
|
|
|
- }
|
|
|
|
- this.getHistoryList()
|
|
|
|
|
|
+ categoryId: this.dialogForm_list.categoryId,
|
|
|
|
+ };
|
|
|
|
+ this.getHistoryList();
|
|
},
|
|
},
|
|
|
|
|
|
// 有效时间
|
|
// 有效时间
|
|
getChange(row) {
|
|
getChange(row) {
|
|
timeChange({
|
|
timeChange({
|
|
moduleId: row.id,
|
|
moduleId: row.id,
|
|
- timeList: row.rsDates
|
|
|
|
- }).then(res => {
|
|
|
|
|
|
+ timeList: row.rsDates,
|
|
|
|
+ }).then((res) => {
|
|
if (res.code === 0) {
|
|
if (res.code === 0) {
|
|
- this.$message.success('修改成功!')
|
|
|
|
- this.getTabList()
|
|
|
|
|
|
+ this.$message.success("修改成功!");
|
|
|
|
+ this.getTabList();
|
|
}
|
|
}
|
|
- })
|
|
|
|
|
|
+ });
|
|
},
|
|
},
|
|
|
|
|
|
// 复制
|
|
// 复制
|
|
@@ -341,21 +516,23 @@ export default {
|
|
path: `/operation/homePage/recommend/detail`,
|
|
path: `/operation/homePage/recommend/detail`,
|
|
query: {
|
|
query: {
|
|
copyId: row.id,
|
|
copyId: row.id,
|
|
- moduleTypeId: row.moduleTypeId
|
|
|
|
- }
|
|
|
|
- })
|
|
|
|
|
|
+ moduleTypeId: row.moduleTypeId,
|
|
|
|
+ },
|
|
|
|
+ });
|
|
},
|
|
},
|
|
|
|
|
|
// 字典翻译
|
|
// 字典翻译
|
|
statusFormatter(row) {
|
|
statusFormatter(row) {
|
|
- return this.selectDictLabel(this.statusOptions, row.isProgressStatus)
|
|
|
|
|
|
+ return this.selectDictLabel(this.statusOptions, row.isProgressStatus);
|
|
},
|
|
},
|
|
|
|
|
|
typeFormatter(row) {
|
|
typeFormatter(row) {
|
|
- return row.lv !== 1 ? this.typeOptions.find(i => i.typeId === row.moduleTypeId).typeName : ''
|
|
|
|
- }
|
|
|
|
- }
|
|
|
|
-}
|
|
|
|
|
|
+ return row.lv !== 1
|
|
|
|
+ ? this.typeOptions.find((i) => i.typeId === row.moduleTypeId).typeName
|
|
|
|
+ : "";
|
|
|
|
+ },
|
|
|
|
+ },
|
|
|
|
+};
|
|
</script>
|
|
</script>
|
|
|
|
|
|
<style lang="scss">
|
|
<style lang="scss">
|
|
@@ -366,4 +543,4 @@ export default {
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
-</style>
|
|
|
|
|
|
+</style>
|