@titaui/pc 1.15.40-beta.11 → 1.15.40-beta.12

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.
@@ -85,6 +85,10 @@ var getOkrClassifyList = function getOkrClassifyList() {
85
85
 
86
86
  var getOrderTypeList = function getOrderTypeList() {
87
87
  return [{
88
+ label: '自定义排序',
89
+ value: 0,
90
+ toolTip: '自定义排序'
91
+ }, {
88
92
  label: (0, _getLocale.getLocale)("OKR_MyO_Text_Firstcreated"),
89
93
  value: 2,
90
94
  toolTip: (0, _getLocale.getLocale)("OKR_MyO_Text_First")
@@ -115,7 +119,7 @@ var Filter = function Filter(_ref) {
115
119
  var values = useLocalStorage.getItem("okr-filter-values") || {
116
120
  okrType: "",
117
121
  okrClassify: "",
118
- orderType: 2
122
+ orderType: 0
119
123
  };
120
124
  return values;
121
125
  }),
@@ -163,7 +167,7 @@ var Filter = function Filter(_ref) {
163
167
  useLocalStorage.setItem("okr-filter-values", {
164
168
  okrType: "",
165
169
  okrClassify: "",
166
- orderType: 2
170
+ orderType: 0
167
171
  });
168
172
  }
169
173
 
@@ -116,7 +116,7 @@ function Creator(_ref) {
116
116
  var generalCanvas = function generalCanvas() {
117
117
  var type = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : "text";
118
118
  var userName = arguments.length > 1 ? arguments[1] : undefined;
119
- var font = "normal 24px/30px Arial,Verdana,Helvetica Neue,Helvetica,sans-serif,PingFang SC,Microsoft YaHei";
119
+ var font = "normal 36px/36px Arial,Verdana,Helvetica Neue,Helvetica,sans-serif,PingFang SC,Microsoft YaHei";
120
120
  var canvas = document.createElement("canvas");
121
121
  var ctx = canvas.getContext("2d");
122
122
  ctx.font = font;
@@ -125,7 +125,7 @@ function Creator(_ref) {
125
125
  width = _ctx$measureText.width;
126
126
 
127
127
  var actualWidth = Math.min(width, 184);
128
- (0, _openDataPainter.setSize)(canvas, ctx, actualWidth, 48); // 设置画布尺寸
128
+ (0, _openDataPainter.setSize)(canvas, ctx, actualWidth, 72); // 设置画布尺寸
129
129
 
130
130
  setImgwidth(actualWidth);
131
131
  ctx.textBaseline = "middle";
@@ -167,10 +167,9 @@ function Creator(_ref) {
167
167
  src: darkTheme ? whiteImg : normalImg,
168
168
  style: {
169
169
  maxWidth: 92,
170
- marginLeft: 4,
171
- transform: 'translateY(-20%)'
170
+ marginLeft: 4
172
171
  },
173
- width: Number(imgWidth) / 2
172
+ width: Number(imgWidth) / 3
174
173
  }));
175
174
  }
176
175
 
@@ -86,7 +86,9 @@ var viewConfig = function viewConfig() {
86
86
  };
87
87
 
88
88
  var isSelfTenant = function isSelfTenant() {
89
- return ['352728', '564003', '511477'].includes((0, _bsGlobal.getBSGlobal)('tenantInfo').Id);
89
+ return ['352728', '564003', '511477', // 正式环境
90
+ '500019', '500017' // 测试环境
91
+ ].includes((0, _bsGlobal.getBSGlobal)('tenantInfo').Id);
90
92
  };
91
93
 
92
94
  function Header(props, ref) {
@@ -111,7 +111,10 @@ var NewOkrList = function NewOkrList(props) {
111
111
  var formFieldValues = useLocalStorage.getItem("okr-filter-values") || {
112
112
  targetType: "",
113
113
  targetCategory: "",
114
- targetSort: ""
114
+ targetSort: "",
115
+ okrType: "",
116
+ okrClassify: "",
117
+ orderType: 0
115
118
  };
116
119
 
117
120
  var filterCycle = function () {
@@ -41,10 +41,13 @@ function List(props) {
41
41
  var _useContext = (0, _react.useContext)(_context.Context),
42
42
  annualNum = _useContext.annualNum,
43
43
  cycleType = _useContext.cycleType,
44
- yqmNum = _useContext.yqmNum;
44
+ yqmNum = _useContext.yqmNum,
45
+ orderType = _useContext.orderType;
45
46
 
46
47
  return /*#__PURE__*/_react["default"].createElement("div", null, /*#__PURE__*/_react["default"].createElement(OkrListCmp, {
48
+ orderType: orderType,
47
49
  okrData: okrs,
50
+ setData: setOkrs,
48
51
  cycle: {
49
52
  annualNum: annualNum,
50
53
  cycleType: cycleType,
@@ -9,12 +9,12 @@ exports.parseTag = exports.parseStringV2 = exports.parseString = exports.parseOp
9
9
 
10
10
  var _react = _interopRequireWildcard(require("react"));
11
11
 
12
+ var Sentry = _interopRequireWildcard(require("@sentry/browser"));
13
+
12
14
  var _bsGlobal = require("./bs-global");
13
15
 
14
16
  var _openDataPainter = require("../components/open-data-painter");
15
17
 
16
- var _helpers = require("./helpers");
17
-
18
18
  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); }
19
19
 
20
20
  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; }
@@ -77,60 +77,13 @@ function openData() {
77
77
  var _getBSGlobal;
78
78
 
79
79
  // 企业微信租户 && 非自建应用
80
- if ((getSource() === WX_SOURCE || getUA().includes(WX_UA_STR)) && ((_getBSGlobal = (0, _bsGlobal.getBSGlobal)('tenantInfo')) === null || _getBSGlobal === void 0 ? void 0 : _getBSGlobal.corpCreateType) !== 2 // 2:自建应用
81
- ) {
82
- // 企业微信初始化失败
83
- // if (!window.WWOpenData && !window.top.WWOpenData) {
84
- // return (p) => {
85
- // if (p.name == undefined || p.id == undefined) {
86
- // try {
87
- // errorLog(1, JSON.stringify({
88
- // errorType: 'WWOpenData is undefined',
89
- // pName: p.name == undefined ? 'undefined' : p.name,
90
- // pId: p.id == undefined ? 'undefined' : p.id,
91
- // pType: p.type,
92
- // }))
93
- // } catch (e) {
94
- // console.log(e)
95
- // }
96
- // }
97
- // return p.name || p.id || null
98
- // }
99
- // }
80
+ if ((getSource() === WX_SOURCE || getUA().includes(WX_UA_STR)) && (_getBSGlobal = (0, _bsGlobal.getBSGlobal)('tenantInfo')) !== null && _getBSGlobal !== void 0 && _getBSGlobal.isTranslate) {
100
81
  return function (p) {
101
82
  var pId = p.id,
102
83
  pName = p.name,
103
84
  pCorpId = p.corpId,
104
85
  pType = p.type;
105
86
  var ref = (0, _react.useRef)(null);
106
- (0, _react.useEffect)(function () {
107
- var openId = pCorpId || getOpenId(pId, pType);
108
-
109
- if (!openId) {
110
- if (pId !== undefined && !ignorePIds.includes(pId)) {
111
- try {
112
- // BSGlobal
113
- var openIds;
114
-
115
- if (pType === 'userName') {
116
- openIds = (0, _bsGlobal.getBSGlobal)('openIds');
117
- } else if (pType === 'departmentName') {
118
- openIds = (0, _bsGlobal.getBSGlobal)('openDepartmentIds');
119
- }
120
-
121
- (0, _helpers.errorLog)(1, JSON.stringify({
122
- errorType: 'openId 不存在',
123
- pName: pName === undefined ? 'undefined' : pName,
124
- pId: pId === undefined ? 'undefined' : pId,
125
- pType: pType,
126
- openIds: openIds
127
- }));
128
- } catch (e) {
129
- console.log(e);
130
- }
131
- }
132
- }
133
- }, [pId, pName]);
134
87
  (0, _react.useLayoutEffect)(function () {
135
88
  var _ref;
136
89
 
@@ -146,21 +99,19 @@ function openData() {
146
99
  var openId = pCorpId || getOpenId(pId, pType);
147
100
 
148
101
  if (!openId) {
149
- if (pId !== undefined && !ignorePIds.includes(pId)) {// Sentry.withScope((scope) => {
150
- // scope.setTag('error-level', 'P1')
151
- // scope.setTag('error-type', '企业微信openData调用失败')
152
- // scope.setExtra('fail_type', pType)
153
- // scope.setExtra('p_id', pId)
154
- // scope.setExtra('p_name', pName)
155
- // scope.setExtra('corp_id', pCorpId)
156
- // scope.setExtra('open_id', getOpenId(pId, pType))
157
- // p.callFunc && scope.setExtra('fail_callFunc', p.callFunc)
158
- // p.extra && scope.setExtra('fail_extra', p.extra)
159
- // Sentry.captureException(
160
- // new Error('企业微信openData调用失败'),
161
- // scope,
162
- // )
163
- // })
102
+ if (pId !== undefined && !ignorePIds.includes(pId)) {
103
+ Sentry.withScope(function (scope) {
104
+ scope.setTag('error-level', 'P1');
105
+ scope.setTag('error-type', 'openId不存在');
106
+ scope.setExtra('fail_type', pType);
107
+ scope.setExtra('p_id', pId);
108
+ scope.setExtra('p_name', pName);
109
+ scope.setExtra('corp_id', pCorpId);
110
+ scope.setExtra('open_id', getOpenId(pId, pType));
111
+ p.callFunc && scope.setExtra('fail_callFunc', p.callFunc);
112
+ p.extra && scope.setExtra('fail_extra', p.extra);
113
+ Sentry.captureException(new Error('企业微信openData调用失败'), scope);
114
+ });
164
115
  }
165
116
 
166
117
  return pName || pId || null;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@titaui/pc",
3
- "version": "1.15.40-beta.11",
3
+ "version": "1.15.40-beta.12",
4
4
  "nameCN": "",
5
5
  "description": "",
6
6
  "main": "lib/index.js",