@cmstops/pro-compo 0.3.49 → 0.3.51
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.css +30 -13
- package/dist/index.min.css +1 -1
- package/es/docPreview/component.js +33 -30
- package/es/hooks/useUpload.d.ts +1 -0
- package/es/hooks/useUpload.js +26 -8
- package/es/index.css +30 -13
- package/es/selectResourceModal/components/ListCardWrapper/index.js +19 -15
- package/es/selectResourceModal/components/ListContent/index.js +5 -2
- package/es/selectResourceModal/components/ListContentLocal/index.js +28 -4
- package/es/selectResourceModal/components/ListFilter/index.js +12 -2
- package/es/selectResourceModal/style/index.css +7 -1
- package/es/selectResourceModal/style/listCardWrapper.less +11 -1
- package/es/thumbCard/component.js +36 -35
- package/es/thumbCard/components/ThumbUploading/index.d.ts +0 -0
- package/es/thumbCard/components/ThumbUploading/index.js +42 -0
- package/es/thumbCard/style/index.css +23 -12
- package/es/thumbCard/style/index.less +6 -16
- package/es/thumbCard/style/thumbUploading.less +26 -0
- package/es/userAvater/component.js +3 -3
- package/lib/docPreview/component.js +33 -30
- package/lib/hooks/useUpload.js +26 -8
- package/lib/index.css +30 -13
- package/lib/selectResourceModal/components/ListCardWrapper/index.js +19 -15
- package/lib/selectResourceModal/components/ListContent/index.js +5 -2
- package/lib/selectResourceModal/components/ListContentLocal/index.js +28 -4
- package/lib/selectResourceModal/components/ListFilter/index.js +12 -2
- package/lib/selectResourceModal/style/index.css +7 -1
- package/lib/selectResourceModal/style/listCardWrapper.less +11 -1
- package/lib/thumbCard/component.js +35 -34
- package/lib/thumbCard/components/ThumbUploading/index.js +43 -0
- package/lib/thumbCard/style/index.css +23 -12
- package/lib/thumbCard/style/index.less +6 -16
- package/lib/thumbCard/style/thumbUploading.less +26 -0
- package/lib/userAvater/component.js +3 -3
- package/package.json +1 -1
|
@@ -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
|
+
}
|
|
@@ -85,7 +85,7 @@ const _sfc_main = vue.defineComponent({
|
|
|
85
85
|
"content-style": { padding: 0 }
|
|
86
86
|
}, {
|
|
87
87
|
content: vue.withCtx(() => {
|
|
88
|
-
var _a;
|
|
88
|
+
var _a, _b;
|
|
89
89
|
return [
|
|
90
90
|
vue.createElementVNode("div", _hoisted_4, [
|
|
91
91
|
vue.createElementVNode("div", _hoisted_5, [
|
|
@@ -109,7 +109,7 @@ const _sfc_main = vue.defineComponent({
|
|
|
109
109
|
vue.createElementVNode("div", _hoisted_8, vue.toDisplayString(userInfo.value.name), 1),
|
|
110
110
|
vue.createElementVNode("div", _hoisted_9, vue.toDisplayString(userInfo.value.mail || "\u6682\u65E0\u90AE\u7BB1"), 1),
|
|
111
111
|
((_a = userInfo.value.domains) == null ? void 0 : _a.length) === 1 && userInfo.value.currentDomain ? (vue.openBlock(), vue.createElementBlock("div", _hoisted_10, vue.toDisplayString(userInfo.value.currentDomain), 1)) : vue.createCommentVNode("v-if", true),
|
|
112
|
-
vue.
|
|
112
|
+
((_b = userInfo.value.domains) == null ? void 0 : _b.length) > 1 ? (vue.openBlock(), vue.createBlock(vue.unref(webVue.Dropdown), { key: 1 }, {
|
|
113
113
|
content: vue.withCtx(() => [
|
|
114
114
|
(vue.openBlock(true), vue.createElementBlock(vue.Fragment, null, vue.renderList(userInfo.value.domains, (item, index) => {
|
|
115
115
|
return vue.openBlock(), vue.createBlock(vue.unref(webVue.Doption), {
|
|
@@ -132,7 +132,7 @@ const _sfc_main = vue.defineComponent({
|
|
|
132
132
|
})
|
|
133
133
|
]),
|
|
134
134
|
_: 1
|
|
135
|
-
}),
|
|
135
|
+
})) : vue.createCommentVNode("v-if", true),
|
|
136
136
|
vue.createElementVNode("div", _hoisted_11, [
|
|
137
137
|
vue.createVNode(vue.unref(webVue.Button), {
|
|
138
138
|
type: "text",
|