From e358d69fc18870584dd2d9f531910b7838ea27d9 Mon Sep 17 00:00:00 2001 From: wangting <wangting@vci-tech.com> Date: 星期四, 02 一月 2025 09:58:53 +0800 Subject: [PATCH] 调整行点击后的回调 --- Source/plt-web/plt-web-ui/src/views/system/user/index.vue | 141 +++++++++++++++++++++++++++++----------------- 1 files changed, 88 insertions(+), 53 deletions(-) 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 1f75a2b..5f92502 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 @@ -28,21 +28,37 @@ </template> <template #menu="{row,index,size}"> - <el-button icon="el-icon-edit" size="small" type="text" @click.stop="rowEditHandler(row,index)">缂栬緫</el-button> - <el-button icon="el-icon-delete" size="small" type="text" @click.stop="rowDeleteHandler(row)">鍒犻櫎</el-button> - <el-button size="small" type="text" @click.stop="stopUserHandler(row)"> + <el-button v-if="permissionList.editBtn" icon="el-icon-edit" size="small" type="text" + @click.stop="rowEditHandler(row,index)">缂栬緫 + </el-button> + <el-button v-if="permissionList.delBtn" icon="el-icon-delete" size="small" type="text" + @click.stop="rowDeleteHandler(row)">鍒犻櫎 + </el-button> + <el-button v-if="permissionList.stopActionBtn" size="small" type="text" @click.stop="stopUserHandler(row)"> <span v-if="row.status === 0" style="color: #fa3434"><i class="el-icon-video-pause"></i> 鍋滅敤</span> <span v-if="row.status === 1" style="color: #55b61d"><i class="el-icon-video-play"></i> 鍚敤</span> </el-button> </template> <template slot="menuLeft" slot-scope="scope"> - <el-button icon="el-icon-delete" plain size="small" type="danger" @click="allDelHandler">鍒犻櫎</el-button> - <el-button icon="el-icon-user" plain size="small" type="primary" @click="roleHandler">鍒嗛厤瑙掕壊</el-button> - <el-button icon="el-icon-school" plain size="small" type="primary" @click="departmentHandler">鍒嗛厤閮ㄩ棬</el-button> - <el-button icon="el-icon-key" plain size="small" type="success" @click="setPwsHandler">璁剧疆瀵嗙爜绛栫暐</el-button> - <el-button icon="el-icon-upload2" plain size="small" type="primary" @click="uploadUser">瀵煎叆浜哄憳</el-button> - <el-button icon="el-icon-download" plain size="small" type="primary" @click="downloadHandler">涓嬭浇瀵煎叆妯℃澘</el-button> + <el-button v-if="permissionList.editBtn" icon="el-icon-delete" plain size="small" type="danger" + @click="allDelHandler">鍒犻櫎 + </el-button> + <el-button v-if="permissionList.assigningRolesBtn" icon="el-icon-user" plain size="small" type="primary" + @click="roleHandler">鍒嗛厤瑙掕壊 + </el-button> + <el-button v-if="permissionList.distributionDepartmentBtn" icon="el-icon-school" plain size="small" + type="primary" @click="departmentHandler">鍒嗛厤閮ㄩ棬 + </el-button> + <el-button v-if="permissionList.setPasswordPolicyBtn" icon="el-icon-key" plain size="small" type="success" + @click="setPwsHandler">璁剧疆瀵嗙爜绛栫暐 + </el-button> + <el-button v-if="permissionList.importPersonnelBtn" icon="el-icon-upload2" plain size="small" type="primary" + @click="uploadUser">瀵煎叆浜哄憳 + </el-button> + <el-button v-if="permissionList.downloadImportTemplateBtn" icon="el-icon-download" plain size="small" + type="primary" @click="downloadHandler">涓嬭浇瀵煎叆妯℃澘 + </el-button> </template> </avue-crud> @@ -61,12 +77,11 @@ class="avue-dialog" style="margin-top: -15vh !important;" title="璁剧疆瀵嗙爜绛栫暐" - width="30%" + width="500px" > - <div class="password-strategy-container"> - <div><i class="el-icon-setting"/>璁剧疆瀵嗙爜绛栫暐锛�</div> - <el-select v-model="pwdValue" placeholder="璇烽�夋嫨瀵嗙爜绛栫暐"> + <div style="width:115px;"><i class="el-icon-setting"/>璁剧疆瀵嗙爜绛栫暐锛�</div> + <el-select v-model="pwdValue" placeholder="璇烽�夋嫨瀵嗙爜绛栫暐" style="width: 330px;"> <el-option v-for="(item,index) in pwdList" :key="index" :label="item.name" :value="item.id"></el-option> </el-select> </div> @@ -78,7 +93,8 @@ </el-dialog> <!-- 瀵煎叆浜哄憳 --> - <upload-file ref="upload" :tipList="tipList" :fileType="upFileType" :fileUrl="fileUrl" title="瀵煎叆浜哄憳" @updata="getTableList"></upload-file> + <upload-file ref="upload" :fileType="upFileType" :fileUrl="fileUrl" :tipList="tipList" title="瀵煎叆浜哄憳" + @updata="getTableList"></upload-file> <!-- 鍒嗛厤閮ㄩ棬瀵硅瘽妗� --> <el-dialog @@ -124,19 +140,20 @@ } from '@/api/system/user/api' import {column} from "./option" import func from '@/util/func' +import {mapGetters} from "vuex"; export default { name: "userManage", data: function () { return { - departSearchObj:{}, - departSearchValue:'', + departSearchObj: {}, + departSearchValue: '', loadKey: 0, departStatus: '', // 鍖哄垎涓嶅悓鏂瑰紡鎵撳紑閮ㄩ棬瀵硅瘽妗� departCurrenRow: {}, departOption: { ...basicOption, - addBtn:false, + addBtn: false, rowKey: 'oid', rowParentKey: 'parentId', selection: false, @@ -145,12 +162,12 @@ menu: false, refreshBtn: false, gridBtn: false, - header:false, + header: false, column: [ { label: '鍚嶇О', prop: 'name', - align:'left' + align: 'left' }, { label: '缂栧彿', @@ -173,14 +190,6 @@ pwdList: [], tableLoading: false, tableData: [], - option: { - ...basicOption, - editBtn: false, - delBtn: false, - dialogWidth: '50%', - calcHeight: -60, - column: column - }, page: { currentPage: 1, pageSize: 10, @@ -192,11 +201,36 @@ leftRoleData: [], // 鍒嗛厤瑙掕壊绌挎妗嗗乏渚у垵濮嬫暟鎹� rightRoleData: [], // 鍒嗛厤瑙掕壊绌挎妗嗗彸渚у垵濮嬫暟鎹� transferTitle: ['鐜版湁瑙掕壊', '鎷ユ湁瑙掕壊'], - tipList:["瀵煎叆妯℃澘涓爣鏄庣孩鑹插瓧浣撶殑涓哄繀杈撻」","閮ㄩ棬鍒椾笂涓嬬骇鍏崇郴蹇呴』鎸夌収鍙嶆枩鏉犻殧寮�(/)"], - lastIndex:null, + tipList: ["瀵煎叆妯℃澘涓爣鏄庣孩鑹插瓧浣撶殑涓哄繀杈撻」", "閮ㄩ棬鍒椾笂涓嬬骇鍏崇郴蹇呴』鎸夌収鍙嶆枩鏉犻殧寮�(/)"], + lastIndex: null, } }, - created() { + computed: { + ...mapGetters(["permission"]), + permissionList() { + return { + addBtn: this.vaildData(this.permission[this.$route.query.id].ADD, false), + delBtn: this.vaildData(this.permission[this.$route.query.id].DELETE, false), + editBtn: this.vaildData(this.permission[this.$route.query.id].EDIT, false), + assigningRolesBtn: this.vaildData(this.permission[this.$route.query.id].assigningRoles, false), + distributionDepartmentBtn: this.vaildData(this.permission[this.$route.query.id].distributionDepartment, false), + downloadImportTemplateBtn: this.vaildData(this.permission[this.$route.query.id].downloadImportTemplate, false), + importPersonnelBtn: this.vaildData(this.permission[this.$route.query.id].importPersonnel, false), + setPasswordPolicyBtn: this.vaildData(this.permission[this.$route.query.id].setPasswordPolicy, false), + stopActionBtn: this.vaildData(this.permission[this.$route.query.id].stopAction, false), + }; + }, + option() { + return { + ...basicOption, + addBtn: this.permissionList.addBtn, + editBtn: false, + delBtn: false, + dialogWidth: '50%', + calcHeight: -60, + column: column + } + } }, methods: { // 琛ㄦ牸璇锋眰 @@ -204,9 +238,10 @@ this.tableLoading = true; getDataUsers(this.page.currentPage, this.page.pageSize, this.searchParams).then(res => { const data = res.data.data; + data.map(item => {item.secretGrade = item.secretGrade.toString()}) this.tableData = data; this.page.total = res.data.total; - this.tableLoading = false; + this.tableLoading = false;s }) this.departmentQueryOnLoad() }, @@ -263,9 +298,7 @@ stopUser(params).then(res => { this.$message.success(res.data.obj); this.getTableList(); - }).catch(err => { - this.$message.error(err) - }) + }); }, // 閫夋嫨妗� @@ -279,8 +312,12 @@ row, this.$refs.userCrud, this.lastIndex, - (newIndex) => { this.lastIndex = newIndex; }, - () => { this.selectList = []; } + (newIndex) => { + this.lastIndex = newIndex; + }, + () => { + this.selectList = [row]; + } ); }, @@ -303,9 +340,7 @@ listRoleByUserOid(userOid).then(res => { this.rightRoleData = res.data.data.map(item => item.oid); }) - }).catch(err => { - this.$message.error(err) - }) + }); this.$refs.transfer.visible = true; }, @@ -318,9 +353,7 @@ saveRights(params).then(res => { this.$message.success(res.data.obj); this.getTableList(); - }).catch(err => { - this.$message.error(err) - }) + }); }, // 璁剧疆瀵嗙爜绛栫暐 @@ -352,13 +385,11 @@ saveUserPasswordStrateg(params).then(res => { this.pwdVisible = false; this.$message.success(res.data.obj) - }).catch(err => { - this.$message.error(err) - }) + }); }, // 鏂板 - rowSaveHandler(row, done,loading) { + rowSaveHandler(row, done, loading) { if (row.password != row.confirmPassword) { this.$message.error('璇锋鏌ヤ袱娆″瘑鐮佹槸鍚﹁緭鍏ヤ竴鑷达紒') return this.$refs.userCrud.$refs.dialogForm.$refs.tableForm.allDisabled = false; @@ -380,7 +411,7 @@ }, // 缂栬緫 - rowUpdateHandler(row, index, done,loading) { + rowUpdateHandler(row, index, done, loading) { if (row.password != row.confirmPassword) { this.$message.error('璇锋鏌ヤ袱娆″瘑鐮佹槸鍚﹁緭鍏ヤ竴鑷达紒') return this.$refs.userCrud.$refs.dialogForm.$refs.tableForm.allDisabled = false; @@ -477,11 +508,15 @@ departmentQueryController({queryAllLevel: true}).then(res => { const data = res.data.treeData; this.departData = this.departDtaFormAtter(data); - this.option.column[7].dicData=[{oid:'ALLDept',name:'鎵�鏈夐儴闂�',expand:true,disabled:true,children:this.departData}] - this.option.column[7].defaultExpandedKeys=['ALLDept']; - }).catch(err => { - this.$message.error(err); - }) + this.option.column[7].dicData = [{ + oid: 'ALLDept', + name: '鎵�鏈夐儴闂�', + expand: true, + disabled: true, + children: this.departData + }] + this.option.column[7].defaultExpandedKeys = ['ALLDept']; + }); }, // 鍒嗛厤閮ㄩ棬鏁版嵁杞崲 @@ -538,7 +573,7 @@ <style lang="scss" scoped> .password-strategy-container { - padding-left: 20px; + margin-bottom: 20px; display: flex; //justify-content: center; align-items: center; -- Gitblit v1.9.3