@juzhenfe/page-model 3.12.4 → 3.13.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.
@@ -24,6 +24,7 @@
24
24
 
25
25
  import { ButtonProps } from 'element-plus'
26
26
  import { StyleValue } from 'vue'
27
+ import { JSX } from 'vue/jsx-runtime'
27
28
 
28
29
  declare global {
29
30
  type AnyObject = {
@@ -43,8 +44,9 @@ declare global {
43
44
  ...rest: Parameters<FN>
44
45
  ) => Promise<ReturnType<FN>>)
45
46
 
46
- type FieldType = 'string' | 'number' | 'date'
47
+ type FilterType = 'string' | 'number' | 'date' | 'boolean' | 'select' | 'list'
47
48
 
49
+
48
50
  type InnerFilterItem = {
49
51
  key: string
50
52
  compareFn: (cellValue: string) => boolean
@@ -240,35 +242,80 @@ declare global {
240
242
  interface NoParams extends AnyObject {}
241
243
 
242
244
  interface TableBaseItem<MODEL = any, CTX = any> extends BaseElItem<MODEL> {
243
- // 宽度属性
245
+ /**
246
+ * 宽度
247
+ */
244
248
  width?: string | number
249
+ /**
250
+ * 最小宽度
251
+ */
245
252
  minWidth?: string | number
246
- // 定位属性
253
+ /**
254
+ * 定位
255
+ */
247
256
  fixed?: 'left' | 'right' | boolean
248
- // 是否显示
257
+ /**
258
+ * 是否显示
259
+ */
249
260
  isShow?:
250
261
  | boolean
251
262
  | ((this: CTX, self: TableBaseItem<MODEL, CTX>) => boolean)
252
- // 用户表格配置
263
+ /**
264
+ * 用户表格配置
265
+ */
253
266
  userConfigShow?: boolean
254
- // 用户表头
267
+ /**
268
+ * 用户表头
269
+ */
255
270
  userLabel?: string
256
- // 表格排序
271
+ /**
272
+ * 表格排序
273
+ */
257
274
  sortValues?: [AscParams, DescParams] | [AscParams, DescParams, NoParams]
258
- // 列属性
275
+ /**
276
+ * 列属性
277
+ */
259
278
  props?: ConvertFunctionContext<TableBaseItemProps, CTX>
260
- // 自定义渲染
279
+ /**
280
+ * 自定义渲染
281
+ */
261
282
  renderFn?: (this: CTX, data: MODEL, index: number) => JSX.Element
262
- // 过滤函数
263
- filterFn?: (this: CTX, data: MODEL, query: any) => boolean
264
- // 过滤组件
265
- getCellText?: (this: CTX, data: MODEL) => string
266
- // 过滤的自定义组件配置
267
- filterData?: FormItem<MODEL, CTX>
268
- // 是否直接显示编辑组件
269
- showEdit?: boolean
283
+ /**
284
+ * 是否启用过滤
285
+ */
286
+ filterable?: boolean
287
+
288
+ /**
289
+ * 过滤类型
290
+ */
291
+ filterType?: FilterType
292
+
293
+ /**
294
+ * 复数过滤
295
+ */
296
+ filterMultiple?: boolean
297
+
298
+ /**
299
+ * 过滤表单文本
300
+ */
301
+ filterLabel?: string
302
+
303
+ /**
304
+ * 过滤选项
305
+ */
306
+ filterOptions?: Array<{ label: string; value: string | number | boolean }>
307
+
308
+ /**
309
+ * 是否必填
310
+ */
270
311
  required?: boolean
271
- // 内置编辑组件
312
+ /**
313
+ * 是否直接显示编辑组件
314
+ */
315
+ showEdit?: boolean
316
+ /**
317
+ * 内置编辑组件
318
+ */
272
319
  editData?: FormItem<MODEL, CTX> & {
273
320
  api?: string | ((this: CTX, data: MODEL) => string)
274
321
  method?: PageModel.AjaxMethod
@@ -296,8 +343,6 @@ declare global {
296
343
  helpText?: string
297
344
  // 显示合计
298
345
  showSummary?: number | string
299
- // 静态过滤类型
300
- fieldType?: FieldType
301
346
  /**
302
347
  * 显示的行数
303
348
  */
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@juzhenfe/page-model",
3
- "version": "3.12.4",
3
+ "version": "3.13.0",
4
4
  "types": "dist/main.d.ts",
5
5
  "main": "dist/index.umd.js",
6
6
  "keywords": [
@@ -1,158 +0,0 @@
1
- declare const _sfc_main: import("vue").DefineComponent<{
2
- els: {
3
- type: ArrayConstructor;
4
- required: true;
5
- };
6
- context: {
7
- type: any;
8
- required: true;
9
- };
10
- }, {
11
- props: any;
12
- tableManager: import("vue").ComputedRef<any>;
13
- handleClickEditIcon: (column: any, row: any) => void;
14
- onUpdateTableCellModelValue: (row: any, prop: string, value: any) => void;
15
- onSaveEditContent: (row: AnyObject, cellKey: string, column: PageModel.TableBaseItem<any, any>) => Promise<boolean>;
16
- onCellDataChange: (row: AnyObject, cellKey: string, column: PageModel.TableBaseItem<any, any>) => void;
17
- onCancelEditContent: (row: AnyObject, cellKey: string, restoreKey: string) => void;
18
- TableCellRenderer: import("vue").DefineComponent<{
19
- renderFn: {
20
- type: import("vue").PropType<PageModel.RenderFn>;
21
- default: any;
22
- };
23
- context: {
24
- type: import("vue").PropType<any>;
25
- default: any;
26
- };
27
- args: {
28
- type: import("vue").PropType<any[]>;
29
- default: () => any[];
30
- };
31
- pure: {
32
- type: import("vue").PropType<boolean>;
33
- default: boolean;
34
- };
35
- row: {
36
- type: ObjectConstructor;
37
- default: () => void;
38
- };
39
- index: {
40
- type: NumberConstructor;
41
- };
42
- }, () => any, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<{
43
- renderFn: {
44
- type: import("vue").PropType<PageModel.RenderFn>;
45
- default: any;
46
- };
47
- context: {
48
- type: import("vue").PropType<any>;
49
- default: any;
50
- };
51
- args: {
52
- type: import("vue").PropType<any[]>;
53
- default: () => any[];
54
- };
55
- pure: {
56
- type: import("vue").PropType<boolean>;
57
- default: boolean;
58
- };
59
- row: {
60
- type: ObjectConstructor;
61
- default: () => void;
62
- };
63
- index: {
64
- type: NumberConstructor;
65
- };
66
- }>>, {
67
- context: any;
68
- renderFn: PageModel.RenderFn;
69
- args: any[];
70
- pure: boolean;
71
- row: Record<string, any>;
72
- }, {}>;
73
- FormItemRenderer: import("vue").DefineComponent<{
74
- modelValue: any;
75
- renderFn: {
76
- type: import("vue").PropType<PageModel.RenderFn>;
77
- default: any;
78
- };
79
- change: {
80
- type: import("vue").PropType<(...rest: any[]) => void>;
81
- default: any;
82
- };
83
- options: {
84
- type: import("vue").PropType<any>;
85
- default: () => void;
86
- };
87
- context: {
88
- type: import("vue").PropType<any>;
89
- default: () => void;
90
- };
91
- disabled: {
92
- type: import("vue").PropType<boolean>;
93
- default: any;
94
- };
95
- model: {
96
- type: import("vue").PropType<AnyObject>;
97
- default: () => {};
98
- };
99
- multProps: {
100
- type: import("vue").PropType<string[]>;
101
- default: any;
102
- };
103
- }, () => import("vue").VNode<import("vue").RendererNode, import("vue").RendererElement, {
104
- [key: string]: any;
105
- }>, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<{
106
- modelValue: any;
107
- renderFn: {
108
- type: import("vue").PropType<PageModel.RenderFn>;
109
- default: any;
110
- };
111
- change: {
112
- type: import("vue").PropType<(...rest: any[]) => void>;
113
- default: any;
114
- };
115
- options: {
116
- type: import("vue").PropType<any>;
117
- default: () => void;
118
- };
119
- context: {
120
- type: import("vue").PropType<any>;
121
- default: () => void;
122
- };
123
- disabled: {
124
- type: import("vue").PropType<boolean>;
125
- default: any;
126
- };
127
- model: {
128
- type: import("vue").PropType<AnyObject>;
129
- default: () => {};
130
- };
131
- multProps: {
132
- type: import("vue").PropType<string[]>;
133
- default: any;
134
- };
135
- }>>, {
136
- context: any;
137
- renderFn: PageModel.RenderFn;
138
- modelValue: any;
139
- change: (...rest: any[]) => void;
140
- disabled: boolean;
141
- options: any;
142
- model: {};
143
- multProps: string[];
144
- }, {}>;
145
- readonly QuestionFilled: import("vue").DefineComponent<{}, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, import("vue").EmitsOptions, string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{}>>, {}, {}>;
146
- readonly Loading: import("vue").DefineComponent<{}, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, import("vue").EmitsOptions, string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{}>>, {}, {}>;
147
- readonly Edit: import("vue").DefineComponent<{}, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, import("vue").EmitsOptions, string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{}>>, {}, {}>;
148
- }, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<{
149
- els: {
150
- type: ArrayConstructor;
151
- required: true;
152
- };
153
- context: {
154
- type: any;
155
- required: true;
156
- };
157
- }>>, {}, {}>;
158
- export default _sfc_main;