@titaui/pc 1.10.82-beta.2 → 1.10.82-beta.5

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 (22) hide show
  1. package/lib/components/drawer-manager/index.js +25 -27
  2. package/lib/components/dynamic/dynamic-item/dynamic-ai-dialy/index.js +12 -3
  3. package/lib/components/dynamic/online-broadcast/data.js +7 -7
  4. package/lib/components/img-viewer/index.css +6 -0
  5. package/lib/components/img-viewer/index.js +47 -8
  6. package/lib/components/menus/export-modules/demo-menus/menus.js +1 -23
  7. package/lib/components/menus/export-modules/okr-menus/menu-highlight.js +10 -0
  8. package/lib/components/okr-detail/components/okr-tree/tree-node/o-child-node/index.css +4 -3
  9. package/lib/components/okr-progress-modal/index.css +16 -15
  10. package/lib/components/okrcase-library/okrcases-components/caseLibrary-main.js +14 -8
  11. package/lib/components/superset-charts/components/chart/index.js +8 -36
  12. package/lib/components/superset-charts/fetch-assets-and-append/get-assets-with-cache.js +8 -0
  13. package/lib/components/task-relation-modal/index.css +2 -2
  14. package/lib/components/task-relation-modal/tree-node/category-node/index.css +4 -0
  15. package/lib/components/task-relation-modal/tree-node/kr-node/index.css +4 -0
  16. package/lib/components/task-relation-modal/tree-node/milestone-node/index.css +4 -0
  17. package/lib/components/task-relation-modal/tree-node/o-node/index.css +4 -0
  18. package/lib/components/task-relation-modal/tree-node/work-node/index.css +4 -0
  19. package/lib/components/wechat-btn/index.css +4 -0
  20. package/lib/components/wechat-btn/index.js +29 -30
  21. package/lib/pages/new-okr-list/index.js +25 -14
  22. package/package.json +1 -1
@@ -25,45 +25,42 @@ function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { va
25
25
 
26
26
  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; }
27
27
 
28
- function _objectDestructuringEmpty(obj) { if (obj == null) throw new TypeError("Cannot destructure undefined"); }
29
-
30
28
  function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
31
29
 
32
30
  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); } }
33
31
 
34
32
  function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
35
33
 
