@jari-ace/element-plus-component 0.5.6 → 0.6.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (61) hide show
  1. package/dist/components/autoComplete/JaAutoComplete.vue.d.ts +856 -1163
  2. package/dist/components/autoComplete/JaAutoComplete.vue.d.ts.map +1 -1
  3. package/dist/components/avatar/JaAvatar.vue.d.ts +3 -4
  4. package/dist/components/avatar/JaAvatar.vue.d.ts.map +1 -1
  5. package/dist/components/avatar/JaAvatar.vue.js +2 -10
  6. package/dist/components/avatar/JaAvatar.vue.js.map +1 -1
  7. package/dist/components/button/JaButton.vue.d.ts +354 -246
  8. package/dist/components/button/JaButton.vue.d.ts.map +1 -1
  9. package/dist/components/checkbox/JaCheckbox.vue.d.ts +212 -176
  10. package/dist/components/checkbox/JaCheckbox.vue.d.ts.map +1 -1
  11. package/dist/components/checkboxGroup/JaCheckboxGroup.vue.d.ts +262 -222
  12. package/dist/components/checkboxGroup/JaCheckboxGroup.vue.d.ts.map +1 -1
  13. package/dist/components/departmentPicker/src/DepartmentPicker.vue.js +2 -2
  14. package/dist/components/departmentPicker/src/DepartmentPicker.vue.js.map +1 -1
  15. package/dist/components/dropdownButton/JaDropdownButton.vue.d.ts +400 -268
  16. package/dist/components/dropdownButton/JaDropdownButton.vue.d.ts.map +1 -1
  17. package/dist/components/flowShell/FlowFormShell.vue.d.ts +339 -0
  18. package/dist/components/flowShell/FlowFormShell.vue.d.ts.map +1 -1
  19. package/dist/components/flowShell/FlowFormShell.vue.js +137 -50
  20. package/dist/components/flowShell/FlowFormShell.vue.js.map +1 -1
  21. package/dist/components/formItem/JaFormItem.vue.d.ts +228 -186
  22. package/dist/components/formItem/JaFormItem.vue.d.ts.map +1 -1
  23. package/dist/components/input/JaInput.vue.d.ts +595 -581
  24. package/dist/components/input/JaInput.vue.d.ts.map +1 -1
  25. package/dist/components/input/JaInput.vue.js +4 -2
  26. package/dist/components/input/JaInput.vue.js.map +1 -1
  27. package/dist/components/inputNumber/JaInputNumber.vue.d.ts +428 -276
  28. package/dist/components/inputNumber/JaInputNumber.vue.d.ts.map +1 -1
  29. package/dist/components/radioGroup/JaRadioGroup.vue.d.ts +246 -155
  30. package/dist/components/radioGroup/JaRadioGroup.vue.d.ts.map +1 -1
  31. package/dist/components/rolePicker/baseRolePicker.vue.d.ts +984 -12
  32. package/dist/components/rolePicker/baseRolePicker.vue.d.ts.map +1 -1
  33. package/dist/components/scrollbar/Scrollbar.vue.d.ts +332 -194
  34. package/dist/components/scrollbar/Scrollbar.vue.d.ts.map +1 -1
  35. package/dist/components/switch/JaSwitch.vue.d.ts +378 -317
  36. package/dist/components/switch/JaSwitch.vue.d.ts.map +1 -1
  37. package/dist/components/upload/JaUploader.vue.d.ts +51 -3
  38. package/dist/components/upload/JaUploader.vue.d.ts.map +1 -1
  39. package/dist/components/upload/JaUploader.vue.js +12 -0
  40. package/dist/components/upload/JaUploader.vue.js.map +1 -1
  41. package/dist/components/upload/index.d.ts +31 -0
  42. package/dist/components/upload/index.d.ts.map +1 -1
  43. package/dist/components/upload/uploader.vue.d.ts +9 -0
  44. package/dist/components/upload/uploader.vue.d.ts.map +1 -1
  45. package/dist/components/upload/uploader.vue.js +20 -14
  46. package/dist/components/upload/uploader.vue.js.map +1 -1
  47. package/dist/components/userGroupPicker/src/UserGroupPicker.vue.js +2 -2
  48. package/dist/components/userGroupPicker/src/UserGroupPicker.vue.js.map +1 -1
  49. package/dist/components/userGroupTree/src/userGroupTree.vue.d.ts +416 -324
  50. package/dist/components/userGroupTree/src/userGroupTree.vue.d.ts.map +1 -1
  51. package/lib/index.css +1 -1
  52. package/lib/index.js +9788 -9548
  53. package/lib/index.umd.cjs +34 -34
  54. package/package.json +2 -2
  55. package/packages/components/avatar/JaAvatar.vue +7 -16
  56. package/packages/components/departmentPicker/src/DepartmentPicker.vue +1 -1
  57. package/packages/components/flowShell/FlowFormShell.vue +98 -8
  58. package/packages/components/input/JaInput.vue +2 -1
  59. package/packages/components/upload/JaUploader.vue +39 -5
  60. package/packages/components/upload/uploader.vue +51 -38
  61. package/packages/components/userGroupPicker/src/UserGroupPicker.vue +1 -1
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@jari-ace/element-plus-component",
3
3
  "private": false,
