@titaui/pc 1.13.2-beta.19 → 1.13.2-beta.21

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.
Files changed (75) hide show
  1. package/lib/components/checkbox-list/index.css +31 -0
  2. package/lib/components/checkbox-list/index.js +68 -0
  3. package/lib/components/create-okr-modal/index.js +4 -1
  4. package/lib/components/dialog-qq-docs/index.css +106 -0
  5. package/lib/components/dialog-qq-docs/index.js +501 -0
  6. package/lib/components/dialog-qq-docs/request-apis.js +16 -0
  7. package/lib/components/dialog-qq-docs/utils.js +83 -0
  8. package/lib/components/dialog-select/index.css +9 -0
  9. package/lib/components/dialog-select/index.js +48 -0
  10. package/lib/components/dialog-upload/img/folder.svg +40 -0
  11. package/lib/components/dialog-upload/img/form.svg +38 -0
  12. package/lib/components/dialog-upload/img/mind.svg +39 -0
  13. package/lib/components/dialog-upload/util.js +20 -2
  14. package/lib/components/dialog-upload-type/assets/folder.svg +20 -0
  15. package/lib/components/dialog-upload-type/assets/qq-docs.svg +20 -0
  16. package/lib/components/dialog-upload-type/components/upload-type-item/index.css +14 -0
  17. package/lib/components/dialog-upload-type/components/upload-type-item/index.js +36 -0
  18. package/lib/components/dialog-upload-type/index.css +7 -0
  19. package/lib/components/dialog-upload-type/index.js +68 -0
  20. package/lib/components/dynamic/dynamic-item/components/okr-progress/index.js +2 -3
  21. package/lib/components/dynamic/dynamic-item/components/schedule/index.js +1 -5
  22. package/lib/components/dynamic/dynamic-item/components/table-row-okr/index.css +0 -12
  23. package/lib/components/dynamic/dynamic-item/components/table-row-okr/index.js +2 -13
  24. package/lib/components/dynamic/dynamic-item/components/task-progress/render-row.js +2 -2
  25. package/lib/components/dynamic/dynamic-item/dynamic-new-report/components/remind-user-view/index.css +1 -16
  26. package/lib/components/dynamic/dynamic-item/dynamic-new-report/components/remind-user-view/index.js +9 -51
  27. package/lib/components/dynamic/dynamic-item/dynamic-new-report/index.js +10 -27
  28. package/lib/components/dynamic/dynamic-item/dynamic-progress/index.js +4 -6
  29. package/lib/components/dynamic/dynamic-item/index.js +3 -23
  30. package/lib/components/dynamic/request-api.js +2 -9
  31. package/lib/components/file-list/components/single-file/index.css +29 -0
  32. package/lib/components/file-list/components/single-file/index.js +19 -28
  33. package/lib/components/file-list/img/folder.svg +40 -0
  34. package/lib/components/file-list/img/form.svg +38 -0
  35. package/lib/components/file-list/img/mind.svg +39 -0
  36. package/lib/components/file-list/index.js +2 -1
  37. package/lib/components/file-list/util.js +20 -2
  38. package/lib/components/file-preview/index.css +44 -0
  39. package/lib/components/file-preview/index.js +68 -0
  40. package/lib/components/loading/assets/loading.gif +0 -0
  41. package/lib/components/loading/index.css +28 -0
  42. package/lib/components/loading/index.js +64 -0
  43. package/lib/components/nav/index.css +37 -0
  44. package/lib/components/nav/index.js +31 -0
  45. package/lib/components/nav-top/components/app-center/index.js +6 -1
  46. package/lib/components/nav-top/components/menu/index.js +44 -14
  47. package/lib/components/nav-top/index.css +6 -0
  48. package/lib/components/nav-top/index.js +138 -2
  49. package/lib/components/nav-top/request.apis.js +10 -2
  50. package/lib/components/okr-detail/schedule/components/kr-progress/index.js +4 -1
  51. package/lib/components/okr-guide/constant.js +23 -0
  52. package/lib/components/okr-guide/img/left-img.jpg +0 -0
  53. package/lib/components/okr-guide/index.css +148 -0
  54. package/lib/components/okr-guide/index.js +242 -0
  55. package/lib/components/okr-guide/request-api.js +57 -0
  56. package/lib/components/okr-review/ReviewPop/components/ReviewBody/index.js +1 -1
  57. package/lib/components/rich-editor/plugins/inline/color/commond.js +3 -3
  58. package/lib/components/rich-editor-at/index.js +13 -85
  59. package/lib/components/scroll-container/index.js +27 -6
  60. package/lib/components/search-input/index.css +2 -2
  61. package/lib/components/search-input/index.js +4 -0
  62. package/lib/components/upload/img/folder.svg +40 -0
  63. package/lib/components/upload/img/form.svg +38 -0
  64. package/lib/components/upload/img/mind.svg +39 -0
  65. package/lib/components/upload/index.js +193 -25
  66. package/lib/components/upload/index2.js +381 -0
  67. package/lib/components/upload/util.js +20 -2
  68. package/lib/components/user-selector/request-apis.js +3 -3
  69. package/lib/components/version-change-modal/index.js +1 -3
  70. package/lib/index.js +8 -0
  71. package/lib/utils/open-data.js +77 -68
  72. package/lib/utils/tools.js +11 -1
  73. package/package.json +2 -3
  74. package/lib/components/dynamic/dynamic-item/components/table-row-okr/utils.js +0 -56
  75. package/lib/utils/mock-bsglobal.js +0 -1837
@@ -23,6 +23,12 @@ function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "functio
23
23
 
24
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
25
 
26
+ 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; }
27
+
28
+ 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; }
29
+
30
+ 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; }
31
+
26
32
  function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
27
33
 
28
34
  function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
