@jari-ace/element-plus-component 0.4.0 → 0.4.2
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/components/autoComplete/JaAutoComplete.vue.d.ts +543 -686
- package/dist/components/autoComplete/JaAutoComplete.vue.d.ts.map +1 -1
- package/dist/components/autoComplete/JaAutoComplete.vue.js +10 -2
- package/dist/components/autoComplete/JaAutoComplete.vue.js.map +1 -1
- package/dist/components/avatar/JaAvatar.vue.d.ts +4 -3
- package/dist/components/avatar/JaAvatar.vue.d.ts.map +1 -1
- package/dist/components/avatar/JaAvatar.vue.js +10 -2
- package/dist/components/avatar/JaAvatar.vue.js.map +1 -1
- package/dist/components/button/JaButton.vue.d.ts +184 -250
- package/dist/components/button/JaButton.vue.d.ts.map +1 -1
- package/dist/components/button/JaButton.vue.js +11 -3
- package/dist/components/button/JaButton.vue.js.map +1 -1
- package/dist/components/checkbox/JaCheckbox.vue.d.ts +164 -1068
- package/dist/components/checkbox/JaCheckbox.vue.d.ts.map +1 -1
- package/dist/components/checkbox/JaCheckbox.vue.js +9 -24
- package/dist/components/checkbox/JaCheckbox.vue.js.map +1 -1
- package/dist/components/checkboxGroup/JaCheckboxGroup.vue.d.ts +158 -163
- package/dist/components/checkboxGroup/JaCheckboxGroup.vue.d.ts.map +1 -1
- package/dist/components/checkboxGroup/JaCheckboxGroup.vue.js +14 -5
- package/dist/components/checkboxGroup/JaCheckboxGroup.vue.js.map +1 -1
- package/dist/components/datePicker/JaDatePicker.vue.d.ts +7 -4
- package/dist/components/datePicker/JaDatePicker.vue.d.ts.map +1 -1
- package/dist/components/datePicker/JaDatePicker.vue.js +18 -7
- package/dist/components/datePicker/JaDatePicker.vue.js.map +1 -1
- package/dist/components/dropdownButton/JaDropdownButton.vue.d.ts +324 -399
- package/dist/components/dropdownButton/JaDropdownButton.vue.d.ts.map +1 -1
- package/dist/components/dropdownButton/JaDropdownButton.vue.js +4 -2
- package/dist/components/dropdownButton/JaDropdownButton.vue.js.map +1 -1
- package/dist/components/form/JaForm.vue.d.ts +52 -3
- package/dist/components/form/JaForm.vue.d.ts.map +1 -1
- package/dist/components/form/JaForm.vue.js +4 -2
- package/dist/components/form/JaForm.vue.js.map +1 -1
- package/dist/components/formItem/JaFormItem.vue.d.ts +168 -133
- package/dist/components/formItem/JaFormItem.vue.d.ts.map +1 -1
- package/dist/components/formItem/JaFormItem.vue.js.map +1 -1
- package/dist/components/input/JaInput.vue.d.ts +274 -421
- package/dist/components/input/JaInput.vue.d.ts.map +1 -1
- package/dist/components/input/JaInput.vue.js +20 -60
- package/dist/components/input/JaInput.vue.js.map +1 -1
- package/dist/components/inputI18n/JaInputI18n.vue.d.ts +70 -70
- package/dist/components/inputNumber/JaInputNumber.vue.d.ts +203 -217
- package/dist/components/inputNumber/JaInputNumber.vue.d.ts.map +1 -1
- package/dist/components/inputNumber/JaInputNumber.vue.js +16 -37
- package/dist/components/inputNumber/JaInputNumber.vue.js.map +1 -1
- package/dist/components/radioGroup/JaRadioGroup.vue.d.ts +148 -121
- package/dist/components/radioGroup/JaRadioGroup.vue.d.ts.map +1 -1
- package/dist/components/radioGroup/JaRadioGroup.vue.js +14 -5
- package/dist/components/radioGroup/JaRadioGroup.vue.js.map +1 -1
- package/dist/components/scrollbar/Scrollbar.vue.d.ts +5 -2
- package/dist/components/scrollbar/Scrollbar.vue.d.ts.map +1 -1
- package/dist/components/scrollbar/Scrollbar.vue.js +11 -3
- package/dist/components/scrollbar/Scrollbar.vue.js.map +1 -1
- package/dist/components/select/JaSelect.vue.d.ts +70 -70
- package/dist/components/select/JaSelect.vue.js +14 -5
- package/dist/components/select/JaSelect.vue.js.map +1 -1
- package/dist/components/switch/JaSwitch.vue.d.ts +174 -205
- package/dist/components/switch/JaSwitch.vue.d.ts.map +1 -1
- package/dist/components/switch/JaSwitch.vue.js +13 -4
- package/dist/components/switch/JaSwitch.vue.js.map +1 -1
- package/dist/components/timePicker/JaTimePicker.vue.d.ts +5 -2
- package/dist/components/timePicker/JaTimePicker.vue.d.ts.map +1 -1
- package/dist/components/timePicker/JaTimePicker.vue.js +18 -7
- package/dist/components/timePicker/JaTimePicker.vue.js.map +1 -1
- package/dist/components/tip/index.d.ts +3 -12
- package/dist/components/tip/index.d.ts.map +1 -1
- package/dist/components/tip/src/AceTip.vue.d.ts +9 -3
- package/dist/components/tip/src/AceTip.vue.d.ts.map +1 -1
- package/dist/components/tip/src/AceTip.vue.js.map +1 -1
- package/dist/components/upload/JaUploader.vue.d.ts +74 -14
- package/dist/components/upload/JaUploader.vue.d.ts.map +1 -1
- package/dist/components/upload/JaUploader.vue.js +3 -5
- package/dist/components/upload/JaUploader.vue.js.map +1 -1
- package/dist/components/upload/index.d.ts +79 -25
- package/dist/components/upload/index.d.ts.map +1 -1
- package/dist/components/upload/uploader.vue.d.ts +16 -0
- package/dist/components/upload/uploader.vue.d.ts.map +1 -1
- package/dist/components/upload/uploader.vue.js +137 -95
- package/dist/components/upload/uploader.vue.js.map +1 -1
- package/dist/components/userGroupTree/src/userGroupTree.vue.d.ts +50 -36
- package/dist/components/userGroupTree/src/userGroupTree.vue.d.ts.map +1 -1
- package/dist/components/userGroupTree/src/userGroupTree.vue.js +26 -1
- package/dist/components/userGroupTree/src/userGroupTree.vue.js.map +1 -1
- package/lib/index.css +2 -2
- package/lib/index.js +8291 -7887
- package/lib/index.umd.cjs +36 -36
- package/package.json +2 -2
- package/packages/components/autoComplete/JaAutoComplete.vue +19 -9
- package/packages/components/autoComplete/README.md +35 -0
- package/packages/components/avatar/JaAvatar.vue +16 -7
- package/packages/components/avatar/README.md +45 -0
- package/packages/components/button/JaButton.vue +32 -7
- package/packages/components/button/README.md +57 -0
- package/packages/components/checkbox/JaCheckbox.vue +15 -25
- package/packages/components/checkbox/README.md +21 -0
- package/packages/components/checkboxGroup/JaCheckboxGroup.vue +16 -5
- package/packages/components/checkboxGroup/README.md +24 -0
- package/packages/components/datePicker/JaDatePicker.vue +23 -10
- package/packages/components/datePicker/README.md +21 -0
- package/packages/components/dropdownButton/JaDropdownButton.vue +25 -7
- package/packages/components/dropdownButton/README.md +30 -0
- package/packages/components/form/JaForm.vue +60 -20
- package/packages/components/form/README.md +30 -0
- package/packages/components/formItem/JaFormItem.vue +43 -7
- package/packages/components/formItem/README.md +28 -0
- package/packages/components/input/JaInput.vue +30 -66
- package/packages/components/input/README.md +23 -0
- package/packages/components/inputNumber/JaInputNumber.vue +25 -45
- package/packages/components/inputNumber/README.md +21 -0
- package/packages/components/radioGroup/JaRadioGroup.vue +16 -5
- package/packages/components/radioGroup/README.md +24 -0
- package/packages/components/scrollbar/README.md +23 -0
- package/packages/components/scrollbar/Scrollbar.vue +14 -3
- package/packages/components/select/JaSelect.vue +22 -10
- package/packages/components/select/README.md +24 -0
- package/packages/components/switch/JaSwitch.vue +16 -5
- package/packages/components/switch/README.md +21 -0
- package/packages/components/timePicker/JaTimePicker.vue +21 -8
- package/packages/components/timePicker/README.md +21 -0
- package/packages/components/tip/README.md +20 -0
- package/packages/components/tip/src/AceTip.vue +10 -2
- package/packages/components/upload/JaUploader.vue +9 -8
- package/packages/components/upload/README.md +24 -0
- package/packages/components/upload/uploader.vue +95 -58
- package/packages/components/userGroupTree/src/userGroupTree.vue +9 -2
|
@@ -1,13 +1,16 @@
|
|
|
1
1
|
<script setup lang="ts">
|
|
2
2
|
import {
|
|
3
|
+
type ClassificationLevel,
|
|
3
4
|
createAxiosWithoutCache,
|
|
4
|
-
type FileInfo,
|
|
5
|
+
type FileInfo,
|
|
6
|
+
Jari,
|
|
7
|
+
type UploadInitParams,
|
|
5
8
|
useFilesApi,
|
|
6
|
-
|
|
7
|
-
|
|
9
|
+
useLoading,
|
|
10
|
+
useLoginUser
|
|
8
11
|
} from "@jari-ace/app-bolts";
|
|
9
12
|
import { nextTick, onMounted, onUnmounted, ref, watch } from "vue";
|
|
10
|
-
import { ArrowDown, Download, Upload } from "@element-plus/icons-vue";
|
|
13
|
+
import { ArrowDown, Download, Upload, WarningFilled } from "@element-plus/icons-vue";
|
|
11
14
|
import {
|
|
12
15
|
useSystemClassificationLevelMap,
|
|
13
16
|
useSystemClassificationLevels
|
|
@@ -67,7 +70,23 @@ const props = defineProps<{
|
|
|
67
70
|
/**
|
|
68
71
|
* 文件列表最大高度
|
|
69
72
|
*/
|
|
70
|
-
maxHeight?: string | number
|
|
73
|
+
maxHeight?: string | number,
|
|
74
|
+
/**
|
|
75
|
+
* 是否允许上传, 为空表示采用应用里的附件设置
|
|
76
|
+
*/
|
|
77
|
+
allowUpload?: boolean,
|
|
78
|
+
/**
|
|
79
|
+
* 是否允许下载,为空表示采用应用里的附件设置
|
|
80
|
+
*/
|
|
81
|
+
allowDownload?: boolean,
|
|
82
|
+
/**
|
|
83
|
+
* 是否允许删除,为空表示采用应用里的附件设置
|
|
84
|
+
*/
|
|
85
|
+
allowDelete?: boolean,
|
|
86
|
+
/**
|
|
87
|
+
* 是否允许预览,为空表示采用应用里的附件设置
|
|
88
|
+
*/
|
|
89
|
+
allowPreview?: boolean,
|
|
71
90
|
}>();
|
|
72
91
|
const attachId = defineModel<string>({
|
|
73
92
|
required: false
|
|
@@ -79,6 +98,7 @@ const files = ref<FileInfo[]>([]);
|
|
|
79
98
|
const classificationLevels = ref<ClassificationLevel[]>([]);
|
|
80
99
|
const allowedClassificationLevels = ref<ClassificationLevel[]>([]);
|
|
81
100
|
const classificationLevelMap = ref<Map<number, string>>();
|
|
101
|
+
const highestClassificationLevel = ref<number>();
|
|
82
102
|
const user = ref<Ace.User>();
|
|
83
103
|
const selectedFileClassificationLevel = ref(50);
|
|
84
104
|
const curAttachToken = ref<string>();
|
|
@@ -151,18 +171,7 @@ let uppy: Uppy | undefined;
|
|
|
151
171
|
curAttachToken.value = props.attachToken;
|
|
152
172
|
|
|
153
173
|
onMounted(async () => {
|
|
154
|
-
|
|
155
|
-
const cl = Math.max(props.classificationLevel ?? 50, user.value?.classifiedLevel ?? 50);
|
|
156
|
-
classificationLevels.value = await useSystemClassificationLevels();
|
|
157
|
-
classificationLevelMap.value = await useSystemClassificationLevelMap();
|
|
158
|
-
allowedClassificationLevels.value = classificationLevels.value.filter(l => l.value >= cl);
|
|
159
|
-
console.log(`附件控件密级调试:
|
|
160
|
-
表单密级:`, props.classificationLevel, `
|
|
161
|
-
用户密级:`, user.value?.classifiedLevel, `
|
|
162
|
-
表单/用户密级比较后取最低密级:`, cl, `
|
|
163
|
-
系统密级:`, classificationLevels.value, `
|
|
164
|
-
最终可选密级:`, allowedClassificationLevels.value
|
|
165
|
-
)
|
|
174
|
+
await updateAllowedClassificationLevels();
|
|
166
175
|
if (props.attachToken) {
|
|
167
176
|
await initLoad();
|
|
168
177
|
} else {
|
|
@@ -175,6 +184,22 @@ onUnmounted(() => {
|
|
|
175
184
|
uppy = undefined;
|
|
176
185
|
});
|
|
177
186
|
|
|
187
|
+
async function updateAllowedClassificationLevels() {
|
|
188
|
+
user.value = useLoginUser();
|
|
189
|
+
const cl = Math.max(props.classificationLevel ?? 50, user.value?.classifiedLevel ?? 50);
|
|
190
|
+
classificationLevels.value = await useSystemClassificationLevels();
|
|
191
|
+
classificationLevelMap.value = await useSystemClassificationLevelMap();
|
|
192
|
+
allowedClassificationLevels.value = classificationLevels.value.filter(l => l.value >= cl);
|
|
193
|
+
highestClassificationLevel.value = Math.min(...allowedClassificationLevels.value.map(l=>l.value))
|
|
194
|
+
console.log(`附件控件密级调试:
|
|
195
|
+
表单密级:`, props.classificationLevel, `
|
|
196
|
+
用户密级:`, user.value?.classifiedLevel, `
|
|
197
|
+
表单/用户密级比较后取最低密级:`, cl, `
|
|
198
|
+
系统密级:`, classificationLevels.value, `
|
|
199
|
+
最终可选密级:`, allowedClassificationLevels.value
|
|
200
|
+
);
|
|
201
|
+
}
|
|
202
|
+
|
|
178
203
|
async function loadFileInfos() {
|
|
179
204
|
if (!curAttachToken.value) {
|
|
180
205
|
files.value = [];
|
|
@@ -393,66 +418,71 @@ async function downloadAll() {
|
|
|
393
418
|
}
|
|
394
419
|
|
|
395
420
|
function checkAllowUpload() {
|
|
396
|
-
|
|
397
|
-
|
|
398
|
-
|
|
399
|
-
|
|
400
|
-
|
|
401
|
-
|
|
402
|
-
|
|
421
|
+
if (props.allowUpload == undefined) {
|
|
422
|
+
const cfg = uploadInitParams.value?.fileConfig;
|
|
423
|
+
if (cfg) {
|
|
424
|
+
let hasRole = true;
|
|
425
|
+
if (cfg.uploadAuthCode) {
|
|
426
|
+
const login = useLoginUser();
|
|
427
|
+
if (login) {
|
|
428
|
+
hasRole = login.hasRole(cfg.uploadAuthCode);
|
|
429
|
+
}
|
|
430
|
+
return !cfg.disallowUpload && hasRole;
|
|
403
431
|
}
|
|
404
|
-
return !cfg.disallowUpload
|
|
432
|
+
return !cfg.disallowUpload;
|
|
405
433
|
}
|
|
406
|
-
|
|
434
|
+
console.log('file cfg is null')
|
|
407
435
|
}
|
|
408
|
-
|
|
409
|
-
return false;
|
|
436
|
+
return props.allowUpload;
|
|
410
437
|
}
|
|
411
438
|
|
|
412
439
|
function checkAllowDownload() {
|
|
413
|
-
|
|
414
|
-
|
|
415
|
-
|
|
416
|
-
|
|
417
|
-
|
|
418
|
-
|
|
419
|
-
|
|
440
|
+
if (props.allowDownload == undefined) {
|
|
441
|
+
const cfg = uploadInitParams.value?.fileConfig;
|
|
442
|
+
if (cfg) {
|
|
443
|
+
let hasRole = true;
|
|
444
|
+
if (cfg.downloadAuthCode) {
|
|
445
|
+
const login = useLoginUser();
|
|
446
|
+
if (login) {
|
|
447
|
+
hasRole = login.hasRole(cfg.downloadAuthCode);
|
|
448
|
+
}
|
|
449
|
+
return !cfg.disallowDownload && hasRole;
|
|
420
450
|
}
|
|
421
|
-
return !cfg.disallowDownload
|
|
451
|
+
return !cfg.disallowDownload;
|
|
422
452
|
}
|
|
423
|
-
return !cfg.disallowDownload;
|
|
424
453
|
}
|
|
425
|
-
return
|
|
454
|
+
return props.allowDownload;
|
|
426
455
|
}
|
|
427
456
|
|
|
428
457
|
function checkAllowDelete() {
|
|
429
|
-
|
|
430
|
-
|
|
431
|
-
|
|
432
|
-
|
|
433
|
-
|
|
434
|
-
|
|
435
|
-
|
|
458
|
+
if (props.allowDelete == undefined) {
|
|
459
|
+
const cfg = uploadInitParams.value?.fileConfig;
|
|
460
|
+
if (cfg) {
|
|
461
|
+
let hasRole = true;
|
|
462
|
+
if (cfg.deleteAuthCode) {
|
|
463
|
+
const login = useLoginUser();
|
|
464
|
+
if (login) {
|
|
465
|
+
hasRole = login.hasRole(cfg.deleteAuthCode);
|
|
466
|
+
}
|
|
467
|
+
return !cfg.disallowDelete && hasRole;
|
|
436
468
|
}
|
|
437
|
-
return !cfg.disallowDelete
|
|
469
|
+
return !cfg.disallowDelete;
|
|
438
470
|
}
|
|
439
|
-
return !cfg.disallowDelete;
|
|
440
471
|
}
|
|
441
|
-
return
|
|
472
|
+
return props.allowDelete;
|
|
442
473
|
}
|
|
443
474
|
|
|
444
475
|
function checkAllowPreview(file: FileInfo) {
|
|
445
|
-
|
|
446
|
-
|
|
447
|
-
if (cfg
|
|
448
|
-
|
|
449
|
-
|
|
450
|
-
|
|
451
|
-
return
|
|
476
|
+
if (props.allowPreview == undefined) {
|
|
477
|
+
const cfg = uploadInitParams.value?.fileConfig;
|
|
478
|
+
if (cfg) {
|
|
479
|
+
if (cfg.disablePreview) {
|
|
480
|
+
return false;
|
|
481
|
+
}
|
|
482
|
+
return previewableFileExts.some(ext => file.fileName.endsWith(ext));
|
|
452
483
|
}
|
|
453
|
-
return true;
|
|
454
484
|
}
|
|
455
|
-
return
|
|
485
|
+
return props.allowPreview;
|
|
456
486
|
}
|
|
457
487
|
|
|
458
488
|
watch(() => props.attachToken, () => {
|
|
@@ -463,6 +493,8 @@ watch(() => props.attachToken, () => {
|
|
|
463
493
|
}
|
|
464
494
|
});
|
|
465
495
|
|
|
496
|
+
watch(()=> props.classificationLevel, updateAllowedClassificationLevels)
|
|
497
|
+
|
|
466
498
|
</script>
|
|
467
499
|
|
|
468
500
|
<template>
|
|
@@ -506,12 +538,17 @@ watch(() => props.attachToken, () => {
|
|
|
506
538
|
{{ prettyBytes(scope.row.fileSize) }}
|
|
507
539
|
</template>
|
|
508
540
|
</el-table-column>
|
|
509
|
-
<el-table-column prop="classifiedLevel" width="
|
|
541
|
+
<el-table-column prop="classifiedLevel" width="80">
|
|
510
542
|
<template #default="scope">
|
|
511
543
|
<el-tag
|
|
512
544
|
:type="scope.row.classifiedLevel < 50 ? (scope.row.classifiedLevel < 30 ? 'danger' : 'warning') : 'info'">
|
|
513
545
|
{{ classificationLevelMap?.get(scope.row.classifiedLevel) }}
|
|
514
546
|
</el-tag>
|
|
547
|
+
<el-tooltip v-if="scope.row.classifiedLevel < highestClassificationLevel" content="文件密级已高于当前许可范围,请立即删除">
|
|
548
|
+
<el-icon color="#F56C6C">
|
|
549
|
+
<warning-filled/>
|
|
550
|
+
</el-icon>
|
|
551
|
+
</el-tooltip>
|
|
515
552
|
</template>
|
|
516
553
|
</el-table-column>
|
|
517
554
|
<el-table-column align="right" width="150" fixed="right">
|
|
@@ -10,7 +10,14 @@
|
|
|
10
10
|
:expand-on-click-node="false"
|
|
11
11
|
v-bind="$attrs" @current-change="currentChange" :props="{
|
|
12
12
|
class: (node: TreeNodeData) => selected?.id === node.id ? 'selected-group' : 'group',
|
|
13
|
-
}"
|
|
13
|
+
}">
|
|
14
|
+
|
|
15
|
+
<template #default="{ data }">
|
|
16
|
+
<div>
|
|
17
|
+
<div class="name">{{ data.label }} <el-tag v-if="data.resourceScoped" type="info">资源域</el-tag></div>
|
|
18
|
+
</div>
|
|
19
|
+
</template>
|
|
20
|
+
</el-tree>
|
|
14
21
|
</div>
|
|
15
22
|
</template>
|
|
16
23
|
|
|
@@ -24,7 +31,7 @@ import {
|
|
|
24
31
|
useUserGroupApi,
|
|
25
32
|
} from "@jari-ace/app-bolts";
|
|
26
33
|
import {type TreeNodeType, useTreeData} from "../../../hooks/useTreeData";
|
|
27
|
-
import {ElOption, ElSelect, ElTree, vLoading} from "element-plus";
|
|
34
|
+
import {ElOption, ElSelect, ElTree, vLoading, ElTag} from "element-plus";
|
|
28
35
|
import type {TreeNodeData} from "element-plus/es/components/tree/src/tree.type";
|
|
29
36
|
import {useAppInstances} from "../../../hooks/useAppInstances";
|
|
30
37
|
import {useGroups} from "../../../hooks/useGroups";
|