adtec-core-package 3.2.5 → 3.2.7

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "adtec-core-package",
3
- "version": "3.2.5",
3
+ "version": "3.2.7",
4
4
  "private": false,
5
5
  "type": "module",
6
6
  "exports": {
@@ -17,7 +17,7 @@
17
17
  "./scripts/*": "./scripts/*"
18
18
  },
19
19
  "scripts": {
20
- "build:vite-integration": "esbuild vite/umoIntegration.ts --bundle --platform=node --format=esm --packages=external --outfile=vite/umoIntegration.js",
20
+ "build:vite-integration": "node scripts/build-vite-integration.mjs",
21
21
  "build:umo": "node scripts/inject-umo-composable-imports.mjs && node scripts/build-umo.mjs",
22
22
  "dev": "vite",
23
23
  "prepare:umo": "node scripts/prepare-umo-source.mjs",
@@ -0,0 +1,15 @@
1
+ import * as esbuild from 'esbuild'
2
+ import path from 'node:path'
3
+ import { fileURLToPath } from 'node:url'
4
+
5
+ const root = fileURLToPath(new URL('..', import.meta.url))
6
+
7
+ await esbuild.build({
8
+ entryPoints: [path.join(root, 'vite/umoIntegration.ts')],
9
+ bundle: true,
10
+ platform: 'node',
11
+ format: 'esm',
12
+ packages: 'external',
13
+ outfile: path.join(root, 'vite/umoIntegration.js'),
14
+ logLevel: 'info',
15
+ })
@@ -5,7 +5,6 @@
5
5
  // @import './sidebar.scss';
6
6
  // @import './btn.scss';
7
7
  @import './transition.scss';
8
- @import './scrollbar-classic.less';
9
8
 
10
9
  body {
11
10
  height: 100%;
@@ -127,63 +126,138 @@ div:focus {
127
126
  --margin-8: 8px;
128
127
  --margin-9: 9px;
129
128
  --margin-10: 10px;
130
-
131
- /* 现代圆角滚动条 */
132
- --adtec-scrollbar-size: 15px;
133
- --el-scrollbar-size: 8px;
134
- --adtec-scrollbar-radius: 999px;
135
- --adtec-scrollbar-thumb-color: rgba(0, 0, 0, 0.22);
136
- --adtec-scrollbar-thumb-hover-color: rgba(0, 0, 0, 0.35);
137
- --adtec-scrollbar-track-color: rgba(0, 0, 0, 0.04);
138
- /* vxe 表格滚动条:与 el-scrollbar 对齐 */
139
- --vxe-scrollbar-size: var(--el-scrollbar-size, 8px);
140
- --vxe-scrollbar-thumb-color: var(--el-scrollbar-bg-color, rgba(0, 0, 0, 0.42));
141
- --vxe-scrollbar-thumb-hover-color: var(--el-scrollbar-hover-bg-color, rgba(0, 0, 0, 0.55));
142
- --vxe-scrollbar-track-color: rgba(0, 0, 0, 0.04);
143
- /* el-scrollbar 单独配色(略粗 + 半透明灰,颜色偏深) */
144
- --el-scrollbar-opacity: 0.65;
145
- --el-scrollbar-bg-color: rgba(0, 0, 0, 0.42);
146
- --el-scrollbar-hover-opacity: 0.85;
147
- --el-scrollbar-hover-bg-color: rgba(0, 0, 0, 0.55);
129
+ /* 全系统滚动条统一为 vxe 观感 */
130
+ --adtec-scrollbar-size: 8px;
131
+ --adtec-scrollbar-thumb: #c0c4cc;
132
+ --adtec-scrollbar-thumb-hover: #909399;
133
+ /* vxe 表格滚动条粗细(仅 Chrome/Edge 的 ::-webkit-scrollbar 支持精确 px) */
134
+ --adtec-vxe-scrollbar-size: 8px;
148
135
  }
149
136
  .move-back {
150
137
  background: #f5f5f5 !important;
151
138
  }
152
139
 
153
- * {
154
- .adtec-scrollbar-hidden();
140
+ /**
141
+ * 全局原生滚动条(Chrome/Edge):对齐 vxe 观感。
142
+ * 关键:-webkit-appearance: none —— macOS/Chromium 默认 overlay 细条会忽略 width/height,
143
+ * 加了才切换为经典滚动条,尊重此处的 px 与配色。勿在 * 上写 scrollbar-width(会退回 overlay)。
144
+ */
145
+ *::-webkit-scrollbar {
146
+ -webkit-appearance: none;
147
+ appearance: none;
148
+ width: var(--adtec-scrollbar-size);
149
+ height: var(--adtec-scrollbar-size);
150
+ background: transparent;
155
151
  }
156
152
 
157
- *:hover {
158
- .adtec-scrollbar-active();
153
+ *::-webkit-scrollbar-thumb {
154
+ background: var(--adtec-scrollbar-thumb);
155
+ border-radius: 6px;
159
156
  }
160
157
 
161
- /* vxe-table 使用独立滚动条手柄,禁止全局 hover 样式作用于表格内部(含固定列) */
162
- .vxe-table,
163
- .vxe-table *,
164
- .vxe-table *:hover {
165
- .adtec-scrollbar-hidden();
158
+ *::-webkit-scrollbar-thumb:hover {
159
+ background: var(--adtec-scrollbar-thumb-hover);
166
160
  }
167
161
 
168
- .vxe-table:hover {
169
- .vxe-table--scroll-x-handle,
170
- .vxe-table--scroll-y-handle {
171
- .adtec-vxe-scrollbar-active();
172
- }
162
+ *::-webkit-scrollbar-track {
163
+ background: transparent;
173
164
  }
174
165
 
175
- /* 附件预览:常显滚动条,避免 hover 才出现导致“没有滚动条” */
176
- .pdf-js-viewer,
177
- .docx-js-viewer,
178
- .excel-grid-scroll,
179
- .office-preview-root.is-rich-preview {
180
- .adtec-scrollbar-persistent();
166
+ /* Firefox:无 webkit 伪元素时才用 scrollbar-width(无法精确到 px) */
167
+ @supports not selector(::-webkit-scrollbar) {
168
+ * {
169
+ scrollbar-width: thin;
170
+ scrollbar-color: var(--adtec-scrollbar-thumb) transparent;
171
+ }
181
172
  }
182
173
 
174
+ //::-webkit-scrollbar {
175
+ // width: 6px;
176
+ // height: 6px;
177
+ //}
178
+ //// 滚动条的轨道的两端按钮,允许通过点击微调小方块的位置。
179
+ //::-webkit-scrollbar-button {
180
+ // display: none;
181
+ //}
182
+ //// 滚动条的轨道(里面装有Thumb)
183
+ //::-webkit-scrollbar-track {
184
+ // background: transparent;
185
+ //}
186
+ //// 滚动条的轨道(里面装有Thumb)
187
+ //::-webkit-scrollbar-track-piece {
188
+ // background-color: transparent;
189
+ //}
190
+ //// 滚动条里面的小方块,能向上向下移动(或往左往右移动,取决于是垂直滚动条还是水平滚动条)
191
+ //::-webkit-scrollbar-thumb {
192
+ // background: #DDDEE0;
193
+ // opacity: var(--el-scrollbar-opacity, .3);
194
+ // transition: var(--el-transition-duration) background-color;
195
+ // cursor: pointer;
196
+ // border-radius: 4px;
197
+ //}
198
+ //::-webkit-scrollbar-thumb:hover {
199
+ // background: #C7C9CC;
200
+ //}
201
+ // 边角,即两个滚动条的交汇处
183
202
  ::-webkit-scrollbar-corner {
184
- background: transparent;
203
+ display: none;
185
204
  }
186
205
  // 两个滚动条的交汇处上用于通过拖动调整元素大小的小控件
187
206
  *::-webkit-resizer {
188
207
  display: none;
208
+ }
209
+
210
+ /* UMO 编辑器:工具栏横向滚动仍隐藏;正文/面板滚动条与系统对齐 */
211
+ .umo-rich-text-editor-root {
212
+ .umo-scrollable-content {
213
+ scrollbar-width: none !important;
214
+ -ms-overflow-style: none !important;
215
+
216
+ &::-webkit-scrollbar {
217
+ display: none !important;
218
+ width: 0 !important;
219
+ height: 0 !important;
220
+ }
221
+
222
+ &:hover::-webkit-scrollbar-thumb {
223
+ background: transparent !important;
224
+ }
225
+ }
226
+
227
+ .umo-scrollbar,
228
+ .umo-zoomable-container {
229
+ scrollbar-width: auto;
230
+ scrollbar-color: var(--adtec-scrollbar-thumb) transparent;
231
+
232
+ &::-webkit-scrollbar {
233
+ width: var(--adtec-scrollbar-size) !important;
234
+ height: var(--adtec-scrollbar-size) !important;
235
+ }
236
+
237
+ &::-webkit-scrollbar-thumb {
238
+ background-color: var(--adtec-scrollbar-thumb) !important;
239
+ border-radius: 6px !important;
240
+ border: 2px solid transparent !important;
241
+ background-clip: content-box !important;
242
+ }
243
+
244
+ &:hover::-webkit-scrollbar-thumb {
245
+ background-color: var(--adtec-scrollbar-thumb-hover) !important;
246
+ }
247
+ }
248
+ }
249
+
250
+ .umo-scrollable-content {
251
+ scrollbar-width: none !important;
252
+ -ms-overflow-style: none !important;
253
+
254
+ &::-webkit-scrollbar {
255
+ display: none !important;
256
+ width: 0 !important;
257
+ height: 0 !important;
258
+ }
259
+
260
+ &:hover::-webkit-scrollbar-thumb {
261
+ background: transparent !important;
262
+ }
189
263
  }
@@ -3,7 +3,7 @@
3
3
  <!--创建时间: 2025/5/8 09:15-->
4
4
  <!--修改时间: 2025/5/8 09:15-->
5
5
  <template>
6
- <el-scrollbars :noresize="true" class="el-card-list-scroll" style="width: 100%">
6
+ <el-scrollbars :noresize="true" style="width: 100%">
7
7
  <div v-if="!model || (model?.length ?? 0) == 0" class="el-table__empty-block">
8
8
  <span class="el-table__empty-text">暂无数据</span>
9
9
  </div>
@@ -61,10 +61,4 @@ defineExpose<{
61
61
  .seMeetingSel {
62
62
  border: 1px solid var(--el-color-primary) !important;
63
63
  }
64
-
65
- .el-card-list-scroll {
66
- flex: 1;
67
- min-height: 0;
68
- overflow: hidden;
69
- }
70
64
  </style>
@@ -4,8 +4,9 @@
4
4
  ref="rootRef"
5
5
  class="umo-rich-text-editor-root"
6
6
  :class="{ 'umo-rich-text-editor-root--readonly': !editable }">
7
- <UmoEditor
8
- v-if="umoMountOptions"
7
+ <component
8
+ :is="UmoEditorComp"
9
+ v-if="UmoEditorComp && umoMountOptions"
9
10
  :key="umoRuntimeKey"
10
11
  ref="editorRef"
11
12
  class="umo-rich-text-editor"
@@ -14,14 +15,25 @@
14
15
  @changed="onEditorChanged"
15
16
  @blur="onEditorBlur"
16
17
  />
18
+ <!-- 受控 loading 覆盖全程:运行时 import → UmoEditor 挂载 → TipTap created,杜绝 UMO 内置 loading 闪现/泄漏 -->
19
+ <div
20
+ v-if="showControlledLoading"
21
+ class="umo-rich-text-editor-loading"
22
+ v-loading="true"
23
+ element-loading-text="编辑器加载中..."
24
+ />
17
25
  </div>
18
26
  </template>
19
27
 
20
28
  <script setup lang="ts">
21
- import { UmoEditor } from '../../../prebuilt/umo-editor/umo-editor.js'
22
- import '../../../prebuilt/umo-editor/umo-editor.css'
29
+ /**
30
+ * UMO 编辑器运行时(umo-editor ~2.9MB + TDesign ~2.29MB + exceljs 等)改为受控懒加载:
31
+ * 不再静态引入,避免这 ~7MB 打进入口/页面同步 chunk。
32
+ * 严格串行:先 import() 运行时并完成全局注册(installUmoEditorApp),再渲染 UmoEditor,
33
+ * 中间只显示一个受控 loading,杜绝「UMO 内置 loading vs 自定义 loading」竞态卡死。
34
+ */
23
35
  import { ElMessage } from 'element-plus'
24
- import { computed, getCurrentInstance, nextTick, onBeforeUnmount, onMounted, onUnmounted, ref, shallowRef, watch, type App } from 'vue'
36
+ import { computed, getCurrentInstance, nextTick, onBeforeUnmount, onMounted, onUnmounted, ref, shallowRef, watch, type App, type Component } from 'vue'
25
37
  import { v4 as uuidv4 } from 'uuid'
26
38
  import {
27
39
  finalizeHtml,
@@ -30,7 +42,6 @@ import {
30
42
  purgeUmoDocumentLocalStorage,
31
43
  releaseUmoDocumentStorageShim,
32
44
  } from './richTextHtmlUtils'
33
- import { installUmoEditorApp } from './installUmoEditorApp'
34
45
 
35
46
  export type RichTextEditorConfig = {
36
47
  placeholder?: string
@@ -106,15 +117,22 @@ const text = defineModel<string>('text', {
106
117
  required: false,
107
118
  })
108
119
 
109
- const editorRef = ref<InstanceType<typeof UmoEditor> | null>(null)
120
+ const editorRef = ref<any>(null)
110
121
  const rootRef = ref<HTMLElement | null>(null)
111
122
  /** setup 同步捕获;async/Observer 内 getCurrentInstance() 为 null */
112
123
  const hostApp = getCurrentInstance()?.appContext?.app as App | undefined
124
+ /** 懒加载的 UmoEditor 组件;null 时显示受控 loading,加载并注册全局后再渲染 */
125
+ const UmoEditorComp = shallowRef<Component | null>(null)
126
+ let umoRuntimePromise: Promise<boolean> | null = null
113
127
  const editorKey = `umo-${uuidv4()}`
114
128
  /** 编辑/只读扩展集不同,切换时需 remount;key 变化强制重建 UmoEditor */
115
129
  const umoRuntimeKey = ref(editorKey)
116
130
  const lastMountEditable = ref<boolean | null>(null)
117
131
  const ready = ref(false)
132
+ /** 受控 loading:运行时未就绪或编辑器尚未 created/bootstrap 完成 */
133
+ const showControlledLoading = computed(
134
+ () => !UmoEditorComp.value || !umoMountOptions.value || !ready.value,
135
+ )
118
136
  const syncingContent = ref(false)
119
137
  /** 挂载快照,避免 computed props 变更触发 Umo 内部反复 patch 导致 emitsOptions null */
120
138
  const umoMountOptions = shallowRef<Record<string, unknown> | null>(null)
@@ -139,16 +157,25 @@ function isPanelVisible() {
139
157
  }
140
158
 
141
159
  function handlePanelShown() {
142
- if (!isPanelVisible() || !umoMountOptions.value) {
160
+ if (!isPanelVisible()) {
143
161
  rootWasHidden = true
144
162
  return
145
163
  }
146
- if (!rootWasHidden) return
164
+ const wasHidden = rootWasHidden
147
165
  rootWasHidden = false
148
- if (!ready.value) {
166
+ if (!UmoEditorComp.value) {
167
+ void startUmoBootstrap()
168
+ return
169
+ }
170
+ if (!umoMountOptions.value) {
171
+ initUmoMountOptions()
172
+ return
173
+ }
174
+ if (wasHidden && !ready.value) {
149
175
  void bootstrapEditor()
150
176
  return
151
177
  }
178
+ if (!wasHidden) return
152
179
  void applyEditableStateWithRetry()
153
180
  if (editable.value) {
154
181
  void ensureBlockImageNodeView()
@@ -223,15 +250,52 @@ async function remountEditor() {
223
250
  umoMountOptions.value = null
224
251
  umoRuntimeKey.value = `${editorKey}-${Date.now()}`
225
252
  await nextTick()
226
- ensureUmoGlobals()
253
+ const ok = await ensureUmoGlobals()
254
+ if (!ok) return
227
255
  initUmoMountOptions(html)
228
256
  } finally {
229
257
  remounting = false
230
258
  }
231
259
  }
232
260
 
233
- function ensureUmoGlobals() {
234
- return installUmoEditorApp(hostApp ?? getCurrentInstance()?.appContext?.app)
261
+ /**
262
+ * 受控懒加载:并行 import UMO 运行时 + CSS + 安装器,
263
+ * 完成全局注册(TDesign + umoGlobalComponents)后再暴露 UmoEditorComp。
264
+ * 幂等:多次调用共用同一 Promise;失败可重试。
265
+ */
266
+ function ensureUmoGlobals(): Promise<boolean> {
267
+ if (UmoEditorComp.value) return Promise.resolve(true)
268
+ if (!umoRuntimePromise) {
269
+ umoRuntimePromise = Promise.all([
270
+ import('../../../prebuilt/umo-editor/umo-editor.js'),
271
+ import('../../../prebuilt/umo-editor/umo-editor.css'),
272
+ import('./installUmoEditorApp'),
273
+ ])
274
+ .then(([umoMod, _css, installMod]) => {
275
+ installMod.installUmoEditorApp(hostApp)
276
+ UmoEditorComp.value = (umoMod as { UmoEditor: Component }).UmoEditor
277
+ return true
278
+ })
279
+ .catch(() => {
280
+ umoRuntimePromise = null
281
+ ElMessage.error('编辑器加载失败,请重试')
282
+ return false
283
+ })
284
+ }
285
+ return umoRuntimePromise
286
+ }
287
+
288
+ /** 面板可见时才启动懒加载,避免隐藏 Tab/Collapse 内编辑器触发 UMO loading */
289
+ async function startUmoBootstrap() {
290
+ if (!isPanelVisible()) {
291
+ rootWasHidden = true
292
+ return
293
+ }
294
+ const ok = await ensureUmoGlobals()
295
+ if (!ok) return
296
+ if (!umoMountOptions.value) {
297
+ initUmoMountOptions()
298
+ }
235
299
  }
236
300
 
237
301
  const editable = computed(() => {
@@ -504,15 +568,11 @@ function onEditorBlur() {
504
568
  }
505
569
 
506
570
  onMounted(() => {
507
- ensureUmoGlobals()
508
571
  rootWasHidden = !isPanelVisible()
509
572
  observePanelVisibility()
573
+ void startUmoBootstrap()
510
574
  })
511
575
 
512
- // editable 就绪后同步初始化,避免 onBeforeMount 时序问题
513
- ensureUmoGlobals()
514
- initUmoMountOptions()
515
-
516
576
  onBeforeUnmount(() => {
517
577
  clearVisibilityObserver()
518
578
  ready.value = false
@@ -609,8 +669,22 @@ onUnmounted(() => {
609
669
  min-width: 0;
610
670
  min-height: 280px;
611
671
  box-sizing: border-box;
672
+ position: relative;
673
+ overflow: hidden;
612
674
  }
613
675
 
676
+ .umo-rich-text-editor-loading {
677
+ position: absolute;
678
+ inset: 0;
679
+ z-index: 20;
680
+ flex: 1;
681
+ min-height: 200px;
682
+ width: 100%;
683
+ pointer-events: none;
684
+ }
685
+
686
+ /* 受控 loading 由 installUmoEmbedStyles 全局禁用 UMO 内置 loading,此处仅保留容器样式 */
687
+
614
688
  :deep(.umo-rich-text-editor) {
615
689
  width: 100%;
616
690
  height: 100%;
@@ -644,41 +718,10 @@ onUnmounted(() => {
644
718
  min-width: 0;
645
719
  }
646
720
 
647
- /* classic 模式:切换工具栏固定右上角(与 ribbon 图二一致) */
648
- :deep(.umo-toolbar-actions-classic) {
649
- position: absolute;
650
- right: 5px;
651
- top: 6px;
652
- z-index: 10;
653
- border-radius: 6px;
654
- background-color: var(--umo-color-white, #fff);
655
- box-shadow:
656
- 0 0 0 1px hsla(0, 0%, 5%, 0.04),
657
- 0 2px 5px hsla(0, 0%, 5%, 0.06);
658
- }
659
-
660
- :deep(.toolbar-classic .umo-scrollable-container) {
661
- padding-right: 108px;
662
- }
663
-
664
- :deep(.umo-scrollable-content) {
665
- overflow-x: hidden;
666
- overflow-y: hidden;
667
- scrollbar-width: none;
668
- -ms-overflow-style: none;
669
-
670
- &::-webkit-scrollbar {
671
- display: none;
672
- width: 0;
673
- height: 0;
674
- }
675
- }
676
-
677
721
  :deep(.umo-classic-menu),
678
722
  :deep(.umo-virtual-group) {
679
- flex-wrap: wrap;
680
- row-gap: 4px;
681
- white-space: normal;
723
+ flex-wrap: nowrap;
724
+ white-space: nowrap;
682
725
  }
683
726
 
684
727
  :deep(.umo-button__text),
@@ -718,14 +761,6 @@ onUnmounted(() => {
718
761
  }
719
762
 
720
763
  .umo-rich-text-editor-root--readonly {
721
- :deep(.umo-loading),
722
- :deep(.umo-loading--visible),
723
- :deep(.umo-loading__overlay),
724
- :deep(.umo-loading--center),
725
- :deep(.umo-icon-loading) {
726
- display: none !important;
727
- }
728
-
729
764
  :deep(.umo-editor-content .ProseMirror) {
730
765
  cursor: default;
731
766
  }
@@ -1,10 +1,25 @@
1
- import type { App, Component } from 'vue'
1
+ import { defineComponent, type App, type Component } from 'vue'
2
2
  import TDesign from 'tdesign-vue-next'
3
3
  import { umoGlobalComponents } from '../../../prebuilt/umo-editor/umo-editor.js'
4
4
 
5
5
  const registeredApps = new WeakSet<App>()
6
6
  const tdesignApps = new WeakSet<App>()
7
7
 
8
+ /** TDesign Loading 空实现:嵌入场景不使用 UMO 内置 loading(由 RichTextEditor 受控 loading 接管) */
9
+ const UmoLoadingNoop = defineComponent({
10
+ name: 'TLoading',
11
+ inheritAttrs: false,
12
+ props: { loading: { type: Boolean, default: false } },
13
+ setup() {
14
+ return () => null
15
+ },
16
+ })
17
+
18
+ const umoLoadingServiceNoop = Object.assign(
19
+ () => ({ hide: () => {} }),
20
+ { install: () => {} },
21
+ )
22
+
8
23
  /** 嵌入 Umo 的全局样式覆盖(须注入 document.head,全屏 Teleport 到 body 时组件 scoped :deep 无法命中) */
9
24
  function injectUmoEmbedStyles() {
10
25
  if (typeof document === 'undefined') return
@@ -19,6 +34,22 @@ function injectUmoEmbedStyles() {
19
34
  .umo-status-bar-button.umo-lang-button {
20
35
  display: none !important;
21
36
  }
37
+ /* 嵌入场景:彻底禁用 UMO/TDesign 内置 loading(组件 + 遮罩 + 全屏服务残留节点) */
38
+ .umo-loading,
39
+ .umo-loading--visible,
40
+ .umo-loading--full,
41
+ .umo-loading--center,
42
+ .umo-loading--lock,
43
+ .umo-loading__overlay,
44
+ .umo-loading__fullscreen,
45
+ .umo-loading__gradient,
46
+ .umo-loading__text,
47
+ .umo-icon-loading,
48
+ body > .umo-loading__fullscreen {
49
+ display: none !important;
50
+ visibility: hidden !important;
51
+ pointer-events: none !important;
52
+ }
22
53
  `
23
54
  document.head.appendChild(style)
24
55
  }
@@ -44,6 +75,9 @@ export function installUmoEditorApp(app?: App | null) {
44
75
  } catch {
45
76
  // 宿主或兄弟插件已安装 TDesign
46
77
  }
78
+ // 运行时“删除”UMO 内置 loading:空组件 + 空 $loading 服务(不碰 v-loading 指令,避免影响 Element Plus)
79
+ app.component('TLoading', UmoLoadingNoop)
80
+ app.config.globalProperties.$loading = umoLoadingServiceNoop
47
81
  tdesignApps.add(app)
48
82
  }
49
83
 
@@ -3,11 +3,7 @@
3
3
  <!--创建时间: 2025/3/20 16:16-->
4
4
  <!--修改时间: 2025/3/20 16:16-->
5
5
  <template>
6
- <el-scrollbar
7
- class="adtec-el-scrollbar"
8
- :noresize="true"
9
- v-resize-observer="onResizeObserver"
10
- ref="ref_scrollbar">
6
+ <el-scrollbar :noresize="true" v-resize-observer="onResizeObserver" ref="ref_scrollbar">
11
7
  <slot></slot>
12
8
  </el-scrollbar>
13
9
  </template>
@@ -21,9 +17,5 @@ const onResizeObserver=(entries:any) =>{
21
17
  }
22
18
  </script>
23
19
  <style scoped lang="scss">
24
- .adtec-el-scrollbar {
25
- height: 100%;
26
- flex: 1;
27
- min-height: 0;
28
- }
20
+
29
21
  </style>
@@ -3,7 +3,8 @@
3
3
 
4
4
  @-moz-document url-prefix() {
5
5
  scrollbar-color: var(--umo-scrollbar-thumb-color) transparent;
6
- scrollbar-width: thin;
6
+ /* 勿用 thin:Chromium 会压过 ::-webkit-scrollbar 的自定义宽度 */
7
+ scrollbar-width: auto;
7
8
  }
8
9
 
9
10
  &::-webkit-scrollbar {
@@ -59,10 +59,10 @@
59
59
  --umo-content-code-family:
60
60
  Consolas, Monaco, Andale Mono, Ubuntu Mono, monospace;
61
61
 
62
- // 滚动条
63
- --umo-scrollbar-size: 12px;
64
- --umo-scrollbar-thumb-color: rgba(0, 0, 0, 0.1);
65
- --umo-scrollbar-thumb-hover-color: rgba(0, 0, 0, 0.3);
62
+ // 滚动条(与系统 --adtec-scrollbar-* / vxe 对齐)
63
+ --umo-scrollbar-size: var(--adtec-scrollbar-size, 10px);
64
+ --umo-scrollbar-thumb-color: var(--adtec-scrollbar-thumb, rgba(144, 147, 153, 0.55));
65
+ --umo-scrollbar-thumb-hover-color: var(--adtec-scrollbar-thumb-hover, rgba(144, 147, 153, 0.8));
66
66
  }
67
67
 
68
68
  [theme-mode='dark'] {
@@ -92,6 +92,7 @@
92
92
  --umo-content-text-color: #000;
93
93
 
94
94
  // 滚动条
95
- --umo-scrollbar-thumb-color: rgba(255, 255, 255, 0.3);
96
- --umo-scrollbar-thumb-hover-color: rgba(255, 255, 255, 0.45);
95
+ --umo-scrollbar-size: 10px;
96
+ --umo-scrollbar-thumb-color: rgba(255, 255, 255, 0.55);
97
+ --umo-scrollbar-thumb-hover-color: rgba(255, 255, 255, 0.8);
97
98
  }
@@ -250,12 +250,10 @@ const setContentFromCache = () => {
250
250
  padding: 6px 10px;
251
251
  display: flex;
252
252
  align-items: center;
253
- &-ribbon,
254
- &-classic {
253
+ &-ribbon {
255
254
  position: absolute;
256
255
  right: 0;
257
256
  top: 1px;
258
- z-index: 10;
259
257
  }
260
258
  &-button {
261
259
  &.active {
@@ -339,18 +337,9 @@ const setContentFromCache = () => {
339
337
 
340
338
  <style lang="less">
341
339
  .umo-skin-modern {
342
- &.toolbar-classic,
343
- &.toolbar-ribbon {
344
- .umo-toolbar-actions {
345
- right: 5px !important;
346
- top: 6px !important;
347
- }
348
- }
349
340
  &.toolbar-classic {
350
- .umo-scrollable-container {
351
- padding-right: 108px;
352
- }
353
341
  .umo-toolbar-actions {
342
+ margin: 15px 15px 2px 0;
354
343
  border-radius: 6px;
355
344
  background-color: var(--umo-color-white);
356
345
  box-shadow:
@@ -363,6 +352,12 @@ const setContentFromCache = () => {
363
352
  }
364
353
  }
365
354
  }
355
+ &.toolbar-ribbon {
356
+ .umo-toolbar-actions {
357
+ right: 5px !important;
358
+ top: 6px !important;
359
+ }
360
+ }
366
361
  }
367
362
  [theme-mode='dark'] .umo-skin-modern {
368
363
  &.toolbar-classic {
@@ -17,9 +17,19 @@ import elementPlus, {
17
17
  ElDrawer,
18
18
  ElSelect,
19
19
  ElTreeSelect,
20
+ ElDatePicker,
21
+ ElCascader,
20
22
  ElTable,
21
23
  ElTooltip,
22
24
  } from 'element-plus'
25
+
26
+ /**
27
+ * vxe 单元格编辑时,Element 下拉/日期面板默认 teleport 到 body。
28
+ * 点击选项会被 vxe 判定为“单元格外点击”并 clearEdit,导致间歇性选不中。
29
+ * 官方约定:弹出层加 class `vxe-table--ignore-clear` 即可跳过该清理。
30
+ * 非 vxe 场景加此 class 无副作用。
31
+ */
32
+ const VXE_IGNORE_CLEAR_POPPER = 'vxe-table--ignore-clear'
23
33
  ElPagination.props.background = {
24
34
  type: Boolean,
25
35
  default: true,
@@ -72,10 +82,26 @@ ElSelect.props.fitInputWidth = {
72
82
  type: Boolean,
73
83
  default: false,
74
84
  }
85
+ ElSelect.props.popperClass = {
86
+ type: String,
87
+ default: VXE_IGNORE_CLEAR_POPPER,
88
+ }
75
89
  ElTreeSelect.props.fitInputWidth = {
76
90
  type: Boolean,
77
91
  default: false,
78
92
  }
93
+ ElTreeSelect.props.popperClass = {
94
+ type: String,
95
+ default: VXE_IGNORE_CLEAR_POPPER,
96
+ }
97
+ ElDatePicker.props.popperClass = {
98
+ type: String,
99
+ default: VXE_IGNORE_CLEAR_POPPER,
100
+ }
101
+ ElCascader.props.popperClass = {
102
+ type: String,
103
+ default: VXE_IGNORE_CLEAR_POPPER,
104
+ }
79
105
  ElTable.props.showOverflowTooltip = {
80
106
  type: Boolean,
81
107
  default: true,
@@ -4,12 +4,37 @@ import {
4
4
  VxeUI,
5
5
  VxeTooltip } from 'vxe-pc-ui'
6
6
 
7
+ import VxeUIPluginRenderElement from '@vxe-ui/plugin-render-element'
7
8
  import '@vxe-ui/plugin-render-element/dist/style.css'
9
+ // 注意:经 umoCjsVirtual 转换后,导出插件的「真插件」是具名导出(带 .install),
10
+ // default 只是包装对象 { VxeUIPluginExportXLSX, default }(无 .install)。
11
+ // 用 default 导入会导致 VxeUI.use() 空转 → 导出报「不支持的文件类型 xlsx/pdf」。必须用具名导入。
12
+ import { VxeUIPluginExportXLSX } from '@vxe-ui/plugin-export-xlsx'
13
+ import ExcelJS from 'exceljs'
8
14
  import 'vxe-pc-ui/lib/style.css'
9
15
  import '../css/vxeTableUI/all.scss'
16
+ import { VxeUIPluginExportPDF } from '@vxe-ui/plugin-export-pdf'
17
+ import { jsPDF } from 'jspdf'
10
18
  // 导入默认的语言(使用 es 构建,避免 lib CJS 在 Vite 下无 default 导出)
11
19
  import zhCN from 'vxe-table/es/locale/lang/zh-CN'
12
20
 
21
+ /**
22
+ * 导出插件(Excel/PDF)全局注册一次。
23
+ * ExcelJS / jsPDF / 插件均已在本文件顶部静态引入,注册与否不影响打包体积。
24
+ * 过去按 enableExcel/enablePdf 逐页 gating,导致注册依赖页面访问顺序:
25
+ * 直连未开启导出的页面时 VxeUI 未注册 xlsx,导出报「不支持的文件类型 "xlsx"」。
26
+ * 改为无条件注册后,任意页面、任意访问顺序均可导出。
27
+ */
28
+ let vxeExportPluginsRegistered = false
29
+ function registerVxeExportPlugins() {
30
+ if (vxeExportPluginsRegistered) return
31
+ vxeExportPluginsRegistered = true
32
+ VxeUI.use(VxeUIPluginExportXLSX, { ExcelJS })
33
+ VxeUI.use(VxeUIPluginExportPDF, { jsPDF })
34
+ }
35
+ // 模块加载即注册,确保任何 grid 创建前 xlsx/pdf 类型已可用
36
+ registerVxeExportPlugins()
37
+
13
38
  /**
14
39
  * 局部初始化 vxe-table 插件与配置
15
40
  */
@@ -22,41 +47,10 @@ export function initVxeTableInPage(
22
47
  VxeUI.setI18n('zh-CN', zhCN)
23
48
  VxeUI.setLanguage('zh-CN')
24
49
  VxeUI.component(VxeTooltip)
25
- // 局部注册插件(CJS 包动态加载,避免 Vite 静态 import 无 default 导出)
26
- if (enableElementPlus) {
27
- void import('@vxe-ui/plugin-render-element').then((renderModule) => {
28
- const VxeUIPluginRenderElement =
29
- renderModule.default ??
30
- (renderModule as { VxeUIPluginRenderElement?: typeof renderModule.default })
31
- .VxeUIPluginRenderElement ??
32
- renderModule
33
- VxeUI.use(VxeUIPluginRenderElement)
34
- })
35
- }
36
- if (enableExcel) {
37
- void Promise.all([
38
- import('exceljs'),
39
- import('@vxe-ui/plugin-export-xlsx'),
40
- ]).then(([{ default: ExcelJS }, xlsxModule]) => {
41
- const VxeUIPluginExportXLSX =
42
- xlsxModule.default ??
43
- (xlsxModule as { VxeUIPluginExportXLSX?: typeof xlsxModule.default }).VxeUIPluginExportXLSX ??
44
- xlsxModule
45
- VxeUI.use(VxeUIPluginExportXLSX, { ExcelJS })
46
- })
47
- }
48
- if (enablePdf) {
49
- void Promise.all([
50
- import('jspdf'),
51
- import('@vxe-ui/plugin-export-pdf'),
52
- ]).then(([{ jsPDF }, pdfModule]) => {
53
- const VxeUIPluginExportPDF =
54
- pdfModule.default ??
55
- (pdfModule as { VxeUIPluginExportPDF?: typeof pdfModule.default }).VxeUIPluginExportPDF ??
56
- pdfModule
57
- VxeUI.use(VxeUIPluginExportPDF, { jsPDF })
58
- })
59
- }
50
+ // 局部注册插件
51
+ enableElementPlus && VxeUI.use(VxeUIPluginRenderElement)
52
+ // 导出插件已在模块级全局注册(enableExcel/enablePdf 仅保留签名兼容)
53
+ registerVxeExportPlugins()
60
54
 
61
55
  // 设置表格配置(可复制你在 VxeTableConfig.ts 中的配置)
62
56
  VxeUI.setConfig({
@@ -239,8 +233,7 @@ export function initVxeTableInPage(
239
233
  oSize: 2,
240
234
  },
241
235
  scrollbarConfig: {
242
- width: 10,
243
- height: 10,
236
+ // 与 --adtec-vxe-scrollbar-size 一致;JS 用此值预留 scroll-x/y-virtual 空间
244
237
  },
245
238
  },
246
239
  grid: {
@@ -1226,10 +1226,11 @@ $loading: map.merge(
1226
1226
  $scrollbar: () !default;
1227
1227
  $scrollbar: map.merge(
1228
1228
  (
1229
- 'opacity': 0.65,
1230
- 'bg-color': rgba(0, 0, 0, 0.42),
1231
- 'hover-opacity': 0.85,
1232
- 'hover-bg-color': rgba(0, 0, 0, 0.55),
1229
+ /* 与 vxe 实心条对齐:不透明,避免半透明看起来更细 */
1230
+ 'opacity': 1,
1231
+ 'bg-color': rgba(144, 147, 153, 0.55),
1232
+ 'hover-opacity': 1,
1233
+ 'hover-bg-color': rgba(144, 147, 153, 0.8),
1233
1234
  ),
1234
1235
  $scrollbar
1235
1236
  );
@@ -1,6 +1,5 @@
1
1
  @use 'function' as *;
2
2
  @use '../common/var' as *;
3
- @use '../../../assets/style/scrollbar-classic.scss' as classic;
4
3
  // forward mixins
5
4
  @forward 'config';
6
5
  @forward 'function';
@@ -23,10 +22,35 @@
23
22
 
24
23
  // Scrollbar
25
24
  @mixin scroll-bar {
26
- @include classic.adtec-scrollbar-hidden;
25
+ $scrollbar-thumb-background: var(--adtec-scrollbar-thumb, rgba(144, 147, 153, 0.55));
26
+ $scrollbar-track-background: transparent;
27
27
 
28
- &:hover {
29
- @include classic.adtec-scrollbar-active;
28
+ &::-webkit-scrollbar {
29
+ z-index: 11;
30
+ width: var(--adtec-scrollbar-size, 10px);
31
+
32
+ &:horizontal {
33
+ height: var(--adtec-scrollbar-size, 10px);
34
+ }
35
+
36
+ &-thumb {
37
+ border-radius: 6px;
38
+ width: var(--adtec-scrollbar-size, 10px);
39
+ background: $scrollbar-thumb-background;
40
+ }
41
+
42
+ &-corner {
43
+ background: $scrollbar-track-background;
44
+ }
45
+
46
+ &-track {
47
+ background: $scrollbar-track-background;
48
+
49
+ &-piece {
50
+ background: $scrollbar-track-background;
51
+ width: var(--adtec-scrollbar-size, 10px);
52
+ }
53
+ }
30
54
  }
31
55
  }
32
56
 
@@ -3,7 +3,6 @@
3
3
  @use 'mixins/mixins' as *;
4
4
  @use 'mixins/var' as *;
5
5
  @use 'common/var' as *;
6
- @use '../../assets/style/scrollbar-classic.scss' as classic;
7
6
 
8
7
  @include b(scrollbar) {
9
8
  @include set-component-css-var('scrollbar', $scrollbar);
@@ -17,9 +16,6 @@
17
16
  @include e(wrap) {
18
17
  overflow: auto;
19
18
  height: 100%;
20
- box-sizing: border-box;
21
- /* 预留滚动条槽位,避免 thumb 压在正文上 */
22
- padding-right: calc(var(--el-scrollbar-size, 8px) + 4px);
23
19
 
24
20
  @include m(hidden-default) {
25
21
  scrollbar-width: none;
@@ -35,7 +31,7 @@
35
31
  width: 0;
36
32
  height: 0;
37
33
  cursor: pointer;
38
- border-radius: calc(var(--el-scrollbar-size, 8px) / 2);
34
+ border-radius: inherit;
39
35
  background-color: var(
40
36
  #{getCssVarName('scrollbar-bg-color')},
41
37
  map.get($scrollbar, 'bg-color')
@@ -60,17 +56,14 @@
60
56
 
61
57
  @include e(bar) {
62
58
  position: absolute;
63
- right: 4px;
59
+ right: 2px;
64
60
  bottom: 2px;
65
61
  z-index: 1;
66
- border-radius: calc(var(--el-scrollbar-size, 8px) / 2);
67
- opacity: 0;
68
- transition: opacity getCssVar('transition-duration') ease-out;
62
+ border-radius: 6px;
69
63
 
70
64
  @include when(vertical) {
71
- width: var(--el-scrollbar-size, 8px);
65
+ width: var(--adtec-scrollbar-size, 10px);
72
66
  top: 2px;
73
- background-color: rgba(0, 0, 0, 0.04);
74
67
 
75
68
  > div {
76
69
  width: 100%;
@@ -78,22 +71,14 @@
78
71
  }
79
72
 
80
73
  @include when(horizontal) {
81
- height: var(--el-scrollbar-size, 8px);
74
+ height: var(--adtec-scrollbar-size, 10px);
82
75
  left: 2px;
83
- background-color: rgba(0, 0, 0, 0.04);
84
76
 
85
77
  > div {
86
78
  height: 100%;
87
79
  }
88
80
  }
89
81
  }
90
-
91
- &:hover,
92
- &:active {
93
- @include e(bar) {
94
- opacity: 1;
95
- }
96
- }
97
82
  }
98
83
 
99
84
  .#{$namespace}-scrollbar-fade {
@@ -1,5 +1,4 @@
1
1
  @use '../helpers/baseMixin.scss';
2
- @use '../../../assets/style/scrollbar-classic.scss' as classic;
3
2
  @use './icon.scss';
4
3
  @use './table-module/all.scss';
5
4
 
@@ -51,20 +50,11 @@
51
50
  .vxe-table--body-wrapper,
52
51
  .vxe-table--footer-wrapper,
53
52
  .vxe-table--fixed-left-body-wrapper,
54
- .vxe-table--fixed-right-body-wrapper,
55
- .vxe-table--fixed-left-wrapper,
56
- .vxe-table--fixed-right-wrapper {
53
+ .vxe-table--fixed-right-body-wrapper {
57
54
  overflow: hidden;
58
55
  outline: 0;
59
56
  scrollbar-width: none;
60
- -ms-overflow-style: none;
61
57
  -webkit-overflow-scrolling: touch;
62
-
63
- &::-webkit-scrollbar {
64
- display: none;
65
- width: 0;
66
- height: 0;
67
- }
68
58
  }
69
59
  .vxe-table--header-inner-wrapper,
70
60
  .vxe-table--body-inner-wrapper,
@@ -75,11 +65,8 @@
75
65
  scrollbar-width: none;
76
66
  -ms-overflow-style: none;
77
67
  -webkit-overflow-scrolling: touch;
78
-
79
68
  &::-webkit-scrollbar {
80
69
  display: none;
81
- width: 0;
82
- height: 0;
83
70
  }
84
71
  }
85
72
  .vxe-table--header-inner-wrapper,
@@ -92,16 +79,54 @@
92
79
  overflow-x: scroll;
93
80
  }
94
81
 
95
- /* vxe 表格:hover 时仅在手柄上显示现代圆角滚动条(全局 index.less 已排除表格内部) */
82
+ /**
83
+ * vxe 4.13 滚动条自定义粗细(可精确到 px):
84
+ * 关键是 ::-webkit-scrollbar 上的 -webkit-appearance: none。
85
+ * macOS/Chromium 默认用 overlay 细条,会忽略 width/height;
86
+ * 一旦 appearance:none,就切换为经典滚动条,尊重此处的 px 与滑块样式。
87
+ * 故不写 scrollbar-width(避免退回 auto/overlay),只走 webkit 伪元素。
88
+ *
89
+ * 自动隐藏:默认滑块/轨道透明(隐藏),鼠标悬停 vxe 表格时才显示。
90
+ * 仍保留 appearance:none 的 8px 占位(is--scroll-x/y 预留),故无布局跳动、不遮内容。
91
+ */
96
92
  .vxe-table--scroll-x-handle,
97
93
  .vxe-table--scroll-y-handle {
98
- @include classic.adtec-scrollbar-hidden;
94
+ -ms-overflow-style: auto;
95
+
96
+ &::-webkit-scrollbar {
97
+ -webkit-appearance: none;
98
+ appearance: none;
99
+ width: var(--adtec-vxe-scrollbar-size, 8px);
100
+ height: var(--adtec-vxe-scrollbar-size, 8px);
101
+ background: transparent;
102
+ }
103
+ &::-webkit-scrollbar-thumb {
104
+ background: transparent;
105
+ border-radius: 6px;
106
+ }
107
+ &::-webkit-scrollbar-track {
108
+ background: transparent;
109
+ }
99
110
  }
100
111
 
112
+ /* 鼠标悬停在 vxe 表格上时才显示滚动条滑块(移出即隐藏) */
101
113
  .vxe-table:hover {
114
+ .vxe-table--scroll-x-handle::-webkit-scrollbar-thumb,
115
+ .vxe-table--scroll-y-handle::-webkit-scrollbar-thumb {
116
+ background: #c0c4cc;
117
+ }
118
+ .vxe-table--scroll-x-handle::-webkit-scrollbar-thumb:hover,
119
+ .vxe-table--scroll-y-handle::-webkit-scrollbar-thumb:hover {
120
+ background: #909399;
121
+ }
122
+ }
123
+
124
+ /* Firefox 无 ::-webkit-scrollbar:退而用 thin(无法精确到 px) */
125
+ @supports not selector(::-webkit-scrollbar) {
102
126
  .vxe-table--scroll-x-handle,
103
127
  .vxe-table--scroll-y-handle {
104
- @include classic.adtec-vxe-scrollbar-active;
128
+ scrollbar-width: thin;
129
+ scrollbar-color: #c0c4cc transparent;
105
130
  }
106
131
  }
107
132
 
@@ -598,12 +623,29 @@
598
623
  }
599
624
  }
600
625
  }
626
+ /**
627
+ * 滚动条布局:
628
+ * - virtual 默认 0,由 JS(scrollbarConfig)写入真实高度/宽度(禁止 !important 压死)
629
+ * - handle 粗细由 --adtec-vxe-scrollbar-size 控制(默认 8px)
630
+ */
601
631
  .vxe-table--scroll-x-virtual {
602
632
  height: 0;
603
633
  }
604
634
  .vxe-table--scroll-y-virtual {
605
635
  width: 0;
606
636
  }
637
+ /**
638
+ * 有滚动条时按 8px 预留占位:
639
+ * scroll-x/y-handle 是 position:absolute 浮层,appearance:none 后为 8px 实体条。
640
+ * 若虚拟条 height/width 为 0,绝对定位的滚动条会溢出盖住最后一行/最右列。
641
+ * 仅在 is--scroll-x/y(确有溢出)时预留,空表不留缝。
642
+ */
643
+ &.is--scroll-x .vxe-table--scroll-x-virtual {
644
+ height: var(--adtec-vxe-scrollbar-size, 8px);
645
+ }
646
+ &.is--scroll-y .vxe-table--scroll-y-virtual {
647
+ width: var(--adtec-vxe-scrollbar-size, 8px);
648
+ }
607
649
  .vxe-table--scroll-x-virtual,
608
650
  .vxe-table--scroll-y-virtual {
609
651
  visibility: hidden;
@@ -630,7 +672,7 @@
630
672
  .vxe-table--scroll-x-handle {
631
673
  overflow-y: hidden;
632
674
  overflow-x: scroll;
633
- height: var(--vxe-scrollbar-size, 8px);
675
+ height: var(--adtec-vxe-scrollbar-size, 8px);
634
676
  }
635
677
  .vxe-table--scroll-x-wrapper {
636
678
  height: 100%;
@@ -645,7 +687,7 @@
645
687
  .vxe-table--scroll-y-handle {
646
688
  overflow-y: scroll;
647
689
  overflow-x: hidden;
648
- width: var(--vxe-scrollbar-size, 8px);
690
+ width: var(--adtec-vxe-scrollbar-size, 8px);
649
691
  height: 100%;
650
692
  }
651
693
  .vxe-table--scroll-x-space {
@@ -924,16 +966,19 @@
924
966
  height: 100%;
925
967
  display: flex;
926
968
  flex-direction: column;
969
+ min-height: 0;
927
970
  overflow: hidden;
928
-
971
+ /**
972
+ * 项目 height:100% 表格必需:layout 用 flex 收缩,
973
+ * 把底部留给官方 scroll-x-virtual 预留区,避免 100%+18px 被裁掉。
974
+ */
929
975
  .vxe-table--layout-wrapper {
930
- flex: 1;
976
+ flex: 1 1 auto;
931
977
  min-height: 0;
932
978
  height: auto;
933
979
  }
934
-
935
980
  .vxe-table--scroll-x-virtual {
936
- flex-shrink: 0;
981
+ flex: 0 0 auto;
937
982
  }
938
983
  }
939
984
  &:not(.is--empty) {
@@ -1216,7 +1261,7 @@
1216
1261
  &::after {
1217
1262
  bottom: 0;
1218
1263
  height: calc(100% + var(--vxe-ui-table-border-width));
1219
- //border-top: var(--vxe-ui-table-border-width) solid var(--vxe-ui-table-border-color);
1264
+ border-top: var(--vxe-ui-table-border-width) solid var(--vxe-ui-table-border-color);
1220
1265
  }
1221
1266
  }
1222
1267
  }
@@ -16,8 +16,6 @@ export function getAcceptString(accept: string): string | undefined {
16
16
  return '.xls,.xlsx'
17
17
  } else if (accept === 'ppt') {
18
18
  return '.ppt,.pptx'
19
- } else if (accept === 'zip') {
20
- return '.zip'
21
19
  }
22
20
  return undefined
23
21
  }
@@ -30,7 +28,7 @@ export function getAcceptSuffixes(accept: string): string[] | null {
30
28
  return acceptStr.split(',').map((suffix) => suffix.slice(1).toLowerCase())
31
29
  }
32
30
 
33
- const ACCEPT_TYPES = ['images', 'document', 'txt', 'pdf', 'word', 'excel', 'ppt', 'zip'] as const
31
+ const ACCEPT_TYPES = ['images', 'document', 'txt', 'pdf', 'word', 'excel', 'ppt'] as const
34
32
 
35
33
  const ALL_PREVIEW_SUFFIXES = new Set(
36
34
  ACCEPT_TYPES.flatMap((accept) => getAcceptSuffixes(accept) ?? []),
@@ -1,105 +0,0 @@
1
- /* 现代圆角滚动条(hover 显示),供全局 / vxe 复用 */
2
-
3
- .adtec-scrollbar-active() {
4
- scrollbar-width: thin;
5
- scrollbar-color: var(--adtec-scrollbar-thumb-color) var(--adtec-scrollbar-track-color);
6
-
7
- &::-webkit-scrollbar {
8
- background: transparent;
9
- }
10
-
11
- &::-webkit-scrollbar:vertical {
12
- width: var(--adtec-scrollbar-size);
13
- }
14
-
15
- &::-webkit-scrollbar:horizontal {
16
- height: var(--adtec-scrollbar-size);
17
- }
18
-
19
- &::-webkit-scrollbar-track {
20
- background: var(--adtec-scrollbar-track-color);
21
- border-radius: var(--adtec-scrollbar-radius);
22
- }
23
-
24
- &::-webkit-scrollbar-thumb {
25
- background: var(--adtec-scrollbar-thumb-color);
26
- border-radius: var(--adtec-scrollbar-radius);
27
- border: none;
28
- }
29
-
30
- &::-webkit-scrollbar-thumb:hover {
31
- background: var(--adtec-scrollbar-thumb-hover-color);
32
- }
33
-
34
- &::-webkit-scrollbar-button {
35
- display: none;
36
- width: 0;
37
- height: 0;
38
- }
39
-
40
- &::-webkit-scrollbar-corner {
41
- background: transparent;
42
- }
43
- }
44
-
45
- .adtec-scrollbar-hidden() {
46
- scrollbar-width: none;
47
- -ms-overflow-style: none;
48
-
49
- &::-webkit-scrollbar-thumb {
50
- background: transparent;
51
- }
52
-
53
- &::-webkit-scrollbar-track {
54
- background: transparent;
55
- }
56
- }
57
-
58
- /* 附件预览等关键区域:滚动条常显(覆盖全局 hover 才显示) */
59
- .adtec-scrollbar-persistent() {
60
- .adtec-scrollbar-active();
61
- }
62
-
63
- /* vxe 表格专用:尺寸/颜色与 el-scrollbar 一致 */
64
- .adtec-vxe-scrollbar-active() {
65
- scrollbar-width: thin;
66
- scrollbar-color: var(--vxe-scrollbar-thumb-color, rgba(0, 0, 0, 0.42))
67
- var(--vxe-scrollbar-track-color, rgba(0, 0, 0, 0.04));
68
-
69
- &::-webkit-scrollbar {
70
- background: transparent;
71
- }
72
-
73
- &::-webkit-scrollbar:vertical {
74
- width: var(--vxe-scrollbar-size, 8px);
75
- }
76
-
77
- &::-webkit-scrollbar:horizontal {
78
- height: var(--vxe-scrollbar-size, 8px);
79
- }
80
-
81
- &::-webkit-scrollbar-track {
82
- background: var(--vxe-scrollbar-track-color, rgba(0, 0, 0, 0.04));
83
- border-radius: calc(var(--vxe-scrollbar-size, 8px) / 2);
84
- }
85
-
86
- &::-webkit-scrollbar-thumb {
87
- background: var(--vxe-scrollbar-thumb-color, rgba(0, 0, 0, 0.42));
88
- border-radius: calc(var(--vxe-scrollbar-size, 8px) / 2);
89
- border: none;
90
- }
91
-
92
- &::-webkit-scrollbar-thumb:hover {
93
- background: var(--vxe-scrollbar-thumb-hover-color, rgba(0, 0, 0, 0.55));
94
- }
95
-
96
- &::-webkit-scrollbar-button {
97
- display: none;
98
- width: 0;
99
- height: 0;
100
- }
101
-
102
- &::-webkit-scrollbar-corner {
103
- background: transparent;
104
- }
105
- }
@@ -1,105 +0,0 @@
1
- // 现代圆角滚动条(hover 显示),与 scrollbar-classic.less 保持同步
2
-
3
- @mixin adtec-scrollbar-active {
4
- scrollbar-width: thin;
5
- scrollbar-color: var(--adtec-scrollbar-thumb-color) var(--adtec-scrollbar-track-color);
6
-
7
- &::-webkit-scrollbar {
8
- background: transparent;
9
- }
10
-
11
- &::-webkit-scrollbar:vertical {
12
- width: var(--adtec-scrollbar-size);
13
- }
14
-
15
- &::-webkit-scrollbar:horizontal {
16
- height: var(--adtec-scrollbar-size);
17
- }
18
-
19
- &::-webkit-scrollbar-track {
20
- background: var(--adtec-scrollbar-track-color);
21
- border-radius: var(--adtec-scrollbar-radius);
22
- }
23
-
24
- &::-webkit-scrollbar-thumb {
25
- background: var(--adtec-scrollbar-thumb-color);
26
- border-radius: var(--adtec-scrollbar-radius);
27
- border: none;
28
- }
29
-
30
- &::-webkit-scrollbar-thumb:hover {
31
- background: var(--adtec-scrollbar-thumb-hover-color);
32
- }
33
-
34
- &::-webkit-scrollbar-button {
35
- display: none;
36
- width: 0;
37
- height: 0;
38
- }
39
-
40
- &::-webkit-scrollbar-corner {
41
- background: transparent;
42
- }
43
- }
44
-
45
- @mixin adtec-scrollbar-hidden {
46
- scrollbar-width: none;
47
- -ms-overflow-style: none;
48
-
49
- &::-webkit-scrollbar-thumb {
50
- background: transparent;
51
- }
52
-
53
- &::-webkit-scrollbar-track {
54
- background: transparent;
55
- }
56
- }
57
-
58
- /* 附件预览等关键区域:滚动条常显(覆盖全局 hover 才显示) */
59
- @mixin adtec-scrollbar-persistent {
60
- @include adtec-scrollbar-active;
61
- }
62
-
63
- /* vxe 表格专用:尺寸/颜色与 el-scrollbar 一致 */
64
- @mixin adtec-vxe-scrollbar-active {
65
- scrollbar-width: thin;
66
- scrollbar-color: var(--vxe-scrollbar-thumb-color, rgba(0, 0, 0, 0.42))
67
- var(--vxe-scrollbar-track-color, rgba(0, 0, 0, 0.04));
68
-
69
- &::-webkit-scrollbar {
70
- background: transparent;
71
- }
72
-
73
- &::-webkit-scrollbar:vertical {
74
- width: var(--vxe-scrollbar-size, 8px);
75
- }
76
-
77
- &::-webkit-scrollbar:horizontal {
78
- height: var(--vxe-scrollbar-size, 8px);
79
- }
80
-
81
- &::-webkit-scrollbar-track {
82
- background: var(--vxe-scrollbar-track-color, rgba(0, 0, 0, 0.04));
83
- border-radius: calc(var(--vxe-scrollbar-size, 8px) / 2);
84
- }
85
-
86
- &::-webkit-scrollbar-thumb {
87
- background: var(--vxe-scrollbar-thumb-color, rgba(0, 0, 0, 0.42));
88
- border-radius: calc(var(--vxe-scrollbar-size, 8px) / 2);
89
- border: none;
90
- }
91
-
92
- &::-webkit-scrollbar-thumb:hover {
93
- background: var(--vxe-scrollbar-thumb-hover-color, rgba(0, 0, 0, 0.55));
94
- }
95
-
96
- &::-webkit-scrollbar-button {
97
- display: none;
98
- width: 0;
99
- height: 0;
100
- }
101
-
102
- &::-webkit-scrollbar-corner {
103
- background: transparent;
104
- }
105
- }