import * as service from '../services/PropertyManagementServices';
import { message } from 'antd';

import { routerRedux } from 'dva/router'

export default {
  namespace: 'PropertyManagement',
  state: {
    Data: '',
    CurData:'',
  },

  reducers: {
    returnData(state, { Data }) {
      return { ...state, Data };
    },
    returnCurData(state, { CurData }) {
      return { ...state, CurData };
    },
  },

  effects: {
    
    //获取物业费列表
    *get({ playload }, { call, put }) {
      console.log(playload)
      const resp = yield call(service.get, playload);
      console.log(resp)
      let Data = resp.data.rows;
      yield put({ type: 'returnData', Data, });
    },
    *getById({ playload }, { call, put }) {
      let CurData = playload;
      yield put({ type: 'returnCurData', CurData, });
    },
    

  },
};
