@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.
@@ -588,10 +588,21 @@ function LegacyInstanceList(props) {
588
588
  const 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;
589
589
  const order = ["series-number", "auto-increment-id"].includes(sortType) ? asc ? 2 : -2 : asc ? 1 : -1;
590
590
  if (sort) {
591
+ var _relationObjectShowKe;
591
592
  data.sort = {
592
593
  [sort]: order
593
594
  };
594
- v3Data.sort = [{
595
+ let relationObjectShowKeys = [];
596
+ if (!props.useExternalCmdbApi && !props.useAutoDiscoveryProvider && !props.ignorePermission) {
597
+ var _modelData$relation_l, _props$objectList, _props$objectList$fin, _props$objectList$fin2;
598
+ const 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);
599
+ const 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;
600
+ 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;
601
+ }
602
+ v3Data.sort = (_relationObjectShowKe = relationObjectShowKeys) !== null && _relationObjectShowKe !== void 0 && _relationObjectShowKe.length ? relationObjectShowKeys.map(i => ({
603
+ key: `${sort}.${i}`,
604
+ order
605
+ })) : [{
595
606
  key: sort,
596
607
  order
597
608
  }];
@@ -762,7 +773,7 @@ function LegacyInstanceList(props) {
762
773
  });
763
774
  }
764
775
  }
765
- }, [props.objectId, props.presetConfigs]);
776
+ }, [props.objectId, props.presetConfigs, processFixedFields]);
766
777
  (0, _react.useEffect)(() => {
767
778
  var _props$selectedRowKey2;
768
779
  setSelectedRowKeys((_props$selectedRowKey2 = props.selectedRowKeys) !== null && _props$selectedRowKey2 !== void 0 ? _props$selectedRowKey2 : []);
@@ -1496,8 +1507,8 @@ function LegacyInstanceListWrapper(props) {
1496
1507
  cache: false
1497
1508
  });
1498
1509
  (0, _react.useEffect)(() => {
1499
- var _props$objectList;
1500
- if ((_props$objectList = props.objectList) !== null && _props$objectList !== void 0 && _props$objectList.length) {
1510
+ var _props$objectList2;
1511
+ if ((_props$objectList2 = props.objectList) !== null && _props$objectList2 !== void 0 && _props$objectList2.length) {
1501
1512
  setObjectList(props.objectList);
1502
1513
  } else {
1503
1514
  (async () => {