@titaui/pc 1.12.4-beta.1 → 1.12.4-beta.3

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.
@@ -21,6 +21,8 @@ var _precls = _interopRequireDefault(require("../../precls"));
21
21
 
22
22
  var _drawerManager = _interopRequireDefault(require("../../../../../drawer-manager"));
23
23
 
24
+ var _taskRelationModal = _interopRequireDefault(require("../../../../../task-relation-modal"));
25
+
24
26
  var _auth = require("../../../../../../utils/auth");
25
27
 
26
28
  var _tooltipText = _interopRequireDefault(require("../../../../../tooltip/tooltip-text"));
@@ -41,7 +43,21 @@ function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) { try
41
43
 
42
44
  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); }); }; }
43
45
 
46
+ function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
47
+
48
+ 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."); }
49
+
50
+ 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); }
51
+
52
+ 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; }
53
+
54
+ 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; }
55
+
56
+ function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
57
+
44
58
  var hasProject = (0, _bsGlobal.hasWebHead)('project');
59
+ var RelationTaskModel = _taskRelationModal["default"].RelationTaskModel,
60
+ RelationWorkModel = _taskRelationModal["default"].RelationWorkModel;
45
61
  var baseAuth = new _auth.BaseAuth();
46
62
 
47
63
  var EKrNode = function EKrNode(props) {
@@ -61,6 +77,16 @@ var EKrNode = function EKrNode(props) {
61
77
  var _useContext2 = (0, _react.useContext)(_context2.EListContext),
62
78
  refreshEList = _useContext2.refreshEList;
63
79
 
80
+ var _useState = (0, _react.useState)(false),
81
+ _useState2 = _slicedToArray(_useState, 2),
82
+ isShowWork = _useState2[0],
83
+ setIsShowWork = _useState2[1];
84
+
85
+ var _useState3 = (0, _react.useState)(false),
86
+ _useState4 = _slicedToArray(_useState3, 2),
87
+ isShowTask = _useState4[0],
88
+ setIsShowTask = _useState4[1];
89
+
64
90
  var onlySuperCreateWork = (_window = window) === null || _window === void 0 ? void 0 : (_window$BSGlobal = _window.BSGlobal) === null || _window$BSGlobal === void 0 ? void 0 : (_window$BSGlobal$Work = _window$BSGlobal.WorkAdvancedSetting) === null || _window$BSGlobal$Work === void 0 ? void 0 : (_window$BSGlobal$Work2 = _window$BSGlobal$Work.WorkFunctionSetting) === null || _window$BSGlobal$Work2 === void 0 ? void 0 : _window$BSGlobal$Work2.WorkCreate; //开启后,仅超管、目标管理员、老板/助理可创建项目
65
91
 
66
92
  var canCreateWork = baseAuth.isBoss() || baseAuth.isManager() || baseAuth.isWorkManager() || baseAuth.isAssistant() || !onlySuperCreateWork;
@@ -142,37 +168,28 @@ var EKrNode = function EKrNode(props) {
142
168
  }(), []);
143
169
  var openRelatePop = (0, _react.useCallback)(function (name) {
144
170
  if (name === 'relateTask') {
145
- window.openRelateTaskPop(btnRef.current, {
146
- okrId: data.workId,
147
- krId: data.mileStoneId
148
- }).then(function () {
149
- _toast["default"].Success((0, _getLocale.getLocale)('Mod_Successfuloperat'), {
150
- canClose: false
151
- });
152
-
153
- setTimeout(refreshEList, 2000);
154
- })["catch"](function (e) {
155
- _toast["default"].Error(e, {
156
- canClose: false
157
- });
158
- });
171
+ setIsShowTask(true);
159
172
  } else {
160
- window.openRelateProjectPop(btnRef.current, {
161
- okrId: data.workId,
162
- krId: data.mileStoneId
163
- }).then(function () {
164
- _toast["default"].Success((0, _getLocale.getLocale)('Mod_Successfuloperat'), {
165
- canClose: false
166
- });
167
-
168
- setTimeout(refreshEList, 2000);
169
- })["catch"](function (e) {
170
- _toast["default"].Error(e.errorMsg, {
171
- canClose: false
172
- });
173
- });
173
+ setIsShowWork(true);
174
174
  }
175
- });
175
+ }, []);
176
+
177
+ var onModelCancel = function onModelCancel() {
178
+ setIsShowTask(false);
179
+ };
180
+
181
+ var onModelWorkCancel = function onModelWorkCancel() {
182
+ setIsShowWork(false);
183
+ };
184
+
185
+ var onModelOk = function onModelOk(data) {
186
+ setTimeout(refreshEList, 2000);
187
+ };
188
+
189
+ var onModelWorkOK = function onModelWorkOK(data) {
190
+ setTimeout(refreshEList, 2000);
191
+ };
192
+
176
193
  return /*#__PURE__*/_react["default"].createElement("div", {
177
194
  key: index,
178
195
  className: (0, _classnames["default"])("".concat(_precls["default"], "__e-kr-node"))
@@ -228,7 +245,22 @@ var EKrNode = function EKrNode(props) {
228
245
  icon: "tu-icon-GL-xiangmu",
229
246
  exIconClass: "e-kr-node-layer-icon",
230
247
  name: "relateProject"
231
- }, /*#__PURE__*/_react["default"].createElement("span", null, (0, _getLocale.getLocale)('OKR_MyO_E_Butt_AssProjects'))) : /*#__PURE__*/_react["default"].createElement("span", null))) : null);
248
+ }, /*#__PURE__*/_react["default"].createElement("span", null, (0, _getLocale.getLocale)('OKR_MyO_E_Butt_AssProjects'))) : /*#__PURE__*/_react["default"].createElement("span", null)), isShowTask && /*#__PURE__*/_react["default"].createElement(RelationTaskModel, {
249
+ noScreen: true,
250
+ zIndex: 2400,
251
+ krId: data === null || data === void 0 ? void 0 : data.mileStoneId,
252
+ okrId: data.workId,
253
+ defaultVisible: true,
254
+ onCancel: onModelCancel,
255
+ onRelateSuccess: onModelOk
256
+ }), isShowWork && /*#__PURE__*/_react["default"].createElement(RelationWorkModel, {
257
+ zIndex: 2400,
258
+ krId: data === null || data === void 0 ? void 0 : data.mileStoneId,
259
+ okrId: data.workId,
260
+ defaultVisible: true,
261
+ onCancel: onModelWorkCancel,
262
+ onRelateSuccess: onModelWorkOK
263
+ })) : null);
232
264
  };
