|
|
|
|
@ -107,25 +107,25 @@ var Message = function Message(_ref) {
|
|
|
|
|
}, [isEdit, data]);
|
|
|
|
|
var handleFinish = /*#__PURE__*/function () {
|
|
|
|
|
var _ref2 = asyncToGenerator_default()( /*#__PURE__*/regeneratorRuntime_default()().mark(function _callee(values) {
|
|
|
|
|
var _values$attachment_id, _values$attachment_id2, type, res;
|
|
|
|
|
var _values$attachment_id, fileExtensions, res;
|
|
|
|
|
return regeneratorRuntime_default()().wrap(function _callee$(_context) {
|
|
|
|
|
while (1) switch (_context.prev = _context.next) {
|
|
|
|
|
case 0:
|
|
|
|
|
if (values.attachment_ids) {
|
|
|
|
|
console.log('attachment_ids--', values.attachment_ids);
|
|
|
|
|
values.attachment_ids = values === null || values === void 0 || (_values$attachment_id = values.attachment_ids) === null || _values$attachment_id === void 0 ? void 0 : _values$attachment_id.map(function (v) {
|
|
|
|
|
var _v$response;
|
|
|
|
|
return v === null || v === void 0 || (_v$response = v.response) === null || _v$response === void 0 ? void 0 : _v$response.id;
|
|
|
|
|
// 使用正则表达式提取文件后缀
|
|
|
|
|
fileExtensions = values.attachment_ids.map(function (t) {
|
|
|
|
|
return t.match(/[^.]+$/)[0];
|
|
|
|
|
});
|
|
|
|
|
type = values === null || values === void 0 || (_values$attachment_id2 = values.attachment_ids) === null || _values$attachment_id2 === void 0 ? void 0 : _values$attachment_id2.map(function (v) {
|
|
|
|
|
return v === null || v === void 0 ? void 0 : v.type;
|
|
|
|
|
});
|
|
|
|
|
console.log("type", type);
|
|
|
|
|
if (type.includes('video/mp4')) {
|
|
|
|
|
console.log("fileExtensions", fileExtensions);
|
|
|
|
|
if (fileExtensions.includes('mp4')) {
|
|
|
|
|
values.category = 'video';
|
|
|
|
|
} else {
|
|
|
|
|
values.category = 'information';
|
|
|
|
|
}
|
|
|
|
|
values.attachment_ids = values === null || values === void 0 || (_values$attachment_id = values.attachment_ids) === null || _values$attachment_id === void 0 ? void 0 : _values$attachment_id.map(function (v) {
|
|
|
|
|
var _v$response;
|
|
|
|
|
return v === null || v === void 0 || (_v$response = v.response) === null || _v$response === void 0 ? void 0 : _v$response.id;
|
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
setLoading(true);
|
|
|
|
|
if (!isEdit) {
|
|
|
|
|
@ -375,7 +375,7 @@ var Detail_Message = function Message(_ref) {
|
|
|
|
|
children: [/*#__PURE__*/(0,jsx_runtime.jsx)("div", {
|
|
|
|
|
className: Detailmodules.header,
|
|
|
|
|
style: {
|
|
|
|
|
backgroundImage: know !== null && know !== void 0 && (_know$top_bg_image = know.top_bg_image) !== null && _know$top_bg_image !== void 0 && _know$top_bg_image.url ? "url(".concat(know === null || know === void 0 || (_know$top_bg_image2 = know.top_bg_image) === null || _know$top_bg_image2 === void 0 ? void 0 : _know$top_bg_image2.url, ")") : "url('/api/attachments/27491199')"
|
|
|
|
|
backgroundImage: (know === null || know === void 0 || (_know$top_bg_image = know.top_bg_image) === null || _know$top_bg_image === void 0 ? void 0 : _know$top_bg_image.url) && "url(".concat(know === null || know === void 0 || (_know$top_bg_image2 = know.top_bg_image) === null || _know$top_bg_image2 === void 0 ? void 0 : _know$top_bg_image2.url, "})")
|
|
|
|
|
},
|
|
|
|
|
children: /*#__PURE__*/(0,jsx_runtime.jsxs)("div", {
|
|
|
|
|
className: Detailmodules.core,
|
|
|
|
|
@ -450,10 +450,10 @@ var Detail_Message = function Message(_ref) {
|
|
|
|
|
id: null,
|
|
|
|
|
name: "全部"
|
|
|
|
|
}, {
|
|
|
|
|
id: 2,
|
|
|
|
|
id: 1,
|
|
|
|
|
name: "视频"
|
|
|
|
|
}, {
|
|
|
|
|
id: 1,
|
|
|
|
|
id: 2,
|
|
|
|
|
name: "资料"
|
|
|
|
|
}],
|
|
|
|
|
titleWidth: 80
|