Commit 9616571b authored by “yiyousong”'s avatar “yiyousong”

perf: 优化

parent 0ffce21d
...@@ -77,8 +77,8 @@ ...@@ -77,8 +77,8 @@
</div> </div>
</div> </div>
</template> </template>
<script> <script>
import { import {
addMatterInternet, addMatterInternet,
getMatterInternetList, getMatterInternetList,
...@@ -128,7 +128,10 @@ export default { ...@@ -128,7 +128,10 @@ export default {
} }
}, },
async handleSave() { async handleSave() {
console.log(this.arrType); if (!local.getLocal("matter")) {
this.$message.warning("请先新增基本信息");
return;
}
let arr = this.arrType.filter((v) => v); let arr = this.arrType.filter((v) => v);
arr.forEach((v) => { arr.forEach((v) => {
local.getLocal("matter").matterName local.getLocal("matter").matterName
...@@ -140,7 +143,6 @@ export default { ...@@ -140,7 +143,6 @@ export default {
: (v.matterId = ""); : (v.matterId = "");
}); });
let res = await addMatterInternet(arr); let res = await addMatterInternet(arr);
console.log(res);
let { code, msg } = res.data; let { code, msg } = res.data;
if (code == 1) { if (code == 1) {
this.$message.success(msg); this.$message.success(msg);
...@@ -149,22 +151,23 @@ export default { ...@@ -149,22 +151,23 @@ export default {
} }
}, },
async getList() { async getList() {
let res = await getMatterInternetList({ if (local.getLocal("matter")) {
matterId: local.getLocal("matter").id, let res = await getMatterInternetList({
}); matterId: local.getLocal("matter").id,
let { code, data } = res.data; });
if (code == 1) { let { code, data } = res.data;
this.arrType = data.data; if (code == 1) {
} else { this.arrType = data.data;
this.arrType = []; } else {
this.arrType = [];
}
} }
console.log(res);
}, },
}, },
}; };
</script> </script>
<style lang="less" scoped> <style lang="less" scoped>
.basicset-tab4 { .basicset-tab4 {
width: 100%; width: 100%;
height: 100%; height: 100%;
...@@ -235,4 +238,3 @@ export default { ...@@ -235,4 +238,3 @@ export default {
} }
} }
</style> </style>
\ No newline at end of file
...@@ -114,8 +114,15 @@ export default { ...@@ -114,8 +114,15 @@ export default {
dataIndex: "orgCode", dataIndex: "orgCode",
}, },
{ {
title: "备注", title: "状态",
dataIndex: "remark", dataIndex: "enabled",
customRender: (text) => {
if (text === 1) {
return <a-tag color="green">启用</a-tag>;
} else if (text === 0) {
return <a-tag color="red">停用</a-tag>;
}
},
}, },
{ {
title: "操作", title: "操作",
......
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