feature/2.19.1.2501.01-移动端查看工资单密码设置
This commit is contained in:
parent
fab27c99ed
commit
94c9a39f9f
|
|
@ -19,3 +19,69 @@ export const secondaryVerifyConditions = [
|
||||||
defaultshow: true
|
defaultshow: true
|
||||||
}
|
}
|
||||||
];
|
];
|
||||||
|
export const loginCondition = [
|
||||||
|
{
|
||||||
|
items: [
|
||||||
|
{
|
||||||
|
conditionType: "INPUT",
|
||||||
|
domkey: ["password"],
|
||||||
|
fieldcol: 14,
|
||||||
|
label: "登录密码",
|
||||||
|
labelcol: 10,
|
||||||
|
value: "",
|
||||||
|
otherParams: {
|
||||||
|
type: "password"
|
||||||
|
},
|
||||||
|
rules: "required|string",
|
||||||
|
viewAttr: 3
|
||||||
|
}
|
||||||
|
],
|
||||||
|
title: "",
|
||||||
|
defaultshow: true
|
||||||
|
}
|
||||||
|
];
|
||||||
|
export const secondarypwdCondition = [
|
||||||
|
{
|
||||||
|
items: [
|
||||||
|
{
|
||||||
|
conditionType: "INPUT",
|
||||||
|
domkey: ["secondaryPwd1"],
|
||||||
|
fieldcol: 14,
|
||||||
|
label: "密码",
|
||||||
|
labelcol: 10,
|
||||||
|
value: "",
|
||||||
|
otherParams: {
|
||||||
|
type: "password",
|
||||||
|
passwordStrength: true
|
||||||
|
},
|
||||||
|
rules: "required|string",
|
||||||
|
viewAttr: 3
|
||||||
|
},
|
||||||
|
{
|
||||||
|
conditionType: "INPUT",
|
||||||
|
domkey: ["secondaryPwd2"],
|
||||||
|
fieldcol: 14,
|
||||||
|
label: "确认密码",
|
||||||
|
labelcol: 10,
|
||||||
|
value: "",
|
||||||
|
otherParams: {
|
||||||
|
type: "password"
|
||||||
|
},
|
||||||
|
rules: "required|string",
|
||||||
|
viewAttr: 3
|
||||||
|
},
|
||||||
|
{
|
||||||
|
conditionType: "INPUT",
|
||||||
|
domkey: ["validatecode"],
|
||||||
|
fieldcol: 14,
|
||||||
|
label: "验证码",
|
||||||
|
labelcol: 10,
|
||||||
|
value: "",
|
||||||
|
rules: "required|string",
|
||||||
|
viewAttr: 3
|
||||||
|
}
|
||||||
|
],
|
||||||
|
title: "",
|
||||||
|
defaultshow: true
|
||||||
|
}
|
||||||
|
];
|
||||||
|
|
|
||||||
|
|
@ -15,9 +15,9 @@ import PassSetDialog from "./passSetDialog";
|
||||||
import { ConfirmBtns } from "../mySalary/mySalaryView";
|
import { ConfirmBtns } from "../mySalary/mySalaryView";
|
||||||
import Content from "../../components/pcTemplate/content";
|
import Content from "../../components/pcTemplate/content";
|
||||||
import MobileTemplate from "../../components/mobileTemplate";
|
import MobileTemplate from "../../components/mobileTemplate";
|
||||||
import "../mySalary/index.less";
|
|
||||||
import MobileModal from "./mobileModal";
|
|
||||||
import SecondaryVerify from "./secondaryVerify";
|
import SecondaryVerify from "./secondaryVerify";
|
||||||
|
import { removeElementById } from "../../util";
|
||||||
|
import "../mySalary/index.less";
|
||||||
|
|
||||||
const getLabel = WeaLocaleProvider.getLabel;
|
const getLabel = WeaLocaleProvider.getLabel;
|
||||||
|
|
||||||
|
|
@ -85,11 +85,11 @@ export default class MobilePayroll extends React.Component {
|
||||||
API.isNeedSecondPwdVerify({ mouldCode: "HRM", itemCode: "SALARY" }, this.state.salaryBillToken)
|
API.isNeedSecondPwdVerify({ mouldCode: "HRM", itemCode: "SALARY" }, this.state.salaryBillToken)
|
||||||
.then(({ status, isNeedSecondAuth }) => {
|
.then(({ status, isNeedSecondAuth }) => {
|
||||||
if (status && isNeedSecondAuth) {
|
if (status && isNeedSecondAuth) {
|
||||||
ReactDom.render(
|
ReactDom.render(<SecondaryVerify {...this.props} salaryBillToken={this.state.salaryBillToken}
|
||||||
<MobileModal title={getLabel(111, "身份验证")} onConfirm={() => message.error("请输入密码")}>
|
onSuccess={() => {
|
||||||
<SecondaryVerify/>
|
removeElementById("am-modal-container");
|
||||||
</MobileModal>,
|
this.getMySalaryBill(getQueryString("id"));
|
||||||
document.body);
|
}}/>, document.body);
|
||||||
return;
|
return;
|
||||||
this.setState({ visible: true }, () => {
|
this.setState({ visible: true }, () => {
|
||||||
API.getSecondAuthForm({ mouldCode: "HRM", itemCode: "SALARY" }, this.state.salaryBillToken)
|
API.getSecondAuthForm({ mouldCode: "HRM", itemCode: "SALARY" }, this.state.salaryBillToken)
|
||||||
|
|
|
||||||
|
|
@ -52,7 +52,7 @@
|
||||||
}
|
}
|
||||||
|
|
||||||
.am-modal-transparent {
|
.am-modal-transparent {
|
||||||
width: 270px;
|
width: 80%;
|
||||||
}
|
}
|
||||||
|
|
||||||
.am-modal-transparent .am-modal-content {
|
.am-modal-transparent .am-modal-content {
|
||||||
|
|
@ -92,50 +92,38 @@
|
||||||
height: 100%;
|
height: 100%;
|
||||||
line-height: 1.5;
|
line-height: 1.5;
|
||||||
overflow: auto;
|
overflow: auto;
|
||||||
padding: 0 15px 15px;
|
padding: 0 15px 30px;
|
||||||
|
|
||||||
.wea-search-group, .wea-content, .wea-form-cell {
|
.wea-search-group, .wea-content, .wea-form-cell {
|
||||||
padding: 0;
|
padding: 0;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
.am-modal {
|
|
||||||
position: fixed;
|
|
||||||
top: 50%;
|
|
||||||
left: 50%;
|
|
||||||
transform: translate(-50%, -50%);
|
|
||||||
z-index: 1000;
|
|
||||||
}
|
|
||||||
|
|
||||||
.am-modal-wrap {
|
.am-modal-wrap {
|
||||||
height: 100vh;
|
position: fixed;
|
||||||
|
overflow: auto;
|
||||||
|
top: 0;
|
||||||
|
right: 0;
|
||||||
|
bottom: 0;
|
||||||
|
left: 0;
|
||||||
|
height: 100%;
|
||||||
|
z-index: 999;
|
||||||
|
-webkit-overflow-scrolling: touch;
|
||||||
|
outline: 0;
|
||||||
|
display: -webkit-box;
|
||||||
|
display: -webkit-flex;
|
||||||
|
display: -ms-flexbox;
|
||||||
display: flex;
|
display: flex;
|
||||||
justify-content: center;
|
-webkit-box-align: center;
|
||||||
|
-webkit-align-items: center;
|
||||||
|
-ms-flex-align: center;
|
||||||
align-items: center;
|
align-items: center;
|
||||||
//position: fixed;
|
-webkit-box-pack: center;
|
||||||
//overflow: auto;
|
-webkit-justify-content: center;
|
||||||
//top: 0;
|
-ms-flex-pack: center;
|
||||||
//right: 0;
|
justify-content: center;
|
||||||
//bottom: 0;
|
-webkit-transform: translateZ(1px);
|
||||||
//left: 0;
|
transform: translateZ(1px);
|
||||||
//height: 100%;
|
|
||||||
//z-index: 999;
|
|
||||||
//-webkit-overflow-scrolling: touch;
|
|
||||||
//outline: 0;
|
|
||||||
//display: -webkit-box;
|
|
||||||
//display: -webkit-flex;
|
|
||||||
//display: -ms-flexbox;
|
|
||||||
//display: flex;
|
|
||||||
//-webkit-box-align: center;
|
|
||||||
//-webkit-align-items: center;
|
|
||||||
//-ms-flex-align: center;
|
|
||||||
//align-items: center;
|
|
||||||
//-webkit-box-pack: center;
|
|
||||||
//-webkit-justify-content: center;
|
|
||||||
//-ms-flex-pack: center;
|
|
||||||
//justify-content: center;
|
|
||||||
//-webkit-transform: translateZ(1px);
|
|
||||||
//transform: translateZ(1px);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
.am-modal-button-group-h {
|
.am-modal-button-group-h {
|
||||||
|
|
|
||||||
|
|
@ -0,0 +1,56 @@
|
||||||
|
/*
|
||||||
|
* 登录密码验证
|
||||||
|
*
|
||||||
|
* @Author: 黎永顺
|
||||||
|
* @Date: 2025/4/17
|
||||||
|
* @Wechat:
|
||||||
|
* @Email: 971387674@qq.com
|
||||||
|
* @description:
|
||||||
|
*/
|
||||||
|
import React, { Component } from "react";
|
||||||
|
import ReactDom from "react-dom";
|
||||||
|
import { WeaLocaleProvider } from "ecCom";
|
||||||
|
import { WeaForm } from "comsMobx";
|
||||||
|
import FormInfo from "../../components/FormInfo";
|
||||||
|
import { loginCondition } from "./conditions";
|
||||||
|
import MobileModal from "./mobileModal";
|
||||||
|
import SecondarypwdVerify from "./secondarypwdVerify";
|
||||||
|
import { checkPassword } from "../../apis/mySalaryBenefits";
|
||||||
|
import { RSAEcrypt } from "../../util/RSAUtil";
|
||||||
|
|
||||||
|
const form = new WeaForm();
|
||||||
|
const getLabel = WeaLocaleProvider.getLabel;
|
||||||
|
|
||||||
|
class LoginVerify extends Component {
|
||||||
|
|
||||||
|
componentDidMount() {
|
||||||
|
form.initFormFields(loginCondition);
|
||||||
|
}
|
||||||
|
|
||||||
|
save = async () => {
|
||||||
|
form.validateForm().then(f => {
|
||||||
|
if (f.isValid) {
|
||||||
|
RSAEcrypt("1", { ...form.getFormParams() }).then(RSAParam => {
|
||||||
|
checkPassword({ ...RSAParam }).then(({ result }) => {
|
||||||
|
if (result) {
|
||||||
|
ReactDom.render(<SecondarypwdVerify {...this.props} />, document.body);
|
||||||
|
} else {
|
||||||
|
form.showError("password", getLabel(504343, "登录密码错误"));
|
||||||
|
}
|
||||||
|
});
|
||||||
|
});
|
||||||
|
} else {
|
||||||
|
f.showErrors();
|
||||||
|
}
|
||||||
|
});
|
||||||
|
};
|
||||||
|
|
||||||
|
render() {
|
||||||
|
const itemRender = {};
|
||||||
|
return (<MobileModal title={getLabel(111, "请先输入登录密码")} onConfirm={this.save}>
|
||||||
|
<FormInfo center={false} itemRender={itemRender} form={form} formFields={loginCondition}/>
|
||||||
|
</MobileModal>);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
export default LoginVerify;
|
||||||
|
|
@ -15,10 +15,28 @@ import "./index.less";
|
||||||
const getLabel = WeaLocaleProvider.getLabel;
|
const getLabel = WeaLocaleProvider.getLabel;
|
||||||
|
|
||||||
class MobileModal extends Component {
|
class MobileModal extends Component {
|
||||||
|
componentDidMount() {
|
||||||
|
this.setMetaViewport();
|
||||||
|
}
|
||||||
|
|
||||||
|
setMetaViewport = () => {
|
||||||
|
// 检查是否已存在 viewport meta 标签
|
||||||
|
let viewportMeta = document.querySelector("meta[name=\"viewport\"]");
|
||||||
|
if (!viewportMeta) {
|
||||||
|
// 如果不存在,创建一个新的 meta 标签
|
||||||
|
viewportMeta = document.createElement("meta");
|
||||||
|
viewportMeta.setAttribute("name", "viewport");
|
||||||
|
document.head.appendChild(viewportMeta);
|
||||||
|
}
|
||||||
|
// 设置或更新 viewport 的 content 属性
|
||||||
|
const content = "width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no, viewport-fit=cover";
|
||||||
|
viewportMeta.setAttribute("content", content);
|
||||||
|
};
|
||||||
|
|
||||||
render() {
|
render() {
|
||||||
return (
|
return (
|
||||||
<div id="am-modal-container">
|
<div id="am-modal-container">
|
||||||
<div style={{overflow: "hidden"}}>
|
<div>
|
||||||
<div className="am-modal-mask"></div>
|
<div className="am-modal-mask"></div>
|
||||||
<div className="am-modal-wrap">
|
<div className="am-modal-wrap">
|
||||||
<div className="am-modal am-modal-transparent">
|
<div className="am-modal am-modal-transparent">
|
||||||
|
|
|
||||||
|
|
@ -8,22 +8,76 @@
|
||||||
* @description:
|
* @description:
|
||||||
*/
|
*/
|
||||||
import React, { Component } from "react";
|
import React, { Component } from "react";
|
||||||
|
import ReactDom from "react-dom";
|
||||||
import { WeaLocaleProvider } from "ecCom";
|
import { WeaLocaleProvider } from "ecCom";
|
||||||
import { WeaForm } from "comsMobx";
|
import { WeaForm, WeaSwitch } from "comsMobx";
|
||||||
|
import { message } from "antd";
|
||||||
import FormInfo from "../../components/FormInfo";
|
import FormInfo from "../../components/FormInfo";
|
||||||
import { secondaryVerifyConditions } from "./conditions";
|
import { secondaryVerifyConditions } from "./conditions";
|
||||||
|
import * as API from "../../apis/mySalaryBenefits";
|
||||||
|
import MobileModal from "./mobileModal";
|
||||||
|
import LoginVerify from "./loginVerify";
|
||||||
|
|
||||||
const form = new WeaForm();
|
const form = new WeaForm();
|
||||||
const getLabel = WeaLocaleProvider.getLabel;
|
const getLabel = WeaLocaleProvider.getLabel;
|
||||||
|
|
||||||
class SecondaryVerify extends Component {
|
class SecondaryVerify extends Component {
|
||||||
|
constructor(props) {
|
||||||
|
super(props);
|
||||||
|
this.state = { notSetting: false };
|
||||||
|
}
|
||||||
|
|
||||||
componentDidMount() {
|
componentDidMount() {
|
||||||
|
API.getSecondAuthForm({ mouldCode: "HRM", itemCode: "SALARY" }, this.props.salaryBillToken)
|
||||||
|
.then(({ notSetting }) => {
|
||||||
|
this.setState({ notSetting });
|
||||||
|
});
|
||||||
form.initFormFields(secondaryVerifyConditions);
|
form.initFormFields(secondaryVerifyConditions);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
doSecondAuth = () => {
|
||||||
|
form.validateForm().then(f => {
|
||||||
|
if (f.isValid) {
|
||||||
|
const { mySalaryStore: { setInitEmVerify }, salaryBillToken } = this.props;
|
||||||
|
API.doSecondAuth({ mouldCode: "HRM", itemCode: "SALARY", ...form.getFormParams() }, salaryBillToken)
|
||||||
|
.then(({ status, checkStatus, checkMsg }) => {
|
||||||
|
if (status && checkStatus === "1") {
|
||||||
|
message.success(checkMsg);
|
||||||
|
setInitEmVerify();
|
||||||
|
this.props.onSuccess();
|
||||||
|
} else {
|
||||||
|
form.showError("authCode", checkMsg);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
} else {
|
||||||
|
f.showErrors();
|
||||||
|
}
|
||||||
|
});
|
||||||
|
};
|
||||||
|
handleSetSecondaryPassword = () => {
|
||||||
|
ReactDom.render(<LoginVerify {...this.props} />, document.body);
|
||||||
|
};
|
||||||
|
|
||||||
render() {
|
render() {
|
||||||
const itemRender = {};
|
const { notSetting } = this.state;
|
||||||
return (<FormInfo center={false} itemRender={itemRender} form={form} formFields={secondaryVerifyConditions}/>);
|
const itemRender = {
|
||||||
|
authCode: (field, textAreaProps, form, formParams) => {
|
||||||
|
return (<React.Fragment>
|
||||||
|
<WeaSwitch fieldConfig={{ ...field, ...textAreaProps }} form={form} formParams={formParams}/>
|
||||||
|
{
|
||||||
|
notSetting &&
|
||||||
|
<div style={{ clear: "both", paddingTop: 10 }}>
|
||||||
|
{getLabel(111, "您还未设置二次验证密码,点击")}
|
||||||
|
<a href="javascript:void(0);" onClick={this.handleSetSecondaryPassword}>{getLabel(111, "设置")}</a>
|
||||||
|
</div>
|
||||||
|
}
|
||||||
|
</React.Fragment>);
|
||||||
|
}
|
||||||
|
};
|
||||||
|
return (<MobileModal title={getLabel(111, "身份验证")} onConfirm={this.doSecondAuth}>
|
||||||
|
<FormInfo center={false} custLabelCol={10} itemRender={itemRender} form={form}
|
||||||
|
formFields={secondaryVerifyConditions}/>
|
||||||
|
</MobileModal>);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -0,0 +1,68 @@
|
||||||
|
/*
|
||||||
|
* 二次验证密码设置
|
||||||
|
*
|
||||||
|
* @Author: 黎永顺
|
||||||
|
* @Date: 2025/4/17
|
||||||
|
* @Wechat:
|
||||||
|
* @Email: 971387674@qq.com
|
||||||
|
* @description:
|
||||||
|
*/
|
||||||
|
import React, { Component } from "react";
|
||||||
|
import { WeaLocaleProvider } from "ecCom";
|
||||||
|
import { WeaForm, WeaSwitch } from "comsMobx";
|
||||||
|
import FormInfo from "../../components/FormInfo";
|
||||||
|
import { secondarypwdCondition } from "./conditions";
|
||||||
|
import MobileModal from "./mobileModal";
|
||||||
|
import { RSAEcrypt } from "../../util/RSAUtil";
|
||||||
|
|
||||||
|
const form = new WeaForm();
|
||||||
|
const getLabel = WeaLocaleProvider.getLabel;
|
||||||
|
|
||||||
|
class SecondarypwdVerify extends Component {
|
||||||
|
constructor(props) {
|
||||||
|
super(props);
|
||||||
|
this.state = {
|
||||||
|
src: (window.ecologyContentPath || "") + "/weaver/weaver.file.MakeValidateCode?notneedvalidate=1&isView=1&validatetype=0&validatenum=4",
|
||||||
|
num: 0
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
|
componentDidMount() {
|
||||||
|
form.initFormFields(secondarypwdCondition);
|
||||||
|
}
|
||||||
|
|
||||||
|
save = async () => {
|
||||||
|
form.validateForm().then(f => {
|
||||||
|
if (f.isValid) {
|
||||||
|
RSAEcrypt("1", { ...form.getFormParams() }).then(RSAParam => {
|
||||||
|
console.log(form.getFormParams(), this.props);
|
||||||
|
});
|
||||||
|
} else {
|
||||||
|
f.showErrors();
|
||||||
|
}
|
||||||
|
});
|
||||||
|
};
|
||||||
|
|
||||||
|
render() {
|
||||||
|
const itemRender = {
|
||||||
|
validatecode: (field, textAreaProps, form, formParams) => {
|
||||||
|
return (<React.Fragment>
|
||||||
|
<WeaSwitch fieldConfig={{ ...field, ...textAreaProps }} form={form} formParams={formParams}/>
|
||||||
|
<img
|
||||||
|
style={{ height: 30, cursor: "pointer", position: "absolute", left: "105%" }}
|
||||||
|
src={this.state.src}
|
||||||
|
onClick={() => {
|
||||||
|
this.setState({ num: this.state.num + 1 }, () => {
|
||||||
|
this.setState({ src: `${window.ecologyContentPath || ""}/weaver/weaver.file.MakeValidateCode?notneedvalidate=1&isView=1&validatetype=0&validatenum=4&seriesnum_=${this.state.num}` });
|
||||||
|
});
|
||||||
|
}} alt=""/>
|
||||||
|
</React.Fragment>);
|
||||||
|
}
|
||||||
|
};
|
||||||
|
return (<MobileModal title={getLabel(111, "二次验证密码设置")} onConfirm={this.save}>
|
||||||
|
<FormInfo center={false} itemRender={itemRender} form={form} formFields={secondarypwdCondition}/>
|
||||||
|
</MobileModal>);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
export default SecondarypwdVerify;
|
||||||
Loading…
Reference in New Issue