parent
8b3ebe1e98
commit
14aee071e2
@ -0,0 +1,400 @@
|
||||
"use strict";
|
||||
(self["webpackChunk"] = self["webpackChunk"] || []).push([[98662],{
|
||||
|
||||
/***/ 22197:
|
||||
/*!******************************************************************!*\
|
||||
!*** ./src/pages/Materials/ItemAssetsType/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 */ ItemAssetsType; }
|
||||
});
|
||||
|
||||
// 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__(44742);
|
||||
;// CONCATENATED MODULE: ./src/pages/Materials/ItemAssetsType/index.less?modules
|
||||
// extracted by mini-css-extract-plugin
|
||||
/* harmony default export */ var ItemAssetsTypemodules = ({"header_div":"header_div___vIi6W","header_title":"header_title___N7Kkj","search":"search___V6do5","searchIcon":"searchIcon___R9Tr9","clear_Data":"clear_Data___w3xTH","formWrap":"formWrap___EfDnW"});
|
||||
// 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/input/index.js + 5 modules
|
||||
var input = __webpack_require__(20008);
|
||||
// EXTERNAL MODULE: ./node_modules/_antd@5.9.0@antd/es/table/index.js + 85 modules
|
||||
var table = __webpack_require__(86383);
|
||||
// EXTERNAL MODULE: ./node_modules/_antd@5.9.0@antd/es/pagination/index.js + 10 modules
|
||||
var pagination = __webpack_require__(36697);
|
||||
// EXTERNAL MODULE: ./src/service/laboratory.ts
|
||||
var laboratory = __webpack_require__(66754);
|
||||
// EXTERNAL MODULE: ./node_modules/_react@17.0.2@react/jsx-runtime.js
|
||||
var jsx_runtime = __webpack_require__(37712);
|
||||
;// CONCATENATED MODULE: ./src/pages/Materials/ItemAssetsType/index.tsx
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
var Navigation = function Navigation(_ref) {
|
||||
var loading = _ref.loading;
|
||||
var _useState = (0,_react_17_0_2_react.useState)(),
|
||||
_useState2 = slicedToArray_default()(_useState, 2),
|
||||
keyword = _useState2[0],
|
||||
setkeyword = _useState2[1];
|
||||
var _useState3 = (0,_react_17_0_2_react.useState)(),
|
||||
_useState4 = slicedToArray_default()(_useState3, 2),
|
||||
typeId = _useState4[0],
|
||||
setTypeId = _useState4[1];
|
||||
var _useState5 = (0,_react_17_0_2_react.useState)(false),
|
||||
_useState6 = slicedToArray_default()(_useState5, 2),
|
||||
openMyModal = _useState6[0],
|
||||
setOpenMyModal = _useState6[1];
|
||||
var _Form$useForm = es_form/* default */.Z.useForm(),
|
||||
_Form$useForm2 = slicedToArray_default()(_Form$useForm, 1),
|
||||
myForm = _Form$useForm2[0];
|
||||
|
||||
//分页
|
||||
var _useState7 = (0,_react_17_0_2_react.useState)(0),
|
||||
_useState8 = slicedToArray_default()(_useState7, 2),
|
||||
total = _useState8[0],
|
||||
setTotal = _useState8[1];
|
||||
var _useState9 = (0,_react_17_0_2_react.useState)(1),
|
||||
_useState10 = slicedToArray_default()(_useState9, 2),
|
||||
page = _useState10[0],
|
||||
setPage = _useState10[1];
|
||||
var _useState11 = (0,_react_17_0_2_react.useState)(10),
|
||||
_useState12 = slicedToArray_default()(_useState11, 2),
|
||||
limit = _useState12[0],
|
||||
setLimit = _useState12[1];
|
||||
|
||||
//预约数据
|
||||
var _useState13 = (0,_react_17_0_2_react.useState)([]),
|
||||
_useState14 = slicedToArray_default()(_useState13, 2),
|
||||
tableData = _useState14[0],
|
||||
setTableData = _useState14[1];
|
||||
(0,_react_17_0_2_react.useEffect)(function () {
|
||||
getData(false);
|
||||
}, [page, limit]);
|
||||
(0,_react_17_0_2_react.useEffect)(function () {
|
||||
getData(true);
|
||||
}, [keyword]);
|
||||
var getData = function getData(flag) {
|
||||
if (flag) {
|
||||
setPage(1);
|
||||
}
|
||||
(0,laboratory/* classroom_categories_query */.mU)({
|
||||
page: page,
|
||||
limit: limit,
|
||||
keyword: keyword
|
||||
}).then(function (res) {
|
||||
var _res$data, _res$data2;
|
||||
setTableData(res === null || res === void 0 || (_res$data = res.data) === null || _res$data === void 0 ? void 0 : _res$data.list);
|
||||
setTotal(res === null || res === void 0 || (_res$data2 = res.data) === null || _res$data2 === void 0 ? void 0 : _res$data2.count);
|
||||
});
|
||||
};
|
||||
var columns = [{
|
||||
title: '类别名称',
|
||||
dataIndex: 'title',
|
||||
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: 'title1',
|
||||
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: '操作',
|
||||
width: 150,
|
||||
ellipsis: true,
|
||||
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() {
|
||||
setTypeId(record === null || record === void 0 ? void 0 : record.id);
|
||||
myForm.setFieldValue('title', record === null || record === void 0 ? void 0 : record.title);
|
||||
setOpenMyModal(true);
|
||||
},
|
||||
children: "\u7F16\u8F91"
|
||||
}), /*#__PURE__*/(0,jsx_runtime.jsx)("span", {
|
||||
style: {
|
||||
color: "#5F6367",
|
||||
marginLeft: "10px",
|
||||
cursor: "pointer"
|
||||
},
|
||||
onClick: function onClick() {
|
||||
modal/* default */.Z.confirm({
|
||||
centered: true,
|
||||
okText: '确定',
|
||||
cancelText: '取消',
|
||||
title: "提示",
|
||||
content: "是否确认删除该物资类别?",
|
||||
onOk: function () {
|
||||
var _onOk = asyncToGenerator_default()( /*#__PURE__*/regeneratorRuntime_default()().mark(function _callee() {
|
||||
return regeneratorRuntime_default()().wrap(function _callee$(_context) {
|
||||
while (1) switch (_context.prev = _context.next) {
|
||||
case 0:
|
||||
(0,laboratory/* classroom_categories_delete */.ZC)({
|
||||
id: record === null || record === void 0 ? void 0 : record.id
|
||||
}).then(function (res) {
|
||||
if (res.status === 0) {
|
||||
message/* default */.ZP.success('删除成功');
|
||||
getData(true);
|
||||
}
|
||||
});
|
||||
case 1:
|
||||
case "end":
|
||||
return _context.stop();
|
||||
}
|
||||
}, _callee);
|
||||
}));
|
||||
function onOk() {
|
||||
return _onOk.apply(this, arguments);
|
||||
}
|
||||
return onOk;
|
||||
}()
|
||||
});
|
||||
},
|
||||
children: "\u5220\u9664"
|
||||
})]
|
||||
});
|
||||
}
|
||||
}];
|
||||
var onShowSizeChange = function onShowSizeChange(page, size) {
|
||||
setPage(page);
|
||||
setLimit(size);
|
||||
};
|
||||
return /*#__PURE__*/(0,jsx_runtime.jsxs)("div", {
|
||||
children: [/*#__PURE__*/(0,jsx_runtime.jsxs)("div", {
|
||||
className: ItemAssetsTypemodules.header_div,
|
||||
children: [/*#__PURE__*/(0,jsx_runtime.jsx)("div", {
|
||||
className: ItemAssetsTypemodules.header_title,
|
||||
children: "\u7269\u8D44\u7C7B\u522B"
|
||||
}), /*#__PURE__*/(0,jsx_runtime.jsx)(input/* default */.Z.Search, {
|
||||
placeholder: "\u8BF7\u8F93\u5165\u7C7B\u522B\u540D\u79F0\u641C\u7D22",
|
||||
size: "large",
|
||||
className: ItemAssetsTypemodules.search,
|
||||
value: keyword,
|
||||
onChange: function onChange(e) {
|
||||
setkeyword(e.target.value);
|
||||
},
|
||||
onSearch: function onSearch(value) {
|
||||
setkeyword(value);
|
||||
},
|
||||
suffix: /*#__PURE__*/(0,jsx_runtime.jsx)("i", {
|
||||
className: "iconfont icon-sousuo9 font14 ".concat(ItemAssetsTypemodules.searchIcon),
|
||||
onClick: function onClick() {
|
||||
setkeyword(keyword);
|
||||
getData(true);
|
||||
}
|
||||
})
|
||||
}), /*#__PURE__*/(0,jsx_runtime.jsx)("div", {
|
||||
className: ItemAssetsTypemodules.clear_Data,
|
||||
onClick: function onClick() {
|
||||
setOpenMyModal(true);
|
||||
setTypeId('');
|
||||
},
|
||||
children: "\u65B0\u589E\u7C7B\u522B"
|
||||
})]
|
||||
}), /*#__PURE__*/(0,jsx_runtime.jsx)("div", {
|
||||
className: ItemAssetsTypemodules.search_params
|
||||
}), /*#__PURE__*/(0,jsx_runtime.jsx)(table/* default */.Z, {
|
||||
pagination: false,
|
||||
dataSource: tableData,
|
||||
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", {
|
||||
children: /*#__PURE__*/(0,jsx_runtime.jsxs)("span", {
|
||||
style: {
|
||||
color: '#656F87'
|
||||
},
|
||||
children: ["\u5171", /*#__PURE__*/(0,jsx_runtime.jsx)("span", {
|
||||
className: "c-light-primary",
|
||||
children: total
|
||||
}), "\u6761\u6570\u636E"]
|
||||
})
|
||||
}), /*#__PURE__*/(0,jsx_runtime.jsx)(pagination/* default */.Z, {
|
||||
showSizeChanger: true,
|
||||
showQuickJumper: true,
|
||||
onChange: 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, {
|
||||
centered: true,
|
||||
keyboard: false,
|
||||
destroyOnClose: true,
|
||||
className: ItemAssetsTypemodules.my_modal,
|
||||
open: openMyModal,
|
||||
title: "".concat(typeId ? '编辑' : '新建', "\u7269\u8D44\u7C7B\u522B"),
|
||||
width: "600px",
|
||||
onOk: /*#__PURE__*/asyncToGenerator_default()( /*#__PURE__*/regeneratorRuntime_default()().mark(function _callee2() {
|
||||
return regeneratorRuntime_default()().wrap(function _callee2$(_context2) {
|
||||
while (1) switch (_context2.prev = _context2.next) {
|
||||
case 0:
|
||||
_context2.next = 2;
|
||||
return myForm.validateFields();
|
||||
case 2:
|
||||
if (typeId) {
|
||||
(0,laboratory/* classroom_categories_update */.Ig)({
|
||||
id: typeId,
|
||||
classroom_category: myForm.getFieldsValue()
|
||||
}).then(function (res) {
|
||||
if ((res === null || res === void 0 ? void 0 : res.status) == 0) {
|
||||
message/* default */.ZP.success('编辑成功');
|
||||
getData(true);
|
||||
}
|
||||
setOpenMyModal(false);
|
||||
myForm.resetFields();
|
||||
});
|
||||
} else {
|
||||
(0,laboratory/* classroom_categories_create */.Mf)({
|
||||
classroom_category: myForm.getFieldsValue()
|
||||
}).then(function (res) {
|
||||
if ((res === null || res === void 0 ? void 0 : res.status) == 0) {
|
||||
message/* default */.ZP.success('新增成功');
|
||||
getData(true);
|
||||
}
|
||||
setOpenMyModal(false);
|
||||
myForm.resetFields();
|
||||
});
|
||||
}
|
||||
case 3:
|
||||
case "end":
|
||||
return _context2.stop();
|
||||
}
|
||||
}, _callee2);
|
||||
})),
|
||||
onCancel: function onCancel() {
|
||||
setOpenMyModal(false);
|
||||
myForm.resetFields();
|
||||
},
|
||||
children: /*#__PURE__*/(0,jsx_runtime.jsxs)(es_form/* default */.Z, {
|
||||
className: ItemAssetsTypemodules.formWrap,
|
||||
form: myForm,
|
||||
wrapperCol: {
|
||||
span: 20
|
||||
},
|
||||
children: [/*#__PURE__*/(0,jsx_runtime.jsx)(es_form/* default */.Z.Item, {
|
||||
colon: false,
|
||||
labelCol: {
|
||||
span: 4
|
||||
},
|
||||
label: "\u7C7B\u522B\u540D\u79F0",
|
||||
name: "title",
|
||||
rules: [{
|
||||
required: true,
|
||||
message: '请输入类别名称'
|
||||
}],
|
||||
style: {
|
||||
marginTop: '20px',
|
||||
marginBottom: '10px'
|
||||
},
|
||||
children: /*#__PURE__*/(0,jsx_runtime.jsx)(input/* default */.Z, {
|
||||
style: {
|
||||
height: '40px'
|
||||
},
|
||||
maxLength: 50,
|
||||
showCount: true,
|
||||
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, {
|
||||
colon: false,
|
||||
labelCol: {
|
||||
span: 4
|
||||
},
|
||||
label: "\u98CE\u9669\u70B9",
|
||||
name: "title1",
|
||||
style: {
|
||||
marginTop: '20px',
|
||||
marginBottom: '10px'
|
||||
},
|
||||
children: /*#__PURE__*/(0,jsx_runtime.jsx)(input/* default */.Z, {
|
||||
style: {
|
||||
height: '40px'
|
||||
},
|
||||
onChange: function onChange(e) {
|
||||
var _e$target2;
|
||||
myForm.setFieldValue('title1', e === null || e === void 0 || (_e$target2 = e.target) === null || _e$target2 === void 0 || (_e$target2 = _e$target2.value) === null || _e$target2 === void 0 ? void 0 : _e$target2.trim());
|
||||
}
|
||||
})
|
||||
})]
|
||||
})
|
||||
})]
|
||||
});
|
||||
};
|
||||
/* harmony default export */ var ItemAssetsType = ((0,_umi_production_exports.connect)(function (_ref3) {
|
||||
var loading = _ref3.loading,
|
||||
engineeringNavigtion = _ref3.engineeringNavigtion;
|
||||
return objectSpread2_default()({
|
||||
loading: loading
|
||||
}, engineeringNavigtion);
|
||||
})(Navigation));
|
||||
|
||||
/***/ })
|
||||
|
||||
}]);
|
||||
File diff suppressed because it is too large
Load Diff
@ -0,0 +1,552 @@
|
||||
"use strict";
|
||||
(self["webpackChunk"] = self["webpackChunk"] || []).push([[25807],{
|
||||
|
||||
/***/ 17040:
|
||||
/*!*************************************************************!*\
|
||||
!*** ./src/pages/Materials/MyProcure/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 */ MyProcure; }
|
||||
});
|
||||
|
||||
// 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/toConsumableArray.js
|
||||
var toConsumableArray = __webpack_require__(37205);
|
||||
var toConsumableArray_default = /*#__PURE__*/__webpack_require__.n(toConsumableArray);
|
||||
// EXTERNAL MODULE: ./node_modules/_@babel_runtime@7.23.6@@babel/runtime/helpers/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__(44742);
|
||||
;// CONCATENATED MODULE: ./src/pages/Materials/MyProcure/index.less?modules
|
||||
// extracted by mini-css-extract-plugin
|
||||
/* harmony default export */ var MyProcuremodules = ({"header_div":"header_div___Wlpv4","header_title":"header_title___Ke5eh","search":"search___TCi9C","searchIcon":"searchIcon___aj2zp","clear_Data":"clear_Data___alPld","batch":"batch___AYgkR","btns":"btns___Hq8qk","btn":"btn___fFGnN"});
|
||||
// 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/form/index.js + 19 modules
|
||||
var es_form = __webpack_require__(78241);
|
||||
// EXTERNAL MODULE: ./node_modules/_antd@5.9.0@antd/es/select/index.js
|
||||
var es_select = __webpack_require__(57809);
|
||||
// EXTERNAL MODULE: ./node_modules/_antd@5.9.0@antd/es/input/index.js + 5 modules
|
||||
var input = __webpack_require__(20008);
|
||||
// EXTERNAL MODULE: ./node_modules/_antd@5.9.0@antd/es/table/index.js + 85 modules
|
||||
var table = __webpack_require__(86383);
|
||||
// EXTERNAL MODULE: ./node_modules/_antd@5.9.0@antd/es/pagination/index.js + 10 modules
|
||||
var pagination = __webpack_require__(36697);
|
||||
// EXTERNAL MODULE: ./src/service/laboratory.ts
|
||||
var service_laboratory = __webpack_require__(66754);
|
||||
// EXTERNAL MODULE: ./node_modules/_antd@5.9.0@antd/es/input/TextArea.js
|
||||
var TextArea = __webpack_require__(1643);
|
||||
// EXTERNAL MODULE: ./node_modules/_react@17.0.2@react/jsx-runtime.js
|
||||
var jsx_runtime = __webpack_require__(37712);
|
||||
;// CONCATENATED MODULE: ./src/pages/Materials/MyProcure/index.tsx
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
var Navigation = function Navigation(_ref) {
|
||||
var loading = _ref.loading,
|
||||
dispatch = _ref.dispatch;
|
||||
var _useState = (0,_react_17_0_2_react.useState)(),
|
||||
_useState2 = slicedToArray_default()(_useState, 2),
|
||||
keyword = _useState2[0],
|
||||
setkeyword = _useState2[1];
|
||||
var _useState3 = (0,_react_17_0_2_react.useState)(''),
|
||||
_useState4 = slicedToArray_default()(_useState3, 2),
|
||||
reason = _useState4[0],
|
||||
setReason = _useState4[1];
|
||||
var countRef = (0,_react_17_0_2_react.useRef)(reason);
|
||||
countRef.current = reason;
|
||||
|
||||
//预约数据
|
||||
var _useState5 = (0,_react_17_0_2_react.useState)([]),
|
||||
_useState6 = slicedToArray_default()(_useState5, 2),
|
||||
tableData = _useState6[0],
|
||||
setTableData = _useState6[1];
|
||||
var columns = [{
|
||||
title: '房间名称',
|
||||
dataIndex: 'title',
|
||||
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() {
|
||||
_umi_production_exports.history.push("/laboratory/reservations/".concat(record === null || record === void 0 ? void 0 : record.id, "/info?index=laboratoryRoom"));
|
||||
},
|
||||
children: text || '--'
|
||||
})
|
||||
});
|
||||
}
|
||||
}, {
|
||||
title: '预约权限',
|
||||
dataIndex: 'permission',
|
||||
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 == '0' ? '学生' : text == '1' ? '教师(已认证)' : '学生、教师(已认证)'
|
||||
})
|
||||
});
|
||||
}
|
||||
}, {
|
||||
title: '状态',
|
||||
dataIndex: 'status',
|
||||
ellipsis: true,
|
||||
render: function render(text) {
|
||||
return /*#__PURE__*/(0,jsx_runtime.jsx)(tooltip/* default */.Z, {
|
||||
placement: "bottomLeft",
|
||||
title: text,
|
||||
children: text == '0' ? /*#__PURE__*/(0,jsx_runtime.jsx)("span", {
|
||||
style: {
|
||||
color: '#FA6400'
|
||||
},
|
||||
children: "\u5DF2\u542F\u7528"
|
||||
}) : /*#__PURE__*/(0,jsx_runtime.jsx)("span", {
|
||||
style: {
|
||||
color: '#000000'
|
||||
},
|
||||
children: "\u5DF2\u7981\u7528"
|
||||
})
|
||||
});
|
||||
}
|
||||
}, {
|
||||
title: '使用面积',
|
||||
dataIndex: 'area',
|
||||
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 ? "".concat(text, "\u5E73\u65B9\u7C73") : '--'
|
||||
})
|
||||
});
|
||||
}
|
||||
}, {
|
||||
title: '工位数量',
|
||||
dataIndex: 'work_num',
|
||||
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: 'classroom_title',
|
||||
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: '操作',
|
||||
ellipsis: true,
|
||||
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() {
|
||||
setRoomId(record === null || record === void 0 ? void 0 : record.id);
|
||||
_umi_production_exports.history.push("/laboratory/laboratoryRoom/".concat(record === null || record === void 0 ? void 0 : record.id));
|
||||
},
|
||||
children: "\u7F16\u8F91"
|
||||
}), /*#__PURE__*/(0,jsx_runtime.jsx)("span", {
|
||||
style: {
|
||||
color: "#5F6367",
|
||||
marginLeft: "10px",
|
||||
cursor: "pointer"
|
||||
},
|
||||
onClick: function onClick() {
|
||||
modal/* default */.Z.confirm({
|
||||
centered: true,
|
||||
okText: '确定',
|
||||
cancelText: '取消',
|
||||
title: "提示",
|
||||
content: "\u8BF7\u786E\u8BA4\u662F\u5426\u5220\u9664".concat(record === null || record === void 0 ? void 0 : record.title, "\u7684\u76F8\u5173\u4FE1\u606F\uFF1F\u5220\u9664\u7684\u4FE1\u606F\u5C06\u65E0\u6CD5\u6062\u590D\u3002"),
|
||||
onOk: function () {
|
||||
var _onOk = asyncToGenerator_default()( /*#__PURE__*/regeneratorRuntime_default()().mark(function _callee() {
|
||||
return regeneratorRuntime_default()().wrap(function _callee$(_context) {
|
||||
while (1) switch (_context.prev = _context.next) {
|
||||
case 0:
|
||||
(0,service_laboratory/* classroom_rooms_delete */.L7)({
|
||||
id: record === null || record === void 0 ? void 0 : record.id
|
||||
}).then(function (res) {
|
||||
if (res.status === 0) {
|
||||
message/* default */.ZP.success('删除成功');
|
||||
getData(true);
|
||||
}
|
||||
});
|
||||
case 1:
|
||||
case "end":
|
||||
return _context.stop();
|
||||
}
|
||||
}, _callee);
|
||||
}));
|
||||
function onOk() {
|
||||
return _onOk.apply(this, arguments);
|
||||
}
|
||||
return onOk;
|
||||
}()
|
||||
});
|
||||
},
|
||||
children: "\u5220\u9664"
|
||||
}), (record === null || record === void 0 ? void 0 : record.status) == 1 && /*#__PURE__*/(0,jsx_runtime.jsx)("span", {
|
||||
style: {
|
||||
color: "#165DFF",
|
||||
marginLeft: "10px",
|
||||
cursor: "pointer"
|
||||
},
|
||||
onClick: function onClick() {
|
||||
modal/* default */.Z.confirm({
|
||||
centered: true,
|
||||
okText: '确定',
|
||||
cancelText: '取消',
|
||||
icon: null,
|
||||
title: "确认启用房间",
|
||||
content: "\u60A8\u9009\u4E2D\u7684\u623F\u95F4\u5373\u5C06\u542F\u7528\uFF0C\u542F\u7528\u540E\uFF0C\u5177\u5907\u9884\u7EA6\u6743\u9650\u7684\u7528\u6237\u80FD\u591F\u8FDB\u884C\u623F\u95F4\u7684\u9884\u7EA6\u548C\u4F7F\u7528\u3002",
|
||||
onOk: function () {
|
||||
var _onOk2 = asyncToGenerator_default()( /*#__PURE__*/regeneratorRuntime_default()().mark(function _callee2() {
|
||||
return regeneratorRuntime_default()().wrap(function _callee2$(_context2) {
|
||||
while (1) switch (_context2.prev = _context2.next) {
|
||||
case 0:
|
||||
(0,service_laboratory/* rooms_enable */.KB)({
|
||||
classroom_room_ids: [record === null || record === void 0 ? void 0 : record.id]
|
||||
}).then(function (res) {
|
||||
if (res.status === 0) {
|
||||
message/* default */.ZP.success('启用成功');
|
||||
getData(true);
|
||||
}
|
||||
});
|
||||
case 1:
|
||||
case "end":
|
||||
return _context2.stop();
|
||||
}
|
||||
}, _callee2);
|
||||
}));
|
||||
function onOk() {
|
||||
return _onOk2.apply(this, arguments);
|
||||
}
|
||||
return onOk;
|
||||
}()
|
||||
});
|
||||
},
|
||||
children: "\u542F\u7528"
|
||||
}), (record === null || record === void 0 ? void 0 : record.status) == 0 && /*#__PURE__*/(0,jsx_runtime.jsx)("span", {
|
||||
style: {
|
||||
color: "#165DFF",
|
||||
marginLeft: "10px",
|
||||
cursor: "pointer"
|
||||
},
|
||||
onClick: function onClick() {
|
||||
modal/* default */.Z.confirm({
|
||||
centered: true,
|
||||
okText: '确定',
|
||||
cancelText: '取消',
|
||||
icon: null,
|
||||
title: "确认禁用房间",
|
||||
content: /*#__PURE__*/(0,jsx_runtime.jsxs)("div", {
|
||||
children: [/*#__PURE__*/(0,jsx_runtime.jsx)("div", {
|
||||
children: record !== null && record !== void 0 && record.has_reservation ? '您选中的房间中存在用户预约,如禁用房间将自动取消预约,请通知相关用户取消预约的原因:' : '您选中的房间即将禁用,禁用后,用户不能进行房间的预约和使用。'
|
||||
}), (record === null || record === void 0 ? void 0 : record.has_reservation) && /*#__PURE__*/(0,jsx_runtime.jsx)(TextArea/* default */.Z, {
|
||||
placeholder: "\u8BF7\u586B\u5199\u53D6\u6D88\u9884\u7EA6\u7684\u539F\u56E0",
|
||||
className: "mt10",
|
||||
onChange: function onChange(e) {
|
||||
var _e$target;
|
||||
setReason(e === null || e === void 0 || (_e$target = e.target) === null || _e$target === void 0 ? void 0 : _e$target.value);
|
||||
}
|
||||
})]
|
||||
}),
|
||||
onOk: function () {
|
||||
var _onOk3 = asyncToGenerator_default()( /*#__PURE__*/regeneratorRuntime_default()().mark(function _callee3() {
|
||||
return regeneratorRuntime_default()().wrap(function _callee3$(_context3) {
|
||||
while (1) switch (_context3.prev = _context3.next) {
|
||||
case 0:
|
||||
(0,service_laboratory/* rooms_disable */.Y_)({
|
||||
classroom_room_ids: [record === null || record === void 0 ? void 0 : record.id],
|
||||
reason: countRef.current
|
||||
}).then(function (res) {
|
||||
if (res.status === 0) {
|
||||
message/* default */.ZP.success('禁用成功');
|
||||
getData(true);
|
||||
}
|
||||
});
|
||||
case 1:
|
||||
case "end":
|
||||
return _context3.stop();
|
||||
}
|
||||
}, _callee3);
|
||||
}));
|
||||
function onOk() {
|
||||
return _onOk3.apply(this, arguments);
|
||||
}
|
||||
return onOk;
|
||||
}()
|
||||
});
|
||||
},
|
||||
children: "\u7981\u7528"
|
||||
})]
|
||||
});
|
||||
}
|
||||
}];
|
||||
|
||||
//分页
|
||||
var _useState7 = (0,_react_17_0_2_react.useState)(0),
|
||||
_useState8 = slicedToArray_default()(_useState7, 2),
|
||||
total = _useState8[0],
|
||||
setTotal = _useState8[1];
|
||||
var _useState9 = (0,_react_17_0_2_react.useState)(1),
|
||||
_useState10 = slicedToArray_default()(_useState9, 2),
|
||||
page = _useState10[0],
|
||||
setPage = _useState10[1];
|
||||
var _useState11 = (0,_react_17_0_2_react.useState)(10),
|
||||
_useState12 = slicedToArray_default()(_useState11, 2),
|
||||
limit = _useState12[0],
|
||||
setLimit = _useState12[1];
|
||||
var _useState13 = (0,_react_17_0_2_react.useState)(null),
|
||||
_useState14 = slicedToArray_default()(_useState13, 2),
|
||||
roomId = _useState14[0],
|
||||
setRoomId = _useState14[1];
|
||||
|
||||
//实验室
|
||||
var _useState15 = (0,_react_17_0_2_react.useState)([]),
|
||||
_useState16 = slicedToArray_default()(_useState15, 2),
|
||||
laboratoryLists = _useState16[0],
|
||||
setLaboratoryLists = _useState16[1];
|
||||
var _useState17 = (0,_react_17_0_2_react.useState)(''),
|
||||
_useState18 = slicedToArray_default()(_useState17, 2),
|
||||
laboratory = _useState18[0],
|
||||
setLaboratory = _useState18[1];
|
||||
var _useState19 = (0,_react_17_0_2_react.useState)(''),
|
||||
_useState20 = slicedToArray_default()(_useState19, 2),
|
||||
status = _useState20[0],
|
||||
setStatus = _useState20[1];
|
||||
(0,_react_17_0_2_react.useEffect)(function () {
|
||||
//实验室列表
|
||||
(0,service_laboratory/* classroom_query */.GJ)({
|
||||
page: 1,
|
||||
limit: 10000,
|
||||
keyword: ''
|
||||
}).then(function (res) {
|
||||
var _res$data;
|
||||
setLaboratoryLists([{
|
||||
id: '',
|
||||
title: '全部'
|
||||
}].concat(toConsumableArray_default()(res === null || res === void 0 || (_res$data = res.data) === null || _res$data === void 0 ? void 0 : _res$data.list)));
|
||||
});
|
||||
dispatch({
|
||||
type: 'globalSetting/footerToggle',
|
||||
payload: false
|
||||
});
|
||||
return function () {
|
||||
dispatch({
|
||||
type: 'globalSetting/footerToggle',
|
||||
payload: true
|
||||
});
|
||||
};
|
||||
}, []);
|
||||
(0,_react_17_0_2_react.useEffect)(function () {
|
||||
getData(false);
|
||||
}, [page, limit]);
|
||||
(0,_react_17_0_2_react.useEffect)(function () {
|
||||
getData(true);
|
||||
}, [keyword, status, laboratory]);
|
||||
var getData = function getData(flag) {
|
||||
if (flag) {
|
||||
setPage(1);
|
||||
}
|
||||
(0,service_laboratory/* classroom_rooms_query */.jd)({
|
||||
page: page,
|
||||
limit: limit,
|
||||
keyword: keyword,
|
||||
classroom_id: laboratory,
|
||||
status: status
|
||||
}).then(function (res) {
|
||||
var _res$data2, _res$data3;
|
||||
setTotal(res === null || res === void 0 || (_res$data2 = res.data) === null || _res$data2 === void 0 ? void 0 : _res$data2.count);
|
||||
setTableData(res === null || res === void 0 || (_res$data3 = res.data) === null || _res$data3 === void 0 || (_res$data3 = _res$data3.list) === null || _res$data3 === void 0 ? void 0 : _res$data3.map(function (item) {
|
||||
item.key = item === null || item === void 0 ? void 0 : item.id;
|
||||
return item;
|
||||
}));
|
||||
});
|
||||
};
|
||||
var onShowSizeChange = function onShowSizeChange(page, size) {
|
||||
setPage(page);
|
||||
setLimit(size);
|
||||
};
|
||||
return /*#__PURE__*/(0,jsx_runtime.jsxs)("div", {
|
||||
children: [/*#__PURE__*/(0,jsx_runtime.jsxs)("div", {
|
||||
className: MyProcuremodules.header_div,
|
||||
children: [/*#__PURE__*/(0,jsx_runtime.jsx)("div", {
|
||||
className: MyProcuremodules.header_title,
|
||||
children: "\u5B9E\u9A8C\u5BA4\u623F\u95F4"
|
||||
}), /*#__PURE__*/(0,jsx_runtime.jsx)(es_form/* default */.Z.Item, {
|
||||
colon: false,
|
||||
label: "\u7533\u8BF7\u5B9E\u9A8C\u5BA4",
|
||||
style: {
|
||||
marginLeft: 'auto'
|
||||
},
|
||||
children: /*#__PURE__*/(0,jsx_runtime.jsx)(es_select["default"], {
|
||||
style: {
|
||||
width: 160
|
||||
},
|
||||
defaultValue: laboratory,
|
||||
value: laboratory,
|
||||
onChange: function onChange(e) {
|
||||
setLaboratory(e);
|
||||
},
|
||||
children: laboratoryLists === null || laboratoryLists === void 0 ? void 0 : laboratoryLists.map(function (item, index) {
|
||||
return /*#__PURE__*/(0,jsx_runtime.jsx)(es_select["default"].Option, {
|
||||
value: item === null || item === void 0 ? void 0 : item.id,
|
||||
children: item === null || item === void 0 ? void 0 : item.title
|
||||
}, index);
|
||||
})
|
||||
})
|
||||
}), /*#__PURE__*/(0,jsx_runtime.jsx)(es_form/* default */.Z.Item, {
|
||||
colon: false,
|
||||
label: "\u72B6\u6001",
|
||||
style: {
|
||||
marginLeft: '20px'
|
||||
},
|
||||
children: /*#__PURE__*/(0,jsx_runtime.jsxs)(es_select["default"], {
|
||||
style: {
|
||||
width: 100
|
||||
},
|
||||
defaultValue: status,
|
||||
value: status,
|
||||
onChange: function onChange(e) {
|
||||
setStatus(e);
|
||||
},
|
||||
children: [/*#__PURE__*/(0,jsx_runtime.jsx)(es_select["default"].Option, {
|
||||
value: "",
|
||||
children: "\u5168\u90E8"
|
||||
}), /*#__PURE__*/(0,jsx_runtime.jsx)(es_select["default"].Option, {
|
||||
value: "0",
|
||||
children: "\u5DF2\u542F\u7528"
|
||||
}), /*#__PURE__*/(0,jsx_runtime.jsx)(es_select["default"].Option, {
|
||||
value: "1",
|
||||
children: "\u5DF2\u7981\u7528"
|
||||
})]
|
||||
})
|
||||
}), /*#__PURE__*/(0,jsx_runtime.jsx)(input/* default */.Z.Search, {
|
||||
placeholder: "\u8BF7\u8F93\u5165\u623F\u95F4\u540D\u79F0\u641C\u7D22",
|
||||
size: "large",
|
||||
className: MyProcuremodules.search,
|
||||
value: keyword,
|
||||
onChange: function onChange(e) {
|
||||
setkeyword(e.target.value);
|
||||
},
|
||||
onSearch: function onSearch(value) {
|
||||
setkeyword(value);
|
||||
},
|
||||
suffix: /*#__PURE__*/(0,jsx_runtime.jsx)("i", {
|
||||
className: "iconfont icon-sousuo9 font14 ".concat(MyProcuremodules.searchIcon),
|
||||
onClick: function onClick() {
|
||||
setkeyword(keyword);
|
||||
getData(true);
|
||||
}
|
||||
})
|
||||
})]
|
||||
}), /*#__PURE__*/(0,jsx_runtime.jsx)("div", {
|
||||
className: MyProcuremodules.search_params
|
||||
}), /*#__PURE__*/(0,jsx_runtime.jsx)(table/* default */.Z, {
|
||||
pagination: false,
|
||||
dataSource: tableData,
|
||||
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", {
|
||||
children: /*#__PURE__*/(0,jsx_runtime.jsxs)("span", {
|
||||
style: {
|
||||
color: '#656F87'
|
||||
},
|
||||
children: ["\u5171", /*#__PURE__*/(0,jsx_runtime.jsx)("span", {
|
||||
className: "c-light-primary",
|
||||
children: total
|
||||
}), "\u6761\u6570\u636E"]
|
||||
})
|
||||
}), /*#__PURE__*/(0,jsx_runtime.jsx)(pagination/* default */.Z, {
|
||||
showSizeChanger: true,
|
||||
showQuickJumper: true,
|
||||
onChange: onShowSizeChange,
|
||||
defaultCurrent: 1,
|
||||
pageSizeOptions: ['10', '20', '50', '100'],
|
||||
current: page || 1,
|
||||
pageSize: limit || 10,
|
||||
defaultPageSize: 10,
|
||||
total: total
|
||||
})]
|
||||
}) : ''
|
||||
})]
|
||||
});
|
||||
};
|
||||
/* harmony default export */ var MyProcure = ((0,_umi_production_exports.connect)(function (_ref2) {
|
||||
var loading = _ref2.loading,
|
||||
engineeringNavigtion = _ref2.engineeringNavigtion,
|
||||
dispatch = _ref2.dispatch;
|
||||
return objectSpread2_default()(objectSpread2_default()({
|
||||
loading: loading
|
||||
}, engineeringNavigtion), {}, {
|
||||
dispatch: dispatch
|
||||
});
|
||||
})(Navigation));
|
||||
|
||||
/***/ })
|
||||
|
||||
}]);
|
||||
File diff suppressed because it is too large
Load Diff
File diff suppressed because one or more lines are too long
Loading…
Reference in new issue