@@ -78,7 +76,7 @@ export default class topNav extends React.Component{
{
item.items.map((item2,key2)=>{
return(
-
this.btnfn(item2)} className={pathnameBreak==item2.path?'menuactive':''}>{item2.name}
+
this.btnfn(item2)} className={pathnameBreak==item2.path&&item.items.length>1?'menuactive':''}>{item2.name}
)
})
}
diff --git a/src/pages/distributor/add/add.js b/src/pages/distributor/add/add.js
index a8b241d4..c553723c 100644
--- a/src/pages/distributor/add/add.js
+++ b/src/pages/distributor/add/add.js
@@ -12,15 +12,14 @@ export default class acclist extends React.Component{
constructor(props){
super(props)
this.state={
-
}
}
render(){
const { current, pageSize } = this.state;
return(
-
diff --git a/src/pages/login/login.js b/src/pages/login/login.js
index 7b9f53fb..533dab9a 100644
--- a/src/pages/login/login.js
+++ b/src/pages/login/login.js
@@ -6,6 +6,10 @@ import Loginform from "./loginform"
import Button from "../../components/button/main"
import { BrowserRouter as Router, Route, Link } from "react-router-dom";
export default class App extends Component {
+ constructor(props){
+ super(props)
+ window['react']=this;
+ }
state = {
pathname:'',
};
@@ -14,6 +18,7 @@ export default class App extends Component {
const pathnamestr=window.location.href.substr(pathname);
this.setState({pathname:`${pathnamestr}`});
}
+
render() {
return (
diff --git a/src/pages/login/login.less b/src/pages/login/login.less
index 16c537ff..d720636c 100644
--- a/src/pages/login/login.less
+++ b/src/pages/login/login.less
@@ -1,6 +1,7 @@
.loginPage{
width: 100%;
height: 100%;
+
}
.loginPage .login-left{
width: 70%;
@@ -50,4 +51,9 @@ background-position: left center;
.loginPage .zent-btn[data-zv="9.11.0"]:hover {
color: #fff;
+}
+.forget{
+ text-align: right;
+ color: #296bef!important;
+ cursor: pointer;
}
\ No newline at end of file
diff --git a/src/pages/login/loginform.js b/src/pages/login/loginform.js
index 5416e245..1835d0f1 100644
--- a/src/pages/login/loginform.js
+++ b/src/pages/login/loginform.js
@@ -10,6 +10,7 @@ import {
Validators,
Input,
Icon,
+ Link,
Button,
ButtonDirective,
Notify
@@ -32,11 +33,16 @@ function FormDom(props) {
}, [form]);
const onSubmit = React.useCallback(form => {
const value = form.getValue();
- props.history.push('/home')
+ props.history.push('/home')
}, []);
+ const forgetFn =()=>{
+ Notify.clear();
+ Notify.warn('请联系管理员')
+ }
+
return (
<>
-
diff --git a/src/pages/system/account/add/add.js b/src/pages/system/account/add/add.js
index 67e018fd..ff0e3dab 100644
--- a/src/pages/system/account/add/add.js
+++ b/src/pages/system/account/add/add.js
@@ -8,13 +8,18 @@ import Adduser from "../add/adduserinfo/adduserinfo"
export default class accadd extends React.Component{
constructor(props){
super(props)
- this.state={}
+ this.state={
+ pagetitle:'新建账号'
+ }
+ }
+ componentWillMount(){
+ let pagetitle=JSON.parse(sessionStorage.getItem('breaknav'))[0].pagetitle;
+ this.setState({pagetitle:pagetitle+'账号'});
}
render(){
return(
-
-
+
diff --git a/src/pages/system/account/add/add.less b/src/pages/system/account/add/add.less
index 6d52ebaf..259d779a 100644
--- a/src/pages/system/account/add/add.less
+++ b/src/pages/system/account/add/add.less
@@ -1,5 +1,7 @@
#accadd{
height: 100px;
+ .addaccount{
+ }
}
#accadd .selectList{
display: flex;
diff --git a/src/pages/system/account/add/adduserinfo/adduserinfo.js b/src/pages/system/account/add/adduserinfo/adduserinfo.js
index c9906825..afe3de09 100644
--- a/src/pages/system/account/add/adduserinfo/adduserinfo.js
+++ b/src/pages/system/account/add/adduserinfo/adduserinfo.js
@@ -1,13 +1,14 @@
import React from "react"
import "./adduserinfo.less"
import Ipt from "../../../../../components/input/main"
-
+import "../../../../../assets/comm.css"
import {
Form,
FormStrategy,
Radio,
Checkbox,
Notify,
+ ImageUpload,
Validators,
FormSelectField,
FormUploadField,
@@ -43,6 +44,7 @@ function Adduser(){
const onSubmit = React.useCallback(form => {
const value = form.getValue();
+
console.log(value)
}, []);
@@ -114,9 +116,38 @@ function Adduser(){
);
}
+
+ function onUploadError(type, data){
+ if (type === 'overMaxAmount') {
+ Notify.error(`最多可上传 ${data.maxAmount} 张图片`);
+ } else if (type === 'overMaxSize') {
+ Notify.error(`图片大小不能超过 ${data.formattedMaxSize}`);
+ }
+ };
+ function onUploadChange(files){
+ console.log(files);
+ };
+
+ function onUpload (file, report){
+ return new Promise((resolve, reject) => {
+ let count = 0;
+ const update = () => {
+ if (count < 100) {
+ count += 10;
+ report(count);
+ setTimeout(update, 500);
+ } else {
+
+ }
+ };
+ });
+ };
+
return (
-
+
+
+
+
+
);
}
export default Adduser;
\ No newline at end of file
diff --git a/src/pages/system/account/add/adduserinfo/adduserinfo.less b/src/pages/system/account/add/adduserinfo/adduserinfo.less
index bbf084e3..5aecd508 100644
--- a/src/pages/system/account/add/adduserinfo/adduserinfo.less
+++ b/src/pages/system/account/add/adduserinfo/adduserinfo.less
@@ -2,12 +2,37 @@
flex-basis: 60px!important;
/* justify-content: flex-end; */
}
-.select-item{
- width: 300px;
- display: flex;
- align-items: center;
- margin-bottom: 20px;
-}
-.select-item-label{
- padding-right: 10px;
+.addaccinfo{
+ width: 100%;
+ display: flex;
+
+ .addform{
+ width: 70%;
+ }
+ .mypic{
+ flex: 1;
+ padding: 30px 50px;
+ border-left: 1px solid #F2F2F2;
+ .changepic{
+ margin-top:20px;
+ .zent-image-upload-list[data-zv="9.11.0"] {
+ justify-content: center;
+ width: 100px;
+ margin: 0 auto;
+ height: 100px;
+ border-radius: 50px;
+ background: #00bfff!important;
+ // overflow: hidden;
+ .zent-image-upload-trigger[data-zv="9.11.0"]{
+ width: 100px;
+ height: 100px;
+ }
+ }
+ .putImage{
+ margin-top: 30px;
+ }
+
+ }
+ }
+
}
\ No newline at end of file
diff --git a/src/pages/system/account/list/list.js b/src/pages/system/account/list/list.js
index ea948951..558542ad 100644
--- a/src/pages/system/account/list/list.js
+++ b/src/pages/system/account/list/list.js
@@ -1,13 +1,13 @@
import ReactDOM from 'react-dom';
import React, { Component } from 'react';
import { HashRouter as Router, Route, Link } from "react-router-dom";
-import { Button } from 'zent';
import "./list.less"
-import {Switch ,Icon } from 'zent';
+import {Switch ,Icon ,Sweetalert, Notify,Dialog,Button} from 'zent';
import TabPage from "../../../../components/tabPage/main.js"
import "../../../../assets/comm.css"
import Grid from "../../../../components/gird/main.js"
import Ipt from "../../../../components/input/main"
+import Modifypwd from "./modifypwd"
const Column = [
{
title: '用户名',
@@ -51,7 +51,8 @@ const Column = [
title: '状态',
width:'auto',
type: "slot",
- prop:'name'
+ name:'name',
+ prop:'status'
},
{
title: '创建时间',
@@ -75,19 +76,25 @@ export default class acclist extends React.Component{
super(props)
this.state={
pageSize: 10,
+ checkedSmall: true,
current: 2,
+ visible: false,
tabList:[{title:"账号列表"}],
- accoutdata:[{username:'红噔噔',phone:'13541778893',role:'管理员',name:'红噔噔',status:'红噔噔'
- ,time:'2021-00-04 13:48:45',post:'技术',opearo:'红噔噔'},{username:'红噔噔',phone:'13541778893',role:'管理员',name:'红噔噔',status:'红噔噔'
- ,time:'2021-00-04 13:48:45',post:'技术',opearo:'红噔噔'},{username:'红噔噔',phone:'13541778893',role:'管理员',name:'红噔噔',status:'红噔噔'
- ,time:'2021-00-04 13:48:45',post:'技术',opearo:'红噔噔'},{username:'红噔噔',phone:'13541778893',role:'管理员',name:'红噔噔',status:'红噔噔'
- ,time:'2021-00-04 13:48:45',post:'技术',opearo:'红噔噔'},{username:'红噔噔',phone:'13541778893',role:'管理员',name:'红噔噔',status:'红噔噔'}]
+ accoutdata:[{username:'红噔噔',phone:'13541778893',role:'管理员',status:true,name:'红噔噔'
+ ,time:'2021-00-04 13:48:45',post:'技术',opearo:'红噔噔'},{username:'红噔噔',phone:'13541778893',role:'管理员',status:true,name:'红噔噔'
+ ,time:'2021-00-04 13:48:45',post:'技术',opearo:'红噔噔'},{username:'红噔噔',phone:'13541778893',role:'管理员',status:true,name:'红噔噔'
+ ,time:'2021-00-04 13:48:45',post:'技术',opearo:'红噔噔'}]
}
}
+ handleChangeSmall(e,rowData) {
+ // this.setState({ checkedSmall: checked });
+ console.log(rowData);
+ rowData.status=!rowData.status;
+ };
clickFn(){
this.props.history.push('/system/account-add');
sessionStorage.setItem('pathname2','/system/account-add')
- let activerou=[{items:[
+ let activerou=[{'pagetitle':'新建',items:[
{
"path": "/system/account-list",
"name": "账号管理"
@@ -102,7 +109,49 @@ export default class acclist extends React.Component{
onChange = options => {
this.setState(options);
};
+ onConfirm = () => {
+ Notify.success('我真的知道了');
+ }
+ onCancel = () => {
+ Notify.error('我真的取消了');
+ }
+ //表单删除
+ delFn(e,row){
+ Sweetalert.confirm({
+ type:'warning',
+ closeBtn:true,
+ title:'确认操作',
+ content:
是否删除此条数据?
,
+ onConfirm: this.onConfirm,
+ onCancel: this.onCancel,
+ className:'questModal',
+ parentComponent: this
+ });
+ }
+ editFn(e,row){
+ this.props.history.push('/system/account-add');
+ sessionStorage.setItem('pathname2','/system/account-add')
+ let activerou=[{'pagetitle':'编辑',items:[
+ {
+ "path": "/system/account-list",
+ "name": "账号管理"
+ },
+ {
+ "path": "/system/account-add",
+ "name": "编辑账号"
+ }
+ ]}]
+ sessionStorage.setItem('breaknav',JSON.stringify(activerou));
+ }
+ //重置密码
+ resetpwd(){
+ console.log('重置密码');
+ this.setState({visible:true});
+ }
+ setVisible = visible => {
+ this.setState({ visible });
+ };
render(){
return(
@@ -126,20 +175,20 @@ export default class acclist extends React.Component{
this.pageChange(e)
}}
checkChange ={(selection)=>{
- console.log(selection)
+
}}
ComponentHandler={(com,rowData)=>{
- if(com == "name")
+ if(com == "status")
{
- return
;
+ return
this.handleChangeSmall(e,rowData)}>;
}
if(com == "opearo")
{
return
- 编辑
- 删除
- 重置密码
+ this.editFn(e,rowData)}>编辑
+ this.delFn(e,rowData)}>删除
+ 重置密码
}
}}
@@ -148,6 +197,24 @@ export default class acclist extends React.Component{
{/*
*/}