|
|
@@ -4,9 +4,9 @@
|
|
|
<template #name_en>
|
|
|
<v-btn color="primary" class="ml-3" :loading="translateLoading" @click="getTranslate">翻译</v-btn>
|
|
|
</template>
|
|
|
- <template #childrenId="{ item }">
|
|
|
+ <!-- <template #childrenId="{ item }">
|
|
|
<search-nodes v-model="item.value" v-bind="item.options" :search-value="item.search"></search-nodes>
|
|
|
- </template>
|
|
|
+ </template> -->
|
|
|
</m-form>
|
|
|
</div>
|
|
|
</template>
|
|
|
@@ -21,8 +21,9 @@ import {
|
|
|
frequency,
|
|
|
sensitivity
|
|
|
} from '@/utils/dataGovernance'
|
|
|
+import { getDatasourceList } from '@/api/dataOrigin'
|
|
|
import { api } from '@/api/dataGovernance'
|
|
|
-import SearchNodes from '../../components/searchNodes.vue'
|
|
|
+// import SearchNodes from '../../components/searchNodes.vue'
|
|
|
export default {
|
|
|
name: 'edit-base',
|
|
|
props: {
|
|
|
@@ -35,7 +36,10 @@ export default {
|
|
|
default: () => ({})
|
|
|
}
|
|
|
},
|
|
|
- components: { MForm, SearchNodes },
|
|
|
+ components: {
|
|
|
+ MForm
|
|
|
+ // SearchNodes
|
|
|
+ },
|
|
|
data () {
|
|
|
return {
|
|
|
formValues: {
|
|
|
@@ -44,12 +48,13 @@ export default {
|
|
|
category: '应用类',
|
|
|
organization: this.$store.getters.userInfo.username,
|
|
|
leader: this.$store.getters.userInfo.username,
|
|
|
- childrenId: [],
|
|
|
+ // childrenId: [],
|
|
|
frequency: '日',
|
|
|
data_sensitivity: '低',
|
|
|
tag: null,
|
|
|
describe: null,
|
|
|
- status: true
|
|
|
+ status: true,
|
|
|
+ data_source: null
|
|
|
},
|
|
|
pageInfo: {
|
|
|
size: 10,
|
|
|
@@ -58,7 +63,8 @@ export default {
|
|
|
total: 0,
|
|
|
loading: false,
|
|
|
translateLoading: false,
|
|
|
- tagItems: []
|
|
|
+ tagItems: [],
|
|
|
+ dataSourceItems: []
|
|
|
}
|
|
|
},
|
|
|
computed: {
|
|
|
@@ -75,14 +81,23 @@ export default {
|
|
|
{ type: 'autocomplete', key: 'category', label: '请选择分类 *', rules: [v => !!v || '请选择分类'], items: [...metadata] },
|
|
|
{ type: 'text', key: 'organization', label: '请输入所属机构 *', rules: [v => !!v || '请输入所属机构'] },
|
|
|
{ type: 'text', key: 'leader', label: '请输入负责人 *', rules: [v => !!v || '请输入负责人'] },
|
|
|
+ // {
|
|
|
+ // key: 'childrenId',
|
|
|
+ // slotName: 'childrenId',
|
|
|
+ // search: null,
|
|
|
+ // options: {
|
|
|
+ // label: '请选择数据来源',
|
|
|
+ // attach: true
|
|
|
+ // }
|
|
|
+ // },
|
|
|
{
|
|
|
- key: 'childrenId',
|
|
|
- slotName: 'childrenId',
|
|
|
- search: null,
|
|
|
- options: {
|
|
|
- label: '请选择数据来源',
|
|
|
- attach: true
|
|
|
- }
|
|
|
+ type: 'autocomplete',
|
|
|
+ key: 'data_source',
|
|
|
+ label: '请选择数据来源',
|
|
|
+ noAttach: true,
|
|
|
+ itemText: 'name_zh',
|
|
|
+ itemValue: 'id',
|
|
|
+ items: this.dataSourceItems
|
|
|
},
|
|
|
{ type: 'autocomplete', key: 'frequency', label: '请选择更新频率 *', rules: [v => !!v || '请选择更新频率'], items: [...frequency] },
|
|
|
{ type: 'autocomplete', key: 'data_sensitivity', label: '请选择数据敏感度 *', rules: [v => !!v || '请选择数据敏感度'], items: [...sensitivity] },
|
|
|
@@ -107,17 +122,18 @@ export default {
|
|
|
if (!val || !Object.keys(val).length) {
|
|
|
return
|
|
|
}
|
|
|
- if (val.childrenId.length) {
|
|
|
- this.formValues.childrenId = val.childrenId.map(e => {
|
|
|
- return {
|
|
|
- value: e.id,
|
|
|
- text: e.name_zh
|
|
|
- }
|
|
|
- })
|
|
|
- }
|
|
|
+ // if (val.childrenId.length) {
|
|
|
+ // this.formValues.childrenId = val.childrenId.map(e => {
|
|
|
+ // return {
|
|
|
+ // value: e.id,
|
|
|
+ // text: e.name_zh
|
|
|
+ // }
|
|
|
+ // })
|
|
|
+ // }
|
|
|
this.formValues.tag = val.tag?.id ?? null
|
|
|
this.formItems.forEach(item => {
|
|
|
- if (!Object.prototype.hasOwnProperty.call(val, item.key) || item.key === 'childrenId' || item.key === 'tag') {
|
|
|
+ if (!Object.prototype.hasOwnProperty.call(val, item.key) || item.key === 'tag') {
|
|
|
+ // if (!Object.prototype.hasOwnProperty.call(val, item.key) || item.key === 'childrenId' || item.key === 'tag') {
|
|
|
return
|
|
|
}
|
|
|
this.formValues[item.key] = val[item.key]
|
|
|
@@ -133,6 +149,8 @@ export default {
|
|
|
})
|
|
|
this.tagItems = data.records
|
|
|
this.total = data.total
|
|
|
+ const { data: dataSource } = await getDatasourceList({})
|
|
|
+ this.dataSourceItems = dataSource.data_source
|
|
|
} catch (error) {
|
|
|
this.$snackbar.error(error)
|
|
|
} finally {
|
|
|
@@ -163,10 +181,11 @@ export default {
|
|
|
if (!this.$refs.form.validate()) {
|
|
|
return
|
|
|
}
|
|
|
- const { childrenId, ...obj } = this.formValues
|
|
|
+ // const { childrenId, ...obj } = this.formValues
|
|
|
+ const { ...obj } = this.formValues
|
|
|
return {
|
|
|
- ...obj,
|
|
|
- childrenId: childrenId.map(e => e.value)
|
|
|
+ ...obj
|
|
|
+ // childrenId: childrenId.map(e => e.value)
|
|
|
}
|
|
|
}
|
|
|
}
|