feat:数据授权(优化)
parent
8db55ed843
commit
2045889bb1
|
@ -154,7 +154,6 @@ export default {
|
|||
return ids
|
||||
},
|
||||
authChange(row) {
|
||||
console.log(row)
|
||||
this.loading= true;
|
||||
this.sourceAccreditReq={
|
||||
deptIds:null,
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
<template>
|
||||
<div class="app-container">
|
||||
<h4 class="form-header h4">基本信息</h4>
|
||||
<el-form ref="form" :model="baseInfo" label-width="120px">
|
||||
<el-form ref="form" :model="title" label-width="120px">
|
||||
<el-row>
|
||||
<el-col :offset="2" :span="8">
|
||||
<el-form-item label="数据接入名称" prop="nickName">
|
||||
|
@ -101,19 +101,19 @@
|
|||
<script>
|
||||
|
||||
import { parseTime } from '@/utils/muyu'
|
||||
import {
|
||||
addSourceAccredit,
|
||||
deleteSourceAccreditBySourceIds,
|
||||
getSourceAccreditByDataSourceId
|
||||
} from "@/api/dataSource/sourceAccredit";
|
||||
import {listDept} from "@/api/system/dept";
|
||||
import {listUser} from "@/api/system/user";
|
||||
import {
|
||||
addAssetAccredit,
|
||||
deleteAssetAccreditByAssetIds,
|
||||
getAssetAccreditByDataAssetId
|
||||
} from "@/api/dataSource/assetAccredit";
|
||||
|
||||
export default {
|
||||
watch:{
|
||||
'title':{
|
||||
handler(val){
|
||||
this.getSourceAccreditByDataSourceId()
|
||||
this.getAssetAccreditByDataAssetId()
|
||||
},
|
||||
immediate:true
|
||||
}
|
||||
|
@ -171,33 +171,35 @@ export default {
|
|||
this.sourceAccreditReq={
|
||||
deptIds:null,
|
||||
userId: null,
|
||||
dataSourceId: null
|
||||
dataAssetId: null
|
||||
}
|
||||
if (row.nickName){
|
||||
this.sourceAccreditReq.userId=row.userId
|
||||
this.sourceAccreditReq.dataSourceId=this.title.id
|
||||
this.sourceAccreditReq.dataAssetId=this.title.id
|
||||
}else {
|
||||
let ids=this.recursion(row)
|
||||
const uniqueIds = [...new Set(ids)];
|
||||
this.sourceAccreditReq.deptIds = uniqueIds
|
||||
this.sourceAccreditReq.dataSourceId = this.title.id
|
||||
this.sourceAccreditReq.dataAssetId = this.title.id
|
||||
}
|
||||
if (row.isAuth){
|
||||
addSourceAccredit(this.sourceAccreditReq).then(res => {
|
||||
this.getSourceAccreditByDataSourceId()
|
||||
addAssetAccredit(this.sourceAccreditReq).then(res => {
|
||||
this.getAssetAccreditByDataAssetId()
|
||||
})
|
||||
}else{
|
||||
deleteSourceAccreditBySourceIds(this.sourceAccreditReq).then(res => {
|
||||
this.getSourceAccreditByDataSourceId()
|
||||
deleteAssetAccreditByAssetIds(this.sourceAccreditReq).then(res => {
|
||||
this.getAssetAccreditByDataAssetId()
|
||||
})
|
||||
}
|
||||
},
|
||||
parseTime,
|
||||
getSourceAccreditByDataSourceId(){
|
||||
getAssetAccreditByDataAssetId(){
|
||||
if (this.title.id != undefined){
|
||||
getSourceAccreditByDataSourceId(this.title.id).then(response => {
|
||||
getAssetAccreditByDataAssetId(this.title.id).then(response => {
|
||||
this.deptAccreditIds = response.data.deptAccreditModelIds
|
||||
this.userAccreditIds = response.data.userAccreditModelIds
|
||||
console.log(this.deptAccreditIds)
|
||||
console.log(this.userAccreditIds)
|
||||
setTimeout(() => this.getDeptList(), 50)
|
||||
setTimeout(() => this.getUserList(), 50)
|
||||
this.loading = false
|
||||
|
|
|
@ -98,7 +98,6 @@ export default {
|
|||
}else {
|
||||
this.assetStructureList.forEach(source=>{
|
||||
console.log(source)
|
||||
console.log(this.tableList)
|
||||
if (source.tableList!=null){
|
||||
source.tableList.forEach(table=>{
|
||||
if (table.name==data.name){
|
||||
|
|
Loading…
Reference in New Issue