mirror of
https://github.com/YMFE/yapi.git
synced 2025-01-06 12:45:22 +08:00
Merge branch 'dev' of http://gitlab.corp.qunar.com/mfe/yapi into dev
This commit is contained in:
commit
d76b0cc678
@ -1,3 +1,7 @@
|
||||
export default {
|
||||
PAGE_LIMIT: 10 // 默认每页展示10条数据
|
||||
PAGE_LIMIT: 10, // 默认每页展示10条数据
|
||||
|
||||
// layout
|
||||
ROW_MIN_WIDTH: '9.7rem', // 适应小屏幕分辨率
|
||||
ROW_MAX_WIDTH: '11.7rem' // 适应大屏幕分辨率
|
||||
}
|
||||
|
@ -50,7 +50,8 @@ class UpDateModal extends Component {
|
||||
constructor(props) {
|
||||
super(props);
|
||||
this.state = {
|
||||
protocol: 'http:\/\/'
|
||||
protocol: 'http:\/\/',
|
||||
envProtocolChange: 'http:\/\/'
|
||||
}
|
||||
}
|
||||
static propTypes = {
|
||||
@ -84,18 +85,19 @@ class UpDateModal extends Component {
|
||||
e.preventDefault();
|
||||
const { form, updateProject, changeUpdateModal, currGroup, projectList, handleUpdateIndex, fetchProjectList, changeTableLoading } = this.props;
|
||||
form.validateFields((err, values) => {
|
||||
console.log(err);
|
||||
console.log(values);
|
||||
if (!err) {
|
||||
console.log(projectList[handleUpdateIndex]);
|
||||
// console.log(projectList[handleUpdateIndex]);
|
||||
let assignValue = Object.assign(projectList[handleUpdateIndex], values);
|
||||
values.protocol = this.state.protocol.split(':')[0];
|
||||
assignValue.env = assignValue.envs.map((item, index) => {
|
||||
console.log(values['envs-protocol-'+index]);
|
||||
return {
|
||||
name: values['envs-name-'+index],
|
||||
domain: values['envs-domain-'+index]
|
||||
domain: values['envs-protocol-'+index] + values['envs-domain-'+index]
|
||||
}
|
||||
});
|
||||
console.log(assignValue);
|
||||
// console.log(assignValue);
|
||||
|
||||
changeTableLoading(true);
|
||||
updateProject(assignValue).then((res) => {
|
||||
@ -119,6 +121,13 @@ class UpDateModal extends Component {
|
||||
});
|
||||
}
|
||||
|
||||
envProtocolChange = (value) => {
|
||||
console.log(value);
|
||||
// this.setState({
|
||||
// envProtocolChange: value
|
||||
// })
|
||||
}
|
||||
|
||||
// 项目的修改操作 - 删除一项环境配置
|
||||
remove = (id) => {
|
||||
const { form } = this.props;
|
||||
@ -174,7 +183,7 @@ class UpDateModal extends Component {
|
||||
getFieldDecorator('envs', { initialValue: envMessage });
|
||||
const envs = getFieldValue('envs');
|
||||
const formItems = envs.map((k, index) => {
|
||||
console.log(k);
|
||||
// console.log(k);
|
||||
const secondIndex = 'next' + index; // 为保证key的唯一性
|
||||
return (
|
||||
<Row key={index} type="flex" justify="space-between" align={index === 0 ? 'middle' : 'top'}>
|
||||
@ -220,7 +229,7 @@ class UpDateModal extends Component {
|
||||
>
|
||||
{getFieldDecorator(`envs-domain-${index}`, {
|
||||
validateTrigger: ['onChange', 'onBlur'],
|
||||
initialValue: envMessage.length !== 0 ? k.domain : '',
|
||||
initialValue: envMessage.length !== 0 ? k.domain.split('\/\/')[1] : '',
|
||||
rules: [{
|
||||
required: false,
|
||||
whitespace: true,
|
||||
@ -240,7 +249,18 @@ class UpDateModal extends Component {
|
||||
}
|
||||
}]
|
||||
})(
|
||||
<Input placeholder="请输入环境域名" style={{ width: '90%', marginRight: 8 }} />
|
||||
<Input placeholder="请输入环境域名" style={{ width: '90%', marginRight: 8 }} addonBefore={
|
||||
getFieldDecorator(`envs-protocol-${index}`, {
|
||||
initialValue: 'http:\/\/',
|
||||
rules: [{
|
||||
required: true
|
||||
}]
|
||||
})(
|
||||
<Select>
|
||||
<Option value="http://">{'http:\/\/'}</Option>
|
||||
<Option value="https://">{'https:\/\/'}</Option>
|
||||
</Select>
|
||||
)}/>
|
||||
)}
|
||||
</FormItem>
|
||||
</Col>
|
||||
|
@ -2,7 +2,8 @@ import {
|
||||
LOGIN,
|
||||
LOGIN_OUT,
|
||||
LOGIN_TYPE,
|
||||
GET_LOGIN_STATE
|
||||
GET_LOGIN_STATE,
|
||||
REGISTER
|
||||
} from '../../constants/action-types';
|
||||
|
||||
const LOADING_STATUS = 0;
|
||||
@ -13,8 +14,8 @@ const initialState = {
|
||||
isLogin: false,
|
||||
userName: null,
|
||||
uid: null,
|
||||
loginState:LOADING_STATUS,
|
||||
loginWrapActiveKey:"1"
|
||||
loginState: LOADING_STATUS,
|
||||
loginWrapActiveKey: "1"
|
||||
};
|
||||
|
||||
export default (state = initialState, action) => {
|
||||
@ -51,6 +52,15 @@ export default (state = initialState, action) => {
|
||||
loginWrapActiveKey: action.index
|
||||
};
|
||||
}
|
||||
case REGISTER: {
|
||||
return {
|
||||
...state,
|
||||
isLogin: true,
|
||||
loginState: MEMBER_STATUS,
|
||||
uid: action.payload.data.data.uid,
|
||||
userName: action.payload.data.data.username
|
||||
};
|
||||
}
|
||||
default:
|
||||
return state;
|
||||
}
|
||||
|
@ -2,7 +2,8 @@ import {
|
||||
LOGIN,
|
||||
LOGIN_OUT,
|
||||
LOGIN_TYPE,
|
||||
GET_LOGIN_STATE
|
||||
GET_LOGIN_STATE,
|
||||
REGISTER
|
||||
} from '../../constants/action-types';
|
||||
|
||||
const LOADING_STATUS = 0;
|
||||
@ -13,8 +14,8 @@ const initialState = {
|
||||
isLogin: false,
|
||||
userName: null,
|
||||
uid: null,
|
||||
loginState:LOADING_STATUS,
|
||||
loginWrapActiveKey:"1"
|
||||
loginState: LOADING_STATUS,
|
||||
loginWrapActiveKey: "1"
|
||||
};
|
||||
|
||||
export default (state = initialState, action) => {
|
||||
@ -51,6 +52,15 @@ export default (state = initialState, action) => {
|
||||
loginWrapActiveKey: action.index
|
||||
};
|
||||
}
|
||||
case REGISTER: {
|
||||
return {
|
||||
...state,
|
||||
isLogin: true,
|
||||
loginState: MEMBER_STATUS,
|
||||
uid: action.payload.data.data.uid,
|
||||
userName: action.payload.data.data.username
|
||||
};
|
||||
}
|
||||
default:
|
||||
return state;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user