@@ -59,15 +65,24 @@ var ScrollContainer = /*#__PURE__*/function (_PureComponent) {
59
65
 
60
66
  _this = _super.call(this, props);
61
67
 
62
- _this.onEndScroll = function () {
68
+ _this.onEndScroll = function (e) {
69
+ var _e$target = e.target,
70
+ clientHeight = _e$target.clientHeight,
71
+ scrollHeight = _e$target.scrollHeight,
72
+ scrollTop = _e$target.scrollTop;
73
+ if (clientHeight + scrollTop >= scrollHeight - 50) _this.props.onScrollBottom(e);
63
74
  _this.scrolling = false;
64
75
 
65
76
  if (!_this.pressed && _this.started) {
66
- _this.processEnd();
77
+ _this.processEnd(e);
67
78
  }
68
79
  };
69
80
 
70
81
  _this.onScroll = function (e) {
82
+ var _e$target2 = e.target,
83
+ clientHeight = _e$target2.clientHeight,
84
+ scrollHeight = _e$target2.scrollHeight,
85
+ scrollTop = _e$target2.scrollTop;
71
86
  var container = _this.container.current; // Ignore the internal scrolls
72
87
 
73
88
  if (container.scrollLeft !== _this.scrollLeft || container.scrollTop !== _this.scrollTop) {
@@ -75,7 +90,13 @@ var ScrollContainer = /*#__PURE__*/function (_PureComponent) {
75
90
 
76
91
  _this.processScroll(e);
77
92
 
78
- _this.onEndScroll();
93
+ _this.onEndScroll({
94
+ target: {
95
+ clientHeight: clientHeight,
96
+ scrollHeight: scrollHeight,
97
+ scrollTop: scrollTop
98
+ }
99
+ });
79
100
  }
80
101
  };
81
102
 
@@ -351,14 +372,14 @@ var ScrollContainer = /*#__PURE__*/function (_PureComponent) {
351
372
  }
352
373
  }, {
353
374
  key: "processEnd",
354
- value: function processEnd() {
375
+ value: function processEnd(e) {
355
376
  var onEndScroll = this.props.onEndScroll;
356
377
  var container = this.container.current;
357
378
 
358
379
  if (container && onEndScroll) {
359
- onEndScroll({
380
+ onEndScroll(_objectSpread(_objectSpread({}, e), {}, {
360
381
  external: !this.internal
361
- });
382
+ }));
362
383
  }
363
384
 
364
385
  this.pressed = false;
@@ -23,7 +23,7 @@
23
23
  .search-input-box .clear-input-icon {
24
24
  color: #c2cbd1;
25
25
  position: absolute;
26
- font-size: 14px;
26
+ font-size: 16px;
27
27
  right: 32px;
28
28
  top: 50%;
29
29
  transform: translate(0, -50%);
@@ -41,7 +41,7 @@
41
41
  .search-input-box > input {
42
42
  background: #ffffff;
43
43
  border: 1px solid #e9edf0;
44
- border-radius: 16px;
44
+ border-radius: 18px;
45
45
  width: 100%;
46
46
  height: 100%;
47
47
  padding: 0 44px 0 11px;
@@ -58,6 +58,10 @@ function _default(props) {
58
58
  height: 30
59
59
  }, props.style);
60
60
 
61
+ (0, _react.useEffect)(function () {
62
+ setValue(props.value);
63
+ if (!props.value) setClearIconState(false);
64
+ }, [props.value]);
61
65
  var inputClassName = focus ? "search-input-focus" : "";
62
66
  var iconClassName = focus ? "search-input-icon-focus" : "";
63
67
  var clearIconStyle = {
@@ -0,0 +1,40 @@
1
+ <?xml version="1.0" encoding="UTF-8"?>
2
+ <svg width="28px" height="28px" viewBox="0 0 28 28" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
3
+ <title>文件夹-icon</title>
4
+ <defs>
5
+ <linearGradient x1="50%" y1="0%" x2="50%" y2="100%" id="linearGradient-1">
6
+ <stop stop-color="#FFC03F" offset="0%"></stop>
7
+ <stop stop-color="#E69F00" offset="100%"></stop>
8
+ </linearGradient>
9
+ <linearGradient x1="50%" y1="0%" x2="50%" y2="100%" id="linearGradient-2">
10
+ <stop stop-color="#FFDCA4" offset="0%"></stop>
11
+ <stop stop-color="#FFB112" offset="100%"></stop>
12
+ </linearGradient>
13
+ <filter x="-34.5%" y="-70.4%" width="169.1%" height="240.7%" filterUnits="objectBoundingBox" id="filter-3">
14
+ <feOffset dx="0" dy="0.8" in="SourceAlpha" result="shadowOffsetOuter1"></feOffset>
15
+ <feGaussianBlur stdDeviation="0.4" in="shadowOffsetOuter1" result="shadowBlurOuter1"></feGaussianBlur>
16
+ <feColorMatrix values="0 0 0 0 0.839215686 0 0 0 0 0.521568627 0 0 0 0 0 0 0 0 0.8 0" type="matrix" in="shadowBlurOuter1" result="shadowMatrixOuter1"></feColorMatrix>
17
+ <feMerge>
18
+ <feMergeNode in="shadowMatrixOuter1"></feMergeNode>
19
+ <feMergeNode in="SourceGraphic"></feMergeNode>
20
+ </feMerge>
21
+ </filter>
22
+ </defs>
23
+ <g id="老图标" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">
24
+ <g id="附件图标" transform="translate(-121.000000, -2257.000000)">
25
+ <g id="caret-left" transform="translate(100.000000, 2236.000000)">
26
+ <g id="文件夹-icon" transform="translate(21.000000, 21.451613)">
27
+ <rect id="矩形" x="0" y="0" width="28" height="27.0967742"></rect>
28
+ <g id="编组-2" transform="translate(3.000000, 4.000000)">
29
+ <path d="M15.9650836,2 L6,2 L8.77205113,6.06216846 C9.14163521,6.6037576 9.75321174,6.92979558 10.408869,6.93477353 L19,7 L19,7 L19,5.05359586 C19,3.3506359 17.6240805,2 15.9650836,2 Z" id="路径" fill="url(#linearGradient-1)" fill-rule="nonzero"></path>
30
+ <path d="M6.04598201,0 L2.57236384,0 C1.15168652,0 0,1.16658056 0,2.60563061 L0,16.3943694 C0,17.8334194 1.15168652,19 2.57236384,19 L19.4259356,19 C20.1081689,19 20.7624597,18.725479 21.2448715,18.2368285 C21.7272833,17.7481779 21.9982995,17.0854256 21.9982995,16.3943694 L22,7.44078957 L21.9889926,7.20659221 C21.8694704,5.89527292 20.7924377,4.86679244 19.4711935,4.84814641 L10.8954901,4.77831357 L8.46091772,1.49939662 C7.94002451,0.624382478 7.06938277,0 6.04598201,0 Z" id="路径" fill="url(#linearGradient-2)" fill-rule="nonzero"></path>
31
+ <g id="编组-22" filter="url(#filter-3)" transform="translate(5.439785, 9.493548)">
32
+ <path d="M0.7,4 L6.3,4 C6.68659932,4 7,4.31340068 7,4.7 C7,5.08659932 6.68659932,5.4 6.3,5.4 L0.7,5.4 C0.313400675,5.4 4.73447626e-17,5.08659932 0,4.7 C-4.73447626e-17,4.31340068 0.313400675,4 0.7,4 Z" id="path-5" fill="#FFDA9E" transform="translate(3.500000, 4.700000) rotate(-180.000000) translate(-3.500000, -4.700000) "></path>
33
+ <path d="M0.7,0 L10.3,0 C10.6865993,-1.82039446e-16 11,0.313400675 11,0.7 C11,1.08659932 10.6865993,1.4 10.3,1.4 L0.7,1.4 C0.313400675,1.4 4.73447626e-17,1.08659932 0,0.7 C-4.73447626e-17,0.313400675 0.313400675,7.10171439e-17 0.7,0 Z" id="path-5" fill="#FFFFFF" transform="translate(5.500000, 0.700000) rotate(-180.000000) translate(-5.500000, -0.700000) "></path>
34
+ </g>
35
+ </g>
36
+ </g>
37
+ </g>
38
+ </g>
39
+ </g>
40
+ </svg>
@@ -0,0 +1,38 @@
1
+ <?xml version="1.0" encoding="UTF-8"?>
2
+ <svg width="28px" height="28px" viewBox="0 0 28 28" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
3
+ <title>PPT-icon</title>
4
+ <defs>
5
+ <linearGradient x1="100%" y1="29.7818714%" x2="83.6208606%" y2="29.7818714%" id="linearGradient-1">
6
+ <stop stop-color="#F0A326" offset="0%"></stop>
7
+ <stop stop-color="#D68500" offset="100%"></stop>
8
+ </linearGradient>
9
+ <linearGradient x1="50%" y1="99.3480785%" x2="50%" y2="-1.36175793e-14%" id="linearGradient-2">
10
+ <stop stop-color="#F0A326" offset="0%"></stop>
11
+ <stop stop-color="#FFDA9E" offset="100%"></stop>
12
+ </linearGradient>
13
+ <filter x="-31.6%" y="-43.3%" width="163.2%" height="186.7%" filterUnits="objectBoundingBox" id="filter-3">
14
+ <feOffset dx="0" dy="0.8" in="SourceAlpha" result="shadowOffsetOuter1"></feOffset>
15
+ <feGaussianBlur stdDeviation="0.4" in="shadowOffsetOuter1" result="shadowBlurOuter1"></feGaussianBlur>
16
+ <feColorMatrix values="0 0 0 0 0.839215686 0 0 0 0 0.521568627 0 0 0 0 0 0 0 0 1 0" type="matrix" in="shadowBlurOuter1" result="shadowMatrixOuter1"></feColorMatrix>
17
+ <feMerge>
18
+ <feMergeNode in="shadowMatrixOuter1"></feMergeNode>
19
+ <feMergeNode in="SourceGraphic"></feMergeNode>
20
+ </feMerge>
21
+ </filter>
22
+ </defs>
23
+ <g id="老图标" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">
24
+ <g id="附件图标" transform="translate(-121.000000, -2469.000000)">
25
+ <g id="caret-left" transform="translate(100.000000, 2448.000000)">
26
+ <g id="PPT-icon" transform="translate(21.000000, 21.000000)">
27
+ <rect id="矩形" x="0" y="0" width="28" height="27.0967742"></rect>
28
+ <path d="M8.08888889,7.67741935 L23.6444445,7.67741935 C24.503554,7.67741935 25.2,8.3455386 25.2,9.16970547 L25.2,23.3464236 C25.2,24.1705905 24.503554,24.8387097 23.6444445,24.8387097 L8.08888889,24.8387097 C7.22977928,24.8387097 6.53333333,24.1705905 6.53333333,23.3464236 L6.53333333,9.16970547 C6.53333333,8.3455386 7.22977928,7.67741935 8.08888889,7.67741935 Z" id="蒙版备份" fill="url(#linearGradient-1)" fill-rule="nonzero"></path>
29
+ <path d="M20.291358,2.25806452 C21.1313763,2.25806452 21.8123456,2.93204446 21.8123456,3.76344086 L21.8123456,23.3333334 C21.8123456,24.1647298 22.493315,24.8387097 23.3333333,24.8387097 L4.32098765,24.8387097 C3.48096937,24.8387097 2.8,24.1647298 2.8,23.3333334 L2.8,3.76344086 C2.8,2.93204446 3.48096937,2.25806452 4.32098765,2.25806452 L20.291358,2.25806452 Z" id="path-3" fill="url(#linearGradient-2)" fill-rule="nonzero"></path>
30
+ <g id="编组-22" filter="url(#filter-3)" transform="translate(6.747309, 8.548387)">
31
+ <path d="M0.31629509,5.451829 L4.91629509,5.451829 C5.30289442,5.451829 5.61629509,5.76522967 5.61629509,6.151829 C5.61629509,6.53842832 5.30289442,6.851829 4.91629509,6.851829 L0.31629509,6.851829 C-0.0703042345,6.851829 -0.38370491,6.53842832 -0.38370491,6.151829 C-0.38370491,5.76522967 -0.0703042345,5.451829 0.31629509,5.451829 Z" id="path-5" fill="#FFDA9E" transform="translate(2.616295, 6.151829) rotate(-135.000000) translate(-2.616295, -6.151829) "></path>
32
+ <path d="M2.83675324,3.68406204 L12.4367532,3.68406204 C12.8233526,3.68406204 13.1367532,3.99746272 13.1367532,4.38406204 C13.1367532,4.77066137 12.8233526,5.08406204 12.4367532,5.08406204 L2.83675324,5.08406204 C2.45015391,5.08406204 2.13675324,4.77066137 2.13675324,4.38406204 C2.13675324,3.99746272 2.45015391,3.68406204 2.83675324,3.68406204 Z" id="path-5" fill="#FFFFFF" transform="translate(7.636753, 4.384062) rotate(-225.000000) translate(-7.636753, -4.384062) "></path>
33
+ </g>
34
+ </g>
35
+ </g>
36
+ </g>
37
+ </g>
38
+ </svg>
@@ -0,0 +1,39 @@
1
+ <?xml version="1.0" encoding="UTF-8"?>
2
+ <svg width="28px" height="28px" viewBox="0 0 28 28" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
3
+ <title>pdf-icon</title>
4
+ <defs>
5
+ <linearGradient x1="100%" y1="29.7818714%" x2="83.6208606%" y2="29.7818714%" id="linearGradient-1">
6
+ <stop stop-color="#33C7FF" offset="0%"></stop>
7
+ <stop stop-color="#009FDB" offset="100%"></stop>
8
+ </linearGradient>
9
+ <linearGradient x1="50%" y1="100%" x2="50%" y2="-2.48949813e-15%" id="linearGradient-2">
10
+ <stop stop-color="#12AFEA" offset="0%"></stop>
11
+ <stop stop-color="#94E2FF" offset="100%"></stop>
12
+ </linearGradient>
13
+ <filter x="-33.2%" y="-40.4%" width="166.4%" height="180.9%" filterUnits="objectBoundingBox" id="filter-3">
14
+ <feOffset dx="0" dy="0.8" in="SourceAlpha" result="shadowOffsetOuter1"></feOffset>
15
+ <feGaussianBlur stdDeviation="0.4" in="shadowOffsetOuter1" result="shadowBlurOuter1"></feGaussianBlur>
16
+ <feColorMatrix values="0 0 0 0 0.0705882353 0 0 0 0 0.68627451 0 0 0 0 0.917647059 0 0 0 0.8 0" type="matrix" in="shadowBlurOuter1" result="shadowMatrixOuter1"></feColorMatrix>
17
+ <feMerge>
18
+ <feMergeNode in="shadowMatrixOuter1"></feMergeNode>
19
+ <feMergeNode in="SourceGraphic"></feMergeNode>
20
+ </feMerge>
21
+ </filter>
22
+ </defs>
23
+ <g id="老图标" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">
24
+ <g id="附件图标" transform="translate(-121.000000, -2045.000000)">
25
+ <g id="caret-left" transform="translate(100.000000, 2024.000000)">
26
+ <g id="pdf-icon" transform="translate(21.000000, 21.451613)">
27
+ <rect id="矩形" x="0" y="0" width="28" height="27.0967742"></rect>
28
+ <path d="M8.08888889,7.67741935 L23.6444445,7.67741935 C24.503554,7.67741935 25.2,8.3455386 25.2,9.16970547 L25.2,23.3464236 C25.2,24.1705905 24.503554,24.8387097 23.6444445,24.8387097 L8.08888889,24.8387097 C7.22977928,24.8387097 6.53333333,24.1705905 6.53333333,23.3464236 L6.53333333,9.16970547 C6.53333333,8.3455386 7.22977928,7.67741935 8.08888889,7.67741935 Z" id="蒙版备份" fill="url(#linearGradient-1)" fill-rule="nonzero"></path>
29
+ <path d="M20.291358,2.25806452 C21.1313763,2.25806452 21.8123456,2.93204446 21.8123456,3.76344086 L21.8123456,23.3333334 C21.8123456,24.1647298 22.493315,24.8387097 23.3333333,24.8387097 L4.32098765,24.8387097 C3.48096937,24.8387097 2.8,24.1647298 2.8,23.3333334 L2.8,3.76344086 C2.8,2.93204446 3.48096937,2.25806452 4.32098765,2.25806452 L20.291358,2.25806452 Z" id="path-3" fill="url(#linearGradient-2)" fill-rule="nonzero"></path>
30
+ <g id="编组-22" filter="url(#filter-3)" transform="translate(6.000000, 8.798387)">
31
+ <path d="M7.13978495,4 L10.7397849,4 C11.1263843,4 11.4397849,4.31340068 11.4397849,4.7 C11.4397849,5.08659932 11.1263843,5.4 10.7397849,5.4 L7.13978495,5.4 C6.75318562,5.4 6.43978495,5.08659932 6.43978495,4.7 C6.43978495,4.31340068 6.75318562,4 7.13978495,4 Z" id="path-5" fill="#88DFFF" transform="translate(8.939785, 4.700000) rotate(-180.000000) translate(-8.939785, -4.700000) "></path>
32
+ <path d="M2.80326654,4 C3.08544089,4 3.34002538,4.16942267 3.44897952,4.42971358 C4.42734177,6.76701638 5.41282979,7.91043659 6.29653021,7.99493445 L6.40207871,8 L10.7,8 C11.0865993,8 11.4,8.31340068 11.4,8.7 C11.4,9.05438271 11.1366564,9.34725823 10.7949859,9.39360983 L10.7,9.4 L6.40207871,9.4 C4.9177844,9.4 3.65980532,8.17244898 2.53985234,5.8267506 L2.343,5.4 L0.7,5.4 C0.345617286,5.4 0.0527417698,5.13665638 0.00639017493,4.79498585 L0,4.7 C0,4.34561729 0.263343623,4.05274177 0.605014146,4.00639017 L0.7,4 L2.80326654,4 Z" id="路径-2" fill="#FFFFFF" fill-rule="nonzero"></path>
33
+ <path d="M2.80326654,0 C3.08544089,0 3.34002538,0.169422665 3.44897952,0.429713581 C4.42734177,2.76701638 5.41282979,3.91043659 6.29653021,3.99493445 L6.40207871,4 L10.7,4 C11.0865993,4 11.4,4.31340068 11.4,4.7 C11.4,5.05438271 11.1366564,5.34725823 10.7949859,5.39360983 L10.7,5.4 L6.40207871,5.4 C4.9177844,5.4 3.65980532,4.17244898 2.53985234,1.8267506 L2.343,1.4 L0.7,1.4 C0.345617286,1.4 0.0527417698,1.13665638 0.00639017493,0.794985854 L0,0.7 C0,0.345617286 0.263343623,0.0527417698 0.605014146,0.00639017493 L0.7,0 L2.80326654,0 Z" id="路径-2" fill="#FFFFFF" fill-rule="nonzero" transform="translate(5.700000, 2.700000) scale(1, -1) translate(-5.700000, -2.700000) "></path>
34
+ </g>
35
+ </g>
36
+ </g>
37
+ </g>
38
+ </g>
39
+ </svg>
@@ -13,6 +13,10 @@ var _titaUi = require("tita-ui");
13
13
 
14
14
  var _uuid = _interopRequireDefault(require("uuid"));
15
15
 
16
+ var _dialogUploadType = _interopRequireDefault(require("../dialog-upload-type"));
17
+
18
+ var _dialogQqDocs = _interopRequireDefault(require("../dialog-qq-docs"));
19
+
16
20
  var _Portals = _interopRequireDefault(require("../../components-v1/portals/Portals"));
17
21
 
18
22
  var _requestV = require("../../utils/request-v1");
@@ -31,12 +35,22 @@ var _util = require("./util");
31
35
 
32
36
  var _getLocale = require("../../utils/getLocale");
33
37
 
38
+ var _platform = require("../../utils/platform");
39
+
40
+ var _utils = require("../dialog-qq-docs/utils");
41
+
34
42
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
35
43
 
36
44
  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); }
37
45
 
38
46
  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; }
39
47
 
48
+ function _regeneratorRuntime() { "use strict"; /*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */ _regeneratorRuntime = function _regeneratorRuntime() { return exports; }; var exports = {}, Op = Object.prototype, hasOwn = Op.hasOwnProperty, $Symbol = "function" == typeof Symbol ? Symbol : {}, iteratorSymbol = $Symbol.iterator || "@@iterator", asyncIteratorSymbol = $Symbol.asyncIterator || "@@asyncIterator", toStringTagSymbol = $Symbol.toStringTag || "@@toStringTag"; function define(obj, key, value) { return Object.defineProperty(obj, key, { value: value, enumerable: !0, configurable: !0, writable: !0 }), obj[key]; } try { define({}, ""); } catch (err) { define = function define(obj, key, value) { return obj[key] = value; }; } function wrap(innerFn, outerFn, self, tryLocsList) { var protoGenerator = outerFn && outerFn.prototype instanceof Generator ? outerFn : Generator, generator = Object.create(protoGenerator.prototype), context = new Context(tryLocsList || []); return generator._invoke = function (innerFn, self, context) { var state = "suspendedStart"; return function (method, arg) { if ("executing" === state) throw new Error("Generator is already running"); if ("completed" === state) { if ("throw" === method) throw arg; return doneResult(); } for (context.method = method, context.arg = arg;;) { var delegate = context.delegate; if (delegate) { var delegateResult = maybeInvokeDelegate(delegate, context); if (delegateResult) { if (delegateResult === ContinueSentinel) continue; return delegateResult; } } if ("next" === context.method) context.sent = context._sent = context.arg;else if ("throw" === context.method) { if ("suspendedStart" === state) throw state = "completed", context.arg; context.dispatchException(context.arg); } else "return" === context.method && context.abrupt("return", context.arg); state = "executing"; var record = tryCatch(innerFn, self, context); if ("normal" === record.type) { if (state = context.done ? "completed" : "suspendedYield", record.arg === ContinueSentinel) continue; return { value: record.arg, done: context.done }; } "throw" === record.type && (state = "completed", context.method = "throw", context.arg = record.arg); } }; }(innerFn, self, context), generator; } function tryCatch(fn, obj, arg) { try { return { type: "normal", arg: fn.call(obj, arg) }; } catch (err) { return { type: "throw", arg: err }; } } exports.wrap = wrap; var ContinueSentinel = {}; function Generator() {} function GeneratorFunction() {} function GeneratorFunctionPrototype() {} var IteratorPrototype = {}; define(IteratorPrototype, iteratorSymbol, function () { return this; }); var getProto = Object.getPrototypeOf, NativeIteratorPrototype = getProto && getProto(getProto(values([]))); NativeIteratorPrototype && NativeIteratorPrototype !== Op && hasOwn.call(NativeIteratorPrototype, iteratorSymbol) && (IteratorPrototype = NativeIteratorPrototype); var Gp = GeneratorFunctionPrototype.prototype = Generator.prototype = Object.create(IteratorPrototype); function defineIteratorMethods(prototype) { ["next", "throw", "return"].forEach(function (method) { define(prototype, method, function (arg) { return this._invoke(method, arg); }); }); } function AsyncIterator(generator, PromiseImpl) { function invoke(method, arg, resolve, reject) { var record = tryCatch(generator[method], generator, arg); if ("throw" !== record.type) { var result = record.arg, value = result.value; return value && "object" == _typeof(value) && hasOwn.call(value, "__await") ? PromiseImpl.resolve(value.__await).then(function (value) { invoke("next", value, resolve, reject); }, function (err) { invoke("throw", err, resolve, reject); }) : PromiseImpl.resolve(value).then(function (unwrapped) { result.value = unwrapped, resolve(result); }, function (error) { return invoke("throw", error, resolve, reject); }); } reject(record.arg); } var previousPromise; this._invoke = function (method, arg) { function callInvokeWithMethodAndArg() { return new PromiseImpl(function (resolve, reject) { invoke(method, arg, resolve, reject); }); } return previousPromise = previousPromise ? previousPromise.then(callInvokeWithMethodAndArg, callInvokeWithMethodAndArg) : callInvokeWithMethodAndArg(); }; } function maybeInvokeDelegate(delegate, context) { var method = delegate.iterator[context.method]; if (undefined === method) { if (context.delegate = null, "throw" === context.method) { if (delegate.iterator["return"] && (context.method = "return", context.arg = undefined, maybeInvokeDelegate(delegate, context), "throw" === context.method)) return ContinueSentinel; context.method = "throw", context.arg = new TypeError("The iterator does not provide a 'throw' method"); } return ContinueSentinel; } var record = tryCatch(method, delegate.iterator, context.arg); if ("throw" === record.type) return context.method = "throw", context.arg = record.arg, context.delegate = null, ContinueSentinel; var info = record.arg; return info ? info.done ? (context[delegate.resultName] = info.value, context.next = delegate.nextLoc, "return" !== context.method && (context.method = "next", context.arg = undefined), context.delegate = null, ContinueSentinel) : info : (context.method = "throw", context.arg = new TypeError("iterator result is not an object"), context.delegate = null, ContinueSentinel); } function pushTryEntry(locs) { var entry = { tryLoc: locs[0] }; 1 in locs && (entry.catchLoc = locs[1]), 2 in locs && (entry.finallyLoc = locs[2], entry.afterLoc = locs[3]), this.tryEntries.push(entry); } function resetTryEntry(entry) { var record = entry.completion || {}; record.type = "normal", delete record.arg, entry.completion = record; } function Context(tryLocsList) { this.tryEntries = [{ tryLoc: "root" }], tryLocsList.forEach(pushTryEntry, this), this.reset(!0); } function values(iterable) { if (iterable) { var iteratorMethod = iterable[iteratorSymbol]; if (iteratorMethod) return iteratorMethod.call(iterable); if ("function" == typeof iterable.next) return iterable; if (!isNaN(iterable.length)) { var i = -1, next = function next() { for (; ++i < iterable.length;) { if (hasOwn.call(iterable, i)) return next.value = iterable[i], next.done = !1, next; } return next.value = undefined, next.done = !0, next; }; return next.next = next; } } return { next: doneResult }; } function doneResult() { return { value: undefined, done: !0 }; } return GeneratorFunction.prototype = GeneratorFunctionPrototype, define(Gp, "constructor", GeneratorFunctionPrototype), define(GeneratorFunctionPrototype, "constructor", GeneratorFunction), GeneratorFunction.displayName = define(GeneratorFunctionPrototype, toStringTagSymbol, "GeneratorFunction"), exports.isGeneratorFunction = function (genFun) { var ctor = "function" == typeof genFun && genFun.constructor; return !!ctor && (ctor === GeneratorFunction || "GeneratorFunction" === (ctor.displayName || ctor.name)); }, exports.mark = function (genFun) { return Object.setPrototypeOf ? Object.setPrototypeOf(genFun, GeneratorFunctionPrototype) : (genFun.__proto__ = GeneratorFunctionPrototype, define(genFun, toStringTagSymbol, "GeneratorFunction")), genFun.prototype = Object.create(Gp), genFun; }, exports.awrap = function (arg) { return { __await: arg }; }, defineIteratorMethods(AsyncIterator.prototype), define(AsyncIterator.prototype, asyncIteratorSymbol, function () { return this; }), exports.AsyncIterator = AsyncIterator, exports.async = function (innerFn, outerFn, self, tryLocsList, PromiseImpl) { void 0 === PromiseImpl && (PromiseImpl = Promise); var iter = new AsyncIterator(wrap(innerFn, outerFn, self, tryLocsList), PromiseImpl); return exports.isGeneratorFunction(outerFn) ? iter : iter.next().then(function (result) { return result.done ? result.value : iter.next(); }); }, defineIteratorMethods(Gp), define(Gp, toStringTagSymbol, "Generator"), define(Gp, iteratorSymbol, function () { return this; }), define(Gp, "toString", function () { return "[object Generator]"; }), exports.keys = function (object) { var keys = []; for (var key in object) { keys.push(key); } return keys.reverse(), function next() { for (; keys.length;) { var key = keys.pop(); if (key in object) return next.value = key, next.done = !1, next; } return next.done = !0, next; }; }, exports.values = values, Context.prototype = { constructor: Context, reset: function reset(skipTempReset) { if (this.prev = 0, this.next = 0, this.sent = this._sent = undefined, this.done = !1, this.delegate = null, this.method = "next", this.arg = undefined, this.tryEntries.forEach(resetTryEntry), !skipTempReset) for (var name in this) { "t" === name.charAt(0) && hasOwn.call(this, name) && !isNaN(+name.slice(1)) && (this[name] = undefined); } }, stop: function stop() { this.done = !0; var rootRecord = this.tryEntries[0].completion; if ("throw" === rootRecord.type) throw rootRecord.arg; return this.rval; }, dispatchException: function dispatchException(exception) { if (this.done) throw exception; var context = this; function handle(loc, caught) { return record.type = "throw", record.arg = exception, context.next = loc, caught && (context.method = "next", context.arg = undefined), !!caught; } for (var i = this.tryEntries.length - 1; i >= 0; --i) { var entry = this.tryEntries[i], record = entry.completion; if ("root" === entry.tryLoc) return handle("end"); if (entry.tryLoc <= this.prev) { var hasCatch = hasOwn.call(entry, "catchLoc"), hasFinally = hasOwn.call(entry, "finallyLoc"); if (hasCatch && hasFinally) { if (this.prev < entry.catchLoc) return handle(entry.catchLoc, !0); if (this.prev < entry.finallyLoc) return handle(entry.finallyLoc); } else if (hasCatch) { if (this.prev < entry.catchLoc) return handle(entry.catchLoc, !0); } else { if (!hasFinally) throw new Error("try statement without catch or finally"); if (this.prev < entry.finallyLoc) return handle(entry.finallyLoc); } } } }, abrupt: function abrupt(type, arg) { for (var i = this.tryEntries.length - 1; i >= 0; --i) { var entry = this.tryEntries[i]; if (entry.tryLoc <= this.prev && hasOwn.call(entry, "finallyLoc") && this.prev < entry.finallyLoc) { var finallyEntry = entry; break; } } finallyEntry && ("break" === type || "continue" === type) && finallyEntry.tryLoc <= arg && arg <= finallyEntry.finallyLoc && (finallyEntry = null); var record = finallyEntry ? finallyEntry.completion : {}; return record.type = type, record.arg = arg, finallyEntry ? (this.method = "next", this.next = finallyEntry.finallyLoc, ContinueSentinel) : this.complete(record); }, complete: function complete(record, afterLoc) { if ("throw" === record.type) throw record.arg; return "break" === record.type || "continue" === record.type ? this.next = record.arg : "return" === record.type ? (this.rval = this.arg = record.arg, this.method = "return", this.next = "end") : "normal" === record.type && afterLoc && (this.next = afterLoc), ContinueSentinel; }, finish: function finish(finallyLoc) { for (var i = this.tryEntries.length - 1; i >= 0; --i) { var entry = this.tryEntries[i]; if (entry.finallyLoc === finallyLoc) return this.complete(entry.completion, entry.afterLoc), resetTryEntry(entry), ContinueSentinel; } }, "catch": function _catch(tryLoc) { for (var i = this.tryEntries.length - 1; i >= 0; --i) { var entry = this.tryEntries[i]; if (entry.tryLoc === tryLoc) { var record = entry.completion; if ("throw" === record.type) { var thrown = record.arg; resetTryEntry(entry); } return thrown; } } throw new Error("illegal catch attempt"); }, delegateYield: function delegateYield(iterable, resultName, nextLoc) { return this.delegate = { iterator: values(iterable), resultName: resultName, nextLoc: nextLoc }, "next" === this.method && (this.arg = undefined), ContinueSentinel; } }, exports; }
49
+
50
+ 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); } }
51
+
52
+ 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); }); }; }
53
+
40
54
  function _toConsumableArray(arr) { return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread(); }
