diff --git a/backend/src/main/java/io/dataease/base/domain/ChartView.java b/backend/src/main/java/io/dataease/base/domain/ChartView.java index 9835b73b31..f8e662c1d5 100644 --- a/backend/src/main/java/io/dataease/base/domain/ChartView.java +++ b/backend/src/main/java/io/dataease/base/domain/ChartView.java @@ -23,5 +23,7 @@ public class ChartView implements Serializable { private Long updateTime; + private String stylePriority; + private static final long serialVersionUID = 1L; } \ No newline at end of file diff --git a/backend/src/main/java/io/dataease/base/domain/ChartViewExample.java b/backend/src/main/java/io/dataease/base/domain/ChartViewExample.java index bbc4c8b82b..7aaf8d21e5 100644 --- a/backend/src/main/java/io/dataease/base/domain/ChartViewExample.java +++ b/backend/src/main/java/io/dataease/base/domain/ChartViewExample.java @@ -713,6 +713,76 @@ public class ChartViewExample { addCriterion("update_time not between", value1, value2, "updateTime"); return (Criteria) this; } + + public Criteria andStylePriorityIsNull() { + addCriterion("style_priority is null"); + return (Criteria) this; + } + + public Criteria andStylePriorityIsNotNull() { + addCriterion("style_priority is not null"); + return (Criteria) this; + } + + public Criteria andStylePriorityEqualTo(String value) { + addCriterion("style_priority =", value, "stylePriority"); + return (Criteria) this; + } + + public Criteria andStylePriorityNotEqualTo(String value) { + addCriterion("style_priority <>", value, "stylePriority"); + return (Criteria) this; + } + + public Criteria andStylePriorityGreaterThan(String value) { + addCriterion("style_priority >", value, "stylePriority"); + return (Criteria) this; + } + + public Criteria andStylePriorityGreaterThanOrEqualTo(String value) { + addCriterion("style_priority >=", value, "stylePriority"); + return (Criteria) this; + } + + public Criteria andStylePriorityLessThan(String value) { + addCriterion("style_priority <", value, "stylePriority"); + return (Criteria) this; + } + + public Criteria andStylePriorityLessThanOrEqualTo(String value) { + addCriterion("style_priority <=", value, "stylePriority"); + return (Criteria) this; + } + + public Criteria andStylePriorityLike(String value) { + addCriterion("style_priority like", value, "stylePriority"); + return (Criteria) this; + } + + public Criteria andStylePriorityNotLike(String value) { + addCriterion("style_priority not like", value, "stylePriority"); + return (Criteria) this; + } + + public Criteria andStylePriorityIn(List values) { + addCriterion("style_priority in", values, "stylePriority"); + return (Criteria) this; + } + + public Criteria andStylePriorityNotIn(List values) { + addCriterion("style_priority not in", values, "stylePriority"); + return (Criteria) this; + } + + public Criteria andStylePriorityBetween(String value1, String value2) { + addCriterion("style_priority between", value1, value2, "stylePriority"); + return (Criteria) this; + } + + public Criteria andStylePriorityNotBetween(String value1, String value2) { + addCriterion("style_priority not between", value1, value2, "stylePriority"); + return (Criteria) this; + } } public static class Criteria extends GeneratedCriteria { diff --git a/backend/src/main/java/io/dataease/base/domain/ChartViewWithBLOBs.java b/backend/src/main/java/io/dataease/base/domain/ChartViewWithBLOBs.java index 655f2fb30b..bc06da0a28 100644 --- a/backend/src/main/java/io/dataease/base/domain/ChartViewWithBLOBs.java +++ b/backend/src/main/java/io/dataease/base/domain/ChartViewWithBLOBs.java @@ -19,5 +19,7 @@ public class ChartViewWithBLOBs extends ChartView implements Serializable { private String customFilter; + private String snapshot; + private static final long serialVersionUID = 1L; } \ No newline at end of file diff --git a/backend/src/main/java/io/dataease/base/mapper/ChartViewMapper.xml b/backend/src/main/java/io/dataease/base/mapper/ChartViewMapper.xml index eec202f585..2d91efd41a 100644 --- a/backend/src/main/java/io/dataease/base/mapper/ChartViewMapper.xml +++ b/backend/src/main/java/io/dataease/base/mapper/ChartViewMapper.xml @@ -11,6 +11,7 @@ + @@ -18,6 +19,7 @@ + @@ -78,10 +80,11 @@ - id, `name`, scene_id, table_id, `type`, title, create_by, create_time, update_time + id, `name`, scene_id, table_id, `type`, title, create_by, create_time, update_time, + style_priority - x_axis, y_axis, custom_attr, custom_style, custom_filter + x_axis, y_axis, custom_attr, custom_style, custom_filter, snapshot @@ -270,6 +287,9 @@ update_time = #{record.updateTime,jdbcType=BIGINT}, + + style_priority = #{record.stylePriority,jdbcType=VARCHAR}, + x_axis = #{record.xAxis,jdbcType=LONGVARCHAR}, @@ -285,6 +305,9 @@ custom_filter = #{record.customFilter,jdbcType=LONGVARCHAR}, + + snapshot = #{record.snapshot,jdbcType=LONGVARCHAR}, + @@ -301,11 +324,13 @@ create_by = #{record.createBy,jdbcType=VARCHAR}, create_time = #{record.createTime,jdbcType=BIGINT}, update_time = #{record.updateTime,jdbcType=BIGINT}, + style_priority = #{record.stylePriority,jdbcType=VARCHAR}, x_axis = #{record.xAxis,jdbcType=LONGVARCHAR}, y_axis = #{record.yAxis,jdbcType=LONGVARCHAR}, custom_attr = #{record.customAttr,jdbcType=LONGVARCHAR}, custom_style = #{record.customStyle,jdbcType=LONGVARCHAR}, - custom_filter = #{record.customFilter,jdbcType=LONGVARCHAR} + custom_filter = #{record.customFilter,jdbcType=LONGVARCHAR}, + snapshot = #{record.snapshot,jdbcType=LONGVARCHAR} @@ -320,7 +345,8 @@ title = #{record.title,jdbcType=VARCHAR}, create_by = #{record.createBy,jdbcType=VARCHAR}, create_time = #{record.createTime,jdbcType=BIGINT}, - update_time = #{record.updateTime,jdbcType=BIGINT} + update_time = #{record.updateTime,jdbcType=BIGINT}, + style_priority = #{record.stylePriority,jdbcType=VARCHAR} @@ -352,6 +378,9 @@ update_time = #{updateTime,jdbcType=BIGINT}, + + style_priority = #{stylePriority,jdbcType=VARCHAR}, + x_axis = #{xAxis,jdbcType=LONGVARCHAR}, @@ -367,6 +396,9 @@ custom_filter = #{customFilter,jdbcType=LONGVARCHAR}, + + snapshot = #{snapshot,jdbcType=LONGVARCHAR}, + where id = #{id,jdbcType=VARCHAR} @@ -380,11 +412,13 @@ create_by = #{createBy,jdbcType=VARCHAR}, create_time = #{createTime,jdbcType=BIGINT}, update_time = #{updateTime,jdbcType=BIGINT}, + style_priority = #{stylePriority,jdbcType=VARCHAR}, x_axis = #{xAxis,jdbcType=LONGVARCHAR}, y_axis = #{yAxis,jdbcType=LONGVARCHAR}, custom_attr = #{customAttr,jdbcType=LONGVARCHAR}, custom_style = #{customStyle,jdbcType=LONGVARCHAR}, - custom_filter = #{customFilter,jdbcType=LONGVARCHAR} + custom_filter = #{customFilter,jdbcType=LONGVARCHAR}, + snapshot = #{snapshot,jdbcType=LONGVARCHAR} where id = #{id,jdbcType=VARCHAR} @@ -396,7 +430,8 @@ title = #{title,jdbcType=VARCHAR}, create_by = #{createBy,jdbcType=VARCHAR}, create_time = #{createTime,jdbcType=BIGINT}, - update_time = #{updateTime,jdbcType=BIGINT} + update_time = #{updateTime,jdbcType=BIGINT}, + style_priority = #{stylePriority,jdbcType=VARCHAR} where id = #{id,jdbcType=VARCHAR} \ No newline at end of file diff --git a/backend/src/main/resources/generatorConfig.xml b/backend/src/main/resources/generatorConfig.xml index c8c841cc56..ab97ce64ed 100644 --- a/backend/src/main/resources/generatorConfig.xml +++ b/backend/src/main/resources/generatorConfig.xml @@ -67,7 +67,7 @@ - +
diff --git a/frontend/src/api/panel/panel.js b/frontend/src/api/panel/panel.js index c5a85910fc..355d7f070b 100644 --- a/frontend/src/api/panel/panel.js +++ b/frontend/src/api/panel/panel.js @@ -18,10 +18,19 @@ export function groupTree(data) { }) } -export function loadTable(data) { +export function viewData(id, data) { return request({ - url: '/panel/table/list', + url: '/chart/view/getData/' + id, method: 'post', + hideMsg: true, + data + }) +} +export function panelSave(data) { + return request({ + url: 'panel/group/save', + method: 'post', + loading: true, data }) } @@ -104,6 +113,7 @@ export function post(url, data) { return request({ url: url, method: 'post', + loading: true, data }) } @@ -115,4 +125,4 @@ export function get(url) { }) } -export default { post, get, groupTree, defaultTree } +export default { post, get, groupTree, defaultTree, viewData ,panelSave} diff --git a/frontend/src/components/RightPanel/index.vue b/frontend/src/components/RightPanel/index.vue index 55e8c1e5c0..ab863836f5 100644 --- a/frontend/src/components/RightPanel/index.vue +++ b/frontend/src/components/RightPanel/index.vue @@ -80,7 +80,7 @@ export default { .showRightPanel { overflow: hidden; position: relative; - width: calc(100% - 15px); + width:100%; } diff --git a/frontend/src/components/canvas/components/Editor/Grid.vue b/frontend/src/components/canvas/components/Editor/Grid.vue index a3ecd76aa1..60c1f06c4e 100644 --- a/frontend/src/components/canvas/components/Editor/Grid.vue +++ b/frontend/src/components/canvas/components/Editor/Grid.vue @@ -1,26 +1,26 @@ \ No newline at end of file + diff --git a/frontend/src/components/canvas/components/Editor/Preview.vue b/frontend/src/components/canvas/components/Editor/Preview.vue index a082b91ad3..58864de930 100644 --- a/frontend/src/components/canvas/components/Editor/Preview.vue +++ b/frontend/src/components/canvas/components/Editor/Preview.vue @@ -111,19 +111,21 @@ export default { return value * parseInt(scale) / 100 }, handleScaleChange() { - const componentData = deepCopy(this.componentData) - componentData.forEach(component => { - Object.keys(component.style).forEach(key => { - if (this.needToChangeHeight.includes(key)) { - component.style[key] = this.format(component.style[key], this.scaleHeight) - } - if (this.needToChangeWidth.includes(key)) { - component.style[key] = this.format(component.style[key], this.scaleWidth) - } + if (this.componentData) { + const componentData = deepCopy(this.componentData) + componentData.forEach(component => { + Object.keys(component.style).forEach(key => { + if (this.needToChangeHeight.includes(key)) { + component.style[key] = this.format(component.style[key], this.scaleHeight) + } + if (this.needToChangeWidth.includes(key)) { + component.style[key] = this.format(component.style[key], this.scaleWidth) + } + }) }) - }) - this.componentDataShow = componentData - this.$nextTick(() => (eventBus.$emit('resizing', ''))) + this.componentDataShow = componentData + this.$nextTick(() => (eventBus.$emit('resizing', ''))) + } } } } @@ -136,7 +138,7 @@ export default { width: 100%; height: 100%; border: 1px solid #E6E6E6; - background-size: 100% !important; + background-size: 100% 100% !important; .canvas-container { 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 cab7c53fd0..25722d077b 100644 --- a/frontend/src/components/canvas/components/Editor/PreviewEject.vue +++ b/frontend/src/components/canvas/components/Editor/PreviewEject.vue @@ -106,6 +106,7 @@ export default { this.panelId = this.$route.path.split('/')[2] // 加载视图数据 get('panel/group/findOne/' + this.panelId).then(response => { + debugger this.componentDataSource = this.resetID(JSON.parse(response.data.panelData)) this.canvasStyleData = JSON.parse(response.data.panelStyle) this.resize() @@ -148,7 +149,7 @@ export default { min-height: 600px; width: 100%; height: 100%; - background-size: 100% !important; + background-size: 100% 100% !important; overflow: auto; position: relative; margin: 0; diff --git a/frontend/src/components/canvas/custom-component/UserView.vue b/frontend/src/components/canvas/custom-component/UserView.vue index 32cbf340f6..0d028a21ac 100644 --- a/frontend/src/components/canvas/custom-component/UserView.vue +++ b/frontend/src/components/canvas/custom-component/UserView.vue @@ -1,5 +1,5 @@