@riil-frontend/component-topology 11.0.27 → 11.0.28

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.
Files changed (75) hide show
  1. package/build/1.js +2 -2
  2. package/build/2.js +1 -1
  3. package/build/index.css +1 -1
  4. package/build/index.js +20 -20
  5. package/es/components/BatchAttrMetric/index.js +9 -19
  6. package/es/components/BatchAttrMetric/setting.js +64 -30
  7. package/es/components/BatchAttrMetric/utils.js +14 -199
  8. package/es/components/ModelAttrSelectDrawer/components/ModelAttrSelectDrawer.js +1 -1
  9. package/es/core/components/DisplaySettingDrawer/ResourceDisplay/BasicConfig.js +6 -7
  10. package/es/core/components/ResourceViewAttributeSetting/Setting.js +30 -58
  11. package/es/core/components/TopoView/topoView.js +0 -1
  12. package/es/core/components/titlebar/TitleBar.module.scss +0 -9
  13. package/es/core/components/titlebar/widgets/TitleWidget.js +2 -5
  14. package/es/core/editor/components/BottomFloatTool/HelpIcon.js +1 -4
  15. package/es/core/editor/components/BottomFloatTool/HelpIcon.module.scss +10 -8
  16. package/es/core/editor/components/Sidebar/views/BackgroundPanel/BackgroundPanel.js +1 -2
  17. package/es/core/editor/components/Toolbar/widgets/BoxBackgroundButton/BoxBackgroundButton.js +1 -4
  18. package/es/core/editor/components/Toolbar/widgets/EdgeColorButton/EdgeColorButton.js +1 -4
  19. package/es/core/editor/components/Toolbar/widgets/EdgeTypeButton/EdgeType.js +0 -1
  20. package/es/core/editor/components/Toolbar/widgets/EdgeTypeButton/index.js +2 -5
  21. package/es/core/editor/components/Toolbar/widgets/NodeAlignWidget.js +1 -4
  22. package/es/core/editor/components/Toolbar/widgets/NodeImageButton/NodeImageButton.js +1 -4
  23. package/es/core/editor/components/Toolbar/widgets/NodeSizeButton/NodeSizeButton.js +1 -4
  24. package/es/core/models/TopoApp.js +1 -1
  25. package/es/core/models/topoData.js +2 -2
  26. package/es/core/store/models/topoConfig.js +3 -4
  27. package/es/utils/topoData.js +0 -142
  28. package/lib/components/BatchAttrMetric/index.js +9 -19
  29. package/lib/components/BatchAttrMetric/setting.js +58 -24
  30. package/lib/components/BatchAttrMetric/utils.js +16 -206
  31. package/lib/components/ModelAttrSelectDrawer/components/ModelAttrSelectDrawer.js +1 -1
  32. package/lib/core/components/DisplaySettingDrawer/ResourceDisplay/BasicConfig.js +5 -6
  33. package/lib/core/components/ResourceViewAttributeSetting/Setting.js +28 -56
  34. package/lib/core/components/TopoView/topoView.js +0 -1
  35. package/lib/core/components/titlebar/TitleBar.module.scss +0 -9
  36. package/lib/core/components/titlebar/widgets/TitleWidget.js +2 -7
  37. package/lib/core/editor/components/BottomFloatTool/HelpIcon.js +1 -4
  38. package/lib/core/editor/components/BottomFloatTool/HelpIcon.module.scss +10 -8
  39. package/lib/core/editor/components/Sidebar/views/BackgroundPanel/BackgroundPanel.js +1 -2
  40. package/lib/core/editor/components/Toolbar/widgets/BoxBackgroundButton/BoxBackgroundButton.js +1 -4
  41. package/lib/core/editor/components/Toolbar/widgets/EdgeColorButton/EdgeColorButton.js +1 -4
  42. package/lib/core/editor/components/Toolbar/widgets/EdgeTypeButton/EdgeType.js +0 -1
  43. package/lib/core/editor/components/Toolbar/widgets/EdgeTypeButton/index.js +1 -4
  44. package/lib/core/editor/components/Toolbar/widgets/NodeAlignWidget.js +1 -4
  45. package/lib/core/editor/components/Toolbar/widgets/NodeImageButton/NodeImageButton.js +1 -4
  46. package/lib/core/editor/components/Toolbar/widgets/NodeSizeButton/NodeSizeButton.js +3 -4
  47. package/lib/core/models/TopoApp.js +1 -1
  48. package/lib/core/models/topoData.js +2 -2
  49. package/lib/core/store/models/topoConfig.js +3 -6
  50. package/lib/utils/topoData.js +0 -145
  51. package/package.json +2 -2
  52. package/es/components/BatchAttrMetric2/SelectTable.js +0 -21
  53. package/es/components/BatchAttrMetric2/constant.js +0 -30
  54. package/es/components/BatchAttrMetric2/index.js +0 -68
  55. package/es/components/BatchAttrMetric2/index.module.scss +0 -76
  56. package/es/components/BatchAttrMetric2/setting.js +0 -181
  57. package/es/components/BatchAttrMetric2/utils.js +0 -42
  58. package/es/components/ModelAttrSelectDrawer/components/ModelAttrSelect.js +0 -5
  59. package/es/core/components/TopoApp.js +0 -7
  60. package/es/core/components/TopoAppView.js +0 -24
  61. package/es/core/editor/components/Toolbar/widgets/Dropdown.js +0 -12
  62. package/es/core/editor/components/settings/propertyViews/view/GlobalTootipSetting.js +0 -28
  63. package/es/networkTopo/components/Link/index copy.js +0 -213
  64. package/lib/components/BatchAttrMetric2/SelectTable.js +0 -26
  65. package/lib/components/BatchAttrMetric2/constant.js +0 -36
  66. package/lib/components/BatchAttrMetric2/index.js +0 -75
  67. package/lib/components/BatchAttrMetric2/index.module.scss +0 -76
  68. package/lib/components/BatchAttrMetric2/setting.js +0 -189
  69. package/lib/components/BatchAttrMetric2/utils.js +0 -48
  70. package/lib/components/ModelAttrSelectDrawer/components/ModelAttrSelect.js +0 -11
  71. package/lib/core/components/TopoApp.js +0 -13
  72. package/lib/core/components/TopoAppView.js +0 -32
  73. package/lib/core/editor/components/Toolbar/widgets/Dropdown.js +0 -18
  74. package/lib/core/editor/components/settings/propertyViews/view/GlobalTootipSetting.js +0 -34
  75. package/lib/networkTopo/components/Link/index copy.js +0 -220
