|
|
|
|
@ -596,8 +596,10 @@ var jsx_runtime = __webpack_require__(37712);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
var RangePicker = date_picker["default"].RangePicker;
|
|
|
|
|
var Navigation = function Navigation(_ref) {
|
|
|
|
|
var _user$userInfo;
|
|
|
|
|
var loading = _ref.loading,
|
|
|
|
|
user = _ref.user,
|
|
|
|
|
dispatch = _ref.dispatch,
|
|
|
|
|
@ -698,92 +700,94 @@ var Navigation = function Navigation(_ref) {
|
|
|
|
|
fontSize: '20px'
|
|
|
|
|
},
|
|
|
|
|
children: detail === null || detail === void 0 ? void 0 : detail.title
|
|
|
|
|
}), /*#__PURE__*/(0,jsx_runtime.jsx)("i", {
|
|
|
|
|
onClick: function onClick() {
|
|
|
|
|
setaddmodal(true);
|
|
|
|
|
modifyForm.setFieldsValue(objectSpread2_default()(objectSpread2_default()({}, detail), {}, {
|
|
|
|
|
attachment_ids: (0,MultiUpload/* coverToFileList */.z)(detail === null || detail === void 0 ? void 0 : detail.attachments)
|
|
|
|
|
}));
|
|
|
|
|
},
|
|
|
|
|
className: "iconfont icon-bianji14"
|
|
|
|
|
}), /*#__PURE__*/(0,jsx_runtime.jsx)("i", {
|
|
|
|
|
onClick: function onClick() {
|
|
|
|
|
modal/* default */.Z.confirm({
|
|
|
|
|
title: '提示',
|
|
|
|
|
centered: true,
|
|
|
|
|
icon: null,
|
|
|
|
|
content: '是否确认删除',
|
|
|
|
|
onOk: function () {
|
|
|
|
|
var _onOk = asyncToGenerator_default()( /*#__PURE__*/regeneratorRuntime_default()().mark(function _callee() {
|
|
|
|
|
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/tools/".concat(detail === null || detail === void 0 ? void 0 : detail.id, ".json"), {
|
|
|
|
|
method: 'DELETE'
|
|
|
|
|
});
|
|
|
|
|
case 2:
|
|
|
|
|
res = _context.sent;
|
|
|
|
|
if ((res === null || res === void 0 ? void 0 : res.status) === 0) {
|
|
|
|
|
message/* default */.ZP.info('删除成功'), _umi_production_exports.history.back();
|
|
|
|
|
}
|
|
|
|
|
case 4:
|
|
|
|
|
case "end":
|
|
|
|
|
return _context.stop();
|
|
|
|
|
}
|
|
|
|
|
}, _callee);
|
|
|
|
|
}));
|
|
|
|
|
function onOk() {
|
|
|
|
|
return _onOk.apply(this, arguments);
|
|
|
|
|
}
|
|
|
|
|
return onOk;
|
|
|
|
|
}()
|
|
|
|
|
});
|
|
|
|
|
},
|
|
|
|
|
style: {
|
|
|
|
|
margin: '0px 20px'
|
|
|
|
|
},
|
|
|
|
|
className: "iconfont icon-shanchutimu"
|
|
|
|
|
}), /*#__PURE__*/(0,jsx_runtime.jsx)(es_button/* default */.ZP, {
|
|
|
|
|
onClick: function onClick() {
|
|
|
|
|
modal/* default */.Z.confirm({
|
|
|
|
|
title: '提示',
|
|
|
|
|
centered: true,
|
|
|
|
|
icon: null,
|
|
|
|
|
content: "\u662F\u5426\u786E\u8BA4".concat((detail === null || detail === void 0 ? void 0 : detail.status) === 'un_public' ? '公开' : "取消公开"),
|
|
|
|
|
onOk: function () {
|
|
|
|
|
var _onOk2 = asyncToGenerator_default()( /*#__PURE__*/regeneratorRuntime_default()().mark(function _callee2() {
|
|
|
|
|
var res;
|
|
|
|
|
return regeneratorRuntime_default()().wrap(function _callee2$(_context2) {
|
|
|
|
|
while (1) switch (_context2.prev = _context2.next) {
|
|
|
|
|
case 0:
|
|
|
|
|
_context2.next = 2;
|
|
|
|
|
return (0,fetch/* default */.ZP)("/api/tools/".concat(detail.id, "/change_status.json"), {
|
|
|
|
|
method: 'POST',
|
|
|
|
|
body: {
|
|
|
|
|
status: (detail === null || detail === void 0 ? void 0 : detail.status) === 'un_public' ? 'is_public' : 'un_public'
|
|
|
|
|
}), (user === null || user === void 0 || (_user$userInfo = user.userInfo) === null || _user$userInfo === void 0 ? void 0 : _user$userInfo.identity) !== 'student' && /*#__PURE__*/(0,jsx_runtime.jsxs)(jsx_runtime.Fragment, {
|
|
|
|
|
children: [/*#__PURE__*/(0,jsx_runtime.jsx)("i", {
|
|
|
|
|
onClick: function onClick() {
|
|
|
|
|
setaddmodal(true);
|
|
|
|
|
modifyForm.setFieldsValue(objectSpread2_default()(objectSpread2_default()({}, detail), {}, {
|
|
|
|
|
attachment_ids: (0,MultiUpload/* coverToFileList */.z)(detail === null || detail === void 0 ? void 0 : detail.attachments)
|
|
|
|
|
}));
|
|
|
|
|
},
|
|
|
|
|
className: "iconfont icon-bianji14"
|
|
|
|
|
}), /*#__PURE__*/(0,jsx_runtime.jsx)("i", {
|
|
|
|
|
onClick: function onClick() {
|
|
|
|
|
modal/* default */.Z.confirm({
|
|
|
|
|
title: '提示',
|
|
|
|
|
centered: true,
|
|
|
|
|
icon: null,
|
|
|
|
|
content: '是否确认删除',
|
|
|
|
|
onOk: function () {
|
|
|
|
|
var _onOk = asyncToGenerator_default()( /*#__PURE__*/regeneratorRuntime_default()().mark(function _callee() {
|
|
|
|
|
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/tools/".concat(detail === null || detail === void 0 ? void 0 : detail.id, ".json"), {
|
|
|
|
|
method: 'DELETE'
|
|
|
|
|
});
|
|
|
|
|
case 2:
|
|
|
|
|
res = _context.sent;
|
|
|
|
|
if ((res === null || res === void 0 ? void 0 : res.status) === 0) {
|
|
|
|
|
message/* default */.ZP.info('删除成功'), _umi_production_exports.history.back();
|
|
|
|
|
}
|
|
|
|
|
});
|
|
|
|
|
case 2:
|
|
|
|
|
res = _context2.sent;
|
|
|
|
|
if ((res === null || res === void 0 ? void 0 : res.status) === 0) {
|
|
|
|
|
message/* default */.ZP.info('状态更新成功'), getdetail();
|
|
|
|
|
}
|
|
|
|
|
case 4:
|
|
|
|
|
case "end":
|
|
|
|
|
return _context2.stop();
|
|
|
|
|
}
|
|
|
|
|
}, _callee2);
|
|
|
|
|
}));
|
|
|
|
|
function onOk() {
|
|
|
|
|
return _onOk2.apply(this, arguments);
|
|
|
|
|
}
|
|
|
|
|
return onOk;
|
|
|
|
|
}()
|
|
|
|
|
});
|
|
|
|
|
},
|
|
|
|
|
children: (detail === null || detail === void 0 ? void 0 : detail.status) === 'un_public' ? '公开' : "取消公开"
|
|
|
|
|
case 4:
|
|
|
|
|
case "end":
|
|
|
|
|
return _context.stop();
|
|
|
|
|
}
|
|
|
|
|
}, _callee);
|
|
|
|
|
}));
|
|
|
|
|
function onOk() {
|
|
|
|
|
return _onOk.apply(this, arguments);
|
|
|
|
|
}
|
|
|
|
|
return onOk;
|
|
|
|
|
}()
|
|
|
|
|
});
|
|
|
|
|
},
|
|
|
|
|
style: {
|
|
|
|
|
margin: '0px 20px'
|
|
|
|
|
},
|
|
|
|
|
className: "iconfont icon-shanchutimu"
|
|
|
|
|
}), /*#__PURE__*/(0,jsx_runtime.jsx)(es_button/* default */.ZP, {
|
|
|
|
|
onClick: function onClick() {
|
|
|
|
|
modal/* default */.Z.confirm({
|
|
|
|
|
title: '提示',
|
|
|
|
|
centered: true,
|
|
|
|
|
icon: null,
|
|
|
|
|
content: "\u662F\u5426\u786E\u8BA4".concat((detail === null || detail === void 0 ? void 0 : detail.status) === 'un_public' ? '公开' : "取消公开"),
|
|
|
|
|
onOk: function () {
|
|
|
|
|
var _onOk2 = asyncToGenerator_default()( /*#__PURE__*/regeneratorRuntime_default()().mark(function _callee2() {
|
|
|
|
|
var res;
|
|
|
|
|
return regeneratorRuntime_default()().wrap(function _callee2$(_context2) {
|
|
|
|
|
while (1) switch (_context2.prev = _context2.next) {
|
|
|
|
|
case 0:
|
|
|
|
|
_context2.next = 2;
|
|
|
|
|
return (0,fetch/* default */.ZP)("/api/tools/".concat(detail.id, "/change_status.json"), {
|
|
|
|
|
method: 'POST',
|
|
|
|
|
body: {
|
|
|
|
|
status: (detail === null || detail === void 0 ? void 0 : detail.status) === 'un_public' ? 'is_public' : 'un_public'
|
|
|
|
|
}
|
|
|
|
|
});
|
|
|
|
|
case 2:
|
|
|
|
|
res = _context2.sent;
|
|
|
|
|
if ((res === null || res === void 0 ? void 0 : res.status) === 0) {
|
|
|
|
|
message/* default */.ZP.info('状态更新成功'), getdetail();
|
|
|
|
|
}
|
|
|
|
|
case 4:
|
|
|
|
|
case "end":
|
|
|
|
|
return _context2.stop();
|
|
|
|
|
}
|
|
|
|
|
}, _callee2);
|
|
|
|
|
}));
|
|
|
|
|
function onOk() {
|
|
|
|
|
return _onOk2.apply(this, arguments);
|
|
|
|
|
}
|
|
|
|
|
return onOk;
|
|
|
|
|
}()
|
|
|
|
|
});
|
|
|
|
|
},
|
|
|
|
|
children: (detail === null || detail === void 0 ? void 0 : detail.status) === 'un_public' ? '公开' : "取消公开"
|
|
|
|
|
})]
|
|
|
|
|
})]
|
|
|
|
|
}), /*#__PURE__*/(0,jsx_runtime.jsx)(divider/* default */.Z, {}), /*#__PURE__*/(0,jsx_runtime.jsx)(RenderHtml/* default */.Z, {
|
|
|
|
|
value: (detail === null || detail === void 0 ? void 0 : detail.description) || ''
|