@titaui/pc 1.16.20 → 1.16.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.
@@ -54,9 +54,6 @@ function _iterableToArrayLimit(arr, i) { var _i = arr == null ? null : typeof Sy
54
54
  function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
55
55
 
56
56
  var visibilityList = [{
57
- value: 1,
58
- lable: (0, _getLocale.getLocale)("OKR_MyO_Pop_Public")
59
- }, {
60
57
  value: 2,
61
58
  lable: (0, _getLocale.getLocale)("OKR_MyO_From_Associatedmem")
62
59
  }, {
@@ -67,12 +64,19 @@ var visibilityList = [{
67
64
  lable: (0, _getLocale.getLocale)("OKR_MyO_Pop_Specified")
68
65
  }];
69
66
 
67
+ if (window.BSGlobal.tenantInfo.isOpenInfo) {
68
+ visibilityList.unshift({
69
+ value: 1,
70
+ lable: (0, _getLocale.getLocale)("OKR_MyO_Pop_Public")
71
+ });
72
+ }
73
+
70
74
  function _default(_ref) {
71
75
  var _ref$canEdit = _ref.canEdit,
72
76
  canEdit = _ref$canEdit === void 0 ? false : _ref$canEdit,
73
77
  workId = _ref.workId,
74
78
  _ref$visibilityProp = _ref.visibilityProp,
75
- visibilityProp = _ref$visibilityProp === void 0 ? 1 : _ref$visibilityProp,
79
+ visibilityProp = _ref$visibilityProp === void 0 ? 2 : _ref$visibilityProp,
76
80
  _ref$visiableScopePro = _ref.visiableScopeProp,
77
81
  visiableScopeProp = _ref$visiableScopePro === void 0 ? {} : _ref$visiableScopePro,
78
82
  onSave = _ref.onSave;
@@ -29,10 +29,7 @@ function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "functio
29
29
  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; }
30
30
 
31
31
  var visibilityList = function visibilityList() {
32
- return [{
33
- value: 1,
34
- lable: (0, _getLocale.getLocale)("OKR_MyO_Pop_Public")
35
- }, {
32
+ var visibility = [{
36
33
  value: 2,
37
34
  lable: (0, _getLocale.getLocale)("OKR_MyO_From_Associatedmem")
38
35
  }, {
@@ -42,6 +39,15 @@ var visibilityList = function visibilityList() {
42
39
  value: 4,
43
40
  lable: (0, _getLocale.getLocale)("OKR_MyO_Pop_Specified")
44
41
  }];
42
+
43
+ if (window.BSGlobal.tenantInfo.isOpenInfo) {
44
+ visibility.unshift({
45
+ value: 1,
46
+ lable: (0, _getLocale.getLocale)("OKR_MyO_Pop_Public")
47
+ });
48
+ }
49
+
50
+ return visibility;
45
51
  };
46
52
 
47
53
  var visibilityMapText = function visibilityMapText() {
@@ -221,7 +221,7 @@ function CreateOkrModal(_ref, ref) {
221
221
  setOkrClassify = _useState20[1]; // 目标类别
222
222
 
223
223
 
224
- var _useState21 = (0, _react.useState)(1),
224
+ var _useState21 = (0, _react.useState)(2),
225
225
  _useState22 = _slicedToArray(_useState21, 2),
226
226
  visibility = _useState22[0],
227
227
  setVisibility = _useState22[1]; // 可见性
@@ -680,7 +680,7 @@ function CreateOkrModal(_ref, ref) {
680
680
  });
681
681
  setCycle(cycle);
682
682
  setOkrClassify(undefined);
683
- setVisibility(1);
683
+ setVisibility(2);
684
684
  setParent({
685
685
  parentWorkId: 0,
686
686
  parentWorkName: '',
@@ -365,9 +365,13 @@ var DynamicItemHeader = function DynamicItemHeader(_ref) {
365
365
  }); // 暂时用title
366
366
 
367
367
  if (typeof (mindData === null || mindData === void 0 ? void 0 : mindData.content) === 'string' && (mindData === null || mindData === void 0 ? void 0 : mindData.content) !== '') {
368
- setMindImg(_constant.Motion.find(function (item) {
369
- return item.id === JSON.parse(mindData.content || '{}').SelectedValues[0];
370
- }).img);
368
+ var _Motion$find;
369
+
370
+ setMindImg(((_Motion$find = _constant.Motion.find(function (item) {
371
+ var _JSON$parse$SelectedV;
372
+
373
+ return item.id === ((_JSON$parse$SelectedV = JSON.parse(mindData.content || '{}').SelectedValues) === null || _JSON$parse$SelectedV === void 0 ? void 0 : _JSON$parse$SelectedV[0]) || 0;
374
+ })) === null || _Motion$find === void 0 ? void 0 : _Motion$find.img) || '');
371
375
  }
372
376
  }
373
377
  }, [dailyContent]);
@@ -40,10 +40,7 @@ function _iterableToArrayLimit(arr, i) { var _i = arr == null ? null : typeof Sy
40
40
  function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
41
41
 
42
42
  var getVisibilityList = function getVisibilityList() {
43
- return [{
44
- value: 1,
45
- label: (0, _getLocale.getLocale)("OKR_MyO_Pop_Public")
46
- }, {
43
+ var visibility = [{
47
44
  value: 2,
48
45
  label: (0, _getLocale.getLocale)("OKR_MyO_From_Associatedmem")
49
46
  }, {
@@ -53,6 +50,15 @@ var getVisibilityList = function getVisibilityList() {
53
50
  value: 4,
54
51
  label: (0, _getLocale.getLocale)("OKR_MyO_Pop_Specified")
55
52
  }];
53
+
54
+ if (window.BSGlobal.tenantInfo.isOpenInfo) {
55
+ visibility.unshift({
56
+ value: 1,
57
+ label: (0, _getLocale.getLocale)("OKR_MyO_Pop_Public")
58
+ });
59
+ }
60
+
61
+ return visibility;
56
62
  };
57
63
 
58
64
  var getVisibilityMapText = function getVisibilityMapText() {
@@ -34,11 +34,6 @@ var addVisibilityButton = function addVisibilityButton(_ref2, actions) {
34
34
  detailInfo = _ref2.detailInfo,
35
35
  changeVisiblilty = _ref2.changeVisiblilty;
36
36
  var children = [{
37
- title: (0, _getLocale.getLocale)('OKR_MyO_Pop_Public'),
38
- onClick: function onClick() {
39
- return changeVisiblilty(1);
40
- }
41
- }, {
42
37
  title: (0, _getLocale.getLocale)('OKR_MyO_From_Associatedmem'),
43
38
  onClick: function onClick() {
44
39
  return changeVisiblilty(2);
@@ -55,11 +50,27 @@ var addVisibilityButton = function addVisibilityButton(_ref2, actions) {
55
50
  }
56
51
  }];
57
52
 
53
+ if (window.BSGlobal.tenantInfo.isOpenInfo) {
54
+ children.unshift({
55
+ title: (0, _getLocale.getLocale)('OKR_MyO_Pop_Public'),
56
+ onClick: function onClick() {
57
+ return changeVisiblilty(1);
58
+ }
59
+ });
60
+ }
61
+
62
+ var getVisibilityMapText = {
63
+ 1: (0, _getLocale.getLocale)('OKR_MyO_Pop_Public'),
64
+ 2: (0, _getLocale.getLocale)('OKR_MyO_From_Associatedmem'),
65
+ 3: (0, _getLocale.getLocale)('OKR_MyO_Pop_Directrep'),
66
+ 4: (0, _getLocale.getLocale)('OKR_MyO_Pop_Specified')
67
+ };
68
+
58
69
  var editable = auth.hasAuth() && detailInfo.status === _enums.OkrStatus.inProgress;
59
70
 
60
71
  actions.push({
61
72
  icon: visibility !== 1 ? 'tu-icon-simi-icon' : 'tu-icon-gongkai',
62
- title: children[visibility - 1].title + (0, _getLocale.getLocale)('OKR_MyO_Text_Visible'),
73
+ title: getVisibilityMapText[visibility] + (0, _getLocale.getLocale)('OKR_MyO_Text_Visible'),
63
74
  children: editable ? children : null
64
75
  });
65
76
  };
@@ -40,19 +40,25 @@ function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
40
40
  var prefix = 'tita-okr-excel-create-visibility';
41
41
 
42
42
  var getVisibilityList = function getVisibilityList() {
43
- return [{
44
- value: 1,
45
- label: (0, _getLocale.getLocale)('OKR_MyO_Pop_Public')
46
- }, {
43
+ var visibility = [{
47
44
  value: 2,
48
- label: (0, _getLocale.getLocale)('OKR_MyO_From_Associatedmem')
45
+ label: (0, _getLocale.getLocale)("OKR_MyO_From_Associatedmem")
49
46
  }, {
50
47
  value: 3,
51
- label: (0, _getLocale.getLocale)('OKR_MyO_Pop_Directrep')
48
+ label: (0, _getLocale.getLocale)("OKR_MyO_Pop_Directrep")
52
49
  }, {
53
50
  value: 4,
54
- label: (0, _getLocale.getLocale)('OKR_MyO_Pop_Specified')
51
+ label: (0, _getLocale.getLocale)("OKR_MyO_Pop_Specified")
55
52
  }];
53
+
54
+ if (window.BSGlobal.tenantInfo.isOpenInfo) {
55
+ visibility.unshift({
56
+ value: 1,
57
+ label: (0, _getLocale.getLocale)("OKR_MyO_Pop_Public")
58
+ });
59
+ }
60
+
61
+ return visibility;
56
62
  };
57
63
 
58
64
  var getVisibilityMapText = function getVisibilityMapText() {
@@ -40,19 +40,25 @@ function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
40
40
  var prefix = 'tita-okr-excel-create-visibility';
41
41
 
42
42
  var getVisibilityList = function getVisibilityList() {
43
- return [{
44
- value: 1,
45
- label: (0, _getLocale.getLocale)('OKR_MyO_Pop_Public')
46
- }, {
43
+ var visibility = [{
47
44
  value: 2,
48
- label: (0, _getLocale.getLocale)('OKR_MyO_From_Associatedmem')
45
+ label: (0, _getLocale.getLocale)("OKR_MyO_From_Associatedmem")
49
46
  }, {
50
47
  value: 3,
51
- label: (0, _getLocale.getLocale)('OKR_MyO_Pop_Directrep')
48
+ label: (0, _getLocale.getLocale)("OKR_MyO_Pop_Directrep")
52
49
  }, {
53
50
  value: 4,
54
- label: (0, _getLocale.getLocale)('OKR_MyO_Pop_Specified')
51
+ label: (0, _getLocale.getLocale)("OKR_MyO_Pop_Specified")
55
52
  }];
53
+
54
+ if (window.BSGlobal.tenantInfo.isOpenInfo) {
55
+ visibility.unshift({
56
+ value: 1,
57
+ label: (0, _getLocale.getLocale)("OKR_MyO_Pop_Public")
58
+ });
59
+ }
60
+
61
+ return visibility;
56
62
  };
57
63
 
58
64
  var getVisibilityMapText = function getVisibilityMapText() {
@@ -114,7 +114,7 @@ var getIitData = function getIitData(_ref) {
114
114
  workName: '',
115
115
  isSaved: false,
116
116
  workNameRichText: '',
117
- visibility: 1,
117
+ visibility: 2,
118
118
  visibilityScope: undefined,
119
119
  departmentId: loginUser.DepartmentId,
120
120
  departmentName: loginUser.Department,
@@ -139,9 +139,9 @@ var flatTree = function flatTree(current, elements, showkr) {
139
139
  children = _current$children === void 0 ? [] : _current$children,
140
140
  isSearchRes = current.isSearchRes;
141
141
 
142
- if (modelType == 'root') {
142
+ if (modelType === 'root') {
143
143
  elements.push({
144
- id: "".concat(id),
144
+ id: modelType + id,
145
145
  type: 'RootNode',
146
146
  data: data,
147
147
  isParent: true,
@@ -168,7 +168,7 @@ var flatTree = function flatTree(current, elements, showkr) {
168
168
  }
169
169
 
170
170
  elements.push({
171
- id: "".concat(id),
171
+ id: "".concat(modelType).concat(id),
172
172
  type: 'ChildNode',
173
173
  position: {
174
174
  x: 0,
@@ -189,29 +189,26 @@ var flatTree = function flatTree(current, elements, showkr) {
189
189
  if (children.length) {
190
190
  children.forEach(function (child) {
191
191
  if (!child) return;
192
- var modelType = child.modelType,
193
- _child$children = child.children,
194
- children = _child$children === void 0 ? [] : _child$children;
195
192
 
196
- if (!showkr && modelType == 'kr') {
193
+ if (!showkr && child.modelType === 'kr') {
197
194
  if (children.length > 0) {
198
195
  children.forEach(function (sub) {
199
196
  if (!sub) return;
200
197
  elements.push({
201
- id: "e".concat(id, "-").concat(sub.id),
202
- source: "".concat(id),
203
- target: "".concat(sub.id)
198
+ id: "e".concat(modelType).concat(id, "-").concat(sub.modelType).concat(sub.id),
199
+ source: modelType + id,
200
+ target: "kr".concat(sub.id)
204
201
  });
205
202
  flatTree(sub, elements, showkr, current.modelType != 'root', id);
206
203
  });
207
204
  }
208
205
  } else {
209
206
  elements.push({
210
- id: "e".concat(id, "-").concat(child.id),
211
- source: "".concat(id),
212
- target: "".concat(child.id)
207
+ id: "e".concat(modelType).concat(id, "-").concat(child.modelType).concat(child.id),
208
+ source: modelType + id,
209
+ target: child.modelType + child.id
213
210
  });
214
- flatTree(child, elements, showkr, current.modelType != 'root', id);
211
+ flatTree(child, elements, showkr, current.modelType !== 'root', id);
215
212
  }
216
213
  });
217
214
  }
@@ -36,9 +36,12 @@ function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
36
36
  function _default(props) {
37
37
  var onSearch = props.onSearch,
38
38
  placeholder = props.placeholder,
39
- setSearchKey = props.setSearchKey;
39
+ setSearchKey = props.setSearchKey,
40
+ propsValue = props.value,
41
+ _props$style = props.style,
42
+ style = _props$style === void 0 ? {} : _props$style;
40
43
 
41
- var _useState = (0, _react.useState)(""),
44
+ var _useState = (0, _react.useState)(''),
42
45
  _useState2 = _slicedToArray(_useState, 2),
43
46
  value = _useState2[0],
44
47
  setValue = _useState2[1];
@@ -56,23 +59,23 @@ function _default(props) {
56
59
  var defaultStyle = _objectSpread({
57
60
  width: 230,
58
61
  height: 30
59
- }, props.style);
62
+ }, style);
60
63
 
61
64
  (0, _react.useEffect)(function () {
62
- setValue(props.value);
63
- if (!props.value) setClearIconState(false);
64
- }, [props.value]);
65
- var inputClassName = focus ? "search-input-focus" : "";
66
- var iconClassName = focus ? "search-input-icon-focus" : "";
65
+ setValue(propsValue);
66
+ if (!propsValue) setClearIconState(false);
67
+ }, [propsValue]);
68
+ var inputClassName = focus ? 'search-input-focus' : '';
69
+ var iconClassName = focus ? 'search-input-icon-focus' : '';
67
70
  var clearIconStyle = {
68
- display: clearIconState ? "inline" : "none"
71
+ display: clearIconState ? 'inline' : 'none'
69
72
  };
70
73
 
71
74
  var handleInputChange = function handleInputChange(e) {
72
75
  var evalue = e.target.value;
73
76
  setValue(evalue);
74
- setSearchKey && setSearchKey(evalue);
75
- setClearIconState(evalue != "");
77
+ setSearchKey === null || setSearchKey === void 0 ? void 0 : setSearchKey(evalue);
78
+ setClearIconState(evalue != '');
76
79
  };
77
80
 
78
81
  var handleFocusBlur = function handleFocusBlur(e) {
@@ -80,18 +83,18 @@ function _default(props) {
80
83
  };
81
84
 
82
85
  var handleKeyPress = function handleKeyPress(e) {
83
- if (e.key === "Enter") {
86
+ if (e.key === 'Enter') {
84
87
  handleSearch();
85
88
  }
86
89
  };
87
90
 
88
91
  var handleSearch = function handleSearch() {
89
- onSearch && onSearch(value.trim());
92
+ onSearch === null || onSearch === void 0 ? void 0 : onSearch(value === null || value === void 0 ? void 0 : value.trim());
90
93
  };
91
94
 
92
95
  var clearValue = function clearValue(e) {
93
- setValue("");
94
- setSearchKey && setSearchKey("");
96
+ setValue('');
97
+ setSearchKey === null || setSearchKey === void 0 ? void 0 : setSearchKey('');
95
98
 
96
99
  if (onSearch) {
97
100
  onSearch('');
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@titaui/pc",
3
- "version": "1.16.20",
3
+ "version": "1.16.21",
4
4
  "nameCN": "",
5
5
  "description": "",
6
6
  "main": "lib/index.js",