@riil-frontend/component-topology 6.0.11 → 6.0.12
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.
- package/build/index.js +1 -1
- package/es/core/editor/components/Toolbar/widgets/FontColorButton.js +1 -1
- package/es/core/models/TopoApp.js +1 -1
- package/es/networkTopo/services/funcAuth.js +39 -0
- package/es/networkTopo/services/index.js +2 -1
- package/es/networkTopo/store/functionAuth.js +85 -97
- package/lib/core/editor/components/Toolbar/widgets/FontColorButton.js +1 -1
- package/lib/core/models/TopoApp.js +1 -1
- package/lib/networkTopo/services/funcAuth.js +50 -0
- package/lib/networkTopo/services/index.js +3 -1
- package/lib/networkTopo/store/functionAuth.js +94 -109
- package/package.json +2 -2
@@ -25,7 +25,7 @@ function FontColorDropdown(props) {
|
|
25
25
|
var backOpacityChange = function backOpacityChange(value) {
|
26
26
|
topo.historyManager.beginTransaction();
|
27
27
|
onChange({
|
28
|
-
opacity:
|
28
|
+
opacity: (value / 100).toFixed(2)
|
29
29
|
});
|
30
30
|
topo.historyManager.endTransaction();
|
31
31
|
};
|
@@ -23,7 +23,7 @@ import topoFactory from "./topoFactory";
|
|
23
23
|
import ElementTagTipConfig from "./tagstips/ElementTagTipConfig";
|
24
24
|
import SelectionModel from "./SelectionModel"; // eslint-disable-next-line no-undef
|
25
25
|
|
26
|
-
var version = typeof "6.0.
|
26
|
+
var version = typeof "6.0.12" === 'string' ? "6.0.12" : null;
|
27
27
|
console.info("\u62D3\u6251\u7248\u672C: " + version);
|
28
28
|
/**
|
29
29
|
* 拓扑显示和编辑
|
@@ -0,0 +1,39 @@
|
|
1
|
+
import _asyncToGenerator from "@babel/runtime/helpers/asyncToGenerator";
|
2
|
+
import _regeneratorRuntime from "@babel/runtime/regenerator";
|
3
|
+
import authServices from '@riil-frontend/component-topology-common/es/services/authorization';
|
4
|
+
export default {
|
5
|
+
getFuncAuth: function getFuncAuth() {
|
6
|
+
return _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee() {
|
7
|
+
var funcResult, permissions;
|
8
|
+
return _regeneratorRuntime.wrap(function _callee$(_context) {
|
9
|
+
while (1) {
|
10
|
+
switch (_context.prev = _context.next) {
|
11
|
+
case 0:
|
12
|
+
_context.next = 2;
|
13
|
+
return authServices.checkFuncAuthentication([{
|
14
|
+
func: 'topo_createTopo'
|
15
|
+
}, {
|
16
|
+
func: 'topo_manageNavTree'
|
17
|
+
}, {
|
18
|
+
func: 'topo_setTopoPermission'
|
19
|
+
}, {
|
20
|
+
func: 'addResource'
|
21
|
+
}]);
|
22
|
+
|
23
|
+
case 2:
|
24
|
+
funcResult = _context.sent;
|
25
|
+
permissions = {};
|
26
|
+
funcResult.forEach(function (func) {
|
27
|
+
permissions[func.func.replace('topo_', '')] = func.passed === 'PASS';
|
28
|
+
});
|
29
|
+
return _context.abrupt("return", permissions);
|
30
|
+
|
31
|
+
case 6:
|
32
|
+
case "end":
|
33
|
+
return _context.stop();
|
34
|
+
}
|
35
|
+
}
|
36
|
+
}, _callee);
|
37
|
+
}))();
|
38
|
+
}
|
39
|
+
};
|
@@ -3,7 +3,8 @@ import _extends from "@babel/runtime/helpers/extends";
|
|
3
3
|
import _regeneratorRuntime from "@babel/runtime/regenerator";
|
4
4
|
import topoService from '@riil-frontend/component-topology-common/es/services/topo';
|
5
5
|
import { request } from '@riil-frontend/component-topology-utils';
|
6
|
-
|
6
|
+
import funcAuth from "./funcAuth";
|
7
|
+
export default _extends({}, topoService, funcAuth, {
|
7
8
|
// 获取有权限的拓扑树
|
8
9
|
getTopoTreeByLoginUser: function getTopoTreeByLoginUser(params) {
|
9
10
|
return _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee() {
|
@@ -6,111 +6,99 @@ import _regeneratorRuntime from "@babel/runtime/regenerator";
|
|
6
6
|
* 功能权限 Model
|
7
7
|
*/
|
8
8
|
import rlog from '@riil-frontend/component-topology-utils/es/rlog';
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
}
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
}
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
var _this = this;
|
9
|
+
export default function (topo) {
|
10
|
+
return {
|
11
|
+
// 定义 model 的初始 state
|
12
|
+
state: {
|
13
|
+
permissions: {
|
14
|
+
createTopo: false,
|
15
|
+
manageNavTree: false,
|
16
|
+
setTopoPermission: false
|
17
|
+
}
|
18
|
+
},
|
19
|
+
// 定义改变该模型状态的纯函数
|
20
|
+
reducers: {
|
21
|
+
update: function update(prevState, payload) {
|
22
|
+
return _extends({}, prevState, payload);
|
23
|
+
}
|
24
|
+
},
|
25
|
+
// 定义处理该模型副作用的函数
|
26
|
+
effects: function effects(dispatch) {
|
27
|
+
return {
|
28
|
+
init: function init(payload, rootState) {
|
29
|
+
var _this = this;
|
31
30
|
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
|
31
|
+
return _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee() {
|
32
|
+
var permissions;
|
33
|
+
return _regeneratorRuntime.wrap(function _callee$(_context) {
|
34
|
+
while (1) {
|
35
|
+
switch (_context.prev = _context.next) {
|
36
|
+
case 0:
|
37
|
+
_context.next = 2;
|
38
|
+
return _this.getPermissions();
|
40
39
|
|
41
|
-
|
42
|
-
|
40
|
+
case 2:
|
41
|
+
permissions = _context.sent;
|
43
42
|
|
44
|
-
|
45
|
-
|
46
|
-
|
47
|
-
|
48
|
-
|
43
|
+
if (permissions) {
|
44
|
+
_this.update({
|
45
|
+
permissions: permissions
|
46
|
+
});
|
47
|
+
}
|
49
48
|
|
50
|
-
|
51
|
-
|
52
|
-
|
49
|
+
case 4:
|
50
|
+
case "end":
|
51
|
+
return _context.stop();
|
52
|
+
}
|
53
53
|
}
|
54
|
-
}
|
55
|
-
}
|
56
|
-
}
|
57
|
-
|
58
|
-
|
59
|
-
|
60
|
-
|
61
|
-
|
62
|
-
|
63
|
-
|
64
|
-
|
65
|
-
|
66
|
-
return authServices.checkFuncAuthentication([{
|
67
|
-
func: 'topo_createTopo'
|
68
|
-
}, {
|
69
|
-
func: 'topo_manageNavTree'
|
70
|
-
}, {
|
71
|
-
func: 'topo_setTopoPermission'
|
72
|
-
}, {
|
73
|
-
func: 'addResource'
|
74
|
-
}]);
|
54
|
+
}, _callee);
|
55
|
+
}))();
|
56
|
+
},
|
57
|
+
getPermissions: function getPermissions() {
|
58
|
+
return _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee2() {
|
59
|
+
var permissions;
|
60
|
+
return _regeneratorRuntime.wrap(function _callee2$(_context2) {
|
61
|
+
while (1) {
|
62
|
+
switch (_context2.prev = _context2.next) {
|
63
|
+
case 0:
|
64
|
+
_context2.next = 2;
|
65
|
+
return topo.serverApi.getFuncAuth();
|
75
66
|
|
76
|
-
|
77
|
-
|
78
|
-
|
79
|
-
funcResult.forEach(function (func) {
|
80
|
-
permissions[func.func.replace('topo_', '')] = func.passed === 'PASS';
|
81
|
-
});
|
82
|
-
return _context2.abrupt("return", permissions);
|
67
|
+
case 2:
|
68
|
+
permissions = _context2.sent;
|
69
|
+
return _context2.abrupt("return", permissions);
|
83
70
|
|
84
|
-
|
85
|
-
|
86
|
-
|
71
|
+
case 4:
|
72
|
+
case "end":
|
73
|
+
return _context2.stop();
|
74
|
+
}
|
87
75
|
}
|
88
|
-
}
|
89
|
-
}
|
90
|
-
}
|
91
|
-
|
92
|
-
|
93
|
-
|
94
|
-
|
95
|
-
|
96
|
-
var _this2 = this;
|
76
|
+
}, _callee2);
|
77
|
+
}))();
|
78
|
+
},
|
79
|
+
checkAuth: function checkAuth(name, rootState) {
|
80
|
+
return rootState.functionAuth.permissions[name];
|
81
|
+
},
|
82
|
+
refresh: function refresh() {
|
83
|
+
var _this2 = this;
|
97
84
|
|
98
|
-
|
99
|
-
|
100
|
-
|
101
|
-
|
102
|
-
|
103
|
-
|
104
|
-
|
85
|
+
return _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee3() {
|
86
|
+
return _regeneratorRuntime.wrap(function _callee3$(_context3) {
|
87
|
+
while (1) {
|
88
|
+
switch (_context3.prev = _context3.next) {
|
89
|
+
case 0:
|
90
|
+
_context3.next = 2;
|
91
|
+
return _this2.init();
|
105
92
|
|
106
|
-
|
107
|
-
|
108
|
-
|
93
|
+
case 2:
|
94
|
+
case "end":
|
95
|
+
return _context3.stop();
|
96
|
+
}
|
109
97
|
}
|
110
|
-
}
|
111
|
-
}
|
112
|
-
}
|
113
|
-
}
|
114
|
-
}
|
115
|
-
}
|
116
|
-
}
|
98
|
+
}, _callee3);
|
99
|
+
}))();
|
100
|
+
}
|
101
|
+
};
|
102
|
+
}
|
103
|
+
};
|
104
|
+
}
|
@@ -43,7 +43,7 @@ function FontColorDropdown(props) {
|
|
43
43
|
var backOpacityChange = function backOpacityChange(value) {
|
44
44
|
topo.historyManager.beginTransaction();
|
45
45
|
onChange({
|
46
|
-
opacity:
|
46
|
+
opacity: (value / 100).toFixed(2)
|
47
47
|
});
|
48
48
|
topo.historyManager.endTransaction();
|
49
49
|
};
|
@@ -54,7 +54,7 @@ var _ElementTagTipConfig = _interopRequireDefault(require("./tagstips/ElementTag
|
|
54
54
|
var _SelectionModel = _interopRequireDefault(require("./SelectionModel"));
|
55
55
|
|
56
56
|
// eslint-disable-next-line no-undef
|
57
|
-
var version = typeof "6.0.
|
57
|
+
var version = typeof "6.0.12" === 'string' ? "6.0.12" : null;
|
58
58
|
console.info("\u62D3\u6251\u7248\u672C: " + version);
|
59
59
|
/**
|
60
60
|
* 拓扑显示和编辑
|
@@ -0,0 +1,50 @@
|
|
1
|
+
"use strict";
|
2
|
+
|
3
|
+
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
4
|
+
|
5
|
+
exports.__esModule = true;
|
6
|
+
exports["default"] = void 0;
|
7
|
+
|
8
|
+
var _regenerator = _interopRequireDefault(require("@babel/runtime/regenerator"));
|
9
|
+
|
10
|
+
var _asyncToGenerator2 = _interopRequireDefault(require("@babel/runtime/helpers/asyncToGenerator"));
|
11
|
+
|
12
|
+
var _authorization = _interopRequireDefault(require("@riil-frontend/component-topology-common/es/services/authorization"));
|
13
|
+
|
14
|
+
var _default = {
|
15
|
+
getFuncAuth: function getFuncAuth() {
|
16
|
+
return (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee() {
|
17
|
+
var funcResult, permissions;
|
18
|
+
return _regenerator["default"].wrap(function _callee$(_context) {
|
19
|
+
while (1) {
|
20
|
+
switch (_context.prev = _context.next) {
|
21
|
+
case 0:
|
22
|
+
_context.next = 2;
|
23
|
+
return _authorization["default"].checkFuncAuthentication([{
|
24
|
+
func: 'topo_createTopo'
|
25
|
+
}, {
|
26
|
+
func: 'topo_manageNavTree'
|
27
|
+
}, {
|
28
|
+
func: 'topo_setTopoPermission'
|
29
|
+
}, {
|
30
|
+
func: 'addResource'
|
31
|
+
}]);
|
32
|
+
|
33
|
+
case 2:
|
34
|
+
funcResult = _context.sent;
|
35
|
+
permissions = {};
|
36
|
+
funcResult.forEach(function (func) {
|
37
|
+
permissions[func.func.replace('topo_', '')] = func.passed === 'PASS';
|
38
|
+
});
|
39
|
+
return _context.abrupt("return", permissions);
|
40
|
+
|
41
|
+
case 6:
|
42
|
+
case "end":
|
43
|
+
return _context.stop();
|
44
|
+
}
|
45
|
+
}
|
46
|
+
}, _callee);
|
47
|
+
}))();
|
48
|
+
}
|
49
|
+
};
|
50
|
+
exports["default"] = _default;
|
@@ -15,7 +15,9 @@ var _topo = _interopRequireDefault(require("@riil-frontend/component-topology-co
|
|
15
15
|
|
16
16
|
var _componentTopologyUtils = require("@riil-frontend/component-topology-utils");
|
17
17
|
|
18
|
-
var
|
18
|
+
var _funcAuth = _interopRequireDefault(require("./funcAuth"));
|
19
|
+
|
20
|
+
var _default = (0, _extends2["default"])({}, _topo["default"], _funcAuth["default"], {
|
19
21
|
// 获取有权限的拓扑树
|
20
22
|
getTopoTreeByLoginUser: function getTopoTreeByLoginUser(params) {
|
21
23
|
return (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee() {
|
@@ -3,7 +3,7 @@
|
|
3
3
|
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
4
4
|
|
5
5
|
exports.__esModule = true;
|
6
|
-
exports["default"] =
|
6
|
+
exports["default"] = _default;
|
7
7
|
|
8
8
|
var _regenerator = _interopRequireDefault(require("@babel/runtime/regenerator"));
|
9
9
|
|
@@ -13,117 +13,102 @@ var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends")
|
|
13
13
|
|
14
14
|
var _rlog = _interopRequireDefault(require("@riil-frontend/component-topology-utils/es/rlog"));
|
15
15
|
|
16
|
-
var _topo = _interopRequireDefault(require("@riil-frontend/component-topology-common/es/services/topo"));
|
17
|
-
|
18
|
-
var _authorization = _interopRequireDefault(require("@riil-frontend/component-topology-common/es/services/authorization"));
|
19
|
-
|
20
16
|
/**
|
21
17
|
* 功能权限 Model
|
22
18
|
*/
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
|
46
|
-
|
47
|
-
|
48
|
-
|
49
|
-
|
50
|
-
|
51
|
-
|
52
|
-
|
53
|
-
|
54
|
-
|
55
|
-
|
56
|
-
|
57
|
-
|
58
|
-
|
59
|
-
|
60
|
-
|
61
|
-
|
62
|
-
|
63
|
-
|
64
|
-
|
19
|
+
function _default(topo) {
|
20
|
+
return {
|
21
|
+
// 定义 model 的初始 state
|
22
|
+
state: {
|
23
|
+
permissions: {
|
24
|
+
createTopo: false,
|
25
|
+
manageNavTree: false,
|
26
|
+
setTopoPermission: false
|
27
|
+
}
|
28
|
+
},
|
29
|
+
// 定义改变该模型状态的纯函数
|
30
|
+
reducers: {
|
31
|
+
update: function update(prevState, payload) {
|
32
|
+
return (0, _extends2["default"])({}, prevState, payload);
|
33
|
+
}
|
34
|
+
},
|
35
|
+
// 定义处理该模型副作用的函数
|
36
|
+
effects: function effects(dispatch) {
|
37
|
+
return {
|
38
|
+
init: function init(payload, rootState) {
|
39
|
+
var _this = this;
|
40
|
+
|
41
|
+
return (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee() {
|
42
|
+
var permissions;
|
43
|
+
return _regenerator["default"].wrap(function _callee$(_context) {
|
44
|
+
while (1) {
|
45
|
+
switch (_context.prev = _context.next) {
|
46
|
+
case 0:
|
47
|
+
_context.next = 2;
|
48
|
+
return _this.getPermissions();
|
49
|
+
|
50
|
+
case 2:
|
51
|
+
permissions = _context.sent;
|
52
|
+
|
53
|
+
if (permissions) {
|
54
|
+
_this.update({
|
55
|
+
permissions: permissions
|
56
|
+
});
|
57
|
+
}
|
58
|
+
|
59
|
+
case 4:
|
60
|
+
case "end":
|
61
|
+
return _context.stop();
|
62
|
+
}
|
65
63
|
}
|
66
|
-
}
|
67
|
-
}
|
68
|
-
}
|
69
|
-
|
70
|
-
|
71
|
-
|
72
|
-
|
73
|
-
|
74
|
-
|
75
|
-
|
76
|
-
|
77
|
-
|
78
|
-
|
79
|
-
|
80
|
-
|
81
|
-
|
82
|
-
|
83
|
-
|
84
|
-
|
85
|
-
|
86
|
-
|
87
|
-
|
88
|
-
case 2:
|
89
|
-
funcResult = _context2.sent;
|
90
|
-
permissions = {};
|
91
|
-
funcResult.forEach(function (func) {
|
92
|
-
permissions[func.func.replace('topo_', '')] = func.passed === 'PASS';
|
93
|
-
});
|
94
|
-
return _context2.abrupt("return", permissions);
|
95
|
-
|
96
|
-
case 6:
|
97
|
-
case "end":
|
98
|
-
return _context2.stop();
|
64
|
+
}, _callee);
|
65
|
+
}))();
|
66
|
+
},
|
67
|
+
getPermissions: function getPermissions() {
|
68
|
+
return (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee2() {
|
69
|
+
var permissions;
|
70
|
+
return _regenerator["default"].wrap(function _callee2$(_context2) {
|
71
|
+
while (1) {
|
72
|
+
switch (_context2.prev = _context2.next) {
|
73
|
+
case 0:
|
74
|
+
_context2.next = 2;
|
75
|
+
return topo.serverApi.getFuncAuth();
|
76
|
+
|
77
|
+
case 2:
|
78
|
+
permissions = _context2.sent;
|
79
|
+
return _context2.abrupt("return", permissions);
|
80
|
+
|
81
|
+
case 4:
|
82
|
+
case "end":
|
83
|
+
return _context2.stop();
|
84
|
+
}
|
99
85
|
}
|
100
|
-
}
|
101
|
-
}
|
102
|
-
}
|
103
|
-
|
104
|
-
|
105
|
-
|
106
|
-
|
107
|
-
|
108
|
-
|
109
|
-
|
110
|
-
|
111
|
-
|
112
|
-
|
113
|
-
|
114
|
-
|
115
|
-
|
116
|
-
|
117
|
-
|
118
|
-
|
119
|
-
|
120
|
-
|
86
|
+
}, _callee2);
|
87
|
+
}))();
|
88
|
+
},
|
89
|
+
checkAuth: function checkAuth(name, rootState) {
|
90
|
+
return rootState.functionAuth.permissions[name];
|
91
|
+
},
|
92
|
+
refresh: function refresh() {
|
93
|
+
var _this2 = this;
|
94
|
+
|
95
|
+
return (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee3() {
|
96
|
+
return _regenerator["default"].wrap(function _callee3$(_context3) {
|
97
|
+
while (1) {
|
98
|
+
switch (_context3.prev = _context3.next) {
|
99
|
+
case 0:
|
100
|
+
_context3.next = 2;
|
101
|
+
return _this2.init();
|
102
|
+
|
103
|
+
case 2:
|
104
|
+
case "end":
|
105
|
+
return _context3.stop();
|
106
|
+
}
|
121
107
|
}
|
122
|
-
}
|
123
|
-
}
|
124
|
-
}
|
125
|
-
}
|
126
|
-
}
|
127
|
-
}
|
128
|
-
}
|
129
|
-
exports["default"] = _default;
|
108
|
+
}, _callee3);
|
109
|
+
}))();
|
110
|
+
}
|
111
|
+
};
|
112
|
+
}
|
113
|
+
};
|
114
|
+
}
|
package/package.json
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"name": "@riil-frontend/component-topology",
|
3
|
-
"version": "6.0.
|
3
|
+
"version": "6.0.12",
|
4
4
|
"description": "拓扑",
|
5
5
|
"scripts": {
|
6
6
|
"start": "build-scripts start",
|
@@ -116,6 +116,6 @@
|
|
116
116
|
"access": "public"
|
117
117
|
},
|
118
118
|
"license": "MIT",
|
119
|
-
"homepage": "https://unpkg.com/@riil-frontend/component-topology@6.0.
|
119
|
+
"homepage": "https://unpkg.com/@riil-frontend/component-topology@6.0.12/build/index.html",
|
120
120
|
"gitHead": "2da19ffccbb7ca60a8acf396e39f542c68bb33f5"
|
121
121
|
}
|