From 44956f4609df3f0c321ad6d31d47b72f1a050c29 Mon Sep 17 00:00:00 2001 From: limengnan <420004014@qq.com> Date: Tue, 24 Jun 2025 15:16:08 +0800 Subject: [PATCH] =?UTF-8?q?=E6=9B=B4=E6=96=B0=E5=89=8D=E7=AB=AFsrc/views/v?= =?UTF-8?q?iewsnew/application/service/datasource=E7=9B=AE=E5=BD=95?= =?UTF-8?q?=E6=96=87=E4=BB=B6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../service/datasource/BaseInfoContent.vue | 26 +- .../service/datasource/BaseInfoItem.vue | 6 +- .../service/datasource/ExcelInfo.vue | 2 +- .../service/datasource/ExcelInfoBase.vue | 54 + .../datasource/form/ApiHttpRequestDraw.vue | 68 +- .../datasource/form/ApiHttpRequestForm.vue | 8 - .../service/datasource/form/ApiKeyValue.vue | 84 +- .../service/datasource/form/ApiVariable.vue | 3 - .../service/datasource/form/CreatDsGroup.vue | 6 +- .../service/datasource/form/EditorDetail.vue | 142 +- .../service/datasource/form/ExcelDetail.vue | 197 ++- .../datasource/form/ExcelRemoteDetail.vue | 1452 +++++++++++++++++ .../service/datasource/form/Pagination.vue | 10 +- .../service/datasource/form/index.vue | 200 ++- .../service/datasource/form/option.ts | 8 +- .../application/service/datasource/index.vue | 210 ++- 16 files changed, 2051 insertions(+), 425 deletions(-) create mode 100644 core/core-frontend/src/viewsnew/application/service/datasource/ExcelInfoBase.vue create mode 100644 core/core-frontend/src/viewsnew/application/service/datasource/form/ExcelRemoteDetail.vue diff --git a/core/core-frontend/src/viewsnew/application/service/datasource/BaseInfoContent.vue b/core/core-frontend/src/viewsnew/application/service/datasource/BaseInfoContent.vue index ec3d448..bf84201 100644 --- a/core/core-frontend/src/viewsnew/application/service/datasource/BaseInfoContent.vue +++ b/core/core-frontend/src/viewsnew/application/service/datasource/BaseInfoContent.vue @@ -2,10 +2,15 @@ import icon_expandRight_filled from '@/assets/svg/icon_expand-right_filled.svg' import { ref } from 'vue' import { propTypes } from '@/utils/propTypes' +import { timestampFormatDate } from '../dataset/form/util' +import { useI18n } from '@/hooks/web/useI18n' defineProps({ - name: propTypes.string.def('') + name: propTypes.string.def(''), + time: propTypes.number.def(0), + showTime: propTypes.bool.def(false) }) const active = ref(true) +const { t } = useI18n() defineExpose({ active }) @@ -13,13 +18,15 @@ defineExpose({ @@ -61,7 +68,12 @@ defineExpose({ line-height: 24px; margin-left: 8px; } - + .time { + color: #8f959e; + font-size: 14px; + line-height: 22px; + padding: 0 0 0 8px; + } &.active { .title { .ed-icon { diff --git a/core/core-frontend/src/viewsnew/application/service/datasource/BaseInfoItem.vue b/core/core-frontend/src/viewsnew/application/service/datasource/BaseInfoItem.vue index d013785..cca145e 100644 --- a/core/core-frontend/src/viewsnew/application/service/datasource/BaseInfoItem.vue +++ b/core/core-frontend/src/viewsnew/application/service/datasource/BaseInfoItem.vue @@ -7,10 +7,10 @@ defineProps({ diff --git a/core/core-frontend/src/viewsnew/application/service/datasource/ExcelInfo.vue b/core/core-frontend/src/viewsnew/application/service/datasource/ExcelInfo.vue index ad2bdb6..4984a01 100644 --- a/core/core-frontend/src/viewsnew/application/service/datasource/ExcelInfo.vue +++ b/core/core-frontend/src/viewsnew/application/service/datasource/ExcelInfo.vue @@ -1,7 +1,7 @@ + + + + diff --git a/core/core-frontend/src/viewsnew/application/service/datasource/form/ApiHttpRequestDraw.vue b/core/core-frontend/src/viewsnew/application/service/datasource/form/ApiHttpRequestDraw.vue index 0110386..391b99f 100644 --- a/core/core-frontend/src/viewsnew/application/service/datasource/form/ApiHttpRequestDraw.vue +++ b/core/core-frontend/src/viewsnew/application/service/datasource/form/ApiHttpRequestDraw.vue @@ -190,7 +190,17 @@ const initApiItem = ( ) => { pluginDs.value = pluginDsList pluginIndex.value = indexPlugin - isPlugin.value = isPluginDs + if (!isPluginDs) { + const arr = pluginDs.value.filter(ele => { + return ele.type === from.type + }) + if (arr && arr.length > 0) { + isPlugin.value = true + } + } else { + isPlugin.value = isPluginDs + } + copyItem.value = val.copy copyDs.value = from.copy dsType.value = from.type @@ -354,6 +364,12 @@ const saveItem = () => { } } returnAPIItem('returnItem', cloneDeep(apiItem)) + if (isPlugin.value) { + xpackApiItemBasicInfo?.value?.invokeMethod({ + methodName: 'resetForm', + args: [] + }) + } edit_api_item.value = false } const before = () => { @@ -450,12 +466,14 @@ const validateItem = () => { } cancelMap['/datasource/checkApiDatasource']?.() const params = Base64.encode(JSON.stringify(paramsList)) + formLoading.value = true checkApiItem({ dsType: dsType.value, data: Base64.encode(JSON.stringify(apiItem)), paramsList: params }) .then(response => { + formLoading.value = false apiItem.jsonFields = response.data.jsonFields apiItem.fields = [] apiItem.name = response.data.name @@ -464,6 +482,7 @@ const validateItem = () => { ElMessage.success(t('datasource.validate_success')) }) .catch(() => { + formLoading.value = false ElMessage.error(t('data_source.verification_failed')) }) } @@ -483,6 +502,12 @@ const handleSubmit = param => { const closeEditItem = () => { cancelMap['/datasource/checkApiDatasource']?.() + if (isPlugin.value) { + xpackApiItemBasicInfo?.value?.invokeMethod({ + methodName: 'resetForm', + args: [] + }) + } edit_api_item.value = false } @@ -645,35 +670,25 @@ defineExpose({ activeName === 'table' ? t('datasource.data_table') : t('data_source.interface_parameters') " v-model="edit_api_item" - custom-class="api-datasource-drawer" + modal-class="api-datasource-drawer" size="1000px" :before-close="closeEditItem" direction="rtl" > -
- +
+ -