|
|
|
|
@ -546,10 +546,10 @@ var AddOrEdit = function AddOrEdit(_ref) {
|
|
|
|
|
_useState4 = slicedToArray_default()(_useState3, 2),
|
|
|
|
|
imgLoading = _useState4[0],
|
|
|
|
|
setImgLoading = _useState4[1];
|
|
|
|
|
var _useState5 = (0,_react_17_0_2_react.useState)('fj'),
|
|
|
|
|
var _useState5 = (0,_react_17_0_2_react.useState)(false),
|
|
|
|
|
_useState6 = slicedToArray_default()(_useState5, 2),
|
|
|
|
|
sctype = _useState6[0],
|
|
|
|
|
setsctype = _useState6[1];
|
|
|
|
|
isLink = _useState6[0],
|
|
|
|
|
setIsLink = _useState6[1];
|
|
|
|
|
var _useState7 = (0,_react_17_0_2_react.useState)([]),
|
|
|
|
|
_useState8 = slicedToArray_default()(_useState7, 2),
|
|
|
|
|
news_event_tags = _useState8[0],
|
|
|
|
|
@ -580,12 +580,14 @@ var AddOrEdit = function AddOrEdit(_ref) {
|
|
|
|
|
political_point_ids: currentItem === null || currentItem === void 0 ? void 0 : currentItem.political_point_ids,
|
|
|
|
|
embodiment_ids: currentItem === null || currentItem === void 0 ? void 0 : currentItem.embodiment_ids,
|
|
|
|
|
material_type_id: currentItem === null || currentItem === void 0 ? void 0 : currentItem.material_type_id,
|
|
|
|
|
is_link: currentItem === null || currentItem === void 0 ? void 0 : currentItem.is_link,
|
|
|
|
|
link: currentItem === null || currentItem === void 0 ? void 0 : currentItem.link,
|
|
|
|
|
tags: '',
|
|
|
|
|
attachment_id: (currentItem === null || currentItem === void 0 ? void 0 : currentItem.attachment) && (0,MultiUpload/* coverToFileList */.z)([currentItem === null || currentItem === void 0 ? void 0 : currentItem.attachment]) || ''
|
|
|
|
|
});
|
|
|
|
|
setnews_event_tags(currentItem === null || currentItem === void 0 ? void 0 : currentItem.tags);
|
|
|
|
|
} else {
|
|
|
|
|
form.setFieldValue('attachment_type', 'fj');
|
|
|
|
|
form.setFieldValue('is_link', false);
|
|
|
|
|
}
|
|
|
|
|
case 4:
|
|
|
|
|
case "end":
|
|
|
|
|
@ -642,7 +644,7 @@ var AddOrEdit = function AddOrEdit(_ref) {
|
|
|
|
|
_context3.next = 2;
|
|
|
|
|
return form.validateFields();
|
|
|
|
|
case 2:
|
|
|
|
|
if (!(((_values$attachment_id = values.attachment_id) === null || _values$attachment_id === void 0 ? void 0 : _values$attachment_id.length) == 0)) {
|
|
|
|
|
if (!(!values.is_link && ((_values$attachment_id = values.attachment_id) === null || _values$attachment_id === void 0 ? void 0 : _values$attachment_id.length) == 0)) {
|
|
|
|
|
_context3.next = 4;
|
|
|
|
|
break;
|
|
|
|
|
}
|
|
|
|
|
@ -889,7 +891,7 @@ var AddOrEdit = function AddOrEdit(_ref) {
|
|
|
|
|
});
|
|
|
|
|
})
|
|
|
|
|
}), /*#__PURE__*/(0,jsx_runtime.jsx)(es_form/* default */.Z.Item, {
|
|
|
|
|
name: "attachment_type",
|
|
|
|
|
name: "is_link",
|
|
|
|
|
label: "\u7D20\u6750\u5F62\u5F0F",
|
|
|
|
|
rules: [{
|
|
|
|
|
required: true,
|
|
|
|
|
@ -897,29 +899,19 @@ var AddOrEdit = function AddOrEdit(_ref) {
|
|
|
|
|
}],
|
|
|
|
|
children: /*#__PURE__*/(0,jsx_runtime.jsxs)(es_radio/* default.Group */.ZP.Group, {
|
|
|
|
|
onChange: function onChange(e) {
|
|
|
|
|
setsctype(e.target.value);
|
|
|
|
|
setIsLink(e.target.value);
|
|
|
|
|
},
|
|
|
|
|
children: [/*#__PURE__*/(0,jsx_runtime.jsx)(es_radio/* default */.ZP, {
|
|
|
|
|
value: "fj",
|
|
|
|
|
value: false,
|
|
|
|
|
children: "\u9644\u4EF6"
|
|
|
|
|
}), /*#__PURE__*/(0,jsx_runtime.jsx)(es_radio/* default */.ZP, {
|
|
|
|
|
value: "wl",
|
|
|
|
|
value: true,
|
|
|
|
|
children: "\u5916\u94FE"
|
|
|
|
|
})]
|
|
|
|
|
})
|
|
|
|
|
}), sctype == 'fj' && /*#__PURE__*/(0,jsx_runtime.jsx)(es_form/* default */.Z.Item, {
|
|
|
|
|
name: "attachment_id",
|
|
|
|
|
label: "\u9644\u4EF6",
|
|
|
|
|
rules: [{
|
|
|
|
|
required: true,
|
|
|
|
|
message: '请上传附件'
|
|
|
|
|
}],
|
|
|
|
|
children: /*#__PURE__*/(0,jsx_runtime.jsx)(MultiUpload/* default */.Z, {
|
|
|
|
|
Single: true
|
|
|
|
|
})
|
|
|
|
|
}), sctype == 'wl' && /*#__PURE__*/(0,jsx_runtime.jsx)(es_form/* default */.Z.Item, {
|
|
|
|
|
}), isLink ? /*#__PURE__*/(0,jsx_runtime.jsx)(es_form/* default */.Z.Item, {
|
|
|
|
|
label: "\u5916\u94FE",
|
|
|
|
|
name: "wl",
|
|
|
|
|
name: "link",
|
|
|
|
|
rules: [{
|
|
|
|
|
required: true,
|
|
|
|
|
message: "\u8BF7\u8F93\u5165\u5916\u94FE"
|
|
|
|
|
@ -929,6 +921,16 @@ var AddOrEdit = function AddOrEdit(_ref) {
|
|
|
|
|
maxLength: 200,
|
|
|
|
|
placeholder: "\u8BF7\u8F93\u5165\u5916\u94FE"
|
|
|
|
|
})
|
|
|
|
|
}) : /*#__PURE__*/(0,jsx_runtime.jsx)(es_form/* default */.Z.Item, {
|
|
|
|
|
name: "attachment_id",
|
|
|
|
|
label: "\u9644\u4EF6",
|
|
|
|
|
rules: [{
|
|
|
|
|
required: true,
|
|
|
|
|
message: '请上传附件'
|
|
|
|
|
}],
|
|
|
|
|
children: /*#__PURE__*/(0,jsx_runtime.jsx)(MultiUpload/* default */.Z, {
|
|
|
|
|
Single: true
|
|
|
|
|
})
|
|
|
|
|
})]
|
|
|
|
|
})
|
|
|
|
|
});
|