diff --git a/core/core-frontend/src/api/dataset.ts b/core/core-frontend/src/api/dataset.ts index 27f6b3060b..b3f3dc0021 100644 --- a/core/core-frontend/src/api/dataset.ts +++ b/core/core-frontend/src/api/dataset.ts @@ -11,6 +11,13 @@ export interface DatasetOrFolder { allFields?: Array<{}> } +export interface EnumValue { + queryId: string + displayId?: string + sortId?: string + sort?: string +} + interface Fields { fields: Array<{}> data: Array<{}> @@ -76,6 +83,12 @@ export const renameDatasetTree = async (data: DatasetOrFolder): Promise[]> => { + return request.post({ url: '/datasetData/enumValueObj', data }).then(res => { + return res?.data + }) +} + export const moveDatasetTree = async (data: DatasetOrFolder): Promise => { return request.post({ url: '/datasetTree/move', data }).then(res => { return res?.data diff --git a/core/core-frontend/src/custom-component/v-query/Component.vue b/core/core-frontend/src/custom-component/v-query/Component.vue index f1d94e7a7b..23e3b86535 100644 --- a/core/core-frontend/src/custom-component/v-query/Component.vue +++ b/core/core-frontend/src/custom-component/v-query/Component.vue @@ -198,23 +198,24 @@ const dragover = () => { } const drop = e => { - const componentInfo: ComponentInfo = JSON.parse(e.dataTransfer.getData('dimension') || '{}') - if (!componentInfo.id) return - const checkedFields = [] - const checkedFieldsMap = {} - datasetFieldList.value.forEach(ele => { - if (ele.tableId === componentInfo.datasetId) { - checkedFields.push(ele.id) - checkedFieldsMap[ele.id] = componentInfo.id - } - }) - list.value.push({ - ...infoFormat(componentInfo), - auto: true, - optionValueSource: 1, - checkedFields, - checkedFieldsMap, - displayType: `${componentInfo.deType}` + const componentInfoArr: ComponentInfo[] = JSON.parse(e.dataTransfer.getData('dimension') || '{}') + componentInfoArr.forEach(componentInfo => { + const checkedFields = [] + const checkedFieldsMap = {} + datasetFieldList.value.forEach(ele => { + if (ele.tableId === componentInfo.datasetId) { + checkedFields.push(ele.id) + checkedFieldsMap[ele.id] = componentInfo.id + } + }) + list.value.push({ + ...infoFormat(componentInfo), + auto: true, + optionValueSource: 1, + checkedFields, + checkedFieldsMap, + displayType: `${componentInfo.deType}` + }) }) element.value.propValue = [...list.value] snapshotStore.recordSnapshotCache() diff --git a/core/core-frontend/src/custom-component/v-query/QueryConditionConfiguration.vue b/core/core-frontend/src/custom-component/v-query/QueryConditionConfiguration.vue index fd833d481d..03e5b1a53d 100644 --- a/core/core-frontend/src/custom-component/v-query/QueryConditionConfiguration.vue +++ b/core/core-frontend/src/custom-component/v-query/QueryConditionConfiguration.vue @@ -240,6 +240,8 @@ const computedTree = computed(() => { const handleDatasetChange = () => { curComponent.value.field.id = '' + curComponent.value.displayId = '' + curComponent.value.sortId = '' getOptions(curComponent.value.dataset.id, curComponent.value) } @@ -672,6 +674,7 @@ const parameterCompletion = () => { const attributes = { timeType: 'fixed', required: false, + defaultMapValue: [], parametersStart: null, conditionType: 0, conditionValueOperatorF: 'eq', @@ -691,6 +694,9 @@ const parameterCompletion = () => { timeNumRange: 0, relativeToCurrentTypeRange: 'year', aroundRange: 'f', + displayId: '', + sortId: '', + sort: 'asc', arbitraryTimeRange: new Date(), setTimeRange: false, showEmpty: false, @@ -743,10 +749,6 @@ const handleCondition = item => { valueSource.value.push('') valueSource.value.push('') } - curComponent.value.sortField = curComponent.value.sortField ?? { - id: '', - sortType: 'asc' - } parameterCompletion() nextTick(() => { curComponent.value.showError = showError.value @@ -1330,7 +1332,7 @@ defineExpose({