diff --git a/src/components/form/main.js b/src/components/form/main.js index 217699fd..fd47a2a4 100644 --- a/src/components/form/main.js +++ b/src/components/form/main.js @@ -269,7 +269,7 @@ export default class form extends React.Component { if (formItem_com.value == ""||formItem_com.value == undefined) { self.removeClass(item) self.isRequired(formItem_com.value, o.className, item, rules_item[j].message); - break; + return false; } else{ self.removeClass(item) @@ -286,8 +286,9 @@ export default class form extends React.Component { self.removeClass(item) } else { - console.log("不满足") + self.isRequired(formItem_com.value, o.className, item, rules_item[j].message); + return false } } @@ -297,6 +298,9 @@ export default class form extends React.Component { } } + + + return true; } render() { diff --git a/src/components/subnav/main.js b/src/components/subnav/main.js index 80ccf4c4..cf5e4a39 100644 --- a/src/components/subnav/main.js +++ b/src/components/subnav/main.js @@ -52,7 +52,6 @@ export default class topNav extends React.Component{ } render(){ - console.log(this.props); let routeflag=sessionStorage.getItem('showflag') let breaknav=JSON.parse(sessionStorage.getItem('breaknav')) let pathnameBreak=sessionStorage.getItem('pathname2') diff --git a/src/pages/home/home.js b/src/pages/home/home.js index 3d0e097f..56f8847c 100644 --- a/src/pages/home/home.js +++ b/src/pages/home/home.js @@ -41,6 +41,9 @@ import accountadd from '../system/account/add/add'; import rolelist from '../system/role/list/list'; import roleadd from '../system/role/add/add'; import station from '../system/station/main'; +import customize from '../system/customize/main.js' + + import menu from '../system/menu/main/main'; import distributorlist from '../distributor/list/list'; @@ -70,7 +73,7 @@ export default class App extends Component { childmenu:[{ group:'账号管理', items:[{path:'/system/account-list',name:'账号管理'},{path:'/system/role-list',name:'角色管理'}, - {path:'/system/station',name:'岗位管理'},{path:'/system/menu',name:'菜单管理'}] + {path:'/system/station',name:'岗位管理'},{path:'/system/menu',name:'菜单管理'},{path:'/system/customize',name:'定制化模板'}] }], path:'/system' },{ @@ -179,7 +182,6 @@ export default class App extends Component { /* 定时器 间隔1秒检测是否长时间未操作页面 */ render() { - return (
@@ -240,6 +242,7 @@ export default class App extends Component { + diff --git a/src/pages/plan/add/add.js b/src/pages/plan/add/add.js index 4d4496b0..b727cee2 100644 --- a/src/pages/plan/add/add.js +++ b/src/pages/plan/add/add.js @@ -13,21 +13,26 @@ export default class add extends React.Component{ step1_pagetitle:"新建计划", step2_pagetitle:"生成key", step3_pagetitle:"绑定卡券", + curstep:1, menuList:[ {id:1,title:"推广计划",child:[{step:1,title:"新建计划"}]}, - {id:2,title:"key",child:[{step:1,title:"生产key"},{step:2,title:"绑定卡券"}]}, - {id:3,title:"兑换页",child:[{step:1,title:"绑定兑换页"}]}, - {id:4,title:"活动",child:[{step:1,title:"选择活动"},{step:2,title:"活动内容"}]}, + {id:2,title:"key",child:[{step:1,title:"生产key"}]}, + {id:3,title:"兑换页",child:[{step:1,title:"绑定卡券"}]}, + ] } } - submit(){ this.refs.step1.submit(); } - cancel(){ - // this.refs.step1.onCancel(); + onCancel(){ + this.refs.step1.onCancel(); + } + onNextStep(){ + let step = this.state.curstep + 1; + this.setState({curstep:step}) + console.log(this.state.curstep) } render(){ @@ -36,13 +41,13 @@ export default class add extends React.Component{
{ this.state.menuList.map((item, index) => { - return( -
+ return( +
{item.title}
{ item.child.map((item2, index2) => { - return( -
{item2.title}
+ return( +
= item.id ? "child-title active" :"child-title" } >{item2.title}
) }) } @@ -61,25 +66,50 @@ export default class add extends React.Component{ - -
-
key
+ + { + this.state.curstep >= 2 ? (
+
key
+ ) : null + } + { + + this.state.curstep >= 3 ? (
+ ) : null + + } + + + + + { + this.state.curstep == 3 ? ( +
+ + +
+ ) :( +
+ + +
+ ) + }
-
) diff --git a/src/pages/plan/add/add.less b/src/pages/plan/add/add.less index 5b86ce50..e1581380 100644 --- a/src/pages/plan/add/add.less +++ b/src/pages/plan/add/add.less @@ -52,6 +52,11 @@ margin-left: 14px; margin-bottom: 15px; } +.child-title.active{ + font-weight: bold; +} + + .under-line{ width: 100%; height: 1px; @@ -106,4 +111,11 @@ } .step3{ margin-top: 20px; -} \ No newline at end of file +} +.step-btn-group{ + margin-top: 15px; + button{ + width: 100px; + height: 36px; + } +} diff --git a/src/pages/plan/add/step1.js b/src/pages/plan/add/step1.js index f7e1f847..08ea8182 100644 --- a/src/pages/plan/add/step1.js +++ b/src/pages/plan/add/step1.js @@ -27,7 +27,9 @@ export default class acclist extends React.Component{ submit(){ this.refs.form1.validator() } - + onCancel(){ + this.refs.form1.cancel() + } render(){ //校验规则 const rules = { diff --git a/src/pages/plan/add/step2.js b/src/pages/plan/add/step2.js index b3e21cdf..d0bd218d 100644 --- a/src/pages/plan/add/step2.js +++ b/src/pages/plan/add/step2.js @@ -28,6 +28,9 @@ export default class acclist extends React.Component{ submit(){ this.refs.form1.validator() + } + onCancel(){ + this.refs.form1.cancel() } onCheckChange = (checkedList) => { this.setState({ checkedList }); diff --git a/src/pages/plan/add/step3.js b/src/pages/plan/add/step3.js index e7eb0e8b..12e0005c 100644 --- a/src/pages/plan/add/step3.js +++ b/src/pages/plan/add/step3.js @@ -27,6 +27,9 @@ export default class acclist extends React.Component{ submit(){ this.refs.form1.validator() } + onCancel(){ + this.refs.form1.cancel() + } render(){ //校验规则 @@ -89,6 +92,20 @@ export default class acclist extends React.Component{ 链接 + + + 列表 + 轮播 + 矩阵 + + + + + 大客户 + 普通商户 + 备用 + + ) diff --git a/src/pages/system/customize/main.js b/src/pages/system/customize/main.js new file mode 100644 index 00000000..00286ee7 --- /dev/null +++ b/src/pages/system/customize/main.js @@ -0,0 +1,132 @@ +import ReactDOM from 'react-dom'; +import React, { Component } from 'react'; +import { HashRouter as Router, Route, Link } from "react-router-dom"; +import "./main.less" +import {Switch ,Icon ,Sweetalert, Notify,Dialog,Button,Card,Select,Upload,ImageUpload} from 'zent'; +import Ipt from "../../../components/input/main" +import Form from "../../../components/form/main" +import FormItem from "../../../components/form-item/main" + + +const FILE_UPLOAD_STATUS = Upload.FILE_UPLOAD_STATUS; + +const CustomItem = props => { + const { item, i18n, onRetry, onDelete } = props; + return ( +
+

{item.name}

+

进度:{item.percent}%

+
+ {item.status === FILE_UPLOAD_STATUS.failed && } + +
+
+ ) +}; + + +export default class acclist extends React.Component{ + constructor(props){ + super(props) + this.state={ + model:{ //数据模型不可少 + name:"", + zip:"", + picurl:"", + account:"", + pagetype:"" + } + } + } + onUploadChange(e){ + + } + onUpload(e){ + + } + onUploadError(){ + + } + render(){ + //校验规则 + const rules = { + name: [ + { type: "required", message: "请输入标题"}, + ], + zip: [ + { type: "required", message: "请选择文件"}, + ], + picurl: [ + { type: "required", message: "请上传截图"}, + ], + } + const options = [ + { + key: '1', + text: 'Option 1', + }, + { + key: '2', + text: 'Option 2', + }, + { + key: '3', + text: 'Option 3', + disabled: true, + }, + { + key: '4', + text: `君不见,黄河之水天上来,奔流到海不复回`, + }, + ]; + return( +
+ +
+ + { + let model2 = this.state.model; + model2.name = e; + this.setState({model:model2}) + }} value={this.state.model.name} placeholder={"请输入"} labelWidth={'0px'} maxLength={12} height={'36px'} width={'520px'} alignment={'left'}/> + + + + + + + + + + + +
+
+
+ ) + } +} \ No newline at end of file diff --git a/src/pages/system/customize/main.less b/src/pages/system/customize/main.less new file mode 100644 index 00000000..57da6b37 --- /dev/null +++ b/src/pages/system/customize/main.less @@ -0,0 +1,4 @@ +.customize-card{ + width: 98%; + margin: 0 auto; +} \ No newline at end of file