You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
NewEduCoderBuild/32791.async.js

918 lines
39 KiB

"use strict";
(self["webpackChunk"] = self["webpackChunk"] || []).push([[32791],{
/***/ 88794:
/*!*******************************************************************************************************************!*\
!*** ./node_modules/_@ant-design_icons@5.3.0@@ant-design/icons/es/icons/ExclamationCircleOutlined.js + 1 modules ***!
\*******************************************************************************************************************/
/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
// EXPORTS
__webpack_require__.d(__webpack_exports__, {
Z: function() { return /* binding */ icons_ExclamationCircleOutlined; }
});
// EXTERNAL MODULE: ./node_modules/_@babel_runtime@7.23.9@@babel/runtime/helpers/esm/extends.js
var esm_extends = __webpack_require__(79384);
// EXTERNAL MODULE: ./node_modules/_react@17.0.2@react/index.js
var _react_17_0_2_react = __webpack_require__(59301);
;// CONCATENATED MODULE: ./node_modules/_@ant-design_icons-svg@4.4.0@@ant-design/icons-svg/es/asn/ExclamationCircleOutlined.js
// This icon file is generated automatically.
var ExclamationCircleOutlined = { "icon": { "tag": "svg", "attrs": { "viewBox": "64 64 896 896", "focusable": "false" }, "children": [{ "tag": "path", "attrs": { "d": "M512 64C264.6 64 64 264.6 64 512s200.6 448 448 448 448-200.6 448-448S759.4 64 512 64zm0 820c-205.4 0-372-166.6-372-372s166.6-372 372-372 372 166.6 372 372-166.6 372-372 372z" } }, { "tag": "path", "attrs": { "d": "M464 688a48 48 0 1096 0 48 48 0 10-96 0zm24-112h48c4.4 0 8-3.6 8-8V296c0-4.4-3.6-8-8-8h-48c-4.4 0-8 3.6-8 8v272c0 4.4 3.6 8 8 8z" } }] }, "name": "exclamation-circle", "theme": "outlined" };
/* harmony default export */ var asn_ExclamationCircleOutlined = (ExclamationCircleOutlined);
// EXTERNAL MODULE: ./node_modules/_@ant-design_icons@5.3.0@@ant-design/icons/es/components/AntdIcon.js + 3 modules
var AntdIcon = __webpack_require__(44847);
;// CONCATENATED MODULE: ./node_modules/_@ant-design_icons@5.3.0@@ant-design/icons/es/icons/ExclamationCircleOutlined.js
// GENERATE BY ./scripts/generate.ts
// DON NOT EDIT IT MANUALLY
var ExclamationCircleOutlined_ExclamationCircleOutlined = function ExclamationCircleOutlined(props, ref) {
return /*#__PURE__*/_react_17_0_2_react.createElement(AntdIcon/* default */.Z, (0,esm_extends/* default */.Z)({}, props, {
ref: ref,
icon: asn_ExclamationCircleOutlined
}));
};
if (false) {}
/* harmony default export */ var icons_ExclamationCircleOutlined = (/*#__PURE__*/_react_17_0_2_react.forwardRef(ExclamationCircleOutlined_ExclamationCircleOutlined));
/***/ }),
/***/ 3882:
/*!****************************************************************************!*\
!*** ./src/pages/virtualSpaces/components/AddOrEdit/index.tsx + 1 modules ***!
\****************************************************************************/
/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
// EXPORTS
__webpack_require__.d(__webpack_exports__, {
Z: function() { return /* binding */ components_AddOrEdit; }
});
// UNUSED EXPORTS: Edit
// EXTERNAL MODULE: ./node_modules/_@babel_runtime@7.23.6@@babel/runtime/helpers/regeneratorRuntime.js
var regeneratorRuntime = __webpack_require__(7557);
var regeneratorRuntime_default = /*#__PURE__*/__webpack_require__.n(regeneratorRuntime);
// EXTERNAL MODULE: ./node_modules/_@babel_runtime@7.23.6@@babel/runtime/helpers/asyncToGenerator.js
var asyncToGenerator = __webpack_require__(41498);
var asyncToGenerator_default = /*#__PURE__*/__webpack_require__.n(asyncToGenerator);
// EXTERNAL MODULE: ./node_modules/_@babel_runtime@7.23.6@@babel/runtime/helpers/slicedToArray.js
var slicedToArray = __webpack_require__(79800);
var slicedToArray_default = /*#__PURE__*/__webpack_require__.n(slicedToArray);
// EXTERNAL MODULE: ./node_modules/_react@17.0.2@react/index.js
var _react_17_0_2_react = __webpack_require__(59301);
// EXTERNAL MODULE: ./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 es_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/input/index.js + 5 modules
var input = __webpack_require__(65645);
// 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/upload/index.js + 24 modules
var upload = __webpack_require__(17071);
;// CONCATENATED MODULE: ./src/pages/virtualSpaces/components/AddOrEdit/index.less?modules
// extracted by mini-css-extract-plugin
/* harmony default export */ var AddOrEditmodules = ({"flex_box_center":"flex_box_center___ze4wf","flex_space_between":"flex_space_between___JpH0B","flex_box_vertical_center":"flex_box_vertical_center___NbRyF","flex_box_center_end":"flex_box_center_end___fUFoB","flex_box_column":"flex_box_column___i2BZL","form":"form____yVeV","btn":"btn___X16NC","img":"img___sQnKq"});
// EXTERNAL MODULE: ./src/components/ui-customization/reset.less?modules
var resetmodules = __webpack_require__(9796);
// EXTERNAL MODULE: ./src/utils/env.ts + 1 modules
var env = __webpack_require__(83877);
// EXTERNAL MODULE: ./node_modules/_@ant-design_icons@5.3.0@@ant-design/icons/es/icons/CloseCircleFilled.js + 1 modules
var icons_CloseCircleFilled = __webpack_require__(22261);
// EXTERNAL MODULE: ./node_modules/_react@17.0.2@react/jsx-runtime.js
var jsx_runtime = __webpack_require__(37712);
;// CONCATENATED MODULE: ./src/pages/virtualSpaces/components/AddOrEdit/index.tsx
var AddOrEdit = function AddOrEdit(_ref) {
var _fileList$3, _fileOtherList$3;
var visible = _ref.visible,
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)([]),
_useState6 = slicedToArray_default()(_useState5, 2),
fileOtherList = _useState6[0],
setFileOtherList = _useState6[1];
var _useState7 = (0,_react_17_0_2_react.useState)(false),
_useState8 = slicedToArray_default()(_useState7, 2),
imgLoading = _useState8[0],
setImgLoading = _useState8[1];
(0,_react_17_0_2_react.useEffect)(function () {
if (visible !== null && visible !== void 0 && visible.name) {
var _visible$cover_url, _visible$cover_url2, _visible$backbground_, _visible$backbground_2;
form.setFieldsValue({
name: visible === null || visible === void 0 ? void 0 : visible.name
});
var newFileList = visible !== null && visible !== void 0 && (_visible$cover_url = visible.cover_url) !== null && _visible$cover_url !== void 0 && _visible$cover_url.includes('attachments') ? [{
response: {
id: visible === null || visible === void 0 || (_visible$cover_url2 = visible.cover_url) === null || _visible$cover_url2 === void 0 ? void 0 : _visible$cover_url2.split('/')[3]
}
}] : [];
var newFileOtherList = visible !== null && visible !== void 0 && (_visible$backbground_ = visible.backbground_image_url) !== null && _visible$backbground_ !== void 0 && _visible$backbground_.includes('attachments') ? [{
response: {
id: visible === null || visible === void 0 || (_visible$backbground_2 = visible.backbground_image_url) === null || _visible$backbground_2 === void 0 ? void 0 : _visible$backbground_2.split('/')[3]
}
}] : [];
setFileList(newFileList);
setFileOtherList(newFileOtherList);
}
}, [visible]);
var handleOk = function handleOk() {
form.submit();
};
var handleCancel = function handleCancel() {
onCancel();
};
var addSubmit = /*#__PURE__*/function () {
var _ref2 = asyncToGenerator_default()( /*#__PURE__*/regeneratorRuntime_default()().mark(function _callee(values) {
var _fileList$, _fileOtherList$;
var param;
return regeneratorRuntime_default()().wrap(function _callee$(_context) {
while (1) switch (_context.prev = _context.next) {
case 0:
setBtnLoading(true);
console.log(fileList, fileOtherList, 3333);
param = {
name: values === null || values === void 0 ? void 0 : values.name,
vs_type: values === null || values === void 0 ? void 0 : values.vs_type,
identifier: values === null || values === void 0 ? void 0 : values.identifier,
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) || '',
backbground_image_id: (fileOtherList === null || fileOtherList === void 0 || (_fileOtherList$ = fileOtherList[0]) === null || _fileOtherList$ === void 0 || (_fileOtherList$ = _fileOtherList$.response) === null || _fileOtherList$ === void 0 ? void 0 : _fileOtherList$.id) || ''
};
onOk(param, function (res) {
if ((res === null || res === void 0 ? void 0 : res.status) === -3) {
form.setFields([{
name: 'identifier',
errors: ['该标识已存在,请更换']
}]);
}
setBtnLoading(false);
});
case 4:
case "end":
return _context.stop();
}
}, _callee);
}));
return function addSubmit(_x) {
return _ref2.apply(this, arguments);
};
}();
var handleFileChange = function handleFileChange(info, type) {
var statusList = ["uploading", "done", "removed"];
if (statusList.includes(info.file.status)) {
if (info.file.status === 'uploading') {
setImgLoading(true);
}
if (info.file.status === 'done') {
setImgLoading(false);
}
if (type === 1) {
setFileList(info.fileList);
} else {
setFileOtherList(info.fileList);
}
}
};
var handleFileRemove = function handleFileRemove(file, type) {
if (type === 1) {
setFileList([]);
} else {
setFileOtherList([]);
}
};
var handleFileBeforeUpload = function handleFileBeforeUpload(file, type) {
var isJpgOrPng = file.type === 'image/jpeg' || file.type === 'image/png';
if (!isJpgOrPng) {
es_message/* default */.ZP.warning('请上传jpg或png的图片!');
return false;
}
var is200K = file.size / 1024 > 200;
var is1M = file.size / 1024 / 1024 > 1;
if (is200K && type === 1) {
es_message/* default */.ZP.warning('文件大小必须小于200KB');
return false;
}
if (is1M && type === 2) {
es_message/* default */.ZP.warning('文件大小必须小于1MB');
return false;
}
if (type === 1) {
setFileList([]);
} else {
setFileOtherList([]);
}
return true;
};
var renderImg = function renderImg(type) {
var _fileList$2, _fileOtherList$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/" + (type === 1 ? 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 : fileOtherList === null || fileOtherList === void 0 || (_fileOtherList$2 = fileOtherList[0]) === null || _fileOtherList$2 === void 0 || (_fileOtherList$2 = _fileOtherList$2.response) === null || _fileOtherList$2 === void 0 ? void 0 : _fileOtherList$2.id),
alt: "avatar",
style: {
width: '100%'
}
}), /*#__PURE__*/(0,jsx_runtime.jsx)("div", {
children: /*#__PURE__*/(0,jsx_runtime.jsx)(icons_CloseCircleFilled/* default */.Z, {
onClick: function onClick() {
if (type === 1) {
setFileList([]);
} else {
setFileOtherList([]);
}
},
style: {
fontSize: '16px',
color: 'red'
}
})
})]
});
};
return /*#__PURE__*/(0,jsx_runtime.jsx)(modal/* default */.Z, {
title: title,
open: visible,
onOk: handleOk,
centered: true,
onCancel: handleCancel,
confirmLoading: btnLoading,
okButtonProps: {
disabled: imgLoading
},
width: 694,
afterClose: function afterClose() {
setBtnLoading(false);
setFileList([]);
setFileOtherList([]);
form.resetFields();
},
okText: visible !== null && visible !== void 0 && visible.name ? '确认' : '确认新建',
cancelText: "\u53D6\u6D88",
wrapClassName: resetmodules/* default */.Z.CustomCss,
children: /*#__PURE__*/(0,jsx_runtime.jsxs)(es_form/* default */.Z, {
form: form,
colon: false,
onFinish: addSubmit
// labelCol={{ span: 4 }}
// wrapperCol={{ span: 18 }}
,
className: AddOrEditmodules.form,
children: [/*#__PURE__*/(0,jsx_runtime.jsx)(es_form/* default */.Z.Item, {
label: "\u793E\u533A\u540D\u79F0",
name: "name",
rules: [{
required: true,
message: '请输入社区名称'
}, {
whitespace: true,
message: '请输入社区名称'
}, {
max: 60,
message: '只能输入60个字符'
}],
children: /*#__PURE__*/(0,jsx_runtime.jsx)(input/* default */.Z, {
maxLength: 60,
placeholder: "\u8BF7\u8F93\u5165\u793E\u533A\u540D\u79F0"
})
}), /*#__PURE__*/(0,jsx_runtime.jsx)(es_form/* default */.Z.Item, {
label: "\u793E\u533A\u7C7B\u578B",
initialValue: "classroom",
name: "vs_type",
rules: [{
required: true,
message: '请输入社区类型'
}],
children: /*#__PURE__*/(0,jsx_runtime.jsxs)(es_radio/* default.Group */.ZP.Group, {
children: [/*#__PURE__*/(0,jsx_runtime.jsx)(es_radio/* default */.ZP, {
value: "classroom",
children: "\u865A\u62DF\u6559\u7814\u5BA4"
}), /*#__PURE__*/(0,jsx_runtime.jsx)(es_radio/* default */.ZP, {
className: "ml20",
value: "plan",
children: "101\u8BA1\u5212"
})]
})
}), /*#__PURE__*/(0,jsx_runtime.jsx)(es_form/* default */.Z.Item, {
label: /*#__PURE__*/(0,jsx_runtime.jsx)("span", {
style: {
width: 66
},
children: "\u6807\u8BC6"
}),
name: "identifier",
rules: [{
pattern: /^[a-zA-Z0-9]+$/,
message: '仅支持填写英文和数字'
}],
children: /*#__PURE__*/(0,jsx_runtime.jsx)(input/* default */.Z, {
maxLength: 15
})
}), /*#__PURE__*/(0,jsx_runtime.jsxs)("div", {
style: {
marginLeft: 78
},
children: [/*#__PURE__*/(0,jsx_runtime.jsx)("div", {
className: "14px c-grey-999",
children: "\u7528\u4E8E\u5355\u72EC\u6807\u8BC6\u865A\u62DF\u793E\u533A\uFF0C\u5728\u94FE\u63A5\u4E2D\u4F53\u73B0\uFF0C\u5982\uFF1Awww.educoder.net/vtrs/+\u6807\u8BC6"
}), /*#__PURE__*/(0,jsx_runtime.jsxs)("div", {
className: "14px c-grey-333",
children: ["\u6CE8\u610F\uFF1A", /*#__PURE__*/(0,jsx_runtime.jsx)("br", {}), "1\u3001\u6807\u8BC6\u4E0D\u53EF\u91CD\u590D", /*#__PURE__*/(0,jsx_runtime.jsx)("br", {}), "2\u3001\u4EC5\u652F\u6301\u586B\u5199\u82F1\u6587\u548C\u6570\u5B57", /*#__PURE__*/(0,jsx_runtime.jsx)("br", {}), "3\u3001\u4E0D\u8D85\u8FC715\u4E2A\u5B57\u7B26", /*#__PURE__*/(0,jsx_runtime.jsx)("br", {}), "4\u3001\u672A\u586B\u5199\u65F6\uFF0C\u7CFB\u7EDF\u81EA\u52A8\u751F\u6210\u72EC\u7ACB\u6807\u8BC6"]
})]
}), /*#__PURE__*/(0,jsx_runtime.jsx)(es_form/* default */.Z.Item, {
name: "cover_id",
label: "\u4E0A\u4F20\u5C01\u9762\u56FE",
valuePropName: "fileList",
className: "mt30",
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(1) : /*#__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, 1);
},
onRemove: function onRemove(e) {
return handleFileRemove(e, 1);
},
beforeUpload: function beforeUpload(e) {
return handleFileBeforeUpload(e, 1);
},
withCredentials: true,
accept: "image/*",
children: /*#__PURE__*/(0,jsx_runtime.jsxs)("div", {
className: AddOrEditmodules.btn,
children: [/*#__PURE__*/(0,jsx_runtime.jsx)("i", {
className: "iconfont icon-shangchuantupian2"
}), "\u4E0A\u4F20\u56FE\u7247"]
})
})
})
}), /*#__PURE__*/(0,jsx_runtime.jsx)("aside", {
children: "\u4EC5\u652F\u6301\u4E0A\u4F20jpg/png\u683C\u5F0F\u6587\u4EF6\uFF0C\u6587\u4EF6\u5927\u5C0F\u4E0D\u80FD\u8D85\u8FC7200KB\uFF0C\u5EFA\u8BAE\u4F7F\u7528282*228\u50CF\u7D20\uFF1B\u5982\u4E0D\u4E0A\u4F20\uFF0C\u9ED8\u8BA4\u4F7F\u7528\u7CFB\u7EDF\u56FE\u7247\u3002"
}), /*#__PURE__*/(0,jsx_runtime.jsx)(es_form/* default */.Z.Item, {
name: "backbground_image_id",
label: "\u8BE6\u60C5\u9876\u90E8\u80CC\u666F",
valuePropName: "fileList",
className: "mt30",
children: /*#__PURE__*/(0,jsx_runtime.jsx)("div", {
className: AddOrEditmodules.upload,
children: fileOtherList !== null && fileOtherList !== void 0 && (_fileOtherList$3 = fileOtherList[0]) !== null && _fileOtherList$3 !== void 0 && (_fileOtherList$3 = _fileOtherList$3.response) !== null && _fileOtherList$3 !== void 0 && _fileOtherList$3.id ? renderImg(2) : /*#__PURE__*/(0,jsx_runtime.jsx)(upload/* default */.Z, {
fileList: fileOtherList,
action: "".concat(env/* default */.Z.API_SERVER, "/api/attachments.json"),
onChange: function onChange(e) {
return handleFileChange(e, 2);
},
onRemove: function onRemove(e) {
return handleFileRemove(e, 2);
},
beforeUpload: function beforeUpload(e) {
return handleFileBeforeUpload(e, 2);
},
withCredentials: true,
accept: "image/*",
children: /*#__PURE__*/(0,jsx_runtime.jsxs)("div", {
className: AddOrEditmodules.btn,
children: [/*#__PURE__*/(0,jsx_runtime.jsx)("i", {
className: "iconfont icon-shangchuantupian2"
}), "\u4E0A\u4F20\u56FE\u7247"]
})
})
})
}), /*#__PURE__*/(0,jsx_runtime.jsx)("aside", {
children: "\u4EC5\u652F\u6301\u4E0A\u4F20jpg/png\u683C\u5F0F\u6587\u4EF6\uFF0C\u6587\u4EF6\u5927\u5C0F\u4E0D\u80FD\u8D85\u8FC71MB\uFF0C\u5EFA\u8BAE\u4F7F\u75283840*148\u50CF\u7D20\uFF1B\u5982\u4E0D\u4E0A\u4F20\uFF0C\u9ED8\u8BA4\u4F7F\u7528\u7CFB\u7EDF\u56FE\u7247\u3002"
})]
})
});
};
var Edit = function Edit(_ref3) {
var _fileList$6, _fileOtherList$6;
var data = _ref3.data,
onOk = _ref3.onOk;
var _Form$useForm3 = Form.useForm(),
_Form$useForm4 = _slicedToArray(_Form$useForm3, 1),
form = _Form$useForm4[0];
var _useState9 = useState(false),
_useState10 = _slicedToArray(_useState9, 2),
btnLoading = _useState10[0],
setBtnLoading = _useState10[1];
var _useState11 = useState([]),
_useState12 = _slicedToArray(_useState11, 2),
fileList = _useState12[0],
setFileList = _useState12[1];
var _useState13 = useState([]),
_useState14 = _slicedToArray(_useState13, 2),
fileOtherList = _useState14[0],
setFileOtherList = _useState14[1];
var _useState15 = useState(false),
_useState16 = _slicedToArray(_useState15, 2),
imgLoading = _useState16[0],
setImgLoading = _useState16[1];
useEffect(function () {
if (data !== null && data !== void 0 && data.name) {
var _data$cover_url, _data$cover_url2, _data$backbground_ima, _data$backbground_ima2;
form.setFieldsValue({
name: data === null || data === void 0 ? void 0 : data.name
});
var newFileList = data !== null && data !== void 0 && (_data$cover_url = data.cover_url) !== null && _data$cover_url !== void 0 && _data$cover_url.includes('attachments') ? [{
response: {
id: data === null || data === void 0 || (_data$cover_url2 = data.cover_url) === null || _data$cover_url2 === void 0 ? void 0 : _data$cover_url2.split('/')[3]
}
}] : [];
var newFileOtherList = data !== null && data !== void 0 && (_data$backbground_ima = data.backbground_image_url) !== null && _data$backbground_ima !== void 0 && _data$backbground_ima.includes('attachments') ? [{
response: {
id: data === null || data === void 0 || (_data$backbground_ima2 = data.backbground_image_url) === null || _data$backbground_ima2 === void 0 ? void 0 : _data$backbground_ima2.split('/')[3]
}
}] : [];
setFileList(newFileList);
setFileOtherList(newFileOtherList);
}
}, [data]);
var handleOk = function handleOk() {
form.submit();
};
var addSubmit = /*#__PURE__*/function () {
var _ref4 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee2(values) {
var _fileList$4, _fileOtherList$4;
var param;
return _regeneratorRuntime().wrap(function _callee2$(_context2) {
while (1) switch (_context2.prev = _context2.next) {
case 0:
setBtnLoading(true);
param = {
name: values === null || values === void 0 ? void 0 : values.name,
cover_id: (fileList === null || fileList === void 0 || (_fileList$4 = fileList[0]) === null || _fileList$4 === void 0 || (_fileList$4 = _fileList$4.response) === null || _fileList$4 === void 0 ? void 0 : _fileList$4.id) || '',
backbground_image_id: (fileOtherList === null || fileOtherList === void 0 || (_fileOtherList$4 = fileOtherList[0]) === null || _fileOtherList$4 === void 0 || (_fileOtherList$4 = _fileOtherList$4.response) === null || _fileOtherList$4 === void 0 ? void 0 : _fileOtherList$4.id) || ''
};
onOk(param, function () {
setBtnLoading(false);
});
case 3:
case "end":
return _context2.stop();
}
}, _callee2);
}));
return function addSubmit(_x2) {
return _ref4.apply(this, arguments);
};
}();
var handleFileChange = function handleFileChange(info, type) {
var statusList = ["uploading", "done", "removed"];
if (statusList.includes(info.file.status)) {
if (info.file.status === 'uploading') {
setImgLoading(true);
}
if (info.file.status === 'done') {
setImgLoading(false);
}
if (type === 1) {
setFileList(info.fileList);
} else {
setFileOtherList(info.fileList);
}
}
};
var handleFileRemove = function handleFileRemove(file, type) {
if (type === 1) {
setFileList([]);
} else {
setFileOtherList([]);
}
};
var handleFileBeforeUpload = function handleFileBeforeUpload(file, type) {
var isJpgOrPng = file.type === 'image/jpeg' || file.type === 'image/png';
if (!isJpgOrPng) {
message.error('请上传jpg或png的图片!');
return false;
}
var is150M = file.size / 1024 / 1024 > 2;
if (is150M) {
message.info('文件大小必须小于2MB');
return false;
}
if (type === 1) {
setFileList([]);
} else {
setFileOtherList([]);
}
return true;
};
var renderImg = function renderImg(type) {
var _fileList$5, _fileOtherList$5;
return /*#__PURE__*/_jsxs("div", {
className: styles.img,
children: [/*#__PURE__*/_jsx("img", {
src: ENV.API_SERVER + "/api/attachments/" + (type === 1 ? fileList === null || fileList === void 0 || (_fileList$5 = fileList[0]) === null || _fileList$5 === void 0 || (_fileList$5 = _fileList$5.response) === null || _fileList$5 === void 0 ? void 0 : _fileList$5.id : fileOtherList === null || fileOtherList === void 0 || (_fileOtherList$5 = fileOtherList[0]) === null || _fileOtherList$5 === void 0 || (_fileOtherList$5 = _fileOtherList$5.response) === null || _fileOtherList$5 === void 0 ? void 0 : _fileOtherList$5.id),
alt: "avatar",
style: {
width: '100%'
}
}), /*#__PURE__*/_jsx("div", {
children: /*#__PURE__*/_jsx(CloseCircleFilled, {
onClick: function onClick() {
if (type === 1) {
setFileList([]);
} else {
setFileOtherList([]);
}
},
style: {
fontSize: '16px',
color: 'red'
}
})
})]
});
};
return /*#__PURE__*/_jsxs(Form, {
form: form,
colon: false,
onFinish: addSubmit,
labelCol: {
span: 3
},
wrapperCol: {
span: 19
},
className: styles.form,
children: [/*#__PURE__*/_jsx(Form.Item, {
label: "\u793E\u533A\u540D\u79F0",
name: "name",
rules: [{
required: true,
message: '请输入社区名称'
}, {
whitespace: true,
message: '请输入社区名称'
}, {
max: 60,
message: '只能输入60个字符'
}],
children: /*#__PURE__*/_jsx(Input, {
maxLength: 60,
placeholder: "\u8BF7\u8F93\u5165\u793E\u533A\u540D\u79F0"
})
}), /*#__PURE__*/_jsx(Form.Item, {
name: "cover_id",
label: "\u5C01\u9762\u56FE",
valuePropName: "fileList",
children: /*#__PURE__*/_jsxs("div", {
className: styles.upload,
children: [fileList !== null && fileList !== void 0 && (_fileList$6 = fileList[0]) !== null && _fileList$6 !== void 0 && (_fileList$6 = _fileList$6.response) !== null && _fileList$6 !== void 0 && _fileList$6.id ? renderImg(1) : /*#__PURE__*/_jsx(Upload, {
fileList: fileList,
action: "".concat(ENV.API_SERVER, "/api/attachments.json"),
onChange: function onChange(e) {
return handleFileChange(e, 1);
},
onRemove: function onRemove(e) {
return handleFileRemove(e, 1);
},
beforeUpload: function beforeUpload(e) {
return handleFileBeforeUpload(e, 1);
},
withCredentials: true,
accept: "image/*",
children: /*#__PURE__*/_jsxs(Button, {
children: [/*#__PURE__*/_jsx("i", {
className: "iconfont icon-shangchuantupian2 mr10"
}), "\u4E0A\u4F20\u56FE\u7247"]
})
}), /*#__PURE__*/_jsx("aside", {
children: "\u4EC5\u652F\u6301\u4E0A\u4F20jpg/png\u7B49\u683C\u5F0F\u6587\u4EF6\uFF0C\u6587\u4EF6\u5927\u5C0F\u4E0D\u80FD\u8D85\u8FC72M,\u5EFA\u8BAE\u4F7F\u7528278*225\u50CF\u7D20\uFF1B\u5982\u4E0D\u4E0A\u4F20\uFF0C\u9ED8\u8BA4\u4F7F\u7528\u7CFB\u7EDF\u56FE\u7247\u3002"
})]
})
}), /*#__PURE__*/_jsx(Form.Item, {
name: "backbground_image_id",
label: "\u8BE6\u60C5\u9876\u90E8\u80CC\u666F",
valuePropName: "fileList",
children: /*#__PURE__*/_jsxs("div", {
className: styles.upload,
children: [fileOtherList !== null && fileOtherList !== void 0 && (_fileOtherList$6 = fileOtherList[0]) !== null && _fileOtherList$6 !== void 0 && (_fileOtherList$6 = _fileOtherList$6.response) !== null && _fileOtherList$6 !== void 0 && _fileOtherList$6.id ? renderImg(2) : /*#__PURE__*/_jsx(Upload, {
fileList: fileOtherList,
action: "".concat(ENV.API_SERVER, "/api/attachments.json"),
onChange: function onChange(e) {
return handleFileChange(e, 2);
},
onRemove: function onRemove(e) {
return handleFileRemove(e, 2);
},
beforeUpload: function beforeUpload(e) {
return handleFileBeforeUpload(e, 2);
},
withCredentials: true,
accept: "image/*",
children: /*#__PURE__*/_jsxs(Button, {
children: [/*#__PURE__*/_jsx("i", {
className: "iconfont icon-shangchuantupian2 mr10"
}), "\u4E0A\u4F20\u56FE\u7247"]
})
}), /*#__PURE__*/_jsx("aside", {
children: "\u4EC5\u652F\u6301\u4E0A\u4F20jpg/png\u7B49\u683C\u5F0F\u6587\u4EF6\uFF0C\u6587\u4EF6\u5927\u5C0F\u4E0D\u80FD\u8D85\u8FC72M,\u5EFA\u8BAE\u4F7F\u75281920*220\u50CF\u7D20\uFF1B\u5982\u4E0D\u4E0A\u4F20\uFF0C\u9ED8\u8BA4\u4F7F\u7528\u7CFB\u7EDF\u56FE\u7247\u3002"
})]
})
}), /*#__PURE__*/_jsx(Button, {
disabled: imgLoading,
loading: btnLoading,
type: "primary",
onClick: handleOk,
style: {
marginLeft: 120
},
children: "\u786E\u8BA4"
})]
});
};
/* harmony default export */ var components_AddOrEdit = (AddOrEdit);
/***/ }),
/***/ 9796:
/*!************************************************************!*\
!*** ./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"});
/***/ }),
/***/ 28103:
/*!***********************************************************************!*\
!*** ./node_modules/_antd@5.9.0@antd/es/divider/index.js + 1 modules ***!
\***********************************************************************/
/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
// EXPORTS
__webpack_require__.d(__webpack_exports__, {
Z: function() { return /* binding */ divider; }
});
// 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/_antd@5.9.0@antd/es/config-provider/context.js
var context = __webpack_require__(36355);
// EXTERNAL MODULE: ./node_modules/_antd@5.9.0@antd/es/style/index.js
var style = __webpack_require__(17313);
// EXTERNAL MODULE: ./node_modules/_antd@5.9.0@antd/es/theme/util/genComponentStyleHook.js
var genComponentStyleHook = __webpack_require__(83116);
// EXTERNAL MODULE: ./node_modules/_antd@5.9.0@antd/es/theme/util/statistic.js
var statistic = __webpack_require__(37613);
;// CONCATENATED MODULE: ./node_modules/_antd@5.9.0@antd/es/divider/style/index.js
// ============================== Shared ==============================
const genSharedDividerStyle = token => {
const {
componentCls,
sizePaddingEdgeHorizontal,
colorSplit,
lineWidth,
textPaddingInline,
orientationMargin,
verticalMarginInline
} = token;
return {
[componentCls]: Object.assign(Object.assign({}, (0,style/* resetComponent */.Wf)(token)), {
borderBlockStart: `${lineWidth}px solid ${colorSplit}`,
// vertical
'&-vertical': {
position: 'relative',
top: '-0.06em',
display: 'inline-block',
height: '0.9em',
marginInline: verticalMarginInline,
marginBlock: 0,
verticalAlign: 'middle',
borderTop: 0,
borderInlineStart: `${lineWidth}px solid ${colorSplit}`
},
'&-horizontal': {
display: 'flex',
clear: 'both',
width: '100%',
minWidth: '100%',
margin: `${token.dividerHorizontalGutterMargin}px 0`
},
[`&-horizontal${componentCls}-with-text`]: {
display: 'flex',
alignItems: 'center',
margin: `${token.dividerHorizontalWithTextGutterMargin}px 0`,
color: token.colorTextHeading,
fontWeight: 500,
fontSize: token.fontSizeLG,
whiteSpace: 'nowrap',
textAlign: 'center',
borderBlockStart: `0 ${colorSplit}`,
'&::before, &::after': {
position: 'relative',
width: '50%',
borderBlockStart: `${lineWidth}px solid transparent`,
// Chrome not accept `inherit` in `border-top`
borderBlockStartColor: 'inherit',
borderBlockEnd: 0,
transform: 'translateY(50%)',
content: "''"
}
},
[`&-horizontal${componentCls}-with-text-left`]: {
'&::before': {
width: `${orientationMargin * 100}%`
},
'&::after': {
width: `${100 - orientationMargin * 100}%`
}
},
[`&-horizontal${componentCls}-with-text-right`]: {
'&::before': {
width: `${100 - orientationMargin * 100}%`
},
'&::after': {
width: `${orientationMargin * 100}%`
}
},
[`${componentCls}-inner-text`]: {
display: 'inline-block',
paddingBlock: 0,
paddingInline: textPaddingInline
},
'&-dashed': {
background: 'none',
borderColor: colorSplit,
borderStyle: 'dashed',
borderWidth: `${lineWidth}px 0 0`
},
[`&-horizontal${componentCls}-with-text${componentCls}-dashed`]: {
'&::before, &::after': {
borderStyle: 'dashed none none'
}
},
[`&-vertical${componentCls}-dashed`]: {
borderInlineStartWidth: lineWidth,
borderInlineEnd: 0,
borderBlockStart: 0,
borderBlockEnd: 0
},
[`&-plain${componentCls}-with-text`]: {
color: token.colorText,
fontWeight: 'normal',
fontSize: token.fontSize
},
[`&-horizontal${componentCls}-with-text-left${componentCls}-no-default-orientation-margin-left`]: {
'&::before': {
width: 0
},
'&::after': {
width: '100%'
},
[`${componentCls}-inner-text`]: {
paddingInlineStart: sizePaddingEdgeHorizontal
}
},
[`&-horizontal${componentCls}-with-text-right${componentCls}-no-default-orientation-margin-right`]: {
'&::before': {
width: '100%'
},
'&::after': {
width: 0
},
[`${componentCls}-inner-text`]: {
paddingInlineEnd: sizePaddingEdgeHorizontal
}
}
})
};
};
// ============================== Export ==============================
/* harmony default export */ var divider_style = ((0,genComponentStyleHook/* default */.Z)('Divider', token => {
const dividerToken = (0,statistic/* merge */.TS)(token, {
dividerHorizontalWithTextGutterMargin: token.margin,
dividerHorizontalGutterMargin: token.marginLG,
sizePaddingEdgeHorizontal: 0
});
return [genSharedDividerStyle(dividerToken)];
}, token => ({
textPaddingInline: '1em',
orientationMargin: 0.05,
verticalMarginInline: token.marginXS
})));
;// CONCATENATED MODULE: ./node_modules/_antd@5.9.0@antd/es/divider/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 Divider = props => {
const {
getPrefixCls,
direction,
divider
} = _react_17_0_2_react.useContext(context/* ConfigContext */.E_);
const {
prefixCls: customizePrefixCls,
type = 'horizontal',
orientation = 'center',
orientationMargin,
className,
rootClassName,
children,
dashed,
plain,
style
} = props,
restProps = __rest(props, ["prefixCls", "type", "orientation", "orientationMargin", "className", "rootClassName", "children", "dashed", "plain", "style"]);
const prefixCls = getPrefixCls('divider', customizePrefixCls);
const [wrapSSR, hashId] = divider_style(prefixCls);
const orientationPrefix = orientation.length > 0 ? `-${orientation}` : orientation;
const hasChildren = !!children;
const hasCustomMarginLeft = orientation === 'left' && orientationMargin != null;
const hasCustomMarginRight = orientation === 'right' && orientationMargin != null;
const classString = _classnames_2_5_1_classnames_default()(prefixCls, divider === null || divider === void 0 ? void 0 : divider.className, hashId, `${prefixCls}-${type}`, {
[`${prefixCls}-with-text`]: hasChildren,
[`${prefixCls}-with-text${orientationPrefix}`]: hasChildren,
[`${prefixCls}-dashed`]: !!dashed,
[`${prefixCls}-plain`]: !!plain,
[`${prefixCls}-rtl`]: direction === 'rtl',
[`${prefixCls}-no-default-orientation-margin-left`]: hasCustomMarginLeft,
[`${prefixCls}-no-default-orientation-margin-right`]: hasCustomMarginRight
}, className, rootClassName);
const memoizedOrientationMargin = _react_17_0_2_react.useMemo(() => {
if (typeof orientationMargin === 'number') {
return orientationMargin;
}
if (/^\d+$/.test(orientationMargin)) {
return Number(orientationMargin);
}
return orientationMargin;
}, [orientationMargin]);
const innerStyle = Object.assign(Object.assign({}, hasCustomMarginLeft && {
marginLeft: memoizedOrientationMargin
}), hasCustomMarginRight && {
marginRight: memoizedOrientationMargin
});
// Warning children not work in vertical mode
if (false) {}
return wrapSSR( /*#__PURE__*/_react_17_0_2_react.createElement("div", Object.assign({
className: classString,
style: Object.assign(Object.assign({}, divider === null || divider === void 0 ? void 0 : divider.style), style)
}, restProps, {
role: "separator"
}), children && type !== 'vertical' && /*#__PURE__*/_react_17_0_2_react.createElement("span", {
className: `${prefixCls}-inner-text`,
style: innerStyle
}, children)));
};
if (false) {}
/* harmony default export */ var divider = (Divider);
/***/ })
}]);