@titaui/pc 1.11.5-beta.3 → 1.11.7
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.husky/pre-commit +2 -2
- package/lib/components/button/rect-btn/index.css +11 -25
- package/lib/components/button/rect-btn/index.js +4 -8
- package/lib/components/create-okr-modal/request-api.js +1 -1
- package/lib/components/drawer/index.js +8 -25
- package/lib/components/nav-top/index.js +2 -6
- package/lib/components/okr-detail/components/okr-tree/tree-node/e-node/e-priority-dropdown.js +1 -1
- package/lib/components/okr-detail/detail-header/actions.js +40 -44
- package/lib/components/okr-detail/detail-header/index.css +2 -2
- package/lib/components/okr-detail/detail-header/index.js +205 -194
- package/lib/components/okr-detail/index.js +2 -0
- package/lib/components/okr-flow/child-node/index.css +10 -46
- package/lib/components/okr-flow/child-node/work-node.js +3 -19
- package/lib/components/okr-flow/export-modal/index.js +2 -26
- package/lib/components/okr-flow/export-modules/okr-search-panel/index.js +9 -14
- package/lib/components/okr-flow/okr-map/index.js +14 -32
- package/lib/components/okr-flow/request-apis.js +4 -11
- package/lib/components/okr-flow/utils/index.js +28 -68
- package/lib/components/okr-flow/utils/tree-handler.js +1 -9
- package/lib/components/survey-model/contact.js +93 -0
- package/lib/components/survey-model/index.css +141 -0
- package/lib/components/survey-model/index.js +264 -0
- package/lib/components/survey-model/instance.js +86 -0
- package/lib/components/survey-model/request-api.js +80 -0
- package/lib/components/wechat-btn/index.css +14 -0
- package/lib/components/wechat-btn/index.js +333 -0
- package/lib/index.js +91 -115
- package/lib/pages/new-okr-list/header/index.css +0 -45
- package/lib/pages/new-okr-list/header/index.js +16 -28
- package/lib/pages/new-okr-list/index.js +1 -3
- package/lib/pages/okr-map/export-modules/okr-map/header/index.css +1 -1
- package/lib/pages/okr-map/export-modules/okr-map/header/index.js +4 -29
- package/lib/pages/okr-map/export-modules/okr-map/okr-map.js +17 -27
- package/lib/pages/okr-map/number-select/index.css +1 -0
- package/lib/utils/auth.js +60 -3
- package/lib/utils/bs-global.js +14 -2
- package/lib/utils/format-time.js +1 -8
- package/lib/utils/open-data.js +1 -5
- package/package.json +1 -1
- package/lib/components/textarea/index.css +0 -120
- package/lib/components/textarea/index.js +0 -257
- package/lib/pages/new-okr-list/header/common.js +0 -52
- package/lib/pages/new-okr-list/header/operate-record.js +0 -88
|
@@ -33,8 +33,6 @@ var _precls = _interopRequireDefault(require("../precls"));
|
|
|
33
33
|
|
|
34
34
|
var _getLocale = require("../../../utils/getLocale");
|
|
35
35
|
|
|
36
|
-
var _lodash = _interopRequireDefault(require("lodash"));
|
|
37
|
-
|
|
38
36
|
require("rc-color-picker/assets/index.css");
|
|
39
37
|
|
|
40
38
|
require("./index.css");
|
|
@@ -47,14 +45,6 @@ function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj &&
|
|
|
47
45
|
|
|
48
46
|
function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
|
49
47
|
|
|
50
|
-
function _toConsumableArray(arr) { return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread(); }
|
|
51
|
-
|
|
52
|
-
function _nonIterableSpread() { throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
|
|
53
|
-
|
|
54
|
-
function _iterableToArray(iter) { if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter); }
|
|
55
|
-
|
|
56
|
-
function _arrayWithoutHoles(arr) { if (Array.isArray(arr)) return _arrayLikeToArray(arr); }
|
|
57
|
-
|
|
58
48
|
function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) { try { var info = gen[key](arg); var value = info.value; } catch (error) { reject(error); return; } if (info.done) { resolve(value); } else { Promise.resolve(value).then(_next, _throw); } }
|
|
59
49
|
|
|
60
50
|
function _asyncToGenerator(fn) { return function () { var self = this, args = arguments; return new Promise(function (resolve, reject) { var gen = fn.apply(self, args); function _next(value) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, "next", value); } function _throw(err) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, "throw", err); } _next(undefined); }); }; }
|
|
@@ -98,7 +88,6 @@ var ExportMapModal = function ExportMapModal(props) {
|
|
|
98
88
|
setIsExport = _useState6[1];
|
|
99
89
|
|
|
100
90
|
var modalRef = (0, _react.useRef)();
|
|
101
|
-
var virtualElements = (0, _react.useRef)([]);
|
|
102
91
|
(0, _react.useEffect)(function () {
|
|
103
92
|
if ((0, _bsGlobal.isWx)() && window.WWOpenData) {
|
|
104
93
|
if (window.WWOpenData.enableCanvasSharing) {
|
|
@@ -247,19 +236,6 @@ var ExportMapModal = function ExportMapModal(props) {
|
|
|
247
236
|
setBgColor(colors ? colors.color : "none");
|
|
248
237
|
};
|
|
249
238
|
|
|
250
|
-
var NodeDebug = function NodeDebug() {
|
|
251
|
-
var elements = (0, _reactFlowRenderer.useStoreState)(function (state) {
|
|
252
|
-
return [].concat(_toConsumableArray(state.nodes), _toConsumableArray(state.edges));
|
|
253
|
-
}, _lodash["default"].isEqual);
|
|
254
|
-
var setElements = (0, _reactFlowRenderer.useStoreActions)(function (actions) {
|
|
255
|
-
return actions.setElements;
|
|
256
|
-
});
|
|
257
|
-
var newElements = (0, _utils.getLayoutedElements)(elements, direction);
|
|
258
|
-
virtualElements = newElements;
|
|
259
|
-
setElements(newElements);
|
|
260
|
-
return null;
|
|
261
|
-
};
|
|
262
|
-
|
|
263
239
|
return /*#__PURE__*/_react["default"].createElement(_dialog["default"], {
|
|
264
240
|
title: (0, _getLocale.getLocale)("OKR_Ali_Exportmap"),
|
|
265
241
|
noFooterLine: true,
|
|
@@ -299,7 +275,7 @@ var ExportMapModal = function ExportMapModal(props) {
|
|
|
299
275
|
nodesDraggable: false,
|
|
300
276
|
nodesConnectable: false,
|
|
301
277
|
className: (0, _classnames["default"])("".concat(_precls["default"], "__export"), _defineProperty({}, "".concat(_precls["default"], "__dark"), darkTheme)),
|
|
302
|
-
elements: dataSource,
|
|
278
|
+
elements: (0, _utils.getLayoutedElements)(dataSource, direction),
|
|
303
279
|
nodeTypes: _utils.nodeTypes,
|
|
304
280
|
minZoom: 0.05,
|
|
305
281
|
zoomOnScroll: false,
|
|
@@ -311,7 +287,7 @@ var ExportMapModal = function ExportMapModal(props) {
|
|
|
311
287
|
width: "100%",
|
|
312
288
|
background: bgColor
|
|
313
289
|
}
|
|
314
|
-
}
|
|
290
|
+
}))))));
|
|
315
291
|
};
|
|
316
292
|
|
|
317
293
|
ExportMapModal.defaultProps = {
|
|
@@ -87,8 +87,6 @@ function OkrSearchPanel(props, ref) {
|
|
|
87
87
|
showkr = _props$showkr === void 0 ? true : _props$showkr,
|
|
88
88
|
_props$darkTheme = props.darkTheme,
|
|
89
89
|
darkTheme = _props$darkTheme === void 0 ? false : _props$darkTheme,
|
|
90
|
-
_props$showCardKr = props.showCardKr,
|
|
91
|
-
showCardKr = _props$showCardKr === void 0 ? false : _props$showCardKr,
|
|
92
90
|
onNodeClick = props.onNodeClick;
|
|
93
91
|
|
|
94
92
|
var _useState = (0, _react.useState)(true),
|
|
@@ -113,7 +111,7 @@ function OkrSearchPanel(props, ref) {
|
|
|
113
111
|
|
|
114
112
|
|
|
115
113
|
var getSearchData = (0, _react.useRef)((0, _helper.debounce)( /*#__PURE__*/function () {
|
|
116
|
-
var _ref = _asyncToGenerator( /*#__PURE__*/regeneratorRuntime.mark(function _callee(searchType, rootId, rootName, avatar, cycleType, yqmNum, annualNum, okrType, openLevel, showkr
|
|
114
|
+
var _ref = _asyncToGenerator( /*#__PURE__*/regeneratorRuntime.mark(function _callee(searchType, rootId, rootName, avatar, cycleType, yqmNum, annualNum, okrType, openLevel, showkr) {
|
|
117
115
|
var _yield$searchOkrs, works, okrIds, nodes, allNodes, subTreeNodes;
|
|
118
116
|
|
|
119
117
|
return regeneratorRuntime.wrap(function _callee$(_context) {
|
|
@@ -157,8 +155,7 @@ function OkrSearchPanel(props, ref) {
|
|
|
157
155
|
return (0, _requestApis.expandNodesByLevel)({
|
|
158
156
|
okrIds: okrIds,
|
|
159
157
|
level: openLevel - 1,
|
|
160
|
-
showKr: showkr ? 0 : 1
|
|
161
|
-
showCardKr: showCardKr ? 0 : 1
|
|
158
|
+
showKr: showkr ? 0 : 1
|
|
162
159
|
});
|
|
163
160
|
|
|
164
161
|
case 13:
|
|
@@ -191,19 +188,19 @@ function OkrSearchPanel(props, ref) {
|
|
|
191
188
|
}, _callee);
|
|
192
189
|
}));
|
|
193
190
|
|
|
194
|
-
return function (_x, _x2, _x3, _x4, _x5, _x6, _x7, _x8, _x9, _x10
|
|
191
|
+
return function (_x, _x2, _x3, _x4, _x5, _x6, _x7, _x8, _x9, _x10) {
|
|
195
192
|
return _ref.apply(this, arguments);
|
|
196
193
|
};
|
|
197
194
|
}(), 500)).current;
|
|
198
195
|
var okrFlow = (0, _react.useRef)();
|
|
199
196
|
(0, _react.useEffect)(function () {
|
|
200
197
|
if (!annualNum) return;
|
|
201
|
-
getSearchData(searchType, rootId, rootName, avatar, cycleType, yqmNum, annualNum, okrType, openLevel, showkr
|
|
202
|
-
}, [searchType, rootId, rootName, cycleType, yqmNum, annualNum, okrType, openLevel, showkr
|
|
198
|
+
getSearchData(searchType, rootId, rootName, avatar, cycleType, yqmNum, annualNum, okrType, openLevel, showkr);
|
|
199
|
+
}, [searchType, rootId, rootName, cycleType, yqmNum, annualNum, okrType, openLevel, showkr]);
|
|
203
200
|
(0, _react.useEffect)(function () {
|
|
204
201
|
var data = (0, _treeHandler.transToMapData)(treeNodes, showkr);
|
|
205
202
|
setDataSource(data.length > 1 ? data : []);
|
|
206
|
-
}, [treeNodes, showkr
|
|
203
|
+
}, [treeNodes, showkr]);
|
|
207
204
|
|
|
208
205
|
var handleParentExpand = /*#__PURE__*/function () {
|
|
209
206
|
var _ref2 = _asyncToGenerator( /*#__PURE__*/regeneratorRuntime.mark(function _callee2(node) {
|
|
@@ -219,8 +216,7 @@ function OkrSearchPanel(props, ref) {
|
|
|
219
216
|
krId: modelType == "kr" ? id : 0,
|
|
220
217
|
okrId: modelType == "kr" ? data.workId : id,
|
|
221
218
|
okrIdParent: modelType == "work" ? data.parentId : data.workId,
|
|
222
|
-
childRoot: false
|
|
223
|
-
showCardKr: showCardKr ? 0 : 1
|
|
219
|
+
childRoot: false
|
|
224
220
|
});
|
|
225
221
|
|
|
226
222
|
case 3:
|
|
@@ -253,7 +249,7 @@ function OkrSearchPanel(props, ref) {
|
|
|
253
249
|
}, _callee2);
|
|
254
250
|
}));
|
|
255
251
|
|
|
256
|
-
return function handleParentExpand(
|
|
252
|
+
return function handleParentExpand(_x11) {
|
|
257
253
|
return _ref2.apply(this, arguments);
|
|
258
254
|
};
|
|
259
255
|
}();
|
|
@@ -272,7 +268,6 @@ function OkrSearchPanel(props, ref) {
|
|
|
272
268
|
okrId: modelType == "work" ? id : data.workId,
|
|
273
269
|
okrIdParent: 0,
|
|
274
270
|
childRoot: true,
|
|
275
|
-
showCardKr: showCardKr ? 0 : 1,
|
|
276
271
|
currentOkrRole: modelType == "kr" ? data.mapkrVisible : data.MapOkrVisible
|
|
277
272
|
});
|
|
278
273
|
|
|
@@ -299,7 +294,7 @@ function OkrSearchPanel(props, ref) {
|
|
|
299
294
|
}, _callee3);
|
|
300
295
|
}));
|
|
301
296
|
|
|
302
|
-
return function handleChildExpand(
|
|
297
|
+
return function handleChildExpand(_x12) {
|
|
303
298
|
return _ref3.apply(this, arguments);
|
|
304
299
|
};
|
|
305
300
|
}();
|
|
@@ -11,8 +11,6 @@ var _react = _interopRequireWildcard(require("react"));
|
|
|
11
11
|
|
|
12
12
|
var _reactFlowRenderer = _interopRequireWildcard(require("@titaui/react-flow-renderer"));
|
|
13
13
|
|
|
14
|
-
var _lodash = _interopRequireDefault(require("lodash"));
|
|
15
|
-
|
|
16
14
|
var _classnames = _interopRequireDefault(require("classnames"));
|
|
17
15
|
|
|
18
16
|
var _html2canvas = _interopRequireDefault(require("html2canvas"));
|
|
@@ -41,14 +39,6 @@ function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj &&
|
|
|
41
39
|
|
|
42
40
|
function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
|
43
41
|
|
|
44
|
-
function _toConsumableArray(arr) { return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread(); }
|
|
45
|
-
|
|
46
|
-
function _nonIterableSpread() { throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
|
|
47
|
-
|
|
48
|
-
function _iterableToArray(iter) { if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter); }
|
|
49
|
-
|
|
50
|
-
function _arrayWithoutHoles(arr) { if (Array.isArray(arr)) return _arrayLikeToArray(arr); }
|
|
51
|
-
|
|
52
42
|
function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
|
|
53
43
|
|
|
54
44
|
function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
|
|
@@ -78,12 +68,16 @@ var OkrMap = /*#__PURE__*/(0, _react.forwardRef)(function (props, ref) {
|
|
|
78
68
|
onChildClose = _props$onChildClose === void 0 ? function () {} : _props$onChildClose,
|
|
79
69
|
_props$dataSource = props.dataSource,
|
|
80
70
|
dataSource = _props$dataSource === void 0 ? [] : _props$dataSource;
|
|
81
|
-
var virtualElements = (0, _react.useRef)([]);
|
|
82
71
|
|
|
83
|
-
var _useState = (0, _react.useState)(),
|
|
72
|
+
var _useState = (0, _react.useState)([]),
|
|
84
73
|
_useState2 = _slicedToArray(_useState, 2),
|
|
85
|
-
|
|
86
|
-
|
|
74
|
+
elements = _useState2[0],
|
|
75
|
+
setElements = _useState2[1];
|
|
76
|
+
|
|
77
|
+
var _useState3 = (0, _react.useState)(),
|
|
78
|
+
_useState4 = _slicedToArray(_useState3, 2),
|
|
79
|
+
flowInstance = _useState4[0],
|
|
80
|
+
setFlowInstance = _useState4[1];
|
|
87
81
|
|
|
88
82
|
var isMoving = (0, _react.useRef)(false);
|
|
89
83
|
|
|
@@ -95,10 +89,12 @@ var OkrMap = /*#__PURE__*/(0, _react.forwardRef)(function (props, ref) {
|
|
|
95
89
|
onNodeClick & onNodeClick(data);
|
|
96
90
|
};
|
|
97
91
|
|
|
92
|
+
var layoutedElements = (0, _utils.getLayoutedElements)(dataSource, direction);
|
|
93
|
+
|
|
98
94
|
var getDefaultPos = function getDefaultPos() {
|
|
99
95
|
var containerHeight = document.body.clientHeight - 200 - 96;
|
|
100
96
|
var containerWidth = document.body.clientWidth - 180 - 320;
|
|
101
|
-
var rootNode =
|
|
97
|
+
var rootNode = layoutedElements[0];
|
|
102
98
|
|
|
103
99
|
if (direction == "horizontal") {
|
|
104
100
|
var targetY = containerHeight / 2;
|
|
@@ -106,27 +102,13 @@ var OkrMap = /*#__PURE__*/(0, _react.forwardRef)(function (props, ref) {
|
|
|
106
102
|
}
|
|
107
103
|
|
|
108
104
|
var targetX = containerWidth / 2;
|
|
109
|
-
return [targetX - rootNode.position.x, -48];
|
|
110
|
-
// return [0, 0]
|
|
105
|
+
return [targetX - rootNode.position.x, -48];
|
|
111
106
|
};
|
|
112
107
|
|
|
113
108
|
var onLoad = function onLoad(reactFlowInstance) {
|
|
114
109
|
setFlowInstance(reactFlowInstance);
|
|
115
110
|
};
|
|
116
111
|
|
|
117
|
-
var NodeDebug = function NodeDebug() {
|
|
118
|
-
var elements = (0, _reactFlowRenderer.useStoreState)(function (state) {
|
|
119
|
-
return [].concat(_toConsumableArray(state.nodes), _toConsumableArray(state.edges));
|
|
120
|
-
}, _lodash["default"].isEqual);
|
|
121
|
-
var setElements = (0, _reactFlowRenderer.useStoreActions)(function (actions) {
|
|
122
|
-
return actions.setElements;
|
|
123
|
-
});
|
|
124
|
-
var newElements = (0, _utils.getLayoutedElements)(elements, direction);
|
|
125
|
-
virtualElements = newElements;
|
|
126
|
-
setElements(newElements);
|
|
127
|
-
return null;
|
|
128
|
-
};
|
|
129
|
-
|
|
130
112
|
(0, _react.useEffect)(function () {
|
|
131
113
|
if (flowInstance) {
|
|
132
114
|
var _getDefaultPos = getDefaultPos(),
|
|
@@ -192,7 +174,7 @@ var OkrMap = /*#__PURE__*/(0, _react.forwardRef)(function (props, ref) {
|
|
|
192
174
|
|
|
193
175
|
}, /*#__PURE__*/_react["default"].createElement(_reactFlowRenderer.ReactFlowProvider, null, dataSource.length == 0 ? /*#__PURE__*/_react["default"].createElement(_empty["default"], null) : /*#__PURE__*/_react["default"].createElement(_react["default"].Fragment, null, /*#__PURE__*/_react["default"].createElement(_reactFlowRenderer["default"], {
|
|
194
176
|
onLoad: onLoad,
|
|
195
|
-
elements:
|
|
177
|
+
elements: layoutedElements,
|
|
196
178
|
nodesDraggable: false,
|
|
197
179
|
nodesConnectable: false,
|
|
198
180
|
nodeTypes: _utils.nodeTypes,
|
|
@@ -200,7 +182,7 @@ var OkrMap = /*#__PURE__*/(0, _react.forwardRef)(function (props, ref) {
|
|
|
200
182
|
minZoom: 0.25,
|
|
201
183
|
maxZoom: 1.5,
|
|
202
184
|
panOnScroll: true
|
|
203
|
-
}
|
|
185
|
+
}), /*#__PURE__*/_react["default"].createElement(_miniMap["default"], {
|
|
204
186
|
onMoveStart: function onMoveStart() {
|
|
205
187
|
return isMoving.current = true;
|
|
206
188
|
}
|
|
@@ -78,9 +78,7 @@ var expandNode = function expandNode(params) {
|
|
|
78
78
|
_params$okrIdParent = params.okrIdParent,
|
|
79
79
|
okrIdParent = _params$okrIdParent === void 0 ? 0 : _params$okrIdParent,
|
|
80
80
|
_params$currentOkrRol = params.currentOkrRole,
|
|
81
|
-
currentOkrRole = _params$currentOkrRol === void 0 ? true : _params$currentOkrRol
|
|
82
|
-
_params$showCardKr = params.showCardKr,
|
|
83
|
-
showCardKr = _params$showCardKr === void 0 ? 1 : _params$showCardKr;
|
|
81
|
+
currentOkrRole = _params$currentOkrRol === void 0 ? true : _params$currentOkrRol;
|
|
84
82
|
return _axios["default"].get("".concat(requestDomain(), "/api/v1/").concat(tenantId, "/").concat(userId, "/okr/map/expand"), {
|
|
85
83
|
params: {
|
|
86
84
|
okrId: okrId,
|
|
@@ -89,9 +87,7 @@ var expandNode = function expandNode(params) {
|
|
|
89
87
|
// true: 展开子节点, false: 展开父节点
|
|
90
88
|
okrIdParent: okrIdParent,
|
|
91
89
|
// 当前选中okr 或 当前选中kr 的okrId(kr的父节点是所属okr)
|
|
92
|
-
currentOkrRole: currentOkrRole
|
|
93
|
-
// 查看权限
|
|
94
|
-
showCardKr: showCardKr // o带上kr
|
|
90
|
+
currentOkrRole: currentOkrRole // 查看权限
|
|
95
91
|
|
|
96
92
|
}
|
|
97
93
|
}).then(function (res) {
|
|
@@ -107,15 +103,12 @@ var expandNodesByLevel = function expandNodesByLevel(_ref2) {
|
|
|
107
103
|
_ref2$okrIds = _ref2.okrIds,
|
|
108
104
|
okrIds = _ref2$okrIds === void 0 ? [] : _ref2$okrIds,
|
|
109
105
|
_ref2$showKr = _ref2.showKr,
|
|
110
|
-
showKr = _ref2$showKr === void 0 ? 0 : _ref2$showKr
|
|
111
|
-
_ref2$showCardKr = _ref2.showCardKr,
|
|
112
|
-
showCardKr = _ref2$showCardKr === void 0 ? 1 : _ref2$showCardKr;
|
|
106
|
+
showKr = _ref2$showKr === void 0 ? 0 : _ref2$showKr;
|
|
113
107
|
return (// const queryStr = qs.stringify({ okrIds, level }, { arrayFormat: 'repeat' });
|
|
114
108
|
_axios["default"].post("".concat(requestDomain(), "/api/v1/").concat(tenantId, "/").concat(userId, "/okr/map/generalview"), {
|
|
115
109
|
okrIds: okrIds,
|
|
116
110
|
level: level,
|
|
117
|
-
showKr: showKr
|
|
118
|
-
showCardKr: showCardKr
|
|
111
|
+
showKr: showKr
|
|
119
112
|
}).then(function (res) {
|
|
120
113
|
return res.data.Data;
|
|
121
114
|
})
|
|
@@ -15,12 +15,6 @@ var _rootNode = _interopRequireDefault(require("../root-node"));
|
|
|
15
15
|
|
|
16
16
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
|
|
17
17
|
|
|
18
|
-
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
19
|
-
|
|
20
|
-
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
21
|
-
|
|
22
|
-
function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
|
23
|
-
|
|
24
18
|
var nodeTypes = {
|
|
25
19
|
ChildNode: _childNode["default"],
|
|
26
20
|
RootNode: _rootNode["default"]
|
|
@@ -29,77 +23,43 @@ exports.nodeTypes = nodeTypes;
|
|
|
29
23
|
|
|
30
24
|
var getLayoutedElements = function getLayoutedElements(elements) {
|
|
31
25
|
var direction = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : "horizontal";
|
|
32
|
-
var isHorizontal = direction === "horizontal";
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
// // debugger
|
|
38
|
-
// // let krsLength = el?.data?.data?.Krs?.length || 0
|
|
39
|
-
// // if(krsLength){
|
|
40
|
-
// // debugger
|
|
41
|
-
// // nodeHeight = nodeHeight + (krsLength*20)
|
|
42
|
-
// // }
|
|
43
|
-
// // const nodeElement = document.querySelector(`.react-flow__node[data-id="${Number(el.id)}"]`);
|
|
44
|
-
// console.log(el.__rf)
|
|
45
|
-
// dagreGraph.setNode(el.id, { width: el.__rf?.width || 0, height:el.__rf?.height || 0 });
|
|
46
|
-
// } else {
|
|
47
|
-
// dagreGraph.setEdge(el.source, el.target)
|
|
48
|
-
// }
|
|
49
|
-
// });
|
|
50
|
-
// dagre.layout(dagreGraph);
|
|
51
|
-
// return elements.map((el) => {
|
|
52
|
-
// if (isNode(el)) {
|
|
53
|
-
// const nodeWithPosition = dagreGraph.node(el.id);
|
|
54
|
-
// el.targetPosition = isHorizontal ? "left" : "top";
|
|
55
|
-
// el.sourcePosition = isHorizontal ? "right" : "bottom";
|
|
56
|
-
// el.position = {
|
|
57
|
-
// x: nodeWithPosition.x ,
|
|
58
|
-
// y: nodeWithPosition.y ,
|
|
59
|
-
// };
|
|
60
|
-
// }
|
|
61
|
-
// return el;
|
|
62
|
-
// });
|
|
63
|
-
|
|
64
|
-
var g = new _dagre["default"].graphlib.Graph();
|
|
65
|
-
g.setGraph({
|
|
66
|
-
rankdir: isHorizontal ? "LR" : "TB",
|
|
67
|
-
nodesep: 12,
|
|
68
|
-
ranksep: 80
|
|
69
|
-
});
|
|
70
|
-
g.setDefaultEdgeLabel(function () {
|
|
26
|
+
var isHorizontal = direction === "horizontal";
|
|
27
|
+
var nodeWidth = 320;
|
|
28
|
+
var nodeHeight = 96;
|
|
29
|
+
var dagreGraph = new _dagre["default"].graphlib.Graph();
|
|
30
|
+
dagreGraph.setDefaultEdgeLabel(function () {
|
|
71
31
|
return {};
|
|
72
32
|
});
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
33
|
+
dagreGraph.setGraph({
|
|
34
|
+
rankdir: isHorizontal ? "LR" : "TB",
|
|
35
|
+
ranksep: 80,
|
|
36
|
+
nodesep: 12
|
|
37
|
+
});
|
|
38
|
+
elements.forEach(function (el) {
|
|
39
|
+
if ((0, _reactFlowRenderer.isNode)(el)) {
|
|
40
|
+
dagreGraph.setNode(el.id, {
|
|
41
|
+
width: nodeWidth,
|
|
42
|
+
height: nodeHeight
|
|
81
43
|
});
|
|
82
44
|
} else {
|
|
83
|
-
|
|
45
|
+
dagreGraph.setEdge(el.source, el.target);
|
|
84
46
|
}
|
|
85
47
|
});
|
|
86
48
|
|
|
87
|
-
_dagre["default"].layout(
|
|
88
|
-
|
|
89
|
-
return elements.map(function (
|
|
90
|
-
if ((0, _reactFlowRenderer.isNode)(
|
|
91
|
-
var
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
}
|
|
99
|
-
});
|
|
49
|
+
_dagre["default"].layout(dagreGraph);
|
|
50
|
+
|
|
51
|
+
return elements.map(function (el) {
|
|
52
|
+
if ((0, _reactFlowRenderer.isNode)(el)) {
|
|
53
|
+
var nodeWithPosition = dagreGraph.node(el.id);
|
|
54
|
+
el.targetPosition = isHorizontal ? "left" : "top";
|
|
55
|
+
el.sourcePosition = isHorizontal ? "right" : "bottom";
|
|
56
|
+
el.position = {
|
|
57
|
+
x: nodeWithPosition.x,
|
|
58
|
+
y: nodeWithPosition.y
|
|
59
|
+
};
|
|
100
60
|
}
|
|
101
61
|
|
|
102
|
-
return
|
|
62
|
+
return el;
|
|
103
63
|
});
|
|
104
64
|
};
|
|
105
65
|
|
|
@@ -142,11 +142,7 @@ var flatTree = function flatTree(current, elements, showkr) {
|
|
|
142
142
|
elements.push({
|
|
143
143
|
id: "".concat(id),
|
|
144
144
|
type: "RootNode",
|
|
145
|
-
data: data
|
|
146
|
-
position: {
|
|
147
|
-
x: 0,
|
|
148
|
-
y: 0
|
|
149
|
-
}
|
|
145
|
+
data: data
|
|
150
146
|
});
|
|
151
147
|
} else {
|
|
152
148
|
var isChildExpand = false;
|
|
@@ -168,10 +164,6 @@ var flatTree = function flatTree(current, elements, showkr) {
|
|
|
168
164
|
elements.push({
|
|
169
165
|
id: "".concat(id),
|
|
170
166
|
type: "ChildNode",
|
|
171
|
-
position: {
|
|
172
|
-
x: 0,
|
|
173
|
-
y: 0
|
|
174
|
-
},
|
|
175
167
|
data: {
|
|
176
168
|
id: id,
|
|
177
169
|
data: data,
|
|
@@ -0,0 +1,93 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); }
|
|
4
|
+
|
|
5
|
+
Object.defineProperty(exports, "__esModule", {
|
|
6
|
+
value: true
|
|
7
|
+
});
|
|
8
|
+
exports["default"] = void 0;
|
|
9
|
+
|
|
10
|
+
var _react = _interopRequireWildcard(require("react"));
|
|
11
|
+
|
|
12
|
+
var _classnames = _interopRequireDefault(require("classnames"));
|
|
13
|
+
|
|
14
|
+
var _button = _interopRequireDefault(require("../button"));
|
|
15
|
+
|
|
16
|
+
var _form = _interopRequireDefault(require("../form"));
|
|
17
|
+
|
|
18
|
+
require("./index.css");
|
|
19
|
+
|
|
20
|
+
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
|
|
21
|
+
|
|
22
|
+
function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
|
|
23
|
+
|
|
24
|
+
function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== "object" && typeof obj !== "function") { return { "default": obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj["default"] = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
|
|
25
|
+
|
|
26
|
+
function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
|
|
27
|
+
|
|
28
|
+
function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
|
|
29
|
+
|
|
30
|
+
function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
|
|
31
|
+
|
|
32
|
+
function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) { arr2[i] = arr[i]; } return arr2; }
|
|
33
|
+
|
|
34
|
+
function _iterableToArrayLimit(arr, i) { var _i = arr == null ? null : typeof Symbol !== "undefined" && arr[Symbol.iterator] || arr["@@iterator"]; if (_i == null) return; var _arr = []; var _n = true; var _d = false; var _s, _e; try { for (_i = _i.call(arr); !(_n = (_s = _i.next()).done); _n = true) { _arr.push(_s.value); if (i && _arr.length === i) break; } } catch (err) { _d = true; _e = err; } finally { try { if (!_n && _i["return"] != null) _i["return"](); } finally { if (_d) throw _e; } } return _arr; }
|
|
35
|
+
|
|
36
|
+
function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
|
37
|
+
|
|
38
|
+
var preCls = 'tita-survey-model';
|
|
39
|
+
var Rect = _button["default"].Rect;
|
|
40
|
+
var Input = _form["default"].Fields.Input;
|
|
41
|
+
|
|
42
|
+
var ContactModel = function ContactModel(_ref) {
|
|
43
|
+
var visilble = _ref.visilble,
|
|
44
|
+
setVisible = _ref.setVisible,
|
|
45
|
+
sendData = _ref.sendData;
|
|
46
|
+
|
|
47
|
+
var _useState = (0, _react.useState)(''),
|
|
48
|
+
_useState2 = _slicedToArray(_useState, 2),
|
|
49
|
+
contact = _useState2[0],
|
|
50
|
+
setContact = _useState2[1];
|
|
51
|
+
|
|
52
|
+
var onContactChange = function onContactChange(value) {
|
|
53
|
+
setContact(value);
|
|
54
|
+
};
|
|
55
|
+
|
|
56
|
+
var handleClose = function handleClose() {
|
|
57
|
+
sendData(contact);
|
|
58
|
+
|
|
59
|
+
if (setVisible) {
|
|
60
|
+
setVisible(false);
|
|
61
|
+
}
|
|
62
|
+
};
|
|
63
|
+
|
|
64
|
+
var handleSubmit = function handleSubmit() {
|
|
65
|
+
sendData(contact);
|
|
66
|
+
setVisible(false);
|
|
67
|
+
};
|
|
68
|
+
|
|
69
|
+
if (!visilble) return /*#__PURE__*/_react["default"].createElement("div", null);
|
|
70
|
+
return /*#__PURE__*/_react["default"].createElement("div", {
|
|
71
|
+
className: (0, _classnames["default"])('tita-survey-model')
|
|
72
|
+
}, /*#__PURE__*/_react["default"].createElement("div", {
|
|
73
|
+
className: "".concat(preCls, "__head")
|
|
74
|
+
}, /*#__PURE__*/_react["default"].createElement("div", {
|
|
75
|
+
className: "".concat(preCls, "__head-title")
|
|
76
|
+
}, "\u5982\u613F\u610F\u63A5\u53D7\u56DE\u8BBF\uFF0C\u8BF7\u7559\u4E0B\u59D3\u540D\u4E0E\u7535\u8BDD"), /*#__PURE__*/_react["default"].createElement("span", {
|
|
77
|
+
className: "tu-icon-canceled ".concat(preCls, "__head-close "),
|
|
78
|
+
onClick: handleClose
|
|
79
|
+
})), /*#__PURE__*/_react["default"].createElement(Input, {
|
|
80
|
+
placeholder: '请输入',
|
|
81
|
+
value: contact,
|
|
82
|
+
onChange: onContactChange,
|
|
83
|
+
className: "".concat(preCls, "__input")
|
|
84
|
+
}), /*#__PURE__*/_react["default"].createElement(Rect, {
|
|
85
|
+
type: "primary",
|
|
86
|
+
className: "".concat(preCls, "__btn"),
|
|
87
|
+
onClick: handleSubmit
|
|
88
|
+
}, "\u63D0\u4EA4"));
|
|
89
|
+
};
|
|
90
|
+
|
|
91
|
+
ContactModel.defaultProps = {};
|
|
92
|
+
var _default = ContactModel;
|
|
93
|
+
exports["default"] = _default;
|