36
- var typeMap = {};
37
-
38
34
  var DrawerManager = /*#__PURE__*/function () {
39
35
  function DrawerManager() {
40
36
  var _this = this;
41
37
 
42
- var _ref = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
43
-
44
- _objectDestructuringEmpty(_ref);
45
-
46
38
  _classCallCheck(this, DrawerManager);
47
39
 
48
40
  this.history = [];
49
41
  this.uid = 0;
42
+ this.typeMap = {};
50
43
 
51
44
  this.open = function (type) {
52
45
  var props = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
53
46
  var drawerProps = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};
54
- if (!type) throw "need provide drawer type";
55
- var Component = typeMap[type];
56
- if (!Component) throw "the type is not regisited";
57
- window.titaTracker && window.titaTracker("action").record({
58
- actionName: type,
59
- actionGroup: "打开推屏",
60
- productName: "OKR"
61
- });
47
+ if (!type) throw new Error("need provide drawer type");
48
+ var Component = typeof type === "string" ? _this.typeMap[type] : type;
49
+ if (!Component) throw new Error("the type is not regisited");
50
+
51
+ if (window.titaTracker) {
52
+ window.titaTracker("action").record({
53
+ actionName: type,
54
+ actionGroup: "打开推屏",
55
+ productName: "OKR"
56
+ });
57
+ }
58
+
62
59
  return new Promise(function (resolve) {
63
60
  clearTimeout(_this.timer);
64
61
  _this.timer = setTimeout(function () {
65
62
  var uid = _this.uid;
66
- _this.uid++;
63
+ _this.uid += 1;
67
64
  var extendedDrawerProps = drawerProps;
68
65
 
69
66
  if (_this.history.length > 0) {
@@ -82,7 +79,7 @@ var DrawerManager = /*#__PURE__*/function () {
82
79
  key: uid
83
80
  }, props)), extendedDrawerProps);
84
81
 
85
- if (_this.history.length == 1) {
82
+ if (_this.history.length === 1) {
86
83
  document.addEventListener("mousedown", _this.autoClose);
87
84
  }
88
85
  }, 200);
@@ -109,14 +106,16 @@ var DrawerManager = /*#__PURE__*/function () {
109
106
  };
110
107
 
111
108
  this.close = function () {
112
- _this.history.reverse().forEach(function (_ref2) {
113
- var resolve = _ref2.resolve;
109
+ _this.history.reverse().forEach(function (_ref) {
110
+ var resolve = _ref.resolve;
114
111
  return resolve();
115
112
  });
116
113
 
117
114
  _this.history = [];
118
115
 
119
116
  _this.drawer.close();
117
+
118
+ document.removeEventListener("mousedown", _this.autoClose);
120
119
  };
121
120
 
122
121
  this.autoClose = function (e) {
@@ -125,20 +124,19 @@ var DrawerManager = /*#__PURE__*/function () {
125
124
  return;
126
125
  }
127
126
 
128
- if ((0, _dom.hasAncestorElement)(e.target, "document-mouse-event-ignore,rc-tooltip,titaui-popup,rc-dialog-root,common-modal,in-modal,task-hot-add")) return;
127
+ if ((0, _dom.hasAncestorElement)(e.target, "document-mouse-event-ignore,rc-tooltip,titaui-popup,rc-dialog-root,common-modal,in-modal,task-hot-add")) {
128
+ return;
129
+ }
129
130
 
130
131
  _this.close();
132
+ };
131
133
 
132
- document.removeEventListener("mousedown", _this.autoClose);
134
+ this.regist = function (type, component) {
135
+ _this.typeMap[type] = component;
133
136
  };
134
137
  }
135
138
 
136
139
  _createClass(DrawerManager, [{
137
- key: "regist",
138
- value: function regist(type, component) {
139
- typeMap[type] = component;
140
- }
141
- }, {
142
140
  key: "drawer",
143
141
  get: function get() {
144
142
  var _this2 = this;
@@ -13,15 +13,24 @@ var _utils = require("../dynamic-chart/utils");
13
13
 
14
14
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
15
15
 
16
+ function _extends() { _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
17
+
16
18
  var prefixCls = "titaui-dynamic-item";
17
19
 
18
20
  var DynamicAIDialy = function DynamicAIDialy(_ref) {
19
21
  var data = _ref.data;
20
- var chartQuery = (0, _utils.getChartProps)(data.biId);
22
+
23
+ var chartQuery = _react["default"].useMemo(function () {
24
+ return (0, _utils.getChartProps)(data.biId);
25
+ }, [data.biId]);
26
+
21
27
  return /*#__PURE__*/_react["default"].createElement("div", {
22
28
  className: prefixCls
23
- }, /*#__PURE__*/_react["default"].createElement(_supersetCharts["default"], chartQuery));
29
+ }, /*#__PURE__*/_react["default"].createElement(_supersetCharts["default"], _extends({
30
+ feedData: data
31
+ }, chartQuery)));
24
32
  };
25
33
 
26
- var _default = DynamicAIDialy;
34
+ var _default = /*#__PURE__*/_react["default"].memo(DynamicAIDialy);
35
+
27
36
  exports["default"] = _default;
@@ -19,16 +19,16 @@ exports.onlineBroadcastData = exports["default"] = void 0;
19
19
  // }
20
20
  var onlineBroadcastData = [{
21
21
  hasOnline: true,
22
- preContent: "OKR 工作法」体验优化 ",
23
- preHref: "https://wiki.tita.com/x/jIOeAQ",
22
+ preContent: "「考核」OKR 维度支持按 KR 评分啦",
23
+ preHref: "https://wiki.tita.com/x/JYOeAQ",
24
24
  isNew: true,
25
- date: "3/29"
25
+ date: "4/11"
26
26
  }, {
27
27
  hasOnline: true,
28
- preContent: "新增「同步钉钉待办」,工作实时掌握",
29
- preHref: "https://wiki.tita.com/x/DIOeAQ",
30
- isNew: true,
31
- date: "3/18"
28
+ preContent: "「OKR 工作法」体验优化 ",
29
+ preHref: "https://wiki.tita.com/x/jIOeAQ",
30
+ isNew: false,
31
+ date: "3/29"
32
32
  }, {
33
33
  hasOnline: true,
34
34
  preContent: "「考核」支持建立企业指标库",
@@ -80,6 +80,12 @@
80
80
 
81
81
  .titaui-img-viewer__body-img {
82
82
  max-width: 800px;
83
+ position: absolute;
84
+ top: 0;
85
+ left: 0;
86
+ right: 0;
87
+ bottom: 0;
88
+ margin: auto;
83
89
  }
84
90
 
85
91
  .titaui-img-viewer__body-operate-btn {
@@ -85,7 +85,18 @@ var ImgViewer = /*#__PURE__*/(0, _react.forwardRef)(function (_ref, ref) {
85
85
  isLoading = _useState12[0],
86
86
  setIsLoading = _useState12[1];
87
87
 
88
+ var _useState13 = (0, _react.useState)(0),
89
+ _useState14 = _slicedToArray(_useState13, 2),
90
+ moveX = _useState14[0],
91
+ setMoveX = _useState14[1];
92
+
93
+ var _useState15 = (0, _react.useState)(0),
94
+ _useState16 = _slicedToArray(_useState15, 2),
95
+ moveY = _useState16[0],
96
+ setMoveY = _useState16[1];
97
+
88
98
  var imgRef = (0, _react.useRef)(document.createElement("img"));
99
+ var DragRef = (0, _react.useRef)(document.createElement("div"));
89
100
 
90
101
  var showPreview = function showPreview() {
91
102
  var index = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 0;
@@ -120,6 +131,31 @@ var ImgViewer = /*#__PURE__*/(0, _react.forwardRef)(function (_ref, ref) {
120
131
  setCurrentRotateDeg(currentRotateDeg - 90);
121
132
  };
122
133
 
134
+ var handleMouseDownImg = function handleMouseDownImg(e) {
135
+ e.preventDefault();
136
+ var downX = e.clientX;
137
+ var downY = e.clientY; // 因为这个moveX不闭包的话在拖动的时候他就 一直累加
138
+
139
+ var beforeX = moveX;
140
+ var beforeY = moveY;
141
+
142
+ DragRef.current.onmousemove = function (e1) {
143
+ //获取x和y
144
+ var nx = e1.clientX;
145
+ var ny = e1.clientY; // //计算移动后的左偏移量和顶部的偏移量
146
+
147
+ var nl = nx - downX + beforeX;
148
+ var nt = ny - downY + beforeY;
149
+ setMoveX(nl);
150
+ setMoveY(nt);
151
+ };
152
+ };
153
+
154
+ var handleMouseUpImg = function handleMouseUpImg(e) {
155
+ e.preventDefault();
156
+ DragRef.current.onmousemove = null;
157
+ };
158
+
123
159
  var handleRightRotate = function handleRightRotate() {
124
160
  setCurrentRotateDeg(currentRotateDeg + 90);
125
161
  };
@@ -170,7 +206,10 @@ var ImgViewer = /*#__PURE__*/(0, _react.forwardRef)(function (_ref, ref) {
170
206
  className: (0, _classnames["default"])("tu-icon-close", "".concat(prefix, "__header-close")),
171
207
  onClick: hidePreview
172
208
  }))), /*#__PURE__*/_react["default"].createElement("div", {
173
- className: "".concat(prefix, "__body")
209
+ className: "".concat(prefix, "__body"),
210
+ ref: DragRef,
211
+ onMouseDown: handleMouseDownImg,
212
+ onMouseUp: handleMouseUpImg
174
213
  }, /*#__PURE__*/_react["default"].createElement("span", {
175
214
  className: (0, _classnames["default"])("".concat(prefix, "__body-operate-btn"), "".concat(prefix, "__body-operate-btn--left"), _defineProperty({}, "".concat(prefix, "__body-operate-btn--disable"), currentIndex === 0)),
176
215
  onClick: handlePreImgClick
@@ -184,17 +223,17 @@ var ImgViewer = /*#__PURE__*/(0, _react.forwardRef)(function (_ref, ref) {
184
223
  })), isLoading && /*#__PURE__*/_react["default"].createElement("div", {
185
224
  className: "".concat(prefix, "__body--loading")
186
225
  }, /*#__PURE__*/_react["default"].createElement("img", {
187
- src: _loading["default"]
188
- })), /*#__PURE__*/_react["default"].createElement("div", {
189
- style: {
190
- transform: "rotate(".concat(currentRotateDeg, "deg)")
191
- }
192
- }, /*#__PURE__*/_react["default"].createElement("img", {
226
+ src: _loading["default"],
227
+ alt: ""
228
+ })), /*#__PURE__*/_react["default"].createElement("div", null, /*#__PURE__*/_react["default"].createElement("img", {
193
229
  className: "".concat(prefix, "__body-img"),
194
230
  ref: imgRef,
231
+ alt: "",
195
232
  src: (currentImgData === null || currentImgData === void 0 ? void 0 : currentImgData.previewUrl) || (currentImgData === null || currentImgData === void 0 ? void 0 : currentImgData.bigImageUrl),
196
233
  style: {
197
- transform: "scale(".concat(currentScale, ")")
234
+ transform: "scale(".concat(currentScale, ") rotate(").concat(currentRotateDeg, "deg) "),
235
+ left: "".concat(moveX, "px"),
236
+ top: "".concat(moveY, "px")
198
237
  }
199
238
  }))), /*#__PURE__*/_react["default"].createElement("div", {
200
239
  className: "".concat(prefix, "__footer")
@@ -109,29 +109,7 @@ var DemoMenuData = /*#__PURE__*/function () {
109
109
  key: PAGE_DUEDATE_ORDER,
110
110
  href: "#/demofree/recharge/order",
111
111
  isShow: this.isManager === EManagerType.ReCharge || this.isManager === EManagerType.Manager
112
- } // {
113
- // icon: "",
114
- // label: "续费状态",
115
- // key: PAGE_RECHARGE_STATUS,
116
- // href: "#/demofree/recharge/status",
117
- // isShow: this.isManager === EManagerType.ReCharge || this.isManager === EManagerType.Manager,
118
- // },
119
- // {
120
- // icon: "",
121
- // label: "数据统计",
122
- // key: PAGE_RECHARGE_STATISTICS,
123
- // href: "#/demofree/recharge/statistics",
124
- // isShow: this.isManager === EManagerType.ReCharge || this.isManager === EManagerType.Manager,
125
- // },
126
- ]
127
- }, {
128
- icon: "KH-help",
129
- label: "预约演示报表",
130
- key: "charts",
131
- href: "#/demofree/charts",
132
- isShow: this.isManager === EManagerType.Manager,
133
- children: [],
134
- type: _index.MENU_ITEM_NOE
112
+ }]
135
113
  }];
136
114
  }
137
115
 
@@ -31,6 +31,8 @@ var _default = /*#__PURE__*/function () {
31
31
  cb(_menus.PAGE_MY_PART_OKR);
32
32
  } else if (this.isMyTargetOkr()) {
33
33
  cb(_menus.PAGE_MY_TARGET_OKR);
34
+ } else if (this.isTargetUser()) {
35
+ return null;
34
36
  } else {
35
37
  cb(_menus.PAGE_MY_OWNER_OKR);
36
38
  }
@@ -43,6 +45,8 @@ var _default = /*#__PURE__*/function () {
43
45
  } else if (this.isOkrCases()) {
44
46
  cb(_menus.PAGE_OKR_CASES);
45
47
  }
48
+
49
+ return null;
46
50
  }
47
51
  }, {
48
52
  key: "isMyOkr",
@@ -62,6 +66,12 @@ var _default = /*#__PURE__*/function () {
62
66
  var search = this.history.location.search;
63
67
  return !!search.match(/relation[\s]*?=[\s]*?3/);
64
68
  }
69
+ }, {
70
+ key: "isTargetUser",
71
+ value: function isTargetUser() {
72
+ var search = this.history.location.search;
73
+ return !!search.match(/toUserId[\s]*?=[\d]+/);
74
+ }
65
75
  }, {
66
76
  key: "isOkr",
67
77
  value: function isOkr() {
@@ -54,7 +54,7 @@
54
54
  }
55
55
 
56
56
  .tita-okrdt-tree__o-child-node-prefix::before {
57
- content: "";
57
+ content: '';
58
58
  width: 9px;
59
59
  height: 12px;
60
60
  background: url(../../images/O.svg) transparent no-repeat 50% 50%;
@@ -73,11 +73,12 @@
73
73
 
74
74
  .child-okrs-weight__content {
75
75
  padding: 10px 32px 8px;
76
+ max-height: 300px;
76
77
  min-height: 90px;
78
+ overflow: auto;
77
79
  box-sizing: border-box;
78
80
  display: flex;
79
81
  flex-direction: column;
80
- justify-content: center;
81
82
  }
82
83
 
83
84
  .child-okrs-weight__item {
@@ -105,7 +106,7 @@
105
106
  }
106
107
 
107
108
  .child-okrs-weight__item-precls:before {
108
- content: "";
109
+ content: '';
109
110
  width: 10px;
110
111
  height: 8px;
111
112
  border-radius: 50%;
@@ -17,7 +17,7 @@
17
17
 
18
18
  .auto-update__item-progress-input {
19
19
  padding-right: 20px;
20
- color: #3F4755 !important;
20
+ color: #3f4755 !important;
21
21
  }
22
22
 
23
23
  .auto-update__item-progress-input--error {
@@ -26,16 +26,17 @@
26
26
  }
27
27
 
28
28
  .auto-update__item-progress-input--disabled {
29
- border-color: #E9ECF0 !important;
30
- background: #f7f8fa !important;
29
+ border-color: #e9ecf0 !important;
30
+ background-color: #f7f8fa !important;
31
31
  }
32
32
 
33
33
  .auto-update__item-progress-input--disabled:hover {
34
- border-color: #E9ECF0;
34
+ border-color: #e9ecf0;
35
35
  }
36
36
 
37
37
  .auto-update__item-progress-input--disabled input {
38
- color: #A4ACB9 !important;
38
+ color: #bfc7d5 !important;
39
+ background-color: #f7f8fa !important;
39
40
  }
40
41
 
41
42
  .auto-update__item-progress-input__suffix {
@@ -49,7 +50,7 @@
49
50
  }
50
51
 
51
52
  .auto-update__item-progress-input__suffix--disabled {
52
- color: #BFC7D5;
53
+ color: #bfc7d5;
53
54
  background: #f7f8fa;
54
55
  }
55
56
 
@@ -58,7 +59,7 @@
58
59
  height: 22px;
59
60
  margin-left: 10px;
60
61
  line-height: 22px;
61
- color: #F6BD16;
62
+ color: #f6bd16;
62
63
  font-size: 13px;
63
64
  }
64
65
 
@@ -75,7 +76,7 @@
75
76
  .auto-update__recommand-tip {
76
77
  font-family: PingFangSC-Regular, PingFang SC;
77
78
  font-size: 13px;
78
- color: #A4ACB9;
79
+ color: #a4acb9;
79
80
  margin-left: 10px;
80
81
  }
81
82
 
@@ -96,7 +97,7 @@
96
97
  width: 4px;
97
98
  height: 15px;
98
99
  border-radius: 2px;
99
- background: linear-gradient(90deg, #4E90FF 0%, #2879FF 100%);
100
+ background: linear-gradient(90deg, #4e90ff 0%, #2879ff 100%);
100
101
  position: absolute;
101
102
  left: 0;
102
103
  top: 6px;
@@ -109,7 +110,7 @@
109
110
  .auto-update-setting__option {
110
111
  line-height: 22px;
111
112
  cursor: pointer;
112
- color: #3F4755;
113
+ color: #3f4755;
113
114
  }
114
115
 
115
116
  .auto-update-setting__option div {
@@ -125,7 +126,7 @@
125
126
  width: 14px;
126
127
  height: 14px;
127
128
  border-radius: 50%;
128
- border: 1px solid #E9ECF0;
129
+ border: 1px solid #e9ecf0;
129
130
  margin-right: 4px;
130
131
  vertical-align: text-top;
131
132
  line-height: 14px;
@@ -133,11 +134,11 @@
133
134
  }
134
135
 
135
136
  .auto-update-setting__radio:hover {
136
- border-color: #2879FF;
137
+ border-color: #2879ff;
137
138
  }
138
139
 
139
140
  .auto-update-setting__radio--selected {
140
- border-color: #2879FF;
141
+ border-color: #2879ff;
141
142
  }
142
143
 
143
144
  .auto-update-setting__radio--selected:before {
@@ -146,7 +147,7 @@
146
147
  width: 10px;
147
148
  height: 10px;
148
149
  border-radius: 50%;
149
- background: #2879FF;
150
+ background: #2879ff;
150
151
  }
151
152
 
152
153
  .auto-update-setting__tips {
@@ -159,7 +160,7 @@
159
160
  position: absolute;
160
161
  right: 0;
161
162
  bottom: 0;
162
- color: #2879FF;
163
+ color: #2879ff;
163
164
  font-family: PingFangSC-Regular, PingFang SC;
164
165
  cursor: pointer;
165
166
  }
@@ -13,27 +13,29 @@ var _essayComponent = _interopRequireDefault(require("../../grid-layout/essay-co
13
13
 
14
14
  var _helpers = require("../../../utils/helpers");
15
15
 
16
- var _getLocale = require("../../../utils/getLocale");
16
+ var _openData = require("../../../utils/open-data");
17
17
 
18
18
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
19
19
 
20
+ var pencil = require("../image/\u7B14.svg");
21
+
20
22
  function CaseLibraryMain(props) {
21
23
  var onApplyTpl = props.onApplyTpl,
22
24
  cardList = props.cardList,
23
25
  isUnlock = props.isUnlock,
24
- okrCasesNum = props.okrCasesNum,
25
26
  handleShowSubmitOkrWindow = props.handleShowSubmitOkrWindow,
26
27
  handleShowPayWindow = props.handleShowPayWindow,
27
28
  isfix = props.isfix,
28
29
  isLoading = props.isLoading,
29
30
  activeNavId = props.activeNavId,
30
- onClose = props.onClose,
31
31
  asideHeightRef = props.asideHeightRef,
32
32
  fixAsideTopScroll = props.fixAsideTopScroll; // @ts-ignore
33
33
 
34
- var DeadLine = BSGlobal.tenantAuthentication.DeadLine; // @ts-ignore
34
+ var DeadLine = window.BSGlobal.tenantAuthentication.DeadLine; // @ts-ignore
35
35
 
36
- var Name = BSGlobal.loginUserInfo.Name;
36
+ var _window$BSGlobal$logi = window.BSGlobal.loginUserInfo,
37
+ Name = _window$BSGlobal$logi.Name,
38
+ Id = _window$BSGlobal$logi.Id;
37
39
  return /*#__PURE__*/_react["default"].createElement("div", {
38
40
  className: "okr-cases-library__mainContainer"
39
41
  }, /*#__PURE__*/_react["default"].createElement(_caseLibraryCardList["default"], {
@@ -60,18 +62,22 @@ function CaseLibraryMain(props) {
60
62
  return handleShowSubmitOkrWindow(true);
61
63
  }
62
64
  }, /*#__PURE__*/_react["default"].createElement("img", {
63
- src: require("../image/\u7B14.svg")
65
+ src: pencil,
66
+ alt: "pencil"
64
67
  }), "\u63D0\u4EA4\u6211\u60F3\u8981\u7684OKR\u7C7B\u578B"), /*#__PURE__*/_react["default"].createElement("div", {
65
68
  className: "okr-cases-library__aside__submitWant__libraryNum"
66
69
  }, "\u5168\u56FD\u6700\u5927 OKR \u6848\u4F8B\u5E93", /*#__PURE__*/_react["default"].createElement("span", {
67
70
  style: {
68
71
  color: "#F05E5E"
69
72
  }
70
- }, " ", okrCasesNum), " ", (0, _getLocale.getLocale)("OKR_MyO_E_Mumber"))), isUnlock ? /*#__PURE__*/_react["default"].createElement("div", {
73
+ }, " 1000+"), " ")), isUnlock ? /*#__PURE__*/_react["default"].createElement("div", {
71
74
  className: "okr-cases-library__aside__memberInfo"
72
75
  }, /*#__PURE__*/_react["default"].createElement("div", {
73
76
  className: "okr-cases-library__aside__memberInfo__name"
74
- }, Name, "\u7684", /*#__PURE__*/_react["default"].createElement("b", null, " VIP "), "\u4F1A\u5458"), /*#__PURE__*/_react["default"].createElement("p", {
77
+ }, /*#__PURE__*/_react["default"].createElement(_openData.OpenUserName, {
78
+ name: Name,
79
+ id: Id
80
+ }), "\u7684", /*#__PURE__*/_react["default"].createElement("b", null, " VIP "), "\u4F1A\u5458"), /*#__PURE__*/_react["default"].createElement("p", {
75
81
  className: "okr-cases-library__aside__memberInfo__deadLine"
76
82
  }, "\u6709\u6548\u65E5\u671F\u81F3\uFF1A", DeadLine)) : /*#__PURE__*/_react["default"].createElement("div", {
77
83
  className: "okr-cases-library__aside__advertise",
@@ -1,53 +1,25 @@
1
1
  "use strict";
2
2
 
3
- function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); }
4
-
5
3
  Object.defineProperty(exports, "__esModule", {
6
4
  value: true
7
5
  });
8
6
  exports["default"] = void 0;
9
7
 
10
- var _react = _interopRequireWildcard(require("react"));
11
-
12
- var _fetchAssetsAndAppend = _interopRequireDefault(require("../../fetch-assets-and-append"));
8
+ var _react = _interopRequireDefault(require("react"));
13
9
 
14
10
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
15
11
 
16
- 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); }
17
-
18
- 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; }
19
-
20
- function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
21
-
22
- 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."); }
23
-
24
- 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); }
25
-
26
- 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; }
27
-
28
- 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; }
29
-
30
- function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
31
-
32
- var singletonFetchAssetsAndAppend = (0, _fetchAssetsAndAppend["default"])();
33
-
12
+ // const singletonFetchAssetsAndAppend = SingletonFetchAssetsAndAppend();
34
13
  var Chart = function Chart(props) {
35
14
  var _window, _window$SupersetChart;
36
15
 
37
- var _useState = (0, _react.useState)(false),
38
- _useState2 = _slicedToArray(_useState, 2),
39
- isInit = _useState2[0],
40
- setIsInit = _useState2[1];
41
-
42
- (0, _react.useEffect)(function () {
43
- var _singletonFetchAssets;
44
-
45
- (_singletonFetchAssets = singletonFetchAssetsAndAppend()) === null || _singletonFetchAssets === void 0 ? void 0 : _singletonFetchAssets.then(function () {
46
- setIsInit(true);
47
- });
48
- }, []);
16
+ // useEffect(() => {
17
+ // singletonFetchAssetsAndAppend()?.then(() => {
18
+ // setIsInit(true);
19
+ // });
20
+ // }, []);
49
21
  var Chart = (_window = window) === null || _window === void 0 ? void 0 : (_window$SupersetChart = _window.SupersetChart) === null || _window$SupersetChart === void 0 ? void 0 : _window$SupersetChart.SupersetChart;
50
- return /*#__PURE__*/_react["default"].createElement("div", null, Chart && isInit && /*#__PURE__*/_react["default"].createElement(Chart, props));
22
+ return /*#__PURE__*/_react["default"].createElement("div", null, Chart && /*#__PURE__*/_react["default"].createElement(Chart, props));
51
23
  };
52
24
 
53
25
  var _default = Chart;
@@ -47,6 +47,10 @@ var fetchAssetsVersion = function fetchAssetsVersion() {
47
47
  },
48
48
  objectName: "superset_assets_version"
49
49
  }).then(function (res) {
50
+ if (!res.data) {
51
+ return [];
52
+ }
53
+
50
54
  return transMetasToTableData(res.data.list);
51
55
  });
52
56
  };
@@ -70,6 +74,10 @@ var fetchAssetsUri = function fetchAssetsUri(version) {
70
74
  },
71
75
  objectName: "superset_assets"
72
76
  }).then(function (res) {
77
+ if (!res.data) {
78
+ return [];
79
+ }
80
+
73
81
  sessionStorage.setItem("".concat(storageKey, "version"), JSON.stringify(transMetasToTableData(res.data.list)));
74
82
  return transMetasToTableData(res.data.list);
75
83
  });
