From 31c63130d63549a410a13a4e05934ca41a220311 Mon Sep 17 00:00:00 2001 From: wuyuting1 Date: Tue, 20 Sep 2022 17:51:41 +0800 Subject: [PATCH 1/2] =?UTF-8?q?feat:=20text=E7=BB=84=E4=BB=B6=E5=A2=9E?= =?UTF-8?q?=E5=8A=A0=E7=82=B9=E5=87=BB=E9=93=BE=E6=8E=A5=E5=BC=B9=E6=A1=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Informations/Texts/TextCommon/config.ts | 1 + .../Informations/Texts/TextCommon/config.vue | 16 +++++++++++++++- .../Informations/Texts/TextCommon/index.vue | 11 ++++++++++- 3 files changed, 26 insertions(+), 2 deletions(-) diff --git a/src/packages/components/Informations/Texts/TextCommon/config.ts b/src/packages/components/Informations/Texts/TextCommon/config.ts index b20c318e..3774e0ae 100644 --- a/src/packages/components/Informations/Texts/TextCommon/config.ts +++ b/src/packages/components/Informations/Texts/TextCommon/config.ts @@ -14,6 +14,7 @@ export const WritingModeObject = { } export const option = { + link:'', dataset: '我是文本', fontSize: 20, fontColor: '#ffffff', diff --git a/src/packages/components/Informations/Texts/TextCommon/config.vue b/src/packages/components/Informations/Texts/TextCommon/config.vue index 4988e9c4..25568621 100644 --- a/src/packages/components/Informations/Texts/TextCommon/config.vue +++ b/src/packages/components/Informations/Texts/TextCommon/config.vue @@ -5,6 +5,11 @@ + + + 点击 + + @@ -69,7 +74,7 @@ import { SettingItemBox, SettingItem } from '@/components/Pages/ChartItemSetting' - +import { useMessage } from 'naive-ui' const props = defineProps({ optionData: { type: Object as PropType, @@ -84,4 +89,13 @@ const verticalOptions = [{ label: WritingModeEnum.VERTICAL, value: WritingModeObject[WritingModeEnum.VERTICAL] }] +const message = useMessage() +const handleLinkClick = ()=>{ + + if(props.optionData.link){ + window.open(props.optionData.link) + }else{ + message.info("链接未输入") + } +} diff --git a/src/packages/components/Informations/Texts/TextCommon/index.vue b/src/packages/components/Informations/Texts/TextCommon/index.vue index 1701fae9..92418501 100644 --- a/src/packages/components/Informations/Texts/TextCommon/index.vue +++ b/src/packages/components/Informations/Texts/TextCommon/index.vue @@ -15,7 +15,10 @@ background-color:${backgroundColor}`" > - {{ option.dataset }} + + {{ dataset }} + + {{ dataset }} @@ -35,6 +38,7 @@ const props = defineProps({ const { w, h } = toRefs(props.chartConfig.attr) const { + link, dataset, fontColor, fontSize, @@ -68,6 +72,11 @@ watch( useChartDataFetch(props.chartConfig, useChartEditStore, (newData: string) => { option.dataset = newData }) + +//打开链接 +const click = () => { + window.open(link.value) +}