@aks-dev/easyui 1.0.194 → 1.0.196

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 (86) hide show
  1. package/dist/components/AnimationModal/AnimationModal.js +15 -36
  2. package/dist/components/Badge/Badge.js +7 -16
  3. package/dist/components/DottedLine/DottedLine.js +14 -13
  4. package/dist/components/Echarts/EchartsView.js +30 -73
  5. package/dist/components/Echarts/demo.js +201 -0
  6. package/dist/components/Echarts/helper.js +1 -16
  7. package/dist/components/Hud/AlertBottomView/AlertBottomView.js +43 -60
  8. package/dist/components/Hud/AlertSheetView/AlertSheetView.js +23 -30
  9. package/dist/components/Hud/AlertView/AlertView.js +46 -62
  10. package/dist/components/Hud/Hud.js +8 -19
  11. package/dist/components/Hud/Loading/Loading.js +4 -16
  12. package/dist/components/Hud/PopoverView/PopoverView.js +2 -13
  13. package/dist/components/Hud/Scanner/Scanner.js +55 -86
  14. package/dist/components/Hud/Toast/Toast.js +5 -15
  15. package/dist/components/MenuView/MenuView.js +33 -61
  16. package/dist/components/Modal/Modal.js +0 -7
  17. package/dist/components/MutiPictureView/MutiPictureView.js +27 -47
  18. package/dist/components/PictureViewer/PictureViewer.js +8 -24
  19. package/dist/components/RefreshList/RefreshList.js +41 -52
  20. package/dist/components/RefreshList/demo.js +9 -0
  21. package/dist/components/RefreshList/demo1.js +27 -0
  22. package/dist/components/RefreshList/demo2.js +9 -0
  23. package/dist/components/RichText/RichText.js +21 -22
  24. package/dist/components/StickHeaderView/StickHeaderView.js +2 -12
  25. package/dist/components/StickHeaderView/demo.js +37 -0
  26. package/dist/components/TableCell/TableCell.js +37 -51
  27. package/dist/components/TextInputArea/TextInputArea.js +21 -28
  28. package/dist/components/WithLoadingContainer/WithLoadingContainer.js +14 -31
  29. package/dist/index.js +0 -11
  30. package/dist/jsbridge/RNEasyui.js +0 -25
  31. package/dist/jsbridge/UpgradeModule.js +9 -19
  32. package/dist/jsbridge/index.js +0 -7
  33. package/dist/screen/index.js +0 -8
  34. package/dist/screen/px2dp.js +2 -25
  35. package/dist/screen/px2sp.js +5 -35
  36. package/dist/screen/text-fit.js +2 -13
  37. package/dist/utils/index.js +0 -7
  38. package/dist/utils/lazy.js +12 -67
  39. package/dist/utils/mode.js +0 -21
  40. package/package.json +3 -2
  41. package/types/components/AnimationModal/AnimationModal.d.ts +0 -8
  42. package/types/components/AnimationModal/AnimationModal.d.ts.map +1 -1
  43. package/types/components/Echarts/demo.d.ts +4 -0
  44. package/types/components/Echarts/demo.d.ts.map +1 -0
  45. package/types/components/Echarts/helper.d.ts +0 -5
  46. package/types/components/Echarts/helper.d.ts.map +1 -1
  47. package/types/components/Hud/AlertBottomView/AlertBottomView.d.ts +1 -1
  48. package/types/components/Hud/AlertBottomView/AlertBottomView.d.ts.map +1 -1
  49. package/types/components/Hud/AlertSheetView/AlertSheetView.d.ts +1 -1
  50. package/types/components/Hud/AlertSheetView/AlertSheetView.d.ts.map +1 -1
  51. package/types/components/Hud/AlertView/AlertView.d.ts +1 -1
  52. package/types/components/Hud/AlertView/AlertView.d.ts.map +1 -1
  53. package/types/components/Hud/Loading/Loading.d.ts +3 -3
  54. package/types/components/Hud/Loading/Loading.d.ts.map +1 -1
  55. package/types/components/Hud/PopoverView/PopoverView.d.ts +3 -3
  56. package/types/components/Hud/PopoverView/PopoverView.d.ts.map +1 -1
  57. package/types/components/Hud/Scanner/Scanner.d.ts +3 -3
  58. package/types/components/Hud/Scanner/Scanner.d.ts.map +1 -1
  59. package/types/components/Hud/Toast/Toast.d.ts +2 -2
  60. package/types/components/Hud/Toast/Toast.d.ts.map +1 -1
  61. package/types/components/MutiPictureView/MutiPictureView.d.ts +0 -9
  62. package/types/components/MutiPictureView/MutiPictureView.d.ts.map +1 -1
  63. package/types/components/RefreshList/demo.d.ts +2 -0
  64. package/types/components/RefreshList/demo.d.ts.map +1 -0
  65. package/types/components/RefreshList/demo1.d.ts +2 -0
  66. package/types/components/RefreshList/demo1.d.ts.map +1 -0
  67. package/types/components/RefreshList/demo2.d.ts +2 -0
  68. package/types/components/RefreshList/demo2.d.ts.map +1 -0
  69. package/types/components/StickHeaderView/StickHeaderView.d.ts +0 -6
  70. package/types/components/StickHeaderView/StickHeaderView.d.ts.map +1 -1
  71. package/types/components/StickHeaderView/demo.d.ts +4 -0
  72. package/types/components/StickHeaderView/demo.d.ts.map +1 -0
  73. package/types/components/TextInputArea/TextInputArea.d.ts +0 -1
  74. package/types/components/TextInputArea/TextInputArea.d.ts.map +1 -1
  75. package/types/jsbridge/RNEasyui.d.ts +0 -18
  76. package/types/jsbridge/RNEasyui.d.ts.map +1 -1
  77. package/types/jsbridge/UpgradeModule.d.ts +0 -15
  78. package/types/jsbridge/UpgradeModule.d.ts.map +1 -1
  79. package/types/screen/px2dp.d.ts +0 -11
  80. package/types/screen/px2dp.d.ts.map +1 -1
  81. package/types/screen/text-fit.d.ts +0 -3
  82. package/types/screen/text-fit.d.ts.map +1 -1
  83. package/types/utils/lazy.d.ts +2 -35
  84. package/types/utils/lazy.d.ts.map +1 -1
  85. package/types/utils/mode.d.ts +0 -14
  86. package/types/utils/mode.d.ts.map +1 -1
