소스 검색

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

wu.jian2 1 년 전
부모
커밋
6c73607daf

+ 1 - 0
data-room-ui/.gitignore

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

파일 크기가 너무 크기때문에 변경 상태를 표시하지 않습니다.
+ 2245 - 162
data-room-ui/package-lock.json


+ 1 - 0
data-room-ui/package.json

@@ -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",

+ 7 - 8
data-room-ui/packages/DataSetManagement/src/index.vue

@@ -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) {

+ 16 - 10
data-room-ui/packages/DataSourceManagement/src/checkDatasource.vue

@@ -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>

+ 17 - 18
data-room-ui/packages/DataSourceManagement/src/index.vue

@@ -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)

이 변경점에서 너무 많은 파일들이 변경되어 몇몇 파일들은 표시되지 않았습니다.