|
@@ -1,8 +1,10 @@
|
|
|
import React, {Component} from 'react';
|
|
|
-import {StyleSheet, View, Text, DeviceEventEmitter, ScrollView,TouchableOpacity, Dimensions} from 'react-native';
|
|
|
+import {StyleSheet, View, Text, DeviceEventEmitter, ScrollView, TouchableOpacity, Dimensions} from 'react-native';
|
|
|
import {Button} from '@ant-design/react-native';
|
|
|
import ReadUHF from "../../utils/ReadUHF";
|
|
|
import Barcode from "react-native-barcode-builder";
|
|
|
+import SyncStorage from "sync-storage";
|
|
|
+
|
|
|
let screenW = Dimensions.get('window').width;
|
|
|
|
|
|
class DesktopHome extends Component {
|
|
@@ -11,6 +13,8 @@ class DesktopHome extends Component {
|
|
|
this.state = {
|
|
|
data: [],
|
|
|
userData: [],
|
|
|
+ no_begin: '8',
|
|
|
+ no_length: '14',
|
|
|
error: 0,
|
|
|
isStart: true,
|
|
|
timerID: [],
|
|
@@ -52,7 +56,13 @@ class DesktopHome extends Component {
|
|
|
this.setState({data, userData, error})
|
|
|
}
|
|
|
}
|
|
|
+
|
|
|
_start = () => {
|
|
|
+ const no_begin = SyncStorage.get('no_begin')
|
|
|
+ const no_length = SyncStorage.get('no_length')
|
|
|
+ if (no_begin && no_begin) {
|
|
|
+ this.setState({no_begin, no_length})
|
|
|
+ }
|
|
|
let {isStart} = this.state;
|
|
|
ReadUHF.doRead()
|
|
|
this.setState({isStart: !isStart})
|
|
@@ -61,12 +71,17 @@ class DesktopHome extends Component {
|
|
|
this.setState({userData: [], data: [], error: 0})
|
|
|
}
|
|
|
onKeyDown = () => {
|
|
|
+ const no_begin = SyncStorage.get('no_begin')
|
|
|
+ const no_length = SyncStorage.get('no_length')
|
|
|
+ if (no_begin && no_begin) {
|
|
|
+ this.setState({no_begin, no_length})
|
|
|
+ }
|
|
|
let {isStart} = this.state;
|
|
|
this.setState({isStart: !isStart})
|
|
|
}
|
|
|
|
|
|
dianYaRender = (item, index) => {
|
|
|
- const assetID = item.assetID.slice(7, 21)
|
|
|
+ const assetID = item.assetID.slice(parseInt(this.state.no_begin) -1, parseInt(this.state.no_begin)+parseInt(this.state.no_length)-1)
|
|
|
const releaseDates = item.releaseDate.split('-')
|
|
|
const releaseDate = releaseDates[0] + "年" + releaseDates[1] + "月"
|
|
|
return (
|
|
@@ -78,7 +93,7 @@ class DesktopHome extends Component {
|
|
|
<View style={styles.betweenView}>
|
|
|
<Text style={styles.textColor3}>型号:{item.model}</Text>
|
|
|
<View style={styles.centerWidth}>
|
|
|
- <Text style={styles.textColor3}>电压等级:{item.voltageLevel}</Text>
|
|
|
+ <Text style={styles.textColor3}>电压等级:{item.voltageLevel}kV</Text>
|
|
|
</View>
|
|
|
<Text style={styles.textColor3}>绕组数量:{item.secondWindingCount}</Text>
|
|
|
</View>
|
|
@@ -94,7 +109,7 @@ class DesktopHome extends Component {
|
|
|
</View>
|
|
|
<View style={styles.betweenView}>
|
|
|
<View style={styles.centerView}>
|
|
|
- <Text style={styles.textColor4}>{item.secondVoltage}</Text>
|
|
|
+ <Text style={styles.textColor4}>{item.secondVoltage}kV</Text>
|
|
|
</View>
|
|
|
<View style={styles.centerWidth}>
|
|
|
<Text style={styles.textColor4}>{item.accuracy}</Text>
|
|
@@ -109,7 +124,7 @@ class DesktopHome extends Component {
|
|
|
<View style={styles.betweenView}>
|
|
|
<Text style={styles.textColor3}>安装场所:{item.place}</Text>
|
|
|
<View style={styles.centerWidth}>
|
|
|
- <Text style={styles.textColor3}>额定负荷:{item.ratedLoad}</Text>
|
|
|
+ <Text style={styles.textColor3}>额定负荷:{item.ratedLoad}VA</Text>
|
|
|
</View>
|
|
|
<Text style={styles.textColor3}>电压因数:{item.voltageFactor}</Text>
|
|
|
</View>
|
|
@@ -147,7 +162,7 @@ class DesktopHome extends Component {
|
|
|
}
|
|
|
|
|
|
dianLiuRender = (item, index) => {
|
|
|
- const assetID = item.assetID.slice(7, 21)
|
|
|
+ const assetID = item.assetID.slice(parseInt(this.state.no_begin) -1, parseInt(this.state.no_begin)+parseInt(this.state.no_length)-1)
|
|
|
const releaseDates = item.releaseDate.split('-')
|
|
|
const releaseDate = releaseDates[0] + "年" + releaseDates[1] + "月"
|
|
|
return (
|
|
@@ -159,7 +174,7 @@ class DesktopHome extends Component {
|
|
|
<View style={styles.betweenView}>
|
|
|
<Text style={styles.textColor3}>型号:{item.model}</Text>
|
|
|
<View style={styles.centerWidth}>
|
|
|
- <Text style={styles.textColor3}>电压等级:{item.voltageLevel}</Text>
|
|
|
+ <Text style={styles.textColor3}>电压等级:{item.voltageLevel}kV</Text>
|
|
|
</View>
|
|
|
<Text style={styles.textColor3}>绕组数量:{item.secondWindingCount}</Text>
|
|
|
</View>
|
|
@@ -175,10 +190,10 @@ class DesktopHome extends Component {
|
|
|
</View>
|
|
|
<View style={styles.betweenView}>
|
|
|
<View style={styles.centerView}>
|
|
|
- <Text style={styles.textColor4}>{item.firstCurrent}</Text>
|
|
|
+ <Text style={styles.textColor4}>{item.firstCurrent}A</Text>
|
|
|
</View>
|
|
|
<View style={styles.centerWidth}>
|
|
|
- <Text style={styles.textColor4}>{item.senondCurrent}</Text>
|
|
|
+ <Text style={styles.textColor4}>{item.senondCurrent}A</Text>
|
|
|
</View>
|
|
|
<View style={styles.rightWidth}>
|
|
|
<Text style={styles.textColor4}>{item.powerFactor}</Text>
|
|
@@ -190,7 +205,7 @@ class DesktopHome extends Component {
|
|
|
<View style={styles.betweenView}>
|
|
|
<Text style={styles.textColor3}>安装场所:{item.place}</Text>
|
|
|
<View style={styles.centerWidth}>
|
|
|
- <Text style={styles.textColor3}>额定负荷:{item.ratedLoad}</Text>
|
|
|
+ <Text style={styles.textColor3}>额定负荷:{item.ratedLoad}VA</Text>
|
|
|
</View>
|
|
|
<Text style={styles.textColor3}>准确等级:{item.accuracy}</Text>
|
|
|
</View>
|