diff --git a/src/components/PageModal/Form.vue b/src/components/PageModal/Form.vue new file mode 100644 index 00000000..bf29a6dc --- /dev/null +++ b/src/components/PageModal/Form.vue @@ -0,0 +1,147 @@ + + + diff --git a/src/components/PageModal/index.vue b/src/components/PageModal/index.vue index 6f49e969..f371bd50 100644 --- a/src/components/PageModal/index.vue +++ b/src/components/PageModal/index.vue @@ -1,193 +1,87 @@ diff --git a/src/components/PageModal/types.ts b/src/components/PageModal/types.ts new file mode 100644 index 00000000..dfd8a317 --- /dev/null +++ b/src/components/PageModal/types.ts @@ -0,0 +1,57 @@ +import type { + DialogProps, + DrawerProps, + FormProps, + FormItemRule, +} from "element-plus"; + +// dialog组件属性 +export type IDialog = Partial>; + +// drawer组件属性 +export type IDrawer = Partial>; + +// form组件属性 +export type IForm = Partial>; + +// 对象类型 +export type IObject = Record; + +// 表单项 +export type IFormItems = Array<{ + // 组件类型(如input,select,radio,custom等,默认input) + type?: + | "input" + | "select" + | "radio" + | "checkbox" + | "tree-select" + | "date-picker" + | "input-number" + | "custom"; + // 组件属性 + attrs?: IObject; + // 组件可选项(适用于select,radio,checkbox组件) + options?: Array<{ + label: string; + value: any; + disabled?: boolean; + [key: string]: any; + }>; + // 插槽名(适用于组件类型为custom) + slotName?: string; + // 标签文本 + label: string; + // 标签提示 + tips?: string; + // 键名 + prop: string; + // 验证规则 + rules?: FormItemRule[]; + // 初始值 + initialValue?: any; + // 是否隐藏 + hidden?: boolean; + // 监听函数 + watch?: (newValue: any, oldValue: any, data: T) => void; +}>;