feat: 添加数据源、数据集删除操作前判断是否已经被大屏使用

main
wu.jian2 2 years ago
parent d7aeb50a65
commit 6c73607daf

@ -368,5 +368,6 @@ GitHub.sublime-settings
lib lib
data-room-ui data-room-ui
dataRoomUi
bigScreen bigScreen
bigScreen.zip bigScreen.zip

File diff suppressed because it is too large Load Diff

@ -53,6 +53,7 @@
"@amap/amap-jsapi-loader": "^1.0.1", "@amap/amap-jsapi-loader": "^1.0.1",
"@antv/g2plot": "2.4.0", "@antv/g2plot": "2.4.0",
"@jiaminghi/data-view": "2.10.0", "@jiaminghi/data-view": "2.10.0",
"@wjjj/utils": "^0.1.2",
"axios": "0.18.1", "axios": "0.18.1",
"babel-polyfill": "6.26.0", "babel-polyfill": "6.26.0",
"echarts": "^5.2.2", "echarts": "^5.2.2",

@ -233,8 +233,8 @@
/> />
<checkDatasource <checkDatasource
ref="checkDatasource" ref="checkDatasource"
:reasonList="reasonList" :reason-list="reasonList"
/> />
<component <component
:is="componentData.component" :is="componentData.component"
v-if="datasetType" v-if="datasetType"
@ -311,7 +311,7 @@ export default {
}, },
data () { data () {
return { return {
reasonList:[], reasonList: [],
datasetType: null, datasetType: null,
isEdit: false, isEdit: false,
categoryData: [], categoryData: [],
@ -446,9 +446,9 @@ export default {
}, },
// //
delDataset (id) { delDataset (id) {
datasetCheck(id).then((res)=>{ datasetCheck(id).then((res) => {
console.log(res) console.log(res)
if(res.canDelete){ if (res.canDelete) {
this.$confirm('确定删除当前数据集吗?', '提示', { this.$confirm('确定删除当前数据集吗?', '提示', {
confirmButtonText: '确定', confirmButtonText: '确定',
cancelButtonText: '取消', cancelButtonText: '取消',
@ -461,12 +461,11 @@ export default {
}) })
}).catch(() => { }).catch(() => {
}) })
}else{ } else {
this.reasonList=res.reasons this.reasonList = res.reasons
this.$refs.checkDatasource.checkDatasourceVisible = true this.$refs.checkDatasource.checkDatasourceVisible = true
} }
}) })
}, },
// //
toPreview (id, type, name, typeId) { toPreview (id, type, name, typeId) {

@ -8,11 +8,13 @@
:before-close="handleClose" :before-close="handleClose"
class="bs-dialog-wrap bs-el-dialog" class="bs-dialog-wrap bs-el-dialog"
> >
<div <div class="text-style">
style="padding-right: 80px;" <div
> v-for="(item,index) in reasonList"
<div class="item" v-for="(item,index) in reasonList" :key="index"> :key="index"
<span v-if="reasonList.length>1"> {{index+1}}</span>{{item}} class="item"
>
<span v-if="reasonList.length>1"> {{ index+1 }}</span>{{ item }}
</div> </div>
</div> </div>
<span <span
@ -34,21 +36,21 @@ export default {
props: { props: {
reasonList: { reasonList: {
type: Array, type: Array,
default: ()=>[] default: () => []
} }
}, },
data () { data () {
return { return {
checkDatasourceVisible: false, checkDatasourceVisible: false
} }
}, },
methods: { methods: {
handleClose(){ handleClose () {
this.checkDatasourceVisible=false this.checkDatasourceVisible = false
} }
}
} }
}
</script> </script>
<style lang="scss" scoped> <style lang="scss" scoped>
@ -59,4 +61,8 @@ export default {
.item{ .item{
padding: 8px 0; padding: 8px 0;
} }
.text-style{
padding-right: 80px;
color: var(--bs-el-text);
}
</style> </style>

@ -128,10 +128,10 @@
:app-code="appCode" :app-code="appCode"
@refreshTable="init" @refreshTable="init"
/> />
<checkDatasource <checkDatasource
ref="checkDatasource" ref="checkDatasource"
:reasonList="reasonList" :reason-list="reasonList"
/> />
</div> </div>
</template> </template>
@ -185,7 +185,7 @@ export default {
}, },
data () { data () {
return { return {
reasonList:[], reasonList: [],
testBtnLoading: [], testBtnLoading: [],
loadingText: '', loadingText: '',
searchLoading: false, searchLoading: false,
@ -279,25 +279,24 @@ export default {
handleDelete (row) { handleDelete (row) {
// eslint-disable-next-line eqeqeq // eslint-disable-next-line eqeqeq
if (row.editable == 1 && !this.appCode) return if (row.editable == 1 && !this.appCode) return
dataSourceCheck(row.id).then((res)=>{ dataSourceCheck(row.id).then((res) => {
if(res.canDelete){ if (res.canDelete) {
this.$confirm('确定删除当前数据源吗?', '提示', { this.$confirm('确定删除当前数据源吗?', '提示', {
confirmButtonText: '确定', confirmButtonText: '确定',
cancelButtonText: '取消', cancelButtonText: '取消',
type: 'warning', type: 'warning',
customClass: 'bs-el-message-box' customClass: 'bs-el-message-box'
}).then(() => { }).then(() => {
sourceRemove(row.id).then((r) => { sourceRemove(row.id).then((r) => {
this.$message.success('删除成功') this.$message.success('删除成功')
this.init() this.init()
})
}) })
}) } else {
}else{ this.reasonList = res.reasons
this.reasonList=res.reasons
this.$refs.checkDatasource.checkDatasourceVisible = true this.$refs.checkDatasource.checkDatasourceVisible = true
} }
}) })
}, },
sourceLinkTest (row) { sourceLinkTest (row) {
this.testBtnLoading.push(row.id) this.testBtnLoading.push(row.id)

Loading…
Cancel
Save