From 1f07eea84278e4a23f61f878dd43fae88cb55794 Mon Sep 17 00:00:00 2001
From: ludc
Date: 星期五, 06 十二月 2024 16:13:00 +0800
Subject: [PATCH] Merge remote-tracking branch 'origin/master'

---
 Source/plt-web/plt-web-ui/src/views/authority/ui/dataAuthorization/index.vue |  122 +++++++++++++++++++++++++++++++++-------
 1 files changed, 101 insertions(+), 21 deletions(-)

diff --git a/Source/plt-web/plt-web-ui/src/views/authority/ui/dataAuthorization/index.vue b/Source/plt-web/plt-web-ui/src/views/authority/ui/dataAuthorization/index.vue
index 54d9cd4..8a9012a 100644
--- a/Source/plt-web/plt-web-ui/src/views/authority/ui/dataAuthorization/index.vue
+++ b/Source/plt-web/plt-web-ui/src/views/authority/ui/dataAuthorization/index.vue
@@ -31,7 +31,7 @@
             <el-button icon="el-icon-plus" size="small" type="primary" @click="addHandler">娣诲姞</el-button>
             <el-button icon="el-icon-plus" size="small" type="primary" @click="editHandler">淇敼</el-button>
             <el-button icon="el-icon-delete" plain size="small" type="danger" @click="delHandler">鍒犻櫎</el-button>
-            <el-button icon="el-icon-view" plain size="small" type="primary" @click="chekView">鏌ョ湅鎺堟潈缁撴灉</el-button>
+            <el-button icon="el-icon-view" plain size="small" type="primary" @click="viewAuthHandler">鏌ョ湅鎺堟潈缁撴灉</el-button>
           </template>
         </avue-crud>
         <div style="margin-top: 15px;">
@@ -57,18 +57,18 @@
         <!-- 鏌ョ湅鎺堟潈缁撴灉    -->
         <el-dialog
           v-dialogDrag
-          :visible.sync="checkViewVisible"
+          :visible.sync="authResultVisible"
           append-to-body="true"
           class="avue-dialog"
-          title="鏌ョ湅浣跨敤鑼冨洿"
+          title="鏌ョ湅鎺堟潈缁撴灉"
           width="60%"
         >
           <el-form ref="form" :inline="true" size="mini" :model="form" label-width="80px">
-            <el-form-item label="涓氬姟瀵硅薄" prop="btmType">
-              <el-input v-model="form.btmType"></el-input>
+            <el-form-item label="涓氬姟瀵硅薄" prop="objectoid">
+              <el-input v-model="form.objectoid" style="width:300px;"></el-input>
             </el-form-item>
             <el-form-item>
-              <el-button type="primary" size="mini" @click="onSubmit">鏌ヨ涓氬姟瀵硅薄</el-button>
+              <el-button type="primary" @click="queryBtm" style="padding: 6px 15px;">鏌ヨ涓氬姟瀵硅薄</el-button>
             </el-form-item>
             <fieldset style="width: 99.5%">
               <legend>&nbsp;鐢ㄦ埛淇℃伅 </legend>
@@ -90,17 +90,31 @@
                 </el-form-item>
               </div>
             </fieldset>
-
+            <el-dialog
+              v-dialogDrag
+              :visible.sync="btmObjVisible"
+              append-to-body="true"
+              class="avue-dialog"
+              title="涓氬姟瀵硅薄鍒楄〃"
+              width="90%"
+            >
+              <avue-crud
+                ref="btmObjCrud"
+                :data="btmObjData"
+                :option="btmObjOption"
+                @current-row-change="btmObjClickHandler"
+              >
+              </avue-crud>
+            </el-dialog>
           </el-form>
           <fieldset style="width: 99.5%;margin-top: 10px;">
             <legend>&nbsp;鎺堟潈缁撴灉锛� </legend>
             <div>
               <avue-crud
-                ref="checkViewCrud"
-                :data="checkViewData"
-                :option="checkViewOption"
+                ref="authResultCrud"
+                :data="authResultData"
+                :option="authResultOption"
               >
-
               </avue-crud>
             </div>
           </fieldset>
@@ -116,7 +130,7 @@
 import {getBizTree} from "@/api/UI/uiDefine";
 import basicOption from "@/util/basic-option";
 import dataView from "./dataView";
