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__Engineering__Lists__Grad...

1567 lines
64 KiB

"use strict";
(self["webpackChunk"] = self["webpackChunk"] || []).push([[34800],{
/***/ 68795:
/*!*******************************************************************************!*\
!*** ./node_modules/@ant-design/icons/es/icons/SearchOutlined.js + 1 modules ***!
\*******************************************************************************/
/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
// EXPORTS
__webpack_require__.d(__webpack_exports__, {
"Z": function() { return /* binding */ icons_SearchOutlined; }
});
// EXTERNAL MODULE: ./node_modules/@babel/runtime/helpers/esm/extends.js
var esm_extends = __webpack_require__(87462);
// EXTERNAL MODULE: ./node_modules/react/index.js
var react = __webpack_require__(67294);
;// CONCATENATED MODULE: ./node_modules/@ant-design/icons-svg/es/asn/SearchOutlined.js
// This icon file is generated automatically.
var SearchOutlined = { "icon": { "tag": "svg", "attrs": { "viewBox": "64 64 896 896", "focusable": "false" }, "children": [{ "tag": "path", "attrs": { "d": "M909.6 854.5L649.9 594.8C690.2 542.7 712 479 712 412c0-80.2-31.3-155.4-87.9-212.1-56.6-56.7-132-87.9-212.1-87.9s-155.5 31.3-212.1 87.9C143.2 256.5 112 331.8 112 412c0 80.1 31.3 155.5 87.9 212.1C256.5 680.8 331.8 712 412 712c67 0 130.6-21.8 182.7-62l259.7 259.6a8.2 8.2 0 0011.6 0l43.6-43.5a8.2 8.2 0 000-11.6zM570.4 570.4C528 612.7 471.8 636 412 636s-116-23.3-158.4-65.6C211.3 528 188 471.8 188 412s23.3-116.1 65.6-158.4C296 211.3 352.2 188 412 188s116.1 23.2 158.4 65.6S636 352.2 636 412s-23.3 116.1-65.6 158.4z" } }] }, "name": "search", "theme": "outlined" };
/* harmony default export */ var asn_SearchOutlined = (SearchOutlined);
// EXTERNAL MODULE: ./node_modules/@ant-design/icons/es/components/AntdIcon.js + 8 modules
var AntdIcon = __webpack_require__(74643);
;// CONCATENATED MODULE: ./node_modules/@ant-design/icons/es/icons/SearchOutlined.js
// GENERATE BY ./scripts/generate.ts
// DON NOT EDIT IT MANUALLY
var SearchOutlined_SearchOutlined = function SearchOutlined(props, ref) {
return /*#__PURE__*/react.createElement(AntdIcon/* default */.Z, (0,esm_extends/* default */.Z)({}, props, {
ref: ref,
icon: asn_SearchOutlined
}));
};
if (false) {}
/* harmony default export */ var icons_SearchOutlined = (/*#__PURE__*/react.forwardRef(SearchOutlined_SearchOutlined));
/***/ }),
/***/ 94594:
/*!***************************************************************************!*\
!*** ./src/pages/Engineering/Lists/GraduatedMatrix/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 */ GraduatedMatrix; }
});
// EXTERNAL MODULE: ./node_modules/@babel/runtime/helpers/objectSpread2.js
var objectSpread2 = __webpack_require__(42122);
var objectSpread2_default = /*#__PURE__*/__webpack_require__.n(objectSpread2);
// EXTERNAL MODULE: ./node_modules/@babel/runtime/helpers/regeneratorRuntime.js
var regeneratorRuntime = __webpack_require__(17061);
var regeneratorRuntime_default = /*#__PURE__*/__webpack_require__.n(regeneratorRuntime);
// EXTERNAL MODULE: ./node_modules/@babel/runtime/helpers/asyncToGenerator.js
var asyncToGenerator = __webpack_require__(17156);
var asyncToGenerator_default = /*#__PURE__*/__webpack_require__.n(asyncToGenerator);
// EXTERNAL MODULE: ./node_modules/@babel/runtime/helpers/slicedToArray.js
var slicedToArray = __webpack_require__(27424);
var slicedToArray_default = /*#__PURE__*/__webpack_require__.n(slicedToArray);
// EXTERNAL MODULE: ./node_modules/react/index.js
var react = __webpack_require__(67294);
;// CONCATENATED MODULE: ./src/pages/Engineering/Lists/GraduatedMatrix/index.less?modules
// extracted by mini-css-extract-plugin
/* harmony default export */ var GraduatedMatrixmodules = ({"flex_box_center":"flex_box_center___jGAtx","flex_space_between":"flex_space_between___Ao895","flex_box_vertical_center":"flex_box_vertical_center___nX_pV","flex_box_center_end":"flex_box_center_end___WN5Kr","flex_box_column":"flex_box_column___d2CEE","wrap":"wrap___R200H","tabWarp":"tabWarp___mqv7U","control":"control___DRROw","label":"label___uGfKS","customTable":"customTable___zTaIe","detail":"detail___zd2LS","table":"table___QYxOF","head":"head___j0vM3","row":"row___LHb1i"});
// EXTERNAL MODULE: ./src/.umi-production/exports.ts + 8 modules
var _umi_production_exports = __webpack_require__(89214);
// EXTERNAL MODULE: ./src/utils/fetch.ts
var fetch = __webpack_require__(84519);
// EXTERNAL MODULE: ./node_modules/lodash/lodash.js
var lodash = __webpack_require__(96486);
// EXTERNAL MODULE: ./node_modules/antd/es/select/index.js + 42 modules
var es_select = __webpack_require__(79035);
// EXTERNAL MODULE: ./node_modules/antd/es/button/index.js
var es_button = __webpack_require__(71577);
// EXTERNAL MODULE: ./node_modules/antd/es/tabs/index.js + 28 modules
var tabs = __webpack_require__(34755);
// EXTERNAL MODULE: ./node_modules/antd/es/spin/index.js + 1 modules
var spin = __webpack_require__(57953);
// EXTERNAL MODULE: ./node_modules/antd/es/tooltip/index.js + 3 modules
var tooltip = __webpack_require__(83062);
// EXTERNAL MODULE: ./node_modules/antd/es/checkbox/index.js + 3 modules
var es_checkbox = __webpack_require__(84567);
// EXTERNAL MODULE: ./node_modules/antd/es/empty/index.js + 3 modules
var empty = __webpack_require__(32983);
// EXTERNAL MODULE: ./src/utils/util.tsx
var util = __webpack_require__(29427);
// EXTERNAL MODULE: ./src/utils/env.ts + 1 modules
var env = __webpack_require__(59758);
// EXTERNAL MODULE: ./src/pages/Engineering/util.tsx
var Engineering_util = __webpack_require__(69555);
// EXTERNAL MODULE: ./src/pages/Engineering/components/Evaluate/index.ts + 4 modules
var Evaluate = __webpack_require__(32337);
// EXTERNAL MODULE: ./node_modules/react/jsx-runtime.js
var jsx_runtime = __webpack_require__(85893);
;// CONCATENATED MODULE: ./src/pages/Engineering/Lists/GraduatedMatrix/index.tsx
var Page = function Page(_ref) {
var _user$userInfo2, _tableData$data, _tableData$data2, _tableData$data2$, _tableData$data2$$ite, _tableData$data3, _tableData$data3$, _tableData$data3$$ite, _tableData$data4;
var user = _ref.user,
dispatch = _ref.dispatch;
var initParams = {
tab: '1',
ec_major_school_id: null,
ec_year_id: null
};
var _useState = (0,react.useState)(initParams),
_useState2 = slicedToArray_default()(_useState, 2),
params = _useState2[0],
setParams = _useState2[1];
var _useState3 = (0,react.useState)([]),
_useState4 = slicedToArray_default()(_useState3, 2),
majorData = _useState4[0],
setMajorData = _useState4[1];
var _useState5 = (0,react.useState)([]),
_useState6 = slicedToArray_default()(_useState5, 2),
yearData = _useState6[0],
setYearData = _useState6[1];
var _useState7 = (0,react.useState)([]),
_useState8 = slicedToArray_default()(_useState7, 2),
tableData = _useState8[0],
setTableData = _useState8[1];
var _useState9 = (0,react.useState)(true),
_useState10 = slicedToArray_default()(_useState9, 2),
loading = _useState10[0],
setLoading = _useState10[1];
var _useState11 = (0,react.useState)(false),
_useState12 = slicedToArray_default()(_useState11, 2),
disabled = _useState12[0],
setDisabled = _useState12[1];
var _useState13 = (0,react.useState)(false),
_useState14 = slicedToArray_default()(_useState13, 2),
verify = _useState14[0],
setVerify = _useState14[1];
var urlParams = (0,_umi_production_exports.useLocation)();
(0,react.useEffect)(function () {
var _user$userInfo;
if (user !== null && user !== void 0 && (_user$userInfo = user.userInfo) !== null && _user$userInfo !== void 0 && _user$userInfo.school_id) {
getMajorData();
}
return function () {
dispatch({
type: 'engineering/setMatrixVerify',
payload: {
key: false,
params: {}
}
});
};
}, [user === null || user === void 0 ? void 0 : (_user$userInfo2 = user.userInfo) === null || _user$userInfo2 === void 0 ? void 0 : _user$userInfo2.school_id]);
var getData = /*#__PURE__*/function () {
var _ref2 = asyncToGenerator_default()( /*#__PURE__*/regeneratorRuntime_default()().mark(function _callee(record, bool) {
var _user$userInfo3;
var sendData, res;
return regeneratorRuntime_default()().wrap(function _callee$(_context) {
while (1) switch (_context.prev = _context.next) {
case 0:
sendData = (0,lodash.cloneDeep)(record);
Engineering_util/* localSelect.setItem */.U.setItem(user === null || user === void 0 ? void 0 : (_user$userInfo3 = user.userInfo) === null || _user$userInfo3 === void 0 ? void 0 : _user$userInfo3.login, [sendData === null || sendData === void 0 ? void 0 : sendData.ec_major_school_id, sendData === null || sendData === void 0 ? void 0 : sendData.ec_year_id]);
delete sendData.tab;
if (!bool) {
setLoading(true);
}
_context.next = 6;
return (0,fetch/* default */.ZP)("/api/ec_years/".concat(params.ec_year_id, "/").concat((record === null || record === void 0 ? void 0 : record.tab) === '1' ? 'requirement_support_objectives' : 'subitem_support_standards', ".json"), {
method: 'get',
params: sendData
});
case 6:
res = _context.sent;
if (res !== null && res !== void 0 && res.data) {
if (res !== null && res !== void 0 && res.standards) {
res.training_subitems = res === null || res === void 0 ? void 0 : res.standards; //统一数据结构
}
setTableData(res || []);
bf((res === null || res === void 0 ? void 0 : res.data) || []);
}
setLoading(false);
case 9:
case "end":
return _context.stop();
}
}, _callee);
}));
return function getData(_x, _x2) {
return _ref2.apply(this, arguments);
};
}();
var bf = function bf(d) {
var bool = false;
for (var i = 0; i < d.length; i++) {
var _d$i, _d$i$item;
if ((_d$i = d[i]) !== null && _d$i !== void 0 && (_d$i$item = _d$i.item) !== null && _d$i$item !== void 0 && _d$i$item.every(function (j) {
return !j.status;
})) {
bool = true;
break;
}
}
dispatch({
type: 'engineering/setMatrixVerify',
payload: {
key: bool,
params: params
}
});
setVerify(bool);
};
var exportExcel = function exportExcel() {
var sendData = (0,lodash.cloneDeep)(params);
delete sendData.tab;
(0,util/* downLoadFile */.FH)('', (0,util/* setUrlQuery */.NY)({
url: env/* default.API_SERVER */.Z.API_SERVER + "/api/ec_years/".concat(params.ec_year_id, "/").concat((params === null || params === void 0 ? void 0 : params.tab) === '1' ? 'requirement_support_objectives' : 'subitem_support_standards', ".xlsx"),
query: sendData
}));
};
var getMajorData = /*#__PURE__*/function () {
var _ref3 = asyncToGenerator_default()( /*#__PURE__*/regeneratorRuntime_default()().mark(function _callee2() {
var _user$userInfo4, _res1$data, _res1$data$, _user$userInfo5, _urlParams$query, _res1$data2, _res1$data2$, _urlParams$query2, _res2$data, _res2$data$;
var res1, item, ec_major_school_id, res2;
return regeneratorRuntime_default()().wrap(function _callee2$(_context2) {
while (1) switch (_context2.prev = _context2.next) {
case 0:
_context2.next = 2;
return (0,fetch/* default */.ZP)("/api/schools/".concat(user === null || user === void 0 ? void 0 : (_user$userInfo4 = user.userInfo) === null || _user$userInfo4 === void 0 ? void 0 : _user$userInfo4.school_id, "/ec_majors/get_major_list.json"), {
method: 'get'
});
case 2:
res1 = _context2.sent;
if (res1 !== null && res1 !== void 0 && (_res1$data = res1.data) !== null && _res1$data !== void 0 && (_res1$data$ = _res1$data[0]) !== null && _res1$data$ !== void 0 && _res1$data$.ec_major_school_id) {
_context2.next = 7;
break;
}
setLoading(false);
setDisabled(true);
return _context2.abrupt("return");
case 7:
item = Engineering_util/* localSelect.getItem */.U.getItem(user === null || user === void 0 ? void 0 : (_user$userInfo5 = user.userInfo) === null || _user$userInfo5 === void 0 ? void 0 : _user$userInfo5.login);
ec_major_school_id = Number(urlParams === null || urlParams === void 0 ? void 0 : (_urlParams$query = urlParams.query) === null || _urlParams$query === void 0 ? void 0 : _urlParams$query.ec_major_school_id) || item[0] || (res1 === null || res1 === void 0 ? void 0 : (_res1$data2 = res1.data) === null || _res1$data2 === void 0 ? void 0 : (_res1$data2$ = _res1$data2[0]) === null || _res1$data2$ === void 0 ? void 0 : _res1$data2$.ec_major_school_id);
_context2.next = 11;
return (0,fetch/* default */.ZP)("/api/ec_major_schools/".concat(ec_major_school_id, "/ec_years/get_year_list.json"), {
method: "get"
});
case 11:
res2 = _context2.sent;
params.ec_major_school_id = ec_major_school_id;
params.ec_year_id = Number(urlParams === null || urlParams === void 0 ? void 0 : (_urlParams$query2 = urlParams.query) === null || _urlParams$query2 === void 0 ? void 0 : _urlParams$query2.ec_year_id) || item[1] || (res2 === null || res2 === void 0 ? void 0 : (_res2$data = res2.data) === null || _res2$data === void 0 ? void 0 : (_res2$data$ = _res2$data[0]) === null || _res2$data$ === void 0 ? void 0 : _res2$data$.ec_year_id);
setMajorData((res1 === null || res1 === void 0 ? void 0 : res1.data) || []);
setYearData((res2 === null || res2 === void 0 ? void 0 : res2.data) || []);
setParams(params);
getData(params);
case 18:
case "end":
return _context2.stop();
}
}, _callee2);
}));
return function getMajorData() {
return _ref3.apply(this, arguments);
};
}();
var getYearData = /*#__PURE__*/function () {
var _ref4 = asyncToGenerator_default()( /*#__PURE__*/regeneratorRuntime_default()().mark(function _callee3(id) {
var _res2$data2, _res2$data2$;
var res2;
return regeneratorRuntime_default()().wrap(function _callee3$(_context3) {
while (1) switch (_context3.prev = _context3.next) {
case 0:
_context3.next = 2;
return (0,fetch/* default */.ZP)("/api/ec_major_schools/".concat(id, "/ec_years/get_year_list.json"), {
method: 'get'
});
case 2:
res2 = _context3.sent;
params.ec_major_school_id = id;
params.ec_year_id = res2 === null || res2 === void 0 ? void 0 : (_res2$data2 = res2.data) === null || _res2$data2 === void 0 ? void 0 : (_res2$data2$ = _res2$data2[0]) === null || _res2$data2$ === void 0 ? void 0 : _res2$data2$.ec_year_id;
setYearData((res2 === null || res2 === void 0 ? void 0 : res2.data) || []);
setParams(params);
getData(params);
case 8:
case "end":
return _context3.stop();
}
}, _callee3);
}));
return function getYearData(_x3) {
return _ref4.apply(this, arguments);
};
}();
var handleSelect = function handleSelect(v, type) {
var put = function put() {
params[type] = v;
if (type === 'ec_major_school_id') {
getYearData(v);
return;
}
if (type === 'ec_year_id') {
setParams(objectSpread2_default()({}, params));
getData(params);
}
};
if (verify) {
(0,Engineering_util/* verifyModal */.t)(put, "\u6BD5\u4E1A\u8981\u6C42\u6307\u6807\u70B9\u5B58\u5728\u6CA1\u6709\u5173\u8054".concat((params === null || params === void 0 ? void 0 : params.tab) === '1' ? '培养目标' : '通用标准', "\uFF0C\u786E\u5B9A\u662F\u5426\u79BB\u5F00\u5F53\u524D\u9875\u9762\uFF1F"));
} else {
put();
}
};
var handleTabsChange = function handleTabsChange(activeKey) {
var put = function put() {
params.tab = activeKey;
setParams(objectSpread2_default()({}, params));
if (isDisabled) return;
getData(params);
};
if (verify) {
(0,Engineering_util/* verifyModal */.t)(put, "\u6BD5\u4E1A\u8981\u6C42\u6307\u6807\u70B9\u5B58\u5728\u6CA1\u6709\u5173\u8054".concat(activeKey === '1' ? '通用标准' : '培养目标', "\uFF0C\u786E\u5B9A\u662F\u5426\u79BB\u5F00\u5F53\u524D\u9875\u9762\uFF1F"));
} else {
put();
}
};
var handleCheck = /*#__PURE__*/function () {
var _ref5 = asyncToGenerator_default()( /*#__PURE__*/regeneratorRuntime_default()().mark(function _callee4(e, r) {
var checked, res;
return regeneratorRuntime_default()().wrap(function _callee4$(_context4) {
while (1) switch (_context4.prev = _context4.next) {
case 0:
checked = e.target.checked;
_context4.next = 3;
return (0,fetch/* default */.ZP)("/api/ec_years/".concat(params.ec_year_id, "/").concat((params === null || params === void 0 ? void 0 : params.tab) === '1' ? 'requirement_support_objectives' : 'subitem_support_standards', ".json"), {
method: checked ? 'post' : 'delete',
body: objectSpread2_default()({}, r)
});
case 3:
res = _context4.sent;
if ((res === null || res === void 0 ? void 0 : res.status) === 0) {
getData(params, true);
}
case 5:
case "end":
return _context4.stop();
}
}, _callee4);
}));
return function handleCheck(_x4, _x5) {
return _ref5.apply(this, arguments);
};
}();
var isDisabled = loading || disabled;
return /*#__PURE__*/(0,jsx_runtime.jsxs)("div", {
className: GraduatedMatrixmodules.wrap,
children: [/*#__PURE__*/(0,jsx_runtime.jsx)(Evaluate/* PanelTitle */.p, {
title: "\u6BD5\u4E1A\u77E9\u9635"
}), /*#__PURE__*/(0,jsx_runtime.jsxs)("div", {
className: GraduatedMatrixmodules.control,
children: [/*#__PURE__*/(0,jsx_runtime.jsx)("div", {
className: GraduatedMatrixmodules.label,
children: "\u8BA4\u8BC1\u4E13\u4E1A"
}), /*#__PURE__*/(0,jsx_runtime.jsx)(es_select/* default */.Z, {
disabled: isDisabled,
style: {
width: 240
},
placeholder: "\u8BF7\u9009\u62E9\u8BA4\u8BC1\u4E13\u4E1A",
value: params === null || params === void 0 ? void 0 : params.ec_major_school_id,
onChange: function onChange(v) {
return handleSelect(v, 'ec_major_school_id');
},
children: majorData === null || majorData === void 0 ? void 0 : majorData.map(function (e) {
return /*#__PURE__*/(0,jsx_runtime.jsx)(es_select/* default.Option */.Z.Option, {
value: e.ec_major_school_id,
children: e.name
});
})
}), /*#__PURE__*/(0,jsx_runtime.jsx)("div", {
className: GraduatedMatrixmodules.label,
children: "\u8BA4\u8BC1\u5C4A\u522B"
}), /*#__PURE__*/(0,jsx_runtime.jsx)(es_select/* default */.Z, {
disabled: isDisabled,
style: {
width: 140
},
placeholder: "\u8BF7\u9009\u62E9\u5C4A\u522B",
value: params === null || params === void 0 ? void 0 : params.ec_year_id,
onChange: function onChange(v) {
return handleSelect(v, 'ec_year_id');
},
children: yearData === null || yearData === void 0 ? void 0 : yearData.map(function (e) {
return /*#__PURE__*/(0,jsx_runtime.jsx)(es_select/* default.Option */.Z.Option, {
value: e.ec_year_id,
children: e.year
});
})
}), /*#__PURE__*/(0,jsx_runtime.jsxs)(es_button/* default */.ZP, {
disabled: isDisabled,
style: {
marginLeft: 'auto',
transition: '0s'
},
onClick: function onClick() {
return exportExcel();
},
children: [/*#__PURE__*/(0,jsx_runtime.jsx)("i", {
className: "iconfont icon-daochubeifen font14 mr5"
}), "\u5BFC\u51FA"]
})]
}), /*#__PURE__*/(0,jsx_runtime.jsxs)(tabs/* default */.Z, {
className: GraduatedMatrixmodules.tabWarp,
activeKey: params === null || params === void 0 ? void 0 : params.tab,
onChange: handleTabsChange,
children: [/*#__PURE__*/(0,jsx_runtime.jsx)(tabs/* default.TabPane */.Z.TabPane, {
tab: "\u6BD5\u4E1A\u8981\u6C42\u6307\u6807\u70B9\u4E0E\u57F9\u517B\u76EE\u6807\u5173\u7CFB\u77E9\u9635"
}, '1'), /*#__PURE__*/(0,jsx_runtime.jsx)(tabs/* default.TabPane */.Z.TabPane, {
tab: "\u6BD5\u4E1A\u8981\u6C42\u6307\u6807\u70B9\u4E0E\u901A\u7528\u6807\u51C6\u5173\u7CFB\u77E9\u9635"
}, '2')]
}), /*#__PURE__*/(0,jsx_runtime.jsx)(spin/* default */.Z, {
spinning: loading,
children: !!(tableData !== null && tableData !== void 0 && (_tableData$data = tableData.data) !== null && _tableData$data !== void 0 && _tableData$data.length) ? /*#__PURE__*/(0,jsx_runtime.jsx)("div", {
className: GraduatedMatrixmodules.table,
children: /*#__PURE__*/(0,jsx_runtime.jsxs)("aside", {
style: {
width: 169 + (tableData === null || tableData === void 0 ? void 0 : (_tableData$data2 = tableData.data) === null || _tableData$data2 === void 0 ? void 0 : (_tableData$data2$ = _tableData$data2[0]) === null || _tableData$data2$ === void 0 ? void 0 : (_tableData$data2$$ite = _tableData$data2$.item) === null || _tableData$data2$$ite === void 0 ? void 0 : _tableData$data2$$ite.length) * 79,
minWidth: '100%'
},
children: [/*#__PURE__*/(0,jsx_runtime.jsxs)("ul", {
className: GraduatedMatrixmodules.head,
children: [(params === null || params === void 0 ? void 0 : params.tab) === '1' ? /*#__PURE__*/(0,jsx_runtime.jsxs)("li", {
children: [/*#__PURE__*/(0,jsx_runtime.jsx)("span", {
children: "\u57F9\u517B\u76EE\u6807"
}), /*#__PURE__*/(0,jsx_runtime.jsx)("span", {
children: "\u6BD5\u4E1A\u8981\u6C42\u6307\u6807\u70B9"
})]
}) : /*#__PURE__*/(0,jsx_runtime.jsxs)("li", {
children: [/*#__PURE__*/(0,jsx_runtime.jsx)("span", {
children: "\u901A\u7528\u6807\u51C6"
}), /*#__PURE__*/(0,jsx_runtime.jsx)("span", {
children: "\u6BD5\u4E1A\u8981\u6C42\u6307\u6807\u70B9"
})]
}), tableData === null || tableData === void 0 ? void 0 : (_tableData$data3 = tableData.data) === null || _tableData$data3 === void 0 ? void 0 : (_tableData$data3$ = _tableData$data3[0]) === null || _tableData$data3$ === void 0 ? void 0 : (_tableData$data3$$ite = _tableData$data3$.item) === null || _tableData$data3$$ite === void 0 ? void 0 : _tableData$data3$$ite.map(function (e) {
var _tableData$training_s, _tableData$training_s2;
var title = tableData === null || tableData === void 0 ? void 0 : (_tableData$training_s = tableData.training_subitems) === null || _tableData$training_s === void 0 ? void 0 : (_tableData$training_s2 = _tableData$training_s.find(function (v) {
return v.id === e[(params === null || params === void 0 ? void 0 : params.tab) === '1' ? 'ec_training_subitem_id' : 'ec_graduation_standard_id'];
})) === null || _tableData$training_s2 === void 0 ? void 0 : _tableData$training_s2.name;
return /*#__PURE__*/(0,jsx_runtime.jsx)("li", {
children: /*#__PURE__*/(0,jsx_runtime.jsx)(tooltip/* default */.Z, {
title: title,
children: /*#__PURE__*/(0,jsx_runtime.jsx)("span", {
style: {
cursor: 'default'
},
children: e.x
})
})
}, e.ec_training_subitem_id);
})]
}), tableData === null || tableData === void 0 ? void 0 : (_tableData$data4 = tableData.data) === null || _tableData$data4 === void 0 ? void 0 : _tableData$data4.map(function (e, k) {
var _e$item, _e$item2;
var err = e === null || e === void 0 ? void 0 : (_e$item = e.item) === null || _e$item === void 0 ? void 0 : _e$item.every(function (j) {
return !j.status;
});
return /*#__PURE__*/(0,jsx_runtime.jsxs)("ul", {
className: GraduatedMatrixmodules.row,
children: [/*#__PURE__*/(0,jsx_runtime.jsx)("li", {
style: {
color: err ? '#E30000' : '#333333'
},
children: /*#__PURE__*/(0,jsx_runtime.jsx)(tooltip/* default */.Z, {
title: e.name,
children: /*#__PURE__*/(0,jsx_runtime.jsxs)("span", {
style: {
cursor: 'default'
},
children: [err ? /*#__PURE__*/(0,jsx_runtime.jsx)("span", {
style: {
marginRight: 3
},
children: "!"
}) : null, e.y]
})
})
}), e === null || e === void 0 ? void 0 : (_e$item2 = e.item) === null || _e$item2 === void 0 ? void 0 : _e$item2.map(function (r) {
return /*#__PURE__*/(0,jsx_runtime.jsx)("li", {
children: /*#__PURE__*/(0,jsx_runtime.jsx)(tooltip/* default */.Z, {
title: r !== null && r !== void 0 && r.status ? '取消支撑' : '选择支撑',
children: /*#__PURE__*/(0,jsx_runtime.jsx)(es_checkbox/* default */.Z, {
onChange: function onChange(ev) {
return handleCheck(ev, r);
},
checked: r === null || r === void 0 ? void 0 : r.status
})
})
});
})]
});
})]
})
}) : /*#__PURE__*/(0,jsx_runtime.jsx)(empty/* default */.Z, {
style: {
padding: '70px 0'
}
})
})]
});
};
/* harmony default export */ var GraduatedMatrix = ((0,_umi_production_exports.connect)(function (_ref6) {
var user = _ref6.user;
return {
user: user
};
})(Page));
/***/ }),
/***/ 32337:
/*!************************************************************************!*\
!*** ./src/pages/Engineering/components/Evaluate/index.ts + 4 modules ***!
\************************************************************************/
/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
// EXPORTS
__webpack_require__.d(__webpack_exports__, {
"p": function() { return /* reexport */ Evaluate_PanelTitle; },
"v": function() { return /* reexport */ Evaluate_SelectWrap; }
});
// EXTERNAL MODULE: ./node_modules/react/index.js
var react = __webpack_require__(67294);
;// CONCATENATED MODULE: ./src/pages/Engineering/components/Evaluate/PanelTitle/index.less?modules
// extracted by mini-css-extract-plugin
/* harmony default export */ var PanelTitlemodules = ({"panelTitleContainer":"panelTitleContainer___Ypuh_"});
// EXTERNAL MODULE: ./node_modules/react/jsx-runtime.js
var jsx_runtime = __webpack_require__(85893);
;// CONCATENATED MODULE: ./src/pages/Engineering/components/Evaluate/PanelTitle/index.tsx
/*
* @Author: dengcheng
* @Date: 2022-03-29 21:51:10
* @Last Modified by: dengcheng
* @Last Modified time: 2022-03-30 15:20:33
* @description:面板标题
*/
var PanelTitle = function PanelTitle(_ref) {
var title = _ref.title,
_ref$style = _ref.style,
style = _ref$style === void 0 ? {} : _ref$style;
return /*#__PURE__*/(0,jsx_runtime.jsx)("div", {
className: PanelTitlemodules.panelTitleContainer,
style: style,
children: /*#__PURE__*/(0,jsx_runtime.jsx)("div", {
children: title
})
});
};
/* harmony default export */ var Evaluate_PanelTitle = (PanelTitle);
;// CONCATENATED MODULE: ./src/pages/Engineering/components/Evaluate/SelectWrap/index.less?modules
// extracted by mini-css-extract-plugin
/* harmony default export */ var SelectWrapmodules = ({"selectWrapContainer":"selectWrapContainer___qocIH"});
;// CONCATENATED MODULE: ./src/pages/Engineering/components/Evaluate/SelectWrap/index.tsx
var SelectWrap = function SelectWrap(_ref) {
var title = _ref.title,
children = _ref.children;
return /*#__PURE__*/(0,jsx_runtime.jsxs)("div", {
className: SelectWrapmodules.selectWrapContainer,
children: [/*#__PURE__*/(0,jsx_runtime.jsx)("span", {
children: title
}), children]
});
};
/* harmony default export */ var Evaluate_SelectWrap = (SelectWrap);
;// CONCATENATED MODULE: ./src/pages/Engineering/components/Evaluate/index.ts
// 面板标题
// 选择包装器
/***/ }),
/***/ 9708:
/*!***************************************************!*\
!*** ./node_modules/antd/es/_util/statusUtils.js ***!
\***************************************************/
/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */ "F": function() { return /* binding */ getMergedStatus; },
/* harmony export */ "Z": function() { return /* binding */ getStatusClassNames; }
/* harmony export */ });
/* harmony import */ var classnames__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! classnames */ 94184);
/* harmony import */ var classnames__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(classnames__WEBPACK_IMPORTED_MODULE_0__);
const InputStatuses = (/* unused pure expression or super */ null && (['warning', 'error', '']));
function getStatusClassNames(prefixCls, status, hasFeedback) {
return classnames__WEBPACK_IMPORTED_MODULE_0___default()({
[`${prefixCls}-status-success`]: status === 'success',
[`${prefixCls}-status-warning`]: status === 'warning',
[`${prefixCls}-status-error`]: status === 'error',
[`${prefixCls}-status-validating`]: status === 'validating',
[`${prefixCls}-has-feedback`]: hasFeedback
});
}
const getMergedStatus = (contextStatus, customStatus) => customStatus || contextStatus;
/***/ }),
/***/ 84567:
/*!************************************************************!*\
!*** ./node_modules/antd/es/checkbox/index.js + 3 modules ***!
\************************************************************/
/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
// EXPORTS
__webpack_require__.d(__webpack_exports__, {
"Z": function() { return /* binding */ es_checkbox; }
});
// EXTERNAL MODULE: ./node_modules/classnames/index.js
var classnames = __webpack_require__(94184);
var classnames_default = /*#__PURE__*/__webpack_require__.n(classnames);
// EXTERNAL MODULE: ./node_modules/rc-checkbox/es/index.js + 5 modules
var es = __webpack_require__(95860);
// EXTERNAL MODULE: ./node_modules/react/index.js
var react = __webpack_require__(67294);
// EXTERNAL MODULE: ./node_modules/antd/es/config-provider/context.js
var config_provider_context = __webpack_require__(53124);
// EXTERNAL MODULE: ./node_modules/antd/es/config-provider/DisabledContext.js
var DisabledContext = __webpack_require__(98866);
// EXTERNAL MODULE: ./node_modules/antd/es/form/context.js
var context = __webpack_require__(65223);
;// CONCATENATED MODULE: ./node_modules/antd/es/checkbox/GroupContext.js
const GroupContext = /*#__PURE__*/react.createContext(null);
/* harmony default export */ var checkbox_GroupContext = (GroupContext);
// EXTERNAL MODULE: ./node_modules/antd/es/checkbox/style/index.js
var checkbox_style = __webpack_require__(63185);
;// CONCATENATED MODULE: ./node_modules/antd/es/checkbox/Checkbox.js
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 InternalCheckbox = (props, ref) => {
var _a;
const {
prefixCls: customizePrefixCls,
className,
rootClassName,
children,
indeterminate = false,
style,
onMouseEnter,
onMouseLeave,
skipGroup = false,
disabled
} = props,
restProps = __rest(props, ["prefixCls", "className", "rootClassName", "children", "indeterminate", "style", "onMouseEnter", "onMouseLeave", "skipGroup", "disabled"]);
const {
getPrefixCls,
direction,
checkbox
} = react.useContext(config_provider_context/* ConfigContext */.E_);
const checkboxGroup = react.useContext(checkbox_GroupContext);
const {
isFormItemInput
} = react.useContext(context/* FormItemInputContext */.aM);
const contextDisabled = react.useContext(DisabledContext/* default */.Z);
const mergedDisabled = (_a = (checkboxGroup === null || checkboxGroup === void 0 ? void 0 : checkboxGroup.disabled) || disabled) !== null && _a !== void 0 ? _a : contextDisabled;
const prevValue = react.useRef(restProps.value);
react.useEffect(() => {
checkboxGroup === null || checkboxGroup === void 0 ? void 0 : checkboxGroup.registerValue(restProps.value);
false ? 0 : void 0;
}, []);
react.useEffect(() => {
if (skipGroup) {
return;
}
if (restProps.value !== prevValue.current) {
checkboxGroup === null || checkboxGroup === void 0 ? void 0 : checkboxGroup.cancelValue(prevValue.current);
checkboxGroup === null || checkboxGroup === void 0 ? void 0 : checkboxGroup.registerValue(restProps.value);
prevValue.current = restProps.value;
}
return () => checkboxGroup === null || checkboxGroup === void 0 ? void 0 : checkboxGroup.cancelValue(restProps.value);
}, [restProps.value]);
const prefixCls = getPrefixCls('checkbox', customizePrefixCls);
const [wrapSSR, hashId] = (0,checkbox_style/* default */.ZP)(prefixCls);
const checkboxProps = Object.assign({}, restProps);
if (checkboxGroup && !skipGroup) {
checkboxProps.onChange = function () {
if (restProps.onChange) {
restProps.onChange.apply(restProps, arguments);
}
if (checkboxGroup.toggleOption) {
checkboxGroup.toggleOption({
label: children,
value: restProps.value
});
}
};
checkboxProps.name = checkboxGroup.name;
checkboxProps.checked = checkboxGroup.value.includes(restProps.value);
}
const classString = classnames_default()(`${prefixCls}-wrapper`, {
[`${prefixCls}-rtl`]: direction === 'rtl',
[`${prefixCls}-wrapper-checked`]: checkboxProps.checked,
[`${prefixCls}-wrapper-disabled`]: mergedDisabled,
[`${prefixCls}-wrapper-in-form-item`]: isFormItemInput
}, checkbox === null || checkbox === void 0 ? void 0 : checkbox.className, className, rootClassName, hashId);
const checkboxClass = classnames_default()({
[`${prefixCls}-indeterminate`]: indeterminate
}, hashId);
const ariaChecked = indeterminate ? 'mixed' : undefined;
return wrapSSR(
/*#__PURE__*/
// eslint-disable-next-line jsx-a11y/label-has-associated-control
react.createElement("label", {
className: classString,
style: Object.assign(Object.assign({}, checkbox === null || checkbox === void 0 ? void 0 : checkbox.style), style),
onMouseEnter: onMouseEnter,
onMouseLeave: onMouseLeave
}, /*#__PURE__*/react.createElement(es/* default */.Z, Object.assign({
"aria-checked": ariaChecked
}, checkboxProps, {
prefixCls: prefixCls,
className: checkboxClass,
disabled: mergedDisabled,
ref: ref
})), children !== undefined && /*#__PURE__*/react.createElement("span", null, children)));
};
const Checkbox = /*#__PURE__*/react.forwardRef(InternalCheckbox);
if (false) {}
/* harmony default export */ var checkbox_Checkbox = (Checkbox);
// EXTERNAL MODULE: ./node_modules/@babel/runtime/helpers/esm/toConsumableArray.js + 2 modules
var toConsumableArray = __webpack_require__(74902);
// EXTERNAL MODULE: ./node_modules/antd/node_modules/rc-util/es/omit.js
var omit = __webpack_require__(10366);
;// CONCATENATED MODULE: ./node_modules/antd/es/checkbox/Group.js
var Group_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 InternalGroup = (props, ref) => {
const {
defaultValue,
children,
options = [],
prefixCls: customizePrefixCls,
className,
rootClassName,
style,
onChange
} = props,
restProps = Group_rest(props, ["defaultValue", "children", "options", "prefixCls", "className", "rootClassName", "style", "onChange"]);
const {
getPrefixCls,
direction
} = react.useContext(config_provider_context/* ConfigContext */.E_);
const [value, setValue] = react.useState(restProps.value || defaultValue || []);
const [registeredValues, setRegisteredValues] = react.useState([]);
react.useEffect(() => {
if ('value' in restProps) {
setValue(restProps.value || []);
}
}, [restProps.value]);
const memoOptions = react.useMemo(() => options.map(option => {
if (typeof option === 'string' || typeof option === 'number') {
return {
label: option,
value: option
};
}
return option;
}), [options]);
const cancelValue = val => {
setRegisteredValues(prevValues => prevValues.filter(v => v !== val));
};
const registerValue = val => {
setRegisteredValues(prevValues => [].concat((0,toConsumableArray/* default */.Z)(prevValues), [val]));
};
const toggleOption = option => {
const optionIndex = value.indexOf(option.value);
const newValue = (0,toConsumableArray/* default */.Z)(value);
if (optionIndex === -1) {
newValue.push(option.value);
} else {
newValue.splice(optionIndex, 1);
}
if (!('value' in restProps)) {
setValue(newValue);
}
onChange === null || onChange === void 0 ? void 0 : onChange(newValue.filter(val => registeredValues.includes(val)).sort((a, b) => {
const indexA = memoOptions.findIndex(opt => opt.value === a);
const indexB = memoOptions.findIndex(opt => opt.value === b);
return indexA - indexB;
}));
};
const prefixCls = getPrefixCls('checkbox', customizePrefixCls);
const groupPrefixCls = `${prefixCls}-group`;
const [wrapSSR, hashId] = (0,checkbox_style/* default */.ZP)(prefixCls);
const domProps = (0,omit/* default */.Z)(restProps, ['value', 'disabled']);
const childrenNode = options.length ? memoOptions.map(option => /*#__PURE__*/react.createElement(checkbox_Checkbox, {
prefixCls: prefixCls,
key: option.value.toString(),
disabled: 'disabled' in option ? option.disabled : restProps.disabled,
value: option.value,
checked: value.includes(option.value),
onChange: option.onChange,
className: `${groupPrefixCls}-item`,
style: option.style,
title: option.title
}, option.label)) : children;
// eslint-disable-next-line react/jsx-no-constructed-context-values
const context = {
toggleOption,
value,
disabled: restProps.disabled,
name: restProps.name,
// https://github.com/ant-design/ant-design/issues/16376
registerValue,
cancelValue
};
const classString = classnames_default()(groupPrefixCls, {
[`${groupPrefixCls}-rtl`]: direction === 'rtl'
}, className, rootClassName, hashId);
return wrapSSR( /*#__PURE__*/react.createElement("div", Object.assign({
className: classString,
style: style
}, domProps, {
ref: ref
}), /*#__PURE__*/react.createElement(checkbox_GroupContext.Provider, {
value: context
}, childrenNode)));
};
const CheckboxGroup = /*#__PURE__*/react.forwardRef(InternalGroup);
/* harmony default export */ var Group = (/*#__PURE__*/react.memo(CheckboxGroup));
;// CONCATENATED MODULE: ./node_modules/antd/es/checkbox/index.js
'use client';
const es_checkbox_Checkbox = checkbox_Checkbox;
es_checkbox_Checkbox.Group = Group;
es_checkbox_Checkbox.__ANT_CHECKBOX = true;
if (false) {}
/* harmony default export */ var es_checkbox = (es_checkbox_Checkbox);
/***/ }),
/***/ 63185:
/*!******************************************************!*\
!*** ./node_modules/antd/es/checkbox/style/index.js ***!
\******************************************************/
/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */ "C2": function() { return /* binding */ getStyle; }
/* harmony export */ });
/* unused harmony export genCheckboxStyle */
/* harmony import */ var _ant_design_cssinjs__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @ant-design/cssinjs */ 68024);
/* harmony import */ var _style__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../../style */ 14747);
/* harmony import */ var _theme_internal__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../../theme/internal */ 45503);
/* harmony import */ var _theme_internal__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../../theme/internal */ 67968);
// ============================== Motion ==============================
const antCheckboxEffect = new _ant_design_cssinjs__WEBPACK_IMPORTED_MODULE_0__.Keyframes('antCheckboxEffect', {
'0%': {
transform: 'scale(1)',
opacity: 0.5
},
'100%': {
transform: 'scale(1.6)',
opacity: 0
}
});
// ============================== Styles ==============================
const genCheckboxStyle = token => {
const {
checkboxCls
} = token;
const wrapperCls = `${checkboxCls}-wrapper`;
return [
// ===================== Basic =====================
{
// Group
[`${checkboxCls}-group`]: Object.assign(Object.assign({}, (0,_style__WEBPACK_IMPORTED_MODULE_1__/* .resetComponent */ .Wf)(token)), {
display: 'inline-flex',
flexWrap: 'wrap',
columnGap: token.marginXS,
// Group > Grid
[`> ${token.antCls}-row`]: {
flex: 1
}
}),
// Wrapper
[wrapperCls]: Object.assign(Object.assign({}, (0,_style__WEBPACK_IMPORTED_MODULE_1__/* .resetComponent */ .Wf)(token)), {
display: 'inline-flex',
alignItems: 'baseline',
cursor: 'pointer',
// Fix checkbox & radio in flex align #30260
'&:after': {
display: 'inline-block',
width: 0,
overflow: 'hidden',
content: "'\\a0'"
},
// Checkbox near checkbox
[`& + ${wrapperCls}`]: {
marginInlineStart: 0
},
[`&${wrapperCls}-in-form-item`]: {
'input[type="checkbox"]': {
width: 14,
height: 14 // FIXME: magic
}
}
}),
// Wrapper > Checkbox
[checkboxCls]: Object.assign(Object.assign({}, (0,_style__WEBPACK_IMPORTED_MODULE_1__/* .resetComponent */ .Wf)(token)), {
position: 'relative',
whiteSpace: 'nowrap',
lineHeight: 1,
cursor: 'pointer',
// To make alignment right when `controlHeight` is changed
// Ref: https://github.com/ant-design/ant-design/issues/41564
alignSelf: 'center',
// Wrapper > Checkbox > input
[`${checkboxCls}-input`]: {
position: 'absolute',
// Since baseline align will get additional space offset,
// we need to move input to top to make it align with text.
// Ref: https://github.com/ant-design/ant-design/issues/38926#issuecomment-1486137799
inset: 0,
zIndex: 1,
cursor: 'pointer',
opacity: 0,
margin: 0,
[`&:focus-visible + ${checkboxCls}-inner`]: Object.assign({}, (0,_style__WEBPACK_IMPORTED_MODULE_1__/* .genFocusOutline */ .oN)(token))
},
// Wrapper > Checkbox > inner
[`${checkboxCls}-inner`]: {
boxSizing: 'border-box',
position: 'relative',
top: 0,
insetInlineStart: 0,
display: 'block',
width: token.checkboxSize,
height: token.checkboxSize,
direction: 'ltr',
backgroundColor: token.colorBgContainer,
border: `${token.lineWidth}px ${token.lineType} ${token.colorBorder}`,
borderRadius: token.borderRadiusSM,
borderCollapse: 'separate',
transition: `all ${token.motionDurationSlow}`,
'&:after': {
boxSizing: 'border-box',
position: 'absolute',
top: '50%',
insetInlineStart: '21.5%',
display: 'table',
width: token.checkboxSize / 14 * 5,
height: token.checkboxSize / 14 * 8,
border: `${token.lineWidthBold}px solid ${token.colorWhite}`,
borderTop: 0,
borderInlineStart: 0,
transform: 'rotate(45deg) scale(0) translate(-50%,-50%)',
opacity: 0,
content: '""',
transition: `all ${token.motionDurationFast} ${token.motionEaseInBack}, opacity ${token.motionDurationFast}`
}
},
// Wrapper > Checkbox + Text
'& + span': {
paddingInlineStart: token.paddingXS,
paddingInlineEnd: token.paddingXS
}
})
},
// ===================== Hover =====================
{
// Wrapper
[`${wrapperCls}:hover ${checkboxCls}:after`]: {
visibility: 'visible'
},
// Wrapper & Wrapper > Checkbox
[`
${wrapperCls}:not(${wrapperCls}-disabled),
${checkboxCls}:not(${checkboxCls}-disabled)
`]: {
[`&:hover ${checkboxCls}-inner`]: {
borderColor: token.colorPrimary
}
},
[`${wrapperCls}:not(${wrapperCls}-disabled)`]: {
[`&:hover ${checkboxCls}-checked:not(${checkboxCls}-disabled) ${checkboxCls}-inner`]: {
backgroundColor: token.colorPrimaryHover,
borderColor: 'transparent'
},
[`&:hover ${checkboxCls}-checked:not(${checkboxCls}-disabled):after`]: {
borderColor: token.colorPrimaryHover
}
}
},
// ==================== Checked ====================
{
// Wrapper > Checkbox
[`${checkboxCls}-checked`]: {
[`${checkboxCls}-inner`]: {
backgroundColor: token.colorPrimary,
borderColor: token.colorPrimary,
'&:after': {
opacity: 1,
transform: 'rotate(45deg) scale(1) translate(-50%,-50%)',
transition: `all ${token.motionDurationMid} ${token.motionEaseOutBack} ${token.motionDurationFast}`
}
},
// Checked Effect
'&:after': {
position: 'absolute',
top: 0,
insetInlineStart: 0,
width: '100%',
height: '100%',
borderRadius: token.borderRadiusSM,
visibility: 'hidden',
border: `${token.lineWidthBold}px solid ${token.colorPrimary}`,
animationName: antCheckboxEffect,
animationDuration: token.motionDurationSlow,
animationTimingFunction: 'ease-in-out',
animationFillMode: 'backwards',
content: '""',
transition: `all ${token.motionDurationSlow}`
}
},
[`
${wrapperCls}-checked:not(${wrapperCls}-disabled),
${checkboxCls}-checked:not(${checkboxCls}-disabled)
`]: {
[`&:hover ${checkboxCls}-inner`]: {
backgroundColor: token.colorPrimaryHover,
borderColor: 'transparent'
},
[`&:hover ${checkboxCls}:after`]: {
borderColor: token.colorPrimaryHover
}
}
},
// ================= Indeterminate =================
{
[checkboxCls]: {
'&-indeterminate': {
// Wrapper > Checkbox > inner
[`${checkboxCls}-inner`]: {
backgroundColor: token.colorBgContainer,
borderColor: token.colorBorder,
'&:after': {
top: '50%',
insetInlineStart: '50%',
width: token.fontSizeLG / 2,
height: token.fontSizeLG / 2,
backgroundColor: token.colorPrimary,
border: 0,
transform: 'translate(-50%, -50%) scale(1)',
opacity: 1,
content: '""'
}
}
}
}
},
// ==================== Disable ====================
{
// Wrapper
[`${wrapperCls}-disabled`]: {
cursor: 'not-allowed'
},
// Wrapper > Checkbox
[`${checkboxCls}-disabled`]: {
// Wrapper > Checkbox > input
[`&, ${checkboxCls}-input`]: {
cursor: 'not-allowed',
// Disabled for native input to enable Tooltip event handler
// ref: https://github.com/ant-design/ant-design/issues/39822#issuecomment-1365075901
pointerEvents: 'none'
},
// Wrapper > Checkbox > inner
[`${checkboxCls}-inner`]: {
background: token.colorBgContainerDisabled,
borderColor: token.colorBorder,
'&:after': {
borderColor: token.colorTextDisabled
}
},
'&:after': {
display: 'none'
},
'& + span': {
color: token.colorTextDisabled
},
[`&${checkboxCls}-indeterminate ${checkboxCls}-inner::after`]: {
background: token.colorTextDisabled
}
}
}];
};
// ============================== Export ==============================
function getStyle(prefixCls, token) {
const checkboxToken = (0,_theme_internal__WEBPACK_IMPORTED_MODULE_2__/* .merge */ .TS)(token, {
checkboxCls: `.${prefixCls}`,
checkboxSize: token.controlInteractiveSize
});
return [genCheckboxStyle(checkboxToken)];
}
/* harmony default export */ __webpack_exports__["ZP"] = ((0,_theme_internal__WEBPACK_IMPORTED_MODULE_3__/* ["default"] */ .Z)('Checkbox', (token, _ref) => {
let {
prefixCls
} = _ref;
return [getStyle(prefixCls, token)];
}));
/***/ }),
/***/ 95860:
/*!**********************************************************!*\
!*** ./node_modules/rc-checkbox/es/index.js + 5 modules ***!
\**********************************************************/
/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
// EXPORTS
__webpack_require__.d(__webpack_exports__, {
"Z": function() { return /* binding */ es; }
});
// UNUSED EXPORTS: Checkbox
// EXTERNAL MODULE: ./node_modules/@babel/runtime/helpers/esm/extends.js
var esm_extends = __webpack_require__(87462);
// EXTERNAL MODULE: ./node_modules/@babel/runtime/helpers/esm/objectSpread2.js
var objectSpread2 = __webpack_require__(1413);
// EXTERNAL MODULE: ./node_modules/@babel/runtime/helpers/esm/defineProperty.js
var defineProperty = __webpack_require__(4942);
// EXTERNAL MODULE: ./node_modules/@babel/runtime/helpers/esm/slicedToArray.js + 1 modules
var slicedToArray = __webpack_require__(97685);
// EXTERNAL MODULE: ./node_modules/@babel/runtime/helpers/esm/objectWithoutProperties.js
var objectWithoutProperties = __webpack_require__(45987);
// EXTERNAL MODULE: ./node_modules/classnames/index.js
var classnames = __webpack_require__(94184);
var classnames_default = /*#__PURE__*/__webpack_require__.n(classnames);
// EXTERNAL MODULE: ./node_modules/react/index.js
var react = __webpack_require__(67294);
;// CONCATENATED MODULE: ./node_modules/rc-checkbox/node_modules/rc-util/es/hooks/useEvent.js
function useEvent(callback) {
var fnRef = react.useRef();
fnRef.current = callback;
var memoFn = react.useCallback(function () {
var _fnRef$current;
for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
args[_key] = arguments[_key];
}
return (_fnRef$current = fnRef.current) === null || _fnRef$current === void 0 ? void 0 : _fnRef$current.call.apply(_fnRef$current, [fnRef].concat(args));
}, []);
return memoFn;
}
;// CONCATENATED MODULE: ./node_modules/rc-checkbox/node_modules/rc-util/es/Dom/canUseDom.js
function canUseDom() {
return !!(typeof window !== 'undefined' && window.document && window.document.createElement);
}
;// CONCATENATED MODULE: ./node_modules/rc-checkbox/node_modules/rc-util/es/hooks/useLayoutEffect.js
/**
* Wrap `React.useLayoutEffect` which will not throw warning message in test env
*/
var useInternalLayoutEffect = true && canUseDom() ? react.useLayoutEffect : react.useEffect;
var useLayoutEffect = function useLayoutEffect(callback, deps) {
var firstMountRef = react.useRef(true);
useInternalLayoutEffect(function () {
return callback(firstMountRef.current);
}, deps);
// We tell react that first mount has passed
useInternalLayoutEffect(function () {
firstMountRef.current = false;
return function () {
firstMountRef.current = true;
};
}, []);
};
var useLayoutUpdateEffect = function useLayoutUpdateEffect(callback, deps) {
useLayoutEffect(function (firstMount) {
if (!firstMount) {
return callback();
}
}, deps);
};
/* harmony default export */ var hooks_useLayoutEffect = ((/* unused pure expression or super */ null && (useLayoutEffect)));
;// CONCATENATED MODULE: ./node_modules/rc-checkbox/node_modules/rc-util/es/hooks/useState.js
/**
* Same as React.useState but `setState` accept `ignoreDestroy` param to not to setState after destroyed.
* We do not make this auto is to avoid real memory leak.
* Developer should confirm it's safe to ignore themselves.
*/
function useSafeState(defaultValue) {
var destroyRef = react.useRef(false);
var _React$useState = react.useState(defaultValue),
_React$useState2 = (0,slicedToArray/* default */.Z)(_React$useState, 2),
value = _React$useState2[0],
setValue = _React$useState2[1];
react.useEffect(function () {
destroyRef.current = false;
return function () {
destroyRef.current = true;
};
}, []);
function safeSetState(updater, ignoreDestroy) {
if (ignoreDestroy && destroyRef.current) {
return;
}
setValue(updater);
}
return [value, safeSetState];
}
;// CONCATENATED MODULE: ./node_modules/rc-checkbox/node_modules/rc-util/es/hooks/useMergedState.js
/** We only think `undefined` is empty */
function hasValue(value) {
return value !== undefined;
}
/**
* Similar to `useState` but will use props value if provided.
* Note that internal use rc-util `useState` hook.
*/
function useMergedState(defaultStateValue, option) {
var _ref = option || {},
defaultValue = _ref.defaultValue,
value = _ref.value,
onChange = _ref.onChange,
postState = _ref.postState;
// ======================= Init =======================
var _useState = useSafeState(function () {
if (hasValue(value)) {
return value;
} else if (hasValue(defaultValue)) {
return typeof defaultValue === 'function' ? defaultValue() : defaultValue;
} else {
return typeof defaultStateValue === 'function' ? defaultStateValue() : defaultStateValue;
}
}),
_useState2 = (0,slicedToArray/* default */.Z)(_useState, 2),
innerValue = _useState2[0],
setInnerValue = _useState2[1];
var mergedValue = value !== undefined ? value : innerValue;
var postMergedValue = postState ? postState(mergedValue) : mergedValue;
// ====================== Change ======================
var onChangeFn = useEvent(onChange);
var _useState3 = useSafeState([mergedValue]),
_useState4 = (0,slicedToArray/* default */.Z)(_useState3, 2),
prevValue = _useState4[0],
setPrevValue = _useState4[1];
useLayoutUpdateEffect(function () {
var prev = prevValue[0];
if (innerValue !== prev) {
onChangeFn(innerValue, prev);
}
}, [prevValue]);
// Sync value back to `undefined` when it from control to un-control
useLayoutUpdateEffect(function () {
if (!hasValue(value)) {
setInnerValue(value);
}
}, [value]);
// ====================== Update ======================
var triggerChange = useEvent(function (updater, ignoreDestroy) {
setInnerValue(updater, ignoreDestroy);
setPrevValue([mergedValue], ignoreDestroy);
});
return [postMergedValue, triggerChange];
}
;// CONCATENATED MODULE: ./node_modules/rc-checkbox/es/index.js
var _excluded = ["prefixCls", "className", "style", "checked", "disabled", "defaultChecked", "type", "title", "onChange"];
var Checkbox = /*#__PURE__*/(0,react.forwardRef)(function (props, ref) {
var _classNames;
var _props$prefixCls = props.prefixCls,
prefixCls = _props$prefixCls === void 0 ? 'rc-checkbox' : _props$prefixCls,
className = props.className,
style = props.style,
checked = props.checked,
disabled = props.disabled,
_props$defaultChecked = props.defaultChecked,
defaultChecked = _props$defaultChecked === void 0 ? false : _props$defaultChecked,
_props$type = props.type,
type = _props$type === void 0 ? 'checkbox' : _props$type,
title = props.title,
onChange = props.onChange,
inputProps = (0,objectWithoutProperties/* default */.Z)(props, _excluded);
var inputRef = (0,react.useRef)(null);
var _useMergedState = useMergedState(defaultChecked, {
value: checked
}),
_useMergedState2 = (0,slicedToArray/* default */.Z)(_useMergedState, 2),
rawValue = _useMergedState2[0],
setRawValue = _useMergedState2[1];
(0,react.useImperativeHandle)(ref, function () {
return {
focus: function focus() {
var _inputRef$current;
(_inputRef$current = inputRef.current) === null || _inputRef$current === void 0 ? void 0 : _inputRef$current.focus();
},
blur: function blur() {
var _inputRef$current2;
(_inputRef$current2 = inputRef.current) === null || _inputRef$current2 === void 0 ? void 0 : _inputRef$current2.blur();
},
input: inputRef.current
};
});
var classString = classnames_default()(prefixCls, className, (_classNames = {}, (0,defineProperty/* default */.Z)(_classNames, "".concat(prefixCls, "-checked"), rawValue), (0,defineProperty/* default */.Z)(_classNames, "".concat(prefixCls, "-disabled"), disabled), _classNames));
var handleChange = function handleChange(e) {
if (disabled) {
return;
}
if (!('checked' in props)) {
setRawValue(e.target.checked);
}
onChange === null || onChange === void 0 ? void 0 : onChange({
target: (0,objectSpread2/* default */.Z)((0,objectSpread2/* default */.Z)({}, props), {}, {
type: type,
checked: e.target.checked
}),
stopPropagation: function stopPropagation() {
e.stopPropagation();
},
preventDefault: function preventDefault() {
e.preventDefault();
},
nativeEvent: e.nativeEvent
});
};
return /*#__PURE__*/react.createElement("span", {
className: classString,
title: title,
style: style
}, /*#__PURE__*/react.createElement("input", (0,esm_extends/* default */.Z)({}, inputProps, {
className: "".concat(prefixCls, "-input"),
ref: inputRef,
onChange: handleChange,
disabled: disabled,
checked: !!rawValue,
type: type
})), /*#__PURE__*/react.createElement("span", {
className: "".concat(prefixCls, "-inner")
}));
});
/* harmony default export */ var es = (Checkbox);
/***/ }),
/***/ 66680:
/*!***************************************************!*\
!*** ./node_modules/rc-util/es/hooks/useEvent.js ***!
\***************************************************/
/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */ "Z": function() { return /* binding */ useEvent; }
/* harmony export */ });
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! react */ 67294);
function useEvent(callback) {
var fnRef = react__WEBPACK_IMPORTED_MODULE_0__.useRef();
fnRef.current = callback;
var memoFn = react__WEBPACK_IMPORTED_MODULE_0__.useCallback(function () {
var _fnRef$current;
for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
args[_key] = arguments[_key];
}
return (_fnRef$current = fnRef.current) === null || _fnRef$current === void 0 ? void 0 : _fnRef$current.call.apply(_fnRef$current, [fnRef].concat(args));
}, []);
return memoFn;
}
/***/ }),
/***/ 21770:
/*!*********************************************************!*\
!*** ./node_modules/rc-util/es/hooks/useMergedState.js ***!
\*********************************************************/
/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */ "Z": function() { return /* binding */ useMergedState; }
/* harmony export */ });
/* harmony import */ var _babel_runtime_helpers_esm_slicedToArray__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @babel/runtime/helpers/esm/slicedToArray */ 97685);
/* harmony import */ var _useEvent__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./useEvent */ 66680);
/* harmony import */ var _useLayoutEffect__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./useLayoutEffect */ 8410);
/* harmony import */ var _useState__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./useState */ 30470);
/** We only think `undefined` is empty */
function hasValue(value) {
return value !== undefined;
}
/**
* Similar to `useState` but will use props value if provided.
* Note that internal use rc-util `useState` hook.
*/
function useMergedState(defaultStateValue, option) {
var _ref = option || {},
defaultValue = _ref.defaultValue,
value = _ref.value,
onChange = _ref.onChange,
postState = _ref.postState;
// ======================= Init =======================
var _useState = (0,_useState__WEBPACK_IMPORTED_MODULE_2__/* ["default"] */ .Z)(function () {
if (hasValue(value)) {
return value;
} else if (hasValue(defaultValue)) {
return typeof defaultValue === 'function' ? defaultValue() : defaultValue;
} else {
return typeof defaultStateValue === 'function' ? defaultStateValue() : defaultStateValue;
}
}),
_useState2 = (0,_babel_runtime_helpers_esm_slicedToArray__WEBPACK_IMPORTED_MODULE_3__/* ["default"] */ .Z)(_useState, 2),
innerValue = _useState2[0],
setInnerValue = _useState2[1];
var mergedValue = value !== undefined ? value : innerValue;
var postMergedValue = postState ? postState(mergedValue) : mergedValue;
// ====================== Change ======================
var onChangeFn = (0,_useEvent__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */ .Z)(onChange);
var _useState3 = (0,_useState__WEBPACK_IMPORTED_MODULE_2__/* ["default"] */ .Z)([mergedValue]),
_useState4 = (0,_babel_runtime_helpers_esm_slicedToArray__WEBPACK_IMPORTED_MODULE_3__/* ["default"] */ .Z)(_useState3, 2),
prevValue = _useState4[0],
setPrevValue = _useState4[1];
(0,_useLayoutEffect__WEBPACK_IMPORTED_MODULE_1__/* .useLayoutUpdateEffect */ .o)(function () {
var prev = prevValue[0];
if (innerValue !== prev) {
onChangeFn(innerValue, prev);
}
}, [prevValue]);
// Sync value back to `undefined` when it from control to un-control
(0,_useLayoutEffect__WEBPACK_IMPORTED_MODULE_1__/* .useLayoutUpdateEffect */ .o)(function () {
if (!hasValue(value)) {
setInnerValue(value);
}
}, [value]);
// ====================== Update ======================
var triggerChange = (0,_useEvent__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */ .Z)(function (updater, ignoreDestroy) {
setInnerValue(updater, ignoreDestroy);
setPrevValue([mergedValue], ignoreDestroy);
});
return [postMergedValue, triggerChange];
}
/***/ }),
/***/ 98423:
/*!*****************************************!*\
!*** ./node_modules/rc-util/es/omit.js ***!
\*****************************************/
/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */ "Z": function() { return /* binding */ omit; }
/* harmony export */ });
/* harmony import */ var _babel_runtime_helpers_esm_objectSpread2__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @babel/runtime/helpers/esm/objectSpread2 */ 1413);
function omit(obj, fields) {
var clone = (0,_babel_runtime_helpers_esm_objectSpread2__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */ .Z)({}, obj);
if (Array.isArray(fields)) {
fields.forEach(function (key) {
delete clone[key];
});
}
return clone;
}
/***/ })
}]);