@gct-paas/word 0.1.63 → 0.1.64
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.es.js
CHANGED
|
@@ -33535,7 +33535,7 @@ function getValue$1(value, multiple) {
|
|
|
33535
33535
|
}
|
|
33536
33536
|
return value;
|
|
33537
33537
|
}
|
|
33538
|
-
function setValue
|
|
33538
|
+
function setValue(value, valuePath, payload) {
|
|
33539
33539
|
const { multiple = false, valueKey } = payload || {};
|
|
33540
33540
|
const values = multiple ? value?.map((item) => valueKey ? item[valueKey] : item).join(",") || null : value ?? null;
|
|
33541
33541
|
return {
|
|
@@ -81339,7 +81339,7 @@ function getLabelPath(path) {
|
|
|
81339
81339
|
function getHrefPath(path) {
|
|
81340
81340
|
return path + HREF_SUFFIX;
|
|
81341
81341
|
}
|
|
81342
|
-
function getIdPath
|
|
81342
|
+
function getIdPath(path) {
|
|
81343
81343
|
return path + ID_SUFFIX;
|
|
81344
81344
|
}
|
|
81345
81345
|
function isCompanionIdPath(path) {
|
|
@@ -84511,7 +84511,7 @@ function createIdEnricher(reg) {
|
|
|
84511
84511
|
return createCompanionEnricher(reg, {
|
|
84512
84512
|
cacheNamespace: "id_enrich_resolve",
|
|
84513
84513
|
defaultIdPrefix: "id:",
|
|
84514
|
-
getCompanionPath: getIdPath
|
|
84514
|
+
getCompanionPath: getIdPath,
|
|
84515
84515
|
preserveOnHydrate: true,
|
|
84516
84516
|
skipWhenCompanionPresent: true,
|
|
84517
84517
|
buildCacheKey: (path, value, doc) => ({
|
|
@@ -85362,7 +85362,7 @@ class DataManager {
|
|
|
85362
85362
|
return getHrefPath(path);
|
|
85363
85363
|
}
|
|
85364
85364
|
getIdPath(path) {
|
|
85365
|
-
return getIdPath
|
|
85365
|
+
return getIdPath(path);
|
|
85366
85366
|
}
|
|
85367
85367
|
getFieldRuntimeSpecificConfigKeys() {
|
|
85368
85368
|
return [...this.fieldRuntimeConfigByPath.keys()];
|
|
@@ -86591,7 +86591,7 @@ class DataManager {
|
|
|
86591
86591
|
designValuePath,
|
|
86592
86592
|
getLabelPath(designValuePath),
|
|
86593
86593
|
getHrefPath(designValuePath),
|
|
86594
|
-
getIdPath
|
|
86594
|
+
getIdPath(designValuePath)
|
|
86595
86595
|
];
|
|
86596
86596
|
const wildcardKeys = new Set(bases.map((path) => this.convertPathToWildcard(path)));
|
|
86597
86597
|
const result = new Set(bases);
|
|
@@ -86615,7 +86615,7 @@ class DataManager {
|
|
|
86615
86615
|
paths.add(path);
|
|
86616
86616
|
paths.add(getLabelPath(path));
|
|
86617
86617
|
paths.add(getHrefPath(path));
|
|
86618
|
-
paths.add(getIdPath
|
|
86618
|
+
paths.add(getIdPath(path));
|
|
86619
86619
|
}
|
|
86620
86620
|
return [...paths];
|
|
86621
86621
|
}
|
|
@@ -86626,7 +86626,7 @@ class DataManager {
|
|
|
86626
86626
|
designValuePath,
|
|
86627
86627
|
getLabelPath(designValuePath),
|
|
86628
86628
|
getHrefPath(designValuePath),
|
|
86629
|
-
getIdPath
|
|
86629
|
+
getIdPath(designValuePath)
|
|
86630
86630
|
].map((path) => this.convertPathToWildcard(path))
|
|
86631
86631
|
);
|
|
86632
86632
|
const nodes = this.collectDepNodes();
|
|
@@ -86873,7 +86873,7 @@ function buildFieldSelectUpdates(valuePath, value, optionId, options = {}) {
|
|
|
86873
86873
|
[valuePath]: normalizedValue
|
|
86874
86874
|
};
|
|
86875
86875
|
if (options.persistOptionId) {
|
|
86876
|
-
updates[getIdPath
|
|
86876
|
+
updates[getIdPath(valuePath)] = optionId ?? null;
|
|
86877
86877
|
}
|
|
86878
86878
|
return updates;
|
|
86879
86879
|
}
|
|
@@ -89134,7 +89134,7 @@ const CLEAR_ON_MFG_ORDER_SWITCH = [F$2.materialContainer, F$2.productionContaine
|
|
|
89134
89134
|
const CLEAR_ON_MATERIAL_CONTAINER_NO_EMPTY = [...CLEAR_ON_COMMON_EMPTY];
|
|
89135
89135
|
const CLEAR_ON_MATERIAL_CONTAINER_NO_SWITCH = [F$2.mfgOrder, F$2.productionContainer];
|
|
89136
89136
|
const CLEAR_ON_MATERIAL_CONTAINER_NO_MANUAL_SWITCH = [...CLEAR_ON_COMMON_EMPTY];
|
|
89137
|
-
const MATERIAL_CONTAINER_ID = getIdPath
|
|
89137
|
+
const MATERIAL_CONTAINER_ID = getIdPath(F$2.materialContainer);
|
|
89138
89138
|
const PRODUCT_EDITABILITY_WATCH = [
|
|
89139
89139
|
F$2.materialContainer,
|
|
89140
89140
|
MATERIAL_CONTAINER_ID,
|
|
@@ -89444,7 +89444,7 @@ function handleMfgOrderChange(doc, subFieldKey, rowIndex) {
|
|
|
89444
89444
|
function handleMaterialContainerNoChange(doc, subFieldKey, rowIndex) {
|
|
89445
89445
|
const ctx = getRowChangeCtx(doc, subFieldKey, rowIndex);
|
|
89446
89446
|
if (!ctx) return;
|
|
89447
|
-
const clearWhenPresent = isBlank(ctx.row[getIdPath
|
|
89447
|
+
const clearWhenPresent = isBlank(ctx.row[getIdPath(F$2.materialContainer)]) ? [...CLEAR_ON_MATERIAL_CONTAINER_NO_MANUAL_SWITCH, ...CLEAR_ON_MATERIAL_CONTAINER_NO_SWITCH] : CLEAR_ON_MATERIAL_CONTAINER_NO_SWITCH;
|
|
89448
89448
|
handleIdentityFieldChange$1(
|
|
89449
89449
|
ctx,
|
|
89450
89450
|
F$2.materialContainer,
|
|
@@ -109014,7 +109014,7 @@ class MaterialConsumeTableController {
|
|
|
109014
109014
|
if (data.expiration) {
|
|
109015
109015
|
row.expiration_date_ = toDateOnly(data.expiration);
|
|
109016
109016
|
}
|
|
109017
|
-
this.setDefaultValue(row);
|
|
109017
|
+
this.setDefaultValue(row, option.doc);
|
|
109018
109018
|
try {
|
|
109019
109019
|
const newArr = this.bomEntriesValidator.mergeRowInArr(row, this.actualTableData);
|
|
109020
109020
|
await this.bomEntriesValidator.validateScanCanInsert(newArr);
|
|
@@ -109256,7 +109256,7 @@ class MaterialConsumeTableController {
|
|
|
109256
109256
|
* 设置默认值,如工序,需求数量/已消耗数量
|
|
109257
109257
|
* @param row
|
|
109258
109258
|
*/
|
|
109259
|
-
setDefaultValue(row) {
|
|
109259
|
+
setDefaultValue(row, doc) {
|
|
109260
109260
|
if (!row.routing_operation_id_) {
|
|
109261
109261
|
row.routing_operation_id_ = this.tmplBomController.operationId;
|
|
109262
109262
|
}
|
|
@@ -109268,6 +109268,7 @@ class MaterialConsumeTableController {
|
|
|
109268
109268
|
row.bom_entry_id_ = util.bomEntry.id_;
|
|
109269
109269
|
}
|
|
109270
109270
|
}
|
|
109271
|
+
this.updateRowConsumed(doc);
|
|
109271
109272
|
}
|
|
109272
109273
|
getDefaultValue(row) {
|
|
109273
109274
|
const value = {};
|
|
@@ -109487,9 +109488,10 @@ const syncMaterialConsumeTableBomInfo = async (templateId, docModel) => {
|
|
|
109487
109488
|
};
|
|
109488
109489
|
const initMaterialConsumeTableConfig = (doc, subConfig, tmplBomC) => {
|
|
109489
109490
|
if (!tmplBomC?.formInstBom?.formTmplBomList) return;
|
|
109490
|
-
const useBomMode = tmplBomC.defaultMCPattern === MaterialConsumptionPatternEnum.BOM;
|
|
109491
109491
|
tmplBomC.formInstBom.formTmplBomList.forEach(
|
|
109492
109492
|
({ personal_bom_enabled_, entries_, table_key_ }) => {
|
|
109493
|
+
const tableController = tmplBomC?.findTableControllerByField(table_key_);
|
|
109494
|
+
const useBomMode = tableController?.mcPattern === MaterialConsumptionPatternEnum.BOM;
|
|
109493
109495
|
if (useBomMode) {
|
|
109494
109496
|
const entries = personal_bom_enabled_ ? entries_ : tmplBomC.bomEntries;
|
|
109495
109497
|
const includedIds = [];
|
|
@@ -109509,7 +109511,6 @@ const initMaterialConsumeTableConfig = (doc, subConfig, tmplBomC) => {
|
|
|
109509
109511
|
});
|
|
109510
109512
|
rows.forEach((row, rowIndex) => {
|
|
109511
109513
|
const rowPath = `${table_key_}[${rowIndex}]`;
|
|
109512
|
-
const tableController = tmplBomC?.findTableControllerByField(table_key_);
|
|
109513
109514
|
if (row.product_id_) {
|
|
109514
109515
|
const versionId = row.product_id_.split(":").pop();
|
|
109515
109516
|
if (versionId) {
|
|
@@ -109534,6 +109535,12 @@ const initMaterialConsumeTableConfig = (doc, subConfig, tmplBomC) => {
|
|
|
109534
109535
|
}
|
|
109535
109536
|
);
|
|
109536
109537
|
};
|
|
109538
|
+
const handleAllMCTablesMounted = (doc, tmplBomC) => {
|
|
109539
|
+
tmplBomC.formInstBom?.formTmplBomList?.forEach(({ table_key_ }) => {
|
|
109540
|
+
const tableController = tmplBomC.findTableControllerByField(table_key_);
|
|
109541
|
+
tableController?.updateRowConsumed(doc);
|
|
109542
|
+
});
|
|
109543
|
+
};
|
|
109537
109544
|
class DocRequestStrategy {
|
|
109538
109545
|
props;
|
|
109539
109546
|
payload;
|
|
@@ -110825,10 +110832,14 @@ function useDocumentFactory(props, payload) {
|
|
|
110825
110832
|
try {
|
|
110826
110833
|
const response = await runFetchDocument(newRequestId);
|
|
110827
110834
|
if (!response) return;
|
|
110828
|
-
if (response.tmplBomC) {
|
|
110829
|
-
tmplBomCRef.value = response.tmplBomC;
|
|
110830
|
-
}
|
|
110831
110835
|
await mountDocument(response);
|
|
110836
|
+
const { tmplBomC } = response;
|
|
110837
|
+
if (tmplBomC) {
|
|
110838
|
+
tmplBomCRef.value = tmplBomC;
|
|
110839
|
+
if (docIns.value) {
|
|
110840
|
+
handleAllMCTablesMounted(docIns.value, tmplBomC);
|
|
110841
|
+
}
|
|
110842
|
+
}
|
|
110832
110843
|
} catch (err) {
|
|
110833
110844
|
console.error(err);
|
|
110834
110845
|
}
|
|
@@ -111743,7 +111754,7 @@ function appendFillMapPayload(payload, parsed, parseRules, runtimeValuePath) {
|
|
|
111743
111754
|
for (const formField of mapItem?.formFields || []) {
|
|
111744
111755
|
const path = resolveTargetPath(runtimeValuePath, formField);
|
|
111745
111756
|
if (!path || path === runtimeValuePath) continue;
|
|
111746
|
-
Object.assign(payload, setValue
|
|
111757
|
+
Object.assign(payload, setValue(value, path));
|
|
111747
111758
|
}
|
|
111748
111759
|
}
|
|
111749
111760
|
}
|
|
@@ -111794,7 +111805,7 @@ async function submitDeviceScan(params) {
|
|
|
111794
111805
|
if (!row) {
|
|
111795
111806
|
return { ok: false, message: MSG_NO_DATA };
|
|
111796
111807
|
}
|
|
111797
|
-
const payload = setValue
|
|
111808
|
+
const payload = setValue(row.__VALUE__, runtimeValuePath);
|
|
111798
111809
|
appendFillMapPayload(payload, parsed, parseRules, runtimeValuePath);
|
|
111799
111810
|
return { ok: true, payload, record: row._item };
|
|
111800
111811
|
}
|
|
@@ -125381,7 +125392,7 @@ const _sfc_main$2c = /* @__PURE__ */ defineComponent({
|
|
|
125381
125392
|
return getValue$1(value, isMultiple.value);
|
|
125382
125393
|
},
|
|
125383
125394
|
set(v) {
|
|
125384
|
-
const data = setValue
|
|
125395
|
+
const data = setValue(v, runtimeValuePath.value, {
|
|
125385
125396
|
multiple: isMultiple.value
|
|
125386
125397
|
});
|
|
125387
125398
|
docInst.value?.dataManager.setMultiple(data, "user");
|
|
@@ -139658,7 +139669,7 @@ const _sfc_main$f = /* @__PURE__ */ defineComponent({
|
|
|
139658
139669
|
emitChange(value);
|
|
139659
139670
|
}
|
|
139660
139671
|
function emitChange(value) {
|
|
139661
|
-
const data = setValue
|
|
139672
|
+
const data = setValue(value, runtimeValuePath.value, {
|
|
139662
139673
|
multiple: props.isMultiple
|
|
139663
139674
|
});
|
|
139664
139675
|
emit("change", data);
|
|
@@ -139955,7 +139966,7 @@ const _sfc_main$d = /* @__PURE__ */ defineComponent({
|
|
|
139955
139966
|
emitChange(null);
|
|
139956
139967
|
}
|
|
139957
139968
|
function emitChange(value) {
|
|
139958
|
-
const data = setValue
|
|
139969
|
+
const data = setValue(value, runtimeValuePath.value, {
|
|
139959
139970
|
multiple: props.isMultiple
|
|
139960
139971
|
});
|
|
139961
139972
|
emit("change", data);
|
|
@@ -140043,7 +140054,7 @@ const _sfc_main$c = /* @__PURE__ */ defineComponent({
|
|
|
140043
140054
|
() => isDateTime.value ? resolveDateTimePickerTimeFormat(widgetProps.value) : void 0
|
|
140044
140055
|
);
|
|
140045
140056
|
function onPanelChange(v) {
|
|
140046
|
-
const data = setValue
|
|
140057
|
+
const data = setValue(
|
|
140047
140058
|
v ? formatDateTimeForStorage(v, storageFormat.value, pickerTimeFormat.value) : v,
|
|
140048
140059
|
runtimeValuePath.value
|
|
140049
140060
|
);
|
|
@@ -140082,7 +140093,7 @@ const _sfc_main$b = /* @__PURE__ */ defineComponent({
|
|
|
140082
140093
|
const pickerFormat = computed(() => resolveTimePickerFormat(widgetProps.value));
|
|
140083
140094
|
function onPanelChange(timeObj) {
|
|
140084
140095
|
const value = timeObj.value == null ? timeObj.value : completeTimeValue(timeObj.value);
|
|
140085
|
-
const data = setValue
|
|
140096
|
+
const data = setValue(value, runtimeValuePath.value);
|
|
140086
140097
|
emit("change", data);
|
|
140087
140098
|
}
|
|
140088
140099
|
return (_ctx, _cache) => {
|
|
@@ -140555,7 +140566,7 @@ function useTableDropdown(props, searchFilters) {
|
|
|
140555
140566
|
const columns2 = computed(() => getColumns(strategy.value.columnsKey, strategy.value.isTree));
|
|
140556
140567
|
const selectedId = computed(() => {
|
|
140557
140568
|
if (!runtimeValuePath.value) return void 0;
|
|
140558
|
-
const id = docInst.value.dataManager.get(getIdPath
|
|
140569
|
+
const id = docInst.value.dataManager.get(getIdPath(runtimeValuePath.value));
|
|
140559
140570
|
return id != null && id !== "" ? String(id) : void 0;
|
|
140560
140571
|
});
|
|
140561
140572
|
const businessLinkage = computed(
|
|
@@ -140782,10 +140793,6 @@ const _sfc_main$7 = /* @__PURE__ */ defineComponent({
|
|
|
140782
140793
|
row?._item?.id_,
|
|
140783
140794
|
{ persistOptionId: persistOptionId.value }
|
|
140784
140795
|
);
|
|
140785
|
-
if (persistOptionId.value) {
|
|
140786
|
-
const idPath = getIdPath(runtimeValuePath.value);
|
|
140787
|
-
Object.assign(data, setValue(row?._item?.id_ ?? void 0, idPath));
|
|
140788
|
-
}
|
|
140789
140796
|
if (clearValuePath.value) {
|
|
140790
140797
|
Object.assign(data, buildFieldSelectUpdates(clearValuePath.value, void 0));
|
|
140791
140798
|
}
|
|
@@ -140978,7 +140985,7 @@ const _sfc_main$5 = /* @__PURE__ */ defineComponent({
|
|
|
140978
140985
|
showValue = value;
|
|
140979
140986
|
}
|
|
140980
140987
|
}
|
|
140981
|
-
const data = setValue
|
|
140988
|
+
const data = setValue(showValue, runtimeValuePath.value);
|
|
140982
140989
|
emit("change", data, __DEFAULT__ ? __DEFAULT__._item : row?._item);
|
|
140983
140990
|
};
|
|
140984
140991
|
__expose({
|
|
@@ -141389,7 +141396,7 @@ const _sfc_main$3 = /* @__PURE__ */ defineComponent({
|
|
|
141389
141396
|
GctMessage.warning("请等待附件上传完成后再点击确定");
|
|
141390
141397
|
return;
|
|
141391
141398
|
}
|
|
141392
|
-
return setValue
|
|
141399
|
+
return setValue(innerValue.value, runtimeValuePath.value);
|
|
141393
141400
|
}
|
|
141394
141401
|
function cancelUploading() {
|
|
141395
141402
|
uploadRef.value?.cancelUploading?.();
|
|
@@ -141717,7 +141724,7 @@ const _sfc_main$1 = /* @__PURE__ */ defineComponent({
|
|
|
141717
141724
|
GctMessage.warning("请等待图片上传完成后再点击确定");
|
|
141718
141725
|
return;
|
|
141719
141726
|
}
|
|
141720
|
-
return setValue
|
|
141727
|
+
return setValue(innerValue.value, runtimeValuePath.value);
|
|
141721
141728
|
}
|
|
141722
141729
|
function cancelUploading() {
|
|
141723
141730
|
uploadRef.value?.cancelUploading?.();
|
|
@@ -142002,7 +142009,7 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
142002
142009
|
const persistSignatures = () => {
|
|
142003
142010
|
const list = signatureList.value.map(({ displaySrc: _2, ...item }) => item);
|
|
142004
142011
|
const data = list.length ? JSON.stringify(list) : void 0;
|
|
142005
|
-
return setValue
|
|
142012
|
+
return setValue(data, runtimeValuePath.value);
|
|
142006
142013
|
};
|
|
142007
142014
|
const validateAll = async () => {
|
|
142008
142015
|
clearErrors();
|
package/dist/runtime/canvas/table/render/material-consume/material-consume-table-controller.d.ts
CHANGED
|
@@ -237,7 +237,7 @@ export declare class MaterialConsumeTableController {
|
|
|
237
237
|
* 设置默认值,如工序,需求数量/已消耗数量
|
|
238
238
|
* @param row
|
|
239
239
|
*/
|
|
240
|
-
setDefaultValue(row: IMaterialConsumeData): void;
|
|
240
|
+
setDefaultValue(row: IMaterialConsumeData, doc: Doc): void;
|
|
241
241
|
getDefaultValue(row: IMaterialConsumeData): any;
|
|
242
242
|
/**
|
|
243
243
|
* 处理[物料消耗表]下拉字段变更
|
|
@@ -2,10 +2,15 @@ import { Doc } from '../../../../../core';
|
|
|
2
2
|
import { DocModel } from '../../../../../core/model';
|
|
3
3
|
import { FormTmplBomController } from './tmpl-bom-controller';
|
|
4
4
|
/**
|
|
5
|
-
* 同步[物料消耗表] formTmplBomList
|
|
5
|
+
* 同步[物料消耗表] formTmplBomList 信息到 widgetProps 上
|
|
6
|
+
* 因为 formTmplBomList 有独立存取接口
|
|
6
7
|
*/
|
|
7
8
|
export declare const syncMaterialConsumeTableBomInfo: (templateId: string, docModel: DocModel) => Promise<void>;
|
|
8
9
|
/**
|
|
9
10
|
* 处理表单实例上的[物料消耗表]相关配置
|
|
10
11
|
*/
|
|
11
12
|
export declare const initMaterialConsumeTableConfig: (doc: Doc, subConfig: Record<string, any>, tmplBomC?: FormTmplBomController) => void;
|
|
13
|
+
/**
|
|
14
|
+
* 文档加载完毕后,处理所有[物料消耗表]已消耗数量累加计算
|
|
15
|
+
*/
|
|
16
|
+
export declare const handleAllMCTablesMounted: (doc: Doc, tmplBomC: FormTmplBomController) => void;
|