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.
1930 lines
79 KiB
1930 lines
79 KiB
"use strict";
|
|
(self["webpackChunk"] = self["webpackChunk"] || []).push([[1343],{
|
|
|
|
/***/ 16800:
|
|
/*!**********************************************!*\
|
|
!*** ./src/components/AsyncButton/index.tsx ***!
|
|
\**********************************************/
|
|
/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
|
|
|
|
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
|
|
/* harmony export */ Z: function() { return /* binding */ AsyncButton; }
|
|
/* harmony export */ });
|
|
/* harmony import */ var antd__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! antd */ 3113);
|
|
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! react */ 59301);
|
|
var __defProp = Object.defineProperty;
|
|
var __defProps = Object.defineProperties;
|
|
var __getOwnPropDescs = Object.getOwnPropertyDescriptors;
|
|
var __getOwnPropSymbols = Object.getOwnPropertySymbols;
|
|
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
var __propIsEnum = Object.prototype.propertyIsEnumerable;
|
|
var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
var __spreadValues = (a, b) => {
|
|
for (var prop in b || (b = {}))
|
|
if (__hasOwnProp.call(b, prop))
|
|
__defNormalProp(a, prop, b[prop]);
|
|
if (__getOwnPropSymbols)
|
|
for (var prop of __getOwnPropSymbols(b)) {
|
|
if (__propIsEnum.call(b, prop))
|
|
__defNormalProp(a, prop, b[prop]);
|
|
}
|
|
return a;
|
|
};
|
|
var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
|
|
var __objRest = (source, exclude) => {
|
|
var target = {};
|
|
for (var prop in source)
|
|
if (__hasOwnProp.call(source, prop) && exclude.indexOf(prop) < 0)
|
|
target[prop] = source[prop];
|
|
if (source != null && __getOwnPropSymbols)
|
|
for (var prop of __getOwnPropSymbols(source)) {
|
|
if (exclude.indexOf(prop) < 0 && __propIsEnum.call(source, prop))
|
|
target[prop] = source[prop];
|
|
}
|
|
return target;
|
|
};
|
|
var __async = (__this, __arguments, generator) => {
|
|
return new Promise((resolve, reject) => {
|
|
var fulfilled = (value) => {
|
|
try {
|
|
step(generator.next(value));
|
|
} catch (e) {
|
|
reject(e);
|
|
}
|
|
};
|
|
var rejected = (value) => {
|
|
try {
|
|
step(generator.throw(value));
|
|
} catch (e) {
|
|
reject(e);
|
|
}
|
|
};
|
|
var step = (x) => x.done ? resolve(x.value) : Promise.resolve(x.value).then(fulfilled, rejected);
|
|
step((generator = generator.apply(__this, __arguments)).next());
|
|
});
|
|
};
|
|
|
|
|
|
const AsyncButton = (_a) => {
|
|
var _b = _a, { children } = _b, props = __objRest(_b, ["children"]);
|
|
const [btnLoading, setBtnLoading] = (0,react__WEBPACK_IMPORTED_MODULE_0__.useState)(false);
|
|
return /* @__PURE__ */ react__WEBPACK_IMPORTED_MODULE_0__.createElement(antd__WEBPACK_IMPORTED_MODULE_1__/* ["default"] */ .ZP, __spreadProps(__spreadValues({}, props), { loading: btnLoading, onClick: (e) => __async(void 0, null, function* () {
|
|
try {
|
|
setBtnLoading(true);
|
|
yield props.onClick(e);
|
|
setBtnLoading(false);
|
|
} catch (error) {
|
|
console.error(error);
|
|
setBtnLoading(false);
|
|
}
|
|
}) }), children);
|
|
};
|
|
|
|
|
|
/***/ }),
|
|
|
|
/***/ 87526:
|
|
/*!*****************************************!*\
|
|
!*** ./src/components/NoData/index.tsx ***!
|
|
\*****************************************/
|
|
/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
|
|
|
|
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! react */ 59301);
|
|
/* harmony import */ var _assets_images_icons_nodata_png__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @/assets/images/icons/nodata.png */ 93314);
|
|
/* harmony import */ var antd__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! antd */ 3113);
|
|
var __defProp = Object.defineProperty;
|
|
var __defProps = Object.defineProperties;
|
|
var __getOwnPropDescs = Object.getOwnPropertyDescriptors;
|
|
var __getOwnPropSymbols = Object.getOwnPropertySymbols;
|
|
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
var __propIsEnum = Object.prototype.propertyIsEnumerable;
|
|
var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
var __spreadValues = (a, b) => {
|
|
for (var prop in b || (b = {}))
|
|
if (__hasOwnProp.call(b, prop))
|
|
__defNormalProp(a, prop, b[prop]);
|
|
if (__getOwnPropSymbols)
|
|
for (var prop of __getOwnPropSymbols(b)) {
|
|
if (__propIsEnum.call(b, prop))
|
|
__defNormalProp(a, prop, b[prop]);
|
|
}
|
|
return a;
|
|
};
|
|
var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
|
|
|
|
|
|
|
|
const noData = ({
|
|
img,
|
|
buttonProps = {},
|
|
styles = {},
|
|
customText,
|
|
ButtonText,
|
|
ButtonClick,
|
|
Buttonclass,
|
|
ButtonTwo,
|
|
imgStyles,
|
|
loading = false
|
|
}) => {
|
|
return /* @__PURE__ */ react__WEBPACK_IMPORTED_MODULE_0__.createElement(
|
|
"section",
|
|
{
|
|
className: "tc animated fadeIn",
|
|
style: __spreadValues(__spreadValues({}, { color: "#999", margin: "100px auto", visibility: loading ? "hidden" : "visible" }), styles)
|
|
},
|
|
/* @__PURE__ */ react__WEBPACK_IMPORTED_MODULE_0__.createElement("img", { src: img || _assets_images_icons_nodata_png__WEBPACK_IMPORTED_MODULE_1__, style: __spreadProps(__spreadValues({}, imgStyles), { pointerEvents: "none", userSelect: "none" }) }),
|
|
/* @__PURE__ */ react__WEBPACK_IMPORTED_MODULE_0__.createElement("p", { className: "mt20 font14" }, customText || "\u6682\u65F6\u8FD8\u6CA1\u6709\u76F8\u5173\u6570\u636E\u54E6!"),
|
|
ButtonText && /* @__PURE__ */ react__WEBPACK_IMPORTED_MODULE_0__.createElement(antd__WEBPACK_IMPORTED_MODULE_2__/* ["default"] */ .ZP, __spreadValues({ className: Buttonclass, onClick: ButtonClick }, buttonProps), ButtonText),
|
|
ButtonTwo && ButtonTwo
|
|
);
|
|
};
|
|
/* harmony default export */ __webpack_exports__.Z = (noData);
|
|
|
|
|
|
/***/ }),
|
|
|
|
/***/ 42845:
|
|
/*!************************************************************************!*\
|
|
!*** ./src/pages/User/Detail/ResourceAllocation/index.tsx + 7 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 */ Detail_ResourceAllocation; }
|
|
});
|
|
|
|
// 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 + 15 modules
|
|
var _umi_production_exports = __webpack_require__(67866);
|
|
;// CONCATENATED MODULE: ./src/pages/User/Detail/ResourceAllocation/index.less?modules
|
|
// extracted by mini-css-extract-plugin
|
|
/* harmony default export */ var ResourceAllocationmodules = ({"flex_box_center":"flex_box_center___jyZV2","flex_space_between":"flex_space_between___k_7F2","flex_box_vertical_center":"flex_box_vertical_center___d0b7M","flex_box_center_end":"flex_box_center_end___wqxMs","flex_box_column":"flex_box_column___P0s_3","wrap":"wrap___CzoO3","customTable":"customTable___Fav7O","rowHead":"rowHead___d790S","title":"title___NIVLU","date":"date___GUgJk","type":"type___zYawb","status":"status___wCEKO","action":"action___BAHpo"});
|
|
// EXTERNAL MODULE: ./src/components/ui-customization/index.tsx + 34 modules
|
|
var ui_customization = __webpack_require__(26324);
|
|
// 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 es_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/row/index.js
|
|
var row = __webpack_require__(95237);
|
|
// EXTERNAL MODULE: ./node_modules/_antd@5.9.0@antd/es/col/index.js
|
|
var col = __webpack_require__(43604);
|
|
// EXTERNAL MODULE: ./node_modules/_antd@5.9.0@antd/es/table/index.js + 85 modules
|
|
var table = __webpack_require__(14491);
|
|
// 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/checkbox/index.js + 3 modules
|
|
var es_checkbox = __webpack_require__(24905);
|
|
// EXTERNAL MODULE: ./node_modules/_antd@5.9.0@antd/es/radio/index.js + 5 modules
|
|
var es_radio = __webpack_require__(5112);
|
|
// EXTERNAL MODULE: ./node_modules/_antd@5.9.0@antd/es/input/index.js + 5 modules
|
|
var input = __webpack_require__(98135);
|
|
// EXTERNAL MODULE: ./src/utils/fetch.ts
|
|
var fetch = __webpack_require__(51165);
|
|
;// CONCATENATED MODULE: ./src/pages/User/Detail/ResourceAllocation/CustomLimit/index.less?modules
|
|
// extracted by mini-css-extract-plugin
|
|
/* harmony default export */ var CustomLimitmodules = ({"flex_box_center":"flex_box_center___y5ps_","flex_space_between":"flex_space_between___fpOHW","flex_box_vertical_center":"flex_box_vertical_center___xbHpf","flex_box_center_end":"flex_box_center_end___PY24I","flex_box_column":"flex_box_column___KA5XQ","wrap":"wrap___yixzN","real_name":"real_name___s2R4p","operationBtn":"operationBtn___UqS0S","reject":"reject___etB4g","approve":"approve___emYHF","rejectBtn":"rejectBtn___iLRty","approveBtn":"approveBtn___kX8_G","user_model":"user_model___hYuKq","zybzForm":"zybzForm___NLuB8","dataPicker":"dataPicker___vz5Fw","graaytitle":"graaytitle___RQG8g","must":"must___xJhkN","ActvieE3":"ActvieE3___OfRAG","allbox":"allbox___Qnoae","customModal":"customModal___cIPxO","shezhi":"shezhi___TaKHQ"});
|
|
// EXTERNAL MODULE: ./node_modules/_dayjs@1.11.11@dayjs/dayjs.min.js
|
|
var dayjs_min = __webpack_require__(99232);
|
|
var dayjs_min_default = /*#__PURE__*/__webpack_require__.n(dayjs_min);
|
|
// EXTERNAL MODULE: ./src/components/AsyncButton/index.tsx
|
|
var AsyncButton = __webpack_require__(16800);
|
|
// EXTERNAL MODULE: ./node_modules/_lodash@4.17.21@lodash/lodash.js
|
|
var lodash = __webpack_require__(89392);
|
|
;// CONCATENATED MODULE: ./src/pages/User/Detail/ResourceAllocation/CustomLimit/index.tsx
|
|
/* provided dependency */ var React = __webpack_require__(/*! react */ 59301);
|
|
var __defProp = Object.defineProperty;
|
|
var __defProps = Object.defineProperties;
|
|
var __getOwnPropDescs = Object.getOwnPropertyDescriptors;
|
|
var __getOwnPropSymbols = Object.getOwnPropertySymbols;
|
|
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
var __propIsEnum = Object.prototype.propertyIsEnumerable;
|
|
var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
var __spreadValues = (a, b) => {
|
|
for (var prop in b || (b = {}))
|
|
if (__hasOwnProp.call(b, prop))
|
|
__defNormalProp(a, prop, b[prop]);
|
|
if (__getOwnPropSymbols)
|
|
for (var prop of __getOwnPropSymbols(b)) {
|
|
if (__propIsEnum.call(b, prop))
|
|
__defNormalProp(a, prop, b[prop]);
|
|
}
|
|
return a;
|
|
};
|
|
var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
|
|
var __objRest = (source, exclude) => {
|
|
var target = {};
|
|
for (var prop in source)
|
|
if (__hasOwnProp.call(source, prop) && exclude.indexOf(prop) < 0)
|
|
target[prop] = source[prop];
|
|
if (source != null && __getOwnPropSymbols)
|
|
for (var prop of __getOwnPropSymbols(source)) {
|
|
if (exclude.indexOf(prop) < 0 && __propIsEnum.call(source, prop))
|
|
target[prop] = source[prop];
|
|
}
|
|
return target;
|
|
};
|
|
var __async = (__this, __arguments, generator) => {
|
|
return new Promise((resolve, reject) => {
|
|
var fulfilled = (value) => {
|
|
try {
|
|
step(generator.next(value));
|
|
} catch (e) {
|
|
reject(e);
|
|
}
|
|
};
|
|
var rejected = (value) => {
|
|
try {
|
|
step(generator.throw(value));
|
|
} catch (e) {
|
|
reject(e);
|
|
}
|
|
};
|
|
var step = (x) => x.done ? resolve(x.value) : Promise.resolve(x.value).then(fulfilled, rejected);
|
|
step((generator = generator.apply(__this, __arguments)).next());
|
|
});
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
const CustomLimit = (_a) => {
|
|
var _b = _a, {
|
|
globalSetting,
|
|
user,
|
|
dispatch,
|
|
keyVal
|
|
} = _b, props = __objRest(_b, [
|
|
"globalSetting",
|
|
"user",
|
|
"dispatch",
|
|
"keyVal"
|
|
]);
|
|
const [activeStatus, setActiveStatus] = (0,_react_17_0_2_react.useState)(null);
|
|
const [params, setParams] = (0,_react_17_0_2_react.useState)({
|
|
page: 1,
|
|
limit: 10,
|
|
keywords: null,
|
|
limit_type: null
|
|
});
|
|
const [result, setResult] = (0,_react_17_0_2_react.useState)();
|
|
const [tableLoading, setTableLoading] = (0,_react_17_0_2_react.useState)(true);
|
|
const [customModal, setCustomModal] = (0,_react_17_0_2_react.useState)(false);
|
|
const [isCreate, setIsCreate] = (0,_react_17_0_2_react.useState)(false);
|
|
const [settingModal, setSettingModal] = (0,_react_17_0_2_react.useState)(false);
|
|
const [tipRange, setTipRange] = (0,_react_17_0_2_react.useState)(0);
|
|
const [schoolList, setSchoolList] = (0,_react_17_0_2_react.useState)([]);
|
|
const [departmentList, setDepartmentList] = (0,_react_17_0_2_react.useState)([]);
|
|
const [selectAll, setSelectAll] = (0,_react_17_0_2_react.useState)(false);
|
|
const [form] = es_form["default"].useForm();
|
|
const [form1] = es_form["default"].useForm();
|
|
const [formValue, setFormValue] = (0,_react_17_0_2_react.useState)({});
|
|
const [selectedRow, setSelectedRow] = (0,_react_17_0_2_react.useState)({});
|
|
const [btnLoading, setBtnLoading] = (0,_react_17_0_2_react.useState)(false);
|
|
const [allSchool, setAllSchool] = (0,_react_17_0_2_react.useState)(false);
|
|
const throttleGetSchoolOption = (0,_react_17_0_2_react.useRef)(
|
|
(0,lodash.throttle)((value) => getSchoolList(value), 1200, { leading: true, trailing: true })
|
|
).current;
|
|
const columns = [
|
|
{
|
|
title: "\u5E8F\u53F7",
|
|
dataIndex: "name",
|
|
key: "name",
|
|
ellipsis: true,
|
|
fixed: "left",
|
|
width: 60,
|
|
render: (text, record, index) => {
|
|
return /* @__PURE__ */ React.createElement("span", { style: { color: "#333" } }, params.limit * (params.page - 1) + index + 1);
|
|
}
|
|
},
|
|
{
|
|
title: "\u6240\u5C5E\u5355\u4F4D",
|
|
dataIndex: "school_info",
|
|
key: "school_info",
|
|
ellipsis: true,
|
|
render: (text, record, index) => /* @__PURE__ */ React.createElement("span", { style: { color: "#333" } }, text.name)
|
|
},
|
|
{
|
|
title: "\u5B66\u9662\u540D\u79F0",
|
|
dataIndex: "department_info",
|
|
key: "department_info",
|
|
ellipsis: true,
|
|
render: (text, record) => {
|
|
var _a2;
|
|
return /* @__PURE__ */ React.createElement("span", { style: { color: "#333" } }, (record == null ? void 0 : record.is_all_department) ? "\u5168\u90E8\u5B66\u9662" : (_a2 = text.map((item) => item.name)) == null ? void 0 : _a2.join("\u3001"));
|
|
}
|
|
},
|
|
{
|
|
title: "\u6559\u5E08\uFF08\u4EBA\uFF09",
|
|
dataIndex: "teacher_count",
|
|
key: "teacher_count",
|
|
width: 90,
|
|
ellipsis: true,
|
|
render: (text, record) => /* @__PURE__ */ React.createElement("span", { style: { color: "#165DFF", cursor: "pointer" }, onClick: () => {
|
|
var _a2;
|
|
_umi_production_exports.history.push(`/colleges/${(_a2 = record == null ? void 0 : record.school_info) == null ? void 0 : _a2.id}/statistics`);
|
|
} }, text)
|
|
},
|
|
{
|
|
title: "\u5B66\u751F\uFF08\u4EBA\uFF09",
|
|
dataIndex: "student_count",
|
|
key: "student_count",
|
|
width: 90,
|
|
ellipsis: true,
|
|
render: (text, record) => /* @__PURE__ */ React.createElement("span", { style: { color: "#165DFF", cursor: "pointer" }, onClick: () => {
|
|
var _a2;
|
|
_umi_production_exports.history.push(`/colleges/${(_a2 = record == null ? void 0 : record.school_info) == null ? void 0 : _a2.id}/statistics`);
|
|
} }, text)
|
|
},
|
|
{
|
|
title: "\u7C7B\u578B",
|
|
dataIndex: "limit_type",
|
|
key: "limit_type",
|
|
width: 90,
|
|
ellipsis: true,
|
|
render: (text) => /* @__PURE__ */ React.createElement("span", { style: { color: "#000" } }, text == 1 ? "\u4F4E\u4F18\u5148\u7EA7" : "\u5B8C\u5168\u7981\u7528")
|
|
},
|
|
{
|
|
title: "\u521B\u5EFA\u65F6\u95F4",
|
|
dataIndex: "created_at",
|
|
key: "created_at",
|
|
ellipsis: true,
|
|
render: (text, record, index) => /* @__PURE__ */ React.createElement("span", { style: { color: "#666" } }, text ? dayjs_min_default()(text).format("YYYY-MM-DD HH:mm") : "--")
|
|
},
|
|
{
|
|
title: "\u521B\u5EFA\u4EBA",
|
|
dataIndex: "user_name",
|
|
key: "user_name",
|
|
ellipsis: true,
|
|
render: (text, record, index) => /* @__PURE__ */ React.createElement("span", { style: { color: "#666" } }, text)
|
|
},
|
|
{
|
|
title: "\u539F\u56E0",
|
|
dataIndex: "reason",
|
|
key: "reason",
|
|
ellipsis: true,
|
|
render: (text, record, index) => {
|
|
return /* @__PURE__ */ React.createElement(tooltip/* default */.Z, { title: record == null ? void 0 : record.reason, placement: "bottomLeft" }, /* @__PURE__ */ React.createElement("div", { style: { overflow: "hidden", textOverflow: "ellipsis", whiteSpace: "nowrap", color: "#666" } }, text));
|
|
}
|
|
},
|
|
{
|
|
title: /* @__PURE__ */ React.createElement("span", null, "\u64CD\u4F5C"),
|
|
align: "right",
|
|
width: 120,
|
|
render: (text, record) => /* @__PURE__ */ React.createElement(React.Fragment, null, /* @__PURE__ */ React.createElement(AsyncButton/* AsyncButton */.Z, { type: "link", style: { whiteSpace: "nowrap", padding: 0, color: "#165DFF" }, onClick: () => __async(void 0, null, function* () {
|
|
var _a2;
|
|
setIsCreate(false);
|
|
const detailData = {
|
|
school_id: record == null ? void 0 : record.school_info.id,
|
|
department_ids: (_a2 = record == null ? void 0 : record.department_info) == null ? void 0 : _a2.map((item) => item.id),
|
|
limit_type: record == null ? void 0 : record.limit_type,
|
|
reason: record == null ? void 0 : record.reason
|
|
};
|
|
form.setFieldsValue(detailData);
|
|
setFormValue(detailData);
|
|
setSelectedRow(record);
|
|
setAllSchool(record == null ? void 0 : record.is_all_department);
|
|
yield handleFormData(record);
|
|
}) }, "\u7F16\u8F91"), /* @__PURE__ */ React.createElement("a", { className: CustomLimitmodules.ActvieE3, type: "link", style: { padding: "0 0 0 10px", whiteSpace: "nowrap" }, onClick: () => {
|
|
const modal = es_modal["default"].confirm({
|
|
title: "\u5220\u9664\u63D0\u793A",
|
|
icon: null,
|
|
centered: true,
|
|
width: 530,
|
|
maskClosable: true,
|
|
content: /* @__PURE__ */ React.createElement("span", null, "\u786E\u5B9A\u5220\u9664\u8BE5\u9650\u5236\u4FDD\u969C\u5BA2\u6237\uFF1F\u5220\u9664\u540E\u8BE5\u5355\u4F4D\u5BA2\u6237\u5C06\u4E0D\u5728\u5E73\u53F0\u9650\u5236\u4FDD\u969C\u7684\u8303\u56F4\u4E2D\u3002"),
|
|
okText: "\u786E\u5B9A",
|
|
cancelText: "\u53D6\u6D88",
|
|
onOk: () => __async(void 0, null, function* () {
|
|
const res = yield (0,fetch/* default */.ZP)(
|
|
`/api/resource_allocations/delete_limit.json`,
|
|
{ method: "delete", body: { resource_limit_custom_id: record == null ? void 0 : record.id } }
|
|
);
|
|
if (res.status == 0) {
|
|
message/* default */.ZP.success("\u5220\u9664\u6210\u529F");
|
|
getList();
|
|
}
|
|
modal.destroy();
|
|
}),
|
|
onCancel: () => {
|
|
modal.destroy();
|
|
}
|
|
});
|
|
} }, "\u5220\u9664"))
|
|
}
|
|
];
|
|
(0,_react_17_0_2_react.useEffect)(() => {
|
|
params.keywords = keyVal;
|
|
params.page = 1;
|
|
setParams(__spreadValues({}, params));
|
|
getList();
|
|
}, [keyVal]);
|
|
(0,_react_17_0_2_react.useEffect)(() => {
|
|
getSetting();
|
|
}, []);
|
|
function getList() {
|
|
return __async(this, null, function* () {
|
|
setTableLoading(true);
|
|
const res = yield (0,fetch/* default */.ZP)(
|
|
`/api/resource_allocations/limit_list.json`,
|
|
{ method: "get", params }
|
|
);
|
|
if (res.status == 0) {
|
|
setResult(res.data);
|
|
}
|
|
setTableLoading(false);
|
|
});
|
|
}
|
|
const getSetting = () => __async(void 0, null, function* () {
|
|
const res = yield (0,fetch/* default */.ZP)(
|
|
`/api/business_contacts/show_settings.json`,
|
|
{ method: "get" }
|
|
);
|
|
if (res.status == 0) {
|
|
setTipRange(res == null ? void 0 : res.value);
|
|
}
|
|
});
|
|
const getSchoolList = (_0, ..._1) => __async(void 0, [_0, ..._1], function* (keyword, record = {}) {
|
|
const res = yield (0,fetch/* default */.ZP)(
|
|
`/api/schools/limit_list.json`,
|
|
{ method: "get", params: { limit: 20, keyword } }
|
|
);
|
|
if (res.status == 0) {
|
|
setSchoolList([...res == null ? void 0 : res.schools, __spreadValues({}, (record == null ? void 0 : record.school_info) || {})]);
|
|
}
|
|
});
|
|
const getDepartmentList = (schoolId, record) => __async(void 0, null, function* () {
|
|
var _a2, _b2, _c, _d, _e;
|
|
const res = yield (0,fetch/* default */.ZP)(
|
|
`/api/schools/${schoolId}/departments/for_option.json`,
|
|
{ method: "get", params: { source: "resource_limit" } }
|
|
);
|
|
if (res.status == 0) {
|
|
if (isCreate) {
|
|
setDepartmentList((_a2 = res == null ? void 0 : res.departments) == null ? void 0 : _a2.filter((item) => !(item == null ? void 0 : item.resource_limit_exist)));
|
|
} else {
|
|
setDepartmentList((_b2 = res == null ? void 0 : res.departments) == null ? void 0 : _b2.filter((item) => !(item == null ? void 0 : item.resource_limit_exist) || (item == null ? void 0 : item.resource_limit_exist) && (record == null ? void 0 : record.department_info.some((jtem) => jtem.id == item.id))));
|
|
setSelectAll(((_c = record == null ? void 0 : record.department_info) == null ? void 0 : _c.length) == ((_e = (_d = res == null ? void 0 : res.departments) == null ? void 0 : _d.filter((item) => !(item == null ? void 0 : item.resource_limit_exist) || (item == null ? void 0 : item.resource_limit_exist) && (record == null ? void 0 : record.department_info.some((jtem) => jtem.id == item.id)))) == null ? void 0 : _e.length) ? true : false);
|
|
}
|
|
}
|
|
});
|
|
const handleFormData = (record) => __async(void 0, null, function* () {
|
|
var _a2;
|
|
yield getSchoolList("", record);
|
|
if (record == null ? void 0 : record.id) {
|
|
yield getDepartmentList((_a2 = record == null ? void 0 : record.school_info) == null ? void 0 : _a2.id, record);
|
|
}
|
|
setCustomModal(true);
|
|
});
|
|
const handleFinish = (values) => __async(void 0, null, function* () {
|
|
setBtnLoading(true);
|
|
let res;
|
|
if (isCreate) {
|
|
console.log("allSchool", allSchool);
|
|
res = yield (0,fetch/* default */.ZP)(
|
|
`/api/resource_allocations/add_limit.json`,
|
|
{
|
|
method: "post",
|
|
body: __spreadValues({}, values)
|
|
}
|
|
);
|
|
} else {
|
|
res = yield (0,fetch/* default */.ZP)(
|
|
`/api/resource_allocations/update_limit.json`,
|
|
{
|
|
method: "put",
|
|
body: __spreadProps(__spreadValues({}, values), {
|
|
// is_all_department: allSchool,
|
|
resource_limit_custom_id: selectedRow == null ? void 0 : selectedRow.id
|
|
})
|
|
}
|
|
);
|
|
}
|
|
if (res.status == 0) {
|
|
message/* default */.ZP.success(isCreate ? "\u521B\u5EFA\u6210\u529F" : "\u66F4\u65B0\u6210\u529F");
|
|
setFormValue({});
|
|
form.resetFields();
|
|
setCustomModal(false);
|
|
setSchoolList([]);
|
|
setDepartmentList([]);
|
|
setIsCreate(false);
|
|
yield getList();
|
|
}
|
|
setBtnLoading(false);
|
|
setCustomModal(false);
|
|
});
|
|
return /* @__PURE__ */ React.createElement("div", { className: CustomLimitmodules.wrap }, /* @__PURE__ */ React.createElement(_react_17_0_2_react.Fragment, null, /* @__PURE__ */ React.createElement(row/* default */.Z, { justify: "space-between", style: { marginTop: 25 } }, /* @__PURE__ */ React.createElement(col/* default */.Z, null, /* @__PURE__ */ React.createElement(
|
|
ui_customization/* CustomTags */.qp,
|
|
{
|
|
title: "\u72B6\u6001",
|
|
value: activeStatus,
|
|
onChange: (e) => {
|
|
setActiveStatus(e);
|
|
params.limit_type = e;
|
|
params.page = 1;
|
|
setParams(__spreadValues({}, params));
|
|
getList();
|
|
},
|
|
dataSource: [
|
|
{ name: "\u5168\u90E8", id: null },
|
|
{ name: "\u4F4E\u4F18\u5148\u7EA7", id: 1 },
|
|
{ name: "\u5B8C\u5168\u7981\u7528", id: 2 }
|
|
],
|
|
titleWidth: 28,
|
|
style: { flex: 1 }
|
|
}
|
|
)), /* @__PURE__ */ React.createElement(col/* default */.Z, null, /* @__PURE__ */ React.createElement(
|
|
"i",
|
|
{
|
|
className: `iconfont icon-shezhi ${CustomLimitmodules.shezhi}`,
|
|
onClick: () => __async(void 0, null, function* () {
|
|
setSettingModal(true);
|
|
})
|
|
}
|
|
), /* @__PURE__ */ React.createElement(
|
|
ui_customization/* CustomButton */.op,
|
|
{
|
|
openLoading: true,
|
|
onClick: () => __async(void 0, null, function* () {
|
|
setIsCreate(true);
|
|
form.setFieldValue("limit_type", 1);
|
|
yield handleFormData();
|
|
})
|
|
},
|
|
"\u65B0\u5EFA"
|
|
)))), /* @__PURE__ */ React.createElement(ui_customization/* CustomTable */.Gi, null, /* @__PURE__ */ React.createElement(
|
|
table["default"],
|
|
{
|
|
columns,
|
|
loading: tableLoading,
|
|
dataSource: result == null ? void 0 : result.list,
|
|
pagination: {
|
|
size: "default",
|
|
showQuickJumper: true,
|
|
showSizeChanger: true,
|
|
pageSizeOptions: ["10", "15", "50", "100", "200"],
|
|
hideOnSinglePage: true,
|
|
pageSize: params.limit,
|
|
current: params.page,
|
|
position: ["bottomRight"],
|
|
onChange: (page, pagesize) => {
|
|
params.page = page;
|
|
params.limit = pagesize;
|
|
setParams(__spreadValues({}, params));
|
|
getList();
|
|
},
|
|
total: result == null ? void 0 : result.count,
|
|
showTotal: (total, range) => /* @__PURE__ */ React.createElement("span", null, "\u5171", /* @__PURE__ */ React.createElement("span", { style: { color: "#165DFF" } }, " ", total, " "), "\u6761\u6570\u636E")
|
|
}
|
|
}
|
|
)), /* @__PURE__ */ React.createElement(
|
|
es_modal["default"],
|
|
{
|
|
centered: true,
|
|
width: 515,
|
|
title: `${isCreate ? "\u65B0\u5EFA\u9650\u5236\u4FDD\u969C\u5BA2\u6237" : "\u7F16\u8F91\u9650\u5236\u4FDD\u969C\u5BA2\u6237"}`,
|
|
open: customModal,
|
|
okText: "\u786E\u5B9A",
|
|
cancelText: "\u53D6\u6D88",
|
|
maskClosable: false,
|
|
onOk: () => {
|
|
form.submit();
|
|
},
|
|
okButtonProps: { loading: btnLoading },
|
|
className: `${CustomLimitmodules.customModal} ant-form-modal-body`,
|
|
afterOpenChange: (open) => {
|
|
open && document.querySelector(".ant-form-modal-body").querySelector(".ant-modal-body").scrollTo(0, 0);
|
|
},
|
|
onCancel: () => {
|
|
setFormValue({});
|
|
form.resetFields();
|
|
setSchoolList([]);
|
|
setDepartmentList([]);
|
|
setCustomModal(false);
|
|
setIsCreate(false);
|
|
}
|
|
},
|
|
/* @__PURE__ */ React.createElement(
|
|
es_form["default"],
|
|
{
|
|
form,
|
|
layout: "vertical",
|
|
scrollToFirstError: true,
|
|
className: `${CustomLimitmodules.FormDiv}`,
|
|
onValuesChange: (changedValues) => {
|
|
var _a2, _b2;
|
|
if (((_a2 = changedValues == null ? void 0 : changedValues.department_ids) == null ? void 0 : _a2.length) != 0 && ((_b2 = changedValues == null ? void 0 : changedValues.department_ids) == null ? void 0 : _b2.length) == departmentList.length) {
|
|
setSelectAll(true);
|
|
} else {
|
|
setSelectAll(false);
|
|
}
|
|
setFormValue(__spreadValues(__spreadValues({}, formValue), changedValues));
|
|
},
|
|
onFinish: (values) => __async(void 0, null, function* () {
|
|
handleFinish(values);
|
|
})
|
|
},
|
|
/* @__PURE__ */ React.createElement(
|
|
es_form["default"].Item,
|
|
{
|
|
htmlFor: null,
|
|
label: /* @__PURE__ */ React.createElement("span", { style: { color: "#5F6368" } }, "\u6240\u5C5E\u5355\u4F4D"),
|
|
name: "school_id",
|
|
rules: [{ required: true, message: "\u8BF7\u9009\u62E9\u6240\u5C5E\u5355\u4F4D" }]
|
|
},
|
|
/* @__PURE__ */ React.createElement(
|
|
es_select["default"],
|
|
{
|
|
size: "large",
|
|
showSearch: true,
|
|
allowClear: true,
|
|
optionFilterProp: "children",
|
|
placeholder: "\u8BF7\u9009\u62E9\u6240\u5C5E\u5355\u4F4D",
|
|
onSearch: throttleGetSchoolOption,
|
|
onSelect: (value, option) => __async(void 0, null, function* () {
|
|
yield getDepartmentList(value);
|
|
form.setFieldValue("department_ids", []);
|
|
})
|
|
},
|
|
schoolList == null ? void 0 : schoolList.map((item, index) => /* @__PURE__ */ React.createElement(es_select["default"].Option, { key: item.id, value: item.id }, item.name))
|
|
)
|
|
),
|
|
/* @__PURE__ */ React.createElement(
|
|
es_form["default"].Item,
|
|
{
|
|
htmlFor: null,
|
|
label: /* @__PURE__ */ React.createElement("span", { style: { color: "#5F6368" } }, "\u5B66\u9662(\u53EF\u591A\u9009)"),
|
|
name: "department_ids",
|
|
rules: [{ required: true, message: "\u8BF7\u9009\u62E9\u5B66\u9662" }]
|
|
},
|
|
/* @__PURE__ */ React.createElement(
|
|
es_select["default"],
|
|
{
|
|
size: "large",
|
|
mode: "multiple",
|
|
optionFilterProp: "children",
|
|
placeholder: "\u8BF7\u9009\u62E9\u5B66\u9662",
|
|
allowClear: true,
|
|
menuItemSelectedIcon: null,
|
|
optionLabelProp: "label",
|
|
dropdownRender: (menu) => {
|
|
return /* @__PURE__ */ React.createElement(React.Fragment, null, (departmentList == null ? void 0 : departmentList.length) > 0 && /* @__PURE__ */ React.createElement("div", { className: CustomLimitmodules.allbox, style: { padding: "4px 8px 8px 12px", cursor: "pointer" } }, /* @__PURE__ */ React.createElement(
|
|
es_checkbox["default"],
|
|
{
|
|
checked: selectAll,
|
|
onChange: (e) => {
|
|
if (e.target.checked) {
|
|
setSelectAll(true);
|
|
form.setFieldsValue(__spreadProps(__spreadValues({}, formValue), { department_ids: departmentList.map((item) => item.id) }));
|
|
setFormValue(__spreadProps(__spreadValues({}, formValue), {
|
|
department_ids: departmentList.map((item) => item.id)
|
|
}));
|
|
} else {
|
|
setSelectAll(false);
|
|
form.setFieldsValue(__spreadProps(__spreadValues({}, formValue), { department_ids: [] }));
|
|
setFormValue(__spreadProps(__spreadValues({}, formValue), {
|
|
department_ids: []
|
|
}));
|
|
}
|
|
}
|
|
},
|
|
"\u5168\u90E8\u5B66\u9662"
|
|
)), menu);
|
|
}
|
|
},
|
|
departmentList == null ? void 0 : departmentList.map((item, index) => {
|
|
var _a2;
|
|
return /* @__PURE__ */ React.createElement(es_select["default"].Option, { key: index, value: item.id, label: item.name }, /* @__PURE__ */ React.createElement(
|
|
es_checkbox["default"],
|
|
{
|
|
checked: (_a2 = form.getFieldValue("department_ids")) == null ? void 0 : _a2.some((jtem) => jtem == item.id),
|
|
style: { marginRight: "6px" }
|
|
}
|
|
), item.name);
|
|
})
|
|
)
|
|
),
|
|
/* @__PURE__ */ React.createElement(es_form["default"].Item, { htmlFor: null, label: /* @__PURE__ */ React.createElement("span", { style: { color: "#5F6368" } }, "\u7C7B\u578B"), name: "limit_type" }, /* @__PURE__ */ React.createElement(es_radio/* default.Group */.ZP.Group, null, /* @__PURE__ */ React.createElement(es_radio/* default */.ZP, { value: 1, style: { marginBottom: "15px" } }, "\u4F4E\u4F18\u5148\u7EA7", /* @__PURE__ */ React.createElement("span", { style: { color: "#999", marginLeft: "5px" } }, "\uFF08\u5BF9\u4E8E\u4F4E\u4F18\u5148\u7EA7\u7528\u6237\u5E73\u53F0\u5C06\u6700\u4F4E\u4F18\u5148\u7EA7\u5206\u914D\u5B9E\u9A8C\u8D44\u6E90\uFF09")), /* @__PURE__ */ React.createElement(es_radio/* default */.ZP, { value: 2 }, "\u5B8C\u5168\u7981\u7528", /* @__PURE__ */ React.createElement("span", { style: { color: "#999", marginLeft: "5px" } }, "\uFF08\u5BF9\u4E8E\u5B8C\u5168\u7981\u7528\u7528\u6237\u5E73\u53F0\u7981\u6B62\u8BE5\u7C7B\u7528\u6237\u4F7F\u7528\u8BC4\u6D4B\u529F\u80FD\uFF09")))),
|
|
/* @__PURE__ */ React.createElement(
|
|
es_form["default"].Item,
|
|
{
|
|
htmlFor: null,
|
|
label: /* @__PURE__ */ React.createElement("span", { style: { color: "#5F6368" } }, "\u539F\u56E0"),
|
|
name: "reason",
|
|
rules: [
|
|
{ type: "string", max: 200, message: "\u8F93\u5165\u8D85\u9650\uFF0C\u8BF7\u7F29\u51CF\u5B57\u7B26\u6570" },
|
|
{ required: true, message: "\u8BF7\u8F93\u5165\u539F\u56E0" }
|
|
]
|
|
},
|
|
/* @__PURE__ */ React.createElement(
|
|
input["default"].TextArea,
|
|
{
|
|
showCount: true,
|
|
value: form.getFieldValue("reason"),
|
|
maxLength: 200,
|
|
style: { height: 120, resize: "none" },
|
|
placeholder: "\u8BF7\u586B\u5199\u539F\u56E0",
|
|
rows: 5
|
|
}
|
|
)
|
|
)
|
|
)
|
|
), /* @__PURE__ */ React.createElement(
|
|
es_modal["default"],
|
|
{
|
|
centered: true,
|
|
width: 400,
|
|
title: "\u8BBE\u7F6E",
|
|
open: settingModal,
|
|
okText: "\u786E\u5B9A",
|
|
cancelText: "\u53D6\u6D88",
|
|
maskClosable: false,
|
|
onOk: () => __async(void 0, null, function* () {
|
|
const formValue2 = form1.getFieldsValue();
|
|
const res = yield (0,fetch/* default */.ZP)(`/api/business_contacts/settings.json`, {
|
|
method: "put",
|
|
body: __spreadValues({}, formValue2)
|
|
});
|
|
if ((res == null ? void 0 : res.status) !== -1) {
|
|
message/* default */.ZP.info("\u8BBE\u7F6E\u6210\u529F");
|
|
setSettingModal(false);
|
|
getSetting();
|
|
getList();
|
|
}
|
|
}),
|
|
onCancel: () => {
|
|
setSettingModal(false);
|
|
form1.resetFields();
|
|
}
|
|
},
|
|
/* @__PURE__ */ React.createElement(
|
|
es_form["default"],
|
|
{
|
|
form: form1,
|
|
layout: "vertical",
|
|
initialValues: { value: tipRange }
|
|
},
|
|
/* @__PURE__ */ React.createElement(es_form["default"].Item, { label: "\u6536\u8D39\u63D0\u793A\u8303\u56F4", name: "value", required: true }, /* @__PURE__ */ React.createElement(es_radio/* default.Group */.ZP.Group, null, /* @__PURE__ */ React.createElement(es_radio/* default */.ZP, { value: 0, className: "ml15" }, "\u5168\u90E8\u5B66\u9662"), /* @__PURE__ */ React.createElement(es_radio/* default */.ZP, { value: 1, className: "ml50" }, "\u53D7\u9650\u5B66\u9662")))
|
|
)
|
|
));
|
|
};
|
|
/* harmony default export */ var ResourceAllocation_CustomLimit = ((0,_umi_production_exports.connect)(
|
|
({
|
|
globalSetting,
|
|
user
|
|
}) => ({
|
|
globalSetting,
|
|
user
|
|
})
|
|
)(CustomLimit));
|
|
|
|
// EXTERNAL MODULE: ./src/utils/util.tsx
|
|
var util = __webpack_require__(13462);
|
|
;// CONCATENATED MODULE: ./src/pages/User/Detail/ResourceAllocation/CustomAllocate/index.tsx
|
|
var CustomAllocate_defProp = Object.defineProperty;
|
|
var CustomAllocate_getOwnPropSymbols = Object.getOwnPropertySymbols;
|
|
var CustomAllocate_hasOwnProp = Object.prototype.hasOwnProperty;
|
|
var CustomAllocate_propIsEnum = Object.prototype.propertyIsEnumerable;
|
|
var CustomAllocate_defNormalProp = (obj, key, value) => key in obj ? CustomAllocate_defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
var CustomAllocate_spreadValues = (a, b) => {
|
|
for (var prop in b || (b = {}))
|
|
if (CustomAllocate_hasOwnProp.call(b, prop))
|
|
CustomAllocate_defNormalProp(a, prop, b[prop]);
|
|
if (CustomAllocate_getOwnPropSymbols)
|
|
for (var prop of CustomAllocate_getOwnPropSymbols(b)) {
|
|
if (CustomAllocate_propIsEnum.call(b, prop))
|
|
CustomAllocate_defNormalProp(a, prop, b[prop]);
|
|
}
|
|
return a;
|
|
};
|
|
var CustomAllocate_objRest = (source, exclude) => {
|
|
var target = {};
|
|
for (var prop in source)
|
|
if (CustomAllocate_hasOwnProp.call(source, prop) && exclude.indexOf(prop) < 0)
|
|
target[prop] = source[prop];
|
|
if (source != null && CustomAllocate_getOwnPropSymbols)
|
|
for (var prop of CustomAllocate_getOwnPropSymbols(source)) {
|
|
if (exclude.indexOf(prop) < 0 && CustomAllocate_propIsEnum.call(source, prop))
|
|
target[prop] = source[prop];
|
|
}
|
|
return target;
|
|
};
|
|
var CustomAllocate_async = (__this, __arguments, generator) => {
|
|
return new Promise((resolve, reject) => {
|
|
var fulfilled = (value) => {
|
|
try {
|
|
step(generator.next(value));
|
|
} catch (e) {
|
|
reject(e);
|
|
}
|
|
};
|
|
var rejected = (value) => {
|
|
try {
|
|
step(generator.throw(value));
|
|
} catch (e) {
|
|
reject(e);
|
|
}
|
|
};
|
|
var step = (x) => x.done ? resolve(x.value) : Promise.resolve(x.value).then(fulfilled, rejected);
|
|
step((generator = generator.apply(__this, __arguments)).next());
|
|
});
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
dayjs_min_default().locale("ZH-cn");
|
|
const CustomAllocate = (_a) => {
|
|
var _b = _a, {
|
|
globalSetting,
|
|
user,
|
|
dispatch,
|
|
keyVal
|
|
} = _b, props = CustomAllocate_objRest(_b, [
|
|
"globalSetting",
|
|
"user",
|
|
"dispatch",
|
|
"keyVal"
|
|
]);
|
|
const [params, setParams] = (0,_react_17_0_2_react.useState)({
|
|
page: 1,
|
|
limit: 10,
|
|
keywords: null,
|
|
type_en: null,
|
|
status_en: null
|
|
});
|
|
const [result, setResult] = (0,_react_17_0_2_react.useState)();
|
|
const [tableLoading, setTableLoading] = (0,_react_17_0_2_react.useState)(true);
|
|
let columns = [
|
|
{
|
|
title: "\u5E8F\u53F7",
|
|
dataIndex: "name",
|
|
key: "name",
|
|
ellipsis: true,
|
|
fixed: "left",
|
|
width: 60,
|
|
render: (text, record, index) => {
|
|
return /* @__PURE__ */ _react_17_0_2_react.createElement("span", { style: { color: "#333" } }, params.limit * (params.page - 1) + index + 1);
|
|
}
|
|
},
|
|
{
|
|
title: "\u6240\u5C5E\u5355\u4F4D",
|
|
dataIndex: "school_info",
|
|
key: "school_info",
|
|
ellipsis: true,
|
|
render: (text, record, index) => /* @__PURE__ */ _react_17_0_2_react.createElement("span", { style: { color: "#333" } }, text.name)
|
|
},
|
|
{
|
|
title: "\u5B66\u9662\u540D\u79F0",
|
|
dataIndex: "department_info",
|
|
key: "department_info",
|
|
ellipsis: true,
|
|
render: (text, record, index) => /* @__PURE__ */ _react_17_0_2_react.createElement("span", { style: { color: "#333" } }, text.name)
|
|
},
|
|
{
|
|
title: "\u6559\u5E08\uFF08\u4EBA\uFF09",
|
|
dataIndex: "teacher_count",
|
|
key: "teacher_count",
|
|
width: 90,
|
|
ellipsis: true,
|
|
render: (text, record) => /* @__PURE__ */ _react_17_0_2_react.createElement("span", { style: { color: "#165DFF", cursor: "pointer" }, onClick: () => {
|
|
var _a2;
|
|
_umi_production_exports.history.push(`/colleges/${(_a2 = record == null ? void 0 : record.school_info) == null ? void 0 : _a2.id}/statistics`);
|
|
} }, text)
|
|
},
|
|
{
|
|
title: "\u5B66\u751F\uFF08\u4EBA\uFF09",
|
|
dataIndex: "student_count",
|
|
key: "student_count",
|
|
width: 90,
|
|
ellipsis: true,
|
|
render: (text, record) => /* @__PURE__ */ _react_17_0_2_react.createElement("span", { style: { color: "#165DFF", cursor: "pointer" }, onClick: () => {
|
|
var _a2;
|
|
_umi_production_exports.history.push(`/colleges/${(_a2 = record == null ? void 0 : record.school_info) == null ? void 0 : _a2.id}/statistics`);
|
|
} }, text)
|
|
},
|
|
{
|
|
title: "\u7C7B\u578B",
|
|
dataIndex: "type_cn",
|
|
key: "type_cn",
|
|
width: 100,
|
|
ellipsis: true,
|
|
render: (text) => /* @__PURE__ */ _react_17_0_2_react.createElement("span", { style: { color: "#333" } }, text)
|
|
},
|
|
{
|
|
title: "\u670D\u52A1\u671F",
|
|
dataIndex: "service_end_time",
|
|
key: "service_end_time",
|
|
ellipsis: true,
|
|
render: (text, record, index) => /* @__PURE__ */ _react_17_0_2_react.createElement(
|
|
"span",
|
|
{
|
|
title: (record == null ? void 0 : record.service_start_time) && (record == null ? void 0 : record.service_end_time) ? `${dayjs_min_default()(record == null ? void 0 : record.service_start_time).format("YYYY-MM-DD HH:mm")} - ${dayjs_min_default()(record == null ? void 0 : record.service_end_time).format("YYYY-MM-DD HH:mm")}` : "--",
|
|
style: { color: "#000" }
|
|
},
|
|
" ",
|
|
(record == null ? void 0 : record.service_start_time) && (record == null ? void 0 : record.service_end_time) ? `${dayjs_min_default()(record == null ? void 0 : record.service_start_time).format("YYYY-MM-DD HH:mm")} - ${dayjs_min_default()(record == null ? void 0 : record.service_end_time).format("YYYY-MM-DD HH:mm")}` : "--"
|
|
)
|
|
},
|
|
{
|
|
title: "\u72B6\u6001",
|
|
dataIndex: "status_cn",
|
|
key: "status_cn",
|
|
align: "right",
|
|
ellipsis: true,
|
|
width: 70,
|
|
render: (text) => /* @__PURE__ */ _react_17_0_2_react.createElement("span", null, text == "\u670D\u52A1\u4E2D" && /* @__PURE__ */ _react_17_0_2_react.createElement("span", { style: { color: "#00B187" } }, text), text == "\u672A\u5F00\u59CB" && /* @__PURE__ */ _react_17_0_2_react.createElement("span", { style: { color: "#849BB6" } }, text), text == "\u5DF2\u8FC7\u671F" && /* @__PURE__ */ _react_17_0_2_react.createElement("span", { style: { color: "#E30000" } }, text))
|
|
}
|
|
];
|
|
(0,_react_17_0_2_react.useEffect)(() => {
|
|
params.keywords = keyVal;
|
|
params.page = 1;
|
|
setParams(CustomAllocate_spreadValues({}, params));
|
|
getList();
|
|
}, [keyVal]);
|
|
function getList() {
|
|
return CustomAllocate_async(this, null, function* () {
|
|
setTableLoading(true);
|
|
const result2 = yield (0,fetch/* default */.ZP)(
|
|
`/api/resource_allocations/list.json`,
|
|
{ method: "get", params }
|
|
);
|
|
if (result2.status == 0) {
|
|
setResult(result2.data);
|
|
}
|
|
setTableLoading(false);
|
|
});
|
|
}
|
|
return /* @__PURE__ */ _react_17_0_2_react.createElement("div", { className: CustomLimitmodules.wrap }, /* @__PURE__ */ _react_17_0_2_react.createElement(_react_17_0_2_react.Fragment, null, /* @__PURE__ */ _react_17_0_2_react.createElement(row/* default */.Z, { justify: "space-between", style: { marginTop: 25 } }, /* @__PURE__ */ _react_17_0_2_react.createElement(col/* default */.Z, null, /* @__PURE__ */ _react_17_0_2_react.createElement(
|
|
ui_customization/* CustomTags */.qp,
|
|
{
|
|
title: "\u7C7B\u578B",
|
|
value: params.type_en,
|
|
onChange: (e) => {
|
|
params.type_en = e;
|
|
params.page = 1;
|
|
setParams(CustomAllocate_spreadValues({}, params));
|
|
getList();
|
|
},
|
|
dataSource: [
|
|
{ name: "\u5168\u90E8", id: null },
|
|
{ name: "\u4ED8\u8D39\u7528\u6237", id: "payed" },
|
|
{ name: "\u91CD\u70B9\u8DDF\u8FDB\u7528\u6237", id: "follow" }
|
|
],
|
|
titleWidth: 28,
|
|
style: { flex: 1 }
|
|
}
|
|
)), /* @__PURE__ */ _react_17_0_2_react.createElement(col/* default */.Z, null, /* @__PURE__ */ _react_17_0_2_react.createElement(
|
|
ui_customization/* CustomButton */.op,
|
|
{
|
|
onClick: () => {
|
|
(0,util/* openNewWindow */.xg)(`https://marketing.educoder.net/missions/businesses`);
|
|
}
|
|
},
|
|
"\u65B0\u589E"
|
|
))), /* @__PURE__ */ _react_17_0_2_react.createElement(
|
|
ui_customization/* CustomTags */.qp,
|
|
{
|
|
title: "\u72B6\u6001",
|
|
value: params.status_en,
|
|
onChange: (e) => {
|
|
params.status_en = e;
|
|
params.page = 1;
|
|
setParams(CustomAllocate_spreadValues({}, params));
|
|
getList();
|
|
},
|
|
dataSource: [
|
|
{ name: "\u5168\u90E8", id: null },
|
|
{ name: "\u670D\u52A1\u4E2D", id: "inservice" },
|
|
{ name: "\u672A\u5F00\u59CB", id: "unstart" },
|
|
{ name: "\u5DF2\u8FC7\u671F", id: "expired" }
|
|
],
|
|
titleWidth: 28,
|
|
style: { flex: 1 }
|
|
}
|
|
)), /* @__PURE__ */ _react_17_0_2_react.createElement(ui_customization/* CustomTable */.Gi, null, /* @__PURE__ */ _react_17_0_2_react.createElement(
|
|
table["default"],
|
|
{
|
|
columns,
|
|
loading: tableLoading,
|
|
dataSource: result == null ? void 0 : result.list,
|
|
pagination: {
|
|
size: "default",
|
|
showQuickJumper: true,
|
|
showSizeChanger: true,
|
|
pageSizeOptions: ["10", "15", "50", "100", "200"],
|
|
hideOnSinglePage: true,
|
|
pageSize: params.limit,
|
|
current: params.page,
|
|
position: ["bottomRight"],
|
|
onChange: (page, pagesize) => {
|
|
params.page = page;
|
|
params.limit = pagesize;
|
|
setParams(CustomAllocate_spreadValues({}, params));
|
|
getList();
|
|
},
|
|
total: result == null ? void 0 : result.count,
|
|
showTotal: (total, range) => /* @__PURE__ */ _react_17_0_2_react.createElement("span", null, "\u5171", /* @__PURE__ */ _react_17_0_2_react.createElement("span", { style: { color: "#165DFF" } }, " ", total, " "), "\u6761\u6570\u636E")
|
|
}
|
|
}
|
|
)));
|
|
};
|
|
/* harmony default export */ var ResourceAllocation_CustomAllocate = ((0,_umi_production_exports.connect)(
|
|
({
|
|
globalSetting,
|
|
user
|
|
}) => ({
|
|
globalSetting,
|
|
user
|
|
})
|
|
)(CustomAllocate));
|
|
|
|
;// CONCATENATED MODULE: ./src/pages/User/Detail/ResourceAllocation/BusinessContact/index.less?modules
|
|
// extracted by mini-css-extract-plugin
|
|
/* harmony default export */ var BusinessContactmodules = ({"flex_box_center":"flex_box_center___FfWRq","flex_space_between":"flex_space_between___fvv7j","flex_box_vertical_center":"flex_box_vertical_center___kqC9r","flex_box_center_end":"flex_box_center_end___lIoU5","flex_box_column":"flex_box_column___LbSUa","wrap":"wrap___jDAui","real_name":"real_name___S6qbO","operationBtn":"operationBtn___BCmW0","reject":"reject___BGUoY","approve":"approve___YzRm9","rejectBtn":"rejectBtn___J9fWg","approveBtn":"approveBtn___WJo_j","user_model":"user_model___AAO5L","zybzForm":"zybzForm___wXOC_","dataPicker":"dataPicker___kp0Fa","graaytitle":"graaytitle___oz6Mk","must":"must___UwXkJ","ActvieE3":"ActvieE3___lMVJr","allbox":"allbox___i1YQn","customModal":"customModal___HQqjh","shezhi":"shezhi___fKg49","operator":"operator___Yv6gN","tag":"tag___K_qOD"});
|
|
// EXTERNAL MODULE: ./node_modules/_antd@5.9.0@antd/es/auto-complete/index.js
|
|
var auto_complete = __webpack_require__(88522);
|
|
// EXTERNAL MODULE: ./node_modules/_antd@5.9.0@antd/es/button/index.js
|
|
var es_button = __webpack_require__(3113);
|
|
// EXTERNAL MODULE: ./node_modules/_react-infinite-scroller@1.2.4@react-infinite-scroller/index.js
|
|
var _react_infinite_scroller_1_2_4_react_infinite_scroller = __webpack_require__(26724);
|
|
var _react_infinite_scroller_1_2_4_react_infinite_scroller_default = /*#__PURE__*/__webpack_require__.n(_react_infinite_scroller_1_2_4_react_infinite_scroller);
|
|
// EXTERNAL MODULE: ./src/service/classrooms.ts
|
|
var classrooms = __webpack_require__(65998);
|
|
// EXTERNAL MODULE: ./src/components/ImagesIcon/index.ts + 32 modules
|
|
var ImagesIcon = __webpack_require__(86231);
|
|
;// CONCATENATED MODULE: ./src/pages/User/Detail/ResourceAllocation/components/AddTeacher.tsx
|
|
/* provided dependency */ var AddTeacher_React = __webpack_require__(/*! react */ 59301);
|
|
var AddTeacher_defProp = Object.defineProperty;
|
|
var AddTeacher_getOwnPropSymbols = Object.getOwnPropertySymbols;
|
|
var AddTeacher_hasOwnProp = Object.prototype.hasOwnProperty;
|
|
var AddTeacher_propIsEnum = Object.prototype.propertyIsEnumerable;
|
|
var AddTeacher_defNormalProp = (obj, key, value) => key in obj ? AddTeacher_defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
var AddTeacher_spreadValues = (a, b) => {
|
|
for (var prop in b || (b = {}))
|
|
if (AddTeacher_hasOwnProp.call(b, prop))
|
|
AddTeacher_defNormalProp(a, prop, b[prop]);
|
|
if (AddTeacher_getOwnPropSymbols)
|
|
for (var prop of AddTeacher_getOwnPropSymbols(b)) {
|
|
if (AddTeacher_propIsEnum.call(b, prop))
|
|
AddTeacher_defNormalProp(a, prop, b[prop]);
|
|
}
|
|
return a;
|
|
};
|
|
var AddTeacher_async = (__this, __arguments, generator) => {
|
|
return new Promise((resolve, reject) => {
|
|
var fulfilled = (value) => {
|
|
try {
|
|
step(generator.next(value));
|
|
} catch (e) {
|
|
reject(e);
|
|
}
|
|
};
|
|
var rejected = (value) => {
|
|
try {
|
|
step(generator.throw(value));
|
|
} catch (e) {
|
|
reject(e);
|
|
}
|
|
};
|
|
var step = (x) => x.done ? resolve(x.value) : Promise.resolve(x.value).then(fulfilled, rejected);
|
|
step((generator = generator.apply(__this, __arguments)).next());
|
|
});
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
const AddTeacher = ({ classroomList, loading, dispatch, onTags }) => {
|
|
var _a, _b;
|
|
const params = (0,_umi_production_exports.useParams)();
|
|
const { actionTabs } = classroomList;
|
|
const [options, setOptions] = (0,_react_17_0_2_react.useState)([]);
|
|
const [hasMore, setHasmore] = (0,_react_17_0_2_react.useState)(true);
|
|
const [isLoading, setIsLoading] = (0,_react_17_0_2_react.useState)(false);
|
|
const [form] = es_form["default"].useForm();
|
|
const [tableData, setTableData] = (0,_react_17_0_2_react.useState)([]);
|
|
const [page, setPage] = (0,_react_17_0_2_react.useState)(0);
|
|
const [selectArrs, setSelectArrs] = (0,_react_17_0_2_react.useState)([]);
|
|
const [selectRows, setSelectRows] = (0,_react_17_0_2_react.useState)([]);
|
|
const [notSearch, setNotSearch] = (0,_react_17_0_2_react.useState)(true);
|
|
const autoCompleteRef = (0,_react_17_0_2_react.useRef)();
|
|
(0,_react_17_0_2_react.useEffect)(() => {
|
|
if (classroomList.actionTabs.key === "\u6DFB\u52A0\u5BF9\u63A5\u4EBA") {
|
|
setNotSearch(true);
|
|
getData();
|
|
}
|
|
}, [classroomList.actionTabs.key]);
|
|
const getData = () => AddTeacher_async(void 0, null, function* () {
|
|
const res = yield dispatch({
|
|
type: "classroomList/getSchoolList",
|
|
payload: {}
|
|
});
|
|
setOptions(res.map((item) => {
|
|
return { value: item };
|
|
}));
|
|
});
|
|
const onFinish = () => {
|
|
var _a2;
|
|
if (((_a2 = form.getFieldValue()) == null ? void 0 : _a2.keyword) === "") {
|
|
setTableData([]);
|
|
message/* default */.ZP.error("\u8BF7\u8F93\u5165\u641C\u7D22\u5185\u5BB9");
|
|
return;
|
|
}
|
|
;
|
|
setNotSearch(false);
|
|
setHasmore(true);
|
|
setIsLoading(false);
|
|
setSelectArrs([]);
|
|
setTimeout(() => {
|
|
handleInfiniteOnLoad(true);
|
|
}, 200);
|
|
};
|
|
const saveSelect = (id, record) => {
|
|
id = String(id);
|
|
const key = selectArrs.indexOf(id);
|
|
if (key < 0) {
|
|
selectArrs.push(id);
|
|
selectRows.push({ user_id: record == null ? void 0 : record.numid, name: record == null ? void 0 : record.username });
|
|
} else {
|
|
selectArrs.splice(key, 1);
|
|
selectRows.splice(key, 1);
|
|
}
|
|
setSelectArrs([...selectArrs]);
|
|
setSelectRows([...selectRows]);
|
|
};
|
|
const handleInfiniteOnLoad = (reload = false) => AddTeacher_async(void 0, null, function* () {
|
|
var _a2;
|
|
if ((reload || hasMore) && !isLoading) {
|
|
const formValue = form.getFieldValue();
|
|
setIsLoading(true);
|
|
setPage(reload ? 1 : page + 1);
|
|
const res = yield (0,classrooms/* searchSchoolTeacherList */.nQ)(AddTeacher_spreadValues({
|
|
page: reload ? 1 : page + 1,
|
|
container_id: params.coursesId,
|
|
container_type: 1,
|
|
school_name: formValue == null ? void 0 : formValue.school_name,
|
|
keyword: formValue == null ? void 0 : formValue.keyword
|
|
}, formValue));
|
|
reload ? setTableData([...res.users]) : setTableData([...tableData, ...res.users]);
|
|
setIsLoading(false);
|
|
if (((_a2 = res.users) == null ? void 0 : _a2.length) < 10)
|
|
setHasmore(false);
|
|
}
|
|
});
|
|
const onOK = () => AddTeacher_async(void 0, null, function* () {
|
|
if (selectArrs == "") {
|
|
message/* default */.ZP.error("\u8BF7\u9009\u62E9\u4EBA\u6570");
|
|
} else {
|
|
onTags(selectRows);
|
|
dispatch({
|
|
type: "classroomList/setActionTabs",
|
|
payload: {}
|
|
});
|
|
}
|
|
});
|
|
const columns = [
|
|
{
|
|
title: "",
|
|
dataIndex: "added",
|
|
width: 40,
|
|
ellipsis: true,
|
|
render: (add, record) => {
|
|
return /* @__PURE__ */ AddTeacher_React.createElement(
|
|
es_checkbox["default"],
|
|
{
|
|
value: record.numid,
|
|
checked: selectArrs.includes(String(record.numid)),
|
|
disabled: !!add
|
|
}
|
|
);
|
|
}
|
|
},
|
|
{
|
|
title: "\u59D3\u540D",
|
|
width: 100,
|
|
ellipsis: true,
|
|
dataIndex: "username",
|
|
render: (text, record) => {
|
|
return /* @__PURE__ */ AddTeacher_React.createElement(tooltip/* default */.Z, { placement: "bottom", title: text }, /* @__PURE__ */ AddTeacher_React.createElement(_umi_production_exports.Link, { className: "bold c-black", to: `/users/${record.login}`, target: "_blank" }, text || "--"));
|
|
}
|
|
},
|
|
{
|
|
title: "\u624B\u673A",
|
|
width: 100,
|
|
dataIndex: "phone",
|
|
ellipsis: true,
|
|
render: (text) => {
|
|
return /* @__PURE__ */ AddTeacher_React.createElement(tooltip/* default */.Z, { placement: "bottom", title: text }, /* @__PURE__ */ AddTeacher_React.createElement("span", null, text || "--"));
|
|
}
|
|
},
|
|
{
|
|
title: "\u90AE\u7BB1",
|
|
dataIndex: "email",
|
|
width: 100,
|
|
ellipsis: true,
|
|
render: (text) => {
|
|
return /* @__PURE__ */ AddTeacher_React.createElement(tooltip/* default */.Z, { placement: "bottom", title: text }, /* @__PURE__ */ AddTeacher_React.createElement("span", null, text || "--"));
|
|
}
|
|
},
|
|
{
|
|
title: "\u5B66\u53F7/\u5DE5\u53F7",
|
|
width: 100,
|
|
dataIndex: "student_number",
|
|
ellipsis: true,
|
|
render: (text) => {
|
|
return /* @__PURE__ */ AddTeacher_React.createElement(tooltip/* default */.Z, { placement: "bottom", title: text }, /* @__PURE__ */ AddTeacher_React.createElement("span", null, text || "--"));
|
|
}
|
|
},
|
|
{
|
|
title: "\u5B66\u6821/\u5355\u4F4D",
|
|
width: 150,
|
|
dataIndex: "school_name",
|
|
ellipsis: true,
|
|
render: (text) => {
|
|
return /* @__PURE__ */ AddTeacher_React.createElement(tooltip/* default */.Z, { placement: "bottom", title: text }, /* @__PURE__ */ AddTeacher_React.createElement("span", null, text || "--"));
|
|
}
|
|
},
|
|
{
|
|
title: "\u9662\u7CFB/\u90E8\u95E8",
|
|
dataIndex: "depart_name",
|
|
width: 130,
|
|
ellipsis: true,
|
|
render: (text) => {
|
|
return /* @__PURE__ */ AddTeacher_React.createElement(tooltip/* default */.Z, { placement: "bottom", title: text }, /* @__PURE__ */ AddTeacher_React.createElement("span", null, text || "--"));
|
|
}
|
|
},
|
|
{
|
|
title: "\u5B9E\u540D\u8BA4\u8BC1",
|
|
dataIndex: "school_name",
|
|
width: 100,
|
|
render: (text) => text ? "\u662F" : "\u5426"
|
|
},
|
|
{
|
|
title: "\u6700\u540E\u767B\u5F55\u65F6\u95F4",
|
|
dataIndex: "last_login_on",
|
|
width: 140,
|
|
ellipsis: true,
|
|
render: (text) => {
|
|
return /* @__PURE__ */ AddTeacher_React.createElement(tooltip/* default */.Z, { placement: "bottom", title: text }, /* @__PURE__ */ AddTeacher_React.createElement("span", null, dayjs_min_default()(text).format("YYYY-MM-DD HH:mm")));
|
|
}
|
|
},
|
|
{
|
|
title: "\u72B6\u6001",
|
|
dataIndex: "added",
|
|
width: 80,
|
|
render: (text) => {
|
|
if (text === 1) {
|
|
return /* @__PURE__ */ AddTeacher_React.createElement("span", { className: "c-green" }, "\u5DF2\u6DFB\u52A0");
|
|
}
|
|
}
|
|
}
|
|
];
|
|
return /* @__PURE__ */ AddTeacher_React.createElement(
|
|
es_modal["default"],
|
|
{
|
|
centered: true,
|
|
title: "\u6DFB\u52A0\u5BF9\u63A5\u4EBA",
|
|
open: classroomList.actionTabs.key === "\u6DFB\u52A0\u5BF9\u63A5\u4EBA" ? true : false,
|
|
okText: "\u786E\u5B9A",
|
|
cancelText: "\u53D6\u6D88",
|
|
width: 1100,
|
|
zIndex: 1e3,
|
|
bodyStyle: { minHeight: 200 },
|
|
onOk: () => AddTeacher_async(void 0, null, function* () {
|
|
onOK();
|
|
}),
|
|
onCancel: () => {
|
|
setSelectArrs([]);
|
|
dispatch({
|
|
type: "classroomList/setActionTabs",
|
|
payload: {}
|
|
});
|
|
}
|
|
},
|
|
/* @__PURE__ */ AddTeacher_React.createElement(
|
|
es_form["default"],
|
|
{
|
|
layout: "inline",
|
|
form,
|
|
initialValues: {
|
|
school_name: "",
|
|
keyword: "",
|
|
search_type: "1"
|
|
},
|
|
className: "mt10"
|
|
},
|
|
/* @__PURE__ */ AddTeacher_React.createElement(es_form["default"].Item, { name: "search_type", label: "\u641C\u7D22\u7C7B\u578B" }, /* @__PURE__ */ AddTeacher_React.createElement(es_select["default"], { style: { width: 90 } }, /* @__PURE__ */ AddTeacher_React.createElement(es_select["default"].Option, { value: "1" }, "\u59D3\u540D"), /* @__PURE__ */ AddTeacher_React.createElement(es_select["default"].Option, { value: "2" }, "\u624B\u673A\u53F7"), /* @__PURE__ */ AddTeacher_React.createElement(es_select["default"].Option, { value: "3" }, "\u90AE\u7BB1"))),
|
|
/* @__PURE__ */ AddTeacher_React.createElement(es_form["default"].Item, { name: "keyword", label: "\u641C\u7D22\u5185\u5BB9\uFF1A" }, /* @__PURE__ */ AddTeacher_React.createElement(input["default"], { allowClear: true, style: { width: 250 }, size: "middle", defaultValue: ((_a = actionTabs.selectArrs) == null ? void 0 : _a.category_name) || ((_b = actionTabs.selectArrs) == null ? void 0 : _b.name) })),
|
|
/* @__PURE__ */ AddTeacher_React.createElement(es_form["default"].Item, { name: "school_name", label: "\u5355\u4F4D\uFF1A" }, /* @__PURE__ */ AddTeacher_React.createElement(
|
|
auto_complete/* default */.Z,
|
|
{
|
|
options,
|
|
style: { width: 390 },
|
|
size: "middle",
|
|
placeholder: "\u8BF7\u8F93\u5165\u5355\u4F4D\u540D\u79F0",
|
|
filterOption: (inputValue, option) => option.value.toUpperCase().indexOf(inputValue.toUpperCase()) !== -1
|
|
}
|
|
)),
|
|
/* @__PURE__ */ AddTeacher_React.createElement(es_form["default"].Item, null, /* @__PURE__ */ AddTeacher_React.createElement(es_button/* default */.ZP, { htmlType: "submit", type: "primary", size: "middle", onClick: () => onFinish() }, "\u641C\u7D22"))
|
|
),
|
|
notSearch && /* @__PURE__ */ AddTeacher_React.createElement("div", { className: "tc font16 c-light-black mt40 pb30" }, /* @__PURE__ */ AddTeacher_React.createElement("img", { src: ImagesIcon/* searchIcon */.RL, width: "100", alt: "" }), /* @__PURE__ */ AddTeacher_React.createElement("br", null), /* @__PURE__ */ AddTeacher_React.createElement("p", { className: "mt20" }, "\u8BF7\u641C\u7D22\u8981\u6DFB\u52A0\u7684\u4EBA\u5458")),
|
|
!notSearch && tableData == "" && !isLoading && /* @__PURE__ */ AddTeacher_React.createElement("div", { className: "tc font16 c-light-black mt40 pb30" }, /* @__PURE__ */ AddTeacher_React.createElement("img", { src: ImagesIcon/* noDataIcon */.z3, width: "100", alt: "" }), /* @__PURE__ */ AddTeacher_React.createElement("br", null), /* @__PURE__ */ AddTeacher_React.createElement("p", { className: "mt20" }, "\u6682\u65F6\u8FD8\u6CA1\u6709\u76F8\u5173\u6570\u636E\u54E6!")),
|
|
(!notSearch && tableData != "" || isLoading) && /* @__PURE__ */ AddTeacher_React.createElement("section", null, /* @__PURE__ */ AddTeacher_React.createElement("div", { className: "flexd-table-header mt20" }, /* @__PURE__ */ AddTeacher_React.createElement(table["default"], { pagination: false, dataSource: [], columns })), /* @__PURE__ */ AddTeacher_React.createElement(
|
|
"div",
|
|
{
|
|
style: {
|
|
maxHeight: 260,
|
|
overflow: "auto"
|
|
}
|
|
},
|
|
/* @__PURE__ */ AddTeacher_React.createElement(
|
|
(_react_infinite_scroller_1_2_4_react_infinite_scroller_default()),
|
|
{
|
|
initialLoad: false,
|
|
pageStart: 1,
|
|
threshold: 20,
|
|
loadMore: (page2) => {
|
|
handleInfiniteOnLoad();
|
|
},
|
|
hasMore,
|
|
useWindow: false
|
|
},
|
|
/* @__PURE__ */ AddTeacher_React.createElement(
|
|
table["default"],
|
|
{
|
|
loading: isLoading,
|
|
showHeader: false,
|
|
pagination: false,
|
|
dataSource: tableData,
|
|
columns,
|
|
onRow: (record) => {
|
|
return {
|
|
onClick: (event) => {
|
|
console.log(record);
|
|
console.log(event.currentTarget.querySelector("input"));
|
|
if (!event.currentTarget.querySelector("input").disabled)
|
|
saveSelect(event.currentTarget.querySelector("input").value, record);
|
|
}
|
|
};
|
|
}
|
|
}
|
|
)
|
|
)
|
|
))
|
|
);
|
|
};
|
|
/* harmony default export */ var components_AddTeacher = ((0,_umi_production_exports.connect)(
|
|
({
|
|
classroomList,
|
|
loading
|
|
}) => ({
|
|
classroomList,
|
|
loading
|
|
})
|
|
)(AddTeacher));
|
|
|
|
;// CONCATENATED MODULE: ./src/pages/User/Detail/ResourceAllocation/BusinessContact/index.tsx
|
|
/* provided dependency */ var BusinessContact_React = __webpack_require__(/*! react */ 59301);
|
|
var BusinessContact_defProp = Object.defineProperty;
|
|
var BusinessContact_getOwnPropSymbols = Object.getOwnPropertySymbols;
|
|
var BusinessContact_hasOwnProp = Object.prototype.hasOwnProperty;
|
|
var BusinessContact_propIsEnum = Object.prototype.propertyIsEnumerable;
|
|
var BusinessContact_defNormalProp = (obj, key, value) => key in obj ? BusinessContact_defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
var BusinessContact_spreadValues = (a, b) => {
|
|
for (var prop in b || (b = {}))
|
|
if (BusinessContact_hasOwnProp.call(b, prop))
|
|
BusinessContact_defNormalProp(a, prop, b[prop]);
|
|
if (BusinessContact_getOwnPropSymbols)
|
|
for (var prop of BusinessContact_getOwnPropSymbols(b)) {
|
|
if (BusinessContact_propIsEnum.call(b, prop))
|
|
BusinessContact_defNormalProp(a, prop, b[prop]);
|
|
}
|
|
return a;
|
|
};
|
|
var BusinessContact_objRest = (source, exclude) => {
|
|
var target = {};
|
|
for (var prop in source)
|
|
if (BusinessContact_hasOwnProp.call(source, prop) && exclude.indexOf(prop) < 0)
|
|
target[prop] = source[prop];
|
|
if (source != null && BusinessContact_getOwnPropSymbols)
|
|
for (var prop of BusinessContact_getOwnPropSymbols(source)) {
|
|
if (exclude.indexOf(prop) < 0 && BusinessContact_propIsEnum.call(source, prop))
|
|
target[prop] = source[prop];
|
|
}
|
|
return target;
|
|
};
|
|
var BusinessContact_async = (__this, __arguments, generator) => {
|
|
return new Promise((resolve, reject) => {
|
|
var fulfilled = (value) => {
|
|
try {
|
|
step(generator.next(value));
|
|
} catch (e) {
|
|
reject(e);
|
|
}
|
|
};
|
|
var rejected = (value) => {
|
|
try {
|
|
step(generator.throw(value));
|
|
} catch (e) {
|
|
reject(e);
|
|
}
|
|
};
|
|
var step = (x) => x.done ? resolve(x.value) : Promise.resolve(x.value).then(fulfilled, rejected);
|
|
step((generator = generator.apply(__this, __arguments)).next());
|
|
});
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
const BusinessContact = (_a) => {
|
|
var _b = _a, {
|
|
globalSetting,
|
|
user,
|
|
dispatch,
|
|
keyVal
|
|
} = _b, props = BusinessContact_objRest(_b, [
|
|
"globalSetting",
|
|
"user",
|
|
"dispatch",
|
|
"keyVal"
|
|
]);
|
|
const [activeStatus, setActiveStatus] = (0,_react_17_0_2_react.useState)(0);
|
|
const [params, setParams] = (0,_react_17_0_2_react.useState)({
|
|
page: 1,
|
|
limit: 10,
|
|
keywords: null,
|
|
status: 0
|
|
});
|
|
const [result, setResult] = (0,_react_17_0_2_react.useState)();
|
|
const [tableLoading, setTableLoading] = (0,_react_17_0_2_react.useState)(true);
|
|
const [customModal, setCustomModal] = (0,_react_17_0_2_react.useState)(false);
|
|
const [isCreate, setIsCreate] = (0,_react_17_0_2_react.useState)(false);
|
|
const [form] = es_form["default"].useForm();
|
|
const [form1] = es_form["default"].useForm();
|
|
const [selectedRow, setSelectedRow] = (0,_react_17_0_2_react.useState)({});
|
|
const [btnLoading, setBtnLoading] = (0,_react_17_0_2_react.useState)(false);
|
|
const [tags, setTags] = (0,_react_17_0_2_react.useState)([]);
|
|
const columns = [
|
|
{
|
|
title: "\u5E8F\u53F7",
|
|
dataIndex: "id",
|
|
key: "id",
|
|
ellipsis: true,
|
|
fixed: "left",
|
|
width: 60,
|
|
render: (text, record, index) => {
|
|
return /* @__PURE__ */ BusinessContact_React.createElement("span", { style: { color: "#333" } }, params.limit * (params.page - 1) + index + 1);
|
|
}
|
|
},
|
|
{
|
|
title: "\u53D1\u8D77\u4EBA",
|
|
dataIndex: "user",
|
|
key: "user",
|
|
width: 90,
|
|
ellipsis: true,
|
|
render: (text, record, index) => /* @__PURE__ */ BusinessContact_React.createElement("span", { style: { color: "#333" } }, text.name)
|
|
},
|
|
{
|
|
title: "\u6240\u5C5E\u5355\u4F4D",
|
|
dataIndex: "school",
|
|
key: "school",
|
|
width: 100,
|
|
ellipsis: true,
|
|
render: (text, record, index) => /* @__PURE__ */ BusinessContact_React.createElement("span", { style: { color: "#333" } }, text.name)
|
|
},
|
|
{
|
|
title: "\u5B66\u9662\u540D\u79F0",
|
|
dataIndex: "department",
|
|
key: "department",
|
|
width: 150,
|
|
ellipsis: true,
|
|
render: (text, record) => /* @__PURE__ */ BusinessContact_React.createElement("span", { style: { color: "#333" } }, text.name)
|
|
},
|
|
{
|
|
title: "\u8054\u7CFB\u7535\u8BDD",
|
|
width: 120,
|
|
dataIndex: "phone",
|
|
render: (text, record) => {
|
|
return /* @__PURE__ */ BusinessContact_React.createElement("span", { className: "c-black" }, text || "--");
|
|
}
|
|
},
|
|
{
|
|
title: "\u7535\u5B50\u90AE\u7BB1",
|
|
width: 180,
|
|
dataIndex: "email",
|
|
ellipsis: true,
|
|
render: (text, record) => {
|
|
return /* @__PURE__ */ BusinessContact_React.createElement("span", { className: "c-black" }, text || "--");
|
|
}
|
|
},
|
|
{
|
|
title: "\u53D1\u8D77\u65F6\u95F4",
|
|
dataIndex: "start_time",
|
|
key: "start_time",
|
|
ellipsis: true,
|
|
render: (text, record, index) => /* @__PURE__ */ BusinessContact_React.createElement("span", { style: { color: "#666" } }, text ? dayjs_min_default()(text).format("YYYY-MM-DD HH:mm") : "--")
|
|
},
|
|
{
|
|
title: /* @__PURE__ */ BusinessContact_React.createElement("span", null, "\u64CD\u4F5C"),
|
|
align: "right",
|
|
width: 60,
|
|
render: (text, record) => /* @__PURE__ */ BusinessContact_React.createElement(BusinessContact_React.Fragment, null, /* @__PURE__ */ BusinessContact_React.createElement("a", { type: "link", style: { whiteSpace: "nowrap", padding: 0, color: "#165DFF" }, onClick: () => BusinessContact_async(void 0, null, function* () {
|
|
setIsCreate(true);
|
|
setSelectedRow(record);
|
|
setCustomModal(true);
|
|
}) }, "\u53BB\u5904\u7406"))
|
|
}
|
|
];
|
|
const columns1 = [
|
|
{
|
|
title: "\u5E8F\u53F7",
|
|
dataIndex: "id",
|
|
key: "id",
|
|
ellipsis: true,
|
|
fixed: "left",
|
|
width: 60,
|
|
render: (text, record, index) => {
|
|
return /* @__PURE__ */ BusinessContact_React.createElement("span", { style: { color: "#333" } }, params.limit * (params.page - 1) + index + 1);
|
|
}
|
|
},
|
|
{
|
|
title: "\u53D1\u8D77\u4EBA",
|
|
dataIndex: "user",
|
|
key: "user",
|
|
width: 90,
|
|
fixed: "left",
|
|
ellipsis: true,
|
|
render: (text, record, index) => /* @__PURE__ */ BusinessContact_React.createElement("span", { style: { color: "#333" } }, text.name)
|
|
},
|
|
{
|
|
title: "\u6240\u5C5E\u5355\u4F4D",
|
|
dataIndex: "school",
|
|
key: "school",
|
|
width: 100,
|
|
fixed: "left",
|
|
ellipsis: true,
|
|
render: (text, record, index) => /* @__PURE__ */ BusinessContact_React.createElement("span", { style: { color: "#333" } }, text.name)
|
|
},
|
|
{
|
|
title: "\u5B66\u9662\u540D\u79F0",
|
|
dataIndex: "department",
|
|
key: "department",
|
|
width: 100,
|
|
ellipsis: true,
|
|
fixed: "left",
|
|
render: (text, record) => /* @__PURE__ */ BusinessContact_React.createElement("span", { style: { color: "#333" } }, text.name)
|
|
},
|
|
{
|
|
title: "\u8054\u7CFB\u7535\u8BDD",
|
|
width: 100,
|
|
dataIndex: "phone",
|
|
render: (text, record) => {
|
|
return /* @__PURE__ */ BusinessContact_React.createElement("span", { style: { color: "#333" } }, text || "--");
|
|
}
|
|
},
|
|
{
|
|
title: "\u7535\u5B50\u90AE\u7BB1",
|
|
width: 120,
|
|
dataIndex: "email",
|
|
ellipsis: true,
|
|
render: (text, record) => {
|
|
return /* @__PURE__ */ BusinessContact_React.createElement("span", { style: { color: "#333" } }, text || "--");
|
|
}
|
|
},
|
|
{
|
|
title: "\u53D1\u8D77\u65F6\u95F4",
|
|
dataIndex: "start_time",
|
|
key: "start_time",
|
|
ellipsis: true,
|
|
width: 120,
|
|
render: (text, record, index) => /* @__PURE__ */ BusinessContact_React.createElement("span", { style: { color: "#666" } }, text ? dayjs_min_default()(text).format("YYYY-MM-DD HH:mm") : "--")
|
|
},
|
|
{
|
|
title: "\u5BF9\u63A5\u4EBA",
|
|
dataIndex: "operator_name",
|
|
key: "operator_name",
|
|
width: 90,
|
|
ellipsis: true,
|
|
render: (text, record, index) => /* @__PURE__ */ BusinessContact_React.createElement("span", { style: { color: "#333" } }, text || "--")
|
|
},
|
|
{
|
|
title: "\u5904\u7406\u65F6\u95F4",
|
|
dataIndex: "handle_time",
|
|
key: "handle_time",
|
|
ellipsis: true,
|
|
width: 120,
|
|
render: (text, record, index) => /* @__PURE__ */ BusinessContact_React.createElement("span", { style: { color: "#666" } }, text ? dayjs_min_default()(text).format("YYYY-MM-DD HH:mm") : "--")
|
|
},
|
|
{
|
|
title: "\u5907\u6CE8",
|
|
dataIndex: "notes",
|
|
key: "notes",
|
|
width: 90,
|
|
ellipsis: true,
|
|
render: (text, record, index) => /* @__PURE__ */ BusinessContact_React.createElement("span", { style: { color: "#666" } }, text || "--")
|
|
},
|
|
{
|
|
title: /* @__PURE__ */ BusinessContact_React.createElement("span", null, "\u64CD\u4F5C"),
|
|
align: "right",
|
|
width: 60,
|
|
fixed: "right",
|
|
render: (text, record) => /* @__PURE__ */ BusinessContact_React.createElement(BusinessContact_React.Fragment, null, /* @__PURE__ */ BusinessContact_React.createElement("a", { type: "link", style: { whiteSpace: "nowrap", padding: 0, color: "#165DFF" }, onClick: () => BusinessContact_async(void 0, null, function* () {
|
|
setIsCreate(false);
|
|
const detailData = {
|
|
operator_name: record == null ? void 0 : record.operator_name,
|
|
notes: record == null ? void 0 : record.notes
|
|
};
|
|
form.setFieldsValue(detailData);
|
|
setSelectedRow(record);
|
|
setCustomModal(true);
|
|
setTags(record == null ? void 0 : record.operator);
|
|
}) }, "\u7F16\u8F91"))
|
|
}
|
|
];
|
|
(0,_react_17_0_2_react.useEffect)(() => {
|
|
params.keywords = keyVal;
|
|
params.page = 1;
|
|
setParams(BusinessContact_spreadValues({}, params));
|
|
getList();
|
|
}, [keyVal]);
|
|
function getList() {
|
|
return BusinessContact_async(this, null, function* () {
|
|
setTableLoading(true);
|
|
const res = yield (0,fetch/* default */.ZP)(
|
|
`/api/business_contacts.json`,
|
|
{ method: "get", params }
|
|
);
|
|
if (res.status == 0) {
|
|
setResult(res.data);
|
|
}
|
|
setTableLoading(false);
|
|
});
|
|
}
|
|
const handleFinish = (values) => BusinessContact_async(void 0, null, function* () {
|
|
setBtnLoading(true);
|
|
const res = yield (0,fetch/* default */.ZP)(
|
|
`/api/business_contacts/${selectedRow == null ? void 0 : selectedRow.id}.json`,
|
|
{
|
|
method: "put",
|
|
body: BusinessContact_spreadValues({}, values)
|
|
}
|
|
);
|
|
if (res.status == 0) {
|
|
message/* default */.ZP.success(isCreate ? "\u521B\u5EFA\u6210\u529F" : "\u66F4\u65B0\u6210\u529F");
|
|
form.resetFields();
|
|
setCustomModal(false);
|
|
setIsCreate(false);
|
|
yield getList();
|
|
}
|
|
setBtnLoading(false);
|
|
setCustomModal(false);
|
|
});
|
|
const handleClose = (removedTag) => {
|
|
const newTags = tags.filter((tag) => tag.user_id !== removedTag);
|
|
console.log(newTags);
|
|
setTags(newTags);
|
|
};
|
|
const handleTags = (ids) => {
|
|
const data = [...tags, ...ids];
|
|
const uniqueData = Array.from(
|
|
data.reduce((map, item) => map.set(item.user_id, item), /* @__PURE__ */ new Map()).values()
|
|
);
|
|
console.log(uniqueData);
|
|
setTags(uniqueData);
|
|
};
|
|
return /* @__PURE__ */ BusinessContact_React.createElement("div", { className: BusinessContactmodules.wrap }, /* @__PURE__ */ BusinessContact_React.createElement(_react_17_0_2_react.Fragment, null, /* @__PURE__ */ BusinessContact_React.createElement(row/* default */.Z, { justify: "space-between", style: { marginTop: 25 } }, /* @__PURE__ */ BusinessContact_React.createElement(col/* default */.Z, null, /* @__PURE__ */ BusinessContact_React.createElement(
|
|
ui_customization/* CustomTags */.qp,
|
|
{
|
|
title: "\u7C7B\u578B",
|
|
value: activeStatus,
|
|
onChange: (e) => {
|
|
setActiveStatus(e);
|
|
params.status = e;
|
|
params.page = 1;
|
|
setParams(BusinessContact_spreadValues({}, params));
|
|
getList();
|
|
},
|
|
dataSource: [
|
|
{ name: "\u672A\u5904\u7406", id: 0 },
|
|
{ name: "\u5DF2\u5904\u7406", id: 1 }
|
|
],
|
|
titleWidth: 28,
|
|
style: { flex: 1 }
|
|
}
|
|
)))), /* @__PURE__ */ BusinessContact_React.createElement(ui_customization/* CustomTable */.Gi, null, activeStatus === 0 ? /* @__PURE__ */ BusinessContact_React.createElement(
|
|
table["default"],
|
|
{
|
|
columns,
|
|
loading: tableLoading,
|
|
dataSource: result == null ? void 0 : result.list,
|
|
pagination: {
|
|
size: "default",
|
|
showQuickJumper: true,
|
|
showSizeChanger: true,
|
|
pageSizeOptions: ["10", "15", "50", "100", "200"],
|
|
hideOnSinglePage: true,
|
|
pageSize: params.limit,
|
|
current: params.page,
|
|
position: ["bottomRight"],
|
|
onChange: (page, pagesize) => {
|
|
params.page = page;
|
|
params.limit = pagesize;
|
|
setParams(BusinessContact_spreadValues({}, params));
|
|
getList();
|
|
},
|
|
total: result == null ? void 0 : result.count,
|
|
showTotal: (total, range) => /* @__PURE__ */ BusinessContact_React.createElement("span", null, "\u5171", /* @__PURE__ */ BusinessContact_React.createElement("span", { style: { color: "#165DFF" } }, " ", total, " "), "\u6761\u6570\u636E")
|
|
}
|
|
}
|
|
) : /* @__PURE__ */ BusinessContact_React.createElement(
|
|
table["default"],
|
|
{
|
|
columns: columns1,
|
|
loading: tableLoading,
|
|
dataSource: result == null ? void 0 : result.list,
|
|
scroll: { x: 1200 },
|
|
pagination: {
|
|
size: "default",
|
|
showQuickJumper: true,
|
|
showSizeChanger: true,
|
|
pageSizeOptions: ["10", "15", "50", "100", "200"],
|
|
hideOnSinglePage: true,
|
|
pageSize: params.limit,
|
|
current: params.page,
|
|
position: ["bottomRight"],
|
|
onChange: (page, pagesize) => {
|
|
params.page = page;
|
|
params.limit = pagesize;
|
|
setParams(BusinessContact_spreadValues({}, params));
|
|
getList();
|
|
},
|
|
total: result == null ? void 0 : result.count,
|
|
showTotal: (total, range) => /* @__PURE__ */ BusinessContact_React.createElement("span", null, "\u5171", /* @__PURE__ */ BusinessContact_React.createElement("span", { style: { color: "#165DFF" } }, " ", total, " "), "\u6761\u6570\u636E")
|
|
}
|
|
}
|
|
)), /* @__PURE__ */ BusinessContact_React.createElement(
|
|
es_modal["default"],
|
|
{
|
|
centered: true,
|
|
width: 515,
|
|
title: `${isCreate ? "\u5B8C\u6210\u5546\u52A1\u5BF9\u63A5" : "\u7F16\u8F91\u5546\u52A1\u5BF9\u63A5"}`,
|
|
open: customModal,
|
|
okText: "\u786E\u5B9A",
|
|
cancelText: "\u53D6\u6D88",
|
|
maskClosable: false,
|
|
onOk: () => {
|
|
form.submit();
|
|
},
|
|
okButtonProps: { loading: btnLoading },
|
|
className: `${BusinessContactmodules.customModal} ant-form-modal-body`,
|
|
afterClose: () => {
|
|
form.resetFields();
|
|
setTags([]);
|
|
},
|
|
onCancel: () => {
|
|
form.resetFields();
|
|
setCustomModal(false);
|
|
setIsCreate(false);
|
|
}
|
|
},
|
|
/* @__PURE__ */ BusinessContact_React.createElement(
|
|
es_form["default"],
|
|
{
|
|
form,
|
|
layout: "vertical",
|
|
scrollToFirstError: true,
|
|
className: `${BusinessContactmodules.FormDiv}`,
|
|
onFinish: (values) => BusinessContact_async(void 0, null, function* () {
|
|
handleFinish(values);
|
|
})
|
|
},
|
|
/* @__PURE__ */ BusinessContact_React.createElement(
|
|
es_form["default"].Item,
|
|
{
|
|
htmlFor: null,
|
|
label: /* @__PURE__ */ BusinessContact_React.createElement("span", { style: { color: "#5F6368" } }, "\u5BF9\u63A5\u4EBA"),
|
|
name: "operator_name",
|
|
rules: [
|
|
{
|
|
required: true,
|
|
message: "\u8BF7\u586B\u5199\u5BF9\u63A5\u4EBA"
|
|
}
|
|
]
|
|
},
|
|
/* @__PURE__ */ BusinessContact_React.createElement(input["default"], null)
|
|
),
|
|
/* @__PURE__ */ BusinessContact_React.createElement(
|
|
es_form["default"].Item,
|
|
{
|
|
htmlFor: null,
|
|
label: /* @__PURE__ */ BusinessContact_React.createElement("span", { style: { color: "#5F6368" } }, "\u5907\u6CE8"),
|
|
name: "notes",
|
|
rules: [{ type: "string", max: 200, message: "\u8F93\u5165\u8D85\u9650\uFF0C\u8BF7\u7F29\u51CF\u5B57\u7B26\u6570" }]
|
|
},
|
|
/* @__PURE__ */ BusinessContact_React.createElement(
|
|
input["default"].TextArea,
|
|
{
|
|
showCount: true,
|
|
value: form.getFieldValue("notes"),
|
|
maxLength: 200,
|
|
style: { height: 120, resize: "none", marginBottom: 20 },
|
|
placeholder: "\u8BF7\u586B\u5199\u5907\u6CE8",
|
|
rows: 5
|
|
}
|
|
)
|
|
)
|
|
)
|
|
), /* @__PURE__ */ BusinessContact_React.createElement(components_AddTeacher, { onTags: handleTags }));
|
|
};
|
|
/* harmony default export */ var ResourceAllocation_BusinessContact = ((0,_umi_production_exports.connect)(
|
|
({
|
|
globalSetting,
|
|
user
|
|
}) => ({
|
|
globalSetting,
|
|
user
|
|
})
|
|
)(BusinessContact));
|
|
|
|
;// CONCATENATED MODULE: ./src/pages/User/Detail/ResourceAllocation/index.tsx
|
|
/* provided dependency */ var ResourceAllocation_React = __webpack_require__(/*! react */ 59301);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
const ResourceAllocation = ({
|
|
globalSetting,
|
|
dispatch,
|
|
user
|
|
}) => {
|
|
const [activeTab, setActiveTab] = (0,_react_17_0_2_react.useState)(null);
|
|
const [keyVal, setKeyVal] = (0,_react_17_0_2_react.useState)("");
|
|
const [dataSource, setDataSource] = (0,_react_17_0_2_react.useState)([]);
|
|
const handleSearch = (value) => {
|
|
setKeyVal(value);
|
|
};
|
|
(0,_react_17_0_2_react.useEffect)(() => {
|
|
if (user.userInfo.role == 1) {
|
|
setDataSource([{ id: "1", name: "\u8D44\u6E90\u4FDD\u969C\u5BA2\u6237" }, { id: "2", name: "\u8D44\u6E90\u9650\u5236\u5BA2\u6237" }, { id: "3", name: "\u5546\u52A1\u8054\u7CFB" }]);
|
|
setActiveTab("1");
|
|
} else if (user.userInfo.role == 2) {
|
|
setDataSource([{ id: "1", name: "\u8D44\u6E90\u4FDD\u969C\u5BA2\u6237" }, { id: "3", name: "\u5546\u52A1\u8054\u7CFB" }]);
|
|
setActiveTab("1");
|
|
}
|
|
}, [user.userInfo.role]);
|
|
return /* @__PURE__ */ ResourceAllocation_React.createElement("section", { className: ResourceAllocationmodules.wrap }, /* @__PURE__ */ ResourceAllocation_React.createElement(
|
|
ui_customization/* CustomTabs */.YG,
|
|
{
|
|
value: activeTab,
|
|
onChange: (e) => {
|
|
setActiveTab(e);
|
|
},
|
|
tabBarExtraContent: /* @__PURE__ */ ResourceAllocation_React.createElement(ui_customization/* CustomInput */.t7, { style: { width: 270 }, placeholder: activeTab == "3" ? "\u641C\u7D22\u5355\u4F4D/\u5B66\u9662/\u53D1\u8D77\u4EBA/\u5BF9\u63A5\u4EBA" : "\u641C\u7D22\u5355\u4F4D/\u5B66\u9662/\u521B\u5EFA\u4EBA", value: keyVal, onChange: handleSearch }),
|
|
dataSource
|
|
}
|
|
), user.userInfo.role == 1 && activeTab == "2" && /* @__PURE__ */ ResourceAllocation_React.createElement(ResourceAllocation_CustomLimit, { keyVal }), [1, 2].includes(user.userInfo.role) && activeTab == "1" && /* @__PURE__ */ ResourceAllocation_React.createElement(ResourceAllocation_CustomAllocate, { keyVal }), [1, 2].includes(user.userInfo.role) && activeTab == "3" && /* @__PURE__ */ ResourceAllocation_React.createElement(ResourceAllocation_BusinessContact, { keyVal }));
|
|
};
|
|
/* harmony default export */ var Detail_ResourceAllocation = ((0,_umi_production_exports.connect)(
|
|
({
|
|
globalSetting,
|
|
user
|
|
}) => ({
|
|
globalSetting,
|
|
user
|
|
})
|
|
)(ResourceAllocation));
|
|
|
|
|
|
/***/ })
|
|
|
|
}]); |