@@ -59,7 +59,7 @@
59
59
  width: 16px;
60
60
  height: 16px;
61
61
  border-radius: 8px;
62
- border: 1px solid #e9ecf0;
62
+ border: 1px solid #bfc7d5;
63
63
  cursor: pointer;
64
64
  }
65
65
 
@@ -69,7 +69,7 @@
69
69
  }
70
70
 
71
71
  .titaui-task-relation__radio--checked:before {
72
- content: "";
72
+ content: '';
73
73
  position: absolute;
74
74
  left: 50%;
75
75
  top: 50%;
@@ -40,3 +40,7 @@
40
40
  .rel-category-tree .rc-tree-treenode {
41
41
  overflow: unset !important;
42
42
  }
43
+
44
+ .rel-category-tree .titaui-checkbox {
45
+ border: 1px solid #bfc7d5;
46
+ }
@@ -13,6 +13,10 @@
13
13
  top: 4px;
14
14
  }
15
15
 
16
+ .rel-kr-node__checkbox .titaui-checkbox {
17
+ border: 1px solid #bfc7d5;
18
+ }
19
+
16
20
  .rel-kr-node__pointer {
17
21
  position: absolute;
18
22
  top: -26px;
@@ -13,6 +13,10 @@
13
13
  top: 4px;
14
14
  }
