You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
NewEduCoderBuild/p__User__Detail__AccountInf...

753 lines
34 KiB

"use strict";
(self["webpackChunk"] = self["webpackChunk"] || []).push([[31416],{
/***/ 4888:
/*!*************************************************************************************!*\
!*** ./src/pages/User/Detail/AccountInfo/CareerCertification/index.tsx + 1 modules ***!
\*************************************************************************************/
/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
// ESM COMPAT FLAG
__webpack_require__.r(__webpack_exports__);
// EXPORTS
__webpack_require__.d(__webpack_exports__, {
"default": function() { return /* binding */ CareerCertification; }
});
// EXTERNAL MODULE: ./node_modules/_@babel_runtime@7.23.6@@babel/runtime/helpers/regeneratorRuntime.js
var regeneratorRuntime = __webpack_require__(7557);
var regeneratorRuntime_default = /*#__PURE__*/__webpack_require__.n(regeneratorRuntime);
// EXTERNAL MODULE: ./node_modules/_@babel_runtime@7.23.6@@babel/runtime/helpers/objectSpread2.js
var objectSpread2 = __webpack_require__(82242);
var objectSpread2_default = /*#__PURE__*/__webpack_require__.n(objectSpread2);
// EXTERNAL MODULE: ./node_modules/_@babel_runtime@7.23.6@@babel/runtime/helpers/toConsumableArray.js
var toConsumableArray = __webpack_require__(37205);
var toConsumableArray_default = /*#__PURE__*/__webpack_require__.n(toConsumableArray);
// EXTERNAL MODULE: ./node_modules/_@babel_runtime@7.23.6@@babel/runtime/helpers/asyncToGenerator.js
var asyncToGenerator = __webpack_require__(41498);
var asyncToGenerator_default = /*#__PURE__*/__webpack_require__.n(asyncToGenerator);
// EXTERNAL MODULE: ./node_modules/_@babel_runtime@7.23.6@@babel/runtime/helpers/slicedToArray.js
var slicedToArray = __webpack_require__(79800);
var slicedToArray_default = /*#__PURE__*/__webpack_require__.n(slicedToArray);
// EXTERNAL MODULE: ./node_modules/_@babel_runtime@7.23.6@@babel/runtime/helpers/objectWithoutProperties.js
var objectWithoutProperties = __webpack_require__(39647);
var objectWithoutProperties_default = /*#__PURE__*/__webpack_require__.n(objectWithoutProperties);
// EXTERNAL MODULE: ./node_modules/_react@17.0.2@react/index.js
var _react_17_0_2_react = __webpack_require__(59301);
// EXTERNAL MODULE: ./src/.umi-production/exports.ts
var _umi_production_exports = __webpack_require__(48938);
// EXTERNAL MODULE: ./node_modules/_antd@5.9.0@antd/es/select/index.js
var es_select = __webpack_require__(57809);
// EXTERNAL MODULE: ./node_modules/_antd@5.9.0@antd/es/upload/index.js + 24 modules
var upload = __webpack_require__(54580);
// EXTERNAL MODULE: ./node_modules/_antd@5.9.0@antd/es/form/index.js + 19 modules
var es_form = __webpack_require__(78241);
// EXTERNAL MODULE: ./node_modules/_antd@5.9.0@antd/es/message/index.js + 4 modules
var message = __webpack_require__(8591);
// EXTERNAL MODULE: ./node_modules/_antd@5.9.0@antd/es/spin/index.js + 1 modules
var spin = __webpack_require__(71418);
// EXTERNAL MODULE: ./node_modules/_antd@5.9.0@antd/es/row/index.js
var row = __webpack_require__(95237);
// EXTERNAL MODULE: ./node_modules/_antd@5.9.0@antd/es/col/index.js
var col = __webpack_require__(43604);
// EXTERNAL MODULE: ./node_modules/_antd@5.9.0@antd/es/input/index.js + 5 modules
var input = __webpack_require__(10249);
// EXTERNAL MODULE: ./node_modules/_antd@5.9.0@antd/es/tooltip/index.js + 3 modules
var tooltip = __webpack_require__(6848);
// EXTERNAL MODULE: ./node_modules/_antd@5.9.0@antd/es/auto-complete/index.js
var auto_complete = __webpack_require__(88522);
// EXTERNAL MODULE: ./node_modules/_antd@5.9.0@antd/es/button/index.js
var es_button = __webpack_require__(3113);
// EXTERNAL MODULE: ./src/pages/User/Detail/AccountInfo/components/AppplySchoolModal/index.tsx + 1 modules
var AppplySchoolModal = __webpack_require__(99405);
// EXTERNAL MODULE: ./src/pages/User/Detail/AccountInfo/components/AppplyDepartmentModal/index.tsx + 1 modules
var AppplyDepartmentModal = __webpack_require__(461);
// EXTERNAL MODULE: ./src/utils/env.ts + 1 modules
var env = __webpack_require__(63648);
;// CONCATENATED MODULE: ./src/pages/User/Detail/AccountInfo/CareerCertification/index.less?modules
// extracted by mini-css-extract-plugin
/* harmony default export */ var CareerCertificationmodules = ({"modal":"modal____ssfC","colorBlue":"colorBlue___vZIcC","formWrap":"formWrap___Rxwqi","flexRow":"flexRow___K4rXe","flexColumn":"flexColumn___AqTfO","example":"example___JWtD9","exampleImg":"exampleImg___QXK9C","colorOrange":"colorOrange___pNrU4","uploader":"uploader___gwoUO","uploadImg":"uploadImg___dJUTb","imageTip":"imageTip___nNH8z","uploadTipIcon":"uploadTipIcon___CRQxL","uploadTip":"uploadTip___Hp7rX","color05101a":"color05101a___G4pdC","viewLargerImg":"viewLargerImg___bMB3e","footerWrap":"footerWrap___DeHYE","note":"note___BEdWC","schoolHintWrap":"schoolHintWrap___zHXjt","colorCDCDCD":"colorCDCDCD___sUIJS","color0152d9":"color0152d9___z5mvy","tips":"tips___wL0_E"});
// EXTERNAL MODULE: ./src/utils/util.tsx
var util = __webpack_require__(82338);
// EXTERNAL MODULE: ./src/pages/User/Detail/AccountInfo/index.tsx
var AccountInfo = __webpack_require__(62389);
// EXTERNAL MODULE: ./node_modules/_lodash@4.17.21@lodash/lodash.js
var lodash = __webpack_require__(89392);
// EXTERNAL MODULE: ./node_modules/_react@17.0.2@react/jsx-runtime.js
var jsx_runtime = __webpack_require__(37712);
;// CONCATENATED MODULE: ./src/pages/User/Detail/AccountInfo/CareerCertification/index.tsx
var _excluded = ["user", "account", "globalSetting", "loading", "dispatch"];
var Option = es_select["default"].Option;
var Dragger = upload/* default */.Z.Dragger;
var ProfessionalAuthModal = function ProfessionalAuthModal(_ref) {
var _account$basicInfo5, _schoolList$find2;
var user = _ref.user,
account = _ref.account,
globalSetting = _ref.globalSetting,
loading = _ref.loading,
dispatch = _ref.dispatch,
props = objectWithoutProperties_default()(_ref, _excluded);
var _Form$useForm = es_form/* default */.Z.useForm(),
_Form$useForm2 = slicedToArray_default()(_Form$useForm, 1),
form = _Form$useForm2[0];
var _useState = (0,_react_17_0_2_react.useState)({}),
_useState2 = slicedToArray_default()(_useState, 2),
formValue = _useState2[0],
setFormValue = _useState2[1];
var _useState3 = (0,_react_17_0_2_react.useState)([]),
_useState4 = slicedToArray_default()(_useState3, 2),
schoolList = _useState4[0],
setSchoolList = _useState4[1];
var _useState5 = (0,_react_17_0_2_react.useState)([]),
_useState6 = slicedToArray_default()(_useState5, 2),
filterSchoolList = _useState6[0],
setFilterSchoolList = _useState6[1];
var _useState7 = (0,_react_17_0_2_react.useState)([]),
_useState8 = slicedToArray_default()(_useState7, 2),
departmentList = _useState8[0],
setDepartmentList = _useState8[1];
var _useState9 = (0,_react_17_0_2_react.useState)([]),
_useState10 = slicedToArray_default()(_useState9, 2),
filterDepartmentList = _useState10[0],
setFilterDepartmentList = _useState10[1];
var _useState11 = (0,_react_17_0_2_react.useState)(),
_useState12 = slicedToArray_default()(_useState11, 2),
image = _useState12[0],
setImage = _useState12[1];
var _useState13 = (0,_react_17_0_2_react.useState)(),
_useState14 = slicedToArray_default()(_useState13, 2),
fileId = _useState14[0],
setFileId = _useState14[1];
var _useState15 = (0,_react_17_0_2_react.useState)(),
_useState16 = slicedToArray_default()(_useState15, 2),
isLoading = _useState16[0],
setIsLoading = _useState16[1];
var _useState17 = (0,_react_17_0_2_react.useState)(),
_useState18 = slicedToArray_default()(_useState17, 2),
visibleAppplySchool = _useState18[0],
setVisibleAppplySchool = _useState18[1];
var _useState19 = (0,_react_17_0_2_react.useState)(),
_useState20 = slicedToArray_default()(_useState19, 2),
visibleAppplyDepartment = _useState20[0],
setVisibleAppplyDepartment = _useState20[1];
(0,_react_17_0_2_react.useEffect)(function () {
var _account$basicInfo;
if ((_account$basicInfo = account.basicInfo) !== null && _account$basicInfo !== void 0 && _account$basicInfo.school_id) {
var _account$basicInfo2, _account$basicInfo3, _account$basicInfo4;
getDepartmentOption((_account$basicInfo2 = account.basicInfo) === null || _account$basicInfo2 === void 0 ? void 0 : _account$basicInfo2.school_id);
setSchoolList([{
id: (_account$basicInfo3 = account.basicInfo) === null || _account$basicInfo3 === void 0 ? void 0 : _account$basicInfo3.school_id,
name: (_account$basicInfo4 = account.basicInfo) === null || _account$basicInfo4 === void 0 ? void 0 : _account$basicInfo4.school_name
}]);
}
// getSchoolOption();
}, [(_account$basicInfo5 = account.basicInfo) === null || _account$basicInfo5 === void 0 ? void 0 : _account$basicInfo5.school_id]);
var throttleGetSchoolOption = (0,_react_17_0_2_react.useRef)((0,lodash.throttle)(function (value) {
return getSchoolOption(value);
}, 1200, {
leading: true,
trailing: true
})).current;
// useEffect(() => {
// if (!account.basicInfo?.school_id) {
// return;
// }
// (async () => {
// const res = await getDepartmentOption(account.basicInfo?.school_id);
// setDepartmentList(res?.departments);
// })();
// }, [account.basicInfo?.school_id]);
var getSchoolOption = /*#__PURE__*/function () {
var _ref2 = asyncToGenerator_default()( /*#__PURE__*/regeneratorRuntime_default()().mark(function _callee(value) {
var res, _res$schools, _res$schools2, findSchoolId;
return regeneratorRuntime_default()().wrap(function _callee$(_context) {
while (1) switch (_context.prev = _context.next) {
case 0:
_context.next = 2;
return dispatch({
type: 'account/getSchoolOption',
payload: {
keyword: value,
limit: 99999
}
});
case 2:
res = _context.sent;
setSchoolList(res === null || res === void 0 ? void 0 : res.schools);
setFilterSchoolList(res === null || res === void 0 ? void 0 : res.schools);
if (value && value != "") {
setFilterSchoolList(toConsumableArray_default()(res === null || res === void 0 || (_res$schools = res.schools) === null || _res$schools === void 0 ? void 0 : _res$schools.filter(function (item) {
return item.name.includes(value);
})));
findSchoolId = ((res === null || res === void 0 || (_res$schools2 = res.schools) === null || _res$schools2 === void 0 ? void 0 : _res$schools2.find(function (item) {
return item.name === value;
})) || {}).id;
if (findSchoolId) {
handleSetDepartment(value, null, res === null || res === void 0 ? void 0 : res.schools);
} else {
form.setFieldsValue(objectSpread2_default()(objectSpread2_default()({}, form.getFieldsValue()), {}, {
department: ''
}));
setFormValue(objectSpread2_default()(objectSpread2_default()({}, form.getFieldsValue()), {
school: value,
department: ''
}));
}
}
case 6:
case "end":
return _context.stop();
}
}, _callee);
}));
return function getSchoolOption(_x) {
return _ref2.apply(this, arguments);
};
}();
var getDepartmentOption = /*#__PURE__*/function () {
var _ref3 = asyncToGenerator_default()( /*#__PURE__*/regeneratorRuntime_default()().mark(function _callee2(schoolId) {
var res;
return regeneratorRuntime_default()().wrap(function _callee2$(_context2) {
while (1) switch (_context2.prev = _context2.next) {
case 0:
if (schoolId) {
_context2.next = 2;
break;
}
return _context2.abrupt("return");
case 2:
_context2.next = 4;
return dispatch({
type: 'account/getDepartmentOption',
payload: {
id: schoolId
}
});
case 4:
res = _context2.sent;
setDepartmentList(res === null || res === void 0 ? void 0 : res.departments);
return _context2.abrupt("return", res);
case 7:
case "end":
return _context2.stop();
}
}, _callee2);
}));
return function getDepartmentOption(_x2) {
return _ref3.apply(this, arguments);
};
}();
(0,_react_17_0_2_react.useEffect)(function () {
if (!account.basicInfo) {
return;
}
var basicInfo = account.basicInfo;
var formData = {
identity: basicInfo.identity,
school: basicInfo.school_name,
department: basicInfo.department_name,
studentNo: basicInfo.student_id,
jobTitle: basicInfo.identity == "teacher" ? basicInfo.technical_title : "教授",
manager: basicInfo.identity == "professional" ? basicInfo.technical_title : "企业管理者",
staff_id: basicInfo.staff_id
};
form.setFieldsValue(formData);
setFormValue(formData);
}, [account.basicInfo]);
var handleApplySchool = function handleApplySchool() {
setVisibleAppplySchool(true);
};
var handleApplyDepartment = function handleApplyDepartment() {
if (!schoolList.find(function (item) {
return item.name === formValue.school;
})) {
message/* default */.ZP.info('请先选择正确的单位或者学校!');
return;
}
setVisibleAppplyDepartment(true);
};
var handleValuesChange = function handleValuesChange(changedValues) {
setFormValue(objectSpread2_default()({}, form.getFieldsValue()));
if ('school' in changedValues) {
setFilterSchoolList(schoolList.filter(function (item) {
return item.name.includes(changedValues.school);
}));
var findSchoolId = (schoolList.find(function (item) {
return item.name === changedValues.school;
}) || {}).id;
if (findSchoolId) {
handleSetDepartment(changedValues.school);
} else {
form.setFieldsValue({
department: ''
});
setFormValue(objectSpread2_default()(objectSpread2_default()({}, formValue), {
school: changedValues.school,
department: ''
}));
}
}
};
var handleSetDepartment = /*#__PURE__*/function () {
var _ref4 = asyncToGenerator_default()( /*#__PURE__*/regeneratorRuntime_default()().mark(function _callee3(school, departmentName, schoolData) {
var _find, _res$departments;
var findSchoolId, res, name;
return regeneratorRuntime_default()().wrap(function _callee3$(_context3) {
while (1) switch (_context3.prev = _context3.next) {
case 0:
findSchoolId = (_find = (schoolData || schoolList).find(function (item) {
return item.name === school;
})) === null || _find === void 0 ? void 0 : _find.id;
_context3.next = 3;
return getDepartmentOption(findSchoolId);
case 3:
_context3.t0 = _context3.sent;
if (_context3.t0) {
_context3.next = 6;
break;
}
_context3.t0 = {};
case 6:
res = _context3.t0;
setDepartmentList(res === null || res === void 0 ? void 0 : res.departments);
name = departmentName || (res === null || res === void 0 || (_res$departments = res.departments) === null || _res$departments === void 0 || (_res$departments = _res$departments[0]) === null || _res$departments === void 0 ? void 0 : _res$departments.name);
form.setFieldsValue({
department: name
});
setFormValue(objectSpread2_default()(objectSpread2_default()({}, formValue), {
school: school,
department: name
}));
case 11:
case "end":
return _context3.stop();
}
}, _callee3);
}));
return function handleSetDepartment(_x3, _x4, _x5) {
return _ref4.apply(this, arguments);
};
}();
var handleSchoolSuccess = /*#__PURE__*/function () {
var _ref5 = asyncToGenerator_default()( /*#__PURE__*/regeneratorRuntime_default()().mark(function _callee4(schoolName) {
return regeneratorRuntime_default()().wrap(function _callee4$(_context4) {
while (1) switch (_context4.prev = _context4.next) {
case 0:
_context4.next = 2;
return getSchoolOption();
case 2:
form.setFieldsValue({
school: schoolName,
department: ''
});
setFormValue(objectSpread2_default()(objectSpread2_default()({}, formValue), {
school: schoolName,
department: ''
}));
case 4:
case "end":
return _context4.stop();
}
}, _callee4);
}));
return function handleSchoolSuccess(_x6) {
return _ref5.apply(this, arguments);
};
}();
var handleUploadChange = function handleUploadChange(info) {
if (info.file.status === 'uploading') {
setIsLoading(true);
return;
}
if (info.file.status === 'done') {
var _info$file$response;
console.log(info.file, info.file.response);
setFileId((_info$file$response = info.file.response) === null || _info$file$response === void 0 ? void 0 : _info$file$response.id);
(0,util/* getBase64 */.y3)(info.file.originFileObj, function (base64Img) {
setImage(base64Img);
setIsLoading(false);
});
}
};
var handleFinish = /*#__PURE__*/function () {
var _ref6 = asyncToGenerator_default()( /*#__PURE__*/regeneratorRuntime_default()().mark(function _callee5(values) {
var _schoolList$find, _departmentList$find, _account$basicInfo6, _user$userInfo;
var _ref7, school, department, identity, studentNo, jobTitle, manager, staff_id, school_id, department_id, extra, res, _user$userInfo2;
return regeneratorRuntime_default()().wrap(function _callee5$(_context5) {
while (1) switch (_context5.prev = _context5.next) {
case 0:
_ref7 = values || {}, school = _ref7.school, department = _ref7.department, identity = _ref7.identity, studentNo = _ref7.studentNo, jobTitle = _ref7.jobTitle, manager = _ref7.manager, staff_id = _ref7.staff_id; // if (!image) {
// message.info('请先上传照片!');
// return;
// }
school_id = (_schoolList$find = schoolList.find(function (item) {
return item.name === school;
})) === null || _schoolList$find === void 0 ? void 0 : _schoolList$find.id;
department_id = (_departmentList$find = departmentList.find(function (item) {
return item.name === department;
})) === null || _departmentList$find === void 0 ? void 0 : _departmentList$find.id;
if (identity === 'student') {
extra = studentNo;
} else if (identity === 'teacher') {
extra = jobTitle;
} else {
extra = manager;
}
_context5.next = 6;
return dispatch({
type: 'account/applyProfessionalAuth',
payload: {
id: ((_account$basicInfo6 = account.basicInfo) === null || _account$basicInfo6 === void 0 ? void 0 : _account$basicInfo6.id) || ((_user$userInfo = user.userInfo) === null || _user$userInfo === void 0 ? void 0 : _user$userInfo.login),
school_id: school_id,
department_id: department_id,
identity: identity,
extra: extra,
staff_id: staff_id
// attachment_ids: [fileId]
}
});
case 6:
res = _context5.sent;
handleClose();
if (res) {
message/* default */.ZP.info("申请已提交,请等待审核!");
setImage('');
dispatch({
type: 'account/getBasicInfo',
payload: {
login: (_user$userInfo2 = user.userInfo) === null || _user$userInfo2 === void 0 ? void 0 : _user$userInfo2.login
}
});
}
case 9:
case "end":
return _context5.stop();
}
}, _callee5);
}));
return function handleFinish(_x7) {
return _ref6.apply(this, arguments);
};
}();
var handleClose = function handleClose() {
dispatch({
type: 'account/setActionTabs',
payload: {}
});
};
var uploadProps = {
data: {
type: "professional"
},
multiple: true,
withCredentials: true,
showUploadList: false,
action: "".concat(env/* default */.Z.API_SERVER, "/api/attachments.json"),
className: CareerCertificationmodules.uploader,
onChange: handleUploadChange,
beforeUpload: function beforeUpload(file) {
var isJpgOrPng = file.type === 'image/jpeg' || file.type === 'image/png' || file.type === 'image/jpg' || file.type === 'image/bmp';
if (!isJpgOrPng) {
message/* default */.ZP.info('请上传正确文件格式');
}
return isJpgOrPng;
}
};
return /*#__PURE__*/(0,jsx_runtime.jsxs)("div", {
children: [/*#__PURE__*/(0,jsx_runtime.jsx)(AccountInfo/* default */.Z, {
active: 3
}), /*#__PURE__*/(0,jsx_runtime.jsx)("div", {
style: {
paddingTop: '30px'
},
children: /*#__PURE__*/(0,jsx_runtime.jsx)(spin/* default */.Z, {
spinning: !!isLoading,
children: /*#__PURE__*/(0,jsx_runtime.jsxs)(es_form/* default */.Z, {
className: CareerCertificationmodules.formWrap,
form: form,
layout: "horizontal",
onValuesChange: handleValuesChange,
onFinish: handleFinish,
scrollToFirstError: true,
size: "large",
children: [/*#__PURE__*/(0,jsx_runtime.jsxs)(row/* default */.Z, {
gutter: [10, 0],
children: [/*#__PURE__*/(0,jsx_runtime.jsx)(col/* default */.Z, {
flex: "300px",
children: /*#__PURE__*/(0,jsx_runtime.jsx)(es_form/* default */.Z.Item, {
label: "\u804C\u4E1A",
name: "identity",
rules: [{
required: true,
message: '请先选择职业'
}],
children: /*#__PURE__*/(0,jsx_runtime.jsxs)(es_select["default"], {
size: "large",
children: [/*#__PURE__*/(0,jsx_runtime.jsx)(Option, {
value: "teacher",
children: "\u6559\u5E08"
}), /*#__PURE__*/(0,jsx_runtime.jsx)(Option, {
value: "student",
children: "\u5B66\u751F"
}), /*#__PURE__*/(0,jsx_runtime.jsx)(Option, {
value: "professional",
children: "\u4E13\u4E1A\u4EBA\u58EB"
})]
})
})
}), formValue.identity === 'student' && /*#__PURE__*/(0,jsx_runtime.jsxs)(jsx_runtime.Fragment, {
children: [/*#__PURE__*/(0,jsx_runtime.jsx)(col/* default */.Z, {
flex: 1,
children: /*#__PURE__*/(0,jsx_runtime.jsx)(es_form/* default */.Z.Item, {
initialValue: formValue.studentNo,
name: "studentNo",
rules: [{
required: true,
message: '请先输入学号'
}],
children: /*#__PURE__*/(0,jsx_runtime.jsx)(input/* default */.Z, {
size: "large",
type: "text",
placeholder: "\u8BF7\u8F93\u5165\u5B66\u53F7"
})
})
}), /*#__PURE__*/(0,jsx_runtime.jsx)(col/* default */.Z, {
flex: 0,
children: /*#__PURE__*/(0,jsx_runtime.jsx)("div", {
className: CareerCertificationmodules.tooltipWrapper,
children: /*#__PURE__*/(0,jsx_runtime.jsx)(tooltip/* default */.Z, {
title: "\u5355\u4F4D\u7BA1\u7406\u5458\u53EF\u7BA1\u7406\u5DF2\u901A\u8FC7\u804C\u4E1A\u8BA4\u8BC1\u7684\u5B66\u751F\u8D26\u53F7\u4FE1\u606F\uFF08\u5305\u542B\u521D\u59CB\u5316\u5BC6\u7801\uFF09",
children: /*#__PURE__*/(0,jsx_runtime.jsx)("span", {
className: CareerCertificationmodules.tips,
children: /*#__PURE__*/(0,jsx_runtime.jsx)("i", {
className: "iconfont icon-a-wenhaobeifen2"
})
})
})
})
})]
}), formValue.identity === 'teacher' && /*#__PURE__*/(0,jsx_runtime.jsx)(col/* default */.Z, {
flex: 1,
children: /*#__PURE__*/(0,jsx_runtime.jsx)(es_form/* default */.Z.Item, {
initialValue: formValue.jobTitle,
name: "jobTitle",
rules: [{
required: true,
message: '请先选择职称'
}],
children: /*#__PURE__*/(0,jsx_runtime.jsxs)(es_select["default"], {
size: "large",
children: [/*#__PURE__*/(0,jsx_runtime.jsx)(Option, {
value: "\u6559\u6388",
children: "\u6559\u6388"
}), /*#__PURE__*/(0,jsx_runtime.jsx)(Option, {
value: "\u526F\u6559\u6388",
children: "\u526F\u6559\u6388"
}), /*#__PURE__*/(0,jsx_runtime.jsx)(Option, {
value: "\u8BB2\u5E08",
children: "\u8BB2\u5E08"
}), /*#__PURE__*/(0,jsx_runtime.jsx)(Option, {
value: "\u52A9\u6559",
children: "\u52A9\u6559"
})]
})
})
}), formValue.identity === 'professional' && /*#__PURE__*/(0,jsx_runtime.jsx)(col/* default */.Z, {
flex: 1,
children: /*#__PURE__*/(0,jsx_runtime.jsx)(es_form/* default */.Z.Item, {
initialValue: formValue.manager,
name: "manager",
rules: [{
required: true,
message: '请先选择职称'
}],
children: /*#__PURE__*/(0,jsx_runtime.jsxs)(es_select["default"], {
size: "large",
children: [/*#__PURE__*/(0,jsx_runtime.jsx)(Option, {
value: "\u4F01\u4E1A\u7BA1\u7406\u8005",
children: "\u4F01\u4E1A\u7BA1\u7406\u8005"
}), /*#__PURE__*/(0,jsx_runtime.jsx)(Option, {
value: "\u90E8\u95E8\u7BA1\u7406\u8005",
children: "\u90E8\u95E8\u7BA1\u7406\u8005"
}), /*#__PURE__*/(0,jsx_runtime.jsx)(Option, {
value: "\u9AD8\u7EA7\u5DE5\u7A0B\u5E08",
children: "\u9AD8\u7EA7\u5DE5\u7A0B\u5E08"
}), /*#__PURE__*/(0,jsx_runtime.jsx)(Option, {
value: "\u5DE5\u7A0B\u5E08",
children: "\u5DE5\u7A0B\u5E08"
}), /*#__PURE__*/(0,jsx_runtime.jsx)(Option, {
value: "\u52A9\u7406\u5DE5\u7A0B\u5E08",
children: "\u52A9\u7406\u5DE5\u7A0B\u5E08"
})]
})
})
})]
}), /*#__PURE__*/(0,jsx_runtime.jsx)(es_form/* default */.Z.Item, {
label: "\u5B66\u6821/\u5355\u4F4D",
name: "school",
extra: formValue.school && !(schoolList !== null && schoolList !== void 0 && schoolList.find(function (item) {
return item.name === formValue.school;
})) && /*#__PURE__*/(0,jsx_runtime.jsxs)("div", {
className: CareerCertificationmodules.schoolHintWrap,
children: [/*#__PURE__*/(0,jsx_runtime.jsxs)("span", {
className: CareerCertificationmodules.colorCDCDCD,
children: ["\u672A\u627E\u5230\u5305\u542B\u201C", formValue.school, "\u201D\u7684\u9AD8\u6821\uFF0C"]
}), /*#__PURE__*/(0,jsx_runtime.jsx)("span", {
className: "".concat(CareerCertificationmodules.color0152d9, " current"),
onClick: handleApplySchool,
children: "\u7533\u8BF7\u65B0\u589E"
})]
}),
rules: [{
required: true,
message: '请先选择学校/单位'
}, {
whitespace: true,
message: '请先选择学校/单位'
}],
children: /*#__PURE__*/(0,jsx_runtime.jsx)(auto_complete/* default */.Z, {
size: "large",
showSearch: true,
onSearch: throttleGetSchoolOption
// options={filterSchoolList?.map(item => ({ value: item.name }))}
,
children: filterSchoolList.map(function (item, key) {
return /*#__PURE__*/(0,jsx_runtime.jsx)(Option, {
value: item.name,
children: item.name
}, key);
})
})
}), /*#__PURE__*/(0,jsx_runtime.jsx)(es_form/* default */.Z.Item, {
label: "\u9662\u7CFB/\u90E8\u95E8",
name: "department",
extra: formValue.department && !(departmentList !== null && departmentList !== void 0 && departmentList.find(function (item) {
return item.name === formValue.department;
})) && /*#__PURE__*/(0,jsx_runtime.jsxs)("div", {
className: CareerCertificationmodules.schoolHintWrap,
children: [/*#__PURE__*/(0,jsx_runtime.jsx)("span", {
className: CareerCertificationmodules.colorCDCDCD,
children: formValue.department ? "\u672A\u627E\u5230\u5305\u542B\u201C".concat(formValue.department, "\u201D\u7684\u9AD8\u6821\uFF0C") : '未找到院系,'
}), /*#__PURE__*/(0,jsx_runtime.jsx)("span", {
className: "".concat(CareerCertificationmodules.color0152d9, " current"),
onClick: handleApplyDepartment,
children: "\u7533\u8BF7\u65B0\u589E"
})]
}),
rules: [{
required: true,
message: '请先选择院系/部门'
}],
children: /*#__PURE__*/(0,jsx_runtime.jsx)(auto_complete/* default */.Z, {
size: "large",
showSearch: true,
onChange: function onChange(value) {
return setFilterDepartmentList(departmentList.filter(function (item) {
return item.name.includes(value);
}));
},
children: filterDepartmentList.map(function (item, key) {
return /*#__PURE__*/(0,jsx_runtime.jsx)(Option, {
value: item.name,
children: item.name
}, key);
})
})
}), (formValue.identity === 'teacher' || formValue.identity === 'professional') && /*#__PURE__*/(0,jsx_runtime.jsx)(es_form/* default */.Z.Item, {
label: "\u5DE5\u53F7",
name: "staff_id"
// labelCol={{ span: 4 }}
,
rules: [{
validator: function validator(rule, value) {
var chineseReg = /[\u4E00-\u9FA5]/g;
if (chineseReg.test(value)) {
return Promise.reject('请勿输入中文字符');
}
return Promise.resolve();
}
}],
children: /*#__PURE__*/(0,jsx_runtime.jsx)(input/* default */.Z, {
className: CareerCertificationmodules.staffidInput,
suffix: " ",
size: "large"
})
}), /*#__PURE__*/(0,jsx_runtime.jsx)("div", {
className: CareerCertificationmodules.footerWrap,
children: /*#__PURE__*/(0,jsx_runtime.jsx)(es_form/* default */.Z.Item, {
children: /*#__PURE__*/(0,jsx_runtime.jsx)(es_button/* default */.ZP, {
size: "middle",
type: "primary"
// htmlType="submit"
,
onClick: function onClick() {
form.submit();
},
loading: loading['account/applyProfessionalAuth'],
children: "\u63D0\u4EA4"
})
})
})]
})
})
}), /*#__PURE__*/(0,jsx_runtime.jsx)(AppplySchoolModal/* default */.Z, {
visible: visibleAppplySchool,
onClose: function onClose() {
return setVisibleAppplySchool(false);
},
schoolName: formValue.school,
onSuccess: handleSchoolSuccess
}), /*#__PURE__*/(0,jsx_runtime.jsx)(AppplyDepartmentModal/* default */.Z, {
visible: visibleAppplyDepartment,
onClose: function onClose() {
return setVisibleAppplyDepartment(false);
},
schoolId: (_schoolList$find2 = schoolList.find(function (item) {
return item.name === formValue.school;
})) === null || _schoolList$find2 === void 0 ? void 0 : _schoolList$find2.id,
schoolName: formValue.school,
departmentName: formValue.department,
onSuccess: function onSuccess(departmentName) {
return handleSetDepartment(formValue.school, departmentName);
}
})]
});
};
/* harmony default export */ var CareerCertification = ((0,_umi_production_exports.connect)(function (_ref8) {
var user = _ref8.user,
account = _ref8.account,
loading = _ref8.loading,
globalSetting = _ref8.globalSetting;
return {
user: user,
account: account,
globalSetting: globalSetting,
loading: loading.effects
};
})(ProfessionalAuthModal));
/***/ })
}]);