Skip to content

Commit

Permalink
update
Browse files Browse the repository at this point in the history
  • Loading branch information
summerGN committed Apr 21, 2017
1 parent 4892d5b commit f5ab517
Show file tree
Hide file tree
Showing 7 changed files with 64 additions and 20 deletions.
2 changes: 1 addition & 1 deletion src/components/TopBar.js
Original file line number Diff line number Diff line change
Expand Up @@ -1419,7 +1419,7 @@ const LeftSidebar = (props) => {

</div>

)
)
}, {
title: '基本信息',
content: (
Expand Down
10 changes: 8 additions & 2 deletions src/components/TopBar/TemplateStore.js
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,7 @@ const TemplateStore = (props) => {
description: '请重新输入'
});
return false;
}
}
props.dispatch({
type: 'templateStore/valueChange',
payload: e.target.value
Expand Down Expand Up @@ -162,6 +162,12 @@ const TemplateStore = (props) => {
type: 'templateStore/domainValueChange',
payload: e.target.value
})
props.dispatch({
type: 'sidebar/checkDomain',
payload: {
domain:e.target.value
}
})
},
hanleCreate(){
props.dispatch({
Expand Down Expand Up @@ -360,7 +366,7 @@ const TemplateStore = (props) => {
<span>自定义域名:</span>
</Col>
<Col span={18} style={{textAlign: 'left'}}>
<Input onChange={templateStoreProps.domainValueChange} value={props.templateStore.createForm.domain} onPressEnter={templateStoreProps.createApp}/>
<Input onChange={templateStoreProps.domainValueChange} value={props.templateStore.createForm.domain} onPressEnter={templateStoreProps.createApp} addonAfter=".gospel.design"/>
</Col>
</Row>
<Button disabled={!props.templateStore.available} type="primary" onClick={templateStoreProps.createApp} style={{ marginTop: 32, marginLeft: 370 }}>立即创建</Button>
Expand Down
5 changes: 3 additions & 2 deletions src/components/VDSite/VDLeftPanel/VDAllPages.js
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ const Component = (props) => {
const allPagesProps = {

handlePageListItemClick (e) {
console.log(e)
var key = e.key;
localStorage.popoverKey = key;

Expand All @@ -39,6 +40,7 @@ const Component = (props) => {
type: 'vdpm/setCurrentActivePageListItem',
payload: key
});

},
visibleChange(item, e){
if(props.vdpm.currentActivePageListItem != item.key){
Expand Down Expand Up @@ -328,12 +330,11 @@ const Component = (props) => {
activePage: val
}
});
$("#vdsitePagesBtn").click();
}

return (
<div className="vd-allpages-list">
<Popover placement="right" trigger="click" title="设置页面的详细信息" content={generatePageDetailSettings()} onClick={allPagesProps.handlePageListItemClick} onVisibleChange={allPagesProps.visibleChange} visible={props.vdpm.pageManager.updatePopoverVisible}>
<Popover placement="right" title="设置页面的详细信息" content={generatePageDetailSettings()} onClick={allPagesProps.handlePageListItemClick} onVisibleChange={allPagesProps.visibleChange} visible={props.vdpm.pageManager.updatePopoverVisible}>
<Menu
style={{ width: '100%' }}
defaultOpenKeys={['index.html']}
Expand Down
32 changes: 31 additions & 1 deletion src/components/VDSite/VDRightPanel/VDSettingPanel.js
Original file line number Diff line number Diff line change
Expand Up @@ -181,8 +181,22 @@ const Component = (props) => {
if(sessionStorage.newTime-sessionStorage.oldTime > 1500){
sessionStorage.oldTime = sessionStorage.newTime;
if(attrType.key == 'link-setting'){

if(attrType.activeLinkType == 'link'){
if(newVal != ""){

if(newVal.substr(0,7)=="http://"){
console.log(newVal);
newVal = newVal;
sessionStorage.clear();
}else{
console.log('error',newVal);
message.error('请输入http://开头的链接地址');
sessionStorage.clear();
item.value = "";
newVal = "";
}

if(urlRegex.test(newVal)){
newVal = newVal;
sessionStorage.clear();
Expand Down Expand Up @@ -659,6 +673,12 @@ const Component = (props) => {
let inputPhoneValue = item.children[2].value;

if(item.activeLinkType == 'link' && inputLinkValue != ""){
if(inputLinkValue.substr(0,7) != "http://"){
console.log(inputLinkValue);
message.error('请输入http://开头的链接地址');
inputLinkValue = '';
return false;
}
if(!urlRegex.test(inputLinkValue)){
message.error('请输入正确的链接地址');
inputLinkValue = '';
Expand All @@ -683,6 +703,15 @@ const Component = (props) => {
}
}

const linkRemind = (
<span>
<span>链接地址</span>
<Tooltip placement="bottom" title='只能输入http://开头的链接地址'>
<Icon type="question-circle-o" style={{position: 'absolute', left: '65px', top: '4px'}}/>
</Tooltip>
</span>
)

const linkSettingProps = {

linkSettingTemplate: props.vdcore.linkSetting.list.map( (item, index) => {
Expand All @@ -696,7 +725,8 @@ const Component = (props) => {
}),
tpl: [(
<Form className="form-no-margin-bottom">
<FormItem {...formItemLayout} label="链接地址">
<FormItem {...formItemLayout} label={linkRemind}>

<Input size="small" value={item.children[0].value} type="url" onChange={formProps.handleAttrFormInputChange.bind(this, item.children[0], attrType)} onBlur={validateFromData}/>
</FormItem>

Expand Down
4 changes: 3 additions & 1 deletion src/index.less
Original file line number Diff line number Diff line change
Expand Up @@ -4202,6 +4202,8 @@
}

.ant-btn-primary[disabled] {
color:#fff!important;
color: rgba(0,0,0,.25)!important;
background-color: #f7f7f7!important;
border-color: #d9d9d9!important;
}
}
12 changes: 6 additions & 6 deletions src/models/ModelLeftSidebar.js
Original file line number Diff line number Diff line change
Expand Up @@ -374,7 +374,7 @@ export default {
}
},
*checkDomain({payload: params}, {call, put}) {

console.log(params);
var url = 'domains?subDomain=' + params.domain.toLocaleLowerCase();
var result = yield request(url, {
method: 'GET'
Expand Down Expand Up @@ -463,9 +463,9 @@ export default {
});

const showConfirm = (data) => {
Modal.error({
title: '服务器提了一个问题',
content: '创建失败,请重试,' + data.message
Modal.info({
title: '创建失败',
content: data.message + ',请重试'
});
}

Expand All @@ -475,7 +475,7 @@ export default {
}
return {
data: {
message: '服务器提了一个问题',
message: '出了一个错误: ',
code: 500
}
};
Expand All @@ -499,7 +499,7 @@ export default {
}
return {
data: {
message: '服务器提了一个问题' + data.message,
message: data.message,
code: 500
}
};
Expand Down
19 changes: 12 additions & 7 deletions src/models/topbar/ModelTemplateStore.js
Original file line number Diff line number Diff line change
Expand Up @@ -395,8 +395,13 @@ export default {

var createForm = yield select(state=> state.templateStore.createForm);

if(createForm.name == '' || createForm.domain == '') {
message.error("请完善表单");
if(createForm.name == '') {
message.error("请输入项目名称");
return;
}

if(createForm.domain == '') {
message.error("请输入自定义域名");
return;
}

Expand Down Expand Up @@ -450,9 +455,9 @@ export default {
type: 'hideCreateTemplate',
})
const showConfirm = (data) => {
Modal.error({
title: '服务器提了一个问题',
content: '创建失败,请重试,' + data.message
Modal.info({
title: '创建失败',
content: data.message + ',请重试'
});
}

Expand All @@ -462,7 +467,7 @@ export default {
}
return {
data: {
message: '服务器提了一个问题',
message: '出了一个错误: ',
code: 500
}
};
Expand All @@ -486,7 +491,7 @@ export default {
}
return {
data: {
message: '服务器提了一个问题' + data.message,
message: '出了一个错误: ' + data.message,
code: 500
}
};
Expand Down

0 comments on commit f5ab517

Please sign in to comment.