Commit 6974ed40 authored by wuhao's avatar wuhao 🎯

asdr

parent 212345b2
......@@ -138,6 +138,7 @@ pre {
justify-content: center;
}
.spread {
width: 100%;
display: flex;
align-items: center;
justify-content: space-between;
......@@ -235,6 +236,12 @@ pre {
}
.logincontent {
.ant-tabs-nav-wrap{
display: inline-block !important;
}
.ant-tabs-tab-active {
font-size: 16px !important;
}
.ant-layout-footer {
background-color: #23394a !important;
.ant-pro-global-footer {
......@@ -281,6 +288,16 @@ pre {
.ant-select-clear {
background-color: transparent !important;
}
.ant-select-selection-item-content,.ant-select-selection-item-remove{
color: #000 !important;
.anticon {
color: #000 !important;
}
}
.ant-select-selection-overflow{
display: flex !important;
flex-wrap: nowrap !important;
}
}
.reg {
......@@ -296,3 +313,6 @@ pre {
.ant-pro-global-header {
padding-left: 6px !important;
}
table{
min-width: calc(100% - 6px) !important;
}
import {
AlipayCircleOutlined,
LockOutlined,
MobileOutlined,
TaobaoCircleOutlined,
UserOutlined,
WeiboCircleOutlined,
LoginOutlined,
ArrowRightOutlined,
CloseOutlined
} from "@ant-design/icons";
import { Alert, message, Tabs, Row, Col } from "antd";
import React, { useState } from "react";
import { Alert, message, Tabs, Row, Col, Button, Input } from "antd";
import React, { useState, useRef } from "react";
import {
ProFormCaptcha,
ProFormCheckbox,
......@@ -19,7 +18,7 @@ import {
ProFormTextArea
} from "@ant-design/pro-form";
import { Link, history, FormattedMessage, useModel } from "umi";
import { fakeAccountLogin } from "@/services/login";
import { fakeAccountLogin, saveForRegister } from "@/services/login";
import styles from "./index.less";
import AES from "crypto-js/aes";
import ECB from "crypto-js/mode-ecb";
......@@ -29,26 +28,18 @@ import moment from "moment";
import Footer from "@/components/Footer";
import {
factorySelectRegister,
shopSelectByFactory,
storeselectionBoxAll,
productionLineSelectByShops,
sectionSelectByShops,
allUserSelect,
departmentTree,
roleSelectRegister,
} from "@/services/system";
import { doFetch } from "@/utils/doFetch";
import { ProDescriptions } from '@ant-design/pro-components';
const LoginMessage = ({ content }) => (
<Alert
style={{
marginBottom: 24,
}}
message={content}
type="error"
showIcon
/>
);
const { Search } = Input;
const { TabPane } = Tabs;
......@@ -56,8 +47,11 @@ let col = { xs: 0, sm: 0, md: 7, lg: 6, xl: 6, xxl: 6 },
cols = { xs: 24, sm: 24, md: 17, lg: 18, xl: 18, xxl: 18 };
const Login = () => {
const formRef = useRef();
const { initialState, setInitialState } = useModel("@@initialState");
const [tabkey, settabkey] = useState("1");
const [visible, setvisible] = useState(true);
const [data, setdata] = useState();
const fetchUserInfo = async () => {
const userInfo = await initialState?.fetchUserInfo(),
menuData = await initialState?.getmenuData();
......@@ -105,14 +99,24 @@ const Login = () => {
}
};
const handleReg = async (values) => {
console.log(values);
debugger
// 登录
const res = await saveForRegister({ ...values });
if (res.code === "0000") {
message.success("注册成功,根据用户名可查询注册进度");
formRef.current.resetFields();
return;
}
};
const handleSubmit = async (values) => {
if (tabkey == "1") {
await handleLogin(values)
} else {
await handleReg(values)
}
}
......@@ -131,12 +135,154 @@ const Login = () => {
<div className="cover">
<img alt="logo" src={require("@/assets/logo_white.png")} />
</div>
{
visible && <div className={styles.search}>
<h2 style={{ fontSize: 16, borderBottom: "6px solid #eee", marginBottom: 12, paddingBottom: 12 }} className="spread">
<a>
查询注册进度
</a>
<CloseOutlined style={{ color: "red" }} onClick={() => {
setvisible(false)
}}>
</CloseOutlined>
</h2>
<Search
placeholder="请输入手机号"
allowClear
onSearch={(value) => {
if (value) {
doFetch({
url: "/ngic-auth/sysAccountApply/queryByPhone",
params: { accountName: value.replace(/^\s+|\s+$/g, "") },
}).then((res) => {
if (res.code == "0000") {
let data = res?.data?.data;
setdata(data);
}
});
}
}}
style={{ width: "100%", marginBottom: 15 }}
/>
<ProDescriptions
columns={[
{
"title": "用户名",
"dataIndex": "accountName",
"key": "accountName"
},
{
"title": "姓名",
"dataIndex": "userName",
"key": "userName"
},
{
"title": "联系电话",
"dataIndex": "telephone",
"key": "telephone"
},
{
"title": "工厂",
"dataIndex": "factoryName",
"key": "factoryName"
},
{
"title": "组织",
"dataIndex": "departmentName",
"key": "departmentName"
},
{
"title": "负责仓库",
"dataIndex": "chargeStoreName",
"key": "chargeStoreName"
},
{
"title": "角色",
"dataIndex": "roleName",
"key": "roleName"
},
{
"title": "直属领导",
"dataIndex": "parentName",
"key": "parentName"
},
{
"title": "邮箱",
"dataIndex": "mailNo",
"key": "mailNo"
},
{
"title": "审批结果",
"dataIndex": "auditResultName",
"key": "auditResultName"
},
{
"title": "这是审批意见",
"dataIndex": "auditOpinion",
"key": "auditOpinion"
},
{
"title": "审批状态",
"dataIndex": "statusName",
"key": "statusName"
},
{
"title": "备注",
"dataIndex": "remark",
"key": "remark"
},
{
"title": "申请时间",
"dataIndex": "applyTime",
"key": "applyTime"
},
{
"title": "审批时间",
"dataIndex": "auditTime",
"key": "auditTime"
},
{
"title": "审批人",
"dataIndex": "auditUserName",
"key": "auditUserName"
}
]}
column={1}
dataSource={data}
></ProDescriptions>
</div>
}
</div>
</Col>
<Col {...cols}>
<div className="logincontent" style={{ width: "100%", height: "100%", display: "flex", flexDirection: "column" }}>
<div className={styles.content}>
<LoginForm
submitter={{
render: (props) => {
return <Button
{...props}
style={{ width: "100%" }}
type="primary"
size="large"
icon={tabkey === "1" ? <LoginOutlined /> : <ArrowRightOutlined />}
onClick={async () => {
let values = await formRef.current.validateFields()
await handleSubmit(values);
}}
>
{tabkey === "1" ? "登录" : "注册"}
</Button>
}
}}
title={<span style={{ color: "#fff" }}>WMS</span>}
subTitle={
<span style={{ color: "rgba(255,255,255,0.6)" }}>
......@@ -150,11 +296,14 @@ const Login = () => {
await handleSubmit(values);
}}
style={{ width: tabkey == "2" ? 560 : 328, marginLeft: tabkey == "2" ? -116 : 0 }}//样式适配
formRef={formRef}
>
<Tabs
style={{ justifyContent: "flex-start" }}
activeKey={tabkey}
onChange={settabkey}
tabBarStyle={{ color: "#fff" }}
tabBarExtraContent={<a style={{ color: "rgba(255,255,255,0.6)" }}>查询注册进度</a>}
>
<TabPane tab="登录" key="1">
{tabkey == "1" && (
......@@ -195,6 +344,11 @@ const Login = () => {
<Row className="reg" gutter={12}>
<Col span={8}>
<ProFormText
fieldProps={{
style: {
height: 32
}
}}
name="accountName"
label={<b>用户名</b>}
placeholder="请输入用户名"
......@@ -209,6 +363,11 @@ const Login = () => {
<Col span={8}>
<ProFormText
fieldProps={{
style: {
height: 32
}
}}
name="userName"
label={<b>姓名</b>}
placeholder="请输入姓名"
......@@ -223,6 +382,11 @@ const Login = () => {
<Col span={8}>
<ProFormText
fieldProps={{
style: {
height: 32
}
}}
name="telephone"
label={<b>联系电话</b>}
placeholder="请输入联系电话"
......@@ -242,8 +406,8 @@ const Login = () => {
<Col span={8}>
<ProFormTreeSelect
name="departmentId"
label={<b>组织</b>}
placeholder="请选择组织"
label={<b>部门</b>}
placeholder="请选择部门"
fieldProps={{
fieldNames: {
label: "title",
......@@ -258,7 +422,7 @@ const Login = () => {
rules={[
{
required: true,
message: "请选择组织!",
message: "请选择部门!",
}
]}
/>
......@@ -266,7 +430,11 @@ const Login = () => {
<Col span={8}>
<ProFormSelect
name="factoryId"
fieldProps={{
mode: "multiple",
maxTagCount: 1
}}
name="factoryIdList"
label={<b>工厂</b>}
placeholder="请选择工厂"
request={async () => {
......@@ -283,17 +451,36 @@ const Login = () => {
</Col>
<Col span={8}>
<ProFormDependency name={["factoryId"]}>
<ProFormSelect
fieldProps={{
mode: "multiple",
maxTagCount: 1
}}
name="storeIdList"
label={<b>负责仓库</b>}
placeholder={"请选择负责仓库"}
request={async () => {
let res = await storeselectionBoxAll({});
return res?.data?.dataList ?? []
}}
rules={[
{
required: false,
message: "请选择负责仓库!",
}
]}
/>
{/* <ProFormDependency name={["factoryId"]}>
{
({ factoryId }) => {
return <ProFormSelect
name="shopIdList"
name="storeIdList"
label={<b>负责仓库</b>}
placeholder={"请选择负责仓库"}
params={{ factoryId }}
request={async (params) => {
let res = await shopSelectByFactory({ factoryId: params.factoryId });
let res = await storeselectionBoxAll({});
return res?.data?.dataList ?? []
}}
rules={[
......@@ -307,12 +494,16 @@ const Login = () => {
}
</ProFormDependency>
</ProFormDependency> */}
</Col>
<Col span={8}>
<ProFormSelect
fieldProps={{
mode: "multiple",
maxTagCount: 1
}}
name="roleIdList"
label={<b>角色配置</b>}
placeholder="请选择角色配置"
......@@ -348,13 +539,14 @@ const Login = () => {
</Col>
<Col span={8}>
<ProFormText
fieldProps={{
style: {
height: 32
}
}}
name="mailNo"
label={<b>邮箱</b>}
placeholder="请输入邮箱"
request={async () => {
let res = await allUserSelect({});
return res?.data?.dataList ?? []
}}
rules={[
{
required: false,
......
......@@ -52,3 +52,14 @@
color: @primary-color;
}
}
.search{
position: absolute;
left: 0;
top: 0;
z-index: 999;
background-color: #ffffff;
width: 100%;
height: 100%;
padding: 12px;
}
\ No newline at end of file
......@@ -49,6 +49,9 @@ const Logon = (props) => {
<div className={styles.main}>
<div>
<img src="./logo.svg" alt="" style={{ width: 44, marginBottom: 30 }} />
</div>
<div className={`${styles.body} logon`}>
<Tabs
......
......@@ -16,6 +16,15 @@ export async function fakeAccountLoginOut(params) {
});
}
//登录
export async function saveForRegister(params) {
return request("/wms/ngic-auth/sysAccountApply/saveForRegister", {
method: "POST",
data: params,
});
}
//个人信息
export async function queryCurrentUser(params) {
return request("/wms/ngic-auth/sysUser/query", {
......
......@@ -29,7 +29,13 @@ export async function shopSelect(params) {
data: params,
});
}
//仓库下拉
export async function storeselectionBoxAll(params) {
return request(`/wms/ngic-auth/sysStore/selectionBoxAll`, {
method: "POST",
data: params,
});
}
//根据工厂id查询车间下拉
export async function shopSelectByFactory(params) {
return request(`/wms/ngic-auth/sysShop/query/selectbox/factory`, {
......
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