@@ -1,3 +1,5 @@
1
+ @import '@alifd/next/variables.scss';
2
+
1
3
  .topoHelpIconBtn{
2
4
  width: '100%';
3
5
  height: '100%';
@@ -16,25 +18,25 @@
16
18
  }
17
19
 
18
20
  :global{
19
- .white.next-overlay-inner{
21
+ .white.#{$css-prefix}overlay-inner{
20
22
  padding: 10px;
21
- .next-balloon-close{
23
+ .#{$css-prefix}balloon-close{
22
24
  right: 10px;
23
25
  top:8px
24
26
  }
25
27
  }
26
- .dark.next-overlay-inner{
28
+ .dark.#{$css-prefix}overlay-inner{
27
29
  padding: 10px;
28
30
  background-color: #063658;
29
31
  border-color: #08A5F4;
30
- .next-balloon-close{
32
+ .#{$css-prefix}balloon-close{
31
33
  right: 10px;
32
34
  /* color:$color-text1-5; */
33
35
  color:#fff;
34
36
  top:8px
35
37
  }
36
38
  }
37
- .dark.next-overlay-inner:after{
39
+ .dark.#{$css-prefix}overlay-inner:after{
38
40
  border-color: #08A5F4;
39
41
  background: #063658;
40
42
  }
@@ -61,10 +63,10 @@
61
63
  line-height: 20px;
62
64
  margin-top: 8px;
63
65
  :global{
64
- .next-row{
66
+ .#{$css-prefix}row{
65
67
  margin: 4px 0;
66
68
  }
67
- .next-col-8{
69
+ .#{$css-prefix}col-8{
68
70
  text-align: right;
69
71
  color:$color-text1-4;
70
72
  }
@@ -78,7 +80,7 @@
78
80
  .conten{
79
81
  color:$color-text1-5;
80
82
  :global{
81
- .next-col-8{
83
+ .#{$css-prefix}col-8{
82
84
  color:$color-text1-5;
83
85
  }
84
86
  }
@@ -1,8 +1,7 @@
1
1
  import React from 'react';
2
2
  import BackgroundView from "../../../BackgroundView";
3
3
  export default function BackgroundPanel(props) {
4
- var topo = props.topo,
5
- editorProps = props.editorProps;
4
+ var topo = props.topo;
6
5
  return /*#__PURE__*/React.createElement(BackgroundView, {
7
6
  topo: topo
8
7
  });
@@ -1,5 +1,3 @@
1
- import _objectWithoutPropertiesLoose from "@babel/runtime/helpers/objectWithoutPropertiesLoose";
2
- var _excluded = ["topo", "showLabel"];
3
1
  import React, { useEffect, useState, useMemo } from 'react';
4
2
  import DropdownButton from "../components/DropdownButton";
5
3
  import WidgetBox from "../WidgetBox";
@@ -12,8 +10,7 @@ import { getHtSelection, getGroupsStyle, setGroupsStyle } from "./BoxBackgroundU
12
10
  */
13
11
  function BoxBackgroundButton(props) {
14
12
  var topo = props.topo,
15
- showLabel = props.showLabel,
16
- otherProps = _objectWithoutPropertiesLoose(props, _excluded);
13
+ showLabel = props.showLabel;
17
14
  var _useState = useState(true),
18
15
  disabled = _useState[0],
19
16
  setDisabled = _useState[1];
@@ -1,6 +1,4 @@
1
1
  import _extends from "@babel/runtime/helpers/extends";
2
- import _objectWithoutPropertiesLoose from "@babel/runtime/helpers/objectWithoutPropertiesLoose";
3
- var _excluded = ["topo", "showLabel"];
4
2
  import React, { useEffect, useState } from 'react';
5
3
  import { getEdgesBySelection } from "../../../../utils/edgeTypeStyleUtil";
6
4
  import DropdownButton from "../components/DropdownButton";
@@ -14,8 +12,7 @@ import Content from "./Content";
14
12
  */
15
13
  function EdgeColorButton(props) {
16
14
  var topo = props.topo,
17
- showLabel = props.showLabel,
18
- otherProps = _objectWithoutPropertiesLoose(props, _excluded);
15
+ showLabel = props.showLabel;
19
16
  var _useState = useState(true),
20
17
  disabled = _useState[0],
21
18
  setDisabled = _useState[1];
@@ -80,7 +80,6 @@ function getValuesByEdges(topo) {
80
80
  edges.forEach(function (edge) {
81
81
  edgeValues.push({
82
82
  baseAgreement: false,
83
- //,
84
83
  lineButton: edge.a('edge.type.name') || edge.s('edge.type'),
85
84
  startPoint: getStartPoint(edge),
86
85
  endPoint: getEndPoint(edge),
@@ -1,7 +1,5 @@
1
1
  import _extends from "@babel/runtime/helpers/extends";
2
- import _objectWithoutPropertiesLoose from "@babel/runtime/helpers/objectWithoutPropertiesLoose";
3
- var _excluded = ["topo", "showLabel", "editorProps"];
4
- import React, { useEffect, useMemo, useState } from 'react';
2
+ import React, { useEffect, useState } from 'react';
5
3
  import { getEdgesBySelection, setEdgesAndChildren, setEdgesType } from "../../../../utils/edgeTypeStyleUtil";
6
4
  import DropdownButton from "../components/DropdownButton";
7
5
  import WidgetBox from "../WidgetBox";
@@ -16,8 +14,7 @@ import EdgeType from "./EdgeType";
16
14
  function EdgeTypeButton(props) {
17
15
  var topo = props.topo,
18
16
  showLabel = props.showLabel,
19
- editorProps = props.editorProps,
20
- otherProps = _objectWithoutPropertiesLoose(props, _excluded);
17
+ editorProps = props.editorProps;
21
18
  var _useState = useState(true),
22
19
  disabled = _useState[0],
23
20
  setDisabled = _useState[1];
@@ -1,7 +1,5 @@
1
1
  import _Balloon from "@alifd/next/es/balloon";
2
2
  import _NumberPicker from "@alifd/next/es/number-picker";
3
- import _objectWithoutPropertiesLoose from "@babel/runtime/helpers/objectWithoutPropertiesLoose";
4
- var _excluded = ["topo", "showLabel"];
5
3
  import React, { useState, useEffect } from 'react';
6
4
  import WidgetBox from "./WidgetBox";
7
5
  import DropdownButton from "./components/DropdownButton";
@@ -10,8 +8,7 @@ import { isEdge, isLayer } from "../../../../../utils/htElementUtils";
10
8
  import styles from "./NodeAlignWidget.module.scss";
11
9
  function NodeAlignWidget(props) {
12
10
  var topo = props.topo,
13
- showLabel = props.showLabel,
14
- otherProps = _objectWithoutPropertiesLoose(props, _excluded);
11
+ showLabel = props.showLabel;
15
12
  var _useState = useState(true),
16
13
  disabled = _useState[0],
17
14
  setDisabled = _useState[1];
@@ -1,5 +1,3 @@
1
- import _objectWithoutPropertiesLoose from "@babel/runtime/helpers/objectWithoutPropertiesLoose";
2
- var _excluded = ["topo", "showLabel"];
3
1
  import React, { useEffect, useState } from "react";
4
2
  import { isGroup, isNode, isText } from "../../../../../../utils/htElementUtils";
5
3
  import DropdownButton from "../components/DropdownButton";
@@ -19,8 +17,7 @@ function isElementSetImageEnabled(element) {
19
17
  */
20
18
  function NodeImageButton(props) {
21
19
  var topo = props.topo,
22
- showLabel = props.showLabel,
23
- otherProps = _objectWithoutPropertiesLoose(props, _excluded);
20
+ showLabel = props.showLabel;
24
21
  var _useState = useState(true),
25
22
  disabled = _useState[0],
26
23
  setDisabled = _useState[1];
@@ -1,5 +1,3 @@
1
- import _objectWithoutPropertiesLoose from "@babel/runtime/helpers/objectWithoutPropertiesLoose";
2
- var _excluded = ["topo", "showLabel"];
3
1
  import React, { useEffect, useState } from 'react';
4
2
  // import BatchSetNodeSize from "../../../settings/propertyViews/view/BatchSetNodeSize";
5
3
  import BatchSetNodeSize from "../../../settings/propertyViews/multipleElements/BatchSetNodeSize/BatchSetNodeSize";
@@ -16,8 +14,7 @@ import { isGroup, isNode } from "../../../../../../utils/htElementUtils";
16
14
  */
17
15
  function NodeSizeButton(props) {
18
16
  var topo = props.topo,
19
- showLabel = props.showLabel,
20
- otherProps = _objectWithoutPropertiesLoose(props, _excluded);
17
+ showLabel = props.showLabel;
21
18
  var _useState = useState(true),
22
19
  disabled = _useState[0],
23
20
  setDisabled = _useState[1];
@@ -25,7 +25,7 @@ import SelectionModel from "./SelectionModel";
25
25
  import CiCache from "./cache/CiCache";
26
26
 
27
27
  // eslint-disable-next-line no-undef
28
- var version = typeof "11.0.27" === 'string' ? "11.0.27" : null;
28
+ var version = typeof "11.0.28" === 'string' ? "11.0.28" : null;
29
29
  console.info("\u62D3\u6251\u7248\u672C: " + version);
30
30
 
31
31
  /**
@@ -36,11 +36,11 @@ export function saveTopo(_x) {
36
36
  }
37
37
  function _saveTopo() {
38
38
  _saveTopo = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee(data) {
39
- var topoService, topoId, template, layout, backgroundId, globalConfig, serialize, resources, groups, exportLinkIdList, relateTopoIdList, viewGroupId, groupInfo, viewResources, linkIps;
39
+ var topoService, topoId, template, layout, backgroundId, globalConfig, serialize, resources, groups, relateTopoIdList, viewGroupId, groupInfo, viewResources, linkIps;
40
40
  return _regeneratorRuntime().wrap(function _callee$(_context) {
41
41
  while (1) switch (_context.prev = _context.next) {
42
42
  case 0:
43
- topoService = data.topoService, topoId = data.id, template = data.template, layout = data.layout, backgroundId = data.backgroundId, globalConfig = data.globalConfig, serialize = data.serialize, resources = data.resources, groups = data.groups, exportLinkIdList = data.exportLinkIdList, relateTopoIdList = data.relateTopoIdList, viewGroupId = data.viewGroupId;
43
+ topoService = data.topoService, topoId = data.id, template = data.template, layout = data.layout, backgroundId = data.backgroundId, globalConfig = data.globalConfig, serialize = data.serialize, resources = data.resources, groups = data.groups, relateTopoIdList = data.relateTopoIdList, viewGroupId = data.viewGroupId;
44
44
  rlog.debug("saveTopo", data);
45
45
 
46
46
  // 保存布局
@@ -6,7 +6,7 @@ function _regeneratorRuntime() { "use strict"; /*! regenerator-runtime -- Copyri
6
6
  */
7
7
  import { getUUID, isAvailableArray } from "@riil-frontend/utils";
8
8
  import { transformTopoElements } from "@riil-frontend/component-topology-graph/es/utils";
9
- import topoService, { TOPO_PARENT_ID } from "@riil-frontend/component-topology-common/es/services/topo";
9
+ import { TOPO_PARENT_ID } from "@riil-frontend/component-topology-common/es/services/topo";
10
10
  import rlog from "@riil-frontend/component-topology-utils/es/rlog";
11
11
  import { removeFromArray } from "../../../utils/format";
12
12
  import { DEFAULT_GROUP } from "../../../utils/template";
@@ -220,17 +220,16 @@ export default function (topoApp) {
220
220
  fetchDataByConfig: function fetchDataByConfig(params, rootState) {
221
221
  var _this2 = this;
222
222
  return _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee2() {
223
- var editState, resources, _editState$groups, groups, _editState$exportLink, exportLinkIdList, _editState$ipNodes, ipNodes, query, data;
223
+ var editState, resources, _editState$groups, groups, _editState$ipNodes, ipNodes, query, data;
224
224
  return _regeneratorRuntime().wrap(function _callee2$(_context2) {
225
225
  while (1) switch (_context2.prev = _context2.next) {
226
226
  case 0:
227
227
  editState = rootState.topoConfig;
228
- resources = editState.resources, _editState$groups = editState.groups, groups = _editState$groups === void 0 ? [] : _editState$groups, _editState$exportLink = editState.exportLinkIdList, exportLinkIdList = _editState$exportLink === void 0 ? [] : _editState$exportLink, _editState$ipNodes = editState.ipNodes, ipNodes = _editState$ipNodes === void 0 ? [] : _editState$ipNodes; // console.log("editState", editState);
228
+ resources = editState.resources, _editState$groups = editState.groups, groups = _editState$groups === void 0 ? [] : _editState$groups, _editState$ipNodes = editState.ipNodes, ipNodes = _editState$ipNodes === void 0 ? [] : _editState$ipNodes;
229
229
  query = {
230
230
  id: rootState.topoMod.topoId,
231
231
  resources: resources,
232
232
  groups: groups,
233
- // exportLinkIdList,
234
233
  ipNodes: ipNodes
235
234
  };
236
235
  _context2.next = 5;
@@ -339,148 +339,6 @@ export function getLinksBetweenTwoNodes(links, id1, id2) {
339
339
  });
340
340
  }
341
341
 
342
- // 批量更新指标状态
343
- export var updateAllCiDoc = function updateAllCiDoc(dataType, doc, ciDoc, allCiSet) {
344
- rlog.debug("updateAllCiDoc", dataType, doc, ciDoc);
345
- var cidoc = _.cloneDeep(ciDoc);
346
- var allciset = _.cloneDeep(allCiSet);
347
- var ciArr = Object.keys(cidoc);
348
- ciArr.map(function (key) {
349
- rlog.debug("Object.keys", allciset, cidoc, key);
350
- var arr = [];
351
- var list = cidoc[key].list.map(function (d) {
352
- var ciType = cidoc[key].code;
353
-
354
- // rlog.debug('Object.keys---list-item', cidoc[key], ciType, d);
355
- var item = findItem(doc[ciType], "code", d.code);
356
- // rlog.debug('Object.keys---list-findItem', doc[ciType], item);
357
- var r = _extends({}, d);
358
- var name = cidoc[key].name;
359
- // rlog.debug('Object.keys---r', r);
360
- if (item) {
361
- r[dataType] = true;
362
- var num = 0;
363
- var nameArr = [];
364
- ciArr.map(function (ci) {
365
- var ciItem = cidoc[ci];
366
- if (ciItem.code === ciType) {
367
- num += 1;
368
- nameArr.push(ciItem.name);
369
- }
370
- return "";
371
- });
372
- rlog.debug("Object.keys---nameArr", num, nameArr);
373
- if (dataType === "tip") {
374
- r.ciTipNum = num;
375
- r.ciTipArr = nameArr;
376
- } else if (dataType === "tag") {
377
- r.ciTagNum = num;
378
- r.ciTagArr = nameArr;
379
- }
380
- arr.push(item);
381
- } else {
382
- r[dataType] = false;
383
- if (dataType === "tip") {
384
- r.ciTipNum = 0;
385
- r.ciTipArr = [];
386
- } else if (dataType === "tag") {
387
- r.ciTagNum = 0;
388
- r.ciTagArr = [];
389
- }
390
- }
391
- return r;
392
- });
393
- var uniqArr = _.uniqWith(arr, _.isEqual);
394
- rlog.debug("Object.keys---list-result-arr,list", arr, uniqArr, list);
395
- allciset[cidoc[key].code].list = list;
396
- cidoc[key][dataType] = uniqArr;
397
- cidoc[key].list = list;
398
- return "";
399
- });
400
- rlog.debug("updateAllCiDoc-result", cidoc);
401
- return {
402
- cidoc: cidoc,
403
- allciset: allciset
404
- };
405
- };
406
- // 更新指标状态
407
- export var updateCiDoc = function updateCiDoc(dataType, doc, ciDoc, allCiSet) {
408
- rlog.debug("updateCiDoc", dataType, doc, ciDoc, allCiSet);
409
- var dt = {
410
- attribute: "attributes",
411
- metric: "metrics"
412
- };
413
- var cidoc = _.cloneDeep(ciDoc);
414
- var allciset = _.cloneDeep(allCiSet);
415
- Object.keys(doc).map(function (key) {
416
- var arr = doc[key].map(function (item) {
417
- return item;
418
- });
419
- var list = cidoc[key].list.map(function (d) {
420
- var r = _extends({}, d);
421
- var ciname = cidoc[key].name;
422
- if (findItemIndex(arr, "code", d.code) < 0) {
423
- r[dataType] = false;
424
- if (dataType === "tip") {
425
- r.ciTipNum = r.ciTipNum > 1 ? r.ciTipNum - 1 : 0;
426
- r.ciTipArr = r.ciTipArr.length > 1 ? r.ciTipArr.splice(r.ciTipArr.indexOf(ciname), 1) : [];
427
- } else if (dataType === "tag") {
428
- r.ciTagNum = r.ciTagNum > 1 ? r.ciTagNum - 1 : 0;
429
- r.ciTagArr = r.ciTagArr.length > 1 ? r.ciTagArr.splice(r.ciTagArr.indexOf(ciname), 1) : [];
430
- }
431
- } else {
432
- r[dataType] = true;
433
- if (dataType === "tip") {
434
- if (r.ciTipArr.indexOf(ciname) < 0) {
435
- r.ciTipNum += 1;
436
- r.ciTipArr.push(ciname);
437
- }
438
- } else if (dataType === "tag") {
439
- if (r.ciTagArr.indexOf(ciname) < 0) {
440
- r.ciTagNum += 1;
441
- r.ciTagArr.push(ciname);
442
- }
443
- }
444
- }
445
- return r;
446
- });
447
- var list2 = cidoc[key].list.map(function (d) {
448
- var r = _extends({}, d);
449
- var ciname = cidoc[key].name;
450
- if (findItemIndex(arr, "code", d.code) < 0) {
451
- if (dataType === "tip") {
452
- r.ciTipNum = r.ciTipNum > 1 ? r.ciTipNum - 1 : 0;
453
- r.ciTipArr = r.ciTipArr.length > 1 ? r.ciTipArr.splice(r.ciTipArr.indexOf(ciname), 1) : [];
454
- } else if (dataType === "tag") {
455
- r.ciTagNum = r.ciTagNum > 1 ? r.ciTagNum - 1 : 0;
456
- r.ciTagArr = r.ciTagArr.length > 1 ? r.ciTagArr.splice(r.ciTagArr.indexOf(ciname), 1) : [];
457
- }
458
- } else if (dataType === "tip") {
459
- if (r.ciTipArr.indexOf(ciname) < 0) {
460
- r.ciTipNum += 1;
461
- r.ciTipArr.push(ciname);
462
- }
463
- } else if (dataType === "tag") {
464
- if (r.ciTagArr.indexOf(ciname) < 0) {
465
- r.ciTagNum += 1;
466
- r.ciTagArr.push(ciname);
467
- }
468
- }
469
- return r;
470
- });
471
- rlog.debug("updateCiDoc-result-----list", list, list2);
472
- allciset[cidoc[key].code].list = list2;
473
- cidoc[key][dataType] = arr;
474
- cidoc[key].list = list;
475
- return "";
476
- });
477
- // rlog.debug('updateCiDoc-result', cidoc);
478
- return {
479
- cidoc: cidoc,
480
- allciset: allciset
481
- };
482
- };
483
-
484
342
  /**
485
343
  * 将从topo组件返回的数据(global)转化为后端接收的数据
486
344
  * 具体格式内容参考
@@ -12,41 +12,32 @@ var _propTypes = _interopRequireDefault(require("prop-types"));
12
12
  var _indexModule = _interopRequireDefault(require("./index.module.scss"));
13
13
  var _setting = _interopRequireDefault(require("./setting"));
14
14
  var _constant = require("./constant");
15
- var _excluded = ["saveCb"],
15
+ var _excluded = ["saveCb", "showType"],
16
16
  _excluded2 = ["drawerTitle", "drawerWidth"];
17
17
  function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
18
18
  function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { "default": obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj["default"] = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
19
19
  /**
20
20
  * 属性指标配置抽屉
21
21
  */
22
- var BatchAttrMetricDrawer = /*#__PURE__*/(0, _react.forwardRef)(function (_ref, ref) {
23
- var _saveCb = _ref.saveCb,
24
- props = (0, _objectWithoutPropertiesLoose2["default"])(_ref, _excluded);
22
+ var BatchAttrMetricDrawer = /*#__PURE__*/(0, _react.forwardRef)(function (props, ref) {
23
+ var _saveCb = props.saveCb,
24
+ showType = props.showType,
25
+ settingProps = (0, _objectWithoutPropertiesLoose2["default"])(props, _excluded);
25
26
  var _useBoolean = (0, _ahooks.useBoolean)(false),
26
27
  visible = _useBoolean[0],
27
28
  _useBoolean$ = _useBoolean[1],
28
29
  setTrue = _useBoolean$.setTrue,
29
30
  setFalse = _useBoolean$.setFalse;
30
- // 选择类型,single/batch
31
31
  var selectType = 'batch';
32
- // 数据类型,tip/tag
33
- var _useState = (0, _react.useState)(),
34
- showType = _useState[0],
35
- setShowType = _useState[1];
36
32
  (0, _react.useImperativeHandle)(ref, function () {
37
33
  return {
38
34
  /**
39
35
  * 展开抽屉
40
- * @param {*} entryConfig 入口配置对象,必须
41
- * @param {*} entryConfig.selectType 选择类型(single/batch),必须
42
- * @param {*} entryConfig.dataType 数据类型(tip/tag),必须
43
36
  */
44
37
  show: function show(entryConfig) {
45
38
  if (entryConfig === void 0) {
46
39
  entryConfig = {};
47
40
  }
48
- // setSelectType(entryConfig.selectType);
49
- setShowType(entryConfig.showType);
50
41
  setTrue();
51
42
  }
52
43
  };
@@ -62,19 +53,18 @@ var BatchAttrMetricDrawer = /*#__PURE__*/(0, _react.forwardRef)(function (_ref,
62
53
  title: drawerTitle,
63
54
  className: _indexModule["default"].drawer,
64
55
  width: drawerWidth
65
- }, visible && /*#__PURE__*/_react["default"].createElement(_setting["default"], (0, _extends2["default"])({}, pageConfig, props, {
66
- showType: showType,
56
+ }, visible && /*#__PURE__*/_react["default"].createElement(_setting["default"], (0, _extends2["default"])({}, pageConfig, settingProps, {
67
57
  cancelCb: setFalse,
68
58
  saveCb: function saveCb(values) {
69
59
  setFalse();
70
- _saveCb(showType, values, selectType);
60
+ _saveCb(showType, values);
71
61
  }
72
62
  })));
73
63
  });
74
- BatchAttrMetricDrawer.displayName = 'BatchAttrMetricDrawer';
64
+ BatchAttrMetricDrawer.displayName = 'BatchAttrMetricDrawerV2';
75
65
  BatchAttrMetricDrawer.propTypes = {
76
66
  // 数据项
77
- allCiSet: _propTypes["default"].any.isRequired,
67
+ dataSource: _propTypes["default"].array.isRequired,
78
68
  // 保存回调
79
69
  saveCb: _propTypes["default"].func
80
70
  };
@@ -18,24 +18,33 @@ var _componentTableLayout = _interopRequireDefault(require("@riil-frontend/compo
18
18
  var _hooks = _interopRequireDefault(require("@riil-frontend/hooks"));
19
19
  var utils = _interopRequireWildcard(require("./utils"));
20
20
  var _indexModule = _interopRequireDefault(require("./index.module.scss"));
21
- var _excluded = ["value", "defaultSet", "allCiSet", "showType"];
21
+ var _treeUtil = require("../../utils/treeUtil");
22
+ var _excluded = ["value", "defaultSet", "dataSource"];
22
23
  function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
23
24
  function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { "default": obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj["default"] = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
24
25
  var Setting = function Setting(_ref) {
25
26
  var _ref$value = _ref.value,
26
27
  value = _ref$value === void 0 ? {} : _ref$value,
27
28
  defaultSet = _ref.defaultSet,
28
- allCiSet = _ref.allCiSet,
29
- showType = _ref.showType,
29
+ dataSource = _ref.dataSource,
30
30
  props = (0, _objectWithoutPropertiesLoose2["default"])(_ref, _excluded);
31
- // const allCiSet = utils.dsTransform(props.allCiSet);
32
-
33
31
  var limit = props.limit,
34
- saveCb = props.saveCb,
35
- elementType = props.elementType;
36
- var _useState = (0, _react.useState)(Object.keys(allCiSet)[0]),
32
+ saveCb = props.saveCb;
33
+ var allCiSet = (0, _react.useMemo)(function () {
34
+ var map = {};
35
+ (0, _treeUtil.loopTreeNode)(dataSource, function (item) {
36
+ if (item.type !== 'folder') {
37
+ map[item.id] = item;
38
+ }
39
+ });
40
+ return map;
41
+ }, [dataSource]);
42
+ var _useState = (0, _react.useState)(utils.getDefaultSelectedCiType(dataSource)),
37
43
  ciType = _useState[0],
38
44
  setCiType = _useState[1];
45
+ (0, _react.useEffect)(function () {
46
+ setCiType(utils.getDefaultSelectedCiType(dataSource));
47
+ }, [dataSource]);
39
48
  var _useState2 = (0, _react.useState)(''),
40
49
  search = _useState2[0],
41
50
  setSearch = _useState2[1];
@@ -44,31 +53,46 @@ var Setting = function Setting(_ref) {
44
53
  setSelected = _useState3[1];
45
54
  var selectedRowKeys = selected[ciType] || [];
46
55
  var _RiilHooks$useTableCo = _hooks["default"].useTableColumn({
47
- columns: utils.columns(showType, props.showCiNum)
56
+ columns: [{
57
+ width: '100%',
58
+ dataIndex: 'name',
59
+ title: '数据',
60
+ cellOption: {
61
+ nowrap: true
62
+ }
63
+ }, {
64
+ width: '70px',
65
+ dataIndex: 'type',
66
+ title: '类型',
67
+ cellOption: {
68
+ nowrap: {
69
+ nowrapCell: utils.typeCell,
70
+ title: utils.typeCell
71
+ }
72
+ }
73
+ }]
48
74
  }),
49
75
  columnNodes = _RiilHooks$useTableCo.columnNodes;
50
76
  var onTreeSelect = function onTreeSelect(_ref2) {
51
77
  var selectedKey = _ref2[0];
52
- if (selectedKey) {
78
+ if (selectedKey && allCiSet[selectedKey] && allCiSet[selectedKey].type !== 'folder') {
53
79
  setCiType(selectedKey);
54
80
  }
55
81
  };
56
82
  var onTableSelect = function onTableSelect(selectedKeys) {
57
83
  var values = (0, _extends2["default"])({}, selected);
58
- _rlog["default"].debug("Setting-allCiSet-onTableSelect", limit, selectedKeys, selected);
84
+ _rlog["default"].debug('Setting-allCiSet-onTableSelect', limit, selectedKeys, selected);
59
85
  values[ciType] = selectedKeys;
60
86
  setSelected(values);
61
87
  };
62
88
  var saveSelected = function saveSelected() {
63
- saveCb(utils.saveTransform(selected));
89
+ saveCb(selected);
64
90
  };
65
91
  var onReset = function onReset() {
66
- var values = utils.defaultSelected(allCiSet, defaultSet, showType);
67
- setSelected(values);
92
+ setSelected({});
68
93
  };
69
94
  var tableData = (0, _react.useMemo)(function () {
70
95
  var _allCiSet$ciType;
71
- // console.log('allCiSet,ciType,search', allCiSet, ciType, search);
72
96
  var list = ((_allCiSet$ciType = allCiSet[ciType]) === null || _allCiSet$ciType === void 0 ? void 0 : _allCiSet$ciType.list) || [];
73
97
  if (search) {
74
98
  list = list.filter(function (item) {
@@ -78,9 +102,8 @@ var Setting = function Setting(_ref) {
78
102
  }
79
103
  return list;
80
104
  }, [allCiSet, ciType, search]);
81
- function onSearch(value) {
82
- // console.log('search', search);
83
- setSearch(value);
105
+ function onSearch(searchValue) {
106
+ setSearch(searchValue);
84
107
  }
85
108
  return /*#__PURE__*/_react["default"].createElement("div", {
86
109
  className: _indexModule["default"].layout
@@ -90,18 +113,29 @@ var Setting = function Setting(_ref) {
90
113
  type: "notice"
91
114
  }, props.label + "\u6570\u636E\uFF1A\u9009\u62E9\u7684\u6307\u6807\u548C\u5C5E\u6027\u5C06\u4F1A\u663E\u793A\u5728" + props.poslabel + "\uFF0C\u6700\u591A\u652F\u6301\u52FE\u9009 " + limit + " \u9879\u3002")), /*#__PURE__*/_react["default"].createElement(_grid["default"].Row, {
92
115
  className: _indexModule["default"].content
93
- }, props.showTree && /*#__PURE__*/_react["default"].createElement(_grid["default"].Col, {
116
+ }, /*#__PURE__*/_react["default"].createElement(_grid["default"].Col, {
94
117
  span: 8,
95
- className: _indexModule["default"]["tree-wrap"]
96
- }, /*#__PURE__*/_react["default"].createElement(_componentActionTree["default"], {
97
- dataSource: utils.treeDs(allCiSet),
118
+ className: _indexModule["default"]['tree-wrap']
119
+ }, dataSource.length && /*#__PURE__*/_react["default"].createElement(_componentActionTree["default"], {
120
+ dataSource: dataSource,
98
121
  onSelect: onTreeSelect,
99
122
  draggable: false,
100
123
  treeProps: {
101
- selectedKeys: [ciType]
124
+ selectedKeys: [ciType],
125
+ defaultExpandedKeys: dataSource.filter(function (item) {
126
+ return item.type === 'folder';
127
+ }).map(function (item) {
128
+ return item.id;
129
+ }),
130
+ expandedKeys: dataSource.filter(function (item) {
131
+ return item.type === 'folder';
132
+ }).map(function (item) {
133
+ return item.id;
134
+ }),
135
+ defaultExpandAll: true
102
136
  }
103
137
  })), /*#__PURE__*/_react["default"].createElement(_grid["default"].Col, {
104
- className: _indexModule["default"]["table-wrap"]
138
+ className: _indexModule["default"]['table-wrap']
105
139
  }, /*#__PURE__*/_react["default"].createElement(_componentTableLayout["default"], {
106
140
  filterItems: /*#__PURE__*/_react["default"].createElement("div", {
107
141
  className: _indexModule["default"].filter