!142 fix(xispeak): 修复前端页面 QA 审查发现的问题

Merge pull request !142 from wsm/fix/xi_speak_fix_20260807
This commit is contained in:
wsm
2026-08-07 07:33:24 +00:00
committed by Gitee
5 changed files with 33 additions and 53 deletions
@@ -139,7 +139,8 @@
}
function searchReset() {
formRef.value.resetFields();
// 本组件模板未绑定 formRef,若未来被挂载使用不能因此崩溃
formRef.value?.resetFields();
selectedRowKeys.value = [];
reload();
}
+19 -19
View File
@@ -9,7 +9,7 @@
<template #label>
<a-tooltip title="支持模糊查询,输入重要讲话指示批示情况关键词">讲话指示批示</a-tooltip>
</template>
<a-tooltip title="支持模糊查询,输入重要讲话指示批示情况关键词"><JInput v-model:value="queryParam.speakStatus" type="like" placeholder="请输入重要讲话指示批示情况" allow-clear trim @change="searchQuery" /></a-tooltip>
<a-tooltip title="支持模糊查询,输入重要讲话指示批示情况关键词"><JInput v-model:value="queryParam.speakStatus" type="like" placeholder="请输入重要讲话指示批示情况" allow-clear trim @change="debouncedSearchQuery" /></a-tooltip>
</a-form-item>
</a-col>
<a-col :xl="6" :lg="6" :md="8" :sm="12">
@@ -135,17 +135,17 @@
<script lang="ts" name="bg.xispeak-bgXiSpeak" setup>
import { ref, reactive, unref, computed, provide, nextTick, onMounted } from 'vue';
import { useDebounceFn } from '@vueuse/core';
import { BasicTable, useTable } from '/@/components/Table';
import { Dropdown } from '/@/components/Dropdown';
import { useListPage } from '/@/hooks/system/useListPage';
import { useModal } from '/@/components/Modal';
import { defHttp } from '/@/utils/http/axios';
import { defHttp } from '/@/utils/http/axios';
import { useMessage } from '/@/hooks/web/useMessage';
import { showImportValidationErrors } from '/@/utils/helper/importError';
import { startProcessSchedules } from '/@/api/common/api';
import { dateUtil } from '/@/utils/dateUtil';
import JDictSelectTag from '/@/components/Form/src/jeecg/components/JDictSelectTag.vue';
import JInput from '/@/components/Form/src/jeecg/components/JInput.vue';
import SzSelectDept from '/@/components/Form/src/jeecg/components/SzSelectDept.vue';
import DeptRoleUserSelectDropDown from '/@/components/semri/userComponent/DeptRoleUserSelectDropDown.vue';
@@ -198,8 +198,6 @@ import { PARTY_COMMITTEE_DEPT_ID, SDW_LEADER_ROLE_ID } from '/@/constant/supervi
const pendingFeedbackRightNow = ref(0);
const statsData = reactive({ notStarted: 0, inProgress: 0, overdue: 0, completed: 0 });
const processColumns = taskTaskColumns;
// 是否显示DW领导列表选择
const showSdwLeaderSelect = computed(() => queryParam.value.needSdwApproval === '1');
const { prefixCls, tableContext, onExportXls, onImportXls } = useListPage({
tableProps: {
@@ -780,15 +778,23 @@ import { PARTY_COMMITTEE_DEPT_ID, SDW_LEADER_ROLE_ID } from '/@/constant/supervi
try {
await startProcessSchedules(params);
successCount++;
if (successCount === total) {
await saveOrUpdateDict({ id: record.id, bpmStatus: '2', supervisionCount: nextSuperviseCount, completionStatus: 0 }, true);
createMessage.success(`成功发起 ${total} 个经办人执行反馈流程`);
reload();
}
} catch (e) {
createMessage.error(`部门 ${deptId} 流程发起失败`);
}
}
// 部分/全部失败时也要保存状态并刷新列表,避免已成功发起的流程成为无主流程
if (successCount > 0) {
await saveOrUpdateDict({ id: record.id, bpmStatus: '2', supervisionCount: nextSuperviseCount, completionStatus: 0 }, true);
}
if (successCount === total) {
createMessage.success(`成功发起 ${total} 个经办人执行反馈流程`);
} else if (successCount > 0) {
createMessage.warning(`部分部门流程发起失败:成功 ${successCount}/${total}`);
} else {
createMessage.error(`所有部门流程发起失败(共 ${total} 个)`);
}
reload();
return;
}
@@ -901,6 +907,9 @@ import { PARTY_COMMITTEE_DEPT_ID, SDW_LEADER_ROLE_ID } from '/@/constant/supervi
reload({ page: 1 });
}
// 输入框逐字触发的查询做防抖,查询按钮仍走未防抖的 searchQuery
const debouncedSearchQuery = useDebounceFn(searchQuery, 500);
/**
* 重置
*/
@@ -930,15 +939,6 @@ import { PARTY_COMMITTEE_DEPT_ID, SDW_LEADER_ROLE_ID } from '/@/constant/supervi
}
reload({ page: 1 });
}
/**
* form点击事件(以逗号分割)
*/
function handleFormJoinChange(key, value) {
if (typeof value != 'string') {
queryParam.value[key] = value.join(',');
}
}
</script>
<style lang="less" scoped>
@@ -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',
@@ -235,17 +235,14 @@
if (!deptName && deptId) {
const loginInfo = (userStore.getLoginInfo || {}) as Record<string, any>;
const departs = Array.isArray(loginInfo.departs) ? loginInfo.departs : [];
console.log('【所务会-反馈】兜底查找, orgCode:', deptId, ', departs orgCodes:', departs.map((d: any) => d.orgCode), ', departs names:', departs.map((d: any) => d.departName));
const matched = departs.find((d: any) => d.orgCode === deptId);
if (matched) {
deptId = matched.id || deptId;
deptName = matched.departName || '';
console.log('【所务会-反馈】兜底匹配成功, matched:', matched);
}
}
formData.responDeptid = deptId;
formData.responDeptname = deptName;
console.log('【所务会-反馈】填充当前部门, deptId:', deptId, ', deptName:', deptName);
}
/**
@@ -276,22 +273,14 @@
const tmpData = {};
Object.keys(formData).forEach((key) => {
if (record.hasOwnProperty(key)) {
let value = record[key];
// 处理日期字段,Date 对象转换为字符串
if (key === 'deadline' && value instanceof Date) {
value = value.format('YYYY-MM-DD HH:mm:ss');
}
if (key === 'responTime' && value instanceof Date) {
value = value.format('YYYY-MM-DD HH:mm:ss');
}
if (key === 'startTime' && value instanceof Date) {
value = value.format('YYYY-MM-DD HH:mm:ss');
}
tmpData[key] = value;
tmpData[key] = record[key];
}
});
Object.assign(formData, tmpData);
fillDeptFromLogin();
// 编辑已有记录时保留原部门归属,仅新增时填充当前登录人部门
if (!record.id) {
fillDeptFromLogin();
}
});
}
@@ -160,8 +160,8 @@ import { PARTY_COMMITTEE_DEPT_ID, SDW_LEADER_ROLE_ID } from '/@/constant/supervi
pid: '',
speakStatus: '',
time: '',
elmComment: '经单位主要负责同时签批同意,由xx部做好贯彻落实',
status: 'x月x日召开xxxx年第x次党委会议',
elmComment: '',
status: '',
secretLevel: '',
responsiblePerson: '',
needSdwApproval: '',
@@ -251,12 +251,15 @@ import { PARTY_COMMITTEE_DEPT_ID, SDW_LEADER_ROLE_ID } from '/@/constant/supervi
}
function edit(record) {
// 新增:同步重置,不带入任何旧数据
// 新增:同步重置,不带入任何旧数据(但保留"添加下级"传入的父节点 pid,否则子记录会退化为根记录)
if (!record.id) {
const defaults = getDefaultFormData();
for (const key of Object.keys(formData)) {
formData[key] = defaults[key];
}
if (record.pid) {
formData.pid = record.pid;
}
model = {};
return;
}