From 7c871c775c3a08271e7e75966642eacb0c00b57a Mon Sep 17 00:00:00 2001 From: tnt group Date: Tue, 27 Sep 2022 08:56:49 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E4=BF=AE=E5=A4=8D=E6=96=87=E6=9C=AC?= =?UTF-8?q?=E8=AE=BE=E7=BD=AE=E9=93=BE=E6=8E=A5=E6=97=B6=EF=BC=8C=E5=AD=97?= =?UTF-8?q?=E4=BD=93=E6=A0=B7=E5=BC=8F=E4=B8=A2=E5=A4=B1=E9=97=AE=E9=A2=98?= =?UTF-8?q?=EF=BC=8C=E5=B9=B6=E5=A2=9E=E5=8A=A0=E6=B0=B4=E5=B9=B3=E5=AF=B9?= =?UTF-8?q?=E9=BD=90=E9=85=8D=E7=BD=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Informations/Texts/TextCommon/config.ts | 14 +++--- .../Informations/Texts/TextCommon/config.vue | 34 +++++++------- .../Informations/Texts/TextCommon/index.vue | 44 +++++++++---------- 3 files changed, 48 insertions(+), 44 deletions(-) diff --git a/src/packages/components/Informations/Texts/TextCommon/config.ts b/src/packages/components/Informations/Texts/TextCommon/config.ts index e71a8158..d2aba30a 100644 --- a/src/packages/components/Informations/Texts/TextCommon/config.ts +++ b/src/packages/components/Informations/Texts/TextCommon/config.ts @@ -5,22 +5,23 @@ import cloneDeep from 'lodash/cloneDeep' export enum WritingModeEnum { HORIZONTAL = '水平', - VERTICAL = '垂直', + VERTICAL = '垂直' } export const WritingModeObject = { [WritingModeEnum.HORIZONTAL]: 'horizontal-tb', - [WritingModeEnum.VERTICAL]: 'vertical-rl', + [WritingModeEnum.VERTICAL]: 'vertical-rl' } export const option = { - link:'', - linkHead:'http://', + link: '', + linkHead: 'http://', dataset: '我是文本', fontSize: 20, fontColor: '#ffffff', paddingX: 10, paddingY: 10, + textAlign: 'center', // 水平对齐方式 // 边框 borderWidth: 0, @@ -30,11 +31,10 @@ export const option = { // 字间距 letterSpacing: 5, writingMode: 'horizontal-tb', - backgroundColor: '#00000000', + backgroundColor: '#00000000' } -export default class Config extends PublicConfigClass implements CreateComponentType -{ +export default class Config extends PublicConfigClass implements CreateComponentType { public key = TextCommonConfig.key public chartConfig = cloneDeep(TextCommonConfig) public option = cloneDeep(option) diff --git a/src/packages/components/Informations/Texts/TextCommon/config.vue b/src/packages/components/Informations/Texts/TextCommon/config.vue index 07a9d95e..aa912e57 100644 --- a/src/packages/components/Informations/Texts/TextCommon/config.vue +++ b/src/packages/components/Informations/Texts/TextCommon/config.vue @@ -23,26 +23,30 @@ + + + - - - - + + + + + + + + - - - @@ -86,6 +90,12 @@ const props = defineProps({ } }) +const textAlignOptions = [ + { label: '左对齐', value: 'start' }, + { label: '居中', value: 'center' }, + { label: '右对齐', value: 'end' } +] + const verticalOptions = [ { label: WritingModeEnum.HORIZONTAL, @@ -100,13 +110,7 @@ const handleLinkClick = () => { window.open(props.optionData.linkHead + props.optionData.link) } const linkHeadOptions = [ - { - label: 'http://', - value: 'http://' - }, - { - label: 'https://', - value: 'https://' - } + { label: 'http://', value: 'http://' }, + { label: 'https://', value: 'https://' } ] diff --git a/src/packages/components/Informations/Texts/TextCommon/index.vue b/src/packages/components/Informations/Texts/TextCommon/index.vue index 18990c70..0df31961 100644 --- a/src/packages/components/Informations/Texts/TextCommon/index.vue +++ b/src/packages/components/Informations/Texts/TextCommon/index.vue @@ -1,27 +1,12 @@ + @@ -84,6 +69,21 @@ const click = () => { @include go('text-box') { display: flex; align-items: center; - justify-content: center; + justify-content: v-bind('textAlign'); + + .content { + color: v-bind('fontColor'); + padding: v-bind('`${paddingY}px ${paddingX}px`'); + font-size: v-bind('fontSize + "px"'); + letter-spacing: v-bind('letterSpacing + "px"'); + writing-mode: v-bind('writingMode'); + + border-style: solid; + border-width: v-bind('borderWidth + "px"'); + border-radius: v-bind('borderRadius + "px"'); + border-color: v-bind('borderColor'); + + background-color: v-bind('backgroundColor'); + } }