@dt-frames/ui 2.0.14 → 2.0.15
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/es/components/form/index.js +6 -3
- package/es/components/form/index.less +28 -3
- package/es/components/form/src/props.d.ts +3 -3
- package/es/components/table/index.js +70 -86
- package/es/components/table/src/components/TableAction.d.ts +6 -0
- package/es/components/table/src/index.d.ts +4 -4
- package/es/components/table/src/props.d.ts +1 -1
- package/es/components/upload/index.js +54 -58
- package/es/components/upload/index.less +9 -4
- package/es/components/upload/src/basicProps.d.ts +1 -1
- package/es/components/upload/src/index.d.ts +5 -5
- package/es/theme/index.js +108 -152
- package/es/theme/index.less +23 -0
- package/es/theme/src/components/header/components/lock/Lockscreen.d.ts +34 -3
- package/es/theme/src/components/header/components/lock/index.d.ts +1 -2
- package/es/theme/src/components/header/components/lock/useTime.d.ts +7 -0
- package/es/theme/src/components/header/components/user-info.d.ts +7 -0
- package/es/theme/src/components/header/index.d.ts +7 -0
- package/es/theme/src/components/header/multiple-header.d.ts +7 -0
- package/es/theme/src/index.d.ts +53 -3
- package/es/theme/src/stores/lockscreen.store.d.ts +7 -0
- package/package.json +1 -1
|
@@ -2,9 +2,9 @@ import { Button, Upload, Image } from "ant-design-vue/es";
|
|
|
2
2
|
import "ant-design-vue/es/image/style";
|
|
3
3
|
import "ant-design-vue/es/upload/style";
|
|
4
4
|
import "ant-design-vue/es/button/style";
|
|
5
|
-
import {
|
|
5
|
+
import { computed, unref, ref, watch, defineComponent, openBlock, createBlock, withCtx, createVNode, createElementVNode, toRefs, createElementBlock, mergeProps, isRef, createSlots, toDisplayString, Fragment, renderList, normalizeClass, createCommentVNode, renderSlot, normalizeProps, guardReactiveProps } from "vue";
|
|
6
6
|
import { takeRight, omit } from "lodash-es";
|
|
7
|
-
import { useAppStore, useMessage, dispatchResize, isFunction,
|
|
7
|
+
import { useAppStore, useMessage, isString, dispatchResize, isFunction, http, HttpContentTypeEnum } from "@dt-frames/core";
|
|
8
8
|
import { useModal, DtModal, useModalOut } from "../modal";
|
|
9
9
|
import { DtIframe } from "../iframe";
|
|
10
10
|
import { renderAsync } from "docx-preview";
|
|
@@ -27,9 +27,9 @@ const basicProps = {
|
|
|
27
27
|
type: Object,
|
|
28
28
|
default: {}
|
|
29
29
|
},
|
|
30
|
-
|
|
30
|
+
fileName: {
|
|
31
31
|
type: String,
|
|
32
|
-
default: "
|
|
32
|
+
default: "file"
|
|
33
33
|
},
|
|
34
34
|
accept: {
|
|
35
35
|
type: Array,
|
|
@@ -134,13 +134,14 @@ function useFile({
|
|
|
134
134
|
return helpTexts.join(", ");
|
|
135
135
|
});
|
|
136
136
|
const setFile = (file) => {
|
|
137
|
+
let _downloadUrl = getAppConf.pages?.downloadUrl;
|
|
137
138
|
return {
|
|
138
139
|
...file,
|
|
139
|
-
name: file.
|
|
140
|
-
fileType: file.
|
|
140
|
+
name: file.fileName ?? file.fileId,
|
|
141
|
+
fileType: file.fileName ? takeRight(file.fileName.split("."))[0] : null,
|
|
141
142
|
status: "done",
|
|
142
143
|
uid: file.id ?? file.fileId,
|
|
143
|
-
url: `${getAppConf.
|
|
144
|
+
url: `${getAppConf.http?.baseUrl}${isString(_downloadUrl) ? _downloadUrl : _downloadUrl.api}?id=${file.fileId}`
|
|
144
145
|
};
|
|
145
146
|
};
|
|
146
147
|
const fileList = ref(unref(fileListRef).map((it) => setFile(it)));
|
|
@@ -213,7 +214,7 @@ const _sfc_main$2 = /* @__PURE__ */ defineComponent({
|
|
|
213
214
|
const pdfUrlRef = ref();
|
|
214
215
|
const [register] = useModal({
|
|
215
216
|
width: "70%",
|
|
216
|
-
title: (data) => `\u9644\u4EF6\u9884\u89C8 - ${data.
|
|
217
|
+
title: (data) => `\u9644\u4EF6\u9884\u89C8 - ${data.fileName}`,
|
|
217
218
|
useWrapper: false,
|
|
218
219
|
wrapClassName: "dt-pdf",
|
|
219
220
|
maskClosable: false,
|
|
@@ -225,14 +226,14 @@ const _sfc_main$2 = /* @__PURE__ */ defineComponent({
|
|
|
225
226
|
exeReduce.value = isFullscreen ? 55 : 233;
|
|
226
227
|
}
|
|
227
228
|
return (_ctx, _cache) => {
|
|
228
|
-
return openBlock(), createBlock(unref
|
|
229
|
-
onRegister: unref
|
|
229
|
+
return openBlock(), createBlock(unref(DtModal), {
|
|
230
|
+
onRegister: unref(register),
|
|
230
231
|
onToggleFullscreen: toggleFullscreen
|
|
231
232
|
}, {
|
|
232
233
|
default: withCtx(() => [
|
|
233
|
-
createVNode(unref
|
|
234
|
-
src:
|
|
235
|
-
exeReduce:
|
|
234
|
+
createVNode(unref(DtIframe), {
|
|
235
|
+
src: pdfUrlRef.value,
|
|
236
|
+
exeReduce: exeReduce.value
|
|
236
237
|
}, null, 8, ["src", "exeReduce"])
|
|
237
238
|
]),
|
|
238
239
|
_: 1
|
|
@@ -240,27 +241,18 @@ const _sfc_main$2 = /* @__PURE__ */ defineComponent({
|
|
|
240
241
|
};
|
|
241
242
|
}
|
|
242
243
|
});
|
|
243
|
-
const _export_sfc = (sfc, props) => {
|
|
244
|
-
const target = sfc.__vccOpts || sfc;
|
|
245
|
-
for (const [key, val] of props) {
|
|
246
|
-
target[key] = val;
|
|
247
|
-
}
|
|
248
|
-
return target;
|
|
249
|
-
};
|
|
250
|
-
const PdfView = /* @__PURE__ */ _export_sfc(_sfc_main$2, [["__file", "D:/dt/dt-frame-front/dt-frames/frames/packages/ui/src/components/upload/src/components/PdfView.vue"]]);
|
|
251
244
|
const _sfc_main$1 = /* @__PURE__ */ defineComponent({
|
|
252
245
|
__name: "WordView",
|
|
253
246
|
setup(__props) {
|
|
254
247
|
const ID = `word-view-${Math.ceil(Math.random() * 1e6)}`;
|
|
255
248
|
const [register] = useModal({
|
|
256
249
|
width: "900px",
|
|
257
|
-
title: (data) => `\u9644\u4EF6\u9884\u89C8 - ${data.
|
|
250
|
+
title: (data) => `\u9644\u4EF6\u9884\u89C8 - ${data.fileName}`,
|
|
258
251
|
useWrapper: false,
|
|
259
252
|
wrapClassName: "dt-word",
|
|
260
253
|
maskClosable: false,
|
|
261
254
|
footer: null
|
|
262
255
|
}, (data) => {
|
|
263
|
-
console.log(data);
|
|
264
256
|
const fileReader = new FileReader();
|
|
265
257
|
fileReader.addEventListener("load", (event) => {
|
|
266
258
|
const arrayBuffer = event.target.result;
|
|
@@ -282,7 +274,7 @@ const _sfc_main$1 = /* @__PURE__ */ defineComponent({
|
|
|
282
274
|
fileReader.readAsArrayBuffer(data.data);
|
|
283
275
|
});
|
|
284
276
|
return (_ctx, _cache) => {
|
|
285
|
-
return openBlock(), createBlock(unref
|
|
277
|
+
return openBlock(), createBlock(unref(DtModal), { onRegister: unref(register) }, {
|
|
286
278
|
default: withCtx(() => [
|
|
287
279
|
createElementVNode("div", {
|
|
288
280
|
id: ID,
|
|
@@ -294,7 +286,6 @@ const _sfc_main$1 = /* @__PURE__ */ defineComponent({
|
|
|
294
286
|
};
|
|
295
287
|
}
|
|
296
288
|
});
|
|
297
|
-
const DocxView = /* @__PURE__ */ _export_sfc(_sfc_main$1, [["__file", "D:/dt/dt-frame-front/dt-frames/frames/packages/ui/src/components/upload/src/components/WordView.vue"]]);
|
|
298
289
|
const _hoisted_1 = { class: "flex items-center" };
|
|
299
290
|
const _hoisted_2 = { class: "pl-3" };
|
|
300
291
|
const _hoisted_3 = { class: "flex justify-between border border-solid border-gray-300 p-1 mt-2" };
|
|
@@ -382,14 +373,12 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
382
373
|
};
|
|
383
374
|
});
|
|
384
375
|
const handlePreview = async (file) => {
|
|
385
|
-
console.log(file);
|
|
386
376
|
imgSrcRef.value = file.url;
|
|
387
377
|
imgVisable.value = true;
|
|
388
378
|
};
|
|
389
379
|
const uploadFile = async ({ file, onSuccess, onError, onProgress }) => {
|
|
390
|
-
console.log(file);
|
|
391
380
|
const { getAppConf } = useAppStore();
|
|
392
|
-
const { uploadUrl = getAppConf.pages.uploadUrl, downloadUrl = getAppConf.pages.downloadUrl } = props;
|
|
381
|
+
const { uploadUrl = getAppConf.pages.uploadUrl, downloadUrl = getAppConf.pages.downloadUrl, fileName } = props;
|
|
393
382
|
let _uploadUrl = isString(uploadUrl) ? uploadUrl : uploadUrl.api;
|
|
394
383
|
let _downloadUrl = isString(downloadUrl) ? downloadUrl : downloadUrl.api;
|
|
395
384
|
if (!_uploadUrl) {
|
|
@@ -410,13 +399,15 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
410
399
|
},
|
|
411
400
|
{
|
|
412
401
|
...props.extraParams,
|
|
413
|
-
file
|
|
402
|
+
[fileName || "file"]: file
|
|
414
403
|
}
|
|
415
404
|
);
|
|
416
|
-
file
|
|
417
|
-
|
|
418
|
-
|
|
419
|
-
|
|
405
|
+
Object.assign(file, {
|
|
406
|
+
fileId: result?.data?.fileId,
|
|
407
|
+
url: `${getAppConf.http?.baseUrl}${_downloadUrl}?id=${result?.data?.fileId}`,
|
|
408
|
+
fileName: result?.data?.fileName,
|
|
409
|
+
fileType: takeRight(result?.data?.fileName?.split("."))?.[0]
|
|
410
|
+
});
|
|
420
411
|
onSuccess(result);
|
|
421
412
|
} catch (err) {
|
|
422
413
|
onError(err);
|
|
@@ -426,12 +417,13 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
426
417
|
try {
|
|
427
418
|
const { getAppConf } = useAppStore();
|
|
428
419
|
const { downloadUrl = getAppConf.pages.downloadUrl } = props;
|
|
420
|
+
let _downloadUrl = isString(downloadUrl) ? downloadUrl : downloadUrl.api;
|
|
429
421
|
if (["jpg", "jpeg", "png", "bmp", "gif"].includes(file.fileType)) {
|
|
430
|
-
imgSrcRef.value = `${
|
|
422
|
+
imgSrcRef.value = `${_downloadUrl}?id=${file.fileId}`;
|
|
431
423
|
imgVisable.value = true;
|
|
432
424
|
return;
|
|
433
425
|
}
|
|
434
|
-
let result = await http.get(
|
|
426
|
+
let result = await http.get(_downloadUrl, { id: file.fileId }, {
|
|
435
427
|
onlyData: false,
|
|
436
428
|
responseType: "blob",
|
|
437
429
|
isTransformResponse: false,
|
|
@@ -442,13 +434,13 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
442
434
|
switch (file.fileType) {
|
|
443
435
|
case "pdf":
|
|
444
436
|
openPdfModal({
|
|
445
|
-
|
|
437
|
+
fileName: file.fileName,
|
|
446
438
|
url: URL.createObjectURL(result.data)
|
|
447
439
|
});
|
|
448
440
|
break;
|
|
449
441
|
case "docx":
|
|
450
442
|
openDocxModal({
|
|
451
|
-
|
|
443
|
+
fileName: file.fileName,
|
|
452
444
|
data: result.data
|
|
453
445
|
});
|
|
454
446
|
break;
|
|
@@ -460,12 +452,17 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
460
452
|
function download(file) {
|
|
461
453
|
const { getAppConf } = useAppStore();
|
|
462
454
|
const { downloadUrl = getAppConf.pages.downloadUrl } = props;
|
|
463
|
-
http.exportFile(downloadUrl, { id: file.fileId }, file.
|
|
455
|
+
http.exportFile(downloadUrl, { id: file.fileId }, file.fileName);
|
|
464
456
|
}
|
|
465
457
|
watch(
|
|
466
|
-
() => unref(fileList)
|
|
467
|
-
(v) =>
|
|
458
|
+
() => unref(fileList),
|
|
459
|
+
async (v) => {
|
|
460
|
+
let ids = unref(fileList).map((it) => it.fileId);
|
|
461
|
+
if (ids.length === v.length)
|
|
462
|
+
emits("change", ids.join(","));
|
|
463
|
+
},
|
|
468
464
|
{
|
|
465
|
+
deep: true,
|
|
469
466
|
immediate: true
|
|
470
467
|
}
|
|
471
468
|
);
|
|
@@ -474,18 +471,18 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
474
471
|
const _component_AUpload = Upload;
|
|
475
472
|
const _component_AImage = Image;
|
|
476
473
|
return openBlock(), createElementBlock("div", null, [
|
|
477
|
-
unref
|
|
478
|
-
fileList: unref
|
|
474
|
+
unref(getBind).listType === "text" ? (openBlock(), createBlock(_component_AUpload, mergeProps({ key: 0 }, unref(getBind), {
|
|
475
|
+
fileList: unref(fileList),
|
|
479
476
|
"onUpdate:fileList": _cache[0] || (_cache[0] = ($event) => isRef(fileList) ? fileList.value = $event : null)
|
|
480
477
|
}), createSlots({
|
|
481
478
|
itemRender: withCtx(({ file, actions }) => [
|
|
482
479
|
createElementVNode("div", _hoisted_3, [
|
|
483
480
|
createElementVNode("div", _hoisted_4, [
|
|
484
481
|
createElementVNode("img", {
|
|
485
|
-
src: unref
|
|
482
|
+
src: unref(getFileThumb)(file.fileType),
|
|
486
483
|
class: "w-9 h-9 mr-2 p-1"
|
|
487
484
|
}, null, 8, _hoisted_5),
|
|
488
|
-
createElementVNode("span", null, toDisplayString(file.
|
|
485
|
+
createElementVNode("span", null, toDisplayString(file.fileName), 1)
|
|
489
486
|
]),
|
|
490
487
|
createElementVNode("div", _hoisted_6, [
|
|
491
488
|
(openBlock(), createElementBlock(Fragment, null, renderList(btns, (btn) => {
|
|
@@ -496,7 +493,7 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
496
493
|
key: 0,
|
|
497
494
|
class: normalizeClass(["i w-7 h-7 !text-base text-center leading-7 text-gray-600 cursor-pointer hover:bg-gray-200 hover:bg-opacity-50 transition-all duration-300", btn.class]),
|
|
498
495
|
onClick: ($event) => btn.click(file)
|
|
499
|
-
}, null, 10, _hoisted_7)) : createCommentVNode("
|
|
496
|
+
}, null, 10, _hoisted_7)) : createCommentVNode("", true)
|
|
500
497
|
], 64);
|
|
501
498
|
}), 64))
|
|
502
499
|
])
|
|
@@ -507,16 +504,16 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
507
504
|
createVNode(_component_AButton, null, {
|
|
508
505
|
default: withCtx(() => [
|
|
509
506
|
createElementVNode("i", {
|
|
510
|
-
class: normalizeClass(["i mr-1", unref
|
|
507
|
+
class: normalizeClass(["i mr-1", unref(getBind).preIcon])
|
|
511
508
|
}, null, 2),
|
|
512
|
-
createElementVNode("span", null, toDisplayString(unref
|
|
509
|
+
createElementVNode("span", null, toDisplayString(unref(getBind).buttonText), 1)
|
|
513
510
|
]),
|
|
514
511
|
_: 1
|
|
515
512
|
}),
|
|
516
|
-
createElementVNode("p", _hoisted_2, toDisplayString(unref
|
|
513
|
+
createElementVNode("p", _hoisted_2, toDisplayString(unref(getHelpText)), 1)
|
|
517
514
|
]),
|
|
518
|
-
createVNode(
|
|
519
|
-
createVNode(
|
|
515
|
+
createVNode(_sfc_main$2, { onRegister: unref(registerPdf) }, null, 8, ["onRegister"]),
|
|
516
|
+
createVNode(_sfc_main$1, { onRegister: unref(registerDocx) }, null, 8, ["onRegister"])
|
|
520
517
|
]),
|
|
521
518
|
_: 2
|
|
522
519
|
}, [
|
|
@@ -528,23 +525,22 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
528
525
|
])
|
|
529
526
|
};
|
|
530
527
|
})
|
|
531
|
-
]), 1040, ["fileList"])) : createCommentVNode("
|
|
532
|
-
unref
|
|
533
|
-
fileList: unref
|
|
528
|
+
]), 1040, ["fileList"])) : createCommentVNode("", true),
|
|
529
|
+
unref(getBind).listType === "picture-card" ? (openBlock(), createBlock(_component_AUpload, mergeProps({ key: 1 }, unref(getBind), {
|
|
530
|
+
fileList: unref(fileList),
|
|
534
531
|
"onUpdate:fileList": _cache[1] || (_cache[1] = ($event) => isRef(fileList) ? fileList.value = $event : null),
|
|
535
532
|
onPreview: handlePreview
|
|
536
533
|
}), {
|
|
537
534
|
default: withCtx(() => [
|
|
538
|
-
!_ctx.maxCount || unref
|
|
535
|
+
!_ctx.maxCount || !unref(fileList).length || unref(fileList).length < _ctx.maxCount ? (openBlock(), createElementBlock("div", _hoisted_8, _hoisted_11)) : createCommentVNode("", true)
|
|
539
536
|
]),
|
|
540
537
|
_: 1
|
|
541
|
-
}, 16, ["fileList"])) : createCommentVNode("
|
|
542
|
-
unref
|
|
538
|
+
}, 16, ["fileList"])) : createCommentVNode("", true),
|
|
539
|
+
unref(bindImg).src ? (openBlock(), createBlock(_component_AImage, mergeProps({ key: 2 }, unref(bindImg), { style: { display: "none" } }), null, 16)) : createCommentVNode("", true)
|
|
543
540
|
]);
|
|
544
541
|
};
|
|
545
542
|
}
|
|
546
543
|
});
|
|
547
|
-
const index = /* @__PURE__ */ _export_sfc(_sfc_main, [["__file", "D:/dt/dt-frame-front/dt-frames/frames/packages/ui/src/components/upload/src/index.vue"]]);
|
|
548
544
|
export {
|
|
549
|
-
|
|
545
|
+
_sfc_main as DtUpload
|
|
550
546
|
};
|
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
display: initial;
|
|
6
6
|
}
|
|
7
7
|
|
|
8
|
-
.dt-pdf{
|
|
8
|
+
.dt-pdf, .dt-word{
|
|
9
9
|
&.fullscreen-modal{
|
|
10
10
|
min-height: calc(100% + 8px);
|
|
11
11
|
&>.ant-modal{
|
|
@@ -27,12 +27,16 @@
|
|
|
27
27
|
}
|
|
28
28
|
}
|
|
29
29
|
}
|
|
30
|
+
|
|
31
|
+
.word-view{
|
|
32
|
+
width: 100%;
|
|
33
|
+
}
|
|
30
34
|
}
|
|
31
35
|
}
|
|
32
36
|
|
|
33
37
|
.word-view{
|
|
34
38
|
width: 900px;
|
|
35
|
-
height:
|
|
39
|
+
height: calc(100vh - 260px);
|
|
36
40
|
}
|
|
37
41
|
|
|
38
42
|
.dt-image-item{
|
|
@@ -49,9 +53,10 @@
|
|
|
49
53
|
|
|
50
54
|
.dt-upload{
|
|
51
55
|
.ant-upload-list-picture-card{
|
|
56
|
+
min-height: 112px;
|
|
52
57
|
.ant-upload-list-item, .ant-upload {
|
|
53
|
-
height: 104px;
|
|
54
|
-
width: 104px;
|
|
58
|
+
height: 104px !important;
|
|
59
|
+
width: 104px !important;
|
|
55
60
|
}
|
|
56
61
|
}
|
|
57
62
|
|
|
@@ -19,7 +19,7 @@ declare const _sfc_main: import("vue").DefineComponent<{
|
|
|
19
19
|
type: import("vue").PropType<object | ((file: UploadFile) => object)>;
|
|
20
20
|
default: {};
|
|
21
21
|
};
|
|
22
|
-
|
|
22
|
+
fileName: {
|
|
23
23
|
type: StringConstructor;
|
|
24
24
|
default: string;
|
|
25
25
|
};
|
|
@@ -156,7 +156,7 @@ declare const _sfc_main: import("vue").DefineComponent<{
|
|
|
156
156
|
type: import("vue").PropType<object | ((file: UploadFile) => object)>;
|
|
157
157
|
default: {};
|
|
158
158
|
};
|
|
159
|
-
|
|
159
|
+
fileName: {
|
|
160
160
|
type: StringConstructor;
|
|
161
161
|
default: string;
|
|
162
162
|
};
|
|
@@ -223,16 +223,16 @@ declare const _sfc_main: import("vue").DefineComponent<{
|
|
|
223
223
|
onChange?: (...args: any[]) => any;
|
|
224
224
|
}, {
|
|
225
225
|
data: object | ((file: UploadFile) => object);
|
|
226
|
-
disabled: Boolean | import("vue").Ref<Boolean> | import("vue").ComputedRef<Boolean>;
|
|
227
|
-
multiple: boolean;
|
|
228
226
|
buttonText: string;
|
|
229
227
|
preIcon: string;
|
|
230
|
-
|
|
228
|
+
fileName: string;
|
|
231
229
|
accept: string[];
|
|
230
|
+
disabled: Boolean | import("vue").Ref<Boolean> | import("vue").ComputedRef<Boolean>;
|
|
232
231
|
defaultFiles: UploadFile[];
|
|
233
232
|
listType: "text" | "picture-card";
|
|
234
233
|
maxSize: number;
|
|
235
234
|
helpText: string;
|
|
235
|
+
multiple: boolean;
|
|
236
236
|
extraParams: {};
|
|
237
237
|
showView: boolean;
|
|
238
238
|
showDownload: boolean;
|