From c4eacd7552781c58bdca11581d5a45a58e00799f Mon Sep 17 00:00:00 2001 From: "sylor_huang@126.com" Date: Mon, 22 Jun 2020 17:32:43 +0800 Subject: [PATCH 01/11] change --- src/AppConfig.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/AppConfig.js b/src/AppConfig.js index e07996277..81e5439c0 100644 --- a/src/AppConfig.js +++ b/src/AppConfig.js @@ -100,7 +100,7 @@ export function initAxiosInterceptors(props) { // TODO 读取到package.json中的配置? var proxy = "http://localhost:3000" // proxy = "https://pre-newweb.educoder.net" - proxy = "https://testforgeplus.trustie.net/" + // proxy = "https://testforgeplus.trustie.net/" // 在这里使用requestMap控制,避免用户通过双击等操作发出重复的请求; From 7ba94ee0941980a0b87ac6914db90a5fb71c4477 Mon Sep 17 00:00:00 2001 From: "sylor_huang@126.com" Date: Mon, 22 Jun 2020 17:49:11 +0800 Subject: [PATCH 02/11] change header --- src/AppConfig.js | 2 +- src/modules/tpm/NewHeader.js | 8 ++++++++ 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/src/AppConfig.js b/src/AppConfig.js index 79caf0d7c..12abacae9 100644 --- a/src/AppConfig.js +++ b/src/AppConfig.js @@ -100,7 +100,7 @@ export function initAxiosInterceptors(props) { // TODO 读取到package.json中的配置? var proxy = "http://localhost:3000" // proxy = "https://pre-newweb.educoder.net" - // proxy = "https://testforgeplus.trustie.net/" + proxy = "https://testforgeplus.trustie.net/" // 在这里使用requestMap控制,避免用户通过双击等操作发出重复的请求; diff --git a/src/modules/tpm/NewHeader.js b/src/modules/tpm/NewHeader.js index 074b2b6c7..1c290730a 100644 --- a/src/modules/tpm/NewHeader.js +++ b/src/modules/tpm/NewHeader.js @@ -617,6 +617,8 @@ class NewHeader extends Component { return true } else if (url.startsWith('/statistics') && match.path.startsWith('/statistics')) { return true + } else if (url.startsWith('/users') && match.path.startsWith('/users')) { + return true } else { return false } @@ -812,6 +814,12 @@ class NewHeader extends Component { ) }) } + { + this.props.current_user && this.props.current_user.login && +
  • this.headtypesonClick(`/users/${this.props.current_user.login}`, true)} className={`${this.matchpaths(`/users/${this.props.current_user.login}`) === true ? 'pr active' : 'pr'}`} style={true ? { display: 'flex' } : { display: 'none' }}> + 项目 +
  • + } : "" From eb7235951173221036a5e10b91f27dc43c89f289 Mon Sep 17 00:00:00 2001 From: caishi <1149225589@qq.com> Date: Wed, 24 Jun 2020 10:10:47 +0800 Subject: [PATCH 03/11] =?UTF-8?q?=E7=BB=84=E7=BB=87=E8=AE=BE=E7=BD=AE?= =?UTF-8?q?=E9=83=A8=E5=88=86=E9=A1=B5=E9=9D=A2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/AppConfig.js | 2 +- src/forge/Component/SearchUser.jsx | 70 ++++++++++++ src/forge/Component/layout.jsx | 3 +- src/forge/Settings/setting.scss | 11 +- src/forge/Team/Index.scss | 48 +++++++++ src/forge/Team/TeamSettingCommon.jsx | 106 +++++++++++++++++++ src/forge/Team/TeamSettingGroup.jsx | 71 +++++++++++++ src/forge/Team/TeamSettingIndex.jsx | 60 ++++++++++- src/forge/Team/TeamSettingMember.jsx | 152 +++++++++++++++++++++++++++ src/forge/css/index.scss | 14 +++ 10 files changed, 520 insertions(+), 17 deletions(-) create mode 100644 src/forge/Component/SearchUser.jsx create mode 100644 src/forge/Team/TeamSettingCommon.jsx create mode 100644 src/forge/Team/TeamSettingGroup.jsx create mode 100644 src/forge/Team/TeamSettingMember.jsx diff --git a/src/AppConfig.js b/src/AppConfig.js index 12abacae9..434b1f9dd 100644 --- a/src/AppConfig.js +++ b/src/AppConfig.js @@ -100,7 +100,7 @@ export function initAxiosInterceptors(props) { // TODO 读取到package.json中的配置? var proxy = "http://localhost:3000" // proxy = "https://pre-newweb.educoder.net" - proxy = "https://testforgeplus.trustie.net/" + proxy = "https://testforgeplus.trustie.net" // 在这里使用requestMap控制,避免用户通过双击等操作发出重复的请求; diff --git a/src/forge/Component/SearchUser.jsx b/src/forge/Component/SearchUser.jsx new file mode 100644 index 000000000..1df7ec64e --- /dev/null +++ b/src/forge/Component/SearchUser.jsx @@ -0,0 +1,70 @@ +import React , { useState , useEffect } from 'react'; +import { AutoComplete } from 'antd'; +import { getImageUrl } from "educoder"; +import axios from 'axios'; +const Option = AutoComplete.Option; + +export default ({ getUser })=>{ + const [ searchKey , setSearchKey ] = useState(undefined); + const [ userDataSource , setUserDataSource ] = useState(undefined); + + function getUserList(e){ + const url = `/users/list.json`; + axios.get(url, { + params: { + search: e, + }, + }) + .then((result) => { + if (result) { + setUserDataSource(result.data.users); + } + }) + .catch((error) => { + console.log(error); + }); + }; + + function changeInputUser(value){ + setSearchKey(value); + getUserList(value); + } + + function selectInputUser(id, option){ + setSearchKey(option.props.searchValue); + getUserList(option.props.searchValue); + getUser && getUser(id); + } + const source = + userDataSource && userDataSource.map((item, key) => { + return ( + + ); + }); + return( + + ) +} \ No newline at end of file diff --git a/src/forge/Component/layout.jsx b/src/forge/Component/layout.jsx index a2eece9f7..6d4e23651 100644 --- a/src/forge/Component/layout.jsx +++ b/src/forge/Component/layout.jsx @@ -49,11 +49,12 @@ export const WhiteBack = styled.div`{ }` export const Blueline = styled.a`{ height:32px; - line-height:32px; + line-height:30px; border-radius:2px; border:1px solid rgba(80,145,255,1); color:rgba(80,145,255,1); padding:0px 12px; + display:inline-block; }` export const Redline = styled.a`{ height:32px; diff --git a/src/forge/Settings/setting.scss b/src/forge/Settings/setting.scss index f9fedddfc..a91760dc3 100644 --- a/src/forge/Settings/setting.scss +++ b/src/forge/Settings/setting.scss @@ -174,16 +174,7 @@ border-bottom: none; } } -.required{ - position: relative; - &::before{ - content: "*"; - color: red; - position: absolute; - left: -10px; - top: -2px; - } -} + .hooksNew{ .ant-select.ant-select-enabled{ width: 100%; diff --git a/src/forge/Team/Index.scss b/src/forge/Team/Index.scss index 46ca01139..987fc8666 100644 --- a/src/forge/Team/Index.scss +++ b/src/forge/Team/Index.scss @@ -274,3 +274,51 @@ } } } +.warningBox{ + border-radius:5px 5px 0px 0px; + border:1px solid rgba(219,39,41,1); + border-radius:5px 5px 0px 0px; + .warningTitle{ + height:40px; + line-height: 40px; + background:rgba(255,232,230,1); + border-radius:5px 5px 0px 0px; + border-bottom:1px solid rgba(219,39,41,1); + color: #DB2729; + font-size: 16px; + padding:0px 30px; + } + .warningContent{ + padding:20px 30px; + } + .warningDelete{ + display: block; + height:26px; + line-height: 26px; + padding:0px 15px; + background:rgba(247,48,48,1); + border-radius:20px; + color: #fff; + } +} +// 组织成员管理 +.teamMemberTable{ + .ant-table-small{ + border:none; + } + .ant-table-body{ + margin:0px!important; + thead tr{ + background-color: #F1F8FF; + color: #333; + } + tbody tr:hover:not(.ant-table-expanded-row):not(.ant-table-row-selected) > td{ + background-color: #fff; + } + tbody tr td{ + border-bottom: 1px solid #eee!important; + padding:15px 8px!important; + } + + } +} diff --git a/src/forge/Team/TeamSettingCommon.jsx b/src/forge/Team/TeamSettingCommon.jsx new file mode 100644 index 000000000..de0b2dacc --- /dev/null +++ b/src/forge/Team/TeamSettingCommon.jsx @@ -0,0 +1,106 @@ +import React, { forwardRef , useCallback } from 'react'; +import { Form , Input , Cascader , Radio ,Checkbox , Divider , Button } from 'antd'; +import { WhiteBack , FlexAJ } from '../Component/layout'; +import Title from '../Component/Title'; +import styled from 'styled-components'; +import { locData } from "../Utils/locData"; +const TextArea = Input.TextArea; + +const Div = styled.div`{ + padding:20px 30px; +}` +const radioStyle = { + display: 'block', + height: '30px', + lineHeight: '30px', +}; +export default Form.create()( + forwardRef(({ form })=>{ + const { getFieldDecorator } = form; + const helper = useCallback( + (label, name, rules, widget , isRequired ) => ( +
    + {label} + + {getFieldDecorator(name, { rules, validateFirst: true })(widget)} + +
    + ), + [] + ); + return( +
    + + 基本设置 +
    +
    + {helper( + "组织名称:", + "name", + [{ required: true, message: "请输入组织名称" }], + ,true + )} + {helper( + "组织描述:", + "desc", + [], + - )} - {helper( - "公司介绍", - "intro", - [{ max: 5000, message: "超过5000字符" }], - - )} -
    - ); -}); diff --git a/src/modules/recruitment/jobForm/popup/AddClass.js b/src/modules/recruitment/jobForm/popup/AddClass.js deleted file mode 100644 index 5924188a8..000000000 --- a/src/modules/recruitment/jobForm/popup/AddClass.js +++ /dev/null @@ -1,51 +0,0 @@ -import React, { useCallback } from "react"; -import { Input, Form } from "antd"; -import Modal from "../../util/Modal"; -import { CenterBtnGrp, OkBtn, CancelBtn } from "../../util/GeneralButton"; - -const InnerForm = Form.create()(({ form, onCancel, setValue }) => { - const { getFieldDecorator, validateFields } = form; - const rules = [ - { required: true, message: "请输入职业分类" }, - { max: 10, message: "超过10字符" }, - { whitespace: true, message: "不能全空" }, - ]; - const formLayout = { - labelCol: { span: 5 }, - wrapperCol: { span: 17 }, - }; - const onOk = useCallback(() => { - validateFields((e, v) => { - if (e) { - return; - } - setValue(v); - onCancel(); - }); - }, []); - return ( -
    - - {getFieldDecorator("father", { rules })( - - )} - - - {getFieldDecorator("son", { rules })( - - )} - - - - - -
    - ); -}); - -//visible, setValue, onCancel -export default ({ setValue, ...props }) => ( - - - -); diff --git a/src/modules/recruitment/jobForm/popup/SelectClass.js b/src/modules/recruitment/jobForm/popup/SelectClass.js deleted file mode 100644 index 3252a777b..000000000 --- a/src/modules/recruitment/jobForm/popup/SelectClass.js +++ /dev/null @@ -1,66 +0,0 @@ -import { Row, Col } from 'antd'; -import React, { useState, useCallback, useRef, useEffect } from 'react'; -import Loading from '../../util/Loading'; -import { getJobCate } from '../../data/getJobCate'; -import Modal from '../../util/Modal'; -import { CenterBtnGrp, OkBtn, CancelBtn } from '../../util/GeneralButton'; -import FatherNav from './selectWidget/FatherNav'; -import SonArea from './selectWidget/SonArea'; - - -//visible, setValue, onCancel -export default ({ setValue, ...props }) => { - const [isloaded, setLoaded] = useState(false); - const dataRef = useRef(null); - useEffect(() => { - const f = async () => { - const map = await getJobCate(); - //const map = mock; - dataRef.current = map; - setLoaded(true); - } - f(); - return () => { setLoaded(false); }; - }, []); - const [selectedCate, setCate] = useState(null); - const [selectedJob, setJob] = useState(null); - const selectCate = useCallback(text => { - if (text === selectedCate) { - return; - } - setCate(text); - setJob(null); - }, []); - const selectJob = useCallback(text => { - if (text === selectedJob) { - return; - } - setJob(text); - }, []); - const onOk = useCallback(() => { - if (selectedJob === null) { - return; - } - props.onCancel(); - setValue({ father: selectedCate, son: selectedJob }); - }, [selectedCate, selectedJob]); - const Content = - - - - -
    - -
    - - - - - -
    ; - return - {!isloaded ? : Content} - ; -}; \ No newline at end of file diff --git a/src/modules/recruitment/jobForm/popup/selectWidget/FatherItem.js b/src/modules/recruitment/jobForm/popup/selectWidget/FatherItem.js deleted file mode 100644 index 3455e3871..000000000 --- a/src/modules/recruitment/jobForm/popup/selectWidget/FatherItem.js +++ /dev/null @@ -1,29 +0,0 @@ -import styled from 'styled-components'; -import React from 'react'; -import { Icon as AdIcon } from "antd"; -import { pointerMixin, betweenMixin } from "../../../util/cssMixin"; - -const Item = styled.div` - height:57px; - background:${p => p.isSelected ? "rgba(241,241,241,1)" : "transparent"}; - ${pointerMixin} - ${betweenMixin} -`; -const Name = styled.div` - color:rgba(51,51,51,1); - font-size:16px; - font-family:MicrosoftYaHei; - margin-left:30px; -`; -const Icon = styled(AdIcon)` - display:block; - color:rgba(187,187,187,1); - margin-right:20px; -`; - -//onClick, isSelected -export default ({ children, ...props }) => - - {children} - - ; \ No newline at end of file diff --git a/src/modules/recruitment/jobForm/popup/selectWidget/FatherNav.js b/src/modules/recruitment/jobForm/popup/selectWidget/FatherNav.js deleted file mode 100644 index 5d492d9f5..000000000 --- a/src/modules/recruitment/jobForm/popup/selectWidget/FatherNav.js +++ /dev/null @@ -1,14 +0,0 @@ -import styled from 'styled-components'; -import React from 'react'; -import Item from './FatherItem'; - -const Column = styled.div` - background:rgba(250,250,250,1); - height:100%; - overflow:auto; -`; - -export default ({ data, selectCate, selectedCate }) => //data is a map - - {Array.from(data.keys()).map(i => { selectCate(i); }} isSelected={selectedCate === i}>{i})} - ; \ No newline at end of file diff --git a/src/modules/recruitment/jobForm/popup/selectWidget/SonArea.js b/src/modules/recruitment/jobForm/popup/selectWidget/SonArea.js deleted file mode 100644 index facb25ad9..000000000 --- a/src/modules/recruitment/jobForm/popup/selectWidget/SonArea.js +++ /dev/null @@ -1,19 +0,0 @@ -import { Row } from "antd"; -import React from "react"; -import { JobBtn } from "../../../util/GeneralButton"; - -export default ({ data, selectedJob, selectJob }) => ( - - {Array.from(data.keys()).map((i) => ( - { - selectJob(i); - }} - isSelected={selectedJob === i} - > - {i} - - ))} - -); diff --git a/src/modules/recruitment/jobForm/widget/CateSelect.js b/src/modules/recruitment/jobForm/widget/CateSelect.js deleted file mode 100644 index 55b8d5703..000000000 --- a/src/modules/recruitment/jobForm/widget/CateSelect.js +++ /dev/null @@ -1,61 +0,0 @@ -import React, { forwardRef } from "react"; -import { Icon, Row } from "antd"; -import { useToggle } from "../../util/hooks"; -import styled from "styled-components"; -import { BtnBase } from "../../util/Button"; -import AddClassPopup from "../popup/AddClass"; -import SelectClassPopup from "../popup/SelectClass"; - -const SimulateInput = styled(BtnBase)` - border-radius: 4px; - border: 1px solid rgba(221, 221, 221, 1); - width: 252px; - padding-left: 10px; - padding-right: 10px; - margin-bottom: 5px; - &:hover { - border: 1px solid #40a9ff; - } - &.has-error { - border: 1px solid #f5222d; - } -`; - -const SI = ({ children }) => ( - {children} -); - -const Value = styled.span` - font-size: 14px; - color: rgba(51, 51, 51, 1); - font-family: MicrosoftYaHei; -`; -const Placeholder = styled(Value)` - color: rgba(187, 187, 187, 1); -`; - -export default forwardRef(({ onChange, value, placeholder }, ref) => { - const [v1, sv1] = useToggle(); - const [v2, sv2] = useToggle(); - return ( - - - - {!value || !value.father || !value.son ? ( - 请选择职位类别 - ) : ( - {`${value.father}/${value.son}`} - )} - - - - - - - - ); -}); diff --git a/src/modules/recruitment/jobForm/widget/InputWithLen.js b/src/modules/recruitment/jobForm/widget/InputWithLen.js deleted file mode 100644 index dfa26f024..000000000 --- a/src/modules/recruitment/jobForm/widget/InputWithLen.js +++ /dev/null @@ -1,7 +0,0 @@ -import React, { forwardRef } from "react"; -import { Input } from "antd"; - -export default forwardRef(({ maxLen, ...props }, ref) => { - const len = !props.value ? 0 : props.value.length; - return {`${len}/${maxLen}`}} ref={ref} /> -}); \ No newline at end of file diff --git a/src/modules/recruitment/jobForm/widget/TextArea.js b/src/modules/recruitment/jobForm/widget/TextArea.js deleted file mode 100644 index de4e14230..000000000 --- a/src/modules/recruitment/jobForm/widget/TextArea.js +++ /dev/null @@ -1,6 +0,0 @@ -import styled from 'styled-components'; -import { Input } from "antd"; - -export default styled(Input.TextArea)` - resize:none; -`; \ No newline at end of file diff --git a/src/modules/recruitment/recrulistcss/recrulistcss.scss b/src/modules/recruitment/recrulistcss/recrulistcss.scss deleted file mode 100644 index 8540ab4c1..000000000 --- a/src/modules/recruitment/recrulistcss/recrulistcss.scss +++ /dev/null @@ -1,260 +0,0 @@ - -.IntermediateCenter { - display: flex; - flex-direction: column; - align-items: center; - justify-content: center; - -} - -.JianDcentered { - display: flex; - align-items: center; -} - -.spacearound { - display: flex; - justify-content: space-around; - -} - -.spacebetween { - display: flex; - justify-content: space-between; -} - -.topcenter { - display: -webkit-flex; - flex-direction: column; - align-items: center; - -} - -.sortinxdirection { - display: flex; - flex-direction: row; -} - -.xaxisreverseorder { - display: flex; - flex-direction: row-reverse; -} - -.verticallayout { - display: flex; - flex-direction: column; -} - -.reversedirection { - display: flex; - flex-direction: column-reverse; -} - -.color88 { - color: #888888; -} - -.mr7 { - margin-right: 7px; -} -.ml21{ - margin-left: 21px; -} - -.mt22 { - margin-top: 22px; -} - -.w50s { - width: 50%; -} -.w70s { - width: 70%; -} -.w80s { - width: 80%; -} - -.w20s { - width: 20%; -} - -.w83s { - width: 83%; -} - -.w17s { - width: 17%; -} - -.iconcolor { - color: #4CADFF !important; -} - -.lh45s { - line-height: 45px; -} - -.lh48s { - line-height: 48px; - -} - -.lh40s { - line-height: 40px; -} - -.titless100 { - max-width: 100px; - overflow: hidden; - text-overflow: ellipsis; - white-space: nowrap; - cursor: default; -} - -.w1199dbl { - width: 1200px; - min-height: 60px; - background: rgba(255, 255, 255, 1); - -webkit-box-shadow: 0px 6px 8px 0px rgba(0, 0, 0, 0.03); - box-shadow: 0px 6px 8px 0px rgba(0, 0, 0, 0.03); - border-radius: 2px; -} -.divgreens{ - color: #42B366; - background: #D8F7E2 !important; - border: 1px solid #D8F7E2 !important; -} -.divViolets{ - color: #5B36D1; - border: 1px solid #E8E1FF !important; - background: #E8E1FF !important; - -} -.divoranges{ - color: #E65A18; - border: 1px solid #FFF2EC !important; - background: #FFF2EC!important; - -} -.divreds{ - color: #F30F0F; - border: 1px solid #FFE6E6 !important; - background: #FFE6E6 !important; -} - -.xiaoshou { - cursor: pointer !important; -} - -.xiaoshout { - cursor: default !important; -} - -.pdtop30 { - padding-top: 30px !important; -} -.pd30{ - padding: 30px; -} -.ptabo{ - .ant-input-wrapper { - .ant-input { - height: 48px !important; - line-height: 46px !important; - } - } - - .ant-input-group-addon { - width: 48px !important; - - .ant-btn-lg { - height: 46px !important; - width: 108px; - border-left: 1px solid #1890ff !important; - border-bottom: 1px solid #1890ff !important; - border-right: 1px solid #1890ff !important; - border-top: 1px solid #1890ff !important; - } - } - - .ant-popover-inner-content { - padding: 0px !important; - } - -} -.tabone { - border-bottom: 1px solid #EEEEEE; - - .pdtab { - padding-top: 15px; - padding-left: 15px; - padding-right: 30px; - - - .ant-tabs { - width: 50% !important; - - .ant-tabs-bar { - border-bottom: 1px solid #ffffff; - - .ant-tabs-tab { - font-size: 16px; - } - } - - } - } - - .pdtabs { - - .searchwidth { - width: 100%; - } - } - - .pdtabss { - .divgreen{ - color: #42B366; - border: 1px solid #42B366; - - - } - .divViolet{ - color: #5B36D1; - border: 1px solid #5B36D1; - - - - } - .divorange{ - color: #E65A18; - border: 1px solid #E65A18; - - - } - .divred{ - color: #F30F0F; - border: 1px solid #F30F0F; - - - } - .brodersdiv{ - - background: #ffffff; - border-radius:25px; - min-width: 170px; - text-align: center; - height: 46px; - line-height: 46px; - } - - - .searchwidth { - width:347px; - } - } - .pdtabsss { - padding: 30px; - } -} diff --git a/src/modules/recruitment/resumeForm/CompanyHeader.js b/src/modules/recruitment/resumeForm/CompanyHeader.js deleted file mode 100644 index 32ed9232a..000000000 --- a/src/modules/recruitment/resumeForm/CompanyHeader.js +++ /dev/null @@ -1,38 +0,0 @@ -import React from "react"; -import styled from "styled-components"; -import { Divider, Row } from "antd"; - -const Header = styled.div` - width: 1200px; - height: 145px; - background: rgba(255, 255, 255, 1); - border-radius: 2px; - padding: 40px; - margin:0 auto; - margin-bottom: 20px; -`; -const Job = styled.div` - font-size: 20px; - font-family: MicrosoftYaHeiSemibold; - color: rgba(51, 51, 51, 1); - margin-bottom:15px; -`; - -const Item = styled.span` - font-size: 14px; - font-family: MicrosoftYaHei; - color: rgba(51, 51, 51, 1); -`; - -export default ({ jobName, company, city }) => { - return ( -
    - {jobName} -
    - {company} - - {city} -
    -
    - ); -}; diff --git a/src/modules/recruitment/resumeForm/Form.js b/src/modules/recruitment/resumeForm/Form.js deleted file mode 100644 index f22a4a533..000000000 --- a/src/modules/recruitment/resumeForm/Form.js +++ /dev/null @@ -1,7 +0,0 @@ -import React, { - createContext, - forwardRef, - useImperativeHandle, - useCallback, - } from "react"; -export const FormCtx = createContext(); \ No newline at end of file diff --git a/src/modules/recruitment/resumeForm/NormalForm.js b/src/modules/recruitment/resumeForm/NormalForm.js deleted file mode 100644 index 3a4cb636b..000000000 --- a/src/modules/recruitment/resumeForm/NormalForm.js +++ /dev/null @@ -1,240 +0,0 @@ -import _ from "lodash"; -import React, { forwardRef, useImperativeHandle, useCallback } from "react"; -import { Form, Input, Radio, Row, DatePicker, Icon } from "antd"; -import styled from "styled-components"; -import ImageUploader from "./widget/ImageUploader"; -import ResumesUploader from "./widget/ResumesUploader"; -import JobExpect from "./widget/JobExpect"; -import EduItem from "./widget/EduItem"; -import WorkItem from "./widget/WorkItem"; -import { FormCtx } from "./Form"; -import { AddButton } from "./widget/Button"; -import { useSet } from "../util/hooks"; -import { genUuid } from "../data/genUuid"; -import { mapPropsToFields } from "../data/mapResumeData"; -import moment from "moment"; - -const Label = styled.div` - &::before { - content: ${(p) => (p.required ? '"*"' : '""')}; - color: ${(p) => (p.required ? "red" : "black")}; - } - &::after { - content: ":"; - } - margin-bottom: 5px; - font-size: 16px; - font-family: MicrosoftYaHeiSemibold; - color: rgba(51, 51, 51, 1); -`; -const Tip = styled.div` - font-size: 12px; - font-family: MicrosoftYaHei; - color: rgba(136, 136, 136, 1); - margin-left: 10px; -`; - -export default Form.create({ mapPropsToFields })( - forwardRef(({ form, attachment_name, logo_url, attachment_url, attachment_id }, ref) => { - const { - getFieldDecorator, - validateFields, - getFieldValue, - setFields, - getFieldsValue - } = form; - const { set: eduSet, add: eduAdd, remove: eduRm } = useSet(); - const { set: wkSet, add: wkAdd, remove: wkRm } = useSet(); - const addEdu = useCallback(() => { - const uuid = genUuid(); - eduAdd(uuid); - return uuid; - }, []); - const addWk = useCallback(() => { - const uuid = genUuid(); - wkAdd(uuid); - return uuid; - }, []); - const set = useCallback((education, experience) => { - const object = {}; - if (experience !== undefined) { - experience.forEach((exp) => { - const id = addWk(); - ["company", "desc"].forEach((k) => { - object[`experience[${id}].${k}`] = { value: exp[k] }; - }); - ["begin_on", "end_on"].forEach((k) => { - object[`experience[${id}].${k}`] = { value: moment(exp[k]) }; - }); - }); - } - if (education !== undefined) { - let isFirst = true; - education.forEach((edu) => { - const id = isFirst ? "base" : addEdu(); - ["edu_bg", "edu_category", "major", "school"].forEach((k) => { - object[`education[${id}].${k}`] = { value: edu[k] }; - }); - ["begin_on", "end_on"].forEach((k) => { - object[`education[${id}].${k}`] = { value: moment(edu[k]) }; - }); - isFirst = false; - }); - } - setTimeout(() => { - setFields(object); - }, 1000); - }, []); - const genVerArr = useCallback(() => { - const genWk = (key) => - ["begin_on", "end_on", "company", "desc"].map( - (k) => `experience[${key}].${k}` - ); - const genEdu = (key) => - ["begin_on", "end_on", "edu_bg", "edu_category", "major", "school"].map( - (k) => `education[${key}].${k}` - ); - const field = [ - "name", - "sex", - "logo", - "birth_on", - "mobile", - "evaluate", - "attachment_id", - "job_position", - "city", - "salary", - "job_category", - "job_year", - ]; - const baseEdu = genEdu("base"); - const wk = _.flatten(Array.from(wkSet.keys()).map(genWk)); - const edu = _.flatten(Array.from(eduSet.keys()).map(genEdu)); - return _.concat(wk, edu, field, baseEdu); - }, []); - useImperativeHandle(ref, () => ({ - verify: (callback) => { - validateFields(genVerArr(), callback); - }, - set, - })); - const helper = useCallback( - (label, name, rules, widget, isRequired = true) => ( - - - - {getFieldDecorator(name, { rules, validateFirst: true })(widget)} - - - ), - [] - ); - return ( - -
    - {helper( - "姓名", - "name", - [ - { max: 60, message: "超过60字符" }, - { required: true, message: "请输入姓名" }, - { whitespace: true, message: "不能全空" }, - ], - - )} - {helper( - "性别", - "sex", - [{ required: true, message: "请选择性别" }], - - - - - )} - - - 只支持JPG,JPEG格式,大小不要超过2MB,建议使用证件照 - - {getFieldDecorator("logo", {})()} - {helper( - "出生日期", - "birth_on", - [{ required: true, message: "请选择日期" }], - m > moment()} /> - )} - {helper( - "手机号", - "mobile", - [ - { required: true, message: "请输入手机号" }, - { min: 11, message: "号码不正确" }, - { max: 11, message: "号码不正确" }, - { pattern: /^\d+$/, message: "请输入数字" }, - ], - - )} - {helper( - "参加工作时间", - "job_year", - [], - , - false - )} - - - - - {Array.from(eduSet.values()).map((k) => ( - { - eduRm(k); - }} - /> - ))} - - - 添加教育经历 - - - {Array.from(wkSet.values()).map((k) => ( - { - wkRm(k); - }} - /> - ))} - - - 添加工作经验 - - {helper( - "自我评价", - "evaluate", - [{ max: 5000, message: "超过5000字符" }], - , - false - )} - - - (上传简历可以提高应聘成功率) - - {getFieldDecorator("attachment_id", { rules: [] })( - - )} - -
    - ); - }) -); diff --git a/src/modules/recruitment/resumeForm/popup/CityPopup.js b/src/modules/recruitment/resumeForm/popup/CityPopup.js deleted file mode 100644 index e5ba59839..000000000 --- a/src/modules/recruitment/resumeForm/popup/CityPopup.js +++ /dev/null @@ -1,51 +0,0 @@ -import React, { useEffect,useCallback } from "react"; -import {message} from 'antd'; -import Modal from "./Modal"; -import { useLoaded, useMap } from "../../util/hooks"; -import { getCurrCity } from "../../data/getCurrCity"; -import { CenterBtnGrp, OkBtn, CancelBtn } from "../../util/GeneralButton"; -import CityList from "./city/CityList"; -import SelectedCity from "./city/SelectedCity"; -import { getHotCity } from "../../data/getHotCity"; -import Loading from "../../util/Loading"; - -//visible, setValue, onCancel -export default ({ setValue, ...props }) => { - const { isLoaded: isCurrCityLoaded, data: currCity } = useLoaded( - getCurrCity, - [] - ); - const { isLoaded: isCityLoaded, data: cityLst } = useLoaded(getHotCity, []); - const { map, add, remove } = useMap((m) => { - if (m.size >= 5) { - message.error("最多选择5项"); - return false; - } - return true; - }); - useEffect(() => { - if (isCurrCityLoaded) { - add(currCity, true); - } - }, [isCurrCityLoaded]); - const onOk = useCallback(() => { - props.onCancel(); - setValue(Array.from(map.keys())); - }, []); - const content = - !isCurrCityLoaded || !isCityLoaded ? ( - - ) : ( - - - - - - - - - ); - return - {content} - ; -}; diff --git a/src/modules/recruitment/resumeForm/popup/JobPopup.js b/src/modules/recruitment/resumeForm/popup/JobPopup.js deleted file mode 100644 index 29781b603..000000000 --- a/src/modules/recruitment/resumeForm/popup/JobPopup.js +++ /dev/null @@ -1,68 +0,0 @@ -import React, { useCallback, useState,useEffect } from "react"; -import { Row, Col, message } from "antd"; -import Modal from "../../util/Modal"; -import Nav from "./jobClass/FatherNav"; -import SonNav from "./jobClass/SonArea"; -import Tiltle from "./jobClass/Tiltle"; -import Loading from "../../util/Loading"; -import { useLoaded, useSet } from "../../util/hooks"; -import { CenterBtnGrp, OkBtn, CancelBtn } from "../../util/GeneralButton"; -import { getJobCate } from "../../data/getJobCate"; - -//visible, setValue, onCancel -export default ({ setValue, initArr, ...props }) => { - const { isLoaded, data } = useLoaded(getJobCate, []); - const { set, add, remove } = useSet((s) => { - if (s.size >= 5) { - message.error("最多选择5项"); - return false; - } - return true; - }); - const [selectedCate, selectCate] = useState(null); - const onOk = useCallback(() => { - props.onCancel(); - setValue(Array.from(set.values())); - }, []); - useEffect(() => { - if (Array.isArray(initArr)) { - initArr.forEach((i) => add(i)); - } - }, []); - const content = !isLoaded ? ( - - ) : ( - - - - - - -
    - -
    - - - - - -
    -
    - ); - return ( - } - {...props} getContainer={false} - > - {content} - - ); -}; diff --git a/src/modules/recruitment/resumeForm/popup/Modal.js b/src/modules/recruitment/resumeForm/popup/Modal.js deleted file mode 100644 index da5972e20..000000000 --- a/src/modules/recruitment/resumeForm/popup/Modal.js +++ /dev/null @@ -1,15 +0,0 @@ -import React from "react"; -import { Modal } from 'antd'; -import styled from 'styled-components'; - -const Box = styled.div` - width:clac(100%+80px); - margin:-24px -24px; -`; - -//visible,title,onCancel,width -export default ({ children, ...props }) => { - return - {children} - ; -}; diff --git a/src/modules/recruitment/resumeForm/popup/city/CityList.js b/src/modules/recruitment/resumeForm/popup/city/CityList.js deleted file mode 100644 index c0ba73035..000000000 --- a/src/modules/recruitment/resumeForm/popup/city/CityList.js +++ /dev/null @@ -1,49 +0,0 @@ -import styled from "styled-components"; -import React from "react"; -import { Row } from "antd"; - -const Button = styled.div` - width: 100px; - height: 46px; - background: rgba(255, 255, 255, 1); - border-radius: 2px; - border: 1px solid rgba(221, 221, 221, 1); - font-size: 14px; - font-family: MicrosoftYaHei; - color: rgba(51, 51, 51, 1); - margin-left: 30px; - margin-top: 10px; - display: flex; - justify-content: center; - align-items: center; - &:hover { - cursor: pointer; - } -`; -const Title = styled.div` - font-size: 16px; - font-family: Microsoft YaHei; - color: rgba(51, 51, 51, 1); - margin:15px 30px; - margin-bottom:5px; -`; - -export default ({ select, data }) => { - return ( - - 热门城市: - - {data.map((city) => ( - - ))} - - - ); -}; diff --git a/src/modules/recruitment/resumeForm/popup/city/SelectedCity.js b/src/modules/recruitment/resumeForm/popup/city/SelectedCity.js deleted file mode 100644 index c12d802b1..000000000 --- a/src/modules/recruitment/resumeForm/popup/city/SelectedCity.js +++ /dev/null @@ -1,47 +0,0 @@ -import styled from "styled-components"; -import React, { useCallback } from "react"; -import { Tag, Tooltip, Icon } from "antd"; - -const Title = styled.div` - font-size: 16px; - font-family: Microsoft YaHei; - color: rgba(51, 51, 51, 1); - margin: 15px 30px; - margin-top:30px; -`; -const Tip = styled.span` - font-size: 12px; - -`; -const tagConfig = { - color: "blue", - closable: true, - style:{border:"0"}, -}; - -export default ({ selected, remove }) => { - return ( - - 选择期望工作城市: -
    - {Array.from(selected.entries()).map(([key, isCurrCity]) => { - if (isCurrCity) { - return ( - remove(key)}> - - {key} - (当前定位城市) - - ); - } else { - return ( - remove(key)}> - {key} - - ); - } - })} -
    -
    - ); -}; diff --git a/src/modules/recruitment/resumeForm/popup/jobClass/FatherItem.js b/src/modules/recruitment/resumeForm/popup/jobClass/FatherItem.js deleted file mode 100644 index dcb47cc94..000000000 --- a/src/modules/recruitment/resumeForm/popup/jobClass/FatherItem.js +++ /dev/null @@ -1,32 +0,0 @@ -import styled from 'styled-components'; -import React from 'react'; -import { Icon as AdIcon } from "antd"; - -const Item = styled.div` - height:57px; - background:${p => p.isSelected ? "rgba(241,241,241,1)" : "transparent"}; - &:hover{ - cursor:pointer; - } - display:flex; - justify-content:space-between; - align-items:center; -`; -const Name = styled.div` - color:rgba(51,51,51,1); - font-size:16px; - font-family:MicrosoftYaHei; - margin-left:30px; -`; -const Icon = styled(AdIcon)` - display:block; - color:rgba(187,187,187,1); - margin-right:20px; -`; - -//onClick, isSelected -export default ({ children, ...props }) => - - {children} - - ; \ No newline at end of file diff --git a/src/modules/recruitment/resumeForm/popup/jobClass/FatherNav.js b/src/modules/recruitment/resumeForm/popup/jobClass/FatherNav.js deleted file mode 100644 index 5d492d9f5..000000000 --- a/src/modules/recruitment/resumeForm/popup/jobClass/FatherNav.js +++ /dev/null @@ -1,14 +0,0 @@ -import styled from 'styled-components'; -import React from 'react'; -import Item from './FatherItem'; - -const Column = styled.div` - background:rgba(250,250,250,1); - height:100%; - overflow:auto; -`; - -export default ({ data, selectCate, selectedCate }) => //data is a map - - {Array.from(data.keys()).map(i => { selectCate(i); }} isSelected={selectedCate === i}>{i})} - ; \ No newline at end of file diff --git a/src/modules/recruitment/resumeForm/popup/jobClass/SonArea.js b/src/modules/recruitment/resumeForm/popup/jobClass/SonArea.js deleted file mode 100644 index 0ad4f99f5..000000000 --- a/src/modules/recruitment/resumeForm/popup/jobClass/SonArea.js +++ /dev/null @@ -1,13 +0,0 @@ -import { Row } from "antd"; -import React from "react"; -import { JobBtn } from "../../../util/GeneralButton"; - -export default ({ data, select }) => ( - - {Array.from(data.values()).map((v) => ( - select(v)}> - {v} - - ))} - -); diff --git a/src/modules/recruitment/resumeForm/popup/jobClass/Tiltle.js b/src/modules/recruitment/resumeForm/popup/jobClass/Tiltle.js deleted file mode 100644 index cff7ffcaf..000000000 --- a/src/modules/recruitment/resumeForm/popup/jobClass/Tiltle.js +++ /dev/null @@ -1,41 +0,0 @@ -import styled from "styled-components"; -import React from "react"; -import { Tag, Tooltip } from "antd"; - -const Header = styled.div` - display: flex; - justify-content: space-between; - align-items: center; -`; - -const Title = styled.div` - font-size: 16px; - font-family: Microsoft YaHei; - font-weight: bold; - color: rgba(51, 51, 51, 1); -`; -const tagConfig = { - color: "blue", - closable: true, - style:{border:"0"}, -}; -export default ({ selected, remove }) => { - const tag = (key) => ( - remove(key)}> - {key.length >= 4 ? `${key.substring(0, 4)}...` : key} - - ); - const wrapper = (key) => { - if (key.length >= 4) { - return {tag(key)}; - } else { - return tag(key); - } - }; - return ( -
    - 选择职位类别 -
    {Array.from(selected.keys()).map((key) => wrapper(key))}
    -
    - ); -}; diff --git a/src/modules/recruitment/resumeForm/widget/Button.js b/src/modules/recruitment/resumeForm/widget/Button.js deleted file mode 100644 index 89c364813..000000000 --- a/src/modules/recruitment/resumeForm/widget/Button.js +++ /dev/null @@ -1,37 +0,0 @@ -import styled from "styled-components"; - -export const AddButton = styled.div` - display:flex; - justify-content:center; - align-items:center; - width:169px; - height:40px; - background:rgba(236,246,255,1); - border-radius:20px; - border:1px solid rgba(76,172,255,1); - font-size:14px; - font-family:MicrosoftYaHeiSemibold; - color:rgba(76,172,255,1); - margin-bottom:20px; - &:hover{ - cursor:pointer; - } -`; - -export const UploadButton = styled.div` - display:flex; - justify-content:center; - align-items:center; - width:87px; - height:40px; - background:rgba(236,246,255,1); - border-radius:2px; - border:1px solid rgba(76,172,255,1); - font-size:14px; - font-family:MicrosoftYaHeiSemibold; - color:rgba(76,172,255,1); - margin-right:20px; - &:hover{ - cursor:pointer; - } -`; diff --git a/src/modules/recruitment/resumeForm/widget/EduItem.js b/src/modules/recruitment/resumeForm/widget/EduItem.js deleted file mode 100644 index e028bbb5d..000000000 --- a/src/modules/recruitment/resumeForm/widget/EduItem.js +++ /dev/null @@ -1,101 +0,0 @@ -import React, { useContext, useCallback } from "react"; -import { FormCtx } from "../Form"; -import { Row, Col, Form, Select, Input, Icon } from "antd"; -import MonthPicker from "./MothPicker"; - -const edu_bg = ["本科", "硕士", "博士", "大专", "其他"]; -const edu_category = ["统招全日制", "统招非全日制", "自考", "其他"]; - -export default ({ nameKey, onDelete }) => { - const { getFieldDecorator, getFieldValue } = useContext(FormCtx); - const greatValidater = useCallback((r, v, cb) => { - if (v >= getFieldValue(`education[${nameKey}].begin_on`)) { - cb(); - } else { - cb("时间范围不正确"); - } - }, []); - return ( -
    - - - - {getFieldDecorator(`education[${nameKey}].begin_on`, { - rules: [{ required: true, message: "请选择开始日期" }], - })()} - - - - - {getFieldDecorator(`education[${nameKey}].end_on`, { - rules: [ - { required: true, message: "请选择结束日期" }, - { validator: greatValidater }, - ], - validateFirst: true, - })()} - - - - {onDelete ? ( - - ) : null} - - - - - - {getFieldDecorator(`education[${nameKey}].edu_bg`, { - rules: [{ required: true, message: "请选择学历" }], - })( - - )} - - - - - {getFieldDecorator(`education[${nameKey}].edu_category`, { - rules: [{ required: true, message: "请选择学历类型" }], - })( - - )} - - - - - {getFieldDecorator(`education[${nameKey}].major`, { - rules: [ - { required: true, message: "请输入专业" }, - { max: 60, message: "超过60字符" }, - { whitespace: true, message: "不能全空" }, - ], - validateFirst: true, - })()} - - - - - {getFieldDecorator(`education[${nameKey}].school`, { - rules: [ - { required: true, message: "请输入学校名称" }, - { max: 60, message: "超过60字符" }, - { whitespace: true, message: "不能全空" }, - ], - validateFirst: true, - })()} - -
    - ); -}; diff --git a/src/modules/recruitment/resumeForm/widget/ImageUploader.js b/src/modules/recruitment/resumeForm/widget/ImageUploader.js deleted file mode 100644 index eb0e65579..000000000 --- a/src/modules/recruitment/resumeForm/widget/ImageUploader.js +++ /dev/null @@ -1,73 +0,0 @@ -import React, { useState, useRef, useCallback } from "react"; -import { getUploadLogoActionUrl, getUrl } from "educoder"; -import { Upload, Icon, message } from "antd"; -import axios from 'axios'; - -export default ({ logo_url, onChange }) => { - const base64Ref = useRef(null); - const getBase64 = useCallback((file) => { - return new Promise((resolve) => { - const reader = new FileReader(); - reader.addEventListener("load", () => { - base64Ref.current = reader.result; - resolve(reader.result); - }); - reader.readAsDataURL(file); - }); - }, []); - const [isLoading, setLoading] = useState(() => { - if (logo_url) { - return true; - } - return false; - }); - const [imageUrl, setUrl] = useState(() => { - if (logo_url) { - return getUrl("/"+logo_url); - } - return undefined; - }); - const handleChange = useCallback(({ file }) => { - if (file.status === "uploading") { - setLoading(true); - return; - }else if (file.status === "done") { - onChange("t"); - setLoading(false); - setUrl(base64Ref.current); - }else if (file.size > 2 ** 20 * 2) { - setLoading(false); - setUrl(""); - } - }, []); - const verifyFile = useCallback((f) => { - if(imageUrl){ - axios.post('/resumes/destroy_logo.json'); - } - const isProperSize = f.size / 1024 / 1024 < 2; //2MB - if (!isProperSize) { - message.error("照片超过2MB"); - } - return isProperSize; - },[imageUrl]); - return ( - - - {imageUrl ? ( - avatar - ) : ( - - )} - - - ); -}; diff --git a/src/modules/recruitment/resumeForm/widget/JobExpect.js b/src/modules/recruitment/resumeForm/widget/JobExpect.js deleted file mode 100644 index 6581db0c2..000000000 --- a/src/modules/recruitment/resumeForm/widget/JobExpect.js +++ /dev/null @@ -1,138 +0,0 @@ -import React, { forwardRef, useContext } from "react"; -import { Row, Icon, Form, Select, Checkbox } from "antd"; -import styled from "styled-components"; -import { useToggle } from "../../util/hooks"; -import JobPopup from "../popup/JobPopup"; -import CityPopup from "../popup/CityPopup"; -import { FormCtx } from "../Form"; - -const Input = styled.div` - border-radius: 4px; - border: 1px solid rgba(221, 221, 221, 1); - width: 534px; - height: 33px; - padding-left: 10px; - padding-right: 10px; - margin-bottom: 5px; - display: flex; - justify-content: space-between; - align-items: center; - &:hover { - cursor: pointer; - border: 1px solid #40a9ff; - } - & .has-error { - border: 1px solid #f5222d; - } -`; - -const Value = styled.div` - font-size: 14px; - color: rgba(51, 51, 51, 1); - font-family: MicrosoftYaHei; -`; -const Placeholder = styled(Value)` - color: rgba(187, 187, 187, 1); -`; -const Content = ({ placeholder, value, onClick }) => ( - - {!value ? {placeholder} : {value}} - - -); - -const ExpJob = forwardRef(({ onChange, value }, ref) => { - const [jobVis, setJobVis] = useToggle(); - return ( - - - - - - - ); -}); -const ExpCity = forwardRef(({ onChange, value }, ref) => { - const [cityVis, setCityVis] = useToggle(); - return ( - - - - - - - ); -}); - -const salary = [ - "1000元/月以下", - "1000—2000元/月", - "2001—4000元/月", - "4001—6000元/月", - "6001—8000元/月", - "8001—10000元/月", - "10001—15000元/月", - "15001—25000元/月", - "25001—35000元/月", - "35001—50000元/月", - "50001—70000元/月", - "70001—100000元/月", - "100000元/月以上", -]; -const job_category = ["全职", "兼职", "实习"]; - -export default () => { - const { getFieldDecorator } = useContext(FormCtx); - return ( -
    - - {getFieldDecorator("job_position", { - rules: [{ required: true, message: "请选择期望职位" }], - })()} - - - {getFieldDecorator("city", { - rules: [{ required: true, message: "请选择期望工作城市" }], - })()} - - - {getFieldDecorator("salary", { - rules: [{ required: true, message: "请选择期望薪资" }], - })( - - )} - - - {getFieldDecorator("job_category", { - rules: [{ required: true, message: "请选择求职类型" }], - })( - - {job_category.map((j) => ( - - {j} - - ))} - - )} - -
    - ); -}; diff --git a/src/modules/recruitment/resumeForm/widget/MothPicker.js b/src/modules/recruitment/resumeForm/widget/MothPicker.js deleted file mode 100644 index d87144e4e..000000000 --- a/src/modules/recruitment/resumeForm/widget/MothPicker.js +++ /dev/null @@ -1,16 +0,0 @@ -import React from "react"; -import { DatePicker } from "antd"; -import styled from "styled-components"; - -const Box = styled.div` - position: relative; - z-index: 1; -`; - -export default ({ ...props }) => { - return ( - - - - ); -}; diff --git a/src/modules/recruitment/resumeForm/widget/ResumesUploader.js b/src/modules/recruitment/resumeForm/widget/ResumesUploader.js deleted file mode 100644 index 44124a6a6..000000000 --- a/src/modules/recruitment/resumeForm/widget/ResumesUploader.js +++ /dev/null @@ -1,82 +0,0 @@ -import React, { useCallback, useState } from "react"; -import { Upload, Row, message } from "antd"; -import styled from "styled-components"; -import { UploadButton } from "./Button"; -import { getUploadActionUrl } from "educoder"; - -const Info = styled.div` - font-size: 14px; - font-family: MicrosoftYaHei; - color: rgba(231, 114, 52, 1); - margin-top: 10px; -`; - -const verifyFile = (f, fLst) => { - if (fLst.length === 1 && fLst[0].status === "uploading") { - message.error("请等待上传完成"); - return false; - } - const isProperSize = f.size / (2 ** 20 * 10); - if (!isProperSize) { - message.error("简历超过10MB"); - return false; - } - return true; -}; -export default ({ - attachment_name, - attachment_url, - attachment_id, - onChange, -}) => { - const [fileLst, setFlieLst] = useState(() => { - if (attachment_name) { - return [ - { - uid: "-1", - status: "done", - name: attachment_name, - url: attachment_url, - }, - ]; - } - return []; - }); - const handleChange = useCallback(async ({ file }) => { - if (file.status === "removed") { - setFlieLst([]); - const id = file.response ? file.response.id : attachment_id; - //axios.delete(`/attachments/${id}.json`); - onChange(""); - } else if (file.size > 2 ** 20 * 10) { - setFlieLst([]); - } else { - setFlieLst([file]); - if (file.status === "done") { - onChange(file.response.id); - } - } - }, []); - return ( - - - - - - {fileLst.length === 1 ? "重新上传" : "上传"} - - - 提示:不超过10MB,扩展名为pdf、doc、docx、ppt、pptx、png、jpg、jpeg - - - - - - ); -}; diff --git a/src/modules/recruitment/resumeForm/widget/WorkItem.js b/src/modules/recruitment/resumeForm/widget/WorkItem.js deleted file mode 100644 index 541b0ad6d..000000000 --- a/src/modules/recruitment/resumeForm/widget/WorkItem.js +++ /dev/null @@ -1,72 +0,0 @@ -import React, { useContext, useCallback } from "react"; -import { FormCtx } from "../Form"; -import { Row, Col, Form, Input, Icon } from "antd"; -import MonthPicker from "./MothPicker"; - -export default ({ nameKey, onDelete }) => { - const { getFieldDecorator, getFieldValue } = useContext(FormCtx); - const greatValidater = useCallback((r, v, cb) => { - if (v >= getFieldValue(`experience[${nameKey}].begin_on`)) { - cb(); - } else { - cb("时间范围不正确"); - } - }, []); - return ( -
    - - - - {getFieldDecorator(`experience[${nameKey}].begin_on`, { - rules: [{ required: true, message: "请选择开始日期" }], - })()} - - - - - {getFieldDecorator(`experience[${nameKey}].end_on`, { - rules: [ - { required: true, message: "请选择结束日期" }, - { validator: greatValidater }, - ], - validateFirst: true, - })()} - - - - {onDelete ? ( - - ) : null} - - - - {getFieldDecorator(`experience[${nameKey}].company`, { - rules: [ - { max: 60, message: "超过60字符" }, - { required: true, message: "请输入公司名称" }, - { whitespace: true, message: "不能全空" }, - ], - validateFirst: true, - })()} - - - {getFieldDecorator(`experience[${nameKey}].desc`, { - rules: [ - { max: 5000, message: "超过5000字符" }, - { required: true, message: "请输入工作描述" }, - ], - validateFirst: true, - })( - - )} - -
    - ); -}; diff --git a/src/modules/recruitment/routePage/AddJobPage.js b/src/modules/recruitment/routePage/AddJobPage.js deleted file mode 100644 index 84209889c..000000000 --- a/src/modules/recruitment/routePage/AddJobPage.js +++ /dev/null @@ -1,52 +0,0 @@ -import React, { useCallback } from "react"; -import FormPage from "../jobForm/FormPage"; -import { submitJobInfo } from "../data/submitData"; -import { useLoaded } from "../util/hooks"; -import { getProfileLoc } from "../data/getProfileLoc"; -import Loading from "../util/Loading"; -import styled from "styled-components"; -import { FullScreen } from "../util/Layout"; -import { notification } from "antd"; - -const Backgroud = styled(FullScreen)` - background: rgba(245, 246, 249, 1); -`; - -export default ({ history, user }) => { - console.log(user); - const { isLoaded, data: city } = useLoaded(getProfileLoc, [user]); - const submit = useCallback((v) => { - const f = async () => { - await submitJobInfo(v); - notification.open({ - message: "成功", - description: "提交职位成功,请耐心等待审核", - }); - const wait = (ms) => new Promise((resolve) => setTimeout(resolve, ms)); - await wait(1000); - history.push("/recruitment?tab=1&jobstate=drafted"); - }; - f(); - }, []); - const data = { - education: "学历不限", - work_year: "经验不限", - city, - }; - if (!isLoaded) { - return ( - - - - ); - } - return ( - { - history.goBack(); - }} - > - ); -}; diff --git a/src/modules/recruitment/routePage/AddResumePage.js b/src/modules/recruitment/routePage/AddResumePage.js deleted file mode 100644 index 58c2b9e02..000000000 --- a/src/modules/recruitment/routePage/AddResumePage.js +++ /dev/null @@ -1,63 +0,0 @@ -import React, { useRef, useCallback } from "react"; -import styled from "styled-components"; -import Form from "../resumeForm/NormalForm"; -import { CenterBtnGrp, SaveBtn, CancelBtn } from "../util/GeneralButton"; -import { sumitResume } from "../data/sumitResume"; -import Nav from "../util/Nav"; - -const Background = styled.div` - width: 100%; - background: rgba(245, 246, 249, 1); - min-height: 100vh; - padding: 20px; - padding-bottom: 70px; -`; -const Content = styled.div` - width: 1200px; - padding: 40px; - background: rgba(255, 255, 255, 1); - border-radius: 2px; - margin: 0 auto; - margin-bottom: 40px; -`; -const Margin = styled.div` - height: 80px; -`; - -export default ({ history }) => { - console.log(history[0]); - const validator = useRef(null); - const submit = useCallback((v) => { - const f = async () => { - await sumitResume(v); - history.goBack(); - }; - f(); - }, []); - const onOk = useCallback(() => { - validator.current.verify((e, v) => { - if (e) { - return; - } - submit(v); - }); - }, []); - return ( - - - -
    -
    - - { - history.push("/recruitment"); - }} - /> - - - -
    -
    - ); -}; diff --git a/src/modules/recruitment/routePage/ApplierPage.js b/src/modules/recruitment/routePage/ApplierPage.js deleted file mode 100644 index 99d188055..000000000 --- a/src/modules/recruitment/routePage/ApplierPage.js +++ /dev/null @@ -1,63 +0,0 @@ -import React, { useState, useCallback } from "react"; -import styled from "styled-components"; -import { Pagination } from "antd"; -import Header from "../jobAppliers/Header"; -import List from "../jobAppliers/List"; -import Loading from "../util/Loading"; -import { getAppliers } from "../data/getAppliers"; -import Nav from "../util/Nav"; -import { useLoaded } from "../util/hooks"; -import { Link } from "react-router-dom"; - -const GreyBg = styled.div` - width: 100%; - background: rgba(245, 246, 249, 1); - min-height: 100vh; -`; -const Paper = styled.div` - width: 1200px; - padding: 30px; - background: rgba(255, 255, 255, 1); - border-radius: 2px; - margin: 0 auto; - min-height:500px; -`; - -export default ({ jobId, history }) => { - console.log("render"); - const [page, setPage] = useState(1); - const { isLoaded, data } = useLoaded(getAppliers, [jobId, page, history]); - const back = useCallback(() => { - history.push("/recruitment?tab=1&jobstate=published"); - }, []); - let appliers, count; - if (data) { - [appliers, count] = data; - } - return ( - - -