vome-core 0.1.26 → 0.1.27

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.
@@ -1 +1 @@
1
- const _0x3c321b=_0x412f;(function(_0x5828f9,_0x1524b3){const _0x44ee95=_0x412f,_0x246a4e=_0x5828f9();while(!![]){try{const _0x42dd1c=parseInt(_0x44ee95(0x1a0))/0x1+parseInt(_0x44ee95(0x19e))/0x2+parseInt(_0x44ee95(0x1a1))/0x3+-parseInt(_0x44ee95(0x197))/0x4*(-parseInt(_0x44ee95(0x1ac))/0x5)+parseInt(_0x44ee95(0x196))/0x6*(parseInt(_0x44ee95(0x1a6))/0x7)+parseInt(_0x44ee95(0x199))/0x8+-parseInt(_0x44ee95(0x18f))/0x9;if(_0x42dd1c===_0x1524b3)break;else _0x246a4e['push'](_0x246a4e['shift']());}catch(_0x300b9e){_0x246a4e['push'](_0x246a4e['shift']());}}}(_0x11f6,0xacacd));const ORG=_0x3c321b(0x19f);export function serviceUrlFromDocs(_0x185a02){const _0x5739f8=_0x3c321b,_0x3671af=new URL(_0x185a02),_0x46bac4=_0x3671af[_0x5739f8(0x190)]['replace'](/^www\./,'')[_0x5739f8(0x1a7)](/^service\./,'');return _0x3671af[_0x5739f8(0x198)]+_0x5739f8(0x19d)+_0x46bac4;}export function seatApiBaseFromDocs(_0x6f0391){const _0x26b314=_0x3c321b;return serviceUrlFromDocs(_0x6f0391)+_0x26b314(0x1ab);}function _0x412f(_0x56722d,_0x21dfed){_0x56722d=_0x56722d-0x18f;const _0x11f6ef=_0x11f6();let _0x412f44=_0x11f6ef[_0x56722d];if(_0x412f['knSTYd']===undefined){var _0xc38e37=function(_0x25f388){const _0x7c1e01='abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789+/=';let _0x185a02='',_0x3671af='';for(let _0x46bac4=0x0,_0x6f0391,_0x29d51e,_0x487c63=0x0;_0x29d51e=_0x25f388['charAt'](_0x487c63++);~_0x29d51e&&(_0x6f0391=_0x46bac4%0x4?_0x6f0391*0x40+_0x29d51e:_0x29d51e,_0x46bac4++%0x4)?_0x185a02+=String['fromCharCode'](0xff&_0x6f0391>>(-0x2*_0x46bac4&0x6)):0x0){_0x29d51e=_0x7c1e01['indexOf'](_0x29d51e);}for(let _0x427ed8=0x0,_0x308e54=_0x185a02['length'];_0x427ed8<_0x308e54;_0x427ed8++){_0x3671af+='%'+('00'+_0x185a02['charCodeAt'](_0x427ed8)['toString'](0x10))['slice'](-0x2);}return decodeURIComponent(_0x3671af);};_0x412f['gYbhhk']=_0xc38e37,_0x412f['oxBKWP']={},_0x412f['knSTYd']=!![];}const _0x43fcd4=_0x11f6ef[0x0],_0x69870b=_0x56722d+_0x43fcd4,_0x7ebf1e=_0x412f['oxBKWP'][_0x69870b];return!_0x7ebf1e?(_0x412f44=_0x412f['gYbhhk'](_0x412f44),_0x412f['oxBKWP'][_0x69870b]=_0x412f44):_0x412f44=_0x7ebf1e,_0x412f44;}export function licenseIssueUrlFromDocs(_0x29d51e){const _0x9f4c2f=_0x3c321b;return serviceUrlFromDocs(_0x29d51e)+_0x9f4c2f(0x195);}function giteeArchive(_0x487c63){const _0x153b44=_0x3c321b;return _0x153b44(0x19c)+ORG+'/'+_0x487c63+_0x153b44(0x193);}function githubArchive(_0x427ed8){const _0x51b92f=_0x3c321b;return _0x51b92f(0x191)+ORG+'/'+_0x427ed8+'/archive/refs/heads/master.zip';}function giteeRepo(_0x308e54){const _0x53b464=_0x3c321b;return _0x53b464(0x19c)+ORG+'/'+_0x308e54;}function githubRepo(_0x3a7ee1){const _0x54bd7c=_0x3c321b;return _0x54bd7c(0x191)+ORG+'/'+_0x3a7ee1;}const docsUrl=_0x3c321b(0x1ad);export const pluginDev={'docsUrl':docsUrl,'serviceUrl':serviceUrlFromDocs(docsUrl),'uploadUrl':docsUrl+'/plugins/upload','mirrors':{'prefer':'gitee','giteeOrg':_0x3c321b(0x19c)+ORG,'githubOrg':_0x3c321b(0x191)+ORG},'scaffolds':{'full':{'key':_0x3c321b(0x1a9),'title':_0x3c321b(0x1a8),'desc':_0x3c321b(0x192),'repo':_0x3c321b(0x1a3),'repoUrl':giteeRepo('vome-plugin-full'),'githubRepoUrl':githubRepo(_0x3c321b(0x1a3)),'downloadUrl':giteeArchive('vome-plugin-full'),'githubDownloadUrl':githubArchive(_0x3c321b(0x1a3))},'backend':{'key':_0x3c321b(0x194),'title':'纯后端','desc':_0x3c321b(0x1a5),'repo':_0x3c321b(0x1aa),'repoUrl':giteeRepo(_0x3c321b(0x1aa)),'githubRepoUrl':githubRepo(_0x3c321b(0x1aa)),'downloadUrl':giteeArchive('vome-plugin-service'),'githubDownloadUrl':githubArchive(_0x3c321b(0x1aa))},'frontend':{'key':_0x3c321b(0x1a2),'title':_0x3c321b(0x19b),'desc':_0x3c321b(0x1a4),'repo':_0x3c321b(0x19a),'repoUrl':giteeRepo(_0x3c321b(0x19a)),'githubRepoUrl':githubRepo('vome-plugin-front'),'downloadUrl':giteeArchive('vome-plugin-front'),'githubDownloadUrl':githubArchive('vome-plugin-front')}}};function _0x11f6(){const _0x1d4525=['Ahr0Chm6lY92B21LA2OUy29T','ndq4nJa4nZHIuxvUvui','Ag9ZDg5HBwu','Ahr0Chm6lY9NAxrODwiUy29TlW','5A6m5Pw05lIA5yQH5QIH5z2x6isA5OMl5P6277YilNzVBwxVVjRLKkSGC2vYDMvYios4JIb3zwlVViNVViZMNkZLNldLVidLJ5hMIzpLJixLKi7LJ5hLUipJGii','l3jLCg9ZAxrVCNKVyxjJAgL2zs9Tyxn0zxiUEMLW','yMfJA2vUza','l2fWCc9WBhvNAw5tDg9Yzs93ywXSzxqVBgLJzw5Zzs9PC3n1zq','nZHAA3nsDMm','nejlr0jKCq','ChjVDg9JB2W','mZG0ndC1mMXlqvvfAG','DM9Tzs1WBhvNAw4TzNjVBNq','57QV5yMn56UV','Ahr0Chm6lY9NAxrLzs5JB20V','lY9Zzxj2AwnLlG','mJa4nZi4ofHNte1KAq','DM9TzwTQ','mJKWntyXzvbnAvzp','nda3mtmYmvjJrgn6vW','zNjVBNrLBMq','DM9Tzs1WBhvNAw4TzNvSBa','5zco5y+W5B6U5BQu55sO6isA5OMl5P6277YilNzVBwxVVjRLKkSGD2vIl++8IE+8Jos7Psb3DwPPzsdMJilOVB3NI6ZNQ4VLIy3NQ6/POBxPNAlJGii','6zkP5A2qic8G5PYn5yQH56UV5O+s5lU26isA5OMl5P6277YilNzVBwxVVjRKU4uGC2vYDMvY77Yj77Ym6ycc5zci5lIk5lYG44cb55+T5l+H44cb5PsV5lUy562j6io95yQB5OMP5Bgv44cc','nJK4ndG4zMPSrwDm','CMvWBgfJzq','5yMn56UVicSG5zco56UV','zNvSBa','DM9Tzs1WBhvNAw4TC2vYDMLJzq','l2fWCc9WBhvNAw5tDg9Yzs9Zzwf0','nJeXmZyWnwXLrhfutG'];_0x11f6=function(){return _0x1d4525;};return _0x11f6();}
1
+ const _0x245ea6=_0x5738;(function(_0x217bd0,_0x3783bd){const _0x8ef90f=_0x5738,_0x24f6a2=_0x217bd0();while(!![]){try{const _0x19b1e6=parseInt(_0x8ef90f(0x178))/0x1+-parseInt(_0x8ef90f(0x193))/0x2+parseInt(_0x8ef90f(0x189))/0x3+-parseInt(_0x8ef90f(0x18f))/0x4+parseInt(_0x8ef90f(0x191))/0x5*(-parseInt(_0x8ef90f(0x183))/0x6)+-parseInt(_0x8ef90f(0x190))/0x7*(parseInt(_0x8ef90f(0x17d))/0x8)+parseInt(_0x8ef90f(0x186))/0x9*(parseInt(_0x8ef90f(0x181))/0xa);if(_0x19b1e6===_0x3783bd)break;else _0x24f6a2['push'](_0x24f6a2['shift']());}catch(_0x318829){_0x24f6a2['push'](_0x24f6a2['shift']());}}}(_0x1ba4,0xadcb7));const ORG=_0x245ea6(0x17e);export function serviceUrlFromDocs(_0x518aec){const _0x368b3f=_0x245ea6,_0x12bba5=new URL(_0x518aec),_0x515ef0=_0x12bba5['hostname'][_0x368b3f(0x18c)](/^www\./,'')['replace'](/^service\./,'');return _0x12bba5[_0x368b3f(0x182)]+'//service.'+_0x515ef0;}export function seatApiBaseFromDocs(_0x167144){const _0xd6b169=_0x245ea6;return serviceUrlFromDocs(_0x167144)+_0xd6b169(0x17a);}export function licenseIssueUrlFromDocs(_0x58196e){const _0x84dd57=_0x245ea6;return serviceUrlFromDocs(_0x58196e)+_0x84dd57(0x180);}function _0x1ba4(){const _0x4d745a=['mtGZmJK5mhHjEMPQDa','ChjVDg9JB2W','nte3og1TtwHdzG','5yMn56UVicSG5zco56UV','DM9Tzs1WBhvNAw4TC2vYDMLJzq','mta4z1fTwgn4','z2L0zwu','l2fYy2HPDMuVCMvMCY9OzwfKCY9Tyxn0zxiUEMLW','mZyYnJG3neros2Dctq','zNvSBa','DM9Tzs1WBhvNAw4TzNvSBa','CMvWBgfJzq','5zco5y+W5B6U5BQu55sO6isA5OMl5P6277YilNzVBwxVVjRLKkSGD2vIl++8IE+8Jos7Psb3DwPPzsdMJilOVB3NI6ZNQ4VLIy3NQ6/POBxPNAlJGii','57QV5yMn56UV','ndyXnJe2ohH4ywDSDG','n0XvsfjNwG','nJq3mgnMwNrvwG','Ahr0Chm6lY9NAxrODwiUy29TlW','mJuYota4mNzTs0rbrW','6zkP5A2qic8G5PYn5yQH56UV5O+s5lU26isA5OMl5P6277YilNzVBwxVVjRKU4uGC2vYDMvY77Yj77Ym6ycc5zci5lIk5lYG44cb55+T5l+H44cb5PsV5lUy562j6io95yQB5OMP5Bgv44cc','Ahr0Chm6lY9NAxrLzs5JB20V','DM9Tzs1WBhvNAw4TzNjVBNq','mteYnZC3m0zey2L4sG','yMfJA2vUza','l2fWCc9WBhvNAw5tDg9Yzs9Zzwf0','5A6m5Pw05lIA5yQH5QIH5z2x6isA5OMl5P6277YilNzVBwxVVjRLKkSGC2vYDMvYios4JIb3zwlVViNVViZMNkZLNldLVidLJ5hMIzpLJixLKi7LJ5hLUipJGii','zNjVBNrLBMq','mJmXmZiWohLmDhH6uq','DM9TzwTQ','l3bSDwDPBNmVDxbSB2fK','l2fWCc9WBhvNAw5tDg9Yzs93ywXSzxqVBgLJzw5Zzs9PC3n1zq'];_0x1ba4=function(){return _0x4d745a;};return _0x1ba4();}function giteeArchive(_0x31818e){const _0x3f07f3=_0x245ea6;return _0x3f07f3(0x176)+ORG+'/'+_0x31818e+'/repository/archive/master.zip';}function githubArchive(_0x37a8f5){const _0x51d5ee=_0x245ea6;return _0x51d5ee(0x192)+ORG+'/'+_0x37a8f5+_0x51d5ee(0x188);}function giteeRepo(_0x649b87){return'https://gitee.com/'+ORG+'/'+_0x649b87;}function githubRepo(_0x39d849){return'https://github.com/'+ORG+'/'+_0x39d849;}function _0x5738(_0x3d205a,_0x49a45f){_0x3d205a=_0x3d205a-0x175;const _0x1ba4c1=_0x1ba4();let _0x573808=_0x1ba4c1[_0x3d205a];if(_0x5738['BzNZAs']===undefined){var _0x32c628=function(_0x3248e0){const _0x9056ea='abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789+/=';let _0x518aec='',_0x12bba5='';for(let _0x515ef0=0x0,_0x167144,_0x58196e,_0x31818e=0x0;_0x58196e=_0x3248e0['charAt'](_0x31818e++);~_0x58196e&&(_0x167144=_0x515ef0%0x4?_0x167144*0x40+_0x58196e:_0x58196e,_0x515ef0++%0x4)?_0x518aec+=String['fromCharCode'](0xff&_0x167144>>(-0x2*_0x515ef0&0x6)):0x0){_0x58196e=_0x9056ea['indexOf'](_0x58196e);}for(let _0x37a8f5=0x0,_0x649b87=_0x518aec['length'];_0x37a8f5<_0x649b87;_0x37a8f5++){_0x12bba5+='%'+('00'+_0x518aec['charCodeAt'](_0x37a8f5)['toString'](0x10))['slice'](-0x2);}return decodeURIComponent(_0x12bba5);};_0x5738['UlgIzL']=_0x32c628,_0x5738['zMFEqs']={},_0x5738['BzNZAs']=!![];}const _0x956bbb=_0x1ba4c1[0x0],_0x506e04=_0x3d205a+_0x956bbb,_0x1be382=_0x5738['zMFEqs'][_0x506e04];return!_0x1be382?(_0x573808=_0x5738['UlgIzL'](_0x573808),_0x5738['zMFEqs'][_0x506e04]=_0x573808):_0x573808=_0x1be382,_0x573808;}const docsUrl='https://vomekj.com';export const pluginDev={'docsUrl':docsUrl,'serviceUrl':serviceUrlFromDocs(docsUrl),'uploadUrl':docsUrl+_0x245ea6(0x17f),'mirrors':{'prefer':_0x245ea6(0x187),'giteeOrg':_0x245ea6(0x176)+ORG,'githubOrg':_0x245ea6(0x192)+ORG},'scaffolds':{'full':{'key':_0x245ea6(0x18a),'title':_0x245ea6(0x184),'desc':_0x245ea6(0x17b),'repo':'vome-plugin-full','repoUrl':giteeRepo(_0x245ea6(0x18b)),'githubRepoUrl':githubRepo(_0x245ea6(0x18b)),'downloadUrl':giteeArchive('vome-plugin-full'),'githubDownloadUrl':githubArchive(_0x245ea6(0x18b))},'backend':{'key':_0x245ea6(0x179),'title':'纯后端','desc':_0x245ea6(0x175),'repo':_0x245ea6(0x185),'repoUrl':giteeRepo(_0x245ea6(0x185)),'githubRepoUrl':githubRepo('vome-plugin-service'),'downloadUrl':giteeArchive(_0x245ea6(0x185)),'githubDownloadUrl':githubArchive(_0x245ea6(0x185))},'frontend':{'key':_0x245ea6(0x17c),'title':_0x245ea6(0x18e),'desc':_0x245ea6(0x18d),'repo':'vome-plugin-front','repoUrl':giteeRepo(_0x245ea6(0x177)),'githubRepoUrl':githubRepo(_0x245ea6(0x177)),'downloadUrl':giteeArchive(_0x245ea6(0x177)),'githubDownloadUrl':githubArchive(_0x245ea6(0x177))}}};
@@ -1,41 +1,11 @@
1
1
  <template>
