From 2ff8dd1f7d2f71944c25c9e116d12d9fb418ac0a Mon Sep 17 00:00:00 2001
From: ludc
Date: 星期三, 17 一月 2024 17:00:08 +0800
Subject: [PATCH] 分类授权数据授权界面编写与接口修改,分类数据查询接口修改

---
 Source/UBCS-WEB/src/components/Master/MasterTree.vue |   56 +++++++++++++++++++++++++++++++++-----------------------
 1 files changed, 33 insertions(+), 23 deletions(-)

diff --git a/Source/UBCS-WEB/src/components/Master/MasterTree.vue b/Source/UBCS-WEB/src/components/Master/MasterTree.vue
index 978e482..2dc9840 100644
--- a/Source/UBCS-WEB/src/components/Master/MasterTree.vue
+++ b/Source/UBCS-WEB/src/components/Master/MasterTree.vue
@@ -3,10 +3,13 @@
     <avue-tree ref="tree" v-model="CloneTreeAvueform" v-loading="loading" :data="Treedata" :defaultExpandAll="false"
                :option="Treeoption" style="width: fit-content;" @node-click="nodeClick">
       <template slot-scope="{ node }">
-        <span v-html="node.label"></span>
+        <el-tooltip :content="$createElement('div', { domProps: { innerHTML: node.label } })" class="item" effect="dark"
+                    open-delay="350" placement="right-start">
+          <span id="labelSize" v-html="node.label"></span>
+        </el-tooltip>
       </template>
     </avue-tree>
-    <div style="position: absolute; right: 0px; top: -1px;">
+    <div style="position: absolute; right: 3px; top: -1px;">
       <el-link class="refresh-icon" icon="el-icon-refresh" @click="getTreeLists"></el-link>
     </div>
   </div>
@@ -31,10 +34,6 @@
       type: String,
       default: ''
     },
-    isLoading:{
-      type: Boolean,
-      default:false
-    }
   },
   data() {
     return {
@@ -59,10 +58,6 @@
         defaultExpandAll: false,
         menu: false,
         lazy: true,
-        // treeLoad:function (node,resolve){
-        //   console.log(node)
-        //   console.log(resolve)
-        // }
         treeLoad: (node, resolve) => {
           if (node.data != false) {
             const parentId = (node.level === 0) ? 0 : node.data.oid;
@@ -106,15 +101,19 @@
     getTreeLists() {
       const index = this.$route.query.id.indexOf('@');
       const result = this.$route.query.id.substring(0, index);
-      this.idData = result
-      // console.log(this.$route)
-      getTreeList({'conditionMap[id]': this.idData}).then(res => {
+      this.idData = result;
+      this.removeList();
+      let conditionMaps = {};
+      conditionMaps["conditionMap[id]"] = this.idData;
+      conditionMaps["conditionMap[authType]"] = "data_auth";
+      // 鏁版嵁鎺堟潈涓槸鍚﹀叿澶囨煡鐪嬫潈闄�
+      conditionMaps["conditionMap[menuCode]"] = "data_view";
+      getTreeList(conditionMaps).then(res => {
         if (res) {
           if (res.data.length === 0) {
             this.$message.error("涓绘暟鎹垎绫绘煡璇负绌猴紒");
           } else {
             this.Treedata = res.data;
-
             const [firstProperty] = res.data;
             this.ModifyProperties(this.Treedata, 'text', 'label');
             this.referTreeId = firstProperty.attributes.btmTypeId;
@@ -128,15 +127,19 @@
             });
             this.$emit("coderuleoid", this.coderuleoid)
             this.$emit('Treedata', this.Treedata)
-            // console.log(this.Treedata)
           }
         }
       }).catch(res => {
-        // console.log(res)
         this.$message.error(res)
       });
     },
-
+    removeList() {
+      this.$emit('tableHeadDataFateher', []);
+      this.$emit('tableHeadFindData', []);
+      this.$emit('tableHeadBttoms', []);
+      this.$emit('tableDataArray', [])
+      this.$emit('total', null)
+    },
     //瀹氫箟涓�涓慨鏀规暟鎹睘鎬у悕鐨勬柟娉�
     ModifyProperties(obj, oldName, newName) {
       for (let key in obj) {
@@ -151,14 +154,17 @@
     },
     //琛ㄦ牸鍒锋柊
     TableRend() {
-      this.isLoading = true;
+      this.loading = true;
+      this.$emit('loading', this.loading)
       TableData({
         templateOid: this.templateOids,
         codeClassifyOid: this.nodeClickList.oid,
         page: this.currentPage,
         limit: this.pageSize,
       }).then(res => {
-        this.isLoading = false;
+        // console.log('tab',res)
+        this.loading = false;
+        this.$emit('loading', this.loading)
         this.tableDataArray = res.data.data;
         this.$emit('tableDataArray', this.tableDataArray)
         this.$emit('total', res.data.total)
@@ -187,10 +193,11 @@
           List.forEach(item => {
             let columnItem = {
               label: item.title,
-              prop: item.queryField,
+              prop: item.field,
               // type: this.columnType[item.type],
               sortable: item.sort,
-              width: item.minWidth
+              width: item.minWidth,
+              query: item.queryField
             };
             this.tableHeadFindData.push(Object.assign(item, columnItem))
           })
@@ -219,7 +226,6 @@
         this.$emit("codeClassifyOid", this.nodeClickList.oid)
         this.$emit("nodeClickList", this.nodeClickList)
       } catch (error) {
-        // 澶勭悊閿欒
         this.$message.error(error)
       }
     }
@@ -230,7 +236,7 @@
 <style lang="scss" scoped>
 .app {
   overflow: auto;
-  height: calc(100vh - 150px);
+  height: calc(100vh - 145px);
 }
 
 .app::-webkit-scrollbar {
@@ -254,4 +260,8 @@
   margin-left: 6px;
   font-size: 18px;
 }
+
+#labelSize {
+  font-size: 14px !important;
+}
 </style>

--
Gitblit v1.9.3