zhytech-ui-mobile 1.1.2 → 1.1.3

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
1
  import { default as filePreview } from './index';
2
- import { previewOption, videoConfigType, pdfOptionType } from './types/filePreviewType';
2
+ import { filePreviewOption, videoConfigType, pdfOptionType } from './types/filePreviewType';
3
3
 
4
4
  export { filePreview };
5
- export type { previewOption, videoConfigType, pdfOptionType };
5
+ export type { filePreviewOption, videoConfigType, pdfOptionType };
@@ -224,7 +224,7 @@ export interface pdfOptionType {
224
224
  /**
225
225
  * 工具条显示项,默认值: scale(缩放) print download pages(当前页/总页数)
226
226
  */
227
- tool?: Array<"scale" | "print" | "download" | "pages" | "" | "" | "">;
227
+ tool?: Array<"scale" | "pages">;
228
228
  /**
229
229
  * 是否单页显示,默认true
230
230
  */
@@ -238,7 +238,7 @@ export interface pdfOptionType {
238
238
  */
239
239
  onPageChange?: Function;
240
240
  }
241
- export interface previewOption {
241
+ export interface filePreviewOption {
242
242
  /**
243
243
  * @description: 是否显示全屏按钮p
244
244
  */
@@ -1,7 +1,7 @@
1
1
  import { ConfigProviderThemeVars } from 'wot-design-uni';
2
2
  import { dynamicFormData, formAttribute, dictionaryData, dictionaryItem, uploadOption, documentView, formRenderer as zhyFormRenderer } from './components/dynamicForm/index';
3
3
  import { verificationCode as zhyVerificationCode, vcodeConfigOption } from './components/verificationCode/index';
4
- import { filePreview as zhyFilePreview, previewOption, videoConfigType, pdfOptionType } from './components/filePreview/index';
4
+ import { filePreview as zhyFilePreview, filePreviewOption, videoConfigType, pdfOptionType } from './components/filePreview/index';
5
5
 
6
6
  interface ZhyConfigOptions {
7
7
  /**
@@ -9,7 +9,7 @@ interface ZhyConfigOptions {
9
9
  */
10
10
  theme: ConfigProviderThemeVars;
11
11
  }
12
- export type { ZhyConfigOptions, ConfigProviderThemeVars, dynamicFormData, formAttribute, dictionaryData, dictionaryItem, uploadOption, documentView, vcodeConfigOption, previewOption, videoConfigType, pdfOptionType };
12
+ export type { ZhyConfigOptions, ConfigProviderThemeVars, dynamicFormData, formAttribute, dictionaryData, dictionaryItem, uploadOption, documentView, vcodeConfigOption, filePreviewOption, videoConfigType, pdfOptionType };
13
13
  declare const setTheme: (options: ConfigProviderThemeVars) => {
14
14
  colorTheme?: string;
15
15
  colorWhite?: string;
@@ -13050,7 +13050,7 @@ const _sfc_main$V = /* @__PURE__ */ defineComponent({
13050
13050
  }
13051
13051
  });
13052
13052
  const wdLoading_vue_vue_type_style_index_0_scoped_847be99d_lang = "";
13053
- const wdLoading = /* @__PURE__ */ _export_sfc(_sfc_main$V, [["__scopeId", "data-v-847be99d"]]);
13053
+ const __easycom_1$5 = /* @__PURE__ */ _export_sfc(_sfc_main$V, [["__scopeId", "data-v-847be99d"]]);
13054
13054
  const transitionProps = {
13055
13055
  ...baseProps,
13056
13056
  /**
@@ -13743,7 +13743,7 @@ const _sfc_main$S = /* @__PURE__ */ defineComponent({
13743
13743
  class: normalizeClass(rootClass.value)
13744
13744
  }, {
13745
13745
  default: withCtx(() => [
13746
- iconName.value === "loading" ? (openBlock(), createBlock(wdLoading, {
13746
+ iconName.value === "loading" ? (openBlock(), createBlock(__easycom_1$5, {
13747
13747
  key: 0,
13748
13748
  type: loadingType.value,
13749
13749
  color: loadingColor.value,
@@ -18210,7 +18210,7 @@ const _sfc_main$A = /* @__PURE__ */ defineComponent({
18210
18210
  class: "wd-picker-view__loading"
18211
18211
  }, {
18212
18212
  default: withCtx(() => [
18213
- createVNode$1(wdLoading, { color: _ctx.loadingColor }, null, 8, ["color"])
18213
+ createVNode$1(__easycom_1$5, { color: _ctx.loadingColor }, null, 8, ["color"])
18214
18214
  ]),
18215
18215
  _: 1
18216
18216
  })) : createCommentVNode("", true),
@@ -21956,7 +21956,7 @@ const _sfc_main$t = /* @__PURE__ */ defineComponent({
21956
21956
  class: "wd-upload__status-content"
21957
21957
  }, {
21958
21958
  default: withCtx(() => [
21959
- createVNode$1(wdLoading, {
21959
+ createVNode$1(__easycom_1$5, {
21960
21960
  type: _ctx.loadingType,
21961
21961
  size: _ctx.loadingSize,
21962
21962
  color: _ctx.loadingColor
@@ -25595,7 +25595,7 @@ const _sfc_main$c = /* @__PURE__ */ defineComponent({
25595
25595
  onClick: ($event) => select(rowIndex, "action")
25596
25596
  }, {
25597
25597
  default: withCtx(() => [
25598
- action.loading ? (openBlock(), createBlock(wdLoading, {
25598
+ action.loading ? (openBlock(), createBlock(__easycom_1$5, {
25599
25599
  key: 0,
25600
25600
  "custom-class": "`wd-action-sheet__action-loading"
25601
25601
  })) : (openBlock(), createBlock(_component_v_uni_view, {
@@ -194322,9 +194322,12 @@ const _sfc_main$1 = /* @__PURE__ */ defineComponent({
194322
194322
  numPages: 0
194323
194323
  });
194324
194324
  const pdfContainer = ref();
194325
+ const loading = ref(true);
194325
194326
  let pdfDoc = void 0;
194326
194327
  const loadPdf = async () => {
194328
+ var _a2, _b2;
194327
194329
  try {
194330
+ loading.value = true;
194328
194331
  await new Promise((resolve2, reject2) => {
194329
194332
  const script = document.createElement("script");
194330
194333
  script.src = `${pdfjsBaseUrl}static/pdfjs-list/build/pdf.js`;
@@ -194343,8 +194346,10 @@ const _sfc_main$1 = /* @__PURE__ */ defineComponent({
194343
194346
  loadingTask.__PDFDocumentLoadingTask = true;
194344
194347
  pdfDoc = await loadingTask.promise;
194345
194348
  state.value.numPages = pdfDoc.numPages;
194349
+ (_b2 = (_a2 = option.value).onPageChange) == null ? void 0 : _b2.call(_a2, state.value.pageNum, state.value.numPages);
194346
194350
  await renderPage();
194347
194351
  } catch (error2) {
194352
+ loading.value = false;
194348
194353
  console.error("PDF加载失败:", error2);
194349
194354
  }
194350
194355
  };
@@ -194355,6 +194360,7 @@ const _sfc_main$1 = /* @__PURE__ */ defineComponent({
194355
194360
  pages = [state.value.pageNum];
194356
194361
  }
194357
194362
  pdfContainer.value && (pdfContainer.value.innerHTML = "");
194363
+ loading.value = true;
194358
194364
  for (let i = 0; i < pages.length; i++) {
194359
194365
  const page = await pdfDoc.getPage(pages[i]);
194360
194366
  let viewport = page.getViewport({ scale: 1 });
@@ -194370,6 +194376,7 @@ const _sfc_main$1 = /* @__PURE__ */ defineComponent({
194370
194376
  };
194371
194377
  await page.render(renderContext).promise;
194372
194378
  }
194379
+ loading.value = false;
194373
194380
  };
194374
194381
  watch(
194375
194382
  () => src.value,
@@ -194391,7 +194398,7 @@ const _sfc_main$1 = /* @__PURE__ */ defineComponent({
194391
194398
  if (state.value.pageNum > 1) {
194392
194399
  state.value.pageNum -= 1;
194393
194400
  renderPage();
194394
- (_b2 = (_a2 = option.value).onPageChange) == null ? void 0 : _b2.call(_a2, state.value.pageNum);
194401
+ (_b2 = (_a2 = option.value).onPageChange) == null ? void 0 : _b2.call(_a2, state.value.pageNum, state.value.numPages);
194395
194402
  }
194396
194403
  };
194397
194404
  const nextPage = () => {
@@ -194399,7 +194406,7 @@ const _sfc_main$1 = /* @__PURE__ */ defineComponent({
194399
194406
  if (state.value.pageNum < state.value.numPages) {
194400
194407
  state.value.pageNum += 1;
194401
194408
  renderPage();
194402
- (_b2 = (_a2 = option.value).onPageChange) == null ? void 0 : _b2.call(_a2, state.value.pageNum);
194409
+ (_b2 = (_a2 = option.value).onPageChange) == null ? void 0 : _b2.call(_a2, state.value.pageNum, state.value.numPages);
194403
194410
  }
194404
194411
  };
194405
194412
  const pageZoomOut = () => {
@@ -194413,52 +194420,77 @@ const _sfc_main$1 = /* @__PURE__ */ defineComponent({
194413
194420
  }
194414
194421
  };
194415
194422
  return (_ctx, _cache) => {
194416
- var _a2, _b2;
194423
+ const _component_v_uni_view = index$g;
194424
+ const _component_wd_loading = resolveEasycom(resolveDynamicComponent("wd-loading"), __easycom_1$5);
194417
194425
  const _component_wd_icon = resolveEasycom(resolveDynamicComponent("wd-icon"), __easycom_0$4);
194418
- return openBlock(), createElementBlock("div", { class: "wh-full pos-relative bg-#e9e9e9" }, [
194419
- createElementVNode("div", { class: "h-full overflow-y-auto" }, [
194420
- createElementVNode("div", {
194421
- class: "h-full w-90% mx-auto",
194422
- ref_key: "pdfContainer",
194423
- ref: pdfContainer
194424
- }, null, 512)
194425
- ]),
194426
- unref(option).showTool ? (openBlock(), createElementBlock("div", {
194427
- key: 0,
194428
- class: "pos-absolute bottom-10px p-8px flex items-center bg-#424242 c-#ffffff rd-20px z-1000 ml-50% transform -translate-x-50% sons-class-wd-icon:px-10 sons-class-page:px-10 sons-class-page:fs-16"
194429
- }, [
194430
- unref(option).single ? (openBlock(), createElementBlock(Fragment, { key: 0 }, [
194431
- createVNode$1(_component_wd_icon, {
194432
- name: "arrow-left",
194433
- size: "20px",
194434
- onClick: lastPage
194435
- }),
194436
- createVNode$1(_component_wd_icon, {
194437
- name: "arrow-right",
194438
- size: "20px",
194439
- onClick: nextPage
194440
- })
194441
- ], 64)) : createCommentVNode("", true),
194442
- ((_a2 = unref(option).tool) == null ? void 0 : _a2.includes("pages")) ? (openBlock(), createElementBlock("div", {
194443
- key: 1,
194444
- class: "page"
194445
- }, [
194446
- unref(option).single ? (openBlock(), createElementBlock("span", { key: 0 }, toDisplayString(unref(state).pageNum) + "/" + toDisplayString(unref(state).numPages), 1)) : (openBlock(), createElementBlock("span", { key: 1 }, "共 " + toDisplayString(unref(state).numPages) + " 页", 1))
194447
- ])) : createCommentVNode("", true),
194448
- ((_b2 = unref(option).tool) == null ? void 0 : _b2.includes("scale")) ? (openBlock(), createElementBlock(Fragment, { key: 2 }, [
194449
- createVNode$1(_component_wd_icon, {
194450
- name: "add-circle1",
194451
- size: "20px",
194452
- onClick: pageZoomOut
194426
+ return openBlock(), createBlock(_component_v_uni_view, { class: "wh-full pos-relative bg-#e9e9e9" }, {
194427
+ default: withCtx(() => {
194428
+ var _a2, _b2;
194429
+ return [
194430
+ createVNode$1(_component_v_uni_view, { class: "h-full overflow-y-auto" }, {
194431
+ default: withCtx(() => [
194432
+ createElementVNode("div", {
194433
+ class: "h-full w-90% mx-auto",
194434
+ ref_key: "pdfContainer",
194435
+ ref: pdfContainer
194436
+ }, null, 512)
194437
+ ]),
194438
+ _: 1
194453
194439
  }),
194454
- createVNode$1(_component_wd_icon, {
194455
- name: "minus-circle",
194456
- size: "20px",
194457
- onClick: pageZoomIn
194458
- })
194459
- ], 64)) : createCommentVNode("", true)
194460
- ])) : createCommentVNode("", true)
194461
- ]);
194440
+ unref(loading) ? (openBlock(), createBlock(_component_v_uni_view, {
194441
+ key: 0,
194442
+ class: "wh-full pos-absolute top-0 left-0 bg-#00000099 y-aline-center z-1500"
194443
+ }, {
194444
+ default: withCtx(() => [
194445
+ createVNode$1(_component_wd_loading),
194446
+ createVNode$1(_component_v_uni_view, { class: "fs-16 mt-5 c-#ffffff" }, {
194447
+ default: withCtx(() => [
194448
+ createTextVNode("加载中……")
194449
+ ]),
194450
+ _: 1
194451
+ })
194452
+ ]),
194453
+ _: 1
194454
+ })) : createCommentVNode("", true),
194455
+ unref(option).showTool ? (openBlock(), createElementBlock("div", {
194456
+ key: 1,
194457
+ class: "pos-absolute bottom-10px p-8px flex items-center bg-#424242 c-#ffffff rd-20px z-1000 ml-50% transform -translate-x-50% sons-class-wd-icon:px-10 sons-class-page:px-10 sons-class-page:fs-16"
194458
+ }, [
194459
+ unref(option).single ? (openBlock(), createElementBlock(Fragment, { key: 0 }, [
194460
+ createVNode$1(_component_wd_icon, {
194461
+ name: "arrow-left",
194462
+ size: "20px",
194463
+ onClick: lastPage
194464
+ }),
194465
+ createVNode$1(_component_wd_icon, {
194466
+ name: "arrow-right",
194467
+ size: "20px",
194468
+ onClick: nextPage
194469
+ })
194470
+ ], 64)) : createCommentVNode("", true),
194471
+ ((_a2 = unref(option).tool) == null ? void 0 : _a2.includes("pages")) ? (openBlock(), createElementBlock("div", {
194472
+ key: 1,
194473
+ class: "page"
194474
+ }, [
194475
+ unref(option).single ? (openBlock(), createElementBlock("span", { key: 0 }, toDisplayString(unref(state).pageNum) + "/" + toDisplayString(unref(state).numPages), 1)) : (openBlock(), createElementBlock("span", { key: 1 }, "共 " + toDisplayString(unref(state).numPages) + " 页", 1))
194476
+ ])) : createCommentVNode("", true),
194477
+ ((_b2 = unref(option).tool) == null ? void 0 : _b2.includes("scale")) ? (openBlock(), createElementBlock(Fragment, { key: 2 }, [
194478
+ createVNode$1(_component_wd_icon, {
194479
+ name: "add-circle1",
194480
+ size: "20px",
194481
+ onClick: pageZoomOut
194482
+ }),
194483
+ createVNode$1(_component_wd_icon, {
194484
+ name: "minus-circle",
194485
+ size: "20px",
194486
+ onClick: pageZoomIn
194487
+ })
194488
+ ], 64)) : createCommentVNode("", true)
194489
+ ])) : createCommentVNode("", true)
194490
+ ];
194491
+ }),
194492
+ _: 1
194493
+ });
194462
194494
  };
194463
194495
  }
194464
194496
  });