From ac7c4b4c9f2a56137431e9befa900ca792045bdb Mon Sep 17 00:00:00 2001
From: 田源 <lastanimals@163.com>
Date: 星期二, 11 七月 2023 18:11:40 +0800
Subject: [PATCH] 主数据 主题库 租户管理bug修复

---
 Source/UBCS-WEB/src/views/system/tenant.vue |  285 +++++++++++++++++++++++++++++---------------------------
 1 files changed, 146 insertions(+), 139 deletions(-)

diff --git a/Source/UBCS-WEB/src/views/system/tenant.vue b/Source/UBCS-WEB/src/views/system/tenant.vue
index 8cfa8c9..665513f 100644
--- a/Source/UBCS-WEB/src/views/system/tenant.vue
+++ b/Source/UBCS-WEB/src/views/system/tenant.vue
@@ -1,6 +1,6 @@
 <template>
   <basic-container>
-    <avue-crud :option="option"
+    <avue-crud :option="this.option"
                :table-loading="loading"
                :data="data"
                ref="crud"
@@ -13,6 +13,7 @@
                @row-save="rowSave"
                @search-change="searchChange"
                @search-reset="searchReset"
+               @row-click="clickRowChange"
                @selection-change="selectionChange"
                @current-change="currentChange"
                @size-change="sizeChange"
@@ -26,14 +27,6 @@
                    plain
                    @click="handleDelete">鍒� 闄�
         </el-button>
-        <el-tooltip class="item" effect="dark" content="缁欑鎴烽厤缃处鍙烽搴︺�佽繃鏈熸椂闂寸瓑鎺堟潈淇℃伅" placement="top">
-          <el-button size="small"
-                     plain
-                     v-if="userInfo.role_name.includes('administrator')"
-                     icon="el-icon-setting"
-                     @click="handleSetting">鎺堟潈閰嶇疆
-          </el-button>
-        </el-tooltip>
         <el-tooltip class="item" effect="dark" content="缁欑鎴烽厤缃嫭绔嬫暟鎹簮浠ュ疄鐜版暟鎹簱闅旂" placement="top">
           <el-button size="small"
                      plain
@@ -97,7 +90,7 @@
   remove,
   update,
   add,
-  setting,
+  // setting,
   datasource,
   packageInfo,
   packageSetting
@@ -122,116 +115,6 @@
         pageSize: 10,
         currentPage: 1,
         total: 0
-      },
-      option: {
-        height: 'auto',
-        calcHeight: 30,
-        tip: false,
-        searchShow: true,
-        searchMenuSpan: 6,
-        border: true,
-        index: true,
-        selection: true,
-        viewBtn: true,
-        dialogWidth: 900,
-        dialogClickModal: false,
-        column: [
-          {
-            label: "绉熸埛ID",
-            prop: "tenantId",
-            width: 100,
-            search: true,
-            addDisplay: false,
-            editDisplay: false,
-            span: 24,
-            rules: [{
-              required: true,
-              message: "璇疯緭鍏ョ鎴稩D",
-              trigger: "blur"
-            }]
-          },
-          {
-            label: "鍏ㄧО",
-            prop: "fullName",
-            width: 120,
-            span:24,
-            rules: [{
-              required: true,
-              message: "璇疯緭鍏ュ叏绉�",
-              trigger: "blur"
-            }]
-          },
-          {
-            label: "绉熸埛鍚嶇О",
-            prop: "tenantName",
-            search: true,
-            width: 180,
-            span: 24,
-            rules: [{
-              required: true,
-              message: "璇疯緭鍏ュ弬鏁板悕绉�",
-              trigger: "blur"
-            }]
-          },
-          {
-            label: "鑱旂郴浜�",
-            prop: "linkman",
-            width: 150,
-            search: true,
-            rules: [{
-              required: true,
-              message: "璇疯緭鍏ヨ仈绯讳汉",
-              trigger: "blur"
-            }]
-          },
-          {
-            label: "鑱旂郴鐢佃瘽",
-            prop: "contactNumber",
-            width: 150,
-          },
-          {
-            label: "鑱旂郴鍦板潃",
-            prop: "address",
-            span: 24,
-            minRows: 2,
-            type: "textarea",
-            hide: true,
-          },
-          {
-            label: '寮�鍚笁鍛�',
-            prop: 'ssaEnable',
-            type: 'radio',
-            width: 100,
-            value:0,
-            disabled:Boolean,
-            dicData: [{
-              label: '寮�鍚�',
-              value: 0
-            }, {
-              label: '涓嶅紑鍚�',
-              value: 1
-            },],
-          },
-          {
-            label: "缁戝畾鍩熷悕",
-            prop: "domainUrl",
-            span: 24,
-          },
-          {
-            label: "绯荤粺鑳屾櫙",
-            prop: "backgroundUrl",
-            type: 'upload',
-            listType: 'picture-img',
-            dataType: 'string',
-            action: '/api/ubcs-resource/oss/endpoint/put-file',
-            propsHttp: {
-              res: 'data',
-              url: 'link',
-            },
-            hide: true,
-            span: 24,
-          },
-        ]
       },
       data: [],
       settingForm: {},
@@ -304,14 +187,12 @@
           },
         ]
       },
