Employee.js
1.74 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
/**
* Created by DEV005 on 2017/11/13.
*/
/**
* Created by tdzl2003 on 12/18/16.
*/
import React, {Component} from "react";
import {StyleSheet, View} from "react-native";
import EmployeeList from './public/EmployeeList';
export default class Employee extends Component {
params = this.props.navigation.state.params;
constructor(props) {
super(props);
this.state = {
tenantId: global.tenantId,
tenantName: global.tenantShortName
};
}
static navigationOptions = ({navigation, screenProps}) => ({
title: "通讯录",
});
componentDidMount() {
let _this = this;
//设置头部
this.props.navigation.setParams({
isBack: true
});
}
render() {
return (
<View style={styles.body}>
<EmployeeList tenantId={this.state.tenantId} name={this.state.tenantName} callback={this.callback}
employeeType="USER"></EmployeeList>
</View>
);
}
callback = (data) => {
let _this = this;
//转交
console.log(data)
if (_this.params.status == "add") {
_this.params.callback(data)
this.props.navigation.goBack();
} else {
this.props.navigation.navigate('Comment', {
status: _this.params.status, flowId: _this.params.flowId,
id: _this.params.id, rowVersion: _this.params.rowVersion, submitUser: {name: data.name, id: data.id},
goBackKey: this.props.navigation.state.key
})
}
}
}
const styles = StyleSheet.create({
body: {
flex: 1,
flexDirection: "column",
backgroundColor: "#ecf0f3",
},
});