From 5c487e8208311bfd93a904bfdae2cfab0e9b2cd7 Mon Sep 17 00:00:00 2001
From: 田源 <lastanimals@163.com>
Date: 星期三, 07 六月 2023 18:10:35 +0800
Subject: [PATCH] Merge remote-tracking branch 'origin/master'

---
 Source/UBCS-WEB/src/views/MasterData/items.vue |  203 ++++++++++++++++++++++++++++++++++++++------------
 1 files changed, 153 insertions(+), 50 deletions(-)

diff --git a/Source/UBCS-WEB/src/views/MasterData/items.vue b/Source/UBCS-WEB/src/views/MasterData/items.vue
index 94b1072..a101488 100644
--- a/Source/UBCS-WEB/src/views/MasterData/items.vue
+++ b/Source/UBCS-WEB/src/views/MasterData/items.vue
@@ -2,71 +2,174 @@
     <el-container>
       <el-aside>
         <basic-container style="height: 85vh; max-height: 155vh; overflow-y: scroll;">
-          <avue-tree  :option="option" :data="data"  v-model="form" style="height: 80.5vh;padding-top: 5px;padding-bottom: 30px"></avue-tree>
+          <avue-tree ref="tree" v-model="CloneTreeAvueform" v-loading="loading" :data="Treedata" :defaultExpandAll="false"
+                     :option="Treeoption"
+                     style="height: 80.5vh;padding-top: 5px;padding-bottom: 30px"
+                     @node-click=" nodeClick"
+          ></avue-tree>
         </basic-container>
       </el-aside>
       <el-main>
-      <TableCrud></TableCrud>
+      <TableCrud :page="this.page" :templateOid="this.templateOid" :codeClassifyOid="this.codeClassifyOid"></TableCrud>
       </el-main>
     </el-container>
 </template>
 
 <script>
