Commit 460f50a4 by huaying

fix: 新建编辑模板置顶逻辑

parent 4d9402d2
...@@ -52,10 +52,10 @@ ...@@ -52,10 +52,10 @@
<el-table-column prop="" label="操作"> <el-table-column prop="" label="操作">
<template slot-scope="scope"> <template slot-scope="scope">
<el-button type="text" @click="delRow(scope.$index, scope.row)">移除</el-button> <el-button type="text" @click="delRow(scope.$index, scope.row)">移除</el-button>
<dm-delete tips="确定置顶?" @confirm="isTopping(scope.$index, scope.row, 1)" v-if="isEdit && scope.row.topFlag == 0"> <dm-delete tips="确定置顶?" @confirm="isTopping(scope.$index, scope.row, 1)" v-if="toppingNum < 5 && scope.row.topFlag == 0">
<el-button type="text" style="padding: 0 14px" :disabled="toppingNum >= 5">置顶</el-button> <el-button type="text" style="padding: 0 14px" :disabled="toppingNum >= 5">置顶</el-button>
</dm-delete> </dm-delete>
<dm-delete tips="确定取消置顶?" @confirm="isTopping(scope.$index, scope.row, 0)" v-if="isEdit && scope.row.topFlag == 1"> <dm-delete tips="确定取消置顶?" @confirm="isTopping(scope.$index, scope.row, 0)" v-if="scope.row.topFlag == 1">
<el-button type="text">取消置顶</el-button> <el-button type="text">取消置顶</el-button>
</dm-delete> </dm-delete>
</template> </template>
...@@ -120,8 +120,7 @@ export default { ...@@ -120,8 +120,7 @@ export default {
total: 0, total: 0,
groupShow: false, groupShow: false,
loadingBtn: false, loadingBtn: false,
toppingNum: 0, toppingNum: 0
isEdit: false
}; };
}, },
methods: { methods: {
...@@ -156,7 +155,7 @@ export default { ...@@ -156,7 +155,7 @@ export default {
} }
setTimeout(() => { setTimeout(() => {
this.loading = false; this.loading = false;
this.$message.success('操作成功!'); // this.$message.success('操作成功!');
}, 500); }, 500);
// this.getTemplateSet(this.brandId); // this.getTemplateSet(this.brandId);
// } else { // } else {
...@@ -349,17 +348,14 @@ export default { ...@@ -349,17 +348,14 @@ export default {
handler: function(val) { handler: function(val) {
const that = this; const that = this;
if (val) { if (val) {
if (that.isEdit) {
that.getToppingNum(val); that.getToppingNum(val);
} }
}
}, },
deep: true deep: true
} }
}, },
mounted() { mounted() {
const that = this; const that = this;
that.isEdit = that.$route.query.templateId ? true : false;
that.$emit('showTab', '12'); that.$emit('showTab', '12');
if (that.brandId && !!that.$route.query.templateId) { if (that.brandId && !!that.$route.query.templateId) {
that.getTemplateSet(that.brandId); that.getTemplateSet(that.brandId);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment