diff --git a/core/core-backend/src/main/resources/db/desktop/V2.10__ddl.sql b/core/core-backend/src/main/resources/db/desktop/V2.10__ddl.sql deleted file mode 100644 index ea825754fb..0000000000 --- a/core/core-backend/src/main/resources/db/desktop/V2.10__ddl.sql +++ /dev/null @@ -1,2 +0,0 @@ -INSERT INTO `core_sys_setting` (`id`, `pkey`, `pval`, `type`, `sort`) VALUES (10, 'basic.exportFileLiveTime', '30', 'text', 2); -delete from visualization_background where id ='dark_1'; \ No newline at end of file diff --git a/core/core-backend/src/main/resources/db/desktop/V2.9__ddl.sql b/core/core-backend/src/main/resources/db/desktop/V2.9__ddl.sql index b1e4e43562..4b560fcb1f 100644 --- a/core/core-backend/src/main/resources/db/desktop/V2.9__ddl.sql +++ b/core/core-backend/src/main/resources/db/desktop/V2.9__ddl.sql @@ -52,3 +52,6 @@ ALTER TABLE `visualization_template` MODIFY COLUMN `node_type` varchar(255) NULL DEFAULT NULL COMMENT '节点类型 app or template 应用 或者 模板' AFTER `dv_type`, ADD COLUMN `app_data` longtext NULL COMMENT 'app数据' AFTER `dynamic_data`; +INSERT INTO `core_sys_setting` (`id`, `pkey`, `pval`, `type`, `sort`) VALUES (10, 'basic.exportFileLiveTime', '30', 'text', 2); +delete from visualization_background where id ='dark_1'; + diff --git a/core/core-backend/src/main/resources/db/migration/V2.10__ddl.sql b/core/core-backend/src/main/resources/db/migration/V2.10__ddl.sql deleted file mode 100644 index ea825754fb..0000000000 --- a/core/core-backend/src/main/resources/db/migration/V2.10__ddl.sql +++ /dev/null @@ -1,2 +0,0 @@ -INSERT INTO `core_sys_setting` (`id`, `pkey`, `pval`, `type`, `sort`) VALUES (10, 'basic.exportFileLiveTime', '30', 'text', 2); -delete from visualization_background where id ='dark_1'; \ No newline at end of file diff --git a/core/core-backend/src/main/resources/db/migration/V2.9__ddl.sql b/core/core-backend/src/main/resources/db/migration/V2.9__ddl.sql index f8f3e97901..7ce906fe03 100644 --- a/core/core-backend/src/main/resources/db/migration/V2.9__ddl.sql +++ b/core/core-backend/src/main/resources/db/migration/V2.9__ddl.sql @@ -73,3 +73,6 @@ ALTER TABLE `visualization_template` MODIFY COLUMN `node_type` varchar(255) NULL DEFAULT NULL COMMENT '节点类型 app or template 应用 或者 模板' AFTER `dv_type`, ADD COLUMN `app_data` longtext NULL COMMENT 'app数据' AFTER `dynamic_data`; +INSERT INTO `core_sys_setting` (`id`, `pkey`, `pval`, `type`, `sort`) VALUES (10, 'basic.exportFileLiveTime', '30', 'text', 2); +delete from visualization_background where id ='dark_1'; + diff --git a/core/core-frontend/src/components/data-visualization/canvas/DePreview.vue b/core/core-frontend/src/components/data-visualization/canvas/DePreview.vue index fcdf1a34c2..de893e0fff 100644 --- a/core/core-frontend/src/components/data-visualization/canvas/DePreview.vue +++ b/core/core-frontend/src/components/data-visualization/canvas/DePreview.vue @@ -9,7 +9,7 @@ import { storeToRefs } from 'pinia' import elementResizeDetectorMaker from 'element-resize-detector' import UserViewEnlarge from '@/components/visualization/UserViewEnlarge.vue' import CanvasOptBar from '@/components/visualization/CanvasOptBar.vue' -import { isDashboard, isMainCanvas } from '@/utils/canvasUtils' +import { isDashboard, isMainCanvas, refreshOtherComponent } from '@/utils/canvasUtils' import { activeWatermark } from '@/components/watermark/watermark' import { personInfoApi } from '@/api/user' import router from '@/router' @@ -220,6 +220,9 @@ const initRefreshTimer = () => { } refreshTimer.value = setInterval(() => { searchCount.value++ + if (isMainCanvas(canvasId.value)) { + refreshOtherComponent(dvInfo.value.id, dvInfo.value.type) + } }, refreshTime) } } diff --git a/core/core-frontend/src/utils/canvasUtils.ts b/core/core-frontend/src/utils/canvasUtils.ts index b178c3cd05..c301fcdf65 100644 --- a/core/core-frontend/src/utils/canvasUtils.ts +++ b/core/core-frontend/src/utils/canvasUtils.ts @@ -170,6 +170,30 @@ export function historyAdaptor( }) } +// 重置仪表板、大屏中的其他组件 +export function refreshOtherComponent(dvId, busiFlag) { + // 富文本 跑马灯组件进行刷新 + const refreshComponentList = componentData.value.filter( + ele => ['ScrollText'].includes(ele.component) || ele.innerType === 'rich-text' + ) + if (refreshComponentList && refreshComponentList.length > 0) { + const refreshIdList = refreshComponentList.map(ele => ele.id) + findById(dvId, busiFlag, {}).then(rsp => { + const canvasInfo = rsp.data + const canvasDataResult = JSON.parse(canvasInfo.componentData) + const canvasDataResultMap = canvasDataResult.reduce((acc, comp) => { + acc.set(comp.id, comp) + return acc + }, new Map()) + componentData.value.map(component => + refreshIdList.includes(component.id) && canvasDataResultMap[component.id] + ? canvasDataResultMap[component.id] + : component + ) + }) + } +} + export function initCanvasDataPrepare(dvId, busiFlag, callBack) { const copyFlag = busiFlag != null && busiFlag.includes('-copy') const busiFlagCustom = copyFlag ? busiFlag.split('-')[0] : busiFlag