Commit 4a461dd1 by swl

feat: gx

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