@done-coding/admin-core 0.0.1-alpha.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +48 -0
- package/docs/TECH_SNAPSHOT.md +146 -0
- package/docs/specs/2026-05-09-055250-moderate-/345/210/227/350/241/250key/351/205/215/347/275/256/347/202/271/350/267/257/345/276/204/346/224/257/346/214/201/RETROSPECTIVE.md +63 -0
- package/docs/specs/2026-05-09-055250-moderate-/345/210/227/350/241/250key/351/205/215/347/275/256/347/202/271/350/267/257/345/276/204/346/224/257/346/214/201/design.md +575 -0
- package/docs/specs/2026-05-09-055250-moderate-/345/210/227/350/241/250key/351/205/215/347/275/256/347/202/271/350/267/257/345/276/204/346/224/257/346/214/201/landing-authorizations/2026-05-09-080900-/346/234/2371-/345/205/245/345/256/236/346/226/275/346/216/210/346/235/203.md +107 -0
- package/docs/specs/2026-05-09-055250-moderate-/345/210/227/350/241/250key/351/205/215/347/275/256/347/202/271/350/267/257/345/276/204/346/224/257/346/214/201/project-orchestration.md +58 -0
- package/docs/specs/2026-05-09-055250-moderate-/345/210/227/350/241/250key/351/205/215/347/275/256/347/202/271/350/267/257/345/276/204/346/224/257/346/214/201/requirements.md +238 -0
- package/docs/specs/2026-05-09-055250-moderate-/345/210/227/350/241/250key/351/205/215/347/275/256/347/202/271/350/267/257/345/276/204/346/224/257/346/214/201/tasks.md +290 -0
- package/es/_virtual/_plugin-vue_export-helper.mjs +9 -0
- package/es/components/display/WatchSize.vue.mjs +50 -0
- package/es/components/display/WatchSize.vue2.mjs +4 -0
- package/es/components/display/index.mjs +12 -0
- package/es/components/form/FormItem.vue.mjs +7 -0
- package/es/components/form/FormItem.vue2.mjs +145 -0
- package/es/components/form/FormMain.vue.mjs +142 -0
- package/es/components/form/FormMain.vue2.mjs +4 -0
- package/es/components/form/FormRadioGroup.vue.mjs +36 -0
- package/es/components/form/FormRadioGroup.vue2.mjs +4 -0
- package/es/components/form/FormSearch.vue.mjs +7 -0
- package/es/components/form/FormSearch.vue2.mjs +132 -0
- package/es/components/form/FormSelect.vue.mjs +65 -0
- package/es/components/form/FormSelect.vue2.mjs +4 -0
- package/es/components/form/FormTree.vue.mjs +34 -0
- package/es/components/form/FormTree.vue2.mjs +4 -0
- package/es/components/form/FormVerifyCode.vue.mjs +72 -0
- package/es/components/form/FormVerifyCode.vue2.mjs +4 -0
- package/es/components/form/FormVerifyImage.vue.mjs +7 -0
- package/es/components/form/FormVerifyImage.vue2.mjs +60 -0
- package/es/components/form/index.mjs +32 -0
- package/es/components/form/utils.mjs +147 -0
- package/es/components/list-page/ListPage.vue.mjs +7 -0
- package/es/components/list-page/ListPage.vue2.mjs +194 -0
- package/es/components/list-page/index.mjs +14 -0
- package/es/components/menu/MenuItemSub.vue.mjs +60 -0
- package/es/components/menu/MenuItemSub.vue2.mjs +4 -0
- package/es/components/menu/MenuTree.vue.mjs +87 -0
- package/es/components/menu/MenuTree.vue2.mjs +4 -0
- package/es/components/menu/index.mjs +12 -0
- package/es/components/misc/TriggerAutoImport.vue.mjs +10 -0
- package/es/components/misc/TriggerAutoImport.vue2.mjs +4 -0
- package/es/components/misc/index.mjs +12 -0
- package/es/components/modal/ConfirmModal.vue.mjs +8 -0
- package/es/components/modal/ConfirmModal.vue2.mjs +141 -0
- package/es/components/modal/DetailModal.vue.mjs +67 -0
- package/es/components/modal/DetailModal.vue2.mjs +4 -0
- package/es/components/modal/index.mjs +17 -0
- package/es/components/table/TableMain.vue.mjs +7 -0
- package/es/components/table/TableMain.vue2.mjs +204 -0
- package/es/components/table/index.mjs +14 -0
- package/es/config/list-model.mjs +13 -0
- package/es/config/route.mjs +4 -0
- package/es/helpers/form.mjs +32 -0
- package/es/helpers/route.mjs +60 -0
- package/es/helpers/state.mjs +46 -0
- package/es/helpers/storage.mjs +16 -0
- package/es/hooks/activated.mjs +42 -0
- package/es/hooks/feel-size.mjs +30 -0
- package/es/hooks/menus-dispatch.mjs +47 -0
- package/es/index.mjs +97 -0
- package/es/inject/key.mjs +6 -0
- package/es/style.css +1 -0
- package/es/utils/id.mjs +5 -0
- package/es/utils/router.mjs +18 -0
- package/es/utils/time.mjs +18 -0
- package/package.json +81 -0
- package/types/components/display/WatchSize.vue.d.ts +44 -0
- package/types/components/display/index.d.ts +5 -0
- package/types/components/form/FormItem.vue.d.ts +50 -0
- package/types/components/form/FormMain.vue.d.ts +51 -0
- package/types/components/form/FormRadioGroup.vue.d.ts +23 -0
- package/types/components/form/FormSearch.vue.d.ts +23 -0
- package/types/components/form/FormSelect.vue.d.ts +60 -0
- package/types/components/form/FormTree.vue.d.ts +42 -0
- package/types/components/form/FormVerifyCode.vue.d.ts +32 -0
- package/types/components/form/FormVerifyImage.vue.d.ts +22 -0
- package/types/components/form/index.d.ts +13 -0
- package/types/components/form/types.d.ts +223 -0
- package/types/components/form/utils.d.ts +49 -0
- package/types/components/list-page/ListPage.vue.d.ts +44 -0
- package/types/components/list-page/index.d.ts +6 -0
- package/types/components/list-page/types.d.ts +44 -0
- package/types/components/menu/MenuItemSub.vue.d.ts +19 -0
- package/types/components/menu/MenuTree.vue.d.ts +28 -0
- package/types/components/menu/index.d.ts +6 -0
- package/types/components/misc/TriggerAutoImport.vue.d.ts +11 -0
- package/types/components/misc/index.d.ts +5 -0
- package/types/components/modal/ConfirmModal.vue.d.ts +107 -0
- package/types/components/modal/DetailModal.vue.d.ts +23 -0
- package/types/components/modal/index.d.ts +7 -0
- package/types/components/modal/types.d.ts +33 -0
- package/types/components/table/TableMain.vue.d.ts +35 -0
- package/types/components/table/index.d.ts +6 -0
- package/types/components/table/types.d.ts +90 -0
- package/types/config/index.d.ts +2 -0
- package/types/config/list-model.d.ts +48 -0
- package/types/config/route.d.ts +2 -0
- package/types/helpers/form.d.ts +11 -0
- package/types/helpers/index.d.ts +4 -0
- package/types/helpers/route.d.ts +37 -0
- package/types/helpers/state.d.ts +26 -0
- package/types/helpers/storage.d.ts +10 -0
- package/types/hooks/activated.d.ts +8 -0
- package/types/hooks/feel-size.d.ts +10 -0
- package/types/hooks/index.d.ts +3 -0
- package/types/hooks/menus-dispatch.d.ts +33 -0
- package/types/index.d.ts +24 -0
- package/types/inject/index.d.ts +1 -0
- package/types/inject/key.d.ts +11 -0
- package/types/types/dot-path.d.ts +13 -0
- package/types/types/index.d.ts +3 -0
- package/types/types/route.d.ts +92 -0
- package/types/types/utility-types.d.ts +8 -0
- package/types/utils/id.d.ts +2 -0
- package/types/utils/index.d.ts +3 -0
- package/types/utils/router.d.ts +8 -0
- package/types/utils/time.d.ts +2 -0
|
@@ -0,0 +1,223 @@
|
|
|
1
|
+
import { FormItemRule, ColProps, FormItemProps } from 'element-plus';
|
|
2
|
+
import { VNode } from 'vue';
|
|
3
|
+
|
|
4
|
+
export type OnlyOneKey<T extends Record<string, any>> = {
|
|
5
|
+
[K in keyof T]: {
|
|
6
|
+
[P in K]?: T[P];
|
|
7
|
+
} & Partial<Record<Exclude<keyof T, K>, never>>;
|
|
8
|
+
}[keyof T];
|
|
9
|
+
/** 额外扩展表单配置项 */
|
|
10
|
+
export type FormItemConfigExtra = OnlyOneKey<{
|
|
11
|
+
/** 是输入类型 */
|
|
12
|
+
isInput: boolean;
|
|
13
|
+
/** 是选择类型 */
|
|
14
|
+
isSelect: boolean;
|
|
15
|
+
}> & {
|
|
16
|
+
/** 回车提交 */
|
|
17
|
+
enterSubmit?: boolean;
|
|
18
|
+
/** 失去焦点提交[isInput默认为true] */
|
|
19
|
+
blurSubmit?: boolean;
|
|
20
|
+
/** 变化提交 [isSelect默认为true] */
|
|
21
|
+
changeSubmit?: boolean;
|
|
22
|
+
};
|
|
23
|
+
interface WrapProps extends FormItemProps {
|
|
24
|
+
[key: string]: any;
|
|
25
|
+
}
|
|
26
|
+
/** formItem联动配置 */
|
|
27
|
+
interface FormItemLinkConfig<K extends string, BV, OV> {
|
|
28
|
+
/** 关联(该宿主配置)表单项的key */
|
|
29
|
+
key: K;
|
|
30
|
+
/**
|
|
31
|
+
* 获取该项的值
|
|
32
|
+
* @param hostValue 宿主/依赖项的值
|
|
33
|
+
* @param ownValue 该(寄生/收集依赖)项的值
|
|
34
|
+
* @param attachInfo 附加信息,可用于表单渲染为自定义组件时触发事件triggerChangeLink, 此场景 寄生项的值内部会去拿
|
|
35
|
+
* @example emit('triggerChangeLink', hostValue, attachInfo)
|
|
36
|
+
*/
|
|
37
|
+
getValue: (hostValue: BV, ownValue: OV, attachInfo?: any) => void;
|
|
38
|
+
}
|
|
39
|
+
/** formItem配置 */
|
|
40
|
+
export interface FormItemConfig<PO extends Record<string, any> = Record<string, any>,
|
|
41
|
+
/** 需要格式化的模型 */
|
|
42
|
+
SO extends Record<string, any> = Record<string, any>,
|
|
43
|
+
/** 解析的模型的key */
|
|
44
|
+
PK extends Extract<keyof PO, string> = Extract<keyof PO, string>,
|
|
45
|
+
/** 解析的模型的值 */
|
|
46
|
+
PV extends PO[PK] = PO[PK],
|
|
47
|
+
/** 需要格式化的模型的值 */
|
|
48
|
+
SV extends PK extends keyof SO ? SO[PK] : PV = PK extends keyof SO ? SO[PK] : PV> {
|
|
49
|
+
/** 表单项key __大写视为忽略 等价于 ignore = true */
|
|
50
|
+
key: PK;
|
|
51
|
+
/** 表单项label */
|
|
52
|
+
label: string;
|
|
53
|
+
/** 提示信息 */
|
|
54
|
+
tip?: string | (() => VNode);
|
|
55
|
+
/** 表单布局 优先级高于FormMain同名属性 */
|
|
56
|
+
layout?: Partial<ColProps>;
|
|
57
|
+
/** 表单外FormItem属性 */
|
|
58
|
+
wrapProps?: Partial<WrapProps> | ((scope: FormScope<PO, SO, PK, PV, SV>) => Partial<WrapProps>);
|
|
59
|
+
/** 表单主体属性 */
|
|
60
|
+
props?: Record<string, any> | ((scope: FormScope<PO, SO, PK, PV, SV>) => Record<string, any>);
|
|
61
|
+
/** 表单渲染函数/渲染标签/组件 */
|
|
62
|
+
render?: string | Record<string, any> | ((props: {
|
|
63
|
+
modelValue: PV;
|
|
64
|
+
["onUpdate:modelValue"]: (value: PV) => void;
|
|
65
|
+
placeholder?: string;
|
|
66
|
+
["onTriggerChangeLink"]?: (value: SV, attachInfo?: any) => void;
|
|
67
|
+
} & Record<string, any>) => VNode);
|
|
68
|
+
/** 表单校验规则 */
|
|
69
|
+
rules?: FormItemRule[] | ((scope: FormScope<PO, SO, PK, PV, SV>) => FormItemRule[]);
|
|
70
|
+
/** 表单初始值 */
|
|
71
|
+
init?: (() => PV) | PV;
|
|
72
|
+
/** 表单回显解析处理 */
|
|
73
|
+
parse?: (value: any, parseData: Partial<PO>, originData: ExtractFormStringifyFromObject<PO, SO>) => PV | undefined;
|
|
74
|
+
/** 表单序列化处理 */
|
|
75
|
+
stringify?: (value: any, stringifyData: Partial<ExtractFormStringifyFromObject<PO, SO>>, originData: PO) => SV | undefined;
|
|
76
|
+
/**
|
|
77
|
+
* 是否在初始化数据、解析数据、序列化数据时忽略处理
|
|
78
|
+
*/
|
|
79
|
+
ignore?: boolean;
|
|
80
|
+
/**
|
|
81
|
+
* 是否在表单中隐藏
|
|
82
|
+
*/
|
|
83
|
+
hide?: boolean | ((scope: FormScope<PO, SO, PK, PV, SV> & {
|
|
84
|
+
getInitValue: () => PV;
|
|
85
|
+
}) => boolean);
|
|
86
|
+
/**
|
|
87
|
+
* 被关联配置
|
|
88
|
+
* 1. 不要配置当前表单项的key
|
|
89
|
+
* 2. 最好不要循环关联
|
|
90
|
+
* 3. 必须循环关联时,避免循环引用
|
|
91
|
+
*/
|
|
92
|
+
beLink?: FormItemLinkConfig<PK, PV, any> | FormItemLinkConfig<PK, PV, any>[];
|
|
93
|
+
/**
|
|
94
|
+
* 额外一些配置
|
|
95
|
+
*/
|
|
96
|
+
extra?: FormItemConfigExtra;
|
|
97
|
+
}
|
|
98
|
+
/** form配置 */
|
|
99
|
+
export type FormItemConfigList<PO extends Record<string, any> = Record<string, any>, SO extends Record<string, any> = Record<string, any>> = FormItemConfig<PO, SO>[];
|
|
100
|
+
/** 表单数据 */ export type FormModel<L> = L extends FormItemConfigList<infer PO, any> ? PO : Record<string, any>;
|
|
101
|
+
/** 提取格式化原始对象 */
|
|
102
|
+
export type ExtractFormStringifyRawFromObject<PO extends Record<string, any>, SO extends Record<string, any>> = {
|
|
103
|
+
[K in keyof PO | keyof SO]: K extends keyof SO ? SO[K] extends never ? never : SO[K] extends undefined ? K extends keyof PO ? PO[K] : never : SO[K] : K extends keyof PO ? PO[K] : never;
|
|
104
|
+
};
|
|
105
|
+
/** 表单序列化数据原始 */
|
|
106
|
+
export type ExtractFormStringifyRawFromList<L> = L extends FormItemConfigList<infer PO, infer SO> ? PO extends Record<string, any> ? SO extends Record<string, any> ? ExtractFormStringifyFromObject<PO, SO> : Record<string, any> : Record<string, any> : Record<string, any>;
|
|
107
|
+
/** 提取除never以外的属性值 */
|
|
108
|
+
export type ExcludeNeverProperties<T> = {
|
|
109
|
+
[K in keyof T as T[K] extends never ? never : K]: T[K];
|
|
110
|
+
};
|
|
111
|
+
export type ExtractFormStringifyFromObject<PO extends Record<string, any>, SO extends Record<string, any>> = ExcludeNeverProperties<ExtractFormStringifyRawFromObject<PO, SO>>;
|
|
112
|
+
/** 表单序列化数据 */
|
|
113
|
+
export type ExtractFormStringifyFromList<L> = ExcludeNeverProperties<ExtractFormStringifyRawFromList<L>>;
|
|
114
|
+
/** form作用域数据 */
|
|
115
|
+
export interface FormScope<
|
|
116
|
+
/** 解析的模型 */
|
|
117
|
+
PO extends Record<string, any>,
|
|
118
|
+
/** 需要格式化的模型 */
|
|
119
|
+
SO extends Record<string, any>,
|
|
120
|
+
/** 解析的模型的key */
|
|
121
|
+
PK extends Extract<keyof PO, string>,
|
|
122
|
+
/** 解析的模型的值 */
|
|
123
|
+
PV extends PO[PK],
|
|
124
|
+
/** 需要格式化的模型的值 */
|
|
125
|
+
SV extends PK extends keyof SO ? SO[PK] : PV> {
|
|
126
|
+
data: PO;
|
|
127
|
+
config: FormItemConfig<PO, SO, PK, PV, SV>;
|
|
128
|
+
}
|
|
129
|
+
/** FormMain expose类型 */
|
|
130
|
+
export interface FormMainInstance {
|
|
131
|
+
validate: () => Promise<void>;
|
|
132
|
+
resetFields: () => void;
|
|
133
|
+
clearValidate: (key?: string) => void;
|
|
134
|
+
}
|
|
135
|
+
/** FormSearch expose类型 */
|
|
136
|
+
export interface FormSearchInstance extends FormMainInstance {
|
|
137
|
+
/** 触发搜索 */
|
|
138
|
+
triggerSearch: () => void;
|
|
139
|
+
/** 触发重置 */
|
|
140
|
+
triggerReset: () => void;
|
|
141
|
+
}
|
|
142
|
+
/** FormItem props */
|
|
143
|
+
export interface FormMainItemProps {
|
|
144
|
+
config: FormItemConfig<Record<string, any>, Record<string, any>>;
|
|
145
|
+
data: Record<string, any>;
|
|
146
|
+
}
|
|
147
|
+
/** FormMain props */
|
|
148
|
+
export interface FormMainProps<PO extends Record<string, any>, SO extends Record<string, any>> {
|
|
149
|
+
list: FormItemConfigList<PO, SO>;
|
|
150
|
+
data: PO;
|
|
151
|
+
layout?: Partial<ColProps>;
|
|
152
|
+
}
|
|
153
|
+
/** FormSearch props */
|
|
154
|
+
export interface FormSearchProps<PO extends Record<string, any>, SO extends Record<string, any>, SQ extends Record<string, any>> extends FormMainProps<PO, SO> {
|
|
155
|
+
labelPosition?: "right" | "left" | "top";
|
|
156
|
+
labelWidth?: string;
|
|
157
|
+
/** 静态参数(非表单 非分页参数) */
|
|
158
|
+
staticQuery?: SQ;
|
|
159
|
+
}
|
|
160
|
+
/** form item loading 信息 */
|
|
161
|
+
export interface FormItemLoadingInfo {
|
|
162
|
+
key: string;
|
|
163
|
+
label: string;
|
|
164
|
+
message: string;
|
|
165
|
+
}
|
|
166
|
+
/** form item 加载状态信息 */
|
|
167
|
+
export type FormItemLoadingChangeFunc = (data: {
|
|
168
|
+
key: string;
|
|
169
|
+
message?: string;
|
|
170
|
+
}) => void;
|
|
171
|
+
/** form tree 单项类型 */
|
|
172
|
+
export interface FormTreeItem {
|
|
173
|
+
id: string | number;
|
|
174
|
+
label: string;
|
|
175
|
+
children?: FormTreeItem[];
|
|
176
|
+
disabled?: boolean;
|
|
177
|
+
[key: string]: any;
|
|
178
|
+
}
|
|
179
|
+
/** form单项表单提交类型 */
|
|
180
|
+
export type FormItemSubmitType = "blur" | "change" | "enter";
|
|
181
|
+
/** 表单搜索搜索类型 */
|
|
182
|
+
export type FormSearchSearchType = "search" | "reset" | FormItemSubmitType;
|
|
183
|
+
export type FormItemConfigSwiftOptionsCommon<PO extends Record<string, any>,
|
|
184
|
+
/** 需要格式化的模型 */
|
|
185
|
+
SO extends Record<string, any>> = Omit<FormItemConfig<PO, SO>, "rules"> & {
|
|
186
|
+
/** label */
|
|
187
|
+
/**
|
|
188
|
+
* 表单类型
|
|
189
|
+
* ----
|
|
190
|
+
* input: 会补齐 extra.isInput = true 最终表现在组件会默认设置placeholder `请输入${label}`,同时如果设置了required 会自动添加一条校验规则 提示信息同 placeholder;
|
|
191
|
+
*
|
|
192
|
+
* select: 会补齐 extra.isSelect = true 最终表现在组件会默认设置placeholder `请选择${label}`,同时如果设置了required 会自动添加一条校验规则 提示信息同 placeholder;
|
|
193
|
+
* 如果不设置此项 不会补齐 extra
|
|
194
|
+
*/
|
|
195
|
+
type?: "input" | "select";
|
|
196
|
+
};
|
|
197
|
+
/** 表单配置项快捷生成类型 - 设置required */
|
|
198
|
+
export interface FormItemConfigSwiftOptionsRequired<PO extends Record<string, any>,
|
|
199
|
+
/** 需要格式化的模型 */
|
|
200
|
+
SO extends Record<string, any>> extends FormItemConfigSwiftOptionsCommon<PO, SO> {
|
|
201
|
+
/**
|
|
202
|
+
* 是否必填
|
|
203
|
+
* -----
|
|
204
|
+
* 设置了此项 不能设置 rules, 如果校验规则只是验证必填 使用此选项更方便
|
|
205
|
+
*/
|
|
206
|
+
required?: true;
|
|
207
|
+
}
|
|
208
|
+
/** 表单配置项快捷生成类型 - 设置rules */
|
|
209
|
+
export interface FormItemConfigSwiftOptionsRules<PO extends Record<string, any>,
|
|
210
|
+
/** 需要格式化的模型 */
|
|
211
|
+
SO extends Record<string, any>> extends FormItemConfigSwiftOptionsCommon<PO, SO> {
|
|
212
|
+
/**
|
|
213
|
+
* 校验规则
|
|
214
|
+
* ---
|
|
215
|
+
* 设置了此项 不能直接设置 required, 如果校验规则特殊 或者 要基于数据值动态校验 请使用 rules
|
|
216
|
+
*/
|
|
217
|
+
rules?: FormItemConfig["rules"];
|
|
218
|
+
}
|
|
219
|
+
/** 表单配置项快捷生成类型 */
|
|
220
|
+
export type FormItemConfigSwiftOptions<PO extends Record<string, any>,
|
|
221
|
+
/** 需要格式化的模型 */
|
|
222
|
+
SO extends Record<string, any>> = FormItemConfigSwiftOptionsRequired<PO, SO> | FormItemConfigSwiftOptionsRules<PO, SO>;
|
|
223
|
+
export {};
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
import { FormItemConfig, FormItemConfigList, ExtractFormStringifyFromObject, FormItemConfigSwiftOptions } from './types';
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* 生成表单数据
|
|
5
|
+
*/
|
|
6
|
+
export declare const generateFormData: <PO extends Record<string, any>, SO extends Record<string, any>>(list: FormItemConfigList<PO, SO>) => PO;
|
|
7
|
+
/**
|
|
8
|
+
* 解析表单数据
|
|
9
|
+
*/
|
|
10
|
+
export declare const parseFormData: <PO extends Record<string, any>, SO extends Record<string, any>>(data: ExtractFormStringifyFromObject<PO, SO>, list: FormItemConfigList<PO, SO>) => PO;
|
|
11
|
+
/**
|
|
12
|
+
* 序列化表单数据
|
|
13
|
+
*/
|
|
14
|
+
export declare const stringifyFormData: <PO extends Record<string, any>, SO extends Record<string, any>>(data: PO, list: FormItemConfigList<PO, SO>) => import('./types').ExcludeNeverProperties<import('./types').ExtractFormStringifyRawFromObject<PO, SO>>;
|
|
15
|
+
/**
|
|
16
|
+
* 获取v-model语法糖配置
|
|
17
|
+
*/
|
|
18
|
+
export declare const getVModelSugar: <PO extends Record<string, any>, SO extends Record<string, any>, PK extends Extract<keyof PO, string>, MK extends string>({ modelValueKey, config, data, updateData, }: {
|
|
19
|
+
modelValueKey?: MK;
|
|
20
|
+
config: FormItemConfig<PO, SO>;
|
|
21
|
+
data: PO;
|
|
22
|
+
updateData?: (val: PO[PK]) => void;
|
|
23
|
+
}) => { [P in MK]: PO[PK]; } & { [E in string as `onUpdate:${MK}`]: (val: PO[PK]) => void; };
|
|
24
|
+
/** 获取placeholder */
|
|
25
|
+
export declare const getPlaceholder: <PO extends Record<string, any>, SO extends Record<string, any>>(config: FormItemConfig<PO, SO>) => {
|
|
26
|
+
placeholder?: string;
|
|
27
|
+
};
|
|
28
|
+
/** 获取回车提交 */
|
|
29
|
+
export declare const getEnterSubmit: <PO extends Record<string, any>, SO extends Record<string, any>>(config: FormItemConfig<PO, SO>, handler: () => void) => {
|
|
30
|
+
onKeyup: (e: KeyboardEvent) => void;
|
|
31
|
+
} | undefined;
|
|
32
|
+
/** 获取失去焦点提交 */
|
|
33
|
+
export declare const getBlurSubmit: <PO extends Record<string, any>, SO extends Record<string, any>>(config: FormItemConfig<PO, SO>, handler: () => void) => {
|
|
34
|
+
onBlur: () => void;
|
|
35
|
+
} | undefined;
|
|
36
|
+
/** 获取变化提交 */
|
|
37
|
+
export declare const getChangeSubmit: <PO extends Record<string, any>, SO extends Record<string, any>>(config: FormItemConfig<PO, SO>, handler: () => void) => {
|
|
38
|
+
onChange: () => void;
|
|
39
|
+
} | undefined;
|
|
40
|
+
/** form item 更改loading状态 */
|
|
41
|
+
export declare const FORM_ITEM_CHANGE_LOADING: unique symbol;
|
|
42
|
+
/** 设置输入类型组件 */
|
|
43
|
+
export declare const setInputComponent: (components: any[]) => void;
|
|
44
|
+
/** 设置选择类型组件 */
|
|
45
|
+
export declare const setSelectComponent: (components: any[]) => void;
|
|
46
|
+
/** 快捷配置表单项 */
|
|
47
|
+
export declare const swiftFormItemConfig: <PO extends Record<string, any>,
|
|
48
|
+
/** 需要格式化的模型 */
|
|
49
|
+
SO extends Record<string, any>>(options: FormItemConfigSwiftOptions<PO, SO>) => FormItemConfig<PO, SO>;
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
import { FormItemConfigList, FormSearchSearchType } from '../form';
|
|
2
|
+
import { TableMainInstance } from '../table';
|
|
3
|
+
import { ListPageInnerInjectInfo, ListPageInstance } from './types';
|
|
4
|
+
|
|
5
|
+
declare const _default: <T extends Record<string, any>, PO extends Record<string, any>, SO extends Record<string, any>, SQ extends Record<string, any>, F extends Record<string, any>>(__VLS_props: Awaited<typeof __VLS_setup>["props"], __VLS_ctx?: __VLS_Prettify<Pick<Awaited<typeof __VLS_setup>, "attrs" | "emit" | "slots">>, __VLS_expose?: NonNullable<Awaited<typeof __VLS_setup>>["expose"], __VLS_setup?: Promise<{
|
|
6
|
+
props: __VLS_Prettify<__VLS_OmitKeepDiscriminatedUnion<(Partial<{}> & Omit<{} & import('vue').VNodeProps & import('vue').AllowedComponentProps & import('vue').ComponentCustomProps, never>) & (Partial<Pick<import('../form').FormSearchProps<PO, SO, {}>, "staticQuery">> & {
|
|
7
|
+
formSearchProps?: Partial<Omit<import('../form').FormSearchProps<PO, SO, {}>, "list" | "staticQuery">> | undefined;
|
|
8
|
+
} & Pick<import('../table').TableMainProps<T, import('../form').ExcludeNeverProperties<import('../form').ExtractFormStringifyRawFromObject<PO, SO>> & SQ, ListPageInnerInjectInfo<PO, F>>, import('./types').TableMainRequiredKey> & Partial<Pick<import('../table').TableMainProps<T, import('../form').ExcludeNeverProperties<import('../form').ExtractFormStringifyRawFromObject<PO, SO>> & SQ, ListPageInnerInjectInfo<PO, F>>, import('./types').TableMainOptionsKey>> & {
|
|
9
|
+
tableMainProps?: Partial<Omit<import('../table').TableMainProps<T, import('../form').ExcludeNeverProperties<import('../form').ExtractFormStringifyRawFromObject<PO, SO>> & SQ, ListPageInnerInjectInfo<PO, F>>, import('./types').TableMainOptionsKey | import('./types').TableMainRewriteKey>> | undefined;
|
|
10
|
+
} & {
|
|
11
|
+
showOperation?: boolean;
|
|
12
|
+
list?: FormItemConfigList<PO, SO> | undefined;
|
|
13
|
+
api: (params: import('../table').TableApiParams<import('../form').ExcludeNeverProperties<import('../form').ExtractFormStringifyRawFromObject<PO, SO>> & SQ>) => Promise<import('../table').TableApiResult<T>>;
|
|
14
|
+
query?: SQ | undefined;
|
|
15
|
+
injectInfo?: F | undefined;
|
|
16
|
+
beforeSearch?: ((data: import('../form').ExcludeNeverProperties<import('../form').ExtractFormStringifyRawFromObject<PO, SO>>, type: FormSearchSearchType) => import('../form').ExcludeNeverProperties<import('../form').ExtractFormStringifyRawFromObject<PO, SO>>) | undefined;
|
|
17
|
+
clearTableFilterOnReset?: boolean;
|
|
18
|
+
}), keyof import('vue').VNodeProps | keyof import('vue').AllowedComponentProps>> & {} & (import('vue').VNodeProps & import('vue').AllowedComponentProps & import('vue').ComponentCustomProps);
|
|
19
|
+
expose(exposed: import('vue').ShallowUnwrapRef<ListPageInstance<PO>>): void;
|
|
20
|
+
attrs: any;
|
|
21
|
+
slots: ReturnType<() => Partial<Record<`form-${Extract<keyof PO, string>}`, (_: any) => any>> & Partial<Record<NonNullable<"table-undefined" | `table-${Uppercase<string>}` | `table-${Extract<keyof T, string>}`>, (_: {
|
|
22
|
+
row: T;
|
|
23
|
+
column: import('../table').ElTableColumnProps<T, ListPageInnerInjectInfo<PO, F>>;
|
|
24
|
+
$index: number;
|
|
25
|
+
injectInfo: ListPageInnerInjectInfo<PO, F>;
|
|
26
|
+
exposeInfo: TableMainInstance;
|
|
27
|
+
}) => any>> & Partial<Record<NonNullable<"table-header-undefined" | `table-header-${Uppercase<string>}` | `table-header-${Extract<keyof T, string>}`>, (_: {
|
|
28
|
+
searchFormData: PO;
|
|
29
|
+
triggerSearch: (() => void) | undefined;
|
|
30
|
+
column: import('../table').ElTableColumnProps<T, ListPageInnerInjectInfo<PO, F>>;
|
|
31
|
+
$index: number;
|
|
32
|
+
injectInfo: ListPageInnerInjectInfo<PO, F>;
|
|
33
|
+
exposeInfo: TableMainInstance;
|
|
34
|
+
}) => any>> & {
|
|
35
|
+
operation?(_: {}): any;
|
|
36
|
+
}>;
|
|
37
|
+
emit: typeof __VLS_emit;
|
|
38
|
+
}>) => import('vue').VNode & {
|
|
39
|
+
__ctx?: Awaited<typeof __VLS_setup>;
|
|
40
|
+
};
|
|
41
|
+
export default _default;
|
|
42
|
+
type __VLS_Prettify<T> = {
|
|
43
|
+
[K in keyof T]: T[K];
|
|
44
|
+
} & {};
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
import { ExtractFormStringifyFromObject, ExtractFormStringifyFromList, FormItemConfigList, FormSearchInstance, FormSearchProps, FormSearchSearchType } from '../form';
|
|
2
|
+
import { TableApiParams, TableApiResult, TableMainInstance, TableMainProps } from '../table';
|
|
3
|
+
|
|
4
|
+
export type FormSearchOptionsKey = "staticQuery";
|
|
5
|
+
export type FormSearchRewriteKey = "list";
|
|
6
|
+
export type TableMainOptionsKey = "refine" | "refineReduceHeight";
|
|
7
|
+
export type TableMainRequiredKey = "columns" | "rowKey";
|
|
8
|
+
export type TableMainRewriteKey = "api" | "query" | "injectInfo";
|
|
9
|
+
export type ListPageInnerInjectInfo<PO extends Record<string, any>,
|
|
10
|
+
/** 期望注入到表格列插槽上的额外内容 */
|
|
11
|
+
F extends Record<string, any>> = Pick<ListPageInstance<PO>, "triggerReset" | "triggerSearch" | "update"> & F;
|
|
12
|
+
export type ListPageProps<
|
|
13
|
+
/** 行数据结构 */
|
|
14
|
+
T extends Record<string, any>,
|
|
15
|
+
/** 表单标准结构模型 */
|
|
16
|
+
PO extends Record<string, any>,
|
|
17
|
+
/** 表单需转换的部分结构模型 */
|
|
18
|
+
SO extends Record<string, any>,
|
|
19
|
+
/** 静态参数 */
|
|
20
|
+
SQ extends Record<string, any>,
|
|
21
|
+
/** 期望注入到表格列插槽上的额外内容 */
|
|
22
|
+
F extends Record<string, any>> = Partial<Pick<FormSearchProps<PO, SO, {}>, FormSearchOptionsKey>> & {
|
|
23
|
+
formSearchProps?: Partial<Omit<FormSearchProps<PO, SO, {}>, FormSearchOptionsKey | FormSearchRewriteKey>>;
|
|
24
|
+
} & Pick<TableMainProps<T, ExtractFormStringifyFromObject<PO, SO> & SQ, ListPageInnerInjectInfo<PO, F>>, TableMainRequiredKey> & Partial<Pick<TableMainProps<T, ExtractFormStringifyFromObject<PO, SO> & SQ, ListPageInnerInjectInfo<PO, F>>, TableMainOptionsKey>> & {
|
|
25
|
+
tableMainProps?: Partial<Omit<TableMainProps<T, ExtractFormStringifyFromObject<PO, SO> & SQ, ListPageInnerInjectInfo<PO, F>>, TableMainOptionsKey | TableMainOptionsKey | TableMainRewriteKey>>;
|
|
26
|
+
} & {
|
|
27
|
+
/** 是否展示操作区 */
|
|
28
|
+
showOperation?: boolean;
|
|
29
|
+
list?: FormItemConfigList<PO, SO>;
|
|
30
|
+
/** api */
|
|
31
|
+
api: (params: TableApiParams<ExtractFormStringifyFromObject<PO, SO> & SQ>) => Promise<TableApiResult<T>>;
|
|
32
|
+
/** 静态参数 */
|
|
33
|
+
query?: SQ;
|
|
34
|
+
injectInfo?: F;
|
|
35
|
+
/** 搜索前的回调[同步] */
|
|
36
|
+
beforeSearch?: (data: ExtractFormStringifyFromObject<PO, SO>, type: FormSearchSearchType) => ExtractFormStringifyFromObject<PO, SO>;
|
|
37
|
+
/** 在点击搜索重置按钮时,是否同时调用清空表格表头过滤 */
|
|
38
|
+
clearTableFilterOnReset?: boolean;
|
|
39
|
+
};
|
|
40
|
+
export interface ListPageInstance<PO extends Record<string, any> = Record<string, any>> extends FormSearchInstance, TableMainInstance {
|
|
41
|
+
/** 更新表单数据 */
|
|
42
|
+
update: (key: Extract<keyof PO, string>, value: any) => void;
|
|
43
|
+
}
|
|
44
|
+
export type ListApiParams<L, SQ extends Record<string, any>> = TableApiParams<ExtractFormStringifyFromList<L> & SQ>;
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { RouteMetaResolveRaw } from '../../types';
|
|
2
|
+
|
|
3
|
+
declare const _default: import('vue').DefineComponent<globalThis.ExtractPropTypes<__VLS_TypePropsToRuntimeProps<{
|
|
4
|
+
menu: RouteMetaResolveRaw;
|
|
5
|
+
MenuItemSub: any;
|
|
6
|
+
}>>, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, string, import('vue').PublicProps, Readonly<globalThis.ExtractPropTypes<__VLS_TypePropsToRuntimeProps<{
|
|
7
|
+
menu: RouteMetaResolveRaw;
|
|
8
|
+
MenuItemSub: any;
|
|
9
|
+
}>>> & Readonly<{}>, {}, {}, {}, {}, string, import('vue').ComponentProvideOptions, true, {}, any>;
|
|
10
|
+
export default _default;
|
|
11
|
+
type __VLS_NonUndefinedable<T> = T extends undefined ? never : T;
|
|
12
|
+
type __VLS_TypePropsToRuntimeProps<T> = {
|
|
13
|
+
[K in keyof T]-?: {} extends Pick<T, K> ? {
|
|
14
|
+
type: import('vue').PropType<__VLS_NonUndefinedable<T[K]>>;
|
|
15
|
+
} : {
|
|
16
|
+
type: import('vue').PropType<T[K]>;
|
|
17
|
+
required: true;
|
|
18
|
+
};
|
|
19
|
+
};
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import { RouteMetaResolveRaw } from '../../types';
|
|
2
|
+
|
|
3
|
+
declare const _default: import('vue').DefineComponent<globalThis.ExtractPropTypes<__VLS_TypePropsToRuntimeProps<{
|
|
4
|
+
menus: RouteMetaResolveRaw[];
|
|
5
|
+
menuFlatList: RouteMetaResolveRaw[];
|
|
6
|
+
routerMode?: boolean;
|
|
7
|
+
collapse?: boolean;
|
|
8
|
+
autoClose?: boolean;
|
|
9
|
+
}>>, {
|
|
10
|
+
open: (index: string) => void | undefined;
|
|
11
|
+
close: (index: string) => void | undefined;
|
|
12
|
+
}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, string, import('vue').PublicProps, Readonly<globalThis.ExtractPropTypes<__VLS_TypePropsToRuntimeProps<{
|
|
13
|
+
menus: RouteMetaResolveRaw[];
|
|
14
|
+
menuFlatList: RouteMetaResolveRaw[];
|
|
15
|
+
routerMode?: boolean;
|
|
16
|
+
collapse?: boolean;
|
|
17
|
+
autoClose?: boolean;
|
|
18
|
+
}>>> & Readonly<{}>, {}, {}, {}, {}, string, import('vue').ComponentProvideOptions, true, {}, any>;
|
|
19
|
+
export default _default;
|
|
20
|
+
type __VLS_NonUndefinedable<T> = T extends undefined ? never : T;
|
|
21
|
+
type __VLS_TypePropsToRuntimeProps<T> = {
|
|
22
|
+
[K in keyof T]-?: {} extends Pick<T, K> ? {
|
|
23
|
+
type: import('vue').PropType<__VLS_NonUndefinedable<T[K]>>;
|
|
24
|
+
} : {
|
|
25
|
+
type: import('vue').PropType<T[K]>;
|
|
26
|
+
required: true;
|
|
27
|
+
};
|
|
28
|
+
};
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
declare function __VLS_template(): {
|
|
2
|
+
default?(_: {}): any;
|
|
3
|
+
};
|
|
4
|
+
declare const __VLS_component: import('vue').DefineComponent<{}, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, string, import('vue').PublicProps, Readonly<{}> & Readonly<{}>, {}, {}, {}, {}, string, import('vue').ComponentProvideOptions, true, {}, any>;
|
|
5
|
+
declare const _default: __VLS_WithTemplateSlots<typeof __VLS_component, ReturnType<typeof __VLS_template>>;
|
|
6
|
+
export default _default;
|
|
7
|
+
type __VLS_WithTemplateSlots<T, S> = T & {
|
|
8
|
+
new (): {
|
|
9
|
+
$slots: S;
|
|
10
|
+
};
|
|
11
|
+
};
|
|
@@ -0,0 +1,107 @@
|
|
|
1
|
+
declare function __VLS_template(): {
|
|
2
|
+
title?(_: {}): any;
|
|
3
|
+
default?(_: {}): any;
|
|
4
|
+
footer?(_: {
|
|
5
|
+
cancelHandler: () => Promise<void>;
|
|
6
|
+
confirmHandler: () => Promise<void>;
|
|
7
|
+
loading: boolean;
|
|
8
|
+
}): any;
|
|
9
|
+
};
|
|
10
|
+
declare const __VLS_component: import('vue').DefineComponent<globalThis.ExtractPropTypes<__VLS_WithDefaults<__VLS_TypePropsToRuntimeProps<{
|
|
11
|
+
show: boolean;
|
|
12
|
+
showClose?: boolean;
|
|
13
|
+
onClose?: (status?: boolean) => void;
|
|
14
|
+
onCancel?: () => void | Promise<boolean | void>;
|
|
15
|
+
onConfirm?: () => void | Promise<boolean | void>;
|
|
16
|
+
title?: string | (() => VNode);
|
|
17
|
+
content?: string | (() => VNode);
|
|
18
|
+
cancelText?: string | (() => VNode);
|
|
19
|
+
confirmText?: string | (() => VNode);
|
|
20
|
+
/** 是否隐藏取消按钮 */
|
|
21
|
+
hiddenCancel?: boolean;
|
|
22
|
+
width?: number | string;
|
|
23
|
+
/** 反转按钮位置 */
|
|
24
|
+
reverse?: boolean;
|
|
25
|
+
/** 按下 ESC 是否关闭 */
|
|
26
|
+
closeOnPressEscape?: boolean;
|
|
27
|
+
/** 点击遮罩是否关闭 */
|
|
28
|
+
closeOnClickModal?: boolean;
|
|
29
|
+
/** 是否使用确认按钮loading */
|
|
30
|
+
useLoading?: boolean;
|
|
31
|
+
}>, {
|
|
32
|
+
showClose: boolean;
|
|
33
|
+
cancelText: string;
|
|
34
|
+
confirmText: string;
|
|
35
|
+
hiddenCancel: boolean;
|
|
36
|
+
width: number;
|
|
37
|
+
reverse: boolean;
|
|
38
|
+
closeOnPressEscape: boolean;
|
|
39
|
+
closeOnClickModal: boolean;
|
|
40
|
+
}>>, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {
|
|
41
|
+
"update:show": (value: boolean) => void;
|
|
42
|
+
}, string, import('vue').PublicProps, Readonly<globalThis.ExtractPropTypes<__VLS_WithDefaults<__VLS_TypePropsToRuntimeProps<{
|
|
43
|
+
show: boolean;
|
|
44
|
+
showClose?: boolean;
|
|
45
|
+
onClose?: (status?: boolean) => void;
|
|
46
|
+
onCancel?: () => void | Promise<boolean | void>;
|
|
47
|
+
onConfirm?: () => void | Promise<boolean | void>;
|
|
48
|
+
title?: string | (() => VNode);
|
|
49
|
+
content?: string | (() => VNode);
|
|
50
|
+
cancelText?: string | (() => VNode);
|
|
51
|
+
confirmText?: string | (() => VNode);
|
|
52
|
+
/** 是否隐藏取消按钮 */
|
|
53
|
+
hiddenCancel?: boolean;
|
|
54
|
+
width?: number | string;
|
|
55
|
+
/** 反转按钮位置 */
|
|
56
|
+
reverse?: boolean;
|
|
57
|
+
/** 按下 ESC 是否关闭 */
|
|
58
|
+
closeOnPressEscape?: boolean;
|
|
59
|
+
/** 点击遮罩是否关闭 */
|
|
60
|
+
closeOnClickModal?: boolean;
|
|
61
|
+
/** 是否使用确认按钮loading */
|
|
62
|
+
useLoading?: boolean;
|
|
63
|
+
}>, {
|
|
64
|
+
showClose: boolean;
|
|
65
|
+
cancelText: string;
|
|
66
|
+
confirmText: string;
|
|
67
|
+
hiddenCancel: boolean;
|
|
68
|
+
width: number;
|
|
69
|
+
reverse: boolean;
|
|
70
|
+
closeOnPressEscape: boolean;
|
|
71
|
+
closeOnClickModal: boolean;
|
|
72
|
+
}>>> & Readonly<{
|
|
73
|
+
"onUpdate:show"?: ((value: boolean) => any) | undefined;
|
|
74
|
+
}>, {
|
|
75
|
+
width: number | string;
|
|
76
|
+
reverse: boolean;
|
|
77
|
+
showClose: boolean;
|
|
78
|
+
cancelText: string | (() => VNode);
|
|
79
|
+
confirmText: string | (() => VNode);
|
|
80
|
+
hiddenCancel: boolean;
|
|
81
|
+
closeOnPressEscape: boolean;
|
|
82
|
+
closeOnClickModal: boolean;
|
|
83
|
+
}, {}, {}, {}, string, import('vue').ComponentProvideOptions, true, {}, any>;
|
|
84
|
+
declare const _default: __VLS_WithTemplateSlots<typeof __VLS_component, ReturnType<typeof __VLS_template>>;
|
|
85
|
+
export default _default;
|
|
86
|
+
type __VLS_NonUndefinedable<T> = T extends undefined ? never : T;
|
|
87
|
+
type __VLS_TypePropsToRuntimeProps<T> = {
|
|
88
|
+
[K in keyof T]-?: {} extends Pick<T, K> ? {
|
|
89
|
+
type: import('vue').PropType<__VLS_NonUndefinedable<T[K]>>;
|
|
90
|
+
} : {
|
|
91
|
+
type: import('vue').PropType<T[K]>;
|
|
92
|
+
required: true;
|
|
93
|
+
};
|
|
94
|
+
};
|
|
95
|
+
type __VLS_WithDefaults<P, D> = {
|
|
96
|
+
[K in keyof Pick<P, keyof P>]: K extends keyof D ? __VLS_Prettify<P[K] & {
|
|
97
|
+
default: D[K];
|
|
98
|
+
}> : P[K];
|
|
99
|
+
};
|
|
100
|
+
type __VLS_Prettify<T> = {
|
|
101
|
+
[K in keyof T]: T[K];
|
|
102
|
+
} & {};
|
|
103
|
+
type __VLS_WithTemplateSlots<T, S> = T & {
|
|
104
|
+
new (): {
|
|
105
|
+
$slots: S;
|
|
106
|
+
};
|
|
107
|
+
};
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { ExtractFormStringifyFromObject } from '../form';
|
|
2
|
+
import { DetailModalProps } from './types';
|
|
3
|
+
|
|
4
|
+
declare const _default: <PO extends Record<string, any>, SO extends Record<string, any>>(__VLS_props: Awaited<typeof __VLS_setup>["props"], __VLS_ctx?: __VLS_Prettify<Pick<Awaited<typeof __VLS_setup>, "attrs" | "emit" | "slots">>, __VLS_expose?: NonNullable<Awaited<typeof __VLS_setup>>["expose"], __VLS_setup?: Promise<{
|
|
5
|
+
props: __VLS_Prettify<__VLS_OmitKeepDiscriminatedUnion<(Partial<{}> & Omit<{
|
|
6
|
+
readonly "onUpdate:show"?: ((value: boolean) => any) | undefined;
|
|
7
|
+
readonly onAfterAdd?: ((data: import('../form').ExcludeNeverProperties<import('../form').ExtractFormStringifyRawFromObject<PO, SO>>) => any) | undefined;
|
|
8
|
+
readonly onAfterEdit?: ((data: import('../form').ExcludeNeverProperties<import('../form').ExtractFormStringifyRawFromObject<PO, SO>>) => any) | undefined;
|
|
9
|
+
} & import('vue').VNodeProps & import('vue').AllowedComponentProps & import('vue').ComponentCustomProps, never>) & DetailModalProps<PO, SO>, keyof import('vue').VNodeProps | keyof import('vue').AllowedComponentProps>> & {} & (import('vue').VNodeProps & import('vue').AllowedComponentProps & import('vue').ComponentCustomProps);
|
|
10
|
+
expose(exposed: import('vue').ShallowUnwrapRef<{}>): void;
|
|
11
|
+
attrs: any;
|
|
12
|
+
slots: ReturnType<() => {}>;
|
|
13
|
+
emit: {
|
|
14
|
+
(e: "update:show", value: boolean): void;
|
|
15
|
+
(e: "afterAdd" | "afterEdit", data: ExtractFormStringifyFromObject<PO, SO>): void;
|
|
16
|
+
};
|
|
17
|
+
}>) => import('vue').VNode & {
|
|
18
|
+
__ctx?: Awaited<typeof __VLS_setup>;
|
|
19
|
+
};
|
|
20
|
+
export default _default;
|
|
21
|
+
type __VLS_Prettify<T> = {
|
|
22
|
+
[K in keyof T]: T[K];
|
|
23
|
+
} & {};
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { Plugin } from 'vue';
|
|
2
|
+
import { default as ConfirmModal } from './ConfirmModal.vue';
|
|
3
|
+
import { default as DetailModal } from './DetailModal.vue';
|
|
4
|
+
|
|
5
|
+
export * from './types';
|
|
6
|
+
export { ConfirmModal, DetailModal };
|
|
7
|
+
export declare const modalInstall: Plugin;
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import { ExtractFormStringifyFromObject, FormItemConfigList, FormMainProps } from '../form';
|
|
2
|
+
import { FormProps } from 'element-plus';
|
|
3
|
+
|
|
4
|
+
/** 详情页类型 */
|
|
5
|
+
export type DetailType = "add" | "edit" | "read";
|
|
6
|
+
export interface DetailModalProps<
|
|
7
|
+
/** 表单标准结构模型 */
|
|
8
|
+
PO extends Record<string, any>,
|
|
9
|
+
/** 表单需转换的部分结构模型 */
|
|
10
|
+
SO extends Record<string, any>> {
|
|
11
|
+
/** 表单数据 */
|
|
12
|
+
data: PO;
|
|
13
|
+
/** 表单配置 */
|
|
14
|
+
list: FormItemConfigList<PO, SO>;
|
|
15
|
+
/** 表单类型 */
|
|
16
|
+
type: DetailType;
|
|
17
|
+
/**
|
|
18
|
+
* 标题
|
|
19
|
+
* 最终表现为:新增[标题]、编辑[标题]
|
|
20
|
+
*/
|
|
21
|
+
subTitle?: string;
|
|
22
|
+
show: boolean;
|
|
23
|
+
/** 新增api */
|
|
24
|
+
addApi?: (data: ExtractFormStringifyFromObject<PO, SO>) => Promise<any>;
|
|
25
|
+
/** 编辑api */
|
|
26
|
+
editApi?: (data: ExtractFormStringifyFromObject<PO, SO>) => Promise<any>;
|
|
27
|
+
/** 弹窗宽度 */
|
|
28
|
+
modalWidth?: number | string;
|
|
29
|
+
/** 表单整体布局 */
|
|
30
|
+
formLayout?: FormMainProps<PO, SO>["layout"];
|
|
31
|
+
/** elForm其他属性 */
|
|
32
|
+
formProps?: Partial<FormProps>;
|
|
33
|
+
}
|