样式修改

0603
wt 5 years ago
parent 079583602b
commit 4fd239b66b
  1. 2
      src/Active.tsx
  2. 2
      src/Manager.tsx
  3. 6
      src/User.tsx
  4. 10
      src/account/Login.tsx
  5. 14
      src/account/Register.tsx
  6. 4
      src/entity.ts
  7. 30
      src/index.css
  8. 4
      src/ui/InputGroup.tsx

@ -123,7 +123,7 @@ export class Active extends React.Component<any, {
return ( return (
<Tabs defaultActiveKey="info" id="uncontrolled-tab-example"> <Tabs defaultActiveKey="info" id="uncontrolled-tab-example">
<Tab eventKey="info" title="活动管理"> <Tab eventKey="info" title="活动管理">
<Table striped bordered hover className="mt-3"> <Table striped bordered hover className="mt-3 custom-table ml-auto mr-auto">
<thead> <thead>
<tr> <tr>
<th>#</th> <th>#</th>

@ -208,7 +208,7 @@ export class Manager extends React.Component<
menuName={"添加管理员"} onClose={()=>{ menuName={"添加管理员"} onClose={()=>{
this.setState({dialog:null}); this.setState({dialog:null});
}}/>})}></Button> }}/>})}></Button>
<Table striped bordered hover className="mt-3"> <Table striped bordered hover className="mt-3 custom-table ml-auto mr-auto overflow-auto custom-table-height">
<thead> <thead>
<tr> <tr>
<th>#</th> <th>#</th>

