diff --git a/src/assets/images/chart/decorates/inputs_date.png b/src/assets/images/chart/informations/inputs_date.png similarity index 100% rename from src/assets/images/chart/decorates/inputs_date.png rename to src/assets/images/chart/informations/inputs_date.png diff --git a/src/assets/images/chart/informations/inputs_select.png b/src/assets/images/chart/informations/inputs_select.png new file mode 100644 index 00000000..66ccdd09 Binary files /dev/null and b/src/assets/images/chart/informations/inputs_select.png differ diff --git a/src/packages/components/Informations/Inputs/InputsDate/config.vue b/src/packages/components/Informations/Inputs/InputsDate/config.vue index 38766425..5b906750 100644 --- a/src/packages/components/Informations/Inputs/InputsDate/config.vue +++ b/src/packages/components/Informations/Inputs/InputsDate/config.vue @@ -2,7 +2,7 @@ @@ -13,7 +13,7 @@ @@ -23,8 +23,8 @@ diff --git a/src/packages/components/Informations/Inputs/InputsDate/index.vue b/src/packages/components/Informations/Inputs/InputsDate/index.vue index 9497b0cf..506d03a8 100644 --- a/src/packages/components/Informations/Inputs/InputsDate/index.vue +++ b/src/packages/components/Informations/Inputs/InputsDate/index.vue @@ -1,21 +1,17 @@ diff --git a/src/packages/components/Informations/Inputs/InputsDate/interact.ts b/src/packages/components/Informations/Inputs/InputsDate/interact.ts index a9323163..a466c989 100644 --- a/src/packages/components/Informations/Inputs/InputsDate/interact.ts +++ b/src/packages/components/Informations/Inputs/InputsDate/interact.ts @@ -48,7 +48,7 @@ const timeRange = [ export const interactActions: InteractActionsType[] = [ { interactType: InteractEventOn.CHANGE, - interactName: '完成后的回调', + interactName: '选择完成', componentEmitEvents: { [ComponentInteractEventEnum.DATE]: time, [ComponentInteractEventEnum.DATE_TIME]: time, diff --git a/src/packages/components/Informations/Inputs/InputsSelect/config.ts b/src/packages/components/Informations/Inputs/InputsSelect/config.ts new file mode 100644 index 00000000..2a0ee907 --- /dev/null +++ b/src/packages/components/Informations/Inputs/InputsSelect/config.ts @@ -0,0 +1,38 @@ +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 { InputsSelectConfig } from './index' + +export const option = { + // 时间组件展示类型,必须和 interactActions 中定义的数据一致 + [COMPONENT_INTERACT_EVENT_KET]: ComponentInteractEventEnum.DATA, + // 默认值 + selectValue: '1', + // 暴露配置内容给用户 + dataset: [ + { + label: '选项1', + value: '1' + }, + { + label: '选项2', + value: '2' + }, + { + label: '选项3', + value: '3' + } + ] +} + +export default class Config extends PublicConfigClass implements CreateComponentType { + public key = InputsSelectConfig.key + public attr = { ...chartInitConfig, w: 260, h: 32, zIndex: -1 } + public chartConfig = cloneDeep(InputsSelectConfig) + public interactActions = interactActions + public option = cloneDeep(option) +} diff --git a/src/packages/components/Informations/Inputs/InputsSelect/config.vue b/src/packages/components/Informations/Inputs/InputsSelect/config.vue new file mode 100644 index 00000000..67472c2f --- /dev/null +++ b/src/packages/components/Informations/Inputs/InputsSelect/config.vue @@ -0,0 +1,20 @@ + + + diff --git a/src/packages/components/Informations/Inputs/InputsSelect/index.ts b/src/packages/components/Informations/Inputs/InputsSelect/index.ts new file mode 100644 index 00000000..8e4d21cb --- /dev/null +++ b/src/packages/components/Informations/Inputs/InputsSelect/index.ts @@ -0,0 +1,14 @@ +import { ConfigType, PackagesCategoryEnum, ChartFrameEnum } from '@/packages/index.d' +import { ChatCategoryEnum, ChatCategoryEnumName } from '../../index.d' + +export const InputsSelectConfig: ConfigType = { + key: 'InputsSelect', + chartKey: 'VInputsSelect', + conKey: 'VCInputsSelect', + title: '下拉选择器', + category: ChatCategoryEnum.INPUTS, + categoryName: ChatCategoryEnumName.INPUTS, + package: PackagesCategoryEnum.INFORMATIONS, + chartFrame: ChartFrameEnum.STATIC, + image: 'inputs_select.png' +} diff --git a/src/packages/components/Informations/Inputs/InputsSelect/index.vue b/src/packages/components/Informations/Inputs/InputsSelect/index.vue new file mode 100644 index 00000000..f57b3a60 --- /dev/null +++ b/src/packages/components/Informations/Inputs/InputsSelect/index.vue @@ -0,0 +1,68 @@ + + + + + diff --git a/src/packages/components/Informations/Inputs/InputsSelect/interact.ts b/src/packages/components/Informations/Inputs/InputsSelect/interact.ts new file mode 100644 index 00000000..adc75306 --- /dev/null +++ b/src/packages/components/Informations/Inputs/InputsSelect/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 48ef63f0..555f97da 100644 --- a/src/packages/components/Informations/Inputs/index.ts +++ b/src/packages/components/Informations/Inputs/index.ts @@ -1,3 +1,4 @@ import { InputsDateConfig } from './InputsDate/index' +import { InputsSelectConfig } from './InputsSelect/index' -export default [InputsDateConfig] +export default [InputsDateConfig, InputsSelectConfig] diff --git a/src/views/chart/ContentBox/index.vue b/src/views/chart/ContentBox/index.vue index 8f7b5e5d..b7d7f78f 100644 --- a/src/views/chart/ContentBox/index.vue +++ b/src/views/chart/ContentBox/index.vue @@ -10,7 +10,7 @@ - + diff --git a/src/views/chart/ContentLayers/index.vue b/src/views/chart/ContentLayers/index.vue index 4f5895d2..9d7c118f 100644 --- a/src/views/chart/ContentLayers/index.vue +++ b/src/views/chart/ContentLayers/index.vue @@ -199,9 +199,8 @@ const changeLayerType = (value: LayerModeEnum) => {