优化一下评价任务管理dva更新数据逻辑
This commit is contained in:
@ -246,8 +246,9 @@ const SupplierTaskModel: SupplierTaskModelType = {
|
||||
const userId = newUser.id || newUser.userId;
|
||||
const existing = existingUserMap.get(userId);
|
||||
|
||||
// 这里优化一下 如果newUser.indicatorIds为空 则取existing?.indicatorIds 否则取newUser.indicatorIds
|
||||
const indicatorIds =
|
||||
newUser.indicatorIds && newUser.indicatorIds.length > 0
|
||||
newUser.indicatorIds
|
||||
? newUser.indicatorIds
|
||||
: existing?.indicatorIds || [];
|
||||
|
||||
|
@ -204,7 +204,6 @@ const DivisionStepComponent = (props: DivisionStepProps) => {
|
||||
// 读取dva中的数据,只克隆一次
|
||||
const indicatorList = JSON.parse(JSON.stringify(taskFormData?.indicatorList || []));
|
||||
const userList = JSON.parse(JSON.stringify(taskFormData?.userList || []));
|
||||
|
||||
// 批量更新indicatorList和userList
|
||||
userIds.forEach((userId) => {
|
||||
// 更新indicatorList
|
||||
@ -382,7 +381,8 @@ const DivisionStepComponent = (props: DivisionStepProps) => {
|
||||
key: 'action',
|
||||
render: (_: any, record: SupplierTaskManage.PersonnelItem) => (
|
||||
<Space size="middle">
|
||||
{mode !== 'division' && (
|
||||
{/* 如果是分工模式 或者 历史存在数据则显示按钮 */}
|
||||
{(mode !== 'division' || !record.isSelected) && (
|
||||
<>
|
||||
<Button type="link" onClick={() => handleAssignIndicators(record.id)}>
|
||||
{intl.formatMessage({ id: 'supplierTaskManage.button.evaluatorDivision' })}
|
||||
|
Reference in New Issue
Block a user