| | |
| | | <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 icon="el-icon-view" plain size="small" type="primary" @click="viewAuthHandler">查看授权结果</el-button> |
| | | </template> |
| | | </avue-crud> |
| | | <div style="margin-top: 15px;"> |
| | |
| | | <!-- 查看授权结果 --> |
| | | <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> |
| | |
| | | </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> |
| | |
| | | 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"; |
| | | export default { |
| | |
| | | title: '', |
| | | visible: false, |
| | | form:{ |
| | | btmType:'', |
| | | objectoid:'', |
| | | userOid:'', |
| | | roleOid:'', |
| | | deptOid:'' |
| | |
| | | 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: [] |
| | | } |
| | | } |
| | | }, |
| | | created() { |
| | |
| | | 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>' |
| | |
| | | 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(); |
| | |
| | | }, |
| | | |
| | | // 查看授权结果 |
| | | 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; |
| | |
| | | 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> |