@cmstops/pro-compo 0.3.40 → 0.3.42
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 +49 -0
- package/dist/index.min.css +1 -1
- package/es/contentModal/components/ViewAllColumn/MediaFilter/index.js +45 -51
- package/es/hooks/useMediaContext.d.ts +12 -0
- package/es/index.css +49 -0
- package/es/index.d.ts +1 -0
- package/es/index.js +1 -0
- package/es/index.less +1 -0
- package/es/utils/request.js +2 -0
- package/es/videoThumb/component.d.ts +0 -0
- package/es/videoThumb/component.js +103 -0
- package/es/videoThumb/index.d.ts +2 -0
- package/es/videoThumb/index.js +7 -0
- package/es/videoThumb/scripts/api.d.ts +9 -0
- package/es/videoThumb/scripts/api.js +11 -0
- package/es/videoThumb/scripts/useVideoThumbs.d.ts +7 -0
- package/es/videoThumb/scripts/useVideoThumbs.js +48 -0
- package/es/videoThumb/style/css.js +1 -0
- package/es/videoThumb/style/index.css +49 -0
- package/es/videoThumb/style/index.d.ts +1 -0
- package/es/videoThumb/style/index.js +1 -0
- package/es/videoThumb/style/index.less +61 -0
- package/lib/contentModal/components/ViewAllColumn/MediaFilter/index.js +44 -50
- package/lib/index.css +49 -0
- package/lib/index.js +2 -0
- package/lib/index.less +1 -0
- package/lib/utils/request.js +2 -0
- package/lib/videoThumb/component.js +104 -0
- package/lib/videoThumb/index.js +8 -0
- package/lib/videoThumb/scripts/api.js +13 -0
- package/lib/videoThumb/scripts/useVideoThumbs.js +50 -0
- package/lib/videoThumb/style/css.js +2 -0
- package/lib/videoThumb/style/index.css +49 -0
- package/lib/videoThumb/style/index.js +2 -0
- package/lib/videoThumb/style/index.less +61 -0
- package/package.json +6 -6
|
@@ -6,10 +6,7 @@ var doc = require("../../../../utils/doc.js");
|
|
|
6
6
|
var index = require("../columnTree/index.js");
|
|
7
7
|
const _hoisted_1 = { class: "media-filter-container" };
|
|
8
8
|
const _hoisted_2 = { style: { "display": "flex", "align-items": "center", "gap": "5px" } };
|
|
9
|
-
const _hoisted_3 =
|
|
10
|
-
const _hoisted_4 = { style: { "display": "flex", "align-items": "center", "gap": "5px" } };
|
|
11
|
-
const _hoisted_5 = /* @__PURE__ */ vue.createElementVNode("span", null, "\u6A21\u7CCA\u641C", -1);
|
|
12
|
-
const _hoisted_6 = { class: "sort-button" };
|
|
9
|
+
const _hoisted_3 = { class: "sort-button" };
|
|
13
10
|
const _sfc_main = vue.defineComponent({
|
|
14
11
|
...{ name: "MediaFilter" },
|
|
15
12
|
__name: "index",
|
|
@@ -24,7 +21,7 @@ const _sfc_main = vue.defineComponent({
|
|
|
24
21
|
emits: ["update:group_id", "search"],
|
|
25
22
|
setup(__props, { emit: __emit }) {
|
|
26
23
|
const props = __props;
|
|
27
|
-
const column_id = vue.ref(
|
|
24
|
+
const column_id = vue.ref("all");
|
|
28
25
|
const emit = __emit;
|
|
29
26
|
const filter = vue.ref({
|
|
30
27
|
keywords: "",
|
|
@@ -35,6 +32,18 @@ const _sfc_main = vue.defineComponent({
|
|
|
35
32
|
order: "create_time",
|
|
36
33
|
wordState: "precision"
|
|
37
34
|
});
|
|
35
|
+
const wordStateOptions = [
|
|
36
|
+
{
|
|
37
|
+
value: "precision",
|
|
38
|
+
label: "\u7CBE\u51C6\u641C",
|
|
39
|
+
desc: "\u4F1A\u4EE5\u8F93\u5165\u7684\u5B8C\u6574\u5173\u952E\u8BCD\u201C\u6210\u957F\u201D\u8FDB\u884C\u641C\u7D22\uFF0C\u641C\u7D22\u7ED3\u679C\u5173\u8054\u6027\u66F4\u9AD8\uFF0C\u4F46\u641C\u7D22\u7ED3\u679C\u66F4\u5C11"
|
|
40
|
+
},
|
|
41
|
+
{
|
|
42
|
+
value: "blur",
|
|
43
|
+
label: "\u6A21\u7CCA\u641C",
|
|
44
|
+
desc: "\u4F1A\u5C06\u8F93\u5165\u5185\u5BB9\u5206\u8BCD\uFF0C\u4F8B\u5982\u201C\u6210\u957F\u201D\u4F1A\u5206\u4E3A\u201C\u6210\u201D\u3001\u201C\u957F\u201D\u3001\u201C\u6210\u957F\u201D\uFF0C\u5185\u5BB9\u5305\u542B\u4E09\u4E2A\u8BCD\u4E2D\u4EFB\u610F\u4E00\u4E2A\u5747\u4F1A\u663E\u793A\u51FA\u6765\uFF0C\u641C\u7D22\u5185\u5BB9\u66F4\u52A0\u4E30\u5BCC"
|
|
45
|
+
}
|
|
46
|
+
];
|
|
38
47
|
const bannerOptions = vue.computed(() => {
|
|
39
48
|
const options = [
|
|
40
49
|
{
|
|
@@ -92,22 +101,24 @@ const _sfc_main = vue.defineComponent({
|
|
|
92
101
|
return filter.value.keywords || series || filter.value.cover_type || banner || filter.value.sort !== -1;
|
|
93
102
|
});
|
|
94
103
|
const reset = () => {
|
|
95
|
-
|
|
104
|
+
const _set = {
|
|
96
105
|
keywords: "",
|
|
97
106
|
cover_type: "",
|
|
98
107
|
sort: -1,
|
|
99
108
|
order: "create_time"
|
|
100
109
|
};
|
|
110
|
+
Object.assign(filter.value, _set);
|
|
101
111
|
if (props.banner !== "all") {
|
|
102
112
|
filter.value.banner = props.banner;
|
|
103
113
|
} else {
|
|
104
114
|
filter.value.banner = "";
|
|
105
115
|
}
|
|
106
|
-
if (props.series !== "all") {
|
|
116
|
+
if (props.series !== "all" && props.series.split(",").length === 1) {
|
|
107
117
|
filter.value.type = props.series;
|
|
108
118
|
} else {
|
|
109
119
|
filter.value.type = "";
|
|
110
120
|
}
|
|
121
|
+
column_id.value = "all";
|
|
111
122
|
};
|
|
112
123
|
const checkout = (type) => {
|
|
113
124
|
filter.value.wordState = type;
|
|
@@ -157,6 +168,7 @@ const _sfc_main = vue.defineComponent({
|
|
|
157
168
|
"allow-clear": "",
|
|
158
169
|
class: "filter-item keyword",
|
|
159
170
|
placeholder: "\u8BF7\u8F93\u5165\u5185\u5BB9\u6807\u9898",
|
|
171
|
+
style: { width: "240px" },
|
|
160
172
|
onPressEnter: handleSearch
|
|
161
173
|
}, {
|
|
162
174
|
prepend: vue.withCtx(() => [
|
|
@@ -167,48 +179,30 @@ const _sfc_main = vue.defineComponent({
|
|
|
167
179
|
onSelect: checkout
|
|
168
180
|
}, {
|
|
169
181
|
default: vue.withCtx(() => [
|
|
170
|
-
vue.
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
vue.
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
value
|
|
193
|
-
|
|
194
|
-
}, {
|
|
195
|
-
default: vue.withCtx(() => [
|
|
196
|
-
vue.createElementVNode("div", _hoisted_4, [
|
|
197
|
-
_hoisted_5,
|
|
198
|
-
vue.createVNode(vue.unref(webVue.Tooltip), {
|
|
199
|
-
effect: "dark",
|
|
200
|
-
content: "\u4F1A\u5C06\u8F93\u5165\u5185\u5BB9\u5206\u8BCD\uFF0C\u4F8B\u5982\u201C\u6210\u957F\u201D\u4F1A\u5206\u4E3A\u201C\u6210\u201D\u3001\u201C\u957F\u201D\u3001\u201C\u6210\u957F\u201D\uFF0C\u5185\u5BB9\u5305\u542B\u4E09\u4E2A\u8BCD\u4E2D\u4EFB\u610F\u4E00\u4E2A\u5747\u4F1A\u663E\u793A\u51FA\u6765\uFF0C\u641C\u7D22\u5185\u5BB9\u66F4\u52A0\u4E30\u5BCC",
|
|
201
|
-
position: "right"
|
|
202
|
-
}, {
|
|
203
|
-
default: vue.withCtx(() => [
|
|
204
|
-
vue.createVNode(vue.unref(icon.IconInfoCircle))
|
|
205
|
-
]),
|
|
206
|
-
_: 1
|
|
207
|
-
})
|
|
208
|
-
])
|
|
209
|
-
]),
|
|
210
|
-
_: 1
|
|
211
|
-
})
|
|
182
|
+
(vue.openBlock(), vue.createElementBlock(vue.Fragment, null, vue.renderList(wordStateOptions, (item, index2) => {
|
|
183
|
+
return vue.createVNode(vue.unref(webVue.Option), {
|
|
184
|
+
key: index2,
|
|
185
|
+
value: item.value,
|
|
186
|
+
label: item.label
|
|
187
|
+
}, {
|
|
188
|
+
default: vue.withCtx(() => [
|
|
189
|
+
vue.createElementVNode("div", _hoisted_2, [
|
|
190
|
+
vue.createElementVNode("span", null, vue.toDisplayString(item.label), 1),
|
|
191
|
+
vue.createVNode(vue.unref(webVue.Tooltip), {
|
|
192
|
+
effect: "dark",
|
|
193
|
+
content: item.desc,
|
|
194
|
+
position: "right"
|
|
195
|
+
}, {
|
|
196
|
+
default: vue.withCtx(() => [
|
|
197
|
+
vue.createVNode(vue.unref(icon.IconInfoCircle))
|
|
198
|
+
]),
|
|
199
|
+
_: 2
|
|
200
|
+
}, 1032, ["content"])
|
|
201
|
+
])
|
|
202
|
+
]),
|
|
203
|
+
_: 2
|
|
204
|
+
}, 1032, ["value", "label"]);
|
|
205
|
+
}), 64))
|
|
212
206
|
]),
|
|
213
207
|
_: 1
|
|
214
208
|
}, 8, ["modelValue"])
|
|
@@ -300,7 +294,7 @@ const _sfc_main = vue.defineComponent({
|
|
|
300
294
|
]),
|
|
301
295
|
_: 1
|
|
302
296
|
}),
|
|
303
|
-
vue.createElementVNode("div",
|
|
297
|
+
vue.createElementVNode("div", _hoisted_3, [
|
|
304
298
|
vue.createVNode(vue.unref(webVue.Select), {
|
|
305
299
|
modelValue: filter.value.order,
|
|
306
300
|
"onUpdate:modelValue": _cache[6] || (_cache[6] = ($event) => filter.value.order = $event),
|
package/lib/index.css
CHANGED
|
@@ -4746,3 +4746,52 @@
|
|
|
4746
4746
|
.doc-history-drawer .arco-drawer-body {
|
|
4747
4747
|
padding: 0;
|
|
4748
4748
|
}
|
|
4749
|
+
.video-thumb {
|
|
4750
|
+
display: flex;
|
|
4751
|
+
flex-direction: column;
|
|
4752
|
+
gap: 10px;
|
|
4753
|
+
box-sizing: border-box;
|
|
4754
|
+
width: 100%;
|
|
4755
|
+
height: 100%;
|
|
4756
|
+
padding: 10px;
|
|
4757
|
+
overflow: hidden;
|
|
4758
|
+
}
|
|
4759
|
+
.video-thumb .video-player-container {
|
|
4760
|
+
display: flex;
|
|
4761
|
+
flex: 1;
|
|
4762
|
+
flex-direction: column;
|
|
4763
|
+
overflow: hidden;
|
|
4764
|
+
}
|
|
4765
|
+
.video-thumb .video-player-container video {
|
|
4766
|
+
height: 100%;
|
|
4767
|
+
}
|
|
4768
|
+
.video-thumb .video-thumb-list {
|
|
4769
|
+
position: relative;
|
|
4770
|
+
display: flex;
|
|
4771
|
+
height: 80px;
|
|
4772
|
+
padding: 20px 0;
|
|
4773
|
+
}
|
|
4774
|
+
.video-thumb .video-thumb-list .video-thumb-list-item {
|
|
4775
|
+
flex: 1;
|
|
4776
|
+
cursor: pointer;
|
|
4777
|
+
user-select: none;
|
|
4778
|
+
}
|
|
4779
|
+
.video-thumb .video-thumb-list .video-thumb-list-item img {
|
|
4780
|
+
width: 100%;
|
|
4781
|
+
height: 100%;
|
|
4782
|
+
object-fit: cover;
|
|
4783
|
+
transition: all 0.1s ease-in-out;
|
|
4784
|
+
pointer-events: none;
|
|
4785
|
+
}
|
|
4786
|
+
.video-thumb .video-thumb-list .video-thumb-list-item:hover:not(.active) img {
|
|
4787
|
+
transform: scale(1.05);
|
|
4788
|
+
}
|
|
4789
|
+
.video-thumb .video-thumb-list .video-thumb-list-drager {
|
|
4790
|
+
position: absolute;
|
|
4791
|
+
top: 20px;
|
|
4792
|
+
left: 0;
|
|
4793
|
+
width: 6px;
|
|
4794
|
+
height: calc(100% - 40px);
|
|
4795
|
+
background-color: rgb(var(--primary-5));
|
|
4796
|
+
cursor: pointer;
|
|
4797
|
+
}
|
package/lib/index.js
CHANGED
|
@@ -28,6 +28,7 @@ var index$n = require("./thumbCard/index.js");
|
|
|
28
28
|
var index$o = require("./selectResourceModal/index.js");
|
|
29
29
|
var index$p = require("./docPreview/index.js");
|
|
30
30
|
var index$q = require("./docHistory/index.js");
|
|
31
|
+
var index$r = require("./videoThumb/index.js");
|
|
31
32
|
exports["default"] = components;
|
|
32
33
|
exports.appCenter = index;
|
|
33
34
|
exports.messageBox = index$1;
|
|
@@ -56,3 +57,4 @@ exports.thumbCard = index$n;
|
|
|
56
57
|
exports.selectResourceModal = index$o;
|
|
57
58
|
exports.docPreview = index$p;
|
|
58
59
|
exports.docHistory = index$q;
|
|
60
|
+
exports.videoThumb = index$r;
|
package/lib/index.less
CHANGED
package/lib/utils/request.js
CHANGED
|
@@ -26,6 +26,8 @@ function request(BASE_API, options) {
|
|
|
26
26
|
service.interceptors.response.use(
|
|
27
27
|
(response) => {
|
|
28
28
|
const res = response.data;
|
|
29
|
+
if (res.Code != null && res.Code === 200)
|
|
30
|
+
res.code = 0;
|
|
29
31
|
if ((res == null ? void 0 : res.code) !== 0) {
|
|
30
32
|
if (res == null ? void 0 : res.real_error) {
|
|
31
33
|
webVue.Message.warning({ content: res.real_error });
|
|
@@ -0,0 +1,104 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var vue = require("vue");
|
|
3
|
+
var config = require("../config.js");
|
|
4
|
+
var useVideoThumbs = require("./scripts/useVideoThumbs.js");
|
|
5
|
+
const _hoisted_1 = { class: "video-thumb" };
|
|
6
|
+
const _hoisted_2 = { class: "video-player-container" };
|
|
7
|
+
const _hoisted_3 = ["src"];
|
|
8
|
+
const _hoisted_4 = ["onClick"];
|
|
9
|
+
const _hoisted_5 = ["src"];
|
|
10
|
+
const _sfc_main = vue.defineComponent({
|
|
11
|
+
...{ name: "videoThumb" },
|
|
12
|
+
__name: "component",
|
|
13
|
+
props: {
|
|
14
|
+
BASE_API: {},
|
|
15
|
+
src: {},
|
|
16
|
+
duration: {}
|
|
17
|
+
},
|
|
18
|
+
emits: ["select"],
|
|
19
|
+
setup(__props, { emit: __emit }) {
|
|
20
|
+
const props = __props;
|
|
21
|
+
const emit = __emit;
|
|
22
|
+
const BASE_API = props.BASE_API || config.DEFAULT_BASE_API;
|
|
23
|
+
const { thumbs, curThumb, getVideoThumbs, handleSelectThumb } = useVideoThumbs.useVideoThumbs();
|
|
24
|
+
const videoThumbRef = vue.ref();
|
|
25
|
+
const videoThumbDrager = vue.ref();
|
|
26
|
+
const isDrag = vue.ref(false);
|
|
27
|
+
const width = vue.computed(() => {
|
|
28
|
+
if (!videoThumbRef.value)
|
|
29
|
+
return 0;
|
|
30
|
+
const rect = videoThumbRef.value.getBoundingClientRect();
|
|
31
|
+
return parseInt((rect.width / thumbs.value.length).toFixed(0), 10);
|
|
32
|
+
});
|
|
33
|
+
function moveDragger(moveX) {
|
|
34
|
+
if (!videoThumbDrager.value || !videoThumbRef.value)
|
|
35
|
+
return;
|
|
36
|
+
const rect = videoThumbRef.value.getBoundingClientRect();
|
|
37
|
+
if (moveX < 0 || moveX > rect.width)
|
|
38
|
+
return;
|
|
39
|
+
videoThumbDrager.value.style.left = `${moveX}px`;
|
|
40
|
+
const index = Math.floor(moveX / width.value);
|
|
41
|
+
curThumb.value = thumbs.value[index];
|
|
42
|
+
}
|
|
43
|
+
const handleMousedown = () => {
|
|
44
|
+
isDrag.value = true;
|
|
45
|
+
window.onmouseup = handleMouseup;
|
|
46
|
+
window.onmousemove = handleMousemove;
|
|
47
|
+
};
|
|
48
|
+
const handleMouseup = () => {
|
|
49
|
+
isDrag.value = false;
|
|
50
|
+
window.onmouseup = null;
|
|
51
|
+
window.onmousemove = null;
|
|
52
|
+
};
|
|
53
|
+
const handleMousemove = (e) => {
|
|
54
|
+
if (!isDrag.value)
|
|
55
|
+
return;
|
|
56
|
+
const moveX = e.x - 30;
|
|
57
|
+
moveDragger(moveX);
|
|
58
|
+
};
|
|
59
|
+
function handleSelect(idx) {
|
|
60
|
+
handleSelectThumb(idx);
|
|
61
|
+
moveDragger(idx * width.value + width.value / 2);
|
|
62
|
+
}
|
|
63
|
+
vue.watch(
|
|
64
|
+
() => curThumb.value,
|
|
65
|
+
() => emit("select", curThumb.value)
|
|
66
|
+
);
|
|
67
|
+
vue.onMounted(() => {
|
|
68
|
+
getVideoThumbs(BASE_API, props.src, props.duration);
|
|
69
|
+
});
|
|
70
|
+
return (_ctx, _cache) => {
|
|
71
|
+
return vue.openBlock(), vue.createElementBlock("div", _hoisted_1, [
|
|
72
|
+
vue.createElementVNode("div", _hoisted_2, [
|
|
73
|
+
vue.createElementVNode("img", { src: vue.unref(curThumb) }, null, 8, _hoisted_3)
|
|
74
|
+
]),
|
|
75
|
+
vue.createCommentVNode(" \u5C01\u9762\u56FE "),
|
|
76
|
+
vue.createElementVNode("div", {
|
|
77
|
+
ref_key: "videoThumbRef",
|
|
78
|
+
ref: videoThumbRef,
|
|
79
|
+
class: "video-thumb-list"
|
|
80
|
+
}, [
|
|
81
|
+
vue.createElementVNode("div", {
|
|
82
|
+
ref_key: "videoThumbDrager",
|
|
83
|
+
ref: videoThumbDrager,
|
|
84
|
+
class: "video-thumb-list-drager",
|
|
85
|
+
onMousedown: handleMousedown
|
|
86
|
+
}, null, 544),
|
|
87
|
+
(vue.openBlock(true), vue.createElementBlock(vue.Fragment, null, vue.renderList(vue.unref(thumbs), (thumb, idx) => {
|
|
88
|
+
return vue.openBlock(), vue.createElementBlock("div", {
|
|
89
|
+
key: thumb,
|
|
90
|
+
class: vue.normalizeClass(["video-thumb-list-item", { active: vue.unref(curThumb) === thumb }]),
|
|
91
|
+
onClick: ($event) => handleSelect(idx)
|
|
92
|
+
}, [
|
|
93
|
+
vue.createElementVNode("img", {
|
|
94
|
+
src: thumb,
|
|
95
|
+
alt: ""
|
|
96
|
+
}, null, 8, _hoisted_5)
|
|
97
|
+
], 10, _hoisted_4);
|
|
98
|
+
}), 128))
|
|
99
|
+
], 512)
|
|
100
|
+
]);
|
|
101
|
+
};
|
|
102
|
+
}
|
|
103
|
+
});
|
|
104
|
+
module.exports = _sfc_main;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperties(exports, { __esModule: { value: true }, [Symbol.toStringTag]: { value: "Module" } });
|
|
3
|
+
var request = require("../../utils/request.js");
|
|
4
|
+
function editthumb(BASE_URL, params) {
|
|
5
|
+
const { url, count, start, end, search } = params;
|
|
6
|
+
const src = encodeURIComponent(url);
|
|
7
|
+
const n = count > 50 ? 50 : count;
|
|
8
|
+
return request(BASE_URL, {
|
|
9
|
+
url: `/poplar/v2/editthumb?src=${src}&n=${n}&starttime=${start}&endtime=${end}${search}`,
|
|
10
|
+
method: "get"
|
|
11
|
+
});
|
|
12
|
+
}
|
|
13
|
+
exports.editthumb = editthumb;
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperties(exports, { __esModule: { value: true }, [Symbol.toStringTag]: { value: "Module" } });
|
|
3
|
+
var vue = require("vue");
|
|
4
|
+
var api = require("./api.js");
|
|
5
|
+
function calculateFrameCoverCount(videoDuration) {
|
|
6
|
+
const base = 5;
|
|
7
|
+
const coefficient = 10;
|
|
8
|
+
const maxCount = 50;
|
|
9
|
+
let count = Math.log(videoDuration / base) * coefficient;
|
|
10
|
+
count = Math.min(count, maxCount);
|
|
11
|
+
return Math.ceil(count);
|
|
12
|
+
}
|
|
13
|
+
function useVideoThumbs() {
|
|
14
|
+
const thumbs = vue.ref([]);
|
|
15
|
+
const loading = vue.ref(true);
|
|
16
|
+
const curThumb = vue.ref();
|
|
17
|
+
async function getVideoThumbs(BASE_API, url, duration) {
|
|
18
|
+
loading.value = true;
|
|
19
|
+
try {
|
|
20
|
+
const { Code, Msg } = await api.editthumb(BASE_API, {
|
|
21
|
+
url,
|
|
22
|
+
count: calculateFrameCoverCount(duration),
|
|
23
|
+
start: 0,
|
|
24
|
+
end: duration,
|
|
25
|
+
search: "&cover=true"
|
|
26
|
+
});
|
|
27
|
+
if (Code !== 200)
|
|
28
|
+
return;
|
|
29
|
+
const { Domain, Frames } = Msg;
|
|
30
|
+
thumbs.value = Frames.map((item) => {
|
|
31
|
+
return `${Domain}/${item}`;
|
|
32
|
+
});
|
|
33
|
+
[curThumb.value] = thumbs.value;
|
|
34
|
+
} catch (e) {
|
|
35
|
+
console.log("\u52A0\u8F7D\u5C01\u9762\u56FE\u5931\u8D25", e);
|
|
36
|
+
} finally {
|
|
37
|
+
loading.value = false;
|
|
38
|
+
}
|
|
39
|
+
}
|
|
40
|
+
function handleSelectThumb(idx) {
|
|
41
|
+
curThumb.value = thumbs.value[idx];
|
|
42
|
+
}
|
|
43
|
+
return {
|
|
44
|
+
thumbs,
|
|
45
|
+
curThumb,
|
|
46
|
+
getVideoThumbs,
|
|
47
|
+
handleSelectThumb
|
|
48
|
+
};
|
|
49
|
+
}
|
|
50
|
+
exports.useVideoThumbs = useVideoThumbs;
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
.video-thumb {
|
|
2
|
+
display: flex;
|
|
3
|
+
flex-direction: column;
|
|
4
|
+
gap: 10px;
|
|
5
|
+
box-sizing: border-box;
|
|
6
|
+
width: 100%;
|
|
7
|
+
height: 100%;
|
|
8
|
+
padding: 10px;
|
|
9
|
+
overflow: hidden;
|
|
10
|
+
}
|
|
11
|
+
.video-thumb .video-player-container {
|
|
12
|
+
display: flex;
|
|
13
|
+
flex: 1;
|
|
14
|
+
flex-direction: column;
|
|
15
|
+
overflow: hidden;
|
|
16
|
+
}
|
|
17
|
+
.video-thumb .video-player-container video {
|
|
18
|
+
height: 100%;
|
|
19
|
+
}
|
|
20
|
+
.video-thumb .video-thumb-list {
|
|
21
|
+
position: relative;
|
|
22
|
+
display: flex;
|
|
23
|
+
height: 80px;
|
|
24
|
+
padding: 20px 0;
|
|
25
|
+
}
|
|
26
|
+
.video-thumb .video-thumb-list .video-thumb-list-item {
|
|
27
|
+
flex: 1;
|
|
28
|
+
cursor: pointer;
|
|
29
|
+
user-select: none;
|
|
30
|
+
}
|
|
31
|
+
.video-thumb .video-thumb-list .video-thumb-list-item img {
|
|
32
|
+
width: 100%;
|
|
33
|
+
height: 100%;
|
|
34
|
+
object-fit: cover;
|
|
35
|
+
transition: all 0.1s ease-in-out;
|
|
36
|
+
pointer-events: none;
|
|
37
|
+
}
|
|
38
|
+
.video-thumb .video-thumb-list .video-thumb-list-item:hover:not(.active) img {
|
|
39
|
+
transform: scale(1.05);
|
|
40
|
+
}
|
|
41
|
+
.video-thumb .video-thumb-list .video-thumb-list-drager {
|
|
42
|
+
position: absolute;
|
|
43
|
+
top: 20px;
|
|
44
|
+
left: 0;
|
|
45
|
+
width: 6px;
|
|
46
|
+
height: calc(100% - 40px);
|
|
47
|
+
background-color: rgb(var(--primary-5));
|
|
48
|
+
cursor: pointer;
|
|
49
|
+
}
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
.video-thumb {
|
|
2
|
+
display: flex;
|
|
3
|
+
flex-direction: column;
|
|
4
|
+
gap: 10px;
|
|
5
|
+
box-sizing: border-box;
|
|
6
|
+
width: 100%;
|
|
7
|
+
height: 100%;
|
|
8
|
+
padding: 10px;
|
|
9
|
+
overflow: hidden;
|
|
10
|
+
|
|
11
|
+
// 播放器
|
|
12
|
+
.video-player-container {
|
|
13
|
+
display: flex;
|
|
14
|
+
flex: 1;
|
|
15
|
+
flex-direction: column;
|
|
16
|
+
overflow: hidden;
|
|
17
|
+
|
|
18
|
+
video {
|
|
19
|
+
height: 100%;
|
|
20
|
+
}
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
// 视频封面列表
|
|
24
|
+
.video-thumb-list {
|
|
25
|
+
position: relative;
|
|
26
|
+
display: flex;
|
|
27
|
+
height: 80px;
|
|
28
|
+
padding: 20px 0;
|
|
29
|
+
|
|
30
|
+
.video-thumb-list-item {
|
|
31
|
+
flex: 1;
|
|
32
|
+
cursor: pointer;
|
|
33
|
+
user-select: none;
|
|
34
|
+
|
|
35
|
+
img {
|
|
36
|
+
width: 100%;
|
|
37
|
+
height: 100%;
|
|
38
|
+
object-fit: cover;
|
|
39
|
+
transition: all 0.1s ease-in-out;
|
|
40
|
+
// 不允许拖动
|
|
41
|
+
pointer-events: none;
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
&:hover:not(.active) {
|
|
45
|
+
img {
|
|
46
|
+
transform: scale(1.05);
|
|
47
|
+
}
|
|
48
|
+
}
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
.video-thumb-list-drager {
|
|
52
|
+
position: absolute;
|
|
53
|
+
top: 20px;
|
|
54
|
+
left: 0;
|
|
55
|
+
width: 6px;
|
|
56
|
+
height: calc(100% - 40px);
|
|
57
|
+
background-color: rgb(var(--primary-5));
|
|
58
|
+
cursor: pointer;
|
|
59
|
+
}
|
|
60
|
+
}
|
|
61
|
+
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@cmstops/pro-compo",
|
|
3
|
-
"version": "0.3.
|
|
3
|
+
"version": "0.3.42",
|
|
4
4
|
"description": "",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"vue",
|
|
@@ -51,16 +51,16 @@
|
|
|
51
51
|
"colorthief": "^2.4.0",
|
|
52
52
|
"cropperjs": "^1.6.1",
|
|
53
53
|
"dayjs": "^1.11.9",
|
|
54
|
+
"diff": "^5.2.0",
|
|
54
55
|
"gif-to-canvas": "^1.0.0",
|
|
55
56
|
"gif.js": "^0.2.0",
|
|
56
57
|
"tus-js-client": "^3.1.1",
|
|
57
58
|
"vue": "^3.2.0",
|
|
58
|
-
"vuedraggable": "^4.1.0"
|
|
59
|
-
"diff": "^5.2.0"
|
|
59
|
+
"vuedraggable": "^4.1.0"
|
|
60
60
|
},
|
|
61
61
|
"devDependencies": {
|
|
62
62
|
"@arco-design/web-vue": "~2",
|
|
63
|
-
"@arco-iconbox/vue-cmstop-icons": "^0.0.
|
|
63
|
+
"@arco-iconbox/vue-cmstop-icons": "^0.0.30",
|
|
64
64
|
"@babel/core": "^7.14.6",
|
|
65
65
|
"@babel/plugin-proposal-class-properties": "^7.14.5",
|
|
66
66
|
"@babel/plugin-syntax-dynamic-import": "^7.8.3",
|
|
@@ -90,6 +90,7 @@
|
|
|
90
90
|
"colorthief": "^2.4.0",
|
|
91
91
|
"cropperjs": "^1.6.1",
|
|
92
92
|
"dayjs": "^1.11.9",
|
|
93
|
+
"diff": "^5.2.0",
|
|
93
94
|
"eslint": "^7.21.0",
|
|
94
95
|
"eslint-config-airbnb-base": "^14.2.1",
|
|
95
96
|
"eslint-config-prettier": "^8.3.0",
|
|
@@ -119,8 +120,7 @@
|
|
|
119
120
|
"vue": "^3.2.0",
|
|
120
121
|
"vue-loader": "^16.2.0",
|
|
121
122
|
"vuedraggable": "^4.1.0",
|
|
122
|
-
"webpack": "^5.88.2"
|
|
123
|
-
"diff": "^5.2.0"
|
|
123
|
+
"webpack": "^5.88.2"
|
|
124
124
|
},
|
|
125
125
|
"arcoMeta": {
|
|
126
126
|
"type": "vue-library",
|