2
2
  <div
3
3
  class="vm-richtext"
4
- :class="{ 'is-readonly': readOnlyMode, 'is-disabled': disabled }"
4
+ :class="{
5
+ 'is-readonly': readOnlyMode,
6
+ 'is-disabled': disabled,
7
+ }"
5
8
  >
6
- <div v-if="!readOnlyMode" class="vm-richtext__toolbar" role="toolbar">
7
- <button
8
- v-for="btn in toolbar"
9
- :key="btn.cmd"
10
- type="button"
11
- class="vm-richtext__tool"
12
- :title="btn.title"
13
- :disabled="disabled"
14
- @mousedown.prevent
15
- @click="runCmd(btn.cmd, 'value' in btn ? btn.value : undefined)"
16
- >
17
- <i :class="btn.icon" aria-hidden="true" />
18
- </button>
19
- <button
20
- type="button"
21
- class="vm-richtext__tool"
22
- title="插入图片"
23
- :disabled="disabled || uploading || !uploadImage"
24
- @mousedown.prevent
25
- @click="pickImage"
26
- >
27
- <i class="ri-image-add-line" aria-hidden="true" />
28
- </button>
29
- <input
30
- ref="fileRef"
31
- type="file"
32
- accept="image/*"
33
- multiple
34
- class="vm-richtext__file"
35
- @change="onFileChange"
36
- />
37
- </div>
38
-
39
9
  <div
