forked from github/dataease
Merge pull request #4262 from dataease/pr@dev@fix_relation_delete_tip
fix(血源关系): 删除数据源和数据集时如果没有查看血源关系的权限则不提示跳转
This commit is contained in:
commit
425c001d2d
@ -545,9 +545,7 @@ import {
|
|||||||
isKettleRunning,
|
isKettleRunning,
|
||||||
alter
|
alter
|
||||||
} from '@/api/dataset/dataset'
|
} from '@/api/dataset/dataset'
|
||||||
import {
|
import { getDatasetRelationship } from '@/api/chart/chart.js'
|
||||||
getDatasetRelationship,
|
|
||||||
} from '@/api/chart/chart.js'
|
|
||||||
|
|
||||||
import msgContent from '@/views/system/datasource/MsgContent.vue'
|
import msgContent from '@/views/system/datasource/MsgContent.vue'
|
||||||
import GroupMoveSelector from './GroupMoveSelector'
|
import GroupMoveSelector from './GroupMoveSelector'
|
||||||
@ -556,6 +554,7 @@ import { queryAuthModel } from '@/api/authModel/authModel'
|
|||||||
import { engineMode } from '@/api/system/engine'
|
import { engineMode } from '@/api/system/engine'
|
||||||
import _ from 'lodash'
|
import _ from 'lodash'
|
||||||
import msgCfm from '@/components/msgCfm/index'
|
import msgCfm from '@/components/msgCfm/index'
|
||||||
|
import { checkPermission } from '@/utils/permission'
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
name: 'Group',
|
name: 'Group',
|
||||||
@ -925,8 +924,14 @@ export default {
|
|||||||
}
|
}
|
||||||
|
|
||||||
const { queryType = 'dataset', id } = data
|
const { queryType = 'dataset', id } = data
|
||||||
getDatasetRelationship(id).then((res) => {
|
if (checkPermission(['relationship:read'])) {
|
||||||
|
let hasSubRelation = false
|
||||||
|
await getDatasetRelationship(id).then((res) => {
|
||||||
if (res.data.subRelation?.length) {
|
if (res.data.subRelation?.length) {
|
||||||
|
hasSubRelation = true
|
||||||
|
}
|
||||||
|
})
|
||||||
|
if (hasSubRelation) {
|
||||||
options.title = this.$t('datasource.delete_this_dataset')
|
options.title = this.$t('datasource.delete_this_dataset')
|
||||||
options.link = this.$t('datasource.click_to_check')
|
options.link = this.$t('datasource.click_to_check')
|
||||||
options.content = this.$t('datasource.cannot_be_deleted_dataset')
|
options.content = this.$t('datasource.cannot_be_deleted_dataset')
|
||||||
@ -937,8 +942,8 @@ export default {
|
|||||||
this.withLink(options, this.$t('commons.delete'))
|
this.withLink(options, this.$t('commons.delete'))
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
}
|
||||||
this.handlerConfirm(options)
|
this.handlerConfirm(options)
|
||||||
})
|
|
||||||
},
|
},
|
||||||
linkTo(query) {
|
linkTo(query) {
|
||||||
window.open(this.$router.resolve({
|
window.open(this.$router.resolve({
|
||||||
|
@ -339,13 +339,12 @@ import {
|
|||||||
listDriverByType,
|
listDriverByType,
|
||||||
updateDriver
|
updateDriver
|
||||||
} from '@/api/system/datasource'
|
} from '@/api/system/datasource'
|
||||||
import {
|
import { getDatasourceRelationship } from '@/api/chart/chart.js'
|
||||||
getDatasourceRelationship,
|
|
||||||
} from '@/api/chart/chart.js'
|
|
||||||
|
|
||||||
import msgContent from './MsgContent.vue'
|
import msgContent from './MsgContent.vue'
|
||||||
import deTextarea from '@/components/deCustomCm/DeTextarea.vue'
|
import deTextarea from '@/components/deCustomCm/DeTextarea.vue'
|
||||||
import msgCfm from '@/components/msgCfm'
|
import msgCfm from '@/components/msgCfm'
|
||||||
|
import { checkPermission } from '@/utils/permission'
|
||||||
export default {
|
export default {
|
||||||
name: 'DsTree',
|
name: 'DsTree',
|
||||||
components: { deTextarea },
|
components: { deTextarea },
|
||||||
@ -754,6 +753,7 @@ export default {
|
|||||||
}
|
}
|
||||||
const { queryType = 'datasource', name: label, id } = datasource
|
const { queryType = 'datasource', name: label, id } = datasource
|
||||||
if (this.showView === 'Datasource') {
|
if (this.showView === 'Datasource') {
|
||||||
|
if (checkPermission(['relationship:read'])) {
|
||||||
await this.getDatasourceRelationship({ queryType, label, id })
|
await this.getDatasourceRelationship({ queryType, label, id })
|
||||||
if (this.treeData.length) {
|
if (this.treeData.length) {
|
||||||
params.title = this.$t('datasource.this_data_source')
|
params.title = this.$t('datasource.this_data_source')
|
||||||
@ -765,6 +765,7 @@ export default {
|
|||||||
return
|
return
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
this.handlerConfirm(params)
|
this.handlerConfirm(params)
|
||||||
},
|
},
|
||||||
linkTo(query) {
|
linkTo(query) {
|
||||||
|
@ -340,6 +340,7 @@ export default {
|
|||||||
},
|
},
|
||||||
queryTypeChange(val) {
|
queryTypeChange(val) {
|
||||||
this.formInline.dataSourceName = ''
|
this.formInline.dataSourceName = ''
|
||||||
|
this.dataSourceNameList = []
|
||||||
switch (val) {
|
switch (val) {
|
||||||
case 'datasource':
|
case 'datasource':
|
||||||
this.listDatasource()
|
this.listDatasource()
|
||||||
|
Loading…
Reference in New Issue
Block a user