|
|
|
|
@ -404,6 +404,10 @@ var Edit = function Edit(_ref) {
|
|
|
|
|
_useState28 = slicedToArray_default()(_useState27, 2),
|
|
|
|
|
studentName = _useState28[0],
|
|
|
|
|
setStudentName = _useState28[1];
|
|
|
|
|
var _useState29 = (0,_react_17_0_2_react.useState)([]),
|
|
|
|
|
_useState30 = slicedToArray_default()(_useState29, 2),
|
|
|
|
|
specialityList = _useState30[0],
|
|
|
|
|
setSpecialityList = _useState30[1];
|
|
|
|
|
var _account$basicInfo = account.basicInfo,
|
|
|
|
|
basicInfo = _account$basicInfo === void 0 ? {} : _account$basicInfo;
|
|
|
|
|
// 已职业认证的账户不能修改职业,学校/单位,院系/部门(true为disable)
|
|
|
|
|
@ -483,6 +487,7 @@ var Edit = function Edit(_ref) {
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
var basicInfo = account.basicInfo;
|
|
|
|
|
_school_majors(basicInfo.school_id, basicInfo.department_id);
|
|
|
|
|
var formData = {
|
|
|
|
|
nickname: basicInfo.nickname,
|
|
|
|
|
name: basicInfo.show_realname ? basicInfo.name : (0,util/* getHiddenName */.YA)(basicInfo.name),
|
|
|
|
|
@ -491,6 +496,7 @@ var Edit = function Edit(_ref) {
|
|
|
|
|
identity: basicInfo.identity,
|
|
|
|
|
school: basicInfo.school_name,
|
|
|
|
|
department: basicInfo.department_name,
|
|
|
|
|
school_major_id: basicInfo.school_major_id,
|
|
|
|
|
studentNo: basicInfo.student_id,
|
|
|
|
|
edu_entry_year: basicInfo.edu_entry_year,
|
|
|
|
|
edu_background: basicInfo.edu_background,
|
|
|
|
|
@ -546,6 +552,9 @@ var Edit = function Edit(_ref) {
|
|
|
|
|
// form.setFieldsValue({ name: formValue.name });
|
|
|
|
|
// }
|
|
|
|
|
if ('school' in changedValues) {
|
|
|
|
|
form.setFieldsValue({
|
|
|
|
|
school_major_id: ''
|
|
|
|
|
});
|
|
|
|
|
setFilterSchoolList(schoolList.filter(function (item) {
|
|
|
|
|
return item.name.includes(changedValues.school);
|
|
|
|
|
}));
|
|
|
|
|
@ -562,6 +571,7 @@ var Edit = function Edit(_ref) {
|
|
|
|
|
school: changedValues.school,
|
|
|
|
|
department: ''
|
|
|
|
|
}));
|
|
|
|
|
_school_majors(findSchoolId, null);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
if ((changedValues === null || changedValues === void 0 || (_changedValues$nickna = changedValues.nickname) === null || _changedValues$nickna === void 0 ? void 0 : _changedValues$nickna.length) <= 0) {
|
|
|
|
|
@ -590,7 +600,7 @@ var Edit = function Edit(_ref) {
|
|
|
|
|
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;
|
|
|
|
|
var findSchoolId, res, name, _res$departments$find, findDepartmentId;
|
|
|
|
|
return regeneratorRuntime_default()().wrap(function _callee3$(_context3) {
|
|
|
|
|
while (1) switch (_context3.prev = _context3.next) {
|
|
|
|
|
case 0:
|
|
|
|
|
@ -617,7 +627,13 @@ var Edit = function Edit(_ref) {
|
|
|
|
|
school: school,
|
|
|
|
|
department: name
|
|
|
|
|
}));
|
|
|
|
|
case 11:
|
|
|
|
|
if (name) {
|
|
|
|
|
findDepartmentId = res === null || res === void 0 || (_res$departments$find = res.departments.find(function (item) {
|
|
|
|
|
return item.name === name;
|
|
|
|
|
})) === null || _res$departments$find === void 0 ? void 0 : _res$departments$find.id;
|
|
|
|
|
_school_majors(findSchoolId, findDepartmentId);
|
|
|
|
|
}
|
|
|
|
|
case 12:
|
|
|
|
|
case "end":
|
|
|
|
|
return _context3.stop();
|
|
|
|
|
}
|
|
|
|
|
@ -736,11 +752,11 @@ var Edit = function Edit(_ref) {
|
|
|
|
|
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;
|
|
|
|
|
var nickname, gender, identity, studentNo, jobTitle, manager, school, department, edu_background, edu_entry_year, brief_introduction, face_image, staff_id, school_major_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;
|
|
|
|
|
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, school_major_id = values.school_major_id;
|
|
|
|
|
department_id = (_departmentList$find = departmentList.find(function (item) {
|
|
|
|
|
return item.name === department;
|
|
|
|
|
})) === null || _departmentList$find === void 0 ? void 0 : _departmentList$find.id;
|
|
|
|
|
@ -841,6 +857,7 @@ var Edit = function Edit(_ref) {
|
|
|
|
|
edu_background: edu_background,
|
|
|
|
|
edu_entry_year: edu_entry_year,
|
|
|
|
|
show_realname: showRealName,
|
|
|
|
|
school_major_id: school_major_id,
|
|
|
|
|
brief_introduction: brief_introduction,
|
|
|
|
|
student_id: identity === 'student' ? studentNo : null,
|
|
|
|
|
technical_title: jobTitle || manager,
|
|
|
|
|
@ -922,6 +939,7 @@ var Edit = function Edit(_ref) {
|
|
|
|
|
edu_background: edu_background,
|
|
|
|
|
edu_entry_year: edu_entry_year,
|
|
|
|
|
staff_id: staff_id,
|
|
|
|
|
school_major_id: school_major_id,
|
|
|
|
|
show_realname: showRealName,
|
|
|
|
|
brief_introduction: brief_introduction,
|
|
|
|
|
student_id: identity === 'student' ? studentNo : null,
|
|
|
|
|
@ -1002,6 +1020,42 @@ var Edit = function Edit(_ref) {
|
|
|
|
|
});
|
|
|
|
|
reader.readAsDataURL(img);
|
|
|
|
|
};
|
|
|
|
|
var _school_majors = /*#__PURE__*/function () {
|
|
|
|
|
var _ref8 = asyncToGenerator_default()( /*#__PURE__*/regeneratorRuntime_default()().mark(function _callee9(school_id, department_id) {
|
|
|
|
|
var res;
|
|
|
|
|
return regeneratorRuntime_default()().wrap(function _callee9$(_context9) {
|
|
|
|
|
while (1) switch (_context9.prev = _context9.next) {
|
|
|
|
|
case 0:
|
|
|
|
|
setSpecialityList([]);
|
|
|
|
|
if (!(!school_id || !department_id)) {
|
|
|
|
|
_context9.next = 3;
|
|
|
|
|
break;
|
|
|
|
|
}
|
|
|
|
|
return _context9.abrupt("return");
|
|
|
|
|
case 3:
|
|
|
|
|
_context9.next = 5;
|
|
|
|
|
return Fetch("/api/school_majors.json", {
|
|
|
|
|
method: 'get',
|
|
|
|
|
params: {
|
|
|
|
|
school_id: school_id,
|
|
|
|
|
department_id: department_id
|
|
|
|
|
}
|
|
|
|
|
});
|
|
|
|
|
case 5:
|
|
|
|
|
res = _context9.sent;
|
|
|
|
|
if ((res === null || res === void 0 ? void 0 : res.status) === 0) {
|
|
|
|
|
setSpecialityList(res.data);
|
|
|
|
|
}
|
|
|
|
|
case 7:
|
|
|
|
|
case "end":
|
|
|
|
|
return _context9.stop();
|
|
|
|
|
}
|
|
|
|
|
}, _callee9);
|
|
|
|
|
}));
|
|
|
|
|
return function _school_majors(_x6, _x7) {
|
|
|
|
|
return _ref8.apply(this, arguments);
|
|
|
|
|
};
|
|
|
|
|
}();
|
|
|
|
|
return /*#__PURE__*/(0,jsx_runtime.jsxs)("section", {
|
|
|
|
|
className: Editmodules.wrap,
|
|
|
|
|
children: [/*#__PURE__*/(0,jsx_runtime.jsxs)("div", {
|
|
|
|
|
@ -1314,62 +1368,97 @@ var Edit = function Edit(_ref) {
|
|
|
|
|
})
|
|
|
|
|
})
|
|
|
|
|
})
|
|
|
|
|
})), /*#__PURE__*/(0,jsx_runtime.jsx)(tooltip/* default */.Z, objectSpread2_default()(objectSpread2_default()({
|
|
|
|
|
placement: "bottom",
|
|
|
|
|
title: function title() {
|
|
|
|
|
return /*#__PURE__*/(0,jsx_runtime.jsxs)("div", {
|
|
|
|
|
children: [/*#__PURE__*/(0,jsx_runtime.jsx)("div", {
|
|
|
|
|
children: "\u5DF2\u63D0\u4EA4\u804C\u4E1A\u8BA4\u8BC1"
|
|
|
|
|
}), /*#__PURE__*/(0,jsx_runtime.jsxs)("div", {
|
|
|
|
|
children: ["\u53EF\u5728", /*#__PURE__*/(0,jsx_runtime.jsx)("a", {
|
|
|
|
|
href: "/account/certification",
|
|
|
|
|
className: "c-blue",
|
|
|
|
|
children: "\u8BA4\u8BC1\u4FE1\u606F"
|
|
|
|
|
}), "\u4E2D\u901A\u8FC7\u201C\u91CD\u65B0\u8BA4\u8BC1\u201D\u8FDB\u884C\u4FEE\u6539"]
|
|
|
|
|
})]
|
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
}, toolTipProps), {}, {
|
|
|
|
|
children: /*#__PURE__*/(0,jsx_runtime.jsx)(es_form/* default */.Z.Item, {
|
|
|
|
|
label: "\u9662\u7CFB/\u90E8\u95E8",
|
|
|
|
|
name: "department",
|
|
|
|
|
wrapperCol: {
|
|
|
|
|
span: 10
|
|
|
|
|
},
|
|
|
|
|
extra: !schoolLoading && formValue.department && !(departmentList !== null && departmentList !== void 0 && departmentList.find(function (item) {
|
|
|
|
|
return item.name === formValue.department;
|
|
|
|
|
})) && /*#__PURE__*/(0,jsx_runtime.jsxs)("div", {
|
|
|
|
|
className: Editmodules.schoolHintWrap,
|
|
|
|
|
children: [/*#__PURE__*/(0,jsx_runtime.jsx)("span", {
|
|
|
|
|
className: Editmodules.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(Editmodules.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",
|
|
|
|
|
onChange: function onChange(value) {
|
|
|
|
|
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);
|
|
|
|
|
})), /*#__PURE__*/(0,jsx_runtime.jsxs)(row/* default */.Z, {
|
|
|
|
|
gutter: [10, 0],
|
|
|
|
|
children: [/*#__PURE__*/(0,jsx_runtime.jsx)(col/* default */.Z, {
|
|
|
|
|
flex: 14,
|
|
|
|
|
children: /*#__PURE__*/(0,jsx_runtime.jsx)(tooltip/* default */.Z, objectSpread2_default()(objectSpread2_default()({
|
|
|
|
|
placement: "bottom",
|
|
|
|
|
title: function title() {
|
|
|
|
|
return /*#__PURE__*/(0,jsx_runtime.jsxs)("div", {
|
|
|
|
|
children: [/*#__PURE__*/(0,jsx_runtime.jsx)("div", {
|
|
|
|
|
children: "\u5DF2\u63D0\u4EA4\u804C\u4E1A\u8BA4\u8BC1"
|
|
|
|
|
}), /*#__PURE__*/(0,jsx_runtime.jsxs)("div", {
|
|
|
|
|
children: ["\u53EF\u5728", /*#__PURE__*/(0,jsx_runtime.jsx)("a", {
|
|
|
|
|
href: "/account/certification",
|
|
|
|
|
className: "c-blue",
|
|
|
|
|
children: "\u8BA4\u8BC1\u4FE1\u606F"
|
|
|
|
|
}), "\u4E2D\u901A\u8FC7\u201C\u91CD\u65B0\u8BA4\u8BC1\u201D\u8FDB\u884C\u4FEE\u6539"]
|
|
|
|
|
})]
|
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
}, toolTipProps), {}, {
|
|
|
|
|
children: /*#__PURE__*/(0,jsx_runtime.jsx)(es_form/* default */.Z.Item, {
|
|
|
|
|
label: "\u9662\u7CFB/\u90E8\u95E8",
|
|
|
|
|
name: "department",
|
|
|
|
|
wrapperCol: {
|
|
|
|
|
span: 10
|
|
|
|
|
},
|
|
|
|
|
extra: !schoolLoading && formValue.department && !(departmentList !== null && departmentList !== void 0 && departmentList.find(function (item) {
|
|
|
|
|
return item.name === formValue.department;
|
|
|
|
|
})) && /*#__PURE__*/(0,jsx_runtime.jsxs)("div", {
|
|
|
|
|
className: Editmodules.schoolHintWrap,
|
|
|
|
|
children: [/*#__PURE__*/(0,jsx_runtime.jsx)("span", {
|
|
|
|
|
className: Editmodules.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(Editmodules.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",
|
|
|
|
|
onChange: function onChange(value) {
|
|
|
|
|
var _departmentList$find2;
|
|
|
|
|
form.setFieldsValue({
|
|
|
|
|
school_major_id: ''
|
|
|
|
|
});
|
|
|
|
|
var findSchoolId = schoolList.find(function (item) {
|
|
|
|
|
return item.name === (formValue === null || formValue === void 0 ? void 0 : formValue.school);
|
|
|
|
|
}).id;
|
|
|
|
|
var findDepartmentId = (_departmentList$find2 = departmentList.find(function (item) {
|
|
|
|
|
return item.name === value;
|
|
|
|
|
})) === null || _departmentList$find2 === void 0 ? void 0 : _departmentList$find2.id;
|
|
|
|
|
_school_majors(findSchoolId, findDepartmentId);
|
|
|
|
|
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);
|
|
|
|
|
})
|
|
|
|
|
})
|
|
|
|
|
})
|
|
|
|
|
}))
|
|
|
|
|
}), /*#__PURE__*/(0,jsx_runtime.jsx)(col/* default */.Z, {
|
|
|
|
|
flex: 10,
|
|
|
|
|
children: /*#__PURE__*/(0,jsx_runtime.jsx)(es_form/* default */.Z.Item, {
|
|
|
|
|
label: "\u4E13\u4E1A",
|
|
|
|
|
name: "school_major_id",
|
|
|
|
|
children: /*#__PURE__*/(0,jsx_runtime.jsx)(es_select["default"], {
|
|
|
|
|
size: "large",
|
|
|
|
|
style: {
|
|
|
|
|
width: '185px'
|
|
|
|
|
},
|
|
|
|
|
children: specialityList.map(function (item, key) {
|
|
|
|
|
return /*#__PURE__*/(0,jsx_runtime.jsx)(Option, {
|
|
|
|
|
value: item.id,
|
|
|
|
|
children: item.name
|
|
|
|
|
}, key);
|
|
|
|
|
})
|
|
|
|
|
})
|
|
|
|
|
})
|
|
|
|
|
})
|
|
|
|
|
})), /*#__PURE__*/(0,jsx_runtime.jsx)(es_form/* default */.Z.Item, {
|
|
|
|
|
})]
|
|
|
|
|
}), /*#__PURE__*/(0,jsx_runtime.jsx)(es_form/* default */.Z.Item, {
|
|
|
|
|
label: "\u6635\u79F0",
|
|
|
|
|
name: "nickname",
|
|
|
|
|
rules: [{
|
|
|
|
|
@ -1665,12 +1754,12 @@ var Edit = function Edit(_ref) {
|
|
|
|
|
}), /*#__PURE__*/(0,jsx_runtime.jsx)(image_preview/* default */.Z, {})]
|
|
|
|
|
});
|
|
|
|
|
};
|
|
|
|
|
/* harmony default export */ var Profile_Edit = ((0,_umi_production_exports.connect)(function (_ref8) {
|
|
|
|
|
var user = _ref8.user,
|
|
|
|
|
account = _ref8.account,
|
|
|
|
|
loading = _ref8.loading,
|
|
|
|
|
globalSetting = _ref8.globalSetting,
|
|
|
|
|
shixunHomeworks = _ref8.shixunHomeworks;
|
|
|
|
|
/* harmony default export */ var Profile_Edit = ((0,_umi_production_exports.connect)(function (_ref9) {
|
|
|
|
|
var user = _ref9.user,
|
|
|
|
|
account = _ref9.account,
|
|
|
|
|
loading = _ref9.loading,
|
|
|
|
|
globalSetting = _ref9.globalSetting,
|
|
|
|
|
shixunHomeworks = _ref9.shixunHomeworks;
|
|
|
|
|
return {
|
|
|
|
|
user: user,
|
|
|
|
|
account: account,
|