Commit fd1543dc authored by wuhao's avatar wuhao 🎯

asder

parent 232589d0
...@@ -4,31 +4,24 @@ import { DefaultFooter } from "@ant-design/pro-layout"; ...@@ -4,31 +4,24 @@ import { DefaultFooter } from "@ant-design/pro-layout";
const Footer = () => { const Footer = () => {
const intl = useIntl(); const intl = useIntl();
const defaultMessage = intl.formatMessage({
id: "app.copyright.produced",
defaultMessage: "蚂蚁集团体验技术部出品",
});
const currentYear = new Date().getFullYear(); const currentYear = new Date().getFullYear();
return ( return (
<DefaultFooter <DefaultFooter
copyright={`${currentYear} ${defaultMessage}`} copyright={`${currentYear} 江苏南高智能装备创新中心出品`}
links={[ links={[
{ {
key: "Ant Design Pro", key: "Ant Design Pro",
title: "Ant Design Pro", title: "JiangSuNanGao",
href: "https://pro.ant.design",
blankTarget: true, blankTarget: true,
}, },
{ {
key: "github", key: "github",
title: <GithubOutlined />, title: <GithubOutlined />,
href: "https://github.com/ant-design/ant-design-pro",
blankTarget: true, blankTarget: true,
}, },
{ {
key: "Ant Design", key: "Designed By Wuhao",
title: "Ant Design", title: "Designed By Wuhao",
href: "https://ant.design",
blankTarget: true, blankTarget: true,
}, },
]} ]}
......
...@@ -110,12 +110,16 @@ ol { ...@@ -110,12 +110,16 @@ ol {
padding: 10px 0 10px 0 !important; padding: 10px 0 10px 0 !important;
} }
.ant-pro-form-login-container { .ant-pro-form-login-container {
padding-top: 22vh !important; height: auto !important;
margin-top: -10vh;
padding: 0 !important;
background: transparent !important; background: transparent !important;
} }
.ant-pro-form-login-main { .ant-pro-form-login-main {
margin-top: 30px !important; margin-top: 30px !important;
} }
pre { pre {
color: rgba(0, 0, 0, 0.85) !important; color: rgba(0, 0, 0, 0.85) !important;
font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
...@@ -223,5 +227,33 @@ pre { ...@@ -223,5 +227,33 @@ pre {
.ant-pro-form-login-desc { .ant-pro-form-login-desc {
margin-bottom: 0 !important; margin-bottom: 0 !important;
} }
#content { .ant-layout-footer {
background-color: transparent !important;
.ant-pro-global-footer {
margin: 0 !important;
padding: 0 !important;
}
}
.logincontent {
.ant-layout-footer {
background-color: #23394a !important;
.ant-pro-global-footer {
margin: 0 0 20px 0 !important;
padding: 0 !important;
* {
color: rgba(255, 255, 255, 0.6) !important;
}
.ant-pro-global-footer-copyright {
color: rgba(255, 255, 255, 0.3) !important;
}
}
}
}
.reg {
b {
color: #fff !important;
font-weight: normal !important;
}
} }
...@@ -11,8 +11,12 @@ import React, { useState } from "react"; ...@@ -11,8 +11,12 @@ import React, { useState } from "react";
import { import {
ProFormCaptcha, ProFormCaptcha,
ProFormCheckbox, ProFormCheckbox,
ProFormDependency,
ProFormText, ProFormText,
LoginForm, LoginForm,
ProFormTreeSelect,
ProFormSelect,
ProFormTextArea
} from "@ant-design/pro-form"; } from "@ant-design/pro-form";
import { Link, history, FormattedMessage, useModel } from "umi"; import { Link, history, FormattedMessage, useModel } from "umi";
import { fakeAccountLogin } from "@/services/login"; import { fakeAccountLogin } from "@/services/login";
...@@ -22,6 +26,18 @@ import ECB from "crypto-js/mode-ecb"; ...@@ -22,6 +26,18 @@ import ECB from "crypto-js/mode-ecb";
import Pkcs7 from "crypto-js/pad-pkcs7"; import Pkcs7 from "crypto-js/pad-pkcs7";
import Utf8 from "crypto-js/enc-utf8"; import Utf8 from "crypto-js/enc-utf8";
import moment from "moment"; import moment from "moment";
import Footer from "@/components/Footer";
import {
factorySelectRegister,
shopSelectByFactory,
productionLineSelectByShops,
sectionSelectByShops,
allUserSelect,
departmentTree,
roleSelectRegister,
} from "@/services/system";
const LoginMessage = ({ content }) => ( const LoginMessage = ({ content }) => (
<Alert <Alert
...@@ -41,7 +57,7 @@ let col = { xs: 0, sm: 0, md: 7, lg: 6, xl: 6, xxl: 6 }, ...@@ -41,7 +57,7 @@ let col = { xs: 0, sm: 0, md: 7, lg: 6, xl: 6, xxl: 6 },
const Login = () => { const Login = () => {
const { initialState, setInitialState } = useModel("@@initialState"); const { initialState, setInitialState } = useModel("@@initialState");
const [tabkey, settabkey] = useState(); const [tabkey, settabkey] = useState("1");
const fetchUserInfo = async () => { const fetchUserInfo = async () => {
const userInfo = await initialState?.fetchUserInfo(), const userInfo = await initialState?.fetchUserInfo(),
menuData = await initialState?.getmenuData(); menuData = await initialState?.getmenuData();
...@@ -53,7 +69,8 @@ const Login = () => { ...@@ -53,7 +69,8 @@ const Login = () => {
} }
}; };
const handleSubmit = async (values) => { //登录
const handleLogin = async (values) => {
let timestamp = moment().valueOf().toString() + "acb"; let timestamp = moment().valueOf().toString() + "acb";
let newtimestamp = AES.encrypt(timestamp, Utf8.parse("NANGAODEAESKEY--"), { let newtimestamp = AES.encrypt(timestamp, Utf8.parse("NANGAODEAESKEY--"), {
mode: ECB, mode: ECB,
...@@ -89,6 +106,20 @@ const Login = () => { ...@@ -89,6 +106,20 @@ const Login = () => {
message.error(res.msg); message.error(res.msg);
} }
}; };
const handleSubmit = async (values) => {
if (tabkey == "1") {
await handleLogin()
} else {
}
}
return ( return (
<Row className={styles.container}> <Row className={styles.container}>
<Col {...col}> <Col {...col}>
...@@ -105,70 +136,272 @@ const Login = () => { ...@@ -105,70 +136,272 @@ const Login = () => {
</div> </div>
</Col> </Col>
<Col {...cols}> <Col {...cols}>
<div className={styles.content} id="content"> <div className="logincontent" style={{ width: "100%", height: "100%", display: "flex", flexDirection: "column" }}>
<LoginForm <div className={styles.content}>
title={<span style={{ color: "#fff" }}>WMS</span>} <LoginForm
subTitle={ title={<span style={{ color: "#fff" }}>WMS</span>}
<span style={{ color: "rgba(255,255,255,0.6)" }}> subTitle={
智慧仓储管理系统 <span style={{ color: "rgba(255,255,255,0.6)" }}>
</span> 智慧仓储管理系统
} </span>
initialValues={{ }
autoLogin: true, initialValues={{
}} autoLogin: true,
onFinish={async (values) => { }}
await handleSubmit(values); onFinish={async (values) => {
}} await handleSubmit(values);
>
<Tabs
activeKey={tabkey}
onChange={settabkey}
tabBarStyle={{ color: "#fff" }}
>
<TabPane tab="登录" key="1">
{tabkey == "1" && (
<>
<ProFormText
name="userName"
fieldProps={{
size: "large",
prefix: <UserOutlined className={styles.prefixIcon} />,
}}
placeholder="用户名"
rules={[
{
required: true,
message: "请输入用户名!",
},
]}
/>
<ProFormText.Password
name="password"
fieldProps={{
size: "large",
prefix: <LockOutlined className={styles.prefixIcon} />,
}}
placeholder="密码"
rules={[
{
required: true,
message: "请输入密码!",
},
]}
/>
</>
)}
</TabPane>
<TabPane tab="注册" key="2"></TabPane>
</Tabs>
<div
style={{
marginBottom: 12,
height: 0,
}} }}
style={{ width: tabkey == "2" ? 560 : 328, marginLeft: tabkey == "2" ? -116 : 0 }}//样式适配
> >
{/* <Link to="/user/logon" <Tabs
activeKey={tabkey}
onChange={settabkey}
tabBarStyle={{ color: "#fff" }}
>
<TabPane tab="登录" key="1">
{tabkey == "1" && (
<>
<ProFormText
name="userName"
fieldProps={{
size: "large",
prefix: <UserOutlined className={styles.prefixIcon} />,
}}
placeholder="用户名"
rules={[
{
required: true,
message: "请输入用户名!",
},
]}
/>
<ProFormText.Password
name="password"
fieldProps={{
size: "large",
prefix: <LockOutlined className={styles.prefixIcon} />,
}}
placeholder="密码"
rules={[
{
required: true,
message: "请输入密码!",
},
]}
/>
</>
)}
</TabPane>
<TabPane tab="注册" key="2">
{tabkey == "2" && (
<Row className="reg" gutter={12}>
<Col span={8}>
<ProFormText
name="accountName"
label={<b>用户名</b>}
placeholder="请输入用户名"
rules={[
{
required: true,
message: "请输入用户名!",
},
]}
/>
</Col>
<Col span={8}>
<ProFormText
name="userName"
label={<b>姓名</b>}
placeholder="请输入姓名"
rules={[
{
required: true,
message: "请输入姓名!",
},
]}
/>
</Col>
<Col span={8}>
<ProFormText
name="telephone"
label={<b>联系电话</b>}
placeholder="请输入联系电话"
rules={[
{
required: false,
message: "请输入联系电话!",
},
{
pattern: /^1\d{10}$/,
message: "手机号格式错误!",
},
]}
/>
</Col>
<Col span={8}>
<ProFormTreeSelect
name="departmentId"
label={<b>组织</b>}
placeholder="请选择组织"
fieldProps={{
fieldNames: {
label: "title",
value: "key",
children: "children"
}
}}
request={async () => {
let res = await departmentTree({});
return res?.data?.dataList ?? []
}}
rules={[
{
required: true,
message: "请选择组织!",
}
]}
/>
</Col>
<Col span={8}>
<ProFormSelect
name="factoryId"
label={<b>工厂</b>}
placeholder="请选择工厂"
request={async () => {
let res = await factorySelectRegister({});
return res?.data?.dataList ?? []
}}
rules={[
{
required: true,
message: "请选择工厂!",
}
]}
/>
</Col>
<Col span={8}>
<ProFormDependency name={["factoryId"]}>
{
({ factoryId }) => {
return <ProFormSelect
name="shopIdList"
label={<b>负责仓库</b>}
placeholder={"请选择负责仓库"}
params={{ factoryId }}
request={async (params) => {
let res = await shopSelectByFactory({ factoryId: params.factoryId });
return res?.data?.dataList ?? []
}}
rules={[
{
required: false,
message: "请选择负责仓库!",
}
]}
/>
}
}
</ProFormDependency>
</Col>
<Col span={8}>
<ProFormSelect
name="roleIdList"
label={<b>角色配置</b>}
placeholder="请选择角色配置"
request={async () => {
let res = await roleSelectRegister({});
return res?.data?.dataList ?? []
}}
rules={[
{
required: false,
message: "请选择角色配置!",
}
]}
/>
</Col>
<Col span={8}>
<ProFormSelect
name="parentId"
label={<b>直属领导</b>}
placeholder="请选择直属领导"
request={async () => {
let res = await allUserSelect({});
return res?.data?.dataList ?? []
}}
rules={[
{
required: false,
message: "请选择直属领导!",
}
]}
/>
</Col>
<Col span={8}>
<ProFormText
name="mailNo"
label={<b>邮箱</b>}
placeholder="请输入邮箱"
request={async () => {
let res = await allUserSelect({});
return res?.data?.dataList ?? []
}}
rules={[
{
required: false,
message: "请输入邮箱!",
}
]}
/>
</Col>
<Col span={24}>
<ProFormTextArea
name="remark"
label={<b>备注</b>}
placeholder="请输入备注"
request={async () => {
let res = await allUserSelect({});
return res?.data?.dataList ?? []
}}
rules={[
{
required: false,
message: "请输入备注!",
}
]}
/>
</Col>
</Row>
)}
</TabPane>
</Tabs>
<div
style={{
marginBottom: 12,
height: 0,
}}
>
{/* <Link to="/user/logon"
style={{ style={{
float: 'right', float: 'right',
textShadow: "0 0 4px #999" textShadow: "0 0 4px #999"
...@@ -176,9 +409,12 @@ const Login = () => { ...@@ -176,9 +409,12 @@ const Login = () => {
> >
<FormattedMessage id="pages.login.registerAccount" defaultMessage="" /> <FormattedMessage id="pages.login.registerAccount" defaultMessage="" />
</Link> */} </Link> */}
</div> </div>
</LoginForm> </LoginForm>
</div>
<Footer></Footer>
</div> </div>
</Col> </Col>
</Row> </Row>
); );
......
...@@ -18,7 +18,10 @@ ...@@ -18,7 +18,10 @@
} }
.content { .content {
display: flex;
flex: 1; flex: 1;
align-items: center;
justify-content: center;
height: 100%; height: 100%;
padding: 32px 0; padding: 32px 0;
background-color: #23394a; background-color: #23394a;
...@@ -26,6 +29,9 @@ ...@@ -26,6 +29,9 @@
@media (min-width: @screen-md-min) { @media (min-width: @screen-md-min) {
.content { .content {
display: flex;
align-items: center;
justify-content: center;
padding: 32px 0 24px; padding: 32px 0 24px;
} }
} }
...@@ -42,3 +48,4 @@ ...@@ -42,3 +48,4 @@
color: @primary-color; color: @primary-color;
} }
} }
...@@ -22,29 +22,23 @@ export default { ...@@ -22,29 +22,23 @@ export default {
name: ["userName"], name: ["userName"],
required: true, required: true,
}, },
gender: {
value: null,
type: "select",
title: "性别",
name: ["gender"],
required: false,
options: [
{
label: "男",
value: 1,
},
{
label: "女",
value: 2,
},
],
},
telephone: { telephone: {
value: null, value: null,
type: "input", type: "input",
title: "联系电话", title: "联系电话",
name: ["telephone"], name: ["telephone"],
required: false,
},
departmentId: {
value: null,
type: "treeselect",
title: "组织",
name: ["departmentId"],
required: true, required: true,
options: {
database: departmentTree,
params: {},
},
}, },
factoryId: { factoryId: {
value: null, value: null,
...@@ -58,21 +52,10 @@ export default { ...@@ -58,21 +52,10 @@ export default {
}, },
linked: true, linked: true,
}, },
departmentId: {
value: null,
type: "treeselect",
title: "部门",
name: ["departmentId"],
required: true,
options: {
database: departmentTree,
params: {},
},
},
shopIdList: { shopIdList: {
value: [], value: [],
type: "select", type: "select",
title: "负责车间", title: "负责仓库",
name: ["shopIdList"], name: ["shopIdList"],
required: false, required: false,
belinked: { belinked: {
...@@ -84,34 +67,6 @@ export default { ...@@ -84,34 +67,6 @@ export default {
linked: true, linked: true,
multiple: true, multiple: true,
}, },
sectionIdList: {
value: [],
type: "select",
title: "负责工段",
name: ["sectionIdList"],
required: false,
belinked: {
options: {
database: sectionSelectByShops,
params: { shopIdList: "linked", factoryId: "linked" },
},
},
multiple: true,
},
productionLineIdList: {
value: [],
type: "select",
title: "负责产线",
name: ["productionLineIdList"],
required: false,
belinked: {
options: {
database: productionLineSelectByShops,
params: { shopIdList: "linked", factoryId: "linked" },
},
},
multiple: true,
},
roleIdList: { roleIdList: {
value: [], value: [],
type: "select", type: "select",
...@@ -149,36 +104,6 @@ export default { ...@@ -149,36 +104,6 @@ export default {
span: 12, span: 12,
}, },
}, },
academicCareer: {
value: null,
type: "input",
title: "学历",
name: ["academicCareer"],
required: false,
col: {
span: 12,
},
},
university: {
value: null,
type: "input",
title: "毕业院校",
name: ["university"],
required: false,
col: {
span: 12,
},
},
major: {
value: null,
type: "input",
title: "专业",
name: ["major"],
required: false,
col: {
span: 12,
},
},
remark: { remark: {
value: null, value: null,
type: "textarea", type: "textarea",
...@@ -187,17 +112,5 @@ export default { ...@@ -187,17 +112,5 @@ export default {
required: false, required: false,
col: { span: 24 }, col: { span: 24 },
}, },
userImgList: {
value: null,
type: "upload",
title: "个人图片",
name: ["userImgList"],
required: false,
col: {
span: 24,
},
listType: "img",
multiple: false,
limit: 1,
},
}; };
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment