@cmstops/pro-compo 0.1.43 → 0.1.45
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/imageCrop/component.js +69 -57
- package/es/selectThumb/component.js +14 -3
- package/lib/imageCrop/component.js +67 -55
- package/lib/selectThumb/component.js +13 -2
- package/package.json +1 -1
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { defineComponent, ref, watch,
|
|
2
|
-
import { Modal, Tooltip, Button, Space } from "@arco-design/web-vue";
|
|
1
|
+
import { defineComponent, ref, watch, onBeforeUnmount, openBlock, createBlock, unref, withCtx, createTextVNode, toDisplayString, createElementVNode, createVNode, withDirectives, vShow, normalizeClass, createElementBlock, createCommentVNode, Fragment, renderList } from "vue";
|
|
2
|
+
import { Modal, Tooltip, Button, Space, Spin } from "@arco-design/web-vue";
|
|
3
3
|
import { IconZoomIn, IconZoomOut, IconRotateLeft, IconRotateRight, IconSync } from "@arco-design/web-vue/es/icon";
|
|
4
4
|
import Cropper from "cropperjs";
|
|
5
5
|
import ColorThief from "colorthief";
|
|
@@ -10,22 +10,21 @@ import { DEFAULT_BASE_API } from "../config.js";
|
|
|
10
10
|
import { replaceSuffix } from "../utils/index.js";
|
|
11
11
|
import { getFileRealUrl } from "./script/api.js";
|
|
12
12
|
import { useGenerateAssets } from "../hooks/assets.js";
|
|
13
|
-
const _hoisted_1 = { class: "
|
|
14
|
-
const _hoisted_2 =
|
|
15
|
-
const _hoisted_3 =
|
|
16
|
-
const _hoisted_4 = {
|
|
13
|
+
const _hoisted_1 = { class: "edit-cropper" };
|
|
14
|
+
const _hoisted_2 = ["src"];
|
|
15
|
+
const _hoisted_3 = {
|
|
17
16
|
key: 0,
|
|
18
17
|
class: "tool"
|
|
19
18
|
};
|
|
20
|
-
const
|
|
21
|
-
const
|
|
19
|
+
const _hoisted_4 = ["onClick"];
|
|
20
|
+
const _hoisted_5 = {
|
|
22
21
|
key: 1,
|
|
23
22
|
class: "tool"
|
|
24
23
|
};
|
|
25
|
-
const
|
|
26
|
-
const
|
|
27
|
-
const
|
|
28
|
-
const
|
|
24
|
+
const _hoisted_6 = ["onClick"];
|
|
25
|
+
const _hoisted_7 = { class: "image-crop-modal-footer" };
|
|
26
|
+
const _hoisted_8 = { class: "left" };
|
|
27
|
+
const _hoisted_9 = { class: "right" };
|
|
29
28
|
const _sfc_main = defineComponent({
|
|
30
29
|
__name: "component",
|
|
31
30
|
props: {
|
|
@@ -44,7 +43,6 @@ const _sfc_main = defineComponent({
|
|
|
44
43
|
const saveLoading = ref(false);
|
|
45
44
|
const editImage = ref("");
|
|
46
45
|
const setVisible = (bool) => {
|
|
47
|
-
console.log("--0-", bool);
|
|
48
46
|
emit("update:visible", bool);
|
|
49
47
|
};
|
|
50
48
|
const cancelDialog = () => {
|
|
@@ -65,6 +63,13 @@ const _sfc_main = defineComponent({
|
|
|
65
63
|
const cropperIndex = ref(0);
|
|
66
64
|
const selectedData = ref([]);
|
|
67
65
|
const loadImage = () => {
|
|
66
|
+
const cropperImg = document.getElementById("cropper_img");
|
|
67
|
+
const editCropper = document.querySelector(".edit-cropper");
|
|
68
|
+
cropperImg.classList.remove("position");
|
|
69
|
+
if (cropperImg && editCropper) {
|
|
70
|
+
editCropper.style.width = `${cropperImg.offsetWidth}px`;
|
|
71
|
+
editCropper.style.height = `${cropperImg.offsetHeight}px`;
|
|
72
|
+
}
|
|
68
73
|
};
|
|
69
74
|
const getBase64 = (imgUrl) => {
|
|
70
75
|
window.URL = window.URL || window.webkitURL;
|
|
@@ -305,8 +310,10 @@ const _sfc_main = defineComponent({
|
|
|
305
310
|
}
|
|
306
311
|
getMediaRealUrl();
|
|
307
312
|
};
|
|
313
|
+
onBeforeUnmount(() => {
|
|
314
|
+
cropperDestroy();
|
|
315
|
+
});
|
|
308
316
|
return (_ctx, _cache) => {
|
|
309
|
-
const _directive_loading = resolveDirective("loading");
|
|
310
317
|
return openBlock(), createBlock(unref(Modal), {
|
|
311
318
|
visible: _ctx.visible,
|
|
312
319
|
width: "986px",
|
|
@@ -321,8 +328,8 @@ const _sfc_main = defineComponent({
|
|
|
321
328
|
createTextVNode(toDisplayString(_ctx.aspectRatioProp ? "\u88C1\u526A\u56FE\u7247" : "\u8BF7\u9009\u62E9\u88C1\u526A\u6BD4\u4F8B"), 1)
|
|
322
329
|
]),
|
|
323
330
|
footer: withCtx(() => [
|
|
324
|
-
createElementVNode("span",
|
|
325
|
-
createElementVNode("div",
|
|
331
|
+
createElementVNode("span", _hoisted_7, [
|
|
332
|
+
createElementVNode("div", _hoisted_8, [
|
|
326
333
|
createVNode(unref(Tooltip), { content: "\u653E\u5927" }, {
|
|
327
334
|
default: withCtx(() => [
|
|
328
335
|
createVNode(unref(Button), {
|
|
@@ -399,7 +406,7 @@ const _sfc_main = defineComponent({
|
|
|
399
406
|
_: 1
|
|
400
407
|
})
|
|
401
408
|
]),
|
|
402
|
-
createElementVNode("div",
|
|
409
|
+
createElementVNode("div", _hoisted_9, [
|
|
403
410
|
createVNode(unref(Space), null, {
|
|
404
411
|
default: withCtx(() => [
|
|
405
412
|
createVNode(unref(Button), {
|
|
@@ -431,47 +438,52 @@ const _sfc_main = defineComponent({
|
|
|
431
438
|
])
|
|
432
439
|
]),
|
|
433
440
|
default: withCtx(() => [
|
|
434
|
-
|
|
435
|
-
|
|
436
|
-
|
|
437
|
-
|
|
438
|
-
|
|
439
|
-
|
|
440
|
-
createElementVNode("div",
|
|
441
|
-
|
|
442
|
-
|
|
443
|
-
|
|
444
|
-
|
|
445
|
-
|
|
446
|
-
|
|
447
|
-
|
|
448
|
-
|
|
449
|
-
|
|
450
|
-
|
|
451
|
-
|
|
441
|
+
createVNode(unref(Spin), {
|
|
442
|
+
loading: croppering.value,
|
|
443
|
+
class: "image-cropper",
|
|
444
|
+
style: { "width": "100%" }
|
|
445
|
+
}, {
|
|
446
|
+
default: withCtx(() => [
|
|
447
|
+
createElementVNode("div", {
|
|
448
|
+
class: normalizeClass(["edit", {
|
|
449
|
+
fullHeight: _ctx.aspectRatioProp && !Array.isArray(_ctx.aspectRatioProp)
|
|
450
|
+
}])
|
|
451
|
+
}, [
|
|
452
|
+
createElementVNode("div", _hoisted_1, [
|
|
453
|
+
editImage.value ? (openBlock(), createElementBlock("img", {
|
|
454
|
+
key: 0,
|
|
455
|
+
id: "cropper_img",
|
|
456
|
+
class: "position",
|
|
457
|
+
crossorigin: "anonymous",
|
|
458
|
+
src: editImage.value,
|
|
459
|
+
onLoad: loadImage
|
|
460
|
+
}, null, 40, _hoisted_2)) : createCommentVNode("v-if", true)
|
|
461
|
+
])
|
|
462
|
+
], 2),
|
|
463
|
+
!_ctx.aspectRatioProp ? (openBlock(), createElementBlock("div", _hoisted_3, [
|
|
464
|
+
(openBlock(), createElementBlock(Fragment, null, renderList(aspectRatioList, (item, i) => {
|
|
465
|
+
return createElementVNode("div", {
|
|
466
|
+
key: item.lable,
|
|
467
|
+
class: normalizeClass(["btn btn" + (i + 1), { active: aspectRatioActive.value === i }]),
|
|
468
|
+
onClick: ($event) => cropper(item.value, i)
|
|
469
|
+
}, toDisplayString(item.label), 11, _hoisted_4);
|
|
470
|
+
}), 64))
|
|
471
|
+
])) : createCommentVNode("v-if", true),
|
|
472
|
+
_ctx.aspectRatioProp && Array.isArray(_ctx.aspectRatioProp) && customizedAspectRatioList.value.length > 0 ? (openBlock(), createElementBlock("div", _hoisted_5, [
|
|
473
|
+
(openBlock(true), createElementBlock(Fragment, null, renderList(customizedAspectRatioList.value, (item, i) => {
|
|
474
|
+
return openBlock(), createElementBlock("div", {
|
|
475
|
+
key: item.lable,
|
|
476
|
+
class: normalizeClass([
|
|
477
|
+
"btn btn" + (item.buttonIndex + 1),
|
|
478
|
+
{ active: aspectRatioActive.value === i }
|
|
479
|
+
]),
|
|
480
|
+
onClick: ($event) => cropper(item.value, i)
|
|
481
|
+
}, toDisplayString(item.label), 11, _hoisted_6);
|
|
482
|
+
}), 128))
|
|
483
|
+
])) : createCommentVNode("v-if", true)
|
|
452
484
|
]),
|
|
453
|
-
|
|
454
|
-
|
|
455
|
-
return createElementVNode("div", {
|
|
456
|
-
key: item.lable,
|
|
457
|
-
class: normalizeClass(["btn btn" + (i + 1), { active: aspectRatioActive.value === i }]),
|
|
458
|
-
onClick: ($event) => cropper(item.value, i)
|
|
459
|
-
}, toDisplayString(item.label), 11, _hoisted_5);
|
|
460
|
-
}), 64))
|
|
461
|
-
])) : createCommentVNode("v-if", true),
|
|
462
|
-
_ctx.aspectRatioProp && Array.isArray(_ctx.aspectRatioProp) && customizedAspectRatioList.value.length > 0 ? (openBlock(), createElementBlock("div", _hoisted_6, [
|
|
463
|
-
(openBlock(true), createElementBlock(Fragment, null, renderList(customizedAspectRatioList.value, (item, i) => {
|
|
464
|
-
return openBlock(), createElementBlock("div", {
|
|
465
|
-
key: item.lable,
|
|
466
|
-
class: normalizeClass([
|
|
467
|
-
"btn btn" + (item.buttonIndex + 1),
|
|
468
|
-
{ active: aspectRatioActive.value === i }
|
|
469
|
-
]),
|
|
470
|
-
onClick: ($event) => cropper(item.value, i)
|
|
471
|
-
}, toDisplayString(item.label), 11, _hoisted_7);
|
|
472
|
-
}), 128))
|
|
473
|
-
])) : createCommentVNode("v-if", true)
|
|
474
|
-
])
|
|
485
|
+
_: 1
|
|
486
|
+
}, 8, ["loading"])
|
|
475
487
|
]),
|
|
476
488
|
_: 1
|
|
477
489
|
}, 8, ["visible"]);
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { defineComponent, ref, provide, computed, watch, openBlock, createElementBlock, createTextVNode, toDisplayString, createCommentVNode, Fragment, renderList, createBlock, createVNode, unref, withCtx, createElementVNode, withDirectives, vShow } from "vue";
|
|
1
|
+
import { defineComponent, ref, provide, computed, watch, nextTick, openBlock, createElementBlock, createTextVNode, toDisplayString, createCommentVNode, Fragment, renderList, createBlock, createVNode, unref, withCtx, createElementVNode, withDirectives, vShow } from "vue";
|
|
2
2
|
import { RadioGroup, Radio, Switch } from "@arco-design/web-vue";
|
|
3
3
|
import { docThumbObjMap, docThumbArrMap, docThumbRatioMap } from "../utils/doc.js";
|
|
4
4
|
import _sfc_main$3 from "../resourceModal/component.js";
|
|
@@ -81,6 +81,16 @@ const _sfc_main = defineComponent({
|
|
|
81
81
|
callback(styleData.value);
|
|
82
82
|
}
|
|
83
83
|
});
|
|
84
|
+
const refreshCrop = ref(true);
|
|
85
|
+
watch(
|
|
86
|
+
() => dialogCropperShow.value,
|
|
87
|
+
(n) => {
|
|
88
|
+
if (n)
|
|
89
|
+
return;
|
|
90
|
+
refreshCrop.value = false;
|
|
91
|
+
nextTick(() => refreshCrop.value = true);
|
|
92
|
+
}
|
|
93
|
+
);
|
|
84
94
|
const loadData = (value) => {
|
|
85
95
|
let data = null;
|
|
86
96
|
if (!value) {
|
|
@@ -414,7 +424,8 @@ const _sfc_main = defineComponent({
|
|
|
414
424
|
onSubmit: submitCallback,
|
|
415
425
|
onUpload: _cache[3] || (_cache[3] = (cb) => _ctx.$emit("upload", cb))
|
|
416
426
|
}, null, 8, ["dialogVisible", "ai_static_covers", "BASE_API"]),
|
|
417
|
-
|
|
427
|
+
refreshCrop.value ? (openBlock(), createBlock(_sfc_main$4, {
|
|
428
|
+
key: 3,
|
|
418
429
|
visible: dialogCropperShow.value,
|
|
419
430
|
"onUpdate:visible": _cache[4] || (_cache[4] = ($event) => dialogCropperShow.value = $event),
|
|
420
431
|
"aspect-ratio-prop": aspectRatioProp.value,
|
|
@@ -422,7 +433,7 @@ const _sfc_main = defineComponent({
|
|
|
422
433
|
"corp-data": cropperData.value,
|
|
423
434
|
"generate-assets": false,
|
|
424
435
|
onConfirm: cropConfirm
|
|
425
|
-
}, null, 8, ["visible", "aspect-ratio-prop", "BASE_API", "corp-data"])
|
|
436
|
+
}, null, 8, ["visible", "aspect-ratio-prop", "BASE_API", "corp-data"])) : createCommentVNode("v-if", true)
|
|
426
437
|
]);
|
|
427
438
|
};
|
|
428
439
|
}
|
|
@@ -17,22 +17,21 @@ function _interopDefaultLegacy(e) {
|
|
|
17
17
|
var Cropper__default = /* @__PURE__ */ _interopDefaultLegacy(Cropper);
|
|
18
18
|
var ColorThief__default = /* @__PURE__ */ _interopDefaultLegacy(ColorThief);
|
|
19
19
|
var GIF__default = /* @__PURE__ */ _interopDefaultLegacy(GIF);
|
|
20
|
-
const _hoisted_1 = { class: "
|
|
21
|
-
const _hoisted_2 =
|
|
22
|
-
const _hoisted_3 =
|
|
23
|
-
const _hoisted_4 = {
|
|
20
|
+
const _hoisted_1 = { class: "edit-cropper" };
|
|
21
|
+
const _hoisted_2 = ["src"];
|
|
22
|
+
const _hoisted_3 = {
|
|
24
23
|
key: 0,
|
|
25
24
|
class: "tool"
|
|
26
25
|
};
|
|
27
|
-
const
|
|
28
|
-
const
|
|
26
|
+
const _hoisted_4 = ["onClick"];
|
|
27
|
+
const _hoisted_5 = {
|
|
29
28
|
key: 1,
|
|
30
29
|
class: "tool"
|
|
31
30
|
};
|
|
32
|
-
const
|
|
33
|
-
const
|
|
34
|
-
const
|
|
35
|
-
const
|
|
31
|
+
const _hoisted_6 = ["onClick"];
|
|
32
|
+
const _hoisted_7 = { class: "image-crop-modal-footer" };
|
|
33
|
+
const _hoisted_8 = { class: "left" };
|
|
34
|
+
const _hoisted_9 = { class: "right" };
|
|
36
35
|
const _sfc_main = vue.defineComponent({
|
|
37
36
|
__name: "component",
|
|
38
37
|
props: {
|
|
@@ -51,7 +50,6 @@ const _sfc_main = vue.defineComponent({
|
|
|
51
50
|
const saveLoading = vue.ref(false);
|
|
52
51
|
const editImage = vue.ref("");
|
|
53
52
|
const setVisible = (bool) => {
|
|
54
|
-
console.log("--0-", bool);
|
|
55
53
|
emit("update:visible", bool);
|
|
56
54
|
};
|
|
57
55
|
const cancelDialog = () => {
|
|
@@ -72,6 +70,13 @@ const _sfc_main = vue.defineComponent({
|
|
|
72
70
|
const cropperIndex = vue.ref(0);
|
|
73
71
|
const selectedData = vue.ref([]);
|
|
74
72
|
const loadImage = () => {
|
|
73
|
+
const cropperImg = document.getElementById("cropper_img");
|
|
74
|
+
const editCropper = document.querySelector(".edit-cropper");
|
|
75
|
+
cropperImg.classList.remove("position");
|
|
76
|
+
if (cropperImg && editCropper) {
|
|
77
|
+
editCropper.style.width = `${cropperImg.offsetWidth}px`;
|
|
78
|
+
editCropper.style.height = `${cropperImg.offsetHeight}px`;
|
|
79
|
+
}
|
|
75
80
|
};
|
|
76
81
|
const getBase64 = (imgUrl) => {
|
|
77
82
|
window.URL = window.URL || window.webkitURL;
|
|
@@ -312,8 +317,10 @@ const _sfc_main = vue.defineComponent({
|
|
|
312
317
|
}
|
|
313
318
|
getMediaRealUrl();
|
|
314
319
|
};
|
|
320
|
+
vue.onBeforeUnmount(() => {
|
|
321
|
+
cropperDestroy();
|
|
322
|
+
});
|
|
315
323
|
return (_ctx, _cache) => {
|
|
316
|
-
const _directive_loading = vue.resolveDirective("loading");
|
|
317
324
|
return vue.openBlock(), vue.createBlock(vue.unref(webVue.Modal), {
|
|
318
325
|
visible: _ctx.visible,
|
|
319
326
|
width: "986px",
|
|
@@ -328,8 +335,8 @@ const _sfc_main = vue.defineComponent({
|
|
|
328
335
|
vue.createTextVNode(vue.toDisplayString(_ctx.aspectRatioProp ? "\u88C1\u526A\u56FE\u7247" : "\u8BF7\u9009\u62E9\u88C1\u526A\u6BD4\u4F8B"), 1)
|
|
329
336
|
]),
|
|
330
337
|
footer: vue.withCtx(() => [
|
|
331
|
-
vue.createElementVNode("span",
|
|
332
|
-
vue.createElementVNode("div",
|
|
338
|
+
vue.createElementVNode("span", _hoisted_7, [
|
|
339
|
+
vue.createElementVNode("div", _hoisted_8, [
|
|
333
340
|
vue.createVNode(vue.unref(webVue.Tooltip), { content: "\u653E\u5927" }, {
|
|
334
341
|
default: vue.withCtx(() => [
|
|
335
342
|
vue.createVNode(vue.unref(webVue.Button), {
|
|
@@ -406,7 +413,7 @@ const _sfc_main = vue.defineComponent({
|
|
|
406
413
|
_: 1
|
|
407
414
|
})
|
|
408
415
|
]),
|
|
409
|
-
vue.createElementVNode("div",
|
|
416
|
+
vue.createElementVNode("div", _hoisted_9, [
|
|
410
417
|
vue.createVNode(vue.unref(webVue.Space), null, {
|
|
411
418
|
default: vue.withCtx(() => [
|
|
412
419
|
vue.createVNode(vue.unref(webVue.Button), {
|
|
@@ -438,47 +445,52 @@ const _sfc_main = vue.defineComponent({
|
|
|
438
445
|
])
|
|
439
446
|
]),
|
|
440
447
|
default: vue.withCtx(() => [
|
|
441
|
-
vue.
|
|
442
|
-
|
|
443
|
-
|
|
444
|
-
|
|
445
|
-
|
|
446
|
-
|
|
447
|
-
vue.createElementVNode("div",
|
|
448
|
-
|
|
449
|
-
|
|
450
|
-
|
|
451
|
-
|
|
452
|
-
|
|
453
|
-
|
|
454
|
-
|
|
455
|
-
|
|
456
|
-
|
|
457
|
-
|
|
458
|
-
|
|
448
|
+
vue.createVNode(vue.unref(webVue.Spin), {
|
|
449
|
+
loading: croppering.value,
|
|
450
|
+
class: "image-cropper",
|
|
451
|
+
style: { "width": "100%" }
|
|
452
|
+
}, {
|
|
453
|
+
default: vue.withCtx(() => [
|
|
454
|
+
vue.createElementVNode("div", {
|
|
455
|
+
class: vue.normalizeClass(["edit", {
|
|
456
|
+
fullHeight: _ctx.aspectRatioProp && !Array.isArray(_ctx.aspectRatioProp)
|
|
457
|
+
}])
|
|
458
|
+
}, [
|
|
459
|
+
vue.createElementVNode("div", _hoisted_1, [
|
|
460
|
+
editImage.value ? (vue.openBlock(), vue.createElementBlock("img", {
|
|
461
|
+
key: 0,
|
|
462
|
+
id: "cropper_img",
|
|
463
|
+
class: "position",
|
|
464
|
+
crossorigin: "anonymous",
|
|
465
|
+
src: editImage.value,
|
|
466
|
+
onLoad: loadImage
|
|
467
|
+
}, null, 40, _hoisted_2)) : vue.createCommentVNode("v-if", true)
|
|
468
|
+
])
|
|
469
|
+
], 2),
|
|
470
|
+
!_ctx.aspectRatioProp ? (vue.openBlock(), vue.createElementBlock("div", _hoisted_3, [
|
|
471
|
+
(vue.openBlock(), vue.createElementBlock(vue.Fragment, null, vue.renderList(aspectRatioList, (item, i) => {
|
|
472
|
+
return vue.createElementVNode("div", {
|
|
473
|
+
key: item.lable,
|
|
474
|
+
class: vue.normalizeClass(["btn btn" + (i + 1), { active: aspectRatioActive.value === i }]),
|
|
475
|
+
onClick: ($event) => cropper(item.value, i)
|
|
476
|
+
}, vue.toDisplayString(item.label), 11, _hoisted_4);
|
|
477
|
+
}), 64))
|
|
478
|
+
])) : vue.createCommentVNode("v-if", true),
|
|
479
|
+
_ctx.aspectRatioProp && Array.isArray(_ctx.aspectRatioProp) && customizedAspectRatioList.value.length > 0 ? (vue.openBlock(), vue.createElementBlock("div", _hoisted_5, [
|
|
480
|
+
(vue.openBlock(true), vue.createElementBlock(vue.Fragment, null, vue.renderList(customizedAspectRatioList.value, (item, i) => {
|
|
481
|
+
return vue.openBlock(), vue.createElementBlock("div", {
|
|
482
|
+
key: item.lable,
|
|
483
|
+
class: vue.normalizeClass([
|
|
484
|
+
"btn btn" + (item.buttonIndex + 1),
|
|
485
|
+
{ active: aspectRatioActive.value === i }
|
|
486
|
+
]),
|
|
487
|
+
onClick: ($event) => cropper(item.value, i)
|
|
488
|
+
}, vue.toDisplayString(item.label), 11, _hoisted_6);
|
|
489
|
+
}), 128))
|
|
490
|
+
])) : vue.createCommentVNode("v-if", true)
|
|
459
491
|
]),
|
|
460
|
-
|
|
461
|
-
|
|
462
|
-
return vue.createElementVNode("div", {
|
|
463
|
-
key: item.lable,
|
|
464
|
-
class: vue.normalizeClass(["btn btn" + (i + 1), { active: aspectRatioActive.value === i }]),
|
|
465
|
-
onClick: ($event) => cropper(item.value, i)
|
|
466
|
-
}, vue.toDisplayString(item.label), 11, _hoisted_5);
|
|
467
|
-
}), 64))
|
|
468
|
-
])) : vue.createCommentVNode("v-if", true),
|
|
469
|
-
_ctx.aspectRatioProp && Array.isArray(_ctx.aspectRatioProp) && customizedAspectRatioList.value.length > 0 ? (vue.openBlock(), vue.createElementBlock("div", _hoisted_6, [
|
|
470
|
-
(vue.openBlock(true), vue.createElementBlock(vue.Fragment, null, vue.renderList(customizedAspectRatioList.value, (item, i) => {
|
|
471
|
-
return vue.openBlock(), vue.createElementBlock("div", {
|
|
472
|
-
key: item.lable,
|
|
473
|
-
class: vue.normalizeClass([
|
|
474
|
-
"btn btn" + (item.buttonIndex + 1),
|
|
475
|
-
{ active: aspectRatioActive.value === i }
|
|
476
|
-
]),
|
|
477
|
-
onClick: ($event) => cropper(item.value, i)
|
|
478
|
-
}, vue.toDisplayString(item.label), 11, _hoisted_7);
|
|
479
|
-
}), 128))
|
|
480
|
-
])) : vue.createCommentVNode("v-if", true)
|
|
481
|
-
])
|
|
492
|
+
_: 1
|
|
493
|
+
}, 8, ["loading"])
|
|
482
494
|
]),
|
|
483
495
|
_: 1
|
|
484
496
|
}, 8, ["visible"]);
|
|
@@ -82,6 +82,16 @@ const _sfc_main = vue.defineComponent({
|
|
|
82
82
|
callback(styleData.value);
|
|
83
83
|
}
|
|
84
84
|
});
|
|
85
|
+
const refreshCrop = vue.ref(true);
|
|
86
|
+
vue.watch(
|
|
87
|
+
() => dialogCropperShow.value,
|
|
88
|
+
(n) => {
|
|
89
|
+
if (n)
|
|
90
|
+
return;
|
|
91
|
+
refreshCrop.value = false;
|
|
92
|
+
vue.nextTick(() => refreshCrop.value = true);
|
|
93
|
+
}
|
|
94
|
+
);
|
|
85
95
|
const loadData = (value) => {
|
|
86
96
|
let data = null;
|
|
87
97
|
if (!value) {
|
|
@@ -415,7 +425,8 @@ const _sfc_main = vue.defineComponent({
|
|
|
415
425
|
onSubmit: submitCallback,
|
|
416
426
|
onUpload: _cache[3] || (_cache[3] = (cb) => _ctx.$emit("upload", cb))
|
|
417
427
|
}, null, 8, ["dialogVisible", "ai_static_covers", "BASE_API"]),
|
|
418
|
-
vue.
|
|
428
|
+
refreshCrop.value ? (vue.openBlock(), vue.createBlock(component$1, {
|
|
429
|
+
key: 3,
|
|
419
430
|
visible: dialogCropperShow.value,
|
|
420
431
|
"onUpdate:visible": _cache[4] || (_cache[4] = ($event) => dialogCropperShow.value = $event),
|
|
421
432
|
"aspect-ratio-prop": aspectRatioProp.value,
|
|
@@ -423,7 +434,7 @@ const _sfc_main = vue.defineComponent({
|
|
|
423
434
|
"corp-data": cropperData.value,
|
|
424
435
|
"generate-assets": false,
|
|
425
436
|
onConfirm: cropConfirm
|
|
426
|
-
}, null, 8, ["visible", "aspect-ratio-prop", "BASE_API", "corp-data"])
|
|
437
|
+
}, null, 8, ["visible", "aspect-ratio-prop", "BASE_API", "corp-data"])) : vue.createCommentVNode("v-if", true)
|
|
427
438
|
]);
|
|
428
439
|
};
|
|
429
440
|
}
|