@titaui/pc 1.11.28 → 1.11.29

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();
@@ -166,10 +166,24 @@ var ExportMapModal = function ExportMapModal(props) {
166
166
  }
167
167
 
168
168
  var imgUrl = result.toDataURL('image/png'); // 得到图片的base64编码数据
169
+ // @ts-ignore
169
170
 
170
171
  // 得到图片的base64编码数据
172
+ // @ts-ignore
173
+ window.titaTracker && window.titaTracker("action").record({
174
+ actionName: '我得到了图片' + imgUrl,
175
+ actionGroup: 'okr地图图片',
176
+ productName: 'okr地图导出'
177
+ });
171
178
  (0, _requestApis.getBase64DownloadUrl)(imgUrl.split(',')[1]).then(function (url) {
172
- var image = new Image();
179
+ var image = new Image(); // @ts-ignore
180
+
181
+ // @ts-ignore
182
+ window.titaTracker && window.titaTracker("action").record({
183
+ actionName: '我获得了地址' + url.Data.obj,
184
+ actionGroup: 'okr地图接口',
185
+ productName: 'okr地图导出'
186
+ });
173
187
  image.setAttribute('crossOrigin', 'anonymous');
174
188
 
175
189
  image.onload = function () {
@@ -188,9 +202,9 @@ var ExportMapModal = function ExportMapModal(props) {
188
202
  a.download = 'okr地图'; // 设置图片名称
189
203
 
190
204
  // 设置图片名称
191
- a.href = url.Data.obj; // 将生成的URL设置为a.href属性
205
+ a.href = url.Data.obj; // 将生成的URL设置为a
192
206
 
193
- // 将生成的URL设置为a.href属性
207
+ // 将生成的URL设置为a
194
208
  a.dispatchEvent(event); // 触发a的单击事件
195
209
 
196
210
  // 触发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.29",
4
4
  "nameCN": "",
5
5
  "description": "",
6
6
  "main": "lib/index.js",