feat: 接口页面修改状态布局

This commit is contained in:
wenbo.dong 2017-09-22 17:49:15 +08:00
parent 398ad1cd4d
commit 326f86ee0a
4 changed files with 35 additions and 19 deletions

View File

@ -51,6 +51,10 @@
margin-right: 7px; margin-right: 7px;
padding: 0 5px; padding: 0 5px;
} }
.ant-select-selection {
background-color: transparent;
border: none;
}
} }
.toolTip .ant-tooltip-inner{ .toolTip .ant-tooltip-inner{

View File

@ -3,13 +3,14 @@ import { connect } from 'react-redux';
import PropTypes from 'prop-types' import PropTypes from 'prop-types'
import axios from 'axios' import axios from 'axios'
import { import {
Table, Button, Modal, message, Tooltip Table, Button, Modal, message, Tooltip, Select
} from 'antd'; } from 'antd';
import AddInterfaceForm from './AddInterfaceForm'; import AddInterfaceForm from './AddInterfaceForm';
import { fetchInterfaceList} from '../../../../reducer/modules/interface.js'; import { fetchInterfaceList} from '../../../../reducer/modules/interface.js';
import { Link } from 'react-router-dom'; import { Link } from 'react-router-dom';
import variable from '../../../../constants/variable'; import variable from '../../../../constants/variable';
import './Edit.scss'; import './Edit.scss';
const Option = Select.Option;
@connect( @connect(
state => { state => {
@ -99,6 +100,16 @@ class InterfaceList extends Component {
}) })
} }
changeInterfaceStatus = (e) => {
console.log(e);
// this.props.changeMemberRole({ id, member_uid, role }).then((res) => {
// if (!res.payload.data.errcode) {
// message.success(res.payload.data.errmsg);
// this.reFetchList(); // 添加成功后重新获取分组成员列表
// }
// });
}
render() { render() {
let { sortedInfo } = this.state; let { sortedInfo } = this.state;
sortedInfo = sortedInfo || {}; sortedInfo = sortedInfo || {};
@ -138,11 +149,11 @@ class InterfaceList extends Component {
key: 'status', key: 'status',
width: 14, width: 14,
render: (item) => { render: (item) => {
return <div>{item === 'done' ? console.log(item);
<span className="tag-status done">已完成</span> return <Select value={item} className="select" onChange={this.changeInterfaceStatus}>
: <Option value={'done'}><span className="tag-status done">已完成</span></Option>
<span className="tag-status undone">未完成</span> <Option value={'undone'}><span className="tag-status undone">未完成</span></Option>
}</div> </Select>
}, },
filters: [{ filters: [{
text: '已完成', text: '已完成',

View File

@ -314,7 +314,7 @@ class View extends Component {
<Col span={18} className="colValue href"><span onClick={() => window.open(location.protocol + '//' + location.hostname + (location.port !== "" ? ":" + location.port : "") + `/mock/${this.props.currProject._id}${this.props.currProject.basepath}${this.props.curData.path}`, '_blank')}>{location.protocol + '//' + location.hostname + (location.port !== "" ? ":" + location.port : "") + `/mock/${this.props.currProject._id}${this.props.currProject.basepath}${this.props.curData.path}`}</span></Col> <Col span={18} className="colValue href"><span onClick={() => window.open(location.protocol + '//' + location.hostname + (location.port !== "" ? ":" + location.port : "") + `/mock/${this.props.currProject._id}${this.props.currProject.basepath}${this.props.curData.path}`, '_blank')}>{location.protocol + '//' + location.hostname + (location.port !== "" ? ":" + location.port : "") + `/mock/${this.props.currProject._id}${this.props.currProject.basepath}${this.props.curData.path}`}</span></Col>
</Row> </Row>
{this.props.curData.desc? {this.props.curData.desc?
<Row className="row"> <Row className="row remark">
<Col span={4} className="colKey">接口备注</Col> <Col span={4} className="colKey">接口备注</Col>
<Col span={18} className="colValue" dangerouslySetInnerHTML={{__html: this.props.curData.desc}}></Col> <Col span={18} className="colValue" dangerouslySetInnerHTML={{__html: this.props.curData.desc}}></Col>
</Row>:""} </Row>:""}

View File

@ -173,7 +173,6 @@
margin-bottom: .16rem; margin-bottom: .16rem;
} }
.panel-sub { .panel-sub {
background: rgba(236, 238, 241, 0.67);
padding: .16rem; padding: .16rem;
} }
.ant-radio-button-wrapper-checked { .ant-radio-button-wrapper-checked {
@ -190,6 +189,7 @@
.remark-editor { .remark-editor {
background-color: #fff; background-color: #fff;
} }
.remark {
table { table {
border-collapse: collapse; border-collapse: collapse;
} }
@ -201,4 +201,5 @@
padding: 8px; padding: 8px;
} }
tr:nth-child(odd){background: rgba(236, 238, 241, 0.67);} tr:nth-child(odd){background: rgba(236, 238, 241, 0.67);}
}
} }