From a08e27da2d27c8b479e8749080fdd6f0c2b2e5c3 Mon Sep 17 00:00:00 2001 From: luoyp <2456821174@qq.com> Date: Tue, 1 Aug 2023 09:32:55 +0800 Subject: [PATCH] =?UTF-8?q?=E6=96=B0=E5=A2=9E=E5=88=86=E9=A1=B5=E8=81=94?= =?UTF-8?q?=E5=8A=A8=E7=BB=84=E4=BB=B6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Inputs/InputsPagination/config.ts | 26 ++++++++ .../Inputs/InputsPagination/config.vue | 35 ++++++++++ .../Inputs/InputsPagination/index.ts | 14 ++++ .../Inputs/InputsPagination/index.vue | 66 +++++++++++++++++++ .../Inputs/InputsPagination/interact.ts | 32 +++++++++ .../components/Informations/Inputs/index.ts | 3 +- 6 files changed, 175 insertions(+), 1 deletion(-) create mode 100644 src/packages/components/Informations/Inputs/InputsPagination/config.ts create mode 100644 src/packages/components/Informations/Inputs/InputsPagination/config.vue create mode 100644 src/packages/components/Informations/Inputs/InputsPagination/index.ts create mode 100644 src/packages/components/Informations/Inputs/InputsPagination/index.vue create mode 100644 src/packages/components/Informations/Inputs/InputsPagination/interact.ts diff --git a/src/packages/components/Informations/Inputs/InputsPagination/config.ts b/src/packages/components/Informations/Inputs/InputsPagination/config.ts new file mode 100644 index 00000000..7d73e5a1 --- /dev/null +++ b/src/packages/components/Informations/Inputs/InputsPagination/config.ts @@ -0,0 +1,26 @@ +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 {InputsPaginationConfig} from "./index"; + +export const option = { + // 时间组件展示类型,必须和 interactActions 中定义的数据一致 + [COMPONENT_INTERACT_EVENT_KET]: ComponentInteractEventEnum.DATA, + // 默认值 + pageValue:1, + sizeValue:[2,4,8,10,20], + pageSize:4, + // 暴露配置内容给用户 + dataset: 10 +} + +export default class Config extends PublicConfigClass implements CreateComponentType { + public key = InputsPaginationConfig.key + public attr = { ...chartInitConfig, w: 395, h: 32, zIndex: -1 } + public chartConfig = cloneDeep(InputsPaginationConfig) + public interactActions = interactActions + public option = cloneDeep(option) +} \ No newline at end of file diff --git a/src/packages/components/Informations/Inputs/InputsPagination/config.vue b/src/packages/components/Informations/Inputs/InputsPagination/config.vue new file mode 100644 index 00000000..3599781d --- /dev/null +++ b/src/packages/components/Informations/Inputs/InputsPagination/config.vue @@ -0,0 +1,35 @@ + + \ No newline at end of file diff --git a/src/packages/components/Informations/Inputs/InputsPagination/index.ts b/src/packages/components/Informations/Inputs/InputsPagination/index.ts new file mode 100644 index 00000000..cfc3b912 --- /dev/null +++ b/src/packages/components/Informations/Inputs/InputsPagination/index.ts @@ -0,0 +1,14 @@ +import { ConfigType, PackagesCategoryEnum, ChartFrameEnum } from '@/packages/index.d' +import { ChatCategoryEnum, ChatCategoryEnumName } from '../../index.d' + +export const InputsPaginationConfig: ConfigType = { + key: 'InputsPagination', + chartKey: 'VInputsPagination', + conKey: 'VCInputsPagination', + title: '分页', + category: ChatCategoryEnum.INPUTS, + categoryName: ChatCategoryEnumName.INPUTS, + package: PackagesCategoryEnum.INFORMATIONS, + chartFrame: ChartFrameEnum.STATIC, + image: 'inputs_select.png' +} \ No newline at end of file diff --git a/src/packages/components/Informations/Inputs/InputsPagination/index.vue b/src/packages/components/Informations/Inputs/InputsPagination/index.vue new file mode 100644 index 00000000..2dc81c75 --- /dev/null +++ b/src/packages/components/Informations/Inputs/InputsPagination/index.vue @@ -0,0 +1,66 @@ + + + \ No newline at end of file diff --git a/src/packages/components/Informations/Inputs/InputsPagination/interact.ts b/src/packages/components/Informations/Inputs/InputsPagination/interact.ts new file mode 100644 index 00000000..acc1453f --- /dev/null +++ b/src/packages/components/Informations/Inputs/InputsPagination/interact.ts @@ -0,0 +1,32 @@ +import { InteractEventOn, InteractActionsType } from '@/enums/eventEnum' + +// 时间组件类型 +export enum ComponentInteractEventEnum { + DATA = 'data' +} + +// 联动参数 +export enum ComponentInteractParamsEnum { + DATA = 'data', + DATA2 = 'data2' +} + +// 定义组件触发回调事件 +export const interactActions: InteractActionsType[] = [ + { + interactType: InteractEventOn.CHANGE, + interactName: '选择完成', + componentEmitEvents: { + [ComponentInteractEventEnum.DATA]: [ + { + value: ComponentInteractParamsEnum.DATA, + label: '页数' + }, + { + value: ComponentInteractParamsEnum.DATA2, + label: '每页条数' + } + ] + } + } +] \ No newline at end of file diff --git a/src/packages/components/Informations/Inputs/index.ts b/src/packages/components/Informations/Inputs/index.ts index 1f4f22a7..bea83789 100644 --- a/src/packages/components/Informations/Inputs/index.ts +++ b/src/packages/components/Informations/Inputs/index.ts @@ -1,5 +1,6 @@ import { InputsDateConfig } from './InputsDate/index' import { InputsSelectConfig } from './InputsSelect/index' import { InputsTabConfig } from './InputsTab/index' +import { InputsPaginationConfig } from "./InputsPagination/index"; -export default [InputsDateConfig, InputsSelectConfig, InputsTabConfig] +export default [InputsDateConfig, InputsSelectConfig, InputsTabConfig,InputsPaginationConfig]