@titaui/pc 1.10.81 → 1.10.82-beta.13
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.
- package/.husky/pre-commit +1 -1
- package/lib/components/drawer/index.js +3 -2
- package/lib/components/drawer-manager/index.js +25 -27
- package/lib/components/dynamic/dynamic-item/dynamic-ai-dialy/index.js +12 -3
- package/lib/components/dynamic/online-broadcast/data.js +7 -7
- package/lib/components/img-viewer/index.css +6 -0
- package/lib/components/img-viewer/index.js +47 -8
- package/lib/components/menus/export-modules/demo-menus/menus.js +1 -23
- package/lib/components/menus/export-modules/okr-menus/menu-highlight.js +10 -0
- package/lib/components/okr-detail/components/okr-tree/tree-node/o-child-node/index.css +4 -3
- package/lib/components/okr-detail/detail-header/actions.js +40 -44
- package/lib/components/okr-detail/detail-header/index.css +2 -2
- package/lib/components/okr-detail/detail-header/index.js +205 -194
- package/lib/components/okr-detail/index.js +2 -0
- package/lib/components/okr-progress-modal/index.css +16 -15
- package/lib/components/okrcase-library/okrcases-components/caseLibrary-main.js +14 -8
- package/lib/components/superset-charts/components/chart/index.js +8 -36
- package/lib/components/superset-charts/fetch-assets-and-append/get-assets-with-cache.js +8 -0
- package/lib/components/task-relation-modal/index.css +2 -2
- package/lib/components/task-relation-modal/tree-node/category-node/index.css +4 -0
- package/lib/components/task-relation-modal/tree-node/kr-node/index.css +4 -0
- package/lib/components/task-relation-modal/tree-node/milestone-node/index.css +4 -0
- package/lib/components/task-relation-modal/tree-node/o-node/index.css +4 -0
- package/lib/components/task-relation-modal/tree-node/work-node/index.css +4 -0
- package/lib/components/wechat-btn/index.css +14 -0
- package/lib/components/wechat-btn/index.js +322 -0
- package/lib/index.js +8 -0
- package/lib/pages/new-okr-list/index.js +25 -14
- package/package.json +1 -1
package/.husky/pre-commit
CHANGED
|
@@ -122,7 +122,8 @@ function DrawerHeader(_ref) {
|
|
|
122
122
|
actionMaxCount = _ref$actionMaxCount === void 0 ? 4 : _ref$actionMaxCount,
|
|
123
123
|
content = _ref.content,
|
|
124
124
|
style = _ref.style,
|
|
125
|
-
onClose = _ref.onClose
|
|
125
|
+
onClose = _ref.onClose,
|
|
126
|
+
actionComponent = _ref.actionComponent;
|
|
126
127
|
var drawer = (0, _react.useContext)(DrawerContext);
|
|
127
128
|
var manager = (0, _react.useContext)(_context["default"]);
|
|
128
129
|
var showClose = closable && (!!onClose || !!drawer);
|
|
@@ -151,7 +152,7 @@ function DrawerHeader(_ref) {
|
|
|
151
152
|
style: {
|
|
152
153
|
flex: 1
|
|
153
154
|
}
|
|
154
|
-
}), displayActions.map(function (action) {
|
|
155
|
+
}), /*#__PURE__*/_react["default"].createElement("div", null, actionComponent), displayActions.map(function (action) {
|
|
155
156
|
return /*#__PURE__*/_react["default"].createElement(_headerAction["default"], action);
|
|
156
157
|
}), !!collapsedActions.length && /*#__PURE__*/_react["default"].createElement(_headerAction["default"], {
|
|
157
158
|
title: (0, _getLocale.getLocale)("Mod_MoreOperate"),
|
|
@@ -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
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
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
|
|
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 (
|
|
113
|
-
var 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"))
|
|
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
|
-
|
|
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
|
-
|
|
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"],
|
|
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: "
|
|
23
|
-
preHref: "https://wiki.tita.com/x/
|
|
22
|
+
preContent: "「考核」OKR 维度支持按 KR 评分啦",
|
|
23
|
+
preHref: "https://wiki.tita.com/x/JYOeAQ",
|
|
24
24
|
isNew: true,
|
|
25
|
-
date: "
|
|
25
|
+
date: "4/11"
|
|
26
26
|
}, {
|
|
27
27
|
hasOnline: true,
|
|
28
|
-
preContent: "
|
|
29
|
-
preHref: "https://wiki.tita.com/x/
|
|
30
|
-
isNew:
|
|
31
|
-
date: "3/
|
|
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: "「考核」支持建立企业指标库",
|
|
@@ -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
|
-
|
|
189
|
-
|
|
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%;
|
|
@@ -5,8 +5,6 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
5
5
|
});
|
|
6
6
|
exports.getOkrHeadActions = getOkrHeadActions;
|
|
7
7
|
|
|
8
|
-
var _dayjs = _interopRequireDefault(require("dayjs"));
|
|
9
|
-
|
|
10
8
|
var _bsGlobal = require("../../../utils/bs-global");
|
|
11
9
|
|
|
12
10
|
var _auth = require("../../../utils/auth");
|
|
@@ -15,36 +13,12 @@ var _enums = require("./enums");
|
|
|
15
13
|
|
|
16
14
|
var _getLocale = require("../../../utils/getLocale");
|
|
17
15
|
|
|
18
|
-
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
|
|
19
|
-
|
|
20
16
|
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; }
|
|
21
17
|
|
|
22
18
|
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; }
|
|
23
19
|
|
|
24
20
|
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; }
|
|
25
21
|
|
|
26
|
-
function getOkrHeadActions(data) {
|
|
27
|
-
var actions = [];
|
|
28
|
-
var auth = new _auth.OAuth({
|
|
29
|
-
principalUser: data.principalUser,
|
|
30
|
-
createUserId: data.detailInfo.createUserId
|
|
31
|
-
});
|
|
32
|
-
|
|
33
|
-
var dataWithAuth = _objectSpread(_objectSpread({}, data), {}, {
|
|
34
|
-
auth: auth
|
|
35
|
-
});
|
|
36
|
-
|
|
37
|
-
addShareButton(dataWithAuth, actions);
|
|
38
|
-
addVisibilityButton(dataWithAuth, actions);
|
|
39
|
-
addFollowButton(dataWithAuth, actions);
|
|
40
|
-
addExitButton(dataWithAuth, actions);
|
|
41
|
-
addFinishOrReopenButton(dataWithAuth, actions);
|
|
42
|
-
addCopyButton(dataWithAuth, actions);
|
|
43
|
-
addDeleteButton(dataWithAuth, actions); // addDetailButton(dataWithAuth,actions)
|
|
44
|
-
|
|
45
|
-
return actions;
|
|
46
|
-
}
|
|
47
|
-
|
|
48
22
|
var addShareButton = function addShareButton(_ref, actions) {
|
|
49
23
|
var openShareModal = _ref.openShareModal;
|
|
50
24
|
actions.push({
|
|
@@ -81,10 +55,10 @@ var addVisibilityButton = function addVisibilityButton(_ref2, actions) {
|
|
|
81
55
|
}
|
|
82
56
|
}];
|
|
83
57
|
|
|
84
|
-
var editable = auth.hasAuth() && detailInfo.status
|
|
58
|
+
var editable = auth.hasAuth() && detailInfo.status === _enums.OkrStatus.inProgress;
|
|
85
59
|
|
|
86
60
|
actions.push({
|
|
87
|
-
icon: visibility
|
|
61
|
+
icon: visibility !== 1 ? "tu-icon-simi-icon" : "tu-icon-gongkai",
|
|
88
62
|
title: children[visibility - 1].title + (0, _getLocale.getLocale)("OKR_MyO_Text_Visible"),
|
|
89
63
|
children: editable ? children : null
|
|
90
64
|
});
|
|
@@ -92,7 +66,6 @@ var addVisibilityButton = function addVisibilityButton(_ref2, actions) {
|
|
|
92
66
|
|
|
93
67
|
var addFollowButton = function addFollowButton(_ref3, actions) {
|
|
94
68
|
var roleType = _ref3.roleType,
|
|
95
|
-
detailInfo = _ref3.detailInfo,
|
|
96
69
|
onChangeOkrFollow = _ref3.onChangeOkrFollow;
|
|
97
70
|
|
|
98
71
|
// 未开启关注目标功能
|
|
@@ -101,12 +74,12 @@ var addFollowButton = function addFollowButton(_ref3, actions) {
|
|
|
101
74
|
} // 是负责人或是内部成员不能关注目标
|
|
102
75
|
|
|
103
76
|
|
|
104
|
-
if (roleType
|
|
77
|
+
if (roleType === _enums.OkrRole.principal || roleType === _enums.OkrRole.member) {
|
|
105
78
|
return;
|
|
106
79
|
} // 已关注目标
|
|
107
80
|
|
|
108
81
|
|
|
109
|
-
if (roleType
|
|
82
|
+
if (roleType === _enums.OkrRole.follower) {
|
|
110
83
|
actions.push({
|
|
111
84
|
icon: "okr-drawer-header-followed",
|
|
112
85
|
title: (0, _getLocale.getLocale)("OKR_MyO_Butt_Unfollow"),
|
|
@@ -131,7 +104,7 @@ var addExitButton = function addExitButton(_ref4, actions) {
|
|
|
131
104
|
var roleType = _ref4.roleType,
|
|
132
105
|
onQuit = _ref4.onQuit;
|
|
133
106
|
|
|
134
|
-
if (roleType
|
|
107
|
+
if (roleType === _enums.OkrRole.member) {
|
|
135
108
|
actions.push({
|
|
136
109
|
icon: "tu-icon-tuichu",
|
|
137
110
|
title: (0, _getLocale.getLocale)("Pro_Admin_pop_Withdraw"),
|
|
@@ -146,7 +119,7 @@ var addFinishOrReopenButton = function addFinishOrReopenButton(_ref5, actions) {
|
|
|
146
119
|
onFinishOrReOpen = _ref5.onFinishOrReOpen;
|
|
147
120
|
if (!auth.hasAuth()) return;
|
|
148
121
|
|
|
149
|
-
if (detailInfo.status
|
|
122
|
+
if (detailInfo.status === _enums.OkrStatus.inProgress) {
|
|
150
123
|
actions.push({
|
|
151
124
|
icon: "tu-icon-liebiao-jieshu",
|
|
152
125
|
title: (0, _getLocale.getLocale)("OKR_MyO_EndObjective"),
|
|
@@ -185,16 +158,39 @@ var addDeleteButton = function addDeleteButton(_ref7, actions) {
|
|
|
185
158
|
title: (0, _getLocale.getLocale)("OKR_MyO_Butt_DeleteO"),
|
|
186
159
|
onClick: onDeleteOkr
|
|
187
160
|
});
|
|
188
|
-
};
|
|
161
|
+
}; // const addDetailButton: ActionDealFunction = ({ detailInfo }, actions) => {
|
|
162
|
+
// const registerDate = window.BSGlobal.tenantAuthentication.StartDate;
|
|
163
|
+
// dayjs(registerDate).year() < 2021
|
|
164
|
+
// && actions.push({
|
|
165
|
+
// icon: "tu-icon-xiangqing1",
|
|
166
|
+
// title: "目标详情",
|
|
167
|
+
// onClick: () => {
|
|
168
|
+
// window.open(
|
|
169
|
+
// `${location.pathname}#okr/manage?work_id=${detailInfo.workId}`,
|
|
170
|
+
// );
|
|
171
|
+
// },
|
|
172
|
+
// });
|
|
173
|
+
// };
|
|
189
174
|
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
var
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
onClick: function onClick() {
|
|
197
|
-
window.open("".concat(location.pathname, "#okr/manage?work_id=").concat(detailInfo.workId));
|
|
198
|
-
}
|
|
175
|
+
|
|
176
|
+
function getOkrHeadActions(data) {
|
|
177
|
+
var actions = [];
|
|
178
|
+
var auth = new _auth.OAuth({
|
|
179
|
+
principalUser: data.principalUser,
|
|
180
|
+
createUserId: data.detailInfo.createUserId
|
|
199
181
|
});
|
|
200
|
-
|
|
182
|
+
|
|
183
|
+
var dataWithAuth = _objectSpread(_objectSpread({}, data), {}, {
|
|
184
|
+
auth: auth
|
|
185
|
+
});
|
|
186
|
+
|
|
187
|
+
addShareButton(dataWithAuth, actions);
|
|
188
|
+
addVisibilityButton(dataWithAuth, actions);
|
|
189
|
+
addFollowButton(dataWithAuth, actions);
|
|
190
|
+
addExitButton(dataWithAuth, actions);
|
|
191
|
+
addFinishOrReopenButton(dataWithAuth, actions);
|
|
192
|
+
addCopyButton(dataWithAuth, actions);
|
|
193
|
+
addDeleteButton(dataWithAuth, actions); // addDetailButton(dataWithAuth,actions)
|
|
194
|
+
|
|
195
|
+
return actions;
|
|
196
|
+
}
|
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
.okr-detail-head-parent {
|
|
6
6
|
display: flex;
|
|
7
7
|
align-items: center;
|
|
8
|
-
color: #
|
|
8
|
+
color: #89919f;
|
|
9
9
|
}
|
|
10
10
|
|
|
11
11
|
.okr-detail-head-parent .tu-icon-liebiao-duiqinubiao {
|
|
@@ -23,5 +23,5 @@
|
|
|
23
23
|
}
|
|
24
24
|
|
|
25
25
|
.okr-detail-head-parent > span:hover {
|
|
26
|
-
color: #
|
|
26
|
+
color: #2879ff;
|
|
27
27
|
}
|