+import {getTreeList} from "@/api/MasterData/master"
 export default {
   name: "items.vue",
   data(){
     return{
-      form:{},
-      data:[
-        {
-          value:0,
-          label:'涓�绾ч儴闂�',
-          children:[
-            {
-              value:1,
-              label:'涓�绾ч儴闂�1',
-            },{
-              value:2,
-              label:'涓�绾ч儴闂�2',
-            }
-          ]
-        },{
-          value:3,
-          label:'浜岀骇閮ㄩ棬',
-          children:[
-            {
-              value:4,
-              label:'浜岀骇閮ㄩ棬1',
-            },{
-              value:5,
-              label:'浜岀骇閮ㄩ棬2',
-            }
-          ]
-        }
-      ],
-      option:{
-        title:'鎴戞槸鏍囬',
-        filterText:"鎼滅储鍏抽敭瀛楄嚜瀹氫箟",
-        defaultExpandAll:true,
-        addBtnText:'鏂板鑷畾涔夋枃妗�',
-        editBtnText:'淇敼鑷畾涔夋枃妗�',
-        delBtnText:'鍒犻櫎鑷畾涔夋枃妗�',
-        defaultExpandedKeys:[1],
-        height:900,
-        formOption:{
-          labelWidth:100,
-          column:[{
-            label:'鑷畾涔夐」',
-            prop:'label'
-          }],
+      // 鍒嗛〉
+      page: {
+        total: 0,
+        currentPage: 1,
+        pageSize: 10,
+        pageSizes: [10, 30, 50, 100, 200],
+      },
+      templateOid: "A12826E4-2B66-6D56-DE30-92BB1D7F607F",
+      codeClassifyOid: "D9CF223F-317D-71EB-BD11-433A94CAD9F3",
+      CloneTreeAvueform:{},
+      loading:false,
+      Treedata:[],
+      Treeoption: {
+        addBtn: false,
+        editBtn: false,
+        delBtn: false,
+        defaultExpandAll: false,
+        menu: false,
+        lazy: true,
+        // treeLoad:function (node,resolve){
+        //   console.log(node)
+        //   console.log(resolve)
+        // }
+        treeLoad:function (node, resolve){
+          if(node.loading){
+            const parentId = (node.level === 0) ? 0 : node.data.oid;
+            const parentBtmName = node.data.attributes.btmname
+            getTreeList({parentOid:parentId,parentBtmName:parentBtmName}).then(res=>{
+              console.log(res)
+            })
+          }
         },
-        props:{
-          labelText:'鏍囬',
-          label:'label',
-          value:'value',
-          children:'children'
+      },
+      nodeClickList: "",
+    }
+  },
+  created() {
+    // this.getAttr()
+    this.getTreeList()
+  },
+  methods:{
+    getTreeList(){
+      getTreeList({'conditionMap[id]': 'wupin'}).then(res=>{
+        this.Treedata=res.data
+        this.ModifyProperties(this.Treedata, 'text', 'label');
+        console.log(this.Treedata)
+      }).catch(res=>{
+        console.log(res)
+      })
+    },
+
+    //瀹氫箟涓�涓慨鏀规暟鎹睘鎬у悕鐨勬柟娉�
+    ModifyProperties(obj, oldName, newName) {
+      for (let key in obj) {
+        if (key === oldName) {
+          obj[newName] = obj[key];
+          delete obj[key];
+        }
+        if (typeof obj[key] === 'object') {
+          this.ModifyProperties(obj[key], oldName, newName);
         }
       }
+    },
+    //鏍戣妭鐐规坊鍔犳寜閽�
+    // TreeAdd() {
+    //   this.TreeAddFormVisible = true;
+    //   // 鍒ゆ柇褰撳墠鏄惁鏈夌偣鍑诲瓙椤�
+    //   if (this.nodeClickList !== "") {
+    //     this.TreeFlag = true
+    //   }
+    // },
+    // //鏍戣妭鐐规坊鍔犱簨浠�
+    // TreeAddHandler() {
+    //   const data = this.TreeAddform
+    //   this.$set(data, "parentCodeClassifyOid", this.nodeClickList.oid)
+    //   TreeSave(data).then(() => {
+    //     this.$message({
+    //       type: 'success',
+    //       message: '娣诲姞鎴愬姛!'
+    //     });
+    //     this.getAttr();
+    //     this.TreeAddFormVisible = false
+    //     this.TreeAddform = ""
+    //   }).catch(res => {
+    //     this.$message({
+    //       type: 'warning',
+    //       message: res
+    //     });
+    //   })
+    // },
+    //鏍戣妭鐐瑰垹闄ゆ寜閽�
+    // TreeDel() {
+    //   this.$confirm('鏄惁鍒犻櫎褰撳墠閫夋嫨鐨勫垎绫伙紝灏嗕細鎶婂瓙鍒嗙被涓�骞跺垹闄わ紝濡傛灉瀛樺湪缂栫爜鏁版嵁灏嗕笉鑳借鍒犻櫎锛屾槸鍚︾户缁紵', '鎻愮ず', {
+    //     confirmButtonText: '纭畾',
+    //     cancelButtonText: '鍙栨秷',
+    //     type: 'warning',
+    //     customClass: 'my-messagebox',
+    //   }).then(() => {
+    //     TreeCheckDel(this.nodeClickList).then(res => {
+    //       if (res.data.data) {
+    //         TreeDel(this.nodeClickList).then(() => {
+    //           this.$message({
+    //             type: 'success',
+    //             message: '鍒犻櫎鎴愬姛!'
+    //           });
+    //           this.getAttr();
+    //         }).catch(res => {
+    //           this.$message({
+    //             type: 'warning',
+    //             message: res
+    //           });
+    //         })
+    //       } else {
+    //         this.$confirm('褰撳墠鏁版嵁鍖呭惈鏈変笅绾ф暟鎹紝瑕佸垹闄ょ殑璇濅細鍜屼笅绾ф暟鎹竴璧峰垹闄わ紝浣犵‘璁ょ户缁�?', '鎻愮ず', {
+    //           confirmButtonText: '纭畾',
+    //           cancelButtonText: '鍙栨秷',
+    //           type: 'warning',
+    //           customClass: 'my-messageboxs',
+    //         }).then(() => {
+    //           TreeDel(this.nodeClickList).then(() => {
+    //             this.$message({
+    //               type: 'success',
+    //               message: '鍒犻櫎鎴愬姛!'
+    //             });
+    //             this.getAttr();
+    //           }).catch(res => {
+    //             this.$message({
+    //               type: 'warning',
+    //               message: res
+    //             });
+    //           })
+    //         }).catch(() => {
+    //           this.$message({
+    //             type: 'info',
+    //             message: '宸插彇娑堝垹闄�'
+    //           });
+    //         });
+    //       }
+    //     })
+    //   }).catch(() => {
+    //     this.$message({
+    //       type: 'info',
+    //       message: '宸插彇娑堝垹闄�'
+    //     });
+    //   });
+    // },
+    nodeClick(data){
+      this.nodeClickList = data
+      console.log(data)
     }
   }
 }

--
Gitblit v1.9.3