From 616c910aff988ffcad936005aee6576771c82c70 Mon Sep 17 00:00:00 2001
From: 田源 <lastanimals@163.com>
Date: 星期一, 12 八月 2024 11:57:39 +0800
Subject: [PATCH] 1、列表普遍存在一个问题,如果点击列表行(不是checkbox),应该选中点击行,checkbox选中,其他行的checkbox取消,如果点击行的checkbox,则其他行的checkbox不变,当前点击行的checkbox选中状态切换。 2、部门管理单元格设置为左对齐

---
 Source/plt-web/plt-web-ui/src/views/modelingMenu/modeling/attributePool/option.js |    1 
 Source/plt-web/plt-web-ui/src/views/system/role/index.vue                         |   38 +++++++-----
 Source/plt-web/plt-web-ui/src/views/system/user/index.vue                         |   12 +++
 Source/plt-web/plt-web-ui/src/util/func.js                                        |   23 +++++++
 Source/plt-web/plt-web-ui/src/views/modelingMenu/modeling/attributePool/index.vue |   39 +++++++-----
 Source/plt-web/plt-web-ui/src/views/modelingMenu/modeling/linkType/index.vue      |   22 ++++++-
 Source/plt-web/plt-web-ui/src/views/modelingMenu/modeling/enumType/index.vue      |   12 +++-
 Source/plt-web/plt-web-ui/src/views/modelingMenu/modeling/statusPool/index.vue    |   14 +++-
 8 files changed, 119 insertions(+), 42 deletions(-)

