@gct-paas/word 0.1.74-beta.40 → 0.1.74-beta.41
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/domain/field/field-type.d.ts +24 -0
- package/dist/domain/object/date-object/index.d.ts +4 -0
- package/dist/domain/object/date-object/profile/field-keys.d.ts +19 -0
- package/dist/domain/object/date-object/profile/fields.d.ts +2 -0
- package/dist/domain/object/date-object/profile/index.d.ts +3 -0
- package/dist/domain/object/date-object/runtime/date-object-context.d.ts +41 -0
- package/dist/domain/object/date-object/runtime/date-object-runtime.d.ts +41 -0
- package/dist/domain/object/date-object/runtime/fetch-records.d.ts +16 -0
- package/dist/domain/object/date-object/runtime/object-handlers.d.ts +6 -0
- package/dist/domain/object/date-object/runtime/re-inspection-date.d.ts +49 -0
- package/dist/domain/object/date-object/runtime/register-handlers.d.ts +1 -0
- package/dist/domain/object/date-object/runtime/row-change-handlers.d.ts +6 -0
- package/dist/domain/object/date-object/types.d.ts +48 -0
- package/dist/index.es.js +1560 -908
- package/dist/runtime/renderer/dropdowns/components/tables/composables/useTableDropdown.d.ts +1 -0
- package/dist/suites/edhr/manifest/field/object-type/date-object-manifest.d.ts +3 -0
- package/dist/suites/edhr/manifest/field/object-type/re-inspection-date-manifest.d.ts +2 -0
- package/dist/suites/edhr/manifest/field/object-type/validity-manifest.d.ts +2 -0
- package/dist/suites/shared/panel/config/editor/display-fields-editor/display-fields-editor.vue.d.ts +1 -0
- package/dist/suites/shared/panel/config/editor/field-config-visibility.d.ts +1 -1
- package/dist/suites/shared/panel/config/editor/quick-search-editor/quick-search.util.d.ts +2 -5
- package/dist/word.css +27 -27
- package/package.json +1 -1
|
@@ -374,6 +374,18 @@ export declare const BUSINESS_FIELD_TYPE: {
|
|
|
374
374
|
* 物料消耗对象
|
|
375
375
|
*/
|
|
376
376
|
readonly MATERIAL_CONSUME: "material_consume";
|
|
377
|
+
/**
|
|
378
|
+
* 物料日期对象
|
|
379
|
+
*/
|
|
380
|
+
readonly DATE_OBJECT: "date_object";
|
|
381
|
+
/**
|
|
382
|
+
* 有效期
|
|
383
|
+
*/
|
|
384
|
+
readonly VALIDITY: "validity";
|
|
385
|
+
/**
|
|
386
|
+
* 下一次复检日期
|
|
387
|
+
*/
|
|
388
|
+
readonly RE_INSPECTION_DATE: "re_inspection_date";
|
|
377
389
|
/**
|
|
378
390
|
* 数量
|
|
379
391
|
*/
|
|
@@ -574,6 +586,18 @@ export declare const FIELD_TYPE: {
|
|
|
574
586
|
* 物料消耗对象
|
|
575
587
|
*/
|
|
576
588
|
readonly MATERIAL_CONSUME: "material_consume";
|
|
589
|
+
/**
|
|
590
|
+
* 物料日期对象
|
|
591
|
+
*/
|
|
592
|
+
readonly DATE_OBJECT: "date_object";
|
|
593
|
+
/**
|
|
594
|
+
* 有效期
|
|
595
|
+
*/
|
|
596
|
+
readonly VALIDITY: "validity";
|
|
597
|
+
/**
|
|
598
|
+
* 下一次复检日期
|
|
599
|
+
*/
|
|
600
|
+
readonly RE_INSPECTION_DATE: "re_inspection_date";
|
|
577
601
|
/**
|
|
578
602
|
* 数量
|
|
579
603
|
*/
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
/** 批次 / 物料下拉 option 上的字段 */
|
|
2
|
+
export declare const OptionF: {
|
|
3
|
+
/** 物料 */
|
|
4
|
+
readonly productId: "product_id_";
|
|
5
|
+
/** 生产日期 */
|
|
6
|
+
readonly productionDate: "production_date_";
|
|
7
|
+
/** 有效期 */
|
|
8
|
+
readonly validity: "validate_";
|
|
9
|
+
/** 下一次复检日期 */
|
|
10
|
+
readonly reInspectionDate: "re_inspection_date_";
|
|
11
|
+
/** 复检周期 */
|
|
12
|
+
readonly reInspectionInterval: "re_inspection_interval_";
|
|
13
|
+
/** 复检周期单位 */
|
|
14
|
+
readonly reInspectionIntervalUnit: "re_inspection_interval_unit_";
|
|
15
|
+
};
|
|
16
|
+
/** paramsConfig.txnConfig.businessType:复检场景 */
|
|
17
|
+
export declare const RE_INSPECTION_BUSINESS_TYPE = "reInspection";
|
|
18
|
+
/** 真正要按周期计算、但物料未配周期时的提示 */
|
|
19
|
+
export declare const MISSING_RE_INSPECTION_INTERVAL_MSG = "\u5F53\u524D\u7269\u6599\u672A\u914D\u7F6E\u590D\u68C0\u5468\u671F\uFF0C\u65E0\u6CD5\u8BA1\u7B97\u4E0B\u4E00\u6B21\u590D\u68C0\u65E5\u671F";
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
import { Doc } from '../../../../core';
|
|
2
|
+
import { FIELD_TYPE } from '../../../field/field-type';
|
|
3
|
+
import { DateObjectFieldProfile, DateObjectProfile } from '../types';
|
|
4
|
+
/** 日期对象子字段身份:控件 fieldLink 末段即主表 field key */
|
|
5
|
+
interface DateObjectChildField {
|
|
6
|
+
key: string;
|
|
7
|
+
}
|
|
8
|
+
/** 同一日期对象下的子字段,按 bizType 索引 */
|
|
9
|
+
interface DateObjectFieldSet {
|
|
10
|
+
belongingObject: string;
|
|
11
|
+
byBizType: Partial<Record<FIELD_TYPE, DateObjectChildField>>;
|
|
12
|
+
}
|
|
13
|
+
/** 单个物料日期对象实例:Profile + 同组字段 */
|
|
14
|
+
export declare class DateObjectContext {
|
|
15
|
+
readonly doc: Doc;
|
|
16
|
+
readonly profile: DateObjectProfile;
|
|
17
|
+
readonly belongingObject: string;
|
|
18
|
+
readonly fieldSet: DateObjectFieldSet;
|
|
19
|
+
/**
|
|
20
|
+
* @param doc 当前文档
|
|
21
|
+
* @param profile 日期对象 Profile
|
|
22
|
+
* @param belongingObject 对象字段 key,同组子字段都挂在它下面
|
|
23
|
+
* @param fieldSet 已按 bizType 收好的同组字段
|
|
24
|
+
*/
|
|
25
|
+
constructor(doc: Doc, profile: DateObjectProfile, belongingObject: string, fieldSet: DateObjectFieldSet);
|
|
26
|
+
/** 按 bizType 取同组字段 key */
|
|
27
|
+
fieldByBizType(bizType: FIELD_TYPE): DateObjectChildField | undefined;
|
|
28
|
+
/** 主表路径 `$.{fieldKey}` */
|
|
29
|
+
path(bizType: FIELD_TYPE): string | undefined;
|
|
30
|
+
/** 读取同组字段当前值 */
|
|
31
|
+
getValue(bizType: FIELD_TYPE): unknown;
|
|
32
|
+
/** 按 bizType 查找字段 Profile */
|
|
33
|
+
findFieldProfile(bizType: FIELD_TYPE): DateObjectFieldProfile | undefined;
|
|
34
|
+
/** 按主表 field key 反查同组 bizType */
|
|
35
|
+
bizTypeByFieldKey(fieldKey: string | undefined): FIELD_TYPE | undefined;
|
|
36
|
+
/** 一次模型遍历,收集文档内全部物料日期对象 */
|
|
37
|
+
static collectAll(doc: Doc): DateObjectContext[];
|
|
38
|
+
/** 按对象 key 查找上下文;不是日期对象则返回 undefined */
|
|
39
|
+
static find(doc: Doc, belongingObject: string | undefined): DateObjectContext | undefined;
|
|
40
|
+
}
|
|
41
|
+
export {};
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
import { Doc } from '../../../../core';
|
|
2
|
+
import { FieldChangeMap } from '../../../../core/data';
|
|
3
|
+
export declare class DateObjectRuntime {
|
|
4
|
+
private readonly doc;
|
|
5
|
+
/** 绑定当前文档;每次 overlay / afterFlush 可 new 一份 */
|
|
6
|
+
constructor(doc: Doc);
|
|
7
|
+
/** 文档初始化:按当前物料写入批次下拉过滤参数 */
|
|
8
|
+
onInit(): void;
|
|
9
|
+
/**
|
|
10
|
+
* 选中 / 清空下拉:按 profile.fillFromOption、clearOnEmpty 回填。
|
|
11
|
+
* 只反填物料 / 生产日期 / 有效期;下一次复检日期由 afterFlush 现查接口计算。
|
|
12
|
+
*/
|
|
13
|
+
buildFillFromOption(options: {
|
|
14
|
+
belongingObject?: string;
|
|
15
|
+
bizType?: string;
|
|
16
|
+
selectedOption?: Record<string, unknown> | null;
|
|
17
|
+
}): Record<string, unknown>;
|
|
18
|
+
/**
|
|
19
|
+
* 用户改上游字段时,按 select.clearOnLinkChange 清空下游。
|
|
20
|
+
* 只看「本次点选的字段」,避免批次反填物料时把批次自己清掉。
|
|
21
|
+
*/
|
|
22
|
+
buildDownstreamClears(options: {
|
|
23
|
+
belongingObject?: string;
|
|
24
|
+
bizType?: string;
|
|
25
|
+
pending?: Record<string, unknown>;
|
|
26
|
+
}): Record<string, unknown>;
|
|
27
|
+
/**
|
|
28
|
+
* 用户变更主表字段后:刷新级联 query,并按 profile.rowHandlers 现查接口重算。
|
|
29
|
+
*/
|
|
30
|
+
onFieldChanges(changedMap: FieldChangeMap, options?: {
|
|
31
|
+
batchSource?: string;
|
|
32
|
+
}): Promise<void>;
|
|
33
|
+
/** 主表路径 `$.fieldKey` → 对象内 bizType */
|
|
34
|
+
private resolveChangedBizType;
|
|
35
|
+
/** 批次反填物料时物料值未变,不应触发 clearOnLinkChange */
|
|
36
|
+
private isUnchangedProduct;
|
|
37
|
+
/** 按 select.buildLinkQuery 写入批次下拉过滤参数 */
|
|
38
|
+
private applyLinkage;
|
|
39
|
+
/** 按 bizType 把同组字段写成 null;批次额外清 _id_ */
|
|
40
|
+
private buildClearUpdates;
|
|
41
|
+
}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
/** 物料信息:按版本 id 拉一条(value 可能是 baseId:versionId) */
|
|
2
|
+
export declare function fetchProductRecord(productValue: unknown): Promise<Record<string, unknown> | null>;
|
|
3
|
+
/** 批次信息:优先 companion id,否则按批次号 name_ */
|
|
4
|
+
export declare function fetchLotRecord(options: {
|
|
5
|
+
lotId?: unknown;
|
|
6
|
+
lotName?: unknown;
|
|
7
|
+
}): Promise<Record<string, unknown> | null>;
|
|
8
|
+
/** 并行拉物料 + 批次;缺 ident 的一侧不请求 */
|
|
9
|
+
export declare function fetchDateObjectRecords(options: {
|
|
10
|
+
productValue?: unknown;
|
|
11
|
+
lotId?: unknown;
|
|
12
|
+
lotName?: unknown;
|
|
13
|
+
}): Promise<{
|
|
14
|
+
product: Record<string, unknown> | null;
|
|
15
|
+
lot: Record<string, unknown> | null;
|
|
16
|
+
}>;
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { Doc } from '../../../../core';
|
|
2
|
+
export type DateObjectHandler = (doc: Doc, belongingObject: string) => void | Promise<void>;
|
|
3
|
+
/** 注册对象级运行时钩子;profile 只需写短名 */
|
|
4
|
+
export declare function registerDateObjectHandler(name: string, handler: DateObjectHandler): void;
|
|
5
|
+
/** 执行指定短名的对象处理器;未注册则静默跳过 */
|
|
6
|
+
export declare function runDateObjectHandler(name: string | undefined, doc: Doc, belongingObject: string): Promise<void>;
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
import { MISSING_RE_INSPECTION_INTERVAL_MSG } from '../profile/field-keys';
|
|
2
|
+
export { MISSING_RE_INSPECTION_INTERVAL_MSG };
|
|
3
|
+
export type ReInspectionIntervalUnit = 'day' | 'month';
|
|
4
|
+
export interface ReInspectionInterval {
|
|
5
|
+
/** 复检周期 */
|
|
6
|
+
amount: number;
|
|
7
|
+
/** 复检周期单位 */
|
|
8
|
+
unit: ReInspectionIntervalUnit;
|
|
9
|
+
}
|
|
10
|
+
export interface ResolveNextReInspectionDateInput {
|
|
11
|
+
/** paramsConfig.txnConfig.businessType === reInspection */
|
|
12
|
+
isReInspection: boolean;
|
|
13
|
+
/** 批次接口上的下一次复检日期 */
|
|
14
|
+
lotReInspectionDate?: unknown;
|
|
15
|
+
/** 当前生产日期(批次带出或手选) */
|
|
16
|
+
productionDate?: unknown;
|
|
17
|
+
/** 复检周期信息 */
|
|
18
|
+
interval?: ReInspectionInterval;
|
|
19
|
+
}
|
|
20
|
+
export interface ResolveNextReInspectionDateResult {
|
|
21
|
+
value: string | null;
|
|
22
|
+
/** 是否走「生产日期 / 接口日期 + 周期」计算 */
|
|
23
|
+
needCalculate: boolean;
|
|
24
|
+
missingInterval: boolean;
|
|
25
|
+
}
|
|
26
|
+
/** 是否为可解析的日历日期(写入前会归一成 YYYY-MM-DD) */
|
|
27
|
+
export declare function hasDateValue(value: unknown): boolean;
|
|
28
|
+
/**
|
|
29
|
+
* 复检周期单位:接口只返回 day / month。
|
|
30
|
+
*/
|
|
31
|
+
export declare function normalizeReInspectionUnit(unit: unknown): ReInspectionIntervalUnit | undefined;
|
|
32
|
+
/** 复检周期数量:必须是有限正数 */
|
|
33
|
+
export declare function parseReInspectionIntervalAmount(value: unknown): number | undefined;
|
|
34
|
+
/** 从物料或批次 option 读取复检周期;缺数量或单位则视为未配置 */
|
|
35
|
+
export declare function pickReInspectionInterval(source?: Record<string, unknown> | null): ReInspectionInterval | undefined;
|
|
36
|
+
/**
|
|
37
|
+
* 按日历加周期:先 toDateOnly 成 YYYY-MM-DD,再 dayjs.add。
|
|
38
|
+
* 项目里没有现成的日期加减工具,日期归一复用 toDateOnly。
|
|
39
|
+
* 自然月:1月31日 + 1月 → 2月28日;无效基准日期返回 null。
|
|
40
|
+
*/
|
|
41
|
+
export declare function addReInspectionInterval(base: unknown, interval: ReInspectionInterval): string | null;
|
|
42
|
+
/**
|
|
43
|
+
* 下一次复检日期:
|
|
44
|
+
* - 未配复检且批次已有日期 → 直接用接口值
|
|
45
|
+
* - 否则用「接口日期(复检场景)或生产日期」+ 周期
|
|
46
|
+
*/
|
|
47
|
+
export declare function resolveNextReInspectionDate(input: ResolveNextReInspectionDateInput): ResolveNextReInspectionDateResult;
|
|
48
|
+
/** paramsConfig.txnConfig.businessType === reInspection */
|
|
49
|
+
export declare function isReInspectionTxnConfig(txnConfig: unknown): boolean;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
import { FIELD_TYPE } from '../../field/field-type';
|
|
2
|
+
/** 单条 option → 对象子字段 的映射 */
|
|
3
|
+
export interface DateObjectOptionFillDef {
|
|
4
|
+
/** option record 里的源字段 key */
|
|
5
|
+
optionField: string;
|
|
6
|
+
/** 目标子字段,运行时按 bizType 解析为实际 field key */
|
|
7
|
+
toBizType: FIELD_TYPE;
|
|
8
|
+
/** 写入前对 option 值做转换(如日期时间 → 日期) */
|
|
9
|
+
transform?: (value: unknown) => unknown;
|
|
10
|
+
}
|
|
11
|
+
/** 下拉级联:上游按 bizType 解析,不写死 field key */
|
|
12
|
+
export interface DateObjectSelectDef {
|
|
13
|
+
/** 上游字段 bizType(与本字段同属一个 belongingObject) */
|
|
14
|
+
linkBizType: FIELD_TYPE;
|
|
15
|
+
/** 构建下拉查询参数;上游为空时返回 {},批次可独立下拉 */
|
|
16
|
+
buildLinkQuery?: (ctx: {
|
|
17
|
+
linkValue: unknown;
|
|
18
|
+
}) => Record<string, unknown>;
|
|
19
|
+
/** 用户改上游时清空的下游(bizType) */
|
|
20
|
+
clearOnLinkChange?: FIELD_TYPE[];
|
|
21
|
+
}
|
|
22
|
+
/** 日期对象子字段 Profile:按 bizType 匹配,声明联动 / 反填 */
|
|
23
|
+
export interface DateObjectFieldProfile {
|
|
24
|
+
match: {
|
|
25
|
+
bizType: FIELD_TYPE;
|
|
26
|
+
};
|
|
27
|
+
/** 下拉级联 */
|
|
28
|
+
select?: DateObjectSelectDef;
|
|
29
|
+
/** 选中下拉项后,从 option 同步填充同组字段 */
|
|
30
|
+
fillFromOption?: DateObjectOptionFillDef[];
|
|
31
|
+
/** 本字段清空时要清的 sibling bizType(不含反填物料) */
|
|
32
|
+
clearOnEmpty?: FIELD_TYPE[];
|
|
33
|
+
}
|
|
34
|
+
/** 对象级处理器声明:按时机调用注册于 object-handlers 的具名处理器 */
|
|
35
|
+
export interface DateObjectRowHandlerDef {
|
|
36
|
+
when: 'onFieldChange';
|
|
37
|
+
/** 仅这些 bizType 变更时执行 */
|
|
38
|
+
watch: FIELD_TYPE[];
|
|
39
|
+
/** 注册于 object-handlers 的处理器短名 */
|
|
40
|
+
handler: string;
|
|
41
|
+
}
|
|
42
|
+
/** 物料日期对象 Profile */
|
|
43
|
+
export interface DateObjectProfile {
|
|
44
|
+
type: 'date_object';
|
|
45
|
+
fields: DateObjectFieldProfile[];
|
|
46
|
+
/** 无法声明的副作用(如按物料/批次接口计算复检日期) */
|
|
47
|
+
rowHandlers?: DateObjectRowHandlerDef[];
|
|
48
|
+
}
|