@vue-start/pro 0.4.13 → 0.5.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/dist/index.d.ts CHANGED
@@ -1,960 +1,1454 @@
1
+ /// <reference types="lodash" />
1
2
  import * as vue from 'vue';
2
3
  import { ExtractPropTypes, PropType, VNode, App, Ref as Ref$1 } from 'vue';
4
+ import * as _vue_reactivity from '@vue/reactivity';
3
5
  import { UnwrapNestedRefs, Ref, ComputedRef } from '@vue/reactivity';
4
- import { Subject } from 'rxjs';
6
+ import * as _vue_start_store from '@vue-start/store';
7
+ import { TUpdater } from '@vue-start/store';
5
8
  import { IRequestActor } from '@vue-start/request';
9
+ import { Subject } from 'rxjs';
10
+ import * as lodash from 'lodash';
6
11
 
7
- declare const proGridProps: () => {
8
- row: {
9
- type: PropType<Record<string, any>>;
10
- default: undefined;
11
- };
12
- col: {
13
- type: PropType<Record<string, any>>;
14
- };
15
- items: {
16
- type: PropType<{
17
- vNode: VNode;
18
- rowKey?: string | number | undefined;
19
- col?: Record<string, any> | undefined;
20
- }[]>;
21
- };
22
- };
23
- declare type GridProps = Partial<ExtractPropTypes<ReturnType<typeof proGridProps>>>;
24
- declare const createGrid: (Row: any, Col: any) => any;
12
+ declare const proGridProps: () => {
13
+ row: {
14
+ type: PropType<Record<string, any>>;
15
+ default: undefined;
16
+ };
17
+ col: {
18
+ type: PropType<Record<string, any>>;
19
+ };
20
+ items: {
21
+ type: PropType<{
22
+ vNode: VNode;
23
+ rowKey?: string | number | undefined;
24
+ col?: Record<string, any> | undefined;
25
+ }[]>;
26
+ };
27
+ };
28
+ declare type ProGridProps = Partial<ExtractPropTypes<ReturnType<typeof proGridProps>>>;
29
+ declare const ProGrid: vue.DefineComponent<Partial<ExtractPropTypes<{
30
+ row: {
31
+ type: PropType<Record<string, any>>;
32
+ default: undefined;
33
+ };
34
+ col: {
35
+ type: PropType<Record<string, any>>;
36
+ };
37
+ items: {
38
+ type: PropType<{
39
+ vNode: VNode;
40
+ rowKey?: string | number | undefined;
41
+ col?: Record<string, any> | undefined;
42
+ }[]>;
43
+ };
44
+ }>>, {}, {}, {}, {}, vue.ComponentOptionsMixin, vue.ComponentOptionsMixin, vue.EmitsOptions, string, vue.VNodeProps & vue.AllowedComponentProps & vue.ComponentCustomProps, Readonly<Partial<ExtractPropTypes<{
45
+ row: {
46
+ type: PropType<Record<string, any>>;
47
+ default: undefined;
48
+ };
49
+ col: {
50
+ type: PropType<Record<string, any>>;
51
+ };
52
+ items: {
53
+ type: PropType<{
54
+ vNode: VNode;
55
+ rowKey?: string | number | undefined;
56
+ col?: Record<string, any> | undefined;
57
+ }[]>;
58
+ };
59
+ }>>>, {}>;
25
60
 
