|
@@ -142,6 +142,36 @@
|
|
|
|
|
|
</el-form-item>
|
|
|
|
|
|
+ <!-- 可见权限 -->
|
|
|
+ <el-form-item prop="reportType" label="可见权限">
|
|
|
+ <template slot="label">
|
|
|
+ <span>可见权限</span>
|
|
|
+ <el-tooltip content="未设置可见权限表示所有用户可见,设置可见用户后,指定用户可见该分类下报告">
|
|
|
+ <i class="el-icon-warning"/>
|
|
|
+ </el-tooltip>
|
|
|
+ </template>
|
|
|
+ <el-cascader
|
|
|
+ @change="getVal"
|
|
|
+ style="width:400px"
|
|
|
+ :disabled='classifyForm.Child'
|
|
|
+ v-model="classifyForm.VisibleUserIds"
|
|
|
+ :options="userOptions"
|
|
|
+ :props="{
|
|
|
+ value: 'NodeId',
|
|
|
+ label: 'NodeName',
|
|
|
+ children: 'Children',
|
|
|
+ multiple: true,
|
|
|
+ emitPath: false
|
|
|
+ }"
|
|
|
+ :show-all-levels="false"
|
|
|
+ collapse-tags
|
|
|
+ clearable
|
|
|
+ filterable
|
|
|
+ :placeholder="this.$t('SystemManage.OperateAuth.placeholder04')"
|
|
|
+ />
|
|
|
+
|
|
|
+ </el-form-item>
|
|
|
+
|
|
|
<!-- 报告提醒 -->
|
|
|
<el-form-item prop="warnTime" label="报告提醒">
|
|
|
<template slot="label">
|
|
@@ -240,6 +270,7 @@
|
|
|
import mDialog from '@/components/mDialog.vue';
|
|
|
import { classifylist,classifyparent,classifyadd,classifyedit,classifydelete } from 'api/api.js';
|
|
|
import {classifyPermissionInterface} from '@/api/modules/classifyApi.js'
|
|
|
+import { departInterence } from '@/api/modules/setApi';
|
|
|
export default {
|
|
|
components:{mDialog},
|
|
|
computed: {
|
|
@@ -256,6 +287,8 @@ export default {
|
|
|
},
|
|
|
data() {
|
|
|
return {
|
|
|
+ userOptions:[],
|
|
|
+
|
|
|
typeVal:1,
|
|
|
searchVal:'',
|
|
|
list:[],
|
|
@@ -269,7 +302,8 @@ export default {
|
|
|
reportType: 1,
|
|
|
isReportWarn: 0,
|
|
|
warnTime:'09:00',
|
|
|
- hasClassifyChild:false
|
|
|
+ hasClassifyChild:false,
|
|
|
+ VisibleUserIds:[]
|
|
|
},
|
|
|
formRules: {
|
|
|
classify_name: [{ required:true,message:this.$t('ReportManage.CategoryList.category_name_hint'),trigger:'blur'}]
|
|
@@ -287,8 +321,37 @@ export default {
|
|
|
},
|
|
|
mounted(){
|
|
|
this.getList()
|
|
|
+ this.getUserList()
|
|
|
},
|
|
|
methods: {
|
|
|
+ getVal(val){
|
|
|
+ console.log(val)
|
|
|
+ },
|
|
|
+ // 递归处理数组
|
|
|
+ filterTreeEmpty(arr) {
|
|
|
+ function dfs(node) {
|
|
|
+ if (Array.isArray(node.Children)) {
|
|
|
+ for (let child of node.Children) {
|
|
|
+ dfs(child);
|
|
|
+ }
|
|
|
+ if(node.Children.length===0) delete node.Children
|
|
|
+ }
|
|
|
+ //若为叶子节点,且不为用户,禁止选中
|
|
|
+ if(!node.Children||!Array.isArray(node.Children)){
|
|
|
+ if(node.NodeType!==3) node.disabled = true
|
|
|
+ }
|
|
|
+ }
|
|
|
+ dfs(arr);
|
|
|
+ },
|
|
|
+ // 获取用户可见权限列表
|
|
|
+ getUserList(){
|
|
|
+ departInterence.getSystemUser({}).then(res=>{
|
|
|
+ if(res.Ret===200){
|
|
|
+ this.userOptions=res.Data || []
|
|
|
+ this.filterTreeEmpty({Children:this.userOptions})
|
|
|
+ }
|
|
|
+ })
|
|
|
+ },
|
|
|
/* 报告转移 */
|
|
|
transferReport() {
|
|
|
this.isTransferReport = true;
|
|
@@ -322,6 +385,7 @@ export default {
|
|
|
if(item&&item[0]) {
|
|
|
this.classifyForm.reportType = item[0].data.ClassifyType;
|
|
|
this.classifyForm.hasClassifyChild = item[0].data.HasChild ? true : false;
|
|
|
+ this.classifyForm.VisibleUserIds = item[0].data.VisiableUsers?item[0].data.VisiableUsers:[];
|
|
|
}else {
|
|
|
this.classifyForm.hasClassifyChild = false
|
|
|
}
|
|
@@ -344,6 +408,7 @@ export default {
|
|
|
async addClassify(){
|
|
|
|
|
|
this.classifyForm={
|
|
|
+ Child:null,
|
|
|
show:true,
|
|
|
classify_id:0,
|
|
|
classify_name:"",
|
|
@@ -352,11 +417,14 @@ export default {
|
|
|
reportType: 1,
|
|
|
isReportWarn: 0,
|
|
|
warnTime:'09:00',
|
|
|
- hasClassifyChild:false
|
|
|
+ hasClassifyChild:false,
|
|
|
+ VisibleUserIds:[]
|
|
|
}
|
|
|
},
|
|
|
async handleEdit(item){
|
|
|
this.classifyForm={
|
|
|
+ Child:item.Child,
|
|
|
+ VisibleUserIds:item.VisiableUsers?item.VisiableUsers:[],
|
|
|
show:true,
|
|
|
classify_id:item.Id,
|
|
|
classify_name:item.ClassifyName,
|
|
@@ -370,13 +438,14 @@ export default {
|
|
|
},
|
|
|
async setClassifyHandle(){
|
|
|
await this.$refs.formRef.validate();
|
|
|
- const { classify_name,parent_id,classify_id,reportType,isReportWarn,warnTime } = this.classifyForm;
|
|
|
+ const { classify_name,parent_id,classify_id,reportType,isReportWarn,warnTime,VisibleUserIds } = this.classifyForm;
|
|
|
let params = {
|
|
|
ClassifyName: classify_name,
|
|
|
ParentId: parent_id,
|
|
|
ClassifyType: reportType,
|
|
|
IsRemind: isReportWarn,
|
|
|
- RemindTime: warnTime
|
|
|
+ RemindTime: warnTime,
|
|
|
+ VisibleUserIds
|
|
|
}
|
|
|
|
|
|
const { Ret,Msg } = classify_id
|