@ -1,5 +1,5 @@
import React from "react"; import React from "react";
import {Button, Col, Form, Image, Row, Tab, Table, Tabs} from "react-bootstrap"; import {Button, Col, Container, Form, Image, Row, Tab, Table, Tabs} from "react-bootstrap";
import {PageProps, UserEntity, UserType} from "./entity"; import {PageProps, UserEntity, UserType} from "./entity";
import {Input} from "./ui/InputGroup"; import {Input} from "./ui/InputGroup";
import {JSONResponse, Method, request} from "./interface"; import {JSONResponse, Method, request} from "./interface";
@ -244,6 +244,7 @@ export class User extends React.Component<
return ( return (
<Tabs defaultActiveKey="info" id="uncontrolled-tab-example"> <Tabs defaultActiveKey="info" id="uncontrolled-tab-example">
<Tab eventKey="info" title="用户信息"> <Tab eventKey="info" title="用户信息">
{/*<div className="overflow-auto custom-table-height">*/}
<Table striped bordered hover className="mt-3"> <Table striped bordered hover className="mt-3">
<thead> <thead>
<tr> <tr>
@ -263,7 +264,7 @@ export class User extends React.Component<
<th></th> <th></th>
</tr> </tr>
</thead> </thead>
<tbody> <tbody className="custom-table-height">
{this.state.userList?this.state.userList.length>0?this.state.userList.map((user:UserEntity, index:number)=> {this.state.userList?this.state.userList.length>0?this.state.userList.map((user:UserEntity, index:number)=>
<tr key={"tr"+index}> <tr key={"tr"+index}>
<td className="align-middle">{index+1}</td> <td className="align-middle">{index+1}</td>
@ -298,6 +299,7 @@ export class User extends React.Component<
</tr>):<h3 className="text-center text-danger"></h3>:null} </tr>):<h3 className="text-center text-danger"></h3>:null}
</tbody> </tbody>
</Table> </Table>
{/*</div>*/}
{this.state.page?<Page onClick={(page:number)=>this.loadUser(page)} currentPage={this.state.page.currentPage} {this.state.page?<Page onClick={(page:number)=>this.loadUser(page)} currentPage={this.state.page.currentPage}
totalPage={this.state.page.totalPage} pageSize={this.state.page.pageSize}/> totalPage={this.state.page.totalPage} pageSize={this.state.page.pageSize}/>

@ -59,12 +59,13 @@ export class Login extends React.Component<LoginProps, LoginState>{
render() { render() {
return ( return (
<div className="d-flex align-items-center" style={{height:window.screen.availHeight+'px'}}> <div className="d-flex align-items-center" style={{backgroundColor:"#FFF8F8",height:"937px",overflow:"hidden"}}>
<div className="container"> <div style={{height:300,backgroundColor:"#ffffff",width:"800px",float:"left",overflow:"hidden",marginTop:"-50px",border:"3px solid #ffffff",borderRadius:15,boxShadow:"0 0 10px #939292"}} className="container">
<div style={{float:"left",marginTop:"20px",marginLeft:"270px",color:"#1D45FF",fontFamily:"微软雅黑",fontSize:20}}>+</div>
<div style={{marginTop:70}}>
<Form> <Form>
<Input name="managerId" type="text" desc="管理员账号" value={this.state.managerId} <Input style={{}} name="managerId" type="text" desc="管理员账号" value={this.state.managerId}
onChange={(value: string)=>{this.setState({managerId:value})}} valid={{check:this.state.managerId.length>0}}/> onChange={(value: string)=>{this.setState({managerId:value})}} valid={{check:this.state.managerId.length>0}}/>
<Input name="password" type="password" desc="管理员密码" value={this.state.password} <Input name="password" type="password" desc="管理员密码" value={this.state.password}
@ -77,6 +78,7 @@ export class Login extends React.Component<LoginProps, LoginState>{
</Form> </Form>
</div> </div>
</div>
<MyDialog content={this.state.tipContent} open={this.state.tipContent!=null} titleId={"login-dialog"} <MyDialog content={this.state.tipContent} open={this.state.tipContent!=null} titleId={"login-dialog"}
menuName={"提示"} onClose={()=>this.setState({ menuName={"提示"} onClose={()=>this.setState({

@ -74,18 +74,19 @@ export class Register extends React.Component<RegisterProps, RegisterState>{
render() { render() {
return ( return (
<div className="d-flex align-items-center" style={{height:window.screen.availHeight+'px'}}> <div className="d-flex align-items-center" style={{backgroundColor:"#FFF8F8",height:"937px",overflow:"hidden"}}>
<div className="container"> <div style={{height:400,backgroundColor:"#ffffff",width:"800px",float:"left",overflow:"hidden",marginTop:"-50px",border:"3px solid #ffffff",borderRadius:15,boxShadow:"0 0 10px #939292"}} className="container">
<div style={{float:"left",marginTop:"20px",marginLeft:"270px",color:"#1D45FF",fontFamily:"微软雅黑",fontSize:20}}>+</div>
<div style={{marginTop:75}}>
<Form> <Form>
<Input col={4} name="managerId" type="text" desc="管理员账号" value={this.state.managerId} onChange={(value: string)=>{ <Input prependTextClass={"input-prepend-text"} col={7} name="managerId" type="text" desc="管理员账号" value={this.state.managerId} onChange={(value: string)=>{
this.setState({...this.state,...{managerId:value}})}} valid={{check:this.isNotEmpty(this.state.managerId)}}/> this.setState({...this.state,...{managerId:value}})}} valid={{check:this.isNotEmpty(this.state.managerId)}}/>
<Input col={4} name="password" type="password" desc="管理员密码" value={this.state.password} <Input prependTextClass={"input-prepend-text"} col={7} name="password" type="password" desc="管理员密码" value={this.state.password}
onChange={(value: string)=>{this.setState({password:value})}} valid={{check:this.isNotEmpty(this.state.password)}}/> onChange={(value: string)=>{this.setState({password:value})}} valid={{check:this.isNotEmpty(this.state.password)}}/>
<Input col={4} name="confirmPwd" type="password" desc="确认密码" placeholder="请确认密码" value={this.state.confirmPwd} <Input prependTextClass={"input-prepend-text"} col={7} name="confirmPwd" type="password" desc="&nbsp;&nbsp;确认密码" placeholder="请确认密码" value={this.state.confirmPwd}
onChange={(value: string)=>{this.setState({confirmPwd:value})}} onChange={(value: string)=>{this.setState({confirmPwd:value})}}
valid={{check:this.checkPwd(), valid={{check:this.checkPwd(),
invalid:this.state.confirmPwd.length>0&&this.state.password!==this.state.confirmPwd?"密码和确认密码不一致":"验证失败"}}/> invalid:this.state.confirmPwd.length>0&&this.state.password!==this.state.confirmPwd?"密码和确认密码不一致":"验证失败"}}/>
@ -96,6 +97,7 @@ export class Register extends React.Component<RegisterProps, RegisterState>{
</Form> </Form>
</div> </div>
</div>
<MyDialog content={this.state.tipContent} open={this.state.tipContent!=null} titleId={"register-dialog"} <MyDialog content={this.state.tipContent} open={this.state.tipContent!=null} titleId={"register-dialog"}
menuName={"提示"} onClose={()=>this.setState({ menuName={"提示"} onClose={()=>this.setState({

@ -83,6 +83,10 @@ export interface FormInputProps {
col?: number col?: number
//整体样式,若存在会覆盖col局部样式 //整体样式,若存在会覆盖col局部样式
className?:string; className?:string;
//内联样式
style?:object;
//前置文本宽度
prependTextClass?:string;
} }
/** /**

@ -35,3 +35,33 @@ code {
width: 30px; width: 30px;
height: 30px; height: 30px;
} }
/*前置文本宽度*/
.input-prepend-text{
width:106px;
}
/*表格示例样式*/
.custom-table{
max-width: 95%;
}
.custom-table-height{
height: 500px;
}
table tbody {
display:block;
height:195px;
overflow-y:scroll;
}
table thead, tbody tr {
display:table;
width:100%;
table-layout:fixed;
}
table thead {
width: calc( 100% - 1em )
}

@ -27,9 +27,9 @@ export class Input extends React.Component<FormInputProps, { undefined?:undefine
render() { render() {
return ( return (
<InputGroup className={this.props.className?this.props.className:"col-"+(this.props.col||7)+" ml-auto mr-auto mt-3"}> <InputGroup style={this.props.style||{}} className={this.props.className?this.props.className:"col-"+(this.props.col||7)+" ml-auto mr-auto mt-3"}>
<InputGroup.Prepend> <InputGroup.Prepend>
<InputGroup.Text id={this.props.name}>{this.props.desc}</InputGroup.Text> <InputGroup.Text className={this.props.prependTextClass?this.props.prependTextClass:""} id={this.props.name}>{this.props.desc}</InputGroup.Text>
</InputGroup.Prepend> </InputGroup.Prepend>
<FormControl autoComplete={this.props.name} className={this.valid()} type={this.props.type} as={this.props.as} <FormControl autoComplete={this.props.name} className={this.valid()} type={this.props.type} as={this.props.as}
placeholder={(this.props.placeholder||"").length>0?this.props.placeholder:"请输入"+this.props.desc} placeholder={(this.props.placeholder||"").length>0?this.props.placeholder:"请输入"+this.props.desc}

Loading…
Cancel
Save