diff --git a/frontend/src/components/canvas/components/Editor/Grid.vue b/frontend/src/components/canvas/components/Editor/Grid.vue index 7946e63b19..89640eb4c5 100644 --- a/frontend/src/components/canvas/components/Editor/Grid.vue +++ b/frontend/src/components/canvas/components/Editor/Grid.vue @@ -9,12 +9,12 @@ stroke-width="1" /> - - + + @@ -25,6 +25,8 @@ diff --git a/frontend/src/components/canvas/components/Editor/index.vue b/frontend/src/components/canvas/components/Editor/index.vue index 9e6c00fedf..c58fcfa466 100644 --- a/frontend/src/components/canvas/components/Editor/index.vue +++ b/frontend/src/components/canvas/components/Editor/index.vue @@ -866,14 +866,8 @@ export default { } }, matrixCount: { - required: false, - type: Object, - default: () => { - return { - x: 36, - y: 18 - } - } + required: true, + type: Object }, scrollTop: { type: Number, @@ -1017,13 +1011,11 @@ export default { } }, watch: { - matrixCount: { + 'canvasStyleData.aidedDesign.matrixBase': { handler(newVal, oldVal) { - if (newVal && oldVal) { - this.changeComponentSizePoint(newVal.x / oldVal.x) - } - this.changeScale() - } + this.changeComponentSizePoint(newVal / oldVal) + }, + deep: true }, customStyle: { handler(newVal) { @@ -1065,10 +1057,7 @@ export default { }, mounted() { - setTimeout(() => { - this.changeScale() - this.editShow = true - }, 500) + this.canvasInit() // 获取编辑器元素 this.$store.commit('getEditor') const _this = this @@ -1089,6 +1078,13 @@ export default { created() { }, methods: { + canvasInit() { + this.editShow = false + setTimeout(() => { + this.changeScale() + this.editShow = true + }, 500) + }, backgroundSetClose() { this.boardSetVisible = false }, @@ -1255,6 +1251,7 @@ export default { item.sizex = item.sizex * pointScale item.sizey = item.sizey * pointScale }) + this.changeScale() } }, diff --git a/frontend/src/components/canvas/utils/utils.js b/frontend/src/components/canvas/utils/utils.js index 2bd642b7be..4db1994c95 100644 --- a/frontend/src/components/canvas/utils/utils.js +++ b/frontend/src/components/canvas/utils/utils.js @@ -95,7 +95,6 @@ export function panelInit(componentData, componentStyle) { item.hyperlinks = (item.hyperlinks || HYPERLINKS) } item.commonBackground = item.commonBackground || deepCopy(COMMON_BACKGROUND_NONE) - componentData[index] = item }) // style初始化 componentStyle.refreshTime = (componentStyle.refreshTime || 5) diff --git a/frontend/src/views/panel/SubjectSetting/PanelStyle/PanelAidedDesign.vue b/frontend/src/views/panel/SubjectSetting/PanelStyle/PanelAidedDesign.vue index e5cd9868b3..680f73bd8d 100644 --- a/frontend/src/views/panel/SubjectSetting/PanelStyle/PanelAidedDesign.vue +++ b/frontend/src/views/panel/SubjectSetting/PanelStyle/PanelAidedDesign.vue @@ -15,7 +15,7 @@ 普通 适中 - 密集 + 密集 diff --git a/frontend/vue.config.js b/frontend/vue.config.js index f1218fa1ce..34b4f12eb4 100644 --- a/frontend/vue.config.js +++ b/frontend/vue.config.js @@ -40,7 +40,7 @@ module.exports = { }, configureWebpack: { name: name, - devtool: 'cheap-module-source-map', + devtool: 'source-map', resolve: { alias: { '@': resolve('src')