From a19d26e88360c9760b2286bac4dfb1710fd2fa21 Mon Sep 17 00:00:00 2001
From: xiejun <xj@2023>
Date: 星期六, 12 八月 2023 13:33:58 +0800
Subject: [PATCH] Merge remote-tracking branch 'origin/master'

---
 Source/UBCS-WEB/src/components/Master/MasterTree.vue |  101 +++++++++++++++++++++++++-------------------------
 1 files changed, 50 insertions(+), 51 deletions(-)

diff --git a/Source/UBCS-WEB/src/components/Master/MasterTree.vue b/Source/UBCS-WEB/src/components/Master/MasterTree.vue
index 71634a4..73dc835 100644
--- a/Source/UBCS-WEB/src/components/Master/MasterTree.vue
+++ b/Source/UBCS-WEB/src/components/Master/MasterTree.vue
@@ -8,38 +8,37 @@
 
 <script>
 import {getTreeList} from "@/api/MasterData/master";
-import {mapMutations, mapState} from "vuex";
-import {TableData,MasterTable} from "@/api/GetItem";
+import {TableData, MasterTable} from "@/api/GetItem";
 
 export default {
   name: "MasterTree",
-  props:{
-    pageSize:{
-      type:String,
-      default:"10"
+  props: {
+    pageSize: {
+      type: String,
+      default: "10"
     },
-    currentPage:{
-      type:String,
-      default:"1"
+    currentPage: {
+      type: String,
+      default: "1"
     },
-    templateOid:{
-      type:String,
-      default:''
+    templateOid: {
+      type: String,
+      default: ''
     },
   },
-  data(){
-    return{
-      idData:'',
-      masterVrBtnList:[],
-      tableHeadFindData:[],
-      tableHeadDataFateher:[],
-      templateOids:"",
-      tableDataArray:[],
-      codeClassifyOid:"",
-      coderuleoid:"",
-      CloneTreeAvueform:{},
-      loading:false,
-      Treedata:[],
+  data() {
+    return {
+      idData: '',
+      masterVrBtnList: [],
+      tableHeadFindData: [],
+      tableHeadDataFateher: [],
+      templateOids: "",
+      tableDataArray: [],
+      codeClassifyOid: "",
+      coderuleoid: "",
+      CloneTreeAvueform: {},
+      loading: false,
+      Treedata: [],
       nodeClickList: "",
       Treeoption: {
         addBtn: false,
@@ -52,15 +51,15 @@
         //   console.log(node)
         //   console.log(resolve)
         // }
-        treeLoad:function (node, resolve){
-          if(node.data != false){
+        treeLoad: function (node, resolve) {
+          if (node.data != false) {
             const parentId = (node.level === 0) ? 0 : node.data.oid;
             const parentBtmName = node.data.attributes.btmname
-            getTreeList({parentOid:parentId,parentBtmName:parentBtmName}).then(res=>{
-              resolve(res.data.map(item=>{
+            getTreeList({parentOid: parentId, parentBtmName: parentBtmName}).then(res => {
+              resolve(res.data.map(item => {
                 return {
                   ...item,
-                  label:item.text
+                  label: item.text
                 }
               }))
             })
@@ -72,23 +71,23 @@
   created() {
     this.getTreeLists()
   },
-  computed:{
-   },
-  methods:{
+  computed: {},
+  methods: {
     //鑾峰彇鏁版嵁
-    getTreeLists(){
+    getTreeLists() {
       const index = this.$route.query.id.indexOf('@');
       const result = this.$route.query.id.substring(0, index);
-      this.idData=result
+      this.idData = result
       // console.log(this.$route)
-      getTreeList({'conditionMap[id]':this.idData }).then(res=>{
-        this.Treedata=res.data;
+      getTreeList({'conditionMap[id]': this.idData}).then(res => {
+        this.Treedata = res.data;
         const [firstProperty] = res.data;
         this.ModifyProperties(this.Treedata, 'text', 'label');
-        this.codeClassifyOid=firstProperty.oid;
-        this.coderuleoid=firstProperty.attributes.coderuleoid;
-        this.$emit("coderuleoid", this.coderuleoid )
-      }).catch(res=>{
+        this.codeClassifyOid = firstProperty.oid;
+        this.coderuleoid = firstProperty.attributes.coderuleoid;
+        this.$emit("coderuleoid", this.coderuleoid)
+        this.$emit('Treedata', this.Treedata)
+      }).catch(res => {
         this.$message.error(res)
       })
     },
@@ -106,16 +105,16 @@
       }
     },
     //琛ㄦ牸鍒锋柊
-    TableRend(){
+    TableRend() {
       TableData({
         templateOid: this.templateOids,
         codeClassifyOid: this.nodeClickList.oid,
         page: this.currentPage,
         limit: this.pageSize,
       }).then(res => {
-        this.tableDataArray=res.data.data;
-        this.$emit('tableDataArray',this.tableDataArray)
-        this.$emit('total',res.data.total)
+        this.tableDataArray = res.data.data;
+        this.$emit('tableDataArray', this.tableDataArray)
+        this.$emit('total', res.data.total)
       })
     },
     //琛ㄦ牸澶撮儴
@@ -125,9 +124,9 @@
       return new Promise((resolve, reject) => {
         MasterTable({
           codeClassifyOid: this.nodeClickList.oid,
-          functionId:result,
+          functionId: result,
         }).then(res => {
-          const flagsToDeleteBtn = ["CODEIMPORTHISTORY", "CODEEXPORT", "CODEQUERY","batchApplyCode"];
+          const flagsToDeleteBtn = ["CODEIMPORTHISTORY", "CODEEXPORT", "CODEQUERY", "batchApplyCode"];
           //涓嶅悓鑺傜偣鏄剧ず涓嶅悓鎸夐挳
           if (!res.data.leaf) {
             this.masterVrBtnList = res.data.buttons.filter(obj => flagsToDeleteBtn.includes(obj.uniqueFlag));
@@ -160,12 +159,12 @@
     async nodeClick(data) {
       try {
         this.nodeClickList = data;
-        this.tableHeadDataFateher=[]
-        this.tableHeadFindData=[]
+        this.tableHeadDataFateher = []
+        this.tableHeadFindData = []
         await this.TableHeadRend(); // 鍏堟墽琛� TableHeadRend()
         this.TableRend(); // TableHeadRend() 鏂规硶瀹屾垚鍚庡啀鎵ц TableRend()
-        this.$emit('nodeClick',this.templateOids)
-        this.$emit("codeClassifyOid", this.nodeClickList.oid )
+        this.$emit('nodeClick', this.templateOids)
+        this.$emit("codeClassifyOid", this.nodeClickList.oid)
       } catch (error) {
         // 澶勭悊閿欒
         this.$message.error(error)

--
Gitblit v1.9.3