@cmstops/pro-compo 0.3.3 → 0.3.4

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.
Files changed (33) hide show
  1. package/dist/index.css +83 -0
  2. package/dist/index.min.css +1 -1
  3. package/es/contentDetailList/component.js +12 -5
  4. package/es/contentDetailList/components/Content/DocItem/index.js +14 -8
  5. package/es/contentDetailList/components/Content/index.js +4 -2
  6. package/es/contentDetailList/components/Doc/index.js +4 -2
  7. package/es/contentDetailList/components/ShowQRCode/QrcodeView/index.d.ts +0 -0
  8. package/es/contentDetailList/components/ShowQRCode/QrcodeView/index.js +265 -0
  9. package/es/contentDetailList/components/ShowQRCode/index.d.ts +0 -0
  10. package/es/contentDetailList/components/ShowQRCode/index.js +66 -0
  11. package/es/contentDetailList/script/api.d.ts +6 -0
  12. package/es/contentDetailList/script/api.js +16 -0
  13. package/es/contentDetailList/style/QrCodeView.less +93 -0
  14. package/es/contentDetailList/style/ShowQRCode.less +3 -0
  15. package/es/contentDetailList/style/index.css +83 -0
  16. package/es/contentDetailList/style/index.less +2 -0
  17. package/es/index.css +83 -0
  18. package/es/utils/date.d.ts +3 -0
  19. package/es/utils/date.js +27 -0
  20. package/lib/contentDetailList/component.js +12 -5
  21. package/lib/contentDetailList/components/Content/DocItem/index.js +9 -3
  22. package/lib/contentDetailList/components/Content/index.js +4 -2
  23. package/lib/contentDetailList/components/Doc/index.js +4 -2
  24. package/lib/contentDetailList/components/ShowQRCode/QrcodeView/index.js +271 -0
  25. package/lib/contentDetailList/components/ShowQRCode/index.js +67 -0
  26. package/lib/contentDetailList/script/api.js +19 -0
  27. package/lib/contentDetailList/style/QrCodeView.less +93 -0
  28. package/lib/contentDetailList/style/ShowQRCode.less +3 -0
  29. package/lib/contentDetailList/style/index.css +83 -0
  30. package/lib/contentDetailList/style/index.less +2 -0
  31. package/lib/index.css +83 -0
  32. package/lib/utils/date.js +29 -0
  33. package/package.json +5 -2
@@ -0,0 +1,27 @@
1
+ function tow(n) {
2
+ return n >= 0 && n < 10 ? `0${n}` : `${n}`;
3
+ }
4
+ function need(value, label) {
5
+ if (!value)
6
+ return "";
7
+ return tow(value) + label;
8
+ }
9
+ function getSpaceDate(date) {
10
+ const oDate = new Date();
11
+ const oldTime = oDate.getTime();
12
+ const newDate = new Date(date);
13
+ const newTime = newDate.getTime();
14
+ let second = Math.floor((newTime - oldTime) / 1e3);
15
+ if (second <= 0) {
16
+ return 0;
17
+ }
18
+ const day = Math.floor(second / 86400);
19
+ second %= 86400;
20
+ const hour = Math.floor(second / 3600);
21
+ second %= 3600;
22
+ const minute = Math.floor(second / 60);
23
+ second %= 60;
24
+ const str = `${need(day, "\u5929") + need(hour, "\u5C0F\u65F6") + need(minute, "\u5206\u949F") + tow(second)}\u79D2`;
25
+ return str;
26
+ }
27
+ export { getSpaceDate };
@@ -2,6 +2,7 @@
2
2
  var vue = require("vue");
3
3
  var webVue = require("@arco-design/web-vue");
4
4
  var draggable = require("vuedraggable");
5
+ var config = require("../config.js");
5
6
  var index = require("./components/Content/index.js");
6
7
  var index$1 = require("./components/Doc/index.js");
7
8
  var index$2 = require("./components/Records/index.js");
