@mldong/jeeflow 1.8.37 → 1.8.39
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/facade.d.ts +6 -2
- package/dist/facade.js +24 -10
- package/dist/jdbc/ext.js +10 -2
- package/dist/memory-ext.js +9 -3
- package/package.json +1 -1
package/dist/facade.d.ts
CHANGED
|
@@ -81,8 +81,12 @@ export declare class JeeflowFacade {
|
|
|
81
81
|
private surrogateDetail;
|
|
82
82
|
/** 删除委托(issues/95:前端「我的委托」行内/批量删除统一发 {ids},与 define/design remove 同惯例) */
|
|
83
83
|
private surrogateRemove;
|
|
84
|
-
/** 委托写入公共字段。授权人(operator
|
|
85
|
-
*
|
|
84
|
+
/** 委托写入公共字段。授权人(operator)仅在**显式且非空白**时覆盖:
|
|
85
|
+
* - update 缺省(不带键 / 空串 / 全空白)⇒ 保留原授权人,不得清空(spec 06 §update)
|
|
86
|
+
* - save 缺省档 ⇒ 保留调用点已归一的 operator(`operatorArg`,缺省 user1)
|
|
87
|
+
* issues/152 ③:空串/全空白**绝不落进** operator——那种行是「死行」,getSurrogate 的
|
|
88
|
+
* `WHERE operator = ?` 永不命中,台账看得见、待办永远不并人(比报错更难查)。
|
|
89
|
+
* 三档入参一律走 §2.5 归一,与 java `applySurrogateFields` 同形。 */
|
|
86
90
|
private applySurrogateFields;
|
|
87
91
|
private getLastByName;
|
|
88
92
|
private highLight;
|
package/dist/facade.js
CHANGED
|
@@ -807,12 +807,15 @@ export class JeeflowFacade {
|
|
|
807
807
|
}
|
|
808
808
|
// ── 委托代理(需扩展仓储) ───────────────────────────────────────────────
|
|
809
809
|
async surrogatePage(args) {
|
|
810
|
-
// issues/
|
|
811
|
-
//
|
|
812
|
-
//
|
|
813
|
-
//
|
|
814
|
-
|
|
815
|
-
|
|
810
|
+
// issues/152 ②(案 A · 引擎侧立法,spec 06 §2.5 口径表 + §4.5「归属不变式」):
|
|
811
|
+
// t.operator 是归属列,与 instancePage(`pageInstances(pageNum, pageSize, operatorArg(args))`) 同形注入
|
|
812
|
+
// —— 引擎自己保证「我的委托」只看自己授出的行。旧写法(issues/129 案 A 那一版)是
|
|
813
|
+
// "空串/缺键 ⇒ **不带**归属过滤",理由是"本 action 在 java 门面里不下发归属条件",
|
|
814
|
+
// 那句话随 issues/152 选 A 一起作废:当时"我的委托只看自己"全靠集成壳注入 operator
|
|
815
|
+
// (mldong-boot2-jeeflow WfFlowController),换宿主/直调门面就退化成全库台账
|
|
816
|
+
// (vben5 前端本来就不传 operator)。归属列一律走 §2.5 归一:缺键/空串/全空白 ⇒ user1。
|
|
817
|
+
// 仓储那一层的第二道兜底(空归属值 ⇒ 空页)保持不动,见 memory-ext.ts / jdbc/ext.ts。
|
|
818
|
+
const filters = { operator: operatorArg(args) };
|
|
816
819
|
const pageNum = toInt(args.pageNum ?? 1);
|
|
817
820
|
const pageSize = toInt(args.pageSize ?? 10);
|
|
818
821
|
const [rows, total] = await this.ext().pageSurrogates(pageNum, pageSize, filters, parseMQuery(args));
|
|
@@ -871,12 +874,19 @@ export class JeeflowFacade {
|
|
|
871
874
|
await ext.removeSurrogate(id);
|
|
872
875
|
return {};
|
|
873
876
|
}
|
|
874
|
-
/** 委托写入公共字段。授权人(operator
|
|
875
|
-
*
|
|
877
|
+
/** 委托写入公共字段。授权人(operator)仅在**显式且非空白**时覆盖:
|
|
878
|
+
* - update 缺省(不带键 / 空串 / 全空白)⇒ 保留原授权人,不得清空(spec 06 §update)
|
|
879
|
+
* - save 缺省档 ⇒ 保留调用点已归一的 operator(`operatorArg`,缺省 user1)
|
|
880
|
+
* issues/152 ③:空串/全空白**绝不落进** operator——那种行是「死行」,getSurrogate 的
|
|
881
|
+
* `WHERE operator = ?` 永不命中,台账看得见、待办永远不并人(比报错更难查)。
|
|
882
|
+
* 三档入参一律走 §2.5 归一,与 java `applySurrogateFields` 同形。 */
|
|
876
883
|
applySurrogateFields(s, args, operator) {
|
|
877
884
|
s.processName = String(args.processName ?? '');
|
|
878
|
-
if ('operator' in args)
|
|
879
|
-
|
|
885
|
+
if ('operator' in args) {
|
|
886
|
+
const explicit = toStr(args.operator);
|
|
887
|
+
if (explicit.trim() !== '')
|
|
888
|
+
s.operator = explicit;
|
|
889
|
+
}
|
|
880
890
|
s.surrogate = String(args.surrogate ?? '');
|
|
881
891
|
s.startTime = parseSurrogateTime(args.startTime);
|
|
882
892
|
s.endTime = parseSurrogateTime(args.endTime);
|
|
@@ -1034,6 +1044,10 @@ export class JeeflowFacade {
|
|
|
1034
1044
|
const instanceId = toId(args.id);
|
|
1035
1045
|
const his = await this.repo.findHistoryTasks(instanceId);
|
|
1036
1046
|
return his.map(t => ({
|
|
1047
|
+
// issues/154④:审批记录九键之首=任务行主键。本栈 id 全程 string(仓储 rowId 出口),
|
|
1048
|
+
// 仍显式 String() 一挡——"必须是字符串"这条契约不许押在仓储姿势上:19 位雪花 id
|
|
1049
|
+
// 出 number 会被 JS 截精度(同 issues/75/92 那族坑),对齐 java String.valueOf(...)。
|
|
1050
|
+
id: String(t.id ?? ''),
|
|
1037
1051
|
taskName: t.taskName, displayName: t.displayName, taskType: t.taskType ?? null,
|
|
1038
1052
|
performType: t.performType ?? null, taskState: t.taskState, operator: t.actorId ?? '',
|
|
1039
1053
|
// issues/122:可空时间列空值出 '' 不出 null——mldong-nestjs 全局 SmartNullStripping
|
package/dist/jdbc/ext.js
CHANGED
|
@@ -248,8 +248,16 @@ export class JdbcProcessExtRepository {
|
|
|
248
248
|
let countSql = 'SELECT COUNT(*) FROM wf_process_surrogate t WHERE 1=1';
|
|
249
249
|
// issues/129 案 A 第二层:filters.operator 是归属谓词("这条委托属于谁"),空值 ⇒ **空页**。
|
|
250
250
|
// 与内存仓 memory-ext.ts pageSurrogates 同判据(否则同一个空 operator 两仓一个出 0 行、
|
|
251
|
-
//
|
|
252
|
-
|
|
251
|
+
// 一个把条件丢掉出全库)。issues/152 ② 起门面恒定下发归一后的归属值(surrogatePage 走
|
|
252
|
+
// operatorArg,缺键/空串/全空白 ⇒ user1),这一道专防绕过门面直连仓储的调用方。
|
|
253
|
+
// issues/152 ②:归属列**缺失档与空值档同判**(spec 06 §2.5),与 memory-ext.ts 逐字同尺子。
|
|
254
|
+
const ownCond = (conditions ?? []).find(c => c.column === 't.operator'
|
|
255
|
+
&& (c.operator == null || String(c.operator).toUpperCase() === 'EQ'));
|
|
256
|
+
if ('operator' in (filters ?? {})) {
|
|
257
|
+
if (isBlankValue(filters.operator))
|
|
258
|
+
return [[], 0];
|
|
259
|
+
}
|
|
260
|
+
else if (!ownCond || isBlankValue(ownCond.value))
|
|
253
261
|
return [[], 0];
|
|
254
262
|
const args = [];
|
|
255
263
|
const args2 = [];
|
package/dist/memory-ext.js
CHANGED
|
@@ -97,9 +97,15 @@ export class MemoryExtRepository {
|
|
|
97
97
|
// 原来靠下面那句 `val === '' continue` 把这条条件整条丢掉 ⇒ 空 operator 读出全库委托;
|
|
98
98
|
// 只收归属列——surrogate / process_name / enabled 三个可选过滤仍走"空值当作没填"。
|
|
99
99
|
// conditions 那一路(m_ 条件)由 matchConditions 的归属兜底覆盖(SURROGATE_FIELDS 带 t.operator)。
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
100
|
+
// issues/152 ②:归属列**缺失档与空值档同判**(spec 06 §2.5),与 jdbc/ext.ts 逐字同尺子。
|
|
101
|
+
const blankOwn = (v) => v == null || String(v).trim() === '';
|
|
102
|
+
const ownCond = (conditions ?? []).find(c => c.column === 't.operator'
|
|
103
|
+
&& (c.operator == null || String(c.operator).toUpperCase() === 'EQ'));
|
|
104
|
+
if ('operator' in (filters ?? {})) {
|
|
105
|
+
if (blankOwn(filters.operator))
|
|
106
|
+
return [[], 0];
|
|
107
|
+
}
|
|
108
|
+
else if (!ownCond || blankOwn(ownCond.value))
|
|
103
109
|
return [[], 0];
|
|
104
110
|
const rows = [...this.surrogates.values()].filter(s => {
|
|
105
111
|
for (const [col, val] of Object.entries(filters ?? {})) {
|