@dt-frames/ui 2.0.16 → 2.0.17
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 +25 -3
- package/es/components/form/src/props.d.ts +3 -3
- package/es/components/table/index.js +60 -133
- package/es/components/table/index.less +25 -0
- package/es/components/table/src/components/editTable/EditTableCell.d.ts +1 -0
- package/es/components/table/src/index.d.ts +0 -10
- package/es/components/table/src/props.d.ts +0 -4
- package/es/components/table/src/types/table.type.d.ts +8 -0
- package/es/components/tree/index.js +83 -73
- package/es/components/tree/index.less +13 -0
- package/es/components/tree/src/basicProps.d.ts +9 -4
- package/es/components/tree/src/components/ContextMenu.d.ts +6 -0
- package/es/components/tree/src/index.d.ts +11 -11
- package/es/components/tree/src/type/menu.d.ts +3 -0
- package/es/components/tree/src/type/tree.d.ts +0 -1
- package/es/components/upload/index.js +86 -47
- package/es/components/upload/index.less +7 -0
- package/es/components/upload/src/components/WordView.d.ts +1 -0
- package/es/components/upload/src/index.d.ts +1 -0
- package/es/theme/index.js +8 -3
- package/package.json +1 -1
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { Recordable } from "@dt-frames/core";
|
|
1
2
|
export interface Axis {
|
|
2
3
|
x: number;
|
|
3
4
|
y: number;
|
|
@@ -21,6 +22,7 @@ export interface CreateContextOptions {
|
|
|
21
22
|
icon?: string;
|
|
22
23
|
styles?: any;
|
|
23
24
|
items?: ContextMenuItem[];
|
|
25
|
+
node?: Recordable;
|
|
24
26
|
}
|
|
25
27
|
export interface ContextMenuProps {
|
|
26
28
|
event?: MouseEvent;
|
|
@@ -30,4 +32,5 @@ export interface ContextMenuProps {
|
|
|
30
32
|
axis?: Axis;
|
|
31
33
|
width?: number;
|
|
32
34
|
showIcon?: boolean;
|
|
35
|
+
node?: Recordable;
|
|
33
36
|
}
|
|
@@ -2,12 +2,11 @@ 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 { computed, unref, ref, watch, defineComponent, openBlock, createBlock, withCtx, createVNode, createElementVNode, toRefs, createElementBlock, mergeProps, isRef, createSlots, toDisplayString,
|
|
5
|
+
import { computed, unref, ref, watch, defineComponent, openBlock, createBlock, withCtx, createVNode, createElementVNode, toRefs, createElementBlock, mergeProps, isRef, createSlots, normalizeClass, toDisplayString, createCommentVNode, normalizeStyle, Fragment, renderList, renderSlot, normalizeProps, guardReactiveProps } from "vue";
|
|
6
6
|
import { takeRight, omit } from "lodash-es";
|
|
7
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
|
-
import { renderAsync } from "docx-preview";
|
|
11
10
|
const basicProps = {
|
|
12
11
|
uploadUrl: {
|
|
13
12
|
type: Object
|
|
@@ -243,10 +242,19 @@ const _sfc_main$2 = /* @__PURE__ */ defineComponent({
|
|
|
243
242
|
};
|
|
244
243
|
}
|
|
245
244
|
});
|
|
245
|
+
const _export_sfc = (sfc, props) => {
|
|
246
|
+
const target = sfc.__vccOpts || sfc;
|
|
247
|
+
for (const [key, val] of props) {
|
|
248
|
+
target[key] = val;
|
|
249
|
+
}
|
|
250
|
+
return target;
|
|
251
|
+
};
|
|
252
|
+
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"]]);
|
|
246
253
|
const _sfc_main$1 = /* @__PURE__ */ defineComponent({
|
|
247
254
|
__name: "WordView",
|
|
248
255
|
setup(__props) {
|
|
249
256
|
const ID = `word-view-${Math.ceil(Math.random() * 1e6)}`;
|
|
257
|
+
const domRef = ref(null);
|
|
250
258
|
const [register] = useModal({
|
|
251
259
|
width: "900px",
|
|
252
260
|
title: (data) => `\u9644\u4EF6\u9884\u89C8 - ${data.fileName}`,
|
|
@@ -256,56 +264,68 @@ const _sfc_main$1 = /* @__PURE__ */ defineComponent({
|
|
|
256
264
|
wrapClassName: "dt-word",
|
|
257
265
|
maskClosable: false,
|
|
258
266
|
footer: null
|
|
259
|
-
}, (data) => {
|
|
267
|
+
}, async (data) => {
|
|
260
268
|
const fileReader = new FileReader();
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
269
|
+
if (typeof window !== "undefined") {
|
|
270
|
+
let { renderAsync } = await import("docx-preview");
|
|
271
|
+
fileReader.addEventListener("load", (event) => {
|
|
272
|
+
const arrayBuffer = event.target.result;
|
|
273
|
+
renderAsync(arrayBuffer, unref(domRef), null, {
|
|
274
|
+
className: "docx",
|
|
275
|
+
inWrapper: true,
|
|
276
|
+
ignoreWidth: false,
|
|
277
|
+
ignoreHeight: false,
|
|
278
|
+
ignoreFonts: false,
|
|
279
|
+
breakPages: true,
|
|
280
|
+
ignoreLastRenderedPageBreak: true,
|
|
281
|
+
experimental: false,
|
|
282
|
+
trimXmlDeclaration: true,
|
|
283
|
+
debug: false
|
|
284
|
+
}).then((rsp) => {
|
|
285
|
+
dispatchResize();
|
|
286
|
+
});
|
|
276
287
|
});
|
|
277
|
-
|
|
278
|
-
|
|
288
|
+
fileReader.readAsArrayBuffer(data.data);
|
|
289
|
+
}
|
|
279
290
|
});
|
|
280
291
|
return (_ctx, _cache) => {
|
|
281
292
|
return openBlock(), createBlock(unref(DtModal), { onRegister: unref(register) }, {
|
|
282
293
|
default: withCtx(() => [
|
|
283
294
|
createElementVNode("div", {
|
|
295
|
+
ref_key: "domRef",
|
|
296
|
+
ref: domRef,
|
|
284
297
|
id: ID,
|
|
285
298
|
class: "word-view"
|
|
286
|
-
})
|
|
299
|
+
}, null, 512)
|
|
287
300
|
]),
|
|
288
301
|
_: 1
|
|
289
302
|
}, 8, ["onRegister"]);
|
|
290
303
|
};
|
|
291
304
|
}
|
|
292
305
|
});
|
|
306
|
+
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"]]);
|
|
293
307
|
const _hoisted_1 = {
|
|
294
308
|
key: 0,
|
|
295
309
|
class: "flex items-center"
|
|
296
310
|
};
|
|
297
311
|
const _hoisted_2 = { class: "pl-3" };
|
|
298
|
-
const _hoisted_3 = { class: "flex
|
|
299
|
-
const _hoisted_4 =
|
|
300
|
-
const _hoisted_5 =
|
|
301
|
-
const _hoisted_6 = {
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
const
|
|
306
|
-
const
|
|
307
|
-
|
|
308
|
-
|
|
312
|
+
const _hoisted_3 = { class: "flex items-center flex-1" };
|
|
313
|
+
const _hoisted_4 = ["src"];
|
|
314
|
+
const _hoisted_5 = { class: "flex-1 pr-4" };
|
|
315
|
+
const _hoisted_6 = {
|
|
316
|
+
key: 0,
|
|
317
|
+
class: "ant-progress ant-progress-line ant-progress-default ant-progress-status-normal"
|
|
318
|
+
};
|
|
319
|
+
const _hoisted_7 = { class: "ant-progress-outer" };
|
|
320
|
+
const _hoisted_8 = { class: "ant-progress-inner" };
|
|
321
|
+
const _hoisted_9 = { class: "flex items-center" };
|
|
322
|
+
const _hoisted_10 = ["onClick"];
|
|
323
|
+
const _hoisted_11 = { key: 0 };
|
|
324
|
+
const _hoisted_12 = /* @__PURE__ */ createElementVNode("i", { class: "i ic:baseline-file-upload" }, null, -1);
|
|
325
|
+
const _hoisted_13 = /* @__PURE__ */ createElementVNode("div", null, "\u6587\u4EF6\u4E0A\u4F20", -1);
|
|
326
|
+
const _hoisted_14 = [
|
|
327
|
+
_hoisted_12,
|
|
328
|
+
_hoisted_13
|
|
309
329
|
];
|
|
310
330
|
const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
311
331
|
__name: "index",
|
|
@@ -484,15 +504,33 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
484
504
|
"onUpdate:fileList": _cache[0] || (_cache[0] = ($event) => isRef(fileList) ? fileList.value = $event : null)
|
|
485
505
|
}), createSlots({
|
|
486
506
|
itemRender: withCtx(({ file, actions }) => [
|
|
487
|
-
createElementVNode("div",
|
|
488
|
-
|
|
507
|
+
createElementVNode("div", {
|
|
508
|
+
class: normalizeClass(["flex justify-between border border-solid border-gray-300 p-1 mt-2", file?.status === "error" ? "ant-upload-list-item-error" : ""])
|
|
509
|
+
}, [
|
|
510
|
+
createElementVNode("div", _hoisted_3, [
|
|
489
511
|
createElementVNode("img", {
|
|
490
512
|
src: unref(getFileThumb)(file.fileType),
|
|
491
513
|
class: "w-9 h-9 mr-2 p-1"
|
|
492
|
-
}, null, 8,
|
|
493
|
-
createElementVNode("
|
|
514
|
+
}, null, 8, _hoisted_4),
|
|
515
|
+
createElementVNode("div", _hoisted_5, [
|
|
516
|
+
createElementVNode("span", null, toDisplayString(file.fileName || file.name), 1),
|
|
517
|
+
createCommentVNode(" \u8BBE\u7F6E\u8FDB\u5EA6 "),
|
|
518
|
+
file.percent < 100 && file.percent > 0 ? (openBlock(), createElementBlock("div", _hoisted_6, [
|
|
519
|
+
createElementVNode("div", _hoisted_7, [
|
|
520
|
+
createElementVNode("div", _hoisted_8, [
|
|
521
|
+
createElementVNode("div", {
|
|
522
|
+
class: "ant-progress-bg",
|
|
523
|
+
style: normalizeStyle({
|
|
524
|
+
width: `${file.percent}%`,
|
|
525
|
+
height: "2px"
|
|
526
|
+
})
|
|
527
|
+
}, null, 4)
|
|
528
|
+
])
|
|
529
|
+
])
|
|
530
|
+
])) : createCommentVNode("v-if", true)
|
|
531
|
+
])
|
|
494
532
|
]),
|
|
495
|
-
createElementVNode("div",
|
|
533
|
+
createElementVNode("div", _hoisted_9, [
|
|
496
534
|
(openBlock(), createElementBlock(Fragment, null, renderList(btns, (btn) => {
|
|
497
535
|
return openBlock(), createElementBlock(Fragment, {
|
|
498
536
|
key: btn.class
|
|
@@ -501,11 +539,11 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
501
539
|
key: 0,
|
|
502
540
|
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]),
|
|
503
541
|
onClick: ($event) => btn.click(file)
|
|
504
|
-
}, null, 10,
|
|
542
|
+
}, null, 10, _hoisted_10)) : createCommentVNode("v-if", true)
|
|
505
543
|
], 64);
|
|
506
544
|
}), 64))
|
|
507
545
|
])
|
|
508
|
-
])
|
|
546
|
+
], 2)
|
|
509
547
|
]),
|
|
510
548
|
default: withCtx(() => [
|
|
511
549
|
!unref(getBind).disabled ? (openBlock(), createElementBlock("div", _hoisted_1, [
|
|
@@ -519,9 +557,9 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
519
557
|
_: 1
|
|
520
558
|
}),
|
|
521
559
|
createElementVNode("p", _hoisted_2, toDisplayString(unref(getHelpText)), 1)
|
|
522
|
-
])) : createCommentVNode("", true),
|
|
523
|
-
createVNode(
|
|
524
|
-
createVNode(
|
|
560
|
+
])) : createCommentVNode("v-if", true),
|
|
561
|
+
createVNode(PdfView, { onRegister: unref(registerPdf) }, null, 8, ["onRegister"]),
|
|
562
|
+
createVNode(DocxView, { onRegister: unref(registerDocx) }, null, 8, ["onRegister"])
|
|
525
563
|
]),
|
|
526
564
|
_: 2
|
|
527
565
|
}, [
|
|
@@ -533,22 +571,23 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
533
571
|
])
|
|
534
572
|
};
|
|
535
573
|
})
|
|
536
|
-
]), 1040, ["fileList"])) : createCommentVNode("", true),
|
|
574
|
+
]), 1040, ["fileList"])) : createCommentVNode("v-if", true),
|
|
537
575
|
unref(getBind).listType === "picture-card" ? (openBlock(), createBlock(_component_AUpload, mergeProps({ key: 1 }, unref(getBind), {
|
|
538
576
|
fileList: unref(fileList),
|
|
539
577
|
"onUpdate:fileList": _cache[1] || (_cache[1] = ($event) => isRef(fileList) ? fileList.value = $event : null),
|
|
540
578
|
onPreview: handlePreview
|
|
541
579
|
}), {
|
|
542
580
|
default: withCtx(() => [
|
|
543
|
-
!unref(getBind).disabled && (!_ctx.maxCount || !unref(fileList).length || unref(fileList).length < _ctx.maxCount) ? (openBlock(), createElementBlock("div",
|
|
581
|
+
!unref(getBind).disabled && (!_ctx.maxCount || !unref(fileList).length || unref(fileList).length < _ctx.maxCount) ? (openBlock(), createElementBlock("div", _hoisted_11, _hoisted_14)) : createCommentVNode("v-if", true)
|
|
544
582
|
]),
|
|
545
583
|
_: 1
|
|
546
|
-
}, 16, ["fileList"])) : createCommentVNode("", true),
|
|
547
|
-
unref(bindImg).src ? (openBlock(), createBlock(_component_AImage, mergeProps({ key: 2 }, unref(bindImg), { style: { display: "none" } }), null, 16)) : createCommentVNode("", true)
|
|
584
|
+
}, 16, ["fileList"])) : createCommentVNode("v-if", true),
|
|
585
|
+
unref(bindImg).src ? (openBlock(), createBlock(_component_AImage, mergeProps({ key: 2 }, unref(bindImg), { style: { display: "none" } }), null, 16)) : createCommentVNode("v-if", true)
|
|
548
586
|
]);
|
|
549
587
|
};
|
|
550
588
|
}
|
|
551
589
|
});
|
|
590
|
+
const index = /* @__PURE__ */ _export_sfc(_sfc_main, [["__file", "D:/dt/dt-frame-front/dt-frames/frames/packages/ui/src/components/upload/src/index.vue"]]);
|
|
552
591
|
export {
|
|
553
|
-
|
|
592
|
+
index as DtUpload
|
|
554
593
|
};
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
declare const _sfc_main: import("vue").DefineComponent<{}, {
|
|
2
2
|
ID: string;
|
|
3
|
+
domRef: any;
|
|
3
4
|
register: import("../../../modal/src/types/modal.type").RegisterFn;
|
|
4
5
|
readonly DtModal: import("vue").DefineComponent<{}, {}, any, import("vue").ComputedOptions, import("vue").MethodOptions, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{}>>, {}>;
|
|
5
6
|
}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{}>>, {}>;
|
|
@@ -134,6 +134,7 @@ declare const _sfc_main: import("vue").DefineComponent<{
|
|
|
134
134
|
}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{}>>, {}>;
|
|
135
135
|
DocxView: import("vue").DefineComponent<{}, {
|
|
136
136
|
ID: string;
|
|
137
|
+
domRef: any;
|
|
137
138
|
register: import("../../modal/src/types/modal.type").RegisterFn;
|
|
138
139
|
readonly DtModal: import("vue").DefineComponent<{}, {}, any, import("vue").ComputedOptions, import("vue").MethodOptions, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{}>>, {}>;
|
|
139
140
|
}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{}>>, {}>;
|
package/es/theme/index.js
CHANGED
|
@@ -546,14 +546,19 @@ function getBreadCrumb(path, menus) {
|
|
|
546
546
|
}
|
|
547
547
|
function getFilterMenu(filter = "", flag = false) {
|
|
548
548
|
let _menus = [];
|
|
549
|
+
const { getIsZH } = useHeader();
|
|
549
550
|
if (!trim(filter) && !flag)
|
|
550
551
|
return _menus;
|
|
551
552
|
let getTargetMenus = (menusArr) => {
|
|
552
553
|
menusArr.forEach((menu) => {
|
|
553
554
|
if (menu.children && menu.children.length) {
|
|
554
555
|
getTargetMenus(menu.children);
|
|
555
|
-
} else
|
|
556
|
-
|
|
556
|
+
} else {
|
|
557
|
+
let flabel = unref(getIsZH) ? menu.label : menu.enLabel?.toLowerCase();
|
|
558
|
+
let ffilter = unref(getIsZH) ? filter : filter.toLowerCase();
|
|
559
|
+
if (flabel.indexOf(ffilter) !== -1 || flag && !trim(filter)) {
|
|
560
|
+
_menus.push(menu);
|
|
561
|
+
}
|
|
557
562
|
}
|
|
558
563
|
});
|
|
559
564
|
};
|
|
@@ -3940,7 +3945,7 @@ const ZH = {
|
|
|
3940
3945
|
"NUMBER": "\u5E8F\u53F7",
|
|
3941
3946
|
"ACTIONS": "\u64CD\u4F5C",
|
|
3942
3947
|
"TOTAL_PAGE": "\u603B\u5171{total}\u6761",
|
|
3943
|
-
"FILTER": "\u641C\u7D22",
|
|
3948
|
+
"FILTER": "\u641C\u7D22...",
|
|
3944
3949
|
"EXPAND_ALL": "\u5C55\u5F00\u5168\u90E8",
|
|
3945
3950
|
"COLLAPSE_ALL": "\u6298\u53E0\u5168\u90E8",
|
|
3946
3951
|
"SELECT_ALL1": "\u9009\u62E9\u5168\u90E8",
|