@cmstops/pro-compo 0.3.7 → 0.3.9
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/es/contentDetailList/components/ShowQRCode/QrcodeView/index.js +60 -117
- package/es/contentDetailList/components/ShowQRCode/index.js +28 -9
- package/es/selectThumb/component.js +16 -9
- package/es/selectThumb/components/card.js +80 -45
- package/es/style/index.less +1 -1
- package/lib/contentDetailList/components/ShowQRCode/QrcodeView/index.js +58 -116
- package/lib/contentDetailList/components/ShowQRCode/index.js +26 -7
- package/lib/selectThumb/component.js +16 -9
- package/lib/selectThumb/components/card.js +78 -43
- package/lib/style/index.less +1 -1
- package/package.json +1 -1
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { defineComponent, ref, computed, onMounted, onBeforeUnmount, openBlock, createElementBlock, createCommentVNode,
|
|
2
|
-
import {
|
|
1
|
+
import { defineComponent, ref, computed, onMounted, onBeforeUnmount, openBlock, createElementBlock, createCommentVNode, createElementVNode, Fragment, createVNode, unref, withCtx, renderList, createBlock, toDisplayString, createTextVNode, nextTick } from "vue";
|
|
2
|
+
import { Select, Option, Button, Message } from "@arco-design/web-vue";
|
|
3
3
|
import { IconQrcode } from "@arco-design/web-vue/es/icon";
|
|
4
|
-
import
|
|
4
|
+
import "html2canvas";
|
|
5
5
|
import QRCode from "qrcodejs2-fix";
|
|
6
6
|
import { getSpaceDate } from "../../../../utils/date.js";
|
|
7
7
|
import { generateDocPreviewLink } from "../../../script/api.js";
|
|
@@ -41,8 +41,10 @@ const _sfc_main = defineComponent({
|
|
|
41
41
|
docData: {},
|
|
42
42
|
BASE_API: {}
|
|
43
43
|
},
|
|
44
|
-
|
|
44
|
+
emits: ["changeLoading"],
|
|
45
|
+
setup(__props, { emit: __emit }) {
|
|
45
46
|
const props = __props;
|
|
47
|
+
const emit = __emit;
|
|
46
48
|
const qrcode = ref();
|
|
47
49
|
const dataInfo = ref(null);
|
|
48
50
|
const expirationOptions = ref([
|
|
@@ -56,7 +58,6 @@ const _sfc_main = defineComponent({
|
|
|
56
58
|
{ label: "30\u5929", value: 60 * 60 * 24 * 30 }
|
|
57
59
|
]);
|
|
58
60
|
const expiration = ref(60 * 60 * 24);
|
|
59
|
-
const loading = ref(false);
|
|
60
61
|
const interval = ref(null);
|
|
61
62
|
const time = ref("");
|
|
62
63
|
const local_url = ref("");
|
|
@@ -84,38 +85,8 @@ const _sfc_main = defineComponent({
|
|
|
84
85
|
return true;
|
|
85
86
|
return flag;
|
|
86
87
|
});
|
|
87
|
-
const clip = (data) => {
|
|
88
|
-
const clipboard = typeof data === "string" ? navigator.clipboard.writeText(data) : navigator.clipboard.write(data);
|
|
89
|
-
clipboard.then(
|
|
90
|
-
() => {
|
|
91
|
-
Message.success({
|
|
92
|
-
content: "\u5DF2\u4FDD\u5B58\u5230\u7C98\u8D34\u677F"
|
|
93
|
-
});
|
|
94
|
-
},
|
|
95
|
-
() => {
|
|
96
|
-
Message.success({
|
|
97
|
-
content: "\u4FDD\u5B58\u5931\u8D25"
|
|
98
|
-
});
|
|
99
|
-
}
|
|
100
|
-
);
|
|
101
|
-
};
|
|
102
|
-
const clipUrl = (type) => {
|
|
103
|
-
if (!dataInfo.value.share.share_url)
|
|
104
|
-
return;
|
|
105
|
-
if (type === "text") {
|
|
106
|
-
clip(dataInfo.value.share.share_url);
|
|
107
|
-
} else {
|
|
108
|
-
const img = document.querySelector(`#${dynamicQRId.value} img`);
|
|
109
|
-
html2canvas(img).then((canvas) => {
|
|
110
|
-
canvas.toBlob((blob) => {
|
|
111
|
-
const data = [new ClipboardItem({ [blob.type]: blob })];
|
|
112
|
-
clip(data);
|
|
113
|
-
}, "image/png");
|
|
114
|
-
});
|
|
115
|
-
}
|
|
116
|
-
};
|
|
117
88
|
const genTimeLink = async (expiration2, force = true, tip = true) => {
|
|
118
|
-
|
|
89
|
+
emit("changeLoading", true);
|
|
119
90
|
const data = {
|
|
120
91
|
force,
|
|
121
92
|
hash_id: dataInfo.value.hash_id || dataInfo.value.hashid
|
|
@@ -133,7 +104,7 @@ const _sfc_main = defineComponent({
|
|
|
133
104
|
nextTick(() => {
|
|
134
105
|
loadQrcode(`${message.inner_url}?reqTime=${reqTime}`);
|
|
135
106
|
setTimeout(() => {
|
|
136
|
-
|
|
107
|
+
emit("changeLoading", false);
|
|
137
108
|
}, 500);
|
|
138
109
|
});
|
|
139
110
|
} else {
|
|
@@ -162,7 +133,6 @@ const _sfc_main = defineComponent({
|
|
|
162
133
|
};
|
|
163
134
|
onMounted(() => {
|
|
164
135
|
dataInfo.value = props.docData;
|
|
165
|
-
console.log(1111, dataInfo.value);
|
|
166
136
|
if (needLoadQR.value) {
|
|
167
137
|
genTimeLink(60 * 60 * 24, false, false);
|
|
168
138
|
}
|
|
@@ -177,87 +147,60 @@ const _sfc_main = defineComponent({
|
|
|
177
147
|
return (_ctx, _cache) => {
|
|
178
148
|
return openBlock(), createElementBlock("div", _hoisted_1, [
|
|
179
149
|
createCommentVNode(" \u9884\u89C8\u624B\u673A\u626B\u7801 "),
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
class: "qrcode"
|
|
192
|
-
}, null, 8, _hoisted_3)) : (openBlock(), createElementBlock(Fragment, { key: 1 }, [
|
|
193
|
-
!is_publish.value ? (openBlock(), createElementBlock("div", _hoisted_4, [
|
|
194
|
-
createElementVNode("div", _hoisted_5, [
|
|
195
|
-
createVNode(unref(IconQrcode), { size: 200 })
|
|
196
|
-
])
|
|
197
|
-
])) : (openBlock(), createElementBlock("div", _hoisted_6, "\u6682\u65E0\u4E8C\u7EF4\u7801"))
|
|
198
|
-
], 64)),
|
|
199
|
-
is_share.value ? (openBlock(), createElementBlock("div", _hoisted_7, "\u626B\u63CF\u4E8C\u7EF4\u7801\u8BBF\u95EE")) : (openBlock(), createElementBlock("div", _hoisted_8, [
|
|
200
|
-
_hoisted_9,
|
|
201
|
-
createElementVNode("span", null, [
|
|
202
|
-
createVNode(unref(Select), {
|
|
203
|
-
modelValue: expiration.value,
|
|
204
|
-
"onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => expiration.value = $event),
|
|
205
|
-
size: "mini",
|
|
206
|
-
placeholder: "\u8BF7\u9009\u62E9"
|
|
207
|
-
}, {
|
|
208
|
-
default: withCtx(() => [
|
|
209
|
-
(openBlock(true), createElementBlock(Fragment, null, renderList(expirationOptions.value, (time2, index) => {
|
|
210
|
-
return openBlock(), createBlock(unref(Option), {
|
|
211
|
-
key: index,
|
|
212
|
-
label: time2.label,
|
|
213
|
-
value: time2.value
|
|
214
|
-
}, null, 8, ["label", "value"]);
|
|
215
|
-
}), 128))
|
|
216
|
-
]),
|
|
217
|
-
_: 1
|
|
218
|
-
}, 8, ["modelValue"])
|
|
219
|
-
])
|
|
220
|
-
])),
|
|
221
|
-
is_share.value && time.value ? (openBlock(), createElementBlock("div", _hoisted_10, "\u94FE\u63A5\u5269\u4F59\u65F6\u95F4: " + toDisplayString(time.value), 1)) : is_share.value && time.value === 0 ? (openBlock(), createElementBlock("div", _hoisted_11, "\u94FE\u63A5\u5DF2\u8FC7\u671F")) : createCommentVNode("v-if", true),
|
|
222
|
-
createElementVNode("div", _hoisted_12, [
|
|
223
|
-
showGetLink.value ? (openBlock(), createBlock(unref(Button), {
|
|
224
|
-
key: 0,
|
|
225
|
-
type: "primary",
|
|
226
|
-
light: "",
|
|
227
|
-
onClick: _cache[1] || (_cache[1] = ($event) => genTimeLink(expiration.value))
|
|
228
|
-
}, {
|
|
229
|
-
default: withCtx(() => [
|
|
230
|
-
createTextVNode("\u751F\u6210\u9884\u89C8\u94FE\u63A5")
|
|
231
|
-
]),
|
|
232
|
-
_: 1
|
|
233
|
-
})) : (openBlock(), createElementBlock(Fragment, { key: 1 }, [
|
|
234
|
-
createVNode(unref(Button), {
|
|
235
|
-
class: "auto",
|
|
236
|
-
light: "",
|
|
237
|
-
onClick: _cache[2] || (_cache[2] = ($event) => clipUrl("img"))
|
|
238
|
-
}, {
|
|
239
|
-
default: withCtx(() => [
|
|
240
|
-
createTextVNode("\u590D\u5236\u4E8C\u7EF4\u7801")
|
|
241
|
-
]),
|
|
242
|
-
_: 1
|
|
243
|
-
}),
|
|
244
|
-
createVNode(unref(Button), {
|
|
245
|
-
class: "auto",
|
|
246
|
-
type: "primary",
|
|
247
|
-
light: "",
|
|
248
|
-
onClick: _cache[3] || (_cache[3] = ($event) => clipUrl("text"))
|
|
249
|
-
}, {
|
|
250
|
-
default: withCtx(() => [
|
|
251
|
-
createTextVNode(toDisplayString(time.value ? "\u590D\u5236\u9884\u89C8\u5730\u5740" : "\u590D\u5236\u8BBF\u95EE\u5730\u5740"), 1)
|
|
252
|
-
]),
|
|
253
|
-
_: 1
|
|
254
|
-
})
|
|
255
|
-
], 64))
|
|
150
|
+
createElementVNode("div", _hoisted_2, [
|
|
151
|
+
is_share.value ? (openBlock(), createElementBlock("div", {
|
|
152
|
+
key: 0,
|
|
153
|
+
id: dynamicQRId.value,
|
|
154
|
+
ref_key: "qrcode",
|
|
155
|
+
ref: qrcode,
|
|
156
|
+
class: "qrcode"
|
|
157
|
+
}, null, 8, _hoisted_3)) : (openBlock(), createElementBlock(Fragment, { key: 1 }, [
|
|
158
|
+
!is_publish.value ? (openBlock(), createElementBlock("div", _hoisted_4, [
|
|
159
|
+
createElementVNode("div", _hoisted_5, [
|
|
160
|
+
createVNode(unref(IconQrcode), { size: 200 })
|
|
256
161
|
])
|
|
162
|
+
])) : (openBlock(), createElementBlock("div", _hoisted_6, "\u6682\u65E0\u4E8C\u7EF4\u7801"))
|
|
163
|
+
], 64)),
|
|
164
|
+
is_share.value ? (openBlock(), createElementBlock("div", _hoisted_7, "\u626B\u63CF\u4E8C\u7EF4\u7801\u8BBF\u95EE")) : (openBlock(), createElementBlock("div", _hoisted_8, [
|
|
165
|
+
_hoisted_9,
|
|
166
|
+
createElementVNode("span", null, [
|
|
167
|
+
createVNode(unref(Select), {
|
|
168
|
+
modelValue: expiration.value,
|
|
169
|
+
"onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => expiration.value = $event),
|
|
170
|
+
size: "mini",
|
|
171
|
+
placeholder: "\u8BF7\u9009\u62E9"
|
|
172
|
+
}, {
|
|
173
|
+
default: withCtx(() => [
|
|
174
|
+
(openBlock(true), createElementBlock(Fragment, null, renderList(expirationOptions.value, (time2, index) => {
|
|
175
|
+
return openBlock(), createBlock(unref(Option), {
|
|
176
|
+
key: index,
|
|
177
|
+
label: time2.label,
|
|
178
|
+
value: time2.value
|
|
179
|
+
}, null, 8, ["label", "value"]);
|
|
180
|
+
}), 128))
|
|
181
|
+
]),
|
|
182
|
+
_: 1
|
|
183
|
+
}, 8, ["modelValue"])
|
|
257
184
|
])
|
|
258
|
-
]),
|
|
259
|
-
|
|
260
|
-
|
|
185
|
+
])),
|
|
186
|
+
is_share.value && time.value ? (openBlock(), createElementBlock("div", _hoisted_10, "\u94FE\u63A5\u5269\u4F59\u65F6\u95F4: " + toDisplayString(time.value), 1)) : is_share.value && time.value === 0 ? (openBlock(), createElementBlock("div", _hoisted_11, "\u94FE\u63A5\u5DF2\u8FC7\u671F")) : createCommentVNode("v-if", true),
|
|
187
|
+
createElementVNode("div", _hoisted_12, [
|
|
188
|
+
showGetLink.value ? (openBlock(), createBlock(unref(Button), {
|
|
189
|
+
key: 0,
|
|
190
|
+
type: "primary",
|
|
191
|
+
light: "",
|
|
192
|
+
onClick: _cache[1] || (_cache[1] = ($event) => genTimeLink(expiration.value))
|
|
193
|
+
}, {
|
|
194
|
+
default: withCtx(() => [
|
|
195
|
+
createTextVNode("\u751F\u6210\u9884\u89C8\u94FE\u63A5")
|
|
196
|
+
]),
|
|
197
|
+
_: 1
|
|
198
|
+
})) : (openBlock(), createElementBlock(Fragment, { key: 1 }, [
|
|
199
|
+
createCommentVNode("v-if", true),
|
|
200
|
+
createCommentVNode("v-if", true)
|
|
201
|
+
], 64))
|
|
202
|
+
])
|
|
203
|
+
])
|
|
261
204
|
]);
|
|
262
205
|
};
|
|
263
206
|
}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { defineComponent, ref, openBlock, createBlock, unref, withCtx, withModifiers, createCommentVNode, createElementVNode
|
|
2
|
-
import { Popover } from "@arco-design/web-vue";
|
|
1
|
+
import { defineComponent, ref, openBlock, createBlock, unref, withCtx, createVNode, withModifiers, createCommentVNode, createElementVNode } from "vue";
|
|
2
|
+
import { Popover, Spin } from "@arco-design/web-vue";
|
|
3
3
|
import { IconQrcode } from "@arco-design/web-vue/es/icon";
|
|
4
4
|
import { getDocDetailsNew } from "../../script/api.js";
|
|
5
5
|
import _sfc_main$1 from "./QrcodeView/index.js";
|
|
@@ -12,6 +12,7 @@ const _sfc_main = defineComponent({
|
|
|
12
12
|
},
|
|
13
13
|
setup(__props) {
|
|
14
14
|
const props = __props;
|
|
15
|
+
const loading = ref(false);
|
|
15
16
|
const docData = ref(null);
|
|
16
17
|
const showQR = ref(false);
|
|
17
18
|
const getDocDetail = async () => {
|
|
@@ -23,26 +24,44 @@ const _sfc_main = defineComponent({
|
|
|
23
24
|
}
|
|
24
25
|
};
|
|
25
26
|
const openPopover = () => {
|
|
27
|
+
loading.value = true;
|
|
26
28
|
getDocDetail();
|
|
27
29
|
setTimeout(() => {
|
|
28
30
|
showQR.value = true;
|
|
29
31
|
}, 500);
|
|
30
32
|
};
|
|
33
|
+
const handleChangeLoading = (val) => {
|
|
34
|
+
loading.value = val;
|
|
35
|
+
console.log(1111, loading.value);
|
|
36
|
+
};
|
|
31
37
|
return (_ctx, _cache) => {
|
|
32
38
|
return openBlock(), createBlock(unref(Popover), {
|
|
39
|
+
"content-style": {
|
|
40
|
+
minWidth: "224px",
|
|
41
|
+
minHeight: "300px"
|
|
42
|
+
},
|
|
33
43
|
position: "bottom",
|
|
34
44
|
trigger: "click",
|
|
35
45
|
onShow: openPopover,
|
|
36
46
|
onHide: _cache[1] || (_cache[1] = ($event) => showQR.value = false)
|
|
37
47
|
}, {
|
|
38
48
|
content: withCtx(() => [
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
49
|
+
createVNode(unref(Spin), {
|
|
50
|
+
loading: loading.value,
|
|
51
|
+
style: { "min-width": "224px", "min-height": "300px" }
|
|
52
|
+
}, {
|
|
53
|
+
default: withCtx(() => [
|
|
54
|
+
showQR.value ? (openBlock(), createBlock(_sfc_main$1, {
|
|
55
|
+
key: 0,
|
|
56
|
+
BASE_API: _ctx.BASE_API,
|
|
57
|
+
docData: docData.value || props.item,
|
|
58
|
+
onChangeLoading: handleChangeLoading,
|
|
59
|
+
onClick: _cache[0] || (_cache[0] = withModifiers(() => {
|
|
60
|
+
}, ["stop"]))
|
|
61
|
+
}, null, 8, ["BASE_API", "docData"])) : createCommentVNode("v-if", true)
|
|
62
|
+
]),
|
|
63
|
+
_: 1
|
|
64
|
+
}, 8, ["loading"])
|
|
46
65
|
]),
|
|
47
66
|
default: withCtx(() => [
|
|
48
67
|
createElementVNode("section", _hoisted_1, [
|
|
@@ -87,7 +87,6 @@ const _sfc_main = defineComponent({
|
|
|
87
87
|
const emit = __emit;
|
|
88
88
|
const props = __props;
|
|
89
89
|
const BASE_API = props.BASE_API || DEFAULT_BASE_API;
|
|
90
|
-
ref(props.cropper || false);
|
|
91
90
|
const oldData = ref(null);
|
|
92
91
|
const styleData = ref({});
|
|
93
92
|
const thumbBannerModel = ref("banner");
|
|
@@ -360,10 +359,12 @@ const _sfc_main = defineComponent({
|
|
|
360
359
|
key: index,
|
|
361
360
|
id: `thumb-card-${index}`,
|
|
362
361
|
data: thumbList.value[index],
|
|
362
|
+
"onUpdate:data": ($event) => thumbList.value[index] = $event,
|
|
363
363
|
"preview-list": previewList.value,
|
|
364
364
|
"thumb-model": "thumb",
|
|
365
|
+
onUploadLocal: _cache[0] || (_cache[0] = (cb) => _ctx.$emit("upload", cb)),
|
|
365
366
|
onOpen: ($event) => openDialogMediaSelection($event, index)
|
|
366
|
-
}, null, 8, ["id", "data", "preview-list", "onOpen"]);
|
|
367
|
+
}, null, 8, ["id", "data", "onUpdate:data", "preview-list", "onOpen"]);
|
|
367
368
|
}), 128))
|
|
368
369
|
])) : currentModel.value ? (openBlock(), createElementBlock(Fragment, { key: 1 }, [
|
|
369
370
|
createCommentVNode(" \u5C01\u9762\u56FEcard "),
|
|
@@ -373,11 +374,13 @@ const _sfc_main = defineComponent({
|
|
|
373
374
|
key: index,
|
|
374
375
|
id: `thumb-card-${index}`,
|
|
375
376
|
data: thumbList.value[index],
|
|
377
|
+
"onUpdate:data": ($event) => thumbList.value[index] = $event,
|
|
376
378
|
model: model.value,
|
|
377
379
|
"preview-list": previewList.value,
|
|
378
380
|
"thumb-model": "thumb",
|
|
381
|
+
onUploadLocal: _cache[1] || (_cache[1] = (cb) => _ctx.$emit("upload", cb)),
|
|
379
382
|
onOpen: ($event) => openDialogMediaSelection($event, index)
|
|
380
|
-
}, null, 8, ["id", "data", "model", "preview-list", "onOpen"]);
|
|
383
|
+
}, null, 8, ["id", "data", "onUpdate:data", "model", "preview-list", "onOpen"]);
|
|
381
384
|
}), 128))
|
|
382
385
|
])
|
|
383
386
|
], 2112)) : createCommentVNode("v-if", true),
|
|
@@ -389,7 +392,7 @@ const _sfc_main = defineComponent({
|
|
|
389
392
|
createCommentVNode(" \u9009\u62E9\u5927\u56FE\u3001\u4E09\u56FE\u3001\u5355\u56FE...\u7B49\u6A21\u5F0F "),
|
|
390
393
|
createVNode(unref(RadioGroup), {
|
|
391
394
|
modelValue: model.value,
|
|
392
|
-
"onUpdate:modelValue": _cache[
|
|
395
|
+
"onUpdate:modelValue": _cache[2] || (_cache[2] = ($event) => model.value = $event),
|
|
393
396
|
size: "small",
|
|
394
397
|
type: "button",
|
|
395
398
|
style: { "margin-top": "10px" },
|
|
@@ -427,7 +430,7 @@ const _sfc_main = defineComponent({
|
|
|
427
430
|
!_ctx.flex ? (openBlock(), createBlock(unref(Switch), {
|
|
428
431
|
key: 0,
|
|
429
432
|
modelValue: hasBanner.value,
|
|
430
|
-
"onUpdate:modelValue": _cache[
|
|
433
|
+
"onUpdate:modelValue": _cache[3] || (_cache[3] = ($event) => hasBanner.value = $event),
|
|
431
434
|
size: "small"
|
|
432
435
|
}, null, 8, ["modelValue"])) : createCommentVNode("v-if", true)
|
|
433
436
|
], 4),
|
|
@@ -436,7 +439,7 @@ const _sfc_main = defineComponent({
|
|
|
436
439
|
_ctx.flex ? (openBlock(), createBlock(unref(Switch), {
|
|
437
440
|
key: 0,
|
|
438
441
|
modelValue: hasBanner.value,
|
|
439
|
-
"onUpdate:modelValue": _cache[
|
|
442
|
+
"onUpdate:modelValue": _cache[4] || (_cache[4] = ($event) => hasBanner.value = $event),
|
|
440
443
|
style: { "margin-bottom": "10px" },
|
|
441
444
|
size: "small"
|
|
442
445
|
}, null, 8, ["modelValue"])) : createCommentVNode("v-if", true),
|
|
@@ -444,8 +447,10 @@ const _sfc_main = defineComponent({
|
|
|
444
447
|
key: 1,
|
|
445
448
|
id: `banner-card`,
|
|
446
449
|
data: banner.value,
|
|
450
|
+
"onUpdate:data": _cache[5] || (_cache[5] = ($event) => banner.value = $event),
|
|
447
451
|
"preview-list": previewList.value,
|
|
448
452
|
"thumb-model": "banner",
|
|
453
|
+
onUploadLocal: _cache[6] || (_cache[6] = (cb) => _ctx.$emit("upload", cb)),
|
|
449
454
|
onOpen: openDialogMediaSelection
|
|
450
455
|
}, null, 8, ["data", "preview-list"])) : createCommentVNode("v-if", true),
|
|
451
456
|
hasBanner.value && styleData.value.banner_theme_color ? (openBlock(), createElementBlock("div", _hoisted_11, _hoisted_13)) : createCommentVNode("v-if", true),
|
|
@@ -476,8 +481,10 @@ const _sfc_main = defineComponent({
|
|
|
476
481
|
createVNode(_sfc_main$1, {
|
|
477
482
|
id: `pc-banner-card`,
|
|
478
483
|
data: pcBanner.value,
|
|
484
|
+
"onUpdate:data": _cache[7] || (_cache[7] = ($event) => pcBanner.value = $event),
|
|
479
485
|
previewList: previewList.value,
|
|
480
486
|
thumbModel: "pcBanner",
|
|
487
|
+
onUploadLocal: _cache[8] || (_cache[8] = (cb) => _ctx.$emit("upload", cb)),
|
|
481
488
|
onOpen: openDialogMediaSelection
|
|
482
489
|
}, null, 8, ["data", "previewList"]),
|
|
483
490
|
_ctx.flex ? (openBlock(), createElementBlock("span", _hoisted_19, "(\u5EFA\u8BAE\u5C3A\u5BF8\uFF1A1242px*662px)")) : createCommentVNode("v-if", true),
|
|
@@ -493,18 +500,18 @@ const _sfc_main = defineComponent({
|
|
|
493
500
|
], 64)) : createCommentVNode("v-if", true),
|
|
494
501
|
createVNode(_sfc_main$3, {
|
|
495
502
|
dialogVisible: dialogMediaSelectionShow.value,
|
|
496
|
-
"onUpdate:dialogVisible": _cache[
|
|
503
|
+
"onUpdate:dialogVisible": _cache[9] || (_cache[9] = ($event) => dialogMediaSelectionShow.value = $event),
|
|
497
504
|
preview: false,
|
|
498
505
|
"catalog-props": "image",
|
|
499
506
|
ai_static_covers: _ctx.aiImages,
|
|
500
507
|
BASE_API: unref(BASE_API),
|
|
501
508
|
onSubmit: submitCallback,
|
|
502
|
-
onUpload: _cache[
|
|
509
|
+
onUpload: _cache[10] || (_cache[10] = (cb) => _ctx.$emit("upload", cb))
|
|
503
510
|
}, null, 8, ["dialogVisible", "ai_static_covers", "BASE_API"]),
|
|
504
511
|
refreshCrop.value ? (openBlock(), createBlock(_sfc_main$4, {
|
|
505
512
|
key: 1,
|
|
506
513
|
visible: dialogCropperShow.value,
|
|
507
|
-
"onUpdate:visible": _cache[
|
|
514
|
+
"onUpdate:visible": _cache[11] || (_cache[11] = ($event) => dialogCropperShow.value = $event),
|
|
508
515
|
"aspect-ratio-prop": aspectRatioProp.value,
|
|
509
516
|
BASE_API: unref(BASE_API),
|
|
510
517
|
"corp-data": cropperData.value,
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { defineComponent, computed, openBlock,
|
|
2
|
-
import { Image } from "@arco-design/web-vue";
|
|
1
|
+
import { defineComponent, computed, openBlock, createBlock, unref, withCtx, createElementVNode, normalizeStyle, normalizeClass, createElementBlock, createVNode, Transition, withModifiers, createCommentVNode } from "vue";
|
|
2
|
+
import { Popover, Image } from "@arco-design/web-vue";
|
|
3
3
|
import { IconEdit, IconDelete, IconPlus } from "@arco-design/web-vue/es/icon";
|
|
4
4
|
import { DEFAULT_BASE_API } from "../../config.js";
|
|
5
5
|
const _hoisted_1 = {
|
|
@@ -14,9 +14,10 @@ const _sfc_main = defineComponent({
|
|
|
14
14
|
previewList: {},
|
|
15
15
|
thumbModel: {},
|
|
16
16
|
along: { type: Boolean },
|
|
17
|
-
model: {}
|
|
17
|
+
model: {},
|
|
18
|
+
changeThumbModel: { type: Function }
|
|
18
19
|
},
|
|
19
|
-
emits: ["open", "remove"],
|
|
20
|
+
emits: ["open", "remove", "uploadLocal", "update:data"],
|
|
20
21
|
setup(__props, { emit: __emit }) {
|
|
21
22
|
const waterBg = `${DEFAULT_BASE_API}/static/images/waterBg.png`;
|
|
22
23
|
const props = __props;
|
|
@@ -29,9 +30,24 @@ const _sfc_main = defineComponent({
|
|
|
29
30
|
[`model-${props.model}`]: ((_a = props.data) == null ? void 0 : _a.url) && props.model
|
|
30
31
|
};
|
|
31
32
|
});
|
|
33
|
+
const btnStyle = computed(() => {
|
|
34
|
+
return {
|
|
35
|
+
padding: "5px 10px",
|
|
36
|
+
cursor: "pointer"
|
|
37
|
+
};
|
|
38
|
+
});
|
|
32
39
|
const clickMask = () => {
|
|
33
40
|
props.along && openDialogMediaSelection();
|
|
34
41
|
};
|
|
42
|
+
const loaclUpload = () => {
|
|
43
|
+
emit("uploadLocal", (file) => {
|
|
44
|
+
const { data } = props;
|
|
45
|
+
if (!data || !file)
|
|
46
|
+
return;
|
|
47
|
+
data.url = file.url;
|
|
48
|
+
emit("update:data", data);
|
|
49
|
+
});
|
|
50
|
+
};
|
|
35
51
|
const openDialogMediaSelection = () => {
|
|
36
52
|
emit("open", props.thumbModel);
|
|
37
53
|
};
|
|
@@ -39,48 +55,67 @@ const _sfc_main = defineComponent({
|
|
|
39
55
|
emit("remove");
|
|
40
56
|
};
|
|
41
57
|
return (_ctx, _cache) => {
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
},
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
58
|
+
return openBlock(), createBlock(unref(Popover), {
|
|
59
|
+
trigger: "hover",
|
|
60
|
+
"content-style": "padding: 0;"
|
|
61
|
+
}, {
|
|
62
|
+
content: withCtx(() => [
|
|
63
|
+
createElementVNode("div", {
|
|
64
|
+
style: normalizeStyle(btnStyle.value),
|
|
65
|
+
onClick: openDialogMediaSelection
|
|
66
|
+
}, "\u7D20\u6750\u5E93\u9009\u62E9", 4),
|
|
67
|
+
createElementVNode("div", {
|
|
68
|
+
style: normalizeStyle(btnStyle.value),
|
|
69
|
+
onClick: loaclUpload
|
|
70
|
+
}, "\u672C\u5730\u4E0A\u4F20", 4)
|
|
71
|
+
]),
|
|
72
|
+
default: withCtx(() => {
|
|
73
|
+
var _a, _b;
|
|
74
|
+
return [
|
|
75
|
+
createElementVNode("div", {
|
|
76
|
+
class: normalizeClass(["thumb-card-container", classObj.value])
|
|
77
|
+
}, [
|
|
78
|
+
((_a = props.data) == null ? void 0 : _a.url) ? (openBlock(), createElementBlock("div", _hoisted_1, [
|
|
79
|
+
createVNode(unref(Image), {
|
|
80
|
+
class: "item",
|
|
81
|
+
fit: "cover",
|
|
82
|
+
src: (_b = props.data) == null ? void 0 : _b.url
|
|
83
|
+
}, null, 8, ["src"]),
|
|
84
|
+
createVNode(Transition, { name: "fade" }, {
|
|
85
|
+
default: withCtx(() => [
|
|
86
|
+
createElementVNode("div", {
|
|
87
|
+
class: "mask",
|
|
88
|
+
onClick: clickMask
|
|
89
|
+
}, [
|
|
90
|
+
createElementVNode("span", {
|
|
91
|
+
class: "half",
|
|
92
|
+
onClick: withModifiers(openDialogMediaSelection, ["stop"])
|
|
93
|
+
}, [
|
|
94
|
+
createVNode(unref(IconEdit))
|
|
95
|
+
]),
|
|
96
|
+
_ctx.along ? (openBlock(), createElementBlock("span", {
|
|
97
|
+
key: 0,
|
|
98
|
+
class: "half",
|
|
99
|
+
onClick: withModifiers(remove, ["stop"])
|
|
100
|
+
}, [
|
|
101
|
+
createVNode(unref(IconDelete))
|
|
102
|
+
])) : createCommentVNode("v-if", true)
|
|
103
|
+
])
|
|
104
|
+
]),
|
|
105
|
+
_: 1
|
|
106
|
+
})
|
|
107
|
+
])) : (openBlock(), createElementBlock("div", {
|
|
108
|
+
key: 1,
|
|
109
|
+
class: "item add-thumb",
|
|
110
|
+
style: normalizeStyle({ backgroundImage: `url(${waterBg})` })
|
|
57
111
|
}, [
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
key: 0,
|
|
66
|
-
class: "half",
|
|
67
|
-
onClick: withModifiers(remove, ["stop"])
|
|
68
|
-
}, [
|
|
69
|
-
createVNode(unref(IconDelete))
|
|
70
|
-
])) : createCommentVNode("v-if", true)
|
|
71
|
-
])
|
|
72
|
-
]),
|
|
73
|
-
_: 1
|
|
74
|
-
})
|
|
75
|
-
])) : (openBlock(), createElementBlock("div", {
|
|
76
|
-
key: 1,
|
|
77
|
-
class: "item add-thumb",
|
|
78
|
-
style: normalizeStyle({ backgroundImage: `url(${waterBg})` }),
|
|
79
|
-
onClick: withModifiers(openDialogMediaSelection, ["stop"])
|
|
80
|
-
}, [
|
|
81
|
-
createVNode(unref(IconPlus))
|
|
82
|
-
], 4))
|
|
83
|
-
], 2);
|
|
112
|
+
createVNode(unref(IconPlus))
|
|
113
|
+
], 4))
|
|
114
|
+
], 2)
|
|
115
|
+
];
|
|
116
|
+
}),
|
|
117
|
+
_: 1
|
|
118
|
+
});
|
|
84
119
|
};
|
|
85
120
|
}
|
|
86
121
|
});
|
package/es/style/index.less
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
// Global Style
|
|
1
|
+
// Global Style
|
|
@@ -2,14 +2,13 @@
|
|
|
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
|
-
|
|
5
|
+
require("html2canvas");
|
|
6
6
|
var QRCode = require("qrcodejs2-fix");
|
|
7
7
|
var date = require("../../../../utils/date.js");
|
|
8
8
|
var api = require("../../../script/api.js");
|
|
9
9
|
function _interopDefaultLegacy(e) {
|
|
10
10
|
return e && typeof e === "object" && "default" in e ? e : { "default": e };
|
|
11
11
|
}
|
|
12
|
-
var html2canvas__default = /* @__PURE__ */ _interopDefaultLegacy(html2canvas);
|
|
13
12
|
var QRCode__default = /* @__PURE__ */ _interopDefaultLegacy(QRCode);
|
|
14
13
|
const _hoisted_1 = { class: "preview-qrcode-iframe-container-v" };
|
|
15
14
|
const _hoisted_2 = { class: "doc-qrcode-preview-container-v" };
|
|
@@ -47,8 +46,10 @@ const _sfc_main = vue.defineComponent({
|
|
|
47
46
|
docData: {},
|
|
48
47
|
BASE_API: {}
|
|
49
48
|
},
|
|
50
|
-
|
|
49
|
+
emits: ["changeLoading"],
|
|
50
|
+
setup(__props, { emit: __emit }) {
|
|
51
51
|
const props = __props;
|
|
52
|
+
const emit = __emit;
|
|
52
53
|
const qrcode = vue.ref();
|
|
53
54
|
const dataInfo = vue.ref(null);
|
|
54
55
|
const expirationOptions = vue.ref([
|
|
@@ -62,7 +63,6 @@ const _sfc_main = vue.defineComponent({
|
|
|
62
63
|
{ label: "30\u5929", value: 60 * 60 * 24 * 30 }
|
|
63
64
|
]);
|
|
64
65
|
const expiration = vue.ref(60 * 60 * 24);
|
|
65
|
-
const loading = vue.ref(false);
|
|
66
66
|
const interval = vue.ref(null);
|
|
67
67
|
const time = vue.ref("");
|
|
68
68
|
const local_url = vue.ref("");
|
|
@@ -90,38 +90,8 @@ const _sfc_main = vue.defineComponent({
|
|
|
90
90
|
return true;
|
|
91
91
|
return flag;
|
|
92
92
|
});
|
|
93
|
-
const clip = (data) => {
|
|
94
|
-
const clipboard = typeof data === "string" ? navigator.clipboard.writeText(data) : navigator.clipboard.write(data);
|
|
95
|
-
clipboard.then(
|
|
96
|
-
() => {
|
|
97
|
-
webVue.Message.success({
|
|
98
|
-
content: "\u5DF2\u4FDD\u5B58\u5230\u7C98\u8D34\u677F"
|
|
99
|
-
});
|
|
100
|
-
},
|
|
101
|
-
() => {
|
|
102
|
-
webVue.Message.success({
|
|
103
|
-
content: "\u4FDD\u5B58\u5931\u8D25"
|
|
104
|
-
});
|
|
105
|
-
}
|
|
106
|
-
);
|
|
107
|
-
};
|
|
108
|
-
const clipUrl = (type) => {
|
|
109
|
-
if (!dataInfo.value.share.share_url)
|
|
110
|
-
return;
|
|
111
|
-
if (type === "text") {
|
|
112
|
-
clip(dataInfo.value.share.share_url);
|
|
113
|
-
} else {
|
|
114
|
-
const img = document.querySelector(`#${dynamicQRId.value} img`);
|
|
115
|
-
html2canvas__default["default"](img).then((canvas) => {
|
|
116
|
-
canvas.toBlob((blob) => {
|
|
117
|
-
const data = [new ClipboardItem({ [blob.type]: blob })];
|
|
118
|
-
clip(data);
|
|
119
|
-
}, "image/png");
|
|
120
|
-
});
|
|
121
|
-
}
|
|
122
|
-
};
|
|
123
93
|
const genTimeLink = async (expiration2, force = true, tip = true) => {
|
|
124
|
-
|
|
94
|
+
emit("changeLoading", true);
|
|
125
95
|
const data = {
|
|
126
96
|
force,
|
|
127
97
|
hash_id: dataInfo.value.hash_id || dataInfo.value.hashid
|
|
@@ -139,7 +109,7 @@ const _sfc_main = vue.defineComponent({
|
|
|
139
109
|
vue.nextTick(() => {
|
|
140
110
|
loadQrcode(`${message.inner_url}?reqTime=${reqTime}`);
|
|
141
111
|
setTimeout(() => {
|
|
142
|
-
|
|
112
|
+
emit("changeLoading", false);
|
|
143
113
|
}, 500);
|
|
144
114
|
});
|
|
145
115
|
} else {
|
|
@@ -168,7 +138,6 @@ const _sfc_main = vue.defineComponent({
|
|
|
168
138
|
};
|
|
169
139
|
vue.onMounted(() => {
|
|
170
140
|
dataInfo.value = props.docData;
|
|
171
|
-
console.log(1111, dataInfo.value);
|
|
172
141
|
if (needLoadQR.value) {
|
|
173
142
|
genTimeLink(60 * 60 * 24, false, false);
|
|
174
143
|
}
|
|
@@ -183,87 +152,60 @@ const _sfc_main = vue.defineComponent({
|
|
|
183
152
|
return (_ctx, _cache) => {
|
|
184
153
|
return vue.openBlock(), vue.createElementBlock("div", _hoisted_1, [
|
|
185
154
|
vue.createCommentVNode(" \u9884\u89C8\u624B\u673A\u626B\u7801 "),
|
|
186
|
-
vue.
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
class: "qrcode"
|
|
198
|
-
}, null, 8, _hoisted_3)) : (vue.openBlock(), vue.createElementBlock(vue.Fragment, { key: 1 }, [
|
|
199
|
-
!is_publish.value ? (vue.openBlock(), vue.createElementBlock("div", _hoisted_4, [
|
|
200
|
-
vue.createElementVNode("div", _hoisted_5, [
|
|
201
|
-
vue.createVNode(vue.unref(icon.IconQrcode), { size: 200 })
|
|
202
|
-
])
|
|
203
|
-
])) : (vue.openBlock(), vue.createElementBlock("div", _hoisted_6, "\u6682\u65E0\u4E8C\u7EF4\u7801"))
|
|
204
|
-
], 64)),
|
|
205
|
-
is_share.value ? (vue.openBlock(), vue.createElementBlock("div", _hoisted_7, "\u626B\u63CF\u4E8C\u7EF4\u7801\u8BBF\u95EE")) : (vue.openBlock(), vue.createElementBlock("div", _hoisted_8, [
|
|
206
|
-
_hoisted_9,
|
|
207
|
-
vue.createElementVNode("span", null, [
|
|
208
|
-
vue.createVNode(vue.unref(webVue.Select), {
|
|
209
|
-
modelValue: expiration.value,
|
|
210
|
-
"onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => expiration.value = $event),
|
|
211
|
-
size: "mini",
|
|
212
|
-
placeholder: "\u8BF7\u9009\u62E9"
|
|
213
|
-
}, {
|
|
214
|
-
default: vue.withCtx(() => [
|
|
215
|
-
(vue.openBlock(true), vue.createElementBlock(vue.Fragment, null, vue.renderList(expirationOptions.value, (time2, index) => {
|
|
216
|
-
return vue.openBlock(), vue.createBlock(vue.unref(webVue.Option), {
|
|
217
|
-
key: index,
|
|
218
|
-
label: time2.label,
|
|
219
|
-
value: time2.value
|
|
220
|
-
}, null, 8, ["label", "value"]);
|
|
221
|
-
}), 128))
|
|
222
|
-
]),
|
|
223
|
-
_: 1
|
|
224
|
-
}, 8, ["modelValue"])
|
|
225
|
-
])
|
|
226
|
-
])),
|
|
227
|
-
is_share.value && time.value ? (vue.openBlock(), vue.createElementBlock("div", _hoisted_10, "\u94FE\u63A5\u5269\u4F59\u65F6\u95F4: " + vue.toDisplayString(time.value), 1)) : is_share.value && time.value === 0 ? (vue.openBlock(), vue.createElementBlock("div", _hoisted_11, "\u94FE\u63A5\u5DF2\u8FC7\u671F")) : vue.createCommentVNode("v-if", true),
|
|
228
|
-
vue.createElementVNode("div", _hoisted_12, [
|
|
229
|
-
showGetLink.value ? (vue.openBlock(), vue.createBlock(vue.unref(webVue.Button), {
|
|
230
|
-
key: 0,
|
|
231
|
-
type: "primary",
|
|
232
|
-
light: "",
|
|
233
|
-
onClick: _cache[1] || (_cache[1] = ($event) => genTimeLink(expiration.value))
|
|
234
|
-
}, {
|
|
235
|
-
default: vue.withCtx(() => [
|
|
236
|
-
vue.createTextVNode("\u751F\u6210\u9884\u89C8\u94FE\u63A5")
|
|
237
|
-
]),
|
|
238
|
-
_: 1
|
|
239
|
-
})) : (vue.openBlock(), vue.createElementBlock(vue.Fragment, { key: 1 }, [
|
|
240
|
-
vue.createVNode(vue.unref(webVue.Button), {
|
|
241
|
-
class: "auto",
|
|
242
|
-
light: "",
|
|
243
|
-
onClick: _cache[2] || (_cache[2] = ($event) => clipUrl("img"))
|
|
244
|
-
}, {
|
|
245
|
-
default: vue.withCtx(() => [
|
|
246
|
-
vue.createTextVNode("\u590D\u5236\u4E8C\u7EF4\u7801")
|
|
247
|
-
]),
|
|
248
|
-
_: 1
|
|
249
|
-
}),
|
|
250
|
-
vue.createVNode(vue.unref(webVue.Button), {
|
|
251
|
-
class: "auto",
|
|
252
|
-
type: "primary",
|
|
253
|
-
light: "",
|
|
254
|
-
onClick: _cache[3] || (_cache[3] = ($event) => clipUrl("text"))
|
|
255
|
-
}, {
|
|
256
|
-
default: vue.withCtx(() => [
|
|
257
|
-
vue.createTextVNode(vue.toDisplayString(time.value ? "\u590D\u5236\u9884\u89C8\u5730\u5740" : "\u590D\u5236\u8BBF\u95EE\u5730\u5740"), 1)
|
|
258
|
-
]),
|
|
259
|
-
_: 1
|
|
260
|
-
})
|
|
261
|
-
], 64))
|
|
155
|
+
vue.createElementVNode("div", _hoisted_2, [
|
|
156
|
+
is_share.value ? (vue.openBlock(), vue.createElementBlock("div", {
|
|
157
|
+
key: 0,
|
|
158
|
+
id: dynamicQRId.value,
|
|
159
|
+
ref_key: "qrcode",
|
|
160
|
+
ref: qrcode,
|
|
161
|
+
class: "qrcode"
|
|
162
|
+
}, null, 8, _hoisted_3)) : (vue.openBlock(), vue.createElementBlock(vue.Fragment, { key: 1 }, [
|
|
163
|
+
!is_publish.value ? (vue.openBlock(), vue.createElementBlock("div", _hoisted_4, [
|
|
164
|
+
vue.createElementVNode("div", _hoisted_5, [
|
|
165
|
+
vue.createVNode(vue.unref(icon.IconQrcode), { size: 200 })
|
|
262
166
|
])
|
|
167
|
+
])) : (vue.openBlock(), vue.createElementBlock("div", _hoisted_6, "\u6682\u65E0\u4E8C\u7EF4\u7801"))
|
|
168
|
+
], 64)),
|
|
169
|
+
is_share.value ? (vue.openBlock(), vue.createElementBlock("div", _hoisted_7, "\u626B\u63CF\u4E8C\u7EF4\u7801\u8BBF\u95EE")) : (vue.openBlock(), vue.createElementBlock("div", _hoisted_8, [
|
|
170
|
+
_hoisted_9,
|
|
171
|
+
vue.createElementVNode("span", null, [
|
|
172
|
+
vue.createVNode(vue.unref(webVue.Select), {
|
|
173
|
+
modelValue: expiration.value,
|
|
174
|
+
"onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => expiration.value = $event),
|
|
175
|
+
size: "mini",
|
|
176
|
+
placeholder: "\u8BF7\u9009\u62E9"
|
|
177
|
+
}, {
|
|
178
|
+
default: vue.withCtx(() => [
|
|
179
|
+
(vue.openBlock(true), vue.createElementBlock(vue.Fragment, null, vue.renderList(expirationOptions.value, (time2, index) => {
|
|
180
|
+
return vue.openBlock(), vue.createBlock(vue.unref(webVue.Option), {
|
|
181
|
+
key: index,
|
|
182
|
+
label: time2.label,
|
|
183
|
+
value: time2.value
|
|
184
|
+
}, null, 8, ["label", "value"]);
|
|
185
|
+
}), 128))
|
|
186
|
+
]),
|
|
187
|
+
_: 1
|
|
188
|
+
}, 8, ["modelValue"])
|
|
263
189
|
])
|
|
264
|
-
]),
|
|
265
|
-
|
|
266
|
-
|
|
190
|
+
])),
|
|
191
|
+
is_share.value && time.value ? (vue.openBlock(), vue.createElementBlock("div", _hoisted_10, "\u94FE\u63A5\u5269\u4F59\u65F6\u95F4: " + vue.toDisplayString(time.value), 1)) : is_share.value && time.value === 0 ? (vue.openBlock(), vue.createElementBlock("div", _hoisted_11, "\u94FE\u63A5\u5DF2\u8FC7\u671F")) : vue.createCommentVNode("v-if", true),
|
|
192
|
+
vue.createElementVNode("div", _hoisted_12, [
|
|
193
|
+
showGetLink.value ? (vue.openBlock(), vue.createBlock(vue.unref(webVue.Button), {
|
|
194
|
+
key: 0,
|
|
195
|
+
type: "primary",
|
|
196
|
+
light: "",
|
|
197
|
+
onClick: _cache[1] || (_cache[1] = ($event) => genTimeLink(expiration.value))
|
|
198
|
+
}, {
|
|
199
|
+
default: vue.withCtx(() => [
|
|
200
|
+
vue.createTextVNode("\u751F\u6210\u9884\u89C8\u94FE\u63A5")
|
|
201
|
+
]),
|
|
202
|
+
_: 1
|
|
203
|
+
})) : (vue.openBlock(), vue.createElementBlock(vue.Fragment, { key: 1 }, [
|
|
204
|
+
vue.createCommentVNode("v-if", true),
|
|
205
|
+
vue.createCommentVNode("v-if", true)
|
|
206
|
+
], 64))
|
|
207
|
+
])
|
|
208
|
+
])
|
|
267
209
|
]);
|
|
268
210
|
};
|
|
269
211
|
}
|
|
@@ -13,6 +13,7 @@ const _sfc_main = vue.defineComponent({
|
|
|
13
13
|
},
|
|
14
14
|
setup(__props) {
|
|
15
15
|
const props = __props;
|
|
16
|
+
const loading = vue.ref(false);
|
|
16
17
|
const docData = vue.ref(null);
|
|
17
18
|
const showQR = vue.ref(false);
|
|
18
19
|
const getDocDetail = async () => {
|
|
@@ -24,26 +25,44 @@ const _sfc_main = vue.defineComponent({
|
|
|
24
25
|
}
|
|
25
26
|
};
|
|
26
27
|
const openPopover = () => {
|
|
28
|
+
loading.value = true;
|
|
27
29
|
getDocDetail();
|
|
28
30
|
setTimeout(() => {
|
|
29
31
|
showQR.value = true;
|
|
30
32
|
}, 500);
|
|
31
33
|
};
|
|
34
|
+
const handleChangeLoading = (val) => {
|
|
35
|
+
loading.value = val;
|
|
36
|
+
console.log(1111, loading.value);
|
|
37
|
+
};
|
|
32
38
|
return (_ctx, _cache) => {
|
|
33
39
|
return vue.openBlock(), vue.createBlock(vue.unref(webVue.Popover), {
|
|
40
|
+
"content-style": {
|
|
41
|
+
minWidth: "224px",
|
|
42
|
+
minHeight: "300px"
|
|
43
|
+
},
|
|
34
44
|
position: "bottom",
|
|
35
45
|
trigger: "click",
|
|
36
46
|
onShow: openPopover,
|
|
37
47
|
onHide: _cache[1] || (_cache[1] = ($event) => showQR.value = false)
|
|
38
48
|
}, {
|
|
39
49
|
content: vue.withCtx(() => [
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
50
|
+
vue.createVNode(vue.unref(webVue.Spin), {
|
|
51
|
+
loading: loading.value,
|
|
52
|
+
style: { "min-width": "224px", "min-height": "300px" }
|
|
53
|
+
}, {
|
|
54
|
+
default: vue.withCtx(() => [
|
|
55
|
+
showQR.value ? (vue.openBlock(), vue.createBlock(index, {
|
|
56
|
+
key: 0,
|
|
57
|
+
BASE_API: _ctx.BASE_API,
|
|
58
|
+
docData: docData.value || props.item,
|
|
59
|
+
onChangeLoading: handleChangeLoading,
|
|
60
|
+
onClick: _cache[0] || (_cache[0] = vue.withModifiers(() => {
|
|
61
|
+
}, ["stop"]))
|
|
62
|
+
}, null, 8, ["BASE_API", "docData"])) : vue.createCommentVNode("v-if", true)
|
|
63
|
+
]),
|
|
64
|
+
_: 1
|
|
65
|
+
}, 8, ["loading"])
|
|
47
66
|
]),
|
|
48
67
|
default: vue.withCtx(() => [
|
|
49
68
|
vue.createElementVNode("section", _hoisted_1, [
|
|
@@ -88,7 +88,6 @@ const _sfc_main = vue.defineComponent({
|
|
|
88
88
|
const emit = __emit;
|
|
89
89
|
const props = __props;
|
|
90
90
|
const BASE_API = props.BASE_API || config.DEFAULT_BASE_API;
|
|
91
|
-
vue.ref(props.cropper || false);
|
|
92
91
|
const oldData = vue.ref(null);
|
|
93
92
|
const styleData = vue.ref({});
|
|
94
93
|
const thumbBannerModel = vue.ref("banner");
|
|
@@ -361,10 +360,12 @@ const _sfc_main = vue.defineComponent({
|
|
|
361
360
|
key: index,
|
|
362
361
|
id: `thumb-card-${index}`,
|
|
363
362
|
data: thumbList.value[index],
|
|
363
|
+
"onUpdate:data": ($event) => thumbList.value[index] = $event,
|
|
364
364
|
"preview-list": previewList.value,
|
|
365
365
|
"thumb-model": "thumb",
|
|
366
|
+
onUploadLocal: _cache[0] || (_cache[0] = (cb) => _ctx.$emit("upload", cb)),
|
|
366
367
|
onOpen: ($event) => openDialogMediaSelection($event, index)
|
|
367
|
-
}, null, 8, ["id", "data", "preview-list", "onOpen"]);
|
|
368
|
+
}, null, 8, ["id", "data", "onUpdate:data", "preview-list", "onOpen"]);
|
|
368
369
|
}), 128))
|
|
369
370
|
])) : currentModel.value ? (vue.openBlock(), vue.createElementBlock(vue.Fragment, { key: 1 }, [
|
|
370
371
|
vue.createCommentVNode(" \u5C01\u9762\u56FEcard "),
|
|
@@ -374,11 +375,13 @@ const _sfc_main = vue.defineComponent({
|
|
|
374
375
|
key: index,
|
|
375
376
|
id: `thumb-card-${index}`,
|
|
376
377
|
data: thumbList.value[index],
|
|
378
|
+
"onUpdate:data": ($event) => thumbList.value[index] = $event,
|
|
377
379
|
model: model.value,
|
|
378
380
|
"preview-list": previewList.value,
|
|
379
381
|
"thumb-model": "thumb",
|
|
382
|
+
onUploadLocal: _cache[1] || (_cache[1] = (cb) => _ctx.$emit("upload", cb)),
|
|
380
383
|
onOpen: ($event) => openDialogMediaSelection($event, index)
|
|
381
|
-
}, null, 8, ["id", "data", "model", "preview-list", "onOpen"]);
|
|
384
|
+
}, null, 8, ["id", "data", "onUpdate:data", "model", "preview-list", "onOpen"]);
|
|
382
385
|
}), 128))
|
|
383
386
|
])
|
|
384
387
|
], 2112)) : vue.createCommentVNode("v-if", true),
|
|
@@ -390,7 +393,7 @@ const _sfc_main = vue.defineComponent({
|
|
|
390
393
|
vue.createCommentVNode(" \u9009\u62E9\u5927\u56FE\u3001\u4E09\u56FE\u3001\u5355\u56FE...\u7B49\u6A21\u5F0F "),
|
|
391
394
|
vue.createVNode(vue.unref(webVue.RadioGroup), {
|
|
392
395
|
modelValue: model.value,
|
|
393
|
-
"onUpdate:modelValue": _cache[
|
|
396
|
+
"onUpdate:modelValue": _cache[2] || (_cache[2] = ($event) => model.value = $event),
|
|
394
397
|
size: "small",
|
|
395
398
|
type: "button",
|
|
396
399
|
style: { "margin-top": "10px" },
|
|
@@ -428,7 +431,7 @@ const _sfc_main = vue.defineComponent({
|
|
|
428
431
|
!_ctx.flex ? (vue.openBlock(), vue.createBlock(vue.unref(webVue.Switch), {
|
|
429
432
|
key: 0,
|
|
430
433
|
modelValue: hasBanner.value,
|
|
431
|
-
"onUpdate:modelValue": _cache[
|
|
434
|
+
"onUpdate:modelValue": _cache[3] || (_cache[3] = ($event) => hasBanner.value = $event),
|
|
432
435
|
size: "small"
|
|
433
436
|
}, null, 8, ["modelValue"])) : vue.createCommentVNode("v-if", true)
|
|
434
437
|
], 4),
|
|
@@ -437,7 +440,7 @@ const _sfc_main = vue.defineComponent({
|
|
|
437
440
|
_ctx.flex ? (vue.openBlock(), vue.createBlock(vue.unref(webVue.Switch), {
|
|
438
441
|
key: 0,
|
|
439
442
|
modelValue: hasBanner.value,
|
|
440
|
-
"onUpdate:modelValue": _cache[
|
|
443
|
+
"onUpdate:modelValue": _cache[4] || (_cache[4] = ($event) => hasBanner.value = $event),
|
|
441
444
|
style: { "margin-bottom": "10px" },
|
|
442
445
|
size: "small"
|
|
443
446
|
}, null, 8, ["modelValue"])) : vue.createCommentVNode("v-if", true),
|
|
@@ -445,8 +448,10 @@ const _sfc_main = vue.defineComponent({
|
|
|
445
448
|
key: 1,
|
|
446
449
|
id: `banner-card`,
|
|
447
450
|
data: banner.value,
|
|
451
|
+
"onUpdate:data": _cache[5] || (_cache[5] = ($event) => banner.value = $event),
|
|
448
452
|
"preview-list": previewList.value,
|
|
449
453
|
"thumb-model": "banner",
|
|
454
|
+
onUploadLocal: _cache[6] || (_cache[6] = (cb) => _ctx.$emit("upload", cb)),
|
|
450
455
|
onOpen: openDialogMediaSelection
|
|
451
456
|
}, null, 8, ["data", "preview-list"])) : vue.createCommentVNode("v-if", true),
|
|
452
457
|
hasBanner.value && styleData.value.banner_theme_color ? (vue.openBlock(), vue.createElementBlock("div", _hoisted_11, _hoisted_13)) : vue.createCommentVNode("v-if", true),
|
|
@@ -477,8 +482,10 @@ const _sfc_main = vue.defineComponent({
|
|
|
477
482
|
vue.createVNode(card, {
|
|
478
483
|
id: `pc-banner-card`,
|
|
479
484
|
data: pcBanner.value,
|
|
485
|
+
"onUpdate:data": _cache[7] || (_cache[7] = ($event) => pcBanner.value = $event),
|
|
480
486
|
previewList: previewList.value,
|
|
481
487
|
thumbModel: "pcBanner",
|
|
488
|
+
onUploadLocal: _cache[8] || (_cache[8] = (cb) => _ctx.$emit("upload", cb)),
|
|
482
489
|
onOpen: openDialogMediaSelection
|
|
483
490
|
}, null, 8, ["data", "previewList"]),
|
|
484
491
|
_ctx.flex ? (vue.openBlock(), vue.createElementBlock("span", _hoisted_19, "(\u5EFA\u8BAE\u5C3A\u5BF8\uFF1A1242px*662px)")) : vue.createCommentVNode("v-if", true),
|
|
@@ -494,18 +501,18 @@ const _sfc_main = vue.defineComponent({
|
|
|
494
501
|
], 64)) : vue.createCommentVNode("v-if", true),
|
|
495
502
|
vue.createVNode(component, {
|
|
496
503
|
dialogVisible: dialogMediaSelectionShow.value,
|
|
497
|
-
"onUpdate:dialogVisible": _cache[
|
|
504
|
+
"onUpdate:dialogVisible": _cache[9] || (_cache[9] = ($event) => dialogMediaSelectionShow.value = $event),
|
|
498
505
|
preview: false,
|
|
499
506
|
"catalog-props": "image",
|
|
500
507
|
ai_static_covers: _ctx.aiImages,
|
|
501
508
|
BASE_API: vue.unref(BASE_API),
|
|
502
509
|
onSubmit: submitCallback,
|
|
503
|
-
onUpload: _cache[
|
|
510
|
+
onUpload: _cache[10] || (_cache[10] = (cb) => _ctx.$emit("upload", cb))
|
|
504
511
|
}, null, 8, ["dialogVisible", "ai_static_covers", "BASE_API"]),
|
|
505
512
|
refreshCrop.value ? (vue.openBlock(), vue.createBlock(component$1, {
|
|
506
513
|
key: 1,
|
|
507
514
|
visible: dialogCropperShow.value,
|
|
508
|
-
"onUpdate:visible": _cache[
|
|
515
|
+
"onUpdate:visible": _cache[11] || (_cache[11] = ($event) => dialogCropperShow.value = $event),
|
|
509
516
|
"aspect-ratio-prop": aspectRatioProp.value,
|
|
510
517
|
BASE_API: vue.unref(BASE_API),
|
|
511
518
|
"corp-data": cropperData.value,
|
|
@@ -15,9 +15,10 @@ const _sfc_main = vue.defineComponent({
|
|
|
15
15
|
previewList: {},
|
|
16
16
|
thumbModel: {},
|
|
17
17
|
along: { type: Boolean },
|
|
18
|
-
model: {}
|
|
18
|
+
model: {},
|
|
19
|
+
changeThumbModel: { type: Function }
|
|
19
20
|
},
|
|
20
|
-
emits: ["open", "remove"],
|
|
21
|
+
emits: ["open", "remove", "uploadLocal", "update:data"],
|
|
21
22
|
setup(__props, { emit: __emit }) {
|
|
22
23
|
const waterBg = `${config.DEFAULT_BASE_API}/static/images/waterBg.png`;
|
|
23
24
|
const props = __props;
|
|
@@ -30,9 +31,24 @@ const _sfc_main = vue.defineComponent({
|
|
|
30
31
|
[`model-${props.model}`]: ((_a = props.data) == null ? void 0 : _a.url) && props.model
|
|
31
32
|
};
|
|
32
33
|
});
|
|
34
|
+
const btnStyle = vue.computed(() => {
|
|
35
|
+
return {
|
|
36
|
+
padding: "5px 10px",
|
|
37
|
+
cursor: "pointer"
|
|
38
|
+
};
|
|
39
|
+
});
|
|
33
40
|
const clickMask = () => {
|
|
34
41
|
props.along && openDialogMediaSelection();
|
|
35
42
|
};
|
|
43
|
+
const loaclUpload = () => {
|
|
44
|
+
emit("uploadLocal", (file) => {
|
|
45
|
+
const { data } = props;
|
|
46
|
+
if (!data || !file)
|
|
47
|
+
return;
|
|
48
|
+
data.url = file.url;
|
|
49
|
+
emit("update:data", data);
|
|
50
|
+
});
|
|
51
|
+
};
|
|
36
52
|
const openDialogMediaSelection = () => {
|
|
37
53
|
emit("open", props.thumbModel);
|
|
38
54
|
};
|
|
@@ -40,48 +56,67 @@ const _sfc_main = vue.defineComponent({
|
|
|
40
56
|
emit("remove");
|
|
41
57
|
};
|
|
42
58
|
return (_ctx, _cache) => {
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
},
|
|
47
|
-
|
|
48
|
-
vue.
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
59
|
+
return vue.openBlock(), vue.createBlock(vue.unref(webVue.Popover), {
|
|
60
|
+
trigger: "hover",
|
|
61
|
+
"content-style": "padding: 0;"
|
|
62
|
+
}, {
|
|
63
|
+
content: vue.withCtx(() => [
|
|
64
|
+
vue.createElementVNode("div", {
|
|
65
|
+
style: vue.normalizeStyle(btnStyle.value),
|
|
66
|
+
onClick: openDialogMediaSelection
|
|
67
|
+
}, "\u7D20\u6750\u5E93\u9009\u62E9", 4),
|
|
68
|
+
vue.createElementVNode("div", {
|
|
69
|
+
style: vue.normalizeStyle(btnStyle.value),
|
|
70
|
+
onClick: loaclUpload
|
|
71
|
+
}, "\u672C\u5730\u4E0A\u4F20", 4)
|
|
72
|
+
]),
|
|
73
|
+
default: vue.withCtx(() => {
|
|
74
|
+
var _a, _b;
|
|
75
|
+
return [
|
|
76
|
+
vue.createElementVNode("div", {
|
|
77
|
+
class: vue.normalizeClass(["thumb-card-container", classObj.value])
|
|
78
|
+
}, [
|
|
79
|
+
((_a = props.data) == null ? void 0 : _a.url) ? (vue.openBlock(), vue.createElementBlock("div", _hoisted_1, [
|
|
80
|
+
vue.createVNode(vue.unref(webVue.Image), {
|
|
81
|
+
class: "item",
|
|
82
|
+
fit: "cover",
|
|
83
|
+
src: (_b = props.data) == null ? void 0 : _b.url
|
|
84
|
+
}, null, 8, ["src"]),
|
|
85
|
+
vue.createVNode(vue.Transition, { name: "fade" }, {
|
|
86
|
+
default: vue.withCtx(() => [
|
|
87
|
+
vue.createElementVNode("div", {
|
|
88
|
+
class: "mask",
|
|
89
|
+
onClick: clickMask
|
|
90
|
+
}, [
|
|
91
|
+
vue.createElementVNode("span", {
|
|
92
|
+
class: "half",
|
|
93
|
+
onClick: vue.withModifiers(openDialogMediaSelection, ["stop"])
|
|
94
|
+
}, [
|
|
95
|
+
vue.createVNode(vue.unref(icon.IconEdit))
|
|
96
|
+
]),
|
|
97
|
+
_ctx.along ? (vue.openBlock(), vue.createElementBlock("span", {
|
|
98
|
+
key: 0,
|
|
99
|
+
class: "half",
|
|
100
|
+
onClick: vue.withModifiers(remove, ["stop"])
|
|
101
|
+
}, [
|
|
102
|
+
vue.createVNode(vue.unref(icon.IconDelete))
|
|
103
|
+
])) : vue.createCommentVNode("v-if", true)
|
|
104
|
+
])
|
|
105
|
+
]),
|
|
106
|
+
_: 1
|
|
107
|
+
})
|
|
108
|
+
])) : (vue.openBlock(), vue.createElementBlock("div", {
|
|
109
|
+
key: 1,
|
|
110
|
+
class: "item add-thumb",
|
|
111
|
+
style: vue.normalizeStyle({ backgroundImage: `url(${waterBg})` })
|
|
58
112
|
}, [
|
|
59
|
-
vue.
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
key: 0,
|
|
67
|
-
class: "half",
|
|
68
|
-
onClick: vue.withModifiers(remove, ["stop"])
|
|
69
|
-
}, [
|
|
70
|
-
vue.createVNode(vue.unref(icon.IconDelete))
|
|
71
|
-
])) : vue.createCommentVNode("v-if", true)
|
|
72
|
-
])
|
|
73
|
-
]),
|
|
74
|
-
_: 1
|
|
75
|
-
})
|
|
76
|
-
])) : (vue.openBlock(), vue.createElementBlock("div", {
|
|
77
|
-
key: 1,
|
|
78
|
-
class: "item add-thumb",
|
|
79
|
-
style: vue.normalizeStyle({ backgroundImage: `url(${waterBg})` }),
|
|
80
|
-
onClick: vue.withModifiers(openDialogMediaSelection, ["stop"])
|
|
81
|
-
}, [
|
|
82
|
-
vue.createVNode(vue.unref(icon.IconPlus))
|
|
83
|
-
], 4))
|
|
84
|
-
], 2);
|
|
113
|
+
vue.createVNode(vue.unref(icon.IconPlus))
|
|
114
|
+
], 4))
|
|
115
|
+
], 2)
|
|
116
|
+
];
|
|
117
|
+
}),
|
|
118
|
+
_: 1
|
|
119
|
+
});
|
|
85
120
|
};
|
|
86
121
|
}
|
|
87
122
|
});
|
package/lib/style/index.less
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
// Global Style
|
|
1
|
+
// Global Style
|