|
|
"use strict";
|
|
|
(self["webpackChunk"] = self["webpackChunk"] || []).push([[38447],{
|
|
|
|
|
|
/***/ 84319:
|
|
|
/*!***********************************************************************!*\
|
|
|
!*** ./src/pages/virtualSpaces/Lists/Knowledge/index.tsx + 3 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 */ Knowledge; }
|
|
|
});
|
|
|
|
|
|
// EXTERNAL MODULE: ./node_modules/_@babel_runtime@7.23.6@@babel/runtime/helpers/regeneratorRuntime.js
|
|
|
var regeneratorRuntime = __webpack_require__(7557);
|
|
|
var regeneratorRuntime_default = /*#__PURE__*/__webpack_require__.n(regeneratorRuntime);
|
|
|
// EXTERNAL MODULE: ./node_modules/_@babel_runtime@7.23.6@@babel/runtime/helpers/objectSpread2.js
|
|
|
var objectSpread2 = __webpack_require__(82242);
|
|
|
var objectSpread2_default = /*#__PURE__*/__webpack_require__.n(objectSpread2);
|
|
|
// EXTERNAL MODULE: ./node_modules/_@babel_runtime@7.23.6@@babel/runtime/helpers/asyncToGenerator.js
|
|
|
var asyncToGenerator = __webpack_require__(41498);
|
|
|
var asyncToGenerator_default = /*#__PURE__*/__webpack_require__.n(asyncToGenerator);
|
|
|
// EXTERNAL MODULE: ./node_modules/_@babel_runtime@7.23.6@@babel/runtime/helpers/slicedToArray.js
|
|
|
var slicedToArray = __webpack_require__(79800);
|
|
|
var slicedToArray_default = /*#__PURE__*/__webpack_require__.n(slicedToArray);
|
|
|
// EXTERNAL MODULE: ./node_modules/_react@17.0.2@react/index.js
|
|
|
var _react_17_0_2_react = __webpack_require__(59301);
|
|
|
// EXTERNAL MODULE: ./src/.umi-production/exports.ts
|
|
|
var _umi_production_exports = __webpack_require__(80608);
|
|
|
// 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/row/index.js
|
|
|
var row = __webpack_require__(95237);
|
|
|
// EXTERNAL MODULE: ./node_modules/_antd@5.9.0@antd/es/spin/index.js + 1 modules
|
|
|
var spin = __webpack_require__(71418);
|
|
|
;// CONCATENATED MODULE: ./src/pages/virtualSpaces/Lists/Knowledge/index.less?modules
|
|
|
// extracted by mini-css-extract-plugin
|
|
|
/* harmony default export */ var Knowledgemodules = ({"flex_box_center":"flex_box_center___JKPl3","flex_space_between":"flex_space_between___QuVBb","flex_box_vertical_center":"flex_box_vertical_center___Ksaxh","flex_box_center_end":"flex_box_center_end___nIhjx","flex_box_column":"flex_box_column___NAJ16","wrap":"wrap___NZWPs","content":"content___OLcvS","name":"name____Thh2","list":"list___F7fxl","head":"head___ffJpn","models":"models___kudCc","btns":"btns___CQDPq","rowsHead":"rowsHead___oC1SU","time":"time___r7Qed","rowsBody":"rowsBody___ZNF9c"});
|
|
|
// EXTERNAL MODULE: ./src/utils/fetch.ts
|
|
|
var fetch = __webpack_require__(49105);
|
|
|
// EXTERNAL MODULE: ./src/components/ui-customization/index.tsx + 30 modules
|
|
|
var ui_customization = __webpack_require__(92073);
|
|
|
// EXTERNAL MODULE: ./src/components/markdown-editor/index.tsx + 10 modules
|
|
|
var markdown_editor = __webpack_require__(77036);
|
|
|
// EXTERNAL MODULE: ./src/components/RenderHtml/index.tsx + 2 modules
|
|
|
var RenderHtml = __webpack_require__(47759);
|
|
|
// EXTERNAL MODULE: ./src/components/ui-customization/reset.less?modules
|
|
|
var resetmodules = __webpack_require__(11806);
|
|
|
// EXTERNAL MODULE: ./src/utils/authority.ts
|
|
|
var authority = __webpack_require__(75916);
|
|
|
// EXTERNAL MODULE: ./src/utils/util.tsx
|
|
|
var util = __webpack_require__(27876);
|
|
|
// EXTERNAL MODULE: ./node_modules/_@babel_runtime@7.23.6@@babel/runtime/helpers/classCallCheck.js
|
|
|
var classCallCheck = __webpack_require__(82100);
|
|
|
var classCallCheck_default = /*#__PURE__*/__webpack_require__.n(classCallCheck);
|
|
|
// EXTERNAL MODULE: ./node_modules/_@babel_runtime@7.23.6@@babel/runtime/helpers/createClass.js
|
|
|
var createClass = __webpack_require__(29186);
|
|
|
var createClass_default = /*#__PURE__*/__webpack_require__.n(createClass);
|
|
|
// EXTERNAL MODULE: ./node_modules/_@babel_runtime@7.23.6@@babel/runtime/helpers/get.js
|
|
|
var get = __webpack_require__(4811);
|
|
|
var get_default = /*#__PURE__*/__webpack_require__.n(get);
|
|
|
// EXTERNAL MODULE: ./node_modules/_@babel_runtime@7.23.6@@babel/runtime/helpers/getPrototypeOf.js
|
|
|
var getPrototypeOf = __webpack_require__(34577);
|
|
|
var getPrototypeOf_default = /*#__PURE__*/__webpack_require__.n(getPrototypeOf);
|
|
|
// EXTERNAL MODULE: ./node_modules/_@babel_runtime@7.23.6@@babel/runtime/helpers/inherits.js
|
|
|
var inherits = __webpack_require__(80619);
|
|
|
var inherits_default = /*#__PURE__*/__webpack_require__.n(inherits);
|
|
|
// EXTERNAL MODULE: ./node_modules/_@babel_runtime@7.23.6@@babel/runtime/helpers/createSuper.js
|
|
|
var createSuper = __webpack_require__(47074);
|
|
|
var createSuper_default = /*#__PURE__*/__webpack_require__.n(createSuper);
|
|
|
// EXTERNAL MODULE: ./node_modules/_antd@5.9.0@antd/es/form/index.js + 19 modules
|
|
|
var es_form = __webpack_require__(78241);
|
|
|
// EXTERNAL MODULE: ./node_modules/_antd@5.9.0@antd/es/message/index.js + 4 modules
|
|
|
var message = __webpack_require__(8591);
|
|
|
// EXTERNAL MODULE: ./node_modules/_antd@5.9.0@antd/es/button/index.js
|
|
|
var es_button = __webpack_require__(3113);
|
|
|
// 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/dropdown/index.js + 1 modules
|
|
|
var dropdown = __webpack_require__(38854);
|
|
|
// EXTERNAL MODULE: ./node_modules/_antd@5.9.0@antd/es/select/index.js
|
|
|
var es_select = __webpack_require__(57809);
|
|
|
// EXTERNAL MODULE: ./node_modules/_antd@5.9.0@antd/es/input/index.js + 3 modules
|
|
|
var input = __webpack_require__(92832);
|
|
|
// EXTERNAL MODULE: ./node_modules/_antd@5.9.0@antd/es/tree/index.js + 8 modules
|
|
|
var tree = __webpack_require__(32985);
|
|
|
// 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/upload/index.js
|
|
|
var upload = __webpack_require__(60028);
|
|
|
// EXTERNAL MODULE: ./node_modules/_gojs-react@1.1.2@gojs-react/lib/esm/gojsreact.js + 1 modules
|
|
|
var gojsreact = __webpack_require__(85160);
|
|
|
// EXTERNAL MODULE: ./node_modules/_gojs3@2.3.10@gojs3/release/go-module.js
|
|
|
var go_module = __webpack_require__(12378);
|
|
|
// EXTERNAL MODULE: ./src/utils/fullscreen.ts
|
|
|
var fullscreen = __webpack_require__(25526);
|
|
|
;// CONCATENATED MODULE: ./src/pages/virtualSpaces/Lists/Knowledge/knowledge/index.less?modules
|
|
|
// extracted by mini-css-extract-plugin
|
|
|
/* harmony default export */ var knowledgemodules = ({"flex_box_center":"flex_box_center___dw6yv","flex_space_between":"flex_space_between___bkc32","flex_box_vertical_center":"flex_box_vertical_center___jDpm2","flex_box_center_end":"flex_box_center_end___g9JOB","flex_box_column":"flex_box_column___ngIjI","diagram-component":"diagram-component___fHDp0","rightmodal":"rightmodal___Fwj_F","title":"title___YZZgl","button":"button___yQKxh","linetitles":"linetitles___CFVw5","line":"line___hSEjG","additem":"additem___cy1wv","lebels":"lebels___E2znG","describe":"describe___emw2X","describetitle":"describetitle___bgNOs","ehover":"ehover____RCDx","dhover":"dhover___IP_3b","header":"header___PCDQg","headeractivite":"headeractivite___x56tJ"});
|
|
|
// EXTERNAL MODULE: ./src/components/NoData/index.tsx
|
|
|
var NoData = __webpack_require__(6638);
|
|
|
// EXTERNAL MODULE: ./src/utils/env.ts + 1 modules
|
|
|
var env = __webpack_require__(71681);
|
|
|
// EXTERNAL MODULE: ./node_modules/_react-draggable@4.4.6@react-draggable/build/cjs/cjs.js
|
|
|
var cjs = __webpack_require__(12911);
|
|
|
var cjs_default = /*#__PURE__*/__webpack_require__.n(cjs);
|
|
|
// EXTERNAL MODULE: ./node_modules/_react@17.0.2@react/jsx-runtime.js
|
|
|
var jsx_runtime = __webpack_require__(37712);
|
|
|
;// CONCATENATED MODULE: ./src/pages/virtualSpaces/Lists/Knowledge/knowledge/index.tsx
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
var ContinuousForceDirectedLayout = /*#__PURE__*/function (_go$ForceDirectedLayo) {
|
|
|
inherits_default()(ContinuousForceDirectedLayout, _go$ForceDirectedLayo);
|
|
|
var _super = createSuper_default()(ContinuousForceDirectedLayout);
|
|
|
function ContinuousForceDirectedLayout() {
|
|
|
classCallCheck_default()(this, ContinuousForceDirectedLayout);
|
|
|
return _super.apply(this, arguments);
|
|
|
}
|
|
|
createClass_default()(ContinuousForceDirectedLayout, [{
|
|
|
key: "isFixed",
|
|
|
value: function isFixed(v) {
|
|
|
return v.node.isSelected;
|
|
|
}
|
|
|
}, {
|
|
|
key: "doLayout",
|
|
|
value: function doLayout(coll) {
|
|
|
var _this = this;
|
|
|
if (!this._isObserving) {
|
|
|
this._isObserving = true;
|
|
|
this.diagram.addModelChangedListener(function (e) {
|
|
|
if (e.modelChange !== "" || e.change === go_module/* ChangedEvent */.Vk.Transaction && e.propertyName === "StartingFirstTransaction") {
|
|
|
_this.network = null;
|
|
|
}
|
|
|
});
|
|
|
}
|
|
|
var net = this.network;
|
|
|
if (net === null) {
|
|
|
this.network = net = this.makeNetwork(coll);
|
|
|
} else {
|
|
|
this.diagram.nodes.each(function (n) {
|
|
|
var v = net.findVertex(n);
|
|
|
if (v !== null) v.bounds = n.actualBounds;
|
|
|
});
|
|
|
}
|
|
|
get_default()(getPrototypeOf_default()(ContinuousForceDirectedLayout.prototype), "doLayout", this).call(this, coll);
|
|
|
this.network = net;
|
|
|
}
|
|
|
}]);
|
|
|
return ContinuousForceDirectedLayout;
|
|
|
}(go_module/* ForceDirectedLayout */.hD);
|
|
|
var colors = ['#3CDAA3', '#9C41DE', '#F84F90', '#30A7F1', '#6656FF'];
|
|
|
var textcolor = ['根节点', '课件知识单元', '实训知识单元', '文本知识单元', '知识点'];
|
|
|
var Atlas = function Atlas(_ref) {
|
|
|
var _items$relations, _items$descriptions;
|
|
|
var globalSetting = _ref.globalSetting,
|
|
|
dispatch = _ref.dispatch,
|
|
|
virtualSpaces = _ref.virtualSpaces;
|
|
|
var params = (0,_umi_production_exports.useParams)();
|
|
|
var diagramRef = (0,_react_17_0_2_react.useRef)();
|
|
|
var _useState = (0,_react_17_0_2_react.useState)(false),
|
|
|
_useState2 = slicedToArray_default()(_useState, 2),
|
|
|
upname = _useState2[0],
|
|
|
setupname = _useState2[1];
|
|
|
var _useState3 = (0,_react_17_0_2_react.useState)(false),
|
|
|
_useState4 = slicedToArray_default()(_useState3, 2),
|
|
|
buttonloading = _useState4[0],
|
|
|
setbuttonloading = _useState4[1];
|
|
|
var _useState5 = (0,_react_17_0_2_react.useState)(false),
|
|
|
_useState6 = slicedToArray_default()(_useState5, 2),
|
|
|
additem = _useState6[0],
|
|
|
setadditem = _useState6[1];
|
|
|
var _useState7 = (0,_react_17_0_2_react.useState)(false),
|
|
|
_useState8 = slicedToArray_default()(_useState7, 2),
|
|
|
addunit = _useState8[0],
|
|
|
setaddunit = _useState8[1];
|
|
|
var _useState9 = (0,_react_17_0_2_react.useState)(true),
|
|
|
_useState10 = slicedToArray_default()(_useState9, 2),
|
|
|
ismind = _useState10[0],
|
|
|
setismind = _useState10[1];
|
|
|
var _useState11 = (0,_react_17_0_2_react.useState)(false),
|
|
|
_useState12 = slicedToArray_default()(_useState11, 2),
|
|
|
sploading = _useState12[0],
|
|
|
setsploading = _useState12[1];
|
|
|
var _useState13 = (0,_react_17_0_2_react.useState)({}),
|
|
|
_useState14 = slicedToArray_default()(_useState13, 2),
|
|
|
items = _useState14[0],
|
|
|
setitems = _useState14[1];
|
|
|
var _Form$useForm = es_form/* default */.Z.useForm(),
|
|
|
_Form$useForm2 = slicedToArray_default()(_Form$useForm, 1),
|
|
|
form = _Form$useForm2[0];
|
|
|
var _useState15 = (0,_react_17_0_2_react.useState)(false),
|
|
|
_useState16 = slicedToArray_default()(_useState15, 2),
|
|
|
relation = _useState16[0],
|
|
|
setrelation = _useState16[1];
|
|
|
var _useState17 = (0,_react_17_0_2_react.useState)(true),
|
|
|
_useState18 = slicedToArray_default()(_useState17, 2),
|
|
|
urldisabled = _useState18[0],
|
|
|
seturldisabled = _useState18[1];
|
|
|
var _useState19 = (0,_react_17_0_2_react.useState)({
|
|
|
index: '',
|
|
|
name: '',
|
|
|
add: false
|
|
|
}),
|
|
|
_useState20 = slicedToArray_default()(_useState19, 2),
|
|
|
describe = _useState20[0],
|
|
|
setdescribe = _useState20[1];
|
|
|
var _useState21 = (0,_react_17_0_2_react.useState)({}),
|
|
|
_useState22 = slicedToArray_default()(_useState21, 2),
|
|
|
datas = _useState22[0],
|
|
|
setdatas = _useState22[1];
|
|
|
var containerRef = (0,_react_17_0_2_react.useRef)(null);
|
|
|
var _useState23 = (0,_react_17_0_2_react.useState)(false),
|
|
|
_useState24 = slicedToArray_default()(_useState23, 2),
|
|
|
IsFulls = _useState24[0],
|
|
|
setIsFull = _useState24[1];
|
|
|
var _useState25 = (0,_react_17_0_2_react.useState)(false),
|
|
|
_useState26 = slicedToArray_default()(_useState25, 2),
|
|
|
exportshow = _useState26[0],
|
|
|
setexport = _useState26[1];
|
|
|
var _useState27 = (0,_react_17_0_2_react.useState)([]),
|
|
|
_useState28 = slicedToArray_default()(_useState27, 2),
|
|
|
fileList = _useState28[0],
|
|
|
setFileList = _useState28[1];
|
|
|
var _useState29 = (0,_react_17_0_2_react.useState)([]),
|
|
|
_useState30 = slicedToArray_default()(_useState29, 2),
|
|
|
three = _useState30[0],
|
|
|
setthree = _useState30[1];
|
|
|
var _useState31 = (0,_react_17_0_2_react.useState)([]),
|
|
|
_useState32 = slicedToArray_default()(_useState31, 2),
|
|
|
expandedKeys = _useState32[0],
|
|
|
setExpandedKeys = _useState32[1];
|
|
|
var _useState33 = (0,_react_17_0_2_react.useState)(''),
|
|
|
_useState34 = slicedToArray_default()(_useState33, 2),
|
|
|
searchValue = _useState34[0],
|
|
|
setSearchValue = _useState34[1];
|
|
|
var _useState35 = (0,_react_17_0_2_react.useState)(true),
|
|
|
_useState36 = slicedToArray_default()(_useState35, 2),
|
|
|
autoExpandParent = _useState36[0],
|
|
|
setAutoExpandParent = _useState36[1];
|
|
|
var _useState37 = (0,_react_17_0_2_react.useState)(),
|
|
|
_useState38 = slicedToArray_default()(_useState37, 2),
|
|
|
AddModal = _useState38[0],
|
|
|
setAddModal = _useState38[1];
|
|
|
var _useState39 = (0,_react_17_0_2_react.useState)([]),
|
|
|
_useState40 = slicedToArray_default()(_useState39, 2),
|
|
|
threelist = _useState40[0],
|
|
|
setthreelist = _useState40[1];
|
|
|
var _useState41 = (0,_react_17_0_2_react.useState)(false),
|
|
|
_useState42 = slicedToArray_default()(_useState41, 2),
|
|
|
showadd = _useState42[0],
|
|
|
setshowadd = _useState42[1];
|
|
|
var _useState43 = (0,_react_17_0_2_react.useState)(false),
|
|
|
_useState44 = slicedToArray_default()(_useState43, 2),
|
|
|
selectmodal = _useState44[0],
|
|
|
setselectmodal = _useState44[1];
|
|
|
var relationshipDiagramRef = (0,_react_17_0_2_react.useRef)();
|
|
|
var treeDiagramRef = (0,_react_17_0_2_react.useRef)();
|
|
|
var _useState45 = (0,_react_17_0_2_react.useState)(false),
|
|
|
_useState46 = slicedToArray_default()(_useState45, 2),
|
|
|
disabled = _useState46[0],
|
|
|
setDisabled = _useState46[1];
|
|
|
var _useState47 = (0,_react_17_0_2_react.useState)({
|
|
|
left: 0,
|
|
|
top: 0,
|
|
|
bottom: 0,
|
|
|
right: 0
|
|
|
}),
|
|
|
_useState48 = slicedToArray_default()(_useState47, 2),
|
|
|
bounds = _useState48[0],
|
|
|
setBounds = _useState48[1];
|
|
|
var draggleRef = (0,_react_17_0_2_react.useRef)(null);
|
|
|
var virtualSpacesDetails = virtualSpaces.virtualSpacesDetails;
|
|
|
var permission = (virtualSpacesDetails === null || virtualSpacesDetails === void 0 ? void 0 : virtualSpacesDetails.is_member) || (0,authority/* isSuperAdmins */.Ny)();
|
|
|
var _useState49 = (0,_react_17_0_2_react.useState)(false),
|
|
|
_useState50 = slicedToArray_default()(_useState49, 2),
|
|
|
threenodata = _useState50[0],
|
|
|
setThreenodata = _useState50[1];
|
|
|
var _onStart = function onStart(_event, uiData) {
|
|
|
var _draggleRef$current;
|
|
|
var _window$document$docu = window.document.documentElement,
|
|
|
clientWidth = _window$document$docu.clientWidth,
|
|
|
clientHeight = _window$document$docu.clientHeight;
|
|
|
var targetRect = (_draggleRef$current = draggleRef.current) === null || _draggleRef$current === void 0 ? void 0 : _draggleRef$current.getBoundingClientRect();
|
|
|
setBounds({
|
|
|
left: -targetRect.left + uiData.x,
|
|
|
right: clientWidth - (targetRect.right - uiData.x),
|
|
|
top: -targetRect.top + uiData.y,
|
|
|
bottom: clientHeight - (targetRect.bottom - uiData.y) - 70
|
|
|
});
|
|
|
};
|
|
|
var _useState51 = (0,_react_17_0_2_react.useState)(600),
|
|
|
_useState52 = slicedToArray_default()(_useState51, 2),
|
|
|
widths = _useState52[0],
|
|
|
setwidths = _useState52[1];
|
|
|
(0,_react_17_0_2_react.useEffect)(function () {
|
|
|
setdatas({});
|
|
|
getdatas();
|
|
|
}, [params, ismind]);
|
|
|
(0,_react_17_0_2_react.useEffect)(function () {
|
|
|
treeChart();
|
|
|
message/* default */.ZP.config({
|
|
|
getContainer: function getContainer() {
|
|
|
return containerRef.current;
|
|
|
},
|
|
|
top: 100
|
|
|
});
|
|
|
}, []);
|
|
|
var treeChart = function treeChart() {
|
|
|
if (treeDiagramRef.current) return;
|
|
|
var $ = go_module/* GraphObject */.bx.make;
|
|
|
var myDiagram = new go_module/* Diagram */.S0("myDiagramDiv", {
|
|
|
// when the user drags a node, also move/copy/delete the whole subtree starting with that node
|
|
|
"commandHandler.copiesTree": false,
|
|
|
"commandHandler.copiesParentKey": false,
|
|
|
"commandHandler.deletesTree": false,
|
|
|
"draggingTool.dragsTree": false,
|
|
|
"undoManager.isEnabled": false,
|
|
|
"doubleClick": false
|
|
|
});
|
|
|
treeDiagramRef.current = myDiagram;
|
|
|
var layout = go_module/* GraphObject */.bx.make(go_module/* TreeLayout */.FF);
|
|
|
layout.angle = 0;
|
|
|
layout.arrangement = go_module/* TreeLayout */.FF.ArrangementFixedRoots;
|
|
|
myDiagram.layout = layout;
|
|
|
myDiagram.nodeTemplate = $(go_module/* Node */.NB, "Vertical", {
|
|
|
selectionObjectName: "TEXT"
|
|
|
}, $(go_module/* TextBlock */.al, {
|
|
|
name: "TEXT",
|
|
|
minSize: new go_module/* Size */.$u(30, 15)
|
|
|
},
|
|
|
// remember not only the text string but the scale and the font in the node data
|
|
|
new go_module/* Binding */.KX("text", "text").makeTwoWay(), new go_module/* Binding */.KX("scale", "scale").makeTwoWay(), new go_module/* Binding */.KX("font", "font").makeTwoWay()), $(go_module/* Shape */.bn, "LineH", {
|
|
|
stretch: go_module/* GraphObject */.bx.Horizontal,
|
|
|
strokeWidth: 3,
|
|
|
height: 3,
|
|
|
// this line shape is the port -- what links connect with
|
|
|
portId: "",
|
|
|
fromSpot: go_module/* Spot */.z6.LeftRightSides,
|
|
|
toSpot: go_module/* Spot */.z6.LeftRightSides
|
|
|
}, new go_module/* Binding */.KX("stroke", "brush"),
|
|
|
// make sure links come in from the proper direction and go out appropriately
|
|
|
new go_module/* Binding */.KX("fromSpot", "dir", function (d) {
|
|
|
return spotConverter(d, true);
|
|
|
}), new go_module/* Binding */.KX("toSpot", "dir", function (d) {
|
|
|
return spotConverter(d, false);
|
|
|
})),
|
|
|
// remember the locations of each node in the node data
|
|
|
new go_module/* Binding */.KX("location", "loc", go_module/* Point */.E9.parse).makeTwoWay(go_module/* Point */.E9.stringify),
|
|
|
// make sure text "grows" in the desired direction
|
|
|
new go_module/* Binding */.KX("locationSpot", "dir", function (d) {
|
|
|
return spotConverter(d, false);
|
|
|
}), {
|
|
|
click: function click(e, thisObj) {
|
|
|
if (permission) {
|
|
|
setitems(thisObj === null || thisObj === void 0 ? void 0 : thisObj.data);
|
|
|
setBounds({
|
|
|
left: 0,
|
|
|
top: 0,
|
|
|
bottom: 0,
|
|
|
right: 0
|
|
|
});
|
|
|
} else {
|
|
|
var _thisObj$data, _thisObj$data2;
|
|
|
if (!(thisObj !== null && thisObj !== void 0 && (_thisObj$data = thisObj.data) !== null && _thisObj$data !== void 0 && _thisObj$data.url)) {
|
|
|
return;
|
|
|
}
|
|
|
window.open(thisObj === null || thisObj === void 0 || (_thisObj$data2 = thisObj.data) === null || _thisObj$data2 === void 0 ? void 0 : _thisObj$data2.url);
|
|
|
}
|
|
|
// setitems(thisObj?.data)
|
|
|
}
|
|
|
});
|
|
|
myDiagram.allowDoubleClick = false;
|
|
|
myDiagram.allowSelect = "single";
|
|
|
myDiagram.commandHandler.canDeleteSelection = false;
|
|
|
myDiagram.commandHandler.canUndo = false;
|
|
|
var clickSelectingTool = myDiagram.toolManager.clickSelectingTool;
|
|
|
clickSelectingTool.canStartMulti = false;
|
|
|
myDiagram.linkTemplate = $(go_module/* Link */.rU, {
|
|
|
curve: go_module/* Link */.rU.Bezier,
|
|
|
fromShortLength: -2,
|
|
|
toShortLength: -2,
|
|
|
selectable: false
|
|
|
}, $(go_module/* Shape */.bn, {
|
|
|
strokeWidth: 3
|
|
|
}, new go_module/* Binding */.KX("stroke", "toNode", function (n) {
|
|
|
if (n.data.brush) return n.data.brush;
|
|
|
return "black";
|
|
|
}).ofObject()));
|
|
|
};
|
|
|
function loadTreeChart(nodeData) {
|
|
|
treeDiagramRef.current.model = go_module/* Model */.Hn.fromJson(JSON.stringify({
|
|
|
"class": "go.TreeModel",
|
|
|
"nodeDataArray": nodeData.map(function (item) {
|
|
|
item.brush = colors[item.unit_type];
|
|
|
return item;
|
|
|
})
|
|
|
}));
|
|
|
}
|
|
|
function getdatas() {
|
|
|
return _getdatas.apply(this, arguments);
|
|
|
}
|
|
|
function _getdatas() {
|
|
|
_getdatas = asyncToGenerator_default()( /*#__PURE__*/regeneratorRuntime_default()().mark(function _callee16() {
|
|
|
var url, res, _res$nodeData, _res$nodeData2, ritems, item;
|
|
|
return regeneratorRuntime_default()().wrap(function _callee16$(_context16) {
|
|
|
while (1) switch (_context16.prev = _context16.next) {
|
|
|
case 0:
|
|
|
url = ismind ? "/api/knowledge_graphs/tree.json" : "/api/knowledge_graphs/map.json";
|
|
|
_context16.next = 3;
|
|
|
return (0,fetch/* default */.ZP)(url, {
|
|
|
method: 'get',
|
|
|
params: {
|
|
|
type: 2,
|
|
|
identifier: params.virtual_spacesId
|
|
|
}
|
|
|
});
|
|
|
case 3:
|
|
|
res = _context16.sent;
|
|
|
if (res.status === 0) {
|
|
|
ritems = res === null || res === void 0 || (_res$nodeData = res.nodeData) === null || _res$nodeData === void 0 ? void 0 : _res$nodeData.map(function (item, index) {
|
|
|
return objectSpread2_default()(objectSpread2_default()({}, item), {}, {
|
|
|
bgcolor: colors[item.unit_type],
|
|
|
parent: item.parent_id
|
|
|
});
|
|
|
});
|
|
|
setdatas(objectSpread2_default()(objectSpread2_default()({}, res), {}, {
|
|
|
nodeData: ritems
|
|
|
}));
|
|
|
if (ismind) {
|
|
|
loadTreeChart(ritems);
|
|
|
setTimeout(function () {
|
|
|
zoomToFit();
|
|
|
}, 300);
|
|
|
} else {
|
|
|
zoomToFit();
|
|
|
}
|
|
|
item = res === null || res === void 0 || (_res$nodeData2 = res.nodeData) === null || _res$nodeData2 === void 0 ? void 0 : _res$nodeData2.filter(function (item) {
|
|
|
return item.id === items.id;
|
|
|
});
|
|
|
if ((item === null || item === void 0 ? void 0 : item.length) > 0) {
|
|
|
setitems(objectSpread2_default()({}, item === null || item === void 0 ? void 0 : item[0]));
|
|
|
}
|
|
|
}
|
|
|
case 5:
|
|
|
case "end":
|
|
|
return _context16.stop();
|
|
|
}
|
|
|
}, _callee16);
|
|
|
}));
|
|
|
return _getdatas.apply(this, arguments);
|
|
|
}
|
|
|
var Draggers = {
|
|
|
onRemove: function onRemove() {
|
|
|
setFileList([]);
|
|
|
},
|
|
|
beforeUpload: function beforeUpload(file) {
|
|
|
console.log(file);
|
|
|
if ((file === null || file === void 0 ? void 0 : file.size) > 1024 * 1024 * 50) {
|
|
|
message/* default */.ZP.info('文件超过50M,不符合上传要求');
|
|
|
return false;
|
|
|
}
|
|
|
var filelist = [];
|
|
|
filelist.push(file);
|
|
|
setFileList([].concat(filelist));
|
|
|
return false;
|
|
|
},
|
|
|
fileList: fileList,
|
|
|
accept: ".xls,.xlsx"
|
|
|
};
|
|
|
var treeData = (0,_react_17_0_2_react.useMemo)(function () {
|
|
|
var loop = function loop(data) {
|
|
|
return data.map(function (item) {
|
|
|
var strTitle = item.title;
|
|
|
var index = strTitle.indexOf(searchValue);
|
|
|
var beforeStr = strTitle.substring(0, index);
|
|
|
var afterStr = strTitle.slice(index + searchValue.length);
|
|
|
var title = index > -1 ? /*#__PURE__*/(0,jsx_runtime.jsxs)("span", {
|
|
|
children: [beforeStr, /*#__PURE__*/(0,jsx_runtime.jsx)("span", {
|
|
|
style: {
|
|
|
color: '#f50'
|
|
|
},
|
|
|
children: searchValue
|
|
|
}), afterStr]
|
|
|
}) : /*#__PURE__*/(0,jsx_runtime.jsx)("span", {
|
|
|
children: strTitle
|
|
|
});
|
|
|
if (item.children) {
|
|
|
return {
|
|
|
title: title,
|
|
|
key: item.key,
|
|
|
children: loop(item.children)
|
|
|
};
|
|
|
}
|
|
|
return {
|
|
|
title: title,
|
|
|
key: item.key
|
|
|
};
|
|
|
});
|
|
|
};
|
|
|
return loop(three);
|
|
|
}, [searchValue, three]);
|
|
|
function initDiagram() {
|
|
|
var $ = go_module/* GraphObject */.bx.make;
|
|
|
var myDiagram = $(go_module/* Diagram */.S0, {
|
|
|
allowSelect: false,
|
|
|
'undoManager.isEnabled': true,
|
|
|
// 'clickCreatingTool.archetypeNodeData': { text: 'new node', color: 'lightblue' },
|
|
|
initialAutoScale: go_module/* Diagram */.S0.Uniform,
|
|
|
contentAlignment: go_module/* Spot */.z6.Center,
|
|
|
layout: $(ContinuousForceDirectedLayout, {
|
|
|
defaultSpringLength: 30,
|
|
|
defaultElectricalCharge: 100
|
|
|
}),
|
|
|
"SelectionMoved": function SelectionMoved(e) {
|
|
|
return e.diagram.layout.invalidateLayout();
|
|
|
},
|
|
|
model: $(go_module/* GraphLinksModel */.FJ, {
|
|
|
linkKeyProperty: 'key',
|
|
|
makeUniqueKeyFunction: function makeUniqueKeyFunction(m, data) {
|
|
|
var k = data.key || 1;
|
|
|
while (m.findNodeDataForKey(k)) k++;
|
|
|
data.key = k;
|
|
|
return k;
|
|
|
},
|
|
|
makeUniqueLinkKeyFunction: function makeUniqueLinkKeyFunction(m, data) {
|
|
|
var k = data.key || -1;
|
|
|
while (m.findLinkDataForKey(k)) k--;
|
|
|
data.key = k;
|
|
|
return k;
|
|
|
}
|
|
|
})
|
|
|
});
|
|
|
myDiagram.toolManager.draggingTool.doMouseMove = function () {
|
|
|
// method override must be function, not =>
|
|
|
go_module/* DraggingTool */.h1.prototype.doMouseMove.call(this);
|
|
|
if (this.isActive) this.diagram.layout.doLayout(true);
|
|
|
};
|
|
|
myDiagram.nodeTemplate = $(go_module/* Node */.NB, "Auto", {
|
|
|
minSize: new go_module/* Size */.$u(100, 100)
|
|
|
}, $(go_module/* Shape */.bn, "Circle", {
|
|
|
stroke: "white",
|
|
|
spot1: new go_module/* Spot */.z6(0, 0, 5, 5),
|
|
|
spot2: new go_module/* Spot */.z6(1, 1, -5, -5)
|
|
|
}, new go_module/* Binding */.KX('fill', 'bgcolor')), $(go_module/* TextBlock */.al, {
|
|
|
font: "bold 10pt helvetica, bold arial, sans-serif",
|
|
|
stroke: 'white',
|
|
|
textAlign: "center",
|
|
|
maxSize: new go_module/* Size */.$u(100, NaN)
|
|
|
}, new go_module/* Binding */.KX('text', 'text')), {
|
|
|
click: function click(e, thisObj) {
|
|
|
if (permission) {
|
|
|
setitems(thisObj === null || thisObj === void 0 ? void 0 : thisObj.data);
|
|
|
setBounds({
|
|
|
left: 0,
|
|
|
top: 0,
|
|
|
bottom: 0,
|
|
|
right: 0
|
|
|
});
|
|
|
} else {
|
|
|
var _thisObj$data3, _thisObj$data4;
|
|
|
if (!(thisObj !== null && thisObj !== void 0 && (_thisObj$data3 = thisObj.data) !== null && _thisObj$data3 !== void 0 && _thisObj$data3.url)) {
|
|
|
return;
|
|
|
}
|
|
|
window.open(thisObj === null || thisObj === void 0 || (_thisObj$data4 = thisObj.data) === null || _thisObj$data4 === void 0 ? void 0 : _thisObj$data4.url);
|
|
|
}
|
|
|
}
|
|
|
});
|
|
|
myDiagram.linkTemplate = $(go_module/* Link */.rU,
|
|
|
// the whole link panel
|
|
|
{
|
|
|
layerName: 'Background'
|
|
|
}, $(go_module/* Shape */.bn,
|
|
|
// the link shape
|
|
|
{
|
|
|
stroke: "black"
|
|
|
}), $(go_module/* Shape */.bn,
|
|
|
// the arrowhead
|
|
|
{
|
|
|
toArrow: "standard",
|
|
|
stroke: null
|
|
|
}), $(go_module/* Panel */.s_, "Auto", $(go_module/* Shape */.bn, {
|
|
|
fill: $(go_module/* Brush */.BD, "Radial", {
|
|
|
0: "rgb(240, 240, 240)",
|
|
|
0.3: "rgb(240, 240, 240)",
|
|
|
1: "rgba(240, 240, 240, 0)"
|
|
|
}),
|
|
|
stroke: null
|
|
|
}), $(go_module/* TextBlock */.al,
|
|
|
// the label text
|
|
|
{
|
|
|
textAlign: "center",
|
|
|
font: "10pt helvetica, arial, sans-serif",
|
|
|
stroke: "#555555",
|
|
|
margin: 4
|
|
|
}, new go_module/* Binding */.KX("text", "text"))));
|
|
|
myDiagram.doubleClick = false;
|
|
|
myDiagram.allowDoubleClick = false;
|
|
|
myDiagram.allowSelect = "single";
|
|
|
myDiagram.commandHandler.canDeleteSelection = false;
|
|
|
myDiagram.commandHandler.canUndo = false;
|
|
|
myDiagram.allowInsert = false;
|
|
|
var clickSelectingTool = myDiagram.toolManager.clickSelectingTool;
|
|
|
clickSelectingTool.canStartMulti = false;
|
|
|
relationshipDiagramRef.current = myDiagram;
|
|
|
return myDiagram;
|
|
|
}
|
|
|
function spotConverter(dir, from) {
|
|
|
if (dir === "left") {
|
|
|
return from ? go_module/* Spot */.z6.Left : go_module/* Spot */.z6.Right;
|
|
|
} else {
|
|
|
return from ? go_module/* Spot */.z6.Right : go_module/* Spot */.z6.Left;
|
|
|
}
|
|
|
}
|
|
|
function zoomToFit() {
|
|
|
var _treeDiagramRef$curre, _treeDiagramRef$curre2, _relationshipDiagramR, _relationshipDiagramR2;
|
|
|
setwidths(600);
|
|
|
(_treeDiagramRef$curre = treeDiagramRef.current) === null || _treeDiagramRef$curre === void 0 || (_treeDiagramRef$curre2 = _treeDiagramRef$curre.zoomToFit) === null || _treeDiagramRef$curre2 === void 0 || _treeDiagramRef$curre2.call(_treeDiagramRef$curre);
|
|
|
(_relationshipDiagramR = relationshipDiagramRef.current) === null || _relationshipDiagramR === void 0 || (_relationshipDiagramR2 = _relationshipDiagramR.zoomToFit) === null || _relationshipDiagramR2 === void 0 || _relationshipDiagramR2.call(_relationshipDiagramR);
|
|
|
}
|
|
|
return /*#__PURE__*/(0,jsx_runtime.jsxs)("div", {
|
|
|
ref: containerRef,
|
|
|
style: {
|
|
|
paddingBottom: 20,
|
|
|
background: "#FFF",
|
|
|
position: 'relative',
|
|
|
height: '100vh'
|
|
|
},
|
|
|
children: [/*#__PURE__*/(0,jsx_runtime.jsxs)(spin/* default */.Z, {
|
|
|
spinning: sploading,
|
|
|
children: [(datas === null || datas === void 0 ? void 0 : datas.is_root) && /*#__PURE__*/(0,jsx_runtime.jsx)(NoData/* default */.Z, {
|
|
|
ButtonClick: /*#__PURE__*/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:
|
|
|
setsploading(true);
|
|
|
_context.next = 3;
|
|
|
return (0,fetch/* default */.ZP)("/api/knowledge_graphs/set_root.json", {
|
|
|
method: 'post',
|
|
|
body: {
|
|
|
type: 2,
|
|
|
identifier: params.virtual_spacesId
|
|
|
}
|
|
|
});
|
|
|
case 3:
|
|
|
res = _context.sent;
|
|
|
setsploading(false);
|
|
|
if (res.status === 0) {
|
|
|
getdatas();
|
|
|
}
|
|
|
case 6:
|
|
|
case "end":
|
|
|
return _context.stop();
|
|
|
}
|
|
|
}, _callee);
|
|
|
})),
|
|
|
buttonProps: {
|
|
|
type: 'primary'
|
|
|
},
|
|
|
ButtonText: permission && '新增节点',
|
|
|
ButtonTwo: permission && /*#__PURE__*/(0,jsx_runtime.jsx)(es_button/* default */.ZP, {
|
|
|
style: {
|
|
|
marginLeft: 20
|
|
|
},
|
|
|
onClick: function onClick() {
|
|
|
setexport(true);
|
|
|
},
|
|
|
type: "primary",
|
|
|
children: "\u6587\u4EF6\u5BFC\u5165"
|
|
|
}),
|
|
|
styles: {
|
|
|
margin: 'auto',
|
|
|
paddingTop: 100
|
|
|
}
|
|
|
}), !(datas !== null && datas !== void 0 && datas.is_root) && /*#__PURE__*/(0,jsx_runtime.jsxs)("div", {
|
|
|
style: {
|
|
|
height: 60,
|
|
|
border: '1px solid #e7e7e7',
|
|
|
display: 'flex'
|
|
|
},
|
|
|
children: [/*#__PURE__*/(0,jsx_runtime.jsxs)("div", {
|
|
|
onClick: function onClick() {
|
|
|
setismind(true);
|
|
|
setitems({});
|
|
|
},
|
|
|
className: ismind ? knowledgemodules.headeractivite : knowledgemodules.header,
|
|
|
children: [/*#__PURE__*/(0,jsx_runtime.jsxs)("div", {
|
|
|
children: [" ", /*#__PURE__*/(0,jsx_runtime.jsx)("i", {
|
|
|
className: "iconfont icon-zhishishu"
|
|
|
})]
|
|
|
}), /*#__PURE__*/(0,jsx_runtime.jsx)("div", {
|
|
|
children: "\u77E5\u8BC6\u6811"
|
|
|
})]
|
|
|
}), /*#__PURE__*/(0,jsx_runtime.jsxs)("div", {
|
|
|
onClick: function onClick() {
|
|
|
setismind(false);
|
|
|
setitems({});
|
|
|
},
|
|
|
className: ismind ? knowledgemodules.header : knowledgemodules.headeractivite,
|
|
|
children: [/*#__PURE__*/(0,jsx_runtime.jsxs)("div", {
|
|
|
children: [" ", /*#__PURE__*/(0,jsx_runtime.jsx)("i", {
|
|
|
className: "iconfont icon-guanxitu"
|
|
|
})]
|
|
|
}), /*#__PURE__*/(0,jsx_runtime.jsx)("div", {
|
|
|
children: "\u5173\u7CFB\u56FE"
|
|
|
})]
|
|
|
}), /*#__PURE__*/(0,jsx_runtime.jsxs)("div", {
|
|
|
onClick: function onClick() {
|
|
|
var _treeDiagramRef$curre3, _treeDiagramRef$curre4, _relationshipDiagramR3, _relationshipDiagramR4;
|
|
|
var viewportWidth = ismind ? treeDiagramRef.current.viewportBounds.width : relationshipDiagramRef.current.viewportBounds.width;
|
|
|
var viewportHeight = ismind ? treeDiagramRef.current.viewportBounds.height : relationshipDiagramRef.current.viewportBounds.height;
|
|
|
(_treeDiagramRef$curre3 = treeDiagramRef.current) === null || _treeDiagramRef$curre3 === void 0 || (_treeDiagramRef$curre4 = _treeDiagramRef$curre3.zoomToRect) === null || _treeDiagramRef$curre4 === void 0 || _treeDiagramRef$curre4.call(_treeDiagramRef$curre3, new go_module/* Rect */.UL(1, 1, viewportWidth / 1.1, viewportHeight / 1.1));
|
|
|
(_relationshipDiagramR3 = relationshipDiagramRef.current) === null || _relationshipDiagramR3 === void 0 || (_relationshipDiagramR4 = _relationshipDiagramR3.zoomToRect) === null || _relationshipDiagramR4 === void 0 || _relationshipDiagramR4.call(_relationshipDiagramR3, new go_module/* Rect */.UL(1, 1, viewportWidth / 1.1, viewportHeight / 1.1));
|
|
|
},
|
|
|
className: knowledgemodules.header,
|
|
|
children: [/*#__PURE__*/(0,jsx_runtime.jsxs)("div", {
|
|
|
children: [" ", /*#__PURE__*/(0,jsx_runtime.jsx)("i", {
|
|
|
className: "iconfont icon-fangda3"
|
|
|
})]
|
|
|
}), /*#__PURE__*/(0,jsx_runtime.jsx)("div", {
|
|
|
children: "\u653E\u5927"
|
|
|
})]
|
|
|
}), /*#__PURE__*/(0,jsx_runtime.jsxs)("div", {
|
|
|
onClick: function onClick() {
|
|
|
var _treeDiagramRef$curre5, _treeDiagramRef$curre6, _relationshipDiagramR5, _relationshipDiagramR6;
|
|
|
var viewportWidth = ismind ? treeDiagramRef.current.viewportBounds.width : relationshipDiagramRef.current.viewportBounds.width;
|
|
|
var viewportHeight = ismind ? treeDiagramRef.current.viewportBounds.height : relationshipDiagramRef.current.viewportBounds.height;
|
|
|
(_treeDiagramRef$curre5 = treeDiagramRef.current) === null || _treeDiagramRef$curre5 === void 0 || (_treeDiagramRef$curre6 = _treeDiagramRef$curre5.zoomToRect) === null || _treeDiagramRef$curre6 === void 0 || _treeDiagramRef$curre6.call(_treeDiagramRef$curre5, new go_module/* Rect */.UL(1, 1, viewportWidth * 1.1, viewportHeight * 1.1));
|
|
|
(_relationshipDiagramR5 = relationshipDiagramRef.current) === null || _relationshipDiagramR5 === void 0 || (_relationshipDiagramR6 = _relationshipDiagramR5.zoomToRect) === null || _relationshipDiagramR6 === void 0 || _relationshipDiagramR6.call(_relationshipDiagramR5, new go_module/* Rect */.UL(1, 1, viewportWidth * 1.1, viewportHeight * 1.1));
|
|
|
},
|
|
|
className: knowledgemodules.header,
|
|
|
children: [/*#__PURE__*/(0,jsx_runtime.jsxs)("div", {
|
|
|
children: [" ", /*#__PURE__*/(0,jsx_runtime.jsx)("i", {
|
|
|
className: "iconfont icon-suoxiao3"
|
|
|
})]
|
|
|
}), /*#__PURE__*/(0,jsx_runtime.jsx)("div", {
|
|
|
children: "\u7F29\u5C0F"
|
|
|
})]
|
|
|
}), /*#__PURE__*/(0,jsx_runtime.jsxs)("div", {
|
|
|
onClick: function onClick() {
|
|
|
var _treeDiagramRef$curre7, _treeDiagramRef$curre8, _relationshipDiagramR7, _relationshipDiagramR8;
|
|
|
setwidths(600);
|
|
|
(_treeDiagramRef$curre7 = treeDiagramRef.current) === null || _treeDiagramRef$curre7 === void 0 || (_treeDiagramRef$curre8 = _treeDiagramRef$curre7.zoomToFit) === null || _treeDiagramRef$curre8 === void 0 || _treeDiagramRef$curre8.call(_treeDiagramRef$curre7);
|
|
|
(_relationshipDiagramR7 = relationshipDiagramRef.current) === null || _relationshipDiagramR7 === void 0 || (_relationshipDiagramR8 = _relationshipDiagramR7.zoomToFit) === null || _relationshipDiagramR8 === void 0 || _relationshipDiagramR8.call(_relationshipDiagramR7);
|
|
|
},
|
|
|
className: knowledgemodules.header,
|
|
|
children: [/*#__PURE__*/(0,jsx_runtime.jsxs)("div", {
|
|
|
children: [" ", /*#__PURE__*/(0,jsx_runtime.jsx)("i", {
|
|
|
className: "iconfont icon-zishiying"
|
|
|
})]
|
|
|
}), /*#__PURE__*/(0,jsx_runtime.jsx)("div", {
|
|
|
children: "\u6700\u4F73\u9002\u5E94"
|
|
|
})]
|
|
|
}), /*#__PURE__*/(0,jsx_runtime.jsxs)("div", {
|
|
|
onClick: /*#__PURE__*/asyncToGenerator_default()( /*#__PURE__*/regeneratorRuntime_default()().mark(function _callee2() {
|
|
|
var res, _res$list;
|
|
|
return regeneratorRuntime_default()().wrap(function _callee2$(_context2) {
|
|
|
while (1) switch (_context2.prev = _context2.next) {
|
|
|
case 0:
|
|
|
setselectmodal(true);
|
|
|
_context2.next = 3;
|
|
|
return (0,fetch/* default */.ZP)("/api/knowledge_graphs.json", {
|
|
|
method: 'get',
|
|
|
params: {
|
|
|
type: 2,
|
|
|
identifier: params.virtual_spacesId
|
|
|
}
|
|
|
});
|
|
|
case 3:
|
|
|
res = _context2.sent;
|
|
|
if (res.status === 0) {
|
|
|
setthreelist(res === null || res === void 0 ? void 0 : res.list);
|
|
|
setthree(res === null || res === void 0 ? void 0 : res.knowledge_graphs);
|
|
|
setExpandedKeys(res === null || res === void 0 || (_res$list = res.list) === null || _res$list === void 0 ? void 0 : _res$list.map(function (item) {
|
|
|
return item.key;
|
|
|
}));
|
|
|
}
|
|
|
case 5:
|
|
|
case "end":
|
|
|
return _context2.stop();
|
|
|
}
|
|
|
}, _callee2);
|
|
|
})),
|
|
|
className: knowledgemodules.header,
|
|
|
children: [/*#__PURE__*/(0,jsx_runtime.jsxs)("div", {
|
|
|
children: [" ", /*#__PURE__*/(0,jsx_runtime.jsx)("i", {
|
|
|
className: "iconfont icon-chazhao"
|
|
|
})]
|
|
|
}), /*#__PURE__*/(0,jsx_runtime.jsx)("div", {
|
|
|
children: "\u67E5\u627E"
|
|
|
})]
|
|
|
}), permission && /*#__PURE__*/(0,jsx_runtime.jsxs)("div", {
|
|
|
onClick: function onClick() {
|
|
|
setexport(true);
|
|
|
},
|
|
|
className: knowledgemodules.header,
|
|
|
children: [/*#__PURE__*/(0,jsx_runtime.jsxs)("div", {
|
|
|
children: [" ", /*#__PURE__*/(0,jsx_runtime.jsx)("i", {
|
|
|
className: "iconfont icon-daoru"
|
|
|
})]
|
|
|
}), /*#__PURE__*/(0,jsx_runtime.jsx)("div", {
|
|
|
children: "\u5BFC\u5165"
|
|
|
})]
|
|
|
}), /*#__PURE__*/(0,jsx_runtime.jsxs)("div", {
|
|
|
style: {
|
|
|
flex: 1,
|
|
|
textAlign: 'end',
|
|
|
lineHeight: '60px'
|
|
|
},
|
|
|
children: [permission && /*#__PURE__*/(0,jsx_runtime.jsx)(tooltip/* default */.Z, {
|
|
|
title: "\u6E05\u7A7A\u6240\u6709\u6570\u636E",
|
|
|
getPopupContainer: function getPopupContainer() {
|
|
|
return containerRef.current;
|
|
|
},
|
|
|
children: /*#__PURE__*/(0,jsx_runtime.jsx)("i", {
|
|
|
onClick: function onClick() {
|
|
|
modal/* default */.Z.confirm({
|
|
|
title: '提示',
|
|
|
icon: null,
|
|
|
centered: true,
|
|
|
getContainer: function getContainer() {
|
|
|
return containerRef.current;
|
|
|
},
|
|
|
content: '请确定是否将知识图谱所有的数据清空,恢复空状态,清空后数据不可恢复!本次清空不会影响到课程章节内容,仅作用于知识图谱的数据。',
|
|
|
onOk: function () {
|
|
|
var _onOk = 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:
|
|
|
_context3.next = 2;
|
|
|
return (0,fetch/* default */.ZP)("/api/knowledge_graphs/delete_all.json", {
|
|
|
method: 'DELETE',
|
|
|
body: {
|
|
|
type: 2,
|
|
|
identifier: params.virtual_spacesId
|
|
|
}
|
|
|
});
|
|
|
case 2:
|
|
|
res = _context3.sent;
|
|
|
if (res.status === 0) {
|
|
|
getdatas();
|
|
|
setitems({});
|
|
|
}
|
|
|
case 4:
|
|
|
case "end":
|
|
|
return _context3.stop();
|
|
|
}
|
|
|
}, _callee3);
|
|
|
}));
|
|
|
function onOk() {
|
|
|
return _onOk.apply(this, arguments);
|
|
|
}
|
|
|
return onOk;
|
|
|
}()
|
|
|
});
|
|
|
},
|
|
|
className: "iconfont icon-shanchu14 ".concat(knowledgemodules.dhover)
|
|
|
})
|
|
|
}), permission && /*#__PURE__*/(0,jsx_runtime.jsx)(dropdown/* default */.Z, {
|
|
|
getPopupContainer: function getPopupContainer() {
|
|
|
return containerRef.current;
|
|
|
},
|
|
|
menu: {
|
|
|
items: [{
|
|
|
key: '1',
|
|
|
style: {
|
|
|
width: 100
|
|
|
},
|
|
|
label: /*#__PURE__*/(0,jsx_runtime.jsx)("a", {
|
|
|
href: "".concat(env/* default */.Z.API_SERVER, "/api/knowledge_graphs/export.xlsx?identifier=").concat(params.virtual_spacesId, "&type=2"),
|
|
|
children: "\u5BFC\u51FAExcel"
|
|
|
})
|
|
|
}, {
|
|
|
key: '2',
|
|
|
label: /*#__PURE__*/(0,jsx_runtime.jsx)("a", {
|
|
|
href: "".concat(env/* default */.Z.API_SERVER, "/api/knowledge_graphs/export.json?identifier=").concat(params.virtual_spacesId, "&type=2"),
|
|
|
children: "\u5BFC\u51FAWord"
|
|
|
})
|
|
|
}]
|
|
|
},
|
|
|
children: /*#__PURE__*/(0,jsx_runtime.jsx)("i", {
|
|
|
style: {
|
|
|
marginLeft: 30
|
|
|
},
|
|
|
className: "iconfont icon-xiazai6 ".concat(knowledgemodules.ehover)
|
|
|
})
|
|
|
}), /*#__PURE__*/(0,jsx_runtime.jsx)("i", {
|
|
|
onClick: function onClick() {
|
|
|
if ((0,fullscreen/* IsFull */.vp)()) {
|
|
|
setIsFull(false);
|
|
|
(0,fullscreen/* exitFull */.BU)();
|
|
|
} else {
|
|
|
setIsFull(true);
|
|
|
(0,fullscreen/* requestFullScreen */.Dj)(containerRef.current);
|
|
|
}
|
|
|
zoomToFit();
|
|
|
},
|
|
|
style: {
|
|
|
marginLeft: 30,
|
|
|
marginRight: 20
|
|
|
},
|
|
|
className: "iconfont ".concat(IsFulls ? 'icon-tuichuquanping3' : 'icon-quanping4', " ").concat(knowledgemodules.ehover)
|
|
|
})]
|
|
|
})]
|
|
|
}), /*#__PURE__*/(0,jsx_runtime.jsxs)("div", {
|
|
|
className: "relative",
|
|
|
children: [!ismind && /*#__PURE__*/(0,jsx_runtime.jsx)(gojsreact/* ReactDiagram */.FI, {
|
|
|
ref: diagramRef,
|
|
|
divClassName: "diagram-component",
|
|
|
style: {
|
|
|
backgroundColor: '#fff',
|
|
|
height: IsFulls ? "calc(100vh - 100px)" : 540,
|
|
|
visibility: datas !== null && datas !== void 0 && datas.is_root ? 'hidden' : 'visible'
|
|
|
},
|
|
|
initDiagram: initDiagram,
|
|
|
nodeDataArray: datas === null || datas === void 0 ? void 0 : datas.nodeData,
|
|
|
linkDataArray: datas === null || datas === void 0 ? void 0 : datas.linkData
|
|
|
}), /*#__PURE__*/(0,jsx_runtime.jsx)("div", {
|
|
|
id: "myDiagramDiv",
|
|
|
style: {
|
|
|
height: IsFulls ? "calc(100vh - 100px)" : 540,
|
|
|
width: "100%",
|
|
|
visibility: datas !== null && datas !== void 0 && datas.is_root ? 'hidden' : ismind ? "visible" : "hidden",
|
|
|
position: ismind ? "relative" : "absolute"
|
|
|
}
|
|
|
})]
|
|
|
}), /*#__PURE__*/(0,jsx_runtime.jsx)("div", {
|
|
|
children: !(datas !== null && datas !== void 0 && datas.is_root) && textcolor.map(function (item, index) {
|
|
|
return /*#__PURE__*/(0,jsx_runtime.jsxs)("span", {
|
|
|
style: {
|
|
|
marginLeft: index === 0 && 20,
|
|
|
marginRight: 30
|
|
|
},
|
|
|
children: [/*#__PURE__*/(0,jsx_runtime.jsx)("span", {
|
|
|
style: {
|
|
|
marginRight: 6,
|
|
|
width: 16,
|
|
|
height: 8,
|
|
|
background: colors[index],
|
|
|
display: 'inline-flex',
|
|
|
borderRadius: 4
|
|
|
}
|
|
|
}), /*#__PURE__*/(0,jsx_runtime.jsx)("span", {
|
|
|
style: {
|
|
|
color: '#9096A3'
|
|
|
},
|
|
|
children: item
|
|
|
})]
|
|
|
});
|
|
|
})
|
|
|
})]
|
|
|
}), /*#__PURE__*/(0,jsx_runtime.jsx)("div", {
|
|
|
style: {
|
|
|
zIndex: 1000
|
|
|
},
|
|
|
children: /*#__PURE__*/(0,jsx_runtime.jsx)((cjs_default()), {
|
|
|
disabled: disabled,
|
|
|
bounds: bounds,
|
|
|
onStart: function onStart(event, uiData) {
|
|
|
return _onStart(event, uiData);
|
|
|
},
|
|
|
children: /*#__PURE__*/(0,jsx_runtime.jsx)("div", {
|
|
|
ref: draggleRef,
|
|
|
style: {
|
|
|
position: 'fixed',
|
|
|
cursor: 'move',
|
|
|
right: IsFulls ? 0 : 0,
|
|
|
top: IsFulls ? 60 : 260,
|
|
|
zIndex: 12
|
|
|
},
|
|
|
children: /*#__PURE__*/(0,jsx_runtime.jsx)("div", {
|
|
|
onMouseOver: function onMouseOver() {
|
|
|
if (disabled) {
|
|
|
if (!urldisabled) {
|
|
|
setDisabled(true);
|
|
|
} else {
|
|
|
setDisabled(false);
|
|
|
}
|
|
|
}
|
|
|
},
|
|
|
onMouseOut: function onMouseOut() {
|
|
|
setDisabled(true);
|
|
|
},
|
|
|
children: items.id && /*#__PURE__*/(0,jsx_runtime.jsx)("div", {
|
|
|
className: knowledgemodules.rightmodal,
|
|
|
children: /*#__PURE__*/(0,jsx_runtime.jsxs)(spin/* default */.Z, {
|
|
|
spinning: sploading,
|
|
|
children: [/*#__PURE__*/(0,jsx_runtime.jsxs)("div", {
|
|
|
style: {
|
|
|
display: 'flex'
|
|
|
},
|
|
|
children: [/*#__PURE__*/(0,jsx_runtime.jsxs)("div", {
|
|
|
className: knowledgemodules.title,
|
|
|
children: [items.text, " ", /*#__PURE__*/(0,jsx_runtime.jsx)("i", {
|
|
|
onClick: function onClick() {
|
|
|
setupname(true);
|
|
|
form.setFieldsValue({
|
|
|
name: items.text
|
|
|
});
|
|
|
},
|
|
|
className: "iconfont icon-bianji3",
|
|
|
style: {
|
|
|
marginLeft: 14,
|
|
|
color: '#666666',
|
|
|
cursor: 'pointer'
|
|
|
}
|
|
|
})]
|
|
|
}), /*#__PURE__*/(0,jsx_runtime.jsx)("div", {
|
|
|
children: /*#__PURE__*/(0,jsx_runtime.jsx)("i", {
|
|
|
style: {
|
|
|
cursor: 'pointer'
|
|
|
},
|
|
|
onClick: function onClick() {
|
|
|
var _treeDiagramRef$curre9, _relationshipDiagramR9;
|
|
|
setitems({});
|
|
|
(_treeDiagramRef$curre9 = treeDiagramRef.current) === null || _treeDiagramRef$curre9 === void 0 || _treeDiagramRef$curre9.clearSelection();
|
|
|
(_relationshipDiagramR9 = relationshipDiagramRef.current) === null || _relationshipDiagramR9 === void 0 || _relationshipDiagramR9.clearSelection();
|
|
|
},
|
|
|
className: "iconfont icon-danchuangguanbi"
|
|
|
})
|
|
|
})]
|
|
|
}), /*#__PURE__*/(0,jsx_runtime.jsxs)("div", {
|
|
|
style: {
|
|
|
marginTop: 25
|
|
|
},
|
|
|
children: [/*#__PURE__*/(0,jsx_runtime.jsxs)("span", {
|
|
|
className: knowledgemodules.button,
|
|
|
onClick: function onClick() {
|
|
|
if (items.unit_type >= 4 || items.unit_type === 0) {
|
|
|
if (items.unit_type === 0) {
|
|
|
message/* default */.ZP.info('根节点暂不支持插入知识点');
|
|
|
} else {
|
|
|
message/* default */.ZP.info('知识点为最小单位暂不支持插入知识点');
|
|
|
}
|
|
|
return;
|
|
|
}
|
|
|
form.setFieldsValue({
|
|
|
name: ''
|
|
|
});
|
|
|
setadditem(true);
|
|
|
},
|
|
|
children: [/*#__PURE__*/(0,jsx_runtime.jsx)("i", {
|
|
|
style: {
|
|
|
marginRight: 8
|
|
|
},
|
|
|
className: "iconfont icon-charuzhishidian1"
|
|
|
}), " \u63D2\u5165\u77E5\u8BC6\u70B9"]
|
|
|
}), /*#__PURE__*/(0,jsx_runtime.jsxs)("span", {
|
|
|
className: knowledgemodules.button,
|
|
|
onClick: function onClick() {
|
|
|
if (items.unit_type >= 4) {
|
|
|
message/* default */.ZP.info('知识点为最小单位暂不支持插入知识单元');
|
|
|
return;
|
|
|
}
|
|
|
form.setFieldsValue({
|
|
|
name: '',
|
|
|
unit_type: 3,
|
|
|
url: ''
|
|
|
});
|
|
|
setaddunit(true);
|
|
|
},
|
|
|
children: [/*#__PURE__*/(0,jsx_runtime.jsx)("i", {
|
|
|
style: {
|
|
|
marginRight: 8
|
|
|
},
|
|
|
className: "iconfont icon-charuzhishidanyuan"
|
|
|
}), " \u63D2\u5165\u77E5\u8BC6\u5355\u5143"]
|
|
|
}), /*#__PURE__*/(0,jsx_runtime.jsxs)("span", {
|
|
|
className: knowledgemodules.button,
|
|
|
onClick: function onClick() {
|
|
|
modal/* default */.Z.confirm({
|
|
|
icon: null,
|
|
|
title: '提示',
|
|
|
centered: true,
|
|
|
getContainer: function getContainer() {
|
|
|
return containerRef.current;
|
|
|
},
|
|
|
content: '删除该节点会导致它的子节点一并删除,删除节点不会影响到课程章节内容,删除后,数据不可恢复请确认是否删除',
|
|
|
onOk: function () {
|
|
|
var _onOk2 = 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:
|
|
|
setsploading(true);
|
|
|
_context4.next = 3;
|
|
|
return (0,fetch/* default */.ZP)("/api/knowledge_graphs/".concat(items.id, ".json"), {
|
|
|
method: 'DELETE'
|
|
|
});
|
|
|
case 3:
|
|
|
res = _context4.sent;
|
|
|
setsploading(false);
|
|
|
if ((res === null || res === void 0 ? void 0 : res.status) === 0) {
|
|
|
setitems({});
|
|
|
getdatas();
|
|
|
}
|
|
|
case 6:
|
|
|
case "end":
|
|
|
return _context4.stop();
|
|
|
}
|
|
|
}, _callee4);
|
|
|
}));
|
|
|
function onOk() {
|
|
|
return _onOk2.apply(this, arguments);
|
|
|
}
|
|
|
return onOk;
|
|
|
}()
|
|
|
});
|
|
|
},
|
|
|
children: [/*#__PURE__*/(0,jsx_runtime.jsx)("i", {
|
|
|
style: {
|
|
|
marginRight: 8
|
|
|
},
|
|
|
className: "iconfont icon-shanchujiedian"
|
|
|
}), " \u5220\u9664\u8282\u70B9"]
|
|
|
}), /*#__PURE__*/(0,jsx_runtime.jsxs)("span", {
|
|
|
className: knowledgemodules.button,
|
|
|
onClick: /*#__PURE__*/asyncToGenerator_default()( /*#__PURE__*/regeneratorRuntime_default()().mark(function _callee5() {
|
|
|
var res, _res$list2;
|
|
|
return regeneratorRuntime_default()().wrap(function _callee5$(_context5) {
|
|
|
while (1) switch (_context5.prev = _context5.next) {
|
|
|
case 0:
|
|
|
setrelation(true);
|
|
|
_context5.next = 3;
|
|
|
return (0,fetch/* default */.ZP)("/api/knowledge_graphs.json", {
|
|
|
method: 'get',
|
|
|
params: {
|
|
|
type: 2,
|
|
|
identifier: params.virtual_spacesId
|
|
|
}
|
|
|
});
|
|
|
case 3:
|
|
|
res = _context5.sent;
|
|
|
if (res.status === 0) {
|
|
|
setthreelist(res === null || res === void 0 ? void 0 : res.list);
|
|
|
setthree(res === null || res === void 0 ? void 0 : res.knowledge_graphs);
|
|
|
setExpandedKeys(res === null || res === void 0 || (_res$list2 = res.list) === null || _res$list2 === void 0 ? void 0 : _res$list2.map(function (item) {
|
|
|
return item.key;
|
|
|
}));
|
|
|
}
|
|
|
case 5:
|
|
|
case "end":
|
|
|
return _context5.stop();
|
|
|
}
|
|
|
}, _callee5);
|
|
|
})),
|
|
|
children: [/*#__PURE__*/(0,jsx_runtime.jsx)("i", {
|
|
|
style: {
|
|
|
marginRight: 8
|
|
|
},
|
|
|
className: "iconfont icon-guanxi"
|
|
|
}), " \u5173\u7CFB"]
|
|
|
})]
|
|
|
}), /*#__PURE__*/(0,jsx_runtime.jsxs)("div", {
|
|
|
style: {
|
|
|
marginTop: 20
|
|
|
},
|
|
|
children: [/*#__PURE__*/(0,jsx_runtime.jsxs)("div", {
|
|
|
className: knowledgemodules.linetitles,
|
|
|
children: [/*#__PURE__*/(0,jsx_runtime.jsx)("span", {
|
|
|
className: knowledgemodules.line
|
|
|
}), "\u5C5E\u6027"]
|
|
|
}), items.unit_type != 4 && items.unit_type > 0 && /*#__PURE__*/(0,jsx_runtime.jsxs)("div", {
|
|
|
style: {
|
|
|
paddingLeft: 8
|
|
|
},
|
|
|
children: [/*#__PURE__*/(0,jsx_runtime.jsx)("label", {
|
|
|
className: knowledgemodules.lebels,
|
|
|
children: "\u7C7B\u578B"
|
|
|
}), /*#__PURE__*/(0,jsx_runtime.jsxs)(es_select["default"], {
|
|
|
size: "large",
|
|
|
getPopupContainer: function getPopupContainer() {
|
|
|
return containerRef.current;
|
|
|
},
|
|
|
style: {
|
|
|
width: '100%',
|
|
|
marginTop: 6
|
|
|
},
|
|
|
value: items.unit_type,
|
|
|
onChange: ( /*#__PURE__*/function () {
|
|
|
var _ref5 = asyncToGenerator_default()( /*#__PURE__*/regeneratorRuntime_default()().mark(function _callee6(e) {
|
|
|
var res;
|
|
|
return regeneratorRuntime_default()().wrap(function _callee6$(_context6) {
|
|
|
while (1) switch (_context6.prev = _context6.next) {
|
|
|
case 0:
|
|
|
items.unit_type = e;
|
|
|
setitems(objectSpread2_default()({}, items));
|
|
|
setsploading(true);
|
|
|
_context6.next = 5;
|
|
|
return (0,fetch/* default */.ZP)("/api/knowledge_graphs/".concat(items.id, ".json"), {
|
|
|
method: 'put',
|
|
|
body: {
|
|
|
type: 2,
|
|
|
unit_type: e
|
|
|
}
|
|
|
});
|
|
|
case 5:
|
|
|
res = _context6.sent;
|
|
|
setsploading(false);
|
|
|
if (res.status === 0) {
|
|
|
setupname(false);
|
|
|
getdatas();
|
|
|
}
|
|
|
case 8:
|
|
|
case "end":
|
|
|
return _context6.stop();
|
|
|
}
|
|
|
}, _callee6);
|
|
|
}));
|
|
|
return function (_x) {
|
|
|
return _ref5.apply(this, arguments);
|
|
|
};
|
|
|
}()),
|
|
|
placeholder: "\u8BF7\u9009\u62E9\u7C7B\u578B",
|
|
|
children: [/*#__PURE__*/(0,jsx_runtime.jsx)(es_select["default"].Option, {
|
|
|
value: 1,
|
|
|
children: "\u8BFE\u4EF6"
|
|
|
}), /*#__PURE__*/(0,jsx_runtime.jsx)(es_select["default"].Option, {
|
|
|
value: 3,
|
|
|
children: "\u6587\u672C"
|
|
|
}), /*#__PURE__*/(0,jsx_runtime.jsx)(es_select["default"].Option, {
|
|
|
value: 2,
|
|
|
children: "\u5B9E\u8BAD"
|
|
|
})]
|
|
|
})]
|
|
|
}), /*#__PURE__*/(0,jsx_runtime.jsxs)("div", {
|
|
|
style: {
|
|
|
paddingLeft: 8,
|
|
|
marginTop: 15
|
|
|
},
|
|
|
children: [/*#__PURE__*/(0,jsx_runtime.jsx)("label", {
|
|
|
className: knowledgemodules.lebels,
|
|
|
style: {
|
|
|
display: 'flex'
|
|
|
},
|
|
|
children: "\u8DF3\u8F6C\u5730\u5740"
|
|
|
}), /*#__PURE__*/(0,jsx_runtime.jsx)(input/* default */.Z, {
|
|
|
size: "large",
|
|
|
value: items.url,
|
|
|
onChange: function onChange(e) {
|
|
|
items.url = e.target.value;
|
|
|
setitems(objectSpread2_default()({}, items));
|
|
|
},
|
|
|
disabled: urldisabled,
|
|
|
onBlur: ( /*#__PURE__*/function () {
|
|
|
var _ref6 = asyncToGenerator_default()( /*#__PURE__*/regeneratorRuntime_default()().mark(function _callee7(e) {
|
|
|
var reg, res;
|
|
|
return regeneratorRuntime_default()().wrap(function _callee7$(_context7) {
|
|
|
while (1) switch (_context7.prev = _context7.next) {
|
|
|
case 0:
|
|
|
setDisabled(false);
|
|
|
if (!e.target.value) {
|
|
|
_context7.next = 6;
|
|
|
break;
|
|
|
}
|
|
|
reg = new RegExp(/^(https?:\/\/)?([\w.-]+)\.([a-z]{2,})(\/\S*)?$/, "i");
|
|
|
if (reg.test(e.target.value)) {
|
|
|
_context7.next = 6;
|
|
|
break;
|
|
|
}
|
|
|
message/* default */.ZP.info('请输入正确的跳转地址');
|
|
|
return _context7.abrupt("return");
|
|
|
case 6:
|
|
|
setsploading(true);
|
|
|
_context7.next = 9;
|
|
|
return (0,fetch/* default */.ZP)("/api/knowledge_graphs/".concat(items.id, ".json"), {
|
|
|
method: 'put',
|
|
|
body: {
|
|
|
type: 2,
|
|
|
url: e.target.value
|
|
|
}
|
|
|
});
|
|
|
case 9:
|
|
|
res = _context7.sent;
|
|
|
setsploading(false);
|
|
|
seturldisabled(true);
|
|
|
if (res.status === 0) {
|
|
|
setupname(false);
|
|
|
getdatas();
|
|
|
}
|
|
|
case 13:
|
|
|
case "end":
|
|
|
return _context7.stop();
|
|
|
}
|
|
|
}, _callee7);
|
|
|
}));
|
|
|
return function (_x2) {
|
|
|
return _ref6.apply(this, arguments);
|
|
|
};
|
|
|
}()),
|
|
|
style: {
|
|
|
width: '81%',
|
|
|
marginTop: 6
|
|
|
}
|
|
|
}), /*#__PURE__*/(0,jsx_runtime.jsx)("i", {
|
|
|
onClick: function onClick() {
|
|
|
seturldisabled(false);
|
|
|
},
|
|
|
className: "iconfont icon-bianji3",
|
|
|
style: {
|
|
|
marginLeft: 12,
|
|
|
marginRight: 20,
|
|
|
color: '#666666',
|
|
|
cursor: 'pointer'
|
|
|
}
|
|
|
}), /*#__PURE__*/(0,jsx_runtime.jsx)("span", {
|
|
|
className: knowledgemodules.button,
|
|
|
style: {
|
|
|
marginRight: 0
|
|
|
},
|
|
|
onClick: function onClick() {
|
|
|
if (!items.url) {
|
|
|
message/* default */.ZP.info('链接不能为空');
|
|
|
return;
|
|
|
}
|
|
|
window.open(items.url);
|
|
|
},
|
|
|
children: "\u8DF3\u8F6C"
|
|
|
})]
|
|
|
})]
|
|
|
}), /*#__PURE__*/(0,jsx_runtime.jsxs)("div", {
|
|
|
style: {
|
|
|
marginTop: 20
|
|
|
},
|
|
|
children: [/*#__PURE__*/(0,jsx_runtime.jsxs)("div", {
|
|
|
className: knowledgemodules.linetitles,
|
|
|
children: [/*#__PURE__*/(0,jsx_runtime.jsx)("span", {
|
|
|
className: knowledgemodules.line
|
|
|
}), "\u5173\u7CFB"]
|
|
|
}), items === null || items === void 0 || (_items$relations = items.relations) === null || _items$relations === void 0 ? void 0 : _items$relations.map(function (item, index) {
|
|
|
return /*#__PURE__*/(0,jsx_runtime.jsxs)("div", {
|
|
|
style: {
|
|
|
display: 'flex',
|
|
|
paddingLeft: 8
|
|
|
},
|
|
|
children: [/*#__PURE__*/(0,jsx_runtime.jsxs)("div", {
|
|
|
className: knowledgemodules.multi_ellipsis1,
|
|
|
children: ["\u4E0E\u8282\u70B9\u201C", /*#__PURE__*/(0,jsx_runtime.jsx)("span", {
|
|
|
style: {
|
|
|
fontWeight: 600,
|
|
|
color: '#000000'
|
|
|
},
|
|
|
children: item.name
|
|
|
}), "\u201D\u4E3A", item.relation, "\u5173\u7CFB"]
|
|
|
}), /*#__PURE__*/(0,jsx_runtime.jsx)("div", {
|
|
|
style: {
|
|
|
width: '10%',
|
|
|
textAlign: 'end'
|
|
|
},
|
|
|
children: /*#__PURE__*/(0,jsx_runtime.jsx)("i", {
|
|
|
onClick: function onClick() {
|
|
|
modal/* default */.Z.confirm({
|
|
|
icon: null,
|
|
|
title: '提示',
|
|
|
getContainer: function getContainer() {
|
|
|
return containerRef.current;
|
|
|
},
|
|
|
centered: true,
|
|
|
content: '请确认是否将节点之间的关系解绑',
|
|
|
onOk: function () {
|
|
|
var _onOk3 = asyncToGenerator_default()( /*#__PURE__*/regeneratorRuntime_default()().mark(function _callee8() {
|
|
|
var res, _items$relations2;
|
|
|
return regeneratorRuntime_default()().wrap(function _callee8$(_context8) {
|
|
|
while (1) switch (_context8.prev = _context8.next) {
|
|
|
case 0:
|
|
|
setsploading(true);
|
|
|
_context8.next = 3;
|
|
|
return (0,fetch/* default */.ZP)("/api/knowledge_graphs/".concat(items === null || items === void 0 ? void 0 : items.id, "/delete_relation.json"), {
|
|
|
method: 'POST',
|
|
|
body: {
|
|
|
relation_id: item.relation_id
|
|
|
}
|
|
|
});
|
|
|
case 3:
|
|
|
res = _context8.sent;
|
|
|
setsploading(false);
|
|
|
if (res.status === 0) {
|
|
|
(_items$relations2 = items.relations) === null || _items$relations2 === void 0 || _items$relations2.splice(index, 1);
|
|
|
setitems(objectSpread2_default()({}, items));
|
|
|
getdatas();
|
|
|
}
|
|
|
case 6:
|
|
|
case "end":
|
|
|
return _context8.stop();
|
|
|
}
|
|
|
}, _callee8);
|
|
|
}));
|
|
|
function onOk() {
|
|
|
return _onOk3.apply(this, arguments);
|
|
|
}
|
|
|
return onOk;
|
|
|
}()
|
|
|
});
|
|
|
},
|
|
|
className: "".concat(knowledgemodules.dhover, " iconfont icon-shanchu10")
|
|
|
})
|
|
|
})]
|
|
|
});
|
|
|
})]
|
|
|
}), /*#__PURE__*/(0,jsx_runtime.jsxs)("div", {
|
|
|
style: {
|
|
|
marginTop: 20
|
|
|
},
|
|
|
children: [/*#__PURE__*/(0,jsx_runtime.jsxs)("div", {
|
|
|
className: knowledgemodules.linetitles,
|
|
|
children: [/*#__PURE__*/(0,jsx_runtime.jsx)("span", {
|
|
|
className: knowledgemodules.line
|
|
|
}), "\u63CF\u8FF0", /*#__PURE__*/(0,jsx_runtime.jsx)("div", {
|
|
|
style: {
|
|
|
flex: 1,
|
|
|
textAlign: 'end'
|
|
|
},
|
|
|
children: /*#__PURE__*/(0,jsx_runtime.jsxs)("span", {
|
|
|
onClick: function onClick() {
|
|
|
setdescribe({
|
|
|
add: true,
|
|
|
name: ''
|
|
|
});
|
|
|
form.setFieldsValue({
|
|
|
describe: ''
|
|
|
});
|
|
|
},
|
|
|
className: knowledgemodules.additem,
|
|
|
children: [/*#__PURE__*/(0,jsx_runtime.jsx)("i", {
|
|
|
style: {
|
|
|
fontSize: 12
|
|
|
},
|
|
|
className: "iconfont icon-tianjiashitixiaojiahao"
|
|
|
}), " \u6DFB\u52A0"]
|
|
|
})
|
|
|
})]
|
|
|
}), /*#__PURE__*/(0,jsx_runtime.jsx)("div", {
|
|
|
style: {
|
|
|
height: 200,
|
|
|
overflow: 'auto'
|
|
|
},
|
|
|
children: (_items$descriptions = items.descriptions) === null || _items$descriptions === void 0 ? void 0 : _items$descriptions.map(function (item, index) {
|
|
|
return /*#__PURE__*/(0,jsx_runtime.jsxs)("div", {
|
|
|
className: knowledgemodules.describe,
|
|
|
children: [/*#__PURE__*/(0,jsx_runtime.jsxs)("div", {
|
|
|
className: knowledgemodules.describetitle,
|
|
|
children: [/*#__PURE__*/(0,jsx_runtime.jsxs)("div", {
|
|
|
style: {
|
|
|
fontSize: 14,
|
|
|
color: '#000000',
|
|
|
fontWeight: 500
|
|
|
},
|
|
|
children: ["\u63CF\u8FF0", index + 1]
|
|
|
}), /*#__PURE__*/(0,jsx_runtime.jsxs)("div", {
|
|
|
children: [/*#__PURE__*/(0,jsx_runtime.jsx)("i", {
|
|
|
onClick: function onClick() {
|
|
|
setdescribe({
|
|
|
index: index,
|
|
|
name: item
|
|
|
});
|
|
|
form.setFieldsValue({
|
|
|
describe: item
|
|
|
});
|
|
|
},
|
|
|
style: {
|
|
|
marginRight: 10
|
|
|
},
|
|
|
className: "iconfont icon-bianji-moren ".concat(knowledgemodules.ehover)
|
|
|
}), /*#__PURE__*/(0,jsx_runtime.jsx)("i", {
|
|
|
onClick: function onClick() {
|
|
|
modal/* default */.Z.confirm({
|
|
|
icon: null,
|
|
|
title: '提示',
|
|
|
getContainer: function getContainer() {
|
|
|
return containerRef.current;
|
|
|
},
|
|
|
centered: true,
|
|
|
content: '删除描述后,数据不可恢复,请确认是否删除',
|
|
|
onOk: function () {
|
|
|
var _onOk4 = asyncToGenerator_default()( /*#__PURE__*/regeneratorRuntime_default()().mark(function _callee9() {
|
|
|
var _items$descriptions2;
|
|
|
var res;
|
|
|
return regeneratorRuntime_default()().wrap(function _callee9$(_context9) {
|
|
|
while (1) switch (_context9.prev = _context9.next) {
|
|
|
case 0:
|
|
|
(_items$descriptions2 = items.descriptions) === null || _items$descriptions2 === void 0 || _items$descriptions2.splice(index, 1);
|
|
|
setitems(objectSpread2_default()({}, items));
|
|
|
setsploading(true);
|
|
|
_context9.next = 5;
|
|
|
return (0,fetch/* default */.ZP)("/api/knowledge_graphs/".concat(items.id, ".json"), {
|
|
|
method: 'put',
|
|
|
body: {
|
|
|
type: 2,
|
|
|
descriptions: items.descriptions
|
|
|
}
|
|
|
});
|
|
|
case 5:
|
|
|
res = _context9.sent;
|
|
|
setsploading(false);
|
|
|
if (res.status === 0) {
|
|
|
setupname(false);
|
|
|
getdatas();
|
|
|
}
|
|
|
case 8:
|
|
|
case "end":
|
|
|
return _context9.stop();
|
|
|
}
|
|
|
}, _callee9);
|
|
|
}));
|
|
|
function onOk() {
|
|
|
return _onOk4.apply(this, arguments);
|
|
|
}
|
|
|
return onOk;
|
|
|
}()
|
|
|
});
|
|
|
},
|
|
|
className: "iconfont icon-shanchutimu ".concat(knowledgemodules.dhover)
|
|
|
})]
|
|
|
})]
|
|
|
}), /*#__PURE__*/(0,jsx_runtime.jsx)(RenderHtml/* default */.Z, {
|
|
|
value: item || ''
|
|
|
})]
|
|
|
});
|
|
|
})
|
|
|
})]
|
|
|
})]
|
|
|
})
|
|
|
})
|
|
|
})
|
|
|
})
|
|
|
})
|
|
|
}), /*#__PURE__*/(0,jsx_runtime.jsx)(modal/* default */.Z, {
|
|
|
open: upname,
|
|
|
centered: true,
|
|
|
title: '编辑',
|
|
|
getContainer: function getContainer() {
|
|
|
return containerRef.current;
|
|
|
},
|
|
|
onCancel: function onCancel() {
|
|
|
return setupname(false);
|
|
|
},
|
|
|
okButtonProps: {
|
|
|
loading: buttonloading
|
|
|
},
|
|
|
onOk: function onOk() {
|
|
|
form.submit();
|
|
|
},
|
|
|
children: /*#__PURE__*/(0,jsx_runtime.jsx)(es_form/* default */.Z, {
|
|
|
size: "large",
|
|
|
form: form,
|
|
|
onFinish: ( /*#__PURE__*/function () {
|
|
|
var _ref7 = asyncToGenerator_default()( /*#__PURE__*/regeneratorRuntime_default()().mark(function _callee10(values) {
|
|
|
var res;
|
|
|
return regeneratorRuntime_default()().wrap(function _callee10$(_context10) {
|
|
|
while (1) switch (_context10.prev = _context10.next) {
|
|
|
case 0:
|
|
|
setbuttonloading(true);
|
|
|
_context10.next = 3;
|
|
|
return (0,fetch/* default */.ZP)("/api/knowledge_graphs/".concat(items.id, ".json"), {
|
|
|
method: 'put',
|
|
|
body: {
|
|
|
type: 2,
|
|
|
name: values.name
|
|
|
}
|
|
|
});
|
|
|
case 3:
|
|
|
res = _context10.sent;
|
|
|
setbuttonloading(false);
|
|
|
if (res.status === 0) {
|
|
|
if (ismind) {
|
|
|
items.text = values.name;
|
|
|
setitems(items);
|
|
|
} else {}
|
|
|
setupname(false);
|
|
|
message/* default */.ZP.info('修改成功');
|
|
|
getdatas();
|
|
|
}
|
|
|
case 6:
|
|
|
case "end":
|
|
|
return _context10.stop();
|
|
|
}
|
|
|
}, _callee10);
|
|
|
}));
|
|
|
return function (_x3) {
|
|
|
return _ref7.apply(this, arguments);
|
|
|
};
|
|
|
}()),
|
|
|
children: /*#__PURE__*/(0,jsx_runtime.jsx)(es_form/* default */.Z.Item, {
|
|
|
name: "name",
|
|
|
label: "\u540D\u79F0",
|
|
|
rules: [{
|
|
|
required: true,
|
|
|
validator: function validator(_, value) {
|
|
|
var _value$replaceAll;
|
|
|
return (value === null || value === void 0 || (_value$replaceAll = value.replaceAll(' ', '')) === null || _value$replaceAll === void 0 ? void 0 : _value$replaceAll.length) > 0 ? Promise.resolve() : Promise.reject('请输入名称');
|
|
|
}
|
|
|
}],
|
|
|
children: /*#__PURE__*/(0,jsx_runtime.jsx)(input/* default */.Z, {
|
|
|
maxLength: 30
|
|
|
})
|
|
|
})
|
|
|
})
|
|
|
}), /*#__PURE__*/(0,jsx_runtime.jsx)(modal/* default */.Z, {
|
|
|
open: additem,
|
|
|
centered: true,
|
|
|
title: '插入知识点',
|
|
|
getContainer: function getContainer() {
|
|
|
return containerRef.current;
|
|
|
},
|
|
|
onCancel: function onCancel() {
|
|
|
return setadditem(false);
|
|
|
},
|
|
|
okButtonProps: {
|
|
|
loading: buttonloading
|
|
|
},
|
|
|
onOk: function onOk() {
|
|
|
form.submit();
|
|
|
},
|
|
|
children: /*#__PURE__*/(0,jsx_runtime.jsx)(es_form/* default */.Z, {
|
|
|
size: "large",
|
|
|
form: form,
|
|
|
onFinish: ( /*#__PURE__*/function () {
|
|
|
var _ref8 = asyncToGenerator_default()( /*#__PURE__*/regeneratorRuntime_default()().mark(function _callee11(value) {
|
|
|
var res;
|
|
|
return regeneratorRuntime_default()().wrap(function _callee11$(_context11) {
|
|
|
while (1) switch (_context11.prev = _context11.next) {
|
|
|
case 0:
|
|
|
setbuttonloading(true);
|
|
|
_context11.next = 3;
|
|
|
return (0,fetch/* default */.ZP)("/api/knowledge_graphs.json", {
|
|
|
method: 'post',
|
|
|
body: objectSpread2_default()(objectSpread2_default()({}, value), {}, {
|
|
|
unit_type: 4,
|
|
|
type: 2,
|
|
|
identifier: params.virtual_spacesId,
|
|
|
parent_id: items.id
|
|
|
})
|
|
|
});
|
|
|
case 3:
|
|
|
res = _context11.sent;
|
|
|
setbuttonloading(false);
|
|
|
if (res.status === 0) {
|
|
|
setadditem(false);
|
|
|
getdatas();
|
|
|
message/* default */.ZP.info('插入知识点成功');
|
|
|
}
|
|
|
case 6:
|
|
|
case "end":
|
|
|
return _context11.stop();
|
|
|
}
|
|
|
}, _callee11);
|
|
|
}));
|
|
|
return function (_x4) {
|
|
|
return _ref8.apply(this, arguments);
|
|
|
};
|
|
|
}()),
|
|
|
children: /*#__PURE__*/(0,jsx_runtime.jsx)(es_form/* default */.Z.Item, {
|
|
|
name: "name",
|
|
|
label: "\u77E5\u8BC6\u70B9\u540D\u79F0",
|
|
|
rules: [{
|
|
|
required: true,
|
|
|
validator: function validator(_, value) {
|
|
|
var _value$replaceAll2;
|
|
|
return (value === null || value === void 0 || (_value$replaceAll2 = value.replaceAll(' ', '')) === null || _value$replaceAll2 === void 0 ? void 0 : _value$replaceAll2.length) > 0 ? Promise.resolve() : Promise.reject('请输入知识点名称');
|
|
|
}
|
|
|
}],
|
|
|
children: /*#__PURE__*/(0,jsx_runtime.jsx)(input/* default */.Z, {
|
|
|
maxLength: 20
|
|
|
})
|
|
|
})
|
|
|
})
|
|
|
}), /*#__PURE__*/(0,jsx_runtime.jsx)(modal/* default */.Z, {
|
|
|
open: addunit,
|
|
|
centered: true,
|
|
|
width: 550,
|
|
|
title: '插入知识单元',
|
|
|
getContainer: function getContainer() {
|
|
|
return containerRef.current;
|
|
|
},
|
|
|
onCancel: function onCancel() {
|
|
|
return setaddunit(false);
|
|
|
},
|
|
|
okButtonProps: {
|
|
|
loading: buttonloading
|
|
|
},
|
|
|
onOk: function onOk() {
|
|
|
form.submit();
|
|
|
},
|
|
|
children: /*#__PURE__*/(0,jsx_runtime.jsxs)(es_form/* default */.Z, {
|
|
|
size: "large",
|
|
|
form: form,
|
|
|
labelCol: {
|
|
|
span: 5
|
|
|
},
|
|
|
onFinish: ( /*#__PURE__*/function () {
|
|
|
var _ref9 = asyncToGenerator_default()( /*#__PURE__*/regeneratorRuntime_default()().mark(function _callee12(value) {
|
|
|
var res;
|
|
|
return regeneratorRuntime_default()().wrap(function _callee12$(_context12) {
|
|
|
while (1) switch (_context12.prev = _context12.next) {
|
|
|
case 0:
|
|
|
_context12.next = 2;
|
|
|
return (0,fetch/* default */.ZP)("/api/knowledge_graphs.json", {
|
|
|
method: 'post',
|
|
|
body: objectSpread2_default()(objectSpread2_default()({}, value), {}, {
|
|
|
type: 2,
|
|
|
identifier: params.virtual_spacesId,
|
|
|
parent_id: items.id
|
|
|
})
|
|
|
});
|
|
|
case 2:
|
|
|
res = _context12.sent;
|
|
|
setbuttonloading(false);
|
|
|
if (res.status === 0) {
|
|
|
setaddunit(false);
|
|
|
getdatas();
|
|
|
message/* default */.ZP.info('插入知识单元成功');
|
|
|
}
|
|
|
case 5:
|
|
|
case "end":
|
|
|
return _context12.stop();
|
|
|
}
|
|
|
}, _callee12);
|
|
|
}));
|
|
|
return function (_x5) {
|
|
|
return _ref9.apply(this, arguments);
|
|
|
};
|
|
|
}()),
|
|
|
children: [/*#__PURE__*/(0,jsx_runtime.jsx)(es_form/* default */.Z.Item, {
|
|
|
name: "name",
|
|
|
label: "\u77E5\u8BC6\u5355\u5143\u540D\u79F0",
|
|
|
rules: [{
|
|
|
required: true,
|
|
|
validator: function validator(_, value) {
|
|
|
var _value$replaceAll3;
|
|
|
return (value === null || value === void 0 || (_value$replaceAll3 = value.replaceAll(' ', '')) === null || _value$replaceAll3 === void 0 ? void 0 : _value$replaceAll3.length) > 0 ? Promise.resolve() : Promise.reject('请输入知识单元名称');
|
|
|
}
|
|
|
}],
|
|
|
children: /*#__PURE__*/(0,jsx_runtime.jsx)(input/* default */.Z, {
|
|
|
placeholder: "\u8BF7\u8F93\u5165\u77E5\u8BC6\u5355\u5143\u540D\u79F0",
|
|
|
maxLength: 20
|
|
|
})
|
|
|
}), /*#__PURE__*/(0,jsx_runtime.jsx)(es_form/* default */.Z.Item, {
|
|
|
name: "unit_type",
|
|
|
label: "\u7C7B\u578B",
|
|
|
children: /*#__PURE__*/(0,jsx_runtime.jsxs)(es_select["default"], {
|
|
|
getPopupContainer: function getPopupContainer() {
|
|
|
return containerRef.current;
|
|
|
},
|
|
|
placeholder: "\u8BF7\u9009\u62E9\u7C7B\u578B",
|
|
|
children: [/*#__PURE__*/(0,jsx_runtime.jsx)(es_select["default"].Option, {
|
|
|
value: 1,
|
|
|
children: "\u8BFE\u4EF6"
|
|
|
}), /*#__PURE__*/(0,jsx_runtime.jsx)(es_select["default"].Option, {
|
|
|
value: 3,
|
|
|
children: "\u6587\u672C"
|
|
|
}), /*#__PURE__*/(0,jsx_runtime.jsx)(es_select["default"].Option, {
|
|
|
value: 2,
|
|
|
children: "\u5B9E\u8BAD"
|
|
|
})]
|
|
|
})
|
|
|
}), /*#__PURE__*/(0,jsx_runtime.jsx)(es_form/* default */.Z.Item, {
|
|
|
name: "url",
|
|
|
label: "\u8DF3\u8F6C\u5730\u5740",
|
|
|
rules: [{
|
|
|
pattern: new RegExp(/^(https?:\/\/)?([\w.-]+)\.([a-z]{2,})(\/\S*)?$/, "i"),
|
|
|
message: '请输入正确的地址'
|
|
|
}],
|
|
|
children: /*#__PURE__*/(0,jsx_runtime.jsx)(input/* default */.Z, {
|
|
|
placeholder: "\u8BF7\u8F93\u5165\u70B9\u51FB\u8BE5\u8282\u70B9\u8DF3\u8F6C\u7684\u94FE\u63A5\u5730\u5740"
|
|
|
})
|
|
|
})]
|
|
|
})
|
|
|
}), relation && /*#__PURE__*/(0,jsx_runtime.jsxs)(modal/* default */.Z, {
|
|
|
open: relation,
|
|
|
centered: true,
|
|
|
width: 550,
|
|
|
title: '添加关系',
|
|
|
getContainer: function getContainer() {
|
|
|
return containerRef.current;
|
|
|
},
|
|
|
onCancel: function onCancel() {
|
|
|
setAddModal('');
|
|
|
setrelation(false);
|
|
|
},
|
|
|
okButtonProps: {
|
|
|
loading: buttonloading
|
|
|
},
|
|
|
onOk: function onOk() {
|
|
|
if (!AddModal) {
|
|
|
message/* default */.ZP.info('请先选择节点');
|
|
|
return;
|
|
|
}
|
|
|
setrelation(false);
|
|
|
setshowadd(true);
|
|
|
form.setFieldsValue({
|
|
|
relation: 1
|
|
|
});
|
|
|
setSearchValue('');
|
|
|
},
|
|
|
children: [/*#__PURE__*/(0,jsx_runtime.jsx)(input/* default */.Z.Search, {
|
|
|
size: "large",
|
|
|
onChange: function onChange(e) {
|
|
|
var value = e.target.value;
|
|
|
var newExpandedKeys = threelist.filter(function (item) {
|
|
|
return item.title.indexOf(value) > -1;
|
|
|
}).map(function (item) {
|
|
|
return item.key;
|
|
|
});
|
|
|
setExpandedKeys(newExpandedKeys);
|
|
|
setAutoExpandParent(true);
|
|
|
setSearchValue(e.target.value);
|
|
|
// console.log(newExpandedKeys);
|
|
|
}
|
|
|
}), /*#__PURE__*/(0,jsx_runtime.jsx)(tree/* default */.Z, {
|
|
|
onExpand: function onExpand(newExpandedKeys) {
|
|
|
setExpandedKeys(newExpandedKeys);
|
|
|
setAutoExpandParent(false);
|
|
|
},
|
|
|
style: {
|
|
|
maxHeight: 300,
|
|
|
height: 300,
|
|
|
marginTop: 20,
|
|
|
overflow: 'auto'
|
|
|
},
|
|
|
onSelect: function onSelect(e) {
|
|
|
console.log('---', e);
|
|
|
setAddModal(e === null || e === void 0 ? void 0 : e[0]);
|
|
|
},
|
|
|
expandedKeys: expandedKeys,
|
|
|
defaultExpandAll: true,
|
|
|
autoExpandParent: autoExpandParent,
|
|
|
treeData: treeData
|
|
|
})]
|
|
|
}), (describe.name || describe.add) && /*#__PURE__*/(0,jsx_runtime.jsx)(modal/* default */.Z, {
|
|
|
open: describe.name || describe.add,
|
|
|
title: "\u63CF\u8FF0",
|
|
|
width: 900,
|
|
|
getContainer: function getContainer() {
|
|
|
return containerRef.current;
|
|
|
},
|
|
|
centered: true,
|
|
|
onCancel: function onCancel() {
|
|
|
setdescribe('');
|
|
|
},
|
|
|
okButtonProps: {
|
|
|
loading: buttonloading
|
|
|
},
|
|
|
onOk: function onOk() {
|
|
|
form.submit();
|
|
|
},
|
|
|
children: /*#__PURE__*/(0,jsx_runtime.jsx)(es_form/* default */.Z, {
|
|
|
form: form,
|
|
|
onFinish: ( /*#__PURE__*/function () {
|
|
|
var _ref10 = asyncToGenerator_default()( /*#__PURE__*/regeneratorRuntime_default()().mark(function _callee13(values) {
|
|
|
var res;
|
|
|
return regeneratorRuntime_default()().wrap(function _callee13$(_context13) {
|
|
|
while (1) switch (_context13.prev = _context13.next) {
|
|
|
case 0:
|
|
|
setbuttonloading(true);
|
|
|
if (describe.add) {
|
|
|
items.descriptions.push(values.describe);
|
|
|
setitems(objectSpread2_default()({}, items));
|
|
|
} else {
|
|
|
items.descriptions[describe.index] = values.describe;
|
|
|
setitems(objectSpread2_default()({}, items));
|
|
|
}
|
|
|
_context13.next = 4;
|
|
|
return (0,fetch/* default */.ZP)("/api/knowledge_graphs/".concat(items.id, ".json"), {
|
|
|
method: 'put',
|
|
|
body: {
|
|
|
type: 2,
|
|
|
descriptions: items.descriptions
|
|
|
}
|
|
|
});
|
|
|
case 4:
|
|
|
res = _context13.sent;
|
|
|
setbuttonloading(false);
|
|
|
setdescribe('');
|
|
|
if (res.status === 0) {
|
|
|
setupname(false);
|
|
|
getdatas();
|
|
|
}
|
|
|
case 8:
|
|
|
case "end":
|
|
|
return _context13.stop();
|
|
|
}
|
|
|
}, _callee13);
|
|
|
}));
|
|
|
return function (_x6) {
|
|
|
return _ref10.apply(this, arguments);
|
|
|
};
|
|
|
}()),
|
|
|
children: /*#__PURE__*/(0,jsx_runtime.jsx)(es_form/* default */.Z.Item, {
|
|
|
name: "describe",
|
|
|
style: {
|
|
|
marginBottom: -10
|
|
|
},
|
|
|
rules: [{
|
|
|
required: true,
|
|
|
validator: function validator(_, value) {
|
|
|
var _value$replaceAll4;
|
|
|
return (value === null || value === void 0 || (_value$replaceAll4 = value.replaceAll(' ', '')) === null || _value$replaceAll4 === void 0 ? void 0 : _value$replaceAll4.length) > 0 ? Promise.resolve() : Promise.reject('请输入描述内容');
|
|
|
}
|
|
|
}],
|
|
|
children: /*#__PURE__*/(0,jsx_runtime.jsx)(markdown_editor/* default */.Z, {
|
|
|
placeholder: "\u8BF7\u5728\u6B64\u8F93\u5165\u5185\u5BB9\uFF0C\u6700\u5927\u9650\u5236\u4E3A65000\u4E2A\u5B57\u7B26",
|
|
|
watch: true,
|
|
|
defaultValue: describe.name
|
|
|
})
|
|
|
})
|
|
|
})
|
|
|
}), /*#__PURE__*/(0,jsx_runtime.jsxs)(modal/* default */.Z, {
|
|
|
title: "\u6587\u4EF6\u5BFC\u5165",
|
|
|
open: exportshow,
|
|
|
centered: true,
|
|
|
okButtonProps: {
|
|
|
loading: buttonloading
|
|
|
},
|
|
|
onCancel: function onCancel() {
|
|
|
setexport(false);
|
|
|
setFileList([]);
|
|
|
},
|
|
|
onOk: /*#__PURE__*/asyncToGenerator_default()( /*#__PURE__*/regeneratorRuntime_default()().mark(function _callee14() {
|
|
|
var formData, res, _res$fail;
|
|
|
return regeneratorRuntime_default()().wrap(function _callee14$(_context14) {
|
|
|
while (1) switch (_context14.prev = _context14.next) {
|
|
|
case 0:
|
|
|
formData = new FormData();
|
|
|
if (!(fileList.length > 0)) {
|
|
|
_context14.next = 5;
|
|
|
break;
|
|
|
}
|
|
|
formData.append('file', fileList[0]);
|
|
|
_context14.next = 7;
|
|
|
break;
|
|
|
case 5:
|
|
|
message/* default */.ZP.warning("请选择文件");
|
|
|
return _context14.abrupt("return");
|
|
|
case 7:
|
|
|
setbuttonloading(true);
|
|
|
formData.append('ec_year_id', params.ec_year_id);
|
|
|
formData.append('identifier', params.virtual_spacesId);
|
|
|
formData.append('type', '2');
|
|
|
_context14.next = 13;
|
|
|
return (0,fetch/* default */.ZP)("/api/knowledge_graphs/import.json", {
|
|
|
method: 'post',
|
|
|
body: formData
|
|
|
}, true);
|
|
|
case 13:
|
|
|
res = _context14.sent;
|
|
|
setbuttonloading(false);
|
|
|
if ((res === null || res === void 0 ? void 0 : res.status) === 0) {
|
|
|
if ((res === null || res === void 0 || (_res$fail = res.fail) === null || _res$fail === void 0 ? void 0 : _res$fail.length) > 0) {
|
|
|
modal/* default */.Z.confirm({
|
|
|
icon: null,
|
|
|
title: '导入失败',
|
|
|
content: /*#__PURE__*/(0,jsx_runtime.jsxs)("span", {
|
|
|
children: ["\u68C0\u6D4B\u5230\u672C\u6B21\u5BFC\u5165\u5B58\u5728\u4E0D\u7B26\u5408\u8981\u6C42\u7684\u6570\u636E\uFF0C\u70B9\u51FB\u4E0B\u8F7D", /*#__PURE__*/(0,jsx_runtime.jsx)("a", {
|
|
|
href: "".concat(env/* default */.Z.API_SERVER).concat(res === null || res === void 0 ? void 0 : res.url),
|
|
|
download: "\u5931\u8D25\u6570\u636E.xlsx",
|
|
|
children: "\u5BFC\u5165\u5931\u8D25\u7684\u6570\u636E"
|
|
|
}), "\u67E5\u770B"]
|
|
|
})
|
|
|
});
|
|
|
}
|
|
|
setFileList([]);
|
|
|
if ((res === null || res === void 0 ? void 0 : res.success) > 0) {
|
|
|
message/* default */.ZP.info('添加成功');
|
|
|
}
|
|
|
getdatas();
|
|
|
setexport(false);
|
|
|
}
|
|
|
case 16:
|
|
|
case "end":
|
|
|
return _context14.stop();
|
|
|
}
|
|
|
}, _callee14);
|
|
|
})),
|
|
|
children: [!(datas !== null && datas !== void 0 && datas.is_root) && /*#__PURE__*/(0,jsx_runtime.jsx)("div", {
|
|
|
style: {
|
|
|
marginBottom: 30,
|
|
|
color: '#333333'
|
|
|
},
|
|
|
children: "\u68C0\u6D4B\u5F53\u524D\u5DF2\u5B58\u6570\u636E\uFF0C\u5BFC\u5165\u540E\u539F\u6570\u636E\u5C06\u4F1A\u88AB\u5220\u9664\uFF0C\u6309\u7167\u6700\u65B0\u5BFC\u5165\u7684 \u4E3A\u4E3B\uFF0C\u5982\u7EE7\u7EED\u5BFC\u5165\uFF0C\u8BF7\u6309\u7167\u4E0B\u65B9\u6B65\u9AA4\u8FDB\u884C"
|
|
|
}), /*#__PURE__*/(0,jsx_runtime.jsxs)("p", {
|
|
|
style: {
|
|
|
color: '#5F6368'
|
|
|
},
|
|
|
children: ["\u6B65\u9AA41\uFF1A", /*#__PURE__*/(0,jsx_runtime.jsx)("span", {
|
|
|
style: {
|
|
|
color: '#000000'
|
|
|
},
|
|
|
children: "\u4E0B\u8F7D"
|
|
|
}), /*#__PURE__*/(0,jsx_runtime.jsx)("a", {
|
|
|
href: "".concat(env/* default */.Z.API_SERVER, "/api/knowledge_graphs/down_template.json"),
|
|
|
download: "\u6A21\u7248.xlsx",
|
|
|
children: "\u77E5\u8BC6\u56FE\u8C31\u5BFC\u5165\u6A21\u7248"
|
|
|
})]
|
|
|
}), /*#__PURE__*/(0,jsx_runtime.jsx)(row/* default */.Z, {
|
|
|
children: /*#__PURE__*/(0,jsx_runtime.jsxs)(col/* default */.Z, {
|
|
|
style: {
|
|
|
color: '#5F6368'
|
|
|
},
|
|
|
children: ["\u6B65\u9AA42\uFF1A", /*#__PURE__*/(0,jsx_runtime.jsx)("span", {
|
|
|
style: {
|
|
|
color: '#000000'
|
|
|
},
|
|
|
children: "\u4E0A\u4F20\u586B\u5199\u597D\u7684\u300A\u77E5\u8BC6\u56FE\u8C31\u5BFC\u5165\u6A21\u7248\u300B"
|
|
|
})]
|
|
|
})
|
|
|
}), /*#__PURE__*/(0,jsx_runtime.jsx)(row/* default */.Z, {
|
|
|
style: {
|
|
|
marginTop: 10,
|
|
|
marginLeft: 50
|
|
|
},
|
|
|
children: /*#__PURE__*/(0,jsx_runtime.jsx)(upload/* default */.Z, objectSpread2_default()(objectSpread2_default()({}, Draggers), {}, {
|
|
|
children: /*#__PURE__*/(0,jsx_runtime.jsxs)("span", {
|
|
|
style: {
|
|
|
padding: '0px 16px',
|
|
|
color: '#3061D0',
|
|
|
cursor: 'pointer',
|
|
|
height: 32,
|
|
|
alignItems: 'center',
|
|
|
display: 'inline-flex',
|
|
|
borderRadius: 2,
|
|
|
border: '1px solid #BACFFE',
|
|
|
background: '#F6F7F9 linear-gradient(180deg, #FFFFFF 0%, #F6F7F9 100%)',
|
|
|
boxShadow: '0px 2px 4px 0px #E0DFE1, inset 0px 1px 3px 0px rgba(255,255,255,0.5)'
|
|
|
},
|
|
|
children: [/*#__PURE__*/(0,jsx_runtime.jsx)("i", {
|
|
|
style: {
|
|
|
fontSize: 12,
|
|
|
marginRight: 6
|
|
|
},
|
|
|
className: "iconfont icon-tianjiashitixiaojiahao"
|
|
|
}), " \u9009\u62E9\u6587\u4EF6"]
|
|
|
})
|
|
|
}))
|
|
|
})]
|
|
|
}), /*#__PURE__*/(0,jsx_runtime.jsx)(modal/* default */.Z, {
|
|
|
open: showadd,
|
|
|
title: "\u6DFB\u52A0\u5173\u7CFB",
|
|
|
width: 500,
|
|
|
getContainer: function getContainer() {
|
|
|
return containerRef.current;
|
|
|
},
|
|
|
centered: true,
|
|
|
onCancel: function onCancel() {
|
|
|
setshowadd(false);
|
|
|
form.setFieldsValue({
|
|
|
relation: null
|
|
|
});
|
|
|
},
|
|
|
okButtonProps: {
|
|
|
loading: buttonloading
|
|
|
},
|
|
|
onOk: function onOk() {
|
|
|
form.submit();
|
|
|
},
|
|
|
children: /*#__PURE__*/(0,jsx_runtime.jsx)(es_form/* default */.Z, {
|
|
|
form: form,
|
|
|
onFinish: ( /*#__PURE__*/function () {
|
|
|
var _ref12 = asyncToGenerator_default()( /*#__PURE__*/regeneratorRuntime_default()().mark(function _callee15(values) {
|
|
|
var res;
|
|
|
return regeneratorRuntime_default()().wrap(function _callee15$(_context15) {
|
|
|
while (1) switch (_context15.prev = _context15.next) {
|
|
|
case 0:
|
|
|
setbuttonloading(true);
|
|
|
_context15.next = 3;
|
|
|
return (0,fetch/* default */.ZP)("/api/knowledge_graphs/".concat(items.id, "/relation.json"), {
|
|
|
method: 'post',
|
|
|
body: objectSpread2_default()({
|
|
|
type: 2,
|
|
|
parent_id: AddModal
|
|
|
}, values)
|
|
|
});
|
|
|
case 3:
|
|
|
res = _context15.sent;
|
|
|
setbuttonloading(false);
|
|
|
if (res.status === 0) {
|
|
|
message/* default */.ZP.info('关联成功');
|
|
|
getdatas();
|
|
|
setAddModal('');
|
|
|
setshowadd(false);
|
|
|
form.setFieldsValue({
|
|
|
relation: null
|
|
|
});
|
|
|
}
|
|
|
case 6:
|
|
|
case "end":
|
|
|
return _context15.stop();
|
|
|
}
|
|
|
}, _callee15);
|
|
|
}));
|
|
|
return function (_x7) {
|
|
|
return _ref12.apply(this, arguments);
|
|
|
};
|
|
|
}()),
|
|
|
children: /*#__PURE__*/(0,jsx_runtime.jsx)(es_form/* default */.Z.Item, {
|
|
|
name: "relation",
|
|
|
label: "\u7C7B\u578B",
|
|
|
children: /*#__PURE__*/(0,jsx_runtime.jsxs)(es_select["default"], {
|
|
|
getPopupContainer: function getPopupContainer() {
|
|
|
return containerRef.current;
|
|
|
},
|
|
|
placeholder: "\u8BF7\u9009\u62E9\u7C7B\u578B",
|
|
|
children: [/*#__PURE__*/(0,jsx_runtime.jsx)(es_select["default"].Option, {
|
|
|
value: 1,
|
|
|
children: "\u5173\u8054"
|
|
|
}), /*#__PURE__*/(0,jsx_runtime.jsx)(es_select["default"].Option, {
|
|
|
value: 2,
|
|
|
children: "\u540E\u5E8F"
|
|
|
})]
|
|
|
})
|
|
|
})
|
|
|
})
|
|
|
}), selectmodal && /*#__PURE__*/(0,jsx_runtime.jsxs)(modal/* default */.Z, {
|
|
|
open: selectmodal,
|
|
|
centered: true,
|
|
|
width: 550,
|
|
|
title: '查找',
|
|
|
getContainer: function getContainer() {
|
|
|
return containerRef.current;
|
|
|
},
|
|
|
onCancel: function onCancel() {
|
|
|
setAddModal('');
|
|
|
setselectmodal(false);
|
|
|
},
|
|
|
okButtonProps: {
|
|
|
loading: buttonloading
|
|
|
},
|
|
|
onOk: function onOk() {
|
|
|
var _treeDiagramRef$curre10, _relationshipDiagramR10, _relationshipDiagramR11, _relationshipDiagramR12, _treeDiagramRef$curre11, _treeDiagramRef$curre12, _treeDiagramRef$curre13, _relationshipDiagramR13;
|
|
|
setselectmodal(false);
|
|
|
(_treeDiagramRef$curre10 = treeDiagramRef.current) === null || _treeDiagramRef$curre10 === void 0 || _treeDiagramRef$curre10.clearSelection();
|
|
|
(_relationshipDiagramR10 = relationshipDiagramRef.current) === null || _relationshipDiagramR10 === void 0 || _relationshipDiagramR10.clearSelection();
|
|
|
var node = (_relationshipDiagramR11 = relationshipDiagramRef.current) === null || _relationshipDiagramR11 === void 0 || (_relationshipDiagramR12 = _relationshipDiagramR11.findNodeForKey) === null || _relationshipDiagramR12 === void 0 ? void 0 : _relationshipDiagramR12.call(_relationshipDiagramR11, AddModal);
|
|
|
var node2 = (_treeDiagramRef$curre11 = treeDiagramRef.current) === null || _treeDiagramRef$curre11 === void 0 || (_treeDiagramRef$curre12 = _treeDiagramRef$curre11.findNodeForKey) === null || _treeDiagramRef$curre12 === void 0 ? void 0 : _treeDiagramRef$curre12.call(_treeDiagramRef$curre11, AddModal);
|
|
|
(_treeDiagramRef$curre13 = treeDiagramRef.current) === null || _treeDiagramRef$curre13 === void 0 || (_treeDiagramRef$curre13 = _treeDiagramRef$curre13.commandHandler) === null || _treeDiagramRef$curre13 === void 0 || _treeDiagramRef$curre13.scrollToPart(node2);
|
|
|
(_relationshipDiagramR13 = relationshipDiagramRef.current) === null || _relationshipDiagramR13 === void 0 || (_relationshipDiagramR13 = _relationshipDiagramR13.commandHandler) === null || _relationshipDiagramR13 === void 0 || _relationshipDiagramR13.scrollToPart(node);
|
|
|
if (node) {
|
|
|
node.isSelected = true;
|
|
|
if (permission) {
|
|
|
setBounds({
|
|
|
left: 0,
|
|
|
top: 0,
|
|
|
bottom: 0,
|
|
|
right: 0
|
|
|
});
|
|
|
setitems(node.data);
|
|
|
}
|
|
|
}
|
|
|
if (node2) {
|
|
|
node2.isSelected = true;
|
|
|
if (permission) {
|
|
|
setBounds({
|
|
|
left: 0,
|
|
|
top: 0,
|
|
|
bottom: 0,
|
|
|
right: 0
|
|
|
});
|
|
|
setitems(node2.data);
|
|
|
}
|
|
|
}
|
|
|
setAddModal('');
|
|
|
setSearchValue('');
|
|
|
},
|
|
|
children: [/*#__PURE__*/(0,jsx_runtime.jsx)(input/* default */.Z.Search, {
|
|
|
size: "large",
|
|
|
allowClear: true,
|
|
|
onChange: function onChange(e) {
|
|
|
var value = e.target.value;
|
|
|
var newExpandedKeys = threelist.filter(function (item) {
|
|
|
return item.title.indexOf(value) > -1;
|
|
|
}).map(function (item) {
|
|
|
return item.key;
|
|
|
});
|
|
|
setExpandedKeys(newExpandedKeys);
|
|
|
if (newExpandedKeys.length <= 0) {
|
|
|
setThreenodata(true);
|
|
|
} else {
|
|
|
setThreenodata(false);
|
|
|
}
|
|
|
setAutoExpandParent(true);
|
|
|
setSearchValue(e.target.value);
|
|
|
// console.log(newExpandedKeys);
|
|
|
}
|
|
|
}), threenodata ? /*#__PURE__*/(0,jsx_runtime.jsx)(NoData/* default */.Z, {}) : /*#__PURE__*/(0,jsx_runtime.jsx)(tree/* default */.Z, {
|
|
|
onExpand: function onExpand(newExpandedKeys) {
|
|
|
setExpandedKeys(newExpandedKeys);
|
|
|
setAutoExpandParent(false);
|
|
|
},
|
|
|
style: {
|
|
|
maxHeight: 400,
|
|
|
height: 400,
|
|
|
marginTop: 20,
|
|
|
overflow: 'auto'
|
|
|
},
|
|
|
onSelect: function onSelect(e) {
|
|
|
setAddModal(e === null || e === void 0 ? void 0 : e[0]);
|
|
|
},
|
|
|
expandedKeys: expandedKeys,
|
|
|
defaultExpandAll: true,
|
|
|
autoExpandParent: autoExpandParent,
|
|
|
treeData: treeData
|
|
|
})]
|
|
|
})]
|
|
|
});
|
|
|
};
|
|
|
/* harmony default export */ var knowledge = ((0,_umi_production_exports.connect)(function (_ref13) {
|
|
|
var virtualSpaces = _ref13.virtualSpaces,
|
|
|
globalSetting = _ref13.globalSetting;
|
|
|
return {
|
|
|
globalSetting: globalSetting,
|
|
|
virtualSpaces: virtualSpaces
|
|
|
};
|
|
|
})(Atlas));
|
|
|
;// CONCATENATED MODULE: ./src/pages/virtualSpaces/Lists/Knowledge/index.tsx
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
var Page = function Page(_ref) {
|
|
|
var _data$subject_modules;
|
|
|
var globalSetting = _ref.globalSetting,
|
|
|
dispatch = _ref.dispatch,
|
|
|
virtualSpaces = _ref.virtualSpaces;
|
|
|
var _useSearchParams = (0,_umi_production_exports.useSearchParams)(),
|
|
|
_useSearchParams2 = slicedToArray_default()(_useSearchParams, 1),
|
|
|
searchParams = _useSearchParams2[0];
|
|
|
var _useState = (0,_react_17_0_2_react.useState)(true),
|
|
|
_useState2 = slicedToArray_default()(_useState, 2),
|
|
|
loading = _useState2[0],
|
|
|
setLoading = _useState2[1];
|
|
|
var _useState3 = (0,_react_17_0_2_react.useState)(false),
|
|
|
_useState4 = slicedToArray_default()(_useState3, 2),
|
|
|
btnLoading = _useState4[0],
|
|
|
setBtnLoading = _useState4[1];
|
|
|
var _useState5 = (0,_react_17_0_2_react.useState)(false),
|
|
|
_useState6 = slicedToArray_default()(_useState5, 2),
|
|
|
edit = _useState6[0],
|
|
|
setEdit = _useState6[1];
|
|
|
var _useState7 = (0,_react_17_0_2_react.useState)({}),
|
|
|
_useState8 = slicedToArray_default()(_useState7, 2),
|
|
|
data = _useState8[0],
|
|
|
setData = _useState8[1];
|
|
|
var _useState9 = (0,_react_17_0_2_react.useState)(''),
|
|
|
_useState10 = slicedToArray_default()(_useState9, 2),
|
|
|
description = _useState10[0],
|
|
|
setDescription = _useState10[1];
|
|
|
var _useState11 = (0,_react_17_0_2_react.useState)((searchParams === null || searchParams === void 0 ? void 0 : searchParams.get("active")) || 'position_and_target'),
|
|
|
_useState12 = slicedToArray_default()(_useState11, 2),
|
|
|
active = _useState12[0],
|
|
|
setActive = _useState12[1];
|
|
|
var virtualSpacesDetails = virtualSpaces.virtualSpacesDetails;
|
|
|
var query = (0,_umi_production_exports.useParams)();
|
|
|
var permission = (virtualSpacesDetails === null || virtualSpacesDetails === void 0 ? void 0 : virtualSpacesDetails.is_member) || (0,authority/* isSuperAdmins */.Ny)();
|
|
|
(0,_react_17_0_2_react.useEffect)(function () {
|
|
|
getData();
|
|
|
}, [active]);
|
|
|
var getData = /*#__PURE__*/function () {
|
|
|
var _ref2 = 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:
|
|
|
setLoading(true);
|
|
|
_context.next = 3;
|
|
|
return (0,fetch/* default */.ZP)("/api/virtual_classrooms/".concat(query.virtual_spacesId, "/knowledge_systems/show.json"), {
|
|
|
method: 'get',
|
|
|
params: {
|
|
|
column: active
|
|
|
}
|
|
|
});
|
|
|
case 3:
|
|
|
res = _context.sent;
|
|
|
if ((res === null || res === void 0 ? void 0 : res.status) !== -1) {
|
|
|
setData(objectSpread2_default()({}, res));
|
|
|
setDescription((res === null || res === void 0 ? void 0 : res[active]) || '');
|
|
|
}
|
|
|
setLoading(false);
|
|
|
case 6:
|
|
|
case "end":
|
|
|
return _context.stop();
|
|
|
}
|
|
|
}, _callee);
|
|
|
}));
|
|
|
return function getData() {
|
|
|
return _ref2.apply(this, arguments);
|
|
|
};
|
|
|
}();
|
|
|
var tabs = [{
|
|
|
id: 'position_and_target',
|
|
|
name: '课程定位与目标'
|
|
|
}, {
|
|
|
id: 'desc',
|
|
|
name: '课程知识点'
|
|
|
}, {
|
|
|
id: 'knowledge_graph',
|
|
|
name: '知识图谱描述'
|
|
|
}, {
|
|
|
id: 'knowledge',
|
|
|
name: '知识图谱'
|
|
|
}];
|
|
|
var handleEdit = /*#__PURE__*/function () {
|
|
|
var _ref3 = asyncToGenerator_default()( /*#__PURE__*/regeneratorRuntime_default()().mark(function _callee2() {
|
|
|
var body, res;
|
|
|
return regeneratorRuntime_default()().wrap(function _callee2$(_context2) {
|
|
|
while (1) switch (_context2.prev = _context2.next) {
|
|
|
case 0:
|
|
|
setBtnLoading(true);
|
|
|
body = {};
|
|
|
body[active] = description;
|
|
|
_context2.next = 5;
|
|
|
return (0,fetch/* default */.ZP)("/api/virtual_classrooms/".concat(query.virtual_spacesId, "/knowledge_systems/edit.json"), {
|
|
|
method: 'put',
|
|
|
body: body
|
|
|
});
|
|
|
case 5:
|
|
|
res = _context2.sent;
|
|
|
if ((res === null || res === void 0 ? void 0 : res.status) !== -1) {
|
|
|
getData();
|
|
|
setEdit(false);
|
|
|
}
|
|
|
setBtnLoading(false);
|
|
|
case 8:
|
|
|
case "end":
|
|
|
return _context2.stop();
|
|
|
}
|
|
|
}, _callee2);
|
|
|
}));
|
|
|
return function handleEdit() {
|
|
|
return _ref3.apply(this, arguments);
|
|
|
};
|
|
|
}();
|
|
|
var handleDelete = function handleDelete(id, name) {
|
|
|
modal/* default */.Z.confirm({
|
|
|
title: '提示',
|
|
|
okText: '确定删除',
|
|
|
okButtonProps: {
|
|
|
danger: true
|
|
|
},
|
|
|
icon: false,
|
|
|
className: resetmodules/* default */.Z.CustomTipsModalCss,
|
|
|
cancelText: '取消',
|
|
|
content: /*#__PURE__*/(0,jsx_runtime.jsxs)("div", {
|
|
|
children: [/*#__PURE__*/(0,jsx_runtime.jsxs)("div", {
|
|
|
children: ["\u786E\u8BA4\u5220\u9664 ", name, " \u5417\uFF1F"]
|
|
|
}), /*#__PURE__*/(0,jsx_runtime.jsx)("div", {
|
|
|
className: "mt10",
|
|
|
children: "\u5220\u9664\u540E\uFF0C\u5C06\u65E0\u6CD5\u6062\u590D\uFF0C\u8BF7\u8C28\u614E\u64CD\u4F5C"
|
|
|
})]
|
|
|
}),
|
|
|
onOk: function () {
|
|
|
var _onOk = 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:
|
|
|
_context3.next = 2;
|
|
|
return (0,fetch/* default */.ZP)("/api/virtual_classrooms/".concat(query.virtual_spacesId, "/knowledge_systems/").concat(id, "/del_content.json"), {
|
|
|
method: 'delete'
|
|
|
});
|
|
|
case 2:
|
|
|
res = _context3.sent;
|
|
|
if ((res === null || res === void 0 ? void 0 : res.status) !== -1) {
|
|
|
getData();
|
|
|
}
|
|
|
case 4:
|
|
|
case "end":
|
|
|
return _context3.stop();
|
|
|
}
|
|
|
}, _callee3);
|
|
|
}));
|
|
|
function onOk() {
|
|
|
return _onOk.apply(this, arguments);
|
|
|
}
|
|
|
return onOk;
|
|
|
}()
|
|
|
});
|
|
|
};
|
|
|
return /*#__PURE__*/(0,jsx_runtime.jsxs)("section", {
|
|
|
className: Knowledgemodules.wrap,
|
|
|
children: [/*#__PURE__*/(0,jsx_runtime.jsx)(ui_customization/* CustomTabs */.YG, {
|
|
|
value: active,
|
|
|
onChange: function onChange(k) {
|
|
|
if (k === active) {
|
|
|
return;
|
|
|
}
|
|
|
setActive(k);
|
|
|
setEdit(false);
|
|
|
},
|
|
|
tabBarExtraContent: permission && /*#__PURE__*/(0,jsx_runtime.jsxs)(jsx_runtime.Fragment, {
|
|
|
children: [active === 'position_and_target' && /*#__PURE__*/(0,jsx_runtime.jsxs)(ui_customization/* CustomButton */.op, {
|
|
|
onClick: function onClick() {
|
|
|
return setEdit(true);
|
|
|
},
|
|
|
children: [" ", /*#__PURE__*/(0,jsx_runtime.jsx)("i", {
|
|
|
className: "iconfont icon-bianji7 font14 mr5"
|
|
|
}), "\u7F16\u8F91"]
|
|
|
}), active === 'desc' && /*#__PURE__*/(0,jsx_runtime.jsxs)(row/* default */.Z, {
|
|
|
align: "middle",
|
|
|
children: [/*#__PURE__*/(0,jsx_runtime.jsxs)(ui_customization/* CustomButton */.op, {
|
|
|
onClick: function onClick() {
|
|
|
return setEdit(true);
|
|
|
},
|
|
|
children: [" ", /*#__PURE__*/(0,jsx_runtime.jsx)("i", {
|
|
|
className: "iconfont icon-bianji7 font14 mr5"
|
|
|
}), "\u7F16\u8F91\u8BF4\u660E"]
|
|
|
}), /*#__PURE__*/(0,jsx_runtime.jsxs)(ui_customization/* CustomButton */.op, {
|
|
|
onClick: function onClick() {
|
|
|
_umi_production_exports.history.push("/".concat(util/* vtrsKey */.AS, "/").concat(query.virtual_spacesId, "/knowledge/add"));
|
|
|
},
|
|
|
className: "ml20",
|
|
|
children: [" ", /*#__PURE__*/(0,jsx_runtime.jsx)("i", {
|
|
|
className: "iconfont icon-tianjiashitixiaojiahao font14 mr5"
|
|
|
}), "\u65B0\u589E\u77E5\u8BC6\u70B9\u6A21\u5757"]
|
|
|
})]
|
|
|
}), active === 'knowledge_graph' && /*#__PURE__*/(0,jsx_runtime.jsxs)(ui_customization/* CustomButton */.op, {
|
|
|
onClick: function onClick() {
|
|
|
return setEdit(true);
|
|
|
},
|
|
|
children: [" ", /*#__PURE__*/(0,jsx_runtime.jsx)("i", {
|
|
|
className: "iconfont icon-bianji7 font14 mr5"
|
|
|
}), "\u7F16\u8F91\u77E5\u8BC6\u56FE\u8C31"]
|
|
|
})]
|
|
|
}),
|
|
|
dataSource: tabs
|
|
|
}), /*#__PURE__*/(0,jsx_runtime.jsxs)(spin/* default */.Z, {
|
|
|
spinning: loading,
|
|
|
children: [active !== 'desc' && /*#__PURE__*/(0,jsx_runtime.jsx)("div", {
|
|
|
className: active !== 'knowledge' && 'mt20',
|
|
|
children: edit ? /*#__PURE__*/(0,jsx_runtime.jsxs)(jsx_runtime.Fragment, {
|
|
|
children: [/*#__PURE__*/(0,jsx_runtime.jsx)(markdown_editor/* default */.Z, {
|
|
|
onChange: function onChange(v) {
|
|
|
return setDescription(v);
|
|
|
},
|
|
|
watch: true,
|
|
|
defaultValue: description
|
|
|
}), /*#__PURE__*/(0,jsx_runtime.jsx)(ui_customization/* ConfirmAndCancel */.QD, {
|
|
|
confirmTitle: "\u4FDD\u5B58",
|
|
|
confirmLoading: btnLoading,
|
|
|
confirmClick: handleEdit,
|
|
|
cancelClick: function cancelClick() {
|
|
|
setEdit(false);
|
|
|
setDescription(data[active] || '');
|
|
|
},
|
|
|
cancelTitle: "\u53D6\u6D88",
|
|
|
className: "mb25"
|
|
|
})]
|
|
|
}) : /*#__PURE__*/(0,jsx_runtime.jsx)(RenderHtml/* default */.Z, {
|
|
|
value: description
|
|
|
})
|
|
|
}), active === 'knowledge' && /*#__PURE__*/(0,jsx_runtime.jsx)(knowledge, {}), active === 'desc' && /*#__PURE__*/(0,jsx_runtime.jsxs)("div", {
|
|
|
className: Knowledgemodules.content,
|
|
|
children: [!!description && /*#__PURE__*/(0,jsx_runtime.jsxs)("div", {
|
|
|
className: Knowledgemodules.name,
|
|
|
children: [/*#__PURE__*/(0,jsx_runtime.jsx)("aside", {
|
|
|
children: "\u8BF4\u660E"
|
|
|
}), /*#__PURE__*/(0,jsx_runtime.jsx)(RenderHtml/* default */.Z, {
|
|
|
value: description
|
|
|
})]
|
|
|
}), data === null || data === void 0 || (_data$subject_modules = data.subject_modules) === null || _data$subject_modules === void 0 ? void 0 : _data$subject_modules.map(function (item) {
|
|
|
var _item$members = item.members,
|
|
|
module_content = _item$members.module_content,
|
|
|
module_name = _item$members.module_name,
|
|
|
subject_module_id = _item$members.subject_module_id;
|
|
|
return /*#__PURE__*/(0,jsx_runtime.jsxs)("div", {
|
|
|
className: Knowledgemodules.list,
|
|
|
children: [/*#__PURE__*/(0,jsx_runtime.jsxs)("div", {
|
|
|
className: Knowledgemodules.head,
|
|
|
children: [/*#__PURE__*/(0,jsx_runtime.jsx)("div", {
|
|
|
className: Knowledgemodules.models,
|
|
|
children: module_name
|
|
|
}), permission && /*#__PURE__*/(0,jsx_runtime.jsxs)("div", {
|
|
|
className: Knowledgemodules.btns,
|
|
|
children: [/*#__PURE__*/(0,jsx_runtime.jsx)("div", {
|
|
|
onClick: function onClick() {
|
|
|
return _umi_production_exports.history.push("/".concat(util/* vtrsKey */.AS, "/").concat(query.virtual_spacesId, "/knowledge/").concat(subject_module_id, "/edit"));
|
|
|
},
|
|
|
children: /*#__PURE__*/(0,jsx_runtime.jsxs)("span", {
|
|
|
className: "primary-hover",
|
|
|
children: [/*#__PURE__*/(0,jsx_runtime.jsx)("i", {
|
|
|
className: "iconfont icon-bianji7 font14 mr5"
|
|
|
}), "\u7F16\u8F91"]
|
|
|
})
|
|
|
}), /*#__PURE__*/(0,jsx_runtime.jsx)("div", {
|
|
|
onClick: function onClick() {
|
|
|
return handleDelete(subject_module_id, module_name);
|
|
|
},
|
|
|
children: /*#__PURE__*/(0,jsx_runtime.jsxs)("span", {
|
|
|
className: "delete-hover",
|
|
|
children: [" ", /*#__PURE__*/(0,jsx_runtime.jsx)("i", {
|
|
|
className: "iconfont icon-piliangshanchubeifen font14 mr5"
|
|
|
}), "\u5220\u9664"]
|
|
|
})
|
|
|
})]
|
|
|
})]
|
|
|
}), /*#__PURE__*/(0,jsx_runtime.jsxs)("div", {
|
|
|
className: Knowledgemodules.rowsHead,
|
|
|
children: [/*#__PURE__*/(0,jsx_runtime.jsx)("div", {
|
|
|
children: "\u77E5\u8BC6\u70B9"
|
|
|
}), /*#__PURE__*/(0,jsx_runtime.jsx)("div", {
|
|
|
children: "\u4E3B\u8981\u5185\u5BB9"
|
|
|
}), /*#__PURE__*/(0,jsx_runtime.jsx)("div", {
|
|
|
children: "\u80FD\u529B\u76EE\u6807"
|
|
|
}), /*#__PURE__*/(0,jsx_runtime.jsx)("div", {
|
|
|
className: Knowledgemodules.time,
|
|
|
children: "\u5B66\u65F6"
|
|
|
}), /*#__PURE__*/(0,jsx_runtime.jsx)("div", {
|
|
|
style: {
|
|
|
marginRight: 0
|
|
|
},
|
|
|
children: "\u6559\u6848"
|
|
|
})]
|
|
|
}), module_content === null || module_content === void 0 ? void 0 : module_content.map(function (e, i) {
|
|
|
var knowledge_point = e.knowledge_point,
|
|
|
content = e.content,
|
|
|
target = e.target,
|
|
|
class_hour = e.class_hour,
|
|
|
lesson_plan = e.lesson_plan;
|
|
|
return /*#__PURE__*/(0,jsx_runtime.jsxs)("div", {
|
|
|
className: Knowledgemodules.rowsBody,
|
|
|
children: [/*#__PURE__*/(0,jsx_runtime.jsx)("div", {
|
|
|
children: knowledge_point
|
|
|
}), /*#__PURE__*/(0,jsx_runtime.jsx)("pre", {
|
|
|
children: content
|
|
|
}), /*#__PURE__*/(0,jsx_runtime.jsx)("pre", {
|
|
|
children: target
|
|
|
}), /*#__PURE__*/(0,jsx_runtime.jsx)("div", {
|
|
|
className: Knowledgemodules.time,
|
|
|
children: class_hour
|
|
|
}), /*#__PURE__*/(0,jsx_runtime.jsx)("div", {
|
|
|
style: {
|
|
|
marginRight: 0
|
|
|
},
|
|
|
children: /*#__PURE__*/(0,jsx_runtime.jsx)(RenderHtml/* default */.Z, {
|
|
|
value: lesson_plan
|
|
|
})
|
|
|
})]
|
|
|
}, i);
|
|
|
})]
|
|
|
}, subject_module_id);
|
|
|
})]
|
|
|
}), /*#__PURE__*/(0,jsx_runtime.jsxs)(modal/* default */.Z, {
|
|
|
title: '编辑说明',
|
|
|
destroyOnClose: true,
|
|
|
open: active === 'desc' && edit,
|
|
|
onOk: handleEdit,
|
|
|
centered: true,
|
|
|
onCancel: function onCancel() {
|
|
|
setEdit(false);
|
|
|
setDescription(data[active] || '');
|
|
|
},
|
|
|
confirmLoading: btnLoading,
|
|
|
width: 686,
|
|
|
okText: '确认',
|
|
|
cancelText: "\u53D6\u6D88",
|
|
|
wrapClassName: resetmodules/* default */.Z.CustomCss,
|
|
|
children: [/*#__PURE__*/(0,jsx_runtime.jsx)("div", {
|
|
|
children: "\u8BF4\u660E\uFF1A"
|
|
|
}), /*#__PURE__*/(0,jsx_runtime.jsx)(markdown_editor/* default */.Z, {
|
|
|
onChange: function onChange(v) {
|
|
|
return setDescription(v);
|
|
|
},
|
|
|
watch: true,
|
|
|
defaultValue: description
|
|
|
})]
|
|
|
})]
|
|
|
})]
|
|
|
});
|
|
|
};
|
|
|
/* harmony default export */ var Knowledge = ((0,_umi_production_exports.connect)(function (_ref4) {
|
|
|
var virtualSpaces = _ref4.virtualSpaces,
|
|
|
globalSetting = _ref4.globalSetting;
|
|
|
return {
|
|
|
globalSetting: globalSetting,
|
|
|
virtualSpaces: virtualSpaces
|
|
|
};
|
|
|
})(Page));
|
|
|
|
|
|
/***/ }),
|
|
|
|
|
|
/***/ 25526:
|
|
|
/*!*********************************!*\
|
|
|
!*** ./src/utils/fullscreen.ts ***!
|
|
|
\*********************************/
|
|
|
/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
|
|
|
|
|
|
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
|
|
|
/* harmony export */ BU: function() { return /* binding */ exitFull; },
|
|
|
/* harmony export */ Dj: function() { return /* binding */ requestFullScreen; },
|
|
|
/* harmony export */ gH: function() { return /* binding */ fullscreenChange; },
|
|
|
/* harmony export */ vp: function() { return /* binding */ IsFull; }
|
|
|
/* harmony export */ });
|
|
|
function requestFullScreen(element) {
|
|
|
try {
|
|
|
if (element.mozRequestFullScreen) {
|
|
|
element.mozRequestFullScreen();
|
|
|
} else if (element.webkitRequestFullScreen) {
|
|
|
element.webkitRequestFullScreen();
|
|
|
}
|
|
|
} catch (e) {
|
|
|
console.log(e, ":e");
|
|
|
}
|
|
|
}
|
|
|
function exitFull() {
|
|
|
if (window.top.document.webkitExitFullscreen) {
|
|
|
window.top.document.webkitExitFullscreen();
|
|
|
} else if (document.exitFullscreen) {
|
|
|
window.top.document.exitFullscreen();
|
|
|
} else if (document.msExitFullscreen) {
|
|
|
window.top.document.msExitFullscreen();
|
|
|
} else if (document.mozCancelFullScreen) {
|
|
|
window.top.document.mozCancelFullScreen();
|
|
|
}
|
|
|
}
|
|
|
|
|
|
// esliint disabled
|
|
|
var fullscreenChange = function fullscreenChange() {
|
|
|
//['fullscreenchange','msfullscreenchange','webkitfullscreenchange', 'mozfullscreenchange']
|
|
|
if (document.webkitExitFullscreen) {
|
|
|
// document.webkitExitFullscreen()
|
|
|
return 'webkitfullscreenchange';
|
|
|
} else if (document.exitFullscreen) {
|
|
|
// document.exitFullscreen()
|
|
|
return 'fullscreenchange';
|
|
|
} else if (document.msExitFullscreen) {
|
|
|
// document.msExitFullscreen()
|
|
|
return 'msfullscreenchange';
|
|
|
} else if (document.mozCancelFullScreen) {
|
|
|
// document.mozCancelFullScreen()
|
|
|
return 'mozfullscreenchange';
|
|
|
}
|
|
|
};
|
|
|
|
|
|
//判断是否全屏
|
|
|
function IsFull() {
|
|
|
var fullscreenElement = window.top.document.fullscreenElement || window.top.document.mozFullscreenElement || window.top.document.webkitFullscreenElement;
|
|
|
var fullscreenEnabled = document.fullscreenEnabled || document.mozFullscreenEnabled || document.webkitFullscreenEnabled;
|
|
|
console.log("fullscreenElement", fullscreenElement);
|
|
|
if (fullscreenElement == null) {
|
|
|
return false;
|
|
|
} else {
|
|
|
return true;
|
|
|
}
|
|
|
}
|
|
|
|
|
|
// document.addEventListener("mozfullscreenchange", function (event) {
|
|
|
// console.log("mozfullscreenchange ", event);
|
|
|
// if (IsFull()) {
|
|
|
// console.log('进入全屏')
|
|
|
// $("#closescreen").show();
|
|
|
// $("#openscreen").hide();
|
|
|
// } else {
|
|
|
// console.log('退出全屏')
|
|
|
// $("#closescreen").hide();
|
|
|
// $("#openscreen").show();
|
|
|
// }
|
|
|
// });
|
|
|
// document.addEventListener("webkitfullscreenchange", function (event) {
|
|
|
// console.log("webkitfullscreenchange", event);
|
|
|
// if (IsFull()) {
|
|
|
// console.log('进入全屏')
|
|
|
// $("#closescreen").show();
|
|
|
// $("#openscreen").hide();
|
|
|
// } else {
|
|
|
// console.log('退出全屏')
|
|
|
// $("#closescreen").hide();
|
|
|
// $("#openscreen").show();
|
|
|
// }
|
|
|
// });
|
|
|
// document.addEventListener("msfullscreenchange", function (event) {
|
|
|
// console.log("msfullscreenchange", event);
|
|
|
// if (IsFull()) {
|
|
|
// console.log('进入全屏')
|
|
|
// $("#closescreen").show();
|
|
|
// $("#openscreen").hide();
|
|
|
// } else {
|
|
|
// console.log('退出全屏')
|
|
|
// $("#closescreen").hide();
|
|
|
// $("#openscreen").show();
|
|
|
// }
|
|
|
// });
|
|
|
|
|
|
/***/ }),
|
|
|
|
|
|
/***/ 11806:
|
|
|
/*!************************************************************!*\
|
|
|
!*** ./src/components/ui-customization/reset.less?modules ***!
|
|
|
\************************************************************/
|
|
|
/***/ (function(__unused_webpack_module, __webpack_exports__) {
|
|
|
|
|
|
// extracted by mini-css-extract-plugin
|
|
|
/* harmony default export */ __webpack_exports__.Z = ({"flex_box_center":"flex_box_center___vG4eV","flex_space_between":"flex_space_between___qVVxe","flex_box_vertical_center":"flex_box_vertical_center___P8Z8s","flex_box_center_end":"flex_box_center_end___VMme3","flex_box_column":"flex_box_column___VMHwm","dropdownmenus":"dropdownmenus___oVzoj","popupClassNames":"popupClassNames___OcZq7","selectdown":"selectdown___mmcA8"});
|
|
|
|
|
|
/***/ })
|
|
|
|
|
|
}]); |