@next-libs/cmdb-instances 7.29.0 → 7.29.2
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.
|
@@ -580,10 +580,21 @@ export function LegacyInstanceList(props) {
|
|
|
580
580
|
var sortType = modelData === null || modelData === void 0 ? void 0 : (_modelData$attrList2 = modelData.attrList) === null || _modelData$attrList2 === void 0 ? void 0 : (_modelData$attrList2$ = _modelData$attrList2.find(attr => attr.id === sort)) === null || _modelData$attrList2$ === void 0 ? void 0 : (_modelData$attrList2$2 = _modelData$attrList2$.value) === null || _modelData$attrList2$2 === void 0 ? void 0 : _modelData$attrList2$2.default_type;
|
|
581
581
|
var order = ["series-number", "auto-increment-id"].includes(sortType) ? asc ? 2 : -2 : asc ? 1 : -1;
|
|
582
582
|
if (sort) {
|
|
583
|
+
var _relationObjectShowKe;
|
|
583
584
|
data.sort = {
|
|
584
585
|
[sort]: order
|
|
585
586
|
};
|
|
586
|
-
|
|
587
|
+
var relationObjectShowKeys = [];
|
|
588
|
+
if (!props.useExternalCmdbApi && !props.useAutoDiscoveryProvider && !props.ignorePermission) {
|
|
589
|
+
var _modelData$relation_l, _props$objectList, _props$objectList$fin, _props$objectList$fin2;
|
|
590
|
+
var relation = modelData === null || modelData === void 0 ? void 0 : (_modelData$relation_l = modelData.relation_list) === null || _modelData$relation_l === void 0 ? void 0 : _modelData$relation_l.find(i => i.right_object_id === props.objectId ? sort === i.right_id : sort === i.left_id);
|
|
591
|
+
var relationObjectId = (relation === null || relation === void 0 ? void 0 : relation.right_object_id) === props.objectId ? relation === null || relation === void 0 ? void 0 : relation.left_object_id : relation === null || relation === void 0 ? void 0 : relation.right_object_id;
|
|
592
|
+
relationObjectShowKeys = (_props$objectList = props.objectList) === null || _props$objectList === void 0 ? void 0 : (_props$objectList$fin = _props$objectList.find(i => i.objectId === relationObjectId)) === null || _props$objectList$fin === void 0 ? void 0 : (_props$objectList$fin2 = _props$objectList$fin.view) === null || _props$objectList$fin2 === void 0 ? void 0 : _props$objectList$fin2.show_key;
|
|
593
|
+
}
|
|
594
|
+
v3Data.sort = (_relationObjectShowKe = relationObjectShowKeys) !== null && _relationObjectShowKe !== void 0 && _relationObjectShowKe.length ? relationObjectShowKeys.map(i => ({
|
|
595
|
+
key: "".concat(sort, ".").concat(i),
|
|
596
|
+
order
|
|
597
|
+
})) : [{
|
|
587
598
|
key: sort,
|
|
588
599
|
order
|
|
589
600
|
}];
|
|
@@ -761,7 +772,7 @@ export function LegacyInstanceList(props) {
|
|
|
761
772
|
});
|
|
762
773
|
}
|
|
763
774
|
}
|
|
764
|
-
}, [props.objectId, props.presetConfigs]);
|
|
775
|
+
}, [props.objectId, props.presetConfigs, processFixedFields]);
|
|
765
776
|
useEffect(() => {
|
|
766
777
|
var _props$selectedRowKey2;
|
|
767
778
|
setSelectedRowKeys((_props$selectedRowKey2 = props.selectedRowKeys) !== null && _props$selectedRowKey2 !== void 0 ? _props$selectedRowKey2 : []);
|
|
@@ -1504,8 +1515,8 @@ export function LegacyInstanceListWrapper(props) {
|
|
|
1504
1515
|
cache: false
|
|
1505
1516
|
});
|
|
1506
1517
|
useEffect(() => {
|
|
1507
|
-
var _props$
|
|
1508
|
-
if ((_props$
|
|
1518
|
+
var _props$objectList2;
|
|
1519
|
+
if ((_props$objectList2 = props.objectList) !== null && _props$objectList2 !== void 0 && _props$objectList2.length) {
|
|
1509
1520
|
setObjectList(props.objectList);
|
|
1510
1521
|
} else {
|
|
1511
1522
|
_asyncToGenerator(function* () {
|