iking-web-ui-pro 0.2.0 → 0.2.2

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,6 +1,6 @@
1
- import { defineComponent as h, computed as q, resolveComponent as I, openBlock as l, createElementBlock as f, normalizeClass as _, normalizeStyle as v, createCommentVNode as S, createElementVNode as C, createBlock as k, withCtx as g, createTextVNode as F, toDisplayString as E, createVNode as z, unref as y, mergeModels as P, useModel as U, ref as D, h as M, mergeProps as L, createSlots as H, renderSlot as R, reactive as G, watch as W, nextTick as N, Fragment as X } from "vue";
2
- import { ikColor as Y, buildUUID as K } from "iking-utils-pro";
3
- const x = (n, e) => {
1
+ import { defineComponent as h, computed as F, resolveComponent as z, openBlock as l, createElementBlock as d, normalizeClass as w, normalizeStyle as v, createCommentVNode as S, createElementVNode as I, createBlock as _, withCtx as g, createTextVNode as B, toDisplayString as $, createVNode as D, unref as y, mergeModels as L, useModel as H, ref as x, h as N, mergeProps as X, createSlots as Y, renderSlot as C, reactive as G, watch as K, nextTick as J, Fragment as Q } from "vue";
2
+ import { ikColor as Z, buildUUID as ee } from "iking-utils-pro";
3
+ const q = (n, e) => {
4
4
  if (n.install = (o) => {
5
5
  for (const r of [n, ...Object.values(e ?? {})])
6
6
  o.component(r.name, r);
@@ -8,14 +8,14 @@ const x = (n, e) => {
8
8
  for (const [o, r] of Object.entries(e))
9
9
  n[o] = r;
10
10
  return n;
11
- }, V = (n, e) => e ? e.startsWith("http") ? e : `${n || location.origin}${e}` : "", $ = (n, e) => {
11
+ }, j = (n, e) => e ? e.startsWith("http") ? e : `${n || location.origin}${e}` : "", V = (n, e) => {
12
12
  const o = n.__vccOpts || n;
13
13
  for (const [r, t] of e)
14
14
  o[r] = t;
15
15
  return o;
16
- }, J = (n, e) => {
17
- var i, a, c, p;
18
- const o = (i = n == null ? void 0 : n.response) != null && i.data ? T((c = (a = n == null ? void 0 : n.response) == null ? void 0 : a.data) == null ? void 0 : c.suffix) : ((p = n.raw) == null ? void 0 : p.type) || T(n[e.suffix]), r = o == null ? void 0 : o.toLowerCase(), t = {
16
+ }, te = (n, e) => {
17
+ var i, a, u, p;
18
+ const o = (i = n == null ? void 0 : n.response) != null && i.data ? M((u = (a = n == null ? void 0 : n.response) == null ? void 0 : a.data) == null ? void 0 : u.suffix) : ((p = n.raw) == null ? void 0 : p.type) || M(n[e.suffix]), r = o == null ? void 0 : o.toLowerCase(), t = {
19
19
  sheet: "excel",
20
20
  excel: "excel",
21
21
  zip: "zip",
@@ -35,7 +35,7 @@ const x = (n, e) => {
35
35
  if (typeof r == "string" && (r.includes(s) || r === s))
36
36
  return t[s];
37
37
  return "unknown";
38
- }, Q = {
38
+ }, ne = {
39
39
  ".doc": "word",
40
40
  ".docx": "word",
41
41
  ".docxf": "word",
@@ -120,24 +120,24 @@ const x = (n, e) => {
120
120
  ".vob": "video",
121
121
  ".txt": "txt",
122
122
  ".pdf": "pdf"
123
- }, T = (n) => {
123
+ }, M = (n) => {
124
124
  const e = n == null ? void 0 : n.toLocaleLowerCase(), o = e != null && e.startsWith(".") ? e : `.${e}`;
125
- return o && Q[o] || "unknow";
126
- }, Z = (n) => {
125
+ return o && ne[o] || "unknow";
126
+ }, oe = (n) => {
127
127
  let e = "", o = ["doc", "docx"], r = ["xls", "xlsx"], t = ["ppt", "pptx"], i = ["pdf"];
128
128
  return o.includes(n) && (e = "word"), r.includes(n) && (e = "cell"), t.includes(n) && (e = "slide"), i.includes(n) && (e = "text-pdf"), e;
129
- }, ee = {
129
+ }, ie = {
130
130
  key: 0,
131
131
  class: "ik-svg-icon ik-icon inline-block inline-flex justify-center box-content line-height-[0]"
132
- }, te = {
132
+ }, se = {
133
133
  key: 1,
134
134
  class: "h-[1em] w-[1em]",
135
135
  "aria-hidden": "true"
136
- }, ne = ["xlink:href"], oe = ["src"], ie = {
136
+ }, re = ["xlink:href"], ae = ["src"], le = {
137
137
  key: 1,
138
138
  class: "h-[1em] w-[1em]",
139
139
  "aria-hidden": "true"
140
- }, se = ["xlink:href"], re = ["src"], ae = /* @__PURE__ */ h({
140
+ }, ce = ["xlink:href"], ue = ["src"], de = /* @__PURE__ */ h({
141
141
  name: "IkSvgIcon",
142
142
  __name: "index",
143
143
  props: {
@@ -164,10 +164,10 @@ const x = (n, e) => {
164
164
  tableIconType: { default: "icon" }
165
165
  },
166
166
  setup(n) {
167
- const e = n, o = q(() => {
167
+ const e = n, o = F(() => {
168
168
  var t, i, a;
169
169
  return /^http?:\/\//.test(e.name) ? "img" : /i-[^:]+:[^:]+/.test(e.name) ? "unocss" : (t = e.name) != null && t.startsWith("iksig") ? "iksig" : (i = e.name) != null && i.includes(":") ? "iconify" : (a = e.name) != null && a.startsWith("iksvg") ? "svg" : "i";
170
- }), r = q(() => {
170
+ }), r = F(() => {
171
171
  const t = [];
172
172
  if (e.flip)
173
173
  switch (e.flip) {
@@ -189,19 +189,19 @@ const x = (n, e) => {
189
189
  padding: e.showBg || e.bg ? e.padding : 0,
190
190
  ...e.color && o.value !== "iksig" ? {
191
191
  "--ik-color-icon-dark": e.color,
192
- "--ik-color-icon-light": e.colorLight || Y.setOpacity(e.color, e.opacity)
192
+ "--ik-color-icon-light": e.colorLight || Z.setOpacity(e.color, e.opacity)
193
193
  } : {}
194
194
  };
195
195
  return e.width && (i.width = i.height = typeof e.width == "number" ? `${e.width}px` : e.width), i;
196
196
  });
197
197
  return (t, i) => {
198
- const a = I("el-tooltip"), c = I("el-button");
199
- return t.tableIconType === "icon" ? (l(), f("span", ee, [
200
- t.notip || !t.title ? (l(), f(
198
+ const a = z("el-tooltip"), u = z("el-button");
199
+ return t.tableIconType === "icon" ? (l(), d("span", ie, [
200
+ t.notip || !t.title ? (l(), d(
201
201
  "i",
202
202
  {
203
203
  key: 0,
204
- class: _(["ik-svg-icon ik-icon relative h-[1em] w-[1em] inline-flex items-center justify-center fill-current leading-[1em] transition", {
204
+ class: w(["ik-svg-icon ik-icon relative h-[1em] w-[1em] inline-flex items-center justify-center fill-current leading-[1em] transition", {
205
205
  [t.name]: o.value === "unocss",
206
206
  "show-bg": t.showBg || t.bg,
207
207
  default: t.size === "default",
@@ -218,29 +218,29 @@ const x = (n, e) => {
218
218
  },
219
219
  [
220
220
  S(` <Icon v-if="outputType === 'iconify'" :icon="name" /> `),
221
- o.value === "iksig" ? (l(), f(
221
+ o.value === "iksig" ? (l(), d(
222
222
  "i",
223
223
  {
224
224
  key: 0,
225
- class: _(`iksig ${t.name}`),
225
+ class: w(`iksig ${t.name}`),
226
226
  style: v(r.value)
227
227
  },
228
228
  null,
229
229
  6
230
230
  /* CLASS, STYLE */
231
- )) : o.value === "svg" ? (l(), f("svg", te, [
232
- C("use", {
231
+ )) : o.value === "svg" ? (l(), d("svg", se, [
232
+ I("use", {
233
233
  "xlink:href": `#${t.name}`
234
- }, null, 8, ne)
235
- ])) : o.value === "img" ? (l(), f("img", {
234
+ }, null, 8, re)
235
+ ])) : o.value === "img" ? (l(), d("img", {
236
236
  key: 2,
237
237
  src: t.name,
238
238
  class: "h-[1em] w-[1em]"
239
- }, null, 8, oe)) : (l(), f(
239
+ }, null, 8, ae)) : (l(), d(
240
240
  "i",
241
241
  {
242
242
  key: 3,
243
- class: _(t.name),
243
+ class: w(t.name),
244
244
  style: v(r.value)
245
245
  },
246
246
  null,
@@ -250,16 +250,16 @@ const x = (n, e) => {
250
250
  ],
251
251
  6
252
252
  /* CLASS, STYLE */
253
- )) : (l(), k(a, {
253
+ )) : (l(), _(a, {
254
254
  key: 1,
255
255
  content: t.title,
256
256
  placement: "top"
257
257
  }, {
258
258
  default: g(() => [
259
- C(
259
+ I(
260
260
  "i",
261
261
  {
262
- class: _(["ik-svg-icon ik-icon relative h-[1em] w-[1em] inline-flex items-center justify-center fill-current leading-[1em] transition", {
262
+ class: w(["ik-svg-icon ik-icon relative h-[1em] w-[1em] inline-flex items-center justify-center fill-current leading-[1em] transition", {
263
263
  [t.name]: o.value === "unocss",
264
264
  "show-bg": t.showBg || t.bg,
265
265
  default: t.size === "default",
@@ -274,29 +274,29 @@ const x = (n, e) => {
274
274
  style: v(r.value)
275
275
  },
276
276
  [
277
- o.value === "iksig" ? (l(), f(
277
+ o.value === "iksig" ? (l(), d(
278
278
  "i",
279
279
  {
280
280
  key: 0,
281
- class: _(`iksig ${t.name}`),
281
+ class: w(`iksig ${t.name}`),
282
282
  style: v(r.value)
283
283
  },
284
284
  null,
285
285
  6
286
286
  /* CLASS, STYLE */
287
- )) : o.value === "svg" ? (l(), f("svg", ie, [
288
- C("use", {
287
+ )) : o.value === "svg" ? (l(), d("svg", le, [
288
+ I("use", {
289
289
  "xlink:href": `#${t.name}`
290
- }, null, 8, se)
291
- ])) : o.value === "img" ? (l(), f("img", {
290
+ }, null, 8, ce)
291
+ ])) : o.value === "img" ? (l(), d("img", {
292
292
  key: 2,
293
293
  src: t.name,
294
294
  class: "h-[1em] w-[1em]"
295
- }, null, 8, re)) : (l(), f(
295
+ }, null, 8, ue)) : (l(), d(
296
296
  "i",
297
297
  {
298
298
  key: 3,
299
- class: _(t.name),
299
+ class: w(t.name),
300
300
  style: v(r.value)
301
301
  },
302
302
  null,
@@ -311,13 +311,13 @@ const x = (n, e) => {
311
311
  _: 1
312
312
  /* STABLE */
313
313
  }, 8, ["content"]))
314
- ])) : (l(), k(c, {
314
+ ])) : (l(), _(u, {
315
315
  key: 1,
316
316
  type: ["warning", "error"].includes(t.type) ? "danger" : ""
317
317
  }, {
318
318
  default: g(() => [
319
- F(
320
- E(t.title),
319
+ B(
320
+ $(t.title),
321
321
  1
322
322
  /* TEXT */
323
323
  )
@@ -328,10 +328,10 @@ const x = (n, e) => {
328
328
  };
329
329
  }
330
330
  });
331
- const le = /* @__PURE__ */ $(ae, [["__scopeId", "data-v-7d95dbf5"]]), B = x(le), ce = {
331
+ const pe = /* @__PURE__ */ V(de, [["__scopeId", "data-v-7d95dbf5"]]), O = q(pe), fe = {
332
332
  key: 0,
333
333
  class: "exit-main-page-maximize"
334
- }, ue = /* @__PURE__ */ h({
334
+ }, me = /* @__PURE__ */ h({
335
335
  __name: "CloseIcon",
336
336
  props: {
337
337
  showBg: {
@@ -344,15 +344,15 @@ const le = /* @__PURE__ */ $(ae, [["__scopeId", "data-v-7d95dbf5"]]), B = x(le),
344
344
  }
345
345
  },
346
346
  setup(n) {
347
- return (e, o) => (l(), f("div", null, [
348
- n.showBg && n.fullscreen ? (l(), f("div", ce, [
349
- z(y(B), {
347
+ return (e, o) => (l(), d("div", null, [
348
+ n.showBg && n.fullscreen ? (l(), d("div", fe, [
349
+ D(y(O), {
350
350
  name: "iksvg_guanbidanchuang",
351
351
  title: "关闭",
352
352
  size: 20,
353
353
  error: ""
354
354
  })
355
- ])) : (l(), k(y(B), {
355
+ ])) : (l(), _(y(O), {
356
356
  key: 1,
357
357
  error: "",
358
358
  name: "iksvg_guanbidanchuang",
@@ -362,9 +362,9 @@ const le = /* @__PURE__ */ $(ae, [["__scopeId", "data-v-7d95dbf5"]]), B = x(le),
362
362
  ]));
363
363
  }
364
364
  });
365
- const de = /* @__PURE__ */ $(ue, [["__scopeId", "data-v-79f49df8"]]), pe = { class: "base-header" }, fe = /* @__PURE__ */ h({
365
+ const ve = /* @__PURE__ */ V(me, [["__scopeId", "data-v-79f49df8"]]), ge = { class: "base-header" }, he = /* @__PURE__ */ h({
366
366
  __name: "IkBaseDialog",
367
- props: /* @__PURE__ */ P({
367
+ props: /* @__PURE__ */ L({
368
368
  title: { default: "" },
369
369
  cancelText: { default: "取消" },
370
370
  confirmText: { default: "确认" },
@@ -383,47 +383,47 @@ const de = /* @__PURE__ */ $(ue, [["__scopeId", "data-v-79f49df8"]]), pe = { cla
383
383
  }),
384
384
  emits: ["update:modelValue"],
385
385
  setup(n) {
386
- const e = n, o = U(n, "modelValue"), r = D(e.fullscreen), t = () => {
386
+ const e = n, o = H(n, "modelValue"), r = x(e.fullscreen), t = () => {
387
387
  r.value = !r.value;
388
388
  }, i = h({
389
389
  setup() {
390
- return () => M(de, {
390
+ return () => N(ve, {
391
391
  showBg: e.showCloseBg,
392
392
  fullscreen: e.fullscreen
393
393
  });
394
394
  }
395
395
  });
396
- return (a, c) => {
397
- const p = I("el-dialog");
398
- return l(), k(p, L({
396
+ return (a, u) => {
397
+ const p = z("el-dialog");
398
+ return l(), _(p, X({
399
399
  modelValue: o.value,
400
- "onUpdate:modelValue": c[0] || (c[0] = (s) => o.value = s)
400
+ "onUpdate:modelValue": u[0] || (u[0] = (s) => o.value = s)
401
401
  }, a.$attrs, {
402
402
  "close-icon": y(i),
403
403
  class: `ik-base-dialog ${a.noHeader ? "no-header" : ""} ${a.noFooter ? "no-footer" : ""}`,
404
404
  fullscreen: r.value,
405
405
  "modal-class": "baseDialog"
406
- }), H({
406
+ }), Y({
407
407
  icon: g(() => [
408
- R(a.$slots, "title", {}, () => [
409
- F(
410
- E(a.title),
408
+ C(a.$slots, "title", {}, () => [
409
+ B(
410
+ $(a.title),
411
411
  1
412
412
  /* TEXT */
413
413
  )
414
414
  ])
415
415
  ]),
416
416
  header: g(() => [
417
- C("div", pe, [
418
- R(a.$slots, "header", {}, () => [
419
- F(
420
- E(a.title),
417
+ I("div", ge, [
418
+ C(a.$slots, "header", {}, () => [
419
+ B(
420
+ $(a.title),
421
421
  1
422
422
  /* TEXT */
423
423
  )
424
424
  ])
425
425
  ]),
426
- a.$attrs.showClose ? (l(), k(y(B), {
426
+ a.$attrs.showClose ? (l(), _(y(O), {
427
427
  key: 0,
428
428
  onClick: t,
429
429
  name: r.value ? "iksvg_tuichuquanping" : "iksvg_quanping-daohang",
@@ -432,7 +432,7 @@ const de = /* @__PURE__ */ $(ue, [["__scopeId", "data-v-79f49df8"]]), pe = { cla
432
432
  }, null, 8, ["name", "title"])) : S("v-if", !0)
433
433
  ]),
434
434
  default: g(() => [
435
- R(a.$slots, "default")
435
+ C(a.$slots, "default")
436
436
  ]),
437
437
  _: 2
438
438
  /* DYNAMIC */
@@ -440,7 +440,7 @@ const de = /* @__PURE__ */ $(ue, [["__scopeId", "data-v-79f49df8"]]), pe = { cla
440
440
  a.$slots.footer ? {
441
441
  name: "footer",
442
442
  fn: g(() => [
443
- R(a.$slots, "footer")
443
+ C(a.$slots, "footer")
444
444
  ]),
445
445
  key: "0"
446
446
  } : void 0
@@ -448,46 +448,46 @@ const de = /* @__PURE__ */ $(ue, [["__scopeId", "data-v-79f49df8"]]), pe = { cla
448
448
  };
449
449
  }
450
450
  });
451
- const me = x(fe);
452
- function ve(n, e, o, r) {
451
+ const ye = q(he);
452
+ function we(n, e, o, r) {
453
453
  function t(i) {
454
454
  return i instanceof o ? i : new o(function(a) {
455
455
  a(i);
456
456
  });
457
457
  }
458
458
  return new (o || (o = Promise))(function(i, a) {
459
- function c(u) {
459
+ function u(c) {
460
460
  try {
461
- s(r.next(u));
461
+ s(r.next(c));
462
462
  } catch (m) {
463
463
  a(m);
464
464
  }
465
465
  }
466
- function p(u) {
466
+ function p(c) {
467
467
  try {
468
- s(r.throw(u));
468
+ s(r.throw(c));
469
469
  } catch (m) {
470
470
  a(m);
471
471
  }
472
472
  }
473
- function s(u) {
474
- u.done ? i(u.value) : t(u.value).then(c, p);
473
+ function s(c) {
474
+ c.done ? i(c.value) : t(c.value).then(u, p);
475
475
  }
476
476
  s((r = r.apply(n, e || [])).next());
477
477
  });
478
478
  }
479
- function ge(n, e) {
479
+ function _e(n, e) {
480
480
  var o = { label: 0, sent: function() {
481
481
  if (i[0] & 1)
482
482
  throw i[1];
483
483
  return i[1];
484
484
  }, trys: [], ops: [] }, r, t, i, a;
485
- return a = { next: c(0), throw: c(1), return: c(2) }, typeof Symbol == "function" && (a[Symbol.iterator] = function() {
485
+ return a = { next: u(0), throw: u(1), return: u(2) }, typeof Symbol == "function" && (a[Symbol.iterator] = function() {
486
486
  return this;
487
487
  }), a;
488
- function c(s) {
489
- return function(u) {
490
- return p([s, u]);
488
+ function u(s) {
489
+ return function(c) {
490
+ return p([s, c]);
491
491
  };
492
492
  }
493
493
  function p(s) {
@@ -531,8 +531,8 @@ function ge(n, e) {
531
531
  continue;
532
532
  }
533
533
  s = e.call(n, o);
534
- } catch (u) {
535
- s = [6, u], t = 0;
534
+ } catch (c) {
535
+ s = [6, c], t = 0;
536
536
  } finally {
537
537
  r = i = 0;
538
538
  }
@@ -541,9 +541,9 @@ function ge(n, e) {
541
541
  return { value: s[0] ? s[1] : void 0, done: !0 };
542
542
  }
543
543
  }
544
- var he = function(n, e) {
545
- return ve(void 0, void 0, void 0, function() {
546
- return ge(this, function(o) {
544
+ var ke = function(n, e) {
545
+ return we(void 0, void 0, void 0, function() {
546
+ return _e(this, function(o) {
547
547
  return [2, new Promise(function(r, t) {
548
548
  try {
549
549
  if (window.DocsAPI)
@@ -555,13 +555,13 @@ var he = function(n, e) {
555
555
  if (!p) {
556
556
  if (clearInterval(a), window.DocsAPI)
557
557
  return r(null);
558
- var s = A(e, n, r, t);
558
+ var s = U(e, n, r, t);
559
559
  i.remove(), document.body.appendChild(s);
560
560
  }
561
561
  }, 500);
562
562
  else {
563
- var c = A(e, n, r, t);
564
- document.body.appendChild(c);
563
+ var u = U(e, n, r, t);
564
+ document.body.appendChild(u);
565
565
  }
566
566
  } catch (p) {
567
567
  console.error(p);
@@ -569,14 +569,14 @@ var he = function(n, e) {
569
569
  })];
570
570
  });
571
571
  });
572
- }, A = function(n, e, o, r) {
572
+ }, U = function(n, e, o, r) {
573
573
  var t = document.createElement("script");
574
574
  return t.id = n, t.type = "text/javascript", t.src = e, t.async = !0, t.onload = function() {
575
575
  t.removeAttribute("loading"), o(null);
576
576
  }, t.onerror = function(i) {
577
577
  t.removeAttribute("loading"), r(i);
578
578
  }, t.setAttribute("loading", ""), t;
579
- }, O = h({
579
+ }, T = h({
580
580
  name: "DocumentEditor",
581
581
  props: {
582
582
  id: {
@@ -631,7 +631,7 @@ var he = function(n, e) {
631
631
  var n = this, e = this.documentServerUrl;
632
632
  e.endsWith("/") || (e += "/");
633
633
  var o = "".concat(e, "web-apps/apps/api/documents/api.js");
634
- he(o, "onlyoffice-api-script").then(function() {
634
+ ke(o, "onlyoffice-api-script").then(function() {
635
635
  return n.onLoad();
636
636
  }).catch(function() {
637
637
  n.onError(-2);
@@ -745,13 +745,13 @@ var he = function(n, e) {
745
745
  }
746
746
  }
747
747
  });
748
- const ye = ["id"];
749
- function we(n, e, o, r, t, i) {
750
- return l(), f("div", { id: n.id }, null, 8, ye);
748
+ const be = ["id"];
749
+ function Re(n, e, o, r, t, i) {
750
+ return l(), d("div", { id: n.id }, null, 8, be);
751
751
  }
752
- O.render = we;
753
- O.__file = "src/components/DocumentEditor.vue";
754
- const _e = /* @__PURE__ */ h({
752
+ T.render = Re;
753
+ T.__file = "src/components/DocumentEditor.vue";
754
+ const Se = /* @__PURE__ */ h({
755
755
  __name: "IkOnlyOffice",
756
756
  props: {
757
757
  // 文件服务器的服务的地址
@@ -759,80 +759,33 @@ const _e = /* @__PURE__ */ h({
759
759
  type: String,
760
760
  default: ""
761
761
  },
762
- // 当前onlyoffice的模式 (edit 编辑模式 view是查看模式)
763
- mode: {
764
- type: String,
765
- default: ""
766
- },
767
762
  // 配置项
768
763
  configOptions: {
769
764
  type: Object,
770
765
  default: () => {
771
766
  }
772
767
  },
773
- // 元素的高度
768
+ // 元素的高度
774
769
  officeHeight: {
775
770
  type: String,
776
771
  default: "100%"
777
- },
778
- // 加密后的token
779
- token: {
780
- type: String,
781
- default: ""
782
772
  }
783
773
  },
784
774
  setup(n) {
785
- var t, i, a, c;
786
- const e = n, o = D({
775
+ const e = n, o = x({
787
776
  width: "100%",
788
777
  height: "100%",
789
- document: (t = e.configOptions) == null ? void 0 : t.document,
790
- // word cell(表格) slide(PPT)
791
- documentType: (i = e.configOptions) == null ? void 0 : i.documentType,
792
- editorConfig: {
793
- callbackUrl: (c = (a = e.configOptions) == null ? void 0 : a.editorConfig) == null ? void 0 : c.callbackUrl,
794
- // 保存的回调函数
795
- lang: "zh-CN",
796
- mode: e.mode,
797
- // 强制保存
798
- customization: {
799
- forcesave: !0,
800
- autosave: !0
801
- }
802
- },
803
- // 权限
804
- permissions: {
805
- comment: !0,
806
- commentGroups: {
807
- edit: ["Group1"],
808
- remove: ["Group1"],
809
- view: ""
810
- },
811
- copy: !0,
812
- deleteCommentAuthorOnly: !0,
813
- download: !0,
814
- edit: !0,
815
- editCommentAuthorOnly: !0,
816
- fillForms: !0,
817
- modifyContentControl: !0,
818
- modifyFilter: !0,
819
- print: !0,
820
- review: !0,
821
- reviewGroups: ["Group1", "Group2", "Group3"],
822
- userInfoGroups: ["Group1"]
823
- },
824
- mode: e.mode,
825
- token: e.token
778
+ ...e.configOptions || {}
826
779
  }), r = () => {
827
- console.info("文档加载完成");
780
+ console.info("文档加载完成", e.configOptions);
828
781
  };
829
- return (p, s) => (l(), f(
782
+ return (t, i) => (l(), d(
830
783
  "div",
831
784
  {
832
785
  style: v({ height: e.officeHeight })
833
786
  },
834
787
  [
835
- z(y(O), {
788
+ D(y(T), {
836
789
  id: `${(/* @__PURE__ */ new Date()).getTime()}`,
837
790
  ref: "editorRef",
838
791
  "document-server-url": n.documentServerUrl,
@@ -845,9 +798,9 @@ const _e = /* @__PURE__ */ h({
845
798
  ));
846
799
  }
847
800
  });
848
- const ke = /* @__PURE__ */ $(_e, [["__scopeId", "data-v-ea0a8f6d"]]), be = x(ke), Se = /* @__PURE__ */ h({
801
+ const Ce = /* @__PURE__ */ V(Se, [["__scopeId", "data-v-fe959cd8"]]), Ie = q(Ce), ze = /* @__PURE__ */ h({
849
802
  __name: "IkPreviewFileDialog",
850
- props: /* @__PURE__ */ P({
803
+ props: /* @__PURE__ */ L({
851
804
  file: {
852
805
  type: Object,
853
806
  default: () => []
@@ -882,78 +835,81 @@ const ke = /* @__PURE__ */ $(_e, [["__scopeId", "data-v-ea0a8f6d"]]), be = x(ke)
882
835
  }),
883
836
  emits: ["update:show"],
884
837
  setup(n) {
885
- const e = n, o = U(n, "show"), r = q(() => ({
838
+ const e = n, o = H(n, "show"), r = F(() => ({
886
839
  name: "name",
887
840
  url: "url",
888
841
  suffix: "suffix",
889
842
  size: "fileSize",
890
843
  ...e.field
891
- })), t = D(null), i = D(null), a = G({
844
+ })), t = x(null), i = x(null), a = G({
892
845
  image: !1,
893
846
  office: !1,
894
847
  video: !1
895
- }), c = (s) => {
896
- var u, m;
848
+ }), u = (s) => {
849
+ var c, m, k, b, R, A;
897
850
  try {
898
- const d = ((u = s == null ? void 0 : s.response) == null ? void 0 : u.data) || s, b = d[r.value.url] || (d == null ? void 0 : d.id) || d.attachmentId, w = (m = d[r.value.suffix] || d.attachmentSuffix) == null ? void 0 : m.toLowerCase(), j = d[r.value.name] || (d == null ? void 0 : d.attachmentName);
851
+ const f = ((c = s == null ? void 0 : s.response) == null ? void 0 : c.data) || s, P = f[r.value.url] || (f == null ? void 0 : f.id) || f.attachmentId, E = (m = f[r.value.suffix] || f.attachmentSuffix) == null ? void 0 : m.toLowerCase(), W = f[r.value.name] || (f == null ? void 0 : f.attachmentName);
899
852
  if (i.value = {
900
853
  ...s,
901
854
  name: s[r.value.name],
902
- url: V(e.loadUrl, b)
903
- }, s && J(s, r.value) === "image") {
855
+ url: j(e.loadUrl, P)
856
+ }, s && te(s, r.value) === "image") {
904
857
  a.image = !0;
905
858
  return;
906
- } else if (e.onlyOfficeAccept.includes(w)) {
859
+ } else if (e.onlyOfficeAccept.includes(E)) {
907
860
  a.office = !0, t.value = {
908
- documentType: Z(w),
909
- document: {
910
- key: K(),
911
- title: j,
912
- url: V(e.loadUrl, b),
913
- fileType: w
914
- },
861
+ ...e.onlyOfficeConfig,
915
862
  editorConfig: {
863
+ ...((k = e.onlyOfficeConfig) == null ? void 0 : k.editorConfig) || {},
916
864
  customization: {
865
+ ...((R = (b = e.onlyOfficeConfig) == null ? void 0 : b.editorConfig) == null ? void 0 : R.customization) || {},
917
866
  review: {
918
867
  reviewDisplay: "final"
919
868
  }
920
869
  }
921
870
  },
922
- ...e.onlyOfficeConfig
871
+ document: {
872
+ key: ee(),
873
+ title: W,
874
+ url: j(e.loadUrl, P),
875
+ fileType: E,
876
+ ...((A = e.onlyOfficeConfig) == null ? void 0 : A.document) || {}
877
+ },
878
+ documentType: oe(E)
923
879
  };
924
880
  return;
925
881
  }
926
- } catch (d) {
927
- console.info("预览错误: ", d);
882
+ } catch (f) {
883
+ console.info("预览错误: ", f);
928
884
  }
929
885
  };
930
- W([o, e.file], ([s, u]) => {
931
- s && N(() => {
932
- c(e.file);
886
+ K([o, e.file], ([s, c]) => {
887
+ s && J(() => {
888
+ u(e.file);
933
889
  });
934
890
  });
935
891
  const p = () => {
936
892
  o.value = !1, a.office = !1, a.image = !1, a.video = !1;
937
893
  };
938
- return (s, u) => {
939
- var d, b;
940
- const m = I("el-image-viewer");
941
- return o.value ? (l(), f(
942
- X,
894
+ return (s, c) => {
895
+ var k, b;
896
+ const m = z("el-image-viewer");
897
+ return o.value ? (l(), d(
898
+ Q,
943
899
  { key: 0 },
944
900
  [
945
- (d = i.value) != null && d.url && a.image ? (l(), k(m, {
901
+ (k = i.value) != null && k.url && a.image ? (l(), _(m, {
946
902
  key: 0,
947
- onClose: u[0] || (u[0] = (w) => {
903
+ onClose: c[0] || (c[0] = (R) => {
948
904
  i.value = null, a.image = !1;
949
905
  }),
950
906
  ref: "previewImgRef",
951
907
  "url-list": [(b = i.value) == null ? void 0 : b.url]
952
908
  }, null, 8, ["url-list"])) : S("v-if", !0),
953
909
  S(" 文档类 "),
954
- z(y(me), {
910
+ D(y(ye), {
955
911
  modelValue: a.office,
956
- "onUpdate:modelValue": u[1] || (u[1] = (w) => a.office = w),
912
+ "onUpdate:modelValue": c[1] || (c[1] = (R) => a.office = R),
957
913
  draggable: "",
958
914
  "no-footer": "",
959
915
  "no-header": "",
@@ -967,7 +923,7 @@ const ke = /* @__PURE__ */ $(_e, [["__scopeId", "data-v-ea0a8f6d"]]), be = x(ke)
967
923
  "modal-class": "ik-only-preview-dialog"
968
924
  }, {
969
925
  default: g(() => [
970
- z(y(be), {
926
+ D(y(Ie), {
971
927
  configOptions: t.value,
972
928
  documentServerUrl: n.onlyofficeServer,
973
929
  mode: "view"
@@ -983,8 +939,8 @@ const ke = /* @__PURE__ */ $(_e, [["__scopeId", "data-v-ea0a8f6d"]]), be = x(ke)
983
939
  };
984
940
  }
985
941
  });
986
- const Ie = x(Se);
942
+ const qe = q(ze);
987
943
  export {
988
- Ie as IkPreviewFileDialog,
989
- Ie as default
944
+ qe as IkPreviewFileDialog,
945
+ qe as default
990
946
  };