26
- declare type TDefaultValueType = "text" | "textarea" | "password" | "digit" | "date" | "dateRange" | "time" | "timeRange" | "select" | "treeSelect" | "checkbox" | "radio" | "slider" | "switch" | "rate" | "cascader";
27
- declare type TValueType = TDefaultValueType | string;
28
- declare type TOption = {
29
- label?: string;
30
- value: string | number;
31
- disabled?: boolean;
32
- };
33
- declare type TOptions = TOption[];
34
- declare type TreeOption = {
35
- label?: string;
36
- value: string | number;
37
- disabled?: boolean;
38
- children?: TreeOption[];
39
- };
40
- declare type TreeOptions = TreeOption[];
41
- declare type TColumn = {
42
- title?: string | VNode;
43
- dataIndex?: string | number;
44
- valueType?: TValueType;
45
- formValueType?: TValueType;
46
- showProps?: Record<string, any>;
47
- formItemProps?: {
48
- name?: string;
49
- label?: string;
50
- };
51
- formFieldProps?: Record<string, any>;
52
- search?: boolean;
53
- extra?: {
54
- desc?: Record<string, any>;
55
- col?: Record<string, any>;
56
- } & Record<string, any>;
57
- };
58
- declare type TColumns = TColumn[];
59
- /**
60
- * 发送事件对象
61
- */
62
- declare type TActionEvent = {
63
- type: string;
64
- payload?: any;
65
- /**
66
- * 发送事件源
67
- * 公共组件(如:Curd)只处理source为undefined的事件
68
- * 业务组件可以传入该参数覆盖之前的默认行为
69
- */
70
- source?: string;
71
- extra?: Record<string, any>;
72
- };
73
- /**
74
- * 发送state对象
75
- */
76
- declare type TActionState = {
77
- type: string;
78
- payload: any;
79
- extra?: Record<string, any>;
80
- };
81
- /**
82
- * 组件Map
83
- */
84
- declare type TElementMap = Record<string, any>;
85
- declare type BooleanObjType = {
86
- [key: string]: boolean;
87
- };
88
- declare type BooleanRulesObjType = {
89
- [key: string]: (record: any) => boolean;
90
- };
91
- /**
92
- *
93
- */
94
- interface FieldNames {
95
- value?: string;
96
- label?: string;
97
- children?: string;
61
+ declare type TDefaultValueType = "text" | "textarea" | "password" | "digit" | "date" | "dateRange" | "time" | "timeRange" | "select" | "treeSelect" | "checkbox" | "radio" | "slider" | "switch" | "rate" | "cascader";
62
+ declare type TValueType = TDefaultValueType | string;
63
+ declare type TOption = {
64
+ label?: string;
65
+ value: string | number;
66
+ disabled?: boolean;
67
+ };
68
+ declare type TOptions = TOption[];
69
+ declare type TreeOption = {
70
+ label?: string;
71
+ value: string | number;
72
+ disabled?: boolean;
73
+ children?: TreeOption[];
74
+ };
75
+ declare type TreeOptions = TreeOption[];
76
+ declare type TColumn = {
77
+ title?: string | VNode;
78
+ dataIndex?: string | number;
79
+ valueType?: TValueType;
80
+ formValueType?: TValueType;
81
+ showProps?: Record<string, any>;
82
+ formItemProps?: {
83
+ name?: string;
84
+ label?: string;
85
+ };
86
+ formFieldProps?: Record<string, any>;
87
+ search?: boolean;
88
+ extra?: {
89
+ desc?: Record<string, any>;
90
+ col?: Record<string, any>;
91
+ } & Record<string, any>;
92
+ };
93
+ declare type TColumns = TColumn[];
94
+ /**
95
+ * 发送事件对象
96
+ */
97
+ declare type TActionEvent = {
98
+ type: string;
99
+ payload?: any;
100
+ /**
101
+ * 发送事件源
102
+ * 公共组件(如:Curd)只处理source为undefined的事件
103
+ * 业务组件可以传入该参数覆盖之前的默认行为
104
+ */
105
+ source?: string;
106
+ extra?: Record<string, any>;
107
+ };
108
+ /**
109
+ * 发送state对象
110
+ */
111
+ declare type TActionState = {
112
+ type: string;
113
+ payload: any;
114
+ extra?: Record<string, any>;
115
+ };
116
+ /**
117
+ * 组件Map
118
+ */
119
+ declare type TElementMap = Record<string, any>;
120
+ declare type BooleanObjType = {
121
+ [key: string]: boolean;
122
+ };
123
+ declare type BooleanRulesObjType = {
124
+ [key: string]: (record: any) => boolean;
125
+ };
126
+ /**
127
+ *
128
+ */
129
+ interface FieldNames {
130
+ value?: string;
131
+ label?: string;
132
+ children?: string;
98
133
  }
99
134
 
100
- /***************************************** curd模式 *****************************************/
101
- /**
102
- * 获取Column的valueType,默认"text"
103
- * @param column
104
- */
105
- declare const getColumnValueType: (column: TColumn) => TValueType;
106
- /**
107
- *获取Column的FormItem name
108
- * @param column
109
- */
110
- declare const getColumnFormItemName: (column: TColumn) => string | number | undefined;
111
- /**
112
- * 根据Column生成FormItem VNode
113
- * formFieldProps中的slots参数会以v-slots的形式传递到FormItem的录入组件(子组件)中
114
- * @param formElementMap
115
- * @param column
116
- * @param needRules
117
- */
118
- declare const getFormItemEl: (formElementMap: any, column: TColumn, needRules?: boolean | undefined) => VNode | null;
119
- /**
120
- * 根据Column生成Item VNode
121
- * @param elementMap
122
- * @param column
123
- * @param value
124
- */
125
- declare const getItemEl: <T extends TColumn>(elementMap: any, column: T, value: any) => VNode | null;
126
- /***************************************** 通用模式 *****************************************/
127
- declare type InternalNamePath = (string | number)[];
128
- declare type NamePath = string | number | InternalNamePath;
129
- interface IHighConfig {
130
- registerStateList?: {
131
- name: NamePath;
132
- mapName?: NamePath;
133
- }[];
134
- registerEventList?: {
135
- name: string;
136
- sendEventName?: TActionEvent["type"];
137
- }[];
138
- registerPropsTrans?: {
139
- name: NamePath;
140
- isFun?: boolean;
141
- needParams?: boolean;
142
- }[];
143
- }
144
- /**
145
- * 组件树描述
146
- */
147
- interface IElementConfig {
148
- elementType: string;
149
- elementId: string;
150
- elementProps?: Record<string, any>;
151
- slots?: {
152
- [name: string]: ((...params$: any[]) => any) | (IElementConfig & {
153
- needParams?: boolean;
154
- });
155
- };
156
- children?: IElementConfig[];
157
- childrenSlotName?: string;
158
- highConfig$?: IHighConfig;
159
- }
160
- declare const renderElements: (elementMap: TElementMap, elementConfigs: IElementConfig[]) => (VNode | null)[];
161
- /**
162
- *
163
- * @param elementMap
164
- * @param elementConfig
165
- */
166
- declare const renderElement: (elementMap: TElementMap, elementConfig: IElementConfig) => VNode<vue.RendererNode, vue.RendererElement, {
167
- [key: string]: any;
168
- }>;
169
- /**
170
- * 获取第一层级属性名
171
- * 如:['aaa','bbb',...] 中的 'aaa'
172
- * 如:"aaa.bbb.ccc..." 中的 'aaa'
173
- */
174
- declare const getFirstPropName: (name: NamePath) => string | number | undefined;
175
- /**
176
- * 处理highConfig$
177
- */
178
- declare const Wrapper: vue.DefineComponent<{
179
- elementMap: TElementMap;
180
- elementConfig: IElementConfig;
181
- }, {}, {}, {}, {}, vue.ComponentOptionsMixin, vue.ComponentOptionsMixin, vue.EmitsOptions, string, vue.VNodeProps & vue.AllowedComponentProps & vue.ComponentCustomProps, Readonly<{
182
- elementMap: TElementMap;
183
- elementConfig: IElementConfig;
135
+ /***************************************** curd模式 *****************************************/
136
+ /**
137
+ * 获取Column的valueType,默认"text"
138
+ * @param column
139
+ */
140
+ declare const getColumnValueType: (column: TColumn) => TValueType;
141
+ /**
142
+ *获取Column的FormItem name
143
+ * @param column
144
+ */
145
+ declare const getColumnFormItemName: (column: TColumn) => string | number | undefined;
146
+ /**
147
+ * 根据Column生成FormItem VNode
148
+ * formFieldProps中的slots参数会以v-slots的形式传递到FormItem的录入组件(子组件)中
149
+ * @param formElementMap
150
+ * @param column
151
+ * @param needRules
152
+ */
153
+ declare const getFormItemEl: (formElementMap: any, column: TColumn, needRules?: boolean | undefined) => VNode | null;
154
+ /**
155
+ * 根据Column生成Item VNode
156
+ * @param elementMap
157
+ * @param column
158
+ * @param value
159
+ */
160
+ declare const getItemEl: <T extends TColumn>(elementMap: any, column: T, value: any) => VNode | null;
161
+ /***************************************** 通用模式 *****************************************/
162
+ declare type InternalNamePath = (string | number)[];
163
+ declare type NamePath = string | number | InternalNamePath;
164
+ interface IHighConfig {
165
+ registerStateList?: {
166
+ name: NamePath;
167
+ mapName?: NamePath;
168
+ }[];
169
+ registerEventList?: {
170
+ name: string;
171
+ sendEventName?: TActionEvent["type"];
172
+ }[];
173
+ registerPropsTrans?: {
174
+ name: NamePath;
175
+ isFun?: boolean;
176
+ needParams?: boolean;
177
+ }[];
178
+ }
179
+ /**
180
+ * 组件树描述
181
+ */
182
+ interface IElementConfig {
183
+ elementType: string;
184
+ elementId: string;
185
+ elementProps?: Record<string, any>;
186
+ slots?: {
187
+ [name: string]: ((...params$: any[]) => any) | (IElementConfig & {
188
+ needParams?: boolean;
189
+ });
190
+ };
191
+ children?: IElementConfig[];
192
+ childrenSlotName?: string;
193
+ highConfig$?: IHighConfig;
194
+ }
195
+ declare const renderElements: (elementMap: TElementMap, elementConfigs: IElementConfig[]) => (VNode | null)[];
196
+ /**
197
+ *
198
+ * @param elementMap
199
+ * @param elementConfig
200
+ */
201
+ declare const renderElement: (elementMap: TElementMap, elementConfig: IElementConfig) => VNode<vue.RendererNode, vue.RendererElement, {
202
+ [key: string]: any;
203
+ }>;
204
+ /**
205
+ * 获取第一层级属性名
206
+ * 如:['aaa','bbb',...] 中的 'aaa'
207
+ * 如:"aaa.bbb.ccc..." 中的 'aaa'
208
+ */
209
+ declare const getFirstPropName: (name: NamePath) => string | number | undefined;
210
+ /**
211
+ * 处理highConfig$
212
+ */
213
+ declare const Wrapper: vue.DefineComponent<{
214
+ elementMap: TElementMap;
215
+ elementConfig: IElementConfig;
216
+ }, {}, {}, {}, {}, vue.ComponentOptionsMixin, vue.ComponentOptionsMixin, vue.EmitsOptions, string, vue.VNodeProps & vue.AllowedComponentProps & vue.ComponentCustomProps, Readonly<{
217
+ elementMap: TElementMap;
218
+ elementConfig: IElementConfig;
184
219
  }>, {}>;
185
220
 
186
- interface IProModuleProvide {
187
- elementMap: TElementMap;
188
- subject$: Subject<TActionEvent>;
189
- sendEvent: (action: TActionEvent) => void;
190
- state: UnwrapNestedRefs<Record<string, any>>;
191
- dispatch: (action: TActionState) => void;
192
- requests: IRequestOpts[];
193
- sendRequest: (requestNameOrAction: string, ...params: any[]) => void;
194
- }
195
- declare const useProModule: () => IProModuleProvide;
196
- declare const provideProModule: (ctx: IProModuleProvide) => void;
197
- interface IRequestOpts {
198
- actor: IRequestActor;
199
- /**
200
- * 如果设置action,可以使用该值发起请求 住:要保证唯一性
201
- * 设置该字段原因:因为actor中的name不友好,可以理解为一个备选方案
202
- */
203
- action?: string;
204
- stateName?: string;
205
- loadingName?: string;
206
- convertParams?: (...params: any[]) => Record<string, any>;
207
- convertData?: (actor: IRequestActor) => Record<string, any>;
208
- onSuccess?: (actor?: IRequestActor) => void;
209
- onFailed?: (actor?: IRequestActor) => void;
210
- }
211
- declare const RequestAction: {
212
- Success: string;
213
- Fail: string;
214
- };
215
- declare const proModuleProps: () => {
216
- /**
217
- * module状态
218
- */
219
- state: {
220
- type: PropType<Record<string, any>>;
221
- };
222
- /**
223
- * 组件集
224
- */
225
- elementMap: {
226
- type: PropType<TElementMap>;
227
- };
228
- /**
229
- * 组件描述(树)
230
- */
231
- elementConfigs: {
232
- type: PropType<IElementConfig[]>;
233
- };
234
- /**
235
- * requests
236
- */
237
- requests: {
238
- type: PropType<IRequestOpts[]>;
239
- };
240
- };
241
- declare type ProModuleProps = Partial<ExtractPropTypes<ReturnType<typeof proModuleProps>>>;
242
- declare const ProModule: vue.DefineComponent<Partial<ExtractPropTypes<{
243
- /**
244
- * module状态
245
- */
246
- state: {
247
- type: PropType<Record<string, any>>;
248
- };
249
- /**
250
- * 组件集
251
- */
252
- elementMap: {
253
- type: PropType<TElementMap>;
254
- };
255
- /**
256
- * 组件描述(树)
257
- */
258
- elementConfigs: {
259
- type: PropType<IElementConfig[]>;
260
- };
261
- /**
262
- * requests
263
- */
264
- requests: {
265
- type: PropType<IRequestOpts[]>;
266
- };
267
- }>>, {}, {}, {}, {}, vue.ComponentOptionsMixin, vue.ComponentOptionsMixin, vue.EmitsOptions, string, vue.VNodeProps & vue.AllowedComponentProps & vue.ComponentCustomProps, Readonly<Partial<ExtractPropTypes<{
268
- /**
269
- * module状态
270
- */
271
- state: {
272
- type: PropType<Record<string, any>>;
273
- };
274
- /**
275
- * 组件集
276
- */
277
- elementMap: {
278
- type: PropType<TElementMap>;
279
- };
280
- /**
281
- * 组件描述(树)
282
- */
283
- elementConfigs: {
284
- type: PropType<IElementConfig[]>;
285
- };
286
- /**
287
- * requests
288
- */
289
- requests: {
290
- type: PropType<IRequestOpts[]>;
291
- };
221
+ interface IProModuleProvide {
222
+ elementMap: TElementMap;
223
+ subject$: Subject<TActionEvent>;
224
+ sendEvent: (action: TActionEvent) => void;
225
+ state: UnwrapNestedRefs<Record<string, any>>;
226
+ dispatch: (action: TActionState) => void;
227
+ requests: IRequestOpts[];
228
+ sendRequest: (requestNameOrAction: string, ...params: any[]) => void;
229
+ }
230
+ declare const useProModule: () => IProModuleProvide;
231
+ declare const provideProModule: (ctx: IProModuleProvide) => void;
232
+ declare const useModuleEvent: (cb: (action: TActionEvent) => void) => void;
233
+ interface IRequestOpts {
234
+ actor: IRequestActor;
235
+ /**
236
+ * 如果设置action,可以使用该值发起请求 住:要保证唯一性
237
+ * 设置该字段原因:因为actor中的name不友好,可以理解为一个备选方案
238
+ */
239
+ action?: string;
240
+ stateName?: string;
241
+ loadingName?: string;
242
+ convertParams?: (...params: any[]) => Record<string, any>;
243
+ convertData?: (actor: IRequestActor) => Record<string, any>;
244
+ onSuccess?: (actor?: IRequestActor) => void;
245
+ onFailed?: (actor?: IRequestActor) => void;
246
+ }
247
+ declare const RequestAction: {
248
+ Success: string;
249
+ Fail: string;
250
+ };
251
+ declare const proModuleProps: () => {
252
+ /**
253
+ * module状态
254
+ */
255
+ state: {
256
+ type: PropType<Record<string, any>>;
257
+ };
258
+ /**
259
+ * 组件集
260
+ */
261
+ elementMap: {
262
+ type: PropType<TElementMap>;
263
+ };
264
+ /**
265
+ * 组件描述(树)
266
+ */
267
+ elementConfigs: {
268
+ type: PropType<IElementConfig[]>;
269
+ };
270
+ /**
271
+ * requests
272
+ */
273
+ requests: {
274
+ type: PropType<IRequestOpts[]>;
275
+ };
276
+ };
277
+ declare type ProModuleProps = Partial<ExtractPropTypes<ReturnType<typeof proModuleProps>>>;
278
+ declare const ProModule: vue.DefineComponent<Partial<ExtractPropTypes<{
279
+ /**
280
+ * module状态
281
+ */
282
+ state: {
283
+ type: PropType<Record<string, any>>;
284
+ };
285
+ /**
286
+ * 组件集
287
+ */
288
+ elementMap: {
289
+ type: PropType<TElementMap>;
290
+ };
291
+ /**
292
+ * 组件描述(树)
293
+ */
294
+ elementConfigs: {
295
+ type: PropType<IElementConfig[]>;
296
+ };
297
+ /**
298
+ * requests
299
+ */
300
+ requests: {
301
+ type: PropType<IRequestOpts[]>;
302
+ };
303
+ }>>, {}, {}, {}, {}, vue.ComponentOptionsMixin, vue.ComponentOptionsMixin, vue.EmitsOptions, string, vue.VNodeProps & vue.AllowedComponentProps & vue.ComponentCustomProps, Readonly<Partial<ExtractPropTypes<{
304
+ /**
305
+ * module状态
306
+ */
307
+ state: {
308
+ type: PropType<Record<string, any>>;
309
+ };
310
+ /**
311
+ * 组件集
312
+ */
313
+ elementMap: {
314
+ type: PropType<TElementMap>;
315
+ };
316
+ /**
317
+ * 组件描述(树)
318
+ */
319
+ elementConfigs: {
320
+ type: PropType<IElementConfig[]>;
321
+ };
322
+ /**
323
+ * requests
324
+ */
325
+ requests: {
326
+ type: PropType<IRequestOpts[]>;
327
+ };
292
328
  }>>>, {}>;
293
329
 
294
- declare const useModuleEvent: (cb: (action: TActionEvent) => void) => void;
330
+ declare type TInitialState<T> = T | (() => T);
331
+ declare type TRegisterStore = {
332
+ key: string;
333
+ initialState?: TInitialState<any>;
334
+ persist?: boolean;
335
+ };
336
+ declare type TRegisterStoreMap = Record<string, TRegisterStore>;
337
+ /**
338
+ * 更新全局状态
339
+ */
340
+ declare const useDispatchStore: <T>() => (key: string, stateOrUpdater: T | TUpdater<T>) => void;
341
+ /**
342
+ * 读取全局状态
343
+ * 返回ref对象
344
+ */
345
+ declare const useReadStore: (key: string) => _vue_reactivity.Ref<any>;
295
346
 
296
- declare const useDoneRequestActor: (actors: (IRequestActor | string)[], callback: (actor: IRequestActor) => void) => void;
297
- declare const useFailedRequestActor: (actors: (IRequestActor | string)[], callback: (actor: IRequestActor) => void) => void;
298
- declare const useComposeRequestActor: (actors: (IRequestActor | string)[], options: {
299
- onSuccess?: ((actor: IRequestActor) => void) | undefined;
300
- onFailed?: ((actor: IRequestActor) => void) | undefined;
301
- onFinish?: ((actor: IRequestActor) => void) | undefined;
302
- }, cancelWhileUnmount?: boolean) => void;
347
+ declare const useDoneRequestActor: (actors: (IRequestActor | string)[], callback: (actor: IRequestActor) => void) => void;
348
+ declare const useFailedRequestActor: (actors: (IRequestActor | string)[], callback: (actor: IRequestActor) => void) => void;
349
+ declare const useComposeRequestActor: (actors: (IRequestActor | string)[], options: {
350
+ onSuccess?: ((actor: IRequestActor) => void) | undefined;
351
+ onFailed?: ((actor: IRequestActor) => void) | undefined;
352
+ onFinish?: ((actor: IRequestActor) => void) | undefined;
353
+ }, cancelWhileUnmount?: boolean) => void;
354
+ /******************************* meta *********************************/
355
+ /**
356
+ * 转换请求数据
357
+ * @param actor
358
+ * @param convertData
359
+ * @param convertPath
360
+ */
361
+ declare const convertResData: (actor: IRequestActor, convertData?: ((res: IRequestActor["res"], actor: IRequestActor) => any) | undefined, convertPath?: (string | number)[]) => any;
362
+ declare type TMeta = {
363
+ actorName: string;
364
+ storeName?: string;
365
+ initParams?: Record<string, any>;
366
+ convertPath?: (string | number)[];
367
+ convertData?: (data: any, actor: IRequestActor) => any;
368
+ };
369
+ /**
370
+ * 发送meta请求
371
+ */
372
+ declare const useDispatchMeta: () => (actorName: string) => void;
373
+ declare const useMetaRegister: (registerMetaMap: IProConfigProvide["registerMetaMap"], registerActorMap: IProConfigProvide["registerActorMap"]) => void;
303
374
 
304
- declare const proBasePropsFn: () => {
305
- /**
306
- * 组件集
307
- */
308
- elementMap: {
309
- type: PropType<TElementMap>;
310
- };
311
- /**
312
- * form组件集(使用FormItem包裹的组件集合)
313
- * readonly模式下使用elementMap中的组件渲染
314
- */
315
- formElementMap: {
316
- type: PropType<TElementMap>;
317
- };
318
- /**
319
- * 基础项配置
320
- */
321
- columns: {
322
- type: PropType<TColumns>;
323
- };
324
- /**
325
- * 对 column 进行补充
326
- * 通常对columns为静态值时候使用
327
- */
328
- columnState: {
329
- type: PropType<Record<string, any>>;
330
- };
331
- };
332
- declare type ProBaseProps = Partial<ExtractPropTypes<ReturnType<typeof proBasePropsFn>>>;
333
- declare const proBaseProps: ProBaseProps;
334
- interface IProConfigProvide {
335
- /**
336
- * 组件集
337
- */
338
- elementMap?: TElementMap;
339
- /**
340
- * form组件集(使用FormItem包裹的组件集合)
341
- */
342
- formElementMap?: TElementMap;
343
- }
344
- declare const proConfigProps: () => {
345
- config: {
346
- type: PropType<IProConfigProvide>;
347
- default: {};
348
- };
349
- };
350
- declare const useProConfig: () => IProConfigProvide;
351
- declare type ProConfigProps = Partial<ExtractPropTypes<ReturnType<typeof proConfigProps>>>;
352
- /**
353
- * 组件方式注册
354
- */
355
- declare const ProConfig: vue.DefineComponent<Partial<ExtractPropTypes<{
356
- config: {
357
- type: PropType<IProConfigProvide>;
358
- default: {};
359
- };
360
- }>>, {}, {}, {}, {}, vue.ComponentOptionsMixin, vue.ComponentOptionsMixin, vue.EmitsOptions, string, vue.VNodeProps & vue.AllowedComponentProps & vue.ComponentCustomProps, Readonly<Partial<ExtractPropTypes<{
361
- config: {
362
- type: PropType<IProConfigProvide>;
363
- default: {};
364
- };
375
+ declare const proBasePropsFn: () => {
376
+ /**
377
+ * 组件集
378
+ */
379
+ elementMap: {
380
+ type: PropType<TElementMap>;
381
+ };
382
+ /**
383
+ * form组件集(使用FormItem包裹的组件集合)
384
+ * readonly模式下使用elementMap中的组件渲染
385
+ */
386
+ formElementMap: {
387
+ type: PropType<TElementMap>;
388
+ };
389
+ /**
390
+ * 基础项配置
391
+ */
392
+ columns: {
393
+ type: PropType<TColumns>;
394
+ };
395
+ /**
396
+ * 对 column 进行补充
397
+ * 通常对columns为静态值时候使用
398
+ */
399
+ columnState: {
400
+ type: PropType<Record<string, any>>;
401
+ };
402
+ };
403
+ declare type ProBaseProps = Partial<ExtractPropTypes<ReturnType<typeof proBasePropsFn>>>;
404
+ declare const proBaseProps: ProBaseProps;
405
+ declare type ProDispatchRequestType = (actorName: string, params?: IRequestActor["req"], extra?: IRequestActor["extra"]) => IRequestActor | undefined;
406
+ interface IProConfigProvide {
407
+ /**
408
+ * 组件集
409
+ */
410
+ elementMap?: TElementMap;
411
+ /**
412
+ * form组件集(使用FormItem包裹的组件集合)
413
+ */
414
+ formElementMap?: TElementMap;
415
+ /**
416
+ * 注册的全局状态
417
+ */
418
+ registerStoreMap: TRegisterStoreMap;
419
+ /**
420
+ * 注册的全局接口
421
+ */
422
+ registerActorMap: Record<string, {
423
+ actor: IRequestActor;
424
+ }>;
425
+ /**
426
+ * 注册的全局Meta
427
+ */
428
+ registerMetaMap: Record<string, TMeta>;
429
+ /**
430
+ * 发送请求
431
+ * @param actorName
432
+ * @param params
433
+ * @param extra
434
+ */
435
+ dispatchRequest: ProDispatchRequestType;
436
+ }
437
+ declare const proConfigProps: () => {
438
+ elementMap: {
439
+ type: PropType<TElementMap>;
440
+ };
441
+ formElementMap: {
442
+ type: PropType<TElementMap>;
443
+ };
444
+ registerStores: {
445
+ type: PropType<TRegisterStore[]>;
446
+ };
447
+ registerActors: {
448
+ type: PropType<{
449
+ actor: IRequestActor;
450
+ }[]>;
451
+ };
452
+ registerMetas: {
453
+ type: PropType<TMeta[]>;
454
+ };
455
+ };
456
+ declare const useProConfig: () => IProConfigProvide;
457
+ declare type ProConfigProps = Partial<ExtractPropTypes<ReturnType<typeof proConfigProps>>>;
458
+ /**
459
+ * 组件方式注册
460
+ */
461
+ declare const ProConfig: vue.DefineComponent<Partial<ExtractPropTypes<{
462
+ elementMap: {
463
+ type: PropType<TElementMap>;
464
+ };
465
+ formElementMap: {
466
+ type: PropType<TElementMap>;
467
+ };
468
+ registerStores: {
469
+ type: PropType<TRegisterStore[]>;
470
+ };
471
+ registerActors: {
472
+ type: PropType<{
473
+ actor: IRequestActor;
474
+ }[]>;
475
+ };
476
+ registerMetas: {
477
+ type: PropType<TMeta[]>;
478
+ };
479
+ }>>, {}, {}, {}, {}, vue.ComponentOptionsMixin, vue.ComponentOptionsMixin, vue.EmitsOptions, string, vue.VNodeProps & vue.AllowedComponentProps & vue.ComponentCustomProps, Readonly<Partial<ExtractPropTypes<{
480
+ elementMap: {
481
+ type: PropType<TElementMap>;
482
+ };
483
+ formElementMap: {
484
+ type: PropType<TElementMap>;
485
+ };
486
+ registerStores: {
487
+ type: PropType<TRegisterStore[]>;
488
+ };
489
+ registerActors: {
490
+ type: PropType<{
491
+ actor: IRequestActor;
492
+ }[]>;
493
+ };
494
+ registerMetas: {
495
+ type: PropType<TMeta[]>;
496
+ };
497
+ }>>>, {}>;
498
+ /**
499
+ * app.use 方式注册
500
+ * @param config
501
+ */
502
+ declare const createProConfig: (config?: ProConfigProps) => (app: App) => void;
503
+
504
+ interface IAccess extends Record<string, any> {
505
+ token?: string;
506
+ }
507
+ declare type TAccess = UnwrapNestedRefs<IAccess>;
508
+ declare const useAccess: () => TAccess;
509
+ declare const useAccessMgr: () => readonly [any, (stateOrUpdater: _vue_start_store.TUpdater<undefined> | undefined) => void, () => void];
510
+ declare const MustLogon: vue.DefineComponent<unknown, () => vue.VNode<vue.RendererNode, vue.RendererElement, {
511
+ [key: string]: any;
512
+ }>[] | null | undefined, {}, vue.ComputedOptions, vue.MethodOptions, vue.ComponentOptionsMixin, vue.ComponentOptionsMixin, {}, string, vue.VNodeProps & vue.AllowedComponentProps & vue.ComponentCustomProps, Readonly<unknown>, {}>;
513
+ declare const LogonUserKey: unique symbol;
514
+ interface IUser extends Record<string, any> {
515
+ id?: string | number;
516
+ }
517
+ declare type TLogonUserProvide = {
518
+ user: UnwrapNestedRefs<IUser>;
519
+ setUser: (u: IUser) => void;
520
+ per: UnwrapNestedRefs<Record<string, any>>;
521
+ setPer: (u: IUser) => void;
522
+ opts: Record<string, any>;
523
+ };
524
+ declare const useLogonUser: () => TLogonUserProvide;
525
+ declare const LogonUser: vue.DefineComponent<unknown, () => vue.VNode<vue.RendererNode, vue.RendererElement, {
526
+ [key: string]: any;
527
+ }>[] | undefined, {}, vue.ComputedOptions, vue.MethodOptions, vue.ComponentOptionsMixin, vue.ComponentOptionsMixin, {}, string, vue.VNodeProps & vue.AllowedComponentProps & vue.ComponentCustomProps, Readonly<unknown>, {}>;
528
+
529
+ interface IProFormProvideExtra extends Record<string, any> {
530
+ }
531
+ interface IProFormProvide extends IProFormProvideExtra {
532
+ formState: UnwrapNestedRefs<Record<string, any>>;
533
+ showState: UnwrapNestedRefs<Record<string, any>>;
534
+ readonlyState: UnwrapNestedRefs<Record<string, any>>;
535
+ disableState: UnwrapNestedRefs<Record<string, any>>;
536
+ readonly: Ref<boolean | undefined>;
537
+ elementMap?: TElementMap;
538
+ formElementMap?: TElementMap;
539
+ columns: Ref<TColumns>;
540
+ }
541
+ declare const useProForm: () => IProFormProvide;
542
+ declare enum FormAction {
543
+ RESET = "RESET",
544
+ SUBMIT = "SUBMIT",
545
+ CONTINUE = "CONTINUE"
546
+ }
547
+ declare type TProFormOperate = ProOperateProps & {
548
+ onReset?: () => void;
549
+ onSubmit?: () => void;
550
+ onContinue?: () => void;
551
+ };
552
+ declare const proFormProps: () => {
553
+ /**
554
+ * class名称
555
+ */
556
+ clsName: {
557
+ type: StringConstructor;
558
+ default: string;
559
+ };
560
+ /**
561
+ * 同 antd 或 element form中的model
562
+ */
563
+ model: {
564
+ type: PropType<Record<string, any>>;
565
+ };
566
+ /**
567
+ * 子组件是否只读样式
568
+ */
569
+ readonly: {
570
+ type: BooleanConstructor;
571
+ default: undefined;
572
+ };
573
+ /**
574
+ * FormComponent 根据此项来确定组件是否显示
575
+ * rules 根据rules中方法生成showState对象
576
+ */
577
+ showState: {
578
+ type: PropType<BooleanObjType>;
579
+ };
580
+ showStateRules: {
581
+ type: PropType<BooleanRulesObjType>;
582
+ };
583
+ /**
584
+ * 是否只读
585
+ */
586
+ readonlyState: {
587
+ type: PropType<BooleanObjType>;
588
+ };
589
+ readonlyStateRules: {
590
+ type: PropType<BooleanRulesObjType>;
591
+ };
592
+ /**
593
+ * 是否disabled
594
+ */
595
+ disableState: {
596
+ type: PropType<BooleanObjType>;
597
+ };
598
+ disableStateRules: {
599
+ type: PropType<BooleanRulesObjType>;
600
+ };
601
+ /**
602
+ * 是否启用rules验证
603
+ */
604
+ needRules: {
605
+ type: BooleanConstructor;
606
+ default: boolean;
607
+ };
608
+ /**
609
+ * provide传递
610
+ */
611
+ provideExtra: {
612
+ type: PropType<IProFormProvideExtra>;
613
+ };
614
+ /**
615
+ * 操作按钮
616
+ */
617
+ operate: {
618
+ type: PropType<TProFormOperate>;
619
+ };
620
+ submitLoading: {
621
+ type: BooleanConstructor;
622
+ };
623
+ /**
624
+ * ref 默认中转方法
625
+ */
626
+ formMethods: {
627
+ type: PropType<string[]>;
628
+ };
629
+ };
630
+ declare type ProFormProps = Partial<ExtractPropTypes<ReturnType<typeof proFormProps>>> & ProBaseProps & Omit<ProGridProps, "items"> & {
631
+ onFinish?: (showValues?: Record<string, any>, values?: Record<string, any>) => void;
632
+ onFinishFailed?: (errs: any) => void;
633
+ };
634
+ declare const ProForm: vue.DefineComponent<ProFormProps, {}, {}, {}, {}, vue.ComponentOptionsMixin, vue.ComponentOptionsMixin, vue.EmitsOptions, string, vue.VNodeProps & vue.AllowedComponentProps & vue.ComponentCustomProps, Readonly<ProFormProps>, {}>;
635
+
636
+ declare enum SearchMode {
637
+ AUTO = "AUTO",
638
+ MANUAL = "MANUAL"
639
+ }
640
+ declare type ISearchMode = keyof typeof SearchMode;
641
+ declare const proSearchFormProps: () => {
642
+ /**
643
+ * 初始化触发 onFinish
644
+ */
645
+ initEmit: {
646
+ type: BooleanConstructor;
647
+ default: boolean;
648
+ };
649
+ /**
650
+ * 模式 自动触发或者手动触发 onFinish
651
+ */
652
+ searchMode: {
653
+ type: PropType<"AUTO" | "MANUAL">;
654
+ default: SearchMode;
655
+ };
656
+ /**
657
+ * 需要debounce处理的字段
658
+ */
659
+ debounceKeys: {
660
+ type: PropType<string[]>;
661
+ };
662
+ debounceTypes: {
663
+ type: PropType<string[]>;
664
+ default: string[];
665
+ };
666
+ debounceTime: {
667
+ type: NumberConstructor;
668
+ default: number;
669
+ };
670
+ };
671
+ declare type ProSearchFormProps = Partial<ExtractPropTypes<ReturnType<typeof proSearchFormProps>>> & ProFormProps;
672
+ declare const ProSearchForm: vue.DefineComponent<ProSearchFormProps, {}, {}, {}, {}, vue.ComponentOptionsMixin, vue.ComponentOptionsMixin, vue.EmitsOptions, string, vue.VNodeProps & vue.AllowedComponentProps & vue.ComponentCustomProps, Readonly<ProSearchFormProps>, {}>;
673
+
674
+ interface FormItemProps {
675
+ name?: string | number | (string | number)[];
676
+ }
677
+ declare const proFormItemProps: () => {
678
+ readonly: {
679
+ type: BooleanConstructor;
680
+ default: undefined;
681
+ };
682
+ fieldProps: {
683
+ type: ObjectConstructor;
684
+ };
685
+ showProps: {
686
+ type: ObjectConstructor;
687
+ };
688
+ slots: {
689
+ type: ObjectConstructor;
690
+ };
691
+ };
692
+ declare type ProFormItemProps = Partial<ExtractPropTypes<ReturnType<typeof proFormItemProps>>> & Record<string, any>;
693
+ declare const createFormItemCompFn: <T extends FormItemProps>(FormItem: any, convertInputCompProps: (value: any, setValue: (v: any) => void, disabled: boolean | undefined) => Record<string, any>) => ({ InputComp, valueType, name }: {
694
+ InputComp: any;
695
+ valueType: TValueType;
696
+ name?: string | undefined;
697
+ }) => vue.DefineComponent<T & Partial<ExtractPropTypes<{
698
+ readonly: {
699
+ type: BooleanConstructor;
700
+ default: undefined;
701
+ };
702
+ fieldProps: {
703
+ type: ObjectConstructor;
704
+ };
705
+ showProps: {
706
+ type: ObjectConstructor;
707
+ };
708
+ slots: {
709
+ type: ObjectConstructor;
710
+ };
711
+ }>> & Record<string, any>, {}, {}, {}, {}, vue.ComponentOptionsMixin, vue.ComponentOptionsMixin, vue.EmitsOptions, string, vue.VNodeProps & vue.AllowedComponentProps & vue.ComponentCustomProps, Readonly<T & Partial<ExtractPropTypes<{
712
+ readonly: {
713
+ type: BooleanConstructor;
714
+ default: undefined;
715
+ };
716
+ fieldProps: {
717
+ type: ObjectConstructor;
718
+ };
719
+ showProps: {
720
+ type: ObjectConstructor;
721
+ };
722
+ slots: {
723
+ type: ObjectConstructor;
724
+ };
725
+ }>> & Record<string, any> extends infer T_1 ? T_1 extends T & Partial<ExtractPropTypes<{
726
+ readonly: {
727
+ type: BooleanConstructor;
728
+ default: undefined;
729
+ };
730
+ fieldProps: {
731
+ type: ObjectConstructor;
732
+ };
733
+ showProps: {
734
+ type: ObjectConstructor;
735
+ };
736
+ slots: {
737
+ type: ObjectConstructor;
738
+ };
739
+ }>> & Record<string, any> ? T_1 extends vue.ComponentPropsOptions<{
740
+ [x: string]: unknown;
741
+ }> ? ExtractPropTypes<T_1> : T_1 : never : never>, vue.ExtractDefaultPropTypes<T & Partial<ExtractPropTypes<{
742
+ readonly: {
743
+ type: BooleanConstructor;
744
+ default: undefined;
745
+ };
746
+ fieldProps: {
747
+ type: ObjectConstructor;
748
+ };
749
+ showProps: {
750
+ type: ObjectConstructor;
751
+ };
752
+ slots: {
753
+ type: ObjectConstructor;
754
+ };
755
+ }>> & Record<string, any>>>;
756
+
757
+ interface IProFormListProvide {
758
+ pathList: (string | number)[];
759
+ }
760
+ declare const useProFormList: () => IProFormListProvide;
761
+ declare const provideProFormList: (ctx: IProFormListProvide) => void;
762
+ declare const proFormListProps: () => {
763
+ rowKey: {
764
+ type: StringConstructor;
765
+ default: string;
766
+ };
767
+ name: {
768
+ type: PropType<string | number | (string | number)[]>;
769
+ required: boolean;
770
+ };
771
+ };
772
+ declare type ProFormListProps = Partial<ExtractPropTypes<ReturnType<typeof proFormListProps>>>;
773
+ declare const ProFormList: vue.DefineComponent<Partial<ExtractPropTypes<{
774
+ rowKey: {
775
+ type: StringConstructor;
776
+ default: string;
777
+ };
778
+ name: {
779
+ type: PropType<string | number | (string | number)[]>;
780
+ required: boolean;
781
+ };
782
+ }>>, {}, {}, {}, {}, vue.ComponentOptionsMixin, vue.ComponentOptionsMixin, vue.EmitsOptions, string, vue.VNodeProps & vue.AllowedComponentProps & vue.ComponentCustomProps, Readonly<Partial<ExtractPropTypes<{
783
+ rowKey: {
784
+ type: StringConstructor;
785
+ default: string;
786
+ };
787
+ name: {
788
+ type: PropType<string | number | (string | number)[]>;
789
+ required: boolean;
790
+ };
365
791
  }>>>, {}>;
366
- /**
367
- * app.use 方式注册
368
- * @param config
369
- */
370
- declare const createProConfig: (config?: IProConfigProvide) => (app: App) => void;
371
792
 
372
- interface IProTableProvideExtra extends Record<string, any> {
373
- }
374
- interface IProTableProvide extends IProTableProvideExtra {
375
- columns: Ref<TTableColumns>;
376
- }
377
- declare const useProTable: () => IProTableProvide;
378
- declare type TTableColumn = {
379
- customRender?: (opt: {
380
- value: any;
381
- text: any;
382
- record: Record<string, any>;
383
- index: number;
384
- column: TTableColumn;
385
- }) => VNode | string | number;
386
- fixed?: boolean | string;
387
- width?: number | string;
388
- } & TColumn;
389
- declare type TTableColumns = TTableColumn[];
390
- /**
391
- * 单个操作描述
392
- */
393
- interface IOperateItem {
394
- value: string | number;
395
- label?: string | VNode;
396
- element?: (record: Record<string, any>, item: IOperateItem) => VNode;
397
- show?: boolean | ((record: Record<string, any>) => boolean);
398
- disabled?: boolean | ((record: Record<string, any>) => boolean);
399
- onClick?: (record: Record<string, any>) => void;
400
- sort?: number;
401
- }
402
- /**
403
- * 整个操作栏描述
404
- */
405
- interface ITableOperate {
406
- column?: TColumn;
407
- items?: IOperateItem[];
408
- itemState?: {
409
- [key: string]: Omit<IOperateItem, "value">;
410
- };
411
- }
412
- declare const proTableProps: () => {
413
- operate: {
414
- type: PropType<ITableOperate>;
415
- };
416
- columnEmptyText: {
417
- type: StringConstructor;
418
- };
419
- /**
420
- * 公共column,会merge到columns item中
421
- */
422
- column: {
423
- type: PropType<TTableColumn>;
424
- };
425
- /**
426
- * 序号
427
- */
428
- serialNumber: {
429
- type: BooleanConstructor;
430
- };
431
- /**
432
- * 分页
433
- */
434
- paginationState: {
435
- type: PropType<{
436
- page?: number | undefined;
437
- pageSize?: number | undefined;
438
- }>;
439
- };
440
- /**
441
- * provide传递
442
- */
443
- provideExtra: {
444
- type: PropType<IProTableProvideExtra>;
445
- };
446
- };
447
- declare type ProTableProps = Partial<ExtractPropTypes<ReturnType<typeof proTableProps>>> & ProBaseProps;
448
- declare const createTable: (Table: any, Props?: any, tableMethods?: string[]) => any;
793
+ interface IOpeItem {
794
+ value: string | number;
795
+ label?: string | VNode | (() => string | VNode);
796
+ show?: boolean | (() => boolean);
797
+ disabled?: boolean | (() => boolean);
798
+ loading?: boolean | (() => boolean);
799
+ extraProps?: object | (() => Record<string, any>);
800
+ onClick?: (value: string | number | boolean) => void;
801
+ element?: (item?: Omit<IOpeItem, "show" | "disabled" | "opeProps" | "element"> & {
802
+ disabled?: boolean;
803
+ }) => VNode | null;
804
+ }
805
+ declare const proOperateProps: () => {
806
+ /**
807
+ * class名称
808
+ */
809
+ clsName: {
810
+ type: StringConstructor;
811
+ default: string;
812
+ };
813
+ items: {
814
+ type: PropType<IOpeItem[]>;
815
+ };
816
+ itemState: {
817
+ type: PropType<Record<string, IOpeItem>>;
818
+ };
819
+ elementKey: {
820
+ type: StringConstructor;
821
+ default: string;
822
+ };
823
+ };
824
+ declare type ProOperateProps = Partial<ExtractPropTypes<ReturnType<typeof proOperateProps>>>;
825
+ declare const ProOperate: vue.DefineComponent<Partial<ExtractPropTypes<{
826
+ /**
827
+ * class名称
828
+ */
829
+ clsName: {
830
+ type: StringConstructor;
831
+ default: string;
832
+ };
833
+ items: {
834
+ type: PropType<IOpeItem[]>;
835
+ };
836
+ itemState: {
837
+ type: PropType<Record<string, IOpeItem>>;
838
+ };
839
+ elementKey: {
840
+ type: StringConstructor;
841
+ default: string;
842
+ };
843
+ }>>, {}, {}, {}, {}, vue.ComponentOptionsMixin, vue.ComponentOptionsMixin, vue.EmitsOptions, string, vue.VNodeProps & vue.AllowedComponentProps & vue.ComponentCustomProps, Readonly<Partial<ExtractPropTypes<{
844
+ /**
845
+ * class名称
846
+ */
847
+ clsName: {
848
+ type: StringConstructor;
849
+ default: string;
850
+ };
851
+ items: {
852
+ type: PropType<IOpeItem[]>;
853
+ };
854
+ itemState: {
855
+ type: PropType<Record<string, IOpeItem>>;
856
+ };
857
+ elementKey: {
858
+ type: StringConstructor;
859
+ default: string;
860
+ };
861
+ }>>>, {}>;
449
862
 
450
- declare type TPageState = {
451
- page: number;
452
- pageSize: number;
453
- };
454
- declare const defaultPage: TPageState;
455
- interface IListData extends Record<string, any> {
456
- total: number;
457
- dataSource: Record<string, any>[];
458
- }
459
- interface ICurdState extends Record<string, any> {
460
- listLoading?: boolean;
461
- listData?: IListData;
462
- mode?: ICurdCurrentMode;
463
- detailLoading?: boolean;
464
- detailData?: Record<string, any>;
465
- operateLoading?: boolean;
466
- addAction?: ICurdAddAction;
467
- }
468
- /**
469
- * action:list,detail,add,edit,delete
470
- */
471
- interface ICurdOperateOpts extends Omit<IRequestOpts, "actor" | "action">, Omit<IOperateItem, "value"> {
472
- action: ICurdAction;
473
- actor?: IRequestActor;
474
- tableOperate?: boolean;
475
- }
476
- declare type TCurdActionEvent = {
477
- action: ICurdAction;
478
- type: ICurdSubAction;
479
- record?: Record<string, any>;
480
- values?: Record<string, any>;
481
- source?: TActionEvent["source"];
482
- };
483
- declare const proCurdProps: () => {
484
- /**
485
- * 列表 或 详情 的唯一标识
486
- */
487
- rowKey: {
488
- type: StringConstructor;
489
- default: string;
490
- };
491
- /**
492
- * operates
493
- */
494
- operates: {
495
- type: PropType<ICurdOperateOpts[]>;
496
- };
497
- /************************* 子组件props *******************************/
498
- listProps: {
499
- type: PropType<Record<string, any>>;
500
- };
501
- formProps: {
502
- type: PropType<Record<string, any>>;
503
- };
504
- descProps: {
505
- type: PropType<Record<string, any>>;
506
- };
507
- modalProps: {
508
- type: PropType<Record<string, any>>;
509
- };
510
- };
511
- declare type CurdProps = Partial<ExtractPropTypes<ReturnType<typeof proCurdProps>>> & ProBaseProps;
512
- declare const CurdMethods: string[];
513
- declare type ProCurdProps = CurdProps & Omit<ProModuleProps, "state" | "requests"> & {
514
- curdState?: UnwrapNestedRefs<ICurdState>;
515
- };
863
+ interface IProTableProvideExtra extends Record<string, any> {
864
+ }
865
+ interface IProTableProvide extends IProTableProvideExtra {
866
+ columns: Ref<TTableColumns>;
867
+ originColumns: Ref<TTableColumns>;
868
+ state: UnwrapNestedRefs<{
869
+ selectIds: (string | number)[];
870
+ }>;
871
+ }
872
+ declare const useProTable: () => IProTableProvide;
873
+ declare type TTableColumn = {
874
+ customRender?: (opt: {
875
+ value: any;
876
+ text: any;
877
+ record: Record<string, any>;
878
+ index: number;
879
+ column: TTableColumn;
880
+ }) => VNode | string | number;
881
+ fixed?: boolean | string;
882
+ width?: number | string;
883
+ } & TColumn;
884
+ declare type TTableColumns = TTableColumn[];
885
+ /**
886
+ * 单个操作描述
887
+ */
888
+ interface IOperateItem {
889
+ value: string | number;
890
+ label?: string | VNode;
891
+ show?: boolean | ((record: Record<string, any>) => boolean);
892
+ disabled?: boolean | ((record: Record<string, any>) => boolean);
893
+ loading?: boolean | ((record: Record<string, any>) => boolean);
894
+ extraProps?: object | ((record: Record<string, any>) => Record<string, any>);
895
+ onClick?: (record: Record<string, any>) => void;
896
+ sort?: number;
897
+ element?: (record: Record<string, any>, item: IOperateItem) => VNode;
898
+ }
899
+ /**
900
+ * 整个操作栏描述
901
+ */
902
+ interface ITableOperate {
903
+ column?: TColumn;
904
+ items?: IOperateItem[];
905
+ itemState?: {
906
+ [key: string]: Omit<IOperateItem, "value">;
907
+ };
908
+ clsName?: ProOperateProps["clsName"];
909
+ elementKey?: ProOperateProps["elementKey"];
910
+ }
911
+ declare const proTableProps: () => {
912
+ /**
913
+ * class名称
914
+ */
915
+ clsName: {
916
+ type: StringConstructor;
917
+ default: string;
918
+ };
919
+ operate: {
920
+ type: PropType<ITableOperate>;
921
+ };
922
+ columnEmptyText: {
923
+ type: StringConstructor;
924
+ };
925
+ /**
926
+ * 公共column,会merge到columns item中
927
+ */
928
+ column: {
929
+ type: PropType<TTableColumn>;
930
+ };
931
+ /**
932
+ * 序号
933
+ */
934
+ serialNumber: {
935
+ type: (BooleanConstructor | ObjectConstructor)[];
936
+ };
937
+ /**
938
+ * 分页
939
+ */
940
+ paginationState: {
941
+ type: PropType<{
942
+ page?: number | undefined;
943
+ pageSize?: number | undefined;
944
+ }>;
945
+ };
946
+ /**
947
+ * 操作栏
948
+ */
949
+ toolbar: {
950
+ type: PropType<{
951
+ columnSetting?: Partial<ExtractPropTypes<{
952
+ clsName: {
953
+ type: StringConstructor;
954
+ default: string;
955
+ };
956
+ signName: {
957
+ type: StringConstructor;
958
+ default: string;
959
+ };
960
+ popoverProps: ObjectConstructor;
961
+ }>> | undefined;
962
+ }>;
963
+ };
964
+ /**
965
+ * provide传递
966
+ */
967
+ provideExtra: {
968
+ type: PropType<IProTableProvideExtra>;
969
+ };
970
+ /**
971
+ * ref 默认中转方法
972
+ */
973
+ tableMethods: {
974
+ type: PropType<string[]>;
975
+ };
976
+ };
977
+ declare type ProTableProps = Partial<ExtractPropTypes<ReturnType<typeof proTableProps>>> & ProBaseProps & {
978
+ loading?: boolean;
979
+ dataSource?: Record<string, any>[];
980
+ };
981
+ declare const ProTable: vue.DefineComponent<ProTableProps, {}, {}, {}, {}, vue.ComponentOptionsMixin, vue.ComponentOptionsMixin, vue.EmitsOptions, string, vue.VNodeProps & vue.AllowedComponentProps & vue.ComponentCustomProps, Readonly<ProTableProps>, {}>;
982
+
983
+ declare const proPageHeaderProps: () => {
984
+ title: {
985
+ type: StringConstructor;
986
+ };
987
+ subTitle: {
988
+ type: StringConstructor;
989
+ };
990
+ showBack: BooleanConstructor;
991
+ hideWhileNoHistory: {
992
+ type: BooleanConstructor;
993
+ default: boolean;
994
+ };
995
+ };
996
+ declare type PageHeaderProps = Partial<ExtractPropTypes<ReturnType<typeof proPageHeaderProps>>>;
997
+ declare const PageHeader: vue.DefineComponent<{
998
+ title: {
999
+ type: StringConstructor;
1000
+ };
1001
+ subTitle: {
1002
+ type: StringConstructor;
1003
+ };
1004
+ showBack: BooleanConstructor;
1005
+ hideWhileNoHistory: {
1006
+ type: BooleanConstructor;
1007
+ default: boolean;
1008
+ };
1009
+ }, () => JSX.Element, unknown, {}, {}, vue.ComponentOptionsMixin, vue.ComponentOptionsMixin, Record<string, any>, string, vue.VNodeProps & vue.AllowedComponentProps & vue.ComponentCustomProps, Readonly<ExtractPropTypes<{
1010
+ title: {
1011
+ type: StringConstructor;
1012
+ };
1013
+ subTitle: {
1014
+ type: StringConstructor;
1015
+ };
1016
+ showBack: BooleanConstructor;
1017
+ hideWhileNoHistory: {
1018
+ type: BooleanConstructor;
1019
+ default: boolean;
1020
+ };
1021
+ }>>, {
1022
+ showBack: boolean;
1023
+ hideWhileNoHistory: boolean;
1024
+ }>;
1025
+ declare const proPageProps: () => {
1026
+ loading: {
1027
+ type: BooleanConstructor;
1028
+ default: boolean;
1029
+ };
1030
+ loadingOpts: ObjectConstructor;
1031
+ fillMode: {
1032
+ type: BooleanConstructor;
1033
+ default: boolean;
1034
+ };
1035
+ };
1036
+ declare type ProPageProps = Partial<ExtractPropTypes<ReturnType<typeof proPageProps>>> & PageHeaderProps;
1037
+ declare const ProPage: vue.DefineComponent<ProPageProps, {}, {}, {}, {}, vue.ComponentOptionsMixin, vue.ComponentOptionsMixin, vue.EmitsOptions, string, vue.VNodeProps & vue.AllowedComponentProps & vue.ComponentCustomProps, Readonly<ProPageProps>, {}>;
1038
+
1039
+ declare type TPageState = {
1040
+ page: number;
1041
+ pageSize: number;
1042
+ };
1043
+ declare const defaultPage: TPageState;
1044
+ declare const proListProps: () => {
1045
+ /**
1046
+ * class名称
1047
+ */
1048
+ clsName: {
1049
+ type: StringConstructor;
1050
+ default: string;
1051
+ };
1052
+ searchProps: {
1053
+ type: PropType<Record<string, any>>;
1054
+ };
1055
+ tableProps: {
1056
+ type: PropType<Record<string, any>>;
1057
+ };
1058
+ paginationProps: {
1059
+ type: PropType<Record<string, any>>;
1060
+ };
1061
+ pageState: {
1062
+ type: PropType<TPageState>;
1063
+ };
1064
+ };
1065
+ declare type ProListProps = Partial<ExtractPropTypes<ReturnType<typeof proListProps>>>;
1066
+ declare type SearchSlotProps = {
1067
+ executeSearchWithResetPage: (values: Record<string, any>, page?: number) => void;
1068
+ pageState: TPageState;
1069
+ };
1070
+ declare type PaginationSlotProps = {
1071
+ executePageChange: (page: number, pageSize: number) => void;
1072
+ pageState: TPageState;
1073
+ };
1074
+ /**
1075
+ * 搜索框+表格+分页 三个组件组成
1076
+ * onSearch 方法:search改变、page改变触发
1077
+ */
1078
+ declare const ProList: vue.DefineComponent<Partial<ExtractPropTypes<{
1079
+ /**
1080
+ * class名称
1081
+ */
1082
+ clsName: {
1083
+ type: StringConstructor;
1084
+ default: string;
1085
+ };
1086
+ searchProps: {
1087
+ type: PropType<Record<string, any>>;
1088
+ };
1089
+ tableProps: {
1090
+ type: PropType<Record<string, any>>;
1091
+ };
1092
+ paginationProps: {
1093
+ type: PropType<Record<string, any>>;
1094
+ };
1095
+ pageState: {
1096
+ type: PropType<TPageState>;
1097
+ };
1098
+ }>>, {}, {}, {}, {}, vue.ComponentOptionsMixin, vue.ComponentOptionsMixin, vue.EmitsOptions, string, vue.VNodeProps & vue.AllowedComponentProps & vue.ComponentCustomProps, Readonly<Partial<ExtractPropTypes<{
1099
+ /**
1100
+ * class名称
1101
+ */
1102
+ clsName: {
1103
+ type: StringConstructor;
1104
+ default: string;
1105
+ };
1106
+ searchProps: {
1107
+ type: PropType<Record<string, any>>;
1108
+ };
1109
+ tableProps: {
1110
+ type: PropType<Record<string, any>>;
1111
+ };
1112
+ paginationProps: {
1113
+ type: PropType<Record<string, any>>;
1114
+ };
1115
+ pageState: {
1116
+ type: PropType<TPageState>;
1117
+ };
1118
+ }>>>, {}>;
1119
+
1120
+ declare const proDescProps: () => {
1121
+ /**
1122
+ * class名称
1123
+ */
1124
+ clsName: {
1125
+ type: StringConstructor;
1126
+ default: string;
1127
+ };
1128
+ model: {
1129
+ type: PropType<any>;
1130
+ };
1131
+ };
1132
+ declare type ProDescProps = Partial<ExtractPropTypes<ReturnType<typeof proDescProps>>> & ProBaseProps;
1133
+ declare const ProDesc: vue.DefineComponent<ProDescProps, {}, {}, {}, {}, vue.ComponentOptionsMixin, vue.ComponentOptionsMixin, vue.EmitsOptions, string, vue.VNodeProps & vue.AllowedComponentProps & vue.ComponentCustomProps, Readonly<ProDescProps>, {
1134
+ model?: any;
1135
+ }>;
1136
+
1137
+ /******************************** 原始组件key ********************************/
1138
+ declare const LoadingKey = "Loading$";
1139
+ declare const RowKey = "Row$";
1140
+ declare const ColKey = "Col$";
1141
+ declare const ButtonKey = "Button$";
1142
+ declare const DescriptionsKey = "ProDescriptions$";
1143
+ declare const DescriptionsItemKey = "ProDescriptionsItem$";
1144
+ declare const PaginationKey = "Pagination$";
1145
+ declare const PopoverKey = "Popover$";
1146
+ declare const CheckboxKey = "Checkbox$";
1147
+ declare const ModalKey = "Modal$";
1148
+ declare const FormKey = "Form$";
1149
+ declare const FormItemKey = "FormItem$";
1150
+ declare const TableKey = "Table$";
1151
+ /******************************** pro组件key ********************************/
1152
+ declare const ProFormKey = "ProForm$";
1153
+ declare const ProSearchFormKey = "ProSearchForm$";
1154
+ declare const ProTableKey = "ProTable$";
1155
+ /**
1156
+ * 根据elementKey获取组件
1157
+ */
1158
+ declare const useGetCompByKey: () => (elementKey: string) => any;
1159
+
1160
+ interface IListData extends Record<string, any> {
1161
+ total: number;
1162
+ dataSource: Record<string, any>[];
1163
+ }
1164
+ interface ICurdState extends Record<string, any> {
1165
+ listLoading?: boolean;
1166
+ listData?: IListData;
1167
+ mode?: ICurdCurrentMode;
1168
+ detailLoading?: boolean;
1169
+ detailData?: Record<string, any>;
1170
+ operateLoading?: boolean;
1171
+ addAction?: ICurdAddAction;
1172
+ }
1173
+ /**
1174
+ * action:list,detail,add,edit,delete
1175
+ */
1176
+ interface ICurdOperateOpts extends Omit<IRequestOpts, "actor" | "action">, Omit<IOperateItem, "value"> {
1177
+ action: ICurdAction;
1178
+ actor?: IRequestActor;
1179
+ tableOperate?: boolean;
1180
+ }
1181
+ declare type TCurdActionEvent = {
1182
+ action: ICurdAction;
1183
+ type: ICurdSubAction;
1184
+ record?: Record<string, any>;
1185
+ values?: Record<string, any>;
1186
+ source?: TActionEvent["source"];
1187
+ };
1188
+ declare const proCurdProps: () => {
1189
+ /**
1190
+ * 列表 或 详情 的唯一标识
1191
+ */
1192
+ rowKey: {
1193
+ type: StringConstructor;
1194
+ default: string;
1195
+ };
1196
+ /**
1197
+ * operates
1198
+ */
1199
+ operates: {
1200
+ type: PropType<ICurdOperateOpts[]>;
1201
+ };
1202
+ /************************* 子组件props *******************************/
1203
+ listProps: {
1204
+ type: PropType<Record<string, any>>;
1205
+ };
1206
+ formProps: {
1207
+ type: PropType<Record<string, any>>;
1208
+ };
1209
+ descProps: {
1210
+ type: PropType<Record<string, any>>;
1211
+ };
1212
+ modalProps: {
1213
+ type: PropType<Record<string, any>>;
1214
+ };
1215
+ };
1216
+ declare type CurdProps = Partial<ExtractPropTypes<ReturnType<typeof proCurdProps>>> & ProBaseProps;
1217
+ declare const CurdMethods: string[];
1218
+ declare type ProCurdProps = CurdProps & Omit<ProModuleProps, "state" | "requests"> & {
1219
+ curdState?: UnwrapNestedRefs<ICurdState>;
1220
+ };
516
1221
  declare const ProCurd: vue.DefineComponent<ProCurdProps, {}, {}, {}, {}, vue.ComponentOptionsMixin, vue.ComponentOptionsMixin, vue.EmitsOptions, string, vue.VNodeProps & vue.AllowedComponentProps & vue.ComponentCustomProps, Readonly<ProCurdProps>, {}>;
517
1222
 
518
- interface IProCurdProvide {
519
- columns: Ref<TColumns>;
520
- getSignColumns: (signName: string) => TColumns;
521
- getFormItemVNode: (column: TColumn, needRules: boolean | undefined) => VNode | null;
522
- getItemVNode: (column: TColumn, value: any) => VNode | null;
523
- elementMap: TElementMap;
524
- formElementMap: TElementMap;
525
- rowKey: string;
526
- curdState: UnwrapNestedRefs<ICurdState>;
527
- formColumns: Ref<TColumns>;
528
- descColumns: Ref<TColumns>;
529
- tableColumns: Ref<TColumns>;
530
- searchColumns: Ref<TColumns>;
531
- sendCurdEvent: (event: TCurdActionEvent) => void;
532
- operates: ICurdOperateOpts[];
533
- getOperate: (action: ICurdAction) => ICurdOperateOpts | undefined;
534
- refreshList: (extra?: Record<string, any>) => void;
535
- /******************子组件参数*******************/
536
- listProps?: ComputedRef<Record<string, any> | undefined>;
537
- formProps?: ComputedRef<Record<string, any> | undefined>;
538
- descProps?: ComputedRef<Record<string, any> | undefined>;
539
- modalProps?: ComputedRef<Record<string, any> | undefined>;
540
- }
541
- declare const useProCurd: <T extends IProCurdProvide>() => T;
542
- declare const provideProCurd: (ctx: IProCurdProvide) => void;
543
- /************************************ 常量 *************************************/
544
- /**
545
- * curd 5种基础Action
546
- */
547
- declare enum CurdAction {
548
- LIST = "LIST",
549
- DETAIL = "DETAIL",
550
- ADD = "ADD",
551
- EDIT = "EDIT",
552
- DELETE = "DELETE"
553
- }
554
- declare type ICurdAction = keyof typeof CurdAction | string;
555
- /**
556
- * CurdAction 的子事件
557
- */
558
- declare enum CurdSubAction {
559
- EMIT = "EMIT",
560
- EXECUTE = "EXECUTE",
561
- PAGE = "PAGE",
562
- SUCCESS = "SUCCESS",
563
- FAIL = "FAIL"
564
- }
565
- declare type ICurdSubAction = keyof typeof CurdSubAction;
566
- /**
567
- * curd 操作模式
568
- */
569
- declare enum CurdCurrentMode {
570
- ADD = "ADD",
571
- EDIT = "EDIT",
572
- DETAIL = "DETAIL"
573
- }
574
- declare type ICurdCurrentMode = keyof typeof CurdCurrentMode | string;
575
- /**
576
- * curd add 模式下 标记 "确定" "确定并继续" 触发
577
- */
578
- declare enum CurdAddAction {
579
- NORMAL = "NORMAL",
580
- CONTINUE = "CONTINUE"
581
- }
1223
+ interface IProCurdProvide {
1224
+ columns: Ref<TColumns>;
1225
+ getSignColumns: (signName: string) => TColumns;
1226
+ getFormItemVNode: (column: TColumn, needRules: boolean | undefined) => VNode | null;
1227
+ getItemVNode: (column: TColumn, value: any) => VNode | null;
1228
+ elementMap: TElementMap;
1229
+ formElementMap: TElementMap;
1230
+ rowKey: string;
1231
+ curdState: UnwrapNestedRefs<ICurdState>;
1232
+ formColumns: Ref<TColumns>;
1233
+ descColumns: Ref<TColumns>;
1234
+ tableColumns: Ref<TColumns>;
1235
+ searchColumns: Ref<TColumns>;
1236
+ sendCurdEvent: (event: TCurdActionEvent) => void;
1237
+ operates: ICurdOperateOpts[];
1238
+ getOperate: (action: ICurdAction) => ICurdOperateOpts | undefined;
1239
+ refreshList: (extra?: Record<string, any>) => void;
1240
+ /******************子组件参数*******************/
1241
+ listProps?: ComputedRef<Record<string, any> | undefined>;
1242
+ formProps?: ComputedRef<Record<string, any> | undefined>;
1243
+ descProps?: ComputedRef<Record<string, any> | undefined>;
1244
+ modalProps?: ComputedRef<Record<string, any> | undefined>;
1245
+ }
1246
+ declare const useProCurd: <T extends IProCurdProvide>() => T;
1247
+ declare const provideProCurd: (ctx: IProCurdProvide) => void;
1248
+ /************************************ 常量 *************************************/
1249
+ /**
1250
+ * curd 5种基础Action
1251
+ */
1252
+ declare enum CurdAction {
1253
+ LIST = "LIST",
1254
+ DETAIL = "DETAIL",
1255
+ ADD = "ADD",
1256
+ EDIT = "EDIT",
1257
+ DELETE = "DELETE"
1258
+ }
1259
+ declare type ICurdAction = keyof typeof CurdAction | string;
1260
+ /**
1261
+ * CurdAction 的子事件
1262
+ */
1263
+ declare enum CurdSubAction {
1264
+ EMIT = "EMIT",
1265
+ EXECUTE = "EXECUTE",
1266
+ PAGE = "PAGE",
1267
+ SUCCESS = "SUCCESS",
1268
+ FAIL = "FAIL"
1269
+ }
1270
+ declare type ICurdSubAction = keyof typeof CurdSubAction;
1271
+ /**
1272
+ * curd 操作模式
1273
+ */
1274
+ declare enum CurdCurrentMode {
1275
+ ADD = "ADD",
1276
+ EDIT = "EDIT",
1277
+ DETAIL = "DETAIL"
1278
+ }
1279
+ declare type ICurdCurrentMode = keyof typeof CurdCurrentMode | string;
1280
+ /**
1281
+ * curd add 模式下 标记 "确定" "确定并继续" 触发
1282
+ */
1283
+ declare enum CurdAddAction {
1284
+ NORMAL = "NORMAL",
1285
+ CONTINUE = "CONTINUE"
1286
+ }
582
1287
  declare type ICurdAddAction = keyof typeof CurdAddAction;
583
1288
 
584
- declare const modalCurdProps: () => {
585
- defaultAddRecord: {
586
- type: PropType<Record<string, any>>;
587
- };
588
- };
589
- declare type ModalCurdProps = Partial<ExtractPropTypes<ReturnType<typeof modalCurdProps>>>;
590
- declare type ProModalCurdProps = ModalCurdProps & ProCurdProps;
1289
+ declare const modalCurdProps: () => {
1290
+ defaultAddRecord: {
1291
+ type: PropType<Record<string, any>>;
1292
+ };
1293
+ };
1294
+ declare type ModalCurdProps = Partial<ExtractPropTypes<ReturnType<typeof modalCurdProps>>>;
1295
+ declare type ProModalCurdProps = ModalCurdProps & ProCurdProps;
591
1296
  declare const ProModalCurd: vue.DefineComponent<ProModalCurdProps, {}, {}, {}, {}, vue.ComponentOptionsMixin, vue.ComponentOptionsMixin, vue.EmitsOptions, string, vue.VNodeProps & vue.AllowedComponentProps & vue.ComponentCustomProps, Readonly<ProModalCurdProps>, {}>;
592
1297
 
593
- declare const pageCurdProps: () => {
594
- defaultAddRecord: {
595
- type: PropType<Record<string, any>>;
596
- };
597
- routeBack: {
598
- type: PropType<(action: ICurdAction) => void>;
599
- };
600
- };
601
- declare type PageCurdProps = Partial<ExtractPropTypes<ReturnType<typeof pageCurdProps>>>;
602
- declare type ProPageCurdProps = PageCurdProps & ProCurdProps;
1298
+ declare const pageCurdProps: () => {
1299
+ defaultAddRecord: {
1300
+ type: PropType<Record<string, any>>;
1301
+ };
1302
+ routeBack: {
1303
+ type: PropType<(action: ICurdAction) => void>;
1304
+ };
1305
+ };
1306
+ declare type PageCurdProps = Partial<ExtractPropTypes<ReturnType<typeof pageCurdProps>>>;
1307
+ declare type ProPageCurdProps = PageCurdProps & ProCurdProps;
603
1308
  declare const ProPageCurd: vue.DefineComponent<ProPageCurdProps, {}, {}, {}, {}, vue.ComponentOptionsMixin, vue.ComponentOptionsMixin, vue.EmitsOptions, string, vue.VNodeProps & vue.AllowedComponentProps & vue.ComponentCustomProps, Readonly<ProPageCurdProps>, {}>;
604
1309
 
605
- declare const createCurdDesc: (Descriptions: any, DescriptionsItem: any) => any;
606
-
607
- declare const proCurdAddOrEditProps: () => {
608
- signName: {
609
- type: StringConstructor;
610
- };
611
- modelName: {
612
- type: StringConstructor;
613
- default: string;
614
- };
615
- operateBar: {
616
- type: BooleanConstructor;
617
- default: boolean;
618
- };
619
- showContinueAdd: {
620
- type: BooleanConstructor;
621
- default: boolean;
622
- };
623
- okText: {
624
- type: StringConstructor;
625
- default: string;
626
- };
627
- okButtonProps: {
628
- type: PropType<Record<string, any>>;
629
- };
630
- continueText: {
631
- type: StringConstructor;
632
- default: string;
633
- };
634
- continueButtonProps: {
635
- type: PropType<Record<string, any>>;
636
- };
637
- };
638
- declare type ProCurdAddOrEditProps = Partial<ExtractPropTypes<ReturnType<typeof proCurdAddOrEditProps>>>;
639
- declare const createCurdForm: (Form: any, Button: any, convertFormProps?: ((curdState: ICurdState) => Record<string, any>) | undefined, formMethods?: string[]) => any;
1310
+ /**
1311
+ *
1312
+ */
1313
+ declare const ProCurdList: vue.DefineComponent<Partial<vue.ExtractPropTypes<{
1314
+ clsName: {
1315
+ type: StringConstructor;
1316
+ default: string;
1317
+ };
1318
+ searchProps: {
1319
+ type: vue.PropType<Record<string, any>>;
1320
+ };
1321
+ tableProps: {
1322
+ type: vue.PropType<Record<string, any>>;
1323
+ };
1324
+ paginationProps: {
1325
+ type: vue.PropType<Record<string, any>>;
1326
+ };
1327
+ pageState: {
1328
+ type: vue.PropType<TPageState>;
1329
+ };
1330
+ }>>, {}, {}, {}, {}, vue.ComponentOptionsMixin, vue.ComponentOptionsMixin, vue.EmitsOptions, string, vue.VNodeProps & vue.AllowedComponentProps & vue.ComponentCustomProps, Readonly<Partial<vue.ExtractPropTypes<{
1331
+ clsName: {
1332
+ type: StringConstructor;
1333
+ default: string;
1334
+ };
1335
+ searchProps: {
1336
+ type: vue.PropType<Record<string, any>>;
1337
+ };
1338
+ tableProps: {
1339
+ type: vue.PropType<Record<string, any>>;
1340
+ };
1341
+ paginationProps: {
1342
+ type: vue.PropType<Record<string, any>>;
1343
+ };
1344
+ pageState: {
1345
+ type: vue.PropType<TPageState>;
1346
+ };
1347
+ }>>>, {}>;
1348
+ declare const ProCurdListConnect: vue.DefineComponent<unknown, () => JSX.Element, {}, vue.ComputedOptions, vue.MethodOptions, vue.ComponentOptionsMixin, vue.ComponentOptionsMixin, {}, string, vue.VNodeProps & vue.AllowedComponentProps & vue.ComponentCustomProps, Readonly<unknown>, {}>;
640
1349
 
641
- declare const proCurdListProps: () => {
642
- /**
643
- * extra 是否放到SearchForm中
644
- */
645
- extraInSearch: {
646
- type: BooleanConstructor;
647
- default: undefined;
648
- };
649
- searchProps: {
650
- type: PropType<Record<string, any>>;
651
- };
652
- tableProps: {
653
- type: PropType<Record<string, any>>;
654
- };
655
- paginationProps: {
656
- type: PropType<Record<string, any>>;
657
- };
658
- showPagination: {
659
- type: BooleanConstructor;
660
- default: boolean;
661
- };
662
- pageState: {
663
- type: PropType<TPageState>;
664
- };
665
- };
666
- declare type ProCurdListProps = Partial<ExtractPropTypes<ReturnType<typeof proCurdListProps>>>;
667
- declare const createCurdList: (SearchForm: any, Table: any) => vue.DefineComponent<Partial<ExtractPropTypes<{
668
- /**
669
- * extra 是否放到SearchForm中
670
- */
671
- extraInSearch: {
672
- type: BooleanConstructor;
673
- default: undefined;
674
- };
675
- searchProps: {
676
- type: PropType<Record<string, any>>;
677
- };
678
- tableProps: {
679
- type: PropType<Record<string, any>>;
680
- };
681
- paginationProps: {
682
- type: PropType<Record<string, any>>;
683
- };
684
- showPagination: {
685
- type: BooleanConstructor;
686
- default: boolean;
687
- };
688
- pageState: {
689
- type: PropType<TPageState>;
690
- };
691
- }>>, {}, {}, {}, {}, vue.ComponentOptionsMixin, vue.ComponentOptionsMixin, vue.EmitsOptions, string, vue.VNodeProps & vue.AllowedComponentProps & vue.ComponentCustomProps, Readonly<Partial<ExtractPropTypes<{
692
- /**
693
- * extra 是否放到SearchForm中
694
- */
695
- extraInSearch: {
696
- type: BooleanConstructor;
697
- default: undefined;
698
- };
699
- searchProps: {
700
- type: PropType<Record<string, any>>;
701
- };
702
- tableProps: {
703
- type: PropType<Record<string, any>>;
704
- };
705
- paginationProps: {
706
- type: PropType<Record<string, any>>;
707
- };
708
- showPagination: {
709
- type: BooleanConstructor;
710
- default: boolean;
711
- };
712
- pageState: {
713
- type: PropType<TPageState>;
714
- };
715
- }>>>, {}>;
1350
+ declare const proCurdFormProps: () => {
1351
+ /**
1352
+ * class名称
1353
+ */
1354
+ clsName: {
1355
+ type: StringConstructor;
1356
+ default: string;
1357
+ };
1358
+ signName: {
1359
+ type: StringConstructor;
1360
+ };
1361
+ };
1362
+ declare type ProCurdFormProps = Partial<ExtractPropTypes<ReturnType<typeof proCurdFormProps>>> & ProFormProps;
1363
+ declare const ProCurdForm: vue.DefineComponent<ProCurdFormProps, {}, {}, {}, {}, vue.ComponentOptionsMixin, vue.ComponentOptionsMixin, vue.EmitsOptions, string, vue.VNodeProps & vue.AllowedComponentProps & vue.ComponentCustomProps, Readonly<ProCurdFormProps>, {}>;
1364
+ declare const ProCurdFormConnect: vue.DefineComponent<unknown, () => JSX.Element, {}, vue.ComputedOptions, vue.MethodOptions, vue.ComponentOptionsMixin, vue.ComponentOptionsMixin, {}, string, vue.VNodeProps & vue.AllowedComponentProps & vue.ComponentCustomProps, Readonly<unknown>, {}>;
716
1365
 
717
- interface IProFormProvideExtra extends Record<string, any> {
718
- }
719
- interface IProFormProvide extends IProFormProvideExtra {
720
- formState: UnwrapNestedRefs<Record<string, any>>;
721
- showState: UnwrapNestedRefs<Record<string, any>>;
722
- readonlyState: UnwrapNestedRefs<Record<string, any>>;
723
- disableState: UnwrapNestedRefs<Record<string, any>>;
724
- readonly: Ref<boolean | undefined>;
725
- elementMap?: TElementMap;
726
- formElementMap?: TElementMap;
727
- columns: Ref<TColumns>;
728
- }
729
- declare const useProForm: () => IProFormProvide;
730
- declare const proFormProps: () => {
731
- /**
732
- * 同 antd 或 element form中的model
733
- */
734
- model: {
735
- type: PropType<Record<string, any>>;
736
- };
737
- /**
738
- * 子组件是否只读样式
739
- */
740
- readonly: {
741
- type: BooleanConstructor;
742
- default: undefined;
743
- };
744
- /**
745
- * FormComponent 根据此项来确定组件是否显示
746
- * rules 根据rules中方法生成showState对象
747
- */
748
- showState: {
749
- type: PropType<BooleanObjType>;
750
- };
751
- showStateRules: {
752
- type: PropType<BooleanRulesObjType>;
753
- };
754
- /**
755
- * 是否只读
756
- */
757
- readonlyState: {
758
- type: PropType<BooleanObjType>;
759
- };
760
- readonlyStateRules: {
761
- type: PropType<BooleanRulesObjType>;
762
- };
763
- /**
764
- * 是否disabled
765
- */
766
- disableState: {
767
- type: PropType<BooleanObjType>;
768
- };
769
- disableStateRules: {
770
- type: PropType<BooleanRulesObjType>;
771
- };
772
- /**
773
- * 是否启用rules验证
774
- */
775
- needRules: {
776
- type: BooleanConstructor;
777
- default: boolean;
778
- };
779
- /**
780
- * provide传递
781
- */
782
- provideExtra: {
783
- type: PropType<IProFormProvideExtra>;
784
- };
785
- };
786
- declare type ProFormProps = Partial<ExtractPropTypes<ReturnType<typeof proFormProps>>> & ProBaseProps;
787
- declare const createForm: (Form: any, Grid: any, formMethods: string[]) => any;
1366
+ declare const proCurdDescProps: () => {
1367
+ /**
1368
+ * class名称
1369
+ */
1370
+ clsName: {
1371
+ type: StringConstructor;
1372
+ default: string;
1373
+ };
1374
+ signName: {
1375
+ type: StringConstructor;
1376
+ };
1377
+ };
1378
+ declare type ProCurdDescProps = Partial<ExtractPropTypes<ReturnType<typeof proCurdDescProps>>> & ProBaseProps & ProDescProps;
1379
+ declare const ProCurdDesc: vue.DefineComponent<ProCurdDescProps, {}, {}, {}, {}, vue.ComponentOptionsMixin, vue.ComponentOptionsMixin, vue.EmitsOptions, string, vue.VNodeProps & vue.AllowedComponentProps & vue.ComponentCustomProps, Readonly<ProCurdDescProps>, {
1380
+ model?: any;
1381
+ }>;
1382
+ declare const ProCurdDescConnect: vue.DefineComponent<unknown, () => JSX.Element, {}, vue.ComputedOptions, vue.MethodOptions, vue.ComponentOptionsMixin, vue.ComponentOptionsMixin, {}, string, vue.VNodeProps & vue.AllowedComponentProps & vue.ComponentCustomProps, Readonly<unknown>, {}>;
788
1383
 
789
- declare enum SearchMode {
790
- AUTO = "AUTO",
791
- MANUAL = "MANUAL"
792
- }
793
- declare type ISearchMode = keyof typeof SearchMode;
794
- declare const proSearchFormProps: () => {
795
- /**
796
- * 初始化触发 onFinish
797
- */
798
- initEmit: {
799
- type: BooleanConstructor;
800
- default: boolean;
801
- };
802
- /**
803
- * 模式 自动触发或者手动触发 onFinish
804
- */
805
- searchMode: {
806
- type: PropType<"AUTO" | "MANUAL">;
807
- default: SearchMode;
808
- };
809
- /**
810
- * 需要debounce处理的字段
811
- */
812
- debounceKeys: {
813
- type: PropType<string[]>;
814
- };
815
- debounceTypes: {
816
- type: PropType<string[]>;
817
- default: string[];
818
- };
819
- debounceTime: {
820
- type: NumberConstructor;
821
- default: number;
822
- };
823
- };
824
- declare type ProSearchFormProps = Partial<ExtractPropTypes<ReturnType<typeof proSearchFormProps>>> & ProFormProps;
825
- /**
826
- * 该组件只是个模式,最终返回null,不做任何渲染,应配合着ProForm的包装类一起使用
827
- * 针对传入的model(监听对象)做相应的finish(回调)处理
828
- */
829
- declare const createSearchForm: (Form: any, Props: any, formMethods: string[]) => any;
830
-
831
- interface FormItemProps {
832
- name?: string | number | (string | number)[];
833
- }
834
- declare const proFormItemProps: () => {
835
- readonly: {
836
- type: BooleanConstructor;
837
- default: undefined;
838
- };
839
- fieldProps: {
840
- type: ObjectConstructor;
841
- };
842
- showProps: {
843
- type: ObjectConstructor;
844
- };
845
- slots: {
846
- type: ObjectConstructor;
847
- };
848
- };
849
- declare type ProFormItemProps = Partial<ExtractPropTypes<ReturnType<typeof proFormItemProps>>> & Record<string, any>;
850
- declare const createFormItemCompFn: <T extends FormItemProps>(FormItem: any, convertInputCompProps: (value: any, setValue: (v: any) => void, disabled: boolean | undefined) => Record<string, any>) => ({ InputComp, valueType, name }: {
851
- InputComp: any;
852
- valueType: TValueType;
853
- name?: string | undefined;
854
- }) => vue.DefineComponent<T & Partial<ExtractPropTypes<{
855
- readonly: {
856
- type: BooleanConstructor;
857
- default: undefined;
858
- };
859
- fieldProps: {
860
- type: ObjectConstructor;
861
- };
862
- showProps: {
863
- type: ObjectConstructor;
864
- };
865
- slots: {
866
- type: ObjectConstructor;
867
- };
868
- }>> & Record<string, any>, {}, {}, {}, {}, vue.ComponentOptionsMixin, vue.ComponentOptionsMixin, vue.EmitsOptions, string, vue.VNodeProps & vue.AllowedComponentProps & vue.ComponentCustomProps, Readonly<T & Partial<ExtractPropTypes<{
869
- readonly: {
870
- type: BooleanConstructor;
871
- default: undefined;
872
- };
873
- fieldProps: {
874
- type: ObjectConstructor;
875
- };
876
- showProps: {
877
- type: ObjectConstructor;
878
- };
879
- slots: {
880
- type: ObjectConstructor;
881
- };
882
- }>> & Record<string, any> extends infer T_1 ? T_1 extends T & Partial<ExtractPropTypes<{
883
- readonly: {
884
- type: BooleanConstructor;
885
- default: undefined;
886
- };
887
- fieldProps: {
888
- type: ObjectConstructor;
889
- };
890
- showProps: {
891
- type: ObjectConstructor;
892
- };
893
- slots: {
894
- type: ObjectConstructor;
895
- };
896
- }>> & Record<string, any> ? T_1 extends vue.ComponentPropsOptions<{
897
- [x: string]: unknown;
898
- }> ? ExtractPropTypes<T_1> : T_1 : never : never>, vue.ExtractDefaultPropTypes<T & Partial<ExtractPropTypes<{
899
- readonly: {
900
- type: BooleanConstructor;
901
- default: undefined;
902
- };
903
- fieldProps: {
904
- type: ObjectConstructor;
905
- };
906
- showProps: {
907
- type: ObjectConstructor;
908
- };
909
- slots: {
910
- type: ObjectConstructor;
911
- };
912
- }>> & Record<string, any>>>;
913
-
914
- interface IProFormListProvide {
915
- pathList: (string | number)[];
916
- }
917
- declare const useProFormList: () => IProFormListProvide;
918
- declare const provideProFormList: (ctx: IProFormListProvide) => void;
919
- declare const proFormListProps: () => {
920
- rowKey: {
921
- type: StringConstructor;
922
- default: string;
923
- };
924
- name: {
925
- type: PropType<string | number | (string | number)[]>;
926
- required: boolean;
927
- };
928
- };
929
- declare type ProFormListProps = Partial<ExtractPropTypes<ReturnType<typeof proFormListProps>>>;
930
- declare const createFormList: (FormItem: any) => any;
1384
+ declare const proCurdModalProps: () => {
1385
+ /**
1386
+ * class名称
1387
+ */
1388
+ clsName: {
1389
+ type: StringConstructor;
1390
+ default: string;
1391
+ };
1392
+ validMode: {
1393
+ type: ArrayConstructor;
1394
+ default: CurdAction[];
1395
+ };
1396
+ };
1397
+ declare type ProCurdModalProps = Partial<ExtractPropTypes<ReturnType<typeof proCurdModalProps>>> & Record<string, any>;
1398
+ declare const ProCurdModal: vue.DefineComponent<ProCurdModalProps, {}, {}, {}, {}, vue.ComponentOptionsMixin, vue.ComponentOptionsMixin, vue.EmitsOptions, string, vue.VNodeProps & vue.AllowedComponentProps & vue.ComponentCustomProps, Readonly<ExtractPropTypes<ProCurdModalProps>>, {
1399
+ [x: string]: any;
1400
+ }>;
1401
+ declare const ProCurdModalForm: vue.DefineComponent<{
1402
+ modalProps: ObjectConstructor;
1403
+ formProps: ObjectConstructor;
1404
+ }, () => JSX.Element, unknown, {}, {}, vue.ComponentOptionsMixin, vue.ComponentOptionsMixin, Record<string, any>, string, vue.VNodeProps & vue.AllowedComponentProps & vue.ComponentCustomProps, Readonly<ExtractPropTypes<{
1405
+ modalProps: ObjectConstructor;
1406
+ formProps: ObjectConstructor;
1407
+ }>>, {}>;
1408
+ declare const ProCurdModalFormConnect: vue.DefineComponent<unknown, () => JSX.Element, {}, vue.ComputedOptions, vue.MethodOptions, vue.ComponentOptionsMixin, vue.ComponentOptionsMixin, {}, string, vue.VNodeProps & vue.AllowedComponentProps & vue.ComponentCustomProps, Readonly<unknown>, {}>;
931
1409
 
932
- /**
933
- * 剔除showState或showStateRules规则为!true的值
934
- * @param values
935
- * @param showState
936
- * @param showStateRules
937
- */
938
- declare const getValidValues: (values: Record<string, any>, showState?: BooleanObjType, showStateRules?: BooleanRulesObjType) => Record<string, any>;
939
- /**
940
- * string类型的path转为arr
941
- * @param path
942
- */
943
- declare const convertPathToList: (path: undefined | string | number | (string | number)[]) => undefined | (string | number)[];
944
- /**
945
- * 将listState 中的数据通过id merge到 list item中
946
- * ps:数组会替换
947
- * 注意:mergeWith 会改变原始对象
948
- * @param list
949
- * @param listState
950
- * @param id
951
- */
1410
+ /**
1411
+ * 剔除showState或showStateRules规则为!true的值
1412
+ * @param values
1413
+ * @param showState
1414
+ * @param showStateRules
1415
+ */
1416
+ declare const getValidValues: (values: Record<string, any>, showState?: BooleanObjType, showStateRules?: BooleanRulesObjType) => Record<string, any>;
1417
+ /**
1418
+ * string类型的path转为arr
1419
+ * @param path
1420
+ */
1421
+ declare const convertPathToList: (path: undefined | string | number | (string | number)[]) => undefined | (string | number)[];
1422
+ /**
1423
+ * 将listState 中的数据通过id merge到 list item中
1424
+ * ps:数组会替换
1425
+ * 注意:mergeWith 会改变原始对象
1426
+ * @param list
1427
+ * @param listState
1428
+ * @param id
1429
+ */
952
1430
  declare const mergeStateToList: (list: Record<string, any>[], listState: Record<string, any>, id: string | number | ((item: Record<string, any>) => string | number)) => Record<string, any>[];
953
1431
 
954
- /**
955
- * ref 传递
956
- */
957
- declare const createExpose: (methods: string[], targetRef: Ref$1) => Record<string, any>;
958
- declare const createExposeObj: (targetRef: Ref$1, methods?: string[], opts?: Record<string, any>) => Record<string, any>;
1432
+ /**
1433
+ * ref 传递
1434
+ */
1435
+ declare const createExpose: (methods: string[], targetRef: Ref$1) => Record<string, any>;
1436
+ declare const createExposeObj: (targetRef: Ref$1, methods?: string[], opts?: Record<string, any>) => Record<string, any>;
1437
+ /**
1438
+ * 从TColumn中查找标记值
1439
+ * @param item
1440
+ * @param signName
1441
+ */
1442
+ declare const getSignValue: <T = any>(item: TColumn, signName: string) => T;
1443
+ /**
1444
+ * 从slots对象中找出`${prefix}`开头的属性组成一个对象
1445
+ * {
1446
+ * `${prefix}${slot name}}`: ()=>Function,
1447
+ * ...
1448
+ * }
1449
+ * @param slots
1450
+ * @param prefix
1451
+ */
1452
+ declare const filterSlotsByPrefix: (slots: Record<string, any>, prefix: string) => lodash.Dictionary<any>;
959
1453
 
960
- export { BooleanObjType, BooleanRulesObjType, CurdAction, CurdAddAction, CurdCurrentMode, CurdMethods, CurdSubAction, FieldNames, FormItemProps, GridProps, ICurdAction, ICurdAddAction, ICurdCurrentMode, ICurdOperateOpts, ICurdState, ICurdSubAction, IElementConfig, IHighConfig, IListData, IOperateItem, IProConfigProvide, IProCurdProvide, IProFormProvideExtra, IProModuleProvide, IProTableProvide, IProTableProvideExtra, IRequestOpts, ISearchMode, ITableOperate, InternalNamePath, NamePath, ProBaseProps, ProConfig, ProConfigProps, ProCurd, ProCurdAddOrEditProps, ProCurdListProps, ProCurdProps, ProFormItemProps, ProFormListProps, ProFormProps, ProModalCurd, ProModalCurdProps, ProModule, ProModuleProps, ProPageCurd, ProPageCurdProps, ProSearchFormProps, ProTableProps, RequestAction, SearchMode, TActionEvent, TActionState, TColumn, TColumns, TCurdActionEvent, TDefaultValueType, TElementMap, TOption, TOptions, TPageState, TTableColumn, TTableColumns, TValueType, TreeOption, TreeOptions, Wrapper, convertPathToList, createCurdDesc, createCurdForm, createCurdList, createExpose, createExposeObj, createForm, createFormItemCompFn, createFormList, createGrid, createProConfig, createSearchForm, createTable, defaultPage, getColumnFormItemName, getColumnValueType, getFirstPropName, getFormItemEl, getItemEl, getValidValues, mergeStateToList, proBaseProps, provideProCurd, provideProFormList, provideProModule, renderElement, renderElements, useComposeRequestActor, useDoneRequestActor, useFailedRequestActor, useModuleEvent, useProConfig, useProCurd, useProForm, useProFormList, useProModule, useProTable };
1454
+ export { BooleanObjType, BooleanRulesObjType, ButtonKey, CheckboxKey, ColKey, CurdAction, CurdAddAction, CurdCurrentMode, CurdMethods, CurdSubAction, DescriptionsItemKey, DescriptionsKey, FieldNames, FormAction, FormItemKey, FormItemProps, FormKey, IAccess, ICurdAction, ICurdAddAction, ICurdCurrentMode, ICurdOperateOpts, ICurdState, ICurdSubAction, IElementConfig, IHighConfig, IListData, IOpeItem, IOperateItem, IProConfigProvide, IProCurdProvide, IProFormProvideExtra, IProModuleProvide, IProTableProvide, IProTableProvideExtra, IRequestOpts, ISearchMode, ITableOperate, IUser, InternalNamePath, LoadingKey, LogonUser, LogonUserKey, ModalKey, MustLogon, NamePath, PageHeader, PageHeaderProps, PaginationKey, PaginationSlotProps, PopoverKey, ProBaseProps, ProConfig, ProConfigProps, ProCurd, ProCurdDesc, ProCurdDescConnect, ProCurdDescProps, ProCurdForm, ProCurdFormConnect, ProCurdFormProps, ProCurdList, ProCurdListConnect, ProCurdModal, ProCurdModalForm, ProCurdModalFormConnect, ProCurdModalProps, ProCurdProps, ProDesc, ProDescProps, ProDispatchRequestType, ProForm, ProFormItemProps, ProFormKey, ProFormList, ProFormListProps, ProFormProps, ProGrid, ProGridProps, ProList, ProListProps, ProModalCurd, ProModalCurdProps, ProModule, ProModuleProps, ProOperate, ProOperateProps, ProPage, ProPageCurd, ProPageCurdProps, ProPageProps, ProSearchForm, ProSearchFormKey, ProSearchFormProps, ProTable, ProTableKey, ProTableProps, RequestAction, RowKey, SearchMode, SearchSlotProps, TAccess, TActionEvent, TActionState, TColumn, TColumns, TCurdActionEvent, TDefaultValueType, TElementMap, TInitialState, TLogonUserProvide, TMeta, TOption, TOptions, TPageState, TProFormOperate, TRegisterStore, TRegisterStoreMap, TTableColumn, TTableColumns, TValueType, TableKey, TreeOption, TreeOptions, Wrapper, convertPathToList, convertResData, createExpose, createExposeObj, createFormItemCompFn, createProConfig, defaultPage, filterSlotsByPrefix, getColumnFormItemName, getColumnValueType, getFirstPropName, getFormItemEl, getItemEl, getSignValue, getValidValues, mergeStateToList, proBaseProps, provideProCurd, provideProFormList, provideProModule, renderElement, renderElements, useAccess, useAccessMgr, useComposeRequestActor, useDispatchMeta, useDispatchStore, useDoneRequestActor, useFailedRequestActor, useGetCompByKey, useLogonUser, useMetaRegister, useModuleEvent, useProConfig, useProCurd, useProForm, useProFormList, useProModule, useProTable, useReadStore };