feat(bpm): 默认抄送改为extendUrlParams配置驱动,优化fetchDefaultCcUsers并发请求
Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
This commit is contained in:
@@ -293,6 +293,8 @@
|
||||
PARTY_COMMITTEE_DEPT_ID as CHARGE_LEADER_DEPT_ID,
|
||||
CHARGE_LEADER_ROLE_ID,
|
||||
SDW_LEADER_ROLE_ID,
|
||||
SUOBAN_DEPT_ID,
|
||||
MEASURE_RES_LEADER_ROLE_ID,
|
||||
} from '/@/constant/supervision';
|
||||
|
||||
const { initBpmFormData } = usePermission();
|
||||
@@ -446,29 +448,32 @@
|
||||
|
||||
watch([() => props.formData?.dataId, () => processInfo.value.processInstanceId], () => initFormData());
|
||||
|
||||
const showDefaultCc = computed(() => String(props.formData?.extendUrlParams?.defaultCc ?? '') === '1');
|
||||
|
||||
async function fetchDefaultCcUsers() {
|
||||
try {
|
||||
const res = await defHttp.get({
|
||||
url: '/sys/user/queryUserRoleComponentData',
|
||||
params: {
|
||||
departId: PARTY_COMMITTEE_DEPT_ID,
|
||||
roleId: SDW_LEADER_ROLE_ID,
|
||||
searchSecurityLevel: 5,
|
||||
pageNo: 1,
|
||||
pageSize: 999,
|
||||
},
|
||||
});
|
||||
const records = res?.records || res?.result?.records || [];
|
||||
defaultCcUsers.value = records;
|
||||
const [res1, res2] = await Promise.all([
|
||||
defHttp.get({
|
||||
url: '/sys/user/queryUserRoleComponentData',
|
||||
params: { departId: PARTY_COMMITTEE_DEPT_ID, roleId: SDW_LEADER_ROLE_ID, searchSecurityLevel: 5, pageNo: 1, pageSize: 999 },
|
||||
}),
|
||||
defHttp.get({
|
||||
url: '/sys/user/queryUserRoleComponentData',
|
||||
params: { departId: SUOBAN_DEPT_ID, roleId: MEASURE_RES_LEADER_ROLE_ID, searchSecurityLevel: 5, pageNo: 1, pageSize: 999 },
|
||||
}),
|
||||
]);
|
||||
const records1 = res1?.records || res1?.result?.records || [];
|
||||
const records2 = res2?.records || res2?.result?.records || [];
|
||||
defaultCcUsers.value = [...records1, ...records2];
|
||||
} catch {
|
||||
defaultCcUsers.value = [];
|
||||
}
|
||||
}
|
||||
|
||||
watch(
|
||||
() => processInfo.value.taskDefKey,
|
||||
(key) => {
|
||||
if (key === 'Task_137y5vq') {
|
||||
() => showDefaultCc.value,
|
||||
() => {
|
||||
if (showDefaultCc.value) {
|
||||
fetchDefaultCcUsers();
|
||||
} else {
|
||||
defaultCcUsers.value = [];
|
||||
|
||||
Reference in New Issue
Block a user