15
15
 
16
+ .rel-milestone-node__checkbox .titaui-checkbox {
17
+ border: 1px solid #bfc7d5;
18
+ }
19
+
16
20
  .rel-milestone-node__pointer {
17
21
  position: absolute;
18
22
  top: -26px;
@@ -12,6 +12,10 @@
12
12
  top: 4px;
13
13
  }
14
14
 
15
+ .rel-okr-node__checkbox .titaui-checkbox {
16
+ border: 1px solid #bfc7d5;
17
+ }
18
+
15
19
  .rel-okr-node__name {
16
20
  flex: 1;
17
21
  cursor: pointer;
@@ -11,6 +11,10 @@
11
11
  top: 4px;
12
12
  }
13
13
 
14
+ .rel-work-node__checkbox .titaui-checkbox {
15
+ border: 1px solid #bfc7d5;
16
+ }
17
+
14
18
  .rel-work-node__name {
15
19
  flex: 1;
16
20
  cursor: pointer;
@@ -8,3 +8,7 @@
8
8
  .titaui-wechat-btn:hover {
9
9
  color: #2879ff;
10
10
  }
11
+
12
+ .titaui-wechat-btn__chat {
13
+ color: #2879ff;
14
+ }
@@ -27,6 +27,8 @@ function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "functio
27
27
 
28
28
  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; }
