Commit fd1543dc authored by wuhao's avatar wuhao 🎯

asder

parent 232589d0
......@@ -4,31 +4,24 @@ import { DefaultFooter } from "@ant-design/pro-layout";
const Footer = () => {
const intl = useIntl();
const defaultMessage = intl.formatMessage({
id: "app.copyright.produced",
defaultMessage: "蚂蚁集团体验技术部出品",
});
const currentYear = new Date().getFullYear();
return (
<DefaultFooter
copyright={`${currentYear} ${defaultMessage}`}
copyright={`${currentYear} 江苏南高智能装备创新中心出品`}
links={[
{
key: "Ant Design Pro",
title: "Ant Design Pro",
href: "https://pro.ant.design",
title: "JiangSuNanGao",
blankTarget: true,
},
{
key: "github",
title: <GithubOutlined />,
href: "https://github.com/ant-design/ant-design-pro",
blankTarget: true,
},
{
key: "Ant Design",
title: "Ant Design",
href: "https://ant.design",
key: "Designed By Wuhao",
title: "Designed By Wuhao",
blankTarget: true,
},
]}
......
......@@ -110,12 +110,16 @@ ol {
padding: 10px 0 10px 0 !important;
}
.ant-pro-form-login-container {
padding-top: 22vh !important;
height: auto !important;
margin-top: -10vh;
padding: 0 !important;
background: transparent !important;
}
.ant-pro-form-login-main {
margin-top: 30px !important;
}
pre {
color: rgba(0, 0, 0, 0.85) !important;
font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
......@@ -223,5 +227,33 @@ pre {
.ant-pro-form-login-desc {
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";
import {
ProFormCaptcha,
ProFormCheckbox,
ProFormDependency,
ProFormText,
LoginForm,
ProFormTreeSelect,
ProFormSelect,
ProFormTextArea
} from "@ant-design/pro-form";
import { Link, history, FormattedMessage, useModel } from "umi";
import { fakeAccountLogin } from "@/services/login";
......@@ -22,6 +26,18 @@ import ECB from "crypto-js/mode-ecb";
import Pkcs7 from "crypto-js/pad-pkcs7";
import Utf8 from "crypto-js/enc-utf8";
import moment from "moment";
import Footer from "@/components/Footer";
import {
factorySelectRegister,
shopSelectByFactory,
productionLineSelectByShops,
sectionSelectByShops,
allUserSelect,
departmentTree,
roleSelectRegister,
} from "@/services/system";
const LoginMessage = ({ content }) => (
<Alert
......@@ -41,7 +57,7 @@ let col = { xs: 0, sm: 0, md: 7, lg: 6, xl: 6, xxl: 6 },
const Login = () => {
const { initialState, setInitialState } = useModel("@@initialState");
const [tabkey, settabkey] = useState();
const [tabkey, settabkey] = useState("1");
const fetchUserInfo = async () => {
const userInfo = await initialState?.fetchUserInfo(),
menuData = await initialState?.getmenuData();
......@@ -53,7 +69,8 @@ const Login = () => {
}
};
const handleSubmit = async (values) => {
//登录
const handleLogin = async (values) => {
let timestamp = moment().valueOf().toString() + "acb";
let newtimestamp = AES.encrypt(timestamp, Utf8.parse("NANGAODEAESKEY--"), {
mode: ECB,
......@@ -89,6 +106,20 @@ const Login = () => {
message.error(res.msg);
}
};
const handleSubmit = async (values) => {
if (tabkey == "1") {
await handleLogin()
} else {
}
}
return (
<Row className={styles.container}>
<Col {...col}>
......@@ -105,7 +136,8 @@ const Login = () => {
</div>
</Col>
<Col {...cols}>
<div className={styles.content} id="content">
<div className="logincontent" style={{ width: "100%", height: "100%", display: "flex", flexDirection: "column" }}>
<div className={styles.content}>
<LoginForm
title={<span style={{ color: "#fff" }}>WMS</span>}
subTitle={
......@@ -119,6 +151,7 @@ const Login = () => {
onFinish={async (values) => {
await handleSubmit(values);
}}
style={{ width: tabkey == "2" ? 560 : 328, marginLeft: tabkey == "2" ? -116 : 0 }}//样式适配
>
<Tabs
activeKey={tabkey}
......@@ -159,7 +192,207 @@ const Login = () => {
</>
)}
</TabPane>
<TabPane tab="注册" key="2"></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
......@@ -179,6 +412,9 @@ const Login = () => {
</div>
</LoginForm>
</div>
<Footer></Footer>
</div>
</Col>
</Row>
);
......
......@@ -18,7 +18,10 @@
}
.content {
display: flex;
flex: 1;
align-items: center;
justify-content: center;
height: 100%;
padding: 32px 0;
background-color: #23394a;
......@@ -26,6 +29,9 @@
@media (min-width: @screen-md-min) {
.content {
display: flex;
align-items: center;
justify-content: center;
padding: 32px 0 24px;
}
}
......@@ -42,3 +48,4 @@
color: @primary-color;
}
}
......@@ -22,29 +22,23 @@ export default {
name: ["userName"],
required: true,
},
gender: {
value: null,
type: "select",
title: "性别",
name: ["gender"],
required: false,
options: [
{
label: "男",
value: 1,
},
{
label: "女",
value: 2,
},
],
},
telephone: {
value: null,
type: "input",
title: "联系电话",
name: ["telephone"],
required: false,
},
departmentId: {
value: null,
type: "treeselect",
title: "组织",
name: ["departmentId"],
required: true,
options: {
database: departmentTree,
params: {},
},
},
factoryId: {
value: null,
......@@ -58,21 +52,10 @@ export default {
},
linked: true,
},
departmentId: {
value: null,
type: "treeselect",
title: "部门",
name: ["departmentId"],
required: true,
options: {
database: departmentTree,
params: {},
},
},
shopIdList: {
value: [],
type: "select",
title: "负责车间",
title: "负责仓库",
name: ["shopIdList"],
required: false,
belinked: {
......@@ -84,34 +67,6 @@ export default {
linked: 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: {
value: [],
type: "select",
......@@ -149,36 +104,6 @@ export default {
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: {
value: null,
type: "textarea",
......@@ -187,17 +112,5 @@ export default {
required: false,
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