|
@@ -1,12 +1,14 @@
|
|
<template>
|
|
<template>
|
|
<div class="app-container">
|
|
<div class="app-container">
|
|
- <el-button type="primary" icon="el-icon-plus" size="mini" @click="dialogVisible = true">新增</el-button>
|
|
|
|
|
|
+ <el-button type="primary" icon="el-icon-plus" size="mini" @click="dialogVisible = true"
|
|
|
|
+ v-hasPermi="['operation:recommend:add']">新增</el-button>
|
|
<!-- 列表 -->
|
|
<!-- 列表 -->
|
|
<el-table :data="tableData" ref="tableData" row-key="id" :default-sort="{ prop: 'sort', order: 'ascending' }"
|
|
<el-table :data="tableData" ref="tableData" row-key="id" :default-sort="{ prop: 'sort', order: 'ascending' }"
|
|
:tree-props="{ children: 'children', hasChildren: 'hasChildren' }">
|
|
: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.$index)" />
|
|
|
|
|
|
+ <el-link v-if="scope.row.hidden" :underline="false" class="el-icon-arrow-right"
|
|
|
|
+ @click="getList(scope.row, scope.$index)" />
|
|
</template>
|
|
</template>
|
|
</el-table-column>
|
|
</el-table-column>
|
|
<el-table-column label="排序" align="center">
|
|
<el-table-column label="排序" align="center">
|
|
@@ -28,17 +30,20 @@
|
|
<template slot-scope="scope">
|
|
<template slot-scope="scope">
|
|
<el-date-picker v-if="scope.row.lv === 3" v-model="scope.row.rsDates" type="datetimerange"
|
|
<el-date-picker v-if="scope.row.lv === 3" v-model="scope.row.rsDates" type="datetimerange"
|
|
start-placeholder="开始日期" end-placeholder="结束日期" value-format="yyyy-MM-dd HH:mm:ss"
|
|
start-placeholder="开始日期" end-placeholder="结束日期" value-format="yyyy-MM-dd HH:mm:ss"
|
|
- @change="getChange(scope.row)" />
|
|
|
|
|
|
+ @change="getChange(scope.row)" :readonly="checkPermi(['operation:recommend:time'])" />
|
|
</template>
|
|
</template>
|
|
</el-table-column>
|
|
</el-table-column>
|
|
<el-table-column label="操作" align="center">
|
|
<el-table-column label="操作" align="center">
|
|
<template slot-scope="scope">
|
|
<template slot-scope="scope">
|
|
- <el-button v-if="scope.row.lv === 2" type="text" @click="getDetail(scope.row, '新增')">新增</el-button>
|
|
|
|
|
|
+ <el-button v-if="scope.row.lv === 2" type="text" @click="getDetail(scope.row, '新增')"
|
|
|
|
+ v-hasPermi="['operation:recommend:add']">新增</el-button>
|
|
<el-button v-if="scope.row.lv === 1" type="text" @click="getDialog(scope.row.id)">历史记录</el-button>
|
|
<el-button v-if="scope.row.lv === 1" type="text" @click="getDialog(scope.row.id)">历史记录</el-button>
|
|
<span v-else style="margin-left: 10px">
|
|
<span v-else style="margin-left: 10px">
|
|
<el-button type="text" @click="getOpen(scope.row, '查看', true)">查看</el-button>
|
|
<el-button type="text" @click="getOpen(scope.row, '查看', true)">查看</el-button>
|
|
- <el-button type="text" @click="getOpen(scope.row, '编辑')">编辑</el-button>
|
|
|
|
- <el-button type="delete" @click="getDelete(scope.row)">删除</el-button>
|
|
|
|
|
|
+ <el-button type="text" @click="getOpen(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>
|
|
</template>
|
|
</template>
|
|
</el-table-column>
|
|
</el-table-column>
|
|
@@ -97,11 +102,13 @@
|
|
<el-table-column label="当前状态" prop="status" align="center" :formatter="statusFormatter" />
|
|
<el-table-column label="当前状态" prop="status" align="center" :formatter="statusFormatter" />
|
|
<el-table-column label="创建时间" prop="createTime" align="center" />
|
|
<el-table-column label="创建时间" prop="createTime" align="center" />
|
|
<el-table-column label="操作" align="center">
|
|
<el-table-column label="操作" align="center">
|
|
- <template>
|
|
|
|
- <el-button type="text">查看</el-button>
|
|
|
|
|
|
+ <template slot-scope="scope">
|
|
|
|
+ <el-button type="text" @click="getOpen(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" />
|
|
</el-dialog>
|
|
</el-dialog>
|
|
</div>
|
|
</div>
|
|
</template>
|
|
</template>
|
|
@@ -109,6 +116,7 @@
|
|
<script>
|
|
<script>
|
|
import { tabList, typeList, list, submit, listDetail, remove, history, timeChange } from '@/api/operation/recommend'
|
|
import { tabList, typeList, list, submit, listDetail, remove, history, timeChange } from '@/api/operation/recommend'
|
|
import { currentMixin } from '@/mixin/index'
|
|
import { currentMixin } from '@/mixin/index'
|
|
|
|
+import { checkPermi } from '@/utils/permission'
|
|
export default {
|
|
export default {
|
|
mixins: [currentMixin],
|
|
mixins: [currentMixin],
|
|
data() {
|
|
data() {
|
|
@@ -130,6 +138,8 @@ export default {
|
|
title: '新增',
|
|
title: '新增',
|
|
// 弹窗列表
|
|
// 弹窗列表
|
|
dialogTableData: [],
|
|
dialogTableData: [],
|
|
|
|
+ // 总数据
|
|
|
|
+ total: 0,
|
|
// 导航栏
|
|
// 导航栏
|
|
tabOptions: [],
|
|
tabOptions: [],
|
|
// 模板类型
|
|
// 模板类型
|
|
@@ -269,6 +279,11 @@ export default {
|
|
this.dialogVisible_list = true
|
|
this.dialogVisible_list = true
|
|
this.loading = true
|
|
this.loading = true
|
|
this.dialogForm_list.categoryId = id
|
|
this.dialogForm_list.categoryId = id
|
|
|
|
+ this.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.dialogTableData = res.data.records
|
|
@@ -295,6 +310,9 @@ export default {
|
|
statusFormatter(row) {
|
|
statusFormatter(row) {
|
|
return this.selectDictLabel(this.currentOptions, row.status)
|
|
return this.selectDictLabel(this.currentOptions, row.status)
|
|
},
|
|
},
|
|
|
|
+
|
|
|
|
+ // 权限判断
|
|
|
|
+ checkPermi
|
|
}
|
|
}
|
|
}
|
|
}
|
|
</script>
|
|
</script>
|