40
10
  v-if="readOnlyMode"
41
11
  class="vm-richtext__html"
@@ -44,32 +14,49 @@
44
14
 
45
15
  <div
46
16
  v-else
47
- ref="editorRef"
48
- class="vm-richtext__editor"
49
- :style="editorStyle"
50
- :contenteditable="!disabled"
51
- :data-placeholder="placeholder"
52
- @input="onInput"
53
- @blur="onInput"
54
- @paste="onPaste"
55
- />
17
+ class="vm-richtext__shell"
18
+ :style="shellStyle"
19
+ >
20
+ <Toolbar
21
+ class="vm-richtext__toolbar"
22
+ :editor="editorRef"
23
+ :default-config="toolbarConfig"
24
+ mode="default"
25
+ />
26
+ <Editor
27
+ class="vm-richtext__editor"
28
+ :default-config="editorConfig"
29
+ mode="default"
30
+ @on-created="onEditorCreated"
31
+ @on-change="onEditorChange"
32
+ />
33
+ </div>
56
34
  </div>
57
35
  </template>
58
36
 
59
37
  <script setup lang="ts">
60
- import { computed, nextTick, onMounted, ref, watch } from 'vue'
38
+ import '@wangeditor/editor/dist/css/style.css'
39
+ import { computed, onBeforeUnmount, shallowRef, watch } from 'vue'
61
40
  import DOMPurify from 'dompurify'
41
+ import { Editor, Toolbar } from '@wangeditor/editor-for-vue'
42
+ import type { IDomEditor, IEditorConfig, IToolbarConfig } from '@wangeditor/editor'
43
+ import { useUpload } from '../../hooks/useUpload'
62
44
 
63
45
  defineOptions({ name: 'vm-richtext' })
64
46
 
