diff --git a/backend/src/main/resources/db/migration/V12__panel_table.sql b/backend/src/main/resources/db/migration/V12__panel_table.sql index c1ecdcea96..a14300fd4d 100644 --- a/backend/src/main/resources/db/migration/V12__panel_table.sql +++ b/backend/src/main/resources/db/migration/V12__panel_table.sql @@ -17,7 +17,6 @@ CREATE TABLE `panel_design` ( `update_person` varchar(255) DEFAULT NULL COMMENT '修改人', PRIMARY KEY (`id`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='仪表盘和组件的关联关系 组件分为普通视图和系统组件'; - -- ---------------------------- -- Table structure for panel_group -- ---------------------------- @@ -66,21 +65,32 @@ SET FOREIGN_KEY_CHECKS = 1; -DROP function IF EXISTS GET_PANEL_CHILDREN_CHILDREN; +DROP function IF EXISTS GET_PANEL_GROUP_WITH_CHILDREN; DELIMITER $$ -CREATE FUNCTION `GET_PANEL_CHILDREN_CHILDREN`(parentId varchar(8000)) RETURNS varchar(8000) CHARSET utf8 -READS SQL DATA +CREATE FUNCTION `GET_PANEL_GROUP_WITH_CHILDREN`(parentId varchar(8000)) RETURNS varchar(8000) CHARSET utf8 + READS SQL DATA BEGIN - DECLARE oTemp VARCHAR(8000); - DECLARE oTempChild VARCHAR(8000); - SET oTemp = ''; - SET oTempChild = CAST(parentId AS CHAR); - WHILE oTempChild IS NOT NULL - DO - SET oTemp = CONCAT(oTemp,',',oTempChild); - SELECT GROUP_CONCAT(id) INTO oTempChild FROM panel_group WHERE FIND_IN_SET(pid,oTempChild) > 0; - END WHILE; - RETURN oTemp; + +DECLARE oTemp VARCHAR(8000); + +DECLARE oTempChild VARCHAR(8000); + +SET oTemp = ''; + +SET oTempChild = CAST(parentId AS CHAR); + +WHILE oTempChild IS NOT NULL + +DO + +SET oTemp = CONCAT(oTemp,',',oTempChild); + +SELECT GROUP_CONCAT(id) INTO oTempChild FROM panel_group WHERE FIND_IN_SET(pid,oTempChild) > 0; + +END WHILE; + +RETURN oTemp; + END $$ DELIMITER ; @@ -183,3 +193,18 @@ CREATE TABLE `panel_template` ( `dynamic_data` longtext COMMENT '预存数据', PRIMARY KEY (`id`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8; + +-- ---------------------------- +DROP TABLE IF EXISTS `panel_subject`; +CREATE TABLE `panel_subject` ( + `id` varchar(50) NOT NULL, + `name` varchar(255) DEFAULT NULL COMMENT '主题名称', + `type` varchar(255) DEFAULT NULL COMMENT '主题类型 system 系统主题,self 自定义主题', + `details` longtext COMMENT '主题内容', + `create_time` bigint(13) DEFAULT NULL COMMENT '创建时间', + `create_by` varchar(255) DEFAULT NULL COMMENT '创建人', + `update_time` bigint(13) DEFAULT NULL COMMENT '更新时间', + `update_by` varchar(255) DEFAULT NULL COMMENT '更新人', + PRIMARY KEY (`id`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8; + diff --git a/frontend/public/index.html b/frontend/public/index.html index fa2be9164a..acf03654a4 100644 --- a/frontend/public/index.html +++ b/frontend/public/index.html @@ -4,7 +4,7 @@ - + <%= webpackConfig.name %> diff --git a/frontend/src/components/canvas/components/Editor/Preview.vue b/frontend/src/components/canvas/components/Editor/Preview.vue index 58864de930..3b41f46cba 100644 --- a/frontend/src/components/canvas/components/Editor/Preview.vue +++ b/frontend/src/components/canvas/components/Editor/Preview.vue @@ -54,7 +54,7 @@ export default { customStyle() { let style = {} if (this.canvasStyleData.openCommonStyle) { - if (this.canvasStyleData.panel.backgroundType === 'image') { + if (this.canvasStyleData.panel.backgroundType === 'image' && this.canvasStyleData.panel.imageUrl) { style = { width: '100%', height: '100%', diff --git a/frontend/src/components/canvas/components/Editor/PreviewEject.vue b/frontend/src/components/canvas/components/Editor/PreviewEject.vue index a70119fc88..62bad79e79 100644 --- a/frontend/src/components/canvas/components/Editor/PreviewEject.vue +++ b/frontend/src/components/canvas/components/Editor/PreviewEject.vue @@ -57,7 +57,7 @@ export default { customStyle() { let style = {} if (this.canvasStyleData.openCommonStyle) { - if (this.canvasStyleData.panel.backgroundType === 'image') { + if (this.canvasStyleData.panel.backgroundType === 'image'&&this.canvasStyleData.panel.imageUrl) { style = { width: '100%', height: '100%', diff --git a/frontend/src/components/canvas/components/Editor/index.vue b/frontend/src/components/canvas/components/Editor/index.vue index 150d0898f2..c1ad0e8f8f 100644 --- a/frontend/src/components/canvas/components/Editor/index.vue +++ b/frontend/src/components/canvas/components/Editor/index.vue @@ -109,7 +109,7 @@ export default { height: this.changeStyleWithScale(this.canvasStyleData.height) + 'px' } if (this.canvasStyleData.openCommonStyle) { - if (this.canvasStyleData.panel.backgroundType === 'image') { + if (this.canvasStyleData.panel.backgroundType === 'image'&&this.canvasStyleData.panel.imageUrl) { style = { width: this.changeStyleWithScale(this.canvasStyleData.width) + 'px', height: this.changeStyleWithScale(this.canvasStyleData.height) + 'px', diff --git a/frontend/src/views/panel/SubjectSetting/PreSubject/SubjectTemplateItem.vue b/frontend/src/views/panel/SubjectSetting/PreSubject/SubjectTemplateItem.vue index 4417f8ec79..de99a3f2c1 100644 --- a/frontend/src/views/panel/SubjectSetting/PreSubject/SubjectTemplateItem.vue +++ b/frontend/src/views/panel/SubjectSetting/PreSubject/SubjectTemplateItem.vue @@ -80,7 +80,7 @@ export default { background: 'background: 0% 0% / cover rgb(255, 255, 255)' } if (this.subjectItemDetails) { - if (this.subjectItemDetails.panel.backgroundType === 'image') { + if (this.subjectItemDetails.panel.backgroundType === 'image'&&this.subjectItemDetails.panel.imageUrl) { style = { width: '100%', height: '100%', diff --git a/frontend/src/views/panel/SubjectSetting/PreSubject/SubjectTemplateItemback.vue b/frontend/src/views/panel/SubjectSetting/PreSubject/SubjectTemplateItemback.vue index 0145bae5a7..48d10f091a 100644 --- a/frontend/src/views/panel/SubjectSetting/PreSubject/SubjectTemplateItemback.vue +++ b/frontend/src/views/panel/SubjectSetting/PreSubject/SubjectTemplateItemback.vue @@ -80,7 +80,7 @@ export default { background: '0% 0% / cover rgb(239, 241, 244)' } if (this.subjectItemDetails) { - if (this.subjectItemDetails.panel.backgroundType === 'image') { + if (this.subjectItemDetails.panel.backgroundType === 'image'&&this.subjectItemDetails.panel.imageUrl) { style = { width: '100%', height: '100%', diff --git a/frontend/src/views/panel/list/PanelList.vue b/frontend/src/views/panel/list/PanelList.vue index bfd18bc3eb..c338ff95f0 100644 --- a/frontend/src/views/panel/list/PanelList.vue +++ b/frontend/src/views/panel/list/PanelList.vue @@ -468,7 +468,6 @@ export default { const temp = JSON.parse(response.data.panelStyle) this.$store.commit('setCanvasStyle', temp) this.$store.dispatch('panel/setPanelInfo', data) - this.currGroup = data }) } if (node.expanded) {