@gct-paas/word 0.2.44-beta.0 → 0.2.45-beta.0
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
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/*! @gct-paas/word v0.2.
|
|
1
|
+
/*! @gct-paas/word v0.2.45-beta.0 */
|
|
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, shallowReactive, shallowRef, toDisplayString, toHandlers, toRaw, toRef, toValue, unref, useAttrs, useCssVars, useModel, useSlots, vModelRadio, vModelSelect, vModelText, vShow, watch, watchEffect, withCtx, withDirectives, withKeys, withModifiers } from "vue";
|
|
3
3
|
import da, { PopperWrapper } from "floating-vue";
|
|
4
4
|
import VueKonva from "vue-konva";
|
|
@@ -127080,7 +127080,7 @@ var init_fetchers = __esmMin((() => {
|
|
|
127080
127080
|
};
|
|
127081
127081
|
return {
|
|
127082
127082
|
options: this.toOptions(result.data, params.optionMapping),
|
|
127083
|
-
totalPage: result.totalPage,
|
|
127083
|
+
totalPage: result.totalPage ?? 0,
|
|
127084
127084
|
totalCount: result.totalCount
|
|
127085
127085
|
};
|
|
127086
127086
|
}
|
|
@@ -127099,9 +127099,10 @@ var init_fetchers = __esmMin((() => {
|
|
|
127099
127099
|
/** 多条转 Options */
|
|
127100
127100
|
toOptions(items, optionMapping) {
|
|
127101
127101
|
var _this$config$transfor2;
|
|
127102
|
-
|
|
127103
|
-
if ((
|
|
127104
|
-
|
|
127102
|
+
const data = items ?? [];
|
|
127103
|
+
if ((optionMapping === null || optionMapping === void 0 ? void 0 : optionMapping.value) || (optionMapping === null || optionMapping === void 0 ? void 0 : optionMapping.label)) return createTransformer(optionMapping.label ?? LABEL_FIELDS.default, optionMapping.value ?? VALUE_FIELDS.default).toOptions(data);
|
|
127104
|
+
if ((_this$config$transfor2 = this.config.transformers) === null || _this$config$transfor2 === void 0 ? void 0 : _this$config$transfor2.toOptions) return this.config.transformers.toOptions(data);
|
|
127105
|
+
return data.map((i) => this.toOption(i));
|
|
127105
127106
|
}
|
|
127106
127107
|
};
|
|
127107
127108
|
apiFetchers = {
|
|
@@ -158327,14 +158328,12 @@ function matchProductId(rowProductId, ruleProductId) {
|
|
|
158327
158328
|
if (!ruleId.includes(":") && rowId.startsWith(`${ruleId}:`)) return true;
|
|
158328
158329
|
return false;
|
|
158329
158330
|
}
|
|
158330
|
-
/**
|
|
158331
|
+
/** 源单位匹配数量单位,目标单位匹配需求数量单位,兼容旧配置保存的固定字段映射。 */
|
|
158331
158332
|
function matchBaseUom(row, fieldMaps = []) {
|
|
158332
|
-
const
|
|
158333
|
-
const
|
|
158334
|
-
if (!(
|
|
158335
|
-
|
|
158336
|
-
const loadingField = loadingUnit.formField || DEFAULT_TARGET_UOM_FIELD;
|
|
158337
|
-
return sameId(row[requiredField], requiredUnit.value) && sameId(row[loadingField], loadingUnit.value);
|
|
158333
|
+
const source = fieldMaps.find((m) => m.key === SOURCE_UNIT_KEY$1);
|
|
158334
|
+
const target = fieldMaps.find((m) => m.key === TARGET_UNIT_KEY$1);
|
|
158335
|
+
if (!(source === null || source === void 0 ? void 0 : source.value) || !(target === null || target === void 0 ? void 0 : target.value)) return false;
|
|
158336
|
+
return sameId(row.qty_uom_id_, source.value) && sameId(row.qty_required_uom_id_, target.value);
|
|
158338
158337
|
}
|
|
158339
158338
|
/**
|
|
158340
158339
|
* 规则是否适用于当前行。
|
|
@@ -158429,8 +158428,8 @@ var init_uom_convert_runtime = __esmMin((() => {
|
|
|
158429
158428
|
SOURCE_UNIT_KEY$1 = "sourceUnit";
|
|
158430
158429
|
TARGET_UNIT_KEY$1 = "targetUnit";
|
|
158431
158430
|
FORMULA_RULE_INPUT_KEY = "formulaRuleInput";
|
|
158432
|
-
DEFAULT_SOURCE_UOM_FIELD = "
|
|
158433
|
-
DEFAULT_TARGET_UOM_FIELD = "
|
|
158431
|
+
DEFAULT_SOURCE_UOM_FIELD = "qty_uom_id_";
|
|
158432
|
+
DEFAULT_TARGET_UOM_FIELD = "qty_required_uom_id_";
|
|
158434
158433
|
DEFAULT_INPUT_FIELD = "qty_";
|
|
158435
158434
|
}));
|
|
158436
158435
|
//#endregion
|
|
@@ -158471,7 +158470,7 @@ var init_bom_validator$1 = __esmMin((() => {
|
|
|
158471
158470
|
return this.historyQty.toNumber();
|
|
158472
158471
|
}
|
|
158473
158472
|
get historyQtyForValidation() {
|
|
158474
|
-
return this.
|
|
158473
|
+
return this.calcQtyForBounds(this.historyData, "history");
|
|
158475
158474
|
}
|
|
158476
158475
|
get remainingQty() {
|
|
158477
158476
|
return minus(this.totalQty, this.historyQtyForValidation);
|
|
@@ -158646,7 +158645,7 @@ var init_bom_validator$1 = __esmMin((() => {
|
|
|
158646
158645
|
if (this.bomEntry.type_ === "view") return;
|
|
158647
158646
|
const groupData = this.filterGroupData(arr);
|
|
158648
158647
|
if (!groupData.some((row) => Number(row.qty_))) return;
|
|
158649
|
-
const consumeNum = this.
|
|
158648
|
+
const consumeNum = this.calcQtyForBounds(arr);
|
|
158650
158649
|
if (["eq", "lte"].includes(this.bomEntry.qty_validation_rule_) && compare(consumeNum, this.remainingQty) === 1) throw new Error("当前物料上料总消耗不能大于需求数量");
|
|
158651
158650
|
if (this.bomEntry.qty_validation_rule_ === "bounds") {
|
|
158652
158651
|
const consumeSum = plus(consumeNum, this.historyQtyForValidation);
|
|
@@ -158674,7 +158673,7 @@ var init_bom_validator$1 = __esmMin((() => {
|
|
|
158674
158673
|
return sum(this.filterGroupData(arr, source).map((row) => Number(row.qty_ ?? 0)));
|
|
158675
158674
|
}
|
|
158676
158675
|
/** 当前及历史数据按行取转换后数量,未转换的行使用上料数量。 */
|
|
158677
|
-
|
|
158676
|
+
calcQtyForBounds(arr, source = "current") {
|
|
158678
158677
|
return sum(this.filterGroupData(arr, source).map((row) => parseConvertedQty(row.qty_transfer_) ?? Number(row.qty_ ?? 0)));
|
|
158679
158678
|
}
|
|
158680
158679
|
calcRunningQtyConsumed(arr) {
|
|
@@ -158711,7 +158710,7 @@ var init_bom_validator$1 = __esmMin((() => {
|
|
|
158711
158710
|
const entry = this.bomEntry;
|
|
158712
158711
|
if (!entry.qty_validation_enabled_ || entry.type_ === "view") return;
|
|
158713
158712
|
const groupData = this.filterGroupData(arr);
|
|
158714
|
-
const loaded = this.
|
|
158713
|
+
const loaded = this.calcQtyForBounds(arr);
|
|
158715
158714
|
const historical = this.historyQtyForValidation;
|
|
158716
158715
|
let required = this.totalQty;
|
|
158717
158716
|
if (this.isCustomRequiredQty) {
|
|
@@ -158760,7 +158759,7 @@ var init_bom_validator$1 = __esmMin((() => {
|
|
|
158760
158759
|
throw new Error(message);
|
|
158761
158760
|
}
|
|
158762
158761
|
if (this.bomEntry.type_ === "view") return;
|
|
158763
|
-
const consumeNum = this.bomEntry.qty_validation_enabled_ ? this.
|
|
158762
|
+
const consumeNum = this.bomEntry.qty_validation_enabled_ ? this.calcQtyForBounds(groupData) : this.calcQtyConsumed(groupData);
|
|
158764
158763
|
const zeroComparison = compare(consumeNum, 0);
|
|
158765
158764
|
if (!this.bomEntry.qty_validation_enabled_ && zeroComparison !== null && zeroComparison !== 0) return;
|
|
158766
158765
|
switch (this.bomEntry.qty_validation_rule_) {
|
|
@@ -205296,8 +205295,8 @@ var GROUP_SUB_PREFIX = "group:sub:";
|
|
|
205296
205295
|
/** 输入值 / 源单位 / 目标单位写死的表单字段 key */
|
|
205297
205296
|
var FIXED_FORM_FIELD_KEYS = {
|
|
205298
205297
|
formulaRuleInput: "qty_",
|
|
205299
|
-
[SOURCE_UNIT_KEY]: "
|
|
205300
|
-
[TARGET_UNIT_KEY]: "
|
|
205298
|
+
[SOURCE_UNIT_KEY]: "qty_uom_id_",
|
|
205299
|
+
[TARGET_UNIT_KEY]: "qty_required_uom_id_"
|
|
205301
205300
|
};
|
|
205302
205301
|
/** 写死字段右侧展示名 */
|
|
205303
205302
|
var FIXED_FORM_FIELD_LABELS = {
|
|
@@ -205420,6 +205419,16 @@ function applyFixedFormField(row, fieldKey) {
|
|
|
205420
205419
|
row.formFieldLabel = FIXED_FORM_FIELD_LABELS[fieldKey] ?? fieldKey;
|
|
205421
205420
|
row.fixed = true;
|
|
205422
205421
|
}
|
|
205422
|
+
/** 编辑旧规则时恢复固定字段的对应关系,保留参数字段和单位值。 */
|
|
205423
|
+
function normalizeFixedFieldMaps(fieldMaps) {
|
|
205424
|
+
return fieldMaps.map((item) => {
|
|
205425
|
+
const fieldKey = FIXED_FORM_FIELD_KEYS[item.key];
|
|
205426
|
+
if (!fieldKey) return item;
|
|
205427
|
+
const row = { ...item };
|
|
205428
|
+
applyFixedFormField(row, fieldKey);
|
|
205429
|
+
return row;
|
|
205430
|
+
});
|
|
205431
|
+
}
|
|
205423
205432
|
/** 按选中规则重建固定映射行 */
|
|
205424
205433
|
function buildFixedFieldMaps(options) {
|
|
205425
205434
|
const { expr, sourceUomId, targetUomId, sourceUomLabel, targetUomLabel } = options;
|
|
@@ -205601,10 +205610,8 @@ var unit_field_map_modal_vue_vue_type_script_setup_true_name_unit_field_map_moda
|
|
|
205601
205610
|
expressionStr: props.item.expressionStr,
|
|
205602
205611
|
productId: props.item.productId,
|
|
205603
205612
|
productName: props.item.productName,
|
|
205604
|
-
fieldMaps: cloneDeep(props.item.fieldMaps ?? [])
|
|
205613
|
+
fieldMaps: normalizeFixedFieldMaps(cloneDeep(props.item.fieldMaps ?? []))
|
|
205605
205614
|
});
|
|
205606
|
-
const unitDisplayTitles = /* @__PURE__ */ new Map([[TARGET_UNIT_KEY, "源单位"], [SOURCE_UNIT_KEY, "目标单位"]]);
|
|
205607
|
-
const displayedFieldMaps = computed(() => [...formState.fieldMaps.filter(({ key }) => !unitDisplayTitles.has(key)), ...Array.from(unitDisplayTitles.keys()).flatMap((unitKey) => formState.fieldMaps.filter(({ key }) => key === unitKey))]);
|
|
205608
205615
|
const errors = reactive({
|
|
205609
205616
|
ruleId: "",
|
|
205610
205617
|
fieldMaps: {}
|
|
@@ -205730,10 +205737,10 @@ var unit_field_map_modal_vue_vue_type_script_setup_true_name_unit_field_map_moda
|
|
|
205730
205737
|
_: 1
|
|
205731
205738
|
})]),
|
|
205732
205739
|
createElementVNode("div", _hoisted_4$19, [_cache[2] || (_cache[2] = createElementVNode("div", { class: "expression-show__title" }, "规则表达式", -1)), createElementVNode("div", { class: normalizeClass(["expression-show__value", !formState.ruleName && "placeholder"]) }, toDisplayString(formState.ruleName || "选择单位转换规则后自动带出"), 3)]),
|
|
205733
|
-
formState.fieldMaps.length ? (openBlock(), createElementBlock("div", _hoisted_5$15, [(openBlock(true), createElementBlock(Fragment, null, renderList(
|
|
205740
|
+
formState.fieldMaps.length ? (openBlock(), createElementBlock("div", _hoisted_5$15, [(openBlock(true), createElementBlock(Fragment, null, renderList(formState.fieldMaps, (item) => {
|
|
205734
205741
|
return openBlock(), createBlock(field_map_row_default, {
|
|
205735
205742
|
key: item.key,
|
|
205736
|
-
"left-title":
|
|
205743
|
+
"left-title": item.title,
|
|
205737
205744
|
"rule-expression-label": item.label,
|
|
205738
205745
|
"form-field": item.formField,
|
|
205739
205746
|
"onUpdate:formField": ($event) => item.formField = $event,
|
|
@@ -205775,7 +205782,7 @@ var unit_field_map_modal_vue_vue_type_script_setup_true_name_unit_field_map_moda
|
|
|
205775
205782
|
//#endregion
|
|
205776
205783
|
//#region src/suites/edhr/panel-schema/rule/modals/unit-field-map-modal.vue
|
|
205777
205784
|
init__plugin_vue_export_helper();
|
|
205778
|
-
var unit_field_map_modal_default = /*#__PURE__*/ _plugin_vue_export_helper_default(unit_field_map_modal_vue_vue_type_script_setup_true_name_unit_field_map_modal_lang_default, [["__scopeId", "data-v-
|
|
205785
|
+
var unit_field_map_modal_default = /*#__PURE__*/ _plugin_vue_export_helper_default(unit_field_map_modal_vue_vue_type_script_setup_true_name_unit_field_map_modal_lang_default, [["__scopeId", "data-v-373bcf09"]]);
|
|
205779
205786
|
//#endregion
|
|
205780
205787
|
//#region src/suites/edhr/panel-schema/rule/modals/open-rule-modal.ts
|
|
205781
205788
|
init_base$2();
|
|
@@ -116,7 +116,7 @@ export declare class BomEntryValidator {
|
|
|
116
116
|
*/
|
|
117
117
|
calcQtyConsumed(arr: IMaterialConsumeData[], source?: ConsumeDataSource): BigNumber;
|
|
118
118
|
/** 当前及历史数据按行取转换后数量,未转换的行使用上料数量。 */
|
|
119
|
-
|
|
119
|
+
calcQtyForBounds(arr: IMaterialConsumeData[], source?: ConsumeDataSource): BigNumber;
|
|
120
120
|
calcRunningQtyConsumed(arr: IMaterialConsumeData[]): number;
|
|
121
121
|
/**
|
|
122
122
|
* 计算自定义的数量校验的最大值和最小值
|
|
@@ -88,7 +88,7 @@ declare class APIFetcher {
|
|
|
88
88
|
label?: string;
|
|
89
89
|
}): Option;
|
|
90
90
|
/** 多条转 Options */
|
|
91
|
-
protected toOptions(items: any[], optionMapping?: {
|
|
91
|
+
protected toOptions(items: any[] | null | undefined, optionMapping?: {
|
|
92
92
|
value?: string;
|
|
93
93
|
label?: string;
|
|
94
94
|
}): Option[];
|
|
@@ -19,6 +19,8 @@ export declare function resolveLockedSubFieldKey(fieldMaps: RuleFieldMap[]): str
|
|
|
19
19
|
export declare function clearIncompatibleParamFormFields(fieldMaps: RuleFieldMap[], lockedSubFieldKey?: string): void;
|
|
20
20
|
export declare function clearFormFieldSelection(item: RuleFieldMap): void;
|
|
21
21
|
export declare function applyFormFieldSelection(item: RuleFieldMap, meta?: FieldTreeTargetMeta): void;
|
|
22
|
+
/** 编辑旧规则时恢复固定字段的对应关系,保留参数字段和单位值。 */
|
|
23
|
+
export declare function normalizeFixedFieldMaps(fieldMaps: RuleFieldMap[]): RuleFieldMap[];
|
|
22
24
|
/** 按选中规则重建固定映射行 */
|
|
23
25
|
export declare function buildFixedFieldMaps(options: {
|
|
24
26
|
expr?: string;
|
package/dist/word.css
CHANGED
|
@@ -13815,18 +13815,18 @@ svg.portrait-icon[data-v-8bdb451e] {
|
|
|
13815
13815
|
font-size: 12px;
|
|
13816
13816
|
line-height: 18px;
|
|
13817
13817
|
}
|
|
13818
|
-
.unit-field-map-modal__filters[data-v-
|
|
13818
|
+
.unit-field-map-modal__filters[data-v-373bcf09] {
|
|
13819
13819
|
display: grid;
|
|
13820
13820
|
grid-template-columns: 1fr 1fr;
|
|
13821
13821
|
gap: 12px;
|
|
13822
13822
|
}
|
|
13823
|
-
.error-text[data-v-
|
|
13823
|
+
.error-text[data-v-373bcf09] {
|
|
13824
13824
|
margin-top: 4px;
|
|
13825
13825
|
color: #ff4d4f;
|
|
13826
13826
|
font-size: 12px;
|
|
13827
13827
|
line-height: 18px;
|
|
13828
13828
|
}
|
|
13829
|
-
.expression-show[data-v-
|
|
13829
|
+
.expression-show[data-v-373bcf09] {
|
|
13830
13830
|
margin-top: 12px;
|
|
13831
13831
|
position: relative;
|
|
13832
13832
|
padding: 12px;
|
|
@@ -13834,13 +13834,13 @@ svg.portrait-icon[data-v-8bdb451e] {
|
|
|
13834
13834
|
border-radius: 4px;
|
|
13835
13835
|
background: #f9fafb;
|
|
13836
13836
|
}
|
|
13837
|
-
.expression-show__title[data-v-
|
|
13837
|
+
.expression-show__title[data-v-373bcf09] {
|
|
13838
13838
|
color: #1a1d23;
|
|
13839
13839
|
font-size: 12px;
|
|
13840
13840
|
font-weight: 400;
|
|
13841
13841
|
line-height: 18px;
|
|
13842
13842
|
}
|
|
13843
|
-
.expression-show__value[data-v-
|
|
13843
|
+
.expression-show__value[data-v-373bcf09] {
|
|
13844
13844
|
border: 1px solid #e8ebf0;
|
|
13845
13845
|
border-radius: 4px;
|
|
13846
13846
|
text-align: center;
|
|
@@ -13852,10 +13852,10 @@ svg.portrait-icon[data-v-8bdb451e] {
|
|
|
13852
13852
|
line-height: 18px;
|
|
13853
13853
|
margin-top: 6px;
|
|
13854
13854
|
}
|
|
13855
|
-
.expression-show__value.placeholder[data-v-
|
|
13855
|
+
.expression-show__value.placeholder[data-v-373bcf09] {
|
|
13856
13856
|
color: rgba(0, 0, 0, 0.25);
|
|
13857
13857
|
}
|
|
13858
|
-
.field-map-panel[data-v-
|
|
13858
|
+
.field-map-panel[data-v-373bcf09] {
|
|
13859
13859
|
margin-top: 12px;
|
|
13860
13860
|
padding: 12px;
|
|
13861
13861
|
border: 1px dashed #e0e3eb;
|