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 c86fa302b0..110b76dafb 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 @@ -16,13 +16,13 @@ public interface ExtSysMsgMapper { @Update({ "" }) - int batchStatus(@Param("msgIds") List msgIds); + int batchStatus(@Param("msgIds") List msgIds, @Param("time") Long time); @Delete({ 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 60c5ad3096..ee046ddaab 100644 --- a/backend/src/main/java/io/dataease/commons/utils/ExcelReaderUtil.java +++ b/backend/src/main/java/io/dataease/commons/utils/ExcelReaderUtil.java @@ -68,6 +68,6 @@ public class ExcelReaderUtil { } public static void main(String[] args) throws Exception { - ExcelReaderUtil.readExcel("111.xls", new FileInputStream("/Users/taojinlong/Desktop/111.xls")); + ExcelReaderUtil.readExcel("跑步数据汇总——万马奔腾版0729.xlsx", new FileInputStream("/Users/taojinlong/Desktop/跑步数据汇总——万马奔腾版0729.xlsx")); } } 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 5d65ace513..6b33dd49c1 100644 --- a/backend/src/main/java/io/dataease/commons/utils/ExcelXlsxReader.java +++ b/backend/src/main/java/io/dataease/commons/utils/ExcelXlsxReader.java @@ -327,7 +327,7 @@ public class ExcelXlsxReader extends DefaultHandler { formatString = style.getDataFormatString(); short format = this.formatIndex; if (format == 14 || format == 31 || format == 57 ||format == 59|| - format == 58 || (176 <= format && format <= 178) + format == 58 || (176 < format && format < 178) || (182 <= format && format <= 196) || (210 <= format && format <= 213) || (208 == format)) { // 日期 @@ -380,7 +380,7 @@ public class ExcelXlsxReader extends DefaultHandler { break; case NUMBER: //数字 - if (formatString != null) { + if (formatString != null && isDateFormat) { thisStr = formatter.formatRawCellContents(Double.parseDouble(value), formatIndex, formatString).trim(); } else { thisStr = value; @@ -404,7 +404,7 @@ public class ExcelXlsxReader extends DefaultHandler { } if(curRow==1){ TableFiled tableFiled = new TableFiled(); - tableFiled.setFieldType(type); + tableFiled.setFieldType("TEXT"); tableFiled.setFieldSize(65533); tableFiled.setFieldName(thisStr); tableFiled.setRemarks(thisStr); @@ -413,7 +413,15 @@ public class ExcelXlsxReader extends DefaultHandler { if(CollectionUtils.isEmpty(this.getFields())){ throw new RuntimeException(Translator.get("i18n_excel_header_empty")); } - this.getFields().get(curCol).setFieldType(type); + if(type.equalsIgnoreCase("LONG") && this.getFields().get(curCol).getFieldType().equalsIgnoreCase("TEXT")){ + this.getFields().get(curCol).setFieldType(type); + } + if(type.equalsIgnoreCase("DOUBLE") && !this.getFields().get(curCol).getFieldType().equalsIgnoreCase("DATETIME")){ + this.getFields().get(curCol).setFieldType(type); + } + if(type.equalsIgnoreCase("DATETIME")){ + this.getFields().get(curCol).setFieldType(type); + } } return thisStr; } @@ -428,9 +436,7 @@ public class ExcelXlsxReader extends DefaultHandler { thisStr = String.valueOf(Double.valueOf(thisStr)/100); } Long.valueOf(thisStr); - if(this.getFields().get(curCol).getFieldType().equalsIgnoreCase("TEXT")){ - return "LONG"; - } + return "LONG"; }catch (Exception e){ try { Double.valueOf(thisStr); diff --git a/backend/src/main/java/io/dataease/provider/doris/DorisConstants.java b/backend/src/main/java/io/dataease/provider/doris/DorisConstants.java index 5930960165..e25aa90085 100644 --- a/backend/src/main/java/io/dataease/provider/doris/DorisConstants.java +++ b/backend/src/main/java/io/dataease/provider/doris/DorisConstants.java @@ -41,4 +41,6 @@ public class DorisConstants extends SQLConstants { public static final String BRACKETS = "(%s)"; public static final String ROUND = "ROUND(%s,%s)"; + + public static final String VARCHAR = "VARCHAR"; } diff --git a/backend/src/main/java/io/dataease/provider/doris/DorisQueryProvider.java b/backend/src/main/java/io/dataease/provider/doris/DorisQueryProvider.java index 368736debd..5132840ea6 100644 --- a/backend/src/main/java/io/dataease/provider/doris/DorisQueryProvider.java +++ b/backend/src/main/java/io/dataease/provider/doris/DorisQueryProvider.java @@ -519,6 +519,8 @@ public class DorisQueryProvider extends QueryProvider { if (field.getDeType() == 1 && field.getDeExtractType() != 1) { String cast = String.format(DorisConstants.CAST, originName, DorisConstants.DEFAULT_INT_FORMAT) + "/1000"; whereName = String.format(DorisConstants.FROM_UNIXTIME, cast, DorisConstants.DEFAULT_DATE_FORMAT); + } else if (field.getDeType() == 0) { + whereName = String.format(DorisConstants.CAST, originName, DorisConstants.VARCHAR); } else { whereName = originName; } @@ -560,6 +562,8 @@ public class DorisQueryProvider extends QueryProvider { if (field.getDeType() == 1 && field.getDeExtractType() != 1) { String cast = String.format(DorisConstants.CAST, originName, DorisConstants.DEFAULT_INT_FORMAT) + "/1000"; whereName = String.format(DorisConstants.FROM_UNIXTIME, cast, DorisConstants.DEFAULT_DATE_FORMAT); + } else if (field.getDeType() == 0) { + whereName = String.format(DorisConstants.CAST, originName, DorisConstants.VARCHAR); } else { whereName = originName; } @@ -636,6 +640,8 @@ public class DorisQueryProvider extends QueryProvider { String from_unixtime = String.format(DorisConstants.FROM_UNIXTIME, cast, DorisConstants.DEFAULT_DATE_FORMAT); fieldName = String.format(DorisConstants.DATE_FORMAT, from_unixtime, format); } + } else if (x.getDeType() == 0) { + fieldName = String.format(DorisConstants.CAST, originField, DorisConstants.VARCHAR); } else { fieldName = originField; } diff --git a/backend/src/main/java/io/dataease/service/message/SysMsgService.java b/backend/src/main/java/io/dataease/service/message/SysMsgService.java index 58809cc63d..b43d1cf687 100644 --- a/backend/src/main/java/io/dataease/service/message/SysMsgService.java +++ b/backend/src/main/java/io/dataease/service/message/SysMsgService.java @@ -109,7 +109,7 @@ public class SysMsgService { } public void setBatchReaded(List msgIds) { - extSysMsgMapper.batchStatus(msgIds); + extSysMsgMapper.batchStatus(msgIds, System.currentTimeMillis()); } public void batchDelete(List msgIds) { diff --git a/backend/src/main/resources/db/migration/V17__alter_chart_view.sql b/backend/src/main/resources/db/migration/V17__alter_chart_view.sql deleted file mode 100644 index fbc971300f..0000000000 --- a/backend/src/main/resources/db/migration/V17__alter_chart_view.sql +++ /dev/null @@ -1,3 +0,0 @@ -ALTER TABLE `chart_view` ADD COLUMN `ext_stack` LONGTEXT COMMENT '堆叠项' AFTER `y_axis`; - -UPDATE `chart_view` SET `ext_stack` = '[]'; diff --git a/backend/src/main/resources/db/migration/V17__update_auth.sql b/backend/src/main/resources/db/migration/V17__update_auth.sql new file mode 100644 index 0000000000..182c72d824 --- /dev/null +++ b/backend/src/main/resources/db/migration/V17__update_auth.sql @@ -0,0 +1,174 @@ +update sys_menu set i_frame = 0 where menu_id in (1,2,8,10,15,16,17,24,27,28,34,40,58); +update sys_menu set i_frame = 1 where menu_id not in (1,2,8,10,15,16,17,24,27,28,34,40,58); + + +DROP VIEW +IF + EXISTS `v_auth_model`; +CREATE ALGORITHM = UNDEFINED SQL SECURITY DEFINER VIEW `v_auth_model` AS SELECT +`sys_user`.`user_id` AS `id`, +`sys_user`.`username` AS `name`, +`sys_user`.`username` AS `label`, +'0' AS `pid`, +'leaf' AS `node_type`, +'user' AS `model_type`, +'user' AS `model_inner_type`, +'target' AS `auth_type`, +`sys_user`.`create_by` AS `create_by` +FROM + `sys_user` UNION ALL +SELECT + `sys_role`.`role_id` AS `id`, + `sys_role`.`name` AS `name`, + `sys_role`.`name` AS `label`, + '0' AS `pid`, + 'leaf' AS `node_type`, + 'role' AS `model_type`, + 'role' AS `model_inner_type`, + 'target' AS `auth_type`, + `sys_role`.`create_by` AS `create_by` +FROM + `sys_role` UNION ALL +SELECT + `sys_dept`.`dept_id` AS `id`, + `sys_dept`.`name` AS `name`, + `sys_dept`.`name` AS `lable`, + cast( `sys_dept`.`pid` AS CHAR charset utf8mb4 ) AS `pid`, +IF + (( `sys_dept`.`sub_count` = 0 ), 'leaf', 'spine' ) AS `node_type`, + 'dept' AS `model_type`, + 'dept' AS `model_inner_type`, + 'target' AS `auth_type`, + `sys_dept`.`create_by` AS `create_by` +FROM + `sys_dept` UNION ALL +SELECT + `datasource`.`id` AS `id`, + `datasource`.`name` AS `NAME`, + `datasource`.`name` AS `label`, + '0' AS `pid`, + 'leaf' AS `node_type`, + 'link' AS `model_type`, + `datasource`.`type` AS `model_inner_type`, + 'source' AS `auth_type`, + `datasource`.`create_by` AS `create_by` +FROM + `datasource` UNION ALL +SELECT + `dataset_group`.`id` AS `id`, + `dataset_group`.`name` AS `NAME`, + `dataset_group`.`name` AS `lable`, +IF + ( isnull( `dataset_group`.`pid` ), '0', `dataset_group`.`pid` ) AS `pid`, + 'spine' AS `node_type`, + 'dataset' AS `model_type`, + `dataset_group`.`type` AS `model_inner_type`, + 'source' AS `auth_type`, + `dataset_group`.`create_by` AS `create_by` +FROM + `dataset_group` UNION ALL +SELECT + `dataset_table`.`id` AS `id`, + `dataset_table`.`name` AS `NAME`, + `dataset_table`.`name` AS `lable`, + `dataset_table`.`scene_id` AS `pid`, + 'leaf' AS `node_type`, + 'dataset' AS `model_type`, + `dataset_table`.`type` AS `model_inner_type`, + 'source' AS `auth_type`, + `dataset_table`.`create_by` AS `create_by` +FROM + `dataset_table` UNION ALL +SELECT + `chart_group`.`id` AS `id`, + `chart_group`.`name` AS `name`, + `chart_group`.`name` AS `label`, +IF + ( isnull( `chart_group`.`pid` ), '0', `chart_group`.`pid` ) AS `pid`, + 'spine' AS `node_type`, + 'chart' AS `model_type`, + `chart_group`.`type` AS `model_inner_type`, + 'source' AS `auth_type`, + `chart_group`.`create_by` AS `create_by` +FROM + `chart_group` UNION ALL +SELECT + `chart_view`.`id` AS `id`, + `chart_view`.`name` AS `name`, + `chart_view`.`name` AS `label`, + `chart_view`.`scene_id` AS `pid`, + 'leaf' AS `node_type`, + 'chart' AS `model_type`, + `chart_view`.`type` AS `model_inner_type`, + 'source' AS `auth_type`, + `chart_view`.`create_by` AS `create_by` +FROM + `chart_view` UNION ALL +SELECT + `panel_group`.`id` AS `id`, + `panel_group`.`name` AS `NAME`, + `panel_group`.`name` AS `label`,( + CASE + `panel_group`.`id` + WHEN 'panel_list' THEN + '0' + WHEN 'default_panel' THEN + '0' ELSE `panel_group`.`pid` + END + ) AS `pid`, + IF + (( `panel_group`.`node_type` = 'folder' ), 'spine', 'leaf' ) AS `node_type`, + 'panel' AS `model_type`, + `panel_group`.`panel_type` AS `model_inner_type`, + 'source' AS `auth_type`, + `panel_group`.`create_by` AS `create_by` + FROM + `panel_group` UNION ALL + SELECT + `sys_menu`.`menu_id` AS `menu_id`, + `sys_menu`.`title` AS `name`, + `sys_menu`.`title` AS `label`, + `sys_menu`.`pid` AS `pid`, + IF + (( `sys_menu`.`sub_count` > 0 ), 'spine', 'leaf' ) AS `node_type`, + 'menu' AS `model_type`,( + CASE + `sys_menu`.`type` + WHEN 0 THEN + 'folder' + WHEN 1 THEN + 'menu' + WHEN 2 THEN + 'button' + END + ) AS `model_inner_type`, + 'source' AS `auth_type`, + `sys_menu`.`create_by` AS `create_by` + FROM + `sys_menu` + WHERE + (sys_menu.i_frame !=1 or sys_menu.i_frame is null) UNION ALL + SELECT + `plugin_sys_menu`.`menu_id` AS `menu_id`, + `plugin_sys_menu`.`title` AS `name`, + `plugin_sys_menu`.`title` AS `label`, + `plugin_sys_menu`.`pid` AS `pid`, + IF + (( `plugin_sys_menu`.`sub_count` > 0 ), 'spine', 'leaf' ) AS `node_type`, + 'menu' AS `model_type`,( + CASE + `plugin_sys_menu`.`type` + WHEN 0 THEN + 'folder' + WHEN 1 THEN + 'menu' + WHEN 2 THEN + 'button' + END + ) AS `model_inner_type`, + 'source' AS `auth_type`, + `plugin_sys_menu`.`create_by` AS `create_by` + FROM + `plugin_sys_menu` + WHERE + (plugin_sys_menu.i_frame !=1 or plugin_sys_menu.i_frame is null); diff --git a/frontend/package.json b/frontend/package.json index 75addb3a7c..d33d755db0 100644 --- a/frontend/package.json +++ b/frontend/package.json @@ -59,6 +59,7 @@ "babel-eslint": "10.0.1", "chalk": "2.4.2", "connect": "3.6.6", + "copy-webpack-plugin": "^4.6.0", "eslint": "5.15.3", "eslint-plugin-vue": "5.2.2", "html-webpack-plugin": "3.2.0", diff --git a/frontend/src/api/system/msg.js b/frontend/src/api/system/msg.js index d84dba9cb9..83accc340f 100644 --- a/frontend/src/api/system/msg.js +++ b/frontend/src/api/system/msg.js @@ -26,6 +26,15 @@ export function batchRead(data) { }) } +export function batchDelete(data) { + return request({ + url: '/api/sys_msg/batchDelete', + method: 'post', + loading: true, + data + }) +} + export function treeList() { return request({ url: '/api/sys_msg/treeNodes', diff --git a/frontend/src/api/system/template.js b/frontend/src/api/system/template.js index 5b83b15bcb..16f427ea36 100644 --- a/frontend/src/api/system/template.js +++ b/frontend/src/api/system/template.js @@ -4,12 +4,14 @@ export function save(data) { return request({ url: '/template/save', data: data, + timeout: 60000, method: 'post' }) } export function templateDelete(id) { return request({ url: '/template/delete/' + id, + timeout: 60000, method: 'delete' }) } @@ -17,6 +19,7 @@ export function templateDelete(id) { export function showTemplateList(data) { return request({ url: '/template/templateList', + timeout: 60000, data: data, method: 'post' }) @@ -25,6 +28,7 @@ export function showTemplateList(data) { export function findOne(id) { return request({ url: '/template/findOne/' + id, + timeout: 60000, method: 'get' }) } @@ -32,6 +36,7 @@ export function findOne(id) { export function find(data) { return request({ url: '/template/find', + timeout: 60000, data: data, method: 'post' }) diff --git a/frontend/src/components/canvas/components/Editor/Preview.vue b/frontend/src/components/canvas/components/Editor/Preview.vue index 70cdab8bc6..5b8fcbd1c9 100644 --- a/frontend/src/components/canvas/components/Editor/Preview.vue +++ b/frontend/src/components/canvas/components/Editor/Preview.vue @@ -215,6 +215,7 @@ export default { min-height: 300px; width: 100%; height: 100%; + overflow-x: hidden; /*border: 1px solid #E6E6E6;*/ background-size: 100% 100% !important; .canvas-container { diff --git a/frontend/src/views/chart/components/component-style/LegendSelector.vue b/frontend/src/views/chart/components/component-style/LegendSelector.vue index 0146a20c2f..02aa399ba2 100644 --- a/frontend/src/views/chart/components/component-style/LegendSelector.vue +++ b/frontend/src/views/chart/components/component-style/LegendSelector.vue @@ -148,25 +148,29 @@ export default { watch: { 'chart': { handler: function() { - const chart = JSON.parse(JSON.stringify(this.chart)) - if (chart.customStyle) { - let customStyle = null - if (Object.prototype.toString.call(chart.customStyle) === '[object Object]') { - customStyle = JSON.parse(JSON.stringify(chart.customStyle)) - } else { - customStyle = JSON.parse(chart.customStyle) - } - if (customStyle.legend) { - this.legendForm = customStyle.legend - } - } + this.initData() } } }, mounted() { this.init() + this.initData() }, methods: { + initData() { + const chart = JSON.parse(JSON.stringify(this.chart)) + if (chart.customStyle) { + let customStyle = null + if (Object.prototype.toString.call(chart.customStyle) === '[object Object]') { + customStyle = JSON.parse(JSON.stringify(chart.customStyle)) + } else { + customStyle = JSON.parse(chart.customStyle) + } + if (customStyle.legend) { + this.legendForm = customStyle.legend + } + } + }, init() { const arr = [] for (let i = 10; i <= 60; i = i + 2) { diff --git a/frontend/src/views/chart/components/component-style/SplitSelector.vue b/frontend/src/views/chart/components/component-style/SplitSelector.vue index 3c98871534..b828660cb5 100644 --- a/frontend/src/views/chart/components/component-style/SplitSelector.vue +++ b/frontend/src/views/chart/components/component-style/SplitSelector.vue @@ -122,27 +122,31 @@ export default { watch: { 'chart': { handler: function() { - const chart = JSON.parse(JSON.stringify(this.chart)) - if (chart.customStyle) { - let customStyle = null - if (Object.prototype.toString.call(chart.customStyle) === '[object Object]') { - customStyle = JSON.parse(JSON.stringify(chart.customStyle)) - } else { - customStyle = JSON.parse(chart.customStyle) - } - if (customStyle.split) { - this.splitForm = customStyle.split - } else { - this.splitForm = JSON.parse(JSON.stringify(DEFAULT_SPLIT)) - } - } + this.initData() } } }, mounted() { this.init() + this.initData() }, methods: { + initData() { + const chart = JSON.parse(JSON.stringify(this.chart)) + if (chart.customStyle) { + let customStyle = null + if (Object.prototype.toString.call(chart.customStyle) === '[object Object]') { + customStyle = JSON.parse(JSON.stringify(chart.customStyle)) + } else { + customStyle = JSON.parse(chart.customStyle) + } + if (customStyle.split) { + this.splitForm = customStyle.split + } else { + this.splitForm = JSON.parse(JSON.stringify(DEFAULT_SPLIT)) + } + } + }, init() { const arr = [] for (let i = 6; i <= 40; i = i + 2) { diff --git a/frontend/src/views/chart/components/component-style/TitleSelector.vue b/frontend/src/views/chart/components/component-style/TitleSelector.vue index 626654f877..c2e25ee0d5 100644 --- a/frontend/src/views/chart/components/component-style/TitleSelector.vue +++ b/frontend/src/views/chart/components/component-style/TitleSelector.vue @@ -136,26 +136,30 @@ export default { watch: { 'chart': { handler: function() { - const chart = JSON.parse(JSON.stringify(this.chart)) - if (chart.customStyle) { - let customStyle = null - if (Object.prototype.toString.call(chart.customStyle) === '[object Object]') { - customStyle = JSON.parse(JSON.stringify(chart.customStyle)) - } else { - customStyle = JSON.parse(chart.customStyle) - } - if (customStyle.text) { - this.titleForm = customStyle.text - } - this.titleForm.title = this.chart.title - } + this.initData() } } }, mounted() { this.init() + this.initData() }, methods: { + initData() { + const chart = JSON.parse(JSON.stringify(this.chart)) + if (chart.customStyle) { + let customStyle = null + if (Object.prototype.toString.call(chart.customStyle) === '[object Object]') { + customStyle = JSON.parse(JSON.stringify(chart.customStyle)) + } else { + customStyle = JSON.parse(chart.customStyle) + } + if (customStyle.text) { + this.titleForm = customStyle.text + } + this.titleForm.title = this.chart.title + } + }, init() { const arr = [] for (let i = 10; i <= 60; i = i + 2) { diff --git a/frontend/src/views/chart/components/component-style/XAxisSelector.vue b/frontend/src/views/chart/components/component-style/XAxisSelector.vue index 232b2d69b6..21cdf2fbf6 100644 --- a/frontend/src/views/chart/components/component-style/XAxisSelector.vue +++ b/frontend/src/views/chart/components/component-style/XAxisSelector.vue @@ -178,31 +178,35 @@ export default { watch: { 'chart': { handler: function() { - const chart = JSON.parse(JSON.stringify(this.chart)) - if (chart.customStyle) { - let customStyle = null - if (Object.prototype.toString.call(chart.customStyle) === '[object Object]') { - customStyle = JSON.parse(JSON.stringify(chart.customStyle)) - } else { - customStyle = JSON.parse(chart.customStyle) - } - if (customStyle.xAxis) { - this.axisForm = customStyle.xAxis - if (!this.axisForm.splitLine) { - this.axisForm.splitLine = JSON.parse(JSON.stringify(DEFAULT_XAXIS_STYLE.splitLine)) - } - if (!this.axisForm.nameTextStyle) { - this.axisForm.nameTextStyle = JSON.parse(JSON.stringify(DEFAULT_XAXIS_STYLE.nameTextStyle)) - } - } - } + this.initData() } } }, mounted() { this.init() + this.initData() }, methods: { + initData() { + const chart = JSON.parse(JSON.stringify(this.chart)) + if (chart.customStyle) { + let customStyle = null + if (Object.prototype.toString.call(chart.customStyle) === '[object Object]') { + customStyle = JSON.parse(JSON.stringify(chart.customStyle)) + } else { + customStyle = JSON.parse(chart.customStyle) + } + if (customStyle.xAxis) { + this.axisForm = customStyle.xAxis + if (!this.axisForm.splitLine) { + this.axisForm.splitLine = JSON.parse(JSON.stringify(DEFAULT_XAXIS_STYLE.splitLine)) + } + if (!this.axisForm.nameTextStyle) { + this.axisForm.nameTextStyle = JSON.parse(JSON.stringify(DEFAULT_XAXIS_STYLE.nameTextStyle)) + } + } + } + }, init() { const arr = [] for (let i = 6; i <= 40; i = i + 2) { diff --git a/frontend/src/views/chart/components/component-style/YAxisSelector.vue b/frontend/src/views/chart/components/component-style/YAxisSelector.vue index 85423137e0..ef52af5636 100644 --- a/frontend/src/views/chart/components/component-style/YAxisSelector.vue +++ b/frontend/src/views/chart/components/component-style/YAxisSelector.vue @@ -178,31 +178,35 @@ export default { watch: { 'chart': { handler: function() { - const chart = JSON.parse(JSON.stringify(this.chart)) - if (chart.customStyle) { - let customStyle = null - if (Object.prototype.toString.call(chart.customStyle) === '[object Object]') { - customStyle = JSON.parse(JSON.stringify(chart.customStyle)) - } else { - customStyle = JSON.parse(chart.customStyle) - } - if (customStyle.yAxis) { - this.axisForm = customStyle.yAxis - if (!this.axisForm.splitLine) { - this.axisForm.splitLine = JSON.parse(JSON.stringify(DEFAULT_YAXIS_STYLE.splitLine)) - } - if (!this.axisForm.nameTextStyle) { - this.axisForm.nameTextStyle = JSON.parse(JSON.stringify(DEFAULT_YAXIS_STYLE.nameTextStyle)) - } - } - } + this.initData() } } }, mounted() { this.init() + this.initData() }, methods: { + initData() { + const chart = JSON.parse(JSON.stringify(this.chart)) + if (chart.customStyle) { + let customStyle = null + if (Object.prototype.toString.call(chart.customStyle) === '[object Object]') { + customStyle = JSON.parse(JSON.stringify(chart.customStyle)) + } else { + customStyle = JSON.parse(chart.customStyle) + } + if (customStyle.yAxis) { + this.axisForm = customStyle.yAxis + if (!this.axisForm.splitLine) { + this.axisForm.splitLine = JSON.parse(JSON.stringify(DEFAULT_YAXIS_STYLE.splitLine)) + } + if (!this.axisForm.nameTextStyle) { + this.axisForm.nameTextStyle = JSON.parse(JSON.stringify(DEFAULT_YAXIS_STYLE.nameTextStyle)) + } + } + } + }, init() { const arr = [] for (let i = 6; i <= 40; i = i + 2) { diff --git a/frontend/src/views/chart/components/shape-attr/LabelSelector.vue b/frontend/src/views/chart/components/shape-attr/LabelSelector.vue index e6d17816f8..a6f2fc4f72 100644 --- a/frontend/src/views/chart/components/shape-attr/LabelSelector.vue +++ b/frontend/src/views/chart/components/shape-attr/LabelSelector.vue @@ -177,28 +177,32 @@ export default { watch: { 'chart': { handler: function() { - const chart = JSON.parse(JSON.stringify(this.chart)) - if (chart.customAttr) { - let customAttr = null - if (Object.prototype.toString.call(chart.customAttr) === '[object Object]') { - customAttr = JSON.parse(JSON.stringify(chart.customAttr)) - } else { - customAttr = JSON.parse(chart.customAttr) - } - if (customAttr.label) { - this.labelForm = customAttr.label - if (!this.labelForm.labelLine) { - this.labelForm.labelLine = JSON.parse(JSON.stringify(DEFAULT_LABEL.labelLine)) - } - } - } + this.initData() } } }, mounted() { this.init() + this.initData() }, methods: { + initData() { + const chart = JSON.parse(JSON.stringify(this.chart)) + if (chart.customAttr) { + let customAttr = null + if (Object.prototype.toString.call(chart.customAttr) === '[object Object]') { + customAttr = JSON.parse(JSON.stringify(chart.customAttr)) + } else { + customAttr = JSON.parse(chart.customAttr) + } + if (customAttr.label) { + this.labelForm = customAttr.label + if (!this.labelForm.labelLine) { + this.labelForm.labelLine = JSON.parse(JSON.stringify(DEFAULT_LABEL.labelLine)) + } + } + } + }, init() { const arr = [] for (let i = 10; i <= 20; i = i + 2) { diff --git a/frontend/src/views/chart/components/shape-attr/SizeSelector.vue b/frontend/src/views/chart/components/shape-attr/SizeSelector.vue index 1a542be9f6..bdda5c8fbe 100644 --- a/frontend/src/views/chart/components/shape-attr/SizeSelector.vue +++ b/frontend/src/views/chart/components/shape-attr/SizeSelector.vue @@ -317,25 +317,29 @@ export default { watch: { 'chart': { handler: function() { - const chart = JSON.parse(JSON.stringify(this.chart)) - if (chart.customAttr) { - let customAttr = null - if (Object.prototype.toString.call(chart.customAttr) === '[object Object]') { - customAttr = JSON.parse(JSON.stringify(chart.customAttr)) - } else { - customAttr = JSON.parse(chart.customAttr) - } - if (customAttr.size) { - this.sizeForm = customAttr.size - } - } + this.initData() } } }, mounted() { this.init() + this.initData() }, methods: { + initData() { + const chart = JSON.parse(JSON.stringify(this.chart)) + if (chart.customAttr) { + let customAttr = null + if (Object.prototype.toString.call(chart.customAttr) === '[object Object]') { + customAttr = JSON.parse(JSON.stringify(chart.customAttr)) + } else { + customAttr = JSON.parse(chart.customAttr) + } + if (customAttr.size) { + this.sizeForm = customAttr.size + } + } + }, init() { const arr = [] for (let i = 10; i <= 60; i = i + 2) { diff --git a/frontend/src/views/chart/components/shape-attr/TooltipSelector.vue b/frontend/src/views/chart/components/shape-attr/TooltipSelector.vue index 02088808d3..f4a76dedbe 100644 --- a/frontend/src/views/chart/components/shape-attr/TooltipSelector.vue +++ b/frontend/src/views/chart/components/shape-attr/TooltipSelector.vue @@ -144,25 +144,29 @@ export default { watch: { 'chart': { handler: function() { - const chart = JSON.parse(JSON.stringify(this.chart)) - if (chart.customAttr) { - let customAttr = null - if (Object.prototype.toString.call(chart.customAttr) === '[object Object]') { - customAttr = JSON.parse(JSON.stringify(chart.customAttr)) - } else { - customAttr = JSON.parse(chart.customAttr) - } - if (customAttr.tooltip) { - this.tooltipForm = customAttr.tooltip - } - } + this.initData() } } }, mounted() { this.init() + this.initData() }, methods: { + initData() { + const chart = JSON.parse(JSON.stringify(this.chart)) + if (chart.customAttr) { + let customAttr = null + if (Object.prototype.toString.call(chart.customAttr) === '[object Object]') { + customAttr = JSON.parse(JSON.stringify(chart.customAttr)) + } else { + customAttr = JSON.parse(chart.customAttr) + } + if (customAttr.tooltip) { + this.tooltipForm = customAttr.tooltip + } + } + }, init() { const arr = [] for (let i = 10; i <= 20; i = i + 2) { diff --git a/frontend/src/views/chart/view/ChartEdit.vue b/frontend/src/views/chart/view/ChartEdit.vue index 208d59c7a6..b657d2fc5c 100644 --- a/frontend/src/views/chart/view/ChartEdit.vue +++ b/frontend/src/views/chart/view/ChartEdit.vue @@ -1245,10 +1245,12 @@ export default { }, changeChart() { - this.view.tableId = this.changeTable.id - this.view.xaxis = [] - this.view.yaxis = [] - this.view.customFilter = [] + if (this.view.tableId !== this.changeTable.id) { + this.view.tableId = this.changeTable.id + this.view.xaxis = [] + this.view.yaxis = [] + this.view.customFilter = [] + } this.save(true, 'chart', false) }, diff --git a/frontend/src/views/chart/view/TableSelector.vue b/frontend/src/views/chart/view/TableSelector.vue index 53ac2d5629..0741875729 100644 --- a/frontend/src/views/chart/view/TableSelector.vue +++ b/frontend/src/views/chart/view/TableSelector.vue @@ -1,7 +1,7 @@ + + + @@ -229,7 +246,7 @@ type="primary" icon="el-icon-edit" circle - :disabled="scope.row.rate === 'SIMPLE'" + :disabled="scope.row.rate === 'SIMPLE' || scope.row.status === 'Stopped'" @click="addTask(scope.row)" /> - + +