@cmstops/pro-compo 0.3.49 → 0.3.51
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 +30 -13
- package/dist/index.min.css +1 -1
- package/es/docPreview/component.js +33 -30
- package/es/hooks/useUpload.d.ts +1 -0
- package/es/hooks/useUpload.js +26 -8
- package/es/index.css +30 -13
- package/es/selectResourceModal/components/ListCardWrapper/index.js +19 -15
- package/es/selectResourceModal/components/ListContent/index.js +5 -2
- package/es/selectResourceModal/components/ListContentLocal/index.js +28 -4
- package/es/selectResourceModal/components/ListFilter/index.js +12 -2
- package/es/selectResourceModal/style/index.css +7 -1
- package/es/selectResourceModal/style/listCardWrapper.less +11 -1
- package/es/thumbCard/component.js +36 -35
- package/es/thumbCard/components/ThumbUploading/index.d.ts +0 -0
- package/es/thumbCard/components/ThumbUploading/index.js +42 -0
- package/es/thumbCard/style/index.css +23 -12
- package/es/thumbCard/style/index.less +6 -16
- package/es/thumbCard/style/thumbUploading.less +26 -0
- package/es/userAvater/component.js +3 -3
- package/lib/docPreview/component.js +33 -30
- package/lib/hooks/useUpload.js +26 -8
- package/lib/index.css +30 -13
- package/lib/selectResourceModal/components/ListCardWrapper/index.js +19 -15
- package/lib/selectResourceModal/components/ListContent/index.js +5 -2
- package/lib/selectResourceModal/components/ListContentLocal/index.js +28 -4
- package/lib/selectResourceModal/components/ListFilter/index.js +12 -2
- package/lib/selectResourceModal/style/index.css +7 -1
- package/lib/selectResourceModal/style/listCardWrapper.less +11 -1
- package/lib/thumbCard/component.js +35 -34
- package/lib/thumbCard/components/ThumbUploading/index.js +43 -0
- package/lib/thumbCard/style/index.css +23 -12
- package/lib/thumbCard/style/index.less +6 -16
- package/lib/thumbCard/style/thumbUploading.less +26 -0
- package/lib/userAvater/component.js +3 -3
- package/package.json +1 -1
|
@@ -6,23 +6,22 @@ import _sfc_main$1 from "./components/PreviewIframe.js";
|
|
|
6
6
|
import { useDocPreview, EXPIRE_TIME_OPTIONS } from "./scripts/hook.js";
|
|
7
7
|
const _hoisted_1 = { class: "preview-close" };
|
|
8
8
|
const _hoisted_2 = /* @__PURE__ */ createElementVNode("div", { class: "doc-preview-share" }, null, -1);
|
|
9
|
-
const _hoisted_3 = { class: "doc-preview-share" };
|
|
10
|
-
const _hoisted_4 =
|
|
11
|
-
const _hoisted_5 =
|
|
12
|
-
const _hoisted_6 =
|
|
13
|
-
const _hoisted_7 =
|
|
14
|
-
const _hoisted_8 =
|
|
15
|
-
const _hoisted_9 = { class: "doc-preview-share-link" };
|
|
16
|
-
const _hoisted_10 = { class: "doc-preview-share-link-
|
|
17
|
-
const _hoisted_11 = { class: "doc-preview-share-
|
|
18
|
-
const _hoisted_12 = { class: "doc-preview-share-
|
|
19
|
-
const _hoisted_13 = /* @__PURE__ */ createElementVNode("div", { class: "doc-preview-share-img" }, [
|
|
9
|
+
const _hoisted_3 = { class: "doc-preview-share-img" };
|
|
10
|
+
const _hoisted_4 = ["src"];
|
|
11
|
+
const _hoisted_5 = /* @__PURE__ */ createElementVNode("div", { class: "doc-preview-share-tips" }, "\u626B\u63CF\u4E8C\u7EF4\u7801\u8BBF\u95EE", -1);
|
|
12
|
+
const _hoisted_6 = { class: "doc-preview-share-header" };
|
|
13
|
+
const _hoisted_7 = /* @__PURE__ */ createElementVNode("span", null, "\u9884\u89C8\u5730\u5740", -1);
|
|
14
|
+
const _hoisted_8 = { class: "doc-preview-share-link" };
|
|
15
|
+
const _hoisted_9 = { class: "doc-preview-share-link-value" };
|
|
16
|
+
const _hoisted_10 = { class: "doc-preview-share-link-hint" };
|
|
17
|
+
const _hoisted_11 = { class: "doc-preview-share-action" };
|
|
18
|
+
const _hoisted_12 = /* @__PURE__ */ createElementVNode("div", { class: "doc-preview-share-img" }, [
|
|
20
19
|
/* @__PURE__ */ createElementVNode("div", { class: "doc-preview-share-img-hint" }, " \u6682\u65E0\u9884\u89C8 ")
|
|
21
20
|
], -1);
|
|
22
|
-
const
|
|
23
|
-
const
|
|
24
|
-
const
|
|
25
|
-
const
|
|
21
|
+
const _hoisted_13 = /* @__PURE__ */ createElementVNode("div", { class: "doc-preview-share-tips" }, " \u5185\u5BB9\u6682\u65E0\u9884\u89C8\u94FE\u63A5\uFF0C\u53EF\u751F\u6210\u9884\u89C8\u94FE\u63A5 ", -1);
|
|
22
|
+
const _hoisted_14 = { class: "doc-preview-share-header" };
|
|
23
|
+
const _hoisted_15 = /* @__PURE__ */ createElementVNode("span", null, "\u94FE\u63A5\u6709\u6548\u65F6\u957F", -1);
|
|
24
|
+
const _hoisted_16 = { class: "doc-preview-share-action" };
|
|
26
25
|
const _sfc_main = defineComponent({
|
|
27
26
|
...{ name: "docPreview" },
|
|
28
27
|
__name: "component",
|
|
@@ -51,7 +50,7 @@ const _sfc_main = defineComponent({
|
|
|
51
50
|
return (_ctx, _cache) => {
|
|
52
51
|
return openBlock(), createElementBlock("div", {
|
|
53
52
|
class: "doc-preview-container",
|
|
54
|
-
onClick: _cache[
|
|
53
|
+
onClick: _cache[7] || (_cache[7] = ($event) => emits("close"))
|
|
55
54
|
}, [
|
|
56
55
|
createElementVNode("div", _hoisted_1, [
|
|
57
56
|
createVNode(unref(IconClose), {
|
|
@@ -66,20 +65,24 @@ const _sfc_main = defineComponent({
|
|
|
66
65
|
}, null, 8, ["src"]),
|
|
67
66
|
createVNode(unref(Spin), { loading: unref(loading) }, {
|
|
68
67
|
default: withCtx(() => [
|
|
69
|
-
createElementVNode("div",
|
|
68
|
+
createElementVNode("div", {
|
|
69
|
+
class: "doc-preview-share",
|
|
70
|
+
onClick: _cache[6] || (_cache[6] = withModifiers(() => {
|
|
71
|
+
}, ["stop"]))
|
|
72
|
+
}, [
|
|
70
73
|
unref(shareData) ? (openBlock(), createElementBlock(Fragment, { key: 0 }, [
|
|
71
74
|
createCommentVNode(" \u4E8C\u7EF4\u7801 "),
|
|
72
|
-
createElementVNode("div",
|
|
75
|
+
createElementVNode("div", _hoisted_3, [
|
|
73
76
|
createElementVNode("img", {
|
|
74
77
|
src: unref(shareData).qrCode,
|
|
75
78
|
alt: ""
|
|
76
|
-
}, null, 8,
|
|
79
|
+
}, null, 8, _hoisted_4)
|
|
77
80
|
]),
|
|
78
81
|
createCommentVNode(" \u5907\u6CE8 "),
|
|
79
|
-
|
|
82
|
+
_hoisted_5,
|
|
80
83
|
createCommentVNode(" \u94FE\u63A5\u524D\u7F6E\u64CD\u4F5C "),
|
|
81
|
-
createElementVNode("div",
|
|
82
|
-
|
|
84
|
+
createElementVNode("div", _hoisted_6, [
|
|
85
|
+
_hoisted_7,
|
|
83
86
|
createVNode(unref(Link), {
|
|
84
87
|
type: "text",
|
|
85
88
|
onClick: unref(copy)
|
|
@@ -91,12 +94,12 @@ const _sfc_main = defineComponent({
|
|
|
91
94
|
}, 8, ["onClick"])
|
|
92
95
|
]),
|
|
93
96
|
createCommentVNode(" \u94FE\u63A5 "),
|
|
94
|
-
createElementVNode("div",
|
|
95
|
-
createElementVNode("div",
|
|
96
|
-
createElementVNode("div",
|
|
97
|
+
createElementVNode("div", _hoisted_8, [
|
|
98
|
+
createElementVNode("div", _hoisted_9, toDisplayString(unref(shareData).shareUrl), 1),
|
|
99
|
+
createElementVNode("div", _hoisted_10, " \u94FE\u63A5\u5269\u4F59\u65F6\u95F4\uFF1A" + toDisplayString(unref(intervalTime)), 1)
|
|
97
100
|
]),
|
|
98
101
|
createCommentVNode(" \u64CD\u4F5C "),
|
|
99
|
-
createElementVNode("div",
|
|
102
|
+
createElementVNode("div", _hoisted_11, [
|
|
100
103
|
createVNode(unref(Button), {
|
|
101
104
|
onClick: _cache[2] || (_cache[2] = ($event) => unref(cancel)())
|
|
102
105
|
}, {
|
|
@@ -116,10 +119,10 @@ const _sfc_main = defineComponent({
|
|
|
116
119
|
})
|
|
117
120
|
])
|
|
118
121
|
], 64)) : (openBlock(), createElementBlock(Fragment, { key: 1 }, [
|
|
122
|
+
_hoisted_12,
|
|
119
123
|
_hoisted_13,
|
|
120
|
-
_hoisted_14,
|
|
121
|
-
|
|
122
|
-
_hoisted_16,
|
|
124
|
+
createElementVNode("div", _hoisted_14, [
|
|
125
|
+
_hoisted_15,
|
|
123
126
|
createVNode(unref(Select), {
|
|
124
127
|
modelValue: unref(expireTime),
|
|
125
128
|
"onUpdate:modelValue": _cache[4] || (_cache[4] = ($event) => isRef(expireTime) ? expireTime.value = $event : null),
|
|
@@ -138,7 +141,7 @@ const _sfc_main = defineComponent({
|
|
|
138
141
|
_: 1
|
|
139
142
|
}, 8, ["modelValue"])
|
|
140
143
|
]),
|
|
141
|
-
createElementVNode("div",
|
|
144
|
+
createElementVNode("div", _hoisted_16, [
|
|
142
145
|
createVNode(unref(Button), {
|
|
143
146
|
type: "primary",
|
|
144
147
|
onClick: _cache[5] || (_cache[5] = () => unref(generate)())
|
package/es/hooks/useUpload.d.ts
CHANGED
|
@@ -13,4 +13,5 @@ export default function useUpload(): {
|
|
|
13
13
|
uploadFile: (BASE_API: string, file: any, dir: number | undefined, repoId: number, callback?: CallbackFunc | undefined) => void;
|
|
14
14
|
transcodingFile: (BASE_API: string, file: any) => void;
|
|
15
15
|
recordTaskStatusChange: (file: any, progress: number, isTrans?: boolean | undefined) => void;
|
|
16
|
+
removeRecord: (file: any) => void;
|
|
16
17
|
};
|
package/es/hooks/useUpload.js
CHANGED
|
@@ -40,19 +40,28 @@ function useUpload() {
|
|
|
40
40
|
}
|
|
41
41
|
list.value = originList;
|
|
42
42
|
}
|
|
43
|
+
const removeRecord = (file) => {
|
|
44
|
+
const originList = list.value;
|
|
45
|
+
const taskIndex = originList.findIndex((task) => task.id === file.id);
|
|
46
|
+
if (taskIndex !== -1) {
|
|
47
|
+
originList.splice(taskIndex, 1);
|
|
48
|
+
list.value = originList;
|
|
49
|
+
}
|
|
50
|
+
};
|
|
43
51
|
const uploadFile = (BASE_API, file, dir = 0, repoId, callback) => {
|
|
44
52
|
const newFile = {
|
|
45
|
-
id: generateUUID(),
|
|
53
|
+
id: file.id || generateUUID(),
|
|
46
54
|
sig_id: file.sig_id || generateUUID(),
|
|
47
55
|
name: file.name,
|
|
48
56
|
url: "",
|
|
49
57
|
size: file.size,
|
|
50
58
|
isUpload: true,
|
|
51
|
-
type: file.type
|
|
59
|
+
type: file.type,
|
|
60
|
+
originFile: file
|
|
52
61
|
};
|
|
53
62
|
const upload = new TusUploadTask(file);
|
|
54
63
|
newFile.abort = () => upload.abort();
|
|
55
|
-
recordTaskStatusChange(newFile, 0);
|
|
64
|
+
recordTaskStatusChange({ ...newFile, status: 1, msg: "\u4E0A\u4F20\u4E2D\u2026\u2026" }, 0);
|
|
56
65
|
const progress = (percent, total) => {
|
|
57
66
|
const progress2 = percent / total;
|
|
58
67
|
recordTaskStatusChange(newFile, progress2);
|
|
@@ -82,7 +91,9 @@ function useUpload() {
|
|
|
82
91
|
callback && callback({ ...message, sig_id: newFile.sig_id }, "success");
|
|
83
92
|
}).catch((e) => {
|
|
84
93
|
console.log("\u{1F525}\u{1F525}\u{1F525}\u{1F525}\u{1F525} \u4E0A\u4F20\u5931\u8D25\uFF1A", e);
|
|
85
|
-
|
|
94
|
+
setTimeout(() => {
|
|
95
|
+
recordTaskStatusChange({ ...newFile, status: 2, msg: "\u4E0A\u4F20\u5931\u8D25" }, -1);
|
|
96
|
+
}, 1e3);
|
|
86
97
|
callback && callback(newFile, "fail");
|
|
87
98
|
});
|
|
88
99
|
};
|
|
@@ -96,7 +107,7 @@ function useUpload() {
|
|
|
96
107
|
if (idx === -1)
|
|
97
108
|
return;
|
|
98
109
|
const item = list.value[idx];
|
|
99
|
-
recordTaskStatusChange(item, 0, true);
|
|
110
|
+
recordTaskStatusChange({ ...item, status: 1, msg: "\u8F6C\u7801\u4E2D\u2026\u2026" }, 0, true);
|
|
100
111
|
const progress = (progress2) => recordTaskStatusChange(item, progress2);
|
|
101
112
|
const transing = task.start(BASE_API, progress);
|
|
102
113
|
transing.then(async (res) => {
|
|
@@ -106,11 +117,17 @@ function useUpload() {
|
|
|
106
117
|
setTimeout(() => uploadSuccess(file), 200);
|
|
107
118
|
} else {
|
|
108
119
|
console.log("\u{1F525}\u{1F525}\u{1F525}\u{1F525}\u{1F525} \u8F6C\u7801\u5931\u8D25\uFF1A", item);
|
|
109
|
-
recordTaskStatusChange(
|
|
120
|
+
recordTaskStatusChange(
|
|
121
|
+
{ ...item, mediaFile: file, status: 3, msg: "\u8F6C\u7801\u5931\u8D25" },
|
|
122
|
+
-1
|
|
123
|
+
);
|
|
110
124
|
}
|
|
111
125
|
}).catch((e) => {
|
|
112
126
|
console.log("\u{1F525}\u{1F525}\u{1F525}\u{1F525}\u{1F525} \u8F6C\u7801\u5931\u8D25", e);
|
|
113
|
-
recordTaskStatusChange(
|
|
127
|
+
recordTaskStatusChange(
|
|
128
|
+
{ ...item, mediaFile: file, status: 3, msg: "\u8F6C\u7801\u5931\u8D25" },
|
|
129
|
+
-1
|
|
130
|
+
);
|
|
114
131
|
});
|
|
115
132
|
};
|
|
116
133
|
watch(() => list.value, set, { deep: true });
|
|
@@ -119,7 +136,8 @@ function useUpload() {
|
|
|
119
136
|
list,
|
|
120
137
|
uploadFile,
|
|
121
138
|
transcodingFile,
|
|
122
|
-
recordTaskStatusChange
|
|
139
|
+
recordTaskStatusChange,
|
|
140
|
+
removeRecord
|
|
123
141
|
};
|
|
124
142
|
}
|
|
125
143
|
export { addMedia, useUpload as default };
|
package/es/index.css
CHANGED
|
@@ -4246,29 +4246,37 @@
|
|
|
4246
4246
|
color: #fff;
|
|
4247
4247
|
font-size: 18px;
|
|
4248
4248
|
}
|
|
4249
|
-
.thumb-
|
|
4250
|
-
position: relative;
|
|
4249
|
+
.thumb-upload-loading {
|
|
4251
4250
|
display: flex;
|
|
4251
|
+
flex-direction: column;
|
|
4252
4252
|
align-items: center;
|
|
4253
4253
|
justify-content: center;
|
|
4254
4254
|
width: 100%;
|
|
4255
4255
|
height: 100%;
|
|
4256
|
-
|
|
4257
|
-
border-radius: 2px;
|
|
4258
|
-
cursor: pointer;
|
|
4256
|
+
background-color: rgba(0, 0, 0, 0.5);
|
|
4259
4257
|
}
|
|
4260
|
-
.thumb-
|
|
4258
|
+
.thumb-upload-loading .arco-progress-circle-text {
|
|
4259
|
+
color: #fff;
|
|
4260
|
+
}
|
|
4261
|
+
.thumb-upload-loading .thumb-upload-text {
|
|
4262
|
+
color: #fff;
|
|
4263
|
+
}
|
|
4264
|
+
.thumb-upload-loading .thumb-upload-text-success {
|
|
4265
|
+
color: rgb(var(--success-2));
|
|
4266
|
+
}
|
|
4267
|
+
.thumb-upload-loading .thumb-upload-text-error {
|
|
4268
|
+
color: rgb(var(--danger-6));
|
|
4269
|
+
}
|
|
4270
|
+
.thumb-select-wrapper {
|
|
4271
|
+
position: relative;
|
|
4261
4272
|
display: flex;
|
|
4262
|
-
flex-direction: column;
|
|
4263
4273
|
align-items: center;
|
|
4264
4274
|
justify-content: center;
|
|
4265
4275
|
width: 100%;
|
|
4266
4276
|
height: 100%;
|
|
4267
|
-
|
|
4268
|
-
|
|
4269
|
-
|
|
4270
|
-
.thumb-select-wrapper .thumb-upload-loading .arco-progress-circle-text {
|
|
4271
|
-
color: #fff;
|
|
4277
|
+
overflow: hidden;
|
|
4278
|
+
border-radius: 2px;
|
|
4279
|
+
cursor: pointer;
|
|
4272
4280
|
}
|
|
4273
4281
|
.thumb-select-wrapper .thumb-image img {
|
|
4274
4282
|
width: 100%;
|
|
@@ -4288,6 +4296,9 @@
|
|
|
4288
4296
|
opacity: 0;
|
|
4289
4297
|
transition: all 0.3s ease-in-out;
|
|
4290
4298
|
}
|
|
4299
|
+
.thumb-select-wrapper .thumb-handler-list.thumb-handler-always {
|
|
4300
|
+
opacity: 1 !important;
|
|
4301
|
+
}
|
|
4291
4302
|
.thumb-select-wrapper .thumb-handler-list .handler-item {
|
|
4292
4303
|
padding: 0 8px;
|
|
4293
4304
|
color: #fff;
|
|
@@ -4463,6 +4474,8 @@
|
|
|
4463
4474
|
.card-wrapper-image {
|
|
4464
4475
|
position: relative;
|
|
4465
4476
|
overflow: hidden;
|
|
4477
|
+
user-select: none;
|
|
4478
|
+
-webkit-user-drag: none;
|
|
4466
4479
|
}
|
|
4467
4480
|
.card-wrapper-image .card-wrapper {
|
|
4468
4481
|
position: relative;
|
|
@@ -4471,9 +4484,13 @@
|
|
|
4471
4484
|
transition: all 0.3s ease-in-out;
|
|
4472
4485
|
aspect-ratio: 4 / 3;
|
|
4473
4486
|
}
|
|
4474
|
-
.card-wrapper-image .card-wrapper.disable:not(.active) {
|
|
4487
|
+
.card-wrapper-image .card-wrapper.disable:not(.active) .thumb-image {
|
|
4488
|
+
cursor: not-allowed;
|
|
4475
4489
|
opacity: 0.4;
|
|
4476
4490
|
}
|
|
4491
|
+
.card-wrapper-image .card-wrapper.disable:not(.active) .thumb-upload-loading {
|
|
4492
|
+
cursor: not-allowed;
|
|
4493
|
+
}
|
|
4477
4494
|
.card-wrapper-image .card-wrapper .mask {
|
|
4478
4495
|
position: absolute;
|
|
4479
4496
|
top: 0;
|
|
@@ -18,7 +18,7 @@ const _sfc_main = defineComponent({
|
|
|
18
18
|
selectKeys: {},
|
|
19
19
|
disable: { type: Boolean }
|
|
20
20
|
},
|
|
21
|
-
emits: ["select", "select-one"],
|
|
21
|
+
emits: ["select", "select-one", "options"],
|
|
22
22
|
setup(__props, { emit: __emit }) {
|
|
23
23
|
const props = __props;
|
|
24
24
|
const emits = __emit;
|
|
@@ -31,17 +31,6 @@ const _sfc_main = defineComponent({
|
|
|
31
31
|
});
|
|
32
32
|
return result;
|
|
33
33
|
});
|
|
34
|
-
function handleCheck() {
|
|
35
|
-
if (props.disable && !selectedOrder.value[props.item.id])
|
|
36
|
-
return;
|
|
37
|
-
emits("select", props.item);
|
|
38
|
-
}
|
|
39
|
-
function handleOption(params) {
|
|
40
|
-
const { key, item } = params;
|
|
41
|
-
if (key === "select") {
|
|
42
|
-
emits("select-one", item);
|
|
43
|
-
}
|
|
44
|
-
}
|
|
45
34
|
const canIUse = computed(() => {
|
|
46
35
|
if (props.disable)
|
|
47
36
|
return false;
|
|
@@ -56,10 +45,25 @@ const _sfc_main = defineComponent({
|
|
|
56
45
|
});
|
|
57
46
|
const handlersKey = computed(() => {
|
|
58
47
|
var _a;
|
|
59
|
-
if (
|
|
48
|
+
if (props.item.status === 2) {
|
|
49
|
+
return [
|
|
50
|
+
{ label: "\u91CD\u65B0\u4E0A\u4F20", key: "reupload" },
|
|
51
|
+
{ label: "\u5220\u9664\u8BB0\u5F55", key: "remove" }
|
|
52
|
+
];
|
|
53
|
+
}
|
|
54
|
+
if (props.item.status === 3) {
|
|
55
|
+
return [{ label: "\u91CD\u65B0\u8F6C\u7801", key: "retranscode" }];
|
|
56
|
+
}
|
|
57
|
+
if (((_a = props.selectKeys) == null ? void 0 : _a.length) > 0 || props.disable || !canIUse.value) {
|
|
60
58
|
return [];
|
|
61
|
-
|
|
59
|
+
}
|
|
60
|
+
return [{ label: "\u9009\u7528", key: "select-one" }].concat(props.extraKeys || []);
|
|
62
61
|
});
|
|
62
|
+
function handleCheck() {
|
|
63
|
+
if (!canIUse.value && !selectedOrder.value[props.item.id])
|
|
64
|
+
return;
|
|
65
|
+
emits("select", props.item);
|
|
66
|
+
}
|
|
63
67
|
return (_ctx, _cache) => {
|
|
64
68
|
return openBlock(), createElementBlock("div", {
|
|
65
69
|
class: "card-wrapper-image",
|
|
@@ -78,7 +82,7 @@ const _sfc_main = defineComponent({
|
|
|
78
82
|
},
|
|
79
83
|
"use-mask": true,
|
|
80
84
|
"handlers-key": handlersKey.value,
|
|
81
|
-
onHandle:
|
|
85
|
+
onHandle: _cache[0] || (_cache[0] = (e) => emits("options", e))
|
|
82
86
|
}, null, 8, ["url", "thumb", "catalog", "meta", "options", "handlers-key"]),
|
|
83
87
|
_hoisted_1
|
|
84
88
|
], 2),
|
|
@@ -14,6 +14,9 @@ const _sfc_main = defineComponent({
|
|
|
14
14
|
emits: ["select", "select-one"],
|
|
15
15
|
setup(__props, { emit: __emit }) {
|
|
16
16
|
const emits = __emit;
|
|
17
|
+
function handleOptions(e) {
|
|
18
|
+
emits(e.key, e.item);
|
|
19
|
+
}
|
|
17
20
|
return (_ctx, _cache) => {
|
|
18
21
|
var _a, _b;
|
|
19
22
|
return openBlock(), createElementBlock("div", _hoisted_1, [
|
|
@@ -24,8 +27,8 @@ const _sfc_main = defineComponent({
|
|
|
24
27
|
"select-keys": _ctx.selectKeys,
|
|
25
28
|
disable: _ctx.disable,
|
|
26
29
|
onSelect: () => emits("select", item),
|
|
27
|
-
|
|
28
|
-
}, null, 8, ["item", "select-keys", "disable", "onSelect"
|
|
30
|
+
onOptions: handleOptions
|
|
31
|
+
}, null, 8, ["item", "select-keys", "disable", "onSelect"]);
|
|
29
32
|
}), 128)),
|
|
30
33
|
createCommentVNode(" \u7A7A\u72B6\u6001 "),
|
|
31
34
|
((_a = _ctx.list) == null ? void 0 : _a.length) === 0 && _ctx.loading ? (openBlock(), createBlock(unref(Spin), {
|
|
@@ -16,7 +16,7 @@ const _sfc_main = defineComponent({
|
|
|
16
16
|
selectKeys: {},
|
|
17
17
|
disable: { type: Boolean }
|
|
18
18
|
},
|
|
19
|
-
emits: ["select", "select-one"],
|
|
19
|
+
emits: ["select", "select-one", "reupload"],
|
|
20
20
|
setup(__props, { emit: __emit }) {
|
|
21
21
|
const emits = __emit;
|
|
22
22
|
const userInfo = inject("userInfo");
|
|
@@ -25,7 +25,7 @@ const _sfc_main = defineComponent({
|
|
|
25
25
|
var _a;
|
|
26
26
|
return (_a = userInfo == null ? void 0 : userInfo.value) == null ? void 0 : _a.repository_id;
|
|
27
27
|
});
|
|
28
|
-
const { list, uploadFile, transcodingFile } = useUpload();
|
|
28
|
+
const { list, uploadFile, transcodingFile, removeRecord } = useUpload();
|
|
29
29
|
function handleChange(file) {
|
|
30
30
|
if (!baseAPI || !repoId.value)
|
|
31
31
|
return;
|
|
@@ -37,6 +37,30 @@ const _sfc_main = defineComponent({
|
|
|
37
37
|
(media) => transcodingFile(baseAPI, media)
|
|
38
38
|
);
|
|
39
39
|
}
|
|
40
|
+
function handleOptions(e) {
|
|
41
|
+
var _a, _b;
|
|
42
|
+
if (e.key === "reupload") {
|
|
43
|
+
if (!e.item || !((_a = e.item) == null ? void 0 : _a.originFile))
|
|
44
|
+
return;
|
|
45
|
+
e.item.originFile.sig_id = e.item.sig_id;
|
|
46
|
+
e.item.originFile.id = e.item.id;
|
|
47
|
+
handleChange({ file: e.item.originFile });
|
|
48
|
+
return;
|
|
49
|
+
}
|
|
50
|
+
if (e.key === "retranscode") {
|
|
51
|
+
if (!baseAPI || !((_b = e.item) == null ? void 0 : _b.mediaFile))
|
|
52
|
+
return;
|
|
53
|
+
transcodingFile(baseAPI, e.item.mediaFile);
|
|
54
|
+
return;
|
|
55
|
+
}
|
|
56
|
+
if (e.key === "remove") {
|
|
57
|
+
if (!e.item)
|
|
58
|
+
return;
|
|
59
|
+
removeRecord(e.item);
|
|
60
|
+
return;
|
|
61
|
+
}
|
|
62
|
+
emits(e.key, e.item);
|
|
63
|
+
}
|
|
40
64
|
return (_ctx, _cache) => {
|
|
41
65
|
var _a, _b;
|
|
42
66
|
return openBlock(), createElementBlock("div", _hoisted_1, [
|
|
@@ -55,8 +79,8 @@ const _sfc_main = defineComponent({
|
|
|
55
79
|
"select-keys": _ctx.selectKeys,
|
|
56
80
|
disable: _ctx.disable,
|
|
57
81
|
onSelect: () => emits("select", item),
|
|
58
|
-
|
|
59
|
-
}, null, 8, ["item", "select-keys", "disable", "onSelect"
|
|
82
|
+
onOptions: handleOptions
|
|
83
|
+
}, null, 8, ["item", "select-keys", "disable", "onSelect"]);
|
|
60
84
|
}), 128))
|
|
61
85
|
])
|
|
62
86
|
])
|
|
@@ -74,8 +74,18 @@ const _sfc_main = defineComponent({
|
|
|
74
74
|
set(val) {
|
|
75
75
|
if (val) {
|
|
76
76
|
const [start, end] = val;
|
|
77
|
-
|
|
78
|
-
|
|
77
|
+
const created_begin = new Date(start);
|
|
78
|
+
const created_end = new Date(end);
|
|
79
|
+
created_begin.setHours(0, 0, 0, 0);
|
|
80
|
+
created_end.setHours(23, 59, 59, 0);
|
|
81
|
+
filter.value.created_begin = parseInt(
|
|
82
|
+
(created_begin.getTime() / 1e3).toFixed(0),
|
|
83
|
+
10
|
|
84
|
+
);
|
|
85
|
+
filter.value.created_end = parseInt(
|
|
86
|
+
(created_end.getTime() / 1e3).toFixed(0),
|
|
87
|
+
10
|
|
88
|
+
);
|
|
79
89
|
} else {
|
|
80
90
|
filter.value.created_begin = "";
|
|
81
91
|
filter.value.created_end = "";
|
|
@@ -135,6 +135,8 @@
|
|
|
135
135
|
.card-wrapper-image {
|
|
136
136
|
position: relative;
|
|
137
137
|
overflow: hidden;
|
|
138
|
+
user-select: none;
|
|
139
|
+
-webkit-user-drag: none;
|
|
138
140
|
}
|
|
139
141
|
.card-wrapper-image .card-wrapper {
|
|
140
142
|
position: relative;
|
|
@@ -143,9 +145,13 @@
|
|
|
143
145
|
transition: all 0.3s ease-in-out;
|
|
144
146
|
aspect-ratio: 4 / 3;
|
|
145
147
|
}
|
|
146
|
-
.card-wrapper-image .card-wrapper.disable:not(.active) {
|
|
148
|
+
.card-wrapper-image .card-wrapper.disable:not(.active) .thumb-image {
|
|
149
|
+
cursor: not-allowed;
|
|
147
150
|
opacity: 0.4;
|
|
148
151
|
}
|
|
152
|
+
.card-wrapper-image .card-wrapper.disable:not(.active) .thumb-upload-loading {
|
|
153
|
+
cursor: not-allowed;
|
|
154
|
+
}
|
|
149
155
|
.card-wrapper-image .card-wrapper .mask {
|
|
150
156
|
position: absolute;
|
|
151
157
|
top: 0;
|
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
.card-wrapper-image {
|
|
2
2
|
position: relative;
|
|
3
3
|
overflow: hidden;
|
|
4
|
+
user-select: none;
|
|
5
|
+
-webkit-user-drag: none;
|
|
4
6
|
|
|
5
7
|
.card-wrapper {
|
|
6
8
|
position: relative;
|
|
@@ -11,7 +13,15 @@
|
|
|
11
13
|
aspect-ratio: 4 / 3;
|
|
12
14
|
|
|
13
15
|
&.disable:not(.active) {
|
|
14
|
-
|
|
16
|
+
// disabled 下禁用
|
|
17
|
+
.thumb-image {
|
|
18
|
+
cursor: not-allowed;
|
|
19
|
+
opacity: 0.4;
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
.thumb-upload-loading {
|
|
23
|
+
cursor: not-allowed;
|
|
24
|
+
}
|
|
15
25
|
}
|
|
16
26
|
|
|
17
27
|
.mask {
|
|
@@ -1,23 +1,15 @@
|
|
|
1
|
-
import { defineComponent, computed, openBlock, createElementBlock, normalizeClass, normalizeStyle,
|
|
1
|
+
import { defineComponent, computed, openBlock, createElementBlock, normalizeClass, normalizeStyle, createBlock, Fragment, createCommentVNode, unref, mergeProps, createTextVNode, toDisplayString, createElementVNode, renderList, withModifiers, renderSlot } from "vue";
|
|
2
2
|
import { IconVideoTag, IconAudioTag } from "@arco-iconbox/vue-cmstop-icons";
|
|
3
|
-
import {
|
|
3
|
+
import { Image } from "@arco-design/web-vue";
|
|
4
4
|
import magic from "./assets/magic.js";
|
|
5
5
|
import { DEFAULT_BASE_API } from "../config.js";
|
|
6
6
|
import { mediaTime } from "../utils/index.js";
|
|
7
|
+
import _sfc_main$1 from "./components/ThumbUploading/index.js";
|
|
7
8
|
const _hoisted_1 = {
|
|
8
|
-
key: 0,
|
|
9
|
-
class: "thumb-upload-loading"
|
|
10
|
-
};
|
|
11
|
-
const _hoisted_2 = {
|
|
12
|
-
key: 0,
|
|
13
|
-
class: "thumb-upload-text"
|
|
14
|
-
};
|
|
15
|
-
const _hoisted_3 = { class: "thumb-handler-list" };
|
|
16
|
-
const _hoisted_4 = ["onClick"];
|
|
17
|
-
const _hoisted_5 = {
|
|
18
9
|
key: 2,
|
|
19
10
|
class: "thumb-select-tag"
|
|
20
11
|
};
|
|
12
|
+
const _hoisted_2 = ["onClick"];
|
|
21
13
|
const _sfc_main = defineComponent({
|
|
22
14
|
...{ name: "thumbCard" },
|
|
23
15
|
__name: "component",
|
|
@@ -29,7 +21,8 @@ const _sfc_main = defineComponent({
|
|
|
29
21
|
options: {},
|
|
30
22
|
meta: {},
|
|
31
23
|
catalog: {},
|
|
32
|
-
handlersKey: {}
|
|
24
|
+
handlersKey: {},
|
|
25
|
+
handlersAlways: { type: Boolean }
|
|
33
26
|
},
|
|
34
27
|
emits: ["handle", "edit"],
|
|
35
28
|
setup(__props, { emit: __emit }) {
|
|
@@ -61,6 +54,13 @@ const _sfc_main = defineComponent({
|
|
|
61
54
|
}
|
|
62
55
|
return list;
|
|
63
56
|
});
|
|
57
|
+
const thumbHandlerClass = computed(() => {
|
|
58
|
+
const list = [];
|
|
59
|
+
if (props.handlersAlways) {
|
|
60
|
+
list.push("thumb-handler-always");
|
|
61
|
+
}
|
|
62
|
+
return list;
|
|
63
|
+
});
|
|
64
64
|
const aImageAttr = computed(() => {
|
|
65
65
|
return {
|
|
66
66
|
fit: "contain",
|
|
@@ -74,40 +74,41 @@ const _sfc_main = defineComponent({
|
|
|
74
74
|
emits("handle", { key, item: props.meta });
|
|
75
75
|
}
|
|
76
76
|
return (_ctx, _cache) => {
|
|
77
|
-
var _a
|
|
77
|
+
var _a;
|
|
78
78
|
return openBlock(), createElementBlock("div", {
|
|
79
79
|
class: normalizeClass(["thumb-select-wrapper", classList.value]),
|
|
80
80
|
style: normalizeStyle(styleObject.value)
|
|
81
81
|
}, [
|
|
82
|
-
isUploading.value ? (openBlock(),
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
}, null, 8, ["percent"]),
|
|
87
|
-
((_b = _ctx.meta) == null ? void 0 : _b.isTrans) ? (openBlock(), createElementBlock("div", _hoisted_2, "\u8F6C\u7801\u4E2D...")) : createCommentVNode("v-if", true)
|
|
88
|
-
])) : _ctx.catalog && _ctx.url ? (openBlock(), createElementBlock(Fragment, { key: 1 }, [
|
|
82
|
+
isUploading.value ? (openBlock(), createBlock(_sfc_main$1, {
|
|
83
|
+
key: 0,
|
|
84
|
+
meta: _ctx.meta
|
|
85
|
+
}, null, 8, ["meta"])) : _ctx.catalog && _ctx.url ? (openBlock(), createElementBlock(Fragment, { key: 1 }, [
|
|
89
86
|
createCommentVNode(" \u6709\u7C7B\u578B\u7684\u5C01\u9762 "),
|
|
90
87
|
createCommentVNode(" \u56FE\u7247 "),
|
|
91
88
|
_ctx.catalog ? (openBlock(), createBlock(unref(Image), mergeProps({
|
|
92
89
|
key: 0,
|
|
93
90
|
class: "thumb-image",
|
|
94
91
|
src: realThumb.value
|
|
95
|
-
}, aImageAttr.value), null, 16, ["src"])) : createCommentVNode("v-if", true)
|
|
96
|
-
createCommentVNode(" \u5C55\u793A\u6A21\u5F0F "),
|
|
97
|
-
createElementVNode("div", _hoisted_3, [
|
|
98
|
-
(openBlock(true), createElementBlock(Fragment, null, renderList(_ctx.handlersKey, (item) => {
|
|
99
|
-
return openBlock(), createElementBlock("div", {
|
|
100
|
-
key: item.key,
|
|
101
|
-
class: "handler-item",
|
|
102
|
-
onClick: withModifiers(() => handleOption(item.key), ["stop"])
|
|
103
|
-
}, toDisplayString(item.label), 9, _hoisted_4);
|
|
104
|
-
}), 128))
|
|
105
|
-
])
|
|
92
|
+
}, aImageAttr.value), null, 16, ["src"])) : createCommentVNode("v-if", true)
|
|
106
93
|
], 64)) : createCommentVNode("v-if", true),
|
|
107
|
-
|
|
94
|
+
createCommentVNode(" \u4E00\u4E9B\u6807\u7B7E\uFF08\u56DB\u4E2A\u89D2\uFF09 "),
|
|
95
|
+
["video", "audio"].includes(_ctx.catalog) && _ctx.meta ? (openBlock(), createElementBlock("div", _hoisted_1, [
|
|
108
96
|
_ctx.catalog === "video" ? (openBlock(), createBlock(unref(IconVideoTag), { key: 0 })) : (openBlock(), createBlock(unref(IconAudioTag), { key: 1 })),
|
|
109
|
-
createTextVNode(" " + toDisplayString(unref(mediaTime)((
|
|
110
|
-
])) : createCommentVNode("v-if", true)
|
|
97
|
+
createTextVNode(" " + toDisplayString(unref(mediaTime)((_a = _ctx.meta) == null ? void 0 : _a.length)), 1)
|
|
98
|
+
])) : createCommentVNode("v-if", true),
|
|
99
|
+
createCommentVNode(" \u5916\u6302\u9009\u9879 "),
|
|
100
|
+
createElementVNode("div", {
|
|
101
|
+
class: normalizeClass(["thumb-handler-list", thumbHandlerClass.value])
|
|
102
|
+
}, [
|
|
103
|
+
(openBlock(true), createElementBlock(Fragment, null, renderList(_ctx.handlersKey, (item) => {
|
|
104
|
+
return openBlock(), createElementBlock("div", {
|
|
105
|
+
key: item.key,
|
|
106
|
+
class: "handler-item",
|
|
107
|
+
onClick: withModifiers(() => handleOption(item.key), ["stop"])
|
|
108
|
+
}, toDisplayString(item.label), 9, _hoisted_2);
|
|
109
|
+
}), 128)),
|
|
110
|
+
renderSlot(_ctx.$slots, "handlers")
|
|
111
|
+
], 2)
|
|
111
112
|
], 6);
|
|
112
113
|
};
|
|
113
114
|
}
|
|
File without changes
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
import { defineComponent, computed, openBlock, createElementBlock, createBlock, unref, createCommentVNode, normalizeClass, toDisplayString } from "vue";
|
|
2
|
+
import { Progress } from "@arco-design/web-vue";
|
|
3
|
+
const _hoisted_1 = { class: "thumb-upload-loading" };
|
|
4
|
+
const _sfc_main = defineComponent({
|
|
5
|
+
__name: "index",
|
|
6
|
+
props: {
|
|
7
|
+
meta: {}
|
|
8
|
+
},
|
|
9
|
+
setup(__props) {
|
|
10
|
+
const props = __props;
|
|
11
|
+
const isFaild = computed(() => {
|
|
12
|
+
return [2, 3].includes(props.meta.status);
|
|
13
|
+
});
|
|
14
|
+
const isSuccess = computed(() => {
|
|
15
|
+
return [0].includes(props.meta.status);
|
|
16
|
+
});
|
|
17
|
+
const textStatusClass = computed(() => {
|
|
18
|
+
if (isFaild.value) {
|
|
19
|
+
return "thumb-upload-text-error";
|
|
20
|
+
}
|
|
21
|
+
if (isSuccess.value) {
|
|
22
|
+
return "thumb-upload-text-success";
|
|
23
|
+
}
|
|
24
|
+
return "";
|
|
25
|
+
});
|
|
26
|
+
return (_ctx, _cache) => {
|
|
27
|
+
var _a, _b;
|
|
28
|
+
return openBlock(), createElementBlock("div", _hoisted_1, [
|
|
29
|
+
!isFaild.value ? (openBlock(), createBlock(unref(Progress), {
|
|
30
|
+
key: 0,
|
|
31
|
+
type: "circle",
|
|
32
|
+
percent: (_a = _ctx.meta) == null ? void 0 : _a.progress
|
|
33
|
+
}, null, 8, ["percent"])) : createCommentVNode("v-if", true),
|
|
34
|
+
_ctx.meta.msg ? (openBlock(), createElementBlock("div", {
|
|
35
|
+
key: 1,
|
|
36
|
+
class: normalizeClass(["thumb-upload-text", textStatusClass.value])
|
|
37
|
+
}, toDisplayString((_b = _ctx.meta) == null ? void 0 : _b.msg), 3)) : createCommentVNode("v-if", true)
|
|
38
|
+
]);
|
|
39
|
+
};
|
|
40
|
+
}
|
|
41
|
+
});
|
|
42
|
+
export { _sfc_main as default };
|