@gct-paas/core-web 0.1.4-dev.12 → 0.1.4-dev.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/de_DE-Dlmr1Wso.js +152 -0
- package/dist/en_US-B9GNh9s3.js +173 -0
- package/dist/es_ES-CdOh6_BZ.js +159 -0
- package/dist/fr_FR-DA5AJaJ_.js +168 -0
- package/dist/index.min.css +1 -1
- package/dist/ja_JP-DE6fp7p7.js +140 -0
- package/dist/loader.esm.min.js +9583 -0
- package/dist/{monaco-editor-BHuf3IVH.js → monaco-editor-Di2Ob0f2.js} +37 -38
- package/dist/objectSpread2-fLnUNEWu.js +62 -0
- package/dist/pt_PT-DqWIQ8Sv.js +134 -0
- package/dist/ru_RU-B7eejpuq.js +165 -0
- package/dist/tr_TR-Cp-TWGG5.js +167 -0
- package/dist/{useMonacoEditor-CfhCBaPa.js → useMonacoEditor-B4gp3RiK.js} +753 -817
- package/dist/vi_VN-BWekEft9.js +85 -0
- package/dist/zh_CN-CaadhslE.js +174 -0
- package/dist/zh_TW-DHMPuQGm.js +169 -0
- package/es/components/field-upload/index.d.ts +2 -0
- package/es/components/field-upload/index.mjs +7 -0
- package/es/components/field-upload/src/FieldUpload.vue.d.ts +37 -0
- package/es/components/field-upload/src/FieldUpload.vue.mjs +5 -0
- package/es/components/field-upload/src/FieldUpload.vue_vue_type_script_setup_true_name_FieldUpload_lang.mjs +111 -0
- package/es/components/field-upload/src/components/base-upload.vue.d.ts +21 -0
- package/es/components/field-upload/src/components/base-upload.vue.mjs +7 -0
- package/es/components/field-upload/src/components/base-upload.vue_vue_type_script_name_baseUpload_setup_true_lang.mjs +227 -0
- package/es/components/field-upload/src/components/base-upload.vue_vue_type_style_index_0_scoped_f53b6ac6_lang.css +76 -0
- package/es/components/field-upload/src/components/file-list.vue.d.ts +17 -0
- package/es/components/field-upload/src/components/file-list.vue.mjs +7 -0
- package/es/components/field-upload/src/components/file-list.vue_vue_type_script_setup_true_name_fileList_lang.mjs +129 -0
- package/es/components/field-upload/src/components/file-list.vue_vue_type_style_index_0_scoped_3918aad0_lang.css +129 -0
- package/es/components/field-upload/src/components/upload-design.vue.d.ts +5 -0
- package/es/components/field-upload/src/components/upload-design.vue.mjs +7 -0
- package/es/components/field-upload/src/components/upload-design.vue_vue_type_script_name_UploadDesign_setup_true_lang.mjs +43 -0
- package/es/components/field-upload/src/components/upload-design.vue_vue_type_style_index_0_scoped_1e5189c1_lang.css +43 -0
- package/es/components/field-upload/src/hooks/hooks.d.ts +4 -0
- package/es/components/field-upload/src/hooks/hooks.mjs +47 -0
- package/es/components/field-upload/src/types/index.d.ts +42 -0
- package/es/components/field-upload/src/types/index.mjs +24 -0
- package/es/components/image-upload/index.d.ts +2 -0
- package/es/components/image-upload/index.mjs +7 -0
- package/es/components/image-upload/src/ImageUpload.vue.d.ts +32 -0
- package/es/components/image-upload/src/ImageUpload.vue.mjs +5 -0
- package/es/components/image-upload/src/ImageUpload.vue_vue_type_script_setup_true_name_ImageUpload_lang.mjs +74 -0
- package/es/components/image-upload/src/components/base-upload.vue.d.ts +24 -0
- package/es/components/image-upload/src/components/base-upload.vue.mjs +8 -0
- package/es/components/image-upload/src/components/base-upload.vue_vue_type_script_name_baseUpload_setup_true_lang.mjs +209 -0
- package/es/components/image-upload/src/components/base-upload.vue_vue_type_style_index_0_scoped_3248e630_lang.css +73 -0
- package/es/components/image-upload/src/components/base-upload.vue_vue_type_style_index_1_lang.css +3 -0
- package/es/components/image-upload/src/components/upload-design.vue.d.ts +6 -0
- package/es/components/image-upload/src/components/upload-design.vue.mjs +7 -0
- package/es/components/image-upload/src/components/upload-design.vue_vue_type_script_name_UploadDesign_setup_true_lang.mjs +33 -0
- package/es/components/image-upload/src/components/upload-design.vue_vue_type_style_index_0_scoped_575d3a1a_lang.css +33 -0
- package/es/components/image-upload/src/hooks/hooks.d.ts +2 -0
- package/es/components/image-upload/src/types/index.d.ts +34 -0
- package/es/components/image-upload/src/types/index.mjs +8 -0
- package/es/components/index.d.ts +3 -1
- package/es/components/index.mjs +2 -0
- package/es/hooks/useLocale.d.ts +365 -1
- package/es/hooks/useLocale.mjs +20 -24
- package/es/index.d.ts +1 -0
- package/es/index.mjs +10 -6
- package/es/loader.d.ts +1 -0
- package/es/modules/Cropper/hooks/useFile.mjs +21 -0
- package/es/modules/Cropper/index.d.ts +1 -0
- package/es/modules/Cropper/index.mjs +12 -0
- package/es/modules/Cropper/src/CopperFreeModal.vue.mjs +7 -0
- package/es/modules/Cropper/src/CopperFreeModal.vue_vue_type_script_setup_true_name_CropperModal_lang.mjs +299 -0
- package/es/modules/Cropper/src/CopperFreeModal.vue_vue_type_style_index_0_scoped_28afc2ab_lang.css +48 -0
- package/es/modules/Cropper/src/CopperModal.vue.mjs +7 -0
- package/es/modules/Cropper/src/CopperModal.vue_vue_type_script_setup_true_name_CropperModal_lang.mjs +283 -0
- package/es/modules/Cropper/src/CopperModal.vue_vue_type_style_index_0_scoped_f42f8311_lang.css +71 -0
- package/es/modules/Cropper/src/Cropper.vue.d.ts +1 -1
- package/es/modules/Cropper/src/Cropper.vue.mjs +25 -0
- package/es/modules/Cropper/src/Cropper.vue_vue_type_script_lang.mjs +173 -0
- package/es/modules/Cropper/src/Cropper.vue_vue_type_style_index_0_lang.css +4 -0
- package/es/modules/Cropper/src/CropperAvatar.vue.mjs +7 -0
- package/es/modules/Cropper/src/CropperAvatar.vue_vue_type_script_setup_true_name_CropperAvatar_lang.mjs +116 -0
- package/es/modules/Cropper/src/CropperAvatar.vue_vue_type_style_index_0_scoped_b5d65cd4_lang.css +39 -0
- package/es/modules/Cropper/src/CropperFree.vue.mjs +7 -0
- package/es/modules/Cropper/src/CropperFree.vue_vue_type_script_setup_true_name_CropperPhoto_lang.mjs +165 -0
- package/es/modules/Cropper/src/CropperFree.vue_vue_type_style_index_0_scoped_3cc5e19b_lang.css +83 -0
- package/es/modules/code-editor/index.d.ts +3 -3
- package/es/modules/code-editor/monaco-editor.vue.d.ts +1 -1
- package/es/modules/code-editor/monaco-editor.vue.mjs +2 -2
- package/es/modules/code-editor/monaco-editor.vue_vue_type_script_setup_true_name_code-editor_lang.mjs +4 -3
- package/es/modules/code-editor/{monaco-editor.vue_vue_type_style_index_0_scoped_254c9227_lang.css → monaco-editor.vue_vue_type_style_index_0_scoped_ccf22884_lang.css} +9 -9
- package/es/modules/gct-table/editor/gct-table-date/gct-table-date.mjs +1 -1
- package/es/modules/gct-table/editor/gct-table-text/gct-table-text.mjs +1 -1
- package/package.json +7 -7
- package/dist/index.esm.min.js +0 -9864
- /package/es/modules/gct-table/editor/{gct-table-text/gct-table-text.css → gct-table-date/gct-table-date.css} +0 -0
|
@@ -0,0 +1,227 @@
|
|
|
1
|
+
import svg_icon_default from "../../../svg-icon/svg-icon.vue.mjs";
|
|
2
|
+
import { statusEnum } from "../types/index.mjs";
|
|
3
|
+
import { getFileSize, sizeParser, typeParser } from "../hooks/hooks.mjs";
|
|
4
|
+
import { Fragment, computed, createBlock, createCommentVNode, createElementBlock, createElementVNode, createTextVNode, createVNode, defineComponent, nextTick, normalizeClass, openBlock, ref, renderList, resolveComponent, toDisplayString, unref, vShow, watch, withCtx, withDirectives, withModifiers } from "vue";
|
|
5
|
+
import { cloneDeep } from "lodash-es";
|
|
6
|
+
import { Uploader, downloadByUrl, t, uuid2 } from "@gct-paas/core";
|
|
7
|
+
import { message } from "ant-design-vue";
|
|
8
|
+
//#region src/components/field-upload/src/components/base-upload.vue?vue&type=script&name=baseUpload&setup=true&lang.ts
|
|
9
|
+
var _hoisted_1 = { class: "progress-box" };
|
|
10
|
+
var _hoisted_2 = { class: "progress-item__box pl-10px" };
|
|
11
|
+
var _hoisted_3 = { class: "progress-item__name" };
|
|
12
|
+
var _hoisted_4 = ["onClick"];
|
|
13
|
+
var _hoisted_5 = {
|
|
14
|
+
key: 0,
|
|
15
|
+
class: "error",
|
|
16
|
+
style: { "color": "red" }
|
|
17
|
+
};
|
|
18
|
+
var _hoisted_6 = {
|
|
19
|
+
key: 1,
|
|
20
|
+
style: { "color": "var(--ant-primary-color)" }
|
|
21
|
+
};
|
|
22
|
+
var base_upload_vue_vue_type_script_name_baseUpload_setup_true_lang_default = /* @__PURE__ */ defineComponent({
|
|
23
|
+
__name: "base-upload",
|
|
24
|
+
props: {
|
|
25
|
+
modelKey: {},
|
|
26
|
+
modelValue: {},
|
|
27
|
+
readonly: { type: Boolean },
|
|
28
|
+
disabled: { type: Boolean },
|
|
29
|
+
maxCount: {},
|
|
30
|
+
maxSize: {},
|
|
31
|
+
accept: {},
|
|
32
|
+
isTable: { type: Boolean },
|
|
33
|
+
beforeUpload: { type: Function }
|
|
34
|
+
},
|
|
35
|
+
emits: [
|
|
36
|
+
"update:modelValue",
|
|
37
|
+
"onBeforeUpload",
|
|
38
|
+
"saveTableRow"
|
|
39
|
+
],
|
|
40
|
+
setup(__props, { emit: __emit }) {
|
|
41
|
+
const fileLen = ref(0);
|
|
42
|
+
const fileList = ref([]);
|
|
43
|
+
const emit = __emit;
|
|
44
|
+
const props = __props;
|
|
45
|
+
const fileTypeParser = computed(() => {
|
|
46
|
+
return (fileName) => {
|
|
47
|
+
return typeParser(fileName);
|
|
48
|
+
};
|
|
49
|
+
});
|
|
50
|
+
const value = computed({
|
|
51
|
+
get() {
|
|
52
|
+
try {
|
|
53
|
+
return props.modelValue ? props.modelValue.split(",") : [];
|
|
54
|
+
} catch (error) {
|
|
55
|
+
return [];
|
|
56
|
+
}
|
|
57
|
+
},
|
|
58
|
+
set(value) {
|
|
59
|
+
if (value?.length > 0) emit("update:modelValue", value);
|
|
60
|
+
else emit("update:modelValue", []);
|
|
61
|
+
}
|
|
62
|
+
});
|
|
63
|
+
watch(() => props.modelValue, async () => {
|
|
64
|
+
const P = (props.modelValue ? props.modelValue.split(",") : []).map(async (url) => {
|
|
65
|
+
const path = void 0 + url;
|
|
66
|
+
return {
|
|
67
|
+
uid: uuid2(16, 16),
|
|
68
|
+
path,
|
|
69
|
+
name: url.split("/").at(-1),
|
|
70
|
+
status: void 0,
|
|
71
|
+
fileSize: await getFileSize(path),
|
|
72
|
+
percentNum: 0
|
|
73
|
+
};
|
|
74
|
+
});
|
|
75
|
+
fileList.value = await Promise.all(P);
|
|
76
|
+
}, { immediate: true });
|
|
77
|
+
const fileSizeParser = computed(() => {
|
|
78
|
+
return (size) => {
|
|
79
|
+
return sizeParser(size);
|
|
80
|
+
};
|
|
81
|
+
});
|
|
82
|
+
const acceptList = computed(() => {
|
|
83
|
+
const _accept = cloneDeep(props.accept || []);
|
|
84
|
+
const handleAccept = [...new Set(_accept)];
|
|
85
|
+
const allAccepts = [];
|
|
86
|
+
handleAccept.forEach((ext) => {
|
|
87
|
+
allAccepts.push(ext);
|
|
88
|
+
if (ext === ext.toLowerCase()) allAccepts.push(ext.toUpperCase());
|
|
89
|
+
if (ext === ext.toUpperCase()) allAccepts.push(ext.toLowerCase());
|
|
90
|
+
});
|
|
91
|
+
return [...new Set(allAccepts)].map((i) => "." + i);
|
|
92
|
+
});
|
|
93
|
+
const showUpload = computed(() => {
|
|
94
|
+
if (props.maxCount === null || props.maxCount === void 0) return true;
|
|
95
|
+
return fileList.value.length < props.maxCount;
|
|
96
|
+
});
|
|
97
|
+
const isMultiple = computed(() => {
|
|
98
|
+
if (props.maxCount === null || props.maxCount === void 0) return true;
|
|
99
|
+
return props.maxCount > 1;
|
|
100
|
+
});
|
|
101
|
+
async function beforeUploadFn({ file }) {
|
|
102
|
+
fileLen.value += 1;
|
|
103
|
+
if (fileLen.value > props.maxCount) {
|
|
104
|
+
fileLen.value -= 1;
|
|
105
|
+
return;
|
|
106
|
+
}
|
|
107
|
+
fileList.value = [...fileList.value, {
|
|
108
|
+
uid: file.uid,
|
|
109
|
+
name: file.name,
|
|
110
|
+
fileSize: file.size,
|
|
111
|
+
path: "",
|
|
112
|
+
percentNum: 0,
|
|
113
|
+
status: statusEnum.ACTIVE
|
|
114
|
+
}];
|
|
115
|
+
await uploadFile(file);
|
|
116
|
+
}
|
|
117
|
+
async function uploadFile(file) {
|
|
118
|
+
let findItem = fileList.value.find((item) => item.uid === file.uid) || {};
|
|
119
|
+
try {
|
|
120
|
+
await Uploader.beforeUploadFun(file, {
|
|
121
|
+
maxSize: props.maxSize || 5,
|
|
122
|
+
acceptList: (props.accept || []).map((i) => "." + i),
|
|
123
|
+
beforeUpload: async (file) => {
|
|
124
|
+
if (props.beforeUpload && Object.prototype.toString.call(props.beforeUpload) === "[object Function]") return props.beforeUpload(file);
|
|
125
|
+
}
|
|
126
|
+
});
|
|
127
|
+
const timer = setInterval(() => {
|
|
128
|
+
if (findItem["percentNum"] && findItem["percentNum"] < 95) findItem["percentNum"] += 1;
|
|
129
|
+
}, 100);
|
|
130
|
+
try {
|
|
131
|
+
const path = await Uploader.uploadByFile(file, true, props.modelKey);
|
|
132
|
+
value.value = [...value.value, path];
|
|
133
|
+
findItem = Object.assign(findItem, {
|
|
134
|
+
path: void 0 + path,
|
|
135
|
+
percentNum: 100,
|
|
136
|
+
status: void 0
|
|
137
|
+
});
|
|
138
|
+
clearInterval(timer);
|
|
139
|
+
await nextTick();
|
|
140
|
+
/**列字段时候触发保存 */
|
|
141
|
+
props.isTable && emit("saveTableRow");
|
|
142
|
+
} catch (err) {
|
|
143
|
+
fileLen.value -= 1;
|
|
144
|
+
console.warn(err);
|
|
145
|
+
findItem["status"] = statusEnum.EXCEPTION;
|
|
146
|
+
clearInterval(timer);
|
|
147
|
+
}
|
|
148
|
+
} catch (error) {
|
|
149
|
+
fileLen.value -= 1;
|
|
150
|
+
message.warn(error);
|
|
151
|
+
fileList.value.splice(fileList.value.length - 1, 1);
|
|
152
|
+
}
|
|
153
|
+
}
|
|
154
|
+
async function deleteFile(index) {
|
|
155
|
+
fileLen.value -= 1;
|
|
156
|
+
fileList.value.splice(index, 1);
|
|
157
|
+
value.value.splice(index, 1);
|
|
158
|
+
value.value = [...value.value];
|
|
159
|
+
await nextTick();
|
|
160
|
+
}
|
|
161
|
+
async function downFile(item) {
|
|
162
|
+
downloadByUrl({ url: item.path });
|
|
163
|
+
}
|
|
164
|
+
return (_ctx, _cache) => {
|
|
165
|
+
const _component_a_upload_dragger = resolveComponent("a-upload-dragger");
|
|
166
|
+
const _component_a_tooltip = resolveComponent("a-tooltip");
|
|
167
|
+
const _component_a_progress = resolveComponent("a-progress");
|
|
168
|
+
const _component_close_outlined = resolveComponent("close-outlined");
|
|
169
|
+
return withDirectives((openBlock(), createElementBlock("div", null, [withDirectives(createVNode(_component_a_upload_dragger, {
|
|
170
|
+
style: { "margin-bottom": "16px" },
|
|
171
|
+
disabled: __props.disabled,
|
|
172
|
+
"custom-request": beforeUploadFn,
|
|
173
|
+
multiple: isMultiple.value,
|
|
174
|
+
"file-list": [],
|
|
175
|
+
accept: acceptList.value + ""
|
|
176
|
+
}, {
|
|
177
|
+
default: withCtx(() => [createElementVNode("div", null, [createVNode(svg_icon_default, {
|
|
178
|
+
size: "56",
|
|
179
|
+
name: "folder"
|
|
180
|
+
})]), _cache[0] || (_cache[0] = createElementVNode("p", {
|
|
181
|
+
class: "ant-upload-text",
|
|
182
|
+
style: { "font-size": "14px" }
|
|
183
|
+
}, " 点击或将文件拖拽到这里上传 ", -1))]),
|
|
184
|
+
_: 1
|
|
185
|
+
}, 8, [
|
|
186
|
+
"disabled",
|
|
187
|
+
"multiple",
|
|
188
|
+
"accept"
|
|
189
|
+
]), [[vShow, showUpload.value]]), createElementVNode("div", _hoisted_1, [(openBlock(true), createElementBlock(Fragment, null, renderList(fileList.value, (item, index) => {
|
|
190
|
+
return openBlock(), createElementBlock("div", {
|
|
191
|
+
key: index,
|
|
192
|
+
class: "progress-item mb-8px w-full"
|
|
193
|
+
}, [
|
|
194
|
+
createVNode(svg_icon_default, {
|
|
195
|
+
class: "svg-icon",
|
|
196
|
+
size: item.status ? 32 : 24,
|
|
197
|
+
name: fileTypeParser.value(item.name)
|
|
198
|
+
}, null, 8, ["size", "name"]),
|
|
199
|
+
createElementVNode("div", _hoisted_2, [createElementVNode("div", _hoisted_3, [createVNode(_component_a_tooltip, null, {
|
|
200
|
+
title: withCtx(() => [createTextVNode(toDisplayString(item.name), 1)]),
|
|
201
|
+
default: withCtx(() => [createElementVNode("span", {
|
|
202
|
+
class: "label",
|
|
203
|
+
onClick: withModifiers(($event) => downFile(item), ["stop"])
|
|
204
|
+
}, toDisplayString(item.name), 9, _hoisted_4)]),
|
|
205
|
+
_: 2
|
|
206
|
+
}, 1024), item.fileSize ? (openBlock(), createElementBlock("span", {
|
|
207
|
+
key: 0,
|
|
208
|
+
class: normalizeClass(["size", { "mr-40px": item.status }])
|
|
209
|
+
}, toDisplayString(fileSizeParser.value(item.fileSize)), 3)) : createCommentVNode("", true)]), withDirectives(createVNode(_component_a_progress, {
|
|
210
|
+
"stroke-width": 4,
|
|
211
|
+
percent: item.percentNum
|
|
212
|
+
}, {
|
|
213
|
+
format: withCtx((percent) => [item.status === unref(statusEnum).EXCEPTION ? (openBlock(), createElementBlock("span", _hoisted_5, toDisplayString(unref(t)("sys.component.upload.uploadError")) + "!", 1)) : (openBlock(), createElementBlock("span", _hoisted_6, toDisplayString(percent + "%"), 1))]),
|
|
214
|
+
_: 2
|
|
215
|
+
}, 1032, ["percent"]), [[vShow, item.status]])]),
|
|
216
|
+
!__props.disabled ? (openBlock(), createBlock(_component_close_outlined, {
|
|
217
|
+
key: 0,
|
|
218
|
+
class: "mt-3px icon",
|
|
219
|
+
onClick: withModifiers(($event) => deleteFile(index), ["stop"])
|
|
220
|
+
}, null, 8, ["onClick"])) : createCommentVNode("", true)
|
|
221
|
+
]);
|
|
222
|
+
}), 128))])], 512)), [[vShow, !__props.readonly]]);
|
|
223
|
+
};
|
|
224
|
+
}
|
|
225
|
+
});
|
|
226
|
+
//#endregion
|
|
227
|
+
export { base_upload_vue_vue_type_script_name_baseUpload_setup_true_lang_default as default };
|
|
@@ -0,0 +1,76 @@
|
|
|
1
|
+
.progress-box[data-v-f53b6ac6] {
|
|
2
|
+
max-height: 320px;
|
|
3
|
+
overflow-y: auto;
|
|
4
|
+
}
|
|
5
|
+
.progress-box[data-v-f53b6ac6]::-webkit-scrollbar {
|
|
6
|
+
display: block;
|
|
7
|
+
width: 4px;
|
|
8
|
+
}
|
|
9
|
+
.progress-item[data-v-f53b6ac6] {
|
|
10
|
+
display: flex;
|
|
11
|
+
justify-content: flex-start;
|
|
12
|
+
}
|
|
13
|
+
.progress-item .svg-icon[data-v-f53b6ac6] {
|
|
14
|
+
width: 32px;
|
|
15
|
+
height: 32px;
|
|
16
|
+
}
|
|
17
|
+
.progress-item__box[data-v-f53b6ac6] {
|
|
18
|
+
display: flex;
|
|
19
|
+
flex-direction: column;
|
|
20
|
+
align-self: center;
|
|
21
|
+
width: calc(100% - 72px);
|
|
22
|
+
line-height: 22px;
|
|
23
|
+
}
|
|
24
|
+
.progress-item__box[data-v-f53b6ac6] .ant-progress {
|
|
25
|
+
line-height: 0.4;
|
|
26
|
+
}
|
|
27
|
+
.progress-item__box[data-v-f53b6ac6] .ant-progress .ant-progress-text {
|
|
28
|
+
position: absolute;
|
|
29
|
+
top: -14px;
|
|
30
|
+
right: 0;
|
|
31
|
+
color: #797a7d;
|
|
32
|
+
line-height: 0.6;
|
|
33
|
+
}
|
|
34
|
+
.progress-item__box[data-v-f53b6ac6] .ant-progress .ant-progress-text:has(.error) {
|
|
35
|
+
right: 30px;
|
|
36
|
+
}
|
|
37
|
+
.progress-item__box[data-v-f53b6ac6] .ant-progress-show-info .ant-progress-outer {
|
|
38
|
+
margin-right: 0;
|
|
39
|
+
padding-right: 0;
|
|
40
|
+
}
|
|
41
|
+
.progress-item__box[data-v-f53b6ac6] .ant-progress-show-info .ant-progress-outer .ant-progress-inner {
|
|
42
|
+
background: #e6e9ef;
|
|
43
|
+
}
|
|
44
|
+
.progress-item__name[data-v-f53b6ac6] {
|
|
45
|
+
display: flex;
|
|
46
|
+
width: 100%;
|
|
47
|
+
}
|
|
48
|
+
.progress-item__name .label[data-v-f53b6ac6] {
|
|
49
|
+
overflow: hidden;
|
|
50
|
+
text-overflow: ellipsis;
|
|
51
|
+
white-space: nowrap;
|
|
52
|
+
cursor: pointer;
|
|
53
|
+
}
|
|
54
|
+
.progress-item__name .label[data-v-f53b6ac6]:hover {
|
|
55
|
+
color: var(--ant-primary-color);
|
|
56
|
+
}
|
|
57
|
+
.progress-item__name .size[data-v-f53b6ac6] {
|
|
58
|
+
margin-left: 16px;
|
|
59
|
+
color: #c3c3c3;
|
|
60
|
+
}
|
|
61
|
+
.progress-item .icon[data-v-f53b6ac6] {
|
|
62
|
+
align-self: center;
|
|
63
|
+
margin-left: 24px;
|
|
64
|
+
color: #212528;
|
|
65
|
+
font-size: 16px;
|
|
66
|
+
justify-items: flex-end;
|
|
67
|
+
}
|
|
68
|
+
[data-v-f53b6ac6] .ant-upload.ant-upload-drag {
|
|
69
|
+
background: #f7f8fa;
|
|
70
|
+
}
|
|
71
|
+
[data-v-f53b6ac6] .ant-upload.ant-upload-drag.ant-upload-disabled {
|
|
72
|
+
opacity: 0.5;
|
|
73
|
+
}
|
|
74
|
+
[data-v-f53b6ac6] .ant-upload.ant-upload-drag .ant-upload {
|
|
75
|
+
padding: 40px 0;
|
|
76
|
+
}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { fileType } from '../types';
|
|
2
|
+
import { MaterialEnum } from '@gct-paas/core';
|
|
3
|
+
interface IProps {
|
|
4
|
+
showType: 'Card' | 'List';
|
|
5
|
+
fileList: fileType[];
|
|
6
|
+
isDesign: boolean;
|
|
7
|
+
materialType: MaterialEnum;
|
|
8
|
+
hasSize: boolean;
|
|
9
|
+
nameClick?: (item: fileType) => void;
|
|
10
|
+
hideSwitch?: boolean;
|
|
11
|
+
}
|
|
12
|
+
declare const _default: import('vue').DefineComponent<IProps, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {
|
|
13
|
+
"update:showType": (...args: any[]) => void;
|
|
14
|
+
}, string, import('vue').PublicProps, Readonly<IProps> & Readonly<{
|
|
15
|
+
"onUpdate:showType"?: ((...args: any[]) => any) | undefined;
|
|
16
|
+
}>, {}, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {}, HTMLDivElement>;
|
|
17
|
+
export default _default;
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import _plugin_vue_export_helper_default from "../../../../_virtual/_plugin-vue_export-helper.mjs";
|
|
2
|
+
import file_list_vue_vue_type_script_setup_true_name_fileList_lang_default from "./file-list.vue_vue_type_script_setup_true_name_fileList_lang.mjs";
|
|
3
|
+
import './file-list.vue_vue_type_style_index_0_scoped_3918aad0_lang.css';/* empty css */
|
|
4
|
+
//#region src/components/field-upload/src/components/file-list.vue
|
|
5
|
+
var file_list_default = /* @__PURE__ */ _plugin_vue_export_helper_default(file_list_vue_vue_type_script_setup_true_name_fileList_lang_default, [["__scopeId", "data-v-3918aad0"]]);
|
|
6
|
+
//#endregion
|
|
7
|
+
export { file_list_default as default };
|
|
@@ -0,0 +1,129 @@
|
|
|
1
|
+
import svg_icon_default from "../../../svg-icon/svg-icon.vue.mjs";
|
|
2
|
+
import { sizeParser, typeParser } from "../hooks/hooks.mjs";
|
|
3
|
+
import { Fragment, computed, createBlock, createCommentVNode, createElementBlock, createElementVNode, createTextVNode, createVNode, defineComponent, normalizeClass, openBlock, ref, renderList, resolveComponent, toDisplayString, unref, watch, withCtx, withModifiers } from "vue";
|
|
4
|
+
import { isFunction } from "lodash-es";
|
|
5
|
+
import { MaterialEnum, downloadByUrl } from "@gct-paas/core";
|
|
6
|
+
//#region src/components/field-upload/src/components/file-list.vue?vue&type=script&setup=true&name=fileList&lang.ts
|
|
7
|
+
var _hoisted_1 = { class: "file-list" };
|
|
8
|
+
var _hoisted_2 = {
|
|
9
|
+
key: 0,
|
|
10
|
+
class: "file-list__header"
|
|
11
|
+
};
|
|
12
|
+
var _hoisted_3 = ["onClick"];
|
|
13
|
+
var _hoisted_4 = { class: "file-list__item-name" };
|
|
14
|
+
var _hoisted_5 = ["onClick"];
|
|
15
|
+
var _hoisted_6 = ["onClick"];
|
|
16
|
+
var file_list_vue_vue_type_script_setup_true_name_fileList_lang_default = /* @__PURE__ */ defineComponent({
|
|
17
|
+
__name: "file-list",
|
|
18
|
+
props: {
|
|
19
|
+
showType: {},
|
|
20
|
+
fileList: {},
|
|
21
|
+
isDesign: { type: Boolean },
|
|
22
|
+
materialType: {},
|
|
23
|
+
hasSize: { type: Boolean },
|
|
24
|
+
nameClick: { type: Function },
|
|
25
|
+
hideSwitch: { type: Boolean }
|
|
26
|
+
},
|
|
27
|
+
emits: ["update:showType"],
|
|
28
|
+
setup(__props, { emit: __emit }) {
|
|
29
|
+
const props = __props;
|
|
30
|
+
const emit = __emit;
|
|
31
|
+
const filesList = ref([]);
|
|
32
|
+
const switchIcons = [{
|
|
33
|
+
icon: "icon-liebiaozhanshi",
|
|
34
|
+
name: "List",
|
|
35
|
+
key: "switch_icon_list"
|
|
36
|
+
}, {
|
|
37
|
+
icon: "icon-kapianzhanshi",
|
|
38
|
+
name: "Card",
|
|
39
|
+
key: "switch_icon_card"
|
|
40
|
+
}];
|
|
41
|
+
watch(() => props.fileList, async (val) => {
|
|
42
|
+
if (!props.isDesign && props.hasSize) {
|
|
43
|
+
const ids = props.fileList.map((i) => {
|
|
44
|
+
return i.path.split("/")[2];
|
|
45
|
+
});
|
|
46
|
+
filesList.value = (await _api.apaas.fileResource.postList({ ids }) || []).map((item) => {
|
|
47
|
+
const minio = void 0;
|
|
48
|
+
return {
|
|
49
|
+
path: /^\/w/.test(item.url) ? `${minio}${item.url}` : `${minio}/${item.url}`,
|
|
50
|
+
name: item.name,
|
|
51
|
+
size: item.size
|
|
52
|
+
};
|
|
53
|
+
});
|
|
54
|
+
} else filesList.value = val.map((item) => {
|
|
55
|
+
return typeof item === "string" ? {
|
|
56
|
+
name: getFileName(item),
|
|
57
|
+
path: item
|
|
58
|
+
} : item;
|
|
59
|
+
});
|
|
60
|
+
}, { immediate: true });
|
|
61
|
+
const getFileName = (path) => {
|
|
62
|
+
const parts = path.split("/");
|
|
63
|
+
return parts[parts.length - 1];
|
|
64
|
+
};
|
|
65
|
+
const fileTypeParser = computed(() => {
|
|
66
|
+
return (item) => {
|
|
67
|
+
if (item?.type === "external") return "link";
|
|
68
|
+
return typeParser(item?.name ?? item);
|
|
69
|
+
};
|
|
70
|
+
});
|
|
71
|
+
const fileSizeParser = computed(() => {
|
|
72
|
+
return (size) => {
|
|
73
|
+
return sizeParser(size);
|
|
74
|
+
};
|
|
75
|
+
});
|
|
76
|
+
const onChangeTypeTab = (data) => {
|
|
77
|
+
emit("update:showType", data.name);
|
|
78
|
+
};
|
|
79
|
+
async function downFile(item) {
|
|
80
|
+
if (props.isDesign) return;
|
|
81
|
+
if (props.nameClick && isFunction(props.nameClick)) props.nameClick(item);
|
|
82
|
+
else downloadByUrl({ url: item.path });
|
|
83
|
+
}
|
|
84
|
+
return (_ctx, _cache) => {
|
|
85
|
+
const _component_a_tooltip = resolveComponent("a-tooltip");
|
|
86
|
+
return openBlock(), createElementBlock("div", _hoisted_1, [!__props.hideSwitch ? (openBlock(), createElementBlock("div", _hoisted_2, [(openBlock(), createElementBlock(Fragment, null, renderList(switchIcons, (tab) => {
|
|
87
|
+
return createElementVNode("div", {
|
|
88
|
+
key: tab.key,
|
|
89
|
+
class: normalizeClass(["switch-item", [__props.showType === tab.name && "selected"]]),
|
|
90
|
+
onClick: withModifiers(() => onChangeTypeTab(tab), ["stop"])
|
|
91
|
+
}, [createElementVNode("i", { class: normalizeClass(["iconfont", tab.icon]) }, null, 2)], 10, _hoisted_3);
|
|
92
|
+
}), 64))])) : createCommentVNode("", true), createElementVNode("div", { class: normalizeClass([
|
|
93
|
+
"file-list__list",
|
|
94
|
+
__props.showType === "Card" ? "flex-card" : "flex-list",
|
|
95
|
+
!!__props.hideSwitch ? "hide-switch" : ""
|
|
96
|
+
]) }, [(openBlock(true), createElementBlock(Fragment, null, renderList(filesList.value, (file, index) => {
|
|
97
|
+
return openBlock(), createElementBlock("div", {
|
|
98
|
+
key: index,
|
|
99
|
+
class: normalizeClass([
|
|
100
|
+
"file-list__item",
|
|
101
|
+
__props.isDesign ? "is-design" : "",
|
|
102
|
+
{ "material-table-field": __props.materialType === unref(MaterialEnum).MaterialTableField }
|
|
103
|
+
])
|
|
104
|
+
}, [
|
|
105
|
+
createVNode(svg_icon_default, {
|
|
106
|
+
class: normalizeClass(["file-list__item-svg", !__props.hasSize ? "no-size" : ""]),
|
|
107
|
+
size: __props.showType === "Card" ? 32 : 24,
|
|
108
|
+
name: fileTypeParser.value(file)
|
|
109
|
+
}, null, 8, [
|
|
110
|
+
"class",
|
|
111
|
+
"size",
|
|
112
|
+
"name"
|
|
113
|
+
]),
|
|
114
|
+
createElementVNode("div", _hoisted_4, [__props.isDesign ? (openBlock(), createElementBlock("span", {
|
|
115
|
+
key: 0,
|
|
116
|
+
onClick: withModifiers(($event) => downFile(file), ["stop"])
|
|
117
|
+
}, toDisplayString(file.name), 9, _hoisted_5)) : (openBlock(), createBlock(_component_a_tooltip, { key: 1 }, {
|
|
118
|
+
title: withCtx(() => [createTextVNode(toDisplayString(file.name), 1)]),
|
|
119
|
+
default: withCtx(() => [createElementVNode("span", { onClick: withModifiers(($event) => downFile(file), ["stop"]) }, toDisplayString(file.name), 9, _hoisted_6)]),
|
|
120
|
+
_: 2
|
|
121
|
+
}, 1024))]),
|
|
122
|
+
createElementVNode("span", { class: normalizeClass(["file-list__item-size", [__props.isDesign ? "is-design" : ""]]) }, toDisplayString(__props.hasSize ? fileSizeParser.value(file.size) : ""), 3)
|
|
123
|
+
], 2);
|
|
124
|
+
}), 128))], 2)]);
|
|
125
|
+
};
|
|
126
|
+
}
|
|
127
|
+
});
|
|
128
|
+
//#endregion
|
|
129
|
+
export { file_list_vue_vue_type_script_setup_true_name_fileList_lang_default as default };
|
|
@@ -0,0 +1,129 @@
|
|
|
1
|
+
.file-list__header[data-v-3918aad0] {
|
|
2
|
+
width: 64px;
|
|
3
|
+
height: 32px;
|
|
4
|
+
padding: 4px;
|
|
5
|
+
border-radius: 4px;
|
|
6
|
+
background: #f3f5f9;
|
|
7
|
+
display: flex;
|
|
8
|
+
flex-direction: row;
|
|
9
|
+
justify-content: space-between;
|
|
10
|
+
}
|
|
11
|
+
.file-list__header .switch-item[data-v-3918aad0] {
|
|
12
|
+
position: relative;
|
|
13
|
+
display: flex;
|
|
14
|
+
align-items: center;
|
|
15
|
+
width: 24px;
|
|
16
|
+
height: 24px;
|
|
17
|
+
color: #c9cede;
|
|
18
|
+
border-radius: 2px;
|
|
19
|
+
cursor: pointer;
|
|
20
|
+
}
|
|
21
|
+
.file-list__header .switch-item .iconfont[data-v-3918aad0] {
|
|
22
|
+
width: 24px;
|
|
23
|
+
height: 24px;
|
|
24
|
+
font-size: 16px;
|
|
25
|
+
display: flex;
|
|
26
|
+
justify-content: center;
|
|
27
|
+
}
|
|
28
|
+
.file-list__header .switch-item.selected[data-v-3918aad0] {
|
|
29
|
+
background-color: #fff;
|
|
30
|
+
color: #384356;
|
|
31
|
+
}
|
|
32
|
+
.file-list__list[data-v-3918aad0] {
|
|
33
|
+
margin-top: 12px;
|
|
34
|
+
display: flex;
|
|
35
|
+
}
|
|
36
|
+
.file-list__list.hide-switch[data-v-3918aad0] {
|
|
37
|
+
margin-top: 0;
|
|
38
|
+
}
|
|
39
|
+
.file-list__list[data-v-3918aad0]::-webkit-scrollbar {
|
|
40
|
+
display: block;
|
|
41
|
+
width: 4px;
|
|
42
|
+
}
|
|
43
|
+
.file-list__list.flex-card[data-v-3918aad0] {
|
|
44
|
+
flex-direction: row;
|
|
45
|
+
flex-wrap: wrap;
|
|
46
|
+
max-height: 372px;
|
|
47
|
+
overflow-y: auto;
|
|
48
|
+
}
|
|
49
|
+
.file-list__list.flex-card .file-list__item[data-v-3918aad0] {
|
|
50
|
+
flex-direction: column;
|
|
51
|
+
text-align: center;
|
|
52
|
+
width: 115px;
|
|
53
|
+
background: #fff;
|
|
54
|
+
margin-right: 10px;
|
|
55
|
+
padding: 16px 10px;
|
|
56
|
+
border: 1px solid #e8ebf0;
|
|
57
|
+
border-radius: 4px 4px 4px 4px;
|
|
58
|
+
}
|
|
59
|
+
.file-list__list.flex-card .file-list__item.material-table-field[data-v-3918aad0]:nth-child(3n + 3) {
|
|
60
|
+
margin-right: 0;
|
|
61
|
+
}
|
|
62
|
+
.file-list__list.flex-card .file-list__item-svg[data-v-3918aad0] {
|
|
63
|
+
margin: 0 auto;
|
|
64
|
+
}
|
|
65
|
+
.file-list__list.flex-card .file-list__item-svg.no-size[data-v-3918aad0] {
|
|
66
|
+
margin-top: 6px;
|
|
67
|
+
}
|
|
68
|
+
.file-list__list.flex-card .file-list__item-name[data-v-3918aad0] {
|
|
69
|
+
width: 100%;
|
|
70
|
+
height: 22px;
|
|
71
|
+
line-height: 22px;
|
|
72
|
+
margin: 8px auto 0;
|
|
73
|
+
}
|
|
74
|
+
.file-list__list.flex-card .file-list__item-size[data-v-3918aad0] {
|
|
75
|
+
line-height: 18px;
|
|
76
|
+
margin-top: 2px;
|
|
77
|
+
font-size: 12px;
|
|
78
|
+
color: #c3c3c3;
|
|
79
|
+
}
|
|
80
|
+
.file-list__list.flex-card .file-list__item[data-v-3918aad0]:hover {
|
|
81
|
+
box-shadow: 0px 0px 6px 0px rgba(0, 0, 0, 0.08);
|
|
82
|
+
border-color: #fff;
|
|
83
|
+
}
|
|
84
|
+
.file-list__list.flex-card .file-list__item:hover .file-list__item-size.is-design[data-v-3918aad0] {
|
|
85
|
+
color: #c3c3c3;
|
|
86
|
+
}
|
|
87
|
+
.file-list__list.flex-list[data-v-3918aad0] {
|
|
88
|
+
flex-direction: column;
|
|
89
|
+
max-height: 320px;
|
|
90
|
+
overflow-y: auto;
|
|
91
|
+
}
|
|
92
|
+
.file-list__list.flex-list .file-list__item[data-v-3918aad0] {
|
|
93
|
+
line-height: 24px;
|
|
94
|
+
}
|
|
95
|
+
.file-list__list.flex-list .file-list__item-name[data-v-3918aad0] {
|
|
96
|
+
height: 24px;
|
|
97
|
+
width: calc(100% - 26px);
|
|
98
|
+
margin-left: 8px;
|
|
99
|
+
white-space: nowrap;
|
|
100
|
+
overflow: hidden;
|
|
101
|
+
text-overflow: ellipsis;
|
|
102
|
+
}
|
|
103
|
+
.file-list__list.flex-list .file-list__item-size[data-v-3918aad0] {
|
|
104
|
+
margin-left: 16px;
|
|
105
|
+
margin-right: 3px;
|
|
106
|
+
}
|
|
107
|
+
.file-list__item[data-v-3918aad0] {
|
|
108
|
+
display: flex;
|
|
109
|
+
margin-top: 2px;
|
|
110
|
+
margin-bottom: 6px;
|
|
111
|
+
}
|
|
112
|
+
.file-list__item-name span[data-v-3918aad0] {
|
|
113
|
+
display: inline-block;
|
|
114
|
+
max-width: 100%;
|
|
115
|
+
white-space: nowrap;
|
|
116
|
+
overflow: hidden;
|
|
117
|
+
text-overflow: ellipsis;
|
|
118
|
+
}
|
|
119
|
+
.file-list__item-size[data-v-3918aad0] {
|
|
120
|
+
color: #c3c3c3;
|
|
121
|
+
}
|
|
122
|
+
.file-list__item[data-v-3918aad0]:hover {
|
|
123
|
+
cursor: pointer;
|
|
124
|
+
color: var(--ant-primary-color);
|
|
125
|
+
}
|
|
126
|
+
.file-list__item.is-design[data-v-3918aad0] {
|
|
127
|
+
cursor: default;
|
|
128
|
+
color: rgba(0, 0, 0, 0.85);
|
|
129
|
+
}
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
type __VLS_Props = {
|
|
2
|
+
disabled: boolean;
|
|
3
|
+
};
|
|
4
|
+
declare const _default: import('vue').DefineComponent<__VLS_Props, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, string, import('vue').PublicProps, Readonly<__VLS_Props> & Readonly<{}>, {}, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {}, HTMLDivElement>;
|
|
5
|
+
export default _default;
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import _plugin_vue_export_helper_default from "../../../../_virtual/_plugin-vue_export-helper.mjs";
|
|
2
|
+
import upload_design_vue_vue_type_script_name_UploadDesign_setup_true_lang_default from "./upload-design.vue_vue_type_script_name_UploadDesign_setup_true_lang.mjs";
|
|
3
|
+
import './upload-design.vue_vue_type_style_index_0_scoped_1e5189c1_lang.css';/* empty css */
|
|
4
|
+
//#region src/components/field-upload/src/components/upload-design.vue
|
|
5
|
+
var upload_design_default = /* @__PURE__ */ _plugin_vue_export_helper_default(upload_design_vue_vue_type_script_name_UploadDesign_setup_true_lang_default, [["__scopeId", "data-v-1e5189c1"]]);
|
|
6
|
+
//#endregion
|
|
7
|
+
export { upload_design_default as default };
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
import svg_icon_default from "../../../svg-icon/svg-icon.vue.mjs";
|
|
2
|
+
import { createElementBlock, createElementVNode, createVNode, defineComponent, openBlock, resolveComponent, withCtx } from "vue";
|
|
3
|
+
//#region src/components/field-upload/src/components/upload-design.vue?vue&type=script&name=UploadDesign&setup=true&lang.ts
|
|
4
|
+
var _hoisted_1 = { class: "upload-design" };
|
|
5
|
+
var _hoisted_2 = { style: { "pointer-events": "none" } };
|
|
6
|
+
var _hoisted_3 = { class: "progress-wrap" };
|
|
7
|
+
var _hoisted_4 = { class: "progress-box text-sm" };
|
|
8
|
+
var upload_design_vue_vue_type_script_name_UploadDesign_setup_true_lang_default = /* @__PURE__ */ defineComponent({
|
|
9
|
+
__name: "upload-design",
|
|
10
|
+
props: { disabled: { type: Boolean } },
|
|
11
|
+
setup(__props) {
|
|
12
|
+
return (_ctx, _cache) => {
|
|
13
|
+
const _component_a_upload_dragger = resolveComponent("a-upload-dragger");
|
|
14
|
+
const _component_a_progress = resolveComponent("a-progress");
|
|
15
|
+
const _component_close_outlined = resolveComponent("close-outlined");
|
|
16
|
+
return openBlock(), createElementBlock("div", _hoisted_1, [createElementVNode("div", _hoisted_2, [createVNode(_component_a_upload_dragger, {
|
|
17
|
+
"file-list": [],
|
|
18
|
+
disabled: __props.disabled
|
|
19
|
+
}, {
|
|
20
|
+
default: withCtx(() => [createElementVNode("div", null, [createVNode(svg_icon_default, {
|
|
21
|
+
size: "56",
|
|
22
|
+
name: "folder"
|
|
23
|
+
})]), _cache[0] || (_cache[0] = createElementVNode("p", {
|
|
24
|
+
class: "ant-upload-text",
|
|
25
|
+
style: { "font-size": "14px" }
|
|
26
|
+
}, " 点击或将文件拖拽到这里上传 ", -1))]),
|
|
27
|
+
_: 1
|
|
28
|
+
}, 8, ["disabled"])]), createElementVNode("div", _hoisted_3, [
|
|
29
|
+
createVNode(svg_icon_default, {
|
|
30
|
+
size: "32",
|
|
31
|
+
name: "doc"
|
|
32
|
+
}),
|
|
33
|
+
createElementVNode("div", _hoisted_4, [_cache[1] || (_cache[1] = createElementVNode("div", { class: "left w-full" }, [createElementVNode("span", { class: "label" }, "示例内容.docx"), createElementVNode("span", { class: "size ml-16px text-[#C3C3C3]" }, "88M")], -1)), createVNode(_component_a_progress, {
|
|
34
|
+
"stroke-width": 4,
|
|
35
|
+
percent: 88
|
|
36
|
+
})]),
|
|
37
|
+
createVNode(_component_close_outlined, { class: "mt-3px icon" })
|
|
38
|
+
])]);
|
|
39
|
+
};
|
|
40
|
+
}
|
|
41
|
+
});
|
|
42
|
+
//#endregion
|
|
43
|
+
export { upload_design_vue_vue_type_script_name_UploadDesign_setup_true_lang_default as default };
|