vome-core 0.3.8 → 0.3.9

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 (76) hide show
  1. package/dist/admin/components/ui/avatar/index.js +1 -1
  2. package/dist/admin/components/ui/checkbox/index.js +1 -1
  3. package/dist/admin/components/ui/dialog/DialogContent.vue +132 -0
  4. package/dist/admin/components/ui/dialog/index.js +1 -1
  5. package/dist/admin/components/ui/dropdown-menu/index.js +1 -1
  6. package/dist/admin/components/ui/input/Input.vue +12 -0
  7. package/dist/admin/components/ui/input/index.js +1 -1
  8. package/dist/admin/components/ui/label/index.js +1 -1
  9. package/dist/admin/components/ui/scroll-area/index.js +1 -1
  10. package/dist/admin/components/ui/select/SelectItem.vue +9 -0
  11. package/dist/admin/components/ui/select/SelectTrigger.vue +11 -0
  12. package/dist/admin/components/ui/select/index.js +1 -1
  13. package/dist/admin/components/ui/separator/index.js +1 -1
  14. package/dist/admin/components/ui/sheet/index.js +1 -1
  15. package/dist/admin/components/ui/sonner/index.js +1 -1
  16. package/dist/admin/components/ui/table/index.js +1 -1
  17. package/dist/admin/components/ui/tabs/index.js +1 -1
  18. package/dist/admin/components/ui/tooltip/index.js +1 -1
  19. package/dist/admin/components/vm-dept-tree.vue +79 -74
  20. package/dist/admin/components/vm-form-dialog.vue +630 -0
  21. package/dist/admin/crud/auto-fields.js +1 -1
  22. package/dist/admin/crud/components/vm-richtext-extensions.js +1 -1
  23. package/dist/admin/crud/config.js +1 -1
  24. package/dist/admin/crud/confirm.js +1 -1
  25. package/dist/admin/crud/crud-page-request.js +1 -1
  26. package/dist/admin/crud/data-i18n.js +1 -1
  27. package/dist/admin/crud/dict.js +1 -1
  28. package/dist/admin/crud/export-fetch.js +1 -1
  29. package/dist/admin/crud/key.js +1 -1
  30. package/dist/admin/crud/plugins.js +1 -1
  31. package/dist/admin/crud/span.js +1 -1
  32. package/dist/admin/crud/style.js +1 -1
  33. package/dist/admin/crud/validate.js +1 -1
  34. package/dist/admin/directives/perm.js +1 -1
  35. package/dist/admin/hooks/useUpload.js +1 -1
  36. package/dist/admin/lib/browser.js +1 -1
  37. package/dist/admin/lib/cn.js +1 -1
  38. package/dist/admin/lib/dialog-float.js +1 -1
  39. package/dist/admin/lib/export-excel.js +1 -1
  40. package/dist/admin/lib/import-excel.js +1 -1
  41. package/dist/admin/lib/json.js +1 -1
  42. package/dist/admin/lib/menu.js +1 -1
  43. package/dist/admin/lib/micro-locale.js +1 -1
  44. package/dist/admin/lib/micro-theme.js +1 -1
  45. package/dist/admin/lib/shell.js +1 -1
  46. package/dist/admin/lib/theme-color-options.js +1 -1
  47. package/dist/admin/lib/tree.js +1 -1
  48. package/dist/admin/lib/upload.js +1 -1
  49. package/dist/admin/lib/video-frame.js +1 -1
  50. package/dist/admin/router/create.js +1 -1
  51. package/dist/admin/router/guards.js +1 -1
  52. package/dist/admin/styles/base.css +2 -152
  53. package/dist/ai/index.js +1 -1
  54. package/dist/client/ai-model-registry.js +1 -1
  55. package/dist/client/base.js +1 -1
  56. package/dist/client/configure.js +1 -1
  57. package/dist/client/dict.js +1 -1
  58. package/dist/client/eps-payload.js +1 -1
  59. package/dist/client/eps.js +1 -1
  60. package/dist/client/index.js +1 -1
  61. package/dist/client/locale-store.js +1 -1
  62. package/dist/client/service.js +1 -1
  63. package/dist/client/vite-admin.js +1 -1
  64. package/dist/client/vite-auto-import.js +1 -1
  65. package/dist/client/vite-micro-proxy.js +1 -1
  66. package/dist/client/vite-plugin-eps.js +1 -1
  67. package/dist/client/vite-resolve.js +1 -1
  68. package/dist/config/index.js +1 -1
  69. package/dist/index.js +1 -1
  70. package/dist/server/index.js +1 -1
  71. package/dist/shared/datetime-picker.js +1 -1
  72. package/dist/shared/excel.js +1 -1
  73. package/dist/shared/index.js +1 -1
  74. package/dist/shared/locale-json.js +1 -1
  75. package/dist/shared/tree.js +1 -1
  76. package/package.json +1 -1
