fix: 背景图片空url 问题

This commit is contained in:
wangjiahao 2021-05-08 10:42:23 +08:00
parent aec257ef32
commit 0959535093
8 changed files with 45 additions and 21 deletions

View File

@ -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;

View File

@ -4,7 +4,7 @@
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no">
<link rel="icon" href="<%= BASE_URL %>favicon.ico">
<!-- <link rel="icon" href="<%= BASE_URL %>favicon.ico">-->
<title><%= webpackConfig.name %></title>
</head>
<body>

View File

@ -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%',

View File

@ -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%',

View File

@ -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',

View File

@ -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%',

View File

@ -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%',

View File

@ -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) {