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

746 lines
31 KiB

"use strict";
(self["webpackChunk"] = self["webpackChunk"] || []).push([[91935],{
/***/ 61481:
/*!*******************************************************************************************************!*\
!*** ./node_modules/_@ant-design_icons@5.6.1@@ant-design/icons/es/icons/InboxOutlined.js + 1 modules ***!
\*******************************************************************************************************/
/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
// EXPORTS
__webpack_require__.d(__webpack_exports__, {
Z: function() { return /* binding */ icons_InboxOutlined; }
});
// EXTERNAL MODULE: ./node_modules/_@babel_runtime@7.26.9@@babel/runtime/helpers/esm/extends.js
var esm_extends = __webpack_require__(92413);
// 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/InboxOutlined.js
// This icon file is generated automatically.
var InboxOutlined = { "icon": { "tag": "svg", "attrs": { "viewBox": "0 0 1024 1024", "focusable": "false" }, "children": [{ "tag": "path", "attrs": { "d": "M885.2 446.3l-.2-.8-112.2-285.1c-5-16.1-19.9-27.2-36.8-27.2H281.2c-17 0-32.1 11.3-36.9 27.6L139.4 443l-.3.7-.2.8c-1.3 4.9-1.7 9.9-1 14.8-.1 1.6-.2 3.2-.2 4.8V830a60.9 60.9 0 0060.8 60.8h627.2c33.5 0 60.8-27.3 60.9-60.8V464.1c0-1.3 0-2.6-.1-3.7.4-4.9 0-9.6-1.3-14.1zm-295.8-43l-.3 15.7c-.8 44.9-31.8 75.1-77.1 75.1-22.1 0-41.1-7.1-54.8-20.6S436 441.2 435.6 419l-.3-15.7H229.5L309 210h399.2l81.7 193.3H589.4zm-375 76.8h157.3c24.3 57.1 76 90.8 140.4 90.8 33.7 0 65-9.4 90.3-27.2 22.2-15.6 39.5-37.4 50.7-63.6h156.5V814H214.4V480.1z" } }] }, "name": "inbox", "theme": "outlined" };
/* harmony default export */ var asn_InboxOutlined = (InboxOutlined);
// EXTERNAL MODULE: ./node_modules/_@ant-design_icons@5.6.1@@ant-design/icons/es/components/AntdIcon.js + 3 modules
var AntdIcon = __webpack_require__(7657);
;// CONCATENATED MODULE: ./node_modules/_@ant-design_icons@5.6.1@@ant-design/icons/es/icons/InboxOutlined.js
// GENERATE BY ./scripts/generate.ts
// DON NOT EDIT IT MANUALLY
var InboxOutlined_InboxOutlined = function InboxOutlined(props, ref) {
return /*#__PURE__*/_react_17_0_2_react.createElement(AntdIcon/* default */.Z, (0,esm_extends/* default */.Z)({}, props, {
ref: ref,
icon: asn_InboxOutlined
}));
};
/**![inbox](data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iNTAiIGhlaWdodD0iNTAiIGZpbGw9IiNjYWNhY2EiIHZpZXdCb3g9IjAgMCAxMDI0IDEwMjQiIGZvY3VzYWJsZT0iZmFsc2UiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+PHBhdGggZD0iTTg4NS4yIDQ0Ni4zbC0uMi0uOC0xMTIuMi0yODUuMWMtNS0xNi4xLTE5LjktMjcuMi0zNi44LTI3LjJIMjgxLjJjLTE3IDAtMzIuMSAxMS4zLTM2LjkgMjcuNkwxMzkuNCA0NDNsLS4zLjctLjIuOGMtMS4zIDQuOS0xLjcgOS45LTEgMTQuOC0uMSAxLjYtLjIgMy4yLS4yIDQuOFY4MzBhNjAuOSA2MC45IDAgMDA2MC44IDYwLjhoNjI3LjJjMzMuNSAwIDYwLjgtMjcuMyA2MC45LTYwLjhWNDY0LjFjMC0xLjMgMC0yLjYtLjEtMy43LjQtNC45IDAtOS42LTEuMy0xNC4xem0tMjk1LjgtNDNsLS4zIDE1LjdjLS44IDQ0LjktMzEuOCA3NS4xLTc3LjEgNzUuMS0yMi4xIDAtNDEuMS03LjEtNTQuOC0yMC42UzQzNiA0NDEuMiA0MzUuNiA0MTlsLS4zLTE1LjdIMjI5LjVMMzA5IDIxMGgzOTkuMmw4MS43IDE5My4zSDU4OS40em0tMzc1IDc2LjhoMTU3LjNjMjQuMyA1Ny4xIDc2IDkwLjggMTQwLjQgOTAuOCAzMy43IDAgNjUtOS40IDkwLjMtMjcuMiAyMi4yLTE1LjYgMzkuNS0zNy40IDUwLjctNjMuNmgxNTYuNVY4MTRIMjE0LjRWNDgwLjF6IiAvPjwvc3ZnPg==) */
var RefIcon = /*#__PURE__*/_react_17_0_2_react.forwardRef(InboxOutlined_InboxOutlined);
if (false) {}
/* harmony default export */ var icons_InboxOutlined = (RefIcon);
/***/ }),
/***/ 86298:
/*!**********************************************************************!*\
!*** ./src/pages/Laboratory/Regulationsadmins/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 */ Regulationsadmins; }
});
// 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/_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__(5841);
;// CONCATENATED MODULE: ./src/pages/Laboratory/Regulationsadmins/index.less?modules
// extracted by mini-css-extract-plugin
/* harmony default export */ var Regulationsadminsmodules = ({"header_div":"header_div___qy41A","header_title":"header_title___Wu8pj","search":"search___XkbFV","searchIcon":"searchIcon___oPKoy","clear_Data":"clear_Data___DGoyJ","search_params":"search_params___Wcxh5"});
// 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/tooltip/index.js + 3 modules
var tooltip = __webpack_require__(6848);
// 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/message/index.js + 4 modules
var message = __webpack_require__(8591);
// EXTERNAL MODULE: ./node_modules/_antd@5.9.0@antd/es/table/index.js + 85 modules
var table = __webpack_require__(1710);
// EXTERNAL MODULE: ./node_modules/_antd@5.9.0@antd/es/pagination/index.js + 10 modules
var pagination = __webpack_require__(58421);
// EXTERNAL MODULE: ./node_modules/_antd@5.9.0@antd/es/input/index.js + 3 modules
var input = __webpack_require__(92832);
// EXTERNAL MODULE: ./node_modules/_antd@5.9.0@antd/es/upload/index.js
var upload = __webpack_require__(60028);
// EXTERNAL MODULE: ./node_modules/_antd@5.9.0@antd/es/button/index.js
var es_button = __webpack_require__(3113);
// EXTERNAL MODULE: ./node_modules/_dayjs@1.11.13@dayjs/dayjs.min.js
var dayjs_min = __webpack_require__(61186);
var dayjs_min_default = /*#__PURE__*/__webpack_require__.n(dayjs_min);
// EXTERNAL MODULE: ./src/utils/fetch.ts
var fetch = __webpack_require__(43391);
// EXTERNAL MODULE: ./src/utils/env.ts + 1 modules
var env = __webpack_require__(43873);
// EXTERNAL MODULE: ./node_modules/_@ant-design_icons@5.6.1@@ant-design/icons/es/icons/CloseCircleFilled.js + 1 modules
var CloseCircleFilled = __webpack_require__(19248);
// EXTERNAL MODULE: ./src/components/markdown-editor/index.tsx + 10 modules
var markdown_editor = __webpack_require__(37707);
// EXTERNAL MODULE: ./src/components/MultiUpload/index.tsx + 3 modules
var MultiUpload = __webpack_require__(25655);
// EXTERNAL MODULE: ./node_modules/_react@17.0.2@react/jsx-runtime.js
var jsx_runtime = __webpack_require__(37712);
;// CONCATENATED MODULE: ./src/pages/Laboratory/Regulationsadmins/index.tsx
var Navigation = function Navigation(_ref) {
var loading = _ref.loading,
user = _ref.user;
var _useState = (0,_react_17_0_2_react.useState)(),
_useState2 = slicedToArray_default()(_useState, 2),
keyword = _useState2[0],
setkeyword = _useState2[1];
var _Form$useForm = es_form/* default */.Z.useForm(),
_Form$useForm2 = slicedToArray_default()(_Form$useForm, 1),
myForm = _Form$useForm2[0];
var _useState3 = (0,_react_17_0_2_react.useState)(false),
_useState4 = slicedToArray_default()(_useState3, 2),
openMyModal = _useState4[0],
setOpenMyModal = _useState4[1];
var _useState5 = (0,_react_17_0_2_react.useState)(''),
_useState6 = slicedToArray_default()(_useState5, 2),
centerId = _useState6[0],
setCenterId = _useState6[1];
var _useState7 = (0,_react_17_0_2_react.useState)(false),
_useState8 = slicedToArray_default()(_useState7, 2),
showCustomRules = _useState8[0],
setShowCustomRules = _useState8[1];
var _useState9 = (0,_react_17_0_2_react.useState)(''),
_useState10 = slicedToArray_default()(_useState9, 2),
isType = _useState10[0],
setIsType = _useState10[1];
var _useState11 = (0,_react_17_0_2_react.useState)(false),
_useState12 = slicedToArray_default()(_useState11, 2),
imgLoading = _useState12[0],
setImgLoading = _useState12[1];
var _useState13 = (0,_react_17_0_2_react.useState)(undefined),
_useState14 = slicedToArray_default()(_useState13, 2),
attachId = _useState14[0],
setattachId = _useState14[1];
var _useState15 = (0,_react_17_0_2_react.useState)(),
_useState16 = slicedToArray_default()(_useState15, 2),
items = _useState16[0],
setitem = _useState16[1];
//预约数据
var _useState17 = (0,_react_17_0_2_react.useState)([]),
_useState18 = slicedToArray_default()(_useState17, 2),
tableData = _useState18[0],
setTableData = _useState18[1];
var columns = [{
title: '序号',
dataIndex: 'number',
ellipsis: true,
render: function render(text, item, index) {
console.log('---', index);
return /*#__PURE__*/(0,jsx_runtime.jsx)(tooltip/* default */.Z, {
placement: "bottomLeft",
title: limit * (page - 1) + index + 1,
children: /*#__PURE__*/(0,jsx_runtime.jsx)("span", {
children: limit * (page - 1) + index + 1
})
});
}
}, {
title: '规章制度名称',
dataIndex: 'name',
ellipsis: true,
render: function render(text, record) {
return /*#__PURE__*/(0,jsx_runtime.jsx)(tooltip/* default */.Z, {
placement: "bottomLeft",
title: text,
children: /*#__PURE__*/(0,jsx_runtime.jsx)("span", {
style: {
color: '#165DFF',
cursor: 'pointer'
},
onClick: function onClick() {},
children: text || '--'
})
});
}
}, {
title: '创建人',
dataIndex: 'user_name',
ellipsis: true,
render: function render(text) {
return /*#__PURE__*/(0,jsx_runtime.jsx)(tooltip/* default */.Z, {
placement: "bottomLeft",
title: text,
children: /*#__PURE__*/(0,jsx_runtime.jsx)("span", {
children: text || '--'
})
});
}
}, {
title: '创建时间',
dataIndex: 'created_at',
ellipsis: true,
render: function render(text) {
return /*#__PURE__*/(0,jsx_runtime.jsx)(tooltip/* default */.Z, {
placement: "bottomLeft",
title: dayjs_min_default()(text).format('YYYY-MM-DD HH:mm'),
children: /*#__PURE__*/(0,jsx_runtime.jsx)("span", {
style: {
color: '#666666'
},
children: dayjs_min_default()(text).format('YYYY-MM-DD HH:mm') || '--'
})
});
}
}, {
title: '操作',
dataIndex: 'student_number9',
ellipsis: true,
width: 180,
render: function render(text, record) {
return /*#__PURE__*/(0,jsx_runtime.jsxs)(jsx_runtime.Fragment, {
children: [/*#__PURE__*/(0,jsx_runtime.jsx)("span", {
style: {
color: "#165DFF",
cursor: "pointer"
},
onClick: function onClick() {
var _record$attachments, _record$cover_imgae, _record$cover_imgae2, _record$cover_imgae3, _record$cover_imgae4;
var data = [];
record === null || record === void 0 || (_record$attachments = record.attachments) === null || _record$attachments === void 0 || _record$attachments.map(function (item) {
var tt = {
uid: item.id,
name: item.title,
response: {
id: item.id
}
};
data.push(tt);
});
console.log('---', data);
// cover_image_id content. attachment_ids
// cover_imgae
myForm.setFieldsValue({
name: record === null || record === void 0 ? void 0 : record.name,
content: record === null || record === void 0 ? void 0 : record.content,
cover_image_id: {
uid: record === null || record === void 0 || (_record$cover_imgae = record.cover_imgae) === null || _record$cover_imgae === void 0 ? void 0 : _record$cover_imgae.id,
name: record === null || record === void 0 || (_record$cover_imgae2 = record.cover_imgae) === null || _record$cover_imgae2 === void 0 ? void 0 : _record$cover_imgae2.title,
response: {
id: record === null || record === void 0 || (_record$cover_imgae3 = record.cover_imgae) === null || _record$cover_imgae3 === void 0 ? void 0 : _record$cover_imgae3.id
}
},
attachment_ids: (0,MultiUpload/* coverToFileList */.z)(record === null || record === void 0 ? void 0 : record.attachments)
});
setattachId(record === null || record === void 0 || (_record$cover_imgae4 = record.cover_imgae) === null || _record$cover_imgae4 === void 0 ? void 0 : _record$cover_imgae4.id);
setitem(record);
setOpenMyModal(true);
setIsType('编辑');
},
children: "\u7F16\u8F91"
}), /*#__PURE__*/(0,jsx_runtime.jsx)("span", {
style: {
color: "#5F6367",
marginLeft: "10px",
cursor: "pointer"
},
onClick: function onClick() {
deleteItem(record === null || record === void 0 ? void 0 : record.id);
},
children: "\u5220\u9664"
})]
});
}
}];
var _useState19 = (0,_react_17_0_2_react.useState)([]),
_useState20 = slicedToArray_default()(_useState19, 2),
customRulesList = _useState20[0],
setCustomRulesList = _useState20[1];
//分页
var _useState21 = (0,_react_17_0_2_react.useState)(0),
_useState22 = slicedToArray_default()(_useState21, 2),
total = _useState22[0],
setTotal = _useState22[1];
var _useState23 = (0,_react_17_0_2_react.useState)(1),
_useState24 = slicedToArray_default()(_useState23, 2),
page = _useState24[0],
setPage = _useState24[1];
var _useState25 = (0,_react_17_0_2_react.useState)(10),
_useState26 = slicedToArray_default()(_useState25, 2),
limit = _useState26[0],
setLimit = _useState26[1];
var _useState27 = (0,_react_17_0_2_react.useState)(false),
_useState28 = slicedToArray_default()(_useState27, 2),
isLoading = _useState28[0],
setIsLoading = _useState28[1];
var pageOnChange = function pageOnChange(page, size) {
setPage(page);
};
var onShowSizeChange = function onShowSizeChange(current, pageSize) {
setLimit(pageSize);
};
(0,_react_17_0_2_react.useEffect)(function () {
initForm();
}, []);
(0,_react_17_0_2_react.useEffect)(function () {
getList(false);
}, [page, limit]);
(0,_react_17_0_2_react.useEffect)(function () {
getList(true);
}, [keyword]);
var getList = /*#__PURE__*/function () {
var _ref2 = asyncToGenerator_default()( /*#__PURE__*/regeneratorRuntime_default()().mark(function _callee(flag) {
var res;
return regeneratorRuntime_default()().wrap(function _callee$(_context) {
while (1) switch (_context.prev = _context.next) {
case 0:
if (flag) {
setPage(1);
}
setIsLoading(true);
_context.next = 4;
return (0,fetch/* default */.ZP)("/api/yn_classrooms/rules.json", {
method: 'get',
params: {
page: page,
limit: limit,
keyword: keyword
}
});
case 4:
res = _context.sent;
if ((res === null || res === void 0 ? void 0 : res.status) === 0) {
setTableData(res.data.list);
setTotal(res.data.count);
}
// get_reservation_rules({
// page: page,
// limit: limit,
// keyword: keyword,
// user_id: user?.userInfo?.user_id
// }).then((res) => {
// if (res.status == 0) {
// setTableData(res.data.list)
// setTotal(res.data.count)
// }
// })
setIsLoading(false);
case 7:
case "end":
return _context.stop();
}
}, _callee);
}));
return function getList(_x) {
return _ref2.apply(this, arguments);
};
}();
var initForm = function initForm() {
myForm.setFieldsValue({
title: '',
cycle: 'weekly',
rule: 'whole'
});
setShowCustomRules(false);
};
var deleteItem = function deleteItem(id) {
modal/* default */.Z.confirm({
centered: true,
okText: '确定',
cancelText: '取消',
title: '提示',
content: '确认要删除这个规章制度吗?',
className: Regulationsadminsmodules.modal,
onOk: function () {
var _onOk = 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:
_context2.next = 2;
return (0,fetch/* default */.ZP)("/api/yn_classrooms/rules/".concat(id, ".json"), {
method: 'delete'
});
case 2:
res = _context2.sent;
if ((res === null || res === void 0 ? void 0 : res.status) === 0) {
message/* default */.ZP.success('删除成功!');
getList(true);
}
// del_get_reservation_rules({ id }).then((res) => {
// if (res.status == 0) {
// message.success('删除成功!');
// getList(true)
// }
// })
case 4:
case "end":
return _context2.stop();
}
}, _callee2);
}));
function onOk() {
return _onOk.apply(this, arguments);
}
return onOk;
}()
});
};
var renderImg = function renderImg() {
return /*#__PURE__*/(0,jsx_runtime.jsxs)("div", {
style: {
position: 'relative',
backgroundColor: '#f4f3f4',
display: 'flex',
alignItems: 'center',
justifyContent: 'center'
},
children: [/*#__PURE__*/(0,jsx_runtime.jsx)("img", {
src: env/* default */.Z.API_SERVER + "/api/attachments/" + attachId,
alt: "avatar",
style: {
width: 288
}
}), /*#__PURE__*/(0,jsx_runtime.jsx)("div", {
style: {
position: 'absolute',
right: '-6px',
top: '-6px',
cursor: 'pointer',
backgroundColor: '#fff',
width: '16px',
height: '16px',
borderRadius: '50%'
},
children: /*#__PURE__*/(0,jsx_runtime.jsx)(CloseCircleFilled/* default */.Z, {
onClick: function onClick() {
return setattachId(undefined);
},
style: {
fontSize: '16px',
color: 'red'
}
})
})]
});
};
var handleChange = function handleChange(info) {
if (info.file.status === 'uploading') {
setImgLoading(true);
return;
}
if (info.file.status === 'done') {
var _info$file, _info$file3;
setImgLoading(false);
if (info.file.status === 'done' && ((_info$file = info.file) === null || _info$file === void 0 || (_info$file = _info$file.response) === null || _info$file === void 0 ? void 0 : _info$file.status) === -1) {
var _info$file2;
message/* default */.ZP.error((_info$file2 = info.file) === null || _info$file2 === void 0 || (_info$file2 = _info$file2.response) === null || _info$file2 === void 0 ? void 0 : _info$file2.message);
return;
}
setattachId(info === null || info === void 0 || (_info$file3 = info.file) === null || _info$file3 === void 0 || (_info$file3 = _info$file3.response) === null || _info$file3 === void 0 ? void 0 : _info$file3.id);
}
};
return /*#__PURE__*/(0,jsx_runtime.jsxs)("div", {
style: {
padding: 20
},
children: [/*#__PURE__*/(0,jsx_runtime.jsxs)("div", {
className: Regulationsadminsmodules.header_div,
children: [/*#__PURE__*/(0,jsx_runtime.jsxs)("div", {
className: Regulationsadminsmodules.header_title,
children: [/*#__PURE__*/(0,jsx_runtime.jsx)("span", {
className: "icon-zzxy-guizhangzhiduguanli"
}), " \u89C4\u7AE0\u5236\u5EA6\u7BA1\u7406"]
}), /*#__PURE__*/(0,jsx_runtime.jsx)("div", {
className: Regulationsadminsmodules.search_params,
style: {
marginLeft: 'auto'
}
}), /*#__PURE__*/(0,jsx_runtime.jsx)("div", {
className: Regulationsadminsmodules.clear_Data,
onClick: function onClick() {
initForm();
setCenterId('');
setOpenMyModal(true);
setIsType('新建');
},
children: "\u65B0\u5EFA\u89C4\u7AE0\u5236\u5EA6"
})]
}), /*#__PURE__*/(0,jsx_runtime.jsx)("div", {
className: "materials-table-wrp",
style: {
marginRight: 0
},
children: /*#__PURE__*/(0,jsx_runtime.jsx)(table/* default */.Z, {
loading: isLoading,
pagination: false,
dataSource: tableData,
className: "materials-table",
columns: columns
})
}), /*#__PURE__*/(0,jsx_runtime.jsx)("aside", {
children: total > 0 ? /*#__PURE__*/(0,jsx_runtime.jsxs)("div", {
style: {
display: 'flex',
alignItems: 'center',
justifyContent: 'space-between',
padding: '10px 7px 20px 7px'
},
children: [/*#__PURE__*/(0,jsx_runtime.jsx)("div", {}), /*#__PURE__*/(0,jsx_runtime.jsx)(pagination/* default */.Z, {
showSizeChanger: true,
showQuickJumper: true,
onChange: pageOnChange,
onShowSizeChange: onShowSizeChange,
defaultCurrent: 1,
pageSizeOptions: ['10', '20', '50', '100'],
current: page || 1,
pageSize: limit || 10,
defaultPageSize: 10,
total: total
})]
}) : ''
}), /*#__PURE__*/(0,jsx_runtime.jsx)(modal/* default */.Z, {
maskClosable: false,
centered: true,
keyboard: false,
destroyOnClose: true
// className={styles.my_modal}
,
className: "".concat(Regulationsadminsmodules.my_modal, " modalXazy"),
closeIcon: /*#__PURE__*/(0,jsx_runtime.jsx)("span", {
className: "icon-zzxy-fanhui"
}),
open: openMyModal,
title: "".concat(isType, "\u89C4\u7AE0\u5236\u5EA6"),
width: "950px",
onOk: /*#__PURE__*/asyncToGenerator_default()( /*#__PURE__*/regeneratorRuntime_default()().mark(function _callee3() {
var _formInfo$cover_image, _formInfo$cover_image2, _formInfo$attachment_;
var formInfo, url, res;
return regeneratorRuntime_default()().wrap(function _callee3$(_context3) {
while (1) switch (_context3.prev = _context3.next) {
case 0:
_context3.next = 2;
return myForm.validateFields();
case 2:
formInfo = myForm.getFieldsValue(); // console.log('---', formInfo);
// return
//获取图片id
formInfo.cover_image_id = (formInfo === null || formInfo === void 0 || (_formInfo$cover_image = formInfo.cover_image_id) === null || _formInfo$cover_image === void 0 || (_formInfo$cover_image = _formInfo$cover_image.response) === null || _formInfo$cover_image === void 0 ? void 0 : _formInfo$cover_image.id) || (formInfo === null || formInfo === void 0 || (_formInfo$cover_image2 = formInfo.cover_image_id) === null || _formInfo$cover_image2 === void 0 || (_formInfo$cover_image2 = _formInfo$cover_image2.file) === null || _formInfo$cover_image2 === void 0 || (_formInfo$cover_image2 = _formInfo$cover_image2.response) === null || _formInfo$cover_image2 === void 0 ? void 0 : _formInfo$cover_image2.id);
formInfo.attachment_ids = formInfo === null || formInfo === void 0 || (_formInfo$attachment_ = formInfo.attachment_ids) === null || _formInfo$attachment_ === void 0 ? void 0 : _formInfo$attachment_.map(function (item) {
var _item$response;
return item === null || item === void 0 || (_item$response = item.response) === null || _item$response === void 0 ? void 0 : _item$response.id;
});
console.log('---', formInfo);
url = isType === '编辑' ? "/api/yn_classrooms/rules/".concat(items === null || items === void 0 ? void 0 : items.id, ".json") : "/api/yn_classrooms/rules.json"; // return
_context3.next = 9;
return (0,fetch/* default */.ZP)(url, {
method: isType === '编辑' ? 'put' : 'post',
body: formInfo
});
case 9:
res = _context3.sent;
if ((res === null || res === void 0 ? void 0 : res.status) === 0) {
getList(true);
setOpenMyModal(false);
myForm === null || myForm === void 0 || myForm.resetFields();
setitem({});
setattachId('');
}
// // 配置details数据格式
// let details: any = []
// customRulesList.forEach((item) => {
// item.reservation.forEach((item2: any, index2: any) => {
// if (item2) {
// details.push({
// "week": item.weekDay,
// "section": index2 + 1
// })
// }
// })
// })
// if (isType != '查看') {
// if (centerId) {
// add_reservation_rules_update({ id: centerId, reservation_rule: { ...formInfo, details: details } }).then((res) => {
// if (res.status == 0) {
// message.success('编辑成功');
// setOpenMyModal(false)
// getList(true)
// }
// })
// } else {
// add_reservation_rules({ reservation_rule: { ...formInfo, details: details } }).then((res) => {
// if (res.status == 0) {
// message.success(`${isType}成功`);
// setOpenMyModal(false)
// getList(true)
// }
// })
// }
// } else {
// setOpenMyModal(false)
// }
case 11:
case "end":
return _context3.stop();
}
}, _callee3);
})),
onCancel: function onCancel() {
setOpenMyModal(false);
myForm === null || myForm === void 0 || myForm.resetFields();
setitem({});
setattachId('');
},
children: /*#__PURE__*/(0,jsx_runtime.jsxs)(es_form/* default */.Z, {
className: Regulationsadminsmodules.formWrap,
form: myForm,
labelCol: {
span: 3
},
style: {
marginTop: '20px'
},
children: [/*#__PURE__*/(0,jsx_runtime.jsx)(es_form/* default */.Z.Item, {
label: "\u5236\u5EA6\u540D\u79F0",
name: "name",
rules: [{
required: true,
message: '请输入规则名称'
}],
children: /*#__PURE__*/(0,jsx_runtime.jsx)(input/* default */.Z, {
disabled: isType == '查看' ? true : false,
onChange: function onChange(e) {
var _e$target;
myForm.setFieldValue('title', e === null || e === void 0 || (_e$target = e.target) === null || _e$target === void 0 || (_e$target = _e$target.value) === null || _e$target === void 0 ? void 0 : _e$target.trim());
}
})
}), /*#__PURE__*/(0,jsx_runtime.jsx)(es_form/* default */.Z.Item, {
name: "cover_image_id"
// valuePropName="fileList"
,
label: "\u5C01\u9762\u56FE:",
style: {
marginBottom: "34px"
},
rules: [{
required: true,
message: '请上传封面图'
}],
children: attachId ? renderImg() : /*#__PURE__*/(0,jsx_runtime.jsx)(upload/* default */.Z, {
withCredentials: true,
name: "file",
showUploadList: false,
action: "".concat(env/* default */.Z.API_SERVER, "/api/attachments.json"),
onChange: handleChange,
accept: "image/*",
children: /*#__PURE__*/(0,jsx_runtime.jsx)(es_button/* default */.ZP, {
loading: imgLoading,
icon: /*#__PURE__*/(0,jsx_runtime.jsx)("i", {
className: "iconfont icon-shangchuantupian2"
}),
children: /*#__PURE__*/(0,jsx_runtime.jsx)("span", {
style: {
marginLeft: "3px"
},
children: "\u4E0A\u4F20\u56FE\u7247"
})
})
})
}), /*#__PURE__*/(0,jsx_runtime.jsx)(es_form/* default */.Z.Item, {
label: "\u6D3B\u52A8\u5185\u5BB9",
name: "content",
rules: [{
required: true,
message: '请输入活动内容'
}],
children: /*#__PURE__*/(0,jsx_runtime.jsx)(markdown_editor/* default */.Z, {
watch: true,
defaultValue: items === null || items === void 0 ? void 0 : items.content
})
}), /*#__PURE__*/(0,jsx_runtime.jsx)(es_form/* default */.Z.Item, {
label: "\u9644\u4EF6",
name: "attachment_ids",
children: /*#__PURE__*/(0,jsx_runtime.jsx)(MultiUpload/* default */.Z, {})
})]
})
})]
});
};
/* harmony default export */ var Regulationsadmins = ((0,_umi_production_exports.connect)(function (_ref4) {
var loading = _ref4.loading,
engineeringNavigtion = _ref4.engineeringNavigtion,
user = _ref4.user;
return objectSpread2_default()(objectSpread2_default()({
loading: loading
}, engineeringNavigtion), {}, {
user: user
});
})(Navigation));
/***/ }),
/***/ 60028:
/*!**********************************************************!*\
!*** ./node_modules/_antd@5.9.0@antd/es/upload/index.js ***!
\**********************************************************/
/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
/* harmony import */ var _Dragger__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./Dragger */ 71409);
/* harmony import */ var _Upload__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./Upload */ 37714);
"use client";
const Upload = _Upload__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */ .Z;
Upload.Dragger = _Dragger__WEBPACK_IMPORTED_MODULE_1__/* ["default"] */ .Z;
Upload.LIST_IGNORE = _Upload__WEBPACK_IMPORTED_MODULE_0__/* .LIST_IGNORE */ .E;
/* harmony default export */ __webpack_exports__.Z = (Upload);
/***/ })
}]);