+      BooleanFlag:Boolean,
     };
   },
 
   created() {
-    // 鑾峰彇鍒皌rue杩樻槸false鐩存帴璧嬪�硷紝瀹氫箟鏂规硶浼氬氨鏄幏鍙栦笉鍒帮紝涓嶇煡閬撲粈涔堥棶棰橈紝寮哄埗鐢↗SON.parse浼氬湪鍚庨潰杩藉姞涓�涓猟isabled锛屾墍浠ョ洿鎺ヨ幏鍙栥�傚悗鏈熷鏋滄坊鍔燾loumn浼氬嚭鐜癰ug锛岀敤foreach寰幆鍑篶olumn鍦ㄥ垽鏂璽ype鏄惁绛変簬radio锛岀劧鍚庡皢鍗曠嫭radio鐨刣isabled鏀逛负res.data.data
-    this.$axios.get('/api/ubcs-system/tenant/find-ssa-enable').then(res => {
-      this.option.column[6].disabled= res.data.data
-    });
+    this.initBoolean()
   },
   watch: {
     'packageForm.packageId'() {
@@ -342,9 +223,128 @@
     },
     tenantId() {
       return this.selectionList[0].tenantId;
+    },
+    option(){
+      return{
+          height: 'auto',
+          calcHeight: 30,
+          tip: false,
+          searchShow: true,
+          searchMenuSpan: 6,
+          border: true,
+          index: true,
+          selection: true,
+          viewBtn: true,
+          dialogWidth: 900,
+          dialogClickModal: false,
+          highlightCurrentRow: true, //琛岄�変腑鏃堕珮浜�
+          column: [
+            {
+              label: "绉熸埛ID",
+              prop: "tenantId",
+              width: 100,
+              search: true,
+              addDisplay: false,
+              editDisplay: false,
+              span: 24,
+              rules: [{
+                required: true,
+                message: "璇疯緭鍏ョ鎴稩D",
+                trigger: "blur"
+              }]
+            },
+            {
+              label: "鍏ㄧО",
+              prop: "fullName",
+              width: 120,
+              span:24,
+              rules: [{
+                required: true,
+                message: "璇疯緭鍏ュ叏绉�",
+                trigger: "blur"
+              }]
+            },
+            {
+              label: "绉熸埛鍚嶇О",
+              prop: "tenantName",
+              search: true,
+              width: 180,
+              span: 24,
+              rules: [{
+                required: true,
+                message: "璇疯緭鍏ュ弬鏁板悕绉�",
+                trigger: "blur"
+              }]
+            },
+            {
+              label: "鑱旂郴浜�",
+              prop: "linkman",
+              width: 150,
+              search: true,
+              rules: [{
+                required: true,
+                message: "璇疯緭鍏ヨ仈绯讳汉",
+                trigger: "blur"
+              }]
+            },
+            {
+              label: "鑱旂郴鐢佃瘽",
+              prop: "contactNumber",
+              width: 150,
+            },
+            {
+              label: "鑱旂郴鍦板潃",
+              prop: "address",
+              span: 24,
+              minRows: 2,
+              type: "textarea",
+              hide: true,
+            },
+            {
+              label: '寮�鍚笁鍛�',
+              prop: 'ssaEnable',
+              type: 'radio',
+              width: 100,
+              value:0,
+              disabled:this.BooleanFlag ,
+              dicData: [{
+                label: '寮�鍚�',
+                value: 0
+              }, {
+                label: '涓嶅紑鍚�',
+                value: 1
+              },],
+            },
+            {
+              label: "缁戝畾鍩熷悕",
+              prop: "domainUrl",
+              span: 24,
+            },
+            {
+              label: "绯荤粺鑳屾櫙",
+              prop: "backgroundUrl",
+              type: 'upload',
+              listType: 'picture-img',
+              dataType: 'string',
+              action: '/api/ubcs-resource/oss/endpoint/put-file',
+              propsHttp: {
+                res: 'data',
+                url: 'link',
+              },
+              hide: true,
+              span: 24,
+            },
+          ]
+      }
     }
   },
   methods: {
+    initBoolean(){
+      this.$axios.get('/api/ubcs-system/tenant/find-ssa-enable').then(res => {
+        this.BooleanFlag=res.data.data;
+        console.log('---',res)
+      });
+    },
     initData() {
       getMenuTree().then(res => {
         const column = this.findObject(this.packageOption.column, "menuId");
@@ -359,7 +359,7 @@
           message: "鎿嶄綔鎴愬姛!"
         });
         done();
-        console.log(done)
+        // console.log(done)
       }, error => {
         window.console.log(error);
         loading();
@@ -420,8 +420,15 @@
       this.onLoad(this.page, params);
       done();
     },
+    clickRowChange(row){
+      this.$refs.crud.toggleSelection();
+      this.selectionList = row;
+      this.$refs.crud.setCurrentRow(row);
+      this.$refs.crud.toggleRowSelection(row); //閫変腑褰撳墠琛�
+    },
     selectionChange(list) {
       this.selectionList = list;
+      this.$refs.crud.setCurrentRow(this.selectionList[list.length-1]);
     },
     selectionClear() {
       this.selectionList = [];
@@ -509,20 +516,20 @@
     handlePackageSetting() {
       this.packageSettingBox = true;
     },
-    handleSubmit(form, done, loading) {
-      setting(this.ids, form).then(() => {
-        this.onLoad(this.page);
-        this.$message({
-          type: "success",
-          message: "閰嶇疆鎴愬姛!"
-        });
-        done();
-        this.box = false;
-      }, error => {
-        window.console.log(error);
-        loading();
-      });
-    },
+    // handleSubmit(form, done, loading) {
+    //   setting(this.ids, form).then(() => {
+    //     this.onLoad(this.page);
+    //     this.$message({
+    //       type: "success",
+    //       message: "閰嶇疆鎴愬姛!"
+    //     });
+    //     done();
+    //     this.box = false;
+    //   }, error => {
+    //     window.console.log(error);
+    //     loading();
+    //   });
+    // },
     handleDatasourceSubmit(form, done, loading) {
       datasource(this.tenantId, form.datasourceId).then(() => {
         this.$message({

--
Gitblit v1.9.3