zoukankan      html  css  js  c++  java
  • react dva 相关

    models

    /**
    * Created by AndyCui on 2018/12/3.
    */
    import {
    getWallet,
    getApplyChar,
    getResourcesCount,
    getRecruitmentList,
    getToDos,
    } from '../../services/CompoanyIndex';

    const COMMON_LOADING = 'commonLoading';//请求中
    const COMMON_LOAD_SUCCESS = 'commonLoadSuccess';//请求成功
    const COMMON_LOAD_FAIL = 'commonLoadFail';//请求失败


    export default {
    namespace: 'companyIndex',
    state:{
    walletData:{//获取钱包数据
    data: {}
    },
    applyCharData:{//获取应聘状态数据
    data: {
    content: []
    }
    },
    resourcesCount:{//获取(收到的应聘,个人简历池。。。的个数)
    data: {
    content: []
    }
    },
    recruitmentListData:{//获取实时招聘数据列表
    data: {
    content: []
    }
    },
    toDosData: { // 代办事项
    data: {
    content: []
    }
    }
    },
    effects:{
    *getToDos({ payload }, { call, put }) {
    yield put({
    type: COMMON_LOADING,
    stateKey: 'toDosData'
    });
    const data = yield call(getToDos);
    if (data && data.code === 200) {
    yield put({
    type: COMMON_LOAD_SUCCESS,
    stateKey: 'toDosData',
    result: {
    content: data.data,
    dataMessage: data.message,
    dataCode: data.code
    }
    });
    } else {
    yield put({
    type: COMMON_LOAD_FAIL,
    stateKey: 'toDosData',
    error: data
    });
    }
    },
    *getRecruitmentList({ payload },{ call, put }){//获取实时招聘数据列表
    yield put({
    type: COMMON_LOADING,
    stateKey: 'recruitmentListData'
    });
    const data = yield call(getRecruitmentList);
    if (data && data.code === 200) {
    yield put({
    type: COMMON_LOAD_SUCCESS,
    stateKey: 'recruitmentListData',
    result: {
    content:data.data,
    dataMessage: data.message,
    dataCode: data.code
    }
    });
    } else {
    yield put({
    type: COMMON_LOAD_FAIL,
    stateKey: 'recruitmentListData',
    error: data
    });

    }
    },
    *getResourcesCount({ payload },{ call, put }){//获取(收到的应聘,个人简历池。。。的个数)
    yield put({
    type: COMMON_LOADING,
    stateKey: 'resourcesCount'
    });
    const data = yield call(getResourcesCount);
    if (data && data.code === 200) {
    yield put({
    type: COMMON_LOAD_SUCCESS,
    stateKey: 'resourcesCount',
    result: {
    content:data.data,
    dataMessage: data.message,
    dataCode: data.code
    }
    });
    } else {
    yield put({
    type: COMMON_LOAD_FAIL,
    stateKey: 'resourcesCount',
    error: data
    });

    }
    },
    *getApplyChar({ payload },{ call, put }){//获取应聘状态数据
    yield put({
    type: COMMON_LOADING,
    stateKey: 'applyCharData'
    });
    const data = yield call(getApplyChar,payload.parms);
    if (data && data.code === 200) {
    yield put({
    type: COMMON_LOAD_SUCCESS,
    stateKey: 'applyCharData',
    result: {
    content: data.data,
    dataMessage: data.message,
    dataCode: data.code
    }
    });
    payload.callback();
    } else {
    yield put({
    type: COMMON_LOAD_FAIL,
    stateKey: 'applyCharData',
    error: data
    });
    // message.error(data && data.message || '请求失败...');
    }
    },
    *getWallet({ payload },{ call, put }){//获取钱包数据
    yield put({
    type: COMMON_LOADING,
    stateKey: 'walletData'
    });
    const data = yield call(getWallet);
    if (data && data.code === 200) {
    yield put({
    type: COMMON_LOAD_SUCCESS,
    stateKey: 'walletData',
    result: {
    ...data.data,
    dataMessage: data.message,
    dataCode: data.code
    }
    });
    } else {
    yield put({
    type: COMMON_LOAD_FAIL,
    stateKey: 'walletData',
    error: data
    });
    // message.error(data && data.message || '请求失败...');
    }
    },

    },

    reducers: {
    /**
    * 通用加载中 reducer
    * @param state
    * @param action
    * @returns {{}}
    */
    [COMMON_LOADING](state, action) {
    return {
    ...state,
    [action.stateKey]: {
    ...state[action.stateKey],
    loading: true,
    loaded: false
    }
    };
    },

    /**
    * 通用加载完成 reducer
    * @param state
    * @param action
    * @returns {{}}
    */
    [COMMON_LOAD_SUCCESS](state, action) {
    return {
    ...state,
    [action.stateKey]: {
    ...state[action.stateKey],
    loading: false,
    loaded: true,
    data: action.result
    }
    };
    },

    /**
    * 通用加载失败 reducer
    * @param state
    * @param action
    * @returns {{}}
    */
    [COMMON_LOAD_FAIL](state, action) {
    return {
    ...state,
    [action.stateKey]: {
    ...state[action.stateKey],
    loading: false,
    loaded: false,
    error: action.error
    }
    };
    },

    updateState(state, action) {
    return {
    ...state,
    ...action.payload
    };
    },

    /**
    * 设置页码
    * @param state
    * @param action
    * @returns {{allJobs: {pagination: {total: (number|*)}}}}
    */
    setPagination(state, action) {
    return {
    ...state,
    [action.stateKey]: {
    ...state[action.stateKey],
    pagination: {
    ...state[action.stateKey].pagination,
    ...action.payload
    }
    }
    };
    },
    },
    };
    routers
    /**
    * Created by AndyCui on 2018/11/22.
    */
    import React ,{ Component } from 'react';
    import { connect } from 'dva';
    import { browserHistory } from 'dva/router';
    import G2 from '@antv/g2';
    import styles from './CompanyIndex.less';
    import { DatePicker,Carousel, Modal,Tooltip } from 'antd';
    import { Loader } from '../../components'
    import moment from 'moment';
    import {sendMessage} from "../../utils/utils";

    @connect((state) => ({
    loading: state.loading,
    companyIndex: state.companyIndex,
    auth: state.auth,
    team:state.team,
    app: state.app,
    }))
    class CompanyIndex extends Component {

    constructor(props, context) {
    super(props);
    this.state = {
    isCarouselShow:true,
    display_style: 'none', //此状态机为display的取值
    item: {},//初始化循环的每一项,供简历详情弹框使用
    type: "项目总计",
    value: 500,
    startValue: null,
    endValue: null,
    endOpen: false,
    currentTime: null,
    charShow1: "block",
    charShow2: "none",
    charShow3: "none",
    chart: null,
    chart1: null,
    chart2: null,
    showToday: false,
    autoplaySpeed: 4000,
    customerService: true,
    startX: null,
    endX: null,
    click: true,
    visible: false,
    allowClear:false,
    data:[
    { status: '已应聘1',month:"一月", value:200 },
    { status: '已应聘1',month:"二月", value:210 },
    { status: '已应聘1',month:"三月", value:240 },
    { status: '已应聘1',month:"四月", value:280 },
    { status: '已应聘1',month:"五月", value:240 },
    { status: '已应聘1',month:"六月", value:150 },
    { status: '已面试',month:"一月", value:250 },
    { status: '已面试',month:"二月", value:280 },
    { status: '已面试',month:"三月", value:250 },
    { status: '已面试',month:"四月", value:210 },
    { status: '已面试',month:"五月", value:250 },
    { status: '已面试',month:"六月", value:280 },
    { status: '已办签',month:"一月", value:250 },
    { status: '已办签',month:"二月", value:270 },
    { status: '已办签',month:"三月", value:250 },
    { status: '已办签',month:"四月", value:260 },
    { status: '已办签',month:"五月", value:250 },
    { status: '已办签',month:"六月", value:250 },
    { status: '已办结',month:"一月", value:270 },
    { status: '已办结',month:"二月", value:250 },
    { status: '已办结',month:"三月", value:280 },
    { status: '已办结',month:"四月", value:260 },
    { status: '已办结',month:"五月", value:250 },
    { status: '已办结',month:"六月", value:200 },
    ]
    };
    }
    componentDidMount() {
    const { dispatch } = this.props;
    dispatch({
    type: 'companyIndex/getWallet',
    });
    dispatch({
    type: 'companyIndex/getResourcesCount',
    });
    dispatch({
    type: 'companyIndex/getRecruitmentList',
    });
    const date = new Date();
    dispatch({
    type: 'companyIndex/getApplyChar',
    payload: {
    parms: {
    startTime: moment(new Date(date.getFullYear(), (date.getMonth() - 6), 1)).format('YYYY-MM-DD'),
    endTime: moment(new Date(date.getFullYear(), (date.getMonth()), 0)).format('YYYY-MM-DD'),
    },
    callback: () => {
    this.state.chart.changeData(this.props.companyIndex.applyCharData.data.content || [])
    }
    }
    });
    // 获取代办事项
    dispatch({
    type: 'companyIndex/getToDos',
    payload: {}
    });

    const chart = new G2.Chart({
    container: "charShow1", // 指定图表容器 ID
    forceFit: true, // 指定图表宽度
    height: 200, // 指定图表高度
    padding: [30, 40, 40, 40],//图表的大小
    });
    chart.source();
    chart.interval().position('month*number').color("msg", ["#9465eb", "#ffac5c", "#f1696a", "#28d7d8"]).adjust([{
    type: 'dodge',
    marginRatio: 10 / 32
    }])
    chart.legend({
    position:'top-right'
    })
    chart.render();
    this.setState({
    chart,
    charShow1: "block",
    charShow2: "none",
    charShow3: "none",
    endValue: moment(new Date(this.Month(-1)).valueOf()),
    startValue: moment(new Date(this.Month(-6)).valueOf()),
    })

    }
    //组件将被卸载
    componentWillUnmount(){
    this.setState({
    isCarouselShow:false
    })
    }
    small_up=(e)=>{//处理拖动结束触发点击事件的问题
    var endX = e.clientX;
    this.setState({
    endX:endX
    },()=>{
    if(Math.abs(this.state.endX-this.state.startX)<=5 ){
    this.customerService()
    }
    }
    )

    }
    small_down=(e)=> {//处理拖拽
    var obig = this.refs.move.parentNode;
    var osmall = this.refs.move;
    var e = e || window.event;
    /*用于保存小的div拖拽前的坐标*/
    osmall.startX = e.clientX - osmall.offsetLeft;
    osmall.startY = e.clientY - osmall.offsetTop;
    var startX=e.clientX
    this.setState({
    startX:startX
    })
    /*鼠标的移动事件*/
    document.onmousemove = function(e) {
    var e = e || window.event;
    osmall.style.left = e.clientX - osmall.startX + "px";
    osmall.style.top = e.clientY - osmall.startY + "px";
    /*对于大的DIV四个边界的判断*/
    let x=obig.offsetWidth-osmall.offsetWidth
    let y=obig.offsetHeight-osmall.offsetHeight
    if (e.clientX - osmall.startX <= 270) {
    osmall.style.left = 220 + "px";
    }

    if (e.clientY - osmall.startY <= 50) {
    osmall.style.top = 0 + "px";
    }
    if (e.clientX - osmall.startX >= x +170) {
    osmall.style.left = (x+220) + "px";
    }
    if (e.clientY - osmall.startY >= y-50) {
    osmall.style.top = y + "px";
    }
    };
    /*鼠标的抬起事件,终止拖动*/
    document.onmouseup = function() {
    document.onmousemove = null;
    document.onmouseup = null;
    };
    }
    //处理当前时间前后的日期范围
    Month(month) {
    var time = new Date();
    time.setDate(time.getDate());//获取Day天后的日期
    var y = time.getFullYear();
    var m;
    if (time.getMonth() + month + 1>12){
    y = y+1;
    m = time.getMonth() + month - 11;//获取当前月份的日期 d
    }else{
    m = time.getMonth() + month + 1;//获取当前月份的日期 d
    }
    var d = time.getDate();
    return y + "-" + m + "-" + d;
    }
    getdate(now) {//处理日期格式

    let y = now.getFullYear();
    let m = now.getMonth() + 1;
    let d = now.getDate();
    return y + "-" + (m < 10 ? "0" + m : m) + "-" + (d < 10 ? "0" + d : d) + " " + now.toTimeString().substr(0, 5);

    }
    disabledStartDate = (startValue) => {
    const endValue = this.state.endValue;
    if (!startValue || !endValue) {
    return false;
    }
    return startValue.valueOf() > endValue.valueOf() || startValue.valueOf()<new Date(this.Month(-6)).valueOf();
    }
    disabledEndDate = (endValue) => {
    const startValue = this.state.startValue;
    if (!endValue || !startValue) {
    return false;
    }
    return endValue.valueOf()>new Date(this.Month(-1)).valueOf() || endValue.valueOf()<=startValue.valueOf();
    }
    /**
    * onChange 选择时间发生改变出发
    */
    onChange = (field, value) => {
    this.setState({
    [field]: value,
    endOpen: false
    },()=>{//根据时间发请求
    const startTime = new Date(this.state.startValue.valueOf());
    const endTime = new Date(this.state.endValue.valueOf());
    this.props.dispatch({
    type: 'companyIndex/getApplyChar',
    payload: {
    parms:{
    startTime: moment(new Date(startTime.getFullYear(), (startTime.getMonth()), 1)).format('YYYY-MM-DD'),
    endTime: moment(new Date(endTime.getFullYear(), (endTime.getMonth() + 1), 0)).format('YYYY-MM-DD'),
    },
    callback: () => {
    this.state.chart.changeData(this.props.companyIndex.applyCharData.data.content)
    }
    }
    });
    });

    }
    onStartChange = (value) => {
    this.onChange('startValue', value);
    this.setState({
    endOpen: false
    })

    }
    onEndChange = (value) => {
    this.onChange('endValue', value);
    this.setState({
    endOpen: false
    })
    }
    handleStartOpenChange = (open) => {
    if (!open) {
    this.setState({ endOpen: true });
    }
    }
    handleEndOpenChange = (open) => {
    this.setState({ endOpen: open });
    }

    // 待办事项跳转应聘详情
    goApplyDetail = (item) => {
    browserHistory.push(`/applyment/applymentDetail?applyId=${item.applyId}&status=1&cursor=0&jobName=全部岗位&jobId=`);
    }
    charShow1(){
    this.setState({
    charShow1:"block",
    charShow2:"none",
    charShow3:"none",
    data:[
    { status: '已应聘1',month:"一月", value:200 },
    { status: '已应聘1',month:"二月", value:210 },
    { status: '已应聘1',month:"三月", value:240 },
    { status: '已应聘1',month:"四月", value:280 },
    { status: '已应聘1',month:"五月", value:240 },
    { status: '已应聘1',month:"六月", value:150 },
    { status: '已面试',month:"一月", value:250 },
    { status: '已面试',month:"二月", value:280 },
    { status: '已面试',month:"三月", value:250 },
    { status: '已面试',month:"四月", value:210 },
    { status: '已面试',month:"五月", value:250 },
    { status: '已面试',month:"六月", value:280 },
    { status: '已办签',month:"一月", value:250 },
    { status: '已办签',month:"二月", value:270 },
    { status: '已办签',month:"三月", value:250 },
    { status: '已办签',month:"四月", value:260 },
    { status: '已办签',month:"五月", value:250 },
    { status: '已办签',month:"六月", value:250 },
    { status: '已办结',month:"一月", value:270 },
    { status: '已办结',month:"二月", value:250 },
    { status: '已办结',month:"三月", value:280 },
    { status: '已办结',month:"四月", value:260 },
    { status: '已办结',month:"五月", value:250 },
    { status: '已办结',month:"六月", value:200 },
    ]
    },()=>{
    /* this.state.chart.changeData(this.state.data)*/
    })
    }
    charShow2(){
    this.setState({
    charShow1:"none",
    charShow2:"block",
    charShow3:"none"
    })
    }
    charShow3(){
    this.setState({
    charShow1:"none",
    charShow2:"none",
    charShow3:"block"
    })
    }
    showModal(){//展示视频弹框
    this.setState({
    visible: true,
    });
    }
    handleCancel=()=>{//关闭视频弹框
    this.setState({
    visible: false,
    });
    }
    goIndex(){//去主页
    browserHistory.push('/users/my');
    }
    goRight(){//去相关权益页面/team/teamPoint
    browserHistory.push('/team/teamPoint');
    }
    goTalHosting(){//托管中金额
    browserHistory.push('/money/depositMoney');
    }
    goTalBalance(){//我的余额
    browserHistory.push('/money/myBalance');
    }
    goApply(){//应聘界面/applyment/applyments
    browserHistory.push('/applyment/applyments');
    }
    goResume(){//个人简历池
    browserHistory.push('/resume/myResumes');
    }
    goJob(){//经营的岗位/jobManage/myJobs
    browserHistory.push('/jobManage/myJobs');
    }
    goJobs(){//岗位池
    browserHistory.push('/agent/myAgentJobs');
    }
    dianBanMore(){//查看更多
    browserHistory.push('/applyment/applyments');
    }
    customerService(){//客服
    const { serviceTarget } = this.props.app;
    sendMessage({
    targetId: serviceTarget.uid
    });
    }
    taskCenterOrder(){//去完成 订单任务
    browserHistory.push('/applyment/applyments');
    }
    taskCenterRecommended(){//去完成 推荐企业入驻
    browserHistory.push('/recommend/company');
    }
    taskCenterRelease(){//去完成 发布岗位
    browserHistory.push('/job/addNewJob');
    }
    taskCenterRgent(){//去完成 代理岗位
    browserHistory.push('/agent/myAgentJobs');
    }
    render() {
    const { companyIndex, loading, auth, team} = this.props;
    const { walletData,resourcesCount,recruitmentListData, toDosData } = companyIndex;
    const companySupportArr=Object.keys(auth && auth.companySupport);
    const { isCarouselShow } = this.state;
    let recruitmentListDataArr=(recruitmentListData && recruitmentListData.data && recruitmentListData.data.content) || [];
    let carWrap=[];//定义轮播片数量
    let firstCar=[];
    let secondCar=[];
    let thirdCar=[];
    if(recruitmentListDataArr.length>=12){
    for (var i=0;i<4;i++){
    firstCar.push(recruitmentListDataArr[i])
    }
    for (var i=4;i<8;i++){
    secondCar.push(recruitmentListDataArr[i])
    }
    for (var i=8;i<12;i++){
    thirdCar.push(recruitmentListDataArr[i])
    }
    }else if(recruitmentListDataArr.length>=8 && recruitmentListDataArr.length<12){
    for (var i=0;i<4;i++){
    firstCar.push(recruitmentListDataArr[i])
    }
    for (var i=4;i<8;i++){
    secondCar.push(recruitmentListDataArr[i])
    }
    for (var i=8;i<recruitmentListDataArr.length;i++){
    thirdCar.push(recruitmentListDataArr[i])
    }

    }else if(recruitmentListDataArr.length>=4 && recruitmentListDataArr.length<8){
    for (var i=0;i<4;i++){
    firstCar.push(recruitmentListDataArr[i])
    }
    for (var i=4;i<recruitmentListDataArr.length;i++){
    secondCar.push(recruitmentListDataArr[i])
    }
    }else if(recruitmentListDataArr.length>0 && recruitmentListDataArr.length<4){
    for (var i=0;i<recruitmentListDataArr.length;i++){
    firstCar.push(recruitmentListDataArr[i])
    }
    }
    if(firstCar.length>0){
    carWrap.push(firstCar)
    }
    if(secondCar.length>0){
    carWrap.push(secondCar)
    }
    if(thirdCar.length>0){
    carWrap.push(thirdCar)
    }

    const resourcesData = (resourcesCount && resourcesCount.data && resourcesCount.data.content) || [];
    let receiveApply = '';
    let personResumes = '';
    let myJobs = '';
    let allJobs = '';
    resourcesData.forEach((item) => {//遍历出资源列表的每一项
    if(item.type === 1) {
    receiveApply = item;
    } else if(item.type === 2) {
    personResumes = item;
    } else if(item.type === 3) {
    myJobs = item;
    } else if(item.type === 4) {
    allJobs = item;
    }
    });
    const {teamPoint} = team;
    const { startValue, endValue, endOpen } = this.state;
    const { MonthPicker } = DatePicker;
    return (
    <div className={styles.wrap}>
    <div className={styles.contentWrap}>
    <div className={styles.contentheder}>
    <div className={styles.contenthederLeft}>
    <div className={styles.avatarWrap}>
    <div className={styles.avatar}>
    <img src={auth && auth.avatar} alt=""/>
    </div>
    </div>
    <div className={styles.discribe}>
    <div className={styles.level}>
    <span>{auth && auth.name}</span>
    {
    auth.qualification ? <span>商务资质</span> : ""
    }
    <span>L{teamPoint && teamPoint.level}</span>
    </div>
    <div className={styles.name}>
    {
    auth.userCompanyRole === 1 ? <span>管理员</span> : <span>业务员</span>

    }

    </div>
    <div title={auth && auth.companyName} className={styles.company}><span>{auth.companyName}</span></div>
    </div>
    <div className={styles.link + " " + styles.clearfix}>
    <div className={styles.linkWrap + " " + styles.clearfix}>
    <div className={styles.goIndex}><span onClick={() => this.goIndex()}>进入主页</span>
    </div>
    <div className={styles.goRight}><span onClick={() => this.goRight()}>查看权益</span>
    </div>
    </div>
    </div>
    </div>
    <div className={styles.contenthederCenter}></div>
    <div className={styles.contenthederRight}>
    <div className={styles.TotalHosting} onClick={() => this.goTalHosting()}>
    <p>托管中金额 ></p>
    <p title={walletData && walletData.data && walletData.data.guarantee}>{walletData && walletData.data && walletData.data.guarantee}<span>(元)</span></p>
    </div>
    <div className={styles.line}>
    </div>
    <div className={styles.TotalBalance} onClick={() => this.goTalBalance()}>
    <p>我的余额 ></p>
    <p title={walletData && walletData.data && walletData.data.balance}>{walletData && walletData.data && walletData.data.balance}<span>(元)</span></p>
    </div>
    </div>
    </div>
    <div className={styles.contentOne}>

    <div className={styles.contentOneLeft + " " + styles.clearfix}>
    <div className={styles.contentOneApply + " " + styles.clearfix}
    onClick={() => this.goApply()}>
    <div className={styles.iconWrap + " " + styles.clearfix}>
    <div className={styles.icon + " " + styles.clearfix}>
    </div>
    </div>
    <div className={styles.text + " " + styles.clearfix}>
    <p className={styles.count + " " + styles.clearfix}>
    <span>{receiveApply && receiveApply.number}</span>
    <span>个</span>
    </p>
    <p className={styles.title + " " + styles.clearfix}>
    <span>{receiveApply && receiveApply.msg}</span>
    </p>
    </div>
    </div>
    <div className={styles.contentOneResume + " " + styles.clearfix}
    onClick={() => this.goResume()}>
    <div className={styles.iconWrap + " " + styles.clearfix}>
    <div className={styles.icon + " " + styles.clearfix}>
    </div>
    </div>
    <div className={styles.text + " " + styles.clearfix}>
    <p className={styles.count + " " + styles.clearfix}>
    <span>{personResumes && personResumes.number}</span>
    <span>个</span>
    </p>
    <p className={styles.title + " " + styles.clearfix}>
    <span>{personResumes && personResumes.msg}</span>
    </p>
    </div>
    </div>
    </div>
    <div className={styles.contentOneRight}>
    <div className={styles.contentOneJob} onClick={() => this.goJob()}>
    <div className={styles.iconWrap + " " + styles.clearfix}>
    <div className={styles.icon + " " + styles.clearfix}>
    </div>
    </div>
    <div className={styles.text + " " + styles.clearfix}>
    <p className={styles.count + " " + styles.clearfix}>
    <span>{myJobs && myJobs.number}</span>
    <span>个</span>
    </p>
    <p className={styles.title + " " + styles.clearfix}>
    <span>{myJobs && myJobs.msg}</span>
    </p>
    </div>

    </div>
    <div className={styles.contentOneJobs} onClick={() => this.goJobs()}>
    <div className={styles.iconWrap + " " + styles.clearfix}>
    <div className={styles.icon + " " + styles.clearfix}>

    </div>
    </div>
    <div className={styles.text + " " + styles.clearfix}>
    <p className={styles.count + " " + styles.clearfix}>
    <span>{allJobs && allJobs.number}</span>
    <span>个</span>
    </p>
    <p className={styles.title + " " + styles.clearfix}>
    <span>{allJobs && allJobs.msg}</span>
    </p>
    </div>
    </div>
    </div>
    </div>
    <div className={styles.contentTwo}>
    <div className={styles.contentTwoLeft + " " + styles.clearfix}>

    <div className={styles.dateAndTabs}>
    <span className={styles.dateAndTabsApply}>应聘状态</span>
    <span>创建日期:</span>
    <div className={styles.timeStart + " " + styles.time}>
    <MonthPicker
    getCalendarContainer={trigger => trigger.parentNode}
    allowClear={this.state.allowClear}
    disabledDate={this.disabledStartDate}
    format="YYYY-MM"
    value={startValue}
    placeholder="start"
    onChange={this.onStartChange}
    onOpenChange={this.handleStartOpenChange}
    style={{ "120px"}}
    />
    </div>
    <span> 到:</span>
    <div className={styles.timeEnd + " " + styles.time}>
    <MonthPicker
    getCalendarContainer={trigger => trigger.parentNode}
    allowClear={this.state.allowClear}
    disabledDate={this.disabledEndDate}
    format="YYYY-MM"
    value={endValue}
    placeholder="End"
    onChange={this.onEndChange}
    open={endOpen}
    onOpenChange={this.handleEndOpenChange}
    style={{ "120px"}}
    />
    </div>

    </div>
    <div className={styles.tabs} style={{display: "none"}}>
    <div onClick={() => this.charShow1()}>应聘状态</div>
    <div onClick={() => this.charShow2()}>意向转化</div>
    <div onClick={() => this.charShow3()}>热刚趋势</div>
    </div>
    <div className={styles.intervalChar} style={{display: this.state.charShow1}}>

    <Loader spinning={loading.effects['companyIndex/getApplyChar']} loadingText="加载中..."/>

    <div id="charShow1" className={styles.charShow1Style}></div>

    </div>
    <div className={styles.intervalChar} style={{display: this.state.charShow2}} id="charShow2">
    <div className={styles.charShow1Title}>意向转化环比效率</div>
    </div>
    <div className={styles.intervalChar} style={{display: this.state.charShow3}} id="charShow3">
    <div className={styles.charShow1Title}>热刚趋势</div>
    </div>
    </div>
    <div className={styles.contentTwoRight}>
    <div className={styles.taskCenter}>
    <div>任务中心</div>
    <p><span>订单任务</span><span onClick={() => {
    this.taskCenterOrder()
    }}>去完成</span></p>
    <p><span>推荐企业入驻</span><span onClick={() => {
    this.taskCenterRecommended()
    }}>去完成</span></p>
    <p><span>发布岗位</span><span onClick={() => {
    this.taskCenterRelease()
    }}>去完成</span></p>
    <p><span>代理岗位</span><span onClick={() => {
    this.taskCenterRgent()
    }}>去完成</span></p>
    </div>
    <div className={styles.tool}>
    <div>小工具</div>
    <p className={styles.toolTip}>暂未开放</p>
    </div>
    </div>
    </div>
    <div className={styles.contentThree}>
    <div className={styles.contentThreeLeft}>
    <div className={styles.zhaopin}>实时招聘</div>
    <div className={styles.zhaopinListWrap}>
    {
    isCarouselShow &&
    <Carousel vertical autoplay autoplaySpeed={this.state.autoplaySpeed}>
    {
    carWrap.length > 0 ?
    carWrap.map((items, indexs) => {
    return (
    <div className={styles.zhaopinCardWrap} key={indexs}>
    <div className={styles.zhaopinList}>
    {
    items.map((item, index) => {
    return (
    <div className={styles.zhaopinwrap}
    key={index}>
    <div>{item.name} &nbsp;&nbsp;&nbsp;({item.contactPhone})</div>
    <div>应聘</div>
    <div style={{
    '100%',
    textOverflow: 'ellipsis',
    whiteSpace: 'nowrap',
    overflow: 'hidden',
    cursor: 'pointer'
    }}>
    <Tooltip
    placement={'topLeft'}
    title={item.post && Array.isArray(item.post) &&
    item.post.map(item => item.name).join('、')}>
    {
    item.post && Array.isArray(item.post) &&
    item.post.map(item => item.name).join('、')
    }
    </Tooltip>
    </div>
    <div>{this.getdate(new Date(item.payTime))}</div>
    <div style={{
    '100%',
    textOverflow: 'ellipsis',
    whiteSpace: 'nowrap',
    overflow: 'hidden',
    cursor: 'pointer'
    }}>
    <Tooltip
    placement={'topLeft'}
    title={item.companyName}>
    {item.companyName}
    </Tooltip>
    </div>
    </div>
    )
    })
    }
    </div>
    </div>
    )
    }) : <div className={styles.zhaopinCardWrap}>
    <div className={styles.zhaopinList}>
    <p style={{display: "none"}}>暂无内容</p>
    </div>
    </div>
    }
    </Carousel>
    }

    </div>
    </div>
    <div className={styles.contentThreeRight}>
    <div className={styles.daiban}>
    <div className={styles.daibanTitle}>待办事项</div>
    <div className={styles.daibanListWrap}>
    {
    toDosData && toDosData.data && toDosData.data.content && Array.isArray(toDosData.data.content) &&
    toDosData.data.content.length ?
    toDosData.data.content.map((item) =>
    <div
    style={{
    padding: '6px 0'
    }}
    onClick={() => this.goApplyDetail(item)}
    key={item.applyId}
    className={styles.daibanChildrens}>
    <span>{item.projectType}-{item.price}</span>
    <span>{item.describe}</span>
    <span>{item.createTime && moment(item.createTime).format('YYYY-MM-DD')}</span>
    </div>) :<p className={styles.daibanTip}>暂无内容</p>

    }
    {
    true? '': <div>
    <div
    className={styles.daibanChildrens}>
    <span>啊哈哈哈-24W</span>
    <span>带面试</span>
    <span>2015-10-24</span>
    </div>
    <div
    className={styles.daibanChildrens}>
    <span>啊哈哈哈-24W</span>
    <span>带面试</span>
    <span>2015-10-24</span>
    </div>
    <div
    className={styles.daibanChildrens}>
    <span>啊哈哈哈-24W</span>
    <span>带面试</span>
    <span>2015-10-24</span>
    </div>
    <div
    className={styles.daibanChildrens}>
    <span>啊哈哈哈-24W</span>
    <span>带面试</span>
    <span>2015-10-24</span>
    </div>
    <div
    className={styles.daibanChildrens}>
    <span>啊哈哈哈-24W</span>
    <span>带面试</span>
    <span>2015-10-24</span>
    </div>
    <div
    className={styles.daibanChildrens}>
    <span>啊哈哈哈-24W</span>
    <span>带面试</span>
    <span>2015-10-24</span>
    </div>
    </div>
    }


    </div>
    <div onClick={() => {
    this.dianBanMore()
    }}>查看更多
    </div>
    </div>
    <div className={styles.learn}>
    <div>学习园地</div>
    {

    true ? <p style={{textAlign: "center"}}>暂无内容</p> :
    <div className={styles.learnChildren}><span onClick={() => this.showModal()}>面点师-20Wghfgh fgh </span><span>2018-09-23</span>
    </div>

    }

    </div>
    </div>
    </div>
    <div className={styles.contentfooter}>

    <div className={styles.clearfix}>
    <span>客服电话:400-9688-920</span>
    {
    companySupportArr.length == 0 ? "" :
    <span>商家支持:{auth && auth.companySupport && auth.companySupport.mobile || ""}</span>
    }

    </div>

    </div>
    </div>
    <div ref="move" className={styles.move} onMouseDown={e => this.small_down(e)}
    onMouseUp={e => this.small_up(e)} style={{
    position: "fixed",
    left: `${this.state.translateX}px`,
    top: `${this.state.translateY}px`,
    100,
    height: 100,
    textAlign: 'center'
    }}>
    <i className="iconfont icon-customerservice" style={{fontSize: "70px", color: '#1296db'}}></i>
    <div className={styles.service}>客服</div>
    </div>
    <Modal
    title="观看视频"
    visible={this.state.visible}
    footer={null}
    onCancel={this.handleCancel}
    width="800px"
    centered="true"
    >
    <div className={styles.modal}></div>
    </Modal>
    </div>
    );
    }
    }
    export default CompanyIndex

    services

    /**
    * Created by AndyCui on 2018/12/3.
    */
    import {cFetch} from '../utils';

    /**
    * 获取钱包数据
    * @returns {*}
    */
    export async function getWallet () {
    return cFetch('/wallet/getWallet', {
    method: 'GET',
    })
    }
    /**
    * 获取应聘状态数据
    * @returns {*}
    */
    export async function getApplyChar (parms) {
    return cFetch(`/us/v1/dashboards/apply?startTime=${parms.startTime}&endTime=${parms.endTime}`, {
    method: 'GET',
    })
    }
    /**
    * 获取(收到的应聘,个人简历池。。。的个数)
    * @returns {*}
    */
    export async function getResourcesCount () {
    return cFetch('/us/v1/dashboards', {
    method: 'GET',
    })
    }
    /**
    * 获取实时招聘数据列表
    * @returns {*}
    */
    export async function getRecruitmentList () {
    return cFetch('/ap/v1/cases', {
    method: 'GET',
    })
    }

    /**
    * 获取待办事项
    * @returns {Promise<*>}
    */
    export async function getToDos() {
    return cFetch('/ap/v6/apply/todo', {
    method: 'GET',
    })
    }

    routers
    import React from 'react'
    import { Router } from 'dva/router'
    import App from './routes/app'

    const cached = {}
    const registerModel = (app, model) => {
    console.log(model.namespace);
    if (!cached[model.namespace]) {
    app.model(model)
    cached[model.namespace] = 1
    }
    }
    export default function ({ history, app }) {
    const routes = [
    {
    path: 'auth',
    getComponent(nextState, cb) {
    require.ensure([], require => {
    cb(null, require('./routes/auth/auth'));
    }, 'auth')
    }
    },
    {
    path: 'applyBusiness/:index',
    getComponent(nextState, cb) {
    require.ensure([], require => {
    cb(null, require('./routes/applyBusiness/ApplyBusiness'));
    }, 'applyBusiness')
    }
    },
    {
    path: 'newAuth/:id',
    getComponent(nextState, cb) {
    require.ensure([], require => {
    cb(null, require('./routes/newAuth/NewAuth'));
    }, 'newAuth')
    }
    },
    {
    path: 'showStatus/:index',
    getComponent(nextState, cb) {
    require.ensure([], require => {
    cb(null, require('./routes/showStatus/ShowStatus'));
    }, 'showStatus')
    }
    },
    {
    path:'applyBusinessAgain',
    getComponent(nextState, cb) {
    require.ensure([], require => {
    cb(null, require('./routes/applyBusinessAgain/ApplyBusinessAgain'));
    }, 'applyBusinessAgain')
    }
    },
    {
    path:'users/forgetPassword/:index',
    getComponent(nextState, cb) {
    require.ensure([], require => {
    cb(null, require('./routes/users/forgetPassword/forgetPassword'));
    }, 'forgetPassword')
    }
    },
    {
    path: '/',
    component: App,
    getIndexRoute(nextState, cb) {
    require.ensure([], require => {
    cb(null, { component: require('./routes/company/CompanyIndex') })
    }, 'index')
    },
    childRoutes: [
    {
    path: 'company/CompanyIndex',
    name: 'company/CompanyIndex',
    getComponent(nextState, cb) {
    require.ensure([], require => {
    // registerModel(app, require('./models/staff/resume'));
    cb(null, require('./routes/company/CompanyIndex'))
    }, 'CompanyIndex')
    }
    },
    {
    path: 'company/CompanyWatch',
    name: 'company/CompanyWatch',
    getComponent(nextState, cb) {
    require.ensure([], require => {
    // registerModel(app, require('./models/staff/resume'));
    cb(null, require('./routes/company/CompanyWatch'))
    }, 'CompanyWatch')
    }
    },
    {
    path: 'money/depositMoney',
    name: 'money/depositMoney',
    getComponent(nextState, cb) {
    require.ensure([], require => {
    cb(null, require('./routes/money/DepositMoney'))
    }, 'DepositMoney')
    }
    },
    {
    path: 'money/myBalance',
    name: 'money/myBalance',
    getComponent(nextState, cb) {
    require.ensure([], require => {
    cb(null, require('./routes/money/myBalance'))
    }, 'myBalance')
    }
    },
    {
    path: 'money/inRebate',
    name: 'money/inRebate',
    getComponent(nextState, cb) {
    require.ensure([], require => {
    cb(null, require('./routes/money/InRebate'))
    }, 'InRebate')
    }
    },
    {
    path: 'money/outRebate',
    name: 'money/outRebate',
    getComponent(nextState, cb) {
    require.ensure([], require => {
    cb(null, require('./routes/money/OutRebate'))
    }, 'OutRebate')
    }
    },
    {
    path: 'recommend/company',
    name: 'recommend/company',
    getComponent(nextState, cb) {
    require.ensure([], require => {
    cb(null, require('./routes/recommend/recommend'))
    }, 'recommend')
    }
    }, {
    path: 'team/teamPoint',
    name: 'teamPoint',
    getComponent(nextState, cb) {
    require.ensure([], require => {
    cb(null, require('./routes/team/TeamPoint/TeamPoint'), 'teamPoint')
    })
    }
    }, {
    path: 'jobManage/myJobs',
    getComponent(nextState, cb) {
    require.ensure([], require => {
    cb(null, require('./routes/jobManage/JobManage'));
    }, 'JobManage')
    }
    }, {
    path: 'agent/myAgentJobs',
    name: 'myAgentJobs',
    getComponent(nextState, cb) {
    require.ensure([], require => {
    cb(null, require('./routes/jobManage/MyAgentJobs'));
    }, 'MyAgentJobs')
    }
    },{
    path: 'job/addNewJob',
    name: 'newJob',
    getComponent(nextState, cb) {
    require.ensure([], require => {
    cb(null, require('./routes/job/AddNewJob'))
    }, 'newJob')
    }
    },{
    path: 'job/addNewTradeJob',
    name: 'newTradeJob',
    getComponent(nextState, cb) {
    require.ensure([], require => {
    cb(null, require('./routes/job/AddNewJob'))
    }, 'newTradeJob')
    }
    }, {
    path: 'resume/bestResumes',
    name: 'resume/bestResumes',
    getComponent(nextState, cb) {
    require.ensure([], require => {
    cb(null, require('./routes/resumeManage/BestResumes'))
    }, 'BestResumes')
    }
    }, {
    path: 'resume/teamResumes',
    name: 'resume/teamResumes',
    getComponent(nextState, cb) {
    require.ensure([], require => {
    cb(null, require('./routes/resumeManage/TeamResumes'))
    }, 'TeamResumes')
    }
    }, {
    path: 'resume/companyResumes',
    name: 'resume/companyResumes',
    getComponent(nextState, cb) {
    require.ensure([], require => {
    cb(null, require('./routes/resumeManage/CompanyResumes'))
    }, 'CompanyResumes')
    }
    }, {
    path: 'applyment/applyments',
    name: 'applyment/applyments',
    getComponent(nextState, cb) {
    require.ensure([], require => {
    // registerModel(app, require('./models/applyment/applyments'));
    cb(null, require('./routes/applyment/Applyments'))
    }, 'Applyments')
    }
    },{
    path: 'applyment/chooseJob',
    name: 'applyment/chooseJob',
    getComponent(nextState, cb) {
    require.ensure([], require => {
    cb(null, require('./routes/applyment/chooseJob'))
    }, 'chooseJob')
    }
    },{
    path: 'applyment/applymentDetail',
    name: 'applyment/applymentDetail',
    getComponent(nextState, cb) {
    require.ensure([], require => {
    cb(null, require('./routes/applyment/ApplymentDetail'))
    }, 'ApplymentDetail')
    }
    },{
    path: 'resume/myResumes',
    name: 'resume/myResumes',
    getComponent(nextState, cb) {
    require.ensure([], require => {
    cb(null, require('./routes/resumeManage/MyResumes'))
    }, 'MyResumes')
    }
    }, {
    path: 'users/my',
    name: 'users/my',
    getComponent(nextState, cb) {
    require.ensure([], require => {
    // registerModel(app, require('./models/users/UserInfo'));
    cb(null, require('./components/users/UserInfo'))
    }, 'my')
    }
    },
    {
    path: 'users/recordIncoming',
    name: 'users/recordIncoming',
    getComponent(nextState, cb) {
    require.ensure([], require => {
    // registerModel(app, require('./models/users/UserInfo'));
    cb(null, require('./routes/users/recordIncoming/index'))
    }, 'RecordIncoming')
    }
    },{
    path: 'users/updateSoftPhoneBarInfo',
    getComponent(nextState, cb) {
    require.ensure([], require => {
    cb(null, require('./routes/users/updateSoftPhoneBarInfo/index'))
    }, 'updateSoftPhoneBarInfo')
    }
    }, {
    path: 'staff/enrollAdmin',
    name: 'staff/enrollAdmin',
    getComponent(nextState, cb) {
    require.ensure([], require => {
    cb(null, require('./routes/staff/EnrollManagement'))
    }, 'enroll')
    }
    },
    {
    path: 'users/modifySelf',
    name: 'users/modifySelf',
    getComponent(nextState, cb) {
    require.ensure([], require => {
    // registerModel(app, require('./models/users/UserInfo'));
    cb(null, require('./components/users/UserInfoModify'))
    }, 'UserInfo')
    }
    }, {
    path: 'users',
    name: 'users',
    getComponent(nextState, cb) {
    require.ensure([], require => {
    // registerModel(app, require('./models/users/UserInfo'));
    cb(null, require('./components/users/UserInfo'))
    }, 'users')
    }
    },
    {
    path: 'message/recruitAssistant',
    name: 'message/recruitAssistant',
    getComponent(nextState, cb) {
    require.ensure([], require => {
    registerModel(app, require('./models/seeker/message'));
    cb(null, require('./routes/message/RecruitAssistant'))
    }, 'message')
    }
    },
    {
    path: 'message/system',
    name: 'message/system',
    getComponent(nextState, cb) {
    require.ensure([], require => {
    cb(null, require('./routes/message/SystemMessage'))
    }, 'message/system')
    }
    }, {

    path: 'users/modifyPassword',
    name: 'users/modifyPassword',
    getComponent(nextState, cb) {
    require.ensure([], require => {
    cb(null, require('./routes/users/modifyPassword/modifyPassword'))
    }, 'users/modifyPassword')
    }
    },
    {
    path:'users/cashManage',
    name:'users/cashManage',
    getComponent(nextState,cb){
    require.ensure([],require=>{
    cb(null,require('./routes/users/cashManage/cashManage'))
    },'users/cashManage')
    }
    }, {

    path: 'businessAccreditManage/BusinessAccreditManage',
    name: 'businessAccreditManage/BusinessAccreditManage',
    getComponent(nextState, cb) {
    require.ensure([], require => {
    cb(null, require('./routes/businessAccreditManage/BusinessAccreditManage'))
    }, 'businessAccreditManage/BusinessAccreditManage')
    }
    },
    {
    path: '*',
    name: 'error',
    getComponent(nextState, cb) {
    require.ensure([], require => {
    cb(null, require('./routes/error'))
    }, 'error')
    }
    }
    ]
    }
    ]

    return <Router history={history} routes={routes} />
    }







  • 相关阅读:
    python 将字符串作为脚本运行
    Django Model获取字段名称并转为List存储
    django 过滤查询
    django 视图中异步执行python脚本
    python 异步执行python脚本
    django 筛选不等于的内容
    phpstorm中快速添加函数注释
    搜索模板elasticsearch
    laravel模型关联
    laravel关联用户
  • 原文地址:https://www.cnblogs.com/liuerpeng/p/10167141.html
Copyright © 2011-2022 走看看