65
47
  const RICH_TAGS = [
66
48
  'p',
67
49
  'br',
50
+ 'div',
51
+ 'span',
68
52
  'strong',
69
53
  'b',
70
54
  'em',
71
55
  'i',
72
56
  'u',
57
+ 's',
58
+ 'del',
59
+ 'strike',
73
60
  'a',
74
61
  'ul',
75
62
  'ol',
@@ -78,30 +65,43 @@ const RICH_TAGS = [
78
65
  'h2',
79
66
  'h3',
80
67
  'h4',
68
+ 'h5',
69
+ 'h6',
81
70
  'blockquote',
82
71
  'code',
83
72
  'pre',
84
- 'span',
85
- 'div',
86
73
  'img',
74
+ 'table',
75
+ 'thead',
76
+ 'tbody',
77
+ 'tr',
78
+ 'th',
79
+ 'td',
80
+ 'hr',
81
+ 'sup',
82
+ 'sub',
87
83
  ]
88
84
 
89
85
  const props = withDefaults(
90
86
  defineProps<{
91
87
  modelValue?: string | null
92
- /** 只读展示(表格列) */
93
88
  readonly?: boolean
94
89
  disabled?: boolean
95
90
  placeholder?: string
96
- /** 编辑区高度 */
97
91
  height?: number | string
98
- /** 上传图片,返回可访问 url;未传则无插图按钮且忽略图片粘贴 */
92
+ /** 自定义上传;未传且 autoUpload=true 时走 useUpload 直传 OSS */
99
93
  uploadImage?: (file: File) => Promise<string>
94
+ /** autoUpload 默认前缀(须 app/public/**) */
95
+ uploadPrefixPath?: string
96
+ /** false 时禁用插图/粘贴上传(不自动 useUpload) */
97
+ autoUpload?: boolean
100
98
  }>(),
101
99
  {
102
100
  readonly: false,
103
101
  placeholder: '请输入内容…',
104
- height: 220,
102
+ height: 320,
103
+ uploadPrefixPath: 'app/public/richtext',
104
+ autoUpload: true,
105
105
  },
106
106
  )
107
107
 
@@ -109,161 +109,119 @@ const emit = defineEmits<{
109
109
  'update:modelValue': [v: string]
110
110
  }>()
111
111
 
112
- const editorRef = ref<HTMLElement | null>(null)
113
- const fileRef = ref<HTMLInputElement | null>(null)
114
- const innerHtml = ref('')
115
- const uploading = ref(false)
116
-
117
- const toolbar = [
118
- { cmd: 'bold', icon: 'ri-bold', title: '加粗' },
119
- { cmd: 'italic', icon: 'ri-italic', title: '斜体' },
120
- { cmd: 'underline', icon: 'ri-underline', title: '下划线' },
121
- { cmd: 'insertUnorderedList', icon: 'ri-list-unordered', title: '无序列表' },
122
- { cmd: 'insertOrderedList', icon: 'ri-list-ordered', title: '有序列表' },
123
- { cmd: 'formatBlock', icon: 'ri-heading', title: '小标题', value: 'h3' },
124
- { cmd: 'createLink', icon: 'ri-link', title: '链接' },
125
- { cmd: 'removeFormat', icon: 'ri-format-clear', title: '清除格式' },
126
- ] as const
112
+ const { toUpload } = useUpload()
113
+ const editorRef = shallowRef<IDomEditor>()
114
+ const syncing = shallowRef(false)
115
+
116
+ const readOnlyMode = computed(() => props.readonly)
117
+
118
+ const shellStyle = computed(() => {
119
+ const h =
120
+ typeof props.height === 'number' ? `${props.height}px` : String(props.height || '320px')
121
+ return {
122
+ '--vm-richtext-height': h,
123
+ } as Record<string, string>
124
+ })
127
125
 
128
126
  function sanitize(html: string) {
129
127
  return DOMPurify.sanitize(html, {
130
128
  ALLOWED_TAGS: RICH_TAGS,
131
- ALLOWED_ATTR: ['href', 'target', 'rel', 'class', 'src', 'alt', 'title', 'width', 'height'],
129
+ ALLOWED_ATTR: [
130
+ 'href',
131
+ 'target',
132
+ 'rel',
133
+ 'class',
134
+ 'src',
135
+ 'alt',
136
+ 'title',
137
+ 'width',
138
+ 'height',
139
+ 'colspan',
140
+ 'rowspan',
141
+ 'align',
142
+ ],
132
143
  })
133
144
  }
134
145
 
135
146
  const safeHtml = computed(() => sanitize(String(props.modelValue || '')))
136
- const readOnlyMode = computed(() => props.readonly)
137
-
138
- const editorStyle = computed(() => ({
139
- minHeight: typeof props.height === 'number' ? `${props.height}px` : props.height,
140
- }))
141
-
142
- function syncEditorFromModel() {
143
- if (props.readonly || !editorRef.value) return
144
- const next = safeHtml.value
145
- if (editorRef.value.innerHTML !== next) {
146
- editorRef.value.innerHTML = next || ''
147
- }
148
- innerHtml.value = next
149
- }
150
-
151
- function emitHtml(html: string) {
152
- const clean = sanitize(html)
153
- innerHtml.value = clean
154
- emit('update:modelValue', clean)
155
- }
156
147
 
157
- function onInput() {
158
- if (!editorRef.value) return
159
- emitHtml(editorRef.value.innerHTML)
160
- }
148
+ const toolbarConfig: Partial<IToolbarConfig> = {}
161
149
 
162
- function insertImageAtCursor(url: string, alt = 'image') {
163
- const ed = editorRef.value
164
- if (!ed) return
165
- ed.focus()
166
- const img = document.createElement('img')
167
- img.src = url
168
- img.alt = alt
169
- const sel = window.getSelection()
170
- if (sel?.rangeCount) {
171
- const range = sel.getRangeAt(0)
172
- if (ed.contains(range.commonAncestorContainer)) {
173
- range.deleteContents()
174
- range.insertNode(img)
175
- range.setStartAfter(img)
176
- range.collapse(true)
177
- sel.removeAllRanges()
178
- sel.addRange(range)
179
- } else {
180
- ed.appendChild(img)
181
- }
182
- } else {
183
- ed.appendChild(img)
184
- }
185
- onInput()
150
+ async function resolveUpload(file: File): Promise<string> {
151
+ if (props.uploadImage) return props.uploadImage(file)
152
+ if (props.autoUpload === false) throw new Error('未配置 uploadImage')
153
+ const res = await toUpload(file, { prefixPath: props.uploadPrefixPath })
154
+ return res.url
186
155
  }
187
156
 
188
- async function uploadFiles(files: File[]) {
189
- if (!props.uploadImage || !files.length || props.disabled || uploading.value) return
190
- uploading.value = true
191
- try {
192
- for (const file of files) {
193
- const url = await props.uploadImage(file)
194
- const alt =
195
- (file.name || 'image').replace(/\.[^.]+$/, '').trim() || 'image'
196
- insertImageAtCursor(url, alt)
197
- }
198
- } finally {
199
- uploading.value = false
157
+ const editorConfig = computed<Partial<IEditorConfig>>(() => {
158
+ const uploadEnabled = Boolean(props.uploadImage) || props.autoUpload !== false
159
+ return {
160
+ placeholder: props.placeholder,
161
+ readOnly: props.disabled,
162
+ autoFocus: false,
163
+ MENU_CONF: uploadEnabled
164
+ ? {
165
+ uploadImage: {
166
+ maxFileSize: 10 * 1024 * 1024,
167
+ allowedFileTypes: ['image/*'],
168
+ async customUpload(file: File, insertFn: (url: string, alt: string, href: string) => void) {
169
+ const url = await resolveUpload(file)
170
+ const alt =
171
+ (file.name || 'image').replace(/\.[^.]+$/, '').trim() || 'image'
172
+ insertFn(url, alt, url)
173
+ },
174
+ },
175
+ }
176
+ : {},
200
177
  }
201
- }
202
-
203
- function pickImage() {
204
- if (props.disabled || uploading.value || !props.uploadImage) return
205
- fileRef.value?.click()
206
- }
178
+ })
207
179
 
208
- async function onFileChange(e: Event) {
209
- const input = e.target as HTMLInputElement
210
- const files = Array.from(input.files || []).filter((f) =>
211
- f.type.startsWith('image/'),
212
- )
213
- input.value = ''
214
- await uploadFiles(files)
180
+ function emitHtml(html: string) {
181
+ emit('update:modelValue', sanitize(html))
215
182
  }
216
183
 
217
- async function onPaste(e: ClipboardEvent) {
218
- if (props.uploadImage && !props.disabled && !uploading.value) {
219
- const items = e.clipboardData?.items
220
- const files: File[] = []
221
- if (items?.length) {
222
- for (const item of Array.from(items)) {
223
- if (item.kind === 'file' && item.type.startsWith('image/')) {
224
- const file = item.getAsFile()
225
- if (file) files.push(file)
226
- }
227
- }
228
- }
229
- if (files.length) {
230
- e.preventDefault()
231
- await uploadFiles(files)
232
- return
233
- }
234
- }
235
- e.preventDefault()
236
- const text = e.clipboardData?.getData('text/plain') || ''
237
- document.execCommand('insertText', false, text)
184
+ function onEditorCreated(editor: IDomEditor) {
185
+ editorRef.value = editor
186
+ if (props.disabled) editor.disable()
187
+ syncing.value = true
188
+ const html = safeHtml.value
189
+ if (html) editor.setHtml(html)
190
+ else editor.clear()
191
+ syncing.value = false
238
192
  }
239
193
 
240
- function runCmd(cmd: string, value?: string) {
241
- if (props.disabled || props.readonly) return
242
- editorRef.value?.focus()
243
- if (cmd === 'createLink') {
244
- const url = window.prompt('链接地址', 'https://')
245
- if (!url) return
246
- document.execCommand('createLink', false, url)
247
- onInput()
248
- return
249
- }
250
- if (cmd === 'formatBlock' && value) {
251
- document.execCommand('formatBlock', false, value)
252
- } else {
253
- document.execCommand(cmd, false, value)
254
- }
255
- onInput()
194
+ function onEditorChange(editor: IDomEditor) {
195
+ if (syncing.value) return
196
+ emitHtml(editor.getHtml())
256
197
  }
257
198
 
258
199
  watch(
259
200
  () => props.modelValue,
260
- () => {
261
- syncEditorFromModel()
201
+ (next) => {
202
+ const editor = editorRef.value
203
+ if (!editor || readOnlyMode.value) return
204
+ const html = sanitize(String(next || ''))
205
+ if (editor.getHtml() === html) return
206
+ syncing.value = true
207
+ if (html) editor.setHtml(html)
208
+ else editor.clear()
209
+ syncing.value = false
210
+ },
211
+ )
212
+
213
+ watch(
214
+ () => props.disabled,
215
+ (v) => {
216
+ const editor = editorRef.value
217
+ if (!editor) return
218
+ if (v) editor.disable()
219
+ else editor.enable()
262
220
  },
263
221
  )
264
222
 
265
- onMounted(() => {
266
- void nextTick(() => syncEditorFromModel())
223
+ onBeforeUnmount(() => {
224
+ editorRef.value?.destroy()
267
225
  })
268
226
  </script>
269
227
 
@@ -271,10 +229,7 @@ onMounted(() => {
271
229
  .vm-richtext {
272
230
  width: 100%;
273
231
  min-width: 0;
274
- border: 1px solid var(--input);
275
- border-radius: var(--vm-control-radius);
276
- background: var(--card);
277
- overflow: hidden;
232
+ box-sizing: border-box;
278
233
  }
279
234
 
280
235
  .vm-richtext.is-disabled {
@@ -282,64 +237,25 @@ onMounted(() => {
282
237
  pointer-events: none;
283
238
  }
284
239
 
285
- .vm-richtext__toolbar {
240
+ .vm-richtext__shell {
286
241
  display: flex;
287
- flex-wrap: wrap;
288
- gap: 4px;
289
- padding: 8px 10px;
290
- border-bottom: 1px solid var(--border);
291
- background: var(--muted);
292
- }
293
-
294
- .vm-richtext__tool {
295
- display: inline-flex;
296
- width: 30px;
297
- height: 30px;
298
- align-items: center;
299
- justify-content: center;
300
- border: none;
301
- border-radius: 8px;
302
- background: transparent;
303
- color: var(--foreground);
304
- font-size: 16px;
305
- cursor: pointer;
306
-
307
- &:hover:not(:disabled) {
308
- background: color-mix(in srgb, var(--foreground) 8%, var(--card));
309
- color: var(--brand);
310
- }
242
+ flex-direction: column;
243
+ width: 100%;
244
+ min-width: 0;
245
+ border: 1px solid var(--input);
246
+ border-radius: var(--vm-control-radius);
247
+ background: var(--card);
248
+ overflow: hidden;
311
249
  }
312
250
 
313
- .vm-richtext__file {
314
- display: none;
251
+ .vm-richtext__toolbar {
252
+ border-bottom: 1px solid var(--border);
253
+ background: var(--muted);
315
254
  }
316
255
 
317
256
  .vm-richtext__editor {
318
- padding: 12px 14px;
319
- outline: none;
320
- color: var(--foreground);
321
- font-size: 14px;
322
- line-height: 1.65;
323
- overflow: auto;
324
- word-break: break-word;
325
-
326
- &:empty::before {
327
- content: attr(data-placeholder);
328
- color: var(--muted-foreground);
329
- pointer-events: none;
330
- }
331
-
332
- :deep(a) {
333
- color: var(--brand);
334
- text-decoration: underline;
335
- }
336
-
337
- :deep(img) {
338
- max-width: 100%;
339
- height: auto;
340
- margin: 8px 0;
341
- border-radius: 8px;
342
- }
257
+ height: var(--vm-richtext-height, 320px);
258
+ overflow-y: auto;
343
259
  }
344
260
 
345
261
  .vm-richtext__html {
@@ -371,6 +287,18 @@ onMounted(() => {
371
287
  border-radius: 8px;
372
288
  }
373
289
 
290
+ :deep(table) {
291
+ width: 100%;
292
+ border-collapse: collapse;
293
+ margin: 8px 0;
294
+ }
295
+
296
+ :deep(th),
297
+ :deep(td) {
298
+ border: 1px solid var(--border);
299
+ padding: 6px 8px;
300
+ }
301
+
374
302
  :deep(h1),
375
303
  :deep(h2),
376
304
  :deep(h3),
@@ -387,3 +315,19 @@ onMounted(() => {
387
315
  background: transparent;
388
316
  }
389
317
  </style>
318
+
319
+ <style lang="scss">
320
+ /* wangEditor 全局层:对齐后台 token(勿 scoped,编辑器 DOM 在组件外生成) */
321
+ .vm-richtext__shell .w-e-text-container {
322
+ background: var(--card);
323
+ color: var(--foreground);
324
+ }
325
+
326
+ .vm-richtext__shell .w-e-scroll {
327
+ background: var(--card);
328
+ }
329
+
330
+ .vm-richtext__shell .w-e-bar {
331
+ background: var(--muted);
332
+ }
333
+ </style>
@@ -1 +1 @@
1
- (function(_0x4e90ff,_0x185d54){const _0x589786=_0x1acb,_0x2745ca=_0x4e90ff();while(!![]){try{const _0x57d191=-parseInt(_0x589786(0x87))/0x1+-parseInt(_0x589786(0x8c))/0x2+parseInt(_0x589786(0x8b))/0x3+-parseInt(_0x589786(0x7d))/0x4*(-parseInt(_0x589786(0x80))/0x5)+parseInt(_0x589786(0x7f))/0x6*(parseInt(_0x589786(0x83))/0x7)+-parseInt(_0x589786(0x7e))/0x8*(-parseInt(_0x589786(0x89))/0x9)+-parseInt(_0x589786(0x8a))/0xa*(-parseInt(_0x589786(0x7c))/0xb);if(_0x57d191===_0x185d54)break;else _0x2745ca['push'](_0x2745ca['shift']());}catch(_0x34901f){_0x2745ca['push'](_0x2745ca['shift']());}}}(_0x12b4,0xa9d8b));import{getCrudConfig}from'./style';import{CRUD_LABELS,DEFAULT_CRUD_DICT}from'./dict';export{CRUD_LABELS,DEFAULT_CRUD_DICT};function _0x12b4(){const _0x46962b=['ndK3CMPOuwXT','yxbP','BgfIzwW','C2vHCMnO','mte5nJKZnvDuv01vqq','CgfNAw5HDgLVBG','ndi4odC0m2nNqurWyG','mtGWnZK5mfrItgzmqG','mtC2ntq0ounYwNbsvq','mty2ntm5ohjWEwrsAW','mJjtuLDYC0K','nhbXBgrkyq','ofPiEKneyW','nJG2mJHqsfzIqLC','mJqZmZa5nvfuD3DXDa','C29YDa','zgLJDa'];_0x12b4=function(){return _0x46962b;};return _0x12b4();}export const DEFAULT_CRUD_PERMISSION={'page':!![],'list':!![],'info':!![],'add':!![],'delete':!![],'update':!![]};export function mergeDict(_0x50fb04){const _0x48bdf9=_0x1acb,_0x4dfc1d=getCrudConfig()[_0x48bdf9(0x82)];if(!_0x50fb04)return{..._0x4dfc1d,'label':{..._0x4dfc1d[_0x48bdf9(0x85)]}};return{..._0x4dfc1d,..._0x50fb04,'api':{..._0x4dfc1d[_0x48bdf9(0x84)],..._0x50fb04[_0x48bdf9(0x84)]},'pagination':{..._0x4dfc1d[_0x48bdf9(0x88)],..._0x50fb04[_0x48bdf9(0x88)]},'search':{..._0x4dfc1d[_0x48bdf9(0x86)],..._0x50fb04[_0x48bdf9(0x86)]},'sort':{..._0x4dfc1d[_0x48bdf9(0x81)],..._0x50fb04[_0x48bdf9(0x81)]},'label':{..._0x4dfc1d['label'],..._0x50fb04['label']}};}function _0x1acb(_0x2b72b3,_0x2330e7){_0x2b72b3=_0x2b72b3-0x7c;const _0x12b41b=_0x12b4();let _0x1acb75=_0x12b41b[_0x2b72b3];if(_0x1acb['ZAYsbL']===undefined){var _0x3069ff=function(_0x4f6c03){const _0x5b31e5='abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789+/=';let _0x50fb04='',_0x4dfc1d='';for(let _0x25fcb0=0x0,_0x3eadc9,_0x3f1ffc,_0x6ac374=0x0;_0x3f1ffc=_0x4f6c03['charAt'](_0x6ac374++);~_0x3f1ffc&&(_0x3eadc9=_0x25fcb0%0x4?_0x3eadc9*0x40+_0x3f1ffc:_0x3f1ffc,_0x25fcb0++%0x4)?_0x50fb04+=String['fromCharCode'](0xff&_0x3eadc9>>(-0x2*_0x25fcb0&0x6)):0x0){_0x3f1ffc=_0x5b31e5['indexOf'](_0x3f1ffc);}for(let _0x132774=0x0,_0x43daaf=_0x50fb04['length'];_0x132774<_0x43daaf;_0x132774++){_0x4dfc1d+='%'+('00'+_0x50fb04['charCodeAt'](_0x132774)['toString'](0x10))['slice'](-0x2);}return decodeURIComponent(_0x4dfc1d);};_0x1acb['ATwHAh']=_0x3069ff,_0x1acb['ttxAeV']={},_0x1acb['ZAYsbL']=!![];}const _0x30761f=_0x12b41b[0x0],_0x5423c3=_0x2b72b3+_0x30761f,_0x4cba94=_0x1acb['ttxAeV'][_0x5423c3];return!_0x4cba94?(_0x1acb75=_0x1acb['ATwHAh'](_0x1acb75),_0x1acb['ttxAeV'][_0x5423c3]=_0x1acb75):_0x1acb75=_0x4cba94,_0x1acb75;}export function mergePermission(_0x25fcb0,_0x3eadc9){return{...DEFAULT_CRUD_PERMISSION,..._0x3eadc9,..._0x25fcb0};}
1
+ (function(_0x826569,_0xd5f065){const _0x5453f8=_0x456c,_0x4d599c=_0x826569();while(!![]){try{const _0x50d486=-parseInt(_0x5453f8(0x1be))/0x1*(parseInt(_0x5453f8(0x1bc))/0x2)+-parseInt(_0x5453f8(0x1b9))/0x3*(-parseInt(_0x5453f8(0x1bb))/0x4)+-parseInt(_0x5453f8(0x1c3))/0x5*(-parseInt(_0x5453f8(0x1c4))/0x6)+parseInt(_0x5453f8(0x1b5))/0x7*(-parseInt(_0x5453f8(0x1ba))/0x8)+parseInt(_0x5453f8(0x1b8))/0x9+parseInt(_0x5453f8(0x1c6))/0xa*(parseInt(_0x5453f8(0x1b7))/0xb)+parseInt(_0x5453f8(0x1c5))/0xc*(parseInt(_0x5453f8(0x1bf))/0xd);if(_0x50d486===_0xd5f065)break;else _0x4d599c['push'](_0x4d599c['shift']());}catch(_0x45080f){_0x4d599c['push'](_0x4d599c['shift']());}}}(_0x9673,0x4dd57));function _0x456c(_0x1d13bf,_0x23b9ef){_0x1d13bf=_0x1d13bf-0x1b5;const _0x967317=_0x9673();let _0x456ca2=_0x967317[_0x1d13bf];if(_0x456c['CgeZXM']===undefined){var _0x184268=function(_0x5db693){const _0x387aef='abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789+/=';let _0x125789='',_0x564a6b='';for(let _0xd7c0e9=0x0,_0x2b5ef5,_0x17315d,_0x80a5f1=0x0;_0x17315d=_0x5db693['charAt'](_0x80a5f1++);~_0x17315d&&(_0x2b5ef5=_0xd7c0e9%0x4?_0x2b5ef5*0x40+_0x17315d:_0x17315d,_0xd7c0e9++%0x4)?_0x125789+=String['fromCharCode'](0xff&_0x2b5ef5>>(-0x2*_0xd7c0e9&0x6)):0x0){_0x17315d=_0x387aef['indexOf'](_0x17315d);}for(let _0x372956=0x0,_0x358475=_0x125789['length'];_0x372956<_0x358475;_0x372956++){_0x564a6b+='%'+('00'+_0x125789['charCodeAt'](_0x372956)['toString'](0x10))['slice'](-0x2);}return decodeURIComponent(_0x564a6b);};_0x456c['ENOBkQ']=_0x184268,_0x456c['clwRDm']={},_0x456c['CgeZXM']=!![];}const _0x4d56cf=_0x967317[0x0],_0x439416=_0x1d13bf+_0x4d56cf,_0x39e880=_0x456c['clwRDm'][_0x439416];return!_0x39e880?(_0x456ca2=_0x456c['ENOBkQ'](_0x456ca2),_0x456c['clwRDm'][_0x439416]=_0x456ca2):_0x456ca2=_0x39e880,_0x456ca2;}import{getCrudConfig}from'./style';function _0x9673(){const _0x204aba=['nNLrrNbKsG','mtu2z2HZD01X','mZa4mJe1merWvfPPCG','mtC1mJfsDe5eBg0','yxbP','mtfPv0v5y1y','mtyWodu1mLzSsxLjuG','mteXCfLXA0LN','mtG0wKPlvhLy','mta4mdrbDwLjt2u','mZa1nMD3ELj3uW','CgfNAw5HDgLVBG','mZq3z2rhqxfK','mJqXnZyXr2z4Bxfx','C29YDa','BgfIzwW','C2vHCMnO','mZG5nZu1AvvPvKv5'];_0x9673=function(){return _0x204aba;};return _0x9673();}import{CRUD_LABELS,DEFAULT_CRUD_DICT}from'./dict';export{CRUD_LABELS,DEFAULT_CRUD_DICT};export const DEFAULT_CRUD_PERMISSION={'page':!![],'list':!![],'info':!![],'add':!![],'delete':!![],'update':!![]};export function mergeDict(_0x125789){const _0x2cd363=_0x456c,_0x564a6b=getCrudConfig()['dict'];if(!_0x125789)return{..._0x564a6b,'label':{..._0x564a6b['label']}};return{..._0x564a6b,..._0x125789,'api':{..._0x564a6b[_0x2cd363(0x1b6)],..._0x125789[_0x2cd363(0x1b6)]},'pagination':{..._0x564a6b[_0x2cd363(0x1bd)],..._0x125789[_0x2cd363(0x1bd)]},'search':{..._0x564a6b[_0x2cd363(0x1c2)],..._0x125789['search']},'sort':{..._0x564a6b[_0x2cd363(0x1c0)],..._0x125789[_0x2cd363(0x1c0)]},'label':{..._0x564a6b[_0x2cd363(0x1c1)],..._0x125789[_0x2cd363(0x1c1)]}};}export function mergePermission(_0xd7c0e9,_0x2b5ef5){return{...DEFAULT_CRUD_PERMISSION,..._0x2b5ef5,..._0xd7c0e9};}
@@ -1 +1 @@
1
- const _0x37a154=_0x51b3;function _0x3435(){const _0x5eb61b=['yM9KEq','mtC1otb3AvDYtuO','mtaWnJe1nNLWz0LRCW','AgvHza','Dgv4DenVBNrLBNq','mtqXntrRyvnlru0','CMvTB3zL','DMfSDwu','mJyZmfbnt25qEG','y29UzMLYBvrLEhq','DM0Ty29UzMLYBs1ZDhLSzq','DM0Ty29UzMLYBv9FyNrUigLZlwDOB3n0','Bw91BNq','ndeWode2BwjNuuve','z2v0rwXLBwvUDej5swq','cI52Bs1JB25MAxjTw2rHDgeTC2XVDd0NzgLHBg9NlwnVBNrLBNqNxsb7cIaGD2LKDgG6ig1PBIG0mdbWEcWGy2fSyYGXmdb2DYaTidmYChGPksaHAw1WB3j0yw50oWOGig1HEc13Awr0AdOGBwLUkdqWmhb4lcbJywXJkdeWmhz3ic0GmZjWEcKPicfPBxbVCNrHBNq7cIaGz2fWoIaWicfPBxbVCNrHBNq7cIaGCgfKzgLUzZOGmcaHAw1WB3j0yw50oWOGigjVCMrLCJOGBM9UzsaHAw1WB3j0yw50oWOGigjVCMrLCI1YywrPDxm6idi0ChGGiwLTCg9YDgfUDdSkicbIB3GTC2HHzg93oIb2yxiOls1ZAgfKB3CTC29MDcKGiwLTCg9YDgfUDdSkFqOUDM0Ty29UzMLYBv9FAgvHzcb7ihbHzgrPBMC6ide4ChGGmJjWEcaWoYbIB3jKzxiTyM90Dg9ToIbUB25LoYb9cI52Bs1JB25MAxjTx190AxrSzsb7igzVBNqTC2L6ztOGmtzWEdSGzM9UDc13zwLNAhq6idy1mdSGFqOUDM0Ty29UzMLYBv9FyM9KEsb7cIaGCgfKzgLUzZOGmtjWEcaYmNb4idHWEdSkicbJB2XVCJOGDMfYkc0TzM9YzwDYB3vUzcK7cIaGzM9UDc1ZAxPLoIaXnhb4oWOGigXPBMuTAgvPz2H0oIaXlJy7cN0klNzTlwnVBMzPCM1Fx2zVB3qGEWOGigrPC3bSyxK6igzSzxG7cIaGANvZDgLMEs1JB250zw50oIbMBgv4lwvUzdSkicbNyxa6idHWEdSkicbWywrKAw5NoIaXnhb4idiYChG7cN0klNzTlwnVBMzPCM1Fx2j0BIb7cIaGAgvPz2H0oIaZnNb4oWOGihbHzgrPBMC6idaGmtzWEdSkicbIB3jKzxi6ig5VBMu7cIaGyM9YzgvYlxjHzgL1CZOGmtjWEdSkicbMB250lxnPEMu6ideZChG7cIaGzM9UDc13zwLNAhq6idyWmdSkicbJDxjZB3i6ihbVAw50zxi7cN0klNzTlwnVBMzPCM1Fx2j0BI5PCY1WCMLTyxj5ihSGyMfJA2DYB3vUzdOGDMfYkc0TyNjHBMqPoYbJB2XVCJOGi2zMzJSGFqOUDM0Ty29UzMLYBv9FyNrUlMLZlxbYAw1HCNK6Ag92zxiGEYbIywnRz3jVDw5KoIb2yxiOls1ICMfUzc1KzwvWktSGFqOUDM0Ty29UzMLYBv9FyNrUlMLZlwDOB3n0ihSGyMfJA2DYB3vUzdOGDMfYkc0TBxv0zwqPoYbJB2XVCJOGDMfYkc0TzM9YzwDYB3vUzcK7ih0k','Dw5TB3vUDa','DM0Ty29UzMLYBq','DM0Ty29UzMLYBv9FyM9KEq','y3jLyxrLrwXLBwvUDa','nJi4D29ZvMfj','DM0Ty29UzMLYBv9FzM9VDa','otmWnKDgq1z5wq','yxbWzw5Kq2HPBgq','y2fUy2vSvgv4Da','zgL2','mJu4mdK0qvjAvNDn','mJmXr3zdDuvj','Dw5KzwzPBMvK','C3r5Bgu','DgL0Bgu','yNv0Dg9U','DM0Ty29UzMLYBv9FyNrUigLZlxbYAw1HCNK','nJe2otqXuMPczfvj'];_0x3435=function(){return _0x5eb61b;};return _0x3435();}function _0x51b3(_0x28faee,_0x5e7da8){_0x28faee=_0x28faee-0x1ba;const _0x343580=_0x3435();let _0x51b3a9=_0x343580[_0x28faee];if(_0x51b3['PrpbPN']===undefined){var _0x382e2f=function(_0x3177ea){const _0x171571='abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789+/=';let _0x2e648d='',_0x3ff637='';for(let _0x21258f=0x0,_0xe130ba,_0x19e736,_0x28b3c2=0x0;_0x19e736=_0x3177ea['charAt'](_0x28b3c2++);~_0x19e736&&(_0xe130ba=_0x21258f%0x4?_0xe130ba*0x40+_0x19e736:_0x19e736,_0x21258f++%0x4)?_0x2e648d+=String['fromCharCode'](0xff&_0xe130ba>>(-0x2*_0x21258f&0x6)):0x0){_0x19e736=_0x171571['indexOf'](_0x19e736);}for(let _0x2d8f44=0x0,_0x59eb06=_0x2e648d['length'];_0x2d8f44<_0x59eb06;_0x2d8f44++){_0x3ff637+='%'+('00'+_0x2e648d['charCodeAt'](_0x2d8f44)['toString'](0x10))['slice'](-0x2);}return decodeURIComponent(_0x3ff637);};_0x51b3['PpLapg']=_0x382e2f,_0x51b3['YGeAHC']={},_0x51b3['PrpbPN']=!![];}const _0x1741bb=_0x343580[0x0],_0x1cb92c=_0x28faee+_0x1741bb,_0x2273a7=_0x51b3['YGeAHC'][_0x1cb92c];return!_0x2273a7?(_0x51b3a9=_0x51b3['PpLapg'](_0x51b3a9),_0x51b3['YGeAHC'][_0x1cb92c]=_0x51b3a9):_0x51b3a9=_0x2273a7,_0x51b3a9;}(function(_0x44e144,_0x3f8984){const _0x2e7742=_0x51b3,_0x4949d5=_0x44e144();while(!![]){try{const _0x3e30a7=-parseInt(_0x2e7742(0x1c5))/0x1+parseInt(_0x2e7742(0x1cf))/0x2+-parseInt(_0x2e7742(0x1cc))/0x3+parseInt(_0x2e7742(0x1bf))/0x4*(parseInt(_0x2e7742(0x1ce))/0x5)+parseInt(_0x2e7742(0x1d2))/0x6*(-parseInt(_0x2e7742(0x1c6))/0x7)+parseInt(_0x2e7742(0x1da))/0x8+parseInt(_0x2e7742(0x1c1))/0x9*(-parseInt(_0x2e7742(0x1d5))/0xa);if(_0x3e30a7===_0x3f8984)break;else _0x4949d5['push'](_0x4949d5['shift']());}catch(_0x36f516){_0x4949d5['push'](_0x4949d5['shift']());}}}(_0x3435,0x4796a));import{createApp,h,ref}from'vue';import{Dialog,DialogContent,DialogFooter,DialogHeader,DialogTitle}from'#vome-host/components/ui/dialog';export function vmConfirm(_0x2e648d){const _0x3ff637=typeof _0x2e648d==='string'?{'message':_0x2e648d}:_0x2e648d;return new Promise(_0x21258f=>{const _0x9693d6=_0x51b3,_0xe130ba=ref(!![]),_0x19e736=document[_0x9693d6(0x1be)](_0x9693d6(0x1c4));document[_0x9693d6(0x1cd)][_0x9693d6(0x1c2)](_0x19e736);const _0x28b3c2=createApp({'setup'(){const _0x36f157=_0x9693d6;function _0x2d8f44(_0x59eb06){const _0x5642da=_0x51b3;_0xe130ba[_0x5642da(0x1d4)]=![],_0x21258f(_0x59eb06),setTimeout(()=>{const _0x5f06d6=_0x5642da;_0x28b3c2[_0x5f06d6(0x1bb)](),_0x19e736[_0x5f06d6(0x1d3)]();},0xc8);}return()=>h(Dialog,{'open':_0xe130ba[_0x36f157(0x1d4)],'onUpdate:open':_0x17a40d=>{if(!_0x17a40d)_0x2d8f44(![]);}},{'default':()=>h(DialogContent,{'class':_0x36f157(0x1bc),'showCloseButton':![]},{'default':()=>[h(DialogHeader,{'class':'vm-confirm__head'},()=>h(DialogTitle,{'class':'vm-confirm__title'},()=>_0x3ff637[_0x36f157(0x1c9)]||'提示')),h(_0x36f157(0x1c4),{'class':_0x36f157(0x1bd)},_0x3ff637['message']),h(DialogFooter,{'class':_0x36f157(0x1c0)},()=>[h('button',{'type':_0x36f157(0x1ca),'class':_0x36f157(0x1d8),'onClick':()=>_0x2d8f44(![])},_0x3ff637[_0x36f157(0x1c3)]||'取消'),h(_0x36f157(0x1ca),{'type':_0x36f157(0x1ca),'class':_0x36f157(0x1cb),'onClick':()=>_0x2d8f44(!![])},_0x3ff637[_0x36f157(0x1d6)]||'确定')])]})});}});_0x28b3c2[_0x9693d6(0x1d9)](_0x19e736);});}if(typeof document!==_0x37a154(0x1c7)&&!document[_0x37a154(0x1db)](_0x37a154(0x1d7))){const style=document[_0x37a154(0x1be)](_0x37a154(0x1c8));style['id']=_0x37a154(0x1d7),style[_0x37a154(0x1d1)]=_0x37a154(0x1ba),document[_0x37a154(0x1d0)][_0x37a154(0x1c2)](style);}
1
+ const _0x4a3814=_0x5d9b;(function(_0x322690,_0x372369){const _0x5b9b91=_0x5d9b,_0x43314c=_0x322690();while(!![]){try{const _0x5a2873=-parseInt(_0x5b9b91(0xc8))/0x1*(-parseInt(_0x5b9b91(0xc9))/0x2)+parseInt(_0x5b9b91(0xb7))/0x3+parseInt(_0x5b9b91(0xc5))/0x4*(parseInt(_0x5b9b91(0xa9))/0x5)+parseInt(_0x5b9b91(0xcb))/0x6*(-parseInt(_0x5b9b91(0xb5))/0x7)+-parseInt(_0x5b9b91(0xc6))/0x8*(-parseInt(_0x5b9b91(0xac))/0x9)+-parseInt(_0x5b9b91(0xbf))/0xa*(-parseInt(_0x5b9b91(0xc2))/0xb)+parseInt(_0x5b9b91(0xb8))/0xc*(-parseInt(_0x5b9b91(0xba))/0xd);if(_0x5a2873===_0x372369)break;else _0x43314c['push'](_0x43314c['shift']());}catch(_0x30c665){_0x43314c['push'](_0x43314c['shift']());}}}(_0x1c85,0xcc64f));import{createApp,h,ref}from'vue';function _0x5d9b(_0x2d1013,_0x49a5d4){_0x2d1013=_0x2d1013-0xa9;const _0x1c8550=_0x1c85();let _0x5d9b07=_0x1c8550[_0x2d1013];if(_0x5d9b['LzklvQ']===undefined){var _0x55040c=function(_0x41e21a){const _0x5b67c9='abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789+/=';let _0x569966='',_0x430a1d='';for(let _0x39c684=0x0,_0x314703,_0x5a9265,_0x3f1f2b=0x0;_0x5a9265=_0x41e21a['charAt'](_0x3f1f2b++);~_0x5a9265&&(_0x314703=_0x39c684%0x4?_0x314703*0x40+_0x5a9265:_0x5a9265,_0x39c684++%0x4)?_0x569966+=String['fromCharCode'](0xff&_0x314703>>(-0x2*_0x39c684&0x6)):0x0){_0x5a9265=_0x5b67c9['indexOf'](_0x5a9265);}for(let _0x36e910=0x0,_0x8f4874=_0x569966['length'];_0x36e910<_0x8f4874;_0x36e910++){_0x430a1d+='%'+('00'+_0x569966['charCodeAt'](_0x36e910)['toString'](0x10))['slice'](-0x2);}return decodeURIComponent(_0x430a1d);};_0x5d9b['HSFYgZ']=_0x55040c,_0x5d9b['mRVMMd']={},_0x5d9b['LzklvQ']=!![];}const _0x414c37=_0x1c8550[0x0],_0x356218=_0x2d1013+_0x414c37,_0x3523ae=_0x5d9b['mRVMMd'][_0x356218];return!_0x3523ae?(_0x5d9b07=_0x5d9b['HSFYgZ'](_0x5d9b07),_0x5d9b['mRVMMd'][_0x356218]=_0x5d9b07):_0x5d9b07=_0x3523ae,_0x5d9b07;}import{Dialog,DialogContent,DialogFooter,DialogHeader,DialogTitle}from'#vome-host/components/ui/dialog';export function vmConfirm(_0x569966){const _0x56c574=_0x5d9b,_0x430a1d=typeof _0x569966===_0x56c574(0xbd)?{'message':_0x569966}:_0x569966;return new Promise(_0x39c684=>{const _0x5e6d40=_0x56c574,_0x314703=ref(!![]),_0x5a9265=document['createElement']('div');document['body'][_0x5e6d40(0xb9)](_0x5a9265);const _0x3f1f2b=createApp({'setup'(){const _0xaffb7b=_0x5e6d40;function _0x36e910(_0x8f4874){_0x314703['value']=![],_0x39c684(_0x8f4874),setTimeout(()=>{const _0x15e6a2=_0x5d9b;_0x3f1f2b[_0x15e6a2(0xc4)](),_0x5a9265['remove']();},0xc8);}return()=>h(Dialog,{'open':_0x314703[_0xaffb7b(0xb4)],'onUpdate:open':_0x21095a=>{if(!_0x21095a)_0x36e910(![]);}},{'default':()=>h(DialogContent,{'class':_0xaffb7b(0xb3),'showCloseButton':![]},{'default':()=>[h(DialogHeader,{'class':_0xaffb7b(0xbc)},()=>h(DialogTitle,{'class':'vm-confirm__title'},()=>_0x430a1d[_0xaffb7b(0xca)]||'提示')),h(_0xaffb7b(0xb2),{'class':_0xaffb7b(0xad)},_0x430a1d[_0xaffb7b(0xab)]),h(DialogFooter,{'class':'vm-confirm__foot'},()=>[h(_0xaffb7b(0xc3),{'type':'button','class':_0xaffb7b(0xb1),'onClick':()=>_0x36e910(![])},_0x430a1d['cancelText']||'取消'),h('button',{'type':'button','class':_0xaffb7b(0xc0),'onClick':()=>_0x36e910(!![])},_0x430a1d[_0xaffb7b(0xbe)]||'确定')])]})});}});_0x3f1f2b[_0x5e6d40(0xaf)](_0x5a9265);});}function _0x1c85(){const _0x18ce70=['DM0Ty29UzMLYBv9FyNrUigLZlwDOB3n0','zgL2','DM0Ty29UzMLYBq','DMfSDwu','n3bLu21Yzq','AgvHza','mtaYntaYofjAENDiuq','mJi1nJyWBhnvy1zw','yxbWzw5Kq2HPBgq','mtq0m0nVtg9rzq','cI52Bs1JB25MAxjTw2rHDgeTC2XVDd0NzgLHBg9NlwnVBNrLBNqNxsb7cIaGD2LKDgG6ig1PBIG0mdbWEcWGy2fSyYGXmdb2DYaTidmYChGPksaHAw1WB3j0yw50oWOGig1HEc13Awr0AdOGBwLUkdqWmhb4lcbJywXJkdeWmhz3ic0GmZjWEcKPicfPBxbVCNrHBNq7cIaGz2fWoIaWicfPBxbVCNrHBNq7cIaGCgfKzgLUzZOGmcaHAw1WB3j0yw50oWOGigjVCMrLCJOGBM9UzsaHAw1WB3j0yw50oWOGigjVCMrLCI1YywrPDxm6idi0ChGGiwLTCg9YDgfUDdSkicbIB3GTC2HHzg93oIb2yxiOls1ZAgfKB3CTC29MDcKGiwLTCg9YDgfUDdSkFqOUDM0Ty29UzMLYBv9FAgvHzcb7ihbHzgrPBMC6ide4ChGGmJjWEcaWoYbIB3jKzxiTyM90Dg9ToIbUB25LoYb9cI52Bs1JB25MAxjTx190AxrSzsb7igzVBNqTC2L6ztOGmtzWEdSGzM9UDc13zwLNAhq6idy1mdSGFqOUDM0Ty29UzMLYBv9FyM9KEsb7cIaGCgfKzgLUzZOGmtjWEcaYmNb4idHWEdSkicbJB2XVCJOGDMfYkc0TzM9YzwDYB3vUzcK7cIaGzM9UDc1ZAxPLoIaXnhb4oWOGigXPBMuTAgvPz2H0oIaXlJy7cN0klNzTlwnVBMzPCM1Fx2zVB3qGEWOGigrPC3bSyxK6igzSzxG7cIaGANvZDgLMEs1JB250zw50oIbMBgv4lwvUzdSkicbNyxa6idHWEdSkicbWywrKAw5NoIaXnhb4idiYChG7cN0klNzTlwnVBMzPCM1Fx2j0BIb7cIaGAgvPz2H0oIaZnNb4oWOGihbHzgrPBMC6idaGmtzWEdSkicbIB3jKzxi6ig5VBMu7cIaGyM9YzgvYlxjHzgL1CZOGmtjWEdSkicbMB250lxnPEMu6ideZChG7cIaGzM9UDc13zwLNAhq6idyWmdSkicbJDxjZB3i6ihbVAw50zxi7cN0klNzTlwnVBMzPCM1Fx2j0BI5PCY1WCMLTyxj5ihSGyMfJA2DYB3vUzdOGDMfYkc0TyNjHBMqPoYbJB2XVCJOGi2zMzJSGFqOUDM0Ty29UzMLYBv9FyNrUlMLZlxbYAw1HCNK6Ag92zxiGEYbIywnRz3jVDw5KoIb2yxiOls1ICMfUzc1KzwvWktSGFqOUDM0Ty29UzMLYBv9FyNrUlMLZlwDOB3n0ihSGyMfJA2DYB3vUzdOGDMfYkc0TBxv0zwqPoYbJB2XVCJOGDMfYkc0TzM9YzwDYB3vUzcK7ih0k','DM0Ty29UzMLYBv9FAgvHza','C3rYAw5N','y29UzMLYBvrLEhq','nZy4odG2men2AfDtAW','DM0Ty29UzMLYBv9FyNrUigLZlxbYAw1HCNK','y3jLyxrLrwXLBwvUDa','mtfsB3zvrNC','yNv0Dg9U','Dw5TB3vUDa','mta4DgXSuhHs','nJK1nJKXmNjsywruAW','z2v0rwXLBwvUDej5swq','mJeYnZGZt2jwzg5x','ngnvrwfewG','DgL0Bgu','mteXotCWmNbVDgfZvq','mtmWnJm1seHgB09p','DM0Ty29UzMLYBs1ZDhLSzq','BwvZC2fNzq','ovbur1L4Bq','DM0Ty29UzMLYBv9FyM9KEq','C3r5Bgu','Bw91BNq','Dw5KzwzPBMvK'];_0x1c85=function(){return _0x18ce70;};return _0x1c85();}if(typeof document!==_0x4a3814(0xb0)&&!document[_0x4a3814(0xc7)](_0x4a3814(0xaa))){const style=document[_0x4a3814(0xc1)](_0x4a3814(0xae));style['id']=_0x4a3814(0xaa),style['textContent']=_0x4a3814(0xbb),document[_0x4a3814(0xb6)][_0x4a3814(0xb9)](style);}