@cmstops/pro-compo 0.3.9 → 0.3.11

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.
@@ -6,60 +6,59 @@ import _sfc_main$4 from "../imageCrop/component.js";
6
6
  import _sfc_main$1 from "./components/card.js";
7
7
  import _sfc_main$2 from "./components/colorPalette.js";
8
8
  import { DEFAULT_BASE_API } from "../config.js";
9
- const _hoisted_1 = { class: "select-thumb-container" };
10
- const _hoisted_2 = {
9
+ const _hoisted_1 = {
11
10
  key: 0,
12
11
  class: "star"
13
12
  };
14
- const _hoisted_3 = {
13
+ const _hoisted_2 = {
15
14
  key: 1,
16
15
  style: { "margin-left": "10px" },
17
16
  class: "tip"
18
17
  };
19
- const _hoisted_4 = { class: "thumbbox" };
20
- const _hoisted_5 = {
18
+ const _hoisted_3 = { class: "thumbbox" };
19
+ const _hoisted_4 = {
21
20
  key: 0,
22
21
  class: "thumb-list-view"
23
22
  };
24
- const _hoisted_6 = { class: "thumb-list-view" };
25
- const _hoisted_7 = { style: { "margin-top": "-10px" } };
26
- const _hoisted_8 = {
23
+ const _hoisted_5 = { class: "thumb-list-view" };
24
+ const _hoisted_6 = { style: { "margin-top": "-10px" } };
25
+ const _hoisted_7 = {
27
26
  key: 0,
28
27
  class: "tip"
29
28
  };
30
- const _hoisted_9 = /* @__PURE__ */ createElementVNode("span", { style: { "margin-right": "10px" } }, "\u72EC\u7ACB\u8F6E\u64AD\u56FE", -1);
31
- const _hoisted_10 = { class: "thumbbox" };
32
- const _hoisted_11 = {
29
+ const _hoisted_8 = /* @__PURE__ */ createElementVNode("span", { style: { "margin-right": "10px" } }, "\u72EC\u7ACB\u8F6E\u64AD\u56FE", -1);
30
+ const _hoisted_9 = { class: "thumbbox" };
31
+ const _hoisted_10 = {
33
32
  key: 2,
34
33
  class: "title"
35
34
  };
36
- const _hoisted_12 = /* @__PURE__ */ createElementVNode("span", null, "\u72EC\u7ACB\u8F6E\u64AD\u56FE\u80CC\u666F\u989C\u8272", -1);
37
- const _hoisted_13 = [
38
- _hoisted_12
35
+ const _hoisted_11 = /* @__PURE__ */ createElementVNode("span", null, "\u72EC\u7ACB\u8F6E\u64AD\u56FE\u80CC\u666F\u989C\u8272", -1);
36
+ const _hoisted_12 = [
37
+ _hoisted_11
39
38
  ];
40
- const _hoisted_14 = { key: 0 };
41
- const _hoisted_15 = {
39
+ const _hoisted_13 = { key: 0 };
40
+ const _hoisted_14 = {
42
41
  key: 0,
43
42
  class: "star"
44
43
  };
45
- const _hoisted_16 = { key: 1 };
46
- const _hoisted_17 = {
44
+ const _hoisted_15 = { key: 1 };
45
+ const _hoisted_16 = {
47
46
  key: 2,
48
47
  class: "tip",
49
48
  style: { "margin-left": "10px" }
50
49
  };
51
- const _hoisted_18 = { class: "thumbbox" };
52
- const _hoisted_19 = {
50
+ const _hoisted_17 = { class: "thumbbox" };
51
+ const _hoisted_18 = {
53
52
  key: 0,
54
53
  class: "tip"
55
54
  };
56
- const _hoisted_20 = {
55
+ const _hoisted_19 = {
57
56
  key: 1,
58
57
  class: "title"
59
58
  };
60
- const _hoisted_21 = /* @__PURE__ */ createElementVNode("span", null, "\u56FE\u7247\u80CC\u666F\u989C\u8272", -1);
61
- const _hoisted_22 = [
62
- _hoisted_21
59
+ const _hoisted_20 = /* @__PURE__ */ createElementVNode("span", null, "\u56FE\u7247\u80CC\u666F\u989C\u8272", -1);
60
+ const _hoisted_21 = [
61
+ _hoisted_20
63
62
  ];
64
63
  const _sfc_main = defineComponent({
65
64
  ...{ name: "selectThumb" },
@@ -87,6 +86,7 @@ const _sfc_main = defineComponent({
87
86
  const emit = __emit;
88
87
  const props = __props;
89
88
  const BASE_API = props.BASE_API || DEFAULT_BASE_API;
89
+ const selectThumbRef = ref();
90
90
  const oldData = ref(null);
91
91
  const styleData = ref({});
92
92
  const thumbBannerModel = ref("banner");
@@ -95,6 +95,7 @@ const _sfc_main = defineComponent({
95
95
  const thumbOptionIndex = ref(0);
96
96
  const aspectRatioProp = ref(16 / 9);
97
97
  const cropperData = ref([]);
98
+ const tempThumbFiles = ref([]);
98
99
  if (props.mediaUseType) {
99
100
  provide("mediaUseType", props.mediaUseType);
100
101
  }
@@ -218,13 +219,27 @@ const _sfc_main = defineComponent({
218
219
  }
219
220
  return modelList.value.find((item) => item.value === model.value);
220
221
  });
221
- const thumbList = computed(() => {
222
- var _a;
223
- return ((_a = styleData.value) == null ? void 0 : _a.data) || [];
222
+ const thumbList = computed({
223
+ get() {
224
+ var _a;
225
+ return ((_a = styleData.value) == null ? void 0 : _a.data) || [];
226
+ },
227
+ set(value) {
228
+ styleData.value.data = value || [];
229
+ }
224
230
  });
225
231
  const previewList = computed(() => {
226
232
  return thumbList.value.map((item) => item.url);
227
233
  });
234
+ const fileForShowThumb = (data) => {
235
+ tempThumbFiles.value.push(data);
236
+ submitCallback(tempThumbFiles.value);
237
+ };
238
+ const changeThumbType = (type, index) => {
239
+ tempThumbFiles.value = [];
240
+ thumbBannerModel.value = type;
241
+ thumbOptionIndex.value = index;
242
+ };
228
243
  const openDialogMediaSelection = (type, index) => {
229
244
  thumbBannerModel.value = type || "thumb";
230
245
  thumbOptionIndex.value = index || 0;
@@ -250,8 +265,14 @@ const _sfc_main = defineComponent({
250
265
  } else if (thumbBannerModel.value === "thumb") {
251
266
  let temp = [];
252
267
  if (model.value === "1") {
268
+ let idx = 0;
253
269
  temp = JSON.parse(JSON.stringify(styleData.value.data));
254
- temp[thumbOptionIndex.value] = { url: data[0].url, thumb: data[0].url };
270
+ for (let i = thumbOptionIndex.value; i < thumbOptionIndex.value + data.length; i++) {
271
+ if (i >= 3)
272
+ return;
273
+ temp[i] = { url: data[idx].url, thumb: data[idx].url };
274
+ idx++;
275
+ }
255
276
  } else {
256
277
  temp = [{ url: data[0].url, thumb: data[0].url }];
257
278
  }
@@ -314,9 +335,14 @@ const _sfc_main = defineComponent({
314
335
  }
315
336
  callback(styleData.value);
316
337
  };
317
- const banner = computed(() => {
318
- const { banner: banner2, banner_theme_color, banner_url } = styleData.value;
319
- return { banner: banner2, banner_theme_color, url: banner_url };
338
+ const banner = computed({
339
+ get() {
340
+ const { banner: banner2, banner_theme_color, banner_url } = styleData.value;
341
+ return { banner: banner2, banner_theme_color, url: banner_url };
342
+ },
343
+ set(value) {
344
+ styleData.value.banner_url = value.url;
345
+ }
320
346
  });
321
347
  const hasBanner = computed({
322
348
  get() {
@@ -328,16 +354,25 @@ const _sfc_main = defineComponent({
328
354
  callback(styleData.value);
329
355
  }
330
356
  });
331
- const pcBanner = computed(() => {
332
- const { pc_banner_url_info, pc_banner_url } = styleData.value;
333
- return { pc_banner_url_info, url: pc_banner_url };
357
+ const pcBanner = computed({
358
+ get() {
359
+ const { pc_banner_url_info, pc_banner_url } = styleData.value;
360
+ return { pc_banner_url_info, url: pc_banner_url };
361
+ },
362
+ set(value) {
363
+ styleData.value.pc_banner_url = value.url;
364
+ }
334
365
  });
335
366
  const colorChange = (styleData2) => {
336
367
  callback(styleData2);
337
368
  };
338
369
  return (_ctx, _cache) => {
339
370
  var _a, _b, _c, _d, _e, _f;
340
- return openBlock(), createElementBlock("div", _hoisted_1, [
371
+ return openBlock(), createElementBlock("div", {
372
+ ref_key: "selectThumbRef",
373
+ ref: selectThumbRef,
374
+ class: "select-thumb-container"
375
+ }, [
341
376
  createCommentVNode(" \u5C01\u9762\u6807\u9898"),
342
377
  createElementVNode("div", {
343
378
  class: normalizeClass(["banner-view", { flex: _ctx.flex }])
@@ -347,46 +382,54 @@ const _sfc_main = defineComponent({
347
382
  class: "title",
348
383
  style: normalizeStyle({ width: _ctx.offset })
349
384
  }, [
350
- _ctx.titleValid ? (openBlock(), createElementBlock("span", _hoisted_2, "*")) : createCommentVNode("v-if", true),
385
+ _ctx.titleValid ? (openBlock(), createElementBlock("span", _hoisted_1, "*")) : createCommentVNode("v-if", true),
351
386
  createElementVNode("span", null, toDisplayString(_ctx.title ? _ctx.title : "\u5C01\u9762"), 1),
352
387
  createCommentVNode(" \u4E0A\u4E0B\u5E03\u5C40\u663E\u793A tip"),
353
- ((_a = curtemplate.value) == null ? void 0 : _a.value) !== "4" && !_ctx.flex ? (openBlock(), createElementBlock("span", _hoisted_3, " (" + toDisplayString((_b = curtemplate.value) == null ? void 0 : _b.alias) + "\u6BD4\u4F8B\uFF1A" + toDisplayString((_c = curtemplate.value) == null ? void 0 : _c.ratioStr) + ") ", 1)) : createCommentVNode("v-if", true)
388
+ ((_a = curtemplate.value) == null ? void 0 : _a.value) !== "4" && !_ctx.flex ? (openBlock(), createElementBlock("span", _hoisted_2, " (" + toDisplayString((_b = curtemplate.value) == null ? void 0 : _b.alias) + "\u6BD4\u4F8B\uFF1A" + toDisplayString((_c = curtemplate.value) == null ? void 0 : _c.ratioStr) + ") ", 1)) : createCommentVNode("v-if", true)
354
389
  ], 4)) : createCommentVNode("v-if", true),
355
- createElementVNode("div", _hoisted_4, [
356
- ["thumbs"].includes(_ctx.mode) ? (openBlock(), createElementBlock("div", _hoisted_5, [
390
+ createElementVNode("div", _hoisted_3, [
391
+ ["thumbs"].includes(_ctx.mode) ? (openBlock(), createElementBlock("div", _hoisted_4, [
357
392
  (openBlock(true), createElementBlock(Fragment, null, renderList(thumbsLengthList.value, (item, index) => {
358
393
  return openBlock(), createBlock(_sfc_main$1, {
359
394
  key: index,
360
395
  id: `thumb-card-${index}`,
361
396
  data: thumbList.value[index],
362
397
  "onUpdate:data": ($event) => thumbList.value[index] = $event,
398
+ parentRef: selectThumbRef.value,
399
+ idx: index,
363
400
  "preview-list": previewList.value,
364
401
  "thumb-model": "thumb",
402
+ onFileForShowThumb: fileForShowThumb,
403
+ onChangeThumbType: changeThumbType,
365
404
  onUploadLocal: _cache[0] || (_cache[0] = (cb) => _ctx.$emit("upload", cb)),
366
405
  onOpen: ($event) => openDialogMediaSelection($event, index)
367
- }, null, 8, ["id", "data", "onUpdate:data", "preview-list", "onOpen"]);
406
+ }, null, 8, ["id", "data", "onUpdate:data", "parentRef", "idx", "preview-list", "onOpen"]);
368
407
  }), 128))
369
408
  ])) : currentModel.value ? (openBlock(), createElementBlock(Fragment, { key: 1 }, [
370
409
  createCommentVNode(" \u5C01\u9762\u56FEcard "),
371
- createElementVNode("div", _hoisted_6, [
410
+ createElementVNode("div", _hoisted_5, [
372
411
  (openBlock(true), createElementBlock(Fragment, null, renderList(currentModel.value.maxLength, (item, index) => {
373
412
  return openBlock(), createBlock(_sfc_main$1, {
374
413
  key: index,
375
414
  id: `thumb-card-${index}`,
376
415
  data: thumbList.value[index],
377
416
  "onUpdate:data": ($event) => thumbList.value[index] = $event,
417
+ parentRef: selectThumbRef.value,
378
418
  model: model.value,
419
+ idx: index,
379
420
  "preview-list": previewList.value,
380
421
  "thumb-model": "thumb",
422
+ onFileForShowThumb: fileForShowThumb,
423
+ onChangeThumbType: changeThumbType,
381
424
  onUploadLocal: _cache[1] || (_cache[1] = (cb) => _ctx.$emit("upload", cb)),
382
425
  onOpen: ($event) => openDialogMediaSelection($event, index)
383
- }, null, 8, ["id", "data", "onUpdate:data", "model", "preview-list", "onOpen"]);
426
+ }, null, 8, ["id", "data", "onUpdate:data", "parentRef", "model", "idx", "preview-list", "onOpen"]);
384
427
  }), 128))
385
428
  ])
386
429
  ], 2112)) : createCommentVNode("v-if", true),
387
430
  createCommentVNode(" \u5DE6\u53F3\u5E03\u5C40\u663E\u793Atip "),
388
- createElementVNode("div", _hoisted_7, [
389
- ((_d = curtemplate.value) == null ? void 0 : _d.value) !== "4" && _ctx.flex ? (openBlock(), createElementBlock("span", _hoisted_8, " (" + toDisplayString((_e = curtemplate.value) == null ? void 0 : _e.alias) + "\u6BD4\u4F8B\uFF1A" + toDisplayString((_f = curtemplate.value) == null ? void 0 : _f.ratioStr) + ") ", 1)) : createCommentVNode("v-if", true)
431
+ createElementVNode("div", _hoisted_6, [
432
+ ((_d = curtemplate.value) == null ? void 0 : _d.value) !== "4" && _ctx.flex ? (openBlock(), createElementBlock("span", _hoisted_7, " (" + toDisplayString((_e = curtemplate.value) == null ? void 0 : _e.alias) + "\u6BD4\u4F8B\uFF1A" + toDisplayString((_f = curtemplate.value) == null ? void 0 : _f.ratioStr) + ") ", 1)) : createCommentVNode("v-if", true)
390
433
  ]),
391
434
  ["doc"].includes(_ctx.mode) ? (openBlock(), createElementBlock(Fragment, { key: 2 }, [
392
435
  createCommentVNode(" \u9009\u62E9\u5927\u56FE\u3001\u4E09\u56FE\u3001\u5355\u56FE...\u7B49\u6A21\u5F0F "),
@@ -425,7 +468,7 @@ const _sfc_main = defineComponent({
425
468
  class: "title",
426
469
  style: normalizeStyle({ width: _ctx.offset })
427
470
  }, [
428
- _hoisted_9,
471
+ _hoisted_8,
429
472
  createCommentVNode(" \u4E0A\u4E0B\u5E03\u5C40\u5F00\u5173\u5728\u6807\u9898\u540E "),
430
473
  !_ctx.flex ? (openBlock(), createBlock(unref(Switch), {
431
474
  key: 0,
@@ -434,7 +477,7 @@ const _sfc_main = defineComponent({
434
477
  size: "small"
435
478
  }, null, 8, ["modelValue"])) : createCommentVNode("v-if", true)
436
479
  ], 4),
437
- createElementVNode("div", _hoisted_10, [
480
+ createElementVNode("div", _hoisted_9, [
438
481
  createCommentVNode(" \u5DE6\u53F3\u5E03\u5C40\u5F00\u5173\u663E\u793A "),
439
482
  _ctx.flex ? (openBlock(), createBlock(unref(Switch), {
440
483
  key: 0,
@@ -448,12 +491,15 @@ const _sfc_main = defineComponent({
448
491
  id: `banner-card`,
449
492
  data: banner.value,
450
493
  "onUpdate:data": _cache[5] || (_cache[5] = ($event) => banner.value = $event),
494
+ parentRef: selectThumbRef.value,
451
495
  "preview-list": previewList.value,
452
496
  "thumb-model": "banner",
497
+ onFileForShowThumb: fileForShowThumb,
498
+ onChangeThumbType: changeThumbType,
453
499
  onUploadLocal: _cache[6] || (_cache[6] = (cb) => _ctx.$emit("upload", cb)),
454
500
  onOpen: openDialogMediaSelection
455
- }, null, 8, ["data", "preview-list"])) : createCommentVNode("v-if", true),
456
- hasBanner.value && styleData.value.banner_theme_color ? (openBlock(), createElementBlock("div", _hoisted_11, _hoisted_13)) : createCommentVNode("v-if", true),
501
+ }, null, 8, ["data", "parentRef", "preview-list"])) : createCommentVNode("v-if", true),
502
+ hasBanner.value && styleData.value.banner_theme_color ? (openBlock(), createElementBlock("div", _hoisted_10, _hoisted_12)) : createCommentVNode("v-if", true),
457
503
  createCommentVNode(" banner\u8C03\u8272\u677F "),
458
504
  hasBanner.value ? (openBlock(), createBlock(_sfc_main$2, {
459
505
  key: 3,
@@ -471,24 +517,27 @@ const _sfc_main = defineComponent({
471
517
  class: "title",
472
518
  style: normalizeStyle({ width: _ctx.offset })
473
519
  }, [
474
- docSeriesShowTopThemeColor.value ? (openBlock(), createElementBlock("span", _hoisted_14, [
475
- _ctx.topImageTitleValid ? (openBlock(), createElementBlock("span", _hoisted_15, "*")) : createCommentVNode("v-if", true),
520
+ docSeriesShowTopThemeColor.value ? (openBlock(), createElementBlock("span", _hoisted_13, [
521
+ _ctx.topImageTitleValid ? (openBlock(), createElementBlock("span", _hoisted_14, "*")) : createCommentVNode("v-if", true),
476
522
  createElementVNode("span", null, toDisplayString(_ctx.topImageTitle || "\u5C01\u9762\u5934\u56FE"), 1)
477
- ])) : (openBlock(), createElementBlock("span", _hoisted_16, "PC\u5C01\u9762\u56FE")),
478
- !_ctx.flex ? (openBlock(), createElementBlock("span", _hoisted_17, " (\u5EFA\u8BAE\u5C3A\u5BF8\uFF1A1242px*662px) ")) : createCommentVNode("v-if", true)
523
+ ])) : (openBlock(), createElementBlock("span", _hoisted_15, "PC\u5C01\u9762\u56FE")),
524
+ !_ctx.flex ? (openBlock(), createElementBlock("span", _hoisted_16, " (\u5EFA\u8BAE\u5C3A\u5BF8\uFF1A1242px*662px) ")) : createCommentVNode("v-if", true)
479
525
  ], 4),
480
- createElementVNode("div", _hoisted_18, [
526
+ createElementVNode("div", _hoisted_17, [
481
527
  createVNode(_sfc_main$1, {
482
528
  id: `pc-banner-card`,
483
529
  data: pcBanner.value,
484
530
  "onUpdate:data": _cache[7] || (_cache[7] = ($event) => pcBanner.value = $event),
531
+ parentRef: selectThumbRef.value,
485
532
  previewList: previewList.value,
486
533
  thumbModel: "pcBanner",
534
+ onFileForShowThumb: fileForShowThumb,
535
+ onChangeThumbType: changeThumbType,
487
536
  onUploadLocal: _cache[8] || (_cache[8] = (cb) => _ctx.$emit("upload", cb)),
488
537
  onOpen: openDialogMediaSelection
489
- }, null, 8, ["data", "previewList"]),
490
- _ctx.flex ? (openBlock(), createElementBlock("span", _hoisted_19, "(\u5EFA\u8BAE\u5C3A\u5BF8\uFF1A1242px*662px)")) : createCommentVNode("v-if", true),
491
- docSeriesShowTopThemeColor.value && styleData.value.top_theme_color ? (openBlock(), createElementBlock("div", _hoisted_20, _hoisted_22)) : createCommentVNode("v-if", true),
538
+ }, null, 8, ["data", "parentRef", "previewList"]),
539
+ _ctx.flex ? (openBlock(), createElementBlock("span", _hoisted_18, "(\u5EFA\u8BAE\u5C3A\u5BF8\uFF1A1242px*662px)")) : createCommentVNode("v-if", true),
540
+ docSeriesShowTopThemeColor.value && styleData.value.top_theme_color ? (openBlock(), createElementBlock("div", _hoisted_19, _hoisted_21)) : createCommentVNode("v-if", true),
492
541
  docSeriesShowTopThemeColor.value ? (openBlock(), createBlock(_sfc_main$2, {
493
542
  key: 2,
494
543
  model: "top",
@@ -518,7 +567,7 @@ const _sfc_main = defineComponent({
518
567
  "generate-assets": false,
519
568
  onConfirm: cropConfirm
520
569
  }, null, 8, ["visible", "aspect-ratio-prop", "BASE_API", "corp-data"])) : createCommentVNode("v-if", true)
521
- ]);
570
+ ], 512);
522
571
  };
523
572
  }
524
573
  });
@@ -1,4 +1,4 @@
1
- import { defineComponent, computed, openBlock, createBlock, unref, withCtx, createElementVNode, normalizeStyle, normalizeClass, createElementBlock, createVNode, Transition, withModifiers, createCommentVNode } from "vue";
1
+ import { defineComponent, computed, openBlock, createBlock, unref, withCtx, createElementVNode, normalizeClass, createElementBlock, createVNode, Transition, withModifiers, createCommentVNode, normalizeStyle } from "vue";
2
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";
@@ -13,11 +13,20 @@ const _sfc_main = defineComponent({
13
13
  data: {},
14
14
  previewList: {},
15
15
  thumbModel: {},
16
+ parentRef: {},
17
+ idx: {},
16
18
  along: { type: Boolean },
17
- model: {},
18
- changeThumbModel: { type: Function }
19
+ model: {}
19
20
  },
20
- emits: ["open", "remove", "uploadLocal", "update:data"],
21
+ emits: [
22
+ "open",
23
+ "remove",
24
+ "change",
25
+ "changeThumbType",
26
+ "fileForShowThumb",
27
+ "uploadLocal",
28
+ "update:data"
29
+ ],
21
30
  setup(__props, { emit: __emit }) {
22
31
  const waterBg = `${DEFAULT_BASE_API}/static/images/waterBg.png`;
23
32
  const props = __props;
@@ -30,22 +39,20 @@ const _sfc_main = defineComponent({
30
39
  [`model-${props.model}`]: ((_a = props.data) == null ? void 0 : _a.url) && props.model
31
40
  };
32
41
  });
33
- const btnStyle = computed(() => {
34
- return {
35
- padding: "5px 10px",
36
- cursor: "pointer"
37
- };
38
- });
39
42
  const clickMask = () => {
40
43
  props.along && openDialogMediaSelection();
41
44
  };
42
45
  const loaclUpload = () => {
46
+ emit("changeThumbType", props.thumbModel, props.idx || 0);
43
47
  emit("uploadLocal", (file) => {
44
- const { data } = props;
45
- if (!data || !file)
48
+ let { data } = props;
49
+ if (!file)
46
50
  return;
51
+ if (!data) {
52
+ data = {};
53
+ }
47
54
  data.url = file.url;
48
- emit("update:data", data);
55
+ emit("fileForShowThumb", data);
49
56
  });
50
57
  };
51
58
  const openDialogMediaSelection = () => {
@@ -56,21 +63,16 @@ const _sfc_main = defineComponent({
56
63
  };
57
64
  return (_ctx, _cache) => {
58
65
  return openBlock(), createBlock(unref(Popover), {
59
- trigger: "hover",
60
- "content-style": "padding: 0;"
66
+ trigger: "click",
67
+ position: "bottom",
68
+ "popup-container": props.parentRef
61
69
  }, {
62
70
  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
+ createElementVNode("div", { onClick: openDialogMediaSelection }, "\u7D20\u6750\u5E93\u9009\u62E9"),
72
+ createElementVNode("div", { onClick: loaclUpload }, "\u672C\u5730\u4E0A\u4F20")
71
73
  ]),
72
74
  default: withCtx(() => {
73
- var _a, _b;
75
+ var _a;
74
76
  return [
75
77
  createElementVNode("div", {
76
78
  class: normalizeClass(["thumb-card-container", classObj.value])
@@ -79,7 +81,8 @@ const _sfc_main = defineComponent({
79
81
  createVNode(unref(Image), {
80
82
  class: "item",
81
83
  fit: "cover",
82
- src: (_b = props.data) == null ? void 0 : _b.url
84
+ src: props.data.url,
85
+ "show-loader": ""
83
86
  }, null, 8, ["src"]),
84
87
  createVNode(Transition, { name: "fade" }, {
85
88
  default: withCtx(() => [
@@ -115,7 +118,7 @@ const _sfc_main = defineComponent({
115
118
  ];
116
119
  }),
117
120
  _: 1
118
- });
121
+ }, 8, ["popup-container"]);
119
122
  };
120
123
  }
121
124
  });
@@ -108,6 +108,16 @@
108
108
  transition: transform 0.15s ease-in 0.05s;
109
109
  transform-origin: center;
110
110
  }
111
+ .select-thumb-container .arco-trigger-popup .arco-popover-popup-content {
112
+ padding: 0;
113
+ }
114
+ .select-thumb-container .arco-trigger-popup .arco-popover-popup-content .arco-popover-content div {
115
+ padding: 5px 10px;
116
+ }
117
+ .select-thumb-container .arco-trigger-popup .arco-popover-popup-content .arco-popover-content div:hover {
118
+ background-color: #f3f6f9;
119
+ cursor: pointer;
120
+ }
111
121
  .select-thumb-container .title {
112
122
  margin-bottom: 10px;
113
123
  color: #4e5969;
@@ -3,6 +3,23 @@
3
3
  @import './card.less';
4
4
  @import './colorPalette.less';
5
5
 
6
+ .arco-trigger-popup {
7
+ .arco-popover-popup-content {
8
+ padding: 0;
9
+
10
+ .arco-popover-content {
11
+ div {
12
+ padding: 5px 10px;
13
+
14
+ &:hover {
15
+ background-color: #f3f6f9;
16
+ cursor: pointer;
17
+ }
18
+ }
19
+ }
20
+ }
21
+ }
22
+
6
23
  .title {
7
24
  margin-bottom: 10px;
8
25
  color: #4e5969;
@@ -119,11 +119,11 @@ const _sfc_main = vue.defineComponent({
119
119
  ]),
120
120
  vue.createElementVNode("div", _hoisted_4, [
121
121
  vue.createElementVNode("div", _hoisted_5, [
122
+ vue.renderSlot(_ctx.$slots, "index"),
122
123
  vue.createVNode(index$1, {
123
124
  item: _ctx.item,
124
125
  BASE_API: _ctx.BASE_API
125
126
  }, null, 8, ["item", "BASE_API"]),
126
- vue.renderSlot(_ctx.$slots, "index"),
127
127
  vue.createElementVNode("span", {
128
128
  class: "text",
129
129
  onClick: clickTitle
@@ -2,7 +2,6 @@
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
- require("html2canvas");
6
5
  var QRCode = require("qrcodejs2-fix");
7
6
  var date = require("../../../../utils/date.js");
8
7
  var api = require("../../../script/api.js");
@@ -90,6 +89,62 @@ const _sfc_main = vue.defineComponent({
90
89
  return true;
91
90
  return flag;
92
91
  });
92
+ const clip = (data) => {
93
+ try {
94
+ const input = document.createElement("input");
95
+ input.setAttribute("value", data);
96
+ document.body.appendChild(input);
97
+ input.select();
98
+ document.execCommand("copy");
99
+ document.body.removeChild(input);
100
+ webVue.Message.success({
101
+ content: "\u5DF2\u4FDD\u5B58\u5230\u7C98\u8D34\u677F"
102
+ });
103
+ } catch (e) {
104
+ console.log(e);
105
+ webVue.Message.success({
106
+ content: `\u4FDD\u5B58\u5931\u8D25`
107
+ });
108
+ }
109
+ };
110
+ const clipUrl = async (type) => {
111
+ if (!dataInfo.value.share.share_url)
112
+ return;
113
+ if (type === "text") {
114
+ clip(dataInfo.value.share.share_url);
115
+ } else {
116
+ const img = document.querySelector(`#${dynamicQRId.value} img`);
117
+ if (!img)
118
+ return;
119
+ const response = await fetch(img.src);
120
+ const blob = await response.blob();
121
+ if (!blob)
122
+ return;
123
+ try {
124
+ if (window.__POWERED_BY_WUJIE__) {
125
+ await window.parent.navigator.clipboard.write([
126
+ new ClipboardItem({
127
+ "image/png": blob
128
+ })
129
+ ]);
130
+ } else {
131
+ await navigator.clipboard.write([
132
+ new ClipboardItem({
133
+ "image/png": blob
134
+ })
135
+ ]);
136
+ }
137
+ webVue.Message.success({
138
+ content: "\u5DF2\u4FDD\u5B58\u5230\u7C98\u8D34\u677F"
139
+ });
140
+ } catch (e) {
141
+ console.log(e);
142
+ webVue.Message.success({
143
+ content: `\u4FDD\u5B58\u5931\u8D25`
144
+ });
145
+ }
146
+ }
147
+ };
93
148
  const genTimeLink = async (expiration2, force = true, tip = true) => {
94
149
  emit("changeLoading", true);
95
150
  const data = {
@@ -176,11 +231,11 @@ const _sfc_main = vue.defineComponent({
176
231
  placeholder: "\u8BF7\u9009\u62E9"
177
232
  }, {
178
233
  default: vue.withCtx(() => [
179
- (vue.openBlock(true), vue.createElementBlock(vue.Fragment, null, vue.renderList(expirationOptions.value, (time2, index) => {
234
+ (vue.openBlock(true), vue.createElementBlock(vue.Fragment, null, vue.renderList(expirationOptions.value, (t, index) => {
180
235
  return vue.openBlock(), vue.createBlock(vue.unref(webVue.Option), {
181
236
  key: index,
182
- label: time2.label,
183
- value: time2.value
237
+ label: t.label,
238
+ value: t.value
184
239
  }, null, 8, ["label", "value"]);
185
240
  }), 128))
186
241
  ]),
@@ -188,7 +243,7 @@ const _sfc_main = vue.defineComponent({
188
243
  }, 8, ["modelValue"])
189
244
  ])
190
245
  ])),
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),
246
+ 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
247
  vue.createElementVNode("div", _hoisted_12, [
193
248
  showGetLink.value ? (vue.openBlock(), vue.createBlock(vue.unref(webVue.Button), {
194
249
  key: 0,
@@ -197,12 +252,31 @@ const _sfc_main = vue.defineComponent({
197
252
  onClick: _cache[1] || (_cache[1] = ($event) => genTimeLink(expiration.value))
198
253
  }, {
199
254
  default: vue.withCtx(() => [
200
- vue.createTextVNode("\u751F\u6210\u9884\u89C8\u94FE\u63A5")
255
+ vue.createTextVNode(" \u751F\u6210\u9884\u89C8\u94FE\u63A5 ")
201
256
  ]),
202
257
  _: 1
203
258
  })) : (vue.openBlock(), vue.createElementBlock(vue.Fragment, { key: 1 }, [
204
- vue.createCommentVNode("v-if", true),
205
- vue.createCommentVNode("v-if", true)
259
+ vue.createVNode(vue.unref(webVue.Button), {
260
+ class: "auto",
261
+ light: "",
262
+ onClick: _cache[2] || (_cache[2] = ($event) => clipUrl("img"))
263
+ }, {
264
+ default: vue.withCtx(() => [
265
+ vue.createTextVNode(" \u590D\u5236\u4E8C\u7EF4\u7801 ")
266
+ ]),
267
+ _: 1
268
+ }),
269
+ vue.createVNode(vue.unref(webVue.Button), {
270
+ class: "auto",
271
+ type: "primary",
272
+ light: "",
273
+ onClick: _cache[3] || (_cache[3] = ($event) => clipUrl("text"))
274
+ }, {
275
+ default: vue.withCtx(() => [
276
+ vue.createTextVNode(vue.toDisplayString(time.value ? "\u590D\u5236\u9884\u89C8\u5730\u5740" : "\u590D\u5236\u8BBF\u95EE\u5730\u5740"), 1)
277
+ ]),
278
+ _: 1
279
+ })
206
280
  ], 64))
207
281
  ])
208
282
  ])
package/lib/index.css CHANGED
@@ -3548,6 +3548,16 @@
3548
3548
  transition: transform 0.15s ease-in 0.05s;
3549
3549
  transform-origin: center;
3550
3550
  }
3551
+ .select-thumb-container .arco-trigger-popup .arco-popover-popup-content {
3552
+ padding: 0;
3553
+ }
3554
+ .select-thumb-container .arco-trigger-popup .arco-popover-popup-content .arco-popover-content div {
3555
+ padding: 5px 10px;
3556
+ }
3557
+ .select-thumb-container .arco-trigger-popup .arco-popover-popup-content .arco-popover-content div:hover {
3558
+ background-color: #f3f6f9;
3559
+ cursor: pointer;
3560
+ }
3551
3561
  .select-thumb-container .title {
3552
3562
  margin-bottom: 10px;
3553
3563
  color: #4e5969;