vome-core 0.3.38 → 0.3.40
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/dist/admin/components/ui/avatar/index.js +1 -1
- package/dist/admin/components/ui/checkbox/index.js +1 -1
- package/dist/admin/components/ui/dialog/index.js +1 -1
- package/dist/admin/components/ui/dropdown-menu/index.js +1 -1
- package/dist/admin/components/ui/input/index.js +1 -1
- package/dist/admin/components/ui/label/index.js +1 -1
- package/dist/admin/components/ui/scroll-area/index.js +1 -1
- package/dist/admin/components/ui/select/index.js +1 -1
- package/dist/admin/components/ui/separator/index.js +1 -1
- package/dist/admin/components/ui/sheet/index.js +1 -1
- package/dist/admin/components/ui/sonner/index.js +1 -1
- package/dist/admin/components/ui/table/index.js +1 -1
- package/dist/admin/components/ui/tabs/index.js +1 -1
- package/dist/admin/components/ui/tooltip/index.js +1 -1
- package/dist/admin/crud/auto-fields.js +1 -1
- package/dist/admin/crud/components/vm-color-picker.vue +19 -1
- package/dist/admin/crud/components/vm-context-menu.vue +9 -5
- package/dist/admin/crud/components/vm-richtext-extensions.js +1 -1
- package/dist/admin/crud/components/vm-richtext.vue +412 -23
- package/dist/admin/crud/config.js +1 -1
- package/dist/admin/crud/confirm.js +1 -1
- package/dist/admin/crud/crud-page-request.js +1 -1
- package/dist/admin/crud/data-i18n.js +1 -1
- package/dist/admin/crud/dict.js +1 -1
- package/dist/admin/crud/export-fetch.js +1 -1
- package/dist/admin/crud/key.js +1 -1
- package/dist/admin/crud/plugins.js +1 -1
- package/dist/admin/crud/span.js +1 -1
- package/dist/admin/crud/style.js +1 -1
- package/dist/admin/crud/validate.js +1 -1
- package/dist/admin/directives/perm.js +1 -1
- package/dist/admin/hooks/useUpload.js +1 -1
- package/dist/admin/lib/browser.js +1 -1
- package/dist/admin/lib/cn.js +1 -1
- package/dist/admin/lib/dialog-float.js +1 -1
- package/dist/admin/lib/export-excel.js +1 -1
- package/dist/admin/lib/import-excel.js +1 -1
- package/dist/admin/lib/json.js +1 -1
- package/dist/admin/lib/menu.js +1 -1
- package/dist/admin/lib/micro-locale.js +1 -1
- package/dist/admin/lib/micro-theme.js +1 -1
- package/dist/admin/lib/shell.js +1 -1
- package/dist/admin/lib/theme-color-options.js +1 -1
- package/dist/admin/lib/tree.js +1 -1
- package/dist/admin/lib/upload.js +1 -1
- package/dist/admin/lib/video-frame.js +1 -1
- package/dist/admin/router/create.js +1 -1
- package/dist/admin/router/guards.js +1 -1
- package/dist/ai/index.js +1 -1
- package/dist/client/ai-model-registry.js +1 -1
- package/dist/client/base.js +1 -1
- package/dist/client/configure.js +1 -1
- package/dist/client/dict.js +1 -1
- package/dist/client/eps-payload.js +1 -1
- package/dist/client/eps.js +1 -1
- package/dist/client/index.js +1 -1
- package/dist/client/locale-change.js +1 -1
- package/dist/client/locale-store.js +1 -1
- package/dist/client/service.js +1 -1
- package/dist/client/vite-admin.js +1 -1
- package/dist/client/vite-auto-import.js +1 -1
- package/dist/client/vite-micro-proxy.js +1 -1
- package/dist/client/vite-plugin-eps.js +1 -1
- package/dist/client/vite-resolve.js +1 -1
- package/dist/config/index.js +1 -1
- package/dist/index.js +1 -1
- package/dist/server/index.js +1 -1
- package/dist/shared/datetime-picker.js +1 -1
- package/dist/shared/decimal.js +1 -1
- package/dist/shared/excel.js +1 -1
- package/dist/shared/index.js +1 -1
- package/dist/shared/locale-json.js +1 -1
- package/dist/shared/tree.js +1 -1
- package/package.json +2 -1
|
@@ -25,9 +25,44 @@
|
|
|
25
25
|
<button type="button" class="vm-richtext__btn" :class="{ 'is-active': editor.isActive('italic') }" :title="crudLabel('rtItalic')" @click="editor.chain().focus().toggleItalic().run()"><i class="ri-italic" /></button>
|
|
26
26
|
<button type="button" class="vm-richtext__btn" :class="{ 'is-active': editor.isActive('underline') }" :title="crudLabel('rtUnderline')" @click="editor.chain().focus().toggleUnderline().run()"><i class="ri-underline" /></button>
|
|
27
27
|
<button type="button" class="vm-richtext__btn" :class="{ 'is-active': editor.isActive('strike') }" :title="crudLabel('rtStrike')" @click="editor.chain().focus().toggleStrike().run()"><i class="ri-strikethrough" /></button>
|
|
28
|
-
<
|
|
29
|
-
|
|
30
|
-
|
|
28
|
+
<span
|
|
29
|
+
class="vm-richtext__btn vm-richtext__color-btn"
|
|
30
|
+
:class="{ 'is-active': editor.isActive('highlight'), 'is-disabled': disabled }"
|
|
31
|
+
:title="crudLabel('rtBgColor')"
|
|
32
|
+
role="button"
|
|
33
|
+
@pointerdown="rememberSelection"
|
|
34
|
+
>
|
|
35
|
+
<i class="ri-mark-pen-line" aria-hidden="true" />
|
|
36
|
+
<span class="vm-richtext__color-bar" :style="{ background: highlightColor }" />
|
|
37
|
+
<vm-color-picker
|
|
38
|
+
class="vm-richtext__color-hit"
|
|
39
|
+
size="sm"
|
|
40
|
+
swatch-only
|
|
41
|
+
:enable-theme="false"
|
|
42
|
+
:disabled="disabled"
|
|
43
|
+
:model-value="highlightColor"
|
|
44
|
+
@update:model-value="applyHighlightColor"
|
|
45
|
+
/>
|
|
46
|
+
</span>
|
|
47
|
+
<span
|
|
48
|
+
class="vm-richtext__btn vm-richtext__color-btn"
|
|
49
|
+
:class="{ 'is-active': Boolean(textColor && textColor !== '#111827'), 'is-disabled': disabled }"
|
|
50
|
+
:title="crudLabel('rtTextColor')"
|
|
51
|
+
role="button"
|
|
52
|
+
@pointerdown="rememberSelection"
|
|
53
|
+
>
|
|
54
|
+
<i class="ri-font-color" aria-hidden="true" />
|
|
55
|
+
<span class="vm-richtext__color-bar" :style="{ background: textColor }" />
|
|
56
|
+
<vm-color-picker
|
|
57
|
+
class="vm-richtext__color-hit"
|
|
58
|
+
size="sm"
|
|
59
|
+
swatch-only
|
|
60
|
+
:enable-theme="false"
|
|
61
|
+
:disabled="disabled"
|
|
62
|
+
:model-value="textColor"
|
|
63
|
+
@update:model-value="applyTextColor"
|
|
64
|
+
/>
|
|
65
|
+
</span>
|
|
31
66
|
<span class="vm-richtext__sep" />
|
|
32
67
|
<button type="button" class="vm-richtext__btn" :class="{ 'is-active': editor.isActive('heading', { level: 2 }) }" :title="crudLabel('rtH2')" @click="editor.chain().focus().toggleHeading({ level: 2 }).run()">H2</button>
|
|
33
68
|
<button type="button" class="vm-richtext__btn" :class="{ 'is-active': editor.isActive('heading', { level: 3 }) }" :title="crudLabel('rtH3')" @click="editor.chain().focus().toggleHeading({ level: 3 }).run()">H3</button>
|
|
@@ -84,13 +119,19 @@
|
|
|
84
119
|
</div>
|
|
85
120
|
|
|
86
121
|
<EditorContent class="vm-richtext__content" :editor="editor" />
|
|
122
|
+
<vm-context-menu
|
|
123
|
+
ref="tableCtxRef"
|
|
124
|
+
:items="tableCtxItems"
|
|
125
|
+
:z-index="10050"
|
|
126
|
+
@select="onTableCtxSelect"
|
|
127
|
+
/>
|
|
87
128
|
</div>
|
|
88
129
|
</div>
|
|
89
130
|
</template>
|
|
90
131
|
|
|
91
132
|
<script setup lang="ts">
|
|
92
133
|
import { crudLabel } from '../style'
|
|
93
|
-
import { computed, nextTick, onBeforeUnmount, onMounted, shallowRef, watch } from 'vue'
|
|
134
|
+
import { computed, nextTick, onBeforeUnmount, onMounted, ref, shallowRef, watch } from 'vue'
|
|
94
135
|
import DOMPurify from 'dompurify'
|
|
95
136
|
import { EditorContent, useEditor } from '@tiptap/vue-3'
|
|
96
137
|
import StarterKit from '@tiptap/starter-kit'
|
|
@@ -110,6 +151,12 @@ import TableHeader from '@tiptap/extension-table-header'
|
|
|
110
151
|
import TableCell from '@tiptap/extension-table-cell'
|
|
111
152
|
import { useUpload } from '../../hooks/useUpload'
|
|
112
153
|
import { VM_RICHTEXT_EMOJIS, VmRichtextVideo } from './vm-richtext-extensions'
|
|
154
|
+
import VmColorPicker from './vm-color-picker.vue'
|
|
155
|
+
import VmContextMenu from './vm-context-menu.vue'
|
|
156
|
+
import { CellSelection, cellAround } from '@tiptap/pm/tables'
|
|
157
|
+
import type { Editor } from '@tiptap/core'
|
|
158
|
+
import type { EditorView } from '@tiptap/pm/view'
|
|
159
|
+
import type { CtxMenuItem } from '../../../../typings/admin/comm/crud'
|
|
113
160
|
|
|
114
161
|
defineOptions({ name: 'vm-richtext' })
|
|
115
162
|
|
|
@@ -149,6 +196,210 @@ const emojiOpen = shallowRef(false)
|
|
|
149
196
|
const emojiBtnRef = shallowRef<HTMLElement>()
|
|
150
197
|
const emojiPanelRef = shallowRef<HTMLElement>()
|
|
151
198
|
const emojiPanelStyle = shallowRef<Record<string, string>>({})
|
|
199
|
+
const textColor = ref('#111827')
|
|
200
|
+
const highlightColor = ref('#fef08a')
|
|
201
|
+
/** 点开取色器前保存选区,避免焦点离开编辑器后丢标记范围 */
|
|
202
|
+
let savedSelection: { from: number; to: number } | null = null
|
|
203
|
+
|
|
204
|
+
const tableCtxRef = ref<{ open: (ev: MouseEvent) => void; close: () => void } | null>(null)
|
|
205
|
+
const tableCtxItems = ref<CtxMenuItem[]>([])
|
|
206
|
+
/** 右键按下时缓存多选,防止 mousedown 先把 CellSelection 清掉 */
|
|
207
|
+
let pendingCellSel: { anchor: number; head: number } | null = null
|
|
208
|
+
|
|
209
|
+
type TableCtxKey =
|
|
210
|
+
| 'addColumnBefore'
|
|
211
|
+
| 'addColumnAfter'
|
|
212
|
+
| 'addRowBefore'
|
|
213
|
+
| 'addRowAfter'
|
|
214
|
+
| 'deleteColumn'
|
|
215
|
+
| 'deleteRow'
|
|
216
|
+
| 'mergeCells'
|
|
217
|
+
| 'splitCell'
|
|
218
|
+
|
|
219
|
+
function cellPosInSelection(sel: CellSelection, cellPos: number) {
|
|
220
|
+
let hit = false
|
|
221
|
+
sel.forEachCell((_node, pos) => {
|
|
222
|
+
if (pos === cellPos) hit = true
|
|
223
|
+
})
|
|
224
|
+
return hit
|
|
225
|
+
}
|
|
226
|
+
|
|
227
|
+
function restorePendingCellSelection(view: EditorView) {
|
|
228
|
+
if (!pendingCellSel) return false
|
|
229
|
+
try {
|
|
230
|
+
const sel = CellSelection.create(
|
|
231
|
+
view.state.doc,
|
|
232
|
+
pendingCellSel.anchor,
|
|
233
|
+
pendingCellSel.head,
|
|
234
|
+
)
|
|
235
|
+
view.dispatch(view.state.tr.setSelection(sel))
|
|
236
|
+
return true
|
|
237
|
+
} catch {
|
|
238
|
+
return false
|
|
239
|
+
}
|
|
240
|
+
}
|
|
241
|
+
|
|
242
|
+
/**
|
|
243
|
+
* 右键 mousedown:表格插件会先清掉多选。
|
|
244
|
+
* 若点在已有 CellSelection 内 → preventDefault 并记下选区,供 contextmenu 恢复。
|
|
245
|
+
*/
|
|
246
|
+
function onTableMouseDown(view: EditorView, event: MouseEvent) {
|
|
247
|
+
if (event.button !== 2) {
|
|
248
|
+
pendingCellSel = null
|
|
249
|
+
return false
|
|
250
|
+
}
|
|
251
|
+
const target = event.target as HTMLElement | null
|
|
252
|
+
if (!target?.closest?.('td, th')) {
|
|
253
|
+
pendingCellSel = null
|
|
254
|
+
return false
|
|
255
|
+
}
|
|
256
|
+
|
|
257
|
+
const { selection } = view.state
|
|
258
|
+
if (!(selection instanceof CellSelection)) {
|
|
259
|
+
pendingCellSel = null
|
|
260
|
+
return false
|
|
261
|
+
}
|
|
262
|
+
|
|
263
|
+
pendingCellSel = {
|
|
264
|
+
anchor: selection.$anchorCell.pos,
|
|
265
|
+
head: selection.$headCell.pos,
|
|
266
|
+
}
|
|
267
|
+
|
|
268
|
+
const coords = view.posAtCoords({ left: event.clientX, top: event.clientY })
|
|
269
|
+
if (!coords) return false
|
|
270
|
+
const $cell = cellAround(view.state.doc.resolve(coords.pos))
|
|
271
|
+
if (!$cell) return false
|
|
272
|
+
|
|
273
|
+
if (cellPosInSelection(selection, $cell.pos)) {
|
|
274
|
+
event.preventDefault()
|
|
275
|
+
return true
|
|
276
|
+
}
|
|
277
|
+
return false
|
|
278
|
+
}
|
|
279
|
+
|
|
280
|
+
/** 右键落点:已在多选内则保留;否则选中该单元格作为参照 */
|
|
281
|
+
function selectTableCellFromEvent(ed: Editor, event: MouseEvent) {
|
|
282
|
+
const view = ed.view
|
|
283
|
+
const coords = view.posAtCoords({ left: event.clientX, top: event.clientY })
|
|
284
|
+
if (!coords) return false
|
|
285
|
+
const $cell = cellAround(view.state.doc.resolve(coords.pos))
|
|
286
|
+
if (!$cell) return false
|
|
287
|
+
|
|
288
|
+
const { selection } = view.state
|
|
289
|
+
if (selection instanceof CellSelection && cellPosInSelection(selection, $cell.pos)) {
|
|
290
|
+
return true
|
|
291
|
+
}
|
|
292
|
+
|
|
293
|
+
// mousedown 已清多选时,用缓存恢复(且右键仍落在原多选内)
|
|
294
|
+
if (pendingCellSel) {
|
|
295
|
+
const probe = CellSelection.create(
|
|
296
|
+
view.state.doc,
|
|
297
|
+
pendingCellSel.anchor,
|
|
298
|
+
pendingCellSel.head,
|
|
299
|
+
)
|
|
300
|
+
if (cellPosInSelection(probe, $cell.pos)) {
|
|
301
|
+
return restorePendingCellSelection(view)
|
|
302
|
+
}
|
|
303
|
+
}
|
|
304
|
+
|
|
305
|
+
const tr = view.state.tr.setSelection(CellSelection.create(view.state.doc, $cell.pos))
|
|
306
|
+
view.dispatch(tr)
|
|
307
|
+
return true
|
|
308
|
+
}
|
|
309
|
+
|
|
310
|
+
function buildTableCtxItems(ed: Editor): CtxMenuItem[] {
|
|
311
|
+
const can = ed.can()
|
|
312
|
+
return [
|
|
313
|
+
{
|
|
314
|
+
key: 'addColumnBefore',
|
|
315
|
+
label: crudLabel('rtTableColBefore'),
|
|
316
|
+
disabled: !can.addColumnBefore(),
|
|
317
|
+
},
|
|
318
|
+
{
|
|
319
|
+
key: 'addColumnAfter',
|
|
320
|
+
label: crudLabel('rtTableColAfter'),
|
|
321
|
+
disabled: !can.addColumnAfter(),
|
|
322
|
+
},
|
|
323
|
+
{
|
|
324
|
+
key: 'addRowBefore',
|
|
325
|
+
label: crudLabel('rtTableRowBefore'),
|
|
326
|
+
disabled: !can.addRowBefore(),
|
|
327
|
+
},
|
|
328
|
+
{
|
|
329
|
+
key: 'addRowAfter',
|
|
330
|
+
label: crudLabel('rtTableRowAfter'),
|
|
331
|
+
disabled: !can.addRowAfter(),
|
|
332
|
+
},
|
|
333
|
+
{
|
|
334
|
+
key: 'deleteColumn',
|
|
335
|
+
label: crudLabel('rtTableDeleteCol'),
|
|
336
|
+
disabled: !can.deleteColumn(),
|
|
337
|
+
},
|
|
338
|
+
{
|
|
339
|
+
key: 'deleteRow',
|
|
340
|
+
label: crudLabel('rtTableDeleteRow'),
|
|
341
|
+
disabled: !can.deleteRow(),
|
|
342
|
+
},
|
|
343
|
+
{
|
|
344
|
+
key: 'mergeCells',
|
|
345
|
+
label: crudLabel('rtTableMerge'),
|
|
346
|
+
disabled: !can.mergeCells(),
|
|
347
|
+
},
|
|
348
|
+
{
|
|
349
|
+
key: 'splitCell',
|
|
350
|
+
label: crudLabel('rtTableSplit'),
|
|
351
|
+
disabled: !can.splitCell(),
|
|
352
|
+
},
|
|
353
|
+
]
|
|
354
|
+
}
|
|
355
|
+
|
|
356
|
+
function onTableContextMenu(view: EditorView, event: MouseEvent) {
|
|
357
|
+
const ed = editor.value
|
|
358
|
+
if (!ed || ed.isDestroyed || props.disabled) return false
|
|
359
|
+
const target = event.target as HTMLElement | null
|
|
360
|
+
if (!target?.closest?.('td, th')) return false
|
|
361
|
+
if (!selectTableCellFromEvent(ed, event)) return false
|
|
362
|
+
event.preventDefault()
|
|
363
|
+
tableCtxItems.value = buildTableCtxItems(ed)
|
|
364
|
+
tableCtxRef.value?.open(event)
|
|
365
|
+
pendingCellSel = null
|
|
366
|
+
return true
|
|
367
|
+
}
|
|
368
|
+
|
|
369
|
+
function onTableCtxSelect(key: string) {
|
|
370
|
+
const ed = editor.value
|
|
371
|
+
if (!ed) return
|
|
372
|
+
const k = key as TableCtxKey
|
|
373
|
+
const chain = ed.chain().focus()
|
|
374
|
+
switch (k) {
|
|
375
|
+
case 'addColumnBefore':
|
|
376
|
+
chain.addColumnBefore().run()
|
|
377
|
+
break
|
|
378
|
+
case 'addColumnAfter':
|
|
379
|
+
chain.addColumnAfter().run()
|
|
380
|
+
break
|
|
381
|
+
case 'addRowBefore':
|
|
382
|
+
chain.addRowBefore().run()
|
|
383
|
+
break
|
|
384
|
+
case 'addRowAfter':
|
|
385
|
+
chain.addRowAfter().run()
|
|
386
|
+
break
|
|
387
|
+
case 'deleteColumn':
|
|
388
|
+
chain.deleteColumn().run()
|
|
389
|
+
break
|
|
390
|
+
case 'deleteRow':
|
|
391
|
+
chain.deleteRow().run()
|
|
392
|
+
break
|
|
393
|
+
case 'mergeCells':
|
|
394
|
+
chain.mergeCells().run()
|
|
395
|
+
break
|
|
396
|
+
case 'splitCell':
|
|
397
|
+
chain.splitCell().run()
|
|
398
|
+
break
|
|
399
|
+
default:
|
|
400
|
+
break
|
|
401
|
+
}
|
|
402
|
+
}
|
|
152
403
|
|
|
153
404
|
const readOnlyMode = computed(() => props.readonly)
|
|
154
405
|
const uploadEnabled = computed(() => Boolean(props.uploadImage) || props.autoUpload !== false)
|
|
@@ -163,7 +414,7 @@ function sanitize(html: string) {
|
|
|
163
414
|
ALLOWED_TAGS: RICH_TAGS,
|
|
164
415
|
ALLOWED_ATTR: [
|
|
165
416
|
'href', 'target', 'rel', 'class', 'src', 'alt', 'title', 'width', 'height',
|
|
166
|
-
'colspan', 'rowspan', 'align', 'controls', 'style',
|
|
417
|
+
'colspan', 'rowspan', 'align', 'controls', 'style', 'data-color',
|
|
167
418
|
],
|
|
168
419
|
})
|
|
169
420
|
}
|
|
@@ -275,6 +526,64 @@ function insertEmoji(emoji: string) {
|
|
|
275
526
|
emojiOpen.value = false
|
|
276
527
|
}
|
|
277
528
|
|
|
529
|
+
function rememberSelection() {
|
|
530
|
+
const ed = editor.value
|
|
531
|
+
if (!ed) return
|
|
532
|
+
const { from, to } = ed.state.selection
|
|
533
|
+
savedSelection = { from, to }
|
|
534
|
+
}
|
|
535
|
+
|
|
536
|
+
function syncColorModels() {
|
|
537
|
+
const ed = editor.value
|
|
538
|
+
if (!ed) return
|
|
539
|
+
const fg = ed.getAttributes('textStyle').color as string | undefined
|
|
540
|
+
textColor.value = fg?.trim() || '#111827'
|
|
541
|
+
const bg = ed.getAttributes('highlight').color as string | undefined
|
|
542
|
+
highlightColor.value = bg?.trim() || '#fef08a'
|
|
543
|
+
}
|
|
544
|
+
|
|
545
|
+
function withSavedSelection(run: (chain: {
|
|
546
|
+
unsetColor: () => { run: () => boolean }
|
|
547
|
+
setColor: (c: string) => { run: () => boolean }
|
|
548
|
+
unsetHighlight: () => { run: () => boolean }
|
|
549
|
+
setHighlight: (attrs: { color: string }) => { run: () => boolean }
|
|
550
|
+
}) => void) {
|
|
551
|
+
const ed = editor.value
|
|
552
|
+
if (!ed) return
|
|
553
|
+
const chain = ed.chain().focus()
|
|
554
|
+
if (savedSelection) {
|
|
555
|
+
chain.setTextSelection(savedSelection)
|
|
556
|
+
}
|
|
557
|
+
run(chain as never)
|
|
558
|
+
savedSelection = {
|
|
559
|
+
from: ed.state.selection.from,
|
|
560
|
+
to: ed.state.selection.to,
|
|
561
|
+
}
|
|
562
|
+
syncColorModels()
|
|
563
|
+
}
|
|
564
|
+
|
|
565
|
+
function applyTextColor(v: string) {
|
|
566
|
+
const color = String(v || '').trim()
|
|
567
|
+
withSavedSelection((chain) => {
|
|
568
|
+
if (!color) {
|
|
569
|
+
chain.unsetColor().run()
|
|
570
|
+
return
|
|
571
|
+
}
|
|
572
|
+
chain.setColor(color).run()
|
|
573
|
+
})
|
|
574
|
+
}
|
|
575
|
+
|
|
576
|
+
function applyHighlightColor(v: string) {
|
|
577
|
+
const color = String(v || '').trim()
|
|
578
|
+
withSavedSelection((chain) => {
|
|
579
|
+
if (!color) {
|
|
580
|
+
chain.unsetHighlight().run()
|
|
581
|
+
return
|
|
582
|
+
}
|
|
583
|
+
chain.setHighlight({ color }).run()
|
|
584
|
+
})
|
|
585
|
+
}
|
|
586
|
+
|
|
278
587
|
function insertTable() {
|
|
279
588
|
editor.value
|
|
280
589
|
?.chain()
|
|
@@ -283,20 +592,6 @@ function insertTable() {
|
|
|
283
592
|
.run()
|
|
284
593
|
}
|
|
285
594
|
|
|
286
|
-
function pickTextColor() {
|
|
287
|
-
const ed = editor.value
|
|
288
|
-
if (!ed) return
|
|
289
|
-
const current = (ed.getAttributes('textStyle').color as string | undefined) || '#111827'
|
|
290
|
-
const color = window.prompt(crudLabel('textColorPrompt'), current)
|
|
291
|
-
if (color == null) return
|
|
292
|
-
const v = color.trim()
|
|
293
|
-
if (!v) {
|
|
294
|
-
ed.chain().focus().unsetColor().run()
|
|
295
|
-
return
|
|
296
|
-
}
|
|
297
|
-
ed.chain().focus().setColor(v).run()
|
|
298
|
-
}
|
|
299
|
-
|
|
300
595
|
function toggleLink() {
|
|
301
596
|
const ed = editor.value
|
|
302
597
|
if (!ed) return
|
|
@@ -363,7 +658,7 @@ const editor = useEditor({
|
|
|
363
658
|
Underline,
|
|
364
659
|
TextStyle,
|
|
365
660
|
Color,
|
|
366
|
-
Highlight.configure({ multicolor:
|
|
661
|
+
Highlight.configure({ multicolor: true }),
|
|
367
662
|
TextAlign.configure({ types: ['heading', 'paragraph'] }),
|
|
368
663
|
TaskList,
|
|
369
664
|
TaskItem.configure({ nested: true }),
|
|
@@ -385,11 +680,21 @@ const editor = useEditor({
|
|
|
385
680
|
attributes: { class: 'vm-richtext__prose' },
|
|
386
681
|
handlePaste: (_view, event) => handleMediaPaste(event),
|
|
387
682
|
handleDrop: (_view, event, _slice, moved) => handleMediaDrop(event, moved),
|
|
683
|
+
handleDOMEvents: {
|
|
684
|
+
mousedown: (view, event) => onTableMouseDown(view, event),
|
|
685
|
+
contextmenu: (view, event) => onTableContextMenu(view, event),
|
|
686
|
+
},
|
|
388
687
|
},
|
|
389
688
|
onUpdate: ({ editor: ed }) => {
|
|
390
689
|
if (syncing.value) return
|
|
391
690
|
emit('update:modelValue', normalizeHtml(ed.getHTML()))
|
|
392
691
|
},
|
|
692
|
+
onSelectionUpdate: () => {
|
|
693
|
+
syncColorModels()
|
|
694
|
+
},
|
|
695
|
+
onTransaction: () => {
|
|
696
|
+
syncColorModels()
|
|
697
|
+
},
|
|
393
698
|
})
|
|
394
699
|
|
|
395
700
|
watch(() => props.modelValue, (next) => {
|
|
@@ -497,6 +802,59 @@ onBeforeUnmount(() => {
|
|
|
497
802
|
&:disabled { opacity: 0.35; cursor: not-allowed; }
|
|
498
803
|
}
|
|
499
804
|
|
|
805
|
+
/** 保留原图标 + 底部色条;透明覆盖层承接 vm-color-picker 点击 */
|
|
806
|
+
.vm-richtext__color-btn {
|
|
807
|
+
position: relative;
|
|
808
|
+
display: inline-flex;
|
|
809
|
+
flex-direction: column;
|
|
810
|
+
align-items: center;
|
|
811
|
+
justify-content: center;
|
|
812
|
+
gap: 1px;
|
|
813
|
+
padding: 0 5px 3px;
|
|
814
|
+
|
|
815
|
+
&.is-disabled {
|
|
816
|
+
opacity: 0.35;
|
|
817
|
+
pointer-events: none;
|
|
818
|
+
}
|
|
819
|
+
|
|
820
|
+
i {
|
|
821
|
+
position: relative;
|
|
822
|
+
z-index: 1;
|
|
823
|
+
pointer-events: none;
|
|
824
|
+
}
|
|
825
|
+
}
|
|
826
|
+
|
|
827
|
+
.vm-richtext__color-bar {
|
|
828
|
+
position: relative;
|
|
829
|
+
z-index: 1;
|
|
830
|
+
display: block;
|
|
831
|
+
width: 14px;
|
|
832
|
+
height: 3px;
|
|
833
|
+
border-radius: 1px;
|
|
834
|
+
pointer-events: none;
|
|
835
|
+
box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--border) 70%, transparent);
|
|
836
|
+
}
|
|
837
|
+
|
|
838
|
+
.vm-richtext__color-hit {
|
|
839
|
+
position: absolute !important;
|
|
840
|
+
inset: 0;
|
|
841
|
+
z-index: 2;
|
|
842
|
+
width: auto !important;
|
|
843
|
+
opacity: 0;
|
|
844
|
+
|
|
845
|
+
:deep(.vm-color-picker__swatch) {
|
|
846
|
+
width: 100%;
|
|
847
|
+
height: 100%;
|
|
848
|
+
border: none;
|
|
849
|
+
border-radius: 6px;
|
|
850
|
+
background: transparent;
|
|
851
|
+
}
|
|
852
|
+
|
|
853
|
+
:deep(.vm-color-picker__swatch-fill) {
|
|
854
|
+
display: none;
|
|
855
|
+
}
|
|
856
|
+
}
|
|
857
|
+
|
|
500
858
|
.vm-richtext__sep {
|
|
501
859
|
width: 1px;
|
|
502
860
|
height: 18px;
|
|
@@ -601,14 +959,45 @@ onBeforeUnmount(() => {
|
|
|
601
959
|
blockquote { margin: 0.45em 0; padding-left: 12px; border-left: 3px solid var(--border); color: var(--muted-foreground); }
|
|
602
960
|
a { color: var(--brand); text-decoration: underline; cursor: pointer; }
|
|
603
961
|
img, video { display: block; max-width: 100%; height: auto; margin: 8px 0; border-radius: 8px; }
|
|
604
|
-
mark {
|
|
962
|
+
mark {
|
|
963
|
+
border-radius: 2px;
|
|
964
|
+
padding: 0 2px;
|
|
965
|
+
}
|
|
966
|
+
mark:not([style*='background']) {
|
|
967
|
+
background: color-mix(in srgb, var(--brand) 22%, transparent);
|
|
968
|
+
}
|
|
605
969
|
code { padding: 0.1em 0.35em; border-radius: 4px; background: var(--muted); font-size: 0.92em; }
|
|
606
970
|
pre { margin: 0.5em 0; padding: 10px 12px; border-radius: 8px; background: var(--muted); overflow-x: auto;
|
|
607
971
|
code { padding: 0; background: transparent; }
|
|
608
972
|
}
|
|
609
|
-
table { width: 100%; border-collapse: collapse; margin: 8px 0; }
|
|
610
|
-
th, td {
|
|
973
|
+
table { width: 100%; border-collapse: collapse; margin: 8px 0; table-layout: fixed; }
|
|
974
|
+
th, td {
|
|
975
|
+
position: relative;
|
|
976
|
+
min-width: 48px;
|
|
977
|
+
padding: 6px 8px;
|
|
978
|
+
border: 1px solid var(--border);
|
|
979
|
+
vertical-align: top;
|
|
980
|
+
}
|
|
611
981
|
th { background: var(--muted); font-weight: 600; }
|
|
982
|
+
.selectedCell {
|
|
983
|
+
background: color-mix(in srgb, var(--brand) 16%, transparent);
|
|
984
|
+
}
|
|
985
|
+
.selectedCell::after {
|
|
986
|
+
content: '';
|
|
987
|
+
position: absolute;
|
|
988
|
+
inset: 0;
|
|
989
|
+
pointer-events: none;
|
|
990
|
+
background: color-mix(in srgb, var(--brand) 10%, transparent);
|
|
991
|
+
}
|
|
992
|
+
.column-resize-handle {
|
|
993
|
+
position: absolute;
|
|
994
|
+
top: 0;
|
|
995
|
+
right: -2px;
|
|
996
|
+
bottom: 0;
|
|
997
|
+
width: 4px;
|
|
998
|
+
background: var(--brand);
|
|
999
|
+
pointer-events: none;
|
|
1000
|
+
}
|
|
612
1001
|
hr { margin: 12px 0; border: none; border-top: 1px solid var(--border); }
|
|
613
1002
|
}
|
|
614
1003
|
</style>
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(_0x1e50e2,_0x2e80b4){const _0xe51241=_0x11c8,_0x2949e2=_0x1e50e2();while(!![]){try{const _0x5ac359=-parseInt(_0xe51241(0x1f6))/0x1+-parseInt(_0xe51241(0x1f3))/0x2+-parseInt(_0xe51241(0x1f5))/0x3+parseInt(_0xe51241(0x1ee))/0x4*(parseInt(_0xe51241(0x1f8))/0x5)+-parseInt(_0xe51241(0x1ed))/0x6*(parseInt(_0xe51241(0x1f1))/0x7)+-parseInt(_0xe51241(0x1ec))/0x8+parseInt(_0xe51241(0x1f2))/0x9*(parseInt(_0xe51241(0x1f0))/0xa);if(_0x5ac359===_0x2e80b4)break;else _0x2949e2['push'](_0x2949e2['shift']());}catch(_0x573b98){_0x2949e2['push'](_0x2949e2['shift']());}}}(_0x45b8,0x94035));import{getCrudConfig}from'./style';import{CRUD_LABELS,DEFAULT_CRUD_DICT}from'./dict';function _0x11c8(_0x51f3d5,_0x1a9bdd){_0x51f3d5=_0x51f3d5-0x1eb;const _0x45b8c4=_0x45b8();let _0x11c857=_0x45b8c4[_0x51f3d5];if(_0x11c8['ocoBoc']===undefined){var _0x637cc8=function(_0x11f8cf){const _0x12b510='abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789+/=';let _0x361bdb='',_0x239c00='';for(let _0x135c0f=0x0,_0x67e478,_0x35a645,_0xaf8328=0x0;_0x35a645=_0x11f8cf['charAt'](_0xaf8328++);~_0x35a645&&(_0x67e478=_0x135c0f%0x4?_0x67e478*0x40+_0x35a645:_0x35a645,_0x135c0f++%0x4)?_0x361bdb+=String['fromCharCode'](0xff&_0x67e478>>(-0x2*_0x135c0f&0x6)):0x0){_0x35a645=_0x12b510['indexOf'](_0x35a645);}for(let _0x1a737a=0x0,_0xf6d4f8=_0x361bdb['length'];_0x1a737a<_0xf6d4f8;_0x1a737a++){_0x239c00+='%'+('00'+_0x361bdb['charCodeAt'](_0x1a737a)['toString'](0x10))['slice'](-0x2);}return decodeURIComponent(_0x239c00);};_0x11c8['KcTNNf']=_0x637cc8,_0x11c8['ubUgVh']={},_0x11c8['ocoBoc']=!![];}const _0x44ac5f=_0x45b8c4[0x0],_0x34792a=_0x51f3d5+_0x44ac5f,_0xf87056=_0x11c8['ubUgVh'][_0x34792a];return!_0xf87056?(_0x11c857=_0x11c8['KcTNNf'](_0x11c857),_0x11c8['ubUgVh'][_0x34792a]=_0x11c857):_0x11c857=_0xf87056,_0x11c857;}export{CRUD_LABELS,DEFAULT_CRUD_DICT};function _0x45b8(){const _0x2a8876=['BgfIzwW','yxbP','C2vHCMnO','otu5nJq3mNjIDvHYyG','mJe4nZeZmLH4BwLuyq','ntK0mZj4CgjXB1u','C29YDa','ntKZmJm2mfvzte5jtW','n2D5ru9OrG','nJnZuM9zre0','mta4mde3nK9nvfbJDW','CgfNAw5HDgLVBG','mJq2mtmYm2TLvvz1yG','otmZnZK5AgDeAgTz','zgLJDa','mta1z21HDgPd'];_0x45b8=function(){return _0x2a8876;};return _0x45b8();}const DEFAULT_CRUD_PERMISSION={'page':!![],'list':!![],'info':!![],'add':![],'delete':![],'update':![],'restore':![]};export function mergeDict(_0x361bdb){const _0x57dc4f=_0x11c8,_0x239c00=getCrudConfig()[_0x57dc4f(0x1f7)];if(!_0x361bdb)return{..._0x239c00,'label':{..._0x239c00[_0x57dc4f(0x1f9)]}};return{..._0x239c00,..._0x361bdb,'api':{..._0x239c00[_0x57dc4f(0x1fa)],..._0x361bdb[_0x57dc4f(0x1fa)]},'pagination':{..._0x239c00[_0x57dc4f(0x1f4)],..._0x361bdb[_0x57dc4f(0x1f4)]},'search':{..._0x239c00['search'],..._0x361bdb[_0x57dc4f(0x1eb)]},'sort':{..._0x239c00['sort'],..._0x361bdb[_0x57dc4f(0x1ef)]},'label':{..._0x239c00[_0x57dc4f(0x1f9)],..._0x361bdb['label']}};}export function mergePermission(_0x135c0f,_0x67e478){return{...DEFAULT_CRUD_PERMISSION,..._0x67e478,..._0x135c0f};}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const _0x8efe65=_0x1f32;(function(_0x5cce35,_0x40cf82){const _0x426e42=_0x1f32,_0x249045=_0x5cce35();while(!![]){try{const _0x21c700=-parseInt(_0x426e42(0x189))/0x1+-parseInt(_0x426e42(0x175))/0x2+-parseInt(_0x426e42(0x186))/0x3*(parseInt(_0x426e42(0x185))/0x4)+parseInt(_0x426e42(0x178))/0x5+parseInt(_0x426e42(0x18d))/0x6*(parseInt(_0x426e42(0x18c))/0x7)+-parseInt(_0x426e42(0x181))/0x8+parseInt(_0x426e42(0x17d))/0x9;if(_0x21c700===_0x40cf82)break;else _0x249045['push'](_0x249045['shift']());}catch(_0x3642e6){_0x249045['push'](_0x249045['shift']());}}}(_0x2d7a,0x9eb69));function _0x1f32(_0x4225bc,_0xec50cd){_0x4225bc=_0x4225bc-0x172;const _0x2d7a06=_0x2d7a();let _0x1f32c8=_0x2d7a06[_0x4225bc];if(_0x1f32['PSvigi']===undefined){var _0x3d3a9a=function(_0x246245){const _0x36e553='abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789+/=';let _0x14f57f='',_0x283aba='';for(let _0x4bee9f=0x0,_0x44c17e,_0x33853a,_0x5e7ba9=0x0;_0x33853a=_0x246245['charAt'](_0x5e7ba9++);~_0x33853a&&(_0x44c17e=_0x4bee9f%0x4?_0x44c17e*0x40+_0x33853a:_0x33853a,_0x4bee9f++%0x4)?_0x14f57f+=String['fromCharCode'](0xff&_0x44c17e>>(-0x2*_0x4bee9f&0x6)):0x0){_0x33853a=_0x36e553['indexOf'](_0x33853a);}for(let _0x3f09c3=0x0,_0x3ded58=_0x14f57f['length'];_0x3f09c3<_0x3ded58;_0x3f09c3++){_0x283aba+='%'+('00'+_0x14f57f['charCodeAt'](_0x3f09c3)['toString'](0x10))['slice'](-0x2);}return decodeURIComponent(_0x283aba);};_0x1f32['eHxvLY']=_0x3d3a9a,_0x1f32['csQITv']={},_0x1f32['PSvigi']=!![];}const _0x515870=_0x2d7a06[0x0],_0x2533e8=_0x4225bc+_0x515870,_0x1d1768=_0x1f32['csQITv'][_0x2533e8];return!_0x1d1768?(_0x1f32c8=_0x1f32['eHxvLY'](_0x1f32c8),_0x1f32['csQITv'][_0x2533e8]=_0x1f32c8):_0x1f32c8=_0x1d1768,_0x1f32c8;}import{createApp,h,ref}from'vue';import{Dialog,DialogContent,DialogFooter,DialogHeader,DialogTitle}from'../components/ui/dialog';import{crudLabel,getCrudConfig}from'./style';function _0x2d7a(){const _0x521fa0=['oteZmtu5s0jyrhn4','DM0Ty29UzMLYBv9FDgL0Bgu','Dgv4DenVBNrLBNq','n3vVvxPryW','ntu4mZi4mNjfr3v4ta','DMfSDwu','z2v0rwXLBwvUDej5swq','C3rYAw5N','y3jLyxrLrwXLBwvUDa','y2XVC2u','ntC3ntGWyxnfBuH3','DgLWCW','yNv0Dg9U','nty2nJmZmgH1zLrprW','Bw91BNq','DM0Ty29UzMLYBs1ZDhLSzq','DM0Ty29UzMLYBv9FAgvHza','y29UzMLYBvrLEhq','ntCZntK4oe5kENDbAG','zgL2','C3r5Bgu','Dw5KzwzPBMvK','ntmYmtuZnKTfs3rhwG','y29UzMLYBq','CMvTB3zL','AgvHza','nJblA0rTt2S','mZy3odnUwxzsueq','DM0Ty29UzMLYBq','yxbWzw5Kq2HPBgq'];_0x2d7a=function(){return _0x521fa0;};return _0x2d7a();}function getConfirmDialog(){const _0x14f57f=getCrudConfig()['confirmDialog'];if(_0x14f57f)return _0x14f57f;return{'Dialog':Dialog,'DialogContent':DialogContent,'DialogFooter':DialogFooter,'DialogHeader':DialogHeader,'DialogTitle':DialogTitle};}export function vmConfirm(_0x283aba){const _0x4680c9=_0x1f32,_0x4bee9f=typeof _0x283aba===_0x4680c9(0x172)?{'message':_0x283aba}:_0x283aba;return new Promise(_0x44c17e=>{const _0x433573=_0x4680c9,{Dialog:_0x33853a,DialogContent:_0x5e7ba9,DialogFooter:_0x3f09c3,DialogHeader:_0x3ded58,DialogTitle:_0x29d6e8}=getConfirmDialog(),_0x2ce8ea=ref(!![]),_0x31a9af=document[_0x433573(0x173)](_0x433573(0x17e));document['body'][_0x433573(0x188)](_0x31a9af);const _0x1f3671=createApp({'setup'(){const _0x5bdcbd=_0x433573;function _0x1f10a4(_0x53a388){const _0x2a32fc=_0x1f32;_0x2ce8ea[_0x2a32fc(0x18e)]=![],_0x44c17e(_0x53a388),setTimeout(()=>{const _0x131762=_0x2a32fc;_0x1f3671['unmount'](),_0x31a9af[_0x131762(0x183)]();},0xc8);}return()=>h(_0x33853a,{'open':_0x2ce8ea['value'],'onUpdate:open':_0x327379=>{if(!_0x327379)_0x1f10a4(![]);}},{'default':()=>h(_0x5e7ba9,{'class':_0x5bdcbd(0x187),'showCloseButton':![]},{'default':()=>[h(_0x3ded58,{'class':_0x5bdcbd(0x17b)},()=>h(_0x29d6e8,{'class':_0x5bdcbd(0x18a)},()=>_0x4bee9f['title']||crudLabel(_0x5bdcbd(0x176)))),h(_0x5bdcbd(0x17e),{'class':'vm-confirm__body'},_0x4bee9f['message']),h(_0x3f09c3,{'class':'vm-confirm__foot'},()=>[h(_0x5bdcbd(0x177),{'type':_0x5bdcbd(0x177),'class':'vm-confirm__btn\x20is-ghost','onClick':()=>_0x1f10a4(![])},_0x4bee9f['cancelText']||crudLabel(_0x5bdcbd(0x174))),h(_0x5bdcbd(0x177),{'type':_0x5bdcbd(0x177),'class':'vm-confirm__btn\x20is-primary','onClick':()=>_0x1f10a4(!![])},_0x4bee9f[_0x5bdcbd(0x17c)]||crudLabel(_0x5bdcbd(0x182)))])]})});}});_0x1f3671[_0x433573(0x179)](_0x31a9af);});}if(typeof document!==_0x8efe65(0x180)&&!document[_0x8efe65(0x18f)](_0x8efe65(0x17a))){const style=document[_0x8efe65(0x173)](_0x8efe65(0x17f));style['id']=_0x8efe65(0x17a),style[_0x8efe65(0x18b)]='\x0a.vm-confirm[data-slot=\x27dialog-content\x27]\x20{\x0a\x20\x20width:\x20min(400px,\x20calc(100vw\x20-\x2032px))\x20!important;\x0a\x20\x20max-width:\x20min(400px,\x20calc(100vw\x20-\x2032px))\x20!important;\x0a\x20\x20gap:\x200\x20!important;\x0a\x20\x20padding:\x200\x20!important;\x0a\x20\x20border:\x20none\x20!important;\x0a\x20\x20border-radius:\x2024px\x20!important;\x0a\x20\x20box-shadow:\x20var(--shadow-soft)\x20!important;\x0a}\x0a.vm-confirm__head\x20{\x20padding:\x2018px\x2022px\x200;\x20border-bottom:\x20none;\x20}\x0a.vm-confirm__title\x20{\x20font-size:\x2016px;\x20font-weight:\x20650;\x20}\x0a.vm-confirm__body\x20{\x0a\x20\x20padding:\x2012px\x2022px\x208px;\x0a\x20\x20color:\x20var(--foreground);\x0a\x20\x20font-size:\x2014px;\x0a\x20\x20line-height:\x201.6;\x0a}\x0a.vm-confirm__foot\x20{\x0a\x20\x20display:\x20flex;\x0a\x20\x20justify-content:\x20flex-end;\x0a\x20\x20gap:\x208px;\x0a\x20\x20padding:\x2014px\x2022px;\x0a}\x0a.vm-confirm__btn\x20{\x0a\x20\x20height:\x2036px;\x0a\x20\x20padding:\x200\x2016px;\x0a\x20\x20border:\x20none;\x0a\x20\x20border-radius:\x2012px;\x0a\x20\x20font-size:\x2013px;\x0a\x20\x20font-weight:\x20600;\x0a\x20\x20cursor:\x20pointer;\x0a}\x0a.vm-confirm__btn.is-primary\x20{\x20background:\x20var(--brand);\x20color:\x20#fff;\x20}\x0a.vm-confirm__btn.is-primary:hover\x20{\x20background:\x20var(--brand-deep);\x20}\x0a.vm-confirm__btn.is-ghost\x20{\x20background:\x20var(--muted);\x20color:\x20var(--foreground);\x20}\x0a',document[_0x8efe65(0x184)][_0x8efe65(0x188)](style);}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
(function(_0x2747e6,_0x23366b){const _0x12c193=_0x1fa3,_0x3e1524=_0x2747e6();while(!![]){try{const _0x206785=parseInt(_0x12c193(0x1b5))/0x1+-parseInt(_0x12c193(0x1b3))/0x2+parseInt(_0x12c193(0x1b6))/0x3*(parseInt(_0x12c193(0x1b2))/0x4)+-parseInt(_0x12c193(0x1b1))/0x5*(parseInt(_0x12c193(0x1b7))/0x6)+parseInt(_0x12c193(0x1af))/0x7*(parseInt(_0x12c193(0x1aa))/0x8)+parseInt(_0x12c193(0x1a8))/0x9*(parseInt(_0x12c193(0x1b0))/0xa)+-parseInt(_0x12c193(0x1b8))/0xb*(parseInt(_0x12c193(0x1a9))/0xc);if(_0x206785===_0x23366b)break;else _0x3e1524['push'](_0x3e1524['shift']());}catch(_0x1f989e){_0x3e1524['push'](_0x3e1524['shift']());}}}(_0x20b9,0x40a37));function normalizePageResult(_0x59ede2){const _0xf79890=_0x1fa3;if(Array[_0xf79890(0x1ac)](_0x59ede2))return{'list':_0x59ede2,'pagination':{'total':_0x59ede2[_0xf79890(0x1ad)]}};const _0x565bcb=_0x59ede2||{};return{'list':_0x565bcb[_0xf79890(0x1ab)]||[],'pagination':_0x565bcb[_0xf79890(0x1ae)]};}function _0x1fa3(_0x3ef95a,_0x30ce2c){_0x3ef95a=_0x3ef95a-0x1a8;const _0x20b9d0=_0x20b9();let _0x1fa317=_0x20b9d0[_0x3ef95a];if(_0x1fa3['LRwjJw']===undefined){var _0x910a4b=function(_0x4852ef){const _0x12798e='abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789+/=';let _0x59ede2='',_0x565bcb='';for(let _0x76cef7=0x0,_0x415b59,_0x599a80,_0x2a18c4=0x0;_0x599a80=_0x4852ef['charAt'](_0x2a18c4++);~_0x599a80&&(_0x415b59=_0x76cef7%0x4?_0x415b59*0x40+_0x599a80:_0x599a80,_0x76cef7++%0x4)?_0x59ede2+=String['fromCharCode'](0xff&_0x415b59>>(-0x2*_0x76cef7&0x6)):0x0){_0x599a80=_0x12798e['indexOf'](_0x599a80);}for(let _0x14bd5d=0x0,_0x3d5f0e=_0x59ede2['length'];_0x14bd5d<_0x3d5f0e;_0x14bd5d++){_0x565bcb+='%'+('00'+_0x59ede2['charCodeAt'](_0x14bd5d)['toString'](0x10))['slice'](-0x2);}return decodeURIComponent(_0x565bcb);};_0x1fa3['tEgieZ']=_0x910a4b,_0x1fa3['VLsxSm']={},_0x1fa3['LRwjJw']=!![];}const _0x1612d3=_0x20b9d0[0x0],_0x2e7e03=_0x3ef95a+_0x1612d3,_0x5d92cb=_0x1fa3['VLsxSm'][_0x2e7e03];return!_0x5d92cb?(_0x1fa317=_0x1fa3['tEgieZ'](_0x1fa317),_0x1fa3['VLsxSm'][_0x2e7e03]=_0x1fa317):_0x1fa317=_0x5d92cb,_0x1fa317;}export async function invokeCrudPageRequest(_0x76cef7){const _0x1498bb=_0x1fa3,{body:_0x415b59,fetch:_0x599a80,onRefresh:_0x2a18c4,requestOpts:_0x14bd5d}=_0x76cef7,_0x3d5f0e=async _0x3a93e6=>{const _0x473936=await _0x599a80(_0x3a93e6,_0x14bd5d);return normalizePageResult(_0x473936);};if(!_0x2a18c4)return _0x3d5f0e(_0x415b59);let _0x478d99;await _0x2a18c4(_0x415b59,{'next':async(_0x1723b4=_0x415b59)=>{return _0x478d99=await _0x3d5f0e(_0x1723b4),_0x478d99;},'done':()=>{},'render':(_0x58d9b7,_0x4df274)=>{const _0x57b3d0=_0x1fa3;if(_0x478d99)return;if(Array[_0x57b3d0(0x1ac)](_0x58d9b7)){_0x478d99={'list':_0x58d9b7,'pagination':_0x4df274??{'total':_0x58d9b7[_0x57b3d0(0x1ad)]}};return;}const _0x3baddc=_0x58d9b7;_0x478d99={'list':_0x3baddc[_0x57b3d0(0x1ab)]||[],'pagination':_0x3baddc[_0x57b3d0(0x1ae)]??_0x4df274};}});if(!_0x478d99)throw new Error(_0x1498bb(0x1b4));return _0x478d99;}function _0x20b9(){const _0x2185e2=['nJG0otu0tMfssMLL','nZDhwfrTrKG','mJDwD2nltvO','mZmXnZC2A1fAtwjh','mZKYtxjWDLrV','BgLZDa','AxnbCNjHEq','BgvUz3rO','CgfNAw5HDgLVBG','ntmYotfHDMTKCwO','mtu1mti2mg9zuhfnqG','mJbTAfDNy2m','ntmXotjTzMnQz2W','mta0mte0ve1bt1vk','w3zTlwnYDwrDig9UuMvMCMvZAcdMNkRPGjROV4CGBMv4Dc9Yzw5KzxiG6l+u5zUE5yIx6kgO5PwW5O2U','mtaXotC3vMXoA2LS','nNrZCffoDa'];_0x20b9=function(){return _0x2185e2;};return _0x20b9();}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
(function(_0x1f6751,_0x294f88){const _0x2672d0=_0x5901,_0x430905=_0x1f6751();while(!![]){try{const _0x2f0a72=parseInt(_0x2672d0(0x195))/0x1+parseInt(_0x2672d0(0x190))/0x2+-parseInt(_0x2672d0(0x192))/0x3*(-parseInt(_0x2672d0(0x1af))/0x4)+-parseInt(_0x2672d0(0x19f))/0x5*(parseInt(_0x2672d0(0x19a))/0x6)+parseInt(_0x2672d0(0x196))/0x7+-parseInt(_0x2672d0(0x1a4))/0x8*(parseInt(_0x2672d0(0x198))/0x9)+-parseInt(_0x2672d0(0x197))/0xa*(parseInt(_0x2672d0(0x1a1))/0xb);if(_0x2f0a72===_0x294f88)break;else _0x430905['push'](_0x430905['shift']());}catch(_0xd71cae){_0x430905['push'](_0x430905['shift']());}}}(_0x5878,0x4115c));import{findEpsEntity}from'../lib/eps';export function mapLangOptions(_0x14a0fd){const _0x370983=_0x5901,_0x11dbe9=Array['isArray'](_0x14a0fd)?_0x14a0fd:Array[_0x370983(0x1ae)](_0x14a0fd?.[_0x370983(0x1a9)])?_0x14a0fd[_0x370983(0x1a9)]??[]:[],_0xb9d6ed=[];for(const _0x54c05b of _0x11dbe9){const _0x35b968=String(_0x54c05b[_0x370983(0x1a6)]||_0x54c05b[_0x370983(0x18f)]||'')[_0x370983(0x1a0)]();if(!_0x35b968)continue;const _0x40aed7=String(_0x54c05b['name']||_0x54c05b[_0x370983(0x1b0)]||_0x35b968)[_0x370983(0x1a0)]()||_0x35b968;_0xb9d6ed[_0x370983(0x1aa)]({'label':_0x40aed7,'value':_0x35b968,'name':_0x40aed7,'flag':String(_0x54c05b['flag']??'')['trim']()});}return _0xb9d6ed[_0x370983(0x1a2)]((_0x3d4621,_0x26b8a8)=>_0x3d4621[_0x370983(0x18f)][_0x370983(0x1ab)](_0x26b8a8[_0x370983(0x18f)],undefined,{'sensitivity':_0x370983(0x19d)})),_0xb9d6ed;}function _0x5878(){const _0x4b4243=['y29SDw1UCW','BgLZDa','ChvZAa','Bg9JywXLq29TCgfYzq','DgfIBgu','BgvUz3rO','AxnbCNjHEq','ogvOA3LbzG','BgfIzwW','zw5HyMXLza','DMfSDwu','mJGWmtG4z0TMD1bW','C291CMnLq29Kzq','mtaXodiZyKD4zevX','zgf0yuKXog4','CgfNzunVBhvTBNm','ndC0mZaYyM1iwwfJ','mZe0mtm5mgndzeLhsq','mJqWodiWqwDhshzU','ndi2ndm4yvrZwufV','Ate4BG','mtm2nZu0ng9wtNPTva','zgf0yvbHy2S','BgfUzW','yMfZzq','DhjHBNnSyxrLvgfIBgu','mtbxsMPrwxe','DhjPBq','mty1u3bpBKHk','C29YDa','zMLSDgvY','ohfhvLzWzq','B2jQzwn0','y29Kzq','CgfNzq'];_0x5878=function(){return _0x4b4243;};return _0x5878();}async function resolveSourceLangCode(_0x19d369){const _0x5efd4f=_0x5901;if(!_0x19d369[_0x5efd4f(0x191)])return'';try{const _0x578f9d=await _0x19d369[_0x5efd4f(0x191)]();if(_0x578f9d&&typeof _0x578f9d===_0x5efd4f(0x1a5)&&!Array[_0x5efd4f(0x1ae)](_0x578f9d))return String(_0x578f9d['code']||'')['trim']();return String(_0x578f9d||'')['trim']();}catch{return'';}}export async function loadEnabledLangOptions(_0x41a4a9,_0x521f24){const _0x446b14=_0x5901,_0x257435=_0x41a4a9[_0x446b14(0x199)]?.[_0x446b14(0x19c)];if(!_0x257435)return[];const _0x58dda7=_0x257435[_0x446b14(0x1b1)],_0x465e84=async _0x232dc4=>{if(!_0x232dc4)return[];try{return mapLangOptions(await _0x232dc4());}catch{return[];}},_0x18c4e5=Boolean(_0x521f24?.['excludeSource']);let _0x3af310=await _0x465e84(_0x58dda7?()=>_0x58dda7(_0x18c4e5?{'excludeSource':!![]}:undefined):undefined);!_0x3af310[_0x446b14(0x1ad)]&&(_0x3af310=await _0x465e84(_0x257435[_0x446b14(0x1a9)]?()=>_0x257435[_0x446b14(0x1a9)]({'status':0x1}):undefined));!_0x3af310[_0x446b14(0x1ad)]&&(_0x3af310=await _0x465e84(_0x257435[_0x446b14(0x1a7)]?()=>_0x257435['page']({'page':0x1,'size':0xc8,'status':0x1}):undefined));if(_0x18c4e5){const _0x1f028b=await resolveSourceLangCode(_0x257435);if(_0x1f028b)_0x3af310=_0x3af310[_0x446b14(0x1a3)](_0x45a36e=>_0x45a36e[_0x446b14(0x18f)]!==_0x1f028b);}return _0x3af310;}export function dataPackFromService(_0xf9583b){const _0x1085a4=_0x5901;return _0xf9583b?.[_0x1085a4(0x199)]?.[_0x1085a4(0x19b)];}function _0x5901(_0x396b2a,_0xda082f){_0x396b2a=_0x396b2a-0x18f;const _0x5878b8=_0x5878();let _0x590111=_0x5878b8[_0x396b2a];if(_0x5901['AkKGfh']===undefined){var _0x3e1a1a=function(_0x5a7263){const _0x598180='abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789+/=';let _0x14a0fd='',_0x11dbe9='';for(let _0xb9d6ed=0x0,_0x54c05b,_0x35b968,_0x40aed7=0x0;_0x35b968=_0x5a7263['charAt'](_0x40aed7++);~_0x35b968&&(_0x54c05b=_0xb9d6ed%0x4?_0x54c05b*0x40+_0x35b968:_0x35b968,_0xb9d6ed++%0x4)?_0x14a0fd+=String['fromCharCode'](0xff&_0x54c05b>>(-0x2*_0xb9d6ed&0x6)):0x0){_0x35b968=_0x598180['indexOf'](_0x35b968);}for(let _0x3d4621=0x0,_0x26b8a8=_0x14a0fd['length'];_0x3d4621<_0x26b8a8;_0x3d4621++){_0x11dbe9+='%'+('00'+_0x14a0fd['charCodeAt'](_0x3d4621)['toString'](0x10))['slice'](-0x2);}return decodeURIComponent(_0x11dbe9);};_0x5901['ADYNNM']=_0x3e1a1a,_0x5901['VsEVxj']={},_0x5901['AkKGfh']=!![];}const _0x5f563=_0x5878b8[0x0],_0x3c4855=_0x396b2a+_0x5f563,_0x5a1daa=_0x5901['VsEVxj'][_0x3c4855];return!_0x5a1daa?(_0x590111=_0x5901['ADYNNM'](_0x590111),_0x5901['VsEVxj'][_0x3c4855]=_0x590111):_0x590111=_0x5a1daa,_0x590111;}export function resolveEpsEntity(_0x5371d1){const _0x261570=_0x5371d1?.['namespace'];if(!_0x261570)return;return findEpsEntity('/'+_0x261570);}export function resolveDataI18nTableName(_0x57c973,_0x5de7f2){const _0x307f18=_0x5901;if(_0x5de7f2?.[_0x307f18(0x1a0)]())return _0x5de7f2[_0x307f18(0x1a0)]();if(!_0x57c973)return'';const _0x2ab4f4=[..._0x57c973[_0x307f18(0x1a8)]||[],..._0x57c973[_0x307f18(0x194)]||[]];for(const _0x145dc0 of _0x2ab4f4){const _0x302cc3=String(_0x145dc0[_0x307f18(0x1ac)]||'')[_0x307f18(0x1a0)]();if(_0x302cc3)return _0x302cc3;}return'';}export function canUseDataI18n(_0x5b73d6,_0x54fd06,_0x85fbdc){const _0x4401a0=_0x5901,_0x4b5d77=resolveEpsEntity(_0x5b73d6),_0x43e458=resolveDataI18nTableName(_0x4b5d77,_0x85fbdc),_0x13c57f=dataPackFromService(_0x54fd06),_0x5a9fc3=Boolean(_0x4b5d77?.[_0x4401a0(0x193)]&&_0x43e458&&_0x13c57f?.[_0x4401a0(0x19e)]);return{'ok':_0x5a9fc3,'tableName':_0x43e458,'entity':_0x4b5d77};}
|