import React, {Component} from 'react';
import {
View,
TouchableOpacity,
Image,
Text,
RefreshControl,
FlatList,
ActivityIndicator,
} from 'react-native';
import {
DatePicker,
Drawer,
List,
Provider,
Tabs,
Picker,
InputItem,
SwipeAction,
} from '@ant-design/react-native';
import public_css from '../../source/css/public_css';
import operation_audit_css from './operation_audit_css';
import enterprise_css from '../enterpriseInformation/enterprise_css';
import {RetrieveData} from '../../data/storage';
import {GetDataPost} from '../../data/encryption';
import moment from 'moment';
let pageNo = 1; //当前第几页
let totalPage = 5; //总的页数
export default class operation_audit_list extends Component {
constructor(props) {
super(props);
this.props.navigation.dangerouslyGetParent().setOptions({
tabBarVisible: false,
});
this.state = {
listData: [],
search_data: '',
showFoot: 0, // 控制foot, 0:隐藏footer 1:已加载完成,没有更多数据 2 :显示加载中
isLoading: false,
operaterName: '',
operaterMobile: '',
opType: '',
clickNum: 0,
visible1: false,
beginDateTime: undefined,
endDateTime: undefined,
};
}
render() {
let draw = (
,
nextState: Readonly,
nextContext: any,
): boolean {
if (nextProps.route.params != undefined) {
if (nextProps.route.params.isShow) {
console.log(this.state.clickNum);
if (this.state.clickNum === 0) {
this.setState({
isShowSearch: true,
clickNum: this.state.clickNum++,
});
this.drawer.openDrawer();
this.props.navigation.setParams({
isShow: false,
});
}
}
}
return true;
}
//获取查询数据
getOperationData = async () => {
let beginTime = '';
let endTime = '';
if (this.state.beginDateTime != undefined) {
beginTime = moment(this.state.beginDateTime).format('YYYY-MM-DD');
beginTime = beginTime + ' 00:00:00';
}
if (this.state.endDateTime != undefined) {
endTime = moment(this.state.endDateTime).format('YYYY-MM-DD');
endTime = endTime + ' 23:59:59';
}
let account = await RetrieveData('account');
let token = await RetrieveData('token');
if (token && account) {
account = account.substring(1, account.length - 1);
token = token.substring(1, token.length - 1);
const url = 'https://app.taxbk.cn:9443/auth/log/findPage';
GetDataPost(
url,
token,
{
mobile: account,
operaterMobile: this.state.operaterMobile,
operaterName: this.state.operaterName,
createBeginTime: beginTime,
createEndTime: endTime,
opType: this.state.opType,
pageNum: pageNo,
pageSize: 10,
},
false,
2,
).then((res) => {
console.log(res);
totalPage = res.data.pages;
this.setList(res.data.records);
});
}
};
//设置客户数据列表
setList = (data) => {
let listDatas = data.map((_, i) => ({
key: data[i].id,
userName: data[i].userName,
mobile: data[i].mobile,
opType: data[i].opType,
opDesc: data[i].opDesc,
ip: data[i].ip,
createTime: data[i].createTime,
}));
let list = this.state.listData.concat(listDatas);
this.setState({
listData: list,
showFoot: 0,
});
};
//加载客户列表数据
renderItem = (data) => (