@gct-paas/word 0.1.74-beta.34 → 0.1.74-beta.35

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,19 @@
1
+ import { Doc } from '../..';
2
+ import { DataEnricherRegistration } from '..';
3
+ import { FIELD_TYPE } from '../../../domain/field/field-type';
4
+ export interface OperationReceiveQtyWidgetTarget {
5
+ valuePath: string;
6
+ }
7
+ type OperationReceiveQtyWidgetInstance = {
8
+ widgetMeta?: {
9
+ field?: {
10
+ fieldType?: FIELD_TYPE;
11
+ };
12
+ };
13
+ valuePath?: string;
14
+ };
15
+ /** 从单个 widget 实例解析工序接收数量 enrich 目标 */
16
+ export declare function tryCollectOperationReceiveQtyTarget(instance: OperationReceiveQtyWidgetInstance): OperationReceiveQtyWidgetTarget | null;
17
+ /** 工序接收数量:params 取 containerId / routingOperationId,空值时拉取 qty_current_ */
18
+ export declare function createOperationReceiveQtyEnricher(doc: Doc, targets: OperationReceiveQtyWidgetTarget[]): DataEnricherRegistration;
19
+ export {};
package/dist/index.es.js CHANGED
@@ -1,4 +1,4 @@
1
- /*! @gct-paas/word v0.1.74-beta.34 */
1
+ /*! @gct-paas/word v0.1.74-beta.35 */
2
2
  import { Fragment, Suspense, Teleport, Transition, TransitionGroup, cloneVNode, computed, createApp, createBlock, createCommentVNode, createElementBlock, createElementVNode, createSlots, createStaticVNode, createTextVNode, createVNode, defineAsyncComponent, defineComponent, getCurrentInstance, getCurrentScope, guardReactiveProps, h, inject, isRef, isVNode, markRaw, mergeModels, mergeProps, nextTick, normalizeClass, normalizeProps, normalizeStyle, onBeforeMount, onBeforeUnmount, onMounted, onScopeDispose, onUnmounted, openBlock, provide, reactive, readonly, ref, render, renderList, renderSlot, resolveComponent, resolveDynamicComponent, shallowRef, toDisplayString, toHandlers, toRaw, toRef, toValue, unref, useAttrs, useCssVars, useModel, useSlots, vModelRadio, vModelText, vShow, watch, watchEffect, withCtx, withDirectives, withKeys, withModifiers } from "vue";
3
3
  import St, { PopperWrapper } from "floating-vue";
4
4
  import VueKonva from "vue-konva";
@@ -17556,7 +17556,10 @@ var init_field_type = __esmMin((() => {
17556
17556
  ...BASE_FIELD_TYPE,
17557
17557
  ...BUSINESS_FIELD_TYPE
17558
17558
  };
17559
- FIELD_TYPE_ALIASES = { production_identifier: FIELD_TYPE.PRODUCTION_CONTAINER };
17559
+ FIELD_TYPE_ALIASES = {
17560
+ production_identifier: FIELD_TYPE.PRODUCTION_CONTAINER,
17561
+ operation: FIELD_TYPE.ROUTING_OPERATION
17562
+ };
17560
17563
  }));
17561
17564
  //#endregion
17562
17565
  //#region src/domain/table/design/autofill-expander.ts
@@ -99961,6 +99964,47 @@ var init_lot_parent_label_enricher = __esmMin((() => {
99961
99964
  init_enrich_utils();
99962
99965
  }));
99963
99966
  //#endregion
