feat:数据授权(优化)

master_fei
Yunfei Du 2024-05-13 19:29:18 +08:00
parent 8db55ed843
commit 2045889bb1
3 changed files with 18 additions and 18 deletions

View File

@ -154,7 +154,6 @@ export default {
return ids return ids
}, },
authChange(row) { authChange(row) {
console.log(row)
this.loading= true; this.loading= true;
this.sourceAccreditReq={ this.sourceAccreditReq={
deptIds:null, deptIds:null,

View File

@ -1,7 +1,7 @@
<template> <template>
<div class="app-container"> <div class="app-container">
<h4 class="form-header h4">基本信息</h4> <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-row>
<el-col :offset="2" :span="8"> <el-col :offset="2" :span="8">
<el-form-item label="数据接入名称" prop="nickName"> <el-form-item label="数据接入名称" prop="nickName">
@ -101,19 +101,19 @@
<script> <script>
import { parseTime } from '@/utils/muyu' import { parseTime } from '@/utils/muyu'
import {
addSourceAccredit,
deleteSourceAccreditBySourceIds,
getSourceAccreditByDataSourceId
} from "@/api/dataSource/sourceAccredit";
import {listDept} from "@/api/system/dept"; import {listDept} from "@/api/system/dept";
import {listUser} from "@/api/system/user"; import {listUser} from "@/api/system/user";
import {
addAssetAccredit,
deleteAssetAccreditByAssetIds,
getAssetAccreditByDataAssetId
} from "@/api/dataSource/assetAccredit";
export default { export default {
watch:{ watch:{
'title':{ 'title':{
handler(val){ handler(val){
this.getSourceAccreditByDataSourceId() this.getAssetAccreditByDataAssetId()
}, },
immediate:true immediate:true
} }
@ -171,33 +171,35 @@ export default {
this.sourceAccreditReq={ this.sourceAccreditReq={
deptIds:null, deptIds:null,
userId: null, userId: null,
dataSourceId: null dataAssetId: null
} }
if (row.nickName){ if (row.nickName){
this.sourceAccreditReq.userId=row.userId this.sourceAccreditReq.userId=row.userId
this.sourceAccreditReq.dataSourceId=this.title.id this.sourceAccreditReq.dataAssetId=this.title.id
}else { }else {
let ids=this.recursion(row) let ids=this.recursion(row)
const uniqueIds = [...new Set(ids)]; const uniqueIds = [...new Set(ids)];
this.sourceAccreditReq.deptIds = uniqueIds this.sourceAccreditReq.deptIds = uniqueIds
this.sourceAccreditReq.dataSourceId = this.title.id this.sourceAccreditReq.dataAssetId = this.title.id
} }
if (row.isAuth){ if (row.isAuth){
addSourceAccredit(this.sourceAccreditReq).then(res => { addAssetAccredit(this.sourceAccreditReq).then(res => {
this.getSourceAccreditByDataSourceId() this.getAssetAccreditByDataAssetId()
}) })
}else{ }else{
deleteSourceAccreditBySourceIds(this.sourceAccreditReq).then(res => { deleteAssetAccreditByAssetIds(this.sourceAccreditReq).then(res => {
this.getSourceAccreditByDataSourceId() this.getAssetAccreditByDataAssetId()
}) })
} }
}, },
parseTime, parseTime,
getSourceAccreditByDataSourceId(){ getAssetAccreditByDataAssetId(){
if (this.title.id != undefined){ if (this.title.id != undefined){
getSourceAccreditByDataSourceId(this.title.id).then(response => { getAssetAccreditByDataAssetId(this.title.id).then(response => {
this.deptAccreditIds = response.data.deptAccreditModelIds this.deptAccreditIds = response.data.deptAccreditModelIds
this.userAccreditIds = response.data.userAccreditModelIds this.userAccreditIds = response.data.userAccreditModelIds
console.log(this.deptAccreditIds)
console.log(this.userAccreditIds)
setTimeout(() => this.getDeptList(), 50) setTimeout(() => this.getDeptList(), 50)
setTimeout(() => this.getUserList(), 50) setTimeout(() => this.getUserList(), 50)
this.loading = false this.loading = false

View File

@ -98,7 +98,6 @@ export default {
}else { }else {
this.assetStructureList.forEach(source=>{ this.assetStructureList.forEach(source=>{
console.log(source) console.log(source)
console.log(this.tableList)
if (source.tableList!=null){ if (source.tableList!=null){
source.tableList.forEach(table=>{ source.tableList.forEach(table=>{
if (table.name==data.name){ if (table.name==data.name){