From ab85825fc91e9686709290743ffb7525339e3250 Mon Sep 17 00:00:00 2001 From: wangjiahao <1522128093@qq.com> Date: Wed, 21 Dec 2022 12:05:46 +0800 Subject: [PATCH] =?UTF-8?q?feat(=E8=A7=86=E5=9B=BE):=20=E8=A7=86=E5=9B=BE?= =?UTF-8?q?=E5=8F=AF=E4=BB=A5=E5=8D=95=E7=8B=AC=E8=AE=BE=E7=BD=AE=E5=88=B7?= =?UTF-8?q?=E6=96=B0=E9=A2=91=E7=8E=87?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../io/dataease/ext/ExtChartViewMapper.xml | 645 +++++++++--------- .../main/resources/db/migration/V46__1.18.sql | 23 +- .../canvas/components/editor/EditBar.vue | 16 +- .../canvas/customComponent/UserView.vue | 22 +- frontend/src/lang/en.js | 1 + frontend/src/lang/tw.js | 1 + frontend/src/lang/zh.js | 1 + frontend/src/store/index.js | 17 + frontend/src/views/chart/group/Group.vue | 278 ++++---- frontend/src/views/chart/view/ChartEdit.vue | 151 +++- .../panelStyle/OverallSetting.vue | 1 - 11 files changed, 652 insertions(+), 504 deletions(-) diff --git a/backend/src/main/java/io/dataease/ext/ExtChartViewMapper.xml b/backend/src/main/java/io/dataease/ext/ExtChartViewMapper.xml index c4d4d4ad46..8e5db11c37 100644 --- a/backend/src/main/java/io/dataease/ext/ExtChartViewMapper.xml +++ b/backend/src/main/java/io/dataease/ext/ExtChartViewMapper.xml @@ -8,14 +8,11 @@ - + SELECT chart_view.* + FROM chart_view + LEFT JOIN panel_view ON chart_view.id = panel_view.chart_view_id + WHERE panel_view.panel_id = #{panelId} - INSERT INTO chart_view_cache ( - id, - `name`, - title, - scene_id, - table_id, - `type`, - render, - result_count, - result_mode, - create_by, - create_time, - update_time, - style_priority, - chart_type, - is_plugin, - x_axis, - x_axis_ext, - y_axis, - y_axis_ext, - ext_stack, - ext_bubble, - custom_attr, - custom_style, - custom_filter, - drill_fields, - senior, - SNAPSHOT, - data_from - ) SELECT - id, - `name`, - title, - scene_id, - table_id, - `type`, - render, - result_count, - result_mode, - create_by, - create_time, - update_time, - style_priority, - chart_type, - is_plugin, - x_axis, - x_axis_ext, - y_axis, - y_axis_ext, - ext_stack, - ext_bubble, - custom_attr, - custom_style, - custom_filter, - drill_fields, - senior, - SNAPSHOT, - data_from from chart_view - WHERE - chart_view.id = #{id} + INSERT INTO chart_view_cache (id, + `name`, + title, + scene_id, + table_id, + `type`, + render, + result_count, + result_mode, + create_by, + create_time, + update_time, + style_priority, + chart_type, + is_plugin, + x_axis, + x_axis_ext, + y_axis, + y_axis_ext, + ext_stack, + ext_bubble, + custom_attr, + custom_style, + custom_filter, + drill_fields, + senior, + SNAPSHOT, + data_from, + refresh_view_enable, + refresh_unit, + refresh_time) + SELECT id, + `name`, + title, + scene_id, + table_id, + `type`, + render, + result_count, + result_mode, + create_by, + create_time, + update_time, + style_priority, + chart_type, + is_plugin, + x_axis, + x_axis_ext, + y_axis, + y_axis_ext, + ext_stack, + ext_bubble, + custom_attr, + custom_style, + custom_filter, + drill_fields, + senior, + SNAPSHOT, + data_from, + refresh_view_enable, + refresh_unit, + refresh_time + from chart_view + WHERE chart_view.id = #{id} - INSERT INTO chart_view_cache ( - id, - `name`, - title, - scene_id, - table_id, - `type`, - render, - result_count, - result_mode, - create_by, - create_time, - update_time, - style_priority, - chart_type, - is_plugin, - x_axis, - x_axis_ext, - y_axis, - y_axis_ext, - ext_stack, - ext_bubble, - custom_attr, - custom_style, - custom_filter, - drill_fields, - senior, - SNAPSHOT, - data_from - ) SELECT - #{newViewId} as id, - `name`, - title, - scene_id, - table_id, - `type`, - render, - result_count, - result_mode, - create_by, - create_time, - update_time, - style_priority, - chart_type, - is_plugin, - x_axis, - x_axis_ext, - y_axis, - y_axis_ext, - ext_stack, - ext_bubble, - custom_attr, - custom_style, - custom_filter, - drill_fields, - senior, - SNAPSHOT, - data_from from chart_view_cache - WHERE - chart_view_cache.id = #{sourceViewId} + INSERT INTO chart_view_cache (id, + `name`, + title, + scene_id, + table_id, + `type`, + render, + result_count, + result_mode, + create_by, + create_time, + update_time, + style_priority, + chart_type, + is_plugin, + x_axis, + x_axis_ext, + y_axis, + y_axis_ext, + ext_stack, + ext_bubble, + custom_attr, + custom_style, + custom_filter, + drill_fields, + senior, + SNAPSHOT, + data_from, + refresh_view_enable, + refresh_unit, + refresh_time) + SELECT #{newViewId} as id, + `name`, + title, + scene_id, + table_id, + `type`, + render, + result_count, + result_mode, + create_by, + create_time, + update_time, + style_priority, + chart_type, + is_plugin, + x_axis, + x_axis_ext, + y_axis, + y_axis_ext, + ext_stack, + ext_bubble, + custom_attr, + custom_style, + custom_filter, + drill_fields, + senior, + SNAPSHOT, + data_from, + refresh_view_enable, + refresh_unit, + refresh_time + from chart_view_cache + WHERE chart_view_cache.id = #{sourceViewId} - INSERT INTO chart_view_cache ( - id, - `name`, - title, - scene_id, - table_id, - `type`, - render, - result_count, - result_mode, - create_by, - create_time, - update_time, - style_priority, - chart_type, - is_plugin, - x_axis, - x_axis_ext, - y_axis, - y_axis_ext, - ext_stack, - ext_bubble, - custom_attr, - custom_style, - custom_filter, - drill_fields, - senior, - SNAPSHOT, - data_from - ) SELECT - id, - `name`, - title, - scene_id, - table_id, - `type`, - render, - result_count, - result_mode, - create_by, - create_time, - update_time, - style_priority, - chart_type, - is_plugin, - x_axis, - x_axis_ext, - y_axis, - y_axis_ext, - ext_stack, - ext_bubble, - custom_attr, - custom_style, - custom_filter, - drill_fields, - senior, - SNAPSHOT, - data_from from chart_view - WHERE - chart_view.scene_id = #{panelId} + INSERT INTO chart_view_cache (id, + `name`, + title, + scene_id, + table_id, + `type`, + render, + result_count, + result_mode, + create_by, + create_time, + update_time, + style_priority, + chart_type, + is_plugin, + x_axis, + x_axis_ext, + y_axis, + y_axis_ext, + ext_stack, + ext_bubble, + custom_attr, + custom_style, + custom_filter, + drill_fields, + senior, + SNAPSHOT, + data_from, + refresh_view_enable, + refresh_unit, + refresh_time) + SELECT id, + `name`, + title, + scene_id, + table_id, + `type`, + render, + result_count, + result_mode, + create_by, + create_time, + update_time, + style_priority, + chart_type, + is_plugin, + x_axis, + x_axis_ext, + y_axis, + y_axis_ext, + ext_stack, + ext_bubble, + custom_attr, + custom_style, + custom_filter, + drill_fields, + senior, + SNAPSHOT, + data_from, + refresh_view_enable, + refresh_unit, + refresh_time + from chart_view + WHERE chart_view.scene_id = #{panelId} - SELECT * FROM chart_view - WHERE - id IN ( - SELECT - chart_view_id - FROM - panel_view - WHERE - panel_id = #{panelId} - ) + SELECT * + FROM chart_view + WHERE id IN (SELECT chart_view_id + FROM panel_view + WHERE panel_id = #{panelId}) @@ -480,10 +482,12 @@ #{viewId} - + - delete from chart_view_cache where id = #{viewId} - + delete + from chart_view_cache + where id = #{viewId} + UPDATE chart_view cv, @@ -514,7 +518,10 @@ cv.drill_fields = cve.drill_fields, cv.senior = cve.senior, cv.SNAPSHOT = cve.SNAPSHOT, - cv.data_from = cve.data_from + cv.data_from = cve.data_from, + cv.refresh_view_enable = cve.refresh_view_enable, + cv.refresh_unit = cve.refresh_unit, + cv.refresh_time = cve.refresh_time where cve.id = cv.id and cv.id in #{viewId} @@ -523,69 +530,75 @@ UPDATE chart_view_cache cv, - chart_view cve + chart_view cve SET cv.`name` = cve.`name`, - cv.title = cve.title, - cv.scene_id = cve.scene_id, - cv.table_id = cve.table_id, - cv.`type` = cve.`type`, - cv.render = cve.render, - cv.result_count = cve.result_count, - cv.result_mode = cve.result_mode, - cv.create_by = cve.create_by, - cv.create_time = cve.create_time, - cv.update_time = cve.update_time, - cv.style_priority = cve.style_priority, - cv.chart_type = cve.chart_type, - cv.is_plugin = cve.is_plugin, - cv.x_axis = cve.x_axis, - cv.x_axis_ext = cve.x_axis_ext, - cv.y_axis = cve.y_axis, - cv.y_axis_ext = cve.y_axis_ext, - cv.ext_stack = cve.ext_stack, - cv.ext_bubble = cve.ext_bubble, - cv.custom_attr = cve.custom_attr, - cv.custom_style = cve.custom_style, - cv.custom_filter = cve.custom_filter, - cv.drill_fields = cve.drill_fields, - cv.senior = cve.senior, - cv.SNAPSHOT = cve.SNAPSHOT, - cv.data_from = cve.data_from - where cve.id = cv.id and cv.id =#{viewId} + cv.title = cve.title, + cv.scene_id = cve.scene_id, + cv.table_id = cve.table_id, + cv.`type` = cve.`type`, + cv.render = cve.render, + cv.result_count = cve.result_count, + cv.result_mode = cve.result_mode, + cv.create_by = cve.create_by, + cv.create_time = cve.create_time, + cv.update_time = cve.update_time, + cv.style_priority = cve.style_priority, + cv.chart_type = cve.chart_type, + cv.is_plugin = cve.is_plugin, + cv.x_axis = cve.x_axis, + cv.x_axis_ext = cve.x_axis_ext, + cv.y_axis = cve.y_axis, + cv.y_axis_ext = cve.y_axis_ext, + cv.ext_stack = cve.ext_stack, + cv.ext_bubble = cve.ext_bubble, + cv.custom_attr = cve.custom_attr, + cv.custom_style = cve.custom_style, + cv.custom_filter = cve.custom_filter, + cv.drill_fields = cve.drill_fields, + cv.senior = cve.senior, + cv.SNAPSHOT = cve.SNAPSHOT, + cv.data_from = cve.data_from, + cv.refresh_view_enable = cve.refresh_view_enable, + cv.refresh_unit = cve.refresh_unit, + cv.refresh_time = cve.refresh_time + where cve.id = cv.id and cv.id =#{viewId} UPDATE chart_view_cache cve, - chart_view cv + chart_view cv SET cv.`name` = cve.`name`, - cv.title = cve.title, - cv.scene_id = cve.scene_id, - cv.table_id = cve.table_id, - cv.`type` = cve.`type`, - cv.render = cve.render, - cv.result_count = cve.result_count, - cv.result_mode = cve.result_mode, - cv.create_by = cve.create_by, - cv.create_time = cve.create_time, - cv.update_time = cve.update_time, - cv.style_priority = cve.style_priority, - cv.chart_type = cve.chart_type, - cv.is_plugin = cve.is_plugin, - cv.x_axis = cve.x_axis, - cv.x_axis_ext = cve.x_axis_ext, - cv.y_axis = cve.y_axis, - cv.y_axis_ext = cve.y_axis_ext, - cv.ext_stack = cve.ext_stack, - cv.ext_bubble = cve.ext_bubble, - cv.custom_attr = cve.custom_attr, - cv.custom_style = cve.custom_style, - cv.custom_filter = cve.custom_filter, - cv.drill_fields = cve.drill_fields, - cv.senior = cve.senior, - cv.SNAPSHOT = cve.SNAPSHOT, - cv.data_from = cve.data_from - where cve.id = cv.id and cv.id =#{viewId} + cv.title = cve.title, + cv.scene_id = cve.scene_id, + cv.table_id = cve.table_id, + cv.`type` = cve.`type`, + cv.render = cve.render, + cv.result_count = cve.result_count, + cv.result_mode = cve.result_mode, + cv.create_by = cve.create_by, + cv.create_time = cve.create_time, + cv.update_time = cve.update_time, + cv.style_priority = cve.style_priority, + cv.chart_type = cve.chart_type, + cv.is_plugin = cve.is_plugin, + cv.x_axis = cve.x_axis, + cv.x_axis_ext = cve.x_axis_ext, + cv.y_axis = cve.y_axis, + cv.y_axis_ext = cve.y_axis_ext, + cv.ext_stack = cve.ext_stack, + cv.ext_bubble = cve.ext_bubble, + cv.custom_attr = cve.custom_attr, + cv.custom_style = cve.custom_style, + cv.custom_filter = cve.custom_filter, + cv.drill_fields = cve.drill_fields, + cv.senior = cve.senior, + cv.SNAPSHOT = cve.SNAPSHOT, + cv.data_from = cve.data_from, + cv.refresh_view_enable = cve.refresh_view_enable, + cv.refresh_unit = cve.refresh_unit, + cv.refresh_time = cve.refresh_time + where cve.id = cv.id and cv.id =#{viewId} @@ -600,55 +613,49 @@ - INSERT INTO chart_view_field ( - id, - table_id, - chart_id, - origin_name, - `name`, - dataease_name, - group_type, - `type`, - `size`, - de_type, - de_type_format, - de_extract_type, - ext_field, - `checked`, - column_index, - last_sync_time - ) SELECT - uuid() AS id, - chart_view_field.table_id, - chart_view_field.pv_copy.chart_view_id AS chart_id, - chart_view_field.origin_name, - chart_view_field.`name`, - chart_view_field.dataease_name, - chart_view_field.group_type, - chart_view_field.`type`, - chart_view_field.`size`, - chart_view_field.de_type, - chart_view_field.de_type_format, - chart_view_field.de_extract_type, - chart_view_field.ext_field, - chart_view_field.`checked`, - chart_view_field.column_index, - chart_view_field.last_sync_time - FROM - ( - SELECT - panel_id, - copy_from_view, - chart_view_id - FROM - panel_view - WHERE - copy_id = #{copyId} - ) pv_copy - INNER JOIN chart_view_field ON chart_view_field.chart_id = pv_copy.copy_from_view + INSERT INTO chart_view_field (id, + table_id, + chart_id, + origin_name, + `name`, + dataease_name, + group_type, + `type`, + `size`, + de_type, + de_type_format, + de_extract_type, + ext_field, + `checked`, + column_index, + last_sync_time) + SELECT uuid() AS id, + chart_view_field.table_id, + chart_view_field.pv_copy.chart_view_id AS chart_id, + chart_view_field.origin_name, + chart_view_field.`name`, + chart_view_field.dataease_name, + chart_view_field.group_type, + chart_view_field.`type`, + chart_view_field.`size`, + chart_view_field.de_type, + chart_view_field.de_type_format, + chart_view_field.de_extract_type, + chart_view_field.ext_field, + chart_view_field.`checked`, + chart_view_field.column_index, + chart_view_field.last_sync_time + FROM (SELECT panel_id, + copy_from_view, + chart_view_id + FROM panel_view + WHERE copy_id = #{copyId}) pv_copy + INNER JOIN chart_view_field ON chart_view_field.chart_id = pv_copy.copy_from_view diff --git a/backend/src/main/resources/db/migration/V46__1.18.sql b/backend/src/main/resources/db/migration/V46__1.18.sql index 6d1a5fa29b..a6e13beab1 100644 --- a/backend/src/main/resources/db/migration/V46__1.18.sql +++ b/backend/src/main/resources/db/migration/V46__1.18.sql @@ -10,8 +10,25 @@ ALTER TABLE `sys_task` ADD COLUMN `status` tinyint(1) NULL DEFAULT 1 COMMENT '运行状态' AFTER `create_time`; -INSERT INTO `sys_menu` (`menu_id`, `pid`, `sub_count`, `type`, `title`, `name`, `component`, `menu_sort`, `icon`, `path`, `i_frame`, `cache`, `hidden`, `permission`) VALUES (1100, 1, 0, 1, '血缘关系', 'sys-relationship', 'system/relationship/index', 1002, 'sys-relationship', 'relationship', 0, 0, 0, 'relationship:read'); +INSERT INTO `sys_menu` (`menu_id`, `pid`, `sub_count`, `type`, `title`, `name`, `component`, `menu_sort`, `icon`, + `path`, `i_frame`, `cache`, `hidden`, `permission`) +VALUES (1100, 1, 0, 1, '血缘关系', 'sys-relationship', 'system/relationship/index', 1002, 'sys-relationship', + 'relationship', 0, 0, 0, 'relationship:read'); -UPDATE `sys_menu` SET `menu_sort` = 1003 WHERE (`menu_id` = 101); +UPDATE `sys_menu` +SET `menu_sort` = 1003 +WHERE (`menu_id` = 101); -UPDATE `my_plugin` SET `version` = '1.18.0' where `plugin_id` > 0; +UPDATE `my_plugin` +SET `version` = '1.18.0' +where `plugin_id` > 0; + +ALTER TABLE `chart_view` + ADD COLUMN `refresh_view_enable` tinyint(1) NULL DEFAULT 0 COMMENT '是否开启刷新' AFTER `view_fields`, +ADD COLUMN `refresh_unit` varchar(255) NULL DEFAULT 'minute' COMMENT '刷新时间单位' AFTER `refresh_view_enable`, +ADD COLUMN `refresh_time` int(13) NULL DEFAULT 5 COMMENT '刷新时间' AFTER `refresh_unit`; + +ALTER TABLE `chart_view_cache` + ADD COLUMN `refresh_view_enable` tinyint(1) NULL DEFAULT 0 COMMENT '是否开启刷新' AFTER `view_fields`, +ADD COLUMN `refresh_unit` varchar(255) NULL DEFAULT 'minute' COMMENT '刷新时间单位' AFTER `refresh_view_enable`, +ADD COLUMN `refresh_time` int(13) NULL DEFAULT 5 COMMENT '刷新时间' AFTER `refresh_unit`; diff --git a/frontend/src/components/canvas/components/editor/EditBar.vue b/frontend/src/components/canvas/components/editor/EditBar.vue index 471c4186f2..7c7e833cc5 100644 --- a/frontend/src/components/canvas/components/editor/EditBar.vue +++ b/frontend/src/components/canvas/components/editor/EditBar.vue @@ -137,7 +137,7 @@ :target="curComponent.hyperlinks.openMode " :href="curComponent.hyperlinks.content " > - + @@ -496,19 +496,7 @@ export default { }, // 清除相同sourceViewId 的 联动条件 clearLinkage() { - this.componentData.forEach(item => { - if (item.linkageFilters && item.linkageFilters.length > 0) { - const newList = item.linkageFilters.filter(linkage => linkage.sourceViewId !== this.element.propValue.viewId) - item.linkageFilters.splice(0, item.linkageFilters.length) - // 重新push 可保证数组指针不变 可以watch到 - if (newList.length > 0) { - newList.forEach(newLinkage => { - item.linkageFilters.push(newLinkage) - }) - } - } - }) - bus.$emit('clear_panel_linkage', { viewId: this.element.propValue.viewId }) + this.$store.commit('clearViewLinkage', this.element.propValue.viewId) }, goFile() { this.$refs.files.click() diff --git a/frontend/src/components/canvas/customComponent/UserView.vue b/frontend/src/components/canvas/customComponent/UserView.vue index eab9fd0802..b950c2a008 100644 --- a/frontend/src/components/canvas/customComponent/UserView.vue +++ b/frontend/src/components/canvas/customComponent/UserView.vue @@ -305,6 +305,7 @@ export default { }, data() { return { + innerRefreshTimer: null, mobileChartDetailsVisible: false, chartDetailsVisible: false, showChartInfo: {}, @@ -393,7 +394,7 @@ export default { return this.httpRequest.status && this.chart.type && this.chart.type === 'label' }, loadingFlag() { - return (this.canvasStyleData.refreshViewLoading || this.searchCount === 0) && this.requestStatus === 'waiting' + return (this.canvasStyleData.refreshViewLoading || (!this.innerRefreshTimer && this.searchCount === 0)) && this.requestStatus === 'waiting' }, panelInfo() { return this.$store.state.panel.panelInfo @@ -520,7 +521,8 @@ export default { }, // 监听外部计时器变化 searchCount: function(val1) { - if (val1 > 0 && this.requestStatus !== 'waiting') { + // 内部计时器启动 忽略外部计时器 + if (val1 > 0 && this.requestStatus !== 'waiting' && !this.innerRefreshTimer) { this.getData(this.element.propValue.viewId) } }, @@ -547,6 +549,7 @@ export default { }, beforeDestroy() { + this.innerRefreshTimer && clearInterval(this.innerRefreshTimer) bus.$off('plugin-chart-click', this.pluginChartClick) bus.$off('plugin-jump-click', this.pluginJumpClick) bus.$off('plugin-add-view-track-filter', this.pluginAddViewTrackFilter) @@ -566,6 +569,20 @@ export default { } }, methods: { + //编辑状态下 不启动刷新 + buildInnerRefreshTimer(refreshViewEnable = false, refreshUnit = 'minute', refreshTime = 5) { + if (this.editMode === 'preview' && !this.innerRefreshTimer && refreshViewEnable) { + this.innerRefreshTimer && clearInterval(this.innerRefreshTimer) + const timerRefreshTime = refreshUnit === 'second' ? refreshTime * 1000 : refreshTime * 60000 + this.innerRefreshTimer = setInterval(() => { + this.clearViewLinkage() + this.getData(this.element.propValue.viewId) + }, timerRefreshTime) + } + }, + clearViewLinkage() { + this.$store.commit('clearViewLinkage', this.element.propValue.viewId) + }, responseResetButton() { if (!this.cfilters?.length) { this.getData(this.element.propValue.viewId, false) @@ -741,6 +758,7 @@ export default { if (response.success) { this.chart = response.data this.view = response.data + this.buildInnerRefreshTimer(this.chart.refreshViewEnable, this.chart.refreshUnit, this.chart.refreshTime) this.$emit('fill-chart-2-parent', this.chart) this.getDataOnly(response.data, dataBroadcast) this.chart['position'] = this.inTab ? 'tab' : 'panel' diff --git a/frontend/src/lang/en.js b/frontend/src/lang/en.js index 0d1b11ca47..4af97a6d3e 100644 --- a/frontend/src/lang/en.js +++ b/frontend/src/lang/en.js @@ -931,6 +931,7 @@ export default { password_input_error: 'Original password input error' }, chart: { + chart_refresh_tips: 'View refresh setting takes precedence over panel refresh setting', '1-trend': 'trend', '2-state': 'State', '3-rank': 'Rank', diff --git a/frontend/src/lang/tw.js b/frontend/src/lang/tw.js index 4641716985..43ee0991f2 100644 --- a/frontend/src/lang/tw.js +++ b/frontend/src/lang/tw.js @@ -930,6 +930,7 @@ export default { password_input_error: '原始密碼輸入錯誤' }, chart: { + chart_refresh_tips: '視圖刷新設置優先於儀表板刷新設置', '1-trend': '趨勢', '2-state': '狀態', '3-rank': '排名', diff --git a/frontend/src/lang/zh.js b/frontend/src/lang/zh.js index b9078e74b6..8f1ac7cc22 100644 --- a/frontend/src/lang/zh.js +++ b/frontend/src/lang/zh.js @@ -929,6 +929,7 @@ export default { password_input_error: '原始密码输入错误' }, chart: { + chart_refresh_tips: '视图刷新设置优先于仪表板刷新设置', '1-trend': '趋势', '2-state': '状态', '3-rank': '排名', diff --git a/frontend/src/store/index.js b/frontend/src/store/index.js index a6f76f0cda..d2f832d71d 100644 --- a/frontend/src/store/index.js +++ b/frontend/src/store/index.js @@ -824,6 +824,23 @@ const data = { } } } + }, + // 清除相同sourceViewId 的 联动条件 + clearViewLinkage(state, viewId) { + state.componentData.forEach(item => { + if (item.linkageFilters && item.linkageFilters.length > 0) { + const newList = item.linkageFilters.filter(linkage => linkage.sourceViewId !== viewId) + item.linkageFilters.splice(0, item.linkageFilters.length) + // 重新push 可保证数组指针不变 可以watch到 + if (newList.length > 0) { + newList.forEach(newLinkage => { + item.linkageFilters.push(newLinkage) + }) + } + } + }) + + bus.$emit('clear_panel_linkage', { viewId: viewId }) } }, modules: { diff --git a/frontend/src/views/chart/group/Group.vue b/frontend/src/views/chart/group/Group.vue index 63aa526890..89ec69c2ec 100644 --- a/frontend/src/views/chart/group/Group.vue +++ b/frontend/src/views/chart/group/Group.vue @@ -13,7 +13,7 @@ @click="add('group')" /> - + - {{ searchMap[searchType] }} + {{ searchMap[searchType] }} {{ $t('commons.all') }} @@ -63,7 +63,7 @@ > - + - + - +
{{ $t('chart.cancel') }} + >{{ $t('chart.cancel') }} + {{ $t('chart.confirm') }} + >{{ $t('chart.confirm') }} +
@@ -264,7 +266,7 @@ :label="$t('commons.name')" prop="name" > - +
{{ $t('chart.cancel') }} + >{{ $t('chart.cancel') }} + {{ $t('chart.confirm') }} + >{{ $t('chart.confirm') }} +
@@ -318,8 +322,8 @@ :active="createActive" align-center > - - + + {{ $t('chart.cancel') }} + >{{ $t('chart.cancel') }} + {{ $t('chart.preview') - }} + >{{ + $t('chart.preview') + }} {{ $t('dataset.cancel') }} + >{{ $t('dataset.cancel') }} + {{ - $t('dataset.confirm') }} + $t('dataset.confirm') + }} @@ -465,14 +473,16 @@ {{ $t('dataset.cancel') }} + >{{ $t('dataset.cancel') }} + {{ - $t('dataset.confirm') }} + $t('dataset.confirm') + }} @@ -480,27 +490,26 @@ diff --git a/frontend/src/views/chart/view/ChartEdit.vue b/frontend/src/views/chart/view/ChartEdit.vue index 4931d8baba..1fb3e092a3 100644 --- a/frontend/src/views/chart/view/ChartEdit.vue +++ b/frontend/src/views/chart/view/ChartEdit.vue @@ -192,7 +192,7 @@ @command="chartFieldEdit" > - + - + {{ $t('chart.change_chart_type') }} - + @@ -406,6 +406,68 @@
+ + + + + + + + {{ $t('panel.refresh_frequency') }} + + +
+ {{ $t('chart.chart_refresh_tips') }} +
+ +
+ + + {{ $t('panel.enable_refresh_view') }} + + + + + + + + +
{{ - $t('chart.drag_block_table_data_column') - }} + $t('chart.drag_block_table_data_column') + }} {{ $t('chart.drag_block_type_axis') }} @@ -499,18 +561,18 @@ v-else-if="view.type && view.type.includes('pie')" >{{ $t('chart.drag_block_pie_label') }} {{ - $t('chart.drag_block_funnel_split') - }} + $t('chart.drag_block_funnel_split') + }} {{ - $t('chart.drag_block_radar_label') - }} + $t('chart.drag_block_radar_label') + }} {{ $t('chart.area') }} {{ - $t('chart.drag_block_treemap_label') - }} + $t('chart.drag_block_treemap_label') + }} {{ - $t('chart.drag_block_word_cloud_label') - }} + $t('chart.drag_block_word_cloud_label') + }} {{ $t('chart.drag_block_label') }} / {{ $t('chart.dimension') }} @@ -633,8 +695,8 @@ > {{ - $t('chart.drag_block_table_data_column') - }} + $t('chart.drag_block_table_data_column') + }} {{ $t('chart.drag_block_value_axis') }} @@ -642,30 +704,30 @@ v-else-if="view.type && view.type.includes('pie')" >{{ $t('chart.drag_block_pie_angel') }} {{ - $t('chart.drag_block_funnel_width') - }} + $t('chart.drag_block_funnel_width') + }} {{ - $t('chart.drag_block_radar_length') - }} + $t('chart.drag_block_radar_length') + }} {{ - $t('chart.drag_block_gauge_angel') - }} + $t('chart.drag_block_gauge_angel') + }} {{ $t('chart.drag_block_label_value') }} {{ $t('chart.chart_data') }} {{ - $t('chart.drag_block_treemap_size') - }} + $t('chart.drag_block_treemap_size') + }} {{ - $t('chart.drag_block_value_axis_main') - }} + $t('chart.drag_block_value_axis_main') + }} {{ $t('chart.drag_block_progress') }} {{ - $t('chart.drag_block_word_cloud_size') - }} + $t('chart.drag_block_word_cloud_size') + }} / {{ $t('chart.quota') }} - + @@ -1293,7 +1355,7 @@ width="800px" class="dialog-css" > - +