fix(xispeak): 修复前端页面 QA 审查发现的问题
- P0 添加下级保留父节点 pid,恢复树形层级功能 - P1 新增表单占位模板文本置空,必填校验不再被绕过 - P1 JBR 批量流程部分失败时保存状态并刷新列表,避免孤儿流程 - P1 编辑反馈记录时保留原部门归属,仅新增时填充登录人部门 - P2 讲话指示批示搜索输入防抖 500ms - P2 清理 BPMForm/FeedbackForm 调试 console.log 与日期死代码 - P2 清理 List 死代码(未用 import/computed/函数) - P2 孤儿组件 searchReset 空指针保护 Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
This commit is contained in:
@@ -308,8 +308,6 @@ import {
|
||||
});
|
||||
|
||||
initBpmFormData(props.formData);
|
||||
console.log('@props.formData', props.formData);
|
||||
console.log('@props', props);
|
||||
|
||||
const emit = defineEmits(['ok', 'success', 'claimSuccess']);
|
||||
const { createMessage } = useMessage();
|
||||
@@ -593,38 +591,32 @@ import {
|
||||
|
||||
async function getProcessVarDeptIds(): Promise<string[]> {
|
||||
const taskId = props.formData?.taskId;
|
||||
console.log('【部门过滤】taskId:', taskId, 'processInstanceId:', processInfo.value.processInstanceId);
|
||||
if (taskId) {
|
||||
try {
|
||||
const res = await getProcessVariable({ taskId, key: 'impl_dept_id', isLocal: true });
|
||||
const value = res?.result?.value ?? res?.value;
|
||||
if (value) {
|
||||
const result = String(value).split(',').map((s: string) => s.trim()).filter(Boolean);
|
||||
console.log('【部门过滤】从流程局部变量 impl_dept_id 获取到:', result);
|
||||
return result;
|
||||
}
|
||||
} catch (e) {
|
||||
console.log('【部门过滤】获取局部变量 impl_dept_id 失败:', e);
|
||||
// 忽略局部变量读取失败,继续尝试流程级变量
|
||||
}
|
||||
}
|
||||
// 局部变量未找到,尝试从流程级变量获取
|
||||
const vars = (props.formData?.vars ?? {}) as Record<string, any>;
|
||||
console.log('【部门过滤】vars所有key:', Object.keys(vars), 'implDept:', vars.implDept, 'pending_depts_id:', vars.pending_depts_id);
|
||||
const value = vars.implDept ?? vars.pending_depts_id ?? vars.dept_id ?? vars.deptid;
|
||||
if (value) {
|
||||
const result = Array.isArray(value)
|
||||
? value.map((v: any) => String(v).trim()).filter(Boolean)
|
||||
: String(value).split(',').map((s: string) => s.trim()).filter(Boolean);
|
||||
console.log('【部门过滤】从流程级变量获取到部门ID:', result);
|
||||
return result;
|
||||
}
|
||||
// 最终 fallback 到主表已保存的牵头部门
|
||||
if (mainForm.implDept) {
|
||||
const result = String(mainForm.implDept).split(',').map((s: string) => s.trim()).filter(Boolean);
|
||||
console.log('【部门过滤】fallback mainForm.implDept:', result);
|
||||
return result;
|
||||
}
|
||||
console.log('【部门过滤】未获取到任何部门ID');
|
||||
return [];
|
||||
}
|
||||
|
||||
@@ -656,19 +648,15 @@ import {
|
||||
const apiFn = bgXiSpeakFeedbackList;
|
||||
const res = await apiFn({ mainId: mainForm.id, bpmProcessId, pageNo: 1, pageSize: 999 });
|
||||
let list = res?.records || res?.result?.records || [];
|
||||
console.log('【部门过滤】showDeptFeedback:', showDeptFeedback.value, '反馈总数:', list.length);
|
||||
if (list.length && showDeptFeedback.value) {
|
||||
const deptIds = await getProcessVarDeptIds();
|
||||
console.log('【部门过滤】用于过滤的部门ID列表:', deptIds);
|
||||
if (deptIds.length) {
|
||||
console.log('【部门过滤】过滤前各反馈的 responDeptid:', list.map((item: any) => ({ id: item.id, responDeptid: item.responDeptid, responDeptname: item.responDeptname })));
|
||||
list = list.filter((item: any) => {
|
||||
const responDeptIds = String(item.responDeptid || '')
|
||||
.split(',')
|
||||
.map((s: string) => s.trim());
|
||||
return deptIds.some((id) => responDeptIds.includes(id));
|
||||
});
|
||||
console.log('【部门过滤】过滤后剩余:', list.map((item: any) => ({ id: item.id, responDeptid: item.responDeptid, responDeptname: item.responDeptname })));
|
||||
}
|
||||
}
|
||||
feedbackList.value = list;
|
||||
@@ -683,7 +671,6 @@ import {
|
||||
savingMain.value = true;
|
||||
try {
|
||||
const processInstanceId = processInfo.value.processInstanceId;
|
||||
console.log('BgXiSpeak BPM process info', { ...processInfo.value, processInstanceId });
|
||||
const res = await saveBpmForm({
|
||||
processInstanceId,
|
||||
varField: 'json_data',
|
||||
|
||||
Reference in New Issue
Block a user