|
|
"use strict";
|
|
|
(self["webpackChunk"] = self["webpackChunk"] || []).push([[67589],{
|
|
|
|
|
|
/***/ 56971:
|
|
|
/*!*****************************************!*\
|
|
|
!*** ./src/components/NoData/index.tsx ***!
|
|
|
\*****************************************/
|
|
|
/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
|
|
|
|
|
|
/* harmony import */ var _root_workspace_ppte5yg23_SJ5m_develop_node_modules_babel_runtime_7_23_6_babel_runtime_helpers_objectSpread2_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./node_modules/_@babel_runtime@7.23.6@@babel/runtime/helpers/objectSpread2.js */ 82242);
|
|
|
/* harmony import */ var _root_workspace_ppte5yg23_SJ5m_develop_node_modules_babel_runtime_7_23_6_babel_runtime_helpers_objectSpread2_js__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_root_workspace_ppte5yg23_SJ5m_develop_node_modules_babel_runtime_7_23_6_babel_runtime_helpers_objectSpread2_js__WEBPACK_IMPORTED_MODULE_0__);
|
|
|
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! react */ 59301);
|
|
|
/* harmony import */ var _assets_images_icons_nodata_png__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @/assets/images/icons/nodata.png */ 93314);
|
|
|
/* harmony import */ var antd__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! antd */ 3113);
|
|
|
/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! react/jsx-runtime */ 37712);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
var noData = function noData(_ref) {
|
|
|
var img = _ref.img,
|
|
|
_ref$buttonProps = _ref.buttonProps,
|
|
|
buttonProps = _ref$buttonProps === void 0 ? {} : _ref$buttonProps,
|
|
|
_ref$styles = _ref.styles,
|
|
|
styles = _ref$styles === void 0 ? {} : _ref$styles,
|
|
|
customText = _ref.customText,
|
|
|
ButtonText = _ref.ButtonText,
|
|
|
ButtonClick = _ref.ButtonClick,
|
|
|
Buttonclass = _ref.Buttonclass,
|
|
|
ButtonTwo = _ref.ButtonTwo,
|
|
|
imgStyles = _ref.imgStyles,
|
|
|
_ref$loading = _ref.loading,
|
|
|
loading = _ref$loading === void 0 ? false : _ref$loading;
|
|
|
return /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_3__.jsxs)("section", {
|
|
|
className: "tc animated fadeIn",
|
|
|
style: _root_workspace_ppte5yg23_SJ5m_develop_node_modules_babel_runtime_7_23_6_babel_runtime_helpers_objectSpread2_js__WEBPACK_IMPORTED_MODULE_0___default()(_root_workspace_ppte5yg23_SJ5m_develop_node_modules_babel_runtime_7_23_6_babel_runtime_helpers_objectSpread2_js__WEBPACK_IMPORTED_MODULE_0___default()({}, {
|
|
|
color: '#999',
|
|
|
margin: '100px auto',
|
|
|
visibility: loading ? 'hidden' : 'visible'
|
|
|
}), styles),
|
|
|
children: [/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_3__.jsx)("img", {
|
|
|
src: img || _assets_images_icons_nodata_png__WEBPACK_IMPORTED_MODULE_2__,
|
|
|
style: _root_workspace_ppte5yg23_SJ5m_develop_node_modules_babel_runtime_7_23_6_babel_runtime_helpers_objectSpread2_js__WEBPACK_IMPORTED_MODULE_0___default()(_root_workspace_ppte5yg23_SJ5m_develop_node_modules_babel_runtime_7_23_6_babel_runtime_helpers_objectSpread2_js__WEBPACK_IMPORTED_MODULE_0___default()({}, imgStyles), {}, {
|
|
|
pointerEvents: "none",
|
|
|
userSelect: "none"
|
|
|
})
|
|
|
}), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_3__.jsx)("p", {
|
|
|
className: "mt20 font14",
|
|
|
children: customText || '暂时还没有相关数据哦!'
|
|
|
}), ButtonText && /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_3__.jsx)(antd__WEBPACK_IMPORTED_MODULE_4__/* ["default"] */ .ZP, _root_workspace_ppte5yg23_SJ5m_develop_node_modules_babel_runtime_7_23_6_babel_runtime_helpers_objectSpread2_js__WEBPACK_IMPORTED_MODULE_0___default()(_root_workspace_ppte5yg23_SJ5m_develop_node_modules_babel_runtime_7_23_6_babel_runtime_helpers_objectSpread2_js__WEBPACK_IMPORTED_MODULE_0___default()({
|
|
|
className: Buttonclass,
|
|
|
onClick: ButtonClick
|
|
|
}, buttonProps), {}, {
|
|
|
children: ButtonText
|
|
|
})), ButtonTwo && ButtonTwo]
|
|
|
});
|
|
|
};
|
|
|
/* harmony default export */ __webpack_exports__.Z = (noData);
|
|
|
|
|
|
/***/ }),
|
|
|
|
|
|
/***/ 1393:
|
|
|
/*!***************************************************************************!*\
|
|
|
!*** ./src/pages/virtualSpaces/Lists/DigitalTopics/index.tsx + 3 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 */ DigitalTopics; }
|
|
|
});
|
|
|
|
|
|
// 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/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/asyncToGenerator.js
|
|
|
var asyncToGenerator = __webpack_require__(41498);
|
|
|
var asyncToGenerator_default = /*#__PURE__*/__webpack_require__.n(asyncToGenerator);
|
|
|
// EXTERNAL MODULE: ./node_modules/_@babel_runtime@7.23.6@@babel/runtime/helpers/slicedToArray.js
|
|
|
var slicedToArray = __webpack_require__(79800);
|
|
|
var slicedToArray_default = /*#__PURE__*/__webpack_require__.n(slicedToArray);
|
|
|
// EXTERNAL MODULE: ./node_modules/_react@17.0.2@react/index.js
|
|
|
var _react_17_0_2_react = __webpack_require__(59301);
|
|
|
// EXTERNAL MODULE: ./src/.umi-production/exports.ts + 15 modules
|
|
|
var _umi_production_exports = __webpack_require__(58011);
|
|
|
// 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/modal/index.js + 16 modules
|
|
|
var modal = __webpack_require__(43418);
|
|
|
// 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/spin/index.js + 1 modules
|
|
|
var spin = __webpack_require__(71418);
|
|
|
// 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/pagination/index.js + 10 modules
|
|
|
var pagination = __webpack_require__(66786);
|
|
|
// EXTERNAL MODULE: ./src/components/NoData/index.tsx
|
|
|
var NoData = __webpack_require__(56971);
|
|
|
;// CONCATENATED MODULE: ./src/pages/virtualSpaces/Lists/DigitalTopics/index.less?modules
|
|
|
// extracted by mini-css-extract-plugin
|
|
|
/* harmony default export */ var DigitalTopicsmodules = ({"flex_box_center":"flex_box_center___Rnm3q","flex_space_between":"flex_space_between___nRwGo","flex_box_vertical_center":"flex_box_vertical_center___uDVyV","flex_box_center_end":"flex_box_center_end___ECrdZ","flex_box_column":"flex_box_column___kBaOF","wrap":"wrap___KmeFa","dataDiv":"dataDiv___JXtBq","item_data":"item_data___zWMwd","item_data_content":"item_data_content___N5QQ7","item_data_button":"item_data_button___gVxEX","FileListDiv":"FileListDiv___dC2hh","FileItem":"FileItem____gvjM","FileItemUse":"FileItemUse___FQ06R","file_name":"file_name___dhlos","footer":"footer___BRkIa"});
|
|
|
// EXTERNAL MODULE: ./src/components/ui-customization/index.tsx + 34 modules
|
|
|
var ui_customization = __webpack_require__(75748);
|
|
|
// EXTERNAL MODULE: ./src/utils/authority.ts
|
|
|
var authority = __webpack_require__(77971);
|
|
|
// 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/input/index.js + 5 modules
|
|
|
var input = __webpack_require__(62680);
|
|
|
// EXTERNAL MODULE: ./node_modules/_antd@5.9.0@antd/es/upload/index.js + 24 modules
|
|
|
var upload = __webpack_require__(33556);
|
|
|
;// CONCATENATED MODULE: ./src/pages/virtualSpaces/Lists/DigitalTopics/AddOrEdit/index.less?modules
|
|
|
// extracted by mini-css-extract-plugin
|
|
|
/* harmony default export */ var AddOrEditmodules = ({"flex_box_center":"flex_box_center___uRCSD","flex_space_between":"flex_space_between___tvdXV","flex_box_vertical_center":"flex_box_vertical_center___ymBGe","flex_box_center_end":"flex_box_center_end___HJZ3N","flex_box_column":"flex_box_column___T1kxI","form":"form___ENxpD","btn":"btn___bNIzG","img":"img___bxPJt"});
|
|
|
// EXTERNAL MODULE: ./src/components/ui-customization/reset.less?modules
|
|
|
var resetmodules = __webpack_require__(79274);
|
|
|
// EXTERNAL MODULE: ./src/utils/env.ts + 1 modules
|
|
|
var env = __webpack_require__(2367);
|
|
|
// EXTERNAL MODULE: ./node_modules/_@ant-design_icons@5.3.5@@ant-design/icons/es/icons/CloseCircleFilled.js + 1 modules
|
|
|
var CloseCircleFilled = __webpack_require__(6787);
|
|
|
// EXTERNAL MODULE: ./node_modules/_react@17.0.2@react/jsx-runtime.js
|
|
|
var jsx_runtime = __webpack_require__(37712);
|
|
|
;// CONCATENATED MODULE: ./src/pages/virtualSpaces/Lists/DigitalTopics/AddOrEdit/index.tsx
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
var AddOrEdit = function AddOrEdit(_ref) {
|
|
|
var _fileList$3;
|
|
|
var visible = _ref.visible,
|
|
|
dialogData = _ref.dialogData,
|
|
|
keydom = _ref.keydom,
|
|
|
onOk = _ref.onOk,
|
|
|
onCancel = _ref.onCancel,
|
|
|
_ref$title = _ref.title,
|
|
|
title = _ref$title === void 0 ? '' : _ref$title;
|
|
|
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)(false),
|
|
|
_useState2 = slicedToArray_default()(_useState, 2),
|
|
|
btnLoading = _useState2[0],
|
|
|
setBtnLoading = _useState2[1];
|
|
|
var _useState3 = (0,_react_17_0_2_react.useState)([]),
|
|
|
_useState4 = slicedToArray_default()(_useState3, 2),
|
|
|
fileList = _useState4[0],
|
|
|
setFileList = _useState4[1];
|
|
|
var _useState5 = (0,_react_17_0_2_react.useState)(false),
|
|
|
_useState6 = slicedToArray_default()(_useState5, 2),
|
|
|
imgLoading = _useState6[0],
|
|
|
setImgLoading = _useState6[1];
|
|
|
var query = (0,_umi_production_exports.useParams)();
|
|
|
(0,_react_17_0_2_react.useEffect)(function () {
|
|
|
if (dialogData !== null && dialogData !== void 0 && dialogData.id) {
|
|
|
var _dialogData$cover, _dialogData$cover2;
|
|
|
form.setFieldsValue(objectSpread2_default()(objectSpread2_default()({}, dialogData), {}, {
|
|
|
cover_id: dialogData === null || dialogData === void 0 || (_dialogData$cover = dialogData.cover) === null || _dialogData$cover === void 0 ? void 0 : _dialogData$cover.id
|
|
|
}));
|
|
|
if (dialogData !== null && dialogData !== void 0 && (_dialogData$cover2 = dialogData.cover) !== null && _dialogData$cover2 !== void 0 && _dialogData$cover2.id) {
|
|
|
var _dialogData$cover3;
|
|
|
setFileList([objectSpread2_default()(objectSpread2_default()({}, dialogData === null || dialogData === void 0 ? void 0 : dialogData.cover), {}, {
|
|
|
response: {
|
|
|
id: dialogData === null || dialogData === void 0 || (_dialogData$cover3 = dialogData.cover) === null || _dialogData$cover3 === void 0 ? void 0 : _dialogData$cover3.id
|
|
|
}
|
|
|
})]);
|
|
|
} else {
|
|
|
setFileList([]);
|
|
|
}
|
|
|
}
|
|
|
}, [keydom]);
|
|
|
var handleOk = function handleOk() {
|
|
|
form.submit();
|
|
|
};
|
|
|
var handleCancel = function handleCancel() {
|
|
|
onCancel();
|
|
|
};
|
|
|
var handleFinish = /*#__PURE__*/function () {
|
|
|
var _ref2 = asyncToGenerator_default()( /*#__PURE__*/regeneratorRuntime_default()().mark(function _callee(values) {
|
|
|
var _fileList$;
|
|
|
var param;
|
|
|
return regeneratorRuntime_default()().wrap(function _callee$(_context) {
|
|
|
while (1) switch (_context.prev = _context.next) {
|
|
|
case 0:
|
|
|
setBtnLoading(true);
|
|
|
param = objectSpread2_default()(objectSpread2_default()({}, values), {}, {
|
|
|
cover_id: (fileList === null || fileList === void 0 || (_fileList$ = fileList[0]) === null || _fileList$ === void 0 || (_fileList$ = _fileList$.response) === null || _fileList$ === void 0 ? void 0 : _fileList$.id) || ''
|
|
|
});
|
|
|
onOk(param);
|
|
|
case 3:
|
|
|
case "end":
|
|
|
return _context.stop();
|
|
|
}
|
|
|
}, _callee);
|
|
|
}));
|
|
|
return function handleFinish(_x) {
|
|
|
return _ref2.apply(this, arguments);
|
|
|
};
|
|
|
}();
|
|
|
var handleFileChange = function handleFileChange(info) {
|
|
|
form.setFieldsValue({
|
|
|
cover_id: ''
|
|
|
});
|
|
|
var statusList = ["uploading", "done", "removed"];
|
|
|
if (statusList.includes(info.file.status)) {
|
|
|
var _info$fileList;
|
|
|
if (info.file.status === 'uploading') {
|
|
|
setImgLoading(true);
|
|
|
}
|
|
|
if (info.file.status === 'done') {
|
|
|
setImgLoading(false);
|
|
|
}
|
|
|
setFileList(info.fileList);
|
|
|
form.setFieldsValue({
|
|
|
cover_id: (_info$fileList = info.fileList) === null || _info$fileList === void 0 || (_info$fileList = _info$fileList[0]) === null || _info$fileList === void 0 || (_info$fileList = _info$fileList.response) === null || _info$fileList === void 0 ? void 0 : _info$fileList.id
|
|
|
});
|
|
|
}
|
|
|
};
|
|
|
var handleFileRemove = function handleFileRemove(file) {
|
|
|
setFileList([]);
|
|
|
};
|
|
|
var handleFileBeforeUpload = function handleFileBeforeUpload(file) {
|
|
|
var isJpgOrPng = file.type === 'image/jpeg' || file.type === 'image/png';
|
|
|
if (!isJpgOrPng) {
|
|
|
message/* default */.ZP.error('请上传jpg或png的图片!');
|
|
|
return Promise.reject();
|
|
|
}
|
|
|
var is150M = file.size / 1024 / 1024 > 2;
|
|
|
if (is150M) {
|
|
|
message/* default */.ZP.info('文件大小必须小于2MB');
|
|
|
return Promise.reject();
|
|
|
}
|
|
|
setFileList([]);
|
|
|
return true;
|
|
|
};
|
|
|
var renderImg = function renderImg() {
|
|
|
var _fileList$2;
|
|
|
return /*#__PURE__*/(0,jsx_runtime.jsxs)("div", {
|
|
|
className: AddOrEditmodules.img,
|
|
|
children: [/*#__PURE__*/(0,jsx_runtime.jsx)("img", {
|
|
|
src: env/* default */.Z.API_SERVER + "/api/attachments/" + (fileList === null || fileList === void 0 || (_fileList$2 = fileList[0]) === null || _fileList$2 === void 0 || (_fileList$2 = _fileList$2.response) === null || _fileList$2 === void 0 ? void 0 : _fileList$2.id),
|
|
|
alt: "avatar",
|
|
|
style: {
|
|
|
width: '100%'
|
|
|
}
|
|
|
}), /*#__PURE__*/(0,jsx_runtime.jsx)("div", {
|
|
|
children: /*#__PURE__*/(0,jsx_runtime.jsx)(CloseCircleFilled/* default */.Z, {
|
|
|
onClick: function onClick() {
|
|
|
setFileList([]);
|
|
|
form.setFieldsValue({
|
|
|
cover_id: ''
|
|
|
});
|
|
|
},
|
|
|
style: {
|
|
|
fontSize: '16px',
|
|
|
color: 'red'
|
|
|
}
|
|
|
})
|
|
|
})]
|
|
|
});
|
|
|
};
|
|
|
return /*#__PURE__*/(0,jsx_runtime.jsx)(modal/* default */.Z, {
|
|
|
title: "".concat(dialogData !== null && dialogData !== void 0 && dialogData.id ? '编辑' : '新建').concat(title),
|
|
|
open: visible,
|
|
|
onOk: handleOk,
|
|
|
centered: true,
|
|
|
onCancel: handleCancel
|
|
|
// confirmLoading={btnLoading}
|
|
|
,
|
|
|
okButtonProps: {
|
|
|
disabled: imgLoading
|
|
|
},
|
|
|
width: 686,
|
|
|
afterClose: function afterClose() {
|
|
|
setBtnLoading(false);
|
|
|
setFileList([]);
|
|
|
form.resetFields();
|
|
|
},
|
|
|
okText: '确认',
|
|
|
cancelText: "\u53D6\u6D88",
|
|
|
wrapClassName: resetmodules/* default */.Z.CustomCss,
|
|
|
children: /*#__PURE__*/(0,jsx_runtime.jsxs)(es_form/* default */.Z, {
|
|
|
form: form,
|
|
|
colon: false,
|
|
|
labelCol: {
|
|
|
span: 4
|
|
|
},
|
|
|
wrapperCol: {
|
|
|
span: 18
|
|
|
},
|
|
|
onFinish: handleFinish,
|
|
|
className: AddOrEditmodules.form,
|
|
|
children: [/*#__PURE__*/(0,jsx_runtime.jsx)(es_form/* default */.Z.Item, {
|
|
|
label: "\u6807\u9898",
|
|
|
name: "name",
|
|
|
rules: [{
|
|
|
required: true,
|
|
|
validator: function validator(_, value) {
|
|
|
var _value$replaceAll;
|
|
|
return (value === null || value === void 0 || (_value$replaceAll = value.replaceAll(' ', '')) === null || _value$replaceAll === void 0 ? void 0 : _value$replaceAll.length) > 0 ? Promise.resolve() : Promise.reject('请输入标题');
|
|
|
}
|
|
|
}],
|
|
|
children: /*#__PURE__*/(0,jsx_runtime.jsx)(input/* default */.Z, {
|
|
|
maxLength: 60,
|
|
|
placeholder: "\u8BF7\u8F93\u5165\u6807\u9898"
|
|
|
})
|
|
|
}), /*#__PURE__*/(0,jsx_runtime.jsx)(es_form/* default */.Z.Item, {
|
|
|
label: "\u94FE\u63A5",
|
|
|
name: "lesson_url",
|
|
|
rules: [{
|
|
|
required: true,
|
|
|
validator: function validator(_, value) {
|
|
|
var _value$replaceAll2;
|
|
|
return (value === null || value === void 0 || (_value$replaceAll2 = value.replaceAll(' ', '')) === null || _value$replaceAll2 === void 0 ? void 0 : _value$replaceAll2.length) > 0 ? Promise.resolve() : Promise.reject('请输入链接');
|
|
|
}
|
|
|
}],
|
|
|
children: /*#__PURE__*/(0,jsx_runtime.jsx)(input/* default */.Z, {
|
|
|
placeholder: "\u8BF7\u8F93\u5165\u94FE\u63A5"
|
|
|
})
|
|
|
}), /*#__PURE__*/(0,jsx_runtime.jsx)(es_form/* default */.Z.Item, {
|
|
|
name: "cover_id",
|
|
|
label: "\u4E0A\u4F20\u5C01\u9762\u56FE",
|
|
|
children: /*#__PURE__*/(0,jsx_runtime.jsx)("div", {
|
|
|
className: AddOrEditmodules.upload,
|
|
|
children: fileList !== null && fileList !== void 0 && (_fileList$3 = fileList[0]) !== null && _fileList$3 !== void 0 && (_fileList$3 = _fileList$3.response) !== null && _fileList$3 !== void 0 && _fileList$3.id ? renderImg() : /*#__PURE__*/(0,jsx_runtime.jsxs)(jsx_runtime.Fragment, {
|
|
|
children: [/*#__PURE__*/(0,jsx_runtime.jsx)(upload/* default */.Z, {
|
|
|
fileList: fileList,
|
|
|
action: "".concat(env/* default */.Z.API_SERVER, "/api/attachments.json"),
|
|
|
onChange: function onChange(e) {
|
|
|
return handleFileChange(e);
|
|
|
},
|
|
|
onRemove: function onRemove(e) {
|
|
|
return handleFileRemove(e);
|
|
|
},
|
|
|
beforeUpload: function beforeUpload(e) {
|
|
|
return handleFileBeforeUpload(e);
|
|
|
},
|
|
|
withCredentials: true,
|
|
|
accept: "image/*",
|
|
|
children: /*#__PURE__*/(0,jsx_runtime.jsxs)(ui_customization/* CustomButton */.op, {
|
|
|
style: {
|
|
|
borderRadius: '2px',
|
|
|
marginLeft: 4,
|
|
|
marginTop: 3
|
|
|
},
|
|
|
children: [/*#__PURE__*/(0,jsx_runtime.jsx)("i", {
|
|
|
className: "iconfont icon-shangchuantupian2 mr5"
|
|
|
}), "\u4E0A\u4F20\u56FE\u7247"]
|
|
|
})
|
|
|
}), /*#__PURE__*/(0,jsx_runtime.jsx)("div", {
|
|
|
style: {
|
|
|
fontSize: 12,
|
|
|
color: '#999',
|
|
|
margin: 5
|
|
|
},
|
|
|
children: "\u8BF4\u660E\uFF1A\u652F\u6301\u4E0A\u4F20jpg/png\u7B49\u683C\u5F0F\u6587\u4EF6\uFF0C\u6587\u4EF6\u5927\u5C0F\u4E0D\u80FD\u8D85\u8FC72M\uFF0C\u5EFA\u8BAE\u4F7F\u7528288*158\u50CF\u7D20\uFF1B\u5982\u4E0D\u4E0A\u4F20\uFF0C\u9ED8\u8BA4\u4F7F\u7528\u7CFB\u7EDF\u56FE\u7247\u3002"
|
|
|
})]
|
|
|
})
|
|
|
})
|
|
|
})]
|
|
|
})
|
|
|
});
|
|
|
};
|
|
|
/* harmony default export */ var DigitalTopics_AddOrEdit = (AddOrEdit);
|
|
|
// EXTERNAL MODULE: ./src/utils/fetch.ts
|
|
|
var fetch = __webpack_require__(56648);
|
|
|
;// CONCATENATED MODULE: ./src/pages/virtualSpaces/Lists/DigitalTopics/index.tsx
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
var Page = function Page(_ref) {
|
|
|
var _menus$find;
|
|
|
var globalSetting = _ref.globalSetting,
|
|
|
dispatch = _ref.dispatch,
|
|
|
virtualSpaces = _ref.virtualSpaces;
|
|
|
var _useState = (0,_react_17_0_2_react.useState)([]),
|
|
|
_useState2 = slicedToArray_default()(_useState, 2),
|
|
|
tableData = _useState2[0],
|
|
|
setTableData = _useState2[1];
|
|
|
var _useState3 = (0,_react_17_0_2_react.useState)(true),
|
|
|
_useState4 = slicedToArray_default()(_useState3, 2),
|
|
|
loading = _useState4[0],
|
|
|
setLoading = _useState4[1];
|
|
|
var virtualSpacesDetails = virtualSpaces.virtualSpacesDetails,
|
|
|
menus = virtualSpaces.menus;
|
|
|
var permission = (virtualSpacesDetails === null || virtualSpacesDetails === void 0 ? void 0 : virtualSpacesDetails.is_member) || (0,authority/* isSuperAdmins */.Ny)();
|
|
|
var _useState5 = (0,_react_17_0_2_react.useState)(parseInt(localStorage.getItem('isFilePieceFenbu') || "1")),
|
|
|
_useState6 = slicedToArray_default()(_useState5, 2),
|
|
|
isPieceFenbu = _useState6[0],
|
|
|
setIsPieceFenbu = _useState6[1];
|
|
|
// const moduleName = menus?.find((e: any) => e.module_url === location.pathname)?.name || '';
|
|
|
var moduleName = (menus === null || menus === void 0 || (_menus$find = menus.find(function (e) {
|
|
|
return e.id == window.localStorage.getItem('vtrsModuleId');
|
|
|
})) === null || _menus$find === void 0 ? void 0 : _menus$find.name) || '';
|
|
|
var _useState7 = (0,_react_17_0_2_react.useState)({
|
|
|
page: 1,
|
|
|
limit: 12
|
|
|
}),
|
|
|
_useState8 = slicedToArray_default()(_useState7, 2),
|
|
|
params = _useState8[0],
|
|
|
setParams = _useState8[1];
|
|
|
var _useState9 = (0,_react_17_0_2_react.useState)(0),
|
|
|
_useState10 = slicedToArray_default()(_useState9, 2),
|
|
|
total = _useState10[0],
|
|
|
setTotal = _useState10[1];
|
|
|
var dragged = (0,_react_17_0_2_react.useRef)(null);
|
|
|
var target = (0,_react_17_0_2_react.useRef)(null);
|
|
|
var _useState11 = (0,_react_17_0_2_react.useState)(false),
|
|
|
_useState12 = slicedToArray_default()(_useState11, 2),
|
|
|
visible = _useState12[0],
|
|
|
setVisible = _useState12[1];
|
|
|
var _useState13 = (0,_react_17_0_2_react.useState)({}),
|
|
|
_useState14 = slicedToArray_default()(_useState13, 2),
|
|
|
dialogData = _useState14[0],
|
|
|
setDialogData = _useState14[1];
|
|
|
var _useState15 = (0,_react_17_0_2_react.useState)(''),
|
|
|
_useState16 = slicedToArray_default()(_useState15, 2),
|
|
|
keydom = _useState16[0],
|
|
|
setKeydom = _useState16[1];
|
|
|
var query = (0,_umi_production_exports.useParams)();
|
|
|
var _useSearchParams = (0,_umi_production_exports.useSearchParams)(),
|
|
|
_useSearchParams2 = slicedToArray_default()(_useSearchParams, 1),
|
|
|
searchParams = _useSearchParams2[0];
|
|
|
(0,_react_17_0_2_react.useEffect)(function () {
|
|
|
getData();
|
|
|
}, [window.localStorage.getItem('vtrsModuleId')]);
|
|
|
var getData = /*#__PURE__*/function () {
|
|
|
var _ref2 = asyncToGenerator_default()( /*#__PURE__*/regeneratorRuntime_default()().mark(function _callee() {
|
|
|
var res, _res$data, _res$data2;
|
|
|
return regeneratorRuntime_default()().wrap(function _callee$(_context) {
|
|
|
while (1) switch (_context.prev = _context.next) {
|
|
|
case 0:
|
|
|
setLoading(true);
|
|
|
_context.next = 3;
|
|
|
return (0,fetch/* default */.ZP)("/api/virtual_classrooms/".concat(query.virtual_spacesId, "/digtal_lessons.json"), {
|
|
|
method: 'get',
|
|
|
params: objectSpread2_default()(objectSpread2_default()({}, params), {}, {
|
|
|
virtual_module_id: window.localStorage.getItem('vtrsModuleId')
|
|
|
})
|
|
|
});
|
|
|
case 3:
|
|
|
res = _context.sent;
|
|
|
if ((res === null || res === void 0 ? void 0 : res.status) == 0) {
|
|
|
setTotal(res === null || res === void 0 || (_res$data = res.data) === null || _res$data === void 0 ? void 0 : _res$data.count);
|
|
|
setTableData(res === null || res === void 0 || (_res$data2 = res.data) === null || _res$data2 === void 0 ? void 0 : _res$data2.list);
|
|
|
}
|
|
|
setLoading(false);
|
|
|
case 6:
|
|
|
case "end":
|
|
|
return _context.stop();
|
|
|
}
|
|
|
}, _callee);
|
|
|
}));
|
|
|
return function getData() {
|
|
|
return _ref2.apply(this, arguments);
|
|
|
};
|
|
|
}();
|
|
|
var handleChange = function handleChange(current) {
|
|
|
params.page = current;
|
|
|
setParams(objectSpread2_default()({}, params));
|
|
|
getData();
|
|
|
};
|
|
|
|
|
|
/**
|
|
|
* @function 规定当元素被拖动时,会发生什么
|
|
|
* */
|
|
|
var onDragStart = function onDragStart(e) {
|
|
|
dragged.current = e.target;
|
|
|
};
|
|
|
|
|
|
/**
|
|
|
* @function 元素被拖动到一个有效目标时触发的事件;第一个触发
|
|
|
* @description 元素被拖动到一个有效目标时,以下数据依次触发 dragenter,dragover,drop
|
|
|
* */
|
|
|
var onDragEnter = function onDragEnter(e) {
|
|
|
target.current = e.target;
|
|
|
};
|
|
|
|
|
|
/**
|
|
|
* @function 元素被拖动到一个有效目标时触发的事件;第二个触发
|
|
|
* @description
|
|
|
* 默认地,无法将数据/元素放置到其他元素中。如果需要设置允许放置,
|
|
|
* 我们必须阻止对元素的默认处理方式。
|
|
|
* 这要通过调用 ondragover 事件的 event.preventDefault() 方法
|
|
|
* */
|
|
|
var onDragOver = function onDragOver(e) {
|
|
|
e.preventDefault();
|
|
|
};
|
|
|
|
|
|
/**
|
|
|
* @function 元素被拖动到一个有效目标时触发的事件;第三个(最后)触发
|
|
|
* @description 元素被拖动到一个有效目标时,以下数据依次触发 dragenter,dragover,drop
|
|
|
* */
|
|
|
var onDrop = /*#__PURE__*/function () {
|
|
|
var _ref3 = asyncToGenerator_default()( /*#__PURE__*/regeneratorRuntime_default()().mark(function _callee2(e) {
|
|
|
var res;
|
|
|
return regeneratorRuntime_default()().wrap(function _callee2$(_context2) {
|
|
|
while (1) switch (_context2.prev = _context2.next) {
|
|
|
case 0:
|
|
|
e.preventDefault();
|
|
|
// const from = dragged.current.dataset.id; // 拖动元素id
|
|
|
// const to = target.current.dataset.id; // 放置目标id
|
|
|
if (!((0,authority/* isSuperAdmins */.Ny)() || virtualSpacesDetails !== null && virtualSpacesDetails !== void 0 && virtualSpacesDetails.is_member)) {
|
|
|
_context2.next = 6;
|
|
|
break;
|
|
|
}
|
|
|
_context2.next = 4;
|
|
|
return (0,fetch/* default */.ZP)("/api/virtual_classrooms/".concat(query.virtual_spacesId, "/digtal_lessons/").concat(dragged.current.dataset.id, "/sort.json"), {
|
|
|
method: 'put',
|
|
|
body: {
|
|
|
position: target.current.dataset.position
|
|
|
}
|
|
|
});
|
|
|
case 4:
|
|
|
res = _context2.sent;
|
|
|
if ((res === null || res === void 0 ? void 0 : res.status) == 0) {
|
|
|
message/* default */.ZP.success('排序成功');
|
|
|
getData();
|
|
|
}
|
|
|
case 6:
|
|
|
case "end":
|
|
|
return _context2.stop();
|
|
|
}
|
|
|
}, _callee2);
|
|
|
}));
|
|
|
return function onDrop(_x) {
|
|
|
return _ref3.apply(this, arguments);
|
|
|
};
|
|
|
}();
|
|
|
var handleOk = /*#__PURE__*/function () {
|
|
|
var _ref4 = asyncToGenerator_default()( /*#__PURE__*/regeneratorRuntime_default()().mark(function _callee3(values) {
|
|
|
var res, _res;
|
|
|
return regeneratorRuntime_default()().wrap(function _callee3$(_context3) {
|
|
|
while (1) switch (_context3.prev = _context3.next) {
|
|
|
case 0:
|
|
|
if (!(dialogData !== null && dialogData !== void 0 && dialogData.id)) {
|
|
|
_context3.next = 7;
|
|
|
break;
|
|
|
}
|
|
|
_context3.next = 3;
|
|
|
return (0,fetch/* default */.ZP)("/api/virtual_classrooms/".concat(query.virtual_spacesId, "/digtal_lessons/").concat(dialogData === null || dialogData === void 0 ? void 0 : dialogData.id, ".json"), {
|
|
|
method: 'put',
|
|
|
body: objectSpread2_default()({
|
|
|
virtual_module_id: window.localStorage.getItem('vtrsModuleId')
|
|
|
}, values)
|
|
|
});
|
|
|
case 3:
|
|
|
res = _context3.sent;
|
|
|
if ((res === null || res === void 0 ? void 0 : res.status) == 0) {
|
|
|
getData();
|
|
|
message/* default */.ZP.success('编辑成功');
|
|
|
setVisible(false);
|
|
|
}
|
|
|
_context3.next = 11;
|
|
|
break;
|
|
|
case 7:
|
|
|
_context3.next = 9;
|
|
|
return (0,fetch/* default */.ZP)("/api/virtual_classrooms/".concat(query.virtual_spacesId, "/digtal_lessons.json"), {
|
|
|
method: 'post',
|
|
|
body: objectSpread2_default()({
|
|
|
virtual_module_id: window.localStorage.getItem('vtrsModuleId')
|
|
|
}, values)
|
|
|
});
|
|
|
case 9:
|
|
|
_res = _context3.sent;
|
|
|
if ((_res === null || _res === void 0 ? void 0 : _res.status) == 0) {
|
|
|
getData();
|
|
|
message/* default */.ZP.success('新增成功');
|
|
|
setVisible(false);
|
|
|
}
|
|
|
case 11:
|
|
|
case "end":
|
|
|
return _context3.stop();
|
|
|
}
|
|
|
}, _callee3);
|
|
|
}));
|
|
|
return function handleOk(_x2) {
|
|
|
return _ref4.apply(this, arguments);
|
|
|
};
|
|
|
}();
|
|
|
var deleteData = function deleteData(id) {
|
|
|
modal/* default */.Z.confirm({
|
|
|
centered: true,
|
|
|
okText: '确定',
|
|
|
cancelText: '取消',
|
|
|
title: '提示',
|
|
|
content: '是否确认删除该课堂?',
|
|
|
onOk: function onOk() {
|
|
|
return asyncToGenerator_default()( /*#__PURE__*/regeneratorRuntime_default()().mark(function _callee4() {
|
|
|
var res;
|
|
|
return regeneratorRuntime_default()().wrap(function _callee4$(_context4) {
|
|
|
while (1) switch (_context4.prev = _context4.next) {
|
|
|
case 0:
|
|
|
_context4.next = 2;
|
|
|
return (0,fetch/* default */.ZP)("/api/virtual_classrooms/".concat(query.virtual_spacesId, "/digtal_lessons/").concat(id, ".json"), {
|
|
|
method: 'delete',
|
|
|
body: {
|
|
|
virtual_module_id: window.localStorage.getItem('vtrsModuleId')
|
|
|
}
|
|
|
});
|
|
|
case 2:
|
|
|
res = _context4.sent;
|
|
|
if (res.status === 0) {
|
|
|
message/* default */.ZP.success("删除成功");
|
|
|
params.page = 1;
|
|
|
setParams(objectSpread2_default()({}, params));
|
|
|
getData();
|
|
|
}
|
|
|
case 4:
|
|
|
case "end":
|
|
|
return _context4.stop();
|
|
|
}
|
|
|
}, _callee4);
|
|
|
}))();
|
|
|
}
|
|
|
});
|
|
|
};
|
|
|
return /*#__PURE__*/(0,jsx_runtime.jsxs)("section", {
|
|
|
className: DigitalTopicsmodules.wrap,
|
|
|
children: [/*#__PURE__*/(0,jsx_runtime.jsx)(ui_customization/* CustomTabs */.YG, {
|
|
|
value: 'all',
|
|
|
onChange: function onChange() {},
|
|
|
tabBarExtraContent: /*#__PURE__*/(0,jsx_runtime.jsxs)(row/* default */.Z, {
|
|
|
align: "middle",
|
|
|
children: [/*#__PURE__*/(0,jsx_runtime.jsx)(col/* default */.Z, {
|
|
|
className: "mr20",
|
|
|
children: /*#__PURE__*/(0,jsx_runtime.jsx)("i", {
|
|
|
className: "iconfont ".concat(isPieceFenbu != 1 ? "icon-fenbu-2" : "icon-fenbu"),
|
|
|
onClick: function onClick() {
|
|
|
setIsPieceFenbu(isPieceFenbu != 1 ? 1 : 2);
|
|
|
localStorage.setItem('isFilePieceFenbu', "".concat(isPieceFenbu != 1 ? 1 : 2));
|
|
|
}
|
|
|
})
|
|
|
}), permission && /*#__PURE__*/(0,jsx_runtime.jsx)(ui_customization/* CustomButton */.op, {
|
|
|
onClick: function onClick() {
|
|
|
setVisible(true);
|
|
|
setDialogData({});
|
|
|
setKeydom(new Date());
|
|
|
},
|
|
|
children: "\u6DFB\u52A0"
|
|
|
})]
|
|
|
}),
|
|
|
dataSource: [{
|
|
|
id: 'all',
|
|
|
name: moduleName,
|
|
|
total: total
|
|
|
}]
|
|
|
}), /*#__PURE__*/(0,jsx_runtime.jsxs)(spin/* default */.Z, {
|
|
|
spinning: loading,
|
|
|
children: [!(tableData !== null && tableData !== void 0 && tableData.length) && /*#__PURE__*/(0,jsx_runtime.jsx)(NoData/* default */.Z, {}), !!(tableData !== null && tableData !== void 0 && tableData.length) && /*#__PURE__*/(0,jsx_runtime.jsx)(jsx_runtime.Fragment, {
|
|
|
children: isPieceFenbu != 1 ? /*#__PURE__*/(0,jsx_runtime.jsx)(jsx_runtime.Fragment, {
|
|
|
children: /*#__PURE__*/(0,jsx_runtime.jsx)("div", {
|
|
|
className: DigitalTopicsmodules.dataDiv,
|
|
|
children: tableData === null || tableData === void 0 ? void 0 : tableData.map(function (item, index) {
|
|
|
return /*#__PURE__*/(0,jsx_runtime.jsxs)("div", {
|
|
|
className: DigitalTopicsmodules.item_data,
|
|
|
draggable: "true",
|
|
|
onDragStart: onDragStart,
|
|
|
onDragEnter: onDragEnter,
|
|
|
onDragOver: onDragOver,
|
|
|
onDrop: onDrop,
|
|
|
"data-id": item === null || item === void 0 ? void 0 : item.id,
|
|
|
"data-position": item === null || item === void 0 ? void 0 : item.position,
|
|
|
children: [/*#__PURE__*/(0,jsx_runtime.jsx)(tooltip/* default */.Z, {
|
|
|
title: item === null || item === void 0 ? void 0 : item.name,
|
|
|
children: /*#__PURE__*/(0,jsx_runtime.jsx)("span", {
|
|
|
"data-id": item === null || item === void 0 ? void 0 : item.id,
|
|
|
"data-position": item === null || item === void 0 ? void 0 : item.position,
|
|
|
className: DigitalTopicsmodules.item_data_content,
|
|
|
onClick: function onClick() {
|
|
|
window.open(item === null || item === void 0 ? void 0 : item.lesson_url);
|
|
|
},
|
|
|
children: item === null || item === void 0 ? void 0 : item.name
|
|
|
})
|
|
|
}), /*#__PURE__*/(0,jsx_runtime.jsx)("span", {
|
|
|
"data-id": item === null || item === void 0 ? void 0 : item.id,
|
|
|
"data-position": item === null || item === void 0 ? void 0 : item.position,
|
|
|
className: DigitalTopicsmodules.item_data_button,
|
|
|
onClick: function onClick() {
|
|
|
window.open(item === null || item === void 0 ? void 0 : item.lesson_url);
|
|
|
},
|
|
|
children: "\u67E5\u770B"
|
|
|
}), ((0,authority/* isSuperAdmins */.Ny)() || (virtualSpacesDetails === null || virtualSpacesDetails === void 0 ? void 0 : virtualSpacesDetails.is_member)) && /*#__PURE__*/(0,jsx_runtime.jsx)("span", {
|
|
|
"data-id": item === null || item === void 0 ? void 0 : item.id,
|
|
|
"data-position": item === null || item === void 0 ? void 0 : item.position,
|
|
|
className: DigitalTopicsmodules.item_data_button,
|
|
|
onClick: function onClick() {
|
|
|
setVisible(true);
|
|
|
setDialogData(item);
|
|
|
setKeydom(new Date());
|
|
|
},
|
|
|
children: "\u7F16\u8F91"
|
|
|
}), ((0,authority/* isSuperAdmins */.Ny)() || (virtualSpacesDetails === null || virtualSpacesDetails === void 0 ? void 0 : virtualSpacesDetails.is_creator)) && /*#__PURE__*/(0,jsx_runtime.jsx)("span", {
|
|
|
"data-id": item === null || item === void 0 ? void 0 : item.id,
|
|
|
"data-position": item === null || item === void 0 ? void 0 : item.position,
|
|
|
className: DigitalTopicsmodules.item_data_button,
|
|
|
onClick: function onClick() {
|
|
|
deleteData(item === null || item === void 0 ? void 0 : item.id);
|
|
|
},
|
|
|
children: "\u5220\u9664"
|
|
|
})]
|
|
|
}, index);
|
|
|
})
|
|
|
})
|
|
|
}) : /*#__PURE__*/(0,jsx_runtime.jsx)(jsx_runtime.Fragment, {
|
|
|
children: /*#__PURE__*/(0,jsx_runtime.jsx)("div", {
|
|
|
className: DigitalTopicsmodules.FileListDiv,
|
|
|
children: tableData === null || tableData === void 0 ? void 0 : tableData.map(function (item) {
|
|
|
var _item$cover;
|
|
|
return /*#__PURE__*/(0,jsx_runtime.jsxs)(row/* default */.Z, {
|
|
|
draggable: "true",
|
|
|
onDragStart: onDragStart,
|
|
|
onDragOver: onDragOver,
|
|
|
onDrop: onDrop,
|
|
|
"data-id": item === null || item === void 0 ? void 0 : item.id,
|
|
|
"data-position": item === null || item === void 0 ? void 0 : item.position,
|
|
|
onDragEnter: onDragEnter,
|
|
|
onClick: function onClick() {
|
|
|
window.open(item === null || item === void 0 ? void 0 : item.lesson_url);
|
|
|
},
|
|
|
className: DigitalTopicsmodules.FileItem,
|
|
|
align: "middle",
|
|
|
justify: "space-between",
|
|
|
children: [/*#__PURE__*/(0,jsx_runtime.jsx)(col/* default */.Z, {
|
|
|
children: /*#__PURE__*/(0,jsx_runtime.jsx)("img", {
|
|
|
width: 282,
|
|
|
height: 170,
|
|
|
src: env/* default */.Z.IMG_SERVER + (item === null || item === void 0 || (_item$cover = item.cover) === null || _item$cover === void 0 ? void 0 : _item$cover.url),
|
|
|
"data-id": item === null || item === void 0 ? void 0 : item.id,
|
|
|
"data-position": item === null || item === void 0 ? void 0 : item.position
|
|
|
})
|
|
|
}), /*#__PURE__*/(0,jsx_runtime.jsx)(tooltip/* default */.Z, {
|
|
|
title: item === null || item === void 0 ? void 0 : item.name,
|
|
|
children: /*#__PURE__*/(0,jsx_runtime.jsx)(col/* default */.Z, {
|
|
|
className: "font16 ".concat(DigitalTopicsmodules.file_name),
|
|
|
"data-id": item === null || item === void 0 ? void 0 : item.id,
|
|
|
"data-position": item === null || item === void 0 ? void 0 : item.position,
|
|
|
children: item === null || item === void 0 ? void 0 : item.name
|
|
|
})
|
|
|
}), ((0,authority/* isSuperAdmins */.Ny)() || (virtualSpacesDetails === null || virtualSpacesDetails === void 0 ? void 0 : virtualSpacesDetails.is_member)) && /*#__PURE__*/(0,jsx_runtime.jsxs)(jsx_runtime.Fragment, {
|
|
|
children: [/*#__PURE__*/(0,jsx_runtime.jsx)("div", {
|
|
|
style: {
|
|
|
height: 40
|
|
|
},
|
|
|
"data-id": item === null || item === void 0 ? void 0 : item.id,
|
|
|
"data-position": item === null || item === void 0 ? void 0 : item.position
|
|
|
}), /*#__PURE__*/(0,jsx_runtime.jsxs)(row/* default */.Z, {
|
|
|
style: {
|
|
|
height: 40,
|
|
|
width: "100%",
|
|
|
position: "absolute",
|
|
|
bottom: 0,
|
|
|
left: 0
|
|
|
},
|
|
|
children: [/*#__PURE__*/(0,jsx_runtime.jsxs)(row/* default */.Z, {
|
|
|
className: DigitalTopicsmodules.FileItemUse,
|
|
|
"data-id": item === null || item === void 0 ? void 0 : item.id,
|
|
|
"data-position": item === null || item === void 0 ? void 0 : item.position,
|
|
|
onClick: function onClick(e) {
|
|
|
e.stopPropagation();
|
|
|
e.preventDefault();
|
|
|
},
|
|
|
children: [" ", /*#__PURE__*/(0,jsx_runtime.jsxs)("span", {
|
|
|
className: "primary-hover",
|
|
|
onClick: function onClick() {
|
|
|
setVisible(true);
|
|
|
setDialogData(item);
|
|
|
setKeydom(new Date());
|
|
|
},
|
|
|
children: [/*#__PURE__*/(0,jsx_runtime.jsx)("i", {
|
|
|
className: "iconfont icon-bianji7 font14 mr5"
|
|
|
}), "\u7F16\u8F91"]
|
|
|
})]
|
|
|
}), ((0,authority/* isSuperAdmins */.Ny)() || (virtualSpacesDetails === null || virtualSpacesDetails === void 0 ? void 0 : virtualSpacesDetails.is_creator)) && /*#__PURE__*/(0,jsx_runtime.jsx)(row/* default */.Z, {
|
|
|
className: DigitalTopicsmodules.FileItemUse,
|
|
|
"data-id": item === null || item === void 0 ? void 0 : item.id,
|
|
|
"data-position": item === null || item === void 0 ? void 0 : item.position,
|
|
|
onClick: function onClick(e) {
|
|
|
e.stopPropagation();
|
|
|
e.preventDefault();
|
|
|
},
|
|
|
children: /*#__PURE__*/(0,jsx_runtime.jsxs)("span", {
|
|
|
className: "delete-hover",
|
|
|
onClick: function onClick() {
|
|
|
deleteData(item === null || item === void 0 ? void 0 : item.id);
|
|
|
},
|
|
|
children: [/*#__PURE__*/(0,jsx_runtime.jsx)("i", {
|
|
|
className: "iconfont icon-piliangshanchubeifen font14 mr5"
|
|
|
}), "\u5220\u9664"]
|
|
|
})
|
|
|
})]
|
|
|
})]
|
|
|
})]
|
|
|
}, item === null || item === void 0 ? void 0 : item.id);
|
|
|
})
|
|
|
})
|
|
|
})
|
|
|
}), !!(tableData !== null && tableData !== void 0 && tableData.length) && /*#__PURE__*/(0,jsx_runtime.jsxs)("div", {
|
|
|
className: DigitalTopicsmodules.footer,
|
|
|
children: [total > (params === null || params === void 0 ? void 0 : params.limit) ? /*#__PURE__*/(0,jsx_runtime.jsx)("div", {
|
|
|
children: /*#__PURE__*/(0,jsx_runtime.jsxs)("span", {
|
|
|
style: {
|
|
|
color: '#656F87'
|
|
|
},
|
|
|
children: ["\u5171", /*#__PURE__*/(0,jsx_runtime.jsx)("span", {
|
|
|
className: "c-light-primary",
|
|
|
children: total
|
|
|
}), "\u6761\u6570\u636E"]
|
|
|
})
|
|
|
}) : '', /*#__PURE__*/(0,jsx_runtime.jsx)(pagination/* default */.Z, {
|
|
|
defaultCurrent: 1,
|
|
|
defaultPageSize: 12,
|
|
|
current: (params === null || params === void 0 ? void 0 : params.page) || 1,
|
|
|
showSizeChanger: false,
|
|
|
showQuickJumper: true,
|
|
|
hideOnSinglePage: true,
|
|
|
total: total,
|
|
|
onChange: handleChange
|
|
|
})]
|
|
|
})]
|
|
|
}), /*#__PURE__*/(0,jsx_runtime.jsx)(DigitalTopics_AddOrEdit, {
|
|
|
visible: visible,
|
|
|
dialogData: dialogData,
|
|
|
keydom: keydom,
|
|
|
title: "\u6570\u5B57\u8BFE\u5802",
|
|
|
onCancel: function onCancel() {
|
|
|
return setVisible(false);
|
|
|
},
|
|
|
onOk: handleOk
|
|
|
})]
|
|
|
});
|
|
|
};
|
|
|
/* harmony default export */ var DigitalTopics = ((0,_umi_production_exports.connect)(function (_ref5) {
|
|
|
var virtualSpaces = _ref5.virtualSpaces,
|
|
|
globalSetting = _ref5.globalSetting;
|
|
|
return {
|
|
|
globalSetting: globalSetting,
|
|
|
virtualSpaces: virtualSpaces
|
|
|
};
|
|
|
})(Page));
|
|
|
|
|
|
/***/ }),
|
|
|
|
|
|
/***/ 79274:
|
|
|
/*!************************************************************!*\
|
|
|
!*** ./src/components/ui-customization/reset.less?modules ***!
|
|
|
\************************************************************/
|
|
|
/***/ (function(__unused_webpack_module, __webpack_exports__) {
|
|
|
|
|
|
// extracted by mini-css-extract-plugin
|
|
|
/* harmony default export */ __webpack_exports__.Z = ({"flex_box_center":"flex_box_center___vG4eV","flex_space_between":"flex_space_between___qVVxe","flex_box_vertical_center":"flex_box_vertical_center___P8Z8s","flex_box_center_end":"flex_box_center_end___VMme3","flex_box_column":"flex_box_column___VMHwm","dropdownmenus":"dropdownmenus___oVzoj","popupClassNames":"popupClassNames___OcZq7","selectdown":"selectdown___mmcA8"});
|
|
|
|
|
|
/***/ }),
|
|
|
|
|
|
/***/ 38854:
|
|
|
/*!************************************************************************!*\
|
|
|
!*** ./node_modules/_antd@5.9.0@antd/es/dropdown/index.js + 1 modules ***!
|
|
|
\************************************************************************/
|
|
|
/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
|
|
|
|
|
|
|
|
|
// EXPORTS
|
|
|
__webpack_require__.d(__webpack_exports__, {
|
|
|
Z: function() { return /* binding */ es_dropdown; }
|
|
|
});
|
|
|
|
|
|
// EXTERNAL MODULE: ./node_modules/_antd@5.9.0@antd/es/dropdown/dropdown.js
|
|
|
var dropdown = __webpack_require__(91857);
|
|
|
// EXTERNAL MODULE: ./node_modules/_classnames@2.5.1@classnames/index.js
|
|
|
var _classnames_2_5_1_classnames = __webpack_require__(92310);
|
|
|
var _classnames_2_5_1_classnames_default = /*#__PURE__*/__webpack_require__.n(_classnames_2_5_1_classnames);
|
|
|
// EXTERNAL MODULE: ./node_modules/_react@17.0.2@react/index.js
|
|
|
var _react_17_0_2_react = __webpack_require__(59301);
|
|
|
// EXTERNAL MODULE: ./node_modules/_@ant-design_icons@5.3.5@@ant-design/icons/es/icons/EllipsisOutlined.js + 1 modules
|
|
|
var EllipsisOutlined = __webpack_require__(40090);
|
|
|
// EXTERNAL MODULE: ./node_modules/_antd@5.9.0@antd/es/button/index.js
|
|
|
var es_button = __webpack_require__(3113);
|
|
|
// EXTERNAL MODULE: ./node_modules/_antd@5.9.0@antd/es/config-provider/context.js
|
|
|
var context = __webpack_require__(36355);
|
|
|
// EXTERNAL MODULE: ./node_modules/_antd@5.9.0@antd/es/space/index.js + 3 modules
|
|
|
var space = __webpack_require__(81327);
|
|
|
// EXTERNAL MODULE: ./node_modules/_antd@5.9.0@antd/es/space/Compact.js
|
|
|
var Compact = __webpack_require__(33234);
|
|
|
// EXTERNAL MODULE: ./node_modules/_antd@5.9.0@antd/es/dropdown/style/index.js + 1 modules
|
|
|
var style = __webpack_require__(47211);
|
|
|
;// CONCATENATED MODULE: ./node_modules/_antd@5.9.0@antd/es/dropdown/dropdown-button.js
|
|
|
"use client";
|
|
|
|
|
|
var __rest = undefined && undefined.__rest || function (s, e) {
|
|
|
var t = {};
|
|
|
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0) t[p] = s[p];
|
|
|
if (s != null && typeof Object.getOwnPropertySymbols === "function") for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
|
|
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i])) t[p[i]] = s[p[i]];
|
|
|
}
|
|
|
return t;
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
const DropdownButton = props => {
|
|
|
const {
|
|
|
getPopupContainer: getContextPopupContainer,
|
|
|
getPrefixCls,
|
|
|
direction
|
|
|
} = _react_17_0_2_react.useContext(context/* ConfigContext */.E_);
|
|
|
const {
|
|
|
prefixCls: customizePrefixCls,
|
|
|
type = 'default',
|
|
|
danger,
|
|
|
disabled,
|
|
|
loading,
|
|
|
onClick,
|
|
|
htmlType,
|
|
|
children,
|
|
|
className,
|
|
|
menu,
|
|
|
arrow,
|
|
|
autoFocus,
|
|
|
overlay,
|
|
|
trigger,
|
|
|
align,
|
|
|
open,
|
|
|
onOpenChange,
|
|
|
placement,
|
|
|
getPopupContainer,
|
|
|
href,
|
|
|
icon = /*#__PURE__*/_react_17_0_2_react.createElement(EllipsisOutlined/* default */.Z, null),
|
|
|
title,
|
|
|
buttonsRender = buttons => buttons,
|
|
|
mouseEnterDelay,
|
|
|
mouseLeaveDelay,
|
|
|
overlayClassName,
|
|
|
overlayStyle,
|
|
|
destroyPopupOnHide,
|
|
|
dropdownRender
|
|
|
} = props,
|
|
|
restProps = __rest(props, ["prefixCls", "type", "danger", "disabled", "loading", "onClick", "htmlType", "children", "className", "menu", "arrow", "autoFocus", "overlay", "trigger", "align", "open", "onOpenChange", "placement", "getPopupContainer", "href", "icon", "title", "buttonsRender", "mouseEnterDelay", "mouseLeaveDelay", "overlayClassName", "overlayStyle", "destroyPopupOnHide", "dropdownRender"]);
|
|
|
const prefixCls = getPrefixCls('dropdown', customizePrefixCls);
|
|
|
const buttonPrefixCls = `${prefixCls}-button`;
|
|
|
const [wrapSSR, hashId] = (0,style/* default */.Z)(prefixCls);
|
|
|
const dropdownProps = {
|
|
|
menu,
|
|
|
arrow,
|
|
|
autoFocus,
|
|
|
align,
|
|
|
disabled,
|
|
|
trigger: disabled ? [] : trigger,
|
|
|
onOpenChange,
|
|
|
getPopupContainer: getPopupContainer || getContextPopupContainer,
|
|
|
mouseEnterDelay,
|
|
|
mouseLeaveDelay,
|
|
|
overlayClassName,
|
|
|
overlayStyle,
|
|
|
destroyPopupOnHide,
|
|
|
dropdownRender
|
|
|
};
|
|
|
const {
|
|
|
compactSize,
|
|
|
compactItemClassnames
|
|
|
} = (0,Compact/* useCompactItemContext */.ri)(prefixCls, direction);
|
|
|
const classes = _classnames_2_5_1_classnames_default()(buttonPrefixCls, compactItemClassnames, className, hashId);
|
|
|
if ('overlay' in props) {
|
|
|
dropdownProps.overlay = overlay;
|
|
|
}
|
|
|
if ('open' in props) {
|
|
|
dropdownProps.open = open;
|
|
|
}
|
|
|
if ('placement' in props) {
|
|
|
dropdownProps.placement = placement;
|
|
|
} else {
|
|
|
dropdownProps.placement = direction === 'rtl' ? 'bottomLeft' : 'bottomRight';
|
|
|
}
|
|
|
const leftButton = /*#__PURE__*/_react_17_0_2_react.createElement(es_button/* default */.ZP, {
|
|
|
type: type,
|
|
|
danger: danger,
|
|
|
disabled: disabled,
|
|
|
loading: loading,
|
|
|
onClick: onClick,
|
|
|
htmlType: htmlType,
|
|
|
href: href,
|
|
|
title: title
|
|
|
}, children);
|
|
|
const rightButton = /*#__PURE__*/_react_17_0_2_react.createElement(es_button/* default */.ZP, {
|
|
|
type: type,
|
|
|
danger: danger,
|
|
|
icon: icon
|
|
|
});
|
|
|
const [leftButtonToRender, rightButtonToRender] = buttonsRender([leftButton, rightButton]);
|
|
|
return wrapSSR( /*#__PURE__*/_react_17_0_2_react.createElement(space/* default */.Z.Compact, Object.assign({
|
|
|
className: classes,
|
|
|
size: compactSize,
|
|
|
block: true
|
|
|
}, restProps), leftButtonToRender, /*#__PURE__*/_react_17_0_2_react.createElement(dropdown/* default */.Z, Object.assign({}, dropdownProps), rightButtonToRender)));
|
|
|
};
|
|
|
DropdownButton.__ANT_BUTTON = true;
|
|
|
/* harmony default export */ var dropdown_button = (DropdownButton);
|
|
|
;// CONCATENATED MODULE: ./node_modules/_antd@5.9.0@antd/es/dropdown/index.js
|
|
|
"use client";
|
|
|
|
|
|
|
|
|
|
|
|
const Dropdown = dropdown/* default */.Z;
|
|
|
Dropdown.Button = dropdown_button;
|
|
|
/* harmony default export */ var es_dropdown = (Dropdown);
|
|
|
|
|
|
/***/ }),
|
|
|
|
|
|
/***/ 81327:
|
|
|
/*!*********************************************************************!*\
|
|
|
!*** ./node_modules/_antd@5.9.0@antd/es/space/index.js + 3 modules ***!
|
|
|
\*********************************************************************/
|
|
|
/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
|
|
|
|
|
|
|
|
|
// EXPORTS
|
|
|
__webpack_require__.d(__webpack_exports__, {
|
|
|
Z: function() { return /* binding */ space; }
|
|
|
});
|
|
|
|
|
|
// UNUSED EXPORTS: SpaceContext
|
|
|
|
|
|
// EXTERNAL MODULE: ./node_modules/_react@17.0.2@react/index.js
|
|
|
var _react_17_0_2_react = __webpack_require__(59301);
|
|
|
// EXTERNAL MODULE: ./node_modules/_classnames@2.5.1@classnames/index.js
|
|
|
var _classnames_2_5_1_classnames = __webpack_require__(92310);
|
|
|
var _classnames_2_5_1_classnames_default = /*#__PURE__*/__webpack_require__.n(_classnames_2_5_1_classnames);
|
|
|
// EXTERNAL MODULE: ./node_modules/_rc-util@5.39.1@rc-util/es/Children/toArray.js
|
|
|
var toArray = __webpack_require__(47783);
|
|
|
// EXTERNAL MODULE: ./node_modules/_antd@5.9.0@antd/es/config-provider/context.js
|
|
|
var context = __webpack_require__(36355);
|
|
|
// EXTERNAL MODULE: ./node_modules/_antd@5.9.0@antd/es/space/Compact.js
|
|
|
var Compact = __webpack_require__(33234);
|
|
|
;// CONCATENATED MODULE: ./node_modules/_antd@5.9.0@antd/es/space/context.js
|
|
|
|
|
|
const SpaceContext = /*#__PURE__*/_react_17_0_2_react.createContext({
|
|
|
latestIndex: 0
|
|
|
});
|
|
|
const SpaceContextProvider = SpaceContext.Provider;
|
|
|
;// CONCATENATED MODULE: ./node_modules/_antd@5.9.0@antd/es/space/Item.js
|
|
|
"use client";
|
|
|
|
|
|
|
|
|
|
|
|
const Item = _ref => {
|
|
|
let {
|
|
|
className,
|
|
|
index,
|
|
|
children,
|
|
|
split,
|
|
|
style
|
|
|
} = _ref;
|
|
|
const {
|
|
|
latestIndex
|
|
|
} = _react_17_0_2_react.useContext(SpaceContext);
|
|
|
if (children === null || children === undefined) {
|
|
|
return null;
|
|
|
}
|
|
|
return /*#__PURE__*/_react_17_0_2_react.createElement(_react_17_0_2_react.Fragment, null, /*#__PURE__*/_react_17_0_2_react.createElement("div", {
|
|
|
className: className,
|
|
|
style: style
|
|
|
}, children), index < latestIndex && split && /*#__PURE__*/_react_17_0_2_react.createElement("span", {
|
|
|
className: `${className}-split`
|
|
|
}, split));
|
|
|
};
|
|
|
/* harmony default export */ var space_Item = (Item);
|
|
|
// EXTERNAL MODULE: ./node_modules/_antd@5.9.0@antd/es/space/style/index.js + 1 modules
|
|
|
var space_style = __webpack_require__(2856);
|
|
|
;// CONCATENATED MODULE: ./node_modules/_antd@5.9.0@antd/es/space/utils.js
|
|
|
function isPresetSize(size) {
|
|
|
return ['small', 'middle', 'large'].includes(size);
|
|
|
}
|
|
|
function isValidGapNumber(size) {
|
|
|
if (!size) {
|
|
|
// The case of size = 0 is deliberately excluded here, because the default value of the gap attribute in CSS is 0, so if the user passes 0 in, we can directly ignore it.
|
|
|
return false;
|
|
|
}
|
|
|
return typeof size === 'number' && !Number.isNaN(size);
|
|
|
}
|
|
|
;// CONCATENATED MODULE: ./node_modules/_antd@5.9.0@antd/es/space/index.js
|
|
|
"use client";
|
|
|
|
|
|
var __rest = undefined && undefined.__rest || function (s, e) {
|
|
|
var t = {};
|
|
|
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0) t[p] = s[p];
|
|
|
if (s != null && typeof Object.getOwnPropertySymbols === "function") for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
|
|
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i])) t[p[i]] = s[p[i]];
|
|
|
}
|
|
|
return t;
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
const Space = /*#__PURE__*/_react_17_0_2_react.forwardRef((props, ref) => {
|
|
|
var _a, _b;
|
|
|
const {
|
|
|
getPrefixCls,
|
|
|
space,
|
|
|
direction: directionConfig
|
|
|
} = _react_17_0_2_react.useContext(context/* ConfigContext */.E_);
|
|
|
const {
|
|
|
size = (space === null || space === void 0 ? void 0 : space.size) || 'small',
|
|
|
align,
|
|
|
className,
|
|
|
rootClassName,
|
|
|
children,
|
|
|
direction = 'horizontal',
|
|
|
prefixCls: customizePrefixCls,
|
|
|
split,
|
|
|
style,
|
|
|
wrap = false,
|
|
|
classNames: customClassNames,
|
|
|
styles
|
|
|
} = props,
|
|
|
otherProps = __rest(props, ["size", "align", "className", "rootClassName", "children", "direction", "prefixCls", "split", "style", "wrap", "classNames", "styles"]);
|
|
|
const [horizontalSize, verticalSize] = Array.isArray(size) ? size : [size, size];
|
|
|
const isPresetVerticalSize = isPresetSize(verticalSize);
|
|
|
const isPresetHorizontalSize = isPresetSize(horizontalSize);
|
|
|
const isValidVerticalSize = isValidGapNumber(verticalSize);
|
|
|
const isValidHorizontalSize = isValidGapNumber(horizontalSize);
|
|
|
const childNodes = (0,toArray/* default */.Z)(children, {
|
|
|
keepEmpty: true
|
|
|
});
|
|
|
const mergedAlign = align === undefined && direction === 'horizontal' ? 'center' : align;
|
|
|
const prefixCls = getPrefixCls('space', customizePrefixCls);
|
|
|
const [wrapSSR, hashId] = (0,space_style/* default */.Z)(prefixCls);
|
|
|
const cls = _classnames_2_5_1_classnames_default()(prefixCls, space === null || space === void 0 ? void 0 : space.className, hashId, `${prefixCls}-${direction}`, {
|
|
|
[`${prefixCls}-rtl`]: directionConfig === 'rtl',
|
|
|
[`${prefixCls}-align-${mergedAlign}`]: mergedAlign,
|
|
|
[`${prefixCls}-gap-row-${verticalSize}`]: isPresetVerticalSize,
|
|
|
[`${prefixCls}-gap-col-${horizontalSize}`]: isPresetHorizontalSize
|
|
|
}, className, rootClassName);
|
|
|
const itemClassName = _classnames_2_5_1_classnames_default()(`${prefixCls}-item`, (_a = customClassNames === null || customClassNames === void 0 ? void 0 : customClassNames.item) !== null && _a !== void 0 ? _a : (_b = space === null || space === void 0 ? void 0 : space.classNames) === null || _b === void 0 ? void 0 : _b.item);
|
|
|
// Calculate latest one
|
|
|
let latestIndex = 0;
|
|
|
const nodes = childNodes.map((child, i) => {
|
|
|
var _a, _b;
|
|
|
if (child !== null && child !== undefined) {
|
|
|
latestIndex = i;
|
|
|
}
|
|
|
const key = child && child.key || `${itemClassName}-${i}`;
|
|
|
return /*#__PURE__*/_react_17_0_2_react.createElement(space_Item, {
|
|
|
className: itemClassName,
|
|
|
key: key,
|
|
|
index: i,
|
|
|
split: split,
|
|
|
style: (_a = styles === null || styles === void 0 ? void 0 : styles.item) !== null && _a !== void 0 ? _a : (_b = space === null || space === void 0 ? void 0 : space.styles) === null || _b === void 0 ? void 0 : _b.item
|
|
|
}, child);
|
|
|
});
|
|
|
const spaceContext = _react_17_0_2_react.useMemo(() => ({
|
|
|
latestIndex
|
|
|
}), [latestIndex]);
|
|
|
// =========================== Render ===========================
|
|
|
if (childNodes.length === 0) {
|
|
|
return null;
|
|
|
}
|
|
|
const gapStyle = {};
|
|
|
if (wrap) {
|
|
|
gapStyle.flexWrap = 'wrap';
|
|
|
}
|
|
|
if (!isPresetHorizontalSize && isValidHorizontalSize) {
|
|
|
gapStyle.columnGap = horizontalSize;
|
|
|
}
|
|
|
if (!isPresetVerticalSize && isValidVerticalSize) {
|
|
|
gapStyle.rowGap = verticalSize;
|
|
|
}
|
|
|
return wrapSSR( /*#__PURE__*/_react_17_0_2_react.createElement("div", Object.assign({
|
|
|
ref: ref,
|
|
|
className: cls,
|
|
|
style: Object.assign(Object.assign(Object.assign({}, gapStyle), space === null || space === void 0 ? void 0 : space.style), style)
|
|
|
}, otherProps), /*#__PURE__*/_react_17_0_2_react.createElement(SpaceContextProvider, {
|
|
|
value: spaceContext
|
|
|
}, nodes)));
|
|
|
});
|
|
|
if (false) {}
|
|
|
const CompoundedSpace = Space;
|
|
|
CompoundedSpace.Compact = Compact/* default */.ZP;
|
|
|
/* harmony default export */ var space = (CompoundedSpace);
|
|
|
|
|
|
/***/ })
|
|
|
|
|
|
}]); |