import * as React from 'react';
import './index.scss'
import ViewMore from '../common/viewMore'
import Header from '../common/header'
import DetailItem from './DetailItem'
import { getApiUrl,taker } from '&/helper'
import NodataView from '&/components/common/noDataView'
interface headData{
columns:Array
}
interface col{
name:string,
title:string,
realTitle:string
}
interface bodyData{
}
interface tarData{
}
export default class MobileVacationDetail extends React.Component<{},{data:any}>{
state={data:[]}
refs:any
componentDidMount(){
this.refs.wrap.parentElement.style.padding = '';
this.refs.wrap.parentElement.style.margin = '0px 10px';
}
async componentWillMount(){
this.state={ data:[] }
const headUrl = getApiUrl(`proxy/ocean/GetGridHeader?app_name=italentMobile&componentId=e5509eb3-14e2-43da-af9a-6c85b192990b`)
const url = getApiUrl(`proxy/ocean/GetGridData?app_name=italentMobile&componentId=e5509eb3-14e2-43da-af9a-6c85b192990b&iDisplayStart=0&iDisplayLength=3`);
let headData = await taker(headUrl);
let bodyData = await taker(url);
if(!headData) return;
let trueHeadData = headData.data;
let trueBodayData = bodyData.data.aaData;
this.setState({data:this.fixData(trueHeadData,trueBodayData)});
}
fixData = (head:headData,body:Array) => {
let tempData:Array = [];
body.map((d:bodyData,k:number)=>{
let tempDataChild:tarData = {}
head.columns.map((h:col,hk:number)=>{
tempDataChild[h.realTitle] = d[h.name]
})
tempData.push(tempDataChild)
})
return tempData;
}
render(){
const { data } = this.state;
return
{data && data.length > 0 ?
{ data.map((d:any,k:number)=>) }
:
}
}
}