fix: 修改view页面的样式

This commit is contained in:
喻希里 2017-08-30 10:43:57 +08:00
parent d0444d30c5
commit b58f3c3ec1
5 changed files with 46 additions and 28 deletions

View File

@ -8,6 +8,9 @@
.case-delete-icon{
display: none;
}
i:before{
line-height: 17px;
}
}
.menu-title:hover {
.case-delete-icon {

View File

@ -11,4 +11,7 @@
margin-left: 5px;
cursor: pointer
}
.ant-select-selection__rendered{
line-height: 34px;
}
}

View File

@ -410,7 +410,7 @@ class InterfaceEditForm extends Component {
{getFieldDecorator('path', {
initialValue: this.state.path,
rules: [{
required: true, message: '输入接口路径!'
required: true, message: '输入接口路径!'
}]
})(
<Input onBlur={this.handlePath} placeholder="/path" style={{ width: '60%' }} />

View File

@ -43,6 +43,10 @@ class View extends Component {
dataIndex: 'name',
key: 'name'
}, {
title: '参数类型',
dataIndex: 'type',
key: 'type'
},{
title: '是否必须',
dataIndex: 'required',
key: 'required'
@ -60,7 +64,8 @@ class View extends Component {
key: i,
name: item.name,
value: item.desc,
required: item.required?"必须":"非必须"
required: item.required?"必须":"非必须",
type: item.type === "text"?"文本":"文件"
})
})
}
@ -224,8 +229,14 @@ class View extends Component {
done: "完成"
}
let statusColor = {
undone: "rgb(255, 85, 0)",
done: "#cfefdf"
undone: {
bac: "rgb(255, 85, 0)",
color: "white"
},
done:{
bac: "rgb(135, 208, 104)",
color: "white"
}
}
let methodColor = {
post: {
@ -236,28 +247,29 @@ class View extends Component {
bac: "#cfefdf",
color: "#00a854"
},
input: {
bac: "#57cf27",
color: "#9c82a2"
put: {
bac: "#fff3cf",
color: "#ffbf00"
},
delete: {
bac: "#57cf27",
color: "#57cf27"
bac: "#fcdbd9",
color: "#f04134"
},
head: {
bac: "#d4d5f7",
color: "#0b47ef"
bac: "#fff3cf",
color: "#ffbf00"
},
patch: {
bac: "#f9f4e1",
color: "#fac200"
bac: "#fff3cf",
color: "#ffbf00"
},
options: {
bac: "#f7cdf5",
color: "#fa00f2"
bac: "#fff3cf",
color: "#ffbf00"
}
}
methodColor = methodColor[this.props.curData.method?this.props.curData.method.toLowerCase():"get"];
statusColor = statusColor[this.props.curData.status?this.props.curData.status.toLowerCase():"undone"]
if(!methodColor) methodColor = "get";
let res = <div className="caseContainer">
<div className="colName">
@ -266,7 +278,7 @@ class View extends Component {
</div>
<div className="colMethod">
<span className="colKey">请求方法</span>
<span style={{color:methodColor,backgroundColor:methodColor.bac}} className="colValue">{this.props.curData.method}</span>
<span style={{color:methodColor.color,backgroundColor:methodColor.bac}} className="colValue">{this.props.curData.method}</span>
</div>
<div className="colPath">
<span className="colKey">接口路径</span>
@ -274,7 +286,7 @@ class View extends Component {
</div>
<div className="colstatus">
<span className="colKey">状态</span>
<span style={{backgroundColor:statusColor[this.props.curData.status]}} className="colValue">{status[this.props.curData.status]}</span>
<span style={{backgroundColor:statusColor.bac,color: statusColor.color}} className="colValue">{status[this.props.curData.status]}</span>
</div>
<div className="colAddTime">
<span className="colKey">创建时间</span>

View File

@ -110,7 +110,7 @@ var interfaceController = function (_baseController) {
(0, _createClass3.default)(interfaceController, [{
key: 'add',
value: function () {
var _ref = (0, _asyncToGenerator3.default)( /*#__PURE__*/_regenerator2.default.mark(function _callee(ctx) {
var _ref = (0, _asyncToGenerator3.default)(_regenerator2.default.mark(function _callee(ctx) {
var _this2 = this;
var params, auth, checkRepeat, data, result;
@ -278,7 +278,7 @@ var interfaceController = function (_baseController) {
}, {
key: 'get',
value: function () {
var _ref2 = (0, _asyncToGenerator3.default)( /*#__PURE__*/_regenerator2.default.mark(function _callee2(ctx) {
var _ref2 = (0, _asyncToGenerator3.default)(_regenerator2.default.mark(function _callee2(ctx) {
var params, result;
return _regenerator2.default.wrap(function _callee2$(_context2) {
while (1) {
@ -340,7 +340,7 @@ var interfaceController = function (_baseController) {
}, {
key: 'list',
value: function () {
var _ref3 = (0, _asyncToGenerator3.default)( /*#__PURE__*/_regenerator2.default.mark(function _callee3(ctx) {
var _ref3 = (0, _asyncToGenerator3.default)(_regenerator2.default.mark(function _callee3(ctx) {
var project_id, result;
return _regenerator2.default.wrap(function _callee3$(_context3) {
while (1) {
@ -390,7 +390,7 @@ var interfaceController = function (_baseController) {
}, {
key: 'listByCat',
value: function () {
var _ref4 = (0, _asyncToGenerator3.default)( /*#__PURE__*/_regenerator2.default.mark(function _callee4(ctx) {
var _ref4 = (0, _asyncToGenerator3.default)(_regenerator2.default.mark(function _callee4(ctx) {
var catid, result;
return _regenerator2.default.wrap(function _callee4$(_context4) {
while (1) {
@ -440,7 +440,7 @@ var interfaceController = function (_baseController) {
}, {
key: 'listByMenu',
value: function () {
var _ref5 = (0, _asyncToGenerator3.default)( /*#__PURE__*/_regenerator2.default.mark(function _callee5(ctx) {
var _ref5 = (0, _asyncToGenerator3.default)(_regenerator2.default.mark(function _callee5(ctx) {
var project_id, result, newResult, i, item, list, j;
return _regenerator2.default.wrap(function _callee5$(_context5) {
while (1) {
@ -545,7 +545,7 @@ var interfaceController = function (_baseController) {
}, {
key: 'up',
value: function () {
var _ref6 = (0, _asyncToGenerator3.default)( /*#__PURE__*/_regenerator2.default.mark(function _callee6(ctx) {
var _ref6 = (0, _asyncToGenerator3.default)(_regenerator2.default.mark(function _callee6(ctx) {
var _this3 = this;
var params, id, interfaceData, auth, checkRepeat, data, result, username, cateid;
@ -751,7 +751,7 @@ var interfaceController = function (_baseController) {
}, {
key: 'del',
value: function () {
var _ref7 = (0, _asyncToGenerator3.default)( /*#__PURE__*/_regenerator2.default.mark(function _callee7(ctx) {
var _ref7 = (0, _asyncToGenerator3.default)(_regenerator2.default.mark(function _callee7(ctx) {
var _this4 = this;
var id, data, auth, inter, result, username;
@ -848,7 +848,7 @@ var interfaceController = function (_baseController) {
}, {
key: 'solveConflict',
value: function () {
var _ref8 = (0, _asyncToGenerator3.default)( /*#__PURE__*/_regenerator2.default.mark(function _callee8(ctx) {
var _ref8 = (0, _asyncToGenerator3.default)(_regenerator2.default.mark(function _callee8(ctx) {
var _this5 = this;
var id, result, userInst, userinfo, data;
@ -931,7 +931,7 @@ var interfaceController = function (_baseController) {
}, {
key: 'addCat',
value: function () {
var _ref9 = (0, _asyncToGenerator3.default)( /*#__PURE__*/_regenerator2.default.mark(function _callee9(ctx) {
var _ref9 = (0, _asyncToGenerator3.default)(_regenerator2.default.mark(function _callee9(ctx) {
var params, auth, result, username;
return _regenerator2.default.wrap(function _callee9$(_context9) {
while (1) {
@ -1026,7 +1026,7 @@ var interfaceController = function (_baseController) {
}, {
key: 'upCat',
value: function () {
var _ref10 = (0, _asyncToGenerator3.default)( /*#__PURE__*/_regenerator2.default.mark(function _callee10(ctx) {
var _ref10 = (0, _asyncToGenerator3.default)(_regenerator2.default.mark(function _callee10(ctx) {
var params, result, username, cate, auth;
return _regenerator2.default.wrap(function _callee10$(_context10) {
while (1) {
@ -1098,7 +1098,7 @@ var interfaceController = function (_baseController) {
}, {
key: 'delCat',
value: function () {
var _ref11 = (0, _asyncToGenerator3.default)( /*#__PURE__*/_regenerator2.default.mark(function _callee11(ctx) {
var _ref11 = (0, _asyncToGenerator3.default)(_regenerator2.default.mark(function _callee11(ctx) {
var id, catData, auth, username, result, r;
return _regenerator2.default.wrap(function _callee11$(_context11) {
while (1) {