@gct-paas/word 0.1.52-beta.8 → 0.1.53

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 (25) hide show
  1. package/dist/core/data/DataManager.d.ts +2 -0
  2. package/dist/core/layout/handlers/FieldHandler.d.ts +1 -1
  3. package/dist/core/layout/handlers/fields/FieldBaseHandler.d.ts +7 -0
  4. package/dist/domain/field/field-binding.d.ts +4 -0
  5. package/dist/domain/table/business/check/check-table/index.d.ts +1 -0
  6. package/dist/domain/table/business/check/check-table/runtime/check-table-label-enricher.d.ts +4 -0
  7. package/dist/domain/table/business/check/check-table/runtime/check-table-value-fields.d.ts +3 -0
  8. package/dist/domain/table/business/check/check-table/runtime/index.d.ts +2 -0
  9. package/dist/domain/table/business/check/check-table/runtime/register-handlers.d.ts +1 -0
  10. package/dist/domain/table/business/warehouse/warehouse-allocate/profile/field-keys.d.ts +2 -1
  11. package/dist/domain/table/business/warehouse/warehouse-allocate/runtime/before-btn-click.d.ts +5 -0
  12. package/dist/domain/table/business/warehouse/warehouse-inventory/runtime/stocktake-calc.d.ts +2 -0
  13. package/dist/index.es.js +1453 -1209
  14. package/dist/runtime/_register_/runtime/SuiteRuntime.d.ts +2 -0
  15. package/dist/runtime/canvas/table/render/material-consume/material-consume-table-controller.d.ts +6 -4
  16. package/dist/runtime/canvas/table/render/material-consume/sync-material-info.d.ts +2 -0
  17. package/dist/sdk/doc-runtime/composables/useDocOperations.d.ts +5 -0
  18. package/dist/sdk/doc-runtime/factories/document-initializer.d.ts +2 -0
  19. package/dist/sdk/types/field-model-query.d.ts +3 -0
  20. package/dist/sdk/types/index.d.ts +5 -0
  21. package/dist/suites/edhr/check-table/check-table-dyn-value.d.ts +17 -1
  22. package/dist/types/main.type.d.ts +43 -0
  23. package/dist/utils/TriggerUtil.d.ts +1 -1
  24. package/dist/word.css +69 -69
  25. package/package.json +1 -1
package/dist/index.es.js CHANGED
@@ -355,116 +355,85 @@ function setupGlobDirectives(app) {
355
355
  }
