This commit is contained in:
2024-03-26 10:50:56 +08:00
parent a8bad4ff3d
commit 7c19fb5e4d
3 changed files with 27 additions and 79 deletions

View File

@@ -411,37 +411,7 @@ export default {
// return;
// }
},
async remove(data) {
var ids = { productId: data.productId };
this.$confirm(`是否删除标签【${data.title}】?`, "提示", {
confirmButtonText: "确定",
cancelButtonText: "取消",
type: "warning",
})
.then(async () => {
this.$http({
url: this.$http.adornUrl(
`/book/labelAndMarket/delLabel?id=` + data.id
),
method: "post",
data: {},
}).then(async ({ data }) => {
this.$message({
type: "success",
message: "删除成功!",
});
this.currentNode = null;
this.isFresh = false;
this.addForm = {};
this.$nextTick(() => {
this.isFresh = true;
});
await this.addOrUpdateHandle();
// this.expandedkey = [node.parent.data.catId]
});
})
.catch(() => {});
},
filterNode(value, data) {
if (!value) return true;
return data.title.indexOf(value) !== -1;

View File

@@ -1,7 +1,7 @@
<template>
<div class="mod-config">
<commonTree
source="tags"
source="tags"
ref="commonTree"
:dataList="treeDataList"
@getCommonShopDataList="getCommonShopDataList"
@@ -30,6 +30,8 @@
style="width: 100%"
v-model="addForm.sort"
clearable
@keyup.native="UpNumber"
@keydown.native="UpNumber"
>
</el-input-number>
</el-form-item>
@@ -224,6 +226,10 @@ export default {
this.getDataList();
},
methods: {
// 只可输入数字
UpNumber(e) {
e.target.value = e.target.value.replace(/[^\d]/g, "");
},
dataFormEdit() {
this.checkAll = false;
this.isEdit = !this.isEdit;
@@ -233,7 +239,7 @@ export default {
this.$refs.commonShop.handleCheckAllChange(val);
});
},
handleSubmitShopTable: debounce(async function (ids) {
handleSubmitShopTable: debounce(async function (ids) {
await this.$http({
url: this.$http.adornUrl(`${this.urlList.saveShop}`),
method: "post",
@@ -252,7 +258,7 @@ export default {
this.$message.error(data.msg);
}
});
},200),
}, 200),
openTable() {
this.isEdit = false;
this.$nextTick(() => {
@@ -284,7 +290,7 @@ export default {
},
//新增修改
dataFormSubmit: debounce(async function (formName) {
dataFormSubmit: debounce(async function (formName) {
// return false
if (this.addForm.title == "") {
this.$message.error("请输入标签名称");
@@ -319,9 +325,9 @@ export default {
});
}
});
},200),
}, 200),
//新增修改
dataFormDelete: debounce(async function (formName) {
dataFormDelete: debounce(async function (formName) {
// return false
var selectShopArr = this.$refs.commonShop.selectShopArr;
console.log(selectShopArr, "1111");
@@ -349,7 +355,7 @@ export default {
this.$message.error(data.msg);
}
});
},200),
}, 200),
setCheckedKeys() {
this.$refs.tree.setCheckedKeys([0]);
},
@@ -409,37 +415,7 @@ export default {
// return;
// }
},
async remove(data) {
var ids = { productId: data.productId };
this.$confirm(`是否删除标签【${data.title}】?`, "提示", {
confirmButtonText: "确定",
cancelButtonText: "取消",
type: "warning",
})
.then(async () => {
this.$http({
url: this.$http.adornUrl(
`/book/labelAndMarket/delLabel?id=` + data.id
),
method: "post",
data: {},
}).then(async ({ data }) => {
this.$message({
type: "success",
message: "删除成功!",
});
this.currentNode = null;
this.isFresh = false;
this.addForm = {};
this.$nextTick(() => {
this.isFresh = true;
});
await this.addOrUpdateHandle();
// this.expandedkey = [node.parent.data.catId]
});
})
.catch(() => {});
},
filterNode(value, data) {
if (!value) return true;
return data.title.indexOf(value) !== -1;
@@ -695,7 +671,6 @@ export default {
await this.$http({
url: this.$http.adornUrl(this.urlList.treeList),
method: "get",
}).then(({ data }) => {
console.log("🚀 ~ getDataList ~ data:", data);
if (data && data.code === 0) {

View File

@@ -395,6 +395,7 @@ export default {
// }
},
async remove(data) {
var that=this;
var ids = { productId: data.productId };
this.$confirm(`是否删除标签【${data.title}】?`, "提示", {
confirmButtonText: "确定",
@@ -402,22 +403,24 @@ export default {
type: "warning",
})
.then(async () => {
this.$http({
url: this.$http.adornUrl(`${urlList.delete}?id=` + data.id),
that.$http({
url: that.$http.adornUrl(`${that.urlList.delete}?id=` + data.id),
method: "post",
data: {},
}).then(async ({ data }) => {
this.$message({
that.$message({
type: "success",
message: "删除成功!",
});
this.currentNode = null;
this.isFresh = false;
this.addForm = {};
this.$nextTick(() => {
this.isFresh = true;
that.currentNode = null;
that.isFresh = false;
that.addForm = {};
that.$nextTick(() => {
that.isFresh = true;
});
await this.addOrUpdateHandle();
await that.addOrUpdateHandle();
// this.expandedkey = [node.parent.data.catId]
});
})