99967
+ //#region src/suites/shared/suite-features.ts
99968
+ /** 按套件 key 取可见性配置,未知套件回落默认 */
99969
+ function getSuiteFeatures(suiteKey) {
99970
+ if (!suiteKey) return DEFAULT_SUITE_FEATURES;
99971
+ return SUITE_FEATURES_MAP[suiteKey] ?? DEFAULT_SUITE_FEATURES;
99972
+ }
99973
+ var DEFAULT_SUITE_FEATURES, SUITE_FEATURES_MAP;
99974
+ var init_suite_features = __esmMin((() => {
99975
+ DEFAULT_SUITE_FEATURES = {
99976
+ hiddenBusinessTableTypes: [],
99977
+ showRulePanel: true,
99978
+ showObjectInit: true,
99979
+ showDataLoad: true,
99980
+ hydrateOperationReceiveQty: false
99981
+ };
99982
+ SUITE_FEATURES_MAP = {
99983
+ edhr: {
99984
+ ...DEFAULT_SUITE_FEATURES,
99985
+ hydrateOperationReceiveQty: true
99986
+ },
99987
+ eqm: {
99988
+ hiddenBusinessTableTypes: [
99989
+ "warehouse-in",
99990
+ "warehouse-out",
99991
+ "warehouse-inventory",
99992
+ "warehouse-allocate",
99993
+ "material-consume",
99994
+ "material-balance",
99995
+ "material-requisition",
99996
+ "entrust-steril-batch-list",
99997
+ "pretreatment-list",
99998
+ "check-table"
99999
+ ],
100000
+ showRulePanel: false,
100001
+ showObjectInit: false,
100002
+ showDataLoad: false,
100003
+ hydrateOperationReceiveQty: false
100004
+ }
100005
+ };
100006
+ }));
100007
+ //#endregion
99964
100008
  //#region src/sdk/doc-runtime/utils/sub-field-config.ts
99965
100009
  var SUB_FIELD_CONFIG_KEY, getSubFieldConfig;