233
265
 
234
266
  var _default = EKrNode;
@@ -201,13 +201,18 @@ var ExportMapModal = function ExportMapModal(props) {
201
201
  }
202
202
 
203
203
  size = size / 1024 / 1024; // @ts-ignore
204
+ // window.titaTracker && window.titaTracker("action").record({
205
+ // actionName: userId+'租户:'+telentId+'我得到了图片大小为:'+size+',路径为'+imgUrl.slice(1,200),
206
+ // actionGroup: 'okr地图图片',
207
+ // productName: 'okr地图导出',
208
+ // });
204
209
 
205
210
  // @ts-ignore
206
- window.titaTracker && window.titaTracker("action").record({
207
- actionName: userId + '租户:' + telentId + '我得到了图片大小为:' + size + ',路径为' + imgUrl.slice(1, 200),
208
- actionGroup: 'okr地图图片',
209
- productName: 'okr地图导出'
210
- });
211
+ // window.titaTracker && window.titaTracker("action").record({
212
+ // actionName: userId+'租户:'+telentId+'我得到了图片大小为:'+size+',路径为'+imgUrl.slice(1,200),
213
+ // actionGroup: 'okr地图图片',
214
+ // productName: 'okr地图导出',
215
+ // });
211
216
  Sentry.withScope(function (scope) {
212
217
  scope.setTag("error-level", "P0");
213
218
  scope.setTag("error-type", "地图导出-图片生成");
@@ -215,13 +220,18 @@ var ExportMapModal = function ExportMapModal(props) {
215
220
  });
216
221
  (0, _requestApis.getBase64DownloadUrl)(imgUrl.split(',')[1]).then(function (url) {
217
222
  var image = new Image(); // @ts-ignore
223
+ // window.titaTracker && window.titaTracker("action").record({
224
+ // actionName: userId+'租户:'+telentId+'我获得了地址'+url.Data.obj,
225
+ // actionGroup: 'okr地图接口',
226
+ // productName: 'okr地图导出',
227
+ // });
218
228
 
219
229
  // @ts-ignore
220
- window.titaTracker && window.titaTracker("action").record({
221
- actionName: userId + '租户:' + telentId + '我获得了地址' + url.Data.obj,
222
- actionGroup: 'okr地图接口',
223
- productName: 'okr地图导出'
224
- });
230
+ // window.titaTracker && window.titaTracker("action").record({
231
+ // actionName: userId+'租户:'+telentId+'我获得了地址'+url.Data.obj,
232
+ // actionGroup: 'okr地图接口',
233
+ // productName: 'okr地图导出',
234
+ // });
225
235
  Sentry.withScope(function (scope) {
226
236
  scope.setTag("error-level", "P0");
227
237
  scope.setTag("error-type", "地图导出-图片地址");
@@ -29,7 +29,7 @@ var _getLocale = require("../../../../utils/getLocale");
29
29
 
30
30
  require("./index.css");
31
31
 
32
- var _excluded = ["defaultVisible", "multiple", "onOk", "onCancel", "krId", "okrId", "isRelationOther", "onRelateSuccess", "lastSelected"];
32
+ var _excluded = ["defaultVisible", "multiple", "onOk", "onCancel", "krId", "okrId", "zIndex", "isRelationOther", "onRelateSuccess", "noScreen", "lastSelected"];
33
33
 
34
34
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
35
35
 
@@ -76,9 +76,13 @@ function OkrRelationTaskModal(props) {
76
76
  onCancel = _props$onCancel === void 0 ? function () {} : _props$onCancel,
77
77
  krId = props.krId,
78
78
  okrId = props.okrId,
79
+ _props$zIndex = props.zIndex,
80
+ zIndex = _props$zIndex === void 0 ? 1000 : _props$zIndex,
79
81
  _props$isRelationOthe = props.isRelationOther,
80
82
  isRelationOther = _props$isRelationOthe === void 0 ? false : _props$isRelationOthe,
81
83
  onRelateSuccess = props.onRelateSuccess,
84
+ _props$noScreen = props.noScreen,
85
+ noScreen = _props$noScreen === void 0 ? false : _props$noScreen,
82
86
  _props$lastSelected = props.lastSelected,
83
87
  lastSelected = _props$lastSelected === void 0 ? [] : _props$lastSelected,
84
88
  restProps = _objectWithoutProperties(props, _excluded);
@@ -220,7 +224,7 @@ function OkrRelationTaskModal(props) {
220
224
  height: '590px'
221
225
  },
222
226
  width: 840,
223
- zIndex: 1000,
227
+ zIndex: zIndex,
224
228
  noHeadLine: true,
225
229
  noFooterLine: true // getContainer={getContainer}
226
230
  ,
@@ -246,7 +250,8 @@ function OkrRelationTaskModal(props) {
246
250
  setSelected: setSelected,
247
251
  data: taskData,
248
252
  multiple: true,
249
- pageSize: pageSize
253
+ pageSize: pageSize,
254
+ noScreen: noScreen
250
255
  })), !!total && /*#__PURE__*/_react["default"].createElement("div", {
251
256
  className: "".concat(preCls, "__content-pagination")
252
257
  }, /*#__PURE__*/_react["default"].createElement(_pagination["default"], {
@@ -21,7 +21,7 @@ var _getLocale = require("../../../../utils/getLocale");
21
21
 
22
22
  require("./index.css");
23
23
 
24
- var _excluded = ["defaultVisible", "multiple", "onOk", "onCancel", "onRelateSuccess", "krId", "okrId", "isRelationOther", "lastSelected"];
24
+ var _excluded = ["defaultVisible", "multiple", "onOk", "onCancel", "onRelateSuccess", "krId", "zIndex", "okrId", "isRelationOther", "lastSelected"];
25
25
 
26
26
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
27
27
 
@@ -59,6 +59,8 @@ function OkrRelationWorkModal(props) {
59
59
  onCancel = _props$onCancel === void 0 ? function () {} : _props$onCancel,
60
60
  onRelateSuccess = props.onRelateSuccess,
61
61
  krId = props.krId,
62
+ _props$zIndex = props.zIndex,
63
+ zIndex = _props$zIndex === void 0 ? 1000 : _props$zIndex,
62
64
  okrId = props.okrId,
63
65
  _props$isRelationOthe = props.isRelationOther,
64
66
  isRelationOther = _props$isRelationOthe === void 0 ? false : _props$isRelationOthe,
@@ -111,7 +113,7 @@ function OkrRelationWorkModal(props) {
111
113
  height: '590px'
112
114
  },
113
115
  width: 840,
114
- zIndex: 1000,
116
+ zIndex: zIndex,
115
117
  noHeadLine: true,
116
118
  noFooterLine: true // getContainer={getContainer}
117
119
  ,
@@ -50,7 +50,7 @@
50
50
  .okr-relation-tree__content {
51
51
  margin-right: -32px;
52
52
  margin-left: -4px;
53
- height: 305px;
53
+ height: 320px;
54
54
  font-size: 14px;
55
55
  font-weight: 400;
56
56
  line-height: 22px;
@@ -48,7 +48,9 @@ var TaskTree = function TaskTree(_ref) {
48
48
  setSelected = _ref.setSelected,
49
49
  pageSize = _ref.pageSize,
50
50
  _ref$isWork = _ref.isWork,
51
- isWork = _ref$isWork === void 0 ? false : _ref$isWork;
51
+ isWork = _ref$isWork === void 0 ? false : _ref$isWork,
52
+ _ref$noScreen = _ref.noScreen,
53
+ noScreen = _ref$noScreen === void 0 ? false : _ref$noScreen;
52
54
  var scrollStyle = {
53
55
  height: '100%',
54
56
  backgroundColor: 'transparent',
@@ -59,7 +61,11 @@ var TaskTree = function TaskTree(_ref) {
59
61
  if (isWork) {
60
62
  window.open("#work?work_id=".concat(id, "&to_user_id=").concat((0, _helpers.getLoginUserInfo)().Id, "&status=1"));
61
63
  } else {
62
- window.Talent.app.vent.trigger('global-pull-screen', id, 'task');
64
+ if (noScreen) {
65
+ window.open("https://".concat(location.host).concat(location.pathname, "#more/taskinfo?id=").concat(id));
66
+ } else {
67
+ window.Talent.app.vent.trigger('global-pull-screen', id, 'task');
68
+ }
63
69
  }
64
70
  };
65
71
 
@@ -215,7 +215,6 @@ var _default = /*#__PURE__*/(0, _react.forwardRef)(function (props, ref) {
215
215
  });
216
216
 
217
217
  var onOkHandler = function onOkHandler(selectNodes, e) {
218
- debugger;
219
218
  setVisible(false);
220
219
  setSelected(selectNodes);
221
220
  var texts = [];
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@titaui/pc",
3
- "version": "1.12.4-beta.1",
3
+ "version": "1.12.4-beta.3",
4
4
  "nameCN": "",
5
5
  "description": "",
6
6
  "main": "lib/index.js",