4
- "version": "0.5.6",
4
+ "version": "0.6.0",
5
5
  "main": "lib/index.umd.cjs",
6
6
  "module": "lib/index.js",
7
7
  "types": "dist/index.d.ts",
@@ -35,7 +35,7 @@
35
35
  "@vitejs/plugin-vue-jsx": "^4.1.1",
36
36
  "@vue/tsconfig": "^0.5.1",
37
37
  "@vueuse/core": "^11.1.0",
38
- "element-plus": "2.11.7",
38
+ "element-plus": "2.13.2",
39
39
  "gulp": "^4.0.2",
40
40
  "gulp-autoprefixer": "^8.0.0",
41
41
  "gulp-clean-css": "^4.3.0",
@@ -1,18 +1,18 @@
1
1
  <script setup lang="ts">
2
- import { getAvatarToken } from "./avatarToken";
3
- import { ElAvatar, ElImage } from "element-plus";
4
- import type { AvatarProps } from "element-plus";
2
+ import {getAvatarToken} from "./avatarToken";
3
+ import {ElAvatar, ElImage} from "element-plus";
5
4
  import {
6
5
  computed,
6
+ defineProps,
7
7
  nextTick,
8
8
  onMounted, onUnmounted,
9
9
  ref,
10
10
  watch,
11
11
  withDefaults
12
12
  } from "vue";
13
- import { defaultImg } from "./defaultImg";
13
+ import {defaultImg} from "./defaultImg";
14
14
 
