fix: 获取项目列表字段调整

This commit is contained in:
wenbo.dong 2017-07-18 21:11:32 +08:00
parent 8700012957
commit a76c606f0b
2 changed files with 9 additions and 4 deletions

View File

@ -1,14 +1,16 @@
import React, { Component } from 'react'; import React, { Component } from 'react';
import PropTypes from 'prop-types'; import PropTypes from 'prop-types';
import { connect } from 'react-redux'; import { connect } from 'react-redux';
import { Table, Button, Modal, Form, Input, Icon, Tooltip, Select } from 'antd'; import { Table, Button, Modal, Form, Input, Icon, Tooltip, Select, Popconfirm } from 'antd';
import { addProject, fetchProjectList } from '../../../actions/project'; import { addProject, fetchProjectList } from '../../../actions/project';
const { TextArea } = Input; const { TextArea } = Input;
const FormItem = Form.Item; const FormItem = Form.Item;
const Option = Select.Option; const Option = Select.Option;
import './ProjectList.scss' import './ProjectList.scss'
const confirm = (e) => {
console.log(e);
}
const columns = [{ const columns = [{
title: '项目名称', title: '项目名称',
dataIndex: 'name', dataIndex: 'name',
@ -29,7 +31,9 @@ const columns = [{
<span> <span>
<a href="#">修改</a> <a href="#">修改</a>
<span className="ant-divider" /> <span className="ant-divider" />
<a href="#">删除</a> <Popconfirm title="你确定要删除项目吗?" onConfirm={confirm} okText="删除" cancelText="取消">
<a href="#">删除</a>
</Popconfirm>
</span> </span>
) )
}]; }];

View File

@ -12,7 +12,8 @@ export default (state = initialState, action) => {
case FETCH_PROJECT_LIST: { case FETCH_PROJECT_LIST: {
return { return {
...state, ...state,
projectList: action.payload.data.data projectList: action.payload.data.data.list,
total: action.payload.data.data.total
}; };
} }
case PROJECT_ADD: { case PROJECT_ADD: {