Explorar o código

数据地图-标签

Xiao_123 hai 4 días
pai
achega
9327a1a530

+ 9 - 5
src/api/dataGovernance.js

@@ -148,7 +148,7 @@ const dataModel = {
 const dataLabel = {
   // 列表
   dataLabelList: (param) => {
-    return http.post('/interface/labellist', param)
+    return http.post('/interface/data/label/list', param)
   },
   // 新增
   dataLabelAdd: (param) => {
@@ -352,10 +352,6 @@ const businessDomain = {
   // 组合创建业务领域
   combinationCreateBusinessDomain: (param) => {
     return http.post('/bd/compose', param)
-  },
-  // 获取标签列表 - 弃用
-  getLabelList: (param) => {
-    return http.post('/bd/labellist', param)
   }
 }
 
@@ -392,6 +388,14 @@ const other = {
   // 获取业务域列表
   getBusinessDomainList2: () => {
     return http.get('/dataflow/get-BD-list')
+  },
+  // 获取标签列表
+  getLabelList: (param) => {
+    return http.post('/interface/labellist', param)
+  },
+  // 元数据、业务域关系图谱
+  getGraphAll: (param) => {
+    return http.post('/interface/graphall', param)
   }
 }
 

+ 1 - 0
src/components/Filter/index.vue

@@ -39,6 +39,7 @@
                     :item-value="val.itemValue || 'value'"
                     :style="`width: ${val.width || 250}px`"
                     :search-input.sync="val.searchInput"
+                    :return-object="val.returnObject || false"
                     :readonly="val.readonly"
                     :multiple="val.multiple"
                     outlined dense :clearable="!val.clearable" attach

+ 1 - 0
src/components/MForm/index.vue

@@ -35,6 +35,7 @@
                       :item-value="item.itemValue || 'value'"
                       :outlined="item.outlined ?? true"
                       :dense="item.dense ?? true"
+                      :return-object="item.returnObject || false"
                       :search-input.sync="item.searchInput"
                       :hide-details="item.hideDetails ?? false"
                       :no-data-text="item.noDataText || 'No data available'"

+ 1 - 1
src/views/dataBook/businessDomain/components/graph.vue

@@ -16,7 +16,7 @@ export default {
   components: { MCard, MGraph },
   data () {
     return {
-      toApi: api.getBusinessDomainGraph
+      toApi: api.getGraphAll
     }
   }
 }

+ 1 - 1
src/views/dataBook/dataLabel/index.vue

@@ -1,6 +1,6 @@
 <template>
   <div class="pa-3 white">
-    <m-filter :filter="['name_zh', 'name_en', 'category_filter']" @search="handleSearch" />
+    <m-filter :filter="['name_zh', 'name_en', 'category']" @search="handleSearch" />
     <m-table
       class="mt-3"
       :loading="loading"

+ 2 - 2
src/views/dataBook/dataMetaData/components/graph.vue

@@ -1,7 +1,7 @@
 <template>
   <div style="height: 100%;">
     <m-card title="血缘关系" bodyStyle="flex: 1" style="height: 100%;" class="d-flex flex-column">
-      <m-graph :to-api="toApi"></m-graph>
+      <m-graph :to-api="toApi" meta></m-graph>
     </m-card>
   </div>
 </template>
@@ -16,7 +16,7 @@ export default {
   components: { MCard, MGraph },
   data () {
     return {
-      toApi: api.getMetaDataGraph
+      toApi: api.getGraphAll
     }
   }
 }

+ 3 - 1
src/views/dataBook/dataMetaData/components/metaDataInfo.vue

@@ -16,7 +16,9 @@
           <li>{{ info.name_en }}</li>
           <li>{{ info.data_type }}</li>
           <li>{{ info.create_time }}</li>
-          <li></li>
+          <li>
+            <v-chip v-for="k in info.tag" :key="k.id" small class="mr-1" color="primary">{{ k.name_zh }}</v-chip>
+          </li>
           <!-- <li>{{ info.system == 0 ? '系统级' : '用户级' }}</li> -->
           <!-- <li>
             <v-chip v-for="k in info.metaDataCombinationTags" :key="k.metaDataCombinationTagsId" small class="mr-1" color="success">{{ k.title }}</v-chip>

+ 15 - 10
src/views/dataBook/dataMetaData/index.vue

@@ -23,18 +23,19 @@
         </v-chip>
       </template>
       <template #tag="{ item }">
-        <m-graph-drill
+        <!-- <m-graph-drill
           :id="item.tag?.id"
           :title="`${item.tag?.name_zh}血缘图谱`"
-        >{{ item.tag?.name_zh }}</m-graph-drill>
+        >{{ item.tag?.name_zh }}</m-graph-drill> -->
+        {{ item.tag.map(e => e.name_zh).join(',') }}
       </template>
-      <template #blood_count="{ item }">
+      <!-- <template #blood_count="{ item }">
         <m-graph-drill
           :id="item.id"
           :title="`${item.name_zh}血缘图谱`"
           :to-api="api.getMetaDataGraph"
         >{{ item.blood_count }}</m-graph-drill>
-      </template>
+      </template> -->
       <template v-slot:name_zh = "{item}">
         <span class="defaultLink" @click="toDetail(item)">{{ item.name_zh }}</span>
       </template>
@@ -46,10 +47,14 @@
 import FilterList from '../../dataGovernance/components/Filter'
 import TableList from '@/components/List/table'
 import { api } from '@/api/dataGovernance'
-import MGraphDrill from '../components/mGraphDrill'
+// import MGraphDrill from '../components/mGraphDrill'
 export default {
   name: 'meta-data',
-  components: { FilterList, TableList, MGraphDrill },
+  components: {
+    FilterList,
+    TableList
+    // MGraphDrill
+  },
   data () {
     return {
       api,
@@ -57,10 +62,10 @@ export default {
       headers: [
         { text: '中文名', value: 'name_zh' },
         { text: '英文名', value: 'name_en' },
-        { text: '分类', value: 'category' },
-        { text: '描述', value: 'describe' },
-        { text: '标签', value: 'tag' },
-        { text: '状态', value: 'status' },
+        { text: '分类', value: 'category', sortable: false },
+        { text: '描述', value: 'describe', sortable: false },
+        { text: '标签', value: 'tag', sortable: false },
+        { text: '状态', value: 'status', sortable: false },
         { text: '血缘关系数量', value: 'blood_count', align: 'center' },
         { text: '创建时间', value: 'create_time' }
       ],

+ 8 - 14
src/views/dataGovernance/businessDomain/components/editBase.vue

@@ -143,6 +143,7 @@ export default {
           key: 'tag',
           label: '请选择标签',
           multiple: true,
+          returnObject: true,
           itemText: 'name_zh',
           itemValue: 'id',
           items: this.labelItems
@@ -170,10 +171,10 @@ export default {
       return
     }
     Object.keys(this.formValues).forEach(key => {
-      if (key === 'tag') {
-        this.formValues[key] = this.itemData[key]?.map(e => e.id) || []
-        return
-      }
+      // if (key === 'tag') {
+      //   this.formValues[key] = this.itemData[key]?.map(e => e.id) || []
+      //   return
+      // }
       if (key === 'data_source') {
         this.formValues[key] = this.itemData[key] || null
         this.formValues.chooseStorage = !!this.itemData[key]
@@ -189,7 +190,7 @@ export default {
       try {
         this.loading = true
         try {
-          const { data } = await api.dataLabelList({
+          const { data } = await api.getLabelList({
             ...this.pageInfo,
             category_filter: 'DataOps'
           })
@@ -226,23 +227,16 @@ export default {
       if (!this.$refs.form.validate()) {
         return
       }
-      const { chooseStorage, data_source: dataSource, storage_location: storageLocation, tag: tagIds, ...obj } = this.formValues
-      const tag = tagIds.map(e => ({
-        id: e,
-        name_zh: this.labelItems.find(item => item.id === e)?.name_zh ?? null,
-        name_en: this.labelItems.find(item => item.id === e)?.name_en ?? null
-      }))
+      const { chooseStorage, data_source: dataSource, storage_location: storageLocation, ...obj } = this.formValues
       if (chooseStorage) {
         return {
           ...obj,
-          tag,
           data_source: dataSource
         }
       }
       return {
         ...obj,
-        storage_location: storageLocation,
-        tag
+        storage_location: storageLocation
       }
     }
   }

+ 4 - 9
src/views/dataGovernance/components/Filter.vue

@@ -44,15 +44,10 @@ const options = [
   },
   {
     type: 'autocomplete',
-    value: null,
-    label: '分类',
-    key: 'category_filter',
-    items: metadata
-  },
-  {
-    type: 'autocomplete',
-    value: null,
+    value: [],
+    multiple: true,
     label: '标签',
+    returnObject: true,
     searchInput: null,
     itemText: 'name_zh',
     itemValue: 'id',
@@ -106,7 +101,7 @@ export default {
     async init () {
       this.loading = true
       try {
-        const { data } = await api.dataLabelList({
+        const { data } = await api.getLabelList({
           ...this.tag.pageInfo,
           category_filter: 'DataOps',
           name_zh: this.tag.name

+ 1 - 1
src/views/dataGovernance/dataIndicator/components/editBase.vue

@@ -121,7 +121,7 @@ export default {
       try {
         this.loading = true
         try {
-          const { data } = await api.dataLabelList({
+          const { data } = await api.getLabelList({
             ...this.pageInfo,
             category_filter: 'DataOps'
           })

+ 1 - 1
src/views/dataGovernance/dataLabel/index.vue

@@ -1,6 +1,6 @@
 <template>
   <div class="pa-3 white">
-    <m-filter :filter="['name_zh', 'name_en', 'category_filter']" @search="handleSearch" />
+    <m-filter :filter="['name_zh', 'name_en', 'category']" @search="handleSearch" />
     <m-table
       class="mt-3"
       :loading="loading"

+ 1 - 1
src/views/dataGovernance/dataModules/components/editBase.vue

@@ -148,7 +148,7 @@ export default {
       try {
         this.loading = true
         try {
-          const { data } = await api.dataLabelList({
+          const { data } = await api.getLabelList({
             ...this.pageInfo,
             category_filter: 'DataOps'
           })

+ 4 - 2
src/views/dataGovernance/dataProcess/components/editBase.vue

@@ -44,7 +44,7 @@ export default {
         update_mode: 'append',
         frequency: '月',
         // data_sensitivity: '低',
-        tag: null,
+        tag: [],
         describe: null,
         status: 'active'
       },
@@ -93,6 +93,8 @@ export default {
           type: 'autocomplete',
           key: 'tag',
           label: '标签',
+          returnObject: true,
+          multiple: true,
           itemText: 'name_zh',
           itemValue: 'id',
           items: this.tagItems
@@ -162,7 +164,7 @@ export default {
       try {
         this.loading = true
         try {
-          const { data } = await api.dataLabelList({
+          const { data } = await api.getLabelList({
             ...this.pageInfo,
             category_filter: 'DataOps'
           })

+ 1 - 1
src/views/dataGovernance/dataResource/components/editBase.vue

@@ -189,7 +189,7 @@ export default {
       try {
         this.loading = true
         try {
-          const { data } = await api.dataLabelList({
+          const { data } = await api.getLabelList({
             ...this.pageInfo,
             category_filter: 'DataOps'
           })

+ 15 - 13
src/views/dataGovernance/dataStandard/components/edit.vue

@@ -81,9 +81,11 @@ export default {
           {
             type: 'autocomplete',
             key: 'tag',
-            value: null,
+            value: [],
             label: '请选择标签',
             outlined: true,
+            returnObject: true,
+            multiple: true,
             dense: true,
             itemText: 'name_zh',
             itemValue: 'id',
@@ -148,10 +150,10 @@ export default {
       return
     }
     this.formItems.options.forEach(item => {
-      if (item.key === 'tag') {
-        item.value = this.itemData.tag.id
-        return
-      }
+      // if (item.key === 'tag') {
+      //   item.value = this.itemData.tag.id
+      //   return
+      // }
       item.value = this.itemData[item.key]
     })
   },
@@ -160,7 +162,7 @@ export default {
       try {
         this.loading = true
         try {
-          const { data } = await api.dataLabelList({
+          const { data } = await api.getLabelList({
             ...this.pageInfo,
             category_filter: 'DataOps'
           })
@@ -210,13 +212,13 @@ export default {
         await this.handleCodeGenerate()
       }
       return this.formItems.options.reduce((res, item) => {
-        if (item.key === 'tag' && item.value) {
-          res.tag = {
-            id: item.value,
-            name_zh: item.items.find(e => e.id === item.value)?.name_zh ?? null
-          }
-          return res
-        }
+        // if (item.key === 'tag' && item.value) {
+        //   res.tag = {
+        //     id: item.value,
+        //     name_zh: item.items.find(e => e.id === item.value)?.name_zh ?? null
+        //   }
+        //   return res
+        // }
         res[item.key] = item.value
         return res
       }, {})

+ 12 - 18
src/views/dataGovernance/metadata/components/edit.vue

@@ -34,7 +34,7 @@ export default {
         alias: null,
         affiliation: null,
         data_type: null,
-        tag: null,
+        tag: [],
         describe: null,
         status: 1
       },
@@ -67,10 +67,18 @@ export default {
           type: 'autocomplete',
           key: 'category',
           label: '请选择分类 *',
+          col: 6,
           noAttach: true,
           rules: [v => !!v || '请选择分类'],
           items: [...metadata]
         },
+        {
+          type: 'text',
+          key: 'data_type',
+          label: '请输入数据类型 *',
+          col: 6,
+          rules: [v => !!v || '请输入数据类型']
+        },
         {
           type: 'text',
           key: 'alias',
@@ -81,26 +89,12 @@ export default {
           key: 'affiliation',
           label: '请输入制作单位'
         },
-        {
-          type: 'text',
-          key: 'data_type',
-          label: '请选择数据类型 *',
-          col: 6,
-          rules: [v => !!v || '请选择输入类型']
-
-          // type: 'autocomplete',
-          // key: 'data_type',
-          // label: '请选择数据类型 *',
-          // col: 6,
-          // noAttach: true,
-          // rules: [v => !!v || '请选择数据类型'],
-          // items: [...metadataType]
-        },
         {
           type: 'autocomplete',
           key: 'tag',
           label: '请选择标签',
-          col: 6,
+          returnObject: true,
+          multiple: true,
           noAttach: true,
           itemText: 'name_zh',
           itemValue: 'id',
@@ -136,7 +130,7 @@ export default {
       try {
         this.loading = true
         try {
-          const { data } = await api.dataLabelList({
+          const { data } = await api.getLabelList({
             ...this.pageInfo,
             category_filter: 'DataOps'
           })

+ 1 - 1
src/views/dataGovernance/metadata/index.vue

@@ -23,7 +23,7 @@
         </v-chip>
       </template>
       <template #tag="{ item }">
-        {{ item.tag?.name_zh }}
+        {{ item.tag.map(e => e.name_zh).join(',') }}
       </template>
       <template v-slot:navBtn>
         <v-btn class="elevation-5 buttons mr-3" color="primary" rounded @click="handleAdd">