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.
1302 lines
58 KiB
1302 lines
58 KiB
"use strict";
|
|
(self["webpackChunk"] = self["webpackChunk"] || []).push([[28982],{
|
|
|
|
/***/ 48864:
|
|
/*!***************************************************!*\
|
|
!*** ./src/pages/Paths/New/index.tsx + 5 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 */ New; }
|
|
});
|
|
|
|
// EXTERNAL MODULE: ./node_modules/_@babel_runtime@7.23.6@@babel/runtime/helpers/toConsumableArray.js
|
|
var toConsumableArray = __webpack_require__(37205);
|
|
var toConsumableArray_default = /*#__PURE__*/__webpack_require__.n(toConsumableArray);
|
|
// EXTERNAL MODULE: ./node_modules/_@babel_runtime@7.23.6@@babel/runtime/helpers/defineProperty.js
|
|
var defineProperty = __webpack_require__(85573);
|
|
var defineProperty_default = /*#__PURE__*/__webpack_require__.n(defineProperty);
|
|
// EXTERNAL MODULE: ./node_modules/_@babel_runtime@7.23.6@@babel/runtime/helpers/objectSpread2.js
|
|
var objectSpread2 = __webpack_require__(82242);
|
|
var objectSpread2_default = /*#__PURE__*/__webpack_require__.n(objectSpread2);
|
|
// EXTERNAL MODULE: ./node_modules/_@babel_runtime@7.23.6@@babel/runtime/helpers/regeneratorRuntime.js
|
|
var regeneratorRuntime = __webpack_require__(7557);
|
|
var regeneratorRuntime_default = /*#__PURE__*/__webpack_require__.n(regeneratorRuntime);
|
|
// EXTERNAL MODULE: ./node_modules/_@babel_runtime@7.23.6@@babel/runtime/helpers/asyncToGenerator.js
|
|
var asyncToGenerator = __webpack_require__(41498);
|
|
var asyncToGenerator_default = /*#__PURE__*/__webpack_require__.n(asyncToGenerator);
|
|
// EXTERNAL MODULE: ./node_modules/_@babel_runtime@7.23.6@@babel/runtime/helpers/slicedToArray.js
|
|
var slicedToArray = __webpack_require__(79800);
|
|
var slicedToArray_default = /*#__PURE__*/__webpack_require__.n(slicedToArray);
|
|
// EXTERNAL MODULE: ./node_modules/_@babel_runtime@7.23.6@@babel/runtime/helpers/objectWithoutProperties.js
|
|
var objectWithoutProperties = __webpack_require__(39647);
|
|
var objectWithoutProperties_default = /*#__PURE__*/__webpack_require__.n(objectWithoutProperties);
|
|
// EXTERNAL MODULE: ./node_modules/_react@17.0.2@react/index.js
|
|
var _react_17_0_2_react = __webpack_require__(59301);
|
|
// EXTERNAL MODULE: ./src/.umi-production/exports.ts
|
|
var _umi_production_exports = __webpack_require__(80184);
|
|
// EXTERNAL MODULE: ./node_modules/_antd@5.9.0@antd/es/input/index.js + 5 modules
|
|
var input = __webpack_require__(10249);
|
|
// EXTERNAL MODULE: ./node_modules/_antd@5.9.0@antd/es/tree-select/index.js + 17 modules
|
|
var tree_select = __webpack_require__(98228);
|
|
// 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/message/index.js + 4 modules
|
|
var message = __webpack_require__(8591);
|
|
// 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/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/switch/index.js + 2 modules
|
|
var es_switch = __webpack_require__(78673);
|
|
// 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/checkbox/index.js + 3 modules
|
|
var es_checkbox = __webpack_require__(24905);
|
|
// EXTERNAL MODULE: ./node_modules/_antd@5.9.0@antd/es/upload/index.js + 24 modules
|
|
var upload = __webpack_require__(54580);
|
|
// EXTERNAL MODULE: ./node_modules/_antd@5.9.0@antd/es/button/index.js
|
|
var es_button = __webpack_require__(3113);
|
|
// EXTERNAL MODULE: ./src/components/markdown-editor/index.tsx + 10 modules
|
|
var markdown_editor = __webpack_require__(49731);
|
|
;// CONCATENATED MODULE: ./src/pages/Paths/New/index.less?modules
|
|
// extracted by mini-css-extract-plugin
|
|
/* harmony default export */ var Newmodules = ({"bg":"bg____raBL","wrap":"wrap___HeK2P","crumbs":"crumbs___bamBY","titleWrap":"titleWrap___UpC0c","flexRow":"flexRow___WjoyK","flexJustifyCenter":"flexJustifyCenter___V6ndk","flexAlignEnd":"flexAlignEnd___So64w","flexAlignCenter":"flexAlignCenter___WWRXs","flexColumn":"flexColumn___b0Fz8","formWrap":"formWrap___Bmhgz","fieldWrap":"fieldWrap___pR4UB","mdWrap":"mdWrap___FPskk","backgroundFa":"backgroundFa___ghlCO","aBtn":"aBtn___M7dWu","bBtn":"bBtn___XycZO","cascaderWrap":"cascaderWrap___CPNAV","listItem":"listItem____eV5T","right":"right___x8wr7","one":"one___wdYdi","schoolHintWrap":"schoolHintWrap___AWsQj","colorCDCDCD":"colorCDCDCD___xguLh","color0152d9":"color0152d9___MEYYd","spanText":"spanText___Srs_u"});
|
|
// EXTERNAL MODULE: ./src/utils/util.tsx
|
|
var util = __webpack_require__(1079);
|
|
// EXTERNAL MODULE: ./src/utils/env.ts + 1 modules
|
|
var env = __webpack_require__(67390);
|
|
// EXTERNAL MODULE: ./src/utils/fetch.ts
|
|
var fetch = __webpack_require__(35325);
|
|
// EXTERNAL MODULE: ./node_modules/_antd@5.9.0@antd/es/empty/index.js + 3 modules
|
|
var empty = __webpack_require__(64165);
|
|
;// CONCATENATED MODULE: ./src/pages/Paths/New/Cascader/index.less?modules
|
|
// extracted by mini-css-extract-plugin
|
|
/* harmony default export */ var Cascadermodules = ({"cascaderContainer":"cascaderContainer___uz26h","valueWrap":"valueWrap___zTHXb","valueItem":"valueItem___vBNoA","placeholder":"placeholder___bJTkn","modalWrap":"modalWrap___uhROO","left":"left___oZrbl","right":"right___y9QjL","disabled":"disabled___LVx0f","emptyWrap":"emptyWrap___KG5pK"});
|
|
// EXTERNAL MODULE: ./node_modules/_@ant-design_icons@5.6.1@@ant-design/icons/es/icons/CloseOutlined.js + 1 modules
|
|
var CloseOutlined = __webpack_require__(99267);
|
|
// EXTERNAL MODULE: ./node_modules/_@ant-design_icons@5.6.1@@ant-design/icons/es/icons/RightOutlined.js + 1 modules
|
|
var RightOutlined = __webpack_require__(38819);
|
|
// EXTERNAL MODULE: ./node_modules/_react@17.0.2@react/jsx-runtime.js
|
|
var jsx_runtime = __webpack_require__(37712);
|
|
;// CONCATENATED MODULE: ./src/pages/Paths/New/Cascader/index.tsx
|
|
|
|
|
|
|
|
|
|
|
|
var _excluded = ["sub_discipline"],
|
|
_excluded2 = ["sub_disciplines"];
|
|
|
|
|
|
|
|
|
|
/**
|
|
* @param dataSource 数据源
|
|
* @param defaultValue 默认选中的数据
|
|
* @param placeholder 提示语
|
|
* @param onChange 点击回调事件 返回选中二级的id
|
|
*/
|
|
|
|
|
|
var ref = /*#__PURE__*/(0,_react_17_0_2_react.createRef)();
|
|
var Cascader = function Cascader(_ref) {
|
|
var dataSource = _ref.dataSource,
|
|
placeholder = _ref.placeholder,
|
|
defaultValue = _ref.defaultValue,
|
|
onChange = _ref.onChange;
|
|
var _useState = (0,_react_17_0_2_react.useState)(false),
|
|
_useState2 = slicedToArray_default()(_useState, 2),
|
|
leftStatus = _useState2[0],
|
|
setLeftStatus = _useState2[1];
|
|
var _useState3 = (0,_react_17_0_2_react.useState)({
|
|
data: [],
|
|
objData: {},
|
|
ids: []
|
|
}),
|
|
_useState4 = slicedToArray_default()(_useState3, 2),
|
|
value = _useState4[0],
|
|
setValue = _useState4[1];
|
|
var _useState5 = (0,_react_17_0_2_react.useState)({}),
|
|
_useState6 = slicedToArray_default()(_useState5, 2),
|
|
targetData = _useState6[0],
|
|
setTargetData = _useState6[1];
|
|
(0,_react_17_0_2_react.useEffect)(function () {
|
|
window.addEventListener('click', function () {
|
|
setLeftStatus(false);
|
|
setTargetData({});
|
|
});
|
|
}, []);
|
|
(0,_react_17_0_2_react.useEffect)(function () {
|
|
if (defaultValue) {
|
|
var objData = {};
|
|
var ids = [];
|
|
defaultValue.forEach(function (list) {
|
|
var sub_discipline = list.sub_discipline,
|
|
rest = objectWithoutProperties_default()(list, _excluded);
|
|
if (sub_discipline) {
|
|
objData[sub_discipline.id] = objectSpread2_default()(objectSpread2_default()({}, rest), {}, {
|
|
sub_disciplines: [sub_discipline]
|
|
});
|
|
ids.push(sub_discipline.id);
|
|
}
|
|
});
|
|
setValue({
|
|
ids: ids,
|
|
data: Object.values(objData),
|
|
objData: objData
|
|
});
|
|
onChange(ids);
|
|
}
|
|
}, [defaultValue]);
|
|
var getEmpty = function getEmpty() {
|
|
return /*#__PURE__*/(0,jsx_runtime.jsx)("div", {
|
|
className: Cascadermodules.emptyWrap,
|
|
children: /*#__PURE__*/(0,jsx_runtime.jsx)(empty/* default */.Z, {
|
|
image: empty/* default */.Z.PRESENTED_IMAGE_SIMPLE
|
|
})
|
|
});
|
|
};
|
|
|
|
/**
|
|
* 选中课程事件
|
|
*/
|
|
var onItemClick = function onItemClick(item) {
|
|
if (value.ids.includes(item.id)) {
|
|
return false;
|
|
}
|
|
var sub_disciplines = targetData.sub_disciplines,
|
|
rest = objectWithoutProperties_default()(targetData, _excluded2);
|
|
var _value = objectSpread2_default()(objectSpread2_default()({}, value.objData), {}, defineProperty_default()({}, item.id, objectSpread2_default()(objectSpread2_default()({}, rest), {}, {
|
|
sub_disciplines: [item]
|
|
})));
|
|
setValue({
|
|
ids: [].concat(toConsumableArray_default()(value.ids), [item.id]),
|
|
data: Object.values(_value),
|
|
objData: _value
|
|
});
|
|
onChange([].concat(toConsumableArray_default()(value.ids), [item.id]));
|
|
};
|
|
/**
|
|
*
|
|
*/
|
|
var onItemRemove = function onItemRemove(id) {
|
|
var objData = value.objData;
|
|
delete objData[id];
|
|
var ids = value.ids.filter(function (item) {
|
|
return item !== id;
|
|
});
|
|
setValue({
|
|
data: Object.values(objData),
|
|
objData: objData,
|
|
ids: ids
|
|
});
|
|
onChange(ids);
|
|
};
|
|
var top = 45;
|
|
if (ref && ref.current && ref.current.clientHeight > 45) {
|
|
top = ref.current.clientHeight + 5;
|
|
}
|
|
return /*#__PURE__*/(0,jsx_runtime.jsxs)("div", {
|
|
className: Cascadermodules.cascaderContainer,
|
|
onClick: function onClick(event) {
|
|
event.stopPropagation();
|
|
},
|
|
children: [/*#__PURE__*/(0,jsx_runtime.jsxs)("div", {
|
|
ref: ref,
|
|
className: Cascadermodules.valueWrap,
|
|
onClick: function onClick() {
|
|
return setLeftStatus(!leftStatus);
|
|
},
|
|
children: [value.data.length === 0 && /*#__PURE__*/(0,jsx_runtime.jsx)("span", {
|
|
className: Cascadermodules.placeholder,
|
|
children: placeholder ? placeholder : '请选择方向&课程'
|
|
}), value.data.map(function (item) {
|
|
return /*#__PURE__*/(0,jsx_runtime.jsxs)("div", {
|
|
className: Cascadermodules.valueItem,
|
|
children: [/*#__PURE__*/(0,jsx_runtime.jsx)("span", {
|
|
children: item.name
|
|
}), /*#__PURE__*/(0,jsx_runtime.jsx)("span", {
|
|
children: "/"
|
|
}), /*#__PURE__*/(0,jsx_runtime.jsx)("span", {
|
|
children: item.sub_disciplines[0].name
|
|
}), /*#__PURE__*/(0,jsx_runtime.jsx)("span", {
|
|
onClick: function onClick(event) {
|
|
event.stopPropagation();
|
|
event.preventDefault();
|
|
onItemRemove(item.sub_disciplines[0].id);
|
|
},
|
|
children: /*#__PURE__*/(0,jsx_runtime.jsx)(CloseOutlined/* default */.Z, {})
|
|
})]
|
|
}, item.id);
|
|
})]
|
|
}), leftStatus && /*#__PURE__*/(0,jsx_runtime.jsxs)("div", {
|
|
className: Cascadermodules.modalWrap,
|
|
style: {
|
|
top: top
|
|
},
|
|
children: [/*#__PURE__*/(0,jsx_runtime.jsxs)("div", {
|
|
className: Cascadermodules.left,
|
|
children: [dataSource.length === 0 && getEmpty(), dataSource.length > 0 && dataSource.map(function (item) {
|
|
return /*#__PURE__*/(0,jsx_runtime.jsxs)("div", {
|
|
onClick: function onClick() {
|
|
setTargetData(item);
|
|
},
|
|
children: [/*#__PURE__*/(0,jsx_runtime.jsx)("span", {
|
|
children: item.name
|
|
}), /*#__PURE__*/(0,jsx_runtime.jsx)("span", {
|
|
children: /*#__PURE__*/(0,jsx_runtime.jsx)(RightOutlined/* default */.Z, {})
|
|
})]
|
|
}, item.id);
|
|
})]
|
|
}), targetData.sub_disciplines && /*#__PURE__*/(0,jsx_runtime.jsxs)("div", {
|
|
className: Cascadermodules.right,
|
|
children: [targetData.sub_disciplines.length === 0 && getEmpty(), targetData.sub_disciplines.length > 0 && targetData.sub_disciplines.map(function (item) {
|
|
var active = value.ids.includes(item.id);
|
|
return /*#__PURE__*/(0,jsx_runtime.jsx)("div", {
|
|
className: active ? Cascadermodules.disabled : '',
|
|
onClick: function onClick() {
|
|
onItemClick(item);
|
|
setLeftStatus(false);
|
|
},
|
|
children: item.name
|
|
}, item.id);
|
|
})]
|
|
})]
|
|
})]
|
|
});
|
|
};
|
|
/* harmony default export */ var New_Cascader = (Cascader);
|
|
// EXTERNAL MODULE: ./node_modules/_antd@5.9.0@antd/es/modal/index.js + 16 modules
|
|
var modal = __webpack_require__(43418);
|
|
// EXTERNAL MODULE: ./node_modules/_antd@5.9.0@antd/es/cascader/index.js + 18 modules
|
|
var cascader = __webpack_require__(19842);
|
|
// EXTERNAL MODULE: ./node_modules/_dayjs@1.11.13@dayjs/dayjs.min.js
|
|
var dayjs_min = __webpack_require__(61186);
|
|
var dayjs_min_default = /*#__PURE__*/__webpack_require__.n(dayjs_min);
|
|
// EXTERNAL MODULE: ./node_modules/_@ant-design_icons@5.6.1@@ant-design/icons/es/icons/CheckCircleFilled.js + 1 modules
|
|
var CheckCircleFilled = __webpack_require__(29679);
|
|
// EXTERNAL MODULE: ./node_modules/_@ant-design_icons@5.6.1@@ant-design/icons/es/icons/CloseCircleFilled.js + 1 modules
|
|
var CloseCircleFilled = __webpack_require__(19248);
|
|
// EXTERNAL MODULE: ./src/utils/cityData.ts
|
|
var cityData = __webpack_require__(82527);
|
|
;// CONCATENATED MODULE: ./src/pages/Paths/New/components/AppplySchoolModal/index.less?modules
|
|
// extracted by mini-css-extract-plugin
|
|
/* harmony default export */ var AppplySchoolModalmodules = ({"flexRow":"flexRow___qY1Ro","flexColumn":"flexColumn___xTKsc","formWrap":"formWrap___OJ1NZ","example":"example___XZnZv","footerWrap":"footerWrap___DSZCv"});
|
|
;// CONCATENATED MODULE: ./src/pages/Paths/New/components/AppplySchoolModal/index.tsx
|
|
|
|
|
|
|
|
|
|
var AppplySchoolModal_excluded = ["newCourse", "globalSetting", "loading", "dispatch", "schoolName", "onSuccess"];
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
var filter = function filter(inputValue, path) {
|
|
return path.some(function (option) {
|
|
return option.label.toLowerCase().indexOf(inputValue.toLowerCase()) > -1;
|
|
});
|
|
};
|
|
var TextArea = input/* default */.Z.TextArea;
|
|
var AppplySchoolModal = function AppplySchoolModal(_ref) {
|
|
var newCourse = _ref.newCourse,
|
|
globalSetting = _ref.globalSetting,
|
|
loading = _ref.loading,
|
|
dispatch = _ref.dispatch,
|
|
schoolName = _ref.schoolName,
|
|
_ref$onSuccess = _ref.onSuccess,
|
|
onSuccess = _ref$onSuccess === void 0 ? function () {} : _ref$onSuccess,
|
|
props = objectWithoutProperties_default()(_ref, AppplySchoolModal_excluded);
|
|
var _Form$useForm = es_form/* default */.Z.useForm(),
|
|
_Form$useForm2 = slicedToArray_default()(_Form$useForm, 1),
|
|
form = _Form$useForm2[0];
|
|
(0,_react_17_0_2_react.useEffect)(function () {
|
|
form.setFieldsValue({
|
|
name: schoolName
|
|
});
|
|
}, [schoolName]);
|
|
var handleFinish = /*#__PURE__*/function () {
|
|
var _ref2 = asyncToGenerator_default()( /*#__PURE__*/regeneratorRuntime_default()().mark(function _callee(values) {
|
|
var _ref3, name, _ref3$city, city, address, remarks, res;
|
|
return regeneratorRuntime_default()().wrap(function _callee$(_context) {
|
|
while (1) switch (_context.prev = _context.next) {
|
|
case 0:
|
|
_ref3 = values || {}, name = _ref3.name, _ref3$city = _ref3.city, city = _ref3$city === void 0 ? [] : _ref3$city, address = _ref3.address, remarks = _ref3.remarks;
|
|
_context.next = 3;
|
|
return dispatch({
|
|
type: 'newCourse/appplySchool',
|
|
payload: {
|
|
name: name,
|
|
province: city[0],
|
|
city: city[1],
|
|
address: address,
|
|
remarks: remarks
|
|
}
|
|
});
|
|
case 3:
|
|
res = _context.sent;
|
|
dispatch({
|
|
type: 'newCourse/setActionTabs',
|
|
payload: {}
|
|
});
|
|
if (res) {
|
|
message/* default */.ZP.success("新增发布单位成功!");
|
|
onSuccess(name);
|
|
}
|
|
case 6:
|
|
case "end":
|
|
return _context.stop();
|
|
}
|
|
}, _callee);
|
|
}));
|
|
return function handleFinish(_x) {
|
|
return _ref2.apply(this, arguments);
|
|
};
|
|
}();
|
|
return /*#__PURE__*/(0,jsx_runtime.jsx)(modal/* default */.Z, {
|
|
centered: true,
|
|
keyboard: false,
|
|
closable: false,
|
|
destroyOnClose: true,
|
|
open: newCourse.actionTabs.key === 'NewCourse-AppplySchool',
|
|
title: "\u7533\u8BF7\u53D1\u5E03\u5355\u4F4D",
|
|
width: "600px",
|
|
footer: null,
|
|
children: /*#__PURE__*/(0,jsx_runtime.jsxs)(es_form/* default */.Z, {
|
|
className: AppplySchoolModalmodules.formWrap,
|
|
form: form,
|
|
labelCol: {
|
|
span: 4
|
|
},
|
|
wrapperCol: {
|
|
span: 20
|
|
},
|
|
onFinish: handleFinish,
|
|
children: [/*#__PURE__*/(0,jsx_runtime.jsx)(es_form/* default */.Z.Item, {
|
|
label: "\u53D1\u5E03\u5355\u4F4D\uFF1A",
|
|
name: "name",
|
|
rules: [{
|
|
required: true,
|
|
message: '请输入学校或工作单位'
|
|
}],
|
|
children: /*#__PURE__*/(0,jsx_runtime.jsx)(input/* default */.Z, {
|
|
placeholder: "\u8BF7\u8F93\u5165\u53D1\u5E03\u5355\u4F4D"
|
|
})
|
|
}), /*#__PURE__*/(0,jsx_runtime.jsxs)("div", {
|
|
className: "".concat(AppplySchoolModalmodules.flexRow, " ").concat(AppplySchoolModalmodules.example),
|
|
children: [/*#__PURE__*/(0,jsx_runtime.jsx)("div", {
|
|
children: "\u793A\u4F8B\uFF1A"
|
|
}), /*#__PURE__*/(0,jsx_runtime.jsxs)("div", {
|
|
className: AppplySchoolModalmodules.flexColumn,
|
|
children: [/*#__PURE__*/(0,jsx_runtime.jsxs)("div", {
|
|
children: [/*#__PURE__*/(0,jsx_runtime.jsx)(CheckCircleFilled/* default */.Z, {
|
|
style: {
|
|
color: "rgb(82, 196, 26)"
|
|
}
|
|
}), /*#__PURE__*/(0,jsx_runtime.jsx)("span", {
|
|
className: "font14 ml5",
|
|
children: "\u6B63\u786E\u793A\u4F8B\uFF1A\u6570\u636E\u7ED3\u6784"
|
|
})]
|
|
}), /*#__PURE__*/(0,jsx_runtime.jsxs)("div", {
|
|
children: [/*#__PURE__*/(0,jsx_runtime.jsx)(CloseCircleFilled/* default */.Z, {
|
|
style: {
|
|
color: "red"
|
|
}
|
|
}), /*#__PURE__*/(0,jsx_runtime.jsxs)("span", {
|
|
className: "font14 ml5",
|
|
children: ["\u9519\u8BEF\u793A\u4F8B\uFF1A\u6570\u636E\u7ED3\u6784", dayjs_min_default()().format("YYYY"), "\u6625"]
|
|
})]
|
|
})]
|
|
})]
|
|
}), /*#__PURE__*/(0,jsx_runtime.jsx)(es_form/* default */.Z.Item, {
|
|
label: "\u5730\u533A\uFF1A",
|
|
name: "city",
|
|
children: /*#__PURE__*/(0,jsx_runtime.jsx)(cascader/* default */.Z, {
|
|
allowClear: true,
|
|
size: 'middle',
|
|
options: cityData/* CityData */.P,
|
|
placeholder: "\u8BF7\u9009\u62E9\u6240\u5728\u5730",
|
|
showSearch: {
|
|
matchInputWidth: true,
|
|
filter: filter
|
|
}
|
|
})
|
|
}), /*#__PURE__*/(0,jsx_runtime.jsx)(es_form/* default */.Z.Item, {
|
|
label: "\u8BE6\u7EC6\u5730\u5740\uFF1A",
|
|
name: "address",
|
|
children: /*#__PURE__*/(0,jsx_runtime.jsx)(input/* default */.Z, {
|
|
placeholder: "\u8BF7\u586B\u5199\u5B8C\u6574\u7684\u5730\u5740\u4FE1\u606F"
|
|
})
|
|
}), /*#__PURE__*/(0,jsx_runtime.jsx)(es_form/* default */.Z.Item, {
|
|
label: "\u8BF4\u660E\uFF1A",
|
|
name: "remarks",
|
|
children: /*#__PURE__*/(0,jsx_runtime.jsx)(TextArea, {
|
|
placeholder: "\u518D\u6B21\u8BF4\u660E\u7279\u522B\u60C5\u51B5\uFF08\u9009\u586B\uFF09"
|
|
})
|
|
}), /*#__PURE__*/(0,jsx_runtime.jsx)("div", {
|
|
className: AppplySchoolModalmodules.footerWrap,
|
|
children: /*#__PURE__*/(0,jsx_runtime.jsxs)(es_form/* default */.Z.Item, {
|
|
children: [/*#__PURE__*/(0,jsx_runtime.jsx)(es_button/* default */.ZP, {
|
|
className: "mr5",
|
|
size: 'middle',
|
|
onClick: function onClick() {
|
|
dispatch({
|
|
type: 'newCourse/setActionTabs',
|
|
payload: {}
|
|
});
|
|
},
|
|
children: "\u53D6\u6D88"
|
|
}), /*#__PURE__*/(0,jsx_runtime.jsx)(es_button/* default */.ZP, {
|
|
size: 'middle',
|
|
type: "primary",
|
|
htmlType: "submit",
|
|
loading: loading['newCourse/appplySchool'],
|
|
children: "\u4FDD\u5B58"
|
|
})]
|
|
})
|
|
})]
|
|
})
|
|
});
|
|
};
|
|
/* harmony default export */ var components_AppplySchoolModal = ((0,_umi_production_exports.connect)(function (_ref4) {
|
|
var newCourse = _ref4.newCourse,
|
|
loading = _ref4.loading,
|
|
globalSetting = _ref4.globalSetting;
|
|
return {
|
|
newCourse: newCourse,
|
|
globalSetting: globalSetting,
|
|
loading: loading.effects
|
|
};
|
|
})(AppplySchoolModal));
|
|
;// CONCATENATED MODULE: ./src/pages/Paths/New/index.tsx
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
var New_excluded = ["user", "newCourse", "globalSetting", "loading", "dispatch"];
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
var New_TextArea = input/* default */.Z.TextArea;
|
|
var TreeNode = tree_select/* default.TreeNode */.Z.TreeNode;
|
|
var NewCoursePage = function NewCoursePage(_ref) {
|
|
var _formValue$name, _formValue$name_en;
|
|
var user = _ref.user,
|
|
newCourse = _ref.newCourse,
|
|
globalSetting = _ref.globalSetting,
|
|
loading = _ref.loading,
|
|
dispatch = _ref.dispatch,
|
|
props = objectWithoutProperties_default()(_ref, New_excluded);
|
|
var _useSearchParams = (0,_umi_production_exports.useSearchParams)(),
|
|
_useSearchParams2 = slicedToArray_default()(_useSearchParams, 1),
|
|
searchParams = _useSearchParams2[0];
|
|
var params = (0,_umi_production_exports.useParams)();
|
|
var _Form$useForm = es_form/* default */.Z.useForm(),
|
|
_Form$useForm2 = slicedToArray_default()(_Form$useForm, 1),
|
|
form = _Form$useForm2[0];
|
|
var _useState = (0,_react_17_0_2_react.useState)({}),
|
|
_useState2 = slicedToArray_default()(_useState, 2),
|
|
formValue = _useState2[0],
|
|
setFormValue = _useState2[1];
|
|
var _useState3 = (0,_react_17_0_2_react.useState)(),
|
|
_useState4 = slicedToArray_default()(_useState3, 2),
|
|
isEdit = _useState4[0],
|
|
setIsEdit = _useState4[1];
|
|
var pathId = (0,_react_17_0_2_react.useRef)();
|
|
var _useState5 = (0,_react_17_0_2_react.useState)(true),
|
|
_useState6 = slicedToArray_default()(_useState5, 2),
|
|
custseq = _useState6[0],
|
|
setCustSeq = _useState6[1];
|
|
var _useState7 = (0,_react_17_0_2_react.useState)(false),
|
|
_useState8 = slicedToArray_default()(_useState7, 2),
|
|
showspoc = _useState8[0],
|
|
setShowSpoc = _useState8[1];
|
|
var _useState9 = (0,_react_17_0_2_react.useState)(),
|
|
_useState10 = slicedToArray_default()(_useState9, 2),
|
|
Filelists = _useState10[0],
|
|
setFileLists = _useState10[1];
|
|
var _useState11 = (0,_react_17_0_2_react.useState)(),
|
|
_useState12 = slicedToArray_default()(_useState11, 2),
|
|
Filelists1 = _useState12[0],
|
|
setFileLists1 = _useState12[1];
|
|
var _useState13 = (0,_react_17_0_2_react.useState)(true),
|
|
_useState14 = slicedToArray_default()(_useState13, 2),
|
|
show_tag = _useState14[0],
|
|
setshow_tag = _useState14[1];
|
|
var _useState15 = (0,_react_17_0_2_react.useState)(false),
|
|
_useState16 = slicedToArray_default()(_useState15, 2),
|
|
show_history = _useState16[0],
|
|
setshow_history = _useState16[1];
|
|
var _useState17 = (0,_react_17_0_2_react.useState)(false),
|
|
_useState18 = slicedToArray_default()(_useState17, 2),
|
|
ismodel = _useState18[0],
|
|
setismodel = _useState18[1];
|
|
var _useState19 = (0,_react_17_0_2_react.useState)(-1),
|
|
_useState20 = slicedToArray_default()(_useState19, 2),
|
|
open_num = _useState20[0],
|
|
setopen_num = _useState20[1];
|
|
var _useState21 = (0,_react_17_0_2_react.useState)(true),
|
|
_useState22 = slicedToArray_default()(_useState21, 2),
|
|
schoolLoading = _useState22[0],
|
|
setSchoolLoading = _useState22[1];
|
|
var _useState23 = (0,_react_17_0_2_react.useState)([]),
|
|
_useState24 = slicedToArray_default()(_useState23, 2),
|
|
schoolList = _useState24[0],
|
|
setSchoolList = _useState24[1];
|
|
var _useState25 = (0,_react_17_0_2_react.useState)([]),
|
|
_useState26 = slicedToArray_default()(_useState25, 2),
|
|
filterSchoolList = _useState26[0],
|
|
setFilterSchoolList = _useState26[1];
|
|
var _useState27 = (0,_react_17_0_2_react.useState)(false),
|
|
_useState28 = slicedToArray_default()(_useState27, 2),
|
|
allow_download = _useState28[0],
|
|
setallow_download = _useState28[1];
|
|
var _useState29 = (0,_react_17_0_2_react.useState)(false),
|
|
_useState30 = slicedToArray_default()(_useState29, 2),
|
|
show_course_section = _useState30[0],
|
|
setShowCourseSection = _useState30[1];
|
|
|
|
// 方向课程数据源
|
|
var _useState31 = (0,_react_17_0_2_react.useState)([]),
|
|
_useState32 = slicedToArray_default()(_useState31, 2),
|
|
options = _useState32[0],
|
|
setOptions = _useState32[1];
|
|
|
|
// 方向课程的值
|
|
var _useState33 = (0,_react_17_0_2_react.useState)([]),
|
|
_useState34 = slicedToArray_default()(_useState33, 2),
|
|
disciplinesValue = _useState34[0],
|
|
setDisciplinesValue = _useState34[1];
|
|
(0,_react_17_0_2_react.useEffect)(function () {
|
|
var _globalSetting$settin;
|
|
getOptionsData();
|
|
getSchoolOption();
|
|
pathId.current = params.pathId;
|
|
setIsEdit(!!pathId.current);
|
|
(0,util/* setDocumentTitle */.Dk)(globalSetting === null || globalSetting === void 0 || (_globalSetting$settin = globalSetting.setting) === null || _globalSetting$settin === void 0 ? void 0 : _globalSetting$settin.name);
|
|
form.setFieldsValue({
|
|
learning_notes_title: '课程须知'
|
|
});
|
|
if (pathId.current) {
|
|
getEditCourseData();
|
|
}
|
|
}, []);
|
|
|
|
/**
|
|
* 获取方向/课程的数据
|
|
*/
|
|
var getOptionsData = /*#__PURE__*/function () {
|
|
var _ref2 = asyncToGenerator_default()( /*#__PURE__*/regeneratorRuntime_default()().mark(function _callee() {
|
|
var result;
|
|
return regeneratorRuntime_default()().wrap(function _callee$(_context) {
|
|
while (1) switch (_context.prev = _context.next) {
|
|
case 0:
|
|
_context.next = 2;
|
|
return (0,fetch/* default */.ZP)("/api/disciplines.json", {
|
|
method: 'get',
|
|
params: {
|
|
source: 'subject'
|
|
}
|
|
});
|
|
case 2:
|
|
result = _context.sent;
|
|
setOptions(result.disciplines);
|
|
case 4:
|
|
case "end":
|
|
return _context.stop();
|
|
}
|
|
}, _callee);
|
|
}));
|
|
return function getOptionsData() {
|
|
return _ref2.apply(this, arguments);
|
|
};
|
|
}();
|
|
var getSchoolOption = /*#__PURE__*/function () {
|
|
var _ref3 = asyncToGenerator_default()( /*#__PURE__*/regeneratorRuntime_default()().mark(function _callee2() {
|
|
var res;
|
|
return regeneratorRuntime_default()().wrap(function _callee2$(_context2) {
|
|
while (1) switch (_context2.prev = _context2.next) {
|
|
case 0:
|
|
setSchoolLoading(true);
|
|
_context2.next = 3;
|
|
return dispatch({
|
|
type: 'newCourse/getSchoolOption'
|
|
});
|
|
case 3:
|
|
res = _context2.sent;
|
|
setSchoolLoading(false);
|
|
setSchoolList(res === null || res === void 0 ? void 0 : res.schools);
|
|
setFilterSchoolList(res === null || res === void 0 ? void 0 : res.schools);
|
|
case 7:
|
|
case "end":
|
|
return _context2.stop();
|
|
}
|
|
}, _callee2);
|
|
}));
|
|
return function getSchoolOption() {
|
|
return _ref3.apply(this, arguments);
|
|
};
|
|
}();
|
|
var goBack = function goBack() {
|
|
if (searchParams.get("username")) {
|
|
_umi_production_exports.history.push("/users/".concat(searchParams.get("username"), "/paths"));
|
|
return;
|
|
}
|
|
_umi_production_exports.history.push(isEdit ? "/paths/".concat(pathId.current) : '/paths');
|
|
};
|
|
var getEditCourseData = /*#__PURE__*/function () {
|
|
var _ref4 = asyncToGenerator_default()( /*#__PURE__*/regeneratorRuntime_default()().mark(function _callee3() {
|
|
var res, _res$toast, _res$toast2, _res$toast3, _res$attachments, _res$attachments_b, _res$toast4, formData, _res$attachments2, _res$attachments3, _res$attachments4, _res$attachments_b2, _res$attachments_b3, _res$attachments_b4;
|
|
return regeneratorRuntime_default()().wrap(function _callee3$(_context3) {
|
|
while (1) switch (_context3.prev = _context3.next) {
|
|
case 0:
|
|
_context3.next = 2;
|
|
return dispatch({
|
|
type: 'newCourse/getEditCourseData',
|
|
payload: {
|
|
id: pathId.current
|
|
}
|
|
});
|
|
case 2:
|
|
res = _context3.sent;
|
|
if (res) {
|
|
formData = {
|
|
name: res.name,
|
|
name_en: res.name_en,
|
|
intro: res.description,
|
|
content: res === null || res === void 0 || (_res$toast = res.toast) === null || _res$toast === void 0 ? void 0 : _res$toast.content,
|
|
notice: res.learning_notes,
|
|
school_id: res === null || res === void 0 ? void 0 : res.school,
|
|
learning_notes_title: res.learning_notes_title || '课程须知'
|
|
};
|
|
if (res.disciplines && res.disciplines.length > 0) {
|
|
setDisciplinesValue(res.disciplines);
|
|
// formData['sub_discipline_ids'] = [
|
|
// res.disciplines[0].id,
|
|
// res.disciplines[0].sub_discipline.id,
|
|
// ];
|
|
}
|
|
form.setFieldsValue(formData);
|
|
setismodel(res === null || res === void 0 || (_res$toast2 = res.toast) === null || _res$toast2 === void 0 ? void 0 : _res$toast2.is_open);
|
|
setopen_num(res === null || res === void 0 || (_res$toast3 = res.toast) === null || _res$toast3 === void 0 ? void 0 : _res$toast3.open_num);
|
|
setCustSeq(res === null || res === void 0 ? void 0 : res.cust_seq);
|
|
setShowSpoc(res === null || res === void 0 ? void 0 : res.show_spoc);
|
|
setshow_history(res === null || res === void 0 ? void 0 : res.show_history);
|
|
setShowCourseSection(res === null || res === void 0 ? void 0 : res.show_course_section);
|
|
setallow_download(res === null || res === void 0 ? void 0 : res.allow_download);
|
|
setshow_tag(res === null || res === void 0 ? void 0 : res.show_tag);
|
|
if ((res === null || res === void 0 || (_res$attachments = res.attachments) === null || _res$attachments === void 0 ? void 0 : _res$attachments.length) > 0) {
|
|
setFileLists([{
|
|
uid: res === null || res === void 0 || (_res$attachments2 = res.attachments) === null || _res$attachments2 === void 0 || (_res$attachments2 = _res$attachments2[0]) === null || _res$attachments2 === void 0 ? void 0 : _res$attachments2.id,
|
|
name: res === null || res === void 0 || (_res$attachments3 = res.attachments) === null || _res$attachments3 === void 0 || (_res$attachments3 = _res$attachments3[0]) === null || _res$attachments3 === void 0 ? void 0 : _res$attachments3.title,
|
|
response: {
|
|
id: res === null || res === void 0 || (_res$attachments4 = res.attachments) === null || _res$attachments4 === void 0 || (_res$attachments4 = _res$attachments4[0]) === null || _res$attachments4 === void 0 ? void 0 : _res$attachments4.id
|
|
}
|
|
}]);
|
|
}
|
|
if ((res === null || res === void 0 || (_res$attachments_b = res.attachments_b) === null || _res$attachments_b === void 0 ? void 0 : _res$attachments_b.length) > 0) {
|
|
setFileLists1([{
|
|
uid: res === null || res === void 0 || (_res$attachments_b2 = res.attachments_b) === null || _res$attachments_b2 === void 0 || (_res$attachments_b2 = _res$attachments_b2[0]) === null || _res$attachments_b2 === void 0 ? void 0 : _res$attachments_b2.id,
|
|
name: res === null || res === void 0 || (_res$attachments_b3 = res.attachments_b) === null || _res$attachments_b3 === void 0 || (_res$attachments_b3 = _res$attachments_b3[0]) === null || _res$attachments_b3 === void 0 ? void 0 : _res$attachments_b3.title,
|
|
response: {
|
|
id: res === null || res === void 0 || (_res$attachments_b4 = res.attachments_b) === null || _res$attachments_b4 === void 0 || (_res$attachments_b4 = _res$attachments_b4[0]) === null || _res$attachments_b4 === void 0 ? void 0 : _res$attachments_b4.id
|
|
}
|
|
}]);
|
|
}
|
|
setFormValue({
|
|
name: res.name,
|
|
intro: res.description,
|
|
notice: res.learning_notes,
|
|
content: res === null || res === void 0 || (_res$toast4 = res.toast) === null || _res$toast4 === void 0 ? void 0 : _res$toast4.content
|
|
});
|
|
}
|
|
case 4:
|
|
case "end":
|
|
return _context3.stop();
|
|
}
|
|
}, _callee3);
|
|
}));
|
|
return function getEditCourseData() {
|
|
return _ref4.apply(this, arguments);
|
|
};
|
|
}();
|
|
var handleFinish = /*#__PURE__*/function () {
|
|
var _ref5 = asyncToGenerator_default()( /*#__PURE__*/regeneratorRuntime_default()().mark(function _callee4(values) {
|
|
var _Filelists$, _Filelists1$;
|
|
var _ref6, name, description, learning_notes, name_en, learning_notes_title, sub_discipline_ids, school_id, type, isIncludes, schhool_name, param, res;
|
|
return regeneratorRuntime_default()().wrap(function _callee4$(_context4) {
|
|
while (1) switch (_context4.prev = _context4.next) {
|
|
case 0:
|
|
_ref6 = values || {}, name = _ref6.name, description = _ref6.intro, learning_notes = _ref6.notice, name_en = _ref6.name_en, learning_notes_title = _ref6.learning_notes_title, sub_discipline_ids = _ref6.sub_discipline_ids, school_id = _ref6.school_id;
|
|
type = isEdit ? 'newCourse/editCourse' : 'newCourse/submitCourse';
|
|
isIncludes = false;
|
|
schhool_name = null;
|
|
schoolList.map(function (item) {
|
|
if (school_id === item.name) {
|
|
isIncludes = true;
|
|
schhool_name = item.id;
|
|
}
|
|
});
|
|
if (isIncludes) {
|
|
_context4.next = 7;
|
|
break;
|
|
}
|
|
return _context4.abrupt("return", message/* default */.ZP.error("\u672A\u627E\u5230\u5305\u542B'".concat(school_id, "'\u7684\u53D1\u5E03\u5355\u4F4D")));
|
|
case 7:
|
|
param = {
|
|
id: pathId.current,
|
|
name: name,
|
|
name_en: name_en,
|
|
description: description,
|
|
learning_notes: learning_notes,
|
|
cust_seq: custseq,
|
|
show_spoc: showspoc,
|
|
school_id: schhool_name,
|
|
show_tag: show_tag,
|
|
show_history: show_history,
|
|
show_course_section: show_course_section,
|
|
allow_download: allow_download,
|
|
learning_notes_title: learning_notes_title,
|
|
attachment_ids: [Filelists === null || Filelists === void 0 || (_Filelists$ = Filelists[0]) === null || _Filelists$ === void 0 || (_Filelists$ = _Filelists$.response) === null || _Filelists$ === void 0 ? void 0 : _Filelists$.id],
|
|
attachment_ids_b: [Filelists1 === null || Filelists1 === void 0 || (_Filelists1$ = Filelists1[0]) === null || _Filelists1$ === void 0 || (_Filelists1$ = _Filelists1$.response) === null || _Filelists1$ === void 0 ? void 0 : _Filelists1$.id],
|
|
sub_discipline_ids: sub_discipline_ids,
|
|
subject_toast_attributes: {
|
|
is_open: ismodel,
|
|
open_num: open_num,
|
|
content: values.content
|
|
}
|
|
};
|
|
_context4.next = 10;
|
|
return dispatch({
|
|
type: type,
|
|
payload: objectSpread2_default()({}, param)
|
|
});
|
|
case 10:
|
|
res = _context4.sent;
|
|
(res === null || res === void 0 ? void 0 : res.subject_id) && _umi_production_exports.history.push("/paths/".concat(res.subject_id));
|
|
case 12:
|
|
case "end":
|
|
return _context4.stop();
|
|
}
|
|
}, _callee4);
|
|
}));
|
|
return function handleFinish(_x) {
|
|
return _ref5.apply(this, arguments);
|
|
};
|
|
}();
|
|
var handleApplySchool = function handleApplySchool() {
|
|
dispatch({
|
|
type: 'newCourse/setActionTabs',
|
|
payload: {
|
|
key: 'NewCourse-AppplySchool'
|
|
}
|
|
});
|
|
};
|
|
var onSuccess = function onSuccess(value) {
|
|
getSchoolOption();
|
|
setFormValue(objectSpread2_default()({}, form.getFieldsValue()));
|
|
};
|
|
return /*#__PURE__*/(0,jsx_runtime.jsx)("div", {
|
|
className: Newmodules.wrap,
|
|
children: /*#__PURE__*/(0,jsx_runtime.jsxs)("div", {
|
|
className: Newmodules.bg,
|
|
children: [/*#__PURE__*/(0,jsx_runtime.jsxs)("div", {
|
|
className: Newmodules.crumbs,
|
|
children: [/*#__PURE__*/(0,jsx_runtime.jsx)("span", {
|
|
children: "\u5B9E\u8DF5\u8BFE\u7A0B"
|
|
}), /*#__PURE__*/(0,jsx_runtime.jsx)("i", {
|
|
className: "iconfont icon-zhankai1"
|
|
}), /*#__PURE__*/(0,jsx_runtime.jsxs)("b", {
|
|
children: [isEdit ? '编辑' : '创建', "\u5B9E\u8DF5\u8BFE\u7A0B"]
|
|
})]
|
|
}), /*#__PURE__*/(0,jsx_runtime.jsxs)("div", {
|
|
className: Newmodules.titleWrap,
|
|
children: [/*#__PURE__*/(0,jsx_runtime.jsxs)("span", {
|
|
children: [isEdit ? '编辑' : '创建', "\u5B9E\u8DF5\u8BFE\u7A0B"]
|
|
}), /*#__PURE__*/(0,jsx_runtime.jsx)("b", {
|
|
onClick: goBack,
|
|
children: "\u8FD4\u56DE"
|
|
})]
|
|
}), /*#__PURE__*/(0,jsx_runtime.jsxs)(es_form/* default */.Z, {
|
|
form: form,
|
|
className: Newmodules.formWrap,
|
|
scrollToFirstError: true,
|
|
layout: "vertical",
|
|
colon: false,
|
|
onValuesChange: function onValuesChange() {
|
|
var formValue = form.getFieldsValue();
|
|
if ('school_id' in formValue) {
|
|
setFilterSchoolList(schoolList.filter(function (item) {
|
|
return item.name.includes(formValue.school_id);
|
|
}));
|
|
}
|
|
setFormValue(objectSpread2_default()({}, formValue));
|
|
},
|
|
onFinish: handleFinish,
|
|
children: [/*#__PURE__*/(0,jsx_runtime.jsxs)("div", {
|
|
className: Newmodules.fieldWrap,
|
|
children: [/*#__PURE__*/(0,jsx_runtime.jsx)(es_form/* default */.Z.Item, {
|
|
extra: /*#__PURE__*/(0,jsx_runtime.jsx)("div", {
|
|
className: "tr c-grey-333 font12 mt3",
|
|
children: "".concat(((_formValue$name = formValue.name) === null || _formValue$name === void 0 ? void 0 : _formValue$name.length) || 0, "/60")
|
|
}),
|
|
name: "name",
|
|
label: "\u5B9E\u8DF5\u8BFE\u7A0B\u540D\u79F0",
|
|
rules: [{
|
|
required: true,
|
|
message: '请输入实践课程名称'
|
|
}],
|
|
children: /*#__PURE__*/(0,jsx_runtime.jsx)(New_TextArea, {
|
|
maxLength: 60,
|
|
placeholder: "\u4F8B\u5982\uFF1A\u5927\u5B66\u8BA1\u7B97\u673A\u57FA\u7840 \u2014\u2014 \u8BA1\u7B97\u601D\u7EF4"
|
|
})
|
|
}), /*#__PURE__*/(0,jsx_runtime.jsx)(es_form/* default */.Z.Item, defineProperty_default()(defineProperty_default()(defineProperty_default()(defineProperty_default()({
|
|
style: {
|
|
marginTop: '-24px'
|
|
},
|
|
name: "name_en",
|
|
label: "\u82F1\u6587\u8BFE\u7A0B\u540D\u79F0"
|
|
}, "style", {
|
|
marginTop: '-24px'
|
|
}), "extra", /*#__PURE__*/(0,jsx_runtime.jsx)("div", {
|
|
className: "tr c-grey-333 font12 mt3",
|
|
children: "".concat(((_formValue$name_en = formValue.name_en) === null || _formValue$name_en === void 0 ? void 0 : _formValue$name_en.length) || 0, "/200")
|
|
})), "rules", [{
|
|
message: '请输入英文课程名称'
|
|
}]), "children", /*#__PURE__*/(0,jsx_runtime.jsx)(New_TextArea, {
|
|
maxLength: 200,
|
|
placeholder: "College Computer Fundamentals - Computational Thinking"
|
|
// addonAfter={`${formValue.name_en?.length || 0}/200`}
|
|
}))), /*#__PURE__*/(0,jsx_runtime.jsx)(es_form/* default */.Z.Item, {
|
|
name: "sub_discipline_ids",
|
|
label: "\u65B9\u5411&\u8BFE\u7A0B",
|
|
style: {
|
|
marginTop: '-24px'
|
|
},
|
|
children: /*#__PURE__*/(0,jsx_runtime.jsx)(New_Cascader, {
|
|
defaultValue: disciplinesValue,
|
|
dataSource: options,
|
|
onChange: function onChange(sub_discipline_ids) {
|
|
return form.setFieldsValue({
|
|
sub_discipline_ids: sub_discipline_ids
|
|
});
|
|
}
|
|
})
|
|
}), /*#__PURE__*/(0,jsx_runtime.jsx)(es_form/* default */.Z.Item, {
|
|
label: "\u53D1\u5E03\u5355\u4F4D",
|
|
name: "school_id",
|
|
wrapperCol: {
|
|
span: 24
|
|
},
|
|
extra: !schoolLoading && formValue.school_id && !(schoolList !== null && schoolList !== void 0 && schoolList.find(function (item) {
|
|
return item.name === formValue.school_id;
|
|
})) && /*#__PURE__*/(0,jsx_runtime.jsxs)("div", {
|
|
className: Newmodules.schoolHintWrap,
|
|
children: [/*#__PURE__*/(0,jsx_runtime.jsxs)("span", {
|
|
className: Newmodules.colorCDCDCD,
|
|
children: ["\u672A\u627E\u5230\u5305\u542B\u201C", formValue.school_id, "\u201D\u7684\u53D1\u5E03\u5355\u4F4D\uFF0C"]
|
|
}), /*#__PURE__*/(0,jsx_runtime.jsx)("span", {
|
|
className: "".concat(Newmodules.color0152d9),
|
|
onClick: handleApplySchool,
|
|
children: "\u7533\u8BF7\u65B0\u589E"
|
|
})]
|
|
}),
|
|
rules: [{
|
|
required: true,
|
|
message: '请输入发布单位'
|
|
}],
|
|
children: /*#__PURE__*/(0,jsx_runtime.jsx)(auto_complete/* default */.Z, {
|
|
placeholder: "\u8BF7\u8F93\u5165\u53D1\u5E03\u5355\u4F4D",
|
|
showSearch: true,
|
|
size: "large",
|
|
options: filterSchoolList === null || filterSchoolList === void 0 ? void 0 : filterSchoolList.map(function (item) {
|
|
return {
|
|
value: item.name
|
|
};
|
|
})
|
|
})
|
|
})]
|
|
}), /*#__PURE__*/(0,jsx_runtime.jsx)("div", {
|
|
className: Newmodules.mdWrap,
|
|
children: /*#__PURE__*/(0,jsx_runtime.jsx)(es_form/* default */.Z.Item, {
|
|
name: "intro",
|
|
label: "\u7B80\u4ECB",
|
|
rules: [{
|
|
required: true,
|
|
message: '请输入实践课程的简介'
|
|
}, {
|
|
whitespace: true,
|
|
message: '请输入实践课程的简介'
|
|
}, {
|
|
max: 65000,
|
|
message: '实践课程的简介最大限制65000个字符'
|
|
}],
|
|
children: /*#__PURE__*/(0,jsx_runtime.jsx)(markdown_editor/* default */.Z, {
|
|
watch: true,
|
|
defaultValue: formValue.intro
|
|
})
|
|
})
|
|
}), /*#__PURE__*/(0,jsx_runtime.jsxs)("div", {
|
|
className: Newmodules.mdWrap,
|
|
children: [/*#__PURE__*/(0,jsx_runtime.jsxs)(row/* default */.Z, {
|
|
align: "top",
|
|
className: "mb10 mt10",
|
|
children: [/*#__PURE__*/(0,jsx_runtime.jsx)(col/* default */.Z, {
|
|
children: /*#__PURE__*/(0,jsx_runtime.jsx)("span", {
|
|
className: "c-red mr10",
|
|
children: "*"
|
|
})
|
|
}), /*#__PURE__*/(0,jsx_runtime.jsx)(col/* default */.Z, {
|
|
flex: "1",
|
|
children: /*#__PURE__*/(0,jsx_runtime.jsx)(es_form/* default */.Z.Item, {
|
|
name: "learning_notes_title",
|
|
label: "",
|
|
style: {
|
|
marginBottom: 0
|
|
},
|
|
rules: [{
|
|
required: true,
|
|
message: '请输课程须知标题'
|
|
}, {
|
|
max: 15,
|
|
message: '请输课程须知标题最大限制15个字符'
|
|
}],
|
|
children: /*#__PURE__*/(0,jsx_runtime.jsx)(input/* default */.Z, {
|
|
style: {
|
|
height: 38
|
|
},
|
|
placeholder: "\u8BF7\u8F93\u5165"
|
|
})
|
|
})
|
|
})]
|
|
}), /*#__PURE__*/(0,jsx_runtime.jsx)(es_form/* default */.Z.Item, {
|
|
name: "notice",
|
|
label: "",
|
|
rules: [{
|
|
required: true,
|
|
message: '请输入实践课程的课程须知'
|
|
}, {
|
|
whitespace: true,
|
|
message: '请输入实践课程的课程须知'
|
|
}, {
|
|
max: 65000,
|
|
message: '实践课程的课程须知最大限制65000个字符'
|
|
}],
|
|
children: /*#__PURE__*/(0,jsx_runtime.jsx)(markdown_editor/* default */.Z, {
|
|
insertTemp: "1",
|
|
watch: true,
|
|
defaultValue: formValue.notice
|
|
})
|
|
})]
|
|
}), /*#__PURE__*/(0,jsx_runtime.jsxs)("div", {
|
|
className: Newmodules.mdWrap,
|
|
children: [/*#__PURE__*/(0,jsx_runtime.jsxs)("div", {
|
|
style: {
|
|
display: 'flex',
|
|
alignItems: 'center'
|
|
},
|
|
children: [/*#__PURE__*/(0,jsx_runtime.jsx)(es_switch/* default */.Z, {
|
|
checked: ismodel,
|
|
style: {
|
|
marginRight: 11,
|
|
minWidth: 32
|
|
},
|
|
onChange: function onChange(e) {
|
|
setismodel(e);
|
|
}
|
|
}), /*#__PURE__*/(0,jsx_runtime.jsxs)("span", {
|
|
className: Newmodules.spanText,
|
|
children: ["\u8BFE\u7A0B\u516C\u544A", /*#__PURE__*/(0,jsx_runtime.jsx)("span", {
|
|
children: "\uFF08\u652F\u6301\u8001\u5E08\u81EA\u5B9A\u4E49\u516C\u544A\u5185\u5BB9\uFF0C\u4EE5\u5F39\u6846\u5F62\u5F0F\u63D0\u9192\u8BFE\u7A0B\u7684\u5B66\u4E60\u7528\u6237\uFF09"
|
|
})]
|
|
})]
|
|
}), ismodel && /*#__PURE__*/(0,jsx_runtime.jsx)(es_form/* default */.Z.Item, {
|
|
style: {
|
|
marginTop: 10
|
|
},
|
|
name: "content",
|
|
label: "",
|
|
rules: [{
|
|
required: true,
|
|
message: '请输入实践课程的课程提示'
|
|
}, {
|
|
max: 10000,
|
|
message: '实践课程的课程提示最大限制10000个字符'
|
|
}],
|
|
children: /*#__PURE__*/(0,jsx_runtime.jsx)(markdown_editor/* default */.Z, {
|
|
insertTemp: "1",
|
|
watch: true,
|
|
defaultValue: formValue.content
|
|
})
|
|
}), ismodel && /*#__PURE__*/(0,jsx_runtime.jsxs)("div", {
|
|
style: {
|
|
marginTop: 20,
|
|
borderBottom: '1px solid #DBDCE0',
|
|
paddingBottom: 7
|
|
},
|
|
children: [/*#__PURE__*/(0,jsx_runtime.jsx)("label", {
|
|
style: {
|
|
color: '#000',
|
|
marginRight: 10
|
|
},
|
|
children: "\u63D0\u793A\u6B21\u6570"
|
|
}), /*#__PURE__*/(0,jsx_runtime.jsxs)(es_radio/* default.Group */.ZP.Group, {
|
|
value: open_num,
|
|
onChange: function onChange(e) {
|
|
setopen_num(e.target.value);
|
|
},
|
|
children: [/*#__PURE__*/(0,jsx_runtime.jsx)(es_radio/* default */.ZP, {
|
|
className: "c-black",
|
|
value: -1,
|
|
children: "\u6BCF\u6B21"
|
|
}), /*#__PURE__*/(0,jsx_runtime.jsx)(es_radio/* default */.ZP, {
|
|
className: "ml20 c-black",
|
|
value: 1,
|
|
children: "\u4E00\u6B21"
|
|
})]
|
|
})]
|
|
})]
|
|
}), /*#__PURE__*/(0,jsx_runtime.jsxs)("div", {
|
|
className: Newmodules.mdWrap,
|
|
style: {
|
|
marginTop: 25
|
|
},
|
|
children: [/*#__PURE__*/(0,jsx_runtime.jsx)(es_checkbox/* default */.Z, {
|
|
checked: custseq,
|
|
onChange: function onChange(e) {
|
|
setCustSeq(e === null || e === void 0 ? void 0 : e.target.checked);
|
|
},
|
|
children: /*#__PURE__*/(0,jsx_runtime.jsxs)("span", {
|
|
className: Newmodules.spanText,
|
|
children: ["\u5C55\u793A\u9ED8\u8BA4\u7AE0\u8282\u5E8F\u53F7", /*#__PURE__*/(0,jsx_runtime.jsx)("span", {
|
|
children: "\uFF08\u9009\u4E2D\uFF0C\u5219\u4E3A\u7AE0\u8282\u4E0B\u6240\u6709\u9879\u76EE\u6DFB\u52A0\u6392\u5E8F\u7F16\u53F7\uFF09"
|
|
})]
|
|
})
|
|
}), /*#__PURE__*/(0,jsx_runtime.jsx)("br", {}), /*#__PURE__*/(0,jsx_runtime.jsx)(es_checkbox/* default */.Z, {
|
|
style: {
|
|
marginTop: '10px'
|
|
},
|
|
checked: showspoc,
|
|
onChange: function onChange(e) {
|
|
return setShowSpoc(e === null || e === void 0 ? void 0 : e.target.checked);
|
|
},
|
|
children: /*#__PURE__*/(0,jsx_runtime.jsxs)("span", {
|
|
className: Newmodules.spanText,
|
|
children: ["\u81EA\u9009\u5E76\u5C55\u793ASPOC\u8BFE\u5802", /*#__PURE__*/(0,jsx_runtime.jsx)("span", {
|
|
children: "\uFF08\u9009\u4E2D\uFF0C\u5219\u5728\u6559\u5B66\u56E2\u961F\u4E0B\u65B9\u6DFB\u52A0SPOC\u8BFE\u5802\u6A21\u5757\uFF0C\u56E2\u961F\u6210\u5458\u53EF\u7BA1\u7406\u6A21\u5757\u4E2D\u8BFE\u5802\u7684\u5C55\u793A\uFF09"
|
|
})]
|
|
})
|
|
}), /*#__PURE__*/(0,jsx_runtime.jsx)("br", {}), /*#__PURE__*/(0,jsx_runtime.jsx)(es_checkbox/* default */.Z, {
|
|
style: {
|
|
marginTop: '10px'
|
|
},
|
|
checked: show_tag,
|
|
onChange: function onChange(e) {
|
|
return setshow_tag(e === null || e === void 0 ? void 0 : e.target.checked);
|
|
},
|
|
children: /*#__PURE__*/(0,jsx_runtime.jsxs)("span", {
|
|
className: Newmodules.spanText,
|
|
children: ["\u5C55\u793A\u6280\u672F\u6807\u7B7E\u6A21\u5757", /*#__PURE__*/(0,jsx_runtime.jsx)("span", {
|
|
children: "\uFF08\u9009\u4E2D\uFF0C\u5219\u5728\u6559\u5B66\u56E2\u961F\u4E0B\u65B9\u6DFB\u52A0\u6280\u672F\u6807\u7B7E\u6A21\u5757\uFF09"
|
|
})]
|
|
})
|
|
}), /*#__PURE__*/(0,jsx_runtime.jsx)("br", {}), /*#__PURE__*/(0,jsx_runtime.jsx)(es_checkbox/* default */.Z, {
|
|
style: {
|
|
marginTop: '10px'
|
|
},
|
|
checked: show_history,
|
|
onChange: function onChange(e) {
|
|
return setshow_history(e === null || e === void 0 ? void 0 : e.target.checked);
|
|
},
|
|
children: /*#__PURE__*/(0,jsx_runtime.jsxs)("span", {
|
|
className: Newmodules.spanText,
|
|
children: ["\u5C55\u793A\u5386\u53F2\u8BFE\u5802\u6A21\u5757", /*#__PURE__*/(0,jsx_runtime.jsx)("span", {
|
|
children: "\uFF08\u9009\u4E2D\uFF0C\u5219\u5728\u6559\u5B66\u56E2\u961F\u4E0B\u65B9\u6DFB\u52A0\u5386\u53F2\u8BFE\u5802\u6A21\u5757\uFF0C\u56E2\u961F\u6210\u5458\u53EF\u7BA1\u7406\u6A21\u5757\u4E2D\u8BFE\u5802\u7684\u5C55\u793A\uFF09"
|
|
})]
|
|
})
|
|
}), /*#__PURE__*/(0,jsx_runtime.jsx)("br", {}), /*#__PURE__*/(0,jsx_runtime.jsx)(es_checkbox/* default */.Z, {
|
|
style: {
|
|
marginTop: '10px'
|
|
},
|
|
checked: allow_download,
|
|
onChange: function onChange(e) {
|
|
return setallow_download(e === null || e === void 0 ? void 0 : e.target.checked);
|
|
},
|
|
children: /*#__PURE__*/(0,jsx_runtime.jsxs)("span", {
|
|
className: Newmodules.spanText,
|
|
children: ["\u5141\u8BB8\u4E0B\u8F7D\u6559\u5B66\u8BFE\u4EF6", /*#__PURE__*/(0,jsx_runtime.jsx)("span", {
|
|
children: "\uFF08\u9009\u4E2D\uFF0C\u5219\u5141\u8BB8\u5B66\u4E60\u7528\u6237\u4E0B\u8F7D\u8BFE\u7A0B\u7AE0\u8282\u4E2D\u4E0A\u4F20\u7684\u6559\u5B66\u8BFE\u4EF6\uFF09"
|
|
})]
|
|
})
|
|
}), /*#__PURE__*/(0,jsx_runtime.jsx)("br", {}), /*#__PURE__*/(0,jsx_runtime.jsx)(es_checkbox/* default */.Z, {
|
|
style: {
|
|
marginTop: '10px'
|
|
},
|
|
checked: show_course_section,
|
|
onChange: function onChange(e) {
|
|
return setShowCourseSection(e === null || e === void 0 ? void 0 : e.target.checked);
|
|
},
|
|
children: /*#__PURE__*/(0,jsx_runtime.jsxs)("span", {
|
|
className: Newmodules.spanText,
|
|
children: ["\u9ED8\u8BA4\u5C55\u5F00\u8BFE\u7A0B\u5C0F\u8282\u5185\u5BB9", /*#__PURE__*/(0,jsx_runtime.jsx)("span", {
|
|
children: "\uFF08\u9009\u4E2D\uFF0C\u5219\u7528\u6237\u5728\u8FDB\u5165\u662F\u5C06\u8BFE\u7A0B\u8BE6\u60C5\u9875\u9762\u65F6\uFF0C\u9ED8\u8BA4\u5C55\u5F00\u6240\u6709\u5C0F\u8282\u5185\u5BB9\uFF09"
|
|
})]
|
|
})
|
|
}), /*#__PURE__*/(0,jsx_runtime.jsx)("br", {}), /*#__PURE__*/(0,jsx_runtime.jsxs)("div", {
|
|
className: "mt10",
|
|
children: [/*#__PURE__*/(0,jsx_runtime.jsx)("div", {
|
|
className: "c-black mb10",
|
|
children: "\u81EA\u5B9A\u4E49\u9876\u90E8\u80CC\u666F\u56FE"
|
|
}), /*#__PURE__*/(0,jsx_runtime.jsxs)(upload/* default */.Z, {
|
|
action: env/* default */.Z.API_SERVER + '/api/attachments.json',
|
|
withCredentials: true,
|
|
fileList: Filelists,
|
|
onChange: function onChange(e) {
|
|
var _e$fileList;
|
|
var isLt2M = (e === null || e === void 0 ? void 0 : e.file.size) / 1024 / 1024 < 2;
|
|
if (!((_e$fileList = e.fileList) !== null && _e$fileList !== void 0 && _e$fileList.length)) return false;
|
|
if (!isLt2M) {
|
|
setFileLists(toConsumableArray_default()(Filelists));
|
|
} else {
|
|
var _e$fileList2;
|
|
setFileLists(e === null || e === void 0 || (_e$fileList2 = e.fileList) === null || _e$fileList2 === void 0 ? void 0 : _e$fileList2.slice(-1));
|
|
}
|
|
},
|
|
beforeUpload: function beforeUpload(file) {
|
|
var isJpgOrPng = file.type === 'image/jpeg' || file.type === 'image/png';
|
|
if (!isJpgOrPng) {
|
|
message/* default */.ZP.error('只能上传jpg 或者png图片');
|
|
return false;
|
|
}
|
|
var isLt2M = file.size / 1024 / 1024 < 2;
|
|
if (!isLt2M) {
|
|
message/* default */.ZP.error('文件大小不能大于2m');
|
|
return false;
|
|
}
|
|
return isJpgOrPng && isLt2M;
|
|
},
|
|
onRemove: function onRemove(file) {
|
|
setFileLists([]);
|
|
},
|
|
children: [/*#__PURE__*/(0,jsx_runtime.jsx)("div", {
|
|
className: Newmodules.aBtn,
|
|
children: "\u4E0A\u4F20\u56FE\u7247"
|
|
}), /*#__PURE__*/(0,jsx_runtime.jsx)("span", {
|
|
style: {
|
|
color: '#5F6367',
|
|
pointerEvents: 'none'
|
|
},
|
|
children: "\uFF08\u672C\u9879\u975E\u5FC5\u9700\u3002\u5982\u4E0D\u4E0A\u4F20\uFF0C\u5219\u4F7F\u7528\u7CFB\u7EDF\u9ED8\u8BA4\u56FE\u7247\uFF1B\u5982\u4E0A\u4F20\uFF0C\u8BF7\u9009\u62E9jpg\u3001png\u683C\u5F0F\uFF0C\u5927\u5C0F\u4E0D\u8D85\u8FC72M\uFF0C\u5EFA\u8BAE\u5C3A\u5BF81920*240\u50CF\u7D20\uFF09"
|
|
})]
|
|
})]
|
|
}), /*#__PURE__*/(0,jsx_runtime.jsxs)("div", {
|
|
className: "mt10",
|
|
children: [/*#__PURE__*/(0,jsx_runtime.jsx)("div", {
|
|
className: "c-black mb10",
|
|
children: "\u81EA\u5B9A\u4E49\u9876\u90E8\u5185\u5BB9\u56FE"
|
|
}), /*#__PURE__*/(0,jsx_runtime.jsxs)(upload/* default */.Z, {
|
|
action: env/* default */.Z.API_SERVER + '/api/attachments.json',
|
|
withCredentials: true,
|
|
fileList: Filelists1,
|
|
onChange: function onChange(e) {
|
|
var _e$fileList3;
|
|
var isLt2M = (e === null || e === void 0 ? void 0 : e.file.size) / 1024 / 1024 < 2;
|
|
if (!((_e$fileList3 = e.fileList) !== null && _e$fileList3 !== void 0 && _e$fileList3.length)) return false;
|
|
if (!isLt2M) {
|
|
setFileLists1(toConsumableArray_default()(Filelists1));
|
|
} else {
|
|
var _e$fileList4;
|
|
setFileLists1(e === null || e === void 0 || (_e$fileList4 = e.fileList) === null || _e$fileList4 === void 0 ? void 0 : _e$fileList4.slice(-1));
|
|
}
|
|
},
|
|
beforeUpload: function beforeUpload(file) {
|
|
var isJpgOrPng = file.type === 'image/jpeg' || file.type === 'image/png';
|
|
if (!isJpgOrPng) {
|
|
message/* default */.ZP.error('只能上传jpg 或者png图片');
|
|
return false;
|
|
}
|
|
var isLt2M = file.size / 1024 / 1024 < 2;
|
|
if (!isLt2M) {
|
|
message/* default */.ZP.error('文件大小不能大于2m');
|
|
return false;
|
|
}
|
|
return isJpgOrPng && isLt2M;
|
|
},
|
|
onRemove: function onRemove(file) {
|
|
setFileLists1([]);
|
|
},
|
|
children: [/*#__PURE__*/(0,jsx_runtime.jsx)("div", {
|
|
className: Newmodules.aBtn,
|
|
children: "\u4E0A\u4F20\u56FE\u7247"
|
|
}), /*#__PURE__*/(0,jsx_runtime.jsx)("span", {
|
|
style: {
|
|
color: '#5F6367',
|
|
pointerEvents: 'none'
|
|
},
|
|
children: "\uFF08\u672C\u9879\u975E\u5FC5\u9700\u3002\u5982\u4E0D\u4E0A\u4F20\uFF0C\u5219\u4F7F\u7528\u7CFB\u7EDF\u9ED8\u8BA4\u56FE\u7247\uFF1B\u5982\u4E0A\u4F20\uFF0C\u8BF7\u9009\u62E9jpg\u3001png\u683C\u5F0F\uFF0C\u5927\u5C0F\u4E0D\u8D85\u8FC72M\uFF0C\u5EFA\u8BAE\u5C3A\u5BF81200*240\u50CF\u7D20\uFF09"
|
|
})]
|
|
})]
|
|
})]
|
|
}), /*#__PURE__*/(0,jsx_runtime.jsxs)("div", {
|
|
className: Newmodules.backgroundFa,
|
|
children: [/*#__PURE__*/(0,jsx_runtime.jsx)("div", {
|
|
className: Newmodules.bBtn,
|
|
onClick: goBack,
|
|
children: "\u53D6\u6D88"
|
|
}), /*#__PURE__*/(0,jsx_runtime.jsx)(es_button/* default */.ZP, {
|
|
className: Newmodules.cBtn,
|
|
onClick: function onClick() {
|
|
return form.submit();
|
|
},
|
|
loading: loading['newCourse/editCourse'] || loading['newCourse/submitCourse'],
|
|
children: "\u63D0\u4EA4 "
|
|
})]
|
|
})]
|
|
}), /*#__PURE__*/(0,jsx_runtime.jsx)(components_AppplySchoolModal, {
|
|
schoolName: formValue.school_id,
|
|
onSuccess: onSuccess
|
|
})]
|
|
})
|
|
});
|
|
};
|
|
/* harmony default export */ var New = ((0,_umi_production_exports.connect)(function (_ref7) {
|
|
var user = _ref7.user,
|
|
newCourse = _ref7.newCourse,
|
|
loading = _ref7.loading,
|
|
globalSetting = _ref7.globalSetting;
|
|
return {
|
|
user: user,
|
|
newCourse: newCourse,
|
|
globalSetting: globalSetting,
|
|
loading: loading.effects
|
|
};
|
|
})(NewCoursePage));
|
|
|
|
/***/ })
|
|
|
|
}]); |