|
|
"use strict";
|
|
|
(self["webpackChunk"] = self["webpackChunk"] || []).push([[98936],{
|
|
|
|
|
|
/***/ 38460:
|
|
|
/*!*****************************************************************!*\
|
|
|
!*** ./src/pages/Laboratory/MyLaboratory/index.tsx + 2 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 */ MyLaboratory; }
|
|
|
});
|
|
|
|
|
|
// 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__(80608);
|
|
|
;// CONCATENATED MODULE: ./src/pages/Laboratory/MyLaboratory/index.less?modules
|
|
|
// extracted by mini-css-extract-plugin
|
|
|
/* harmony default export */ var MyLaboratorymodules = ({"header_div":"header_div___LVX8g","header_title":"header_title___Do4wf","search":"search___ko4yU","searchIcon":"searchIcon___yBH7g","add_Data":"add_Data___KK34L","clear_Data":"clear_Data___ZIIz9","upload_modal":"upload_modal___ubHlR","modal_moban":"modal_moban___XbOLn","xiazai":"xiazai___IZfWx","modal_shangchuan":"modal_shangchuan___QZNSG","shangchuan":"shangchuan___wmbUM","geshi":"geshi___EkfuA","formWrap":"formWrap___MYHHs","tag_style":"tag_style___H4cnt","fuzeren":"fuzeren___f4nsv"});
|
|
|
// 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/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/select/index.js
|
|
|
var es_select = __webpack_require__(57809);
|
|
|
// 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/table/index.js + 85 modules
|
|
|
var table = __webpack_require__(51945);
|
|
|
// EXTERNAL MODULE: ./node_modules/_antd@5.9.0@antd/es/pagination/index.js + 10 modules
|
|
|
var pagination = __webpack_require__(86859);
|
|
|
// EXTERNAL MODULE: ./node_modules/_antd@5.9.0@antd/es/tag/index.js + 5 modules
|
|
|
var tag = __webpack_require__(12563);
|
|
|
// EXTERNAL MODULE: ./src/service/laboratory.ts
|
|
|
var laboratory = __webpack_require__(70974);
|
|
|
// EXTERNAL MODULE: ./src/utils/util.tsx
|
|
|
var util = __webpack_require__(27876);
|
|
|
// EXTERNAL MODULE: ./src/utils/env.ts + 1 modules
|
|
|
var env = __webpack_require__(71681);
|
|
|
;// CONCATENATED MODULE: ./src/pages/Laboratory/MyLaboratory/laboratory_module.xlsx
|
|
|
var laboratory_module_namespaceObject = __webpack_require__.p + "static/laboratory_module.c4d3d816.xlsx";
|
|
|
// 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: ./node_modules/_react@17.0.2@react/jsx-runtime.js
|
|
|
var jsx_runtime = __webpack_require__(37712);
|
|
|
;// CONCATENATED MODULE: ./src/pages/Laboratory/MyLaboratory/index.tsx
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
var Dragger = upload/* default */.Z.Dragger;
|
|
|
var Navigation = function Navigation(_ref) {
|
|
|
var _user$userInfo, _ref2, _user$userInfo2;
|
|
|
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 _useState3 = (0,_react_17_0_2_react.useState)([]),
|
|
|
_useState4 = slicedToArray_default()(_useState3, 2),
|
|
|
tableData = _useState4[0],
|
|
|
setTableData = _useState4[1];
|
|
|
var _useState5 = (0,_react_17_0_2_react.useState)(''),
|
|
|
_useState6 = slicedToArray_default()(_useState5, 2),
|
|
|
laboratoryCenter = _useState6[0],
|
|
|
setLaboratoryCenter = _useState6[1];
|
|
|
|
|
|
//分页
|
|
|
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)(false),
|
|
|
_useState14 = slicedToArray_default()(_useState13, 2),
|
|
|
isLoading = _useState14[0],
|
|
|
setIsLoading = _useState14[1];
|
|
|
|
|
|
//导入
|
|
|
var _useState15 = (0,_react_17_0_2_react.useState)(false),
|
|
|
_useState16 = slicedToArray_default()(_useState15, 2),
|
|
|
openUpload = _useState16[0],
|
|
|
setOpenUpload = _useState16[1];
|
|
|
var _Form$useForm = es_form/* default */.Z.useForm(),
|
|
|
_Form$useForm2 = slicedToArray_default()(_Form$useForm, 1),
|
|
|
myForm = _Form$useForm2[0];
|
|
|
var _useState17 = (0,_react_17_0_2_react.useState)([]),
|
|
|
_useState18 = slicedToArray_default()(_useState17, 2),
|
|
|
fileList = _useState18[0],
|
|
|
setFileList = _useState18[1];
|
|
|
|
|
|
//新增
|
|
|
var _useState19 = (0,_react_17_0_2_react.useState)(false),
|
|
|
_useState20 = slicedToArray_default()(_useState19, 2),
|
|
|
openMyModal = _useState20[0],
|
|
|
setOpenMyModal = _useState20[1];
|
|
|
var _useState21 = (0,_react_17_0_2_react.useState)([]),
|
|
|
_useState22 = slicedToArray_default()(_useState21, 2),
|
|
|
directorsList = _useState22[0],
|
|
|
setDirectorsList = _useState22[1];
|
|
|
var _useState23 = (0,_react_17_0_2_react.useState)([]),
|
|
|
_useState24 = slicedToArray_default()(_useState23, 2),
|
|
|
centerList = _useState24[0],
|
|
|
setCenterList = _useState24[1];
|
|
|
var _useState25 = (0,_react_17_0_2_react.useState)([]),
|
|
|
_useState26 = slicedToArray_default()(_useState25, 2),
|
|
|
typeList = _useState26[0],
|
|
|
setTypeList = _useState26[1];
|
|
|
var _useState27 = (0,_react_17_0_2_react.useState)(''),
|
|
|
_useState28 = slicedToArray_default()(_useState27, 2),
|
|
|
centerId = _useState28[0],
|
|
|
setCenterId = _useState28[1];
|
|
|
(0,_react_17_0_2_react.useEffect)(function () {
|
|
|
getData(false);
|
|
|
}, [page]);
|
|
|
(0,_react_17_0_2_react.useEffect)(function () {
|
|
|
getData(true);
|
|
|
}, [keyword, laboratoryCenter, limit]);
|
|
|
(0,_react_17_0_2_react.useEffect)(function () {
|
|
|
//负责人
|
|
|
(0,laboratory/* directors_query */.C0)({}).then(function (res) {
|
|
|
var _res$data;
|
|
|
setDirectorsList(res === null || res === void 0 || (_res$data = res.data) === null || _res$data === void 0 ? void 0 : _res$data.list);
|
|
|
});
|
|
|
//实验室中心
|
|
|
(0,laboratory/* classroom_centers_query */.Jv)({
|
|
|
page: 1,
|
|
|
limit: 10000
|
|
|
}).then(function (res) {
|
|
|
var _res$data2;
|
|
|
setCenterList(res === null || res === void 0 || (_res$data2 = res.data) === null || _res$data2 === void 0 ? void 0 : _res$data2.list);
|
|
|
});
|
|
|
//实验室分类
|
|
|
(0,laboratory/* classroom_categories_query */.mU)({
|
|
|
page: 1,
|
|
|
limit: 10000
|
|
|
}).then(function (res) {
|
|
|
var _res$data3;
|
|
|
setTypeList(res === null || res === void 0 || (_res$data3 = res.data) === null || _res$data3 === void 0 ? void 0 : _res$data3.list);
|
|
|
});
|
|
|
}, []);
|
|
|
var getData = function getData(flag) {
|
|
|
if (flag) {
|
|
|
setPage(1);
|
|
|
}
|
|
|
(0,laboratory/* classroom_query */.GJ)({
|
|
|
page: page,
|
|
|
limit: limit,
|
|
|
keyword: keyword,
|
|
|
classroom_center_id: laboratoryCenter
|
|
|
}).then(function (res) {
|
|
|
var _res$data4, _res$data5;
|
|
|
setTableData(res === null || res === void 0 || (_res$data4 = res.data) === null || _res$data4 === void 0 ? void 0 : _res$data4.list);
|
|
|
setTotal(res === null || res === void 0 || (_res$data5 = res.data) === null || _res$data5 === void 0 ? void 0 : _res$data5.count);
|
|
|
});
|
|
|
};
|
|
|
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/myLaboratory/".concat(record === null || record === void 0 ? void 0 : record.id, "/info"));
|
|
|
},
|
|
|
children: text || '--'
|
|
|
})
|
|
|
});
|
|
|
}
|
|
|
}, {
|
|
|
title: '所属实验室中心',
|
|
|
dataIndex: 'classroom_center_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: 'classroom_category_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: 'nature',
|
|
|
ellipsis: true,
|
|
|
render: function render(text) {
|
|
|
return /*#__PURE__*/(0,jsx_runtime.jsx)(tooltip/* default */.Z, {
|
|
|
placement: "bottomLeft",
|
|
|
title: text == '0' ? '专业' : '普通',
|
|
|
children: /*#__PURE__*/(0,jsx_runtime.jsx)("span", {
|
|
|
children: text == '0' ? '专业' : '普通' || 0
|
|
|
})
|
|
|
});
|
|
|
}
|
|
|
}, {
|
|
|
title: '使用总面积',
|
|
|
dataIndex: 'area',
|
|
|
ellipsis: true,
|
|
|
render: function render(text) {
|
|
|
return text ? text + '平方米' : '--';
|
|
|
}
|
|
|
}, {
|
|
|
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: '',
|
|
|
// ellipsis: true,
|
|
|
// render: (text: string) => {
|
|
|
// return (
|
|
|
// <Tooltip placement="bottomLeft" title={text}>
|
|
|
// <span>{text || '--'}</span>
|
|
|
// </Tooltip>
|
|
|
// );
|
|
|
// },
|
|
|
// },
|
|
|
{
|
|
|
title: '负责人',
|
|
|
dataIndex: 'directors',
|
|
|
ellipsis: true,
|
|
|
render: function render(text, record) {
|
|
|
var _record$directors, _record$directors2;
|
|
|
return (record === null || record === void 0 || (_record$directors = record.directors) === null || _record$directors === void 0 ? void 0 : _record$directors.length) > 0 ? record === null || record === void 0 || (_record$directors2 = record.directors) === null || _record$directors2 === void 0 ? void 0 : _record$directors2.map(function (item, index) {
|
|
|
var _record$directors3;
|
|
|
return /*#__PURE__*/(0,jsx_runtime.jsx)(tooltip/* default */.Z, {
|
|
|
title: /*#__PURE__*/(0,jsx_runtime.jsxs)("div", {
|
|
|
style: {
|
|
|
padding: "0 10px"
|
|
|
},
|
|
|
children: [/*#__PURE__*/(0,jsx_runtime.jsxs)("div", {
|
|
|
style: {
|
|
|
marginTop: '10px'
|
|
|
},
|
|
|
children: ["\u8D1F\u8D23\u4EBA", /*#__PURE__*/(0,jsx_runtime.jsx)("span", {
|
|
|
style: {
|
|
|
marginLeft: '10px'
|
|
|
},
|
|
|
children: (item === null || item === void 0 ? void 0 : item.name) || '--'
|
|
|
})]
|
|
|
}), /*#__PURE__*/(0,jsx_runtime.jsxs)("div", {
|
|
|
style: {
|
|
|
marginTop: '10px'
|
|
|
},
|
|
|
children: ["\u624B\u673A\u53F7", /*#__PURE__*/(0,jsx_runtime.jsx)("span", {
|
|
|
style: {
|
|
|
marginLeft: '10px'
|
|
|
},
|
|
|
children: (item === null || item === void 0 ? void 0 : item.phone) || '--'
|
|
|
})]
|
|
|
}), /*#__PURE__*/(0,jsx_runtime.jsxs)("div", {
|
|
|
style: {
|
|
|
marginTop: '10px',
|
|
|
marginBottom: '10px'
|
|
|
},
|
|
|
children: ["\u90AE\u7BB1\u53F7", /*#__PURE__*/(0,jsx_runtime.jsx)("span", {
|
|
|
style: {
|
|
|
marginLeft: '10px'
|
|
|
},
|
|
|
children: (item === null || item === void 0 ? void 0 : item.mail) || '--'
|
|
|
})]
|
|
|
})]
|
|
|
}),
|
|
|
children: /*#__PURE__*/(0,jsx_runtime.jsx)("span", {
|
|
|
className: MyLaboratorymodules.fuzeren,
|
|
|
children: (item === null || item === void 0 ? void 0 : item.name) + (index == (record === null || record === void 0 || (_record$directors3 = record.directors) === null || _record$directors3 === void 0 ? void 0 : _record$directors3.length) - 1 ? '' : '、')
|
|
|
}, item === null || item === void 0 ? void 0 : item.id)
|
|
|
});
|
|
|
}) : '--';
|
|
|
}
|
|
|
}, {
|
|
|
title: '建立时间',
|
|
|
dataIndex: 'created_at',
|
|
|
ellipsis: true,
|
|
|
render: function render(text) {
|
|
|
return text ? dayjs_min_default()(text).format('YYYY-MM-DD') : '--';
|
|
|
}
|
|
|
}, (user === null || user === void 0 || (_user$userInfo = user.userInfo) === null || _user$userInfo === void 0 ? void 0 : _user$userInfo.classroom_center_auth) && {
|
|
|
title: '操作',
|
|
|
ellipsis: true,
|
|
|
width: 100,
|
|
|
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$directors4;
|
|
|
console.log(record);
|
|
|
setCenterId(record === null || record === void 0 ? void 0 : record.id);
|
|
|
myForm.setFieldsValue({
|
|
|
title: record === null || record === void 0 ? void 0 : record.title,
|
|
|
director_ids: record === null || record === void 0 || (_record$directors4 = record.directors) === null || _record$directors4 === void 0 ? void 0 : _record$directors4.map(function (item) {
|
|
|
return item === null || item === void 0 ? void 0 : item.id;
|
|
|
}),
|
|
|
classroom_center_id: record === null || record === void 0 ? void 0 : record.classroom_center_id,
|
|
|
classroom_category_id: record === null || record === void 0 ? void 0 : record.classroom_category_id,
|
|
|
nature: record === null || record === void 0 ? void 0 : record.nature
|
|
|
});
|
|
|
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: "\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"),
|
|
|
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_delete */.Uk)({
|
|
|
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"
|
|
|
})]
|
|
|
});
|
|
|
}
|
|
|
}].filter(function (item) {
|
|
|
return !!item;
|
|
|
});
|
|
|
var onShowSizeChange = function onShowSizeChange(page, size) {
|
|
|
setPage(page);
|
|
|
setLimit(size);
|
|
|
};
|
|
|
var Draggers = {
|
|
|
onRemove: function onRemove() {
|
|
|
setFileList([]);
|
|
|
},
|
|
|
beforeUpload: function beforeUpload(file) {
|
|
|
if ((file === null || file === void 0 ? void 0 : file.size) > 1024 * 1024 * 50) {
|
|
|
message/* default */.ZP.info('文件超过50M,不符合上传要求');
|
|
|
return false;
|
|
|
}
|
|
|
var filelist = [];
|
|
|
filelist.push(file);
|
|
|
setFileList([].concat(filelist));
|
|
|
return false;
|
|
|
},
|
|
|
fileList: fileList,
|
|
|
accept: ".xls,.xlsx"
|
|
|
};
|
|
|
|
|
|
// const filterOption = (input: string, option?: { label: string; value: string }) =>
|
|
|
// (option?.label ?? '').toLowerCase().includes(input.toLowerCase());
|
|
|
var filterOption = function filterOption(input, option) {
|
|
|
var _option$label, _option$phone;
|
|
|
var label = ((_option$label = option === null || option === void 0 ? void 0 : option.label) !== null && _option$label !== void 0 ? _option$label : '').toLowerCase();
|
|
|
var phone = ((_option$phone = option === null || option === void 0 ? void 0 : option.phone) !== null && _option$phone !== void 0 ? _option$phone : '').toLowerCase();
|
|
|
var search = input.toLowerCase();
|
|
|
return label.includes(search) || phone.includes(search);
|
|
|
};
|
|
|
return /*#__PURE__*/(0,jsx_runtime.jsxs)("div", {
|
|
|
children: [/*#__PURE__*/(0,jsx_runtime.jsxs)("div", {
|
|
|
className: MyLaboratorymodules.header_div,
|
|
|
children: [/*#__PURE__*/(0,jsx_runtime.jsx)("div", {
|
|
|
className: MyLaboratorymodules.header_title,
|
|
|
children: "\u6211\u7684\u5B9E\u9A8C\u5BA4"
|
|
|
}), /*#__PURE__*/(0,jsx_runtime.jsx)(es_form/* default */.Z.Item, {
|
|
|
colon: false,
|
|
|
label: "\u5B9E\u9A8C\u5BA4\u4E2D\u5FC3",
|
|
|
style: {
|
|
|
marginLeft: 'auto'
|
|
|
},
|
|
|
children: /*#__PURE__*/(0,jsx_runtime.jsx)(es_select["default"], {
|
|
|
style: {
|
|
|
width: 160
|
|
|
},
|
|
|
defaultValue: laboratoryCenter,
|
|
|
value: laboratoryCenter,
|
|
|
onChange: function onChange(e) {
|
|
|
setLaboratoryCenter(e);
|
|
|
},
|
|
|
children: (_ref2 = [{
|
|
|
id: '',
|
|
|
title: '全部'
|
|
|
}].concat(toConsumableArray_default()(centerList))) === null || _ref2 === void 0 ? void 0 : _ref2.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)(input/* default */.Z.Search, {
|
|
|
placeholder: "\u8BF7\u8F93\u5165\u5B9E\u9A8C\u5BA4\u540D\u79F0/\u8D1F\u8D23\u4EBA\u59D3\u540D\u641C\u7D22",
|
|
|
size: "large",
|
|
|
className: MyLaboratorymodules.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(MyLaboratorymodules.searchIcon),
|
|
|
onClick: function onClick() {
|
|
|
setkeyword(keyword);
|
|
|
getData(true);
|
|
|
}
|
|
|
})
|
|
|
}), (user === null || user === void 0 || (_user$userInfo2 = user.userInfo) === null || _user$userInfo2 === void 0 ? void 0 : _user$userInfo2.classroom_center_auth) && /*#__PURE__*/(0,jsx_runtime.jsxs)(jsx_runtime.Fragment, {
|
|
|
children: [/*#__PURE__*/(0,jsx_runtime.jsx)("div", {
|
|
|
className: MyLaboratorymodules.add_Data,
|
|
|
onClick: function onClick() {
|
|
|
setOpenMyModal(true);
|
|
|
setCenterId('');
|
|
|
},
|
|
|
children: "\u65B0\u5EFA\u5B9E\u9A8C\u5BA4"
|
|
|
}), /*#__PURE__*/(0,jsx_runtime.jsx)("div", {
|
|
|
className: MyLaboratorymodules.clear_Data,
|
|
|
onClick: function onClick() {
|
|
|
setOpenUpload(true);
|
|
|
},
|
|
|
children: "\u6279\u91CF\u5BFC\u5165"
|
|
|
}), /*#__PURE__*/(0,jsx_runtime.jsx)("div", {
|
|
|
className: MyLaboratorymodules.clear_Data,
|
|
|
onClick: function onClick() {
|
|
|
(0,util/* downLoadFile */.FH)('', (0,util/* setUrlQuery */.NY)({
|
|
|
url: env/* default */.Z.API_SERVER + "/api/yn_classrooms/classrooms/export",
|
|
|
query: {}
|
|
|
}));
|
|
|
},
|
|
|
children: "\u6279\u91CF\u5BFC\u51FA"
|
|
|
})]
|
|
|
})]
|
|
|
}), /*#__PURE__*/(0,jsx_runtime.jsx)(table/* default */.Z, {
|
|
|
loading: isLoading,
|
|
|
pagination: false,
|
|
|
dataSource: tableData,
|
|
|
columns: columns,
|
|
|
scroll: {
|
|
|
x: 1300
|
|
|
}
|
|
|
}), /*#__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.jsxs)(modal/* default */.Z, {
|
|
|
maskClosable: false,
|
|
|
centered: true,
|
|
|
keyboard: false,
|
|
|
destroyOnClose: true,
|
|
|
className: MyLaboratorymodules.upload_modal,
|
|
|
open: openUpload,
|
|
|
title: "\u6279\u91CF\u5BFC\u5165\u5B9E\u9A8C\u5BA4",
|
|
|
width: "500px",
|
|
|
onOk: /*#__PURE__*/asyncToGenerator_default()( /*#__PURE__*/regeneratorRuntime_default()().mark(function _callee2() {
|
|
|
var formData;
|
|
|
return regeneratorRuntime_default()().wrap(function _callee2$(_context2) {
|
|
|
while (1) switch (_context2.prev = _context2.next) {
|
|
|
case 0:
|
|
|
formData = new FormData();
|
|
|
formData.append('file', fileList === null || fileList === void 0 ? void 0 : fileList[0]);
|
|
|
(0,laboratory/* classroom_import */.$u)(formData).then(function (res) {
|
|
|
var _res$fail;
|
|
|
if ((res === null || res === void 0 || (_res$fail = res.fail) === null || _res$fail === void 0 ? void 0 : _res$fail.length) > 0) {
|
|
|
modal/* default */.Z.info({
|
|
|
title: "批量导入失败信息",
|
|
|
icon: null,
|
|
|
okText: "确认",
|
|
|
width: 600,
|
|
|
centered: true,
|
|
|
onOk: function onOk() {
|
|
|
getData(true);
|
|
|
},
|
|
|
content: /*#__PURE__*/(0,jsx_runtime.jsx)(table/* default */.Z, {
|
|
|
scroll: {
|
|
|
y: 300
|
|
|
},
|
|
|
pagination: false,
|
|
|
dataSource: res === null || res === void 0 ? void 0 : res.fail,
|
|
|
columns: [{
|
|
|
title: '实验室名称',
|
|
|
dataIndex: 'title',
|
|
|
ellipsis: true
|
|
|
}, {
|
|
|
title: '导入失败原因',
|
|
|
dataIndex: 'message',
|
|
|
ellipsis: true
|
|
|
}]
|
|
|
})
|
|
|
});
|
|
|
} else if ((res === null || res === void 0 ? void 0 : res.status) == 0) {
|
|
|
message/* default */.ZP.success('导入成功');
|
|
|
getData(true);
|
|
|
} else {
|
|
|
getData(true);
|
|
|
}
|
|
|
});
|
|
|
setFileList([]);
|
|
|
setOpenUpload(false);
|
|
|
case 5:
|
|
|
case "end":
|
|
|
return _context2.stop();
|
|
|
}
|
|
|
}, _callee2);
|
|
|
})),
|
|
|
onCancel: function onCancel() {
|
|
|
setOpenUpload(false);
|
|
|
setFileList([]);
|
|
|
},
|
|
|
children: [/*#__PURE__*/(0,jsx_runtime.jsxs)("div", {
|
|
|
className: MyLaboratorymodules.modal_moban,
|
|
|
children: [/*#__PURE__*/(0,jsx_runtime.jsxs)("div", {
|
|
|
style: {
|
|
|
padding: '20px'
|
|
|
},
|
|
|
children: ["1.\u4E0B\u8F7D\u5BFC\u5165\u6A21\u7248", /*#__PURE__*/(0,jsx_runtime.jsx)("span", {
|
|
|
style: {
|
|
|
color: '#999999',
|
|
|
marginLeft: '10px'
|
|
|
},
|
|
|
children: "\uFF08\u6839\u636E\u63D0\u793A\u4FE1\u606F\u5B8C\u5584\u8868\u683C\u5185\u5BB9\uFF09"
|
|
|
})]
|
|
|
}), /*#__PURE__*/(0,jsx_runtime.jsxs)("div", {
|
|
|
className: MyLaboratorymodules.xiazai,
|
|
|
onClick: function onClick() {
|
|
|
(0,util/* downLoadFile */.FH)('实验室模版', (0,util/* setUrlQuery */.NY)({
|
|
|
url: laboratory_module_namespaceObject,
|
|
|
query: {}
|
|
|
}));
|
|
|
},
|
|
|
children: [/*#__PURE__*/(0,jsx_runtime.jsx)("i", {
|
|
|
className: "iconfont icon-xiazai4 mr5"
|
|
|
}), "\u4E0B\u8F7D\u6A21\u7248\u8868\u683C"]
|
|
|
})]
|
|
|
}), /*#__PURE__*/(0,jsx_runtime.jsxs)("div", {
|
|
|
className: MyLaboratorymodules.modal_shangchuan,
|
|
|
children: [/*#__PURE__*/(0,jsx_runtime.jsx)("div", {
|
|
|
style: {
|
|
|
padding: '20px'
|
|
|
},
|
|
|
children: "2.\u4E0A\u4F20\u5B8C\u5584\u540E\u7684\u6A21\u7248"
|
|
|
}), /*#__PURE__*/(0,jsx_runtime.jsxs)(Dragger, objectSpread2_default()(objectSpread2_default()({}, Draggers), {}, {
|
|
|
children: [/*#__PURE__*/(0,jsx_runtime.jsx)("div", {
|
|
|
className: MyLaboratorymodules.shangchuan,
|
|
|
children: "\u9009\u62E9\u6587\u4EF6"
|
|
|
}), /*#__PURE__*/(0,jsx_runtime.jsx)("div", {
|
|
|
className: MyLaboratorymodules.geshi,
|
|
|
children: "\u4E0B\u8F7D\u6A21\u677F\u5E76\u5B8C\u5584\u4FE1\u606F\u540E\uFF0C\u53EF\u5C06\u6587\u4EF6\u62D6\u66F3\u81F3\u6B64\u5904\u4E0A\u4F20\u3001\u652F\u6301\u683C\u5F0F\uFF1A.xls\u3001.xlsx"
|
|
|
})]
|
|
|
}))]
|
|
|
})]
|
|
|
}), /*#__PURE__*/(0,jsx_runtime.jsx)(modal/* default */.Z, {
|
|
|
maskClosable: false,
|
|
|
centered: true,
|
|
|
keyboard: false,
|
|
|
destroyOnClose: true,
|
|
|
className: MyLaboratorymodules.my_modal,
|
|
|
open: openMyModal,
|
|
|
title: "".concat(centerId ? '编辑' : '新建', "\u5B9E\u9A8C\u5BA4"),
|
|
|
width: "600px",
|
|
|
onOk: /*#__PURE__*/asyncToGenerator_default()( /*#__PURE__*/regeneratorRuntime_default()().mark(function _callee3() {
|
|
|
return regeneratorRuntime_default()().wrap(function _callee3$(_context3) {
|
|
|
while (1) switch (_context3.prev = _context3.next) {
|
|
|
case 0:
|
|
|
_context3.next = 2;
|
|
|
return myForm.validateFields();
|
|
|
case 2:
|
|
|
if (centerId) {
|
|
|
(0,laboratory/* classroom_update */.KS)({
|
|
|
id: centerId,
|
|
|
classroom: 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 === null || myForm === void 0 || myForm.resetFields();
|
|
|
}
|
|
|
});
|
|
|
} else {
|
|
|
(0,laboratory/* classroom_create */.W1)({
|
|
|
classroom: 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 === null || myForm === void 0 || myForm.resetFields();
|
|
|
}
|
|
|
});
|
|
|
}
|
|
|
case 3:
|
|
|
case "end":
|
|
|
return _context3.stop();
|
|
|
}
|
|
|
}, _callee3);
|
|
|
})),
|
|
|
onCancel: function onCancel() {
|
|
|
setOpenMyModal(false);
|
|
|
myForm === null || myForm === void 0 || myForm.resetFields();
|
|
|
},
|
|
|
children: /*#__PURE__*/(0,jsx_runtime.jsxs)(es_form/* default */.Z, {
|
|
|
className: MyLaboratorymodules.formWrap,
|
|
|
form: myForm,
|
|
|
labelCol: {
|
|
|
span: 5
|
|
|
},
|
|
|
wrapperCol: {
|
|
|
span: 19
|
|
|
},
|
|
|
style: {
|
|
|
marginTop: '20px'
|
|
|
},
|
|
|
children: [/*#__PURE__*/(0,jsx_runtime.jsx)(es_form/* default */.Z.Item, {
|
|
|
colon: false,
|
|
|
label: "\u5B9E\u9A8C\u5BA4\u540D\u79F0",
|
|
|
name: "title",
|
|
|
rules: [{
|
|
|
required: true,
|
|
|
message: '请输入实验室名称'
|
|
|
}],
|
|
|
children: /*#__PURE__*/(0,jsx_runtime.jsx)(input/* default */.Z, {
|
|
|
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,
|
|
|
label: "\u6240\u5C5E\u5B9E\u9A8C\u5BA4\u4E2D\u5FC3",
|
|
|
name: "classroom_center_id",
|
|
|
rules: [{
|
|
|
required: true,
|
|
|
message: '请选择所属实验室中心'
|
|
|
}],
|
|
|
children: /*#__PURE__*/(0,jsx_runtime.jsx)(es_select["default"], {
|
|
|
children: centerList === null || centerList === void 0 ? void 0 : centerList.map(function (item, key) {
|
|
|
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) || '--'
|
|
|
}, key);
|
|
|
})
|
|
|
})
|
|
|
}), /*#__PURE__*/(0,jsx_runtime.jsx)(es_form/* default */.Z.Item, {
|
|
|
colon: false,
|
|
|
label: "\u5B9E\u9A8C\u5BA4\u5206\u7C7B",
|
|
|
name: "classroom_category_id",
|
|
|
children: /*#__PURE__*/(0,jsx_runtime.jsx)(es_select["default"], {
|
|
|
children: typeList === null || typeList === void 0 ? void 0 : typeList.map(function (item, key) {
|
|
|
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) || '--'
|
|
|
}, key);
|
|
|
})
|
|
|
})
|
|
|
}), /*#__PURE__*/(0,jsx_runtime.jsx)(es_form/* default */.Z.Item, {
|
|
|
colon: false,
|
|
|
label: "\u5B9E\u9A8C\u5BA4\u6027\u8D28",
|
|
|
name: "nature",
|
|
|
children: /*#__PURE__*/(0,jsx_runtime.jsxs)(es_select["default"], {
|
|
|
children: [/*#__PURE__*/(0,jsx_runtime.jsx)(es_select["default"].Option, {
|
|
|
value: 0,
|
|
|
children: "\u4E13\u4E1A"
|
|
|
}), /*#__PURE__*/(0,jsx_runtime.jsx)(es_select["default"].Option, {
|
|
|
value: 1,
|
|
|
children: "\u666E\u901A"
|
|
|
})]
|
|
|
})
|
|
|
}), /*#__PURE__*/(0,jsx_runtime.jsx)(es_form/* default */.Z.Item, {
|
|
|
colon: false,
|
|
|
label: "\u8D1F\u8D23\u4EBA",
|
|
|
name: "director_ids",
|
|
|
rules: [{
|
|
|
required: true,
|
|
|
message: '请选择负责人'
|
|
|
}],
|
|
|
children: /*#__PURE__*/(0,jsx_runtime.jsx)(es_select["default"], {
|
|
|
showSearch: true,
|
|
|
mode: "multiple",
|
|
|
filterOption: filterOption,
|
|
|
tagRender: function tagRender(props) {
|
|
|
var label = props.label,
|
|
|
value = props.value,
|
|
|
closable = props.closable,
|
|
|
onClose = props.onClose;
|
|
|
var director = directorsList.find(function (item) {
|
|
|
return item.id === value;
|
|
|
});
|
|
|
return /*#__PURE__*/(0,jsx_runtime.jsx)(tag/* default */.Z, {
|
|
|
closable: closable,
|
|
|
onClose: onClose,
|
|
|
className: MyLaboratorymodules.tag_style,
|
|
|
children: director === null || director === void 0 ? void 0 : director.name
|
|
|
}, value);
|
|
|
},
|
|
|
children: directorsList === null || directorsList === void 0 ? void 0 : directorsList.map(function (item, key) {
|
|
|
return /*#__PURE__*/(0,jsx_runtime.jsx)(es_select["default"].Option, {
|
|
|
value: item === null || item === void 0 ? void 0 : item.id,
|
|
|
label: item === null || item === void 0 ? void 0 : item.name,
|
|
|
phone: item === null || item === void 0 ? void 0 : item.phone,
|
|
|
children: /*#__PURE__*/(0,jsx_runtime.jsxs)("div", {
|
|
|
style: {
|
|
|
display: "flex"
|
|
|
},
|
|
|
children: [(item === null || item === void 0 ? void 0 : item.name) || '--', /*#__PURE__*/(0,jsx_runtime.jsx)("div", {
|
|
|
style: {
|
|
|
marginLeft: "auto"
|
|
|
},
|
|
|
children: (item === null || item === void 0 ? void 0 : item.phone) || '--'
|
|
|
})]
|
|
|
})
|
|
|
}, key);
|
|
|
})
|
|
|
})
|
|
|
})]
|
|
|
})
|
|
|
})]
|
|
|
});
|
|
|
};
|
|
|
/* harmony default export */ var MyLaboratory = ((0,_umi_production_exports.connect)(function (_ref5) {
|
|
|
var loading = _ref5.loading,
|
|
|
engineeringNavigtion = _ref5.engineeringNavigtion,
|
|
|
user = _ref5.user;
|
|
|
return objectSpread2_default()(objectSpread2_default()({
|
|
|
loading: loading
|
|
|
}, engineeringNavigtion), {}, {
|
|
|
user: user
|
|
|
});
|
|
|
})(Navigation));
|
|
|
|
|
|
/***/ }),
|
|
|
|
|
|
/***/ 12563:
|
|
|
/*!*******************************************************************!*\
|
|
|
!*** ./node_modules/_antd@5.9.0@antd/es/tag/index.js + 5 modules ***!
|
|
|
\*******************************************************************/
|
|
|
/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
|
|
|
|
|
|
|
|
|
// EXPORTS
|
|
|
__webpack_require__.d(__webpack_exports__, {
|
|
|
Z: function() { return /* binding */ tag; }
|
|
|
});
|
|
|
|
|
|
// EXTERNAL MODULE: ./node_modules/_react@17.0.2@react/index.js
|
|
|
var _react_17_0_2_react = __webpack_require__(59301);
|
|
|
// EXTERNAL MODULE: ./node_modules/_@ant-design_icons@5.4.0@@ant-design/icons/es/icons/CloseOutlined.js + 1 modules
|
|
|
var CloseOutlined = __webpack_require__(53043);
|
|
|
// EXTERNAL MODULE: ./node_modules/_classnames@2.5.1@classnames/index.js
|
|
|
var _classnames_2_5_1_classnames = __webpack_require__(92310);
|
|
|
var _classnames_2_5_1_classnames_default = /*#__PURE__*/__webpack_require__.n(_classnames_2_5_1_classnames);
|
|
|
// EXTERNAL MODULE: ./node_modules/_antd@5.9.0@antd/es/_util/colors.js
|
|
|
var colors = __webpack_require__(36785);
|
|
|
// EXTERNAL MODULE: ./node_modules/_antd@5.9.0@antd/es/_util/hooks/useClosable.js
|
|
|
var useClosable = __webpack_require__(47729);
|
|
|
// EXTERNAL MODULE: ./node_modules/_antd@5.9.0@antd/es/_util/wave/index.js + 4 modules
|
|
|
var wave = __webpack_require__(14088);
|
|
|
// EXTERNAL MODULE: ./node_modules/_antd@5.9.0@antd/es/config-provider/context.js
|
|
|
var context = __webpack_require__(36355);
|
|
|
// EXTERNAL MODULE: ./node_modules/_antd@5.9.0@antd/es/style/index.js
|
|
|
var style = __webpack_require__(17313);
|
|
|
// EXTERNAL MODULE: ./node_modules/_antd@5.9.0@antd/es/theme/util/statistic.js
|
|
|
var statistic = __webpack_require__(37613);
|
|
|
// EXTERNAL MODULE: ./node_modules/_antd@5.9.0@antd/es/theme/util/genComponentStyleHook.js
|
|
|
var genComponentStyleHook = __webpack_require__(83116);
|
|
|
;// CONCATENATED MODULE: ./node_modules/_antd@5.9.0@antd/es/tag/style/index.js
|
|
|
|
|
|
|
|
|
// ============================== Styles ==============================
|
|
|
const genBaseStyle = token => {
|
|
|
const {
|
|
|
paddingXXS,
|
|
|
lineWidth,
|
|
|
tagPaddingHorizontal,
|
|
|
componentCls
|
|
|
} = token;
|
|
|
const paddingInline = tagPaddingHorizontal - lineWidth;
|
|
|
const iconMarginInline = paddingXXS - lineWidth;
|
|
|
return {
|
|
|
// Result
|
|
|
[componentCls]: Object.assign(Object.assign({}, (0,style/* resetComponent */.Wf)(token)), {
|
|
|
display: 'inline-block',
|
|
|
height: 'auto',
|
|
|
marginInlineEnd: token.marginXS,
|
|
|
paddingInline,
|
|
|
fontSize: token.tagFontSize,
|
|
|
lineHeight: token.tagLineHeight,
|
|
|
whiteSpace: 'nowrap',
|
|
|
background: token.defaultBg,
|
|
|
border: `${token.lineWidth}px ${token.lineType} ${token.colorBorder}`,
|
|
|
borderRadius: token.borderRadiusSM,
|
|
|
opacity: 1,
|
|
|
transition: `all ${token.motionDurationMid}`,
|
|
|
textAlign: 'start',
|
|
|
position: 'relative',
|
|
|
// RTL
|
|
|
[`&${componentCls}-rtl`]: {
|
|
|
direction: 'rtl'
|
|
|
},
|
|
|
'&, a, a:hover': {
|
|
|
color: token.defaultColor
|
|
|
},
|
|
|
[`${componentCls}-close-icon`]: {
|
|
|
marginInlineStart: iconMarginInline,
|
|
|
color: token.colorTextDescription,
|
|
|
fontSize: token.tagIconSize,
|
|
|
cursor: 'pointer',
|
|
|
transition: `all ${token.motionDurationMid}`,
|
|
|
'&:hover': {
|
|
|
color: token.colorTextHeading
|
|
|
}
|
|
|
},
|
|
|
[`&${componentCls}-has-color`]: {
|
|
|
borderColor: 'transparent',
|
|
|
[`&, a, a:hover, ${token.iconCls}-close, ${token.iconCls}-close:hover`]: {
|
|
|
color: token.colorTextLightSolid
|
|
|
}
|
|
|
},
|
|
|
[`&-checkable`]: {
|
|
|
backgroundColor: 'transparent',
|
|
|
borderColor: 'transparent',
|
|
|
cursor: 'pointer',
|
|
|
[`&:not(${componentCls}-checkable-checked):hover`]: {
|
|
|
color: token.colorPrimary,
|
|
|
backgroundColor: token.colorFillSecondary
|
|
|
},
|
|
|
'&:active, &-checked': {
|
|
|
color: token.colorTextLightSolid
|
|
|
},
|
|
|
'&-checked': {
|
|
|
backgroundColor: token.colorPrimary,
|
|
|
'&:hover': {
|
|
|
backgroundColor: token.colorPrimaryHover
|
|
|
}
|
|
|
},
|
|
|
'&:active': {
|
|
|
backgroundColor: token.colorPrimaryActive
|
|
|
}
|
|
|
},
|
|
|
[`&-hidden`]: {
|
|
|
display: 'none'
|
|
|
},
|
|
|
// To ensure that a space will be placed between character and `Icon`.
|
|
|
[`> ${token.iconCls} + span, > span + ${token.iconCls}`]: {
|
|
|
marginInlineStart: paddingInline
|
|
|
}
|
|
|
}),
|
|
|
[`${componentCls}-borderless`]: {
|
|
|
borderColor: 'transparent',
|
|
|
background: token.tagBorderlessBg
|
|
|
}
|
|
|
};
|
|
|
};
|
|
|
// ============================== Export ==============================
|
|
|
const prepareToken = token => {
|
|
|
const {
|
|
|
lineWidth,
|
|
|
fontSizeIcon
|
|
|
} = token;
|
|
|
const tagFontSize = token.fontSizeSM;
|
|
|
const tagLineHeight = `${token.lineHeightSM * tagFontSize}px`;
|
|
|
const tagToken = (0,statistic/* merge */.TS)(token, {
|
|
|
tagFontSize,
|
|
|
tagLineHeight,
|
|
|
tagIconSize: fontSizeIcon - 2 * lineWidth,
|
|
|
tagPaddingHorizontal: 8,
|
|
|
tagBorderlessBg: token.colorFillTertiary
|
|
|
});
|
|
|
return tagToken;
|
|
|
};
|
|
|
const prepareCommonToken = token => ({
|
|
|
defaultBg: token.colorFillQuaternary,
|
|
|
defaultColor: token.colorText
|
|
|
});
|
|
|
/* harmony default export */ var tag_style = ((0,genComponentStyleHook/* default */.Z)('Tag', token => {
|
|
|
const tagToken = prepareToken(token);
|
|
|
return genBaseStyle(tagToken);
|
|
|
}, prepareCommonToken));
|
|
|
;// CONCATENATED MODULE: ./node_modules/_antd@5.9.0@antd/es/tag/CheckableTag.js
|
|
|
"use client";
|
|
|
|
|
|
var __rest = undefined && undefined.__rest || function (s, e) {
|
|
|
var t = {};
|
|
|
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0) t[p] = s[p];
|
|
|
if (s != null && typeof Object.getOwnPropertySymbols === "function") for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
|
|
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i])) t[p[i]] = s[p[i]];
|
|
|
}
|
|
|
return t;
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
const CheckableTag = props => {
|
|
|
const {
|
|
|
prefixCls: customizePrefixCls,
|
|
|
style,
|
|
|
className,
|
|
|
checked,
|
|
|
onChange,
|
|
|
onClick
|
|
|
} = props,
|
|
|
restProps = __rest(props, ["prefixCls", "style", "className", "checked", "onChange", "onClick"]);
|
|
|
const {
|
|
|
getPrefixCls,
|
|
|
tag
|
|
|
} = _react_17_0_2_react.useContext(context/* ConfigContext */.E_);
|
|
|
const handleClick = e => {
|
|
|
onChange === null || onChange === void 0 ? void 0 : onChange(!checked);
|
|
|
onClick === null || onClick === void 0 ? void 0 : onClick(e);
|
|
|
};
|
|
|
const prefixCls = getPrefixCls('tag', customizePrefixCls);
|
|
|
// Style
|
|
|
const [wrapSSR, hashId] = tag_style(prefixCls);
|
|
|
const cls = _classnames_2_5_1_classnames_default()(prefixCls, `${prefixCls}-checkable`, {
|
|
|
[`${prefixCls}-checkable-checked`]: checked
|
|
|
}, tag === null || tag === void 0 ? void 0 : tag.className, className, hashId);
|
|
|
return wrapSSR( /*#__PURE__*/_react_17_0_2_react.createElement("span", Object.assign({}, restProps, {
|
|
|
style: Object.assign(Object.assign({}, style), tag === null || tag === void 0 ? void 0 : tag.style),
|
|
|
className: cls,
|
|
|
onClick: handleClick
|
|
|
})));
|
|
|
};
|
|
|
/* harmony default export */ var tag_CheckableTag = (CheckableTag);
|
|
|
// EXTERNAL MODULE: ./node_modules/_antd@5.9.0@antd/es/theme/util/genPresetColor.js
|
|
|
var genPresetColor = __webpack_require__(45157);
|
|
|
;// CONCATENATED MODULE: ./node_modules/_antd@5.9.0@antd/es/tag/style/presetCmp.js
|
|
|
// Style as status component
|
|
|
|
|
|
|
|
|
// ============================== Preset ==============================
|
|
|
const genPresetStyle = token => (0,genPresetColor/* default */.Z)(token, (colorKey, _ref) => {
|
|
|
let {
|
|
|
textColor,
|
|
|
lightBorderColor,
|
|
|
lightColor,
|
|
|
darkColor
|
|
|
} = _ref;
|
|
|
return {
|
|
|
[`${token.componentCls}-${colorKey}`]: {
|
|
|
color: textColor,
|
|
|
background: lightColor,
|
|
|
borderColor: lightBorderColor,
|
|
|
// Inverse color
|
|
|
'&-inverse': {
|
|
|
color: token.colorTextLightSolid,
|
|
|
background: darkColor,
|
|
|
borderColor: darkColor
|
|
|
},
|
|
|
[`&${token.componentCls}-borderless`]: {
|
|
|
borderColor: 'transparent'
|
|
|
}
|
|
|
}
|
|
|
};
|
|
|
});
|
|
|
// ============================== Export ==============================
|
|
|
/* harmony default export */ var presetCmp = ((0,genComponentStyleHook/* genSubStyleComponent */.b)(['Tag', 'preset'], token => {
|
|
|
const tagToken = prepareToken(token);
|
|
|
return genPresetStyle(tagToken);
|
|
|
}, prepareCommonToken));
|
|
|
;// CONCATENATED MODULE: ./node_modules/_antd@5.9.0@antd/es/_util/capitalize.js
|
|
|
function capitalize(str) {
|
|
|
if (typeof str !== 'string') {
|
|
|
return str;
|
|
|
}
|
|
|
const ret = str.charAt(0).toUpperCase() + str.slice(1);
|
|
|
return ret;
|
|
|
}
|
|
|
;// CONCATENATED MODULE: ./node_modules/_antd@5.9.0@antd/es/tag/style/statusCmp.js
|
|
|
|
|
|
|
|
|
|
|
|
const genTagStatusStyle = (token, status, cssVariableType) => {
|
|
|
const capitalizedCssVariableType = capitalize(cssVariableType);
|
|
|
return {
|
|
|
[`${token.componentCls}-${status}`]: {
|
|
|
color: token[`color${cssVariableType}`],
|
|
|
background: token[`color${capitalizedCssVariableType}Bg`],
|
|
|
borderColor: token[`color${capitalizedCssVariableType}Border`],
|
|
|
[`&${token.componentCls}-borderless`]: {
|
|
|
borderColor: 'transparent'
|
|
|
}
|
|
|
}
|
|
|
};
|
|
|
};
|
|
|
// ============================== Export ==============================
|
|
|
/* harmony default export */ var statusCmp = ((0,genComponentStyleHook/* genSubStyleComponent */.b)(['Tag', 'status'], token => {
|
|
|
const tagToken = prepareToken(token);
|
|
|
return [genTagStatusStyle(tagToken, 'success', 'Success'), genTagStatusStyle(tagToken, 'processing', 'Info'), genTagStatusStyle(tagToken, 'error', 'Error'), genTagStatusStyle(tagToken, 'warning', 'Warning')];
|
|
|
}, prepareCommonToken));
|
|
|
;// CONCATENATED MODULE: ./node_modules/_antd@5.9.0@antd/es/tag/index.js
|
|
|
"use client";
|
|
|
|
|
|
var tag_rest = undefined && undefined.__rest || function (s, e) {
|
|
|
var t = {};
|
|
|
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0) t[p] = s[p];
|
|
|
if (s != null && typeof Object.getOwnPropertySymbols === "function") for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
|
|
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i])) t[p[i]] = s[p[i]];
|
|
|
}
|
|
|
return t;
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
const InternalTag = (tagProps, ref) => {
|
|
|
const {
|
|
|
prefixCls: customizePrefixCls,
|
|
|
className,
|
|
|
rootClassName,
|
|
|
style,
|
|
|
children,
|
|
|
icon,
|
|
|
color,
|
|
|
onClose,
|
|
|
closeIcon,
|
|
|
closable,
|
|
|
bordered = true
|
|
|
} = tagProps,
|
|
|
props = tag_rest(tagProps, ["prefixCls", "className", "rootClassName", "style", "children", "icon", "color", "onClose", "closeIcon", "closable", "bordered"]);
|
|
|
const {
|
|
|
getPrefixCls,
|
|
|
direction,
|
|
|
tag
|
|
|
} = _react_17_0_2_react.useContext(context/* ConfigContext */.E_);
|
|
|
const [visible, setVisible] = _react_17_0_2_react.useState(true);
|
|
|
// Warning for deprecated usage
|
|
|
if (false) {}
|
|
|
_react_17_0_2_react.useEffect(() => {
|
|
|
if ('visible' in props) {
|
|
|
setVisible(props.visible);
|
|
|
}
|
|
|
}, [props.visible]);
|
|
|
const isPreset = (0,colors/* isPresetColor */.o2)(color);
|
|
|
const isStatus = (0,colors/* isPresetStatusColor */.yT)(color);
|
|
|
const isInternalColor = isPreset || isStatus;
|
|
|
const tagStyle = Object.assign(Object.assign({
|
|
|
backgroundColor: color && !isInternalColor ? color : undefined
|
|
|
}, tag === null || tag === void 0 ? void 0 : tag.style), style);
|
|
|
const prefixCls = getPrefixCls('tag', customizePrefixCls);
|
|
|
// Style
|
|
|
const [wrapSSR, hashId] = tag_style(prefixCls);
|
|
|
const tagClassName = _classnames_2_5_1_classnames_default()(prefixCls, tag === null || tag === void 0 ? void 0 : tag.className, {
|
|
|
[`${prefixCls}-${color}`]: isInternalColor,
|
|
|
[`${prefixCls}-has-color`]: color && !isInternalColor,
|
|
|
[`${prefixCls}-hidden`]: !visible,
|
|
|
[`${prefixCls}-rtl`]: direction === 'rtl',
|
|
|
[`${prefixCls}-borderless`]: !bordered
|
|
|
}, className, rootClassName, hashId);
|
|
|
const handleCloseClick = e => {
|
|
|
e.stopPropagation();
|
|
|
onClose === null || onClose === void 0 ? void 0 : onClose(e);
|
|
|
if (e.defaultPrevented) {
|
|
|
return;
|
|
|
}
|
|
|
setVisible(false);
|
|
|
};
|
|
|
const [, mergedCloseIcon] = (0,useClosable/* default */.Z)(closable, closeIcon, iconNode => iconNode === null ? /*#__PURE__*/_react_17_0_2_react.createElement(CloseOutlined/* default */.Z, {
|
|
|
className: `${prefixCls}-close-icon`,
|
|
|
onClick: handleCloseClick
|
|
|
}) : /*#__PURE__*/_react_17_0_2_react.createElement("span", {
|
|
|
className: `${prefixCls}-close-icon`,
|
|
|
onClick: handleCloseClick
|
|
|
}, iconNode), null, false);
|
|
|
const isNeedWave = typeof props.onClick === 'function' || children && children.type === 'a';
|
|
|
const iconNode = icon || null;
|
|
|
const kids = iconNode ? /*#__PURE__*/_react_17_0_2_react.createElement(_react_17_0_2_react.Fragment, null, iconNode, children && /*#__PURE__*/_react_17_0_2_react.createElement("span", null, children)) : children;
|
|
|
const tagNode = /*#__PURE__*/_react_17_0_2_react.createElement("span", Object.assign({}, props, {
|
|
|
ref: ref,
|
|
|
className: tagClassName,
|
|
|
style: tagStyle
|
|
|
}), kids, mergedCloseIcon, isPreset && /*#__PURE__*/_react_17_0_2_react.createElement(presetCmp, {
|
|
|
key: "preset",
|
|
|
prefixCls: prefixCls
|
|
|
}), isStatus && /*#__PURE__*/_react_17_0_2_react.createElement(statusCmp, {
|
|
|
key: "status",
|
|
|
prefixCls: prefixCls
|
|
|
}));
|
|
|
return wrapSSR(isNeedWave ? /*#__PURE__*/_react_17_0_2_react.createElement(wave/* default */.Z, {
|
|
|
component: "Tag"
|
|
|
}, tagNode) : tagNode);
|
|
|
};
|
|
|
const Tag = /*#__PURE__*/_react_17_0_2_react.forwardRef(InternalTag);
|
|
|
if (false) {}
|
|
|
Tag.CheckableTag = tag_CheckableTag;
|
|
|
/* harmony default export */ var tag = (Tag);
|
|
|
|
|
|
/***/ }),
|
|
|
|
|
|
/***/ 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 */ 81376);
|
|
|
"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);
|
|
|
|
|
|
/***/ })
|
|
|
|
|
|
}]); |