From afbad86b9315794b130c818748759a270245eafe Mon Sep 17 00:00:00 2001 From: wangjiahao <1522128093@qq.com> Date: Tue, 3 Aug 2021 13:18:21 +0800 Subject: [PATCH 01/15] =?UTF-8?q?fix:=E4=BB=AA=E8=A1=A8=E6=9D=BF=E6=A0=B7?= =?UTF-8?q?=E5=BC=8F=E4=BF=AE=E6=94=B9=E4=BF=9D=E5=AD=98=E6=8C=89=E9=92=AE?= =?UTF-8?q?=E8=BF=98=E6=98=AF=E7=81=B0=E7=9A=84=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- frontend/src/components/DeDrag/DragShadow.vue | 172 ++++++++++++++++++ .../canvas/components/Editor/index.vue | 1 + 2 files changed, 173 insertions(+) create mode 100644 frontend/src/components/DeDrag/DragShadow.vue diff --git a/frontend/src/components/DeDrag/DragShadow.vue b/frontend/src/components/DeDrag/DragShadow.vue new file mode 100644 index 0000000000..60d9e6d358 --- /dev/null +++ b/frontend/src/components/DeDrag/DragShadow.vue @@ -0,0 +1,172 @@ + + + + + diff --git a/frontend/src/components/canvas/components/Editor/index.vue b/frontend/src/components/canvas/components/Editor/index.vue index b647626b30..e3ba326800 100644 --- a/frontend/src/components/canvas/components/Editor/index.vue +++ b/frontend/src/components/canvas/components/Editor/index.vue @@ -275,6 +275,7 @@ export default { // 第一次变化 不需要 重置边界 待改进 if (this.changeIndex++ > 0) { this.resizeParentBounds() + this.$store.state.styleChangeTimes++ } // this.changeScale() }, From 673f4ea4a6b47a1430b7c4a892a76e743bdcb373 Mon Sep 17 00:00:00 2001 From: taojinlong Date: Tue, 3 Aug 2021 15:37:32 +0800 Subject: [PATCH 02/15] =?UTF-8?q?feat:=20=E4=BC=98=E5=8C=96=E4=BB=BB?= =?UTF-8?q?=E5=8A=A1=E7=8A=B6=E6=80=81=E7=9A=84=E5=88=87=E6=8D=A2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../dataset/DataSetTableTaskController.java | 2 +- .../dataset/DataSetTableTaskService.java | 14 ++++++++----- .../resources/i18n/messages_en_US.properties | 5 ++++- .../resources/i18n/messages_zh_CN.properties | 4 ++++ .../resources/i18n/messages_zh_TW.properties | 5 ++++- .../src/views/system/task/DatasetTaskList.vue | 21 ++++++++++++------- 6 files changed, 35 insertions(+), 16 deletions(-) diff --git a/backend/src/main/java/io/dataease/controller/dataset/DataSetTableTaskController.java b/backend/src/main/java/io/dataease/controller/dataset/DataSetTableTaskController.java index 5eb8b32c92..14a5c365f9 100644 --- a/backend/src/main/java/io/dataease/controller/dataset/DataSetTableTaskController.java +++ b/backend/src/main/java/io/dataease/controller/dataset/DataSetTableTaskController.java @@ -57,7 +57,7 @@ public class DataSetTableTaskController { } @PostMapping("/updateStatus") - public void updateStatus(@RequestBody DatasetTableTask datasetTableTask) { + public void updateStatus(@RequestBody DatasetTableTask datasetTableTask) throws Exception{ dataSetTableTaskService.updateDatasetTableTaskStatus(datasetTableTask); } diff --git a/backend/src/main/java/io/dataease/service/dataset/DataSetTableTaskService.java b/backend/src/main/java/io/dataease/service/dataset/DataSetTableTaskService.java index e3fb3369ed..5ee2153f2e 100644 --- a/backend/src/main/java/io/dataease/service/dataset/DataSetTableTaskService.java +++ b/backend/src/main/java/io/dataease/service/dataset/DataSetTableTaskService.java @@ -1,6 +1,5 @@ package io.dataease.service.dataset; -import com.google.gson.Gson; import io.dataease.base.domain.*; import io.dataease.base.mapper.DatasetTableMapper; import io.dataease.base.mapper.DatasetTableTaskMapper; @@ -53,8 +52,6 @@ public class DataSetTableTaskService { private ExtDataSetTaskMapper extDataSetTaskMapper; @Resource private DatasetTableMapper datasetTableMapper; - @Resource - private UtilMapper utilMapper; public DatasetTableTask save(DataSetTaskRequest dataSetTaskRequest) throws Exception { checkName(dataSetTaskRequest); @@ -99,9 +96,10 @@ public class DataSetTableTaskService { // simple if (datasetTableTask.getRate().equalsIgnoreCase(ScheduleType.SIMPLE.toString())) { // SIMPLE 类型,提前占位 execNow(datasetTableTask); + }else { + checkTaskIsStopped(datasetTableTask); } scheduleService.addSchedule(datasetTableTask); - checkTaskIsStopped(datasetTableTask); return datasetTableTask; } @@ -282,7 +280,13 @@ public class DataSetTableTaskService { } } - public void updateDatasetTableTaskStatus(DatasetTableTask datasetTableTask){ + public void updateDatasetTableTaskStatus(DatasetTableTask datasetTableTask)throws Exception{ + + DatasetTableTask dbDatasetTableTask = datasetTableTaskMapper.selectByPrimaryKey(datasetTableTask.getId()); + if(dbDatasetTableTask.getStatus().equalsIgnoreCase(TaskStatus.Exec.name()) || dbDatasetTableTask.getStatus().equals(TaskStatus.Stopped.name())){ + throw new Exception(Translator.get("i18n_change_task_status_error") + Translator.get("i18n_" + dbDatasetTableTask.getStatus())); + } + DatasetTableTaskExample datasetTableTaskExample = new DatasetTableTaskExample(); DatasetTableTaskExample.Criteria criteria = datasetTableTaskExample.createCriteria(); criteria.andIdEqualTo(datasetTableTask.getId()); diff --git a/backend/src/main/resources/i18n/messages_en_US.properties b/backend/src/main/resources/i18n/messages_en_US.properties index df267ca744..c1735c6cb2 100644 --- a/backend/src/main/resources/i18n/messages_en_US.properties +++ b/backend/src/main/resources/i18n/messages_en_US.properties @@ -277,4 +277,7 @@ i18n_data_not_sync=Please sync data first i18n_excel_colume_change=The column name of Excel is inconsistent with the original data set i18n_timed_task=Timed Task i18n_datasource_connect_error=Data source connection exception: -i18n_check_sql_error=Check incremental SQL exception, \ No newline at end of file +i18n_check_sql_error=Check incremental SQL exception, +i18n_change_task_status_error=Suspension is not allowed. The task status is: +i18n_Stopped=END +i18n_Exec=Running \ No newline at end of file diff --git a/backend/src/main/resources/i18n/messages_zh_CN.properties b/backend/src/main/resources/i18n/messages_zh_CN.properties index 63e928d866..9ccd5e60bf 100644 --- a/backend/src/main/resources/i18n/messages_zh_CN.properties +++ b/backend/src/main/resources/i18n/messages_zh_CN.properties @@ -277,3 +277,7 @@ i18n_excel_colume_change=Excel的列名与原数据集不一致 i18n_timed_task=定时任务 i18n_datasource_connect_error=数据源连接异常: i18n_check_sql_error=校验增量 SQL 异常, +i18n_change_task_status_error=不允许暂停,任务状态为: +i18n_Stopped=执行结束 +i18n_Exec=运行中 + diff --git a/backend/src/main/resources/i18n/messages_zh_TW.properties b/backend/src/main/resources/i18n/messages_zh_TW.properties index 6ca4b80ab5..9e79137c74 100644 --- a/backend/src/main/resources/i18n/messages_zh_TW.properties +++ b/backend/src/main/resources/i18n/messages_zh_TW.properties @@ -279,4 +279,7 @@ i18n_data_not_sync=請先完成數據同步 i18n_excel_colume_change=Excel的列名與原數據集不一致 i18n_timed_task=定時任務 i18n_datasource_connect_error=數據源連接異常: -i18n_check_sql_error=校驗增量SQL異常, \ No newline at end of file +i18n_check_sql_error=校驗增量SQL異常, +i18n_change_task_status_error=不允許暫停,任務狀態為: +i18n_Stopped=執行結束 +i18n_Exec=運行中 \ No newline at end of file diff --git a/frontend/src/views/system/task/DatasetTaskList.vue b/frontend/src/views/system/task/DatasetTaskList.vue index 3ae0ebb40d..53cd99bdf9 100644 --- a/frontend/src/views/system/task/DatasetTaskList.vue +++ b/frontend/src/views/system/task/DatasetTaskList.vue @@ -416,15 +416,20 @@ export default { this.update_task = true }, changeTaskStatus(task) { - const param = task - param.status = task.status === 'Underway' ? 'Pending' : 'Underway' + let param = JSON.parse(JSON.stringify(task)); post('/dataset/task/updateStatus', task).then(response => { - task.status = param.status - this.$message({ - message: this.$t('dataset.task.change_success'), - type: 'success', - showClose: true - }) + if(response.success){ + task.status = param.status + this.$message({ + message: this.$t('dataset.task.change_success'), + type: 'success', + showClose: true + }) + }else { + this.search(this.last_condition, false) + } + }).catch(() => { + this.search(this.last_condition, false) }) }, execTask(task) { From 5eaaa236f15706cef07efaa67652a6ea7aac835a Mon Sep 17 00:00:00 2001 From: taojinlong Date: Tue, 3 Aug 2021 15:53:35 +0800 Subject: [PATCH 03/15] =?UTF-8?q?fix:=20=E6=9F=A5=E8=AF=A2=E4=BB=BB?= =?UTF-8?q?=E5=8A=A1=E6=97=A5=E5=BF=97?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- frontend/src/views/system/task/TaskRecord.vue | 17 ++++++++++++++--- 1 file changed, 14 insertions(+), 3 deletions(-) diff --git a/frontend/src/views/system/task/TaskRecord.vue b/frontend/src/views/system/task/TaskRecord.vue index 5ac4a2dd7a..2fa6084a57 100644 --- a/frontend/src/views/system/task/TaskRecord.vue +++ b/frontend/src/views/system/task/TaskRecord.vue @@ -140,8 +140,8 @@ export default { createTimer() { if (!this.timer) { this.timer = setInterval(() => { - this.search(this.last_condition, false) - }, 1000) + this.timerSearch(this.last_condition, false) + }, 15000) } }, destroyTimer() { @@ -168,7 +168,7 @@ export default { }, select(selection) { }, - search(condition, showLoading = true) { + timerSearch(condition, showLoading = true) { if(!this.lastRequestComplete){ return; }else { @@ -188,6 +188,17 @@ export default { this.lastRequestComplete = true; }) }, + search(condition, showLoading = true) { + this.last_condition = condition + condition = formatQuickCondition(condition, 'dataset_table_task.name') + const temp = formatCondition(condition) + const param = temp || {} + param['orders'] = formatOrders(this.orderConditions) + post('/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 + }) + }, showErrorMassage(massage) { this.show_error_massage = true this.error_massage = massage From 38838e3162fa168b64fa7ec59c2ee5c386cf7c92 Mon Sep 17 00:00:00 2001 From: junjie Date: Tue, 3 Aug 2021 17:01:16 +0800 Subject: [PATCH 04/15] =?UTF-8?q?refactor:=20=E5=8E=BB=E6=8E=89=E5=A4=9A?= =?UTF-8?q?=E4=BD=99=E8=AF=B7=E6=B1=82;=E6=95=B0=E6=8D=AE=E9=9B=86tree?= =?UTF-8?q?=E4=BF=AE=E5=A4=8D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- frontend/src/views/chart/group/Group.vue | 2 +- frontend/src/views/chart/view/ChartEdit.vue | 4 ++-- .../dataset/common/DatasetGroupSelectorTree.vue | 14 ++++++++------ 3 files changed, 11 insertions(+), 9 deletions(-) diff --git a/frontend/src/views/chart/group/Group.vue b/frontend/src/views/chart/group/Group.vue index cb401db247..4fb5c85aba 100644 --- a/frontend/src/views/chart/group/Group.vue +++ b/frontend/src/views/chart/group/Group.vue @@ -257,13 +257,13 @@ diff --git a/frontend/src/views/chart/view/ChartEdit.vue b/frontend/src/views/chart/view/ChartEdit.vue index a0f28d62b4..be0025150f 100644 --- a/frontend/src/views/chart/view/ChartEdit.vue +++ b/frontend/src/views/chart/view/ChartEdit.vue @@ -398,13 +398,13 @@

{{ $t('chart.change_ds_tip') }}

@@ -416,11 +416,11 @@ diff --git a/frontend/src/views/dataset/common/DatasetGroupSelectorTree.vue b/frontend/src/views/dataset/common/DatasetGroupSelectorTree.vue index 18e859b0fe..3664bce2b2 100644 --- a/frontend/src/views/dataset/common/DatasetGroupSelectorTree.vue +++ b/frontend/src/views/dataset/common/DatasetGroupSelectorTree.vue @@ -68,7 +68,6 @@ tag + scriptPattern = Pattern.compile("", Pattern.CASE_INSENSITIVE); + value = scriptPattern.matcher(value).replaceAll(""); + // Remove any lonesome tag + scriptPattern = Pattern.compile("", Pattern.CASE_INSENSITIVE); + flag = scriptPattern.matcher(value).find(); + if (flag) { + ThreadLocalContextHolder.setData("包含XSS攻击脚本,请检查参数!"); + return flag; + } + // Remove any lonesome tag - scriptPattern = Pattern.compile("", Pattern.CASE_INSENSITIVE); - value = scriptPattern.matcher(value).replaceAll(""); - // Remove any lonesome tag - scriptPattern = Pattern.compile("", Pattern.CASE_INSENSITIVE); - flag = scriptPattern.matcher(value).find(); - if (flag) { - ThreadLocalContextHolder.setData("包含XSS攻击脚本,请检查参数!"); - return flag; - } - // Remove any lonesome