@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,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 {
|
|
@@ -1,23 +1,15 @@
|
|
|
1
|
-
import { defineComponent, computed, openBlock, createElementBlock, normalizeClass, normalizeStyle,
|
|
1
|
+
import { defineComponent, computed, openBlock, createElementBlock, normalizeClass, normalizeStyle, createBlock, Fragment, createCommentVNode, unref, mergeProps, createTextVNode, toDisplayString, createElementVNode, renderList, withModifiers, renderSlot } from "vue";
|
|
2
2
|
import { IconVideoTag, IconAudioTag } from "@arco-iconbox/vue-cmstop-icons";
|
|
3
|
-
import {
|
|
3
|
+
import { Image } from "@arco-design/web-vue";
|
|
4
4
|
import magic from "./assets/magic.js";
|
|
5
5
|
import { DEFAULT_BASE_API } from "../config.js";
|
|
6
6
|
import { mediaTime } from "../utils/index.js";
|
|
7
|
+
import _sfc_main$1 from "./components/ThumbUploading/index.js";
|
|
7
8
|
const _hoisted_1 = {
|
|
8
|
-
key: 0,
|
|
9
|
-
class: "thumb-upload-loading"
|
|
10
|
-
};
|
|
11
|
-
const _hoisted_2 = {
|
|
12
|
-
key: 0,
|
|
13
|
-
class: "thumb-upload-text"
|
|
14
|
-
};
|
|
15
|
-
const _hoisted_3 = { class: "thumb-handler-list" };
|
|
16
|
-
const _hoisted_4 = ["onClick"];
|
|
17
|
-
const _hoisted_5 = {
|
|
18
9
|
key: 2,
|
|
19
10
|
class: "thumb-select-tag"
|
|
20
11
|
};
|
|
12
|
+
const _hoisted_2 = ["onClick"];
|
|
21
13
|
const _sfc_main = defineComponent({
|
|
22
14
|
...{ name: "thumbCard" },
|
|
23
15
|
__name: "component",
|
|
@@ -29,7 +21,8 @@ const _sfc_main = defineComponent({
|
|
|
29
21
|
options: {},
|
|
30
22
|
meta: {},
|
|
31
23
|
catalog: {},
|
|
32
|
-
handlersKey: {}
|
|
24
|
+
handlersKey: {},
|
|
25
|
+
handlersAlways: { type: Boolean }
|
|
33
26
|
},
|
|
34
27
|
emits: ["handle", "edit"],
|
|
35
28
|
setup(__props, { emit: __emit }) {
|
|
@@ -61,6 +54,13 @@ const _sfc_main = defineComponent({
|
|
|
61
54
|
}
|
|
62
55
|
return list;
|
|
63
56
|
});
|
|
57
|
+
const thumbHandlerClass = computed(() => {
|
|
58
|
+
const list = [];
|
|
59
|
+
if (props.handlersAlways) {
|
|
60
|
+
list.push("thumb-handler-always");
|
|
61
|
+
}
|
|
62
|
+
return list;
|
|
63
|
+
});
|
|
64
64
|
const aImageAttr = computed(() => {
|
|
65
65
|
return {
|
|
66
66
|
fit: "contain",
|
|
@@ -74,40 +74,41 @@ const _sfc_main = defineComponent({
|
|
|
74
74
|
emits("handle", { key, item: props.meta });
|
|
75
75
|
}
|
|
76
76
|
return (_ctx, _cache) => {
|
|
77
|
-
var _a
|
|
77
|
+
var _a;
|
|
78
78
|
return openBlock(), createElementBlock("div", {
|
|
79
79
|
class: normalizeClass(["thumb-select-wrapper", classList.value]),
|
|
80
80
|
style: normalizeStyle(styleObject.value)
|
|
81
81
|
}, [
|
|
82
|
-
isUploading.value ? (openBlock(),
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
}, null, 8, ["percent"]),
|
|
87
|
-
((_b = _ctx.meta) == null ? void 0 : _b.isTrans) ? (openBlock(), createElementBlock("div", _hoisted_2, "\u8F6C\u7801\u4E2D...")) : createCommentVNode("v-if", true)
|
|
88
|
-
])) : _ctx.catalog && _ctx.url ? (openBlock(), createElementBlock(Fragment, { key: 1 }, [
|
|
82
|
+
isUploading.value ? (openBlock(), createBlock(_sfc_main$1, {
|
|
83
|
+
key: 0,
|
|
84
|
+
meta: _ctx.meta
|
|
85
|
+
}, null, 8, ["meta"])) : _ctx.catalog && _ctx.url ? (openBlock(), createElementBlock(Fragment, { key: 1 }, [
|
|
89
86
|
createCommentVNode(" \u6709\u7C7B\u578B\u7684\u5C01\u9762 "),
|
|
90
87
|
createCommentVNode(" \u56FE\u7247 "),
|
|
91
88
|
_ctx.catalog ? (openBlock(), createBlock(unref(Image), mergeProps({
|
|
92
89
|
key: 0,
|
|
93
90
|
class: "thumb-image",
|
|
94
91
|
src: realThumb.value
|
|
95
|
-
}, aImageAttr.value), null, 16, ["src"])) : createCommentVNode("v-if", true)
|
|
96
|
-
createCommentVNode(" \u5C55\u793A\u6A21\u5F0F "),
|
|
97
|
-
createElementVNode("div", _hoisted_3, [
|
|
98
|
-
(openBlock(true), createElementBlock(Fragment, null, renderList(_ctx.handlersKey, (item) => {
|
|
99
|
-
return openBlock(), createElementBlock("div", {
|
|
100
|
-
key: item.key,
|
|
101
|
-
class: "handler-item",
|
|
102
|
-
onClick: withModifiers(() => handleOption(item.key), ["stop"])
|
|
103
|
-
}, toDisplayString(item.label), 9, _hoisted_4);
|
|
104
|
-
}), 128))
|
|
105
|
-
])
|
|
92
|
+
}, aImageAttr.value), null, 16, ["src"])) : createCommentVNode("v-if", true)
|
|
106
93
|
], 64)) : createCommentVNode("v-if", true),
|
|
107
|
-
|
|
94
|
+
createCommentVNode(" \u4E00\u4E9B\u6807\u7B7E\uFF08\u56DB\u4E2A\u89D2\uFF09 "),
|
|
95
|
+
["video", "audio"].includes(_ctx.catalog) && _ctx.meta ? (openBlock(), createElementBlock("div", _hoisted_1, [
|
|
108
96
|
_ctx.catalog === "video" ? (openBlock(), createBlock(unref(IconVideoTag), { key: 0 })) : (openBlock(), createBlock(unref(IconAudioTag), { key: 1 })),
|
|
109
|
-
createTextVNode(" " + toDisplayString(unref(mediaTime)((
|
|
110
|
-
])) : createCommentVNode("v-if", true)
|
|
97
|
+
createTextVNode(" " + toDisplayString(unref(mediaTime)((_a = _ctx.meta) == null ? void 0 : _a.length)), 1)
|
|
98
|
+
])) : createCommentVNode("v-if", true),
|
|
99
|
+
createCommentVNode(" \u5916\u6302\u9009\u9879 "),
|
|
100
|
+
createElementVNode("div", {
|
|
101
|
+
class: normalizeClass(["thumb-handler-list", thumbHandlerClass.value])
|
|
102
|
+
}, [
|
|
103
|
+
(openBlock(true), createElementBlock(Fragment, null, renderList(_ctx.handlersKey, (item) => {
|
|
104
|
+
return openBlock(), createElementBlock("div", {
|
|
105
|
+
key: item.key,
|
|
106
|
+
class: "handler-item",
|
|
107
|
+
onClick: withModifiers(() => handleOption(item.key), ["stop"])
|
|
108
|
+
}, toDisplayString(item.label), 9, _hoisted_2);
|
|
109
|
+
}), 128)),
|
|
110
|
+
renderSlot(_ctx.$slots, "handlers")
|
|
111
|
+
], 2)
|
|
111
112
|
], 6);
|
|
112
113
|
};
|
|
113
114
|
}
|
|
File without changes
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
import { defineComponent, computed, openBlock, createElementBlock, createBlock, unref, createCommentVNode, normalizeClass, toDisplayString } from "vue";
|
|
2
|
+
import { Progress } from "@arco-design/web-vue";
|
|
3
|
+
const _hoisted_1 = { class: "thumb-upload-loading" };
|
|
4
|
+
const _sfc_main = defineComponent({
|
|
5
|
+
__name: "index",
|
|
6
|
+
props: {
|
|
7
|
+
meta: {}
|
|
8
|
+
},
|
|
9
|
+
setup(__props) {
|
|
10
|
+
const props = __props;
|
|
11
|
+
const isFaild = computed(() => {
|
|
12
|
+
return [2, 3].includes(props.meta.status);
|
|
13
|
+
});
|
|
14
|
+
const isSuccess = computed(() => {
|
|
15
|
+
return [0].includes(props.meta.status);
|
|
16
|
+
});
|
|
17
|
+
const textStatusClass = computed(() => {
|
|
18
|
+
if (isFaild.value) {
|
|
19
|
+
return "thumb-upload-text-error";
|
|
20
|
+
}
|
|
21
|
+
if (isSuccess.value) {
|
|
22
|
+
return "thumb-upload-text-success";
|
|
23
|
+
}
|
|
24
|
+
return "";
|
|
25
|
+
});
|
|
26
|
+
return (_ctx, _cache) => {
|
|
27
|
+
var _a, _b;
|
|
28
|
+
return openBlock(), createElementBlock("div", _hoisted_1, [
|
|
29
|
+
!isFaild.value ? (openBlock(), createBlock(unref(Progress), {
|
|
30
|
+
key: 0,
|
|
31
|
+
type: "circle",
|
|
32
|
+
percent: (_a = _ctx.meta) == null ? void 0 : _a.progress
|
|
33
|
+
}, null, 8, ["percent"])) : createCommentVNode("v-if", true),
|
|
34
|
+
_ctx.meta.msg ? (openBlock(), createElementBlock("div", {
|
|
35
|
+
key: 1,
|
|
36
|
+
class: normalizeClass(["thumb-upload-text", textStatusClass.value])
|
|
37
|
+
}, toDisplayString((_b = _ctx.meta) == null ? void 0 : _b.msg), 3)) : createCommentVNode("v-if", true)
|
|
38
|
+
]);
|
|
39
|
+
};
|
|
40
|
+
}
|
|
41
|
+
});
|
|
42
|
+
export { _sfc_main as default };
|
|
@@ -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
|
+
}
|
|
@@ -7,23 +7,22 @@ var PreviewIframe = require("./components/PreviewIframe.js");
|
|
|
7
7
|
var hook = require("./scripts/hook.js");
|
|
8
8
|
const _hoisted_1 = { class: "preview-close" };
|
|
9
9
|
const _hoisted_2 = /* @__PURE__ */ vue.createElementVNode("div", { class: "doc-preview-share" }, null, -1);
|
|
10
|
-
const _hoisted_3 = { class: "doc-preview-share" };
|
|
11
|
-
const _hoisted_4 =
|
|
12
|
-
const _hoisted_5 =
|
|
13
|
-
const _hoisted_6 =
|
|
14
|
-
const _hoisted_7 =
|
|
15
|
-
const _hoisted_8 =
|
|
16
|
-
const _hoisted_9 = { class: "doc-preview-share-link" };
|
|
17
|
-
const _hoisted_10 = { class: "doc-preview-share-link-
|
|
18
|
-
const _hoisted_11 = { class: "doc-preview-share-
|
|
19
|
-
const _hoisted_12 = { class: "doc-preview-share-
|
|
20
|
-
const _hoisted_13 = /* @__PURE__ */ vue.createElementVNode("div", { class: "doc-preview-share-img" }, [
|
|
10
|
+
const _hoisted_3 = { class: "doc-preview-share-img" };
|
|
11
|
+
const _hoisted_4 = ["src"];
|
|
12
|
+
const _hoisted_5 = /* @__PURE__ */ vue.createElementVNode("div", { class: "doc-preview-share-tips" }, "\u626B\u63CF\u4E8C\u7EF4\u7801\u8BBF\u95EE", -1);
|
|
13
|
+
const _hoisted_6 = { class: "doc-preview-share-header" };
|
|
14
|
+
const _hoisted_7 = /* @__PURE__ */ vue.createElementVNode("span", null, "\u9884\u89C8\u5730\u5740", -1);
|
|
15
|
+
const _hoisted_8 = { class: "doc-preview-share-link" };
|
|
16
|
+
const _hoisted_9 = { class: "doc-preview-share-link-value" };
|
|
17
|
+
const _hoisted_10 = { class: "doc-preview-share-link-hint" };
|
|
18
|
+
const _hoisted_11 = { class: "doc-preview-share-action" };
|
|
19
|
+
const _hoisted_12 = /* @__PURE__ */ vue.createElementVNode("div", { class: "doc-preview-share-img" }, [
|
|
21
20
|
/* @__PURE__ */ vue.createElementVNode("div", { class: "doc-preview-share-img-hint" }, " \u6682\u65E0\u9884\u89C8 ")
|
|
22
21
|
], -1);
|
|
23
|
-
const
|
|
24
|
-
const
|
|
25
|
-
const
|
|
26
|
-
const
|
|
22
|
+
const _hoisted_13 = /* @__PURE__ */ vue.createElementVNode("div", { class: "doc-preview-share-tips" }, " \u5185\u5BB9\u6682\u65E0\u9884\u89C8\u94FE\u63A5\uFF0C\u53EF\u751F\u6210\u9884\u89C8\u94FE\u63A5 ", -1);
|
|
23
|
+
const _hoisted_14 = { class: "doc-preview-share-header" };
|
|
24
|
+
const _hoisted_15 = /* @__PURE__ */ vue.createElementVNode("span", null, "\u94FE\u63A5\u6709\u6548\u65F6\u957F", -1);
|
|
25
|
+
const _hoisted_16 = { class: "doc-preview-share-action" };
|
|
27
26
|
const _sfc_main = vue.defineComponent({
|
|
28
27
|
...{ name: "docPreview" },
|
|
29
28
|
__name: "component",
|
|
@@ -52,7 +51,7 @@ const _sfc_main = vue.defineComponent({
|
|
|
52
51
|
return (_ctx, _cache) => {
|
|
53
52
|
return vue.openBlock(), vue.createElementBlock("div", {
|
|
54
53
|
class: "doc-preview-container",
|
|
55
|
-
onClick: _cache[
|
|
54
|
+
onClick: _cache[7] || (_cache[7] = ($event) => emits("close"))
|
|
56
55
|
}, [
|
|
57
56
|
vue.createElementVNode("div", _hoisted_1, [
|
|
58
57
|
vue.createVNode(vue.unref(icon.IconClose), {
|
|
@@ -67,20 +66,24 @@ const _sfc_main = vue.defineComponent({
|
|
|
67
66
|
}, null, 8, ["src"]),
|
|
68
67
|
vue.createVNode(vue.unref(webVue.Spin), { loading: vue.unref(loading) }, {
|
|
69
68
|
default: vue.withCtx(() => [
|
|
70
|
-
vue.createElementVNode("div",
|
|
69
|
+
vue.createElementVNode("div", {
|
|
70
|
+
class: "doc-preview-share",
|
|
71
|
+
onClick: _cache[6] || (_cache[6] = vue.withModifiers(() => {
|
|
72
|
+
}, ["stop"]))
|
|
73
|
+
}, [
|
|
71
74
|
vue.unref(shareData) ? (vue.openBlock(), vue.createElementBlock(vue.Fragment, { key: 0 }, [
|
|
72
75
|
vue.createCommentVNode(" \u4E8C\u7EF4\u7801 "),
|
|
73
|
-
vue.createElementVNode("div",
|
|
76
|
+
vue.createElementVNode("div", _hoisted_3, [
|
|
74
77
|
vue.createElementVNode("img", {
|
|
75
78
|
src: vue.unref(shareData).qrCode,
|
|
76
79
|
alt: ""
|
|
77
|
-
}, null, 8,
|
|
80
|
+
}, null, 8, _hoisted_4)
|
|
78
81
|
]),
|
|
79
82
|
vue.createCommentVNode(" \u5907\u6CE8 "),
|
|
80
|
-
|
|
83
|
+
_hoisted_5,
|
|
81
84
|
vue.createCommentVNode(" \u94FE\u63A5\u524D\u7F6E\u64CD\u4F5C "),
|
|
82
|
-
vue.createElementVNode("div",
|
|
83
|
-
|
|
85
|
+
vue.createElementVNode("div", _hoisted_6, [
|
|
86
|
+
_hoisted_7,
|
|
84
87
|
vue.createVNode(vue.unref(webVue.Link), {
|
|
85
88
|
type: "text",
|
|
86
89
|
onClick: vue.unref(copy)
|
|
@@ -92,12 +95,12 @@ const _sfc_main = vue.defineComponent({
|
|
|
92
95
|
}, 8, ["onClick"])
|
|
93
96
|
]),
|
|
94
97
|
vue.createCommentVNode(" \u94FE\u63A5 "),
|
|
95
|
-
vue.createElementVNode("div",
|
|
96
|
-
vue.createElementVNode("div",
|
|
97
|
-
vue.createElementVNode("div",
|
|
98
|
+
vue.createElementVNode("div", _hoisted_8, [
|
|
99
|
+
vue.createElementVNode("div", _hoisted_9, vue.toDisplayString(vue.unref(shareData).shareUrl), 1),
|
|
100
|
+
vue.createElementVNode("div", _hoisted_10, " \u94FE\u63A5\u5269\u4F59\u65F6\u95F4\uFF1A" + vue.toDisplayString(vue.unref(intervalTime)), 1)
|
|
98
101
|
]),
|
|
99
102
|
vue.createCommentVNode(" \u64CD\u4F5C "),
|
|
100
|
-
vue.createElementVNode("div",
|
|
103
|
+
vue.createElementVNode("div", _hoisted_11, [
|
|
101
104
|
vue.createVNode(vue.unref(webVue.Button), {
|
|
102
105
|
onClick: _cache[2] || (_cache[2] = ($event) => vue.unref(cancel)())
|
|
103
106
|
}, {
|
|
@@ -117,10 +120,10 @@ const _sfc_main = vue.defineComponent({
|
|
|
117
120
|
})
|
|
118
121
|
])
|
|
119
122
|
], 64)) : (vue.openBlock(), vue.createElementBlock(vue.Fragment, { key: 1 }, [
|
|
123
|
+
_hoisted_12,
|
|
120
124
|
_hoisted_13,
|
|
121
|
-
_hoisted_14,
|
|
122
|
-
|
|
123
|
-
_hoisted_16,
|
|
125
|
+
vue.createElementVNode("div", _hoisted_14, [
|
|
126
|
+
_hoisted_15,
|
|
124
127
|
vue.createVNode(vue.unref(webVue.Select), {
|
|
125
128
|
modelValue: vue.unref(expireTime),
|
|
126
129
|
"onUpdate:modelValue": _cache[4] || (_cache[4] = ($event) => vue.isRef(expireTime) ? expireTime.value = $event : null),
|
|
@@ -139,7 +142,7 @@ const _sfc_main = vue.defineComponent({
|
|
|
139
142
|
_: 1
|
|
140
143
|
}, 8, ["modelValue"])
|
|
141
144
|
]),
|
|
142
|
-
vue.createElementVNode("div",
|
|
145
|
+
vue.createElementVNode("div", _hoisted_16, [
|
|
143
146
|
vue.createVNode(vue.unref(webVue.Button), {
|
|
144
147
|
type: "primary",
|
|
145
148
|
onClick: _cache[5] || (_cache[5] = () => vue.unref(generate)())
|
|
@@ -25,7 +25,7 @@ function getAttachmentsMyMessage(BASE_API, query) {
|
|
|
25
25
|
}
|
|
26
26
|
function useAttachement(options) {
|
|
27
27
|
const key = vue.ref(options.key);
|
|
28
|
-
const limit = vue.ref(
|
|
28
|
+
const limit = vue.ref(30);
|
|
29
29
|
const offset = vue.ref(0);
|
|
30
30
|
const filter = vue.ref({});
|
|
31
31
|
const params = vue.computed(() => {
|
package/lib/hooks/useUpload.js
CHANGED
|
@@ -30,7 +30,7 @@ function useUpload() {
|
|
|
30
30
|
const originList = list.value;
|
|
31
31
|
const taskIndex = originList.findIndex((task) => task.id === file.id);
|
|
32
32
|
if (taskIndex !== -1) {
|
|
33
|
-
progress !== -1 && (originList[taskIndex].progress =
|
|
33
|
+
progress !== -1 && (originList[taskIndex].progress = progress.toFixed(2));
|
|
34
34
|
file.status != null && (originList[taskIndex].status = file.status);
|
|
35
35
|
file.msg != null && (originList[taskIndex].msg = file.msg);
|
|
36
36
|
if (isTrans)
|
|
@@ -38,23 +38,32 @@ function useUpload() {
|
|
|
38
38
|
originList[taskIndex].url = file.url;
|
|
39
39
|
} else {
|
|
40
40
|
file.created_at = new Date().getTime();
|
|
41
|
-
originList.
|
|
41
|
+
originList.unshift({ ...file, progress, status: 1 });
|
|
42
42
|
}
|
|
43
43
|
list.value = originList;
|
|
44
44
|
}
|
|
45
|
+
const removeRecord = (file) => {
|
|
46
|
+
const originList = list.value;
|
|
47
|
+
const taskIndex = originList.findIndex((task) => task.id === file.id);
|
|
48
|
+
if (taskIndex !== -1) {
|
|
49
|
+
originList.splice(taskIndex, 1);
|
|
50
|
+
list.value = originList;
|
|
51
|
+
}
|
|
52
|
+
};
|
|
45
53
|
const uploadFile = (BASE_API, file, dir = 0, repoId, callback) => {
|
|
46
54
|
const newFile = {
|
|
47
|
-
id: index.generateUUID(),
|
|
55
|
+
id: file.id || index.generateUUID(),
|
|
48
56
|
sig_id: file.sig_id || index.generateUUID(),
|
|
49
57
|
name: file.name,
|
|
50
58
|
url: "",
|
|
51
59
|
size: file.size,
|
|
52
60
|
isUpload: true,
|
|
53
|
-
type: file.type
|
|
61
|
+
type: file.type,
|
|
62
|
+
originFile: file
|
|
54
63
|
};
|
|
55
64
|
const upload = new tusUpload.TusUploadTask(file);
|
|
56
65
|
newFile.abort = () => upload.abort();
|
|
57
|
-
recordTaskStatusChange(newFile, 0);
|
|
66
|
+
recordTaskStatusChange({ ...newFile, status: 1, msg: "\u4E0A\u4F20\u4E2D\u2026\u2026" }, 0);
|
|
58
67
|
const progress = (percent, total) => {
|
|
59
68
|
const progress2 = percent / total;
|
|
60
69
|
recordTaskStatusChange(newFile, progress2);
|
|
@@ -84,7 +93,9 @@ function useUpload() {
|
|
|
84
93
|
callback && callback({ ...message, sig_id: newFile.sig_id }, "success");
|
|
85
94
|
}).catch((e) => {
|
|
86
95
|
console.log("\u{1F525}\u{1F525}\u{1F525}\u{1F525}\u{1F525} \u4E0A\u4F20\u5931\u8D25\uFF1A", e);
|
|
87
|
-
|
|
96
|
+
setTimeout(() => {
|
|
97
|
+
recordTaskStatusChange({ ...newFile, status: 2, msg: "\u4E0A\u4F20\u5931\u8D25" }, -1);
|
|
98
|
+
}, 1e3);
|
|
88
99
|
callback && callback(newFile, "fail");
|
|
89
100
|
});
|
|
90
101
|
};
|
|
@@ -98,7 +109,7 @@ function useUpload() {
|
|
|
98
109
|
if (idx === -1)
|
|
99
110
|
return;
|
|
100
111
|
const item = list.value[idx];
|
|
101
|
-
recordTaskStatusChange(item, 0, true);
|
|
112
|
+
recordTaskStatusChange({ ...item, status: 1, msg: "\u8F6C\u7801\u4E2D\u2026\u2026" }, 0, true);
|
|
102
113
|
const progress = (progress2) => recordTaskStatusChange(item, progress2);
|
|
103
114
|
const transing = task.start(BASE_API, progress);
|
|
104
115
|
transing.then(async (res) => {
|
|
@@ -108,11 +119,17 @@ function useUpload() {
|
|
|
108
119
|
setTimeout(() => uploadSuccess(file), 200);
|
|
109
120
|
} else {
|
|
110
121
|
console.log("\u{1F525}\u{1F525}\u{1F525}\u{1F525}\u{1F525} \u8F6C\u7801\u5931\u8D25\uFF1A", item);
|
|
111
|
-
recordTaskStatusChange(
|
|
122
|
+
recordTaskStatusChange(
|
|
123
|
+
{ ...item, mediaFile: file, status: 3, msg: "\u8F6C\u7801\u5931\u8D25" },
|
|
124
|
+
-1
|
|
125
|
+
);
|
|
112
126
|
}
|
|
113
127
|
}).catch((e) => {
|
|
114
128
|
console.log("\u{1F525}\u{1F525}\u{1F525}\u{1F525}\u{1F525} \u8F6C\u7801\u5931\u8D25", e);
|
|
115
|
-
recordTaskStatusChange(
|
|
129
|
+
recordTaskStatusChange(
|
|
130
|
+
{ ...item, mediaFile: file, status: 3, msg: "\u8F6C\u7801\u5931\u8D25" },
|
|
131
|
+
-1
|
|
132
|
+
);
|
|
116
133
|
});
|
|
117
134
|
};
|
|
118
135
|
vue.watch(() => list.value, set, { deep: true });
|
|
@@ -121,7 +138,8 @@ function useUpload() {
|
|
|
121
138
|
list,
|
|
122
139
|
uploadFile,
|
|
123
140
|
transcodingFile,
|
|
124
|
-
recordTaskStatusChange
|
|
141
|
+
recordTaskStatusChange,
|
|
142
|
+
removeRecord
|
|
125
143
|
};
|
|
126
144
|
}
|
|
127
145
|
exports.addMedia = addMedia;
|
package/lib/index.css
CHANGED
|
@@ -4246,29 +4246,37 @@
|
|
|
4246
4246
|
color: #fff;
|
|
4247
4247
|
font-size: 18px;
|
|
4248
4248
|
}
|
|
4249
|
-
.thumb-
|
|
4250
|
-
position: relative;
|
|
4249
|
+
.thumb-upload-loading {
|
|
4251
4250
|
display: flex;
|
|
4251
|
+
flex-direction: column;
|
|
4252
4252
|
align-items: center;
|
|
4253
4253
|
justify-content: center;
|
|
4254
4254
|
width: 100%;
|
|
4255
4255
|
height: 100%;
|
|
4256
|
-
|
|
4257
|
-
border-radius: 2px;
|
|
4258
|
-
cursor: pointer;
|
|
4256
|
+
background-color: rgba(0, 0, 0, 0.5);
|
|
4259
4257
|
}
|
|
4260
|
-
.thumb-
|
|
4258
|
+
.thumb-upload-loading .arco-progress-circle-text {
|
|
4259
|
+
color: #fff;
|
|
4260
|
+
}
|
|
4261
|
+
.thumb-upload-loading .thumb-upload-text {
|
|
4262
|
+
color: #fff;
|
|
4263
|
+
}
|
|
4264
|
+
.thumb-upload-loading .thumb-upload-text-success {
|
|
4265
|
+
color: rgb(var(--success-2));
|
|
4266
|
+
}
|
|
4267
|
+
.thumb-upload-loading .thumb-upload-text-error {
|
|
4268
|
+
color: rgb(var(--danger-6));
|
|
4269
|
+
}
|
|
4270
|
+
.thumb-select-wrapper {
|
|
4271
|
+
position: relative;
|
|
4261
4272
|
display: flex;
|
|
4262
|
-
flex-direction: column;
|
|
4263
4273
|
align-items: center;
|
|
4264
4274
|
justify-content: center;
|
|
4265
4275
|
width: 100%;
|
|
4266
4276
|
height: 100%;
|
|
4267
|
-
|
|
4268
|
-
|
|
4269
|
-
|
|
4270
|
-
.thumb-select-wrapper .thumb-upload-loading .arco-progress-circle-text {
|
|
4271
|
-
color: #fff;
|
|
4277
|
+
overflow: hidden;
|
|
4278
|
+
border-radius: 2px;
|
|
4279
|
+
cursor: pointer;
|
|
4272
4280
|
}
|
|
4273
4281
|
.thumb-select-wrapper .thumb-image img {
|
|
4274
4282
|
width: 100%;
|
|
@@ -4288,6 +4296,9 @@
|
|
|
4288
4296
|
opacity: 0;
|
|
4289
4297
|
transition: all 0.3s ease-in-out;
|
|
4290
4298
|
}
|
|
4299
|
+
.thumb-select-wrapper .thumb-handler-list.thumb-handler-always {
|
|
4300
|
+
opacity: 1 !important;
|
|
4301
|
+
}
|
|
4291
4302
|
.thumb-select-wrapper .thumb-handler-list .handler-item {
|
|
4292
4303
|
padding: 0 8px;
|
|
4293
4304
|
color: #fff;
|
|
@@ -4463,6 +4474,8 @@
|
|
|
4463
4474
|
.card-wrapper-image {
|
|
4464
4475
|
position: relative;
|
|
4465
4476
|
overflow: hidden;
|
|
4477
|
+
user-select: none;
|
|
4478
|
+
-webkit-user-drag: none;
|
|
4466
4479
|
}
|
|
4467
4480
|
.card-wrapper-image .card-wrapper {
|
|
4468
4481
|
position: relative;
|
|
@@ -4471,9 +4484,13 @@
|
|
|
4471
4484
|
transition: all 0.3s ease-in-out;
|
|
4472
4485
|
aspect-ratio: 4 / 3;
|
|
4473
4486
|
}
|
|
4474
|
-
.card-wrapper-image .card-wrapper.disable:not(.active) {
|
|
4487
|
+
.card-wrapper-image .card-wrapper.disable:not(.active) .thumb-image {
|
|
4488
|
+
cursor: not-allowed;
|
|
4475
4489
|
opacity: 0.4;
|
|
4476
4490
|
}
|
|
4491
|
+
.card-wrapper-image .card-wrapper.disable:not(.active) .thumb-upload-loading {
|
|
4492
|
+
cursor: not-allowed;
|
|
4493
|
+
}
|
|
4477
4494
|
.card-wrapper-image .card-wrapper .mask {
|
|
4478
4495
|
position: absolute;
|
|
4479
4496
|
top: 0;
|
|
@@ -61,6 +61,7 @@ const _sfc_main = vue.defineComponent({
|
|
|
61
61
|
};
|
|
62
62
|
});
|
|
63
63
|
const activeKey = vue.ref("all");
|
|
64
|
+
vue.provide("filterOptions", vue.computed(() => props.filterOptions));
|
|
64
65
|
vue.provide("userInfo", vue.computed(() => props.userInfo));
|
|
65
66
|
vue.provide("baseAPI", BASE_API);
|
|
66
67
|
const {
|