@titaui/pc 1.11.28 → 1.11.31

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.
@@ -94,7 +94,8 @@ function _default(props) {
94
94
  var data = props.data,
95
95
  index = props.index,
96
96
  title = props.title,
97
- key = props.key;
97
+ key = props.key,
98
+ canEditOkr = props.canEditOkr;
98
99
 
99
100
  var _useContext = (0, _react.useContext)(_context2.CommonContext),
100
101
  refreshAll = _useContext.refreshAll,
@@ -155,7 +156,7 @@ function _default(props) {
155
156
  var hasAuth = new _auth.KRAuth({
156
157
  user: data.user,
157
158
  createUserId: data.createUserId
158
- }).hasAuth();
159
+ }).hasAuth() || canEditOkr;
159
160
  var livetime = okrInfo.status != 2;
160
161
  return hasAuth && livetime;
161
162
  }),
@@ -15,6 +15,10 @@ var _requestApis = require("../../../../request-apis");
15
15
 
16
16
  var _rangePickerPop = _interopRequireDefault(require("../../../../../range-picker-pop"));
17
17
 
18
+ var _toast = _interopRequireDefault(require("../../../../../toast"));
19
+
20
+ var _getLocale = require("../../../../../../utils/getLocale");
21
+
18
22
  require("./index.css");
19
23
 
20
24
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
@@ -68,6 +72,12 @@ function _default(props) {
68
72
  kr: data,
69
73
  startDate: startDate,
70
74
  endDate: endDate
75
+ }).then(function (resp) {
76
+ if (resp.Code === 1) {
77
+ _toast["default"].Success((0, _getLocale.getLocale)('Mod_Successfuloperat'));
78
+ } else {
79
+ _toast["default"].Error(resp.Message);
80
+ }
71
81
  });
72
82
  rangePicker.current.setRange({
73
83
  startDate: startDate,
@@ -96,6 +96,7 @@ var preCls = "okr-detail-okrs-list";
96
96
 
97
97
  var treeDataFormate = function treeDataFormate(nodes) {
98
98
  var type = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : "kr";
99
+ var canEditOkr = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : false;
99
100
  var formateNodes = [];
100
101
  nodes.forEach(function (it, index) {
101
102
  var title = "";
@@ -107,7 +108,8 @@ var treeDataFormate = function treeDataFormate(nodes) {
107
108
  title: title,
108
109
  isLeaf: true,
109
110
  nodeType: type,
110
- data: it
111
+ data: it,
112
+ canEditOkr: canEditOkr
111
113
  });
112
114
  });
113
115
  return formateNodes;
@@ -272,9 +274,9 @@ var _default = /*#__PURE__*/(0, _react.forwardRef)(function (props, ref) {
272
274
  updateKrs();
273
275
  }, []);
274
276
  (0, _react.useEffect)(function () {
275
- var strucKrs = treeDataFormate(pureKrs, "kr");
277
+ var strucKrs = treeDataFormate(pureKrs, "kr", canEditOkr);
276
278
  setKrs(strucKrs);
277
- }, [pureKrs]);
279
+ }, [pureKrs, canEditOkr]);
278
280
 
279
281
  var onAddKrHandler = function onAddKrHandler(kr) {
280
282
  refreshAll();
@@ -155,6 +155,8 @@ var ExportMapModal = function ExportMapModal(props) {
155
155
  };
156
156
  _context.next = 12;
157
157
  return (0, _html2canvas["default"])(okrMapRef, opts).then(function (result) {
158
+ var _window, _window$BSGlobal, _window$BSGlobal$logi, _window2, _window2$BSGlobal, _window2$BSGlobal$ten;
159
+
158
160
  if ((0, _bsGlobal.isWx)() && window.WWOpenData) {
159
161
  if (window.WWOpenData.enableCanvasSharing) {
160
162
  window.WWOpenData.enableCanvasSharing();
@@ -165,11 +167,27 @@ var ExportMapModal = function ExportMapModal(props) {
165
167
  }
166
168
  }
167
169
 
170
+ var userId = (_window = window) === null || _window === void 0 ? void 0 : (_window$BSGlobal = _window.BSGlobal) === null || _window$BSGlobal === void 0 ? void 0 : (_window$BSGlobal$logi = _window$BSGlobal.loginUserInfo) === null || _window$BSGlobal$logi === void 0 ? void 0 : _window$BSGlobal$logi.Id;
171
+ var telentId = (_window2 = window) === null || _window2 === void 0 ? void 0 : (_window2$BSGlobal = _window2.BSGlobal) === null || _window2$BSGlobal === void 0 ? void 0 : (_window2$BSGlobal$ten = _window2$BSGlobal.tenantInfo) === null || _window2$BSGlobal$ten === void 0 ? void 0 : _window2$BSGlobal$ten.Id;
168
172
  var imgUrl = result.toDataURL('image/png'); // 得到图片的base64编码数据
173
+ // @ts-ignore
169
174
 
170
175
  // 得到图片的base64编码数据
176
+ // @ts-ignore
177
+ window.titaTracker && window.titaTracker("action").record({
178
+ actionName: userId + '租户:' + telentId + '我得到了图片' + imgUrl.slice(1, 200),
179
+ actionGroup: 'okr地图图片',
180
+ productName: 'okr地图导出'
181
+ });
171
182
  (0, _requestApis.getBase64DownloadUrl)(imgUrl.split(',')[1]).then(function (url) {
172
- var image = new Image();
183
+ var image = new Image(); // @ts-ignore
184
+
185
+ // @ts-ignore
186
+ window.titaTracker && window.titaTracker("action").record({
187
+ actionName: userId + '租户:' + telentId + '我获得了地址' + url.Data.obj,
188
+ actionGroup: 'okr地图接口',
189
+ productName: 'okr地图导出'
190
+ });
173
191
  image.setAttribute('crossOrigin', 'anonymous');
174
192
 
175
193
  image.onload = function () {
@@ -188,9 +206,9 @@ var ExportMapModal = function ExportMapModal(props) {
188
206
  a.download = 'okr地图'; // 设置图片名称
189
207
 
190
208
  // 设置图片名称
191
- a.href = url.Data.obj; // 将生成的URL设置为a.href属性
209
+ a.href = url.Data.obj; // 将生成的URL设置为a
192
210
 
193
- // 将生成的URL设置为a.href属性
211
+ // 将生成的URL设置为a
194
212
  a.dispatchEvent(event); // 触发a的单击事件
195
213
 
196
214
  // 触发a的单击事件
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@titaui/pc",
3
- "version": "1.11.28",
3
+ "version": "1.11.31",
4
4
  "nameCN": "",
5
5
  "description": "",
6
6
  "main": "lib/index.js",