29
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
+
30
32
  function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
31
33
 
32
34
  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."); }
@@ -81,6 +83,16 @@ var WeChatBtn = function WeChatBtn(props) {
81
83
  tooltip = _useState14[0],
82
84
  setTooltip = _useState14[1];
83
85
 
86
+ var _useState15 = (0, _react.useState)("目标"),
87
+ _useState16 = _slicedToArray(_useState15, 2),
88
+ apply = _useState16[0],
89
+ setApply = _useState16[1];
90
+
91
+ var _useState17 = (0, _react.useState)(false),
92
+ _useState18 = _slicedToArray(_useState17, 2),
93
+ isHasGroup = _useState18[0],
94
+ setIsHasGroup = _useState18[1];
95
+
84
96
  var isWx = navigator.userAgent.match(/wxwork/);
85
97
 
86
98
  var handleClickWechatBtn = function handleClickWechatBtn() {
@@ -88,31 +100,18 @@ var WeChatBtn = function WeChatBtn(props) {
88
100
  //有群了,判断没在群就先进群再打开群
89
101
  if (chatId !== null && chatId !== 'chatId') {
90
102
  wx.invoke('openExistedChatWithMsg', {
91
- chatId: chatId,
92
- msg: {
93
- msgtype: 'link',
94
- link: {
95
- title: name,
96
- desc: 'desc1',
97
- url: 'link1',
98
- imgUrl: 'imgurl1'
99
- }
100
- }
103
+ chatId: chatId
101
104
  }, function (res) {
102
105
  if (res.err_msg === 'openExistedChatWithMsg:fail_fail_Invalid_chatId') {
103
106
  wx.invoke('updateEnterpriseChat', {
104
107
  chatId: chatId,
105
108
  userIdsToAdd: loginUserOpenId
106
- }, function (res) {
107
- if (res.err_msg === 'updateEnterpriseChat:ok') {}
108
109
  });
109
110
  }
110
111
  });
111
112
  } else {
112
113
  setCreateWechatVisible(true);
113
114
  }
114
- } else {
115
- return;
116
115
  }
117
116
  };
118
117
 
@@ -124,7 +123,7 @@ var WeChatBtn = function WeChatBtn(props) {
124
123
  var handleCreateGroupChat = function handleCreateGroupChat() {
125
124
  wx.invoke('createChatWithMsg', {
126
125
  selectedOpenUserIds: weChatGroupMember,
127
- chatName: name,
126
+ chatName: "\u300C".concat(apply, "\u7FA4\u300D").concat(name),
128
127
  msg: {
129
128
  msgtype: 'link',
130
129
  link: {
@@ -135,7 +134,7 @@ var WeChatBtn = function WeChatBtn(props) {
135
134
  }
136
135
  }
137
136
  }, function (res) {
138
- if (res.err_msg == 'createChatWithMsg:ok') {
137
+ if (res.err_msg === 'createChatWithMsg:ok') {
139
138
  if (res.chatId) {
140
139
  (0, _request.rpost)('v1')('chat/add', {
141
140
  objId: id,
@@ -143,18 +142,7 @@ var WeChatBtn = function WeChatBtn(props) {
143
142
  chatId: res.chatId
144
143
  });
145
144
  wx.invoke('openExistedChatWithMsg', {
146
- chatId: res.chatId,
147
- msg: {
148
- msgtype: 'link',
149
- link: {
150
- title: name,
151
- desc: 'desc1',
152
- url: url,
153
- imgUrl: 'imgurl1'
154
- }
155
- }
156
- }, function (res) {
157
- if (res.err_msg === 'openExistedChatWithMsg:ok') {}
145
+ chatId: res.chatId
158
146
  });
159
147
  }
160
148
  }
@@ -174,6 +162,10 @@ var WeChatBtn = function WeChatBtn(props) {
174
162
  } else {
175
163
  setIsShowWeChat(true);
176
164
 
165
+ if (res.Data.obj) {
166
+ setIsHasGroup(true);
167
+ }
168
+
177
169
  if (isWx) {
178
170
  setChatId(res.Data.obj);
179
171
  (0, _request.rpost)('v1')('chat/users', {
@@ -205,11 +197,18 @@ var WeChatBtn = function WeChatBtn(props) {
205
197
  setTooltip('浏览器不支持此功能,请到企业微信工作台中使用');
206
198
  }
207
199
  }, [chatId, isShowWeChat]);
200
+ (0, _react.useEffect)(function () {
201
+ if (objType === 62) {
202
+ setApply("目标");
203
+ } else {
204
+ setApply("任务");
205
+ }
206
+ }, []);
208
207
  return /*#__PURE__*/_react["default"].createElement(_react["default"].Fragment, null, /*#__PURE__*/_react["default"].createElement(_tooltip["default"], {
209
208
  overlay: tooltip,
210
209
  placement: "bottom"
211
210
  }, /*#__PURE__*/_react["default"].createElement("div", {
212
- className: (0, _classnames["default"])(preCls, 'tu-icon-qw-chat'),
211
+ className: (0, _classnames["default"])(preCls, 'tu-icon-qw-chat', _defineProperty({}, "".concat(preCls, "__chat"), isHasGroup)),
213
212
  onMouseDown: handleClickWechatBtn
214
213
  })), /*#__PURE__*/_react["default"].createElement(_dialogConfirm["default"], {
215
214
  zIndex: 1200,
@@ -219,7 +218,7 @@ var WeChatBtn = function WeChatBtn(props) {
219
218
  type: "title"
220
219
  }, "\u786E\u5B9A\u53D1\u8D77\u7FA4\u804A\u5417"), /*#__PURE__*/_react["default"].createElement("span", {
221
220
  type: "content"
222
- }, '可选择任务相关人员快速建群沟通。注意,至少选择 3 人,才能正常发起群聊。'), /*#__PURE__*/_react["default"].createElement(_dialogConfirm.CancelButton, {
221
+ }, "\u53EF\u9009\u62E9".concat(apply, "\u76F8\u5173\u4EBA\u5458\u5FEB\u901F\u5EFA\u7FA4\u6C9F\u901A\u3002\u6CE8\u610F\uFF0C\u81F3\u5C11\u9009\u62E9 3 \u4EBA\uFF0C\u624D\u80FD\u6B63\u5E38\u53D1\u8D77\u7FA4\u804A\u3002")), /*#__PURE__*/_react["default"].createElement(_dialogConfirm.CancelButton, {
223
222
  type: "button",
224
223
  onClick: closeCreateWeChatModal
225
224
  }, "\u53D6\u6D88"), /*#__PURE__*/_react["default"].createElement(_dialogConfirm.SureButton, {
@@ -156,12 +156,18 @@ var NewOkrList = function NewOkrList(props) {
156
156
  setQuery = _useState12[1];
157
157
 
158
158
  var okrsRef = (0, _react.useRef)(okrs);
159
- var headerRef = (0, _react.useRef)();
160
159
 
161
160
  var _useState13 = (0, _react.useState)(false),
162
161
  _useState14 = _slicedToArray(_useState13, 2),
163
- casesVisible = _useState14[0],
164
- setCasesVisible = _useState14[1];
162
+ isInit = _useState14[0],
163
+ setIsInit = _useState14[1];
164
+
165
+ var headerRef = (0, _react.useRef)();
166
+
167
+ var _useState15 = (0, _react.useState)(false),
168
+ _useState16 = _slicedToArray(_useState15, 2),
169
+ casesVisible = _useState16[0],
170
+ setCasesVisible = _useState16[1];
165
171
 
166
172
  var routerData = (0, _tools.getQueryString)();
167
173
  var departmentName = routerData.departmentName,
@@ -179,11 +185,22 @@ var NewOkrList = function NewOkrList(props) {
179
185
  (0, _react.useEffect)(function () {
180
186
  setPageNum(1);
181
187
  }, [relation, toUserId, departmentId, query]);
188
+
189
+ var handleOnSearch = function handleOnSearch(params) {
190
+ setQuery(_objectSpread(_objectSpread({}, query), params));
191
+ setPageNum(1);
192
+ };
193
+
182
194
  (0, _react.useEffect)(function () {
183
- handleOnSearch({
184
- keyWords: ""
185
- });
186
- }, [relation, toUserId, departmentId]); // 记录访问者数据
195
+ if (isInit) {
196
+ handleOnSearch({
197
+ keyWords: ""
198
+ });
199
+ }
200
+ }, [relation, toUserId, departmentId]);
201
+ (0, _react.useEffect)(function () {
202
+ setIsInit(true);
203
+ }, []); // 记录访问者数据
187
204
 
188
205
  var recordVisitUser = function recordVisitUser() {
189
206
  if (toUserId) {
@@ -232,12 +249,6 @@ var NewOkrList = function NewOkrList(props) {
232
249
  setPageSize(nowPageSize);
233
250
  };
234
251
 
235
- var handleOnSearch = function handleOnSearch(params) {
236
- setQuery(_objectSpread(_objectSpread(_objectSpread({}, query), params), {}, {
237
- pageNum: 1
238
- }));
239
- };
240
-
241
252
  var onFrontAddOKR = function onFrontAddOKR(data) {
242
253
  setOkrs([data].concat(_toConsumableArray(okrsRef.current || [])));
243
254
  };
@@ -301,7 +312,7 @@ var NewOkrList = function NewOkrList(props) {
301
312
 
302
313
  (0, _react.useEffect)(function () {
303
314
  getOkrs();
304
- }, [pageNum, pageSize, query, relation, toUserId, departmentId]);
315
+ }, [pageNum, pageSize, query]);
305
316
  return /*#__PURE__*/_react["default"].createElement(_context.Context.Provider, {
306
317
  value: _objectSpread({
307
318
  OkrCommunicationPush: OkrCommunicationPush,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@titaui/pc",
3
- "version": "1.10.82-beta.2",
3
+ "version": "1.10.82-beta.5",
4
4
  "nameCN": "",
5
5
  "description": "",
6
6
  "main": "lib/index.js",