diff --git a/Source/plt-web/plt-web-ui/src/util/func.js b/Source/plt-web/plt-web-ui/src/util/func.js
index 32bf2bd..03c02d3 100644
--- a/Source/plt-web/plt-web-ui/src/util/func.js
+++ b/Source/plt-web/plt-web-ui/src/util/func.js
@@ -4,6 +4,29 @@
 import CryptoJS from 'crypto-js'
 
 export default class func {
+
+  /**
+   * 鍗曢�夎〃鏍艰
+   * row 褰撳墠琛屾暟鎹�
+   * CrudRef 琛ㄦ牸ref缁戝畾鍊�
+   * lastIndex 鍒ゆ柇浜屾鐐瑰嚮index鏄惁鍜岀涓�娆$偣鍑讳竴鑷�
+   * setLastIndex 鏇存柊lastIndex鍊�
+   * setSelectList 灏嗕笅鎷夋淇濆瓨鏁扮粍缃┖
+   */
+
+  static rowClickHandler(row, CrudRef, lastIndex, setLastIndex, setSelectList) {
+    if (lastIndex === row.$index) {
+      setSelectList();
+      CrudRef.clearSelection();
+    } else {
+      setSelectList();
+      CrudRef.clearSelection();
+      CrudRef.toggleRowSelection(row);
+    }
+
+    setLastIndex(row.$index);
+  }
+
   /**
    * 涓嶄负绌�
    * @param val
diff --git a/Source/plt-web/plt-web-ui/src/views/modelingMenu/modeling/attributePool/index.vue b/Source/plt-web/plt-web-ui/src/views/modelingMenu/modeling/attributePool/index.vue
index 4842e75..2fdceb0 100644
--- a/Source/plt-web/plt-web-ui/src/views/modelingMenu/modeling/attributePool/index.vue
+++ b/Source/plt-web/plt-web-ui/src/views/modelingMenu/modeling/attributePool/index.vue
@@ -347,13 +347,13 @@
                 </el-form-item>
                 <el-form-item v-if="!form.enumSwitch" label="杩愮畻绗︼細">
                   <div>
-                    <el-button size="mini" @click="operationHandler('>')"> > </el-button>
-                    <el-button size="mini" @click="operationHandler('<')"> < </el-button>
-                    <el-button size="mini" @click="operationHandler('>=')"> >= </el-button>
-                    <el-button size="mini" @click="operationHandler('<=')"> <= </el-button>
-                    <el-button size="mini" @click="operationHandler('=')"> = </el-button>
-                    <el-button size="mini" @click="operationHandler('!=')"> != </el-button>
-                    <el-button size="mini" @click="operationHandler('()')"> () </el-button>
+                    <el-button size="mini" @click="operationHandler('>')"> ></el-button>
+                    <el-button size="mini" @click="operationHandler('<')"> <</el-button>
+                    <el-button size="mini" @click="operationHandler('>=')"> >=</el-button>
+                    <el-button size="mini" @click="operationHandler('<=')"> <=</el-button>
+                    <el-button size="mini" @click="operationHandler('=')"> =</el-button>
+                    <el-button size="mini" @click="operationHandler('!=')"> !=</el-button>
+                    <el-button size="mini" @click="operationHandler('()')"> ()</el-button>
                   </div>
                 </el-form-item>
                 <el-form-item :label="form.enumSwitch ? '褰撳墠鏋氫妇鍊硷細' : '褰撳墠鍊煎煙锛�'" prop="rangeValue">
@@ -371,16 +371,16 @@
                 </el-form-item>
                 <el-form-item label="杩愮畻绗︼細">
                   <div>
-                    <el-button size="mini" @click="operationHandler('>')"> > </el-button>
-                    <el-button size="mini" @click="operationHandler('<')"> < </el-button>
-                    <el-button size="mini" @click="operationHandler('>=')"> >= </el-button>
-                    <el-button size="mini" @click="operationHandler('<=')"> <= </el-button>
-                    <el-button size="mini" @click="operationHandler('=')"> = </el-button>
-                    <el-button size="mini" @click="operationHandler('!=')"> != </el-button>
-                    <el-button size="mini" @click="operationHandler('()')"> () </el-button>
+                    <el-button size="mini" @click="operationHandler('>')"> ></el-button>
+                    <el-button size="mini" @click="operationHandler('<')"> <</el-button>
+                    <el-button size="mini" @click="operationHandler('>=')"> >=</el-button>
+                    <el-button size="mini" @click="operationHandler('<=')"> <=</el-button>
+                    <el-button size="mini" @click="operationHandler('=')"> =</el-button>
+                    <el-button size="mini" @click="operationHandler('!=')"> !=</el-button>
+                    <el-button size="mini" @click="operationHandler('()')"> ()</el-button>
                   </div>
                 </el-form-item>
-                <el-form-item :label="form.enumSwitch ? '褰撳墠鏋氫妇鍊硷細' : '褰撳墠鍊煎煙锛�'"  prop="rangeValue">
+                <el-form-item :label="form.enumSwitch ? '褰撳墠鏋氫妇鍊硷細' : '褰撳墠鍊煎煙锛�'" prop="rangeValue">
                   <textarea v-model="form.rangeValue"
                             style="width: 330px; height: 80px; border: 1px solid #DCDFE6; overflow: auto; text-align: left;resize: none;">
                   </textarea>
@@ -649,6 +649,7 @@
       ],
       upFileType: ['xls', 'xlsx'],
       fileUrl: 'api/attributeController/importAttributes',
+      lastIndex: null
     }
   },
   computed: {
@@ -732,7 +733,13 @@
 
     // 鐐瑰嚮琛�
     rowClickHandler(row) {
-      this.$refs.userCrud.toggleRowSelection(row);
+      func.rowClickHandler(
+        row,
+        this.$refs.userCrud,
+        this.lastIndex,
+        (newIndex) => { this.lastIndex = newIndex; },
+        () => { this.selectList = []; }
+      );
     },
 
     // 鏉℃暟
diff --git a/Source/plt-web/plt-web-ui/src/views/modelingMenu/modeling/attributePool/option.js b/Source/plt-web/plt-web-ui/src/views/modelingMenu/modeling/attributePool/option.js
index 8111fba..695bd5a 100644
--- a/Source/plt-web/plt-web-ui/src/views/modelingMenu/modeling/attributePool/option.js
+++ b/Source/plt-web/plt-web-ui/src/views/modelingMenu/modeling/attributePool/option.js
@@ -23,5 +23,6 @@
   {
     label: '鎻忚堪',
     prop: 'description',
+    overHidden:true,
   },
 ];
diff --git a/Source/plt-web/plt-web-ui/src/views/modelingMenu/modeling/enumType/index.vue b/Source/plt-web/plt-web-ui/src/views/modelingMenu/modeling/enumType/index.vue
index 3908720..48f06c3 100644
--- a/Source/plt-web/plt-web-ui/src/views/modelingMenu/modeling/enumType/index.vue
+++ b/Source/plt-web/plt-web-ui/src/views/modelingMenu/modeling/enumType/index.vue
@@ -320,7 +320,8 @@
       },
       tableLoading: false,
       selectList: [],
-      searchParams: {}
+      searchParams: {},
+      lastIndex: null
     }
   },
   computed: {
@@ -366,13 +367,18 @@
 
     // 閫夋嫨妗�
     selectChange(row) {
-      console.log(row)
       this.selectList = row;
     },
 
     // 鐐瑰嚮琛�
     rowClickHandler(row) {
-      this.$refs.userCrud.toggleRowSelection(row);
+      func.rowClickHandler(
+        row,
+        this.$refs.userCrud,
+        this.lastIndex,
+        (newIndex) => { this.lastIndex = newIndex; },
+        () => { this.selectList = []; }
+      );
     },
 
     // 鍏抽棴瀵硅瘽妗�
diff --git a/Source/plt-web/plt-web-ui/src/views/modelingMenu/modeling/linkType/index.vue b/Source/plt-web/plt-web-ui/src/views/modelingMenu/modeling/linkType/index.vue
index 4acc188..706fd41 100644
--- a/Source/plt-web/plt-web-ui/src/views/modelingMenu/modeling/linkType/index.vue
+++ b/Source/plt-web/plt-web-ui/src/views/modelingMenu/modeling/linkType/index.vue
@@ -16,7 +16,8 @@
             </el-button>
             <el-button icon="el-icon-upload2" plain size="small" type="primary" @click="upLoadClickHandler">瀵煎叆
             </el-button>
-            <el-button class="smallBtn" style="padding-left: 7px !important;" icon="el-icon-circle-plus-outline" plain size="small"
+            <el-button class="smallBtn" icon="el-icon-circle-plus-outline" plain size="small"
+                       style="padding-left: 7px !important;"
                        type="primary" @click="createViewClickHandler">鍒涘缓瑙嗗浘
             </el-button>
             <el-button class="smallBtn" icon="el-icon-menu" plain size="small" style="padding-left: 1px"
@@ -659,6 +660,8 @@
         main: 'el-icon-warning-outline',
         desc: 'el-icon-chat-line-square'
       },
+      bizLastIndex: null,
+      attrLastIndex:null
     }
   },
   created() {
@@ -865,7 +868,14 @@
 
     // 娣诲姞灞炴�ф睜 琛岀偣鍑�
     dialogAttrRowClickHandler(row) {
-      this.$refs.dialogAttrCrud.toggleRowSelection(row);
+
+      func.rowClickHandler(
+        row,
+        this.$refs.dialogAttrCrud,
+        this.attrLastIndex,
+        (newIndex) => { this.attrLastIndex = newIndex; },
+        () => { this.selectList = []; }
+      );
     },
 
     // 娣诲姞灞炴�ф睜 鍏抽棴瀵硅瘽妗�
@@ -997,7 +1007,13 @@
 
     // form to 绫诲瀷琛岀偣鍑�
     bizTypeRowClick(row) {
-      this.$refs.bizTypeCrud.toggleRowSelection(row);
+      func.rowClickHandler(
+        row,
+        this.$refs.bizTypeCrud,
+        this.bizLastIndex,
+        (newIndex) => { this.bizLastIndex = newIndex; },
+        () => { this.selectList = []; }
+      );
     },
 
     // form to 绫诲瀷淇濆瓨
diff --git a/Source/plt-web/plt-web-ui/src/views/modelingMenu/modeling/statusPool/index.vue b/Source/plt-web/plt-web-ui/src/views/modelingMenu/modeling/statusPool/index.vue
index a771c4a..c1405f9 100644
--- a/Source/plt-web/plt-web-ui/src/views/modelingMenu/modeling/statusPool/index.vue
+++ b/Source/plt-web/plt-web-ui/src/views/modelingMenu/modeling/statusPool/index.vue
@@ -62,10 +62,14 @@
             <el-tag v-if="nodeRow.description">{{ nodeRow.description }}</el-tag>
           </el-descriptions-item>
         </el-descriptions>
+<!--        <avue-crud>-->
+<!--          :data="data"-->
+<!--          :option="option"-->
+<!--        </avue-crud>-->
       </basic-container>
     </el-main>
 
-    <!-- 鏂板 淇敼   -->
+    <!-- 鏂板 淇敼 -->
     <el-dialog
       v-dialogDrag
       :title="dialogTitle === 'add' ? '鍒涘缓' : '淇敼'"
@@ -100,11 +104,11 @@
         </span>
     </el-dialog>
 
-    <!-- 瀵煎叆    -->
+    <!-- 瀵煎叆 -->
     <upload-file ref="upload" :fileType="upFileType" :fileUrl="fileUrl" :tipList="tipList" title="瀵煎叆"
                  @updata="getTreeList"></upload-file>
 
-    <!-- 鏌ョ湅浣跨敤鑼冨洿    -->
+    <!-- 鏌ョ湅浣跨敤鑼冨洿 -->
     <el-dialog
       v-dialogDrag
       :visible.sync="checkViewVisible"
@@ -137,6 +141,10 @@
   name: "index",
   data() {
     return {
+      data:[],
+      option:{
+        ...basicOption
+      },
       checkViewVisible: false,
       checkViewData: [],
       checkViewDataSearch: [],
diff --git a/Source/plt-web/plt-web-ui/src/views/system/role/index.vue b/Source/plt-web/plt-web-ui/src/views/system/role/index.vue
index 06c3d4a..ab98e39 100644
--- a/Source/plt-web/plt-web-ui/src/views/system/role/index.vue
+++ b/Source/plt-web/plt-web-ui/src/views/system/role/index.vue
@@ -53,14 +53,15 @@
       </avue-crud>
       <div slot="footer" class="dialog-footer" style="display: flex;gap: 20px;justify-content: center">
         <div>
-          <el-tag>褰撳墠瑙掕壊鎬讳汉鏁�: {{this.countData.length}}</el-tag>
+          <el-tag>褰撳墠瑙掕壊鎬讳汉鏁�: {{ this.countData.length }}</el-tag>
         </div>
-        <el-button size="small" @click="statisticsVisible = false" icon="el-icon-close" type="danger">鍏� 闂�</el-button>
+        <el-button icon="el-icon-close" size="small" type="danger" @click="statisticsVisible = false">鍏� 闂�</el-button>
       </div>
     </el-dialog>
 
     <!-- 瀵煎叆瑙掕壊  -->
-    <upload-file ref="upload" :tipList="tipList" :fileType="upFileType" :fileUrl="fileUrl" @updata="getTableList" title="瀵煎叆瑙掕壊"></upload-file>
+    <upload-file ref="upload" :fileType="upFileType" :fileUrl="fileUrl" :tipList="tipList" title="瀵煎叆瑙掕壊"
+                 @updata="getTableList"></upload-file>
 
   </basic-container>
 </template>
@@ -77,6 +78,7 @@
 } from '@/api/system/role/api'
 import basicOption from "@/util/basic-option";
 import {column} from "@/views/system/role/option";
+import func from "@/util/func";
 
 export default {
   name: "index",
@@ -107,10 +109,10 @@
       countData: [],
       countOption: {
         ...basicOption,
-        selection:false,
+        selection: false,
         refreshBtn: false,
-        addBtn:false,
-        menu:false,
+        addBtn: false,
+        menu: false,
         column: [
           {
             label: '閮ㄩ棬',
@@ -137,7 +139,7 @@
       },
       upFileType: ['xls', 'xlsx'],
       fileUrl: 'api/roleQueryController/importRole',
-      tipList:["瑙掕壊瀵煎叆鍙湁 鍚嶇О 鍜� 鎻忚堪 涓ゅ垪锛屼笖鍚嶇О涓哄繀杈撻」涓嶈兘涓虹┖"]
+      tipList: ["瑙掕壊瀵煎叆鍙湁 鍚嶇О 鍜� 鎻忚堪 涓ゅ垪锛屼笖鍚嶇О涓哄繀杈撻」涓嶈兘涓虹┖"]
     }
   },
   methods: {
@@ -174,11 +176,17 @@
 
     // 琛屽崟閫�
     rowClickHandler(row) {
-      this.$refs.roleCrud.toggleRowSelection(row);
+      func.rowClickHandler(
+        row,
+        this.$refs.roleCrud,
+        this.lastIndex,
+        (newIndex) => { this.lastIndex = newIndex; },
+        () => { this.selectList = []; }
+      );
     },
 
     // 娣诲姞
-    rowSaveHandler(row, done,loading) {
+    rowSaveHandler(row, done, loading) {
       delete row.roleClassifyText;
       addRole(row).then(res => {
         console.log(res)
@@ -187,14 +195,14 @@
           this.getTableList();
           done();
         }
-      }).catch(err =>{
+      }).catch(err => {
         console.log(err);
         loading();
       })
     },
 
     // 缂栬緫
-    rowUpdateHandler(row, index, done,loading) {
+    rowUpdateHandler(row, index, done, loading) {
       delete row.roleClassifyText;
       updateRole(row).then(res => {
         if (res.data.code === 200) {
@@ -326,9 +334,9 @@
           this.countData = data.map(item => {
             return {
               pkDepartmentName: item.pkDepartmentName,
-              name:item.name,
-              id:item.id,
-              pkPersonName:this.selectList[0].name
+              name: item.name,
+              id: item.id,
+              pkPersonName: this.selectList[0].name
             }
           });
           this.statisticsVisible = true;
@@ -339,7 +347,7 @@
     },
 
     // 瀵煎叆瑙掕壊
-    upLoadRole(){
+    upLoadRole() {
       this.$refs.upload.visible = true;
     }
   }
diff --git a/Source/plt-web/plt-web-ui/src/views/system/user/index.vue b/Source/plt-web/plt-web-ui/src/views/system/user/index.vue
index 619ebf1..ee786da 100644
--- a/Source/plt-web/plt-web-ui/src/views/system/user/index.vue
+++ b/Source/plt-web/plt-web-ui/src/views/system/user/index.vue
@@ -172,6 +172,7 @@
           {
             label: '鍚嶇О',
             prop: 'name',
+            align:'left'
           },
           {
             label: '缂栧彿',
@@ -213,7 +214,8 @@
       leftRoleData: [],  // 鍒嗛厤瑙掕壊绌挎妗嗗乏渚у垵濮嬫暟鎹�
       rightRoleData: [], // 鍒嗛厤瑙掕壊绌挎妗嗗彸渚у垵濮嬫暟鎹�
       transferTitle: ['鐜版湁瑙掕壊', '鎷ユ湁瑙掕壊'],
-      tipList:["瀵煎叆妯℃澘涓爣鏄庣孩鑹插瓧浣撶殑涓哄繀杈撻」","閮ㄩ棬鍒椾笂涓嬬骇鍏崇郴蹇呴』鎸夌収鍙嶆枩鏉犻殧寮�(/)"]
+      tipList:["瀵煎叆妯℃澘涓爣鏄庣孩鑹插瓧浣撶殑涓哄繀杈撻」","閮ㄩ棬鍒椾笂涓嬬骇鍏崇郴蹇呴』鎸夌収鍙嶆枩鏉犻殧寮�(/)"],
+      lastIndex:null,
     }
   },
   created() {
@@ -311,7 +313,13 @@
 
     // 鐐瑰嚮琛�
     rowClickHandler(row) {
-      this.$refs.userCrud.toggleRowSelection(row);
+      func.rowClickHandler(
+        row,
+        this.$refs.userCrud,
+        this.lastIndex,
+        (newIndex) => { this.lastIndex = newIndex; },
+        () => { this.selectList = []; }
+      );
     },
 
     // 鍒嗛厤瑙掕壊

--
Gitblit v1.9.3