qidian-vue-ui 1.2.93 → 1.2.95
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/config-provider/index.d.ts +7 -1
- package/dist/components/config-provider/types.d.ts +2 -0
- package/dist/components/config-provider/useConfig.d.ts +8 -0
- package/dist/components/file-viewer/index.vue.mjs +23 -3
- package/dist/components/office/pdf/index.vue.mjs +2 -2
- package/dist/components/office/pdf/index.vue2.mjs +76 -18
- package/dist/components/office/pdf/index2.css +21 -21
- package/dist/components/office/pdf/types.d.ts +2 -0
- package/dist/components/office/pdf/utils/image2pdf.d.ts +2 -1
- package/dist/components/office/pdf/utils/image2pdf.mjs +16 -2
- package/dist/components/service/table/index.css +7 -7
- package/dist/components/service/table/index.vue.mjs +1 -1
- package/dist/components/service/table/index.vue2.mjs +5 -3
- package/dist/components/service/table/types.d.ts +1 -1
- package/dist/components/tinymce/index.vue.d.ts +4 -4
- package/dist/locales/en-US.d.ts +2 -0
- package/dist/locales/en-US.mjs +3 -1
- package/dist/locales/zh-CN.d.ts +2 -0
- package/dist/locales/zh-CN.mjs +3 -1
- package/dist/locales/zh-TW.d.ts +2 -0
- package/dist/locales/zh-TW.mjs +3 -1
- package/dist/styles/index.css +3 -0
- package/package.json +2 -2
|
@@ -74,6 +74,8 @@ export declare const QdConfigProvider: import("vue").DefineComponent<{
|
|
|
74
74
|
zoomIn?: string;
|
|
75
75
|
cancelAdaptiveView?: string;
|
|
76
76
|
adaptiveView?: string;
|
|
77
|
+
rotateLeft?: string;
|
|
78
|
+
rotateRight?: string;
|
|
77
79
|
};
|
|
78
80
|
dialogTableSelect?: {
|
|
79
81
|
addText?: string;
|
|
@@ -192,6 +194,8 @@ export declare const QdConfigProvider: import("vue").DefineComponent<{
|
|
|
192
194
|
zoomIn?: string;
|
|
193
195
|
cancelAdaptiveView?: string;
|
|
194
196
|
adaptiveView?: string;
|
|
197
|
+
rotateLeft?: string;
|
|
198
|
+
rotateRight?: string;
|
|
195
199
|
};
|
|
196
200
|
dialogTableSelect?: {
|
|
197
201
|
addText?: string;
|
|
@@ -295,6 +299,8 @@ export declare const QdConfigProvider: import("vue").DefineComponent<{
|
|
|
295
299
|
zoomIn?: string;
|
|
296
300
|
cancelAdaptiveView?: string;
|
|
297
301
|
adaptiveView?: string;
|
|
302
|
+
rotateLeft?: string;
|
|
303
|
+
rotateRight?: string;
|
|
298
304
|
};
|
|
299
305
|
dialogTableSelect?: {
|
|
300
306
|
addText?: string;
|
|
@@ -335,7 +341,7 @@ export declare const QdConfigProvider: import("vue").DefineComponent<{
|
|
|
335
341
|
fontFormats?: Record<string, string>;
|
|
336
342
|
};
|
|
337
343
|
}) | undefined;
|
|
338
|
-
upload: Pick<import("..").QdUploadProps<import("tdesign-vue-next").UploadFile, unknown, string | number | (string | number)[], string | number | (string | number)[], unknown, string | string[], string | string[], unknown, string | number | (string | number)[], string | number | (string | number)[]>, "
|
|
344
|
+
upload: Pick<import("..").QdUploadProps<import("tdesign-vue-next").UploadFile, unknown, string | number | (string | number)[], string | number | (string | number)[], unknown, string | string[], string | string[], unknown, string | number | (string | number)[], string | number | (string | number)[]>, "name" | "del" | "action" | "headers" | "method" | "isBatchUpload" | "requestMethod" | "listOssByIds" | "listOssByUrls"> | undefined;
|
|
339
345
|
office: {
|
|
340
346
|
pdfSandboxUrl?: string | undefined;
|
|
341
347
|
pdfWorkerUrl?: string | undefined;
|
|
@@ -62,6 +62,8 @@ export declare function useConfig<T extends keyof NonNullable<QdConfigProviderPr
|
|
|
62
62
|
zoomIn?: string;
|
|
63
63
|
cancelAdaptiveView?: string;
|
|
64
64
|
adaptiveView?: string;
|
|
65
|
+
rotateLeft?: string;
|
|
66
|
+
rotateRight?: string;
|
|
65
67
|
};
|
|
66
68
|
dialogTableSelect?: {
|
|
67
69
|
addText?: string;
|
|
@@ -163,6 +165,8 @@ export declare function useConfig<T extends keyof NonNullable<QdConfigProviderPr
|
|
|
163
165
|
zoomIn?: string;
|
|
164
166
|
cancelAdaptiveView?: string;
|
|
165
167
|
adaptiveView?: string;
|
|
168
|
+
rotateLeft?: string;
|
|
169
|
+
rotateRight?: string;
|
|
166
170
|
};
|
|
167
171
|
dialogTableSelect?: {
|
|
168
172
|
addText?: string;
|
|
@@ -264,6 +268,8 @@ export declare function useConfig<T extends keyof NonNullable<QdConfigProviderPr
|
|
|
264
268
|
zoomIn?: string;
|
|
265
269
|
cancelAdaptiveView?: string;
|
|
266
270
|
adaptiveView?: string;
|
|
271
|
+
rotateLeft?: string;
|
|
272
|
+
rotateRight?: string;
|
|
267
273
|
};
|
|
268
274
|
dialogTableSelect?: {
|
|
269
275
|
addText?: string;
|
|
@@ -366,6 +372,8 @@ export declare function useConfig<T extends keyof NonNullable<QdConfigProviderPr
|
|
|
366
372
|
zoomIn?: string;
|
|
367
373
|
cancelAdaptiveView?: string;
|
|
368
374
|
adaptiveView?: string;
|
|
375
|
+
rotateLeft?: string;
|
|
376
|
+
rotateRight?: string;
|
|
369
377
|
};
|
|
370
378
|
dialogTableSelect?: {
|
|
371
379
|
addText?: string;
|
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
import './index2.css'
|
|
2
2
|
import './index.css'
|
|
3
|
-
import { defineComponent, createBlock, openBlock, unref } from "vue";
|
|
3
|
+
import { defineComponent, computed, createBlock, openBlock, unref } from "vue";
|
|
4
4
|
import { FileViewer } from "@flyfish-group/file-viewer3";
|
|
5
|
+
import QdOfficePdf from "../office/pdf/index.vue.mjs";
|
|
5
6
|
const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
6
7
|
...{ name: "QdFileViewer" },
|
|
7
8
|
__name: "index",
|
|
@@ -11,13 +12,32 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
11
12
|
options: {}
|
|
12
13
|
},
|
|
13
14
|
setup(__props) {
|
|
15
|
+
const props = __props;
|
|
16
|
+
const isPdf = computed(() => {
|
|
17
|
+
const { file, src } = props;
|
|
18
|
+
if (file) {
|
|
19
|
+
if ("type" in file && file.type === "application/pdf") return true;
|
|
20
|
+
if ("name" in file && file.name.endsWith(".pdf")) return true;
|
|
21
|
+
}
|
|
22
|
+
if (src) {
|
|
23
|
+
const pathname = new URL(src, "https://x").pathname;
|
|
24
|
+
if (pathname.endsWith(".pdf")) return true;
|
|
25
|
+
}
|
|
26
|
+
return false;
|
|
27
|
+
});
|
|
14
28
|
return (_ctx, _cache) => {
|
|
15
|
-
return openBlock(), createBlock(unref(
|
|
29
|
+
return isPdf.value ? (openBlock(), createBlock(unref(QdOfficePdf), {
|
|
30
|
+
key: 0,
|
|
31
|
+
class: "qd-file-viewer",
|
|
32
|
+
src: __props.src,
|
|
33
|
+
file: __props.file
|
|
34
|
+
}, null, 8, ["src", "file"])) : (openBlock(), createBlock(unref(FileViewer), {
|
|
35
|
+
key: 1,
|
|
16
36
|
class: "qd-file-viewer",
|
|
17
37
|
file: __props.file,
|
|
18
38
|
url: __props.src,
|
|
19
39
|
options: { toolbar: false, ...__props.options }
|
|
20
|
-
}, null, 8, ["file", "url", "options"]);
|
|
40
|
+
}, null, 8, ["file", "url", "options"]));
|
|
21
41
|
};
|
|
22
42
|
}
|
|
23
43
|
});
|
|
@@ -4,7 +4,7 @@ import _sfc_main from "./index.vue2.mjs";
|
|
|
4
4
|
/* empty css */
|
|
5
5
|
/* empty css */
|
|
6
6
|
import _export_sfc from "../../../_virtual/_plugin-vue_export-helper.mjs";
|
|
7
|
-
const
|
|
7
|
+
const QdOfficePdf = /* @__PURE__ */ _export_sfc(_sfc_main, [["__scopeId", "data-v-f73b844f"]]);
|
|
8
8
|
export {
|
|
9
|
-
|
|
9
|
+
QdOfficePdf as default
|
|
10
10
|
};
|
|
@@ -2,14 +2,14 @@ import './index2.css'
|
|
|
2
2
|
import './index.css'
|
|
3
3
|
import { defineComponent, inject, computed, ref, shallowRef, onMounted, watch, createBlock, openBlock, unref, withCtx, withDirectives, createVNode, createElementBlock, createElementVNode, Transition, createCommentVNode, createTextVNode, toDisplayString, triggerRef } from "vue";
|
|
4
4
|
import { resizeDirective, toPrecision, to, isDev } from "qidian-shared";
|
|
5
|
-
import { ChevronLeftIcon, ChevronRightIcon, ZoomOutIcon, ZoomInIcon, CenterFocusStrongFilledIcon, CenterFocusStrongIcon } from "tdesign-icons-vue-next";
|
|
5
|
+
import { ChevronLeftIcon, ChevronRightIcon, ZoomOutIcon, ZoomInIcon, CenterFocusStrongFilledIcon, CenterFocusStrongIcon, RollbackIcon, RollfrontIcon } from "tdesign-icons-vue-next";
|
|
6
6
|
import { Loading, Tooltip, Button, InputNumber, Divider } from "tdesign-vue-next";
|
|
7
7
|
import { useUICsl, getPublicUrl } from "../../../utils/tools.mjs";
|
|
8
8
|
import { PROVIDE_OFFICE } from "../../config-provider/config.mjs";
|
|
9
9
|
import { useConfig } from "../../config-provider/useConfig.mjs";
|
|
10
10
|
import { ADAPTIVE_VIEW, ZOOM_SCALE_LIMIT } from "./config.mjs";
|
|
11
11
|
import { useZoom } from "./hooks/useZoom.mjs";
|
|
12
|
-
import { image2pdf, isImageUrl } from "./utils/image2pdf.mjs";
|
|
12
|
+
import { isImageFile, image2pdf, isImageUrl } from "./utils/image2pdf.mjs";
|
|
13
13
|
import { useDebounceFn } from "../../../node_modules/.pnpm/@vueuse_shared@14.2.0_vue@3.5.26_typescript@5.9.3_/node_modules/@vueuse/shared/dist/index.mjs";
|
|
14
14
|
const _hoisted_1 = {
|
|
15
15
|
key: 0,
|
|
@@ -26,6 +26,7 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
26
26
|
__name: "index",
|
|
27
27
|
props: {
|
|
28
28
|
src: {},
|
|
29
|
+
file: {},
|
|
29
30
|
mode: {},
|
|
30
31
|
sandboxUrl: {},
|
|
31
32
|
workerUrl: {},
|
|
@@ -93,10 +94,10 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
93
94
|
return viewerVm && viewerVm.currentScale >= ZOOM_SCALE_LIMIT.MAX;
|
|
94
95
|
});
|
|
95
96
|
async function render() {
|
|
96
|
-
const { src, mode } = props;
|
|
97
|
+
const { file, src, mode } = props;
|
|
97
98
|
const containerEl = containerRef.value;
|
|
98
99
|
const viewerEl = viewerRef.value;
|
|
99
|
-
if (!src || !containerEl || !viewerEl) return;
|
|
100
|
+
if (!file && !src || !containerEl || !viewerEl) return;
|
|
100
101
|
const { getDocument, GlobalWorkerOptions } = await import("pdfjs-dist/legacy/build/pdf.mjs");
|
|
101
102
|
const { EventBus, PDFFindController, PDFLinkService, PDFScriptingManager, PDFViewer } = await import("pdfjs-dist/legacy/web/pdf_viewer.mjs");
|
|
102
103
|
GlobalWorkerOptions.workerSrc = workerSrc.value;
|
|
@@ -105,16 +106,33 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
105
106
|
pdfBlobUrl.value = void 0;
|
|
106
107
|
}
|
|
107
108
|
loading.value = true;
|
|
108
|
-
let
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
109
|
+
let loadParams;
|
|
110
|
+
if (file) {
|
|
111
|
+
if (file instanceof Blob && isImageFile(file)) {
|
|
112
|
+
const [err, blobUrl] = await to(image2pdf(file));
|
|
113
|
+
if (err) {
|
|
114
|
+
loading.value = false;
|
|
115
|
+
return;
|
|
116
|
+
}
|
|
117
|
+
loadParams = { url: blobUrl };
|
|
118
|
+
pdfBlobUrl.value = blobUrl;
|
|
119
|
+
} else {
|
|
120
|
+
const data = file instanceof ArrayBuffer ? file : await file.arrayBuffer();
|
|
121
|
+
loadParams = { data };
|
|
115
122
|
}
|
|
116
|
-
|
|
117
|
-
|
|
123
|
+
} else {
|
|
124
|
+
let pdfSrc = src;
|
|
125
|
+
const shouldConvert = mode === "img" || mode === "pdf" && isImageUrl(pdfSrc);
|
|
126
|
+
if (shouldConvert) {
|
|
127
|
+
const [err, blobUrl] = await to(image2pdf(pdfSrc));
|
|
128
|
+
if (err) {
|
|
129
|
+
loading.value = false;
|
|
130
|
+
return;
|
|
131
|
+
}
|
|
132
|
+
pdfSrc = blobUrl;
|
|
133
|
+
pdfBlobUrl.value = blobUrl;
|
|
134
|
+
}
|
|
135
|
+
loadParams = { url: pdfSrc };
|
|
118
136
|
}
|
|
119
137
|
const eventBus = new EventBus();
|
|
120
138
|
const linkService = new PDFLinkService({
|
|
@@ -158,7 +176,7 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
158
176
|
linkService.setViewer(viewerVm);
|
|
159
177
|
scriptingManager.setViewer(viewerVm);
|
|
160
178
|
const loadingTask = getDocument({
|
|
161
|
-
|
|
179
|
+
...loadParams,
|
|
162
180
|
cMapUrl: cMapSrc.value,
|
|
163
181
|
iccUrl: iccSrc.value,
|
|
164
182
|
wasmUrl: wasmSrc.value,
|
|
@@ -209,20 +227,25 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
209
227
|
viewerVm.currentPageNumber = page;
|
|
210
228
|
updateViewer();
|
|
211
229
|
}
|
|
230
|
+
function rotate(degrees) {
|
|
231
|
+
const viewerVm = viewer.value;
|
|
232
|
+
if (!viewerVm) return;
|
|
233
|
+
viewerVm.pagesRotation = (viewerVm.pagesRotation + degrees + 360) % 360;
|
|
234
|
+
updateViewer();
|
|
235
|
+
}
|
|
212
236
|
function onScroll() {
|
|
213
237
|
debounceUpdateViewer();
|
|
214
238
|
}
|
|
215
239
|
onMounted(() => {
|
|
216
|
-
|
|
217
|
-
watch(() => props.src, render);
|
|
240
|
+
watch([() => props.src, () => props.file], render, { immediate: true });
|
|
218
241
|
});
|
|
219
242
|
return (_ctx, _cache) => {
|
|
220
243
|
return openBlock(), createBlock(unref(Loading), {
|
|
221
244
|
class: "qd-office-pdf",
|
|
222
245
|
loading: loading.value,
|
|
223
246
|
size: "small",
|
|
224
|
-
onMouseover: _cache[
|
|
225
|
-
onMouseleave: _cache[
|
|
247
|
+
onMouseover: _cache[7] || (_cache[7] = ($event) => showControls.value = true),
|
|
248
|
+
onMouseleave: _cache[8] || (_cache[8] = ($event) => showControls.value = false)
|
|
226
249
|
}, {
|
|
227
250
|
default: withCtx(() => [
|
|
228
251
|
withDirectives((openBlock(), createElementBlock("div", {
|
|
@@ -359,6 +382,41 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
359
382
|
}, 8, ["theme"])
|
|
360
383
|
]),
|
|
361
384
|
_: 1
|
|
385
|
+
}, 8, ["content"]),
|
|
386
|
+
createVNode(unref(Divider), { layout: "vertical" }),
|
|
387
|
+
createVNode(unref(Tooltip), {
|
|
388
|
+
content: unref(t)("rotateLeft")
|
|
389
|
+
}, {
|
|
390
|
+
default: withCtx(() => [
|
|
391
|
+
createVNode(unref(Button), {
|
|
392
|
+
variant: "text",
|
|
393
|
+
theme: "default",
|
|
394
|
+
onClick: _cache[5] || (_cache[5] = ($event) => rotate(-90))
|
|
395
|
+
}, {
|
|
396
|
+
icon: withCtx(() => [
|
|
397
|
+
createVNode(unref(RollbackIcon))
|
|
398
|
+
]),
|
|
399
|
+
_: 1
|
|
400
|
+
})
|
|
401
|
+
]),
|
|
402
|
+
_: 1
|
|
403
|
+
}, 8, ["content"]),
|
|
404
|
+
createVNode(unref(Tooltip), {
|
|
405
|
+
content: unref(t)("rotateRight")
|
|
406
|
+
}, {
|
|
407
|
+
default: withCtx(() => [
|
|
408
|
+
createVNode(unref(Button), {
|
|
409
|
+
variant: "text",
|
|
410
|
+
theme: "default",
|
|
411
|
+
onClick: _cache[6] || (_cache[6] = ($event) => rotate(90))
|
|
412
|
+
}, {
|
|
413
|
+
icon: withCtx(() => [
|
|
414
|
+
createVNode(unref(RollfrontIcon))
|
|
415
|
+
]),
|
|
416
|
+
_: 1
|
|
417
|
+
})
|
|
418
|
+
]),
|
|
419
|
+
_: 1
|
|
362
420
|
}, 8, ["content"])
|
|
363
421
|
])
|
|
364
422
|
])) : createCommentVNode("", true)
|
|
@@ -1,26 +1,26 @@
|
|
|
1
|
-
.qd-office-pdf[data-v-
|
|
1
|
+
.qd-office-pdf[data-v-f73b844f] {
|
|
2
2
|
width: 100%;
|
|
3
3
|
height: 100%;
|
|
4
4
|
position: relative;
|
|
5
5
|
background-color: var(--td-bg-color-component);
|
|
6
6
|
}
|
|
7
|
-
.qd-office-pdf__container[data-v-
|
|
7
|
+
.qd-office-pdf__container[data-v-f73b844f] {
|
|
8
8
|
position: absolute;
|
|
9
9
|
width: 100%;
|
|
10
10
|
max-height: 100%;
|
|
11
11
|
overflow: auto;
|
|
12
12
|
}
|
|
13
|
-
.qd-office-pdf__viewer[data-v-
|
|
13
|
+
.qd-office-pdf__viewer[data-v-f73b844f] {
|
|
14
14
|
width: 100%;
|
|
15
15
|
height: 100%;
|
|
16
16
|
}
|
|
17
|
-
.qd-office-pdf__viewer[data-v-
|
|
17
|
+
.qd-office-pdf__viewer[data-v-f73b844f] .page {
|
|
18
18
|
box-sizing: content-box;
|
|
19
19
|
}
|
|
20
|
-
.qd-office-pdf__viewer[data-v-
|
|
20
|
+
.qd-office-pdf__viewer[data-v-f73b844f] .annotationLayer :is(.linkAnnotation, .buttonWidgetAnnotation.pushButton):not(.hasBorder) > a {
|
|
21
21
|
background-color: transparent;
|
|
22
22
|
}
|
|
23
|
-
.qd-office-pdf__controls[data-v-
|
|
23
|
+
.qd-office-pdf__controls[data-v-f73b844f] {
|
|
24
24
|
position: absolute;
|
|
25
25
|
left: 50%;
|
|
26
26
|
bottom: var(--td-comp-paddingTB-xl) !important;
|
|
@@ -32,39 +32,39 @@
|
|
|
32
32
|
user-select: none;
|
|
33
33
|
transition: all 0.2s linear;
|
|
34
34
|
}
|
|
35
|
-
.qd-office-pdf__controls .t-button[data-v-
|
|
35
|
+
.qd-office-pdf__controls .t-button[data-v-f73b844f] {
|
|
36
36
|
width: 38px;
|
|
37
37
|
height: 38px;
|
|
38
38
|
padding: 0;
|
|
39
39
|
margin-left: 0;
|
|
40
40
|
}
|
|
41
|
-
.qd-office-pdf__controls-body[data-v-
|
|
41
|
+
.qd-office-pdf__controls-body[data-v-f73b844f] {
|
|
42
42
|
display: flex;
|
|
43
43
|
align-items: center;
|
|
44
44
|
opacity: 0.5;
|
|
45
45
|
transition: opacity 0.2s linear;
|
|
46
46
|
}
|
|
47
|
-
.qd-office-pdf__controls-scale[data-v-
|
|
47
|
+
.qd-office-pdf__controls-scale[data-v-f73b844f] {
|
|
48
48
|
width: 39px;
|
|
49
49
|
margin: 0 var(--td-comp-margin-s);
|
|
50
50
|
}
|
|
51
|
-
.qd-office-pdf__controls-page[data-v-
|
|
51
|
+
.qd-office-pdf__controls-page[data-v-f73b844f] {
|
|
52
52
|
display: flex;
|
|
53
53
|
align-items: stretch;
|
|
54
54
|
}
|
|
55
|
-
.qd-office-pdf__controls-page[data-v-
|
|
55
|
+
.qd-office-pdf__controls-page[data-v-f73b844f] .t-input-number {
|
|
56
56
|
width: auto;
|
|
57
57
|
}
|
|
58
|
-
.qd-office-pdf__controls-page[data-v-
|
|
58
|
+
.qd-office-pdf__controls-page[data-v-f73b844f] .t-input-number .t-input {
|
|
59
59
|
padding: 0;
|
|
60
60
|
}
|
|
61
|
-
.qd-office-pdf__controls-page[data-v-
|
|
61
|
+
.qd-office-pdf__controls-page[data-v-f73b844f] .t-input-number .t-input__wrap {
|
|
62
62
|
min-width: 32px;
|
|
63
63
|
}
|
|
64
|
-
.qd-office-pdf__controls-page[data-v-
|
|
64
|
+
.qd-office-pdf__controls-page[data-v-f73b844f] .t-input-number .t-input__inner {
|
|
65
65
|
min-width: 32px;
|
|
66
66
|
}
|
|
67
|
-
.qd-office-pdf__controls-page-input[data-v-
|
|
67
|
+
.qd-office-pdf__controls-page-input[data-v-f73b844f] {
|
|
68
68
|
display: inline-flex;
|
|
69
69
|
align-items: center;
|
|
70
70
|
flex-shrink: 0;
|
|
@@ -74,17 +74,17 @@
|
|
|
74
74
|
background-color: var(--td-bg-color-secondarycontainer);
|
|
75
75
|
border-radius: var(--td-radius-default);
|
|
76
76
|
}
|
|
77
|
-
.qd-office-pdf__controls[data-v-
|
|
77
|
+
.qd-office-pdf__controls[data-v-f73b844f]:hover {
|
|
78
78
|
background-color: var(--td-bg-color-container);
|
|
79
79
|
}
|
|
80
|
-
.qd-office-pdf__controls:hover .qd-office-pdf__controls-body[data-v-
|
|
80
|
+
.qd-office-pdf__controls:hover .qd-office-pdf__controls-body[data-v-f73b844f] {
|
|
81
81
|
opacity: 1;
|
|
82
82
|
}
|
|
83
|
-
.controls-fade-leave-active[data-v-
|
|
84
|
-
.controls-fade-enter-active[data-v-
|
|
83
|
+
.controls-fade-leave-active[data-v-f73b844f],
|
|
84
|
+
.controls-fade-enter-active[data-v-f73b844f] {
|
|
85
85
|
transition: opacity 0.28s cubic-bezier(0.38, 0, 0.24, 1);
|
|
86
86
|
}
|
|
87
|
-
.controls-fade-enter-from[data-v-
|
|
88
|
-
.controls-fade-leave-to[data-v-
|
|
87
|
+
.controls-fade-enter-from[data-v-f73b844f],
|
|
88
|
+
.controls-fade-leave-to[data-v-f73b844f] {
|
|
89
89
|
opacity: 0;
|
|
90
90
|
}
|
|
@@ -1,7 +1,9 @@
|
|
|
1
1
|
import type { PDFPageView } from 'pdfjs-dist/web/pdf_viewer.d.mts';
|
|
2
|
+
import type { QdFileViewerFile } from '../../file-viewer';
|
|
2
3
|
export type QdOfficePdfMode = 'pdf' | 'img';
|
|
3
4
|
export interface QdOfficePdfProps {
|
|
4
5
|
src?: string;
|
|
6
|
+
file?: QdFileViewerFile;
|
|
5
7
|
mode?: QdOfficePdfMode;
|
|
6
8
|
sandboxUrl?: string;
|
|
7
9
|
workerUrl?: string;
|
|
@@ -1,6 +1,11 @@
|
|
|
1
1
|
function isImageUrl(url) {
|
|
2
2
|
return /\.(jpg|jpeg|png|gif|webp|bmp)(\?.*)?$/i.test(url);
|
|
3
3
|
}
|
|
4
|
+
function isImageFile(file) {
|
|
5
|
+
if (file.type.startsWith("image/")) return true;
|
|
6
|
+
if (!(file instanceof File)) return false;
|
|
7
|
+
return /\.(jpg|jpeg|png|gif|webp|bmp)$/i.test(file.name);
|
|
8
|
+
}
|
|
4
9
|
function loadImage(src) {
|
|
5
10
|
return new Promise((resolve, reject) => {
|
|
6
11
|
const img = new Image();
|
|
@@ -10,9 +15,17 @@ function loadImage(src) {
|
|
|
10
15
|
img.src = src;
|
|
11
16
|
});
|
|
12
17
|
}
|
|
13
|
-
async function image2pdf(
|
|
18
|
+
async function image2pdf(image) {
|
|
14
19
|
const { jsPDF } = await import("jspdf");
|
|
15
|
-
|
|
20
|
+
let objectUrl;
|
|
21
|
+
if (image instanceof Blob) {
|
|
22
|
+
objectUrl = URL.createObjectURL(image);
|
|
23
|
+
}
|
|
24
|
+
const imgSrc = objectUrl ?? image;
|
|
25
|
+
const img = await loadImage(imgSrc);
|
|
26
|
+
if (objectUrl) {
|
|
27
|
+
URL.revokeObjectURL(objectUrl);
|
|
28
|
+
}
|
|
16
29
|
const imgRatio = img.width / img.height;
|
|
17
30
|
let pdfWidth = 210;
|
|
18
31
|
let pdfHeight = 297;
|
|
@@ -39,5 +52,6 @@ async function image2pdf(imageUrl) {
|
|
|
39
52
|
}
|
|
40
53
|
export {
|
|
41
54
|
image2pdf,
|
|
55
|
+
isImageFile,
|
|
42
56
|
isImageUrl
|
|
43
57
|
};
|
|
@@ -1,19 +1,19 @@
|
|
|
1
|
-
.qd-service-table[data-v-
|
|
1
|
+
.qd-service-table[data-v-f9252567] {
|
|
2
2
|
height: 100%;
|
|
3
3
|
display: flex;
|
|
4
4
|
flex-direction: column;
|
|
5
5
|
}
|
|
6
|
-
.qd-service-table[data-v-
|
|
6
|
+
.qd-service-table[data-v-f9252567] > .t-table__content {
|
|
7
7
|
flex: 1;
|
|
8
8
|
}
|
|
9
|
-
.qd-service-table[data-v-
|
|
9
|
+
.qd-service-table[data-v-f9252567] .t-table__tree-col:not(:has(.t-table__tree-op-icon)) {
|
|
10
10
|
margin-left: calc(var(--td-font-size-body-large) + var(--td-comp-margin-s));
|
|
11
11
|
}
|
|
12
|
-
.qd-service-table[data-v-
|
|
12
|
+
.qd-service-table[data-v-f9252567] .t-table__tree-leaf-node .t-table__tree-op-icon:empty {
|
|
13
13
|
width: calc(var(--td-font-size-body-large) + var(--td-comp-margin-s));
|
|
14
14
|
}
|
|
15
|
-
.qd-service-table--ps-x-fixed[data-v-
|
|
15
|
+
.qd-service-table--ps-x-fixed[data-v-f9252567] .ps__rail-x {
|
|
16
16
|
position: fixed;
|
|
17
|
-
left: var(--
|
|
18
|
-
bottom: var(--
|
|
17
|
+
left: var(--v042d60c2) !important;
|
|
18
|
+
bottom: var(--v4b2250e0) !important;
|
|
19
19
|
}
|
|
@@ -2,7 +2,7 @@ import './index.css'
|
|
|
2
2
|
import _sfc_main from "./index.vue2.mjs";
|
|
3
3
|
/* empty css */
|
|
4
4
|
import _export_sfc from "../../../_virtual/_plugin-vue_export-helper.mjs";
|
|
5
|
-
const QdServiceTable = /* @__PURE__ */ _export_sfc(_sfc_main, [["__scopeId", "data-v-
|
|
5
|
+
const QdServiceTable = /* @__PURE__ */ _export_sfc(_sfc_main, [["__scopeId", "data-v-f9252567"]]);
|
|
6
6
|
export {
|
|
7
7
|
QdServiceTable as default
|
|
8
8
|
};
|
|
@@ -302,8 +302,8 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
302
302
|
emit: __emit
|
|
303
303
|
}) {
|
|
304
304
|
useCssVars((_ctx) => ({
|
|
305
|
-
"
|
|
306
|
-
"
|
|
305
|
+
"v042d60c2": tableContentLeft.value,
|
|
306
|
+
"v4b2250e0": outsideBottom.value
|
|
307
307
|
}));
|
|
308
308
|
const props = __props;
|
|
309
309
|
const emit = __emit;
|
|
@@ -657,7 +657,8 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
657
657
|
run,
|
|
658
658
|
cancel,
|
|
659
659
|
refresh,
|
|
660
|
-
refreshAsync
|
|
660
|
+
refreshAsync,
|
|
661
|
+
setPollingInterval
|
|
661
662
|
} = useServicePagination({
|
|
662
663
|
...reProps.value.serviceOptions,
|
|
663
664
|
onSuccess: async (res) => {
|
|
@@ -812,6 +813,7 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
812
813
|
cancel,
|
|
813
814
|
refresh,
|
|
814
815
|
refreshAsync,
|
|
816
|
+
setPollingInterval,
|
|
815
817
|
getData: (key) => {
|
|
816
818
|
if (props.tree) return tableRef.value?.getData(key);
|
|
817
819
|
return data.value.find((item) => get(item, props.rowKey || qdServiceTableProps.rowKey) === key);
|
|
@@ -28,6 +28,6 @@ export interface QdServiceTableProps<D extends TableRowData = TableRowData, R =
|
|
|
28
28
|
export type QdServiceTableCol<D extends TableRowData = TableRowData> = NonNullable<QdServiceTableProps<D>['columns']>[number];
|
|
29
29
|
export type QdServiceTableInstanceFunctions<D extends TableRowData = TableRowData, R = unknown, P = ServicePageParams, TP = P, Pag extends ServicePagination = ServicePagination, HasTree extends boolean = boolean> = (HasTree extends true ? EnhancedTableInstanceFunctions<D> : PrimaryTableInstanceFunctions<D> & {
|
|
30
30
|
getData: (key: TableRowValue) => D | undefined;
|
|
31
|
-
}) & UnwrapAllRefs<Pick<ReturnType<typeof useServicePagination<D, R, P, TP, Pag>>, 'data' | 'firstLoad' | 'manualTriggerLoad' | 'loading' | 'current' | 'pageSize' | 'total' | 'changeCurrent' | 'changePageSize' | 'changePagination' | 'runAsync' | 'run' | 'cancel' | 'refresh' | 'refreshAsync'>> & {
|
|
31
|
+
}) & UnwrapAllRefs<Pick<ReturnType<typeof useServicePagination<D, R, P, TP, Pag>>, 'data' | 'firstLoad' | 'manualTriggerLoad' | 'loading' | 'current' | 'pageSize' | 'total' | 'changeCurrent' | 'changePageSize' | 'changePagination' | 'runAsync' | 'run' | 'cancel' | 'refresh' | 'refreshAsync' | 'setPollingInterval'>> & {
|
|
32
32
|
tableLoad?: boolean;
|
|
33
33
|
};
|
|
@@ -19,12 +19,12 @@ declare const _default: import("vue").DefineComponent<QdTinymceProps, {
|
|
|
19
19
|
disabled: any;
|
|
20
20
|
tinymceScriptSrc: any;
|
|
21
21
|
}> & Omit<{
|
|
22
|
+
readonly toolbar: any;
|
|
22
23
|
readonly disabled: any;
|
|
23
24
|
readonly modelValue: any;
|
|
24
25
|
readonly id: any;
|
|
25
26
|
readonly init: any;
|
|
26
27
|
readonly initialValue: any;
|
|
27
|
-
readonly toolbar: any;
|
|
28
28
|
readonly inline: any;
|
|
29
29
|
readonly plugins: any;
|
|
30
30
|
readonly apiKey: any;
|
|
@@ -33,7 +33,7 @@ declare const _default: import("vue").DefineComponent<QdTinymceProps, {
|
|
|
33
33
|
readonly modelEvents: any;
|
|
34
34
|
readonly tagName: any;
|
|
35
35
|
readonly tinymceScriptSrc: any;
|
|
36
|
-
} & import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, "disabled" | "modelValue" | "id" | "init" | "initialValue" | "
|
|
36
|
+
} & import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, "toolbar" | "disabled" | "modelValue" | "id" | "init" | "initialValue" | "inline" | "plugins" | "apiKey" | "cloudChannel" | "outputFormat" | "modelEvents" | "tagName" | "tinymceScriptSrc">;
|
|
37
37
|
$attrs: {
|
|
38
38
|
[x: string]: unknown;
|
|
39
39
|
};
|
|
@@ -105,17 +105,17 @@ declare const _default: import("vue").DefineComponent<QdTinymceProps, {
|
|
|
105
105
|
placeholder: string;
|
|
106
106
|
theme: "light" | "dark";
|
|
107
107
|
name: string;
|
|
108
|
+
options: Partial<RawEditorSettings>;
|
|
109
|
+
toolbar: string | string[];
|
|
108
110
|
disabled: boolean;
|
|
109
111
|
onBlur: () => void;
|
|
110
112
|
onChange: (content: string) => void;
|
|
111
113
|
onFocus: () => void;
|
|
112
|
-
options: Partial<RawEditorSettings>;
|
|
113
114
|
action: string | ((bucketConfigKey?: string) => string);
|
|
114
115
|
headers: {
|
|
115
116
|
[key: string]: string;
|
|
116
117
|
};
|
|
117
118
|
method: "POST" | "GET" | "PUT" | "OPTIONS" | "PATCH" | "post" | "get" | "put" | "options" | "patch";
|
|
118
|
-
toolbar: string | string[];
|
|
119
119
|
formatResponse: (response: any, context: import("tdesign-vue-next").FormatResponseContext) => import("tdesign-vue-next").ResponseType;
|
|
120
120
|
bucketConfigKey: string;
|
|
121
121
|
plugins: string[];
|
package/dist/locales/en-US.d.ts
CHANGED
package/dist/locales/en-US.mjs
CHANGED
|
@@ -66,7 +66,9 @@ const enUS = {
|
|
|
66
66
|
adaptiveView: "Adaptive",
|
|
67
67
|
cancelAdaptiveView: "Cancel adaptive",
|
|
68
68
|
nextPage: "Next page",
|
|
69
|
-
prevPage: "Previous page"
|
|
69
|
+
prevPage: "Previous page",
|
|
70
|
+
rotateLeft: "Rotate left",
|
|
71
|
+
rotateRight: "Rotate right"
|
|
70
72
|
},
|
|
71
73
|
dialogTableSelect: {
|
|
72
74
|
addText: "Can't select one? Click here to add one.",
|
package/dist/locales/zh-CN.d.ts
CHANGED
package/dist/locales/zh-CN.mjs
CHANGED
package/dist/locales/zh-TW.d.ts
CHANGED
package/dist/locales/zh-TW.mjs
CHANGED
package/dist/styles/index.css
CHANGED
|
@@ -199,6 +199,9 @@ p {
|
|
|
199
199
|
.t-table__scroll-bar-divider {
|
|
200
200
|
display: none;
|
|
201
201
|
}
|
|
202
|
+
.t-table__expanded-row-inner {
|
|
203
|
+
background-color: var(--td-bg-color-secondarycontainer);
|
|
204
|
+
}
|
|
202
205
|
.t-table--header-bg-inherit .t-table__header > tr > th {
|
|
203
206
|
background-color: inherit !important;
|
|
204
207
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "qidian-vue-ui",
|
|
3
|
-
"version": "1.2.
|
|
3
|
+
"version": "1.2.95",
|
|
4
4
|
"description": "基于 TDesign 的 QiDian Vue UI 组件库",
|
|
5
5
|
"author": "qidian",
|
|
6
6
|
"license": "MIT",
|
|
@@ -128,7 +128,7 @@
|
|
|
128
128
|
"vue-echarts": "^8.0.1",
|
|
129
129
|
"vue-stream-markdown": "^0.6.5",
|
|
130
130
|
"@flyfish-group/file-viewer3": "^1.0.12",
|
|
131
|
-
"qidian-shared": "1.0.
|
|
131
|
+
"qidian-shared": "1.0.73"
|
|
132
132
|
},
|
|
133
133
|
"scripts": {
|
|
134
134
|
"clean": "rm -rf dist",
|