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.
1600 lines
65 KiB
1600 lines
65 KiB
"use strict";
|
|
(self["webpackChunk"] = self["webpackChunk"] || []).push([[92045],{
|
|
|
|
/***/ 10099:
|
|
/*!***********************************************************************!*\
|
|
!*** ./src/pages/Engineering/Lists/TeacherList/index.tsx + 3 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 */ TeacherList; }
|
|
});
|
|
|
|
// EXTERNAL MODULE: ./node_modules/_@babel_runtime@7.23.2@@babel/runtime/helpers/regeneratorRuntime.js
|
|
var regeneratorRuntime = __webpack_require__(10574);
|
|
var regeneratorRuntime_default = /*#__PURE__*/__webpack_require__.n(regeneratorRuntime);
|
|
// EXTERNAL MODULE: ./node_modules/_@babel_runtime@7.23.2@@babel/runtime/helpers/objectSpread2.js
|
|
var objectSpread2 = __webpack_require__(26801);
|
|
var objectSpread2_default = /*#__PURE__*/__webpack_require__.n(objectSpread2);
|
|
// EXTERNAL MODULE: ./node_modules/_@babel_runtime@7.23.2@@babel/runtime/helpers/asyncToGenerator.js
|
|
var asyncToGenerator = __webpack_require__(39343);
|
|
var asyncToGenerator_default = /*#__PURE__*/__webpack_require__.n(asyncToGenerator);
|
|
// EXTERNAL MODULE: ./node_modules/_@babel_runtime@7.23.2@@babel/runtime/helpers/slicedToArray.js
|
|
var slicedToArray = __webpack_require__(11006);
|
|
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/pages/Engineering/Lists/TeacherList/index.less?modules
|
|
// extracted by mini-css-extract-plugin
|
|
/* harmony default export */ var TeacherListmodules = ({"flex_box_center":"flex_box_center____IKzc","flex_space_between":"flex_space_between___pQ6WG","flex_box_vertical_center":"flex_box_vertical_center___FwFRn","flex_box_center_end":"flex_box_center_end___ALgdQ","flex_box_column":"flex_box_column___Nkmwa","wrap":"wrap___myvWj","title":"title___WWH7y","tabWarp":"tabWarp___nJkgr","control":"control___ZBPSX","label":"label___Yi2Z_","customTable":"customTable___MusIf","detail":"detail___NJGhU","button":"button___giltN","form":"form___nYZVP","customModal":"customModal___w75LI"});
|
|
// EXTERNAL MODULE: ./src/.umi-production/exports.ts + 8 modules
|
|
var _umi_production_exports = __webpack_require__(7181);
|
|
// EXTERNAL MODULE: ./src/pages/Engineering/components/UploadExcel/index.tsx + 1 modules
|
|
var UploadExcel = __webpack_require__(26352);
|
|
// 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/space/index.js + 3 modules
|
|
var space = __webpack_require__(81327);
|
|
// EXTERNAL MODULE: ./node_modules/_antd@5.9.0@antd/es/input/index.js + 5 modules
|
|
var input = __webpack_require__(1056);
|
|
// EXTERNAL MODULE: ./node_modules/_antd@5.9.0@antd/es/table/index.js + 85 modules
|
|
var table = __webpack_require__(72315);
|
|
// EXTERNAL MODULE: ./src/utils/fetch.ts
|
|
var fetch = __webpack_require__(4781);
|
|
// EXTERNAL MODULE: ./node_modules/_lodash@4.17.21@lodash/lodash.js
|
|
var lodash = __webpack_require__(89392);
|
|
;// CONCATENATED MODULE: ./src/pages/Engineering/components/GroupModal/index.less?modules
|
|
// extracted by mini-css-extract-plugin
|
|
/* harmony default export */ var GroupModalmodules = ({"flex_box_center":"flex_box_center___gy1gd","flex_space_between":"flex_space_between___TuPnr","flex_box_vertical_center":"flex_box_vertical_center___pMddE","flex_box_center_end":"flex_box_center_end___lk2LC","flex_box_column":"flex_box_column___ykUVb","customModal":"customModal___PPyWA","customTable":"customTable___eZMV0"});
|
|
// EXTERNAL MODULE: ./node_modules/_react@17.0.2@react/jsx-runtime.js
|
|
var jsx_runtime = __webpack_require__(37712);
|
|
;// CONCATENATED MODULE: ./src/pages/Engineering/components/GroupModal/index.tsx
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
var GroupModal = function GroupModal(_ref) {
|
|
var visible = _ref.visible,
|
|
onOk = _ref.onOk,
|
|
onCancel = _ref.onCancel,
|
|
_ref$title = _ref.title,
|
|
title = _ref$title === void 0 ? '选择认证团队教师' : _ref$title,
|
|
schoolId = _ref.schoolId;
|
|
var initParams = {
|
|
page: 1,
|
|
per_page: 20,
|
|
total: 0,
|
|
name: '',
|
|
save_name: '',
|
|
tel: '',
|
|
save_tel: ''
|
|
};
|
|
var _useState = (0,_react_17_0_2_react.useState)(objectSpread2_default()({}, initParams)),
|
|
_useState2 = slicedToArray_default()(_useState, 2),
|
|
params = _useState2[0],
|
|
setParams = _useState2[1];
|
|
var _useState3 = (0,_react_17_0_2_react.useState)([]),
|
|
_useState4 = slicedToArray_default()(_useState3, 2),
|
|
ids = _useState4[0],
|
|
setIds = _useState4[1];
|
|
var _useState5 = (0,_react_17_0_2_react.useState)([]),
|
|
_useState6 = slicedToArray_default()(_useState5, 2),
|
|
list = _useState6[0],
|
|
setList = _useState6[1];
|
|
var _useState7 = (0,_react_17_0_2_react.useState)(false),
|
|
_useState8 = slicedToArray_default()(_useState7, 2),
|
|
loading = _useState8[0],
|
|
setLoading = _useState8[1];
|
|
var _useState9 = (0,_react_17_0_2_react.useState)(false),
|
|
_useState10 = slicedToArray_default()(_useState9, 2),
|
|
tableLoading = _useState10[0],
|
|
setTableLoading = _useState10[1];
|
|
(0,_react_17_0_2_react.useEffect)(function () {
|
|
if (visible) {
|
|
getData(initParams);
|
|
} else {
|
|
setIds([]);
|
|
setLoading(false);
|
|
setParams(initParams);
|
|
}
|
|
}, [visible]);
|
|
var getData = /*#__PURE__*/function () {
|
|
var _ref2 = asyncToGenerator_default()( /*#__PURE__*/regeneratorRuntime_default()().mark(function _callee(record) {
|
|
var sendData, res;
|
|
return regeneratorRuntime_default()().wrap(function _callee$(_context) {
|
|
while (1) switch (_context.prev = _context.next) {
|
|
case 0:
|
|
sendData = (0,lodash.cloneDeep)(record);
|
|
sendData.school_id = schoolId;
|
|
setTableLoading(true);
|
|
_context.next = 5;
|
|
return (0,fetch/* default */.ZP)("/api/ec_years/1/ec_teachers/search_users.json", {
|
|
method: "get",
|
|
params: sendData
|
|
});
|
|
case 5:
|
|
res = _context.sent;
|
|
if (res !== null && res !== void 0 && res.data) {
|
|
params.total = res === null || res === void 0 ? void 0 : res.count;
|
|
params.save_name = params.save_name;
|
|
params.save_tel = params.tel;
|
|
setParams(objectSpread2_default()({}, params));
|
|
setList((res === null || res === void 0 ? void 0 : res.data) || []);
|
|
}
|
|
setTableLoading(false);
|
|
case 8:
|
|
case "end":
|
|
return _context.stop();
|
|
}
|
|
}, _callee);
|
|
}));
|
|
return function getData(_x) {
|
|
return _ref2.apply(this, arguments);
|
|
};
|
|
}();
|
|
var handleOk = function handleOk() {
|
|
setLoading(true);
|
|
onOk(ids, function () {
|
|
setLoading(false);
|
|
});
|
|
};
|
|
var handleCancel = function handleCancel() {
|
|
onCancel();
|
|
};
|
|
var rowSelection = {
|
|
selectedRowKeys: ids,
|
|
columnWidth: 40,
|
|
onChange: function onChange(k) {
|
|
return setIds(k);
|
|
}
|
|
};
|
|
var handleChangePage = function handleChangePage(param, per_page, sorter) {
|
|
params.page = param === null || param === void 0 ? void 0 : param.current;
|
|
params.per_page = param === null || param === void 0 ? void 0 : param.pageSize;
|
|
setParams(objectSpread2_default()({}, params));
|
|
getData(params);
|
|
};
|
|
var columns = [{
|
|
title: '姓名',
|
|
dataIndex: 'name'
|
|
}, {
|
|
title: '手机号码',
|
|
dataIndex: 'phone',
|
|
render: function render(v) {
|
|
if (!v) {
|
|
return '';
|
|
}
|
|
var reg = /^(\d{3})\d{4}(\d{4})$/;
|
|
var tel = v === null || v === void 0 ? void 0 : v.replace(reg, "$1****$2");
|
|
return /*#__PURE__*/(0,jsx_runtime.jsx)("span", {
|
|
children: tel
|
|
});
|
|
}
|
|
}, {
|
|
title: '职称',
|
|
dataIndex: 'pro'
|
|
}, {
|
|
title: '职务',
|
|
dataIndex: 'identity'
|
|
}, {
|
|
title: '所属学院',
|
|
dataIndex: 'department'
|
|
}];
|
|
return /*#__PURE__*/(0,jsx_runtime.jsxs)(modal/* default */.Z, {
|
|
title: title,
|
|
open: visible,
|
|
onOk: handleOk,
|
|
centered: true,
|
|
wrapClassName: GroupModalmodules.customModal,
|
|
onCancel: handleCancel,
|
|
confirmLoading: loading,
|
|
width: "800px",
|
|
okText: "\u4FDD\u5B58",
|
|
cancelText: "\u53D6\u6D88",
|
|
children: [/*#__PURE__*/(0,jsx_runtime.jsx)(space/* default */.Z, {
|
|
size: 20,
|
|
children: /*#__PURE__*/(0,jsx_runtime.jsx)(input/* default */.Z.Search, {
|
|
style: {
|
|
width: 343,
|
|
height: 38
|
|
},
|
|
placeholder: "\u8BF7\u8F93\u5165\u59D3\u540D",
|
|
value: params === null || params === void 0 ? void 0 : params.save_name,
|
|
onChange: function onChange(e) {
|
|
params.save_name = e.target.value;
|
|
setParams(objectSpread2_default()({}, params));
|
|
},
|
|
onSearch: function onSearch() {
|
|
params.page = 1;
|
|
params.name = params.save_name;
|
|
setParams(objectSpread2_default()({}, params));
|
|
getData(params);
|
|
}
|
|
})
|
|
}), /*#__PURE__*/(0,jsx_runtime.jsx)("div", {
|
|
style: {
|
|
color: '#FA6400'
|
|
},
|
|
className: "mt10 mb10 pr20",
|
|
children: "!\u9700\u4ECE\u5934\u6B4C\u5E73\u53F0\u9009\u62E9\u5DF2\u6CE8\u518C\u7684\u672C\u5B66\u6821\u6559\u5E08\u3002\u672A\u51FA\u73B0\u5728\u5217\u8868\u7684\u6559\u5E08\u8BF7\u5148\u5728\u5934\u6B4C\u5E73\u53F0\u6CE8\u518C\u8D26\u53F7\uFF0C\u7136\u540E\u5728\u8D26\u53F7\u7BA1\u7406-\u57FA\u672C\u4FE1\u606F\u9875\u9762\uFF0C\u6B63\u786E\u586B\u5199\u5B66\u6821/\u5355\u4F4D\u4FE1\u606F\u3002"
|
|
}), /*#__PURE__*/(0,jsx_runtime.jsx)(table/* default */.Z, {
|
|
rowSelection: rowSelection,
|
|
dataSource: list,
|
|
bordered: false,
|
|
rowKey: "id",
|
|
scroll: {
|
|
y: 400
|
|
},
|
|
columns: columns,
|
|
loading: tableLoading,
|
|
className: GroupModalmodules.customTable,
|
|
onChange: handleChangePage,
|
|
pagination: {
|
|
pageSize: params.per_page,
|
|
total: params.total,
|
|
current: params.page,
|
|
showQuickJumper: true,
|
|
hideOnSinglePage: true,
|
|
size: "default",
|
|
position: ["bottomCenter"],
|
|
showTotal: function showTotal(total) {
|
|
return /*#__PURE__*/(0,jsx_runtime.jsxs)("span", {
|
|
className: "mr10",
|
|
children: ["\u5171", /*#__PURE__*/(0,jsx_runtime.jsx)("span", {
|
|
className: "c-orange",
|
|
children: total
|
|
}), "\u6761\u6570\u636E"]
|
|
});
|
|
}
|
|
}
|
|
})]
|
|
});
|
|
};
|
|
/* harmony default export */ var components_GroupModal = (GroupModal);
|
|
// EXTERNAL MODULE: ./src/pages/Engineering/util.tsx
|
|
var util = __webpack_require__(66349);
|
|
// 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/tooltip/index.js + 3 modules
|
|
var tooltip = __webpack_require__(6848);
|
|
// 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/button/index.js
|
|
var es_button = __webpack_require__(3113);
|
|
// EXTERNAL MODULE: ./node_modules/_antd@5.9.0@antd/es/tabs/index.js + 24 modules
|
|
var tabs = __webpack_require__(99313);
|
|
// EXTERNAL MODULE: ./node_modules/_antd@5.9.0@antd/es/select/index.js
|
|
var es_select = __webpack_require__(57809);
|
|
// EXTERNAL MODULE: ./src/utils/util.tsx
|
|
var utils_util = __webpack_require__(87885);
|
|
// EXTERNAL MODULE: ./src/utils/env.ts + 1 modules
|
|
var env = __webpack_require__(26078);
|
|
// EXTERNAL MODULE: ./src/pages/Engineering/components/Evaluate/index.ts + 4 modules
|
|
var Evaluate = __webpack_require__(36815);
|
|
;// CONCATENATED MODULE: ./src/pages/Engineering/Lists/TeacherList/index.tsx
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
var Page = function Page(_ref) {
|
|
var _user$userInfo2, _user$userInfo10;
|
|
var user = _ref.user;
|
|
var initParams = {
|
|
page: 1,
|
|
per_page: 20,
|
|
total: 0,
|
|
search: '',
|
|
tab: '1',
|
|
save_search: '',
|
|
ec_major_school_id: null,
|
|
ec_year_id: null,
|
|
category: 'name',
|
|
sort_by: null,
|
|
direction: null
|
|
};
|
|
var _useState = (0,_react_17_0_2_react.useState)(initParams),
|
|
_useState2 = slicedToArray_default()(_useState, 2),
|
|
params = _useState2[0],
|
|
setParams = _useState2[1];
|
|
var _useState3 = (0,_react_17_0_2_react.useState)(true),
|
|
_useState4 = slicedToArray_default()(_useState3, 2),
|
|
loading = _useState4[0],
|
|
setLoading = _useState4[1];
|
|
var _useState5 = (0,_react_17_0_2_react.useState)(false),
|
|
_useState6 = slicedToArray_default()(_useState5, 2),
|
|
disabled = _useState6[0],
|
|
setDisabled = _useState6[1];
|
|
var _useState7 = (0,_react_17_0_2_react.useState)(false),
|
|
_useState8 = slicedToArray_default()(_useState7, 2),
|
|
btnLoading = _useState8[0],
|
|
setBtnLoading = _useState8[1];
|
|
var _useState9 = (0,_react_17_0_2_react.useState)(false),
|
|
_useState10 = slicedToArray_default()(_useState9, 2),
|
|
btnAddLoading = _useState10[0],
|
|
setBtnAddLoading = _useState10[1];
|
|
var _useState11 = (0,_react_17_0_2_react.useState)(false),
|
|
_useState12 = slicedToArray_default()(_useState11, 2),
|
|
visible = _useState12[0],
|
|
setVisible = _useState12[1];
|
|
var _useState13 = (0,_react_17_0_2_react.useState)(false),
|
|
_useState14 = slicedToArray_default()(_useState13, 2),
|
|
groupModalVisible = _useState14[0],
|
|
setGroupModalVisible = _useState14[1];
|
|
var _useState15 = (0,_react_17_0_2_react.useState)(false),
|
|
_useState16 = slicedToArray_default()(_useState15, 2),
|
|
edit = _useState16[0],
|
|
setEdit = _useState16[1];
|
|
var _useState17 = (0,_react_17_0_2_react.useState)([]),
|
|
_useState18 = slicedToArray_default()(_useState17, 2),
|
|
selectIds = _useState18[0],
|
|
setSelectIds = _useState18[1];
|
|
var _useState19 = (0,_react_17_0_2_react.useState)([]),
|
|
_useState20 = slicedToArray_default()(_useState19, 2),
|
|
majorData = _useState20[0],
|
|
setMajorData = _useState20[1];
|
|
var _useState21 = (0,_react_17_0_2_react.useState)([]),
|
|
_useState22 = slicedToArray_default()(_useState21, 2),
|
|
yearData = _useState22[0],
|
|
setYearData = _useState22[1];
|
|
var _useState23 = (0,_react_17_0_2_react.useState)([]),
|
|
_useState24 = slicedToArray_default()(_useState23, 2),
|
|
tableData = _useState24[0],
|
|
setTableData = _useState24[1];
|
|
var _Form$useForm = es_form/* default */.Z.useForm(),
|
|
_Form$useForm2 = slicedToArray_default()(_Form$useForm, 1),
|
|
form = _Form$useForm2[0];
|
|
var formSign = (0,_react_17_0_2_react.useRef)(null);
|
|
(0,_react_17_0_2_react.useEffect)(function () {
|
|
var _user$userInfo;
|
|
if (user !== null && user !== void 0 && (_user$userInfo = user.userInfo) !== null && _user$userInfo !== void 0 && _user$userInfo.school_id) {
|
|
getMajorData();
|
|
}
|
|
}, [user === null || user === void 0 || (_user$userInfo2 = user.userInfo) === null || _user$userInfo2 === void 0 ? void 0 : _user$userInfo2.school_id]);
|
|
var getData = /*#__PURE__*/function () {
|
|
var _ref2 = asyncToGenerator_default()( /*#__PURE__*/regeneratorRuntime_default()().mark(function _callee(record) {
|
|
var _user$userInfo3;
|
|
var sendData, _user$userInfo4, res;
|
|
return regeneratorRuntime_default()().wrap(function _callee$(_context) {
|
|
while (1) switch (_context.prev = _context.next) {
|
|
case 0:
|
|
sendData = (0,lodash.cloneDeep)(record);
|
|
util/* localSelect */.U.setItem(user === null || user === void 0 || (_user$userInfo3 = user.userInfo) === null || _user$userInfo3 === void 0 ? void 0 : _user$userInfo3.login, [sendData === null || sendData === void 0 ? void 0 : sendData.ec_major_school_id, sendData === null || sendData === void 0 ? void 0 : sendData.ec_year_id]);
|
|
sendData[record === null || record === void 0 ? void 0 : record.category] = record === null || record === void 0 ? void 0 : record.search;
|
|
if ((record === null || record === void 0 ? void 0 : record.tab) === '2') {
|
|
sendData.school_id = user === null || user === void 0 || (_user$userInfo4 = user.userInfo) === null || _user$userInfo4 === void 0 ? void 0 : _user$userInfo4.school_id;
|
|
}
|
|
setLoading(true);
|
|
_context.next = 7;
|
|
return (0,fetch/* default */.ZP)("/api/ec_years/".concat(params.ec_year_id, "/").concat((record === null || record === void 0 ? void 0 : record.tab) === '1' ? 'ec_course_teachers' : 'ec_teachers', ".json"), {
|
|
method: "get",
|
|
params: sendData
|
|
});
|
|
case 7:
|
|
res = _context.sent;
|
|
if (res !== null && res !== void 0 && res.data) {
|
|
setTableData((res === null || res === void 0 ? void 0 : res.data) || []);
|
|
params.total = res === null || res === void 0 ? void 0 : res.count;
|
|
params.save_search = params.search;
|
|
setParams(objectSpread2_default()({}, params));
|
|
}
|
|
setLoading(false);
|
|
case 10:
|
|
case "end":
|
|
return _context.stop();
|
|
}
|
|
}, _callee);
|
|
}));
|
|
return function getData(_x) {
|
|
return _ref2.apply(this, arguments);
|
|
};
|
|
}();
|
|
var exportExcel = function exportExcel() {
|
|
var sendData = (0,lodash.cloneDeep)(params);
|
|
sendData[params === null || params === void 0 ? void 0 : params.category] = params === null || params === void 0 ? void 0 : params.search;
|
|
if ((params === null || params === void 0 ? void 0 : params.tab) === '2') {
|
|
var _user$userInfo5;
|
|
sendData.school_id = user === null || user === void 0 || (_user$userInfo5 = user.userInfo) === null || _user$userInfo5 === void 0 ? void 0 : _user$userInfo5.school_id;
|
|
}
|
|
(0,utils_util/* downLoadFile */.FH)('', (0,utils_util/* setUrlQuery */.NY)({
|
|
url: env/* default */.Z.API_SERVER + "/api/ec_years/".concat(params.ec_year_id, "/").concat((params === null || params === void 0 ? void 0 : params.tab) === '1' ? 'ec_course_teachers' : 'ec_teachers', ".xlsx"),
|
|
query: sendData
|
|
}));
|
|
};
|
|
var getMajorData = /*#__PURE__*/function () {
|
|
var _ref3 = asyncToGenerator_default()( /*#__PURE__*/regeneratorRuntime_default()().mark(function _callee2() {
|
|
var _user$userInfo6, _res1$data, _user$userInfo7, _res1$data2, _res2$data;
|
|
var res1, item, ec_major_school_id, res2;
|
|
return regeneratorRuntime_default()().wrap(function _callee2$(_context2) {
|
|
while (1) switch (_context2.prev = _context2.next) {
|
|
case 0:
|
|
_context2.next = 2;
|
|
return (0,fetch/* default */.ZP)("/api/schools/".concat(user === null || user === void 0 || (_user$userInfo6 = user.userInfo) === null || _user$userInfo6 === void 0 ? void 0 : _user$userInfo6.school_id, "/ec_majors/get_major_list.json"), {
|
|
method: "get"
|
|
});
|
|
case 2:
|
|
res1 = _context2.sent;
|
|
if (res1 !== null && res1 !== void 0 && (_res1$data = res1.data) !== null && _res1$data !== void 0 && (_res1$data = _res1$data[0]) !== null && _res1$data !== void 0 && _res1$data.ec_major_school_id) {
|
|
_context2.next = 7;
|
|
break;
|
|
}
|
|
setLoading(false);
|
|
setDisabled(true);
|
|
return _context2.abrupt("return");
|
|
case 7:
|
|
item = util/* localSelect */.U.getItem(user === null || user === void 0 || (_user$userInfo7 = user.userInfo) === null || _user$userInfo7 === void 0 ? void 0 : _user$userInfo7.login);
|
|
ec_major_school_id = item[0] || (res1 === null || res1 === void 0 || (_res1$data2 = res1.data) === null || _res1$data2 === void 0 || (_res1$data2 = _res1$data2[0]) === null || _res1$data2 === void 0 ? void 0 : _res1$data2.ec_major_school_id);
|
|
_context2.next = 11;
|
|
return (0,fetch/* default */.ZP)("/api/ec_major_schools/".concat(ec_major_school_id, "/ec_years/get_year_list.json"), {
|
|
method: "get"
|
|
});
|
|
case 11:
|
|
res2 = _context2.sent;
|
|
params.ec_major_school_id = ec_major_school_id;
|
|
params.ec_year_id = item[1] || (res2 === null || res2 === void 0 || (_res2$data = res2.data) === null || _res2$data === void 0 || (_res2$data = _res2$data[0]) === null || _res2$data === void 0 ? void 0 : _res2$data.ec_year_id);
|
|
setMajorData((res1 === null || res1 === void 0 ? void 0 : res1.data) || []);
|
|
setYearData((res2 === null || res2 === void 0 ? void 0 : res2.data) || []);
|
|
setParams(params);
|
|
getData(params);
|
|
case 18:
|
|
case "end":
|
|
return _context2.stop();
|
|
}
|
|
}, _callee2);
|
|
}));
|
|
return function getMajorData() {
|
|
return _ref3.apply(this, arguments);
|
|
};
|
|
}();
|
|
var getYearData = /*#__PURE__*/function () {
|
|
var _ref4 = asyncToGenerator_default()( /*#__PURE__*/regeneratorRuntime_default()().mark(function _callee3(id) {
|
|
var _res2$data2;
|
|
var res2;
|
|
return regeneratorRuntime_default()().wrap(function _callee3$(_context3) {
|
|
while (1) switch (_context3.prev = _context3.next) {
|
|
case 0:
|
|
_context3.next = 2;
|
|
return (0,fetch/* default */.ZP)("/api/ec_major_schools/".concat(id, "/ec_years/get_year_list.json"), {
|
|
method: "get"
|
|
});
|
|
case 2:
|
|
res2 = _context3.sent;
|
|
params.ec_major_school_id = id;
|
|
params.ec_year_id = res2 === null || res2 === void 0 || (_res2$data2 = res2.data) === null || _res2$data2 === void 0 || (_res2$data2 = _res2$data2[0]) === null || _res2$data2 === void 0 ? void 0 : _res2$data2.ec_year_id;
|
|
setYearData((res2 === null || res2 === void 0 ? void 0 : res2.data) || []);
|
|
setParams(params);
|
|
getData(params);
|
|
case 8:
|
|
case "end":
|
|
return _context3.stop();
|
|
}
|
|
}, _callee3);
|
|
}));
|
|
return function getYearData(_x2) {
|
|
return _ref4.apply(this, arguments);
|
|
};
|
|
}();
|
|
var handleSelect = function handleSelect(v, type) {
|
|
params.page = 1;
|
|
params[type] = v;
|
|
if (type === 'category') {
|
|
params.search = '';
|
|
params.save_search = '';
|
|
setParams(objectSpread2_default()({}, params));
|
|
return;
|
|
}
|
|
if (type === 'ec_major_school_id') {
|
|
getYearData(v);
|
|
return;
|
|
}
|
|
if (type === 'ec_year_id') {
|
|
setParams(objectSpread2_default()({}, params));
|
|
getData(params);
|
|
}
|
|
};
|
|
var handleSearch = function handleSearch(v) {
|
|
params.page = 1;
|
|
params.save_search = v;
|
|
setParams(objectSpread2_default()({}, params));
|
|
// getData(params)
|
|
};
|
|
|
|
var handleDelete = function handleDelete(ids) {
|
|
if (ids.length === 0) {
|
|
message/* default */.ZP.warning('请选择要移除的教师');
|
|
return;
|
|
}
|
|
modal/* default */.Z.confirm({
|
|
centered: true,
|
|
okText: '确定',
|
|
cancelText: '取消',
|
|
title: "提示",
|
|
content: "确认要删除吗?",
|
|
onOk: function () {
|
|
var _onOk = asyncToGenerator_default()( /*#__PURE__*/regeneratorRuntime_default()().mark(function _callee4() {
|
|
var res, page;
|
|
return regeneratorRuntime_default()().wrap(function _callee4$(_context4) {
|
|
while (1) switch (_context4.prev = _context4.next) {
|
|
case 0:
|
|
_context4.next = 2;
|
|
return (0,fetch/* default */.ZP)("/api/ec_years/".concat(params.ec_year_id, "/").concat((params === null || params === void 0 ? void 0 : params.tab) === '1' ? 'ec_course_teachers' : 'ec_teachers', ".json"), {
|
|
method: "delete",
|
|
body: {
|
|
ids: ids
|
|
}
|
|
});
|
|
case 2:
|
|
res = _context4.sent;
|
|
if ((res === null || res === void 0 ? void 0 : res.status) === 0) {
|
|
page = ids.length === tableData.length && params.page > 1 ? params.page - 1 : params.page;
|
|
params.page = page;
|
|
setSelectIds([]);
|
|
setParams(objectSpread2_default()({}, params));
|
|
getData(params);
|
|
}
|
|
case 4:
|
|
case "end":
|
|
return _context4.stop();
|
|
}
|
|
}, _callee4);
|
|
}));
|
|
function onOk() {
|
|
return _onOk.apply(this, arguments);
|
|
}
|
|
return onOk;
|
|
}()
|
|
});
|
|
};
|
|
var handleChangePage = function handleChangePage(param, per_page, sorter) {
|
|
params.page = param === null || param === void 0 ? void 0 : param.current;
|
|
params.per_page = param === null || param === void 0 ? void 0 : param.pageSize;
|
|
if (sorter !== null && sorter !== void 0 && sorter.order) {
|
|
params.sort_by = sorter === null || sorter === void 0 ? void 0 : sorter.field;
|
|
params.direction = (sorter === null || sorter === void 0 ? void 0 : sorter.order) === 'ascend' ? 'asc' : 'desc';
|
|
} else {
|
|
params.sort_by = null;
|
|
params.direction = null;
|
|
}
|
|
setParams(objectSpread2_default()({}, params));
|
|
if (isDisabled) return;
|
|
getData(params);
|
|
};
|
|
var rowSelection = {
|
|
selectedRowKeys: selectIds,
|
|
columnWidth: 54,
|
|
onChange: function onChange(k) {
|
|
return setSelectIds(k);
|
|
},
|
|
getCheckboxProps: function getCheckboxProps(r) {
|
|
return {
|
|
disabled: r.is_manager
|
|
};
|
|
}
|
|
};
|
|
var columns = [{
|
|
title: '序号',
|
|
dataIndex: 'index',
|
|
width: 90,
|
|
render: function render(text, record, index) {
|
|
return params.per_page * (params.page - 1) + index + 1;
|
|
}
|
|
}, {
|
|
title: '姓名',
|
|
dataIndex: 'name',
|
|
// sorter: true,
|
|
ellipsis: true,
|
|
// width: 120,
|
|
sortOrder: params.sort_by === "name" ? params.direction === "desc" ? "descend" : "ascend" : false,
|
|
render: function render(text, record) {
|
|
return text ? /*#__PURE__*/(0,jsx_runtime.jsxs)("span", {
|
|
children: [record.is_manager && /*#__PURE__*/(0,jsx_runtime.jsx)(tooltip/* default */.Z, {
|
|
title: "\u7CFB\u7EDF\u7BA1\u7406\u5458",
|
|
children: /*#__PURE__*/(0,jsx_runtime.jsx)("i", {
|
|
className: "iconfont icon-ren mr5"
|
|
})
|
|
}), text]
|
|
}) : '--';
|
|
}
|
|
}, {
|
|
title: '手机号码',
|
|
dataIndex: (params === null || params === void 0 ? void 0 : params.tab) === '1' ? 'tel' : 'phone',
|
|
ellipsis: true,
|
|
sorter: true,
|
|
// width: 120,
|
|
sortOrder: params.sort_by === ((params === null || params === void 0 ? void 0 : params.tab) === '1' ? 'tel' : 'phone') ? params.direction === "desc" ? "descend" : "ascend" : false,
|
|
render: function render(v) {
|
|
return v || '--';
|
|
}
|
|
}, {
|
|
title: '邮箱',
|
|
dataIndex: (params === null || params === void 0 ? void 0 : params.tab) === '1' ? 'email' : 'mail',
|
|
ellipsis: true,
|
|
sorter: true,
|
|
// width: 200,
|
|
sortOrder: params.sort_by === ((params === null || params === void 0 ? void 0 : params.tab) === '1' ? 'email' : 'mail') ? params.direction === "desc" ? "descend" : "ascend" : false,
|
|
render: function render(v) {
|
|
return v || '--';
|
|
}
|
|
}, {
|
|
title: '职称',
|
|
dataIndex: (params === null || params === void 0 ? void 0 : params.tab) === '1' ? 'pro' : 'technical_title',
|
|
ellipsis: true,
|
|
// sorter: true,
|
|
sortOrder: params.sort_by === ((params === null || params === void 0 ? void 0 : params.tab) === '1' ? 'pro' : 'technical_title') ? params.direction === "desc" ? "descend" : "ascend" : false,
|
|
render: function render(v) {
|
|
return v || '';
|
|
}
|
|
}, {
|
|
title: '职务',
|
|
dataIndex: (params === null || params === void 0 ? void 0 : params.tab) === '1' ? 'job' : 'identity',
|
|
ellipsis: true,
|
|
// sorter: true,
|
|
sortOrder: params.sort_by === ((params === null || params === void 0 ? void 0 : params.tab) === '1' ? 'job' : 'identity') ? params.direction === "desc" ? "descend" : "ascend" : false,
|
|
render: function render(v) {
|
|
return v || '';
|
|
}
|
|
}, {
|
|
title: '所属学院/系',
|
|
ellipsis: true,
|
|
dataIndex: 'department',
|
|
render: function render(v) {
|
|
return v || '';
|
|
}
|
|
}, {
|
|
title: '操作',
|
|
dataIndex: 'action',
|
|
align: 'center',
|
|
width: 90,
|
|
render: function render(v, r) {
|
|
return /*#__PURE__*/(0,jsx_runtime.jsxs)("span", {
|
|
children: [params.tab === '1' ? /*#__PURE__*/(0,jsx_runtime.jsx)("i", {
|
|
onClick: function onClick() {
|
|
return handleEdit(r.id);
|
|
},
|
|
className: "iconfont icon-bianji7 c-gcrz-primary current"
|
|
}) : /*#__PURE__*/(0,jsx_runtime.jsx)("i", {
|
|
onClick: function onClick() {
|
|
return handleDetail(r.id);
|
|
},
|
|
className: "iconfont icon-chakansvg c-gcrz-primary current"
|
|
}), !r.is_manager && /*#__PURE__*/(0,jsx_runtime.jsx)("i", {
|
|
onClick: function onClick() {
|
|
return handleDelete([r.id]);
|
|
},
|
|
className: "iconfont icon-piliangshanchubeifen c-gcrz-primary current ml10"
|
|
})]
|
|
});
|
|
}
|
|
}];
|
|
var handleGroup = /*#__PURE__*/function () {
|
|
var _ref5 = asyncToGenerator_default()( /*#__PURE__*/regeneratorRuntime_default()().mark(function _callee5(list, cb) {
|
|
var _user$userInfo8;
|
|
var res;
|
|
return regeneratorRuntime_default()().wrap(function _callee5$(_context5) {
|
|
while (1) switch (_context5.prev = _context5.next) {
|
|
case 0:
|
|
if (!(list.length === 0)) {
|
|
_context5.next = 4;
|
|
break;
|
|
}
|
|
message/* default */.ZP.warning('请选择一条数据');
|
|
cb();
|
|
return _context5.abrupt("return");
|
|
case 4:
|
|
_context5.next = 6;
|
|
return (0,fetch/* default */.ZP)("/api/ec_years/".concat(params.ec_year_id, "/ec_teachers.json"), {
|
|
method: "post",
|
|
body: {
|
|
ids: list,
|
|
school_id: user === null || user === void 0 || (_user$userInfo8 = user.userInfo) === null || _user$userInfo8 === void 0 ? void 0 : _user$userInfo8.school_id
|
|
}
|
|
});
|
|
case 6:
|
|
res = _context5.sent;
|
|
if ((res === null || res === void 0 ? void 0 : res.status) === 0) {
|
|
getData(params);
|
|
setGroupModalVisible(false);
|
|
}
|
|
cb();
|
|
case 9:
|
|
case "end":
|
|
return _context5.stop();
|
|
}
|
|
}, _callee5);
|
|
}));
|
|
return function handleGroup(_x3, _x4) {
|
|
return _ref5.apply(this, arguments);
|
|
};
|
|
}();
|
|
var handleOk = /*#__PURE__*/function () {
|
|
var _ref6 = asyncToGenerator_default()( /*#__PURE__*/regeneratorRuntime_default()().mark(function _callee6(list, cb) {
|
|
var _list$;
|
|
var formData, res;
|
|
return regeneratorRuntime_default()().wrap(function _callee6$(_context6) {
|
|
while (1) switch (_context6.prev = _context6.next) {
|
|
case 0:
|
|
if (!(list.length === 0)) {
|
|
_context6.next = 4;
|
|
break;
|
|
}
|
|
message/* default */.ZP.warning('请上传文件');
|
|
cb();
|
|
return _context6.abrupt("return");
|
|
case 4:
|
|
formData = new FormData();
|
|
formData.append('file', (_list$ = list[0]) === null || _list$ === void 0 ? void 0 : _list$.file);
|
|
_context6.next = 8;
|
|
return (0,fetch/* default */.ZP)("/api/ec_years/".concat(params.ec_year_id, "/ec_course_teachers/import_course_teachers.json"), {
|
|
method: "post",
|
|
body: formData
|
|
}, true);
|
|
case 8:
|
|
res = _context6.sent;
|
|
if ((res === null || res === void 0 ? void 0 : res.status) === 0) {
|
|
getData(params);
|
|
setVisible(false);
|
|
}
|
|
cb();
|
|
case 11:
|
|
case "end":
|
|
return _context6.stop();
|
|
}
|
|
}, _callee6);
|
|
}));
|
|
return function handleOk(_x5, _x6) {
|
|
return _ref6.apply(this, arguments);
|
|
};
|
|
}();
|
|
var handleTabsChange = function handleTabsChange(activeKey) {
|
|
params.page = 1;
|
|
params.tab = activeKey;
|
|
params.sort_by = null;
|
|
params.direction = null;
|
|
params.search = '';
|
|
params.save_search = '';
|
|
setParams(objectSpread2_default()({}, params));
|
|
if (isDisabled) return;
|
|
getData(params);
|
|
};
|
|
var handleDetail = /*#__PURE__*/function () {
|
|
var _ref7 = asyncToGenerator_default()( /*#__PURE__*/regeneratorRuntime_default()().mark(function _callee7(id) {
|
|
var _user$userInfo9;
|
|
var res, _res$data, _res$data2, _res$data3, _res$data4, _res$data5, _res$data6, _res$data7;
|
|
return regeneratorRuntime_default()().wrap(function _callee7$(_context7) {
|
|
while (1) switch (_context7.prev = _context7.next) {
|
|
case 0:
|
|
_context7.next = 2;
|
|
return (0,fetch/* default */.ZP)("/api/ec_years/".concat(params.ec_year_id, "/ec_teachers.json"), {
|
|
method: "get",
|
|
params: {
|
|
teacher_id: id,
|
|
school_id: user === null || user === void 0 || (_user$userInfo9 = user.userInfo) === null || _user$userInfo9 === void 0 ? void 0 : _user$userInfo9.school_id
|
|
}
|
|
});
|
|
case 2:
|
|
res = _context7.sent;
|
|
if (res !== null && res !== void 0 && res.data) {
|
|
modal/* default */.Z.info({
|
|
title: "查看认证团队人员信息",
|
|
className: "custom-modal-divider ",
|
|
centered: true,
|
|
icon: null,
|
|
content: /*#__PURE__*/(0,jsx_runtime.jsxs)("div", {
|
|
className: TeacherListmodules.detail,
|
|
children: [/*#__PURE__*/(0,jsx_runtime.jsxs)("p", {
|
|
children: [/*#__PURE__*/(0,jsx_runtime.jsx)("span", {
|
|
children: "\u59D3\u540D"
|
|
}), /*#__PURE__*/(0,jsx_runtime.jsx)("span", {
|
|
children: (res === null || res === void 0 || (_res$data = res.data) === null || _res$data === void 0 || (_res$data = _res$data[0]) === null || _res$data === void 0 ? void 0 : _res$data.name) || '-'
|
|
})]
|
|
}), /*#__PURE__*/(0,jsx_runtime.jsxs)("p", {
|
|
children: [/*#__PURE__*/(0,jsx_runtime.jsx)("span", {
|
|
children: "\u624B\u673A\u53F7\u7801"
|
|
}), /*#__PURE__*/(0,jsx_runtime.jsx)("span", {
|
|
children: (res === null || res === void 0 || (_res$data2 = res.data) === null || _res$data2 === void 0 || (_res$data2 = _res$data2[0]) === null || _res$data2 === void 0 ? void 0 : _res$data2.phone) || '-'
|
|
})]
|
|
}), /*#__PURE__*/(0,jsx_runtime.jsxs)("p", {
|
|
children: [/*#__PURE__*/(0,jsx_runtime.jsx)("span", {
|
|
children: "\u90AE\u7BB1"
|
|
}), /*#__PURE__*/(0,jsx_runtime.jsx)("span", {
|
|
children: (res === null || res === void 0 || (_res$data3 = res.data) === null || _res$data3 === void 0 || (_res$data3 = _res$data3[0]) === null || _res$data3 === void 0 ? void 0 : _res$data3.mail) || '-'
|
|
})]
|
|
}), /*#__PURE__*/(0,jsx_runtime.jsxs)("p", {
|
|
children: [/*#__PURE__*/(0,jsx_runtime.jsx)("span", {
|
|
children: "\u804C\u79F0"
|
|
}), /*#__PURE__*/(0,jsx_runtime.jsx)("span", {
|
|
children: (res === null || res === void 0 || (_res$data4 = res.data) === null || _res$data4 === void 0 || (_res$data4 = _res$data4[0]) === null || _res$data4 === void 0 ? void 0 : _res$data4.technical_title) || '-'
|
|
})]
|
|
}), /*#__PURE__*/(0,jsx_runtime.jsxs)("p", {
|
|
children: [/*#__PURE__*/(0,jsx_runtime.jsx)("span", {
|
|
children: "\u804C\u52A1"
|
|
}), /*#__PURE__*/(0,jsx_runtime.jsx)("span", {
|
|
children: (res === null || res === void 0 || (_res$data5 = res.data) === null || _res$data5 === void 0 || (_res$data5 = _res$data5[0]) === null || _res$data5 === void 0 ? void 0 : _res$data5.identity) || '-'
|
|
})]
|
|
}), /*#__PURE__*/(0,jsx_runtime.jsxs)("p", {
|
|
children: [/*#__PURE__*/(0,jsx_runtime.jsx)("span", {
|
|
children: "\u5355\u4F4D"
|
|
}), /*#__PURE__*/(0,jsx_runtime.jsx)("span", {
|
|
children: (res === null || res === void 0 || (_res$data6 = res.data) === null || _res$data6 === void 0 || (_res$data6 = _res$data6[0]) === null || _res$data6 === void 0 ? void 0 : _res$data6.school) || '-'
|
|
})]
|
|
}), /*#__PURE__*/(0,jsx_runtime.jsxs)("p", {
|
|
children: [/*#__PURE__*/(0,jsx_runtime.jsx)("span", {
|
|
children: "\u5B66\u9662/\u7CFB"
|
|
}), /*#__PURE__*/(0,jsx_runtime.jsx)("span", {
|
|
children: (res === null || res === void 0 || (_res$data7 = res.data) === null || _res$data7 === void 0 || (_res$data7 = _res$data7[0]) === null || _res$data7 === void 0 ? void 0 : _res$data7.department) || '-'
|
|
})]
|
|
})]
|
|
}),
|
|
okText: '关闭'
|
|
});
|
|
}
|
|
case 4:
|
|
case "end":
|
|
return _context7.stop();
|
|
}
|
|
}, _callee7);
|
|
}));
|
|
return function handleDetail(_x7) {
|
|
return _ref7.apply(this, arguments);
|
|
};
|
|
}();
|
|
var handleEdit = /*#__PURE__*/function () {
|
|
var _ref8 = asyncToGenerator_default()( /*#__PURE__*/regeneratorRuntime_default()().mark(function _callee8(id) {
|
|
var res, _res$data8;
|
|
return regeneratorRuntime_default()().wrap(function _callee8$(_context8) {
|
|
while (1) switch (_context8.prev = _context8.next) {
|
|
case 0:
|
|
setEdit(id);
|
|
_context8.next = 3;
|
|
return (0,fetch/* default */.ZP)("/api/ec_years/".concat(params.ec_year_id, "/ec_course_teachers.json"), {
|
|
method: "get",
|
|
params: {
|
|
teacher_id: id
|
|
}
|
|
});
|
|
case 3:
|
|
res = _context8.sent;
|
|
if (res !== null && res !== void 0 && res.data) {
|
|
form.setFieldsValue((res === null || res === void 0 || (_res$data8 = res.data) === null || _res$data8 === void 0 ? void 0 : _res$data8[0]) || {});
|
|
}
|
|
case 5:
|
|
case "end":
|
|
return _context8.stop();
|
|
}
|
|
}, _callee8);
|
|
}));
|
|
return function handleEdit(_x8) {
|
|
return _ref8.apply(this, arguments);
|
|
};
|
|
}();
|
|
var addSubmit = /*#__PURE__*/function () {
|
|
var _ref9 = asyncToGenerator_default()( /*#__PURE__*/regeneratorRuntime_default()().mark(function _callee9(values) {
|
|
var _res;
|
|
var res;
|
|
return regeneratorRuntime_default()().wrap(function _callee9$(_context9) {
|
|
while (1) switch (_context9.prev = _context9.next) {
|
|
case 0:
|
|
if (formSign.current) {
|
|
setBtnLoading(true);
|
|
} else {
|
|
setBtnAddLoading(true);
|
|
}
|
|
if (!edit) {
|
|
_context9.next = 7;
|
|
break;
|
|
}
|
|
_context9.next = 4;
|
|
return (0,fetch/* default */.ZP)("/api/ec_years/".concat(params.ec_year_id, "/ec_course_teachers.json"), {
|
|
method: "put",
|
|
body: objectSpread2_default()(objectSpread2_default()({}, values), {}, {
|
|
id: edit
|
|
})
|
|
});
|
|
case 4:
|
|
res = _context9.sent;
|
|
_context9.next = 10;
|
|
break;
|
|
case 7:
|
|
_context9.next = 9;
|
|
return (0,fetch/* default */.ZP)("/api/ec_years/".concat(params.ec_year_id, "/ec_course_teachers.json"), {
|
|
method: "post",
|
|
body: values
|
|
});
|
|
case 9:
|
|
res = _context9.sent;
|
|
case 10:
|
|
if (((_res = res) === null || _res === void 0 ? void 0 : _res.status) === 0) {
|
|
if (formSign.current) {
|
|
setVisible(false);
|
|
setEdit(false);
|
|
form.resetFields();
|
|
} else {
|
|
form.resetFields();
|
|
}
|
|
message/* default */.ZP.success('保存成功');
|
|
getData(params);
|
|
}
|
|
setBtnLoading(false);
|
|
setBtnAddLoading(false);
|
|
case 13:
|
|
case "end":
|
|
return _context9.stop();
|
|
}
|
|
}, _callee9);
|
|
}));
|
|
return function addSubmit(_x9) {
|
|
return _ref9.apply(this, arguments);
|
|
};
|
|
}();
|
|
var renderFormNode = function renderFormNode(isEdit) {
|
|
return /*#__PURE__*/(0,jsx_runtime.jsxs)("div", {
|
|
children: [/*#__PURE__*/(0,jsx_runtime.jsxs)(es_form/* default */.Z, {
|
|
form: form,
|
|
colon: false,
|
|
onFinish: addSubmit,
|
|
labelCol: {
|
|
span: 4
|
|
},
|
|
wrapperCol: {
|
|
span: 18
|
|
},
|
|
className: TeacherListmodules.form,
|
|
children: [/*#__PURE__*/(0,jsx_runtime.jsx)(es_form/* default */.Z.Item, {
|
|
label: "\u59D3\u540D",
|
|
name: "name",
|
|
rules: [{
|
|
required: true,
|
|
message: '请输入姓名'
|
|
}, {
|
|
whitespace: true,
|
|
message: '请输入姓名'
|
|
}],
|
|
children: /*#__PURE__*/(0,jsx_runtime.jsx)(input/* default */.Z, {
|
|
placeholder: "\u8BF7\u8F93\u5165\u59D3\u540D"
|
|
})
|
|
}), /*#__PURE__*/(0,jsx_runtime.jsx)(es_form/* default */.Z.Item, {
|
|
label: "\u624B\u673A\u53F7\u7801",
|
|
name: "tel",
|
|
rules: [{
|
|
required: true,
|
|
message: '请输入手机号码'
|
|
}, {
|
|
pattern: /^1[3|4|5|7|8][0-9]\d{8}$/,
|
|
message: '请输入正确的手机号'
|
|
}],
|
|
children: /*#__PURE__*/(0,jsx_runtime.jsx)(input/* default */.Z, {
|
|
placeholder: "\u8BF7\u8F93\u5165\u624B\u673A\u53F7\u7801"
|
|
})
|
|
}), /*#__PURE__*/(0,jsx_runtime.jsx)(es_form/* default */.Z.Item, {
|
|
label: "\u90AE\u7BB1",
|
|
name: "email",
|
|
rules: [{
|
|
type: 'email',
|
|
message: '请输入正确的邮箱'
|
|
}],
|
|
children: /*#__PURE__*/(0,jsx_runtime.jsx)(input/* default */.Z, {
|
|
placeholder: "\u8BF7\u8F93\u5165\u90AE\u7BB1"
|
|
})
|
|
}), /*#__PURE__*/(0,jsx_runtime.jsx)(es_form/* default */.Z.Item, {
|
|
label: "\u804C\u79F0",
|
|
name: "pro",
|
|
rules: [{
|
|
required: true,
|
|
message: '请输入所属职称'
|
|
}, {
|
|
whitespace: true,
|
|
message: '请输入所属职称'
|
|
}],
|
|
children: /*#__PURE__*/(0,jsx_runtime.jsx)(input/* default */.Z, {
|
|
placeholder: "\u8BF7\u8F93\u5165\u6240\u5C5E\u804C\u79F0"
|
|
})
|
|
}), /*#__PURE__*/(0,jsx_runtime.jsx)(es_form/* default */.Z.Item, {
|
|
label: "\u804C\u52A1",
|
|
name: "job",
|
|
children: /*#__PURE__*/(0,jsx_runtime.jsx)(input/* default */.Z, {
|
|
placeholder: "\u8BF7\u8F93\u5165\u804C\u52A1"
|
|
})
|
|
}), /*#__PURE__*/(0,jsx_runtime.jsx)(es_form/* default */.Z.Item, {
|
|
label: "\u5355\u4F4D",
|
|
name: "school",
|
|
children: /*#__PURE__*/(0,jsx_runtime.jsx)(input/* default */.Z, {
|
|
placeholder: "\u8BF7\u8F93\u5165\u5355\u4F4D"
|
|
})
|
|
}), /*#__PURE__*/(0,jsx_runtime.jsx)(es_form/* default */.Z.Item, {
|
|
style: {
|
|
paddingBottom: 0
|
|
},
|
|
label: "\u5B66\u9662/\u7CFB",
|
|
name: "department",
|
|
rules: [{
|
|
required: true,
|
|
message: '请输入学院/系'
|
|
}, {
|
|
whitespace: true,
|
|
message: '请输入学院/系'
|
|
}],
|
|
children: /*#__PURE__*/(0,jsx_runtime.jsx)(input/* default */.Z, {
|
|
placeholder: "\u8BF7\u8F93\u5165\u5B66\u9662/\u7CFB"
|
|
})
|
|
}), /*#__PURE__*/(0,jsx_runtime.jsx)(es_form/* default */.Z.Item, {
|
|
label: "\u4E13\u517C\u804C\u60C5\u51B5",
|
|
name: "is_part_time_job",
|
|
initialValue: 0,
|
|
children: /*#__PURE__*/(0,jsx_runtime.jsxs)(es_radio/* default.Group */.ZP.Group, {
|
|
children: [/*#__PURE__*/(0,jsx_runtime.jsx)(es_radio/* default */.ZP, {
|
|
value: 0,
|
|
children: "\u5168\u804C"
|
|
}), /*#__PURE__*/(0,jsx_runtime.jsx)(es_radio/* default */.ZP, {
|
|
value: 1,
|
|
children: "\u517C\u804C"
|
|
})]
|
|
})
|
|
})]
|
|
}), /*#__PURE__*/(0,jsx_runtime.jsxs)(space/* default */.Z, {
|
|
className: TeacherListmodules.button,
|
|
size: 10,
|
|
style: {
|
|
"float": 'right',
|
|
marginRight: 0,
|
|
paddingBottom: 0
|
|
},
|
|
children: [/*#__PURE__*/(0,jsx_runtime.jsx)(es_button/* default */.ZP, {
|
|
onClick: function onClick() {
|
|
setEdit(false);
|
|
setVisible(false);
|
|
},
|
|
children: "\u53D6\u6D88"
|
|
}), /*#__PURE__*/(0,jsx_runtime.jsx)(es_button/* default */.ZP, {
|
|
disabled: btnAddLoading,
|
|
type: isEdit ? 'primary' : 'default',
|
|
loading: btnLoading,
|
|
onClick: function onClick() {
|
|
formSign.current = true;
|
|
form.submit();
|
|
},
|
|
children: "\u4FDD\u5B58"
|
|
}), !isEdit && /*#__PURE__*/(0,jsx_runtime.jsx)(es_button/* default */.ZP, {
|
|
disabled: btnLoading,
|
|
loading: btnAddLoading,
|
|
type: "primary",
|
|
onClick: function onClick() {
|
|
formSign.current = false;
|
|
form.submit();
|
|
},
|
|
children: "\u7EE7\u7EED\u65B0\u589E"
|
|
})]
|
|
}), /*#__PURE__*/(0,jsx_runtime.jsx)("div", {
|
|
style: {
|
|
clear: 'both'
|
|
}
|
|
})]
|
|
});
|
|
};
|
|
var isDisabled = loading || disabled;
|
|
return /*#__PURE__*/(0,jsx_runtime.jsxs)("div", {
|
|
className: TeacherListmodules.wrap,
|
|
children: [/*#__PURE__*/(0,jsx_runtime.jsx)(Evaluate/* PanelTitle */.p, {
|
|
title: "\u6559\u5E08\u4FE1\u606F",
|
|
style: {
|
|
padding: '12px 0 10px 20px'
|
|
}
|
|
}), /*#__PURE__*/(0,jsx_runtime.jsxs)(tabs/* default */.Z, {
|
|
className: TeacherListmodules.tabWarp,
|
|
activeKey: params === null || params === void 0 ? void 0 : params.tab,
|
|
onChange: handleTabsChange,
|
|
tabBarExtraContent: /*#__PURE__*/(0,jsx_runtime.jsxs)(space/* default */.Z, {
|
|
className: TeacherListmodules.button,
|
|
size: 10,
|
|
children: [/*#__PURE__*/(0,jsx_runtime.jsxs)(es_button/* default */.ZP, {
|
|
disabled: isDisabled,
|
|
onClick: function onClick() {
|
|
if (params.tab === '2') {
|
|
setGroupModalVisible(true);
|
|
return;
|
|
}
|
|
form.resetFields();
|
|
setVisible(true);
|
|
},
|
|
type: "primary",
|
|
children: [/*#__PURE__*/(0,jsx_runtime.jsx)("i", {
|
|
className: "iconfont icon-xinzeng font14 mr5"
|
|
}), "\u65B0\u589E\u4EBA\u5458"]
|
|
}), /*#__PURE__*/(0,jsx_runtime.jsxs)(es_button/* default */.ZP, {
|
|
disabled: isDisabled,
|
|
onClick: function onClick() {
|
|
return handleDelete(selectIds);
|
|
},
|
|
children: [/*#__PURE__*/(0,jsx_runtime.jsx)("i", {
|
|
className: "iconfont icon-piliangshanchubeifen font14 mr5"
|
|
}), "\u6279\u91CF\u5220\u9664"]
|
|
}), /*#__PURE__*/(0,jsx_runtime.jsxs)(es_button/* default */.ZP, {
|
|
disabled: isDisabled,
|
|
onClick: function onClick() {
|
|
return exportExcel();
|
|
},
|
|
children: [/*#__PURE__*/(0,jsx_runtime.jsx)("i", {
|
|
className: "iconfont icon-daochubeifen font14 mr5"
|
|
}), "\u5BFC\u51FA"]
|
|
})]
|
|
}),
|
|
children: [/*#__PURE__*/(0,jsx_runtime.jsx)(tabs/* default */.Z.TabPane, {
|
|
tab: "\u6388\u8BFE\u6559\u5E08\u56E2\u961F"
|
|
}, '1'), /*#__PURE__*/(0,jsx_runtime.jsx)(tabs/* default */.Z.TabPane, {
|
|
tab: "\u8BA4\u8BC1\u5DE5\u4F5C\u56E2\u961F"
|
|
}, '2')]
|
|
}), /*#__PURE__*/(0,jsx_runtime.jsxs)("div", {
|
|
className: TeacherListmodules.control,
|
|
children: [/*#__PURE__*/(0,jsx_runtime.jsx)("div", {
|
|
className: TeacherListmodules.label,
|
|
children: "\u8BA4\u8BC1\u4E13\u4E1A"
|
|
}), /*#__PURE__*/(0,jsx_runtime.jsx)(es_select["default"], {
|
|
disabled: isDisabled,
|
|
style: {
|
|
width: 240
|
|
},
|
|
placeholder: "\u8BF7\u9009\u62E9\u8BA4\u8BC1\u4E13\u4E1A",
|
|
value: params === null || params === void 0 ? void 0 : params.ec_major_school_id,
|
|
onChange: function onChange(v) {
|
|
return handleSelect(v, 'ec_major_school_id');
|
|
},
|
|
children: majorData === null || majorData === void 0 ? void 0 : majorData.map(function (e) {
|
|
return /*#__PURE__*/(0,jsx_runtime.jsx)(es_select["default"].Option, {
|
|
value: e.ec_major_school_id,
|
|
children: e.name
|
|
});
|
|
})
|
|
}), /*#__PURE__*/(0,jsx_runtime.jsx)("div", {
|
|
className: TeacherListmodules.label,
|
|
children: "\u8BA4\u8BC1\u5C4A\u522B"
|
|
}), /*#__PURE__*/(0,jsx_runtime.jsx)(es_select["default"], {
|
|
disabled: isDisabled,
|
|
style: {
|
|
width: 140
|
|
},
|
|
placeholder: "\u8BF7\u9009\u62E9\u5C4A\u522B",
|
|
value: params === null || params === void 0 ? void 0 : params.ec_year_id,
|
|
onChange: function onChange(v) {
|
|
return handleSelect(v, 'ec_year_id');
|
|
},
|
|
children: yearData === null || yearData === void 0 ? void 0 : yearData.map(function (e) {
|
|
return /*#__PURE__*/(0,jsx_runtime.jsx)(es_select["default"].Option, {
|
|
value: e.ec_year_id,
|
|
children: e.year
|
|
});
|
|
})
|
|
}), /*#__PURE__*/(0,jsx_runtime.jsx)("div", {
|
|
className: TeacherListmodules.label,
|
|
style: {
|
|
width: 100,
|
|
background: "#fff"
|
|
},
|
|
children: /*#__PURE__*/(0,jsx_runtime.jsxs)(es_select["default"], {
|
|
disabled: isDisabled,
|
|
style: {
|
|
width: 100,
|
|
transform: 'translate(-1px, -1px)'
|
|
},
|
|
bordered: false,
|
|
value: params === null || params === void 0 ? void 0 : params.category,
|
|
onChange: function onChange(v) {
|
|
return handleSelect(v, 'category');
|
|
},
|
|
children: [/*#__PURE__*/(0,jsx_runtime.jsx)(es_select["default"].Option, {
|
|
value: 'name',
|
|
children: "\u59D3\u540D"
|
|
}), /*#__PURE__*/(0,jsx_runtime.jsx)(es_select["default"].Option, {
|
|
value: 'tel',
|
|
children: "\u624B\u673A\u53F7\u7801"
|
|
}), /*#__PURE__*/(0,jsx_runtime.jsx)(es_select["default"].Option, {
|
|
value: 'email',
|
|
children: "\u90AE\u7BB1"
|
|
})]
|
|
})
|
|
}), /*#__PURE__*/(0,jsx_runtime.jsx)(input/* default */.Z.Search, {
|
|
disabled: isDisabled,
|
|
placeholder: "\u8BF7\u8F93\u5165".concat((params === null || params === void 0 ? void 0 : params.category) === 'name' ? '姓名' : (params === null || params === void 0 ? void 0 : params.category) === 'tel' ? '手机号码' : '邮箱'),
|
|
value: params === null || params === void 0 ? void 0 : params.save_search,
|
|
onChange: function onChange(e) {
|
|
return handleSearch(e.target.value);
|
|
},
|
|
onSearch: function onSearch() {
|
|
params.page = 1;
|
|
params.search = params.save_search;
|
|
setParams(objectSpread2_default()({}, params));
|
|
getData(params);
|
|
}
|
|
})]
|
|
}), /*#__PURE__*/(0,jsx_runtime.jsx)(table/* default */.Z, {
|
|
rowSelection: rowSelection,
|
|
className: TeacherListmodules.customTable,
|
|
dataSource: tableData,
|
|
bordered: false,
|
|
rowKey: "id",
|
|
columns: columns,
|
|
rowClassName: TeacherListmodules.row,
|
|
loading: loading,
|
|
onChange: handleChangePage,
|
|
pagination: {
|
|
pageSize: params.per_page,
|
|
total: params.total,
|
|
current: params.page,
|
|
showQuickJumper: true,
|
|
hideOnSinglePage: false,
|
|
showSizeChanger: true,
|
|
position: ["bottomCenter"],
|
|
size: "default",
|
|
showTotal: function showTotal(total) {
|
|
return /*#__PURE__*/(0,jsx_runtime.jsxs)("span", {
|
|
className: "mr10",
|
|
children: ["\u5171", /*#__PURE__*/(0,jsx_runtime.jsx)("span", {
|
|
className: "c-orange",
|
|
children: total
|
|
}), "\u6761\u6570\u636E"]
|
|
});
|
|
}
|
|
}
|
|
}), /*#__PURE__*/(0,jsx_runtime.jsx)(UploadExcel/* default */.Z, {
|
|
title: "\u65B0\u589E\u6388\u8BFE\u6559\u5E08",
|
|
visible: visible,
|
|
onCancel: function onCancel() {
|
|
return setVisible(false);
|
|
},
|
|
onOk: handleOk,
|
|
templateFileName: "\u6388\u8BFE\u56E2\u961F\u6559\u5E08\u5BFC\u5165\u6A21\u677F",
|
|
templateFileUrl: env/* default */.Z.API_SERVER + '/api/ec_years/1/ec_course_teachers/down_template.xlsx',
|
|
otherTemplateText: "\u6279\u91CF\u5BFC\u5165\u6388\u8BFE\u56E2\u961F\u6559\u5E08\u4FE1\u606F\u3002",
|
|
formNode: renderFormNode()
|
|
}), /*#__PURE__*/(0,jsx_runtime.jsx)(components_GroupModal, {
|
|
visible: groupModalVisible,
|
|
onCancel: function onCancel() {
|
|
return setGroupModalVisible(false);
|
|
},
|
|
onOk: handleGroup,
|
|
schoolId: user === null || user === void 0 || (_user$userInfo10 = user.userInfo) === null || _user$userInfo10 === void 0 ? void 0 : _user$userInfo10.school_id
|
|
}), /*#__PURE__*/(0,jsx_runtime.jsx)(modal/* default */.Z, {
|
|
title: '修改授课教师信息',
|
|
className: TeacherListmodules.customModal,
|
|
open: edit,
|
|
centered: true,
|
|
onCancel: function onCancel() {
|
|
setEdit(false);
|
|
form.resetFields();
|
|
},
|
|
width: "740px",
|
|
footer: null,
|
|
children: renderFormNode(true)
|
|
})]
|
|
});
|
|
};
|
|
/* harmony default export */ var TeacherList = ((0,_umi_production_exports.connect)(function (_ref10) {
|
|
var user = _ref10.user;
|
|
return {
|
|
user: user
|
|
};
|
|
})(Page));
|
|
|
|
/***/ }),
|
|
|
|
/***/ 36815:
|
|
/*!************************************************************************!*\
|
|
!*** ./src/pages/Engineering/components/Evaluate/index.ts + 4 modules ***!
|
|
\************************************************************************/
|
|
/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
|
|
|
|
|
|
// EXPORTS
|
|
__webpack_require__.d(__webpack_exports__, {
|
|
p: function() { return /* reexport */ Evaluate_PanelTitle; },
|
|
v: function() { return /* reexport */ Evaluate_SelectWrap; }
|
|
});
|
|
|
|
// EXTERNAL MODULE: ./node_modules/_react@17.0.2@react/index.js
|
|
var _react_17_0_2_react = __webpack_require__(59301);
|
|
;// CONCATENATED MODULE: ./src/pages/Engineering/components/Evaluate/PanelTitle/index.less?modules
|
|
// extracted by mini-css-extract-plugin
|
|
/* harmony default export */ var PanelTitlemodules = ({"panelTitleContainer":"panelTitleContainer___Ypuh_"});
|
|
// EXTERNAL MODULE: ./node_modules/_react@17.0.2@react/jsx-runtime.js
|
|
var jsx_runtime = __webpack_require__(37712);
|
|
;// CONCATENATED MODULE: ./src/pages/Engineering/components/Evaluate/PanelTitle/index.tsx
|
|
/*
|
|
* @Author: dengcheng
|
|
* @Date: 2022-03-29 21:51:10
|
|
* @Last Modified by: dengcheng
|
|
* @Last Modified time: 2022-03-30 15:20:33
|
|
* @description:面板标题
|
|
*/
|
|
|
|
|
|
|
|
var PanelTitle = function PanelTitle(_ref) {
|
|
var title = _ref.title,
|
|
_ref$style = _ref.style,
|
|
style = _ref$style === void 0 ? {} : _ref$style;
|
|
return /*#__PURE__*/(0,jsx_runtime.jsx)("div", {
|
|
className: PanelTitlemodules.panelTitleContainer,
|
|
style: style,
|
|
children: /*#__PURE__*/(0,jsx_runtime.jsx)("div", {
|
|
children: title
|
|
})
|
|
});
|
|
};
|
|
/* harmony default export */ var Evaluate_PanelTitle = (PanelTitle);
|
|
;// CONCATENATED MODULE: ./src/pages/Engineering/components/Evaluate/SelectWrap/index.less?modules
|
|
// extracted by mini-css-extract-plugin
|
|
/* harmony default export */ var SelectWrapmodules = ({"selectWrapContainer":"selectWrapContainer___qocIH"});
|
|
;// CONCATENATED MODULE: ./src/pages/Engineering/components/Evaluate/SelectWrap/index.tsx
|
|
|
|
|
|
|
|
|
|
var SelectWrap = function SelectWrap(_ref) {
|
|
var title = _ref.title,
|
|
children = _ref.children;
|
|
return /*#__PURE__*/(0,jsx_runtime.jsxs)("div", {
|
|
className: SelectWrapmodules.selectWrapContainer,
|
|
children: [/*#__PURE__*/(0,jsx_runtime.jsx)("span", {
|
|
children: title
|
|
}), children]
|
|
});
|
|
};
|
|
/* harmony default export */ var Evaluate_SelectWrap = (SelectWrap);
|
|
;// CONCATENATED MODULE: ./src/pages/Engineering/components/Evaluate/index.ts
|
|
// 面板标题
|
|
|
|
// 选择包装器
|
|
|
|
|
|
/***/ }),
|
|
|
|
/***/ 26352:
|
|
/*!****************************************************************************!*\
|
|
!*** ./src/pages/Engineering/components/UploadExcel/index.tsx + 1 modules ***!
|
|
\****************************************************************************/
|
|
/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
|
|
|
|
|
|
// EXPORTS
|
|
__webpack_require__.d(__webpack_exports__, {
|
|
Z: function() { return /* binding */ components_UploadExcel; }
|
|
});
|
|
|
|
// EXTERNAL MODULE: ./node_modules/_@babel_runtime@7.23.2@@babel/runtime/helpers/slicedToArray.js
|
|
var slicedToArray = __webpack_require__(11006);
|
|
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);
|
|
// 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/tabs/index.js + 24 modules
|
|
var tabs = __webpack_require__(99313);
|
|
// EXTERNAL MODULE: ./node_modules/_antd@5.9.0@antd/es/upload/index.js + 24 modules
|
|
var upload = __webpack_require__(6557);
|
|
// EXTERNAL MODULE: ./node_modules/_antd@5.9.0@antd/es/button/index.js
|
|
var es_button = __webpack_require__(3113);
|
|
// EXTERNAL MODULE: ./node_modules/_antd@5.9.0@antd/es/space/index.js + 3 modules
|
|
var space = __webpack_require__(81327);
|
|
// EXTERNAL MODULE: ./node_modules/_@ant-design_icons@5.2.6@@ant-design/icons/es/icons/PlusOutlined.js + 1 modules
|
|
var PlusOutlined = __webpack_require__(378);
|
|
// EXTERNAL MODULE: ./src/utils/util.tsx
|
|
var util = __webpack_require__(87885);
|
|
// EXTERNAL MODULE: ./src/.umi-production/exports.ts + 8 modules
|
|
var _umi_production_exports = __webpack_require__(7181);
|
|
;// CONCATENATED MODULE: ./src/pages/Engineering/components/UploadExcel/index.less?modules
|
|
// extracted by mini-css-extract-plugin
|
|
/* harmony default export */ var UploadExcelmodules = ({"flex_box_center":"flex_box_center___XrwzL","flex_space_between":"flex_space_between___iFg5r","flex_box_vertical_center":"flex_box_vertical_center___cwLRs","flex_box_center_end":"flex_box_center_end___CtCUL","flex_box_column":"flex_box_column___LM8yv","customModal":"customModal___YbYj5","content":"content___1WuDQ","tabWarp":"tabWarp___FHw0u"});
|
|
// EXTERNAL MODULE: ./node_modules/_react@17.0.2@react/jsx-runtime.js
|
|
var jsx_runtime = __webpack_require__(37712);
|
|
;// CONCATENATED MODULE: ./src/pages/Engineering/components/UploadExcel/index.tsx
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
var UploadExcel = function UploadExcel(_ref) {
|
|
var visible = _ref.visible,
|
|
onOk = _ref.onOk,
|
|
onCancel = _ref.onCancel,
|
|
templateFileName = _ref.templateFileName,
|
|
templateFileUrl = _ref.templateFileUrl,
|
|
otherTemplateText = _ref.otherTemplateText,
|
|
formNode = _ref.formNode,
|
|
title = _ref.title;
|
|
var _useState = (0,_react_17_0_2_react.useState)([]),
|
|
_useState2 = slicedToArray_default()(_useState, 2),
|
|
fileList = _useState2[0],
|
|
setFileList = _useState2[1];
|
|
var _useState3 = (0,_react_17_0_2_react.useState)(false),
|
|
_useState4 = slicedToArray_default()(_useState3, 2),
|
|
loading = _useState4[0],
|
|
setLoading = _useState4[1];
|
|
var _useState5 = (0,_react_17_0_2_react.useState)('1'),
|
|
_useState6 = slicedToArray_default()(_useState5, 2),
|
|
activeKey = _useState6[0],
|
|
setActiveKey = _useState6[1];
|
|
// const fileList = useRef<any>([])
|
|
var params = (0,_umi_production_exports.useParams)();
|
|
(0,_react_17_0_2_react.useEffect)(function () {
|
|
if (!visible) {
|
|
setFileList([]);
|
|
setLoading(false);
|
|
setActiveKey('1');
|
|
}
|
|
}, [visible]);
|
|
var handleOk = function handleOk() {
|
|
setLoading(true);
|
|
onOk(fileList, function () {
|
|
setLoading(false);
|
|
});
|
|
};
|
|
var handleCancel = function handleCancel() {
|
|
onCancel();
|
|
};
|
|
var down = function down() {
|
|
var url = templateFileUrl;
|
|
(0,util/* downLoadLink */.Nd)(null, url);
|
|
};
|
|
|
|
// const handleChange = (info: any) => {
|
|
// setFileList([info.file]);
|
|
// //受控时必须实时更新fileList
|
|
// };
|
|
|
|
var handleBeforeUpload = function handleBeforeUpload(file) {
|
|
var _file$name, _file$name2, _file$name3, _fileText;
|
|
var fileText = file === null || file === void 0 || (_file$name = file.name) === null || _file$name === void 0 ? void 0 : _file$name.substring(file === null || file === void 0 || (_file$name2 = file.name) === null || _file$name2 === void 0 ? void 0 : _file$name2.lastIndexOf("."), file === null || file === void 0 || (_file$name3 = file.name) === null || _file$name3 === void 0 ? void 0 : _file$name3.length);
|
|
fileText = (_fileText = fileText) === null || _fileText === void 0 ? void 0 : _fileText.toLowerCase();
|
|
if (fileText !== '.xls' && fileText !== '.xlsx') {
|
|
message/* default */.ZP.error('只能上传.xls,.xlsx格式的文档');
|
|
return Promise.reject();
|
|
}
|
|
var param = {
|
|
name: file.name,
|
|
uid: file.uid,
|
|
file: file
|
|
};
|
|
setFileList([param]);
|
|
return false;
|
|
};
|
|
var handleRemove = function handleRemove() {
|
|
setFileList([]);
|
|
};
|
|
return /*#__PURE__*/(0,jsx_runtime.jsx)(modal/* default */.Z, {
|
|
title: title,
|
|
open: visible
|
|
// onOk={handleOk}
|
|
,
|
|
centered: true,
|
|
wrapClassName: UploadExcelmodules.customModal,
|
|
onCancel: handleCancel,
|
|
width: "740px",
|
|
confirmLoading: loading,
|
|
footer: null,
|
|
children: /*#__PURE__*/(0,jsx_runtime.jsxs)(tabs/* default */.Z, {
|
|
className: UploadExcelmodules.tabWarp,
|
|
onChange: function onChange(k) {
|
|
return setActiveKey(k);
|
|
},
|
|
activeKey: activeKey,
|
|
children: [/*#__PURE__*/(0,jsx_runtime.jsx)(tabs/* default */.Z.TabPane, {
|
|
tab: "\u624B\u52A8\u65B0\u589E",
|
|
children: formNode
|
|
}, "1"), /*#__PURE__*/(0,jsx_runtime.jsx)(tabs/* default */.Z.TabPane, {
|
|
tab: "\u6279\u91CF\u5BFC\u5165",
|
|
children: /*#__PURE__*/(0,jsx_runtime.jsxs)("div", {
|
|
className: UploadExcelmodules.content,
|
|
children: [/*#__PURE__*/(0,jsx_runtime.jsxs)("div", {
|
|
style: {
|
|
marginLeft: 0,
|
|
paddingBottom: 50
|
|
},
|
|
children: [/*#__PURE__*/(0,jsx_runtime.jsxs)("div", {
|
|
style: {
|
|
marginTop: 36
|
|
},
|
|
children: [/*#__PURE__*/(0,jsx_runtime.jsx)("span", {
|
|
children: "\u6B65\u9AA41\uFF1A"
|
|
}), /*#__PURE__*/(0,jsx_runtime.jsxs)("span", {
|
|
children: ["\u4E0B\u8F7D\xA0", /*#__PURE__*/(0,jsx_runtime.jsxs)("span", {
|
|
style: {
|
|
color: "#0152D9",
|
|
cursor: 'pointer'
|
|
},
|
|
onClick: down,
|
|
children: [/*#__PURE__*/(0,jsx_runtime.jsx)("i", {
|
|
className: "iconfont icon-moban1 font14"
|
|
}), templateFileName]
|
|
}), "\uFF0C\xA0", otherTemplateText]
|
|
}), /*#__PURE__*/(0,jsx_runtime.jsx)("span", {
|
|
style: {
|
|
color: '#FA6400'
|
|
},
|
|
className: "mt10",
|
|
children: "\u6CE8\uFF1A\u76EE\u524D\u4EC5\u652F\u6301Excel\u683C\u5F0F\u6A21\u677F\u3002"
|
|
})]
|
|
}), /*#__PURE__*/(0,jsx_runtime.jsxs)("aside", {
|
|
style: {
|
|
marginTop: 30
|
|
},
|
|
children: [/*#__PURE__*/(0,jsx_runtime.jsx)("div", {
|
|
className: "mr20",
|
|
children: "\u6B65\u9AA42\uFF1A\u4E0A\u4F20\u586B\u5199\u5B8C\u6210\u7684\u6A21\u677F\u3002"
|
|
}), /*#__PURE__*/(0,jsx_runtime.jsx)("div", {
|
|
children: visible && /*#__PURE__*/(0,jsx_runtime.jsx)(upload/* default */.Z, {
|
|
action: "/api/attachments.json",
|
|
fileList: fileList
|
|
// action={`${ENV.API_SERVER}/api/attachments.json`}
|
|
,
|
|
beforeUpload: handleBeforeUpload,
|
|
onRemove: handleRemove,
|
|
withCredentials: true,
|
|
accept: ".xls,.xlsx",
|
|
children: /*#__PURE__*/(0,jsx_runtime.jsx)(es_button/* default */.ZP, {
|
|
type: "primary",
|
|
icon: /*#__PURE__*/(0,jsx_runtime.jsx)(PlusOutlined/* default */.Z, {}),
|
|
children: "\u9009\u62E9\u6587\u4EF6"
|
|
})
|
|
})
|
|
})]
|
|
})]
|
|
}), /*#__PURE__*/(0,jsx_runtime.jsxs)(space/* default */.Z, {
|
|
className: "",
|
|
size: 10,
|
|
style: {
|
|
"float": 'right'
|
|
},
|
|
children: [/*#__PURE__*/(0,jsx_runtime.jsx)(es_button/* default */.ZP, {
|
|
onClick: function onClick() {
|
|
return handleCancel();
|
|
},
|
|
children: "\u53D6\u6D88"
|
|
}), /*#__PURE__*/(0,jsx_runtime.jsx)(es_button/* default */.ZP, {
|
|
onClick: function onClick() {
|
|
return handleOk();
|
|
},
|
|
type: "primary",
|
|
children: "\u786E\u8BA4"
|
|
})]
|
|
})]
|
|
})
|
|
}, "2")]
|
|
})
|
|
});
|
|
};
|
|
/* harmony default export */ var components_UploadExcel = (UploadExcel);
|
|
|
|
/***/ })
|
|
|
|
}]); |