feat(血源关系): 仪表板名称选项增加默认仪表板

This commit is contained in:
wisonic-s 2023-01-10 16:59:01 +08:00
parent 1380585e5d
commit 26599611e3

View File

@ -172,7 +172,7 @@ import { listDatasource } from '@/api/dataset/dataset'
import _ from 'lodash' import _ from 'lodash'
import GridTable from '@/components/gridTable/index.vue' import GridTable from '@/components/gridTable/index.vue'
import consanguinity from './consanguinity.vue' import consanguinity from './consanguinity.vue'
import { groupTree } from '@/api/panel/panel' import { defaultTree, groupTree } from '@/api/panel/panel'
import { queryAuthModel } from '@/api/authModel/authModel' import { queryAuthModel } from '@/api/authModel/authModel'
import { data } from 'vue2-ace-editor' import { data } from 'vue2-ace-editor'
@ -406,12 +406,24 @@ export default {
}) })
}, },
getPanelGroupList() { getPanelGroupList() {
return defaultTree({ panelType: 'system' }, true).then((res) => {
if (res.data?.length > 0) {
const defaultPanelTree = {
id: 'defaultPanel',
name: this.$t('panel.default_panel'),
nodeType: 'folder',
children: res.data
}
this.resourceTreeData.push(defaultPanelTree)
}
}).then(() => {
const form = { const form = {
panelType: 'self', panelType: 'self',
sort: 'create_time desc,node_type desc,name asc' sort: 'create_time desc,node_type desc,name asc'
} }
return groupTree(form, true).then((res) => { groupTree(form, true).then((res) => {
this.resourceTreeData = res.data this.resourceTreeData = [...this.resourceTreeData, ...res.data]
})
}) })
}, },
queryTypeChange(val) { queryTypeChange(val) {