@aks-dev/easyui 1.0.190 → 1.0.192

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 (72) hide show
  1. package/dist/components/AnimationModal/AnimationModal.js +23 -41
  2. package/dist/components/Badge/Badge.js +7 -16
  3. package/dist/components/DottedLine/DottedLine.js +15 -20
  4. package/dist/components/Echarts/EchartsView.js +40 -77
  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 +49 -64
  8. package/dist/components/Hud/AlertSheetView/AlertSheetView.js +30 -34
  9. package/dist/components/Hud/AlertView/AlertView.js +52 -66
  10. package/dist/components/Hud/Hud.js +8 -19
  11. package/dist/components/Hud/Loading/Loading.js +7 -25
  12. package/dist/components/Hud/PopoverView/PopoverView.js +5 -20
  13. package/dist/components/Hud/Scanner/Scanner.js +71 -99
  14. package/dist/components/Hud/Toast/Toast.js +6 -16
  15. package/dist/components/MenuView/MenuView.js +32 -73
  16. package/dist/components/Modal/Modal.js +0 -7
  17. package/dist/components/MutiPictureView/MutiPictureView.js +78 -88
  18. package/dist/components/PictureViewer/PictureViewer.js +11 -32
  19. package/dist/components/RefreshList/RefreshList.js +43 -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 +23 -23
  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 -53
  27. package/dist/components/TextInputArea/TextInputArea.js +22 -31
  28. package/dist/components/WithLoadingContainer/WithLoadingContainer.js +14 -31
  29. package/dist/index.js +0 -11
  30. package/dist/jsbridge/RNEasyui.js +1 -26
  31. package/dist/jsbridge/UpgradeModule.js +12 -21
  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 +5 -21
  37. package/dist/utils/index.js +0 -7
  38. package/dist/utils/lazy.js +19 -71
  39. package/dist/utils/mode.js +0 -21
  40. package/package.json +3 -7
  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/MutiPictureView/MutiPictureView.d.ts +0 -9
  48. package/types/components/MutiPictureView/MutiPictureView.d.ts.map +1 -1
  49. package/types/components/RefreshList/demo.d.ts +2 -0
  50. package/types/components/RefreshList/demo.d.ts.map +1 -0
  51. package/types/components/RefreshList/demo1.d.ts +2 -0
  52. package/types/components/RefreshList/demo1.d.ts.map +1 -0
  53. package/types/components/RefreshList/demo2.d.ts +2 -0
  54. package/types/components/RefreshList/demo2.d.ts.map +1 -0
  55. package/types/components/StickHeaderView/StickHeaderView.d.ts +0 -6
  56. package/types/components/StickHeaderView/StickHeaderView.d.ts.map +1 -1
  57. package/types/components/StickHeaderView/demo.d.ts +4 -0
  58. package/types/components/StickHeaderView/demo.d.ts.map +1 -0
  59. package/types/components/TextInputArea/TextInputArea.d.ts +0 -1
  60. package/types/components/TextInputArea/TextInputArea.d.ts.map +1 -1
  61. package/types/jsbridge/RNEasyui.d.ts +0 -18
  62. package/types/jsbridge/RNEasyui.d.ts.map +1 -1
  63. package/types/jsbridge/UpgradeModule.d.ts +0 -15
  64. package/types/jsbridge/UpgradeModule.d.ts.map +1 -1
  65. package/types/screen/px2dp.d.ts +0 -11
  66. package/types/screen/px2dp.d.ts.map +1 -1
  67. package/types/screen/text-fit.d.ts +0 -3
  68. package/types/screen/text-fit.d.ts.map +1 -1
  69. package/types/utils/lazy.d.ts +0 -33
  70. package/types/utils/lazy.d.ts.map +1 -1
  71. package/types/utils/mode.d.ts +0 -14
  72. package/types/utils/mode.d.ts.map +1 -1
@@ -1,25 +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
- */
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
+ };
8
10
  import * as React from "react";
9
11
  import { View, Animated, Easing, PanResponder, StyleSheet, useWindowDimensions, BackHandler, } from "react-native";
10
12
  import * as utils from "../../utils/lazy";