@@ -0,0 +1,630 @@
1
+ <template>
2
+ <Dialog
3
+ :open="open"
4
+ @update:open="(v) => (!v ? onCloseClick() : undefined)"
5
+ >
6
+ <DialogContent
7
+ shell="crud"
8
+ :show-close-button="false"
9
+ class="vm-crud-upsert"
10
+ :class="{
11
+ 'is-empty': isBodyEmpty,
12
+ 'is-height': !!heightCss,
13
+ }"
14
+ :style="heightCss ? { '--vm-dialog-height': heightCss } : undefined"
15
+ @pointer-down-outside="preventDialogOutsideClose"
16
+ @focus-outside="preventDialogOutsideClose"
17
+ @interact-outside="preventDialogOutsideClose"
18
+ >
19
+ <DialogHeader class="vm-crud-shell__head">
20
+ <DialogTitle class="vm-crud-shell__title">{{ title }}</DialogTitle>
21
+ <slot name="title-extra" />
22
+ <DialogClose class="vm-crud-shell__close">
23
+ <i class="ri-close-line" />
24
+ <span class="sr-only">Close</span>
25
+ </DialogClose>
26
+ </DialogHeader>
27
+ <div
28
+ class="vm-crud-upsert__body"
29
+ :class="{ 'is-fill': layout === 'fill' }"
30
+ >
31
+ <template v-if="!isBodyEmpty">
32
+ <div
33
+ v-for="item in formItemsBeforeSlot"
34
+ :key="item.prop"
35
+ class="vm-crud-upsert__field"
36
+ :class="{ 'is-error': fieldErrors[item.prop] }"
37
+ :style="{ gridColumn: `span ${itemSpan(item)}` }"
38
+ >
39
+ <Label class="vm-crud-upsert__label">
40
+ {{ item.label }}
41
+ <span
42
+ v-if="resolveItemRequired(item, form)"
43
+ class="vm-crud-upsert__req"
44
+ >*</span>
45
+ </Label>
46
+
47
+ <vm-radio
48
+ v-if="itemType(item) === 'radio'"
49
+ :name="`form-dialog-${item.prop}`"
50
+ :options="resolveOptions(item)"
51
+ :model-value="String(form[item.prop] ?? '')"
52
+ :disabled="readonly || item.disabled"
53
+ @update:model-value="(v) => setField(item.prop, v)"
54
+ />
55
+
56
+ <component
57
+ :is="resolveField(item)"
58
+ v-else-if="resolveField(item)"
59
+ :class="fieldClass(item)"
60
+ v-bind="fieldProps(item)"
61
+ :model-value="form[item.prop]"
62
+ :disabled="readonly || item.disabled"
63
+ @update:model-value="(v: unknown) => setField(item.prop, v)"
64
+ />
65
+
66
+ <Input
67
+ v-else
68
+ class="vm-crud-upsert__control"
69
+ v-bind="inputBind(item)"
70
+ :placeholder="item.placeholder"
71
+ :disabled="readonly || item.disabled"
72
+ :aria-invalid="fieldErrors[item.prop] ? true : undefined"
73
+ :model-value="
74
+ form[item.prop] == null ? '' : (form[item.prop] as string | number)
75
+ "
76
+ @update:model-value="(v) => setField(item.prop, v)"
77
+ />
78
+ <p v-if="fieldErrors[item.prop]" class="vm-crud-upsert__error">
79
+ {{ fieldErrors[item.prop] }}
80
+ </p>
81
+ </div>
82
+ <slot :form="form" />
83
+ <div
84
+ v-for="item in formItemsAfterSlot"
85
+ :key="item.prop"
86
+ class="vm-crud-upsert__field"
87
+ :class="{ 'is-error': fieldErrors[item.prop] }"
88
+ :style="{ gridColumn: `span ${itemSpan(item)}` }"
89
+ >
90
+ <Label class="vm-crud-upsert__label">
91
+ {{ item.label }}
92
+ <span
93
+ v-if="resolveItemRequired(item, form)"
94
+ class="vm-crud-upsert__req"
95
+ >*</span>
96
+ </Label>
97
+
98
+ <div class="vm-crud-upsert__textarea-wrap">
99
+ <textarea
100
+ class="vm-crud-upsert__textarea"
101
+ :placeholder="item.placeholder"
102
+ :disabled="readonly || item.disabled"
103
+ :rows="textareaRows(item)"
104
+ :style="textareaStyle(item)"
105
+ :value="String(form[item.prop] ?? '')"
106
+ @input="setField(item.prop, ($event.target as HTMLTextAreaElement).value)"
107
+ />
108
+ <i
109
+ v-if="
110
+ textareaClearable(item) &&
111
+ String(form[item.prop] ?? '') !== '' &&
112
+ !readonly &&
113
+ !item.disabled
114
+ "
115
+ class="ri-close-circle-fill vm-crud-upsert__textarea-clear"
116
+ role="button"
117
+ tabindex="-1"
118
+ aria-label="清除"
119
+ @mousedown.prevent
120
+ @click="setField(item.prop, '')"
121
+ />
122
+ </div>
123
+ <p v-if="fieldErrors[item.prop]" class="vm-crud-upsert__error">
124
+ {{ fieldErrors[item.prop] }}
125
+ </p>
126
+ </div>
127
+ </template>
128
+ <div v-else class="vm-crud-upsert__empty">
129
+ <vm-empty kind="暂无内容" />
130
+ </div>
131
+ </div>
132
+ <DialogFooter v-if="footer !== false" class="vm-crud-shell__foot">
133
+ <slot
134
+ v-if="slots.footer"
135
+ name="footer"
136
+ v-bind="footerSlotProps"
137
+ />
138
+ <template v-else>
139
+ <slot name="footer-prepend" v-bind="footerSlotProps" />
140
+ <button
141
+ v-if="close !== false"
142
+ type="button"
143
+ class="vm-crud-shell__btn is-ghost"
144
+ :disabled="submitting"
145
+ @click="onCloseClick"
146
+ >
147
+ {{ closeText || '取消' }}
148
+ </button>
149
+ <button
150
+ v-if="confirm !== false && !readonly"
151
+ type="button"
152
+ class="vm-crud-shell__btn is-primary"
153
+ :disabled="submitting"
154
+ @click="onConfirmClick"
155
+ >
156
+ {{ submitting ? '提交中…' : confirmText || '确定' }}
157
+ </button>
158
+ <slot name="footer-append" v-bind="footerSlotProps" />
159
+ </template>
160
+ </DialogFooter>
161
+ </DialogContent>
162
+ </Dialog>
163
+ </template>
164
+
165
+ <script setup lang="ts">
166
+ import { ref, computed, watch, useSlots, toValue } from 'vue'
167
+ import { preventDialogOutsideClose } from '../lib/dialog-float'
168
+ import { resolveCrudComponent } from '../crud/registry'
169
+ import { resolveItemRequired, validateFormFields } from '../crud/validate'
170
+ import { resolveFormSpan, useFormCols } from '../crud/span'
171
+ import { mapDictOptions } from '../crud/auto-fields'
172
+ import type { CrudFormItem } from '../../../typings/admin/comm/crud'
173
+
174
+ defineOptions({ name: 'vm-form-dialog' })
175
+
176
+ export type VmFormDialogSubmitHelpers = {
177
+ /** 关闭弹窗并复位 submitting */
178
+ close: () => void
179
+ /** 仅复位 submitting(弹窗保持打开) */
180
+ done: () => void
181
+ }
182
+
183
+ const props = withDefaults(
184
+ defineProps<{
185
+ open?: boolean
186
+ /** 表单数据(v-model) */
187
+ modelValue?: Record<string, unknown>
188
+ title?: string
189
+ items?: CrudFormItem[]
190
+ height?: string | number
191
+ confirm?: boolean
192
+ close?: boolean
193
+ footer?: boolean
194
+ confirmText?: string
195
+ closeText?: string
196
+ layout?: 'form' | 'fill'
197
+ /** 只读:隐藏确定、控件禁用 */
198
+ readonly?: boolean
199
+ }>(),
200
+ {
201
+ open: false,
202
+ modelValue: () => ({}),
203
+ title: '',
204
+ items: () => [],
205
+ confirm: true,
206
+ close: true,
207
+ footer: true,
208
+ layout: 'form',
209
+ readonly: false,
210
+ },
211
+ )
212
+
213
+ const emit = defineEmits<{
214
+ 'update:open': [v: boolean]
215
+ 'update:modelValue': [v: Record<string, unknown>]
216
+ close: []
217
+ /** 校验通过后触发;业务自行请求,完成后调用 helpers.close() */
218
+ submit: [data: Record<string, unknown>, helpers: VmFormDialogSubmitHelpers]
219
+ }>()
220
+
221
+ const slots = useSlots()
222
+ const formCols = useFormCols()
223
+ const submitting = ref(false)
224
+ const fieldErrors = ref<Record<string, string>>({})
225
+
226
+ const form = computed({
227
+ get: () => props.modelValue || {},
228
+ set: (v) => emit('update:modelValue', v),
229
+ })
230
+
231
+ function normalizeHeight(h?: string | number) {
232
+ if (h == null || h === '') return ''
233
+ if (typeof h === 'number') return `${h}px`
234
+ return String(h)
235
+ }
236
+
237
+ const heightCss = computed(() => normalizeHeight(props.height))
238
+
239
+ const visibleItems = computed(() =>
240
+ (props.items || []).filter((it) => {
241
+ if (typeof it.hidden === 'function') return !it.hidden(form.value)
242
+ return !it.hidden
243
+ }),
244
+ )
245
+
246
+ const formItemsBeforeSlot = computed(() =>
247
+ visibleItems.value.filter((it) => itemType(it) !== 'textarea'),
248
+ )
249
+ const formItemsAfterSlot = computed(() =>
250
+ visibleItems.value.filter((it) => itemType(it) === 'textarea'),
251
+ )
252
+
253
+ const isBodyEmpty = computed(
254
+ () => !visibleItems.value.length && !slots.default,
255
+ )
256
+
257
+ const footerSlotProps = computed(() => ({
258
+ close: onCloseClick,
259
+ submit: onConfirmClick,
260
+ confirm: onConfirmClick,
261
+ submitting: submitting.value,
262
+ form: form.value,
263
+ }))
264
+
265
+ function setField(prop: string, value: unknown) {
266
+ if (props.readonly) return
267
+ if (fieldErrors.value[prop]) {
268
+ const next = { ...fieldErrors.value }
269
+ delete next[prop]
270
+ fieldErrors.value = next
271
+ }
272
+ form.value = { ...form.value, [prop]: value }
273
+ }
274
+
275
+ function inputBind(item: CrudFormItem) {
276
+ if (itemType(item) !== 'number') return {}
277
+ const raw = toValue(item.component?.props)
278
+ if (raw && typeof raw === 'object' && !Array.isArray(raw)) {
279
+ return raw as Record<string, unknown>
280
+ }
281
+ return { type: 'number', controls: false }
282
+ }
283
+
284
+ function itemType(item: CrudFormItem) {
285
+ if (item.type) return item.type
286
+ const name = item.component?.name
287
+ if (typeof name !== 'string') return 'input'
288
+ if (name === 'vm-switch') return 'switch'
289
+ if (name === 'vm-select' || name === 'vm-tree-select') return 'select'
290
+ return 'input'
291
+ }
292
+
293
+ function fieldClass(item: CrudFormItem) {
294
+ const name = item.component?.name
295
+ if (itemType(item) === 'switch') return 'vm-crud-upsert__switch-field'
296
+ if (name === 'vm-upload' || name === 'upload') return 'vm-crud-upsert__upload-field'
297
+ if (name === 'vm-markdown') return 'vm-crud-upsert__markdown-field'
298
+ if (name === 'vm-json-editor') return 'vm-crud-upsert__json-field'
299
+ if (name === 'vm-richtext') return 'vm-crud-upsert__richtext-field'
300
+ return 'vm-crud-upsert__control'
301
+ }
302
+
303
+ function resolveField(item: CrudFormItem) {
304
+ if (itemType(item) === 'radio' || itemType(item) === 'textarea') return undefined
305
+ const name = item.component?.name
306
+ if (typeof name === 'string') {
307
+ if (name === 'upload') return resolveCrudComponent('vm-upload')
308
+ const comp = resolveCrudComponent(name)
309
+ if (comp) return comp
310
+ } else if (name) {
311
+ return name
312
+ }
313
+ if (item.type === 'switch') return resolveCrudComponent('vm-switch')
314
+ if (item.type === 'select') {
315
+ if (item.multiple) return resolveCrudComponent('vm-multi-select')
316
+ return resolveCrudComponent('vm-select')
317
+ }
318
+ return undefined
319
+ }
320
+
321
+ function fieldProps(item: CrudFormItem) {
322
+ const raw = item.component?.props
323
+ const unwrapped = toValue(raw)
324
+ if (Array.isArray(unwrapped)) {
325
+ return {
326
+ options: unwrapped,
327
+ placeholder: item.placeholder,
328
+ refreshOnChange: false,
329
+ }
330
+ }
331
+ return {
332
+ options: resolveOptions(item),
333
+ placeholder: item.placeholder,
334
+ refreshOnChange: false,
335
+ ...(unwrapped && typeof unwrapped === 'object'
336
+ ? (unwrapped as Record<string, unknown>)
337
+ : {}),
338
+ }
339
+ }
340
+
341
+ function resolveOptions(item: CrudFormItem | CrudFormItem['options']) {
342
+ if (item && typeof item === 'object' && 'prop' in item) {
343
+ const formItem = item as CrudFormItem
344
+ if (formItem.dict) return mapDictOptions(formItem.dict)
345
+ const list = formItem.options == null ? [] : toValue(formItem.options)
346
+ return Array.isArray(list) ? list : []
347
+ }
348
+ const list = item == null ? [] : toValue(item)
349
+ return Array.isArray(list) ? list : []
350
+ }
351
+
352
+ function itemSpan(item: CrudFormItem) {
353
+ return resolveFormSpan(item.span, formCols.value)
354
+ }
355
+
356
+ function textareaProps(item: CrudFormItem) {
357
+ const raw = toValue(item.component?.props)
358
+ if (!raw || typeof raw !== 'object' || Array.isArray(raw)) return {}
359
+ return raw as Record<string, unknown>
360
+ }
361
+
362
+ function textareaClearable(item: CrudFormItem) {
363
+ return textareaProps(item).clearable !== false
364
+ }
365
+
366
+ function textareaRows(item: CrudFormItem) {
367
+ const rows = textareaProps(item).rows
368
+ return typeof rows === 'number' || typeof rows === 'string' ? rows : undefined
369
+ }
370
+
371
+ function textareaStyle(item: CrudFormItem) {
372
+ const p = textareaProps(item)
373
+ const style: Record<string, string> = {
374
+ ...((p.style && typeof p.style === 'object'
375
+ ? (p.style as Record<string, string>)
376
+ : {}) as Record<string, string>),
377
+ }
378
+ if (p.height != null && p.height !== '') {
379
+ const h = typeof p.height === 'number' ? `${p.height}px` : String(p.height)
380
+ style.height = h
381
+ if (!style.minHeight) style.minHeight = h
382
+ }
383
+ return Object.keys(style).length ? style : undefined
384
+ }
385
+
386
+ function onCloseClick() {
387
+ submitting.value = false
388
+ fieldErrors.value = {}
389
+ emit('update:open', false)
390
+ emit('close')
391
+ }
392
+
393
+ async function onConfirmClick() {
394
+ if (props.readonly || submitting.value) return
395
+ const errors = await validateFormFields(visibleItems.value, form.value)
396
+ fieldErrors.value = errors
397
+ if (Object.keys(errors).length) return
398
+ submitting.value = true
399
+ const helpers: VmFormDialogSubmitHelpers = {
400
+ close: () => {
401
+ submitting.value = false
402
+ fieldErrors.value = {}
403
+ emit('update:open', false)
404
+ emit('close')
405
+ },
406
+ done: () => {
407
+ submitting.value = false
408
+ },
409
+ }
410
+ emit('submit', { ...form.value }, helpers)
411
+ }
412
+
413
+ watch(
414
+ () => props.open,
415
+ (open) => {
416
+ if (!open) {
417
+ submitting.value = false
418
+ fieldErrors.value = {}
419
+ return
420
+ }
421
+ const data = { ...form.value }
422
+ for (const it of props.items || []) {
423
+ if (data[it.prop] === undefined && it.value !== undefined) {
424
+ data[it.prop] = it.value
425
+ }
426
+ }
427
+ form.value = data
428
+ },
429
+ )
430
+
431
+ defineExpose({
432
+ form,
433
+ submit: onConfirmClick,
434
+ close: onCloseClick,
435
+ })
436
+ </script>
437
+
438
+ <style lang="scss" scoped>
439
+ .vm-crud-upsert__body {
440
+ display: grid;
441
+ flex: 1 1 auto;
442
+ grid-template-columns: repeat(24, minmax(0, 1fr));
443
+ gap: 16px;
444
+ min-height: 0;
445
+ overflow: auto;
446
+ overscroll-behavior: contain;
447
+ padding: 18px 22px;
448
+ align-content: start;
449
+
450
+ &.is-fill {
451
+ display: flex;
452
+ flex-direction: column;
453
+ align-items: stretch;
454
+ gap: 0;
455
+ padding: 0;
456
+
457
+ > * {
458
+ width: 100%;
459
+ min-width: 0;
460
+ }
461
+ }
462
+
463
+ /* slot 内容在宿主 SFC,须 :deep 才能命中 label / control 样式 */
464
+ :deep(.vm-crud-upsert__field) {
465
+ display: grid;
466
+ gap: 6px;
467
+ align-content: start;
468
+ min-width: 0;
469
+ }
470
+
471
+ :deep(.vm-crud-upsert__label) {
472
+ font-size: 12px;
473
+ color: var(--muted-foreground);
474
+ }
475
+
476
+ :deep(.vm-crud-upsert__req) {
477
+ color: var(--destructive);
478
+ }
479
+
480
+ :deep(.vm-crud-upsert__control) {
481
+ width: 100%;
482
+ height: var(--vm-control-height) !important;
483
+ min-height: var(--vm-control-height);
484
+ border-radius: var(--vm-control-radius) !important;
485
+ font-size: var(--vm-control-font-size) !important;
486
+ line-height: 1.4 !important;
487
+ }
488
+
489
+ /* Input 外壳:高度交给内部 input,避免 wrap 压扁清除按钮 */
490
+ :deep(.vm-input-wrap.vm-crud-upsert__control) {
491
+ height: auto !important;
492
+ min-height: var(--vm-control-height);
493
+ }
494
+
495
+ /* 单行 input:白底;select / tree-select 等:淡蓝底 */
496
+ :deep(input.vm-crud-upsert__control),
497
+ :deep(.vm-crud-upsert__control[data-slot='input']),
498
+ :deep(.vm-input-wrap.vm-crud-upsert__control input) {
499
+ background: var(--card) !important;
500
+ }
501
+
502
+ :deep(.vm-crud-select.vm-crud-upsert__control),
503
+ :deep(.vm-group-cascader.vm-crud-upsert__control),
504
+ :deep(.vm-multi-select.vm-crud-upsert__control),
505
+ :deep(.vm-date-picker.vm-crud-upsert__control),
506
+ :deep(.vm-icon-picker.vm-crud-upsert__control) {
507
+ background: var(--muted) !important;
508
+ }
509
+
510
+ :deep(.vm-tree-select.vm-crud-upsert__control .vm-tree-select__trigger) {
511
+ background: var(--muted) !important;
512
+ }
513
+
514
+ @media (max-width: 768px) {
515
+ grid-template-columns: repeat(12, minmax(0, 1fr));
516
+ flex: 1 1 auto;
517
+ min-height: 0;
518
+ gap: 10px;
519
+ padding: 10px 12px;
520
+ }
521
+ }
522
+
523
+ .vm-crud-upsert__empty {
524
+ grid-column: 1 / -1;
525
+ display: flex;
526
+ min-height: 160px;
527
+ align-items: center;
528
+ justify-content: center;
529
+ }
530
+
531
+ .vm-crud-upsert__field {
532
+ &.is-error :deep(.vm-crud-upsert__control) {
533
+ border-color: var(--destructive) !important;
534
+ }
535
+ }
536
+
537
+ .vm-crud-upsert__error {
538
+ margin: 0;
539
+ font-size: 12px;
540
+ line-height: 1.4;
541
+ color: var(--destructive);
542
+ }
543
+
544
+ :deep(.vm-group-cascader.vm-crud-upsert__control) {
545
+ height: auto !important;
546
+ min-height: var(--vm-control-height);
547
+ }
548
+
549
+ /* 上传:勿套用单行高度;多图时铺满 span 以便平铺换行 */
550
+ :deep(.vm-upload.vm-crud-upsert__upload-field) {
551
+ width: 100%;
552
+ max-width: 100%;
553
+ height: auto !important;
554
+ min-height: 0;
555
+ background: transparent !important;
556
+ }
557
+
558
+ /* Markdown:保留组件自身 min-height,勿被 control 行高压扁 */
559
+ :deep(.vm-markdown.vm-crud-upsert__markdown-field) {
560
+ width: 100%;
561
+ height: auto !important;
562
+ min-height: 0;
563
+ background: transparent !important;
564
+ }
565
+
566
+ /* JSON:与备注 textarea 同视觉,勿套单行 control */
567
+ :deep(.vm-json-editor.vm-crud-upsert__json-field) {
568
+ width: 100%;
569
+ height: auto !important;
570
+ min-height: 0;
571
+ background: transparent !important;
572
+ }
573
+
574
+ /* 富文本:保留组件默认 minHeight,勿被 control 行高压扁 */
575
+ :deep(.vm-richtext.vm-crud-upsert__richtext-field) {
576
+ width: 100%;
577
+ height: auto !important;
578
+ min-height: 0;
579
+ background: transparent !important;
580
+ }
581
+
582
+ :deep(.vm-crud-upsert__switch-field.vm-switch) {
583
+ width: 40px;
584
+ height: 22px;
585
+ margin-top: 8px;
586
+ }
587
+
588
+ .vm-crud-upsert__textarea-wrap {
589
+ position: relative;
590
+ width: 100%;
591
+ min-width: 0;
592
+ }
593
+
594
+ .vm-crud-upsert__textarea-clear {
595
+ position: absolute;
596
+ top: 10px;
597
+ right: var(--vm-control-padding-x);
598
+ z-index: 1;
599
+ color: var(--muted-foreground);
600
+ font-size: 14px;
601
+ line-height: 1;
602
+ cursor: pointer;
603
+
604
+ &:hover {
605
+ color: var(--foreground);
606
+ }
607
+ }
608
+
609
+ .vm-crud-upsert__textarea,
610
+ :deep(.vm-crud-upsert__textarea) {
611
+ width: 100%;
612
+ min-height: 72px;
613
+ padding: 8px 28px 8px var(--vm-control-padding-x);
614
+ border: 1px solid var(--input);
615
+ border-radius: var(--vm-control-radius);
616
+ background: var(--muted);
617
+ color: var(--foreground);
618
+ font-size: 14px;
619
+ line-height: 1.5;
620
+ resize: vertical;
621
+ outline: none;
622
+ transition: border-color 0.15s ease;
623
+
624
+ &:focus,
625
+ &:focus-visible {
626
+ border-color: var(--focus-border);
627
+ box-shadow: none;
628
+ }
629
+ }
630
+ </style>
@@ -1 +1 @@
1
- const _0x4f9bbd=_0x4f1c;(function(_0x25ec11,_0x633a0e){const _0x10afb6=_0x4f1c,_0xb070d0=_0x25ec11();while(!![]){try{const _0x368cb8=-parseInt(_0x10afb6(0x203))/0x1+parseInt(_0x10afb6(0x1e2))/0x2+-parseInt(_0x10afb6(0x207))/0x3+parseInt(_0x10afb6(0x1f3))/0x4*(-parseInt(_0x10afb6(0x1dd))/0x5)+-parseInt(_0x10afb6(0x20e))/0x6*(parseInt(_0x10afb6(0x1fe))/0x7)+-parseInt(_0x10afb6(0x1f7))/0x8*(-parseInt(_0x10afb6(0x206))/0x9)+parseInt(_0x10afb6(0x1ed))/0xa;if(_0x368cb8===_0x633a0e)break;else _0xb070d0['push'](_0xb070d0['shift']());}catch(_0x243b38){_0xb070d0['push'](_0xb070d0['shift']());}}}(_0x5ca9,0x29ed6));import{findEpsEntity}from'../lib/eps';import{getDictOptions}from'../../client';export const UPSERT_BUILTIN_IGNORE=['id',_0x4f9bbd(0x1d5),_0x4f9bbd(0x1df),'updateTime',_0x4f9bbd(0x1ee)];export const TABLE_BUILTIN_IGNORE=[_0x4f9bbd(0x1ee),_0x4f9bbd(0x1e7)];function dictKeyOf(_0x310070){const _0x3fb2ce=_0x4f9bbd;if(typeof _0x310070['dict']===_0x3fb2ce(0x1e0)&&_0x310070['dict'])return _0x310070[_0x3fb2ce(0x1de)];if(Array[_0x3fb2ce(0x1e5)](_0x310070[_0x3fb2ce(0x1de)])&&_0x310070[_0x3fb2ce(0x1de)][0x0])return _0x310070['dict'][0x0];return;}function isSwitchDict(_0x2da269){const _0x126c2f=_0x4f9bbd;return _0x2da269===_0x126c2f(0x1e6)||_0x2da269===_0x126c2f(0x1d3);}function switchFormItem(_0x4a3a61,_0x1ed74d,_0x25bfb6){return{..._0x4a3a61,'type':'switch','value':_0x25bfb6,'dict':_0x1ed74d,'component':{'props':()=>mapDictOptions(_0x1ed74d)}};}export function mapDictOptions(_0x136b3e){const _0x2596d0=_0x4f9bbd;return getDictOptions(_0x136b3e)[_0x2596d0(0x1f1)](_0x3534e7=>{const _0x3ac02a=_0x2596d0;let _0x35d6f2=_0x3534e7[_0x3ac02a(0x1db)];return typeof _0x3534e7[_0x3ac02a(0x1db)]===_0x3ac02a(0x1e0)&&/^-?\d+(\.\d+)?$/[_0x3ac02a(0x1ef)](_0x3534e7[_0x3ac02a(0x1db)])&&(_0x35d6f2=Number(_0x3534e7[_0x3ac02a(0x1db)])),{'label':String(_0x3534e7['label']??''),'value':_0x35d6f2,'color':_0x3534e7[_0x3ac02a(0x1fc)]};});}function isMainTableCol(_0x4b158f){const _0x14a657=_0x4f9bbd;return!_0x4b158f['source']||_0x4b158f[_0x14a657(0x1e9)]['startsWith']('a.');}function epsColumns(_0x5d9f5b){const _0x320985=_0x4f9bbd,_0x1ea518=_0x5d9f5b['namespace']?findEpsEntity('/'+_0x5d9f5b[_0x320985(0x20b)]):undefined;if(!_0x1ea518)return[];const _0x399b98=[..._0x1ea518[_0x320985(0x1d1)]||[],..._0x1ea518['pageColumns']||[]],_0x395cde=new Set(),_0x4f9a15=[];for(const _0x2f9094 of _0x399b98){if(!_0x2f9094[_0x320985(0x200)]||!isMainTableCol(_0x2f9094))continue;if(_0x395cde[_0x320985(0x1fb)](_0x2f9094[_0x320985(0x200)]))continue;_0x395cde['add'](_0x2f9094['propertyName']),_0x4f9a15[_0x320985(0x1e8)](_0x2f9094);}return _0x4f9a15;}function columnTypeOf(_0x43fef2){const _0x44d4e2=_0x4f9bbd;return String(_0x43fef2[_0x44d4e2(0x1d8)]||'');}function sqlTypeOf(_0x5da6a8){const _0x440469=_0x4f9bbd;return String(_0x5da6a8[_0x440469(0x1ea)]||'')[_0x440469(0x202)]();}function isTextCol(_0x53211c){const _0x2d5e0c=_0x4f9bbd,_0x2d0e69=columnTypeOf(_0x53211c);if(_0x2d0e69===_0x2d5e0c(0x208))return!![];return sqlTypeOf(_0x53211c)===_0x2d5e0c(0x209);}function isIntegerCol(_0x13de9b){const _0x498f30=_0x4f9bbd,_0x42692f=columnTypeOf(_0x13de9b);if(_0x42692f===_0x498f30(0x1dc)||_0x42692f===_0x498f30(0x204)||_0x42692f===_0x498f30(0x20c)||_0x42692f===_0x498f30(0x1f8)||_0x42692f===_0x498f30(0x1f9)||_0x42692f==='PgBigSerial')return!![];if(_0x13de9b[_0x498f30(0x1fa)]==='number'&&!isNumericCol(_0x13de9b))return!![];return/^(integer|serial|smallint|bigint|smallserial|bigserial)\b/[_0x498f30(0x1ef)](sqlTypeOf(_0x13de9b));}function isNumericCol(_0x16fff8){const _0x1dbb1e=_0x4f9bbd,_0x31f4a8=columnTypeOf(_0x16fff8);if(_0x31f4a8===_0x1dbb1e(0x1f6)||_0x31f4a8===_0x1dbb1e(0x1d4)||_0x31f4a8==='PgReal')return!![];return/^(numeric|decimal|double|real)\b/[_0x1dbb1e(0x1ef)](sqlTypeOf(_0x16fff8));}function isBooleanCol(_0x4ca9d5){const _0x3a6bfb=_0x4f9bbd;return columnTypeOf(_0x4ca9d5)===_0x3a6bfb(0x205)||_0x4ca9d5['type']===_0x3a6bfb(0x201)||sqlTypeOf(_0x4ca9d5)[_0x3a6bfb(0x1e4)]('boolean');}function numberPrecision(_0x3fe966){const _0x4e852d=_0x4f9bbd;if(isIntegerCol(_0x3fe966))return 0x0;if(typeof _0x3fe966[_0x4e852d(0x1ec)]===_0x4e852d(0x20a))return _0x3fe966[_0x4e852d(0x1ec)];return 0x2;}function _0x4f1c(_0x51901b,_0x1e5139){_0x51901b=_0x51901b-0x1cf;const _0x5ca9e7=_0x5ca9();let _0x4f1c1c=_0x5ca9e7[_0x51901b];if(_0x4f1c['YAmFKa']===undefined){var _0x26d109=function(_0x7a08aa){const _0x4aa226='abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789+/=';let _0x310070='',_0x2da269='';for(let _0x4a3a61=0x0,_0x1ed74d,_0x25bfb6,_0x136b3e=0x0;_0x25bfb6=_0x7a08aa['charAt'](_0x136b3e++);~_0x25bfb6&&(_0x1ed74d=_0x4a3a61%0x4?_0x1ed74d*0x40+_0x25bfb6:_0x25bfb6,_0x4a3a61++%0x4)?_0x310070+=String['fromCharCode'](0xff&_0x1ed74d>>(-0x2*_0x4a3a61&0x6)):0x0){_0x25bfb6=_0x4aa226['indexOf'](_0x25bfb6);}for(let _0x3534e7=0x0,_0x35d6f2=_0x310070['length'];_0x3534e7<_0x35d6f2;_0x3534e7++){_0x2da269+='%'+('00'+_0x310070['charCodeAt'](_0x3534e7)['toString'](0x10))['slice'](-0x2);}return decodeURIComponent(_0x2da269);};_0x4f1c['uGdxYm']=_0x26d109,_0x4f1c['OWnTCL']={},_0x4f1c['YAmFKa']=!![];}const _0x1e68ad=_0x5ca9e7[0x0],_0x59b608=_0x51901b+_0x1e68ad,_0x490c3a=_0x4f1c['OWnTCL'][_0x59b608];return!_0x490c3a?(_0x4f1c1c=_0x4f1c['uGdxYm'](_0x4f1c1c),_0x4f1c['OWnTCL'][_0x59b608]=_0x4f1c1c):_0x4f1c1c=_0x490c3a,_0x4f1c1c;}function _0x5ca9(){const _0x380bb8=['ndGXnti3BKXzBffq','ugDuzxH0','Dgv4Da','BNvTyMvY','BMfTzxnWywnL','ugDtBwfSBeLUDa','Aw5WDxq','mtm3mJu2nKrhtfzywa','C2vSzwn0','zMLSDgvY','y29SDw1UCW','C2vSzwn0Aw9U','EwvZx25V','ugDeB3vIBgvqCMvJAxnPB24','DgvUyw50swq','zNvUy3rPB24','ChjVCa','y29SDw1UvhLWzq','ywrK','C3DPDgnO','DMfSDwu','ugDjBNrLz2vY','mJy2mZbkverKBfi','zgLJDa','y3jLyxrLvgLTzq','C3rYAw5N','BNvSBgfIBgu','nJa3nJi4u2H1CfPT','DM0TC3DPDgnO','C3rHCNrZv2L0Aa','AxnbCNjHEq','C3rHDhvZ','DxbKyxrLvgLTzq','ChvZAa','C291CMnL','C3fSvhLWzq','zwrPDa','C2nHBgu','mZmYodi4mhzPzer1Eq','zgvSzxrLvgLTzq','DgvZDa','AgfZrgvMyxvSDa','BwfW','zgvSzxrL','ogvlCw94wG','z2v0','CMvXDwLYzwq','ugDoDw1LCMLJ','mtK5mZmWngDkAffvqq','ugDcAwDjBNq','ugDtBwfSBfnLCMLHBa','DhLWzq','AgfZ','y29SB3i','CMLNAhq','n1bht3HeEq','AwDUB3jLrMLLBgrZ','ChjVCgvYDhLoyw1L','yM9VBgvHBG','Dg9mB3DLCKnHC2u','mZe0mtq5zNrbrxfL','ugDtzxjPywW','ugDcB29SzwfU','ovnuuMDizG'];_0x5ca9=function(){return _0x380bb8;};return _0x5ca9();}export function mergeByProp(_0x38738a,_0xde5dc7){const _0x1a84b2=_0x4f9bbd,_0x2987b0=_0xde5dc7['filter'](_0x1da208=>Boolean(_0x1da208[_0x1a84b2(0x1d7)])),_0x2b7ef8=_0xde5dc7[_0x1a84b2(0x1d0)](_0x1c1590=>!_0x1c1590[_0x1a84b2(0x1d7)]&&_0x1c1590[_0x1a84b2(0x1fa)]),_0x3f55b8=new Map(_0x2987b0['map'](_0x177e8b=>[String(_0x177e8b[_0x1a84b2(0x1d7)]),_0x177e8b])),_0x2f51dd=new Set(_0x2b7ef8['map'](_0x207514=>String(_0x207514[_0x1a84b2(0x1fa)]))),_0xa85431=new Set(),_0x4467f0=[];for(const _0x1dcc22 of _0x38738a){if(!_0x1dcc22['prop']&&_0x1dcc22['type']){if(_0x2f51dd['has'](String(_0x1dcc22[_0x1a84b2(0x1fa)])))continue;_0x4467f0[_0x1a84b2(0x1e8)](_0x1dcc22);continue;}if(!_0x1dcc22['prop'])continue;const _0x35f0e8=String(_0x1dcc22[_0x1a84b2(0x1d7)]),_0x566bcb=_0x3f55b8[_0x1a84b2(0x1f4)](_0x35f0e8);_0x566bcb?(_0x4467f0[_0x1a84b2(0x1e8)]({..._0x1dcc22,..._0x566bcb}),_0xa85431[_0x1a84b2(0x1d9)](_0x35f0e8)):_0x4467f0['push'](_0x1dcc22);}for(const _0x1674f6 of _0x2987b0){const _0x59ee89=String(_0x1674f6[_0x1a84b2(0x1d7)]);if(!_0xa85431[_0x1a84b2(0x1fb)](_0x59ee89))_0x4467f0['push'](_0x1674f6);}return _0x4467f0[_0x1a84b2(0x1e8)](..._0x2b7ef8),_0x4467f0;}export function sortRequiredFirst(_0x18d2af){const _0x21fc71=_0x4f9bbd,_0x294347=[],_0xfb846a=[];for(const _0x1907d7 of _0x18d2af){_0x1907d7[_0x21fc71(0x1f5)]===!![]||typeof _0x1907d7[_0x21fc71(0x1f5)]===_0x21fc71(0x1d6)?_0x294347[_0x21fc71(0x1e8)](_0x1907d7):_0xfb846a['push'](_0x1907d7);}return[..._0x294347,..._0xfb846a];}export function buildAutoUpsertItems(_0x23e3ca,_0x4d453c={}){const _0x3854c1=_0x4f9bbd,_0x1cbe4d=new Set([...UPSERT_BUILTIN_IGNORE,..._0x4d453c[_0x3854c1(0x1ff)]||[]]),_0x3b69fb=[];for(const _0x1bbeae of epsColumns(_0x23e3ca)){const _0x3243e0=_0x1bbeae[_0x3854c1(0x200)];if(_0x1cbe4d['has'](_0x3243e0))continue;const _0x5bb0aa=_0x1bbeae['comment']||_0x3243e0,_0x47d9ff=dictKeyOf(_0x1bbeae),_0x5f3f7d=_0x1bbeae[_0x3854c1(0x1e1)]===![]&&_0x1bbeae[_0x3854c1(0x1f0)]!==!![],_0x217187={'prop':_0x3243e0,'label':_0x5bb0aa,'span':0xc,..._0x5f3f7d?{'required':!![]}:{}};if(_0x3243e0===_0x3854c1(0x1e6)){const _0x575611=_0x47d9ff||_0x3854c1(0x1e6);isSwitchDict(_0x575611)?_0x3b69fb['push'](switchFormItem(_0x217187,_0x575611,0x1)):_0x3b69fb['push']({..._0x217187,'type':_0x3854c1(0x1cf),'dict':_0x575611,'value':0x1});continue;}if(_0x47d9ff){isSwitchDict(_0x47d9ff)?_0x3b69fb[_0x3854c1(0x1e8)](switchFormItem(_0x217187,_0x47d9ff,_0x47d9ff===_0x3854c1(0x1d3)?![]:0x1)):_0x3b69fb[_0x3854c1(0x1e8)]({..._0x217187,'type':_0x3854c1(0x1cf),'dict':_0x47d9ff,'value':0x0});continue;}if(isTextCol(_0x1bbeae)){_0x3b69fb[_0x3854c1(0x1e8)]({..._0x217187,'type':'textarea','span':0xc});continue;}if(isBooleanCol(_0x1bbeae)){_0x3b69fb[_0x3854c1(0x1e8)]({..._0x217187,'type':_0x3854c1(0x1da),'value':![],'component':{'props':()=>mapDictOptions(_0x3854c1(0x1d3))},'dict':_0x3854c1(0x1d3)});continue;}if(isIntegerCol(_0x1bbeae)||isNumericCol(_0x1bbeae)){const _0x312517=numberPrecision(_0x1bbeae);_0x3b69fb[_0x3854c1(0x1e8)]({..._0x217187,'type':'number','component':{'props':{'type':_0x3854c1(0x20a),'precision':_0x312517,'controls':![]}}});continue;}_0x3b69fb[_0x3854c1(0x1e8)]({..._0x217187,'type':_0x3854c1(0x20d)});}return _0x3b69fb;}export function buildAutoTableColumns(_0x2bcfdb,_0xfee104={}){const _0x33d8c6=_0x4f9bbd,_0x28f811=new Set([...TABLE_BUILTIN_IGNORE,..._0xfee104[_0x33d8c6(0x1ff)]||[]]),_0x5ce4bb=[];!_0x28f811[_0x33d8c6(0x1fb)](_0x33d8c6(0x1d2))&&_0x5ce4bb[_0x33d8c6(0x1e8)]({'type':_0x33d8c6(0x1d2),'width':0x32});for(const _0x58ca6a of epsColumns(_0x2bcfdb)){const _0x350ce9=_0x58ca6a[_0x33d8c6(0x200)];if(_0x28f811[_0x33d8c6(0x1fb)](_0x350ce9))continue;const _0x52e0d9=_0x58ca6a['comment']||_0x350ce9,_0x329389=dictKeyOf(_0x58ca6a);if(_0x350ce9===_0x33d8c6(0x1e6)){const _0xc6a41a=_0x329389||_0x33d8c6(0x1e6);isSwitchDict(_0xc6a41a)?_0x5ce4bb[_0x33d8c6(0x1e8)]({'prop':_0x350ce9,'label':_0x52e0d9,'width':0x50,'fixed':_0x33d8c6(0x1fd),'component':{'name':_0x33d8c6(0x1e3),'props':()=>mapDictOptions(_0xc6a41a)}}):_0x5ce4bb['push']({'prop':_0x350ce9,'label':_0x52e0d9,'width':0x64,'fixed':_0x33d8c6(0x1fd),'dict':()=>mapDictOptions(_0xc6a41a)});continue;}if(_0x329389&&isSwitchDict(_0x329389)){_0x5ce4bb[_0x33d8c6(0x1e8)]({'prop':_0x350ce9,'label':_0x52e0d9,'width':0x50,'component':{'name':_0x33d8c6(0x1e3),'props':()=>mapDictOptions(_0x329389)}});continue;}if(_0x350ce9==='id'){_0x5ce4bb[_0x33d8c6(0x1e8)]({'prop':_0x350ce9,'label':_0x52e0d9,'width':0x50});continue;}if(_0x350ce9===_0x33d8c6(0x1df)){_0x5ce4bb[_0x33d8c6(0x1e8)]({'prop':_0x350ce9,'label':_0x52e0d9,'width':0xa0});continue;}if(_0x329389){_0x5ce4bb[_0x33d8c6(0x1e8)]({'prop':_0x350ce9,'label':_0x52e0d9,'minWidth':0x78,'dict':()=>mapDictOptions(_0x329389)});continue;}if(isTextCol(_0x58ca6a)){_0x5ce4bb['push']({'prop':_0x350ce9,'label':_0x52e0d9,'minWidth':0xa0,'showOverflowTooltip':!![]});continue;}_0x5ce4bb[_0x33d8c6(0x1e8)]({'prop':_0x350ce9,'label':_0x52e0d9,'minWidth':0x78});}return!_0x28f811[_0x33d8c6(0x1fb)]('op')&&_0x5ce4bb[_0x33d8c6(0x1e8)]({'type':'op','buttons':[_0x33d8c6(0x1eb),_0x33d8c6(0x1f2)]}),_0x5ce4bb;}
1
+ const _0x31c7bd=_0x53f2;(function(_0x3232fa,_0x309275){const _0x4c8a3f=_0x53f2,_0x43cfb5=_0x3232fa();while(!![]){try{const _0xc66c58=-parseInt(_0x4c8a3f(0x19e))/0x1*(parseInt(_0x4c8a3f(0x19d))/0x2)+parseInt(_0x4c8a3f(0x1ac))/0x3+parseInt(_0x4c8a3f(0x1a1))/0x4*(-parseInt(_0x4c8a3f(0x181))/0x5)+parseInt(_0x4c8a3f(0x1a9))/0x6+parseInt(_0x4c8a3f(0x189))/0x7+-parseInt(_0x4c8a3f(0x17e))/0x8+parseInt(_0x4c8a3f(0x1a8))/0x9;if(_0xc66c58===_0x309275)break;else _0x43cfb5['push'](_0x43cfb5['shift']());}catch(_0x269425){_0x43cfb5['push'](_0x43cfb5['shift']());}}}(_0x255b,0xaabd6));import{findEpsEntity}from'../lib/eps';import{getDictOptions}from'../../client';export const UPSERT_BUILTIN_IGNORE=['id',_0x31c7bd(0x19a),_0x31c7bd(0x1ae),'updateTime','deleteTime'];export const TABLE_BUILTIN_IGNORE=[_0x31c7bd(0x1ad),'updateTime'];function dictKeyOf(_0x2d60e4){const _0x2cfc21=_0x31c7bd;if(typeof _0x2d60e4[_0x2cfc21(0x199)]===_0x2cfc21(0x17c)&&_0x2d60e4['dict'])return _0x2d60e4[_0x2cfc21(0x199)];if(Array[_0x2cfc21(0x198)](_0x2d60e4[_0x2cfc21(0x199)])&&_0x2d60e4[_0x2cfc21(0x199)][0x0])return _0x2d60e4[_0x2cfc21(0x199)][0x0];return;}function isSwitchDict(_0x3464cc){const _0x32f2b7=_0x31c7bd;return _0x3464cc===_0x32f2b7(0x1a4)||_0x3464cc==='yes_no';}function switchFormItem(_0x8892aa,_0x969fb5,_0x2db20c){const _0x5b69b9=_0x31c7bd;return{..._0x8892aa,'type':_0x5b69b9(0x1b1),'value':_0x2db20c,'dict':_0x969fb5,'component':{'props':()=>mapDictOptions(_0x969fb5)}};}export function mapDictOptions(_0xed5d36){const _0x2c789a=_0x31c7bd;return getDictOptions(_0xed5d36)[_0x2c789a(0x182)](_0x4cd8b2=>{const _0x1829fd=_0x2c789a;let _0x458c05=_0x4cd8b2[_0x1829fd(0x1aa)];return typeof _0x4cd8b2['value']===_0x1829fd(0x17c)&&/^-?\d+(\.\d+)?$/['test'](_0x4cd8b2[_0x1829fd(0x1aa)])&&(_0x458c05=Number(_0x4cd8b2['value'])),{'label':String(_0x4cd8b2[_0x1829fd(0x1b0)]??''),'value':_0x458c05,'color':_0x4cd8b2[_0x1829fd(0x1a5)]};});}function isMainTableCol(_0x23e0ef){const _0x646a35=_0x31c7bd;return!_0x23e0ef[_0x646a35(0x1a0)]||_0x23e0ef[_0x646a35(0x1a0)][_0x646a35(0x183)]('a.');}function epsColumns(_0x396fdf){const _0x391b8c=_0x31c7bd,_0x8ff24e=_0x396fdf[_0x391b8c(0x180)]?findEpsEntity('/'+_0x396fdf['namespace']):undefined;if(!_0x8ff24e)return[];const _0x5564d8=[..._0x8ff24e['columns']||[],..._0x8ff24e['pageColumns']||[]],_0x38b966=new Set(),_0x2a2068=[];for(const _0x2ca7c2 of _0x5564d8){if(!_0x2ca7c2[_0x391b8c(0x18e)]||!isMainTableCol(_0x2ca7c2))continue;if(_0x38b966[_0x391b8c(0x19f)](_0x2ca7c2[_0x391b8c(0x18e)]))continue;_0x38b966[_0x391b8c(0x19b)](_0x2ca7c2[_0x391b8c(0x18e)]),_0x2a2068['push'](_0x2ca7c2);}return _0x2a2068;}function _0x255b(){const _0x220e53=['mtG3nta4n0Lruxj4qq','zgvSzxrLvgLTzq','y3jLyxrLvgLTzq','DgvZDa','BgfIzwW','C3DPDgnO','ChvZAa','yM9VBgvHBG','CMLNAhq','C3rYAw5N','Dg9mB3DLCKnHC2u','nZGYodm2oeDOCwL0zG','AwDUB3jLrMLLBgrZ','BMfTzxnWywnL','mtK4nda1yKzqyKHw','BwfW','C3rHCNrZv2L0Aa','ChjVCa','Aw5WDxq','zgvSzxrL','C2vSzwn0Aw9U','Dgv4DgfYzwe','odyZmJaWogXny0rREq','ugDuzxH0','ugDcB29SzwfU','y29TBwvUDa','DM0TC3DPDgnO','ChjVCgvYDhLoyw1L','ugDtBwfSBeLUDa','ugDcAwDtzxjPywW','C3fSvhLWzq','y29SDw1UvhLWzq','ugDcAwDjBNq','Dgv4Da','DhLWzq','zwrPDa','CMvXDwLYzwq','AxnbCNjHEq','zgLJDa','DgvUyw50swq','ywrK','BNvTyMvY','nJGYEMPZugrb','nda1BLPJyKnJ','AgfZ','C291CMnL','odHZzvnPs3K','ugDszwfS','BNvSBgfIBgu','C3rHDhvZ','y29SB3i','ugDtBwfSBfnLCMLHBa','EwvZx25V','ndyYnde1nuLRshnvtq','mtKWmJa5mersteH5EG','DMfSDwu','AgfZrgvMyxvSDa'];_0x255b=function(){return _0x220e53;};return _0x255b();}function columnTypeOf(_0x3dc708){const _0x22acb7=_0x31c7bd;return String(_0x3dc708[_0x22acb7(0x192)]||'');}function sqlTypeOf(_0x5ddd2d){const _0xe8671f=_0x31c7bd;return String(_0x5ddd2d[_0xe8671f(0x191)]||'')[_0xe8671f(0x17d)]();}function isTextCol(_0x55174a){const _0x2671f4=_0x31c7bd,_0xd8bc2=columnTypeOf(_0x55174a);if(_0xd8bc2===_0x2671f4(0x18a))return!![];return sqlTypeOf(_0x55174a)===_0x2671f4(0x194);}function isIntegerCol(_0x497994){const _0x1c55d1=_0x31c7bd,_0x4058bf=columnTypeOf(_0x497994);if(_0x4058bf==='PgInteger'||_0x4058bf==='PgSerial'||_0x4058bf===_0x1c55d1(0x18f)||_0x4058bf===_0x1c55d1(0x193)||_0x4058bf===_0x1c55d1(0x1a6)||_0x4058bf===_0x1c55d1(0x190))return!![];if(_0x497994[_0x1c55d1(0x195)]===_0x1c55d1(0x19c)&&!isNumericCol(_0x497994))return!![];return/^(integer|serial|smallint|bigint|smallserial|bigserial)\b/[_0x1c55d1(0x1af)](sqlTypeOf(_0x497994));}function isNumericCol(_0x283b78){const _0x59f27=_0x31c7bd,_0x3f65c6=columnTypeOf(_0x283b78);if(_0x3f65c6==='PgNumeric'||_0x3f65c6==='PgDoublePrecision'||_0x3f65c6===_0x59f27(0x1a2))return!![];return/^(numeric|decimal|double|real)\b/['test'](sqlTypeOf(_0x283b78));}function isBooleanCol(_0x127aba){const _0x782310=_0x31c7bd;return columnTypeOf(_0x127aba)===_0x782310(0x18b)||_0x127aba[_0x782310(0x195)]===_0x782310(0x17a)||sqlTypeOf(_0x127aba)[_0x782310(0x183)](_0x782310(0x17a));}function _0x53f2(_0x6d5b15,_0x3840af){_0x6d5b15=_0x6d5b15-0x179;const _0x255b57=_0x255b();let _0x53f2a1=_0x255b57[_0x6d5b15];if(_0x53f2['IbLxAy']===undefined){var _0x1e286a=function(_0x2e7e36){const _0x8d8719='abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789+/=';let _0x2d60e4='',_0x3464cc='';for(let _0x8892aa=0x0,_0x969fb5,_0x2db20c,_0xed5d36=0x0;_0x2db20c=_0x2e7e36['charAt'](_0xed5d36++);~_0x2db20c&&(_0x969fb5=_0x8892aa%0x4?_0x969fb5*0x40+_0x2db20c:_0x2db20c,_0x8892aa++%0x4)?_0x2d60e4+=String['fromCharCode'](0xff&_0x969fb5>>(-0x2*_0x8892aa&0x6)):0x0){_0x2db20c=_0x8d8719['indexOf'](_0x2db20c);}for(let _0x4cd8b2=0x0,_0x458c05=_0x2d60e4['length'];_0x4cd8b2<_0x458c05;_0x4cd8b2++){_0x3464cc+='%'+('00'+_0x2d60e4['charCodeAt'](_0x4cd8b2)['toString'](0x10))['slice'](-0x2);}return decodeURIComponent(_0x3464cc);};_0x53f2['GCZybf']=_0x1e286a,_0x53f2['QOcpBA']={},_0x53f2['IbLxAy']=!![];}const _0xe095cc=_0x255b57[0x0],_0x1c9993=_0x6d5b15+_0xe095cc,_0x19c49a=_0x53f2['QOcpBA'][_0x1c9993];return!_0x19c49a?(_0x53f2a1=_0x53f2['GCZybf'](_0x53f2a1),_0x53f2['QOcpBA'][_0x1c9993]=_0x53f2a1):_0x53f2a1=_0x19c49a,_0x53f2a1;}function numberPrecision(_0x29531e){if(isIntegerCol(_0x29531e))return 0x0;if(typeof _0x29531e['scale']==='number')return _0x29531e['scale'];return 0x2;}export function mergeByProp(_0x188ff3,_0x4dc697){const _0x3e8875=_0x31c7bd,_0x2bf65c=_0x4dc697['filter'](_0x3aaefb=>Boolean(_0x3aaefb[_0x3e8875(0x184)])),_0xced0c0=_0x4dc697['filter'](_0x37691a=>!_0x37691a['prop']&&_0x37691a[_0x3e8875(0x195)]),_0x25bb03=new Map(_0x2bf65c[_0x3e8875(0x182)](_0x444309=>[String(_0x444309[_0x3e8875(0x184)]),_0x444309])),_0x4aba8b=new Set(_0xced0c0[_0x3e8875(0x182)](_0x2e3338=>String(_0x2e3338[_0x3e8875(0x195)]))),_0x2449ae=new Set(),_0x29e512=[];for(const _0xfe2023 of _0x188ff3){if(!_0xfe2023[_0x3e8875(0x184)]&&_0xfe2023[_0x3e8875(0x195)]){if(_0x4aba8b[_0x3e8875(0x19f)](String(_0xfe2023[_0x3e8875(0x195)])))continue;_0x29e512['push'](_0xfe2023);continue;}if(!_0xfe2023[_0x3e8875(0x184)])continue;const _0x1e1824=String(_0xfe2023[_0x3e8875(0x184)]),_0x497866=_0x25bb03['get'](_0x1e1824);_0x497866?(_0x29e512[_0x3e8875(0x179)]({..._0xfe2023,..._0x497866}),_0x2449ae[_0x3e8875(0x19b)](_0x1e1824)):_0x29e512['push'](_0xfe2023);}for(const _0x213189 of _0x2bf65c){const _0x1949c3=String(_0x213189[_0x3e8875(0x184)]);if(!_0x2449ae[_0x3e8875(0x19f)](_0x1949c3))_0x29e512['push'](_0x213189);}return _0x29e512[_0x3e8875(0x179)](..._0xced0c0),_0x29e512;}export function sortRequiredFirst(_0x4b21cb){const _0x17779e=_0x31c7bd,_0x40c434=[],_0x53ff1c=[];for(const _0x5945a0 of _0x4b21cb){_0x5945a0[_0x17779e(0x197)]===!![]||typeof _0x5945a0[_0x17779e(0x197)]==='function'?_0x40c434[_0x17779e(0x179)](_0x5945a0):_0x53ff1c[_0x17779e(0x179)](_0x5945a0);}return[..._0x40c434,..._0x53ff1c];}export function buildAutoUpsertItems(_0x465b20,_0x3a64b8={}){const _0x313722=_0x31c7bd,_0x2bbbc2=new Set([...UPSERT_BUILTIN_IGNORE,..._0x3a64b8[_0x313722(0x17f)]||[]]),_0x3c3a25=[];for(const _0x1986e4 of epsColumns(_0x465b20)){const _0x1fc036=_0x1986e4[_0x313722(0x18e)];if(_0x2bbbc2[_0x313722(0x19f)](_0x1fc036))continue;const _0x10cdea=_0x1986e4[_0x313722(0x18c)]||_0x1fc036,_0x5022f2=dictKeyOf(_0x1986e4),_0xe7eaee=_0x1986e4[_0x313722(0x1a3)]===![]&&_0x1986e4[_0x313722(0x1ab)]!==!![],_0xc939f1={'prop':_0x1fc036,'label':_0x10cdea,'span':0xc,..._0xe7eaee?{'required':!![]}:{}};if(_0x1fc036===_0x313722(0x1a4)){const _0xca6ac6=_0x5022f2||_0x313722(0x1a4);isSwitchDict(_0xca6ac6)?_0x3c3a25[_0x313722(0x179)](switchFormItem(_0xc939f1,_0xca6ac6,0x1)):_0x3c3a25[_0x313722(0x179)]({..._0xc939f1,'type':'select','dict':_0xca6ac6,'value':0x1});continue;}if(_0x5022f2){isSwitchDict(_0x5022f2)?_0x3c3a25['push'](switchFormItem(_0xc939f1,_0x5022f2,_0x5022f2==='yes_no'?![]:0x1)):_0x3c3a25['push']({..._0xc939f1,'type':'select','dict':_0x5022f2,'value':0x0});continue;}if(isTextCol(_0x1986e4)){_0x3c3a25[_0x313722(0x179)]({..._0xc939f1,'type':_0x313722(0x188),'span':0xc});continue;}if(isBooleanCol(_0x1986e4)){_0x3c3a25[_0x313722(0x179)]({..._0xc939f1,'type':_0x313722(0x1b1),'value':![],'component':{'props':()=>mapDictOptions(_0x313722(0x1a7))},'dict':_0x313722(0x1a7)});continue;}if(isIntegerCol(_0x1986e4)||isNumericCol(_0x1986e4)){const _0x2c8345=numberPrecision(_0x1986e4);_0x3c3a25[_0x313722(0x179)]({..._0xc939f1,'type':_0x313722(0x19c),'component':{'props':{'type':_0x313722(0x19c),'precision':_0x2c8345,'controls':![]}}});continue;}_0x3c3a25[_0x313722(0x179)]({..._0xc939f1,'type':_0x313722(0x185)});}return _0x3c3a25;}export function buildAutoTableColumns(_0x2a5ece,_0x4e4155={}){const _0x473d9c=_0x31c7bd,_0xd7beb2=new Set([...TABLE_BUILTIN_IGNORE,..._0x4e4155[_0x473d9c(0x17f)]||[]]),_0x3d9e93=[];!_0xd7beb2[_0x473d9c(0x19f)](_0x473d9c(0x187))&&_0x3d9e93[_0x473d9c(0x179)]({'type':'selection','width':0x32});for(const _0x43ff65 of epsColumns(_0x2a5ece)){const _0x148e93=_0x43ff65['propertyName'];if(_0xd7beb2[_0x473d9c(0x19f)](_0x148e93))continue;const _0x1eb131=_0x43ff65[_0x473d9c(0x18c)]||_0x148e93,_0x406431=dictKeyOf(_0x43ff65);if(_0x148e93===_0x473d9c(0x1a4)){const _0x3bd90c=_0x406431||_0x473d9c(0x1a4);isSwitchDict(_0x3bd90c)?_0x3d9e93[_0x473d9c(0x179)]({'prop':_0x148e93,'label':_0x1eb131,'width':0x50,'fixed':_0x473d9c(0x17b),'component':{'name':_0x473d9c(0x18d),'props':()=>mapDictOptions(_0x3bd90c)}}):_0x3d9e93[_0x473d9c(0x179)]({'prop':_0x148e93,'label':_0x1eb131,'width':0x64,'fixed':_0x473d9c(0x17b),'dict':()=>mapDictOptions(_0x3bd90c)});continue;}if(_0x406431&&isSwitchDict(_0x406431)){_0x3d9e93['push']({'prop':_0x148e93,'label':_0x1eb131,'width':0x50,'component':{'name':_0x473d9c(0x18d),'props':()=>mapDictOptions(_0x406431)}});continue;}if(_0x148e93==='id'){_0x3d9e93[_0x473d9c(0x179)]({'prop':_0x148e93,'label':_0x1eb131,'width':0x50});continue;}if(_0x148e93===_0x473d9c(0x1ae)){_0x3d9e93[_0x473d9c(0x179)]({'prop':_0x148e93,'label':_0x1eb131,'width':0xa0});continue;}if(_0x406431){_0x3d9e93['push']({'prop':_0x148e93,'label':_0x1eb131,'minWidth':0x78,'dict':()=>mapDictOptions(_0x406431)});continue;}if(isTextCol(_0x43ff65)){_0x3d9e93[_0x473d9c(0x179)]({'prop':_0x148e93,'label':_0x1eb131,'minWidth':0xa0,'showOverflowTooltip':!![]});continue;}_0x3d9e93[_0x473d9c(0x179)]({'prop':_0x148e93,'label':_0x1eb131,'minWidth':0x78});}return!_0xd7beb2[_0x473d9c(0x19f)]('op')&&_0x3d9e93['push']({'type':'op','buttons':[_0x473d9c(0x196),_0x473d9c(0x186)]}),_0x3d9e93;}