Commit 460f50a4 by huaying

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

parent 4d9402d2
......@@ -52,10 +52,10 @@
<el-table-column prop="" label="操作">
<template slot-scope="scope">
<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>
</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>
</dm-delete>
</template>
......@@ -120,8 +120,7 @@ export default {
total: 0,
groupShow: false,
loadingBtn: false,
toppingNum: 0,
isEdit: false
toppingNum: 0
};
},
methods: {
......@@ -156,12 +155,12 @@ export default {
}
setTimeout(() => {
this.loading = false;
this.$message.success('操作成功!');
// this.$message.success('操作成功!');
}, 500);
// this.getTemplateSet(this.brandId);
// } else {
// this.$message.error(res.data.message);
// }
// } else {
// this.$message.error(res.data.message);
// }
// })
// .finally(() => {
// this.loading = false;
......@@ -349,9 +348,7 @@ export default {
handler: function(val) {
const that = this;
if (val) {
if (that.isEdit) {
that.getToppingNum(val);
}
that.getToppingNum(val);
}
},
deep: true
......@@ -359,7 +356,6 @@ export default {
},
mounted() {
const that = this;
that.isEdit = that.$route.query.templateId ? true : false;
that.$emit('showTab', '12');
if (that.brandId && !!that.$route.query.templateId) {
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