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()); diff --git a/frontend/src/views/panel/appTemplateMarket/log/index.vue b/frontend/src/views/panel/appTemplateMarket/log/index.vue index 6f2e1946b3..24bb969e13 100644 --- a/frontend/src/views/panel/appTemplateMarket/log/index.vue +++ b/frontend/src/views/panel/appTemplateMarket/log/index.vue @@ -2,74 +2,73 @@ - {{$t('commons.create')}} + >{{ $t('commons.create') }}   - + /> {{ $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") }}
- - + + \ No newline at end of file + diff --git a/frontend/src/views/system/log/index.vue b/frontend/src/views/system/log/index.vue index 6c734f4365..5335fb9118 100644 --- a/frontend/src/views/system/log/index.vue +++ b/frontend/src/views/system/log/index.vue @@ -9,64 +9,62 @@ - + /> {{ $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") }}
- - + + \ 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 f26205b02d..da9aa30d64 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 }} @@ -107,7 +104,7 @@ - +
{}, + 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 '' + } + } +}