From 585d737d43de13fcd536169a8a2c7d636850dc2c Mon Sep 17 00:00:00 2001 From: taojinlong Date: Wed, 28 Sep 2022 12:04:26 +0800 Subject: [PATCH 1/4] =?UTF-8?q?fix:=20=E5=88=9B=E5=BB=BA=E5=A4=9Asheet?= =?UTF-8?q?=E9=A1=B5=E7=9A=84Excel=E6=95=B0=E6=8D=AE=E9=9B=86=EF=BC=8C?= =?UTF-8?q?=E8=A1=A8=E4=B8=AD=E6=95=B0=E6=8D=AE=E6=A0=BC=E5=BC=8F=E6=9C=89?= =?UTF-8?q?=E9=97=AE=E9=A2=98=E4=BB=8D=E7=84=B6=E4=BC=9A=E5=88=9B=E5=BB=BA?= =?UTF-8?q?=E6=95=B0=E6=8D=AE=E9=9B=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../service/dataset/DataSetTableService.java | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/backend/src/main/java/io/dataease/service/dataset/DataSetTableService.java b/backend/src/main/java/io/dataease/service/dataset/DataSetTableService.java index f1be09918c..1486fc545f 100644 --- a/backend/src/main/java/io/dataease/service/dataset/DataSetTableService.java +++ b/backend/src/main/java/io/dataease/service/dataset/DataSetTableService.java @@ -204,6 +204,19 @@ public class DataSetTableService { excelSheetData.setData(null); excelSheetData.setJsonArray(null); }); + } + for (String s : map.keySet()) { + DataSetTableRequest sheetTable = new DataSetTableRequest(); + BeanUtils.copyBean(sheetTable, datasetTable); + sheetTable.setId(UUID.randomUUID().toString()); + sheetTable.setCreateBy(AuthUtils.getUser().getUsername()); + sheetTable.setCreateTime(System.currentTimeMillis()); + List excelSheetDataList = map.get(s); + sheetTable.setName(excelSheetDataList.get(0).getDatasetName()); + excelSheetDataList.forEach(excelSheetData -> { + excelSheetData.setData(null); + excelSheetData.setJsonArray(null); + }); DataTableInfoDTO info = new DataTableInfoDTO(); info.setExcelSheetDataList(excelSheetDataList); sheetTable.setInfo(new Gson().toJson(info)); @@ -225,6 +238,9 @@ public class DataSetTableService { if (checkIsRepeat(fieldArray)) { DataEaseException.throwException(Translator.get("i18n_excel_field_repeat")); } + } + + for (ExcelSheetData sheet : datasetTable.getSheets()) { DataSetTableRequest sheetTable = new DataSetTableRequest(); BeanUtils.copyBean(sheetTable, datasetTable); sheetTable.setId(UUID.randomUUID().toString()); From 3255cfb4493fd0141099120b7e86ceece619c112 Mon Sep 17 00:00:00 2001 From: taojinlong Date: Wed, 28 Sep 2022 13:36:27 +0800 Subject: [PATCH 2/4] =?UTF-8?q?fix:=20API=20=E6=95=B0=E6=8D=AE=E9=9B=86?= =?UTF-8?q?=E5=AD=97=E6=AE=B5=E7=B1=BB=E5=9E=8B=E5=B1=95=E7=A4=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/views/system/datasource/dsTable.vue | 101 +++++++++++------- 1 file changed, 62 insertions(+), 39 deletions(-) diff --git a/frontend/src/views/system/datasource/dsTable.vue b/frontend/src/views/system/datasource/dsTable.vue index 2b0e9b13ae..ade0b4a39e 100644 --- a/frontend/src/views/system/datasource/dsTable.vue +++ b/frontend/src/views/system/datasource/dsTable.vue @@ -6,17 +6,16 @@ - + />
@@ -37,11 +36,11 @@ > @@ -71,47 +70,64 @@ - - - - - - - + :data="dsTableData" + stripe + style="width: 100%" + > + + + + + + + +
\ No newline at end of file + From bf118ffb7ab25620ac2bffd9d9943d43aa631b45 Mon Sep 17 00:00:00 2001 From: taojinlong Date: Wed, 28 Sep 2022 14:47:36 +0800 Subject: [PATCH 3/4] =?UTF-8?q?fix:=20=E7=B3=BB=E7=BB=9F=E5=8F=82=E6=95=B0?= =?UTF-8?q?=E9=A1=B5=E9=9D=A2=E8=B0=83=E6=95=B4=E9=97=B4=E9=9A=94?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- frontend/src/views/system/SysParam/BasicSetting.vue | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/frontend/src/views/system/SysParam/BasicSetting.vue b/frontend/src/views/system/SysParam/BasicSetting.vue index 369608b71b..da530395c5 100644 --- a/frontend/src/views/system/SysParam/BasicSetting.vue +++ b/frontend/src/views/system/SysParam/BasicSetting.vue @@ -47,7 +47,7 @@ - + @@ -374,6 +374,13 @@ export default { width: 156px; } } + +.demo-form-inline-ds { + .el-form-item { + margin-bottom: 0px !important; + } +} + \ No newline at end of file + diff --git a/frontend/src/views/system/task/TaskRecord.vue b/frontend/src/views/system/task/TaskRecord.vue index da8f158aea..f138e175c9 100644 --- a/frontend/src/views/system/task/TaskRecord.vue +++ b/frontend/src/views/system/task/TaskRecord.vue @@ -6,60 +6,58 @@ - + /> {{ $t("user.filter") - }} + >{{ $t("user.filter") + }} -
+
{{ paginationConfig.total }} {{ $t("user.result_one") }} - + + @click="scrollPre" + />
-

- {{ ele }} +

+ {{ ele }}

+ @click="scrollNext" + /> {{ $t("user.clear_filter") }} + >{{ $t("user.clear_filter") }}
{{ scope.row.name }} + >{{ scope.row.name }} @@ -99,15 +96,15 @@ {{ $t(`dataset.${scope.row.status.toLocaleLowerCase()}`) }} - + >{{ $t(`dataset.${scope.row.status.toLocaleLowerCase()}`) }} + - - +
{}, + default: () => {} }, transCondition: { type: Object, - default: () => {}, - }, + default: () => {} + } }, data() { return { columns: [], - nikeName: "", + nickName: '', showScroll: false, filterTexts: [], cacheCondition: [], paginationConfig: { currentPage: 1, pageSize: 10, - total: 0, + total: 0 }, data: [], orderConditions: [], show_error_massage: false, - error_massage: "", + error_massage: '', matchLogId: null, - lastRequestComplete: true, - }; - }, - created() { - const { taskId: id, name: label } = this.transCondition; - if (id) { - this.nikeName = label; + lastRequestComplete: true } - const { taskId, name, logId } = (this.param || {}); - if (this.param !== null && taskId) { - this.matchLogId = logId || this.matchLogId; - this.transCondition.taskId = taskId; - this.transCondition.name = name; - this.nikeName = name; - } - this.createTimer(); - }, - mounted() { - this.resizeObserver(); }, watch: { filterTexts: { handler() { - this.getScrollStatus(); + this.getScrollStatus() }, - deep: true, - }, + deep: true + } + }, + created() { + const { taskId: id, name: label } = this.transCondition + if (id) { + this.nickName = label + } + const { taskId, name, logId } = (this.param || {}) + if (this.param !== null && taskId) { + this.matchLogId = logId || this.matchLogId + this.transCondition.taskId = taskId + this.transCondition.name = name + this.nickName = name + } + this.createTimer() + }, + mounted() { + this.resizeObserver() }, beforeDestroy() { - this.destroyTimer(); + this.destroyTimer() }, methods: { exportConfirm() { - this.$confirm(this.$t("log.confirm"), "", { - confirmButtonText: this.$t("commons.confirm"), - cancelButtonText: this.$t("commons.cancel"), - type: "warning", + this.$confirm(this.$t('log.confirm'), '', { + confirmButtonText: this.$t('commons.confirm'), + cancelButtonText: this.$t('commons.cancel'), + type: 'warning' }) .then(() => { - this.exportData(); + this.exportData() }) .catch(() => { // this.$info(this.$t('commons.delete_cancel')) - }); + }) }, exportData() { - const { taskId, name } = this.transCondition; + const { taskId, name } = this.transCondition const param = { orders: formatOrders(this.orderConditions), - conditions: [...this.cacheCondition], - }; - if (this.nikeName) { + conditions: [...this.cacheCondition] + } + if (this.nickName) { param.conditions.push({ field: `dataset_table_task.name`, - operator: "like", - value: this.nikeName, - }); + operator: 'like', + value: this.nickName + }) } - if (taskId && this.nikeName === name) { + if (taskId && this.nickName === name) { param.conditions.push({ - operator: "eq", + operator: 'eq', value: taskId, - field: "dataset_table_task.id", - }); + field: 'dataset_table_task.id' + }) } exportExcel(param).then((res) => { - const blob = new Blob([res], { type: "application/vnd.ms-excel" }); - const link = document.createElement("a"); - link.style.display = "none"; - link.href = URL.createObjectURL(blob); - link.download = "DataEase" + this.$t("dataset.sync_log") + ".xls"; - document.body.appendChild(link); - link.click(); - document.body.removeChild(link); - }); + const blob = new Blob([res], { type: 'application/vnd.ms-excel' }) + const link = document.createElement('a') + link.style.display = 'none' + link.href = URL.createObjectURL(blob) + link.download = 'DataEase' + this.$t('dataset.sync_log') + '.xls' + document.body.appendChild(link) + link.click() + document.body.removeChild(link) + }) }, getScrollStatus() { this.$nextTick(() => { - const dom = document.querySelector(".filter-texts-container"); - this.showScroll = dom && dom.scrollWidth > dom.offsetWidth; - }); + const dom = document.querySelector('.filter-texts-container') + this.showScroll = dom && dom.scrollWidth > dom.offsetWidth + }) }, resizeObserver() { this.resizeForFilter = new ResizeObserver((entries) => { - if (!this.filterTexts.length) return; - this.layoutResize(); - }); + if (!this.filterTexts.length) return + this.layoutResize() + }) this.resizeForFilter.observe( - document.querySelector("#resize-for-filter") - ); + document.querySelector('#resize-for-filter') + ) }, - layoutResize: _.debounce(function () { - this.getScrollStatus(); + layoutResize: _.debounce(function() { + this.getScrollStatus() }, 200), scrollPre() { - const dom = document.querySelector(".filter-texts-container"); - dom.scrollLeft -= 10; + const dom = document.querySelector('.filter-texts-container') + dom.scrollLeft -= 10 if (dom.scrollLeft <= 0) { - dom.scrollLeft = 0; + dom.scrollLeft = 0 } }, scrollNext() { - const dom = document.querySelector(".filter-texts-container"); - dom.scrollLeft += 10; - const width = dom.scrollWidth - dom.offsetWidth; + const dom = document.querySelector('.filter-texts-container') + dom.scrollLeft += 10 + const width = dom.scrollWidth - dom.offsetWidth if (dom.scrollLeft > width) { - dom.scrollLeft = width; + dom.scrollLeft = width } }, clearFilter() { - this.$refs.filterUser.clearFilter(); + this.$refs.filterUser.clearFilter() }, clearOneFilter(index) { - this.$refs.filterUser.clearOneFilter(index); - this.$refs.filterUser.search(); + this.$refs.filterUser.clearOneFilter(index) + this.$refs.filterUser.search() }, filterDraw(condition, filterTexts = []) { - this.cacheCondition = condition; - this.filterTexts = filterTexts; - this.initSearch(); + this.cacheCondition = condition + this.filterTexts = filterTexts + this.initSearch() }, filterShow() { - this.$refs.filterUser.init(); + this.$refs.filterUser.init() }, createTimer() { - this.initSearch(); + this.initSearch() if (!this.timer) { this.timer = setInterval(() => { - this.timerSearch(false); - }, 15000); + this.timerSearch(false) + }, 15000) } }, destroyTimer() { if (this.timer) { - clearInterval(this.timer); - this.timer = null; + clearInterval(this.timer) + this.timer = null } }, handleSizeChange(pageSize) { - this.paginationConfig.currentPage = 1; - this.paginationConfig.pageSize = pageSize; - this.search(); + this.paginationConfig.currentPage = 1 + this.paginationConfig.pageSize = pageSize + this.search() }, handleCurrentChange(currentPage) { - this.paginationConfig.currentPage = currentPage; - this.search(); + this.paginationConfig.currentPage = currentPage + this.search() }, initSearch() { - this.handleCurrentChange(1); + this.handleCurrentChange(1) }, timerSearch(showLoading = true) { if (!this.lastRequestComplete) { - return; + return } else { - this.lastRequestComplete = false; + this.lastRequestComplete = false } - const { taskId, name } = this.transCondition; + const { taskId, name } = this.transCondition const param = { orders: formatOrders(this.orderConditions), - conditions: [...this.cacheCondition], - }; - if (this.nikeName) { + conditions: [...this.cacheCondition] + } + if (this.nickName) { param.conditions.push({ field: `dataset_table_task.name`, - operator: "like", - value: this.nikeName, - }); + operator: 'like', + value: this.nickName + }) } - if (taskId && this.nikeName === name) { + if (taskId && this.nickName === name) { param.conditions.push({ - operator: "eq", + operator: 'eq', value: taskId, - field: "dataset_table_task.id", - }); + field: 'dataset_table_task.id' + }) } post( - "/dataset/taskLog/list/notexcel/" + + '/dataset/taskLog/list/notexcel/' + this.paginationConfig.currentPage + - "/" + + '/' + this.paginationConfig.pageSize, param, showLoading ) .then((response) => { - this.data = response.data.listObject; - this.paginationConfig.total = response.data.itemCount; - this.lastRequestComplete = true; + this.data = response.data.listObject + this.paginationConfig.total = response.data.itemCount + this.lastRequestComplete = true }) .catch(() => { - this.lastRequestComplete = true; - }); + this.lastRequestComplete = true + }) }, search(condition, showLoading = true) { - const { taskId, name } = this.transCondition; + const { taskId, name } = this.transCondition const param = { orders: formatOrders(this.orderConditions), - conditions: [...this.cacheCondition], - }; - if (this.nikeName) { + conditions: [...this.cacheCondition] + } + if (this.nickName) { param.conditions.push({ field: `dataset_table_task.name`, - operator: "like", - value: this.nikeName, - }); + operator: 'like', + value: this.nickName + }) } - if (taskId && this.nikeName === name) { + if (taskId && this.nickName === name) { param.conditions.push({ - operator: "eq", + operator: 'eq', value: taskId, - field: "dataset_table_task.id", - }); + field: 'dataset_table_task.id' + }) } post( - "/dataset/taskLog/list/notexcel/" + + '/dataset/taskLog/list/notexcel/' + this.paginationConfig.currentPage + - "/" + + '/' + this.paginationConfig.pageSize, param, showLoading ).then((response) => { - this.data = response.data.listObject; - this.paginationConfig.total = response.data.itemCount; - }); + this.data = response.data.listObject + this.paginationConfig.total = response.data.itemCount + }) }, showErrorMassage(massage) { - this.show_error_massage = true; - this.error_massage = massage; + this.show_error_massage = true + this.error_massage = massage }, jumpTask(item) { - this.$emit("jumpTask", item); + this.$emit('jumpTask', item) }, rowClassMethod({ row, rowIndex }) { if (this.matchLogId && this.matchLogId === row.id) { - return "row-match-class"; + return 'row-match-class' } - return ""; - }, - }, -}; + return '' + } + } +}