@jari-ace/element-plus-component 0.2.3 → 0.3.1
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 +18 -18
- package/dist/components/button/JaButton.vue.d.ts +24 -24
- package/dist/components/customGroupTree/src/customGroupTree.vue.d.ts +1 -1
- package/dist/components/departmentPicker/src/DepartmentPicker.vue.d.ts +2 -2
- package/dist/components/departmentTree/src/departmentTree.vue.d.ts +1 -1
- package/dist/components/dropdownButton/JaDropdownButton.vue.d.ts +55 -55
- package/dist/components/enumList/EnumListInput.vue.d.ts +2 -2
- package/dist/components/enumPicker/src/EnumPicker.vue.d.ts +1 -1
- package/dist/components/form/JaForm.vue.d.ts +1 -1
- package/dist/components/formItem/JaFormItem.vue.d.ts +12 -12
- package/dist/components/input/JaInput.vue.d.ts +18 -18
- package/dist/components/inputI18n/I18nBundleEditor.vue.d.ts +1 -1
- package/dist/components/inputI18n/InputI18n.vue.d.ts +2 -2
- package/dist/components/inputI18n/JaInputI18n.vue.d.ts +70 -70
- package/dist/components/inputNumber/JaInputNumber.vue.d.ts +12 -12
- package/dist/components/mapItemList/MapItemListInput.vue.d.ts +2 -2
- package/dist/components/numberList/NumberListInput.vue.d.ts +2 -2
- package/dist/components/rolePicker/RoleEditor.vue.d.ts +1 -1
- package/dist/components/rolePicker/baseRolePicker.vue.d.ts +1 -1
- package/dist/components/scrollbar/Scrollbar.vue.d.ts +8 -8
- package/dist/components/select/JaSelect.vue.d.ts +70 -70
- package/dist/components/stringList/StringListInput.vue.d.ts +2 -2
- package/dist/components/tip/index.d.ts +6 -6
- package/dist/components/tip/src/AceTip.vue.d.ts +1 -1
- package/dist/components/upload/JaUploader.vue.d.ts +85 -0
- package/dist/components/upload/JaUploader.vue.d.ts.map +1 -0
- package/dist/components/upload/JaUploader.vue.js +85 -0
- package/dist/components/upload/JaUploader.vue.js.map +1 -0
- package/dist/components/upload/index.d.ts +25 -4
- package/dist/components/upload/index.d.ts.map +1 -1
- package/dist/components/upload/index.js +2 -4
- package/dist/components/upload/index.js.map +1 -1
- package/dist/components/upload/pdf-viewer/PdfViewerModal.vue.d.ts +27 -0
- package/dist/components/upload/pdf-viewer/PdfViewerModal.vue.d.ts.map +1 -0
- package/dist/components/upload/pdf-viewer/PdfViewerModal.vue.js +94 -0
- package/dist/components/upload/pdf-viewer/PdfViewerModal.vue.js.map +1 -0
- package/dist/components/upload/uploader-locale-zh-cn.d.ts +223 -0
- package/dist/components/upload/uploader-locale-zh-cn.d.ts.map +1 -0
- package/dist/components/upload/uploader-locale-zh-cn.js +224 -0
- package/dist/components/upload/uploader-locale-zh-cn.js.map +1 -0
- package/dist/components/upload/uploader.vue.d.ts +44 -0
- package/dist/components/upload/uploader.vue.d.ts.map +1 -0
- package/dist/components/upload/uploader.vue.js +721 -0
- package/dist/components/upload/uploader.vue.js.map +1 -0
- package/dist/components/userGroupPicker/src/UserGroupPicker.vue.d.ts +2 -2
- package/dist/components/userPicker/src/UserPicker.vue.d.ts +3 -3
- package/dist/components/userSelectDialog/src/userSelectDialog.vue.d.ts +1 -1
- package/dist/components/userTag/UserInfoTag.vue.d.ts +2 -2
- package/lib/index.css +9 -1
- package/lib/index.js +37353 -2739
- package/lib/index.umd.cjs +407 -2
- package/package.json +14 -5
- package/packages/components/upload/JaUploader.vue +71 -0
- package/packages/components/upload/index.ts +2 -5
- package/packages/components/upload/pdf-viewer/PdfViewerModal.vue +32 -0
- package/packages/components/upload/uploader-locale-zh-cn.ts +223 -0
- package/packages/components/upload/uploader.vue +515 -0
- package/packages/components/upload/src/Upload.vue +0 -25
- package/packages/components/upload/src/type.ts +0 -3
|
@@ -0,0 +1,721 @@
|
|
|
1
|
+
import { createAxiosWithoutCache, Jari, useFilesApi, useLoginUser, useLoading } from "@jari-ace/app-bolts";
|
|
2
|
+
import { nextTick, onMounted, onUnmounted, ref, watch } from "vue";
|
|
3
|
+
import { ArrowDown, Download, Upload } from "@element-plus/icons-vue";
|
|
4
|
+
import { useSystemClassificationLevelMap, useSystemClassificationLevels } from "../../hooks/useClassificationLevels";
|
|
5
|
+
var Ace = Jari.Ace;
|
|
6
|
+
import { ElMessageBox } from "element-plus";
|
|
7
|
+
import "@uppy/core/css/style.min.css";
|
|
8
|
+
import "@uppy/dashboard/css/style.min.css";
|
|
9
|
+
import "@uppy/audio/css/style.min.css";
|
|
10
|
+
import "@uppy/screen-capture/css/style.min.css";
|
|
11
|
+
import "@uppy/webcam/css/style.min.css";
|
|
12
|
+
import "@uppy/image-editor/css/style.min.css";
|
|
13
|
+
import Uppy from "@uppy/core";
|
|
14
|
+
import Tus from "@uppy/tus";
|
|
15
|
+
import Webcam from "@uppy/webcam";
|
|
16
|
+
import ScreenCapture from "@uppy/screen-capture";
|
|
17
|
+
import Audio from "@uppy/audio";
|
|
18
|
+
import zhCN from "./uploader-locale-zh-cn";
|
|
19
|
+
import Dashboard from "@uppy/dashboard";
|
|
20
|
+
import ImageEditor from "@uppy/image-editor";
|
|
21
|
+
import prettyBytes from "pretty-bytes";
|
|
22
|
+
import PdfViewerModal from "./pdf-viewer/PdfViewerModal.vue";
|
|
23
|
+
import { ElTable, ElTableColumn, ElButton, ElDropdown, ElDropdownItem, ElDropdownMenu, ElIcon, ElTag } from "element-plus";
|
|
24
|
+
const props = defineProps();
|
|
25
|
+
const attachId = defineModel({
|
|
26
|
+
required: false
|
|
27
|
+
});
|
|
28
|
+
const axios = createAxiosWithoutCache();
|
|
29
|
+
const loading = useLoading(axios);
|
|
30
|
+
const api = useFilesApi(axios);
|
|
31
|
+
const files = ref([]);
|
|
32
|
+
const classificationLevels = ref([]);
|
|
33
|
+
const allowedClassificationLevels = ref([]);
|
|
34
|
+
const classificationLevelMap = ref();
|
|
35
|
+
const user = ref();
|
|
36
|
+
const selectedFileClassificationLevel = ref(50);
|
|
37
|
+
const curAttachToken = ref();
|
|
38
|
+
const uploadInitParams = ref();
|
|
39
|
+
const isNewForm = ref(false);
|
|
40
|
+
const uploadingProgress = ref(100);
|
|
41
|
+
const pdfViewerVisible = ref(false);
|
|
42
|
+
const pdfSrc = ref("");
|
|
43
|
+
const previewableFileExts = [".doc", ".docx", ".xls", ".xlsx", ".wps", ".et",
|
|
44
|
+
".csv", ".txt", ".rtf", ".odt", "ods", ".mht", ".ppt", ".pptx", ".odp", ".pdf", "xps", "."];
|
|
45
|
+
const emits = defineEmits(['change']);
|
|
46
|
+
let uppy;
|
|
47
|
+
curAttachToken.value = props.attachToken;
|
|
48
|
+
onMounted(async () => {
|
|
49
|
+
user.value = useLoginUser();
|
|
50
|
+
const cl = Math.max(props.classificationLevel ?? 50, user.value?.classifiedLevel ?? 50);
|
|
51
|
+
classificationLevels.value = await useSystemClassificationLevels();
|
|
52
|
+
classificationLevelMap.value = await useSystemClassificationLevelMap();
|
|
53
|
+
allowedClassificationLevels.value = classificationLevels.value.filter(l => l.value >= cl);
|
|
54
|
+
if (props.attachToken) {
|
|
55
|
+
await initLoad();
|
|
56
|
+
}
|
|
57
|
+
else {
|
|
58
|
+
await initNew();
|
|
59
|
+
}
|
|
60
|
+
});
|
|
61
|
+
onUnmounted(() => {
|
|
62
|
+
if (uppy)
|
|
63
|
+
uppy.destroy();
|
|
64
|
+
uppy = undefined;
|
|
65
|
+
});
|
|
66
|
+
async function loadFileInfos() {
|
|
67
|
+
if (!curAttachToken.value) {
|
|
68
|
+
files.value = [];
|
|
69
|
+
}
|
|
70
|
+
files.value = await api.getFileList(curAttachToken.value);
|
|
71
|
+
}
|
|
72
|
+
function createUppyInstance() {
|
|
73
|
+
if (uppy) {
|
|
74
|
+
uppy.destroy();
|
|
75
|
+
}
|
|
76
|
+
const cfg = uploadInitParams.value.fileConfig;
|
|
77
|
+
uppy = new Uppy({
|
|
78
|
+
autoProceed: true,
|
|
79
|
+
locale: zhCN
|
|
80
|
+
}).on("progress", progress => {
|
|
81
|
+
if (progress == 100) {
|
|
82
|
+
loadFileInfos();
|
|
83
|
+
}
|
|
84
|
+
uploadingProgress.value = progress;
|
|
85
|
+
});
|
|
86
|
+
uppy.use(Tus, {
|
|
87
|
+
endpoint: new URL("/ace-file-service/uploads", location.origin).toString(),
|
|
88
|
+
withCredentials: true,
|
|
89
|
+
retryDelays: undefined,
|
|
90
|
+
chunkSize: !uploadInitParams.value?.chunkSize || uploadInitParams.value?.chunkSize
|
|
91
|
+
== 0 ? Infinity : uploadInitParams.value?.chunkSize,
|
|
92
|
+
parallelUploads: 1,
|
|
93
|
+
headers: {
|
|
94
|
+
aceAttachId: attachId.value,
|
|
95
|
+
aceNewForm: isNewForm.value ? "yes" : "no"
|
|
96
|
+
},
|
|
97
|
+
metadata: {
|
|
98
|
+
attachId: attachId.value,
|
|
99
|
+
configKey: props.configKey,
|
|
100
|
+
appServiceName: props.serviceName,
|
|
101
|
+
classifiedLevel: selectedFileClassificationLevel.value.toString()
|
|
102
|
+
},
|
|
103
|
+
metadataForPartialUploads: {
|
|
104
|
+
attachId: attachId.value,
|
|
105
|
+
configKey: props.configKey,
|
|
106
|
+
appServiceName: props.serviceName,
|
|
107
|
+
classifiedLevel: selectedFileClassificationLevel.value.toString()
|
|
108
|
+
}
|
|
109
|
+
});
|
|
110
|
+
if (cfg.enableWebcam) {
|
|
111
|
+
uppy.use(Webcam, {
|
|
112
|
+
// Webcam 的相关配置
|
|
113
|
+
modes: cfg.allowedWebcamModes?.map(m => {
|
|
114
|
+
switch (m) {
|
|
115
|
+
case "VIDEO_AUDIO":
|
|
116
|
+
return "video-audio";
|
|
117
|
+
case "VIDEO_ONLY":
|
|
118
|
+
return "video-only";
|
|
119
|
+
case "PICTURE":
|
|
120
|
+
return "picture";
|
|
121
|
+
}
|
|
122
|
+
}),
|
|
123
|
+
mirror: false
|
|
124
|
+
});
|
|
125
|
+
}
|
|
126
|
+
if (cfg.enableAudio) {
|
|
127
|
+
uppy.use(Audio);
|
|
128
|
+
}
|
|
129
|
+
if (cfg.enableScreenCapture) {
|
|
130
|
+
uppy.use(ScreenCapture);
|
|
131
|
+
}
|
|
132
|
+
let selectionType;
|
|
133
|
+
if (cfg.disableFileUpload) {
|
|
134
|
+
if (cfg.disableDirUpload) {
|
|
135
|
+
selectionType = undefined;
|
|
136
|
+
}
|
|
137
|
+
else {
|
|
138
|
+
selectionType = "folders";
|
|
139
|
+
}
|
|
140
|
+
}
|
|
141
|
+
else {
|
|
142
|
+
if (cfg.disableDirUpload) {
|
|
143
|
+
selectionType = "files";
|
|
144
|
+
}
|
|
145
|
+
else {
|
|
146
|
+
selectionType = "both";
|
|
147
|
+
}
|
|
148
|
+
}
|
|
149
|
+
uppy.use(Dashboard, {
|
|
150
|
+
inline: false,
|
|
151
|
+
note: cfg.uploadNote,
|
|
152
|
+
proudlyDisplayPoweredByUppy: false,
|
|
153
|
+
fileManagerSelectionType: selectionType,
|
|
154
|
+
singleFileFullScreen: false,
|
|
155
|
+
disableLocalFiles: cfg.disableFileUpload ?? false,
|
|
156
|
+
closeAfterFinish: true,
|
|
157
|
+
closeModalOnClickOutside: true
|
|
158
|
+
}).use(ImageEditor);
|
|
159
|
+
}
|
|
160
|
+
async function onUploadBtnClick() {
|
|
161
|
+
const cfg = uploadInitParams.value?.fileConfig;
|
|
162
|
+
if (cfg) {
|
|
163
|
+
uppy?.setMeta({
|
|
164
|
+
attachId: attachId.value,
|
|
165
|
+
configKey: props.configKey,
|
|
166
|
+
appServiceName: props.serviceName,
|
|
167
|
+
classifiedLevel: selectedFileClassificationLevel.value.toString()
|
|
168
|
+
});
|
|
169
|
+
const dashboard = uppy?.getPlugin("Dashboard");
|
|
170
|
+
if (dashboard) {
|
|
171
|
+
dashboard.setOptions({
|
|
172
|
+
note: (cfg.uploadNote ? cfg.uploadNote : "")
|
|
173
|
+
+ `(正在上传${classificationLevelMap.value?.get(selectedFileClassificationLevel.value)}文件)`
|
|
174
|
+
});
|
|
175
|
+
}
|
|
176
|
+
dashboard?.openModal();
|
|
177
|
+
}
|
|
178
|
+
else {
|
|
179
|
+
ElMessageBox.alert("无法找到附件配置" + props.configKey, "错误");
|
|
180
|
+
}
|
|
181
|
+
}
|
|
182
|
+
function handleClassificationLevelSelCmd(level) {
|
|
183
|
+
selectedFileClassificationLevel.value = level;
|
|
184
|
+
uppy?.setMeta({
|
|
185
|
+
attachId: attachId.value,
|
|
186
|
+
configKey: props.configKey,
|
|
187
|
+
appServiceName: props.serviceName,
|
|
188
|
+
classifiedLevel: selectedFileClassificationLevel.value.toString()
|
|
189
|
+
});
|
|
190
|
+
const dashboard = uppy?.getPlugin("Dashboard");
|
|
191
|
+
if (dashboard) {
|
|
192
|
+
const cfg = uploadInitParams.value?.fileConfig;
|
|
193
|
+
if (cfg) {
|
|
194
|
+
dashboard.setOptions({
|
|
195
|
+
note: (cfg.uploadNote ? cfg.uploadNote : "")
|
|
196
|
+
+ `(正在上传${classificationLevelMap.value?.get(selectedFileClassificationLevel.value)}文件)`
|
|
197
|
+
});
|
|
198
|
+
}
|
|
199
|
+
dashboard?.openModal();
|
|
200
|
+
}
|
|
201
|
+
}
|
|
202
|
+
async function initLoad() {
|
|
203
|
+
uploadInitParams.value = await api.initLoad(props.serviceName, props.configKey, props.attachToken);
|
|
204
|
+
files.value = uploadInitParams.value.files;
|
|
205
|
+
attachId.value = uploadInitParams.value?.attachId;
|
|
206
|
+
curAttachToken.value = uploadInitParams.value?.attachId;
|
|
207
|
+
isNewForm.value = false;
|
|
208
|
+
await nextTick();
|
|
209
|
+
createUppyInstance();
|
|
210
|
+
}
|
|
211
|
+
async function initNew() {
|
|
212
|
+
uploadInitParams.value = await api.initNew(props.serviceName, props.configKey);
|
|
213
|
+
files.value = uploadInitParams.value.files;
|
|
214
|
+
attachId.value = uploadInitParams.value?.attachId;
|
|
215
|
+
curAttachToken.value = uploadInitParams.value?.attachToken;
|
|
216
|
+
isNewForm.value = true;
|
|
217
|
+
emits('change', attachId.value);
|
|
218
|
+
await nextTick();
|
|
219
|
+
createUppyInstance();
|
|
220
|
+
}
|
|
221
|
+
async function delUploadedFile(file) {
|
|
222
|
+
await api.deleteFile(file.token || file.id);
|
|
223
|
+
files.value = files.value.filter(f => f.id !== file.id);
|
|
224
|
+
}
|
|
225
|
+
function previewFile(fileToken) {
|
|
226
|
+
pdfSrc.value = new URL("uploads/preview/" + fileToken, location.origin).toString();
|
|
227
|
+
pdfViewerVisible.value = true;
|
|
228
|
+
}
|
|
229
|
+
function downloadFile(fileToken) {
|
|
230
|
+
api.downloadFile(fileToken);
|
|
231
|
+
}
|
|
232
|
+
function viewUppyDashboard() {
|
|
233
|
+
const dashboard = uppy?.getPlugin("Dashboard");
|
|
234
|
+
if (dashboard) {
|
|
235
|
+
dashboard.openModal();
|
|
236
|
+
}
|
|
237
|
+
}
|
|
238
|
+
function downloadAll() {
|
|
239
|
+
if (!curAttachToken.value) {
|
|
240
|
+
return;
|
|
241
|
+
}
|
|
242
|
+
api.downloadZipFile(curAttachToken.value);
|
|
243
|
+
}
|
|
244
|
+
function checkAllowUpload() {
|
|
245
|
+
const cfg = uploadInitParams.value?.fileConfig;
|
|
246
|
+
if (cfg) {
|
|
247
|
+
let hasRole = true;
|
|
248
|
+
if (cfg.uploadAuthCode) {
|
|
249
|
+
const login = useLoginUser();
|
|
250
|
+
if (login) {
|
|
251
|
+
hasRole = login.hasRole(cfg.uploadAuthCode);
|
|
252
|
+
}
|
|
253
|
+
return !cfg.disallowUpload && hasRole;
|
|
254
|
+
}
|
|
255
|
+
return !cfg.disallowUpload;
|
|
256
|
+
}
|
|
257
|
+
console.log('file cfg is null');
|
|
258
|
+
return false;
|
|
259
|
+
}
|
|
260
|
+
function checkAllowDownload() {
|
|
261
|
+
const cfg = uploadInitParams.value?.fileConfig;
|
|
262
|
+
if (cfg) {
|
|
263
|
+
let hasRole = true;
|
|
264
|
+
if (cfg.downloadAuthCode) {
|
|
265
|
+
const login = useLoginUser();
|
|
266
|
+
if (login) {
|
|
267
|
+
hasRole = login.hasRole(cfg.downloadAuthCode);
|
|
268
|
+
}
|
|
269
|
+
return !cfg.disallowDownload && hasRole;
|
|
270
|
+
}
|
|
271
|
+
return !cfg.disallowDownload;
|
|
272
|
+
}
|
|
273
|
+
return false;
|
|
274
|
+
}
|
|
275
|
+
function checkAllowDelete() {
|
|
276
|
+
const cfg = uploadInitParams.value?.fileConfig;
|
|
277
|
+
if (cfg) {
|
|
278
|
+
let hasRole = true;
|
|
279
|
+
if (cfg.deleteAuthCode) {
|
|
280
|
+
const login = useLoginUser();
|
|
281
|
+
if (login) {
|
|
282
|
+
hasRole = login.hasRole(cfg.deleteAuthCode);
|
|
283
|
+
}
|
|
284
|
+
return !cfg.disallowDelete && hasRole;
|
|
285
|
+
}
|
|
286
|
+
return !cfg.disallowDelete;
|
|
287
|
+
}
|
|
288
|
+
return false;
|
|
289
|
+
}
|
|
290
|
+
function checkAllowPreview(file) {
|
|
291
|
+
const cfg = uploadInitParams.value?.fileConfig;
|
|
292
|
+
if (cfg) {
|
|
293
|
+
if (cfg.disablePreview) {
|
|
294
|
+
return false;
|
|
295
|
+
}
|
|
296
|
+
if (!previewableFileExts.some(ext => file.fileName.endsWith(ext))) {
|
|
297
|
+
return false;
|
|
298
|
+
}
|
|
299
|
+
return true;
|
|
300
|
+
}
|
|
301
|
+
return false;
|
|
302
|
+
}
|
|
303
|
+
watch(() => props.attachToken, () => {
|
|
304
|
+
if (props.attachToken) {
|
|
305
|
+
initLoad();
|
|
306
|
+
}
|
|
307
|
+
else {
|
|
308
|
+
initNew();
|
|
309
|
+
}
|
|
310
|
+
});
|
|
311
|
+
debugger; /* PartiallyEnd: #3632/scriptSetup.vue */
|
|
312
|
+
const __VLS_defaults = {};
|
|
313
|
+
const __VLS_modelEmit = defineEmits();
|
|
314
|
+
const __VLS_ctx = {};
|
|
315
|
+
let __VLS_components;
|
|
316
|
+
let __VLS_directives;
|
|
317
|
+
/** @type {__VLS_StyleScopedClasses['loader-shimmer']} */ ;
|
|
318
|
+
// CSS variable injection
|
|
319
|
+
// CSS variable injection end
|
|
320
|
+
__VLS_asFunctionalElement(__VLS_intrinsicElements.div, __VLS_intrinsicElements.div)({
|
|
321
|
+
...{ class: "ja-uploader" },
|
|
322
|
+
});
|
|
323
|
+
__VLS_asFunctionalElement(__VLS_intrinsicElements.div, __VLS_intrinsicElements.div)({
|
|
324
|
+
...{ class: "ja-uploader-tools" },
|
|
325
|
+
});
|
|
326
|
+
if (__VLS_ctx.allowedClassificationLevels.length <= 1 && __VLS_ctx.checkAllowUpload()) {
|
|
327
|
+
const __VLS_0 = {}.ElButton;
|
|
328
|
+
/** @type {[typeof __VLS_components.ElButton, typeof __VLS_components.elButton, typeof __VLS_components.ElButton, typeof __VLS_components.elButton, ]} */ ;
|
|
329
|
+
// @ts-ignore
|
|
330
|
+
const __VLS_1 = __VLS_asFunctionalComponent(__VLS_0, new __VLS_0({
|
|
331
|
+
...{ 'onClick': {} },
|
|
332
|
+
plain: true,
|
|
333
|
+
type: "success",
|
|
334
|
+
icon: (__VLS_ctx.Upload),
|
|
335
|
+
loading: (__VLS_ctx.loading),
|
|
336
|
+
disabled: (__VLS_ctx.loading),
|
|
337
|
+
size: "small",
|
|
338
|
+
}));
|
|
339
|
+
const __VLS_2 = __VLS_1({
|
|
340
|
+
...{ 'onClick': {} },
|
|
341
|
+
plain: true,
|
|
342
|
+
type: "success",
|
|
343
|
+
icon: (__VLS_ctx.Upload),
|
|
344
|
+
loading: (__VLS_ctx.loading),
|
|
345
|
+
disabled: (__VLS_ctx.loading),
|
|
346
|
+
size: "small",
|
|
347
|
+
}, ...__VLS_functionalComponentArgsRest(__VLS_1));
|
|
348
|
+
let __VLS_4;
|
|
349
|
+
let __VLS_5;
|
|
350
|
+
let __VLS_6;
|
|
351
|
+
const __VLS_7 = {
|
|
352
|
+
onClick: (__VLS_ctx.onUploadBtnClick)
|
|
353
|
+
};
|
|
354
|
+
__VLS_3.slots.default;
|
|
355
|
+
(__VLS_ctx.uploadInitParams?.fileConfig.enableClassifiedLevel ? "(非密)" : "");
|
|
356
|
+
var __VLS_3;
|
|
357
|
+
}
|
|
358
|
+
if (__VLS_ctx.checkAllowDownload()) {
|
|
359
|
+
const __VLS_8 = {}.ElButton;
|
|
360
|
+
/** @type {[typeof __VLS_components.ElButton, typeof __VLS_components.elButton, typeof __VLS_components.ElButton, typeof __VLS_components.elButton, ]} */ ;
|
|
361
|
+
// @ts-ignore
|
|
362
|
+
const __VLS_9 = __VLS_asFunctionalComponent(__VLS_8, new __VLS_8({
|
|
363
|
+
...{ 'onClick': {} },
|
|
364
|
+
plain: true,
|
|
365
|
+
icon: (__VLS_ctx.Download),
|
|
366
|
+
loading: (__VLS_ctx.loading),
|
|
367
|
+
disabled: (__VLS_ctx.loading || __VLS_ctx.files?.length === 0),
|
|
368
|
+
size: "small",
|
|
369
|
+
}));
|
|
370
|
+
const __VLS_10 = __VLS_9({
|
|
371
|
+
...{ 'onClick': {} },
|
|
372
|
+
plain: true,
|
|
373
|
+
icon: (__VLS_ctx.Download),
|
|
374
|
+
loading: (__VLS_ctx.loading),
|
|
375
|
+
disabled: (__VLS_ctx.loading || __VLS_ctx.files?.length === 0),
|
|
376
|
+
size: "small",
|
|
377
|
+
}, ...__VLS_functionalComponentArgsRest(__VLS_9));
|
|
378
|
+
let __VLS_12;
|
|
379
|
+
let __VLS_13;
|
|
380
|
+
let __VLS_14;
|
|
381
|
+
const __VLS_15 = {
|
|
382
|
+
onClick: (__VLS_ctx.downloadAll)
|
|
383
|
+
};
|
|
384
|
+
__VLS_11.slots.default;
|
|
385
|
+
var __VLS_11;
|
|
386
|
+
}
|
|
387
|
+
if (__VLS_ctx.allowedClassificationLevels.length > 1 && __VLS_ctx.checkAllowUpload()) {
|
|
388
|
+
const __VLS_16 = {}.ElDropdown;
|
|
389
|
+
/** @type {[typeof __VLS_components.ElDropdown, typeof __VLS_components.elDropdown, typeof __VLS_components.ElDropdown, typeof __VLS_components.elDropdown, ]} */ ;
|
|
390
|
+
// @ts-ignore
|
|
391
|
+
const __VLS_17 = __VLS_asFunctionalComponent(__VLS_16, new __VLS_16({
|
|
392
|
+
...{ 'onCommand': {} },
|
|
393
|
+
size: "small",
|
|
394
|
+
}));
|
|
395
|
+
const __VLS_18 = __VLS_17({
|
|
396
|
+
...{ 'onCommand': {} },
|
|
397
|
+
size: "small",
|
|
398
|
+
}, ...__VLS_functionalComponentArgsRest(__VLS_17));
|
|
399
|
+
let __VLS_20;
|
|
400
|
+
let __VLS_21;
|
|
401
|
+
let __VLS_22;
|
|
402
|
+
const __VLS_23 = {
|
|
403
|
+
onCommand: (__VLS_ctx.handleClassificationLevelSelCmd)
|
|
404
|
+
};
|
|
405
|
+
__VLS_19.slots.default;
|
|
406
|
+
const __VLS_24 = {}.ElButton;
|
|
407
|
+
/** @type {[typeof __VLS_components.ElButton, typeof __VLS_components.elButton, typeof __VLS_components.ElButton, typeof __VLS_components.elButton, ]} */ ;
|
|
408
|
+
// @ts-ignore
|
|
409
|
+
const __VLS_25 = __VLS_asFunctionalComponent(__VLS_24, new __VLS_24({
|
|
410
|
+
type: "success",
|
|
411
|
+
size: "small",
|
|
412
|
+
}));
|
|
413
|
+
const __VLS_26 = __VLS_25({
|
|
414
|
+
type: "success",
|
|
415
|
+
size: "small",
|
|
416
|
+
}, ...__VLS_functionalComponentArgsRest(__VLS_25));
|
|
417
|
+
__VLS_27.slots.default;
|
|
418
|
+
const __VLS_28 = {}.ElIcon;
|
|
419
|
+
/** @type {[typeof __VLS_components.ElIcon, typeof __VLS_components.elIcon, typeof __VLS_components.ElIcon, typeof __VLS_components.elIcon, ]} */ ;
|
|
420
|
+
// @ts-ignore
|
|
421
|
+
const __VLS_29 = __VLS_asFunctionalComponent(__VLS_28, new __VLS_28({
|
|
422
|
+
...{ class: "el-icon--right" },
|
|
423
|
+
}));
|
|
424
|
+
const __VLS_30 = __VLS_29({
|
|
425
|
+
...{ class: "el-icon--right" },
|
|
426
|
+
}, ...__VLS_functionalComponentArgsRest(__VLS_29));
|
|
427
|
+
__VLS_31.slots.default;
|
|
428
|
+
const __VLS_32 = {}.ArrowDown;
|
|
429
|
+
/** @type {[typeof __VLS_components.ArrowDown, typeof __VLS_components.arrowDown, ]} */ ;
|
|
430
|
+
// @ts-ignore
|
|
431
|
+
const __VLS_33 = __VLS_asFunctionalComponent(__VLS_32, new __VLS_32({}));
|
|
432
|
+
const __VLS_34 = __VLS_33({}, ...__VLS_functionalComponentArgsRest(__VLS_33));
|
|
433
|
+
var __VLS_31;
|
|
434
|
+
var __VLS_27;
|
|
435
|
+
{
|
|
436
|
+
const { dropdown: __VLS_thisSlot } = __VLS_19.slots;
|
|
437
|
+
const __VLS_36 = {}.ElDropdownMenu;
|
|
438
|
+
/** @type {[typeof __VLS_components.ElDropdownMenu, typeof __VLS_components.elDropdownMenu, typeof __VLS_components.ElDropdownMenu, typeof __VLS_components.elDropdownMenu, ]} */ ;
|
|
439
|
+
// @ts-ignore
|
|
440
|
+
const __VLS_37 = __VLS_asFunctionalComponent(__VLS_36, new __VLS_36({}));
|
|
441
|
+
const __VLS_38 = __VLS_37({}, ...__VLS_functionalComponentArgsRest(__VLS_37));
|
|
442
|
+
__VLS_39.slots.default;
|
|
443
|
+
for (const [cl] of __VLS_getVForSourceType((__VLS_ctx.allowedClassificationLevels))) {
|
|
444
|
+
const __VLS_40 = {}.ElDropdownItem;
|
|
445
|
+
/** @type {[typeof __VLS_components.ElDropdownItem, typeof __VLS_components.elDropdownItem, typeof __VLS_components.ElDropdownItem, typeof __VLS_components.elDropdownItem, ]} */ ;
|
|
446
|
+
// @ts-ignore
|
|
447
|
+
const __VLS_41 = __VLS_asFunctionalComponent(__VLS_40, new __VLS_40({
|
|
448
|
+
key: (cl.value),
|
|
449
|
+
command: (cl.value),
|
|
450
|
+
}));
|
|
451
|
+
const __VLS_42 = __VLS_41({
|
|
452
|
+
key: (cl.value),
|
|
453
|
+
command: (cl.value),
|
|
454
|
+
}, ...__VLS_functionalComponentArgsRest(__VLS_41));
|
|
455
|
+
__VLS_43.slots.default;
|
|
456
|
+
(cl.label);
|
|
457
|
+
var __VLS_43;
|
|
458
|
+
}
|
|
459
|
+
var __VLS_39;
|
|
460
|
+
}
|
|
461
|
+
var __VLS_19;
|
|
462
|
+
}
|
|
463
|
+
if (__VLS_ctx.uploadingProgress < 100 && __VLS_ctx.uploadingProgress > 0) {
|
|
464
|
+
__VLS_asFunctionalElement(__VLS_intrinsicElements.div, __VLS_intrinsicElements.div)({
|
|
465
|
+
...{ onClick: (__VLS_ctx.viewUppyDashboard) },
|
|
466
|
+
...{ class: "container" },
|
|
467
|
+
});
|
|
468
|
+
__VLS_asFunctionalElement(__VLS_intrinsicElements.p, __VLS_intrinsicElements.p)({});
|
|
469
|
+
__VLS_asFunctionalElement(__VLS_intrinsicElements.span, __VLS_intrinsicElements.span)({
|
|
470
|
+
...{ class: "loader-shimmer" },
|
|
471
|
+
});
|
|
472
|
+
(__VLS_ctx.uploadingProgress);
|
|
473
|
+
}
|
|
474
|
+
const __VLS_44 = {}.ElTable;
|
|
475
|
+
/** @type {[typeof __VLS_components.ElTable, typeof __VLS_components.elTable, typeof __VLS_components.ElTable, typeof __VLS_components.elTable, ]} */ ;
|
|
476
|
+
// @ts-ignore
|
|
477
|
+
const __VLS_45 = __VLS_asFunctionalComponent(__VLS_44, new __VLS_44({
|
|
478
|
+
data: (__VLS_ctx.files),
|
|
479
|
+
showHeader: (true),
|
|
480
|
+
...{ style: {} },
|
|
481
|
+
emptyText: "暂无文件",
|
|
482
|
+
height: (props.height),
|
|
483
|
+
maxHeight: (props.maxHeight),
|
|
484
|
+
}));
|
|
485
|
+
const __VLS_46 = __VLS_45({
|
|
486
|
+
data: (__VLS_ctx.files),
|
|
487
|
+
showHeader: (true),
|
|
488
|
+
...{ style: {} },
|
|
489
|
+
emptyText: "暂无文件",
|
|
490
|
+
height: (props.height),
|
|
491
|
+
maxHeight: (props.maxHeight),
|
|
492
|
+
}, ...__VLS_functionalComponentArgsRest(__VLS_45));
|
|
493
|
+
__VLS_47.slots.default;
|
|
494
|
+
const __VLS_48 = {}.ElTableColumn;
|
|
495
|
+
/** @type {[typeof __VLS_components.ElTableColumn, typeof __VLS_components.elTableColumn, ]} */ ;
|
|
496
|
+
// @ts-ignore
|
|
497
|
+
const __VLS_49 = __VLS_asFunctionalComponent(__VLS_48, new __VLS_48({
|
|
498
|
+
prop: "fileName",
|
|
499
|
+
}));
|
|
500
|
+
const __VLS_50 = __VLS_49({
|
|
501
|
+
prop: "fileName",
|
|
502
|
+
}, ...__VLS_functionalComponentArgsRest(__VLS_49));
|
|
503
|
+
const __VLS_52 = {}.ElTableColumn;
|
|
504
|
+
/** @type {[typeof __VLS_components.ElTableColumn, typeof __VLS_components.elTableColumn, typeof __VLS_components.ElTableColumn, typeof __VLS_components.elTableColumn, ]} */ ;
|
|
505
|
+
// @ts-ignore
|
|
506
|
+
const __VLS_53 = __VLS_asFunctionalComponent(__VLS_52, new __VLS_52({
|
|
507
|
+
prop: "fileSize",
|
|
508
|
+
width: "100",
|
|
509
|
+
}));
|
|
510
|
+
const __VLS_54 = __VLS_53({
|
|
511
|
+
prop: "fileSize",
|
|
512
|
+
width: "100",
|
|
513
|
+
}, ...__VLS_functionalComponentArgsRest(__VLS_53));
|
|
514
|
+
__VLS_55.slots.default;
|
|
515
|
+
{
|
|
516
|
+
const { default: __VLS_thisSlot } = __VLS_55.slots;
|
|
517
|
+
const [scope] = __VLS_getSlotParams(__VLS_thisSlot);
|
|
518
|
+
(__VLS_ctx.prettyBytes(scope.row.fileSize));
|
|
519
|
+
}
|
|
520
|
+
var __VLS_55;
|
|
521
|
+
const __VLS_56 = {}.ElTableColumn;
|
|
522
|
+
/** @type {[typeof __VLS_components.ElTableColumn, typeof __VLS_components.elTableColumn, typeof __VLS_components.ElTableColumn, typeof __VLS_components.elTableColumn, ]} */ ;
|
|
523
|
+
// @ts-ignore
|
|
524
|
+
const __VLS_57 = __VLS_asFunctionalComponent(__VLS_56, new __VLS_56({
|
|
525
|
+
prop: "classifiedLevel",
|
|
526
|
+
width: "60",
|
|
527
|
+
}));
|
|
528
|
+
const __VLS_58 = __VLS_57({
|
|
529
|
+
prop: "classifiedLevel",
|
|
530
|
+
width: "60",
|
|
531
|
+
}, ...__VLS_functionalComponentArgsRest(__VLS_57));
|
|
532
|
+
__VLS_59.slots.default;
|
|
533
|
+
{
|
|
534
|
+
const { default: __VLS_thisSlot } = __VLS_59.slots;
|
|
535
|
+
const [scope] = __VLS_getSlotParams(__VLS_thisSlot);
|
|
536
|
+
const __VLS_60 = {}.ElTag;
|
|
537
|
+
/** @type {[typeof __VLS_components.ElTag, typeof __VLS_components.elTag, typeof __VLS_components.ElTag, typeof __VLS_components.elTag, ]} */ ;
|
|
538
|
+
// @ts-ignore
|
|
539
|
+
const __VLS_61 = __VLS_asFunctionalComponent(__VLS_60, new __VLS_60({
|
|
540
|
+
type: (scope.row.classifiedLevel < 50 ? (scope.row.classifiedLevel < 30 ? 'danger' : 'warning') : 'info'),
|
|
541
|
+
}));
|
|
542
|
+
const __VLS_62 = __VLS_61({
|
|
543
|
+
type: (scope.row.classifiedLevel < 50 ? (scope.row.classifiedLevel < 30 ? 'danger' : 'warning') : 'info'),
|
|
544
|
+
}, ...__VLS_functionalComponentArgsRest(__VLS_61));
|
|
545
|
+
__VLS_63.slots.default;
|
|
546
|
+
(__VLS_ctx.classificationLevelMap?.get(scope.row.classifiedLevel));
|
|
547
|
+
var __VLS_63;
|
|
548
|
+
}
|
|
549
|
+
var __VLS_59;
|
|
550
|
+
const __VLS_64 = {}.ElTableColumn;
|
|
551
|
+
/** @type {[typeof __VLS_components.ElTableColumn, typeof __VLS_components.elTableColumn, typeof __VLS_components.ElTableColumn, typeof __VLS_components.elTableColumn, ]} */ ;
|
|
552
|
+
// @ts-ignore
|
|
553
|
+
const __VLS_65 = __VLS_asFunctionalComponent(__VLS_64, new __VLS_64({
|
|
554
|
+
align: "right",
|
|
555
|
+
width: "150",
|
|
556
|
+
fixed: "right",
|
|
557
|
+
}));
|
|
558
|
+
const __VLS_66 = __VLS_65({
|
|
559
|
+
align: "right",
|
|
560
|
+
width: "150",
|
|
561
|
+
fixed: "right",
|
|
562
|
+
}, ...__VLS_functionalComponentArgsRest(__VLS_65));
|
|
563
|
+
__VLS_67.slots.default;
|
|
564
|
+
{
|
|
565
|
+
const { default: __VLS_thisSlot } = __VLS_67.slots;
|
|
566
|
+
const [scope] = __VLS_getSlotParams(__VLS_thisSlot);
|
|
567
|
+
if (__VLS_ctx.checkAllowPreview(scope.row)) {
|
|
568
|
+
const __VLS_68 = {}.ElButton;
|
|
569
|
+
/** @type {[typeof __VLS_components.ElButton, typeof __VLS_components.elButton, typeof __VLS_components.ElButton, typeof __VLS_components.elButton, ]} */ ;
|
|
570
|
+
// @ts-ignore
|
|
571
|
+
const __VLS_69 = __VLS_asFunctionalComponent(__VLS_68, new __VLS_68({
|
|
572
|
+
...{ 'onClick': {} },
|
|
573
|
+
link: true,
|
|
574
|
+
type: "warning",
|
|
575
|
+
}));
|
|
576
|
+
const __VLS_70 = __VLS_69({
|
|
577
|
+
...{ 'onClick': {} },
|
|
578
|
+
link: true,
|
|
579
|
+
type: "warning",
|
|
580
|
+
}, ...__VLS_functionalComponentArgsRest(__VLS_69));
|
|
581
|
+
let __VLS_72;
|
|
582
|
+
let __VLS_73;
|
|
583
|
+
let __VLS_74;
|
|
584
|
+
const __VLS_75 = {
|
|
585
|
+
onClick: (...[$event]) => {
|
|
586
|
+
if (!(__VLS_ctx.checkAllowPreview(scope.row)))
|
|
587
|
+
return;
|
|
588
|
+
__VLS_ctx.previewFile(scope.row.token);
|
|
589
|
+
}
|
|
590
|
+
};
|
|
591
|
+
__VLS_71.slots.default;
|
|
592
|
+
var __VLS_71;
|
|
593
|
+
}
|
|
594
|
+
if (__VLS_ctx.checkAllowDownload()) {
|
|
595
|
+
const __VLS_76 = {}.ElButton;
|
|
596
|
+
/** @type {[typeof __VLS_components.ElButton, typeof __VLS_components.elButton, typeof __VLS_components.ElButton, typeof __VLS_components.elButton, ]} */ ;
|
|
597
|
+
// @ts-ignore
|
|
598
|
+
const __VLS_77 = __VLS_asFunctionalComponent(__VLS_76, new __VLS_76({
|
|
599
|
+
...{ 'onClick': {} },
|
|
600
|
+
link: true,
|
|
601
|
+
type: "primary",
|
|
602
|
+
}));
|
|
603
|
+
const __VLS_78 = __VLS_77({
|
|
604
|
+
...{ 'onClick': {} },
|
|
605
|
+
link: true,
|
|
606
|
+
type: "primary",
|
|
607
|
+
}, ...__VLS_functionalComponentArgsRest(__VLS_77));
|
|
608
|
+
let __VLS_80;
|
|
609
|
+
let __VLS_81;
|
|
610
|
+
let __VLS_82;
|
|
611
|
+
const __VLS_83 = {
|
|
612
|
+
onClick: (...[$event]) => {
|
|
613
|
+
if (!(__VLS_ctx.checkAllowDownload()))
|
|
614
|
+
return;
|
|
615
|
+
__VLS_ctx.downloadFile(scope.row.token);
|
|
616
|
+
}
|
|
617
|
+
};
|
|
618
|
+
__VLS_79.slots.default;
|
|
619
|
+
var __VLS_79;
|
|
620
|
+
}
|
|
621
|
+
if (__VLS_ctx.checkAllowDelete()) {
|
|
622
|
+
const __VLS_84 = {}.ElButton;
|
|
623
|
+
/** @type {[typeof __VLS_components.ElButton, typeof __VLS_components.elButton, typeof __VLS_components.ElButton, typeof __VLS_components.elButton, ]} */ ;
|
|
624
|
+
// @ts-ignore
|
|
625
|
+
const __VLS_85 = __VLS_asFunctionalComponent(__VLS_84, new __VLS_84({
|
|
626
|
+
...{ 'onClick': {} },
|
|
627
|
+
link: true,
|
|
628
|
+
type: "danger",
|
|
629
|
+
}));
|
|
630
|
+
const __VLS_86 = __VLS_85({
|
|
631
|
+
...{ 'onClick': {} },
|
|
632
|
+
link: true,
|
|
633
|
+
type: "danger",
|
|
634
|
+
}, ...__VLS_functionalComponentArgsRest(__VLS_85));
|
|
635
|
+
let __VLS_88;
|
|
636
|
+
let __VLS_89;
|
|
637
|
+
let __VLS_90;
|
|
638
|
+
const __VLS_91 = {
|
|
639
|
+
onClick: (...[$event]) => {
|
|
640
|
+
if (!(__VLS_ctx.checkAllowDelete()))
|
|
641
|
+
return;
|
|
642
|
+
__VLS_ctx.delUploadedFile(scope.row);
|
|
643
|
+
}
|
|
644
|
+
};
|
|
645
|
+
__VLS_87.slots.default;
|
|
646
|
+
var __VLS_87;
|
|
647
|
+
}
|
|
648
|
+
}
|
|
649
|
+
var __VLS_67;
|
|
650
|
+
var __VLS_47;
|
|
651
|
+
/** @type {[typeof PdfViewerModal, typeof PdfViewerModal, ]} */ ;
|
|
652
|
+
// @ts-ignore
|
|
653
|
+
const __VLS_92 = __VLS_asFunctionalComponent(PdfViewerModal, new PdfViewerModal({
|
|
654
|
+
src: (__VLS_ctx.pdfSrc),
|
|
655
|
+
modelValue: (__VLS_ctx.pdfViewerVisible),
|
|
656
|
+
}));
|
|
657
|
+
const __VLS_93 = __VLS_92({
|
|
658
|
+
src: (__VLS_ctx.pdfSrc),
|
|
659
|
+
modelValue: (__VLS_ctx.pdfViewerVisible),
|
|
660
|
+
}, ...__VLS_functionalComponentArgsRest(__VLS_92));
|
|
661
|
+
/** @type {__VLS_StyleScopedClasses['ja-uploader']} */ ;
|
|
662
|
+
/** @type {__VLS_StyleScopedClasses['ja-uploader-tools']} */ ;
|
|
663
|
+
/** @type {__VLS_StyleScopedClasses['el-icon--right']} */ ;
|
|
664
|
+
/** @type {__VLS_StyleScopedClasses['container']} */ ;
|
|
665
|
+
/** @type {__VLS_StyleScopedClasses['loader-shimmer']} */ ;
|
|
666
|
+
var __VLS_dollars;
|
|
667
|
+
const __VLS_self = (await import('vue')).defineComponent({
|
|
668
|
+
setup() {
|
|
669
|
+
return {
|
|
670
|
+
ArrowDown: ArrowDown,
|
|
671
|
+
Download: Download,
|
|
672
|
+
Upload: Upload,
|
|
673
|
+
prettyBytes: prettyBytes,
|
|
674
|
+
PdfViewerModal: PdfViewerModal,
|
|
675
|
+
ElTable: ElTable,
|
|
676
|
+
ElTableColumn: ElTableColumn,
|
|
677
|
+
ElButton: ElButton,
|
|
678
|
+
ElDropdown: ElDropdown,
|
|
679
|
+
ElDropdownItem: ElDropdownItem,
|
|
680
|
+
ElDropdownMenu: ElDropdownMenu,
|
|
681
|
+
ElIcon: ElIcon,
|
|
682
|
+
ElTag: ElTag,
|
|
683
|
+
loading: loading,
|
|
684
|
+
files: files,
|
|
685
|
+
allowedClassificationLevels: allowedClassificationLevels,
|
|
686
|
+
classificationLevelMap: classificationLevelMap,
|
|
687
|
+
uploadInitParams: uploadInitParams,
|
|
688
|
+
uploadingProgress: uploadingProgress,
|
|
689
|
+
pdfViewerVisible: pdfViewerVisible,
|
|
690
|
+
pdfSrc: pdfSrc,
|
|
691
|
+
onUploadBtnClick: onUploadBtnClick,
|
|
692
|
+
handleClassificationLevelSelCmd: handleClassificationLevelSelCmd,
|
|
693
|
+
delUploadedFile: delUploadedFile,
|
|
694
|
+
previewFile: previewFile,
|
|
695
|
+
downloadFile: downloadFile,
|
|
696
|
+
viewUppyDashboard: viewUppyDashboard,
|
|
697
|
+
downloadAll: downloadAll,
|
|
698
|
+
checkAllowUpload: checkAllowUpload,
|
|
699
|
+
checkAllowDownload: checkAllowDownload,
|
|
700
|
+
checkAllowDelete: checkAllowDelete,
|
|
701
|
+
checkAllowPreview: checkAllowPreview,
|
|
702
|
+
};
|
|
703
|
+
},
|
|
704
|
+
emits: {
|
|
705
|
+
...{},
|
|
706
|
+
...{},
|
|
707
|
+
},
|
|
708
|
+
__typeProps: {},
|
|
709
|
+
});
|
|
710
|
+
export default (await import('vue')).defineComponent({
|
|
711
|
+
setup() {
|
|
712
|
+
return {};
|
|
713
|
+
},
|
|
714
|
+
emits: {
|
|
715
|
+
...{},
|
|
716
|
+
...{},
|
|
717
|
+
},
|
|
718
|
+
__typeProps: {},
|
|
719
|
+
});
|
|
720
|
+
; /* PartiallyEnd: #4569/main.vue */
|
|
721
|
+
//# sourceMappingURL=uploader.vue.js.map
|