dlt-for-react 2.1.4 → 2.1.6
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/README.md +6 -2
- package/lib/components/KyECharts/index.js +30 -32
- package/lib/utils/common.js +21 -13
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -8,14 +8,18 @@ npm publish
|
|
|
8
8
|
|
|
9
9
|
## 前端 dlt-for-react 依赖包版本更新记录
|
|
10
10
|
|
|
11
|
-
##### 当前最新版本:2.1.3
|
|
12
|
-
|
|
13
11
|
##### 安装依赖
|
|
14
12
|
|
|
15
13
|
> npm install dlt-for-react --save
|
|
16
14
|
|
|
17
15
|
##### 版本修改记录
|
|
18
16
|
|
|
17
|
+
#### V2.1.6—2024 年 6 月 4 日
|
|
18
|
+
|
|
19
|
+
1. 更新echart版本
|
|
20
|
+
2. 去除echarts/map/js/china
|
|
21
|
+
3. 优化handleMenus方法
|
|
22
|
+
|
|
19
23
|
#### V2.1.0—2024 年 6 月 3 日
|
|
20
24
|
|
|
21
25
|
1. 新增 isEqual 函数
|
|
@@ -58,11 +58,24 @@ require('echarts/lib/component/polar');
|
|
|
58
58
|
|
|
59
59
|
require('echarts/lib/component/geo');
|
|
60
60
|
|
|
61
|
-
require('echarts/map/js/china');
|
|
62
|
-
|
|
63
61
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
64
62
|
|
|
65
|
-
|
|
63
|
+
//地理坐标系组件
|
|
64
|
+
// import 'echarts/lib/component/parallel';
|
|
65
|
+
// import 'echarts/lib/component/singleAxis';
|
|
66
|
+
// import 'echarts/lib/component/brush';
|
|
67
|
+
|
|
68
|
+
// import 'echarts/lib/component/dataZoom';
|
|
69
|
+
// import 'echarts/lib/component/visualMap';
|
|
70
|
+
|
|
71
|
+
// import 'echarts/lib/component/markPoint';
|
|
72
|
+
// import 'echarts/lib/component/markLine';
|
|
73
|
+
// import 'echarts/lib/component/markArea';
|
|
74
|
+
|
|
75
|
+
// import 'echarts/lib/component/timeline';
|
|
76
|
+
// import 'echarts/lib/component/toolbox'
|
|
77
|
+
|
|
78
|
+
// import 'echarts/map/js/china' //中国地图数据
|
|
66
79
|
|
|
67
80
|
// import 'echarts/lib/chart/heatmap';
|
|
68
81
|
|
|
@@ -71,7 +84,13 @@ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { de
|
|
|
71
84
|
//图例组件
|
|
72
85
|
//提示框组件
|
|
73
86
|
//标题组件
|
|
74
|
-
|
|
87
|
+
//曲线图
|
|
88
|
+
// import 'echarts/lib/chart/gauge';
|
|
89
|
+
// import 'echarts/lib/chart/funnel';
|
|
90
|
+
// import 'echarts/lib/chart/parallel';
|
|
91
|
+
// import 'echarts/lib/chart/sankey';
|
|
92
|
+
// import 'echarts/lib/chart/boxplot';
|
|
93
|
+
// import 'echarts/lib/chart/candlestick';
|
|
75
94
|
//echarts 基础配置,必须引入
|
|
76
95
|
/* 按需引入echarts */
|
|
77
96
|
//折线图
|
|
@@ -79,12 +98,6 @@ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { de
|
|
|
79
98
|
//饼图
|
|
80
99
|
//散点图
|
|
81
100
|
//雷达图
|
|
82
|
-
//地图
|
|
83
|
-
// import 'echarts/lib/chart/treemap';
|
|
84
|
-
/*******
|
|
85
|
-
* @description:科研-KyECharts 图表绘画
|
|
86
|
-
* @author: 琴时
|
|
87
|
-
*/
|
|
88
101
|
var KyECharts = function KyECharts(_ref) {
|
|
89
102
|
var className = _ref.className,
|
|
90
103
|
notMerge = _ref.notMerge,
|
|
@@ -98,28 +111,13 @@ var KyECharts = function KyECharts(_ref) {
|
|
|
98
111
|
notMerge: notMerge,
|
|
99
112
|
lazyUpdate: lazyUpdate
|
|
100
113
|
}, props));
|
|
101
|
-
};
|
|
102
|
-
|
|
103
|
-
// import 'echarts/lib/
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
// import 'echarts/lib/component/markPoint';
|
|
110
|
-
// import 'echarts/lib/component/markLine';
|
|
111
|
-
// import 'echarts/lib/component/markArea';
|
|
112
|
-
|
|
113
|
-
// import 'echarts/lib/component/timeline';
|
|
114
|
-
// import 'echarts/lib/component/toolbox'
|
|
115
|
-
|
|
116
|
-
//曲线图
|
|
117
|
-
// import 'echarts/lib/chart/gauge';
|
|
118
|
-
// import 'echarts/lib/chart/funnel';
|
|
119
|
-
// import 'echarts/lib/chart/parallel';
|
|
120
|
-
// import 'echarts/lib/chart/sankey';
|
|
121
|
-
// import 'echarts/lib/chart/boxplot';
|
|
122
|
-
// import 'echarts/lib/chart/candlestick';
|
|
114
|
+
}; //极坐标系组件
|
|
115
|
+
//地图
|
|
116
|
+
// import 'echarts/lib/chart/treemap';
|
|
117
|
+
/*******
|
|
118
|
+
* @description:科研-KyECharts 图表绘画
|
|
119
|
+
* @author: 琴时
|
|
120
|
+
*/
|
|
123
121
|
|
|
124
122
|
KyECharts.defaultProps = {
|
|
125
123
|
notMerge: true,
|
package/lib/utils/common.js
CHANGED
|
@@ -416,8 +416,8 @@ var deepCheckField = exports.deepCheckField = function deepCheckField(treeList,
|
|
|
416
416
|
return temp;
|
|
417
417
|
};
|
|
418
418
|
|
|
419
|
-
|
|
420
|
-
|
|
419
|
+
// 获取有权限的菜单
|
|
420
|
+
var handleMenus = exports.handleMenus = function handleMenus(allMenu, auths) {
|
|
421
421
|
var routes = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : [];
|
|
422
422
|
|
|
423
423
|
//过滤掉没有权限的菜单
|
|
@@ -442,7 +442,7 @@ var findAuth = exports.findAuth = function findAuth(routes, menu) {
|
|
|
442
442
|
return r.path == menu.url;
|
|
443
443
|
});
|
|
444
444
|
if (item && item.authority) {
|
|
445
|
-
authority = item.authority;
|
|
445
|
+
authority = item.authority || item.auth;
|
|
446
446
|
}
|
|
447
447
|
return authority;
|
|
448
448
|
};
|
|
@@ -467,25 +467,33 @@ var filterChildrenMenus = exports.filterChildrenMenus = function filterChildrenM
|
|
|
467
467
|
var filterAuthMenus = exports.filterAuthMenus = function filterAuthMenus(menus, auths, routes) {
|
|
468
468
|
var filterMenus = [];
|
|
469
469
|
menus.map(function (item) {
|
|
470
|
-
var authority = item.authority;
|
|
470
|
+
var authority = item.authority || item.auth;
|
|
471
|
+
if (item.url || item.path) {
|
|
472
|
+
item.url = item.url || item.path;
|
|
473
|
+
delete item.path;
|
|
474
|
+
}
|
|
475
|
+
if (item.children || item.routes) {
|
|
476
|
+
item.children = item.children || item.routes;
|
|
477
|
+
delete item.routes;
|
|
478
|
+
}
|
|
471
479
|
if (item.url && routes && routes.length > 0) {
|
|
472
480
|
authority = findAuth(routes, item);
|
|
473
481
|
}
|
|
474
|
-
if (
|
|
475
|
-
//存在子菜单,只需要处理子菜单即可
|
|
476
|
-
item.children = filterAuthMenus(item.children, auths, routes);
|
|
477
|
-
filterMenus.push(item);
|
|
478
|
-
} else if (authority) {
|
|
482
|
+
if (authority) {
|
|
479
483
|
//存在权限判断,此时需要判断用户是否有该权限
|
|
480
|
-
if (IsType('
|
|
481
|
-
if (auths
|
|
484
|
+
if (IsType('Object', auths)) {
|
|
485
|
+
if (auths[authority] !== undefined) {
|
|
482
486
|
filterMenus.push(item);
|
|
483
487
|
}
|
|
484
|
-
} else
|
|
485
|
-
if (auths
|
|
488
|
+
} else {
|
|
489
|
+
if (auths.includes(authority)) {
|
|
486
490
|
filterMenus.push(item);
|
|
487
491
|
}
|
|
488
492
|
}
|
|
493
|
+
} else if (item.children) {
|
|
494
|
+
//存在子菜单,只需要处理子菜单即可
|
|
495
|
+
item.children = filterAuthMenus(item.children, auths, routes);
|
|
496
|
+
filterMenus.push(item);
|
|
489
497
|
} else {
|
|
490
498
|
filterMenus.push(item);
|
|
491
499
|
}
|