@@ -22,7 +23,8 @@ const _sfc_main = vue.defineComponent({
22
23
  parmas: {},
23
24
  dragalbe: { type: Boolean },
24
25
  abttrites: {},
25
- extraAttrs: {}
26
+ extraAttrs: {},
27
+ BASE_API: {}
26
28
  },
27
29
  emits: [
28
30
  "sortChange",
@@ -40,6 +42,7 @@ const _sfc_main = vue.defineComponent({
40
42
  const parmasProps = props.parmas || {};
41
43
  const dragalbeProps = props.dragalbe || false;
42
44
  const abttritesProps = props.abttrites || [];
45
+ const BASE_API_R = props.BASE_API || config.DEFAULT_BASE_API;
43
46
  const outerStyle = vue.computed(() => {
44
47
  return {
45
48
  height: props.height || "100%",
@@ -101,6 +104,7 @@ const _sfc_main = vue.defineComponent({
101
104
  parmas: vue.unref(parmasProps),
102
105
  abttrites: vue.unref(abttritesProps),
103
106
  extraAttrs: _ctx.extraAttrs,
107
+ BASE_API: vue.unref(BASE_API_R),
104
108
  onClickTitle: clickTitle,
105
109
  onCellMouseEnter: tableCellMouseEnter,
106
110
  onCellMouseLeave: tableCellMouseLeave
@@ -118,12 +122,13 @@ const _sfc_main = vue.defineComponent({
118
122
  })
119
123
  ]),
120
124
  _: 2
121
- }, 1032, ["item", "index", "parmas", "abttrites", "extraAttrs"])) : props.type === "doc" ? (vue.openBlock(), vue.createBlock(index$1, {
125
+ }, 1032, ["item", "index", "parmas", "abttrites", "extraAttrs", "BASE_API"])) : props.type === "doc" ? (vue.openBlock(), vue.createBlock(index$1, {
122
126
  key: index$4,
123
127
  item: element,
124
128
  index: index$4,
125
129
  abttrites: vue.unref(abttritesProps),
126
130
  extraAttrs: _ctx.extraAttrs,
131
+ BASE_API: vue.unref(BASE_API_R),
127
132
  onClickTitle: clickTitle,
128
133
  onCellMouseEnter: tableCellMouseEnter,
129
134
  onCellMouseLeave: tableCellMouseLeave
@@ -147,7 +152,7 @@ const _sfc_main = vue.defineComponent({
147
152
  })
148
153
  ]),
149
154
  _: 2
150
- }, 1032, ["item", "index", "abttrites", "extraAttrs"])) : props.type === "record" ? (vue.openBlock(), vue.createBlock(index$2, {
155
+ }, 1032, ["item", "index", "abttrites", "extraAttrs", "BASE_API"])) : props.type === "record" ? (vue.openBlock(), vue.createBlock(index$2, {
151
156
  key: index$4,
152
157
  item: element,
153
158
  index: index$4,
@@ -213,6 +218,7 @@ const _sfc_main = vue.defineComponent({
213
218
  parmas: vue.unref(parmasProps),
214
219
  abttrites: vue.unref(abttritesProps),
215
220
  extraAttrs: _ctx.extraAttrs,
221
+ BASE_API: vue.unref(BASE_API_R),
216
222
  onClickTitle: clickTitle,
217
223
  onCellMouseEnter: tableCellMouseEnter,
218
224
  onCellMouseLeave: tableCellMouseLeave
@@ -230,12 +236,13 @@ const _sfc_main = vue.defineComponent({
230
236
  })
231
237
  ]),
232
238
  _: 2
233
- }, 1032, ["item", "index", "parmas", "abttrites", "extraAttrs"])) : props.type === "doc" ? (vue.openBlock(), vue.createBlock(index$1, {
239
+ }, 1032, ["item", "index", "parmas", "abttrites", "extraAttrs", "BASE_API"])) : props.type === "doc" ? (vue.openBlock(), vue.createBlock(index$1, {
234
240
  key: index$4,
235
241
  item,
236
242
  index: index$4,
237
243
  abttrites: vue.unref(abttritesProps),
238
244
  extraAttrs: _ctx.extraAttrs,
245
+ BASE_API: vue.unref(BASE_API_R),
239
246
  onClickTitle: clickTitle,
240
247
  onCellMouseEnter: tableCellMouseEnter,
241
248
  onCellMouseLeave: tableCellMouseLeave
@@ -259,7 +266,7 @@ const _sfc_main = vue.defineComponent({
259
266
  })
260
267
  ]),
261
268
  _: 2
262
- }, 1032, ["item", "index", "abttrites", "extraAttrs"])) : props.type === "record" ? (vue.openBlock(), vue.createBlock(index$2, {
269
+ }, 1032, ["item", "index", "abttrites", "extraAttrs", "BASE_API"])) : props.type === "record" ? (vue.openBlock(), vue.createBlock(index$2, {
263
270
  key: index$4,
264
271
  item,
265
272
  index: index$4,
@@ -4,9 +4,10 @@ var webVue = require("@arco-design/web-vue");
4
4
  var index = require("../../../../utils/index.js");
5
5
  var doc = require("../../../../utils/doc.js");
6
6
  var typeMap = require("../../../../utils/typeMap.js");
7
+ var index$1 = require("../../ShowQRCode/index.js");
7
8
  var component = require("../../../../typeIcons/component.js");
8
9
  var component$1 = require("../../../../dataTags/component.js");
9
- var index$1 = require("./ApprovalStateMap/index.js");
10
+ var index$2 = require("./ApprovalStateMap/index.js");
10
11
  const _hoisted_1 = { class: "cover-view" };
11
12
  const _hoisted_2 = {
12
13
  key: 1,
@@ -33,6 +34,7 @@ const _sfc_main = vue.defineComponent({
33
34
  props: {
34
35
  item: {},
35
36
  abttrites: {},
37
+ BASE_API: {},
36
38
  extraAttrs: {}
37
39
  },
38
40
  emits: ["clickTitle", "cellMouseEnter", "cellMouseLeave"],
@@ -119,8 +121,12 @@ const _sfc_main = vue.defineComponent({
119
121
  class: "title",
120
122
  onClick: clickTitle
121
123
  }, [
124
+ vue.createVNode(index$1, {
125
+ item: _ctx.item,
126
+ BASE_API: _ctx.BASE_API
127
+ }, null, 8, ["item", "BASE_API"]),
122
128
  vue.renderSlot(_ctx.$slots, "index"),
123
- vue.createTextVNode(vue.toDisplayString(_ctx.item.alias || _ctx.item.title), 1)
129
+ vue.createTextVNode(" " + vue.toDisplayString(_ctx.item.alias || _ctx.item.title), 1)
124
130
  ]),
125
131
  vue.createElementVNode("div", _hoisted_5, [
126
132
  vue.createElementVNode("div", _hoisted_6, [
@@ -141,7 +147,7 @@ const _sfc_main = vue.defineComponent({
141
147
  vue.createCommentVNode(" \u5BA1\u6838\u72B6\u6001 "),
142
148
  column.key === "approval_status" ? (vue.openBlock(), vue.createElementBlock("span", _hoisted_8, [
143
149
  _hoisted_9,
144
- vue.unref(doc.approvalItem)(_ctx.item) ? (vue.openBlock(), vue.createBlock(index$1, {
150
+ vue.unref(doc.approvalItem)(_ctx.item) ? (vue.openBlock(), vue.createBlock(index$2, {
145
151
  key: 0,
146
152
  item: vue.unref(doc.approvalItem)(_ctx.item)
147
153
  }, null, 8, ["item"])) : (vue.openBlock(), vue.createElementBlock("span", _hoisted_10, "--"))
@@ -98,7 +98,8 @@ const _sfc_main = vue.defineComponent({
98
98
  index: {},
99
99
  abttrites: {},
100
100
  extraAttrs: {},
101
- parmas: {}
101
+ parmas: {},
102
+ BASE_API: {}
102
103
  },
103
104
  emits: [
104
105
  "cellMouseEnter",
@@ -128,6 +129,7 @@ const _sfc_main = vue.defineComponent({
128
129
  item: { ..._ctx.item, index: _ctx.index },
129
130
  abttrites: _ctx.abttrites,
130
131
  extraAttrs: _ctx.extraAttrs,
132
+ BASE_API: _ctx.BASE_API,
131
133
  onClickTitle: clickTitle,
132
134
  onCellMouseEnter: cellMouseEnter,
133
135
  onCellMouseLeave: cellMouseLeave
@@ -164,7 +166,7 @@ const _sfc_main = vue.defineComponent({
164
166
  })
165
167
  ]),
166
168
  _: 3
167
- }, 8, ["item", "abttrites", "extraAttrs"])) : _ctx.item.catalog === "contentList" && _ctx.item.list_type === 7 && _ctx.item.target_type === 6 ? (vue.openBlock(), vue.createElementBlock(vue.Fragment, { key: 1 }, [
169
+ }, 8, ["item", "abttrites", "extraAttrs", "BASE_API"])) : _ctx.item.catalog === "contentList" && _ctx.item.list_type === 7 && _ctx.item.target_type === 6 ? (vue.openBlock(), vue.createElementBlock(vue.Fragment, { key: 1 }, [
168
170
  vue.createCommentVNode(" \u7EC4\u4EF6 "),
169
171
  (vue.openBlock(), vue.createBlock(index$1, {
170
172
  key: `compo-${_ctx.item.post_id}`,
@@ -7,7 +7,8 @@ const _sfc_main = vue.defineComponent({
7
7
  abttrites: {},
8
8
  extraAttrs: {},
9
9
  item: {},
10
- index: {}
10
+ index: {},
11
+ BASE_API: {}
11
12
  },
12
13
  emits: ["cellMouseEnter", "cellMouseLeave", "clickTitle"],
13
14
  setup(__props, { emit: __emit }) {
@@ -26,6 +27,7 @@ const _sfc_main = vue.defineComponent({
26
27
  item: _ctx.item,
27
28
  abttrites: _ctx.abttrites,
28
29
  extraAttrs: _ctx.extraAttrs,
30
+ BASE_API: _ctx.BASE_API,
29
31
  onClickTitle: clickTitle,
30
32
  onCellMouseEnter: cellMouseEnter,
31
33
  onCellMouseLeave: cellMouseLeave
@@ -49,7 +51,7 @@ const _sfc_main = vue.defineComponent({
49
51
  })
50
52
  ]),
51
53
  _: 3
52
- }, 8, ["item", "abttrites", "extraAttrs"]);
54
+ }, 8, ["item", "abttrites", "extraAttrs", "BASE_API"]);
53
55
  };
54
56
  }
55
57
  });
@@ -0,0 +1,271 @@
1
+ "use strict";
2
+ var vue = require("vue");
3
+ var webVue = require("@arco-design/web-vue");
4
+ var icon = require("@arco-design/web-vue/es/icon");
5
+ var html2canvas = require("html2canvas");
6
+ var QRCode = require("qrcodejs2");
7
+ var date = require("../../../../utils/date.js");
8
+ var api = require("../../../script/api.js");
9
+ function _interopDefaultLegacy(e) {
10
+ return e && typeof e === "object" && "default" in e ? e : { "default": e };
11
+ }
12
+ var html2canvas__default = /* @__PURE__ */ _interopDefaultLegacy(html2canvas);
13
+ var QRCode__default = /* @__PURE__ */ _interopDefaultLegacy(QRCode);
14
+ const _hoisted_1 = { class: "preview-qrcode-iframe-container-v" };
15
+ const _hoisted_2 = { class: "doc-qrcode-preview-container-v" };
16
+ const _hoisted_3 = ["id"];
17
+ const _hoisted_4 = {
18
+ key: 0,
19
+ class: "qrcode"
20
+ };
21
+ const _hoisted_5 = { class: "no-pub" };
22
+ const _hoisted_6 = {
23
+ key: 1,
24
+ class: "qrcode"
25
+ };
26
+ const _hoisted_7 = {
27
+ key: 2,
28
+ class: "qrcode-hint"
29
+ };
30
+ const _hoisted_8 = {
31
+ key: 3,
32
+ class: "setting"
33
+ };
34
+ const _hoisted_9 = /* @__PURE__ */ vue.createElementVNode("span", { class: "label" }, "\u94FE\u63A5\u6709\u6548\u65F6\u957F", -1);
35
+ const _hoisted_10 = {
36
+ key: 4,
37
+ class: "time-go"
38
+ };
39
+ const _hoisted_11 = {
40
+ key: 5,
41
+ class: "time-go"
42
+ };
43
+ const _hoisted_12 = { class: "btns" };
44
+ const _sfc_main = vue.defineComponent({
45
+ __name: "index",
46
+ props: {
47
+ docData: {},
48
+ BASE_API: {}
49
+ },
50
+ setup(__props) {
51
+ const props = __props;
52
+ const qrcode = vue.ref();
53
+ const dataInfo = vue.ref(null);
54
+ const expirationOptions = vue.ref([
55
+ { label: "1\u5C0F\u65F6", value: 60 * 60 },
56
+ { label: "6\u5C0F\u65F6", value: 60 * 60 * 6 },
57
+ { label: "12\u5C0F\u65F6", value: 60 * 60 * 12 },
58
+ { label: "24\u5C0F\u65F6", value: 60 * 60 * 24 },
59
+ { label: "3\u5929", value: 60 * 60 * 24 * 3 },
60
+ { label: "7\u5929", value: 60 * 60 * 24 * 7 },
61
+ { label: "15\u5929", value: 60 * 60 * 24 * 15 },
62
+ { label: "30\u5929", value: 60 * 60 * 24 * 30 }
63
+ ]);
64
+ const expiration = vue.ref(60 * 60 * 24);
65
+ const loading = vue.ref(false);
66
+ const interval = vue.ref(null);
67
+ const time = vue.ref("");
68
+ const local_url = vue.ref("");
69
+ const is_publish = vue.computed(() => {
70
+ var _a;
71
+ return dataInfo.value && [14, 15, 19].includes((_a = dataInfo.value) == null ? void 0 : _a.state);
72
+ });
73
+ const is_share = vue.computed(() => {
74
+ var _a;
75
+ return (_a = dataInfo == null ? void 0 : dataInfo.value) == null ? void 0 : _a.share;
76
+ });
77
+ const dynamicQRId = vue.computed(() => {
78
+ var _a;
79
+ return `qrcode-${(_a = dataInfo.value) == null ? void 0 : _a.id}`;
80
+ });
81
+ const showGetLink = vue.computed(() => {
82
+ return !is_share.value || !is_publish.value && is_share.value && !is_share.value.expired_at;
83
+ });
84
+ const needLoadQR = vue.computed(() => {
85
+ var _a;
86
+ const flag = false;
87
+ if (is_publish.value)
88
+ return true;
89
+ if (is_share.value && ((_a = is_share.value) == null ? void 0 : _a.expired_at))
90
+ return true;
91
+ return flag;
92
+ });
93
+ const clip = (data) => {
94
+ const clipboard = typeof data === "string" ? navigator.clipboard.writeText(data) : navigator.clipboard.write(data);
95
+ clipboard.then(
96
+ () => {
97
+ webVue.Message.success({
98
+ content: "\u5DF2\u4FDD\u5B58\u5230\u7C98\u8D34\u677F"
99
+ });
100
+ },
101
+ () => {
102
+ webVue.Message.success({
103
+ content: "\u4FDD\u5B58\u5931\u8D25"
104
+ });
105
+ }
106
+ );
107
+ };
108
+ const clipUrl = (type) => {
109
+ if (!dataInfo.value.share.share_url)
110
+ return;
111
+ if (type === "text") {
112
+ clip(dataInfo.value.share.share_url);
113
+ } else {
114
+ const img = document.querySelector(`#${dynamicQRId.value} img`);
115
+ html2canvas__default["default"](img).then((canvas) => {
116
+ canvas.toBlob((blob) => {
117
+ const data = [new ClipboardItem({ [blob.type]: blob })];
118
+ clip(data);
119
+ }, "image/png");
120
+ });
121
+ }
122
+ };
123
+ const genTimeLink = async (expiration2, force = true, tip = true) => {
124
+ loading.value = true;
125
+ const data = {
126
+ force,
127
+ hash_id: dataInfo.value.hash_id || dataInfo.value.hashid
128
+ };
129
+ if (expiration2) {
130
+ data.expiration = expiration2;
131
+ }
132
+ const { code, message } = await api.generateDocPreviewLink(props.BASE_API, data);
133
+ if (code === 0) {
134
+ if (expiration2 || !force) {
135
+ tip && webVue.Message.success("\u94FE\u63A5\u751F\u6210\u6210\u529F");
136
+ dataInfo.value.share = message;
137
+ const reqTime = `${new Date().getTime()}`;
138
+ local_url.value = `${message.inner_url}?reqTime=${reqTime}`;
139
+ vue.nextTick(() => {
140
+ loadQrcode(`${message.inner_url}?reqTime=${reqTime}`);
141
+ setTimeout(() => {
142
+ loading.value = false;
143
+ }, 500);
144
+ });
145
+ } else {
146
+ webVue.Message.success("\u5DF2\u53D6\u6D88\u9884\u89C8\u94FE\u63A5");
147
+ dataInfo.value.share = null;
148
+ qrcode.value.innerHTML = "";
149
+ clearInterval(interval.value);
150
+ interval.value = null;
151
+ time.value = 0;
152
+ }
153
+ } else {
154
+ webVue.Message.error(message);
155
+ }
156
+ };
157
+ const loadQrcode = (url) => {
158
+ new QRCode__default["default"](dynamicQRId.value, {
159
+ width: 200,
160
+ height: 200,
161
+ text: url
162
+ });
163
+ if (dataInfo.value.share.expired_at) {
164
+ interval.value = setInterval(() => {
165
+ time.value = date.getSpaceDate(dataInfo.value.share.expired_at);
166
+ }, 1e3);
167
+ }
168
+ };
169
+ vue.onMounted(() => {
170
+ dataInfo.value = props.docData;
171
+ console.log(1111, dataInfo.value);
172
+ if (needLoadQR.value) {
173
+ genTimeLink(60 * 60 * 24, false, false);
174
+ }
175
+ });
176
+ vue.onBeforeUnmount(() => {
177
+ if (interval.value) {
178
+ clearInterval(interval.value);
179
+ interval.value = null;
180
+ time.value = "";
181
+ }
182
+ });
183
+ return (_ctx, _cache) => {
184
+ return vue.openBlock(), vue.createElementBlock("div", _hoisted_1, [
185
+ vue.createCommentVNode(" \u9884\u89C8\u624B\u673A\u626B\u7801 "),
186
+ vue.createVNode(vue.unref(webVue.Spin), {
187
+ loading: loading.value,
188
+ style: { "width": "100%", "height": "100%" }
189
+ }, {
190
+ default: vue.withCtx(() => [
191
+ vue.createElementVNode("div", _hoisted_2, [
192
+ is_share.value ? (vue.openBlock(), vue.createElementBlock("div", {
193
+ key: 0,
194
+ id: dynamicQRId.value,
195
+ ref_key: "qrcode",
196
+ ref: qrcode,
197
+ class: "qrcode"
198
+ }, null, 8, _hoisted_3)) : (vue.openBlock(), vue.createElementBlock(vue.Fragment, { key: 1 }, [
199
+ !is_publish.value ? (vue.openBlock(), vue.createElementBlock("div", _hoisted_4, [
200
+ vue.createElementVNode("div", _hoisted_5, [
201
+ vue.createVNode(vue.unref(icon.IconQrcode), { size: 200 })
202
+ ])
203
+ ])) : (vue.openBlock(), vue.createElementBlock("div", _hoisted_6, "\u6682\u65E0\u4E8C\u7EF4\u7801"))
204
+ ], 64)),
205
+ is_share.value ? (vue.openBlock(), vue.createElementBlock("div", _hoisted_7, "\u626B\u63CF\u4E8C\u7EF4\u7801\u8BBF\u95EE")) : (vue.openBlock(), vue.createElementBlock("div", _hoisted_8, [
206
+ _hoisted_9,
207
+ vue.createElementVNode("span", null, [
208
+ vue.createVNode(vue.unref(webVue.Select), {
209
+ modelValue: expiration.value,
210
+ "onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => expiration.value = $event),
211
+ size: "mini",
212
+ placeholder: "\u8BF7\u9009\u62E9"
213
+ }, {
214
+ default: vue.withCtx(() => [
215
+ (vue.openBlock(true), vue.createElementBlock(vue.Fragment, null, vue.renderList(expirationOptions.value, (time2, index) => {
216
+ return vue.openBlock(), vue.createBlock(vue.unref(webVue.Option), {
217
+ key: index,
218
+ label: time2.label,
219
+ value: time2.value
220
+ }, null, 8, ["label", "value"]);
221
+ }), 128))
222
+ ]),
223
+ _: 1
224
+ }, 8, ["modelValue"])
225
+ ])
226
+ ])),
227
+ 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),
228
+ vue.createElementVNode("div", _hoisted_12, [
229
+ showGetLink.value ? (vue.openBlock(), vue.createBlock(vue.unref(webVue.Button), {
230
+ key: 0,
231
+ type: "primary",
232
+ light: "",
233
+ onClick: _cache[1] || (_cache[1] = ($event) => genTimeLink(expiration.value))
234
+ }, {
235
+ default: vue.withCtx(() => [
236
+ vue.createTextVNode("\u751F\u6210\u9884\u89C8\u94FE\u63A5")
237
+ ]),
238
+ _: 1
239
+ })) : (vue.openBlock(), vue.createElementBlock(vue.Fragment, { key: 1 }, [
240
+ vue.createVNode(vue.unref(webVue.Button), {
241
+ class: "auto",
242
+ light: "",
243
+ onClick: _cache[2] || (_cache[2] = ($event) => clipUrl("img"))
244
+ }, {
245
+ default: vue.withCtx(() => [
246
+ vue.createTextVNode("\u590D\u5236\u4E8C\u7EF4\u7801")
247
+ ]),
248
+ _: 1
249
+ }),
250
+ vue.createVNode(vue.unref(webVue.Button), {
251
+ class: "auto",
252
+ type: "primary",
253
+ light: "",
254
+ onClick: _cache[3] || (_cache[3] = ($event) => clipUrl("text"))
255
+ }, {
256
+ default: vue.withCtx(() => [
257
+ vue.createTextVNode(vue.toDisplayString(time.value ? "\u590D\u5236\u9884\u89C8\u5730\u5740" : "\u590D\u5236\u8BBF\u95EE\u5730\u5740"), 1)
258
+ ]),
259
+ _: 1
260
+ })
261
+ ], 64))
262
+ ])
263
+ ])
264
+ ]),
265
+ _: 1
266
+ }, 8, ["loading"])
267
+ ]);
268
+ };
269
+ }
270
+ });
271
+ module.exports = _sfc_main;
@@ -0,0 +1,67 @@
1
+ "use strict";
2
+ var vue = require("vue");
3
+ var webVue = require("@arco-design/web-vue");
4
+ var icon = require("@arco-design/web-vue/es/icon");
5
+ var api = require("../../script/api.js");
6
+ var index = require("./QrcodeView/index.js");
7
+ const _hoisted_1 = { class: "qr-code" };
8
+ const _sfc_main = vue.defineComponent({
9
+ __name: "index",
10
+ props: {
11
+ item: {},
12
+ BASE_API: {}
13
+ },
14
+ setup(__props) {
15
+ const props = __props;
16
+ const docData = vue.ref(null);
17
+ const showQR = vue.ref(false);
18
+ const getDocDetail = async () => {
19
+ const { code, message } = await api.getDocDetailsNew(props.BASE_API, {
20
+ hashid: props.item.hashid || props.item.hash_id
21
+ });
22
+ if (code === 0 && message) {
23
+ docData.value = { ...props.item, share: message.preview };
24
+ }
25
+ };
26
+ const openPopover = () => {
27
+ getDocDetail();
28
+ setTimeout(() => {
29
+ showQR.value = true;
30
+ }, 500);
31
+ };
32
+ return (_ctx, _cache) => {
33
+ return vue.openBlock(), vue.createBlock(vue.unref(webVue.Popover), {
34
+ position: "bottom",
35
+ trigger: "hover",
36
+ onShow: openPopover,
37
+ onHide: _cache[1] || (_cache[1] = ($event) => showQR.value = false)
38
+ }, {
39
+ content: vue.withCtx(() => [
40
+ showQR.value ? (vue.openBlock(), vue.createBlock(index, {
41
+ key: 0,
42
+ BASE_API: _ctx.BASE_API,
43
+ docData: docData.value || props.item,
44
+ onClick: _cache[0] || (_cache[0] = vue.withModifiers(() => {
45
+ }, ["stop"]))
46
+ }, null, 8, ["BASE_API", "docData"])) : vue.createCommentVNode("v-if", true)
47
+ ]),
48
+ default: vue.withCtx(() => [
49
+ vue.createElementVNode("section", _hoisted_1, [
50
+ vue.createVNode(vue.unref(webVue.Tooltip), {
51
+ effect: "dark",
52
+ content: "\u70B9\u51FB\u53EF\u67E5\u770B\u5185\u5BB9\u5206\u4EAB\u4E8C\u7EF4\u7801",
53
+ position: "top"
54
+ }, {
55
+ default: vue.withCtx(() => [
56
+ vue.createVNode(vue.unref(icon.IconQrcode))
57
+ ]),
58
+ _: 1
59
+ })
60
+ ])
61
+ ]),
62
+ _: 1
63
+ });
64
+ };
65
+ }
66
+ });
67
+ module.exports = _sfc_main;
@@ -0,0 +1,19 @@
1
+ "use strict";
2
+ Object.defineProperties(exports, { __esModule: { value: true }, [Symbol.toStringTag]: { value: "Module" } });
3
+ var request = require("../../utils/request.js");
4
+ function generateDocPreviewLink(BASE_API, query) {
5
+ return request(BASE_API, {
6
+ url: "/poplar/v3/preview/document/generate",
7
+ method: "post",
8
+ data: query
9
+ });
10
+ }
11
+ function getDocDetailsNew(BASE_API, query) {
12
+ const url = `/poplar/v3/document/${query == null ? void 0 : query.hashid}`;
13
+ return request(BASE_API, {
14
+ url,
15
+ method: "get"
16
+ });
17
+ }
18
+ exports.generateDocPreviewLink = generateDocPreviewLink;
19
+ exports.getDocDetailsNew = getDocDetailsNew;
@@ -0,0 +1,93 @@
1
+ .doc-qrcode-preview-container-v {
2
+ display: flex;
3
+ flex-direction: column;
4
+ gap: 10px;
5
+ align-items: center;
6
+ justify-content: center;
7
+ margin: auto;
8
+ color: #4e5969;
9
+ font-size: 14px;
10
+ background: white;
11
+ border-radius: 6px;
12
+
13
+ .qrcode {
14
+ display: flex;
15
+ align-items: center;
16
+ justify-content: center;
17
+ width: 200px;
18
+ height: 200px;
19
+ color: #4886ff;
20
+ background: #edf3ff;
21
+
22
+ .no-pub {
23
+ position: relative;
24
+ width: 100%;
25
+ height: 100%;
26
+
27
+ &::after {
28
+ position: absolute;
29
+ top: 0;
30
+ left: 0;
31
+ display: flex;
32
+ align-items: center;
33
+ justify-content: center;
34
+ width: calc(100% - 40px);
35
+ height: 100%;
36
+ padding: 0 20px;
37
+ color: #fff;
38
+ background-color: rgba(0, 0, 0, 0.5);
39
+ content: '内容暂未发布,如需链接预览请在下方生成临时预览链接';
40
+ // z-index: 2;
41
+ }
42
+ }
43
+ }
44
+
45
+ .qrcode-hint {
46
+ opacity: 0.6;
47
+ }
48
+
49
+ .setting {
50
+ display: flex;
51
+ align-items: center;
52
+ justify-content: space-between;
53
+ width: 100%;
54
+
55
+ .label {
56
+ font-weight: 500;
57
+ }
58
+
59
+ .a-select {
60
+ width: 100px;
61
+
62
+ .a-input__inner {
63
+ color: #86909c;
64
+ text-align: center;
65
+ background: #f3f4f5;
66
+ border: none;
67
+ }
68
+ }
69
+ }
70
+
71
+ .btns {
72
+ display: flex;
73
+ gap: 10px;
74
+ justify-content: space-between;
75
+ width: 100%;
76
+
77
+ .arco-btn {
78
+ width: 100%;
79
+ margin-left: 0;
80
+ padding: 10px 5px;
81
+ font-size: 14px;
82
+
83
+ &.auto {
84
+ flex: 1;
85
+ width: auto;
86
+ }
87
+ }
88
+ }
89
+
90
+ .time-go {
91
+ font-size: 12px;
92
+ }
93
+ }
@@ -0,0 +1,3 @@
1
+ .qr-code {
2
+ margin-right: 5px;
3
+ }