forked from github/dataease
Merge pull request #7967 from dataease/pr@dev-v2_query_com
Pr@dev v2 query com
This commit is contained in:
commit
a3884205c7
@ -41,6 +41,7 @@ const defaultProps = {
|
||||
children: 'children',
|
||||
label: 'name'
|
||||
}
|
||||
const mounted = ref(false)
|
||||
const rootManage = ref(false)
|
||||
const anyManage = ref(false)
|
||||
const { curCanvasType, showPosition } = toRefs(props)
|
||||
@ -219,6 +220,7 @@ function flatTree(tree: BusiTreeNode[]) {
|
||||
}
|
||||
|
||||
const afterTreeInit = () => {
|
||||
mounted.value = true
|
||||
if (selectedNodeKey.value && returnMounted.value) {
|
||||
expandedArray.value = getDefaultExpandedKeys()
|
||||
returnMounted.value = false
|
||||
@ -371,7 +373,8 @@ onMounted(() => {
|
||||
defineExpose({
|
||||
rootManage,
|
||||
hasData,
|
||||
createNewObject
|
||||
createNewObject,
|
||||
mounted
|
||||
})
|
||||
</script>
|
||||
|
||||
|
@ -52,6 +52,9 @@ const isDataEaseBi = computed(() => appStore.getIsDataEaseBi)
|
||||
const rootManage = computed(() => {
|
||||
return resourceTreeRef.value?.rootManage
|
||||
})
|
||||
const mounted = computed(() => {
|
||||
return resourceTreeRef.value?.mounted
|
||||
})
|
||||
|
||||
function createNew() {
|
||||
resourceTreeRef.value?.createNewObject()
|
||||
@ -188,10 +191,10 @@ defineExpose({
|
||||
></de-preview>
|
||||
</div>
|
||||
</template>
|
||||
<template v-else-if="hasTreeData">
|
||||
<template v-else-if="hasTreeData && mounted">
|
||||
<empty-background description="请在左侧选择仪表板" img-type="select" />
|
||||
</template>
|
||||
<template v-else>
|
||||
<template v-else-if="mounted">
|
||||
<empty-background description="暂无仪表板" img-type="none">
|
||||
<el-button v-if="rootManage && !isDataEaseBi" @click="createNew" type="primary">
|
||||
<template #icon>
|
||||
|
@ -39,6 +39,10 @@ const hasTreeData = computed(() => {
|
||||
return resourceTreeRef.value?.hasData
|
||||
})
|
||||
|
||||
const mounted = computed(() => {
|
||||
return resourceTreeRef.value?.mounted
|
||||
})
|
||||
|
||||
const rootManage = computed(() => {
|
||||
return resourceTreeRef.value?.rootManage
|
||||
})
|
||||
@ -172,10 +176,10 @@ onBeforeMount(() => {
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
<template v-else-if="hasTreeData">
|
||||
<template v-else-if="hasTreeData && mounted">
|
||||
<empty-background description="请在左侧选择数据大屏" img-type="select" />
|
||||
</template>
|
||||
<template v-else>
|
||||
<template v-else-if="mounted">
|
||||
<empty-background description="暂无数据大屏" img-type="none">
|
||||
<el-button v-if="rootManage && !isDataEaseBi" @click="createNew" type="primary">
|
||||
<template #icon>
|
||||
|
@ -63,6 +63,7 @@ const state = reactive({
|
||||
|
||||
const resourceGroupOpt = ref()
|
||||
const curCanvasType = ref('')
|
||||
const mounted = ref(false)
|
||||
|
||||
const isDataEaseBi = computed(() => appStore.getIsDataEaseBi)
|
||||
const createPanel = path => {
|
||||
@ -204,6 +205,7 @@ const getData = () => {
|
||||
})
|
||||
.finally(() => {
|
||||
dtLoading.value = false
|
||||
mounted.value = true
|
||||
nextTick(() => {
|
||||
if (!!nickName.value.length) {
|
||||
datasetListTree.value.filter(nickName.value)
|
||||
@ -573,7 +575,7 @@ const getMenuList = (val: boolean) => {
|
||||
</el-aside>
|
||||
|
||||
<div class="dataset-content" :class="isDataEaseBi && 'h100'">
|
||||
<template v-if="!state.datasetTree.length">
|
||||
<template v-if="!state.datasetTree.length && mounted">
|
||||
<empty-background description="暂无数据集" img-type="none">
|
||||
<el-button
|
||||
v-if="rootManage && !isDataEaseBi"
|
||||
@ -680,7 +682,7 @@ const getMenuList = (val: boolean) => {
|
||||
</template>
|
||||
</div>
|
||||
</template>
|
||||
<template v-else>
|
||||
<template v-else-if="mounted">
|
||||
<empty-background :description="t('deDataset.on_the_left')" img-type="select" />
|
||||
</template>
|
||||
</div>
|
||||
|
@ -11,7 +11,7 @@ import EmptyBackground from '@/components/empty-background/src/EmptyBackground.v
|
||||
import { checkApiItem } from '@/api/datasource'
|
||||
import { cloneDeep } from 'lodash-es'
|
||||
import { fieldType } from '@/utils/attr'
|
||||
import { ApiConfiguration } from '@/views/visualized/data/datasource/form/index.vue'
|
||||
import type { ApiConfiguration } from '@/views/visualized/data/datasource/form/option'
|
||||
|
||||
export interface Field {
|
||||
name: string
|
||||
|
@ -11,6 +11,7 @@ import ExcelDetail from './ExcelDetail.vue'
|
||||
import { save, update, validate, latestUse, isShowFinishPage, checkRepeat } from '@/api/datasource'
|
||||
import { Base64 } from 'js-base64'
|
||||
import type { Param } from './ExcelDetail.vue'
|
||||
import type { Configuration, ApiConfiguration, SyncSetting } from './option'
|
||||
import { dsTypes, typeList, nameMap } from './option'
|
||||
import { useRouter } from 'vue-router'
|
||||
import { uuid } from 'vue-uuid'
|
||||
@ -53,45 +54,6 @@ state.datasourceTree = typeList.map(ele => {
|
||||
}
|
||||
})
|
||||
|
||||
export interface Configuration {
|
||||
dataBase: string
|
||||
connectionType: string
|
||||
schema: string
|
||||
extraParams: string
|
||||
username: string
|
||||
password: string
|
||||
host: string
|
||||
authMethod: string
|
||||
port: string
|
||||
initialPoolSize: string
|
||||
minPoolSize: string
|
||||
maxPoolSize: string
|
||||
queryTimeout: string
|
||||
}
|
||||
|
||||
export interface ApiConfiguration {
|
||||
id: string
|
||||
name: string
|
||||
deTableName: string
|
||||
method: string
|
||||
url: string
|
||||
status: string
|
||||
useJsonPath: boolean
|
||||
serialNumber: number
|
||||
}
|
||||
|
||||
export interface SyncSetting {
|
||||
id: string
|
||||
updateType: string
|
||||
syncRate: string
|
||||
simpleCronValue: number
|
||||
simpleCronType: string
|
||||
startTime: number
|
||||
endTime: number
|
||||
endLimit: string
|
||||
cron: string
|
||||
}
|
||||
|
||||
const activeStep = ref(0)
|
||||
const detail = ref()
|
||||
const excel = ref()
|
||||
|
@ -119,3 +119,61 @@ export const nameMap = {
|
||||
OTHER: 'API数据',
|
||||
LOCAL: t('datasource.local_file')
|
||||
}
|
||||
|
||||
export interface Configuration {
|
||||
dataBase: string
|
||||
connectionType: string
|
||||
schema: string
|
||||
extraParams: string
|
||||
username: string
|
||||
password: string
|
||||
host: string
|
||||
authMethod: string
|
||||
port: string
|
||||
initialPoolSize: string
|
||||
minPoolSize: string
|
||||
maxPoolSize: string
|
||||
queryTimeout: string
|
||||
}
|
||||
|
||||
export interface ApiConfiguration {
|
||||
id: string
|
||||
name: string
|
||||
deTableName: string
|
||||
method: string
|
||||
url: string
|
||||
status: string
|
||||
useJsonPath: boolean
|
||||
serialNumber: number
|
||||
}
|
||||
|
||||
export interface SyncSetting {
|
||||
id: string
|
||||
updateType: string
|
||||
syncRate: string
|
||||
simpleCronValue: number
|
||||
simpleCronType: string
|
||||
startTime: number
|
||||
endTime: number
|
||||
endLimit: string
|
||||
cron: string
|
||||
}
|
||||
|
||||
export interface Node {
|
||||
name: string
|
||||
createBy: string
|
||||
creator: string
|
||||
createTime: string
|
||||
id: number | string
|
||||
size: number
|
||||
description: string
|
||||
type: string
|
||||
nodeType: string
|
||||
fileName: string
|
||||
syncSetting?: SyncSetting
|
||||
editType?: number
|
||||
configuration?: Configuration
|
||||
apiConfiguration?: ApiConfiguration[]
|
||||
weight?: number
|
||||
lastSyncTime?: number | string
|
||||
}
|
||||
|
@ -30,7 +30,7 @@ import {
|
||||
syncApiTable
|
||||
} from '@/api/datasource'
|
||||
import { Base64 } from 'js-base64'
|
||||
import type { Configuration, ApiConfiguration, SyncSetting } from './form/index.vue'
|
||||
import type { SyncSetting, Node } from './form/option'
|
||||
import EditorDatasource from './form/index.vue'
|
||||
import ExcelInfo from './ExcelInfo.vue'
|
||||
import SheetTabs from './SheetTabs.vue'
|
||||
@ -49,25 +49,6 @@ interface Field {
|
||||
deType: number
|
||||
}
|
||||
|
||||
export interface Node {
|
||||
name: string
|
||||
createBy: string
|
||||
creator: string
|
||||
createTime: string
|
||||
id: number | string
|
||||
size: number
|
||||
description: string
|
||||
type: string
|
||||
nodeType: string
|
||||
fileName: string
|
||||
syncSetting?: SyncSetting
|
||||
editType?: number
|
||||
configuration?: Configuration
|
||||
apiConfiguration?: ApiConfiguration[]
|
||||
weight?: number
|
||||
lastSyncTime?: number | string
|
||||
}
|
||||
|
||||
const { t } = useI18n()
|
||||
const router = useRouter()
|
||||
const appStore = useAppStoreWithOut()
|
||||
@ -386,6 +367,7 @@ const saveDsFolder = (params, successCb, finallyCb, cmd) => {
|
||||
}
|
||||
|
||||
const dsLoading = ref(false)
|
||||
const mounted = ref(false)
|
||||
|
||||
const listDs = () => {
|
||||
rawDatasourceList.value = []
|
||||
@ -403,6 +385,7 @@ const listDs = () => {
|
||||
state.datasourceTree = nodeData
|
||||
})
|
||||
.finally(() => {
|
||||
mounted.value = true
|
||||
dsLoading.value = false
|
||||
updateTreeExpand()
|
||||
const id = nodeInfo.id
|
||||
@ -794,7 +777,7 @@ const getMenuList = (val: boolean) => {
|
||||
</el-aside>
|
||||
|
||||
<div class="datasource-content" :class="isDataEaseBi && 'h100'">
|
||||
<template v-if="!state.datasourceTree.length">
|
||||
<template v-if="!state.datasourceTree.length && mounted">
|
||||
<empty-background description="暂无数据源" img-type="none">
|
||||
<el-button
|
||||
v-if="rootManage && !isDataEaseBi"
|
||||
@ -1228,7 +1211,7 @@ const getMenuList = (val: boolean) => {
|
||||
</BaseInfoContent>
|
||||
</template>
|
||||
</template>
|
||||
<template v-else>
|
||||
<template v-else-if="mounted">
|
||||
<empty-background description="请在左侧选择数据源" img-type="select" />
|
||||
</template>
|
||||
</div>
|
||||
|
Loading…
Reference in New Issue
Block a user