giime 0.5.5 → 0.5.7
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 +39 -35
- package/es/api/materialApi/cross/postSaveFileResources.mjs +0 -1
- package/es/api/materialApi/cross/postSaveFileResources.mjs.map +1 -1
- package/es/components/src/composite/fileComponent/FileComponent.vue2.mjs +6 -5
- package/es/components/src/composite/fileComponent/FileComponent.vue2.mjs.map +1 -1
- package/es/components/src/composite/uploadFile/UploadFile.vue.mjs +1 -1
- package/es/components/src/composite/uploadFile/UploadFile.vue2.mjs +141 -115
- package/es/components/src/composite/uploadFile/UploadFile.vue2.mjs.map +1 -1
- 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 +39 -35
- package/es/utils/src/http/createAxios.d.ts +1 -0
- package/es/utils/src/http/createAxios.mjs +6 -3
- package/es/utils/src/http/createAxios.mjs.map +1 -1
- package/lib/api/materialApi/cross/postSaveFileResources.js +0 -1
- package/lib/api/materialApi/cross/postSaveFileResources.js.map +1 -1
- package/lib/components/src/composite/fileComponent/FileComponent.vue2.js +6 -5
- package/lib/components/src/composite/fileComponent/FileComponent.vue2.js.map +1 -1
- package/lib/components/src/composite/uploadFile/UploadFile.vue.js +1 -1
- package/lib/components/src/composite/uploadFile/UploadFile.vue2.js +140 -114
- package/lib/components/src/composite/uploadFile/UploadFile.vue2.js.map +1 -1
- 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 +39 -35
- package/lib/utils/src/http/createAxios.d.ts +1 -0
- package/lib/utils/src/http/createAxios.js +6 -3
- package/lib/utils/src/http/createAxios.js.map +1 -1
- package/package.json +1 -1
package/dist/index.css
CHANGED
|
@@ -806,13 +806,6 @@ video {
|
|
|
806
806
|
margin: 0;
|
|
807
807
|
}
|
|
808
808
|
|
|
809
|
-
.gm-flex-center[data-v-2a79bac9] {
|
|
810
|
-
align-items: center;
|
|
811
|
-
}
|
|
812
|
-
|
|
813
|
-
.gm-flex-justify-between[data-v-2a79bac9] {
|
|
814
|
-
justify-content: space-between;
|
|
815
|
-
}
|
|
816
809
|
.circular[data-v-b391445c] {
|
|
817
810
|
animation: loading-rotate-b391445c 2s linear infinite;
|
|
818
811
|
}
|
|
@@ -844,44 +837,28 @@ video {
|
|
|
844
837
|
stroke-dashoffset: -120px;
|
|
845
838
|
}
|
|
846
839
|
}
|
|
847
|
-
[data-v-
|
|
848
|
-
|
|
849
|
-
}
|
|
850
|
-
|
|
851
|
-
[data-v-668dc408] .gmTableNoBorder .el-table__inner-wrapper:before {
|
|
852
|
-
height: 0;
|
|
853
|
-
}
|
|
854
|
-
|
|
855
|
-
[data-v-668dc408] .gmTableNoBorder.el-table--border .el-table__inner-wrapper:after {
|
|
856
|
-
height: 0;
|
|
857
|
-
}
|
|
858
|
-
|
|
859
|
-
[data-v-668dc408] .gmTableNoBorder.el-table--border:after {
|
|
860
|
-
height: 0;
|
|
840
|
+
.gm-flex-center[data-v-2a79bac9] {
|
|
841
|
+
align-items: center;
|
|
861
842
|
}
|
|
862
843
|
|
|
863
|
-
[data-v-
|
|
864
|
-
|
|
844
|
+
.gm-flex-justify-between[data-v-2a79bac9] {
|
|
845
|
+
justify-content: space-between;
|
|
865
846
|
}
|
|
866
|
-
|
|
867
|
-
|
|
868
|
-
|
|
847
|
+
[data-v-7b6755e2] .gmSearchForm .el-form-item {
|
|
848
|
+
margin-right: 0;
|
|
849
|
+
margin-bottom: 4px;
|
|
869
850
|
}
|
|
870
|
-
.gm-upload-preview-dialog[data-v-
|
|
851
|
+
.gm-upload-preview-dialog[data-v-bb2dfbf0] [data-v-bb2dfbf0] .el-dialog__body {
|
|
871
852
|
padding: 0;
|
|
872
853
|
}
|
|
873
854
|
|
|
874
|
-
[data-v-
|
|
855
|
+
.gm-upload-file-picture-card[data-v-bb2dfbf0] [data-v-bb2dfbf0] .el-upload-list__item, .gm-upload-file-picture-card[data-v-bb2dfbf0] [data-v-bb2dfbf0] .el-upload--picture-card {
|
|
875
856
|
width: 120px;
|
|
876
857
|
height: 120px;
|
|
877
858
|
display: flex;
|
|
878
859
|
align-items: center;
|
|
879
860
|
justify-content: center;
|
|
880
861
|
}
|
|
881
|
-
[data-v-7b6755e2] .gmSearchForm .el-form-item {
|
|
882
|
-
margin-right: 0;
|
|
883
|
-
margin-bottom: 4px;
|
|
884
|
-
}
|
|
885
862
|
.gm-number-interval-single[data-v-47a13fd0] {
|
|
886
863
|
border-radius: var(--el-input-border-radius, var(--el-border-radius-base));
|
|
887
864
|
box-shadow: 0 0 0 1px var(--el-input-border-color, var(--el-border-color)) inset;
|
|
@@ -900,19 +877,46 @@ video {
|
|
|
900
877
|
.gm-number-interval-single[data-v-47a13fd0]:hover .gm-number-interval-close[data-v-47a13fd0] {
|
|
901
878
|
display: flex;
|
|
902
879
|
}
|
|
903
|
-
.el-
|
|
880
|
+
[data-v-668dc408] .gmTableNoBorder .el-table__body .el-table__cell {
|
|
881
|
+
border-right: none;
|
|
882
|
+
}
|
|
883
|
+
|
|
884
|
+
[data-v-668dc408] .gmTableNoBorder .el-table__inner-wrapper:before {
|
|
885
|
+
height: 0;
|
|
886
|
+
}
|
|
887
|
+
|
|
888
|
+
[data-v-668dc408] .gmTableNoBorder.el-table--border .el-table__inner-wrapper:after {
|
|
889
|
+
height: 0;
|
|
890
|
+
}
|
|
891
|
+
|
|
892
|
+
[data-v-668dc408] .gmTableNoBorder.el-table--border:after {
|
|
893
|
+
height: 0;
|
|
894
|
+
}
|
|
895
|
+
|
|
896
|
+
[data-v-668dc408] .gmTableNoBorder.el-table--border:before {
|
|
897
|
+
height: 0;
|
|
898
|
+
}
|
|
899
|
+
|
|
900
|
+
[data-v-668dc408] .gmTableNoBorder .el-table__border-left-patch {
|
|
901
|
+
height: 0;
|
|
902
|
+
}
|
|
903
|
+
.gm-upload-file {
|
|
904
904
|
line-height: normal;
|
|
905
905
|
}
|
|
906
|
-
.
|
|
906
|
+
.gm-upload-file .el-checkbox {
|
|
907
907
|
position: absolute;
|
|
908
908
|
left: 10px;
|
|
909
909
|
top: 0;
|
|
910
910
|
z-index: 9;
|
|
911
911
|
}
|
|
912
|
-
.
|
|
912
|
+
.gm-upload-file .el-upload-list__item-file-name {
|
|
913
913
|
line-height: normal;
|
|
914
914
|
}
|
|
915
915
|
|
|
916
|
+
.gm-upload-file-disabled .el-upload-list__item-status-label {
|
|
917
|
+
display: none;
|
|
918
|
+
}
|
|
919
|
+
|
|
916
920
|
.pagination-container[data-v-19230954] {
|
|
917
921
|
background: #fff;
|
|
918
922
|
padding-top: 12px;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"postSaveFileResources.mjs","sources":["../../../../../../packages/api/materialApi/cross/postSaveFileResources.ts"],"sourcesContent":["import { type AxiosRequestConfig } from 'axios';\r\nimport request from '../request';\r\nimport type { DeepRequired } from '../interface';\r\n\r\nexport interface PostSaveFileResourcesResponse {\r\n code: number;\r\n data: any;\r\n comment: string;\r\n}\r\n\r\n/**\r\n * @description 文件资源保存入库\r\n * @param {array} fileData 文件资源\r\n * @return {*}\r\n **/\r\nexport function postSaveFileResources(input?: PostSaveFileResourcesInput, config?: AxiosRequestConfig) {\r\n
|
|
1
|
+
{"version":3,"file":"postSaveFileResources.mjs","sources":["../../../../../../packages/api/materialApi/cross/postSaveFileResources.ts"],"sourcesContent":["import { type AxiosRequestConfig } from 'axios';\r\nimport request from '../request';\r\nimport type { DeepRequired } from '../interface';\r\n\r\nexport interface PostSaveFileResourcesResponse {\r\n code: number;\r\n data: any;\r\n comment: string;\r\n}\r\n\r\n/**\r\n * @description 文件资源保存入库\r\n * @param {array} fileData 文件资源\r\n * @return {*}\r\n **/\r\nexport function postSaveFileResources(input?: PostSaveFileResourcesInput, config?: AxiosRequestConfig) {\r\n return request.post<DeepRequired<PostSaveFileResourcesResponse>>(`/material/work/saveFileResources`, input, config);\r\n}\r\n\r\nexport interface PostSaveFileResourcesData {\r\n md5_code: string;\r\n url: string;\r\n file_size?: number;\r\n width?: string;\r\n high?: string;\r\n play_time?: string;\r\n}\r\n\r\nexport interface PostSaveFileResourcesInput {\r\n fileData: PostSaveFileResourcesData;\r\n}\r\n"],"names":["request"],"mappings":";;AAegB,SAAA,qBAAA,CAAsB,OAAoC,MAA6B,EAAA;AACrG,EAAA,OAAOA,OAAQ,CAAA,IAAA,CAAkD,CAAoC,gCAAA,CAAA,EAAA,KAAA,EAAO,MAAM,CAAA,CAAA;AACpH;;;;"}
|
|
@@ -11,7 +11,8 @@ import ZIP from './assets/image/zip.svg.mjs';
|
|
|
11
11
|
import UNKNOWN from './assets/image/unknown.svg.mjs';
|
|
12
12
|
|
|
13
13
|
const _hoisted_1 = { class: "gm-flex gm-h-full gm-items-center gm-justify-center" };
|
|
14
|
-
const _hoisted_2 = ["src"
|
|
14
|
+
const _hoisted_2 = ["src"];
|
|
15
|
+
const _hoisted_3 = ["src", "controls", "controlslist", "oncontextmenu"];
|
|
15
16
|
var _sfc_main = /* @__PURE__ */ defineComponent({
|
|
16
17
|
...{
|
|
17
18
|
name: "GmFileComponent"
|
|
@@ -57,19 +58,19 @@ var _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
57
58
|
return (_ctx, _cache) => {
|
|
58
59
|
const _component_el_image = resolveComponent("el-image");
|
|
59
60
|
return openBlock(), createElementBlock("div", _hoisted_1, [
|
|
60
|
-
unref(isImageUrl)(verifyFile.value) ? (openBlock(),
|
|
61
|
+
unref(isImageUrl)(verifyFile.value) ? (openBlock(), createElementBlock("img", {
|
|
61
62
|
key: 0,
|
|
62
63
|
src: fileURL.value,
|
|
63
64
|
fit: "contain",
|
|
64
|
-
style: { "width": "100%", "height": "100%" }
|
|
65
|
-
}, null, 8,
|
|
65
|
+
style: { "max-width": "100%", "max-height": "100%" }
|
|
66
|
+
}, null, 8, _hoisted_2)) : unref(isVideoUrl)(verifyFile.value) ? (openBlock(), createElementBlock("video", {
|
|
66
67
|
key: 1,
|
|
67
68
|
src: fileURL.value,
|
|
68
69
|
controls: _ctx.controls,
|
|
69
70
|
controlslist: _ctx.controlslist,
|
|
70
71
|
oncontextmenu: () => _ctx.oncontextmenu,
|
|
71
72
|
style: { "width": "100%", "height": "100%" }
|
|
72
|
-
}, null, 8,
|
|
73
|
+
}, null, 8, _hoisted_3)) : (openBlock(), createBlock(_component_el_image, {
|
|
73
74
|
key: 2,
|
|
74
75
|
style: normalizeStyle(iconStyle.value),
|
|
75
76
|
src: iconURL.value
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"FileComponent.vue2.mjs","sources":["../../../../../../../packages/components/src/composite/fileComponent/FileComponent.vue"],"sourcesContent":["<template>\r\n <div class=\"gm-flex gm-h-full gm-items-center gm-justify-center\">\r\n <
|
|
1
|
+
{"version":3,"file":"FileComponent.vue2.mjs","sources":["../../../../../../../packages/components/src/composite/fileComponent/FileComponent.vue"],"sourcesContent":["<template>\r\n <div class=\"gm-flex gm-h-full gm-items-center gm-justify-center\">\r\n <img v-if=\"isImageUrl(verifyFile)\" :src=\"fileURL\" fit=\"contain\" style=\"max-width: 100%; max-height: 100%\" />\r\n <video\r\n v-else-if=\"isVideoUrl(verifyFile)\"\r\n :src=\"fileURL\"\r\n :controls=\"controls\"\r\n :controlslist=\"controlslist\"\r\n :oncontextmenu=\"() => oncontextmenu\"\r\n style=\"width: 100%; height: 100%\"\r\n />\r\n <el-image v-else :style=\"iconStyle\" :src=\"iconURL\" />\r\n </div>\r\n</template>\r\n\r\n<script setup lang=\"ts\">\r\nimport { computed } from 'vue';\r\nimport { isExcel, isImageUrl, isPDF, isPPT, isPSD, isText, isVideoUrl, isWord, isZip } from '@giime/utils/src/is';\r\nimport { fileComponentProps } from './fileComponent';\r\nimport PDF from './assets/image/pdf.svg';\r\nimport WORD from './assets/image/word.svg';\r\nimport EXCEL from './assets/image/excel.svg';\r\nimport PPT from './assets/image/ppt.svg';\r\nimport PSD from './assets/image/psd.svg';\r\nimport TEXT from './assets/image/text.svg';\r\nimport ZIP from './assets/image/zip.svg';\r\nimport UNKNOWN from './assets/image/unknown.svg';\r\nimport type { UploadFile } from 'element-plus';\r\n\r\ndefineOptions({\r\n name: 'GmFileComponent',\r\n});\r\n\r\nconst props = defineProps(fileComponentProps);\r\n\r\nconst iconStyle = computed(() => {\r\n return {\r\n width: `${props.size}px`,\r\n height: `${props.size}px`,\r\n };\r\n});\r\n\r\nconst fileURL = computed(() => {\r\n return props.file[props.url as keyof UploadFile] as string;\r\n});\r\n\r\nconst verifyFile = computed(() => {\r\n return props.file[props.field as keyof UploadFile] as string;\r\n});\r\n\r\nconst iconURL = computed(() => {\r\n const verifyFile = props.file[props.field as keyof UploadFile] as string;\r\n let result: any = null;\r\n if (isPDF(verifyFile)) {\r\n result = PDF;\r\n } else if (isWord(verifyFile)) {\r\n result = WORD;\r\n } else if (isExcel(verifyFile)) {\r\n result = EXCEL;\r\n } else if (isText(verifyFile)) {\r\n result = TEXT;\r\n } else if (isPPT(verifyFile)) {\r\n result = PPT;\r\n } else if (isZip(verifyFile)) {\r\n result = ZIP;\r\n } else if (isPSD(verifyFile)) {\r\n result = PSD;\r\n } else {\r\n result = UNKNOWN;\r\n }\r\n return result;\r\n});\r\n</script>\r\n"],"names":["verifyFile"],"mappings":";;;;;;;;;;;;;;;;;;;;;;AAiCA,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,OAAA,GAAU,SAAS,MAAM;AAC7B,MAAO,OAAA,KAAA,CAAM,IAAK,CAAA,KAAA,C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
|
4
4
|
import _export_sfc from '../../../../_virtual/_plugin-vue_export-helper.mjs';
|
|
5
5
|
|
|
6
|
-
var UploadFile = /* @__PURE__ */ _export_sfc(_sfc_main, [["__scopeId", "data-v-
|
|
6
|
+
var UploadFile = /* @__PURE__ */ _export_sfc(_sfc_main, [["__scopeId", "data-v-bb2dfbf0"]]);
|
|
7
7
|
|
|
8
8
|
export { UploadFile as default };
|
|
9
9
|
//# sourceMappingURL=UploadFile.vue.mjs.map
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { pushScopeId, popScopeId, createElementVNode, createTextVNode, defineComponent, mergeModels, useModel, ref, resolveComponent, openBlock, createElementBlock, createVNode, withCtx, mergeProps, createSlots, renderSlot, normalizeStyle, unref,
|
|
1
|
+
import { pushScopeId, popScopeId, createElementVNode, createTextVNode, defineComponent, mergeModels, useModel, ref, resolveComponent, openBlock, createElementBlock, normalizeClass, createVNode, withCtx, mergeProps, createSlots, renderSlot, normalizeStyle, unref, createBlock, createCommentVNode } from 'vue';
|
|
2
2
|
import { ElMessageBox } from 'element-plus';
|
|
3
3
|
import { useAliossHookStore } from '../../../../utils/src/alioss/aliossPutHook.mjs';
|
|
4
4
|
import { UploadFilled, View, Delete } from '@element-plus/icons-vue';
|
|
@@ -6,9 +6,8 @@ import { GmFileComponent } from '../fileComponent/index.mjs';
|
|
|
6
6
|
import { GmPreviewFile } from '../previewFile/index.mjs';
|
|
7
7
|
import { uploadFileProps } from './uploadFile.mjs';
|
|
8
8
|
|
|
9
|
-
const _withScopeId = (n) => (pushScopeId("data-v-
|
|
10
|
-
const _hoisted_1 =
|
|
11
|
-
const _hoisted_2 = /* @__PURE__ */ _withScopeId(() => /* @__PURE__ */ createElementVNode(
|
|
9
|
+
const _withScopeId = (n) => (pushScopeId("data-v-bb2dfbf0"), n = n(), popScopeId(), n);
|
|
10
|
+
const _hoisted_1 = /* @__PURE__ */ _withScopeId(() => /* @__PURE__ */ createElementVNode(
|
|
12
11
|
"div",
|
|
13
12
|
{ class: "el-upload__text gm-text-center !gm-text-xs gm-text-gray-500" },
|
|
14
13
|
[
|
|
@@ -18,9 +17,9 @@ const _hoisted_2 = /* @__PURE__ */ _withScopeId(() => /* @__PURE__ */ createElem
|
|
|
18
17
|
-1
|
|
19
18
|
/* HOISTED */
|
|
20
19
|
));
|
|
21
|
-
const
|
|
20
|
+
const _hoisted_2 = { class: "el-upload-list__item-actions" };
|
|
21
|
+
const _hoisted_3 = ["onClick"];
|
|
22
22
|
const _hoisted_4 = ["onClick"];
|
|
23
|
-
const _hoisted_5 = ["onClick"];
|
|
24
23
|
var _sfc_main = /* @__PURE__ */ defineComponent({
|
|
25
24
|
...{
|
|
26
25
|
name: "GmUploadFile"
|
|
@@ -69,6 +68,12 @@ var _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
69
68
|
});
|
|
70
69
|
return res;
|
|
71
70
|
};
|
|
71
|
+
const beforeRemove = (file, files) => {
|
|
72
|
+
if (props.disabled) {
|
|
73
|
+
return false;
|
|
74
|
+
}
|
|
75
|
+
return props.beforeRemove ? props.beforeRemove(file, files) : true;
|
|
76
|
+
};
|
|
72
77
|
const handleRemove = (file) => {
|
|
73
78
|
ElMessageBox.confirm("\u786E\u5B9A\u5220\u9664\u8BE5\u6587\u4EF6\u5417\uFF1F", "\u63D0\u793A", {
|
|
74
79
|
confirmButtonText: "\u786E\u5B9A",
|
|
@@ -110,127 +115,148 @@ var _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
110
115
|
});
|
|
111
116
|
return (_ctx, _cache) => {
|
|
112
117
|
const _component_el_icon = resolveComponent("el-icon");
|
|
118
|
+
const _component_el_button = resolveComponent("el-button");
|
|
113
119
|
const _component_el_checkbox = resolveComponent("el-checkbox");
|
|
114
120
|
const _component_el_upload = resolveComponent("el-upload");
|
|
115
121
|
const _component_el_checkbox_group = resolveComponent("el-checkbox-group");
|
|
116
|
-
return openBlock(), createElementBlock(
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
createVNode(_component_el_icon, {
|
|
142
|
-
size: 30,
|
|
143
|
-
color: "#999"
|
|
144
|
-
}, {
|
|
145
|
-
default: withCtx(() => [
|
|
146
|
-
createVNode(unref(UploadFilled))
|
|
147
|
-
]),
|
|
148
|
-
_: 1
|
|
149
|
-
/* STABLE */
|
|
150
|
-
}),
|
|
151
|
-
_hoisted_2
|
|
152
|
-
],
|
|
153
|
-
4
|
|
154
|
-
/* STYLE */
|
|
155
|
-
)
|
|
156
|
-
], true) : createCommentVNode("v-if", true)
|
|
157
|
-
]),
|
|
158
|
-
_: 2
|
|
159
|
-
/* DYNAMIC */
|
|
160
|
-
}, [
|
|
161
|
-
_ctx.showFileList && _ctx.listType === "picture-card" ? {
|
|
162
|
-
name: "file",
|
|
163
|
-
fn: withCtx(({ file }) => [
|
|
164
|
-
_ctx.checkbox ? (openBlock(), createBlock(_component_el_checkbox, {
|
|
165
|
-
key: 0,
|
|
166
|
-
value: file
|
|
167
|
-
}, null, 8, ["value"])) : createCommentVNode("v-if", true),
|
|
168
|
-
renderSlot(_ctx.$slots, "file", { file }, () => [
|
|
169
|
-
createElementVNode(
|
|
122
|
+
return openBlock(), createElementBlock(
|
|
123
|
+
"div",
|
|
124
|
+
{
|
|
125
|
+
class: normalizeClass([{ "gm-upload-file-picture-card": _ctx.listType === "picture-card", "gm-upload-file-disabled": _ctx.disabled }, "gm-upload-file"])
|
|
126
|
+
},
|
|
127
|
+
[
|
|
128
|
+
createVNode(_component_el_checkbox_group, {
|
|
129
|
+
modelValue: checkoutFiles.value,
|
|
130
|
+
"onUpdate:modelValue": _cache[1] || (_cache[1] = ($event) => checkoutFiles.value = $event),
|
|
131
|
+
onChange: handleCheckedChange
|
|
132
|
+
}, {
|
|
133
|
+
default: withCtx(() => [
|
|
134
|
+
createVNode(_component_el_upload, mergeProps({
|
|
135
|
+
ref_key: "uploadFileRef",
|
|
136
|
+
ref: uploadFileRef
|
|
137
|
+
}, props, {
|
|
138
|
+
"file-list": fileList.value,
|
|
139
|
+
"onUpdate:fileList": _cache[0] || (_cache[0] = ($event) => fileList.value = $event),
|
|
140
|
+
"before-remove": beforeRemove,
|
|
141
|
+
action: "",
|
|
142
|
+
"http-request": httpRequest
|
|
143
|
+
}), createSlots({
|
|
144
|
+
default: withCtx(() => [
|
|
145
|
+
!_ctx.disabled ? renderSlot(_ctx.$slots, "default", { key: 0 }, () => [
|
|
146
|
+
_ctx.listType === "picture-card" ? (openBlock(), createElementBlock(
|
|
170
147
|
"div",
|
|
171
148
|
{
|
|
172
|
-
|
|
173
|
-
|
|
149
|
+
key: 0,
|
|
150
|
+
class: "gm-flex gm-flex-col gm-items-center gm-justify-center gm-rounded-md gm-p-1",
|
|
151
|
+
style: normalizeStyle([{ "flex-direction": "column" }, { width: _ctx.width + "px", height: _ctx.height + "px" }])
|
|
174
152
|
},
|
|
175
153
|
[
|
|
176
|
-
createVNode(
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
controls: false
|
|
181
|
-
}, null, 8, ["file", "size", "url"])
|
|
182
|
-
],
|
|
183
|
-
4
|
|
184
|
-
/* STYLE */
|
|
185
|
-
),
|
|
186
|
-
createElementVNode("div", _hoisted_3, [
|
|
187
|
-
createElementVNode("span", {
|
|
188
|
-
class: "el-upload-list__item-preview",
|
|
189
|
-
onClick: ($event) => handlePreview(file)
|
|
190
|
-
}, [
|
|
191
|
-
createVNode(_component_el_icon, null, {
|
|
154
|
+
createVNode(_component_el_icon, {
|
|
155
|
+
size: 30,
|
|
156
|
+
color: "#999"
|
|
157
|
+
}, {
|
|
192
158
|
default: withCtx(() => [
|
|
193
|
-
createVNode(unref(
|
|
159
|
+
createVNode(unref(UploadFilled))
|
|
194
160
|
]),
|
|
195
161
|
_: 1
|
|
196
162
|
/* STABLE */
|
|
197
|
-
})
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
], true)
|
|
163
|
+
}),
|
|
164
|
+
_hoisted_1
|
|
165
|
+
],
|
|
166
|
+
4
|
|
167
|
+
/* STYLE */
|
|
168
|
+
)) : (openBlock(), createBlock(_component_el_button, {
|
|
169
|
+
key: 1,
|
|
170
|
+
type: "primary",
|
|
171
|
+
size: "default"
|
|
172
|
+
}, {
|
|
173
|
+
default: withCtx(() => [
|
|
174
|
+
createTextVNode("\u70B9\u51FB\u4E0A\u4F20")
|
|
175
|
+
]),
|
|
176
|
+
_: 1
|
|
177
|
+
/* STABLE */
|
|
178
|
+
}))
|
|
179
|
+
], true) : createCommentVNode("v-if", true)
|
|
214
180
|
]),
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
181
|
+
_: 2
|
|
182
|
+
/* DYNAMIC */
|
|
183
|
+
}, [
|
|
184
|
+
_ctx.showFileList && _ctx.listType === "picture-card" ? {
|
|
185
|
+
name: "file",
|
|
186
|
+
fn: withCtx(({ file }) => [
|
|
187
|
+
_ctx.checkbox ? (openBlock(), createBlock(_component_el_checkbox, {
|
|
188
|
+
key: 0,
|
|
189
|
+
value: file
|
|
190
|
+
}, null, 8, ["value"])) : createCommentVNode("v-if", true),
|
|
191
|
+
renderSlot(_ctx.$slots, "file", { file }, () => [
|
|
192
|
+
createElementVNode(
|
|
193
|
+
"div",
|
|
194
|
+
{
|
|
195
|
+
class: "gm-flex gm-items-center gm-justify-center gm-rounded-md",
|
|
196
|
+
style: normalizeStyle({ width: _ctx.width + "px", height: _ctx.height + "px" })
|
|
197
|
+
},
|
|
198
|
+
[
|
|
199
|
+
createVNode(unref(GmFileComponent), {
|
|
200
|
+
file,
|
|
201
|
+
size: _ctx.width - 40,
|
|
202
|
+
url: _ctx.url,
|
|
203
|
+
controls: false
|
|
204
|
+
}, null, 8, ["file", "size", "url"])
|
|
205
|
+
],
|
|
206
|
+
4
|
|
207
|
+
/* STYLE */
|
|
208
|
+
),
|
|
209
|
+
createElementVNode("div", _hoisted_2, [
|
|
210
|
+
createElementVNode("span", {
|
|
211
|
+
class: "el-upload-list__item-preview",
|
|
212
|
+
onClick: ($event) => handlePreview(file)
|
|
213
|
+
}, [
|
|
214
|
+
createVNode(_component_el_icon, null, {
|
|
215
|
+
default: withCtx(() => [
|
|
216
|
+
createVNode(unref(View))
|
|
217
|
+
]),
|
|
218
|
+
_: 1
|
|
219
|
+
/* STABLE */
|
|
220
|
+
})
|
|
221
|
+
], 8, _hoisted_3),
|
|
222
|
+
_ctx.showDelete ? (openBlock(), createElementBlock("span", {
|
|
223
|
+
key: 0,
|
|
224
|
+
class: "el-upload-list__item-delete",
|
|
225
|
+
onClick: ($event) => handleRemove(file)
|
|
226
|
+
}, [
|
|
227
|
+
createVNode(_component_el_icon, null, {
|
|
228
|
+
default: withCtx(() => [
|
|
229
|
+
createVNode(unref(Delete))
|
|
230
|
+
]),
|
|
231
|
+
_: 1
|
|
232
|
+
/* STABLE */
|
|
233
|
+
})
|
|
234
|
+
], 8, _hoisted_4)) : createCommentVNode("v-if", true)
|
|
235
|
+
])
|
|
236
|
+
], true)
|
|
237
|
+
]),
|
|
238
|
+
key: "0"
|
|
239
|
+
} : void 0
|
|
240
|
+
]), 1040, ["file-list"])
|
|
241
|
+
]),
|
|
242
|
+
_: 3
|
|
243
|
+
/* FORWARDED */
|
|
244
|
+
}, 8, ["modelValue"]),
|
|
245
|
+
createVNode(unref(GmPreviewFile), {
|
|
246
|
+
dialogVisible: dialogVisible.value,
|
|
247
|
+
"onUpdate:dialogVisible": _cache[2] || (_cache[2] = ($event) => dialogVisible.value = $event),
|
|
248
|
+
"file-index": fileIndex.value,
|
|
249
|
+
"onUpdate:fileIndex": _cache[3] || (_cache[3] = ($event) => fileIndex.value = $event),
|
|
250
|
+
"file-list": fileList.value,
|
|
251
|
+
controls: _ctx.controls,
|
|
252
|
+
oncontextmenu: _ctx.oncontextmenu,
|
|
253
|
+
controlslist: _ctx.controlslist,
|
|
254
|
+
field: _ctx.field
|
|
255
|
+
}, null, 8, ["dialogVisible", "file-index", "file-list", "controls", "oncontextmenu", "controlslist", "field"])
|
|
256
|
+
],
|
|
257
|
+
2
|
|
258
|
+
/* CLASS */
|
|
259
|
+
);
|
|
234
260
|
};
|
|
235
261
|
}
|
|
236
262
|
});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"UploadFile.vue2.mjs","sources":["../../../../../../../packages/components/src/composite/uploadFile/UploadFile.vue"],"sourcesContent":["<template>\r\n <div class=\"el-upload-file\">\r\n <el-checkbox-group v-model=\"checkoutFiles\" @change=\"handleCheckedChange\">\r\n <el-upload ref=\"uploadFileRef\" v-bind=\"props\" v-model:file-list=\"fileList\" action=\"\" :http-request=\"httpRequest\">\r\n <slot v-if=\"!disabled\">\r\n <div\r\n class=\"gm-flex gm-flex-col gm-items-center gm-justify-center gm-rounded-md gm-p-1\"\r\n style=\"flex-direction: column\"\r\n :style=\"{ width: width + 'px', height: height + 'px' }\"\r\n >\r\n <el-icon :size=\"30\" color=\"#999\">\r\n <UploadFilled />\r\n </el-icon>\r\n <div class=\"el-upload__text gm-text-center !gm-text-xs gm-text-gray-500\">\r\n 将文件拖到此处,或 <em class=\"gm-text-blue-700\">点击上传</em>\r\n </div>\r\n </div>\r\n </slot>\r\n <template v-if=\"showFileList && listType === 'picture-card'\" #file=\"{ file }\">\r\n <el-checkbox v-if=\"checkbox\" :value=\"file\" />\r\n <slot name=\"file\" :file=\"file\">\r\n <div class=\"gm-flex gm-items-center gm-justify-center gm-rounded-md\" :style=\"{ width: width + 'px', height: height + 'px' }\">\r\n <GmFileComponent :file=\"file\" :size=\"width - 40\" :url=\"url\" :controls=\"false\" />\r\n </div>\r\n <div class=\"el-upload-list__item-actions\">\r\n <span class=\"el-upload-list__item-preview\" @click=\"handlePreview(file)\">\r\n <el-icon><View /></el-icon>\r\n </span>\r\n <span v-if=\"showDelete\" class=\"el-upload-list__item-delete\" @click=\"handleRemove(file)\">\r\n <el-icon><Delete /></el-icon>\r\n </span>\r\n </div>\r\n </slot>\r\n </template>\r\n </el-upload>\r\n </el-checkbox-group>\r\n\r\n <GmPreviewFile\r\n v-model:dialogVisible=\"dialogVisible\"\r\n v-model:file-index=\"fileIndex\"\r\n :file-list=\"fileList\"\r\n :controls=\"controls\"\r\n :oncontextmenu=\"oncontextmenu\"\r\n :controlslist=\"controlslist\"\r\n :field=\"field\"\r\n />\r\n </div>\r\n</template>\r\n\r\n<script setup lang=\"ts\">\r\nimport { ref } from 'vue';\r\nimport { ElMessageBox } from 'element-plus';\r\nimport { useAliossHookStore } from '@giime/utils/src/alioss/aliossPutHook';\r\nimport { Delete, UploadFilled, View } from '@element-plus/icons-vue';\r\nimport GmFileComponent from '../fileComponent';\r\nimport GmPreviewFile from '../previewFile';\r\nimport { uploadFileProps } from './uploadFile';\r\nimport type { CheckboxValueType, UploadFile, UploadFiles, UploadInstance, UploadRawFile, UploadRequestOptions, UploadStatus } from 'element-plus';\r\nimport type { PostSaveFileResponse } from '@giime/utils/src/alioss/aliossPutHook';\r\n\r\ndefineOptions({\r\n name: 'GmUploadFile',\r\n});\r\n\r\nconst props = defineProps(uploadFileProps);\r\nconst emit = defineEmits([\"handleRemove\", \"handleSaveFileSuccess\"]);\r\n\r\nconst { uploadFile, saveFileResult } = useAliossHookStore();\r\n\r\nsaveFileResult((res: any) => {\r\n const { url, md5_code, file_size } = res;\r\n emit('handleSaveFileSuccess', { url, md5_code, file_size });\r\n});\r\n\r\n/** 上传文件 */\r\nconst fileList = defineModel<UploadFiles>('fileList', { default: [] });\r\n/** 多选数据 */\r\nconst checkoutFiles = defineModel<any[]>('checkoutFiles', { default: [] });\r\n/** 多选状态状态 */\r\nconst isIndeterminate = defineModel<boolean>('isIndeterminate', { default: false });\r\n/** 是否全选 */\r\nconst checkedAll = defineModel<boolean>('checkedAll', { default: false });\r\nconst handleCheckedChange = (value: CheckboxValueType[]) => {\r\n const { length } = value;\r\n checkedAll.value = length === fileList.value.length;\r\n isIndeterminate.value = length > 0 && length < fileList.value.length;\r\n};\r\n\r\n/* 上传 */\r\nconst httpRequest = async (params: UploadRequestOptions) => {\r\n const { file } = params;\r\n const res = await uploadFile({\r\n file,\r\n fileName: props.fileName,\r\n folder: props.folder,\r\n seat: props.seat,\r\n partSize: props.partSize,\r\n parallel: props.parallel,\r\n options: props.options,\r\n bucket: props.bucket,\r\n saveStore: props.saveStore,\r\n });\r\n return res;\r\n};\r\n\r\n/* 删除文件 */\r\nconst handleRemove = (file: UploadFile) => {\r\n ElMessageBox.confirm('确定删除该文件吗?', '提示', {\r\n confirmButtonText: '确定',\r\n cancelButtonText: '取消',\r\n type: 'warning',\r\n })\r\n .then(() => {\r\n const index = fileList.value.indexOf(file);\r\n fileList.value = fileList.value.filter((v, i) => v.url !== file.url || (v.url === file.url && i !== index));\r\n emit('handleRemove', { file, index });\r\n return props.onRemove(file, fileList.value);\r\n })\r\n .catch(() => {});\r\n};\r\n\r\nconst uploadFileRef = ref<UploadInstance>();\r\n/* 手动上传 */\r\nconst submit = () => {\r\n uploadFileRef.value!.submit();\r\n};\r\n\r\n/** 取消上传 */\r\nconst abort = (file: UploadFile) => {\r\n uploadFileRef.value!.abort(file);\r\n};\r\n\r\n/** 清空已上传的文件列表 */\r\nconst clearFiles = (status?: UploadStatus[]) => {\r\n uploadFileRef.value!.clearFiles(status);\r\n};\r\n\r\n/** 手动选择文件 */\r\nconst handleStart = (rawFile: UploadRawFile) => {\r\n uploadFileRef.value!.handleStart(rawFile);\r\n};\r\n\r\n/** 预览 */\r\nconst dialogVisible = ref(false);\r\nconst fileIndex = ref(0);\r\nconst handlePreview = (file: UploadFile) => {\r\n fileIndex.value = fileList.value.indexOf(file);\r\n dialogVisible.value = true;\r\n};\r\n\r\ndefineExpose({\r\n submit,\r\n abort,\r\n clearFiles,\r\n handleStart,\r\n uploadFileRef,\r\n});\r\n</script>\r\n\r\n<style scoped lang=\"scss\">\r\n.gm-upload-preview-dialog {\r\n :deep(.el-dialog__body) {\r\n padding: 0;\r\n }\r\n}\r\n:deep(.el-upload-list__item),\r\n:deep(.el-upload--picture-card) {\r\n width: 120px;\r\n height: 120px;\r\n display: flex;\r\n align-items: center;\r\n justify-content: center;\r\n}\r\n</style>\r\n<style lang=\"scss\">\r\n.el-upload-file {\r\n line-height: normal;\r\n .el-checkbox {\r\n position: absolute;\r\n left: 10px;\r\n top: 0;\r\n z-index: 9;\r\n }\r\n .el-upload-list__item-file-name {\r\n line-height: normal;\r\n }\r\n}\r\n</style>\r\n"],"names":["_useModel"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAgEA,IAAA,MAAM,KAAQ,GAAA,OAAA,CAAA;AACd,IAAA,MAAM,IAAO,GAAA,MAAA,CAAA;AAEb,IAAA,MAAM,EAAE,UAAA,EAAY,cAAe,EAAA,GAAI,kBAAmB,EAAA,CAAA;AAE1D,IAAA,cAAA,CAAe,CAAC,GAAa,KAAA;AAC3B,MAAA,MAAM,EAAE,GAAA,EAAK,QAAU,EAAA,SAAA,EAAc,GAAA,GAAA,CAAA;AACrC,MAAA,IAAA,CAAK,uBAAyB,EAAA,EAAE,GAAK,EAAA,QAAA,EAAU,WAAW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AAA,GAAgB,IAAI,KAAK,CAAA,CAAA;AAC/B,IAAM,MAAA,SAAA,GAAY,IAAI,CAAC,CAAA,CAAA;AACvB,IAAM,MAAA,aAAA,GAAgB,CAAC,IAAqB,KAAA;AAC1C,MAAA,SAAA,CAAU,KAAQ,GAAA,QAAA,CAAS,KAAM,CAAA,OAAA,CAAQ,IAAI,CAAA,CAAA;AAC7C,MAAA,aAAA,CAAc,KAAQ,GAAA,IAAA,CAAA;AAAA,KACxB,CAAA;AAEA,IAAa,QAAA,CAAA;AAAA,MACX,MAAA;AAAA,MACA,KAAA;AAAA,MACA,UAAA;AAAA,MACA,WAAA;AAAA,MACA,aAAA;AAAA,KACD,CAAA,CAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
|
|
1
|
+
{"version":3,"file":"UploadFile.vue2.mjs","sources":["../../../../../../../packages/components/src/composite/uploadFile/UploadFile.vue"],"sourcesContent":["<template>\r\n <div :class=\"{ 'gm-upload-file-picture-card': listType === 'picture-card', 'gm-upload-file-disabled': disabled }\" class=\"gm-upload-file\">\r\n <el-checkbox-group v-model=\"checkoutFiles\" @change=\"handleCheckedChange\">\r\n <el-upload ref=\"uploadFileRef\" v-bind=\"props\" v-model:file-list=\"fileList\" :before-remove=\"beforeRemove\" action=\"\" :http-request=\"httpRequest\">\r\n <slot v-if=\"!disabled\">\r\n <template v-if=\"listType === 'picture-card'\">\r\n <div\r\n class=\"gm-flex gm-flex-col gm-items-center gm-justify-center gm-rounded-md gm-p-1\"\r\n style=\"flex-direction: column\"\r\n :style=\"{ width: width + 'px', height: height + 'px' }\"\r\n >\r\n <el-icon :size=\"30\" color=\"#999\">\r\n <UploadFilled />\r\n </el-icon>\r\n <div class=\"el-upload__text gm-text-center !gm-text-xs gm-text-gray-500\">\r\n 将文件拖到此处,或 <em class=\"gm-text-blue-700\">点击上传</em>\r\n </div>\r\n </div>\r\n </template>\r\n <template v-else>\r\n <el-button type=\"primary\" size=\"default\">点击上传</el-button>\r\n </template>\r\n </slot>\r\n <template v-if=\"showFileList && listType === 'picture-card'\" #file=\"{ file }\">\r\n <el-checkbox v-if=\"checkbox\" :value=\"file\" />\r\n <slot name=\"file\" :file=\"file\">\r\n <div class=\"gm-flex gm-items-center gm-justify-center gm-rounded-md\" :style=\"{ width: width + 'px', height: height + 'px' }\">\r\n <GmFileComponent :file=\"file\" :size=\"width - 40\" :url=\"url\" :controls=\"false\" />\r\n </div>\r\n <div class=\"el-upload-list__item-actions\">\r\n <span class=\"el-upload-list__item-preview\" @click=\"handlePreview(file)\">\r\n <el-icon><View /></el-icon>\r\n </span>\r\n <span v-if=\"showDelete\" class=\"el-upload-list__item-delete\" @click=\"handleRemove(file)\">\r\n <el-icon><Delete /></el-icon>\r\n </span>\r\n </div>\r\n </slot>\r\n </template>\r\n </el-upload>\r\n </el-checkbox-group>\r\n\r\n <GmPreviewFile\r\n v-model:dialogVisible=\"dialogVisible\"\r\n v-model:file-index=\"fileIndex\"\r\n :file-list=\"fileList\"\r\n :controls=\"controls\"\r\n :oncontextmenu=\"oncontextmenu\"\r\n :controlslist=\"controlslist\"\r\n :field=\"field\"\r\n />\r\n </div>\r\n</template>\r\n\r\n<script setup lang=\"ts\">\r\nimport { ref } from 'vue';\r\nimport { ElMessageBox } from 'element-plus';\r\nimport { useAliossHookStore } from '@giime/utils/src/alioss/aliossPutHook';\r\nimport { Delete, UploadFilled, View } from '@element-plus/icons-vue';\r\nimport GmFileComponent from '../fileComponent';\r\nimport GmPreviewFile from '../previewFile';\r\nimport { uploadFileProps } from './uploadFile';\r\nimport type { CheckboxValueType, UploadFile, UploadFiles, UploadInstance, UploadRawFile, UploadRequestOptions, UploadStatus } from 'element-plus';\r\nimport type { PostSaveFileResponse } from '@giime/utils/src/alioss/aliossPutHook';\r\n\r\ndefineOptions({\r\n name: 'GmUploadFile',\r\n});\r\n\r\nconst props = defineProps(uploadFileProps);\r\nconst emit = defineEmits([\"handleRemove\", \"handleSaveFileSuccess\"]);\r\n\r\nconst { uploadFile, saveFileResult } = useAliossHookStore();\r\n\r\nsaveFileResult((res: any) => {\r\n const { url, md5_code, file_size } = res;\r\n emit('handleSaveFileSuccess', { url, md5_code, file_size });\r\n});\r\n\r\n/** 上传文件 */\r\nconst fileList = defineModel<UploadFiles>('fileList', { default: [] });\r\n/** 多选数据 */\r\nconst checkoutFiles = defineModel<any[]>('checkoutFiles', { default: [] });\r\n/** 多选状态状态 */\r\nconst isIndeterminate = defineModel<boolean>('isIndeterminate', { default: false });\r\n/** 是否全选 */\r\nconst checkedAll = defineModel<boolean>('checkedAll', { default: false });\r\nconst handleCheckedChange = (value: CheckboxValueType[]) => {\r\n const { length } = value;\r\n checkedAll.value = length === fileList.value.length;\r\n isIndeterminate.value = length > 0 && length < fileList.value.length;\r\n};\r\n\r\n/* 上传 */\r\nconst httpRequest = async (params: UploadRequestOptions) => {\r\n const { file } = params;\r\n const res = await uploadFile({\r\n file,\r\n fileName: props.fileName,\r\n folder: props.folder,\r\n seat: props.seat,\r\n partSize: props.partSize,\r\n parallel: props.parallel,\r\n options: props.options,\r\n bucket: props.bucket,\r\n saveStore: props.saveStore,\r\n });\r\n return res;\r\n};\r\n\r\n/* 删除文件前 */\r\nconst beforeRemove = (file: UploadFile, files: UploadFiles) => {\r\n if (props.disabled) {\r\n return false;\r\n }\r\n return props.beforeRemove ? props.beforeRemove(file, files) : true;\r\n};\r\n\r\n/* 删除文件 */\r\nconst handleRemove = (file: UploadFile) => {\r\n ElMessageBox.confirm('确定删除该文件吗?', '提示', {\r\n confirmButtonText: '确定',\r\n cancelButtonText: '取消',\r\n type: 'warning',\r\n })\r\n .then(() => {\r\n const index = fileList.value.indexOf(file);\r\n fileList.value = fileList.value.filter((v, i) => v.url !== file.url || (v.url === file.url && i !== index));\r\n emit('handleRemove', { file, index });\r\n return props.onRemove(file, fileList.value);\r\n })\r\n .catch(() => {});\r\n};\r\n\r\nconst uploadFileRef = ref<UploadInstance>();\r\n/* 手动上传 */\r\nconst submit = () => {\r\n uploadFileRef.value!.submit();\r\n};\r\n\r\n/** 取消上传 */\r\nconst abort = (file: UploadFile) => {\r\n uploadFileRef.value!.abort(file);\r\n};\r\n\r\n/** 清空已上传的文件列表 */\r\nconst clearFiles = (status?: UploadStatus[]) => {\r\n uploadFileRef.value!.clearFiles(status);\r\n};\r\n\r\n/** 手动选择文件 */\r\nconst handleStart = (rawFile: UploadRawFile) => {\r\n uploadFileRef.value!.handleStart(rawFile);\r\n};\r\n\r\n/** 预览 */\r\nconst dialogVisible = ref(false);\r\nconst fileIndex = ref(0);\r\nconst handlePreview = (file: UploadFile) => {\r\n fileIndex.value = fileList.value.indexOf(file);\r\n dialogVisible.value = true;\r\n};\r\n\r\ndefineExpose({\r\n submit,\r\n abort,\r\n clearFiles,\r\n handleStart,\r\n uploadFileRef,\r\n});\r\n</script>\r\n\r\n<style scoped lang=\"scss\">\r\n.gm-upload-preview-dialog {\r\n :deep(.el-dialog__body) {\r\n padding: 0;\r\n }\r\n}\r\n.gm-upload-file-picture-card {\r\n :deep(.el-upload-list__item),\r\n :deep(.el-upload--picture-card) {\r\n width: 120px;\r\n height: 120px;\r\n display: flex;\r\n align-items: center;\r\n justify-content: center;\r\n }\r\n}\r\n</style>\r\n<style lang=\"scss\">\r\n.gm-upload-file {\r\n line-height: normal;\r\n .el-checkbox {\r\n position: absolute;\r\n left: 10px;\r\n top: 0;\r\n z-index: 9;\r\n }\r\n .el-upload-list__item-file-name {\r\n line-height: normal;\r\n }\r\n}\r\n.gm-upload-file-disabled {\r\n .el-upload-list__item-status-label {\r\n display: none;\r\n }\r\n}\r\n</style>\r\n"],"names":["_useModel"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAqEA,IAAA,MAAM,KAAQ,GAAA,OAAA,CAAA;AACd,IAAA,M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|
-
export declare const version = "0.5.
|
|
1
|
+
export declare const version = "0.5.7";
|
package/es/giime/version.mjs
CHANGED
package/es/giime/version.mjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"version.mjs","sources":["../../../../packages/giime/version.ts"],"sourcesContent":["export const version = '0.5.
|
|
1
|
+
{"version":3,"file":"version.mjs","sources":["../../../../packages/giime/version.ts"],"sourcesContent":["export const version = '0.5.6';\n"],"names":[],"mappings":"AAAO,MAAM,OAAU,GAAA;;;;"}
|