@wp1001/ui 2.9.13 → 3.0.1

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.
Files changed (106) hide show
  1. package/@vant-D4fmGxs6.js +1 -3891
  2. package/index.html +28 -0
  3. package/index.js +1 -8419
  4. package/lib/tinymce/zh_CN.js +1 -0
  5. package/package.json +1 -1
  6. package/packages/assets/devtools-detector.js +1 -2
  7. package/packages/components/xarray/index.js +1 -64
  8. package/packages/components/xautorows/index.js +1 -35
  9. package/packages/components/xbutton/mobile.js +1 -3
  10. package/packages/components/xbutton/pc.js +1 -3
  11. package/packages/components/xbuttons/mobile.js +1 -51
  12. package/packages/components/xbuttons/pc.js +1 -51
  13. package/packages/components/xchart/constants.js +1 -58
  14. package/packages/components/xchart/index.js +1 -263
  15. package/packages/components/xchart/utils.js +1 -121
  16. package/packages/components/xcheckboxs/mobile.js +1 -58
  17. package/packages/components/xcheckboxs/pc.js +1 -49
  18. package/packages/components/xcol/mobile.js +1 -10
  19. package/packages/components/xcol/pc.js +1 -10
  20. package/packages/components/xdatepicker/mobile.js +1 -71
  21. package/packages/components/xdatepicker/pc.js +1 -9
  22. package/packages/components/xdialog/mobile.js +1 -60
  23. package/packages/components/xdialog/pc.js +1 -64
  24. package/packages/components/xdict/index.js +1 -47
  25. package/packages/components/xdistrictselect/mobile.js +1 -79
  26. package/packages/components/xdistrictselect/pc.js +1 -127
  27. package/packages/components/xform/mobile.js +1 -29
  28. package/packages/components/xform/pc.js +1 -42
  29. package/packages/components/xform/utils.js +1 -95
  30. package/packages/components/xformitem/mobile.js +1 -56
  31. package/packages/components/xformitem/pc.js +1 -72
  32. package/packages/components/xicon/mobile.js +1 -35
  33. package/packages/components/xicon/pc.js +1 -35
  34. package/packages/components/xinfo/index.js +1 -100
  35. package/packages/components/xlooper/index.js +1 -7
  36. package/packages/components/xpagination/mobile.js +1 -21
  37. package/packages/components/xpagination/pc.js +1 -21
  38. package/packages/components/xpicker/index.js +1 -38
  39. package/packages/components/xradios/mobile.js +1 -40
  40. package/packages/components/xradios/pc.js +1 -53
  41. package/packages/components/xrow/mobile.js +1 -9
  42. package/packages/components/xrow/pc.js +1 -9
  43. package/packages/components/xscan/mobile.js +1 -24
  44. package/packages/components/xscan/pc.js +1 -20
  45. package/packages/components/xsearcher/index.js +1 -198
  46. package/packages/components/xselect/mobile.js +1 -86
  47. package/packages/components/xselect/pc.js +1 -114
  48. package/packages/components/xselect/util.js +1 -66
  49. package/packages/components/xselectv2/index.js +1 -91
  50. package/packages/components/xtable/mobile.js +1 -108
  51. package/packages/components/xtable/pc.js +1 -143
  52. package/packages/components/xtable/searcher.js +1 -477
  53. package/packages/components/xtable/settings.js +1 -80
  54. package/packages/components/xtable/utils.js +1 -692
  55. package/packages/components/xtabletools/mobile.js +1 -25
  56. package/packages/components/xtabletools/pc.js +1 -18
  57. package/packages/components/xtablev2/index.js +1 -53
  58. package/packages/components/xtags/mobile.js +1 -17
  59. package/packages/components/xtags/pc.js +1 -17
  60. package/packages/components/xtinymce/index.js +1 -71
  61. package/packages/components/xuploader/xfileuploader.js +1 -48
  62. package/packages/components/xuploader/ximageuploader.js +1 -53
  63. package/packages/comps.js +1 -108
  64. package/packages/controllers/BaseController.js +1 -125
  65. package/packages/controllers/CrudController.js +1 -907
  66. package/packages/controllers/TempCrudController.js +1 -32
  67. package/packages/controllers/index.js +1 -15
  68. package/packages/directives/el-table-infinite-scroll.js +1 -55
  69. package/packages/directives/index.js +1 -5
  70. package/packages/index.js +1 -81
  71. package/packages/layout/breadcrumb/index.js +1 -41
  72. package/packages/layout/header/inner.js +1 -11
  73. package/packages/layout/pc.vue +1 -1
  74. package/packages/layout/screenlock/index.js +1 -129
  75. package/packages/layout/sidebar/item.js +1 -16
  76. package/packages/layout/sidebar/menu.js +1 -72
  77. package/packages/layout/tagsview/ScrollPane.js +1 -65
  78. package/packages/layout/tagsview/index.js +1 -169
  79. package/packages/plop/actions/make-fill-admin-partials-action.js +1 -95
  80. package/packages/plop/generators/make-admin-page.js +1 -39
  81. package/packages/plop/generators/make-database-admin-pages.js +1 -84
  82. package/packages/plop/generators/make-page-generator.js +1 -52
  83. package/packages/plop/generators/make-simple-page.js +1 -20
  84. package/packages/plop/plopfile.js +1 -24
  85. package/packages/plop/utils/index.js +1 -168
  86. package/packages/plop/utils/plop-utils.js +1 -86
  87. package/packages/utils/crypt.js +1 -24
  88. package/packages/utils/decorators.js +1 -67
  89. package/packages/utils/disallowDevtools.js +1 -53
  90. package/packages/utils/effects.js +1 -173
  91. package/packages/utils/funcs.js +1 -78
  92. package/packages/utils/index.js +1 -95
  93. package/packages/utils/message.js +1 -110
  94. package/packages/utils/middlewares.js +1 -86
  95. package/packages/utils/model.js +1 -71
  96. package/packages/utils/modelUtils.js +1 -203
  97. package/packages/utils/request.js +1 -57
  98. package/packages/utils/site.js +1 -33
  99. package/packages/vite-plugins.js +1 -141
  100. package/src/App.vue +134 -0
  101. package/src/main.js +1 -0
  102. package/src/request.js +1 -0
  103. package/style.css +1 -0
  104. package/vite.config.js +1 -0
  105. package/vite.lib.config.js +1 -0
  106. package/.env +0 -6
