@wp1001/ui 2.9.13 → 3.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/@vant-D4fmGxs6.js +1 -3891
- package/index.html +28 -0
- package/index.js +1 -8419
- package/lib/tinymce/zh_CN.js +1 -0
- package/package.json +1 -1
- package/packages/assets/devtools-detector.js +1 -2
- package/packages/components/xarray/index.js +1 -64
- package/packages/components/xautorows/index.js +1 -35
- package/packages/components/xbutton/mobile.js +1 -3
- package/packages/components/xbutton/pc.js +1 -3
- package/packages/components/xbuttons/mobile.js +1 -51
- package/packages/components/xbuttons/pc.js +1 -51
- package/packages/components/xchart/constants.js +1 -58
- package/packages/components/xchart/index.js +1 -263
- package/packages/components/xchart/utils.js +1 -121
- package/packages/components/xcheckboxs/mobile.js +1 -58
- package/packages/components/xcheckboxs/pc.js +1 -49
- package/packages/components/xcol/mobile.js +1 -10
- package/packages/components/xcol/pc.js +1 -10
- package/packages/components/xdatepicker/mobile.js +1 -71
- package/packages/components/xdatepicker/pc.js +1 -9
- package/packages/components/xdialog/mobile.js +1 -60
- package/packages/components/xdialog/pc.js +1 -64
- package/packages/components/xdict/index.js +1 -47
- package/packages/components/xdistrictselect/mobile.js +1 -79
- package/packages/components/xdistrictselect/pc.js +1 -127
- package/packages/components/xform/mobile.js +1 -29
- package/packages/components/xform/pc.js +1 -42
- package/packages/components/xform/utils.js +1 -95
- package/packages/components/xformitem/mobile.js +1 -56
- package/packages/components/xformitem/pc.js +1 -72
- package/packages/components/xicon/mobile.js +1 -35
- package/packages/components/xicon/pc.js +1 -35
- package/packages/components/xinfo/index.js +1 -100
- package/packages/components/xlooper/index.js +1 -7
- package/packages/components/xpagination/mobile.js +1 -21
- package/packages/components/xpagination/pc.js +1 -21
- package/packages/components/xpicker/index.js +1 -38
- package/packages/components/xradios/mobile.js +1 -40
- package/packages/components/xradios/pc.js +1 -53
- package/packages/components/xrow/mobile.js +1 -9
- package/packages/components/xrow/pc.js +1 -9
- package/packages/components/xscan/mobile.js +1 -24
- package/packages/components/xscan/pc.js +1 -20
- package/packages/components/xsearcher/index.js +1 -198
- package/packages/components/xselect/mobile.js +1 -86
- package/packages/components/xselect/pc.js +1 -114
- package/packages/components/xselect/util.js +1 -66
- package/packages/components/xselectv2/index.js +1 -91
- package/packages/components/xtable/mobile.js +1 -108
- package/packages/components/xtable/pc.js +1 -143
- package/packages/components/xtable/searcher.js +1 -477
- package/packages/components/xtable/settings.js +1 -80
- package/packages/components/xtable/utils.js +1 -692
- package/packages/components/xtabletools/mobile.js +1 -25
- package/packages/components/xtabletools/pc.js +1 -18
- package/packages/components/xtablev2/index.js +1 -53
- package/packages/components/xtags/mobile.js +1 -17
- package/packages/components/xtags/pc.js +1 -17
- package/packages/components/xtinymce/index.js +1 -71
- package/packages/components/xuploader/xfileuploader.js +1 -48
- package/packages/components/xuploader/ximageuploader.js +1 -53
- package/packages/comps.js +1 -108
- package/packages/controllers/BaseController.js +1 -125
- package/packages/controllers/CrudController.js +1 -907
- package/packages/controllers/TempCrudController.js +1 -32
- package/packages/controllers/index.js +1 -15
- package/packages/directives/el-table-infinite-scroll.js +1 -55
- package/packages/directives/index.js +1 -5
- package/packages/index.js +1 -81
- package/packages/layout/breadcrumb/index.js +1 -41
- package/packages/layout/header/inner.js +1 -11
- package/packages/layout/screenlock/index.js +1 -129
- package/packages/layout/sidebar/item.js +1 -16
- package/packages/layout/sidebar/menu.js +1 -72
- package/packages/layout/tagsview/ScrollPane.js +1 -65
- package/packages/layout/tagsview/index.js +1 -169
- package/packages/plop/actions/make-fill-admin-partials-action.js +1 -95
- package/packages/plop/generators/make-admin-page.js +1 -39
- package/packages/plop/generators/make-database-admin-pages.js +1 -84
- package/packages/plop/generators/make-page-generator.js +1 -52
- package/packages/plop/generators/make-simple-page.js +1 -20
- package/packages/plop/plopfile.js +1 -24
- package/packages/plop/utils/index.js +1 -168
- package/packages/plop/utils/plop-utils.js +1 -86
- package/packages/utils/crypt.js +1 -24
- package/packages/utils/decorators.js +1 -67
- package/packages/utils/disallowDevtools.js +1 -53
- package/packages/utils/effects.js +1 -173
- package/packages/utils/funcs.js +1 -78
- package/packages/utils/index.js +1 -95
- package/packages/utils/message.js +1 -110
- package/packages/utils/middlewares.js +1 -86
- package/packages/utils/model.js +1 -71
- package/packages/utils/modelUtils.js +1 -203
- package/packages/utils/request.js +1 -57
- package/packages/utils/site.js +1 -33
- package/packages/vite-plugins.js +1 -141
- package/src/App.vue +134 -0
- package/src/main.js +1 -0
- package/src/request.js +1 -0
- package/style.css +1 -0
- package/vite.config.js +1 -0
- package/vite.lib.config.js +1 -0
- 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_0x3c28e5=a62_0x1c50;(function(_0x4d3247,_0xb992a9){const _0x1eb99d=a62_0x1c50,_0x4e030a=_0x4d3247();while(!![]){try{const _0x40b471=parseInt(_0x1eb99d(0x243))/0x1+parseInt(_0x1eb99d(0x242))/0x2+parseInt(_0x1eb99d(0x207))/0x3*(parseInt(_0x1eb99d(0x206))/0x4)+parseInt(_0x1eb99d(0x1c5))/0x5+-parseInt(_0x1eb99d(0x1e5))/0x6+-parseInt(_0x1eb99d(0x264))/0x7*(parseInt(_0x1eb99d(0x236))/0x8)+parseInt(_0x1eb99d(0x241))/0x9;if(_0x40b471===_0xb992a9)break;else _0x4e030a['push'](_0x4e030a['shift']());}catch(_0x27bfa4){_0x4e030a['push'](_0x4e030a['shift']());}}}(a62_0x7f71,0x27541));import{watch,nextTick}from'vue';function a62_0x1c50(_0x5dc9a0,_0x20ed37){const _0x7f7132=a62_0x7f71();return a62_0x1c50=function(_0x1c506c,_0x44c5ba){_0x1c506c=_0x1c506c-0x178;let _0xedead0=_0x7f7132[_0x1c506c];return _0xedead0;},a62_0x1c50(_0x5dc9a0,_0x20ed37);}function a62_0x7f71(){const _0x4fdc81=['onMultiDelete','comp','_lastSearchParams','listProp','limit','split','正在提交...','ElDatePicker','mobile','export2Csv','needCount','_loading','textarea','views','setJson','canSearch','handleAdd','_trimForm','index','injectAddParams','\x2000:00:00','$sleep','Papa','getSearchExportParams','shouldTrim','title','_getMethods','_focusDialogInput','search-attributes','getDeleteParams','text','isInfinite','handleCancel','beforeDelete','_clearValidate','hasOwnProperty','_visibleColumns','72AlMDiq','total','page','onSearch','label','searcher','isArray','getAddParams','afterEdit','DynamicLibs','forEach','1403109DvgVXS','53694iudZxO','19117NuBvqh','endsWith','Sheets','afterDelete','_isMobile','XLSX','tagValues','getSearchParams','handleSearch','query','$refs','_initSearching','focus','type','err','validate','不支持的导出类型','formatList','导出中...','injectList','list','input','func','uid','x-date-picker','onExport','afterAdd','visible','toLowerCase','handleSubmit','_index','number','keys','46417CQDRJj','model','injectUpdateParams','handleExport','getJson','resetValidation','data','string','catch','loading','trim','values','_checkAllNone','handleSave','injectDeleteParams','deepCopy','disabled','prop','beforeAdd','processExportingColumns','formatter','onInit','idField','slice','config','toString','$local','querySelectorAll','dialog','formRef','Settings[','indexOf','finished','find','表单所有数据都是空,确定要继续提交吗?','updatePartials','date','el-date-picker','XDatePicker','datetime','onDelete','exportType','count','getUpdateParams','radio','isEditing','handleMultiDelete','search','originData','search-export','injectSearchParams','some','handleEdit','current','el-input','stringify','read','initialForm','handleImport','_isSubmitting','viewName','handleLoad','service','onEdit','handleSearchExport','afterSearch','order','filter','tableAttrs','sheet_to_json','replace','mapField','name','尚未选择要删除的数据','handleKeywordsSearch','handleCancelEdit','_fillRelatedField','object','export2Excel','clearValidate','ref','join','boolean','use','processImportingData','1206095sknKbS','then','readonly','update','导入成功','formItems','assign','editingRow','_defaultFormatList','onCancelEdit','message','_initialLimit','onAdd','afterSubmit','onKeywordsSearch','processExporting','concat','onImport','handleSortChange','function','csv','value','beforeEdit','onRowEdit','excel','columns','expand','virtual','.csv','handleRowEdit','seperator','formatPrecision','1905624RmFEwo','attrs','currentRoute','parse','dbModelName','remove','_resetForm','map','length','get','bulkCreate','isRowEdit','add','确定删除选中的\x20','_unwatchs','Table','确定要删除吗?','push','processExportingData','_dbTable','options','moreLoading','_formatted_','ElInput','beforeSearch','precision','handleDelete','isMobile','.el-dialog','onSearchExport','includes','_validateForm','format','172pOXKbO','6648Uikxwz','arraybuffer','toType','form','setCurrentView','_showError','selection','table','onSubmit','dbTable'];a62_0x7f71=function(){return _0x4fdc81;};return a62_0x7f71();}import a62_0x2d812a from'./BaseController.js';import{Message,Confirm,Prompt}from'../utils/message.js';const {funcs,highdict,dates}=StardustJs,{file,excel}=StardustBrowser;class CrudController extends a62_0x2d812a{constructor(_0x3413ac){const _0x344cc0=a62_0x1c50;super(_0x3413ac);const {model:_0x139a6b,table:_0x3b6e2c,dialog:_0x280062,dbModelName:dbModelName='',idField:idField='id',listProp:listProp=_0x344cc0(0x26a)}=_0x3413ac;this[_0x344cc0(0x20e)]=_0x3b6e2c||_0x139a6b?.[_0x344cc0(0x20e)],this[_0x344cc0(0x18c)]=_0x280062||_0x139a6b?.[_0x344cc0(0x18c)],this[_0x344cc0(0x1e9)]=dbModelName,this['idField']=idField,this[_0x344cc0(0x214)]=listProp,this[_0x344cc0(0x1ab)]=![],this['_lastSearchParams']=null,this[_0x344cc0(0x1d0)]=this[_0x344cc0(0x20e)]?.[_0x344cc0(0x24c)]?.[_0x344cc0(0x215)],this[_0x344cc0(0x1f8)]=null,this[_0x344cc0(0x1f3)]=[],nextTick(()=>{const _0x165562=_0x344cc0,{name:_0x1cd66f}=this['route'],_0x15cf90=watch(()=>this['router'][_0x165562(0x1e7)],_0x34b7b7=>{const _0x2994a3=_0x165562;_0x1cd66f!==_0x34b7b7[_0x2994a3(0x1b8)]&&(this[_0x2994a3(0x1f3)]['forEach'](_0x4a4722=>_0x4a4722()),_0x15cf90());});});}[a62_0x3c28e5(0x185)](){const _0x4dc4b4=a62_0x3c28e5;super[_0x4dc4b4(0x185)](),this[_0x4dc4b4(0x20e)]?.[_0x4dc4b4(0x25a)]&&this['_initSearching']();}get[a62_0x3c28e5(0x210)](){const _0x4330bb=a62_0x3c28e5;if(!this[_0x4330bb(0x1f8)]){let [_0x1b32da,_0x271406]=this[_0x4330bb(0x1e9)]['split']('.');!_0x271406&&(_0x1b32da='',_0x271406=_0x1b32da),this['_dbTable']=new this[(_0x4330bb(0x1ae))][(_0x4330bb(0x1f4))](_0x1b32da,_0x271406);}return this[_0x4330bb(0x1f8)];}get['form'](){const _0x597b14=a62_0x3c28e5;if(this[_0x597b14(0x265)]?.['form']&&this[_0x597b14(0x18c)]?.[_0x597b14(0x20a)])throw'conflict\x20of\x20model.form\x20and\x20dialog.form';return this[_0x597b14(0x265)]?.['form']||this[_0x597b14(0x18c)]?.[_0x597b14(0x20a)];}[a62_0x3c28e5(0x22b)](){const _0x1d2ad9=a62_0x3c28e5;return[...super['_getMethods'](),_0x1d2ad9(0x1ba),_0x1d2ad9(0x24b),_0x1d2ad9(0x221),_0x1d2ad9(0x1a4),'handleDelete',_0x1d2ad9(0x1e2),_0x1d2ad9(0x267),_0x1d2ad9(0x1b0),'handleImport',_0x1d2ad9(0x19e),_0x1d2ad9(0x17d),_0x1d2ad9(0x260),_0x1d2ad9(0x231),_0x1d2ad9(0x1d7),_0x1d2ad9(0x1ad),'onSearch','onAdd',_0x1d2ad9(0x1af),_0x1d2ad9(0x198),_0x1d2ad9(0x20f),'onCancel',_0x1d2ad9(0x1dc),_0x1d2ad9(0x1ce),_0x1d2ad9(0x25c),'onSearchExport',_0x1d2ad9(0x1d6),_0x1d2ad9(0x211),_0x1d2ad9(0x19f),_0x1d2ad9(0x1f1),'update',_0x1d2ad9(0x1ea),_0x1d2ad9(0x24a),'getAddParams',_0x1d2ad9(0x19b),'getDeleteParams','getSearchExportParams','injectSearchParams',_0x1d2ad9(0x224),_0x1d2ad9(0x266),_0x1d2ad9(0x17e),_0x1d2ad9(0x1fd),_0x1d2ad9(0x182),_0x1d2ad9(0x1db),_0x1d2ad9(0x232),'afterSearch',_0x1d2ad9(0x25d),_0x1d2ad9(0x23e),'afterDelete',_0x1d2ad9(0x1d2),'updatePartials',_0x1d2ad9(0x254),_0x1d2ad9(0x256),'processExportingColumns','processExportingData',_0x1d2ad9(0x1d4),'processImportingData',_0x1d2ad9(0x24e),_0x1d2ad9(0x1cd),_0x1d2ad9(0x1bc),_0x1d2ad9(0x1eb),'_clearValidate',_0x1d2ad9(0x222),_0x1d2ad9(0x204),_0x1d2ad9(0x17c),_0x1d2ad9(0x20c),'_focusDialogInput'];}async[a62_0x3c28e5(0x1ba)](_0x1c2a1c){const _0x1a7c5b=a62_0x3c28e5;this[_0x1a7c5b(0x213)]=null,_0x1c2a1c=_0x1c2a1c[_0x1a7c5b(0x1b6)](/,/g,'\x20')[_0x1a7c5b(0x216)]('\x20')['filter'](_0x1164e5=>_0x1164e5);if(!_0x1c2a1c['length'])return this[_0x1a7c5b(0x24b)]({'page':0x1});let {searchFields:_0x5e2066,columns:_0x3155be}=this[_0x1a7c5b(0x20e)];!_0x5e2066[_0x1a7c5b(0x1ed)]&&(_0x5e2066=[...new Set(_0x3155be[_0x1a7c5b(0x1b3)](_0x39fb3f=>{const _0x4472e9=_0x1a7c5b;if(typeof _0x39fb3f[_0x4472e9(0x220)]==='boolean')return _0x39fb3f['canSearch'];return _0x39fb3f[_0x4472e9(0x181)]&&_0x39fb3f[_0x4472e9(0x250)]!==_0x4472e9(0x262)&&!_0x39fb3f[_0x4472e9(0x212)]&&!_0x39fb3f[_0x4472e9(0x1e0)];})[_0x1a7c5b(0x1ec)](_0x14a47f=>_0x14a47f['prop']))]);if(!_0x5e2066[_0x1a7c5b(0x1ed)])return this[_0x1a7c5b(0x24b)]({'page':0x1});const _0x10db26=_0x1c2a1c[_0x1a7c5b(0x1ec)](_0x2bb23d=>{const _0x34c58f=_0x1a7c5b,_0x4eaeb3=[];return _0x5e2066[_0x34c58f(0x240)](_0x469d97=>{const _0x4ed5d3=_0x34c58f;_0x4eaeb3[_0x4ed5d3(0x1f6)]({[_0x469d97]:{'[Op.like]':'%'+_0x2bb23d+'%'}});}),{'[Op.or]':_0x4eaeb3};});return this[_0x1a7c5b(0x24b)]({'page':0x1,'where':{'[Op.and]':_0x10db26}});}async[a62_0x3c28e5(0x24b)](_0x2b6b5f,{isInfinite:isInfinite=![]}={}){const _0x20ccd0=a62_0x3c28e5;if(_0x2b6b5f instanceof Event)_0x2b6b5f=null;this['table'][_0x20ccd0(0x230)]=isInfinite;if(this['table']['loading']||!await this[_0x20ccd0(0x1fd)](_0x2b6b5f))return;_0x2b6b5f=this['getSearchParams'](_0x2b6b5f),this[_0x20ccd0(0x1a2)](_0x2b6b5f),this[_0x20ccd0(0x20e)][_0x20ccd0(0x179)]=!![];const _0x3a5c24=await this[_0x20ccd0(0x19f)](_0x2b6b5f);let _0x47bd0c=highdict[_0x20ccd0(0x1ee)](_0x3a5c24,this[_0x20ccd0(0x214)]);return _0x47bd0c=this[_0x20ccd0(0x254)](this[_0x20ccd0(0x1cd)](_0x47bd0c,_0x3a5c24),_0x3a5c24),_0x47bd0c[_0x20ccd0(0x240)](this[_0x20ccd0(0x256)]),Object[_0x20ccd0(0x1cb)](this['table'],{'list':_0x47bd0c,'total':_0x3a5c24[_0x20ccd0(0x237)],'loading':![]}),this[_0x20ccd0(0x1b1)](_0x47bd0c,_0x2b6b5f,_0x3a5c24),_0x3a5c24;}async[a62_0x3c28e5(0x221)](){const _0x1293d9=a62_0x3c28e5;if(!await this['beforeAdd']())return;this[_0x1293d9(0x1eb)](),Object[_0x1293d9(0x1cb)](this['dialog'],{'visible':!![],'isEditing':![]}),await nextTick(),await funcs['sleep'](0x32),this[_0x1293d9(0x233)](),this[_0x1293d9(0x22c)](),this[_0x1293d9(0x25d)]();}async[a62_0x3c28e5(0x1a4)]({$index:_0x2ebb99,row:_0x24518e}){const _0x3a9b9b=a62_0x3c28e5;if(!await this[_0x3a9b9b(0x1db)]({'$index':_0x2ebb99,'row':_0x24518e}))return;if(this['table']?.[_0x3a9b9b(0x1f0)])_0x24518e[_0x3a9b9b(0x1a0)]=JSON[_0x3a9b9b(0x1a7)](_0x24518e),_0x24518e['isEditing']=!![];else{this[_0x3a9b9b(0x1eb)]();const _0x3e0533={...this['dialog'][_0x3a9b9b(0x20a)],..._0x24518e};this[_0x3a9b9b(0x18c)][_0x3a9b9b(0x1ca)]['forEach'](_0x56b6cb=>{const _0xeabafa=_0x3a9b9b;_0x56b6cb[_0xeabafa(0x1e3)]&&typeof _0x3e0533[_0x56b6cb[_0xeabafa(0x181)]]===_0xeabafa(0x26b)&&(_0x3e0533[_0x56b6cb[_0xeabafa(0x181)]]=_0x3e0533[_0x56b6cb[_0xeabafa(0x181)]]['split'](_0x56b6cb['seperator']));}),Object['assign'](this[_0x3a9b9b(0x18c)],{'visible':!![],'isEditing':!![],'editingIndex':_0x2ebb99,'editingRow':_0x24518e,'form':_0x3e0533}),await nextTick(),this['dialog'][_0x3a9b9b(0x18d)]?.[_0x3a9b9b(0x252)]()[_0x3a9b9b(0x178)](Function()),this[_0x3a9b9b(0x22c)]();}this[_0x3a9b9b(0x23e)]({'$index':_0x2ebb99,'row':_0x24518e});}async['handleDelete']({$index:_0x3aac0b,row:_0x31d471}){const _0x1e4813=a62_0x3c28e5;if(this[_0x1e4813(0x20e)]['loading'])return;if(!await this[_0x1e4813(0x232)]({'$index':_0x3aac0b,'row':_0x31d471}))return;const _0x17c8f1=await Confirm['w']({'message':_0x1e4813(0x1f5),'title':'警告'});if(!_0x17c8f1)return;this[_0x1e4813(0x20e)][_0x1e4813(0x179)]=!![];const _0x216152=this[_0x1e4813(0x22e)](_0x31d471);this['injectDeleteParams'](_0x216152);const _0x80b168=await this['remove'](_0x216152,_0x31d471);this[_0x1e4813(0x20e)][_0x1e4813(0x179)]=![];if(_0x80b168['err'])return;this[_0x1e4813(0x246)](_0x80b168),this[_0x1e4813(0x24b)]();}async['handleRowEdit']({row:_0x3be092}){const _0x5af0c8=a62_0x3c28e5;if(_0x3be092[_0x5af0c8(0x21c)])return;_0x3be092[_0x5af0c8(0x21c)]=!![];const _0x28a828=this['getUpdateParams'](_0x3be092);this['injectUpdateParams'](_0x28a828);if(!await this[_0x5af0c8(0x17c)](_0x28a828)){_0x3be092['_loading']=![];return;}try{await this['update'](_0x3be092[this[_0x5af0c8(0x186)]],_0x28a828);}catch(_0x2f0185){this['_showError'](_0x2f0185[_0x5af0c8(0x26a)][_0x5af0c8(0x251)]),_0x3be092[_0x5af0c8(0x21c)]=![];return;}delete _0x3be092['originData'],_0x3be092[_0x5af0c8(0x19d)]=![],_0x3be092[_0x5af0c8(0x21c)]=![];}async[a62_0x3c28e5(0x1bb)]({row:_0x56c1b5}){const _0x28cade=a62_0x3c28e5;Object[_0x28cade(0x1cb)](_0x56c1b5,JSON['parse'](_0x56c1b5['originData'])),delete _0x56c1b5['originData'],_0x56c1b5[_0x28cade(0x19d)]=![];}async[a62_0x3c28e5(0x267)](_0x1453d0=this['exportType'],_0x424c6d){const _0x155b89=a62_0x3c28e5;_0x424c6d||=this[_0x155b89(0x20e)][_0x155b89(0x1c0)][_0x155b89(0x22a)]||document[_0x155b89(0x22a)];if(this[_0x155b89(0x20e)]['loading'])return;if(_0x1453d0 instanceof Event)_0x1453d0='';_0x1453d0=_0x1453d0||this[_0x155b89(0x188)][_0x155b89(0x199)]||_0x155b89(0x1d9);if(![_0x155b89(0x1d9),_0x155b89(0x1dd)][_0x155b89(0x203)](_0x1453d0)){Message(_0x155b89(0x253));return;}this['table'][_0x155b89(0x179)]=!![];const {list:_0x1f8e39,selection:_0x4f5b27,ref:_0xa10792}=this[_0x155b89(0x20e)];let _0x310a0b=_0x4f5b27[_0x155b89(0x1ed)]>0x0?_0x4f5b27:_0x1f8e39;_0x310a0b=funcs[_0x155b89(0x17f)](_0x310a0b),_0x310a0b=this[_0x155b89(0x1f7)](_0x310a0b);const _0x897b51=this[_0x155b89(0x183)](_0xa10792[_0x155b89(0x235)],'current'),_0xe8cdde=_0x897b51[_0x155b89(0x1ec)](_0x4d4ba0=>_0x4d4ba0[_0x155b89(0x181)]),_0x3f27c7=_0x897b51['map'](_0x42c869=>_0x42c869[_0x155b89(0x23a)]);_0x310a0b=_0x310a0b[_0x155b89(0x1ec)](_0x413b9e=>_0xe8cdde['map'](_0xc61a2b=>_0x413b9e[_0xc61a2b]));let _0x353591=null;_0x1453d0===_0x155b89(0x1d9)?_0x353591=excel[_0x155b89(0x21a)]:_0x353591=excel['export2Excel'];let _0x50fcee={'list':_0x1f8e39,'header':_0x3f27c7,'data':_0x310a0b,'filename':_0x424c6d};_0x50fcee=await this[_0x155b89(0x1d4)](_0x50fcee),_0x353591(_0x50fcee),this[_0x155b89(0x20e)][_0x155b89(0x179)]=![];}async[a62_0x3c28e5(0x1b0)](_0x554794=this[a62_0x3c28e5(0x199)],_0x2818a1){const _0x568953=a62_0x3c28e5;_0x2818a1||=this['table']['ref'][_0x568953(0x22a)]||document['title'];if(this[_0x568953(0x20e)]['loading']){Message['w'](_0x568953(0x255));return;}_0x554794=_0x554794||this[_0x568953(0x188)][_0x568953(0x199)]||_0x568953(0x1d9);if(![_0x568953(0x1d9),'excel']['includes'](_0x554794)){Message(_0x568953(0x253));return;}this[_0x568953(0x20e)]['loading']=!![];const _0x3ab349=await this[_0x568953(0x210)][_0x568953(0x19f)](this[_0x568953(0x228)]());let _0x26003a=_0x3ab349[_0x568953(0x26a)];_0x26003a=this[_0x568953(0x254)](_0x26003a,_0x3ab349),_0x26003a[_0x568953(0x240)](this[_0x568953(0x256)]),_0x26003a=this[_0x568953(0x1f7)](_0x26003a,'search');const _0x5e5ab9=this[_0x568953(0x183)](this['table'][_0x568953(0x1c0)][_0x568953(0x235)],_0x568953(0x1a1)),_0xc69117=_0x5e5ab9[_0x568953(0x1ec)](_0x2c6496=>_0x2c6496[_0x568953(0x181)]),_0x34b4b1=_0x5e5ab9['map'](_0xec2e77=>_0xec2e77[_0x568953(0x23a)]);_0x26003a=_0x26003a['map'](_0x4722c0=>_0xc69117[_0x568953(0x1ec)](_0x1ee806=>_0x4722c0[_0x1ee806]));let _0x1ba00=null;_0x554794===_0x568953(0x1d9)?_0x1ba00=excel[_0x568953(0x21a)]:_0x1ba00=excel[_0x568953(0x1be)];let _0x10bc44={'list':_0x3ab349[_0x568953(0x26a)],'header':_0x34b4b1,'data':_0x26003a,'filename':_0x2818a1};_0x10bc44=await this[_0x568953(0x1d4)](_0x10bc44),_0x1ba00(_0x10bc44),this[_0x568953(0x20e)][_0x568953(0x179)]=![];}async[a62_0x3c28e5(0x1aa)](){const _0x1bd9b3=a62_0x3c28e5;if(this['table'][_0x1bd9b3(0x179)])return;const _0x40be8b=await file['select']('.xlsx,.csv');this['table']['loading']=!![];const _0x42a3ce=_0x40be8b[_0x1bd9b3(0x1b8)][_0x1bd9b3(0x25f)]()['endsWith'](_0x1bd9b3(0x1e1)),_0x5490d0=await file[_0x1bd9b3(0x209)](_0x40be8b,_0x42a3ce?_0x1bd9b3(0x22f):_0x1bd9b3(0x208));let _0x40f046=[];if(_0x42a3ce)await window['DynamicLibs']?.[_0x1bd9b3(0x1c3)](_0x1bd9b3(0x227)),_0x40f046=window['Papa'][_0x1bd9b3(0x1e8)](_0x5490d0,{'header':!![]})[_0x1bd9b3(0x26a)];else{await window[_0x1bd9b3(0x23f)]?.[_0x1bd9b3(0x1c3)](_0x1bd9b3(0x248));const _0x1100a0=window[_0x1bd9b3(0x248)][_0x1bd9b3(0x1a8)](_0x5490d0,{}),_0x431b7c=Object[_0x1bd9b3(0x17b)](_0x1100a0[_0x1bd9b3(0x245)]);_0x40f046=XLSX['utils'][_0x1bd9b3(0x1b5)](_0x431b7c[0x0]);}if(_0x40f046[_0x1bd9b3(0x1ed)]>0x0){const _0x2e52d9={};this[_0x1bd9b3(0x20e)][_0x1bd9b3(0x1de)][_0x1bd9b3(0x240)](_0x28f35d=>_0x2e52d9[_0x28f35d[_0x1bd9b3(0x23a)]]=_0x28f35d[_0x1bd9b3(0x181)]);const _0x23acab=Object[_0x1bd9b3(0x263)](_0x40f046[0x0]);_0x40f046=_0x40f046['map'](_0x1a00b1=>{const _0x4e5696={};return _0x23acab['forEach'](_0x344fc1=>_0x4e5696[_0x2e52d9[_0x344fc1]]=_0x1a00b1[_0x344fc1]),_0x4e5696;});}_0x40f046=this[_0x1bd9b3(0x1c4)](_0x40f046),await this[_0x1bd9b3(0x210)][_0x1bd9b3(0x259)]([_0x1bd9b3(0x1ef),_0x40f046]),Message['s'](_0x1bd9b3(0x1c9)),this[_0x1bd9b3(0x20e)][_0x1bd9b3(0x179)]=![],this[_0x1bd9b3(0x24b)]();}async['handleMultiDelete'](){const _0x3f90ef=a62_0x3c28e5;if(this['table'][_0x3f90ef(0x179)])return;const {selection:_0x36f583}=this[_0x3f90ef(0x20e)];if(!_0x36f583[_0x3f90ef(0x1ed)]){Message['w'](_0x3f90ef(0x1b9));return;}const _0x23fc83=await Confirm['w']({'title':'警告','message':_0x3f90ef(0x1f2)+_0x36f583[_0x3f90ef(0x1ed)]+'\x20条数据吗?'});if(!_0x23fc83)return;this['table'][_0x3f90ef(0x179)]=!![];const _0x5a4617=_0x36f583[_0x3f90ef(0x1ec)](_0x28252b=>_0x28252b[this[_0x3f90ef(0x186)]]);await this[_0x3f90ef(0x210)]['func'](['destroy',{'where':{[this[_0x3f90ef(0x186)]]:{'[Op.in]':_0x5a4617}}}]),this[_0x3f90ef(0x20e)][_0x3f90ef(0x179)]=![],this[_0x3f90ef(0x24b)]();}async[a62_0x3c28e5(0x17d)](_0x171fbe){const _0x3998cb=a62_0x3c28e5;_0x171fbe=_0x171fbe instanceof Event?this['form']:_0x171fbe;if(this[_0x3998cb(0x1ab)]){Message['w']('正在保存...');return;}const _0x36d569=this['model'][_0x3998cb(0x18d)]||this[_0x3998cb(0x18c)][_0x3998cb(0x18d)];if(!await this[_0x3998cb(0x204)](_0x36d569))return;this[_0x3998cb(0x1ab)]=!![];const _0x4958ad=this[_0x3998cb(0x23d)](_0x171fbe);this['injectAddParams'](_0x4958ad);if(!await this['_checkAllNone'](_0x4958ad)){this['_isSubmitting']=![];return;}let _0x54d93c=null;try{_0x171fbe[this[_0x3998cb(0x186)]]?_0x54d93c=await this['update'](_0x171fbe[this[_0x3998cb(0x186)]],_0x4958ad):_0x54d93c=await this[_0x3998cb(0x1f1)](_0x4958ad);}catch(_0x5067e0){this[_0x3998cb(0x20c)](_0x5067e0[_0x3998cb(0x26a)]['err']),this['_isSubmitting']=![];return;}this[_0x3998cb(0x1ab)]=![];if(!_0x54d93c['err'])Message['s']('保存成功');return this['router']['go'](-0x1),_0x54d93c;}async['handleSubmit'](_0x498a1a){const _0x1b8168=a62_0x3c28e5;_0x498a1a=_0x498a1a instanceof Event?null:_0x498a1a;if(this[_0x1b8168(0x1ab)])return Message['w'](_0x1b8168(0x217)),![];if(!this['dialog']['visible'])return![];this[_0x1b8168(0x1ab)]=!![];const _0x28d002=_0x498a1a||this[_0x1b8168(0x20a)];if(!_0x498a1a){(this[_0x1b8168(0x18c)][_0x1b8168(0x229)]??!![])&&Object['assign'](_0x28d002,this[_0x1b8168(0x222)](_0x28d002));if(!await this[_0x1b8168(0x204)]())return Message['w']('请正确填写'),this[_0x1b8168(0x1ab)]=![],![];}let _0x227166=null;try{if(this['dialog'][_0x1b8168(0x19d)]){const _0x2bbe87=this['getUpdateParams'](_0x28d002);this[_0x1b8168(0x266)](_0x2bbe87);if(!await this[_0x1b8168(0x17c)](_0x2bbe87))return this[_0x1b8168(0x1ab)]=![],![];_0x227166=await this[_0x1b8168(0x1c8)](this[_0x1b8168(0x18c)][_0x1b8168(0x1cc)][this[_0x1b8168(0x186)]],_0x2bbe87);}else{const _0x34a547=this[_0x1b8168(0x23d)](_0x28d002);this[_0x1b8168(0x224)](_0x34a547);if(!await this['_checkAllNone'](_0x34a547))return this[_0x1b8168(0x1ab)]=![],![];_0x227166=await this[_0x1b8168(0x1f1)](_0x34a547);}}catch(_0x1eadf8){return this[_0x1b8168(0x20c)](_0x1eadf8[_0x1b8168(0x26a)][_0x1b8168(0x251)]),this[_0x1b8168(0x1ab)]=![],![];}return this[_0x1b8168(0x18c)][_0x1b8168(0x25e)]=![],this[_0x1b8168(0x1ab)]=![],!_0x227166[_0x1b8168(0x251)]&&this[_0x1b8168(0x24b)](),this[_0x1b8168(0x1d2)](_0x227166),_0x227166;}[a62_0x3c28e5(0x231)](){const _0x2f9dd9=a62_0x3c28e5;this[_0x2f9dd9(0x18c)]['visible']=![];}[a62_0x3c28e5(0x1d7)](_0x1d44be){const _0x46771f=a62_0x3c28e5;if(!_0x1d44be)this[_0x46771f(0x20e)][_0x46771f(0x24c)][_0x46771f(0x1b2)]=[];else{if(Array[_0x46771f(0x23c)](_0x1d44be))this['table'][_0x46771f(0x24c)][_0x46771f(0x1b2)]=_0x1d44be;else{const {prop:_0x340070,order:_0x239eb5}=_0x1d44be;this[_0x46771f(0x20e)][_0x46771f(0x24c)][_0x46771f(0x1b2)]=!_0x340070||!_0x239eb5?[]:[[_0x340070,_0x239eb5['slice'](0x0,-0x6)]];}}this[_0x46771f(0x24b)]();}async[a62_0x3c28e5(0x1ad)](){const _0x1a7ec2=a62_0x3c28e5,{query:_0x29dec9}=this[_0x1a7ec2(0x20e)];if(!this[_0x1a7ec2(0x20e)]['list'][_0x1a7ec2(0x1ed)])return await this['handleSearch'](),_0x29dec9[_0x1a7ec2(0x238)]*_0x29dec9[_0x1a7ec2(0x215)]>=this['table'][_0x1a7ec2(0x237)]&&(this[_0x1a7ec2(0x20e)]['finished']=!![]),this[_0x1a7ec2(0x20e)]['moreLoading']=![];const {loading:_0x5923df,total:_0x2f3487}=this[_0x1a7ec2(0x20e)];if(_0x5923df||!_0x2f3487||this['table'][_0x1a7ec2(0x190)])return this[_0x1a7ec2(0x20e)][_0x1a7ec2(0x1fa)]=![];if(_0x29dec9[_0x1a7ec2(0x238)]*_0x29dec9[_0x1a7ec2(0x215)]>=_0x2f3487)return this[_0x1a7ec2(0x20e)][_0x1a7ec2(0x1fa)]=![],this['table'][_0x1a7ec2(0x190)]=!![];this[_0x1a7ec2(0x20e)]['isInfinite']=!![],_0x29dec9[_0x1a7ec2(0x238)]++;const _0x43389e=this[_0x1a7ec2(0x20e)][_0x1a7ec2(0x257)][_0x1a7ec2(0x187)]();await this['handleSearch']({},{'isInfinite':!![]});while(this['table'][_0x1a7ec2(0x179)]){await this[_0x1a7ec2(0x226)](0x14);}this[_0x1a7ec2(0x20e)][_0x1a7ec2(0x179)]=!![],await this[_0x1a7ec2(0x226)](0x32),this[_0x1a7ec2(0x20e)]['list']=_0x43389e['concat'](this[_0x1a7ec2(0x20e)][_0x1a7ec2(0x257)]),this[_0x1a7ec2(0x20e)][_0x1a7ec2(0x179)]=![],this[_0x1a7ec2(0x20e)][_0x1a7ec2(0x1fa)]=![];}[a62_0x3c28e5(0x1ee)](_0x4cfc8c){const _0x2db54c=a62_0x3c28e5;return this[_0x2db54c(0x210)][_0x2db54c(0x1ee)](_0x4cfc8c);}[a62_0x3c28e5(0x19f)](_0x5a2cfd){const _0x44b5a1=a62_0x3c28e5;this['_lastSearchParams']=JSON[_0x44b5a1(0x1a7)](_0x5a2cfd);if(this[_0x44b5a1(0x20e)]?.['uid']){const _0x599674=_0x44b5a1(0x18e)+this[_0x44b5a1(0x20e)]['uid']+']',_0x4bf448=this[_0x44b5a1(0x18a)][_0x44b5a1(0x268)](_0x599674,{});(_0x4bf448['limit']||_0x5a2cfd[_0x44b5a1(0x215)]!==this[_0x44b5a1(0x1d0)])&&(_0x4bf448['limit']=_0x5a2cfd[_0x44b5a1(0x215)]),Object[_0x44b5a1(0x263)](_0x4bf448)[_0x44b5a1(0x1ed)]&&this[_0x44b5a1(0x18a)][_0x44b5a1(0x21f)](_0x599674,_0x4bf448);}return this[_0x44b5a1(0x210)][_0x44b5a1(0x19f)](_0x5a2cfd);}[a62_0x3c28e5(0x1f1)](_0x1aa33f){const _0x60f78e=a62_0x3c28e5;return this['dbTable'][_0x60f78e(0x1f1)](_0x1aa33f);}[a62_0x3c28e5(0x1c8)](_0x108bea,_0x1b1bee){return this['dbTable']['update'](_0x108bea,_0x1b1bee);}[a62_0x3c28e5(0x1ea)](_0x5e7340,_0x57d7be){const _0x78429d=a62_0x3c28e5;return this[_0x78429d(0x210)][_0x78429d(0x1ea)](_0x5e7340[this['idField']]);}[a62_0x3c28e5(0x24a)](_0x4fc893,_0x14dec2=!![]){const _0x2ecac5=a62_0x3c28e5;if(_0x14dec2){if(_0x4fc893?.[_0x2ecac5(0x238)])this['table'][_0x2ecac5(0x24c)]['page']=_0x4fc893[_0x2ecac5(0x238)];if(_0x4fc893?.[_0x2ecac5(0x215)])this['table']['query'][_0x2ecac5(0x215)]=_0x4fc893['limit'];}return Object[_0x2ecac5(0x1cb)]({'where':{}},JSON[_0x2ecac5(0x1e8)](this[_0x2ecac5(0x213)]),this[_0x2ecac5(0x20e)][_0x2ecac5(0x24c)],_0x4fc893);}[a62_0x3c28e5(0x23d)](_0x23aad4){const _0x77899e=a62_0x3c28e5,_0x22c493=Object[_0x77899e(0x263)](this[_0x77899e(0x18c)][_0x77899e(0x1a9)]),_0x57238c={};return!_0x22c493[_0x77899e(0x1ed)]?Object[_0x77899e(0x1cb)](_0x57238c,_0x23aad4):_0x22c493[_0x77899e(0x240)](_0x46d59f=>_0x57238c[_0x46d59f]=_0x23aad4[_0x46d59f]),this['dialog'][_0x77899e(0x1ca)][_0x77899e(0x240)](_0x1f67cb=>{const _0x433fd6=_0x77899e;if(!_0x1f67cb[_0x433fd6(0x265)]&&!_0x1f67cb[_0x433fd6(0x181)]||_0x1f67cb[_0x433fd6(0x1e0)])return;let _0x5274c2=_0x57238c[_0x1f67cb[_0x433fd6(0x265)]||_0x1f67cb[_0x433fd6(0x181)]];if(_0x1f67cb[_0x433fd6(0x250)]===_0x433fd6(0x262))_0x5274c2=this['uiUtils'][_0x433fd6(0x1e4)](_0x5274c2,_0x1f67cb[_0x433fd6(0x1fe)]||0x3)*0x1;else{if([_0x433fd6(0x218),_0x433fd6(0x195),_0x433fd6(0x196),_0x433fd6(0x25b)][_0x433fd6(0x203)](_0x1f67cb[_0x433fd6(0x212)])){if(_0x1f67cb['type']===_0x433fd6(0x197))_0x5274c2=dates[_0x433fd6(0x205)](_0x5274c2);else(!_0x1f67cb[_0x433fd6(0x250)]||_0x1f67cb['type']===_0x433fd6(0x194))&&(_0x5274c2=dates['format'](_0x5274c2,'',![]));}}if(Array[_0x433fd6(0x23c)](_0x5274c2)){const {seperator:seperator=','}=_0x1f67cb;seperator&&(_0x5274c2=_0x5274c2[_0x433fd6(0x1c1)](seperator));}else _0x5274c2&&typeof _0x5274c2===_0x433fd6(0x1bd)&&(_0x5274c2=JSON['stringify'](_0x5274c2,null,0x4));_0x5274c2===''&&(_0x1f67cb[_0x433fd6(0x212)]&&![_0x433fd6(0x1fc),_0x433fd6(0x1a6)]['includes'](_0x1f67cb['comp'])&&(_0x5274c2=null)),_0x57238c[_0x1f67cb[_0x433fd6(0x265)]||_0x1f67cb[_0x433fd6(0x181)]]=_0x5274c2;}),_0x57238c;}['getUpdateParams'](_0xc43884){const _0x51d892=a62_0x3c28e5;return this[_0x51d892(0x23d)](_0xc43884);}[a62_0x3c28e5(0x22e)](_0x9a4e39){const _0x9c865c=a62_0x3c28e5;return{[this[_0x9c865c(0x186)]]:_0x9a4e39[this[_0x9c865c(0x186)]]};}[a62_0x3c28e5(0x228)](){const _0x43b6c9=a62_0x3c28e5,_0x232ae9=this['getSearchParams']();return this[_0x43b6c9(0x1a2)](_0x232ae9),Object['assign']({},_0x232ae9,{'page':0x1,'limit':-0x1,'attributes':this[_0x43b6c9(0x183)](this[_0x43b6c9(0x20e)][_0x43b6c9(0x1c0)][_0x43b6c9(0x235)],_0x43b6c9(0x22d))[_0x43b6c9(0x1ec)](_0x258d91=>_0x258d91[_0x43b6c9(0x181)])});}[a62_0x3c28e5(0x1a2)](_0x59e37c){}[a62_0x3c28e5(0x224)](_0x1b0112){}[a62_0x3c28e5(0x266)](_0x326b9c){const _0x234a07=a62_0x3c28e5;this[_0x234a07(0x224)](_0x326b9c);}[a62_0x3c28e5(0x17e)](_0x2092ed){}[a62_0x3c28e5(0x1fd)](_0x17d119){return!![];}[a62_0x3c28e5(0x182)](){return!![];}[a62_0x3c28e5(0x1db)]({$index:_0x47ad1b,row:_0x414a27}){return!![];}[a62_0x3c28e5(0x232)]({$index:_0x2cc9ee,row:_0x1360de}){return!![];}[a62_0x3c28e5(0x1b1)](_0x21973a,_0x45f638,_0x2ef6ef){const _0x2a76de=a62_0x3c28e5,_0x59bd1b=JSON[_0x2a76de(0x1a7)](_0x45f638);if(this[_0x2a76de(0x20e)][_0x2a76de(0x24c)][_0x2a76de(0x19a)]===![]&&this[_0x2a76de(0x20e)][_0x2a76de(0x21b)]){if(_0x59bd1b!==this[_0x2a76de(0x213)]){const {page:_0xedb499,limit:_0x1ca9ca,order:_0x284c0c,count:_0xd0510a,..._0x421dad}=_0x45f638;this[_0x2a76de(0x210)][_0x2a76de(0x259)]([_0x2a76de(0x19a),_0x421dad])[_0x2a76de(0x1c6)](_0x5e6738=>this['table'][_0x2a76de(0x237)]=_0x5e6738[_0x2a76de(0x26a)]);}}}[a62_0x3c28e5(0x25d)](){}[a62_0x3c28e5(0x23e)]({$index:_0x46f13f,row:_0x2cae5a}){}['afterDelete'](_0x162c20){}['afterSubmit'](_0x2c325){}async[a62_0x3c28e5(0x193)]({row:_0x1e4349},_0x5635c5=[]){const _0xf59bb8=a62_0x3c28e5;if(!_0x5635c5[_0xf59bb8(0x1ed)])return;this[_0xf59bb8(0x20e)][_0xf59bb8(0x179)]=!![];const _0x5f4fb1={};_0x5635c5[_0xf59bb8(0x240)](_0x47bd82=>_0x5f4fb1[_0x47bd82]=_0x1e4349[_0x47bd82]),await this[_0xf59bb8(0x1c8)](_0x1e4349[this[_0xf59bb8(0x186)]],_0x5f4fb1),this['table'][_0xf59bb8(0x179)]=![];}[a62_0x3c28e5(0x24e)](){const _0x3fdab3=a62_0x3c28e5;this[_0x3fdab3(0x20e)][_0x3fdab3(0x179)]=!![];const _0x14ad39={},_0x138bbb=this[_0x3fdab3(0x18a)][_0x3fdab3(0x268)]('Settings['+this[_0x3fdab3(0x20e)][_0x3fdab3(0x25a)]+']');if(_0x138bbb){if(_0x138bbb['viewName']){const _0xadbdcc=this[_0x3fdab3(0x20e)][_0x3fdab3(0x1c0)][_0x3fdab3(0x24d)][_0x3fdab3(0x23b)],_0x2afef6=_0xadbdcc[_0x3fdab3(0x21e)][_0x3fdab3(0x191)](_0x3b5f23=>_0x3b5f23[_0x3fdab3(0x1b8)]===_0x138bbb[_0x3fdab3(0x1ac)]);_0xadbdcc[_0x3fdab3(0x20b)](_0x2afef6);try{Object[_0x3fdab3(0x1cb)](_0x14ad39,_0xadbdcc['calcParams']());}catch{}}_0x138bbb['limit']&&(this[_0x3fdab3(0x20e)][_0x3fdab3(0x24c)][_0x3fdab3(0x215)]=_0x138bbb[_0x3fdab3(0x215)],_0x14ad39['limit']=_0x138bbb['limit']),_0x138bbb['order']?.[_0x3fdab3(0x1ed)]&&(this[_0x3fdab3(0x20e)][_0x3fdab3(0x24c)][_0x3fdab3(0x1b2)]=_0x138bbb[_0x3fdab3(0x1b2)],_0x14ad39['order']=_0x138bbb[_0x3fdab3(0x1b2)]);}this[_0x3fdab3(0x20e)][_0x3fdab3(0x179)]=![],this[_0x3fdab3(0x24b)](_0x14ad39);}['_defaultFormatList'](_0x571b80,_0x303d5b){const _0x1c9309=a62_0x3c28e5,{columns:_0x1ae218,query:_0x15357d}=this[_0x1c9309(0x20e)],{page:_0x3cc6a9,limit:_0x58824e}=_0x15357d;return _0x571b80[_0x1c9309(0x240)]((_0xb5df62,_0x2eaa29)=>{_0xb5df62['_idx']=_0x2eaa29+0x1,_0xb5df62['_index']=(_0x3cc6a9-0x1)*_0x58824e+_0x2eaa29+0x1;}),_0x1ae218[_0x1c9309(0x240)](_0x497ac9=>{const _0x3f340c=_0x1c9309;let {prop:_0xa235e4,options:_0x5899aa,seperator:_0x263a50}=_0x497ac9;const {format:_0x4784fc,autoFill:_0x446419}=_0x497ac9['tableAttrs']||{},{modelName:_0x33ee84}=_0x497ac9['formAttrs']||{};if(_0x33ee84&&_0x446419)_0x571b80[_0x3f340c(0x240)](_0x40bb2=>_0x40bb2[_0x3f340c(0x1fb)+_0xa235e4]=''),this[_0x3f340c(0x1bc)](_0x571b80,_0x497ac9);else{if(Array[_0x3f340c(0x23c)](_0x5899aa)&&_0x4784fc!==![]){const _0x2c7549=(_0x2e0e31,_0x553811)=>{const _0x2a8f3d=_0x3f340c,_0x1af932=_0x553811?this[_0x2a8f3d(0x20e)]['list']:_0x571b80,_0x512499=makeOptionsKvMap(_0x497ac9);_0x1af932[_0x2a8f3d(0x240)]((_0x49cd77,_0x34bfb9)=>{const _0x23c634=_0x2a8f3d,_0x403f08=highdict['get'](_0x49cd77,_0xa235e4);_0x49cd77[_0x23c634(0x1fb)+_0xa235e4]=_0x512499[_0x403f08]||_0x403f08;});},_0x3158e2=watch(()=>_0x497ac9['options'],_0x2c7549,{'immediate':!![],'deep':!![]});this[_0x3f340c(0x1f3)][_0x3f340c(0x1f6)](_0x3158e2);}}_0x263a50&&_0x571b80[_0x3f340c(0x240)](_0x172e17=>{const _0x355723=_0x3f340c;typeof _0x172e17[_0xa235e4]===_0x355723(0x26b)&&(_0x172e17[_0xa235e4]=_0x172e17[_0xa235e4][_0x355723(0x216)](_0x263a50));});}),_0x571b80;}async[a62_0x3c28e5(0x1bc)](_0x5c64d4,_0x1f8635){const _0x292efb=a62_0x3c28e5,_0x4ee7d0=[...new Set(_0x5c64d4[_0x292efb(0x1ec)](_0x4823f7=>_0x4823f7[_0x1f8635[_0x292efb(0x181)]]))];if(!_0x4ee7d0['length'])return;const {modelName:_0x32b092,text:_0x342c4f,value:_0x45810a}=_0x1f8635['formAttrs'],_0x5dc339=await this[_0x292efb(0x1ae)]['restful'][_0x292efb(0x19f)](_0x32b092,{'limit':-0x1,'attributes':[_0x342c4f,_0x45810a],'where':{[_0x45810a]:{'[Op.in]':_0x4ee7d0}}});if(!_0x5dc339['data'][_0x292efb(0x1ed)])return;const _0x460f54=highdict[_0x292efb(0x1b7)](_0x5dc339[_0x292efb(0x26a)],_0x45810a,_0x342c4f);this[_0x292efb(0x20e)][_0x292efb(0x257)][_0x292efb(0x240)](_0x43eb34=>{const _0x4d8e63=_0x292efb;_0x43eb34['_formatted_'+_0x1f8635[_0x4d8e63(0x181)]]=_0x460f54[_0x43eb34[_0x1f8635[_0x4d8e63(0x181)]]];});}[a62_0x3c28e5(0x254)](_0x323aa4,_0x3174e9){return _0x323aa4;}[a62_0x3c28e5(0x256)](_0x345453,_0x584816,_0x1aff25){}[a62_0x3c28e5(0x183)](_0xe76076,_0x2e9ff3=a62_0x3c28e5(0x1a5)){const _0x46319d=a62_0x3c28e5;return _0xe76076['filter'](_0x3bb876=>{const _0x2b9cae=a62_0x1c50;return![_0x2b9cae(0x223),_0x2b9cae(0x20d),_0x2b9cae(0x1df),_0x2b9cae(0x19c),_0x2b9cae(0x261)][_0x2b9cae(0x203)](_0x3bb876[_0x2b9cae(0x250)]);})[_0x46319d(0x1b3)](_0x9720fb=>{const _0x1441f4=_0x46319d;return _0x2e9ff3===_0x1441f4(0x1a1)?!![]:!_0x9720fb['virtual'];});}[a62_0x3c28e5(0x1f7)](_0x203b20,_0xd919b3=a62_0x3c28e5(0x1a5)){const _0x118d67=a62_0x3c28e5;if(!_0x203b20['length'])return _0x203b20;const _0x6733f9={};this[_0x118d67(0x20e)][_0x118d67(0x1c0)][_0x118d67(0x235)]['forEach'](_0x1065b7=>{const _0x2e1112=_0x118d67;let {formatter:formatter=_0x1065b7[_0x2e1112(0x184)],tagValues:tagValues=_0x1065b7['tagValues'],options:options=_0x1065b7[_0x2e1112(0x1f9)]}=_0x1065b7[_0x2e1112(0x1b4)]||{};if(!formatter&&typeof tagValues===_0x2e1112(0x1d8))formatter=tagValues;_0x6733f9[_0x1065b7[_0x2e1112(0x181)]]={'formatter':formatter,'tagValues':tagValues,'options':options};});const _0x547352=[...new Set(Object[_0x118d67(0x263)](_0x203b20[0x0])[_0x118d67(0x1d5)](this[_0x118d67(0x20e)][_0x118d67(0x1c0)][_0x118d67(0x235)][_0x118d67(0x1ec)](_0x398649=>_0x398649[_0x118d67(0x181)])[_0x118d67(0x1b3)](_0x4592e7=>_0x4592e7)))];return _0x203b20[_0x118d67(0x240)](_0x1810e8=>{_0x547352['forEach'](_0x2f7f25=>{const _0x5426e4=a62_0x1c50,_0x570dd1=_0x1810e8[_0x2f7f25];if(_0x1810e8[_0x5426e4(0x234)](_0x5426e4(0x1fb)+_0x2f7f25))return _0x1810e8[_0x2f7f25]=_0x1810e8[_0x5426e4(0x1fb)+_0x2f7f25];if(_0x6733f9[_0x2f7f25]?.['formatter'])return _0x1810e8[_0x2f7f25]=_0x6733f9[_0x2f7f25][_0x5426e4(0x184)](_0x570dd1,_0x1810e8);if(_0x6733f9[_0x2f7f25]?.[_0x5426e4(0x249)])return _0x1810e8[_0x2f7f25]=_0x6733f9[_0x2f7f25][_0x5426e4(0x249)][_0x570dd1];if(_0x6733f9[_0x2f7f25]?.[_0x5426e4(0x1f9)])return _0x1810e8[_0x2f7f25]=_0x6733f9[_0x2f7f25]['options'][_0x5426e4(0x191)](_0x3324c8=>_0x3324c8[_0x5426e4(0x1da)]===_0x1810e8[_0x2f7f25])?.[_0x5426e4(0x22f)]??_0x1810e8[_0x2f7f25];if(typeof _0x570dd1===_0x5426e4(0x1c2))_0x1810e8[_0x2f7f25]=_0x570dd1&&0x1||0x0;else{if(_0x570dd1 instanceof Date)_0x1810e8[_0x2f7f25]=dates[_0x5426e4(0x205)](_0x570dd1),_0x1810e8[_0x2f7f25][_0x5426e4(0x244)](_0x5426e4(0x225))&&(_0x1810e8[_0x2f7f25]=_0x1810e8[_0x2f7f25][_0x5426e4(0x187)](0x0,-0x9));else _0x570dd1===undefined&&(_0x1810e8[_0x2f7f25]=highdict[_0x5426e4(0x1ee)](_0x1810e8,_0x2f7f25));}});}),_0x203b20[_0x118d67(0x240)](_0x9a4868=>{const _0x645853=_0x118d67;_0x547352[_0x645853(0x240)](_0xa42061=>{const _0x169fdc=_0x645853;_0x9a4868[_0xa42061]&&typeof _0x9a4868[_0xa42061]===_0x169fdc(0x1bd)&&(_0x9a4868[_0xa42061]=JSON[_0x169fdc(0x1a7)](_0x9a4868[_0xa42061]));});}),_0x203b20;}[a62_0x3c28e5(0x1d4)](_0x2d6871){return _0x2d6871;}[a62_0x3c28e5(0x1c4)](_0x192464){const _0x14f9a5=a62_0x3c28e5;return _0x192464[_0x14f9a5(0x240)](_0x9a4ca9=>{const _0x3ae42b=_0x14f9a5;delete _0x9a4ca9[this[_0x3ae42b(0x186)]],delete _0x9a4ca9[_0x3ae42b(0x261)];}),_0x192464;}['_resetForm'](_0x6317bd=this[a62_0x3c28e5(0x18c)]){const _0x4ac940=a62_0x3c28e5;_0x6317bd['form']=JSON['parse'](JSON[_0x4ac940(0x1a7)](_0x6317bd[_0x4ac940(0x1a9)]));}['_trimForm'](_0x1277cb){const _0x4ea12d=a62_0x3c28e5;_0x1277cb||=this['dialog'][_0x4ea12d(0x20a)];const _0x54f8df={};for(let _0xe30a86 in _0x1277cb){_0x1277cb[_0xe30a86]?.[_0x4ea12d(0x17a)]?_0x54f8df[_0xe30a86]=_0x1277cb[_0xe30a86][_0x4ea12d(0x17a)]():_0x54f8df[_0xe30a86]=_0x1277cb[_0xe30a86];}return _0x54f8df;}['_validateForm'](_0x498d40){const _0x880524=a62_0x3c28e5,_0x52ac=_0x498d40||this[_0x880524(0x18c)]['formRef'];if(_0x52ac)return new Promise(_0x3f5625=>{const _0x3ad28a=_0x880524;this[_0x3ad28a(0x247)]?_0x52ac[_0x3ad28a(0x252)]()[_0x3ad28a(0x1c6)](()=>_0x3f5625(!![]))[_0x3ad28a(0x178)](()=>_0x3f5625(![])):_0x52ac['validate'](_0x5cc78b=>_0x3f5625(_0x5cc78b))['catch'](()=>_0x3f5625(![]));});return!![];}[a62_0x3c28e5(0x233)](_0x45caa7=this[a62_0x3c28e5(0x18c)][a62_0x3c28e5(0x18d)]){const _0x21db24=a62_0x3c28e5;_0x45caa7&&(this[_0x21db24(0x247)]?_0x45caa7[_0x21db24(0x269)]():_0x45caa7[_0x21db24(0x1bf)]());}async[a62_0x3c28e5(0x17c)](_0x381160){const _0x4fb2af=a62_0x3c28e5,_0x1363f7=[null,undefined,''],_0x69a671=Object[_0x4fb2af(0x17b)](_0x381160)[_0x4fb2af(0x1a3)](_0x2d15e7=>!_0x1363f7[_0x4fb2af(0x203)](_0x2d15e7));if(_0x69a671)return!![];return Confirm['w']({'message':_0x4fb2af(0x192),'title':'警告'});}['_showError'](_0x4f95d1){const _0x53aad5=a62_0x3c28e5;Message(typeof _0x4f95d1===_0x53aad5(0x1bd)?_0x4f95d1[_0x53aad5(0x1cf)]||_0x4f95d1[_0x53aad5(0x251)]||_0x4f95d1[_0x53aad5(0x189)]():_0x4f95d1);}['_focusDialogInput'](){const _0x3dcaf7=a62_0x3c28e5,_0x207862=document['querySelector'](_0x3dcaf7(0x201));if(!_0x207862)return;let _0x13fe1e=[..._0x207862[_0x3dcaf7(0x18b)](_0x3dcaf7(0x258))][_0x3dcaf7(0x1b3)](_0x14f298=>!_0x14f298[_0x3dcaf7(0x180)]&&!_0x14f298['readonly']),_0x54f6a5=_0x13fe1e['find'](_0xfe5800=>_0xfe5800['type']===_0x3dcaf7(0x22f)||_0xfe5800[_0x3dcaf7(0x250)]===_0x3dcaf7(0x262));!_0x54f6a5&&(_0x13fe1e=[..._0x207862[_0x3dcaf7(0x18b)](_0x3dcaf7(0x21d))][_0x3dcaf7(0x1b3)](_0x2f927d=>!_0x2f927d[_0x3dcaf7(0x180)]&&!_0x2f927d[_0x3dcaf7(0x1c7)]),_0x54f6a5=_0x13fe1e[0x0]),_0x54f6a5?.[_0x3dcaf7(0x24f)]();}get[a62_0x3c28e5(0x247)](){const _0xc69302=a62_0x3c28e5,_0x27caa4=this[_0xc69302(0x20e)]?.[_0xc69302(0x18d)]||this[_0xc69302(0x18c)]?.[_0xc69302(0x18d)];if(_0x27caa4)return _0x27caa4['$'][_0xc69302(0x1e6)]['class'][_0xc69302(0x18f)](_0xc69302(0x219))>=0x0;return window[_0xc69302(0x200)];}[a62_0x3c28e5(0x1d3)](..._0x323d12){return this['handleKeywordsSearch'](..._0x323d12);}[a62_0x3c28e5(0x239)](..._0x5459dc){return this['handleSearch'](..._0x5459dc);}[a62_0x3c28e5(0x1d1)](..._0x391370){const _0x136eac=a62_0x3c28e5;return this[_0x136eac(0x221)](..._0x391370);}[a62_0x3c28e5(0x1af)](..._0x2ddff8){return this['handleEdit'](..._0x2ddff8);}[a62_0x3c28e5(0x198)](..._0x14d9ec){const _0x3ca21c=a62_0x3c28e5;return this[_0x3ca21c(0x1ff)](..._0x14d9ec);}[a62_0x3c28e5(0x20f)](..._0x5652cb){const _0x3e5418=a62_0x3c28e5;return this[_0x3e5418(0x260)](..._0x5652cb);}['onCancel'](..._0x409e25){return this['handleCancel'](..._0x409e25);}[a62_0x3c28e5(0x1dc)](..._0x52c8f4){return this['handleRowEdit'](..._0x52c8f4);}['onCancelEdit'](..._0x4d1e3a){const _0x3e7893=a62_0x3c28e5;return this[_0x3e7893(0x1bb)](..._0x4d1e3a);}['onExport'](..._0x5263b4){const _0x105670=a62_0x3c28e5;return this[_0x105670(0x267)](..._0x5263b4);}[a62_0x3c28e5(0x202)](..._0x1e8aa){const _0xbe763b=a62_0x3c28e5;return this[_0xbe763b(0x1b0)](..._0x1e8aa);}[a62_0x3c28e5(0x1d6)](..._0x4ddb6f){return this['handleImport'](..._0x4ddb6f);}[a62_0x3c28e5(0x211)](..._0xdc84d7){const _0x33ed83=a62_0x3c28e5;return this[_0x33ed83(0x19e)](..._0xdc84d7);}}const makeOptionsKvMap=_0x43bbad=>{const _0x5be51c=a62_0x3c28e5,{options:_0x5847a4,formAttrs:formAttrs={}}=_0x43bbad,{text:text=_0x5be51c(0x22f),value:value=_0x5be51c(0x1da)}=formAttrs,_0x200e1c={};return _0x5847a4&&typeof _0x5847a4===_0x5be51c(0x1bd)&&typeof _0x5847a4[0x0]==='object'&&_0x5847a4['forEach'](_0x476a21=>{_0x200e1c[_0x476a21[value]]=_0x476a21[text];}),_0x200e1c;};export default CrudController;
|