From 354cad3d3ab22ba147169beb6a0f6f51b9bab3a8 Mon Sep 17 00:00:00 2001 From: wangting <wangting@vci-tech.com> Date: 星期三, 08 一月 2025 09:07:22 +0800 Subject: [PATCH] Merge remote-tracking branch 'origin/master' --- Source/plt-web/plt-web-ui/src/views/authority/ui/dataAuthorization/index.vue | 156 ++++++++++++++++++++++++++++++++++++++++++--------- 1 files changed, 128 insertions(+), 28 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..23e05b4 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 @@ -7,8 +7,8 @@ <div style="height: calc(100vh - 190px);"> <avue-tree :data="treeData" :option="treeOption" @node-click="nodeClick"> <span slot-scope="{ node, data }" class="el-tree-node__label"> - <span style="font-size: 15px"> - <i class="el-icon-s-promotion"></i> + <span> + <icon-show :name="data.icon"></icon-show> {{ (node || {}).label }} </span> </span> @@ -28,10 +28,19 @@ @refresh-change="handleRefresh" @current-row-change="rowClickHandler"> <template slot="menuLeft"> - <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 v-if="permissionList.addBtn" class="button-custom-icon" size="small" type="primary" @click="addHandler"> + <icon-show :name="permissionList.addBtn.source"></icon-show> + 娣诲姞 + </el-button> + <el-button v-if="permissionList.editBtn" class="button-custom-icon" size="small" type="primary" @click="editHandler"> + <icon-show :name="permissionList.editBtn.source"></icon-show> + 淇敼 + </el-button> + <el-button v-if="permissionList.delBtn" class="button-custom-icon" plain size="small" type="danger" @click="delHandler"> + <icon-show :name="permissionList.delBtn.source"></icon-show> + 鍒犻櫎 + </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 +66,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> 鐢ㄦ埛淇℃伅 </legend> @@ -90,17 +99,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> 鎺堟潈缁撴灉锛� </legend> <div> <avue-crud - ref="checkViewCrud" - :data="checkViewData" - :option="checkViewOption" + ref="authResultCrud" + :data="authResultData" + :option="authResultOption" > - </avue-crud> </div> </fieldset> @@ -116,9 +139,10 @@ 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"; +import {mapGetters} from "vuex"; export default { name: "index", components:{dataView}, @@ -169,7 +193,7 @@ title: '', visible: false, form:{ - btmType:'', + objectoid:'', userOid:'', roleOid:'', deptOid:'' @@ -185,9 +209,45 @@ 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: [] + } } + }, + 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), + }; + }, }, created() { this.getTreeList(); @@ -195,7 +255,7 @@ watch:{ 'form.userOid':{ handler(val) { - if(val){ + /*if(val){ listRoleByUserOid(val).then(res => { // 缁勮濂界┛姊鍙敤鏁版嵁 this.roleDic = res.data.data; @@ -218,7 +278,7 @@ this.deptDic=[]; this.form.roleOid='' this.form.deptOid=''; - } + }*/ }, immediate: true, deep: true @@ -264,7 +324,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 +336,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 +448,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 +463,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