From b18e67face739aa78f4f5d419491d5d708c95cad Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=A5=94=E8=B7=91=E7=9A=84=E9=9D=A2=E6=9D=A1?= <1262327911@qq.com> Date: Thu, 16 Mar 2023 14:06:00 +0800 Subject: [PATCH] =?UTF-8?q?feat:=20=E6=96=B0=E5=A2=9E=20tab=20=E7=BB=84?= =?UTF-8?q?=E4=BB=B6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../images/chart/informations/inputs_tab.png | Bin 0 -> 7037 bytes .../Inputs/InputsSelect/index.vue | 2 - .../Informations/Inputs/InputsTab/config.ts | 40 ++++++++++++ .../Informations/Inputs/InputsTab/config.vue | 31 ++++++++++ .../Informations/Inputs/InputsTab/index.ts | 14 +++++ .../Informations/Inputs/InputsTab/index.vue | 58 ++++++++++++++++++ .../Informations/Inputs/InputsTab/interact.ts | 27 ++++++++ .../components/Informations/Inputs/index.ts | 3 +- 8 files changed, 172 insertions(+), 3 deletions(-) create mode 100644 src/assets/images/chart/informations/inputs_tab.png create mode 100644 src/packages/components/Informations/Inputs/InputsTab/config.ts create mode 100644 src/packages/components/Informations/Inputs/InputsTab/config.vue create mode 100644 src/packages/components/Informations/Inputs/InputsTab/index.ts create mode 100644 src/packages/components/Informations/Inputs/InputsTab/index.vue create mode 100644 src/packages/components/Informations/Inputs/InputsTab/interact.ts diff --git a/src/assets/images/chart/informations/inputs_tab.png b/src/assets/images/chart/informations/inputs_tab.png new file mode 100644 index 0000000000000000000000000000000000000000..af13ef8182d547c7d986b59088d7d97b5127adfd GIT binary patch literal 7037 zcmc&(2T)U6w?@SVmtvv!-U+=V6p^AxFVcgQ1PCDsC4?%dsHjL25s-Ef5v2*C6N)Ik zDm{cyL_i>+7isc>x4-+}f9B2m-@G$>&Fr$;UVEK2=iBF@sqqy$8g?2gDk?htt2*XX zR3|W0RL6tQoS@8DwD5XUCIn!XHfS3oL!c`PA?*x7xj>}@5tIe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SzhBwE8I3hCY_49m?jAZX)0UN3&}(q4_!c-^j?g@u}Iwqm*QMTD_Q zio2G&p&+HHsi;aie%60&ZIAArRO#Iy?eBXS;C$+GJ!x*!_wjo8_+2>eaLmjB><}8f z|LOD`kIDY`52dLtrp%U!Fx6&tZXC-h~8Q(w3@5J zsr#!1XLQbNL6z*z@^yj^4t6iwbHw-*f10RQY&lqE-P=JwPAZ9MxrrMdtCV<@IOu3b zIjVW<>TK(>sP+l*4qMds&i&Y9g(2eCQVIhyF&(TF5 zY_r;9^V_`K8#N#-2lZfoZuPacwX$|^%9rB@FYCfR%phKNVg?qUj_>gj0S#lg)$hP@ z;VI;p{!H?tD{i1taE=?Upn*CzkyKTYa5Sj35Y#02D~jN*bz?R|Rfq^gp!54AdCpq&)mpWUni#0Al{#W z=U;K`{~BTXo&Wbhm~wdk{j%Ucf?EF%xAd2L3QBfG2z4$=i5&Yp`erbV`T+>fHS|2v z_(W3y(*5n$?D!PnlBBac>g|?ZsqKjuFs0P+<7Lakx36}YXC3`D)7LfDDZ1=*=f420 Ci`7N| literal 0 HcmV?d00001 diff --git a/src/packages/components/Informations/Inputs/InputsSelect/index.vue b/src/packages/components/Informations/Inputs/InputsSelect/index.vue index f57b3a60..714d4021 100644 --- a/src/packages/components/Informations/Inputs/InputsSelect/index.vue +++ b/src/packages/components/Informations/Inputs/InputsSelect/index.vue @@ -23,8 +23,6 @@ const props = defineProps({ }) const { w, h } = toRefs(props.chartConfig.attr) -const rangeDate = ref() - const option = shallowReactive({ value: { selectValue: props.chartConfig.option.selectValue, diff --git a/src/packages/components/Informations/Inputs/InputsTab/config.ts b/src/packages/components/Informations/Inputs/InputsTab/config.ts new file mode 100644 index 00000000..6d8067ac --- /dev/null +++ b/src/packages/components/Informations/Inputs/InputsTab/config.ts @@ -0,0 +1,40 @@ +import dayjs from 'dayjs' +import cloneDeep from 'lodash/cloneDeep' +import { PublicConfigClass } from '@/packages/public' +import { CreateComponentType } from '@/packages/index.d' +import { chartInitConfig } from '@/settings/designSetting' +import { COMPONENT_INTERACT_EVENT_KET } from '@/enums/eventEnum' +import { interactActions, ComponentInteractEventEnum } from './interact' +import { InputsTabConfig } from './index' + +export const option = { + // 时间组件展示类型,必须和 interactActions 中定义的数据一致 + [COMPONENT_INTERACT_EVENT_KET]: ComponentInteractEventEnum.DATA, + // 默认值 + tabLabel: '选项1', + // 样式 + tabType: 'segment', + // 暴露配置内容给用户 + dataset: [ + { + label: '选项1', + value: '1' + }, + { + label: '选项2', + value: '2' + }, + { + label: '选项3', + value: '3' + } + ] +} + +export default class Config extends PublicConfigClass implements CreateComponentType { + public key = InputsTabConfig.key + public attr = { ...chartInitConfig, w: 460, h: 32, zIndex: -1 } + public chartConfig = cloneDeep(InputsTabConfig) + public interactActions = interactActions + public option = cloneDeep(option) +} diff --git a/src/packages/components/Informations/Inputs/InputsTab/config.vue b/src/packages/components/Informations/Inputs/InputsTab/config.vue new file mode 100644 index 00000000..39d9cad5 --- /dev/null +++ b/src/packages/components/Informations/Inputs/InputsTab/config.vue @@ -0,0 +1,31 @@ + + + diff --git a/src/packages/components/Informations/Inputs/InputsTab/index.ts b/src/packages/components/Informations/Inputs/InputsTab/index.ts new file mode 100644 index 00000000..29276c2c --- /dev/null +++ b/src/packages/components/Informations/Inputs/InputsTab/index.ts @@ -0,0 +1,14 @@ +import { ConfigType, PackagesCategoryEnum, ChartFrameEnum } from '@/packages/index.d' +import { ChatCategoryEnum, ChatCategoryEnumName } from '../../index.d' + +export const InputsTabConfig: ConfigType = { + key: 'InputsTab', + chartKey: 'VInputsTab', + conKey: 'VCInputsTab', + title: '标签选择器', + category: ChatCategoryEnum.INPUTS, + categoryName: ChatCategoryEnumName.INPUTS, + package: PackagesCategoryEnum.INFORMATIONS, + chartFrame: ChartFrameEnum.STATIC, + image: 'inputs_tab.png' +} diff --git a/src/packages/components/Informations/Inputs/InputsTab/index.vue b/src/packages/components/Informations/Inputs/InputsTab/index.vue new file mode 100644 index 00000000..f048a482 --- /dev/null +++ b/src/packages/components/Informations/Inputs/InputsTab/index.vue @@ -0,0 +1,58 @@ + + + + + diff --git a/src/packages/components/Informations/Inputs/InputsTab/interact.ts b/src/packages/components/Informations/Inputs/InputsTab/interact.ts new file mode 100644 index 00000000..adc75306 --- /dev/null +++ b/src/packages/components/Informations/Inputs/InputsTab/interact.ts @@ -0,0 +1,27 @@ +import { InteractEventOn, InteractActionsType } from '@/enums/eventEnum' + +// 时间组件类型 +export enum ComponentInteractEventEnum { + DATA = 'data' +} + +// 联动参数 +export enum ComponentInteractParamsEnum { + DATA = 'data' +} + +// 定义组件触发回调事件 +export const interactActions: InteractActionsType[] = [ + { + interactType: InteractEventOn.CHANGE, + interactName: '选择完成', + componentEmitEvents: { + [ComponentInteractEventEnum.DATA]: [ + { + value: ComponentInteractParamsEnum.DATA, + label: '选择项' + } + ] + } + } +] diff --git a/src/packages/components/Informations/Inputs/index.ts b/src/packages/components/Informations/Inputs/index.ts index 555f97da..1f4f22a7 100644 --- a/src/packages/components/Informations/Inputs/index.ts +++ b/src/packages/components/Informations/Inputs/index.ts @@ -1,4 +1,5 @@ import { InputsDateConfig } from './InputsDate/index' import { InputsSelectConfig } from './InputsSelect/index' +import { InputsTabConfig } from './InputsTab/index' -export default [InputsDateConfig, InputsSelectConfig] +export default [InputsDateConfig, InputsSelectConfig, InputsTabConfig]