From b46cf401da847d7cca6269c6b2ffb04f6f72691a Mon Sep 17 00:00:00 2001
From: ludc
Date: 星期日, 14 五月 2023 03:57:37 +0800
Subject: [PATCH] 新增应用码段下的参照配置界面,以及代码整合

---
 Source/UBCS-WEB/src/views/omd/enum.vue |   67 +++++++++++++++++----------------
 1 files changed, 35 insertions(+), 32 deletions(-)

diff --git a/Source/UBCS-WEB/src/views/omd/dict.vue b/Source/UBCS-WEB/src/views/omd/enum.vue
similarity index 89%
rename from Source/UBCS-WEB/src/views/omd/dict.vue
rename to Source/UBCS-WEB/src/views/omd/enum.vue
index 9476deb..aebcd6e 100644
--- a/Source/UBCS-WEB/src/views/omd/dict.vue
+++ b/Source/UBCS-WEB/src/views/omd/enum.vue
@@ -49,7 +49,7 @@
         <el-tag>{{ row.isSealed === 0 ? '鍚�' : '鏄�' }}</el-tag>
       </template>
     </avue-crud>
-    <el-dialog :title="`[${dictValue}]鏋氫妇椤归厤缃甡"
+    <el-dialog :title="`[${name}]鏋氫妇椤归厤缃甡"
                append-to-body
                :visible.sync="box"
                width="1000px">
@@ -80,7 +80,7 @@
             icon="el-icon-delete"
             v-if="permission.dict_delete"
             plain
-            @click="handleDelete"
+            @click="handleDeleteChild"
           >鍒� 闄�
           </el-button>
         </template>
@@ -103,23 +103,23 @@
 </template>
 
 <script>
-  import {
-    getParentList,
-    getChildList,
-    remove,
-    update,
-    add,
-    getDict,
-    getDictTree
-  } from "@/api/omd/dict";
-  import {optionParent, optionChild} from "@/const/omd/dict";
+import {
+  getParentList,
+  getChildList,
+  remove,
+  update,
+  add,
+  getDict,
+  getDictTree, addChild, updateChild, getDictChild, removeChild
+} from "@/api/omd/enum";
+  import {optionParent, optionChild} from "@/const/omd/enum";
   import {mapGetters} from "vuex";
 
   export default {
     data() {
       return {
         dictValue: '鏆傛棤',
-        parentId: -1,
+        parentoid: -1,
         formParent: {},
         formChild: {},
         selectionList: [],
@@ -158,7 +158,7 @@
       ids() {
         let ids = [];
         this.selectionList.forEach(ele => {
-          ids.push(ele.id);
+          ids.push(ele.oid);
         });
         return ids.join(",");
       }
@@ -168,18 +168,20 @@
     },
     methods: {
       initData() {
-        getDictTree().then(res => {
-          const column = this.findObject(this.optionChild.column, "parentId");
+        getDictTree(this.pageParent.currentPage,
+                    this.pageParent.pageSize,
+                    this.query).then(res => {
+          const column = this.findObject(this.optionChild.column, "parentoid");
           column.dicData = res.data.data;
         });
       },
       handleAdd(row) {
-        this.formChild.dictValue = "";
-        this.formChild.dictKey = "";
+        this.formChild.value = "";
+        this.formChild.name = "";
         this.formChild.sort = 0;
         this.formChild.isSealed = 0;
         this.formChild.remark = "";
-        this.formChild.parentId = row.id;
+        this.formChild.parentoid = row.oid;
         this.$refs.crudChild.rowAdd();
       },
       rowSave(row, done, loading) {
@@ -220,7 +222,7 @@
           type: "warning"
         })
           .then(() => {
-            return remove(row.id);
+            return remove(row.oid);
           })
           .then(() => {
             this.onLoadParent(this.pageParent);
@@ -232,13 +234,13 @@
       },
       handleRowClick(row) {
         this.query = {};
-        this.parentId = row.id;
-        this.dictValue = row.dictValue;
+        this.parentId = row.oid;
+        this.name = row.name;
 
-        const code = this.findObject(this.optionChild.column, "code");
+        const code = this.findObject(this.optionChild.column, "value");
         code.value = row.code;
-        const parentId = this.findObject(this.optionChild.column, "parentId");
-        parentId.value = row.id;
+        // const parentoid = this.findObject(this.optionChild.column, "parentoid");
+        this.parentoid = row.oid;
 
         this.box = true;
         this.onLoadChild(this.pageChild);
@@ -284,7 +286,7 @@
       },
       beforeOpen(done, type) {
         if (["edit", "view"].includes(type)) {
-          getDict(this.formParent.id).then(res => {
+          getDict(this.formParent.oid).then(res => {
             this.formParent = res.data.data;
           });
         }
@@ -300,7 +302,8 @@
         this.onLoadParent(this.pageParent, this.query);
       },
       rowSaveChild(row, done, loading) {
-        add(row).then(() => {
+        row.parentoid = this.parentoid;
+        addChild(row).then(() => {
           this.onLoadChild(this.pageChild);
           this.$message({
             type: "success",
@@ -313,7 +316,7 @@
         });
       },
       rowUpdateChild(row, index, done, loading) {
-        update(row).then(() => {
+        updateChild(row).then(() => {
           this.onLoadChild(this.pageChild);
           this.$message({
             type: "success",
@@ -332,7 +335,7 @@
           type: "warning"
         })
           .then(() => {
-            return remove(row.id);
+            return removeChild(row.oid);
           })
           .then(() => {
             this.onLoadChild(this.pageChild);
@@ -370,7 +373,7 @@
           type: "warning"
         })
           .then(() => {
-            return remove(this.ids);
+            return removeChild(this.ids);
           })
           .then(() => {
             this.onLoadChild(this.pageChild);
@@ -386,7 +389,7 @@
           this.initData();
         }
         if (["edit", "view"].includes(type)) {
-          getDict(this.formChild.id).then(res => {
+          getDictChild(this.formChild.oid).then(res => {
             this.formChild = res.data.data;
           });
         }
@@ -429,7 +432,7 @@
         getChildList(
           page.currentPage,
           page.pageSize,
-          this.parentId,
+          this.parentoid,
           Object.assign(params, this.query)
         ).then(res => {
           this.dataChild = res.data.data;

--
Gitblit v1.9.3