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/system/role/index.vue | 38 +++++++++++++++++++++++--------------- 1 files changed, 23 insertions(+), 15 deletions(-) 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; } } -- Gitblit v1.9.3