"use strict"; (self["webpackChunk"] = self["webpackChunk"] || []).push([[24080],{ /***/ 26762: /*!******************************************************************************************************!*\ !*** ./node_modules/_@ant-design_icons@5.5.1@@ant-design/icons/es/icons/PlusOutlined.js + 1 modules ***! \******************************************************************************************************/ /***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) { // EXPORTS __webpack_require__.d(__webpack_exports__, { Z: function() { return /* binding */ icons_PlusOutlined; } }); // EXTERNAL MODULE: ./node_modules/_@babel_runtime@7.26.0@@babel/runtime/helpers/esm/extends.js var esm_extends = __webpack_require__(5891); // EXTERNAL MODULE: ./node_modules/_react@17.0.2@react/index.js var _react_17_0_2_react = __webpack_require__(59301); ;// CONCATENATED MODULE: ./node_modules/_@ant-design_icons-svg@4.4.2@@ant-design/icons-svg/es/asn/PlusOutlined.js // This icon file is generated automatically. var PlusOutlined = { "icon": { "tag": "svg", "attrs": { "viewBox": "64 64 896 896", "focusable": "false" }, "children": [{ "tag": "path", "attrs": { "d": "M482 152h60q8 0 8 8v704q0 8-8 8h-60q-8 0-8-8V160q0-8 8-8z" } }, { "tag": "path", "attrs": { "d": "M192 474h672q8 0 8 8v60q0 8-8 8H160q-8 0-8-8v-60q0-8 8-8z" } }] }, "name": "plus", "theme": "outlined" }; /* harmony default export */ var asn_PlusOutlined = (PlusOutlined); // EXTERNAL MODULE: ./node_modules/_@ant-design_icons@5.5.1@@ant-design/icons/es/components/AntdIcon.js + 3 modules var AntdIcon = __webpack_require__(22589); ;// CONCATENATED MODULE: ./node_modules/_@ant-design_icons@5.5.1@@ant-design/icons/es/icons/PlusOutlined.js // GENERATE BY ./scripts/generate.ts // DON NOT EDIT IT MANUALLY var PlusOutlined_PlusOutlined = function PlusOutlined(props, ref) { return /*#__PURE__*/_react_17_0_2_react.createElement(AntdIcon/* default */.Z, (0,esm_extends/* default */.Z)({}, props, { ref: ref, icon: asn_PlusOutlined })); }; /** */ var RefIcon = /*#__PURE__*/_react_17_0_2_react.forwardRef(PlusOutlined_PlusOutlined); if (false) {} /* harmony default export */ var icons_PlusOutlined = (RefIcon); /***/ }), /***/ 73303: /*!********************************************************************************************************!*\ !*** ./node_modules/_@ant-design_icons@5.5.1@@ant-design/icons/es/icons/ReloadOutlined.js + 1 modules ***! \********************************************************************************************************/ /***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) { // EXPORTS __webpack_require__.d(__webpack_exports__, { Z: function() { return /* binding */ icons_ReloadOutlined; } }); // EXTERNAL MODULE: ./node_modules/_@babel_runtime@7.26.0@@babel/runtime/helpers/esm/extends.js var esm_extends = __webpack_require__(5891); // EXTERNAL MODULE: ./node_modules/_react@17.0.2@react/index.js var _react_17_0_2_react = __webpack_require__(59301); ;// CONCATENATED MODULE: ./node_modules/_@ant-design_icons-svg@4.4.2@@ant-design/icons-svg/es/asn/ReloadOutlined.js // This icon file is generated automatically. var ReloadOutlined = { "icon": { "tag": "svg", "attrs": { "viewBox": "64 64 896 896", "focusable": "false" }, "children": [{ "tag": "path", "attrs": { "d": "M909.1 209.3l-56.4 44.1C775.8 155.1 656.2 92 521.9 92 290 92 102.3 279.5 102 511.5 101.7 743.7 289.8 932 521.9 932c181.3 0 335.8-115 394.6-276.1 1.5-4.2-.7-8.9-4.9-10.3l-56.7-19.5a8 8 0 00-10.1 4.8c-1.8 5-3.8 10-5.9 14.9-17.3 41-42.1 77.8-73.7 109.4A344.77 344.77 0 01655.9 829c-42.3 17.9-87.4 27-133.8 27-46.5 0-91.5-9.1-133.8-27A341.5 341.5 0 01279 755.2a342.16 342.16 0 01-73.7-109.4c-17.9-42.4-27-87.4-27-133.9s9.1-91.5 27-133.9c17.3-41 42.1-77.8 73.7-109.4 31.6-31.6 68.4-56.4 109.3-73.8 42.3-17.9 87.4-27 133.8-27 46.5 0 91.5 9.1 133.8 27a341.5 341.5 0 01109.3 73.8c9.9 9.9 19.2 20.4 27.8 31.4l-60.2 47a8 8 0 003 14.1l175.6 43c5 1.2 9.9-2.6 9.9-7.7l.8-180.9c-.1-6.6-7.8-10.3-13-6.2z" } }] }, "name": "reload", "theme": "outlined" }; /* harmony default export */ var asn_ReloadOutlined = (ReloadOutlined); // EXTERNAL MODULE: ./node_modules/_@ant-design_icons@5.5.1@@ant-design/icons/es/components/AntdIcon.js + 3 modules var AntdIcon = __webpack_require__(22589); ;// CONCATENATED MODULE: ./node_modules/_@ant-design_icons@5.5.1@@ant-design/icons/es/icons/ReloadOutlined.js // GENERATE BY ./scripts/generate.ts // DON NOT EDIT IT MANUALLY var ReloadOutlined_ReloadOutlined = function ReloadOutlined(props, ref) { return /*#__PURE__*/_react_17_0_2_react.createElement(AntdIcon/* default */.Z, (0,esm_extends/* default */.Z)({}, props, { ref: ref, icon: asn_ReloadOutlined })); }; /** */ var RefIcon = /*#__PURE__*/_react_17_0_2_react.forwardRef(ReloadOutlined_ReloadOutlined); if (false) {} /* harmony default export */ var icons_ReloadOutlined = (RefIcon); /***/ }), /***/ 53802: /*!************************************************************!*\ !*** ./src/components/image-preview/index.tsx + 1 modules ***! \************************************************************/ /***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) { // EXPORTS __webpack_require__.d(__webpack_exports__, { Z: function() { return /* binding */ image_preview; } }); // 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/_react@17.0.2@react/index.js var _react_17_0_2_react = __webpack_require__(59301); ;// CONCATENATED MODULE: ./src/components/image-preview/index.less // extracted by mini-css-extract-plugin // EXTERNAL MODULE: ./src/components/mediator.js var mediator = __webpack_require__(50021); // EXTERNAL MODULE: ./node_modules/_antd@5.9.0@antd/es/button/index.js var es_button = __webpack_require__(3113); // EXTERNAL MODULE: ./node_modules/_@ant-design_icons@5.5.1@@ant-design/icons/es/icons/ReloadOutlined.js + 1 modules var ReloadOutlined = __webpack_require__(73303); // EXTERNAL MODULE: ./node_modules/_@ant-design_icons@5.5.1@@ant-design/icons/es/icons/DownloadOutlined.js + 1 modules var DownloadOutlined = __webpack_require__(82234); // EXTERNAL MODULE: ./node_modules/_@ant-design_icons@5.5.1@@ant-design/icons/es/icons/CloseOutlined.js + 1 modules var CloseOutlined = __webpack_require__(51638); // EXTERNAL MODULE: ./node_modules/_react@17.0.2@react/jsx-runtime.js var jsx_runtime = __webpack_require__(37712); ;// CONCATENATED MODULE: ./src/components/image-preview/index.tsx /* harmony default export */ var image_preview = (function () { var _useState = (0,_react_17_0_2_react.useState)(''), _useState2 = slicedToArray_default()(_useState, 2), url = _useState2[0], setUrl = _useState2[1]; var _useState3 = (0,_react_17_0_2_react.useState)(0), _useState4 = slicedToArray_default()(_useState3, 2), deg = _useState4[0], setDeg = _useState4[1]; var saveUrl = (0,_react_17_0_2_react.useRef)(''); (0,_react_17_0_2_react.useEffect)(function () { var unSub = mediator/* default */.Z.subscribe('preview-image', function (value) { setUrl(value); // window.document.body // document.body.style.height='100%' document.body.style.overflow = 'hidden'; }); return unSub; }, []); (0,_react_17_0_2_react.useEffect)(function () { document.addEventListener('keydown', onViewEscClose); return function () { document.removeEventListener('keydown', onViewEscClose); }; }, []); (0,_react_17_0_2_react.useEffect)(function () { saveUrl.current = url; }, [url]); function onViewEscClose(e) { if (e.keyCode == 27 && saveUrl.current) { onClose(); } } // https://data.educoder.net/api/attachments/1571649 function onClose() { // document.body.style.height='100%' document.body.style.overflow = 'auto'; setUrl(''); } function onRotate() { setDeg(deg + 90); } var maskRef = (0,_react_17_0_2_react.useRef)(); var previewWrapperRef = (0,_react_17_0_2_react.useRef)(); var handleMaskClick = function handleMaskClick(e) { if (e.nativeEvent.target === maskRef.current || e.nativeEvent.target === previewWrapperRef.current) { onClose(); } }; return /*#__PURE__*/(0,jsx_runtime.jsx)(_react_17_0_2_react.Fragment, { children: !url ? null : /*#__PURE__*/(0,jsx_runtime.jsxs)("div", { className: "image-preview-container", ref: maskRef, onClick: handleMaskClick, children: [/*#__PURE__*/(0,jsx_runtime.jsxs)("div", { className: "button-group", children: [/*#__PURE__*/(0,jsx_runtime.jsxs)(es_button/* default */.ZP, { onClick: onRotate, children: ["\u65CB\u8F6C", /*#__PURE__*/(0,jsx_runtime.jsx)(ReloadOutlined/* default */.Z, {})] }), /*#__PURE__*/(0,jsx_runtime.jsxs)(es_button/* default */.ZP, { href: url, children: ["\u4E0B\u8F7D", /*#__PURE__*/(0,jsx_runtime.jsx)(DownloadOutlined/* default */.Z, {})] }), /*#__PURE__*/(0,jsx_runtime.jsxs)(es_button/* default */.ZP, { onClick: onClose, children: ["\u5173\u95ED", /*#__PURE__*/(0,jsx_runtime.jsx)(CloseOutlined/* default */.Z, {})] })] }), /*#__PURE__*/(0,jsx_runtime.jsx)("div", { className: "preview-wrp-group", ref: previewWrapperRef, children: /*#__PURE__*/(0,jsx_runtime.jsx)("img", { className: "image-preview", src: url, alt: "\u9884\u89C8\u5927\u56FE", style: { transform: "rotate(".concat(deg, "deg)") } }) })] }) }); }); /***/ }), /***/ 24080: /*!**************************************************************!*\ !*** ./src/pages/Account/Profile/Edit/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 */ Profile_Edit; }, identityMap: function() { return /* binding */ identityMap; } }); // 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/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/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/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__(97091); // 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/input/index.js + 5 modules var input = __webpack_require__(73782); // 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/modal/index.js + 16 modules var modal = __webpack_require__(43418); // 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/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/radio/index.js + 5 modules var es_radio = __webpack_require__(5112); // EXTERNAL MODULE: ./node_modules/_antd@5.9.0@antd/es/upload/index.js + 24 modules var upload = __webpack_require__(59028); // EXTERNAL MODULE: ./node_modules/_antd@5.9.0@antd/es/button/index.js var es_button = __webpack_require__(3113); ;// CONCATENATED MODULE: ./src/pages/Account/Profile/Edit/index.less?modules // extracted by mini-css-extract-plugin /* harmony default export */ var Editmodules = ({"wrap":"wrap___isQuw","content":"content___Gh5i7","hint":"hint___dh6_r","title":"title___Txz11","titleWrap":"titleWrap___p75TL","formWrap":"formWrap___tyQRy","identityWrap":"identityWrap___RmEwo","schoolHintWrap":"schoolHintWrap___WnTDr","colorCDCDCD":"colorCDCDCD___Xq4Mx","color0152d9":"color0152d9___lAjmo","submitButton":"submitButton___LHi3i","submitButtondiv":"submitButtondiv___J6VbH","glow":"glow___jcndc","staffidInput":"staffidInput___M9rEi"}); // EXTERNAL MODULE: ./src/pages/Account/components/AppplySchoolModal/index.tsx + 1 modules var AppplySchoolModal = __webpack_require__(4907); // EXTERNAL MODULE: ./src/pages/Account/components/AppplyDepartmentModal/index.tsx + 1 modules var AppplyDepartmentModal = __webpack_require__(7576); // EXTERNAL MODULE: ./src/assets/images/AssistantCode3.jpeg var AssistantCode3 = __webpack_require__(32637); // EXTERNAL MODULE: ./src/utils/util.tsx var util = __webpack_require__(21082); // EXTERNAL MODULE: ./src/service/account.ts var service_account = __webpack_require__(28678); // EXTERNAL MODULE: ./node_modules/_@ant-design_icons@5.5.1@@ant-design/icons/es/icons/LoadingOutlined.js + 1 modules var LoadingOutlined = __webpack_require__(42141); // EXTERNAL MODULE: ./node_modules/_@ant-design_icons@5.5.1@@ant-design/icons/es/icons/PlusOutlined.js + 1 modules var PlusOutlined = __webpack_require__(26762); // EXTERNAL MODULE: ./src/components/image-preview/index.tsx + 1 modules var image_preview = __webpack_require__(53802); // EXTERNAL MODULE: ./src/components/mediator.js var mediator = __webpack_require__(50021); // EXTERNAL MODULE: ./src/utils/env.ts + 1 modules var env = __webpack_require__(92723); // EXTERNAL MODULE: ./node_modules/_react@17.0.2@react/jsx-runtime.js var jsx_runtime = __webpack_require__(37712); ;// CONCATENATED MODULE: ./src/pages/Account/Profile/Edit/index.tsx var _excluded = ["user", "account", "globalSetting", "shixunHomeworks", "loading", "dispatch"]; var Option = es_select["default"].Option; var TextArea = input/* default */.Z.TextArea; var identityMap = { "teacher": "教师", "student": "学生", "professional": "专业人士" }; var MAX_NAME_LENGTH = 20; var MAX_NICKNAME_LENGTH = 20; var Edit = function Edit(_ref) { var _account$basicInfo3, _formValue$nickname, _form$getFieldValue, _schoolList$find3; var user = _ref.user, account = _ref.account, globalSetting = _ref.globalSetting, shixunHomeworks = _ref.shixunHomeworks, 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)(true), _useState12 = slicedToArray_default()(_useState11, 2), showRealName = _useState12[0], setShowRealName = _useState12[1]; var _useState13 = (0,_react_17_0_2_react.useState)(false), _useState14 = slicedToArray_default()(_useState13, 2), assistantVisible = _useState14[0], setAssistantVisible = _useState14[1]; var _useState15 = (0,_react_17_0_2_react.useState)(), _useState16 = slicedToArray_default()(_useState15, 2), realName = _useState16[0], setRealName = _useState16[1]; var _useState17 = (0,_react_17_0_2_react.useState)(null), _useState18 = slicedToArray_default()(_useState17, 2), saveIdentity = _useState18[0], setSaveIdentity = _useState18[1]; var _useState19 = (0,_react_17_0_2_react.useState)(true), _useState20 = slicedToArray_default()(_useState19, 2), schoolLoading = _useState20[0], setSchoolLoading = _useState20[1]; var _useState21 = (0,_react_17_0_2_react.useState)(), _useState22 = slicedToArray_default()(_useState21, 2), imageUrl = _useState22[0], setimageUrl = _useState22[1]; var _useState23 = (0,_react_17_0_2_react.useState)(false), _useState24 = slicedToArray_default()(_useState23, 2), imgloading = _useState24[0], setimgLoading = _useState24[1]; var _useState25 = (0,_react_17_0_2_react.useState)([]), _useState26 = slicedToArray_default()(_useState25, 2), fileList = _useState26[0], setFileList = _useState26[1]; var _useState27 = (0,_react_17_0_2_react.useState)('学号'), _useState28 = slicedToArray_default()(_useState27, 2), studentName = _useState28[0], setStudentName = _useState28[1]; var _account$basicInfo = account.basicInfo, basicInfo = _account$basicInfo === void 0 ? {} : _account$basicInfo; // 已职业认证的账户不能修改职业,学校/单位,院系/部门(true为disable) var professionalFlag = basicInfo && basicInfo.professional_certification == "certified"; var toolTipProps = professionalFlag ? { visible: false } : { visible: false }; (0,_react_17_0_2_react.useEffect)(function () { getSchoolOption(); }, []); (0,_react_17_0_2_react.useEffect)(function () { if (basicInfo !== null && basicInfo !== void 0 && basicInfo.identity && (basicInfo === null || basicInfo === void 0 ? void 0 : basicInfo.identity) === 'student' || !(basicInfo !== null && basicInfo !== void 0 && basicInfo.identity)) { setStudentName('学号'); } else { setStudentName('工号'); } }, [account]); (0,_react_17_0_2_react.useEffect)(function () { asyncToGenerator_default()( /*#__PURE__*/regeneratorRuntime_default()().mark(function _callee() { var _account$basicInfo2; var res; return regeneratorRuntime_default()().wrap(function _callee$(_context) { while (1) switch (_context.prev = _context.next) { case 0: _context.next = 2; return getDepartmentOption((_account$basicInfo2 = account.basicInfo) === null || _account$basicInfo2 === void 0 ? void 0 : _account$basicInfo2.school_id); case 2: res = _context.sent; setDepartmentList(res === null || res === void 0 ? void 0 : res.departments); case 4: case "end": return _context.stop(); } }, _callee); }))(); }, [(_account$basicInfo3 = account.basicInfo) === null || _account$basicInfo3 === void 0 ? void 0 : _account$basicInfo3.school_id]); var getSchoolOption = /*#__PURE__*/function () { var _ref3 = asyncToGenerator_default()( /*#__PURE__*/regeneratorRuntime_default()().mark(function _callee2() { var res; return regeneratorRuntime_default()().wrap(function _callee2$(_context2) { while (1) switch (_context2.prev = _context2.next) { case 0: setSchoolLoading(true); _context2.next = 3; return dispatch({ type: 'account/getSchoolOption' }); case 3: res = _context2.sent; setSchoolLoading(false); setSchoolList(res === null || res === void 0 ? void 0 : res.schools); case 6: case "end": return _context2.stop(); } }, _callee2); })); return function getSchoolOption() { return _ref3.apply(this, arguments); }; }(); var getDepartmentOption = function getDepartmentOption(schoolId) { if (!schoolId) { return; } return dispatch({ type: 'account/getDepartmentOption', payload: { id: schoolId } }); }; (0,_react_17_0_2_react.useEffect)(function () { if (!account.basicInfo) { return; } var basicInfo = account.basicInfo; var formData = { nickname: basicInfo.nickname, name: basicInfo.show_realname ? basicInfo.name : (0,util/* getHiddenName */.YA)(basicInfo.name), gender: basicInfo.gender, city: [basicInfo.location, basicInfo.location_city], identity: basicInfo.identity, school: basicInfo.school_name, department: basicInfo.department_name, studentNo: basicInfo.student_id, edu_entry_year: basicInfo.edu_entry_year, edu_background: basicInfo.edu_background, brief_introduction: basicInfo.brief_introduction, jobTitle: basicInfo.identity == "teacher" ? basicInfo.technical_title : "教授", manager: basicInfo.identity == "professional" ? basicInfo.technical_title : "企业管理者", staff_id: basicInfo.staff_id // face_image:[{uid:'111',name:'111',url:basicInfo.face_image}] }; if (basicInfo !== null && basicInfo !== void 0 && basicInfo.face_image) { var _basicInfo$face_image; setFileList([{ uid: '111', name: '111', url: env/* default */.Z.API_SERVER + basicInfo.face_image, response: { id: basicInfo === null || basicInfo === void 0 || (_basicInfo$face_image = basicInfo.face_image) === null || _basicInfo$face_image === void 0 || (_basicInfo$face_image = _basicInfo$face_image.split('/')) === null || _basicInfo$face_image === void 0 ? void 0 : _basicInfo$face_image[3] } }]); } setRealName(basicInfo.name); setShowRealName(basicInfo.show_realname); setSaveIdentity(basicInfo.identity); form.setFieldsValue(formData); setFormValue(formData); }, [account.basicInfo]); var handleApplySchool = function handleApplySchool() { dispatch({ type: 'account/setActionTabs', payload: { key: 'Account-AppplySchool' } }); }; var handleApplyDepartment = function handleApplyDepartment() { if (!schoolList.find(function (item) { return item.name === formValue.school; })) { message/* default */.ZP.info('请先选择正确的单位或者学校!'); return; } dispatch({ type: 'account/setActionTabs', payload: { key: 'Account-AppplyDepartment' } }); }; var handleValuesChange = function handleValuesChange(changedValues) { var _changedValues$nickna; setFormValue(objectSpread2_default()({}, form.getFieldsValue())); // if(!changedValues.nickname){ // form.setFieldsValue({ name: formValue.name }); // } 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: '' })); } } if ((changedValues === null || changedValues === void 0 || (_changedValues$nickna = changedValues.nickname) === null || _changedValues$nickna === void 0 ? void 0 : _changedValues$nickna.length) <= 0) { setShowRealName(true); form.setFieldsValue({ name: realName }); } if ('name' in changedValues) { setRealName(changedValues.name); } if ('identity' in changedValues) { form.setFieldsValue({ staff_id: '' }); } }; var handleSetShowRealName = function handleSetShowRealName() { var nextRealNameStatus = !showRealName; setShowRealName(nextRealNameStatus); var nextName = nextRealNameStatus ? realName : (0,util/* getHiddenName */.YA)(realName); form.setFieldsValue({ name: nextName }); }; var handleSetDepartment = /*#__PURE__*/function () { var _ref4 = asyncToGenerator_default()( /*#__PURE__*/regeneratorRuntime_default()().mark(function _callee3(school, departmentName) { var _schoolList$find, _res$departments; var findSchoolId, res, name; return regeneratorRuntime_default()().wrap(function _callee3$(_context3) { while (1) switch (_context3.prev = _context3.next) { case 0: findSchoolId = (_schoolList$find = schoolList.find(function (item) { return item.name === school; })) === null || _schoolList$find === void 0 ? void 0 : _schoolList$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(_x, _x2) { 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(_x3) { return _ref5.apply(this, arguments); }; }(); var handleCancelAuth = /*#__PURE__*/function () { var _ref6 = asyncToGenerator_default()( /*#__PURE__*/regeneratorRuntime_default()().mark(function _callee6(isRealNameAuth) { return regeneratorRuntime_default()().wrap(function _callee6$(_context6) { while (1) switch (_context6.prev = _context6.next) { case 0: modal/* default */.Z.confirm({ centered: true, okText: '确定', cancelText: '取消', title: isRealNameAuth ? '您已通过实名认证,修改姓名需要撤销实名认证,是否确定撤销?' : '您已通过职业认证,修改信息需要撤销职业认证,是否确定撤销?', onOk: function () { var _onOk = asyncToGenerator_default()( /*#__PURE__*/regeneratorRuntime_default()().mark(function _callee5() { var _user$userInfo, _user$userInfo2; var res, _user$userInfo3; return regeneratorRuntime_default()().wrap(function _callee5$(_context5) { while (1) switch (_context5.prev = _context5.next) { case 0: if (!isRealNameAuth) { _context5.next = 6; break; } _context5.next = 3; return (0,service_account/* cancelAuthentication */.RA)({ login: (_user$userInfo = user.userInfo) === null || _user$userInfo === void 0 ? void 0 : _user$userInfo.login }); case 3: _context5.t0 = _context5.sent; _context5.next = 9; break; case 6: _context5.next = 8; return (0,service_account/* cancelProfessionalCertification */.kN)({ login: (_user$userInfo2 = user.userInfo) === null || _user$userInfo2 === void 0 ? void 0 : _user$userInfo2.login }); case 8: _context5.t0 = _context5.sent; case 9: res = _context5.t0; if (res) { message/* default */.ZP.success(isRealNameAuth ? '撤销实名认证成功' : '撤销职业认证成功'); dispatch({ type: 'account/getBasicInfo', payload: { login: (_user$userInfo3 = user.userInfo) === null || _user$userInfo3 === void 0 ? void 0 : _user$userInfo3.login } }); } case 11: case "end": return _context5.stop(); } }, _callee5); })); function onOk() { return _onOk.apply(this, arguments); } return onOk; }() }); case 1: case "end": return _context6.stop(); } }, _callee6); })); return function handleCancelAuth(_x4) { return _ref6.apply(this, arguments); }; }(); var educationBackound = function educationBackound() { var year = new Date().getFullYear(); return Array(31).fill({}).map(function (item, key) { return /*#__PURE__*/(0,jsx_runtime.jsx)(Option, { value: year - key, children: /*#__PURE__*/(0,jsx_runtime.jsx)("span", { children: year - key }) }, key); }); }; var handleFinish = /*#__PURE__*/function () { var _ref7 = asyncToGenerator_default()( /*#__PURE__*/regeneratorRuntime_default()().mark(function _callee8(values) { var _departmentList$find, _schoolList$find2; var nickname, gender, identity, studentNo, jobTitle, manager, school, department, edu_background, edu_entry_year, brief_introduction, face_image, staff_id, department_id, school_id, basicInfo, titls, professionalFlags, _account$basicInfo6, _fileList$2, res, _account$basicInfo7, _user$userInfo7; return regeneratorRuntime_default()().wrap(function _callee8$(_context8) { while (1) switch (_context8.prev = _context8.next) { case 0: nickname = values.nickname, gender = values.gender, identity = values.identity, studentNo = values.studentNo, jobTitle = values.jobTitle, manager = values.manager, school = values.school, department = values.department, edu_background = values.edu_background, edu_entry_year = values.edu_entry_year, brief_introduction = values.brief_introduction, face_image = values.face_image, staff_id = values.staff_id; department_id = (_departmentList$find = departmentList.find(function (item) { return item.name === department; })) === null || _departmentList$find === void 0 ? void 0 : _departmentList$find.id; school_id = (_schoolList$find2 = schoolList.find(function (item) { return item.name === school; })) === null || _schoolList$find2 === void 0 ? void 0 : _schoolList$find2.id; basicInfo = account.basicInfo; // // const [location, location_city] = city; titls = []; if (basicInfo.authentication != 'uncertified') { //判断名称是不是修改了 if (realName != basicInfo.name) { titls.push('姓名'); } if (gender != basicInfo.gender) { titls.push('性别'); } } professionalFlags = []; if (professionalFlag) { if (identity != basicInfo.identity) { professionalFlags.push('职业'); } else { if (formValue.identity === 'student') { if (studentNo != basicInfo.student_id) { professionalFlags.push('职业'); } } if (formValue.identity === 'teacher') { if (jobTitle != basicInfo.technical_title) { professionalFlags.push('职业'); } } if (formValue.identity === 'professional') { if (manager != basicInfo.technical_title) { professionalFlags.push('职业'); } } } if (school != basicInfo.school_name) { professionalFlags.push('学校/单位'); } if (department != basicInfo.department_name) { professionalFlags.push('院系/部门'); } } if (!(titls.length > 0 || professionalFlags.length > 0)) { _context8.next = 12; break; } modal/* default */.Z.confirm({ centered: true, icon: null, okText: '确定', cancelText: '取消', title: '提示', content: /*#__PURE__*/(0,jsx_runtime.jsx)("div", { children: "\u672C\u6B21\u4FEE\u6539\u6D89\u53CA".concat(titls.toString().replaceAll(',', '、')).concat(titls.length > 0 && professionalFlags.length > 0 ? '、' : '').concat(professionalFlags.toString().replaceAll(',', '、'), "\uFF0C\u9700\u8981\u91CD\u65B0\u8FDB\u884C").concat(titls.length > 0 ? '实名认证' : '').concat(titls.length > 0 && professionalFlags.length > 0 ? '和' : '').concat(professionalFlags.length > 0 ? '职业认证' : '', "\uFF0C\u8BF7\u786E\u8BA4\u662F\u5426\u8FDB\u884C\u4FEE\u6539") }), onOk: function () { var _onOk2 = asyncToGenerator_default()( /*#__PURE__*/regeneratorRuntime_default()().mark(function _callee7() { var _account$basicInfo4, _fileList$; var _user$userInfo4, _user$userInfo5, res, _account$basicInfo5, _user$userInfo6; return regeneratorRuntime_default()().wrap(function _callee7$(_context7) { while (1) switch (_context7.prev = _context7.next) { case 0: if (!(titls.length > 0)) { _context7.next = 3; break; } _context7.next = 3; return (0,service_account/* cancelAuthentication */.RA)({ login: (_user$userInfo4 = user.userInfo) === null || _user$userInfo4 === void 0 ? void 0 : _user$userInfo4.login }); case 3: if (!(professionalFlags.length > 0)) { _context7.next = 6; break; } _context7.next = 6; return (0,service_account/* cancelProfessionalCertification */.kN)({ login: (_user$userInfo5 = user.userInfo) === null || _user$userInfo5 === void 0 ? void 0 : _user$userInfo5.login }); case 6: _context7.next = 8; return dispatch({ type: 'account/updateAccount', payload: { id: (_account$basicInfo4 = account.basicInfo) === null || _account$basicInfo4 === void 0 ? void 0 : _account$basicInfo4.id, department_id: department_id, gender: gender, identity: identity, location: location, // location_city, name: realName, nickname: nickname, school_id: school_id, edu_background: edu_background, edu_entry_year: edu_entry_year, show_realname: showRealName, brief_introduction: brief_introduction, student_id: identity === 'student' ? studentNo : null, technical_title: jobTitle || manager, face_image: fileList === null || fileList === void 0 || (_fileList$ = fileList[0]) === null || _fileList$ === void 0 || (_fileList$ = _fileList$.response) === null || _fileList$ === void 0 ? void 0 : _fileList$.id } }); case 8: res = _context7.sent; if (!((res === null || res === void 0 ? void 0 : res.status) === -1)) { _context7.next = 11; break; } return _context7.abrupt("return"); case 11: if (!res) { _context7.next = 19; break; } message/* default */.ZP.info('保存成功'); if (!((_account$basicInfo5 = account.basicInfo) !== null && _account$basicInfo5 !== void 0 && _account$basicInfo5.base_info_completed)) { dispatch({ type: 'user/getUserInfo' }); } dispatch({ type: 'account/getBasicInfo', payload: { login: (_user$userInfo6 = user.userInfo) === null || _user$userInfo6 === void 0 ? void 0 : _user$userInfo6.login } }); if (!(identity !== saveIdentity && identity === 'teacher')) { _context7.next = 17; break; } return _context7.abrupt("return"); case 17: if (localStorage.getItem('Noviceguide') === '0') {} else { dispatch({ type: 'shixunHomeworks/setActionTabs', payload: { key: '底部弹窗', type: 4, href: '/classrooms', text: /*#__PURE__*/(0,jsx_runtime.jsx)("div", { children: "OK\uFF0C\u63A5\u4E0B\u6765\uFF0C\u8BA9\u6211\u4EEC\u5F00\u59CB\u65B0\u5EFA\u3010\u6559\u5B66\u8BFE\u5802\u3011\uFF0C\u8BF7\u60A8\u627E\u5230\u95EA\u5149\u6846\u5E76\u70B9\u51FB \u201C\u6559\u5B66\u8BFE\u5802\u201D\u3002" }) } }); } _umi_production_exports.history.push('/account/profile'); case 19: case "end": return _context7.stop(); } }, _callee7); })); function onOk() { return _onOk2.apply(this, arguments); } return onOk; }() }); _context8.next = 25; break; case 12: _context8.next = 14; return dispatch({ type: 'account/updateAccount', payload: { id: (_account$basicInfo6 = account.basicInfo) === null || _account$basicInfo6 === void 0 ? void 0 : _account$basicInfo6.id, department_id: department_id, gender: gender, identity: identity, location: location, // location_city, name: realName, nickname: nickname, school_id: school_id, edu_background: edu_background, edu_entry_year: edu_entry_year, staff_id: staff_id, show_realname: showRealName, brief_introduction: brief_introduction, student_id: identity === 'student' ? studentNo : null, technical_title: jobTitle || manager, face_image: fileList === null || fileList === void 0 || (_fileList$2 = fileList[0]) === null || _fileList$2 === void 0 || (_fileList$2 = _fileList$2.response) === null || _fileList$2 === void 0 ? void 0 : _fileList$2.id } }); case 14: res = _context8.sent; if (!((res === null || res === void 0 ? void 0 : res.status) === -1)) { _context8.next = 17; break; } return _context8.abrupt("return"); case 17: if (!res) { _context8.next = 25; break; } message/* default */.ZP.info('保存成功'); if (!((_account$basicInfo7 = account.basicInfo) !== null && _account$basicInfo7 !== void 0 && _account$basicInfo7.base_info_completed)) { dispatch({ type: 'user/getUserInfo' }); } dispatch({ type: 'account/getBasicInfo', payload: { login: (_user$userInfo7 = user.userInfo) === null || _user$userInfo7 === void 0 ? void 0 : _user$userInfo7.login } }); if (!(identity !== saveIdentity && identity === 'teacher')) { _context8.next = 23; break; } return _context8.abrupt("return"); case 23: if (localStorage.getItem('Noviceguide') === '0') {} else { dispatch({ type: 'shixunHomeworks/setActionTabs', payload: { key: '底部弹窗', type: 4, href: '/classrooms', text: /*#__PURE__*/(0,jsx_runtime.jsx)("div", { children: "OK\uFF0C\u63A5\u4E0B\u6765\uFF0C\u8BA9\u6211\u4EEC\u5F00\u59CB\u65B0\u5EFA\u3010\u6559\u5B66\u8BFE\u5802\u3011\uFF0C\u8BF7\u60A8\u627E\u5230\u95EA\u5149\u6846\u5E76\u70B9\u51FB \u201C\u6559\u5B66\u8BFE\u5802\u201D\u3002" }) } }); } _umi_production_exports.history.push('/account/profile'); case 25: case "end": return _context8.stop(); } }, _callee8); })); return function handleFinish(_x5) { return _ref7.apply(this, arguments); }; }(); var modalSkip = function modalSkip() { setAssistantVisible(false); _umi_production_exports.history.push('/account/profile'); }; var uploadButton = /*#__PURE__*/(0,jsx_runtime.jsxs)("div", { children: [imgloading ? /*#__PURE__*/(0,jsx_runtime.jsx)(LoadingOutlined/* default */.Z, {}) : /*#__PURE__*/(0,jsx_runtime.jsx)(PlusOutlined/* default */.Z, {}), /*#__PURE__*/(0,jsx_runtime.jsx)("div", { style: { marginTop: 8 }, children: "\u4E0A\u4F20" })] }); var getBase64 = function getBase64(img, callback) { var reader = new FileReader(); reader.addEventListener('load', function () { return callback(reader.result); }); reader.readAsDataURL(img); }; return /*#__PURE__*/(0,jsx_runtime.jsxs)("section", { className: Editmodules.wrap, children: [/*#__PURE__*/(0,jsx_runtime.jsxs)("div", { className: Editmodules.content, children: [/*#__PURE__*/(0,jsx_runtime.jsx)("div", { className: Editmodules.titleWrap, children: /*#__PURE__*/(0,jsx_runtime.jsx)("div", { className: Editmodules.title, children: "\u57FA\u672C\u4FE1\u606F" }) }), /*#__PURE__*/(0,jsx_runtime.jsxs)(es_form/* default */.Z, { form: form, className: Editmodules.formWrap, layout: "horizontal", onValuesChange: handleValuesChange, onFinish: handleFinish, children: [ /*#__PURE__*/ // basicInfo.authentication == 'uncertified' ? (0,jsx_runtime.jsx)(es_form/* default */.Z.Item, { label: "\u59D3\u540D", name: "name", rules: [{ required: true, message: "\u8BF7\u8F93\u5165\u771F\u5B9E\u59D3\u540D\uFF0C\u6700\u5927\u9650\u5236".concat(MAX_NAME_LENGTH, "\u4E2A\u5B57\u7B26") }, { validator: util/* handleValidatorName */.HJ }], extra: /*#__PURE__*/(0,jsx_runtime.jsx)("span", { children: formValue.nickname ? showRealName ? '显示:平台将显示您的真实姓名' : '隐藏:平台将显示你的昵称' : '填写昵称后可设置姓名进行隐藏(当进行姓名搜索时,会展示您的真实姓名)' }), children: /*#__PURE__*/(0,jsx_runtime.jsx)(input/* default */.Z // size="large" , { style: { height: 40 }, disabled: formValue.nickname ? !showRealName : false, placeholder: "\u8BF7\u8F93\u5165\u771F\u5B9E\u59D3\u540D\uFF0C\u6700\u5927\u9650\u5236".concat(MAX_NAME_LENGTH, "\u4E2A\u5B57\u7B26"), maxLength: MAX_NAME_LENGTH, suffix: formValue.nickname ? /*#__PURE__*/(0,jsx_runtime.jsx)("i", { style: { lineHeight: '26px' }, className: "iconfont ".concat(showRealName ? 'icon-xianshi' : 'icon-yincang', " font18 ").concat(Editmodules.color0152d9), onClick: handleSetShowRealName }) : null }) }) // : //