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 00000000..af13ef81 Binary files /dev/null and b/src/assets/images/chart/informations/inputs_tab.png differ 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]