@next-libs/cmdb-instances 7.29.12 → 7.29.13
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -429,7 +429,7 @@ function LegacyInstanceList(props) {
|
|
|
429
429
|
};
|
|
430
430
|
};
|
|
431
431
|
|
|
432
|
-
// 根据用户预定义的 presetConfigs.fieldIds 进行排序,如果不在预定义的字段,则根据
|
|
432
|
+
// 根据用户预定义的 presetConfigs.fieldIds 进行排序,如果不在预定义的字段,则根据 fieldIds 进行排序
|
|
433
433
|
const _sortFieldIds = fieldIds => {
|
|
434
434
|
var _props$presetConfigs2;
|
|
435
435
|
let frontFields = [];
|
|
@@ -437,14 +437,7 @@ function LegacyInstanceList(props) {
|
|
|
437
437
|
if ((_props$presetConfigs2 = props.presetConfigs) !== null && _props$presetConfigs2 !== void 0 && _props$presetConfigs2.fieldIds) {
|
|
438
438
|
frontFields = (0, _lodash.filter)(props.presetConfigs.fieldIds, id => fieldIds.includes(id));
|
|
439
439
|
}
|
|
440
|
-
restFields = (0, _lodash.
|
|
441
|
-
const foundIndex = (0, _lodash.findIndex)(modelData.view.attr_order, orderId => orderId === fieldId);
|
|
442
|
-
if (foundIndex === -1) {
|
|
443
|
-
return null;
|
|
444
|
-
} else {
|
|
445
|
-
return foundIndex;
|
|
446
|
-
}
|
|
447
|
-
});
|
|
440
|
+
restFields = (0, _lodash.reject)(fieldIds, id => frontFields.includes(id));
|
|
448
441
|
return [...frontFields, ...restFields];
|
|
449
442
|
};
|
|
450
443
|
// istanbul ignore next
|
|
@@ -1117,10 +1110,12 @@ function LegacyInstanceList(props) {
|
|
|
1117
1110
|
(0, _brickKit.handleHttpError)(e);
|
|
1118
1111
|
}
|
|
1119
1112
|
} else {
|
|
1113
|
+
const sortFields = mergeFields(state.sortFields, fields);
|
|
1120
1114
|
setState({
|
|
1121
|
-
fieldIds: _sortFieldIds(fields)
|
|
1115
|
+
fieldIds: _sortFieldIds(fields),
|
|
1116
|
+
sortFields
|
|
1122
1117
|
});
|
|
1123
|
-
jsonLocalStorage.setItem(`${modelData.objectId}-selectAttrIds`, fields);
|
|
1118
|
+
jsonLocalStorage.setItem(`${modelData.objectId}-selectAttrIds`, _sortFieldIds(fields));
|
|
1124
1119
|
}
|
|
1125
1120
|
props.onFieldsModalConfirm(fields);
|
|
1126
1121
|
} else {
|