|
@@ -146,6 +146,7 @@ import {
|
|
|
personAllocateRoleDetailApi,
|
|
|
} from '@/api/resource-guard';
|
|
|
import { customerTypeFilter } from '@/utils/filter';
|
|
|
+import { cloneDeep } from 'lodash';
|
|
|
|
|
|
const emit = defineEmits(['update:visible', 'success']);
|
|
|
const props = defineProps({
|
|
@@ -209,7 +210,6 @@ const getDetail = async () => {
|
|
|
EFFECT_ENGINEER: props.curRow.effectQuota,
|
|
|
ASSISTANT_ENGINEER: props.curRow.assistantQuota,
|
|
|
};
|
|
|
-
|
|
|
if (res.length) {
|
|
|
let roleConfigMap = {};
|
|
|
|
|
@@ -223,7 +223,26 @@ const getDetail = async () => {
|
|
|
}
|
|
|
roleConfigMap[item.roleResult.roleId].userIdList.push(item.userId);
|
|
|
});
|
|
|
- formData.roleConfigInfo = Object.values(roleConfigMap);
|
|
|
+ const validRoleTypes = Object.keys(roleQuota).filter(
|
|
|
+ (item) => roleQuota[item]
|
|
|
+ );
|
|
|
+ let singleList = cloneDeep(roleList.value)
|
|
|
+ .filter(
|
|
|
+ (item) =>
|
|
|
+ validRoleTypes.includes(item.type) &&
|
|
|
+ item.type === 'REGION_COORDINATOR'
|
|
|
+ )
|
|
|
+ .map((item) => {
|
|
|
+ return {
|
|
|
+ quota: roleQuota[item.type],
|
|
|
+ userIdList: [],
|
|
|
+ roleId: item.id,
|
|
|
+ roleName: item.name,
|
|
|
+ roleType: item.type,
|
|
|
+ };
|
|
|
+ });
|
|
|
+
|
|
|
+ formData.roleConfigInfo = [...singleList, ...Object.values(roleConfigMap)];
|
|
|
} else {
|
|
|
const validRoleTypes = Object.keys(roleQuota).filter(
|
|
|
(item) => roleQuota[item]
|