Commit 4a461dd1 by swl

feat: gx

parent b3ca14a7
......@@ -67,7 +67,7 @@ export function helpEnable(params) {
export function helpDetail(params) {
return api(
Object.assign(formatParams("GET"), {
url: "/admin-api/living-circle-mutual-aid/comment?infoId=" + params,
url: "/admin-api/living-circle-mutual-aid/infoDetail?infoId=" + params,
})
);
}
......
......@@ -160,9 +160,9 @@ import {
getCategory,
shopMenu,
enableCategory,
iconUpload,
editCategory,
addCategory,
iconUpload,
} from "@/api/livingCircle";
import TableTemplate from "@/components/Table";
......@@ -223,6 +223,7 @@ export default {
name: "",
sort: 1,
iconUrl: "",
iconUrl1: "",
menuId: "",
id: "",
},
......@@ -236,6 +237,7 @@ export default {
name: "",
sort: "",
iconUrl: "",
iconUrl1: "",
menuId: "",
id: "",
};
......@@ -253,10 +255,14 @@ export default {
});
},
beforeUpload() {},
upload(file) {
console.log("addCategory--->", 111);
this.dataForm.iconUrl = URL.createObjectURL(file.file);
iconUpload(file.file).then((res) => {
this.dataForm.iconUrl = res.data;
if (res.code == 200) {
this.dataForm.iconUrl1 = res.data;
this.$message.success("上传成功");
}
});
},
......@@ -268,7 +274,7 @@ export default {
pageSize: this.pagination.pageSize,
};
getCategory(params).then((res) => {
this.tableData = res.data?.list;
this.tableData = res.data?.list ? res.data.list : [];
this.pagination.total = res.data?.total;
});
},
......@@ -301,7 +307,14 @@ export default {
this.$refs.ruleForm.validate((valid) => {
if (valid) {
if (this.dataForm.id) {
editCategory(this.dataForm).then((res) => {
let params = {
id: this.dataForm.id,
name: this.dataForm.name,
sort: this.dataForm.sort,
iconUrl: this.dataForm.iconUrl1,
menuId: this.dataForm.menuId,
};
editCategory(params).then((res) => {
if (res.code == 200) {
this.$message.success("编辑成功");
this.dialogVisible = false;
......@@ -309,7 +322,13 @@ export default {
}
});
} else {
addCategory(this.dataForm).then((res) => {
let params = {
name: this.dataForm.name,
sort: this.dataForm.sort,
iconUrl: this.dataForm.iconUrl1,
menuId: this.dataForm.menuId,
};
addCategory(params).then((res) => {
if (res.code == 200) {
this.$message.success("新增成功");
this.dialogVisible = false;
......
......@@ -195,7 +195,8 @@ export default {
pageNum: this.pagination.currentPage,
};
getKeyword(params).then((res) => {
this.tableData = res.data.list;
this.tableData = res.data?.list ? res.data.list : [];
this.pagination.total = res.data?.total ? res.data.total : 0;
});
},
onSubmit() {
......
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