@gct-paas/word 0.1.67-beta.0 → 0.1.67-beta.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.
package/dist/index.es.js CHANGED
@@ -1,4 +1,4 @@
1
- /*! @gct-paas/word v0.1.67-beta.0 */
1
+ /*! @gct-paas/word v0.1.67-beta.2 */
2
2
  import { Fragment, Suspense, Teleport, Transition, TransitionGroup, cloneVNode, computed, createApp, createBlock, createCommentVNode, createElementBlock, createElementVNode, createSlots, createStaticVNode, createTextVNode, createVNode, defineAsyncComponent, defineComponent, getCurrentInstance, getCurrentScope, guardReactiveProps, h, inject, isRef, isVNode, markRaw, mergeModels, mergeProps, nextTick, normalizeClass, normalizeProps, normalizeStyle, onBeforeMount, onBeforeUnmount, onMounted, onScopeDispose, onUnmounted, openBlock, provide, reactive, readonly, ref, render, renderList, renderSlot, resolveComponent, resolveDynamicComponent, shallowRef, toDisplayString, toRaw, toRef, toValue, unref, useCssVars, useModel, useSlots, vModelText, vShow, watch, watchEffect, withCtx, withDirectives, withKeys, withModifiers } from "vue";
3
3
  import FloatingVue, { PopperWrapper } from "floating-vue";
4
4
  import VueKonva from "vue-konva";
@@ -11,6 +11,8 @@ import exifr from "exifr";
11
11
  import { VxeGrid } from "vxe-table";
12
12
  import CryptoJS from "crypto-js";
13
13
  import { jsPDF } from "jspdf";
14
+ import JsBarcode from "jsbarcode";
15
+ import QRCode from "qrcode";
14
16
  import draggable from "vuedraggable";
15
17
  //#region \0rolldown/runtime.js
16
18
  var __defProp = Object.defineProperty;
