giime 0.7.11 → 0.7.13
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/index.css +20 -23
- package/es/components/src/base/carousel/Carousel.vue.d.ts +1 -0
- package/es/components/src/base/carousel/Carousel.vue2.mjs +1 -1
- package/es/components/src/base/carousel/Carousel.vue2.mjs.map +1 -1
- package/es/components/src/base/carousel/index.d.ts +3 -0
- package/es/components/src/composite/fileComponent/FileComponent.vue.d.ts +44 -2
- package/es/components/src/composite/fileComponent/FileComponent.vue2.mjs +53 -28
- package/es/components/src/composite/fileComponent/FileComponent.vue2.mjs.map +1 -1
- package/es/components/src/composite/fileComponent/fileComponent.d.ts +18 -0
- package/es/components/src/composite/fileComponent/fileComponent.mjs +15 -0
- package/es/components/src/composite/fileComponent/fileComponent.mjs.map +1 -1
- package/es/components/src/composite/fileComponent/index.d.ts +199 -28
- package/es/components/src/composite/fileList2/FileList.vue.d.ts +81 -11
- package/es/components/src/composite/fileList2/FileList.vue2.mjs +54 -24
- package/es/components/src/composite/fileList2/FileList.vue2.mjs.map +1 -1
- package/es/components/src/composite/fileList2/fileList.d.ts +28 -1
- package/es/components/src/composite/fileList2/fileList.mjs +16 -0
- package/es/components/src/composite/fileList2/fileList.mjs.map +1 -1
- package/es/components/src/composite/fileList2/index.d.ts +281 -33
- package/es/components/src/composite/previewFile/PreviewFile.vue.d.ts +45 -3
- package/es/components/src/composite/previewFile/PreviewFile.vue2.mjs +5 -4
- package/es/components/src/composite/previewFile/PreviewFile.vue2.mjs.map +1 -1
- package/es/components/src/composite/previewFile/index.d.ts +45 -3
- package/es/components/src/composite/previewFile/previewFile.d.ts +21 -1
- package/es/components/src/composite/previewFile/previewFile.mjs +6 -1
- package/es/components/src/composite/previewFile/previewFile.mjs.map +1 -1
- package/es/components/src/composite/uploadFile/UploadFile.vue.d.ts +51 -0
- package/es/components/src/composite/uploadFile/index.d.ts +107 -0
- package/es/components/src/composite/uploadFile/uploadFile.d.ts +23 -0
- package/es/giime/version.d.ts +1 -1
- package/es/giime/version.mjs +1 -1
- package/es/giime/version.mjs.map +1 -1
- package/es/index.css +20 -23
- package/lib/components/src/base/carousel/Carousel.vue.d.ts +1 -0
- package/lib/components/src/base/carousel/Carousel.vue2.js +1 -1
- package/lib/components/src/base/carousel/Carousel.vue2.js.map +1 -1
- package/lib/components/src/base/carousel/index.d.ts +3 -0
- package/lib/components/src/composite/fileComponent/FileComponent.vue.d.ts +44 -2
- package/lib/components/src/composite/fileComponent/FileComponent.vue2.js +52 -27
- package/lib/components/src/composite/fileComponent/FileComponent.vue2.js.map +1 -1
- package/lib/components/src/composite/fileComponent/fileComponent.d.ts +18 -0
- package/lib/components/src/composite/fileComponent/fileComponent.js +15 -0
- package/lib/components/src/composite/fileComponent/fileComponent.js.map +1 -1
- package/lib/components/src/composite/fileComponent/index.d.ts +199 -28
- package/lib/components/src/composite/fileList2/FileList.vue.d.ts +81 -11
- package/lib/components/src/composite/fileList2/FileList.vue2.js +53 -23
- package/lib/components/src/composite/fileList2/FileList.vue2.js.map +1 -1
- package/lib/components/src/composite/fileList2/fileList.d.ts +28 -1
- package/lib/components/src/composite/fileList2/fileList.js +16 -0
- package/lib/components/src/composite/fileList2/fileList.js.map +1 -1
- package/lib/components/src/composite/fileList2/index.d.ts +281 -33
- package/lib/components/src/composite/previewFile/PreviewFile.vue.d.ts +45 -3
- package/lib/components/src/composite/previewFile/PreviewFile.vue2.js +4 -3
- package/lib/components/src/composite/previewFile/PreviewFile.vue2.js.map +1 -1
- package/lib/components/src/composite/previewFile/index.d.ts +45 -3
- package/lib/components/src/composite/previewFile/previewFile.d.ts +21 -1
- package/lib/components/src/composite/previewFile/previewFile.js +6 -1
- package/lib/components/src/composite/previewFile/previewFile.js.map +1 -1
- package/lib/components/src/composite/uploadFile/UploadFile.vue.d.ts +51 -0
- package/lib/components/src/composite/uploadFile/index.d.ts +107 -0
- package/lib/components/src/composite/uploadFile/uploadFile.d.ts +23 -0
- package/lib/giime/version.d.ts +1 -1
- package/lib/giime/version.js +1 -1
- package/lib/giime/version.js.map +1 -1
- package/lib/index.css +20 -23
- package/package.json +1 -1
package/dist/index.css
CHANGED
|
@@ -590,9 +590,6 @@ video {
|
|
|
590
590
|
.gm-h-1 {
|
|
591
591
|
height: 0.25rem;
|
|
592
592
|
}
|
|
593
|
-
.gm-h-32 {
|
|
594
|
-
height: 8rem;
|
|
595
|
-
}
|
|
596
593
|
.gm-h-\[30px\] {
|
|
597
594
|
height: 30px;
|
|
598
595
|
}
|
|
@@ -965,27 +962,27 @@ video {
|
|
|
965
962
|
.gm-flex-justify-between[data-v-c17deec9] {
|
|
966
963
|
justify-content: space-between;
|
|
967
964
|
}
|
|
968
|
-
[data-v-
|
|
965
|
+
[data-v-98c2e804] .gmTableNoBorder .el-table__body .el-table__cell {
|
|
969
966
|
border-right: none;
|
|
970
967
|
}
|
|
971
968
|
|
|
972
|
-
[data-v-
|
|
969
|
+
[data-v-98c2e804] .gmTableNoBorder .el-table__inner-wrapper:before {
|
|
973
970
|
height: 0;
|
|
974
971
|
}
|
|
975
972
|
|
|
976
|
-
[data-v-
|
|
973
|
+
[data-v-98c2e804] .gmTableNoBorder.el-table--border .el-table__inner-wrapper:after {
|
|
977
974
|
height: 0;
|
|
978
975
|
}
|
|
979
976
|
|
|
980
|
-
[data-v-
|
|
977
|
+
[data-v-98c2e804] .gmTableNoBorder.el-table--border:after {
|
|
981
978
|
height: 0;
|
|
982
979
|
}
|
|
983
980
|
|
|
984
|
-
[data-v-
|
|
981
|
+
[data-v-98c2e804] .gmTableNoBorder.el-table--border:before {
|
|
985
982
|
height: 0;
|
|
986
983
|
}
|
|
987
984
|
|
|
988
|
-
[data-v-
|
|
985
|
+
[data-v-98c2e804] .gmTableNoBorder .el-table__border-left-patch {
|
|
989
986
|
height: 0;
|
|
990
987
|
}
|
|
991
988
|
.gm-number-interval-single[data-v-4e6f4d6f] {
|
|
@@ -1010,36 +1007,36 @@ video {
|
|
|
1010
1007
|
margin-right: 0;
|
|
1011
1008
|
margin-bottom: 4px;
|
|
1012
1009
|
}
|
|
1013
|
-
[data-v-
|
|
1014
|
-
|
|
1010
|
+
.gm-upload-preview-dialog[data-v-312f9322] [data-v-312f9322] .el-dialog__body {
|
|
1011
|
+
padding: 0;
|
|
1015
1012
|
}
|
|
1016
1013
|
|
|
1017
|
-
[data-v-
|
|
1018
|
-
|
|
1014
|
+
.gm-upload-file-picture-card[data-v-312f9322] [data-v-312f9322] .el-upload-list__item, .gm-upload-file-picture-card[data-v-312f9322] [data-v-312f9322] .el-upload--picture-card {
|
|
1015
|
+
width: auto;
|
|
1016
|
+
height: auto;
|
|
1017
|
+
}
|
|
1018
|
+
[data-v-2c351ff8] .gmTableNoBorder .el-table__body .el-table__cell {
|
|
1019
|
+
border-right: none;
|
|
1019
1020
|
}
|
|
1020
1021
|
|
|
1021
|
-
[data-v-
|
|
1022
|
+
[data-v-2c351ff8] .gmTableNoBorder .el-table__inner-wrapper:before {
|
|
1022
1023
|
height: 0;
|
|
1023
1024
|
}
|
|
1024
1025
|
|
|
1025
|
-
[data-v-
|
|
1026
|
+
[data-v-2c351ff8] .gmTableNoBorder.el-table--border .el-table__inner-wrapper:after {
|
|
1026
1027
|
height: 0;
|
|
1027
1028
|
}
|
|
1028
1029
|
|
|
1029
|
-
[data-v-
|
|
1030
|
+
[data-v-2c351ff8] .gmTableNoBorder.el-table--border:after {
|
|
1030
1031
|
height: 0;
|
|
1031
1032
|
}
|
|
1032
1033
|
|
|
1033
|
-
[data-v-
|
|
1034
|
+
[data-v-2c351ff8] .gmTableNoBorder.el-table--border:before {
|
|
1034
1035
|
height: 0;
|
|
1035
1036
|
}
|
|
1036
|
-
.gm-upload-preview-dialog[data-v-312f9322] [data-v-312f9322] .el-dialog__body {
|
|
1037
|
-
padding: 0;
|
|
1038
|
-
}
|
|
1039
1037
|
|
|
1040
|
-
|
|
1041
|
-
|
|
1042
|
-
height: auto;
|
|
1038
|
+
[data-v-2c351ff8] .gmTableNoBorder .el-table__border-left-patch {
|
|
1039
|
+
height: 0;
|
|
1043
1040
|
}
|
|
1044
1041
|
.gm-upload-file {
|
|
1045
1042
|
line-height: normal;
|
|
@@ -14,6 +14,7 @@ declare const _default: __VLS_WithTemplateSlots<import("vue").DefineComponent<{
|
|
|
14
14
|
motionBlur: BooleanConstructor;
|
|
15
15
|
}, {
|
|
16
16
|
next: () => void;
|
|
17
|
+
activeIndex: number;
|
|
17
18
|
setActiveItem: (index: string | number) => void;
|
|
18
19
|
prev: () => void;
|
|
19
20
|
elRef: import("vue").Ref<({
|
|
@@ -18,7 +18,7 @@ var _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
18
18
|
const emit = __emit;
|
|
19
19
|
const elEvents = getGmEvent(carouselEmits$1, emit);
|
|
20
20
|
const elRef = ref();
|
|
21
|
-
const exposeEvents = ["setActiveItem", "prev", "next"];
|
|
21
|
+
const exposeEvents = ["activeIndex", "setActiveItem", "prev", "next"];
|
|
22
22
|
const { exposeFns } = getGmExports(elRef, exposeEvents);
|
|
23
23
|
__expose({
|
|
24
24
|
elRef,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Carousel.vue2.mjs","sources":["../../../../../../../packages/components/src/base/carousel/Carousel.vue"],"sourcesContent":["<template>\n <el-carousel ref=\"elRef\" v-bind=\"props\" v-on=\"elEvents\">\n <template v-if=\"slots.default\">\n <slot />\n </template>\n </el-carousel>\n</template>\n<script lang=\"ts\" setup>\nimport { ref, useSlots } from 'vue';\nimport { getGmEvent, getGmExports } from '@giime/utils';\nimport { carouselEmits as elCarouselEmits } from 'element-plus';\nimport { carouselEmits, carouselProps } from './carousel';\nimport type { CarouselInstance } from 'element-plus';\n\ndefineOptions({\n name: 'GmCarousel',\n});\nconst slots = useSlots();\nconst props = defineProps(carouselProps);\nconst emit = defineEmits(carouselEmits);\n// 重发el的事件\nconst elEvents = getGmEvent(elCarouselEmits, emit);\n\nconst elRef = ref<CarouselInstance>();\nconst exposeEvents = ['setActiveItem', 'prev', 'next'] as const;\n\nconst { exposeFns } = getGmExports(elRef, exposeEvents);\ndefineExpose({\n elRef,\n ...exposeFns,\n});\n</script>\n"],"names":["elCarouselEmits"],"mappings":";;;;;;;;;;;;;;;AAiBA,IAAA,MAAM,QAAQ,QAAS,EAAA,CAAA;AACvB,IAAA,MAAM,KAAQ,GAAA,OAAA,CAAA;AACd,IAAA,MAAM,IAAO,GAAA,MAAA,CAAA;AAEb,IAAM,MAAA,QAAA,GAAW,UAAW,CAAAA,eAAA,EAAiB,IAAI,CAAA,CAAA;AAEjD,IAAA,MAAM,QAAQ,GAAsB,EAAA,CAAA;AACpC,IAAA,MAAM,YAAe,GAAA,CAAC,
|
|
1
|
+
{"version":3,"file":"Carousel.vue2.mjs","sources":["../../../../../../../packages/components/src/base/carousel/Carousel.vue"],"sourcesContent":["<template>\n <el-carousel ref=\"elRef\" v-bind=\"props\" v-on=\"elEvents\">\n <template v-if=\"slots.default\">\n <slot />\n </template>\n </el-carousel>\n</template>\n<script lang=\"ts\" setup>\nimport { ref, useSlots } from 'vue';\nimport { getGmEvent, getGmExports } from '@giime/utils';\nimport { carouselEmits as elCarouselEmits } from 'element-plus';\nimport { carouselEmits, carouselProps } from './carousel';\nimport type { CarouselInstance } from 'element-plus';\n\ndefineOptions({\n name: 'GmCarousel',\n});\nconst slots = useSlots();\nconst props = defineProps(carouselProps);\nconst emit = defineEmits(carouselEmits);\n// 重发el的事件\nconst elEvents = getGmEvent(elCarouselEmits, emit);\n\nconst elRef = ref<CarouselInstance>();\nconst exposeEvents = ['activeIndex', 'setActiveItem', 'prev', 'next'] as const;\n\nconst { exposeFns } = getGmExports(elRef, exposeEvents);\ndefineExpose({\n elRef,\n ...exposeFns,\n});\n</script>\n"],"names":["elCarouselEmits"],"mappings":";;;;;;;;;;;;;;;AAiBA,IAAA,MAAM,QAAQ,QAAS,EAAA,CAAA;AACvB,IAAA,MAAM,KAAQ,GAAA,OAAA,CAAA;AACd,IAAA,MAAM,IAAO,GAAA,MAAA,CAAA;AAEb,IAAM,MAAA,QAAA,GAAW,UAAW,CAAAA,eAAA,EAAiB,IAAI,CAAA,CAAA;AAEjD,IAAA,MAAM,QAAQ,GAAsB,EAAA,CAAA;AACpC,IAAA,MAAM,YAAe,GAAA,CAAC,aAAe,EAAA,eAAA,EAAiB,QAAQ,MAAM,CAAA,CAAA;AAEpE,IAAA,MAAM,EAAE,SAAA,EAAc,GAAA,YAAA,CAAa,OAAO,YAAY,CAAA,CAAA;AACtD,IAAa,QAAA,CAAA;AAAA,MACX,KAAA;AAAA,MACA,GAAG,SAAA;AAAA,KACJ,CAAA,CAAA;;;;;;;;;;;;;;;;;;;;;;;;;"}
|
|
@@ -18,6 +18,7 @@ export declare const GmCarousel: import("../../../../utils").SFCWithInstall<{
|
|
|
18
18
|
onChange?: ((current: number, prev: number) => any) | undefined;
|
|
19
19
|
}, {
|
|
20
20
|
next: () => void;
|
|
21
|
+
activeIndex: number;
|
|
21
22
|
setActiveItem: (index: string | number) => void;
|
|
22
23
|
prev: () => void;
|
|
23
24
|
elRef: import("vue").Ref<({
|
|
@@ -222,6 +223,7 @@ export declare const GmCarousel: import("../../../../utils").SFCWithInstall<{
|
|
|
222
223
|
onChange?: ((current: number, prev: number) => any) | undefined;
|
|
223
224
|
}, {
|
|
224
225
|
next: () => void;
|
|
226
|
+
activeIndex: number;
|
|
225
227
|
setActiveItem: (index: string | number) => void;
|
|
226
228
|
prev: () => void;
|
|
227
229
|
elRef: import("vue").Ref<({
|
|
@@ -405,6 +407,7 @@ export declare const GmCarousel: import("../../../../utils").SFCWithInstall<{
|
|
|
405
407
|
onChange?: ((current: number, prev: number) => any) | undefined;
|
|
406
408
|
}, {
|
|
407
409
|
next: () => void;
|
|
410
|
+
activeIndex: number;
|
|
408
411
|
setActiveItem: (index: string | number) => void;
|
|
409
412
|
prev: () => void;
|
|
410
413
|
elRef: import("vue").Ref<({
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { UploadFile } from 'element-plus';
|
|
2
|
-
declare const _default: import("vue").DefineComponent<{
|
|
2
|
+
declare const _default: __VLS_WithTemplateSlots<import("vue").DefineComponent<{
|
|
3
3
|
file: {
|
|
4
4
|
type: import("vue").PropType<Partial<UploadFile>>;
|
|
5
5
|
default: () => {};
|
|
@@ -8,6 +8,18 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
8
8
|
type: StringConstructor;
|
|
9
9
|
default: string;
|
|
10
10
|
};
|
|
11
|
+
fileWidth: {
|
|
12
|
+
type: StringConstructor;
|
|
13
|
+
default: string;
|
|
14
|
+
};
|
|
15
|
+
fileHeight: {
|
|
16
|
+
type: StringConstructor;
|
|
17
|
+
default: string;
|
|
18
|
+
};
|
|
19
|
+
fileStyle: {
|
|
20
|
+
type: ObjectConstructor;
|
|
21
|
+
default: () => {};
|
|
22
|
+
};
|
|
11
23
|
size: {
|
|
12
24
|
type: NumberConstructor;
|
|
13
25
|
default: number;
|
|
@@ -32,6 +44,9 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
32
44
|
type: BooleanConstructor;
|
|
33
45
|
default: boolean;
|
|
34
46
|
};
|
|
47
|
+
onClick: {
|
|
48
|
+
type: import("vue").PropType<(file: Partial<UploadFile>) => void>;
|
|
49
|
+
};
|
|
35
50
|
}, {}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<{
|
|
36
51
|
file: {
|
|
37
52
|
type: import("vue").PropType<Partial<UploadFile>>;
|
|
@@ -41,6 +56,18 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
41
56
|
type: StringConstructor;
|
|
42
57
|
default: string;
|
|
43
58
|
};
|
|
59
|
+
fileWidth: {
|
|
60
|
+
type: StringConstructor;
|
|
61
|
+
default: string;
|
|
62
|
+
};
|
|
63
|
+
fileHeight: {
|
|
64
|
+
type: StringConstructor;
|
|
65
|
+
default: string;
|
|
66
|
+
};
|
|
67
|
+
fileStyle: {
|
|
68
|
+
type: ObjectConstructor;
|
|
69
|
+
default: () => {};
|
|
70
|
+
};
|
|
44
71
|
size: {
|
|
45
72
|
type: NumberConstructor;
|
|
46
73
|
default: number;
|
|
@@ -65,6 +92,9 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
65
92
|
type: BooleanConstructor;
|
|
66
93
|
default: boolean;
|
|
67
94
|
};
|
|
95
|
+
onClick: {
|
|
96
|
+
type: import("vue").PropType<(file: Partial<UploadFile>) => void>;
|
|
97
|
+
};
|
|
68
98
|
}>>, {
|
|
69
99
|
size: number;
|
|
70
100
|
url: string;
|
|
@@ -72,7 +102,19 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
72
102
|
showIcon: boolean;
|
|
73
103
|
controls: boolean;
|
|
74
104
|
field: string;
|
|
105
|
+
fileWidth: string;
|
|
106
|
+
fileHeight: string;
|
|
107
|
+
fileStyle: Record<string, any>;
|
|
75
108
|
controlslist: string;
|
|
76
109
|
oncontextmenu: boolean;
|
|
77
|
-
}, {}
|
|
110
|
+
}, {}>, {
|
|
111
|
+
default?(_: {
|
|
112
|
+
file: Partial<UploadFile>;
|
|
113
|
+
}): any;
|
|
114
|
+
}>;
|
|
78
115
|
export default _default;
|
|
116
|
+
type __VLS_WithTemplateSlots<T, S> = T & {
|
|
117
|
+
new (): {
|
|
118
|
+
$slots: S;
|
|
119
|
+
};
|
|
120
|
+
};
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { defineComponent, computed, resolveComponent, openBlock, createElementBlock, Fragment, createBlock,
|
|
1
|
+
import { defineComponent, computed, resolveComponent, openBlock, createElementBlock, createElementVNode, normalizeStyle, Fragment, createBlock, renderSlot } from 'vue';
|
|
2
2
|
import { isImageUrl, isVideoUrl, isPDF, isText, isWord, isExcel, isPPT, isZip, isPSD } from '../../../../utils/src/is.mjs';
|
|
3
3
|
import { fileComponentProps } from './fileComponent.mjs';
|
|
4
4
|
|
|
5
|
-
const _hoisted_1 = { class: "gm-flex gm-h-full gm-items-center gm-justify-center" };
|
|
5
|
+
const _hoisted_1 = { class: "gm-flex gm-h-full gm-w-full gm-flex-col gm-items-center gm-justify-center" };
|
|
6
6
|
const _hoisted_2 = ["src"];
|
|
7
7
|
const _hoisted_3 = ["src", "controls", "controlslist", "oncontextmenu"];
|
|
8
8
|
const _hoisted_4 = ["src"];
|
|
@@ -20,6 +20,13 @@ var _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
20
20
|
height: `${props.size}px`
|
|
21
21
|
};
|
|
22
22
|
});
|
|
23
|
+
const fileStyle = computed(() => {
|
|
24
|
+
return {
|
|
25
|
+
width: props.fileWidth,
|
|
26
|
+
height: props.fileHeight,
|
|
27
|
+
...props.fileStyle
|
|
28
|
+
};
|
|
29
|
+
});
|
|
23
30
|
const fileURL = computed(() => {
|
|
24
31
|
return props.file[props.url];
|
|
25
32
|
});
|
|
@@ -54,40 +61,58 @@ var _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
54
61
|
const matchedType = typeCheckers.find(({ check }) => check());
|
|
55
62
|
return matchedType?.icon || iconList.unknown;
|
|
56
63
|
});
|
|
64
|
+
const handleClick = () => {
|
|
65
|
+
if (!props.onClick)
|
|
66
|
+
return;
|
|
67
|
+
props.onClick(props.file);
|
|
68
|
+
};
|
|
57
69
|
return (_ctx, _cache) => {
|
|
58
70
|
const _component_el_image = resolveComponent("el-image");
|
|
59
71
|
return openBlock(), createElementBlock("div", _hoisted_1, [
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
src: fileURL.value,
|
|
68
|
-
controls: _ctx.controls,
|
|
69
|
-
controlslist: _ctx.controlslist,
|
|
70
|
-
oncontextmenu: () => _ctx.oncontextmenu,
|
|
71
|
-
style: { "width": "100%", "height": "100%" }
|
|
72
|
-
}, null, 8, _hoisted_3)) : (openBlock(), createElementBlock(
|
|
73
|
-
Fragment,
|
|
74
|
-
{ key: 2 },
|
|
72
|
+
createElementVNode(
|
|
73
|
+
"div",
|
|
74
|
+
{
|
|
75
|
+
class: "gm-flex gm-items-center gm-justify-center",
|
|
76
|
+
style: normalizeStyle(fileStyle.value),
|
|
77
|
+
onClick: handleClick
|
|
78
|
+
},
|
|
75
79
|
[
|
|
76
|
-
|
|
80
|
+
isImageFile.value ? (openBlock(), createElementBlock("img", {
|
|
77
81
|
key: 0,
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
82
|
+
src: fileURL.value,
|
|
83
|
+
fit: "contain",
|
|
84
|
+
style: { "max-width": "100%", "max-height": "100%" }
|
|
85
|
+
}, null, 8, _hoisted_2)) : isVideoFile.value ? (openBlock(), createElementBlock("video", {
|
|
81
86
|
key: 1,
|
|
82
87
|
src: fileURL.value,
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
88
|
+
controls: _ctx.controls,
|
|
89
|
+
controlslist: _ctx.controlslist,
|
|
90
|
+
oncontextmenu: () => _ctx.oncontextmenu,
|
|
91
|
+
style: { "max-width": "100%", "max-height": "100%" }
|
|
92
|
+
}, null, 8, _hoisted_3)) : (openBlock(), createElementBlock(
|
|
93
|
+
Fragment,
|
|
94
|
+
{ key: 2 },
|
|
95
|
+
[
|
|
96
|
+
_ctx.showIcon || !showIframe.value ? (openBlock(), createBlock(_component_el_image, {
|
|
97
|
+
key: 0,
|
|
98
|
+
style: normalizeStyle(iconStyle.value),
|
|
99
|
+
src: iconURL.value
|
|
100
|
+
}, null, 8, ["style", "src"])) : (openBlock(), createElementBlock("iframe", {
|
|
101
|
+
key: 1,
|
|
102
|
+
src: fileURL.value,
|
|
103
|
+
width: "850px",
|
|
104
|
+
height: "100%",
|
|
105
|
+
frameborder: "0"
|
|
106
|
+
}, null, 8, _hoisted_4))
|
|
107
|
+
],
|
|
108
|
+
64
|
|
109
|
+
/* STABLE_FRAGMENT */
|
|
110
|
+
))
|
|
87
111
|
],
|
|
88
|
-
|
|
89
|
-
/*
|
|
90
|
-
)
|
|
112
|
+
4
|
|
113
|
+
/* STYLE */
|
|
114
|
+
),
|
|
115
|
+
renderSlot(_ctx.$slots, "default", { file: _ctx.file })
|
|
91
116
|
]);
|
|
92
117
|
};
|
|
93
118
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"FileComponent.vue2.mjs","sources":["../../../../../../../packages/components/src/composite/fileComponent/FileComponent.vue"],"sourcesContent":["<template>\n <div class=\"gm-flex gm-h-full gm-items-center gm-justify-center\">\n <img v-if=\"isImageFile\" :src=\"fileURL\" fit=\"contain\" style=\"max-width: 100%; max-height: 100%\" />\n
|
|
1
|
+
{"version":3,"file":"FileComponent.vue2.mjs","sources":["../../../../../../../packages/components/src/composite/fileComponent/FileComponent.vue"],"sourcesContent":["<template>\n <div class=\"gm-flex gm-h-full gm-w-full gm-flex-col gm-items-center gm-justify-center\">\n <div class=\"gm-flex gm-items-center gm-justify-center\" :style=\"fileStyle\" @click=\"handleClick\">\n <img v-if=\"isImageFile\" :src=\"fileURL\" fit=\"contain\" style=\"max-width: 100%; max-height: 100%\" />\n <video\n v-else-if=\"isVideoFile\"\n :src=\"fileURL\"\n :controls=\"controls\"\n :controlslist=\"controlslist\"\n :oncontextmenu=\"() => oncontextmenu\"\n style=\"max-width: 100%; max-height: 100%\"\n />\n <template v-else>\n <el-image v-if=\"showIcon || !showIframe\" :style=\"iconStyle\" :src=\"iconURL\" />\n <iframe v-else :src=\"fileURL\" width=\"850px\" height=\"100%\" frameborder=\"0\" />\n </template>\n </div>\n <slot :file=\"file\" />\n </div>\n</template>\n\n<script setup lang=\"ts\">\nimport { computed } from 'vue';\nimport { isExcel, isImageUrl, isPDF, isPPT, isPSD, isText, isVideoUrl, isWord, isZip } from '@giime/utils/src/is';\nimport { fileComponentProps } from './fileComponent';\n// import PDF from './assets/image/pdf.svg';\n// import WORD from './assets/image/word.svg';\n// import EXCEL from './assets/image/excel.svg';\n// import PPT from './assets/image/ppt.svg';\n// import PSD from './assets/image/psd.svg';\n// import TEXT from './assets/image/text.svg';\n// import ZIP from './assets/image/zip.svg';\n// import UNKNOWN from './assets/image/unknown.svg';\nimport type { UploadFile } from 'element-plus';\n\ndefineOptions({\n name: 'GmFileComponent',\n});\n\nconst props = defineProps(fileComponentProps);\n\nconst iconStyle = computed(() => {\n return {\n width: `${props.size}px`,\n height: `${props.size}px`,\n };\n});\n\nconst fileStyle = computed(() => {\n return {\n width: props.fileWidth,\n height: props.fileHeight,\n ...props.fileStyle,\n };\n});\n\n/** 文件链接地址 */\nconst fileURL = computed(() => {\n return props.file[props.url as keyof UploadFile] as string;\n});\n\n/** 验证文件类型的字段 */\nconst verifyFile = computed(() => {\n return props.file[props.field as keyof UploadFile] as string;\n});\n\nconst isImageFile = computed(() => isImageUrl(fileURL.value) || isImageUrl(verifyFile.value));\nconst isVideoFile = computed(() => isVideoUrl(fileURL.value) || isVideoUrl(verifyFile.value));\n\n/** 显示iframe */\nconst showIframe = computed(() => {\n return isPDF(fileURL.value) || isPDF(verifyFile.value) || isText(fileURL.value) || isText(verifyFile.value);\n});\n\n/** 图标 */\nconst iconList = {\n excel: 'https://sucai.giikin.cn/workflow/material-refer-1739947054012-1213-335.svg',\n pdf: 'https://sucai.giikin.cn/workflow/material-refer-1739947288698-5462-586.svg',\n word: 'https://sucai.giikin.cn/workflow/material-refer-1739947288698-1540-625.svg',\n txt: 'https://sucai.giikin.cn/workflow/material-refer-1739947288698-1700-90.svg',\n zip: 'https://sucai.giikin.cn/workflow/material-refer-1739947288698-2639-507.svg',\n psd: 'https://sucai.giikin.cn/workflow/material-refer-1739947288698-5026-760.svg',\n ppt: 'https://sucai.giikin.cn/workflow/material-refer-1739947288698-2867-970.svg',\n unknown: 'https://sucai.giikin.cn/workflow/material-refer-1739947288698-1448-736.svg',\n};\n\nconst iconURL = computed<string>(() => {\n // 文件类型检查器映射\n const typeCheckers = [\n { check: () => isPDF(fileURL.value) || isPDF(verifyFile.value), icon: iconList.pdf },\n { check: () => isWord(fileURL.value) || isWord(verifyFile.value), icon: iconList.word },\n { check: () => isExcel(fileURL.value) || isExcel(verifyFile.value), icon: iconList.excel },\n { check: () => isText(fileURL.value) || isText(verifyFile.value), icon: iconList.txt },\n { check: () => isPPT(fileURL.value) || isPPT(verifyFile.value), icon: iconList.ppt },\n { check: () => isZip(fileURL.value) || isZip(verifyFile.value), icon: iconList.zip },\n { check: () => isPSD(fileURL.value) || isPSD(verifyFile.value), icon: iconList.psd },\n ];\n\n // 查找匹配的文件类型\n const matchedType = typeCheckers.find(({ check }) => check());\n\n return matchedType?.icon || iconList.unknown;\n});\n\nconst handleClick = () => {\n if (!props.onClick) return;\n props.onClick(props.file);\n};\n</script>\n"],"names":[],"mappings":";;;;;;;;;;;;;;;AAuCA,IAAA,MAAM,KAAQ,GAAA,OAAA,CAAA;AAEd,IAAM,MAAA,SAAA,GAAY,SAAS,MAAM;AAC/B,MAAO,OAAA;AAAA,QACL,KAAA,EAAO,CAAG,EAAA,KAAA,CAAM,IAAI,CAAA,EAAA,CAAA;AAAA,QACpB,MAAA,EAAQ,CAAG,EAAA,KAAA,CAAM,IAAI,CAAA,EAAA,CAAA;AAAA,OACvB,CAAA;AAAA,KACD,CAAA,CAAA;AAED,IAAM,MAAA,SAAA,GAAY,SAAS,MAAM;AAC/B,MAAO,OAAA;AAAA,QACL,OAAO,KAAM,CAAA,SAAA;AAAA,QACb,QAAQ,KAAM,CAAA,UAAA;AAAA,QACd,GAAG,KAAM,CAAA,SAAA;AAAA,OACX,CAAA;AAAA,KACD,CAAA,CAAA;AAGD,IAAM,MAAA,OAAA,GAAU,SAAS,MAAM;AAC7B,MAAO,OAAA,KAAA,CAAM,IAAK,CAAA,KAAA,CAAM,GAAuB,CAAA,CAAA;AAAA,KAChD,CAAA,CAAA;AAGD,IAAM,MAAA,UAAA,GAAa,SAAS,MAAM;AAChC,MAAO,OAAA,KAAA,CAAM,IAAK,CAAA,KAAA,CAAM,KAAyB,CAAA,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|
2
2
|
import { type UploadFile } from 'element-plus';
|
|
3
3
|
/** 视频控制器 */
|
|
4
4
|
export type Controls = 'nodownload' | 'nofullscreen' | 'noremoteplayback' | 'noplaybackrate';
|
|
5
|
+
export interface FileComponentHooks {
|
|
6
|
+
onClick: (file: Partial<UploadFile>) => void;
|
|
7
|
+
}
|
|
5
8
|
export declare const fileComponentProps: {
|
|
6
9
|
/** 文件 */
|
|
7
10
|
file: {
|
|
@@ -13,6 +16,18 @@ export declare const fileComponentProps: {
|
|
|
13
16
|
type: StringConstructor;
|
|
14
17
|
default: string;
|
|
15
18
|
};
|
|
19
|
+
fileWidth: {
|
|
20
|
+
type: StringConstructor;
|
|
21
|
+
default: string;
|
|
22
|
+
};
|
|
23
|
+
fileHeight: {
|
|
24
|
+
type: StringConstructor;
|
|
25
|
+
default: string;
|
|
26
|
+
};
|
|
27
|
+
fileStyle: {
|
|
28
|
+
type: ObjectConstructor;
|
|
29
|
+
default: () => {};
|
|
30
|
+
};
|
|
16
31
|
/** 图标大小 */
|
|
17
32
|
size: {
|
|
18
33
|
type: NumberConstructor;
|
|
@@ -43,4 +58,7 @@ export declare const fileComponentProps: {
|
|
|
43
58
|
type: BooleanConstructor;
|
|
44
59
|
default: boolean;
|
|
45
60
|
};
|
|
61
|
+
onClick: {
|
|
62
|
+
type: PropType<(file: Partial<UploadFile>) => void>;
|
|
63
|
+
};
|
|
46
64
|
};
|
|
@@ -9,6 +9,18 @@ const fileComponentProps = {
|
|
|
9
9
|
type: String,
|
|
10
10
|
default: "url"
|
|
11
11
|
},
|
|
12
|
+
fileWidth: {
|
|
13
|
+
type: String,
|
|
14
|
+
default: "100%"
|
|
15
|
+
},
|
|
16
|
+
fileHeight: {
|
|
17
|
+
type: String,
|
|
18
|
+
default: "100%"
|
|
19
|
+
},
|
|
20
|
+
fileStyle: {
|
|
21
|
+
type: Object,
|
|
22
|
+
default: () => ({})
|
|
23
|
+
},
|
|
12
24
|
/** 图标大小 */
|
|
13
25
|
size: {
|
|
14
26
|
type: Number,
|
|
@@ -38,6 +50,9 @@ const fileComponentProps = {
|
|
|
38
50
|
showIcon: {
|
|
39
51
|
type: Boolean,
|
|
40
52
|
default: false
|
|
53
|
+
},
|
|
54
|
+
onClick: {
|
|
55
|
+
type: Function
|
|
41
56
|
}
|
|
42
57
|
};
|
|
43
58
|
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"fileComponent.mjs","sources":["../../../../../../../packages/components/src/composite/fileComponent/fileComponent.ts"],"sourcesContent":["import { type PropType } from 'vue';\nimport { type UploadFile } from 'element-plus';\n\n/** 视频控制器 */\nexport type Controls = 'nodownload' | 'nofullscreen' | 'noremoteplayback' | 'noplaybackrate';\n\nexport const fileComponentProps = {\n /** 文件 */\n file: {\n type: Object as PropType<Partial<UploadFile>>,\n default: () => ({}),\n },\n /** 文件链接字段 */\n url: {\n type: String,\n default: 'url',\n },\n /** 图标大小 */\n size: {\n type: Number,\n default: 80,\n },\n /** 文件类型判断字段 */\n field: {\n type: String,\n default: 'name',\n },\n /** 视频是否显示操作按钮 */\n controls: {\n type: Boolean,\n default: true,\n },\n /** 视频控制器选项 */\n controlslist: {\n type: String,\n default: '',\n },\n /** 视频是否显示右键菜单 */\n oncontextmenu: {\n type: Boolean,\n default: true,\n },\n /** 是否显示icon */\n showIcon: {\n type: Boolean,\n default: false,\n },\n};\n"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"fileComponent.mjs","sources":["../../../../../../../packages/components/src/composite/fileComponent/fileComponent.ts"],"sourcesContent":["import { type PropType } from 'vue';\nimport { type UploadFile } from 'element-plus';\n\n/** 视频控制器 */\nexport type Controls = 'nodownload' | 'nofullscreen' | 'noremoteplayback' | 'noplaybackrate';\n\nexport interface FileComponentHooks {\n onClick: (file: Partial<UploadFile>) => void;\n}\n\nexport const fileComponentProps = {\n /** 文件 */\n file: {\n type: Object as PropType<Partial<UploadFile>>,\n default: () => ({}),\n },\n /** 文件链接字段 */\n url: {\n type: String,\n default: 'url',\n },\n fileWidth: {\n type: String,\n default: '100%',\n },\n fileHeight: {\n type: String,\n default: '100%',\n },\n fileStyle: {\n type: Object,\n default: () => ({}),\n },\n /** 图标大小 */\n size: {\n type: Number,\n default: 80,\n },\n /** 文件类型判断字段 */\n field: {\n type: String,\n default: 'name',\n },\n /** 视频是否显示操作按钮 */\n controls: {\n type: Boolean,\n default: true,\n },\n /** 视频控制器选项 */\n controlslist: {\n type: String,\n default: '',\n },\n /** 视频是否显示右键菜单 */\n oncontextmenu: {\n type: Boolean,\n default: true,\n },\n /** 是否显示icon */\n showIcon: {\n type: Boolean,\n default: false,\n },\n onClick: {\n type: Function as PropType<FileComponentHooks['onClick']>,\n },\n};\n"],"names":[],"mappings":"AAUO,MAAM,kBAAqB,GAAA;AAAA;AAAA,EAEhC,IAAM,EAAA;AAAA,IACJ,IAAM,EAAA,MAAA;AAAA,IACN,OAAA,EAAS,OAAO,EAAC,CAAA;AAAA,GACnB;AAAA;AAAA,EAEA,GAAK,EAAA;AAAA,IACH,IAAM,EAAA,MAAA;AAAA,IACN,OAAS,EAAA,KAAA;AAAA,GACX;AAAA,EACA,SAAW,EAAA;AAAA,IACT,IAAM,EAAA,MAAA;AAAA,IACN,OAAS,EAAA,MAAA;AAAA,GACX;AAAA,EACA,UAAY,EAAA;AAAA,IACV,IAAM,EAAA,MAAA;AAAA,IACN,OAAS,EAAA,MAAA;AAAA,GACX;AAAA,EACA,SAAW,EAAA;AAAA,IACT,IAAM,EAAA,MAAA;AAAA,IACN,OAAA,EAAS,OAAO,EAAC,CAAA;AAAA,GACnB;AAAA;AAAA,EAEA,IAAM,EAAA;AAAA,IACJ,IAAM,EAAA,MAAA;AAAA,IACN,OAAS,EAAA,EAAA;AAAA,GACX;AAAA;AAAA,EAEA,KAAO,EAAA;AAAA,IACL,IAAM,EAAA,MAAA;AAAA,IACN,OAAS,EAAA,MAAA;AAAA,GACX;AAAA;AAAA,EAEA,QAAU,EAAA;AAAA,IACR,IAAM,EAAA,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