@gct-paas/word 0.1.63-beta.6 → 0.1.63-beta.7

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.
@@ -0,0 +1,7 @@
1
+ import { Doc } from '../../../../core';
2
+ import { DataEnricherRegistration } from '../../../../core/data';
3
+ import { BusinessSubTableType } from '../../types';
4
+ /**
5
+ * 按业务表类型,仅为该表内的「生产批次号」补全 _href_
6
+ */
7
+ export declare function createProductionContainerHyperlinkEnricher(doc: Doc, tableType: BusinessSubTableType): DataEnricherRegistration;
package/dist/index.es.js CHANGED
@@ -83937,6 +83937,10 @@ function getSelectStrategy(fieldType) {
83937
83937
  if (strategy) return strategy;
83938
83938
  return selectStrategyMap[FIELD_TYPE.REF];
83939
83939
  }
83940
+ const EXCLUDE_FROM_FIELD_TYPES = /* @__PURE__ */ new Set([FIELD_TYPE.BOOLEAN]);
83941
+ function isSelectableFromField(field) {
83942
+ return !EXCLUDE_FROM_FIELD_TYPES.has(field.type);
83943
+ }
83940
83944
  function buildFromFieldTree(currentField, refModelFieldList) {
83941
83945
  return [
83942
83946
  {
@@ -83945,7 +83949,7 @@ function buildFromFieldTree(currentField, refModelFieldList) {
83945
83949
  icon: currentField.icon,
83946
83950
  iconVersion: currentField.version,
83947
83951
  iconColor: "#026ac8",
83948
- children: refModelFieldList.map((item) => ({
83952
+ children: refModelFieldList.filter(isSelectableFromField).map((item) => ({
83949
83953
  label: item.name,
83950
83954
  value: item.key,
83951
83955
  icon: item.icon,
@@ -83976,8 +83980,22 @@ function isSubTableAutofillRule(rule) {
83976
83980
  function isAutofillSubTableTarget(rule, templatePath) {
83977
83981
  return isSubTableAutofillRule(rule) || parseValuePath(templatePath).isSubTable;
83978
83982
  }
83983
+ function resolveLegacyToSubFieldKey(rule, opts) {
83984
+ if (rule.toSubFieldKey) return rule.toSubFieldKey;
83985
+ if (!isSubTableAutofillRule(rule)) return void 0;
83986
+ if (opts?.sourceValuePath) {
83987
+ const parentFieldKey = parseValuePath(opts.sourceValuePath).parentFieldKey;
83988
+ if (parentFieldKey) return parentFieldKey;
83989
+ }
83990
+ return void 0;
83991
+ }
83992
+ function normalizeAutofillRule(rule, opts) {
83993
+ const toSubFieldKey = resolveLegacyToSubFieldKey(rule, opts);
83994
+ if (!toSubFieldKey || toSubFieldKey === rule.toSubFieldKey) return rule;
83995
+ return { ...rule, toSubFieldKey };
83996
+ }
83979
83997
  function buildAutofillTargetTemplatePath(rule) {
83980
- const { toField, toSubFieldKey, toSubModel } = rule;
83998
+ const { toField, toSubFieldKey } = rule;
83981
83999
  if (!toField) return void 0;
83982
84000
  if (isSubTableAutofillRule(rule) && !toSubFieldKey) return void 0;
83983
84001
  return generateValuePath(toField, isSubTableAutofillRule(rule) ? toSubFieldKey : "");
@@ -84022,10 +84040,15 @@ function applyAutofillRules(record, autofillRules, opts) {
84022
84040
  for (const ruleItem of autofillRules) {
84023
84041
  const { fromField } = ruleItem;
84024
84042
  if (!fromField) continue;
84025
- const templatePath = buildAutofillTargetTemplatePath(ruleItem);
84043
+ const normalizedRule = normalizeAutofillRule(ruleItem, opts);
84044
+ const templatePath = buildAutofillTargetTemplatePath(normalizedRule);
84026
84045
  if (!templatePath) continue;
84027
84046
  const value = resolveAutofillSourceValue(record, fromField);
84028
- for (const runtimeValuePath of resolveAutofillRuntimeValuePaths(templatePath, ruleItem, opts)) {
84047
+ for (const runtimeValuePath of resolveAutofillRuntimeValuePaths(
84048
+ templatePath,
84049
+ normalizedRule,
84050
+ opts
84051
+ )) {
84029
84052
  result[runtimeValuePath] = value;
84030
84053
  }
84031
84054
  }
@@ -89372,6 +89395,53 @@ const profile$1 = {
89372
89395
  labelBjColor: "rgba(33, 33, 213, 0.8)"
89373
89396
  }
89374
89397
  };
89398
+ const PRODUCTION_CONTAINER_FIELD_KEY = "production_container_id_";
89399
+ async function resolveHrefByLabel(path, doc) {
89400
+ const materialNo = doc.dataManager.get(getLabelPath(path));
89401
+ if (!isPresent(materialNo)) return null;
89402
+ try {
89403
+ const bool = await api.apaas.modelComprehensive.postBizServiceModelCategoryModelKeyBsKey(
89404
+ {
89405
+ bsKey: "biz_judge_jump",
89406
+ modelKey: "gct_edhr_instance",
89407
+ modelCategory: "entity"
89408
+ },
89409
+ { materialNo },
89410
+ {}
89411
+ );
89412
+ return bool ? String(materialNo) : null;
89413
+ } catch {
89414
+ return null;
89415
+ }
89416
+ }
89417
+ function createProductionContainerHyperlinkEnricher(doc, tableType) {
89418
+ const subFieldKeys = new Set(
89419
+ TableRuntimeContext.collectAll(doc).filter((ctx) => ctx.profile.type === tableType).map((ctx) => ctx.subFieldKey)
89420
+ );
89421
+ return createCompanionEnricher(
89422
+ {
89423
+ id: `hyperlink:${tableType}:production-container`,
89424
+ valuePathTemplate: `*.${PRODUCTION_CONTAINER_FIELD_KEY}`,
89425
+ match: (path) => {
89426
+ const parsed = parseSubtableFieldPath(path);
89427
+ if (!parsed || parsed.fieldKey !== PRODUCTION_CONTAINER_FIELD_KEY) return false;
89428
+ return subFieldKeys.has(parsed.subFieldKey);
89429
+ },
89430
+ doc
89431
+ },
89432
+ {
89433
+ cacheNamespace: "hyperlink_enrich_resolve",
89434
+ defaultIdPrefix: "hyperlink:",
89435
+ getCompanionPath: getHrefPath,
89436
+ buildCacheKey: (path, value, currentDoc) => ({
89437
+ path,
89438
+ value,
89439
+ materialNo: currentDoc.dataManager.get(getLabelPath(path))
89440
+ }),
89441
+ resolveCompanion: (path, _value, currentDoc) => resolveHrefByLabel(path, currentDoc)
89442
+ }
89443
+ );
89444
+ }
89375
89445
  function handleProductionContainerChange$1(doc, subFieldKey, rowIndex) {
89376
89446
  const ctx = getRowChangeCtx(doc, subFieldKey, rowIndex);
89377
89447
  if (!ctx) return;
@@ -89421,81 +89491,12 @@ function resolvePretreatmentListRemoteSync(records, ctx) {
89421
89491
  }
89422
89492
  };
89423
89493
  }
89494
+ registerStaticLabelEnricher((doc) => createProductionContainerHyperlinkEnricher(doc, TABLE_TYPE$1));
89424
89495
  registerRowHandler(TABLE_TYPE$1, "on-production-container-change", handleProductionContainerChange$1);
89425
89496
  registerRowHandler(TABLE_TYPE$1, "on-mfg-order-change", handleMfgOrderChange);
89426
89497
  registerRowHandler(TABLE_TYPE$1, "on-material-container-no-change", handleMaterialContainerNoChange);
89427
89498
  registerRowHandler(TABLE_TYPE$1, "on-product-change", handleProductChange);
89428
89499
  registerRemoteSyncApplyResolver(TABLE_TYPE$1, "remote-sync", resolvePretreatmentListRemoteSync);
89429
- async function openPretreatmentListScan(options) {
89430
- const { doc, subRenderer, subFieldKey } = options;
89431
- const regionProps = subRenderer.widgetMeta?.props;
89432
- await openScanWithParseRule({
89433
- regionId: subRenderer.id,
89434
- barcodeParsingRulesId: regionProps?.barcode_parsing_rules_id_,
89435
- modalEvent: "OPEN_PRETREATMENT_LIST_TABLE_SCAN_MODAL",
89436
- title: subRenderer.tableName || "操作",
89437
- onScan: async (scanInput, { parseRuleProps, scanRuleInfo }) => {
89438
- const ctx = TableRuntimeContext.find(doc, subFieldKey);
89439
- const remoteSync = ctx?.profile.remoteSync;
89440
- if (!ctx || !remoteSync) return;
89441
- const parsed = getParseRuleValue$1(scanInput.str, scanRuleInfo.rules_);
89442
- if (!parsed.lot) {
89443
- GctMessage.error("条码中未解析到批次号");
89444
- return;
89445
- }
89446
- const remoteSyncEngine = new RemoteSyncEngine(doc);
89447
- const requestBody = remoteSyncEngine.buildBody(
89448
- {
89449
- name_: parsed.lot
89450
- },
89451
- remoteSync
89452
- );
89453
- if (!requestBody) {
89454
- GctMessage.error("扫描的物料批次不存在");
89455
- return;
89456
- }
89457
- const { queryData: typeQueryData, exp: typeExp } = buildLikeQuery(
89458
- [],
89459
- "",
89460
- {
89461
- "production_identification_type_.eq": "MATERIAL",
89462
- "production_identification_type_.isNull": null
89463
- },
89464
- {
89465
- filterCombine: "or"
89466
- }
89467
- );
89468
- const queryData = {
89469
- ...typeQueryData,
89470
- ...requestBody
89471
- };
89472
- const nameKeys = Object.keys(requestBody);
89473
- const nameExp = nameKeys.length <= 1 ? nameKeys[0] ?? "" : `AND(${nameKeys.join(",")})`;
89474
- const exp = typeExp && nameExp ? `AND(${nameExp},${typeExp})` : nameExp || typeExp;
89475
- const result = await callBizService(remoteSync.api, {
89476
- query: queryData,
89477
- exp
89478
- });
89479
- const records = unwrapBizServiceList(result);
89480
- if (!records.length) {
89481
- GctMessage.error("扫描的物料批次不存在");
89482
- return;
89483
- }
89484
- const fillData = parseRuleProps?.fillMapArr?.length ? calcFillData(parsed, parseRuleProps.fillMapArr) : {};
89485
- const rows = doc.dataManager.getRawData()[subFieldKey] || [];
89486
- remoteSyncEngine.applySyncResult(ctx, rows.length, remoteSync, records, "", {
89487
- qty_: parsed.qty,
89488
- ...fillData
89489
- });
89490
- }
89491
- });
89492
- }
89493
- async function changePretreatmentListParseRule(options) {
89494
- return changeBarcodeParseRule({
89495
- ...options,
89496
- modalEvent: "OPEN_PRETREATMENT_LIST_TABLE_PARSE_RULE_MODAL"
89497
- });
89498
- }
89499
89500
  const F$1 = {
89500
89501
  /** 产品 */
89501
89502
  product: "product_id_",
@@ -89667,71 +89668,9 @@ function handleProductionContainerChange(doc, subFieldKey, rowIndex) {
89667
89668
  if (!isBlank(ctx.row[F$1.productionContainer])) return;
89668
89669
  applyRowClears(ctx, CLEAR_ON_PROD_CONTAINER_EMPTY);
89669
89670
  }
89671
+ registerStaticLabelEnricher((doc) => createProductionContainerHyperlinkEnricher(doc, TABLE_TYPE));
89670
89672
  registerRowHandler(TABLE_TYPE, "on-production-container-change", handleProductionContainerChange);
89671
89673
  registerRemoteSyncApplyResolver(TABLE_TYPE, "remote-sync", resolveEntrustSterilBatchListRemoteSync);
89672
- async function openEntrustSterilBatchListScan(options) {
89673
- const { doc, subRenderer, subFieldKey } = options;
89674
- const regionProps = subRenderer.widgetMeta?.props;
89675
- await openScanWithParseRule({
89676
- regionId: subRenderer.id,
89677
- barcodeParsingRulesId: regionProps?.barcode_parsing_rules_id_,
89678
- modalEvent: "OPEN_ENTRUST_STERIL_BATCH_LIST_TABLE_SCAN_MODAL",
89679
- title: subRenderer.tableName || "操作",
89680
- onScan: async (scanInput, { parseRuleProps, scanRuleInfo }) => {
89681
- const ctx = TableRuntimeContext.find(doc, subFieldKey);
89682
- const remoteSync = ctx?.profile.remoteSync;
89683
- if (!ctx || !remoteSync) return;
89684
- const parsed = getParseRuleValue$1(scanInput.str, scanRuleInfo.rules_);
89685
- if (!parsed.lot) {
89686
- GctMessage.error("条码中未解析到批次号");
89687
- return;
89688
- }
89689
- const remoteSyncEngine = new RemoteSyncEngine(doc);
89690
- const requestBody = remoteSyncEngine.buildBody(
89691
- {
89692
- name_: parsed.lot
89693
- },
89694
- remoteSync
89695
- );
89696
- if (!requestBody) {
89697
- GctMessage.error("扫描的物料批次不存在");
89698
- return;
89699
- }
89700
- const { queryData: typeQueryData, exp: typeExp } = buildLikeQuery([], "", {
89701
- "production_identification_type_.in": ["LOT", "SN"],
89702
- is_rework_: 0
89703
- });
89704
- const queryData = {
89705
- ...typeQueryData,
89706
- ...requestBody
89707
- };
89708
- const nameKeys = Object.keys(requestBody);
89709
- const nameExp = nameKeys.length <= 1 ? nameKeys[0] ?? "" : `AND(${nameKeys.join(",")})`;
89710
- const exp = typeExp && nameExp ? `AND(${nameExp},${typeExp})` : nameExp || typeExp;
89711
- const result = await callBizService(remoteSync.api, {
89712
- query: queryData,
89713
- exp
89714
- });
89715
- const records = unwrapBizServiceList(result);
89716
- if (!records.length) {
89717
- GctMessage.error("扫描的物料批次不存在");
89718
- return;
89719
- }
89720
- const fillData = parseRuleProps?.fillMapArr?.length ? calcFillData(parsed, parseRuleProps.fillMapArr) : {};
89721
- const rows = doc.dataManager.getRawData()[subFieldKey] || [];
89722
- remoteSyncEngine.applySyncResult(ctx, rows.length, remoteSync, records, "", {
89723
- qty_: parsed.qty,
89724
- ...fillData
89725
- });
89726
- }
89727
- });
89728
- }
89729
- async function changeEntrustSterilBatchListParseRule(options) {
89730
- return changeBarcodeParseRule({
89731
- ...options,
89732
- modalEvent: "OPEN_ENTRUST_STERIL_BATCH_LIST_TABLE_PARSE_RULE_MODAL"
89733
- });
89734
- }
89735
89674
  const ALL_TABLE_PROFILES = [
89736
89675
  profile$a,
89737
89676
  profile$9,
@@ -102766,6 +102705,10 @@ class LayoutManager {
102766
102705
  while (remainingTable) {
102767
102706
  const page = this.pageContext.page;
102768
102707
  const pageRemainingSize = page.getRemainingSize();
102708
+ const firstRowHeight = remainingTable?.children?.[0]?._height;
102709
+ if (firstRowHeight && firstRowHeight > pageRemainingSize) {
102710
+ break;
102711
+ }
102769
102712
  const { cur, next } = splitTableByHeight(remainingTable, pageRemainingSize);
102770
102713
  const newRowIds = [];
102771
102714
  const trModelIds = cur?.getChildren().map((item) => item.modelRef?.id) || [];
@@ -108073,6 +108016,34 @@ const DefaultDocxJson = {
108073
108016
  fontTable,
108074
108017
  footers
108075
108018
  };
108019
+ const updatePgSzElInfo = (pgSz, paperSize, options) => {
108020
+ const direction = options?.direction ?? "portrait";
108021
+ let width = 11906;
108022
+ let height = 16838;
108023
+ switch (paperSize) {
108024
+ case PaperSizeConst.A3:
108025
+ width = 16838;
108026
+ height = 23811;
108027
+ break;
108028
+ case PaperSizeConst.A5:
108029
+ width = 8391;
108030
+ height = 11906;
108031
+ break;
108032
+ case PaperSizeConst.CUSTOM:
108033
+ width = Number(UnitConverter.mmToTwip(options.width));
108034
+ height = Number(UnitConverter.mmToTwip(options.height));
108035
+ break;
108036
+ default:
108037
+ width = 11906;
108038
+ height = 16838;
108039
+ break;
108040
+ }
108041
+ if (direction === "landscape") {
108042
+ [width, height] = [height, width];
108043
+ }
108044
+ pgSz["@attrs"]["w:w"] = String(width);
108045
+ pgSz["@attrs"]["w:h"] = String(height);
108046
+ };
108076
108047
  class RuntimeJsonBuilder {
108077
108048
  json;
108078
108049
  constructor(base) {
@@ -108097,32 +108068,7 @@ class RuntimeJsonBuilder {
108097
108068
  setPageSize(paperSize, options) {
108098
108069
  const pgSz = this.findNode(this.json.document, "w:pgSz");
108099
108070
  if (!pgSz) return this;
108100
- const direction = options?.direction ?? "portrait";
108101
- let width = 11906;
108102
- let height = 16838;
108103
- switch (paperSize) {
108104
- case PaperSizeConst.A3:
108105
- width = 16838;
108106
- height = 23811;
108107
- break;
108108
- case PaperSizeConst.A5:
108109
- width = 8391;
108110
- height = 11906;
108111
- break;
108112
- case PaperSizeConst.CUSTOM:
108113
- width = Number(UnitConverter.mmToTwip(options.width));
108114
- height = Number(UnitConverter.mmToTwip(options.height));
108115
- break;
108116
- default:
108117
- width = 11906;
108118
- height = 16838;
108119
- break;
108120
- }
108121
- if (direction === "landscape") {
108122
- [width, height] = [height, width];
108123
- }
108124
- pgSz["@attrs"]["w:w"] = String(width);
108125
- pgSz["@attrs"]["w:h"] = String(height);
108071
+ updatePgSzElInfo(pgSz, paperSize, options);
108126
108072
  return this;
108127
108073
  }
108128
108074
  /**
@@ -108841,7 +108787,17 @@ class MCDataUtil {
108841
108787
  * @param rowPath $.f_sub[n] n 必须为数字
108842
108788
  */
108843
108789
  static updateConfirmableFieldsDisablement(option) {
108844
- const fields2 = ["product_id_", "material_no_", "qty_", "routing_operation_id_"];
108790
+ const fields2 = [
108791
+ "product_id_",
108792
+ "material_no_",
108793
+ "qty_",
108794
+ "routing_operation_id_",
108795
+ "qty_required_uom_id_",
108796
+ "qty_uom_id_",
108797
+ "qty_transfer_",
108798
+ "qty_transfer_uom_id_",
108799
+ "transfer_formula_"
108800
+ ];
108845
108801
  this._updateDisablement({ ...option, fields: fields2 });
108846
108802
  }
108847
108803
  /**
@@ -109738,6 +109694,21 @@ class SingleTemplateStrategy extends DocRequestStrategy {
109738
109694
  direction: requestInfo.direction
109739
109695
  }).build();
109740
109696
  requestInfo.runtimeJson = JSON.stringify(json);
109697
+ } else {
109698
+ const jsonObj = JSON.parse(requestInfo.runtimeJson);
109699
+ const pgSzEl = jsonObj.document.elements[0].elements.find((el) => el.name === "w:sectPr")?.elements.find((el) => el.name === "w:pgSz");
109700
+ if (pgSzEl) {
109701
+ updatePgSzElInfo(
109702
+ pgSzEl,
109703
+ requestInfo.paperSize || PaperSizeConst.A4,
109704
+ {
109705
+ width: requestInfo.width,
109706
+ height: requestInfo.height,
109707
+ direction: requestInfo.direction
109708
+ }
109709
+ );
109710
+ }
109711
+ requestInfo.runtimeJson = JSON.stringify(jsonObj);
109741
109712
  }
109742
109713
  return {
109743
109714
  id,
@@ -116314,31 +116285,19 @@ const _hoisted_8$e = {
116314
116285
  };
116315
116286
  const _hoisted_9$a = { class: "item-icon" };
116316
116287
  const _hoisted_10$8 = { class: "item-icon scale-large" };
116317
- const _hoisted_11$6 = {
116318
- key: 2,
116319
- class: "action-menu"
116320
- };
116288
+ const _hoisted_11$6 = { class: "action-menu" };
116321
116289
  const _hoisted_12$5 = { class: "item-icon" };
116322
- const _hoisted_13$4 = { class: "item-icon scale-large" };
116323
- const _hoisted_14$3 = {
116324
- key: 3,
116325
- class: "action-menu"
116326
- };
116327
- const _hoisted_15$2 = { class: "item-icon" };
116290
+ const _hoisted_13$4 = { class: "item-icon" };
116291
+ const _hoisted_14$3 = { class: "item-icon scale-large" };
116292
+ const _hoisted_15$2 = { class: "item-label flex-between-center" };
116328
116293
  const _hoisted_16$1 = { class: "item-icon scale-large" };
116329
- const _hoisted_17 = { class: "action-menu" };
116330
- const _hoisted_18 = { class: "item-icon" };
116331
- const _hoisted_19 = { class: "item-icon" };
116332
- const _hoisted_20 = { class: "item-icon scale-large" };
116333
- const _hoisted_21 = { class: "item-label flex-between-center" };
116334
- const _hoisted_22 = { class: "item-icon scale-large" };
116335
- const _hoisted_23 = { class: "item-label flex-between-center" };
116336
- const _hoisted_24 = {
116337
- key: 4,
116294
+ const _hoisted_17 = { class: "item-label flex-between-center" };
116295
+ const _hoisted_18 = {
116296
+ key: 2,
116338
116297
  class: "action-menu"
116339
116298
  };
116340
- const _hoisted_25 = { class: "item-icon" };
116341
- const _hoisted_26 = { class: "more-btn" };
116299
+ const _hoisted_19 = { class: "item-icon" };
116300
+ const _hoisted_20 = { class: "more-btn" };
116342
116301
  const _sfc_main$2T = /* @__PURE__ */ defineComponent({
116343
116302
  __name: "sub-table-action",
116344
116303
  props: {
@@ -116468,30 +116427,6 @@ const _sfc_main$2T = /* @__PURE__ */ defineComponent({
116468
116427
  await changeWarehouseInventoryParseRule({ doc, subRenderer, subModelKey });
116469
116428
  }
116470
116429
  };
116471
- const handleEntrustSterilBatchListAction = async (val) => {
116472
- const { doc } = props;
116473
- const { subRenderer, valuePath, subFieldKey, subModelKey } = getCtx();
116474
- if (!valuePath || !subFieldKey) return;
116475
- if (val === "scan") {
116476
- checkTargetRowThen(() => {
116477
- openEntrustSterilBatchListScan({ doc, subRenderer, subFieldKey });
116478
- });
116479
- } else if (val === "change-rule") {
116480
- await changeEntrustSterilBatchListParseRule({ doc, subRenderer, subModelKey });
116481
- }
116482
- };
116483
- const handlePretreatmentListAction = async (val) => {
116484
- const { doc } = props;
116485
- const { subRenderer, valuePath, subFieldKey, subModelKey } = getCtx();
116486
- if (!valuePath || !subFieldKey) return;
116487
- if (val === "scan") {
116488
- checkTargetRowThen(() => {
116489
- openPretreatmentListScan({ doc, subRenderer, subFieldKey });
116490
- });
116491
- } else if (val === "change-rule") {
116492
- await changePretreatmentListParseRule({ doc, subRenderer, subModelKey });
116493
- }
116494
- };
116495
116430
  const getIsAddable = () => {
116496
116431
  if (subTableType.value.isMaterialConsume) {
116497
116432
  const { subFieldKey } = getCtx();
@@ -116585,7 +116520,7 @@ const _sfc_main$2T = /* @__PURE__ */ defineComponent({
116585
116520
  popper: withCtx(() => [
116586
116521
  createElementVNode("div", _hoisted_2$1e, [
116587
116522
  subTableType.value.isMaterialConsume ? (openBlock(), createElementBlock("div", _hoisted_3$V, [
116588
- _cache[24] || (_cache[24] = createElementVNode("div", { class: "menu-title" }, "业务操作", -1)),
116523
+ _cache[20] || (_cache[20] = createElementVNode("div", { class: "menu-title" }, "业务操作", -1)),
116589
116524
  actionInfo.value.canEdit ? (openBlock(), createElementBlock("div", {
116590
116525
  key: 0,
116591
116526
  class: "menu-item",
@@ -116594,7 +116529,7 @@ const _sfc_main$2T = /* @__PURE__ */ defineComponent({
116594
116529
  createElementVNode("div", _hoisted_4$I, [
116595
116530
  createVNode(unref(GctIcon), { icon: "icon-bianji" })
116596
116531
  ]),
116597
- _cache[20] || (_cache[20] = createElementVNode("div", { class: "item-label" }, "编辑行", -1))
116532
+ _cache[16] || (_cache[16] = createElementVNode("div", { class: "item-label" }, "编辑行", -1))
116598
116533
  ])) : createCommentVNode("", true),
116599
116534
  __props.isLastRow ? (openBlock(), createElementBlock("div", {
116600
116535
  key: 1,
@@ -116604,7 +116539,7 @@ const _sfc_main$2T = /* @__PURE__ */ defineComponent({
116604
116539
  createElementVNode("div", _hoisted_5$y, [
116605
116540
  createVNode(unref(GctIcon), { icon: "icon-saoyisao" })
116606
116541
  ]),
116607
- _cache[21] || (_cache[21] = createElementVNode("div", { class: "item-label" }, "条码扫描", -1))
116542
+ _cache[17] || (_cache[17] = createElementVNode("div", { class: "item-label" }, "条码扫描", -1))
116608
116543
  ])) : createCommentVNode("", true),
116609
116544
  __props.isLastRow ? (openBlock(), createElementBlock("div", {
116610
116545
  key: 2,
@@ -116614,7 +116549,7 @@ const _sfc_main$2T = /* @__PURE__ */ defineComponent({
116614
116549
  createElementVNode("div", _hoisted_6$m, [
116615
116550
  createVNode(unref(GctIcon), { icon: "icon-a-bom11" })
116616
116551
  ]),
116617
- _cache[22] || (_cache[22] = createElementVNode("div", { class: "item-label" }, "BOM", -1))
116552
+ _cache[18] || (_cache[18] = createElementVNode("div", { class: "item-label" }, "BOM", -1))
116618
116553
  ])) : createCommentVNode("", true),
116619
116554
  __props.isLastRow ? (openBlock(), createElementBlock("div", {
116620
116555
  key: 3,
@@ -116624,11 +116559,11 @@ const _sfc_main$2T = /* @__PURE__ */ defineComponent({
116624
116559
  createElementVNode("div", _hoisted_7$h, [
116625
116560
  createVNode(unref(GctIcon), { icon: "icon-tiaomajiexi" })
116626
116561
  ]),
116627
- _cache[23] || (_cache[23] = createElementVNode("div", { class: "item-label" }, "条码解析规则变更", -1))
116562
+ _cache[19] || (_cache[19] = createElementVNode("div", { class: "item-label" }, "条码解析规则变更", -1))
116628
116563
  ])) : createCommentVNode("", true)
116629
116564
  ])) : createCommentVNode("", true),
116630
116565
  subTableType.value.isWarehouseInventory ? (openBlock(), createElementBlock("div", _hoisted_8$e, [
116631
- _cache[27] || (_cache[27] = createElementVNode("div", { class: "menu-title" }, "业务操作", -1)),
116566
+ _cache[23] || (_cache[23] = createElementVNode("div", { class: "menu-title" }, "业务操作", -1)),
116632
116567
  createElementVNode("div", {
116633
116568
  class: "menu-item",
116634
116569
  onClick: _cache[4] || (_cache[4] = ($event) => handleWarehouseInventoryAction("scan"))
@@ -116636,7 +116571,7 @@ const _sfc_main$2T = /* @__PURE__ */ defineComponent({
116636
116571
  createElementVNode("div", _hoisted_9$a, [
116637
116572
  createVNode(unref(GctIcon), { icon: "icon-saoyisao" })
116638
116573
  ]),
116639
- _cache[25] || (_cache[25] = createElementVNode("div", { class: "item-label" }, " 条码扫描 ", -1))
116574
+ _cache[21] || (_cache[21] = createElementVNode("div", { class: "item-label" }, " 条码扫描 ", -1))
116640
116575
  ]),
116641
116576
  createElementVNode("div", {
116642
116577
  class: "menu-item",
@@ -116645,89 +116580,47 @@ const _sfc_main$2T = /* @__PURE__ */ defineComponent({
116645
116580
  createElementVNode("div", _hoisted_10$8, [
116646
116581
  createVNode(unref(GctIcon), { icon: "icon-tiaomajiexi" })
116647
116582
  ]),
116648
- _cache[26] || (_cache[26] = createElementVNode("div", { class: "item-label" }, " 条码解析规则变更 ", -1))
116583
+ _cache[22] || (_cache[22] = createElementVNode("div", { class: "item-label" }, " 条码解析规则变更 ", -1))
116649
116584
  ])
116650
116585
  ])) : createCommentVNode("", true),
116651
- subTableType.value.isEntrustSterilBatchList ? (openBlock(), createElementBlock("div", _hoisted_11$6, [
116652
- _cache[30] || (_cache[30] = createElementVNode("div", { class: "menu-title" }, "业务操作", -1)),
116586
+ createElementVNode("div", _hoisted_11$6, [
116587
+ _cache[28] || (_cache[28] = createElementVNode("div", { class: "menu-title" }, "行编辑", -1)),
116653
116588
  createElementVNode("div", {
116654
116589
  class: "menu-item",
116655
- onClick: _cache[6] || (_cache[6] = ($event) => handleEntrustSterilBatchListAction("scan"))
116590
+ onClick: _cache[6] || (_cache[6] = ($event) => handleAction("insertRowAfter"))
116656
116591
  }, [
116657
116592
  createElementVNode("div", _hoisted_12$5, [
116658
- createVNode(unref(GctIcon), { icon: "icon-saoyisao" })
116659
- ]),
116660
- _cache[28] || (_cache[28] = createElementVNode("div", { class: "item-label" }, " 条码扫描 ", -1))
116661
- ]),
116662
- createElementVNode("div", {
116663
- class: "menu-item",
116664
- onClick: _cache[7] || (_cache[7] = ($event) => handleEntrustSterilBatchListAction("change-rule"))
116665
- }, [
116666
- createElementVNode("div", _hoisted_13$4, [
116667
- createVNode(unref(GctIcon), { icon: "icon-tiaomajiexi" })
116668
- ]),
116669
- _cache[29] || (_cache[29] = createElementVNode("div", { class: "item-label" }, " 条码解析规则变更 ", -1))
116670
- ])
116671
- ])) : createCommentVNode("", true),
116672
- subTableType.value.isPretreatmentList ? (openBlock(), createElementBlock("div", _hoisted_14$3, [
116673
- _cache[33] || (_cache[33] = createElementVNode("div", { class: "menu-title" }, "业务操作", -1)),
116674
- createElementVNode("div", {
116675
- class: "menu-item",
116676
- onClick: _cache[8] || (_cache[8] = ($event) => handlePretreatmentListAction("scan"))
116677
- }, [
116678
- createElementVNode("div", _hoisted_15$2, [
116679
- createVNode(unref(GctIcon), { icon: "icon-saoyisao" })
116680
- ]),
116681
- _cache[31] || (_cache[31] = createElementVNode("div", { class: "item-label" }, " 条码扫描 ", -1))
116682
- ]),
116683
- createElementVNode("div", {
116684
- class: "menu-item",
116685
- onClick: _cache[9] || (_cache[9] = ($event) => handlePretreatmentListAction("change-rule"))
116686
- }, [
116687
- createElementVNode("div", _hoisted_16$1, [
116688
- createVNode(unref(GctIcon), { icon: "icon-tiaomajiexi" })
116689
- ]),
116690
- _cache[32] || (_cache[32] = createElementVNode("div", { class: "item-label" }, " 条码解析规则变更 ", -1))
116691
- ])
116692
- ])) : createCommentVNode("", true),
116693
- createElementVNode("div", _hoisted_17, [
116694
- _cache[38] || (_cache[38] = createElementVNode("div", { class: "menu-title" }, "行编辑", -1)),
116695
- createElementVNode("div", {
116696
- class: "menu-item",
116697
- onClick: _cache[10] || (_cache[10] = ($event) => handleAction("insertRowAfter"))
116698
- }, [
116699
- createElementVNode("div", _hoisted_18, [
116700
116593
  createVNode(unref(GctIcon), { icon: "icon-tianjia" })
116701
116594
  ]),
116702
- _cache[34] || (_cache[34] = createElementVNode("div", { class: "item-label" }, " 加一行 ", -1))
116595
+ _cache[24] || (_cache[24] = createElementVNode("div", { class: "item-label" }, " 加一行 ", -1))
116703
116596
  ]),
116704
116597
  actionInfo.value.canCopy ? (openBlock(), createElementBlock("div", {
116705
116598
  key: 0,
116706
116599
  class: "menu-item",
116707
- onClick: _cache[11] || (_cache[11] = ($event) => handleAction("copyCurrentRow"))
116600
+ onClick: _cache[7] || (_cache[7] = ($event) => handleAction("copyCurrentRow"))
116708
116601
  }, [
116709
- createElementVNode("div", _hoisted_19, [
116602
+ createElementVNode("div", _hoisted_13$4, [
116710
116603
  createVNode(unref(GctIcon), { icon: "icon-fuzhihang" })
116711
116604
  ]),
116712
- _cache[35] || (_cache[35] = createElementVNode("div", { class: "item-label" }, " 复制行 ", -1))
116605
+ _cache[25] || (_cache[25] = createElementVNode("div", { class: "item-label" }, " 复制行 ", -1))
116713
116606
  ])) : createCommentVNode("", true),
116714
116607
  actionInfo.value.canInsertMulti ? (openBlock(), createElementBlock("div", {
116715
116608
  key: 1,
116716
116609
  class: "menu-item",
116717
- onClick: _cache[14] || (_cache[14] = ($event) => handleAction("insertRowBeforeMore"))
116610
+ onClick: _cache[10] || (_cache[10] = ($event) => handleAction("insertRowBeforeMore"))
116718
116611
  }, [
116719
- createElementVNode("div", _hoisted_20, [
116612
+ createElementVNode("div", _hoisted_14$3, [
116720
116613
  createVNode(unref(GctIcon), { icon: "icon-shangfangcharuhang" })
116721
116614
  ]),
116722
- createElementVNode("div", _hoisted_21, [
116723
- _cache[36] || (_cache[36] = createElementVNode("div", null, " 在上方插入行 ", -1)),
116615
+ createElementVNode("div", _hoisted_15$2, [
116616
+ _cache[26] || (_cache[26] = createElementVNode("div", null, " 在上方插入行 ", -1)),
116724
116617
  createVNode(unref(GctInputNumber), {
116725
116618
  modelValue: formState.upRowNum,
116726
- "onUpdate:modelValue": _cache[12] || (_cache[12] = ($event) => formState.upRowNum = $event),
116619
+ "onUpdate:modelValue": _cache[8] || (_cache[8] = ($event) => formState.upRowNum = $event),
116727
116620
  min: 1,
116728
116621
  integer: "",
116729
116622
  style: { "width": "68px" },
116730
- onClick: _cache[13] || (_cache[13] = withModifiers(() => {
116623
+ onClick: _cache[9] || (_cache[9] = withModifiers(() => {
116731
116624
  }, ["stop"]))
116732
116625
  }, null, 8, ["modelValue"])
116733
116626
  ])
@@ -116735,40 +116628,40 @@ const _sfc_main$2T = /* @__PURE__ */ defineComponent({
116735
116628
  actionInfo.value.canInsertMulti ? (openBlock(), createElementBlock("div", {
116736
116629
  key: 2,
116737
116630
  class: "menu-item",
116738
- onClick: _cache[17] || (_cache[17] = ($event) => handleAction("insertRowAfterMore"))
116631
+ onClick: _cache[13] || (_cache[13] = ($event) => handleAction("insertRowAfterMore"))
116739
116632
  }, [
116740
- createElementVNode("div", _hoisted_22, [
116633
+ createElementVNode("div", _hoisted_16$1, [
116741
116634
  createVNode(unref(GctIcon), { icon: "icon-xiafangcharuhang" })
116742
116635
  ]),
116743
- createElementVNode("div", _hoisted_23, [
116744
- _cache[37] || (_cache[37] = createElementVNode("div", null, " 在下方插入行 ", -1)),
116636
+ createElementVNode("div", _hoisted_17, [
116637
+ _cache[27] || (_cache[27] = createElementVNode("div", null, " 在下方插入行 ", -1)),
116745
116638
  createVNode(unref(GctInputNumber), {
116746
116639
  modelValue: formState.downRowNum,
116747
- "onUpdate:modelValue": _cache[15] || (_cache[15] = ($event) => formState.downRowNum = $event),
116640
+ "onUpdate:modelValue": _cache[11] || (_cache[11] = ($event) => formState.downRowNum = $event),
116748
116641
  min: 1,
116749
116642
  integer: "",
116750
116643
  style: { "width": "68px" },
116751
- onClick: _cache[16] || (_cache[16] = withModifiers(() => {
116644
+ onClick: _cache[12] || (_cache[12] = withModifiers(() => {
116752
116645
  }, ["stop"]))
116753
116646
  }, null, 8, ["modelValue"])
116754
116647
  ])
116755
116648
  ])) : createCommentVNode("", true)
116756
116649
  ]),
116757
- actionInfo.value.canDelete ? (openBlock(), createElementBlock("div", _hoisted_24, [
116650
+ actionInfo.value.canDelete ? (openBlock(), createElementBlock("div", _hoisted_18, [
116758
116651
  createElementVNode("div", {
116759
116652
  class: "menu-item",
116760
- onClick: _cache[18] || (_cache[18] = ($event) => handleAction("deleteRowCurrent"))
116653
+ onClick: _cache[14] || (_cache[14] = ($event) => handleAction("deleteRowCurrent"))
116761
116654
  }, [
116762
- createElementVNode("div", _hoisted_25, [
116655
+ createElementVNode("div", _hoisted_19, [
116763
116656
  createVNode(unref(GctIcon), { icon: "icon-shanchu1" })
116764
116657
  ]),
116765
- _cache[39] || (_cache[39] = createElementVNode("div", { class: "item-label" }, " 删除行 ", -1))
116658
+ _cache[29] || (_cache[29] = createElementVNode("div", { class: "item-label" }, " 删除行 ", -1))
116766
116659
  ])
116767
116660
  ])) : createCommentVNode("", true)
116768
116661
  ])
116769
116662
  ]),
116770
116663
  default: withCtx(() => [
116771
- createElementVNode("div", _hoisted_26, [
116664
+ createElementVNode("div", _hoisted_20, [
116772
116665
  createVNode(unref(GctIcon), {
116773
116666
  icon: "icon-gengduo1",
116774
116667
  color: "#fff"
@@ -116780,7 +116673,7 @@ const _sfc_main$2T = /* @__PURE__ */ defineComponent({
116780
116673
  subTableType.value.isMaterialConsume && __props.isLastRow && actionInfo.value.canConfirm ? (openBlock(), createElementBlock("div", {
116781
116674
  key: 2,
116782
116675
  class: "confirm-btn",
116783
- onClick: _cache[19] || (_cache[19] = ($event) => handleMaterialConsumeAction("confirm"))
116676
+ onClick: _cache[15] || (_cache[15] = ($event) => handleMaterialConsumeAction("confirm"))
116784
116677
  }, [
116785
116678
  createVNode(unref(GctIcon), {
116786
116679
  icon: "icon-tijiao1",
@@ -116793,7 +116686,7 @@ const _sfc_main$2T = /* @__PURE__ */ defineComponent({
116793
116686
  };
116794
116687
  }
116795
116688
  });
116796
- const SubTableAction = /* @__PURE__ */ _export_sfc(_sfc_main$2T, [["__scopeId", "data-v-527a94cf"]]);
116689
+ const SubTableAction = /* @__PURE__ */ _export_sfc(_sfc_main$2T, [["__scopeId", "data-v-ce0d6ea2"]]);
116797
116690
  const _sfc_main$2S = /* @__PURE__ */ defineComponent({
116798
116691
  __name: "index",
116799
116692
  props: {
@@ -117383,21 +117276,28 @@ const TABLE_VALIDATION_RULES = [
117383
117276
  invalid: (region) => !region.widgetMeta.props.barcode_parsing_rules_id_,
117384
117277
  code: "barcode-parsing-rules-required",
117385
117278
  message: "请给库存盘点表设置条码解析规则"
117386
- },
117387
- {
117388
- hasTable: (tbl) => tbl.hasRepeating && tbl.repeating.some((r) => r.layoutType === "entrust-steril-batch-list-table"),
117389
- getRegions: (tbl) => tbl.repeating.filter((r) => r.layoutType === "entrust-steril-batch-list-table"),
117390
- invalid: (region) => !region.widgetMeta.props.barcode_parsing_rules_id_,
117391
- code: "barcode-parsing-rules-required",
117392
- message: "请给委托灭菌生产批次表设置条码解析规则"
117393
- },
117394
- {
117395
- hasTable: (tbl) => tbl.hasRepeating && tbl.repeating.some((r) => r.layoutType === "pretreatment-list-table"),
117396
- getRegions: (tbl) => tbl.repeating.filter((r) => r.layoutType === "pretreatment-list-table"),
117397
- invalid: (region) => !region.widgetMeta.props.barcode_parsing_rules_id_,
117398
- code: "barcode-parsing-rules-required",
117399
- message: "请给预处理表设置条码解析规则"
117400
117279
  }
117280
+ // {
117281
+ // hasTable: (tbl: Wtbl) =>
117282
+ // tbl.hasRepeating &&
117283
+ // tbl.repeating.some((r) => r.layoutType === 'entrust-steril-batch-list-table'),
117284
+ // getRegions: (tbl: Wtbl) =>
117285
+ // tbl.repeating.filter((r) => r.layoutType === 'entrust-steril-batch-list-table'),
117286
+ // invalid: (region: Wtbl['repeating'][number]) =>
117287
+ // !(region.widgetMeta.props as WarehouseInventoryTableProps).barcode_parsing_rules_id_,
117288
+ // code: 'barcode-parsing-rules-required' as const,
117289
+ // message: '请给委托灭菌生产批次表设置条码解析规则',
117290
+ // },
117291
+ // {
117292
+ // hasTable: (tbl: Wtbl) =>
117293
+ // tbl.hasRepeating && tbl.repeating.some((r) => r.layoutType === 'pretreatment-list-table'),
117294
+ // getRegions: (tbl: Wtbl) =>
117295
+ // tbl.repeating.filter((r) => r.layoutType === 'pretreatment-list-table'),
117296
+ // invalid: (region: Wtbl['repeating'][number]) =>
117297
+ // !(region.widgetMeta.props as WarehouseInventoryTableProps).barcode_parsing_rules_id_,
117298
+ // code: 'barcode-parsing-rules-required' as const,
117299
+ // message: '请给预处理表设置条码解析规则',
117300
+ // },
117401
117301
  ];
117402
117302
  function validateDocDesigner(doc) {
117403
117303
  if (!doc?.model) {
@@ -128549,8 +128449,8 @@ const _sfc_main$1N = /* @__PURE__ */ defineComponent({
128549
128449
  const showQuickFill = computed(() => !NO_QUICK_FILL_TYPES.includes(layoutType.value));
128550
128450
  const showBarcodeParsingRules = computed(
128551
128451
  () => [
128552
- "pretreatment-list-table",
128553
- "entrust-steril-batch-list-table",
128452
+ // 'pretreatment-list-table',
128453
+ // 'entrust-steril-batch-list-table',
128554
128454
  "warehouse-inventory-table"
128555
128455
  ].includes(layoutType.value)
128556
128456
  );
@@ -128655,7 +128555,7 @@ const _sfc_main$1N = /* @__PURE__ */ defineComponent({
128655
128555
  };
128656
128556
  }
128657
128557
  });
128658
- const RepeatingSubTablePanel = /* @__PURE__ */ _export_sfc(_sfc_main$1N, [["__scopeId", "data-v-afa04296"]]);
128558
+ const RepeatingSubTablePanel = /* @__PURE__ */ _export_sfc(_sfc_main$1N, [["__scopeId", "data-v-b48fc893"]]);
128659
128559
  function createTablePanelSchema(schemaKey, render2, title) {
128660
128560
  const layoutType = schemaKey.replace(/\.basic$/, "");
128661
128561
  return {
@@ -132376,7 +132276,7 @@ function isModelAssociationField(field) {
132376
132276
  const manifestType = resolveFieldManifestType(field);
132377
132277
  return MODEL_ASSOCIATION_TYPES.has(storageType) || MODEL_ASSOCIATION_TYPES.has(manifestType);
132378
132278
  }
132379
- function matchAutofillTargetField(fromMeta, toMeta, options) {
132279
+ function matchAutofillTargetField(fromMeta, toMeta) {
132380
132280
  if (isModelAssociationField(fromMeta)) {
132381
132281
  return isModelAssociationField(toMeta) && fromMeta.bindInfo === toMeta.bindInfo;
132382
132282
  }
@@ -132388,9 +132288,6 @@ function matchAutofillTargetField(fromMeta, toMeta, options) {
132388
132288
  matched = false;
132389
132289
  }
132390
132290
  }
132391
- if (options?.isSubTable && !matched && isModelAssociationField(toMeta)) {
132392
- matched = true;
132393
- }
132394
132291
  return matched;
132395
132292
  }
132396
132293
  function encodeToFieldValue(meta) {
@@ -132461,8 +132358,7 @@ function filterToFieldTreeBySource(nodes, fromMeta) {
132461
132358
  return nodes.reduce((acc, node) => {
132462
132359
  const children = (node.children ?? []).filter((child) => {
132463
132360
  const field = child._targetMeta?.field;
132464
- const isSubTable = child._targetMeta?.subModel === 1;
132465
- return field ? matchAutofillTargetField(fromMeta, field, { isSubTable }) : false;
132361
+ return field ? matchAutofillTargetField(fromMeta, field) : false;
132466
132362
  });
132467
132363
  if (children.length) {
132468
132364
  acc.push({ ...node, children });
@@ -132623,9 +132519,7 @@ function resolveParamFieldTree(doc) {
132623
132519
  const mainModelKey = doc.mainModelKey;
132624
132520
  const mainModel = doc.fieldModelQuery.getModel(mainModelKey);
132625
132521
  const mainFields = doc.fieldModelQuery.getFieldList(mainModelKey).filter(
132626
- (field) => field.createType !== "SYSTEM" && [FIELD_TYPE.TEXT, FIELD_TYPE.DOUBLE, FIELD_TYPE.INTEGER, FIELD_TYPE.DECIMAL].includes(
132627
- field.type
132628
- )
132522
+ (field) => field.createType !== "SYSTEM" && [FIELD_TYPE.DOUBLE, FIELD_TYPE.INTEGER, FIELD_TYPE.DECIMAL].includes(field.type)
132629
132523
  );
132630
132524
  const nodes = [];
132631
132525
  if (mainFields.length) {
@@ -135392,23 +135286,56 @@ const _sfc_main$V = /* @__PURE__ */ defineComponent({
135392
135286
  );
135393
135287
  return contexts.filter((ctx) => ctx.fields.length > 0);
135394
135288
  }
135395
- async function openFilterModal() {
135289
+ async function loadCurrentSubTableContext(subFieldKey) {
135396
135290
  const mainModelKey = docInst.value?.mainModelKey ?? modelKey.value;
135397
- const isSubTableSource = Boolean(props.subFieldKey);
135398
- const toModelKey = isSubTableSource ? mainModelKey : modelKey.value;
135399
- const [refRes, mainFieldList, toModelInfo] = await Promise.all([
135400
- loadFieldList(refModelKey.value),
135401
- loadFieldList(toModelKey),
135402
- loadModelInfo(toModelKey)
135291
+ const [subFieldList, subModelInfo, mainFieldList, mainModelInfo] = await Promise.all([
135292
+ loadFieldList(modelKey.value),
135293
+ loadModelInfo(modelKey.value),
135294
+ loadFieldList(mainModelKey),
135295
+ loadModelInfo(mainModelKey)
135403
135296
  ]);
135404
- const toSubTables = await loadSubTableContexts(mainFieldList || []);
135297
+ const subFieldMeta = (mainFieldList || []).find((field) => field.key === subFieldKey);
135298
+ return {
135299
+ toModelInfo: mainModelInfo,
135300
+ toSubTables: [
135301
+ {
135302
+ subFieldKey,
135303
+ subFieldName: subFieldMeta?.name ?? subModelInfo?.modelName ?? subFieldKey,
135304
+ subModelKey: modelKey.value,
135305
+ subModelName: subModelInfo?.modelName ?? subFieldMeta?.name ?? subFieldKey,
135306
+ fields: filterNonSystemFields(subFieldList || [])
135307
+ }
135308
+ ]
135309
+ };
135310
+ }
135311
+ async function openFilterModal() {
135312
+ const isSubTableSource = Boolean(props.subFieldKey);
135313
+ const refRes = await loadFieldList(refModelKey.value);
135314
+ let toFieldList = [];
135315
+ let toSubTables = [];
135316
+ let toModelInfo;
135317
+ if (isSubTableSource) {
135318
+ const subFieldKey = props.subFieldKey.replace(/^\$\./, "");
135319
+ const currentSub = await loadCurrentSubTableContext(subFieldKey);
135320
+ toModelInfo = currentSub.toModelInfo;
135321
+ toSubTables = currentSub.toSubTables;
135322
+ toFieldList = [];
135323
+ } else {
135324
+ const [mainFieldList, modelInfo] = await Promise.all([
135325
+ loadFieldList(modelKey.value),
135326
+ loadModelInfo(modelKey.value)
135327
+ ]);
135328
+ toModelInfo = modelInfo;
135329
+ toFieldList = filterNonSystemFields(mainFieldList || []);
135330
+ toSubTables = await loadSubTableContexts(mainFieldList || []);
135331
+ }
135405
135332
  GctModal.open({
135406
135333
  title: "添加规则",
135407
135334
  body: AutofillRulesModel,
135408
135335
  bodyProps: {
135409
135336
  currentField: props.currentField,
135410
135337
  refModelFieldList: filterNonSystemFields(refRes || []),
135411
- toFieldList: filterNonSystemFields(mainFieldList || []),
135338
+ toFieldList,
135412
135339
  toSubTables,
135413
135340
  toModelInfo,
135414
135341
  rules: _autofillRules.value
@@ -135449,7 +135376,7 @@ const _sfc_main$V = /* @__PURE__ */ defineComponent({
135449
135376
  };
135450
135377
  }
135451
135378
  });
135452
- const RefAutofillEditor = /* @__PURE__ */ _export_sfc(_sfc_main$V, [["__scopeId", "data-v-0f198b3d"]]);
135379
+ const RefAutofillEditor = /* @__PURE__ */ _export_sfc(_sfc_main$V, [["__scopeId", "data-v-449fd707"]]);
135453
135380
  const ONLINE_FORM_TMPL_MODULE_TYPE = "online_form_module";
135454
135381
  function buildFormTmplRefId(item) {
135455
135382
  if (!item.id) return "";
@@ -21,7 +21,7 @@ export interface UpdateRowOption {
21
21
  * - [需求数量、已消耗数量] 始终只读
22
22
  * - [有效期、唯一标识、自定义字段] 始终可填(不做控制)
23
23
  * - 选择的物料类型是[查看物料]时 [批次、上料数量、工序] 只读
24
- * - 单行校验通过后(包括暂存后再次编辑)[物料、批次、上料数量、工序] 只读
24
+ * - 单行校验通过后(包括暂存后再次编辑)[物料、批次、上料数量、工序、需求数量单位、数量单位、转换后数量、转换数量单位ID、单位转化公式] 只读
25
25
  */
26
26
  export declare class MCDataUtil {
27
27
  /**
@@ -1,4 +1,10 @@
1
1
  import { PaperSize } from '../../../core/constants';
2
+ interface IPageSizeOptions {
3
+ width: number;
4
+ height: number;
5
+ direction?: 'portrait' | 'landscape';
6
+ }
7
+ export declare const updatePgSzElInfo: (pgSz: any, paperSize: PaperSize, options: IPageSizeOptions) => void;
2
8
  export declare class RuntimeJsonBuilder {
3
9
  private json;
4
10
  constructor(base: any);
@@ -6,13 +12,10 @@ export declare class RuntimeJsonBuilder {
6
12
  /**
7
13
  * 页面设置
8
14
  */
9
- setPageSize(paperSize: PaperSize, options: {
10
- width: number;
11
- height: number;
12
- direction?: 'portrait' | 'landscape';
13
- }): this;
15
+ setPageSize(paperSize: PaperSize, options: IPageSizeOptions): this;
14
16
  /**
15
17
  * 构建
16
18
  */
17
19
  build(): any;
18
20
  }
21
+ export {};
package/dist/word.css CHANGED
@@ -9124,20 +9124,20 @@ textarea[data-v-2de31883]::placeholder {
9124
9124
  .table-action .row-headers .row-header:last-child .row-add-btn[data-v-c40eef9f] .gct-icon.bottom {
9125
9125
  transform: translateY(-100%);
9126
9126
  }
9127
- .sub-table-action-container[data-v-527a94cf] {
9127
+ .sub-table-action-container[data-v-ce0d6ea2] {
9128
9128
  position: absolute;
9129
9129
  z-index: 999;
9130
9130
  }
9131
- .sub-table-action-bar[data-v-527a94cf],
9132
- .sub-table-action-popper[data-v-527a94cf] {
9131
+ .sub-table-action-bar[data-v-ce0d6ea2],
9132
+ .sub-table-action-popper[data-v-ce0d6ea2] {
9133
9133
  pointer-events: auto;
9134
9134
  user-select: none;
9135
9135
  }
9136
- .sub-table-action-bar[data-v-527a94cf] {
9136
+ .sub-table-action-bar[data-v-ce0d6ea2] {
9137
9137
  display: flex;
9138
9138
  }
9139
- .sub-table-action-bar .more-btn[data-v-527a94cf],
9140
- .sub-table-action-bar .confirm-btn[data-v-527a94cf] {
9139
+ .sub-table-action-bar .more-btn[data-v-ce0d6ea2],
9140
+ .sub-table-action-bar .confirm-btn[data-v-ce0d6ea2] {
9141
9141
  display: flex;
9142
9142
  justify-content: center;
9143
9143
  align-items: center;
@@ -9146,44 +9146,44 @@ textarea[data-v-2de31883]::placeholder {
9146
9146
  cursor: pointer;
9147
9147
  box-sizing: border-box;
9148
9148
  }
9149
- .sub-table-action-bar .more-btn[data-v-527a94cf] {
9149
+ .sub-table-action-bar .more-btn[data-v-ce0d6ea2] {
9150
9150
  width: 10px;
9151
9151
  background: #026ac8;
9152
9152
  border-radius: 0 4px 4px 0;
9153
9153
  }
9154
- .sub-table-action-bar .confirm-btn[data-v-527a94cf] {
9154
+ .sub-table-action-bar .confirm-btn[data-v-ce0d6ea2] {
9155
9155
  margin-left: 4px;
9156
9156
  border-radius: 4px;
9157
9157
  border: 1px solid #4ec262;
9158
9158
  }
9159
- .sub-table-action-popper[data-v-527a94cf] {
9159
+ .sub-table-action-popper[data-v-ce0d6ea2] {
9160
9160
  padding: 2px 8px;
9161
9161
  }
9162
- .sub-table-action-popper .action-menu[data-v-527a94cf] {
9162
+ .sub-table-action-popper .action-menu[data-v-ce0d6ea2] {
9163
9163
  padding: 4px 0;
9164
9164
  width: 220px;
9165
9165
  user-select: none;
9166
9166
  }
9167
- .sub-table-action-popper .action-menu + .action-menu[data-v-527a94cf] {
9167
+ .sub-table-action-popper .action-menu + .action-menu[data-v-ce0d6ea2] {
9168
9168
  margin-top: 4px;
9169
9169
  padding-top: 4px;
9170
9170
  border-top: 1px solid #efefef;
9171
9171
  }
9172
- .sub-table-action-popper .action-menu .menu-title[data-v-527a94cf] {
9172
+ .sub-table-action-popper .action-menu .menu-title[data-v-ce0d6ea2] {
9173
9173
  color: #bcbcbc;
9174
9174
  margin: 4px 0;
9175
9175
  }
9176
- .sub-table-action-popper .action-menu .menu-item[data-v-527a94cf] {
9176
+ .sub-table-action-popper .action-menu .menu-item[data-v-ce0d6ea2] {
9177
9177
  display: flex;
9178
9178
  align-items: center;
9179
9179
  padding: 8px 10px;
9180
9180
  border-radius: 4px;
9181
9181
  }
9182
- .sub-table-action-popper .action-menu .menu-item[data-v-527a94cf]:hover {
9182
+ .sub-table-action-popper .action-menu .menu-item[data-v-ce0d6ea2]:hover {
9183
9183
  cursor: pointer;
9184
9184
  background-color: #f2f5f8;
9185
9185
  }
9186
- .sub-table-action-popper .action-menu .menu-item .item-icon[data-v-527a94cf] {
9186
+ .sub-table-action-popper .action-menu .menu-item .item-icon[data-v-ce0d6ea2] {
9187
9187
  display: flex;
9188
9188
  align-items: center;
9189
9189
  justify-content: start;
@@ -9191,14 +9191,14 @@ textarea[data-v-2de31883]::placeholder {
9191
9191
  width: 20px;
9192
9192
  height: 20px;
9193
9193
  }
9194
- .sub-table-action-popper .action-menu .menu-item .item-icon.scale-large[data-v-527a94cf] {
9194
+ .sub-table-action-popper .action-menu .menu-item .item-icon.scale-large[data-v-ce0d6ea2] {
9195
9195
  transform: scale(1.5);
9196
9196
  }
9197
- .sub-table-action-popper .action-menu .menu-item .item-label[data-v-527a94cf] {
9197
+ .sub-table-action-popper .action-menu .menu-item .item-label[data-v-ce0d6ea2] {
9198
9198
  flex-grow: 1;
9199
9199
  margin-left: 8px;
9200
9200
  }
9201
- .sub-table-action-popper .action-menu .menu-item .item-label.flex-between-center[data-v-527a94cf] {
9201
+ .sub-table-action-popper .action-menu .menu-item .item-label.flex-between-center[data-v-ce0d6ea2] {
9202
9202
  display: flex;
9203
9203
  justify-content: space-between;
9204
9204
  align-items: center;
@@ -10675,22 +10675,22 @@ svg.portrait-icon[data-v-8bdb451e] {
10675
10675
  .sub-table-basic-info .delete-title[data-v-5a638f72]:hover {
10676
10676
  opacity: 0.7;
10677
10677
  }
10678
- .panel-repeating-sub-table[data-v-afa04296] {
10678
+ .panel-repeating-sub-table[data-v-b48fc893] {
10679
10679
  position: relative;
10680
10680
  }
10681
- .panel-repeating-sub-table .container[data-v-afa04296] {
10681
+ .panel-repeating-sub-table .container[data-v-b48fc893] {
10682
10682
  padding: 16px;
10683
10683
  }
10684
- .panel-repeating-sub-table .form-custom-label[data-v-afa04296] {
10684
+ .panel-repeating-sub-table .form-custom-label[data-v-b48fc893] {
10685
10685
  display: inline-flex;
10686
10686
  align-items: center;
10687
10687
  gap: 4px;
10688
10688
  }
10689
- .panel-repeating-sub-table .form-custom-label .icon[data-v-afa04296] {
10689
+ .panel-repeating-sub-table .form-custom-label .icon[data-v-b48fc893] {
10690
10690
  cursor: pointer;
10691
10691
  vertical-align: text-top;
10692
10692
  }
10693
- .panel-repeating-sub-table .content[data-v-afa04296] {
10693
+ .panel-repeating-sub-table .content[data-v-b48fc893] {
10694
10694
  display: flex;
10695
10695
  align-items: center;
10696
10696
  justify-content: flex-end;
@@ -12246,14 +12246,14 @@ svg.portrait-icon[data-v-8bdb451e] {
12246
12246
  line-height: 20px;
12247
12247
  margin-top: 4px;
12248
12248
  }
12249
- .form-item.default.ref-autofill-editor.is-content-hidden[data-v-0f198b3d] .form-item__label {
12249
+ .form-item.default.ref-autofill-editor.is-content-hidden[data-v-449fd707] .form-item__label {
12250
12250
  margin-bottom: 0 !important ;
12251
12251
  }
12252
- .ref-autofill-editor__extra[data-v-0f198b3d] {
12252
+ .ref-autofill-editor__extra[data-v-449fd707] {
12253
12253
  display: inline-flex;
12254
12254
  align-items: center;
12255
12255
  }
12256
- .data-filter-button[data-v-0f198b3d] {
12256
+ .data-filter-button[data-v-449fd707] {
12257
12257
  height: 32px;
12258
12258
  border: 1px solid #d9d9d9;
12259
12259
  color: #333;
@@ -12264,11 +12264,11 @@ svg.portrait-icon[data-v-8bdb451e] {
12264
12264
  cursor: pointer;
12265
12265
  box-sizing: border-box;
12266
12266
  }
12267
- .data-filter-button[data-v-0f198b3d]:hover {
12267
+ .data-filter-button[data-v-449fd707]:hover {
12268
12268
  border-color: #026ac8;
12269
12269
  color: #026ac8;
12270
12270
  }
12271
- .data-filter-button.primary[data-v-0f198b3d] {
12271
+ .data-filter-button.primary[data-v-449fd707] {
12272
12272
  border-color: #026ac8;
12273
12273
  background-color: #026ac8;
12274
12274
  color: #fff;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@gct-paas/word",
3
- "version": "0.1.63-beta.6",
3
+ "version": "0.1.63-beta.7",
4
4
  "description": "GCT 在线 word",
5
5
  "keywords": [
6
6
  "vue",