@cmstops/pro-compo 0.3.48 → 0.3.50
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/useAttachement.js +1 -1
- package/es/hooks/useUpload.d.ts +1 -0
- package/es/hooks/useUpload.js +28 -10
- package/es/index.css +30 -13
- package/es/selectResourceModal/component.js +1 -0
- package/es/selectResourceModal/components/ListCardWrapper/index.js +48 -6
- package/es/selectResourceModal/components/ListContent/index.js +6 -32
- package/es/selectResourceModal/components/ListContentLocal/index.js +30 -35
- package/es/selectResourceModal/components/ListFilter/index.js +17 -11
- 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/lib/docPreview/component.js +33 -30
- package/lib/hooks/useAttachement.js +1 -1
- package/lib/hooks/useUpload.js +28 -10
- package/lib/index.css +30 -13
- package/lib/selectResourceModal/component.js +1 -0
- package/lib/selectResourceModal/components/ListCardWrapper/index.js +49 -7
- package/lib/selectResourceModal/components/ListContent/index.js +7 -33
- package/lib/selectResourceModal/components/ListContentLocal/index.js +29 -34
- package/lib/selectResourceModal/components/ListFilter/index.js +17 -11
- 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/package.json +1 -1
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
var vue = require("vue");
|
|
3
|
+
var index = require("../../../thumbCard/index.js");
|
|
3
4
|
const _hoisted_1 = /* @__PURE__ */ vue.createElementVNode("div", { class: "mask" }, null, -1);
|
|
4
5
|
const _hoisted_2 = { class: "card-alias" };
|
|
5
6
|
const _hoisted_3 = {
|
|
@@ -14,23 +15,53 @@ const _sfc_main = vue.defineComponent({
|
|
|
14
15
|
__name: "index",
|
|
15
16
|
props: {
|
|
16
17
|
item: {},
|
|
18
|
+
extraKeys: {},
|
|
17
19
|
selectKeys: {},
|
|
18
20
|
disable: { type: Boolean }
|
|
19
21
|
},
|
|
20
|
-
emits: ["select"],
|
|
22
|
+
emits: ["select", "select-one", "options"],
|
|
21
23
|
setup(__props, { emit: __emit }) {
|
|
22
24
|
const props = __props;
|
|
23
25
|
const emits = __emit;
|
|
26
|
+
const filterOptions = vue.inject("filterOptions");
|
|
24
27
|
const selectedOrder = vue.computed(() => {
|
|
25
28
|
var _a;
|
|
26
29
|
const result = {};
|
|
27
|
-
(_a = props.selectKeys) == null ? void 0 : _a.forEach((key,
|
|
28
|
-
result[key] =
|
|
30
|
+
(_a = props.selectKeys) == null ? void 0 : _a.forEach((key, index2) => {
|
|
31
|
+
result[key] = index2 + 1;
|
|
29
32
|
});
|
|
30
33
|
return result;
|
|
31
34
|
});
|
|
35
|
+
const canIUse = vue.computed(() => {
|
|
36
|
+
if (props.disable)
|
|
37
|
+
return false;
|
|
38
|
+
if (filterOptions == null ? void 0 : filterOptions.value) {
|
|
39
|
+
const { mediaType, mediaTypeStrict } = filterOptions.value;
|
|
40
|
+
if (mediaTypeStrict)
|
|
41
|
+
return props.item.catalog === mediaType;
|
|
42
|
+
}
|
|
43
|
+
if (props.item.progress >= 0)
|
|
44
|
+
return false;
|
|
45
|
+
return true;
|
|
46
|
+
});
|
|
47
|
+
const handlersKey = vue.computed(() => {
|
|
48
|
+
var _a;
|
|
49
|
+
if (props.item.status === 2) {
|
|
50
|
+
return [
|
|
51
|
+
{ label: "\u91CD\u65B0\u4E0A\u4F20", key: "reupload" },
|
|
52
|
+
{ label: "\u5220\u9664\u8BB0\u5F55", key: "remove" }
|
|
53
|
+
];
|
|
54
|
+
}
|
|
55
|
+
if (props.item.status === 3) {
|
|
56
|
+
return [{ label: "\u91CD\u65B0\u8F6C\u7801", key: "retranscode" }];
|
|
57
|
+
}
|
|
58
|
+
if (((_a = props.selectKeys) == null ? void 0 : _a.length) > 0 || props.disable || !canIUse.value) {
|
|
59
|
+
return [];
|
|
60
|
+
}
|
|
61
|
+
return [{ label: "\u9009\u7528", key: "select-one" }].concat(props.extraKeys || []);
|
|
62
|
+
});
|
|
32
63
|
function handleCheck() {
|
|
33
|
-
if (
|
|
64
|
+
if (!canIUse.value && !selectedOrder.value[props.item.id])
|
|
34
65
|
return;
|
|
35
66
|
emits("select", props.item);
|
|
36
67
|
}
|
|
@@ -40,9 +71,20 @@ const _sfc_main = vue.defineComponent({
|
|
|
40
71
|
onClick: vue.withModifiers(handleCheck, ["stop"])
|
|
41
72
|
}, [
|
|
42
73
|
vue.createElementVNode("div", {
|
|
43
|
-
class: vue.normalizeClass(["card-wrapper", { disable:
|
|
74
|
+
class: vue.normalizeClass(["card-wrapper", { disable: !canIUse.value, active: selectedOrder.value[_ctx.item.id] }])
|
|
44
75
|
}, [
|
|
45
|
-
vue.
|
|
76
|
+
vue.createVNode(vue.unref(index), {
|
|
77
|
+
url: _ctx.item.url,
|
|
78
|
+
thumb: _ctx.item.thumb || _ctx.item.url,
|
|
79
|
+
catalog: _ctx.item.catalog,
|
|
80
|
+
meta: _ctx.item,
|
|
81
|
+
options: {
|
|
82
|
+
fit: _ctx.item.catalog === "image" ? "contain" : "cover"
|
|
83
|
+
},
|
|
84
|
+
"use-mask": true,
|
|
85
|
+
"handlers-key": handlersKey.value,
|
|
86
|
+
onHandle: _cache[0] || (_cache[0] = (e) => emits("options", e))
|
|
87
|
+
}, null, 8, ["url", "thumb", "catalog", "meta", "options", "handlers-key"]),
|
|
46
88
|
_hoisted_1
|
|
47
89
|
], 2),
|
|
48
90
|
vue.createElementVNode("div", _hoisted_2, vue.toDisplayString(_ctx.item.alias), 1),
|
|
@@ -50,7 +92,7 @@ const _sfc_main = vue.defineComponent({
|
|
|
50
92
|
class: "check-box-wrapper",
|
|
51
93
|
onClick: vue.withModifiers(handleCheck, ["stop"])
|
|
52
94
|
}, [
|
|
53
|
-
selectedOrder.value[_ctx.item.id] ? (vue.openBlock(), vue.createElementBlock("div", _hoisted_3, vue.toDisplayString(selectedOrder.value[_ctx.item.id]), 1)) :
|
|
95
|
+
selectedOrder.value[_ctx.item.id] ? (vue.openBlock(), vue.createElementBlock("div", _hoisted_3, vue.toDisplayString(selectedOrder.value[_ctx.item.id]), 1)) : canIUse.value ? (vue.openBlock(), vue.createElementBlock("div", _hoisted_4)) : vue.createCommentVNode("v-if", true)
|
|
54
96
|
])
|
|
55
97
|
]);
|
|
56
98
|
};
|
|
@@ -1,8 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
var vue = require("vue");
|
|
3
3
|
var webVue = require("@arco-design/web-vue");
|
|
4
|
-
var index$
|
|
5
|
-
var index$1 = require("../../../thumbCard/index.js");
|
|
4
|
+
var index$1 = require("../../../emptyData/index.js");
|
|
6
5
|
var index = require("../ListCardWrapper/index.js");
|
|
7
6
|
const _hoisted_1 = { class: "card-list-wrapper" };
|
|
8
7
|
const _sfc_main = vue.defineComponent({
|
|
@@ -15,19 +14,9 @@ const _sfc_main = vue.defineComponent({
|
|
|
15
14
|
},
|
|
16
15
|
emits: ["select", "select-one"],
|
|
17
16
|
setup(__props, { emit: __emit }) {
|
|
18
|
-
const props = __props;
|
|
19
17
|
const emits = __emit;
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
if (((_a = props.selectKeys) == null ? void 0 : _a.length) > 0 || props.disable)
|
|
23
|
-
return [];
|
|
24
|
-
return [{ label: "\u9009\u7528", key: "select" }];
|
|
25
|
-
});
|
|
26
|
-
function handleOption(params) {
|
|
27
|
-
const { key, item } = params;
|
|
28
|
-
if (key === "select") {
|
|
29
|
-
emits("select-one", item);
|
|
30
|
-
}
|
|
18
|
+
function handleOptions(e) {
|
|
19
|
+
emits(e.key, e.item);
|
|
31
20
|
}
|
|
32
21
|
return (_ctx, _cache) => {
|
|
33
22
|
var _a, _b;
|
|
@@ -38,30 +27,15 @@ const _sfc_main = vue.defineComponent({
|
|
|
38
27
|
item,
|
|
39
28
|
"select-keys": _ctx.selectKeys,
|
|
40
29
|
disable: _ctx.disable,
|
|
41
|
-
onSelect: () => emits("select", item)
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
vue.createVNode(vue.unref(index$1), {
|
|
45
|
-
url: item.url,
|
|
46
|
-
thumb: item.thumb,
|
|
47
|
-
catalog: item.catalog,
|
|
48
|
-
meta: item,
|
|
49
|
-
"use-mask": true,
|
|
50
|
-
"handlers-key": handlersKey.value,
|
|
51
|
-
options: {
|
|
52
|
-
fit: item.catalog === "image" ? "contain" : "cover"
|
|
53
|
-
},
|
|
54
|
-
onHandle: handleOption
|
|
55
|
-
}, null, 8, ["url", "thumb", "catalog", "meta", "handlers-key", "options"])
|
|
56
|
-
]),
|
|
57
|
-
_: 2
|
|
58
|
-
}, 1032, ["item", "select-keys", "disable", "onSelect"]);
|
|
30
|
+
onSelect: () => emits("select", item),
|
|
31
|
+
onOptions: handleOptions
|
|
32
|
+
}, null, 8, ["item", "select-keys", "disable", "onSelect"]);
|
|
59
33
|
}), 128)),
|
|
60
34
|
vue.createCommentVNode(" \u7A7A\u72B6\u6001 "),
|
|
61
35
|
((_a = _ctx.list) == null ? void 0 : _a.length) === 0 && _ctx.loading ? (vue.openBlock(), vue.createBlock(vue.unref(webVue.Spin), {
|
|
62
36
|
key: 0,
|
|
63
37
|
loading: true
|
|
64
|
-
})) : !((_b = _ctx.list) == null ? void 0 : _b.length) ? (vue.openBlock(), vue.createBlock(vue.unref(index$
|
|
38
|
+
})) : !((_b = _ctx.list) == null ? void 0 : _b.length) ? (vue.openBlock(), vue.createBlock(vue.unref(index$1), {
|
|
65
39
|
key: 1,
|
|
66
40
|
type: "empty",
|
|
67
41
|
customTip: "\u6682\u65E0\u6570\u636E"
|
|
@@ -2,7 +2,6 @@
|
|
|
2
2
|
var vue = require("vue");
|
|
3
3
|
var Upload = require("./components/Upload.js");
|
|
4
4
|
var useUpload = require("../../../hooks/useUpload.js");
|
|
5
|
-
var index$1 = require("../../../thumbCard/index.js");
|
|
6
5
|
var index = require("../ListCardWrapper/index.js");
|
|
7
6
|
const _hoisted_1 = { class: "upload-list-wrapper" };
|
|
8
7
|
const _hoisted_2 = { class: "list-upload" };
|
|
@@ -18,9 +17,8 @@ const _sfc_main = vue.defineComponent({
|
|
|
18
17
|
selectKeys: {},
|
|
19
18
|
disable: { type: Boolean }
|
|
20
19
|
},
|
|
21
|
-
emits: ["select", "select-one"],
|
|
20
|
+
emits: ["select", "select-one", "reupload"],
|
|
22
21
|
setup(__props, { emit: __emit }) {
|
|
23
|
-
const props = __props;
|
|
24
22
|
const emits = __emit;
|
|
25
23
|
const userInfo = vue.inject("userInfo");
|
|
26
24
|
const baseAPI = vue.inject("baseAPI");
|
|
@@ -28,19 +26,7 @@ const _sfc_main = vue.defineComponent({
|
|
|
28
26
|
var _a;
|
|
29
27
|
return (_a = userInfo == null ? void 0 : userInfo.value) == null ? void 0 : _a.repository_id;
|
|
30
28
|
});
|
|
31
|
-
const
|
|
32
|
-
var _a;
|
|
33
|
-
if (((_a = props.selectKeys) == null ? void 0 : _a.length) > 0 || props.disable)
|
|
34
|
-
return [];
|
|
35
|
-
return [{ label: "\u9009\u7528", key: "select" }];
|
|
36
|
-
});
|
|
37
|
-
function handleOption(params) {
|
|
38
|
-
const { key, item } = params;
|
|
39
|
-
if (key === "select") {
|
|
40
|
-
emits("select-one", item);
|
|
41
|
-
}
|
|
42
|
-
}
|
|
43
|
-
const { list, uploadFile, transcodingFile } = useUpload["default"]();
|
|
29
|
+
const { list, uploadFile, transcodingFile, removeRecord } = useUpload["default"]();
|
|
44
30
|
function handleChange(file) {
|
|
45
31
|
if (!baseAPI || !repoId.value)
|
|
46
32
|
return;
|
|
@@ -52,6 +38,30 @@ const _sfc_main = vue.defineComponent({
|
|
|
52
38
|
(media) => transcodingFile(baseAPI, media)
|
|
53
39
|
);
|
|
54
40
|
}
|
|
41
|
+
function handleOptions(e) {
|
|
42
|
+
var _a, _b;
|
|
43
|
+
if (e.key === "reupload") {
|
|
44
|
+
if (!e.item || !((_a = e.item) == null ? void 0 : _a.originFile))
|
|
45
|
+
return;
|
|
46
|
+
e.item.originFile.sig_id = e.item.sig_id;
|
|
47
|
+
e.item.originFile.id = e.item.id;
|
|
48
|
+
handleChange({ file: e.item.originFile });
|
|
49
|
+
return;
|
|
50
|
+
}
|
|
51
|
+
if (e.key === "retranscode") {
|
|
52
|
+
if (!baseAPI || !((_b = e.item) == null ? void 0 : _b.mediaFile))
|
|
53
|
+
return;
|
|
54
|
+
transcodingFile(baseAPI, e.item.mediaFile);
|
|
55
|
+
return;
|
|
56
|
+
}
|
|
57
|
+
if (e.key === "remove") {
|
|
58
|
+
if (!e.item)
|
|
59
|
+
return;
|
|
60
|
+
removeRecord(e.item);
|
|
61
|
+
return;
|
|
62
|
+
}
|
|
63
|
+
emits(e.key, e.item);
|
|
64
|
+
}
|
|
55
65
|
return (_ctx, _cache) => {
|
|
56
66
|
var _a, _b;
|
|
57
67
|
return vue.openBlock(), vue.createElementBlock("div", _hoisted_1, [
|
|
@@ -69,24 +79,9 @@ const _sfc_main = vue.defineComponent({
|
|
|
69
79
|
item,
|
|
70
80
|
"select-keys": _ctx.selectKeys,
|
|
71
81
|
disable: _ctx.disable,
|
|
72
|
-
onSelect: () => emits("select", item)
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
vue.createVNode(vue.unref(index$1), {
|
|
76
|
-
url: item.url,
|
|
77
|
-
thumb: item.thumb || item.url,
|
|
78
|
-
catalog: item.catalog,
|
|
79
|
-
meta: item,
|
|
80
|
-
options: {
|
|
81
|
-
fit: item.catalog === "image" ? "contain" : "cover"
|
|
82
|
-
},
|
|
83
|
-
"use-mask": true,
|
|
84
|
-
"handlers-key": handlersKey.value,
|
|
85
|
-
onHandle: handleOption
|
|
86
|
-
}, null, 8, ["url", "thumb", "catalog", "meta", "options", "handlers-key"])
|
|
87
|
-
]),
|
|
88
|
-
_: 2
|
|
89
|
-
}, 1032, ["item", "select-keys", "disable", "onSelect"]);
|
|
82
|
+
onSelect: () => emits("select", item),
|
|
83
|
+
onOptions: handleOptions
|
|
84
|
+
}, null, 8, ["item", "select-keys", "disable", "onSelect"]);
|
|
90
85
|
}), 128))
|
|
91
86
|
])
|
|
92
87
|
])
|
|
@@ -75,8 +75,18 @@ const _sfc_main = vue.defineComponent({
|
|
|
75
75
|
set(val) {
|
|
76
76
|
if (val) {
|
|
77
77
|
const [start, end] = val;
|
|
78
|
-
|
|
79
|
-
|
|
78
|
+
const created_begin = new Date(start);
|
|
79
|
+
const created_end = new Date(end);
|
|
80
|
+
created_begin.setHours(0, 0, 0, 0);
|
|
81
|
+
created_end.setHours(23, 59, 59, 0);
|
|
82
|
+
filter.value.created_begin = parseInt(
|
|
83
|
+
(created_begin.getTime() / 1e3).toFixed(0),
|
|
84
|
+
10
|
|
85
|
+
);
|
|
86
|
+
filter.value.created_end = parseInt(
|
|
87
|
+
(created_end.getTime() / 1e3).toFixed(0),
|
|
88
|
+
10
|
|
89
|
+
);
|
|
80
90
|
} else {
|
|
81
91
|
filter.value.created_begin = "";
|
|
82
92
|
filter.value.created_end = "";
|
|
@@ -104,9 +114,7 @@ const _sfc_main = vue.defineComponent({
|
|
|
104
114
|
vue.watch(
|
|
105
115
|
() => searchType.value,
|
|
106
116
|
() => {
|
|
107
|
-
filter.value.
|
|
108
|
-
filter.value.precise_keyword = "";
|
|
109
|
-
filter.value.keyword = "";
|
|
117
|
+
searchInput.value = filter.value.keyword || filter.value.precise_keyword;
|
|
110
118
|
}
|
|
111
119
|
);
|
|
112
120
|
const isEmpty = vue.computed(() => {
|
|
@@ -136,17 +144,15 @@ const _sfc_main = vue.defineComponent({
|
|
|
136
144
|
var _a;
|
|
137
145
|
if ((_a = props.filterOptions) == null ? void 0 : _a.mediaType) {
|
|
138
146
|
filter.value.catalog = props.filterOptions.mediaType;
|
|
147
|
+
if (props.filterOptions.mediaTypeStrict) {
|
|
148
|
+
originFilter.catalog = props.filterOptions.mediaType;
|
|
149
|
+
}
|
|
139
150
|
}
|
|
140
151
|
},
|
|
141
|
-
{ immediate: true }
|
|
152
|
+
{ immediate: true, deep: true }
|
|
142
153
|
);
|
|
143
154
|
vue.onMounted(() => {
|
|
144
|
-
var _a;
|
|
145
155
|
load();
|
|
146
|
-
if (((_a = props.filterOptions) == null ? void 0 : _a.mediaType) && !props.filterOptions.mediaTypeStrict) {
|
|
147
|
-
filter.value.catalog = props.filterOptions.mediaType;
|
|
148
|
-
originFilter.catalog = props.filterOptions.mediaType;
|
|
149
|
-
}
|
|
150
156
|
});
|
|
151
157
|
__expose({
|
|
152
158
|
resetFilter: handleReset
|
|
@@ -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 {
|
|
@@ -4,21 +4,13 @@ var vueCmstopIcons = require("@arco-iconbox/vue-cmstop-icons");
|
|
|
4
4
|
var webVue = require("@arco-design/web-vue");
|
|
5
5
|
var magic = require("./assets/magic.js");
|
|
6
6
|
var config = require("../config.js");
|
|
7
|
-
var index = require("../utils/index.js");
|
|
7
|
+
var index$1 = require("../utils/index.js");
|
|
8
|
+
var index = require("./components/ThumbUploading/index.js");
|
|
8
9
|
const _hoisted_1 = {
|
|
9
|
-
key: 0,
|
|
10
|
-
class: "thumb-upload-loading"
|
|
11
|
-
};
|
|
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 = {
|
|
19
10
|
key: 2,
|
|
20
11
|
class: "thumb-select-tag"
|
|
21
12
|
};
|
|
13
|
+
const _hoisted_2 = ["onClick"];
|
|
22
14
|
const _sfc_main = vue.defineComponent({
|
|
23
15
|
...{ name: "thumbCard" },
|
|
24
16
|
__name: "component",
|
|
@@ -30,7 +22,8 @@ const _sfc_main = vue.defineComponent({
|
|
|
30
22
|
options: {},
|
|
31
23
|
meta: {},
|
|
32
24
|
catalog: {},
|
|
33
|
-
handlersKey: {}
|
|
25
|
+
handlersKey: {},
|
|
26
|
+
handlersAlways: { type: Boolean }
|
|
34
27
|
},
|
|
35
28
|
emits: ["handle", "edit"],
|
|
36
29
|
setup(__props, { emit: __emit }) {
|
|
@@ -62,6 +55,13 @@ const _sfc_main = vue.defineComponent({
|
|
|
62
55
|
}
|
|
63
56
|
return list;
|
|
64
57
|
});
|
|
58
|
+
const thumbHandlerClass = vue.computed(() => {
|
|
59
|
+
const list = [];
|
|
60
|
+
if (props.handlersAlways) {
|
|
61
|
+
list.push("thumb-handler-always");
|
|
62
|
+
}
|
|
63
|
+
return list;
|
|
64
|
+
});
|
|
65
65
|
const aImageAttr = vue.computed(() => {
|
|
66
66
|
return {
|
|
67
67
|
fit: "contain",
|
|
@@ -75,40 +75,41 @@ const _sfc_main = vue.defineComponent({
|
|
|
75
75
|
emits("handle", { key, item: props.meta });
|
|
76
76
|
}
|
|
77
77
|
return (_ctx, _cache) => {
|
|
78
|
-
var _a
|
|
78
|
+
var _a;
|
|
79
79
|
return vue.openBlock(), vue.createElementBlock("div", {
|
|
80
80
|
class: vue.normalizeClass(["thumb-select-wrapper", classList.value]),
|
|
81
81
|
style: vue.normalizeStyle(styleObject.value)
|
|
82
82
|
}, [
|
|
83
|
-
isUploading.value ? (vue.openBlock(), vue.
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
}, null, 8, ["percent"]),
|
|
88
|
-
((_b = _ctx.meta) == null ? void 0 : _b.isTrans) ? (vue.openBlock(), vue.createElementBlock("div", _hoisted_2, "\u8F6C\u7801\u4E2D...")) : vue.createCommentVNode("v-if", true)
|
|
89
|
-
])) : _ctx.catalog && _ctx.url ? (vue.openBlock(), vue.createElementBlock(vue.Fragment, { key: 1 }, [
|
|
83
|
+
isUploading.value ? (vue.openBlock(), vue.createBlock(index, {
|
|
84
|
+
key: 0,
|
|
85
|
+
meta: _ctx.meta
|
|
86
|
+
}, null, 8, ["meta"])) : _ctx.catalog && _ctx.url ? (vue.openBlock(), vue.createElementBlock(vue.Fragment, { key: 1 }, [
|
|
90
87
|
vue.createCommentVNode(" \u6709\u7C7B\u578B\u7684\u5C01\u9762 "),
|
|
91
88
|
vue.createCommentVNode(" \u56FE\u7247 "),
|
|
92
89
|
_ctx.catalog ? (vue.openBlock(), vue.createBlock(vue.unref(webVue.Image), vue.mergeProps({
|
|
93
90
|
key: 0,
|
|
94
91
|
class: "thumb-image",
|
|
95
92
|
src: realThumb.value
|
|
96
|
-
}, aImageAttr.value), null, 16, ["src"])) : vue.createCommentVNode("v-if", true)
|
|
97
|
-
vue.createCommentVNode(" \u5C55\u793A\u6A21\u5F0F "),
|
|
98
|
-
vue.createElementVNode("div", _hoisted_3, [
|
|
99
|
-
(vue.openBlock(true), vue.createElementBlock(vue.Fragment, null, vue.renderList(_ctx.handlersKey, (item) => {
|
|
100
|
-
return vue.openBlock(), vue.createElementBlock("div", {
|
|
101
|
-
key: item.key,
|
|
102
|
-
class: "handler-item",
|
|
103
|
-
onClick: vue.withModifiers(() => handleOption(item.key), ["stop"])
|
|
104
|
-
}, vue.toDisplayString(item.label), 9, _hoisted_4);
|
|
105
|
-
}), 128))
|
|
106
|
-
])
|
|
93
|
+
}, aImageAttr.value), null, 16, ["src"])) : vue.createCommentVNode("v-if", true)
|
|
107
94
|
], 64)) : vue.createCommentVNode("v-if", true),
|
|
108
|
-
|
|
95
|
+
vue.createCommentVNode(" \u4E00\u4E9B\u6807\u7B7E\uFF08\u56DB\u4E2A\u89D2\uFF09 "),
|
|
96
|
+
["video", "audio"].includes(_ctx.catalog) && _ctx.meta ? (vue.openBlock(), vue.createElementBlock("div", _hoisted_1, [
|
|
109
97
|
_ctx.catalog === "video" ? (vue.openBlock(), vue.createBlock(vue.unref(vueCmstopIcons.IconVideoTag), { key: 0 })) : (vue.openBlock(), vue.createBlock(vue.unref(vueCmstopIcons.IconAudioTag), { key: 1 })),
|
|
110
|
-
vue.createTextVNode(" " + vue.toDisplayString(vue.unref(index.mediaTime)((
|
|
111
|
-
])) : vue.createCommentVNode("v-if", true)
|
|
98
|
+
vue.createTextVNode(" " + vue.toDisplayString(vue.unref(index$1.mediaTime)((_a = _ctx.meta) == null ? void 0 : _a.length)), 1)
|
|
99
|
+
])) : vue.createCommentVNode("v-if", true),
|
|
100
|
+
vue.createCommentVNode(" \u5916\u6302\u9009\u9879 "),
|
|
101
|
+
vue.createElementVNode("div", {
|
|
102
|
+
class: vue.normalizeClass(["thumb-handler-list", thumbHandlerClass.value])
|
|
103
|
+
}, [
|
|
104
|
+
(vue.openBlock(true), vue.createElementBlock(vue.Fragment, null, vue.renderList(_ctx.handlersKey, (item) => {
|
|
105
|
+
return vue.openBlock(), vue.createElementBlock("div", {
|
|
106
|
+
key: item.key,
|
|
107
|
+
class: "handler-item",
|
|
108
|
+
onClick: vue.withModifiers(() => handleOption(item.key), ["stop"])
|
|
109
|
+
}, vue.toDisplayString(item.label), 9, _hoisted_2);
|
|
110
|
+
}), 128)),
|
|
111
|
+
vue.renderSlot(_ctx.$slots, "handlers")
|
|
112
|
+
], 2)
|
|
112
113
|
], 6);
|
|
113
114
|
};
|
|
114
115
|
}
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var vue = require("vue");
|
|
3
|
+
var webVue = require("@arco-design/web-vue");
|
|
4
|
+
const _hoisted_1 = { class: "thumb-upload-loading" };
|
|
5
|
+
const _sfc_main = vue.defineComponent({
|
|
6
|
+
__name: "index",
|
|
7
|
+
props: {
|
|
8
|
+
meta: {}
|
|
9
|
+
},
|
|
10
|
+
setup(__props) {
|
|
11
|
+
const props = __props;
|
|
12
|
+
const isFaild = vue.computed(() => {
|
|
13
|
+
return [2, 3].includes(props.meta.status);
|
|
14
|
+
});
|
|
15
|
+
const isSuccess = vue.computed(() => {
|
|
16
|
+
return [0].includes(props.meta.status);
|
|
17
|
+
});
|
|
18
|
+
const textStatusClass = vue.computed(() => {
|
|
19
|
+
if (isFaild.value) {
|
|
20
|
+
return "thumb-upload-text-error";
|
|
21
|
+
}
|
|
22
|
+
if (isSuccess.value) {
|
|
23
|
+
return "thumb-upload-text-success";
|
|
24
|
+
}
|
|
25
|
+
return "";
|
|
26
|
+
});
|
|
27
|
+
return (_ctx, _cache) => {
|
|
28
|
+
var _a, _b;
|
|
29
|
+
return vue.openBlock(), vue.createElementBlock("div", _hoisted_1, [
|
|
30
|
+
!isFaild.value ? (vue.openBlock(), vue.createBlock(vue.unref(webVue.Progress), {
|
|
31
|
+
key: 0,
|
|
32
|
+
type: "circle",
|
|
33
|
+
percent: (_a = _ctx.meta) == null ? void 0 : _a.progress
|
|
34
|
+
}, null, 8, ["percent"])) : vue.createCommentVNode("v-if", true),
|
|
35
|
+
_ctx.meta.msg ? (vue.openBlock(), vue.createElementBlock("div", {
|
|
36
|
+
key: 1,
|
|
37
|
+
class: vue.normalizeClass(["thumb-upload-text", textStatusClass.value])
|
|
38
|
+
}, vue.toDisplayString((_b = _ctx.meta) == null ? void 0 : _b.msg), 3)) : vue.createCommentVNode("v-if", true)
|
|
39
|
+
]);
|
|
40
|
+
};
|
|
41
|
+
}
|
|
42
|
+
});
|
|
43
|
+
module.exports = _sfc_main;
|
|
@@ -1,26 +1,34 @@
|
|
|
1
|
-
.thumb-
|
|
2
|
-
position: relative;
|
|
1
|
+
.thumb-upload-loading {
|
|
3
2
|
display: flex;
|
|
3
|
+
flex-direction: column;
|
|
4
4
|
align-items: center;
|
|
5
5
|
justify-content: center;
|
|
6
6
|
width: 100%;
|
|
7
7
|
height: 100%;
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
8
|
+
background-color: rgba(0, 0, 0, 0.5);
|
|
9
|
+
}
|
|
10
|
+
.thumb-upload-loading .arco-progress-circle-text {
|
|
11
|
+
color: #fff;
|
|
12
|
+
}
|
|
13
|
+
.thumb-upload-loading .thumb-upload-text {
|
|
14
|
+
color: #fff;
|
|
15
|
+
}
|
|
16
|
+
.thumb-upload-loading .thumb-upload-text-success {
|
|
17
|
+
color: rgb(var(--success-2));
|
|
11
18
|
}
|
|
12
|
-
.thumb-
|
|
19
|
+
.thumb-upload-loading .thumb-upload-text-error {
|
|
20
|
+
color: rgb(var(--danger-6));
|
|
21
|
+
}
|
|
22
|
+
.thumb-select-wrapper {
|
|
23
|
+
position: relative;
|
|
13
24
|
display: flex;
|
|
14
|
-
flex-direction: column;
|
|
15
25
|
align-items: center;
|
|
16
26
|
justify-content: center;
|
|
17
27
|
width: 100%;
|
|
18
28
|
height: 100%;
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
.thumb-select-wrapper .thumb-upload-loading .arco-progress-circle-text {
|
|
23
|
-
color: #fff;
|
|
29
|
+
overflow: hidden;
|
|
30
|
+
border-radius: 2px;
|
|
31
|
+
cursor: pointer;
|
|
24
32
|
}
|
|
25
33
|
.thumb-select-wrapper .thumb-image img {
|
|
26
34
|
width: 100%;
|
|
@@ -40,6 +48,9 @@
|
|
|
40
48
|
opacity: 0;
|
|
41
49
|
transition: all 0.3s ease-in-out;
|
|
42
50
|
}
|
|
51
|
+
.thumb-select-wrapper .thumb-handler-list.thumb-handler-always {
|
|
52
|
+
opacity: 1 !important;
|
|
53
|
+
}
|
|
43
54
|
.thumb-select-wrapper .thumb-handler-list .handler-item {
|
|
44
55
|
padding: 0 8px;
|
|
45
56
|
color: #fff;
|
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
@import './thumbUploading.less';
|
|
2
|
+
|
|
1
3
|
.thumb-select-wrapper {
|
|
2
4
|
position: relative;
|
|
3
5
|
display: flex;
|
|
@@ -10,22 +12,6 @@
|
|
|
10
12
|
border-radius: 2px;
|
|
11
13
|
cursor: pointer;
|
|
12
14
|
|
|
13
|
-
// loading 模式
|
|
14
|
-
.thumb-upload-loading {
|
|
15
|
-
display: flex;
|
|
16
|
-
flex-direction: column;
|
|
17
|
-
align-items: center;
|
|
18
|
-
justify-content: center;
|
|
19
|
-
width: 100%;
|
|
20
|
-
height: 100%;
|
|
21
|
-
color: #fff;
|
|
22
|
-
background-color: rgba(0, 0, 0, 0.5);
|
|
23
|
-
|
|
24
|
-
.arco-progress-circle-text {
|
|
25
|
-
color: #fff;
|
|
26
|
-
}
|
|
27
|
-
}
|
|
28
|
-
|
|
29
15
|
// 样式
|
|
30
16
|
.thumb-image {
|
|
31
17
|
img {
|
|
@@ -49,6 +35,10 @@
|
|
|
49
35
|
opacity: 0;
|
|
50
36
|
transition: all 0.3s ease-in-out;
|
|
51
37
|
|
|
38
|
+
&.thumb-handler-always {
|
|
39
|
+
opacity: 1 !important;
|
|
40
|
+
}
|
|
41
|
+
|
|
52
42
|
.handler-item {
|
|
53
43
|
padding: 0 8px;
|
|
54
44
|
color: #fff;
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
// loading 模式
|
|
2
|
+
.thumb-upload-loading {
|
|
3
|
+
display: flex;
|
|
4
|
+
flex-direction: column;
|
|
5
|
+
align-items: center;
|
|
6
|
+
justify-content: center;
|
|
7
|
+
width: 100%;
|
|
8
|
+
height: 100%;
|
|
9
|
+
background-color: rgba(0, 0, 0, 0.5);
|
|
10
|
+
|
|
11
|
+
.arco-progress-circle-text {
|
|
12
|
+
color: #fff;
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
.thumb-upload-text {
|
|
16
|
+
color: #fff;
|
|
17
|
+
|
|
18
|
+
&-success {
|
|
19
|
+
color: rgb(var(--success-2));
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
&-error {
|
|
23
|
+
color: rgb(var(--danger-6));
|
|
24
|
+
}
|
|
25
|
+
}
|
|
26
|
+
}
|