@cmstops/pro-compo 0.3.35 → 0.3.37
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 +156 -2
- package/dist/index.min.css +1 -1
- package/es/docPreview/component.d.ts +0 -0
- package/es/docPreview/component.js +153 -0
- package/es/docPreview/components/PreviewIframe.d.ts +0 -0
- package/es/docPreview/components/PreviewIframe.js +37 -0
- package/es/docPreview/images/phone.js +2 -0
- package/es/docPreview/index.d.ts +2 -0
- package/es/docPreview/index.js +7 -0
- package/es/docPreview/scripts/api.d.ts +1 -0
- package/es/docPreview/scripts/hook.d.ts +20 -0
- package/es/docPreview/scripts/hook.js +119 -0
- package/es/docPreview/style/css.js +1 -0
- package/es/docPreview/style/index.css +139 -0
- package/es/docPreview/style/index.d.ts +1 -0
- package/es/docPreview/style/index.js +1 -0
- package/es/docPreview/style/index.less +129 -0
- package/es/docPreview/style/previewIframe.less +36 -0
- package/es/hooks/useSelection.js +1 -1
- package/es/index.css +156 -2
- package/es/index.d.ts +1 -0
- package/es/index.js +1 -0
- package/es/index.less +1 -0
- package/es/selectResourceModal/component.js +7 -9
- package/es/selectResourceModal/components/ListContent/index.js +4 -1
- package/es/selectResourceModal/components/ListContentLocal/components/Upload.js +2 -13
- package/es/selectResourceModal/components/ListContentLocal/index.js +4 -1
- package/es/selectResourceModal/components/ListFilter/index.js +3 -2
- package/es/selectResourceModal/style/index.css +1 -1
- package/es/selectResourceModal/style/index.less +1 -1
- package/es/thumbCard/component.js +15 -15
- package/es/thumbCard/style/index.css +16 -1
- package/es/thumbCard/style/index.less +24 -7
- package/es/utils/index.d.ts +2 -0
- package/es/utils/index.js +40 -1
- package/es/utils/typeMap.d.ts +2 -5
- package/es/utils/typeMap.js +2 -1
- package/lib/docPreview/component.js +154 -0
- package/lib/docPreview/components/PreviewIframe.js +38 -0
- package/lib/docPreview/images/phone.js +3 -0
- package/lib/docPreview/index.js +8 -0
- package/lib/docPreview/scripts/hook.js +123 -0
- package/lib/docPreview/style/css.js +2 -0
- package/lib/docPreview/style/index.css +139 -0
- package/lib/docPreview/style/index.js +2 -0
- package/lib/docPreview/style/index.less +129 -0
- package/lib/docPreview/style/previewIframe.less +36 -0
- package/lib/hooks/useSelection.js +1 -1
- package/lib/index.css +156 -2
- package/lib/index.js +2 -0
- package/lib/index.less +1 -0
- package/lib/selectResourceModal/component.js +6 -8
- package/lib/selectResourceModal/components/ListContent/index.js +4 -1
- package/lib/selectResourceModal/components/ListContentLocal/components/Upload.js +1 -12
- package/lib/selectResourceModal/components/ListContentLocal/index.js +4 -1
- package/lib/selectResourceModal/components/ListFilter/index.js +3 -2
- package/lib/selectResourceModal/style/index.css +1 -1
- package/lib/selectResourceModal/style/index.less +1 -1
- package/lib/thumbCard/component.js +15 -15
- package/lib/thumbCard/style/index.css +16 -1
- package/lib/thumbCard/style/index.less +24 -7
- package/lib/utils/index.js +41 -0
- package/lib/utils/typeMap.js +2 -1
- package/package.json +1 -1
|
@@ -38,18 +38,7 @@ const _sfc_main = vue.defineComponent({
|
|
|
38
38
|
]),
|
|
39
39
|
_: 1
|
|
40
40
|
}),
|
|
41
|
-
vue.
|
|
42
|
-
default: vue.withCtx(() => [
|
|
43
|
-
vue.createTextVNode(" \u626B\u7801\u4E0A\u4F20 ")
|
|
44
|
-
]),
|
|
45
|
-
_: 1
|
|
46
|
-
}),
|
|
47
|
-
vue.createVNode(vue.unref(webVue.Button), { type: "primary" }, {
|
|
48
|
-
default: vue.withCtx(() => [
|
|
49
|
-
vue.createTextVNode(" \u5206\u4EAB\u4E0A\u4F20 ")
|
|
50
|
-
]),
|
|
51
|
-
_: 1
|
|
52
|
-
})
|
|
41
|
+
vue.createCommentVNode(' <a-button type="primary"> \u626B\u7801\u4E0A\u4F20 </a-button>\n <a-button type="primary"> \u5206\u4EAB\u4E0A\u4F20 </a-button> ')
|
|
53
42
|
]),
|
|
54
43
|
vue.createElementVNode("div", _hoisted_3, [
|
|
55
44
|
vue.createVNode(vue.unref(webVue.Upload), {
|
|
@@ -71,10 +71,13 @@ const _sfc_main = vue.defineComponent({
|
|
|
71
71
|
thumb: item.url,
|
|
72
72
|
catalog: item.catalog,
|
|
73
73
|
meta: item,
|
|
74
|
+
options: {
|
|
75
|
+
fit: item.catalog === "image" ? "contain" : "cover"
|
|
76
|
+
},
|
|
74
77
|
"use-mask": true,
|
|
75
78
|
"handlers-key": handlersKey.value,
|
|
76
79
|
onHandle: handleOption
|
|
77
|
-
}, null, 8, ["url", "thumb", "catalog", "meta", "handlers-key"])
|
|
80
|
+
}, null, 8, ["url", "thumb", "catalog", "meta", "options", "handlers-key"])
|
|
78
81
|
]),
|
|
79
82
|
_: 2
|
|
80
83
|
}, 1032, ["item", "select-keys", "disable", "onSelect"]);
|
|
@@ -95,7 +95,7 @@ const _sfc_main = vue.defineComponent({
|
|
|
95
95
|
});
|
|
96
96
|
const isEmpty = vue.computed(() => {
|
|
97
97
|
return Object.keys(filter.value).every((key) => {
|
|
98
|
-
return
|
|
98
|
+
return filter.value[key] === originFilter[key];
|
|
99
99
|
});
|
|
100
100
|
});
|
|
101
101
|
vue.watch(
|
|
@@ -110,13 +110,14 @@ const _sfc_main = vue.defineComponent({
|
|
|
110
110
|
});
|
|
111
111
|
emits("change", result);
|
|
112
112
|
},
|
|
113
|
-
{ deep: true }
|
|
113
|
+
{ deep: true, immediate: true }
|
|
114
114
|
);
|
|
115
115
|
vue.onMounted(() => {
|
|
116
116
|
var _a;
|
|
117
117
|
load();
|
|
118
118
|
if ((_a = props.filterOptions) == null ? void 0 : _a.mediaType) {
|
|
119
119
|
filter.value.catalog = props.filterOptions.mediaType;
|
|
120
|
+
originFilter.catalog = props.filterOptions.mediaType;
|
|
120
121
|
}
|
|
121
122
|
});
|
|
122
123
|
return (_ctx, _cache) => {
|
|
@@ -4,12 +4,15 @@ var icon = require("@arco-design/web-vue/es/icon");
|
|
|
4
4
|
var vueCmstopIcons = require("@arco-iconbox/vue-cmstop-icons");
|
|
5
5
|
var webVue = require("@arco-design/web-vue");
|
|
6
6
|
var magic = require("./assets/magic.js");
|
|
7
|
+
var config = require("../config.js");
|
|
8
|
+
var index = require("../utils/index.js");
|
|
7
9
|
const _hoisted_1 = {
|
|
8
10
|
key: 0,
|
|
9
11
|
class: "thumb-upload-loading"
|
|
10
12
|
};
|
|
11
13
|
const _hoisted_2 = { class: "thumb-handler-list" };
|
|
12
14
|
const _hoisted_3 = ["onClick"];
|
|
15
|
+
const _hoisted_4 = { class: "thumb-select-tag" };
|
|
13
16
|
const _sfc_main = vue.defineComponent({
|
|
14
17
|
...{ name: "thumbCard" },
|
|
15
18
|
__name: "component",
|
|
@@ -28,12 +31,18 @@ const _sfc_main = vue.defineComponent({
|
|
|
28
31
|
setup(__props, { emit: __emit }) {
|
|
29
32
|
const props = __props;
|
|
30
33
|
const emits = __emit;
|
|
34
|
+
const BASE_API = props.BASE_API || config.DEFAULT_BASE_API;
|
|
31
35
|
const WATER_BG_URL = magic;
|
|
32
36
|
const isUploading = vue.computed(() => {
|
|
33
37
|
var _a;
|
|
34
38
|
return ((_a = props.meta) == null ? void 0 : _a.progress) != null;
|
|
35
39
|
});
|
|
36
|
-
const thumb = vue.computed(() =>
|
|
40
|
+
const thumb = vue.computed(() => {
|
|
41
|
+
if (["image", "video"].includes(props.catalog || "")) {
|
|
42
|
+
return props.thumb || props.url || "";
|
|
43
|
+
}
|
|
44
|
+
return `${BASE_API}/static/img/music.2ee269c.png`;
|
|
45
|
+
});
|
|
37
46
|
const styleObject = vue.computed(() => {
|
|
38
47
|
const style = {};
|
|
39
48
|
if (props.useMask) {
|
|
@@ -107,21 +116,13 @@ const _sfc_main = vue.defineComponent({
|
|
|
107
116
|
_: 1
|
|
108
117
|
})
|
|
109
118
|
], 64)) : _ctx.catalog && _ctx.url ? (vue.openBlock(), vue.createElementBlock(vue.Fragment, { key: 2 }, [
|
|
119
|
+
vue.createCommentVNode(" \u6709\u7C7B\u578B\u7684\u5C01\u9762 "),
|
|
110
120
|
vue.createCommentVNode(" \u56FE\u7247 "),
|
|
111
|
-
_ctx.catalog
|
|
121
|
+
_ctx.catalog ? (vue.openBlock(), vue.createBlock(vue.unref(webVue.Image), vue.mergeProps({
|
|
112
122
|
key: 0,
|
|
113
123
|
class: "thumb-image",
|
|
114
124
|
src: thumb.value
|
|
115
|
-
}, aImageAttr.value), null, 16, ["src"])) :
|
|
116
|
-
vue.createCommentVNode(" \u89C6\u9891 "),
|
|
117
|
-
vue.createVNode(vue.unref(webVue.Image), vue.mergeProps({
|
|
118
|
-
class: "thumb-image",
|
|
119
|
-
src: thumb.value
|
|
120
|
-
}, aImageAttr.value), null, 16, ["src"])
|
|
121
|
-
], 64)) : _ctx.catalog === "audio" ? (vue.openBlock(), vue.createElementBlock(vue.Fragment, { key: 2 }, [
|
|
122
|
-
vue.createCommentVNode(" \u97F3\u9891 "),
|
|
123
|
-
vue.createTextVNode(" \u97F3\u9891 ")
|
|
124
|
-
], 64)) : vue.createCommentVNode("v-if", true),
|
|
125
|
+
}, aImageAttr.value), null, 16, ["src"])) : vue.createCommentVNode("v-if", true),
|
|
125
126
|
vue.createCommentVNode(" \u5C55\u793A\u6A21\u5F0F "),
|
|
126
127
|
vue.createElementVNode("div", _hoisted_2, [
|
|
127
128
|
(vue.openBlock(true), vue.createElementBlock(vue.Fragment, null, vue.renderList(_ctx.handlersKey, (item) => {
|
|
@@ -132,9 +133,8 @@ const _sfc_main = vue.defineComponent({
|
|
|
132
133
|
}, vue.toDisplayString(item.label), 9, _hoisted_3);
|
|
133
134
|
}), 128))
|
|
134
135
|
])
|
|
135
|
-
], 64)) :
|
|
136
|
-
|
|
137
|
-
], 64))
|
|
136
|
+
], 64)) : vue.createCommentVNode("v-if", true),
|
|
137
|
+
vue.createElementVNode("div", _hoisted_4, vue.toDisplayString(vue.unref(index.mediaTime)(_ctx.meta.length)), 1)
|
|
138
138
|
], 6);
|
|
139
139
|
};
|
|
140
140
|
}
|
|
@@ -57,11 +57,26 @@
|
|
|
57
57
|
.thumb-select-wrapper:hover .thumb-handler-list {
|
|
58
58
|
opacity: 1;
|
|
59
59
|
}
|
|
60
|
+
.thumb-select-wrapper:hover .thumb-select-tag {
|
|
61
|
+
opacity: 0;
|
|
62
|
+
}
|
|
60
63
|
.thumb-select-wrapper.thumb-no-mask {
|
|
61
64
|
background-color: #f2f3f5;
|
|
62
65
|
border: 1px dashed #e5e6eb !important;
|
|
63
66
|
}
|
|
64
|
-
.
|
|
67
|
+
.thumb-select-wrapper .thumb-select-tag {
|
|
68
|
+
position: absolute;
|
|
69
|
+
right: 5px;
|
|
70
|
+
bottom: 5px;
|
|
71
|
+
padding: 2px 10px;
|
|
72
|
+
color: #fff;
|
|
73
|
+
font-size: 12px;
|
|
74
|
+
background-color: rgba(0, 0, 0, 0.5);
|
|
75
|
+
border-radius: 16px;
|
|
76
|
+
opacity: 1;
|
|
77
|
+
transition: all 0.3s ease-in-out;
|
|
78
|
+
}
|
|
79
|
+
.thumb-select-wrapper .arco-dropdown-option-content {
|
|
65
80
|
display: flex;
|
|
66
81
|
gap: 8px;
|
|
67
82
|
align-items: center;
|
|
@@ -73,6 +73,10 @@
|
|
|
73
73
|
.thumb-handler-list {
|
|
74
74
|
opacity: 1;
|
|
75
75
|
}
|
|
76
|
+
|
|
77
|
+
.thumb-select-tag {
|
|
78
|
+
opacity: 0;
|
|
79
|
+
}
|
|
76
80
|
}
|
|
77
81
|
|
|
78
82
|
// 非马赛克模式
|
|
@@ -80,12 +84,25 @@
|
|
|
80
84
|
background-color: #f2f3f5;
|
|
81
85
|
border: 1px dashed #e5e6eb !important;
|
|
82
86
|
}
|
|
83
|
-
}
|
|
84
87
|
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
88
|
+
.thumb-select-tag {
|
|
89
|
+
position: absolute;
|
|
90
|
+
right: 5px;
|
|
91
|
+
bottom: 5px;
|
|
92
|
+
padding: 2px 10px;
|
|
93
|
+
color: #fff;
|
|
94
|
+
font-size: 12px;
|
|
95
|
+
background-color: rgba(0, 0, 0, 0.5);
|
|
96
|
+
border-radius: 16px;
|
|
97
|
+
opacity: 1;
|
|
98
|
+
transition: all 0.3s ease-in-out;
|
|
99
|
+
}
|
|
100
|
+
|
|
101
|
+
// 素材选择
|
|
102
|
+
.arco-dropdown-option-content {
|
|
103
|
+
display: flex;
|
|
104
|
+
gap: 8px;
|
|
105
|
+
align-items: center;
|
|
106
|
+
font-size: 14px;
|
|
107
|
+
}
|
|
91
108
|
}
|
package/lib/utils/index.js
CHANGED
|
@@ -114,10 +114,51 @@ function getThemeColor(BASE_API, src) {
|
|
|
114
114
|
});
|
|
115
115
|
});
|
|
116
116
|
}
|
|
117
|
+
async function copyContent(content) {
|
|
118
|
+
try {
|
|
119
|
+
if (typeof content === "string") {
|
|
120
|
+
const input = document.createElement("input");
|
|
121
|
+
input.setAttribute("value", content);
|
|
122
|
+
document.body.appendChild(input);
|
|
123
|
+
input.select();
|
|
124
|
+
document.execCommand("copy");
|
|
125
|
+
document.body.removeChild(input);
|
|
126
|
+
return true;
|
|
127
|
+
}
|
|
128
|
+
if (window.__POWERED_BY_WUJIE__) {
|
|
129
|
+
await window.parent.navigator.clipboard.write([
|
|
130
|
+
new ClipboardItem({
|
|
131
|
+
"image/png": content
|
|
132
|
+
})
|
|
133
|
+
]);
|
|
134
|
+
} else {
|
|
135
|
+
await navigator.clipboard.write([
|
|
136
|
+
new ClipboardItem({
|
|
137
|
+
"image/png": content
|
|
138
|
+
})
|
|
139
|
+
]);
|
|
140
|
+
}
|
|
141
|
+
return true;
|
|
142
|
+
} catch (e) {
|
|
143
|
+
return false;
|
|
144
|
+
}
|
|
145
|
+
}
|
|
146
|
+
function mediaTime(v) {
|
|
147
|
+
const h = Math.floor(v / (60 * 60));
|
|
148
|
+
const m = Math.floor((v - h) / 60);
|
|
149
|
+
const s = Math.floor(v - h * 360 - m * 60);
|
|
150
|
+
let ret = "";
|
|
151
|
+
ret += `${h < 10 ? `0${h}` : h}:`;
|
|
152
|
+
ret += `${m < 10 ? `0${m}` : m}:`;
|
|
153
|
+
ret += s < 10 ? `0${s}` : s;
|
|
154
|
+
return ret;
|
|
155
|
+
}
|
|
156
|
+
exports.copyContent = copyContent;
|
|
117
157
|
exports.dateYYYYDDMMHHmm = dateYYYYDDMMHHmm;
|
|
118
158
|
exports.generateUUID = generateUUID;
|
|
119
159
|
exports.getRealUrl = getRealUrl;
|
|
120
160
|
exports.getThemeColor = getThemeColor;
|
|
161
|
+
exports.mediaTime = mediaTime;
|
|
121
162
|
exports.noCoverText = noCoverText;
|
|
122
163
|
exports.replaceSuffix = replaceSuffix;
|
|
123
164
|
exports.timeFormat = timeFormat;
|
package/lib/utils/typeMap.js
CHANGED
|
@@ -100,7 +100,8 @@ const kongo_source_map = {
|
|
|
100
100
|
document: "\u7A3F\u4EF6",
|
|
101
101
|
category_list: "\u9891\u9053",
|
|
102
102
|
service: "\u670D\u52A1",
|
|
103
|
-
political: "\u653F\u60C5"
|
|
103
|
+
political: "\u653F\u60C5",
|
|
104
|
+
applet: "\u5C0F\u7A0B\u5E8F"
|
|
104
105
|
};
|
|
105
106
|
const calcApprovingUser = (data) => {
|
|
106
107
|
if (data.current_processes[0] && data.current_processes[0].users && data.current_processes[0].users[0]) {
|