@gct-paas/excel 0.1.39-beta.45 → 0.1.39-beta.46

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (61) hide show
  1. package/dist/{BaseComponent-BcMUXzWr.js → BaseComponent-D_qr1qAV.js} +1 -1
  2. package/dist/{barcode-design-DCo5X-NW.js → barcode-design-B1E1I0h9.js} +1 -1
  3. package/dist/base/index.es.js +34 -11
  4. package/dist/{diagonal-design-CTC7YZ27.js → diagonal-design-vUC0R6G9.js} +1 -1
  5. package/dist/{dynamic-table-action-CTBy77AD.js → dynamic-table-action-BjNAbOiM.js} +53 -33
  6. package/dist/excel.css +8 -8
  7. package/dist/{exceljs.min-BHi5L338.js → exceljs.min-ruMnRdmJ.js} +1 -1
  8. package/dist/{font-editor--mgAlMck.js → font-editor-KgE3aTA7.js} +1 -1
  9. package/dist/{index-CrAk2XO5.js → index-B1Zk4PhS.js} +1 -1
  10. package/dist/{index-Des_Z7g-.js → index-BK2bj0YC.js} +1 -1
  11. package/dist/{index-Dig1Y-WI.js → index-BkrySdbu.js} +2 -2
  12. package/dist/{index-GQjqLjCV.js → index-BtAn5HaV.js} +1 -1
  13. package/dist/{index-Clecgmwq.js → index-C3GeooR3.js} +1 -1
  14. package/dist/{index-DOkOt95L.js → index-CHFipq2D.js} +1 -1
  15. package/dist/{index-D2OOg_P9.js → index-CKKmoHnx.js} +2 -2
  16. package/dist/{index-CDLTNhDs.js → index-CWr2IJif.js} +1 -1
  17. package/dist/{index-CiW7CSPh.js → index-CeUHeApW.js} +1 -1
  18. package/dist/{index-Bz009Lre.js → index-CpDIChOU.js} +1 -1
  19. package/dist/{index-CqDSzVbY.js → index-CquK-4J5.js} +1 -1
  20. package/dist/{index-DMPLAalb.js → index-D0wXTI_4.js} +3 -3
  21. package/dist/{index-B2tkugA7.js → index-DC9Ri3CX.js} +332 -173
  22. package/dist/{index-CPgE97o3.js → index-DPZCDmkK.js} +2 -2
  23. package/dist/{index-B_wIm0c_.js → index-DSFStTXw.js} +1 -1
  24. package/dist/{index-_l9ejJci.js → index-DierjEYd.js} +1 -1
  25. package/dist/{index-CFZlwM2O.js → index-DnmoxMpn.js} +1 -1
  26. package/dist/{index-DtpStBfx.js → index-DoOqRMkR.js} +2 -2
  27. package/dist/{index-B39BtiX-.js → index-Dojxm4da.js} +2 -2
  28. package/dist/{index-CizCUtiP.js → index-DqeDXZCe.js} +1 -1
  29. package/dist/{index-Dnaztyex.js → index-DvzscBgj.js} +1 -1
  30. package/dist/{index-Cit7v0Sn.js → index-DzW9E770.js} +1 -1
  31. package/dist/{index-BMEKVMta.js → index-bBk6szgy.js} +2 -2
  32. package/dist/{index-DAYRbY4X.js → index-owxyHZ4N.js} +1 -1
  33. package/dist/index.es.js +1 -1
  34. package/dist/{pagination-design-D8s2QR4I.js → pagination-design-BqD1xNnj.js} +1 -1
  35. package/dist/paper-widget-design-0Wlu4W7D.js +4 -0
  36. package/dist/{print-runtime-instance-DMKmR64C.js → print-runtime-instance-D-zZ-Pnj.js} +1 -1
  37. package/dist/{print-snapshot-renderer-Dqh4wq32.js → print-snapshot-renderer-CAu5xiAs.js} +3 -3
  38. package/dist/{qrcode-design-CAl6czye.js → qrcode-design-Dx0mGVK1.js} +1 -1
  39. package/dist/seal-design-BSsVnsgS.js +4 -0
  40. package/dist/{single-field-drop-VsopxP2Q.js → single-field-drop-CadWmOmY.js} +1 -1
  41. package/dist/src/nocode-base/src/hooks/material-consume/material-consume-table-controller.d.ts +14 -13
  42. package/dist/src/nocode-base/src/hooks/material-consume/tmpl-bom-controller.d.ts +8 -0
  43. package/dist/src/online-form/src/views/render/__components__/_field_/trace/composables/useReferenceLabel.d.ts +4 -0
  44. package/dist/{sub-table-factory-Ch6_9YNA.js → sub-table-factory-oIHIEDd1.js} +1 -1
  45. package/dist/{text-design-BhAmwouQ.js → text-design-DvaCN4xE.js} +1 -1
  46. package/dist/{trace-like-wrapper-BKilXIvf.js → trace-like-wrapper-DjdghEJk.js} +1 -1
  47. package/dist/{value-editor.vue_vue_type_style_index_0_lang-D8HDJ4_Y.js → value-editor.vue_vue_type_style_index_0_lang-DOoBSxtT.js} +1 -1
  48. package/dist/{widget-barcode-BRgk5gJJ.js → widget-barcode-Bihp8eQf.js} +2 -2
  49. package/dist/{widget-diagonal-ZRIIfCLT.js → widget-diagonal-CU143lb2.js} +2 -2
  50. package/dist/{widget-image-BYbhP5K2.js → widget-image-CvQtHO9u.js} +1 -1
  51. package/dist/{widget-line-D_AZ1rPP.js → widget-line-BWWibbG3.js} +1 -1
  52. package/dist/{widget-pagination-a49kG9bb.js → widget-pagination-BOlbp2M6.js} +2 -2
  53. package/dist/{widget-power-CXpS_5Fa.js → widget-power-BQrjZJ0s.js} +2 -2
  54. package/dist/{widget-qrcode-31D-nG6D.js → widget-qrcode-CMrJuNbq.js} +2 -2
  55. package/dist/{widget-rangelimit-CbKUOqCH.js → widget-rangelimit-CGkoloXm.js} +2 -2
  56. package/dist/{widget-serialnumber-Dd3xlWF_.js → widget-serialnumber-Rwq-qlyD.js} +1 -1
  57. package/dist/{widget-text-B9Sz6JsF.js → widget-text-Qj9jHnAY.js} +3 -3
  58. package/dist/{widget-timediff-DL5l1QV-.js → widget-timediff-DVtLFiEW.js} +1 -1
  59. package/package.json +1 -1
  60. package/dist/paper-widget-design-CEdEkvnQ.js +0 -4
  61. package/dist/seal-design-CWPtNAMf.js +0 -4