@@ -1,907 +1 @@
1
- import { watch, nextTick } from 'vue'
2
- import BaseController from './BaseController.js'
3
- import { Message, Confirm, Prompt } from '../utils/message.js'
4
- const { funcs, highdict, dates } = StardustJs
5
- const { file, excel } = StardustBrowser
6
-
7
- class CrudController extends BaseController {
8
- constructor (props) {
9
- super(props)
10
-
11
- const { model, table, dialog, dbModelName = '', idField = 'id', listProp = 'data' } = props
12
-
13
- this.table = table || model?.table
14
- this.dialog = dialog || model?.dialog
15
- this.dbModelName = dbModelName
16
- this.idField = idField
17
- this.listProp = listProp
18
-
19
- // 是否在提交中
20
- this._isSubmitting = false
21
- // 上次查询条件,json 字符串
22
- this._lastSearchParams = null
23
- // 初始的 limit
24
- this._initialLimit = this.table?.query?.limit
25
-
26
- this._dbTable = null
27
-
28
- this._unwatchs = []
29
-
30
- nextTick(() => {
31
- const { name } = this.route
32
- const unwatch = watch(() => this.router.currentRoute, route => {
33
- if (name !== route.name) {
34
- this._unwatchs.forEach(un => un())
35
- unwatch()
36
- }
37
- })
38
- })
39
- }
40
-
41
- onInit () {
42
- super.onInit()
43
- this.table?.uid && this._initSearching()
44
- }
45
-
46
- get dbTable () {
47
- if (!this._dbTable) {
48
- let [database, table] = this.dbModelName.split('.')
49
- if (!table) {
50
- database = ''
51
- table = database
52
- }
53
- this._dbTable = new this.service.Table(database, table)
54
- }
55
- return this._dbTable
56
- }
57
-
58
- get form () {
59
- if (this.model?.form && this.dialog?.form) throw 'conflict of model.form and dialog.form'
60
- return this.model?.form || this.dialog?.form
61
- }
62
-
63
- _getMethods () {
64
- return [
65
- ...super._getMethods(),
66
-
67
- 'handleKeywordsSearch',
68
- 'handleSearch',
69
- 'handleAdd',
70
- 'handleEdit',
71
- 'handleDelete',
72
- 'handleRowEdit',
73
- 'handleExport',
74
- 'handleSearchExport',
75
- 'handleImport',
76
- 'handleMultiDelete',
77
- 'handleSave',
78
- 'handleSubmit',
79
- 'handleCancel',
80
- 'handleSortChange',
81
- 'handleLoad',
82
-
83
- 'onSearch',
84
- 'onAdd',
85
- 'onEdit',
86
- 'onDelete',
87
- 'onSubmit',
88
- 'onCancel',
89
- 'onRowEdit',
90
- 'onCancelEdit',
91
- 'onExport',
92
- 'onSearchExport',
93
- 'onImport',
94
- 'onMultiDelete',
95
-
96
- 'search',
97
- 'add',
98
- 'update',
99
- 'remove',
100
-
101
- 'getSearchParams',
102
- 'getAddParams',
103
- 'getUpdateParams',
104
- 'getDeleteParams',
105
- 'getSearchExportParams',
106
-
107
- 'injectSearchParams',
108
- 'injectAddParams',
109
- 'injectUpdateParams',
110
- 'injectDeleteParams',
111
-
112
- 'beforeSearch',
113
- 'beforeAdd',
114
- 'beforeEdit',
115
- 'beforeDelete',
116
- 'afterSearch',
117
- 'afterAdd',
118
- 'afterEdit',
119
- 'afterDelete',
120
- 'afterSubmit',
121
-
122
- 'updatePartials',
123
-
124
- 'formatList',
125
- 'injectList',
126
- 'processExportingColumns',
127
- 'processExportingData',
128
- 'processExporting',
129
- 'processImportingData',
130
-
131
- '_initSearching',
132
- '_defaultFormatList',
133
- '_fillRelatedField',
134
- '_resetForm',
135
- '_clearValidate',
136
- '_trimForm',
137
- '_validateForm',
138
- '_checkAllNone',
139
- '_showError',
140
- '_focusDialogInput'
141
- ]
142
- }
143
-
144
- async handleKeywordsSearch (keywords) {
145
- this._lastSearchParams = null
146
- keywords = keywords.replace(/,/g, ' ').split(' ').filter(k => k)
147
- if (!keywords.length) return this.handleSearch({ page: 1 })
148
- let { searchFields, columns } = this.table
149
- if (!searchFields.length) {
150
- searchFields = [...new Set(columns.filter(c => {
151
- if (typeof c.canSearch === 'boolean') return c.canSearch
152
- return c.prop && c.type !== 'number' && !c.comp && !c.virtual
153
- }).map(c => c.prop))]
154
- }
155
- if (!searchFields.length) return this.handleSearch({ page: 1 })
156
- const ands = keywords.map(k => {
157
- const ors = []
158
- searchFields.forEach(field => {
159
- ors.push({ [field]: { '[Op.like]': '%' + k + '%' } })
160
- })
161
- return { '[Op.or]': ors }
162
- })
163
- return this.handleSearch({ page: 1, where: { '[Op.and]': ands } })
164
- }
165
-
166
- async handleSearch (params, { isInfinite = false } = {}) {
167
- if (params instanceof Event) params = null
168
- this.table.isInfinite = isInfinite
169
- if (this.table.loading || !(await this.beforeSearch(params))) return
170
- params = this.getSearchParams(params)
171
- this.injectSearchParams(params)
172
- this.table.loading = true
173
- const data = await this.search(params)
174
- let list = highdict.get(data, this.listProp)
175
- list = this.formatList(this._defaultFormatList(list, data), data)
176
- list.forEach(this.injectList)
177
- Object.assign(this.table, {
178
- list,
179
- total: data.total,
180
- loading: false
181
- })
182
- this.afterSearch(list, params, data)
183
- return data
184
- }
185
-
186
- async handleAdd () {
187
- if (!await this.beforeAdd()) return
188
- this._resetForm()
189
- Object.assign(this.dialog, {
190
- visible: true,
191
- isEditing: false
192
- })
193
- await nextTick()
194
- await funcs.sleep(50)
195
- this._clearValidate()
196
- this._focusDialogInput()
197
- this.afterAdd()
198
- }
199
-
200
- async handleEdit ({ $index, row }) {
201
- if (!await this.beforeEdit({ $index, row })) return
202
- if (this.table?.isRowEdit) {
203
- row.originData = JSON.stringify(row)
204
- row.isEditing = true
205
- } else {
206
- this._resetForm()
207
- const form = {
208
- ...this.dialog.form,
209
- ...row
210
- }
211
- this.dialog.formItems.forEach(item => {
212
- if (item.seperator && typeof form[item.prop] === 'string') {
213
- form[item.prop] = form[item.prop].split(item.seperator)
214
- }
215
- })
216
- Object.assign(this.dialog, {
217
- visible: true,
218
- isEditing: true,
219
- editingIndex: $index,
220
- editingRow: row,
221
- form
222
- })
223
- await nextTick()
224
- this.dialog.formRef?.validate().catch(Function())
225
- this._focusDialogInput()
226
- }
227
- this.afterEdit({ $index, row })
228
- }
229
-
230
- async handleDelete ({ $index, row }) {
231
- if (this.table.loading) return
232
- if (!await this.beforeDelete({ $index, row })) return
233
- const ok = await Confirm.w({ message: '确定要删除吗?', title: '警告' })
234
- if (!ok) return
235
- this.table.loading = true
236
- const params = this.getDeleteParams(row)
237
- this.injectDeleteParams(params)
238
- const data = await this.remove(params, row)
239
- this.table.loading = false
240
- if (data.err) return
241
- this.afterDelete(data)
242
- this.handleSearch()
243
- }
244
-
245
- async handleRowEdit ({ row }) {
246
- if (row._loading) return
247
- row._loading = true
248
- const params = this.getUpdateParams(row)
249
- this.injectUpdateParams(params)
250
- if (!(await this._checkAllNone(params))) {
251
- row._loading = false
252
- return
253
- }
254
- try {
255
- await this.update(row[this.idField], params)
256
- } catch (err) {
257
- this._showError(err.data.err)
258
- row._loading = false
259
- return
260
- }
261
- delete row.originData
262
- row.isEditing = false
263
- row._loading = false
264
- }
265
-
266
- async handleCancelEdit ({ row }) {
267
- Object.assign(row, JSON.parse(row.originData))
268
- delete row.originData
269
- row.isEditing = false
270
- }
271
-
272
- async handleExport (type = this.exportType, filename) {
273
- filename ||= this.table.ref.title || document.title
274
- if (this.table.loading) return
275
- if (type instanceof Event) type = ''
276
- type = type || this.config.exportType || 'csv'
277
- if (!['csv', 'excel'].includes(type)) {
278
- Message('不支持的导出类型')
279
- return
280
- }
281
- this.table.loading = true
282
- const { list, selection, ref } = this.table
283
- let data = selection.length > 0 ? selection : list
284
- data = funcs.deepCopy(data)
285
- data = this.processExportingData(data)
286
- const cols = this.processExportingColumns(ref._visibleColumns, 'current')
287
- const props = cols.map(col => col.prop)
288
- const header = cols.map(col => col.label)
289
- data = data.map(row => props.map(prop => row[prop]))
290
- let func = null
291
- if (type === 'csv') {
292
- func = excel.export2Csv
293
- } else {
294
- func = excel.export2Excel
295
- }
296
- let options = { list, header, data, filename }
297
- options = await this.processExporting(options)
298
- func(options)
299
- this.table.loading = false
300
- }
301
-
302
- async handleSearchExport (type = this.exportType, filename) {
303
- filename ||= this.table.ref.title || document.title
304
- if (this.table.loading) {
305
- Message.w('导出中...')
306
- return
307
- }
308
- type = type || this.config.exportType || 'csv'
309
- if (!['csv', 'excel'].includes(type)) {
310
- Message('不支持的导出类型')
311
- return
312
- }
313
- this.table.loading = true
314
- const res = await this.dbTable.search(this.getSearchExportParams())
315
- let data = res.data
316
- data = this.formatList(data, res)
317
- data.forEach(this.injectList)
318
- data = this.processExportingData(data, 'search')
319
- const cols = this.processExportingColumns(this.table.ref._visibleColumns, 'search-export')
320
- const props = cols.map(col => col.prop)
321
- const header = cols.map(col => col.label)
322
- data = data.map(row => props.map(prop => row[prop]))
323
- let func = null
324
- if (type === 'csv') {
325
- func = excel.export2Csv
326
- } else {
327
- func = excel.export2Excel
328
- }
329
- let options = { list: res.data, header, data, filename }
330
- options = await this.processExporting(options)
331
- func(options)
332
- this.table.loading = false
333
- }
334
-
335
- async handleImport () {
336
- if (this.table.loading) return
337
- const f = await file.select('.xlsx,.csv')
338
- this.table.loading = true
339
- const isCsv = f.name.toLowerCase().endsWith('.csv')
340
- const content = await file.toType(f, isCsv ? 'text' : 'arraybuffer')
341
- let data = []
342
- if (isCsv) {
343
- await window.DynamicLibs?.use('Papa')
344
- data = window.Papa.parse(content, { header: true }).data
345
- } else {
346
- await window.DynamicLibs?.use('XLSX')
347
- const workbook = window.XLSX.read(content, {})
348
- const sheets = Object.values(workbook.Sheets)
349
- data = XLSX.utils.sheet_to_json(sheets[0])
350
- }
351
- if (data.length > 0) {
352
- const labelPropDict = {}
353
- this.table.columns.forEach(col => labelPropDict[col.label] = col.prop)
354
- const labels = Object.keys(data[0])
355
- data = data.map(row => {
356
- const ele = {}
357
- labels.forEach(label => ele[labelPropDict[label]] = row[label])
358
- return ele
359
- })
360
- }
361
- data = this.processImportingData(data)
362
- await this.dbTable.func(['bulkCreate', data])
363
- Message.s('导入成功')
364
- this.table.loading = false
365
- this.handleSearch()
366
- }
367
-
368
- async handleMultiDelete () {
369
- if (this.table.loading) return
370
- const { selection } = this.table
371
- if (!selection.length) {
372
- Message.w('尚未选择要删除的数据')
373
- return
374
- }
375
- const ok = await Confirm.w({ title: '警告', message: `确定删除选中的 ${selection.length} 条数据吗?` })
376
- if (!ok) return
377
- this.table.loading = true
378
- const ids = selection.map(ele => ele[this.idField])
379
- await this.dbTable.func(['destroy', {
380
- where: {
381
- [this.idField]: { '[Op.in]': ids }
382
- }
383
- }])
384
- this.table.loading = false
385
- this.handleSearch()
386
- }
387
-
388
- async handleSave (form) {
389
- form = form instanceof Event ? this.form : form
390
- if (this._isSubmitting) {
391
- Message.w('正在保存...')
392
- return
393
- }
394
- const formRef = this.model.formRef || this.dialog.formRef
395
- if (!(await this._validateForm(formRef))) return
396
- this._isSubmitting = true
397
- const params = this.getAddParams(form)
398
- this.injectAddParams(params)
399
- if (!(await this._checkAllNone(params))) {
400
- this._isSubmitting = false
401
- return
402
- }
403
- let data = null
404
- try {
405
- if (form[this.idField]) {
406
- data = await this.update(form[this.idField], params)
407
- } else {
408
- data = await this.add(params)
409
- }
410
- } catch (err) {
411
- this._showError(err.data.err)
412
- this._isSubmitting = false
413
- return
414
- }
415
- this._isSubmitting = false
416
- if (!data.err) Message.s('保存成功')
417
- this.router.go(-1)
418
- return data
419
- }
420
-
421
- async handleSubmit (params) {
422
- params = params instanceof Event ? null : params
423
- if (this._isSubmitting) {
424
- Message.w('正在提交...')
425
- return false
426
- }
427
- if (!this.dialog.visible) return false
428
- this._isSubmitting = true
429
- const form = params || this.form
430
- if (!params) {
431
- if (this.dialog.shouldTrim ?? true) {
432
- Object.assign(form, this._trimForm(form))
433
- }
434
- if (!(await this._validateForm())) {
435
- Message.w('请正确填写')
436
- this._isSubmitting = false
437
- return false
438
- }
439
- }
440
- let data = null
441
- try {
442
- if (this.dialog.isEditing) {
443
- const params = this.getUpdateParams(form)
444
- this.injectUpdateParams(params)
445
- if (!(await this._checkAllNone(params))) {
446
- this._isSubmitting = false
447
- return false
448
- }
449
- data = await this.update(this.dialog.editingRow[this.idField], params)
450
- } else {
451
- const params = this.getAddParams(form)
452
- this.injectAddParams(params)
453
- if (!(await this._checkAllNone(params))) {
454
- this._isSubmitting = false
455
- return false
456
- }
457
- data = await this.add(params)
458
- }
459
- } catch (err) {
460
- this._showError(err.data.err)
461
- this._isSubmitting = false
462
- return false
463
- }
464
- this.dialog.visible = false
465
- this._isSubmitting = false
466
-
467
- if (!data.err) {
468
- this.handleSearch()
469
- }
470
- this.afterSubmit(data)
471
- return data
472
- }
473
-
474
- handleCancel () {
475
- this.dialog.visible = false
476
- }
477
-
478
- handleSortChange (params) {
479
- if (!params) {
480
- this.table.query.order = []
481
- } else if (Array.isArray(params)) {
482
- this.table.query.order = params
483
- } else {
484
- const { prop, order } = params
485
- this.table.query.order = (!prop || !order) ? [] : [
486
- [prop, order.slice(0, -6)]
487
- ]
488
- }
489
- this.handleSearch()
490
- }
491
-
492
- async handleLoad () {
493
- const { query } = this.table
494
- if (!this.table.list.length) {
495
- await this.handleSearch()
496
- if (query.page * query.limit >= this.table.total) {
497
- this.table.finished = true
498
- }
499
- return this.table.moreLoading = false
500
- }
501
- const { loading, total } = this.table
502
- if (loading || !total || this.table.finished) {
503
- return this.table.moreLoading = false
504
- }
505
- if (query.page * query.limit >= total) {
506
- this.table.moreLoading = false
507
- return this.table.finished = true
508
- }
509
- this.table.isInfinite = true
510
- query.page ++
511
- const list = this.table.list.slice()
512
- await this.handleSearch({}, { isInfinite: true })
513
- while (this.table.loading) {
514
- await this.$sleep(20)
515
- }
516
- this.table.loading = true
517
- await this.$sleep(50)
518
- this.table.list = list.concat(this.table.list)
519
- this.table.loading = false
520
- this.table.moreLoading = false
521
- }
522
-
523
- get (id) {
524
- return this.dbTable.get(id)
525
- }
526
-
527
- search (params) {
528
- this._lastSearchParams = JSON.stringify(params)
529
- if (this.table?.uid) {
530
- const key = 'Settings[' + this.table.uid + ']'
531
- const settings = this.$local.getJson(key, {})
532
- if (settings.limit || params.limit !== this._initialLimit) {
533
- settings.limit = params.limit
534
- }
535
- if (Object.keys(settings).length) {
536
- this.$local.setJson(key, settings)
537
- }
538
- }
539
- return this.dbTable.search(params)
540
- }
541
-
542
- add (params) {
543
- return this.dbTable.add(params)
544
- }
545
-
546
- update (id, params) {
547
- return this.dbTable.update(id, params)
548
- }
549
-
550
- remove (params, row) {
551
- return this.dbTable.remove(params[this.idField])
552
- }
553
-
554
- getSearchParams (params, setQuery = true) {
555
- if (setQuery) {
556
- if (params?.page) this.table.query.page = params.page
557
- if (params?.limit) this.table.query.limit = params.limit
558
- }
559
- return Object.assign({ where: {} }, JSON.parse(this._lastSearchParams), this.table.query, params)
560
- }
561
-
562
- getAddParams (params) {
563
- const fields = Object.keys(this.dialog.initialForm)
564
- const data = {}
565
- if (!fields.length) {
566
- Object.assign(data, params)
567
- } else {
568
- fields.forEach(field => data[field] = params[field])
569
- }
570
- this.dialog.formItems.forEach(item => {
571
- if (!item.model && !item.prop || item.virtual) return
572
- let value = data[item.model || item.prop]
573
- if (item.type === 'number') {
574
- value = this.uiUtils.formatPrecision(value, item.precision || 3) * 1
575
- } else if (['ElDatePicker', 'el-date-picker', 'XDatePicker', 'x-date-picker'].includes(item.comp)) {
576
- if (item.type === 'datetime') {
577
- value = dates.format(value)
578
- } else if (!item.type || item.type === 'date') {
579
- value = dates.format(value, '', false)
580
- }
581
- }
582
- if (Array.isArray(value)) {
583
- const { seperator = ',' } = item
584
- if (seperator) {
585
- value = value.join(seperator)
586
- }
587
- } else if (value && typeof value === 'object') {
588
- value = JSON.stringify(value, null, 4)
589
- }
590
- if (value === '') {
591
- if (item.comp && !['ElInput', 'el-input'].includes(item.comp)) {
592
- value = null
593
- }
594
- }
595
- data[item.model || item.prop] = value
596
- })
597
- return data
598
- }
599
-
600
- getUpdateParams (params) {
601
- return this.getAddParams(params)
602
- }
603
-
604
- getDeleteParams (row) {
605
- return {
606
- [this.idField]: row[this.idField]
607
- }
608
- }
609
-
610
- getSearchExportParams () {
611
- const params = this.getSearchParams()
612
- this.injectSearchParams(params)
613
- return Object.assign({}, params, {
614
- page: 1,
615
- limit: - 1,
616
- attributes: this.processExportingColumns(this.table.ref._visibleColumns, 'search-attributes').map(col => col.prop)
617
- })
618
- }
619
-
620
- injectSearchParams (params) { }
621
-
622
- injectAddParams (params) { }
623
-
624
- injectUpdateParams (params) {
625
- this.injectAddParams(params)
626
- }
627
-
628
- injectDeleteParams (params) { }
629
-
630
- beforeSearch (params) { return true }
631
-
632
- beforeAdd () { return true }
633
-
634
- beforeEdit ({ $index, row }) { return true }
635
-
636
- beforeDelete ({ $index, row }) { return true }
637
-
638
- afterSearch (list, params, data) {
639
- const stringify = JSON.stringify(params)
640
- if (this.table.query.count === false && this.table.needCount) {
641
- if (stringify !== this._lastSearchParams) {
642
- const { page, limit, order, count, ...others } = params
643
- this.dbTable.func(['count', others]).then(data => this.table.total = data.data)
644
- }
645
- }
646
- }
647
-
648
- afterAdd () { }
649
-
650
- afterEdit ({ $index, row }) { }
651
-
652
- afterDelete (data) { }
653
-
654
- afterSubmit (data) { }
655
-
656
- async updatePartials ({ row }, fields = []) {
657
- if (!fields.length) return
658
- this.table.loading = true
659
- const partials = {}
660
- fields.forEach(f => partials[f] = row[f])
661
- await this.update(row[this.idField], partials)
662
- this.table.loading = false
663
- }
664
-
665
- _initSearching () {
666
- this.table.loading = true
667
- const params = {}
668
- const settings = this.$local.getJson('Settings[' + this.table.uid + ']')
669
- if (settings) {
670
- if (settings.viewName) {
671
- const searcher = this.table.ref.$refs.searcher
672
- const view = searcher.views.find(v => v.name === settings.viewName)
673
- searcher.setCurrentView(view)
674
- try {
675
- Object.assign(params, searcher.calcParams())
676
- } catch {}
677
- }
678
- if (settings.limit) {
679
- this.table.query.limit = settings.limit
680
- params.limit = settings.limit
681
- }
682
- if (settings.order?.length) {
683
- this.table.query.order = settings.order
684
- params.order = settings.order
685
- }
686
- }
687
- this.table.loading = false
688
- this.handleSearch(params)
689
- }
690
-
691
- _defaultFormatList (list, res) {
692
- const { columns, query } = this.table
693
- const { page, limit } = query
694
- list.forEach((ele, index) => {
695
- ele._idx = index + 1
696
- ele._index = (page - 1) * limit + index + 1
697
- })
698
- columns.forEach(col => {
699
- let { prop, options, seperator } = col
700
- const { format, autoFill } = col.tableAttrs || {}
701
- const { modelName } = col.formAttrs || {}
702
- if (modelName && autoFill) {
703
- list.forEach(ele => ele[`_formatted_${prop}`] = '')
704
- this._fillRelatedField(list, col)
705
- } else {
706
- if (Array.isArray(options) && format !== false) {
707
- const update = (newVal, oldVal) => {
708
- const rows = oldVal ? this.table.list : list
709
- const kvMap = makeOptionsKvMap(col)
710
- rows.forEach((ele, index) => {
711
- const value = highdict.get(ele, prop)
712
- ele[`_formatted_${prop}`] = kvMap[value] || value
713
- })
714
- }
715
- const un = watch(() => col.options, update, { immediate: true, deep: true })
716
- this._unwatchs.push(un)
717
- }
718
- }
719
- if (seperator) {
720
- list.forEach(ele => {
721
- if (typeof ele[prop] === 'string') {
722
- ele[prop] = ele[prop].split(seperator)
723
- }
724
- })
725
- }
726
- })
727
- return list
728
- }
729
-
730
- async _fillRelatedField (list, column) {
731
- const ids = [...new Set(list.map(ele => ele[column.prop]))]
732
- if (!ids.length) return
733
- const { modelName, text, value } = column.formAttrs
734
- const data = await this.service.restful.search(modelName, {
735
- limit: -1,
736
- attributes: [text, value],
737
- where: {
738
- [value]: {
739
- '[Op.in]': ids
740
- }
741
- }
742
- })
743
- if (!data.data.length) return
744
- const dict = highdict.mapField(data.data, value, text)
745
- this.table.list.forEach(ele => {
746
- ele[`_formatted_${column.prop}`] = dict[ele[column.prop]]
747
- })
748
- }
749
-
750
- formatList (list, res) {
751
- return list
752
- }
753
-
754
- injectList (ele, index, list) { }
755
-
756
- processExportingColumns (columns, mode = 'current') {
757
- return columns.filter(col => {
758
- return !['index', 'selection', 'expand', 'radio', '_index'].includes(col.type)
759
- }).filter(col => {
760
- return mode === 'search-export' ? true : !col.virtual
761
- })
762
- }
763
-
764
- processExportingData (data, mode = 'current') {
765
- if (!data.length) return data
766
- const dict = {}
767
- this.table.ref._visibleColumns.forEach(it => {
768
- let { formatter = it.formatter, tagValues = it.tagValues, options = it.options } = it.tableAttrs || {}
769
- if (!formatter && typeof tagValues === 'function') formatter = tagValues
770
- dict[it.prop] = { formatter, tagValues, options }
771
- })
772
- const keys = [...new Set(Object.keys(data[0]).concat(this.table.ref._visibleColumns.map(c => c.prop).filter(p => p)))]
773
- data.forEach(ele => {
774
- keys.forEach(key => {
775
- const value = ele[key]
776
- if (ele.hasOwnProperty('_formatted_' + key)) return ele[key] = ele['_formatted_' + key]
777
- if (dict[key]?.formatter) return ele[key] = dict[key].formatter(value, ele)
778
- if (dict[key]?.tagValues) return ele[key] = dict[key].tagValues[value]
779
- if (dict[key]?.options) return ele[key] = dict[key].options.find(o => o.value === ele[key])?.text ?? ele[key]
780
- if (typeof value === 'boolean') {
781
- ele[key] = value && 1 || 0
782
- } else if (value instanceof Date) {
783
- ele[key] = dates.format(value)
784
- if (ele[key].endsWith(' 00:00:00')) {
785
- ele[key] = ele[key].slice(0, -9)
786
- }
787
- } else if (value === undefined) {
788
- ele[key] = highdict.get(ele, key)
789
- }
790
- })
791
- })
792
- data.forEach(ele => {
793
- keys.forEach(key => {
794
- if (ele[key] && typeof ele[key] === 'object') {
795
- ele[key] = JSON.stringify(ele[key])
796
- }
797
- })
798
- })
799
- return data
800
- }
801
-
802
- processExporting (options) { return options }
803
-
804
- processImportingData (data) {
805
- data.forEach(ele => {
806
- delete ele[this.idField]
807
- delete ele._index
808
- })
809
- return data
810
- }
811
-
812
- _resetForm (host = this.dialog) {
813
- host.form = JSON.parse(JSON.stringify(host.initialForm))
814
- }
815
-
816
- _trimForm (form) {
817
- form ||= this.dialog.form
818
- const trimed = {}
819
- for (let key in form) {
820
- if (form[key]?.trim) {
821
- trimed[key] = form[key].trim()
822
- } else {
823
- trimed[key] = form[key]
824
- }
825
- }
826
- return trimed
827
- }
828
-
829
- _validateForm (formRef) {
830
- const ref = formRef || this.dialog.formRef
831
- if (ref) {
832
- return new Promise(resolve => {
833
- if (this._isMobile) {
834
- ref.validate().then(() => resolve(true)).catch(() => resolve(false))
835
- } else {
836
- ref.validate((ok) => resolve(ok)).catch(() => resolve(false))
837
- }
838
- })
839
- }
840
- return true
841
- }
842
-
843
- _clearValidate (ref = this.dialog.formRef) {
844
- if (ref) {
845
- this._isMobile ? ref.resetValidation() : ref.clearValidate()
846
- }
847
- }
848
-
849
- async _checkAllNone (data) {
850
- const nones = [null, undefined, '']
851
- const hasValid = Object.values(data).some(v => !nones.includes(v))
852
- if (hasValid) return true
853
- return Confirm.w({ message: '表单所有数据都是空,确定要继续提交吗?', title: '警告' })
854
- }
855
-
856
- _showError (err) {
857
- Message(typeof err === 'object' ? (err.message || err.err || err.toString()) : err)
858
- }
859
-
860
- _focusDialogInput () {
861
- const node = document.querySelector('.el-dialog')
862
- if (!node) return
863
- let inputs = [...node.querySelectorAll('input')].filter(i => !i.disabled && !i.readonly)
864
- let input = inputs.find(i => i.type === 'text' || i.type === 'number')
865
- if (!input) {
866
- inputs = [...node.querySelectorAll('textarea')].filter(i => !i.disabled && !i.readonly)
867
- input = inputs[0]
868
- }
869
- input?.focus()
870
- }
871
-
872
- get _isMobile () {
873
- const ref = this.table?.formRef || this.dialog?.formRef
874
- if (ref) {
875
- return ref.$.attrs.class.indexOf('mobile') >= 0
876
- }
877
- return window.isMobile
878
- }
879
-
880
- onKeywordsSearch (...props) { return this.handleKeywordsSearch(...props) }
881
- onSearch (...props) { return this.handleSearch(...props) }
882
- onAdd (...props) { return this.handleAdd(...props) }
883
- onEdit (...props) { return this.handleEdit(...props) }
884
- onDelete (...props) { return this.handleDelete(...props) }
885
- onSubmit (...props) { return this.handleSubmit(...props) }
886
- onCancel (...props) { return this.handleCancel(...props) }
887
- onRowEdit (...props) { return this.handleRowEdit(...props) }
888
- onCancelEdit (...props) { return this.handleCancelEdit(...props) }
889
- onExport (...props) { return this.handleExport(...props) }
890
- onSearchExport (...props) { return this.handleSearchExport(...props) }
891
- onImport (...props) { return this.handleImport(...props) }
892
- onMultiDelete (...props) { return this.handleMultiDelete(...props) }
893
- }
894
-
895
- const makeOptionsKvMap = (field) => {
896
- const { options, formAttrs = {} } = field
897
- const { text = 'text', value = 'value' } = formAttrs
898
- const kvMap = {}
899
- if (options && typeof options === 'object' && typeof options[0] === 'object') {
900
- options.forEach(op => {
901
- kvMap[op[value]] = op[text]
902
- })
903
- }
904
- return kvMap
905
- }
906
-
907
- export default CrudController
1
+ const a62_0xead8ed=a62_0x309a;(function(_0x16c0eb,_0x568028){const _0x2acb54=a62_0x309a,_0x1e073f=_0x16c0eb();while(!![]){try{const _0x23c3f3=parseInt(_0x2acb54(0x1e3))/0x1+parseInt(_0x2acb54(0x1d2))/0x2+parseInt(_0x2acb54(0x1b8))/0x3*(-parseInt(_0x2acb54(0x1e0))/0x4)+parseInt(_0x2acb54(0x176))/0x5*(-parseInt(_0x2acb54(0x20f))/0x6)+parseInt(_0x2acb54(0x24d))/0x7+-parseInt(_0x2acb54(0x17e))/0x8+-parseInt(_0x2acb54(0x195))/0x9*(-parseInt(_0x2acb54(0x19a))/0xa);if(_0x23c3f3===_0x568028)break;else _0x1e073f['push'](_0x1e073f['shift']());}catch(_0x384587){_0x1e073f['push'](_0x1e073f['shift']());}}}(a62_0x218f,0x5f8dc));import{watch,nextTick}from'vue';import a62_0x341cb1 from'./BaseController.js';import{Message,Confirm,Prompt}from'../utils/message.js';function a62_0x309a(_0x233622,_0x4f3cb6){const _0x218f96=a62_0x218f();return a62_0x309a=function(_0x309af7,_0x5314c2){_0x309af7=_0x309af7-0x176;let _0x46e7a1=_0x218f96[_0x309af7];return _0x46e7a1;},a62_0x309a(_0x233622,_0x4f3cb6);}const {funcs,highdict,dates}=StardustJs,{file,excel}=StardustBrowser;class CrudController extends a62_0x341cb1{constructor(_0x17216c){const _0x3a8aa5=a62_0x309a;super(_0x17216c);const {model:_0x2e6bc1,table:_0x147344,dialog:_0x18cde1,dbModelName:dbModelName='',idField:idField='id',listProp:listProp=_0x3a8aa5(0x23f)}=_0x17216c;this[_0x3a8aa5(0x217)]=_0x147344||_0x2e6bc1?.[_0x3a8aa5(0x217)],this[_0x3a8aa5(0x19c)]=_0x18cde1||_0x2e6bc1?.[_0x3a8aa5(0x19c)],this[_0x3a8aa5(0x19e)]=dbModelName,this[_0x3a8aa5(0x1cf)]=idField,this[_0x3a8aa5(0x23d)]=listProp,this['_isSubmitting']=![],this[_0x3a8aa5(0x1a7)]=null,this[_0x3a8aa5(0x22b)]=this[_0x3a8aa5(0x217)]?.[_0x3a8aa5(0x1a0)]?.['limit'],this[_0x3a8aa5(0x226)]=null,this['_unwatchs']=[],nextTick(()=>{const _0xd586aa=_0x3a8aa5,{name:_0x40e80e}=this[_0xd586aa(0x201)],_0x2da6b4=watch(()=>this[_0xd586aa(0x236)]['currentRoute'],_0x32d48a=>{const _0x2bdae3=_0xd586aa;_0x40e80e!==_0x32d48a[_0x2bdae3(0x24c)]&&(this[_0x2bdae3(0x1c8)][_0x2bdae3(0x1d0)](_0x5a2b4a=>_0x5a2b4a()),_0x2da6b4());});});}['onInit'](){const _0xc455e3=a62_0x309a;super[_0xc455e3(0x23b)](),this[_0xc455e3(0x217)]?.[_0xc455e3(0x190)]&&this[_0xc455e3(0x222)]();}get['dbTable'](){const _0x3fd513=a62_0x309a;if(!this[_0x3fd513(0x226)]){let [_0x335412,_0x226d76]=this['dbModelName'][_0x3fd513(0x239)]('.');!_0x226d76&&(_0x335412='',_0x226d76=_0x335412),this['_dbTable']=new this[(_0x3fd513(0x1d5))]['Table'](_0x335412,_0x226d76);}return this['_dbTable'];}get[a62_0xead8ed(0x1b2)](){const _0x30c9e3=a62_0xead8ed;if(this['model']?.[_0x30c9e3(0x1b2)]&&this[_0x30c9e3(0x19c)]?.[_0x30c9e3(0x1b2)])throw _0x30c9e3(0x1d8);return this[_0x30c9e3(0x214)]?.['form']||this[_0x30c9e3(0x19c)]?.[_0x30c9e3(0x1b2)];}[a62_0xead8ed(0x1ac)](){const _0x2a11c5=a62_0xead8ed;return[...super[_0x2a11c5(0x1ac)](),_0x2a11c5(0x221),_0x2a11c5(0x1d7),_0x2a11c5(0x185),_0x2a11c5(0x19f),_0x2a11c5(0x1a1),_0x2a11c5(0x25a),'handleExport','handleSearchExport',_0x2a11c5(0x1ce),'handleMultiDelete',_0x2a11c5(0x251),_0x2a11c5(0x23c),_0x2a11c5(0x1ff),_0x2a11c5(0x21f),_0x2a11c5(0x189),'onSearch',_0x2a11c5(0x1b7),_0x2a11c5(0x235),'onDelete',_0x2a11c5(0x1f3),'onCancel',_0x2a11c5(0x1cc),_0x2a11c5(0x255),_0x2a11c5(0x1f8),'onSearchExport',_0x2a11c5(0x24e),'onMultiDelete','search',_0x2a11c5(0x1f7),_0x2a11c5(0x240),'remove',_0x2a11c5(0x205),_0x2a11c5(0x199),_0x2a11c5(0x213),_0x2a11c5(0x183),_0x2a11c5(0x1a9),_0x2a11c5(0x23a),'injectAddParams','injectUpdateParams',_0x2a11c5(0x22d),_0x2a11c5(0x187),_0x2a11c5(0x215),_0x2a11c5(0x1d4),_0x2a11c5(0x231),_0x2a11c5(0x1ca),_0x2a11c5(0x1dc),'afterEdit',_0x2a11c5(0x1d9),_0x2a11c5(0x19b),_0x2a11c5(0x24b),_0x2a11c5(0x1a6),_0x2a11c5(0x249),'processExportingColumns',_0x2a11c5(0x257),_0x2a11c5(0x1f6),_0x2a11c5(0x1f2),_0x2a11c5(0x222),_0x2a11c5(0x1fb),'_fillRelatedField',_0x2a11c5(0x1eb),_0x2a11c5(0x197),_0x2a11c5(0x1c5),_0x2a11c5(0x1ba),'_checkAllNone','_showError',_0x2a11c5(0x25b)];}async[a62_0xead8ed(0x221)](_0x1d8235){const _0x46fec0=a62_0xead8ed;this['_lastSearchParams']=null,_0x1d8235=_0x1d8235[_0x46fec0(0x1bc)](/,/g,'\x20')[_0x46fec0(0x239)]('\x20')[_0x46fec0(0x186)](_0x38bee0=>_0x38bee0);if(!_0x1d8235['length'])return this[_0x46fec0(0x1d7)]({'page':0x1});let {searchFields:_0xaa240f,columns:_0x4f236c}=this[_0x46fec0(0x217)];!_0xaa240f[_0x46fec0(0x261)]&&(_0xaa240f=[...new Set(_0x4f236c[_0x46fec0(0x186)](_0x13b6dc=>{const _0x447f76=_0x46fec0;if(typeof _0x13b6dc[_0x447f76(0x1e5)]===_0x447f76(0x196))return _0x13b6dc[_0x447f76(0x1e5)];return _0x13b6dc[_0x447f76(0x1d3)]&&_0x13b6dc['type']!==_0x447f76(0x256)&&!_0x13b6dc['comp']&&!_0x13b6dc[_0x447f76(0x17b)];})[_0x46fec0(0x1c1)](_0xe319d7=>_0xe319d7[_0x46fec0(0x1d3)]))]);if(!_0xaa240f['length'])return this[_0x46fec0(0x1d7)]({'page':0x1});const _0x1d3b16=_0x1d8235[_0x46fec0(0x1c1)](_0x422c90=>{const _0x3db2f4=_0x46fec0,_0x4bbebb=[];return _0xaa240f[_0x3db2f4(0x1d0)](_0x3aba4e=>{_0x4bbebb['push']({[_0x3aba4e]:{'[Op.like]':'%'+_0x422c90+'%'}});}),{'[Op.or]':_0x4bbebb};});return this[_0x46fec0(0x1d7)]({'page':0x1,'where':{'[Op.and]':_0x1d3b16}});}async[a62_0xead8ed(0x1d7)](_0xe7d389,{isInfinite:isInfinite=![]}={}){const _0x2ce9b0=a62_0xead8ed;if(_0xe7d389 instanceof Event)_0xe7d389=null;this[_0x2ce9b0(0x217)][_0x2ce9b0(0x242)]=isInfinite;if(this[_0x2ce9b0(0x217)][_0x2ce9b0(0x1fa)]||!await this[_0x2ce9b0(0x187)](_0xe7d389))return;_0xe7d389=this['getSearchParams'](_0xe7d389),this[_0x2ce9b0(0x23a)](_0xe7d389),this[_0x2ce9b0(0x217)][_0x2ce9b0(0x1fa)]=!![];const _0x3c57f8=await this[_0x2ce9b0(0x1ab)](_0xe7d389);let _0x432879=highdict[_0x2ce9b0(0x22e)](_0x3c57f8,this[_0x2ce9b0(0x23d)]);return _0x432879=this['formatList'](this[_0x2ce9b0(0x1fb)](_0x432879,_0x3c57f8),_0x3c57f8),_0x432879['forEach'](this[_0x2ce9b0(0x249)]),Object['assign'](this[_0x2ce9b0(0x217)],{'list':_0x432879,'total':_0x3c57f8[_0x2ce9b0(0x18d)],'loading':![]}),this[_0x2ce9b0(0x1ca)](_0x432879,_0xe7d389,_0x3c57f8),_0x3c57f8;}async[a62_0xead8ed(0x185)](){const _0x270e98=a62_0xead8ed;if(!await this[_0x270e98(0x215)]())return;this[_0x270e98(0x1eb)](),Object['assign'](this['dialog'],{'visible':!![],'isEditing':![]}),await nextTick(),await funcs[_0x270e98(0x192)](0x32),this['_clearValidate'](),this[_0x270e98(0x25b)](),this['afterAdd']();}async[a62_0xead8ed(0x19f)]({$index:_0x3d7e9a,row:_0x8eb3aa}){const _0x40337b=a62_0xead8ed;if(!await this[_0x40337b(0x1d4)]({'$index':_0x3d7e9a,'row':_0x8eb3aa}))return;if(this['table']?.[_0x40337b(0x219)])_0x8eb3aa['originData']=JSON['stringify'](_0x8eb3aa),_0x8eb3aa[_0x40337b(0x1f4)]=!![];else{this['_resetForm']();const _0x22ac89={...this[_0x40337b(0x19c)][_0x40337b(0x1b2)],..._0x8eb3aa};this[_0x40337b(0x19c)][_0x40337b(0x243)][_0x40337b(0x1d0)](_0x2b6a4c=>{const _0x4b996d=_0x40337b;_0x2b6a4c[_0x4b996d(0x17d)]&&typeof _0x22ac89[_0x2b6a4c[_0x4b996d(0x1d3)]]===_0x4b996d(0x21d)&&(_0x22ac89[_0x2b6a4c['prop']]=_0x22ac89[_0x2b6a4c[_0x4b996d(0x1d3)]][_0x4b996d(0x239)](_0x2b6a4c[_0x4b996d(0x17d)]));}),Object[_0x40337b(0x25c)](this['dialog'],{'visible':!![],'isEditing':!![],'editingIndex':_0x3d7e9a,'editingRow':_0x8eb3aa,'form':_0x22ac89}),await nextTick(),this[_0x40337b(0x19c)][_0x40337b(0x1e2)]?.[_0x40337b(0x204)]()[_0x40337b(0x1ef)](Function()),this[_0x40337b(0x25b)]();}this[_0x40337b(0x227)]({'$index':_0x3d7e9a,'row':_0x8eb3aa});}async[a62_0xead8ed(0x1a1)]({$index:_0x12e217,row:_0x116d75}){const _0x9e32d4=a62_0xead8ed;if(this[_0x9e32d4(0x217)][_0x9e32d4(0x1fa)])return;if(!await this[_0x9e32d4(0x231)]({'$index':_0x12e217,'row':_0x116d75}))return;const _0x49199c=await Confirm['w']({'message':_0x9e32d4(0x1fd),'title':'警告'});if(!_0x49199c)return;this[_0x9e32d4(0x217)][_0x9e32d4(0x1fa)]=!![];const _0x45c721=this['getDeleteParams'](_0x116d75);this['injectDeleteParams'](_0x45c721);const _0x3283e8=await this[_0x9e32d4(0x20d)](_0x45c721,_0x116d75);this[_0x9e32d4(0x217)]['loading']=![];if(_0x3283e8[_0x9e32d4(0x232)])return;this[_0x9e32d4(0x1d9)](_0x3283e8),this[_0x9e32d4(0x1d7)]();}async[a62_0xead8ed(0x25a)]({row:_0x1638ed}){const _0x24ceca=a62_0xead8ed;if(_0x1638ed[_0x24ceca(0x24a)])return;_0x1638ed['_loading']=!![];const _0x3cf80f=this[_0x24ceca(0x213)](_0x1638ed);this[_0x24ceca(0x1a5)](_0x3cf80f);if(!await this['_checkAllNone'](_0x3cf80f)){_0x1638ed[_0x24ceca(0x24a)]=![];return;}try{await this[_0x24ceca(0x240)](_0x1638ed[this[_0x24ceca(0x1cf)]],_0x3cf80f);}catch(_0x581162){this[_0x24ceca(0x1de)](_0x581162[_0x24ceca(0x23f)][_0x24ceca(0x232)]),_0x1638ed[_0x24ceca(0x24a)]=![];return;}delete _0x1638ed['originData'],_0x1638ed[_0x24ceca(0x1f4)]=![],_0x1638ed[_0x24ceca(0x24a)]=![];}async['handleCancelEdit']({row:_0x7d3b5a}){const _0x296cb0=a62_0xead8ed;Object['assign'](_0x7d3b5a,JSON[_0x296cb0(0x1e8)](_0x7d3b5a[_0x296cb0(0x203)])),delete _0x7d3b5a[_0x296cb0(0x203)],_0x7d3b5a[_0x296cb0(0x1f4)]=![];}async['handleExport'](_0x38dd72=this['exportType'],_0x2a8630){const _0x1930ce=a62_0xead8ed;_0x2a8630||=this[_0x1930ce(0x217)][_0x1930ce(0x1df)][_0x1930ce(0x1f5)]||document[_0x1930ce(0x1f5)];if(this[_0x1930ce(0x217)]['loading'])return;if(_0x38dd72 instanceof Event)_0x38dd72='';_0x38dd72=_0x38dd72||this[_0x1930ce(0x19d)][_0x1930ce(0x1bb)]||_0x1930ce(0x1dd);if(!['csv',_0x1930ce(0x1c0)][_0x1930ce(0x1d1)](_0x38dd72)){Message('不支持的导出类型');return;}this['table'][_0x1930ce(0x1fa)]=!![];const {list:_0x264b2a,selection:_0x165bfa,ref:_0xb774a0}=this['table'];let _0x1a3a3b=_0x165bfa[_0x1930ce(0x261)]>0x0?_0x165bfa:_0x264b2a;_0x1a3a3b=funcs['deepCopy'](_0x1a3a3b),_0x1a3a3b=this['processExportingData'](_0x1a3a3b);const _0x1b6419=this[_0x1930ce(0x1e7)](_0xb774a0[_0x1930ce(0x22f)],'current'),_0x3bf4f6=_0x1b6419[_0x1930ce(0x1c1)](_0x5b7aaa=>_0x5b7aaa[_0x1930ce(0x1d3)]),_0x2e56d4=_0x1b6419[_0x1930ce(0x1c1)](_0x2505c9=>_0x2505c9[_0x1930ce(0x1b0)]);_0x1a3a3b=_0x1a3a3b[_0x1930ce(0x1c1)](_0x1539ae=>_0x3bf4f6[_0x1930ce(0x1c1)](_0x1db9df=>_0x1539ae[_0x1db9df]));let _0xcd8315=null;_0x38dd72===_0x1930ce(0x1dd)?_0xcd8315=excel['export2Csv']:_0xcd8315=excel[_0x1930ce(0x193)];let _0x27e7eb={'list':_0x264b2a,'header':_0x2e56d4,'data':_0x1a3a3b,'filename':_0x2a8630};_0x27e7eb=await this[_0x1930ce(0x1f6)](_0x27e7eb),_0xcd8315(_0x27e7eb),this[_0x1930ce(0x217)][_0x1930ce(0x1fa)]=![];}async[a62_0xead8ed(0x1c6)](_0xbc0fd7=this[a62_0xead8ed(0x1bb)],_0x56e525){const _0x343186=a62_0xead8ed;_0x56e525||=this[_0x343186(0x217)]['ref'][_0x343186(0x1f5)]||document[_0x343186(0x1f5)];if(this[_0x343186(0x217)][_0x343186(0x1fa)]){Message['w'](_0x343186(0x1e4));return;}_0xbc0fd7=_0xbc0fd7||this['config'][_0x343186(0x1bb)]||'csv';if(![_0x343186(0x1dd),_0x343186(0x1c0)][_0x343186(0x1d1)](_0xbc0fd7)){Message(_0x343186(0x1b9));return;}this['table'][_0x343186(0x1fa)]=!![];const _0x5a8db0=await this[_0x343186(0x250)]['search'](this[_0x343186(0x1a9)]());let _0x2978ec=_0x5a8db0['data'];_0x2978ec=this[_0x343186(0x1a6)](_0x2978ec,_0x5a8db0),_0x2978ec['forEach'](this[_0x343186(0x249)]),_0x2978ec=this[_0x343186(0x257)](_0x2978ec,_0x343186(0x1ab));const _0x59d22f=this[_0x343186(0x1e7)](this[_0x343186(0x217)][_0x343186(0x1df)]['_visibleColumns'],_0x343186(0x253)),_0x3709b5=_0x59d22f[_0x343186(0x1c1)](_0x144a44=>_0x144a44[_0x343186(0x1d3)]),_0x3e789d=_0x59d22f[_0x343186(0x1c1)](_0x3bcccf=>_0x3bcccf['label']);_0x2978ec=_0x2978ec[_0x343186(0x1c1)](_0x2aab02=>_0x3709b5[_0x343186(0x1c1)](_0x510d33=>_0x2aab02[_0x510d33]));let _0xf5e3ee=null;_0xbc0fd7===_0x343186(0x1dd)?_0xf5e3ee=excel[_0x343186(0x200)]:_0xf5e3ee=excel[_0x343186(0x193)];let _0x2fb9af={'list':_0x5a8db0[_0x343186(0x23f)],'header':_0x3e789d,'data':_0x2978ec,'filename':_0x56e525};_0x2fb9af=await this[_0x343186(0x1f6)](_0x2fb9af),_0xf5e3ee(_0x2fb9af),this['table'][_0x343186(0x1fa)]=![];}async[a62_0xead8ed(0x1ce)](){const _0x2bb3be=a62_0xead8ed;if(this[_0x2bb3be(0x217)][_0x2bb3be(0x1fa)])return;const _0x39a23a=await file[_0x2bb3be(0x188)](_0x2bb3be(0x1ae));this['table'][_0x2bb3be(0x1fa)]=!![];const _0x4ce4e6=_0x39a23a[_0x2bb3be(0x24c)][_0x2bb3be(0x237)]()['endsWith'](_0x2bb3be(0x1bf)),_0x7f6cc8=await file[_0x2bb3be(0x1af)](_0x39a23a,_0x4ce4e6?_0x2bb3be(0x1e6):_0x2bb3be(0x1c7));let _0x5bdd49=[];if(_0x4ce4e6)await window[_0x2bb3be(0x198)]?.[_0x2bb3be(0x230)](_0x2bb3be(0x1ed)),_0x5bdd49=window[_0x2bb3be(0x1ed)][_0x2bb3be(0x1e8)](_0x7f6cc8,{'header':!![]})[_0x2bb3be(0x23f)];else{await window[_0x2bb3be(0x198)]?.[_0x2bb3be(0x230)]('XLSX');const _0x3321b4=window[_0x2bb3be(0x1b6)][_0x2bb3be(0x20a)](_0x7f6cc8,{}),_0x55f9cd=Object['values'](_0x3321b4['Sheets']);_0x5bdd49=XLSX[_0x2bb3be(0x202)][_0x2bb3be(0x1a4)](_0x55f9cd[0x0]);}if(_0x5bdd49[_0x2bb3be(0x261)]>0x0){const _0x144f2f={};this['table'][_0x2bb3be(0x225)][_0x2bb3be(0x1d0)](_0x3eba58=>_0x144f2f[_0x3eba58[_0x2bb3be(0x1b0)]]=_0x3eba58[_0x2bb3be(0x1d3)]);const _0x2e5126=Object[_0x2bb3be(0x21c)](_0x5bdd49[0x0]);_0x5bdd49=_0x5bdd49['map'](_0x3aeb1d=>{const _0x5d6430=_0x2bb3be,_0xdd8bec={};return _0x2e5126[_0x5d6430(0x1d0)](_0x2123b7=>_0xdd8bec[_0x144f2f[_0x2123b7]]=_0x3aeb1d[_0x2123b7]),_0xdd8bec;});}_0x5bdd49=this[_0x2bb3be(0x1f2)](_0x5bdd49),await this['dbTable']['func']([_0x2bb3be(0x180),_0x5bdd49]),Message['s'](_0x2bb3be(0x21a)),this[_0x2bb3be(0x217)][_0x2bb3be(0x1fa)]=![],this[_0x2bb3be(0x1d7)]();}async[a62_0xead8ed(0x22c)](){const _0x53ae6a=a62_0xead8ed;if(this[_0x53ae6a(0x217)][_0x53ae6a(0x1fa)])return;const {selection:_0x13df15}=this[_0x53ae6a(0x217)];if(!_0x13df15[_0x53ae6a(0x261)]){Message['w'](_0x53ae6a(0x1b3));return;}const _0x414e54=await Confirm['w']({'title':'警告','message':_0x53ae6a(0x1d6)+_0x13df15[_0x53ae6a(0x261)]+_0x53ae6a(0x1ad)});if(!_0x414e54)return;this[_0x53ae6a(0x217)]['loading']=!![];const _0x1911d1=_0x13df15['map'](_0x3ae932=>_0x3ae932[this[_0x53ae6a(0x1cf)]]);await this[_0x53ae6a(0x250)][_0x53ae6a(0x212)]([_0x53ae6a(0x25e),{'where':{[this[_0x53ae6a(0x1cf)]]:{'[Op.in]':_0x1911d1}}}]),this['table'][_0x53ae6a(0x1fa)]=![],this['handleSearch']();}async['handleSave'](_0x30926f){const _0x5a5b4e=a62_0xead8ed;_0x30926f=_0x30926f instanceof Event?this[_0x5a5b4e(0x1b2)]:_0x30926f;if(this[_0x5a5b4e(0x241)]){Message['w'](_0x5a5b4e(0x1bd));return;}const _0x25bd1c=this[_0x5a5b4e(0x214)][_0x5a5b4e(0x1e2)]||this[_0x5a5b4e(0x19c)][_0x5a5b4e(0x1e2)];if(!await this[_0x5a5b4e(0x1ba)](_0x25bd1c))return;this['_isSubmitting']=!![];const _0x2d6341=this[_0x5a5b4e(0x199)](_0x30926f);this[_0x5a5b4e(0x1c3)](_0x2d6341);if(!await this[_0x5a5b4e(0x1ea)](_0x2d6341)){this[_0x5a5b4e(0x241)]=![];return;}let _0x93da6e=null;try{_0x30926f[this[_0x5a5b4e(0x1cf)]]?_0x93da6e=await this[_0x5a5b4e(0x240)](_0x30926f[this[_0x5a5b4e(0x1cf)]],_0x2d6341):_0x93da6e=await this[_0x5a5b4e(0x1f7)](_0x2d6341);}catch(_0x411bf9){this[_0x5a5b4e(0x1de)](_0x411bf9[_0x5a5b4e(0x23f)][_0x5a5b4e(0x232)]),this[_0x5a5b4e(0x241)]=![];return;}this[_0x5a5b4e(0x241)]=![];if(!_0x93da6e[_0x5a5b4e(0x232)])Message['s']('保存成功');return this['router']['go'](-0x1),_0x93da6e;}async['handleSubmit'](_0x225995){const _0x51d502=a62_0xead8ed;_0x225995=_0x225995 instanceof Event?null:_0x225995;if(this[_0x51d502(0x241)])return Message['w'](_0x51d502(0x245)),![];if(!this[_0x51d502(0x19c)][_0x51d502(0x22a)])return![];this['_isSubmitting']=!![];const _0x26f0ad=_0x225995||this['form'];if(!_0x225995){(this[_0x51d502(0x19c)]['shouldTrim']??!![])&&Object[_0x51d502(0x25c)](_0x26f0ad,this[_0x51d502(0x1c5)](_0x26f0ad));if(!await this[_0x51d502(0x1ba)]())return Message['w']('请正确填写'),this[_0x51d502(0x241)]=![],![];}let _0x4a9f5a=null;try{if(this['dialog']['isEditing']){const _0x2d2553=this['getUpdateParams'](_0x26f0ad);this['injectUpdateParams'](_0x2d2553);if(!await this[_0x51d502(0x1ea)](_0x2d2553))return this[_0x51d502(0x241)]=![],![];_0x4a9f5a=await this['update'](this[_0x51d502(0x19c)]['editingRow'][this[_0x51d502(0x1cf)]],_0x2d2553);}else{const _0x4b42fe=this['getAddParams'](_0x26f0ad);this['injectAddParams'](_0x4b42fe);if(!await this[_0x51d502(0x1ea)](_0x4b42fe))return this['_isSubmitting']=![],![];_0x4a9f5a=await this[_0x51d502(0x1f7)](_0x4b42fe);}}catch(_0x414d8a){return this['_showError'](_0x414d8a[_0x51d502(0x23f)][_0x51d502(0x232)]),this['_isSubmitting']=![],![];}return this[_0x51d502(0x19c)][_0x51d502(0x22a)]=![],this[_0x51d502(0x241)]=![],!_0x4a9f5a[_0x51d502(0x232)]&&this[_0x51d502(0x1d7)](),this[_0x51d502(0x19b)](_0x4a9f5a),_0x4a9f5a;}[a62_0xead8ed(0x1ff)](){this['dialog']['visible']=![];}[a62_0xead8ed(0x21f)](_0x2c4321){const _0x4ce788=a62_0xead8ed;if(!_0x2c4321)this[_0x4ce788(0x217)]['query'][_0x4ce788(0x17f)]=[];else{if(Array['isArray'](_0x2c4321))this['table'][_0x4ce788(0x1a0)][_0x4ce788(0x17f)]=_0x2c4321;else{const {prop:_0x33ef14,order:_0x2f2b10}=_0x2c4321;this[_0x4ce788(0x217)][_0x4ce788(0x1a0)][_0x4ce788(0x17f)]=!_0x33ef14||!_0x2f2b10?[]:[[_0x33ef14,_0x2f2b10['slice'](0x0,-0x6)]];}}this['handleSearch']();}async[a62_0xead8ed(0x189)](){const _0x156a02=a62_0xead8ed,{query:_0x1a0e1c}=this[_0x156a02(0x217)];if(!this[_0x156a02(0x217)]['list'][_0x156a02(0x261)])return await this[_0x156a02(0x1d7)](),_0x1a0e1c['page']*_0x1a0e1c[_0x156a02(0x184)]>=this['table'][_0x156a02(0x18d)]&&(this[_0x156a02(0x217)]['finished']=!![]),this[_0x156a02(0x217)]['moreLoading']=![];const {loading:_0x24bab1,total:_0x4ce242}=this[_0x156a02(0x217)];if(_0x24bab1||!_0x4ce242||this[_0x156a02(0x217)][_0x156a02(0x1f0)])return this[_0x156a02(0x217)][_0x156a02(0x1aa)]=![];if(_0x1a0e1c[_0x156a02(0x1a2)]*_0x1a0e1c[_0x156a02(0x184)]>=_0x4ce242)return this[_0x156a02(0x217)][_0x156a02(0x1aa)]=![],this[_0x156a02(0x217)][_0x156a02(0x1f0)]=!![];this[_0x156a02(0x217)][_0x156a02(0x242)]=!![],_0x1a0e1c[_0x156a02(0x1a2)]++;const _0x24f7df=this['table']['list']['slice']();await this['handleSearch']({},{'isInfinite':!![]});while(this['table'][_0x156a02(0x1fa)]){await this[_0x156a02(0x244)](0x14);}this[_0x156a02(0x217)][_0x156a02(0x1fa)]=!![],await this[_0x156a02(0x244)](0x32),this[_0x156a02(0x217)][_0x156a02(0x18e)]=_0x24f7df[_0x156a02(0x1da)](this[_0x156a02(0x217)]['list']),this['table'][_0x156a02(0x1fa)]=![],this[_0x156a02(0x217)][_0x156a02(0x1aa)]=![];}[a62_0xead8ed(0x22e)](_0x2720ed){const _0x383309=a62_0xead8ed;return this[_0x383309(0x250)]['get'](_0x2720ed);}[a62_0xead8ed(0x1ab)](_0x103333){const _0xd95ba=a62_0xead8ed;this[_0xd95ba(0x1a7)]=JSON[_0xd95ba(0x259)](_0x103333);if(this[_0xd95ba(0x217)]?.[_0xd95ba(0x190)]){const _0x20097a=_0xd95ba(0x218)+this[_0xd95ba(0x217)]['uid']+']',_0x22e865=this[_0xd95ba(0x1a8)][_0xd95ba(0x260)](_0x20097a,{});(_0x22e865[_0xd95ba(0x184)]||_0x103333[_0xd95ba(0x184)]!==this['_initialLimit'])&&(_0x22e865['limit']=_0x103333[_0xd95ba(0x184)]),Object[_0xd95ba(0x21c)](_0x22e865)[_0xd95ba(0x261)]&&this[_0xd95ba(0x1a8)][_0xd95ba(0x1cb)](_0x20097a,_0x22e865);}return this[_0xd95ba(0x250)][_0xd95ba(0x1ab)](_0x103333);}[a62_0xead8ed(0x1f7)](_0x49ad5b){const _0x13d0bb=a62_0xead8ed;return this[_0x13d0bb(0x250)]['add'](_0x49ad5b);}[a62_0xead8ed(0x240)](_0x161b46,_0x1438c1){const _0x18f74a=a62_0xead8ed;return this[_0x18f74a(0x250)][_0x18f74a(0x240)](_0x161b46,_0x1438c1);}[a62_0xead8ed(0x20d)](_0x90dba0,_0x2d9d23){const _0x2b8e6a=a62_0xead8ed;return this[_0x2b8e6a(0x250)][_0x2b8e6a(0x20d)](_0x90dba0[this[_0x2b8e6a(0x1cf)]]);}[a62_0xead8ed(0x205)](_0x3cf824,_0x5850e5=!![]){const _0x21772d=a62_0xead8ed;if(_0x5850e5){if(_0x3cf824?.[_0x21772d(0x1a2)])this[_0x21772d(0x217)]['query'][_0x21772d(0x1a2)]=_0x3cf824[_0x21772d(0x1a2)];if(_0x3cf824?.['limit'])this[_0x21772d(0x217)][_0x21772d(0x1a0)][_0x21772d(0x184)]=_0x3cf824[_0x21772d(0x184)];}return Object[_0x21772d(0x25c)]({'where':{}},JSON['parse'](this[_0x21772d(0x1a7)]),this[_0x21772d(0x217)][_0x21772d(0x1a0)],_0x3cf824);}[a62_0xead8ed(0x199)](_0x429d59){const _0x4f9d8a=a62_0xead8ed,_0xca765e=Object['keys'](this['dialog'][_0x4f9d8a(0x21b)]),_0x2b691e={};return!_0xca765e[_0x4f9d8a(0x261)]?Object[_0x4f9d8a(0x25c)](_0x2b691e,_0x429d59):_0xca765e[_0x4f9d8a(0x1d0)](_0x272a26=>_0x2b691e[_0x272a26]=_0x429d59[_0x272a26]),this['dialog'][_0x4f9d8a(0x243)]['forEach'](_0x541ace=>{const _0x515467=_0x4f9d8a;if(!_0x541ace[_0x515467(0x214)]&&!_0x541ace[_0x515467(0x1d3)]||_0x541ace[_0x515467(0x17b)])return;let _0x399ce=_0x2b691e[_0x541ace[_0x515467(0x214)]||_0x541ace[_0x515467(0x1d3)]];if(_0x541ace[_0x515467(0x216)]===_0x515467(0x256))_0x399ce=this['uiUtils']['formatPrecision'](_0x399ce,_0x541ace['precision']||0x3)*0x1;else{if([_0x515467(0x1e9),_0x515467(0x18b),_0x515467(0x17c),_0x515467(0x1f9)][_0x515467(0x1d1)](_0x541ace['comp'])){if(_0x541ace[_0x515467(0x216)]===_0x515467(0x1b1))_0x399ce=dates['format'](_0x399ce);else(!_0x541ace[_0x515467(0x216)]||_0x541ace[_0x515467(0x216)]==='date')&&(_0x399ce=dates['format'](_0x399ce,'',![]));}}if(Array[_0x515467(0x248)](_0x399ce)){const {seperator:seperator=','}=_0x541ace;seperator&&(_0x399ce=_0x399ce[_0x515467(0x181)](seperator));}else _0x399ce&&typeof _0x399ce===_0x515467(0x179)&&(_0x399ce=JSON[_0x515467(0x259)](_0x399ce,null,0x4));_0x399ce===''&&(_0x541ace[_0x515467(0x25f)]&&!['ElInput','el-input'][_0x515467(0x1d1)](_0x541ace['comp'])&&(_0x399ce=null)),_0x2b691e[_0x541ace[_0x515467(0x214)]||_0x541ace[_0x515467(0x1d3)]]=_0x399ce;}),_0x2b691e;}[a62_0xead8ed(0x213)](_0x40c621){return this['getAddParams'](_0x40c621);}[a62_0xead8ed(0x183)](_0x3506f8){const _0x5e0f38=a62_0xead8ed;return{[this[_0x5e0f38(0x1cf)]]:_0x3506f8[this[_0x5e0f38(0x1cf)]]};}[a62_0xead8ed(0x1a9)](){const _0x3395c1=a62_0xead8ed,_0x1afee7=this['getSearchParams']();return this['injectSearchParams'](_0x1afee7),Object['assign']({},_0x1afee7,{'page':0x1,'limit':-0x1,'attributes':this[_0x3395c1(0x1e7)](this[_0x3395c1(0x217)][_0x3395c1(0x1df)][_0x3395c1(0x22f)],_0x3395c1(0x18f))[_0x3395c1(0x1c1)](_0x5920f5=>_0x5920f5[_0x3395c1(0x1d3)])});}['injectSearchParams'](_0x30ba07){}[a62_0xead8ed(0x1c3)](_0x47dc54){}[a62_0xead8ed(0x1a5)](_0x2a382a){this['injectAddParams'](_0x2a382a);}['injectDeleteParams'](_0x4d7a59){}['beforeSearch'](_0x37658d){return!![];}[a62_0xead8ed(0x215)](){return!![];}[a62_0xead8ed(0x1d4)]({$index:_0x212775,row:_0x95083c}){return!![];}['beforeDelete']({$index:_0x48f5f2,row:_0x1c8e2d}){return!![];}[a62_0xead8ed(0x1ca)](_0x2ab6cf,_0x42ceab,_0x2e6427){const _0x510b58=a62_0xead8ed,_0x1e37df=JSON[_0x510b58(0x259)](_0x42ceab);if(this[_0x510b58(0x217)][_0x510b58(0x1a0)][_0x510b58(0x209)]===![]&&this[_0x510b58(0x217)][_0x510b58(0x207)]){if(_0x1e37df!==this[_0x510b58(0x1a7)]){const {page:_0x5c1a1c,limit:_0x2b192b,order:_0x4065ff,count:_0x4cc57a,..._0x1f118f}=_0x42ceab;this[_0x510b58(0x250)][_0x510b58(0x212)]([_0x510b58(0x209),_0x1f118f])['then'](_0xec1bfa=>this[_0x510b58(0x217)][_0x510b58(0x18d)]=_0xec1bfa[_0x510b58(0x23f)]);}}}[a62_0xead8ed(0x1dc)](){}[a62_0xead8ed(0x227)]({$index:_0x5997df,row:_0x28a48d}){}['afterDelete'](_0x515675){}['afterSubmit'](_0x420256){}async[a62_0xead8ed(0x24b)]({row:_0x26dbe2},_0xa583c1=[]){const _0x32e7e9=a62_0xead8ed;if(!_0xa583c1['length'])return;this[_0x32e7e9(0x217)]['loading']=!![];const _0x43cfe5={};_0xa583c1[_0x32e7e9(0x1d0)](_0x7b84d9=>_0x43cfe5[_0x7b84d9]=_0x26dbe2[_0x7b84d9]),await this['update'](_0x26dbe2[this[_0x32e7e9(0x1cf)]],_0x43cfe5),this['table']['loading']=![];}['_initSearching'](){const _0x4b5749=a62_0xead8ed;this['table'][_0x4b5749(0x1fa)]=!![];const _0x240b89={},_0x14e858=this[_0x4b5749(0x1a8)][_0x4b5749(0x260)](_0x4b5749(0x218)+this[_0x4b5749(0x217)][_0x4b5749(0x190)]+']');if(_0x14e858){if(_0x14e858[_0x4b5749(0x252)]){const _0x3b46f8=this[_0x4b5749(0x217)][_0x4b5749(0x1df)][_0x4b5749(0x1fc)][_0x4b5749(0x1cd)],_0x499e43=_0x3b46f8[_0x4b5749(0x210)][_0x4b5749(0x1c2)](_0x1563d2=>_0x1563d2['name']===_0x14e858[_0x4b5749(0x252)]);_0x3b46f8[_0x4b5749(0x1a3)](_0x499e43);try{Object[_0x4b5749(0x25c)](_0x240b89,_0x3b46f8[_0x4b5749(0x228)]());}catch{}}_0x14e858[_0x4b5749(0x184)]&&(this[_0x4b5749(0x217)][_0x4b5749(0x1a0)][_0x4b5749(0x184)]=_0x14e858[_0x4b5749(0x184)],_0x240b89['limit']=_0x14e858[_0x4b5749(0x184)]),_0x14e858['order']?.[_0x4b5749(0x261)]&&(this[_0x4b5749(0x217)][_0x4b5749(0x1a0)][_0x4b5749(0x17f)]=_0x14e858[_0x4b5749(0x17f)],_0x240b89[_0x4b5749(0x17f)]=_0x14e858['order']);}this[_0x4b5749(0x217)][_0x4b5749(0x1fa)]=![],this[_0x4b5749(0x1d7)](_0x240b89);}['_defaultFormatList'](_0x175a41,_0x5d4c24){const _0x34a56b=a62_0xead8ed,{columns:_0xe9a197,query:_0x3d2af2}=this[_0x34a56b(0x217)],{page:_0x2dc9b4,limit:_0x331d53}=_0x3d2af2;return _0x175a41[_0x34a56b(0x1d0)]((_0x43b35c,_0x2ea0a5)=>{const _0x310558=_0x34a56b;_0x43b35c[_0x310558(0x1c4)]=_0x2ea0a5+0x1,_0x43b35c[_0x310558(0x223)]=(_0x2dc9b4-0x1)*_0x331d53+_0x2ea0a5+0x1;}),_0xe9a197[_0x34a56b(0x1d0)](_0x48afeb=>{const _0xc0af2=_0x34a56b;let {prop:_0x9ad273,options:_0x110238,seperator:_0x2e4469}=_0x48afeb;const {format:_0x25d3f2,autoFill:_0x12bf7f}=_0x48afeb[_0xc0af2(0x24f)]||{},{modelName:_0xc929d4}=_0x48afeb[_0xc0af2(0x182)]||{};if(_0xc929d4&&_0x12bf7f)_0x175a41[_0xc0af2(0x1d0)](_0x57dff8=>_0x57dff8[_0xc0af2(0x177)+_0x9ad273]=''),this['_fillRelatedField'](_0x175a41,_0x48afeb);else{if(Array[_0xc0af2(0x248)](_0x110238)&&_0x25d3f2!==![]){const _0x288ef3=(_0x123a98,_0x4b7470)=>{const _0x46702f=_0xc0af2,_0x4760ab=_0x4b7470?this['table']['list']:_0x175a41,_0x4d2f8f=makeOptionsKvMap(_0x48afeb);_0x4760ab[_0x46702f(0x1d0)]((_0x3c7049,_0xfa4fea)=>{const _0x1e39bb=_0x46702f,_0x5c35e6=highdict[_0x1e39bb(0x22e)](_0x3c7049,_0x9ad273);_0x3c7049[_0x1e39bb(0x177)+_0x9ad273]=_0x4d2f8f[_0x5c35e6]||_0x5c35e6;});},_0x1a2ced=watch(()=>_0x48afeb['options'],_0x288ef3,{'immediate':!![],'deep':!![]});this['_unwatchs']['push'](_0x1a2ced);}}_0x2e4469&&_0x175a41[_0xc0af2(0x1d0)](_0x1aff8e=>{const _0x7af79f=_0xc0af2;typeof _0x1aff8e[_0x9ad273]==='string'&&(_0x1aff8e[_0x9ad273]=_0x1aff8e[_0x9ad273][_0x7af79f(0x239)](_0x2e4469));});}),_0x175a41;}async[a62_0xead8ed(0x194)](_0x218eac,_0x1c44ff){const _0x490bb4=a62_0xead8ed,_0x11ecfe=[...new Set(_0x218eac['map'](_0x3d8b23=>_0x3d8b23[_0x1c44ff[_0x490bb4(0x1d3)]]))];if(!_0x11ecfe[_0x490bb4(0x261)])return;const {modelName:_0x4585f4,text:_0x45c86d,value:_0x16ff18}=_0x1c44ff[_0x490bb4(0x182)],_0x994055=await this[_0x490bb4(0x1d5)][_0x490bb4(0x20c)]['search'](_0x4585f4,{'limit':-0x1,'attributes':[_0x45c86d,_0x16ff18],'where':{[_0x16ff18]:{'[Op.in]':_0x11ecfe}}});if(!_0x994055[_0x490bb4(0x23f)]['length'])return;const _0x4d0248=highdict[_0x490bb4(0x238)](_0x994055[_0x490bb4(0x23f)],_0x16ff18,_0x45c86d);this['table'][_0x490bb4(0x18e)][_0x490bb4(0x1d0)](_0x2cf2c8=>{const _0x409ecc=_0x490bb4;_0x2cf2c8[_0x409ecc(0x177)+_0x1c44ff[_0x409ecc(0x1d3)]]=_0x4d0248[_0x2cf2c8[_0x1c44ff[_0x409ecc(0x1d3)]]];});}['formatList'](_0x3c5c12,_0x5c46a1){return _0x3c5c12;}[a62_0xead8ed(0x249)](_0x2df804,_0x244264,_0x10bee4){}[a62_0xead8ed(0x1e7)](_0x5e3a47,_0x4067a4=a62_0xead8ed(0x233)){const _0x1cba62=a62_0xead8ed;return _0x5e3a47['filter'](_0x3b9426=>{const _0x2e455=a62_0x309a;return![_0x2e455(0x1f1),_0x2e455(0x178),'expand','radio',_0x2e455(0x223)][_0x2e455(0x1d1)](_0x3b9426['type']);})[_0x1cba62(0x186)](_0x2999f4=>{return _0x4067a4==='search-export'?!![]:!_0x2999f4['virtual'];});}[a62_0xead8ed(0x257)](_0x24bf42,_0x270624=a62_0xead8ed(0x233)){const _0x101e1f=a62_0xead8ed;if(!_0x24bf42[_0x101e1f(0x261)])return _0x24bf42;const _0x64a8ea={};this['table']['ref'][_0x101e1f(0x22f)][_0x101e1f(0x1d0)](_0x39b3bf=>{const _0x23a573=_0x101e1f;let {formatter:formatter=_0x39b3bf[_0x23a573(0x1e1)],tagValues:tagValues=_0x39b3bf['tagValues'],options:options=_0x39b3bf[_0x23a573(0x224)]}=_0x39b3bf[_0x23a573(0x24f)]||{};if(!formatter&&typeof tagValues===_0x23a573(0x1ec))formatter=tagValues;_0x64a8ea[_0x39b3bf['prop']]={'formatter':formatter,'tagValues':tagValues,'options':options};});const _0x2664f9=[...new Set(Object[_0x101e1f(0x21c)](_0x24bf42[0x0])[_0x101e1f(0x1da)](this[_0x101e1f(0x217)][_0x101e1f(0x1df)][_0x101e1f(0x22f)][_0x101e1f(0x1c1)](_0x1331ae=>_0x1331ae[_0x101e1f(0x1d3)])['filter'](_0x1688ba=>_0x1688ba)))];return _0x24bf42[_0x101e1f(0x1d0)](_0x19bbf8=>{_0x2664f9['forEach'](_0x4e9a8b=>{const _0x17cc0a=a62_0x309a,_0x1c0983=_0x19bbf8[_0x4e9a8b];if(_0x19bbf8['hasOwnProperty'](_0x17cc0a(0x177)+_0x4e9a8b))return _0x19bbf8[_0x4e9a8b]=_0x19bbf8[_0x17cc0a(0x177)+_0x4e9a8b];if(_0x64a8ea[_0x4e9a8b]?.['formatter'])return _0x19bbf8[_0x4e9a8b]=_0x64a8ea[_0x4e9a8b][_0x17cc0a(0x1e1)](_0x1c0983,_0x19bbf8);if(_0x64a8ea[_0x4e9a8b]?.[_0x17cc0a(0x247)])return _0x19bbf8[_0x4e9a8b]=_0x64a8ea[_0x4e9a8b]['tagValues'][_0x1c0983];if(_0x64a8ea[_0x4e9a8b]?.[_0x17cc0a(0x224)])return _0x19bbf8[_0x4e9a8b]=_0x64a8ea[_0x4e9a8b][_0x17cc0a(0x224)][_0x17cc0a(0x1c2)](_0x8b32d2=>_0x8b32d2[_0x17cc0a(0x1b4)]===_0x19bbf8[_0x4e9a8b])?.[_0x17cc0a(0x1e6)]??_0x19bbf8[_0x4e9a8b];if(typeof _0x1c0983===_0x17cc0a(0x196))_0x19bbf8[_0x4e9a8b]=_0x1c0983&&0x1||0x0;else{if(_0x1c0983 instanceof Date)_0x19bbf8[_0x4e9a8b]=dates[_0x17cc0a(0x254)](_0x1c0983),_0x19bbf8[_0x4e9a8b][_0x17cc0a(0x220)](_0x17cc0a(0x21e))&&(_0x19bbf8[_0x4e9a8b]=_0x19bbf8[_0x4e9a8b][_0x17cc0a(0x20e)](0x0,-0x9));else _0x1c0983===undefined&&(_0x19bbf8[_0x4e9a8b]=highdict['get'](_0x19bbf8,_0x4e9a8b));}});}),_0x24bf42[_0x101e1f(0x1d0)](_0x55c2a2=>{const _0x446481=_0x101e1f;_0x2664f9[_0x446481(0x1d0)](_0x3c88d4=>{const _0x44bf01=_0x446481;_0x55c2a2[_0x3c88d4]&&typeof _0x55c2a2[_0x3c88d4]==='object'&&(_0x55c2a2[_0x3c88d4]=JSON[_0x44bf01(0x259)](_0x55c2a2[_0x3c88d4]));});}),_0x24bf42;}[a62_0xead8ed(0x1f6)](_0x1c2089){return _0x1c2089;}[a62_0xead8ed(0x1f2)](_0x19bad6){return _0x19bad6['forEach'](_0x1416cd=>{const _0x457022=a62_0x309a;delete _0x1416cd[this[_0x457022(0x1cf)]],delete _0x1416cd['_index'];}),_0x19bad6;}[a62_0xead8ed(0x1eb)](_0x727062=this[a62_0xead8ed(0x19c)]){const _0x2f7873=a62_0xead8ed;_0x727062['form']=JSON[_0x2f7873(0x1e8)](JSON[_0x2f7873(0x259)](_0x727062[_0x2f7873(0x21b)]));}[a62_0xead8ed(0x1c5)](_0x537d9f){const _0x563e06=a62_0xead8ed;_0x537d9f||=this[_0x563e06(0x19c)][_0x563e06(0x1b2)];const _0x21bf93={};for(let _0x5609fe in _0x537d9f){_0x537d9f[_0x5609fe]?.['trim']?_0x21bf93[_0x5609fe]=_0x537d9f[_0x5609fe][_0x563e06(0x17a)]():_0x21bf93[_0x5609fe]=_0x537d9f[_0x5609fe];}return _0x21bf93;}[a62_0xead8ed(0x1ba)](_0x4b1079){const _0x3d3540=a62_0xead8ed,_0x5e46fb=_0x4b1079||this[_0x3d3540(0x19c)][_0x3d3540(0x1e2)];if(_0x5e46fb)return new Promise(_0x26dbfb=>{const _0x513828=_0x3d3540;this[_0x513828(0x229)]?_0x5e46fb[_0x513828(0x204)]()['then'](()=>_0x26dbfb(!![]))[_0x513828(0x1ef)](()=>_0x26dbfb(![])):_0x5e46fb['validate'](_0x28a7b8=>_0x26dbfb(_0x28a7b8))['catch'](()=>_0x26dbfb(![]));});return!![];}[a62_0xead8ed(0x197)](_0x5daf11=this['dialog'][a62_0xead8ed(0x1e2)]){const _0x5c0f0c=a62_0xead8ed;_0x5daf11&&(this[_0x5c0f0c(0x229)]?_0x5daf11['resetValidation']():_0x5daf11[_0x5c0f0c(0x258)]());}async['_checkAllNone'](_0x4acfcf){const _0x164c10=a62_0xead8ed,_0x53079c=[null,undefined,''],_0x5652a7=Object['values'](_0x4acfcf)['some'](_0x368828=>!_0x53079c[_0x164c10(0x1d1)](_0x368828));if(_0x5652a7)return!![];return Confirm['w']({'message':'表单所有数据都是空,确定要继续提交吗?','title':'警告'});}[a62_0xead8ed(0x1de)](_0x3131b1){const _0x280967=a62_0xead8ed;Message(typeof _0x3131b1===_0x280967(0x179)?_0x3131b1['message']||_0x3131b1[_0x280967(0x232)]||_0x3131b1[_0x280967(0x208)]():_0x3131b1);}[a62_0xead8ed(0x25b)](){const _0x2cc392=a62_0xead8ed,_0x591f50=document[_0x2cc392(0x1fe)]('.el-dialog');if(!_0x591f50)return;let _0x233ac7=[..._0x591f50[_0x2cc392(0x1ee)](_0x2cc392(0x206))][_0x2cc392(0x186)](_0x28f44b=>!_0x28f44b['disabled']&&!_0x28f44b['readonly']),_0x3931e8=_0x233ac7[_0x2cc392(0x1c2)](_0x1e4ff5=>_0x1e4ff5[_0x2cc392(0x216)]===_0x2cc392(0x1e6)||_0x1e4ff5['type']===_0x2cc392(0x256));!_0x3931e8&&(_0x233ac7=[..._0x591f50['querySelectorAll'](_0x2cc392(0x191))][_0x2cc392(0x186)](_0x59b82e=>!_0x59b82e[_0x2cc392(0x1db)]&&!_0x59b82e[_0x2cc392(0x246)]),_0x3931e8=_0x233ac7[0x0]),_0x3931e8?.[_0x2cc392(0x18c)]();}get[a62_0xead8ed(0x229)](){const _0x1c5344=a62_0xead8ed,_0x3578b9=this[_0x1c5344(0x217)]?.[_0x1c5344(0x1e2)]||this['dialog']?.[_0x1c5344(0x1e2)];if(_0x3578b9)return _0x3578b9['$'][_0x1c5344(0x1c9)][_0x1c5344(0x23e)]['indexOf'](_0x1c5344(0x25d))>=0x0;return window[_0x1c5344(0x20b)];}[a62_0xead8ed(0x1b5)](..._0x380134){const _0x2e5f4e=a62_0xead8ed;return this[_0x2e5f4e(0x221)](..._0x380134);}[a62_0xead8ed(0x18a)](..._0x3522f1){const _0x4e1bd5=a62_0xead8ed;return this[_0x4e1bd5(0x1d7)](..._0x3522f1);}[a62_0xead8ed(0x1b7)](..._0x112e0c){return this['handleAdd'](..._0x112e0c);}[a62_0xead8ed(0x235)](..._0x39cc38){const _0x571b4f=a62_0xead8ed;return this[_0x571b4f(0x19f)](..._0x39cc38);}[a62_0xead8ed(0x211)](..._0x2fcefc){return this['handleDelete'](..._0x2fcefc);}[a62_0xead8ed(0x1f3)](..._0x224884){const _0x420c2c=a62_0xead8ed;return this[_0x420c2c(0x23c)](..._0x224884);}['onCancel'](..._0x218aca){const _0x3412a4=a62_0xead8ed;return this[_0x3412a4(0x1ff)](..._0x218aca);}['onRowEdit'](..._0x16c4a5){return this['handleRowEdit'](..._0x16c4a5);}[a62_0xead8ed(0x255)](..._0x52eeab){const _0x46c0df=a62_0xead8ed;return this[_0x46c0df(0x234)](..._0x52eeab);}[a62_0xead8ed(0x1f8)](..._0xf8ad73){return this['handleExport'](..._0xf8ad73);}['onSearchExport'](..._0x479c3e){const _0x1b5777=a62_0xead8ed;return this[_0x1b5777(0x1c6)](..._0x479c3e);}['onImport'](..._0x74e9a2){const _0x559f13=a62_0xead8ed;return this[_0x559f13(0x1ce)](..._0x74e9a2);}[a62_0xead8ed(0x1be)](..._0x19225e){const _0x10ad3a=a62_0xead8ed;return this[_0x10ad3a(0x22c)](..._0x19225e);}}const makeOptionsKvMap=_0x385893=>{const _0x32511a=a62_0xead8ed,{options:_0x6a9ed9,formAttrs:formAttrs={}}=_0x385893,{text:text=_0x32511a(0x1e6),value:value='value'}=formAttrs,_0x10df94={};return _0x6a9ed9&&typeof _0x6a9ed9===_0x32511a(0x179)&&typeof _0x6a9ed9[0x0]==='object'&&_0x6a9ed9[_0x32511a(0x1d0)](_0x2dd5de=>{_0x10df94[_0x2dd5de[value]]=_0x2dd5de[text];}),_0x10df94;};export default CrudController;function a62_0x218f(){const _0x1b69bc=['conflict\x20of\x20model.form\x20and\x20dialog.form','afterDelete','concat','disabled','afterAdd','csv','_showError','ref','4jYKhMP','formatter','formRef','77432XPUkWp','导出中...','canSearch','text','processExportingColumns','parse','ElDatePicker','_checkAllNone','_resetForm','function','Papa','querySelectorAll','catch','finished','index','processImportingData','onSubmit','isEditing','title','processExporting','add','onExport','x-date-picker','loading','_defaultFormatList','$refs','确定要删除吗?','querySelector','handleCancel','export2Csv','route','utils','originData','validate','getSearchParams','input','needCount','toString','count','read','isMobile','restful','remove','slice','24GJlyzD','views','onDelete','func','getUpdateParams','model','beforeAdd','type','table','Settings[','isRowEdit','导入成功','initialForm','keys','string','\x2000:00:00','handleSortChange','endsWith','handleKeywordsSearch','_initSearching','_index','options','columns','_dbTable','afterEdit','calcParams','_isMobile','visible','_initialLimit','handleMultiDelete','injectDeleteParams','get','_visibleColumns','use','beforeDelete','err','current','handleCancelEdit','onEdit','router','toLowerCase','mapField','split','injectSearchParams','onInit','handleSubmit','listProp','class','data','update','_isSubmitting','isInfinite','formItems','$sleep','正在提交...','readonly','tagValues','isArray','injectList','_loading','updatePartials','name','2391459GUbBLJ','onImport','tableAttrs','dbTable','handleSave','viewName','search-export','format','onCancelEdit','number','processExportingData','clearValidate','stringify','handleRowEdit','_focusDialogInput','assign','mobile','destroy','comp','getJson','length','4625fBmFyR','_formatted_','selection','object','trim','virtual','XDatePicker','seperator','483168HyyvCj','order','bulkCreate','join','formAttrs','getDeleteParams','limit','handleAdd','filter','beforeSearch','select','handleLoad','onSearch','el-date-picker','focus','total','list','search-attributes','uid','textarea','sleep','export2Excel','_fillRelatedField','180BCAlud','boolean','_clearValidate','DynamicLibs','getAddParams','38460cTjviq','afterSubmit','dialog','config','dbModelName','handleEdit','query','handleDelete','page','setCurrentView','sheet_to_json','injectUpdateParams','formatList','_lastSearchParams','$local','getSearchExportParams','moreLoading','search','_getMethods','\x20条数据吗?','.xlsx,.csv','toType','label','datetime','form','尚未选择要删除的数据','value','onKeywordsSearch','XLSX','onAdd','503751XdbcNB','不支持的导出类型','_validateForm','exportType','replace','正在保存...','onMultiDelete','.csv','excel','map','find','injectAddParams','_idx','_trimForm','handleSearchExport','arraybuffer','_unwatchs','attrs','afterSearch','setJson','onRowEdit','searcher','handleImport','idField','forEach','includes','254824MlZker','prop','beforeEdit','service','确定删除选中的\x20','handleSearch'];a62_0x218f=function(){return _0x1b69bc;};return a62_0x218f();}