@titaui/pc 1.12.8 → 1.12.9

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.
@@ -43,7 +43,8 @@ function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
43
43
 
44
44
  function OkrCase(_ref) {
45
45
  var onOkrApply = _ref.onOkrApply,
46
- okrTemplateEnabled = _ref.okrTemplateEnabled;
46
+ okrTemplateEnabled = _ref.okrTemplateEnabled,
47
+ onVisibleChange = _ref.onVisibleChange;
47
48
 
48
49
  var _useState = (0, _react.useState)(false),
49
50
  _useState2 = _slicedToArray(_useState, 2),
@@ -52,6 +53,7 @@ function OkrCase(_ref) {
52
53
 
53
54
  var okrCaseClickHandler = function okrCaseClickHandler() {
54
55
  setVisible(true);
56
+ onVisibleChange === null || onVisibleChange === void 0 ? void 0 : onVisibleChange(true);
55
57
  };
56
58
 
57
59
  var onCasesCloseHandler = function onCasesCloseHandler() {
@@ -62,13 +64,13 @@ function OkrCase(_ref) {
62
64
  onOkrApply === null || onOkrApply === void 0 ? void 0 : onOkrApply(data);
63
65
  setVisible(false);
64
66
 
65
- _toast["default"].Success("成功套用");
67
+ _toast["default"].Success('成功套用');
66
68
  };
67
69
 
68
70
  return /*#__PURE__*/_react["default"].createElement(_style.Line, null, okrTemplateEnabled && !(0, _helpers.isLocal)() && !(0, _helpers.isTencentHr)() ? /*#__PURE__*/_react["default"].createElement(_style.CaseLink, {
69
71
  onClick: okrCaseClickHandler,
70
72
  className: "tu-icon-shoushi"
71
- }, (0, _getLocale.getLocale)("OKR_MyO_Pop_Butt_AddfromOKR")) : null, okrTemplateEnabled && /*#__PURE__*/_react["default"].createElement(_dialog["default"], {
73
+ }, (0, _getLocale.getLocale)('OKR_MyO_Pop_Butt_AddfromOKR')) : null, okrTemplateEnabled && /*#__PURE__*/_react["default"].createElement(_dialog["default"], {
72
74
  zIndex: 1200,
73
75
  noHeadLine: true,
74
76
  visible: visible,
@@ -78,8 +80,8 @@ function OkrCase(_ref) {
78
80
  noCloseIcon: true,
79
81
  destroyOnClose: true,
80
82
  style: {
81
- width: "100%",
82
- height: "100%"
83
+ width: '100%',
84
+ height: '100%'
83
85
  },
84
86
  maskClosable: true
85
87
  }, /*#__PURE__*/_react["default"].createElement("div", {
@@ -613,32 +613,35 @@ function CreateOkrModal(_ref, ref) {
613
613
 
614
614
 
615
615
  var OnOkRApplyTplHandler = function OnOkRApplyTplHandler(data) {
616
- setRichEditorStatus('refresh');
617
616
  var name = data.name,
618
617
  subelements = data.subelements;
619
- setOkrNameData({
620
- mentionUsers: [],
621
- pureText: name,
622
- pureTextExcludeAt: name,
623
- richText: (0, _richEditor.TitaRichEditorInitTextState)(name)
624
- });
625
- setKrDatas(subelements.map(function (s) {
618
+ setOkrNameData(function () {
626
619
  return {
627
- uuid: _uuid["default"].v1(),
628
- principalId: Id,
629
- principalName: Name,
630
- userAvatar: UserAvatar,
631
- krWeight: (0, _roundWeight.RoundWeight)(100 / subelements.length),
632
- mileStoneName: s.name,
633
- mileStoneNamePureTextExcludeAt: s.name,
634
- mileStoneNameRichText: (0, _richEditor.TitaRichEditorInitTextState)(s.name),
635
- aiteUsers: [],
636
- confidenceIndex: 5
620
+ mentionUsers: [],
621
+ pureText: name,
622
+ pureTextExcludeAt: name,
623
+ richText: (0, _richEditor.TitaRichEditorInitTextState)(name)
637
624
  };
638
- }));
625
+ });
626
+ setKrDatas(function () {
627
+ return subelements.map(function (s) {
628
+ return {
629
+ uuid: _uuid["default"].v1(),
630
+ principalId: Id,
631
+ principalName: Name,
632
+ userAvatar: UserAvatar,
633
+ krWeight: (0, _roundWeight.RoundWeight)(100 / subelements.length),
634
+ mileStoneName: s.name,
635
+ mileStoneNamePureTextExcludeAt: s.name,
636
+ mileStoneNameRichText: (0, _richEditor.TitaRichEditorInitTextState)(s.name),
637
+ aiteUsers: [],
638
+ confidenceIndex: 5
639
+ };
640
+ });
641
+ });
639
642
  setIsCustomWeight(false);
640
643
  setIsApplyTpl(true);
641
- setRichEditorStatus('initialization');
644
+ setRichEditorStatus('refresh');
642
645
  };
643
646
 
644
647
  (0, _react.useEffect)(function () {
@@ -795,7 +798,11 @@ function CreateOkrModal(_ref, ref) {
795
798
  className: "create-modal__title"
796
799
  }, (0, _getLocale.getLocale)('OKR_MyO_Pop_Title_Newobjective')), /*#__PURE__*/_react["default"].createElement(_okrCase["default"], {
797
800
  okrTemplateEnabled: true,
798
- onOkrApply: OnOkRApplyTplHandler
801
+ onOkrApply: OnOkRApplyTplHandler,
802
+ onVisibleChange: function onVisibleChange() {
803
+ setIsApplyTpl(false);
804
+ setRichEditorStatus('initialization');
805
+ }
799
806
  }));
800
807
  }, []);
801
808
  var krCheckFinalResult = (0, _react.useMemo)(function () {
@@ -917,6 +924,7 @@ function CreateOkrModal(_ref, ref) {
917
924
  setONameCheckResult: setONameCheckResult,
918
925
  setIsInputContent: setIsInputContent
919
926
  }), /*#__PURE__*/_react["default"].createElement(_krDatas["default"], {
927
+ isApplyTpl: isApplyTpl,
920
928
  isCustomWeight: isCustomWeight,
921
929
  wrapperRef: wrapperRef,
922
930
  krDatas: krDatas,
@@ -62,7 +62,8 @@ function _iterableToArrayLimit(arr, i) { var _i = arr == null ? null : typeof Sy
62
62
  function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
63
63
 
64
64
  function KrDatas(props) {
65
- var isCustomWeight = props.isCustomWeight,
65
+ var isApplyTpl = props.isApplyTpl,
66
+ isCustomWeight = props.isCustomWeight,
66
67
  wrapperRef = props.wrapperRef,
67
68
  setKrDatas = props.setKrDatas,
68
69
  krDatas = props.krDatas,
@@ -286,7 +287,7 @@ function KrDatas(props) {
286
287
  }, [inputKrInfo, setIsInputContent]);
287
288
  (0, _react.useEffect)(function () {
288
289
  krDatasRef.current = krDatas;
289
- }, []);
290
+ }, [isApplyTpl]);
290
291
  return /*#__PURE__*/_react["default"].createElement("div", null, krDatasRef.current.map(function (kr, index) {
291
292
  return /*#__PURE__*/_react["default"].createElement(_krItem["default"], {
292
293
  key: kr === null || kr === void 0 ? void 0 : kr.uuid,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@titaui/pc",
3
- "version": "1.12.8",
3
+ "version": "1.12.9",
4
4
  "nameCN": "",
5
5
  "description": "",
6
6
  "main": "lib/index.js",