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.
709 lines
28 KiB
709 lines
28 KiB
"use strict";
|
|
(self["webpackChunk"] = self["webpackChunk"] || []).push([[20944],{
|
|
|
|
/***/ 33437:
|
|
/*!************************************************************!*\
|
|
!*** ./src/components/ImgUploadForm/index.tsx + 1 modules ***!
|
|
\************************************************************/
|
|
/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
|
|
|
|
|
|
// EXPORTS
|
|
__webpack_require__.d(__webpack_exports__, {
|
|
Z: function() { return /* binding */ ImgUploadForm; }
|
|
});
|
|
|
|
// 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/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/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: ./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/upload/index.js + 24 modules
|
|
var upload = __webpack_require__(54580);
|
|
// EXTERNAL MODULE: ./node_modules/_antd@5.9.0@antd/es/row/index.js
|
|
var row = __webpack_require__(95237);
|
|
// EXTERNAL MODULE: ./src/utils/env.ts + 1 modules
|
|
var env = __webpack_require__(51200);
|
|
// 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/components/ui-customization/index.tsx + 32 modules
|
|
var ui_customization = __webpack_require__(14083);
|
|
;// CONCATENATED MODULE: ./src/components/ImgUploadForm/index.less?modules
|
|
// extracted by mini-css-extract-plugin
|
|
/* harmony default export */ var ImgUploadFormmodules = ({"tip":"tip___bHEXo"});
|
|
// EXTERNAL MODULE: ./node_modules/_react@17.0.2@react/jsx-runtime.js
|
|
var jsx_runtime = __webpack_require__(37712);
|
|
;// CONCATENATED MODULE: ./src/components/ImgUploadForm/index.tsx
|
|
|
|
|
|
|
|
|
|
|
|
var _excluded = ["ButtonText", "ButtonOptions", "uploadProps", "showTip", "showText", "showListening", "imgWidth"];
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
var AddOrEdit = function AddOrEdit(_ref) {
|
|
var _file$response2;
|
|
var ButtonText = _ref.ButtonText,
|
|
ButtonOptions = _ref.ButtonOptions,
|
|
uploadProps = _ref.uploadProps,
|
|
showTip = _ref.showTip,
|
|
showText = _ref.showText,
|
|
showListening = _ref.showListening,
|
|
imgWidth = _ref.imgWidth,
|
|
props = objectWithoutProperties_default()(_ref, _excluded);
|
|
var _useState = (0,_react_17_0_2_react.useState)(null),
|
|
_useState2 = slicedToArray_default()(_useState, 2),
|
|
file = _useState2[0],
|
|
setFile = _useState2[1];
|
|
var AntdUploadProps = objectSpread2_default()(objectSpread2_default()({
|
|
maxCount: 1,
|
|
accept: "image/*",
|
|
withCredentials: true,
|
|
beforeUpload: function beforeUpload(file) {
|
|
var isJpgOrPng = file.type === 'image/jpeg' || file.type === 'image/png' || file.type === 'image/jpg';
|
|
if (!isJpgOrPng) {
|
|
message/* default */.ZP.error('您上传的不是JPEG/PNG/JPG类型文件');
|
|
return upload/* default */.Z.LIST_IGNORE;
|
|
}
|
|
var fileSize = file.size / 1024 / 1024;
|
|
if (fileSize == 0) {
|
|
message/* default */.ZP.error("".concat(file.name, " \u56FE\u7247\u65E0\u6CD5\u4E0A\u4F20\u3002").concat(fileSize == 0 ? "文件内容不能为空" : '超过图片大小限制(2MB)'));
|
|
return upload/* default */.Z.LIST_IGNORE;
|
|
}
|
|
if (fileSize > 2) {
|
|
message/* default */.ZP.error("".concat(file.name, " \u56FE\u7247\u65E0\u6CD5\u4E0A\u4F20\u3002\u8D85\u8FC7\u56FE\u7247\u5927\u5C0F\u9650\u5236(2MB)"));
|
|
return upload/* default */.Z.LIST_IGNORE;
|
|
}
|
|
return true;
|
|
},
|
|
onChange: function onChange(info) {
|
|
var statusList = ["uploading", "done", "removed"];
|
|
if (statusList.includes(info.file.status)) {
|
|
setFile(info.file);
|
|
}
|
|
if (info.file.status == "done") {
|
|
var _info$file;
|
|
props === null || props === void 0 || props.onChange((_info$file = info.file) === null || _info$file === void 0 || (_info$file = _info$file.response) === null || _info$file === void 0 ? void 0 : _info$file.id);
|
|
}
|
|
},
|
|
action: "".concat(env/* default */.Z.API_SERVER, "/api/attachments.json")
|
|
}, uploadProps || {}), {}, {
|
|
onRemove: function () {
|
|
var _onRemove = asyncToGenerator_default()( /*#__PURE__*/regeneratorRuntime_default()().mark(function _callee(file) {
|
|
return regeneratorRuntime_default()().wrap(function _callee$(_context) {
|
|
while (1) switch (_context.prev = _context.next) {
|
|
case 0:
|
|
close();
|
|
(uploadProps === null || uploadProps === void 0 ? void 0 : uploadProps.onRemove) && (uploadProps === null || uploadProps === void 0 ? void 0 : uploadProps.onRemove(file));
|
|
case 2:
|
|
case "end":
|
|
return _context.stop();
|
|
}
|
|
}, _callee);
|
|
}));
|
|
function onRemove(_x) {
|
|
return _onRemove.apply(this, arguments);
|
|
}
|
|
return onRemove;
|
|
}()
|
|
});
|
|
var renderImg = function renderImg() {
|
|
var _file$response;
|
|
return /*#__PURE__*/(0,jsx_runtime.jsxs)(row/* default */.Z, {
|
|
align: "middle",
|
|
justify: "center",
|
|
style: {
|
|
position: "relative",
|
|
width: imgWidth || 400,
|
|
backgroundColor: "#f4f3f4"
|
|
},
|
|
children: [/*#__PURE__*/(0,jsx_runtime.jsx)("img", {
|
|
src: env/* default */.Z.API_SERVER + "/api/attachments/" + (file === null || file === void 0 || (_file$response = file.response) === null || _file$response === void 0 ? void 0 : _file$response.id),
|
|
alt: "avatar",
|
|
style: {
|
|
width: '100%',
|
|
height: imgWidth ? '177px' : 'auto'
|
|
}
|
|
}), /*#__PURE__*/(0,jsx_runtime.jsx)("div", {
|
|
style: {
|
|
position: "absolute",
|
|
right: "-6px",
|
|
top: "-6px",
|
|
cursor: "pointer",
|
|
width: 16,
|
|
height: 16,
|
|
borderRadius: "50%",
|
|
backgroundColor: "#fff"
|
|
},
|
|
children: /*#__PURE__*/(0,jsx_runtime.jsx)(CloseCircleFilled/* default */.Z, {
|
|
onClick: /*#__PURE__*/asyncToGenerator_default()( /*#__PURE__*/regeneratorRuntime_default()().mark(function _callee2() {
|
|
return regeneratorRuntime_default()().wrap(function _callee2$(_context2) {
|
|
while (1) switch (_context2.prev = _context2.next) {
|
|
case 0:
|
|
close();
|
|
case 1:
|
|
case "end":
|
|
return _context2.stop();
|
|
}
|
|
}, _callee2);
|
|
})),
|
|
style: {
|
|
fontSize: '16px',
|
|
color: 'red'
|
|
}
|
|
})
|
|
})]
|
|
});
|
|
};
|
|
var close = function close() {
|
|
setFile(null);
|
|
props === null || props === void 0 || props.onChange();
|
|
};
|
|
(0,_react_17_0_2_react.useEffect)(function () {
|
|
(props === null || props === void 0 ? void 0 : props.value) && setFile({
|
|
response: {
|
|
id: props === null || props === void 0 ? void 0 : props.value
|
|
}
|
|
});
|
|
}, [props === null || props === void 0 ? void 0 : props.value]);
|
|
return /*#__PURE__*/(0,jsx_runtime.jsx)("div", {
|
|
id: (props === null || props === void 0 ? void 0 : props.scrollId) || '',
|
|
children: file !== null && file !== void 0 && (_file$response2 = file.response) !== null && _file$response2 !== void 0 && _file$response2.id ? renderImg() : /*#__PURE__*/(0,jsx_runtime.jsxs)(jsx_runtime.Fragment, {
|
|
children: [/*#__PURE__*/(0,jsx_runtime.jsx)(upload/* default */.Z, objectSpread2_default()(objectSpread2_default()({}, AntdUploadProps), {}, {
|
|
children: /*#__PURE__*/(0,jsx_runtime.jsx)(ui_customization/* CustomButton */.op, objectSpread2_default()(objectSpread2_default()({
|
|
style: objectSpread2_default()({
|
|
borderRadius: "2px"
|
|
}, ButtonOptions === null || ButtonOptions === void 0 ? void 0 : ButtonOptions.style)
|
|
}, ButtonOptions), {}, {
|
|
children: ButtonText
|
|
}))
|
|
})), showTip && /*#__PURE__*/(0,jsx_runtime.jsx)("span", {
|
|
className: ImgUploadFormmodules.tip,
|
|
children: "\uFF08\u5EFA\u8BAE\u4E0A\u4F20\u5C3A\u5BF8\u4E3A472*266\u7684\u56FE\u7247\uFF09"
|
|
}), showText && /*#__PURE__*/(0,jsx_runtime.jsx)("span", {
|
|
className: ImgUploadFormmodules.tip,
|
|
style: {
|
|
width: '4rem'
|
|
},
|
|
children: "\uFF08\u9700\u4E0A\u4F20\u5C3A\u5BF8\u4E3A200*268\u7684\u56FE\u7247\uFF0C\u5927\u5C0F\u4E0D\u8D85\u8FC72MB\uFF09"
|
|
}), showListening && /*#__PURE__*/(0,jsx_runtime.jsx)("span", {
|
|
className: ImgUploadFormmodules.tip,
|
|
style: {
|
|
width: '4rem'
|
|
},
|
|
children: "\uFF08\u9650\u5236\u4E0A\u4F202MB\u5185\u7684\u56FE\u7247\uFF0C\u5EFA\u8BAE\u4E0A\u4F20\u5C3A\u5BF8\u4E3A283*177\u7684\u56FE\u7247\uFF09"
|
|
})]
|
|
})
|
|
});
|
|
};
|
|
/* harmony default export */ var ImgUploadForm = (AddOrEdit);
|
|
|
|
/***/ }),
|
|
|
|
/***/ 36362:
|
|
/*!**************************************************!*\
|
|
!*** ./src/pages/News/Add/index.tsx + 1 modules ***!
|
|
\**************************************************/
|
|
/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
|
|
|
|
// ESM COMPAT FLAG
|
|
__webpack_require__.r(__webpack_exports__);
|
|
|
|
// EXPORTS
|
|
__webpack_require__.d(__webpack_exports__, {
|
|
"default": function() { return /* binding */ Add; }
|
|
});
|
|
|
|
// 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/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: ./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/input/index.js + 5 modules
|
|
var input = __webpack_require__(10249);
|
|
// 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/date-picker/index.js + 66 modules
|
|
var date_picker = __webpack_require__(5083);
|
|
// 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/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: ./node_modules/_@ant-design_icons@5.6.1@@ant-design/icons/es/icons/UploadOutlined.js + 1 modules
|
|
var UploadOutlined = __webpack_require__(32050);
|
|
// EXTERNAL MODULE: ./src/.umi-production/exports.ts
|
|
var _umi_production_exports = __webpack_require__(64515);
|
|
;// CONCATENATED MODULE: ./src/pages/News/Add/index.less?modules
|
|
// extracted by mini-css-extract-plugin
|
|
/* harmony default export */ var Addmodules = ({"flex_box_center":"flex_box_center___wcUew","flex_space_between":"flex_space_between___nmtwc","flex_box_vertical_center":"flex_box_vertical_center___IBB5I","flex_box_center_end":"flex_box_center_end___uAffv","flex_box_column":"flex_box_column___MwUKt","ContentWarp":"ContentWarp___dEP9T","footst":"footst___jjaL9","tags":"tags___GAiAz","hidden":"hidden___gQNeb"});
|
|
// EXTERNAL MODULE: ./node_modules/_swiper@5.4.5@swiper/css/swiper.css
|
|
var swiper = __webpack_require__(2094);
|
|
// EXTERNAL MODULE: ./src/utils/fetch.ts
|
|
var fetch = __webpack_require__(87281);
|
|
// EXTERNAL MODULE: ./src/utils/env.ts + 1 modules
|
|
var env = __webpack_require__(51200);
|
|
// EXTERNAL MODULE: ./src/components/ImgUploadForm/index.tsx + 1 modules
|
|
var ImgUploadForm = __webpack_require__(33437);
|
|
// EXTERNAL MODULE: ./src/components/ui-customization/index.tsx + 32 modules
|
|
var ui_customization = __webpack_require__(14083);
|
|
// EXTERNAL MODULE: ./src/components/markdown-editor/index.tsx + 10 modules
|
|
var markdown_editor = __webpack_require__(99645);
|
|
// EXTERNAL MODULE: ./node_modules/_react@17.0.2@react/jsx-runtime.js
|
|
var jsx_runtime = __webpack_require__(37712);
|
|
;// CONCATENATED MODULE: ./src/pages/News/Add/index.tsx
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// import Aamodal from '@/components/HomeModal/AAmodal'
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
var IndexPage = function IndexPage(_ref) {
|
|
var homePage = _ref.homePage,
|
|
globalSetting = _ref.globalSetting,
|
|
user = _ref.user,
|
|
loading = _ref.loading,
|
|
dispatch = _ref.dispatch;
|
|
var _useState = (0,_react_17_0_2_react.useState)(),
|
|
_useState2 = slicedToArray_default()(_useState, 2),
|
|
data = _useState2[0],
|
|
setData = _useState2[1];
|
|
var _useState3 = (0,_react_17_0_2_react.useState)([{
|
|
name: '全部'
|
|
}]),
|
|
_useState4 = slicedToArray_default()(_useState3, 2),
|
|
taglist = _useState4[0],
|
|
settaglist = _useState4[1];
|
|
var _Form$useForm = es_form/* default */.Z.useForm(),
|
|
_Form$useForm2 = slicedToArray_default()(_Form$useForm, 1),
|
|
form = _Form$useForm2[0];
|
|
var _useState5 = (0,_react_17_0_2_react.useState)([]),
|
|
_useState6 = slicedToArray_default()(_useState5, 2),
|
|
news_event_tags = _useState6[0],
|
|
setnews_event_tags = _useState6[1];
|
|
var _useState7 = (0,_react_17_0_2_react.useState)({
|
|
page: 1,
|
|
limit: 10,
|
|
setag: '全部'
|
|
}),
|
|
_useState8 = slicedToArray_default()(_useState7, 2),
|
|
params = _useState8[0],
|
|
setparams = _useState8[1];
|
|
(0,_react_17_0_2_react.useEffect)(function () {
|
|
dispatch({
|
|
type: 'globalSetting/headerFooterToggle',
|
|
payload: false
|
|
});
|
|
return function () {
|
|
dispatch({
|
|
type: 'globalSetting/headerFooterToggle',
|
|
payload: true
|
|
});
|
|
};
|
|
}, []);
|
|
var normFile = function normFile(e) {
|
|
console.log('Upload event:', e);
|
|
if (Array.isArray(e)) {
|
|
return e;
|
|
}
|
|
return e === null || e === void 0 ? void 0 : e.fileList;
|
|
};
|
|
return /*#__PURE__*/(0,jsx_runtime.jsxs)("section", {
|
|
style: {
|
|
background: '#fff',
|
|
paddingBottom: 60
|
|
},
|
|
children: [/*#__PURE__*/(0,jsx_runtime.jsxs)("div", {
|
|
style: {
|
|
width: 1200,
|
|
margin: '0px auto'
|
|
},
|
|
children: [/*#__PURE__*/(0,jsx_runtime.jsxs)("div", {
|
|
style: {
|
|
paddingTop: 40,
|
|
display: 'flex',
|
|
alignItems: 'center'
|
|
},
|
|
children: [/*#__PURE__*/(0,jsx_runtime.jsx)("div", {
|
|
style: {
|
|
background: '#666666',
|
|
height: 14,
|
|
width: 4,
|
|
marginRight: 8
|
|
}
|
|
}), /*#__PURE__*/(0,jsx_runtime.jsx)("span", {
|
|
style: {
|
|
color: '#232B40',
|
|
fontWeight: 500
|
|
},
|
|
children: "\u901A\u77E5\u516C\u544A"
|
|
})]
|
|
}), /*#__PURE__*/(0,jsx_runtime.jsx)("div", {
|
|
className: Addmodules.ContentWarp,
|
|
children: /*#__PURE__*/(0,jsx_runtime.jsxs)(es_form/* default */.Z, {
|
|
size: "large",
|
|
colon: false,
|
|
form: form,
|
|
onFinish: ( /*#__PURE__*/function () {
|
|
var _ref2 = asyncToGenerator_default()( /*#__PURE__*/regeneratorRuntime_default()().mark(function _callee(value) {
|
|
var _value$attachment_ids;
|
|
var res;
|
|
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/news_events.json", {
|
|
method: 'post',
|
|
body: objectSpread2_default()(objectSpread2_default()({}, value), {}, {
|
|
attachment_ids: value === null || value === void 0 || (_value$attachment_ids = value.attachment_ids) === null || _value$attachment_ids === void 0 ? void 0 : _value$attachment_ids.map(function (item) {
|
|
var _item$response;
|
|
return item === null || item === void 0 || (_item$response = item.response) === null || _item$response === void 0 ? void 0 : _item$response.id;
|
|
}),
|
|
news_event_tags: news_event_tags,
|
|
new_type: 0
|
|
})
|
|
});
|
|
case 2:
|
|
res = _context.sent;
|
|
if ((res === null || res === void 0 ? void 0 : res.status) === 0) {
|
|
message/* default */.ZP.info("新增成功");
|
|
// history.back()
|
|
_umi_production_exports.history.push("/news/".concat(res === null || res === void 0 ? void 0 : res.id, "/detail"));
|
|
}
|
|
case 4:
|
|
case "end":
|
|
return _context.stop();
|
|
}
|
|
}, _callee);
|
|
}));
|
|
return function (_x) {
|
|
return _ref2.apply(this, arguments);
|
|
};
|
|
}()),
|
|
children: [/*#__PURE__*/(0,jsx_runtime.jsx)(es_form/* default */.Z.Item, {
|
|
label: "\u6807\u9898",
|
|
name: "title",
|
|
labelCol: {
|
|
span: 2
|
|
},
|
|
rules: [{
|
|
required: true,
|
|
message: '标题不能为空'
|
|
}],
|
|
children: /*#__PURE__*/(0,jsx_runtime.jsx)(input/* default */.Z, {
|
|
maxLength: 200,
|
|
showCount: true
|
|
})
|
|
}), /*#__PURE__*/(0,jsx_runtime.jsx)(es_form/* default */.Z.Item, {
|
|
label: "\u6807\u7B7E",
|
|
name: "tags",
|
|
labelCol: {
|
|
span: 2
|
|
},
|
|
children: /*#__PURE__*/(0,jsx_runtime.jsx)(input/* default */.Z, {
|
|
onPressEnter: function onPressEnter(e) {
|
|
if ((news_event_tags === null || news_event_tags === void 0 ? void 0 : news_event_tags.length) === 5) {
|
|
message/* default */.ZP.info('最多新增5个标签');
|
|
return;
|
|
}
|
|
news_event_tags.push({
|
|
id: null,
|
|
name: e.target.value
|
|
});
|
|
setnews_event_tags(toConsumableArray_default()(news_event_tags));
|
|
form.setFieldsValue({
|
|
tags: ''
|
|
});
|
|
},
|
|
maxLength: 10,
|
|
suffix: /*#__PURE__*/(0,jsx_runtime.jsx)("div", {
|
|
style: {
|
|
color: '#9096A3'
|
|
},
|
|
children: "\u56DE\u8F66\u6DFB\u52A0\u6807\u7B7E"
|
|
})
|
|
})
|
|
}), /*#__PURE__*/(0,jsx_runtime.jsxs)(row/* default */.Z, {
|
|
children: [/*#__PURE__*/(0,jsx_runtime.jsx)(col/* default */.Z, {
|
|
span: 2
|
|
}), news_event_tags === null || news_event_tags === void 0 ? void 0 : news_event_tags.map(function (item, index) {
|
|
return /*#__PURE__*/(0,jsx_runtime.jsxs)("div", {
|
|
className: Addmodules.tags,
|
|
style: {
|
|
position: 'relative'
|
|
},
|
|
children: [/*#__PURE__*/(0,jsx_runtime.jsx)("span", {
|
|
style: {
|
|
display: 'inline-flex',
|
|
justifyContent: 'center',
|
|
padding: '0px 14px',
|
|
background: '#F6F7F9',
|
|
borderRadius: 16,
|
|
height: 32,
|
|
lineHeight: '32px',
|
|
color: '#015827',
|
|
marginRight: 20,
|
|
marginBottom: 16
|
|
},
|
|
children: item === null || item === void 0 ? void 0 : item.name
|
|
}), /*#__PURE__*/(0,jsx_runtime.jsx)("span", {
|
|
onClick: function onClick() {
|
|
news_event_tags.splice(index, 1);
|
|
setnews_event_tags(toConsumableArray_default()(news_event_tags));
|
|
},
|
|
className: Addmodules.hidden,
|
|
style: {
|
|
position: 'absolute',
|
|
right: 15,
|
|
top: -5,
|
|
width: 14,
|
|
height: 14,
|
|
background: '#E30000',
|
|
color: '#FFFFFF',
|
|
alignItems: 'center',
|
|
justifyContent: 'center',
|
|
borderRadius: '50%',
|
|
fontSize: 10,
|
|
cursor: 'pointer'
|
|
},
|
|
children: "x"
|
|
})]
|
|
});
|
|
})]
|
|
}), /*#__PURE__*/(0,jsx_runtime.jsxs)(row/* default */.Z, {
|
|
children: [/*#__PURE__*/(0,jsx_runtime.jsx)(col/* default */.Z, {
|
|
span: 12,
|
|
children: /*#__PURE__*/(0,jsx_runtime.jsx)(es_form/* default */.Z.Item, {
|
|
label: "\u6765\u6E90",
|
|
labelCol: {
|
|
span: 4
|
|
}
|
|
// wrapperCol={{ span: 10 }}
|
|
,
|
|
rules: [{
|
|
required: true,
|
|
message: '来源不能为空'
|
|
}],
|
|
name: "publisher",
|
|
children: /*#__PURE__*/(0,jsx_runtime.jsx)(input/* default */.Z, {
|
|
maxLength: 30,
|
|
showCount: true
|
|
})
|
|
})
|
|
}), /*#__PURE__*/(0,jsx_runtime.jsx)(col/* default */.Z, {
|
|
span: 11,
|
|
style: {
|
|
marginLeft: 46
|
|
},
|
|
children: /*#__PURE__*/(0,jsx_runtime.jsx)(es_form/* default */.Z.Item, {
|
|
label: "\u53D1\u5E03\u65F6\u95F4"
|
|
// wrapperCol={{ span: 8 }}
|
|
,
|
|
|
|
rules: [{
|
|
required: true,
|
|
message: '发布时间不能为空'
|
|
}],
|
|
name: "publish_time",
|
|
children: /*#__PURE__*/(0,jsx_runtime.jsx)(date_picker["default"], {
|
|
style: {
|
|
width: '100%'
|
|
},
|
|
showTime: true
|
|
})
|
|
})
|
|
})]
|
|
}), /*#__PURE__*/(0,jsx_runtime.jsx)(es_form/* default */.Z.Item, {
|
|
label: "\u94FE\u63A5",
|
|
name: "url",
|
|
labelCol: {
|
|
span: 2
|
|
},
|
|
children: /*#__PURE__*/(0,jsx_runtime.jsx)(input/* default */.Z, {})
|
|
}), /*#__PURE__*/(0,jsx_runtime.jsx)(es_form/* default */.Z.Item, {
|
|
label: "\u5185\u5BB9",
|
|
name: "content",
|
|
rules: [{
|
|
required: true,
|
|
message: '请输入内容'
|
|
}],
|
|
labelCol: {
|
|
span: 2
|
|
},
|
|
children: /*#__PURE__*/(0,jsx_runtime.jsx)(markdown_editor/* default */.Z, {
|
|
watch: true,
|
|
defaultValue: form.getFieldValue('content')
|
|
})
|
|
}), /*#__PURE__*/(0,jsx_runtime.jsx)(es_form/* default */.Z.Item, {
|
|
label: "\u7F6E\u9876",
|
|
name: "is_top",
|
|
labelCol: {
|
|
span: 2
|
|
},
|
|
children: /*#__PURE__*/(0,jsx_runtime.jsx)(es_switch/* default */.Z, {})
|
|
}), /*#__PURE__*/(0,jsx_runtime.jsxs)("div", {
|
|
style: {
|
|
display: "flex"
|
|
},
|
|
children: [/*#__PURE__*/(0,jsx_runtime.jsx)(es_form/* default */.Z.Item, {
|
|
name: "attachment_ids",
|
|
style: {
|
|
width: '55%'
|
|
},
|
|
label: /*#__PURE__*/(0,jsx_runtime.jsx)("div", {
|
|
style: {
|
|
textAlign: "right",
|
|
width: 82
|
|
},
|
|
children: "\u9644\u4EF6"
|
|
}),
|
|
valuePropName: "fileList",
|
|
getValueFromEvent: normFile,
|
|
children: /*#__PURE__*/(0,jsx_runtime.jsx)(upload/* default */.Z, {
|
|
action: "".concat(env/* default */.Z.API_SERVER, "/api/attachments.json"),
|
|
withCredentials: true,
|
|
listType: "picture",
|
|
children: /*#__PURE__*/(0,jsx_runtime.jsx)(ui_customization/* CustomButton */.op, {
|
|
style: {
|
|
borderRadius: "2px"
|
|
},
|
|
icon: /*#__PURE__*/(0,jsx_runtime.jsx)(UploadOutlined/* default */.Z, {}),
|
|
children: "\u4E0A\u4F20\u6587\u4EF6"
|
|
})
|
|
})
|
|
}), /*#__PURE__*/(0,jsx_runtime.jsx)(es_form/* default */.Z.Item, {
|
|
name: "cover_id",
|
|
label: "\u5C01\u9762\u56FE",
|
|
style: {
|
|
width: '45%',
|
|
marginLeft: '20px'
|
|
},
|
|
children: /*#__PURE__*/(0,jsx_runtime.jsx)(ImgUploadForm/* default */.Z, {
|
|
uploadProps: {
|
|
accept: ".jpg, .png",
|
|
beforeUpload: function beforeUpload(file) {
|
|
var fileSize = file.size / 1024 / 1024;
|
|
if (fileSize > 10) {
|
|
message/* default */.ZP.error('封面图仅支持上传文件大小10MB以下的文件。');
|
|
return upload/* default */.Z.LIST_IGNORE;
|
|
}
|
|
return true;
|
|
},
|
|
data: {
|
|
is_upload_cover: true
|
|
}
|
|
},
|
|
ButtonText: "上传图片",
|
|
ButtonOptions: {
|
|
icon: /*#__PURE__*/(0,jsx_runtime.jsx)(UploadOutlined/* default */.Z, {})
|
|
}
|
|
})
|
|
})]
|
|
})]
|
|
})
|
|
})]
|
|
}), /*#__PURE__*/(0,jsx_runtime.jsx)("div", {
|
|
className: Addmodules.footst,
|
|
children: /*#__PURE__*/(0,jsx_runtime.jsxs)("div", {
|
|
style: {
|
|
width: 1200,
|
|
margin: '0px auto',
|
|
display: 'flex',
|
|
alignItems: 'center',
|
|
justifyContent: 'space-between',
|
|
height: '100%'
|
|
},
|
|
children: [/*#__PURE__*/(0,jsx_runtime.jsx)(es_button/* default */.ZP, {
|
|
onClick: function onClick() {
|
|
_umi_production_exports.history.back();
|
|
},
|
|
size: "large",
|
|
className: "canclebtn",
|
|
children: "\u8FD4\u56DE"
|
|
}), /*#__PURE__*/(0,jsx_runtime.jsx)(es_button/* default */.ZP, {
|
|
onClick: function onClick() {
|
|
form.submit();
|
|
},
|
|
style: {
|
|
marginLeft: 10
|
|
},
|
|
className: "confirmbtn",
|
|
type: "primary",
|
|
size: "large",
|
|
children: "\u786E\u8BA4\u65B0\u5EFA"
|
|
})]
|
|
})
|
|
})]
|
|
});
|
|
};
|
|
/* harmony default export */ var Add = ((0,_umi_production_exports.connect)(function (_ref3) {
|
|
var homePage = _ref3.homePage,
|
|
loading = _ref3.loading,
|
|
globalSetting = _ref3.globalSetting,
|
|
user = _ref3.user;
|
|
return {
|
|
homePage: homePage,
|
|
globalSetting: globalSetting,
|
|
loading: loading.models.homePage,
|
|
user: user
|
|
};
|
|
})(IndexPage));
|
|
|
|
/***/ })
|
|
|
|
}]); |