@cmstops/pro-compo 0.3.42 → 0.3.44
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 +38 -2
- package/dist/index.min.css +1 -1
- package/es/docHistory/component.js +45 -38
- package/es/docHistory/scripts/useDocHistory.js +1 -1
- package/es/hooks/useAttachement.d.ts +5 -0
- package/es/hooks/useLocalStorage.d.ts +8 -0
- package/es/hooks/useUpload.d.ts +2 -1
- package/es/hooks/useUpload.js +42 -9
- package/es/index.css +38 -2
- package/es/selectResourceModal/components/ListCardWrapper/index.js +9 -7
- package/es/selectResourceModal/components/ListContentLocal/index.js +15 -9
- package/es/selectResourceModal/components/ListSelected/index.js +19 -6
- package/es/selectResourceModal/components/Main/index.js +1 -1
- package/es/selectResourceModal/style/index.css +30 -1
- package/es/selectResourceModal/style/listCardWrapper.less +25 -1
- package/es/selectResourceModal/style/listSelected.less +9 -0
- package/es/thumbCard/component.js +21 -13
- package/es/thumbCard/style/index.css +8 -1
- package/es/thumbCard/style/index.less +8 -1
- package/es/utils/transcodeMedia.d.ts +13 -0
- package/es/utils/transcodeMedia.js +46 -0
- package/lib/docHistory/component.js +44 -37
- package/lib/docHistory/scripts/useDocHistory.js +1 -1
- package/lib/hooks/useUpload.js +42 -9
- package/lib/index.css +38 -2
- package/lib/selectResourceModal/components/ListCardWrapper/index.js +9 -7
- package/lib/selectResourceModal/components/ListContentLocal/index.js +14 -8
- package/lib/selectResourceModal/components/ListSelected/index.js +18 -5
- package/lib/selectResourceModal/components/Main/index.js +1 -1
- package/lib/selectResourceModal/style/index.css +30 -1
- package/lib/selectResourceModal/style/listCardWrapper.less +25 -1
- package/lib/selectResourceModal/style/listSelected.less +9 -0
- package/lib/thumbCard/component.js +19 -11
- package/lib/thumbCard/style/index.css +8 -1
- package/lib/thumbCard/style/index.less +8 -1
- package/lib/utils/transcodeMedia.js +49 -0
- package/package.json +2 -2
|
@@ -1,9 +1,10 @@
|
|
|
1
|
-
import { defineComponent, computed, onMounted, openBlock, createBlock, unref, withCtx, createElementVNode, createVNode, createCommentVNode } from "vue";
|
|
1
|
+
import { defineComponent, computed, onMounted, openBlock, createBlock, unref, withCtx, createElementVNode, createElementBlock, Fragment, createVNode, createCommentVNode } from "vue";
|
|
2
2
|
import { Drawer, Spin, Scrollbar } from "@arco-design/web-vue";
|
|
3
3
|
import { DEFAULT_BASE_API } from "../config.js";
|
|
4
4
|
import { useDocHistory } from "./scripts/useDocHistory.js";
|
|
5
5
|
import _sfc_main$2 from "./components/DocHistoryList/index.js";
|
|
6
6
|
import _sfc_main$1 from "./components/DocDiffPanel/index.js";
|
|
7
|
+
import emptyData from "../emptyData/index.js";
|
|
7
8
|
const _hoisted_1 = { class: "doc-history-wrap" };
|
|
8
9
|
const _hoisted_2 = { class: "doc-diff-panel" };
|
|
9
10
|
const _hoisted_3 = { class: "doc-history-list" };
|
|
@@ -53,43 +54,49 @@ const _sfc_main = defineComponent({
|
|
|
53
54
|
}, {
|
|
54
55
|
default: withCtx(() => [
|
|
55
56
|
createElementVNode("div", _hoisted_1, [
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
57
|
+
unref(list).length ? (openBlock(), createElementBlock(Fragment, { key: 0 }, [
|
|
58
|
+
createElementVNode("div", _hoisted_2, [
|
|
59
|
+
createVNode(unref(Spin), {
|
|
60
|
+
loading: unref(loading),
|
|
61
|
+
style: { "height": "100%", "width": "100%" }
|
|
62
|
+
}, {
|
|
63
|
+
default: withCtx(() => [
|
|
64
|
+
createVNode(unref(Scrollbar), {
|
|
65
|
+
"outer-style": { height: "100%" },
|
|
66
|
+
style: { "height": "100%", "overflow": "auto" }
|
|
67
|
+
}, {
|
|
68
|
+
default: withCtx(() => [
|
|
69
|
+
unref(diffContent) ? (openBlock(), createBlock(_sfc_main$1, {
|
|
70
|
+
key: 0,
|
|
71
|
+
doc: unref(diffContent)
|
|
72
|
+
}, null, 8, ["doc"])) : createCommentVNode("v-if", true)
|
|
73
|
+
]),
|
|
74
|
+
_: 1
|
|
75
|
+
})
|
|
76
|
+
]),
|
|
77
|
+
_: 1
|
|
78
|
+
}, 8, ["loading"])
|
|
79
|
+
]),
|
|
80
|
+
createElementVNode("div", _hoisted_3, [
|
|
81
|
+
createVNode(unref(Scrollbar), {
|
|
82
|
+
"outer-style": { height: "100%" },
|
|
83
|
+
style: { "height": "100%", "overflow": "auto" }
|
|
84
|
+
}, {
|
|
85
|
+
default: withCtx(() => [
|
|
86
|
+
createVNode(_sfc_main$2, {
|
|
87
|
+
list: unref(list),
|
|
88
|
+
current: unref(current),
|
|
89
|
+
onSelect: unref(handleSelect)
|
|
90
|
+
}, null, 8, ["list", "current", "onSelect"])
|
|
91
|
+
]),
|
|
92
|
+
_: 1
|
|
93
|
+
})
|
|
94
|
+
])
|
|
95
|
+
], 64)) : (openBlock(), createBlock(unref(emptyData), {
|
|
96
|
+
key: 1,
|
|
97
|
+
type: "empty",
|
|
98
|
+
"custom-tip": "\u6682\u65E0\u5386\u53F2\u8BB0\u5F55"
|
|
99
|
+
}))
|
|
93
100
|
])
|
|
94
101
|
]),
|
|
95
102
|
_: 1
|
|
@@ -17,4 +17,9 @@ export default function useAttachement(options: OptionsType): {
|
|
|
17
17
|
changeSize: (s: number) => void;
|
|
18
18
|
loadData: () => Promise<void>;
|
|
19
19
|
};
|
|
20
|
+
export declare function useLocalRecource(): {
|
|
21
|
+
localList: import("vue").Ref<any[]>;
|
|
22
|
+
initLocalList: () => void;
|
|
23
|
+
setLocalList: (list: any[]) => void;
|
|
24
|
+
};
|
|
20
25
|
export {};
|
package/es/hooks/useUpload.d.ts
CHANGED
|
@@ -11,5 +11,6 @@ export declare function addMedia(BASE_API: string, params: TypeAddMediaParam): i
|
|
|
11
11
|
export default function useUpload(): {
|
|
12
12
|
list: import("vue").Ref<any[]>;
|
|
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
|
+
recordTaskStatusChange: (file: any, progress: number, isTrans?: boolean | undefined) => void;
|
|
15
16
|
};
|
package/es/hooks/useUpload.js
CHANGED
|
@@ -2,6 +2,7 @@ import { ref } from "vue";
|
|
|
2
2
|
import { generateUUID } from "../utils/index.js";
|
|
3
3
|
import { TusUploadTask } from "../utils/tusUpload.js";
|
|
4
4
|
import request from "../utils/request.js";
|
|
5
|
+
import { TranscodingTask } from "../utils/transcodeMedia.js";
|
|
5
6
|
function addMedia(BASE_API, params) {
|
|
6
7
|
return request(BASE_API, {
|
|
7
8
|
url: "/poplar/v2/media/add",
|
|
@@ -21,13 +22,15 @@ function useUpload() {
|
|
|
21
22
|
list.value = originList;
|
|
22
23
|
}
|
|
23
24
|
}
|
|
24
|
-
function recordTaskStatusChange(file, progress) {
|
|
25
|
+
function recordTaskStatusChange(file, progress, isTrans) {
|
|
25
26
|
const originList = list.value;
|
|
26
27
|
const taskIndex = originList.findIndex((task) => task.id === file.id);
|
|
27
28
|
if (taskIndex !== -1) {
|
|
28
|
-
progress !== -1 && (originList[taskIndex].progress = progress);
|
|
29
|
+
progress !== -1 && (originList[taskIndex].progress = Math.round(progress));
|
|
29
30
|
file.status != null && (originList[taskIndex].status = file.status);
|
|
30
31
|
file.msg != null && (originList[taskIndex].msg = file.msg);
|
|
32
|
+
if (isTrans)
|
|
33
|
+
originList[taskIndex].isTrans = true;
|
|
31
34
|
originList[taskIndex].url = file.url;
|
|
32
35
|
} else {
|
|
33
36
|
file.created_at = new Date().getTime();
|
|
@@ -64,24 +67,54 @@ function useUpload() {
|
|
|
64
67
|
});
|
|
65
68
|
if (code !== 0) {
|
|
66
69
|
console.log("\u{1F525}\u{1F525}\u{1F525}\u{1F525}\u{1F525} \u4E0A\u4F20\u5931\u8D25\uFF1A", newFile.name, code, message);
|
|
67
|
-
recordTaskStatusChange({ ...newFile, status: 2, msg: "\
|
|
70
|
+
recordTaskStatusChange({ ...newFile, status: 2, msg: "\u4E0A\u4F20\u5931\u8D25" }, -1);
|
|
68
71
|
return;
|
|
69
72
|
}
|
|
70
|
-
console.log("\u{1F680}\u{1F680}\u{1F680}\u{1F680}\u{1F680}\u{1F680} \u4E0A\u4F20\u6210\u529F\uFF1A", url);
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
uploadSuccess({ ...message, sig_id: newFile.sig_id });
|
|
74
|
-
}
|
|
73
|
+
console.log("\u{1F680}\u{1F680}\u{1F680}\u{1F680}\u{1F680}\u{1F680} \u4E0A\u4F20\u6210\u529F\uFF1A", url, message);
|
|
74
|
+
if (!["video", "audio"].includes(message.catalog)) {
|
|
75
|
+
recordTaskStatusChange({ ...newFile, url: message.url, status: 0 }, 1);
|
|
76
|
+
setTimeout(() => uploadSuccess({ ...message, sig_id: newFile.sig_id }), 200);
|
|
77
|
+
} else {
|
|
78
|
+
recordTaskStatusChange(newFile, 0);
|
|
79
|
+
}
|
|
75
80
|
callback && callback({ ...message, sig_id: newFile.sig_id }, "success");
|
|
76
81
|
}).catch((e) => {
|
|
77
82
|
console.log("\u{1F525}\u{1F525}\u{1F525}\u{1F525}\u{1F525} \u4E0A\u4F20\u5931\u8D25\uFF1A", e);
|
|
78
|
-
recordTaskStatusChange({ ...newFile, status: 2, msg: "\
|
|
83
|
+
recordTaskStatusChange({ ...newFile, status: 2, msg: "\u5931\u8D25" }, -1);
|
|
79
84
|
callback && callback(newFile, "fail");
|
|
80
85
|
});
|
|
81
86
|
};
|
|
87
|
+
const transcodingFile = (BASE_API, file) => {
|
|
88
|
+
if (!["video", "audio"].includes(file.catalog))
|
|
89
|
+
return;
|
|
90
|
+
const task = new TranscodingTask(file);
|
|
91
|
+
const idx = list.value.findIndex(
|
|
92
|
+
(item2) => item2.sig_id === file.sig_id
|
|
93
|
+
);
|
|
94
|
+
if (idx === -1)
|
|
95
|
+
return;
|
|
96
|
+
const item = list.value[idx];
|
|
97
|
+
recordTaskStatusChange(item, 0, true);
|
|
98
|
+
const progress = (progress2) => recordTaskStatusChange(item, progress2);
|
|
99
|
+
const transing = task.start(BASE_API, progress);
|
|
100
|
+
transing.then((res) => {
|
|
101
|
+
if (res) {
|
|
102
|
+
console.log("\u{1F680}\u{1F680}\u{1F680}\u{1F680}\u{1F680}\u{1F680} \u8F6C\u7801\u6210\u529F");
|
|
103
|
+
recordTaskStatusChange({ ...item, status: 0 }, 1);
|
|
104
|
+
setTimeout(() => uploadSuccess(file), 200);
|
|
105
|
+
} else {
|
|
106
|
+
console.log("\u{1F525}\u{1F525}\u{1F525}\u{1F525}\u{1F525} \u8F6C\u7801\u5931\u8D25\uFF1A", item);
|
|
107
|
+
recordTaskStatusChange({ ...item, status: 2, msg: "\u8F6C\u7801\u5931\u8D25" }, -1);
|
|
108
|
+
}
|
|
109
|
+
}).catch((e) => {
|
|
110
|
+
console.log("\u{1F525}\u{1F525}\u{1F525}\u{1F525}\u{1F525} \u8F6C\u7801\u5931\u8D25", e);
|
|
111
|
+
recordTaskStatusChange({ ...item, status: 2, msg: "\u8F6C\u7801\u5931\u8D25" }, -1);
|
|
112
|
+
});
|
|
113
|
+
};
|
|
82
114
|
return {
|
|
83
115
|
list,
|
|
84
116
|
uploadFile,
|
|
117
|
+
transcodingFile,
|
|
85
118
|
recordTaskStatusChange
|
|
86
119
|
};
|
|
87
120
|
}
|
package/es/index.css
CHANGED
|
@@ -4256,6 +4256,7 @@
|
|
|
4256
4256
|
}
|
|
4257
4257
|
.thumb-select-wrapper .thumb-upload-loading {
|
|
4258
4258
|
display: flex;
|
|
4259
|
+
flex-direction: column;
|
|
4259
4260
|
align-items: center;
|
|
4260
4261
|
justify-content: center;
|
|
4261
4262
|
width: 100%;
|
|
@@ -4274,6 +4275,8 @@
|
|
|
4274
4275
|
.thumb-select-wrapper .thumb-image img {
|
|
4275
4276
|
width: 100%;
|
|
4276
4277
|
height: 100%;
|
|
4278
|
+
user-select: none;
|
|
4279
|
+
-webkit-user-drag: none;
|
|
4277
4280
|
}
|
|
4278
4281
|
.thumb-select-wrapper .thumb-handler-list {
|
|
4279
4282
|
position: absolute;
|
|
@@ -4313,9 +4316,13 @@
|
|
|
4313
4316
|
position: absolute;
|
|
4314
4317
|
right: 5px;
|
|
4315
4318
|
bottom: 5px;
|
|
4316
|
-
|
|
4319
|
+
display: flex;
|
|
4320
|
+
gap: 2px;
|
|
4321
|
+
align-items: center;
|
|
4322
|
+
padding: 2px 5px;
|
|
4317
4323
|
color: #fff;
|
|
4318
4324
|
font-size: 12px;
|
|
4325
|
+
line-height: 14px;
|
|
4319
4326
|
background-color: rgba(0, 0, 0, 0.5);
|
|
4320
4327
|
border-radius: 16px;
|
|
4321
4328
|
opacity: 1;
|
|
@@ -4400,10 +4407,18 @@
|
|
|
4400
4407
|
overflow: hidden;
|
|
4401
4408
|
}
|
|
4402
4409
|
.list-panel-wrapper .list-selected-record .list-selected-item .item-thumb {
|
|
4410
|
+
position: relative;
|
|
4403
4411
|
width: 50px;
|
|
4404
4412
|
height: 38px;
|
|
4405
4413
|
overflow: hidden;
|
|
4406
4414
|
}
|
|
4415
|
+
.list-panel-wrapper .list-selected-record .list-selected-item .item-thumb .item-tag {
|
|
4416
|
+
position: absolute;
|
|
4417
|
+
top: 50%;
|
|
4418
|
+
left: 50%;
|
|
4419
|
+
color: white;
|
|
4420
|
+
transform: translate(-50%, -50%);
|
|
4421
|
+
}
|
|
4407
4422
|
.list-panel-wrapper .list-selected-record .list-selected-item .item-alias {
|
|
4408
4423
|
flex: 1;
|
|
4409
4424
|
overflow: hidden;
|
|
@@ -4433,13 +4448,31 @@
|
|
|
4433
4448
|
.card-wrapper-image {
|
|
4434
4449
|
position: relative;
|
|
4435
4450
|
overflow: hidden;
|
|
4436
|
-
cursor: pointer;
|
|
4437
4451
|
}
|
|
4438
4452
|
.card-wrapper-image .card-wrapper {
|
|
4439
4453
|
position: relative;
|
|
4440
4454
|
overflow: hidden;
|
|
4455
|
+
border-radius: 2px;
|
|
4456
|
+
transition: all 0.3s ease-in-out;
|
|
4441
4457
|
aspect-ratio: 4 / 3;
|
|
4442
4458
|
}
|
|
4459
|
+
.card-wrapper-image .card-wrapper.disable:not(.active) {
|
|
4460
|
+
opacity: 0.4;
|
|
4461
|
+
}
|
|
4462
|
+
.card-wrapper-image .card-wrapper .mask {
|
|
4463
|
+
position: absolute;
|
|
4464
|
+
top: 0;
|
|
4465
|
+
z-index: 9;
|
|
4466
|
+
display: none;
|
|
4467
|
+
width: 100%;
|
|
4468
|
+
height: 100%;
|
|
4469
|
+
font-size: 18px;
|
|
4470
|
+
background: rgba(0, 0, 0, 0.3);
|
|
4471
|
+
cursor: pointer;
|
|
4472
|
+
}
|
|
4473
|
+
.card-wrapper-image .card-wrapper.active .mask {
|
|
4474
|
+
display: block;
|
|
4475
|
+
}
|
|
4443
4476
|
.card-wrapper-image .card-alias {
|
|
4444
4477
|
width: 100%;
|
|
4445
4478
|
margin-top: 6px;
|
|
@@ -4449,6 +4482,8 @@
|
|
|
4449
4482
|
line-height: 22px;
|
|
4450
4483
|
white-space: nowrap;
|
|
4451
4484
|
text-overflow: ellipsis;
|
|
4485
|
+
user-select: none;
|
|
4486
|
+
-webkit-user-drag: none;
|
|
4452
4487
|
}
|
|
4453
4488
|
.card-wrapper-image:hover .check-box-wrapper .check-box,
|
|
4454
4489
|
.card-wrapper-image .check-box-wrapper .check-box.active {
|
|
@@ -4458,6 +4493,7 @@
|
|
|
4458
4493
|
position: absolute;
|
|
4459
4494
|
top: 8px;
|
|
4460
4495
|
left: 8px;
|
|
4496
|
+
z-index: 10;
|
|
4461
4497
|
cursor: pointer;
|
|
4462
4498
|
}
|
|
4463
4499
|
.card-wrapper-image .check-box-wrapper .check-box {
|
|
@@ -1,10 +1,11 @@
|
|
|
1
1
|
import { defineComponent, computed, openBlock, createElementBlock, withModifiers, createElementVNode, normalizeClass, renderSlot, toDisplayString, createCommentVNode } from "vue";
|
|
2
|
-
const _hoisted_1 = { class: "
|
|
3
|
-
const _hoisted_2 = {
|
|
2
|
+
const _hoisted_1 = /* @__PURE__ */ createElementVNode("div", { class: "mask" }, null, -1);
|
|
3
|
+
const _hoisted_2 = { class: "card-alias" };
|
|
4
|
+
const _hoisted_3 = {
|
|
4
5
|
key: 0,
|
|
5
6
|
class: "check-box active"
|
|
6
7
|
};
|
|
7
|
-
const
|
|
8
|
+
const _hoisted_4 = {
|
|
8
9
|
key: 1,
|
|
9
10
|
class: "check-box"
|
|
10
11
|
};
|
|
@@ -38,16 +39,17 @@ const _sfc_main = defineComponent({
|
|
|
38
39
|
onClick: withModifiers(handleCheck, ["stop"])
|
|
39
40
|
}, [
|
|
40
41
|
createElementVNode("div", {
|
|
41
|
-
class: normalizeClass(["card-wrapper", { active: selectedOrder.value[_ctx.item.id] }])
|
|
42
|
+
class: normalizeClass(["card-wrapper", { disable: _ctx.disable, active: selectedOrder.value[_ctx.item.id] }])
|
|
42
43
|
}, [
|
|
43
|
-
renderSlot(_ctx.$slots, "default")
|
|
44
|
+
renderSlot(_ctx.$slots, "default"),
|
|
45
|
+
_hoisted_1
|
|
44
46
|
], 2),
|
|
45
|
-
createElementVNode("div",
|
|
47
|
+
createElementVNode("div", _hoisted_2, toDisplayString(_ctx.item.alias), 1),
|
|
46
48
|
createElementVNode("div", {
|
|
47
49
|
class: "check-box-wrapper",
|
|
48
50
|
onClick: withModifiers(handleCheck, ["stop"])
|
|
49
51
|
}, [
|
|
50
|
-
selectedOrder.value[_ctx.item.id] ? (openBlock(), createElementBlock("div",
|
|
52
|
+
selectedOrder.value[_ctx.item.id] ? (openBlock(), createElementBlock("div", _hoisted_3, toDisplayString(selectedOrder.value[_ctx.item.id]), 1)) : !_ctx.disable ? (openBlock(), createElementBlock("div", _hoisted_4)) : createCommentVNode("v-if", true)
|
|
51
53
|
])
|
|
52
54
|
]);
|
|
53
55
|
};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { defineComponent,
|
|
1
|
+
import { defineComponent, inject, computed, openBlock, createElementBlock, createCommentVNode, createElementVNode, createVNode, unref, toDisplayString, Fragment, renderList, createBlock, withCtx } from "vue";
|
|
2
2
|
import _sfc_main$1 from "./components/Upload.js";
|
|
3
3
|
import useUpload from "../../../hooks/useUpload.js";
|
|
4
4
|
import thumbCard from "../../../thumbCard/index.js";
|
|
@@ -21,6 +21,12 @@ const _sfc_main = defineComponent({
|
|
|
21
21
|
setup(__props, { emit: __emit }) {
|
|
22
22
|
const props = __props;
|
|
23
23
|
const emits = __emit;
|
|
24
|
+
const userInfo = inject("userInfo");
|
|
25
|
+
const baseAPI = inject("baseAPI");
|
|
26
|
+
const repoId = computed(() => {
|
|
27
|
+
var _a;
|
|
28
|
+
return (_a = userInfo == null ? void 0 : userInfo.value) == null ? void 0 : _a.repository_id;
|
|
29
|
+
});
|
|
24
30
|
const handlersKey = computed(() => {
|
|
25
31
|
var _a;
|
|
26
32
|
if (((_a = props.selectKeys) == null ? void 0 : _a.length) > 0 || props.disable)
|
|
@@ -33,17 +39,17 @@ const _sfc_main = defineComponent({
|
|
|
33
39
|
emits("select-one", item);
|
|
34
40
|
}
|
|
35
41
|
}
|
|
36
|
-
const { list, uploadFile } = useUpload();
|
|
37
|
-
const userInfo = inject("userInfo");
|
|
38
|
-
const baseAPI = inject("baseAPI");
|
|
39
|
-
const repoId = computed(() => {
|
|
40
|
-
var _a;
|
|
41
|
-
return (_a = userInfo == null ? void 0 : userInfo.value) == null ? void 0 : _a.repository_id;
|
|
42
|
-
});
|
|
42
|
+
const { list, uploadFile, transcodingFile } = useUpload();
|
|
43
43
|
function handleChange(file) {
|
|
44
44
|
if (!baseAPI || !repoId.value)
|
|
45
45
|
return;
|
|
46
|
-
uploadFile(
|
|
46
|
+
uploadFile(
|
|
47
|
+
baseAPI,
|
|
48
|
+
file.file,
|
|
49
|
+
0,
|
|
50
|
+
repoId.value,
|
|
51
|
+
(media) => transcodingFile(baseAPI, media)
|
|
52
|
+
);
|
|
47
53
|
}
|
|
48
54
|
return (_ctx, _cache) => {
|
|
49
55
|
var _a, _b;
|
|
@@ -1,13 +1,15 @@
|
|
|
1
|
-
import { defineComponent, ref, openBlock, createElementBlock, toDisplayString, createCommentVNode, createVNode, unref, withCtx, createElementVNode, Fragment, renderList, createBlock, createTextVNode } from "vue";
|
|
1
|
+
import { defineComponent, inject, computed, ref, openBlock, createElementBlock, toDisplayString, createCommentVNode, createVNode, unref, withCtx, createElementVNode, Fragment, renderList, createBlock, createTextVNode } from "vue";
|
|
2
2
|
import { Popover, Image, Button, Link } from "@arco-design/web-vue";
|
|
3
3
|
import { IconClose } from "@arco-design/web-vue/es/icon";
|
|
4
|
+
import { IconVideoTag } from "@arco-iconbox/vue-cmstop-icons";
|
|
4
5
|
const _hoisted_1 = { class: "list-selected-wrapper" };
|
|
5
6
|
const _hoisted_2 = { key: 0 };
|
|
6
7
|
const _hoisted_3 = { class: "list-panel-header" };
|
|
7
8
|
const _hoisted_4 = { class: "header-options" };
|
|
8
9
|
const _hoisted_5 = { class: "list-selected-record" };
|
|
9
10
|
const _hoisted_6 = { class: "item-thumb" };
|
|
10
|
-
const _hoisted_7 = { class: "item-
|
|
11
|
+
const _hoisted_7 = { class: "item-tag" };
|
|
12
|
+
const _hoisted_8 = { class: "item-alias" };
|
|
11
13
|
const _sfc_main = defineComponent({
|
|
12
14
|
__name: "index",
|
|
13
15
|
props: {
|
|
@@ -17,6 +19,10 @@ const _sfc_main = defineComponent({
|
|
|
17
19
|
emits: ["remove", "clear"],
|
|
18
20
|
setup(__props, { emit: __emit }) {
|
|
19
21
|
const emits = __emit;
|
|
22
|
+
const baseAPI = inject("baseAPI");
|
|
23
|
+
const audioThumb = computed(() => {
|
|
24
|
+
return `${baseAPI}/static/img/music.2ee269c.png`;
|
|
25
|
+
});
|
|
20
26
|
const visible = ref(false);
|
|
21
27
|
return (_ctx, _cache) => {
|
|
22
28
|
return openBlock(), createElementBlock("div", _hoisted_1, [
|
|
@@ -56,11 +62,18 @@ const _sfc_main = defineComponent({
|
|
|
56
62
|
height: "100%",
|
|
57
63
|
src: item.thumb || item.url
|
|
58
64
|
}, null, 8, ["src"])) : createCommentVNode("v-if", true),
|
|
59
|
-
["audio"].includes(item.catalog) ? (openBlock(),
|
|
60
|
-
|
|
61
|
-
|
|
65
|
+
["audio"].includes(item.catalog) ? (openBlock(), createBlock(unref(Image), {
|
|
66
|
+
key: 1,
|
|
67
|
+
width: "100%",
|
|
68
|
+
height: "100%",
|
|
69
|
+
fit: "cover",
|
|
70
|
+
src: audioThumb.value
|
|
71
|
+
}, null, 8, ["src"])) : createCommentVNode("v-if", true),
|
|
72
|
+
createElementVNode("div", _hoisted_7, [
|
|
73
|
+
item.catalog === "video" ? (openBlock(), createBlock(unref(IconVideoTag), { key: 0 })) : createCommentVNode("v-if", true)
|
|
74
|
+
])
|
|
62
75
|
]),
|
|
63
|
-
createElementVNode("div",
|
|
76
|
+
createElementVNode("div", _hoisted_8, toDisplayString(item.alias), 1),
|
|
64
77
|
createVNode(unref(Button), {
|
|
65
78
|
type: "text",
|
|
66
79
|
onClick: ($event) => emits("remove", item)
|
|
@@ -129,7 +129,7 @@ const _sfc_main = defineComponent({
|
|
|
129
129
|
createCommentVNode(" \u7B5B\u9009 "),
|
|
130
130
|
activeKey.value !== "local" ? (openBlock(), createElementBlock("div", _hoisted_4, [
|
|
131
131
|
createVNode(_sfc_main$1, {
|
|
132
|
-
"disable-upload-by":
|
|
132
|
+
"disable-upload-by": !["all", "remind"].includes(activeKey.value),
|
|
133
133
|
filterOptions: _ctx.filterOptions,
|
|
134
134
|
onChange: unref(changeFilter),
|
|
135
135
|
onUpload: handleToUpload
|
|
@@ -71,10 +71,18 @@
|
|
|
71
71
|
overflow: hidden;
|
|
72
72
|
}
|
|
73
73
|
.list-panel-wrapper .list-selected-record .list-selected-item .item-thumb {
|
|
74
|
+
position: relative;
|
|
74
75
|
width: 50px;
|
|
75
76
|
height: 38px;
|
|
76
77
|
overflow: hidden;
|
|
77
78
|
}
|
|
79
|
+
.list-panel-wrapper .list-selected-record .list-selected-item .item-thumb .item-tag {
|
|
80
|
+
position: absolute;
|
|
81
|
+
top: 50%;
|
|
82
|
+
left: 50%;
|
|
83
|
+
color: white;
|
|
84
|
+
transform: translate(-50%, -50%);
|
|
85
|
+
}
|
|
78
86
|
.list-panel-wrapper .list-selected-record .list-selected-item .item-alias {
|
|
79
87
|
flex: 1;
|
|
80
88
|
overflow: hidden;
|
|
@@ -104,13 +112,31 @@
|
|
|
104
112
|
.card-wrapper-image {
|
|
105
113
|
position: relative;
|
|
106
114
|
overflow: hidden;
|
|
107
|
-
cursor: pointer;
|
|
108
115
|
}
|
|
109
116
|
.card-wrapper-image .card-wrapper {
|
|
110
117
|
position: relative;
|
|
111
118
|
overflow: hidden;
|
|
119
|
+
border-radius: 2px;
|
|
120
|
+
transition: all 0.3s ease-in-out;
|
|
112
121
|
aspect-ratio: 4 / 3;
|
|
113
122
|
}
|
|
123
|
+
.card-wrapper-image .card-wrapper.disable:not(.active) {
|
|
124
|
+
opacity: 0.4;
|
|
125
|
+
}
|
|
126
|
+
.card-wrapper-image .card-wrapper .mask {
|
|
127
|
+
position: absolute;
|
|
128
|
+
top: 0;
|
|
129
|
+
z-index: 9;
|
|
130
|
+
display: none;
|
|
131
|
+
width: 100%;
|
|
132
|
+
height: 100%;
|
|
133
|
+
font-size: 18px;
|
|
134
|
+
background: rgba(0, 0, 0, 0.3);
|
|
135
|
+
cursor: pointer;
|
|
136
|
+
}
|
|
137
|
+
.card-wrapper-image .card-wrapper.active .mask {
|
|
138
|
+
display: block;
|
|
139
|
+
}
|
|
114
140
|
.card-wrapper-image .card-alias {
|
|
115
141
|
width: 100%;
|
|
116
142
|
margin-top: 6px;
|
|
@@ -120,6 +146,8 @@
|
|
|
120
146
|
line-height: 22px;
|
|
121
147
|
white-space: nowrap;
|
|
122
148
|
text-overflow: ellipsis;
|
|
149
|
+
user-select: none;
|
|
150
|
+
-webkit-user-drag: none;
|
|
123
151
|
}
|
|
124
152
|
.card-wrapper-image:hover .check-box-wrapper .check-box,
|
|
125
153
|
.card-wrapper-image .check-box-wrapper .check-box.active {
|
|
@@ -129,6 +157,7 @@
|
|
|
129
157
|
position: absolute;
|
|
130
158
|
top: 8px;
|
|
131
159
|
left: 8px;
|
|
160
|
+
z-index: 10;
|
|
132
161
|
cursor: pointer;
|
|
133
162
|
}
|
|
134
163
|
.card-wrapper-image .check-box-wrapper .check-box {
|
|
@@ -1,13 +1,34 @@
|
|
|
1
1
|
.card-wrapper-image {
|
|
2
2
|
position: relative;
|
|
3
3
|
overflow: hidden;
|
|
4
|
-
cursor: pointer;
|
|
5
4
|
|
|
6
5
|
.card-wrapper {
|
|
7
6
|
position: relative;
|
|
8
7
|
overflow: hidden;
|
|
8
|
+
border-radius: 2px;
|
|
9
|
+
transition: all 0.3s ease-in-out;
|
|
9
10
|
// 宽高:43
|
|
10
11
|
aspect-ratio: 4 / 3;
|
|
12
|
+
|
|
13
|
+
&.disable:not(.active) {
|
|
14
|
+
opacity: 0.4;
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
.mask {
|
|
18
|
+
position: absolute;
|
|
19
|
+
top: 0;
|
|
20
|
+
z-index: 9;
|
|
21
|
+
display: none;
|
|
22
|
+
width: 100%;
|
|
23
|
+
height: 100%;
|
|
24
|
+
font-size: 18px;
|
|
25
|
+
background: rgba(0, 0, 0, 0.3);
|
|
26
|
+
cursor: pointer;
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
&.active .mask {
|
|
30
|
+
display: block;
|
|
31
|
+
}
|
|
11
32
|
}
|
|
12
33
|
|
|
13
34
|
.card-alias {
|
|
@@ -19,6 +40,8 @@
|
|
|
19
40
|
line-height: 22px;
|
|
20
41
|
white-space: nowrap;
|
|
21
42
|
text-overflow: ellipsis;
|
|
43
|
+
user-select: none;
|
|
44
|
+
-webkit-user-drag: none;
|
|
22
45
|
}
|
|
23
46
|
|
|
24
47
|
&:hover .check-box-wrapper .check-box,
|
|
@@ -30,6 +53,7 @@
|
|
|
30
53
|
position: absolute;
|
|
31
54
|
top: 8px;
|
|
32
55
|
left: 8px;
|
|
56
|
+
z-index: 10;
|
|
33
57
|
cursor: pointer;
|
|
34
58
|
|
|
35
59
|
.check-box {
|
|
@@ -59,9 +59,18 @@
|
|
|
59
59
|
overflow: hidden;
|
|
60
60
|
|
|
61
61
|
.item-thumb {
|
|
62
|
+
position: relative;
|
|
62
63
|
width: 50px;
|
|
63
64
|
height: 38px;
|
|
64
65
|
overflow: hidden;
|
|
66
|
+
|
|
67
|
+
.item-tag {
|
|
68
|
+
position: absolute;
|
|
69
|
+
top: 50%;
|
|
70
|
+
left: 50%;
|
|
71
|
+
color: white;
|
|
72
|
+
transform: translate(-50%, -50%);
|
|
73
|
+
}
|
|
65
74
|
}
|
|
66
75
|
|
|
67
76
|
.item-alias {
|