|
@@ -14,8 +14,8 @@ import MForm from '@/components/MForm'
|
|
|
// import { combinationTagsPage } from '@/api/dataBook'
|
|
|
import {
|
|
|
metadata,
|
|
|
- frequency,
|
|
|
- sensitivity
|
|
|
+ frequency
|
|
|
+ // sensitivity
|
|
|
} from '@/utils/dataGovernance'
|
|
|
import SearchNodes from '../../components/searchNodes.vue'
|
|
|
import { api } from '@/api/dataGovernance'
|
|
@@ -32,13 +32,14 @@ export default {
|
|
|
return {
|
|
|
formValues: {
|
|
|
name: null,
|
|
|
- en_name: null,
|
|
|
+ name_en: null,
|
|
|
category: '应用类',
|
|
|
- organization: this.$store.getters.userInfo.username,
|
|
|
- leader: this.$store.getters.userInfo.username,
|
|
|
- childrenId: [],
|
|
|
- frequency: '日',
|
|
|
- data_sensitivity: '低',
|
|
|
+ leader: 'system',
|
|
|
+ organization: null,
|
|
|
+ script_type: 'sql',
|
|
|
+ update_mode: 'append',
|
|
|
+ frequency: '月',
|
|
|
+ // data_sensitivity: '低',
|
|
|
tag: null,
|
|
|
describe: null,
|
|
|
status: true
|
|
@@ -56,60 +57,67 @@ export default {
|
|
|
formItems () {
|
|
|
return [
|
|
|
{ type: 'text', key: 'name', label: '名称 *', rules: [v => !!v || '请输入名称'] },
|
|
|
- { type: 'text', key: 'en_name', label: '英文名称 *', rules: [v => !!v || '请输入英文名称'] },
|
|
|
- { 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 || '请输入负责人'] },
|
|
|
+ { type: 'text', key: 'name_en', label: '英文名称 *', rules: [v => !!v || '请输入英文名称'] },
|
|
|
+ { type: 'autocomplete', key: 'category', label: '请选择分类 *', rules: [v => !!v || '请选择分类'], items: [...metadata] },
|
|
|
+ { type: 'text', key: 'leader', label: '创建者 *', rules: [v => !!v || '请输入负责人'] },
|
|
|
+ { type: 'text', key: 'organization', label: '请输入所属机构 *', rules: [v => !!v || '请输入所属机构'] },
|
|
|
{
|
|
|
- key: 'childrenId',
|
|
|
- slotName: 'childrenId',
|
|
|
- search: null,
|
|
|
- options: {
|
|
|
- label: '数据来源',
|
|
|
- attach: true
|
|
|
- }
|
|
|
+ type: 'autocomplete',
|
|
|
+ key: 'script_type',
|
|
|
+ label: '脚本类型 *',
|
|
|
+ rules: [v => !!v || '请选择脚本类型'],
|
|
|
+ items: [
|
|
|
+ { label: 'SQL', value: 'sql' },
|
|
|
+ { label: 'Python', value: 'python' },
|
|
|
+ { label: 'PythonScript', value: 'python_script' },
|
|
|
+ { label: 'SQLScript', value: 'sql_script' }
|
|
|
+ ]
|
|
|
+ },
|
|
|
+ {
|
|
|
+ type: 'autocomplete',
|
|
|
+ key: 'update_mode',
|
|
|
+ label: '更新模式 *',
|
|
|
+ rules: [v => !!v || '请选择更新模式'],
|
|
|
+ items: [
|
|
|
+ { label: '追加', value: 'append' },
|
|
|
+ { label: '全量更新', value: 'full_refresh' }
|
|
|
+ ]
|
|
|
+ },
|
|
|
+ { type: 'autocomplete', key: 'frequency', label: '更新频率 *', rules: [v => !!v || '请选择更新频率'], items: [...frequency] },
|
|
|
+ {
|
|
|
+ type: 'autocomplete',
|
|
|
+ key: 'tag',
|
|
|
+ label: '标签',
|
|
|
+ itemText: 'name',
|
|
|
+ itemValue: 'id',
|
|
|
+ items: this.tagItems
|
|
|
},
|
|
|
- { type: 'autocomplete', key: 'frequency', label: '更新频率 *', rules: [v => !!v || '请选择更新频率'], items: frequency },
|
|
|
- { type: 'autocomplete', key: 'data_sensitivity', label: '数据敏感度 *', rules: [v => !!v || '请选择数据敏感度'], items: sensitivity },
|
|
|
- { type: 'autocomplete', key: 'tag', label: '标签', itemText: 'name', itemValue: 'id', items: this.tagItems },
|
|
|
{ type: 'text', key: 'describe', label: '描述' },
|
|
|
{
|
|
|
type: 'ifRadio',
|
|
|
key: 'status',
|
|
|
label: '启用',
|
|
|
width: 120,
|
|
|
- items: [{ label: '是', value: true }, { label: '否', value: false }]
|
|
|
+ items: [{ label: '是', value: 'active' }, { label: '否', value: 'inactive' }]
|
|
|
}
|
|
|
]
|
|
|
}
|
|
|
},
|
|
|
created () {
|
|
|
this.init()
|
|
|
- if (!Object.keys(this.itemData).length) {
|
|
|
- return
|
|
|
- }
|
|
|
- Object.keys(this.formValues).forEach(key => {
|
|
|
- if (!Object.prototype.hasOwnProperty.call(this.itemData, key)) {
|
|
|
- return
|
|
|
- }
|
|
|
- if (key === 'childrenId') {
|
|
|
- if (this.itemData.childrenId.length === 1 && this.itemData.childrenId[0].id === null) {
|
|
|
- return
|
|
|
- }
|
|
|
- this.formValues[key] = this.itemData.childrenId.map(e => {
|
|
|
- return {
|
|
|
- value: e.id,
|
|
|
- text: e.name
|
|
|
- }
|
|
|
- })
|
|
|
- return
|
|
|
- }
|
|
|
- if (key === 'tag') {
|
|
|
- this.formValues[key] = this.itemData.tag?.id ?? null
|
|
|
- return
|
|
|
- }
|
|
|
- this.formValues[key] = this.itemData[key]
|
|
|
- })
|
|
|
+ // if (!Object.keys(this.itemData).length) {
|
|
|
+ // return
|
|
|
+ // }
|
|
|
+ // Object.keys(this.formValues).forEach(key => {
|
|
|
+ // if (!Object.prototype.hasOwnProperty.call(this.itemData, key)) {
|
|
|
+ // return
|
|
|
+ // }
|
|
|
+ // if (key === 'tag') {
|
|
|
+ // this.formValues[key] = this.itemData.tag
|
|
|
+ // return
|
|
|
+ // }
|
|
|
+ // this.formValues[key] = this.itemData[key]
|
|
|
+ // })
|
|
|
},
|
|
|
methods: {
|
|
|
async init () {
|