From 541c9dba1f7557bdb9c379dbdbe20e1ffaaabac9 Mon Sep 17 00:00:00 2001 From: wangjiahao <1522128093@qq.com> Date: Fri, 18 Nov 2022 18:58:30 +0800 Subject: [PATCH] =?UTF-8?q?feat(=E4=BB=AA=E8=A1=A8=E6=9D=BF):=20=E6=82=AC?= =?UTF-8?q?=E6=B5=AE=E7=BB=84=E4=BB=B6=E6=94=AF=E6=8C=81=E7=B2=BE=E7=A1=AE?= =?UTF-8?q?=E4=BD=8D=E7=BD=AE=E8=B0=83=E6=95=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../canvas/components/editor/SettingMenu.vue | 10 ++ frontend/src/lang/en.js | 5 + frontend/src/lang/tw.js | 5 + frontend/src/lang/zh.js | 5 + frontend/src/store/index.js | 14 +- frontend/src/views/chart/view/ChartEdit.vue | 149 +++++++++++------- .../src/views/chart/view/PositionAdjust.vue | 92 +++++++++++ frontend/src/views/panel/edit/index.vue | 7 +- 8 files changed, 223 insertions(+), 64 deletions(-) create mode 100644 frontend/src/views/chart/view/PositionAdjust.vue diff --git a/frontend/src/components/canvas/components/editor/SettingMenu.vue b/frontend/src/components/canvas/components/editor/SettingMenu.vue index 56d30a4e9c..c1c1ac35bd 100644 --- a/frontend/src/components/canvas/components/editor/SettingMenu.vue +++ b/frontend/src/components/canvas/components/editor/SettingMenu.vue @@ -90,6 +90,13 @@ {{ $t('panel.hyperlinks') }} + + + {{ $t('panel.position_adjust') }} + @@ -213,6 +220,9 @@ export default { this.showCustomSort = false }) }, + positionAdjust() { + bus.$emit('change_panel_right_draw', true) + }, edit() { if (this.curComponent.type === 'custom') { bus.$emit('component-dialog-edit', 'update') diff --git a/frontend/src/lang/en.js b/frontend/src/lang/en.js index 4cc96873e4..1979ce85d2 100644 --- a/frontend/src/lang/en.js +++ b/frontend/src/lang/en.js @@ -1875,6 +1875,11 @@ export default { back_parent: 'Back to previous' }, panel: { + position_adjust: 'Position', + space_top: 'Top', + space_left: 'Left', + space_width: 'Widht', + space_height: 'Height', to_top: 'To Top', down: 'Down', mobile_style_setting: 'Style setting', diff --git a/frontend/src/lang/tw.js b/frontend/src/lang/tw.js index 1f265b98d2..4914de9835 100644 --- a/frontend/src/lang/tw.js +++ b/frontend/src/lang/tw.js @@ -1875,6 +1875,11 @@ export default { back_parent: '返回上一級' }, panel: { + position_adjust: '位置', + space_top: '上', + space_left: '左', + space_width: '寬', + space_height: '高', to_top: '置頂', down: '下載', mobile_style_setting: '樣式設置', diff --git a/frontend/src/lang/zh.js b/frontend/src/lang/zh.js index f9c00523d5..88749cf7c9 100644 --- a/frontend/src/lang/zh.js +++ b/frontend/src/lang/zh.js @@ -1875,6 +1875,11 @@ export default { back_parent: '返回上一级' }, panel: { + position_adjust: '位置', + space_top: '上', + space_left: '左', + space_width: '宽', + space_height: '高', to_top: '置顶', down: '下载', mobile_style_setting: '样式设置', diff --git a/frontend/src/store/index.js b/frontend/src/store/index.js index f03e066752..64cbee8318 100644 --- a/frontend/src/store/index.js +++ b/frontend/src/store/index.js @@ -22,12 +22,10 @@ import layer from '@/components/canvas/store/layer' import snapshot from '@/components/canvas/store/snapshot' import lock from '@/components/canvas/store/lock' import task from './modules/task' -import { valueValid, formatCondition } from '@/utils/conditionUtil' +import { formatCondition, valueValid } from '@/utils/conditionUtil' import { Condition } from '@/components/widget/bean/Condition' -import { - DEFAULT_COMMON_CANVAS_STYLE_STRING -} from '@/views/panel/panel' +import { DEFAULT_COMMON_CANVAS_STYLE_STRING } from '@/views/panel/panel' import bus from '@/utils/bus' import { BASE_MOBILE_STYLE } from '@/components/canvas/customComponent/component-list' import { TYPE_CONFIGS } from '@/views/chart/chart/util' @@ -236,10 +234,10 @@ const data = { setShapeStyle({ curComponent, canvasStyleData, curCanvasScaleMap }, { top, left, width, height, rotate }) { const curCanvasScaleSelf = curCanvasScaleMap[curComponent.canvasId] if (curComponent) { - if (top || top === 0) curComponent.style.top = (top / curCanvasScaleSelf.scalePointHeight) + 0.0000001 - if (left || left === 0) curComponent.style.left = (left / curCanvasScaleSelf.scalePointWidth) + 0.0000001 - if (width || width === 0) curComponent.style.width = (width / curCanvasScaleSelf.scalePointWidth + 0.0000001) - if (height || height === 0) curComponent.style.height = (height / curCanvasScaleSelf.scalePointHeight) + 0.0000001 + if (top || top === 0) curComponent.style.top = Math.round((top / curCanvasScaleSelf.scalePointHeight)) + if (left || left === 0) curComponent.style.left = Math.round((left / curCanvasScaleSelf.scalePointWidth)) + if (width || width === 0) curComponent.style.width = Math.round((width / curCanvasScaleSelf.scalePointWidth)) + if (height || height === 0) curComponent.style.height = Math.round((height / curCanvasScaleSelf.scalePointHeight)) if (rotate || rotate === 0) curComponent.style.rotate = rotate } }, diff --git a/frontend/src/views/chart/view/ChartEdit.vue b/frontend/src/views/chart/view/ChartEdit.vue index bd78ac4b01..30ac660e0c 100644 --- a/frontend/src/views/chart/view/ChartEdit.vue +++ b/frontend/src/views/chart/view/ChartEdit.vue @@ -74,7 +74,9 @@ round @click="changeDs" > - {{ $t('panel.template_view_tips') }} + {{ $t('panel.template_view_tips') }} @@ -1107,6 +1109,16 @@ + + + + {{ $t('chart.cancel') }} + >{{ $t('chart.cancel') }} + {{ $t('chart.confirm') }} + >{{ $t('chart.confirm') }} + @@ -1262,12 +1276,14 @@ {{ $t('chart.cancel') }} + >{{ $t('chart.cancel') }} + {{ $t('chart.confirm') }} + >{{ $t('chart.confirm') }} + {{ $t('chart.cancel') }} + >{{ $t('chart.cancel') }} + {{ $t('chart.confirm') }} + >{{ $t('chart.confirm') }} + {{ $t('chart.cancel') }} + >{{ $t('chart.cancel') }} + {{ $t('chart.confirm') }} + >{{ $t('chart.confirm') }} + @@ -1346,7 +1366,8 @@ {{ $t('chart.cancel') }} + >{{ $t('chart.cancel') }} + {{ $t('chart.close') }} + >{{ $t('chart.close') }} + @@ -1411,7 +1433,8 @@ size="mini" style="float: right;" @click="closeEditChartField" - >{{ $t('chart.close') }} + >{{ $t('chart.close') }} + @@ -1436,12 +1459,14 @@ {{ $t('chart.cancel') }} + >{{ $t('chart.cancel') }} + {{ $t('chart.confirm') }} + >{{ $t('chart.confirm') }} + @@ -1466,12 +1491,14 @@ {{ $t('chart.cancel') }} + >{{ $t('chart.cancel') }} + {{ $t('chart.confirm') }} + >{{ $t('chart.confirm') }} + @@ -1498,12 +1525,14 @@ {{ $t('chart.cancel') }} + >{{ $t('chart.cancel') }} + {{ $t('chart.confirm') }} + >{{ $t('chart.confirm') }} + @@ -1530,12 +1559,14 @@ {{ $t('chart.cancel') }} + >{{ $t('chart.cancel') }} + {{ $t('chart.confirm') }} + >{{ $t('chart.confirm') }} + @@ -1562,10 +1593,11 @@ - diff --git a/frontend/src/views/panel/edit/index.vue b/frontend/src/views/panel/edit/index.vue index 5d4f1914a5..1634189267 100644 --- a/frontend/src/views/panel/edit/index.vue +++ b/frontend/src/views/panel/edit/index.vue @@ -283,11 +283,10 @@ @click="changeRightDrawOpen(false)" /> + {{ $t('panel.position_adjust') }} -
- {{ $t('panel.select_view') }} -
+
@@ -526,10 +525,12 @@ import DeCanvas from '@/components/canvas/DeCanvas' import TextAttr from '@/components/canvas/components/TextAttr' import { userLoginInfo } from '@/api/systemInfo/userLogin' import { activeWatermark } from '@/components/canvas/tools/watermark' +import PositionAdjust from '@/views/chart/view/PositionAdjust' export default { name: 'PanelEdit', components: { + PositionAdjust, TextAttr, DeCanvas, Multiplexing,