@cmstops/pro-compo 0.3.6 → 0.3.8

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,5 +1,5 @@
1
- import { defineComponent, ref, computed, onMounted, onBeforeUnmount, openBlock, createElementBlock, createCommentVNode, createVNode, unref, withCtx, createElementVNode, Fragment, renderList, createBlock, toDisplayString, createTextVNode, nextTick } from "vue";
2
- import { Spin, Select, Option, Button, Message } from "@arco-design/web-vue";
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
4
  import html2canvas from "html2canvas";
5
5
  import QRCode from "qrcodejs2-fix";
@@ -41,8 +41,10 @@ const _sfc_main = defineComponent({
41
41
  docData: {},
42
42
  BASE_API: {}
43
43
  },
44
- setup(__props) {
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("");
@@ -115,7 +116,7 @@ const _sfc_main = defineComponent({
115
116
  }
116
117
  };
117
118
  const genTimeLink = async (expiration2, force = true, tip = true) => {
118
- loading.value = true;
119
+ emit("changeLoading", true);
119
120
  const data = {
120
121
  force,
121
122
  hash_id: dataInfo.value.hash_id || dataInfo.value.hashid
@@ -133,7 +134,7 @@ const _sfc_main = defineComponent({
133
134
  nextTick(() => {
134
135
  loadQrcode(`${message.inner_url}?reqTime=${reqTime}`);
135
136
  setTimeout(() => {
136
- loading.value = false;
137
+ emit("changeLoading", false);
137
138
  }, 500);
138
139
  });
139
140
  } else {
@@ -162,7 +163,6 @@ const _sfc_main = defineComponent({
162
163
  };
163
164
  onMounted(() => {
164
165
  dataInfo.value = props.docData;
165
- console.log(1111, dataInfo.value);
166
166
  if (needLoadQR.value) {
167
167
  genTimeLink(60 * 60 * 24, false, false);
168
168
  }
@@ -177,87 +177,79 @@ const _sfc_main = defineComponent({
177
177
  return (_ctx, _cache) => {
178
178
  return openBlock(), createElementBlock("div", _hoisted_1, [
179
179
  createCommentVNode(" \u9884\u89C8\u624B\u673A\u626B\u7801 "),
180
- createVNode(unref(Spin), {
181
- loading: loading.value,
182
- style: { "width": "100%", "height": "100%" }
183
- }, {
184
- default: withCtx(() => [
185
- createElementVNode("div", _hoisted_2, [
186
- is_share.value ? (openBlock(), createElementBlock("div", {
187
- key: 0,
188
- id: dynamicQRId.value,
189
- ref_key: "qrcode",
190
- ref: qrcode,
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))
180
+ createElementVNode("div", _hoisted_2, [
181
+ is_share.value ? (openBlock(), createElementBlock("div", {
182
+ key: 0,
183
+ id: dynamicQRId.value,
184
+ ref_key: "qrcode",
185
+ ref: qrcode,
186
+ class: "qrcode"
187
+ }, null, 8, _hoisted_3)) : (openBlock(), createElementBlock(Fragment, { key: 1 }, [
188
+ !is_publish.value ? (openBlock(), createElementBlock("div", _hoisted_4, [
189
+ createElementVNode("div", _hoisted_5, [
190
+ createVNode(unref(IconQrcode), { size: 200 })
256
191
  ])
192
+ ])) : (openBlock(), createElementBlock("div", _hoisted_6, "\u6682\u65E0\u4E8C\u7EF4\u7801"))
193
+ ], 64)),
194
+ is_share.value ? (openBlock(), createElementBlock("div", _hoisted_7, "\u626B\u63CF\u4E8C\u7EF4\u7801\u8BBF\u95EE")) : (openBlock(), createElementBlock("div", _hoisted_8, [
195
+ _hoisted_9,
196
+ createElementVNode("span", null, [
197
+ createVNode(unref(Select), {
198
+ modelValue: expiration.value,
199
+ "onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => expiration.value = $event),
200
+ size: "mini",
201
+ placeholder: "\u8BF7\u9009\u62E9"
202
+ }, {
203
+ default: withCtx(() => [
204
+ (openBlock(true), createElementBlock(Fragment, null, renderList(expirationOptions.value, (time2, index) => {
205
+ return openBlock(), createBlock(unref(Option), {
206
+ key: index,
207
+ label: time2.label,
208
+ value: time2.value
209
+ }, null, 8, ["label", "value"]);
210
+ }), 128))
211
+ ]),
212
+ _: 1
213
+ }, 8, ["modelValue"])
257
214
  ])
258
- ]),
259
- _: 1
260
- }, 8, ["loading"])
215
+ ])),
216
+ 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),
217
+ createElementVNode("div", _hoisted_12, [
218
+ showGetLink.value ? (openBlock(), createBlock(unref(Button), {
219
+ key: 0,
220
+ type: "primary",
221
+ light: "",
222
+ onClick: _cache[1] || (_cache[1] = ($event) => genTimeLink(expiration.value))
223
+ }, {
224
+ default: withCtx(() => [
225
+ createTextVNode("\u751F\u6210\u9884\u89C8\u94FE\u63A5")
226
+ ]),
227
+ _: 1
228
+ })) : (openBlock(), createElementBlock(Fragment, { key: 1 }, [
229
+ createVNode(unref(Button), {
230
+ class: "auto",
231
+ light: "",
232
+ onClick: _cache[2] || (_cache[2] = ($event) => clipUrl("img"))
233
+ }, {
234
+ default: withCtx(() => [
235
+ createTextVNode("\u590D\u5236\u4E8C\u7EF4\u7801")
236
+ ]),
237
+ _: 1
238
+ }),
239
+ createVNode(unref(Button), {
240
+ class: "auto",
241
+ type: "primary",
242
+ light: "",
243
+ onClick: _cache[3] || (_cache[3] = ($event) => clipUrl("text"))
244
+ }, {
245
+ default: withCtx(() => [
246
+ createTextVNode(toDisplayString(time.value ? "\u590D\u5236\u9884\u89C8\u5730\u5740" : "\u590D\u5236\u8BBF\u95EE\u5730\u5740"), 1)
247
+ ]),
248
+ _: 1
249
+ })
250
+ ], 64))
251
+ ])
252
+ ])
261
253
  ]);
262
254
  };
263
255
  }
@@ -1,5 +1,5 @@
1
- import { defineComponent, ref, openBlock, createBlock, unref, withCtx, withModifiers, createCommentVNode, createElementVNode, createVNode } from "vue";
2
- import { Popover, Tooltip } 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,39 +24,48 @@ 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
- trigger: "hover",
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
- showQR.value ? (openBlock(), createBlock(_sfc_main$1, {
40
- key: 0,
41
- BASE_API: _ctx.BASE_API,
42
- docData: docData.value || props.item,
43
- onClick: _cache[0] || (_cache[0] = withModifiers(() => {
44
- }, ["stop"]))
45
- }, null, 8, ["BASE_API", "docData"])) : createCommentVNode("v-if", true)
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, [
49
- createVNode(unref(Tooltip), {
50
- effect: "dark",
51
- content: "\u70B9\u51FB\u53EF\u67E5\u770B\u5185\u5BB9\u5206\u4EAB\u4E8C\u7EF4\u7801",
52
- position: "top"
53
- }, {
54
- default: withCtx(() => [
55
- createVNode(unref(IconQrcode))
56
- ]),
57
- _: 1
58
- })
68
+ createVNode(unref(IconQrcode))
59
69
  ])
60
70
  ]),
61
71
  _: 1
@@ -77,12 +77,14 @@
77
77
  -webkit-line-clamp: 2;
78
78
  -webkit-box-orient: vertical;
79
79
 
80
- &:hover {
81
- color: #4886ff;
82
- text-decoration: underline;
80
+ .text {
81
+ &:hover {
82
+ color: #4886ff;
83
+ text-decoration: underline;
83
84
 
84
- .index {
85
- text-decoration: unset;
85
+ .index {
86
+ text-decoration: unset;
87
+ }
86
88
  }
87
89
  }
88
90
  }
@@ -583,11 +583,11 @@
583
583
  -webkit-line-clamp: 2;
584
584
  -webkit-box-orient: vertical;
585
585
  }
586
- .medialist-doc-item-view .info-view .title:hover {
586
+ .medialist-doc-item-view .info-view .title .text:hover {
587
587
  color: #4886ff;
588
588
  text-decoration: underline;
589
589
  }
590
- .medialist-doc-item-view .info-view .title:hover .index {
590
+ .medialist-doc-item-view .info-view .title .text:hover .index {
591
591
  text-decoration: unset;
592
592
  }
593
593
  .medialist-doc-item-view .info-view .abttrite-v {
@@ -1,5 +1,5 @@
1
1
  import { defineComponent, ref, computed, watch, onMounted, openBlock, createBlock, unref, withCtx, createVNode, withDirectives, vShow, createElementBlock, Fragment, renderList, createCommentVNode, createTextVNode, toDisplayString, toRaw } from "vue";
2
- import { Form, FormItem, Input, InputTag, Select, Option, DatePicker, Switch, InputNumber, RadioGroup, Radio, Message } from "@arco-design/web-vue";
2
+ import { Form, FormItem, Input, InputTag, Select, Option, Switch, DatePicker, InputNumber, RadioGroup, Radio, Message } from "@arco-design/web-vue";
3
3
  import { IconInfoCircle } from "@arco-design/web-vue/es/icon";
4
4
  import { docSeries } from "../../utils/doc.js";
5
5
  import _sfc_main$1 from "../../selectThumb/component.js";
@@ -118,6 +118,15 @@ const _sfc_main = defineComponent({
118
118
  });
119
119
  }
120
120
  };
121
+ const defaultSourceValue = computed(() => {
122
+ const defaultValue = SourceInfo.value.find((x) => x.default);
123
+ return defaultValue ? defaultValue.value : "";
124
+ });
125
+ const changeStatement = (val) => {
126
+ if (val && defaultSourceValue.value) {
127
+ form.value.source = defaultSourceValue.value;
128
+ }
129
+ };
121
130
  const lineTimeChange = () => {
122
131
  form.value.online_time = "";
123
132
  form.value.offline_time = "";
@@ -443,6 +452,21 @@ const _sfc_main = defineComponent({
443
452
  ]),
444
453
  _: 1
445
454
  }),
455
+ createVNode(unref(FormItem), {
456
+ key: "statement",
457
+ class: "horizontal",
458
+ field: "statement",
459
+ label: "\u539F\u521B\u58F0\u660E"
460
+ }, {
461
+ default: withCtx(() => [
462
+ createVNode(unref(Switch), {
463
+ modelValue: form.value.statement,
464
+ "onUpdate:modelValue": _cache[10] || (_cache[10] = ($event) => form.value.statement = $event),
465
+ onChange: changeStatement
466
+ }, null, 8, ["modelValue"])
467
+ ]),
468
+ _: 1
469
+ }),
446
470
  createVNode(unref(FormItem), {
447
471
  key: "source_url",
448
472
  field: "source_url",
@@ -451,7 +475,7 @@ const _sfc_main = defineComponent({
451
475
  default: withCtx(() => [
452
476
  createVNode(unref(Input), {
453
477
  modelValue: form.value.source_url,
454
- "onUpdate:modelValue": _cache[10] || (_cache[10] = ($event) => form.value.source_url = $event),
478
+ "onUpdate:modelValue": _cache[11] || (_cache[11] = ($event) => form.value.source_url = $event),
455
479
  "allow-clear": "",
456
480
  class: "input-w",
457
481
  placeholder: "\u586B\u5199\u6765\u6E90URL"
@@ -467,7 +491,7 @@ const _sfc_main = defineComponent({
467
491
  default: withCtx(() => [
468
492
  createVNode(unref(Input), {
469
493
  modelValue: form.value.author,
470
- "onUpdate:modelValue": _cache[11] || (_cache[11] = ($event) => form.value.author = $event),
494
+ "onUpdate:modelValue": _cache[12] || (_cache[12] = ($event) => form.value.author = $event),
471
495
  "allow-clear": "",
472
496
  class: "input-w",
473
497
  placeholder: "\u586B\u5199\u4F5C\u8005"
@@ -483,7 +507,7 @@ const _sfc_main = defineComponent({
483
507
  default: withCtx(() => [
484
508
  createVNode(unref(Select), {
485
509
  modelValue: form.value.duty_editor,
486
- "onUpdate:modelValue": _cache[12] || (_cache[12] = ($event) => form.value.duty_editor = $event),
510
+ "onUpdate:modelValue": _cache[13] || (_cache[13] = ($event) => form.value.duty_editor = $event),
487
511
  class: "input-w",
488
512
  multiple: "",
489
513
  placeholder: "\u8BBE\u7F6E\u7F16\u8F91"
@@ -510,7 +534,7 @@ const _sfc_main = defineComponent({
510
534
  default: withCtx(() => [
511
535
  createVNode(unref(InputTag), {
512
536
  modelValue: form.value.extra_attrs,
513
- "onUpdate:modelValue": _cache[13] || (_cache[13] = ($event) => form.value.extra_attrs = $event),
537
+ "onUpdate:modelValue": _cache[14] || (_cache[14] = ($event) => form.value.extra_attrs = $event),
514
538
  "allow-clear": "",
515
539
  class: "input-w",
516
540
  placeholder: "\u8BBE\u7F6E\u81EA\u5B9A\u4E49\u5C5E\u6027"
@@ -527,7 +551,7 @@ const _sfc_main = defineComponent({
527
551
  default: withCtx(() => [
528
552
  createVNode(unref(DatePicker), {
529
553
  modelValue: form.value.self_publish_time,
530
- "onUpdate:modelValue": _cache[14] || (_cache[14] = ($event) => form.value.self_publish_time = $event),
554
+ "onUpdate:modelValue": _cache[15] || (_cache[15] = ($event) => form.value.self_publish_time = $event),
531
555
  "time-picker-props": { defaultValue: "12:00:00" },
532
556
  placeholder: "\u9009\u62E9\u81EA\u5B9A\u4E49\u53D1\u5E03\u65F6\u95F4",
533
557
  "show-time": "",
@@ -545,7 +569,7 @@ const _sfc_main = defineComponent({
545
569
  default: withCtx(() => [
546
570
  createVNode(unref(Switch), {
547
571
  modelValue: form.value.line_time,
548
- "onUpdate:modelValue": _cache[15] || (_cache[15] = ($event) => form.value.line_time = $event),
572
+ "onUpdate:modelValue": _cache[16] || (_cache[16] = ($event) => form.value.line_time = $event),
549
573
  onChange: lineTimeChange
550
574
  }, null, 8, ["modelValue"])
551
575
  ]),
@@ -561,7 +585,7 @@ const _sfc_main = defineComponent({
561
585
  default: withCtx(() => [
562
586
  createVNode(unref(DatePicker), {
563
587
  modelValue: form.value.online_time,
564
- "onUpdate:modelValue": _cache[16] || (_cache[16] = ($event) => form.value.online_time = $event),
588
+ "onUpdate:modelValue": _cache[17] || (_cache[17] = ($event) => form.value.online_time = $event),
565
589
  "disabled-date": disabledStartTime,
566
590
  "time-picker-props": { defaultValue: "12:00:00" },
567
591
  disabled: disabledDatePickerOnlineTime.value,
@@ -581,7 +605,7 @@ const _sfc_main = defineComponent({
581
605
  default: withCtx(() => [
582
606
  createVNode(unref(DatePicker), {
583
607
  modelValue: form.value.offline_time,
584
- "onUpdate:modelValue": _cache[17] || (_cache[17] = ($event) => form.value.offline_time = $event),
608
+ "onUpdate:modelValue": _cache[18] || (_cache[18] = ($event) => form.value.offline_time = $event),
585
609
  "disabled-date": disabledEndTime,
586
610
  "time-picker-props": { defaultValue: "12:00:00" },
587
611
  placeholder: "\u9009\u62E9\u4E0B\u7EBF\u65F6\u95F4",
@@ -592,20 +616,6 @@ const _sfc_main = defineComponent({
592
616
  _: 1
593
617
  })
594
618
  ], 64)) : createCommentVNode("v-if", true),
595
- createVNode(unref(FormItem), {
596
- key: "statement",
597
- class: "horizontal",
598
- field: "statement",
599
- label: "\u539F\u521B\u58F0\u660E"
600
- }, {
601
- default: withCtx(() => [
602
- createVNode(unref(Switch), {
603
- modelValue: form.value.statement,
604
- "onUpdate:modelValue": _cache[18] || (_cache[18] = ($event) => form.value.statement = $event)
605
- }, null, 8, ["modelValue"])
606
- ]),
607
- _: 1
608
- }),
609
619
  createVNode(unref(FormItem), {
610
620
  key: "ori_count",
611
621
  class: "horizontal",
package/es/index.css CHANGED
@@ -2610,11 +2610,11 @@
2610
2610
  -webkit-line-clamp: 2;
2611
2611
  -webkit-box-orient: vertical;
2612
2612
  }
2613
- .medialist-doc-item-view .info-view .title:hover {
2613
+ .medialist-doc-item-view .info-view .title .text:hover {
2614
2614
  color: #4886ff;
2615
2615
  text-decoration: underline;
2616
2616
  }
2617
- .medialist-doc-item-view .info-view .title:hover .index {
2617
+ .medialist-doc-item-view .info-view .title .text:hover .index {
2618
2618
  text-decoration: unset;
2619
2619
  }
2620
2620
  .medialist-doc-item-view .info-view .abttrite-v {
@@ -1,6 +1,6 @@
1
1
  import { defineComponent, ref, provide, computed, watch, nextTick, openBlock, createElementBlock, createCommentVNode, createElementVNode, normalizeClass, normalizeStyle, toDisplayString, Fragment, renderList, createBlock, createVNode, unref, withCtx, createTextVNode } from "vue";
2
2
  import { RadioGroup, Radio, Switch } from "@arco-design/web-vue";
3
- import { docThumbObjMap, docThumbArrMap, docThumbRatioMap } from "../utils/doc.js";
3
+ import { docThumbObjMap, docThumbArrMap } from "../utils/doc.js";
4
4
  import _sfc_main$3 from "../resourceModal/component.js";
5
5
  import _sfc_main$4 from "../imageCrop/component.js";
6
6
  import _sfc_main$1 from "./components/card.js";
@@ -87,7 +87,7 @@ 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
- const useCropper = ref(props.cropper || false);
90
+ ref(props.cropper || false);
91
91
  const oldData = ref(null);
92
92
  const styleData = ref({});
93
93
  const thumbBannerModel = ref("banner");
@@ -242,64 +242,29 @@ const _sfc_main = defineComponent({
242
242
  ].includes(series);
243
243
  });
244
244
  const submitCallback = (data) => {
245
- var _a, _b, _c, _d;
246
- const isPcBaner = props.mode === "doc" && thumbBannerModel.value === "pcBanner" && !docSeriesShowTopThemeColor.value;
247
- const _useCropper = ["thumb", "doc"].includes(props.mode) ? true : useCropper.value;
248
- if (["smiple", "thumbs"].includes(props.mode)) {
249
- dialogMediaSelectionShow.value = false;
250
- const media = data[0];
251
- const temp = JSON.parse(JSON.stringify(styleData.value.data || []));
252
- temp[thumbOptionIndex.value] = { url: media.url, thumb: media.url };
253
- styleData.value.data = temp;
254
- callback(styleData.value);
255
- } else if (isPcBaner || !_useCropper) {
256
- dialogMediaSelectionShow.value = false;
245
+ if (thumbBannerModel.value === "pc_banner" && !docSeriesShowTopThemeColor.value) {
257
246
  data.map(async (media) => {
258
247
  const { width, height } = await loadImage(media.url);
259
248
  styleData.value.pc_banner_url = `${media.url}?width=${width}&height=${height}`;
260
249
  styleData.value.pc_banner_url_info = JSON.stringify({ width, height });
261
- callback(styleData.value);
262
- return media;
263
250
  });
264
- } else {
265
- cropperData.value = [].concat(data);
266
- if (thumbBannerModel.value === "banner") {
267
- aspectRatioProp.value = ((_a = props.cropperRatios) == null ? void 0 : _a[1]) || docThumbRatioMap()[2];
268
- }
269
- if (thumbBannerModel.value === "pcBanner" && docSeriesShowTopThemeColor.value) {
270
- aspectRatioProp.value = ((_b = props.cropperRatios) == null ? void 0 : _b[2]) || docThumbRatioMap()[2];
271
- }
272
- if (thumbBannerModel.value === "thumb") {
273
- aspectRatioProp.value = ((_c = props.cropperRatios) == null ? void 0 : _c[0]) || docThumbRatioMap()[model.value];
274
- if (data.length) {
275
- const media = data[0];
276
- const wh = [];
277
- (_d = media.metas) == null ? void 0 : _d.map((item) => {
278
- if (item.key === "width")
279
- wh.unshift(parseInt(item.value, 10));
280
- if (item.key === "height")
281
- wh.push(parseInt(item.value, 10));
282
- return item;
283
- });
284
- if (wh.length === 2 && Math.abs(wh[0] / wh[1] - curtemplate.value.ratio) <= 0.05) {
285
- const [width, height] = wh;
286
- const temp = JSON.parse(JSON.stringify(styleData.value.data || []));
287
- temp[thumbOptionIndex.value] = {
288
- url: `${media.url}?width=${width}&height=${height}`,
289
- thumb: `${media.url}?width=${width}&height=${height}`
290
- };
291
- styleData.value.data = temp;
292
- callback(styleData.value);
293
- dialogMediaSelectionShow.value = false;
294
- return false;
295
- }
296
- }
251
+ } else if (thumbBannerModel.value === "thumb") {
252
+ let temp = [];
253
+ if (model.value === "1") {
254
+ temp = JSON.parse(JSON.stringify(styleData.value.data));
255
+ temp[thumbOptionIndex.value] = { url: data[0].url, thumb: data[0].url };
256
+ } else {
257
+ temp = [{ url: data[0].url, thumb: data[0].url }];
297
258
  }
298
- setTimeout(() => {
299
- dialogCropperShow.value = true;
300
- }, 300);
259
+ styleData.value.data = temp;
260
+ } else if (thumbBannerModel.value === "banner") {
261
+ styleData.value.banner_url = data[0].url;
262
+ } else {
263
+ styleData.value.top_image_url = data[0].url;
264
+ styleData.value.pc_banner_url = data[0].url;
301
265
  }
302
- return true;
266
+ callback(styleData.value);
267
+ dialogMediaSelectionShow.value = false;
303
268
  };
304
269
  const cropConfirm = (data) => {
305
270
  dialogMediaSelectionShow.value = false;
package/es/utils/doc.js CHANGED
@@ -44,14 +44,6 @@ const docThumbObjMap = {
44
44
  5: { alias: "\u7AD6\u56FE", maxLength: 1, value: "5", ratioStr: "3:4", ratio: 3 / 4 },
45
45
  7: { alias: "\u7A84\u56FE", maxLength: 1, value: "7", ratioStr: "4:1", ratio: 4 / 1 }
46
46
  };
47
- const docThumbRatioMap = () => {
48
- const obj = {};
49
- Object.keys(docThumbObjMap).map((key) => {
50
- obj[key] = docThumbObjMap[key].ratio;
51
- return {};
52
- });
53
- return obj;
54
- };
55
47
  const docThumbArrMap = () => {
56
48
  return Object.values(docThumbObjMap);
57
49
  };
@@ -115,4 +107,4 @@ function getDocThumb(item) {
115
107
  }
116
108
  return item.cover && item.cover.data && item.cover.data[0] && item.cover.data[0].thumb;
117
109
  }
118
- export { approvalItem, docPubStateMap, docSeries, docStateMap, docThumbArrMap, docThumbMap, docThumbObjMap, docThumbRatioMap, docThumbTypeMap, getDocThumb, stateOptions, typeOptions };
110
+ export { approvalItem, docPubStateMap, docSeries, docStateMap, docThumbArrMap, docThumbMap, docThumbObjMap, docThumbTypeMap, getDocThumb, stateOptions, typeOptions };