wargerm 0.4.25 → 0.4.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.
- package/dist/components/LineEcharts/index.d.ts +15 -0
- package/dist/components/ReactECharts/RAF.d.ts +13 -0
- package/dist/components/ReactECharts/index.d.ts +16 -0
- package/dist/components/ReactECharts/theme.d.ts +138 -0
- package/dist/components/ReactECharts/useRAF.d.ts +4 -0
- package/dist/components/VideoPlayer/example/demo1.d.ts +3 -0
- package/dist/components/VideoPlayer/example/demo2.d.ts +3 -0
- package/dist/components/VideoPlayer/index.d.ts +1 -0
- package/dist/components/WForm/index.d.ts +1 -0
- package/dist/index.d.ts +1 -0
- package/dist/index.esm.js +644 -14
- package/dist/index.js +665 -13
- package/dist/utils/index.d.ts +2 -0
- package/package.json +88 -84
package/dist/index.js
CHANGED
@@ -56,9 +56,34 @@ var Player = require('xgplayer');
|
|
56
56
|
var FlvPlayer = require('xgplayer-flv.js');
|
57
57
|
var HlsJsPlayer = require('xgplayer-hls.js');
|
58
58
|
var lodash = require('lodash');
|
59
|
+
var ReactEChartsCore = require('echarts-for-react/lib/core');
|
60
|
+
var echarts = require('echarts/core');
|
61
|
+
var charts = require('echarts/charts');
|
62
|
+
var components = require('echarts/components');
|
63
|
+
var renderers = require('echarts/renderers');
|
59
64
|
|
60
65
|
function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
|
61
66
|
|
67
|
+
function _interopNamespace(e) {
|
68
|
+
if (e && e.__esModule) return e;
|
69
|
+
var n = Object.create(null);
|
70
|
+
if (e) {
|
71
|
+
Object.keys(e).forEach(function (k) {
|
72
|
+
if (k !== 'default') {
|
73
|
+
var d = Object.getOwnPropertyDescriptor(e, k);
|
74
|
+
Object.defineProperty(n, k, d.get ? d : {
|
75
|
+
enumerable: true,
|
76
|
+
get: function () {
|
77
|
+
return e[k];
|
78
|
+
}
|
79
|
+
});
|
80
|
+
}
|
81
|
+
});
|
82
|
+
}
|
83
|
+
n['default'] = e;
|
84
|
+
return Object.freeze(n);
|
85
|
+
}
|
86
|
+
|
62
87
|
var _Button__default = /*#__PURE__*/_interopDefaultLegacy(_Button);
|
63
88
|
var _Dropdown__default = /*#__PURE__*/_interopDefaultLegacy(_Dropdown);
|
64
89
|
var _Menu__default = /*#__PURE__*/_interopDefaultLegacy(_Menu);
|
@@ -90,6 +115,8 @@ var ProTable__default = /*#__PURE__*/_interopDefaultLegacy(ProTable);
|
|
90
115
|
var Player__default = /*#__PURE__*/_interopDefaultLegacy(Player);
|
91
116
|
var FlvPlayer__default = /*#__PURE__*/_interopDefaultLegacy(FlvPlayer);
|
92
117
|
var HlsJsPlayer__default = /*#__PURE__*/_interopDefaultLegacy(HlsJsPlayer);
|
118
|
+
var ReactEChartsCore__default = /*#__PURE__*/_interopDefaultLegacy(ReactEChartsCore);
|
119
|
+
var echarts__namespace = /*#__PURE__*/_interopNamespace(echarts);
|
93
120
|
|
94
121
|
function ownKeys(object, enumerableOnly) {
|
95
122
|
var keys = Object.keys(object);
|
@@ -578,8 +605,8 @@ Index$3.Group = _Checkbox__default['default'].Group;
|
|
578
605
|
/*
|
579
606
|
* @Author: lijin
|
580
607
|
* @Date: 2021-10-27 22:18:49
|
581
|
-
* @LastEditTime:
|
582
|
-
* @LastEditors:
|
608
|
+
* @LastEditTime: 2022-06-30 16:51:49
|
609
|
+
* @LastEditors: caldelle 793238465@qq.com
|
583
610
|
* @Description:
|
584
611
|
* @FilePath: \wargerm\src\utils\index.ts
|
585
612
|
* 可以输入预定的版权声明、个性签名、空行等
|
@@ -639,6 +666,12 @@ function getArrayLayer(arr, attr) {
|
|
639
666
|
|
640
667
|
return newIndex;
|
641
668
|
}
|
669
|
+
var calcWidth = function calcWidth(width) {
|
670
|
+
return document.body.clientWidth / 3840 * width;
|
671
|
+
};
|
672
|
+
var calcHeight = function calcHeight(height) {
|
673
|
+
return document.body.clientHeight / 2160 * height;
|
674
|
+
};
|
642
675
|
|
643
676
|
var _excluded$1 = ["className", "frameStyle", "style", "direction", "children"];
|
644
677
|
function FrameBox(_ref) {
|
@@ -6785,7 +6818,7 @@ var WCascader = function WCascader(props) {
|
|
6785
6818
|
}, extraProps));
|
6786
6819
|
};
|
6787
6820
|
|
6788
|
-
var _excluded$6 = ["columns", "extraColumns", "className", "style", "search", "disabled", "disabledHideInSearch", "disabledRuler", "onFormChange", "onSubmit", "onReset"];
|
6821
|
+
var _excluded$6 = ["columns", "extraColumns", "className", "style", "search", "disabled", "disabledHideInSearch", "disabledRuler", "onFormChange", "onSubmit", "onReset", "setForm"];
|
6789
6822
|
var RangePicker$2 = Index$5.RangePicker;
|
6790
6823
|
|
6791
6824
|
var WForm = function WForm(props, ref) {
|
@@ -6800,6 +6833,7 @@ var WForm = function WForm(props, ref) {
|
|
6800
6833
|
onFormChange = props.onFormChange,
|
6801
6834
|
onSubmit = props.onSubmit,
|
6802
6835
|
onReset = props.onReset,
|
6836
|
+
setForm = props.setForm,
|
6803
6837
|
extraProps = _objectWithoutProperties(props, _excluded$6);
|
6804
6838
|
|
6805
6839
|
var _Form$useForm = _Form__default['default'].useForm(),
|
@@ -7933,6 +7967,17 @@ var WForm = function WForm(props, ref) {
|
|
7933
7967
|
setFieldsValue: setFieldsValue
|
7934
7968
|
};
|
7935
7969
|
});
|
7970
|
+
React.useEffect(function () {
|
7971
|
+
if (form) {
|
7972
|
+
setForm && setForm(form);
|
7973
|
+
}
|
7974
|
+
|
7975
|
+
return function () {
|
7976
|
+
if (form) {
|
7977
|
+
setForm && setForm(null);
|
7978
|
+
}
|
7979
|
+
};
|
7980
|
+
}, []);
|
7936
7981
|
return /*#__PURE__*/React__default['default'].createElement(_Form__default['default'], _objectSpread2({
|
7937
7982
|
style: {
|
7938
7983
|
marginBottom: '20px',
|
@@ -11171,7 +11216,7 @@ function Xgplay(_ref, fRef) {
|
|
11171
11216
|
var playerRef = React.useRef(null);
|
11172
11217
|
React.useEffect(function () {
|
11173
11218
|
if (ref.current) {
|
11174
|
-
if ((type === null || type === void 0 ? void 0 : type.indexOf('
|
11219
|
+
if ((type === null || type === void 0 ? void 0 : type.indexOf('m3u8')) !== -1) {
|
11175
11220
|
playerRef.current = new HlsJsPlayer__default['default'](_objectSpread2({
|
11176
11221
|
el: ref.current,
|
11177
11222
|
width: '100%',
|
@@ -11188,7 +11233,19 @@ function Xgplay(_ref, fRef) {
|
|
11188
11233
|
height: '100%',
|
11189
11234
|
autoplay: true,
|
11190
11235
|
isLive: true,
|
11191
|
-
autoplayMuted: true
|
11236
|
+
autoplayMuted: true,
|
11237
|
+
flvOptionalConfig: {
|
11238
|
+
enableWorker: true,
|
11239
|
+
enableStashBuffer: false,
|
11240
|
+
stashInitialSize: 2048,
|
11241
|
+
lazyLoad: true,
|
11242
|
+
lazyLoadMaxDuration: 2 * 60,
|
11243
|
+
autoCleanupSourceBuffer: true,
|
11244
|
+
autoCleanupMaxBackwardDuration: 35 * 60,
|
11245
|
+
autoCleanupMinBackwardDuration: 30 * 60,
|
11246
|
+
reuseRedirectedURL: true //重用301/302重定向url,用于随后的请求,如查找、重新连接等
|
11247
|
+
|
11248
|
+
}
|
11192
11249
|
}, config));
|
11193
11250
|
setRef(playerRef.current);
|
11194
11251
|
} else if ((type === null || type === void 0 ? void 0 : type.indexOf('mp4')) !== -1) {
|
@@ -11258,8 +11315,10 @@ function VideoPlayer(_ref, ref) {
|
|
11258
11315
|
config = _ref$config === void 0 ? {} : _ref$config,
|
11259
11316
|
layoutIndex = _ref.layoutIndex,
|
11260
11317
|
_ref$url = _ref.url,
|
11261
|
-
url = _ref$url === void 0 ? [] : _ref$url
|
11262
|
-
|
11318
|
+
url = _ref$url === void 0 ? [] : _ref$url,
|
11319
|
+
_ref$layouts = _ref.layouts,
|
11320
|
+
layouts = _ref$layouts === void 0 ? [] : _ref$layouts;
|
11321
|
+
var basicLayouts = [{
|
11263
11322
|
title: '1x1布局',
|
11264
11323
|
style: {
|
11265
11324
|
gridTemplateColumns: '1fr',
|
@@ -11291,6 +11350,7 @@ function VideoPlayer(_ref, ref) {
|
|
11291
11350
|
}),
|
11292
11351
|
span: 9
|
11293
11352
|
}];
|
11353
|
+
var allLayouts = [].concat(_toConsumableArray(layouts), basicLayouts);
|
11294
11354
|
|
11295
11355
|
var _useState = React.useState(layoutIndex || 0),
|
11296
11356
|
_useState2 = _slicedToArray(_useState, 2),
|
@@ -11302,7 +11362,7 @@ function VideoPlayer(_ref, ref) {
|
|
11302
11362
|
urls = _useState4[0],
|
11303
11363
|
setUrls = _useState4[1];
|
11304
11364
|
|
11305
|
-
var initPlayerIndex =
|
11365
|
+
var initPlayerIndex = allLayouts[layoutIndex || 0].span >= url.length ? url.length - 1 >= 0 ? url.length - 1 : 0 : allLayouts[layoutIndex || 0].span - 1;
|
11306
11366
|
|
11307
11367
|
var _useState5 = React.useState(initPlayerIndex),
|
11308
11368
|
_useState6 = _slicedToArray(_useState5, 2),
|
@@ -11318,7 +11378,7 @@ function VideoPlayer(_ref, ref) {
|
|
11318
11378
|
setPlayers = _useState8[1];
|
11319
11379
|
|
11320
11380
|
var renderDom = React.useMemo(function () {
|
11321
|
-
var arr = new Array(
|
11381
|
+
var arr = new Array(allLayouts[currentLayoutIndex].span).fill(0);
|
11322
11382
|
return arr.map(function (item, index) {
|
11323
11383
|
return /*#__PURE__*/React__default['default'].createElement("div", {
|
11324
11384
|
key: index,
|
@@ -11399,22 +11459,24 @@ function VideoPlayer(_ref, ref) {
|
|
11399
11459
|
}, /*#__PURE__*/React__default['default'].createElement("div", {
|
11400
11460
|
ref: domRef,
|
11401
11461
|
className: "videoContainer-grid",
|
11402
|
-
style:
|
11462
|
+
style: allLayouts[currentLayoutIndex].style
|
11403
11463
|
}, renderDom), footer ? /*#__PURE__*/React__default['default'].createElement("div", {
|
11404
11464
|
className: "tools"
|
11405
|
-
},
|
11465
|
+
}, allLayouts.map(function (item, index) {
|
11406
11466
|
return /*#__PURE__*/React__default['default'].createElement("div", {
|
11407
11467
|
key: index,
|
11408
11468
|
className: "btnbox",
|
11409
11469
|
onClick: function onClick() {
|
11410
|
-
var playerIndex =
|
11470
|
+
var playerIndex = allLayouts[index || 0].span > url.length ? url.length - 1 >= 0 ? url.length : 0 : allLayouts[index || 0].span - 1;
|
11411
11471
|
setCurrentPlayerIndex(playerIndex);
|
11412
11472
|
setCurrentLayoutIndex(index);
|
11413
11473
|
}
|
11414
11474
|
}, /*#__PURE__*/React__default['default'].createElement(_Tooltip__default['default'], {
|
11415
11475
|
placement: "top",
|
11416
11476
|
title: item.title
|
11417
|
-
}, item.icon
|
11477
|
+
}, item.icon || /*#__PURE__*/React__default['default'].createElement(IconFont, {
|
11478
|
+
type: "icon-dantupailie"
|
11479
|
+
})));
|
11418
11480
|
})) : null));
|
11419
11481
|
}
|
11420
11482
|
|
@@ -11650,6 +11712,595 @@ var index$4 = (function (_ref) {
|
|
11650
11712
|
});
|
11651
11713
|
});
|
11652
11714
|
|
11715
|
+
/*
|
11716
|
+
* @Author: lijin
|
11717
|
+
* @Date: 2021-08-04 13:22:21
|
11718
|
+
* @LastEditTime: 2021-08-04 13:25:19
|
11719
|
+
* @LastEditors: lijin
|
11720
|
+
* @Description:
|
11721
|
+
* @FilePath: \big-screen\src\components\ReactECharts\theme.ts
|
11722
|
+
* 可以输入预定的版权声明、个性签名、空行等
|
11723
|
+
*/
|
11724
|
+
var contrastColor = '#9EA1A7';
|
11725
|
+
var backgroundColor = 'transparent';
|
11726
|
+
|
11727
|
+
var axisCommon = function axisCommon() {
|
11728
|
+
return {
|
11729
|
+
axisLine: {
|
11730
|
+
lineStyle: {
|
11731
|
+
color: contrastColor
|
11732
|
+
}
|
11733
|
+
},
|
11734
|
+
splitLine: {
|
11735
|
+
lineStyle: {
|
11736
|
+
color: '#2c3641'
|
11737
|
+
}
|
11738
|
+
},
|
11739
|
+
splitArea: {
|
11740
|
+
areaStyle: {
|
11741
|
+
color: ['rgba(255,255,255,0.02)', 'rgba(255,255,255,0.05)']
|
11742
|
+
}
|
11743
|
+
},
|
11744
|
+
minorSplitLine: {
|
11745
|
+
lineStyle: {
|
11746
|
+
color: '#20203B'
|
11747
|
+
}
|
11748
|
+
}
|
11749
|
+
};
|
11750
|
+
};
|
11751
|
+
|
11752
|
+
var colorPalette = ['#4992ff', '#7cffb2', '#fddd60', '#ff6e76', '#58d9f9', '#05c091', '#ff8a45', '#8d48e3', '#dd79ff'];
|
11753
|
+
var theme = {
|
11754
|
+
darkMode: true,
|
11755
|
+
color: colorPalette,
|
11756
|
+
backgroundColor: backgroundColor,
|
11757
|
+
axisPointer: {
|
11758
|
+
lineStyle: {
|
11759
|
+
color: '#817f91'
|
11760
|
+
},
|
11761
|
+
crossStyle: {
|
11762
|
+
color: '#817f91'
|
11763
|
+
},
|
11764
|
+
label: {
|
11765
|
+
color: contrastColor,
|
11766
|
+
backgroundColor: '#104873'
|
11767
|
+
}
|
11768
|
+
},
|
11769
|
+
legend: {
|
11770
|
+
textStyle: {
|
11771
|
+
color: contrastColor
|
11772
|
+
}
|
11773
|
+
},
|
11774
|
+
textStyle: {
|
11775
|
+
color: contrastColor
|
11776
|
+
},
|
11777
|
+
title: {
|
11778
|
+
textStyle: {
|
11779
|
+
color: '#EEF1FA'
|
11780
|
+
},
|
11781
|
+
subtextStyle: {
|
11782
|
+
color: '#B9B8CE'
|
11783
|
+
}
|
11784
|
+
},
|
11785
|
+
toolbox: {
|
11786
|
+
iconStyle: {
|
11787
|
+
borderColor: contrastColor
|
11788
|
+
}
|
11789
|
+
},
|
11790
|
+
dataZoom: {
|
11791
|
+
borderColor: '#71708A',
|
11792
|
+
textStyle: {
|
11793
|
+
color: contrastColor
|
11794
|
+
},
|
11795
|
+
brushStyle: {
|
11796
|
+
color: 'rgba(135,163,206,0.3)'
|
11797
|
+
},
|
11798
|
+
handleStyle: {
|
11799
|
+
color: '#353450',
|
11800
|
+
borderColor: '#C5CBE3'
|
11801
|
+
},
|
11802
|
+
moveHandleStyle: {
|
11803
|
+
color: '#B0B6C3',
|
11804
|
+
opacity: 0.3
|
11805
|
+
},
|
11806
|
+
fillerColor: 'rgba(135,163,206,0.2)',
|
11807
|
+
emphasis: {
|
11808
|
+
handleStyle: {
|
11809
|
+
borderColor: '#91B7F2',
|
11810
|
+
color: '#4D587D'
|
11811
|
+
},
|
11812
|
+
moveHandleStyle: {
|
11813
|
+
color: '#636D9A',
|
11814
|
+
opacity: 0.7
|
11815
|
+
}
|
11816
|
+
},
|
11817
|
+
dataBackground: {
|
11818
|
+
lineStyle: {
|
11819
|
+
color: '#71708A',
|
11820
|
+
width: 1
|
11821
|
+
},
|
11822
|
+
areaStyle: {
|
11823
|
+
color: '#71708A'
|
11824
|
+
}
|
11825
|
+
},
|
11826
|
+
selectedDataBackground: {
|
11827
|
+
lineStyle: {
|
11828
|
+
color: '#87A3CE'
|
11829
|
+
},
|
11830
|
+
areaStyle: {
|
11831
|
+
color: '#87A3CE'
|
11832
|
+
}
|
11833
|
+
}
|
11834
|
+
},
|
11835
|
+
visualMap: {
|
11836
|
+
textStyle: {
|
11837
|
+
color: contrastColor
|
11838
|
+
}
|
11839
|
+
},
|
11840
|
+
timeline: {
|
11841
|
+
lineStyle: {
|
11842
|
+
color: contrastColor
|
11843
|
+
},
|
11844
|
+
label: {
|
11845
|
+
color: contrastColor
|
11846
|
+
},
|
11847
|
+
controlStyle: {
|
11848
|
+
color: contrastColor,
|
11849
|
+
borderColor: contrastColor
|
11850
|
+
}
|
11851
|
+
},
|
11852
|
+
calendar: {
|
11853
|
+
itemStyle: {
|
11854
|
+
color: backgroundColor
|
11855
|
+
},
|
11856
|
+
dayLabel: {
|
11857
|
+
color: contrastColor
|
11858
|
+
},
|
11859
|
+
monthLabel: {
|
11860
|
+
color: contrastColor
|
11861
|
+
},
|
11862
|
+
yearLabel: {
|
11863
|
+
color: contrastColor
|
11864
|
+
}
|
11865
|
+
},
|
11866
|
+
timeAxis: axisCommon(),
|
11867
|
+
logAxis: axisCommon(),
|
11868
|
+
valueAxis: axisCommon(),
|
11869
|
+
categoryAxis: axisCommon(),
|
11870
|
+
line: {
|
11871
|
+
symbol: 'circle'
|
11872
|
+
},
|
11873
|
+
graph: {
|
11874
|
+
color: colorPalette
|
11875
|
+
},
|
11876
|
+
gauge: {
|
11877
|
+
title: {
|
11878
|
+
color: contrastColor
|
11879
|
+
}
|
11880
|
+
},
|
11881
|
+
candlestick: {
|
11882
|
+
itemStyle: {
|
11883
|
+
color: '#FD1050',
|
11884
|
+
color0: '#0CF49B',
|
11885
|
+
borderColor: '#FD1050',
|
11886
|
+
borderColor0: '#0CF49B'
|
11887
|
+
}
|
11888
|
+
}
|
11889
|
+
};
|
11890
|
+
theme.categoryAxis.splitLine.show = false;
|
11891
|
+
|
11892
|
+
var RAF = /*#__PURE__*/function () {
|
11893
|
+
function RAF() {
|
11894
|
+
_classCallCheck(this, RAF);
|
11895
|
+
|
11896
|
+
this._timerIdMap = void 0;
|
11897
|
+
this._timerIdMap = {
|
11898
|
+
timeout: {},
|
11899
|
+
interval: {}
|
11900
|
+
};
|
11901
|
+
}
|
11902
|
+
|
11903
|
+
_createClass(RAF, [{
|
11904
|
+
key: "run",
|
11905
|
+
value: function run() {
|
11906
|
+
var _this = this;
|
11907
|
+
|
11908
|
+
var type = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 'interval';
|
11909
|
+
var cb = arguments.length > 1 ? arguments[1] : undefined;
|
11910
|
+
var interval = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 16.7;
|
11911
|
+
// 每16.7毫秒刷新一次(一帧)
|
11912
|
+
var now = Date.now;
|
11913
|
+
var startTime = now();
|
11914
|
+
var endTime = startTime;
|
11915
|
+
var timerSymbol = Symbol();
|
11916
|
+
|
11917
|
+
var loop = function loop() {
|
11918
|
+
_this.setIdMap(timerSymbol, type, loop);
|
11919
|
+
|
11920
|
+
endTime = now();
|
11921
|
+
|
11922
|
+
if (endTime - startTime >= interval) {
|
11923
|
+
if (type === 'interval') {
|
11924
|
+
startTime = now();
|
11925
|
+
endTime = startTime;
|
11926
|
+
}
|
11927
|
+
|
11928
|
+
cb();
|
11929
|
+
type === 'timeout' && _this.clearTimeout(timerSymbol);
|
11930
|
+
}
|
11931
|
+
};
|
11932
|
+
|
11933
|
+
this.setIdMap(timerSymbol, type, loop);
|
11934
|
+
return timerSymbol;
|
11935
|
+
}
|
11936
|
+
}, {
|
11937
|
+
key: "setIdMap",
|
11938
|
+
value: function setIdMap(timerSymbol, type, loop) {
|
11939
|
+
var id = requestAnimationFrame(loop);
|
11940
|
+
this._timerIdMap[type][timerSymbol] = id;
|
11941
|
+
}
|
11942
|
+
}, {
|
11943
|
+
key: "setTimeout",
|
11944
|
+
value: function setTimeout(cb, interval) {
|
11945
|
+
return this.run('timeout', cb, interval);
|
11946
|
+
}
|
11947
|
+
}, {
|
11948
|
+
key: "clearTimeout",
|
11949
|
+
value: function clearTimeout(timer) {
|
11950
|
+
cancelAnimationFrame(this._timerIdMap.timeout[timer]);
|
11951
|
+
}
|
11952
|
+
}, {
|
11953
|
+
key: "setInterval",
|
11954
|
+
value: function setInterval(cb, interval) {
|
11955
|
+
return this.run('interval', cb, interval);
|
11956
|
+
}
|
11957
|
+
}, {
|
11958
|
+
key: "clearInterval",
|
11959
|
+
value: function clearInterval(timer) {
|
11960
|
+
cancelAnimationFrame(this._timerIdMap.interval[timer]);
|
11961
|
+
}
|
11962
|
+
}]);
|
11963
|
+
|
11964
|
+
return RAF;
|
11965
|
+
}();
|
11966
|
+
|
11967
|
+
/*
|
11968
|
+
* @Author: lijin
|
11969
|
+
* @Date: 2022-06-20 15:27:46
|
11970
|
+
* @LastEditTime: 2022-06-30 17:32:49
|
11971
|
+
* @LastEditors: caldelle 793238465@qq.com
|
11972
|
+
* @Description:
|
11973
|
+
* @FilePath: \hefeihz-web-bigscreen\src\hooks\useRAF.ts
|
11974
|
+
* 可以输入预定的版权声明、个性签名、空行等
|
11975
|
+
*/
|
11976
|
+
function useRAF() {
|
11977
|
+
var raf = React.useMemo(function () {
|
11978
|
+
return new RAF();
|
11979
|
+
}, []);
|
11980
|
+
return {
|
11981
|
+
raf: raf
|
11982
|
+
};
|
11983
|
+
}
|
11984
|
+
|
11985
|
+
echarts.use([components.TitleComponent, components.TooltipComponent, components.GridComponent, charts.BarChart, renderers.CanvasRenderer, charts.LineChart, charts.PieChart, charts.RadarChart, components.LegendComponent, components.LegendPlainComponent, components.MarkLineComponent, charts.PictorialBarChart, charts.CustomChart, components.LegendScrollComponent, components.PolarComponent, components.GraphicComponent, components.ToolboxComponent]);
|
11986
|
+
echarts.registerTheme('my_theme', theme); // The usage of ReactEChartsCore are same with above.
|
11987
|
+
|
11988
|
+
var ReactECharts = /*#__PURE__*/React__default['default'].memo(function (_ref) {
|
11989
|
+
var _option$highlightData, _option$highlightData2, _option$highlightData3;
|
11990
|
+
|
11991
|
+
var option = _ref.option,
|
11992
|
+
_ref$onChartReady = _ref.onChartReady,
|
11993
|
+
onChartReady = _ref$onChartReady === void 0 ? function () {} : _ref$onChartReady,
|
11994
|
+
_ref$EventsDict = _ref.EventsDict,
|
11995
|
+
EventsDict = _ref$EventsDict === void 0 ? {} : _ref$EventsDict,
|
11996
|
+
_ref$style = _ref.style,
|
11997
|
+
style = _ref$style === void 0 ? {} : _ref$style,
|
11998
|
+
ref = _ref.ref,
|
11999
|
+
_ref$autoLoop = _ref.autoLoop,
|
12000
|
+
autoLoop = _ref$autoLoop === void 0 ? true : _ref$autoLoop,
|
12001
|
+
_ref$duration = _ref.duration,
|
12002
|
+
duration = _ref$duration === void 0 ? 2000 : _ref$duration,
|
12003
|
+
_ref$seriesIndex = _ref.seriesIndex,
|
12004
|
+
seriesIndex = _ref$seriesIndex === void 0 ? 0 : _ref$seriesIndex,
|
12005
|
+
opts = _ref.opts,
|
12006
|
+
otherProps = _ref.otherProps;
|
12007
|
+
|
12008
|
+
var _useRAF = useRAF(),
|
12009
|
+
raf = _useRAF.raf;
|
12010
|
+
|
12011
|
+
var _useState = React.useState(-1),
|
12012
|
+
_useState2 = _slicedToArray(_useState, 2),
|
12013
|
+
currentIndex = _useState2[0],
|
12014
|
+
setCurrentIndex = _useState2[1];
|
12015
|
+
|
12016
|
+
var instance = React.useRef(null);
|
12017
|
+
var timer = React.useRef(null);
|
12018
|
+
var timeoutTimer = React.useRef(null);
|
12019
|
+
|
12020
|
+
var _useState3 = React.useState(false),
|
12021
|
+
_useState4 = _slicedToArray(_useState3, 2),
|
12022
|
+
Flag = _useState4[0],
|
12023
|
+
setFlag = _useState4[1];
|
12024
|
+
|
12025
|
+
var length = (_option$highlightData = option === null || option === void 0 ? void 0 : (_option$highlightData2 = option.highlightData) === null || _option$highlightData2 === void 0 ? void 0 : _option$highlightData2.length) !== null && _option$highlightData !== void 0 ? _option$highlightData : 0;
|
12026
|
+
var current = option === null || option === void 0 ? void 0 : (_option$highlightData3 = option.highlightData) === null || _option$highlightData3 === void 0 ? void 0 : _option$highlightData3[currentIndex];
|
12027
|
+
var currentName = typeof current === 'string' ? current : current === null || current === void 0 ? void 0 : current.name;
|
12028
|
+
React.useEffect(function () {
|
12029
|
+
if (autoLoop && length > 1) {
|
12030
|
+
timer.current = raf.setInterval(function () {
|
12031
|
+
setCurrentIndex(function (index) {
|
12032
|
+
return index >= length - 1 ? 0 : index + 1;
|
12033
|
+
});
|
12034
|
+
}, duration);
|
12035
|
+
} else {
|
12036
|
+
setCurrentIndex(-1);
|
12037
|
+
timer.current && raf.clearInterval(timer.current);
|
12038
|
+
}
|
12039
|
+
|
12040
|
+
return function () {
|
12041
|
+
timer.current && raf.clearInterval(timer.current);
|
12042
|
+
};
|
12043
|
+
}, [autoLoop, duration, raf, length]);
|
12044
|
+
React.useEffect(function () {
|
12045
|
+
if (!instance.current) {
|
12046
|
+
return;
|
12047
|
+
}
|
12048
|
+
|
12049
|
+
instance.current.dispatchAction({
|
12050
|
+
type: 'downplay'
|
12051
|
+
});
|
12052
|
+
instance.current.dispatchAction({
|
12053
|
+
type: 'hideTip'
|
12054
|
+
});
|
12055
|
+
|
12056
|
+
if (currentIndex > -1) {
|
12057
|
+
instance.current.dispatchAction({
|
12058
|
+
type: 'showTip',
|
12059
|
+
seriesIndex: seriesIndex,
|
12060
|
+
dataIndex: currentIndex
|
12061
|
+
});
|
12062
|
+
currentName && instance.current.dispatchAction({
|
12063
|
+
type: 'highlight',
|
12064
|
+
name: currentName
|
12065
|
+
});
|
12066
|
+
}
|
12067
|
+
}, [currentIndex, instance, seriesIndex, currentName]);
|
12068
|
+
|
12069
|
+
var onChartReadyCallback = function onChartReadyCallback(chart) {
|
12070
|
+
instance.current = chart;
|
12071
|
+
onChartReady(chart, option);
|
12072
|
+
timeoutTimer.current = raf.setTimeout(function () {
|
12073
|
+
instance.current.resize();
|
12074
|
+
}, 20);
|
12075
|
+
};
|
12076
|
+
|
12077
|
+
React.useEffect(function () {
|
12078
|
+
filter(option);
|
12079
|
+
}, [option]);
|
12080
|
+
|
12081
|
+
var filter = function filter(option) {
|
12082
|
+
var _option$series;
|
12083
|
+
|
12084
|
+
var flag = option === null || option === void 0 ? void 0 : (_option$series = option.series) === null || _option$series === void 0 ? void 0 : _option$series.every(function (item) {
|
12085
|
+
return !item.data || item.data.length == 0;
|
12086
|
+
});
|
12087
|
+
setFlag(flag);
|
12088
|
+
return option;
|
12089
|
+
};
|
12090
|
+
|
12091
|
+
React.useEffect(function () {
|
12092
|
+
var resizeHandler = function resizeHandler() {
|
12093
|
+
if (instance.current) {
|
12094
|
+
instance.current.resize();
|
12095
|
+
}
|
12096
|
+
};
|
12097
|
+
|
12098
|
+
window.addEventListener('resize', resizeHandler);
|
12099
|
+
return function () {
|
12100
|
+
timeoutTimer.current && raf.clearTimeout(timeoutTimer.current);
|
12101
|
+
window.removeEventListener('resize', resizeHandler);
|
12102
|
+
};
|
12103
|
+
}, []);
|
12104
|
+
return /*#__PURE__*/React__default['default'].createElement(React__default['default'].Fragment, null, /*#__PURE__*/React__default['default'].createElement(ReactEChartsCore__default['default'], _objectSpread2({
|
12105
|
+
ref: ref,
|
12106
|
+
echarts: echarts__namespace,
|
12107
|
+
option: option,
|
12108
|
+
notMerge: true,
|
12109
|
+
lazyUpdate: true,
|
12110
|
+
style: style,
|
12111
|
+
theme: 'my_theme',
|
12112
|
+
onChartReady: onChartReadyCallback,
|
12113
|
+
onEvents: EventsDict,
|
12114
|
+
opts: opts || {}
|
12115
|
+
}, otherProps)));
|
12116
|
+
});
|
12117
|
+
|
12118
|
+
var lineOption = function lineOption(_ref) {
|
12119
|
+
var list = _ref.list,
|
12120
|
+
xdata = _ref.xdata;
|
12121
|
+
return {
|
12122
|
+
grid: {
|
12123
|
+
top: '18%',
|
12124
|
+
bottom: 1,
|
12125
|
+
left: 20,
|
12126
|
+
right: 20,
|
12127
|
+
containLabel: true
|
12128
|
+
},
|
12129
|
+
tooltip: {
|
12130
|
+
trigger: 'axis',
|
12131
|
+
backgroundColor: '#012536',
|
12132
|
+
borderColor: 'rgba(81,190,246,1)',
|
12133
|
+
textStyle: {
|
12134
|
+
color: '#daeef7',
|
12135
|
+
fontSize: calcWidth(24)
|
12136
|
+
},
|
12137
|
+
position: function position(point, params, dom, rect, size) {
|
12138
|
+
// 其中point为当前鼠标的位置,size中有两个属性:viewSize和contentSize,分别为外层div和tooltip提示框的大小
|
12139
|
+
var x = point[0]; //
|
12140
|
+
|
12141
|
+
var y = point[1];
|
12142
|
+
var viewWidth = size.viewSize[0];
|
12143
|
+
var viewHeight = size.viewSize[1];
|
12144
|
+
var boxWidth = size.contentSize[0];
|
12145
|
+
var boxHeight = size.contentSize[1];
|
12146
|
+
var posX = 0; // x坐标位置
|
12147
|
+
|
12148
|
+
var posY = 0; // y坐标位置
|
12149
|
+
|
12150
|
+
if (x < boxWidth) {
|
12151
|
+
// 左边放不开
|
12152
|
+
posX = 5;
|
12153
|
+
} else {
|
12154
|
+
// 左边放的下
|
12155
|
+
posX = x - boxWidth;
|
12156
|
+
}
|
12157
|
+
|
12158
|
+
if (y < boxHeight) {
|
12159
|
+
// 上边放不开
|
12160
|
+
posY = 5;
|
12161
|
+
} else {
|
12162
|
+
// 上边放得下
|
12163
|
+
posY = y - boxHeight;
|
12164
|
+
}
|
12165
|
+
|
12166
|
+
return [posX, posY];
|
12167
|
+
},
|
12168
|
+
axisPointer: {
|
12169
|
+
lineStyle: {
|
12170
|
+
color: {
|
12171
|
+
type: 'linear',
|
12172
|
+
x: 0,
|
12173
|
+
y: 0,
|
12174
|
+
x2: 0,
|
12175
|
+
y2: 1,
|
12176
|
+
colorStops: [{
|
12177
|
+
offset: 0,
|
12178
|
+
color: 'rgba(255,255,255,0)' // 0% 处的颜色
|
12179
|
+
|
12180
|
+
}, {
|
12181
|
+
offset: 0.5,
|
12182
|
+
color: 'rgba(255,255,255,1)' // 100% 处的颜色
|
12183
|
+
|
12184
|
+
}, {
|
12185
|
+
offset: 1,
|
12186
|
+
color: 'rgba(255,255,255,0)' // 100% 处的颜色
|
12187
|
+
|
12188
|
+
}],
|
12189
|
+
global: false // 缺省为 false
|
12190
|
+
|
12191
|
+
}
|
12192
|
+
}
|
12193
|
+
},
|
12194
|
+
formatter: function formatter(params) {
|
12195
|
+
if (params.length == 0) {
|
12196
|
+
return null;
|
12197
|
+
}
|
12198
|
+
|
12199
|
+
var dom = '';
|
12200
|
+
params.map(function (item) {
|
12201
|
+
dom = dom + " <div><?xml version=\"1.0\" standalone=\"no\"?><!DOCTYPE svg PUBLIC \"-//W3C//DTD SVG 1.1//EN\" \"http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd\">\n <svg t=\"1655805829921\" class=\"icon\" viewBox=\"0 0 1024 1024\" fill=\"".concat(item.color, "\"; version=\"1.1\" xmlns=\"http://www.w3.org/2000/svg\" p-id=\"5439\" xmlns:xlink=\"http://www.w3.org/1999/xlink\" width=\"").concat(calcWidth(20), "px\" height=\"").concat(calcHeight(20), "px\" style=\"margin-right:").concat(calcWidth(10), "px\">\n <defs><style type=\"text/css\">@font-face { font-family: feedback-iconfont; src: url(\"//at.alicdn.com/t/font_1031158_u69w8yhxdu.woff2?t=1630033759944\") format(\"woff2\"), url(\"//at.alicdn.com/t/font_1031158_u69w8yhxdu.woff?t=1630033759944\") format(\"woff\"), url(\"//at.alicdn.com/t/font_1031158_u69w8yhxdu.ttf?t=1630033759944\") format(\"truetype\"); }\n </style></defs><path d=\"M512 512m-256 0a256 256 0 1 0 512 0 256 256 0 1 0-512 0Z\" p-id=\"5440\"></path><path d=\"M512 20.48C239.616 20.48 20.48 239.616 20.48 512s219.136 491.52 491.52 491.52 491.52-219.136 491.52-491.52S784.384 20.48 512 20.48z m0 899.072C286.72 919.552 104.448 737.28 104.448 512 104.448 286.72 286.72 104.448 512 104.448 737.28 104.448 919.552 286.72 919.552 512c0 225.28-182.272 407.552-407.552 407.552z\" p-id=\"5441\"></path></svg>").concat(item.seriesName, " : ").concat(item.value, "</div>");
|
12202
|
+
});
|
12203
|
+
return dom;
|
12204
|
+
}
|
12205
|
+
},
|
12206
|
+
legend: {
|
12207
|
+
top: 0,
|
12208
|
+
itemGap: calcWidth(20),
|
12209
|
+
show: true,
|
12210
|
+
textStyle: {
|
12211
|
+
fontSize: calcWidth(24),
|
12212
|
+
color: '#ccf8fb',
|
12213
|
+
lineHeight: calcHeight(20)
|
12214
|
+
},
|
12215
|
+
data: list === null || list === void 0 ? void 0 : list.map(function (item) {
|
12216
|
+
return {
|
12217
|
+
name: item.name,
|
12218
|
+
icon: "path://M512 512m-256 0a256 256 0 1 0 512 0 256 256 0 1 0-512 0Z,M512 20.48C239.616 20.48 20.48 239.616 20.48 512s219.136 491.52 491.52 491.52 491.52-219.136 491.52-491.52S784.384 20.48 512 20.48z m0 899.072C286.72 919.552 104.448 737.28 104.448 512 104.448 286.72 286.72 104.448 512 104.448 737.28 104.448 919.552 286.72 919.552 512c0 225.28-182.272 407.552-407.552 407.552z"
|
12219
|
+
};
|
12220
|
+
}),
|
12221
|
+
itemWidth: calcWidth(20),
|
12222
|
+
itemHeight: calcHeight(20)
|
12223
|
+
},
|
12224
|
+
xAxis: [{
|
12225
|
+
type: 'category',
|
12226
|
+
axisLabel: {
|
12227
|
+
formatter: '{value}',
|
12228
|
+
// interval: 0,
|
12229
|
+
fontSize: calcWidth(24),
|
12230
|
+
color: '#ccf8fb',
|
12231
|
+
margin: 20
|
12232
|
+
},
|
12233
|
+
axisLine: {
|
12234
|
+
lineStyle: {
|
12235
|
+
color: '#2c3641'
|
12236
|
+
}
|
12237
|
+
},
|
12238
|
+
splitLine: {
|
12239
|
+
show: false,
|
12240
|
+
lineStyle: {
|
12241
|
+
color: '#2c3641'
|
12242
|
+
}
|
12243
|
+
},
|
12244
|
+
axisTick: {
|
12245
|
+
show: false
|
12246
|
+
},
|
12247
|
+
data: xdata
|
12248
|
+
}],
|
12249
|
+
yAxis: [{
|
12250
|
+
type: 'value',
|
12251
|
+
splitLine: {
|
12252
|
+
lineStyle: {
|
12253
|
+
color: '#2c3641'
|
12254
|
+
}
|
12255
|
+
},
|
12256
|
+
axisLabel: {
|
12257
|
+
fontSize: calcWidth(24),
|
12258
|
+
color: '#ccf8fb',
|
12259
|
+
margin: 20
|
12260
|
+
},
|
12261
|
+
axisLine: {
|
12262
|
+
show: true,
|
12263
|
+
lineStyle: {
|
12264
|
+
color: '#2c3641'
|
12265
|
+
}
|
12266
|
+
},
|
12267
|
+
axisTick: {
|
12268
|
+
show: false
|
12269
|
+
}
|
12270
|
+
}],
|
12271
|
+
series: list === null || list === void 0 ? void 0 : list.map(function (item) {
|
12272
|
+
return {
|
12273
|
+
name: item.name,
|
12274
|
+
type: 'line',
|
12275
|
+
sampling: 'lttb',
|
12276
|
+
symbolSize: 8,
|
12277
|
+
itemStyle: {
|
12278
|
+
color: item.color
|
12279
|
+
},
|
12280
|
+
zlevel: 3,
|
12281
|
+
lineStyle: {
|
12282
|
+
normal: {
|
12283
|
+
width: calcWidth(2),
|
12284
|
+
color: item.color
|
12285
|
+
}
|
12286
|
+
},
|
12287
|
+
data: item.data
|
12288
|
+
};
|
12289
|
+
})
|
12290
|
+
};
|
12291
|
+
};
|
12292
|
+
|
12293
|
+
function LineEcharts(_ref2) {
|
12294
|
+
var config = _ref2.config;
|
12295
|
+
console.log(config);
|
12296
|
+
return /*#__PURE__*/React__default['default'].createElement(ReactECharts, {
|
12297
|
+
option: lineOption(config),
|
12298
|
+
style: {
|
12299
|
+
height: '100%'
|
12300
|
+
}
|
12301
|
+
});
|
12302
|
+
}
|
12303
|
+
|
11653
12304
|
exports.AutoScroll = Index$9;
|
11654
12305
|
exports.Breadcrumb = Index$b;
|
11655
12306
|
exports.Button = WButton;
|
@@ -11661,6 +12312,7 @@ exports.DatePicker = Index$1;
|
|
11661
12312
|
exports.IconFont = index;
|
11662
12313
|
exports.Input = Index;
|
11663
12314
|
exports.InputNumber = WInputNumber;
|
12315
|
+
exports.LineEcharts = LineEcharts;
|
11664
12316
|
exports.Modal = Modal;
|
11665
12317
|
exports.ModalForm = ModalForm$1;
|
11666
12318
|
exports.ModalTips = Modal$1;
|