deartibers
2 years ago
10 changed files with 433 additions and 418 deletions
After Width: | Height: | Size: 14 KiB |
@ -0,0 +1,117 @@ |
|||||
|
import React, { useState, useRef, useEffect } from "react"; |
||||
|
import { connect } from "react-redux"; |
||||
|
import { Modal, Form, Button, Upload, Toast } from "@douyinfe/semi-ui"; |
||||
|
import { IconAlertCircle } from '@douyinfe/semi-icons'; |
||||
|
import cityData from './city.json'; |
||||
|
import PerfectScrollbar from "perfect-scrollbar"; |
||||
|
import './style.less' |
||||
|
let Scrollbar; |
||||
|
function deleteModal (props) { |
||||
|
const { |
||||
|
close, |
||||
|
cancel, |
||||
|
visible, |
||||
|
dispatch, |
||||
|
actions, |
||||
|
pepUserId |
||||
|
} = props; |
||||
|
const { humanAffairs } = actions; |
||||
|
const form = useRef();//表单 |
||||
|
|
||||
|
const [idPhoto, setIdPhoto] = useState(); //证件照 |
||||
|
|
||||
|
const [word, setWord] = useState(); //简历 |
||||
|
//初始化 |
||||
|
useEffect(() => { |
||||
|
setWord(JSON.parse(localStorage.getItem('word'))) |
||||
|
}, []); |
||||
|
|
||||
|
useEffect(() => { |
||||
|
const Project = document.getElementById("myForm"); |
||||
|
if (Project) { |
||||
|
if (Project && Scrollbar) { |
||||
|
Scrollbar.update(); |
||||
|
} |
||||
|
Scrollbar = new PerfectScrollbar("#myForm", { |
||||
|
suppressScrollX: true, |
||||
|
}); |
||||
|
} |
||||
|
}); |
||||
|
function handleOk () { |
||||
|
//点击弹框确定 右边按钮 |
||||
|
form.current |
||||
|
.validate() |
||||
|
.then((values) => { |
||||
|
if (word == values.word) { |
||||
|
dispatch(humanAffairs.delMember({ pepUserId: pepUserId, msg: '删除档案' })).then((res) => {//获取项企(PEP)全部部门及其下用户 |
||||
|
if (res.success) { |
||||
|
close(); |
||||
|
} |
||||
|
}) |
||||
|
} |
||||
|
else { |
||||
|
Toast.error('密码错误'); |
||||
|
form.current.setValue('word', '') |
||||
|
} |
||||
|
|
||||
|
}) |
||||
|
} |
||||
|
function handleCancel () { |
||||
|
cancel(); |
||||
|
//点击弹框取消 左边按钮 |
||||
|
} |
||||
|
return ( |
||||
|
<> |
||||
|
<Modal |
||||
|
title={'警告'} |
||||
|
okText="确认删除" |
||||
|
cancelText="取消" |
||||
|
visible={visible} |
||||
|
onOk={handleOk} |
||||
|
width={500} |
||||
|
onCancel={handleCancel} |
||||
|
> |
||||
|
<div style={{ borderBottom: '1px solid #DCDEE0', margin: '0px -24px' }}></div> |
||||
|
<Form |
||||
|
// allowEmpty |
||||
|
labelPosition="left" |
||||
|
labelAlign="right" |
||||
|
labelWidth="116px" |
||||
|
onValueChange={(values, field) => { |
||||
|
console.log('values', values); |
||||
|
}} |
||||
|
getFormApi={(formApi) => (form.current = formApi)} |
||||
|
> |
||||
|
<div style={{ padding: '20px 0px' }}> |
||||
|
<div style={{ display: 'flex', alignItems: 'center' }}> |
||||
|
<div> |
||||
|
<Form.Input |
||||
|
field="word" |
||||
|
label='我的登录密码:' |
||||
|
style={{ width: 334 }} |
||||
|
initValue={'' || ""} |
||||
|
placeholder="请输入登录密码" |
||||
|
mode="password" |
||||
|
showClear |
||||
|
rules={[{ required: true, message: "请输入登录密码" }]} |
||||
|
/> |
||||
|
</div> |
||||
|
</div> |
||||
|
</div> |
||||
|
</Form> |
||||
|
</Modal > |
||||
|
</> |
||||
|
); |
||||
|
} |
||||
|
function mapStateToProps (state) { |
||||
|
const { auth, global, members } = state; |
||||
|
return { |
||||
|
// loading: members.isRequesting, |
||||
|
user: auth.user, |
||||
|
actions: global.actions, |
||||
|
apiRoot: global.apiRoot, |
||||
|
// members: members.data, |
||||
|
}; |
||||
|
} |
||||
|
|
||||
|
export default connect(mapStateToProps)(deleteModal); |
@ -0,0 +1,15 @@ |
|||||
|
.upload{ |
||||
|
.semi-upload-file-card{ |
||||
|
width:182px; |
||||
|
} |
||||
|
} |
||||
|
.vitae{ |
||||
|
.semi-upload-file-card{ |
||||
|
width:288px; |
||||
|
height: 32px; |
||||
|
.semi-upload-file-card-preview{ |
||||
|
height: 30px; |
||||
|
width: 30px; |
||||
|
} |
||||
|
} |
||||
|
} |
Loading…
Reference in new issue