giime 0.7.9 → 0.7.11
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 +64 -61
- package/es/components/index.mjs +2 -0
- package/es/components/index.mjs.map +1 -1
- package/es/components/src/business/uploadPro/UploadPro.vue.mjs +1 -1
- package/es/components/src/business/uploadPro/UploadPro.vue2.mjs +1 -8
- package/es/components/src/business/uploadPro/UploadPro.vue2.mjs.map +1 -1
- package/es/components/src/composite/fileComponent/FileComponent.vue.d.ts +3 -3
- package/es/components/src/composite/fileComponent/fileComponent.d.ts +1 -1
- package/es/components/src/composite/fileComponent/fileComponent.mjs.map +1 -1
- package/es/components/src/composite/fileComponent/index.d.ts +3 -3
- package/es/components/src/composite/fileList2/FileList.vue.d.ts +95 -0
- package/es/components/src/composite/fileList2/FileList.vue.mjs +6 -0
- package/es/components/src/composite/fileList2/FileList.vue.mjs.map +1 -0
- package/es/components/src/composite/fileList2/FileList.vue2.mjs +62 -0
- package/es/components/src/composite/fileList2/FileList.vue2.mjs.map +1 -0
- package/es/components/src/composite/fileList2/fileList.d.ts +47 -0
- package/es/components/src/composite/fileList2/fileList.mjs +24 -0
- package/es/components/src/composite/fileList2/fileList.mjs.map +1 -0
- package/es/components/src/composite/fileList2/index.d.ts +98 -0
- package/es/components/src/composite/fileList2/index.mjs +10 -0
- package/es/components/src/composite/fileList2/index.mjs.map +1 -0
- package/es/components/src/composite/index.d.ts +1 -0
- package/es/components/src/composite/index.mjs +2 -0
- package/es/components/src/composite/index.mjs.map +1 -1
- package/es/components/src/composite/previewFile/PreviewFile.vue.d.ts +3 -3
- package/es/components/src/composite/previewFile/PreviewFile.vue2.mjs +3 -2
- package/es/components/src/composite/previewFile/PreviewFile.vue2.mjs.map +1 -1
- package/es/components/src/composite/previewFile/index.d.ts +3 -3
- package/es/components/src/composite/previewFile/previewFile.d.ts +1 -1
- package/es/components/src/composite/uploadFile/UploadFile.vue.d.ts +3 -3
- package/es/components/src/composite/uploadFile/index.d.ts +7 -7
- package/es/components/src/composite/uploadFile/uploadFile.d.ts +1 -1
- package/es/giime/component.mjs +4 -0
- package/es/giime/component.mjs.map +1 -1
- package/es/giime/index.mjs +2 -0
- package/es/giime/index.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 +64 -61
- package/es/utils/src/file.d.ts +7 -5
- package/es/utils/src/file.mjs +26 -4
- package/es/utils/src/file.mjs.map +1 -1
- package/global.d.ts +2 -0
- package/lib/components/index.js +18 -14
- package/lib/components/index.js.map +1 -1
- package/lib/components/src/business/uploadPro/UploadPro.vue.js +1 -1
- package/lib/components/src/business/uploadPro/UploadPro.vue2.js +1 -8
- package/lib/components/src/business/uploadPro/UploadPro.vue2.js.map +1 -1
- package/lib/components/src/composite/fileComponent/FileComponent.vue.d.ts +3 -3
- package/lib/components/src/composite/fileComponent/fileComponent.d.ts +1 -1
- package/lib/components/src/composite/fileComponent/fileComponent.js.map +1 -1
- package/lib/components/src/composite/fileComponent/index.d.ts +3 -3
- package/lib/components/src/composite/fileList2/FileList.vue.d.ts +95 -0
- package/lib/components/src/composite/fileList2/FileList.vue.js +10 -0
- package/lib/components/src/composite/fileList2/FileList.vue.js.map +1 -0
- package/lib/components/src/composite/fileList2/FileList.vue2.js +66 -0
- package/lib/components/src/composite/fileList2/FileList.vue2.js.map +1 -0
- package/lib/components/src/composite/fileList2/fileList.d.ts +47 -0
- package/lib/components/src/composite/fileList2/fileList.js +26 -0
- package/lib/components/src/composite/fileList2/fileList.js.map +1 -0
- package/lib/components/src/composite/fileList2/index.d.ts +98 -0
- package/lib/components/src/composite/fileList2/index.js +16 -0
- package/lib/components/src/composite/fileList2/index.js.map +1 -0
- package/lib/components/src/composite/index.d.ts +1 -0
- package/lib/components/src/composite/index.js +4 -0
- package/lib/components/src/composite/index.js.map +1 -1
- package/lib/components/src/composite/previewFile/PreviewFile.vue.d.ts +3 -3
- package/lib/components/src/composite/previewFile/PreviewFile.vue2.js +3 -2
- package/lib/components/src/composite/previewFile/PreviewFile.vue2.js.map +1 -1
- package/lib/components/src/composite/previewFile/index.d.ts +3 -3
- package/lib/components/src/composite/previewFile/previewFile.d.ts +1 -1
- package/lib/components/src/composite/uploadFile/UploadFile.vue.d.ts +3 -3
- package/lib/components/src/composite/uploadFile/index.d.ts +7 -7
- package/lib/components/src/composite/uploadFile/uploadFile.d.ts +1 -1
- package/lib/giime/component.js +32 -28
- package/lib/giime/component.js.map +1 -1
- package/lib/giime/index.js +80 -76
- package/lib/giime/index.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 +64 -61
- package/lib/utils/src/file.d.ts +7 -5
- package/lib/utils/src/file.js +26 -4
- package/lib/utils/src/file.js.map +1 -1
- package/package.json +1 -1
package/dist/index.css
CHANGED
|
@@ -590,6 +590,9 @@ video {
|
|
|
590
590
|
.gm-h-1 {
|
|
591
591
|
height: 0.25rem;
|
|
592
592
|
}
|
|
593
|
+
.gm-h-32 {
|
|
594
|
+
height: 8rem;
|
|
595
|
+
}
|
|
593
596
|
.gm-h-\[30px\] {
|
|
594
597
|
height: 30px;
|
|
595
598
|
}
|
|
@@ -909,14 +912,6 @@ video {
|
|
|
909
912
|
stroke-dashoffset: -120px;
|
|
910
913
|
}
|
|
911
914
|
}
|
|
912
|
-
.gm-upload-pro-preview-dialog[data-v-40d129e4] [data-v-40d129e4] .el-dialog__body {
|
|
913
|
-
padding: 0;
|
|
914
|
-
}
|
|
915
|
-
|
|
916
|
-
.gm-upload-pro-file-picture-card[data-v-40d129e4] [data-v-40d129e4] .el-upload-list__item, .gm-upload-pro-file-picture-card[data-v-40d129e4] [data-v-40d129e4] .el-upload--picture-card {
|
|
917
|
-
width: auto;
|
|
918
|
-
height: auto;
|
|
919
|
-
}
|
|
920
915
|
.gm-upload-pro-file {
|
|
921
916
|
line-height: normal;
|
|
922
917
|
}
|
|
@@ -955,9 +950,13 @@ video {
|
|
|
955
950
|
.gm-upload-pro-file-disabled .el-upload-list__item-status-label {
|
|
956
951
|
display: none;
|
|
957
952
|
}
|
|
958
|
-
[data-v-
|
|
959
|
-
|
|
960
|
-
|
|
953
|
+
.gm-upload-pro-preview-dialog[data-v-9ac30390] [data-v-9ac30390] .el-dialog__body {
|
|
954
|
+
padding: 0;
|
|
955
|
+
}
|
|
956
|
+
|
|
957
|
+
.gm-upload-pro-file-picture-card[data-v-9ac30390] [data-v-9ac30390] .el-upload-list__item, .gm-upload-pro-file-picture-card[data-v-9ac30390] [data-v-9ac30390] .el-upload--picture-card {
|
|
958
|
+
width: auto;
|
|
959
|
+
height: auto;
|
|
961
960
|
}
|
|
962
961
|
.gm-flex-center[data-v-c17deec9] {
|
|
963
962
|
align-items: center;
|
|
@@ -966,32 +965,6 @@ video {
|
|
|
966
965
|
.gm-flex-justify-between[data-v-c17deec9] {
|
|
967
966
|
justify-content: space-between;
|
|
968
967
|
}
|
|
969
|
-
.gm-number-interval-single[data-v-4e6f4d6f] {
|
|
970
|
-
border-radius: var(--el-input-border-radius, var(--el-border-radius-base));
|
|
971
|
-
box-shadow: 0 0 0 1px var(--el-input-border-color, var(--el-border-color)) inset;
|
|
972
|
-
background-color: var(--el-input-bg-color, var(--el-fill-color-blank));
|
|
973
|
-
}
|
|
974
|
-
.gm-number-interval-single[data-v-4e6f4d6f] [data-v-4e6f4d6f] .el-input__wrapper {
|
|
975
|
-
box-shadow: none;
|
|
976
|
-
background: none;
|
|
977
|
-
}
|
|
978
|
-
|
|
979
|
-
.gm-number-interval-close[data-v-4e6f4d6f] {
|
|
980
|
-
display: none;
|
|
981
|
-
color: var(--el-input-icon-color, var(--el-text-color-placeholder));
|
|
982
|
-
}
|
|
983
|
-
|
|
984
|
-
.gm-number-interval-single[data-v-4e6f4d6f]:hover .gm-number-interval-close[data-v-4e6f4d6f] {
|
|
985
|
-
display: flex;
|
|
986
|
-
}
|
|
987
|
-
.gm-upload-preview-dialog[data-v-312f9322] [data-v-312f9322] .el-dialog__body {
|
|
988
|
-
padding: 0;
|
|
989
|
-
}
|
|
990
|
-
|
|
991
|
-
.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 {
|
|
992
|
-
width: auto;
|
|
993
|
-
height: auto;
|
|
994
|
-
}
|
|
995
968
|
[data-v-2c351ff8] .gmTableNoBorder .el-table__body .el-table__cell {
|
|
996
969
|
border-right: none;
|
|
997
970
|
}
|
|
@@ -1015,6 +988,28 @@ video {
|
|
|
1015
988
|
[data-v-2c351ff8] .gmTableNoBorder .el-table__border-left-patch {
|
|
1016
989
|
height: 0;
|
|
1017
990
|
}
|
|
991
|
+
.gm-number-interval-single[data-v-4e6f4d6f] {
|
|
992
|
+
border-radius: var(--el-input-border-radius, var(--el-border-radius-base));
|
|
993
|
+
box-shadow: 0 0 0 1px var(--el-input-border-color, var(--el-border-color)) inset;
|
|
994
|
+
background-color: var(--el-input-bg-color, var(--el-fill-color-blank));
|
|
995
|
+
}
|
|
996
|
+
.gm-number-interval-single[data-v-4e6f4d6f] [data-v-4e6f4d6f] .el-input__wrapper {
|
|
997
|
+
box-shadow: none;
|
|
998
|
+
background: none;
|
|
999
|
+
}
|
|
1000
|
+
|
|
1001
|
+
.gm-number-interval-close[data-v-4e6f4d6f] {
|
|
1002
|
+
display: none;
|
|
1003
|
+
color: var(--el-input-icon-color, var(--el-text-color-placeholder));
|
|
1004
|
+
}
|
|
1005
|
+
|
|
1006
|
+
.gm-number-interval-single[data-v-4e6f4d6f]:hover .gm-number-interval-close[data-v-4e6f4d6f] {
|
|
1007
|
+
display: flex;
|
|
1008
|
+
}
|
|
1009
|
+
[data-v-488ca110] .gmSearchForm .el-form-item {
|
|
1010
|
+
margin-right: 0;
|
|
1011
|
+
margin-bottom: 4px;
|
|
1012
|
+
}
|
|
1018
1013
|
[data-v-98c2e804] .gmTableNoBorder .el-table__body .el-table__cell {
|
|
1019
1014
|
border-right: none;
|
|
1020
1015
|
}
|
|
@@ -1038,6 +1033,14 @@ video {
|
|
|
1038
1033
|
[data-v-98c2e804] .gmTableNoBorder .el-table__border-left-patch {
|
|
1039
1034
|
height: 0;
|
|
1040
1035
|
}
|
|
1036
|
+
.gm-upload-preview-dialog[data-v-312f9322] [data-v-312f9322] .el-dialog__body {
|
|
1037
|
+
padding: 0;
|
|
1038
|
+
}
|
|
1039
|
+
|
|
1040
|
+
.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 {
|
|
1041
|
+
width: auto;
|
|
1042
|
+
height: auto;
|
|
1043
|
+
}
|
|
1041
1044
|
.gm-upload-file {
|
|
1042
1045
|
line-height: normal;
|
|
1043
1046
|
}
|
|
@@ -1083,112 +1086,112 @@ video {
|
|
|
1083
1086
|
}
|
|
1084
1087
|
|
|
1085
1088
|
@charset "UTF-8";
|
|
1086
|
-
.custom-
|
|
1089
|
+
.table-custom-header-drawer .el-drawer__header {
|
|
1087
1090
|
padding: 10px 15px;
|
|
1088
1091
|
margin: 0;
|
|
1089
1092
|
border-bottom: 1px solid #ebeef5;
|
|
1090
1093
|
}
|
|
1091
|
-
.custom-
|
|
1094
|
+
.table-custom-header-drawer .el-drawer__title {
|
|
1092
1095
|
font-size: 14px;
|
|
1093
1096
|
color: #333;
|
|
1094
1097
|
}
|
|
1095
|
-
.custom-
|
|
1098
|
+
.table-custom-header-drawer .el-drawer__body {
|
|
1096
1099
|
padding: 15px;
|
|
1097
1100
|
}
|
|
1098
|
-
.custom-
|
|
1101
|
+
.table-custom-header-drawer .el-drawer__footer {
|
|
1099
1102
|
padding: 10px 15px;
|
|
1100
1103
|
border-top: 1px solid #ebeef5;
|
|
1101
1104
|
}
|
|
1102
|
-
.custom-
|
|
1105
|
+
.table-custom-header-drawer .el-checkbox {
|
|
1103
1106
|
display: flex;
|
|
1104
1107
|
align-items: center;
|
|
1105
1108
|
}
|
|
1106
|
-
.custom-
|
|
1109
|
+
.table-custom-header-drawer .el-input__inner {
|
|
1107
1110
|
text-align: center;
|
|
1108
1111
|
}
|
|
1109
|
-
.custom-
|
|
1112
|
+
.table-custom-header-drawer .el-input__suffix {
|
|
1110
1113
|
position: absolute;
|
|
1111
1114
|
right: 10px;
|
|
1112
1115
|
}
|
|
1113
|
-
.custom-
|
|
1116
|
+
.table-custom-header-drawer .custom-content li {
|
|
1114
1117
|
display: flex;
|
|
1115
1118
|
align-items: center;
|
|
1116
1119
|
justify-content: center;
|
|
1117
1120
|
height: 44px;
|
|
1118
1121
|
}
|
|
1119
|
-
.custom-
|
|
1122
|
+
.table-custom-header-drawer .custom-group {
|
|
1120
1123
|
max-height: calc(100vh - 226px);
|
|
1121
1124
|
overflow-y: auto;
|
|
1122
1125
|
}
|
|
1123
|
-
.custom-
|
|
1126
|
+
.table-custom-header-drawer .custom-group::-webkit-scrollbar {
|
|
1124
1127
|
/*滚动条整体样式*/
|
|
1125
1128
|
width: 4px;
|
|
1126
1129
|
/*高宽分别对应横竖滚动条的尺寸*/
|
|
1127
1130
|
height: 1px;
|
|
1128
1131
|
}
|
|
1129
|
-
.custom-
|
|
1132
|
+
.table-custom-header-drawer .custom-group::-webkit-scrollbar-thumb {
|
|
1130
1133
|
/*滚动条里面小方块*/
|
|
1131
1134
|
border-radius: 10px;
|
|
1132
1135
|
box-shadow: inset 0 0 5px rgba(0, 0, 0, 0.1);
|
|
1133
1136
|
background: #999;
|
|
1134
1137
|
}
|
|
1135
|
-
.custom-
|
|
1138
|
+
.table-custom-header-drawer .custom-group::-webkit-scrollbar-track {
|
|
1136
1139
|
/*滚动条里面轨道*/
|
|
1137
1140
|
box-shadow: inset 0 0 3px rgba(0, 0, 0, 0.1);
|
|
1138
1141
|
border-radius: 10px;
|
|
1139
1142
|
background: #eee;
|
|
1140
1143
|
}
|
|
1141
1144
|
@charset "UTF-8";
|
|
1142
|
-
.
|
|
1145
|
+
.custom-operate-drawer .el-drawer__header {
|
|
1143
1146
|
padding: 10px 15px;
|
|
1144
1147
|
margin: 0;
|
|
1145
1148
|
border-bottom: 1px solid #ebeef5;
|
|
1146
1149
|
}
|
|
1147
|
-
.
|
|
1150
|
+
.custom-operate-drawer .el-drawer__title {
|
|
1148
1151
|
font-size: 14px;
|
|
1149
1152
|
color: #333;
|
|
1150
1153
|
}
|
|
1151
|
-
.
|
|
1154
|
+
.custom-operate-drawer .el-drawer__body {
|
|
1152
1155
|
padding: 15px;
|
|
1153
1156
|
}
|
|
1154
|
-
.
|
|
1157
|
+
.custom-operate-drawer .el-drawer__footer {
|
|
1155
1158
|
padding: 10px 15px;
|
|
1156
1159
|
border-top: 1px solid #ebeef5;
|
|
1157
1160
|
}
|
|
1158
|
-
.
|
|
1161
|
+
.custom-operate-drawer .el-checkbox {
|
|
1159
1162
|
display: flex;
|
|
1160
1163
|
align-items: center;
|
|
1161
1164
|
}
|
|
1162
|
-
.
|
|
1165
|
+
.custom-operate-drawer .el-input__inner {
|
|
1163
1166
|
text-align: center;
|
|
1164
1167
|
}
|
|
1165
|
-
.
|
|
1168
|
+
.custom-operate-drawer .el-input__suffix {
|
|
1166
1169
|
position: absolute;
|
|
1167
1170
|
right: 10px;
|
|
1168
1171
|
}
|
|
1169
|
-
.
|
|
1172
|
+
.custom-operate-drawer .custom-content li {
|
|
1170
1173
|
display: flex;
|
|
1171
1174
|
align-items: center;
|
|
1172
1175
|
justify-content: center;
|
|
1173
1176
|
height: 44px;
|
|
1174
1177
|
}
|
|
1175
|
-
.
|
|
1178
|
+
.custom-operate-drawer .custom-group {
|
|
1176
1179
|
max-height: calc(100vh - 226px);
|
|
1177
1180
|
overflow-y: auto;
|
|
1178
1181
|
}
|
|
1179
|
-
.
|
|
1182
|
+
.custom-operate-drawer .custom-group::-webkit-scrollbar {
|
|
1180
1183
|
/*滚动条整体样式*/
|
|
1181
1184
|
width: 4px;
|
|
1182
1185
|
/*高宽分别对应横竖滚动条的尺寸*/
|
|
1183
1186
|
height: 1px;
|
|
1184
1187
|
}
|
|
1185
|
-
.
|
|
1188
|
+
.custom-operate-drawer .custom-group::-webkit-scrollbar-thumb {
|
|
1186
1189
|
/*滚动条里面小方块*/
|
|
1187
1190
|
border-radius: 10px;
|
|
1188
1191
|
box-shadow: inset 0 0 5px rgba(0, 0, 0, 0.1);
|
|
1189
1192
|
background: #999;
|
|
1190
1193
|
}
|
|
1191
|
-
.
|
|
1194
|
+
.custom-operate-drawer .custom-group::-webkit-scrollbar-track {
|
|
1192
1195
|
/*滚动条里面轨道*/
|
|
1193
1196
|
box-shadow: inset 0 0 3px rgba(0, 0, 0, 0.1);
|
|
1194
1197
|
border-radius: 10px;
|
package/es/components/index.mjs
CHANGED
|
@@ -277,6 +277,8 @@ export { ruleEditorEmits, ruleEditorProps } from './src/composite/ruleEditor/rul
|
|
|
277
277
|
export { GmRuleEditor } from './src/composite/ruleEditor/index.mjs';
|
|
278
278
|
export { uploadFileProps } from './src/composite/uploadFile/uploadFile.mjs';
|
|
279
279
|
export { GmUploadFile } from './src/composite/uploadFile/index.mjs';
|
|
280
|
+
export { fileProProps } from './src/composite/fileList2/fileList.mjs';
|
|
281
|
+
export { GmFileList } from './src/composite/fileList2/index.mjs';
|
|
280
282
|
export { messageTypes, normalizeMessageOptions } from './src/plugins/message/method.mjs';
|
|
281
283
|
export { GmMessage } from './src/plugins/message/index.mjs';
|
|
282
284
|
export { GmLoading } from './src/plugins/loading/index.mjs';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.mjs","sources":[],"sourcesContent":[],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.mjs","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
|
|
@@ -3,7 +3,7 @@ import './UploadPro.vue3.mjs';
|
|
|
3
3
|
import './UploadPro.vue4.mjs';
|
|
4
4
|
import _export_sfc from '../../../../_virtual/_plugin-vue_export-helper.mjs';
|
|
5
5
|
|
|
6
|
-
var UploadPro = /* @__PURE__ */ _export_sfc(_sfc_main, [["__scopeId", "data-v-
|
|
6
|
+
var UploadPro = /* @__PURE__ */ _export_sfc(_sfc_main, [["__scopeId", "data-v-9ac30390"]]);
|
|
7
7
|
|
|
8
8
|
export { UploadPro as default };
|
|
9
9
|
//# sourceMappingURL=UploadPro.vue.mjs.map
|
|
@@ -9,7 +9,7 @@ import { uploadFileProProps } from './uploadPro.mjs';
|
|
|
9
9
|
import { getGmExports } from '../../../../utils/src/elementPlus/exports.mjs';
|
|
10
10
|
import { useUploadFile } from '../../../../hooks/base/useUploadFile/index.mjs';
|
|
11
11
|
|
|
12
|
-
const _withScopeId = (n) => (pushScopeId("data-v-
|
|
12
|
+
const _withScopeId = (n) => (pushScopeId("data-v-9ac30390"), n = n(), popScopeId(), n);
|
|
13
13
|
const _hoisted_1 = /* @__PURE__ */ _withScopeId(() => /* @__PURE__ */ createElementVNode(
|
|
14
14
|
"div",
|
|
15
15
|
{ class: "el-upload__text gm-text-center !gm-text-xs gm-text-gray-500" },
|
|
@@ -72,13 +72,6 @@ var _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
72
72
|
checkAllUploadComplete();
|
|
73
73
|
};
|
|
74
74
|
const beforeRemove = async (file, files) => {
|
|
75
|
-
if (props.disabled) {
|
|
76
|
-
return false;
|
|
77
|
-
}
|
|
78
|
-
if (props.deleteTip) {
|
|
79
|
-
await GmConfirmBox({ message: "\u786E\u5B9A\u5220\u9664\u8BE5\u6587\u4EF6\u5417\uFF1F" }, async () => {
|
|
80
|
-
});
|
|
81
|
-
}
|
|
82
75
|
if (file.status === "uploading" || loadingUids.value.has(file.uid)) {
|
|
83
76
|
cancelUpload(file.uid);
|
|
84
77
|
loadingUids.value.delete(file.uid);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"UploadPro.vue2.mjs","sources":["../../../../../../../packages/components/src/business/uploadPro/UploadPro.vue"],"sourcesContent":["<template>\n <div>\n <div\n v-loading=\"uploadLoading\"\n ref=\"pasteFileRef\"\n :class=\"{ 'gm-upload-pro-file-picture-card': listType === 'picture-card', 'gm-upload-pro-file-disabled': disabled }\"\n class=\"gm-upload-pro-file\"\n >\n <el-checkbox-group v-model=\"checkoutFiles\">\n <el-upload\n ref=\"uploadFileRef\"\n v-bind=\"props\"\n v-model:file-list=\"fileList\"\n :before-remove=\"beforeRemove\"\n action=\"\"\n :http-request=\"httpRequest\"\n :on-success=\"coverFileSuccess\"\n :on-error=\"coverFileError\"\n >\n <slot v-if=\"!disabled\">\n <template v-if=\"listType === 'picture-card'\">\n <div\n class=\"gm-flex gm-flex-col gm-items-center gm-justify-center gm-rounded-md gm-border gm-border-dashed gm-p-1\"\n style=\"flex-direction: column\"\n :style=\"{ width: width + 'px', height: height + 'px' }\"\n >\n <el-icon :size=\"30\" color=\"#999\">\n <UploadFilled />\n </el-icon>\n <div class=\"el-upload__text gm-text-center !gm-text-xs gm-text-gray-500\">\n 将文件拖到此处,复制粘贴,或 <em class=\"gm-text-blue-700\">点击上传</em>\n </div>\n </div>\n </template>\n <template v-else>\n <el-button type=\"primary\" size=\"default\">点击上传</el-button>\n </template>\n </slot>\n <template v-if=\"showFileList && listType === 'picture-card'\" #file=\"{ file }\">\n <el-checkbox v-if=\"checkbox && !disabledCheckboxUids.includes(file.uid)\" :value=\"file\" />\n\n <slot name=\"file\" :file=\"file\">\n <div class=\"gm-flex gm-items-center gm-justify-center gm-rounded-md\" :style=\"{ width: width + 'px', height: height + 'px' }\">\n <el-progress\n v-if=\"file.status === 'uploading' || loadingUids.has(file.uid)\"\n :type=\"listType === 'picture-card' ? 'circle' : 'line'\"\n :stroke-width=\"listType === 'picture-card' ? 6 : 2\"\n :percentage=\"Number(file.percentage)\"\n :style=\"\n listType === 'picture-card'\n ? {\n width: width - 20 + 'px',\n height: width - 20 + 'px',\n }\n : 'margin-top: 0.5rem'\n \"\n :width=\"width - 20\"\n />\n\n <GmFileComponent v-else :file=\"file\" :size=\"width - 40\" :controls=\"false\" :show-icon=\"true\" />\n </div>\n <div class=\"el-upload-list__item-actions\">\n <span class=\"el-upload-list__item-preview\" @click=\"handlePreview(file)\">\n <el-icon><View /></el-icon>\n </span>\n <span\n v-if=\"showDelete && !disabledDeleteUids.includes(file.uid)\"\n class=\"el-upload-list__item-delete\"\n @click=\"handleRemove(file, fileList)\"\n >\n <el-icon><Delete /></el-icon>\n </span>\n </div>\n </slot>\n </template>\n <template v-else #file=\"slotValue\">\n <slot name=\"file\" v-bind=\"slotValue\" />\n </template>\n <template v-if=\"slots.trigger\" #trigger>\n <slot name=\"trigger\" />\n </template>\n <template v-if=\"slots.tip\" #tip>\n <div class=\"gm-text-sm\">\n <slot name=\"tip\" />\n </div>\n </template>\n </el-upload>\n </el-checkbox-group>\n\n <GmPreviewFile v-model:dialogVisible=\"dialogVisible\" v-model:file-index=\"fileIndex\" :file-list=\"fileList\" />\n </div>\n </div>\n</template>\n\n<script setup lang=\"ts\">\nimport { ElMessageBox } from 'element-plus';\nimport { computed, ref, useSlots } from 'vue';\n// import { fileValidType } from '@giime/utils/src/file';\n// import { pasteFile } from '@giime/utils/src/pasteFile';\nimport { usePasteFile } from '@giime/hooks/base/usePasteFile';\nimport { GmConfirmBox } from '@giime/components/src/plugins/confirmBox';\nimport { Delete, UploadFilled, View } from '@element-plus/icons-vue';\nimport GmFileComponent from '../../composite/fileComponent';\nimport GmPreviewFile from '../../composite/previewFile';\nimport { GmUploadProUserFile, GmUploadProUserFileResponse, uploadFileProProps } from './uploadPro';\nimport type { UploadInstance, UploadProps } from 'element-plus';\nimport type { UploadFile, UploadFiles, UploadRawFile, UploadUserFile } from '@giime/hooks/base/useUploadFile';\nimport { getGmExports } from '@giime/utils/src/elementPlus/exports';\nimport { useUploadFile } from '@giime/hooks/base/useUploadFile';\n\ndefineOptions({\n name: 'GmUploadPro',\n});\nconst slots = useSlots();\n\nconst props = defineProps(uploadFileProProps);\nconst emit = defineEmits([\"handleRemove\"]);\n\n/** 上传文件 */\nconst fileList = defineModel<UploadUserFile[]>('fileList', { required: true });\n/** 多选数据 */\nconst checkoutFiles = defineModel<any[]>('checkoutFiles', { default: () => [] });\n/**上传功能 */\nconst { uploadFile, cancelUpload } = useUploadFile();\n\nconst loadingUids = ref<Set<number>>(new Set());\nconst uploadLoading = computed(() => props.showLoading && loadingUids.value.size > 0);\n\n/* 上传 */\nconst httpRequest: UploadProps['httpRequest'] = async options => {\n loadingUids.value.add(options.file.uid);\n return uploadFile(options.file, {\n domainCode: props.domainCode,\n sceneCode: props.sceneCode,\n accept: props.accept,\n acl: props.acl,\n elOptions: options,\n });\n};\n\n/**判断是否全部上传完成 并触发事件 */\nconst checkAllUploadComplete = () => {\n if (loadingUids.value.size === 0) {\n // 全部文件上传完成\n props.onAllComplete?.();\n }\n};\n// 上传成功\nconst coverFileSuccess: UploadProps['onSuccess'] = (response: GmUploadProUserFileResponse, uploadFile, uploadFiles) => {\n loadingUids.value.delete(uploadFile.uid);\n uploadFile.url = response.url;\n props.onSuccess?.(response, uploadFile, uploadFiles);\n // 判断是否全部上传完成\n checkAllUploadComplete();\n};\n// 上传失败\nconst coverFileError: UploadProps['onError'] = (error, uploadFile, uploadFiles) => {\n loadingUids.value.delete(uploadFile.uid);\n props.onError?.(error, uploadFile, uploadFiles);\n // 判断是否全部上传完成\n checkAllUploadComplete();\n};\n\n/* 删除文件前 */\nconst beforeRemove: UploadProps['beforeRemove'] = async (file, files) => {\n if (props.disabled) {\n return false;\n }\n if (props.deleteTip) {\n await GmConfirmBox({ message: '确定删除该文件吗?' }, async () => {});\n }\n // 如果文件正在上传,取消上传请求\n if (file.status === 'uploading' || loadingUids.value.has(file.uid)) {\n cancelUpload(file.uid);\n loadingUids.value.delete(file.uid);\n // 判断是否全部上传完成\n checkAllUploadComplete();\n }\n return props.beforeRemove?.(file, files) ?? true;\n};\n\n/* 删除文件 */\nconst removeFile = (file: UploadFile, uploadFiles: UploadFiles) => {\n // 如果文件正在上传,取消上传请求\n if (file.status === 'uploading' || loadingUids.value.has(file.uid)) {\n cancelUpload(file.uid);\n loadingUids.value.delete(file.uid);\n // 判断是否全部上传完成\n checkAllUploadComplete();\n }\n\n const index = fileList.value.indexOf(file);\n if (index > -1) {\n fileList.value.splice(index, 1);\n emit('handleRemove', { file, index });\n return props.onRemove?.(file, uploadFiles);\n }\n};\n/**点击删除图标 */\nconst handleRemove = async (file: UploadFile, uploadFiles: UploadUserFile[]) => {\n if (props.deleteTip) {\n await GmConfirmBox({ message: '确定删除该文件吗?' }, async () => {});\n }\n\n removeFile(file, uploadFiles as UploadFiles);\n};\n\nconst uploadFileRef = ref<UploadInstance>();\nconst exposeEvents = ['abort', 'submit', 'clearFiles', 'handleStart', 'handleRemove'] as const;\nconst { exposeFns } = getGmExports(uploadFileRef, exposeEvents);\n\nconst pasteFileRef = ref<HTMLElement>();\n\n/** 预览 */\nconst dialogVisible = ref(false);\nconst fileIndex = ref(0);\n/**点击预览 */\nconst handlePreview = (file: UploadFile) => {\n fileIndex.value = fileList.value.indexOf(file);\n dialogVisible.value = true;\n};\n\n//** 复制粘贴 */\nconst { onSuccess, onError } = usePasteFile(pasteFileRef, { accept: props.accept, disabled: props.disabled });\nonSuccess((files: File[]) => {\n if (props.disabled) {\n return;\n }\n if (Array.isArray(files) && files.length > 0) {\n files.forEach(file => {\n if (file instanceof File) {\n const rawFile = file as UploadRawFile;\n uploadFileRef.value?.handleStart(rawFile);\n\n // 粘贴成功自动上传\n if (props.autoUpload) {\n uploadFileRef.value?.submit();\n }\n }\n });\n }\n});\n/**粘贴失败 */\nonError((error: Error) => {\n console.error('粘贴错误:', error);\n ElMessageBox.alert(error.message, '提示', {\n type: 'error',\n });\n});\ndefineExpose({\n ...exposeFns,\n uploadFileRef,\n loadingUids,\n});\n</script>\n\n<style scoped lang=\"scss\">\n.gm-upload-pro-preview-dialog {\n :deep(.el-dialog__body) {\n padding: 0;\n }\n}\n.gm-upload-pro-file-picture-card {\n :deep(.el-upload-list__item),\n :deep(.el-upload--picture-card) {\n width: auto;\n height: auto;\n }\n}\n</style>\n<style lang=\"scss\">\n.gm-upload-pro-file {\n line-height: normal;\n .el-checkbox-group {\n font-size: unset;\n }\n .el-checkbox {\n position: absolute;\n left: 10px;\n top: 0;\n z-index: 9;\n }\n .el-upload-list--picture-card {\n gap: 10px;\n }\n .el-upload-list__item {\n margin: 0;\n }\n .el-upload-list__item-file-name {\n line-height: 1.7;\n }\n .el-upload-dragger {\n padding: 0;\n border: none;\n width: 100%;\n height: 100%;\n display: flex;\n }\n .el-upload--picture-card {\n border: none;\n }\n}\n.gm-upload-pro-file-disabled {\n .el-upload--picture-card {\n display: none;\n }\n .el-upload-list__item-status-label {\n display: none;\n }\n}\n</style>\n"],"names":["_useModel","uploadFile"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAiHA,IAAA,MAAM,QAAQ,QAAS,EAAA,CAAA;AAEvB,IAAA,MAAM,KAAQ,GAAA,OAAA,CAAA;AACd,IAAA,MAAM,IAAO,GAAA,MAAA,CAAA;AAGb,IAAM,MAAA,QAAA,GAAWA,QAA6B,CAAA,OAAA,EAAC,UAA8B,CAAA,CAAA;AAE7E,IAAM,MAAA,aAAA,GAAgBA,kBAAmB,eAAsC,CAAA,CAAA;AAE/E,IAAA,MAAM,EAAE,UAAA,EAAY,YAAa,EAAA,GAAI,aAAc,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;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
|
|
1
|
+
{"version":3,"file":"UploadPro.vue2.mjs","sources":["../../../../../../../packages/components/src/business/uploadPro/UploadPro.vue"],"sourcesContent":["<template>\n <div>\n <div\n v-loading=\"uploadLoading\"\n ref=\"pasteFileRef\"\n :class=\"{ 'gm-upload-pro-file-picture-card': listType === 'picture-card', 'gm-upload-pro-file-disabled': disabled }\"\n class=\"gm-upload-pro-file\"\n >\n <el-checkbox-group v-model=\"checkoutFiles\">\n <el-upload\n ref=\"uploadFileRef\"\n v-bind=\"props\"\n v-model:file-list=\"fileList\"\n :before-remove=\"beforeRemove\"\n action=\"\"\n :http-request=\"httpRequest\"\n :on-success=\"coverFileSuccess\"\n :on-error=\"coverFileError\"\n >\n <slot v-if=\"!disabled\">\n <template v-if=\"listType === 'picture-card'\">\n <div\n class=\"gm-flex gm-flex-col gm-items-center gm-justify-center gm-rounded-md gm-border gm-border-dashed gm-p-1\"\n style=\"flex-direction: column\"\n :style=\"{ width: width + 'px', height: height + 'px' }\"\n >\n <el-icon :size=\"30\" color=\"#999\">\n <UploadFilled />\n </el-icon>\n <div class=\"el-upload__text gm-text-center !gm-text-xs gm-text-gray-500\">\n 将文件拖到此处,复制粘贴,或 <em class=\"gm-text-blue-700\">点击上传</em>\n </div>\n </div>\n </template>\n <template v-else>\n <el-button type=\"primary\" size=\"default\">点击上传</el-button>\n </template>\n </slot>\n <template v-if=\"showFileList && listType === 'picture-card'\" #file=\"{ file }\">\n <el-checkbox v-if=\"checkbox && !disabledCheckboxUids.includes(file.uid)\" :value=\"file\" />\n\n <slot name=\"file\" :file=\"file\">\n <div class=\"gm-flex gm-items-center gm-justify-center gm-rounded-md\" :style=\"{ width: width + 'px', height: height + 'px' }\">\n <el-progress\n v-if=\"file.status === 'uploading' || loadingUids.has(file.uid)\"\n :type=\"listType === 'picture-card' ? 'circle' : 'line'\"\n :stroke-width=\"listType === 'picture-card' ? 6 : 2\"\n :percentage=\"Number(file.percentage)\"\n :style=\"\n listType === 'picture-card'\n ? {\n width: width - 20 + 'px',\n height: width - 20 + 'px',\n }\n : 'margin-top: 0.5rem'\n \"\n :width=\"width - 20\"\n />\n\n <GmFileComponent v-else :file=\"file\" :size=\"width - 40\" :controls=\"false\" :show-icon=\"true\" />\n </div>\n <div class=\"el-upload-list__item-actions\">\n <span class=\"el-upload-list__item-preview\" @click=\"handlePreview(file)\">\n <el-icon><View /></el-icon>\n </span>\n <span\n v-if=\"showDelete && !disabledDeleteUids.includes(file.uid)\"\n class=\"el-upload-list__item-delete\"\n @click=\"handleRemove(file, fileList)\"\n >\n <el-icon><Delete /></el-icon>\n </span>\n </div>\n </slot>\n </template>\n <template v-else #file=\"slotValue\">\n <slot name=\"file\" v-bind=\"slotValue\" />\n </template>\n <template v-if=\"slots.trigger\" #trigger>\n <slot name=\"trigger\" />\n </template>\n <template v-if=\"slots.tip\" #tip>\n <div class=\"gm-text-sm\">\n <slot name=\"tip\" />\n </div>\n </template>\n </el-upload>\n </el-checkbox-group>\n\n <GmPreviewFile v-model:dialogVisible=\"dialogVisible\" v-model:file-index=\"fileIndex\" :file-list=\"fileList\" />\n </div>\n </div>\n</template>\n\n<script setup lang=\"ts\">\nimport { ElMessageBox } from 'element-plus';\nimport { computed, ref, useSlots } from 'vue';\n// import { fileValidType } from '@giime/utils/src/file';\n// import { pasteFile } from '@giime/utils/src/pasteFile';\nimport { usePasteFile } from '@giime/hooks/base/usePasteFile';\nimport { GmConfirmBox } from '@giime/components/src/plugins/confirmBox';\nimport { Delete, UploadFilled, View } from '@element-plus/icons-vue';\nimport GmFileComponent from '../../composite/fileComponent';\nimport GmPreviewFile from '../../composite/previewFile';\nimport { GmUploadProUserFile, GmUploadProUserFileResponse, uploadFileProProps } from './uploadPro';\nimport type { UploadInstance, UploadProps } from 'element-plus';\nimport type { UploadFile, UploadFiles, UploadRawFile, UploadUserFile } from '@giime/hooks/base/useUploadFile';\nimport { getGmExports } from '@giime/utils/src/elementPlus/exports';\nimport { useUploadFile } from '@giime/hooks/base/useUploadFile';\n\ndefineOptions({\n name: 'GmUploadPro',\n});\nconst slots = useSlots();\n\nconst props = defineProps(uploadFileProProps);\nconst emit = defineEmits([\"handleRemove\"]);\n\n/** 上传文件 */\nconst fileList = defineModel<UploadUserFile[]>('fileList', { required: true });\n/** 多选数据 */\nconst checkoutFiles = defineModel<any[]>('checkoutFiles', { default: () => [] });\n/**上传功能 */\nconst { uploadFile, cancelUpload } = useUploadFile();\n\nconst loadingUids = ref<Set<number>>(new Set());\nconst uploadLoading = computed(() => props.showLoading && loadingUids.value.size > 0);\n\n/* 上传 */\nconst httpRequest: UploadProps['httpRequest'] = async options => {\n loadingUids.value.add(options.file.uid);\n return uploadFile(options.file, {\n domainCode: props.domainCode,\n sceneCode: props.sceneCode,\n accept: props.accept,\n acl: props.acl,\n elOptions: options,\n });\n};\n\n/**判断是否全部上传完成 并触发事件 */\nconst checkAllUploadComplete = () => {\n if (loadingUids.value.size === 0) {\n // 全部文件上传完成\n props.onAllComplete?.();\n }\n};\n// 上传成功\nconst coverFileSuccess: UploadProps['onSuccess'] = (response: GmUploadProUserFileResponse, uploadFile, uploadFiles) => {\n loadingUids.value.delete(uploadFile.uid);\n uploadFile.url = response.url;\n props.onSuccess?.(response, uploadFile, uploadFiles);\n // 判断是否全部上传完成\n checkAllUploadComplete();\n};\n// 上传失败\nconst coverFileError: UploadProps['onError'] = (error, uploadFile, uploadFiles) => {\n loadingUids.value.delete(uploadFile.uid);\n props.onError?.(error, uploadFile, uploadFiles);\n // 判断是否全部上传完成\n checkAllUploadComplete();\n};\n\n/* 删除文件前 */\nconst beforeRemove: UploadProps['beforeRemove'] = async (file, files) => {\n // 如果文件正在上传,取消上传请求\n if (file.status === 'uploading' || loadingUids.value.has(file.uid)) {\n cancelUpload(file.uid);\n loadingUids.value.delete(file.uid);\n // 判断是否全部上传完成\n checkAllUploadComplete();\n }\n return props.beforeRemove?.(file, files) ?? true;\n};\n\n/* 删除文件 */\nconst removeFile = (file: UploadFile, uploadFiles: UploadFiles) => {\n // 如果文件正在上传,取消上传请求\n if (file.status === 'uploading' || loadingUids.value.has(file.uid)) {\n cancelUpload(file.uid);\n loadingUids.value.delete(file.uid);\n // 判断是否全部上传完成\n checkAllUploadComplete();\n }\n\n const index = fileList.value.indexOf(file);\n if (index > -1) {\n fileList.value.splice(index, 1);\n emit('handleRemove', { file, index });\n return props.onRemove?.(file, uploadFiles);\n }\n};\n/**点击删除图标 */\nconst handleRemove = async (file: UploadFile, uploadFiles: UploadUserFile[]) => {\n if (props.deleteTip) {\n await GmConfirmBox({ message: '确定删除该文件吗?' }, async () => {});\n }\n\n removeFile(file, uploadFiles as UploadFiles);\n};\n\nconst uploadFileRef = ref<UploadInstance>();\nconst exposeEvents = ['abort', 'submit', 'clearFiles', 'handleStart', 'handleRemove'] as const;\nconst { exposeFns } = getGmExports(uploadFileRef, exposeEvents);\n\nconst pasteFileRef = ref<HTMLElement>();\n\n/** 预览 */\nconst dialogVisible = ref(false);\nconst fileIndex = ref(0);\n/**点击预览 */\nconst handlePreview = (file: UploadFile) => {\n fileIndex.value = fileList.value.indexOf(file);\n dialogVisible.value = true;\n};\n\n//** 复制粘贴 */\nconst { onSuccess, onError } = usePasteFile(pasteFileRef, { accept: props.accept, disabled: props.disabled });\nonSuccess((files: File[]) => {\n if (props.disabled) {\n return;\n }\n if (Array.isArray(files) && files.length > 0) {\n files.forEach(file => {\n if (file instanceof File) {\n const rawFile = file as UploadRawFile;\n uploadFileRef.value?.handleStart(rawFile);\n\n // 粘贴成功自动上传\n if (props.autoUpload) {\n uploadFileRef.value?.submit();\n }\n }\n });\n }\n});\n/**粘贴失败 */\nonError((error: Error) => {\n console.error('粘贴错误:', error);\n ElMessageBox.alert(error.message, '提示', {\n type: 'error',\n });\n});\ndefineExpose({\n ...exposeFns,\n uploadFileRef,\n loadingUids,\n});\n</script>\n\n<style scoped lang=\"scss\">\n.gm-upload-pro-preview-dialog {\n :deep(.el-dialog__body) {\n padding: 0;\n }\n}\n.gm-upload-pro-file-picture-card {\n :deep(.el-upload-list__item),\n :deep(.el-upload--picture-card) {\n width: auto;\n height: auto;\n }\n}\n</style>\n<style lang=\"scss\">\n.gm-upload-pro-file {\n line-height: normal;\n .el-checkbox-group {\n font-size: unset;\n }\n .el-checkbox {\n position: absolute;\n left: 10px;\n top: 0;\n z-index: 9;\n }\n .el-upload-list--picture-card {\n gap: 10px;\n }\n .el-upload-list__item {\n margin: 0;\n }\n .el-upload-list__item-file-name {\n line-height: 1.7;\n }\n .el-upload-dragger {\n padding: 0;\n border: none;\n width: 100%;\n height: 100%;\n display: flex;\n }\n .el-upload--picture-card {\n border: none;\n }\n}\n.gm-upload-pro-file-disabled {\n .el-upload--picture-card {\n display: none;\n }\n .el-upload-list__item-status-label {\n display: none;\n }\n}\n</style>\n"],"names":["_useModel","uploadFile"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAiHA,IAAA,MAAM,QAAQ,QAAS,EAAA,CAAA;AAEvB,IAAA,MAAM,KAAQ,GAAA,OAAA,CAAA;AACd,IAAA,MAAM,IAAO,GAAA,MAAA,CAAA;AAGb,IAAM,MAAA,QAAA,GAAWA,QAA6B,CAAA,OAAA,EAAC,UAA8B,CAAA,CAAA;AAE7E,IAAM,MAAA,aAAA,GAAgBA,kBAAmB,eAAsC,CAAA,CAAA;AAE/E,IAAA,MAAM,EAAE,UAAA,EAAY,YAAa,EAAA,GAAI,aAAc,EAAA,CAAA;AAEnD,IAAA,MAAM,WAAc,GAAA,GAAA,iBAAqB,IAAA,GAAA,EAAK,CAAA,CAAA;AAC9C,IAAM,MAAA,aAAA,GAAgB,SAAS,MAAM,KAAA,CAAM,eAAe,WAAY,CAAA,KAAA,CAAM,OAAO,CAAC,CAAA,CAAA;AAGpF,IAAM,MAAA,WAAA,GAA0C,OAAM,OAAW,KAAA;AAC/D,MAAA,WAAA,CAAY,KAAM,CAAA,GAAA,C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AO,YAAY,OAAO,CAAA,CAAA;AAGxC,YAAA,IAAI,MAAM,UAAY,EAAA;AACpB,cAAA,aAAA,CAAc,OAAO,MAAO,EAAA,CAAA;AAAA,aAC9B;AAAA,WACF;AAAA,SACD,CAAA,CAAA;AAAA,OACH;AAAA,KACD,CAAA,CAAA;AAED,IAAA,OAAA,CAAQ,CAAC,KAAiB,KAAA;AACxB,MAAQ,OAAA,CAAA,KAAA,CAAM,6BAAS,KAAK,CAAA,CAAA;AAC5B,MAAa,YAAA,CAAA,KAAA,CAAM,KAAM,CAAA,OAAA,EAAS,cAAM,EAAA;AAAA,QACtC,IAAM,EAAA,OAAA;AAAA,OACP,CAAA,CAAA;AAAA,KACF,CAAA,CAAA;AACD,IAAa,QAAA,CAAA;AAAA,MACX,GAAG,SAAA;AAAA,MACH,aAAA;AAAA,MACA,WAAA;AAAA,KACD,CAAA,CAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
|
|
@@ -13,7 +13,7 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
13
13
|
default: number;
|
|
14
14
|
};
|
|
15
15
|
field: {
|
|
16
|
-
type:
|
|
16
|
+
type: StringConstructor;
|
|
17
17
|
default: string;
|
|
18
18
|
};
|
|
19
19
|
controls: {
|
|
@@ -46,7 +46,7 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
46
46
|
default: number;
|
|
47
47
|
};
|
|
48
48
|
field: {
|
|
49
|
-
type:
|
|
49
|
+
type: StringConstructor;
|
|
50
50
|
default: string;
|
|
51
51
|
};
|
|
52
52
|
controls: {
|
|
@@ -71,7 +71,7 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
71
71
|
file: Partial<UploadFile>;
|
|
72
72
|
showIcon: boolean;
|
|
73
73
|
controls: boolean;
|
|
74
|
-
field:
|
|
74
|
+
field: string;
|
|
75
75
|
controlslist: string;
|
|
76
76
|
oncontextmenu: boolean;
|
|
77
77
|
}, {}>;
|
|
@@ -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
|
|
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":"AAMO,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;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,OAAA;AAAA,IACN,OAAS,EAAA,IAAA;AAAA,GACX;AAAA;AAAA,EAEA,YAAc,EAAA;AAAA,IACZ,IAAM,EAAA,MAAA;AAAA,IACN,OAAS,EAAA,EAAA;AAAA,GACX;AAAA;AAAA,EAEA,aAAe,EAAA;AAAA,IACb,IAAM,EAAA,OAAA;AAAA,IACN,OAAS,EAAA,IAAA;AAAA,GACX;AAAA;AAAA,EAEA,QAAU,EAAA;AAAA,IACR,IAAM,EAAA,OAAA;AAAA,IACN,OAAS,EAAA,KAAA;AAAA,GACX;AACF;;;;"}
|
|
@@ -13,7 +13,7 @@ export declare const GmFileComponent: import("../../../../utils").SFCWithInstall
|
|
|
13
13
|
default: number;
|
|
14
14
|
};
|
|
15
15
|
field: {
|
|
16
|
-
type:
|
|
16
|
+
type: StringConstructor;
|
|
17
17
|
default: string;
|
|
18
18
|
};
|
|
19
19
|
controls: {
|
|
@@ -46,7 +46,7 @@ export declare const GmFileComponent: import("../../../../utils").SFCWithInstall
|
|
|
46
46
|
default: number;
|
|
47
47
|
};
|
|
48
48
|
field: {
|
|
49
|
-
type:
|
|
49
|
+
type: StringConstructor;
|
|
50
50
|
default: string;
|
|
51
51
|
};
|
|
52
52
|
controls: {
|
|
@@ -71,7 +71,7 @@ export declare const GmFileComponent: import("../../../../utils").SFCWithInstall
|
|
|
71
71
|
file: Partial<import("element-plus").UploadFile>;
|
|
72
72
|
showIcon: boolean;
|
|
73
73
|
controls: boolean;
|
|
74
|
-
field:
|
|
74
|
+
field: string;
|
|
75
75
|
controlslist: string;
|
|
76
76
|
oncontextmenu: boolean;
|
|
77
77
|
}, {}>> & Record<string, any>;
|
|
@@ -0,0 +1,95 @@
|
|
|
1
|
+
declare const _default: import("vue").DefineComponent<{
|
|
2
|
+
fileList: {
|
|
3
|
+
type: import("vue").PropType<Partial<import("element-plus").UploadFile>[]>;
|
|
4
|
+
default: () => never[];
|
|
5
|
+
};
|
|
6
|
+
controlslist: {
|
|
7
|
+
type: StringConstructor;
|
|
8
|
+
default: string;
|
|
9
|
+
};
|
|
10
|
+
oncontextmenu: {
|
|
11
|
+
type: BooleanConstructor;
|
|
12
|
+
default: boolean;
|
|
13
|
+
};
|
|
14
|
+
width: {
|
|
15
|
+
type: StringConstructor;
|
|
16
|
+
default: string;
|
|
17
|
+
};
|
|
18
|
+
file: {
|
|
19
|
+
type: import("vue").PropType<Partial<import("element-plus").UploadFile>>;
|
|
20
|
+
default: () => {};
|
|
21
|
+
};
|
|
22
|
+
url: {
|
|
23
|
+
type: StringConstructor;
|
|
24
|
+
default: string;
|
|
25
|
+
};
|
|
26
|
+
size: {
|
|
27
|
+
type: NumberConstructor;
|
|
28
|
+
default: number;
|
|
29
|
+
};
|
|
30
|
+
field: {
|
|
31
|
+
type: StringConstructor;
|
|
32
|
+
default: string;
|
|
33
|
+
};
|
|
34
|
+
controls: {
|
|
35
|
+
type: BooleanConstructor;
|
|
36
|
+
default: boolean;
|
|
37
|
+
};
|
|
38
|
+
showIcon: {
|
|
39
|
+
type: BooleanConstructor;
|
|
40
|
+
default: boolean;
|
|
41
|
+
};
|
|
42
|
+
}, {}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<{
|
|
43
|
+
fileList: {
|
|
44
|
+
type: import("vue").PropType<Partial<import("element-plus").UploadFile>[]>;
|
|
45
|
+
default: () => never[];
|
|
46
|
+
};
|
|
47
|
+
controlslist: {
|
|
48
|
+
type: StringConstructor;
|
|
49
|
+
default: string;
|
|
50
|
+
};
|
|
51
|
+
oncontextmenu: {
|
|
52
|
+
type: BooleanConstructor;
|
|
53
|
+
default: boolean;
|
|
54
|
+
};
|
|
55
|
+
width: {
|
|
56
|
+
type: StringConstructor;
|
|
57
|
+
default: string;
|
|
58
|
+
};
|
|
59
|
+
file: {
|
|
60
|
+
type: import("vue").PropType<Partial<import("element-plus").UploadFile>>;
|
|
61
|
+
default: () => {};
|
|
62
|
+
};
|
|
63
|
+
url: {
|
|
64
|
+
type: StringConstructor;
|
|
65
|
+
default: string;
|
|
66
|
+
};
|
|
67
|
+
size: {
|
|
68
|
+
type: NumberConstructor;
|
|
69
|
+
default: number;
|
|
70
|
+
};
|
|
71
|
+
field: {
|
|
72
|
+
type: StringConstructor;
|
|
73
|
+
default: string;
|
|
74
|
+
};
|
|
75
|
+
controls: {
|
|
76
|
+
type: BooleanConstructor;
|
|
77
|
+
default: boolean;
|
|
78
|
+
};
|
|
79
|
+
showIcon: {
|
|
80
|
+
type: BooleanConstructor;
|
|
81
|
+
default: boolean;
|
|
82
|
+
};
|
|
83
|
+
}>>, {
|
|
84
|
+
size: number;
|
|
85
|
+
url: string;
|
|
86
|
+
width: string;
|
|
87
|
+
file: Partial<import("element-plus").UploadFile>;
|
|
88
|
+
showIcon: boolean;
|
|
89
|
+
controls: boolean;
|
|
90
|
+
fileList: Partial<import("element-plus").UploadFile>[];
|
|
91
|
+
field: string;
|
|
92
|
+
controlslist: string;
|
|
93
|
+
oncontextmenu: boolean;
|
|
94
|
+
}, {}>;
|
|
95
|
+
export default _default;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"FileList.vue.mjs","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;"}
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
import { defineComponent, ref, openBlock, createElementBlock, Fragment, createElementVNode, renderList, createVNode, unref, mergeProps } from 'vue';
|
|
2
|
+
import { GmFileComponent } from '../fileComponent/index.mjs';
|
|
3
|
+
import { GmPreviewFile } from '../previewFile/index.mjs';
|
|
4
|
+
import { fileProProps } from './fileList.mjs';
|
|
5
|
+
|
|
6
|
+
const _hoisted_1 = { class: "gm-flex gm-items-center gm-gap-4" };
|
|
7
|
+
const _hoisted_2 = ["onClick"];
|
|
8
|
+
var _sfc_main = /* @__PURE__ */ defineComponent({
|
|
9
|
+
...{
|
|
10
|
+
name: "GmFileList"
|
|
11
|
+
},
|
|
12
|
+
__name: "FileList",
|
|
13
|
+
props: fileProProps,
|
|
14
|
+
setup(__props) {
|
|
15
|
+
const props = __props;
|
|
16
|
+
const dialog = ref(false);
|
|
17
|
+
const fileIndex = ref(0);
|
|
18
|
+
const handlePreview = (index) => {
|
|
19
|
+
fileIndex.value = index;
|
|
20
|
+
dialog.value = true;
|
|
21
|
+
};
|
|
22
|
+
return (_ctx, _cache) => {
|
|
23
|
+
return openBlock(), createElementBlock(
|
|
24
|
+
Fragment,
|
|
25
|
+
null,
|
|
26
|
+
[
|
|
27
|
+
createElementVNode("div", _hoisted_1, [
|
|
28
|
+
(openBlock(true), createElementBlock(
|
|
29
|
+
Fragment,
|
|
30
|
+
null,
|
|
31
|
+
renderList(_ctx.fileList, (file, index) => {
|
|
32
|
+
return openBlock(), createElementBlock("div", {
|
|
33
|
+
key: index,
|
|
34
|
+
class: "gm-relative gm-flex gm-h-32 gm-w-32 gm-cursor-pointer gm-items-center gm-justify-center gm-overflow-hidden gm-rounded gm-border",
|
|
35
|
+
onClick: ($event) => handlePreview(index)
|
|
36
|
+
}, [
|
|
37
|
+
createVNode(unref(GmFileComponent), mergeProps(props, {
|
|
38
|
+
file,
|
|
39
|
+
controls: false
|
|
40
|
+
}), null, 16, ["file"])
|
|
41
|
+
], 8, _hoisted_2);
|
|
42
|
+
}),
|
|
43
|
+
128
|
|
44
|
+
/* KEYED_FRAGMENT */
|
|
45
|
+
))
|
|
46
|
+
]),
|
|
47
|
+
createVNode(unref(GmPreviewFile), mergeProps(props, {
|
|
48
|
+
dialogVisible: dialog.value,
|
|
49
|
+
"onUpdate:dialogVisible": _cache[0] || (_cache[0] = ($event) => dialog.value = $event),
|
|
50
|
+
"file-index": fileIndex.value,
|
|
51
|
+
"onUpdate:fileIndex": _cache[1] || (_cache[1] = ($event) => fileIndex.value = $event)
|
|
52
|
+
}), null, 16, ["dialogVisible", "file-index"])
|
|
53
|
+
],
|
|
54
|
+
64
|
|
55
|
+
/* STABLE_FRAGMENT */
|
|
56
|
+
);
|
|
57
|
+
};
|
|
58
|
+
}
|
|
59
|
+
});
|
|
60
|
+
|
|
61
|
+
export { _sfc_main as default };
|
|
62
|
+
//# sourceMappingURL=FileList.vue2.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"FileList.vue2.mjs","sources":["../../../../../../../packages/components/src/composite/fileList2/FileList.vue"],"sourcesContent":["<template>\n <div class=\"gm-flex gm-items-center gm-gap-4\">\n <div\n v-for=\"(file, index) in fileList\"\n :key=\"index\"\n class=\"gm-relative gm-flex gm-h-32 gm-w-32 gm-cursor-pointer gm-items-center gm-justify-center gm-overflow-hidden gm-rounded gm-border\"\n @click=\"handlePreview(index)\"\n >\n <GmFileComponent v-bind=\"props\" :file :controls=\"false\" />\n </div>\n </div>\n\n <GmPreviewFile v-bind=\"props\" v-model:dialogVisible=\"dialog\" v-model:file-index=\"fileIndex\" />\n</template>\n\n<script setup lang=\"ts\">\nimport { ref } from 'vue';\nimport GmFileComponent from '../fileComponent';\nimport GmPreviewFile from '../previewFile';\nimport { fileProProps } from './fileList';\n\ndefineOptions({\n name: 'GmFileList',\n});\n\nconst props = defineProps(fileProProps);\n\nconst dialog = ref(false);\nconst fileIndex = ref(0);\nconst handlePreview = (index: number) => {\n fileIndex.value = index;\n dialog.value = true;\n};\n</script>\n"],"names":[],"mappings":";;;;;;;;;;;;;;AAyBA,IAAA,MAAM,KAAQ,GAAA,OAAA,CAAA;AAEd,IAAM,MAAA,MAAA,GAAS,IAAI,KAAK,CAAA,CAAA;AACxB,IAAM,MAAA,SAAA,GAAY,IAAI,CAAC,CAAA,CAAA;AACvB,IAAM,MAAA,aAAA,GAAgB,CAAC,KAAkB,KAAA;AACvC,MAAA,SAAA,CAAU,KAAQ,GAAA,KAAA,CAAA;AAClB,MAAA,MAAA,CAAO,KAAQ,GAAA,IAAA,CAAA;AAAA,KACjB,CAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
|