vome-core 0.3.65 → 0.3.66
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/api/client.js +7 -2
- package/dist/admin/components/ui/avatar/Avatar.vue +18 -18
- package/dist/admin/components/ui/avatar/AvatarFallback.vue +21 -21
- package/dist/admin/components/ui/avatar/AvatarImage.vue +16 -16
- package/dist/admin/components/ui/avatar/index.js +1 -1
- package/dist/admin/components/ui/badge/Badge.vue +26 -26
- package/dist/admin/components/ui/button/Button.vue +31 -31
- package/dist/admin/components/ui/checkbox/Checkbox.vue +35 -35
- package/dist/admin/components/ui/checkbox/index.js +1 -1
- package/dist/admin/components/ui/dialog/Dialog.vue +19 -19
- package/dist/admin/components/ui/dialog/DialogClose.vue +15 -15
- package/dist/admin/components/ui/dialog/DialogContent.vue +267 -267
- package/dist/admin/components/ui/dialog/DialogDescription.vue +23 -23
- package/dist/admin/components/ui/dialog/DialogFooter.vue +27 -27
- package/dist/admin/components/ui/dialog/DialogHeader.vue +17 -17
- package/dist/admin/components/ui/dialog/DialogOverlay.vue +21 -21
- package/dist/admin/components/ui/dialog/DialogScrollContent.vue +60 -60
- package/dist/admin/components/ui/dialog/DialogTitle.vue +23 -23
- package/dist/admin/components/ui/dialog/DialogTrigger.vue +15 -15
- package/dist/admin/components/ui/dialog/index.js +1 -1
- package/dist/admin/components/ui/dropdown-menu/DropdownMenu.vue +19 -19
- package/dist/admin/components/ui/dropdown-menu/DropdownMenuCheckboxItem.vue +39 -39
- package/dist/admin/components/ui/dropdown-menu/DropdownMenuContent.vue +39 -39
- package/dist/admin/components/ui/dropdown-menu/DropdownMenuGroup.vue +15 -15
- package/dist/admin/components/ui/dropdown-menu/DropdownMenuItem.vue +31 -31
- package/dist/admin/components/ui/dropdown-menu/DropdownMenuLabel.vue +23 -23
- package/dist/admin/components/ui/dropdown-menu/DropdownMenuRadioGroup.vue +21 -21
- package/dist/admin/components/ui/dropdown-menu/DropdownMenuRadioItem.vue +40 -40
- package/dist/admin/components/ui/dropdown-menu/DropdownMenuSeparator.vue +23 -23
- package/dist/admin/components/ui/dropdown-menu/DropdownMenuShortcut.vue +17 -17
- package/dist/admin/components/ui/dropdown-menu/DropdownMenuSub.vue +18 -18
- package/dist/admin/components/ui/dropdown-menu/DropdownMenuSubContent.vue +27 -27
- package/dist/admin/components/ui/dropdown-menu/DropdownMenuSubTrigger.vue +31 -31
- package/dist/admin/components/ui/dropdown-menu/DropdownMenuTrigger.vue +17 -17
- package/dist/admin/components/ui/dropdown-menu/index.js +1 -1
- package/dist/admin/components/ui/input/Input.vue +183 -183
- package/dist/admin/components/ui/input/index.js +1 -1
- package/dist/admin/components/ui/label/Label.vue +26 -26
- package/dist/admin/components/ui/label/index.js +1 -1
- package/dist/admin/components/ui/scroll-area/ScrollArea.vue +33 -33
- package/dist/admin/components/ui/scroll-area/ScrollBar.vue +32 -32
- package/dist/admin/components/ui/scroll-area/index.js +1 -1
- package/dist/admin/components/ui/select/Select.vue +19 -19
- package/dist/admin/components/ui/select/SelectContent.vue +51 -51
- package/dist/admin/components/ui/select/SelectGroup.vue +15 -15
- package/dist/admin/components/ui/select/SelectItem.vue +53 -53
- package/dist/admin/components/ui/select/SelectItemText.vue +15 -15
- package/dist/admin/components/ui/select/SelectLabel.vue +17 -17
- package/dist/admin/components/ui/select/SelectScrollDownButton.vue +26 -26
- package/dist/admin/components/ui/select/SelectScrollUpButton.vue +26 -26
- package/dist/admin/components/ui/select/SelectSeparator.vue +19 -19
- package/dist/admin/components/ui/select/SelectTrigger.vue +44 -44
- package/dist/admin/components/ui/select/SelectValue.vue +15 -15
- package/dist/admin/components/ui/select/index.js +1 -1
- package/dist/admin/components/ui/separator/Separator.vue +29 -29
- package/dist/admin/components/ui/separator/index.js +1 -1
- package/dist/admin/components/ui/sheet/Sheet.vue +19 -19
- package/dist/admin/components/ui/sheet/SheetClose.vue +15 -15
- package/dist/admin/components/ui/sheet/SheetContent.vue +63 -63
- package/dist/admin/components/ui/sheet/SheetDescription.vue +21 -21
- package/dist/admin/components/ui/sheet/SheetFooter.vue +16 -16
- package/dist/admin/components/ui/sheet/SheetHeader.vue +15 -15
- package/dist/admin/components/ui/sheet/SheetOverlay.vue +21 -21
- package/dist/admin/components/ui/sheet/SheetTitle.vue +21 -21
- package/dist/admin/components/ui/sheet/SheetTrigger.vue +15 -15
- package/dist/admin/components/ui/sheet/index.js +1 -1
- package/dist/admin/components/ui/sonner/Toaster.vue +117 -117
- package/dist/admin/components/ui/sonner/index.js +1 -1
- package/dist/admin/components/ui/table/Table.vue +16 -16
- package/dist/admin/components/ui/table/TableBody.vue +17 -17
- package/dist/admin/components/ui/table/TableCaption.vue +17 -17
- package/dist/admin/components/ui/table/TableCell.vue +22 -22
- package/dist/admin/components/ui/table/TableEmpty.vue +34 -34
- package/dist/admin/components/ui/table/TableFooter.vue +17 -17
- package/dist/admin/components/ui/table/TableHead.vue +17 -17
- package/dist/admin/components/ui/table/TableHeader.vue +17 -17
- package/dist/admin/components/ui/table/TableRow.vue +17 -17
- package/dist/admin/components/ui/table/index.js +1 -1
- package/dist/admin/components/ui/tabs/Tabs.vue +24 -24
- package/dist/admin/components/ui/tabs/TabsContent.vue +21 -21
- package/dist/admin/components/ui/tabs/TabsList.vue +24 -24
- package/dist/admin/components/ui/tabs/TabsTrigger.vue +26 -26
- package/dist/admin/components/ui/tabs/index.js +1 -1
- package/dist/admin/components/ui/tooltip/Tooltip.vue +19 -19
- package/dist/admin/components/ui/tooltip/TooltipContent.vue +34 -34
- package/dist/admin/components/ui/tooltip/TooltipProvider.vue +14 -14
- package/dist/admin/components/ui/tooltip/TooltipTrigger.vue +15 -15
- package/dist/admin/components/ui/tooltip/index.js +1 -1
- package/dist/admin/components/vm-action-btn.vue +136 -136
- package/dist/admin/components/vm-aside-list-item.vue +136 -136
- package/dist/admin/components/vm-aside.vue +229 -229
- package/dist/admin/components/vm-auto-perm-dialog.vue +371 -371
- package/dist/admin/components/vm-card-grid.vue +37 -37
- package/dist/admin/components/vm-card-head.vue +45 -45
- package/dist/admin/components/vm-card-meta.vue +22 -22
- package/dist/admin/components/vm-card-title.vue +56 -56
- package/dist/admin/components/vm-card.vue +176 -176
- package/dist/admin/components/vm-check-tree.vue +340 -340
- package/dist/admin/components/vm-clamp-text.vue +39 -39
- package/dist/admin/components/vm-dept-tree.vue +497 -497
- package/dist/admin/components/vm-empty.vue +68 -68
- package/dist/admin/components/vm-eps-perm-picker.vue +123 -123
- package/dist/admin/components/vm-form-dialog.vue +632 -632
- package/dist/admin/components/vm-group-cascader.vue +560 -560
- package/dist/admin/components/vm-icon-btn.vue +88 -88
- package/dist/admin/components/vm-icon-picker.vue +647 -647
- package/dist/admin/components/vm-inline-search.vue +61 -61
- package/dist/admin/components/vm-loading.vue +114 -114
- package/dist/admin/components/vm-markdown.vue +405 -405
- package/dist/admin/components/vm-marquee.vue +265 -265
- package/dist/admin/components/vm-page-tabs.vue +94 -94
- package/dist/admin/components/vm-perm-section.vue +57 -57
- package/dist/admin/components/vm-ri-icon.vue +23 -23
- package/dist/admin/components/vm-role-picker.vue +314 -314
- package/dist/admin/components/vm-split-layout.vue +106 -106
- package/dist/admin/components/vm-thumb.vue +49 -49
- package/dist/admin/components/vm-view-path-picker.vue +59 -59
- package/dist/admin/crud/auto-fields.js +1 -1
- package/dist/admin/crud/components/vm-avatar.vue +104 -104
- package/dist/admin/crud/components/vm-color-picker.vue +1626 -1626
- package/dist/admin/crud/components/vm-column-custom.vue +193 -193
- package/dist/admin/crud/components/vm-context-menu.vue +105 -105
- package/dist/admin/crud/components/vm-copy-btn.vue +102 -102
- package/dist/admin/crud/components/vm-date-calendar-panel.vue +537 -537
- package/dist/admin/crud/components/vm-date-picker.vue +75 -75
- package/dist/admin/crud/components/vm-date-range.vue +88 -88
- package/dist/admin/crud/components/vm-date-text.vue +42 -42
- package/dist/admin/crud/components/vm-datetime-field.vue +215 -215
- package/dist/admin/crud/components/vm-datetime-picker.vue +9 -9
- package/dist/admin/crud/components/vm-dict-tag.vue +112 -112
- package/dist/admin/crud/components/vm-ellipsis-text.vue +34 -34
- package/dist/admin/crud/components/vm-form-hint.vue +81 -81
- package/dist/admin/crud/components/vm-json-code.vue +41 -41
- package/dist/admin/crud/components/vm-json-editor.vue +161 -161
- package/dist/admin/crud/components/vm-json-kv-editor.vue +318 -318
- package/dist/admin/crud/components/vm-kv-row.vue +51 -51
- package/dist/admin/crud/components/vm-multi-select.vue +279 -279
- package/dist/admin/crud/components/vm-number-range.vue +204 -204
- package/dist/admin/crud/components/vm-preview-viewer.vue +894 -894
- package/dist/admin/crud/components/vm-radio.vue +87 -87
- package/dist/admin/crud/components/vm-richtext.vue +313 -313
- package/dist/admin/crud/components/vm-select.vue +570 -570
- package/dist/admin/crud/components/vm-status-tag.vue +158 -158
- package/dist/admin/crud/components/vm-switch.vue +158 -158
- package/dist/admin/crud/components/vm-tag-list.vue +108 -108
- package/dist/admin/crud/components/vm-text-link.vue +52 -52
- package/dist/admin/crud/components/vm-toggle-switch.vue +84 -84
- package/dist/admin/crud/components/vm-tree-select.vue +450 -450
- package/dist/admin/crud/components/vm-upload-item.vue +298 -298
- package/dist/admin/crud/components/vm-upload.vue +436 -436
- 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/index.js +1 -0
- 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/useCrud.js +3 -0
- package/dist/admin/crud/validate.js +1 -1
- package/dist/admin/crud/vm-add-btn.vue +70 -70
- package/dist/admin/crud/vm-adv-search.vue +83 -83
- package/dist/admin/crud/vm-crud.vue +711 -711
- package/dist/admin/crud/vm-data-i18n-btn.vue +456 -456
- package/dist/admin/crud/vm-data-i18n-lang.vue +183 -183
- package/dist/admin/crud/vm-export-btn.vue +183 -183
- package/dist/admin/crud/vm-flex.vue +14 -14
- package/dist/admin/crud/vm-form.vue +33 -15
- package/dist/admin/crud/vm-import-btn.vue +747 -747
- package/dist/admin/crud/vm-multi-delete-btn.vue +49 -49
- package/dist/admin/crud/vm-pagination.vue +212 -212
- package/dist/admin/crud/vm-refresh-btn.vue +35 -35
- package/dist/admin/crud/vm-row.vue +55 -55
- package/dist/admin/crud/vm-search-key.vue +78 -78
- package/dist/admin/crud/vm-search.vue +466 -466
- package/dist/admin/crud/vm-table.vue +1390 -1390
- package/dist/admin/crud/vm-tabs.vue +94 -94
- package/dist/admin/crud/vm-toolbar.vue +357 -357
- package/dist/admin/crud/vm-upsert.vue +765 -765
- package/dist/admin/directives/perm.js +1 -1
- package/dist/admin/env.d.ts +1 -1
- package/dist/admin/hooks/useUpload.js +1 -1
- package/dist/admin/index.d.ts +1 -31
- 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/admin/router/index.d.ts +1 -5
- package/dist/admin/service/index.d.ts +1 -11
- package/dist/admin/styles/base.css +121 -121
- package/dist/admin/vendor/browser-image-compression.js +1144 -1144
- package/dist/admin/vendor/decimal-js.js +12 -12
- package/dist/admin/vendor/xlsx.js +263 -263
- package/dist/ai/index.js +1 -1
- package/dist/client/admin-vendor.d.ts +1 -13
- 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.d.ts +1 -7
- 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.d.ts +1 -40
- package/dist/client/vite-admin.js +1 -1
- package/dist/client/vite-auto-import.d.ts +1 -2
- package/dist/client/vite-auto-import.js +1 -1
- package/dist/client/vite-micro-proxy.d.ts +1 -20
- package/dist/client/vite-micro-proxy.js +1 -1
- package/dist/client/vite-plugin-eps.d.ts +1 -20
- package/dist/client/vite-plugin-eps.js +1 -1
- package/dist/client/vite-resolve.d.ts +1 -16
- 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 +1 -1
- package/typings/admin/base/auth.ts +24 -24
- package/typings/admin/base/permission.ts +19 -19
- package/typings/admin/comm/cascader.ts +7 -7
- package/typings/admin/comm/check-tree.ts +7 -7
- package/typings/admin/comm/crud.ts +427 -427
- package/typings/admin/comm/eps.ts +86 -86
- package/typings/admin/comm/request.ts +16 -16
- package/typings/admin/comm/service.ts +43 -43
- package/typings/admin/comm/upload.ts +39 -39
- package/typings/admin/theme.ts +10 -10
- package/typings/admin/vome/browser.ts +11 -11
- package/typings/admin/vome/module.ts +13 -13
- package/typings/admin/vome/tags.ts +9 -9
- package/typings/comm/crud.ts +83 -83
- package/typings/comm/page.ts +18 -18
- package/typings/comm/scan.ts +6 -6
- package/typings/common.ts +4 -4
- package/typings/context/data.ts +10 -10
- package/typings/ext/market-seat.ts +42 -42
- package/typings/ext/market.ts +55 -55
- package/typings/ext/module.ts +64 -64
- package/typings/ext/plugin.ts +38 -38
- package/typings/ioc/metadata.ts +34 -34
- package/typings/logger/config.ts +6 -6
- package/typings/routing/crud.ts +199 -199
- package/typings/routing/eps.ts +88 -88
- package/typings/routing/meta.ts +63 -63
- package/typings/routing/register.ts +21 -21
- package/typings/routing/scan-context.ts +7 -7
- package/dist/admin/api/client.d.ts +0 -50
- package/dist/admin/components/ui/avatar/index.d.ts +0 -3
- package/dist/admin/components/ui/badge/index.d.ts +0 -6
- package/dist/admin/components/ui/button/index.d.ts +0 -7
- package/dist/admin/components/ui/checkbox/index.d.ts +0 -1
- package/dist/admin/components/ui/dialog/index.d.ts +0 -10
- package/dist/admin/components/ui/dropdown-menu/index.d.ts +0 -15
- package/dist/admin/components/ui/input/index.d.ts +0 -1
- package/dist/admin/components/ui/label/index.d.ts +0 -1
- package/dist/admin/components/ui/scroll-area/index.d.ts +0 -2
- package/dist/admin/components/ui/select/index.d.ts +0 -11
- package/dist/admin/components/ui/separator/index.d.ts +0 -1
- package/dist/admin/components/ui/sheet/index.d.ts +0 -8
- package/dist/admin/components/ui/sonner/index.d.ts +0 -1
- package/dist/admin/components/ui/table/index.d.ts +0 -9
- package/dist/admin/components/ui/tabs/index.d.ts +0 -4
- package/dist/admin/components/ui/tooltip/index.d.ts +0 -4
- package/dist/admin/crud/auto-fields.d.ts +0 -68
- package/dist/admin/crud/config.d.ts +0 -5
- package/dist/admin/crud/confirm.d.ts +0 -19
- package/dist/admin/crud/crud-page-request.d.ts +0 -21
- package/dist/admin/crud/data-i18n.d.ts +0 -62
- package/dist/admin/crud/dict.d.ts +0 -4
- package/dist/admin/crud/export-fetch.d.ts +0 -22
- package/dist/admin/crud/index.d.ts +0 -60
- package/dist/admin/crud/json-kv.d.ts +0 -9
- package/dist/admin/crud/key.d.ts +0 -22
- package/dist/admin/crud/paging.d.ts +0 -2
- package/dist/admin/crud/plugins.d.ts +0 -63
- package/dist/admin/crud/registry.d.ts +0 -3
- package/dist/admin/crud/span.d.ts +0 -17
- package/dist/admin/crud/style.d.ts +0 -82
- package/dist/admin/crud/useCrud.d.ts +0 -21
- package/dist/admin/crud/validate.d.ts +0 -7
- package/dist/admin/directives/perm.d.ts +0 -3
- package/dist/admin/hooks/useBrowser.d.ts +0 -6
- package/dist/admin/hooks/useUpload.d.ts +0 -8
- package/dist/admin/hooks/useVome.d.ts +0 -10
- package/dist/admin/lib/browser.d.ts +0 -3
- package/dist/admin/lib/cn.d.ts +0 -2
- package/dist/admin/lib/compress-image.d.ts +0 -12
- package/dist/admin/lib/dialog-float.d.ts +0 -8
- package/dist/admin/lib/eps.d.ts +0 -2
- package/dist/admin/lib/export-excel.d.ts +0 -9
- package/dist/admin/lib/file-preview.d.ts +0 -9
- package/dist/admin/lib/import-excel.d.ts +0 -21
- package/dist/admin/lib/json.d.ts +0 -11
- package/dist/admin/lib/menu.d.ts +0 -3
- package/dist/admin/lib/micro-locale.d.ts +0 -5
- package/dist/admin/lib/micro-theme.d.ts +0 -14
- package/dist/admin/lib/module.d.ts +0 -21
- package/dist/admin/lib/scarce-assets.d.ts +0 -5
- package/dist/admin/lib/shell.d.ts +0 -8
- package/dist/admin/lib/theme-color-options.d.ts +0 -15
- package/dist/admin/lib/tree.d.ts +0 -2
- package/dist/admin/lib/upload.d.ts +0 -17
- package/dist/admin/lib/video-frame.d.ts +0 -6
- package/dist/admin/router/create.d.ts +0 -16
- package/dist/admin/router/guards.d.ts +0 -6
- package/dist/admin/router/menu-routes.d.ts +0 -13
- package/dist/admin/stores/app.d.ts +0 -13
- package/dist/admin/stores/tags.d.ts +0 -14
- package/dist/admin/stores/user.d.ts +0 -48
- package/dist/client/ai-model-registry.d.ts +0 -16
- package/dist/client/base.d.ts +0 -28
- package/dist/client/configure.d.ts +0 -33
- package/dist/client/dict.d.ts +0 -31
- package/dist/client/eps-payload.d.ts +0 -3
- package/dist/client/eps.d.ts +0 -17
- package/dist/client/locale-change.d.ts +0 -16
- package/dist/client/locale-store.d.ts +0 -105
- package/dist/client/service.d.ts +0 -29
|
@@ -1,313 +1,313 @@
|
|
|
1
|
-
<template>
|
|
2
|
-
<div
|
|
3
|
-
class="vm-richtext"
|
|
4
|
-
:class="{
|
|
5
|
-
'is-readonly': readOnlyMode,
|
|
6
|
-
'is-disabled': disabled,
|
|
7
|
-
}"
|
|
8
|
-
:style="shellStyle"
|
|
9
|
-
>
|
|
10
|
-
<div
|
|
11
|
-
v-if="readOnlyMode"
|
|
12
|
-
class="vm-richtext__html"
|
|
13
|
-
v-html="safeHtml"
|
|
14
|
-
/>
|
|
15
|
-
|
|
16
|
-
<div
|
|
17
|
-
v-else
|
|
18
|
-
class="vm-richtext__shell"
|
|
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
|
-
v-model="html"
|
|
29
|
-
:default-config="editorConfig"
|
|
30
|
-
mode="default"
|
|
31
|
-
@onCreated="handleCreated"
|
|
32
|
-
/>
|
|
33
|
-
</div>
|
|
34
|
-
</div>
|
|
35
|
-
</template>
|
|
36
|
-
|
|
37
|
-
<script setup lang="ts">
|
|
38
|
-
import '@wangeditor/editor/dist/css/style.css'
|
|
39
|
-
import { crudLabel } from '../style'
|
|
40
|
-
import { computed, onBeforeUnmount, shallowRef, watch } from 'vue'
|
|
41
|
-
import DOMPurify from 'dompurify'
|
|
42
|
-
import { Editor, Toolbar } from '@wangeditor/editor-for-vue'
|
|
43
|
-
import type { IDomEditor, IEditorConfig, IToolbarConfig } from '@wangeditor/editor'
|
|
44
|
-
import { useUpload } from '../../hooks/useUpload'
|
|
45
|
-
|
|
46
|
-
defineOptions({ name: 'vm-richtext' })
|
|
47
|
-
|
|
48
|
-
const RICH_TAGS = [
|
|
49
|
-
'p', 'br', 'div', 'span', 'strong', 'b', 'em', 'i', 'u', 's', 'del', 'strike', 'a',
|
|
50
|
-
'ul', 'ol', 'li', 'h1', 'h2', 'h3', 'h4', 'h5', 'h6', 'blockquote', 'code', 'pre',
|
|
51
|
-
'img', 'video', 'source', 'table', 'thead', 'tbody', 'tr', 'th', 'td', 'hr', 'sup', 'sub',
|
|
52
|
-
'mark',
|
|
53
|
-
]
|
|
54
|
-
|
|
55
|
-
const props = withDefaults(
|
|
56
|
-
defineProps<{
|
|
57
|
-
modelValue?: string | null
|
|
58
|
-
readonly?: boolean
|
|
59
|
-
disabled?: boolean
|
|
60
|
-
placeholder?: string
|
|
61
|
-
height?: number | string
|
|
62
|
-
uploadImage?: (file: File) => Promise<string>
|
|
63
|
-
uploadPrefixPath?: string
|
|
64
|
-
autoUpload?: boolean
|
|
65
|
-
}>(),
|
|
66
|
-
{
|
|
67
|
-
readonly: false,
|
|
68
|
-
placeholder: undefined,
|
|
69
|
-
height: 400,
|
|
70
|
-
uploadPrefixPath: 'app/public/richtext',
|
|
71
|
-
autoUpload: true,
|
|
72
|
-
},
|
|
73
|
-
)
|
|
74
|
-
|
|
75
|
-
const emit = defineEmits<{ 'update:modelValue': [v: string] }>()
|
|
76
|
-
|
|
77
|
-
const { toUpload } = useUpload()
|
|
78
|
-
const editorRef = shallowRef<IDomEditor>()
|
|
79
|
-
const syncing = shallowRef(false)
|
|
80
|
-
|
|
81
|
-
const readOnlyMode = computed(() => props.readonly)
|
|
82
|
-
const uploadEnabled = computed(() => Boolean(props.uploadImage) || props.autoUpload !== false)
|
|
83
|
-
|
|
84
|
-
/** 编辑区高度至少 400px,保证工具栏浮层(表情等)有空间;弹窗不够时由 upsert body 滚动 */
|
|
85
|
-
function resolveEditorHeight(): string {
|
|
86
|
-
const h = props.height
|
|
87
|
-
if (typeof h === 'number') return `${Math.max(h, 400)}px`
|
|
88
|
-
const s = String(h ?? '400').trim()
|
|
89
|
-
if (/^\d+(\.\d+)?$/.test(s)) return `${Math.max(Number(s), 400)}px`
|
|
90
|
-
if (/^\d+(\.\d+)?px$/i.test(s)) return `${Math.max(parseFloat(s), 400)}px`
|
|
91
|
-
return s || '400px'
|
|
92
|
-
}
|
|
93
|
-
|
|
94
|
-
const shellStyle = computed(() => {
|
|
95
|
-
return { '--vm-richtext-height': resolveEditorHeight() } as Record<string, string>
|
|
96
|
-
})
|
|
97
|
-
|
|
98
|
-
function sanitize(html: string) {
|
|
99
|
-
return DOMPurify.sanitize(html, {
|
|
100
|
-
ALLOWED_TAGS: RICH_TAGS,
|
|
101
|
-
ALLOWED_ATTR: [
|
|
102
|
-
'href', 'target', 'rel', 'class', 'src', 'alt', 'title', 'width', 'height',
|
|
103
|
-
'colspan', 'rowspan', 'align', 'controls', 'style', 'data-color',
|
|
104
|
-
],
|
|
105
|
-
})
|
|
106
|
-
}
|
|
107
|
-
|
|
108
|
-
function normalizeHtml(html: string) {
|
|
109
|
-
const safe = sanitize(html)
|
|
110
|
-
const text = safe.replace(/<[^>]+>/g, '').replace(/ /g, ' ').trim()
|
|
111
|
-
return text ? safe : ''
|
|
112
|
-
}
|
|
113
|
-
|
|
114
|
-
const safeHtml = computed(() => sanitize(String(props.modelValue || '')))
|
|
115
|
-
|
|
116
|
-
const html = shallowRef(normalizeHtml(String(props.modelValue || '')) || '<p><br></p>')
|
|
117
|
-
|
|
118
|
-
async function resolveUpload(file: File): Promise<string> {
|
|
119
|
-
if (props.uploadImage) return props.uploadImage(file)
|
|
120
|
-
if (props.autoUpload === false) throw new Error(crudLabel('noUploadImage'))
|
|
121
|
-
const res = await toUpload(file, { prefixPath: props.uploadPrefixPath })
|
|
122
|
-
return res.url
|
|
123
|
-
}
|
|
124
|
-
|
|
125
|
-
const toolbarConfig = computed<Partial<IToolbarConfig>>(() => ({
|
|
126
|
-
excludeKeys: uploadEnabled.value ? [] : ['uploadImage', 'uploadVideo'],
|
|
127
|
-
}))
|
|
128
|
-
|
|
129
|
-
const editorConfig = computed<Partial<IEditorConfig>>(() => ({
|
|
130
|
-
placeholder: props.placeholder ?? crudLabel('richtextPlaceholder'),
|
|
131
|
-
MENU_CONF: {
|
|
132
|
-
uploadImage: {
|
|
133
|
-
async customUpload(file: File, insertFn: (url: string, alt: string, href: string) => void) {
|
|
134
|
-
const url = await resolveUpload(file)
|
|
135
|
-
insertFn(url, file.name || 'image', url)
|
|
136
|
-
},
|
|
137
|
-
},
|
|
138
|
-
uploadVideo: {
|
|
139
|
-
async customUpload(file: File, insertFn: (url: string, poster: string) => void) {
|
|
140
|
-
const url = await resolveUpload(file)
|
|
141
|
-
insertFn(url, '')
|
|
142
|
-
},
|
|
143
|
-
},
|
|
144
|
-
},
|
|
145
|
-
}))
|
|
146
|
-
|
|
147
|
-
function handleCreated(editor: IDomEditor) {
|
|
148
|
-
editorRef.value = editor
|
|
149
|
-
if (props.disabled) editor.disable()
|
|
150
|
-
else editor.enable()
|
|
151
|
-
}
|
|
152
|
-
|
|
153
|
-
watch(html, (v) => {
|
|
154
|
-
if (syncing.value || readOnlyMode.value) return
|
|
155
|
-
emit('update:modelValue', normalizeHtml(String(v || '')))
|
|
156
|
-
})
|
|
157
|
-
|
|
158
|
-
watch(
|
|
159
|
-
() => props.modelValue,
|
|
160
|
-
(next) => {
|
|
161
|
-
if (readOnlyMode.value) return
|
|
162
|
-
const n = normalizeHtml(String(next || ''))
|
|
163
|
-
const cur = normalizeHtml(String(html.value || ''))
|
|
164
|
-
if (n === cur) return
|
|
165
|
-
syncing.value = true
|
|
166
|
-
html.value = n || '<p><br></p>'
|
|
167
|
-
syncing.value = false
|
|
168
|
-
},
|
|
169
|
-
)
|
|
170
|
-
|
|
171
|
-
watch(
|
|
172
|
-
() => props.disabled,
|
|
173
|
-
(v) => {
|
|
174
|
-
const ed = editorRef.value
|
|
175
|
-
if (!ed) return
|
|
176
|
-
if (v) ed.disable()
|
|
177
|
-
else ed.enable()
|
|
178
|
-
},
|
|
179
|
-
)
|
|
180
|
-
|
|
181
|
-
onBeforeUnmount(() => {
|
|
182
|
-
const ed = editorRef.value
|
|
183
|
-
if (!ed) return
|
|
184
|
-
ed.destroy()
|
|
185
|
-
editorRef.value = undefined
|
|
186
|
-
})
|
|
187
|
-
</script>
|
|
188
|
-
|
|
189
|
-
<style lang="scss" scoped>
|
|
190
|
-
.vm-richtext {
|
|
191
|
-
width: 100%;
|
|
192
|
-
min-width: 0;
|
|
193
|
-
}
|
|
194
|
-
|
|
195
|
-
.vm-richtext.is-disabled {
|
|
196
|
-
opacity: 0.65;
|
|
197
|
-
pointer-events: none;
|
|
198
|
-
}
|
|
199
|
-
|
|
200
|
-
.vm-richtext__shell {
|
|
201
|
-
display: flex;
|
|
202
|
-
flex-direction: column;
|
|
203
|
-
/* visible:表情/下拉挂在工具栏下,勿被 shell 裁切;弹窗不够高时靠 upsert body 滚动 */
|
|
204
|
-
overflow: visible;
|
|
205
|
-
border: 1px solid var(--border);
|
|
206
|
-
border-radius: var(--radius, 8px);
|
|
207
|
-
background: var(--card);
|
|
208
|
-
}
|
|
209
|
-
|
|
210
|
-
.vm-richtext__toolbar {
|
|
211
|
-
position: relative;
|
|
212
|
-
z-index: 2;
|
|
213
|
-
overflow: visible;
|
|
214
|
-
border-bottom: 1px solid var(--border) !important;
|
|
215
|
-
background: var(--muted) !important;
|
|
216
|
-
}
|
|
217
|
-
|
|
218
|
-
.vm-richtext__editor {
|
|
219
|
-
position: relative;
|
|
220
|
-
z-index: 1;
|
|
221
|
-
flex-shrink: 0;
|
|
222
|
-
height: var(--vm-richtext-height, 400px) !important;
|
|
223
|
-
min-height: 400px !important;
|
|
224
|
-
overflow-y: hidden;
|
|
225
|
-
background: var(--card);
|
|
226
|
-
}
|
|
227
|
-
|
|
228
|
-
.vm-richtext__html {
|
|
229
|
-
padding: 0;
|
|
230
|
-
color: var(--foreground);
|
|
231
|
-
font-size: 14px;
|
|
232
|
-
line-height: 1.65;
|
|
233
|
-
word-break: break-word;
|
|
234
|
-
|
|
235
|
-
:deep(p) { margin: 0.5em 0; }
|
|
236
|
-
:deep(strong), :deep(b) { font-weight: 800; }
|
|
237
|
-
:deep(ul) {
|
|
238
|
-
margin: 0.5em 0;
|
|
239
|
-
padding-left: 1.5em;
|
|
240
|
-
list-style-type: disc;
|
|
241
|
-
list-style-position: outside;
|
|
242
|
-
}
|
|
243
|
-
:deep(ul ul) { list-style-type: circle; }
|
|
244
|
-
:deep(ul ul ul) { list-style-type: square; }
|
|
245
|
-
:deep(ol) {
|
|
246
|
-
margin: 0.5em 0;
|
|
247
|
-
padding-left: 1.5em;
|
|
248
|
-
list-style-type: decimal;
|
|
249
|
-
list-style-position: outside;
|
|
250
|
-
}
|
|
251
|
-
:deep(ol ol) { list-style-type: lower-alpha; }
|
|
252
|
-
:deep(ol ol ol) { list-style-type: lower-roman; }
|
|
253
|
-
:deep(li) { display: list-item; }
|
|
254
|
-
:deep(a) { color: var(--brand); text-decoration: underline; }
|
|
255
|
-
:deep(img), :deep(video) { max-width: 100%; height: auto; margin: 8px 0; border-radius: 8px; }
|
|
256
|
-
:deep(table) { width: 100%; border-collapse: collapse; margin: 8px 0; }
|
|
257
|
-
:deep(th), :deep(td) { border: 1px solid var(--border); padding: 6px 8px; }
|
|
258
|
-
:deep(blockquote) {
|
|
259
|
-
margin: 0.5em 0;
|
|
260
|
-
padding-left: 12px;
|
|
261
|
-
border-left: 3px solid var(--border);
|
|
262
|
-
color: var(--muted-foreground);
|
|
263
|
-
}
|
|
264
|
-
:deep(h1), :deep(h2), :deep(h3), :deep(h4) {
|
|
265
|
-
margin: 0.65em 0 0.35em;
|
|
266
|
-
font-weight: 650;
|
|
267
|
-
line-height: 1.35;
|
|
268
|
-
}
|
|
269
|
-
}
|
|
270
|
-
|
|
271
|
-
.vm-richtext.is-readonly .vm-richtext__html {
|
|
272
|
-
padding: 0;
|
|
273
|
-
border: none;
|
|
274
|
-
background: transparent;
|
|
275
|
-
}
|
|
276
|
-
|
|
277
|
-
:deep(.w-e-toolbar) {
|
|
278
|
-
border: none !important;
|
|
279
|
-
background: transparent !important;
|
|
280
|
-
}
|
|
281
|
-
|
|
282
|
-
:deep(.w-e-text-container) {
|
|
283
|
-
border: none !important;
|
|
284
|
-
background: var(--card) !important;
|
|
285
|
-
}
|
|
286
|
-
|
|
287
|
-
:deep(.w-e-scroll) {
|
|
288
|
-
height: var(--vm-richtext-height, 400px) !important;
|
|
289
|
-
min-height: 400px !important;
|
|
290
|
-
}
|
|
291
|
-
|
|
292
|
-
:deep(.w-e-text-container [data-slate-editor]) {
|
|
293
|
-
min-height: calc(var(--vm-richtext-height, 400px) - 16px) !important;
|
|
294
|
-
color: var(--foreground);
|
|
295
|
-
font-size: 14px;
|
|
296
|
-
line-height: 1.65;
|
|
297
|
-
|
|
298
|
-
strong, b { font-weight: 800; }
|
|
299
|
-
}
|
|
300
|
-
</style>
|
|
301
|
-
|
|
302
|
-
<style lang="scss">
|
|
303
|
-
/* wangEditor 浮层挂到 body,需高于 Dialog */
|
|
304
|
-
.w-e-bar-item-menus-container,
|
|
305
|
-
.w-e-select-list,
|
|
306
|
-
.w-e-drop-panel,
|
|
307
|
-
.w-e-modal,
|
|
308
|
-
.w-e-panel-content-emotion,
|
|
309
|
-
.w-e-panel-content-color,
|
|
310
|
-
.w-e-panel-content-table {
|
|
311
|
-
z-index: 10050 !important;
|
|
312
|
-
}
|
|
313
|
-
</style>
|
|
1
|
+
<template>
|
|
2
|
+
<div
|
|
3
|
+
class="vm-richtext"
|
|
4
|
+
:class="{
|
|
5
|
+
'is-readonly': readOnlyMode,
|
|
6
|
+
'is-disabled': disabled,
|
|
7
|
+
}"
|
|
8
|
+
:style="shellStyle"
|
|
9
|
+
>
|
|
10
|
+
<div
|
|
11
|
+
v-if="readOnlyMode"
|
|
12
|
+
class="vm-richtext__html"
|
|
13
|
+
v-html="safeHtml"
|
|
14
|
+
/>
|
|
15
|
+
|
|
16
|
+
<div
|
|
17
|
+
v-else
|
|
18
|
+
class="vm-richtext__shell"
|
|
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
|
+
v-model="html"
|
|
29
|
+
:default-config="editorConfig"
|
|
30
|
+
mode="default"
|
|
31
|
+
@onCreated="handleCreated"
|
|
32
|
+
/>
|
|
33
|
+
</div>
|
|
34
|
+
</div>
|
|
35
|
+
</template>
|
|
36
|
+
|
|
37
|
+
<script setup lang="ts">
|
|
38
|
+
import '@wangeditor/editor/dist/css/style.css'
|
|
39
|
+
import { crudLabel } from '../style'
|
|
40
|
+
import { computed, onBeforeUnmount, shallowRef, watch } from 'vue'
|
|
41
|
+
import DOMPurify from 'dompurify'
|
|
42
|
+
import { Editor, Toolbar } from '@wangeditor/editor-for-vue'
|
|
43
|
+
import type { IDomEditor, IEditorConfig, IToolbarConfig } from '@wangeditor/editor'
|
|
44
|
+
import { useUpload } from '../../hooks/useUpload'
|
|
45
|
+
|
|
46
|
+
defineOptions({ name: 'vm-richtext' })
|
|
47
|
+
|
|
48
|
+
const RICH_TAGS = [
|
|
49
|
+
'p', 'br', 'div', 'span', 'strong', 'b', 'em', 'i', 'u', 's', 'del', 'strike', 'a',
|
|
50
|
+
'ul', 'ol', 'li', 'h1', 'h2', 'h3', 'h4', 'h5', 'h6', 'blockquote', 'code', 'pre',
|
|
51
|
+
'img', 'video', 'source', 'table', 'thead', 'tbody', 'tr', 'th', 'td', 'hr', 'sup', 'sub',
|
|
52
|
+
'mark',
|
|
53
|
+
]
|
|
54
|
+
|
|
55
|
+
const props = withDefaults(
|
|
56
|
+
defineProps<{
|
|
57
|
+
modelValue?: string | null
|
|
58
|
+
readonly?: boolean
|
|
59
|
+
disabled?: boolean
|
|
60
|
+
placeholder?: string
|
|
61
|
+
height?: number | string
|
|
62
|
+
uploadImage?: (file: File) => Promise<string>
|
|
63
|
+
uploadPrefixPath?: string
|
|
64
|
+
autoUpload?: boolean
|
|
65
|
+
}>(),
|
|
66
|
+
{
|
|
67
|
+
readonly: false,
|
|
68
|
+
placeholder: undefined,
|
|
69
|
+
height: 400,
|
|
70
|
+
uploadPrefixPath: 'app/public/richtext',
|
|
71
|
+
autoUpload: true,
|
|
72
|
+
},
|
|
73
|
+
)
|
|
74
|
+
|
|
75
|
+
const emit = defineEmits<{ 'update:modelValue': [v: string] }>()
|
|
76
|
+
|
|
77
|
+
const { toUpload } = useUpload()
|
|
78
|
+
const editorRef = shallowRef<IDomEditor>()
|
|
79
|
+
const syncing = shallowRef(false)
|
|
80
|
+
|
|
81
|
+
const readOnlyMode = computed(() => props.readonly)
|
|
82
|
+
const uploadEnabled = computed(() => Boolean(props.uploadImage) || props.autoUpload !== false)
|
|
83
|
+
|
|
84
|
+
/** 编辑区高度至少 400px,保证工具栏浮层(表情等)有空间;弹窗不够时由 upsert body 滚动 */
|
|
85
|
+
function resolveEditorHeight(): string {
|
|
86
|
+
const h = props.height
|
|
87
|
+
if (typeof h === 'number') return `${Math.max(h, 400)}px`
|
|
88
|
+
const s = String(h ?? '400').trim()
|
|
89
|
+
if (/^\d+(\.\d+)?$/.test(s)) return `${Math.max(Number(s), 400)}px`
|
|
90
|
+
if (/^\d+(\.\d+)?px$/i.test(s)) return `${Math.max(parseFloat(s), 400)}px`
|
|
91
|
+
return s || '400px'
|
|
92
|
+
}
|
|
93
|
+
|
|
94
|
+
const shellStyle = computed(() => {
|
|
95
|
+
return { '--vm-richtext-height': resolveEditorHeight() } as Record<string, string>
|
|
96
|
+
})
|
|
97
|
+
|
|
98
|
+
function sanitize(html: string) {
|
|
99
|
+
return DOMPurify.sanitize(html, {
|
|
100
|
+
ALLOWED_TAGS: RICH_TAGS,
|
|
101
|
+
ALLOWED_ATTR: [
|
|
102
|
+
'href', 'target', 'rel', 'class', 'src', 'alt', 'title', 'width', 'height',
|
|
103
|
+
'colspan', 'rowspan', 'align', 'controls', 'style', 'data-color',
|
|
104
|
+
],
|
|
105
|
+
})
|
|
106
|
+
}
|
|
107
|
+
|
|
108
|
+
function normalizeHtml(html: string) {
|
|
109
|
+
const safe = sanitize(html)
|
|
110
|
+
const text = safe.replace(/<[^>]+>/g, '').replace(/ /g, ' ').trim()
|
|
111
|
+
return text ? safe : ''
|
|
112
|
+
}
|
|
113
|
+
|
|
114
|
+
const safeHtml = computed(() => sanitize(String(props.modelValue || '')))
|
|
115
|
+
|
|
116
|
+
const html = shallowRef(normalizeHtml(String(props.modelValue || '')) || '<p><br></p>')
|
|
117
|
+
|
|
118
|
+
async function resolveUpload(file: File): Promise<string> {
|
|
119
|
+
if (props.uploadImage) return props.uploadImage(file)
|
|
120
|
+
if (props.autoUpload === false) throw new Error(crudLabel('noUploadImage'))
|
|
121
|
+
const res = await toUpload(file, { prefixPath: props.uploadPrefixPath })
|
|
122
|
+
return res.url
|
|
123
|
+
}
|
|
124
|
+
|
|
125
|
+
const toolbarConfig = computed<Partial<IToolbarConfig>>(() => ({
|
|
126
|
+
excludeKeys: uploadEnabled.value ? [] : ['uploadImage', 'uploadVideo'],
|
|
127
|
+
}))
|
|
128
|
+
|
|
129
|
+
const editorConfig = computed<Partial<IEditorConfig>>(() => ({
|
|
130
|
+
placeholder: props.placeholder ?? crudLabel('richtextPlaceholder'),
|
|
131
|
+
MENU_CONF: {
|
|
132
|
+
uploadImage: {
|
|
133
|
+
async customUpload(file: File, insertFn: (url: string, alt: string, href: string) => void) {
|
|
134
|
+
const url = await resolveUpload(file)
|
|
135
|
+
insertFn(url, file.name || 'image', url)
|
|
136
|
+
},
|
|
137
|
+
},
|
|
138
|
+
uploadVideo: {
|
|
139
|
+
async customUpload(file: File, insertFn: (url: string, poster: string) => void) {
|
|
140
|
+
const url = await resolveUpload(file)
|
|
141
|
+
insertFn(url, '')
|
|
142
|
+
},
|
|
143
|
+
},
|
|
144
|
+
},
|
|
145
|
+
}))
|
|
146
|
+
|
|
147
|
+
function handleCreated(editor: IDomEditor) {
|
|
148
|
+
editorRef.value = editor
|
|
149
|
+
if (props.disabled) editor.disable()
|
|
150
|
+
else editor.enable()
|
|
151
|
+
}
|
|
152
|
+
|
|
153
|
+
watch(html, (v) => {
|
|
154
|
+
if (syncing.value || readOnlyMode.value) return
|
|
155
|
+
emit('update:modelValue', normalizeHtml(String(v || '')))
|
|
156
|
+
})
|
|
157
|
+
|
|
158
|
+
watch(
|
|
159
|
+
() => props.modelValue,
|
|
160
|
+
(next) => {
|
|
161
|
+
if (readOnlyMode.value) return
|
|
162
|
+
const n = normalizeHtml(String(next || ''))
|
|
163
|
+
const cur = normalizeHtml(String(html.value || ''))
|
|
164
|
+
if (n === cur) return
|
|
165
|
+
syncing.value = true
|
|
166
|
+
html.value = n || '<p><br></p>'
|
|
167
|
+
syncing.value = false
|
|
168
|
+
},
|
|
169
|
+
)
|
|
170
|
+
|
|
171
|
+
watch(
|
|
172
|
+
() => props.disabled,
|
|
173
|
+
(v) => {
|
|
174
|
+
const ed = editorRef.value
|
|
175
|
+
if (!ed) return
|
|
176
|
+
if (v) ed.disable()
|
|
177
|
+
else ed.enable()
|
|
178
|
+
},
|
|
179
|
+
)
|
|
180
|
+
|
|
181
|
+
onBeforeUnmount(() => {
|
|
182
|
+
const ed = editorRef.value
|
|
183
|
+
if (!ed) return
|
|
184
|
+
ed.destroy()
|
|
185
|
+
editorRef.value = undefined
|
|
186
|
+
})
|
|
187
|
+
</script>
|
|
188
|
+
|
|
189
|
+
<style lang="scss" scoped>
|
|
190
|
+
.vm-richtext {
|
|
191
|
+
width: 100%;
|
|
192
|
+
min-width: 0;
|
|
193
|
+
}
|
|
194
|
+
|
|
195
|
+
.vm-richtext.is-disabled {
|
|
196
|
+
opacity: 0.65;
|
|
197
|
+
pointer-events: none;
|
|
198
|
+
}
|
|
199
|
+
|
|
200
|
+
.vm-richtext__shell {
|
|
201
|
+
display: flex;
|
|
202
|
+
flex-direction: column;
|
|
203
|
+
/* visible:表情/下拉挂在工具栏下,勿被 shell 裁切;弹窗不够高时靠 upsert body 滚动 */
|
|
204
|
+
overflow: visible;
|
|
205
|
+
border: 1px solid var(--border);
|
|
206
|
+
border-radius: var(--radius, 8px);
|
|
207
|
+
background: var(--card);
|
|
208
|
+
}
|
|
209
|
+
|
|
210
|
+
.vm-richtext__toolbar {
|
|
211
|
+
position: relative;
|
|
212
|
+
z-index: 2;
|
|
213
|
+
overflow: visible;
|
|
214
|
+
border-bottom: 1px solid var(--border) !important;
|
|
215
|
+
background: var(--muted) !important;
|
|
216
|
+
}
|
|
217
|
+
|
|
218
|
+
.vm-richtext__editor {
|
|
219
|
+
position: relative;
|
|
220
|
+
z-index: 1;
|
|
221
|
+
flex-shrink: 0;
|
|
222
|
+
height: var(--vm-richtext-height, 400px) !important;
|
|
223
|
+
min-height: 400px !important;
|
|
224
|
+
overflow-y: hidden;
|
|
225
|
+
background: var(--card);
|
|
226
|
+
}
|
|
227
|
+
|
|
228
|
+
.vm-richtext__html {
|
|
229
|
+
padding: 0;
|
|
230
|
+
color: var(--foreground);
|
|
231
|
+
font-size: 14px;
|
|
232
|
+
line-height: 1.65;
|
|
233
|
+
word-break: break-word;
|
|
234
|
+
|
|
235
|
+
:deep(p) { margin: 0.5em 0; }
|
|
236
|
+
:deep(strong), :deep(b) { font-weight: 800; }
|
|
237
|
+
:deep(ul) {
|
|
238
|
+
margin: 0.5em 0;
|
|
239
|
+
padding-left: 1.5em;
|
|
240
|
+
list-style-type: disc;
|
|
241
|
+
list-style-position: outside;
|
|
242
|
+
}
|
|
243
|
+
:deep(ul ul) { list-style-type: circle; }
|
|
244
|
+
:deep(ul ul ul) { list-style-type: square; }
|
|
245
|
+
:deep(ol) {
|
|
246
|
+
margin: 0.5em 0;
|
|
247
|
+
padding-left: 1.5em;
|
|
248
|
+
list-style-type: decimal;
|
|
249
|
+
list-style-position: outside;
|
|
250
|
+
}
|
|
251
|
+
:deep(ol ol) { list-style-type: lower-alpha; }
|
|
252
|
+
:deep(ol ol ol) { list-style-type: lower-roman; }
|
|
253
|
+
:deep(li) { display: list-item; }
|
|
254
|
+
:deep(a) { color: var(--brand); text-decoration: underline; }
|
|
255
|
+
:deep(img), :deep(video) { max-width: 100%; height: auto; margin: 8px 0; border-radius: 8px; }
|
|
256
|
+
:deep(table) { width: 100%; border-collapse: collapse; margin: 8px 0; }
|
|
257
|
+
:deep(th), :deep(td) { border: 1px solid var(--border); padding: 6px 8px; }
|
|
258
|
+
:deep(blockquote) {
|
|
259
|
+
margin: 0.5em 0;
|
|
260
|
+
padding-left: 12px;
|
|
261
|
+
border-left: 3px solid var(--border);
|
|
262
|
+
color: var(--muted-foreground);
|
|
263
|
+
}
|
|
264
|
+
:deep(h1), :deep(h2), :deep(h3), :deep(h4) {
|
|
265
|
+
margin: 0.65em 0 0.35em;
|
|
266
|
+
font-weight: 650;
|
|
267
|
+
line-height: 1.35;
|
|
268
|
+
}
|
|
269
|
+
}
|
|
270
|
+
|
|
271
|
+
.vm-richtext.is-readonly .vm-richtext__html {
|
|
272
|
+
padding: 0;
|
|
273
|
+
border: none;
|
|
274
|
+
background: transparent;
|
|
275
|
+
}
|
|
276
|
+
|
|
277
|
+
:deep(.w-e-toolbar) {
|
|
278
|
+
border: none !important;
|
|
279
|
+
background: transparent !important;
|
|
280
|
+
}
|
|
281
|
+
|
|
282
|
+
:deep(.w-e-text-container) {
|
|
283
|
+
border: none !important;
|
|
284
|
+
background: var(--card) !important;
|
|
285
|
+
}
|
|
286
|
+
|
|
287
|
+
:deep(.w-e-scroll) {
|
|
288
|
+
height: var(--vm-richtext-height, 400px) !important;
|
|
289
|
+
min-height: 400px !important;
|
|
290
|
+
}
|
|
291
|
+
|
|
292
|
+
:deep(.w-e-text-container [data-slate-editor]) {
|
|
293
|
+
min-height: calc(var(--vm-richtext-height, 400px) - 16px) !important;
|
|
294
|
+
color: var(--foreground);
|
|
295
|
+
font-size: 14px;
|
|
296
|
+
line-height: 1.65;
|
|
297
|
+
|
|
298
|
+
strong, b { font-weight: 800; }
|
|
299
|
+
}
|
|
300
|
+
</style>
|
|
301
|
+
|
|
302
|
+
<style lang="scss">
|
|
303
|
+
/* wangEditor 浮层挂到 body,需高于 Dialog */
|
|
304
|
+
.w-e-bar-item-menus-container,
|
|
305
|
+
.w-e-select-list,
|
|
306
|
+
.w-e-drop-panel,
|
|
307
|
+
.w-e-modal,
|
|
308
|
+
.w-e-panel-content-emotion,
|
|
309
|
+
.w-e-panel-content-color,
|
|
310
|
+
.w-e-panel-content-table {
|
|
311
|
+
z-index: 10050 !important;
|
|
312
|
+
}
|
|
313
|
+
</style>
|