|
@@ -13,7 +13,22 @@ class DesktopHome extends Component {
|
|
|
constructor(props) {
|
|
|
super(props);
|
|
|
this.state = {
|
|
|
- data: [],
|
|
|
+ data: [
|
|
|
+ {
|
|
|
+ kind: '高压计量装置',
|
|
|
+ releaseDate: '20250516',
|
|
|
+ userData: '高压计量装置',
|
|
|
+ model: 'GJWZ-12',
|
|
|
+ eddl: '630A',
|
|
|
+ eddy: '10kV',
|
|
|
+ firstCurrent: '200',
|
|
|
+ edpl: '50Hz',
|
|
|
+ ratedLoad: '10/15VA',
|
|
|
+ senondCurrent: '5',
|
|
|
+ assetID: '01234567890123456789',
|
|
|
+ manufacturer: '郑州市凯贝特互感器有限公司',
|
|
|
+ }
|
|
|
+ ],
|
|
|
userData: [], //防止重复扫描
|
|
|
no_begin: '8',
|
|
|
no_length: '14',
|
|
@@ -285,7 +300,8 @@ class DesktopHome extends Component {
|
|
|
key={item.userData}
|
|
|
style={styles.mainView}
|
|
|
>
|
|
|
- <Text style={[styles.textColor, {marginVertical: 10, fontWeight: "bold", fontSize: 18}]}>计量箱装置</Text>
|
|
|
+ <Text
|
|
|
+ style={[styles.textColor, {marginVertical: 10, fontWeight: "bold", fontSize: 18}]}>计量箱装置</Text>
|
|
|
|
|
|
<View style={{
|
|
|
flexDirection: 'row',
|
|
@@ -322,8 +338,8 @@ class DesktopHome extends Component {
|
|
|
backgroundColor={"#ffffff"}//背景色
|
|
|
size={65}//二维码宽高
|
|
|
/>
|
|
|
- <Text style={[styles.textColor]}>{item.assetID.slice(0,11)}</Text>
|
|
|
- <Text style={[styles.textColor]}>{item.assetID.slice(11,30)}</Text>
|
|
|
+ <Text style={[styles.textColor]}>{item.assetID.slice(0, 11)}</Text>
|
|
|
+ <Text style={[styles.textColor]}>{item.assetID.slice(11, 30)}</Text>
|
|
|
</View>
|
|
|
</View>
|
|
|
<Text style={[styles.textColor, {marginVertical: 10, fontWeight: "bold",}]}>{item.manufacturer}</Text>
|
|
@@ -331,6 +347,63 @@ class DesktopHome extends Component {
|
|
|
)
|
|
|
}
|
|
|
|
|
|
+ gaoYaRender = (item, index) => {
|
|
|
+ // 高压计量装置
|
|
|
+ return (
|
|
|
+ <View
|
|
|
+ key={item.userData}
|
|
|
+ style={styles.mainView}
|
|
|
+ >
|
|
|
+ <Text style={[styles.textColor, {
|
|
|
+ marginVertical: 10,
|
|
|
+ fontWeight: "bold",
|
|
|
+ fontSize: 18
|
|
|
+ }]}>{item.kind}</Text>
|
|
|
+
|
|
|
+ <View>
|
|
|
+ <View style={styles.JLView}>
|
|
|
+ <Text style={styles.textColor31}>装置型号</Text>
|
|
|
+ <Text style={styles.GYModel}>{item.model}</Text>
|
|
|
+ </View>
|
|
|
+ <View style={styles.JLView}>
|
|
|
+ <Text style={styles.textColor31}>额定电压</Text>
|
|
|
+ <Text style={styles.GYModel}>{item.eddy}</Text>
|
|
|
+ </View>
|
|
|
+ <View style={styles.JLView}>
|
|
|
+ <Text style={styles.textColor31}>额定电流</Text>
|
|
|
+ <Text style={[styles.GYModel]}>{item.eddl}</Text>
|
|
|
+ </View>
|
|
|
+ <View style={styles.JLView}>
|
|
|
+ <Text style={styles.textColor31}>额定频率</Text>
|
|
|
+ <Text style={[styles.GYModel]}>{item.edpl}</Text>
|
|
|
+ </View>
|
|
|
+ <View style={styles.JLView}>
|
|
|
+ <Text style={styles.textColor31}>额定负荷</Text>
|
|
|
+ <Text style={[styles.GYModel]}>{item.ratedLoad}</Text>
|
|
|
+ </View>
|
|
|
+ <View style={styles.JLView}>
|
|
|
+ <Text style={styles.textColor31}>电 流 比</Text>
|
|
|
+ <Text style={[styles.GYModel]}>{item.firstCurrent}/{item.senondCurrent}A</Text>
|
|
|
+ </View>
|
|
|
+ <View style={styles.JLView}>
|
|
|
+ <Text style={styles.textColor31}>资产编号</Text>
|
|
|
+ <Text style={[styles.GYModel]}>{item.assetID}</Text>
|
|
|
+ </View>
|
|
|
+ <View style={styles.JLView}>
|
|
|
+ <Text style={styles.textColor31}>出厂日期</Text>
|
|
|
+ <Text style={styles.GYModel}>{item.releaseDate}</Text>
|
|
|
+ </View>
|
|
|
+ </View>
|
|
|
+
|
|
|
+ <Text style={[styles.textColor, {
|
|
|
+ marginVertical: 10,
|
|
|
+ fontSize: 18,
|
|
|
+ fontWeight: "bold",
|
|
|
+ }]}>{item.manufacturer}</Text>
|
|
|
+ </View>
|
|
|
+ )
|
|
|
+ }
|
|
|
+
|
|
|
errorRender = (item, index) => {
|
|
|
return (
|
|
|
<View
|
|
@@ -352,17 +425,15 @@ class DesktopHome extends Component {
|
|
|
this.state.data.map((item, index) => {
|
|
|
if (item.error) {
|
|
|
return this.errorRender(item, index)
|
|
|
- }
|
|
|
- else if (item.kind.indexOf('电压') > -1) {
|
|
|
+ } else if (item.kind.indexOf('电压') > -1) {
|
|
|
return this.dianYaRender(item, index)
|
|
|
- }
|
|
|
- else if (item.kind.indexOf('电流') > -1) {
|
|
|
+ } else if (item.kind.indexOf('电流') > -1) {
|
|
|
return this.dianLiuRender(item, index)
|
|
|
- }
|
|
|
- else if (item.kind.indexOf('计量箱装置') > -1) {
|
|
|
+ } else if (item.kind.indexOf('计量箱装置') > -1) {
|
|
|
return this.jiliangRender(item, index)
|
|
|
- }
|
|
|
- else {
|
|
|
+ } else if (item.kind.indexOf('高压计量装置') > -1) {
|
|
|
+ return this.gaoYaRender(item, index)
|
|
|
+ } else {
|
|
|
// 组合互感器,没有设置,默认用电压模板
|
|
|
if (zuhe_temp === '2') {
|
|
|
return this.dianLiuRender(item, index)
|
|
@@ -375,7 +446,10 @@ class DesktopHome extends Component {
|
|
|
}
|
|
|
</ScrollView>
|
|
|
<Text
|
|
|
- style={{marginLeft: 10, color: '#f77b22'}}>合计:{this.state.data.length} 失败:{this.state.error}</Text>
|
|
|
+ style={{
|
|
|
+ marginLeft: 10,
|
|
|
+ color: '#f77b22'
|
|
|
+ }}>合计:{this.state.data.length} 失败:{this.state.error}</Text>
|
|
|
<View style={{flexDirection: 'row'}}>
|
|
|
<Button onPress={() => this._start()}
|
|
|
type="primary"
|
|
@@ -489,6 +563,14 @@ const styles = StyleSheet.create({
|
|
|
flexDirection: 'row',
|
|
|
marginBottom: 5
|
|
|
},
|
|
|
+ GYModel: {
|
|
|
+ fontWeight: "bold",
|
|
|
+ borderWidth: 1,
|
|
|
+ borderLeftColor: '#7b7b7b',
|
|
|
+ color: '#333',
|
|
|
+ textAlign: 'center',
|
|
|
+ width: (screenW - 9) * 0.70,
|
|
|
+ },
|
|
|
})
|
|
|
|
|
|
export default DesktopHome;
|