-import {getData,saveGrand,delGrand,authResult} from "@/api/authority/ui/dataAuthor";
+import {getData,saveGrand,delGrand,authResult,queryBusiness} from "@/api/authority/ui/dataAuthor";
 import {listUserByUserType, listRoleByUserOid, listDeptByUserOid} from "@/api/system/user/api";
 import func from "@/util/func";
 export default {
@@ -169,7 +183,7 @@
       title: '',
       visible: false,
       form:{
-        btmType:'',
+        objectoid:'',
         userOid:'',
         roleOid:'',
         deptOid:''
@@ -185,8 +199,34 @@
         label:'',
         value:true
       }],
-      checkViewVisible:false,
-
+      authResultVisible:false,
+      authResultData:[],
+      authResultOption:{
+        ...basicOption,
+        height:300,
+        tip: false,
+        index:false,
+        selection:false,
+        menu:false,
+        header:false,
+        column: [{
+          label: '鍚嶇О',
+          prop: 'name',
+          overHidden: true
+        }]
+      },
+      //涓氬姟瀵硅薄鍒楄〃
+      btmObjVisible:false,
+      btmObjData:[],
+      btmObjOption:{
+        ...basicOption,
+        height:500,
+        tip: false,
+        selection:false,
+        menu:false,
+        header:false,
+        column: []
+      }
     }
   },
   created() {
@@ -264,7 +304,7 @@
               label: item,
               prop: i,
               overHidden: true,
-              width:'auto',
+              width:(this.stringLength(item) *6+35)+'px',
               html:true,
               formatter:(val)=> {
                 return '<label class="el-checkbox is-disabled ' + (val[i] == true ? 'is-checked' : '') + '"><span class="el-checkbox__input is-disabled ' + (val[i] == true ? 'is-checked' : '') + '"><span class="el-checkbox__inner"></span><input type="checkbox" aria-hidden="false" class="el-checkbox__original" value="' + val[i] + '"></span></label>'
@@ -276,7 +316,20 @@
         this.tableLoading = false;
         this.actionMap=res.data.obj.actionMap;
         this.$refs.crud.setCurrentRow( );
+
       })
+    },
+    stringLength(str) {
+      let len = 0;
+      for (let i = 0; i < str.length; i++) {
+        let code = str.charCodeAt(i);
+        if (code >= 0 && code <= 127) {
+          len += 1; // 鑻辨枃瀛楃
+        } else {
+          len += 2; // 涓枃瀛楃
+        }
+      }
+      return len;
     },
     handleRefresh() {
       this.getTableList();
@@ -375,12 +428,12 @@
     },
 
     // 鏌ョ湅鎺堟潈缁撴灉
-    chekView() {
+    viewAuthHandler() {
       if (func.isEmptyObject(this.nodeRow)) {
         this.$message.warning('璇烽�夋嫨绫诲瀷鏍戜俊鎭�');
         return;
       }
-      this.checkViewVisible = true;
+      this.authResultVisible = true;
       listUserByUserType({type:1}).then(res => {
         // 缁勮濂界┛姊鍙敤鏁版嵁
         this.userDic = res.data.data;
@@ -390,13 +443,40 @@
           this.form.userOid=''
         }
       })
-
-      authResult({biztype: this.nodeRow.attributes.name,objectoid:''}).then(res => {
+      this.getAuthResultData()
+    },
+    getAuthResultData(){
+      authResult({biztype: this.nodeRow.attributes.name,objectoid:this.form.objectoid}).then(res => {
         if (res.data.code === 200) {
-          this.checkViewData = res.data.data;
+          this.authResultData = res.data.data;
         }
       })
     },
+    //鏌ヨ涓氬姟瀵硅薄
+    queryBtm(){
+      queryBusiness({btmName: this.nodeRow.attributes.name,boFlag:true,btmType:'btm'}).then(res => {
+        if (res.data.code === 200) {
+          if(res.data.obj.tableHeader){
+            this.btmObjOption.column=[];
+            res.data.obj.tableHeader.forEach((item,i)=>{
+              this.btmObjOption.column.push({
+                label: item,
+                prop: i,
+                overHidden: true,
+                width:(this.stringLength(item) *8+30)+'px',
+              })
+            })
+          }
+          this.btmObjData = res.data.obj.tableValues;
+        }
+      })
+      this.btmObjVisible=true;
+    },
+    btmObjClickHandler(row){
+      this.form.objectoid=row[0];
+      this.getAuthResultData()
+      this.btmObjVisible=false;
+    }
   }
 }
 </script>

--
Gitblit v1.9.3