From 594d20eb4d4a31db3fb7353747fd4fba4202c6bd Mon Sep 17 00:00:00 2001 From: wangjiahao <1522128093@qq.com> Date: Wed, 28 Jul 2021 14:40:22 +0800 Subject: [PATCH] =?UTF-8?q?refactor:=E4=BB=A3=E7=A0=81=E6=A0=BC=E5=BC=8F?= =?UTF-8?q?=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../base/mapper/ext/ExtPanelViewMapper.java | 1 - .../base/mapper/ext/ExtSysMsgMapper.java | 1 - .../commons/utils/ExcelReaderUtil.java | 2 - .../commons/utils/ExcelXlsReader.java | 7 +-- .../commons/utils/ExcelXlsxReader.java | 6 +-- .../dto/chart/ChartFieldCustomFilterDTO.java | 1 - .../dataease/dto/dataset/DataSetTaskDTO.java | 1 - .../dataset/DataSetTableTaskService.java | 4 -- .../service/panel/PanelViewService.java | 3 -- .../dataease/service/sys/SysUserService.java | 1 - frontend/.eslintrc.js | 2 +- .../canvas/assets/iconfont/demo.css | 50 +++++++++---------- .../src/views/dataset/data/UpdateInfo.vue | 46 ++++++++--------- 13 files changed, 51 insertions(+), 74 deletions(-) diff --git a/backend/src/main/java/io/dataease/base/mapper/ext/ExtPanelViewMapper.java b/backend/src/main/java/io/dataease/base/mapper/ext/ExtPanelViewMapper.java index 3e46d5ad70..c1822724ae 100644 --- a/backend/src/main/java/io/dataease/base/mapper/ext/ExtPanelViewMapper.java +++ b/backend/src/main/java/io/dataease/base/mapper/ext/ExtPanelViewMapper.java @@ -1,6 +1,5 @@ package io.dataease.base.mapper.ext; -import io.dataease.base.domain.PanelView; import io.dataease.dto.panel.PanelViewDto; import io.dataease.dto.panel.po.PanelViewInsertDTO; import org.apache.ibatis.annotations.Param; diff --git a/backend/src/main/java/io/dataease/base/mapper/ext/ExtSysMsgMapper.java b/backend/src/main/java/io/dataease/base/mapper/ext/ExtSysMsgMapper.java index 7070b0c4d3..c86fa302b0 100644 --- a/backend/src/main/java/io/dataease/base/mapper/ext/ExtSysMsgMapper.java +++ b/backend/src/main/java/io/dataease/base/mapper/ext/ExtSysMsgMapper.java @@ -2,7 +2,6 @@ package io.dataease.base.mapper.ext; import io.dataease.base.domain.SysMsgExample; import io.dataease.base.domain.SysMsgSetting; -import io.dataease.controller.message.dto.BatchSettingRequest; import io.dataease.controller.message.dto.MsgGridDto; import org.apache.ibatis.annotations.Delete; import org.apache.ibatis.annotations.Mapper; diff --git a/backend/src/main/java/io/dataease/commons/utils/ExcelReaderUtil.java b/backend/src/main/java/io/dataease/commons/utils/ExcelReaderUtil.java index 4ae57a6f5f..60c5ad3096 100644 --- a/backend/src/main/java/io/dataease/commons/utils/ExcelReaderUtil.java +++ b/backend/src/main/java/io/dataease/commons/utils/ExcelReaderUtil.java @@ -4,9 +4,7 @@ import io.dataease.datasource.dto.TableFiled; import java.io.FileInputStream; import java.io.InputStream; -import java.util.ArrayList; import java.util.List; -import java.util.Map; public class ExcelReaderUtil { //excel2003扩展名 diff --git a/backend/src/main/java/io/dataease/commons/utils/ExcelXlsReader.java b/backend/src/main/java/io/dataease/commons/utils/ExcelXlsReader.java index 97f4306939..de917dbd3e 100644 --- a/backend/src/main/java/io/dataease/commons/utils/ExcelXlsReader.java +++ b/backend/src/main/java/io/dataease/commons/utils/ExcelXlsReader.java @@ -1,19 +1,16 @@ package io.dataease.commons.utils; -import com.google.gson.Gson; import io.dataease.datasource.dto.TableFiled; import io.dataease.dto.dataset.ExcelSheetData; import io.dataease.i18n.Translator; import org.apache.poi.hssf.eventusermodel.*; import org.apache.poi.hssf.eventusermodel.dummyrecord.LastCellOfRowDummyRecord; import org.apache.poi.hssf.eventusermodel.dummyrecord.MissingCellDummyRecord; -import org.apache.poi.hssf.model.HSSFFormulaParser; import org.apache.poi.hssf.record.*; import org.apache.poi.hssf.usermodel.HSSFDataFormatter; import org.apache.poi.hssf.usermodel.HSSFWorkbook; import org.apache.poi.poifs.filesystem.POIFSFileSystem; -import java.io.FileInputStream; import java.io.InputStream; import java.util.ArrayList; import java.util.List; @@ -309,7 +306,7 @@ public class ExcelXlsReader implements HSSFListener { excelSheetData.setFields(new ArrayList<>()); totalSheets.add(excelSheetData); } - + if(curRow == 0){ for (String s : cellList) { TableFiled tableFiled = new TableFiled(); @@ -387,4 +384,4 @@ public class ExcelXlsReader implements HSSFListener { return type; } -} \ No newline at end of file +} diff --git a/backend/src/main/java/io/dataease/commons/utils/ExcelXlsxReader.java b/backend/src/main/java/io/dataease/commons/utils/ExcelXlsxReader.java index dc57e3a523..d9deffac6d 100644 --- a/backend/src/main/java/io/dataease/commons/utils/ExcelXlsxReader.java +++ b/backend/src/main/java/io/dataease/commons/utils/ExcelXlsxReader.java @@ -1,13 +1,9 @@ package io.dataease.commons.utils; -import com.google.gson.Gson; import io.dataease.datasource.dto.TableFiled; import io.dataease.dto.dataset.ExcelSheetData; import io.dataease.i18n.Translator; -import io.dataease.service.message.MsgAop; import org.apache.commons.collections4.CollectionUtils; -import org.apache.commons.lang3.StringUtils; import org.apache.poi.openxml4j.opc.OPCPackage; -import org.apache.poi.ss.usermodel.BuiltinFormats; import org.apache.poi.ss.usermodel.DataFormatter; import org.apache.poi.xssf.eventusermodel.XSSFReader; import org.apache.poi.xssf.model.SharedStringsTable; @@ -471,4 +467,4 @@ public class ExcelXlsxReader extends DefaultHandler { return str; } -} \ No newline at end of file +} diff --git a/backend/src/main/java/io/dataease/dto/chart/ChartFieldCustomFilterDTO.java b/backend/src/main/java/io/dataease/dto/chart/ChartFieldCustomFilterDTO.java index 380ec0d4f2..588f9e9d54 100644 --- a/backend/src/main/java/io/dataease/dto/chart/ChartFieldCustomFilterDTO.java +++ b/backend/src/main/java/io/dataease/dto/chart/ChartFieldCustomFilterDTO.java @@ -1,6 +1,5 @@ package io.dataease.dto.chart; -import io.dataease.base.domain.DatasetTableField; import lombok.Getter; import lombok.Setter; diff --git a/backend/src/main/java/io/dataease/dto/dataset/DataSetTaskDTO.java b/backend/src/main/java/io/dataease/dto/dataset/DataSetTaskDTO.java index 26388e3164..c5128c49bb 100644 --- a/backend/src/main/java/io/dataease/dto/dataset/DataSetTaskDTO.java +++ b/backend/src/main/java/io/dataease/dto/dataset/DataSetTaskDTO.java @@ -1,7 +1,6 @@ package io.dataease.dto.dataset; import io.dataease.base.domain.DatasetTableTask; -import io.dataease.base.domain.DatasetTableTaskLog; import lombok.Getter; import lombok.Setter; 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 0278a7cd93..248ac860b5 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; @@ -14,8 +13,6 @@ import io.dataease.commons.constants.TriggerType; import io.dataease.controller.request.dataset.DataSetTaskRequest; import io.dataease.controller.sys.base.BaseGridRequest; import io.dataease.controller.sys.base.ConditionEntity; -import io.dataease.controller.sys.response.SysUserGridResponse; -import io.dataease.controller.sys.response.SysUserRole; import io.dataease.dto.dataset.DataSetTaskDTO; import io.dataease.exception.DataEaseException; import io.dataease.i18n.Translator; @@ -32,7 +29,6 @@ import javax.annotation.Resource; import java.util.Arrays; import java.util.List; import java.util.UUID; -import java.util.stream.Collectors; /** * @Author gin diff --git a/backend/src/main/java/io/dataease/service/panel/PanelViewService.java b/backend/src/main/java/io/dataease/service/panel/PanelViewService.java index aa1f50c544..7d34fac93a 100644 --- a/backend/src/main/java/io/dataease/service/panel/PanelViewService.java +++ b/backend/src/main/java/io/dataease/service/panel/PanelViewService.java @@ -3,9 +3,7 @@ package io.dataease.service.panel; import com.alibaba.fastjson.JSON; import com.alibaba.fastjson.JSONArray; import com.alibaba.fastjson.JSONObject; -import io.dataease.base.domain.PanelGroup; import io.dataease.base.domain.PanelGroupWithBLOBs; -import io.dataease.base.mapper.PanelViewMapper; import io.dataease.base.mapper.ext.ExtPanelViewMapper; import io.dataease.commons.utils.AuthUtils; import io.dataease.commons.utils.BeanUtils; @@ -21,7 +19,6 @@ import org.springframework.transaction.annotation.Propagation; import org.springframework.transaction.annotation.Transactional; import org.springframework.util.Assert; -import javax.annotation.Resource; import java.util.ArrayList; import java.util.List; import java.util.Map; diff --git a/backend/src/main/java/io/dataease/service/sys/SysUserService.java b/backend/src/main/java/io/dataease/service/sys/SysUserService.java index 740e20946e..bfc1871ec8 100644 --- a/backend/src/main/java/io/dataease/service/sys/SysUserService.java +++ b/backend/src/main/java/io/dataease/service/sys/SysUserService.java @@ -30,7 +30,6 @@ import org.springframework.transaction.annotation.Transactional; import javax.annotation.Resource; import java.util.List; -import java.util.Optional; import java.util.stream.Collectors; @Service diff --git a/frontend/.eslintrc.js b/frontend/.eslintrc.js index 3240d4bf56..5de7bd689a 100644 --- a/frontend/.eslintrc.js +++ b/frontend/.eslintrc.js @@ -22,7 +22,7 @@ module.exports = { } }], "vue/singleline-html-element-content-newline": "off", - "vue/multiline-html-element-content-newline":"off", + "vue/multiline-html-element-content-newline": "off", "vue/name-property-casing": ["error", "PascalCase"], "vue/no-v-html": "off", 'accessor-pairs': 2, diff --git a/frontend/src/components/canvas/assets/iconfont/demo.css b/frontend/src/components/canvas/assets/iconfont/demo.css index a67054a0a0..b7af3aa35d 100644 --- a/frontend/src/components/canvas/assets/iconfont/demo.css +++ b/frontend/src/components/canvas/assets/iconfont/demo.css @@ -3,9 +3,9 @@ font-family: "iconfont logo"; src: url('https://at.alicdn.com/t/font_985780_km7mi63cihi.eot?t=1545807318834'); src: url('https://at.alicdn.com/t/font_985780_km7mi63cihi.eot?t=1545807318834#iefix') format('embedded-opentype'), - url('https://at.alicdn.com/t/font_985780_km7mi63cihi.woff?t=1545807318834') format('woff'), - url('https://at.alicdn.com/t/font_985780_km7mi63cihi.ttf?t=1545807318834') format('truetype'), - url('https://at.alicdn.com/t/font_985780_km7mi63cihi.svg?t=1545807318834#iconfont') format('svg'); + url('https://at.alicdn.com/t/font_985780_km7mi63cihi.woff?t=1545807318834') format('woff'), + url('https://at.alicdn.com/t/font_985780_km7mi63cihi.ttf?t=1545807318834') format('truetype'), + url('https://at.alicdn.com/t/font_985780_km7mi63cihi.svg?t=1545807318834#iconfont') format('svg'); } .logo { @@ -215,35 +215,35 @@ margin: 1em 0; } -.markdown>p, -.markdown>blockquote, -.markdown>.highlight, -.markdown>ol, -.markdown>ul { +.markdown > p, +.markdown > blockquote, +.markdown > .highlight, +.markdown > ol, +.markdown > ul { width: 80%; } -.markdown ul>li { +.markdown ul > li { list-style: circle; } -.markdown>ul li, -.markdown blockquote ul>li { +.markdown > ul li, +.markdown blockquote ul > li { margin-left: 20px; padding-left: 4px; } -.markdown>ul li p, -.markdown>ol li p { +.markdown > ul li p, +.markdown > ol li p { margin: 0.6em 0; } -.markdown ol>li { +.markdown ol > li { list-style: decimal; } -.markdown>ol li, -.markdown blockquote ol>li { +.markdown > ol li, +.markdown blockquote ol > li { margin-left: 20px; padding-left: 4px; } @@ -260,7 +260,7 @@ font-weight: 600; } -.markdown>table { +.markdown > table { border-collapse: collapse; border-spacing: 0px; empty-cells: show; @@ -269,20 +269,20 @@ margin-bottom: 24px; } -.markdown>table th { +.markdown > table th { white-space: nowrap; color: #333; font-weight: 600; } -.markdown>table th, -.markdown>table td { +.markdown > table th, +.markdown > table td { border: 1px solid #e9e9e9; padding: 8px 16px; text-align: left; } -.markdown>table th { +.markdown > table th { background: #F7F7F7; } @@ -318,8 +318,8 @@ display: inline-block; } -.markdown>br, -.markdown>p>br { +.markdown > br, +.markdown > p > br { clear: both; } @@ -453,13 +453,13 @@ pre[class*="language-"] { overflow: auto; } -:not(pre)>code[class*="language-"], +:not(pre) > code[class*="language-"], pre[class*="language-"] { background: #f5f2f0; } /* Inline code */ -:not(pre)>code[class*="language-"] { +:not(pre) > code[class*="language-"] { padding: .1em; border-radius: .3em; white-space: normal; diff --git a/frontend/src/views/dataset/data/UpdateInfo.vue b/frontend/src/views/dataset/data/UpdateInfo.vue index b42a0dfeb3..0b8fd0351b 100644 --- a/frontend/src/views/dataset/data/UpdateInfo.vue +++ b/frontend/src/views/dataset/data/UpdateInfo.vue @@ -96,7 +96,7 @@ append-to-body > - + - - + + - + - - + + - - + @@ -535,7 +534,7 @@ export default { } this.incrementalConfig.tableId = this.table.id let startTime = new Date(task.startTime).getTime() - if(startTime < new Date().getTime()){ + if (startTime < new Date().getTime()) { startTime = new Date().getTime() } task.startTime = startTime @@ -559,10 +558,9 @@ export default { this.listTask() this.listTaskLog() }) - }else { + } else { return false } - }) }, deleteTask(task) { @@ -590,27 +588,27 @@ export default { }, onSimpleCronChange() { if (this.taskForm.extraData.simple_cron_type === 'minute') { - if(this.taskForm.extraData.simple_cron_value < 1 || this.taskForm.extraData.simple_cron_value > 59){ - this.$message({message: this.$t('cron.minute_limit'), type: 'warning', showClose: true}) + if (this.taskForm.extraData.simple_cron_value < 1 || this.taskForm.extraData.simple_cron_value > 59) { + this.$message({ message: this.$t('cron.minute_limit'), type: 'warning', showClose: true }) this.taskForm.extraData.simple_cron_value = 59 } - this.taskForm.cron = '0 0/'+ this.taskForm.extraData.simple_cron_value + ' * * * ? *' + this.taskForm.cron = '0 0/' + this.taskForm.extraData.simple_cron_value + ' * * * ? *' return } if (this.taskForm.extraData.simple_cron_type === 'hour') { - if(this.taskForm.extraData.simple_cron_value < 1 || this.taskForm.extraData.simple_cron_value > 23){ - this.$message({message: this.$t('cron.hour_limit'), type: 'warning', showClose: true}) + if (this.taskForm.extraData.simple_cron_value < 1 || this.taskForm.extraData.simple_cron_value > 23) { + this.$message({ message: this.$t('cron.hour_limit'), type: 'warning', showClose: true }) this.taskForm.extraData.simple_cron_value = 23 } - this.taskForm.cron = '0 0 0/'+ this.taskForm.extraData.simple_cron_value + ' * * ? *' + this.taskForm.cron = '0 0 0/' + this.taskForm.extraData.simple_cron_value + ' * * ? *' return } if (this.taskForm.extraData.simple_cron_type === 'day') { - if(this.taskForm.extraData.simple_cron_value < 1 || this.taskForm.extraData.simple_cron_value > 31){ - this.$message({message: this.$t('cron.day_limit'), type: 'warning', showClose: true}) + if (this.taskForm.extraData.simple_cron_value < 1 || this.taskForm.extraData.simple_cron_value > 31) { + this.$message({ message: this.$t('cron.day_limit'), type: 'warning', showClose: true }) this.taskForm.extraData.simple_cron_value = 31 } - this.taskForm.cron = '0 0 0 1/'+ this.taskForm.extraData.simple_cron_value + ' * ? *' + this.taskForm.cron = '0 0 0 1/' + this.taskForm.extraData.simple_cron_value + ' * ? *' return } }, @@ -620,16 +618,16 @@ export default { this.taskForm.endTime = '' this.taskForm.cron = '' } - if (this.taskForm.rate === 'SIMPLE_CRON'){ + if (this.taskForm.rate === 'SIMPLE_CRON') { this.taskForm.cron = '0 0 0/1 * * ? *' } - if (this.taskForm.rate === 'CRON'){ + if (this.taskForm.rate === 'CRON') { this.taskForm.cron = '00 00 * ? * * *' } }, listTaskLog(loading = true) { - const params = {"conditions":[{"field":"dataset_table_task_log.table_id","operator":"eq","value": this.table.id}],"orders":[]} - post('/dataset/taskLog/list/' + this.table.type + '/' + this.page.currentPage + '/' + this.page.pageSize, params, loading).then(response => { + const params = { 'conditions': [{ 'field': 'dataset_table_task_log.table_id', 'operator': 'eq', 'value': this.table.id }], 'orders': [] } + post('/dataset/taskLog/list/' + this.table.type + '/' + this.page.currentPage + '/' + this.page.pageSize, params, loading).then(response => { this.taskLogData = response.data.listObject this.page.total = response.data.itemCount })