@@ -1,26 +1,18 @@
1
- /*
2
- * @Author: shiguo
3
- * @Date: 2022-05-17 15:22:06
4
- * @LastEditors: shiguo
5
- * @LastEditTime: 2023-09-27 15:17:15
6
- * @FilePath: /@aks-dev/easyui/lib/AnimationModal/AnimationModal.tsx
7
- */
8
- import { __awaiter } from "tslib";
1
+ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
2
+ function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
3
+ return new (P || (P = Promise))(function (resolve, reject) {
4
+ function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
5
+ function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
6
+ function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
7
+ step((generator = generator.apply(thisArg, _arguments || [])).next());
8
+ });
9
+ };
9
10
  import * as React from "react";
10
11
  import { View, Animated, Easing, PanResponder, StyleSheet, useWindowDimensions, BackHandler, } from "react-native";
11
12
  import * as utils from "../../utils/lazy";
12
- // type State = {
13
- // display: 'flex' | 'none';
14
- // }
15
- // type StateReducerProps = (state: State, action: Partial<State>) => State
16
13
  export const AnimationModal = React.forwardRef((props, ref) => {
17
14
  const { animationType = "from-bottom", mask = false } = props || {};
18
15
  const { height } = useWindowDimensions();
19
- // const [state, dispatch] = React.useReducer<StateReducerProps>(
20
- // (state, action) => ({ ...state, ...action }),
21
- // {
22
- // display: 'none'
23
- // })
24
16
  const [display, setDisplay] = useCallbackState("none");
25
17
  const animatedValue = React.useRef(new Animated.Value(0)).current;
26
18
  const timing = (value) => {
@@ -30,7 +22,6 @@ export const AnimationModal = React.forwardRef((props, ref) => {
30
22
  useNativeDriver: true,
31
23
  easing: Easing.ease,
32
24
  }).start(({ finished }) => {
33
- /* 动画完成的回调函数 */
34
25
  });
35
26
  };
36
27
  const viewRef = React.useRef(null);
@@ -78,9 +69,9 @@ export const AnimationModal = React.forwardRef((props, ref) => {
78
69
  addEventListener.remove();
79
70
  };
80
71
  }, [display]);
81
- return (<View style={Object.assign({
72
+ return (React.createElement(View, Object.assign({ style: Object.assign({
82
73
  display: display,
83
- }, styles.container, props.style)} {...PanResponder.create({
74
+ }, styles.container, props.style) }, PanResponder.create({
84
75
  onStartShouldSetPanResponder: (e, gestureState) => {
85
76
  let pageY = e.nativeEvent.pageY;
86
77
  let topY = height - layoutRef.current.h1;
@@ -90,7 +81,6 @@ export const AnimationModal = React.forwardRef((props, ref) => {
90
81
  return false;
91
82
  },
92
83
  onPanResponderGrant: (e, gestureState) => {
93
- // console.log({e})
94
84
  let pageY = e.nativeEvent.pageY;
95
85
  let topY = height - layoutRef.current.h1;
96
86
  if (pageY <= topY && !mask) {
@@ -98,18 +88,10 @@ export const AnimationModal = React.forwardRef((props, ref) => {
98
88
  hide();
99
89
  }
100
90
  },
101
- }).panHandlers}>
102
- <Animated.View style={Object.assign({}, styles.wrapper, {
103
- transform: [{ translateY: animatedValue }],
104
- })}
105
- // onLayout={e => {
106
- // let target: LayoutRectangle = e.nativeEvent.layout
107
- // layoutRef.current.h1 = target.height
108
- // }}
109
- ref={viewRef}>
110
- {props.children}
111
- </Animated.View>
112
- </View>);
91
+ }).panHandlers),
92
+ React.createElement(Animated.View, { style: Object.assign({}, styles.wrapper, {
93
+ transform: [{ translateY: animatedValue }],
94
+ }), ref: viewRef }, props.children)));
113
95
  });
114
96
  const styles = StyleSheet.create({
115
97
  container: {
@@ -119,7 +101,6 @@ const styles = StyleSheet.create({
119
101
  top: 0,
120
102
  bottom: 0,
121
103
  zIndex: 999,
122
- // display: 'flex',
123
104
  flexDirection: "column",
124
105
  backgroundColor: "#00000055",
125
106
  overflow: "hidden",
@@ -128,14 +109,12 @@ const styles = StyleSheet.create({
128
109
  position: "absolute",
129
110
  display: "flex",
130
111
  flexDirection: "column",
131
- // backgroundColor: 'pink',
132
112
  width: "100%",
133
113
  top: "100%",
134
114
  },
135
115
  empty: {
136
116
  flex: 1,
137
117
  position: "relative",
138
- // backgroundColor: 'cyan'
139
118
  },
140
119
  });
141
120
  const useCallbackState = (od) => {
@@ -1,23 +1,15 @@
1
- /*
2
- * @Author: shiguo
3
- * @Date: 2022-04-21 14:40:29
4
- * @LastEditors: shiguo
5
- * @LastEditTime: 2022-07-08 15:40:21
6
- * @FilePath: /@aks-dev/easyui/lib/Badge/Badge.tsx
7
- */
8
1
  import React from "react";
9
2
  import { View, Text } from "react-native";
10
3
  import { px2dp } from "../../screen/px2dp";
11
4
  import { px2sp } from "../../screen/px2sp";
12
5
  export const Badge = (props) => {
13
6
  if (isNaN(+props.count) || Number(props.count) == 0)
14
- return <View />;
15
- return (<View style={[
7
+ return React.createElement(View, null);
8
+ return (React.createElement(View, { style: [
16
9
  {
17
10
  flexGrow: 0,
18
11
  flexShrink: 1,
19
12
  zIndex: 1,
20
- // paddingHorizontal: px2dp(0),
21
13
  height: px2dp(16),
22
14
  minWidth: px2dp(16),
23
15
  borderRadius: px2dp(8),
@@ -26,10 +18,9 @@ export const Badge = (props) => {
26
18
  backgroundColor: "red",
27
19
  },
28
20
  props.style,
29
- ]}>
30
- <Text style={{ fontSize: px2sp(12), color: "white", textAlign: "center" }}>
31
- {" "}
32
- {Number(props.count) > 99 ? "+99" : props.count}{" "}
33
- </Text>
34
- </View>);
21
+ ] },
22
+ React.createElement(Text, { style: { fontSize: px2sp(12), color: "white", textAlign: "center" } },
23
+ " ",
24
+ Number(props.count) > 99 ? "+99" : props.count,
25
+ " ")));
35
26
  };
@@ -1,21 +1,22 @@
1
- import { __rest } from "tslib";
2
- /*
3
- * @Author: shiguo
4
- * @Date: 2022-07-12 15:30:19
5
- * @LastEditors: shiguo
6
- * @LastEditTime: 2022-07-12 15:33:06
7
- * @FilePath: /@aks-dev/easyui/lib/DottedLine/DottedLine.tsx
8
- */
1
+ var __rest = (this && this.__rest) || function (s, e) {
2
+ var t = {};
3
+ for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
4
+ t[p] = s[p];
5
+ if (s != null && typeof Object.getOwnPropertySymbols === "function")
6
+ for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
7
+ if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
8
+ t[p[i]] = s[p[i]];
9
+ }
10
+ return t;
11
+ };
9
12
  import React from "react";
10
13
  import { StyleSheet, View } from "react-native";
11
14
  export default (props) => {
12
15
  const { vertical = false, dottedColor, dottedCount = 200 } = props, rest = __rest(props, ["vertical", "dottedColor", "dottedCount"]);
13
16
  const arrs = Array.from({ length: dottedCount }, (k, v) => v);
14
- return (<View style={Object.assign(Object.assign(Object.assign({}, styles.container), { flexDirection: vertical ? "column" : "row" }), rest.style)}>
15
- {arrs.map((item, index) => {
16
- return (<View key={`dotted-${index}`} style={Object.assign(Object.assign({}, (vertical ? styles.dotted_vertical : styles.dotted_horizontal)), (dottedColor && { backgroundColor: dottedColor }))}/>);
17
- })}
18
- </View>);
17
+ return (React.createElement(View, { style: Object.assign(Object.assign(Object.assign({}, styles.container), { flexDirection: vertical ? "column" : "row" }), rest.style) }, arrs.map((item, index) => {
18
+ return (React.createElement(View, { key: `dotted-${index}`, style: Object.assign(Object.assign({}, (vertical ? styles.dotted_vertical : styles.dotted_horizontal)), (dottedColor && { backgroundColor: dottedColor })) }));
19
+ })));
19
20
  };
20
21
  const styles = StyleSheet.create({
21
22
  container: {
@@ -1,16 +1,16 @@
1
- import { __awaiter } from "tslib";
2
- /*
3
- * @Author: shiguo
4
- * @Date: 2022-05-05 14:52:53
5
- * @LastEditors: shiguo
6
- * @LastEditTime: 2023-01-03 17:50:43
7
- * @FilePath: /@aks-dev/easyui/lib/Echarts/EchartsView.tsx
8
- */
1
+ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
2
+ function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
3
+ return new (P || (P = Promise))(function (resolve, reject) {
4
+ function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
5
+ function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
6
+ function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
7
+ step((generator = generator.apply(thisArg, _arguments || [])).next());
8
+ });
9
+ };
9
10
  import * as React from "react";
10
11
  import { StyleSheet, View, } from "react-native";
11
12
  import { WebView } from "react-native-webview";
12
13
  import { getHtml, toString } from "./helper";
13
- // type Reducer = (prevState: State, action: Partial<State>) => State;
14
14
  const EchartsView = (props) => {
15
15
  var _a, _b;
16
16
  const [state, dispatch] = React.useReducer((prevState, ...args) => Object.assign({}, prevState, ...args), {
@@ -33,7 +33,6 @@ const EchartsView = (props) => {
33
33
  pageY: args[5],
34
34
  };
35
35
  }
36
- // console.log('RootView', rootView.current)
37
36
  resovle(args);
38
37
  });
39
38
  });
@@ -81,68 +80,27 @@ const EchartsView = (props) => {
81
80
  console.log(err);
82
81
  });
83
82
  }, [props.option, state.isLoaded]);
84
- // const injectedJavaScript = (): string => {
85
- // console.log('injectedJavaScript', props.option.xAxis.data)
86
- // let height = state.height ? `${state.height}px` : 'auto'
87
- // let width = state.width ? `${state.width}px` : 'auto'
88
- // return `
89
- // ;(function() {
90
- // document.getElementById('main').style.height = "${height}";
91
- // document.getElementById('main').style.width = "${width}";
92
- // var instance = echarts.getInstanceByDom(document.getElementById('main'));
93
- // if(instance == null){
94
- // instance = echarts.init(document.getElementById('main'));
95
- // }
96
- // instance.clear();
97
- // instance.setOption(${toString(props.option)});
98
- // instance.on('click', function(params) {
99
- // var seen = [];
100
- // var paramsString = JSON.stringify(params, function(key, val) {
101
- // if (val != null && typeof val == "object") {
102
- // if (seen.indexOf(val) >= 0) {
103
- // return;
104
- // }
105
- // seen.push(val);
106
- // }
107
- // return val;
108
- // });
109
- // // window.ReactNativeWebView.postMessage(JSON.stringify({"types":"ON_PRESS","payload": paramsString}));
110
- // });
111
- // })();
112
- // `
113
- // }
114
- return (<View style={[styles.container, props.style]} ref={containerRef}>
115
- <WebView ref={WebViewRef} originWhitelist={["*"]} useWebKit={true} // ios使用最新webkit内核渲染
116
- allowUniversalAccessFromFileURLs={true} geolocationEnabled={true} mixedContentMode={"always"} renderLoading={() => {
117
- var _a;
118
- if (props.renderLoading)
119
- return props.renderLoading();
120
- return (<View style={{
121
- backgroundColor: ((_a = props.style) === null || _a === void 0 ? void 0 : _a.backgroundColor) || "transparent",
122
- }}/>);
123
- }} // 设置空View,修复ioswebview闪白
124
- style={{
125
- backgroundColor: ((_a = props.style) === null || _a === void 0 ? void 0 : _a.backgroundColor) || "transparent",
126
- opacity: 0.99, //解决闪退的办法
127
- }} // 设置背景色透明,修复android闪白
128
- scrollEnabled={false}
129
- // onMessage={e=>{
130
- // console.log(e)
131
- // }}
132
- javaScriptEnabled={true}
133
- // injectedJavaScript={injectedJavaScript()}
134
- startInLoadingState={false} onLoadEnd={(_) => {
135
- dispatch({ isLoaded: true });
136
- // console.log('onLoadEnd')
137
- }} onError={(e) => {
138
- console.log("onError", e);
139
- }} source={{
140
- baseUrl: "",
141
- html: getHtml({
142
- backgroundColor: ((_b = props.style) === null || _b === void 0 ? void 0 : _b.backgroundColor) || "transparent",
143
- }),
144
- }}/>
145
- </View>);
83
+ return (React.createElement(View, { style: [styles.container, props.style], ref: containerRef },
84
+ React.createElement(WebView, { ref: WebViewRef, originWhitelist: ["*"], useWebKit: true, allowUniversalAccessFromFileURLs: true, geolocationEnabled: true, mixedContentMode: "always", renderLoading: () => {
85
+ var _a;
86
+ if (props.renderLoading)
87
+ return props.renderLoading();
88
+ return (React.createElement(View, { style: {
89
+ backgroundColor: ((_a = props.style) === null || _a === void 0 ? void 0 : _a.backgroundColor) || "transparent",
90
+ } }));
91
+ }, style: {
92
+ backgroundColor: ((_a = props.style) === null || _a === void 0 ? void 0 : _a.backgroundColor) || "transparent",
93
+ opacity: 0.99,
94
+ }, scrollEnabled: false, javaScriptEnabled: true, startInLoadingState: false, onLoadEnd: (_) => {
95
+ dispatch({ isLoaded: true });
96
+ }, onError: (e) => {
97
+ console.log("onError", e);
98
+ }, source: {
99
+ baseUrl: "",
100
+ html: getHtml({
101
+ backgroundColor: ((_b = props.style) === null || _b === void 0 ? void 0 : _b.backgroundColor) || "transparent",
102
+ }),
103
+ } })));
146
104
  };
147
105
  const styles = StyleSheet.create({
148
106
  container: {
@@ -152,6 +110,5 @@ const styles = StyleSheet.create({
152
110
  },
153
111
  });
154
112
  export default EchartsView;
155
- // React.memo(EchartsView)
156
113
  import * as echarts from "echarts/core";
157
114
  export { echarts };
@@ -0,0 +1,201 @@
1
+ import * as React from "react";
2
+ import { View, StyleSheet } from "react-native";
3
+ import EchartsView from "./EchartsView";
4
+ import { echarts } from "./EchartsView";
5
+ export default () => {
6
+ let option = {
7
+ color: ["#80FFA5", "#00DDFF", "#37A2FF", "#FF0087", "#FFBF00"],
8
+ title: {
9
+ text: "Gradient Stacked Area Chart",
10
+ },
11
+ tooltip: {
12
+ trigger: "axis",
13
+ axisPointer: {
14
+ type: "cross",
15
+ label: {
16
+ backgroundColor: "#6a7985",
17
+ },
18
+ },
19
+ },
20
+ legend: {
21
+ data: ["Line 1", "Line 2", "Line 3", "Line 4", "Line 5"],
22
+ },
23
+ toolbox: {
24
+ feature: {
25
+ saveAsImage: {},
26
+ },
27
+ },
28
+ grid: {
29
+ left: "3%",
30
+ right: "4%",
31
+ bottom: "3%",
32
+ containLabel: true,
33
+ },
34
+ xAxis: [
35
+ {
36
+ type: "category",
37
+ boundaryGap: false,
38
+ data: ["Mon", "Tue", "Wed", "Thu", "Fri", "Sat", "Sun"],
39
+ },
40
+ ],
41
+ yAxis: [
42
+ {
43
+ type: "value",
44
+ },
45
+ ],
46
+ series: [
47
+ {
48
+ name: "Line 1",
49
+ type: "line",
50
+ stack: "Total",
51
+ smooth: true,
52
+ lineStyle: {
53
+ width: 0,
54
+ },
55
+ showSymbol: false,
56
+ areaStyle: {
57
+ opacity: 0.8,
58
+ color: new echarts.graphic.LinearGradient(0, 0, 0, 1, [
59
+ {
60
+ offset: 0,
61
+ color: "rgb(128, 255, 165)",
62
+ },
63
+ {
64
+ offset: 1,
65
+ color: "rgb(1, 191, 236)",
66
+ },
67
+ ]),
68
+ },
69
+ emphasis: {
70
+ focus: "series",
71
+ },
72
+ data: [140, 232, 101, 264, 90, 340, 250],
73
+ },
74
+ {
75
+ name: "Line 2",
76
+ type: "line",
77
+ stack: "Total",
78
+ smooth: true,
79
+ lineStyle: {
80
+ width: 0,
81
+ },
82
+ showSymbol: false,
83
+ areaStyle: {
84
+ opacity: 0.8,
85
+ color: new echarts.graphic.LinearGradient(0, 0, 0, 1, [
86
+ {
87
+ offset: 0,
88
+ color: "rgb(0, 221, 255)",
89
+ },
90
+ {
91
+ offset: 1,
92
+ color: "rgb(77, 119, 255)",
93
+ },
94
+ ]),
95
+ },
96
+ emphasis: {
97
+ focus: "series",
98
+ },
99
+ data: [120, 282, 111, 234, 220, 340, 310],
100
+ },
101
+ {
102
+ name: "Line 3",
103
+ type: "line",
104
+ stack: "Total",
105
+ smooth: true,
106
+ lineStyle: {
107
+ width: 0,
108
+ },
109
+ showSymbol: false,
110
+ areaStyle: {
111
+ opacity: 0.8,
112
+ color: new echarts.graphic.LinearGradient(0, 0, 0, 1, [
113
+ {
114
+ offset: 0,
115
+ color: "rgb(55, 162, 255)",
116
+ },
117
+ {
118
+ offset: 1,
119
+ color: "rgb(116, 21, 219)",
120
+ },
121
+ ]),
122
+ },
123
+ emphasis: {
124
+ focus: "series",
125
+ },
126
+ data: [320, 132, 201, 334, 190, 130, 220],
127
+ },
128
+ {
129
+ name: "Line 4",
130
+ type: "line",
131
+ stack: "Total",
132
+ smooth: true,
133
+ lineStyle: {
134
+ width: 0,
135
+ },
136
+ showSymbol: false,
137
+ areaStyle: {
138
+ opacity: 0.8,
139
+ color: new echarts.graphic.LinearGradient(0, 0, 0, 1, [
140
+ {
141
+ offset: 0,
142
+ color: "rgb(255, 0, 135)",
143
+ },
144
+ {
145
+ offset: 1,
146
+ color: "rgb(135, 0, 157)",
147
+ },
148
+ ]),
149
+ },
150
+ emphasis: {
151
+ focus: "series",
152
+ },
153
+ data: [220, 402, 231, 134, 190, 230, 120],
154
+ },
155
+ {
156
+ name: "Line 5",
157
+ type: "line",
158
+ stack: "Total",
159
+ smooth: true,
160
+ lineStyle: {
161
+ width: 0,
162
+ },
163
+ showSymbol: false,
164
+ label: {
165
+ show: true,
166
+ position: "top",
167
+ },
168
+ areaStyle: {
169
+ opacity: 0.8,
170
+ color: new echarts.graphic.LinearGradient(0, 0, 0, 1, [
171
+ {
172
+ offset: 0,
173
+ color: "rgb(255, 191, 0)",
174
+ },
175
+ {
176
+ offset: 1,
177
+ color: "rgb(224, 62, 76)",
178
+ },
179
+ ]),
180
+ },
181
+ emphasis: {
182
+ focus: "series",
183
+ },
184
+ data: [220, 302, 181, 234, 210, 290, 150],
185
+ },
186
+ ],
187
+ };
188
+ return (React.createElement(View, { style: styles.container },
189
+ React.createElement(View, { style: { width: 100, height: 100, backgroundColor: "pink" } }),
190
+ React.createElement(EchartsView, { option: option, style: {
191
+ marginTop: 100,
192
+ marginHorizontal: 20,
193
+ height: 200,
194
+ } })));
195
+ };
196
+ const styles = StyleSheet.create({
197
+ container: {
198
+ flexGrow: 1,
199
+ display: "flex",
200
+ },
201
+ });
@@ -1,10 +1,3 @@
1
- /*
2
- * @Author: shiguo
3
- * @Date: 2022-05-05 15:56:21
4
- * @LastEditors: shiguo
5
- * @LastEditTime: 2023-01-03 17:02:57
6
- * @FilePath: /@aks-dev/easyui/lib/Echarts/helper.tsx
7
- */
8
1
  export const getHtml = (props) => {
9
2
  return `
10
3
  <!DOCTYPE html>
@@ -42,23 +35,15 @@ export const getHtml = (props) => {
42
35
  </html>
43
36
  `;
44
37
  };
45
- /**
46
- * https://res.actiiot.com/echarts/5.0.2/echarts.min.js
47
- *
48
- * https://cdnjs.cloudflare.com/ajax/libs/echarts/5.4.1/echarts.min.js
49
- */
50
38
  export const toString = (obj) => {
51
39
  let result = JSON.stringify(obj, function (key, val) {
52
- // 对function进行特殊处理
53
40
  if (typeof val === 'function') {
54
41
  return `~ha~${val}~ha~`;
55
42
  }
56
43
  return val;
57
44
  });
58
- // 再进行还原
59
45
  do {
60
- result = result.replace('\"~ha~', '').replace('~ha~\"', '').replace(/\\\"/g, "\""); //最后一个replace将release模式中莫名生成的\"转换成"
46
+ result = result.replace('\"~ha~', '').replace('~ha~\"', '').replace(/\\\"/g, "\"");
61
47
  } while (result.indexOf('~ha~') >= 0);
62
48
  return result;
63
49
  };
64
- ///.replace(/\\n/g, '')