@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,6 +1,6 @@
|
|
|
1
|
-
import { defineComponent, computed, openBlock, createElementBlock, normalizeClass, normalizeStyle, createVNode, unref,
|
|
1
|
+
import { defineComponent, computed, openBlock, createElementBlock, normalizeClass, normalizeStyle, createVNode, unref, createCommentVNode, Fragment, withCtx, createTextVNode, createElementVNode, createBlock, mergeProps, renderList, withModifiers, toDisplayString } from "vue";
|
|
2
2
|
import { IconPlus } from "@arco-design/web-vue/es/icon";
|
|
3
|
-
import { IconResource, IconComputer } from "@arco-iconbox/vue-cmstop-icons";
|
|
3
|
+
import { IconResource, IconComputer, IconVideoTag, IconAudioTag } from "@arco-iconbox/vue-cmstop-icons";
|
|
4
4
|
import { Progress, Dropdown, Doption, Image } from "@arco-design/web-vue";
|
|
5
5
|
import magic from "./assets/magic.js";
|
|
6
6
|
import { DEFAULT_BASE_API } from "../config.js";
|
|
@@ -9,9 +9,13 @@ const _hoisted_1 = {
|
|
|
9
9
|
key: 0,
|
|
10
10
|
class: "thumb-upload-loading"
|
|
11
11
|
};
|
|
12
|
-
const _hoisted_2 = {
|
|
13
|
-
|
|
14
|
-
|
|
12
|
+
const _hoisted_2 = {
|
|
13
|
+
key: 0,
|
|
14
|
+
class: "thumb-upload-text"
|
|
15
|
+
};
|
|
16
|
+
const _hoisted_3 = { class: "thumb-handler-list" };
|
|
17
|
+
const _hoisted_4 = ["onClick"];
|
|
18
|
+
const _hoisted_5 = {
|
|
15
19
|
key: 3,
|
|
16
20
|
class: "thumb-select-tag"
|
|
17
21
|
};
|
|
@@ -39,7 +43,7 @@ const _sfc_main = defineComponent({
|
|
|
39
43
|
var _a;
|
|
40
44
|
return ((_a = props.meta) == null ? void 0 : _a.progress) != null;
|
|
41
45
|
});
|
|
42
|
-
const
|
|
46
|
+
const realThumb = computed(() => {
|
|
43
47
|
if (["image", "video"].includes(props.catalog || "")) {
|
|
44
48
|
return props.thumb || props.url || "";
|
|
45
49
|
}
|
|
@@ -75,7 +79,7 @@ const _sfc_main = defineComponent({
|
|
|
75
79
|
emits("edit", { key });
|
|
76
80
|
}
|
|
77
81
|
return (_ctx, _cache) => {
|
|
78
|
-
var _a, _b;
|
|
82
|
+
var _a, _b, _c;
|
|
79
83
|
return openBlock(), createElementBlock("div", {
|
|
80
84
|
class: normalizeClass(["thumb-select-wrapper", classList.value]),
|
|
81
85
|
style: normalizeStyle(styleObject.value)
|
|
@@ -83,8 +87,9 @@ const _sfc_main = defineComponent({
|
|
|
83
87
|
isUploading.value ? (openBlock(), createElementBlock("div", _hoisted_1, [
|
|
84
88
|
createVNode(unref(Progress), {
|
|
85
89
|
type: "circle",
|
|
86
|
-
percent: (
|
|
87
|
-
}, null, 8, ["percent"])
|
|
90
|
+
percent: (_a = _ctx.meta) == null ? void 0 : _a.progress
|
|
91
|
+
}, null, 8, ["percent"]),
|
|
92
|
+
((_b = _ctx.meta) == null ? void 0 : _b.isTrans) ? (openBlock(), createElementBlock("div", _hoisted_2, "\u8F6C\u7801\u4E2D...")) : createCommentVNode("v-if", true)
|
|
88
93
|
])) : _ctx.isEdit && !_ctx.url ? (openBlock(), createElementBlock(Fragment, { key: 1 }, [
|
|
89
94
|
createCommentVNode(" \u7F16\u8F91\u6A21\u5F0F\u4E0B\u53EF\u4F7F\u7528\u60AC\u6D6E\u6846\u5FEB\u901F\u63D2\u5165\u7D20\u6750 "),
|
|
90
95
|
createVNode(unref(Dropdown), {
|
|
@@ -123,20 +128,23 @@ const _sfc_main = defineComponent({
|
|
|
123
128
|
_ctx.catalog ? (openBlock(), createBlock(unref(Image), mergeProps({
|
|
124
129
|
key: 0,
|
|
125
130
|
class: "thumb-image",
|
|
126
|
-
src:
|
|
131
|
+
src: realThumb.value
|
|
127
132
|
}, aImageAttr.value), null, 16, ["src"])) : createCommentVNode("v-if", true),
|
|
128
133
|
createCommentVNode(" \u5C55\u793A\u6A21\u5F0F "),
|
|
129
|
-
createElementVNode("div",
|
|
134
|
+
createElementVNode("div", _hoisted_3, [
|
|
130
135
|
(openBlock(true), createElementBlock(Fragment, null, renderList(_ctx.handlersKey, (item) => {
|
|
131
136
|
return openBlock(), createElementBlock("div", {
|
|
132
137
|
key: item.key,
|
|
133
138
|
class: "handler-item",
|
|
134
139
|
onClick: withModifiers(() => handleOption(item.key), ["stop"])
|
|
135
|
-
}, toDisplayString(item.label), 9,
|
|
140
|
+
}, toDisplayString(item.label), 9, _hoisted_4);
|
|
136
141
|
}), 128))
|
|
137
142
|
])
|
|
138
143
|
], 64)) : createCommentVNode("v-if", true),
|
|
139
|
-
["video", "audio"].includes(_ctx.catalog) && _ctx.meta ? (openBlock(), createElementBlock("div",
|
|
144
|
+
["video", "audio"].includes(_ctx.catalog) && _ctx.meta ? (openBlock(), createElementBlock("div", _hoisted_5, [
|
|
145
|
+
_ctx.catalog === "video" ? (openBlock(), createBlock(unref(IconVideoTag), { key: 0 })) : (openBlock(), createBlock(unref(IconAudioTag), { key: 1 })),
|
|
146
|
+
createTextVNode(" " + toDisplayString(unref(mediaTime)((_c = _ctx.meta) == null ? void 0 : _c.length)), 1)
|
|
147
|
+
])) : createCommentVNode("v-if", true)
|
|
140
148
|
], 6);
|
|
141
149
|
};
|
|
142
150
|
}
|
|
@@ -11,6 +11,7 @@
|
|
|
11
11
|
}
|
|
12
12
|
.thumb-select-wrapper .thumb-upload-loading {
|
|
13
13
|
display: flex;
|
|
14
|
+
flex-direction: column;
|
|
14
15
|
align-items: center;
|
|
15
16
|
justify-content: center;
|
|
16
17
|
width: 100%;
|
|
@@ -29,6 +30,8 @@
|
|
|
29
30
|
.thumb-select-wrapper .thumb-image img {
|
|
30
31
|
width: 100%;
|
|
31
32
|
height: 100%;
|
|
33
|
+
user-select: none;
|
|
34
|
+
-webkit-user-drag: none;
|
|
32
35
|
}
|
|
33
36
|
.thumb-select-wrapper .thumb-handler-list {
|
|
34
37
|
position: absolute;
|
|
@@ -68,9 +71,13 @@
|
|
|
68
71
|
position: absolute;
|
|
69
72
|
right: 5px;
|
|
70
73
|
bottom: 5px;
|
|
71
|
-
|
|
74
|
+
display: flex;
|
|
75
|
+
gap: 2px;
|
|
76
|
+
align-items: center;
|
|
77
|
+
padding: 2px 5px;
|
|
72
78
|
color: #fff;
|
|
73
79
|
font-size: 12px;
|
|
80
|
+
line-height: 14px;
|
|
74
81
|
background-color: rgba(0, 0, 0, 0.5);
|
|
75
82
|
border-radius: 16px;
|
|
76
83
|
opacity: 1;
|
|
@@ -13,6 +13,7 @@
|
|
|
13
13
|
// loading 模式
|
|
14
14
|
.thumb-upload-loading {
|
|
15
15
|
display: flex;
|
|
16
|
+
flex-direction: column;
|
|
16
17
|
align-items: center;
|
|
17
18
|
justify-content: center;
|
|
18
19
|
width: 100%;
|
|
@@ -37,6 +38,8 @@
|
|
|
37
38
|
img {
|
|
38
39
|
width: 100%;
|
|
39
40
|
height: 100%;
|
|
41
|
+
user-select: none;
|
|
42
|
+
-webkit-user-drag: none;
|
|
40
43
|
}
|
|
41
44
|
}
|
|
42
45
|
|
|
@@ -89,9 +92,13 @@
|
|
|
89
92
|
position: absolute;
|
|
90
93
|
right: 5px;
|
|
91
94
|
bottom: 5px;
|
|
92
|
-
|
|
95
|
+
display: flex;
|
|
96
|
+
gap: 2px;
|
|
97
|
+
align-items: center;
|
|
98
|
+
padding: 2px 5px;
|
|
93
99
|
color: #fff;
|
|
94
100
|
font-size: 12px;
|
|
101
|
+
line-height: 14px;
|
|
95
102
|
background-color: rgba(0, 0, 0, 0.5);
|
|
96
103
|
border-radius: 16px;
|
|
97
104
|
opacity: 1;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
export declare function getTranscodingProgress(BASE_API: string, id: number): import("axios").AxiosPromise<any>;
|
|
2
|
+
/**
|
|
3
|
+
* 转码逻辑
|
|
4
|
+
* @description 转码逻辑抽离,后期所有涉及到转码的地方都可用该方法
|
|
5
|
+
*/
|
|
6
|
+
export declare class TranscodingTask {
|
|
7
|
+
file: any;
|
|
8
|
+
pollCount: number;
|
|
9
|
+
taskInterval: any;
|
|
10
|
+
constructor(file: any);
|
|
11
|
+
start(BASE_API: string, callback: (progress: number) => any): Promise<unknown>;
|
|
12
|
+
abort(): void;
|
|
13
|
+
}
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
import request from "./request.js";
|
|
2
|
+
function getTranscodingProgress(BASE_API, id) {
|
|
3
|
+
return request(BASE_API, {
|
|
4
|
+
url: `/poplar/v2/transcoding/progress?id=${id}`,
|
|
5
|
+
method: "get"
|
|
6
|
+
});
|
|
7
|
+
}
|
|
8
|
+
class TranscodingTask {
|
|
9
|
+
constructor(file) {
|
|
10
|
+
this.file = file;
|
|
11
|
+
this.pollCount = 0;
|
|
12
|
+
}
|
|
13
|
+
start(BASE_API, callback) {
|
|
14
|
+
if (!this.file.id)
|
|
15
|
+
return Promise.reject(new Error("file error"));
|
|
16
|
+
return new Promise((resolve, reject) => {
|
|
17
|
+
const handleTranscoding = async () => {
|
|
18
|
+
const { code, message } = await getTranscodingProgress(
|
|
19
|
+
BASE_API,
|
|
20
|
+
this.file.id
|
|
21
|
+
);
|
|
22
|
+
if (code !== 0)
|
|
23
|
+
reject(new Error(message));
|
|
24
|
+
if (message.state === 1) {
|
|
25
|
+
callback(message.progress);
|
|
26
|
+
if (message.progress === 1 && ++this.pollCount === 3) {
|
|
27
|
+
this.abort();
|
|
28
|
+
resolve(false);
|
|
29
|
+
}
|
|
30
|
+
} else if (message.state === 2) {
|
|
31
|
+
this.abort();
|
|
32
|
+
resolve(false);
|
|
33
|
+
} else if (message.state === 3) {
|
|
34
|
+
this.abort();
|
|
35
|
+
resolve(true);
|
|
36
|
+
}
|
|
37
|
+
};
|
|
38
|
+
this.taskInterval = setInterval(handleTranscoding, 5e3);
|
|
39
|
+
});
|
|
40
|
+
}
|
|
41
|
+
abort() {
|
|
42
|
+
clearInterval(this.taskInterval);
|
|
43
|
+
this.taskInterval = null;
|
|
44
|
+
}
|
|
45
|
+
}
|
|
46
|
+
export { TranscodingTask, getTranscodingProgress };
|
|
@@ -5,6 +5,7 @@ var config = require("../config.js");
|
|
|
5
5
|
var useDocHistory = require("./scripts/useDocHistory.js");
|
|
6
6
|
var index$1 = require("./components/DocHistoryList/index.js");
|
|
7
7
|
var index = require("./components/DocDiffPanel/index.js");
|
|
8
|
+
var index$2 = require("../emptyData/index.js");
|
|
8
9
|
const _hoisted_1 = { class: "doc-history-wrap" };
|
|
9
10
|
const _hoisted_2 = { class: "doc-diff-panel" };
|
|
10
11
|
const _hoisted_3 = { class: "doc-history-list" };
|
|
@@ -54,43 +55,49 @@ const _sfc_main = vue.defineComponent({
|
|
|
54
55
|
}, {
|
|
55
56
|
default: vue.withCtx(() => [
|
|
56
57
|
vue.createElementVNode("div", _hoisted_1, [
|
|
57
|
-
vue.
|
|
58
|
-
vue.
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
vue.
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
vue.
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
vue.
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
vue.
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
58
|
+
vue.unref(list).length ? (vue.openBlock(), vue.createElementBlock(vue.Fragment, { key: 0 }, [
|
|
59
|
+
vue.createElementVNode("div", _hoisted_2, [
|
|
60
|
+
vue.createVNode(vue.unref(webVue.Spin), {
|
|
61
|
+
loading: vue.unref(loading),
|
|
62
|
+
style: { "height": "100%", "width": "100%" }
|
|
63
|
+
}, {
|
|
64
|
+
default: vue.withCtx(() => [
|
|
65
|
+
vue.createVNode(vue.unref(webVue.Scrollbar), {
|
|
66
|
+
"outer-style": { height: "100%" },
|
|
67
|
+
style: { "height": "100%", "overflow": "auto" }
|
|
68
|
+
}, {
|
|
69
|
+
default: vue.withCtx(() => [
|
|
70
|
+
vue.unref(diffContent) ? (vue.openBlock(), vue.createBlock(index, {
|
|
71
|
+
key: 0,
|
|
72
|
+
doc: vue.unref(diffContent)
|
|
73
|
+
}, null, 8, ["doc"])) : vue.createCommentVNode("v-if", true)
|
|
74
|
+
]),
|
|
75
|
+
_: 1
|
|
76
|
+
})
|
|
77
|
+
]),
|
|
78
|
+
_: 1
|
|
79
|
+
}, 8, ["loading"])
|
|
80
|
+
]),
|
|
81
|
+
vue.createElementVNode("div", _hoisted_3, [
|
|
82
|
+
vue.createVNode(vue.unref(webVue.Scrollbar), {
|
|
83
|
+
"outer-style": { height: "100%" },
|
|
84
|
+
style: { "height": "100%", "overflow": "auto" }
|
|
85
|
+
}, {
|
|
86
|
+
default: vue.withCtx(() => [
|
|
87
|
+
vue.createVNode(index$1, {
|
|
88
|
+
list: vue.unref(list),
|
|
89
|
+
current: vue.unref(current),
|
|
90
|
+
onSelect: vue.unref(handleSelect)
|
|
91
|
+
}, null, 8, ["list", "current", "onSelect"])
|
|
92
|
+
]),
|
|
93
|
+
_: 1
|
|
94
|
+
})
|
|
95
|
+
])
|
|
96
|
+
], 64)) : (vue.openBlock(), vue.createBlock(vue.unref(index$2), {
|
|
97
|
+
key: 1,
|
|
98
|
+
type: "empty",
|
|
99
|
+
"custom-tip": "\u6682\u65E0\u5386\u53F2\u8BB0\u5F55"
|
|
100
|
+
}))
|
|
94
101
|
])
|
|
95
102
|
]),
|
|
96
103
|
_: 1
|
package/lib/hooks/useUpload.js
CHANGED
|
@@ -4,6 +4,7 @@ var vue = require("vue");
|
|
|
4
4
|
var index = require("../utils/index.js");
|
|
5
5
|
var tusUpload = require("../utils/tusUpload.js");
|
|
6
6
|
var request = require("../utils/request.js");
|
|
7
|
+
var transcodeMedia = require("../utils/transcodeMedia.js");
|
|
7
8
|
function addMedia(BASE_API, params) {
|
|
8
9
|
return request(BASE_API, {
|
|
9
10
|
url: "/poplar/v2/media/add",
|
|
@@ -23,13 +24,15 @@ function useUpload() {
|
|
|
23
24
|
list.value = originList;
|
|
24
25
|
}
|
|
25
26
|
}
|
|
26
|
-
function recordTaskStatusChange(file, progress) {
|
|
27
|
+
function recordTaskStatusChange(file, progress, isTrans) {
|
|
27
28
|
const originList = list.value;
|
|
28
29
|
const taskIndex = originList.findIndex((task) => task.id === file.id);
|
|
29
30
|
if (taskIndex !== -1) {
|
|
30
|
-
progress !== -1 && (originList[taskIndex].progress = progress);
|
|
31
|
+
progress !== -1 && (originList[taskIndex].progress = Math.round(progress));
|
|
31
32
|
file.status != null && (originList[taskIndex].status = file.status);
|
|
32
33
|
file.msg != null && (originList[taskIndex].msg = file.msg);
|
|
34
|
+
if (isTrans)
|
|
35
|
+
originList[taskIndex].isTrans = true;
|
|
33
36
|
originList[taskIndex].url = file.url;
|
|
34
37
|
} else {
|
|
35
38
|
file.created_at = new Date().getTime();
|
|
@@ -66,24 +69,54 @@ function useUpload() {
|
|
|
66
69
|
});
|
|
67
70
|
if (code !== 0) {
|
|
68
71
|
console.log("\u{1F525}\u{1F525}\u{1F525}\u{1F525}\u{1F525} \u4E0A\u4F20\u5931\u8D25\uFF1A", newFile.name, code, message);
|
|
69
|
-
recordTaskStatusChange({ ...newFile, status: 2, msg: "\
|
|
72
|
+
recordTaskStatusChange({ ...newFile, status: 2, msg: "\u4E0A\u4F20\u5931\u8D25" }, -1);
|
|
70
73
|
return;
|
|
71
74
|
}
|
|
72
|
-
console.log("\u{1F680}\u{1F680}\u{1F680}\u{1F680}\u{1F680}\u{1F680} \u4E0A\u4F20\u6210\u529F\uFF1A", url);
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
uploadSuccess({ ...message, sig_id: newFile.sig_id });
|
|
76
|
-
}
|
|
75
|
+
console.log("\u{1F680}\u{1F680}\u{1F680}\u{1F680}\u{1F680}\u{1F680} \u4E0A\u4F20\u6210\u529F\uFF1A", url, message);
|
|
76
|
+
if (!["video", "audio"].includes(message.catalog)) {
|
|
77
|
+
recordTaskStatusChange({ ...newFile, url: message.url, status: 0 }, 1);
|
|
78
|
+
setTimeout(() => uploadSuccess({ ...message, sig_id: newFile.sig_id }), 200);
|
|
79
|
+
} else {
|
|
80
|
+
recordTaskStatusChange(newFile, 0);
|
|
81
|
+
}
|
|
77
82
|
callback && callback({ ...message, sig_id: newFile.sig_id }, "success");
|
|
78
83
|
}).catch((e) => {
|
|
79
84
|
console.log("\u{1F525}\u{1F525}\u{1F525}\u{1F525}\u{1F525} \u4E0A\u4F20\u5931\u8D25\uFF1A", e);
|
|
80
|
-
recordTaskStatusChange({ ...newFile, status: 2, msg: "\
|
|
85
|
+
recordTaskStatusChange({ ...newFile, status: 2, msg: "\u5931\u8D25" }, -1);
|
|
81
86
|
callback && callback(newFile, "fail");
|
|
82
87
|
});
|
|
83
88
|
};
|
|
89
|
+
const transcodingFile = (BASE_API, file) => {
|
|
90
|
+
if (!["video", "audio"].includes(file.catalog))
|
|
91
|
+
return;
|
|
92
|
+
const task = new transcodeMedia.TranscodingTask(file);
|
|
93
|
+
const idx = list.value.findIndex(
|
|
94
|
+
(item2) => item2.sig_id === file.sig_id
|
|
95
|
+
);
|
|
96
|
+
if (idx === -1)
|
|
97
|
+
return;
|
|
98
|
+
const item = list.value[idx];
|
|
99
|
+
recordTaskStatusChange(item, 0, true);
|
|
100
|
+
const progress = (progress2) => recordTaskStatusChange(item, progress2);
|
|
101
|
+
const transing = task.start(BASE_API, progress);
|
|
102
|
+
transing.then((res) => {
|
|
103
|
+
if (res) {
|
|
104
|
+
console.log("\u{1F680}\u{1F680}\u{1F680}\u{1F680}\u{1F680}\u{1F680} \u8F6C\u7801\u6210\u529F");
|
|
105
|
+
recordTaskStatusChange({ ...item, status: 0 }, 1);
|
|
106
|
+
setTimeout(() => uploadSuccess(file), 200);
|
|
107
|
+
} else {
|
|
108
|
+
console.log("\u{1F525}\u{1F525}\u{1F525}\u{1F525}\u{1F525} \u8F6C\u7801\u5931\u8D25\uFF1A", item);
|
|
109
|
+
recordTaskStatusChange({ ...item, status: 2, msg: "\u8F6C\u7801\u5931\u8D25" }, -1);
|
|
110
|
+
}
|
|
111
|
+
}).catch((e) => {
|
|
112
|
+
console.log("\u{1F525}\u{1F525}\u{1F525}\u{1F525}\u{1F525} \u8F6C\u7801\u5931\u8D25", e);
|
|
113
|
+
recordTaskStatusChange({ ...item, status: 2, msg: "\u8F6C\u7801\u5931\u8D25" }, -1);
|
|
114
|
+
});
|
|
115
|
+
};
|
|
84
116
|
return {
|
|
85
117
|
list,
|
|
86
118
|
uploadFile,
|
|
119
|
+
transcodingFile,
|
|
87
120
|
recordTaskStatusChange
|
|
88
121
|
};
|
|
89
122
|
}
|
package/lib/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,11 +1,12 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
var vue = require("vue");
|
|
3
|
-
const _hoisted_1 = { class: "
|
|
4
|
-
const _hoisted_2 = {
|
|
3
|
+
const _hoisted_1 = /* @__PURE__ */ vue.createElementVNode("div", { class: "mask" }, null, -1);
|
|
4
|
+
const _hoisted_2 = { class: "card-alias" };
|
|
5
|
+
const _hoisted_3 = {
|
|
5
6
|
key: 0,
|
|
6
7
|
class: "check-box active"
|
|
7
8
|
};
|
|
8
|
-
const
|
|
9
|
+
const _hoisted_4 = {
|
|
9
10
|
key: 1,
|
|
10
11
|
class: "check-box"
|
|
11
12
|
};
|
|
@@ -39,16 +40,17 @@ const _sfc_main = vue.defineComponent({
|
|
|
39
40
|
onClick: vue.withModifiers(handleCheck, ["stop"])
|
|
40
41
|
}, [
|
|
41
42
|
vue.createElementVNode("div", {
|
|
42
|
-
class: vue.normalizeClass(["card-wrapper", { active: selectedOrder.value[_ctx.item.id] }])
|
|
43
|
+
class: vue.normalizeClass(["card-wrapper", { disable: _ctx.disable, active: selectedOrder.value[_ctx.item.id] }])
|
|
43
44
|
}, [
|
|
44
|
-
vue.renderSlot(_ctx.$slots, "default")
|
|
45
|
+
vue.renderSlot(_ctx.$slots, "default"),
|
|
46
|
+
_hoisted_1
|
|
45
47
|
], 2),
|
|
46
|
-
vue.createElementVNode("div",
|
|
48
|
+
vue.createElementVNode("div", _hoisted_2, vue.toDisplayString(_ctx.item.alias), 1),
|
|
47
49
|
vue.createElementVNode("div", {
|
|
48
50
|
class: "check-box-wrapper",
|
|
49
51
|
onClick: vue.withModifiers(handleCheck, ["stop"])
|
|
50
52
|
}, [
|
|
51
|
-
selectedOrder.value[_ctx.item.id] ? (vue.openBlock(), vue.createElementBlock("div",
|
|
53
|
+
selectedOrder.value[_ctx.item.id] ? (vue.openBlock(), vue.createElementBlock("div", _hoisted_3, vue.toDisplayString(selectedOrder.value[_ctx.item.id]), 1)) : !_ctx.disable ? (vue.openBlock(), vue.createElementBlock("div", _hoisted_4)) : vue.createCommentVNode("v-if", true)
|
|
52
54
|
])
|
|
53
55
|
]);
|
|
54
56
|
};
|
|
@@ -22,6 +22,12 @@ const _sfc_main = vue.defineComponent({
|
|
|
22
22
|
setup(__props, { emit: __emit }) {
|
|
23
23
|
const props = __props;
|
|
24
24
|
const emits = __emit;
|
|
25
|
+
const userInfo = vue.inject("userInfo");
|
|
26
|
+
const baseAPI = vue.inject("baseAPI");
|
|
27
|
+
const repoId = vue.computed(() => {
|
|
28
|
+
var _a;
|
|
29
|
+
return (_a = userInfo == null ? void 0 : userInfo.value) == null ? void 0 : _a.repository_id;
|
|
30
|
+
});
|
|
25
31
|
const handlersKey = vue.computed(() => {
|
|
26
32
|
var _a;
|
|
27
33
|
if (((_a = props.selectKeys) == null ? void 0 : _a.length) > 0 || props.disable)
|
|
@@ -34,17 +40,17 @@ const _sfc_main = vue.defineComponent({
|
|
|
34
40
|
emits("select-one", item);
|
|
35
41
|
}
|
|
36
42
|
}
|
|
37
|
-
const { list, uploadFile } = useUpload["default"]();
|
|
38
|
-
const userInfo = vue.inject("userInfo");
|
|
39
|
-
const baseAPI = vue.inject("baseAPI");
|
|
40
|
-
const repoId = vue.computed(() => {
|
|
41
|
-
var _a;
|
|
42
|
-
return (_a = userInfo == null ? void 0 : userInfo.value) == null ? void 0 : _a.repository_id;
|
|
43
|
-
});
|
|
43
|
+
const { list, uploadFile, transcodingFile } = useUpload["default"]();
|
|
44
44
|
function handleChange(file) {
|
|
45
45
|
if (!baseAPI || !repoId.value)
|
|
46
46
|
return;
|
|
47
|
-
uploadFile(
|
|
47
|
+
uploadFile(
|
|
48
|
+
baseAPI,
|
|
49
|
+
file.file,
|
|
50
|
+
0,
|
|
51
|
+
repoId.value,
|
|
52
|
+
(media) => transcodingFile(baseAPI, media)
|
|
53
|
+
);
|
|
48
54
|
}
|
|
49
55
|
return (_ctx, _cache) => {
|
|
50
56
|
var _a, _b;
|
|
@@ -2,13 +2,15 @@
|
|
|
2
2
|
var vue = require("vue");
|
|
3
3
|
var webVue = require("@arco-design/web-vue");
|
|
4
4
|
var icon = require("@arco-design/web-vue/es/icon");
|
|
5
|
+
var vueCmstopIcons = require("@arco-iconbox/vue-cmstop-icons");
|
|
5
6
|
const _hoisted_1 = { class: "list-selected-wrapper" };
|
|
6
7
|
const _hoisted_2 = { key: 0 };
|
|
7
8
|
const _hoisted_3 = { class: "list-panel-header" };
|
|
8
9
|
const _hoisted_4 = { class: "header-options" };
|
|
9
10
|
const _hoisted_5 = { class: "list-selected-record" };
|
|
10
11
|
const _hoisted_6 = { class: "item-thumb" };
|
|
11
|
-
const _hoisted_7 = { class: "item-
|
|
12
|
+
const _hoisted_7 = { class: "item-tag" };
|
|
13
|
+
const _hoisted_8 = { class: "item-alias" };
|
|
12
14
|
const _sfc_main = vue.defineComponent({
|
|
13
15
|
__name: "index",
|
|
14
16
|
props: {
|
|
@@ -18,6 +20,10 @@ const _sfc_main = vue.defineComponent({
|
|
|
18
20
|
emits: ["remove", "clear"],
|
|
19
21
|
setup(__props, { emit: __emit }) {
|
|
20
22
|
const emits = __emit;
|
|
23
|
+
const baseAPI = vue.inject("baseAPI");
|
|
24
|
+
const audioThumb = vue.computed(() => {
|
|
25
|
+
return `${baseAPI}/static/img/music.2ee269c.png`;
|
|
26
|
+
});
|
|
21
27
|
const visible = vue.ref(false);
|
|
22
28
|
return (_ctx, _cache) => {
|
|
23
29
|
return vue.openBlock(), vue.createElementBlock("div", _hoisted_1, [
|
|
@@ -57,11 +63,18 @@ const _sfc_main = vue.defineComponent({
|
|
|
57
63
|
height: "100%",
|
|
58
64
|
src: item.thumb || item.url
|
|
59
65
|
}, null, 8, ["src"])) : vue.createCommentVNode("v-if", true),
|
|
60
|
-
["audio"].includes(item.catalog) ? (vue.openBlock(), vue.
|
|
61
|
-
|
|
62
|
-
|
|
66
|
+
["audio"].includes(item.catalog) ? (vue.openBlock(), vue.createBlock(vue.unref(webVue.Image), {
|
|
67
|
+
key: 1,
|
|
68
|
+
width: "100%",
|
|
69
|
+
height: "100%",
|
|
70
|
+
fit: "cover",
|
|
71
|
+
src: audioThumb.value
|
|
72
|
+
}, null, 8, ["src"])) : vue.createCommentVNode("v-if", true),
|
|
73
|
+
vue.createElementVNode("div", _hoisted_7, [
|
|
74
|
+
item.catalog === "video" ? (vue.openBlock(), vue.createBlock(vue.unref(vueCmstopIcons.IconVideoTag), { key: 0 })) : vue.createCommentVNode("v-if", true)
|
|
75
|
+
])
|
|
63
76
|
]),
|
|
64
|
-
vue.createElementVNode("div",
|
|
77
|
+
vue.createElementVNode("div", _hoisted_8, vue.toDisplayString(item.alias), 1),
|
|
65
78
|
vue.createVNode(vue.unref(webVue.Button), {
|
|
66
79
|
type: "text",
|
|
67
80
|
onClick: ($event) => emits("remove", item)
|
|
@@ -130,7 +130,7 @@ const _sfc_main = vue.defineComponent({
|
|
|
130
130
|
vue.createCommentVNode(" \u7B5B\u9009 "),
|
|
131
131
|
activeKey.value !== "local" ? (vue.openBlock(), vue.createElementBlock("div", _hoisted_4, [
|
|
132
132
|
vue.createVNode(index, {
|
|
133
|
-
"disable-upload-by":
|
|
133
|
+
"disable-upload-by": !["all", "remind"].includes(activeKey.value),
|
|
134
134
|
filterOptions: _ctx.filterOptions,
|
|
135
135
|
onChange: vue.unref(changeFilter),
|
|
136
136
|
onUpload: handleToUpload
|