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.
2156 lines
98 KiB
2156 lines
98 KiB
"use strict";
|
|
(self["webpackChunk"] = self["webpackChunk"] || []).push([[15382],{
|
|
|
|
/***/ 2853:
|
|
/*!********************************************************!*\
|
|
!*** ./src/pages/DataSet/Detail/index.tsx + 6 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 */ Detail; }
|
|
});
|
|
|
|
// 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: ./src/.umi-production/exports.ts
|
|
var _umi_production_exports = __webpack_require__(5841);
|
|
// EXTERNAL MODULE: ./node_modules/_antd@5.9.0@antd/es/spin/index.js + 1 modules
|
|
var spin = __webpack_require__(71418);
|
|
// EXTERNAL MODULE: ./node_modules/_antd@5.9.0@antd/es/breadcrumb/index.js + 6 modules
|
|
var breadcrumb = __webpack_require__(66104);
|
|
// EXTERNAL MODULE: ./node_modules/_antd@5.9.0@antd/es/tooltip/index.js + 3 modules
|
|
var tooltip = __webpack_require__(6848);
|
|
// 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/checkbox/index.js + 3 modules
|
|
var es_checkbox = __webpack_require__(24905);
|
|
// 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/dropdown/index.js + 1 modules
|
|
var dropdown = __webpack_require__(38854);
|
|
// EXTERNAL MODULE: ./node_modules/_antd@5.9.0@antd/es/radio/index.js + 5 modules
|
|
var es_radio = __webpack_require__(5112);
|
|
;// CONCATENATED MODULE: ./src/pages/DataSet/Detail/index.less?modules
|
|
// extracted by mini-css-extract-plugin
|
|
/* harmony default export */ var Detailmodules = ({"flex_box_center":"flex_box_center___eNs_C","flex_space_between":"flex_space_between___oJc0d","flex_box_vertical_center":"flex_box_vertical_center___MoDEY","flex_box_center_end":"flex_box_center_end___BtlAV","flex_box_column":"flex_box_column___nUGZ8","bg":"bg___kj21E","wrap":"wrap___TtbC8","leftContent":"leftContent___FGaJd","header":"header___kobCa","headerBack":"headerBack___TI5PF","title":"title___B5Aew","time":"time___Ab938","introduction":"introduction___JKUBJ","from":"from___WId6_","bottom":"bottom___Expju","user_img":"user_img___igguI","user_name":"user_name___xNcx6","tags_name":"tags_name___xhTee","buttonList":"buttonList___ayDi1","buttonItem":"buttonItem___p_BX_","rightContent":"rightContent___XTwKA","share":"share___o0Kxt","publicStyle":"publicStyle___I8HuS","more":"more___ZQSDV","collectStyle":"collectStyle___FwPiJ","collectActiveStyle":"collectActiveStyle___vbqkD","content":"content___dl660","addTypeRadio":"addTypeRadio___iEl2Y","addBtn":"addBtn___SYc61","shixunTooltip":"shixunTooltip___krR3m","pageStyle":"pageStyle___UXmCF","pageCan":"pageCan___yNiQI","pageUnCan":"pageUnCan___M1D84","dropList":"dropList___KP6TZ","dropName":"dropName___hgrPU"});
|
|
// EXTERNAL MODULE: ./src/utils/env.ts + 1 modules
|
|
var env = __webpack_require__(43873);
|
|
;// CONCATENATED MODULE: ./src/pages/DataSet/Detail/DataInfo/index.less?modules
|
|
// extracted by mini-css-extract-plugin
|
|
/* harmony default export */ var DataInfomodules = ({"flex_box_center":"flex_box_center___Kaphe","flex_space_between":"flex_space_between___dzJWD","flex_box_vertical_center":"flex_box_vertical_center___iwu7i","flex_box_center_end":"flex_box_center_end___izksF","flex_box_column":"flex_box_column___ntJPh","content":"content___gDHym","addTypeRadio":"addTypeRadio___oUKH0","introduceNoData":"introduceNoData___iILly","introduceAdd":"introduceAdd___v9keU","introduceText":"introduceText___iTf1W","introduceButton":"introduceButton___bwZMR","close":"close___csBZw","submit":"submit___SQ6af","introduceContent":"introduceContent___Yad8G","introduceTitle":"introduceTitle___DfmXh","introContentWrap":"introContentWrap___bmjAL","action":"action___DPbIq","fileTable":"fileTable___xqsXc"});
|
|
// EXTERNAL MODULE: ./src/components/markdown-editor/index.tsx + 10 modules
|
|
var markdown_editor = __webpack_require__(37707);
|
|
// EXTERNAL MODULE: ./src/components/RenderHtml/index.tsx + 2 modules
|
|
var RenderHtml = __webpack_require__(64692);
|
|
// 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/table/index.js + 85 modules
|
|
var table = __webpack_require__(1710);
|
|
// EXTERNAL MODULE: ./node_modules/_antd@5.9.0@antd/es/input/index.js + 5 modules
|
|
var input = __webpack_require__(10249);
|
|
// EXTERNAL MODULE: ./src/service/dataset.ts
|
|
var dataset = __webpack_require__(77414);
|
|
// EXTERNAL MODULE: ./node_modules/_dayjs@1.11.13@dayjs/dayjs.min.js
|
|
var dayjs_min = __webpack_require__(61186);
|
|
var dayjs_min_default = /*#__PURE__*/__webpack_require__.n(dayjs_min);
|
|
// EXTERNAL MODULE: ./src/utils/util.tsx
|
|
var util = __webpack_require__(11919);
|
|
// EXTERNAL MODULE: ./node_modules/_antd@5.9.0@antd/es/input/TextArea.js
|
|
var TextArea = __webpack_require__(1643);
|
|
// EXTERNAL MODULE: ./node_modules/_react@17.0.2@react/jsx-runtime.js
|
|
var jsx_runtime = __webpack_require__(37712);
|
|
;// CONCATENATED MODULE: ./src/pages/DataSet/Detail/DataInfo/index.tsx
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
var PollDetail = function PollDetail(_ref) {
|
|
var polls = _ref.polls,
|
|
globalSetting = _ref.globalSetting,
|
|
loading = _ref.loading,
|
|
dispatch = _ref.dispatch,
|
|
user = _ref.user,
|
|
dataSetInfo = _ref.dataSetInfo,
|
|
indexType = _ref.indexType,
|
|
getInfo = _ref.getInfo;
|
|
var params = (0,_umi_production_exports.useParams)();
|
|
var _useState = (0,_react_17_0_2_react.useState)(false),
|
|
_useState2 = slicedToArray_default()(_useState, 2),
|
|
showMdEditro = _useState2[0],
|
|
setShowMdEditro = _useState2[1];
|
|
var _useState3 = (0,_react_17_0_2_react.useState)(0),
|
|
_useState4 = slicedToArray_default()(_useState3, 2),
|
|
show = _useState4[0],
|
|
setShow = _useState4[1];
|
|
var tagsRef = (0,_react_17_0_2_react.useRef)(null);
|
|
var scrollRef = (0,_react_17_0_2_react.useRef)(null);
|
|
var _useState5 = (0,_react_17_0_2_react.useState)(''),
|
|
_useState6 = slicedToArray_default()(_useState5, 2),
|
|
contentData = _useState6[0],
|
|
setContentData = _useState6[1];
|
|
var _useState7 = (0,_react_17_0_2_react.useState)(''),
|
|
_useState8 = slicedToArray_default()(_useState7, 2),
|
|
introduce = _useState8[0],
|
|
setIntroduce = _useState8[1];
|
|
var _Form$useForm = es_form/* default */.Z.useForm(),
|
|
_Form$useForm2 = slicedToArray_default()(_Form$useForm, 1),
|
|
form = _Form$useForm2[0];
|
|
(0,_react_17_0_2_react.useEffect)(function () {
|
|
var _tagsRef$current;
|
|
if ((tagsRef === null || tagsRef === void 0 || (_tagsRef$current = tagsRef.current) === null || _tagsRef$current === void 0 ? void 0 : _tagsRef$current.clientHeight) > 80) {
|
|
setShow(1);
|
|
} else {
|
|
setShow(0);
|
|
}
|
|
}, [contentData]);
|
|
(0,_react_17_0_2_react.useEffect)(function () {
|
|
//进来后把介绍赋值
|
|
setContentData(dataSetInfo === null || dataSetInfo === void 0 ? void 0 : dataSetInfo.introduce);
|
|
setIntroduce(dataSetInfo === null || dataSetInfo === void 0 ? void 0 : dataSetInfo.introduce);
|
|
}, [dataSetInfo === null || dataSetInfo === void 0 ? void 0 : dataSetInfo.introduce]);
|
|
return /*#__PURE__*/(0,jsx_runtime.jsxs)("div", {
|
|
className: DataInfomodules.content,
|
|
children: [!showMdEditro && !contentData && indexType && /*#__PURE__*/(0,jsx_runtime.jsxs)("div", {
|
|
className: DataInfomodules.introduceNoData,
|
|
onClick: function onClick() {
|
|
setShowMdEditro(true);
|
|
},
|
|
children: [/*#__PURE__*/(0,jsx_runtime.jsxs)("div", {
|
|
className: DataInfomodules.introduceAdd,
|
|
children: [/*#__PURE__*/(0,jsx_runtime.jsx)("i", {
|
|
className: "icon icon-tianjia4 mr5 font12"
|
|
}), " \u6DFB\u52A0\u6570\u636E\u96C6\u4ECB\u7ECD"]
|
|
}), /*#__PURE__*/(0,jsx_runtime.jsx)("div", {
|
|
className: DataInfomodules.introduceText,
|
|
children: "\u8BA9\u4F60\u7684\u6570\u636E\u96C6\u66F4\u53D7\u6B22\u8FCE"
|
|
})]
|
|
}), !showMdEditro && contentData && /*#__PURE__*/(0,jsx_runtime.jsxs)("div", {
|
|
className: DataInfomodules.introduceContent,
|
|
children: [/*#__PURE__*/(0,jsx_runtime.jsxs)("div", {
|
|
className: DataInfomodules.introduceTitle,
|
|
children: ["\u6570\u636E\u96C6\u4ECB\u7ECD", indexType && /*#__PURE__*/(0,jsx_runtime.jsx)("i", {
|
|
className: "icon icon-bianji9 font14 ml10",
|
|
style: {
|
|
color: '#3061D0',
|
|
cursor: 'pointer'
|
|
},
|
|
onClick: function onClick() {
|
|
setShowMdEditro(true);
|
|
}
|
|
})]
|
|
}), /*#__PURE__*/(0,jsx_runtime.jsx)("div", {
|
|
className: DataInfomodules.introContentWrap,
|
|
children: /*#__PURE__*/(0,jsx_runtime.jsxs)("div", {
|
|
children: [/*#__PURE__*/(0,jsx_runtime.jsx)("div", {
|
|
ref: scrollRef,
|
|
style: show > 0 ? {
|
|
height: show === 1 ? 80 : 'auto',
|
|
overflow: show === 1 ? 'hidden' : 'auto'
|
|
} : {
|
|
paddingRight: 0
|
|
},
|
|
children: /*#__PURE__*/(0,jsx_runtime.jsx)("div", {
|
|
ref: tagsRef,
|
|
children: /*#__PURE__*/(0,jsx_runtime.jsx)(RenderHtml/* default */.Z, {
|
|
value: contentData,
|
|
style: {
|
|
fontSize: '14px'
|
|
}
|
|
})
|
|
})
|
|
}), !!show && /*#__PURE__*/(0,jsx_runtime.jsx)(_react_17_0_2_react.Fragment, {
|
|
children: show === 1 ? /*#__PURE__*/(0,jsx_runtime.jsxs)("div", {
|
|
onClick: function onClick() {
|
|
setShow(2);
|
|
},
|
|
className: DataInfomodules.action,
|
|
children: ["\u5C55\u5F00", /*#__PURE__*/(0,jsx_runtime.jsx)("i", {
|
|
className: "iconfont icon-zhankaixiaojiantou",
|
|
style: {
|
|
fontSize: '10px',
|
|
marginLeft: '3px'
|
|
}
|
|
})]
|
|
}) : /*#__PURE__*/(0,jsx_runtime.jsxs)("div", {
|
|
onClick: function onClick() {
|
|
setShow(1);
|
|
},
|
|
className: DataInfomodules.action,
|
|
children: ["\u6536\u8D77", /*#__PURE__*/(0,jsx_runtime.jsx)("i", {
|
|
className: "iconfont icon-shouqixiaojiantou",
|
|
style: {
|
|
fontSize: '10px',
|
|
marginLeft: '3px'
|
|
}
|
|
})]
|
|
})
|
|
})]
|
|
})
|
|
})]
|
|
}), showMdEditro && /*#__PURE__*/(0,jsx_runtime.jsxs)("div", {
|
|
style: {
|
|
marginTop: '30px'
|
|
},
|
|
children: [/*#__PURE__*/(0,jsx_runtime.jsx)(markdown_editor/* default */.Z, {
|
|
watch: true,
|
|
onChange: function onChange(value) {
|
|
setIntroduce(value);
|
|
},
|
|
defaultValue: introduce,
|
|
placeholder: "\u8BF7\u5728\u6B64\u8F93\u5165\u5185\u5BB9\uFF0C\u6700\u591A5000\u4E2A\u5B57\u7B26"
|
|
}), /*#__PURE__*/(0,jsx_runtime.jsxs)("div", {
|
|
className: DataInfomodules.introduceButton,
|
|
children: [/*#__PURE__*/(0,jsx_runtime.jsx)("div", {
|
|
className: DataInfomodules.close,
|
|
onClick: function onClick(e) {
|
|
e.stopPropagation();
|
|
setShowMdEditro(false);
|
|
},
|
|
children: "\u53D6\u6D88"
|
|
}), /*#__PURE__*/(0,jsx_runtime.jsx)("div", {
|
|
className: DataInfomodules.submit,
|
|
onClick: function onClick(e) {
|
|
e.stopPropagation();
|
|
(0,dataset/* edit_introduce */.R2)({
|
|
id: params === null || params === void 0 ? void 0 : params.id,
|
|
introduce: introduce
|
|
}).then(function (res) {
|
|
if ((res === null || res === void 0 ? void 0 : res.status) == 0) {
|
|
message/* default */.ZP.success('操作成功');
|
|
setShowMdEditro(false);
|
|
getInfo(true);
|
|
}
|
|
});
|
|
},
|
|
children: "\u786E\u8BA4"
|
|
})]
|
|
})]
|
|
}), /*#__PURE__*/(0,jsx_runtime.jsx)("div", {
|
|
className: DataInfomodules.fileTable,
|
|
children: "\u6587\u4EF6\u5217\u8868"
|
|
}), /*#__PURE__*/(0,jsx_runtime.jsx)(table/* default */.Z, {
|
|
dataSource: dataSetInfo === null || dataSetInfo === void 0 ? void 0 : dataSetInfo.attachments,
|
|
pagination: false,
|
|
style: {
|
|
marginTop: '20px'
|
|
},
|
|
scroll: {
|
|
y: 300
|
|
},
|
|
columns: [{
|
|
title: '文件',
|
|
align: 'left',
|
|
width: 400,
|
|
dataIndex: 'title',
|
|
ellipsis: true
|
|
}, {
|
|
title: '备注',
|
|
align: 'left',
|
|
dataIndex: 'description',
|
|
ellipsis: true
|
|
}, {
|
|
title: '创建时间',
|
|
align: 'left',
|
|
ellipsis: true,
|
|
dataIndex: 'created_on',
|
|
render: function render(text) {
|
|
return /*#__PURE__*/(0,jsx_runtime.jsx)("span", {
|
|
style: {
|
|
color: '#666666'
|
|
},
|
|
children: text ? dayjs_min_default()(text).format('YYYY-MM-DD') : '--'
|
|
});
|
|
}
|
|
}, {
|
|
title: '文件大小',
|
|
align: 'left',
|
|
dataIndex: 'filesize',
|
|
ellipsis: true
|
|
}, {
|
|
title: '操作',
|
|
align: 'right',
|
|
dataIndex: 'role',
|
|
width: indexType ? 130 : 60,
|
|
render: function render(text, items, index) {
|
|
return /*#__PURE__*/(0,jsx_runtime.jsx)("span", {
|
|
style: {
|
|
color: '#3061D0'
|
|
},
|
|
children: /*#__PURE__*/(0,jsx_runtime.jsxs)("div", {
|
|
style: {
|
|
display: "flex"
|
|
},
|
|
children: [/*#__PURE__*/(0,jsx_runtime.jsx)("div", {
|
|
style: {
|
|
marginRight: '10px',
|
|
color: '#3061D0',
|
|
cursor: 'pointer'
|
|
},
|
|
onClick: function onClick() {
|
|
(0,util/* downLoadLink */.Nd)(items.title, items === null || items === void 0 ? void 0 : items.download_url);
|
|
},
|
|
children: "\u4E0B\u8F7D"
|
|
}), indexType && /*#__PURE__*/(0,jsx_runtime.jsx)("div", {
|
|
style: {
|
|
marginRight: '10px',
|
|
color: '#3061D0',
|
|
cursor: 'pointer'
|
|
},
|
|
onClick: function onClick() {
|
|
var _items$title, _items$title2, _items$title3, _items$title4;
|
|
var titleSuffix = items === null || items === void 0 || (_items$title = items.title) === null || _items$title === void 0 ? void 0 : _items$title.substring((items === null || items === void 0 || (_items$title2 = items.title) === null || _items$title2 === void 0 ? void 0 : _items$title2.lastIndexOf('.')) + 1); //最后一个小数点 截取 的后半部分
|
|
form.setFieldsValue({
|
|
title: items === null || items === void 0 || (_items$title3 = items.title) === null || _items$title3 === void 0 ? void 0 : _items$title3.substring(0, items === null || items === void 0 || (_items$title4 = items.title) === null || _items$title4 === void 0 ? void 0 : _items$title4.lastIndexOf('.')),
|
|
//最后一个小数点 截取 的前半部分
|
|
description: items === null || items === void 0 ? void 0 : items.description
|
|
});
|
|
modal/* default */.Z.confirm({
|
|
icon: null,
|
|
title: '编辑',
|
|
width: 700,
|
|
centered: true,
|
|
content: /*#__PURE__*/(0,jsx_runtime.jsx)("div", {
|
|
children: /*#__PURE__*/(0,jsx_runtime.jsxs)(es_form/* default */.Z, {
|
|
form: form,
|
|
colon: false,
|
|
labelCol: {
|
|
span: 3
|
|
},
|
|
style: {
|
|
marginBottom: '-20px'
|
|
},
|
|
wrapperCol: {
|
|
span: 21
|
|
},
|
|
children: [/*#__PURE__*/(0,jsx_runtime.jsx)(es_form/* default */.Z.Item, {
|
|
label: "\u6587\u4EF6\u540D\u79F0",
|
|
name: "title",
|
|
rules: [{
|
|
required: true,
|
|
message: '必填项'
|
|
}],
|
|
children: /*#__PURE__*/(0,jsx_runtime.jsx)(input/* default */.Z, {
|
|
placeholder: "\u6587\u4EF6\u540D\u79F0\u6700\u591A\u53EF\u8F93\u516560\u5B57",
|
|
size: "large",
|
|
suffix: /*#__PURE__*/(0,jsx_runtime.jsxs)("span", {
|
|
children: [".", titleSuffix]
|
|
})
|
|
})
|
|
}), /*#__PURE__*/(0,jsx_runtime.jsx)(es_form/* default */.Z.Item, {
|
|
label: "\u5907\u6CE8",
|
|
name: "description",
|
|
children: /*#__PURE__*/(0,jsx_runtime.jsx)(TextArea/* default */.Z, {
|
|
placeholder: "\u5907\u6CE8\u8BF4\u660E\uFF0C\u6700\u591A100\u5B57",
|
|
size: "large"
|
|
})
|
|
})]
|
|
})
|
|
}),
|
|
onOk: function () {
|
|
var _onOk = asyncToGenerator_default()( /*#__PURE__*/regeneratorRuntime_default()().mark(function _callee() {
|
|
return regeneratorRuntime_default()().wrap(function _callee$(_context) {
|
|
while (1) switch (_context.prev = _context.next) {
|
|
case 0:
|
|
_context.next = 2;
|
|
return form.validateFields();
|
|
case 2:
|
|
(0,dataset/* edit_file_info */.A0)({
|
|
id: params === null || params === void 0 ? void 0 : params.id,
|
|
attachment_id: items.id,
|
|
filename: form.getFieldValue('title') + '.' + titleSuffix,
|
|
description: form.getFieldValue('description')
|
|
}).then(function (res) {
|
|
if ((res === null || res === void 0 ? void 0 : res.status) == 0) {
|
|
message/* default */.ZP.success('编辑成功');
|
|
getInfo();
|
|
}
|
|
});
|
|
case 3:
|
|
case "end":
|
|
return _context.stop();
|
|
}
|
|
}, _callee);
|
|
}));
|
|
function onOk() {
|
|
return _onOk.apply(this, arguments);
|
|
}
|
|
return onOk;
|
|
}()
|
|
});
|
|
},
|
|
children: "\u7F16\u8F91"
|
|
}), indexType && /*#__PURE__*/(0,jsx_runtime.jsx)("div", {
|
|
style: {
|
|
color: '#9096A3',
|
|
cursor: 'pointer'
|
|
},
|
|
onClick: function onClick() {
|
|
modal/* default */.Z.confirm({
|
|
icon: null,
|
|
centered: true,
|
|
title: '提示',
|
|
content: '删除数据集不会影响到引用该数据集的实践项目,但删除后数据将不可恢复,请确认是否删除',
|
|
onOk: function () {
|
|
var _onOk2 = asyncToGenerator_default()( /*#__PURE__*/regeneratorRuntime_default()().mark(function _callee2() {
|
|
return regeneratorRuntime_default()().wrap(function _callee2$(_context2) {
|
|
while (1) switch (_context2.prev = _context2.next) {
|
|
case 0:
|
|
(0,dataset/* single_destroy_files */.Il)({
|
|
attachment_id: items === null || items === void 0 ? void 0 : items.id
|
|
}).then(function (res) {
|
|
if ((res === null || res === void 0 ? void 0 : res.status) == 0) {
|
|
message/* default */.ZP.success('删除成功');
|
|
getInfo(true);
|
|
}
|
|
});
|
|
case 1:
|
|
case "end":
|
|
return _context2.stop();
|
|
}
|
|
}, _callee2);
|
|
}));
|
|
function onOk() {
|
|
return _onOk2.apply(this, arguments);
|
|
}
|
|
return onOk;
|
|
}()
|
|
});
|
|
},
|
|
children: "\u5220\u9664"
|
|
})]
|
|
})
|
|
});
|
|
}
|
|
}]
|
|
})]
|
|
});
|
|
};
|
|
/* harmony default export */ var DataInfo = ((0,_umi_production_exports.connect)(function (_ref2) {
|
|
var polls = _ref2.polls,
|
|
loading = _ref2.loading,
|
|
user = _ref2.user,
|
|
globalSetting = _ref2.globalSetting;
|
|
return {
|
|
polls: polls,
|
|
globalSetting: globalSetting,
|
|
user: user,
|
|
loading: loading.effects
|
|
};
|
|
})(PollDetail));
|
|
// 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/objectSpread2.js
|
|
var objectSpread2 = __webpack_require__(82242);
|
|
var objectSpread2_default = /*#__PURE__*/__webpack_require__.n(objectSpread2);
|
|
// EXTERNAL MODULE: ./node_modules/_@ant-design_icons@5.6.1@@ant-design/icons/es/icons/DeleteOutlined.js + 1 modules
|
|
var DeleteOutlined = __webpack_require__(26227);
|
|
// 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/button/index.js
|
|
var es_button = __webpack_require__(3113);
|
|
;// CONCATENATED MODULE: ./src/pages/DataSet/Detail/Comment/index.less?modules
|
|
// extracted by mini-css-extract-plugin
|
|
/* harmony default export */ var Commentmodules = ({"flex_box_center":"flex_box_center___kjELP","flex_space_between":"flex_space_between___IoBKu","flex_box_vertical_center":"flex_box_vertical_center___NuujF","flex_box_center_end":"flex_box_center_end___Kc5UK","flex_box_column":"flex_box_column___ebFBu","reply":"reply___xDf2z","replyList":"replyList___zMH5f","comment":"comment___qHsYF","content":"content___vTju0","commentItem":"commentItem___aGdcc","commentParItem":"commentParItem___XkqkQ","submitStyle":"submitStyle___RwXx8"});
|
|
// EXTERNAL MODULE: ./src/service/forums.ts
|
|
var forums = __webpack_require__(44096);
|
|
;// CONCATENATED MODULE: ./src/pages/DataSet/Detail/Comment/components/Second.tsx
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
dayjs_min_default().locale("ZH-cn");
|
|
function second(_ref) {
|
|
var user = _ref.user,
|
|
_ref$vlist = _ref.vlist,
|
|
vlist = _ref$vlist === void 0 ? [] : _ref$vlist,
|
|
dispatch = _ref.dispatch,
|
|
params = _ref.params,
|
|
id = _ref.id,
|
|
memo_replies = _ref.memo_replies,
|
|
forumsDetail = _ref.forumsDetail;
|
|
return /*#__PURE__*/(0,jsx_runtime.jsx)("aside", {
|
|
className: Commentmodules.comment,
|
|
children: vlist.map(function (val, key) {
|
|
var _user$userInfo, _user$userInfo2;
|
|
return /*#__PURE__*/(0,jsx_runtime.jsxs)(row/* default */.Z, {
|
|
className: Commentmodules.commentItem,
|
|
children: [/*#__PURE__*/(0,jsx_runtime.jsx)(col/* default */.Z, {
|
|
span: 24,
|
|
children: /*#__PURE__*/(0,jsx_runtime.jsxs)(row/* default */.Z, {
|
|
children: [/*#__PURE__*/(0,jsx_runtime.jsxs)(col/* default */.Z, {
|
|
flex: "1",
|
|
children: [/*#__PURE__*/(0,jsx_runtime.jsx)("a", {
|
|
href: "/users/".concat(val.user_login),
|
|
target: "_blank",
|
|
style: {
|
|
color: '#9096A3',
|
|
fontSize: '12px'
|
|
},
|
|
children: val === null || val === void 0 ? void 0 : val.username
|
|
}), /*#__PURE__*/(0,jsx_runtime.jsx)("span", {
|
|
style: {
|
|
color: '#9096A3',
|
|
fontSize: '12px',
|
|
marginLeft: '10px'
|
|
},
|
|
children: val.time
|
|
})]
|
|
}), (val.can_delete || val.user_id === ((_user$userInfo = user.userInfo) === null || _user$userInfo === void 0 ? void 0 : _user$userInfo.user_id) || val.user_login === ((_user$userInfo2 = user.userInfo) === null || _user$userInfo2 === void 0 ? void 0 : _user$userInfo2.login)) && /*#__PURE__*/(0,jsx_runtime.jsx)(col/* default */.Z, {
|
|
className: "forums-comment-delete",
|
|
style: {
|
|
display: 'none'
|
|
},
|
|
children: /*#__PURE__*/(0,jsx_runtime.jsx)(tooltip/* default */.Z, {
|
|
title: "\u5220\u9664",
|
|
children: /*#__PURE__*/(0,jsx_runtime.jsx)(DeleteOutlined/* default */.Z, {
|
|
className: "current",
|
|
onClick: function onClick() {
|
|
modal/* default */.Z.confirm({
|
|
centered: true,
|
|
width: 530,
|
|
okText: '确定',
|
|
cancelText: '取消',
|
|
title: '提示',
|
|
content: /*#__PURE__*/(0,jsx_runtime.jsx)("div", {
|
|
className: "font16 tc",
|
|
children: "\u786E\u5B9A\u8981\u5220\u9664\u8BE5\u6761\u56DE\u590D\u5417\uFF1F"
|
|
}),
|
|
onOk: function () {
|
|
var _onOk = asyncToGenerator_default()( /*#__PURE__*/regeneratorRuntime_default()().mark(function _callee() {
|
|
var res, filterData;
|
|
return regeneratorRuntime_default()().wrap(function _callee$(_context) {
|
|
while (1) switch (_context.prev = _context.next) {
|
|
case 0:
|
|
_context.next = 2;
|
|
return (0,forums/* deleteForums */.sW)({
|
|
id: val.id,
|
|
memo_type: 'data_set'
|
|
});
|
|
case 2:
|
|
res = _context.sent;
|
|
filterData = memo_replies.find(function (x) {
|
|
return x.id === id;
|
|
}).children.filter(function (y) {
|
|
return y.id !== val.id;
|
|
});
|
|
memo_replies.find(function (x) {
|
|
return x.id === id;
|
|
}).children = filterData;
|
|
dispatch({
|
|
type: 'forumsDetail/setForumsDetailData',
|
|
payload: objectSpread2_default()(objectSpread2_default()({}, forumsDetail.forumsDetailData), {}, {
|
|
memo_replies: toConsumableArray_default()(memo_replies),
|
|
memo_type: 'data_set'
|
|
})
|
|
});
|
|
case 6:
|
|
case "end":
|
|
return _context.stop();
|
|
}
|
|
}, _callee);
|
|
}));
|
|
function onOk() {
|
|
return _onOk.apply(this, arguments);
|
|
}
|
|
return onOk;
|
|
}()
|
|
});
|
|
}
|
|
})
|
|
})
|
|
})]
|
|
})
|
|
}), /*#__PURE__*/(0,jsx_runtime.jsx)(col/* default */.Z, {
|
|
children: /*#__PURE__*/(0,jsx_runtime.jsx)(RenderHtml/* default */.Z, {
|
|
value: val.content,
|
|
style: {
|
|
color: '#232B40',
|
|
fontSize: '14px'
|
|
}
|
|
})
|
|
})]
|
|
}, key);
|
|
})
|
|
});
|
|
}
|
|
/* harmony default export */ var Second = (second);
|
|
;// CONCATENATED MODULE: ./src/pages/DataSet/Detail/Comment/index.tsx
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
dayjs_min_default().locale("ZH-cn");
|
|
var Comment = function Comment(_ref, ref) {
|
|
var user = _ref.user,
|
|
forumsDetail = _ref.forumsDetail,
|
|
globalSetting = _ref.globalSetting,
|
|
loading = _ref.loading,
|
|
dispatch = _ref.dispatch,
|
|
handleClick = _ref.handleClick,
|
|
memoId = _ref.memoId;
|
|
var _ref2 = forumsDetail.forumsDetailData || {},
|
|
memo = _ref2.memo,
|
|
memo_replies = _ref2.memo_replies;
|
|
var params = (0,_umi_production_exports.useParams)();
|
|
var _useState = (0,_react_17_0_2_react.useState)(''),
|
|
_useState2 = slicedToArray_default()(_useState, 2),
|
|
value = _useState2[0],
|
|
setValue = _useState2[1];
|
|
var _useState3 = (0,_react_17_0_2_react.useState)(''),
|
|
_useState4 = slicedToArray_default()(_useState3, 2),
|
|
childValue = _useState4[0],
|
|
setChildValue = _useState4[1];
|
|
var _useState5 = (0,_react_17_0_2_react.useState)(-1),
|
|
_useState6 = slicedToArray_default()(_useState5, 2),
|
|
showItemReply = _useState6[0],
|
|
setShowItemReply = _useState6[1];
|
|
var _useState7 = (0,_react_17_0_2_react.useState)(false),
|
|
_useState8 = slicedToArray_default()(_useState7, 2),
|
|
hasMore = _useState8[0],
|
|
setHasMore = _useState8[1];
|
|
var _useState9 = (0,_react_17_0_2_react.useState)(false),
|
|
_useState10 = slicedToArray_default()(_useState9, 2),
|
|
isMdFouch = _useState10[0],
|
|
setIsMdFouch = _useState10[1];
|
|
var _useState11 = (0,_react_17_0_2_react.useState)(1),
|
|
_useState12 = slicedToArray_default()(_useState11, 2),
|
|
page = _useState12[0],
|
|
setPage = _useState12[1];
|
|
(0,_react_17_0_2_react.useEffect)(function () {
|
|
setHasMore((memo === null || memo === void 0 ? void 0 : memo.reply_for_memo_count) > 10);
|
|
}, [memo === null || memo === void 0 ? void 0 : memo.reply_for_memo_count]);
|
|
(0,_react_17_0_2_react.useEffect)(function () {
|
|
dispatch({
|
|
type: 'forumsDetail/getForumsDetailData',
|
|
payload: {
|
|
id: memoId,
|
|
memo_type: 'data_set'
|
|
}
|
|
});
|
|
}, []);
|
|
var handeGetMoreData = /*#__PURE__*/function () {
|
|
var _ref3 = asyncToGenerator_default()( /*#__PURE__*/regeneratorRuntime_default()().mark(function _callee() {
|
|
var currentPage, res, _res$memo_replies;
|
|
return regeneratorRuntime_default()().wrap(function _callee$(_context) {
|
|
while (1) switch (_context.prev = _context.next) {
|
|
case 0:
|
|
currentPage = page + 1;
|
|
setPage(currentPage);
|
|
_context.next = 4;
|
|
return (0,forums/* getMoreReply */.z5)({
|
|
id: memoId,
|
|
page: currentPage,
|
|
memo_type: 'data_set'
|
|
});
|
|
case 4:
|
|
res = _context.sent;
|
|
if (res !== null && res !== void 0 && res.memo_replies) {
|
|
dispatch({
|
|
type: 'forumsDetail/setForumsDetailData',
|
|
payload: objectSpread2_default()(objectSpread2_default()({}, forumsDetail.forumsDetailData), {}, {
|
|
memo_replies: [].concat(toConsumableArray_default()(memo_replies), toConsumableArray_default()(res.memo_replies))
|
|
})
|
|
});
|
|
setHasMore(((_res$memo_replies = res.memo_replies) === null || _res$memo_replies === void 0 ? void 0 : _res$memo_replies.length) === 10);
|
|
}
|
|
case 6:
|
|
case "end":
|
|
return _context.stop();
|
|
}
|
|
}, _callee);
|
|
}));
|
|
return function handeGetMoreData() {
|
|
return _ref3.apply(this, arguments);
|
|
};
|
|
}();
|
|
var formatReplieData = function formatReplieData(data) {
|
|
var _user$userInfo, _user$userInfo2, _user$userInfo3, _user$userInfo4;
|
|
return objectSpread2_default()(objectSpread2_default()({}, data), {}, {
|
|
image_url: (_user$userInfo = user.userInfo) === null || _user$userInfo === void 0 ? void 0 : _user$userInfo.image_url,
|
|
children: [],
|
|
user_id: (_user$userInfo2 = user.userInfo) === null || _user$userInfo2 === void 0 ? void 0 : _user$userInfo2.user_id,
|
|
user_login: (_user$userInfo3 = user.userInfo) === null || _user$userInfo3 === void 0 ? void 0 : _user$userInfo3.login,
|
|
username: (_user$userInfo4 = user.userInfo) === null || _user$userInfo4 === void 0 ? void 0 : _user$userInfo4.username,
|
|
time: "".concat((0,util/* toTimeFormat */.li)((new Date().getTime() - new Date(data.created_at).getTime()) / 1000), "\u524D")
|
|
});
|
|
};
|
|
return /*#__PURE__*/(0,jsx_runtime.jsxs)("section", {
|
|
className: Commentmodules.wrap,
|
|
children: [!!(memo_replies !== null && memo_replies !== void 0 && memo_replies.length) && /*#__PURE__*/(0,jsx_runtime.jsx)("aside", {
|
|
className: Commentmodules.content,
|
|
children: /*#__PURE__*/(0,jsx_runtime.jsx)("aside", {
|
|
className: Commentmodules.replyList,
|
|
children: memo_replies === null || memo_replies === void 0 ? void 0 : memo_replies.map(function (v, k) {
|
|
var _user$userInfo5, _user$userInfo6, _v$children;
|
|
return /*#__PURE__*/(0,jsx_runtime.jsxs)(row/* default */.Z, {
|
|
gutter: [12, 12],
|
|
children: [/*#__PURE__*/(0,jsx_runtime.jsx)(col/* default */.Z, {
|
|
flex: "40px",
|
|
children: /*#__PURE__*/(0,jsx_runtime.jsx)("a", {
|
|
href: "/users/".concat(v.user_login),
|
|
target: "_blank",
|
|
children: /*#__PURE__*/(0,jsx_runtime.jsx)("img", {
|
|
alt: "\u7528\u6237\u5934\u50CF",
|
|
width: "46",
|
|
height: "46",
|
|
src: "".concat(env/* default */.Z.IMG_SERVER, "/images/").concat(v === null || v === void 0 ? void 0 : v.image_url)
|
|
})
|
|
})
|
|
}), /*#__PURE__*/(0,jsx_runtime.jsx)(col/* default */.Z, {
|
|
flex: "1",
|
|
children: /*#__PURE__*/(0,jsx_runtime.jsxs)(row/* default */.Z, {
|
|
align: "middle",
|
|
className: Commentmodules.commentParItem,
|
|
children: [/*#__PURE__*/(0,jsx_runtime.jsx)(col/* default */.Z, {
|
|
span: 24,
|
|
children: /*#__PURE__*/(0,jsx_runtime.jsxs)(row/* default */.Z, {
|
|
children: [/*#__PURE__*/(0,jsx_runtime.jsxs)(col/* default */.Z, {
|
|
flex: "1",
|
|
children: [/*#__PURE__*/(0,jsx_runtime.jsx)("a", {
|
|
href: "/users/".concat(v.user_login),
|
|
target: "_blank",
|
|
children: /*#__PURE__*/(0,jsx_runtime.jsx)("span", {
|
|
style: {
|
|
color: '#9096A3',
|
|
fontSize: '12px'
|
|
},
|
|
children: v === null || v === void 0 ? void 0 : v.username
|
|
})
|
|
}), /*#__PURE__*/(0,jsx_runtime.jsx)("span", {
|
|
style: {
|
|
color: '#9096A3',
|
|
fontSize: '12px',
|
|
marginLeft: '10px'
|
|
},
|
|
children: v.time
|
|
})]
|
|
}), (v.can_delete || v.user_id === ((_user$userInfo5 = user.userInfo) === null || _user$userInfo5 === void 0 ? void 0 : _user$userInfo5.user_id) || v.user_login === ((_user$userInfo6 = user.userInfo) === null || _user$userInfo6 === void 0 ? void 0 : _user$userInfo6.login)) && /*#__PURE__*/(0,jsx_runtime.jsx)(col/* default */.Z, {
|
|
className: "forums-comment-par-delete",
|
|
style: {
|
|
display: 'none'
|
|
},
|
|
children: /*#__PURE__*/(0,jsx_runtime.jsx)(tooltip/* default */.Z, {
|
|
title: "\u5220\u9664",
|
|
children: /*#__PURE__*/(0,jsx_runtime.jsx)(DeleteOutlined/* default */.Z, {
|
|
className: "current",
|
|
onClick: function onClick() {
|
|
modal/* default */.Z.confirm({
|
|
centered: true,
|
|
width: 530,
|
|
okText: '确定',
|
|
cancelText: '取消',
|
|
title: '提示',
|
|
content: /*#__PURE__*/(0,jsx_runtime.jsx)("div", {
|
|
className: "font16 tc",
|
|
children: "\u786E\u5B9A\u8981\u5220\u9664\u8BE5\u6761\u56DE\u590D\u5417\uFF1F"
|
|
}),
|
|
onOk: function () {
|
|
var _onOk = asyncToGenerator_default()( /*#__PURE__*/regeneratorRuntime_default()().mark(function _callee2() {
|
|
var res, filterData;
|
|
return regeneratorRuntime_default()().wrap(function _callee2$(_context2) {
|
|
while (1) switch (_context2.prev = _context2.next) {
|
|
case 0:
|
|
_context2.next = 2;
|
|
return (0,forums/* deleteForums */.sW)({
|
|
id: v.id,
|
|
memo_type: 'data_set'
|
|
});
|
|
case 2:
|
|
res = _context2.sent;
|
|
filterData = memo_replies.filter(function (y) {
|
|
return y.id !== v.id;
|
|
});
|
|
dispatch({
|
|
type: 'forumsDetail/setForumsDetailData',
|
|
payload: objectSpread2_default()(objectSpread2_default()({}, forumsDetail.forumsDetailData), {}, {
|
|
memo_replies: toConsumableArray_default()(filterData),
|
|
memo_type: 'data_set'
|
|
})
|
|
});
|
|
case 5:
|
|
case "end":
|
|
return _context2.stop();
|
|
}
|
|
}, _callee2);
|
|
}));
|
|
function onOk() {
|
|
return _onOk.apply(this, arguments);
|
|
}
|
|
return onOk;
|
|
}()
|
|
});
|
|
}
|
|
})
|
|
})
|
|
})]
|
|
})
|
|
}), /*#__PURE__*/(0,jsx_runtime.jsx)(col/* default */.Z, {
|
|
span: 24,
|
|
style: {
|
|
marginTop: '5px'
|
|
},
|
|
children: /*#__PURE__*/(0,jsx_runtime.jsx)("div", {
|
|
onClick: handleClick,
|
|
children: /*#__PURE__*/(0,jsx_runtime.jsx)(RenderHtml/* default */.Z, {
|
|
value: v.content,
|
|
style: {
|
|
color: '#232B40',
|
|
fontSize: '14px'
|
|
}
|
|
})
|
|
})
|
|
}), !!(v !== null && v !== void 0 && (_v$children = v.children) !== null && _v$children !== void 0 && _v$children.length) && /*#__PURE__*/(0,jsx_runtime.jsx)(Second, {
|
|
user: user,
|
|
id: v === null || v === void 0 ? void 0 : v.id,
|
|
vlist: v === null || v === void 0 ? void 0 : v.children,
|
|
dispatch: dispatch,
|
|
params: params,
|
|
memo_replies: memo_replies,
|
|
forumsDetail: forumsDetail
|
|
}), /*#__PURE__*/(0,jsx_runtime.jsx)(col/* default */.Z, {
|
|
span: 24,
|
|
className: "mt5 c-light-black",
|
|
children: showItemReply === k ? /*#__PURE__*/(0,jsx_runtime.jsxs)("aside", {
|
|
children: [/*#__PURE__*/(0,jsx_runtime.jsx)(markdown_editor/* default */.Z, {
|
|
onChange: function onChange(v) {
|
|
setChildValue(v);
|
|
},
|
|
height: 150,
|
|
isFocus: true,
|
|
placeholder: "\u6211\u8981\u56DE\u590D..."
|
|
}), /*#__PURE__*/(0,jsx_runtime.jsx)(row/* default */.Z, {
|
|
children: /*#__PURE__*/(0,jsx_runtime.jsx)(col/* default */.Z, {
|
|
span: 24,
|
|
className: "tr",
|
|
children: /*#__PURE__*/(0,jsx_runtime.jsx)(es_button/* default */.ZP, {
|
|
type: "primary",
|
|
size: 'middle',
|
|
onClick: /*#__PURE__*/asyncToGenerator_default()( /*#__PURE__*/regeneratorRuntime_default()().mark(function _callee3() {
|
|
var res;
|
|
return regeneratorRuntime_default()().wrap(function _callee3$(_context3) {
|
|
while (1) switch (_context3.prev = _context3.next) {
|
|
case 0:
|
|
if (!(childValue === '')) {
|
|
_context3.next = 4;
|
|
break;
|
|
}
|
|
message/* default */.ZP.error('请输入内容');
|
|
_context3.next = 9;
|
|
break;
|
|
case 4:
|
|
_context3.next = 6;
|
|
return (0,forums/* reply */.ts)({
|
|
parent_id: v.id,
|
|
content: childValue,
|
|
memo_type: 'data_set'
|
|
});
|
|
case 6:
|
|
res = _context3.sent;
|
|
setChildValue(null);
|
|
if (res) {
|
|
setShowItemReply(-1);
|
|
memo_replies.find(function (x) {
|
|
return x.id === res.parent_id;
|
|
}).children.push(formatReplieData(res));
|
|
dispatch({
|
|
type: 'forumsDetail/setForumsDetailData',
|
|
payload: objectSpread2_default()(objectSpread2_default()({}, forumsDetail.forumsDetailData), {}, {
|
|
memo: objectSpread2_default()(objectSpread2_default()({}, memo), {}, {
|
|
reply_for_memo_count: (memo === null || memo === void 0 ? void 0 : memo.reply_for_memo_count) + 1
|
|
}),
|
|
memo_replies: toConsumableArray_default()(memo_replies),
|
|
memo_type: 'data_set'
|
|
})
|
|
});
|
|
}
|
|
case 9:
|
|
case "end":
|
|
return _context3.stop();
|
|
}
|
|
}, _callee3);
|
|
})),
|
|
children: "\u53D1\u9001"
|
|
})
|
|
})
|
|
})]
|
|
}) : /*#__PURE__*/(0,jsx_runtime.jsxs)("div", {
|
|
className: "tr",
|
|
style: {
|
|
textAlign: 'left'
|
|
},
|
|
children: [/*#__PURE__*/(0,jsx_runtime.jsx)("span", {
|
|
className: "iconfont icon-xiaopinglun mr30 current font14",
|
|
onClick: function onClick() {
|
|
return setShowItemReply(k);
|
|
}
|
|
}), /*#__PURE__*/(0,jsx_runtime.jsx)(tooltip/* default */.Z, {
|
|
title: v.user_praise ? "取消点赞" : "点赞",
|
|
children: /*#__PURE__*/(0,jsx_runtime.jsxs)("span", {
|
|
className: v.user_praise ? "c-orange" : "c-gery-888",
|
|
children: [/*#__PURE__*/(0,jsx_runtime.jsx)("i", {
|
|
className: "iconfont icon-dianzan4 mr5 current font14",
|
|
onClick: /*#__PURE__*/asyncToGenerator_default()( /*#__PURE__*/regeneratorRuntime_default()().mark(function _callee4() {
|
|
var res;
|
|
return regeneratorRuntime_default()().wrap(function _callee4$(_context4) {
|
|
while (1) switch (_context4.prev = _context4.next) {
|
|
case 0:
|
|
_context4.next = 2;
|
|
return (0,forums/* like */.vL)({
|
|
id: v.id,
|
|
container_type: 'Memo',
|
|
type: v.user_praise ? 0 : 1,
|
|
memo_type: 'data_set'
|
|
});
|
|
case 2:
|
|
res = _context4.sent;
|
|
if ((res === null || res === void 0 ? void 0 : res.praise_count) >= 0) {
|
|
memo_replies.find(function (x) {
|
|
return x.id === v.id;
|
|
}).user_praise = !v.user_praise;
|
|
memo_replies.find(function (x) {
|
|
return x.id === v.id;
|
|
}).praise_count = res === null || res === void 0 ? void 0 : res.praise_count;
|
|
dispatch({
|
|
type: 'forumsDetail/setForumsDetailData',
|
|
payload: objectSpread2_default()(objectSpread2_default()({}, forumsDetail.forumsDetailData), {}, {
|
|
memo_replies: toConsumableArray_default()(memo_replies),
|
|
memo_type: 'data_set'
|
|
})
|
|
});
|
|
}
|
|
case 4:
|
|
case "end":
|
|
return _context4.stop();
|
|
}
|
|
}, _callee4);
|
|
}))
|
|
}), v.praise_count > 0 ? v.praise_count : '']
|
|
})
|
|
})]
|
|
})
|
|
})]
|
|
})
|
|
})]
|
|
}, k);
|
|
})
|
|
})
|
|
}), hasMore && /*#__PURE__*/(0,jsx_runtime.jsx)("aside", {
|
|
className: "bg-white pb20",
|
|
style: {
|
|
display: 'flex',
|
|
justifyContent: 'center',
|
|
marginTop: '20px'
|
|
},
|
|
children: /*#__PURE__*/(0,jsx_runtime.jsxs)(row/* default */.Z, {
|
|
justify: "space-between",
|
|
children: [/*#__PURE__*/(0,jsx_runtime.jsx)(col/* default */.Z, {}), /*#__PURE__*/(0,jsx_runtime.jsx)(col/* default */.Z, {
|
|
children: hasMore && /*#__PURE__*/(0,jsx_runtime.jsxs)("a", {
|
|
style: {
|
|
color: '#3061D0',
|
|
fontSize: '14px'
|
|
},
|
|
onClick: handeGetMoreData,
|
|
children: ["\u67E5\u770B\u66F4\u591A\u8BC4\u8BBA", /*#__PURE__*/(0,jsx_runtime.jsx)("i", {
|
|
className: "icon icon-zhankaixiaojiantou ",
|
|
style: {
|
|
fontSize: '10px',
|
|
marginLeft: '3px'
|
|
}
|
|
})]
|
|
})
|
|
})]
|
|
})
|
|
}), /*#__PURE__*/(0,jsx_runtime.jsxs)("aside", {
|
|
className: Commentmodules.reply,
|
|
children: [/*#__PURE__*/(0,jsx_runtime.jsx)(markdown_editor/* default */.Z, {
|
|
onBlur: function onBlur() {
|
|
return setIsMdFouch(false);
|
|
},
|
|
isFocus: isMdFouch,
|
|
defaultValue: value,
|
|
id: "writeForumsReviewId",
|
|
onChange: function onChange(v) {
|
|
setValue(v);
|
|
},
|
|
placeholder: "\u6211\u8981\u56DE\u590D...",
|
|
height: 240
|
|
}), /*#__PURE__*/(0,jsx_runtime.jsxs)(row/* default */.Z, {
|
|
children: [/*#__PURE__*/(0,jsx_runtime.jsx)(col/* default */.Z, {
|
|
flex: "1"
|
|
}), /*#__PURE__*/(0,jsx_runtime.jsx)(col/* default */.Z, {
|
|
children: /*#__PURE__*/(0,jsx_runtime.jsx)("div", {
|
|
className: Commentmodules.submitStyle,
|
|
style: {
|
|
width: '60px',
|
|
height: '32px',
|
|
textAlign: 'center'
|
|
},
|
|
onClick: /*#__PURE__*/asyncToGenerator_default()( /*#__PURE__*/regeneratorRuntime_default()().mark(function _callee5() {
|
|
var res;
|
|
return regeneratorRuntime_default()().wrap(function _callee5$(_context5) {
|
|
while (1) switch (_context5.prev = _context5.next) {
|
|
case 0:
|
|
if (!(value === '')) {
|
|
_context5.next = 4;
|
|
break;
|
|
}
|
|
message/* default */.ZP.error('请输入内容');
|
|
_context5.next = 9;
|
|
break;
|
|
case 4:
|
|
_context5.next = 6;
|
|
return (0,forums/* reply */.ts)({
|
|
parent_id: memo === null || memo === void 0 ? void 0 : memo.id,
|
|
content: value,
|
|
memo_type: 'data_set'
|
|
});
|
|
case 6:
|
|
res = _context5.sent;
|
|
setValue(null);
|
|
if (res) {
|
|
dispatch({
|
|
type: 'forumsDetail/setForumsDetailData',
|
|
payload: objectSpread2_default()(objectSpread2_default()({}, forumsDetail.forumsDetailData), {}, {
|
|
memo: objectSpread2_default()(objectSpread2_default()({}, memo), {}, {
|
|
reply_for_memo_count: (memo === null || memo === void 0 ? void 0 : memo.reply_for_memo_count) + 1
|
|
}),
|
|
memo_replies: [formatReplieData(res)].concat(toConsumableArray_default()(memo_replies)),
|
|
memo_type: 'data_set'
|
|
})
|
|
});
|
|
}
|
|
case 9:
|
|
case "end":
|
|
return _context5.stop();
|
|
}
|
|
}, _callee5);
|
|
})),
|
|
children: "\u53D1\u9001"
|
|
})
|
|
})]
|
|
})]
|
|
})]
|
|
});
|
|
};
|
|
/* harmony default export */ var Detail_Comment = ((0,_umi_production_exports.connect)(function (_ref7) {
|
|
var user = _ref7.user,
|
|
forumsDetail = _ref7.forumsDetail,
|
|
loading = _ref7.loading,
|
|
globalSetting = _ref7.globalSetting;
|
|
return {
|
|
user: user,
|
|
forumsDetail: forumsDetail,
|
|
globalSetting: globalSetting,
|
|
loading: loading.models.forumsDetail
|
|
};
|
|
}, null, null, {
|
|
forwardRef: true
|
|
})( /*#__PURE__*/(0,_react_17_0_2_react.forwardRef)(Comment)));
|
|
// EXTERNAL MODULE: ./src/components/ui-customization/index.tsx + 32 modules
|
|
var ui_customization = __webpack_require__(77421);
|
|
// EXTERNAL MODULE: ./src/utils/authority.ts
|
|
var authority = __webpack_require__(7517);
|
|
// EXTERNAL MODULE: ./src/utils/fetch.ts
|
|
var fetch = __webpack_require__(43391);
|
|
// EXTERNAL MODULE: ./src/pages/DataSet/AddOrEditModal/index.tsx + 1 modules
|
|
var AddOrEditModal = __webpack_require__(63618);
|
|
;// CONCATENATED MODULE: ./src/pages/DataSet/Detail/index.tsx
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
var tabsName = {
|
|
'public': '公开数据集',
|
|
'mine': '我的数据集',
|
|
'share': '团队共享',
|
|
'collect': '我收藏的'
|
|
};
|
|
var Detail_PollDetail = function PollDetail(_ref) {
|
|
var _dataSetInfo$user_inf, _dataSetInfo$user_inf2, _dataSetInfo$data_set;
|
|
var polls = _ref.polls,
|
|
globalSetting = _ref.globalSetting,
|
|
loading = _ref.loading,
|
|
dispatch = _ref.dispatch,
|
|
user = _ref.user;
|
|
var params = (0,_umi_production_exports.useParams)();
|
|
var _useSearchParams = (0,_umi_production_exports.useSearchParams)(),
|
|
_useSearchParams2 = slicedToArray_default()(_useSearchParams, 1),
|
|
searchParams = _useSearchParams2[0];
|
|
var _useState = (0,_react_17_0_2_react.useState)(false),
|
|
_useState2 = slicedToArray_default()(_useState, 2),
|
|
indexType = _useState2[0],
|
|
setIndexType = _useState2[1];
|
|
var _useState3 = (0,_react_17_0_2_react.useState)(1),
|
|
_useState4 = slicedToArray_default()(_useState3, 2),
|
|
radioActive = _useState4[0],
|
|
setRadioActive = _useState4[1];
|
|
var _useState5 = (0,_react_17_0_2_react.useState)(null),
|
|
_useState6 = slicedToArray_default()(_useState5, 2),
|
|
dataSetInfo = _useState6[0],
|
|
setDataSetInfo = _useState6[1];
|
|
var _useState7 = (0,_react_17_0_2_react.useState)(''),
|
|
_useState8 = slicedToArray_default()(_useState7, 2),
|
|
refresh = _useState8[0],
|
|
setRefresh = _useState8[1];
|
|
var _useState9 = (0,_react_17_0_2_react.useState)(),
|
|
_useState10 = slicedToArray_default()(_useState9, 2),
|
|
shixuns = _useState10[0],
|
|
setShixuns = _useState10[1];
|
|
var _useState11 = (0,_react_17_0_2_react.useState)(1),
|
|
_useState12 = slicedToArray_default()(_useState11, 2),
|
|
shixunsPage = _useState12[0],
|
|
setShixunsPage = _useState12[1];
|
|
var _useState13 = (0,_react_17_0_2_react.useState)(1),
|
|
_useState14 = slicedToArray_default()(_useState13, 2),
|
|
shixunsAllPage = _useState14[0],
|
|
setShixunsAllPage = _useState14[1]; //总页数
|
|
var groupIdsRef = (0,_react_17_0_2_react.useRef)([]);
|
|
var _useState15 = (0,_react_17_0_2_react.useState)([]),
|
|
_useState16 = slicedToArray_default()(_useState15, 2),
|
|
groupList = _useState16[0],
|
|
setGroupList = _useState16[1];
|
|
var _useState17 = (0,_react_17_0_2_react.useState)(false),
|
|
_useState18 = slicedToArray_default()(_useState17, 2),
|
|
visible = _useState18[0],
|
|
setVisible = _useState18[1];
|
|
var _useState19 = (0,_react_17_0_2_react.useState)(false),
|
|
_useState20 = slicedToArray_default()(_useState19, 2),
|
|
indexLoading = _useState20[0],
|
|
setIndexLoading = _useState20[1];
|
|
(0,_react_17_0_2_react.useEffect)(function () {
|
|
//获取数据集详情
|
|
getInfo();
|
|
//共享列表
|
|
(0,fetch/* default */.ZP)('/api/teach_group_shares.json', {
|
|
method: 'get'
|
|
}).then(function (res) {
|
|
if ((res === null || res === void 0 ? void 0 : res.status) == 0) {
|
|
setGroupList(res === null || res === void 0 ? void 0 : res.groups);
|
|
}
|
|
});
|
|
}, []);
|
|
(0,_react_17_0_2_react.useEffect)(function () {
|
|
//实践项目
|
|
if (radioActive == 2) {
|
|
getShixuns();
|
|
}
|
|
}, [radioActive, shixunsPage]);
|
|
|
|
//根据总数量和每页条数计算多少页
|
|
var calculateTotalPages = function calculateTotalPages(totalItems, itemsPerPage) {
|
|
// 确保输入是数字,且不是负数
|
|
totalItems = Math.max(totalItems, 0);
|
|
itemsPerPage = Math.max(itemsPerPage, 1);
|
|
// 每页至少显示一条
|
|
// 计算总页数
|
|
return Math.ceil(totalItems / itemsPerPage);
|
|
};
|
|
var getShixuns = function getShixuns() {
|
|
(0,dataset/* used_shixuns */.Ce)({
|
|
id: params === null || params === void 0 ? void 0 : params.id,
|
|
page: shixunsPage,
|
|
limit: 16
|
|
}).then(function (res) {
|
|
if ((res === null || res === void 0 ? void 0 : res.status) == 0) {
|
|
var _res$data, _res$data2;
|
|
setShixuns(res === null || res === void 0 || (_res$data = res.data) === null || _res$data === void 0 ? void 0 : _res$data.shixuns);
|
|
setShixunsAllPage(calculateTotalPages(res === null || res === void 0 || (_res$data2 = res.data) === null || _res$data2 === void 0 ? void 0 : _res$data2.count, 16));
|
|
}
|
|
});
|
|
};
|
|
var getInfo = function getInfo() {
|
|
var flag = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : false;
|
|
setIndexLoading(true);
|
|
(0,dataset/* data_sets_info */.Ru)(params === null || params === void 0 ? void 0 : params.id).then(function (res) {
|
|
if ((res === null || res === void 0 ? void 0 : res.status) == 0) {
|
|
var _res$data3, _res$data4;
|
|
setDataSetInfo(res === null || res === void 0 ? void 0 : res.data);
|
|
setIndexType((0,authority/* isSuperAdmins */.Ny)() || (res === null || res === void 0 || (_res$data3 = res.data) === null || _res$data3 === void 0 ? void 0 : _res$data3.is_creator)); //超管或者自己管理
|
|
groupIdsRef.current = res === null || res === void 0 || (_res$data4 = res.data) === null || _res$data4 === void 0 ? void 0 : _res$data4.share_group_ids; //已共享的列表
|
|
if (flag) {
|
|
//编辑数据集介绍的时候 刷新组建
|
|
setRefresh(new Date());
|
|
}
|
|
setIndexLoading(false);
|
|
}
|
|
});
|
|
};
|
|
var onClose = function onClose() {
|
|
setVisible(false);
|
|
};
|
|
var onSuccess = function onSuccess() {
|
|
getInfo();
|
|
setVisible(false);
|
|
};
|
|
return /*#__PURE__*/(0,jsx_runtime.jsx)(spin/* default */.Z, {
|
|
spinning: indexLoading,
|
|
children: /*#__PURE__*/(0,jsx_runtime.jsxs)("section", {
|
|
className: Detailmodules.bg,
|
|
children: [dataSetInfo && /*#__PURE__*/(0,jsx_runtime.jsx)(jsx_runtime.Fragment, {
|
|
children: /*#__PURE__*/(0,jsx_runtime.jsxs)("div", {
|
|
className: "edu-container",
|
|
children: [/*#__PURE__*/(0,jsx_runtime.jsx)("aside", {
|
|
className: "mt10",
|
|
children: /*#__PURE__*/(0,jsx_runtime.jsxs)(breadcrumb/* default */.Z, {
|
|
separator: ">",
|
|
children: [/*#__PURE__*/(0,jsx_runtime.jsx)(breadcrumb/* default */.Z.Item, {
|
|
children: /*#__PURE__*/(0,jsx_runtime.jsx)(_umi_production_exports.Link, {
|
|
to: "/dataset",
|
|
children: "\u6570\u636E\u96C6"
|
|
})
|
|
}), /*#__PURE__*/(0,jsx_runtime.jsx)(breadcrumb/* default */.Z.Item, {
|
|
children: /*#__PURE__*/(0,jsx_runtime.jsx)(_umi_production_exports.Link, {
|
|
to: "/dataset?tabId=".concat(searchParams.get('tabId')),
|
|
children: tabsName[searchParams.get('tabId')]
|
|
})
|
|
}), /*#__PURE__*/(0,jsx_runtime.jsx)(breadcrumb/* default */.Z.Item, {
|
|
children: dataSetInfo === null || dataSetInfo === void 0 ? void 0 : dataSetInfo.title
|
|
})]
|
|
})
|
|
}), /*#__PURE__*/(0,jsx_runtime.jsxs)("aside", {
|
|
className: Detailmodules.wrap,
|
|
children: [/*#__PURE__*/(0,jsx_runtime.jsxs)("div", {
|
|
className: Detailmodules.leftContent,
|
|
style: {
|
|
width: indexType ? '78%' : '87%'
|
|
},
|
|
children: [/*#__PURE__*/(0,jsx_runtime.jsxs)("div", {
|
|
className: Detailmodules.header,
|
|
children: [/*#__PURE__*/(0,jsx_runtime.jsxs)("div", {
|
|
className: Detailmodules.headerBack,
|
|
onClick: function onClick() {
|
|
_umi_production_exports.history.push("/dataset?tabId=".concat(searchParams.get('tabId')));
|
|
},
|
|
children: [/*#__PURE__*/(0,jsx_runtime.jsx)("i", {
|
|
className: "iconfont icon-fanhui4 ",
|
|
style: {
|
|
fontSize: '10px',
|
|
margin: '0 3px 0 5px'
|
|
}
|
|
}), "\u8FD4\u56DE"]
|
|
}), /*#__PURE__*/(0,jsx_runtime.jsx)("div", {
|
|
className: Detailmodules.title,
|
|
children: dataSetInfo === null || dataSetInfo === void 0 ? void 0 : dataSetInfo.title
|
|
}), /*#__PURE__*/(0,jsx_runtime.jsx)("div", {
|
|
className: Detailmodules.time,
|
|
children: dataSetInfo === null || dataSetInfo === void 0 ? void 0 : dataSetInfo.create_at
|
|
})]
|
|
}), /*#__PURE__*/(0,jsx_runtime.jsx)("div", {
|
|
className: Detailmodules.introduction,
|
|
children: dataSetInfo === null || dataSetInfo === void 0 ? void 0 : dataSetInfo.desc
|
|
}), /*#__PURE__*/(0,jsx_runtime.jsxs)("div", {
|
|
className: Detailmodules.bottom,
|
|
children: [(dataSetInfo === null || dataSetInfo === void 0 || (_dataSetInfo$user_inf = dataSetInfo.user_info) === null || _dataSetInfo$user_inf === void 0 ? void 0 : _dataSetInfo$user_inf.image_url) && /*#__PURE__*/(0,jsx_runtime.jsx)("img", {
|
|
className: Detailmodules.user_img,
|
|
alt: "\u7528\u6237\u5934\u50CF",
|
|
src: "".concat(env/* default */.Z.IMG_SERVER, "/images/").concat(dataSetInfo === null || dataSetInfo === void 0 || (_dataSetInfo$user_inf2 = dataSetInfo.user_info) === null || _dataSetInfo$user_inf2 === void 0 ? void 0 : _dataSetInfo$user_inf2.image_url)
|
|
}), /*#__PURE__*/(0,jsx_runtime.jsx)("div", {
|
|
className: Detailmodules.user_name,
|
|
children: dataSetInfo === null || dataSetInfo === void 0 ? void 0 : dataSetInfo.user_info_name
|
|
}), dataSetInfo === null || dataSetInfo === void 0 || (_dataSetInfo$data_set = dataSetInfo.data_set_tags) === null || _dataSetInfo$data_set === void 0 ? void 0 : _dataSetInfo$data_set.map(function (item, index) {
|
|
if (index < 3) {
|
|
return /*#__PURE__*/(0,jsx_runtime.jsx)("div", {
|
|
className: Detailmodules.tags_name,
|
|
children: item === null || item === void 0 ? void 0 : item.tag_name
|
|
}, index);
|
|
} else if (index == 3) {
|
|
var _dataSetInfo$data_set2;
|
|
return /*#__PURE__*/(0,jsx_runtime.jsx)(tooltip/* default */.Z, {
|
|
title: dataSetInfo === null || dataSetInfo === void 0 || (_dataSetInfo$data_set2 = dataSetInfo.data_set_tags) === null || _dataSetInfo$data_set2 === void 0 ? void 0 : _dataSetInfo$data_set2.map(function (v, k) {
|
|
if (k > 2) {
|
|
var _dataSetInfo$data_set3;
|
|
return (v === null || v === void 0 ? void 0 : v.tag_name) + (k === (dataSetInfo === null || dataSetInfo === void 0 || (_dataSetInfo$data_set3 = dataSetInfo.data_set_tags) === null || _dataSetInfo$data_set3 === void 0 ? void 0 : _dataSetInfo$data_set3.length) - 1 ? '' : '、'); // 如果是最后一个标签,则不加逗号
|
|
}
|
|
}).join('') // 将数组转换为字符串
|
|
,
|
|
children: /*#__PURE__*/(0,jsx_runtime.jsx)("div", {
|
|
className: Detailmodules.tags_name,
|
|
children: "..."
|
|
}, index)
|
|
}, index);
|
|
} else {
|
|
return null;
|
|
}
|
|
}), /*#__PURE__*/(0,jsx_runtime.jsxs)("div", {
|
|
className: Detailmodules.buttonList,
|
|
children: [/*#__PURE__*/(0,jsx_runtime.jsxs)("div", {
|
|
className: Detailmodules.buttonItem,
|
|
children: [/*#__PURE__*/(0,jsx_runtime.jsx)("i", {
|
|
className: "iconfont icon-yinyong font12 mr5"
|
|
}), dataSetInfo === null || dataSetInfo === void 0 ? void 0 : dataSetInfo.used_count]
|
|
}), /*#__PURE__*/(0,jsx_runtime.jsxs)("div", {
|
|
className: Detailmodules.buttonItem,
|
|
children: [/*#__PURE__*/(0,jsx_runtime.jsx)("i", {
|
|
className: "iconfont icon-chakanrenshu font12 mr5"
|
|
}), dataSetInfo === null || dataSetInfo === void 0 ? void 0 : dataSetInfo.visited_count]
|
|
}), /*#__PURE__*/(0,jsx_runtime.jsxs)("div", {
|
|
className: Detailmodules.buttonItem,
|
|
children: [/*#__PURE__*/(0,jsx_runtime.jsx)("i", {
|
|
className: "iconfont icon-xiaopinglun font12 mr5"
|
|
}), dataSetInfo === null || dataSetInfo === void 0 ? void 0 : dataSetInfo.comment_count]
|
|
})]
|
|
})]
|
|
})]
|
|
}), /*#__PURE__*/(0,jsx_runtime.jsx)("div", {
|
|
className: Detailmodules.rightContent,
|
|
style: {
|
|
width: indexType ? '22%' : '13%'
|
|
},
|
|
children: indexType ? /*#__PURE__*/(0,jsx_runtime.jsxs)("div", {
|
|
style: {
|
|
display: 'flex',
|
|
marginLeft: 'auto'
|
|
},
|
|
children: [/*#__PURE__*/(0,jsx_runtime.jsx)("div", {
|
|
className: Detailmodules.share,
|
|
onClick: /*#__PURE__*/asyncToGenerator_default()( /*#__PURE__*/regeneratorRuntime_default()().mark(function _callee() {
|
|
return regeneratorRuntime_default()().wrap(function _callee$(_context) {
|
|
while (1) switch (_context.prev = _context.next) {
|
|
case 0:
|
|
modal/* default */.Z.confirm({
|
|
centered: true,
|
|
width: 530,
|
|
okText: '确定',
|
|
cancelText: '取消',
|
|
title: '共享至教研团队',
|
|
maskClosable: true,
|
|
icon: null,
|
|
content: /*#__PURE__*/(0,jsx_runtime.jsxs)("div", {
|
|
className: "font14 ".concat(Detailmodules.overflow),
|
|
children: [/*#__PURE__*/(0,jsx_runtime.jsx)("div", {
|
|
className: Detailmodules.tips,
|
|
children: "\u63D0\u793A\uFF1A\u5171\u4EAB\u540E\u7684\u6570\u636E\u96C6\u652F\u6301\u56E2\u961F\u6210\u5458\u8FDB\u884C\u7F16\u8F91\uFF0C\u5982\u9700\u64A4\u9500\u672C\u6570\u636E\u96C6\u5BF9\u9009\u4E2D\u6559\u7814\u56E2\u961F\u7684\u5206\u4EAB\uFF0C\u53D6\u6D88\u9009\u4E2D\u5E76\u786E\u5B9A\u5373\u53EF\u3002"
|
|
}), /*#__PURE__*/(0,jsx_runtime.jsx)(es_checkbox/* default */.Z.Group, {
|
|
style: {
|
|
marginTop: '10px'
|
|
},
|
|
defaultValue: dataSetInfo === null || dataSetInfo === void 0 ? void 0 : dataSetInfo.share_group_ids,
|
|
onChange: function onChange(e) {
|
|
groupIdsRef.current = e;
|
|
},
|
|
children: groupList === null || groupList === void 0 ? void 0 : groupList.map(function (item) {
|
|
return /*#__PURE__*/(0,jsx_runtime.jsx)(es_checkbox/* default */.Z, {
|
|
value: item === null || item === void 0 ? void 0 : item.group_id,
|
|
children: item === null || item === void 0 ? void 0 : item.name
|
|
}, item === null || item === void 0 ? void 0 : item.group_id);
|
|
})
|
|
})]
|
|
}),
|
|
onOk: function onOk() {
|
|
(0,dataset/* teach_group_shares */.l5)({
|
|
ids: [dataSetInfo === null || dataSetInfo === void 0 ? void 0 : dataSetInfo.id],
|
|
clazz: 'DataSet',
|
|
group_ids: groupIdsRef.current
|
|
}).then(function (res) {
|
|
if ((res === null || res === void 0 ? void 0 : res.status) == 0) {
|
|
message/* default */.ZP.success('共享成功');
|
|
getInfo();
|
|
}
|
|
});
|
|
}
|
|
});
|
|
case 1:
|
|
case "end":
|
|
return _context.stop();
|
|
}
|
|
}, _callee);
|
|
})),
|
|
children: "\u5171\u4EAB"
|
|
}), /*#__PURE__*/(0,jsx_runtime.jsx)("div", {
|
|
className: Detailmodules.publicStyle,
|
|
onClick: function onClick() {
|
|
modal/* default */.Z.confirm({
|
|
centered: true,
|
|
okText: '确定',
|
|
icon: null,
|
|
cancelText: '取消',
|
|
title: '提示',
|
|
content: (dataSetInfo === null || dataSetInfo === void 0 ? void 0 : dataSetInfo.public_status) == 0 ? '申请公开需要待平台管理员审核通过后,自动公开' : (dataSetInfo === null || dataSetInfo === void 0 ? void 0 : dataSetInfo.public_status) == 1 ? '取消公开后,其他用户将不可见,同时再次公开需要重新进行申请' : '撤销申请公开后,申请记录将删除,如需公开请再次申请',
|
|
onOk: function () {
|
|
var _onOk = asyncToGenerator_default()( /*#__PURE__*/regeneratorRuntime_default()().mark(function _callee2() {
|
|
var promise;
|
|
return regeneratorRuntime_default()().wrap(function _callee2$(_context2) {
|
|
while (1) switch (_context2.prev = _context2.next) {
|
|
case 0:
|
|
_context2.t0 = dataSetInfo === null || dataSetInfo === void 0 ? void 0 : dataSetInfo.public_status;
|
|
_context2.next = _context2.t0 === 0 ? 3 : _context2.t0 === 1 ? 5 : _context2.t0 === 2 ? 7 : 9;
|
|
break;
|
|
case 3:
|
|
// 申请公开
|
|
promise = (0,dataset/* apply_public */.To)(dataSetInfo === null || dataSetInfo === void 0 ? void 0 : dataSetInfo.id);
|
|
return _context2.abrupt("break", 10);
|
|
case 5:
|
|
// 取消公开
|
|
promise = (0,dataset/* cancel_public */.a6)(dataSetInfo === null || dataSetInfo === void 0 ? void 0 : dataSetInfo.id);
|
|
return _context2.abrupt("break", 10);
|
|
case 7:
|
|
// 撤销申请公开
|
|
promise = (0,dataset/* revoke_apply_public */.Dx)(dataSetInfo === null || dataSetInfo === void 0 ? void 0 : dataSetInfo.id);
|
|
return _context2.abrupt("break", 10);
|
|
case 9:
|
|
return _context2.abrupt("return");
|
|
case 10:
|
|
promise.then(function (res) {
|
|
if ((res === null || res === void 0 ? void 0 : res.status) === 0) {
|
|
message/* default */.ZP.success('操作成功');
|
|
getInfo(); // 更新数据
|
|
}
|
|
});
|
|
case 11:
|
|
case "end":
|
|
return _context2.stop();
|
|
}
|
|
}, _callee2);
|
|
}));
|
|
function onOk() {
|
|
return _onOk.apply(this, arguments);
|
|
}
|
|
return onOk;
|
|
}()
|
|
});
|
|
},
|
|
children: (dataSetInfo === null || dataSetInfo === void 0 ? void 0 : dataSetInfo.public_status) == 0 ? '申请公开' : (dataSetInfo === null || dataSetInfo === void 0 ? void 0 : dataSetInfo.public_status) == 1 ? '取消公开' : '撤销申请公开'
|
|
}), /*#__PURE__*/(0,jsx_runtime.jsx)(dropdown/* default */.Z, {
|
|
menu: {
|
|
items: [{
|
|
label: /*#__PURE__*/(0,jsx_runtime.jsx)("div", {
|
|
children: "\u7F16\u8F91"
|
|
}),
|
|
key: '4',
|
|
onClick: function onClick() {
|
|
setVisible(true);
|
|
}
|
|
}, {
|
|
label: /*#__PURE__*/(0,jsx_runtime.jsx)("div", {
|
|
onClick: function onClick() {
|
|
modal/* default */.Z.confirm({
|
|
centered: true,
|
|
okText: '确定',
|
|
cancelText: '取消',
|
|
title: '提示',
|
|
icon: null,
|
|
content: '删除数据集中的文件不会影响到引用该数据集的实践项目,但删除后数据将不可恢复,请确认是否删除',
|
|
onOk: function onOk() {
|
|
return asyncToGenerator_default()( /*#__PURE__*/regeneratorRuntime_default()().mark(function _callee3() {
|
|
return regeneratorRuntime_default()().wrap(function _callee3$(_context3) {
|
|
while (1) switch (_context3.prev = _context3.next) {
|
|
case 0:
|
|
(0,dataset/* data_sets_delete */.pP)(dataSetInfo === null || dataSetInfo === void 0 ? void 0 : dataSetInfo.id).then(function (res) {
|
|
if ((res === null || res === void 0 ? void 0 : res.status) == 0) {
|
|
message/* default */.ZP.success('删除成功');
|
|
_umi_production_exports.history.push("/dataset");
|
|
}
|
|
});
|
|
case 1:
|
|
case "end":
|
|
return _context3.stop();
|
|
}
|
|
}, _callee3);
|
|
}))();
|
|
}
|
|
});
|
|
},
|
|
children: "\u5220\u9664"
|
|
}),
|
|
key: '5'
|
|
}]
|
|
},
|
|
children: /*#__PURE__*/(0,jsx_runtime.jsx)("div", {
|
|
className: Detailmodules.more,
|
|
children: /*#__PURE__*/(0,jsx_runtime.jsx)("i", {
|
|
className: "iconfont icon-gengduo6 font12"
|
|
})
|
|
})
|
|
})]
|
|
}) : /*#__PURE__*/(0,jsx_runtime.jsxs)("div", {
|
|
className: dataSetInfo !== null && dataSetInfo !== void 0 && dataSetInfo.current_user_is_collect ? Detailmodules.collectActiveStyle : Detailmodules.collectStyle,
|
|
onClick: function onClick() {
|
|
var promise;
|
|
if (dataSetInfo !== null && dataSetInfo !== void 0 && dataSetInfo.current_user_is_collect) {
|
|
// 取消收藏
|
|
promise = (0,dataset/* collections_cancel */.R9)({
|
|
container_id: dataSetInfo === null || dataSetInfo === void 0 ? void 0 : dataSetInfo.id,
|
|
container_type: 'DataSet'
|
|
});
|
|
} else {
|
|
// 收藏
|
|
promise = (0,dataset/* collections_ok */.nW)({
|
|
container_id: dataSetInfo === null || dataSetInfo === void 0 ? void 0 : dataSetInfo.id,
|
|
container_type: 'DataSet'
|
|
});
|
|
}
|
|
promise.then(function (res) {
|
|
if ((res === null || res === void 0 ? void 0 : res.status) === 0) {
|
|
getInfo(); // 更新数据
|
|
}
|
|
});
|
|
},
|
|
children: [/*#__PURE__*/(0,jsx_runtime.jsx)("i", {
|
|
className: "iconfont icon-shoucang4 font12"
|
|
}), " ", dataSetInfo === null || dataSetInfo === void 0 ? void 0 : dataSetInfo.collect_count]
|
|
})
|
|
})]
|
|
}), /*#__PURE__*/(0,jsx_runtime.jsxs)("div", {
|
|
className: Detailmodules.content,
|
|
children: [/*#__PURE__*/(0,jsx_runtime.jsxs)("div", {
|
|
style: {
|
|
display: "flex",
|
|
alignItems: 'center'
|
|
},
|
|
children: [/*#__PURE__*/(0,jsx_runtime.jsx)(es_radio/* default.Group */.ZP.Group, {
|
|
className: Detailmodules.addTypeRadio,
|
|
optionType: "button",
|
|
options: [{
|
|
label: '详情',
|
|
value: 1
|
|
}, {
|
|
label: '实践项目',
|
|
value: 2
|
|
}, {
|
|
label: '讨论',
|
|
value: 3
|
|
}],
|
|
onChange: function onChange(e) {
|
|
var _e$target;
|
|
setRadioActive(e === null || e === void 0 || (_e$target = e.target) === null || _e$target === void 0 ? void 0 : _e$target.value);
|
|
},
|
|
value: radioActive
|
|
}), /*#__PURE__*/(0,jsx_runtime.jsx)("div", {
|
|
className: Detailmodules.addBtn,
|
|
onClick: function onClick() {
|
|
window.open("/shixuns/new?dataSetId=".concat(params === null || params === void 0 ? void 0 : params.id));
|
|
},
|
|
children: "\u521B\u5EFA\u5B9E\u8DF5\u9879\u76EE"
|
|
})]
|
|
}), radioActive == 1 && /*#__PURE__*/(0,jsx_runtime.jsx)(DataInfo, {
|
|
dataSetInfo: dataSetInfo,
|
|
getInfo: getInfo,
|
|
indexType: indexType
|
|
}, refresh), radioActive == 2 && /*#__PURE__*/(0,jsx_runtime.jsxs)("div", {
|
|
children: [/*#__PURE__*/(0,jsx_runtime.jsxs)("div", {
|
|
className: Detailmodules.shixunTooltip,
|
|
children: [/*#__PURE__*/(0,jsx_runtime.jsx)("i", {
|
|
className: "icon icon-tishi11 font12 mr10"
|
|
}), "\u6E29\u99A8\u63D0\u793A\uFF1A\u4EC5\u5C55\u793A\u5F15\u7528\u8BE5\u6570\u636E\u96C6\u4E14\u516C\u5F00\u7684\u5B9E\u8DF5\u9879\u76EE"]
|
|
}), /*#__PURE__*/(0,jsx_runtime.jsx)(ui_customization/* ShixunList */.wb, {
|
|
dataSource: shixuns,
|
|
right: 23,
|
|
col: 4,
|
|
precision: 1,
|
|
loading: false,
|
|
wrapWidth: 1140,
|
|
trackEventItems: ['实践项目', '首页', '实训列表查看详情']
|
|
}), shixunsAllPage > 1 && /*#__PURE__*/(0,jsx_runtime.jsxs)("div", {
|
|
className: Detailmodules.pageStyle,
|
|
children: [/*#__PURE__*/(0,jsx_runtime.jsx)("div", {
|
|
className: shixunsPage == 1 ? Detailmodules.pageUnCan : Detailmodules.pageCan,
|
|
style: {
|
|
marginRight: '10px'
|
|
},
|
|
onClick: function onClick() {
|
|
if (shixunsPage > 1) {
|
|
setShixunsPage(shixunsPage - 1);
|
|
}
|
|
},
|
|
children: "\u4E0A\u4E00\u9875"
|
|
}), /*#__PURE__*/(0,jsx_runtime.jsx)("div", {
|
|
className: shixunsPage == shixunsAllPage ? Detailmodules.pageUnCan : Detailmodules.pageCan,
|
|
style: {
|
|
marginLeft: '10px'
|
|
},
|
|
onClick: function onClick() {
|
|
if (shixunsPage < shixunsAllPage) {
|
|
setShixunsPage(shixunsPage + 1);
|
|
}
|
|
},
|
|
children: "\u4E0B\u4E00\u9875"
|
|
})]
|
|
})]
|
|
}), radioActive == 3 && /*#__PURE__*/(0,jsx_runtime.jsx)(Detail_Comment, {
|
|
memoId: dataSetInfo === null || dataSetInfo === void 0 ? void 0 : dataSetInfo.memo_id
|
|
})]
|
|
})]
|
|
})
|
|
}), /*#__PURE__*/(0,jsx_runtime.jsx)(AddOrEditModal/* default */.Z, {
|
|
dataSetInfo: dataSetInfo,
|
|
visible: visible,
|
|
onClose: onClose,
|
|
onSuccess: onSuccess
|
|
})]
|
|
})
|
|
});
|
|
};
|
|
/* harmony default export */ var Detail = ((0,_umi_production_exports.connect)(function (_ref3) {
|
|
var polls = _ref3.polls,
|
|
loading = _ref3.loading,
|
|
user = _ref3.user,
|
|
globalSetting = _ref3.globalSetting;
|
|
return {
|
|
polls: polls,
|
|
globalSetting: globalSetting,
|
|
user: user,
|
|
loading: loading.effects
|
|
};
|
|
})(Detail_PollDetail));
|
|
|
|
/***/ }),
|
|
|
|
/***/ 66104:
|
|
/*!**************************************************************************!*\
|
|
!*** ./node_modules/_antd@5.9.0@antd/es/breadcrumb/index.js + 6 modules ***!
|
|
\**************************************************************************/
|
|
/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
|
|
|
|
|
|
// EXPORTS
|
|
__webpack_require__.d(__webpack_exports__, {
|
|
Z: function() { return /* binding */ breadcrumb; }
|
|
});
|
|
|
|
// 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/_rc-util@5.44.4@rc-util/es/Children/toArray.js
|
|
var toArray = __webpack_require__(11592);
|
|
// EXTERNAL MODULE: ./node_modules/_rc-util@5.44.4@rc-util/es/pickAttrs.js
|
|
var pickAttrs = __webpack_require__(26112);
|
|
// 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/_util/reactNode.js
|
|
var reactNode = __webpack_require__(92343);
|
|
// EXTERNAL MODULE: ./node_modules/_antd@5.9.0@antd/es/config-provider/context.js
|
|
var context = __webpack_require__(36355);
|
|
// EXTERNAL MODULE: ./node_modules/_@ant-design_icons@5.6.1@@ant-design/icons/es/icons/DownOutlined.js + 1 modules
|
|
var DownOutlined = __webpack_require__(84105);
|
|
// EXTERNAL MODULE: ./node_modules/_antd@5.9.0@antd/es/dropdown/dropdown.js
|
|
var dropdown = __webpack_require__(91857);
|
|
;// CONCATENATED MODULE: ./node_modules/_antd@5.9.0@antd/es/breadcrumb/BreadcrumbSeparator.js
|
|
"use client";
|
|
|
|
|
|
|
|
const BreadcrumbSeparator = _ref => {
|
|
let {
|
|
children
|
|
} = _ref;
|
|
const {
|
|
getPrefixCls
|
|
} = _react_17_0_2_react.useContext(context/* ConfigContext */.E_);
|
|
const prefixCls = getPrefixCls('breadcrumb');
|
|
return /*#__PURE__*/_react_17_0_2_react.createElement("li", {
|
|
className: `${prefixCls}-separator`,
|
|
"aria-hidden": "true"
|
|
}, children === '' ? children : children || '/');
|
|
};
|
|
BreadcrumbSeparator.__ANT_BREADCRUMB_SEPARATOR = true;
|
|
/* harmony default export */ var breadcrumb_BreadcrumbSeparator = (BreadcrumbSeparator);
|
|
;// CONCATENATED MODULE: ./node_modules/_antd@5.9.0@antd/es/breadcrumb/useItemRender.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;
|
|
};
|
|
|
|
|
|
|
|
function getBreadcrumbName(route, params) {
|
|
if (route.title === undefined || route.title === null) {
|
|
return null;
|
|
}
|
|
const paramsKeys = Object.keys(params).join('|');
|
|
return typeof route.title === 'object' ? route.title : String(route.title).replace(new RegExp(`:(${paramsKeys})`, 'g'), (replacement, key) => params[key] || replacement);
|
|
}
|
|
function renderItem(prefixCls, item, children, href) {
|
|
if (children === null || children === undefined) {
|
|
return null;
|
|
}
|
|
const {
|
|
className,
|
|
onClick
|
|
} = item,
|
|
restItem = __rest(item, ["className", "onClick"]);
|
|
const passedProps = Object.assign(Object.assign({}, (0,pickAttrs/* default */.Z)(restItem, {
|
|
data: true,
|
|
aria: true
|
|
})), {
|
|
onClick
|
|
});
|
|
if (href !== undefined) {
|
|
return /*#__PURE__*/_react_17_0_2_react.createElement("a", Object.assign({}, passedProps, {
|
|
className: _classnames_2_5_1_classnames_default()(`${prefixCls}-link`, className),
|
|
href: href
|
|
}), children);
|
|
}
|
|
return /*#__PURE__*/_react_17_0_2_react.createElement("span", Object.assign({}, passedProps, {
|
|
className: _classnames_2_5_1_classnames_default()(`${prefixCls}-link`, className)
|
|
}), children);
|
|
}
|
|
function useItemRender(prefixCls, itemRender) {
|
|
const mergedItemRender = (item, params, routes, path, href) => {
|
|
if (itemRender) {
|
|
return itemRender(item, params, routes, path);
|
|
}
|
|
const name = getBreadcrumbName(item, params);
|
|
return renderItem(prefixCls, item, name, href);
|
|
};
|
|
return mergedItemRender;
|
|
}
|
|
;// CONCATENATED MODULE: ./node_modules/_antd@5.9.0@antd/es/breadcrumb/BreadcrumbItem.js
|
|
"use client";
|
|
|
|
var BreadcrumbItem_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 InternalBreadcrumbItem = props => {
|
|
const {
|
|
prefixCls,
|
|
separator = '/',
|
|
children,
|
|
menu,
|
|
overlay,
|
|
dropdownProps,
|
|
href
|
|
} = props;
|
|
// Warning for deprecated usage
|
|
if (false) {}
|
|
/** If overlay is have Wrap a Dropdown */
|
|
const renderBreadcrumbNode = breadcrumbItem => {
|
|
if (menu || overlay) {
|
|
const mergeDropDownProps = Object.assign({}, dropdownProps);
|
|
if (menu) {
|
|
const _a = menu || {},
|
|
{
|
|
items
|
|
} = _a,
|
|
menuProps = BreadcrumbItem_rest(_a, ["items"]);
|
|
mergeDropDownProps.menu = Object.assign(Object.assign({}, menuProps), {
|
|
items: items === null || items === void 0 ? void 0 : items.map((_a, index) => {
|
|
var {
|
|
key,
|
|
title,
|
|
label,
|
|
path
|
|
} = _a,
|
|
itemProps = BreadcrumbItem_rest(_a, ["key", "title", "label", "path"]);
|
|
let mergedLabel = label !== null && label !== void 0 ? label : title;
|
|
if (path) {
|
|
mergedLabel = /*#__PURE__*/_react_17_0_2_react.createElement("a", {
|
|
href: `${href}${path}`
|
|
}, mergedLabel);
|
|
}
|
|
return Object.assign(Object.assign({}, itemProps), {
|
|
key: key !== null && key !== void 0 ? key : index,
|
|
label: mergedLabel
|
|
});
|
|
})
|
|
});
|
|
} else if (overlay) {
|
|
mergeDropDownProps.overlay = overlay;
|
|
}
|
|
return /*#__PURE__*/_react_17_0_2_react.createElement(dropdown/* default */.Z, Object.assign({
|
|
placement: "bottom"
|
|
}, mergeDropDownProps), /*#__PURE__*/_react_17_0_2_react.createElement("span", {
|
|
className: `${prefixCls}-overlay-link`
|
|
}, breadcrumbItem, /*#__PURE__*/_react_17_0_2_react.createElement(DownOutlined/* default */.Z, null)));
|
|
}
|
|
return breadcrumbItem;
|
|
};
|
|
// wrap to dropDown
|
|
const link = renderBreadcrumbNode(children);
|
|
if (link !== undefined && link !== null) {
|
|
return /*#__PURE__*/_react_17_0_2_react.createElement(_react_17_0_2_react.Fragment, null, /*#__PURE__*/_react_17_0_2_react.createElement("li", null, link), separator && /*#__PURE__*/_react_17_0_2_react.createElement(breadcrumb_BreadcrumbSeparator, null, separator));
|
|
}
|
|
return null;
|
|
};
|
|
const BreadcrumbItem = props => {
|
|
const {
|
|
prefixCls: customizePrefixCls,
|
|
children,
|
|
href
|
|
} = props,
|
|
restProps = BreadcrumbItem_rest(props, ["prefixCls", "children", "href"]);
|
|
const {
|
|
getPrefixCls
|
|
} = _react_17_0_2_react.useContext(context/* ConfigContext */.E_);
|
|
const prefixCls = getPrefixCls('breadcrumb', customizePrefixCls);
|
|
return /*#__PURE__*/_react_17_0_2_react.createElement(InternalBreadcrumbItem, Object.assign({}, restProps, {
|
|
prefixCls: prefixCls
|
|
}), renderItem(prefixCls, restProps, children, href));
|
|
};
|
|
BreadcrumbItem.__ANT_BREADCRUMB_ITEM = true;
|
|
/* harmony default export */ var breadcrumb_BreadcrumbItem = (BreadcrumbItem);
|
|
// 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/breadcrumb/style/index.js
|
|
|
|
|
|
const genBreadcrumbStyle = token => {
|
|
const {
|
|
componentCls,
|
|
iconCls
|
|
} = token;
|
|
return {
|
|
[componentCls]: Object.assign(Object.assign({}, (0,style/* resetComponent */.Wf)(token)), {
|
|
color: token.itemColor,
|
|
fontSize: token.fontSize,
|
|
[iconCls]: {
|
|
fontSize: token.iconFontSize
|
|
},
|
|
ol: {
|
|
display: 'flex',
|
|
flexWrap: 'wrap',
|
|
margin: 0,
|
|
padding: 0,
|
|
listStyle: 'none'
|
|
},
|
|
a: Object.assign({
|
|
color: token.linkColor,
|
|
transition: `color ${token.motionDurationMid}`,
|
|
padding: `0 ${token.paddingXXS}px`,
|
|
borderRadius: token.borderRadiusSM,
|
|
height: token.lineHeight * token.fontSize,
|
|
display: 'inline-block',
|
|
marginInline: -token.marginXXS,
|
|
'&:hover': {
|
|
color: token.linkHoverColor,
|
|
backgroundColor: token.colorBgTextHover
|
|
}
|
|
}, (0,style/* genFocusStyle */.Qy)(token)),
|
|
[`li:last-child`]: {
|
|
color: token.lastItemColor
|
|
},
|
|
[`${componentCls}-separator`]: {
|
|
marginInline: token.separatorMargin,
|
|
color: token.separatorColor
|
|
},
|
|
[`${componentCls}-link`]: {
|
|
[`
|
|
> ${iconCls} + span,
|
|
> ${iconCls} + a
|
|
`]: {
|
|
marginInlineStart: token.marginXXS
|
|
}
|
|
},
|
|
[`${componentCls}-overlay-link`]: {
|
|
borderRadius: token.borderRadiusSM,
|
|
height: token.lineHeight * token.fontSize,
|
|
display: 'inline-block',
|
|
padding: `0 ${token.paddingXXS}px`,
|
|
marginInline: -token.marginXXS,
|
|
[`> ${iconCls}`]: {
|
|
marginInlineStart: token.marginXXS,
|
|
fontSize: token.fontSizeIcon
|
|
},
|
|
'&:hover': {
|
|
color: token.linkHoverColor,
|
|
backgroundColor: token.colorBgTextHover,
|
|
a: {
|
|
color: token.linkHoverColor
|
|
}
|
|
},
|
|
a: {
|
|
'&:hover': {
|
|
backgroundColor: 'transparent'
|
|
}
|
|
}
|
|
},
|
|
// rtl style
|
|
[`&${token.componentCls}-rtl`]: {
|
|
direction: 'rtl'
|
|
}
|
|
})
|
|
};
|
|
};
|
|
// ============================== Export ==============================
|
|
/* harmony default export */ var breadcrumb_style = ((0,genComponentStyleHook/* default */.Z)('Breadcrumb', token => {
|
|
const BreadcrumbToken = (0,statistic/* merge */.TS)(token, {});
|
|
return [genBreadcrumbStyle(BreadcrumbToken)];
|
|
}, token => ({
|
|
itemColor: token.colorTextDescription,
|
|
lastItemColor: token.colorText,
|
|
iconFontSize: token.fontSize,
|
|
linkColor: token.colorTextDescription,
|
|
linkHoverColor: token.colorText,
|
|
separatorColor: token.colorTextDescription,
|
|
separatorMargin: token.marginXS
|
|
})));
|
|
;// CONCATENATED MODULE: ./node_modules/_antd@5.9.0@antd/es/breadcrumb/useItems.js
|
|
var useItems_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;
|
|
};
|
|
|
|
function route2item(route) {
|
|
const {
|
|
breadcrumbName,
|
|
children
|
|
} = route,
|
|
rest = useItems_rest(route, ["breadcrumbName", "children"]);
|
|
const clone = Object.assign({
|
|
title: breadcrumbName
|
|
}, rest);
|
|
if (children) {
|
|
clone.menu = {
|
|
items: children.map(_a => {
|
|
var {
|
|
breadcrumbName: itemBreadcrumbName
|
|
} = _a,
|
|
itemProps = useItems_rest(_a, ["breadcrumbName"]);
|
|
return Object.assign(Object.assign({}, itemProps), {
|
|
title: itemBreadcrumbName
|
|
});
|
|
})
|
|
};
|
|
}
|
|
return clone;
|
|
}
|
|
function useItems(items, routes) {
|
|
return (0,_react_17_0_2_react.useMemo)(() => {
|
|
if (items) {
|
|
return items;
|
|
}
|
|
if (routes) {
|
|
return routes.map(route2item);
|
|
}
|
|
return null;
|
|
}, [items, routes]);
|
|
}
|
|
;// CONCATENATED MODULE: ./node_modules/_antd@5.9.0@antd/es/breadcrumb/Breadcrumb.js
|
|
"use client";
|
|
|
|
var Breadcrumb_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 getPath = (params, path) => {
|
|
if (path === undefined) {
|
|
return path;
|
|
}
|
|
let mergedPath = (path || '').replace(/^\//, '');
|
|
Object.keys(params).forEach(key => {
|
|
mergedPath = mergedPath.replace(`:${key}`, params[key]);
|
|
});
|
|
return mergedPath;
|
|
};
|
|
const Breadcrumb = props => {
|
|
const {
|
|
prefixCls: customizePrefixCls,
|
|
separator = '/',
|
|
style,
|
|
className,
|
|
rootClassName,
|
|
routes: legacyRoutes,
|
|
items,
|
|
children,
|
|
itemRender,
|
|
params = {}
|
|
} = props,
|
|
restProps = Breadcrumb_rest(props, ["prefixCls", "separator", "style", "className", "rootClassName", "routes", "items", "children", "itemRender", "params"]);
|
|
const {
|
|
getPrefixCls,
|
|
direction,
|
|
breadcrumb
|
|
} = _react_17_0_2_react.useContext(context/* ConfigContext */.E_);
|
|
let crumbs;
|
|
const prefixCls = getPrefixCls('breadcrumb', customizePrefixCls);
|
|
const [wrapSSR, hashId] = breadcrumb_style(prefixCls);
|
|
const mergedItems = useItems(items, legacyRoutes);
|
|
if (false) {}
|
|
const mergedItemRender = useItemRender(prefixCls, itemRender);
|
|
if (mergedItems && mergedItems.length > 0) {
|
|
// generated by route
|
|
const paths = [];
|
|
const itemRenderRoutes = items || legacyRoutes;
|
|
crumbs = mergedItems.map((item, index) => {
|
|
const {
|
|
path,
|
|
key,
|
|
type,
|
|
menu,
|
|
overlay,
|
|
onClick,
|
|
className: itemClassName,
|
|
separator: itemSeparator,
|
|
dropdownProps
|
|
} = item;
|
|
const mergedPath = getPath(params, path);
|
|
if (mergedPath !== undefined) {
|
|
paths.push(mergedPath);
|
|
}
|
|
const mergedKey = key !== null && key !== void 0 ? key : index;
|
|
if (type === 'separator') {
|
|
return /*#__PURE__*/_react_17_0_2_react.createElement(breadcrumb_BreadcrumbSeparator, {
|
|
key: mergedKey
|
|
}, itemSeparator);
|
|
}
|
|
const itemProps = {};
|
|
const isLastItem = index === mergedItems.length - 1;
|
|
if (menu) {
|
|
itemProps.menu = menu;
|
|
} else if (overlay) {
|
|
itemProps.overlay = overlay;
|
|
}
|
|
let {
|
|
href
|
|
} = item;
|
|
if (paths.length && mergedPath !== undefined) {
|
|
href = `#/${paths.join('/')}`;
|
|
}
|
|
return /*#__PURE__*/_react_17_0_2_react.createElement(InternalBreadcrumbItem, Object.assign({
|
|
key: mergedKey
|
|
}, itemProps, (0,pickAttrs/* default */.Z)(item, {
|
|
data: true,
|
|
aria: true
|
|
}), {
|
|
className: itemClassName,
|
|
dropdownProps: dropdownProps,
|
|
href: href,
|
|
separator: isLastItem ? '' : separator,
|
|
onClick: onClick,
|
|
prefixCls: prefixCls
|
|
}), mergedItemRender(item, params, itemRenderRoutes, paths, href));
|
|
});
|
|
} else if (children) {
|
|
const childrenLength = (0,toArray/* default */.Z)(children).length;
|
|
crumbs = (0,toArray/* default */.Z)(children).map((element, index) => {
|
|
if (!element) {
|
|
return element;
|
|
}
|
|
// =================== Warning =====================
|
|
if (false) {}
|
|
false ? 0 : void 0;
|
|
const isLastItem = index === childrenLength - 1;
|
|
return (0,reactNode/* cloneElement */.Tm)(element, {
|
|
separator: isLastItem ? '' : separator,
|
|
key: index
|
|
});
|
|
});
|
|
}
|
|
const breadcrumbClassName = _classnames_2_5_1_classnames_default()(prefixCls, breadcrumb === null || breadcrumb === void 0 ? void 0 : breadcrumb.className, {
|
|
[`${prefixCls}-rtl`]: direction === 'rtl'
|
|
}, className, rootClassName, hashId);
|
|
const mergedStyle = Object.assign(Object.assign({}, breadcrumb === null || breadcrumb === void 0 ? void 0 : breadcrumb.style), style);
|
|
return wrapSSR( /*#__PURE__*/_react_17_0_2_react.createElement("nav", Object.assign({
|
|
className: breadcrumbClassName,
|
|
style: mergedStyle
|
|
}, restProps), /*#__PURE__*/_react_17_0_2_react.createElement("ol", null, crumbs)));
|
|
};
|
|
Breadcrumb.Item = breadcrumb_BreadcrumbItem;
|
|
Breadcrumb.Separator = breadcrumb_BreadcrumbSeparator;
|
|
if (false) {}
|
|
/* harmony default export */ var breadcrumb_Breadcrumb = (Breadcrumb);
|
|
;// CONCATENATED MODULE: ./node_modules/_antd@5.9.0@antd/es/breadcrumb/index.js
|
|
"use client";
|
|
|
|
|
|
/* harmony default export */ var breadcrumb = (breadcrumb_Breadcrumb);
|
|
|
|
/***/ })
|
|
|
|
}]); |