@titaui/pc 1.12.31 → 1.12.34

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.
@@ -120,7 +120,7 @@ var EvaluationDialog = function EvaluationDialog(props) {
120
120
  remark: remark,
121
121
  type: Number(evaluateType),
122
122
  value: value,
123
- user: res === null || res === void 0 ? void 0 : res.user
123
+ user: res === null || res === void 0 ? void 0 : res.userV2
124
124
  });
125
125
 
126
126
  _toast["default"].Success((0, _getLocale.getLocale)("Mod_Successfuloperat"));
@@ -51,6 +51,8 @@ var prefix = 'titaui-okr-progress';
51
51
  var isImport = false;
52
52
 
53
53
  var OkrProgress = function OkrProgress(_ref) {
54
+ var _rowsData$Rows;
55
+
54
56
  var data = _ref.data,
55
57
  reportType = _ref.reportType;
56
58
 
@@ -142,7 +144,7 @@ var OkrProgress = function OkrProgress(_ref) {
142
144
  setRowsData(JSON.parse(data || '{}'));
143
145
  }
144
146
  }, [data]);
145
- if (!(rowsData !== null && rowsData !== void 0 && rowsData.Rows.length)) return null;
147
+ if (!(rowsData !== null && rowsData !== void 0 && (_rowsData$Rows = rowsData.Rows) !== null && _rowsData$Rows !== void 0 && _rowsData$Rows.length)) return null;
146
148
  return /*#__PURE__*/_react["default"].createElement("div", {
147
149
  className: prefix
148
150
  }, /*#__PURE__*/_react["default"].createElement("div", {
@@ -192,11 +192,12 @@ var DynamicReply = function DynamicReply(_ref) {
192
192
  alt: ""
193
193
  }))), dailyContent.map(function (item) {
194
194
  if (item.contentType === _constant.dailyContentType.richText) {
195
- return item.richContent !== "" && typeof item.richContent === "string" && /*#__PURE__*/_react["default"].createElement("div", {
195
+ return !item.richContent && typeof item.richContent === "string" && /*#__PURE__*/_react["default"].createElement("div", {
196
196
  className: "".concat(prefix, "__work")
197
197
  }, item.title === "工作总结" ? (0, _getLocale.getLocale)('Tasks_Tab_MyS_JobSummary') : (0, _getLocale.getLocale)('Rep_Tab_Mys_NextWorkPlans'), /*#__PURE__*/_react["default"].createElement(_richEditor["default"], null, /*#__PURE__*/_react["default"].createElement(_richEditor.EditorComponent, {
198
198
  editable: false,
199
- initialState: JSON.parse(item.richContent || '{}')
199
+ initialState: JSON.parse(item.richContent || '{}'),
200
+ placeholder: (0, _getLocale.getLocale)('Rep_NewS_Notfilled')
200
201
  })));
201
202
  }
202
203
 
@@ -27,7 +27,7 @@ var _selectLayer = _interopRequireDefault(require("../../select-layer"));
27
27
 
28
28
  var _utils = require("../utils");
29
29
 
30
- var _context2 = require("../context");
30
+ var _context3 = require("../context");
31
31
 
32
32
  var _bsGlobal = require("../../../utils/bs-global");
33
33
 
@@ -140,11 +140,11 @@ var ExportMapModal = function ExportMapModal(props) {
140
140
  }, [visible, mapInstance]);
141
141
 
142
142
  var downloadImg = /*#__PURE__*/function () {
143
- var _ref = _asyncToGenerator( /*#__PURE__*/regeneratorRuntime.mark(function _callee() {
143
+ var _ref = _asyncToGenerator( /*#__PURE__*/regeneratorRuntime.mark(function _callee2() {
144
144
  var okrMapRef, width, height, canvas, scale, opts;
145
- return regeneratorRuntime.wrap(function _callee$(_context) {
145
+ return regeneratorRuntime.wrap(function _callee2$(_context2) {
146
146
  while (1) {
147
- switch (_context.prev = _context.next) {
147
+ switch (_context2.prev = _context2.next) {
148
148
  case 0:
149
149
  okrMapRef = document.querySelector('.titaui-okr-flow__export') || document.createElement('div');
150
150
  width = okrMapRef.clientWidth; // 获取dom 宽度
@@ -176,7 +176,7 @@ var ExportMapModal = function ExportMapModal(props) {
176
176
  useCORS: true // 【重要】开启跨域配置
177
177
 
178
178
  };
179
- _context.next = 12;
179
+ _context2.next = 12;
180
180
  return (0, _html2canvas["default"])(okrMapRef, opts).then(function (result) {
181
181
  var _window, _window$BSGlobal, _window$BSGlobal$logi, _window2, _window2$BSGlobal, _window2$BSGlobal$ten;
182
182
 
@@ -240,7 +240,13 @@ var ExportMapModal = function ExportMapModal(props) {
240
240
  scope.setExtra('userMessage', userId + '租户:' + telentId + '我得到了图片大小为:' + size + ',路径为' + imgUrl);
241
241
  });
242
242
  (0, _requestApis.getBase64DownloadUrl)(imgUrl.split(',')[1]).then(function (url) {
243
- // const image = new Image()
243
+ var image = new Image(); // @ts-ignore
244
+ // window.titaTracker && window.titaTracker("action").record({
245
+ // actionName: userId+'租户:'+telentId+'我获得了地址'+url.Data.obj,
246
+ // actionGroup: 'okr地图接口',
247
+ // productName: 'okr地图导出',
248
+ // });
249
+
244
250
  // @ts-ignore
245
251
  // window.titaTracker && window.titaTracker("action").record({
246
252
  // actionName: userId+'租户:'+telentId+'我获得了地址'+url.Data.obj,
@@ -251,46 +257,87 @@ var ExportMapModal = function ExportMapModal(props) {
251
257
  scope.setTag('error-level', "P0");
252
258
  scope.setTag('error-type', '地图导出-图片地址');
253
259
  scope.setExtra('userMessage', userId + '租户:' + telentId + '我得到了图片大小为:' + size + ',路径为' + imgUrl);
254
- });
255
- var newUrl = url.Data.obj;
256
- var x = new XMLHttpRequest();
257
- x.open('GET', newUrl, true);
258
- x.responseType = 'blob';
259
-
260
- x.onload = function (e) {
261
- var url = window.URL.createObjectURL(x.response);
262
- var a = document.createElement('a');
263
- a.href = url;
264
- a.download = model.value === 20 ? '高清图片' : '标清图片';
265
- a.click();
266
-
267
- _toast["default"].Success('导出成功');
268
-
269
- setIsExport(false);
270
-
271
- if (onCloseHandler) {
272
- onCloseHandler();
273
- }
274
- };
275
-
276
- x.send(); // image.setAttribute('crossOrigin', 'anonymous')
277
- // image.onload = async() => {
278
- // if (!url.Data.obj) {
279
- // Toast.Error('导出失败,请稍后重试', { canClose: false })
280
- // }
281
- // await downloadFile(url.Data.obj,model.value===20?'高清分享图片':'标准分享图片')
282
- // // const a = document.createElement('a') // 生成一个a元素
283
- // // const event = new MouseEvent('click') // 创建一个单击事件
284
- // // a.download = '123' // 设置图片名称
285
- // // a.href = url.Data.obj // 将生成的URL设置为a
286
- // // a.dispatchEvent(event) // 触发a的单击事件
287
- // Toast.Success('导出成功')
288
- // setIsExport(false)
289
- // if (onCloseHandler) {
290
- // onCloseHandler()
291
- // }
260
+ }); // var newUrl = url.Data.obj
261
+ // var x = new XMLHttpRequest();
262
+ // x.open("GET", newUrl, true);
263
+ // x.responseType = 'blob';
264
+ // x.onload=function(e) {
265
+ // var url = window.URL.createObjectURL(x.response)
266
+ // var a = document.createElement('a');
267
+ // a.href = url
268
+ // a.download = model.value===20?'高清图片':'标清图片';
269
+ // a.click()
270
+ // Toast.Success('导出成功')
271
+ // setIsExport(false)
272
+ // if (onCloseHandler) {
273
+ // onCloseHandler()
274
+ // }
275
+ // }
276
+ // x.send();
277
+
278
+ // var newUrl = url.Data.obj
279
+ // var x = new XMLHttpRequest();
280
+ // x.open("GET", newUrl, true);
281
+ // x.responseType = 'blob';
282
+ // x.onload=function(e) {
283
+ // var url = window.URL.createObjectURL(x.response)
284
+ // var a = document.createElement('a');
285
+ // a.href = url
286
+ // a.download = model.value===20?'高清图片':'标清图片';
287
+ // a.click()
288
+ // Toast.Success('导出成功')
289
+ // setIsExport(false)
290
+ // if (onCloseHandler) {
291
+ // onCloseHandler()
292
+ // }
292
293
  // }
293
- // image.src = imgUrl
294
+ // x.send();
295
+ image.setAttribute('crossOrigin', 'anonymous');
296
+ image.onload = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/regeneratorRuntime.mark(function _callee() {
297
+ var a, event;
298
+ return regeneratorRuntime.wrap(function _callee$(_context) {
299
+ while (1) {
300
+ switch (_context.prev = _context.next) {
301
+ case 0:
302
+ if (!url.Data.obj) {
303
+ _toast["default"].Error('导出失败,请稍后重试', {
304
+ canClose: false
305
+ });
306
+ } // await downloadFile(url.Data.obj,model.value===20?'高清分享图片':'标准分享图片')
307
+
308
+
309
+ // await downloadFile(url.Data.obj,model.value===20?'高清分享图片':'标准分享图片')
310
+ a = document.createElement('a'); // 生成一个a元素
311
+
312
+ // 生成一个a元素
313
+ event = new MouseEvent('click'); // 创建一个单击事件
314
+
315
+ // 创建一个单击事件
316
+ a.download = '分享图片'; // 设置图片名称
317
+
318
+ // 设置图片名称
319
+ a.href = url.Data.obj; // 将生成的URL设置为a
320
+
321
+ // 将生成的URL设置为a
322
+ a.dispatchEvent(event); // 触发a的单击事件
323
+
324
+ // 触发a的单击事件
325
+ _toast["default"].Success('导出成功');
326
+
327
+ setIsExport(false);
328
+
329
+ if (onCloseHandler) {
330
+ onCloseHandler();
331
+ }
332
+
333
+ case 9:
334
+ case "end":
335
+ return _context.stop();
336
+ }
337
+ }
338
+ }, _callee);
339
+ }));
340
+ image.src = imgUrl;
294
341
  });
295
342
  })["catch"](function (err) {
296
343
  setIsExport(false);
@@ -302,10 +349,10 @@ var ExportMapModal = function ExportMapModal(props) {
302
349
 
303
350
  case 12:
304
351
  case "end":
305
- return _context.stop();
352
+ return _context2.stop();
306
353
  }
307
354
  }
308
- }, _callee);
355
+ }, _callee2);
309
356
  }));
310
357
 
311
358
  return function downloadImg() {
@@ -398,7 +445,7 @@ var ExportMapModal = function ExportMapModal(props) {
398
445
  className: "titaui-search-dropdown__text"
399
446
  }, model.label), /*#__PURE__*/_react["default"].createElement("span", {
400
447
  className: "tu-icon-sort-down"
401
- })))), /*#__PURE__*/_react["default"].createElement("div", null, visible && /*#__PURE__*/_react["default"].createElement(_context2.CommonContext.Provider, {
448
+ })))), /*#__PURE__*/_react["default"].createElement("div", null, visible && /*#__PURE__*/_react["default"].createElement(_context3.CommonContext.Provider, {
402
449
  value: {
403
450
  direction: direction,
404
451
  showkr: showkr,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@titaui/pc",
3
- "version": "1.12.31",
3
+ "version": "1.12.34",
4
4
  "nameCN": "",
5
5
  "description": "",
6
6
  "main": "lib/index.js",