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

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

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

File diff suppressed because it is too large Load Diff

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

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

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

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

Loading…
Cancel
Save