41
55
 
42
56
  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."); }
@@ -75,6 +89,9 @@ function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Re
75
89
 
76
90
  function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }
77
91
 
92
+ var openTencentDocFile = window.BSGlobal && window.BSGlobal.TenantAdvancedSetting.TenantFunAdvancedSetting.TencentDocFile && // 默认在钉钉环境下禁用
93
+ !(0, _platform.isDD)(true);
94
+
78
95
  var Upload = /*#__PURE__*/function (_PureComponent) {
79
96
  _inherits(Upload, _PureComponent);
80
97
 
@@ -87,8 +104,13 @@ var Upload = /*#__PURE__*/function (_PureComponent) {
87
104
 
88
105
  _this = _super.call(this, props);
89
106
 
90
- _this.onFileInputChange = function () {
91
- var fileInput = _this.refs.fileInput; // @ts-ignore
107
+ _this.onFileInputChange = function (e) {
108
+ var onChange = _this.props.onChange;
109
+ var fileInput = _this.refs.fileInput;
110
+
111
+ _this.changeDialogUploadTypeVidible();
112
+
113
+ if (onChange) onChange(e); // @ts-ignore
92
114
 
93
115
  var selectFiles = fileInput.files; // 选择的文件
94
116
  // @ts-ignore
@@ -332,7 +354,9 @@ var Upload = /*#__PURE__*/function (_PureComponent) {
332
354
  };
333
355
 
334
356
  _this._dealUploadSuccess = function (uploadSuccessFile) {
335
- var onSubmit = _this.props.onSubmit;
357
+ var _this$props2 = _this.props,
358
+ onSubmit = _this$props2.onSubmit,
359
+ onUploadSuccess = _this$props2.onUploadSuccess;
336
360
 
337
361
  var uploadSuccessFiles = _toConsumableArray(_this.state.uploadSuccessFiles);
338
362
 
@@ -345,6 +369,8 @@ var Upload = /*#__PURE__*/function (_PureComponent) {
345
369
 
346
370
  onSubmit(uploadSuccessFilesPath); // 将上传完成的文件路径传递给父组件
347
371
 
372
+ if (onUploadSuccess) onUploadSuccess(uploadSuccessFilesFormat);
373
+
348
374
  _this.setState({
349
375
  uploadSuccessFiles: uploadSuccessFilesFormat,
350
376
  attachmentPreviewUrl: (0, _util.getPreviewImgs)(uploadSuccessFilesFormat)
@@ -373,9 +399,9 @@ var Upload = /*#__PURE__*/function (_PureComponent) {
373
399
  };
374
400
 
375
401
  _this.handlerUploadPreviewOptions = function (index, options) {
376
- var _this$props2 = _this.props,
377
- onSubmit = _this$props2.onSubmit,
378
- onDelete = _this$props2.onDelete;
402
+ var _this$props3 = _this.props,
403
+ onSubmit = _this$props3.onSubmit,
404
+ onDelete = _this$props3.onDelete;
379
405
 
380
406
  if (options === 'cancel') {
381
407
  var reUploadFileInfo = _this.state.uploadSuccessFiles[index];
@@ -415,9 +441,12 @@ var Upload = /*#__PURE__*/function (_PureComponent) {
415
441
  };
416
442
 
417
443
  _this.renderUploadList = function (list) {
418
- var attachmentPreviewBox = _this.props.attachmentPreviewBox;
444
+ var _this$props4 = _this.props,
445
+ attachmentPreviewBox = _this$props4.attachmentPreviewBox,
446
+ _this$props4$showFile = _this$props4.showFileList,
447
+ showFileList = _this$props4$showFile === void 0 ? true : _this$props4$showFile;
419
448
  var attachmentPreviewUrl = _this.state.attachmentPreviewUrl;
420
- if (!list.length) return;
449
+ if (!list.length || !showFileList) return '';
421
450
  return /*#__PURE__*/_react["default"].createElement(_Portals["default"], {
422
451
  domNode: attachmentPreviewBox,
423
452
  className: "uploadFile__preview__list"
@@ -441,16 +470,134 @@ var Upload = /*#__PURE__*/function (_PureComponent) {
441
470
  _this.handleButtonClick = function (e) {
442
471
  e.nativeEvent.stopImmediatePropagation();
443
472
 
473
+ if (openTencentDocFile) {
474
+ _this.changeDialogUploadTypeVidible();
475
+
476
+ return;
477
+ }
478
+
444
479
  if (_this.refs.fileInput) {
445
480
  // @ts-ignore
446
481
  _this.refs.fileInput.click();
447
482
  }
448
483
  };
449
484
 
485
+ _this.changeDialogQQDocsVidible = function () {
486
+ _this.setState({
487
+ dialogQQDocsVidible: !_this.state.dialogQQDocsVidible
488
+ });
489
+ };
490
+
491
+ _this.changeDialogUploadTypeVidible = function () {
492
+ _this.setState(function (_ref) {
493
+ var dialogUploadTypeVidible = _ref.dialogUploadTypeVidible;
494
+ return {
495
+ dialogUploadTypeVidible: !dialogUploadTypeVidible
496
+ };
497
+ });
498
+ };
499
+
500
+ _this.onSelectLocalFife = function () {
501
+ if (_this.refs.fileInput) {
502
+ // @ts-ignore
503
+ _this.refs.fileInput.click();
504
+ }
505
+ };
506
+
507
+ _this.onShowDialogQQDocs = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee() {
508
+ var data;
509
+ return _regeneratorRuntime().wrap(function _callee$(_context) {
510
+ while (1) {
511
+ switch (_context.prev = _context.next) {
512
+ case 0:
513
+ _context.next = 2;
514
+ return (0, _utils.checkTencentAuth)({});
515
+
516
+ case 2:
517
+ data = _context.sent;
518
+
519
+ if (data) {
520
+ _context.next = 5;
521
+ break;
522
+ }
523
+
524
+ return _context.abrupt("return");
525
+
526
+ case 5:
527
+ // 设置默认的文档数据,避免在弹窗内部再查询一次
528
+ _this.setState({
529
+ defaultQQDocsData: data,
530
+ dialogQQDocsVidible: true
531
+ });
532
+
533
+ case 6:
534
+ case "end":
535
+ return _context.stop();
536
+ }
537
+ }
538
+ }, _callee);
539
+ }));
540
+
541
+ _this.qqDocsFormat = function (qqDocsList) {
542
+ return qqDocsList.map(function (element) {
543
+ var uploadStartFile = {
544
+ FileName: element.title,
545
+ FileType: element.type,
546
+ FileSize: element.size,
547
+ FileLastModified: element.lastModified,
548
+ IsImage: false,
549
+ percentComplete: 0,
550
+ uploadStatus: 3,
551
+ // 开始上传
552
+ IsSuccess: true,
553
+ uid: (0, _uuid["default"])(),
554
+ _smallImageUrl: '',
555
+ _bigImageUrl: '',
556
+ MediaType: '',
557
+ UserId: 0,
558
+ MaxDocCount: 0,
559
+ DfsPath: "".concat(element.url, "|").concat(element.type, "|").concat(element.title, "|tencentdoc"),
560
+ ClientUrl: element.url,
561
+ SmallImageUrl: '',
562
+ BigImageUrl: '',
563
+ DownloadUrl: '',
564
+ Msg: '',
565
+ AllowUploadAttachmentSize: 50,
566
+ Deleteable: true,
567
+ requestXHR: new XMLHttpRequest() // 在这创建是为了取消用
568
+
569
+ };
570
+ return uploadStartFile;
571
+ });
572
+ };
573
+
574
+ _this.onSelectQQDocsFileHandler = function (checkedDocsList) {
575
+ var uploadSuccessFiles = _this.state.uploadSuccessFiles;
576
+ var onSubmit = _this.props.onSubmit;
577
+
578
+ var newFileList = _this.qqDocsFormat(checkedDocsList);
579
+
580
+ var newUploadSuccessFiles = [].concat(_toConsumableArray(uploadSuccessFiles), _toConsumableArray(newFileList));
581
+
582
+ _this.setState({
583
+ uploadSuccessFiles: newUploadSuccessFiles
584
+ });
585
+
586
+ _this.changeDialogUploadTypeVidible();
587
+
588
+ _this.changeDialogQQDocsVidible();
589
+
590
+ onSubmit(newUploadSuccessFiles.map(function (item) {
591
+ return item.DfsPath;
592
+ }));
593
+ };
594
+
450
595
  _this.state = {
451
596
  uploadSuccessFiles: props.attachments || [],
452
597
  attachmentPreviewUrl: props.attachments ? (0, _util.getPreviewImgs)(props.attachments) : [],
453
- selectFiles: {}
598
+ selectFiles: {},
599
+ dialogUploadTypeVidible: false,
600
+ dialogQQDocsVidible: false
454
601
  };
455
602
  return _this;
456
603
  }
@@ -488,21 +635,22 @@ var Upload = /*#__PURE__*/function (_PureComponent) {
488
635
  value: function render() {
489
636
  var _this2 = this;
490
637
 
491
- var _this$props3 = this.props,
492
- children = _this$props3.children,
493
- className = _this$props3.className,
494
- style = _this$props3.style,
495
- _this$props3$attachme = _this$props3.attachmentTipText,
496
- attachmentTipText = _this$props3$attachme === void 0 ? (0, _getLocale.getLocale)('OKR_MyO_KRP_Draganddropu') : _this$props3$attachme;
497
- var uploadSuccessFiles = this.state.uploadSuccessFiles;
498
- return /*#__PURE__*/_react["default"].createElement(_react["default"].Fragment, null, /*#__PURE__*/_react["default"].createElement(_titaUi.Tooltip, {
499
- container: document.body,
500
- content: /*#__PURE__*/_react["default"].createElement("p", {
501
- dangerouslySetInnerHTML: {
502
- __html: attachmentTipText
503
- }
504
- })
505
- }, /*#__PURE__*/_react["default"].createElement(_style.UploadFormContainer, {
638
+ var _this$props5 = this.props,
639
+ children = _this$props5.children,
640
+ className = _this$props5.className,
641
+ style = _this$props5.style,
642
+ _this$props5$attachme = _this$props5.attachmentTipText,
643
+ attachmentTipText = _this$props5$attachme === void 0 ? (0, _getLocale.getLocale)('OKR_MyO_KRP_Draganddropu') : _this$props5$attachme,
644
+ _this$props5$disableT = _this$props5.disableTooltip,
645
+ disableTooltip = _this$props5$disableT === void 0 ? false : _this$props5$disableT,
646
+ fileNumLimit = _this$props5.fileNumLimit;
647
+ var _this$state2 = this.state,
648
+ uploadSuccessFiles = _this$state2.uploadSuccessFiles,
649
+ dialogUploadTypeVidible = _this$state2.dialogUploadTypeVidible,
650
+ dialogQQDocsVidible = _this$state2.dialogQQDocsVidible,
651
+ defaultQQDocsData = _this$state2.defaultQQDocsData;
652
+
653
+ var uploadFormContainer = /*#__PURE__*/_react["default"].createElement(_style.UploadFormContainer, {
506
654
  className: className,
507
655
  style: style,
508
656
  onMouseUp: function onMouseUp(e) {
@@ -522,7 +670,27 @@ var Upload = /*#__PURE__*/function (_PureComponent) {
522
670
  display: 'none'
523
671
  },
524
672
  onChange: this.onFileInputChange
525
- }))), this.renderUploadList(uploadSuccessFiles));
673
+ }));
674
+
675
+ return /*#__PURE__*/_react["default"].createElement(_react["default"].Fragment, null, /*#__PURE__*/_react["default"].createElement(_dialogUploadType["default"], {
676
+ onSelectLocal: this.onSelectLocalFife,
677
+ onSelectQQDocs: this.onShowDialogQQDocs,
678
+ visible: dialogUploadTypeVidible,
679
+ onClose: this.changeDialogUploadTypeVidible
680
+ }), /*#__PURE__*/_react["default"].createElement(_dialogQqDocs["default"], {
681
+ fileNumLimit: fileNumLimit,
682
+ defaultQQDocsData: defaultQQDocsData,
683
+ visible: dialogQQDocsVidible,
684
+ onClose: this.changeDialogQQDocsVidible,
685
+ onSubmit: this.onSelectQQDocsFileHandler
686
+ }), disableTooltip ? uploadFormContainer : /*#__PURE__*/_react["default"].createElement(_titaUi.Tooltip, {
687
+ container: document.body,
688
+ content: /*#__PURE__*/_react["default"].createElement("p", {
689
+ dangerouslySetInnerHTML: {
690
+ __html: attachmentTipText
691
+ }
692
+ })
693
+ }, uploadFormContainer), this.renderUploadList(uploadSuccessFiles));
526
694
  }
527
695
  }]);
528
696