99966
100010
  var init_sub_field_config = __esmMin((() => {
@@ -100163,6 +100207,98 @@ var init_of_inst_num_enricher = __esmMin((() => {
100163
100207
  inflightCountMapByDoc = /* @__PURE__ */ new WeakMap();
100164
100208
  }));
100165
100209
  //#endregion
100210
+ //#region src/core/data/enrichers/operation-receive-qty-enricher.ts
100211
+ function resolveQueryParams(doc) {
100212
+ const containerId = readContextParam(doc, "containerId");
100213
+ const routingOperationId = readContextParam(doc, "routingOperationId");
100214
+ return {
100215
+ containerId: isBlank$1(containerId) ? void 0 : String(containerId),
100216
+ routingOperationId: isBlank$1(routingOperationId) ? void 0 : String(routingOperationId)
100217
+ };
100218
+ }
100219
+ function parseQtyCurrent(res) {
100220
+ const payload = unwrapBizServiceData(res) ?? res;
100221
+ if (!payload || typeof payload !== "object") return void 0;
100222
+ const raw = (payload.data && typeof payload.data === "object" ? payload.data : payload).qty_current_;
100223
+ if (raw === void 0 || raw === null || raw === "") return void 0;
100224
+ const num = Number(raw);
100225
+ return Number.isNaN(num) ? void 0 : num;
100226
+ }
100227
+ function collectEmptyPaths(doc, targets) {
100228
+ const rawData = doc.dataManager.getRawData();
100229
+ const emptyPaths = [];
100230
+ for (const { valuePath } of targets) for (const path of expandSubTableWidgetPaths(doc, valuePath, rawData)) {
100231
+ if (isPresent(doc.dataManager.get(path))) continue;
100232
+ emptyPaths.push(path);
100233
+ }
100234
+ return emptyPaths;
100235
+ }
100236
+ async function fetchQtyCurrent(doc) {
100237
+ const existing = inflightQtyByDoc.get(doc);
100238
+ if (existing) return existing;
100239
+ const task = (async () => {
100240
+ const { containerId, routingOperationId } = resolveQueryParams(doc);
100241
+ if (!containerId || !routingOperationId) return void 0;
100242
+ return parseQtyCurrent(await callBizService(OPERATION_RECEIVE_QTY_API, {
100243
+ containerId,
100244
+ routingOperationId
100245
+ }));
100246
+ })();
100247
+ inflightQtyByDoc.set(doc, task);
100248
+ try {
100249
+ return await task;
100250
+ } finally {
100251
+ inflightQtyByDoc.delete(doc);
100252
+ }
100253
+ }
100254
+ function buildQtyUpdates(emptyPaths, qty) {
100255
+ const updates = {};
100256
+ for (const path of emptyPaths) updates[path] = qty;
100257
+ return updates;
100258
+ }
100259
+ /** 从单个 widget 实例解析工序接收数量 enrich 目标 */
100260
+ function tryCollectOperationReceiveQtyTarget(instance) {
100261
+ var _instance$widgetMeta;
100262
+ const field = (_instance$widgetMeta = instance.widgetMeta) === null || _instance$widgetMeta === void 0 ? void 0 : _instance$widgetMeta.field;
100263
+ if (!field || field.fieldType !== FIELD_TYPE.OPERATION_RECEIVE_QTY || !instance.valuePath) return null;
100264
+ return { valuePath: String(instance.valuePath) };
100265
+ }
100266
+ /** 工序接收数量:params 取 containerId / routingOperationId,空值时拉取 qty_current_ */
100267
+ function createOperationReceiveQtyEnricher(doc, targets) {
100268
+ const pathMatchers = targets.map((item) => createValuePathMatcher(item.valuePath));
100269
+ return {
100270
+ id: "operation-receive-qty:hydrate",
100271
+ valuePathTemplate: "*",
100272
+ match: (path) => pathMatchers.some((matcher) => matcher(path)),
100273
+ enrich: async () => {
100274
+ var _doc$isInEditMode;
100275
+ if ((_doc$isInEditMode = doc.isInEditMode) === null || _doc$isInEditMode === void 0 ? void 0 : _doc$isInEditMode.call(doc)) return;
100276
+ const emptyPaths = collectEmptyPaths(doc, targets);
100277
+ if (!emptyPaths.length) return;
100278
+ const qty = await fetchQtyCurrent(doc);
100279
+ if (qty === void 0) return;
100280
+ const updates = buildQtyUpdates(emptyPaths, qty);
100281
+ if (!Object.keys(updates).length) return;
100282
+ return updates;
100283
+ }
100284
+ };
100285
+ }
100286
+ var OPERATION_RECEIVE_QTY_API, inflightQtyByDoc;
100287
+ var init_operation_receive_qty_enricher = __esmMin((() => {
100288
+ init_data();
100289
+ init_field_type();
100290
+ init_biz_service_api();
100291
+ init_table_runtime_utils();
100292
+ init_core$1();
100293
+ OPERATION_RECEIVE_QTY_API = {
100294
+ modelCategory: "entity",
100295
+ modelKey: "em_routing_operation_number",
100296
+ bsKey: "getOne",
100297
+ method: "post"
100298
+ };
100299
+ inflightQtyByDoc = /* @__PURE__ */ new WeakMap();
100300
+ }));
100301
+ //#endregion
100166
100302
  //#region src/core/data/enrichers/build-field-enrichers.ts
100167
100303
  /**
100168
100304
  * 解析 enricher 用的 widget props
@@ -100181,8 +100317,10 @@ function resolveEnricherWidgetProps(instance, manifest) {
100181
100317
  }
100182
100318
  /** 根据文档 widget 列表构建全部 enricher 注册项 */
100183
100319
  function buildFieldEnricherRegistrations(instances, ctx, doc) {
100320
+ var _doc$fieldModelQuery;
100184
100321
  const regs = [];
100185
100322
  const ofInstNumTargets = [];
100323
+ const operationReceiveQtyTargets = [];
100186
100324
  for (const instance of instances) {
100187
100325
  var _instance$widgetMeta2, _manifest$computed2;
100188
100326
  const fieldMeta = (_instance$widgetMeta2 = instance.widgetMeta) === null || _instance$widgetMeta2 === void 0 ? void 0 : _instance$widgetMeta2.field;
@@ -100190,6 +100328,8 @@ function buildFieldEnricherRegistrations(instances, ctx, doc) {
100190
100328
  if (!fieldMeta || !valuePath) continue;
100191
100329
  const ofInstNumTarget = tryCollectOfInstNumTarget(instance);
100192
100330
  if (ofInstNumTarget) ofInstNumTargets.push(ofInstNumTarget);
100331
+ const operationReceiveQtyTarget = tryCollectOperationReceiveQtyTarget(instance);
100332
+ if (operationReceiveQtyTarget) operationReceiveQtyTargets.push(operationReceiveQtyTarget);
100193
100333
  const manifest = ctx.getFieldManifest(fieldMeta.fieldType);
100194
100334
  const valueChangeRules = normalizeValueChangeRules(manifest === null || manifest === void 0 || (_manifest$computed2 = manifest.computed) === null || _manifest$computed2 === void 0 ? void 0 : _manifest$computed2.onValueChangeRule);
100195
100335
  if (!valueChangeRules.length) continue;
@@ -100239,6 +100379,7 @@ function buildFieldEnricherRegistrations(instances, ctx, doc) {
100239
100379
  }
100240
100380
  }
100241
100381
  if (ofInstNumTargets.length) regs.push(createOfInstNumEnricher(doc, ofInstNumTargets));
100382
+ if (operationReceiveQtyTargets.length && getSuiteFeatures((_doc$fieldModelQuery = doc.fieldModelQuery) === null || _doc$fieldModelQuery === void 0 ? void 0 : _doc$fieldModelQuery.suiteKey).hydrateOperationReceiveQty) regs.push(createOperationReceiveQtyEnricher(doc, operationReceiveQtyTargets));
100242
100383
  regs.push(...buildStaticLabelEnrichers(doc));
100243
100384
  return regs;
100244
100385
  }
@@ -100250,8 +100391,10 @@ var init_build_field_enrichers = __esmMin((() => {
100250
100391
  init_lot_parent_label_enricher();
100251
100392
  init_static_label_enrichers();
100252
100393
  init_computed();
100394
+ init_suite_features();
100253
100395
  init_field_props_schema_type();
100254
100396
  init_of_inst_num_enricher();
100397
+ init_operation_receive_qty_enricher();
100255
100398
  }));
100256
100399
  //#endregion
100257
100400
  //#region src/core/data/post-change-pipeline.ts
@@ -149308,36 +149451,6 @@ var set_table_header_form_modal_vue_vue_type_script_setup_true_lang_default = /*
149308
149451
  init__plugin_vue_export_helper();
149309
149452
  var set_table_header_form_modal_default = /*#__PURE__*/ _plugin_vue_export_helper_default(set_table_header_form_modal_vue_vue_type_script_setup_true_lang_default, [["__scopeId", "data-v-63b235d6"]]);
149310
149453
  //#endregion
149311
- //#region src/suites/shared/suite-features.ts
149312
- var DEFAULT_SUITE_FEATURES = {
149313
- hiddenBusinessTableTypes: [],
149314
- showRulePanel: true,
149315
- showObjectInit: true,
149316
- showDataLoad: true
149317
- };
149318
- var SUITE_FEATURES_MAP = { eqm: {
149319
- hiddenBusinessTableTypes: [
149320
- "warehouse-in",
149321
- "warehouse-out",
149322
- "warehouse-inventory",
149323
- "warehouse-allocate",
149324
- "material-consume",
149325
- "material-balance",
149326
- "material-requisition",
149327
- "entrust-steril-batch-list",
149328
- "pretreatment-list",
149329
- "check-table"
149330
- ],
149331
- showRulePanel: false,
149332
- showObjectInit: false,
149333
- showDataLoad: false
149334
- } };
149335
- /** 按套件 key 取可见性配置,未知套件回落默认 */
149336
- function getSuiteFeatures(suiteKey) {
149337
- if (!suiteKey) return DEFAULT_SUITE_FEATURES;
149338
- return SUITE_FEATURES_MAP[suiteKey] ?? DEFAULT_SUITE_FEATURES;
149339
- }
149340
- //#endregion
149341
149454
  //#region src/assets/svgs/table/category/data-table.svg
149342
149455
  var data_table_default = "data:image/svg+xml,%3c?xml%20version='1.0'%20standalone='no'?%3e%3c!DOCTYPE%20svg%20PUBLIC%20'-//W3C//DTD%20SVG%201.1//EN'%20'http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd'%3e%3csvg%20t='1781603088074'%20class='icon'%20viewBox='0%200%201024%201024'%20version='1.1'%20xmlns='http://www.w3.org/2000/svg'%20p-id='73543'%20xmlns:xlink='http://www.w3.org/1999/xlink'%20width='200'%20height='200'%3e%3cpath%20d='M667.9552%20867.84h185.1392V421.9904h-185.1392v445.8496z%20m-255.5904%200h199.3216V421.9904H412.3648v445.8496z%20m-241.4592%200h185.088V421.9904H170.9056v445.8496z%20m0-502.1184h682.1376V156.16H170.9056v209.5616zM909.3632%20885.76a38.4%2038.4%200%200%201-38.4%2038.4H153.088a38.4%2038.4%200%200%201-38.4-38.4V153.6c0-29.696%2024.064-53.76%2053.76-53.76H855.552c29.696%200%2053.76%2024.064%2053.76%2053.76v732.16z'%20fill='%23434855'%20p-id='73544'%3e%3c/path%3e%3cpath%20d='M854.1696%20616.96v56.32H170.8032v-56.32h683.3664z'%20fill='%23026AC8'%20p-id='73545'%3e%3c/path%3e%3c/svg%3e";
149343
149456
  //#endregion
@@ -149497,6 +149610,7 @@ init_base$2();
149497
149610
  init_core();
149498
149611
  init__register_();
149499
149612
  init_table$1();
149613
+ init_suite_features();
149500
149614
  init_useTableSelection();
149501
149615
  init_logic$1();
149502
149616
  var _hoisted_1$120 = { class: "ribbon-tab-item" };
@@ -150821,6 +150935,7 @@ var toolkit_content_widgets_default = /*#__PURE__*/ _plugin_vue_export_helper_de
150821
150935
  //#region src/runtime/designer/toolkit/toolkit.vue?vue&type=script&setup=true&lang.ts
150822
150936
  init_core();
150823
150937
  init__register_();
150938
+ init_suite_features();
150824
150939
  var _hoisted_1$112 = { class: "designer_toolkit-wrapper" };
150825
150940
  var toolkit_vue_vue_type_script_setup_true_lang_default = /*@__PURE__*/ defineComponent({
150826
150941
  __name: "toolkit",
@@ -164120,6 +164235,7 @@ init_api$1();
164120
164235
  init_base$2();
164121
164236
  init_core();
164122
164237
  init__register_();
164238
+ init_suite_features();
164123
164239
  var _hoisted_1$70 = { class: "panel-data-init" };
164124
164240
  var _hoisted_2$36 = { class: "collapse-inner param-area" };
164125
164241
  var _hoisted_3$23 = { class: "collapse-inner data-source-area" };
@@ -6,6 +6,8 @@ import { FIELD_TYPE } from '../../domain/field/field-type';
6
6
  * 由 {@link SuiteRuntime} 实现。
7
7
  */
8
8
  export interface FieldModelQuery {
9
+ /** 当前套件 key */
10
+ readonly suiteKey?: SuiteKey;
9
11
  readonly fieldScope: FieldScope;
10
12
  loadFieldList(modelKey: ModelKey, params?: any): Promise<FieldListResult>;
11
13
  loadFieldByKey(modelKey: ModelKey, key: string): Promise<FieldMeta | undefined>;
@@ -1,7 +1,7 @@
1
1
  import { BusinessSubTableType } from '../../domain/table/types';
2
2
  /**
3
3
  * 套件级 UI / 能力可见性
4
- * 默认全开;各套件按需覆盖。
4
+ * UI 默认全开,各套件按需覆盖;依赖特定后端接口的能力默认关闭,由套件打开。
5
5
  */
6
6
  export interface SuiteFeatures {
7
7
  /** Ribbon「业务表」中隐藏的表类型 */
@@ -12,6 +12,8 @@ export interface SuiteFeatures {
12
12
  showObjectInit: boolean;
13
13
  /** 数据面板「数据加载」区块 */
14
14
  showDataLoad: boolean;
15
+ /** 工序接收数量:打开时用 em_routing_operation_number/getOne 现查(仅 EDHR 有此接口) */
16
+ hydrateOperationReceiveQty: boolean;
15
17
  }
16
18
  /** 按套件 key 取可见性配置,未知套件回落默认 */
17
19
  export declare function getSuiteFeatures(suiteKey?: string): SuiteFeatures;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@gct-paas/word",
3
- "version": "0.1.74-beta.34",
3
+ "version": "0.1.74-beta.35",
4
4
  "description": "GCT 在线 word",
5
5
  "keywords": [
6
6
  "vue",