@cmstops/pro-compo 0.3.9 → 0.3.10

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.
@@ -118,11 +118,11 @@ const _sfc_main = defineComponent({
118
118
  ]),
119
119
  createElementVNode("div", _hoisted_4, [
120
120
  createElementVNode("div", _hoisted_5, [
121
+ renderSlot(_ctx.$slots, "index"),
121
122
  createVNode(_sfc_main$1, {
122
123
  item: _ctx.item,
123
124
  BASE_API: _ctx.BASE_API
124
125
  }, null, 8, ["item", "BASE_API"]),
125
- renderSlot(_ctx.$slots, "index"),
126
126
  createElementVNode("span", {
127
127
  class: "text",
128
128
  onClick: clickTitle
@@ -1,7 +1,6 @@
1
1
  import { defineComponent, ref, computed, onMounted, onBeforeUnmount, openBlock, createElementBlock, createCommentVNode, createElementVNode, Fragment, createVNode, unref, withCtx, renderList, createBlock, toDisplayString, createTextVNode, nextTick } from "vue";
2
2
  import { Select, Option, Button, Message } from "@arco-design/web-vue";
3
3
  import { IconQrcode } from "@arco-design/web-vue/es/icon";
4
- import "html2canvas";
5
4
  import QRCode from "qrcodejs2-fix";
6
5
  import { getSpaceDate } from "../../../../utils/date.js";
7
6
  import { generateDocPreviewLink } from "../../../script/api.js";
@@ -85,6 +84,62 @@ const _sfc_main = defineComponent({
85
84
  return true;
86
85
  return flag;
87
86
  });
87
+ const clip = (data) => {
88
+ try {
89
+ const input = document.createElement("input");
90
+ input.setAttribute("value", data);
91
+ document.body.appendChild(input);
92
+ input.select();
93
+ document.execCommand("copy");
94
+ document.body.removeChild(input);
95
+ Message.success({
96
+ content: "\u5DF2\u4FDD\u5B58\u5230\u7C98\u8D34\u677F"
97
+ });
98
+ } catch (e) {
99
+ console.log(e);
100
+ Message.success({
101
+ content: `\u4FDD\u5B58\u5931\u8D25`
102
+ });
103
+ }
104
+ };
105
+ const clipUrl = async (type) => {
106
+ if (!dataInfo.value.share.share_url)
107
+ return;
108
+ if (type === "text") {
109
+ clip(dataInfo.value.share.share_url);
110
+ } else {
111
+ const img = document.querySelector(`#${dynamicQRId.value} img`);
112
+ if (!img)
113
+ return;
114
+ const response = await fetch(img.src);
115
+ const blob = await response.blob();
116
+ if (!blob)
117
+ return;
118
+ try {
119
+ if (window.__POWERED_BY_WUJIE__) {
120
+ await window.parent.navigator.clipboard.write([
121
+ new ClipboardItem({
122
+ "image/png": blob
123
+ })
124
+ ]);
125
+ } else {
126
+ await navigator.clipboard.write([
127
+ new ClipboardItem({
128
+ "image/png": blob
129
+ })
130
+ ]);
131
+ }
132
+ Message.success({
133
+ content: "\u5DF2\u4FDD\u5B58\u5230\u7C98\u8D34\u677F"
134
+ });
135
+ } catch (e) {
136
+ console.log(e);
137
+ Message.success({
138
+ content: `\u4FDD\u5B58\u5931\u8D25`
139
+ });
140
+ }
141
+ }
142
+ };
88
143
  const genTimeLink = async (expiration2, force = true, tip = true) => {
89
144
  emit("changeLoading", true);
90
145
  const data = {
@@ -171,11 +226,11 @@ const _sfc_main = defineComponent({
171
226
  placeholder: "\u8BF7\u9009\u62E9"
172
227
  }, {
173
228
  default: withCtx(() => [
174
- (openBlock(true), createElementBlock(Fragment, null, renderList(expirationOptions.value, (time2, index) => {
229
+ (openBlock(true), createElementBlock(Fragment, null, renderList(expirationOptions.value, (t, index) => {
175
230
  return openBlock(), createBlock(unref(Option), {
176
231
  key: index,
177
- label: time2.label,
178
- value: time2.value
232
+ label: t.label,
233
+ value: t.value
179
234
  }, null, 8, ["label", "value"]);
180
235
  }), 128))
181
236
  ]),
@@ -183,7 +238,7 @@ const _sfc_main = defineComponent({
183
238
  }, 8, ["modelValue"])
184
239
  ])
185
240
  ])),
186
- is_share.value && time.value ? (openBlock(), createElementBlock("div", _hoisted_10, "\u94FE\u63A5\u5269\u4F59\u65F6\u95F4: " + toDisplayString(time.value), 1)) : is_share.value && time.value === 0 ? (openBlock(), createElementBlock("div", _hoisted_11, "\u94FE\u63A5\u5DF2\u8FC7\u671F")) : createCommentVNode("v-if", true),
241
+ is_share.value && time.value ? (openBlock(), createElementBlock("div", _hoisted_10, " \u94FE\u63A5\u5269\u4F59\u65F6\u95F4: " + toDisplayString(time.value), 1)) : is_share.value && time.value === 0 ? (openBlock(), createElementBlock("div", _hoisted_11, "\u94FE\u63A5\u5DF2\u8FC7\u671F")) : createCommentVNode("v-if", true),
187
242
  createElementVNode("div", _hoisted_12, [
188
243
  showGetLink.value ? (openBlock(), createBlock(unref(Button), {
189
244
  key: 0,
@@ -192,12 +247,31 @@ const _sfc_main = defineComponent({
192
247
  onClick: _cache[1] || (_cache[1] = ($event) => genTimeLink(expiration.value))
193
248
  }, {
194
249
  default: withCtx(() => [
195
- createTextVNode("\u751F\u6210\u9884\u89C8\u94FE\u63A5")
250
+ createTextVNode(" \u751F\u6210\u9884\u89C8\u94FE\u63A5 ")
196
251
  ]),
197
252
  _: 1
198
253
  })) : (openBlock(), createElementBlock(Fragment, { key: 1 }, [
199
- createCommentVNode("v-if", true),
200
- createCommentVNode("v-if", true)
254
+ createVNode(unref(Button), {
255
+ class: "auto",
256
+ light: "",
257
+ onClick: _cache[2] || (_cache[2] = ($event) => clipUrl("img"))
258
+ }, {
259
+ default: withCtx(() => [
260
+ createTextVNode(" \u590D\u5236\u4E8C\u7EF4\u7801 ")
261
+ ]),
262
+ _: 1
263
+ }),
264
+ createVNode(unref(Button), {
265
+ class: "auto",
266
+ type: "primary",
267
+ light: "",
268
+ onClick: _cache[3] || (_cache[3] = ($event) => clipUrl("text"))
269
+ }, {
270
+ default: withCtx(() => [
271
+ createTextVNode(toDisplayString(time.value ? "\u590D\u5236\u9884\u89C8\u5730\u5740" : "\u590D\u5236\u8BBF\u95EE\u5730\u5740"), 1)
272
+ ]),
273
+ _: 1
274
+ })
201
275
  ], 64))
202
276
  ])
203
277
  ])
@@ -218,9 +218,14 @@ const _sfc_main = defineComponent({
218
218
  }
219
219
  return modelList.value.find((item) => item.value === model.value);
220
220
  });
221
- const thumbList = computed(() => {
222
- var _a;
223
- return ((_a = styleData.value) == null ? void 0 : _a.data) || [];
221
+ const thumbList = computed({
222
+ get() {
223
+ var _a;
224
+ return ((_a = styleData.value) == null ? void 0 : _a.data) || [];
225
+ },
226
+ set(value) {
227
+ styleData.value.data = value || [];
228
+ }
224
229
  });
225
230
  const previewList = computed(() => {
226
231
  return thumbList.value.map((item) => item.url);
@@ -314,9 +319,14 @@ const _sfc_main = defineComponent({
314
319
  }
315
320
  callback(styleData.value);
316
321
  };
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 };
322
+ const banner = computed({
323
+ get() {
324
+ const { banner: banner2, banner_theme_color, banner_url } = styleData.value;
325
+ return { banner: banner2, banner_theme_color, url: banner_url };
326
+ },
327
+ set(value) {
328
+ styleData.value.banner_url = value.url;
329
+ }
320
330
  });
321
331
  const hasBanner = computed({
322
332
  get() {
@@ -328,9 +338,14 @@ const _sfc_main = defineComponent({
328
338
  callback(styleData.value);
329
339
  }
330
340
  });
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 };
341
+ const pcBanner = computed({
342
+ get() {
343
+ const { pc_banner_url_info, pc_banner_url } = styleData.value;
344
+ return { pc_banner_url_info, url: pc_banner_url };
345
+ },
346
+ set(value) {
347
+ styleData.value.pc_banner_url = value.url;
348
+ }
334
349
  });
335
350
  const colorChange = (styleData2) => {
336
351
  callback(styleData2);
@@ -17,7 +17,13 @@ const _sfc_main = defineComponent({
17
17
  model: {},
18
18
  changeThumbModel: { type: Function }
19
19
  },
20
- emits: ["open", "remove", "uploadLocal", "update:data"],
20
+ emits: [
21
+ "open",
22
+ "remove",
23
+ "change",
24
+ "uploadLocal",
25
+ "update:data"
26
+ ],
21
27
  setup(__props, { emit: __emit }) {
22
28
  const waterBg = `${DEFAULT_BASE_API}/static/images/waterBg.png`;
23
29
  const props = __props;
@@ -41,9 +47,12 @@ const _sfc_main = defineComponent({
41
47
  };
42
48
  const loaclUpload = () => {
43
49
  emit("uploadLocal", (file) => {
44
- const { data } = props;
45
- if (!data || !file)
50
+ let { data } = props;
51
+ if (!file)
46
52
  return;
53
+ if (!data) {
54
+ data = {};
55
+ }
47
56
  data.url = file.url;
48
57
  emit("update:data", data);
49
58
  });
@@ -57,7 +66,7 @@ const _sfc_main = defineComponent({
57
66
  return (_ctx, _cache) => {
58
67
  return openBlock(), createBlock(unref(Popover), {
59
68
  trigger: "hover",
60
- "content-style": "padding: 0;"
69
+ "content-style": { padding: 0 }
61
70
  }, {
62
71
  content: withCtx(() => [
63
72
  createElementVNode("div", {
@@ -70,7 +79,7 @@ const _sfc_main = defineComponent({
70
79
  }, "\u672C\u5730\u4E0A\u4F20", 4)
71
80
  ]),
72
81
  default: withCtx(() => {
73
- var _a, _b;
82
+ var _a;
74
83
  return [
75
84
  createElementVNode("div", {
76
85
  class: normalizeClass(["thumb-card-container", classObj.value])
@@ -79,7 +88,8 @@ const _sfc_main = defineComponent({
79
88
  createVNode(unref(Image), {
80
89
  class: "item",
81
90
  fit: "cover",
82
- src: (_b = props.data) == null ? void 0 : _b.url
91
+ src: props.data.url,
92
+ "show-loader": ""
83
93
  }, null, 8, ["src"]),
84
94
  createVNode(Transition, { name: "fade" }, {
85
95
  default: withCtx(() => [
@@ -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
  ])
@@ -219,9 +219,14 @@ const _sfc_main = vue.defineComponent({
219
219
  }
220
220
  return modelList.value.find((item) => item.value === model.value);
221
221
  });
222
- const thumbList = vue.computed(() => {
223
- var _a;
224
- return ((_a = styleData.value) == null ? void 0 : _a.data) || [];
222
+ const thumbList = vue.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
+ }
225
230
  });
226
231
  const previewList = vue.computed(() => {
227
232
  return thumbList.value.map((item) => item.url);
@@ -315,9 +320,14 @@ const _sfc_main = vue.defineComponent({
315
320
  }
316
321
  callback(styleData.value);
317
322
  };
318
- const banner = vue.computed(() => {
319
- const { banner: banner2, banner_theme_color, banner_url } = styleData.value;
320
- return { banner: banner2, banner_theme_color, url: banner_url };
323
+ const banner = vue.computed({
324
+ get() {
325
+ const { banner: banner2, banner_theme_color, banner_url } = styleData.value;
326
+ return { banner: banner2, banner_theme_color, url: banner_url };
327
+ },
328
+ set(value) {
329
+ styleData.value.banner_url = value.url;
330
+ }
321
331
  });
322
332
  const hasBanner = vue.computed({
323
333
  get() {
@@ -329,9 +339,14 @@ const _sfc_main = vue.defineComponent({
329
339
  callback(styleData.value);
330
340
  }
331
341
  });
332
- const pcBanner = vue.computed(() => {
333
- const { pc_banner_url_info, pc_banner_url } = styleData.value;
334
- return { pc_banner_url_info, url: pc_banner_url };
342
+ const pcBanner = vue.computed({
343
+ get() {
344
+ const { pc_banner_url_info, pc_banner_url } = styleData.value;
345
+ return { pc_banner_url_info, url: pc_banner_url };
346
+ },
347
+ set(value) {
348
+ styleData.value.pc_banner_url = value.url;
349
+ }
335
350
  });
336
351
  const colorChange = (styleData2) => {
337
352
  callback(styleData2);
@@ -18,7 +18,13 @@ const _sfc_main = vue.defineComponent({
18
18
  model: {},
19
19
  changeThumbModel: { type: Function }
20
20
  },
21
- emits: ["open", "remove", "uploadLocal", "update:data"],
21
+ emits: [
22
+ "open",
23
+ "remove",
24
+ "change",
25
+ "uploadLocal",
26
+ "update:data"
27
+ ],
22
28
  setup(__props, { emit: __emit }) {
23
29
  const waterBg = `${config.DEFAULT_BASE_API}/static/images/waterBg.png`;
24
30
  const props = __props;
@@ -42,9 +48,12 @@ const _sfc_main = vue.defineComponent({
42
48
  };
43
49
  const loaclUpload = () => {
44
50
  emit("uploadLocal", (file) => {
45
- const { data } = props;
46
- if (!data || !file)
51
+ let { data } = props;
52
+ if (!file)
47
53
  return;
54
+ if (!data) {
55
+ data = {};
56
+ }
48
57
  data.url = file.url;
49
58
  emit("update:data", data);
50
59
  });
@@ -58,7 +67,7 @@ const _sfc_main = vue.defineComponent({
58
67
  return (_ctx, _cache) => {
59
68
  return vue.openBlock(), vue.createBlock(vue.unref(webVue.Popover), {
60
69
  trigger: "hover",
61
- "content-style": "padding: 0;"
70
+ "content-style": { padding: 0 }
62
71
  }, {
63
72
  content: vue.withCtx(() => [
64
73
  vue.createElementVNode("div", {
@@ -71,7 +80,7 @@ const _sfc_main = vue.defineComponent({
71
80
  }, "\u672C\u5730\u4E0A\u4F20", 4)
72
81
  ]),
73
82
  default: vue.withCtx(() => {
74
- var _a, _b;
83
+ var _a;
75
84
  return [
76
85
  vue.createElementVNode("div", {
77
86
  class: vue.normalizeClass(["thumb-card-container", classObj.value])
@@ -80,7 +89,8 @@ const _sfc_main = vue.defineComponent({
80
89
  vue.createVNode(vue.unref(webVue.Image), {
81
90
  class: "item",
82
91
  fit: "cover",
83
- src: (_b = props.data) == null ? void 0 : _b.url
92
+ src: props.data.url,
93
+ "show-loader": ""
84
94
  }, null, 8, ["src"]),
85
95
  vue.createVNode(vue.Transition, { name: "fade" }, {
86
96
  default: vue.withCtx(() => [
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@cmstops/pro-compo",
3
- "version": "0.3.9",
3
+ "version": "0.3.10",
4
4
  "description": "",
5
5
  "keywords": [
6
6
  "vue",