12345678910111213141516171819202122 |
- var tools = {
- changeMap: function (arr, k, name) {
- var data = arr.map(function (items) {
- if (items[name] && items[name].length) {
- items[name].map(function (children) {
- if (Array.isArray(children)) {
- return children.map(function (res) {
- res.Y = res.Y * k;
- return res;
- });
- }
- else {
- children.Y = children.Y * k;
- return children;
- }
- });
- }
- });
- return data;
- }
- };
- export default tools;
|