fast-crud-ui3 1.5.16 → 1.5.18-beta
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/lib/assets/fonts/iconfont.d.ts +0 -0
- package/lib/components/checkbox-group/index.d.ts +2 -0
- package/lib/components/checkbox-group/src/fast-checkbox-group.d.ts +72 -0
- package/lib/components/content-dialog/index.d.ts +2 -0
- package/lib/components/content-dialog/src/fast-cell-content.d.ts +83 -0
- package/lib/components/json-viewer/index.d.ts +2 -0
- package/lib/components/json-viewer/src/fast-json-viewer.d.ts +48 -0
- package/lib/components/mapping.d.ts +5 -0
- package/lib/components/object-picker/index.d.ts +2 -0
- package/lib/components/object-picker/src/fast-object-picker.d.ts +132 -0
- package/lib/components/select/index.d.ts +2 -0
- package/lib/components/select/src/fast-select.d.ts +83 -0
- package/lib/components/table/index.d.ts +2 -0
- package/lib/components/table/src/RowConfirm.d.ts +39 -0
- package/lib/components/table/src/dynamic-filter-form.d.ts +118 -0
- package/lib/components/table/src/dynamic-filter-list.d.ts +57 -0
- package/lib/components/table/src/easy-filter.d.ts +118 -0
- package/lib/components/table/src/export-confirm.d.ts +12 -0
- package/lib/components/table/src/quick-filter-form.d.ts +42 -0
- package/lib/components/table/src/row-form.d.ts +33 -0
- package/lib/components/table/src/stored-filter-manager.d.ts +55 -0
- package/lib/components/table/src/stored-filter.d.ts +37 -0
- package/lib/components/table/src/table-head-cell.d.ts +9 -0
- package/lib/components/table/src/table.d.ts +507 -0
- package/lib/components/table/src/util.d.ts +77 -0
- package/lib/components/table-column/config.d.ts +5 -0
- package/lib/components/table-column/index.d.ts +2 -0
- package/lib/components/table-column/src/table-column.d.ts +256 -0
- package/lib/components/table-column-date-picker/config.d.ts +5 -0
- package/lib/components/table-column-date-picker/index.d.ts +2 -0
- package/lib/components/table-column-date-picker/src/table-column-date-picker.d.ts +173 -0
- package/lib/components/table-column-file/config.d.ts +5 -0
- package/lib/components/table-column-file/index.d.ts +2 -0
- package/lib/components/table-column-file/src/table-column-file.d.ts +285 -0
- package/lib/components/table-column-img/config.d.ts +5 -0
- package/lib/components/table-column-img/index.d.ts +2 -0
- package/lib/components/table-column-img/src/table-column-img.d.ts +285 -0
- package/lib/components/table-column-input/config.d.ts +5 -0
- package/lib/components/table-column-input/index.d.ts +2 -0
- package/lib/components/table-column-input/src/table-column-input.d.ts +173 -0
- package/lib/components/table-column-number/config.d.ts +5 -0
- package/lib/components/table-column-number/index.d.ts +2 -0
- package/lib/components/table-column-number/src/table-column-number.d.ts +173 -0
- package/lib/components/table-column-object/config.d.ts +5 -0
- package/lib/components/table-column-object/index.d.ts +2 -0
- package/lib/components/table-column-object/src/table-column-object.d.ts +315 -0
- package/lib/components/table-column-select/config.d.ts +5 -0
- package/lib/components/table-column-select/index.d.ts +2 -0
- package/lib/components/table-column-select/src/table-column-select.d.ts +276 -0
- package/lib/components/table-column-switch/config.d.ts +5 -0
- package/lib/components/table-column-switch/index.d.ts +2 -0
- package/lib/components/table-column-switch/src/table-column-switch.d.ts +175 -0
- package/lib/components/table-column-textarea/config.d.ts +5 -0
- package/lib/components/table-column-textarea/index.d.ts +2 -0
- package/lib/components/table-column-textarea/src/table-column-textarea.d.ts +173 -0
- package/lib/components/table-column-time-picker/config.d.ts +5 -0
- package/lib/components/table-column-time-picker/index.d.ts +2 -0
- package/lib/components/table-column-time-picker/src/table-column-time-picker.d.ts +173 -0
- package/lib/components/upload/index.d.ts +2 -0
- package/lib/components/upload/src/fast-upload.d.ts +120 -0
- package/lib/fast-crud-ui3.cjs.js +44 -17
- package/lib/fast-crud-ui3.es.js +9991 -5946
- package/lib/fast-crud-ui3.umd.js +44 -17
- package/lib/global.d.ts +42 -0
- package/lib/index.d.ts +56 -0
- package/lib/mixins/table-column.d.ts +104 -0
- package/lib/mixins/upload.d.ts +15 -0
- package/lib/model/cond.d.ts +48 -0
- package/lib/model/editComponentConfig.d.ts +25 -0
- package/lib/model/fastTableOption.d.ts +513 -0
- package/lib/model/filterComponentConfig.d.ts +55 -0
- package/lib/model/opt.d.ts +20 -0
- package/lib/model/order.d.ts +28 -0
- package/lib/model/pageQuery.d.ts +43 -0
- package/lib/model/query.d.ts +101 -0
- package/lib/model/rel.d.ts +5 -0
- package/lib/style.css +1 -1
- package/lib/util/cache.d.ts +17 -0
- package/lib/util/dialog.d.ts +49 -0
- package/lib/util/escape.d.ts +7 -0
- package/lib/util/http.d.ts +8 -0
- package/lib/util/pick.d.ts +9 -0
- package/lib/util/util.d.ts +311 -0
- package/package.json +19 -5
- package/packages/assets/fonts/iconfont.css +163 -0
- package/packages/assets/fonts/iconfont.js +1 -0
- package/packages/assets/fonts/iconfont.ttf +0 -0
- package/packages/assets/fonts/iconfont.woff +0 -0
- package/packages/assets/fonts/iconfont.woff2 +0 -0
- package/packages/components/checkbox-group/index.js +7 -0
- package/packages/components/checkbox-group/src/fast-checkbox-group.vue +83 -0
- package/packages/components/content-dialog/index.js +7 -0
- package/packages/components/content-dialog/src/fast-cell-content.vue +115 -0
- package/packages/components/json-viewer/index.js +7 -0
- package/packages/components/json-viewer/src/fast-json-viewer.vue +54 -0
- package/packages/components/mapping.js +95 -0
- package/packages/components/object-picker/index.js +7 -0
- package/packages/components/object-picker/src/fast-object-picker.vue +170 -0
- package/packages/components/select/index.js +7 -0
- package/packages/components/select/src/fast-select.vue +90 -0
- package/packages/components/table/index.js +7 -0
- package/packages/components/table/src/RowConfirm.vue +87 -0
- package/packages/components/table/src/dynamic-filter-form.vue +253 -0
- package/packages/components/table/src/dynamic-filter-list.vue +172 -0
- package/packages/components/table/src/easy-filter.vue +129 -0
- package/packages/components/table/src/export-confirm.vue +55 -0
- package/packages/components/table/src/quick-filter-form.vue +140 -0
- package/packages/components/table/src/row-form.vue +137 -0
- package/packages/components/table/src/stored-filter-manager.vue +240 -0
- package/packages/components/table/src/stored-filter.vue +180 -0
- package/packages/components/table/src/table-head-cell.vue +41 -0
- package/packages/components/table/src/table.vue +1309 -0
- package/packages/components/table/src/util.js +496 -0
- package/packages/components/table-column/config.js +64 -0
- package/packages/components/table-column/index.js +7 -0
- package/packages/components/table-column/src/table-column.vue +44 -0
- package/packages/components/table-column-date-picker/config.js +139 -0
- package/packages/components/table-column-date-picker/index.js +7 -0
- package/packages/components/table-column-date-picker/src/table-column-date-picker.vue +54 -0
- package/packages/components/table-column-file/config.js +83 -0
- package/packages/components/table-column-file/index.js +7 -0
- package/packages/components/table-column-file/src/table-column-file.vue +79 -0
- package/packages/components/table-column-img/config.js +83 -0
- package/packages/components/table-column-img/index.js +7 -0
- package/packages/components/table-column-img/src/table-column-img.vue +82 -0
- package/packages/components/table-column-input/config.js +77 -0
- package/packages/components/table-column-input/index.js +7 -0
- package/packages/components/table-column-input/src/table-column-input.vue +60 -0
- package/packages/components/table-column-number/config.js +89 -0
- package/packages/components/table-column-number/index.js +7 -0
- package/packages/components/table-column-number/src/table-column-number.vue +54 -0
- package/packages/components/table-column-object/config.js +66 -0
- package/packages/components/table-column-object/index.js +7 -0
- package/packages/components/table-column-object/src/table-column-object.vue +75 -0
- package/packages/components/table-column-select/config.js +67 -0
- package/packages/components/table-column-select/index.js +7 -0
- package/packages/components/table-column-select/src/table-column-select.vue +101 -0
- package/packages/components/table-column-switch/config.js +55 -0
- package/packages/components/table-column-switch/index.js +7 -0
- package/packages/components/table-column-switch/src/table-column-switch.vue +82 -0
- package/packages/components/table-column-textarea/config.js +77 -0
- package/packages/components/table-column-textarea/index.js +7 -0
- package/packages/components/table-column-textarea/src/table-column-textarea.vue +56 -0
- package/packages/components/table-column-time-picker/config.js +62 -0
- package/packages/components/table-column-time-picker/index.js +7 -0
- package/packages/components/table-column-time-picker/src/table-column-time-picker.vue +53 -0
- package/packages/components/upload/index.js +7 -0
- package/packages/components/upload/src/fast-upload.vue +272 -0
- package/packages/global.d.ts +42 -0
- package/packages/index.js +145 -0
- package/packages/mixins/table-column.js +133 -0
- package/packages/mixins/upload.js +14 -0
- package/packages/model/cond.js +74 -0
- package/packages/model/editComponentConfig.js +72 -0
- package/packages/model/fastTableOption.js +769 -0
- package/packages/model/filterComponentConfig.js +191 -0
- package/packages/model/opt.js +21 -0
- package/packages/model/order.js +37 -0
- package/packages/model/pageQuery.js +52 -0
- package/packages/model/query.js +161 -0
- package/packages/model/rel.js +5 -0
- package/packages/style.scss +5 -0
- package/packages/util/cache.js +92 -0
- package/packages/util/dialog.js +133 -0
- package/packages/util/escape.js +34 -0
- package/packages/util/http.js +18 -0
- package/packages/util/pick.js +92 -0
- package/packages/util/util.js +892 -0
|
@@ -0,0 +1,513 @@
|
|
|
1
|
+
import { default as Cond } from './cond.js';
|
|
2
|
+
export default FastTableOption;
|
|
3
|
+
export type ComponentInstance = import('vue').ComponentPublicInstance;
|
|
4
|
+
/**
|
|
5
|
+
* @typedef {import('vue').ComponentPublicInstance} ComponentInstance
|
|
6
|
+
*/
|
|
7
|
+
declare class FastTableOption {
|
|
8
|
+
static $http: any;
|
|
9
|
+
static $router: any;
|
|
10
|
+
constructor({ context, id, title, showTitle, module, baseUrl, pageUrl, listUrl, insertUrl, batchInsertUrl, updateUrl, batchUpdateUrl, deleteUrl, batchDeleteUrl, uploadUrl, exportUrl, existsUrl, enableDblClickEdit, enableMulti, enableIndex, enableColumnFilter, enableFilterCache, lazyLoad, editType, queryable, insertable, updatable, deletable, exportable, idField, createTimeField, sortField, sortDesc, moreButtons, pagination, style, render, conds, condGroups, condExtra, beforeReset, beforeLoad, loadSuccess, loadFail, beforeToInsert, beforeInsert, insertSuccess, insertFail, beforeToUpdate, beforeUpdate, updateSuccess, updateFail, beforeDeleteTip, beforeDelete, deleteSuccess, deleteFail, beforeCancel, beforeExport, exportSuccess, exportFail }: {
|
|
11
|
+
context: any;
|
|
12
|
+
id?: string;
|
|
13
|
+
title?: string;
|
|
14
|
+
showTitle?: boolean;
|
|
15
|
+
module?: string;
|
|
16
|
+
baseUrl?: string;
|
|
17
|
+
pageUrl?: string;
|
|
18
|
+
listUrl?: string;
|
|
19
|
+
insertUrl?: string;
|
|
20
|
+
batchInsertUrl?: string;
|
|
21
|
+
updateUrl?: string;
|
|
22
|
+
batchUpdateUrl?: string;
|
|
23
|
+
deleteUrl?: string;
|
|
24
|
+
batchDeleteUrl?: string;
|
|
25
|
+
uploadUrl?: string;
|
|
26
|
+
exportUrl?: string;
|
|
27
|
+
existsUrl?: string;
|
|
28
|
+
enableDblClickEdit?: boolean;
|
|
29
|
+
enableMulti?: boolean;
|
|
30
|
+
enableIndex?: boolean;
|
|
31
|
+
enableColumnFilter?: boolean;
|
|
32
|
+
enableFilterCache?: boolean;
|
|
33
|
+
lazyLoad?: boolean;
|
|
34
|
+
editType?: string;
|
|
35
|
+
queryable?: boolean;
|
|
36
|
+
insertable?: boolean;
|
|
37
|
+
updatable?: boolean;
|
|
38
|
+
deletable?: boolean;
|
|
39
|
+
exportable?: boolean;
|
|
40
|
+
idField?: string;
|
|
41
|
+
createTimeField?: string;
|
|
42
|
+
sortField?: string;
|
|
43
|
+
sortDesc?: boolean;
|
|
44
|
+
moreButtons?: any[];
|
|
45
|
+
pagination?: {
|
|
46
|
+
layout: string;
|
|
47
|
+
'page-sizes': number[];
|
|
48
|
+
size: number;
|
|
49
|
+
};
|
|
50
|
+
style?: {};
|
|
51
|
+
render?: () => any[];
|
|
52
|
+
conds?: any[];
|
|
53
|
+
condGroups?: any[];
|
|
54
|
+
condExtra?: {};
|
|
55
|
+
beforeReset?: ({ query }: {
|
|
56
|
+
query: any;
|
|
57
|
+
}) => Promise<void>;
|
|
58
|
+
beforeLoad?: ({ query }: {
|
|
59
|
+
query: any;
|
|
60
|
+
}) => Promise<void>;
|
|
61
|
+
loadSuccess?: ({ query, res }: {
|
|
62
|
+
query: any;
|
|
63
|
+
res: any;
|
|
64
|
+
}) => Promise<any>;
|
|
65
|
+
loadFail?: ({ query, error }: {
|
|
66
|
+
query: any;
|
|
67
|
+
error: any;
|
|
68
|
+
}) => Promise<void>;
|
|
69
|
+
beforeToInsert?: (rows: any) => Promise<void>;
|
|
70
|
+
beforeInsert?: ({ fatRows, rows, editRows }: {
|
|
71
|
+
fatRows: any;
|
|
72
|
+
rows: any;
|
|
73
|
+
editRows: any;
|
|
74
|
+
}) => Promise<any>;
|
|
75
|
+
insertSuccess?: ({ fatRows, rows, editRows, res }: {
|
|
76
|
+
fatRows: any;
|
|
77
|
+
rows: any;
|
|
78
|
+
editRows: any;
|
|
79
|
+
res: any;
|
|
80
|
+
}) => Promise<void>;
|
|
81
|
+
insertFail?: ({ fatRows, rows, editRows, error }: {
|
|
82
|
+
fatRows: any;
|
|
83
|
+
rows: any;
|
|
84
|
+
editRows: any;
|
|
85
|
+
error: any;
|
|
86
|
+
}) => Promise<void>;
|
|
87
|
+
beforeToUpdate?: ({ fatRows, rows }: {
|
|
88
|
+
fatRows: any;
|
|
89
|
+
rows: any;
|
|
90
|
+
}) => Promise<void>;
|
|
91
|
+
beforeUpdate?: ({ fatRows, rows, editRows }: {
|
|
92
|
+
fatRows: any;
|
|
93
|
+
rows: any;
|
|
94
|
+
editRows: any;
|
|
95
|
+
}) => Promise<any>;
|
|
96
|
+
updateSuccess?: ({ fatRows, rows, editRows, res }: {
|
|
97
|
+
fatRows: any;
|
|
98
|
+
rows: any;
|
|
99
|
+
editRows: any;
|
|
100
|
+
res: any;
|
|
101
|
+
}) => Promise<void>;
|
|
102
|
+
updateFail?: ({ fatRows, rows, editRows, error }: {
|
|
103
|
+
fatRows: any;
|
|
104
|
+
rows: any;
|
|
105
|
+
editRows: any;
|
|
106
|
+
error: any;
|
|
107
|
+
}) => Promise<void>;
|
|
108
|
+
beforeDeleteTip?: ({ fatRows, rows }: {
|
|
109
|
+
fatRows: any;
|
|
110
|
+
rows: any;
|
|
111
|
+
}) => Promise<void>;
|
|
112
|
+
beforeDelete?: ({ fatRows, rows }: {
|
|
113
|
+
fatRows: any;
|
|
114
|
+
rows: any;
|
|
115
|
+
}) => Promise<any>;
|
|
116
|
+
deleteSuccess?: ({ fatRows, rows, res }: {
|
|
117
|
+
fatRows: any;
|
|
118
|
+
rows: any;
|
|
119
|
+
res: any;
|
|
120
|
+
}) => Promise<void>;
|
|
121
|
+
deleteFail?: ({ fatRows, rows, error }: {
|
|
122
|
+
fatRows: any;
|
|
123
|
+
rows: any;
|
|
124
|
+
error: any;
|
|
125
|
+
}) => Promise<void>;
|
|
126
|
+
beforeCancel?: ({ fatRows, rows, status }: {
|
|
127
|
+
fatRows: any;
|
|
128
|
+
rows: any;
|
|
129
|
+
status: any;
|
|
130
|
+
}) => Promise<void>;
|
|
131
|
+
beforeExport?: ({ columns, pageQuery }: {
|
|
132
|
+
columns: any;
|
|
133
|
+
pageQuery: any;
|
|
134
|
+
}) => Promise<any>;
|
|
135
|
+
exportSuccess?: ({ columns, pageQuery, data }: {
|
|
136
|
+
columns: any;
|
|
137
|
+
pageQuery: any;
|
|
138
|
+
data: any;
|
|
139
|
+
}) => Promise<void>;
|
|
140
|
+
exportFail?: ({ columns, pageQuery, error }: {
|
|
141
|
+
columns: any;
|
|
142
|
+
pageQuery: any;
|
|
143
|
+
error: any;
|
|
144
|
+
}) => Promise<void>;
|
|
145
|
+
});
|
|
146
|
+
/**
|
|
147
|
+
* 当前组件。一般配置当前组件(this), 这样钩子函数中可以使用this
|
|
148
|
+
* @type {ComponentInstance | null}
|
|
149
|
+
*/
|
|
150
|
+
context: ComponentInstance | null;
|
|
151
|
+
ref: any;
|
|
152
|
+
/**
|
|
153
|
+
* 唯一id值。用于浏览器缓存时不同fast-table之间的隔离,不配置则内部默认生成(取baseUrl)
|
|
154
|
+
* @type {string}
|
|
155
|
+
*/
|
|
156
|
+
id: string;
|
|
157
|
+
/**
|
|
158
|
+
* 表格标题。配置后默认会显示在表格上方
|
|
159
|
+
* @type {string}
|
|
160
|
+
*/
|
|
161
|
+
title: string;
|
|
162
|
+
/**
|
|
163
|
+
* 是否显示标题。默认true
|
|
164
|
+
* @type {boolean}
|
|
165
|
+
*/
|
|
166
|
+
showTitle: boolean;
|
|
167
|
+
/**
|
|
168
|
+
* 表格Rest接口的根path。
|
|
169
|
+
* @type {string}
|
|
170
|
+
*/
|
|
171
|
+
baseUrl: string;
|
|
172
|
+
/**
|
|
173
|
+
* 表格分页接口path。默认 ${baseUrl}/page
|
|
174
|
+
* @type {string}
|
|
175
|
+
*/
|
|
176
|
+
pageUrl: string;
|
|
177
|
+
/**
|
|
178
|
+
* 列表url: 默认为${baseUrl}/list
|
|
179
|
+
* @type {string}
|
|
180
|
+
*/
|
|
181
|
+
listUrl: string;
|
|
182
|
+
/**
|
|
183
|
+
* 新增url: 默认为${baseUrl}/insert
|
|
184
|
+
* @type {string}
|
|
185
|
+
*/
|
|
186
|
+
insertUrl: string;
|
|
187
|
+
/**
|
|
188
|
+
* 批量新增url: 默认为${baseUrl}/insert/batch
|
|
189
|
+
* @type {string}
|
|
190
|
+
*/
|
|
191
|
+
batchInsertUrl: string;
|
|
192
|
+
/**
|
|
193
|
+
* 更新url: 默认为${baseUrl}/update
|
|
194
|
+
* @type {string}
|
|
195
|
+
*/
|
|
196
|
+
updateUrl: string;
|
|
197
|
+
/**
|
|
198
|
+
* 批量更新url: 默认为${baseUrl}/update/batch
|
|
199
|
+
* @type {string}
|
|
200
|
+
*/
|
|
201
|
+
batchUpdateUrl: string;
|
|
202
|
+
/**
|
|
203
|
+
* 删除url: 默认为${baseUrl}/delete
|
|
204
|
+
* @type {string}
|
|
205
|
+
*/
|
|
206
|
+
deleteUrl: string;
|
|
207
|
+
/**
|
|
208
|
+
* 批量删除url: 默认为${baseUrl}/delete/batch
|
|
209
|
+
* @type {string}
|
|
210
|
+
*/
|
|
211
|
+
batchDeleteUrl: string;
|
|
212
|
+
/**
|
|
213
|
+
* 文件上传接口: 默认为${baseUrl}/upload
|
|
214
|
+
* @type {string}
|
|
215
|
+
*/
|
|
216
|
+
uploadUrl: string;
|
|
217
|
+
/**
|
|
218
|
+
* 数据导出接口: 默认为${baseUrl}/export
|
|
219
|
+
* @type {string}
|
|
220
|
+
*/
|
|
221
|
+
exportUrl: string;
|
|
222
|
+
/**
|
|
223
|
+
* 存在性判断接口path: 默认为${baseUrl}/exists
|
|
224
|
+
* @type {string}
|
|
225
|
+
*/
|
|
226
|
+
existsUrl: string;
|
|
227
|
+
/**
|
|
228
|
+
* 是否启用双击编辑。默认true
|
|
229
|
+
* @type {boolean}
|
|
230
|
+
*/
|
|
231
|
+
enableDblClickEdit: boolean;
|
|
232
|
+
/**
|
|
233
|
+
* 是否启用表格多选。默认启用
|
|
234
|
+
* @type {boolean}
|
|
235
|
+
*/
|
|
236
|
+
enableMulti: boolean;
|
|
237
|
+
/**
|
|
238
|
+
* 是否启用序号列
|
|
239
|
+
* @type {boolean}
|
|
240
|
+
*/
|
|
241
|
+
enableIndex: boolean;
|
|
242
|
+
/**
|
|
243
|
+
* 启用列过滤:即动筛。默认启用,若为false, 则表头均无法点击
|
|
244
|
+
* @type {boolean}
|
|
245
|
+
*/
|
|
246
|
+
enableColumnFilter: boolean;
|
|
247
|
+
/**
|
|
248
|
+
* 是否启用过滤条件缓存(页面刷新后过滤条件不丢失),若为true则缓存到session中,有效期为会话。默认启用
|
|
249
|
+
* @type {boolean}
|
|
250
|
+
*/
|
|
251
|
+
enableFilterCache: boolean;
|
|
252
|
+
/**
|
|
253
|
+
* 是否延迟加载分页数据,即不立即加载数据。默认false,若设置true, 则表格渲染后不立即加载数据,需要手动触发加载。
|
|
254
|
+
* @type {boolean}
|
|
255
|
+
*/
|
|
256
|
+
lazyLoad: boolean;
|
|
257
|
+
/**
|
|
258
|
+
* 编辑模式。可选值: inline/form, 默认为inline,即双击行内编辑,若配置为form,则双击将打开弹窗。
|
|
259
|
+
* @type {string}
|
|
260
|
+
*/
|
|
261
|
+
editType: string;
|
|
262
|
+
/**
|
|
263
|
+
* 是否允许分页查询。默认为true。若为false, 则查询等按钮会隐藏, 一般静态表格(前端静态数据)有用。
|
|
264
|
+
* @type {boolean}
|
|
265
|
+
*/
|
|
266
|
+
queryable: boolean;
|
|
267
|
+
/**
|
|
268
|
+
* 是否支持内置新建功能。默认为true
|
|
269
|
+
* @type {boolean}
|
|
270
|
+
*/
|
|
271
|
+
insertable: boolean;
|
|
272
|
+
/**
|
|
273
|
+
* 是否支持内置编辑。默认true
|
|
274
|
+
* @type {boolean}
|
|
275
|
+
*/
|
|
276
|
+
updatable: boolean;
|
|
277
|
+
/**
|
|
278
|
+
* 是否支持内置删除。默认true
|
|
279
|
+
* @type {boolean}
|
|
280
|
+
*/
|
|
281
|
+
deletable: boolean;
|
|
282
|
+
/**
|
|
283
|
+
* 是否支持导出。默认true
|
|
284
|
+
* @type {boolean}
|
|
285
|
+
*/
|
|
286
|
+
exportable: boolean;
|
|
287
|
+
/**
|
|
288
|
+
* 主键字段名。默认为"id"。必须正确设置,否则更新、删除等功能无法使用。
|
|
289
|
+
* @type {string}
|
|
290
|
+
*/
|
|
291
|
+
idField: string;
|
|
292
|
+
/**
|
|
293
|
+
* "创建时间"的字段名。如果配置了,则内部动态构造3个存筛(当天/当周/当月), 此值必须为显示列
|
|
294
|
+
* @type {string}
|
|
295
|
+
*/
|
|
296
|
+
createTimeField: string;
|
|
297
|
+
/**
|
|
298
|
+
* TODO 待实现 父子表级联(父表取choseRow作为选中的行)
|
|
299
|
+
* @type {{map: Object | ObjectConstructor, option: FastTableOption}}
|
|
300
|
+
*/
|
|
301
|
+
parent: {
|
|
302
|
+
map: any | ObjectConstructor;
|
|
303
|
+
option: FastTableOption;
|
|
304
|
+
};
|
|
305
|
+
/**
|
|
306
|
+
* 表格默认的排序字段。默认依次取createTimeField、idField
|
|
307
|
+
*/
|
|
308
|
+
sortField: any;
|
|
309
|
+
/**
|
|
310
|
+
* 降序。若为false, 则为升序
|
|
311
|
+
* @type {boolean}
|
|
312
|
+
*/
|
|
313
|
+
sortDesc: boolean;
|
|
314
|
+
/**
|
|
315
|
+
* 配置【更多】下拉功能按钮。定义: {label: String, click: Function<Promise>, icon: Component, showable: Boolean|Function<Boolean>, disable: Boolean|Function<Boolean>, }
|
|
316
|
+
* @type {[]}
|
|
317
|
+
*/
|
|
318
|
+
moreButtons: [];
|
|
319
|
+
/**
|
|
320
|
+
* 分页条配置
|
|
321
|
+
* @type {{layout: string, size: number, "page-sizes": number[]}}
|
|
322
|
+
*/
|
|
323
|
+
pagination: {
|
|
324
|
+
layout: string;
|
|
325
|
+
size: number;
|
|
326
|
+
"page-sizes": number[];
|
|
327
|
+
};
|
|
328
|
+
/**
|
|
329
|
+
* 样式配置
|
|
330
|
+
* @type {{flexHeight: boolean, quickFilterGridGap: string, formLabelWidth: string, formLayout: null, quickFilterSpan: number, bodyRowHeight: string, size: string}}
|
|
331
|
+
*/
|
|
332
|
+
style: {
|
|
333
|
+
flexHeight: boolean;
|
|
334
|
+
quickFilterGridGap: string;
|
|
335
|
+
formLabelWidth: string;
|
|
336
|
+
formLayout: null;
|
|
337
|
+
quickFilterSpan: number;
|
|
338
|
+
bodyRowHeight: string;
|
|
339
|
+
size: string;
|
|
340
|
+
};
|
|
341
|
+
/**
|
|
342
|
+
* render函数。当前FastTableOption对应的表格若被pick时有用
|
|
343
|
+
* @type {Function}
|
|
344
|
+
*/
|
|
345
|
+
render: Function;
|
|
346
|
+
/**
|
|
347
|
+
* 内置固定的筛选条件。将始终在分页查询条件里,无法被用户取消
|
|
348
|
+
* @type {Cond[]}
|
|
349
|
+
*/
|
|
350
|
+
conds: Cond[];
|
|
351
|
+
/**
|
|
352
|
+
* 开发者预置的条件组——即存筛,例如: [{label: '成年男孩', conds: [{col: 'sex', val: '1'}, {col: 'age', opt: Opt.LE, val: 18}]}] <br/>
|
|
353
|
+
* 注意: 要求conds中每个col都必须启用了filter,只要有一项未启用则整个筛选组无效。
|
|
354
|
+
* @type {[]}
|
|
355
|
+
*/
|
|
356
|
+
condGroups: [];
|
|
357
|
+
/**
|
|
358
|
+
* 扩展的查询条件, 可配合#quickFilter插槽使用。例如配置了keyword(表格中并不存在此列), 则可将query.extra.keyword绑定到自定义输入控件上,
|
|
359
|
+
* 后端配合针对此值做自定义筛选功能。
|
|
360
|
+
* @type {{}}
|
|
361
|
+
*/
|
|
362
|
+
condExtra: {};
|
|
363
|
+
/**
|
|
364
|
+
* 重置按钮点击前触发的钩子函数
|
|
365
|
+
* @type {Function}
|
|
366
|
+
*/
|
|
367
|
+
beforeReset: Function;
|
|
368
|
+
/**
|
|
369
|
+
* 分页请求前触发的钩子函数
|
|
370
|
+
* @type {Function}
|
|
371
|
+
*/
|
|
372
|
+
beforeLoad: Function;
|
|
373
|
+
/**
|
|
374
|
+
* 分页请求成功后的钩子函数
|
|
375
|
+
* @type {Function}
|
|
376
|
+
*/
|
|
377
|
+
loadSuccess: Function;
|
|
378
|
+
/**
|
|
379
|
+
* 分页请求失败后的钩子函数
|
|
380
|
+
* @type {Function}
|
|
381
|
+
*/
|
|
382
|
+
loadFail: Function;
|
|
383
|
+
/**
|
|
384
|
+
* 进入新建前(行内模式新增一行前,表单模式为弹窗前)的钩子函数
|
|
385
|
+
* @type {Function}
|
|
386
|
+
*/
|
|
387
|
+
beforeToInsert: Function;
|
|
388
|
+
/**
|
|
389
|
+
* 插入请求前执行的钩子函数
|
|
390
|
+
* @type {Function}
|
|
391
|
+
*/
|
|
392
|
+
beforeInsert: Function;
|
|
393
|
+
/**
|
|
394
|
+
* 插入成功后的钩子函数
|
|
395
|
+
* @type {Function}
|
|
396
|
+
*/
|
|
397
|
+
insertSuccess: Function;
|
|
398
|
+
/**
|
|
399
|
+
* 插入失败后的钩子函数
|
|
400
|
+
* @type {Function}
|
|
401
|
+
*/
|
|
402
|
+
insertFail: Function;
|
|
403
|
+
/**
|
|
404
|
+
* 进入更新模式前的钩子函数(行内模式为行切换为可编辑模式前,表单模式为弹窗前)
|
|
405
|
+
* @type {Function}
|
|
406
|
+
*/
|
|
407
|
+
beforeToUpdate: Function;
|
|
408
|
+
/**
|
|
409
|
+
* 更新请求前的钩子函数
|
|
410
|
+
* @type {Function}
|
|
411
|
+
*/
|
|
412
|
+
beforeUpdate: Function;
|
|
413
|
+
/**
|
|
414
|
+
* 更新成功后的钩子函数。
|
|
415
|
+
* @type {Function}
|
|
416
|
+
*/
|
|
417
|
+
updateSuccess: Function;
|
|
418
|
+
/**
|
|
419
|
+
* 更新失败后的钩子函数
|
|
420
|
+
* @type {Function}
|
|
421
|
+
*/
|
|
422
|
+
updateFail: Function;
|
|
423
|
+
/**
|
|
424
|
+
* 删除提示前的钩子函数
|
|
425
|
+
* @type {Function}
|
|
426
|
+
*/
|
|
427
|
+
beforeDeleteTip: Function;
|
|
428
|
+
/**
|
|
429
|
+
* 删除请求前的钩子函数
|
|
430
|
+
* @type {Function}
|
|
431
|
+
*/
|
|
432
|
+
beforeDelete: Function;
|
|
433
|
+
/**
|
|
434
|
+
* 删除请求成功后的钩子函数
|
|
435
|
+
* @type {Function}
|
|
436
|
+
*/
|
|
437
|
+
deleteSuccess: Function;
|
|
438
|
+
/**
|
|
439
|
+
* 删除请求失败后的钩子函数
|
|
440
|
+
* @type {Function}
|
|
441
|
+
*/
|
|
442
|
+
deleteFail: Function;
|
|
443
|
+
/**
|
|
444
|
+
* 点击取消按钮前的钩子函数(处于新建、编辑模式时会有取消按钮)
|
|
445
|
+
* @type {Function}
|
|
446
|
+
*/
|
|
447
|
+
beforeCancel: Function;
|
|
448
|
+
/**
|
|
449
|
+
* 导出请求前的钩子函数
|
|
450
|
+
* @type {Function}
|
|
451
|
+
*/
|
|
452
|
+
beforeExport: Function;
|
|
453
|
+
/**
|
|
454
|
+
* 导出成功后的钩子函数
|
|
455
|
+
* @type {Function}
|
|
456
|
+
*/
|
|
457
|
+
exportSuccess: Function;
|
|
458
|
+
/**
|
|
459
|
+
* 导出失败后的钩子函数
|
|
460
|
+
* @type Function
|
|
461
|
+
*/
|
|
462
|
+
exportFail: Function;
|
|
463
|
+
/**
|
|
464
|
+
* 向内置条件组中增加条件
|
|
465
|
+
* @param cond
|
|
466
|
+
* @param repeatable 是否允许重复的col, 默认false, 即若多次添加相同col的条件, 只会保留最新的
|
|
467
|
+
* @return {FastTableOption} 返回当前对象
|
|
468
|
+
*/
|
|
469
|
+
addCond(cond: any, repeatable?: boolean): FastTableOption;
|
|
470
|
+
/**
|
|
471
|
+
* 从内置条件组中移除条件
|
|
472
|
+
* @param col {string} 字段名
|
|
473
|
+
* @return {FastTableOption} 返回当前对象
|
|
474
|
+
*/
|
|
475
|
+
removeCond(col: string): FastTableOption;
|
|
476
|
+
/**
|
|
477
|
+
* 新增行, 返回promise
|
|
478
|
+
* @param fatRows
|
|
479
|
+
* @returns {Promise<void>|Promise<unknown>}
|
|
480
|
+
*/
|
|
481
|
+
_insertRows(fatRows: any): Promise<void> | Promise<unknown>;
|
|
482
|
+
/**
|
|
483
|
+
* 更新行
|
|
484
|
+
* @param fatRows
|
|
485
|
+
* @return 返回promise, 若成功更新则resolve; 若失败或取消, 则返回reject err或用户自定义的内容
|
|
486
|
+
*/
|
|
487
|
+
_updateRows(fatRows: any): Promise<any>;
|
|
488
|
+
/**
|
|
489
|
+
* 列表查询
|
|
490
|
+
* @param query 查询条件 Query类型
|
|
491
|
+
* @param config
|
|
492
|
+
*/
|
|
493
|
+
_list(query: any, config: any): any;
|
|
494
|
+
/**
|
|
495
|
+
* 导出
|
|
496
|
+
* @param columnConfigs
|
|
497
|
+
* @param pageQuery
|
|
498
|
+
*/
|
|
499
|
+
_exportData(columnConfigs: any, pageQuery: any): void;
|
|
500
|
+
/**
|
|
501
|
+
* 存在性判断
|
|
502
|
+
*/
|
|
503
|
+
_exist(conds?: any[]): Promise<any>;
|
|
504
|
+
/**
|
|
505
|
+
* 利用/list接口构造选项列表数据
|
|
506
|
+
* @param query
|
|
507
|
+
* @param valKey
|
|
508
|
+
* @param labelKey
|
|
509
|
+
* @param forceRefresh 是否强制刷新,若true则跳过缓存
|
|
510
|
+
* @return {Promise<*>}
|
|
511
|
+
*/
|
|
512
|
+
_buildSelectOptions(query: any, valKey: any, labelKey: any, forceRefresh?: boolean): Promise<any>;
|
|
513
|
+
}
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
import { default as Opt } from './opt.js';
|
|
2
|
+
export default FilterComponentConfig;
|
|
3
|
+
/**
|
|
4
|
+
* 筛选组件配置
|
|
5
|
+
*/
|
|
6
|
+
export type OptValue = (typeof Opt)[keyof typeof Opt];
|
|
7
|
+
/**
|
|
8
|
+
* 筛选组件配置
|
|
9
|
+
* @typedef {typeof Opt[keyof typeof Opt]} OptValue
|
|
10
|
+
*/
|
|
11
|
+
declare class FilterComponentConfig {
|
|
12
|
+
/**
|
|
13
|
+
* 构造函数
|
|
14
|
+
* @param component {string} 组件名
|
|
15
|
+
* @param col {string} 字段名
|
|
16
|
+
* @param opt {OptValue} 操作符
|
|
17
|
+
* @param val {any} 值
|
|
18
|
+
* @param label {string} 中文名
|
|
19
|
+
* @param props {Object} 组件对应的props
|
|
20
|
+
* @param condMapFn {Function} 条件获取过滤函数
|
|
21
|
+
* @param type {string} quick|easy|dynamic
|
|
22
|
+
*/
|
|
23
|
+
constructor({ component, col, opt, val, label, props, condMapFn, type }: string);
|
|
24
|
+
component: any;
|
|
25
|
+
col: any;
|
|
26
|
+
opt: any;
|
|
27
|
+
val: any;
|
|
28
|
+
label: any;
|
|
29
|
+
props: any;
|
|
30
|
+
defaultVal: any;
|
|
31
|
+
disabled: boolean;
|
|
32
|
+
type: any;
|
|
33
|
+
condMapFn: (cond: any) => any[];
|
|
34
|
+
index: number;
|
|
35
|
+
condMsg: string;
|
|
36
|
+
/**
|
|
37
|
+
* 值为默认值
|
|
38
|
+
*/
|
|
39
|
+
isDefaultVal(): boolean;
|
|
40
|
+
/**
|
|
41
|
+
* 此筛选项是否有效
|
|
42
|
+
* @returns {boolean}
|
|
43
|
+
*/
|
|
44
|
+
isEffective(): boolean;
|
|
45
|
+
/**
|
|
46
|
+
* 返回值是否变更
|
|
47
|
+
* @return {boolean}
|
|
48
|
+
*/
|
|
49
|
+
reset(): boolean;
|
|
50
|
+
getConds(): any[];
|
|
51
|
+
/**
|
|
52
|
+
* 更新条件的文本描述, 例如用于回显在dynamic-filter-list上
|
|
53
|
+
*/
|
|
54
|
+
updateCondMsg(): Promise<any>;
|
|
55
|
+
}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
export default Opt;
|
|
2
|
+
declare const Opt: Readonly<{
|
|
3
|
+
EQ: "=";
|
|
4
|
+
NE: "!=";
|
|
5
|
+
GT: ">";
|
|
6
|
+
GE: ">=";
|
|
7
|
+
LT: "<";
|
|
8
|
+
LE: "<=";
|
|
9
|
+
IN: "in";
|
|
10
|
+
NIN: "nin";
|
|
11
|
+
LIKE: "like";
|
|
12
|
+
LLIKE: "llike";
|
|
13
|
+
RLIKE: "rlike";
|
|
14
|
+
NLIKE: "nlike";
|
|
15
|
+
NULL: "null";
|
|
16
|
+
NNULL: "nnull";
|
|
17
|
+
EMPTY: "empty";
|
|
18
|
+
NEMPTY: "nempty";
|
|
19
|
+
BTW: "between";
|
|
20
|
+
}>;
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
export default Order;
|
|
2
|
+
/**
|
|
3
|
+
* 排序对象
|
|
4
|
+
*/
|
|
5
|
+
declare class Order {
|
|
6
|
+
/**
|
|
7
|
+
* 构造器
|
|
8
|
+
* @param col 排序字段
|
|
9
|
+
* @param asc 是否升序,默认false,即降序
|
|
10
|
+
*/
|
|
11
|
+
constructor(col: any, asc?: boolean);
|
|
12
|
+
/**
|
|
13
|
+
* 排序字段(英文字段),需要和后端分页响应的字段名对应
|
|
14
|
+
* @type {string}
|
|
15
|
+
*/
|
|
16
|
+
col: string;
|
|
17
|
+
/**
|
|
18
|
+
* 是否升序
|
|
19
|
+
* @type {boolean}
|
|
20
|
+
*/
|
|
21
|
+
asc: boolean;
|
|
22
|
+
/**
|
|
23
|
+
* 设置是否升序
|
|
24
|
+
* @param asc
|
|
25
|
+
* @return {Order}
|
|
26
|
+
*/
|
|
27
|
+
setAsc(asc: any): Order;
|
|
28
|
+
}
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
import { default as Query } from './query.js';
|
|
2
|
+
export default PageQuery;
|
|
3
|
+
/**
|
|
4
|
+
* 分页请求参数模型
|
|
5
|
+
*/
|
|
6
|
+
declare class PageQuery extends Query {
|
|
7
|
+
/**
|
|
8
|
+
* 构造器
|
|
9
|
+
* @param current 当前页(默认1)
|
|
10
|
+
* @param size 每页条数(默认20)
|
|
11
|
+
*/
|
|
12
|
+
constructor(current?: number, size?: number);
|
|
13
|
+
/**
|
|
14
|
+
* 当前页,默认1
|
|
15
|
+
* @type {number}
|
|
16
|
+
*/
|
|
17
|
+
current: number;
|
|
18
|
+
/**
|
|
19
|
+
* 每页条数,默认20条
|
|
20
|
+
* @type {number}
|
|
21
|
+
*/
|
|
22
|
+
size: number;
|
|
23
|
+
/**
|
|
24
|
+
* 设置每页大小
|
|
25
|
+
* @param size
|
|
26
|
+
*/
|
|
27
|
+
setSize(size: any): this;
|
|
28
|
+
/**
|
|
29
|
+
* 将当前对象转为json
|
|
30
|
+
* @return {{current: number, size: number, conds: *, extra: {[p: string]: null|*}, distinct: *, orders: *, cols: *}}
|
|
31
|
+
*/
|
|
32
|
+
toJson(): {
|
|
33
|
+
current: number;
|
|
34
|
+
size: number;
|
|
35
|
+
conds: any;
|
|
36
|
+
extra: {
|
|
37
|
+
[p: string]: null | any;
|
|
38
|
+
};
|
|
39
|
+
distinct: any;
|
|
40
|
+
orders: any;
|
|
41
|
+
cols: any;
|
|
42
|
+
};
|
|
43
|
+
}
|