@cmstops/pro-compo 0.1.42 → 0.1.44

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.
@@ -1,9 +1,9 @@
1
1
  import { defineComponent, ref, openBlock, createElementBlock, createVNode, unref, withCtx, createElementVNode } from "vue";
2
- import { Modal, Scrollbar } from "@arco-design/web-vue";
2
+ import { Modal, Spin, Scrollbar } from "@arco-design/web-vue";
3
3
  import { getDocDetailsNew } from "./script/api.js";
4
- import _sfc_main$1 from "./components/metaInfoForm.js";
5
4
  import useDialogVisible from "../hooks/dialogVisible.js";
6
5
  import { DEFAULT_BASE_API } from "../config.js";
6
+ import _sfc_main$1 from "./components/metaInfoForm.js";
7
7
  const _hoisted_1 = { class: "edit-meta-info-container" };
8
8
  const _hoisted_2 = { style: { "padding": "20px" } };
9
9
  const _sfc_main = defineComponent({
@@ -19,14 +19,17 @@ const _sfc_main = defineComponent({
19
19
  const emit = __emit;
20
20
  const props = __props;
21
21
  const metaInfoFormRef = ref();
22
+ const isLoading = ref(false);
22
23
  const editorDataPubInfo = ref(null);
23
24
  const BASE_API = props.BASE_API || DEFAULT_BASE_API;
24
25
  const handleOpen = async () => {
25
26
  if (props.hashId) {
27
+ isLoading.value = true;
26
28
  const { code, message } = await getDocDetailsNew(BASE_API, {
27
29
  hashid: props.hashId
28
30
  });
29
31
  if (code === 0) {
32
+ isLoading.value = false;
30
33
  editorDataPubInfo.value = {
31
34
  id: message.id,
32
35
  title: message.title,
@@ -62,23 +65,31 @@ const _sfc_main = defineComponent({
62
65
  onCancel: handleCancel
63
66
  }, {
64
67
  default: withCtx(() => [
65
- createVNode(unref(Scrollbar), {
66
- "outer-style": "height: 60vh; overflow: auto",
67
- style: { "height": "100%", "overflow": "auto" }
68
+ createVNode(unref(Spin), {
69
+ loading: isLoading.value,
70
+ style: { "width": "100%" }
68
71
  }, {
69
72
  default: withCtx(() => [
70
- createElementVNode("div", _hoisted_2, [
71
- createVNode(_sfc_main$1, {
72
- ref_key: "metaInfoFormRef",
73
- ref: metaInfoFormRef,
74
- BASE_API: unref(BASE_API),
75
- "init-data": editorDataPubInfo.value,
76
- onUpload: _cache[0] || (_cache[0] = (e) => _ctx.$emit("upload", e))
77
- }, null, 8, ["BASE_API", "init-data"])
78
- ])
73
+ createVNode(unref(Scrollbar), {
74
+ "outer-style": "height: 60vh; overflow: auto",
75
+ style: { "height": "100%", "overflow": "auto" }
76
+ }, {
77
+ default: withCtx(() => [
78
+ createElementVNode("div", _hoisted_2, [
79
+ createVNode(_sfc_main$1, {
80
+ ref_key: "metaInfoFormRef",
81
+ ref: metaInfoFormRef,
82
+ BASE_API: unref(BASE_API),
83
+ "init-data": editorDataPubInfo.value,
84
+ onUpload: _cache[0] || (_cache[0] = (e) => _ctx.$emit("upload", e))
85
+ }, null, 8, ["BASE_API", "init-data"])
86
+ ])
87
+ ]),
88
+ _: 1
89
+ })
79
90
  ]),
80
91
  _: 1
81
- })
92
+ }, 8, ["loading"])
82
93
  ]),
83
94
  _: 1
84
95
  }, 8, ["visible"])
@@ -1,5 +1,5 @@
1
- import { defineComponent, ref, watch, resolveDirective, openBlock, createBlock, unref, withCtx, createTextVNode, toDisplayString, createElementVNode, createVNode, withDirectives, vShow, createElementBlock, normalizeClass, createCommentVNode, Fragment, renderList } from "vue";
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: "image-cropper" };
14
- const _hoisted_2 = { class: "edit-cropper" };
15
- const _hoisted_3 = ["src"];
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 _hoisted_5 = ["onClick"];
21
- const _hoisted_6 = {
19
+ const _hoisted_4 = ["onClick"];
20
+ const _hoisted_5 = {
22
21
  key: 1,
23
22
  class: "tool"
24
23
  };
25
- const _hoisted_7 = ["onClick"];
26
- const _hoisted_8 = { class: "image-crop-modal-footer" };
27
- const _hoisted_9 = { class: "left" };
28
- const _hoisted_10 = { class: "right" };
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: {
@@ -64,6 +63,13 @@ const _sfc_main = defineComponent({
64
63
  const cropperIndex = ref(0);
65
64
  const selectedData = ref([]);
66
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
+ }
67
73
  };
68
74
  const getBase64 = (imgUrl) => {
69
75
  window.URL = window.URL || window.webkitURL;
@@ -304,8 +310,10 @@ const _sfc_main = defineComponent({
304
310
  }
305
311
  getMediaRealUrl();
306
312
  };
313
+ onBeforeUnmount(() => {
314
+ cropperDestroy();
315
+ });
307
316
  return (_ctx, _cache) => {
308
- const _directive_loading = resolveDirective("loading");
309
317
  return openBlock(), createBlock(unref(Modal), {
310
318
  visible: _ctx.visible,
311
319
  width: "986px",
@@ -313,14 +321,15 @@ const _sfc_main = defineComponent({
313
321
  "title-align": "center",
314
322
  "unmount-on-close": "",
315
323
  "modal-class": "image-crop-modal-wrapper",
316
- "body-class": "image-crop-modal-body"
324
+ "body-class": "image-crop-modal-body",
325
+ onCancel: _cache[4] || (_cache[4] = ($event) => setVisible(false))
317
326
  }, {
318
327
  title: withCtx(() => [
319
328
  createTextVNode(toDisplayString(_ctx.aspectRatioProp ? "\u88C1\u526A\u56FE\u7247" : "\u8BF7\u9009\u62E9\u88C1\u526A\u6BD4\u4F8B"), 1)
320
329
  ]),
321
330
  footer: withCtx(() => [
322
- createElementVNode("span", _hoisted_8, [
323
- createElementVNode("div", _hoisted_9, [
331
+ createElementVNode("span", _hoisted_7, [
332
+ createElementVNode("div", _hoisted_8, [
324
333
  createVNode(unref(Tooltip), { content: "\u653E\u5927" }, {
325
334
  default: withCtx(() => [
326
335
  createVNode(unref(Button), {
@@ -397,7 +406,7 @@ const _sfc_main = defineComponent({
397
406
  _: 1
398
407
  })
399
408
  ]),
400
- createElementVNode("div", _hoisted_10, [
409
+ createElementVNode("div", _hoisted_9, [
401
410
  createVNode(unref(Space), null, {
402
411
  default: withCtx(() => [
403
412
  createVNode(unref(Button), {
@@ -429,47 +438,52 @@ const _sfc_main = defineComponent({
429
438
  ])
430
439
  ]),
431
440
  default: withCtx(() => [
432
- createElementVNode("div", _hoisted_1, [
433
- withDirectives((openBlock(), createElementBlock("div", {
434
- class: normalizeClass(["edit", {
435
- fullHeight: _ctx.aspectRatioProp && !Array.isArray(_ctx.aspectRatioProp)
436
- }])
437
- }, [
438
- createElementVNode("div", _hoisted_2, [
439
- editImage.value ? (openBlock(), createElementBlock("img", {
440
- key: 0,
441
- id: "cropper_img",
442
- class: "position",
443
- crossorigin: "anonymous",
444
- src: editImage.value,
445
- onLoad: loadImage
446
- }, null, 40, _hoisted_3)) : createCommentVNode("v-if", true)
447
- ])
448
- ], 2)), [
449
- [_directive_loading, croppering.value]
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)
450
484
  ]),
451
- !_ctx.aspectRatioProp ? (openBlock(), createElementBlock("div", _hoisted_4, [
452
- (openBlock(), createElementBlock(Fragment, null, renderList(aspectRatioList, (item, i) => {
453
- return createElementVNode("div", {
454
- key: item.lable,
455
- class: normalizeClass(["btn btn" + (i + 1), { active: aspectRatioActive.value === i }]),
456
- onClick: ($event) => cropper(item.value, i)
457
- }, toDisplayString(item.label), 11, _hoisted_5);
458
- }), 64))
459
- ])) : createCommentVNode("v-if", true),
460
- _ctx.aspectRatioProp && Array.isArray(_ctx.aspectRatioProp) && customizedAspectRatioList.value.length > 0 ? (openBlock(), createElementBlock("div", _hoisted_6, [
461
- (openBlock(true), createElementBlock(Fragment, null, renderList(customizedAspectRatioList.value, (item, i) => {
462
- return openBlock(), createElementBlock("div", {
463
- key: item.lable,
464
- class: normalizeClass([
465
- "btn btn" + (item.buttonIndex + 1),
466
- { active: aspectRatioActive.value === i }
467
- ]),
468
- onClick: ($event) => cropper(item.value, i)
469
- }, toDisplayString(item.label), 11, _hoisted_7);
470
- }), 128))
471
- ])) : createCommentVNode("v-if", true)
472
- ])
485
+ _: 1
486
+ }, 8, ["loading"])
473
487
  ]),
474
488
  _: 1
475
489
  }, 8, ["visible"]);
@@ -60,7 +60,7 @@ const _sfc_main = defineComponent({
60
60
  onCancel: handleCancel
61
61
  }, {
62
62
  title: withCtx(() => [
63
- createTextVNode("\u9009\u62E9\u5C01\u9762\u6765\u6E90")
63
+ createTextVNode("\u9009\u62E9\u7D20\u6750\u6765\u6E90")
64
64
  ]),
65
65
  default: withCtx(() => [
66
66
  createVNode(_sfc_main$1, {
@@ -1,5 +1,6 @@
1
1
  import { defineComponent, ref, provide, computed, watch, 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
+ import { nextTick } from "process";
3
4
  import { docThumbObjMap, docThumbArrMap, docThumbRatioMap } from "../utils/doc.js";
4
5
  import _sfc_main$3 from "../resourceModal/component.js";
5
6
  import _sfc_main$4 from "../imageCrop/component.js";
@@ -81,6 +82,16 @@ const _sfc_main = defineComponent({
81
82
  callback(styleData.value);
82
83
  }
83
84
  });
85
+ const refreshCrop = ref(true);
86
+ watch(
87
+ () => dialogCropperShow.value,
88
+ (n) => {
89
+ if (n)
90
+ return;
91
+ refreshCrop.value = false;
92
+ nextTick(() => refreshCrop.value = true);
93
+ }
94
+ );
84
95
  const loadData = (value) => {
85
96
  let data = null;
86
97
  if (!value) {
@@ -414,7 +425,8 @@ const _sfc_main = defineComponent({
414
425
  onSubmit: submitCallback,
415
426
  onUpload: _cache[3] || (_cache[3] = (cb) => _ctx.$emit("upload", cb))
416
427
  }, null, 8, ["dialogVisible", "ai_static_covers", "BASE_API"]),
417
- createVNode(_sfc_main$4, {
428
+ refreshCrop.value ? (openBlock(), createBlock(_sfc_main$4, {
429
+ key: 3,
418
430
  visible: dialogCropperShow.value,
419
431
  "onUpdate:visible": _cache[4] || (_cache[4] = ($event) => dialogCropperShow.value = $event),
420
432
  "aspect-ratio-prop": aspectRatioProp.value,
@@ -422,7 +434,7 @@ const _sfc_main = defineComponent({
422
434
  "corp-data": cropperData.value,
423
435
  "generate-assets": false,
424
436
  onConfirm: cropConfirm
425
- }, null, 8, ["visible", "aspect-ratio-prop", "BASE_API", "corp-data"])
437
+ }, null, 8, ["visible", "aspect-ratio-prop", "BASE_API", "corp-data"])) : createCommentVNode("v-if", true)
426
438
  ]);
427
439
  };
428
440
  }
@@ -2,9 +2,9 @@
2
2
  var vue = require("vue");
3
3
  var webVue = require("@arco-design/web-vue");
4
4
  var api = require("./script/api.js");
5
- var metaInfoForm = require("./components/metaInfoForm.js");
6
5
  var dialogVisible = require("../hooks/dialogVisible.js");
7
6
  var config = require("../config.js");
7
+ var metaInfoForm = require("./components/metaInfoForm.js");
8
8
  const _hoisted_1 = { class: "edit-meta-info-container" };
9
9
  const _hoisted_2 = { style: { "padding": "20px" } };
10
10
  const _sfc_main = vue.defineComponent({
@@ -20,14 +20,17 @@ const _sfc_main = vue.defineComponent({
20
20
  const emit = __emit;
21
21
  const props = __props;
22
22
  const metaInfoFormRef = vue.ref();
23
+ const isLoading = vue.ref(false);
23
24
  const editorDataPubInfo = vue.ref(null);
24
25
  const BASE_API = props.BASE_API || config.DEFAULT_BASE_API;
25
26
  const handleOpen = async () => {
26
27
  if (props.hashId) {
28
+ isLoading.value = true;
27
29
  const { code, message } = await api.getDocDetailsNew(BASE_API, {
28
30
  hashid: props.hashId
29
31
  });
30
32
  if (code === 0) {
33
+ isLoading.value = false;
31
34
  editorDataPubInfo.value = {
32
35
  id: message.id,
33
36
  title: message.title,
@@ -63,23 +66,31 @@ const _sfc_main = vue.defineComponent({
63
66
  onCancel: handleCancel
64
67
  }, {
65
68
  default: vue.withCtx(() => [
66
- vue.createVNode(vue.unref(webVue.Scrollbar), {
67
- "outer-style": "height: 60vh; overflow: auto",
68
- style: { "height": "100%", "overflow": "auto" }
69
+ vue.createVNode(vue.unref(webVue.Spin), {
70
+ loading: isLoading.value,
71
+ style: { "width": "100%" }
69
72
  }, {
70
73
  default: vue.withCtx(() => [
71
- vue.createElementVNode("div", _hoisted_2, [
72
- vue.createVNode(metaInfoForm, {
73
- ref_key: "metaInfoFormRef",
74
- ref: metaInfoFormRef,
75
- BASE_API: vue.unref(BASE_API),
76
- "init-data": editorDataPubInfo.value,
77
- onUpload: _cache[0] || (_cache[0] = (e) => _ctx.$emit("upload", e))
78
- }, null, 8, ["BASE_API", "init-data"])
79
- ])
74
+ vue.createVNode(vue.unref(webVue.Scrollbar), {
75
+ "outer-style": "height: 60vh; overflow: auto",
76
+ style: { "height": "100%", "overflow": "auto" }
77
+ }, {
78
+ default: vue.withCtx(() => [
79
+ vue.createElementVNode("div", _hoisted_2, [
80
+ vue.createVNode(metaInfoForm, {
81
+ ref_key: "metaInfoFormRef",
82
+ ref: metaInfoFormRef,
83
+ BASE_API: vue.unref(BASE_API),
84
+ "init-data": editorDataPubInfo.value,
85
+ onUpload: _cache[0] || (_cache[0] = (e) => _ctx.$emit("upload", e))
86
+ }, null, 8, ["BASE_API", "init-data"])
87
+ ])
88
+ ]),
89
+ _: 1
90
+ })
80
91
  ]),
81
92
  _: 1
82
- })
93
+ }, 8, ["loading"])
83
94
  ]),
84
95
  _: 1
85
96
  }, 8, ["visible"])
@@ -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: "image-cropper" };
21
- const _hoisted_2 = { class: "edit-cropper" };
22
- const _hoisted_3 = ["src"];
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 _hoisted_5 = ["onClick"];
28
- const _hoisted_6 = {
26
+ const _hoisted_4 = ["onClick"];
27
+ const _hoisted_5 = {
29
28
  key: 1,
30
29
  class: "tool"
31
30
  };
32
- const _hoisted_7 = ["onClick"];
33
- const _hoisted_8 = { class: "image-crop-modal-footer" };
34
- const _hoisted_9 = { class: "left" };
35
- const _hoisted_10 = { class: "right" };
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: {
@@ -71,6 +70,13 @@ const _sfc_main = vue.defineComponent({
71
70
  const cropperIndex = vue.ref(0);
72
71
  const selectedData = vue.ref([]);
73
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
+ }
74
80
  };
75
81
  const getBase64 = (imgUrl) => {
76
82
  window.URL = window.URL || window.webkitURL;
@@ -311,8 +317,10 @@ const _sfc_main = vue.defineComponent({
311
317
  }
312
318
  getMediaRealUrl();
313
319
  };
320
+ vue.onBeforeUnmount(() => {
321
+ cropperDestroy();
322
+ });
314
323
  return (_ctx, _cache) => {
315
- const _directive_loading = vue.resolveDirective("loading");
316
324
  return vue.openBlock(), vue.createBlock(vue.unref(webVue.Modal), {
317
325
  visible: _ctx.visible,
318
326
  width: "986px",
@@ -320,14 +328,15 @@ const _sfc_main = vue.defineComponent({
320
328
  "title-align": "center",
321
329
  "unmount-on-close": "",
322
330
  "modal-class": "image-crop-modal-wrapper",
323
- "body-class": "image-crop-modal-body"
331
+ "body-class": "image-crop-modal-body",
332
+ onCancel: _cache[4] || (_cache[4] = ($event) => setVisible(false))
324
333
  }, {
325
334
  title: vue.withCtx(() => [
326
335
  vue.createTextVNode(vue.toDisplayString(_ctx.aspectRatioProp ? "\u88C1\u526A\u56FE\u7247" : "\u8BF7\u9009\u62E9\u88C1\u526A\u6BD4\u4F8B"), 1)
327
336
  ]),
328
337
  footer: vue.withCtx(() => [
329
- vue.createElementVNode("span", _hoisted_8, [
330
- vue.createElementVNode("div", _hoisted_9, [
338
+ vue.createElementVNode("span", _hoisted_7, [
339
+ vue.createElementVNode("div", _hoisted_8, [
331
340
  vue.createVNode(vue.unref(webVue.Tooltip), { content: "\u653E\u5927" }, {
332
341
  default: vue.withCtx(() => [
333
342
  vue.createVNode(vue.unref(webVue.Button), {
@@ -404,7 +413,7 @@ const _sfc_main = vue.defineComponent({
404
413
  _: 1
405
414
  })
406
415
  ]),
407
- vue.createElementVNode("div", _hoisted_10, [
416
+ vue.createElementVNode("div", _hoisted_9, [
408
417
  vue.createVNode(vue.unref(webVue.Space), null, {
409
418
  default: vue.withCtx(() => [
410
419
  vue.createVNode(vue.unref(webVue.Button), {
@@ -436,47 +445,52 @@ const _sfc_main = vue.defineComponent({
436
445
  ])
437
446
  ]),
438
447
  default: vue.withCtx(() => [
439
- vue.createElementVNode("div", _hoisted_1, [
440
- vue.withDirectives((vue.openBlock(), vue.createElementBlock("div", {
441
- class: vue.normalizeClass(["edit", {
442
- fullHeight: _ctx.aspectRatioProp && !Array.isArray(_ctx.aspectRatioProp)
443
- }])
444
- }, [
445
- vue.createElementVNode("div", _hoisted_2, [
446
- editImage.value ? (vue.openBlock(), vue.createElementBlock("img", {
447
- key: 0,
448
- id: "cropper_img",
449
- class: "position",
450
- crossorigin: "anonymous",
451
- src: editImage.value,
452
- onLoad: loadImage
453
- }, null, 40, _hoisted_3)) : vue.createCommentVNode("v-if", true)
454
- ])
455
- ], 2)), [
456
- [_directive_loading, croppering.value]
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)
457
491
  ]),
458
- !_ctx.aspectRatioProp ? (vue.openBlock(), vue.createElementBlock("div", _hoisted_4, [
459
- (vue.openBlock(), vue.createElementBlock(vue.Fragment, null, vue.renderList(aspectRatioList, (item, i) => {
460
- return vue.createElementVNode("div", {
461
- key: item.lable,
462
- class: vue.normalizeClass(["btn btn" + (i + 1), { active: aspectRatioActive.value === i }]),
463
- onClick: ($event) => cropper(item.value, i)
464
- }, vue.toDisplayString(item.label), 11, _hoisted_5);
465
- }), 64))
466
- ])) : vue.createCommentVNode("v-if", true),
467
- _ctx.aspectRatioProp && Array.isArray(_ctx.aspectRatioProp) && customizedAspectRatioList.value.length > 0 ? (vue.openBlock(), vue.createElementBlock("div", _hoisted_6, [
468
- (vue.openBlock(true), vue.createElementBlock(vue.Fragment, null, vue.renderList(customizedAspectRatioList.value, (item, i) => {
469
- return vue.openBlock(), vue.createElementBlock("div", {
470
- key: item.lable,
471
- class: vue.normalizeClass([
472
- "btn btn" + (item.buttonIndex + 1),
473
- { active: aspectRatioActive.value === i }
474
- ]),
475
- onClick: ($event) => cropper(item.value, i)
476
- }, vue.toDisplayString(item.label), 11, _hoisted_7);
477
- }), 128))
478
- ])) : vue.createCommentVNode("v-if", true)
479
- ])
492
+ _: 1
493
+ }, 8, ["loading"])
480
494
  ]),
481
495
  _: 1
482
496
  }, 8, ["visible"]);
@@ -61,7 +61,7 @@ const _sfc_main = vue.defineComponent({
61
61
  onCancel: handleCancel
62
62
  }, {
63
63
  title: vue.withCtx(() => [
64
- vue.createTextVNode("\u9009\u62E9\u5C01\u9762\u6765\u6E90")
64
+ vue.createTextVNode("\u9009\u62E9\u7D20\u6750\u6765\u6E90")
65
65
  ]),
66
66
  default: vue.withCtx(() => [
67
67
  vue.createVNode(index, {
@@ -1,6 +1,7 @@
1
1
  "use strict";
2
2
  var vue = require("vue");
3
3
  var webVue = require("@arco-design/web-vue");
4
+ var process = require("process");
4
5
  var doc = require("../utils/doc.js");
5
6
  var component = require("../resourceModal/component.js");
6
7
  var component$1 = require("../imageCrop/component.js");
@@ -82,6 +83,16 @@ const _sfc_main = vue.defineComponent({
82
83
  callback(styleData.value);
83
84
  }
84
85
  });
86
+ const refreshCrop = vue.ref(true);
87
+ vue.watch(
88
+ () => dialogCropperShow.value,
89
+ (n) => {
90
+ if (n)
91
+ return;
92
+ refreshCrop.value = false;
93
+ process.nextTick(() => refreshCrop.value = true);
94
+ }
95
+ );
85
96
  const loadData = (value) => {
86
97
  let data = null;
87
98
  if (!value) {
@@ -415,7 +426,8 @@ const _sfc_main = vue.defineComponent({
415
426
  onSubmit: submitCallback,
416
427
  onUpload: _cache[3] || (_cache[3] = (cb) => _ctx.$emit("upload", cb))
417
428
  }, null, 8, ["dialogVisible", "ai_static_covers", "BASE_API"]),
418
- vue.createVNode(component$1, {
429
+ refreshCrop.value ? (vue.openBlock(), vue.createBlock(component$1, {
430
+ key: 3,
419
431
  visible: dialogCropperShow.value,
420
432
  "onUpdate:visible": _cache[4] || (_cache[4] = ($event) => dialogCropperShow.value = $event),
421
433
  "aspect-ratio-prop": aspectRatioProp.value,
@@ -423,7 +435,7 @@ const _sfc_main = vue.defineComponent({
423
435
  "corp-data": cropperData.value,
424
436
  "generate-assets": false,
425
437
  onConfirm: cropConfirm
426
- }, null, 8, ["visible", "aspect-ratio-prop", "BASE_API", "corp-data"])
438
+ }, null, 8, ["visible", "aspect-ratio-prop", "BASE_API", "corp-data"])) : vue.createCommentVNode("v-if", true)
427
439
  ]);
428
440
  };
429
441
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@cmstops/pro-compo",
3
- "version": "0.1.42",
3
+ "version": "0.1.44",
4
4
  "description": "",
5
5
  "keywords": [
6
6
  "vue",