配合示方生成混炼示方完善

This commit is contained in:
2026-07-30 11:28:26 +08:00
parent 2310f79f43
commit 5c27bacd11
231 changed files with 33361 additions and 184 deletions

View File

@@ -0,0 +1,52 @@
/**
* Jeecg QueryGenerator 模糊查询工具:
* - 普通字段:值两侧加 * 转为 LIKE
* - 关键字多字段 OR走 superQueryParams
*/
/** 给指定字符串查询字段追加 *value*(已含 * 则不重复处理) */
export function applyJeecgLikeQuery(params: Recordable, fields: string[]): Recordable {
if (!params || !fields?.length) {
return params;
}
for (const field of fields) {
const raw = params[field];
if (raw == null || raw === '') {
continue;
}
const text = String(raw).trim();
if (!text || text.includes('*')) {
continue;
}
params[field] = `*${text}*`;
}
return params;
}
/** 构造多字段 OR 模糊高级查询参数 */
export function buildOrLikeSuperQuery(fields: string[], keyword: string): {
superQueryMatchType: string;
superQueryParams: string;
} | null {
const kw = keyword?.trim();
if (!kw || !fields?.length) {
return null;
}
const conditions = fields.map((field) => ({
field,
rule: 'like',
val: kw,
}));
return {
superQueryMatchType: 'or',
superQueryParams: encodeURI(JSON.stringify(conditions)),
};
}
/** 密炼物料文本查询字段 */
export const MIXER_MATERIAL_LIKE_FIELDS = ['materialCode', 'materialName', 'erpCode', 'materialDesc', 'aliasName'];
/** 胶料文本查询字段(已去掉胶料编码) */
//update-begin---author:jiangxh ---date:20260729 for【选料弹窗】胶料关键字查询去掉编码-----------
export const RUBBER_MATERIAL_LIKE_FIELDS = ['materialName', 'erpCode', 'aliasName', 'shortName'];
//update-end---author:jiangxh ---date:20260729 for【选料弹窗】胶料关键字查询去掉编码-----------