11
- // type State = {
12
- // display: 'flex' | 'none';
13
- // }
14
- // type StateReducerProps = (state: State, action: Partial<State>) => State
15
13
  export const AnimationModal = React.forwardRef((props, ref) => {
16
14
  const { animationType = "from-bottom", mask = false } = props || {};
17
15
  const { height } = useWindowDimensions();
18
- // const [state, dispatch] = React.useReducer<StateReducerProps>(
19
- // (state, action) => ({ ...state, ...action }),
20
- // {
21
- // display: 'none'
22
- // })
23
16
  const [display, setDisplay] = useCallbackState("none");
24
17
  const animatedValue = React.useRef(new Animated.Value(0)).current;
25
18
  const timing = (value) => {
@@ -29,14 +22,14 @@ export const AnimationModal = React.forwardRef((props, ref) => {
29
22
  useNativeDriver: true,
30
23
  easing: Easing.ease,
31
24
  }).start(({ finished }) => {
32
- /* 动画完成的回调函数 */
33
25
  });
34
26
  };
35
27
  const viewRef = React.useRef(null);
36
28
  const layoutRef = React.useRef({ h0: 0, h1: 0 });
37
29
  const getLayoutPromise = () => {
38
30
  return new Promise((resovle, reject) => {
39
- viewRef.current?.measure((...args) => {
31
+ var _a;
32
+ (_a = viewRef.current) === null || _a === void 0 ? void 0 : _a.measure((...args) => {
40
33
  if (args.length == 6) {
41
34
  layoutRef.current.h1 = args[3];
42
35
  }
@@ -53,11 +46,12 @@ export const AnimationModal = React.forwardRef((props, ref) => {
53
46
  };
54
47
  const getData = () => dataRef.current;
55
48
  const show = () => {
56
- setDisplay("flex", async () => {
57
- await utils.sleep(50);
58
- await getLayoutPromise();
59
- timing(-layoutRef.current?.h1);
60
- });
49
+ setDisplay("flex", () => __awaiter(void 0, void 0, void 0, function* () {
50
+ var _a;
51
+ yield utils.sleep(50);
52
+ yield getLayoutPromise();
53
+ timing(-((_a = layoutRef.current) === null || _a === void 0 ? void 0 : _a.h1));
54
+ }));
61
55
  return init();
62
56
  };
63
57
  const hide = () => {
@@ -75,9 +69,9 @@ export const AnimationModal = React.forwardRef((props, ref) => {
75
69
  addEventListener.remove();
76
70
  };
77
71
  }, [display]);
78
- return (<View style={Object.assign({
72
+ return (React.createElement(View, Object.assign({ style: Object.assign({
79
73
  display: display,
80
- }, styles.container, props.style)} {...PanResponder.create({
74
+ }, styles.container, props.style) }, PanResponder.create({
81
75
  onStartShouldSetPanResponder: (e, gestureState) => {
82
76
  let pageY = e.nativeEvent.pageY;
83
77
  let topY = height - layoutRef.current.h1;
@@ -87,7 +81,6 @@ export const AnimationModal = React.forwardRef((props, ref) => {
87
81
  return false;
88
82
  },
89
83
  onPanResponderGrant: (e, gestureState) => {
90
- // console.log({e})
91
84
  let pageY = e.nativeEvent.pageY;
92
85
  let topY = height - layoutRef.current.h1;
93
86
  if (pageY <= topY && !mask) {
@@ -95,18 +88,10 @@ export const AnimationModal = React.forwardRef((props, ref) => {
95
88
  hide();
96
89
  }
97
90
  },
98
- }).panHandlers}>
99
- <Animated.View style={Object.assign({}, styles.wrapper, {
100
- transform: [{ translateY: animatedValue }],
101
- })}
102
- // onLayout={e => {
103
- // let target: LayoutRectangle = e.nativeEvent.layout
104
- // layoutRef.current.h1 = target.height
105
- // }}
106
- ref={viewRef}>
107
- {props.children}
108
- </Animated.View>
109
- </View>);
91
+ }).panHandlers),
92
+ React.createElement(Animated.View, { style: Object.assign({}, styles.wrapper, {
93
+ transform: [{ translateY: animatedValue }],
94
+ }), ref: viewRef }, props.children)));
110
95
  });
111
96
  const styles = StyleSheet.create({
112
97
  container: {
@@ -116,7 +101,6 @@ const styles = StyleSheet.create({
116
101
  top: 0,
117
102
  bottom: 0,
118
103
  zIndex: 999,
119
- // display: 'flex',
120
104
  flexDirection: "column",
121
105
  backgroundColor: "#00000055",
122
106
  overflow: "hidden",
@@ -125,14 +109,12 @@ const styles = StyleSheet.create({
125
109
  position: "absolute",
126
110
  display: "flex",
127
111
  flexDirection: "column",
128
- // backgroundColor: 'pink',
129
112
  width: "100%",
130
113
  top: "100%",
131
114
  },
132
115
  empty: {
133
116
  flex: 1,
134
117
  position: "relative",
135
- // backgroundColor: 'cyan'
136
118
  },
137
119
  });
138
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,27 +1,22 @@
1
- /*
2
- * @Author: shiguo
3
- * @Date: 2022-07-12 15:30:19
4
- * @LastEditors: shiguo
5
- * @LastEditTime: 2022-07-12 15:33:06
6
- * @FilePath: /@aks-dev/easyui/lib/DottedLine/DottedLine.tsx
7
- */
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
+ };
8
12
  import React from "react";
9
13
  import { StyleSheet, View } from "react-native";
10
14
  export default (props) => {
11
- const { vertical = false, dottedColor, dottedCount = 200, ...rest } = props;
15
+ const { vertical = false, dottedColor, dottedCount = 200 } = props, rest = __rest(props, ["vertical", "dottedColor", "dottedCount"]);
12
16
  const arrs = Array.from({ length: dottedCount }, (k, v) => v);
13
- return (<View style={{
14
- ...styles.container,
15
- flexDirection: vertical ? "column" : "row",
16
- ...rest.style,
17
- }}>
18
- {arrs.map((item, index) => {
19
- return (<View key={`dotted-${index}`} style={{
20
- ...(vertical ? styles.dotted_vertical : styles.dotted_horizontal),
21
- ...(dottedColor && { backgroundColor: dottedColor }),
22
- }}/>);
23
- })}
24
- </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
+ })));
25
20
  };
26
21
  const styles = StyleSheet.create({
27
22
  container: {
@@ -1,16 +1,18 @@
1
- /*
2
- * @Author: shiguo
3
- * @Date: 2022-05-05 14:52:53
4
- * @LastEditors: shiguo
5
- * @LastEditTime: 2023-01-03 17:50:43
6
- * @FilePath: /@aks-dev/easyui/lib/Echarts/EchartsView.tsx
7
- */
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
+ };
8
10
  import * as React from "react";
9
11
  import { StyleSheet, View, } from "react-native";
10
12
  import { WebView } from "react-native-webview";
11
13
  import { getHtml, toString } from "./helper";
12
- // type Reducer = (prevState: State, action: Partial<State>) => State;
13
14
  const EchartsView = (props) => {
15
+ var _a, _b;
14
16
  const [state, dispatch] = React.useReducer((prevState, ...args) => Object.assign({}, prevState, ...args), {
15
17
  width: 0,
16
18
  height: 0,
@@ -21,7 +23,8 @@ const EchartsView = (props) => {
21
23
  const rootView = React.useRef({ pageX: 0, pageY: 0, width: 0, height: 0 });
22
24
  const getRootViewlayoutPromise = () => {
23
25
  return new Promise((resovle, reject) => {
24
- containerRef.current?.measure((...args) => {
26
+ var _a;
27
+ (_a = containerRef.current) === null || _a === void 0 ? void 0 : _a.measure((...args) => {
25
28
  if (args.length == 6) {
26
29
  rootView.current = {
27
30
  width: args[2],
@@ -30,15 +33,15 @@ const EchartsView = (props) => {
30
33
  pageY: args[5],
31
34
  };
32
35
  }
33
- // console.log('RootView', rootView.current)
34
36
  resovle(args);
35
37
  });
36
38
  });
37
39
  };
38
40
  React.useLayoutEffect(() => {
39
- (async () => {
41
+ (() => __awaiter(void 0, void 0, void 0, function* () {
42
+ var _a;
40
43
  if (state.isLoaded) {
41
- await getRootViewlayoutPromise();
44
+ yield getRootViewlayoutPromise();
42
45
  let height = rootView.current.height
43
46
  ? `${rootView.current.height}px`
44
47
  : "auto";
@@ -57,8 +60,9 @@ const EchartsView = (props) => {
57
60
  instance.setOption(${toString(props.option)});
58
61
  })();
59
62
  `;
60
- WebViewRef.current?.injectJavaScript(run);
63
+ (_a = WebViewRef.current) === null || _a === void 0 ? void 0 : _a.injectJavaScript(run);
61
64
  return () => {
65
+ var _a;
62
66
  const run = `
63
67
  ;(function() {
64
68
  var instance = echarts.getInstanceByDom(document.getElementById('main'));
@@ -68,75 +72,35 @@ const EchartsView = (props) => {
68
72
  }
69
73
  })();
70
74
  `;
71
- WebViewRef.current?.injectJavaScript(run);
75
+ (_a = WebViewRef.current) === null || _a === void 0 ? void 0 : _a.injectJavaScript(run);
72
76
  };
73
77
  }
74
78
  return undefined;
75
- })().catch((err) => {
79
+ }))().catch((err) => {
76
80
  console.log(err);
77
81
  });
78
82
  }, [props.option, state.isLoaded]);
79
- // const injectedJavaScript = (): string => {
80
- // console.log('injectedJavaScript', props.option.xAxis.data)
81
- // let height = state.height ? `${state.height}px` : 'auto'
82
- // let width = state.width ? `${state.width}px` : 'auto'
83
- // return `
84
- // ;(function() {
85
- // document.getElementById('main').style.height = "${height}";
86
- // document.getElementById('main').style.width = "${width}";
87
- // var instance = echarts.getInstanceByDom(document.getElementById('main'));
88
- // if(instance == null){
89
- // instance = echarts.init(document.getElementById('main'));
90
- // }
91
- // instance.clear();
92
- // instance.setOption(${toString(props.option)});
93
- // instance.on('click', function(params) {
94
- // var seen = [];
95
- // var paramsString = JSON.stringify(params, function(key, val) {
96
- // if (val != null && typeof val == "object") {
97
- // if (seen.indexOf(val) >= 0) {
98
- // return;
99
- // }
100
- // seen.push(val);
101
- // }
102
- // return val;
103
- // });
104
- // // window.ReactNativeWebView.postMessage(JSON.stringify({"types":"ON_PRESS","payload": paramsString}));
105
- // });
106
- // })();
107
- // `
108
- // }
109
- return (<View style={[styles.container, props.style]} ref={containerRef}>
110
- <WebView ref={WebViewRef} originWhitelist={["*"]} useWebKit={true} // ios使用最新webkit内核渲染
111
- allowUniversalAccessFromFileURLs={true} geolocationEnabled={true} mixedContentMode={"always"} renderLoading={() => {
112
- if (props.renderLoading)
113
- return props.renderLoading();
114
- return (<View style={{
115
- backgroundColor: props.style?.backgroundColor || "transparent",
116
- }}/>);
117
- }} // 设置空View,修复ioswebview闪白
118
- style={{
119
- backgroundColor: props.style?.backgroundColor || "transparent",
120
- opacity: 0.99, //解决闪退的办法
121
- }} // 设置背景色透明,修复android闪白
122
- scrollEnabled={false}
123
- // onMessage={e=>{
124
- // console.log(e)
125
- // }}
126
- javaScriptEnabled={true}
127
- // injectedJavaScript={injectedJavaScript()}
128
- startInLoadingState={false} onLoadEnd={(_) => {
129
- dispatch({ isLoaded: true });
130
- // console.log('onLoadEnd')
131
- }} onError={(e) => {
132
- console.log("onError", e);
133
- }} source={{
134
- baseUrl: "",
135
- html: getHtml({
136
- backgroundColor: props.style?.backgroundColor || "transparent",
137
- }),
138
- }}/>
139
- </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
+ } })));
140
104
  };
141
105
  const styles = StyleSheet.create({
142
106
  container: {
@@ -146,6 +110,5 @@ const styles = StyleSheet.create({
146
110
  },
147
111
  });
148
112
  export default EchartsView;
149
- // React.memo(EchartsView)
150
113
  import * as echarts from "echarts/core";
151
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, '')