Auto Submit

pull/1/head
autosubmit 3 years ago
parent 3b1e8d9721
commit 602ae25a37

@ -1597,7 +1597,7 @@ var Banner = function Banner(_ref) {
title: '姓名',
dataIndex: 'real_name',
key: 'real_name',
width: (params === null || params === void 0 ? void 0 : params.tab) === '1' ? 90 : 60,
width: (params === null || params === void 0 ? void 0 : params.tab) === '3' ? 60 : 110,
ellipsis: true,
render: function render(text, record) {
return /*#__PURE__*/(0,jsx_runtime.jsx)("span", {
@ -1613,7 +1613,7 @@ var Banner = function Banner(_ref) {
dataIndex: 'student_id',
key: 'student_id',
ellipsis: true,
width: 90,
width: (params === null || params === void 0 ? void 0 : params.tab) === '3' ? 90 : 120,
render: function render(text) {
return /*#__PURE__*/(0,jsx_runtime.jsx)("span", {
style: {
@ -1661,7 +1661,7 @@ var Banner = function Banner(_ref) {
dataIndex: 'department',
key: 'department',
ellipsis: true,
width: (params === null || params === void 0 ? void 0 : params.tab) === '1' ? 90 : 70,
width: (params === null || params === void 0 ? void 0 : params.tab) === '3' ? 70 : 140,
render: function render(text, record, index) {
return record.department.name || '--';
}
@ -1670,7 +1670,7 @@ var Banner = function Banner(_ref) {
dataIndex: 'phone',
key: 'phone',
ellipsis: true,
width: (params === null || params === void 0 ? void 0 : params.tab) === '1' ? 110 : 90,
// width: params?.tab === '1'? 110:90,
render: function render(text) {
return /*#__PURE__*/(0,jsx_runtime.jsx)("span", {
style: {
@ -1684,7 +1684,7 @@ var Banner = function Banner(_ref) {
dataIndex: "mail",
key: "mail",
ellipsis: true,
width: (params === null || params === void 0 ? void 0 : params.tab) === '1' ? 130 : 100,
// width: params?.tab === '1'? 130:100,
render: function render(text) {
return /*#__PURE__*/(0,jsx_runtime.jsx)("span", {
style: {
@ -1697,7 +1697,7 @@ var Banner = function Banner(_ref) {
title: '职业认证',
dataIndex: "professional_certification",
key: "professional_certification",
width: 70,
width: 80,
render: function render(text, record, index) {
return (record === null || record === void 0 ? void 0 : record.professional_certification) == true ? "已认证" : /*#__PURE__*/(0,jsx_runtime.jsx)("span", {
style: {
@ -1710,7 +1710,7 @@ var Banner = function Banner(_ref) {
title: '提交时间',
dataIndex: "apply_time",
key: "apply_time",
width: 120,
width: 140,
render: function render(text, record, index) {
return text ? dayjs_min_default()(text).format('YYYY-MM-DD HH:mm') : '--';
}
@ -1718,7 +1718,7 @@ var Banner = function Banner(_ref) {
title: '操作',
key: "action",
align: 'right',
width: (params === null || params === void 0 ? void 0 : params.tab) === '2' ? 80 : 110,
width: (params === null || params === void 0 ? void 0 : params.tab) === '2' ? 80 : 120,
render: function render(text, record) {
switch (params === null || params === void 0 ? void 0 : params.tab) {
case '1':

@ -199,20 +199,26 @@ var Page = function Page(_ref) {
_useState22 = slicedToArray_default()(_useState21, 2),
codeValue = _useState22[0],
setCodeValue = _useState22[1];
var _useState23 = (0,react.useState)(null),
var _useState23 = (0,react.useState)(false),
_useState24 = slicedToArray_default()(_useState23, 2),
id = _useState24[0],
setId = _useState24[1];
var _useState25 = (0,react.useState)({
fetchLoading = _useState24[0],
setFetchLoading = _useState24[1];
var timer = (0,react.useRef)(null);
var fetchIndex = (0,react.useRef)(1);
var _useState25 = (0,react.useState)(null),
_useState26 = slicedToArray_default()(_useState25, 2),
id = _useState26[0],
setId = _useState26[1];
var _useState27 = (0,react.useState)({
keyword: '',
source: '',
status: '',
page: 1,
limit: 20
}),
_useState26 = slicedToArray_default()(_useState25, 2),
params = _useState26[0],
setParams = _useState26[1];
_useState28 = slicedToArray_default()(_useState27, 2),
params = _useState28[0],
setParams = _useState28[1];
//出现页面右侧悬浮按钮
(0,react.useEffect)(function () {
@ -296,35 +302,51 @@ var Page = function Page(_ref) {
return _ref3.apply(this, arguments);
};
}();
var getSchools = /*#__PURE__*/function () {
var _ref4 = asyncToGenerator_default()( /*#__PURE__*/regeneratorRuntime_default()().mark(function _callee3() {
var res;
// const getSchools = async () => {
// const res = await Fetch(`/api/schools/search.json`, {
// method: "get",
// params: {
// page: 1,
// limit: 9999
// }
// })
// if (res.status === 0) {
// setSchools(res?.schools || [])
// }
// }
var getSchools = function getSchools(name) {
var time = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 500;
setFetchLoading(true);
clearTimeout(timer.current);
timer.current = setTimeout( /*#__PURE__*/asyncToGenerator_default()( /*#__PURE__*/regeneratorRuntime_default()().mark(function _callee3() {
var currentFetch, res;
return regeneratorRuntime_default()().wrap(function _callee3$(_context3) {
while (1) switch (_context3.prev = _context3.next) {
case 0:
_context3.next = 2;
fetchIndex.current += 1;
currentFetch = fetchIndex.current;
_context3.next = 4;
return (0,fetch/* default */.ZP)("/api/schools/search.json", {
method: "get",
params: {
page: 1,
limit: 9999
keyword: name
}
});
case 2:
case 4:
res = _context3.sent;
if (res.status === 0) {
if (res.status === 0 && fetchIndex.current === currentFetch) {
setSchools((res === null || res === void 0 ? void 0 : res.schools) || []);
setFetchLoading(false);
}
case 4:
case 6:
case "end":
return _context3.stop();
}
}, _callee3);
}));
return function getSchools() {
return _ref4.apply(this, arguments);
};
}();
})), time);
};
var getDepartments = /*#__PURE__*/function () {
var _ref5 = asyncToGenerator_default()( /*#__PURE__*/regeneratorRuntime_default()().mark(function _callee4(id) {
var res;
@ -380,12 +402,13 @@ var Page = function Page(_ref) {
setFetchAddLoading(true);
_ref7 = user.userInfo || {}, _ref7$user_school_id = _ref7.user_school_id, user_school_id = _ref7$user_school_id === void 0 ? '' : _ref7$user_school_id, _ref7$department_id = _ref7.department_id, department_id = _ref7$department_id === void 0 ? '' : _ref7$department_id, _ref7$school_name = _ref7.school_name, school_name = _ref7$school_name === void 0 ? '' : _ref7$school_name, _ref7$department_name = _ref7.department_name, department_name = _ref7$department_name === void 0 ? '' : _ref7$department_name;
year = years[years.length - 1];
_context5.next = 8;
return getSchools();
case 8:
_context5.next = 10;
setSchools([{
id: user_school_id,
name: school_name
}]);
_context5.next = 9;
return getDepartments(user_school_id);
case 10:
case 9:
addForm.setFieldsValue({
year: year,
school_id: user_school_id,
@ -393,7 +416,7 @@ var Page = function Page(_ref) {
name: "".concat(year).concat(school_name).concat(department_name, "\u6BD5\u4E1A\u8BBE\u8BA1")
});
setFetchAddLoading(false);
case 12:
case 11:
case "end":
return _context5.stop();
}
@ -693,7 +716,11 @@ var Page = function Page(_ref) {
}],
children: /*#__PURE__*/(0,jsx_runtime.jsx)(es_select/* default */.Z, {
showSearch: true,
optionFilterProp: "children",
filterOption: false,
onSearch: function onSearch(v) {
getSchools(v);
},
loading: fetchLoading,
size: "large",
style: {
width: 344

@ -133,34 +133,37 @@ var Page = function Page(_ref) {
var _Form$useForm = es_form/* default.useForm */.Z.useForm(),
_Form$useForm2 = slicedToArray_default()(_Form$useForm, 1),
form = _Form$useForm2[0];
var _useState11 = (0,react.useState)(false),
_useState12 = slicedToArray_default()(_useState11, 2),
fetchLoading = _useState12[0],
setFetchLoading = _useState12[1];
var timer = (0,react.useRef)(null);
var fetchIndex = (0,react.useRef)(1);
(0,react.useEffect)(function () {
getData();
}, []);
var getData = /*#__PURE__*/function () {
var _ref2 = asyncToGenerator_default()( /*#__PURE__*/regeneratorRuntime_default()().mark(function _callee() {
var res, _ref3, school_id, _ref3$department_id, department_id, name, year, code_effect_range, join_audit;
var res, _ref3, school_id, _ref3$department_id, department_id, name, year, code_effect_range, join_audit, school_name;
return regeneratorRuntime_default()().wrap(function _callee$(_context) {
while (1) switch (_context.prev = _context.next) {
case 0:
setLoading(true);
_context.next = 3;
return getSchools();
case 3:
_context.next = 5;
return (0,fetch/* default */.ZP)("/api/graduations/".concat(params === null || params === void 0 ? void 0 : params.id, ".json"), {
method: 'get'
});
case 5:
case 3:
res = _context.sent;
if (!(res.status === 0)) {
_context.next = 12;
_context.next = 11;
break;
}
setYears((res === null || res === void 0 ? void 0 : res.graduation_years) || []);
_ref3 = (res === null || res === void 0 ? void 0 : res.graduation) || {}, school_id = _ref3.school_id, _ref3$department_id = _ref3.department_id, department_id = _ref3$department_id === void 0 ? '' : _ref3$department_id, name = _ref3.name, year = _ref3.year, code_effect_range = _ref3.code_effect_range, join_audit = _ref3.join_audit;
_context.next = 11;
_ref3 = (res === null || res === void 0 ? void 0 : res.graduation) || {}, school_id = _ref3.school_id, _ref3$department_id = _ref3.department_id, department_id = _ref3$department_id === void 0 ? '' : _ref3$department_id, name = _ref3.name, year = _ref3.year, code_effect_range = _ref3.code_effect_range, join_audit = _ref3.join_audit, school_name = _ref3.school_name;
_context.next = 9;
return getDepartments(school_id);
case 11:
case 9:
form.setFieldsValue({
year: year,
school_id: school_id,
@ -169,9 +172,13 @@ var Page = function Page(_ref) {
code_effect_range: code_effect_range,
join_audit: join_audit
});
case 12:
setSchools([{
id: school_id,
name: school_name
}]);
case 11:
setLoading(false);
case 13:
case 12:
case "end":
return _context.stop();
}
@ -181,35 +188,37 @@ var Page = function Page(_ref) {
return _ref2.apply(this, arguments);
};
}();
var getSchools = /*#__PURE__*/function () {
var _ref4 = asyncToGenerator_default()( /*#__PURE__*/regeneratorRuntime_default()().mark(function _callee2() {
var res;
var getSchools = function getSchools(name) {
var time = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 500;
setFetchLoading(true);
clearTimeout(timer.current);
timer.current = setTimeout( /*#__PURE__*/asyncToGenerator_default()( /*#__PURE__*/regeneratorRuntime_default()().mark(function _callee2() {
var currentFetch, res;
return regeneratorRuntime_default()().wrap(function _callee2$(_context2) {
while (1) switch (_context2.prev = _context2.next) {
case 0:
_context2.next = 2;
fetchIndex.current += 1;
currentFetch = fetchIndex.current;
_context2.next = 4;
return (0,fetch/* default */.ZP)("/api/schools/search.json", {
method: "get",
params: {
page: 1,
limit: 9999
keyword: name
}
});
case 2:
case 4:
res = _context2.sent;
if (res.status === 0) {
if (res.status === 0 && fetchIndex.current === currentFetch) {
setSchools((res === null || res === void 0 ? void 0 : res.schools) || []);
setFetchLoading(false);
}
case 4:
case 6:
case "end":
return _context2.stop();
}
}, _callee2);
}));
return function getSchools() {
return _ref4.apply(this, arguments);
};
}();
})), time);
};
var getDepartments = /*#__PURE__*/function () {
var _ref5 = asyncToGenerator_default()( /*#__PURE__*/regeneratorRuntime_default()().mark(function _callee3(id) {
var res;
@ -340,7 +349,15 @@ var Page = function Page(_ref) {
}],
children: /*#__PURE__*/(0,jsx_runtime.jsx)(es_select/* default */.Z, {
showSearch: true,
optionFilterProp: "children",
filterOption: false,
onSearch: function onSearch(v) {
getSchools(v);
},
loading: fetchLoading,
size: "large",
style: {
width: 344
},
children: schools.map(function (item) {
return /*#__PURE__*/(0,jsx_runtime.jsx)(es_select/* default.Option */.Z.Option, {
value: item.id,

Loading…
Cancel
Save