diff --git a/core/core-backend/src/main/java/io/dataease/datasource/provider/ExcelUtils.java b/core/core-backend/src/main/java/io/dataease/datasource/provider/ExcelUtils.java index 5d6fe3eaf9..baf81e5d38 100644 --- a/core/core-backend/src/main/java/io/dataease/datasource/provider/ExcelUtils.java +++ b/core/core-backend/src/main/java/io/dataease/datasource/provider/ExcelUtils.java @@ -160,7 +160,10 @@ public class ExcelUtils { public static String getSize(CoreDatasource datasource) throws DEException { if (datasource.getType().equalsIgnoreCase("ExcelRemote")) { - return "0 B"; + ExcelConfiguration excelConfiguration = JsonUtil.parseObject(datasource.getConfiguration(), ExcelConfiguration.class); + for (ExcelSheetData sheet : excelConfiguration.getSheets()) { + return sheet.getSize(); + } } try { JsonNode rootNode = objectMapper.readTree(datasource.getConfiguration()); @@ -170,7 +173,6 @@ public class ExcelUtils { } catch (Exception e) { DEException.throwException(e); } - return "0 B"; } diff --git a/core/core-backend/src/main/java/io/dataease/datasource/server/DatasourceServer.java b/core/core-backend/src/main/java/io/dataease/datasource/server/DatasourceServer.java index d11152b0db..8619bf56ff 100644 --- a/core/core-backend/src/main/java/io/dataease/datasource/server/DatasourceServer.java +++ b/core/core-backend/src/main/java/io/dataease/datasource/server/DatasourceServer.java @@ -878,13 +878,11 @@ public class DatasourceServer implements DatasourceApi { if (ObjectUtils.isNotEmpty(remoteExcelRequest.getDatasourceId()) && 0L != remoteExcelRequest.getDatasourceId()) { coreDatasource = dataSourceManage.getCoreDatasource(remoteExcelRequest.getDatasourceId()); } - if (coreDatasource != null) { DatasourceRequest datasourceRequest = new DatasourceRequest(); datasourceRequest.setDatasource(transDTO(coreDatasource)); List datasetTableDTOS = ExcelUtils.getTables(datasourceRequest); List excelSheetDataList = new ArrayList<>(); - for (ExcelSheetData sheet : excelFileData.getSheets()) { for (DatasetTableDTO datasetTableDTO : datasetTableDTOS) { if (excelDataTableName(datasetTableDTO.getTableName()).equals(sheet.getTableName())) { @@ -900,7 +898,6 @@ public class DatasourceServer implements DatasourceApi { } excelFileData.setSheets(excelSheetDataList); } - for (ExcelSheetData sheet : excelFileData.getSheets()) { for (int i = 0; i < sheet.getFields().size() - 1; i++) { for (int j = i + 1; j < sheet.getFields().size(); j++) { diff --git a/core/core-frontend/src/assets/svg/icon_excel.svg b/core/core-frontend/src/assets/svg/icon_excel.svg index d2150443c1..ac07bdb107 100644 --- a/core/core-frontend/src/assets/svg/icon_excel.svg +++ b/core/core-frontend/src/assets/svg/icon_excel.svg @@ -1,11 +1,5 @@ - - - - - - - - - + + + diff --git a/core/core-frontend/src/locales/en.ts b/core/core-frontend/src/locales/en.ts index 5b1df71fcb..39891784fb 100644 --- a/core/core-frontend/src/locales/en.ts +++ b/core/core-frontend/src/locales/en.ts @@ -1143,7 +1143,7 @@ export default { remote_excel_url: 'Remote Excel/CSV Address', remote_excel_url_placeholder: 'Please enter the remote Excel/CSV address, for example, ftp://192.168.1.101/files/data.xlsx', - remote_excel_url_empty: 'The remote address cannot be empty', + remote_excel_url_empty: 'Please enter the remote Excel/CSV address', load_data: 'Load Data' }, chart: { diff --git a/core/core-frontend/src/locales/tw.ts b/core/core-frontend/src/locales/tw.ts index 1aaa6fa945..07d1c6a8ec 100644 --- a/core/core-frontend/src/locales/tw.ts +++ b/core/core-frontend/src/locales/tw.ts @@ -1109,7 +1109,7 @@ export default { remote_excel_url: '遠端 Excel/CSV 地址', remote_excel_url_placeholder: '請輸入遠端 Excel/CSV 地址,例如 ftp://192.168.1.101/files/data.xlsx', - remote_excel_url_empty: '遠端地址不能為空', + remote_excel_url_empty: '請輸入遠端 Excel/CSV 地址', load_data: '載入資料' }, chart: { diff --git a/core/core-frontend/src/locales/zh-CN.ts b/core/core-frontend/src/locales/zh-CN.ts index 326cb3cf09..2235ecaa59 100644 --- a/core/core-frontend/src/locales/zh-CN.ts +++ b/core/core-frontend/src/locales/zh-CN.ts @@ -1114,7 +1114,7 @@ export default { remote_excel_url: '远程 Excel/CSV 地址', remote_excel_url_placeholder: '请输入远程 Excel/CSV 地址,例如 ftp://192.168.1.101/files/data.xlsx', - remote_excel_url_empty: '远程地址不能为空', + remote_excel_url_empty: '请输入远程 Excel/CSV 地址', load_data: '加载数据' }, chart: { diff --git a/core/core-frontend/src/views/visualized/data/datasource/ExcelInfo.vue b/core/core-frontend/src/views/visualized/data/datasource/ExcelInfo.vue index ad2bdb6134..9bd7e47165 100644 --- a/core/core-frontend/src/views/visualized/data/datasource/ExcelInfo.vue +++ b/core/core-frontend/src/views/visualized/data/datasource/ExcelInfo.vue @@ -41,9 +41,8 @@ const del = () => { align-items: center; width: 100%; height: 58px; - padding: 0 16px 0 12px; + padding: 0 0 0 0; border-radius: 4px; - border: 1px solid #dee0e3; .excel { font-size: 32px; margin-right: 14.67px; diff --git a/core/core-frontend/src/views/visualized/data/datasource/form/ExcelRemoteDetail.vue b/core/core-frontend/src/views/visualized/data/datasource/form/ExcelRemoteDetail.vue index 9adfe0b9e3..0b71688969 100644 --- a/core/core-frontend/src/views/visualized/data/datasource/form/ExcelRemoteDetail.vue +++ b/core/core-frontend/src/views/visualized/data/datasource/form/ExcelRemoteDetail.vue @@ -114,7 +114,7 @@ const defaultRule = { name: [ { required: true, - message: t('datasource.input_name'), + message: t('sync_datasource.input_ds_name'), trigger: 'blur' }, { @@ -739,7 +739,7 @@ defineExpose({ v-show="activeStep !== 2" > @@ -912,8 +912,8 @@ defineExpose({ v-if="activeStep === 2" > - {{ t('datasource.all_scope') }} - {{ t('datasource.add_scope') }} + {{ t('datasource.append_data') }} + {{ t('datasource.replace_data') }} .editor-detail { - display: flex; - justify-content: center; - width: calc(100% + 48px); - margin: -8px -24px 0 -24px; - .ed-form-item { - margin-bottom: 16px; - } - - .table-select_mode { - display: flex; - align-items: center; - justify-content: space-between; - background: #f5f6f7; - padding: 16px; - .btn-select { - width: 164px; - height: 32px; - display: flex; - align-items: center; - justify-content: center; - background: #ffffff; - border: 1px solid #bbbfc4; - border-radius: 4px; - - .is-active { - background: var(--ed-color-primary-1a, rgba(51, 112, 255, 0.1)); - } - - .ed-button:not(.is-active) { - color: #1f2329; - } - .ed-button.is-text { - height: 24px; - width: 74px; - line-height: 24px; - } - .ed-button + .ed-button { - margin-left: 4px; - } - } - } - - .detail-operate { - height: 56px; - padding: 16px 24px; - font-size: 16px; - font-weight: 500; - width: 100%; - border-bottom: 1px solid rgba(31, 35, 41, 0.15); - } - .detail-inner { - width: 800px; - padding-top: 16px; - height: calc(100vh - 280px); - min-height: 700px; - - .dropdown-icon { - .down-outlined { - transform: rotate(180deg); - } - &[aria-expanded='true'] { - .down-outlined { - transform: rotate(0); - } - } - cursor: pointer; - } - - .error-status { - margin-top: 32px; - } - - .upload-tip { - color: #8f959e; - font-family: var(--de-custom_font, 'PingFang'); - font-size: 14px; - font-style: normal; - font-weight: 400; - line-height: 22px; - } - - .title-form_primary { - margin: 16px 0; - margin-top: 32px; - } - - .info-table { - width: 100%; - height: calc(100% - 200px); - &.info-table_height { - height: calc(100% - 379px); - } - } - } width: 100%; display: flex; justify-content: center; @@ -1162,6 +1068,46 @@ defineExpose({ } } .detail-inner { + height: calc(100vh - 280px); + min-height: 700px; + + .dropdown-icon { + .down-outlined { + transform: rotate(180deg); + } + &[aria-expanded='true'] { + .down-outlined { + transform: rotate(0); + } + } + cursor: pointer; + } + + .error-status { + margin-top: 32px; + } + + .upload-tip { + color: #8f959e; + font-family: var(--de-custom_font, 'PingFang'); + font-size: 14px; + font-style: normal; + font-weight: 400; + line-height: 22px; + } + + .title-form_primary { + margin: 16px 0; + margin-top: 32px; + } + + .info-table { + width: 100%; + height: calc(100% - 200px); + &.info-table_height { + height: calc(100% - 379px); + } + } width: 800px; padding-top: 8px; @@ -1277,6 +1223,47 @@ defineExpose({ align-items: center; } } + .table-select_mode { + display: flex; + align-items: center; + justify-content: space-between; + background: #f5f6f7; + padding: 16px; + .btn-select { + width: 164px; + height: 32px; + display: flex; + align-items: center; + justify-content: center; + background: #ffffff; + border: 1px solid #bbbfc4; + border-radius: 4px; + + .is-active { + background: var(--ed-color-primary-1a, rgba(51, 112, 255, 0.1)); + } + + .ed-button:not(.is-active) { + color: #1f2329; + } + .ed-button.is-text { + height: 24px; + width: 74px; + line-height: 24px; + } + .ed-button + .ed-button { + margin-left: 4px; + } + } + } + .detail-operate { + height: 56px; + padding: 16px 24px; + font-size: 16px; + font-weight: 500; + width: 100%; + border-bottom: 1px solid rgba(31, 35, 41, 0.15); + } } .api-card-content { diff --git a/core/core-frontend/src/views/visualized/data/datasource/form/index.vue b/core/core-frontend/src/views/visualized/data/datasource/form/index.vue index 1eede51d2e..a4ff357487 100644 --- a/core/core-frontend/src/views/visualized/data/datasource/form/index.vue +++ b/core/core-frontend/src/views/visualized/data/datasource/form/index.vue @@ -323,11 +323,7 @@ const handleShowFinishPage = ({ id, name, pid }) => { emitter.on('showFinishPage', handleShowFinishPage) const prev = () => { - if ( - ((currentDsType.value.includes('API') || currentDsType.value === 'ExcelRemote') && - activeApiStep.value === 1) || - activeStep.value === 1 - ) { + if (activeApiStep.value === 1) { ElMessageBox.confirm(t('data_source.the_previous_step'), { confirmButtonType: 'primary', type: 'warning',