15
- export interface JaAvatarProps extends Partial<AvatarProps> {
15
+ const props = withDefaults(defineProps<{
16
16
  /**
17
17
  * 用户id
18
18
  */
@@ -35,9 +35,7 @@ export interface JaAvatarProps extends Partial<AvatarProps> {
35
35
  hasAvatar?: boolean,
36
36
 
37
37
  firstName?: string
38
- }
39
-
40
- const props = withDefaults(defineProps<JaAvatarProps>(), {
38
+ }>(), {
41
39
  doNotLoadAvatar: false
42
40
  })
43
41
 
@@ -53,7 +51,6 @@ if (!scrollbarWrappedItems) {
53
51
  onMounted(async () => {
54
52
  await nextTick();
55
53
  if (scrollbarWrappedItems) {
56
- // @ts-ignore
57
54
  scrollbarWrappedItems.value?.push({
58
55
  childElement: avatar.value?.$el,
59
56
  onInView(isInView: boolean) {
@@ -96,21 +93,15 @@ function adjustFontSize(element?: HTMLElement) {
96
93
 
97
94
  onUnmounted(() => {
98
95
  if (scrollbarWrappedItems) {
99
- // @ts-ignore
100
96
  scrollbarWrappedItems.value = undefined;
101
97
  }
102
98
  })
103
99
 
104
100
  watch(usernameSpan, () => adjustFontSize(usernameSpan.value))
105
-
106
- const elementProps = computed(() => {
107
- const { userId, username, realm, doNotLoadAvatar, hasAvatar, firstName, ...rest } = props
108
- return rest
109
- })
110
101
  </script>
111
102
 
112
103
  <template>
113
- <el-avatar :src="lazyUrl" v-bind="{ ...elementProps, ...$attrs }" ref="avatar" class="ja-avatar">
104
+ <el-avatar :src="lazyUrl" v-bind="$attrs" ref="avatar" class="ja-avatar">
114
105
  <span v-if="props.firstName && props.firstName.length > 0" class="user-name-avatar"
115
106
  ref="usernameSpan">
116
107
  {{ firstName }}
@@ -5,7 +5,7 @@
5
5
  :size="props.size"
6
6
  node-key="id"
7
7
  check-strictly
8
- :current-node-key="id"
8
+ :current-node-key="Array.isArray(id) ? undefined : id"
9
9
  highlight-current
10
10
  v-model="id"
11
11
  :multiple="multiple"
@@ -1,6 +1,6 @@
1
1
  <template>
2
- <div v-if="dialogVisible" class="flow-shell-wrapper">
3
- <div class="flow-shell-container" v-loading="isLoading">
2
+ <div v-if="dialogVisible" class="flow-shell-wrapper" :style="wrapperStyle">
3
+ <div class="flow-shell-container" v-loading="isLoading" :style="containerStyle">
4
4
  <header class="flow-shell-header">
5
5
  <div class="header-content">
6
6
  <div class="header-top">
@@ -62,11 +62,14 @@
62
62
  </section>
63
63
 
64
64
  <!-- 右侧辅助面板 -->
65
- <aside class="side-panel">
65
+ <aside class="side-panel" :class="{ 'collapsed': sidePanelCollapsed }">
66
66
  <div class="side-panel-header">
67
67
  <h3>办理历史</h3>
68
+ <div class="collapse-btn" @click="sidePanelCollapsed = !sidePanelCollapsed" :title="sidePanelCollapsed ? '展开' : '收起'">
69
+ <el-icon><ArrowRight v-if="!sidePanelCollapsed" /><ArrowLeft v-else /></el-icon>
70
+ </div>
68
71
  </div>
69
- <div class="side-panel-content">
72
+ <div class="side-panel-content" v-show="!sidePanelCollapsed">
70
73
  <el-timeline v-if="sortedTasks.length > 0">
71
74
  <el-timeline-item v-for="(task, index) in sortedTasks" :key="index"
72
75
  :timestamp="formatFriendlyTime(task.finishTime)" placement="top">
@@ -105,6 +108,7 @@
105
108
  :tooltip="'保存并' + (flowFormParam?.taskInstance ? '结束当前工作步骤办理' : '发起工作')" :loading="saving"
106
109
  :disabled="saving">{{
107
110
  flowFormParam?.taskInstance ? "办理结束" : "发起工作" }}</ja-button>
111
+ <slot name="footer" :flowParam="flowFormParam"></slot>
108
112
  </footer>
109
113
  </div>
110
114
  </div>
@@ -118,7 +122,7 @@ import { createAxiosWithoutCache, useLoading } from '@jari-ace/app-bolts'
118
122
  import { ElMessage, ElTag, ElCard, ElButton, ElTimeline, ElTimelineItem, ElEmpty, ElIcon, ElResult } from 'element-plus'
119
123
  import { JaButton } from '../button'
120
124
  import { JaUserInfoTag } from '../userTag'
121
- import { ArrowLeft } from '@element-plus/icons-vue'
125
+ import { ArrowLeft, ArrowRight } from '@element-plus/icons-vue'
122
126
  import dayjs from 'dayjs'
123
127
  import relativeTime from 'dayjs/plugin/relativeTime'
124
128
  import 'dayjs/locale/zh-cn'
@@ -153,17 +157,33 @@ const props = withDefaults(defineProps<{
153
157
  * 保存表单数据的方法,保存成功时发起或转交工作
154
158
  */
155
159
  saveAndForward: (formData: FlowProcessRequest<T>) => Promise<any>
160
+ /**
161
+ * 对话框宽度,为空时全屏
162
+ */
163
+ width?: string
164
+ /**
165
+ * 对话框高度,为空时全屏
166
+ */
167
+ height?: string
168
+ /**
169
+ * 侧边栏默认是否收起
170
+ */
171
+ defaultCollapsed?: boolean
156
172
  }>(), {
157
173
  appName: undefined,
158
174
  flowKey: undefined,
159
175
  startNodeKey: undefined,
160
- taskInstanceId: undefined
176
+ taskInstanceId: undefined,
177
+ width: undefined,
178
+ height: undefined,
179
+ defaultCollapsed: false
161
180
  })
162
181
 
163
182
  // 内部状态
164
183
  const dialogVisible = defineModel<boolean>({
165
184
  default: false
166
185
  })
186
+ const sidePanelCollapsed = ref(props.defaultCollapsed)
167
187
  const axios = createAxiosWithoutCache()
168
188
  const loading = useLoading(axios)
169
189
  const localLoading = ref(false)
@@ -178,6 +198,38 @@ const emits = defineEmits<{
178
198
  (e: 'closed'): void
179
199
  }>();
180
200
 
201
+ const isModal = computed(() => !!props.width || !!props.height)
202
+
203
+ const wrapperStyle = computed(() => {
204
+ if (isModal.value) {
205
+ return {
206
+ justifyContent: 'center',
207
+ alignItems: 'center',
208
+ backgroundColor: 'rgba(0, 0, 0, 0.5)'
209
+ }
210
+ }
211
+ return {
212
+ backgroundColor: '#f5f7fa'
213
+ }
214
+ })
215
+
216
+ const containerStyle = computed(() => {
217
+ if (isModal.value) {
218
+ return {
219
+ width: props.width || '100%',
220
+ height: props.height || '100%',
221
+ backgroundColor: '#f5f7fa',
222
+ borderRadius: '4px',
223
+ boxShadow: '0 2px 12px 0 rgba(0, 0, 0, 0.1)',
224
+ overflow: 'hidden'
225
+ }
226
+ }
227
+ return {
228
+ width: '100%',
229
+ height: '100%'
230
+ }
231
+ })
232
+
181
233
  const flowStateTagType = computed(() => {
182
234
  switch (flowFormParam.value?.flowInstance?.state) {
183
235
  case 0:
@@ -368,7 +420,7 @@ const handleForward = async () => {
368
420
  width: 100%;
369
421
  height: 100%;
370
422
  background-color: #f5f7fa;
371
- z-index: 2000;
423
+ z-index: 300;
372
424
  display: flex;
373
425
  flex-direction: column;
374
426
  }
@@ -517,6 +569,11 @@ const handleForward = async () => {
517
569
  display: flex;
518
570
  flex-direction: column;
519
571
  width: 400px;
572
+ transition: width 0.3s ease;
573
+ }
574
+
575
+ .side-panel.collapsed {
576
+ width: 40px;
520
577
  }
521
578
 
522
579
  .side-panel-header {
@@ -524,8 +581,16 @@ const handleForward = async () => {
524
581
  border-bottom: 1px solid #e0e0e0;
525
582
  display: flex;
526
583
  align-items: center;
527
- padding: 0 20px;
584
+ justify-content: space-between;
585
+ padding: 0 10px 0 20px;
528
586
  background-color: #fafafa;
587
+ overflow: hidden;
588
+ white-space: nowrap;
589
+ }
590
+
591
+ .side-panel.collapsed .side-panel-header {
592
+ padding: 0;
593
+ justify-content: center;
529
594
  }
530
595
 
531
596
  .side-panel-header h3 {
@@ -533,6 +598,31 @@ const handleForward = async () => {
533
598
  font-size: 16px;
534
599
  font-weight: 600;
535
600
  color: #303133;
601
+ transition: opacity 0.3s;
602
+ }
603
+
604
+ .side-panel.collapsed .side-panel-header h3 {
605
+ opacity: 0;
606
+ width: 0;
607
+ margin: 0;
608
+ padding: 0;
609
+ display: none;
610
+ }
611
+
612
+ .collapse-btn {
613
+ cursor: pointer;
614
+ display: flex;
615
+ align-items: center;
616
+ justify-content: center;
617
+ width: 24px;
618
+ height: 24px;
619
+ border-radius: 4px;
620
+ color: #909399;
621
+ }
622
+
623
+ .collapse-btn:hover {
624
+ background-color: #e6e6e6;
625
+ color: #606266;
536
626
  }
537
627
 
538
628
  .side-panel-content {
@@ -23,7 +23,8 @@ const props = withDefaults(defineProps<JaInputProps>(), {
23
23
  autocomplete: 'off',
24
24
  readonly: false,
25
25
  autofocus: false,
26
- validateEvent: true
26
+ validateEvent: true,
27
+ inputStyle: () => ({})
27
28
  })
28
29
 
29
30
  const model = inject('aceFormModel') as Record<string, any>
@@ -5,7 +5,7 @@ import {getValue, setValue} from "../../utils/objectUtils";
5
5
  import Uploader from "./uploader.vue";
6
6
 
7
7
  export interface JaUploaderProps {
8
- /**
8
+ /**
9
9
  * 应用名
10
10
  */
11
11
  serviceName: string,
@@ -18,7 +18,7 @@ export interface JaUploaderProps {
18
18
  */
19
19
  attachToken?: string,
20
20
  /**
21
- * 数据密级
21
+ * 数据密集
22
22
  */
23
23
  classificationLevel?: number,
24
24
  /**
@@ -28,7 +28,31 @@ export interface JaUploaderProps {
28
28
  /**
29
29
  * 文件列表最大高度
30
30
  */
31
- maxHeight?: string | number
31
+ maxHeight?: string | number,
32
+ /**
33
+ * 是否允许上传, 为空表示采用应用里的附件设置
34
+ */
35
+ allowUpload?: boolean,
36
+ /**
37
+ * 是否允许下载,为空表示采用应用里的附件设置
38
+ */
39
+ allowDownload?: boolean,
40
+ /**
41
+ * 是否允许删除,为空表示采用应用里的附件设置
42
+ */
43
+ allowDelete?: boolean,
44
+ /**
45
+ * 是否允许预览,为空表示采用应用里的附件设置
46
+ */
47
+ allowPreview?: boolean,
48
+ /**
49
+ * 布局方式: list-列表布局(默认), inline-行内布局
50
+ */
51
+ layout?: 'list' | 'inline',
52
+ /**
53
+ * 是否隐藏下载所有按钮
54
+ */
55
+ hideDownloadAll?: boolean
32
56
  }
33
57
 
34
58
  const props = defineProps<JaUploaderProps>();
@@ -61,8 +85,18 @@ defineExpose({
61
85
  </script>
62
86
 
63
87
  <template>
64
- <uploader :service-name="serviceName" :max-height="maxHeight" :height="height" :config-key="configKey"
65
- :attach-token="attachToken" :classification-level="classificationLevel"
88
+ <uploader :service-name="serviceName"
89
+ :max-height="maxHeight"
90
+ :height="height"
91
+ :config-key="configKey"
92
+ :attach-token="attachToken"
93
+ :classification-level="classificationLevel"
94
+ :allow-delete="allowDelete"
95
+ :allow-download="allowDownload"
96
+ :allow-preview="allowPreview"
97
+ :layout="layout"
98
+ :hide-download-all="hideDownloadAll"
99
+ :allow-upload="allowUpload"
66
100
  v-model="mv"
67
101
  @change="onChange"></uploader>
68
102
  </template>
@@ -92,9 +92,18 @@ const props = withDefaults(defineProps<{
92
92
  /**
93
93
  * 布局方式: list-列表布局(默认), inline-行内布局
94
94
  */
95
- layout?: 'list' | 'inline'
95
+ layout?: 'list' | 'inline',
96
+ /**
97
+ * 是否隐藏下载所有按钮
98
+ */
99
+ hideDownloadAll?: boolean
96
100
  }>(), {
97
- layout: 'list'
101
+ layout: 'list',
102
+ allowUpload: undefined,
103
+ allowDownload: undefined,
104
+ allowDelete: undefined,
105
+ allowPreview: undefined,
106
+ hideDownloadAll: false
98
107
  });
99
108
  const attachId = defineModel<string>({
100
109
  required: false
@@ -178,15 +187,6 @@ const emits = defineEmits<{
178
187
  let uppy: Uppy | undefined;
179
188
  curAttachToken.value = props.attachToken;
180
189
 
181
- onMounted(async () => {
182
- await updateAllowedClassificationLevels();
183
- if (props.attachToken) {
184
- await initLoad();
185
- } else {
186
- await initNew();
187
- }
188
- });
189
-
190
190
  onUnmounted(() => {
191
191
  if (uppy) uppy.destroy();
192
192
  uppy = undefined;
@@ -198,7 +198,7 @@ async function updateAllowedClassificationLevels() {
198
198
  classificationLevels.value = await useSystemClassificationLevels();
199
199
  classificationLevelMap.value = await useSystemClassificationLevelMap();
200
200
  allowedClassificationLevels.value = classificationLevels.value.filter(l => l.value >= cl);
201
- highestClassificationLevel.value = Math.min(...allowedClassificationLevels.value.map(l=>l.value))
201
+ highestClassificationLevel.value = Math.min(...allowedClassificationLevels.value.map(l => l.value))
202
202
  console.log(`附件控件密级调试:
203
203
  表单密级:`, props.classificationLevel, `
204
204
  用户密级:`, user.value?.classifiedLevel, `
@@ -326,6 +326,7 @@ function createUppyInstance() {
326
326
  }
327
327
 
328
328
  async function onUploadBtnClick() {
329
+ console.log('upload btn clicked')
329
330
  const cfg = uploadInitParams.value?.fileConfig;
330
331
  if (cfg) {
331
332
  uppy?.setMeta({
@@ -514,9 +515,13 @@ watch(() => props.attachToken, () => {
514
515
  } else {
515
516
  initNew();
516
517
  }
518
+ }, {
519
+ immediate: true
517
520
  });
518
521
 
519
- watch(()=> props.classificationLevel, updateAllowedClassificationLevels)
522
+ watch(() => props.classificationLevel, updateAllowedClassificationLevels, {
523
+ immediate: true
524
+ })
520
525
 
521
526
  function getFileIcon(fileName: string) {
522
527
  if (!fileName) return Document;
@@ -557,7 +562,7 @@ function getFileIcon(fileName: string) {
557
562
  :disabled="loading" size="small" v-if="allowedClassificationLevels.length <= 1 && checkAllowUpload()">
558
563
  上传{{ uploadInitParams?.fileConfig.enableClassifiedLevel ? "(非密)" : "" }}
559
564
  </el-button>
560
- <el-button plain :icon="Download" @click="downloadAll" v-if="checkAllowDownload()" :loading="loading"
565
+ <el-button plain :icon="Download" @click="downloadAll" v-if="checkAllowDownload() && !hideDownloadAll" :loading="loading"
561
566
  :disabled="loading || files?.length === 0" size="small">
562
567
  全部下载
563
568
  </el-button>
@@ -582,13 +587,15 @@ function getFileIcon(fileName: string) {
582
587
  <span class="loader-shimmer">正在上传,已完成{{ uploadingProgress }}%...</span>
583
588
  </p>
584
589
  </div>
585
-
590
+
586
591
  <div v-if="layout === 'inline'" class="inline-files">
587
- <div v-for="file in files" :key="file.id" class="inline-file-item">
592
+ <div v-for="file in files" :key="file.id" class="inline-file-item">
588
593
  <el-popover placement="top" :width="300" trigger="hover">
589
594
  <template #reference>
590
595
  <div class="inline-file-icon-wrapper">
591
- <el-icon class="file-icon" size="20"><component :is="getFileIcon(file.fileName)" /></el-icon>
596
+ <el-icon class="file-icon" size="20">
597
+ <component :is="getFileIcon(file.fileName)" />
598
+ </el-icon>
592
599
  </div>
593
600
  </template>
594
601
  <div class="file-popover-content">
@@ -596,38 +603,43 @@ function getFileIcon(fileName: string) {
596
603
  <span class="label">文件名:</span>
597
604
  <span class="value">{{ file.fileName }}</span>
598
605
  </div>
599
- <div class="popover-row">
606
+ <div class="popover-row">
600
607
  <span class="label">大小:</span>
601
608
  <span class="value">{{ prettyBytes(file.fileSize) }}</span>
602
609
  </div>
603
- <div class="popover-row">
610
+ <div class="popover-row">
604
611
  <span class="label">密级:</span>
605
612
  <span class="value">
606
- <el-tag size="small"
613
+ <el-tag size="small"
607
614
  :type="file.classifiedLevel < 50 ? (file.classifiedLevel < 30 ? 'danger' : 'warning') : 'info'">
608
615
  {{ classificationLevelMap?.get(file.classifiedLevel) }}
609
616
  </el-tag>
610
617
  </span>
611
618
  </div>
612
619
  <div class="popover-actions">
613
- <el-button link type="primary" @click="previewFile(file.token)"
620
+ <el-button link type="primary" @click="previewFile(file.token)"
614
621
  v-if="checkAllowPreview(file)">预览
615
622
  </el-button>
616
- <el-button link type="primary" @click="downloadFile(file.token)" v-if="checkAllowDownload()">下载
623
+ <el-button link type="primary" @click="downloadFile(file.token)"
624
+ v-if="checkAllowDownload()">下载
617
625
  </el-button>
618
- <el-button link type="danger" @click="delUploadedFile(file)" v-if="checkAllowDelete()">删除
626
+ <el-button link type="danger" @click="delUploadedFile(file)"
627
+ v-if="checkAllowDelete()">删除
619
628
  </el-button>
620
629
  </div>
621
630
  </div>
622
631
  </el-popover>
623
- </div>
632
+ </div>
624
633
  </div>
625
634
  </div>
626
- <div v-if="layout === 'list'" class="file-list" :style="{ height: typeof props.height === 'number' ? props.height + 'px' : props.height, maxHeight: typeof props.maxHeight === 'number' ? props.maxHeight + 'px' : props.maxHeight }">
627
- <div v-if="files.length === 0" class="empty-text">暂无文件</div>
635
+ <div v-if="layout === 'list'" class="file-list"
636
+ :style="{ height: typeof props.height === 'number' ? props.height + 'px' : props.height, maxHeight: typeof props.maxHeight === 'number' ? props.maxHeight + 'px' : props.maxHeight }">
637
+ <div v-if="files?.length === 0" class="empty-text">暂无文件</div>
628
638
  <div v-for="file in files" :key="file.id" class="file-item">
629
639
  <div class="file-main">
630
- <el-icon class="file-icon"><component :is="getFileIcon(file.fileName)" /></el-icon>
640
+ <el-icon class="file-icon">
641
+ <component :is="getFileIcon(file.fileName)" />
642
+ </el-icon>
631
643
  <span class="file-name" :title="file.fileName">{{ file.fileName }}</span>
632
644
  </div>
633
645
  <div class="file-info-right">
@@ -637,9 +649,10 @@ function getFileIcon(fileName: string) {
637
649
  :type="file.classifiedLevel < 50 ? (file.classifiedLevel < 30 ? 'danger' : 'warning') : 'info'">
638
650
  {{ classificationLevelMap?.get(file.classifiedLevel) }}
639
651
  </el-tag>
640
- <el-tooltip v-if="file.classifiedLevel < highestClassificationLevel" content="文件密级已高于当前许可范围,请立即删除">
652
+ <el-tooltip v-if="file.classifiedLevel < highestClassificationLevel"
653
+ content="文件密级已高于当前许可范围,请立即删除">
641
654
  <el-icon color="#F56C6C" class="warning-icon">
642
- <warning-filled/>
655
+ <warning-filled />
643
656
  </el-icon>
644
657
  </el-tooltip>
645
658
  </div>
@@ -687,7 +700,7 @@ function getFileIcon(fileName: string) {
687
700
  flex-wrap: wrap;
688
701
  gap: 8px;
689
702
  margin-left: 8px;
690
-
703
+
691
704
  .inline-file-item {
692
705
  .inline-file-icon-wrapper {
693
706
  cursor: pointer;
@@ -697,7 +710,7 @@ function getFileIcon(fileName: string) {
697
710
  padding: 4px;
698
711
  border-radius: 4px;
699
712
  color: var(--el-text-color-regular);
700
-
713
+
701
714
  &:hover {
702
715
  background-color: var(--el-fill-color-light);
703
716
  color: var(--el-color-primary);
@@ -763,23 +776,23 @@ function getFileIcon(fileName: string) {
763
776
  flex-direction: column;
764
777
  gap: 8px;
765
778
  font-size: 14px;
766
-
779
+
767
780
  .popover-row {
768
781
  display: flex;
769
782
  align-items: flex-start;
770
-
783
+
771
784
  .label {
772
785
  color: var(--el-text-color-secondary);
773
786
  width: 60px;
774
787
  flex-shrink: 0;
775
788
  }
776
-
789
+
777
790
  .value {
778
791
  color: var(--el-text-color-primary);
779
792
  word-break: break-all;
780
793
  }
781
794
  }
782
-
795
+
783
796
  .popover-actions {
784
797
  display: flex;
785
798
  justify-content: flex-end;
@@ -794,7 +807,7 @@ function getFileIcon(fileName: string) {
794
807
  overflow-y: auto;
795
808
  border: 1px solid var(--el-border-color-lighter);
796
809
  border-radius: 4px;
797
-
810
+
798
811
  .empty-text {
799
812
  text-align: center;
800
813
  padding: 20px;
@@ -854,7 +867,7 @@ function getFileIcon(fileName: string) {
854
867
  display: flex;
855
868
  align-items: center;
856
869
  gap: 4px;
857
-
870
+
858
871
  .warning-icon {
859
872
  margin-left: 4px;
860
873
  cursor: help;
@@ -864,7 +877,7 @@ function getFileIcon(fileName: string) {
864
877
  .file-actions {
865
878
  display: flex;
866
879
  gap: 8px;
867
-
880
+
868
881
  .el-button {
869
882
  padding: 0;
870
883
  height: auto;
@@ -5,7 +5,7 @@
5
5
  :size="props.size"
6
6
  node-key="id"
7
7
  check-strictly
8
- :current-node-key="id"
8
+ :current-node-key="Array.isArray(id) ? undefined : id"
9
9
  highlight-current
10
10
  v-model="id"
11
11
  :multiple="multiple"