356
356
  const apiConfig$2 = [
357
357
  {
358
- name: "medPro",
359
- entityName: "medPro",
358
+ name: "ai",
359
+ entityName: "ai",
360
360
  apis: [
361
361
  {
362
362
  mode: "post",
363
- method: "postModelMetaDataAssociation",
364
- path: "modelMeta/dataAssociation",
363
+ method: "postFormConvertBatchAddFormTmpl",
364
+ path: "form-convert/batch-add-form-tmpl",
365
365
  hasData: true
366
366
  },
367
- {
368
- mode: "get",
369
- method: "getModelMetaGetSysConfig",
370
- path: "modelMeta/getSysConfig",
371
- hasQuery: true
372
- },
373
- {
374
- mode: "get",
375
- method: "getModelMetaHasDataAssociation",
376
- path: "modelMeta/hasDataAssociation",
377
- hasQuery: true
378
- },
379
- {
380
- mode: "get",
381
- method: "getModelMetaModelDataAssociation",
382
- path: "modelMeta/modelDataAssociation",
383
- hasQuery: true
384
- },
385
367
  {
386
368
  mode: "post",
387
- method: "postApproveProcessApprove",
388
- path: "approve/process/approve",
369
+ method: "postFormConvertBatchFailReasons",
370
+ path: "form-convert/batch/fail-reasons",
389
371
  hasData: true
390
372
  },
391
373
  {
392
374
  mode: "post",
393
- method: "postApproveProcessInterfereReassign",
394
- path: "approve/process/interfere/reassign",
375
+ method: "postFormConvertBatchList",
376
+ path: "form-convert/batch/list",
395
377
  hasData: true
396
378
  },
397
379
  {
398
380
  mode: "post",
399
- method: "postApproveProcessInterfereReturn",
400
- path: "approve/process/interfere/return",
381
+ method: "postFormConvertBatchUpload",
382
+ path: "form-convert/batch/upload",
401
383
  hasData: true
402
384
  },
403
385
  {
404
- mode: "post",
405
- method: "postApproveProcessJump",
406
- path: "approve/process/jump",
407
- hasData: true
386
+ mode: "get",
387
+ method: "getFormConvertBatchId",
388
+ path: "form-convert/batch/{id}",
389
+ hasPathParams: true
408
390
  },
409
391
  {
410
- mode: "post",
411
- method: "postApproveProcessReassign",
412
- path: "approve/process/reassign",
413
- hasData: true
392
+ mode: "delete",
393
+ method: "deleteFormConvertBatchId",
394
+ path: "form-convert/batch/{id}",
395
+ hasPathParams: true
414
396
  },
415
397
  {
416
398
  mode: "post",
417
- method: "postApproveProcessReturn",
418
- path: "approve/process/return",
399
+ method: "postFormConvertFailReasons",
400
+ path: "form-convert/fail-reasons",
419
401
  hasData: true
420
402
  },
421
- {
422
- mode: "get",
423
- method: "getEdhrAttachmentGetEdhrAttachment",
424
- path: "edhrAttachment/getEdhrAttachment",
425
- hasQuery: true
426
- },
427
- {
428
- mode: "post",
429
- method: "postFileUnzip",
430
- path: "file/unzip",
431
- hasQuery: true
432
- },
433
403
  {
434
404
  mode: "post",
435
- method: "postFormChangeProcessApprove",
436
- path: "form/change/process/approve",
405
+ method: "postFormConvertList",
406
+ path: "form-convert/list",
437
407
  hasData: true
438
408
  },
439
409
  {
440
410
  mode: "post",
441
- method: "postFormChangeProcessInterfereReassign",
442
- path: "form/change/process/interfere/reassign",
443
- hasData: true
411
+ method: "postFormConvertRefresh",
412
+ path: "form-convert/refresh"
444
413
  },
445
414
  {
446
415
  mode: "post",
447
- method: "postFormChangeProcessInterfereReturn",
448
- path: "form/change/process/interfere/return",
416
+ method: "postFormConvertSave",
417
+ path: "form-convert/save",
449
418
  hasData: true
450
419
  },
451
420
  {
452
- mode: "post",
453
- method: "postFormChangeProcessJump",
454
- path: "form/change/process/jump",
421
+ mode: "put",
422
+ method: "putFormConvertUpdate",
423
+ path: "form-convert/update",
455
424
  hasData: true
456
425
  },
457
426
  {
458
- mode: "post",
459
- method: "postFormChangeProcessReassign",
460
- path: "form/change/process/reassign",
461
- hasData: true
427
+ mode: "get",
428
+ method: "getFormConvertId",
429
+ path: "form-convert/{id}",
430
+ hasPathParams: true
462
431
  },
463
432
  {
464
- mode: "post",
465
- method: "postFormChangeProcessReturn",
466
- path: "form/change/process/return",
467
- hasData: true
433
+ mode: "delete",
434
+ method: "deleteFormConvertId",
435
+ path: "form-convert/{id}",
436
+ hasPathParams: true
468
437
  }
469
438
  ]
470
439
  },
@@ -563,6 +532,12 @@ const apiConfig$2 = [
563
532
  path: "batch",
564
533
  hasData: true
565
534
  },
535
+ {
536
+ mode: "get",
537
+ method: "getCheckUserNeedTransfer",
538
+ path: "checkUserNeedTransfer",
539
+ hasQuery: true
540
+ },
566
541
  {
567
542
  mode: "get",
568
543
  method: "getGrantedStatistic",
@@ -4801,36 +4776,6 @@ const apiConfig$2 = [
4801
4776
  path: "appendix/form/list",
4802
4777
  hasQuery: true
4803
4778
  },
4804
- {
4805
- mode: "post",
4806
- method: "postDataCollectionAbandon",
4807
- path: "data-collection/abandon",
4808
- hasData: true
4809
- },
4810
- {
4811
- mode: "post",
4812
- method: "postDataCollectionCreate",
4813
- path: "data-collection/create",
4814
- hasData: true
4815
- },
4816
- {
4817
- mode: "get",
4818
- method: "getDataCollectionListAll",
4819
- path: "data-collection/listAll",
4820
- hasQuery: true
4821
- },
4822
- {
4823
- mode: "post",
4824
- method: "postDataCollectionUpdateAlias",
4825
- path: "data-collection/update-alias",
4826
- hasData: true
4827
- },
4828
- {
4829
- mode: "post",
4830
- method: "postDataCollectionUpdateStatus",
4831
- path: "data-collection/update-status",
4832
- hasData: true
4833
- },
4834
4779
  {
4835
4780
  mode: "get",
4836
4781
  method: "getDataIds",
@@ -7690,36 +7635,157 @@ const apiConfig$2 = [
7690
7635
  ]
7691
7636
  },
7692
7637
  {
7693
- name: "ss",
7694
- entityName: "ss",
7638
+ name: "stash",
7639
+ entityName: "stash",
7695
7640
  apis: [
7696
7641
  {
7697
7642
  mode: "post",
7698
- method: "postUploadExcel",
7699
- path: "upload/excel",
7700
- hasUpload: true,
7701
- hasQuery: true,
7643
+ method: "post",
7644
+ path: "",
7702
7645
  hasData: true
7703
7646
  },
7647
+ {
7648
+ mode: "delete",
7649
+ method: "delete",
7650
+ path: "",
7651
+ hasQuery: true
7652
+ },
7653
+ {
7654
+ mode: "get",
7655
+ method: "getFindByClientKey",
7656
+ path: "findByClientKey",
7657
+ hasQuery: true
7658
+ },
7659
+ {
7660
+ mode: "get",
7661
+ method: "getInfo",
7662
+ path: "info",
7663
+ hasQuery: true
7664
+ },
7665
+ {
7666
+ mode: "put",
7667
+ method: "putId",
7668
+ path: "{id}",
7669
+ hasPathParams: true,
7670
+ hasData: true
7671
+ }
7672
+ ]
7673
+ },
7674
+ {
7675
+ name: "subModelProcess",
7676
+ entityName: "sub-model-process",
7677
+ apis: [
7704
7678
  {
7705
7679
  mode: "post",
7706
- method: "postUploadImportSerialWorkflow",
7707
- path: "upload/importSerialWorkflow",
7708
- hasUpload: true,
7680
+ method: "postAllSubModelDataClean",
7681
+ path: "allSubModelDataClean"
7682
+ }
7683
+ ]
7684
+ },
7685
+ {
7686
+ name: "sysConfig",
7687
+ entityName: "sys-config",
7688
+ apis: [
7689
+ {
7690
+ mode: "post",
7691
+ method: "post",
7692
+ path: "",
7709
7693
  hasData: true
7710
7694
  },
7695
+ {
7696
+ mode: "delete",
7697
+ method: "delete",
7698
+ path: "",
7699
+ hasQuery: true
7700
+ },
7701
+ {
7702
+ mode: "get",
7703
+ method: "getInfo",
7704
+ path: "info",
7705
+ hasQuery: true
7706
+ },
7707
+ {
7708
+ mode: "get",
7709
+ method: "getList",
7710
+ path: "list"
7711
+ },
7712
+ {
7713
+ mode: "get",
7714
+ method: "getPageList",
7715
+ path: "page/list",
7716
+ hasQuery: true
7717
+ },
7718
+ {
7719
+ mode: "put",
7720
+ method: "putId",
7721
+ path: "{id}",
7722
+ hasPathParams: true,
7723
+ hasData: true
7724
+ }
7725
+ ]
7726
+ },
7727
+ {
7728
+ name: "systemVar",
7729
+ entityName: "system-var",
7730
+ apis: [
7711
7731
  {
7712
7732
  mode: "post",
7713
- method: "postUploadZip",
7714
- path: "upload/zip",
7715
- hasUpload: true,
7733
+ method: "post",
7734
+ path: "",
7735
+ hasData: true
7736
+ },
7737
+ {
7738
+ mode: "delete",
7739
+ method: "delete",
7740
+ path: "",
7741
+ hasQuery: true
7742
+ },
7743
+ {
7744
+ mode: "get",
7745
+ method: "getGetSystemVarByKeys",
7746
+ path: "getSystemVarByKeys",
7747
+ hasQuery: true
7748
+ },
7749
+ {
7750
+ mode: "get",
7751
+ method: "getGetVarByKeys",
7752
+ path: "getVarByKeys",
7753
+ hasQuery: true
7754
+ },
7755
+ {
7756
+ mode: "get",
7757
+ method: "getInfo",
7758
+ path: "info",
7759
+ hasQuery: true
7760
+ },
7761
+ {
7762
+ mode: "get",
7763
+ method: "getList",
7764
+ path: "list"
7765
+ },
7766
+ {
7767
+ mode: "get",
7768
+ method: "getListSystemVarCache",
7769
+ path: "listSystemVarCache"
7770
+ },
7771
+ {
7772
+ mode: "get",
7773
+ method: "getPageList",
7774
+ path: "page/list",
7775
+ hasQuery: true
7776
+ },
7777
+ {
7778
+ mode: "put",
7779
+ method: "putId",
7780
+ path: "{id}",
7781
+ hasPathParams: true,
7716
7782
  hasData: true
7717
7783
  }
7718
7784
  ]
7719
7785
  },
7720
7786
  {
7721
- name: "stash",
7722
- entityName: "stash",
7787
+ name: "traceLog",
7788
+ entityName: "trace-log",
7723
7789
  apis: [
7724
7790
  {
7725
7791
  mode: "post",
@@ -7735,8 +7801,8 @@ const apiConfig$2 = [
7735
7801
  },
7736
7802
  {
7737
7803
  mode: "get",
7738
- method: "getFindByClientKey",
7739
- path: "findByClientKey",
7804
+ method: "getFindByTraceId",
7805
+ path: "findByTraceId",
7740
7806
  hasQuery: true
7741
7807
  },
7742
7808
  {
@@ -7745,6 +7811,17 @@ const apiConfig$2 = [
7745
7811
  path: "info",
7746
7812
  hasQuery: true
7747
7813
  },
7814
+ {
7815
+ mode: "get",
7816
+ method: "getList",
7817
+ path: "list"
7818
+ },
7819
+ {
7820
+ mode: "get",
7821
+ method: "getPageList",
7822
+ path: "page/list",
7823
+ hasQuery: true
7824
+ },
7748
7825
  {
7749
7826
  mode: "put",
7750
7827
  method: "putId",
@@ -7755,239 +7832,79 @@ const apiConfig$2 = [
7755
7832
  ]
7756
7833
  },
7757
7834
  {
7758
- name: "subModelProcess",
7759
- entityName: "sub-model-process",
7835
+ name: "traceLogDetails",
7836
+ entityName: "trace-log-details",
7760
7837
  apis: [
7761
7838
  {
7762
7839
  mode: "post",
7763
- method: "postAllSubModelDataClean",
7764
- path: "allSubModelDataClean"
7840
+ method: "post",
7841
+ path: "",
7842
+ hasData: true
7843
+ },
7844
+ {
7845
+ mode: "delete",
7846
+ method: "delete",
7847
+ path: "",
7848
+ hasQuery: true
7849
+ },
7850
+ {
7851
+ mode: "post",
7852
+ method: "postAppDataTracePageList",
7853
+ path: "app-data-trace/page/list",
7854
+ hasData: true
7855
+ },
7856
+ {
7857
+ mode: "get",
7858
+ method: "getInfo",
7859
+ path: "info",
7860
+ hasQuery: true
7861
+ },
7862
+ {
7863
+ mode: "get",
7864
+ method: "getInfoTree",
7865
+ path: "infoTree",
7866
+ hasQuery: true
7867
+ },
7868
+ {
7869
+ mode: "get",
7870
+ method: "getInfoTreeById",
7871
+ path: "infoTreeById",
7872
+ hasQuery: true
7873
+ },
7874
+ {
7875
+ mode: "get",
7876
+ method: "getList",
7877
+ path: "list"
7878
+ },
7879
+ {
7880
+ mode: "get",
7881
+ method: "getOperators",
7882
+ path: "operators"
7883
+ },
7884
+ {
7885
+ mode: "get",
7886
+ method: "getPageList",
7887
+ path: "page/list",
7888
+ hasQuery: true
7889
+ },
7890
+ {
7891
+ mode: "get",
7892
+ method: "getPageListByRecodeId",
7893
+ path: "page/listByRecodeId",
7894
+ hasQuery: true
7895
+ },
7896
+ {
7897
+ mode: "put",
7898
+ method: "putId",
7899
+ path: "{id}",
7900
+ hasPathParams: true,
7901
+ hasData: true
7765
7902
  }
7766
7903
  ]
7767
7904
  },
7768
7905
  {
7769
- name: "sysConfig",
7770
- entityName: "sys-config",
7771
- apis: [
7772
- {
7773
- mode: "post",
7774
- method: "post",
7775
- path: "",
7776
- hasData: true
7777
- },
7778
- {
7779
- mode: "delete",
7780
- method: "delete",
7781
- path: "",
7782
- hasQuery: true
7783
- },
7784
- {
7785
- mode: "get",
7786
- method: "getInfo",
7787
- path: "info",
7788
- hasQuery: true
7789
- },
7790
- {
7791
- mode: "get",
7792
- method: "getList",
7793
- path: "list"
7794
- },
7795
- {
7796
- mode: "get",
7797
- method: "getPageList",
7798
- path: "page/list",
7799
- hasQuery: true
7800
- },
7801
- {
7802
- mode: "put",
7803
- method: "putId",
7804
- path: "{id}",
7805
- hasPathParams: true,
7806
- hasData: true
7807
- }
7808
- ]
7809
- },
7810
- {
7811
- name: "systemVar",
7812
- entityName: "system-var",
7813
- apis: [
7814
- {
7815
- mode: "post",
7816
- method: "post",
7817
- path: "",
7818
- hasData: true
7819
- },
7820
- {
7821
- mode: "delete",
7822
- method: "delete",
7823
- path: "",
7824
- hasQuery: true
7825
- },
7826
- {
7827
- mode: "get",
7828
- method: "getGetSystemVarByKeys",
7829
- path: "getSystemVarByKeys",
7830
- hasQuery: true
7831
- },
7832
- {
7833
- mode: "get",
7834
- method: "getGetVarByKeys",
7835
- path: "getVarByKeys",
7836
- hasQuery: true
7837
- },
7838
- {
7839
- mode: "get",
7840
- method: "getInfo",
7841
- path: "info",
7842
- hasQuery: true
7843
- },
7844
- {
7845
- mode: "get",
7846
- method: "getList",
7847
- path: "list"
7848
- },
7849
- {
7850
- mode: "get",
7851
- method: "getListSystemVarCache",
7852
- path: "listSystemVarCache"
7853
- },
7854
- {
7855
- mode: "get",
7856
- method: "getPageList",
7857
- path: "page/list",
7858
- hasQuery: true
7859
- },
7860
- {
7861
- mode: "put",
7862
- method: "putId",
7863
- path: "{id}",
7864
- hasPathParams: true,
7865
- hasData: true
7866
- }
7867
- ]
7868
- },
7869
- {
7870
- name: "traceLog",
7871
- entityName: "trace-log",
7872
- apis: [
7873
- {
7874
- mode: "post",
7875
- method: "post",
7876
- path: "",
7877
- hasData: true
7878
- },
7879
- {
7880
- mode: "delete",
7881
- method: "delete",
7882
- path: "",
7883
- hasQuery: true
7884
- },
7885
- {
7886
- mode: "get",
7887
- method: "getFindByTraceId",
7888
- path: "findByTraceId",
7889
- hasQuery: true
7890
- },
7891
- {
7892
- mode: "get",
7893
- method: "getInfo",
7894
- path: "info",
7895
- hasQuery: true
7896
- },
7897
- {
7898
- mode: "get",
7899
- method: "getList",
7900
- path: "list"
7901
- },
7902
- {
7903
- mode: "get",
7904
- method: "getPageList",
7905
- path: "page/list",
7906
- hasQuery: true
7907
- },
7908
- {
7909
- mode: "put",
7910
- method: "putId",
7911
- path: "{id}",
7912
- hasPathParams: true,
7913
- hasData: true
7914
- }
7915
- ]
7916
- },
7917
- {
7918
- name: "traceLogDetails",
7919
- entityName: "trace-log-details",
7920
- apis: [
7921
- {
7922
- mode: "post",
7923
- method: "post",
7924
- path: "",
7925
- hasData: true
7926
- },
7927
- {
7928
- mode: "delete",
7929
- method: "delete",
7930
- path: "",
7931
- hasQuery: true
7932
- },
7933
- {
7934
- mode: "post",
7935
- method: "postAppDataTracePageList",
7936
- path: "app-data-trace/page/list",
7937
- hasData: true
7938
- },
7939
- {
7940
- mode: "get",
7941
- method: "getInfo",
7942
- path: "info",
7943
- hasQuery: true
7944
- },
7945
- {
7946
- mode: "get",
7947
- method: "getInfoTree",
7948
- path: "infoTree",
7949
- hasQuery: true
7950
- },
7951
- {
7952
- mode: "get",
7953
- method: "getInfoTreeById",
7954
- path: "infoTreeById",
7955
- hasQuery: true
7956
- },
7957
- {
7958
- mode: "get",
7959
- method: "getList",
7960
- path: "list"
7961
- },
7962
- {
7963
- mode: "get",
7964
- method: "getOperators",
7965
- path: "operators"
7966
- },
7967
- {
7968
- mode: "get",
7969
- method: "getPageList",
7970
- path: "page/list",
7971
- hasQuery: true
7972
- },
7973
- {
7974
- mode: "get",
7975
- method: "getPageListByRecodeId",
7976
- path: "page/listByRecodeId",
7977
- hasQuery: true
7978
- },
7979
- {
7980
- mode: "put",
7981
- method: "putId",
7982
- path: "{id}",
7983
- hasPathParams: true,
7984
- hasData: true
7985
- }
7986
- ]
7987
- },
7988
- {
7989
- name: "traceMainline",
7990
- entityName: "trace-mainline",
7906
+ name: "traceMainline",
7907
+ entityName: "trace-mainline",
7991
7908
  apis: [
7992
7909
  {
7993
7910
  mode: "post",
@@ -8397,6 +8314,18 @@ const apiConfig$2 = [
8397
8314
  name: "api",
8398
8315
  entityName: "api",
8399
8316
  apis: [
8317
+ {
8318
+ mode: "post",
8319
+ method: "postAiFormConvertCallbackRestore",
8320
+ path: "ai/form-convert/callback/restore",
8321
+ hasData: true
8322
+ },
8323
+ {
8324
+ mode: "post",
8325
+ method: "postAiFormConvertCallbackStatus",
8326
+ path: "ai/form-convert/callback/status",
8327
+ hasData: true
8328
+ },
8400
8329
  {
8401
8330
  mode: "post",
8402
8331
  method: "postAppCreateBranch",
@@ -25994,7 +25923,7 @@ const _sfc_main$3i = /* @__PURE__ */ defineComponent({
25994
25923
  };
25995
25924
  }
25996
25925
  });
25997
- const GctSelect = /* @__PURE__ */ _export_sfc(_sfc_main$3i, [["__scopeId", "data-v-6ecd8ef9"]]);
25926
+ const GctSelect = /* @__PURE__ */ _export_sfc(_sfc_main$3i, [["__scopeId", "data-v-4756c59a"]]);
25998
25927
  const _hoisted_1$24 = ["value", "placeholder", "disabled"];
25999
25928
  const _hoisted_2$1h = {
26000
25929
  key: 1,
@@ -33231,7 +33160,7 @@ function toFormatValue(fieldType, value) {
33231
33160
  if ([FIELD_TYPE.INTEGER, FIELD_TYPE.LONG].includes(fieldType)) {
33232
33161
  const _val_ = parseInt(value);
33233
33162
  return isNaN(_val_) ? null : _val_;
33234
- } else if (fieldType === FIELD_TYPE.DECIMAL) {
33163
+ } else if ([FIELD_TYPE.DOUBLE, FIELD_TYPE.DECIMAL].includes(fieldType)) {
33235
33164
  const _val_ = parseFloat(value);
33236
33165
  return isNaN(_val_) ? null : _val_;
33237
33166
  } else if (fieldType === FIELD_TYPE.BOOLEAN) {
@@ -33445,6 +33374,23 @@ function formatNumberHook(props, type4, value) {
33445
33374
  const formats = buildNumberFormats(props, type4);
33446
33375
  return formatNumber(formats, value);
33447
33376
  }
33377
+ const CHECK_TABLE_TYPE_TO_VALUE_FIELD = {
33378
+ boolean: "bool_value_",
33379
+ string: "text_value_",
33380
+ integer: "int_value_",
33381
+ decimal: "double_value_",
33382
+ user: "user_value_",
33383
+ user_multi: "user_multi_value_",
33384
+ org: "org_value_",
33385
+ date: "date_value_",
33386
+ date_time: "date_time_value_",
33387
+ image: "image_value_",
33388
+ attachment: "attachment_value_"
33389
+ };
33390
+ const CHECK_TABLE_LABEL_SYNC_TYPES = /* @__PURE__ */ new Set(["boolean", "user", "user_multi", "org"]);
33391
+ function shouldSyncCheckTableLabel(type_) {
33392
+ return CHECK_TABLE_LABEL_SYNC_TYPES.has(type_);
33393
+ }
33448
33394
  function transformSourceData(sourceData, i18nData) {
33449
33395
  const clone2 = cloneDeep(sourceData);
33450
33396
  const _DICT = i18nData ? Object.keys(clone2).reduce((acc, key) => {
@@ -33545,27 +33491,9 @@ function resolveSubmitCrossKeys(formData, subTableInfoList) {
33545
33491
  }
33546
33492
  const handleSyncCheckValue = (row) => {
33547
33493
  const { type_, value_ } = row;
33548
- if (type_ === "boolean") {
33549
- row.bool_value_ = value_;
33550
- } else if (type_ === "string") {
33551
- row.text_value_ = value_;
33552
- } else if (type_ === "integer") {
33553
- row.int_value_ = value_;
33554
- } else if (type_ === "decimal") {
33555
- row.double_value_ = value_;
33556
- } else if (type_ === "user") {
33557
- row.user_value_ = value_;
33558
- } else if (type_ === "org") {
33559
- row.org_value_ = value_;
33560
- } else if (type_ === "date") {
33561
- row.date_value_ = value_;
33562
- } else if (type_ === "date_time") {
33563
- row.date_time_value_ = value_;
33564
- } else if (type_ === "image") {
33565
- row.image_value_ = value_;
33566
- } else if (type_ === "attachment") {
33567
- row.attachment_value_ = value_;
33568
- }
33494
+ const valueFieldKey = CHECK_TABLE_TYPE_TO_VALUE_FIELD[type_];
33495
+ if (!valueFieldKey) return;
33496
+ row[valueFieldKey] = value_;
33569
33497
  };
33570
33498
  function getSubmitFormData(formData, subTableInfoList) {
33571
33499
  const _formData = { ...formData };
@@ -34591,6 +34519,20 @@ function resolveStocktakeQty(value, options = {}) {
34591
34519
  }
34592
34520
  return Math.max(MIN_STOCKTAKE_NUM, num);
34593
34521
  }
34522
+ function getScanQtyDeductionBlockReason(current, scanQty, type4 = "add") {
34523
+ if (type4 !== "minus" || isBlank(scanQty)) {
34524
+ return void 0;
34525
+ }
34526
+ const qtyNum = Number(scanQty);
34527
+ if (Number.isNaN(qtyNum) || qtyNum <= 0) {
34528
+ return void 0;
34529
+ }
34530
+ const base = isBlank(current) ? 0 : toNumber(current);
34531
+ if (base - qtyNum >= MIN_STOCKTAKE_NUM) {
34532
+ return void 0;
34533
+ }
34534
+ return "当前实盘数量小于本次条码扫码数量,无法扣减";
34535
+ }
34594
34536
  function applyScanQtyToStocktake(current, scanQty, type4 = "add") {
34595
34537
  if (isBlank(scanQty)) {
34596
34538
  return current;
@@ -34601,7 +34543,7 @@ function applyScanQtyToStocktake(current, scanQty, type4 = "add") {
34601
34543
  }
34602
34544
  const base = isBlank(current) ? 0 : toNumber(current);
34603
34545
  const next = base + (type4 === "minus" ? -qtyNum : qtyNum);
34604
- return Math.max(MIN_STOCKTAKE_NUM, next);
34546
+ return next;
34605
34547
  }
34606
34548
  function accumulateScanQtyOnRow(visibleRows, rowIndex, scanQty, type4 = "add") {
34607
34549
  const nextRows = [...visibleRows];
@@ -35219,7 +35161,14 @@ function getParseRuleValue(labelStr, labelRule) {
35219
35161
  if (val !== null) {
35220
35162
  switch (field.type) {
35221
35163
  case Config_Fields.qty:
35222
- val = Number(val);
35164
+ if (isBlank(val)) {
35165
+ val = null;
35166
+ } else {
35167
+ val = Number(val);
35168
+ if (Number.isNaN(val)) {
35169
+ val = null;
35170
+ }
35171
+ }
35223
35172
  break;
35224
35173
  case Config_Fields.expiration:
35225
35174
  val = dayjs(val, field.format).format("YYYY-MM-DD HH:mm:ss");
@@ -82862,10 +82811,19 @@ const fieldNameMap = {
82862
82811
  product_check_qty: "产品检验数量",
82863
82812
  material_check_qty: "材料检验数量",
82864
82813
  external_reference_no: "外部参考号",
82814
+ order_no: "订单号",
82815
+ related_lot_no: "关联批次",
82865
82816
  warehouse_receipt_no: "单据编号",
82866
82817
  warehouse_receipt_date: "单据日期",
82867
82818
  warehouse_manager: "仓管员",
82868
82819
  warehouse: "仓库",
82820
+ location: "库位",
82821
+ production_identifier: "物料批次(生产标识)",
82822
+ object_type: "对象",
82823
+ material_consume: "物料消耗",
82824
+ qty: "数量",
82825
+ qty_consumed: "已消耗数量",
82826
+ qty_required: "需求数量",
82869
82827
  device_ref: "设备关联",
82870
82828
  device_ref_multi: "设备多选",
82871
82829
  number: "数值",
@@ -82993,12 +82951,23 @@ const getField2Operators = (fieldType) => {
82993
82951
  case FIELD_TYPE.RELATED_LOT_NO:
82994
82952
  case FIELD_TYPE.SCRAP_MATERIAL_NO:
82995
82953
  case FIELD_TYPE.EXTERNAL_REF_NO:
82954
+ case FIELD_TYPE.ORDER_NO:
82955
+ case FIELD_TYPE.WAREHOUSE_RECEIPT_NO:
82996
82956
  options = StringOperators.slice();
82997
82957
  break;
82998
82958
  case FIELD_TYPE.INTEGER:
82999
82959
  case FIELD_TYPE.LONG:
83000
82960
  case FIELD_TYPE.DOUBLE:
83001
82961
  case FIELD_TYPE.DECIMAL:
82962
+ case FIELD_TYPE.QTY:
82963
+ case FIELD_TYPE.QTY_CONSUMED:
82964
+ case FIELD_TYPE.QTY_REQUIRED:
82965
+ case FIELD_TYPE.GOOD_QTY:
82966
+ case FIELD_TYPE.NOT_GOOD_QTY:
82967
+ case FIELD_TYPE.SCRAP_QTY:
82968
+ case FIELD_TYPE.DESTRUCTIVE_TEST_QTY:
82969
+ case FIELD_TYPE.PRODUCT_CHECK_QTY:
82970
+ case FIELD_TYPE.MATERIAL_CHECK_QTY:
83002
82971
  options = NumberOperators.slice();
83003
82972
  break;
83004
82973
  case FIELD_TYPE.BOOLEAN:
@@ -83007,6 +82976,9 @@ const getField2Operators = (fieldType) => {
83007
82976
  case FIELD_TYPE.DATE:
83008
82977
  case FIELD_TYPE.TIME:
83009
82978
  case FIELD_TYPE.DATE_TIME:
82979
+ case FIELD_TYPE.TRACE_DATE:
82980
+ case FIELD_TYPE.WAREHOUSE_RECEIPT_DATE:
82981
+ case FIELD_TYPE.PRODUCTION_DATE:
83010
82982
  options = TimeOperators.slice();
83011
82983
  break;
83012
82984
  case FIELD_TYPE.OPTION:
@@ -83016,6 +82988,7 @@ const getField2Operators = (fieldType) => {
83016
82988
  case FIELD_TYPE.REF:
83017
82989
  case FIELD_TYPE.RDO_REF:
83018
82990
  case FIELD_TYPE.WAREHOUSE:
82991
+ case FIELD_TYPE.LOCATION:
83019
82992
  options = OptionOperators.slice();
83020
82993
  break;
83021
82994
  case FIELD_TYPE.OPTION_MULTI:
@@ -83146,6 +83119,8 @@ async function loadDefaultValuesByFields(instances, ctx, context, masterSlaveLis
83146
83119
  const promises = instances.map(async (instance2) => {
83147
83120
  const { field, props } = instance2.widgetMeta;
83148
83121
  if (!field || !props) return;
83122
+ const isSpecialMaterialConsumeObjField = !!field.belongingObject && [FIELD_TYPE.PRODUCT, FIELD_TYPE.MATERIAL_NO].includes(field.fieldType);
83123
+ if (isSpecialMaterialConsumeObjField) return;
83149
83124
  mergeDefaultsIntoMap(
83150
83125
  defaultDataMap,
83151
83126
  await resolveFieldDefaults({ props, field, ctx, context, instances })
@@ -83168,7 +83143,7 @@ async function loadDefaultValuesByFields(instances, ctx, context, masterSlaveLis
83168
83143
  return defaultDataMap;
83169
83144
  }
83170
83145
  const handleParameterMapping = async (parameterMapping, paramsConfig, fieldPermission, instances, ctx) => {
83171
- if (!parameterMapping.length || !paramsConfig) {
83146
+ if (isEmpty(parameterMapping) || isEmpty(paramsConfig)) {
83172
83147
  return {};
83173
83148
  }
83174
83149
  const referenceMap = new Map(Object.entries(paramsConfig));
@@ -83935,9 +83910,13 @@ function buildRowFromResolve(resolved, scanQty, assignScanQty = false, scanAdjus
83935
83910
  [F$2.rowSource]: "scan"
83936
83911
  };
83937
83912
  if (assignScanQty && scanQty != null && scanQty !== "") {
83913
+ const blockReason = getScanQtyDeductionBlockReason(void 0, scanQty, scanAdjustType);
83914
+ if (blockReason) {
83915
+ return { rowData, deductionBlockedReason: blockReason };
83916
+ }
83938
83917
  rowData[F$2.stocktake] = applyScanQtyToStocktake(void 0, scanQty, scanAdjustType);
83939
83918
  }
83940
- return rowData;
83919
+ return { rowData };
83941
83920
  }
83942
83921
  function appendUnresolvedScanRecords(options) {
83943
83922
  const {
@@ -83952,12 +83931,12 @@ function appendUnresolvedScanRecords(options) {
83952
83931
  assignScanQty,
83953
83932
  scanQtyState
83954
83933
  } = options;
83955
- if (!unprocessed.length) return { rows: visibleRows };
83934
+ if (!unprocessed.length) return { rows: visibleRows, deductionBlockedReasons: [] };
83956
83935
  const { records: recordsForNewRow, productGroupCount } = pickRecordsForNewScanRow(
83957
83936
  unprocessed,
83958
83937
  groupByWarehouse
83959
83938
  );
83960
- if (!recordsForNewRow.length) return { rows: visibleRows };
83939
+ if (!recordsForNewRow.length) return { rows: visibleRows, deductionBlockedReasons: [] };
83961
83940
  if (productGroupCount > 1) {
83962
83941
  scanLog().info("待新建含多产品组,仅取第一组建一行", {
83963
83942
  productGroupCount,
@@ -83971,7 +83950,7 @@ function appendUnresolvedScanRecords(options) {
83971
83950
  row: { [F$2.rowSource]: "scan" },
83972
83951
  config: remoteSync
83973
83952
  });
83974
- if (!resolved) return { rows: visibleRows };
83953
+ if (!resolved) return { rows: visibleRows, deductionBlockedReasons: [] };
83975
83954
  const newRowIndex = visibleRows.length;
83976
83955
  const shouldWriteQty = shouldAssignScanQty({
83977
83956
  strategy: SCAN_QTY_ASSIGN_STRATEGY,
@@ -83981,20 +83960,27 @@ function appendUnresolvedScanRecords(options) {
83981
83960
  qtyAssignedOnScan: scanQtyState.qtyAssignedOnScan,
83982
83961
  qtyAssignedRowIndexes: scanQtyState.qtyAssignedRowIndexes
83983
83962
  });
83984
- const rowData = buildRowFromResolve(resolved, scanQty, shouldWriteQty, scanAdjustType);
83985
- if (shouldWriteQty) {
83963
+ const { rowData, deductionBlockedReason } = buildRowFromResolve(
83964
+ resolved,
83965
+ scanQty,
83966
+ shouldWriteQty,
83967
+ scanAdjustType
83968
+ );
83969
+ const deductionBlockedReasons = deductionBlockedReason ? [deductionBlockedReason] : [];
83970
+ if (shouldWriteQty && !deductionBlockedReason) {
83986
83971
  markScanQtyAssigned(scanQtyState, newRowIndex);
83987
83972
  }
83988
83973
  const appended = appendScanRowFromResolve(visibleRows, rowData);
83989
83974
  return {
83990
83975
  rows: appended.rows,
83991
83976
  mergedIndex: appended.mergedIndex,
83977
+ deductionBlockedReasons,
83992
83978
  appendMeta: {
83993
83979
  unprocessedCount: unprocessed.length,
83994
83980
  productGroupCount,
83995
83981
  usedForNewRow: recordsForNewRow.length,
83996
83982
  multiLocationPending: !groupByWarehouse && recordsForNewRow.length > 1,
83997
- qtyWritten: shouldWriteQty
83983
+ qtyWritten: shouldWriteQty && !deductionBlockedReason
83998
83984
  }
83999
83985
  };
84000
83986
  }
@@ -84013,9 +83999,11 @@ function processScanRecordGroup(options) {
84013
83999
  let visibleRows = options.visibleRows;
84014
84000
  const mergedIndexes = [];
84015
84001
  const unprocessed = [];
84002
+ const deductionBlockedReasons = [];
84016
84003
  let skippedForLocation = 0;
84017
84004
  let accumulated = 0;
84018
84005
  let qtyWritten = 0;
84006
+ let deductionBlocked = 0;
84019
84007
  for (const record of groupRecords) {
84020
84008
  const disposition = dispositionScanRecord(record, visibleRows, groupByWarehouse);
84021
84009
  if (disposition.kind === "accumulate") {
@@ -84030,6 +84018,30 @@ function processScanRecordGroup(options) {
84030
84018
  };
84031
84019
  const shouldAddQty = shouldAssignScanQty(qtyCheck);
84032
84020
  const qtySkippedReason = getScanQtySkipReason(qtyCheck);
84021
+ if (shouldAddQty) {
84022
+ const blockReason = getScanQtyDeductionBlockReason(
84023
+ visibleRows[disposition.index][F$2.stocktake],
84024
+ scanQty,
84025
+ scanAdjustType
84026
+ );
84027
+ if (blockReason) {
84028
+ deductionBlocked += 1;
84029
+ deductionBlockedReasons.push(blockReason);
84030
+ scanLog().info(
84031
+ `明细#${accumulated + skippedForLocation + unprocessed.length} → 命中行#${disposition.index},扣减被拦截`,
84032
+ {
84033
+ rowIndex: disposition.index,
84034
+ batch: record[F$2.batch],
84035
+ product: record[F$2.product],
84036
+ location: record[F$2.location],
84037
+ scanQty,
84038
+ scanAdjustType,
84039
+ blockReason
84040
+ }
84041
+ );
84042
+ continue;
84043
+ }
84044
+ }
84033
84045
  scanLog().info(
84034
84046
  shouldAddQty ? `明细#${accumulated + skippedForLocation + unprocessed.length} → 命中行#${disposition.index},写入盘点数` : `明细#${accumulated + skippedForLocation + unprocessed.length} → 命中行#${disposition.index},跳过写 qty`,
84035
84047
  {
@@ -84092,6 +84104,7 @@ function processScanRecordGroup(options) {
84092
84104
  scanQtyState
84093
84105
  });
84094
84106
  visibleRows = appended.rows;
84107
+ deductionBlockedReasons.push(...appended.deductionBlockedReasons);
84095
84108
  const appendedCount = appended.mergedIndex != null ? 1 : 0;
84096
84109
  if (appended.appendMeta?.qtyWritten) {
84097
84110
  qtyWritten += 1;
@@ -84111,10 +84124,11 @@ function processScanRecordGroup(options) {
84111
84124
  qtyWritten,
84112
84125
  skipped: skippedForLocation,
84113
84126
  unprocessed: unprocessed.length,
84114
- appended: appendedCount
84127
+ appended: appendedCount,
84128
+ deductionBlocked
84115
84129
  };
84116
84130
  scanLog().info("本组处理汇总", stats);
84117
- return { rows: visibleRows, mergedIndexes, skippedForLocation, stats };
84131
+ return { rows: visibleRows, mergedIndexes, skippedForLocation, deductionBlockedReasons, stats };
84118
84132
  }
84119
84133
  async function parseAndMergeScanRow(doc, subFieldKey, scanInput, scanRules, scanRuleProps) {
84120
84134
  const ctx = TableRuntimeContext.find(doc, subFieldKey);
@@ -84166,6 +84180,7 @@ async function parseAndMergeScanRow(doc, subFieldKey, scanInput, scanRules, scan
84166
84180
  let visibleRows = getVisibleRows(doc, subFieldKey);
84167
84181
  const mergedIndexes = [];
84168
84182
  let totalSkippedForLocation = 0;
84183
+ const deductionBlockedReasons = [];
84169
84184
  const groupStats = [];
84170
84185
  for (let i = 0; i < materialGroups.length; i += 1) {
84171
84186
  const groupRecords = materialGroups[i];
@@ -84185,6 +84200,7 @@ async function parseAndMergeScanRow(doc, subFieldKey, scanInput, scanRules, scan
84185
84200
  visibleRows = result.rows;
84186
84201
  mergedIndexes.push(...result.mergedIndexes);
84187
84202
  totalSkippedForLocation += result.skippedForLocation;
84203
+ deductionBlockedReasons.push(...result.deductionBlockedReasons);
84188
84204
  groupStats.push(result.stats);
84189
84205
  }
84190
84206
  scanLog().info("扫码结束汇总", {
@@ -84204,8 +84220,14 @@ async function parseAndMergeScanRow(doc, subFieldKey, scanInput, scanRules, scan
84204
84220
  totalSkippedForLocation === 1 ? "相同物料行尚未选择库位,已忽略 1 条扫码数据" : `相同物料行尚未选择库位,已忽略 ${totalSkippedForLocation} 条扫码数据`
84205
84221
  );
84206
84222
  }
84223
+ const uniqueDeductionBlockedReasons = [...new Set(deductionBlockedReasons)];
84224
+ if (uniqueDeductionBlockedReasons.length === 1) {
84225
+ GctMessage.error(uniqueDeductionBlockedReasons[0]);
84226
+ } else if (uniqueDeductionBlockedReasons.length > 1) {
84227
+ GctMessage.error(uniqueDeductionBlockedReasons.join(";"));
84228
+ }
84207
84229
  if (!mergedIndexes.length) {
84208
- if (totalSkippedForLocation === 0) {
84230
+ if (totalSkippedForLocation === 0 && uniqueDeductionBlockedReasons.length === 0) {
84209
84231
  GctMessage.error("扫描结果解析失败");
84210
84232
  }
84211
84233
  return;
@@ -84281,16 +84303,17 @@ async function changeWarehouseInventoryParseRule(options) {
84281
84303
  }
84282
84304
  const F$1 = {
84283
84305
  batch: "production_identification_id_",
84306
+ batchLb: "production_identification_id__lb_",
84284
84307
  product: "product_id_",
84285
84308
  productName: "product_id_name_",
84286
84309
  productCode: "product_id_code_",
84287
84310
  productSpec: "product_id_spec_",
84288
- matno: "material_no_",
84289
84311
  validity: "validity_",
84290
84312
  stock: "stock_num_",
84291
84313
  warehouse: "warehouse_id_",
84292
84314
  location: "location_id_",
84293
84315
  originWarehouseId: "origin_warehouse_id_",
84316
+ originWarehouseIdLb: "origin_warehouse_id__lb_",
84294
84317
  originLocationId: "origin_location_id_",
84295
84318
  originLocationIdLb: "origin_location_id__lb_",
84296
84319
  rowSource: "row_source_"
@@ -84361,15 +84384,15 @@ const fields = [
84361
84384
  clearOnLinkChange: []
84362
84385
  }
84363
84386
  },
84364
- {
84365
- // 源仓库 与 源库位 级联
84366
- match: { fieldKey: F$1.originLocationId },
84367
- select: {
84368
- linkFieldKey: F$1.originWarehouseId,
84369
- requireLinkWidget: false,
84370
- buildLinkQuery: ({ linkValue }) => linkValue ? { "warehouse_id_.eq": linkValue } : {}
84371
- }
84372
- },
84387
+ // {
84388
+ // // 源仓库 与 源库位 级联
84389
+ // match: { fieldKey: F.originLocationId },
84390
+ // select: {
84391
+ // linkFieldKey: F.originWarehouseId,
84392
+ // requireLinkWidget: false,
84393
+ // buildLinkQuery: ({ linkValue }) => (linkValue ? { 'warehouse_id_.eq': linkValue } : {}),
84394
+ // },
84395
+ // },
84373
84396
  {
84374
84397
  // 仓库 与 库位 级联
84375
84398
  match: { fieldKey: F$1.location },
@@ -84448,7 +84471,10 @@ function handleProductIdChange(doc, subFieldKey, rowIndex) {
84448
84471
  F$1.productName,
84449
84472
  F$1.productCode,
84450
84473
  F$1.productSpec,
84451
- F$1.matno,
84474
+ F$1.batch,
84475
+ F$1.batchLb,
84476
+ F$1.originWarehouseId,
84477
+ F$1.originWarehouseIdLb,
84452
84478
  F$1.originLocationId,
84453
84479
  F$1.originLocationIdLb,
84454
84480
  F$1.stock,
@@ -84522,6 +84548,828 @@ const profile = {
84522
84548
  labelBjColor: "rgba(247,128,31,0.8)"
84523
84549
  }
84524
84550
  };
84551
+ class BaseService {
84552
+ suiteKey;
84553
+ registry;
84554
+ suiteMap;
84555
+ constructor(suiteKey, registry2) {
84556
+ this.suiteKey = suiteKey;
84557
+ this.registry = registry2;
84558
+ this.suiteMap = registry2.getSuiteMap(suiteKey);
84559
+ }
84560
+ /** 获取指定key的值 */
84561
+ get(key) {
84562
+ return this.suiteMap.get(key);
84563
+ }
84564
+ /** 检查是否存在指定key */
84565
+ has(key) {
84566
+ return this.suiteMap.has(key);
84567
+ }
84568
+ /** 获取当前套件下的所有值 */
84569
+ getAll() {
84570
+ return Array.from(this.suiteMap.values());
84571
+ }
84572
+ }
84573
+ class BaseRegistry {
84574
+ static instances = /* @__PURE__ */ new Map();
84575
+ store = /* @__PURE__ */ new Map();
84576
+ constructor() {
84577
+ }
84578
+ /**
84579
+ * 获取单例实例
84580
+ * @returns 子类实例
84581
+ */
84582
+ static getInstance() {
84583
+ const className = this.name;
84584
+ if (!BaseRegistry.instances.has(className)) {
84585
+ BaseRegistry.instances.set(className, new this());
84586
+ }
84587
+ return BaseRegistry.instances.get(className);
84588
+ }
84589
+ /**
84590
+ * 通用注册逻辑:按 suiteKey 注册一批 K-V 映射
84591
+ * @param suiteKey 套件唯一标识
84592
+ * @param items 要注册的键值对
84593
+ * @param override 是否允许覆盖(默认false,子类可自定义)
84594
+ */
84595
+ register(suiteKey, items, override = false) {
84596
+ if (!suiteKey || typeof suiteKey !== "string") {
84597
+ throw new Error(`[${this.constructor.name}] 无效的suiteKey,必须是非空字符串`);
84598
+ }
84599
+ if (!items || Object.keys(items).length === 0) {
84600
+ return;
84601
+ }
84602
+ let suiteMap = this.store.get(suiteKey);
84603
+ if (!suiteMap) {
84604
+ suiteMap = /* @__PURE__ */ new Map();
84605
+ this.store.set(suiteKey, suiteMap);
84606
+ }
84607
+ Object.entries(items).forEach(([key, value]) => {
84608
+ const typedKey = key;
84609
+ if (!override && suiteMap.has(typedKey)) {
84610
+ throw new Error(
84611
+ `[${this.constructor.name}] 键 "${String(
84612
+ typedKey
84613
+ )}" 在套件 "${suiteKey}" 下已存在,如需覆盖请设置override: true`
84614
+ );
84615
+ }
84616
+ suiteMap.set(typedKey, value);
84617
+ });
84618
+ }
84619
+ /**
84620
+ * 按 suiteKey 获取对应的内部Map
84621
+ * @param suiteKey 套件唯一标识
84622
+ * @returns 对应的Map
84623
+ */
84624
+ getSuiteMap(suiteKey) {
84625
+ return this.store.get(suiteKey) ?? /* @__PURE__ */ new Map();
84626
+ }
84627
+ /**
84628
+ * 按 suiteKey 获取所有值的数组
84629
+ * @param suiteKey 套件唯一标识
84630
+ * @returns 值数组
84631
+ */
84632
+ getSuiteValues(suiteKey) {
84633
+ return Array.from(this.getSuiteMap(suiteKey).values());
84634
+ }
84635
+ /** 清空所有存储 */
84636
+ clear() {
84637
+ this.store.clear();
84638
+ }
84639
+ }
84640
+ class FieldManifestRegistry extends BaseRegistry {
84641
+ register(suiteKey, manifests) {
84642
+ super.register(suiteKey, manifests);
84643
+ }
84644
+ }
84645
+ const fieldManifestRegistry = FieldManifestRegistry.getInstance();
84646
+ function resolveFieldManifestType(field) {
84647
+ return field.bizType ?? field.type;
84648
+ }
84649
+ function resolveFieldStorageType(field) {
84650
+ return field.type;
84651
+ }
84652
+ class FieldManifestService extends BaseService {
84653
+ constructor(suiteKey) {
84654
+ super(suiteKey, FieldManifestRegistry.getInstance());
84655
+ }
84656
+ getManifestBySuite() {
84657
+ return this.getAll();
84658
+ }
84659
+ getManifestByType(fieldType) {
84660
+ return this.get(fieldType);
84661
+ }
84662
+ getManifestForField(field) {
84663
+ return this.getManifestByType(resolveFieldManifestType(field));
84664
+ }
84665
+ }
84666
+ function isLinkSubTableType(type4) {
84667
+ if (!type4) return false;
84668
+ return type4 === "2d-table" || type4 === "check-table";
84669
+ }
84670
+ function isLinkSubTableSubScopeZone(cellZone) {
84671
+ if (!cellZone) return false;
84672
+ return cellZone === "cross" || cellZone === "horizontal";
84673
+ }
84674
+ function getLinkSubTableCrossRange(region) {
84675
+ const { itemRegion } = region;
84676
+ if (!itemRegion) return void 0;
84677
+ return {
84678
+ start: {
84679
+ row: Math.max(region.start.row, itemRegion.start.row),
84680
+ col: Math.max(region.start.col, itemRegion.start.col)
84681
+ },
84682
+ end: {
84683
+ row: Math.min(region.end.row, itemRegion.end.row),
84684
+ col: Math.min(region.end.col, itemRegion.end.col)
84685
+ }
84686
+ };
84687
+ }
84688
+ function getDataGroup2DFillEndCol(region, cellDataIndexMap) {
84689
+ const { itemRegion } = region;
84690
+ if (!itemRegion) return region.end.col;
84691
+ let maxCol = itemRegion.end.col;
84692
+ cellDataIndexMap.forEach((meta, key) => {
84693
+ const [rowStr, colStr] = key.split(",");
84694
+ const row = Number(rowStr);
84695
+ const col = Number(colStr);
84696
+ if (row >= itemRegion.start.row && row <= itemRegion.end.row && meta.dataIndex !== void 0) {
84697
+ maxCol = Math.max(maxCol, col);
84698
+ }
84699
+ });
84700
+ return maxCol;
84701
+ }
84702
+ function resolveLinkSubTableCellZone(row, col, region, options = {}) {
84703
+ const { itemRegion } = region;
84704
+ if (!itemRegion) {
84705
+ return region.contains(row, col) ? "horizontal" : void 0;
84706
+ }
84707
+ const cross = getLinkSubTableCrossRange(region);
84708
+ const fillEndCol = options.fillEndCol ?? itemRegion.end.col;
84709
+ const inCrossRows = row >= cross.start.row && row <= cross.end.row;
84710
+ const inItemRows = row >= itemRegion.start.row && row <= itemRegion.end.row;
84711
+ if (inCrossRows && col >= itemRegion.start.col && col <= fillEndCol) {
84712
+ return "cross";
84713
+ }
84714
+ if (!inCrossRows && inItemRows && col >= itemRegion.start.col && col <= fillEndCol) {
84715
+ return "vertical";
84716
+ }
84717
+ if (region.contains(row, col)) {
84718
+ if (col < itemRegion.start.col) {
84719
+ return "horizontal";
84720
+ }
84721
+ if (inCrossRows && col > fillEndCol) {
84722
+ return "horizontal";
84723
+ }
84724
+ }
84725
+ return void 0;
84726
+ }
84727
+ function resolveLinkSubTableValuePath(region, cellZone) {
84728
+ switch (cellZone) {
84729
+ case "cross":
84730
+ return region.valuePath;
84731
+ case "vertical":
84732
+ return region.linkValuePath;
84733
+ case "horizontal":
84734
+ return region.subValuePath;
84735
+ }
84736
+ }
84737
+ function isInLinkSubTableLayoutScope(row, col, region, options = {}) {
84738
+ return resolveLinkSubTableCellZone(row, col, region, options) !== void 0;
84739
+ }
84740
+ const initComponentDependency = {
84741
+ sortDependency: [],
84742
+ configDependency: {
84743
+ [FieldDependencyTypeConst.Hidden]: {},
84744
+ [FieldDependencyTypeConst.Readonly]: {},
84745
+ [FieldDependencyTypeConst.Disabled]: {},
84746
+ [FieldDependencyTypeConst.Required]: {},
84747
+ [FieldDependencyTypeConst.Assignment]: {}
84748
+ }
84749
+ };
84750
+ const commonDefaultRenderers = {
84751
+ placeholder: "render:gct-placeholder",
84752
+ control: "render:gct-control",
84753
+ space: "render:gct-space",
84754
+ leftMarker: "render:gct-leftMarker",
84755
+ rightMarker: "render:gct-rightMarker",
84756
+ text: "render:gct-text"
84757
+ };
84758
+ const commonDefaultProps = {
84759
+ viewState: ViewStateTypeConst.Readonly,
84760
+ emptySymbol: null,
84761
+ required: true,
84762
+ disabled: false,
84763
+ defaultValue: null,
84764
+ placeholder: null,
84765
+ componentDependency: cloneDeep(initComponentDependency),
84766
+ computedOptions: null,
84767
+ // word 画布渲染使用
84768
+ cannotInput: false,
84769
+ newSpecificConfig: {}
84770
+ };
84771
+ const dateFieldDefaultProps = {
84772
+ enableCustomFormat: false,
84773
+ formatSeparator: "-",
84774
+ formatTemplate: "YYYY${sep}MM${sep}DD",
84775
+ customFormat: void 0,
84776
+ defaultSysDate: false,
84777
+ enableRangeValidate: false,
84778
+ maxValidateMode: RangeValidateModeTypeConst.No_Validate,
84779
+ minValidateMode: RangeValidateModeTypeConst.No_Validate,
84780
+ minValue: void 0,
84781
+ maxValue: void 0,
84782
+ minFormulaExpr: void 0,
84783
+ maxFormulaExpr: void 0
84784
+ };
84785
+ const numberFieldDefaultProps = {
84786
+ displayMode: DecimalDisplayModeTypeConst.ORIGIN,
84787
+ enableRangeValidate: false,
84788
+ maxValidateMode: RangeValidateModeTypeConst.No_Validate,
84789
+ minValidateMode: RangeValidateModeTypeConst.No_Validate,
84790
+ minValue: void 0,
84791
+ maxValue: void 0,
84792
+ minFormulaExpr: void 0,
84793
+ maxFormulaExpr: void 0
84794
+ };
84795
+ const signFieldDefaultProps = {
84796
+ signatureNumber: SignatureNumberTypeConst.SIGNATURE_MULTIPLE,
84797
+ signatureType: SignatureTypeConst.SIGNATURE_ONLY,
84798
+ signTimeType: SignatureTimeTypeConst.FOLLOW_SIGNATURE,
84799
+ signDisplayStyle: SignDisplayTypeConst.VERTICAL,
84800
+ populateFields: []
84801
+ };
84802
+ const fileFieldDefaultProps = {
84803
+ imageDisplayMode: ImageDisplayModeConst.CUSTOM,
84804
+ maxCount: void 0,
84805
+ maxSize: void 0,
84806
+ showFileName: void 0,
84807
+ acceptTypes: []
84808
+ };
84809
+ const styleDefaultProps = {
84810
+ renderComp: RenderCompTypeConst.Select,
84811
+ iconLabelSpace: 8,
84812
+ labelPosition: LabelPositionTypeConst.After,
84813
+ direction: OrientationTypeConst.Landscape,
84814
+ /** 控件大小 */
84815
+ controlSize: 24,
84816
+ /** 枚举项的间距 */
84817
+ controlEnumSpace: 16
84818
+ };
84819
+ const styleSizeDefaultProps = {
84820
+ /** 组件默认宽度 */
84821
+ width: 120,
84822
+ /** 组件默认高度 */
84823
+ height: 68
84824
+ };
84825
+ const labelPriorityConfig = {
84826
+ type: "priority",
84827
+ fields: ["defaultValue"]
84828
+ };
84829
+ const labelResolveDateConfig = {
84830
+ type: "resolve",
84831
+ valueType: "date",
84832
+ valueField: "defaultSysDate"
84833
+ };
84834
+ const labelResolveUserConfig = {
84835
+ type: "resolve",
84836
+ valueType: "user",
84837
+ valueField: "defaultValue",
84838
+ isRenderSideRequest: true,
84839
+ fetcher: "user"
84840
+ };
84841
+ const labelResolveOrgConfig = {
84842
+ type: "resolve",
84843
+ valueType: "org",
84844
+ valueField: "defaultValue",
84845
+ isRenderSideRequest: true,
84846
+ fetcher: "dept"
84847
+ };
84848
+ const labelResolveEnumConfig = {
84849
+ type: "resolve",
84850
+ valueType: "enum",
84851
+ from: "optionsJson",
84852
+ valueField: "defaultSelected"
84853
+ };
84854
+ const optionsMapEnumConfig = {
84855
+ type: "map",
84856
+ filter: "enum",
84857
+ from: "optionsJson"
84858
+ };
84859
+ const labelOnValueChangeRule = { type: "label" };
84860
+ const hyperlinkOnValueChangeRule = { type: "hyperlink" };
84861
+ const hyperlinkAndLabelOnValueChangeRules = [
84862
+ hyperlinkOnValueChangeRule,
84863
+ labelOnValueChangeRule
84864
+ ];
84865
+ function mergeCheckTableItemInfosIntoDefaults(defaultsMap, region, infos, layoutColumnCount) {
84866
+ applySubFieldDefaults(defaultsMap, region, infos, layoutColumnCount ?? 0);
84867
+ }
84868
+ const CHECK_TABLE_ROW_CONFIG_FIELDS = [
84869
+ "type_",
84870
+ "show_type_",
84871
+ "required_",
84872
+ "tip_text_",
84873
+ "options_",
84874
+ "pattern_",
84875
+ "max_int_",
84876
+ "min_int_",
84877
+ "min_decimal_",
84878
+ "max_decimal_",
84879
+ "validate_range_",
84880
+ "digits_",
84881
+ "regex_",
84882
+ "true_text_",
84883
+ "false_text_",
84884
+ "default_value_",
84885
+ "name_",
84886
+ "description_",
84887
+ "inspection_standard_",
84888
+ "__gw_y_uid"
84889
+ ];
84890
+ function expandRowToDefaultPaths(defaultsMap, subFieldKey, index2, item) {
84891
+ const rowPath = `$.${subFieldKey}[${index2}]`;
84892
+ for (const [key, value] of Object.entries(item)) {
84893
+ if (value === void 0) continue;
84894
+ defaultsMap[`${rowPath}.${key}`] = value;
84895
+ }
84896
+ }
84897
+ function readCheckTableRowConfigFromDefaults(getDefault, rowMetaPath) {
84898
+ const row = {};
84899
+ let hasField = false;
84900
+ for (const key of CHECK_TABLE_ROW_CONFIG_FIELDS) {
84901
+ const value = getDefault(`${rowMetaPath}.${key}`);
84902
+ if (value !== void 0) {
84903
+ row[key] = value;
84904
+ hasField = true;
84905
+ }
84906
+ }
84907
+ if (hasField) return row;
84908
+ const whole = getDefault(rowMetaPath);
84909
+ if (whole != null && typeof whole === "object" && !Array.isArray(whole)) {
84910
+ return { ...whole };
84911
+ }
84912
+ return {};
84913
+ }
84914
+ function applySubFieldDefaults(defaultsMap, region, payload, layoutColumnCount = 0) {
84915
+ if (!payload?.data?.length || !region.subFieldKey) return;
84916
+ const subFieldKey = region.subFieldKey;
84917
+ const xCount = region.linkFieldKey ? Math.max(layoutColumnCount, 0) : 0;
84918
+ payload.data.forEach((row, index2) => {
84919
+ const item = { ...row };
84920
+ if (!item.__gw_y_uid) {
84921
+ item.__gw_y_uid = `${subFieldKey}_y_${index2}`;
84922
+ }
84923
+ expandRowToDefaultPaths(defaultsMap, subFieldKey, index2, item);
84924
+ const defaultValue = item.default_value_;
84925
+ if (defaultValue == null || defaultValue === "" || !region.linkFieldKey || xCount === 0) {
84926
+ return;
84927
+ }
84928
+ for (let x2 = 0; x2 < xCount; x2++) {
84929
+ const crossPath = `$.${subFieldKey}:${region.linkFieldKey}[${index2}][${x2}].value_`;
84930
+ if (defaultsMap[crossPath] == null) {
84931
+ defaultsMap[crossPath] = defaultValue;
84932
+ }
84933
+ }
84934
+ });
84935
+ }
84936
+ const basicAttrs = {
84937
+ required: [
84938
+ {
84939
+ from: "required_",
84940
+ to: "required",
84941
+ transform: (value) => Boolean(value)
84942
+ }
84943
+ // {
84944
+ // from: '_',
84945
+ // to: 'newSpecificConfig.newFieldName',
84946
+ // transform: () => '值',
84947
+ // },
84948
+ ],
84949
+ placeholder: [{ from: "tip_text_", to: "placeholder" }],
84950
+ showType: [
84951
+ {
84952
+ from: "show_type_",
84953
+ to: "renderComp",
84954
+ transform: (value) => {
84955
+ if (value === "select") return RenderCompTypeConst.Select;
84956
+ if (value === "radio") return RenderCompTypeConst.Radio;
84957
+ if (value === "checkbox") return RenderCompTypeConst.Checkbox;
84958
+ return RenderCompTypeConst.Select;
84959
+ }
84960
+ }
84961
+ ],
84962
+ options: [
84963
+ { from: "options_", to: "optionsJson", transform: (v) => v == null ? null : String(v) }
84964
+ ],
84965
+ pattern: [
84966
+ {
84967
+ from: "_",
84968
+ to: "enableCustomFormat",
84969
+ transform: (_v, _t2, row) => !isEmpty(row.pattern_)
84970
+ },
84971
+ { from: "pattern_", to: "customFormat" },
84972
+ {
84973
+ from: "_",
84974
+ to: "formatTemplate",
84975
+ transform: (_v, fieldType) => fieldType === FIELD_TYPE.DATE ? "YYYY-MM-DD" : fieldType === FIELD_TYPE.DATE_TIME ? "YYYY-MM-DD HH:mm:ss" : void 0
84976
+ },
84977
+ { from: "_", to: "formatSeparator", transform: () => "-" }
84978
+ ]
84979
+ };
84980
+ const DYN_CONFIG_BY_TYPE = {
84981
+ [
84982
+ "string"
84983
+ /* String */
84984
+ ]: {
84985
+ fieldType: FIELD_TYPE.TEXT,
84986
+ attrsTransform: [
84987
+ ...basicAttrs.required,
84988
+ ...basicAttrs.placeholder,
84989
+ ...basicAttrs.showType,
84990
+ ...basicAttrs.options,
84991
+ { from: "regex_", to: "regex" }
84992
+ ]
84993
+ },
84994
+ [
84995
+ "integer"
84996
+ /* Integer */
84997
+ ]: {
84998
+ fieldType: FIELD_TYPE.INTEGER,
84999
+ attrsTransform: [
85000
+ ...basicAttrs.required,
85001
+ ...basicAttrs.placeholder,
85002
+ ...basicAttrs.showType,
85003
+ ...basicAttrs.options,
85004
+ {
85005
+ from: "validate_range_",
85006
+ to: "enableRangeValidate",
85007
+ transform: (_v, _t2, row) => Boolean(row.validate_range_)
85008
+ },
85009
+ {
85010
+ from: "max_int_",
85011
+ to: "maxValue",
85012
+ transform: (value, _t2, row) => {
85013
+ const n = parseInt(String(value), 10);
85014
+ return row.validate_range_ && !Number.isNaN(n) ? n : void 0;
85015
+ }
85016
+ },
85017
+ {
85018
+ from: "max_int_",
85019
+ to: "maxValidateMode",
85020
+ transform: (value, _t2, row) => {
85021
+ const n = parseInt(String(value), 10);
85022
+ return row.validate_range_ && !Number.isNaN(n) ? RangeValidateModeTypeConst.Fixed_Number : RangeValidateModeTypeConst.No_Validate;
85023
+ }
85024
+ },
85025
+ {
85026
+ from: "min_int_",
85027
+ to: "minValue",
85028
+ transform: (value, _t2, row) => {
85029
+ const n = parseInt(String(value), 10);
85030
+ return row.validate_range_ && !Number.isNaN(n) ? n : void 0;
85031
+ }
85032
+ },
85033
+ {
85034
+ from: "min_int_",
85035
+ to: "minValidateMode",
85036
+ transform: (value, _t2, row) => {
85037
+ const n = parseInt(String(value), 10);
85038
+ return row.validate_range_ && !Number.isNaN(n) ? RangeValidateModeTypeConst.Fixed_Number : RangeValidateModeTypeConst.No_Validate;
85039
+ }
85040
+ }
85041
+ ]
85042
+ },
85043
+ [
85044
+ "decimal"
85045
+ /* Decimal */
85046
+ ]: {
85047
+ fieldType: FIELD_TYPE.DECIMAL,
85048
+ attrsTransform: [
85049
+ ...basicAttrs.required,
85050
+ ...basicAttrs.placeholder,
85051
+ ...basicAttrs.showType,
85052
+ ...basicAttrs.options,
85053
+ {
85054
+ from: "validate_range_",
85055
+ to: "enableRangeValidate",
85056
+ transform: (_v, _t2, row) => Boolean(row.validate_range_)
85057
+ },
85058
+ {
85059
+ from: "digits_",
85060
+ to: "newSpecificConfig.digits",
85061
+ transform: (value) => {
85062
+ const n = parseInt(String(value), 10);
85063
+ return Number.isNaN(n) ? void 0 : n;
85064
+ }
85065
+ }
85066
+ ]
85067
+ },
85068
+ [
85069
+ "boolean"
85070
+ /* Boolean */
85071
+ ]: {
85072
+ fieldType: FIELD_TYPE.BOOLEAN,
85073
+ attrsTransform: [
85074
+ ...basicAttrs.required,
85075
+ ...basicAttrs.showType,
85076
+ {
85077
+ from: "_",
85078
+ to: "optionsJson",
85079
+ transform: (_v, _t2, row) => {
85080
+ const options = [
85081
+ { label: row.true_text_ || "是", value: true, refFields: [], _item: {} },
85082
+ { label: row.false_text_ || "否", value: false, refFields: [], _item: {} }
85083
+ ];
85084
+ const json = JSON.stringify(options);
85085
+ return json;
85086
+ }
85087
+ },
85088
+ {
85089
+ from: "_",
85090
+ to: "computedOptions",
85091
+ transform: (_v, _t2, row) => {
85092
+ const options = [
85093
+ { label: row.true_text_ || "是", value: true, refFields: [], _item: {} },
85094
+ { label: row.false_text_ || "否", value: false, refFields: [], _item: {} }
85095
+ ];
85096
+ const json = JSON.stringify(options);
85097
+ return json;
85098
+ }
85099
+ },
85100
+ {
85101
+ from: "_",
85102
+ to: "iconLabelSpace",
85103
+ transform: () => 8
85104
+ },
85105
+ {
85106
+ from: "_",
85107
+ to: "labelPosition",
85108
+ transform: () => "after"
85109
+ },
85110
+ {
85111
+ from: "_",
85112
+ to: "direction",
85113
+ transform: () => "landscape"
85114
+ },
85115
+ {
85116
+ from: "_",
85117
+ to: "controlSize",
85118
+ transform: () => 24
85119
+ },
85120
+ {
85121
+ from: "_",
85122
+ to: "controlEnumSpace",
85123
+ transform: () => 16
85124
+ },
85125
+ {
85126
+ from: "_",
85127
+ to: "showMode",
85128
+ transform: () => "both"
85129
+ },
85130
+ { from: "validate_true_", to: "validateTrue" },
85131
+ { from: "validate_false_", to: "validateFalse" }
85132
+ ]
85133
+ },
85134
+ [
85135
+ "user"
85136
+ /* User */
85137
+ ]: {
85138
+ fieldType: FIELD_TYPE.USER,
85139
+ attrsTransform: [...basicAttrs.required, ...basicAttrs.placeholder]
85140
+ },
85141
+ [
85142
+ "user_multi"
85143
+ /* UserMulti */
85144
+ ]: {
85145
+ fieldType: FIELD_TYPE.USER_MULTI,
85146
+ attrsTransform: [...basicAttrs.required, ...basicAttrs.placeholder]
85147
+ },
85148
+ [
85149
+ "org"
85150
+ /* Org */
85151
+ ]: {
85152
+ fieldType: FIELD_TYPE.ORG,
85153
+ attrsTransform: [...basicAttrs.required, ...basicAttrs.placeholder]
85154
+ },
85155
+ [
85156
+ "date"
85157
+ /* Date */
85158
+ ]: {
85159
+ fieldType: FIELD_TYPE.DATE,
85160
+ attrsTransform: [...basicAttrs.required, ...basicAttrs.placeholder, ...basicAttrs.pattern]
85161
+ },
85162
+ [
85163
+ "date_time"
85164
+ /* DateTime */
85165
+ ]: {
85166
+ fieldType: FIELD_TYPE.DATE_TIME,
85167
+ attrsTransform: [...basicAttrs.required, ...basicAttrs.placeholder, ...basicAttrs.pattern]
85168
+ },
85169
+ [
85170
+ "image"
85171
+ /* Image */
85172
+ ]: {
85173
+ fieldType: FIELD_TYPE.IMAGE,
85174
+ attrsTransform: [...basicAttrs.required, ...basicAttrs.placeholder]
85175
+ },
85176
+ [
85177
+ "attachment"
85178
+ /* Attachment */
85179
+ ]: {
85180
+ fieldType: FIELD_TYPE.ATTACHMENT,
85181
+ attrsTransform: [...basicAttrs.required, ...basicAttrs.placeholder]
85182
+ }
85183
+ };
85184
+ const FIELD_TYPE_TO_FW = {
85185
+ [FIELD_TYPE.TEXT]: "fw:input",
85186
+ [FIELD_TYPE.LONG_TEXT]: "fw:input",
85187
+ [FIELD_TYPE.INTEGER]: "fw:number",
85188
+ [FIELD_TYPE.LONG]: "fw:number",
85189
+ [FIELD_TYPE.DOUBLE]: "fw:double",
85190
+ [FIELD_TYPE.DECIMAL]: "fw:number",
85191
+ [FIELD_TYPE.BOOLEAN]: "fw:enum",
85192
+ [FIELD_TYPE.DATE]: "fw:date",
85193
+ [FIELD_TYPE.DATE_TIME]: "fw:date-time",
85194
+ [FIELD_TYPE.TIME]: "fw:time",
85195
+ [FIELD_TYPE.IMAGE]: "fw:image",
85196
+ [FIELD_TYPE.ATTACHMENT]: "fw:file",
85197
+ [FIELD_TYPE.USER]: "fw:select",
85198
+ [FIELD_TYPE.USER_MULTI]: "fw:select-multiple",
85199
+ [FIELD_TYPE.ORG]: "fw:tree-select",
85200
+ [FIELD_TYPE.ORG_MULTI]: "fw:tree-select-multiple"
85201
+ };
85202
+ function getDynConfig(type_) {
85203
+ return DYN_CONFIG_BY_TYPE[
85204
+ type_ || "string"
85205
+ /* String */
85206
+ ] ?? DYN_CONFIG_BY_TYPE[
85207
+ "string"
85208
+ /* String */
85209
+ ];
85210
+ }
85211
+ const DATE_TIME_FIELD_DEFAULT_PROPS = {
85212
+ ...dateFieldDefaultProps,
85213
+ formatTemplate: "YYYY${sep}MM${sep}DD HH:mm:ss"
85214
+ };
85215
+ function defaultPropsForFieldType(fieldType) {
85216
+ if (fieldType === FIELD_TYPE.DATE) {
85217
+ return { ...dateFieldDefaultProps };
85218
+ }
85219
+ if (fieldType === FIELD_TYPE.DATE_TIME) {
85220
+ return { ...DATE_TIME_FIELD_DEFAULT_PROPS };
85221
+ }
85222
+ return {};
85223
+ }
85224
+ function buildPropsFromRow(row, config2, baseProps = {}) {
85225
+ const patch = cloneDeep({
85226
+ ...defaultPropsForFieldType(config2.fieldType),
85227
+ ...baseProps
85228
+ });
85229
+ for (const rowDef of config2.attrsTransform) {
85230
+ const raw = rowDef.from === "_" ? void 0 : get(row, rowDef.from);
85231
+ const val = rowDef.transform ? rowDef.transform(raw, config2.fieldType, row, baseProps) : raw;
85232
+ if (val !== void 0) set(patch, rowDef.to, val);
85233
+ }
85234
+ return patch;
85235
+ }
85236
+ function resolveFwType(fieldType, props) {
85237
+ return FIELD_TYPE_TO_FW[fieldType] ?? "fw:input";
85238
+ }
85239
+ function parseCrossIndices(path) {
85240
+ const m = path.match(/\[(\d+)\]\[(\d+)\](?:\.[^[]+)?$/);
85241
+ return m ? { y: Number(m[1]), x: Number(m[2]) } : null;
85242
+ }
85243
+ function rowMetaPathOf(crossValuePath, y2, isLinkNotSet) {
85244
+ const parsed = parseValuePath(crossValuePath);
85245
+ const subKey = parsed.isLink || isLinkNotSet ? parsed.parentFieldKey : crossValuePath.replace(/^\$\./, "").split(":")[0]?.replace(/\[[^\]]*\]/g, "") ?? "";
85246
+ return subKey ? `$.${subKey}[${y2}]` : "";
85247
+ }
85248
+ function resolvePathsFromTemplate(templatePath, y2, x2, resolvePath, isLinkNotSet) {
85249
+ const valuePath = resolvePath?.(templatePath) ?? templatePath;
85250
+ const fromPath = parseCrossIndices(valuePath);
85251
+ const rowY = fromPath?.y ?? y2;
85252
+ const rowX = fromPath?.x ?? x2;
85253
+ return {
85254
+ y: rowY,
85255
+ x: rowX,
85256
+ valuePath,
85257
+ rowMetaPath: rowMetaPathOf(valuePath, rowY, isLinkNotSet)
85258
+ };
85259
+ }
85260
+ function readRowMeta(doc, rowMetaPath) {
85261
+ const dm = doc.dataManager;
85262
+ const config2 = readCheckTableRowConfigFromDefaults((path) => dm.getDefault(path), rowMetaPath);
85263
+ if (doc.mode === DocModeTypeConst.Edit) {
85264
+ return config2;
85265
+ }
85266
+ const runtime = dm.get(rowMetaPath) ?? {};
85267
+ return { ...runtime, ...config2 };
85268
+ }
85269
+ function buildDynWidgetMeta(base, rowMeta) {
85270
+ const config2 = getDynConfig(String(rowMeta.type_ ?? "string"));
85271
+ const props = buildPropsFromRow(rowMeta, config2, base?.props ?? {});
85272
+ return {
85273
+ ...base,
85274
+ type: resolveFwType(config2.fieldType),
85275
+ props,
85276
+ field: {
85277
+ ...base.field,
85278
+ fieldType: config2.fieldType
85279
+ }
85280
+ };
85281
+ }
85282
+ function isCheckTableCrossValuePath(path) {
85283
+ return path.includes(":") && path.endsWith(".value_");
85284
+ }
85285
+ function readCheckTableRowMetaByValuePath(doc, valuePath) {
85286
+ const indices = parseCrossIndices(valuePath);
85287
+ if (!indices) return {};
85288
+ return readRowMeta(doc, rowMetaPathOf(valuePath, indices.y));
85289
+ }
85290
+ function isCheckTableCrossValueLayout(ctx) {
85291
+ const { context, wr } = ctx;
85292
+ if (wr.widgetMeta?.field?.fieldLink !== "value_") return false;
85293
+ const sub = context.cell?.subRenderer;
85294
+ if (!sub || sub.cellZone !== "cross" || !isLinkSubTableType(sub.type)) return false;
85295
+ return sub.type === "check-table";
85296
+ }
85297
+ function prepareDynLayoutWr(ctx, isLinkNotSet) {
85298
+ const wr = cloneDeep(ctx.wr);
85299
+ const sub = ctx.context.cell?.subRenderer;
85300
+ const templatePath = wr.valuePath ?? wr.widgetMeta?.field?.valuePath ?? "";
85301
+ const paths = resolvePathsFromTemplate(
85302
+ templatePath,
85303
+ sub?.yDataIndex ?? 0,
85304
+ sub?.xDataIndex ?? 0,
85305
+ (p) => ctx.context.getValuePath(p),
85306
+ isLinkNotSet
85307
+ );
85308
+ const rowMeta = readRowMeta(ctx.context.doc, paths.rowMetaPath);
85309
+ wr.widgetMeta = buildDynWidgetMeta(wr.widgetMeta, rowMeta);
85310
+ wr.valuePath = paths.valuePath;
85311
+ return { ...ctx, wr };
85312
+ }
85313
+ const EDHR_SUITE_KEY = "edhr";
85314
+ function getFieldManifest(type4) {
85315
+ return fieldManifestRegistry.getSuiteMap(EDHR_SUITE_KEY).get(type4);
85316
+ }
85317
+ function resolveCheckTableValueFieldBinding(doc) {
85318
+ return doc.model?.getWidgetInstances()?.find(
85319
+ (instance2) => instance2.widgetMeta?.field?.fieldLink === "value_" && typeof instance2.valuePath === "string" && instance2.valuePath.includes(":")
85320
+ )?.widgetMeta?.field;
85321
+ }
85322
+ function shouldPreserveCheckTableLabel(doc, valuePath, ctx) {
85323
+ if (ctx?.batchSource !== "hydrate") return false;
85324
+ if (ctx.oldValue !== ctx.newValue) return false;
85325
+ return isPresent(doc.dataManager.get(getLabelPath(valuePath)));
85326
+ }
85327
+ function createCheckTableValueLabelEnricher(doc) {
85328
+ return {
85329
+ id: "label:check-table-value",
85330
+ valuePathTemplate: "*:*[n_y][n_x].value_",
85331
+ match: isCheckTableCrossValuePath,
85332
+ enrich: async (path, value, ctx) => {
85333
+ const baseFieldBinding = resolveCheckTableValueFieldBinding(doc);
85334
+ if (!baseFieldBinding) return;
85335
+ const labelPath = getLabelPath(path);
85336
+ if (shouldPreserveCheckTableLabel(doc, path, ctx)) return;
85337
+ if (value == null || value === "") {
85338
+ return { [labelPath]: null };
85339
+ }
85340
+ const rowMeta = readCheckTableRowMetaByValuePath(doc, path);
85341
+ const type_ = String(rowMeta.type_ ?? "");
85342
+ if (!shouldSyncCheckTableLabel(type_)) return;
85343
+ const config2 = getDynConfig(type_);
85344
+ const manifest2 = getFieldManifest(config2.fieldType);
85345
+ const strategies = resolveFieldLabelStrategies(config2.fieldType, manifest2);
85346
+ if (!strategies) return;
85347
+ const typedFieldKey = CHECK_TABLE_TYPE_TO_VALUE_FIELD[type_];
85348
+ const widgetProps = buildPropsFromRow(rowMeta, config2);
85349
+ const fieldBinding = {
85350
+ ...baseFieldBinding,
85351
+ fieldType: config2.fieldType,
85352
+ fieldLink: typedFieldKey ?? baseFieldBinding.fieldLink
85353
+ };
85354
+ const label = await resolveFieldLabel(strategies, {
85355
+ path,
85356
+ value,
85357
+ dataManager: doc.dataManager,
85358
+ fieldBinding,
85359
+ widgetProps,
85360
+ loadFieldByKey: (modelKey, key) => doc.fieldModelQuery.loadFieldByKey(modelKey, key)
85361
+ });
85362
+ if (label == null) {
85363
+ if (ctx?.batchSource !== "hydrate" && ctx?.oldValue !== ctx?.newValue) {
85364
+ return { [labelPath]: null };
85365
+ }
85366
+ return;
85367
+ }
85368
+ return { [labelPath]: label };
85369
+ }
85370
+ };
85371
+ }
85372
+ registerStaticLabelEnricher((doc) => createCheckTableValueLabelEnricher(doc));
84525
85373
  const ALL_TABLE_PROFILES = [
84526
85374
  profile$8,
84527
85375
  profile$7,
@@ -85750,80 +86598,6 @@ class WtblRegionManager {
85750
86598
  }
85751
86599
  }
85752
86600
  }
85753
- function isLinkSubTableType(type4) {
85754
- if (!type4) return false;
85755
- return type4 === "2d-table" || type4 === "check-table";
85756
- }
85757
- function isLinkSubTableSubScopeZone(cellZone) {
85758
- if (!cellZone) return false;
85759
- return cellZone === "cross" || cellZone === "horizontal";
85760
- }
85761
- function getLinkSubTableCrossRange(region) {
85762
- const { itemRegion } = region;
85763
- if (!itemRegion) return void 0;
85764
- return {
85765
- start: {
85766
- row: Math.max(region.start.row, itemRegion.start.row),
85767
- col: Math.max(region.start.col, itemRegion.start.col)
85768
- },
85769
- end: {
85770
- row: Math.min(region.end.row, itemRegion.end.row),
85771
- col: Math.min(region.end.col, itemRegion.end.col)
85772
- }
85773
- };
85774
- }
85775
- function getDataGroup2DFillEndCol(region, cellDataIndexMap) {
85776
- const { itemRegion } = region;
85777
- if (!itemRegion) return region.end.col;
85778
- let maxCol = itemRegion.end.col;
85779
- cellDataIndexMap.forEach((meta, key) => {
85780
- const [rowStr, colStr] = key.split(",");
85781
- const row = Number(rowStr);
85782
- const col = Number(colStr);
85783
- if (row >= itemRegion.start.row && row <= itemRegion.end.row && meta.dataIndex !== void 0) {
85784
- maxCol = Math.max(maxCol, col);
85785
- }
85786
- });
85787
- return maxCol;
85788
- }
85789
- function resolveLinkSubTableCellZone(row, col, region, options = {}) {
85790
- const { itemRegion } = region;
85791
- if (!itemRegion) {
85792
- return region.contains(row, col) ? "horizontal" : void 0;
85793
- }
85794
- const cross = getLinkSubTableCrossRange(region);
85795
- const fillEndCol = options.fillEndCol ?? itemRegion.end.col;
85796
- const inCrossRows = row >= cross.start.row && row <= cross.end.row;
85797
- const inItemRows = row >= itemRegion.start.row && row <= itemRegion.end.row;
85798
- if (inCrossRows && col >= itemRegion.start.col && col <= fillEndCol) {
85799
- return "cross";
85800
- }
85801
- if (!inCrossRows && inItemRows && col >= itemRegion.start.col && col <= fillEndCol) {
85802
- return "vertical";
85803
- }
85804
- if (region.contains(row, col)) {
85805
- if (col < itemRegion.start.col) {
85806
- return "horizontal";
85807
- }
85808
- if (inCrossRows && col > fillEndCol) {
85809
- return "horizontal";
85810
- }
85811
- }
85812
- return void 0;
85813
- }
85814
- function resolveLinkSubTableValuePath(region, cellZone) {
85815
- switch (cellZone) {
85816
- case "cross":
85817
- return region.valuePath;
85818
- case "vertical":
85819
- return region.linkValuePath;
85820
- case "horizontal":
85821
- return region.subValuePath;
85822
- }
85823
- }
85824
- function isInLinkSubTableLayoutScope(row, col, region, options = {}) {
85825
- return resolveLinkSubTableCellZone(row, col, region, options) !== void 0;
85826
- }
85827
86601
  class CellCollector {
85828
86602
  constructor(table) {
85829
86603
  this.table = table;
@@ -94627,7 +95401,26 @@ function shouldShowFieldHyperlink(doc, widgetMeta, runtimePath) {
94627
95401
  }
94628
95402
  class FieldBaseHandler extends RunHandlerBase {
94629
95403
  static hasValue(value) {
94630
- return value !== void 0 && value !== null;
95404
+ return value !== void 0 && value !== null && value !== "";
95405
+ }
95406
+ /** 将展示文案拆成逐字 run;空串 split 会得到 [],需单独处理 */
95407
+ static toLayoutChars(label) {
95408
+ if (label === void 0 || label === null || label === "") {
95409
+ return [];
95410
+ }
95411
+ return String(label).split("");
95412
+ }
95413
+ /**
95414
+ * 展示内容为空时补一个带 widgetMeta/valuePath 的占位 run
95415
+ * 避免段落只剩默认 TextRun(isPlaceholder=true)导致 getWidgetInstances 收集不到
95416
+ */
95417
+ static ensureFieldWidgetAnchor(ctx, layoutStyle, extra) {
95418
+ const metrics = TextRun.measureText(TextRun.measurePayload(" ", layoutStyle));
95419
+ this.addSpace({
95420
+ ctx,
95421
+ textMetrics: metrics,
95422
+ extra
95423
+ });
94631
95424
  }
94632
95425
  static getModelRefId(context, wr) {
94633
95426
  return this.buildSplitModelRefId(context, wr.id);
@@ -94730,13 +95523,16 @@ class FieldBaseHandler extends RunHandlerBase {
94730
95523
  }
94731
95524
  const layoutStyle = this.resolveFieldTextLayoutStyle(ctx, wr, wr.valuePath);
94732
95525
  const fontSize = layoutStyle.fontSize ?? DEFAULT_FONT_SIZE;
94733
- const chars = String(label).split("");
95526
+ const chars = this.toLayoutChars(label);
94734
95527
  let doc = context.doc;
94735
95528
  this.addFieldMarker({
94736
95529
  ctx,
94737
95530
  fontSize,
94738
95531
  position: "left"
94739
95532
  });
95533
+ if (chars.length === 0) {
95534
+ this.ensureFieldWidgetAnchor(ctx, layoutStyle);
95535
+ }
94740
95536
  chars.forEach((char, charIndex) => {
94741
95537
  const { width, height, ascent, descent } = TextRun.measureText(
94742
95538
  TextRun.measurePayload(char, layoutStyle)
@@ -94778,13 +95574,16 @@ class FieldBaseHandler extends RunHandlerBase {
94778
95574
  const textStyle = TextStyleResolver.resolve(wr.rPr, context.doc.model?.styles);
94779
95575
  const layoutStyle = TextRun.textStyle2LayoutStyle(textStyle);
94780
95576
  const measureStyle = { ...layoutStyle, fontSize: 16 };
94781
- const { label, type: type4 } = this.getNoValueLabel(ctx);
94782
- const chars = label.split("");
95577
+ const { label } = this.getNoValueLabel(ctx);
95578
+ const chars = this.toLayoutChars(label);
94783
95579
  this.addFieldMarker({
94784
95580
  ctx,
94785
95581
  fontSize: 16,
94786
95582
  position: "left"
94787
95583
  });
95584
+ if (chars.length === 0) {
95585
+ this.ensureFieldWidgetAnchor(ctx, measureStyle, { isEmptyPlaceholder: true });
95586
+ }
94788
95587
  chars.forEach((char, charIndex) => {
94789
95588
  const { width, height, ascent, descent } = TextRun.measureText(
94790
95589
  TextRun.measurePayload(char, measureStyle)
@@ -94971,27 +95770,13 @@ class FieldBaseHandler extends RunHandlerBase {
94971
95770
  context.addRun(run);
94972
95771
  }
94973
95772
  }
94974
- const FIELD_TYPE_TO_FW$1 = {
94975
- [FIELD_TYPE.TEXT]: "fw:input",
94976
- [FIELD_TYPE.LONG_TEXT]: "fw:input",
94977
- [FIELD_TYPE.INTEGER]: "fw:number",
94978
- [FIELD_TYPE.LONG]: "fw:number",
94979
- [FIELD_TYPE.DOUBLE]: "fw:double",
94980
- [FIELD_TYPE.DECIMAL]: "fw:number",
94981
- [FIELD_TYPE.DATE]: "fw:date",
94982
- [FIELD_TYPE.DATE_TIME]: "fw:date-time",
94983
- [FIELD_TYPE.TIME]: "fw:time",
94984
- [FIELD_TYPE.ENUM]: "fw:enum",
94985
- [FIELD_TYPE.ENUM_MULTI]: "fw:enum-multiple",
94986
- [FIELD_TYPE.MATERIAL_NO]: "fw:table-select",
94987
- [FIELD_TYPE.RELATED_LOT_NO]: "fw:table-select",
94988
- [FIELD_TYPE.PRODUCT]: "fw:rdo-table-select",
94989
- [FIELD_TYPE.DEVICE]: "fw:table-select",
94990
- [FIELD_TYPE.MFG_ORDER]: "fw:table-select",
94991
- [FIELD_TYPE.RECORD_NO]: "fw:input",
94992
- [FIELD_TYPE.ORDER_NO]: "fw:input",
94993
- [FIELD_TYPE.TRACE_DATE]: "fw:date"
94994
- };
95773
+ function resolveAttachFieldComponent(ctx, fieldType) {
95774
+ const component = ctx.context.doc.fieldModelQuery.getFieldManifest(fieldType)?.component;
95775
+ if (component && component !== "cascade") {
95776
+ return component;
95777
+ }
95778
+ return "fw:input";
95779
+ }
94995
95780
  class AttachFieldHandler extends FieldBaseHandler {
94996
95781
  static layoutOptionAttachFields(ctx, option, layoutStyle) {
94997
95782
  const items = option.attachFields;
@@ -94999,7 +95784,7 @@ class AttachFieldHandler extends FieldBaseHandler {
94999
95784
  const { context, wr } = ctx;
95000
95785
  const parentRuntimeValuePath = context.getValuePath(wr.valuePath);
95001
95786
  const gap = 2;
95002
- const { height, ascent, descent } = TextRun.measureText(
95787
+ const { width, height, ascent, descent } = TextRun.measureText(
95003
95788
  TextRun.measurePayload("0", { ...layoutStyle, fontSize: 16 })
95004
95789
  );
95005
95790
  this.addSpace({
@@ -95018,7 +95803,7 @@ class AttachFieldHandler extends FieldBaseHandler {
95018
95803
  }
95019
95804
  static buildWidgetMeta(ctx, item, parentWr, parentRuntimeValuePath, parentOptionValue, runtimePath) {
95020
95805
  const fieldType = item.fieldData.fieldType;
95021
- const type4 = FIELD_TYPE_TO_FW$1[fieldType] ?? "fw:input";
95806
+ const type4 = resolveAttachFieldComponent(ctx, fieldType);
95022
95807
  const parentMeta = parentWr.widgetMeta;
95023
95808
  const attachFieldParent = {
95024
95809
  parentModelRefId: this.getModelRefId(ctx.context, parentWr),
@@ -95099,7 +95884,7 @@ class OptionHandler extends FieldBaseHandler {
95099
95884
  AttachFieldHandler.layoutOptionAttachFields({ context, wr }, optionWithAttach, layoutStyle);
95100
95885
  }
95101
95886
  if (index2 === options.length - 1 && attachFields.length > 0) {
95102
- const { height, ascent, descent } = TextRun.measureText(
95887
+ const { width, height, ascent, descent } = TextRun.measureText(
95103
95888
  TextRun.measurePayload("0", { ...layoutStyle, fontSize: 16 })
95104
95889
  );
95105
95890
  this.addSpace({
@@ -95347,7 +96132,7 @@ class InputHandler extends FieldBaseHandler {
95347
96132
  }
95348
96133
  const layoutStyle = this.resolveFieldTextLayoutStyle(ctx, wr, wr.valuePath);
95349
96134
  const fontSize = layoutStyle.fontSize ?? DEFAULT_FONT_SIZE;
95350
- const chars = String(label).split("");
96135
+ const chars = this.toLayoutChars(label);
95351
96136
  let doc = context.doc;
95352
96137
  this.addFieldMarker({
95353
96138
  ctx,
@@ -95465,575 +96250,15 @@ class AttachmentHandler extends FieldBaseHandler {
95465
96250
  }
95466
96251
  }
95467
96252
  }
95468
- const initComponentDependency = {
95469
- sortDependency: [],
95470
- configDependency: {
95471
- [FieldDependencyTypeConst.Hidden]: {},
95472
- [FieldDependencyTypeConst.Readonly]: {},
95473
- [FieldDependencyTypeConst.Disabled]: {},
95474
- [FieldDependencyTypeConst.Required]: {},
95475
- [FieldDependencyTypeConst.Assignment]: {}
95476
- }
95477
- };
95478
- const commonDefaultRenderers = {
95479
- placeholder: "render:gct-placeholder",
95480
- control: "render:gct-control",
95481
- space: "render:gct-space",
95482
- leftMarker: "render:gct-leftMarker",
95483
- rightMarker: "render:gct-rightMarker",
95484
- text: "render:gct-text"
95485
- };
95486
- const commonDefaultProps = {
95487
- viewState: ViewStateTypeConst.Readonly,
95488
- emptySymbol: null,
95489
- required: true,
95490
- disabled: false,
95491
- defaultValue: null,
95492
- placeholder: null,
95493
- componentDependency: cloneDeep(initComponentDependency),
95494
- computedOptions: null,
95495
- // word 画布渲染使用
95496
- cannotInput: false,
95497
- newSpecificConfig: {}
95498
- };
95499
- const dateFieldDefaultProps = {
95500
- enableCustomFormat: false,
95501
- formatSeparator: "-",
95502
- formatTemplate: "YYYY${sep}MM${sep}DD",
95503
- customFormat: void 0,
95504
- defaultSysDate: false,
95505
- enableRangeValidate: false,
95506
- maxValidateMode: RangeValidateModeTypeConst.No_Validate,
95507
- minValidateMode: RangeValidateModeTypeConst.No_Validate,
95508
- minValue: void 0,
95509
- maxValue: void 0,
95510
- minFormulaExpr: void 0,
95511
- maxFormulaExpr: void 0
95512
- };
95513
- const numberFieldDefaultProps = {
95514
- displayMode: DecimalDisplayModeTypeConst.ORIGIN,
95515
- enableRangeValidate: false,
95516
- maxValidateMode: RangeValidateModeTypeConst.No_Validate,
95517
- minValidateMode: RangeValidateModeTypeConst.No_Validate,
95518
- minValue: void 0,
95519
- maxValue: void 0,
95520
- minFormulaExpr: void 0,
95521
- maxFormulaExpr: void 0
95522
- };
95523
- const signFieldDefaultProps = {
95524
- signatureNumber: SignatureNumberTypeConst.SIGNATURE_MULTIPLE,
95525
- signatureType: SignatureTypeConst.SIGNATURE_ONLY,
95526
- signTimeType: SignatureTimeTypeConst.FOLLOW_SIGNATURE,
95527
- signDisplayStyle: SignDisplayTypeConst.VERTICAL,
95528
- populateFields: []
95529
- };
95530
- const fileFieldDefaultProps = {
95531
- imageDisplayMode: ImageDisplayModeConst.CUSTOM,
95532
- maxCount: void 0,
95533
- maxSize: void 0,
95534
- showFileName: void 0,
95535
- acceptTypes: []
95536
- };
95537
- const styleDefaultProps = {
95538
- renderComp: RenderCompTypeConst.Select,
95539
- iconLabelSpace: 8,
95540
- labelPosition: LabelPositionTypeConst.After,
95541
- direction: OrientationTypeConst.Landscape,
95542
- /** 控件大小 */
95543
- controlSize: 24,
95544
- /** 枚举项的间距 */
95545
- controlEnumSpace: 16
95546
- };
95547
- const styleSizeDefaultProps = {
95548
- /** 组件默认宽度 */
95549
- width: 120,
95550
- /** 组件默认高度 */
95551
- height: 68
95552
- };
95553
- const labelPriorityConfig = {
95554
- type: "priority",
95555
- fields: ["defaultValue"]
95556
- };
95557
- const labelResolveDateConfig = {
95558
- type: "resolve",
95559
- valueType: "date",
95560
- valueField: "defaultSysDate"
95561
- };
95562
- const labelResolveUserConfig = {
95563
- type: "resolve",
95564
- valueType: "user",
95565
- valueField: "defaultValue",
95566
- isRenderSideRequest: true,
95567
- fetcher: "user"
95568
- };
95569
- const labelResolveOrgConfig = {
95570
- type: "resolve",
95571
- valueType: "org",
95572
- valueField: "defaultValue",
95573
- isRenderSideRequest: true,
95574
- fetcher: "dept"
95575
- };
95576
- const labelResolveEnumConfig = {
95577
- type: "resolve",
95578
- valueType: "enum",
95579
- from: "optionsJson",
95580
- valueField: "defaultSelected"
95581
- };
95582
- const optionsMapEnumConfig = {
95583
- type: "map",
95584
- filter: "enum",
95585
- from: "optionsJson"
95586
- };
95587
- const labelOnValueChangeRule = { type: "label" };
95588
- const hyperlinkOnValueChangeRule = { type: "hyperlink" };
95589
- const hyperlinkAndLabelOnValueChangeRules = [
95590
- hyperlinkOnValueChangeRule,
95591
- labelOnValueChangeRule
95592
- ];
95593
- function mergeCheckTableItemInfosIntoDefaults(defaultsMap, region, infos, layoutColumnCount) {
95594
- applySubFieldDefaults(defaultsMap, region, infos, layoutColumnCount ?? 0);
95595
- }
95596
- const CHECK_TABLE_ROW_CONFIG_FIELDS = [
95597
- "type_",
95598
- "show_type_",
95599
- "required_",
95600
- "tip_text_",
95601
- "options_",
95602
- "pattern_",
95603
- "max_int_",
95604
- "min_int_",
95605
- "min_decimal_",
95606
- "max_decimal_",
95607
- "validate_range_",
95608
- "digits_",
95609
- "regex_",
95610
- "true_text_",
95611
- "false_text_",
95612
- "default_value_",
95613
- "name_",
95614
- "description_",
95615
- "inspection_standard_",
95616
- "__gw_y_uid"
95617
- ];
95618
- function expandRowToDefaultPaths(defaultsMap, subFieldKey, index2, item) {
95619
- const rowPath = `$.${subFieldKey}[${index2}]`;
95620
- for (const [key, value] of Object.entries(item)) {
95621
- if (value === void 0) continue;
95622
- defaultsMap[`${rowPath}.${key}`] = value;
95623
- }
95624
- }
95625
- function readCheckTableRowConfigFromDefaults(getDefault, rowMetaPath) {
95626
- const row = {};
95627
- let hasField = false;
95628
- for (const key of CHECK_TABLE_ROW_CONFIG_FIELDS) {
95629
- const value = getDefault(`${rowMetaPath}.${key}`);
95630
- if (value !== void 0) {
95631
- row[key] = value;
95632
- hasField = true;
95633
- }
95634
- }
95635
- if (hasField) return row;
95636
- const whole = getDefault(rowMetaPath);
95637
- if (whole != null && typeof whole === "object" && !Array.isArray(whole)) {
95638
- return { ...whole };
95639
- }
95640
- return {};
95641
- }
95642
- function applySubFieldDefaults(defaultsMap, region, payload, layoutColumnCount = 0) {
95643
- if (!payload?.data?.length || !region.subFieldKey) return;
95644
- const subFieldKey = region.subFieldKey;
95645
- const xCount = region.linkFieldKey ? Math.max(layoutColumnCount, 0) : 0;
95646
- payload.data.forEach((row, index2) => {
95647
- const item = { ...row };
95648
- if (!item.__gw_y_uid) {
95649
- item.__gw_y_uid = `${subFieldKey}_y_${index2}`;
95650
- }
95651
- expandRowToDefaultPaths(defaultsMap, subFieldKey, index2, item);
95652
- const defaultValue = item.default_value_;
95653
- if (defaultValue == null || defaultValue === "" || !region.linkFieldKey || xCount === 0) {
95654
- return;
95655
- }
95656
- for (let x2 = 0; x2 < xCount; x2++) {
95657
- const crossPath = `$.${subFieldKey}:${region.linkFieldKey}[${index2}][${x2}].value_`;
95658
- if (defaultsMap[crossPath] == null) {
95659
- defaultsMap[crossPath] = defaultValue;
95660
- }
95661
- }
95662
- });
95663
- }
95664
- const basicAttrs = {
95665
- required: [
95666
- {
95667
- from: "required_",
95668
- to: "required",
95669
- transform: (value) => Boolean(value)
95670
- }
95671
- // {
95672
- // from: '_',
95673
- // to: 'newSpecificConfig.newFieldName',
95674
- // transform: () => '值',
95675
- // },
95676
- ],
95677
- placeholder: [{ from: "tip_text_", to: "placeholder" }],
95678
- showType: [
95679
- {
95680
- from: "show_type_",
95681
- to: "renderComp",
95682
- transform: (value) => {
95683
- if (value === "select") return RenderCompTypeConst.Select;
95684
- if (value === "radio") return RenderCompTypeConst.Radio;
95685
- if (value === "checkbox") return RenderCompTypeConst.Checkbox;
95686
- return RenderCompTypeConst.Select;
95687
- }
95688
- }
95689
- ],
95690
- options: [
95691
- { from: "options_", to: "optionsJson", transform: (v) => v == null ? null : String(v) }
95692
- ],
95693
- pattern: [
95694
- {
95695
- from: "_",
95696
- to: "enableCustomFormat",
95697
- transform: (_v, _t2, row) => !isEmpty(row.pattern_)
95698
- },
95699
- { from: "pattern_", to: "customFormat" },
95700
- {
95701
- from: "_",
95702
- to: "formatTemplate",
95703
- transform: (_v, fieldType) => fieldType === FIELD_TYPE.DATE ? "YYYY-MM-DD" : fieldType === FIELD_TYPE.DATE_TIME ? "YYYY-MM-DD HH:mm:ss" : void 0
95704
- },
95705
- { from: "_", to: "formatSeparator", transform: () => "-" }
95706
- ]
95707
- };
95708
- const DYN_CONFIG_BY_TYPE = {
95709
- [
95710
- "string"
95711
- /* String */
95712
- ]: {
95713
- fieldType: FIELD_TYPE.TEXT,
95714
- attrsTransform: [
95715
- ...basicAttrs.required,
95716
- ...basicAttrs.placeholder,
95717
- ...basicAttrs.showType,
95718
- ...basicAttrs.options,
95719
- { from: "regex_", to: "regex" }
95720
- ]
95721
- },
95722
- [
95723
- "integer"
95724
- /* Integer */
95725
- ]: {
95726
- fieldType: FIELD_TYPE.INTEGER,
95727
- attrsTransform: [
95728
- ...basicAttrs.required,
95729
- ...basicAttrs.placeholder,
95730
- ...basicAttrs.showType,
95731
- ...basicAttrs.options,
95732
- {
95733
- from: "validate_range_",
95734
- to: "enableRangeValidate",
95735
- transform: (_v, _t2, row) => Boolean(row.validate_range_)
95736
- },
95737
- {
95738
- from: "max_int_",
95739
- to: "maxValue",
95740
- transform: (value, _t2, row) => {
95741
- const n = parseInt(String(value), 10);
95742
- return row.validate_range_ && !Number.isNaN(n) ? n : void 0;
95743
- }
95744
- },
95745
- {
95746
- from: "max_int_",
95747
- to: "maxValidateMode",
95748
- transform: (value, _t2, row) => {
95749
- const n = parseInt(String(value), 10);
95750
- return row.validate_range_ && !Number.isNaN(n) ? RangeValidateModeTypeConst.Fixed_Number : RangeValidateModeTypeConst.No_Validate;
95751
- }
95752
- },
95753
- {
95754
- from: "min_int_",
95755
- to: "minValue",
95756
- transform: (value, _t2, row) => {
95757
- const n = parseInt(String(value), 10);
95758
- return row.validate_range_ && !Number.isNaN(n) ? n : void 0;
95759
- }
95760
- },
95761
- {
95762
- from: "min_int_",
95763
- to: "minValidateMode",
95764
- transform: (value, _t2, row) => {
95765
- const n = parseInt(String(value), 10);
95766
- return row.validate_range_ && !Number.isNaN(n) ? RangeValidateModeTypeConst.Fixed_Number : RangeValidateModeTypeConst.No_Validate;
95767
- }
95768
- }
95769
- ]
95770
- },
95771
- [
95772
- "decimal"
95773
- /* Decimal */
95774
- ]: {
95775
- fieldType: FIELD_TYPE.DECIMAL,
95776
- attrsTransform: [
95777
- ...basicAttrs.required,
95778
- ...basicAttrs.placeholder,
95779
- ...basicAttrs.showType,
95780
- ...basicAttrs.options,
95781
- {
95782
- from: "validate_range_",
95783
- to: "enableRangeValidate",
95784
- transform: (_v, _t2, row) => Boolean(row.validate_range_)
95785
- },
95786
- {
95787
- from: "digits_",
95788
- to: "newSpecificConfig.digits",
95789
- transform: (value) => {
95790
- const n = parseInt(String(value), 10);
95791
- return Number.isNaN(n) ? void 0 : n;
95792
- }
95793
- }
95794
- ]
95795
- },
95796
- [
95797
- "boolean"
95798
- /* Boolean */
95799
- ]: {
95800
- fieldType: FIELD_TYPE.BOOLEAN,
95801
- attrsTransform: [
95802
- ...basicAttrs.required,
95803
- ...basicAttrs.showType,
95804
- {
95805
- from: "_",
95806
- to: "optionsJson",
95807
- transform: (_v, _t2, row) => {
95808
- const options = [
95809
- { label: row.true_text_ || "是", value: true, refFields: [], _item: {} },
95810
- { label: row.false_text_ || "否", value: false, refFields: [], _item: {} }
95811
- ];
95812
- const json = JSON.stringify(options);
95813
- return json;
95814
- }
95815
- },
95816
- {
95817
- from: "_",
95818
- to: "computedOptions",
95819
- transform: (_v, _t2, row) => {
95820
- const options = [
95821
- { label: row.true_text_ || "是", value: true, refFields: [], _item: {} },
95822
- { label: row.false_text_ || "否", value: false, refFields: [], _item: {} }
95823
- ];
95824
- const json = JSON.stringify(options);
95825
- return json;
95826
- }
95827
- },
95828
- {
95829
- from: "_",
95830
- to: "iconLabelSpace",
95831
- transform: () => 8
95832
- },
95833
- {
95834
- from: "_",
95835
- to: "labelPosition",
95836
- transform: () => "after"
95837
- },
95838
- {
95839
- from: "_",
95840
- to: "direction",
95841
- transform: () => "landscape"
95842
- },
95843
- {
95844
- from: "_",
95845
- to: "controlSize",
95846
- transform: () => 24
95847
- },
95848
- {
95849
- from: "_",
95850
- to: "controlEnumSpace",
95851
- transform: () => 16
95852
- },
95853
- {
95854
- from: "_",
95855
- to: "showMode",
95856
- transform: () => "both"
95857
- },
95858
- { from: "validate_true_", to: "validateTrue" },
95859
- { from: "validate_false_", to: "validateFalse" }
95860
- ]
95861
- },
95862
- [
95863
- "user"
95864
- /* User */
95865
- ]: {
95866
- fieldType: FIELD_TYPE.USER,
95867
- attrsTransform: [...basicAttrs.required, ...basicAttrs.placeholder]
95868
- },
95869
- [
95870
- "user_multi"
95871
- /* UserMulti */
95872
- ]: {
95873
- fieldType: FIELD_TYPE.USER_MULTI,
95874
- attrsTransform: [...basicAttrs.required, ...basicAttrs.placeholder]
95875
- },
95876
- [
95877
- "org"
95878
- /* Org */
95879
- ]: {
95880
- fieldType: FIELD_TYPE.ORG,
95881
- attrsTransform: [...basicAttrs.required, ...basicAttrs.placeholder]
95882
- },
95883
- [
95884
- "date"
95885
- /* Date */
95886
- ]: {
95887
- fieldType: FIELD_TYPE.DATE,
95888
- attrsTransform: [...basicAttrs.required, ...basicAttrs.placeholder, ...basicAttrs.pattern]
95889
- },
95890
- [
95891
- "date_time"
95892
- /* DateTime */
95893
- ]: {
95894
- fieldType: FIELD_TYPE.DATE_TIME,
95895
- attrsTransform: [...basicAttrs.required, ...basicAttrs.placeholder, ...basicAttrs.pattern]
95896
- },
95897
- [
95898
- "image"
95899
- /* Image */
95900
- ]: {
95901
- fieldType: FIELD_TYPE.IMAGE,
95902
- attrsTransform: [...basicAttrs.required, ...basicAttrs.placeholder]
95903
- },
95904
- [
95905
- "attachment"
95906
- /* Attachment */
95907
- ]: {
95908
- fieldType: FIELD_TYPE.ATTACHMENT,
95909
- attrsTransform: [...basicAttrs.required, ...basicAttrs.placeholder]
95910
- }
95911
- };
95912
- const FIELD_TYPE_TO_FW = {
95913
- [FIELD_TYPE.TEXT]: "fw:input",
95914
- [FIELD_TYPE.LONG_TEXT]: "fw:input",
95915
- [FIELD_TYPE.INTEGER]: "fw:number",
95916
- [FIELD_TYPE.LONG]: "fw:number",
95917
- [FIELD_TYPE.DOUBLE]: "fw:double",
95918
- [FIELD_TYPE.DECIMAL]: "fw:number",
95919
- [FIELD_TYPE.BOOLEAN]: "fw:enum",
95920
- [FIELD_TYPE.DATE]: "fw:date",
95921
- [FIELD_TYPE.DATE_TIME]: "fw:date-time",
95922
- [FIELD_TYPE.TIME]: "fw:time",
95923
- [FIELD_TYPE.IMAGE]: "fw:image",
95924
- [FIELD_TYPE.ATTACHMENT]: "fw:file",
95925
- [FIELD_TYPE.USER]: "fw:select",
95926
- [FIELD_TYPE.USER_MULTI]: "fw:select-multiple",
95927
- [FIELD_TYPE.ORG]: "fw:tree-select",
95928
- [FIELD_TYPE.ORG_MULTI]: "fw:tree-select-multiple"
95929
- };
95930
- function getDynConfig(type_) {
95931
- return DYN_CONFIG_BY_TYPE[
95932
- type_ || "string"
95933
- /* String */
95934
- ] ?? DYN_CONFIG_BY_TYPE[
95935
- "string"
95936
- /* String */
95937
- ];
95938
- }
95939
- const DATE_TIME_FIELD_DEFAULT_PROPS = {
95940
- ...dateFieldDefaultProps,
95941
- formatTemplate: "YYYY${sep}MM${sep}DD HH:mm:ss"
95942
- };
95943
- function defaultPropsForFieldType(fieldType) {
95944
- if (fieldType === FIELD_TYPE.DATE) {
95945
- return { ...dateFieldDefaultProps };
95946
- }
95947
- if (fieldType === FIELD_TYPE.DATE_TIME) {
95948
- return { ...DATE_TIME_FIELD_DEFAULT_PROPS };
95949
- }
95950
- return {};
95951
- }
95952
- function buildPropsFromRow(row, config2, baseProps = {}) {
95953
- const patch = cloneDeep({
95954
- ...defaultPropsForFieldType(config2.fieldType),
95955
- ...baseProps
95956
- });
95957
- for (const rowDef of config2.attrsTransform) {
95958
- const raw = rowDef.from === "_" ? void 0 : get(row, rowDef.from);
95959
- const val = rowDef.transform ? rowDef.transform(raw, config2.fieldType, row, baseProps) : raw;
95960
- if (val !== void 0) set(patch, rowDef.to, val);
95961
- }
95962
- return patch;
95963
- }
95964
- function resolveFwType(fieldType, props) {
95965
- return FIELD_TYPE_TO_FW[fieldType] ?? "fw:input";
95966
- }
95967
- function parseCrossIndices(path) {
95968
- const m = path.match(/\[(\d+)\]\[(\d+)\](?:\.[^[]+)?$/);
95969
- return m ? { y: Number(m[1]), x: Number(m[2]) } : null;
95970
- }
95971
- function rowMetaPathOf(crossValuePath, y2) {
95972
- const parsed = parseValuePath(crossValuePath);
95973
- const subKey = parsed.isLink ? parsed.parentFieldKey : crossValuePath.replace(/^\$\./, "").split(":")[0]?.replace(/\[[^\]]*\]/g, "") ?? "";
95974
- return subKey ? `$.${subKey}[${y2}]` : "";
95975
- }
95976
- function resolvePathsFromTemplate(templatePath, y2, x2, resolvePath) {
95977
- const valuePath = resolvePath?.(templatePath) ?? templatePath;
95978
- const fromPath = parseCrossIndices(valuePath);
95979
- const rowY = fromPath?.y ?? y2;
95980
- const rowX = fromPath?.x ?? x2;
95981
- return {
95982
- y: rowY,
95983
- x: rowX,
95984
- valuePath,
95985
- rowMetaPath: rowMetaPathOf(valuePath, rowY)
95986
- };
95987
- }
95988
- function readRowMeta(doc, rowMetaPath) {
95989
- const dm = doc.dataManager;
95990
- const config2 = readCheckTableRowConfigFromDefaults((path) => dm.getDefault(path), rowMetaPath);
95991
- if (doc.mode === DocModeTypeConst.Edit) {
95992
- return config2;
95993
- }
95994
- const runtime = dm.get(rowMetaPath) ?? {};
95995
- return { ...runtime, ...config2 };
95996
- }
95997
- function buildDynWidgetMeta(base, rowMeta) {
95998
- const config2 = getDynConfig(String(rowMeta.type_ ?? "string"));
95999
- const props = buildPropsFromRow(rowMeta, config2, base?.props ?? {});
96000
- return {
96001
- ...base,
96002
- type: resolveFwType(config2.fieldType),
96003
- props,
96004
- field: {
96005
- ...base.field,
96006
- fieldType: config2.fieldType
96007
- }
96008
- };
96009
- }
96010
- function isCheckTableCrossValueLayout(ctx) {
96011
- const { context, wr } = ctx;
96012
- if (wr.widgetMeta?.field?.fieldLink !== "value_") return false;
96013
- const sub = context.cell?.subRenderer;
96014
- if (!sub || sub.cellZone !== "cross" || !isLinkSubTableType(sub.type)) return false;
96015
- return sub.type === "check-table";
96016
- }
96017
- function prepareDynLayoutWr(ctx) {
96018
- const wr = cloneDeep(ctx.wr);
96019
- const sub = ctx.context.cell?.subRenderer;
96020
- const templatePath = wr.valuePath ?? wr.widgetMeta?.field?.valuePath ?? "";
96021
- const paths = resolvePathsFromTemplate(
96022
- templatePath,
96023
- sub?.yDataIndex ?? 0,
96024
- sub?.xDataIndex ?? 0,
96025
- (p) => ctx.context.getValuePath(p)
96026
- );
96027
- const rowMeta = readRowMeta(ctx.context.doc, paths.rowMetaPath);
96028
- wr.widgetMeta = buildDynWidgetMeta(wr.widgetMeta, rowMeta);
96029
- wr.valuePath = paths.valuePath;
96030
- return { ...ctx, wr };
96031
- }
96032
96253
  class FieldHandler {
96033
96254
  static layout(context, wr) {
96034
96255
  const ctx = { context, wr };
96035
96256
  if (isCheckTableCrossValueLayout(ctx)) {
96036
- FieldHandler.layoutCheckTableCrossValue(ctx);
96257
+ FieldHandler.layoutCheckTableValue(ctx);
96258
+ return;
96259
+ }
96260
+ if (context.cell?.subRenderer?.type === "check-table" && wr.widgetMeta?.field?.fieldLink === "value_") {
96261
+ FieldHandler.layoutCheckTableValue(ctx, true);
96037
96262
  return;
96038
96263
  }
96039
96264
  if (wr.widgetMeta?.props?.renderComp === "checkbox") {
@@ -96051,8 +96276,8 @@ class FieldHandler {
96051
96276
  }
96052
96277
  }
96053
96278
  /** 检验表交叉区 value_:按同行检验项 type_ 渲染,值路径固定 value_ */
96054
- static layoutCheckTableCrossValue(ctx) {
96055
- const layoutCtx = prepareDynLayoutWr(ctx);
96279
+ static layoutCheckTableValue(ctx, isLinkNotSet) {
96280
+ const layoutCtx = prepareDynLayoutWr(ctx, isLinkNotSet);
96056
96281
  if (layoutCtx.context.doc.mode === DocModeTypeConst.Print) {
96057
96282
  FieldBaseHandler.layoutValue(layoutCtx);
96058
96283
  return;
@@ -101118,12 +101343,14 @@ class DataManager {
101118
101343
  this.setByPath(this.rawData, crossPath, rows);
101119
101344
  }
101120
101345
  let row2 = rows.find((item) => item?.__gw_y_uid === yUid && item?.__gw_x_uid === xUid);
101346
+ const oldFieldValue2 = row2 ? this.deepClone(this.getFieldFromRow(row2, fieldPath)) : void 0;
101121
101347
  if (!row2) {
101122
101348
  row2 = { __gw_y_uid: yUid, __gw_x_uid: xUid };
101123
101349
  rows.push(row2);
101124
101350
  }
101125
101351
  this.assignField(row2, fieldPath, value);
101126
101352
  this.emit(crossPath, this.getByPath(this.rawData, crossPath), oldValue2, source);
101353
+ this.emit2DFieldPath(tableKey, fieldPath, coords, value, oldFieldValue2, source);
101127
101354
  return true;
101128
101355
  }
101129
101356
  const axisInfo = this.resolveAxisByTableKey(tableKey);
@@ -101134,10 +101361,24 @@ class DataManager {
101134
101361
  const tablePath = `$.${tableKey}`;
101135
101362
  const oldValue = this.deepClone(this.getByPath(this.rawData, tablePath));
101136
101363
  const row = this.ensureAxisRowAndUid(tableKey, index2, axis);
101364
+ const oldFieldValue = this.deepClone(this.getFieldFromRow(row, fieldPath));
101137
101365
  this.assignField(row, fieldPath, value);
101138
101366
  this.emit(tablePath, this.getByPath(this.rawData, tablePath), oldValue, source);
101367
+ this.emit2DFieldPath(tableKey, fieldPath, coords, value, oldFieldValue, source);
101139
101368
  return true;
101140
101369
  }
101370
+ /** 二维/检验表写字段后,额外 emit 带下标的字段路径,供 label enricher 等按字段匹配 */
101371
+ emit2DFieldPath(tableKey, fieldPath, coords, value, oldValue, source) {
101372
+ if (!fieldPath) return;
101373
+ if (tableKey.includes(":")) {
101374
+ if (typeof coords.y !== "number" || typeof coords.x !== "number") return;
101375
+ this.emit(`$.${tableKey}[${coords.y}][${coords.x}].${fieldPath}`, value, oldValue, source);
101376
+ return;
101377
+ }
101378
+ const index2 = typeof coords.y === "number" ? coords.y : coords.x;
101379
+ if (typeof index2 !== "number") return;
101380
+ this.emit(`$.${tableKey}[${index2}].${fieldPath}`, value, oldValue, source);
101381
+ }
101141
101382
  cleanupCrossByAxisUid(tableKey, axis, uid) {
101142
101383
  if (!uid) return;
101143
101384
  const uidField = axis === "y" ? "__gw_y_uid" : "__gw_x_uid";
@@ -106169,7 +106410,7 @@ class MaterialConsumeTableController {
106169
106410
  * 并判断是否能存入表中,返回对象则表示可以存入
106170
106411
  * @param str
106171
106412
  */
106172
- async parseScanStr(str, option, subModelKey) {
106413
+ async parseScanStr(str, option) {
106173
106414
  if (!this.isFirstBlankRow() && this.hasEditingRow()) {
106174
106415
  return;
106175
106416
  }
@@ -106220,11 +106461,14 @@ class MaterialConsumeTableController {
106220
106461
  const newArr = this.bomEntriesValidator.mergeRowInArr(row, this.actualTableData);
106221
106462
  await this.bomEntriesValidator.validateScanCanInsert(newArr);
106222
106463
  this.tableDataRef.value = newArr;
106223
- setTimeout(() => {
106464
+ setTimeout(async () => {
106224
106465
  const row2 = this.actualTableData.find((i) => !i.is_confirmed_);
106225
106466
  const rowIndex = this.actualTableData.findIndex((i) => !i.is_confirmed_);
106467
+ const { doc, subFieldKey, subModelKey } = option;
106468
+ await doc.dataManager.whenEmitSettled();
106469
+ await hydrateSubtableRowLabels(doc, subFieldKey, [rowIndex]);
106226
106470
  if (row2) {
106227
- this.confirm({ ...option, rowIndex }, subModelKey);
106471
+ this.confirm({ dataManager: doc.dataManager, subFieldKey, rowIndex }, subModelKey);
106228
106472
  }
106229
106473
  });
106230
106474
  } catch (e) {
@@ -106240,7 +106484,7 @@ class MaterialConsumeTableController {
106240
106484
  * 打开扫描弹窗
106241
106485
  * @param opts
106242
106486
  */
106243
- async openScanModal(title, option, subModelKey) {
106487
+ async openScanModal(title, option) {
106244
106488
  if (this.isScanOpen) return;
106245
106489
  if (!this.scanRuleInfo) {
106246
106490
  this.error(
@@ -106254,7 +106498,7 @@ class MaterialConsumeTableController {
106254
106498
  title,
106255
106499
  onScan: async (str) => {
106256
106500
  console.log("onScan", str);
106257
- await this.parseScanStr(str, option, subModelKey);
106501
+ await this.parseScanStr(str, option);
106258
106502
  }
106259
106503
  });
106260
106504
  this.isScanOpen = false;
@@ -106446,7 +106690,6 @@ class MaterialConsumeTableController {
106446
106690
  doc.dataManager.setMultiple(
106447
106691
  {
106448
106692
  [`${rowPath}.product_id_`]: selectedOption.product_id_
106449
- // [`${rowPath}.product_id__lb_`]: record.product_id__lb_, // 目前取不到
106450
106693
  },
106451
106694
  "user"
106452
106695
  );
@@ -107899,25 +108142,63 @@ async function prepareDocumentFieldContext(options) {
107899
108142
  if (loadSubModels) {
107900
108143
  await addSubModelsToFieldScope(mainModelKey, payload.ctx);
107901
108144
  }
108145
+ const fieldList = payload.ctx.runtime.getFieldList(mainModelKey);
107902
108146
  const masterSlaveList = payload.ctx.runtime.getMasterSlaveFieldList(mainModelKey);
107903
- return { mainModelKey, masterSlaveList };
107904
- }
107905
- const initObjectTypeFieldDefaultValue = (runtimeJson, rawData) => {
108147
+ return { mainModelKey, fieldList, masterSlaveList };
108148
+ }
108149
+ const initObjectTypeFieldDefaultValue = (rawData, instances, fieldList, runtimeJson) => {
108150
+ const usingObjectFieldMap = instances.map((i) => {
108151
+ const { belongingObject, fieldLink } = i.widgetMeta.field;
108152
+ return belongingObject ? { belongingObject, fieldLink } : null;
108153
+ }).reduce((map, cur) => {
108154
+ if (!cur) return map;
108155
+ const { belongingObject, fieldLink } = cur;
108156
+ if (!map[belongingObject]) {
108157
+ map[belongingObject] = [];
108158
+ }
108159
+ map[belongingObject].push(fieldLink);
108160
+ return map;
108161
+ }, {});
108162
+ const allObjectFieldMap = groupBy$1(
108163
+ fieldList.filter((f) => !!f.belongingObject),
108164
+ "belongingObject"
108165
+ );
108166
+ Object.entries(allObjectFieldMap).forEach(([belongingObject, fields2]) => {
108167
+ const allFieldKeys = fields2.map((f) => f.key);
108168
+ const isNotUsed = allFieldKeys.every(
108169
+ (fk) => !usingObjectFieldMap[belongingObject]?.includes(fk)
108170
+ );
108171
+ if (isNotUsed) {
108172
+ delete rawData[belongingObject];
108173
+ }
108174
+ });
107906
108175
  const res = JSON.parse(runtimeJson);
107907
108176
  const { objectInitialValues } = res?.document?.config?.dataInit || {};
107908
108177
  if (!objectInitialValues?.length) return;
107909
- objectInitialValues.forEach(({ values }) => {
107910
- if (!values) return;
107911
- for (const [key, value] of Object.entries(values)) {
107912
- if (value === void 0 || value === null) continue;
107913
- const existing = rawData[key];
107914
- if (existing !== void 0 && existing !== null) continue;
107915
- rawData[key] = value;
108178
+ objectInitialValues.forEach(
108179
+ ({ objectField, values }) => {
108180
+ if (!objectField || !values) return;
108181
+ for (const [key, value] of Object.entries(values)) {
108182
+ if (value === void 0 || value === null) continue;
108183
+ const existing = rawData[key];
108184
+ if (existing !== void 0 && existing !== null) continue;
108185
+ rawData[key] = value;
108186
+ }
108187
+ rawData[objectField] = null;
107916
108188
  }
107917
- });
108189
+ );
107918
108190
  };
107919
108191
  async function prepareDocumentRenderData(options) {
107920
- const { requestInfo, payload, materialNo, query, instances, subTableInfoList, masterSlaveList } = options;
108192
+ const {
108193
+ requestInfo,
108194
+ payload,
108195
+ materialNo,
108196
+ query,
108197
+ instances,
108198
+ subTableInfoList,
108199
+ fieldList,
108200
+ masterSlaveList
108201
+ } = options;
107921
108202
  const interfaceData = await fetchRenderData({
107922
108203
  info: requestInfo,
107923
108204
  fetchConfig: { _gct_materialNo_: materialNo },
@@ -107930,7 +108211,7 @@ async function prepareDocumentRenderData(options) {
107930
108211
  interfaceData,
107931
108212
  subTableInfoList
107932
108213
  });
107933
- initObjectTypeFieldDefaultValue(requestInfo.runtimeJson, rawData);
108214
+ initObjectTypeFieldDefaultValue(rawData, instances, fieldList, requestInfo.runtimeJson);
107934
108215
  return rawData;
107935
108216
  }
107936
108217
  async function loadDocumentInitMappings(options) {
@@ -107964,13 +108245,13 @@ async function initializeDocumentEngine(props, payload, result) {
107964
108245
  configurePipelineLoggingForDev();
107965
108246
  const { id, requestInfo, fillModeType, paramsConfig, tmplBomC } = result;
107966
108247
  const materialNo = paramsConfig?.materialNo || requestInfo.materialNo;
107967
- const { mainModelKey, masterSlaveList } = await prepareDocumentFieldContext({
108248
+ const { mainModelKey, fieldList, masterSlaveList } = await prepareDocumentFieldContext({
107968
108249
  requestInfo,
107969
108250
  payload,
107970
108251
  loadSubModels: true
107971
108252
  });
107972
108253
  const cloneRuntimeJson = cloneDeep(JSON.parse(requestInfo.runtimeJson || "{}"));
107973
- const instanceId = fillModeType === DocModeTypeConst.Fill ? id : "";
108254
+ const instanceId = fillModeType === DocModeTypeConst.Edit ? "" : id;
107974
108255
  const { infosMap, countMap } = await getCheckItemsInfo(instanceId, cloneRuntimeJson);
107975
108256
  const runtimeJsonForModel = expandCheckTableRuntimeJson(cloneRuntimeJson, { countMap });
107976
108257
  const docModel = ModelConverter.toModel(runtimeJsonForModel);
@@ -107999,7 +108280,7 @@ async function initializeDocumentEngine(props, payload, result) {
107999
108280
  payload.ctx,
108000
108281
  defaultQueryIds
108001
108282
  );
108002
- if (fillModeType === DocModeTypeConst.Fill) {
108283
+ if (fillModeType !== DocModeTypeConst.Edit) {
108003
108284
  listCheckTableRegionsInRuntimeJson(runtimeJsonForModel).forEach((region) => {
108004
108285
  const { regionId, linkFieldKey } = region;
108005
108286
  const infos = infosMap[regionId];
@@ -108028,6 +108309,7 @@ async function initializeDocumentEngine(props, payload, result) {
108028
108309
  query: result.query,
108029
108310
  instances,
108030
108311
  subTableInfoList: docModel.getSubTableInfoList() ?? [],
108312
+ fieldList,
108031
108313
  masterSlaveList
108032
108314
  });
108033
108315
  const docRuntimeMeta = {
@@ -108196,7 +108478,7 @@ function useDocumentFactory(props, payload) {
108196
108478
  bpmnFieldAuthMap
108197
108479
  } = freshExecute;
108198
108480
  const materialNo = paramsConfig?.materialNo || props.materialNo;
108199
- const { masterSlaveList } = await prepareDocumentFieldContext({
108481
+ const { fieldList, masterSlaveList } = await prepareDocumentFieldContext({
108200
108482
  requestInfo,
108201
108483
  payload,
108202
108484
  loadSubModels: false
@@ -108224,6 +108506,7 @@ function useDocumentFactory(props, payload) {
108224
108506
  query,
108225
108507
  instances: doc.model?.getWidgetInstances() ?? [],
108226
108508
  subTableInfoList: doc.model?.getSubTableInfoList() ?? [],
108509
+ fieldList,
108227
108510
  masterSlaveList
108228
108511
  });
108229
108512
  doc.dataManager.setRawData(rawData);
@@ -108489,101 +108772,12 @@ class FieldScope {
108489
108772
  this.fieldStatus.clear();
108490
108773
  }
108491
108774
  }
108492
- class BaseRegistry {
108493
- static instances = /* @__PURE__ */ new Map();
108494
- store = /* @__PURE__ */ new Map();
108495
- constructor() {
108496
- }
108497
- /**
108498
- * 获取单例实例
108499
- * @returns 子类实例
108500
- */
108501
- static getInstance() {
108502
- const className = this.name;
108503
- if (!BaseRegistry.instances.has(className)) {
108504
- BaseRegistry.instances.set(className, new this());
108505
- }
108506
- return BaseRegistry.instances.get(className);
108507
- }
108508
- /**
108509
- * 通用注册逻辑:按 suiteKey 注册一批 K-V 映射
108510
- * @param suiteKey 套件唯一标识
108511
- * @param items 要注册的键值对
108512
- * @param override 是否允许覆盖(默认false,子类可自定义)
108513
- */
108514
- register(suiteKey, items, override = false) {
108515
- if (!suiteKey || typeof suiteKey !== "string") {
108516
- throw new Error(`[${this.constructor.name}] 无效的suiteKey,必须是非空字符串`);
108517
- }
108518
- if (!items || Object.keys(items).length === 0) {
108519
- return;
108520
- }
108521
- let suiteMap = this.store.get(suiteKey);
108522
- if (!suiteMap) {
108523
- suiteMap = /* @__PURE__ */ new Map();
108524
- this.store.set(suiteKey, suiteMap);
108525
- }
108526
- Object.entries(items).forEach(([key, value]) => {
108527
- const typedKey = key;
108528
- if (!override && suiteMap.has(typedKey)) {
108529
- throw new Error(
108530
- `[${this.constructor.name}] 键 "${String(
108531
- typedKey
108532
- )}" 在套件 "${suiteKey}" 下已存在,如需覆盖请设置override: true`
108533
- );
108534
- }
108535
- suiteMap.set(typedKey, value);
108536
- });
108537
- }
108538
- /**
108539
- * 按 suiteKey 获取对应的内部Map
108540
- * @param suiteKey 套件唯一标识
108541
- * @returns 对应的Map
108542
- */
108543
- getSuiteMap(suiteKey) {
108544
- return this.store.get(suiteKey) ?? /* @__PURE__ */ new Map();
108545
- }
108546
- /**
108547
- * 按 suiteKey 获取所有值的数组
108548
- * @param suiteKey 套件唯一标识
108549
- * @returns 值数组
108550
- */
108551
- getSuiteValues(suiteKey) {
108552
- return Array.from(this.getSuiteMap(suiteKey).values());
108553
- }
108554
- /** 清空所有存储 */
108555
- clear() {
108556
- this.store.clear();
108557
- }
108558
- }
108559
108775
  class ComponentRegistry extends BaseRegistry {
108560
108776
  register(suiteKey, components) {
108561
108777
  super.register(suiteKey, components);
108562
108778
  }
108563
108779
  }
108564
108780
  const componentRegistry = ComponentRegistry.getInstance();
108565
- class BaseService {
108566
- suiteKey;
108567
- registry;
108568
- suiteMap;
108569
- constructor(suiteKey, registry2) {
108570
- this.suiteKey = suiteKey;
108571
- this.registry = registry2;
108572
- this.suiteMap = registry2.getSuiteMap(suiteKey);
108573
- }
108574
- /** 获取指定key的值 */
108575
- get(key) {
108576
- return this.suiteMap.get(key);
108577
- }
108578
- /** 检查是否存在指定key */
108579
- has(key) {
108580
- return this.suiteMap.has(key);
108581
- }
108582
- /** 获取当前套件下的所有值 */
108583
- getAll() {
108584
- return Array.from(this.suiteMap.values());
108585
- }
108586
- }
108587
108781
  class ComponentService extends BaseService {
108588
108782
  constructor(suiteKey) {
108589
108783
  super(suiteKey, ComponentRegistry.getInstance());
@@ -108627,32 +108821,6 @@ class PanelConfigService extends BaseService {
108627
108821
  super(suiteKey, PanelConfigRegistry.getInstance());
108628
108822
  }
108629
108823
  }
108630
- class FieldManifestRegistry extends BaseRegistry {
108631
- register(suiteKey, manifests) {
108632
- super.register(suiteKey, manifests);
108633
- }
108634
- }
108635
- const fieldManifestRegistry = FieldManifestRegistry.getInstance();
108636
- function resolveFieldManifestType(field) {
108637
- return field.bizType ?? field.type;
108638
- }
108639
- function resolveFieldStorageType(field) {
108640
- return field.type;
108641
- }
108642
- class FieldManifestService extends BaseService {
108643
- constructor(suiteKey) {
108644
- super(suiteKey, FieldManifestRegistry.getInstance());
108645
- }
108646
- getManifestBySuite() {
108647
- return this.getAll();
108648
- }
108649
- getManifestByType(fieldType) {
108650
- return this.get(fieldType);
108651
- }
108652
- getManifestForField(field) {
108653
- return this.getManifestByType(resolveFieldManifestType(field));
108654
- }
108655
- }
108656
108824
  class PaperWidgetManifestRegistry extends BaseRegistry {
108657
108825
  register(suiteKey, manifests) {
108658
108826
  super.register(suiteKey, manifests);
@@ -108729,6 +108897,9 @@ class SuiteRuntime {
108729
108897
  getMasterSlaveFieldList(modelKey) {
108730
108898
  return this.fieldService.getFieldList(modelKey)?.filter((i) => i.type === FIELD_TYPE.MASTERSLAVE) || [];
108731
108899
  }
108900
+ getFieldManifest(type4) {
108901
+ return this.fieldManifestService.getManifestByType(type4);
108902
+ }
108732
108903
  reloadFields(modelKey) {
108733
108904
  this.fieldService.clear(modelKey);
108734
108905
  return this.loadFieldList(modelKey);
@@ -114001,21 +114172,22 @@ const _sfc_main$2G = /* @__PURE__ */ defineComponent({
114001
114172
  if (!tmplBomCRef?.value?.tableControllers || !valuePath || !subFieldKey) return;
114002
114173
  const mcTableController = tmplBomCRef.value.tableControllers[valuePath];
114003
114174
  if (!mcTableController) return;
114004
- const { dataManager } = docInst.value;
114175
+ const { doc } = props;
114176
+ const { dataManager, mainModelKey } = doc;
114005
114177
  if (val === "confirm") {
114006
114178
  checkTargetRowThen(() => {
114007
114179
  mcTableController.confirm({ dataManager, subFieldKey, rowIndex }, subModelKey);
114008
114180
  });
114009
114181
  } else if (val === "scan") {
114010
114182
  checkTargetRowThen(() => {
114011
- mcTableController.openScanModal(tableName, { dataManager, subFieldKey }, subModelKey);
114183
+ mcTableController.openScanModal(tableName, { doc, subFieldKey, subModelKey });
114012
114184
  });
114013
114185
  } else if (val === "edit-row") {
114014
114186
  mcTableController.editRow({ dataManager, subFieldKey, rowIndex });
114015
114187
  } else if (val === "view-bom") {
114016
114188
  mcTableController.openBomModal();
114017
114189
  } else if (val === "change-rule") {
114018
- mcTableController.changeScanRule(props.doc.mainModelKey, subModelKey);
114190
+ mcTableController.changeScanRule(mainModelKey, subModelKey);
114019
114191
  }
114020
114192
  };
114021
114193
  const handleWarehouseInventoryAction = async (val) => {
@@ -114277,7 +114449,7 @@ const _sfc_main$2G = /* @__PURE__ */ defineComponent({
114277
114449
  };
114278
114450
  }
114279
114451
  });
114280
- const SubTableAction = /* @__PURE__ */ _export_sfc(_sfc_main$2G, [["__scopeId", "data-v-a4364e55"]]);
114452
+ const SubTableAction = /* @__PURE__ */ _export_sfc(_sfc_main$2G, [["__scopeId", "data-v-2b5fa953"]]);
114281
114453
  const _sfc_main$2F = /* @__PURE__ */ defineComponent({
114282
114454
  __name: "index",
114283
114455
  props: {
@@ -114806,7 +114978,7 @@ function buildWidgetFieldMetaMap(instances) {
114806
114978
  metaKey: runtimeValuePath,
114807
114979
  cellType: fieldMeta.fieldType,
114808
114980
  modelId: instance2.modelRef.id,
114809
- points: instance2?.widgetMeta?.extra?.biz?.[instance2.modelRef.id] || {}
114981
+ points: instance2?.widgetMeta?.extra?.biz?.[instance2.valuePath] || {}
114810
114982
  };
114811
114983
  map.set(runtimeValuePath, value);
114812
114984
  }
@@ -114868,7 +115040,8 @@ function validateDocDesigner(doc) {
114868
115040
  }
114869
115041
  const errors = [];
114870
115042
  const children = doc.model.document.body.children || [];
114871
- const fixedTableRegions = children.filter((w2) => w2.name === "w:tbl" && w2.hasBounded).flatMap((w2) => w2.bounded);
115043
+ const tables = children.filter((w2) => w2.name === "w:tbl");
115044
+ const fixedTableRegions = tables.flatMap((w2) => w2.bounded);
114872
115045
  if (fixedTableRegions.some((r) => !r.itemRegion)) {
114873
115046
  errors.push({
114874
115047
  code: "item-region-required",
@@ -114876,7 +115049,20 @@ function validateDocDesigner(doc) {
114876
115049
  source: "doc"
114877
115050
  });
114878
115051
  }
114879
- const tables = children.filter((w2) => w2.name === "w:tbl");
115052
+ const checkTableRegions = tables.flatMap((w2) => w2.checkTable);
115053
+ checkTableRegions.forEach(((r) => {
115054
+ if (!r.itemRegion) return;
115055
+ const { linkFieldKey } = parseValuePath(r.valuePath);
115056
+ const { start: { row: startRow, col: startCol }, end: { row: endRow, col: endCol } } = r.itemRegion;
115057
+ const linkFieldList = r.table.children.slice(startRow, endRow + 1).flatMap((row) => row.children.slice(startCol, endCol + 1)).flatMap((cell) => cell?.children ?? []).flatMap((child) => child?.children ?? []).filter((f) => f?.widgetMeta?.field?.subFieldKey);
115058
+ if (!linkFieldList.some((f) => f.widgetMeta.field.subFieldKey === linkFieldKey)) {
115059
+ errors.push({
115060
+ code: "link-field-required",
115061
+ message: "请拖入动态关联字段",
115062
+ source: "doc"
115063
+ });
115064
+ }
115065
+ }));
114880
115066
  for (const { hasTable, getRegions, message } of BARCODE_PARSING_RULE_TABLES) {
114881
115067
  const regions = tables.filter(hasTable).flatMap(getRegions);
114882
115068
  if (regions.some((r) => !r.widgetMeta.props.barcode_parsing_rules_id_)) {
@@ -114887,6 +115073,14 @@ function validateDocDesigner(doc) {
114887
115073
  });
114888
115074
  }
114889
115075
  }
115076
+ const materialConsumeTableRegions = children.filter((w2) => w2.name === "w:tbl" && w2.hasMaterialConsumeTable).flatMap((w2) => w2.materialConsumeTable);
115077
+ if (materialConsumeTableRegions.some((r) => !r.widgetMeta.props.barcode_parsing_rules_id_)) {
115078
+ errors.push({
115079
+ code: "barcode-parsing-rules-required",
115080
+ message: "请给物料消耗表设置条码解析规则",
115081
+ source: "doc"
115082
+ });
115083
+ }
114890
115084
  return createDesignerValidationResult(errors);
114891
115085
  }
114892
115086
  function validateDesigner(doc) {
@@ -114895,6 +115089,29 @@ function validateDesigner(doc) {
114895
115089
  errors.push(...docResult.errors);
114896
115090
  return createDesignerValidationResult(errors);
114897
115091
  }
115092
+ const getUnitedKey = (key1, key2) => `${key1 ?? ""}:${key2 ?? ""}`;
115093
+ const beforeBtnClick = async (params, doc) => {
115094
+ const { btn } = params;
115095
+ if (btn.type === "Submit" && btn.buttonType === "builtin") {
115096
+ const allChildren = doc.model?.document.body.children ?? [];
115097
+ const allocateTableFieldKeys = allChildren.filter((w2) => w2.name === "w:tbl" && w2.hasRepeating).flatMap((w2) => w2.repeating.filter((t) => t.widgetMeta.props.layoutType === "warehouse-allocate-table")).map((r) => r.valuePath.replace("$.", ""));
115098
+ const formData = doc.dataManager.getRawData();
115099
+ const hasRepeatWarehouseOrLocation = allocateTableFieldKeys.some((subTableFieldKey) => {
115100
+ const rows = formData[subTableFieldKey];
115101
+ return rows.some((row) => {
115102
+ return getUnitedKey(row.origin_warehouse_id_, row.origin_location_id_) === getUnitedKey(row.warehouse_id_, row.location_id_);
115103
+ });
115104
+ });
115105
+ if (hasRepeatWarehouseOrLocation) {
115106
+ const isPass = await triggerUtil.handle("OPEN_COMMON_CONFIRM_MODAL", {
115107
+ content: "调拨的源仓库和目标仓库一致,是否确认执行?"
115108
+ });
115109
+ if (!isPass) {
115110
+ throw new Error("用户取消提交");
115111
+ }
115112
+ }
115113
+ }
115114
+ };
114898
115115
  function useDocOperations(docRef) {
114899
115116
  function getDoc() {
114900
115117
  return docRef.value ?? null;
@@ -114996,6 +115213,11 @@ function useDocOperations(docRef) {
114996
115213
  doc.docRuntimeMeta.handleInfo.initDocModelJson = JSON.stringify(exportModel());
114997
115214
  doc.docRuntimeMeta.handleInfo.initRawDataSnapshot = cloneDeep(doc.dataManager.getRawData());
114998
115215
  }
115216
+ async function beforeBtnClick$1(params) {
115217
+ const doc = getDoc();
115218
+ if (!doc) return;
115219
+ await Promise.all([beforeBtnClick(params, doc)]);
115220
+ }
114999
115221
  return {
115000
115222
  validate,
115001
115223
  validateDesigner: validateDesigner$1,
@@ -115005,7 +115227,8 @@ function useDocOperations(docRef) {
115005
115227
  computeBaselineChanges,
115006
115228
  setAnnotation,
115007
115229
  getUnsavedChanges,
115008
- markAsSaved
115230
+ markAsSaved,
115231
+ beforeBtnClick: beforeBtnClick$1
115009
115232
  };
115010
115233
  }
115011
115234
  function useDocController(factory2, ops) {
@@ -115102,6 +115325,9 @@ function useDocController(factory2, ops) {
115102
115325
  markAsSaved() {
115103
115326
  ops.markAsSaved();
115104
115327
  },
115328
+ beforeBtnClick(params) {
115329
+ return ops.beforeBtnClick(params);
115330
+ },
115105
115331
  setAnnotation(ids, list) {
115106
115332
  ops.setAnnotation(ids, list);
115107
115333
  }
@@ -117420,6 +117646,7 @@ function createDesignFieldToWidgetFactory(getFieldManifestForField) {
117420
117646
  isLinkedModelField: false,
117421
117647
  fieldLink: field.key,
117422
117648
  modelLink: field.modelKey,
117649
+ belongingObject: field.belongingObject,
117423
117650
  valuePath,
117424
117651
  ...opts.parentFieldKey ? { subFieldKey: opts.parentFieldKey } : void 0
117425
117652
  },
@@ -117645,9 +117872,7 @@ const _sfc_main$2n = /* @__PURE__ */ defineComponent({
117645
117872
  const paletteField = toPaletteField(field);
117646
117873
  if (!paletteField) return [];
117647
117874
  if (paletteField?.isCascade) {
117648
- paletteField.children = fields2.value.filter((f) => {
117649
- return f.belongingObject === paletteField.field.key && f.createType === "USER_DEFINED";
117650
- }).map(toPaletteField).filter(Boolean);
117875
+ paletteField.children = fields2.value.filter((f) => f.belongingObject === paletteField.field.key).map(toPaletteField).filter(Boolean);
117651
117876
  }
117652
117877
  return [paletteField];
117653
117878
  });
@@ -117699,7 +117924,7 @@ const _sfc_main$2n = /* @__PURE__ */ defineComponent({
117699
117924
  };
117700
117925
  }
117701
117926
  });
117702
- const ToolkitContentFields = /* @__PURE__ */ _export_sfc(_sfc_main$2n, [["__scopeId", "data-v-811ea2df"]]);
117927
+ const ToolkitContentFields = /* @__PURE__ */ _export_sfc(_sfc_main$2n, [["__scopeId", "data-v-a7322f3e"]]);
117703
117928
  const _hoisted_1$1B = { class: "toolkit-content-widgets" };
117704
117929
  const _hoisted_2$Z = { key: 0 };
117705
117930
  const _hoisted_3$I = ["data-type", "draggable", "onDragstart"];
@@ -130149,7 +130374,10 @@ const _sfc_main$Y = /* @__PURE__ */ defineComponent({
130149
130374
  FIELD_TYPE.MFG_ORDER,
130150
130375
  FIELD_TYPE.RECORD_NO,
130151
130376
  FIELD_TYPE.ORDER_NO,
130152
- FIELD_TYPE.TRACE_DATE
130377
+ FIELD_TYPE.EXTERNAL_REF_NO,
130378
+ FIELD_TYPE.TRACE_DATE,
130379
+ FIELD_TYPE.WAREHOUSE_RECEIPT_NO,
130380
+ FIELD_TYPE.WAREHOUSE_RECEIPT_DATE
130153
130381
  ];
130154
130382
  if (!allowFieldTypes.includes(meta.field.fieldType)) {
130155
130383
  GctMessage.warning(props.customFieldMsg ?? "能绑定数值、文本、日期和追溯类型的字段");
@@ -130199,7 +130427,7 @@ const _sfc_main$Y = /* @__PURE__ */ defineComponent({
130199
130427
  };
130200
130428
  }
130201
130429
  });
130202
- const AttachFieldEditor = /* @__PURE__ */ _export_sfc(_sfc_main$Y, [["__scopeId", "data-v-abcd1f7d"]]);
130430
+ const AttachFieldEditor = /* @__PURE__ */ _export_sfc(_sfc_main$Y, [["__scopeId", "data-v-fc484054"]]);
130203
130431
  const _hoisted_1$Q = { class: "option-container" };
130204
130432
  const _hoisted_2$q = { class: "option-item" };
130205
130433
  const _hoisted_3$f = { class: "option" };
@@ -136017,6 +136245,22 @@ const selectStrategyMap = {
136017
136245
  },
136018
136246
  transform: transformLotData
136019
136247
  },
136248
+ [FIELD_TYPE.WAREHOUSE]: {
136249
+ columnsKey: "ref",
136250
+ fetcher: "ref",
136251
+ buildQuery({ keyword, searchField, extraParams }) {
136252
+ return buildRefQuickSearchQuery(searchField, keyword, extraParams);
136253
+ },
136254
+ transform: transformLotData
136255
+ },
136256
+ [FIELD_TYPE.LOCATION]: {
136257
+ columnsKey: "ref",
136258
+ fetcher: "ref",
136259
+ buildQuery({ keyword, searchField, extraParams }) {
136260
+ return buildRefQuickSearchQuery(searchField, keyword, extraParams);
136261
+ },
136262
+ transform: transformLotData
136263
+ },
136020
136264
  [FIELD_TYPE.REF]: {
136021
136265
  columnsKey: "ref",
136022
136266
  fetcher: "ref",