@@ -5764,7 +5766,7 @@ var init_rdo_tree_select_panel = __esmMin((() => {
5764
5766
  /**
5765
5767
  * 优先使用 6.0 主工程挂载的 window._api,否则回退到 @gct-paas/api
5766
5768
  */
5767
- function getApi$2() {
5769
+ function getApi() {
5768
5770
  if (typeof globalThis !== "undefined") {
5769
5771
  const globalApi = globalThis._api;
5770
5772
  if (globalApi) return globalApi;
@@ -5773,8 +5775,9 @@ function getApi$2() {
5773
5775
  }
5774
5776
  var api$1;
5775
5777
  var init_api = __esmMin((() => {
5776
- api$1 = new Proxy(api, { get(_target, prop, receiver) {
5777
- return Reflect.get(getApi$2(), prop, receiver);
5778
+ api$1 = new Proxy(api, { get(_target, prop) {
5779
+ const real = getApi();
5780
+ return Reflect.get(real, prop, real);
5778
5781
  } });
5779
5782
  }));
5780
5783
  //#endregion
@@ -92006,8 +92009,9 @@ async function callBizService(apiDef, body) {
92006
92009
  bsKey: apiDef.bsKey,
92007
92010
  modelKey: apiDef.modelKey
92008
92011
  };
92009
- if (apiDef.method === "get") return getApi$1(pathParams, body, requestOptions).catch(() => null);
92010
- return postApi$1(pathParams, {}, body, requestOptions).catch(() => null);
92012
+ const comprehensive = getApi().apaas.modelComprehensive;
92013
+ if (apiDef.method === "get") return comprehensive.getBizServiceModelCategoryModelKeyBsKey(pathParams, body, requestOptions).catch(() => null);
92014
+ return comprehensive.postBizServiceModelCategoryModelKeyBsKey(pathParams, {}, body, requestOptions).catch(() => null);
92011
92015
  }
92012
92016
  /** 判断 biz-service 是否失败(网络异常或业务 ok:false) */
92013
92017
  function isBizServiceFailure(res) {
@@ -92034,11 +92038,9 @@ function unwrapBizServiceDict(res) {
92034
92038
  const dict = res.dict;
92035
92039
  return dict && typeof dict === "object" ? dict : void 0;
92036
92040
  }
92037
- var getApi$1, postApi$1, requestOptions;
92041
+ var requestOptions;
92038
92042
  var init_biz_service_api = __esmMin((() => {
92039
92043
  init_api();
92040
- getApi$1 = api$1.apaas.modelComprehensive.getBizServiceModelCategoryModelKeyBsKey;
92041
- postApi$1 = api$1.apaas.modelComprehensive.postBizServiceModelCategoryModelKeyBsKey;
92042
92044
  requestOptions = { __useWordMessage: true };
92043
92045
  }));
92044
92046
  //#endregion
@@ -97582,7 +97584,7 @@ var init_type = __esmMin((() => {
97582
97584
  * @param params
97583
97585
  */
97584
97586
  async function getParseRuleInfo(params) {
97585
- return (await getApi({
97587
+ return (await getApi().apaas.modelComprehensive.getBizServiceModelCategoryModelKeyBsKey({
97586
97588
  bsKey: "rdoGetVersionById",
97587
97589
  modelKey: "em_barcode_parsing_rules",
97588
97590
  modelCategory: "entity"
@@ -97659,12 +97661,10 @@ function calcFillData(data, fillMapArr) {
97659
97661
  });
97660
97662
  return obj;
97661
97663
  }
97662
- var getApi;
97663
97664
  var init_useLabelParsingRules = __esmMin((() => {
97664
97665
  init_type();
97665
97666
  init_api();
97666
97667
  init_core$1();
97667
- getApi = api$1.apaas.modelComprehensive.getBizServiceModelCategoryModelKeyBsKey;
97668
97668
  }));
97669
97669
  //#endregion
97670
97670
  //#region src/runtime/canvas/table/render/label-parse-rule/index.ts
@@ -121523,6 +121523,9 @@ var init_types$2 = __esmMin((() => {
121523
121523
  }));
121524
121524
  //#endregion
121525
121525
  //#region src/runtime/canvas/table/render/material-consume/service.ts
121526
+ function postBizService(...args) {
121527
+ return getApi().apaas.modelComprehensive.postBizServiceModelCategoryModelKeyBsKey(...args);
121528
+ }
121526
121529
  /**
121527
121530
  * 扫码后查询对应信息和部分后台接口校验
121528
121531
  * @export
@@ -121530,7 +121533,7 @@ var init_types$2 = __esmMin((() => {
121530
121533
  * @return {*}
121531
121534
  */
121532
121535
  async function materialCheck(params) {
121533
- return await postApi({
121536
+ return await postBizService({
121534
121537
  bsKey: "biz_single_material_check",
121535
121538
  modelKey: "em_material_loading",
121536
121539
  modelCategory: "entity"
@@ -121542,7 +121545,7 @@ async function materialCheck(params) {
121542
121545
  * @param params
121543
121546
  */
121544
121547
  async function stockCheck(params) {
121545
- await postApi({
121548
+ await postBizService({
121546
121549
  bsKey: "biz_form_single_confirm",
121547
121550
  modelKey: "em_material_loading",
121548
121551
  modelCategory: "entity"
@@ -121561,7 +121564,7 @@ async function stockCheck(params) {
121561
121564
  * @param params
121562
121565
  */
121563
121566
  async function fetchHistoryConsume(params) {
121564
- const res = await postApi({
121567
+ const res = await postBizService({
121565
121568
  bsKey: "listAll",
121566
121569
  modelKey: "em_material_consume",
121567
121570
  modelCategory: "entity"
@@ -121581,7 +121584,7 @@ async function fetchHistoryConsume(params) {
121581
121584
  * @return {*}
121582
121585
  */
121583
121586
  async function judgeUnique(opts) {
121584
- return await postApi({
121587
+ return await postBizService({
121585
121588
  bsKey: "biz_form_unique",
121586
121589
  modelKey: "em_material_loading",
121587
121590
  modelCategory: "entity"
@@ -121593,7 +121596,7 @@ async function judgeUnique(opts) {
121593
121596
  /** 是否有BOM授权 */
121594
121597
  async function queryIsBomGranted() {
121595
121598
  try {
121596
- return await api$1.apaas.modelComprehensive.getBizServiceModelCategoryModelKeyBsKey({
121599
+ return await getApi().apaas.modelComprehensive.getBizServiceModelCategoryModelKeyBsKey({
121597
121600
  modelKey: "em_product_bom",
121598
121601
  bsKey: "biz_bom_granted",
121599
121602
  modelCategory: "entity"
@@ -121602,10 +121605,8 @@ async function queryIsBomGranted() {
121602
121605
  return false;
121603
121606
  }
121604
121607
  }
121605
- var postApi;
121606
121608
  var init_service$5 = __esmMin((() => {
121607
121609
  init_api();
121608
- postApi = api$1.apaas.modelComprehensive.postBizServiceModelCategoryModelKeyBsKey;
121609
121610
  }));
121610
121611
  //#endregion
121611
121612
  //#region src/runtime/canvas/table/render/material-consume/bom-validator.ts
@@ -125263,6 +125264,14 @@ function useWidgetMeta(widget) {
125263
125264
  isDialog: computed(() => DIALOG_TYPES.has(widgetType.value))
125264
125265
  };
125265
125266
  }
125267
+ function usePaperWidgetMeta(widget) {
125268
+ const { meta: pageWidgetMeta, props: pageWidgetProps, widgetType } = useMetaFromWidget(widget, "pageWidgetMeta");
125269
+ return {
125270
+ pageWidgetMeta,
125271
+ pageWidgetProps,
125272
+ widgetType
125273
+ };
125274
+ }
125266
125275
  function useFieldInfo(fieldMeta) {
125267
125276
  const designCtx = useDesignSuiteContext();
125268
125277
  const field = computed(() => fieldMeta());
@@ -125364,6 +125373,17 @@ function useWidgetStaticAttrs(widget) {
125364
125373
  showDisplayStatus: newDisplayStatus
125365
125374
  };
125366
125375
  }
125376
+ function usePaperWidgetStaticAttrs(widget) {
125377
+ const { docInst, isDesignMode } = useDocPubApiContext();
125378
+ const { pageWidgetMeta, pageWidgetProps, widgetType } = usePaperWidgetMeta(widget);
125379
+ return {
125380
+ docInst,
125381
+ isDesignMode,
125382
+ pageWidgetMeta,
125383
+ pageWidgetProps,
125384
+ widgetType
125385
+ };
125386
+ }
125367
125387
  var MULTIPLE_TYPES, ASYNC_TYPES, DROPDOWN_TYPES, DIALOG_TYPES;
125368
125388
  var init_useWidgetRenderData = __esmMin((() => {
125369
125389
  init_core$1();
@@ -129268,6 +129288,15 @@ function createSignatureImageDataUrl(name, width, height) {
129268
129288
  ctx.fillText(name, width / 2, height / 2 + offsetY);
129269
129289
  return canvas.toDataURL("image/png");
129270
129290
  }
129291
+ /** 创建签名图片 */
129292
+ function createSignatureImage(name, width, height) {
129293
+ const base64 = createSignatureImageDataUrl(name, width, height);
129294
+ return new Promise((resolve) => {
129295
+ const img = new Image();
129296
+ img.src = base64;
129297
+ img.onload = () => resolve(img);
129298
+ });
129299
+ }
129271
129300
  var init_image_size_util = __esmMin((() => {}));
129272
129301
  //#endregion
129273
129302
  //#region src/runtime/renderer/dialogs/signature/logic.ts
@@ -130181,6 +130210,23 @@ function pruneValidationComments(doc) {
130181
130210
  showValidationComments(doc, doc.interactionManager.get("validationCommentMap"));
130182
130211
  showRangeHighlights(doc, doc.interactionManager.get("rangeHighlightMap"));
130183
130212
  }
130213
+ /** 判断字段是否在校验批注中 */
130214
+ function hasFieldValidationError(map, runtimeValuePath) {
130215
+ var _map$runtimeValuePath;
130216
+ if (!map || !runtimeValuePath) return false;
130217
+ if ((_map$runtimeValuePath = map[runtimeValuePath]) === null || _map$runtimeValuePath === void 0 ? void 0 : _map$runtimeValuePath.length) return true;
130218
+ return Object.entries(map).some(([key, fields]) => {
130219
+ if (key === runtimeValuePath) return true;
130220
+ return fields.some((field) => {
130221
+ const message = safeParseJson(field.message);
130222
+ return (message === null || message === void 0 ? void 0 : message.runtimeValuePath) === runtimeValuePath;
130223
+ });
130224
+ });
130225
+ }
130226
+ /** 字段是否应标红(批注错误或禁用上下限标红) */
130227
+ function hasFieldErrorHighlight(validationCommentMap, rangeHighlightMap, runtimeValuePath) {
130228
+ return hasFieldValidationError(validationCommentMap, runtimeValuePath) || hasFieldValidationError(rangeHighlightMap, runtimeValuePath);
130229
+ }
130184
130230
  /** 按运行时 valuePath 在布局树中查找对应 widget 节点(子表每行 path 唯一) */
130185
130231
  function findLayoutNodeByValuePath(doc, runtimeValuePath) {
130186
130232
  var _doc$pages;
@@ -142363,12 +142409,2134 @@ function loadPaperWidgetManifestModules() {
142363
142409
  }
142364
142410
  var paperWidgetManifestMap = loadPaperWidgetManifestModules();
142365
142411
  //#endregion
142366
- //#region src/suites/edhr/component/index.ts
142412
+ //#region src/assets/theme/field-state.ts
142367
142413
  /**
142368
- * 同步加载 Vue 组件
142414
+ * 字段交互态配色(Canvas 渲染使用)。
142415
+ * Less 侧见 field-state.less,修改时请同步两处。
142369
142416
  */
142417
+ var FieldStateColors = {
142418
+ /** 可编辑:浅蓝底 */
142419
+ editableBg: "#F2F8FE",
142420
+ editableBgActive: "rgba(147, 197, 253, 0.4)",
142421
+ editableLine: "#999999",
142422
+ /** 暗提示(空值占位文字) */
142423
+ editablePlaceholderText: "#b8b8b8",
142424
+ readonlyPlaceholderText: "#b0b0b0",
142425
+ printPlaceholderText: "#b8b8b8",
142426
+ /** 只读:灰底 + 灰边框,与可编辑蓝底形成对比 */
142427
+ readonlyBg: "#f5f6f8",
142428
+ readonlyBgActive: "#eff1f4",
142429
+ readonlyBorder: "#d9d9d9",
142430
+ readonlyLine: "#bfbfbf",
142431
+ readonlyText: "rgba(0, 0, 0, 0.65)",
142432
+ /** 填报只读 - 有值文本(gct-text-render) */
142433
+ readonlyValueBg: "#f0f2f5",
142434
+ readonlyValueBgActive: "#e8ebf0",
142435
+ readonlyValueText: "rgba(0, 0, 0, 0.78)",
142436
+ readonlyValueLine: "#adb5bd",
142437
+ /** 填报只读 - 空值占位(gct-placeholder-render) */
142438
+ readonlyPlaceholderBg: "#f5f7fa",
142439
+ readonlyPlaceholderBgActive: "#eef1f5",
142440
+ readonlyPlaceholderLine: "#c4c9d0",
142441
+ /** 打印:透明底,不叠加交互态背景 */
142442
+ printBg: "transparent",
142443
+ /** 字段括号 [] 颜色 */
142444
+ markerDefault: "#000000",
142445
+ markerReadonly: "#8c8c8c",
142446
+ markerDisabled: "#c9c9c9",
142447
+ /** 只读选中态(checkbox / radio) */
142448
+ readonlyCheckedBorder: "#91caff",
142449
+ readonlyCheckedBg: "#e6f4ff",
142450
+ readonlyCheckedFill: "#69b1ff",
142451
+ /** 禁用 */
142452
+ disabledBg: "#f5f5f5",
142453
+ disabledBgActive: "#f0f0f0",
142454
+ disabledText: "#c9c9c9",
142455
+ disabledLine: "#c9c9c9",
142456
+ disabledFill: "rgba(0, 0, 0, 0.04)",
142457
+ /** 校验失败(超上下限等) */
142458
+ validationErrorText: "#ff4d4f",
142459
+ validationErrorLine: "#ff4d4f",
142460
+ validationErrorBg: "#fff2f2",
142461
+ /** 禁用态校验失败 */
142462
+ validationErrorDisabledText: "#ff7072",
142463
+ validationErrorDisabledLine: "#ff8a8c",
142464
+ validationErrorDisabledBg: "#f5f5f5",
142465
+ validationErrorDisabledBgActive: "#f0f0f0"
142466
+ };
142467
+ //#endregion
142468
+ //#region src/suites/shared/components/checkbox-canvas.vue?vue&type=script&setup=true&lang.ts
142469
+ init_core$1();
142470
+ //#endregion
142471
+ //#region src/suites/shared/components/checkbox-canvas.vue
142472
+ var checkbox_canvas_default = /* @__PURE__ */ defineComponent({
142473
+ __name: "checkbox-canvas",
142474
+ props: {
142475
+ id: {},
142476
+ x: {},
142477
+ y: {},
142478
+ value: { type: [
142479
+ String,
142480
+ Number,
142481
+ Boolean
142482
+ ] },
142483
+ modelValue: {},
142484
+ readonly: { type: Boolean },
142485
+ disabled: { type: Boolean },
142486
+ required: { type: Boolean },
142487
+ multiple: { type: Boolean },
142488
+ size: {},
142489
+ iconType: {}
142490
+ },
142491
+ emits: ["update:modelValue", "change"],
142492
+ setup(__props, { emit: __emit }) {
142493
+ const props = __props;
142494
+ const emit = __emit;
142495
+ const hover = ref(false);
142496
+ const boxSize = computed(() => props.size === "small" ? 14 : 18);
142497
+ const hitArea = computed(() => {
142498
+ return {
142499
+ x: -4,
142500
+ y: -4,
142501
+ size: boxSize.value + 8
142502
+ };
142503
+ });
142504
+ const checked = computed(() => {
142505
+ if (props.multiple) return Array.isArray(props.modelValue) && props.modelValue.includes(props.value);
142506
+ return props.modelValue === props.value;
142507
+ });
142508
+ const isReadonly = computed(() => !!props.readonly);
142509
+ const isDisabled = computed(() => !!props.disabled);
142510
+ const isRequired = computed(() => !!props.required);
142511
+ const borderColor = computed(() => {
142512
+ if (isDisabled.value) return FieldStateColors.readonlyBorder;
142513
+ if (isReadonly.value) {
142514
+ if (checked.value) return FieldStateColors.readonlyCheckedBorder;
142515
+ return FieldStateColors.readonlyLine;
142516
+ }
142517
+ if (checked.value) return "#026ac8";
142518
+ if (isRequired.value) return "#ff4d4f";
142519
+ if (hover.value) return "#026ac8";
142520
+ return "rgb(128, 128, 128)";
142521
+ });
142522
+ const backgroundColor = computed(() => {
142523
+ if (isDisabled.value) return FieldStateColors.disabledFill;
142524
+ if (isReadonly.value) {
142525
+ if (checked.value) return FieldStateColors.readonlyCheckedBg;
142526
+ return FieldStateColors.readonlyBg;
142527
+ }
142528
+ if (checked.value) return "#026ac8";
142529
+ if (isRequired.value) return "rgba(255, 77, 79, 0.05)";
142530
+ return "#fff";
142531
+ });
142532
+ const checkedColor = computed(() => {
142533
+ if (isDisabled.value) return FieldStateColors.disabledText;
142534
+ if (isReadonly.value) return FieldStateColors.readonlyCheckedFill;
142535
+ return "#fff";
142536
+ });
142537
+ const checkPoints = computed(() => {
142538
+ const s = boxSize.value;
142539
+ return [
142540
+ halfPixel(s * .25) - 2,
142541
+ halfPixel(s * .55) - 1,
142542
+ halfPixel(s * .42) - 1,
142543
+ halfPixel(s * .72),
142544
+ halfPixel(s * .75),
142545
+ halfPixel(s * .28) - 1
142546
+ ];
142547
+ });
142548
+ function onClick() {
142549
+ if (isDisabled.value || isReadonly.value) return;
142550
+ const mv = props.modelValue;
142551
+ setTimeout(() => {
142552
+ if (props.multiple) {
142553
+ const list = Array.isArray(mv) ? [...mv] : [];
142554
+ const index = list.indexOf(props.value);
142555
+ if (index > -1) list.splice(index, 1);
142556
+ else list.push(props.value);
142557
+ emit("update:modelValue", list);
142558
+ emit("change", list);
142559
+ return;
142560
+ }
142561
+ if (checked.value) {
142562
+ emit("update:modelValue", void 0);
142563
+ emit("change", void 0);
142564
+ } else {
142565
+ emit("update:modelValue", props.value);
142566
+ emit("change", props.value);
142567
+ }
142568
+ }, 120);
142569
+ }
142570
+ function onEnter() {
142571
+ if (isReadonly.value || isDisabled.value) return;
142572
+ hover.value = true;
142573
+ }
142574
+ function onLeave() {
142575
+ hover.value = false;
142576
+ }
142577
+ return (_ctx, _cache) => {
142578
+ const _component_v_rect = resolveComponent("v-rect");
142579
+ const _component_v_line = resolveComponent("v-line");
142580
+ const _component_v_group = resolveComponent("v-group");
142581
+ return openBlock(), createBlock(_component_v_group, { config: {
142582
+ x: __props.x,
142583
+ y: __props.y,
142584
+ id: __props.id,
142585
+ onPointerenter: onEnter,
142586
+ onPointerleave: onLeave
142587
+ } }, {
142588
+ default: withCtx(() => [
142589
+ createVNode(_component_v_rect, {
142590
+ width: boxSize.value,
142591
+ height: boxSize.value,
142592
+ cornerRadius: 2,
142593
+ stroke: borderColor.value,
142594
+ fill: backgroundColor.value,
142595
+ strokeWidth: 1,
142596
+ listening: false
142597
+ }, null, 8, [
142598
+ "width",
142599
+ "height",
142600
+ "stroke",
142601
+ "fill"
142602
+ ]),
142603
+ checked.value ? (openBlock(), createBlock(_component_v_line, {
142604
+ key: 0,
142605
+ points: checkPoints.value,
142606
+ stroke: checkedColor.value,
142607
+ strokeWidth: 2,
142608
+ lineCap: "round",
142609
+ lineJoin: "round",
142610
+ perfectDrawEnabled: false,
142611
+ listening: false
142612
+ }, null, 8, ["points", "stroke"])) : createCommentVNode("", true),
142613
+ createVNode(_component_v_rect, {
142614
+ x: hitArea.value.x,
142615
+ y: hitArea.value.y,
142616
+ width: hitArea.value.size,
142617
+ height: hitArea.value.size,
142618
+ fill: "transparent",
142619
+ listening: true,
142620
+ onPointerdown: onClick
142621
+ }, null, 8, [
142622
+ "x",
142623
+ "y",
142624
+ "width",
142625
+ "height"
142626
+ ])
142627
+ ]),
142628
+ _: 1
142629
+ }, 8, ["config"]);
142630
+ };
142631
+ }
142632
+ });
142633
+ //#endregion
142634
+ //#region src/suites/shared/components/radio-canvas.vue?vue&type=script&setup=true&lang.ts
142635
+ var radius = 8;
142636
+ //#endregion
142637
+ //#region src/suites/shared/components/radio-canvas.vue
142638
+ var radio_canvas_default = /* @__PURE__ */ defineComponent({
142639
+ __name: "radio-canvas",
142640
+ props: {
142641
+ id: {},
142642
+ x: {},
142643
+ y: {},
142644
+ value: { type: [
142645
+ String,
142646
+ Number,
142647
+ Boolean
142648
+ ] },
142649
+ modelValue: {},
142650
+ readonly: { type: Boolean },
142651
+ disabled: { type: Boolean },
142652
+ required: { type: Boolean },
142653
+ multiple: { type: Boolean },
142654
+ iconType: {}
142655
+ },
142656
+ emits: ["update:modelValue", "change"],
142657
+ setup(__props, { emit: __emit }) {
142658
+ const props = __props;
142659
+ const emit = __emit;
142660
+ const hover = ref(false);
142661
+ const hitArea = computed(() => {
142662
+ return {
142663
+ x: -3,
142664
+ y: -3,
142665
+ size: 23
142666
+ };
142667
+ });
142668
+ const checked = computed(() => {
142669
+ if (props.multiple) return Array.isArray(props.modelValue) && props.modelValue.includes(props.value);
142670
+ return props.modelValue === props.value;
142671
+ });
142672
+ const isReadonly = computed(() => !!props.readonly);
142673
+ const isDisabled = computed(() => !!props.disabled);
142674
+ const isRequired = computed(() => !!props.required);
142675
+ const borderColor = computed(() => {
142676
+ if (isDisabled.value) return FieldStateColors.readonlyBorder;
142677
+ if (isReadonly.value) {
142678
+ if (checked.value) return FieldStateColors.readonlyCheckedBorder;
142679
+ return FieldStateColors.readonlyLine;
142680
+ }
142681
+ if (checked.value) return "#026ac8";
142682
+ if (isRequired.value) return "#ff4d4f";
142683
+ if (hover.value) return "#026ac8";
142684
+ return "rgb(128, 128, 128)";
142685
+ });
142686
+ const backgroundColor = computed(() => {
142687
+ if (isDisabled.value) return FieldStateColors.disabledFill;
142688
+ if (isReadonly.value) {
142689
+ if (checked.value) return FieldStateColors.readonlyCheckedBg;
142690
+ return FieldStateColors.readonlyBg;
142691
+ }
142692
+ if (checked.value) return "#026ac8";
142693
+ if (isRequired.value) return "rgba(255, 77, 79, 0.05)";
142694
+ return "#fff";
142695
+ });
142696
+ const checkedColor = computed(() => {
142697
+ if (isDisabled.value) return FieldStateColors.disabledText;
142698
+ if (isReadonly.value) return FieldStateColors.readonlyCheckedFill;
142699
+ return "#fff";
142700
+ });
142701
+ const innerRadius = computed(() => radius * .5);
142702
+ function onClick() {
142703
+ if (isDisabled.value || isReadonly.value) return;
142704
+ const mv = props.modelValue;
142705
+ setTimeout(() => {
142706
+ if (props.multiple) {
142707
+ const list = Array.isArray(mv) ? [...mv] : [];
142708
+ const index = list.indexOf(props.value);
142709
+ if (index > -1) list.splice(index, 1);
142710
+ else list.push(props.value);
142711
+ emit("update:modelValue", list);
142712
+ emit("change", list);
142713
+ return;
142714
+ }
142715
+ if (checked.value) {
142716
+ emit("update:modelValue", void 0);
142717
+ emit("change", void 0);
142718
+ } else {
142719
+ emit("update:modelValue", props.value);
142720
+ emit("change", props.value);
142721
+ }
142722
+ }, 120);
142723
+ }
142724
+ function onEnter() {
142725
+ if (isReadonly.value || isDisabled.value) return;
142726
+ hover.value = true;
142727
+ }
142728
+ function onLeave() {
142729
+ hover.value = false;
142730
+ }
142731
+ return (_ctx, _cache) => {
142732
+ const _component_v_circle = resolveComponent("v-circle");
142733
+ const _component_v_rect = resolveComponent("v-rect");
142734
+ const _component_v_group = resolveComponent("v-group");
142735
+ return openBlock(), createBlock(_component_v_group, { config: {
142736
+ x: __props.x,
142737
+ y: __props.y,
142738
+ id: __props.id,
142739
+ onPointerenter: onEnter,
142740
+ onPointerleave: onLeave
142741
+ } }, {
142742
+ default: withCtx(() => [
142743
+ createVNode(_component_v_circle, {
142744
+ x: radius,
142745
+ y: radius,
142746
+ radius,
142747
+ stroke: borderColor.value,
142748
+ strokeWidth: 1,
142749
+ fill: backgroundColor.value,
142750
+ perfectDrawEnabled: false,
142751
+ strokeScaleEnabled: false,
142752
+ hitGraphEnabled: false
142753
+ }, null, 8, ["stroke", "fill"]),
142754
+ checked.value ? (openBlock(), createBlock(_component_v_circle, {
142755
+ key: 0,
142756
+ x: radius,
142757
+ y: radius,
142758
+ radius: innerRadius.value,
142759
+ fill: checkedColor.value,
142760
+ perfectDrawEnabled: false,
142761
+ strokeScaleEnabled: false,
142762
+ hitGraphEnabled: false
142763
+ }, null, 8, ["radius", "fill"])) : createCommentVNode("", true),
142764
+ createVNode(_component_v_rect, {
142765
+ x: hitArea.value.x,
142766
+ y: hitArea.value.y,
142767
+ width: hitArea.value.size,
142768
+ height: hitArea.value.size,
142769
+ fill: "transparent",
142770
+ listening: true,
142771
+ onPointerdown: onClick
142772
+ }, null, 8, [
142773
+ "x",
142774
+ "y",
142775
+ "width",
142776
+ "height"
142777
+ ])
142778
+ ]),
142779
+ _: 1
142780
+ }, 8, ["config"]);
142781
+ };
142782
+ }
142783
+ });
142784
+ //#endregion
142785
+ //#region src/suites/shared/components/icon-canvas.vue?vue&type=script&setup=true&lang.ts
142786
+ init_attachment();
142787
+ init_doc();
142788
+ init_img();
142789
+ init_mp4();
142790
+ init_pdf();
142791
+ init_ppt();
142792
+ init_xlsx();
142793
+ //#endregion
142794
+ //#region src/suites/shared/components/icon-canvas.vue
142795
+ var icon_canvas_default = /* @__PURE__ */ defineComponent({
142796
+ __name: "icon-canvas",
142797
+ props: {
142798
+ id: {},
142799
+ x: {},
142800
+ y: {},
142801
+ value: { type: [
142802
+ String,
142803
+ Number,
142804
+ Boolean
142805
+ ] },
142806
+ modelValue: {},
142807
+ readonly: { type: Boolean },
142808
+ disabled: { type: Boolean },
142809
+ required: { type: Boolean },
142810
+ multiple: { type: Boolean },
142811
+ size: {},
142812
+ iconType: {}
142813
+ },
142814
+ setup(__props) {
142815
+ const svg = {
142816
+ img: img_default,
142817
+ doc: doc_default,
142818
+ mp4: mp4_default,
142819
+ pdf: pdf_default,
142820
+ xlsx: xlsx_default,
142821
+ ppt: ppt_default,
142822
+ attachment: attachment_default
142823
+ };
142824
+ const props = __props;
142825
+ const imageObj = ref();
142826
+ onMounted(() => {
142827
+ const img = new Image();
142828
+ img.src = svg[props.iconType || "attachment"];
142829
+ img.onload = () => {
142830
+ imageObj.value = img;
142831
+ };
142832
+ });
142833
+ return (_ctx, _cache) => {
142834
+ const _component_v_image = resolveComponent("v-image");
142835
+ return imageObj.value ? (openBlock(), createBlock(_component_v_image, {
142836
+ key: 0,
142837
+ config: {
142838
+ x: __props.x,
142839
+ y: __props.y - 6,
142840
+ image: imageObj.value,
142841
+ width: 24,
142842
+ height: 24
142843
+ }
142844
+ }, null, 8, ["config"])) : createCommentVNode("", true);
142845
+ };
142846
+ }
142847
+ });
142848
+ //#endregion
142849
+ //#region src/suites/edhr/component/gct-control-render.vue?vue&type=script&setup=true&name=gct-control-render&lang.ts
142850
+ init_core$1();
142851
+ init_file();
142852
+ init_enum();
142853
+ init_useWidgetRenderData();
142854
+ init_form_value();
142855
+ init_core();
142856
+ init_field_type();
142857
+ var gct_control_render_vue_vue_type_script_setup_true_name_gct_control_render_lang_default = /*@__PURE__*/ defineComponent({
142858
+ __name: "gct-control-render",
142859
+ props: {
142860
+ modelId: {},
142861
+ widget: {}
142862
+ },
142863
+ setup(__props) {
142864
+ const props = __props;
142865
+ /**
142866
+ * 组件映射表
142867
+ */
142868
+ const RenderCompMap = {
142869
+ [RenderCompTypeConst.Checkbox]: checkbox_canvas_default,
142870
+ [RenderCompTypeConst.Radio]: radio_canvas_default,
142871
+ icon: icon_canvas_default
142872
+ };
142873
+ const { docInst, isMultiple, runtimeValuePath, showRequired, showDisabled, showReadonly, widgetProps, widgetType, fieldMeta } = useWidgetStaticAttrs(props.widget);
142874
+ const CurrentComp = computed(() => {
142875
+ if (widgetType.value === "fw:file") return RenderCompMap["icon"] ?? null;
142876
+ const type = widgetProps.value.renderComp;
142877
+ return RenderCompMap[type] ?? null;
142878
+ });
142879
+ const iconType = computed(() => {
142880
+ if (widgetType.value === "fw:file") {
142881
+ var _props$widget;
142882
+ return getUploadFileIcon((_props$widget = props.widget) === null || _props$widget === void 0 || (_props$widget = _props$widget.widgetFileItem) === null || _props$widget === void 0 ? void 0 : _props$widget.value);
142883
+ }
142884
+ });
142885
+ computed(() => safeParseJson(widgetProps.value.optionsJson));
142886
+ /**
142887
+ * 当前选项值
142888
+ */
142889
+ const optionValue = computed(() => {
142890
+ var _props$widget2;
142891
+ return (_props$widget2 = props.widget) === null || _props$widget2 === void 0 || (_props$widget2 = _props$widget2.widgetOption) === null || _props$widget2 === void 0 ? void 0 : _props$widget2.value;
142892
+ });
142893
+ const modelValue = computed({
142894
+ get() {
142895
+ var _fieldMeta$value;
142896
+ let value;
142897
+ if (docInst.value.isInEditMode()) {
142898
+ var _docInst$value;
142899
+ value = (_docInst$value = docInst.value) === null || _docInst$value === void 0 || (_docInst$value = _docInst$value.dataManager) === null || _docInst$value === void 0 ? void 0 : _docInst$value.getDefault(runtimeValuePath.value);
142900
+ } else {
142901
+ var _docInst$value2;
142902
+ value = (_docInst$value2 = docInst.value) === null || _docInst$value2 === void 0 || (_docInst$value2 = _docInst$value2.dataManager) === null || _docInst$value2 === void 0 ? void 0 : _docInst$value2.get(runtimeValuePath.value);
142903
+ }
142904
+ if (((_fieldMeta$value = fieldMeta.value) === null || _fieldMeta$value === void 0 ? void 0 : _fieldMeta$value.fieldType) === FIELD_TYPE.BOOLEAN) value = toBoolean(value);
142905
+ return getValue$1(value, isMultiple.value);
142906
+ },
142907
+ set(v) {
142908
+ var _docInst$value3;
142909
+ const data = setValue(v, runtimeValuePath.value, { multiple: isMultiple.value });
142910
+ (_docInst$value3 = docInst.value) === null || _docInst$value3 === void 0 || _docInst$value3.dataManager.setMultiple(data, "user");
142911
+ }
142912
+ });
142913
+ return (_ctx, _cache) => {
142914
+ return CurrentComp.value ? (openBlock(), createBlock(resolveDynamicComponent(CurrentComp.value), {
142915
+ key: 0,
142916
+ id: __props.widget.id,
142917
+ x: 0,
142918
+ y: 0,
142919
+ readonly: unref(showReadonly),
142920
+ disabled: unref(showDisabled),
142921
+ required: unref(showRequired),
142922
+ multiple: unref(isMultiple),
142923
+ iconType: iconType.value,
142924
+ value: optionValue.value,
142925
+ "model-value": modelValue.value,
142926
+ "onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => modelValue.value = $event)
142927
+ }, null, 8, [
142928
+ "id",
142929
+ "readonly",
142930
+ "disabled",
142931
+ "required",
142932
+ "multiple",
142933
+ "iconType",
142934
+ "value",
142935
+ "model-value"
142936
+ ])) : createCommentVNode("", true);
142937
+ };
142938
+ }
142939
+ });
142940
+ //#endregion
142941
+ //#region src/suites/edhr/component/gct-control-render.vue
142942
+ var gct_control_render_exports = /* @__PURE__ */ __exportAll({ default: () => gct_control_render_default });
142943
+ var gct_control_render_default = gct_control_render_vue_vue_type_script_setup_true_name_gct_control_render_lang_default;
142944
+ //#endregion
142945
+ //#region src/suites/edhr/component/gct-image-render.vue?vue&type=script&setup=true&name=gct-image-render&lang.ts
142946
+ init_asset_helper_util();
142947
+ init_image_size_util();
142948
+ init_constants();
142949
+ init_core$1();
142950
+ init__register_();
142951
+ init_useWidgetRenderData();
142952
+ var gct_image_render_vue_vue_type_script_setup_true_name_gct_image_render_lang_default = /*@__PURE__*/ defineComponent({
142953
+ __name: "gct-image-render",
142954
+ props: {
142955
+ widget: {},
142956
+ modelId: {}
142957
+ },
142958
+ setup(__props) {
142959
+ const interCtx = useInteractionContext();
142960
+ const props = __props;
142961
+ const imgRef = ref(null);
142962
+ const { runtimeValuePath } = useWidgetStaticAttrs(props.widget);
142963
+ const natural = ref({
142964
+ width: 0,
142965
+ height: 0
142966
+ });
142967
+ const display = ref({
142968
+ width: props.widget.width ?? 100,
142969
+ height: props.widget.height ?? 100
142970
+ });
142971
+ const placeholder = {
142972
+ width: props.widget.width ?? 120,
142973
+ height: props.widget.height ?? 80,
142974
+ fill: "#f3f3f3"
142975
+ };
142976
+ watch(() => props.widget.src, async (v) => {
142977
+ const img = await AssetHelper.loadImage(v);
142978
+ if (!img) return;
142979
+ natural.value = {
142980
+ width: img.naturalWidth,
142981
+ height: img.naturalHeight
142982
+ };
142983
+ const size = computeImageDisplaySize(natural.value, {
142984
+ width: props.widget.width,
142985
+ height: props.widget.height,
142986
+ keepAspect: props.widget.keepAspect ?? true,
142987
+ maxDefaultWidth: 200
142988
+ });
142989
+ display.value = size;
142990
+ imgRef.value = img;
142991
+ }, { immediate: true });
142992
+ const imageConfig = computed(() => {
142993
+ const w = display.value.width;
142994
+ const h = display.value.height;
142995
+ return {
142996
+ x: 0,
142997
+ y: 0,
142998
+ image: imgRef.value,
142999
+ width: w,
143000
+ height: h
143001
+ };
143002
+ });
143003
+ const baseLineConfig = {
143004
+ stroke: "#ff4d4f",
143005
+ strokeWidth: 1,
143006
+ ...baseCanvasAttrs
143007
+ };
143008
+ const useLineConfig = (offsetY = 0) => computed(() => ({
143009
+ points: [
143010
+ 0,
143011
+ halfPixel(display.value.height + offsetY),
143012
+ halfPixel(props.widget.width),
143013
+ halfPixel(display.value.height + offsetY)
143014
+ ],
143015
+ ...baseLineConfig
143016
+ }));
143017
+ const lineOneConfig = useLineConfig(0);
143018
+ const lineTwoConfig = useLineConfig(2);
143019
+ const isShowMark = computed(() => {
143020
+ return interCtx.annotationIds && interCtx.annotationIds.length !== 0 && interCtx.annotationIds.includes(runtimeValuePath.value);
143021
+ });
143022
+ return (_ctx, _cache) => {
143023
+ const _component_v_line = resolveComponent("v-line");
143024
+ const _component_v_image = resolveComponent("v-image");
143025
+ const _component_v_rect = resolveComponent("v-rect");
143026
+ const _component_v_group = resolveComponent("v-group");
143027
+ return openBlock(), createBlock(_component_v_group, null, {
143028
+ default: withCtx(() => [
143029
+ isShowMark.value ? (openBlock(), createBlock(_component_v_line, {
143030
+ key: 0,
143031
+ config: unref(lineOneConfig)
143032
+ }, null, 8, ["config"])) : createCommentVNode("", true),
143033
+ isShowMark.value ? (openBlock(), createBlock(_component_v_line, {
143034
+ key: 1,
143035
+ config: unref(lineTwoConfig)
143036
+ }, null, 8, ["config"])) : createCommentVNode("", true),
143037
+ imgRef.value ? (openBlock(), createBlock(_component_v_image, {
143038
+ key: 2,
143039
+ config: imageConfig.value
143040
+ }, null, 8, ["config"])) : (openBlock(), createBlock(_component_v_rect, {
143041
+ key: 3,
143042
+ width: placeholder.width,
143043
+ height: placeholder.height,
143044
+ fill: placeholder.fill
143045
+ }, null, 8, [
143046
+ "width",
143047
+ "height",
143048
+ "fill"
143049
+ ]))
143050
+ ]),
143051
+ _: 1
143052
+ });
143053
+ };
143054
+ }
143055
+ });
143056
+ //#endregion
143057
+ //#region src/suites/edhr/component/gct-image-render.vue
143058
+ var gct_image_render_exports = /* @__PURE__ */ __exportAll({ default: () => gct_image_render_default });
143059
+ var gct_image_render_default = gct_image_render_vue_vue_type_script_setup_true_name_gct_image_render_lang_default;
143060
+ //#endregion
143061
+ //#region src/suites/edhr/component/use-marker-render-colors.ts
143062
+ init_useWidgetRenderData();
143063
+ function useMarkerRenderColors(widget) {
143064
+ const { docInst, showDisabled, showReadonly } = useWidgetStaticAttrs(widget);
143065
+ return { fill: computed(() => {
143066
+ if (docInst.value.isInPrintMode()) return FieldStateColors.markerDefault;
143067
+ if (showDisabled.value) return FieldStateColors.markerDisabled;
143068
+ if (showReadonly.value) return FieldStateColors.markerReadonly;
143069
+ return FieldStateColors.markerDefault;
143070
+ }) };
143071
+ }
143072
+ //#endregion
143073
+ //#region src/suites/edhr/component/gct-leftMarker-render.vue?vue&type=script&setup=true&name=gct-leftMarker-render&lang.ts
143074
+ var gct_leftMarker_render_vue_vue_type_script_setup_true_name_gct_leftMarker_render_lang_default = /*@__PURE__*/ defineComponent({
143075
+ __name: "gct-leftMarker-render",
143076
+ props: {
143077
+ widget: {},
143078
+ modelId: {}
143079
+ },
143080
+ setup(__props) {
143081
+ const props = __props;
143082
+ const { fill } = useMarkerRenderColors(props.widget);
143083
+ const textConfig = computed(() => ({
143084
+ x: 0,
143085
+ y: 0,
143086
+ width: props.widget.width,
143087
+ text: props.widget.text,
143088
+ fontSize: props.widget.fontSize,
143089
+ fontFamily: props.widget.fontFamily,
143090
+ fill: fill.value,
143091
+ wrap: "none"
143092
+ }));
143093
+ return (_ctx, _cache) => {
143094
+ const _component_v_text = resolveComponent("v-text");
143095
+ const _component_v_group = resolveComponent("v-group");
143096
+ return openBlock(), createBlock(_component_v_group, null, {
143097
+ default: withCtx(() => [createVNode(_component_v_text, {
143098
+ ref: "textRef",
143099
+ id: __props.widget.id,
143100
+ config: textConfig.value
143101
+ }, null, 8, ["id", "config"])]),
143102
+ _: 1
143103
+ });
143104
+ };
143105
+ }
143106
+ });
143107
+ //#endregion
143108
+ //#region src/suites/edhr/component/gct-leftMarker-render.vue
143109
+ var gct_leftMarker_render_exports = /* @__PURE__ */ __exportAll({ default: () => gct_leftMarker_render_default });
143110
+ var gct_leftMarker_render_default = gct_leftMarker_render_vue_vue_type_script_setup_true_name_gct_leftMarker_render_lang_default;
143111
+ //#endregion
143112
+ //#region src/suites/edhr/component/gct-placeholder-render.vue?vue&type=script&setup=true&name=gct-placeholder-render&lang.ts
143113
+ init__register_();
143114
+ init_useWidgetRenderData();
143115
+ var gct_placeholder_render_vue_vue_type_script_setup_true_name_gct_placeholder_render_lang_default = /*@__PURE__*/ defineComponent({
143116
+ __name: "gct-placeholder-render",
143117
+ props: {
143118
+ widget: {},
143119
+ modelId: {}
143120
+ },
143121
+ setup(__props) {
143122
+ const props = __props;
143123
+ const interCtx = useInteractionContext();
143124
+ const { docInst, showDisabled, showRequired, showReadonly } = useWidgetStaticAttrs(props.widget);
143125
+ const isActive = computed(() => {
143126
+ var _interCtx$panelData;
143127
+ return props.modelId === ((_interCtx$panelData = interCtx.panelData) === null || _interCtx$panelData === void 0 ? void 0 : _interCtx$panelData.modelId) || props.modelId === interCtx.hoverModelId;
143128
+ });
143129
+ /**
143130
+ * 统一颜色逻辑
143131
+ */
143132
+ const colors = computed(() => {
143133
+ if (docInst.value.isInPrintMode()) return {
143134
+ text: FieldStateColors.printPlaceholderText,
143135
+ line: FieldStateColors.editableLine,
143136
+ bg: FieldStateColors.printBg
143137
+ };
143138
+ if (showDisabled.value) return {
143139
+ text: FieldStateColors.disabledText,
143140
+ line: FieldStateColors.disabledLine,
143141
+ bg: isActive.value ? FieldStateColors.disabledBgActive : FieldStateColors.disabledBg
143142
+ };
143143
+ if (showReadonly.value) return {
143144
+ text: FieldStateColors.readonlyPlaceholderText,
143145
+ line: FieldStateColors.readonlyPlaceholderLine,
143146
+ bg: FieldStateColors.printBg
143147
+ };
143148
+ if (showRequired.value) return {
143149
+ text: "#f26c6c",
143150
+ line: "#f26c6c",
143151
+ bg: isActive.value ? "rgba(255, 230, 230, 1)" : "rgba(255, 242, 242, 1)"
143152
+ };
143153
+ return {
143154
+ text: FieldStateColors.editablePlaceholderText,
143155
+ line: FieldStateColors.editableLine,
143156
+ bg: isActive.value ? FieldStateColors.editableBgActive : FieldStateColors.editableBg
143157
+ };
143158
+ });
143159
+ const textConfig = computed(() => ({
143160
+ x: 0,
143161
+ y: 0,
143162
+ text: props.widget.text,
143163
+ fontSize: props.widget.fontSize,
143164
+ fontFamily: props.widget.fontFamily,
143165
+ fill: colors.value.text,
143166
+ wrap: "none"
143167
+ }));
143168
+ computed(() => ({
143169
+ points: [
143170
+ 0,
143171
+ props.widget.fontSize + 4,
143172
+ props.widget.width,
143173
+ props.widget.fontSize + 4
143174
+ ],
143175
+ stroke: colors.value.line,
143176
+ strokeWidth: 1
143177
+ }));
143178
+ const bgConfig = computed(() => ({
143179
+ x: 0,
143180
+ y: -3,
143181
+ width: props.widget.width,
143182
+ height: props.widget.height + 6,
143183
+ fill: colors.value.bg
143184
+ }));
143185
+ return (_ctx, _cache) => {
143186
+ const _component_v_rect = resolveComponent("v-rect");
143187
+ const _component_v_text = resolveComponent("v-text");
143188
+ const _component_v_group = resolveComponent("v-group");
143189
+ return openBlock(), createBlock(_component_v_group, null, {
143190
+ default: withCtx(() => [createVNode(_component_v_rect, { config: bgConfig.value }, null, 8, ["config"]), createVNode(_component_v_text, {
143191
+ ref: "textRef",
143192
+ id: __props.widget.id,
143193
+ config: textConfig.value
143194
+ }, null, 8, ["id", "config"])]),
143195
+ _: 1
143196
+ });
143197
+ };
143198
+ }
143199
+ });
143200
+ //#endregion
143201
+ //#region src/suites/edhr/component/gct-placeholder-render.vue
143202
+ var gct_placeholder_render_exports = /* @__PURE__ */ __exportAll({ default: () => gct_placeholder_render_default });
143203
+ var gct_placeholder_render_default = gct_placeholder_render_vue_vue_type_script_setup_true_name_gct_placeholder_render_lang_default;
143204
+ //#endregion
143205
+ //#region src/suites/edhr/component/gct-rightMarker-render.vue?vue&type=script&setup=true&name=gct-rightMarker-render&lang.ts
143206
+ var gct_rightMarker_render_vue_vue_type_script_setup_true_name_gct_rightMarker_render_lang_default = /*@__PURE__*/ defineComponent({
143207
+ __name: "gct-rightMarker-render",
143208
+ props: {
143209
+ widget: {},
143210
+ modelId: {}
143211
+ },
143212
+ setup(__props) {
143213
+ const props = __props;
143214
+ const { fill } = useMarkerRenderColors(props.widget);
143215
+ const textConfig = computed(() => ({
143216
+ x: 0,
143217
+ y: 0,
143218
+ width: props.widget.width,
143219
+ text: props.widget.text,
143220
+ fontSize: props.widget.fontSize,
143221
+ fontFamily: props.widget.fontFamily,
143222
+ fill: fill.value,
143223
+ wrap: "none",
143224
+ align: "right"
143225
+ }));
143226
+ return (_ctx, _cache) => {
143227
+ const _component_v_text = resolveComponent("v-text");
143228
+ const _component_v_group = resolveComponent("v-group");
143229
+ return openBlock(), createBlock(_component_v_group, null, {
143230
+ default: withCtx(() => [createVNode(_component_v_text, {
143231
+ ref: "textRef",
143232
+ id: __props.widget.id,
143233
+ config: textConfig.value
143234
+ }, null, 8, ["id", "config"])]),
143235
+ _: 1
143236
+ });
143237
+ };
143238
+ }
143239
+ });
143240
+ //#endregion
143241
+ //#region src/suites/edhr/component/gct-rightMarker-render.vue
143242
+ var gct_rightMarker_render_exports = /* @__PURE__ */ __exportAll({ default: () => gct_rightMarker_render_default });
143243
+ var gct_rightMarker_render_default = gct_rightMarker_render_vue_vue_type_script_setup_true_name_gct_rightMarker_render_lang_default;
143244
+ //#endregion
143245
+ //#region src/suites/edhr/component/gct-signature-render.vue?vue&type=script&setup=true&name=gct-signature-render&lang.ts
143246
+ init_asset_helper_util();
143247
+ init_image_size_util();
143248
+ init_constants();
143249
+ init_core$1();
143250
+ init__register_();
143251
+ init_useWidgetRenderData();
143252
+ var gct_signature_render_vue_vue_type_script_setup_true_name_gct_signature_render_lang_default = /*@__PURE__*/ defineComponent({
143253
+ __name: "gct-signature-render",
143254
+ props: {
143255
+ widget: {},
143256
+ modelId: {}
143257
+ },
143258
+ setup(__props) {
143259
+ const interCtx = useInteractionContext();
143260
+ const props = __props;
143261
+ const imgRef = ref(null);
143262
+ const { runtimeValuePath } = useWidgetStaticAttrs(props.widget);
143263
+ const imageWidth = computed(() => props.widget._width);
143264
+ const imageHeight = computed(() => props.widget._height);
143265
+ const natural = ref({
143266
+ width: 0,
143267
+ height: 0
143268
+ });
143269
+ const display = ref({
143270
+ width: imageWidth.value,
143271
+ height: imageHeight.value
143272
+ });
143273
+ const placeholder = computed(() => ({
143274
+ width: imageWidth.value ?? 120,
143275
+ height: imageHeight.value ?? 68,
143276
+ fill: "#f3f3f3"
143277
+ }));
143278
+ async function loadImage() {
143279
+ const { src, signature } = props.widget;
143280
+ if (signature) return await createSignatureImage(signature, imageWidth.value, imageHeight.value);
143281
+ if (src) return await AssetHelper.loadImage(src);
143282
+ return null;
143283
+ }
143284
+ watch(() => [
143285
+ props.widget.src,
143286
+ props.widget.signature,
143287
+ imageWidth.value,
143288
+ imageHeight.value,
143289
+ props.widget.keepAspect
143290
+ ], async () => {
143291
+ const img = await loadImage();
143292
+ if (!img) return;
143293
+ natural.value = {
143294
+ width: img.naturalWidth,
143295
+ height: img.naturalHeight
143296
+ };
143297
+ display.value = computeImageDisplaySize(natural.value, {
143298
+ width: imageWidth.value,
143299
+ height: imageHeight.value,
143300
+ keepAspect: props.widget.keepAspect ?? true,
143301
+ maxDefaultWidth: 200
143302
+ });
143303
+ imgRef.value = img;
143304
+ }, { immediate: true });
143305
+ const imageConfig = computed(() => ({
143306
+ x: 0,
143307
+ y: 0,
143308
+ image: imgRef.value,
143309
+ width: display.value.width,
143310
+ height: display.value.height
143311
+ }));
143312
+ const dateTimeConfigs = computed(() => {
143313
+ const list = props.widget.decorations;
143314
+ if (!(list === null || list === void 0 ? void 0 : list.length)) return [];
143315
+ return list.map((item) => ({
143316
+ x: item.x,
143317
+ y: item.y,
143318
+ text: item.text,
143319
+ fontSize: item.fontSize || 14,
143320
+ fill: "#000",
143321
+ width: item.width,
143322
+ height: item.height
143323
+ }));
143324
+ });
143325
+ const baseLineConfig = {
143326
+ stroke: "#ff4d4f",
143327
+ strokeWidth: 1,
143328
+ ...baseCanvasAttrs
143329
+ };
143330
+ const useLineConfig = (offsetY = 0) => computed(() => ({
143331
+ points: [
143332
+ 0,
143333
+ halfPixel(display.value.height + offsetY),
143334
+ halfPixel(props.widget.width),
143335
+ halfPixel(display.value.height + offsetY)
143336
+ ],
143337
+ ...baseLineConfig
143338
+ }));
143339
+ const lineOneConfig = useLineConfig(0);
143340
+ const lineTwoConfig = useLineConfig(2);
143341
+ const isShowMark = computed(() => {
143342
+ return interCtx.annotationIds && interCtx.annotationIds.length !== 0 && interCtx.annotationIds.includes(runtimeValuePath.value);
143343
+ });
143344
+ return (_ctx, _cache) => {
143345
+ const _component_v_line = resolveComponent("v-line");
143346
+ const _component_v_image = resolveComponent("v-image");
143347
+ const _component_v_rect = resolveComponent("v-rect");
143348
+ const _component_v_text = resolveComponent("v-text");
143349
+ const _component_v_group = resolveComponent("v-group");
143350
+ return openBlock(), createBlock(_component_v_group, null, {
143351
+ default: withCtx(() => [
143352
+ isShowMark.value ? (openBlock(), createBlock(_component_v_line, {
143353
+ key: 0,
143354
+ config: unref(lineOneConfig)
143355
+ }, null, 8, ["config"])) : createCommentVNode("", true),
143356
+ isShowMark.value ? (openBlock(), createBlock(_component_v_line, {
143357
+ key: 1,
143358
+ config: unref(lineTwoConfig)
143359
+ }, null, 8, ["config"])) : createCommentVNode("", true),
143360
+ imgRef.value ? (openBlock(), createBlock(_component_v_image, {
143361
+ key: 2,
143362
+ config: imageConfig.value
143363
+ }, null, 8, ["config"])) : (openBlock(), createBlock(_component_v_rect, {
143364
+ key: 3,
143365
+ width: placeholder.value.width,
143366
+ height: placeholder.value.height,
143367
+ fill: placeholder.value.fill
143368
+ }, null, 8, [
143369
+ "width",
143370
+ "height",
143371
+ "fill"
143372
+ ])),
143373
+ (openBlock(true), createElementBlock(Fragment, null, renderList(dateTimeConfigs.value, (cfg, i) => {
143374
+ return openBlock(), createBlock(_component_v_text, {
143375
+ key: i,
143376
+ config: cfg
143377
+ }, null, 8, ["config"]);
143378
+ }), 128))
143379
+ ]),
143380
+ _: 1
143381
+ });
143382
+ };
143383
+ }
143384
+ });
143385
+ //#endregion
143386
+ //#region src/suites/edhr/component/gct-signature-render.vue
143387
+ var gct_signature_render_exports = /* @__PURE__ */ __exportAll({ default: () => gct_signature_render_default });
143388
+ var gct_signature_render_default = gct_signature_render_vue_vue_type_script_setup_true_name_gct_signature_render_lang_default;
143389
+ //#endregion
143390
+ //#region src/suites/edhr/component/gct-space-render.vue?vue&type=script&setup=true&name=gct-space-render&lang.ts
143391
+ var gct_space_render_vue_vue_type_script_setup_true_name_gct_space_render_lang_default = /*@__PURE__*/ defineComponent({
143392
+ __name: "gct-space-render",
143393
+ props: { widget: {} },
143394
+ setup(__props) {
143395
+ const props = __props;
143396
+ const textConfig = computed(() => {
143397
+ return {
143398
+ x: 0,
143399
+ y: 0,
143400
+ text: props.widget.text || "",
143401
+ fontSize: props.widget.fontSize,
143402
+ fontFamily: props.widget.fontFamily,
143403
+ fill: props.widget.color,
143404
+ width: props.widget.width,
143405
+ height: props.widget.height,
143406
+ wrap: "none"
143407
+ };
143408
+ });
143409
+ return (_ctx, _cache) => {
143410
+ const _component_v_text = resolveComponent("v-text");
143411
+ return openBlock(), createBlock(_component_v_text, {
143412
+ id: __props.widget.id,
143413
+ config: textConfig.value
143414
+ }, null, 8, ["id", "config"]);
143415
+ };
143416
+ }
143417
+ });
143418
+ //#endregion
143419
+ //#region src/suites/edhr/component/gct-space-render.vue
143420
+ var gct_space_render_exports = /* @__PURE__ */ __exportAll({ default: () => gct_space_render_default });
143421
+ var gct_space_render_default = gct_space_render_vue_vue_type_script_setup_true_name_gct_space_render_lang_default;
143422
+ //#endregion
143423
+ //#region src/suites/edhr/component/gct-text-render.vue?vue&type=script&setup=true&name=gct-text-render&lang.ts
143424
+ init__register_();
143425
+ init_constants();
143426
+ init_useWidgetRenderData();
143427
+ init_useFormValidator();
143428
+ init_core$1();
143429
+ var gct_text_render_vue_vue_type_script_setup_true_name_gct_text_render_lang_default = /*@__PURE__*/ defineComponent({
143430
+ __name: "gct-text-render",
143431
+ props: {
143432
+ widget: {},
143433
+ modelId: {}
143434
+ },
143435
+ setup(__props) {
143436
+ const props = __props;
143437
+ const interCtx = useInteractionContext();
143438
+ const { docInst, showDisabled, showReadonly, runtimeValuePath } = useWidgetStaticAttrs(props.widget);
143439
+ const isActive = computed(() => {
143440
+ var _interCtx$panelData;
143441
+ return props.modelId === ((_interCtx$panelData = interCtx.panelData) === null || _interCtx$panelData === void 0 ? void 0 : _interCtx$panelData.modelId) || props.modelId === interCtx.hoverModelId;
143442
+ });
143443
+ const isShowMark = computed(() => {
143444
+ return interCtx.annotationIds && interCtx.annotationIds.length !== 0 && interCtx.annotationIds.includes(runtimeValuePath.value);
143445
+ });
143446
+ const isValidationError = computed(() => hasFieldErrorHighlight(interCtx.validationCommentMap, interCtx.rangeHighlightMap, runtimeValuePath.value));
143447
+ const isErrorHighlight = computed(() => isShowMark.value || isValidationError.value);
143448
+ /**
143449
+ * 统一颜色逻辑
143450
+ */
143451
+ const colors = computed(() => {
143452
+ const textColor = props.widget.color;
143453
+ if (isErrorHighlight.value) {
143454
+ if (showDisabled.value) return {
143455
+ text: FieldStateColors.validationErrorDisabledText,
143456
+ line: FieldStateColors.validationErrorDisabledLine,
143457
+ bg: isActive.value ? FieldStateColors.validationErrorDisabledBgActive : FieldStateColors.validationErrorDisabledBg
143458
+ };
143459
+ return {
143460
+ text: FieldStateColors.validationErrorText,
143461
+ line: FieldStateColors.validationErrorLine,
143462
+ bg: FieldStateColors.validationErrorBg
143463
+ };
143464
+ }
143465
+ if (docInst.value.isInPrintMode()) return {
143466
+ text: textColor,
143467
+ line: FieldStateColors.editableLine,
143468
+ bg: FieldStateColors.printBg
143469
+ };
143470
+ if (showDisabled.value) return {
143471
+ text: FieldStateColors.disabledText,
143472
+ line: FieldStateColors.disabledLine,
143473
+ bg: isActive.value ? FieldStateColors.disabledBgActive : FieldStateColors.disabledBg
143474
+ };
143475
+ if (showReadonly.value) return {
143476
+ text: textColor,
143477
+ line: FieldStateColors.readonlyValueLine,
143478
+ bg: FieldStateColors.printBg
143479
+ };
143480
+ return {
143481
+ text: textColor,
143482
+ line: FieldStateColors.editableLine,
143483
+ bg: isActive.value ? FieldStateColors.editableBgActive : FieldStateColors.editableBg
143484
+ };
143485
+ });
143486
+ const textConfig = computed(() => ({
143487
+ x: 0,
143488
+ y: 0,
143489
+ text: props.widget.text,
143490
+ fontSize: props.widget.fontSize,
143491
+ fontFamily: props.widget.fontFamily,
143492
+ fill: colors.value.text,
143493
+ textDecoration: props.widget.underline ? "underline" : void 0,
143494
+ wrap: "none"
143495
+ }));
143496
+ const baseLineConfig = {
143497
+ strokeWidth: 1,
143498
+ ...baseCanvasAttrs
143499
+ };
143500
+ const useLineConfig = (offsetY = 0) => computed(() => ({
143501
+ points: [
143502
+ 0,
143503
+ halfPixel(props.widget.fontSize + offsetY),
143504
+ halfPixel(props.widget.width),
143505
+ halfPixel(props.widget.fontSize + offsetY)
143506
+ ],
143507
+ stroke: colors.value.line,
143508
+ ...baseLineConfig
143509
+ }));
143510
+ const lineOneConfig = useLineConfig(0);
143511
+ const lineTwoConfig = useLineConfig(2);
143512
+ const bgConfig = computed(() => ({
143513
+ x: 0,
143514
+ y: -3,
143515
+ width: props.widget.width,
143516
+ height: props.widget.height + 6,
143517
+ fill: colors.value.bg
143518
+ }));
143519
+ return (_ctx, _cache) => {
143520
+ const _component_v_rect = resolveComponent("v-rect");
143521
+ const _component_v_line = resolveComponent("v-line");
143522
+ const _component_v_text = resolveComponent("v-text");
143523
+ const _component_v_group = resolveComponent("v-group");
143524
+ return openBlock(), createBlock(_component_v_group, null, {
143525
+ default: withCtx(() => [
143526
+ createVNode(_component_v_rect, { config: bgConfig.value }, null, 8, ["config"]),
143527
+ isShowMark.value ? (openBlock(), createBlock(_component_v_line, {
143528
+ key: 0,
143529
+ config: unref(lineOneConfig)
143530
+ }, null, 8, ["config"])) : createCommentVNode("", true),
143531
+ isShowMark.value ? (openBlock(), createBlock(_component_v_line, {
143532
+ key: 1,
143533
+ config: unref(lineTwoConfig)
143534
+ }, null, 8, ["config"])) : createCommentVNode("", true),
143535
+ createVNode(_component_v_text, {
143536
+ ref: "textRef",
143537
+ id: __props.widget.id,
143538
+ config: textConfig.value
143539
+ }, null, 8, ["id", "config"])
143540
+ ]),
143541
+ _: 1
143542
+ });
143543
+ };
143544
+ }
143545
+ });
143546
+ //#endregion
143547
+ //#region src/suites/edhr/component/gct-text-render.vue
143548
+ var gct_text_render_exports = /* @__PURE__ */ __exportAll({ default: () => gct_text_render_default });
143549
+ var gct_text_render_default = gct_text_render_vue_vue_type_script_setup_true_name_gct_text_render_lang_default;
143550
+ //#endregion
143551
+ //#region src/suites/edhr/component/pw-barcode-render.vue?vue&type=script&setup=true&name=gct-image-render&lang.ts
143552
+ init_core();
143553
+ init_enum();
143554
+ init_core$1();
143555
+ init_useWidgetRenderData();
143556
+ var UNIT_WIDTH = 1;
143557
+ var pw_barcode_render_vue_vue_type_script_setup_true_name_gct_image_render_lang_default = /*@__PURE__*/ defineComponent({
143558
+ __name: "pw-barcode-render",
143559
+ props: {
143560
+ widget: {},
143561
+ modelId: {}
143562
+ },
143563
+ setup(__props) {
143564
+ const props = __props;
143565
+ const { docInst, isDesignMode, pageWidgetProps } = usePaperWidgetStaticAttrs(props.widget);
143566
+ const readonlyValue = ref();
143567
+ const valueType = computed(() => pageWidgetProps.value.valueType);
143568
+ const alignType = computed(() => pageWidgetProps.value.justifyContent);
143569
+ /** 值处理 */
143570
+ const modelValue = computed(() => {
143571
+ let text = pageWidgetProps.value.value;
143572
+ if (valueType.value === ValueTypeConst.Field) {
143573
+ var _text$exp;
143574
+ const path = text === null || text === void 0 || (_text$exp = text.exp) === null || _text$exp === void 0 || (_text$exp = _text$exp.fieldData) === null || _text$exp === void 0 ? void 0 : _text$exp.valuePath;
143575
+ if (path) {
143576
+ var _props$widget, _props$widget2, _props$widget3, _docInst$value;
143577
+ const runtimePath = replacePathIndexPlaceholders({
143578
+ y: (_props$widget = props.widget) === null || _props$widget === void 0 || (_props$widget = _props$widget.dataSlotIndex) === null || _props$widget === void 0 ? void 0 : _props$widget.yDataIndex,
143579
+ x: (_props$widget2 = props.widget) === null || _props$widget2 === void 0 || (_props$widget2 = _props$widget2.dataSlotIndex) === null || _props$widget2 === void 0 ? void 0 : _props$widget2.xDataIndex,
143580
+ n: (_props$widget3 = props.widget) === null || _props$widget3 === void 0 || (_props$widget3 = _props$widget3.dataSlotIndex) === null || _props$widget3 === void 0 ? void 0 : _props$widget3.dataIndex,
143581
+ templatePath: path
143582
+ });
143583
+ text = (_docInst$value = docInst.value) === null || _docInst$value === void 0 || (_docInst$value = _docInst$value.dataManager) === null || _docInst$value === void 0 ? void 0 : _docInst$value.get(runtimePath);
143584
+ }
143585
+ }
143586
+ return Array.isArray(text) ? text.join() : text;
143587
+ });
143588
+ watch(() => modelValue.value, async () => {
143589
+ if (isDesignMode.value) {
143590
+ readonlyValue.value = "GCT";
143591
+ return;
143592
+ }
143593
+ if (valueType.value === ValueTypeConst.Formula) {
143594
+ var _modelValue$value, _props$widget4, _modelValue$value2;
143595
+ const subFieldKey = (_modelValue$value = modelValue.value) === null || _modelValue$value === void 0 ? void 0 : _modelValue$value.subFieldKey;
143596
+ const rawData = docInst.value.dataManager.getRawData();
143597
+ const path = subFieldKey ? `${subFieldKey}[${(_props$widget4 = props.widget) === null || _props$widget4 === void 0 || (_props$widget4 = _props$widget4.dataSlotIndex) === null || _props$widget4 === void 0 ? void 0 : _props$widget4.dataIndex}]` : "";
143598
+ const subRowData = path ? docInst.value.dataManager.get(path) : {};
143599
+ const result = await formulaUtils.calculateFormula((_modelValue$value2 = modelValue.value) === null || _modelValue$value2 === void 0 ? void 0 : _modelValue$value2.exp, rawData, subRowData);
143600
+ readonlyValue.value = result;
143601
+ } else readonlyValue.value = modelValue.value;
143602
+ }, { immediate: true });
143603
+ /** 布局 */
143604
+ const layout = computed(() => {
143605
+ const h = props.widget.height;
143606
+ return {
143607
+ paddingX: 12,
143608
+ paddingY: 4,
143609
+ barcodeHeight: showText.value ? h * .7 : h,
143610
+ textHeight: showText.value ? h * .3 : 0
143611
+ };
143612
+ });
143613
+ const rawBars = computed(() => {
143614
+ if (!readonlyValue.value) return [];
143615
+ return getBarsFromSVG(readonlyValue.value, pageWidgetProps.value.codeType);
143616
+ });
143617
+ /** 渲染条码 */
143618
+ const bars = computed(() => {
143619
+ if (!rawBars.value.length) return getBrokenBarsStable("barcode-placeholder").map((b) => ({
143620
+ ...b,
143621
+ fill: "#bbb"
143622
+ }));
143623
+ return rawBars.value.map((bar) => ({
143624
+ x: layout.value.paddingX + bar.x * UNIT_WIDTH,
143625
+ width: bar.width * UNIT_WIDTH,
143626
+ fill: "#000"
143627
+ }));
143628
+ });
143629
+ /** 宽度自适应 */
143630
+ const renderWidth = computed(() => {
143631
+ if (!rawBars.value.length) return props.widget.width;
143632
+ return Math.max(...rawBars.value.map((b) => b.x + b.width)) * UNIT_WIDTH + layout.value.paddingX * 2;
143633
+ });
143634
+ /** 闪电遮罩 */
143635
+ const lightningPath = computed(() => {
143636
+ const w = renderWidth.value;
143637
+ const mid = layout.value.barcodeHeight / 2;
143638
+ return `
143639
+ M 0 ${mid - 6}
143640
+ L ${w * .25} ${mid - 2}
143641
+ L ${w * .4} ${mid + 2}
143642
+ L ${w * .6} ${mid - 4}
143643
+ L ${w * .8} ${mid + 3}
143644
+ L ${w} ${mid - 1}
143645
+ L ${w} ${mid + 6}
143646
+ L ${w * .8} ${mid + 10}
143647
+ L ${w * .6} ${mid + 4}
143648
+ L ${w * .4} ${mid + 12}
143649
+ L ${w * .25} ${mid + 6}
143650
+ L 0 ${mid + 10}
143651
+ Z
143652
+ `;
143653
+ });
143654
+ /** 是否显示文本 */
143655
+ const showText = computed(() => {
143656
+ return !isEmptyValue$1(readonlyValue.value) && pageWidgetProps.value.showValue;
143657
+ });
143658
+ /** 文本内容 */
143659
+ const textValue = computed(() => {
143660
+ if (isDesignMode.value) {
143661
+ if (valueType.value === ValueTypeConst.Field) return "请配置字段";
143662
+ if (valueType.value === ValueTypeConst.Formula) return "请配置公式";
143663
+ return "请输入文本";
143664
+ }
143665
+ return readonlyValue.value;
143666
+ });
143667
+ const fontSize = computed(() => {
143668
+ if (!textValue.value) return 12;
143669
+ return Math.max(8, Math.min(14, renderWidth.value / textValue.value.length * 1));
143670
+ });
143671
+ const textColor = computed(() => isDesignMode.value ? "#999" : "#333");
143672
+ const bgConfig = computed(() => ({
143673
+ x: 0,
143674
+ y: 0,
143675
+ width: props.widget.width,
143676
+ height: props.widget.height,
143677
+ fill: "transparent"
143678
+ }));
143679
+ watch(() => renderWidth.value, (value) => {
143680
+ if (!isDesignMode.value) {
143681
+ var _props$widget5;
143682
+ props.widget.pageWidgetMeta.props.newSpecificConfig ??= {};
143683
+ props.widget.pageWidgetMeta.props.newSpecificConfig[`${props.widget.modelRef.id}@${(_props$widget5 = props.widget) === null || _props$widget5 === void 0 || (_props$widget5 = _props$widget5.dataSlotIndex) === null || _props$widget5 === void 0 ? void 0 : _props$widget5.dataIndex}`] = {
143684
+ relWidth: value,
143685
+ relValue: readonlyValue.value
143686
+ };
143687
+ }
143688
+ }, { immediate: true });
143689
+ function getBarsFromSVG(value, format) {
143690
+ if (!value) return [];
143691
+ const svg = document.createElementNS("http://www.w3.org/2000/svg", "svg");
143692
+ try {
143693
+ JsBarcode(svg, value, {
143694
+ format,
143695
+ displayValue: false,
143696
+ margin: 0,
143697
+ background: "transparent"
143698
+ });
143699
+ } catch (e) {
143700
+ console.error(e);
143701
+ return [];
143702
+ }
143703
+ const group = svg.querySelector("g");
143704
+ if (!group) return [];
143705
+ const rects = group.querySelectorAll("rect");
143706
+ const bars = [];
143707
+ rects.forEach((rect) => {
143708
+ const x = Number(rect.getAttribute("x") || 0);
143709
+ const width = Number(rect.getAttribute("width") || 0);
143710
+ if (width > 0) bars.push({
143711
+ x,
143712
+ width
143713
+ });
143714
+ });
143715
+ return bars;
143716
+ }
143717
+ function getBrokenBarsStable(seed) {
143718
+ const bars = [];
143719
+ const totalWidth = renderWidth.value;
143720
+ let x = layout.value.paddingX;
143721
+ let hash = 0;
143722
+ for (let i = 0; i < seed.length; i++) hash += seed.charCodeAt(i);
143723
+ let i = 0;
143724
+ while (x < totalWidth - layout.value.paddingX) {
143725
+ const width = i % 3 === 0 ? 2 : 1;
143726
+ if ((hash + i * 7) % 10 > 2) bars.push({
143727
+ x,
143728
+ width
143729
+ });
143730
+ x += width + 1;
143731
+ i++;
143732
+ }
143733
+ return bars;
143734
+ }
143735
+ return (_ctx, _cache) => {
143736
+ const _component_v_rect = resolveComponent("v-rect");
143737
+ const _component_v_path = resolveComponent("v-path");
143738
+ const _component_v_text = resolveComponent("v-text");
143739
+ const _component_v_group = resolveComponent("v-group");
143740
+ return openBlock(), createBlock(_component_v_group, { config: {
143741
+ x: __props.widget.x,
143742
+ y: __props.widget.y,
143743
+ id: __props.widget.id
143744
+ } }, {
143745
+ default: withCtx(() => [
143746
+ (openBlock(true), createElementBlock(Fragment, null, renderList(bars.value, (bar, i) => {
143747
+ return openBlock(), createBlock(_component_v_rect, {
143748
+ key: i,
143749
+ x: bar.x,
143750
+ y: 0,
143751
+ width: bar.width,
143752
+ height: layout.value.barcodeHeight,
143753
+ fill: bar.fill
143754
+ }, null, 8, [
143755
+ "x",
143756
+ "width",
143757
+ "height",
143758
+ "fill"
143759
+ ]);
143760
+ }), 128)),
143761
+ !rawBars.value.length ? (openBlock(), createBlock(_component_v_path, {
143762
+ key: 0,
143763
+ data: lightningPath.value,
143764
+ fill: "#fff"
143765
+ }, null, 8, ["data"])) : createCommentVNode("", true),
143766
+ showText.value ? (openBlock(), createBlock(_component_v_text, {
143767
+ key: 1,
143768
+ x: 0,
143769
+ y: layout.value.barcodeHeight + layout.value.paddingY,
143770
+ width: renderWidth.value,
143771
+ height: layout.value.textHeight,
143772
+ text: textValue.value,
143773
+ align: alignType.value,
143774
+ verticalAlign: "middle",
143775
+ fontSize: fontSize.value,
143776
+ fill: textColor.value
143777
+ }, null, 8, [
143778
+ "y",
143779
+ "width",
143780
+ "height",
143781
+ "text",
143782
+ "align",
143783
+ "fontSize",
143784
+ "fill"
143785
+ ])) : createCommentVNode("", true),
143786
+ createVNode(_component_v_rect, { config: bgConfig.value }, null, 8, ["config"])
143787
+ ]),
143788
+ _: 1
143789
+ }, 8, ["config"]);
143790
+ };
143791
+ }
143792
+ });
143793
+ //#endregion
143794
+ //#region src/suites/edhr/component/pw-barcode-render.vue
143795
+ var pw_barcode_render_exports = /* @__PURE__ */ __exportAll({ default: () => pw_barcode_render_default });
143796
+ var pw_barcode_render_default = pw_barcode_render_vue_vue_type_script_setup_true_name_gct_image_render_lang_default;
143797
+ //#endregion
143798
+ //#region src/suites/edhr/component/pw-diagonal-render.vue?vue&type=script&setup=true&name=pw-diagonal-render&lang.ts
143799
+ init_core();
143800
+ init_useWidgetRenderData();
143801
+ init_enum();
143802
+ init_core$1();
143803
+ init__register_();
143804
+ var CELL_PADDING = 5;
143805
+ var pw_diagonal_render_vue_vue_type_script_setup_true_name_pw_diagonal_render_lang_default = /*@__PURE__*/ defineComponent({
143806
+ __name: "pw-diagonal-render",
143807
+ props: {
143808
+ modelId: {},
143809
+ widget: {}
143810
+ },
143811
+ setup(__props) {
143812
+ const designCtx = useDesignSuiteContext();
143813
+ const props = __props;
143814
+ const { docInst, isDesignMode, pageWidgetProps } = usePaperWidgetStaticAttrs(props.widget);
143815
+ const textStyle = computed(() => {
143816
+ const style = {
143817
+ ...DEFAULT_WIDGET_TEXT_STYLE,
143818
+ ...pageWidgetProps.value.textStyle
143819
+ };
143820
+ const fontStyle = [style.bold && "bold", style.italic && "italic"].filter(Boolean).join(" ") || void 0;
143821
+ const textDecoration = [style.underline && "underline", style.strike && "line-through"].filter(Boolean).filter((v, i, arr) => arr.indexOf(v) === i).join(" ") || void 0;
143822
+ return {
143823
+ fontSize: style.fontSize,
143824
+ fontFamily: style.fontFamily,
143825
+ lineHeight: 1.2,
143826
+ fill: style.color,
143827
+ fontStyle,
143828
+ textDecoration,
143829
+ bold: style.bold,
143830
+ italic: style.italic
143831
+ };
143832
+ });
143833
+ const fontSize = computed(() => textStyle.value.fontSize);
143834
+ const lineHeight = computed(() => textStyle.value.fontSize * 1.2);
143835
+ const width = computed(() => props.widget.width);
143836
+ const height = computed(() => props.widget.height);
143837
+ const size = computed(() => pageWidgetProps.value.size);
143838
+ const isBackward = computed(() => pageWidgetProps.value.direction === DiagonalDirectionTypeConst.Backward);
143839
+ /** 分割线 */
143840
+ function flipX(x) {
143841
+ return isBackward.value ? width.value - x : x;
143842
+ }
143843
+ const lines = computed(() => {
143844
+ if (size.value === 2) return [{
143845
+ points: [
143846
+ flipX(0),
143847
+ 0,
143848
+ flipX(width.value),
143849
+ height.value
143850
+ ],
143851
+ stroke: "rgb(128, 128, 128)",
143852
+ strokeWidth: 1
143853
+ }];
143854
+ return [{
143855
+ points: [
143856
+ flipX(width.value * .4),
143857
+ 0,
143858
+ flipX(width.value),
143859
+ height.value
143860
+ ],
143861
+ stroke: "rgb(128, 128, 128)",
143862
+ strokeWidth: 1
143863
+ }, {
143864
+ points: [
143865
+ flipX(0),
143866
+ height.value * .4,
143867
+ flipX(width.value),
143868
+ height.value
143869
+ ],
143870
+ stroke: "rgb(128, 128, 128)",
143871
+ strokeWidth: 1
143872
+ }];
143873
+ });
143874
+ const getNameByIndex = (index) => {
143875
+ var _pageWidgetProps$valu, _pageWidgetProps$valu2;
143876
+ if (!((_pageWidgetProps$valu = pageWidgetProps.value.enableFields) === null || _pageWidgetProps$valu === void 0 ? void 0 : _pageWidgetProps$valu[index])) return pageWidgetProps.value.names[index];
143877
+ const fieldMeta = (_pageWidgetProps$valu2 = pageWidgetProps.value.bindFields) === null || _pageWidgetProps$valu2 === void 0 ? void 0 : _pageWidgetProps$valu2[index];
143878
+ if (fieldMeta && fieldMeta.fieldData) {
143879
+ var _designCtx$runtime$ge, _fieldMeta$fieldData;
143880
+ const modelKey = getLastSegment(fieldMeta.fieldData.modelLink);
143881
+ const fieldKey = getLastSegment(fieldMeta.fieldData.fieldLink);
143882
+ const fieldInfo = modelKey && fieldKey ? ((_designCtx$runtime$ge = designCtx.runtime.getFieldList(modelKey)) === null || _designCtx$runtime$ge === void 0 ? void 0 : _designCtx$runtime$ge.find((f) => f.key === fieldKey)) ?? null : null;
143883
+ const path = (_fieldMeta$fieldData = fieldMeta.fieldData) === null || _fieldMeta$fieldData === void 0 ? void 0 : _fieldMeta$fieldData.valuePath;
143884
+ if (isDesignMode.value) return (fieldInfo === null || fieldInfo === void 0 ? void 0 : fieldInfo.name) ? `\${${fieldInfo.name}}` : path;
143885
+ if (path) {
143886
+ var _props$widget, _props$widget2, _props$widget3, _docInst$value;
143887
+ const runtimePath = replacePathIndexPlaceholders({
143888
+ y: (_props$widget = props.widget) === null || _props$widget === void 0 || (_props$widget = _props$widget.dataSlotIndex) === null || _props$widget === void 0 ? void 0 : _props$widget.yDataIndex,
143889
+ x: (_props$widget2 = props.widget) === null || _props$widget2 === void 0 || (_props$widget2 = _props$widget2.dataSlotIndex) === null || _props$widget2 === void 0 ? void 0 : _props$widget2.xDataIndex,
143890
+ n: (_props$widget3 = props.widget) === null || _props$widget3 === void 0 || (_props$widget3 = _props$widget3.dataSlotIndex) === null || _props$widget3 === void 0 ? void 0 : _props$widget3.dataIndex,
143891
+ templatePath: path
143892
+ });
143893
+ return (_docInst$value = docInst.value) === null || _docInst$value === void 0 || (_docInst$value = _docInst$value.dataManager) === null || _docInst$value === void 0 ? void 0 : _docInst$value.get(runtimePath);
143894
+ }
143895
+ }
143896
+ return "";
143897
+ };
143898
+ const names = computed(() => {
143899
+ return [
143900
+ 0,
143901
+ 1,
143902
+ 2
143903
+ ].map((i) => getNameByIndex(i));
143904
+ });
143905
+ function createCharWidthGetter(size, family, bold, italic) {
143906
+ const cache = /* @__PURE__ */ new Map();
143907
+ return (char) => {
143908
+ const key = [
143909
+ char,
143910
+ size,
143911
+ family,
143912
+ bold,
143913
+ italic
143914
+ ].join("_");
143915
+ if (cache.has(key)) return cache.get(key);
143916
+ const { width } = TextUtil.getLayoutSize({
143917
+ fontSize: size,
143918
+ fontFamily: family,
143919
+ bold,
143920
+ italic,
143921
+ text: char
143922
+ });
143923
+ cache.set(key, width);
143924
+ return width;
143925
+ };
143926
+ }
143927
+ function sliceLine(text, start, maxWidth, getCharWidth) {
143928
+ let width = 0;
143929
+ let end = start;
143930
+ while (end < text.length) {
143931
+ const w = getCharWidth(text[end]);
143932
+ if (width + w > maxWidth) break;
143933
+ width += w;
143934
+ end++;
143935
+ }
143936
+ if (end === start) {
143937
+ width = getCharWidth(text[start]);
143938
+ end = start + 1;
143939
+ }
143940
+ return {
143941
+ end,
143942
+ width,
143943
+ text: text.slice(start, end)
143944
+ };
143945
+ }
143946
+ function layoutByLineWidth({ text, x0, y0, height, getLineWidth, getX = (y, width, maxWidth) => x0 }) {
143947
+ const result = [];
143948
+ const getCharWidth = createCharWidthGetter(fontSize.value, textStyle.value.fontFamily, textStyle.value.bold, textStyle.value.italic);
143949
+ let y = y0;
143950
+ let cursor = 0;
143951
+ while (cursor < text.length) {
143952
+ if (y + lineHeight.value > y0 + height) break;
143953
+ const maxWidth = getLineWidth(y);
143954
+ if (maxWidth <= 0) {
143955
+ y += lineHeight.value;
143956
+ continue;
143957
+ }
143958
+ const { end, width, text: lineText } = sliceLine(text, cursor, maxWidth, getCharWidth);
143959
+ result.push({
143960
+ text: lineText,
143961
+ x: getX(y, width, maxWidth),
143962
+ y
143963
+ });
143964
+ cursor = end;
143965
+ y += lineHeight.value;
143966
+ }
143967
+ return result;
143968
+ }
143969
+ const topTextLines = computed(() => {
143970
+ const text = names.value[isBackward.value ? 0 : 2] || "";
143971
+ if (isBackward.value) {
143972
+ const w = size.value === 2 ? width.value : width.value - width.value * .4;
143973
+ return layoutByLineWidth({
143974
+ text,
143975
+ x0: 0,
143976
+ y0: 0,
143977
+ height: height.value,
143978
+ getLineWidth: (y) => w * (1 - y / height.value) - 12
143979
+ });
143980
+ }
143981
+ const y0 = size.value === 2 ? 0 : height.value * .4;
143982
+ const h = size.value === 2 ? height.value : height.value - height.value * .4;
143983
+ return layoutByLineWidth({
143984
+ text,
143985
+ x0: 0,
143986
+ y0,
143987
+ height: h,
143988
+ getLineWidth: (y) => width.value * (y - y0) / h
143989
+ });
143990
+ });
143991
+ const bottomTextLines = computed(() => {
143992
+ const text = names.value[isBackward.value ? 2 : 0] || "";
143993
+ if (isBackward.value) {
143994
+ const y0 = size.value === 2 ? 0 : height.value * .4;
143995
+ const h = size.value === 2 ? height.value : height.value - height.value * .4;
143996
+ return layoutByLineWidth({
143997
+ text,
143998
+ x0: 0,
143999
+ y0,
144000
+ height: h,
144001
+ getLineWidth: (y) => width.value * ((y - y0) / h),
144002
+ getX: (y, lineWidth) => width.value - lineWidth
144003
+ });
144004
+ }
144005
+ const x0 = size.value === 2 ? 0 : width.value * .4;
144006
+ const w = size.value === 2 ? width.value : width.value - width.value * .4;
144007
+ return layoutByLineWidth({
144008
+ text,
144009
+ x0,
144010
+ y0: 0,
144011
+ height: height.value,
144012
+ getLineWidth: (y) => w * (1 - y / height.value) - 13,
144013
+ getX: (y, lineWidth) => x0 + w - lineWidth
144014
+ });
144015
+ });
144016
+ function layoutInShape({ text, height, xLeft, xRight }) {
144017
+ const result = [];
144018
+ const getCharWidth = createCharWidthGetter(fontSize.value, textStyle.value.fontFamily, textStyle.value.bold, textStyle.value.italic);
144019
+ let cursor = 0;
144020
+ let y = 0;
144021
+ while (y < height && cursor < text.length) {
144022
+ const yTop = y;
144023
+ const yBottom = Math.min(y + lineHeight.value, height);
144024
+ const left = Math.max(xLeft(yTop), xLeft(yBottom));
144025
+ const maxWidth = Math.min(xRight(yTop), xRight(yBottom)) - left;
144026
+ if (maxWidth <= 0) break;
144027
+ const { end, width, text: lineText } = sliceLine(text, cursor, maxWidth, getCharWidth);
144028
+ const isLastLine = end >= text.length;
144029
+ const charCount = lineText.length;
144030
+ let x = left;
144031
+ let letterSpacing = 0;
144032
+ if (!isLastLine && charCount > 1) letterSpacing = (maxWidth - width) / (charCount - 1);
144033
+ result.push({
144034
+ text: lineText,
144035
+ x,
144036
+ y: yTop,
144037
+ width: maxWidth,
144038
+ textWidth: width,
144039
+ letterSpacing
144040
+ });
144041
+ cursor = end;
144042
+ y += lineHeight.value;
144043
+ }
144044
+ return result;
144045
+ }
144046
+ const middleTextLines = computed(() => {
144047
+ const text = names.value[1] || "";
144048
+ if (isBackward.value) {
144049
+ const x1 = width.value - width.value * .4;
144050
+ const y2 = height.value * .4;
144051
+ const kRight = (y2 - height.value) / width.value;
144052
+ const xLeft = (y) => x1 * (height.value - y) / height.value;
144053
+ const xRight = (y) => {
144054
+ if (y <= y2) return width.value;
144055
+ return (y - height.value) / kRight;
144056
+ };
144057
+ return layoutInShape({
144058
+ text,
144059
+ height: height.value,
144060
+ xLeft,
144061
+ xRight
144062
+ });
144063
+ }
144064
+ const x1 = width.value * .4;
144065
+ const y1 = height.value * .4;
144066
+ const xLeft = (y) => y <= y1 ? 0 : width.value * (y - y1) / (height.value - y1);
144067
+ const xRight = (y) => x1 + (width.value - x1) * y / height.value;
144068
+ return layoutInShape({
144069
+ text,
144070
+ height: height.value,
144071
+ xLeft,
144072
+ xRight
144073
+ });
144074
+ });
144075
+ const allTextLines = computed(() => {
144076
+ return [
144077
+ ...topTextLines.value.map((i) => ({
144078
+ ...i,
144079
+ align: "left"
144080
+ })),
144081
+ ...size.value === 3 ? middleTextLines.value.map((i) => ({
144082
+ ...i,
144083
+ align: "left"
144084
+ })) : [],
144085
+ ...bottomTextLines.value.map((i) => ({
144086
+ ...i,
144087
+ align: "right"
144088
+ }))
144089
+ ];
144090
+ });
144091
+ const bgConfig = computed(() => ({
144092
+ x: 0,
144093
+ y: 0,
144094
+ width: props.widget.width,
144095
+ height: props.widget.height,
144096
+ fill: "transparent"
144097
+ }));
144098
+ return (_ctx, _cache) => {
144099
+ const _component_v_line = resolveComponent("v-line");
144100
+ const _component_v_text = resolveComponent("v-text");
144101
+ const _component_v_rect = resolveComponent("v-rect");
144102
+ const _component_v_group = resolveComponent("v-group");
144103
+ return openBlock(), createBlock(_component_v_group, { config: {
144104
+ x: __props.widget.x - CELL_PADDING,
144105
+ y: __props.widget.y - CELL_PADDING,
144106
+ id: __props.widget.id
144107
+ } }, {
144108
+ default: withCtx(() => [
144109
+ (openBlock(true), createElementBlock(Fragment, null, renderList(lines.value, (line, i) => {
144110
+ return openBlock(), createBlock(_component_v_line, {
144111
+ key: i,
144112
+ config: line
144113
+ }, null, 8, ["config"]);
144114
+ }), 128)),
144115
+ (openBlock(true), createElementBlock(Fragment, null, renderList(allTextLines.value, (line, i) => {
144116
+ return openBlock(), createBlock(_component_v_text, {
144117
+ key: "text-" + i,
144118
+ config: {
144119
+ x: line.x,
144120
+ y: line.y,
144121
+ text: line.text,
144122
+ fontSize: textStyle.value.fontSize,
144123
+ fontFamily: textStyle.value.fontFamily,
144124
+ lineHeight: textStyle.value.lineHeight,
144125
+ fill: textStyle.value.fill,
144126
+ fontStyle: textStyle.value.fontStyle,
144127
+ textDecoration: textStyle.value.textDecoration,
144128
+ align: line.align
144129
+ }
144130
+ }, null, 8, ["config"]);
144131
+ }), 128)),
144132
+ createVNode(_component_v_rect, { config: bgConfig.value }, null, 8, ["config"])
144133
+ ]),
144134
+ _: 1
144135
+ }, 8, ["config"]);
144136
+ };
144137
+ }
144138
+ });
144139
+ //#endregion
144140
+ //#region src/suites/edhr/component/pw-diagonal-render.vue
144141
+ var pw_diagonal_render_exports = /* @__PURE__ */ __exportAll({ default: () => pw_diagonal_render_default });
144142
+ var pw_diagonal_render_default = pw_diagonal_render_vue_vue_type_script_setup_true_name_pw_diagonal_render_lang_default;
144143
+ //#endregion
144144
+ //#region src/suites/edhr/component/pw-image-render.vue?vue&type=script&setup=true&name=gct-image-render&lang.ts
144145
+ init_asset_helper_util();
144146
+ init_image_size_util();
144147
+ init_useWidgetRenderData();
144148
+ var pw_image_render_vue_vue_type_script_setup_true_name_gct_image_render_lang_default = /*@__PURE__*/ defineComponent({
144149
+ __name: "pw-image-render",
144150
+ props: {
144151
+ widget: {},
144152
+ modelId: {}
144153
+ },
144154
+ setup(__props) {
144155
+ const props = __props;
144156
+ const imgRef = ref(null);
144157
+ const { pageWidgetProps } = usePaperWidgetStaticAttrs(props.widget);
144158
+ const natural = ref({
144159
+ width: 0,
144160
+ height: 0
144161
+ });
144162
+ const display = ref({
144163
+ width: props.widget.width,
144164
+ height: props.widget.height
144165
+ });
144166
+ const placeholder = {
144167
+ width: props.widget.width,
144168
+ height: props.widget.height,
144169
+ fill: "#f3f3f3"
144170
+ };
144171
+ watch(() => pageWidgetProps.value.value, async (v) => {
144172
+ const img = await AssetHelper.loadImage(v);
144173
+ if (!img) return;
144174
+ natural.value = {
144175
+ width: img.naturalWidth,
144176
+ height: img.naturalHeight
144177
+ };
144178
+ const size = computeImageDisplaySize(natural.value, {
144179
+ width: props.widget.width,
144180
+ height: props.widget.height,
144181
+ keepAspect: props.widget.keepAspect ?? true,
144182
+ maxDefaultWidth: 200
144183
+ });
144184
+ display.value = size;
144185
+ imgRef.value = img;
144186
+ }, { immediate: true });
144187
+ const imageConfig = computed(() => {
144188
+ const w = display.value.width;
144189
+ const h = display.value.height;
144190
+ return {
144191
+ x: 0,
144192
+ y: 0,
144193
+ image: imgRef.value,
144194
+ width: w,
144195
+ height: h
144196
+ };
144197
+ });
144198
+ return (_ctx, _cache) => {
144199
+ const _component_v_image = resolveComponent("v-image");
144200
+ const _component_v_rect = resolveComponent("v-rect");
144201
+ const _component_v_group = resolveComponent("v-group");
144202
+ return openBlock(), createBlock(_component_v_group, { config: {
144203
+ x: __props.widget.x,
144204
+ y: __props.widget.y,
144205
+ id: __props.widget.id
144206
+ } }, {
144207
+ default: withCtx(() => [imgRef.value ? (openBlock(), createBlock(_component_v_image, {
144208
+ key: 0,
144209
+ config: imageConfig.value
144210
+ }, null, 8, ["config"])) : (openBlock(), createBlock(_component_v_rect, {
144211
+ key: 1,
144212
+ width: placeholder.width,
144213
+ height: placeholder.height,
144214
+ fill: placeholder.fill
144215
+ }, null, 8, [
144216
+ "width",
144217
+ "height",
144218
+ "fill"
144219
+ ]))]),
144220
+ _: 1
144221
+ }, 8, ["config"]);
144222
+ };
144223
+ }
144224
+ });
144225
+ //#endregion
144226
+ //#region src/suites/edhr/component/pw-image-render.vue
144227
+ var pw_image_render_exports = /* @__PURE__ */ __exportAll({ default: () => pw_image_render_default });
144228
+ var pw_image_render_default = pw_image_render_vue_vue_type_script_setup_true_name_gct_image_render_lang_default;
144229
+ //#endregion
144230
+ //#region src/suites/edhr/component/pw-line-render.vue?vue&type=script&setup=true&lang.ts
144231
+ init_constants();
144232
+ init_core$1();
144233
+ init_useWidgetRenderData();
144234
+ var pw_line_render_vue_vue_type_script_setup_true_lang_default = /*@__PURE__*/ defineComponent({
144235
+ __name: "pw-line-render",
144236
+ props: {
144237
+ widget: {},
144238
+ modelId: {}
144239
+ },
144240
+ setup(__props) {
144241
+ const props = __props;
144242
+ const { docInst, isDesignMode, pageWidgetProps } = usePaperWidgetStaticAttrs(props.widget);
144243
+ const lineGroupConfig = computed(() => {
144244
+ return {
144245
+ x: props.widget.x,
144246
+ y: props.widget.y,
144247
+ id: props.widget.id
144248
+ };
144249
+ });
144250
+ const lineProps = computed(() => {
144251
+ const { borderColor, borderWidth, borderStyle, direction, rotate } = pageWidgetProps.value;
144252
+ const width = props.widget.width;
144253
+ const height = props.widget.height;
144254
+ const centerX = halfPixel(width / 2);
144255
+ const centerY = halfPixel(height / 2);
144256
+ let points;
144257
+ let offsetX = 0;
144258
+ let offsetY = 0;
144259
+ if (direction === "vertical") {
144260
+ points = [
144261
+ centerX,
144262
+ 0,
144263
+ centerX,
144264
+ height
144265
+ ];
144266
+ offsetX = centerX;
144267
+ offsetY = height / 2;
144268
+ } else {
144269
+ points = [
144270
+ 0,
144271
+ centerY,
144272
+ width,
144273
+ centerY
144274
+ ];
144275
+ offsetX = width / 2;
144276
+ offsetY = centerY;
144277
+ }
144278
+ return {
144279
+ x: offsetX,
144280
+ y: offsetY,
144281
+ stroke: borderColor || "#000",
144282
+ strokeWidth: borderWidth || 1,
144283
+ dash: borderStyle === "dashed" ? [6, 4] : borderStyle === "dotted" ? [2, 2] : void 0,
144284
+ points,
144285
+ offsetX,
144286
+ offsetY,
144287
+ rotation: rotate || 0,
144288
+ ...baseCanvasAttrs
144289
+ };
144290
+ });
144291
+ return (_ctx, _cache) => {
144292
+ const _component_v_line = resolveComponent("v-line");
144293
+ const _component_v_group = resolveComponent("v-group");
144294
+ return openBlock(), createBlock(_component_v_group, { config: lineGroupConfig.value }, {
144295
+ default: withCtx(() => [createVNode(_component_v_line, normalizeProps(guardReactiveProps(lineProps.value)), null, 16)]),
144296
+ _: 1
144297
+ }, 8, ["config"]);
144298
+ };
144299
+ }
144300
+ });
144301
+ //#endregion
144302
+ //#region src/suites/edhr/component/pw-line-render.vue
144303
+ var pw_line_render_exports = /* @__PURE__ */ __exportAll({ default: () => pw_line_render_default });
144304
+ var pw_line_render_default = pw_line_render_vue_vue_type_script_setup_true_lang_default;
144305
+ //#endregion
144306
+ //#region src/suites/edhr/component/pw-pagination-render.vue?vue&type=script&setup=true&lang.ts
144307
+ var pw_pagination_render_vue_vue_type_script_setup_true_lang_default = /*@__PURE__*/ defineComponent({
144308
+ __name: "pw-pagination-render",
144309
+ props: {
144310
+ widget: {},
144311
+ modelId: {}
144312
+ },
144313
+ setup(__props) {
144314
+ const props = __props;
144315
+ const textConfig = computed(() => {
144316
+ const widget = props.widget;
144317
+ const fontStyle = [widget.bold && "bold", widget.italic && "italic"].filter(Boolean).join(" ") || void 0;
144318
+ const textDecoration = [
144319
+ widget.isComposition && "underline",
144320
+ widget.underline && "underline",
144321
+ widget.strike && "line-through"
144322
+ ].filter(Boolean).filter((v, i, arr) => arr.indexOf(v) === i).join(" ") || void 0;
144323
+ return {
144324
+ x: 0,
144325
+ y: 0,
144326
+ text: widget.text,
144327
+ fontSize: widget.fontSize,
144328
+ fontFamily: widget.fontFamily,
144329
+ fill: widget.color,
144330
+ fontStyle,
144331
+ align: widget.textAlign,
144332
+ letterSpacing: widget.letterSpacing,
144333
+ textDecoration,
144334
+ wrap: "none"
144335
+ };
144336
+ });
144337
+ return (_ctx, _cache) => {
144338
+ const _component_v_text = resolveComponent("v-text");
144339
+ const _component_v_group = resolveComponent("v-group");
144340
+ return openBlock(), createBlock(_component_v_group, { config: {
144341
+ x: __props.widget.x,
144342
+ y: __props.widget.y,
144343
+ id: __props.widget.id
144344
+ } }, {
144345
+ default: withCtx(() => [createVNode(_component_v_text, { config: textConfig.value }, null, 8, ["config"])]),
144346
+ _: 1
144347
+ }, 8, ["config"]);
144348
+ };
144349
+ }
144350
+ });
144351
+ //#endregion
144352
+ //#region src/suites/edhr/component/pw-pagination-render.vue
144353
+ var pw_pagination_render_exports = /* @__PURE__ */ __exportAll({ default: () => pw_pagination_render_default });
144354
+ var pw_pagination_render_default = pw_pagination_render_vue_vue_type_script_setup_true_lang_default;
144355
+ //#endregion
144356
+ //#region src/suites/edhr/component/pw-qrcode-render.vue?vue&type=script&setup=true&lang.ts
144357
+ init_core$1();
144358
+ init_useWidgetRenderData();
144359
+ init_enum();
144360
+ init_core();
144361
+ var pw_qrcode_render_vue_vue_type_script_setup_true_lang_default = /*@__PURE__*/ defineComponent({
144362
+ __name: "pw-qrcode-render",
144363
+ props: {
144364
+ widget: {},
144365
+ modelId: {}
144366
+ },
144367
+ setup(__props) {
144368
+ const props = __props;
144369
+ const { docInst, isDesignMode, pageWidgetProps } = usePaperWidgetStaticAttrs(props.widget);
144370
+ const readonlyValue = ref("");
144371
+ const valueType = computed(() => pageWidgetProps.value.valueType);
144372
+ /** 值处理 */
144373
+ const modelValue = computed(() => {
144374
+ let text = pageWidgetProps.value.value;
144375
+ if (valueType.value === ValueTypeConst.Field) {
144376
+ var _text$exp;
144377
+ const path = text === null || text === void 0 || (_text$exp = text.exp) === null || _text$exp === void 0 || (_text$exp = _text$exp.fieldData) === null || _text$exp === void 0 ? void 0 : _text$exp.valuePath;
144378
+ if (path) {
144379
+ var _props$widget, _props$widget2, _props$widget3, _docInst$value;
144380
+ const runtimePath = replacePathIndexPlaceholders({
144381
+ y: (_props$widget = props.widget) === null || _props$widget === void 0 || (_props$widget = _props$widget.dataSlotIndex) === null || _props$widget === void 0 ? void 0 : _props$widget.yDataIndex,
144382
+ x: (_props$widget2 = props.widget) === null || _props$widget2 === void 0 || (_props$widget2 = _props$widget2.dataSlotIndex) === null || _props$widget2 === void 0 ? void 0 : _props$widget2.xDataIndex,
144383
+ n: (_props$widget3 = props.widget) === null || _props$widget3 === void 0 || (_props$widget3 = _props$widget3.dataSlotIndex) === null || _props$widget3 === void 0 ? void 0 : _props$widget3.dataIndex,
144384
+ templatePath: path
144385
+ });
144386
+ text = (_docInst$value = docInst.value) === null || _docInst$value === void 0 || (_docInst$value = _docInst$value.dataManager) === null || _docInst$value === void 0 ? void 0 : _docInst$value.get(runtimePath);
144387
+ }
144388
+ }
144389
+ return Array.isArray(text) ? text.join() : text;
144390
+ });
144391
+ watch(() => modelValue.value, async () => {
144392
+ if (isDesignMode.value) {
144393
+ readonlyValue.value = "GCT";
144394
+ return;
144395
+ }
144396
+ if (valueType.value === ValueTypeConst.Formula) {
144397
+ var _modelValue$value, _props$widget4, _modelValue$value2;
144398
+ const subFieldKey = (_modelValue$value = modelValue.value) === null || _modelValue$value === void 0 ? void 0 : _modelValue$value.subFieldKey;
144399
+ const rawData = docInst.value.dataManager.getRawData();
144400
+ const path = subFieldKey ? `${subFieldKey}[${(_props$widget4 = props.widget) === null || _props$widget4 === void 0 || (_props$widget4 = _props$widget4.dataSlotIndex) === null || _props$widget4 === void 0 ? void 0 : _props$widget4.dataIndex}]` : "";
144401
+ const subRowData = path ? docInst.value.dataManager.get(path) : {};
144402
+ const result = await formulaUtils.calculateFormula((_modelValue$value2 = modelValue.value) === null || _modelValue$value2 === void 0 ? void 0 : _modelValue$value2.exp, rawData, subRowData);
144403
+ readonlyValue.value = result;
144404
+ } else readonlyValue.value = modelValue.value;
144405
+ }, { immediate: true });
144406
+ const isValueEmpty = computed(() => {
144407
+ return isEmptyValue$1(readonlyValue.value);
144408
+ });
144409
+ const qrData = computed(() => {
144410
+ if (isValueEmpty.value) return [];
144411
+ try {
144412
+ return QRCode.create(readonlyValue.value, {
144413
+ errorCorrectionLevel: "H",
144414
+ margin: 1
144415
+ }).modules.data;
144416
+ } catch {
144417
+ return [];
144418
+ }
144419
+ });
144420
+ const blocks = computed(() => {
144421
+ if (isValueEmpty.value) {
144422
+ const placeholder = [];
144423
+ const size = 21;
144424
+ const unit = props.widget.width / size;
144425
+ for (let row = 0; row < size; row++) for (let col = 0; col < size; col++) if ((row + col) % 3 === 0) placeholder.push({
144426
+ x: col * unit,
144427
+ y: row * unit,
144428
+ w: unit,
144429
+ h: unit,
144430
+ fill: "#bbb"
144431
+ });
144432
+ return placeholder;
144433
+ }
144434
+ const blocksArr = [];
144435
+ const size = Math.sqrt(qrData.value.length);
144436
+ const unit = props.widget.width / size;
144437
+ for (let row = 0; row < size; row++) for (let col = 0; col < size; col++) {
144438
+ const idx = row * size + col;
144439
+ if (qrData.value[idx]) blocksArr.push({
144440
+ x: col * unit,
144441
+ y: row * unit,
144442
+ w: unit,
144443
+ h: unit,
144444
+ fill: "#000"
144445
+ });
144446
+ }
144447
+ return blocksArr;
144448
+ });
144449
+ const lightningPath = computed(() => {
144450
+ const w = props.widget.width;
144451
+ const mid = props.widget.width / 2;
144452
+ return `
144453
+ M 0 ${mid - 6}
144454
+ L ${w * .25} ${mid - 2}
144455
+ L ${w * .4} ${mid + 2}
144456
+ L ${w * .6} ${mid - 4}
144457
+ L ${w * .8} ${mid + 3}
144458
+ L ${w} ${mid - 1}
144459
+ L ${w} ${mid + 6}
144460
+ L ${w * .8} ${mid + 10}
144461
+ L ${w * .6} ${mid + 4}
144462
+ L ${w * .4} ${mid + 12}
144463
+ L ${w * .25} ${mid + 6}
144464
+ L 0 ${mid + 10}
144465
+ Z
144466
+ `;
144467
+ });
144468
+ const bgConfig = computed(() => ({
144469
+ x: 0,
144470
+ y: 0,
144471
+ width: props.widget.width,
144472
+ height: props.widget.height,
144473
+ fill: "transparent"
144474
+ }));
144475
+ return (_ctx, _cache) => {
144476
+ const _component_v_rect = resolveComponent("v-rect");
144477
+ const _component_v_path = resolveComponent("v-path");
144478
+ const _component_v_group = resolveComponent("v-group");
144479
+ return openBlock(), createBlock(_component_v_group, { config: {
144480
+ x: __props.widget.x,
144481
+ y: __props.widget.y,
144482
+ id: __props.widget.id
144483
+ } }, {
144484
+ default: withCtx(() => [
144485
+ (openBlock(true), createElementBlock(Fragment, null, renderList(blocks.value, (block, i) => {
144486
+ return openBlock(), createBlock(_component_v_rect, {
144487
+ key: i,
144488
+ x: block.x,
144489
+ y: block.y,
144490
+ width: block.w,
144491
+ height: block.h,
144492
+ fill: block.fill
144493
+ }, null, 8, [
144494
+ "x",
144495
+ "y",
144496
+ "width",
144497
+ "height",
144498
+ "fill"
144499
+ ]);
144500
+ }), 128)),
144501
+ isValueEmpty.value ? (openBlock(), createBlock(_component_v_path, {
144502
+ key: 0,
144503
+ data: lightningPath.value,
144504
+ fill: "#fff"
144505
+ }, null, 8, ["data"])) : createCommentVNode("", true),
144506
+ createVNode(_component_v_rect, { config: bgConfig.value }, null, 8, ["config"])
144507
+ ]),
144508
+ _: 1
144509
+ }, 8, ["config"]);
144510
+ };
144511
+ }
144512
+ });
144513
+ //#endregion
144514
+ //#region src/suites/edhr/component/pw-qrcode-render.vue
144515
+ var pw_qrcode_render_exports = /* @__PURE__ */ __exportAll({ default: () => pw_qrcode_render_default });
144516
+ var pw_qrcode_render_default = pw_qrcode_render_vue_vue_type_script_setup_true_lang_default;
144517
+ //#endregion
144518
+ //#region src/suites/edhr/component/index.ts
142370
144519
  function loadVueComponentModulesSync() {
142371
- const componentModules = /* #__PURE__ */ Object.assign({});
144520
+ const componentModules = {
144521
+ .../* #__PURE__ */ Object.assign({
144522
+ "./gct-control-render.vue": gct_control_render_exports,
144523
+ "./gct-image-render.vue": gct_image_render_exports,
144524
+ "./gct-leftMarker-render.vue": gct_leftMarker_render_exports,
144525
+ "./gct-placeholder-render.vue": gct_placeholder_render_exports,
144526
+ "./gct-rightMarker-render.vue": gct_rightMarker_render_exports,
144527
+ "./gct-signature-render.vue": gct_signature_render_exports,
144528
+ "./gct-space-render.vue": gct_space_render_exports,
144529
+ "./gct-text-render.vue": gct_text_render_exports
144530
+ }),
144531
+ .../* #__PURE__ */ Object.assign({
144532
+ "./pw-barcode-render.vue": pw_barcode_render_exports,
144533
+ "./pw-diagonal-render.vue": pw_diagonal_render_exports,
144534
+ "./pw-image-render.vue": pw_image_render_exports,
144535
+ "./pw-line-render.vue": pw_line_render_exports,
144536
+ "./pw-pagination-render.vue": pw_pagination_render_exports,
144537
+ "./pw-qrcode-render.vue": pw_qrcode_render_exports
144538
+ })
144539
+ };
142372
144540
  const vueComponentMap = {};
142373
144541
  Object.entries(componentModules).forEach(([filePath, componentModule]) => {
142374
144542
  try {