@@ -5,7 +5,7 @@ import { range, cloneDeep, get as get$3, merge, isEmpty, zip, pick, omit, has, d
5
5
  import dayjs from "dayjs";
6
6
  import * as Antd from "ant-design-vue";
7
7
  import { message, Modal, Alert, Empty, InputSearch, Cascader, ConfigProvider, Tooltip as Tooltip$1, Input, Tree, Transfer, Select, Tag, AutoComplete, TimePicker, DatePicker, Textarea, TreeSelect, CheckboxGroup, Checkbox, Radio, RadioGroup } from "ant-design-vue";
8
- import { M as MAX_RUNTIME_SHEETS, a as MAX_RUNTIME_SHEET_TITLE_LENGTH, g as getBusinessFieldKey, b as MULTI_SHEET_SCHEMA_VERSION, n as normalizeGridColumnWidth, c as getParseFormulaVarInfos, d as createRuntimeDocumentV2, e as clampSealPosition, f as normalizeSealDiameter, h as normalizeFieldWidth, D as DEFAULT_BOOLEAN_FIELD_WIDTH, i as isCellAutoLineBreak, B as BorderTD, u as useFormTmplConfig, j as normalizeHistoricalBusinessRow, k as DeviceLinkTmplUtil, l as normalizeAIOcrTmpl, m as useWidgetStaticAttrs, o as useRuntimeInstanceServices, s as setSelectValidatorId, p as setSelectAnnotationId, q as useRuntimeRowState, r as getObjectBomMaterialLotQuery, t as buildObjectLotExtraQuery, v as resolveObjectFieldKeys, w as MaterialConsumptionPatternEnum, x as validateObjectBomForScan, y as resolveObjectBomEntry, z as runWithFillProduct, A as useNocodeFormWidget, C as applyConsumeObjectTraceChange, E as getObjectBomProductQuery, F as EMPTY_PRODUCT_VERSION_ID, G as normalizeHistoricalAutofillRow, N as NCB_PROVIDE, H as readSealValue, I as isSealStamped, J as stampSealValue, K as isValidSealValue, L as clearSealValue, O as parseRuntimeFieldPath, P as calculateFormula, Q as useStyles, R as useDependency, S as useFieldPresentation, T as useRuntimeEditorFlusher, U as RuntimeFormStateStore, V as createRuntimeInstanceContext, W as RuntimeInstanceRegistry, X as ScanParamType, Y as RequiredQtyCalcRule, Z as registerFormulaFuncs, _ as moveSealValue, $ as DocumentPaper, a0 as DynamicTableAction, a1 as _sfc_main$6w } from "./dynamic-table-action-CTBy77AD.js";
8
+ import { M as MAX_RUNTIME_SHEETS, a as MAX_RUNTIME_SHEET_TITLE_LENGTH, g as getBusinessFieldKey, b as MULTI_SHEET_SCHEMA_VERSION, n as normalizeGridColumnWidth, c as getParseFormulaVarInfos, d as createRuntimeDocumentV2, e as clampSealPosition, f as normalizeSealDiameter, h as normalizeFieldWidth, D as DEFAULT_BOOLEAN_FIELD_WIDTH, i as isCellAutoLineBreak, B as BorderTD, u as useFormTmplConfig, j as normalizeHistoricalBusinessRow, k as DeviceLinkTmplUtil, l as normalizeAIOcrTmpl, m as useWidgetStaticAttrs, o as useRuntimeInstanceServices, s as setSelectValidatorId, p as setSelectAnnotationId, q as useRuntimeRowState, r as getObjectBomMaterialLotQuery, t as buildObjectLotExtraQuery, v as resolveObjectFieldKeys, w as MaterialConsumptionPatternEnum, x as validateObjectBomForScan, y as resolveObjectBomEntry, z as runWithFillProduct, A as useNocodeFormWidget, C as applyConsumeObjectTraceChange, E as getObjectBomProductQuery, F as EMPTY_PRODUCT_VERSION_ID, G as normalizeHistoricalAutofillRow, N as NCB_PROVIDE, H as readSealValue, I as isSealStamped, J as stampSealValue, K as isValidSealValue, L as clearSealValue, O as parseRuntimeFieldPath, P as calculateFormula, Q as useStyles, R as useDependency, S as useFieldPresentation, T as useRuntimeEditorFlusher, U as RuntimeFormStateStore, V as createRuntimeInstanceContext, W as RuntimeInstanceRegistry, X as ScanParamType, Y as RequiredQtyCalcRule, Z as registerFormulaFuncs, _ as moveSealValue, $ as DocumentPaper, a0 as DynamicTableAction, a1 as _sfc_main$6w } from "./dynamic-table-action-BjNAbOiM.js";
9
9
  import { S as SEARCH_SEVICE, V as VersionSelect, C as CloseOutlined, E as EmptyImg$2, _ as _sfc_main$6u, P as ProductTypeEnum } from "./online-form-model-select.vue_vue_type_script_setup_true_name_online-form-model-select_lang-CQytxboy.js";
10
10
  import { I as Icon$1, w as warning, u as useInsertStyles, s as svgBaseProps, a as useNamespace } from "./AntdIcon-DCIaV352.js";
11
11
  import { u as useWebUpload, i as initWebPaasUploadApis, a as useThrottleFn, d as defaultWindow, n as noop, b as useEventListener, c as isIOS, e as unrefElement, r as require$$0, U as Uploader, f as useIntersectionObserver, g as cacheAdapter, w as watchDebounced, A as AddRuleBtn, M as ModalWrapper, F as FormFieldSelect, o as onClickOutside$1, _ as _sfc_main$6v, h as initWebNocodeAdapter } from "./index-DZMdGtEu.js";
@@ -1931,7 +1931,7 @@ function openWindow(url, opt) {
1931
1931
  const FieldPropLabels = Object.entries(FIELD_PROP_LABEL_MAP);
1932
1932
  const FieldTypeLabels = Object.entries(FIELD_TYPE_LABEL_MAP);
1933
1933
  async function createWorkbook() {
1934
- const ExcelJs = (await import("./exceljs.min-BHi5L338.js").then((n) => n.e)).default;
1934
+ const ExcelJs = (await import("./exceljs.min-ruMnRdmJ.js").then((n) => n.e)).default;
1935
1935
  return new ExcelJs.Workbook();
1936
1936
  }
1937
1937
  class XlsxParser {
@@ -2302,28 +2302,28 @@ class XlsxParser {
2302
2302
  }
2303
2303
  function asyncImportClassModules() {
2304
2304
  const modules = /* @__PURE__ */ Object.assign({
2305
- "./_field_/auto-complete/index.ts": () => import("./index-D2OOg_P9.js").then((m) => m["default"]),
2306
- "./_field_/datepicker/index.ts": () => import("./index-CiW7CSPh.js").then((m) => m["default"]),
2307
- "./_field_/datetimepicker/index.ts": () => import("./index-_l9ejJci.js").then((m) => m["default"]),
2308
- "./_field_/department/index.ts": () => import("./index-DOkOt95L.js").then((m) => m["default"]),
2309
- "./_field_/enum-select/index.ts": () => import("./index-DtpStBfx.js").then((m) => m["default"]),
2310
- "./_field_/input/index.ts": () => import("./index-DAYRbY4X.js").then((m) => m["default"]),
2311
- "./_field_/inputdouble/index.ts": () => import("./index-Dnaztyex.js").then((m) => m["default"]),
2312
- "./_field_/inputnumber/index.ts": () => import("./index-Cit7v0Sn.js").then((m) => m["default"]),
2313
- "./_field_/rdo-select/index.ts": () => import("./index-CPgE97o3.js").then((m) => m["default"]),
2314
- "./_field_/seal/index.ts": () => import("./index-BMEKVMta.js").then((m) => m["default"]),
2315
- "./_field_/select/index.ts": () => import("./index-B39BtiX-.js").then((m) => m["default"]),
2316
- "./_field_/sign/index.ts": () => import("./index-CqDSzVbY.js").then((m) => m["default"]),
2317
- "./_field_/switch/index.ts": () => import("./index-DMPLAalb.js").then((m) => m["default"]),
2318
- "./_field_/textarea/index.ts": () => import("./index-GQjqLjCV.js").then((m) => m["default"]),
2319
- "./_field_/timepicker/index.ts": () => import("./index-CrAk2XO5.js").then((m) => m["default"]),
2320
- "./_field_/upload-file/index.ts": () => import("./index-CDLTNhDs.js").then((m) => m["default"]),
2321
- "./_field_/upload-image/index.ts": () => import("./index-Bz009Lre.js").then((m) => m["default"]),
2322
- "./_field_/userpicker/index.ts": () => import("./index-CFZlwM2O.js").then((m) => m["default"]),
2305
+ "./_field_/auto-complete/index.ts": () => import("./index-CKKmoHnx.js").then((m) => m["default"]),
2306
+ "./_field_/datepicker/index.ts": () => import("./index-CeUHeApW.js").then((m) => m["default"]),
2307
+ "./_field_/datetimepicker/index.ts": () => import("./index-DierjEYd.js").then((m) => m["default"]),
2308
+ "./_field_/department/index.ts": () => import("./index-CHFipq2D.js").then((m) => m["default"]),
2309
+ "./_field_/enum-select/index.ts": () => import("./index-DoOqRMkR.js").then((m) => m["default"]),
2310
+ "./_field_/input/index.ts": () => import("./index-owxyHZ4N.js").then((m) => m["default"]),
2311
+ "./_field_/inputdouble/index.ts": () => import("./index-DvzscBgj.js").then((m) => m["default"]),
2312
+ "./_field_/inputnumber/index.ts": () => import("./index-DzW9E770.js").then((m) => m["default"]),
2313
+ "./_field_/rdo-select/index.ts": () => import("./index-DPZCDmkK.js").then((m) => m["default"]),
2314
+ "./_field_/seal/index.ts": () => import("./index-bBk6szgy.js").then((m) => m["default"]),
2315
+ "./_field_/select/index.ts": () => import("./index-Dojxm4da.js").then((m) => m["default"]),
2316
+ "./_field_/sign/index.ts": () => import("./index-CquK-4J5.js").then((m) => m["default"]),
2317
+ "./_field_/switch/index.ts": () => import("./index-D0wXTI_4.js").then((m) => m["default"]),
2318
+ "./_field_/textarea/index.ts": () => import("./index-BtAn5HaV.js").then((m) => m["default"]),
2319
+ "./_field_/timepicker/index.ts": () => import("./index-B1Zk4PhS.js").then((m) => m["default"]),
2320
+ "./_field_/upload-file/index.ts": () => import("./index-CWr2IJif.js").then((m) => m["default"]),
2321
+ "./_field_/upload-image/index.ts": () => import("./index-CpDIChOU.js").then((m) => m["default"]),
2322
+ "./_field_/userpicker/index.ts": () => import("./index-DnmoxMpn.js").then((m) => m["default"]),
2323
2323
  "./_widget_/barcode/index.ts": () => import("./index-CwIsdzXH.js").then((m) => m["default"]),
2324
- "./_widget_/combine-fields/index.ts": () => import("./index-B_wIm0c_.js").then((m) => m["default"]),
2325
- "./_widget_/diagonal/index.ts": () => import("./index-Des_Z7g-.js").then((m) => m["default"]),
2326
- "./_widget_/dyn-value/index.ts": () => import("./index-CizCUtiP.js").then((m) => m["default"]),
2324
+ "./_widget_/combine-fields/index.ts": () => import("./index-DSFStTXw.js").then((m) => m["default"]),
2325
+ "./_widget_/diagonal/index.ts": () => import("./index-BK2bj0YC.js").then((m) => m["default"]),
2326
+ "./_widget_/dyn-value/index.ts": () => import("./index-DqeDXZCe.js").then((m) => m["default"]),
2327
2327
  "./_widget_/image/index.ts": () => import("./index-DCjd1J3_.js").then((m) => m["default"]),
2328
2328
  "./_widget_/line/index.ts": () => import("./index-BO1Li3H3.js").then((m) => m["default"]),
2329
2329
  "./_widget_/power/index.ts": () => import("./index-BO9uHu6r.js").then((m) => m["default"]),
@@ -2333,8 +2333,8 @@ function asyncImportClassModules() {
2333
2333
  "./_widget_/sub-table/index.ts": () => import("./index-BjU6Dtry.js").then((m) => m["default"]),
2334
2334
  "./_widget_/timediff/index.ts": () => import("./index-vFXGFf0u.js").then((m) => m["default"]),
2335
2335
  "./paper/index.ts": () => import("./index-BmMbk3ux.js").then((m) => m["default"]),
2336
- "./td/index.ts": () => import("./index-Dig1Y-WI.js").then((m) => m["default"]),
2337
- "./tr/index.ts": () => import("./index-Clecgmwq.js").then((m) => m["default"])
2336
+ "./td/index.ts": () => import("./index-BkrySdbu.js").then((m) => m["default"]),
2337
+ "./tr/index.ts": () => import("./index-C3GeooR3.js").then((m) => m["default"])
2338
2338
  });
2339
2339
  return modules;
2340
2340
  }
@@ -16051,7 +16051,7 @@ function asyncImportWidgetConfigList() {
16051
16051
  return widgetConfigList;
16052
16052
  }
16053
16053
  function asyncImportWidgetDesign() {
16054
- const modules = /* @__PURE__ */ Object.assign({ "../__cell_widgets__/cell-widget-design.vue": () => Promise.resolve().then(() => cellWidgetDesign), "../__cell_widgets__/seal/seal-design.vue": () => import("./seal-design-CWPtNAMf.js"), "./barcode/barcode-design.vue": () => import("./barcode-design-DCo5X-NW.js"), "./diagonal/diagonal-design.vue": () => import("./diagonal-design-CTC7YZ27.js"), "./image/image-design.vue": () => import("./image-design-CvPulfQ5.js"), "./line/line-design.vue": () => Promise.resolve().then(() => lineDesign), "./pagination/pagination-design.vue": () => import("./pagination-design-D8s2QR4I.js"), "./paper-widget-design.vue": () => import("./paper-widget-design-CEdEkvnQ.js"), "./power/power-design.vue": () => Promise.resolve().then(() => powerDesign), "./qrcode/qrcode-design.vue": () => import("./qrcode-design-CAl6czye.js"), "./rangelimit/rangelimit-design.vue": () => Promise.resolve().then(() => rangelimitDesign), "./serialnumber/serialnumber-design.vue": () => import("./serialnumber-design-b3PN24Uf.js"), "./text/text-design.vue": () => import("./text-design-BhAmwouQ.js"), "./timediff/timediff-design.vue": () => import("./timediff-design-BLpsTDOD.js") });
16054
+ const modules = /* @__PURE__ */ Object.assign({ "../__cell_widgets__/cell-widget-design.vue": () => Promise.resolve().then(() => cellWidgetDesign), "../__cell_widgets__/seal/seal-design.vue": () => import("./seal-design-BSsVnsgS.js"), "./barcode/barcode-design.vue": () => import("./barcode-design-B1E1I0h9.js"), "./diagonal/diagonal-design.vue": () => import("./diagonal-design-vUC0R6G9.js"), "./image/image-design.vue": () => import("./image-design-CvPulfQ5.js"), "./line/line-design.vue": () => Promise.resolve().then(() => lineDesign), "./pagination/pagination-design.vue": () => import("./pagination-design-BqD1xNnj.js"), "./paper-widget-design.vue": () => import("./paper-widget-design-0Wlu4W7D.js"), "./power/power-design.vue": () => Promise.resolve().then(() => powerDesign), "./qrcode/qrcode-design.vue": () => import("./qrcode-design-Dx0mGVK1.js"), "./rangelimit/rangelimit-design.vue": () => Promise.resolve().then(() => rangelimitDesign), "./serialnumber/serialnumber-design.vue": () => import("./serialnumber-design-b3PN24Uf.js"), "./text/text-design.vue": () => import("./text-design-DvaCN4xE.js"), "./timediff/timediff-design.vue": () => import("./timediff-design-BLpsTDOD.js") });
16055
16055
  const widgetDesignMap = Object.keys(modules).reduce((map2, path) => {
16056
16056
  const mKey = path.match(/\/([a-z]+)-design\.vue$/)?.[1];
16057
16057
  if (mKey) {
@@ -53017,7 +53017,7 @@ const _sfc_main$3q = /* @__PURE__ */ defineComponent({
53017
53017
  }
53018
53018
  });
53019
53019
  function asyncImportWidgetProp() {
53020
- const modules = /* @__PURE__ */ Object.assign({ "./widget-barcode.vue": () => import("./widget-barcode-BRgk5gJJ.js"), "./widget-diagonal.vue": () => import("./widget-diagonal-ZRIIfCLT.js"), "./widget-image.vue": () => import("./widget-image-BYbhP5K2.js"), "./widget-line.vue": () => import("./widget-line-D_AZ1rPP.js"), "./widget-pagination.vue": () => import("./widget-pagination-a49kG9bb.js"), "./widget-power.vue": () => import("./widget-power-CXpS_5Fa.js"), "./widget-qrcode.vue": () => import("./widget-qrcode-31D-nG6D.js"), "./widget-rangelimit.vue": () => import("./widget-rangelimit-CbKUOqCH.js"), "./widget-serialnumber.vue": () => import("./widget-serialnumber-Dd3xlWF_.js"), "./widget-text.vue": () => import("./widget-text-B9Sz6JsF.js"), "./widget-timediff.vue": () => import("./widget-timediff-DL5l1QV-.js") });
53020
+ const modules = /* @__PURE__ */ Object.assign({ "./widget-barcode.vue": () => import("./widget-barcode-Bihp8eQf.js"), "./widget-diagonal.vue": () => import("./widget-diagonal-CU143lb2.js"), "./widget-image.vue": () => import("./widget-image-CvQtHO9u.js"), "./widget-line.vue": () => import("./widget-line-BWWibbG3.js"), "./widget-pagination.vue": () => import("./widget-pagination-BOlbp2M6.js"), "./widget-power.vue": () => import("./widget-power-BQrjZJ0s.js"), "./widget-qrcode.vue": () => import("./widget-qrcode-CMrJuNbq.js"), "./widget-rangelimit.vue": () => import("./widget-rangelimit-CGkoloXm.js"), "./widget-serialnumber.vue": () => import("./widget-serialnumber-Rwq-qlyD.js"), "./widget-text.vue": () => import("./widget-text-Qj9jHnAY.js"), "./widget-timediff.vue": () => import("./widget-timediff-DVtLFiEW.js") });
53021
53021
  const widgetPropMap = Object.keys(modules).reduce((map2, path) => {
53022
53022
  const mKey = path.match(/\/widget-([a-z]+)\.vue$/)?.[1];
53023
53023
  if (mKey) {
@@ -72370,7 +72370,6 @@ const _sfc_main$1H = /* @__PURE__ */ defineComponent({
72370
72370
  showRequired,
72371
72371
  showDisabled,
72372
72372
  options: initialOptions,
72373
- loadFinished2Options,
72374
72373
  newTotalCount,
72375
72374
  newQueryDataRef
72376
72375
  } = useWidgetStaticAttrs(props2.widget);
@@ -72458,6 +72457,7 @@ const _sfc_main$1H = /* @__PURE__ */ defineComponent({
72458
72457
  allowClear: true,
72459
72458
  defaultActiveFirstOption: false,
72460
72459
  showSearch: true,
72460
+ filterOption: false,
72461
72461
  notFoundContent: void 0
72462
72462
  };
72463
72463
  return attr;
@@ -72609,7 +72609,6 @@ const _sfc_main$1H = /* @__PURE__ */ defineComponent({
72609
72609
  }
72610
72610
  );
72611
72611
  const handleSearch = (keyword2) => {
72612
- if (loadFinished2Options) return;
72613
72612
  state.data = [];
72614
72613
  debounceSearch(keyword2);
72615
72614
  };
@@ -72714,7 +72713,7 @@ const _sfc_main$1H = /* @__PURE__ */ defineComponent({
72714
72713
  };
72715
72714
  }
72716
72715
  });
72717
- const AllocatePart = /* @__PURE__ */ _export_sfc(_sfc_main$1H, [["__scopeId", "data-v-8620f4a0"]]);
72716
+ const AllocatePart = /* @__PURE__ */ _export_sfc(_sfc_main$1H, [["__scopeId", "data-v-6c8bafae"]]);
72718
72717
  function useAsyncOptions({ bindModelKey, modelCategory, code: code2 }) {
72719
72718
  async function getRefList(arg = {}) {
72720
72719
  const res = await api.apaas.modelComprehensive.postBizServiceModelCategoryModelKeyBsKey(
@@ -72809,10 +72808,11 @@ const _sfc_main$1G = /* @__PURE__ */ defineComponent({
72809
72808
  emit2("update:modelValue", val);
72810
72809
  }
72811
72810
  });
72811
+ let optionsRequestId = 0;
72812
72812
  watch(
72813
72813
  () => currentValue.value,
72814
72814
  async () => {
72815
- if (!state.loadFinished2Options) {
72815
+ if (!state.data.some((option2) => option2.value === currentValue.value)) {
72816
72816
  await checkInitialValue();
72817
72817
  }
72818
72818
  },
@@ -72833,7 +72833,7 @@ const _sfc_main$1G = /* @__PURE__ */ defineComponent({
72833
72833
  allowClear: true,
72834
72834
  showSearch: true,
72835
72835
  defaultActiveFirstOption: false,
72836
- filterOption: state.loadFinished2Options ? onFilterOption : false,
72836
+ filterOption: false,
72837
72837
  notFoundContent: void 0
72838
72838
  };
72839
72839
  return attr;
@@ -72846,54 +72846,55 @@ const _sfc_main$1G = /* @__PURE__ */ defineComponent({
72846
72846
  });
72847
72847
  }
72848
72848
  onBeforeMount(async () => {
72849
+ const id = ++optionsRequestId;
72849
72850
  const { options, finished } = await getOptionsByQuery();
72851
+ if (id !== optionsRequestId) return;
72850
72852
  state.loadFinished2Options = finished;
72851
72853
  state.initialOptions = options;
72852
72854
  state.data = options || [];
72855
+ await checkInitialValue();
72853
72856
  });
72854
- function onFilterOption(input, option2) {
72855
- if (option2.label) {
72856
- const options = option2._item;
72857
- const label = option2?.__LABEL__ || options[searchField];
72858
- const code2 = options["code_"];
72859
- const keyword2 = input.toLowerCase();
72860
- return [label, code2].some(
72861
- (v) => String(v ?? "").toLowerCase().includes(keyword2)
72862
- );
72863
- }
72864
- return false;
72865
- }
72866
72857
  const handleSearch = (keyword2) => {
72867
- if (state.loadFinished2Options) return;
72858
+ ++optionsRequestId;
72868
72859
  state.hasSearched = true;
72869
72860
  state.fetching = true;
72870
72861
  state.data = [];
72871
72862
  debounceSearch(keyword2);
72872
72863
  };
72873
72864
  const debounceSearch = debounce(async (keyword2) => {
72865
+ const id = ++optionsRequestId;
72866
+ const value = keyword2?.trim();
72874
72867
  try {
72875
- if (keyword2 && keyword2.trim()) {
72876
- const queryName = `${searchField}.like`;
72877
- const codeName = "code_.like";
72878
- const res = await getOptionsByQuery({
72868
+ const queryName = `${searchField}.like`;
72869
+ const codeName = "code_.like";
72870
+ const res = await getOptionsByQuery({
72871
+ ...value ? {
72879
72872
  exp: `OR(${queryName},${codeName})`,
72880
- queryData: { [queryName]: keyword2, [codeName]: keyword2 },
72881
- pageSize: 30
72882
- });
72883
- state.data = res.options ?? [];
72884
- }
72885
- if (!keyword2) {
72886
- await checkInitialValue();
72887
- }
72873
+ queryData: { [queryName]: value, [codeName]: value }
72874
+ } : {},
72875
+ pageSize: 30
72876
+ });
72877
+ if (id !== optionsRequestId) return;
72878
+ state.data = res.options ?? [];
72879
+ state.hasSearched = !!value;
72880
+ state.loadFinished2Options = !!res.finished;
72888
72881
  } catch (error) {
72889
72882
  console.error("请求失败:", error);
72883
+ if (id === optionsRequestId) state.data = [];
72890
72884
  } finally {
72891
- state.fetching = false;
72885
+ if (id === optionsRequestId) state.fetching = false;
72892
72886
  }
72893
72887
  }, 300);
72888
+ onBeforeUnmount(() => {
72889
+ debounceSearch.cancel();
72890
+ ++optionsRequestId;
72891
+ });
72894
72892
  async function checkInitialValue() {
72893
+ const id = optionsRequestId;
72894
+ const value = currentValue.value;
72895
72895
  if (currentValue.value && !state.initialOptions.some((o) => o.value === currentValue.value)) {
72896
72896
  const remoteOption = await getOptionByIds(currentValue.value);
72897
+ if (id !== optionsRequestId || value !== currentValue.value) return;
72897
72898
  state.data = [...remoteOption, ...state.initialOptions];
72898
72899
  } else {
72899
72900
  state.data = state.initialOptions;
@@ -72927,7 +72928,7 @@ const _sfc_main$1G = /* @__PURE__ */ defineComponent({
72927
72928
  };
72928
72929
  }
72929
72930
  });
72930
- const TraceSelect = /* @__PURE__ */ _export_sfc(_sfc_main$1G, [["__scopeId", "data-v-9cd98049"]]);
72931
+ const TraceSelect = /* @__PURE__ */ _export_sfc(_sfc_main$1G, [["__scopeId", "data-v-fefa9ebf"]]);
72931
72932
  const _hoisted_1$10 = { class: "trace-device__dropdown" };
72932
72933
  const _sfc_main$1F = /* @__PURE__ */ defineComponent({
72933
72934
  __name: "trace-device",
@@ -72979,7 +72980,6 @@ const _sfc_main$1F = /* @__PURE__ */ defineComponent({
72979
72980
  showRequired,
72980
72981
  showDisabled,
72981
72982
  options: initialOptions,
72982
- loadFinished2Options,
72983
72983
  newTotalCount
72984
72984
  } = useWidgetStaticAttrs(props2.widget);
72985
72985
  const { displayFields, autofillRules, enableAutofill } = props2.widget.props;
@@ -73021,7 +73021,7 @@ const _sfc_main$1F = /* @__PURE__ */ defineComponent({
73021
73021
  allowClear: true,
73022
73022
  defaultActiveFirstOption: false,
73023
73023
  showSearch: false,
73024
- // filterOption: loadFinished2Options ? onFilterOption : false,
73024
+ filterOption: false,
73025
73025
  notFoundContent: void 0
73026
73026
  };
73027
73027
  return attr;
@@ -73246,9 +73246,8 @@ const _sfc_main$1F = /* @__PURE__ */ defineComponent({
73246
73246
  selectedDisposed = true;
73247
73247
  selectedRequestId++;
73248
73248
  });
73249
- const handleSearch = (keyword2) => {
73250
- if (loadFinished2Options) return;
73251
- debounceSearch(keyword2);
73249
+ const handleSearch = () => {
73250
+ debounceSearch();
73252
73251
  };
73253
73252
  async function getOptionByIds(ids) {
73254
73253
  const { data = [] } = await api.apaas.modelComprehensive.postQueryRefDataByIdsModelCategory(
@@ -73397,7 +73396,54 @@ const _sfc_main$1F = /* @__PURE__ */ defineComponent({
73397
73396
  };
73398
73397
  }
73399
73398
  });
73400
- const TraceDevice = /* @__PURE__ */ _export_sfc(_sfc_main$1F, [["__scopeId", "data-v-8b3e2bc3"]]);
73399
+ const TraceDevice = /* @__PURE__ */ _export_sfc(_sfc_main$1F, [["__scopeId", "data-v-104db85d"]]);
73400
+ function useReferenceLabel(rowSource, field, dataField = field) {
73401
+ const { formStateStore } = useRuntimeInstanceServices();
73402
+ const labelKey = `${field}_lb_`;
73403
+ let disposed = false;
73404
+ onScopeDispose(() => {
73405
+ disposed = true;
73406
+ });
73407
+ watch(
73408
+ [() => formStateStore.value, rowSource],
73409
+ ([store, row], _previous, onCleanup) => {
73410
+ if (!store || store.getObjectPath(row) === void 0) return;
73411
+ let previousValue = row[dataField];
73412
+ let previousLabel = row[labelKey];
73413
+ const labelPath = store.getFieldPath(row, labelKey);
73414
+ onCleanup(
73415
+ store.subscribe(({ paths }) => {
73416
+ const value = row[dataField];
73417
+ const label = row[labelKey];
73418
+ const stale = value !== previousValue && label === previousLabel;
73419
+ previousValue = value;
73420
+ previousLabel = label;
73421
+ const labelProvided = paths.some(
73422
+ (path) => path === labelPath || labelPath.startsWith(`${path}.`)
73423
+ );
73424
+ if (stale && label != null && !labelProvided) {
73425
+ store.setObjectField(row, labelKey, null, "restore");
73426
+ }
73427
+ })
73428
+ );
73429
+ },
73430
+ { immediate: true, flush: "sync" }
73431
+ );
73432
+ function syncSelectedLabel(option2, source) {
73433
+ const store = formStateStore.value;
73434
+ const row = rowSource();
73435
+ if (disposed || !option2 || option2.value == null || option2.value === "" || !store || store.getObjectPath(row) === void 0 || row[dataField] !== option2.value)
73436
+ return;
73437
+ const current = row[labelKey];
73438
+ if (source === "restore") {
73439
+ if (option2.label == null || option2.label === "") return;
73440
+ if (current != null && current !== "" && current !== "[]") return;
73441
+ }
73442
+ const label = option2.label == null ? null : JSON.stringify([option2.label]);
73443
+ if (current !== label) store.setObjectField(row, labelKey, label, source);
73444
+ }
73445
+ return { syncSelectedLabel };
73446
+ }
73401
73447
  const _hoisted_1$$ = { class: "search-wrapper" };
73402
73448
  const _hoisted_2$J = {
73403
73449
  key: 1,
@@ -73424,9 +73470,11 @@ const _sfc_main$1E = /* @__PURE__ */ defineComponent({
73424
73470
  };
73425
73471
  const props2 = __props;
73426
73472
  const { setRowField } = useRuntimeRowState(() => props2.formData);
73473
+ const { formStateStore } = useRuntimeInstanceServices();
73427
73474
  const emit2 = __emit;
73428
73475
  const {
73429
73476
  field,
73477
+ targetFieldId,
73430
73478
  modelKey,
73431
73479
  refModelKey,
73432
73480
  placeholder,
@@ -73440,6 +73488,9 @@ const _sfc_main$1E = /* @__PURE__ */ defineComponent({
73440
73488
  customLoaderRef
73441
73489
  } = useWidgetStaticAttrs(props2.widget);
73442
73490
  const runtimeProps = resolveRuntimeQuickSearchProps(props2.widget.props);
73491
+ const dataField = targetFieldId || field;
73492
+ const labelKey = `${field}_lb_`;
73493
+ const { syncSelectedLabel } = useReferenceLabel(() => props2.formData, field, dataField);
73443
73494
  const searchField = searchFieldMap[fieldType] || "name_";
73444
73495
  const searchVisible = computed(() => {
73445
73496
  const { quickSearchField } = runtimeProps;
@@ -73463,16 +73514,22 @@ const _sfc_main$1E = /* @__PURE__ */ defineComponent({
73463
73514
  });
73464
73515
  const state = reactive({
73465
73516
  hasSearched: false,
73466
- data: initialOptions,
73517
+ data: initialOptions ?? [],
73467
73518
  fetching: false
73468
73519
  });
73469
- const currentValue = computed({
73470
- get() {
73471
- return props2.value;
73472
- },
73473
- set(val) {
73474
- emit2("update:value", val ? val : null);
73475
- }
73520
+ const currentValue = computed(() => props2.value);
73521
+ let optionsRequestId = 0;
73522
+ let lookupSeq = 0;
73523
+ let selectionSeq = 0;
73524
+ let disposed = false;
73525
+ let selectedOption;
73526
+ let selectedOptionRow;
73527
+ onScopeDispose(() => {
73528
+ disposed = true;
73529
+ optionsRequestId++;
73530
+ lookupSeq++;
73531
+ selectionSeq++;
73532
+ debounceSearch.cancel();
73476
73533
  });
73477
73534
  const selectProps = computed(() => {
73478
73535
  let attr = {
@@ -73480,7 +73537,7 @@ const _sfc_main$1E = /* @__PURE__ */ defineComponent({
73480
73537
  allowClear: true,
73481
73538
  showSearch: searchVisible.value,
73482
73539
  defaultActiveFirstOption: false,
73483
- filterOption: loadFinished2Options && !customLoaderRef.value ? onFilterOption : false,
73540
+ filterOption: false,
73484
73541
  notFoundContent: void 0
73485
73542
  };
73486
73543
  return attr;
@@ -73497,39 +73554,9 @@ const _sfc_main$1E = /* @__PURE__ */ defineComponent({
73497
73554
  handleSyncVirtualListWidth,
73498
73555
  handleShowCustomTooltip
73499
73556
  } = useCommonSelect({ searchable: searchVisible.value });
73500
- function onFilterOption(input, option2) {
73501
- if (option2.label) {
73502
- const options = option2._item;
73503
- const label = option2?.__LABEL__ || options[searchField];
73504
- const code2 = options["code_"];
73505
- const keyword2 = input.toLowerCase();
73506
- return [label, code2].some(
73507
- (v) => String(v ?? "").toLowerCase().includes(keyword2)
73508
- );
73509
- }
73510
- return false;
73511
- }
73512
73557
  watch(
73513
- () => currentValue.value,
73514
- async () => {
73515
- if (!loadFinished2Options || customLoaderRef.value) {
73516
- await checkInitialValue();
73517
- }
73518
- if (!isNil(currentValue.value)) {
73519
- const newLb = JSON.stringify(
73520
- renderUtils.getSelectOptions({
73521
- value: currentValue.value,
73522
- multiple: false,
73523
- options: state.data,
73524
- key: "label"
73525
- }).labels
73526
- );
73527
- const oldLb = props2.formData[`${field}_lb_`];
73528
- if (oldLb !== newLb) {
73529
- setRowField(`${field}_lb_`, newLb, "restore");
73530
- }
73531
- }
73532
- },
73558
+ [() => props2.value, () => props2.formData, () => customLoaderRef.value],
73559
+ () => checkInitialValue(),
73533
73560
  {
73534
73561
  immediate: true
73535
73562
  }
@@ -73554,9 +73581,11 @@ const _sfc_main$1E = /* @__PURE__ */ defineComponent({
73554
73581
  queryData
73555
73582
  };
73556
73583
  };
73557
- let optionsRequestId = 0;
73558
73584
  async function loadOptions({ pageSize: pageSize2, keyword: keyword2 }) {
73559
73585
  const id = ++optionsRequestId;
73586
+ const row = props2.formData;
73587
+ const store = formStateStore.value;
73588
+ const loader = customLoaderRef.value;
73560
73589
  state.fetching = true;
73561
73590
  try {
73562
73591
  const { exp, queryData } = buildQueryParams({ keyword: keyword2 });
@@ -73565,68 +73594,96 @@ const _sfc_main$1E = /* @__PURE__ */ defineComponent({
73565
73594
  fieldKey: field,
73566
73595
  refModelKey,
73567
73596
  isRdo: false,
73568
- customLoader: customLoaderRef.value,
73597
+ customLoader: loader,
73569
73598
  exp,
73570
73599
  queryData,
73571
73600
  pageSize: pageSize2
73572
73601
  });
73573
- if (id !== optionsRequestId) return [];
73602
+ if (disposed || id !== optionsRequestId || props2.formData !== row || formStateStore.value !== store || customLoaderRef.value !== loader)
73603
+ return;
73574
73604
  state.data = res.options ?? [];
73575
73605
  return res.options ?? [];
73576
73606
  } catch (error) {
73577
73607
  console.error("请求失败:", error);
73578
- if (id === optionsRequestId) state.data = [];
73579
- return [];
73608
+ if (!disposed && id === optionsRequestId) {
73609
+ state.data = [];
73610
+ return [];
73611
+ }
73580
73612
  } finally {
73581
- if (id === optionsRequestId) state.fetching = false;
73582
- if (!keyword2) state.hasSearched = false;
73583
- handleSyncVirtualListWidth();
73613
+ if (!disposed && id === optionsRequestId) {
73614
+ state.fetching = false;
73615
+ if (!keyword2?.trim()) state.hasSearched = false;
73616
+ handleSyncVirtualListWidth();
73617
+ }
73584
73618
  }
73585
73619
  }
73586
73620
  watch(
73587
73621
  () => newQueryDataRef.value,
73588
73622
  async () => {
73589
73623
  if (!newQueryDataRef.value || !customLoaderRef.value) return;
73590
- autoQueryOptions.value = await loadOptions({ pageSize: 999 });
73624
+ const options = await loadOptions({ pageSize: 999 });
73625
+ if (options) autoQueryOptions.value = options;
73591
73626
  },
73592
73627
  {
73593
73628
  immediate: true
73594
73629
  }
73595
73630
  );
73596
73631
  const handleSearch = (keyword2) => {
73597
- if (loadFinished2Options && !customLoaderRef.value) return;
73632
+ if (disposed) return;
73633
+ optionsRequestId++;
73598
73634
  state.hasSearched = true;
73599
73635
  state.fetching = true;
73600
73636
  state.data = [];
73601
73637
  debounceSearch(keyword2);
73602
73638
  };
73603
73639
  const debounceSearch = debounce(async (keyword2) => {
73640
+ await loadOptions({ pageSize: 30, keyword: keyword2?.trim() || void 0 });
73641
+ }, 300);
73642
+ watch(dropdownVisible, (visible) => {
73643
+ debounceSearch.cancel();
73644
+ ++optionsRequestId;
73645
+ if (disposed || !visible) {
73646
+ state.fetching = false;
73647
+ return;
73648
+ }
73649
+ state.data = [];
73650
+ state.hasSearched = false;
73651
+ void loadOptions({ pageSize: 30 });
73652
+ });
73653
+ async function checkInitialValue() {
73654
+ const seq = ++lookupSeq;
73655
+ const requestId = ++optionsRequestId;
73656
+ const value = props2.value;
73657
+ const row = props2.formData;
73658
+ const store = formStateStore.value;
73659
+ const loader = customLoaderRef.value;
73604
73660
  try {
73605
- if (keyword2 && keyword2.trim()) {
73606
- await loadOptions({ pageSize: 30, keyword: keyword2 });
73661
+ let option2 = !value ? void 0 : selectedOptionRow === row && selectedOption?.value === value ? selectedOption : [..._initialOptions.value, ...state.data].find((item) => item.value === value);
73662
+ if (value && !option2) {
73663
+ option2 = (await getOptionByIds([value], loader)).find((item) => item.value === value);
73607
73664
  }
73608
- if (!keyword2) {
73609
- await checkInitialValue();
73665
+ await nextTick();
73666
+ if (disposed || seq !== lookupSeq || props2.value !== value || props2.formData !== row || formStateStore.value !== store || customLoaderRef.value !== loader || row[dataField] !== value)
73667
+ return;
73668
+ if (option2) {
73669
+ selectedOption = option2;
73670
+ selectedOptionRow = row;
73671
+ syncSelectedLabel(option2, "restore");
73672
+ }
73673
+ if (requestId === optionsRequestId) {
73674
+ state.data = option2 ? [option2, ..._initialOptions.value.filter((item) => item.value !== value)] : _initialOptions.value;
73675
+ state.hasSearched = false;
73676
+ handleSyncVirtualListWidth();
73610
73677
  }
73611
73678
  } catch (error) {
73612
- console.error("请求失败:", error);
73679
+ console.error("[TraceSelect] Failed to load selected option:", error);
73613
73680
  } finally {
73614
- state.fetching = false;
73681
+ if (!disposed && requestId === optionsRequestId) state.fetching = false;
73615
73682
  }
73616
- }, 300);
73617
- async function checkInitialValue() {
73618
- if (currentValue.value && !_initialOptions.value.some((o) => o.value === currentValue.value)) {
73619
- const remoteOption = await getOptionByIds([currentValue.value]);
73620
- state.data = [...remoteOption, ..._initialOptions.value];
73621
- } else {
73622
- state.data = _initialOptions.value;
73623
- }
73624
- state.hasSearched = false;
73625
- handleSyncVirtualListWidth();
73626
73683
  }
73627
- async function getOptionByIds(ids) {
73628
- if (customLoaderRef.value) {
73629
- const res = await customLoaderRef.value({
73684
+ async function getOptionByIds(ids, loader = customLoaderRef.value) {
73685
+ if (loader) {
73686
+ const res = await loader({
73630
73687
  mode: "byIds",
73631
73688
  modelKey,
73632
73689
  fieldKey: field,
@@ -73658,16 +73715,53 @@ const _sfc_main$1E = /* @__PURE__ */ defineComponent({
73658
73715
  }) ?? [];
73659
73716
  }
73660
73717
  async function handleChange(v, info) {
73718
+ if (disposed) return false;
73719
+ const value = v == null || v === "" ? null : v;
73720
+ const matchesValue = (actual) => value == null ? actual == null || actual === "" : actual === value;
73721
+ const option2 = info?.value === value ? info : state.data.find((item) => item.value === value);
73722
+ const row = props2.formData;
73723
+ const store = formStateStore.value;
73724
+ if (!store || option2?.disabled) return false;
73725
+ let seq = 0;
73726
+ let accepted = false;
73727
+ store.transaction("user", () => {
73728
+ emit2("update:value", value);
73729
+ accepted = formStateStore.value === store && props2.formData === row && matchesValue(row[dataField]);
73730
+ if (!accepted) return;
73731
+ seq = ++selectionSeq;
73732
+ lookupSeq++;
73733
+ optionsRequestId++;
73734
+ debounceSearch.cancel();
73735
+ state.fetching = false;
73736
+ selectedOptionRow = row;
73737
+ selectedOption = option2;
73738
+ if (value == null) {
73739
+ if (row[labelKey] != null) setRowField(labelKey, null, "user");
73740
+ } else {
73741
+ syncSelectedLabel(option2 ?? { value }, "user");
73742
+ if (option2 && !state.data.some((item) => item.value === value)) {
73743
+ state.data = [option2, ...state.data];
73744
+ }
73745
+ }
73746
+ });
73747
+ if (!accepted) return false;
73748
+ await nextTick();
73749
+ if (disposed || seq !== selectionSeq || formStateStore.value !== store || props2.formData !== row || !matchesValue(props2.value) || !matchesValue(row[dataField]))
73750
+ return false;
73661
73751
  if (autofillRules && autofillRules.length !== 0) {
73662
- await nextTick();
73663
- applyAutofillRules(autofillRules, info?._item, props2.formData, { enabled: enableAutofill });
73752
+ applyAutofillRules(autofillRules, option2?._item, row, { enabled: !!enableAutofill });
73664
73753
  }
73665
- emit2("change", v, info);
73754
+ emit2("change", value, option2);
73666
73755
  handleCloseDropdown();
73756
+ return true;
73667
73757
  }
73668
73758
  const { handleSearchScan } = useRuleProps({
73669
73759
  props: props2,
73670
73760
  selectByCode: async (code2, signal) => {
73761
+ const seq = selectionSeq;
73762
+ const row = props2.formData;
73763
+ const store = formStateStore.value;
73764
+ const value = row[dataField];
73671
73765
  const res = await renderUtils.requestRefOptions({
73672
73766
  modelKey,
73673
73767
  fieldKey: field,
@@ -73682,20 +73776,20 @@ const _sfc_main$1E = /* @__PURE__ */ defineComponent({
73682
73776
  },
73683
73777
  pageSize: 30
73684
73778
  });
73685
- if (signal.aborted) return false;
73779
+ if (signal.aborted || disposed || seq !== selectionSeq || props2.formData !== row || formStateStore.value !== store || row[dataField] !== value)
73780
+ return false;
73686
73781
  if (!res.options?.[0]) {
73687
73782
  message.error($t2("sys.onlineForm.noCorrespondingDataFound"));
73688
73783
  return false;
73689
73784
  }
73690
73785
  const info = res.options[0];
73691
- currentValue.value = info.value;
73692
- await handleChange(info.value, info);
73693
- return true;
73786
+ return handleChange(info.value, info);
73694
73787
  }
73695
73788
  });
73696
73789
  onMounted(async () => {
73697
73790
  if (customLoaderRef.value) {
73698
- autoQueryOptions.value = await loadOptions({ pageSize: 999 });
73791
+ const options = await loadOptions({ pageSize: 999 });
73792
+ if (options) autoQueryOptions.value = options;
73699
73793
  }
73700
73794
  });
73701
73795
  __expose({
@@ -73727,9 +73821,7 @@ const _sfc_main$1E = /* @__PURE__ */ defineComponent({
73727
73821
  },
73728
73822
  select: async (option2) => {
73729
73823
  if (option2.disabled) return;
73730
- state.data = [option2];
73731
- currentValue.value = option2.value;
73732
- await handleChange(option2.value, option2);
73824
+ return handleChange(option2.value, option2);
73733
73825
  },
73734
73826
  scan: handleSearchScan,
73735
73827
  active: () => dropdownVisible.value && !showDisabled.value
@@ -73742,7 +73834,6 @@ const _sfc_main$1E = /* @__PURE__ */ defineComponent({
73742
73834
  class: ["cell-trace-select", unref(showRequired) && "is-show-required", __props.realFieldId],
73743
73835
  dropdownClassName: "gct-common-select-dropdown vxe-table--ignore-clear",
73744
73836
  value: currentValue.value,
73745
- "onUpdate:value": _cache[3] || (_cache[3] = ($event) => currentValue.value = $event),
73746
73837
  options: unref(hideOptionsTitle)(state.data),
73747
73838
  disabled: unref(showDisabled),
73748
73839
  open: unref(dropdownVisible)
@@ -73777,7 +73868,7 @@ const _sfc_main$1E = /* @__PURE__ */ defineComponent({
73777
73868
  placeholder: unref($t2)("sys.search"),
73778
73869
  onChange: _cache[1] || (_cache[1] = (e) => handleSearch(e.target.value))
73779
73870
  }, {
73780
- prefix: withCtx(() => [..._cache[4] || (_cache[4] = [
73871
+ prefix: withCtx(() => [..._cache[3] || (_cache[3] = [
73781
73872
  createElementVNode("i", { class: "icon iconfont icon-sousuo1" }, null, -1)
73782
73873
  ])]),
73783
73874
  _: 1
@@ -73834,15 +73925,19 @@ const _sfc_main$1D = /* @__PURE__ */ defineComponent({
73834
73925
  setup(__props, { expose: __expose, emit: __emit }) {
73835
73926
  const props2 = __props;
73836
73927
  const emit2 = __emit;
73928
+ const { setRowField } = useRuntimeRowState(() => props2.formData);
73929
+ const { formStateStore } = useRuntimeInstanceServices();
73837
73930
  const {
73838
73931
  field,
73932
+ targetFieldId,
73839
73933
  modelKey,
73840
73934
  refModelKey,
73841
73935
  placeholder,
73842
73936
  showRequired,
73843
73937
  showDisabled,
73844
73938
  options,
73845
- newQueryDataRef
73939
+ newQueryDataRef,
73940
+ customLoaderRef
73846
73941
  } = useWidgetStaticAttrs(props2.widget);
73847
73942
  const { applyAutofillRules } = useAutofill();
73848
73943
  const open = ref(false);
@@ -73856,30 +73951,64 @@ const _sfc_main$1D = /* @__PURE__ */ defineComponent({
73856
73951
  popoverOverlayStyle,
73857
73952
  calculateWrapperHeight
73858
73953
  } = useWrapperHeight(selectRef);
73954
+ const dataField = targetFieldId || field;
73955
+ const labelKey = `${field}_lb_`;
73956
+ const { syncSelectedLabel } = useReferenceLabel(() => props2.formData, field, dataField);
73957
+ const selectedOptionRow = shallowRef();
73859
73958
  const selectedOption = ref();
73860
73959
  const selectedOptions = computed(() => {
73861
- const selected = selectedOption.value?.value === props2.value ? selectedOption.value : options?.find((item) => item.value === props2.value);
73960
+ const selected = selectedOptionRow.value === props2.formData && selectedOption.value?.value === props2.value ? selectedOption.value : options?.find((item) => item.value === props2.value);
73862
73961
  return selected ? [{ value: selected.value, label: selected.label }] : [];
73863
73962
  });
73864
73963
  let lookupSeq = 0;
73964
+ let selectionSeq = 0;
73965
+ let disposed = false;
73966
+ onScopeDispose(() => {
73967
+ disposed = true;
73968
+ lookupSeq++;
73969
+ selectionSeq++;
73970
+ });
73865
73971
  watch(
73866
- () => props2.value,
73867
- async (value) => {
73972
+ [() => selectedOptions.value[0], () => props2.formData, () => props2.formData[labelKey]],
73973
+ ([option2]) => syncSelectedLabel(option2, "restore"),
73974
+ { immediate: true }
73975
+ );
73976
+ watch(
73977
+ [() => props2.value, () => props2.formData],
73978
+ async ([value, row]) => {
73868
73979
  const seq = ++lookupSeq;
73980
+ const store = formStateStore.value;
73869
73981
  if (!value || selectedOptions.value.length) return;
73870
73982
  try {
73871
- const res = await api.apaas.modelComprehensive.postQueryRefDataByIdsModelCategory(
73872
- { modelCategory: EntityModelCategoryEnum.ENTITY },
73873
- { fieldKey: field, modelKey, refModelKey, ids: [value], includeDeleted: true }
73874
- );
73875
- if (seq !== lookupSeq) return;
73876
- const record = res?.data?.[0];
73877
- if (record) {
73878
- selectedOption.value = {
73879
- value: record.id_ || record.id,
73880
- label: record.__LABEL__,
73881
- _item: record
73882
- };
73983
+ let option2;
73984
+ const loader = customLoaderRef.value;
73985
+ if (loader) {
73986
+ const res = await loader({
73987
+ mode: "byIds",
73988
+ modelKey,
73989
+ fieldKey: field,
73990
+ refModelKey,
73991
+ ids: [value],
73992
+ isRdo: false,
73993
+ queryData: newQueryDataRef.value
73994
+ });
73995
+ option2 = normalizeRefLoaderResult(res, { isRdo: false }).options.find(
73996
+ (item) => item.value === value
73997
+ );
73998
+ } else {
73999
+ const res = await api.apaas.modelComprehensive.postQueryRefDataByIdsModelCategory(
74000
+ { modelCategory: EntityModelCategoryEnum.ENTITY },
74001
+ { fieldKey: field, modelKey, refModelKey, ids: [value], includeDeleted: true }
74002
+ );
74003
+ const record = res?.data?.find((item) => (item.id_ || item.id) === value);
74004
+ if (record) option2 = { value, label: record.__LABEL__, _item: record };
74005
+ }
74006
+ await nextTick();
74007
+ if (disposed || seq !== lookupSeq || props2.value !== value || props2.formData !== row || formStateStore.value !== store || customLoaderRef.value !== loader || row[dataField] !== value)
74008
+ return;
74009
+ if (option2) {
74010
+ selectedOptionRow.value = row;
74011
+ selectedOption.value = option2;
73883
74012
  }
73884
74013
  } catch (error) {
73885
74014
  console.error("[TraceRefTableSelect] Failed to load selected option:", error);
@@ -73893,21 +74022,51 @@ const _sfc_main$1D = /* @__PURE__ */ defineComponent({
73893
74022
  }
73894
74023
  async function onSelect(row) {
73895
74024
  const option2 = row?._option;
73896
- if (!option2) return;
73897
- selectedOption.value = option2;
73898
- emit2("update:value", option2.value);
74025
+ if (!option2 || option2.value == null || option2.value === "" || disposed) return;
74026
+ let seq = 0;
74027
+ const targetRow = props2.formData;
74028
+ const store = formStateStore.value;
74029
+ if (!store) return;
74030
+ let accepted = false;
74031
+ store.transaction("user", () => {
74032
+ emit2("update:value", option2.value);
74033
+ accepted = formStateStore.value === store && props2.formData === targetRow && targetRow[dataField] === option2.value;
74034
+ if (!accepted) return;
74035
+ seq = ++selectionSeq;
74036
+ lookupSeq++;
74037
+ selectedOptionRow.value = targetRow;
74038
+ selectedOption.value = option2;
74039
+ syncSelectedLabel(option2, "user");
74040
+ });
74041
+ if (!accepted) return;
74042
+ await nextTick();
74043
+ if (disposed || seq !== selectionSeq || formStateStore.value !== store || props2.formData !== targetRow || props2.value !== option2.value || targetRow[dataField] !== option2.value)
74044
+ return;
73899
74045
  if (props2.widget.props.autofillRules?.length) {
73900
- await nextTick();
73901
74046
  applyAutofillRules(props2.widget.props.autofillRules, option2._item, props2.formData, {
73902
- enabled: props2.widget.props.enableAutofill
74047
+ enabled: !!props2.widget.props.enableAutofill
73903
74048
  });
73904
74049
  }
73905
74050
  emit2("change", option2.value, option2);
73906
74051
  open.value = false;
73907
74052
  }
73908
74053
  function onClear() {
73909
- selectedOption.value = void 0;
73910
- emit2("update:value", null);
74054
+ if (disposed) return;
74055
+ const targetRow = props2.formData;
74056
+ const store = formStateStore.value;
74057
+ if (!store) return;
74058
+ let accepted = false;
74059
+ store.transaction("user", () => {
74060
+ emit2("update:value", null);
74061
+ accepted = formStateStore.value === store && props2.formData === targetRow && (targetRow[dataField] == null || targetRow[dataField] === "");
74062
+ if (!accepted) return;
74063
+ selectionSeq++;
74064
+ lookupSeq++;
74065
+ selectedOptionRow.value = void 0;
74066
+ selectedOption.value = void 0;
74067
+ if (targetRow[labelKey] != null) setRowField(labelKey, null, "user");
74068
+ });
74069
+ if (!accepted) return;
73911
74070
  emit2("change", null);
73912
74071
  open.value = false;
73913
74072
  }
@@ -91248,8 +91407,8 @@ const _sfc_main$j = /* @__PURE__ */ defineComponent({
91248
91407
  printTask = (async () => {
91249
91408
  if (document.activeElement instanceof HTMLElement) document.activeElement.blur();
91250
91409
  await nextTick();
91251
- const { printRuntimeInstance } = await import("./print-runtime-instance-DMKmR64C.js");
91252
- const { default: renderer } = await import("./print-snapshot-renderer-Dqh4wq32.js");
91410
+ const { printRuntimeInstance } = await import("./print-runtime-instance-D-zZ-Pnj.js");
91411
+ const { default: renderer } = await import("./print-snapshot-renderer-CAu5xiAs.js");
91253
91412
  if (abort.signal.aborted) throw new Error("打印已取消");
91254
91413
  printRenderer.value = markRaw(renderer);
91255
91414
  await printRuntimeInstance(