@tntd/reference 1.2.5 → 1.2.7

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/es/AHref/index.js CHANGED
@@ -10,10 +10,10 @@ var _tntd = require("tntd");
10
10
  function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
11
11
  function _extends() { return _extends = Object.assign ? Object.assign.bind() : function (n) { for (var e = 1; e < arguments.length; e++) { var t = arguments[e]; for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]); } return n; }, _extends.apply(null, arguments); }
12
12
  var _default = exports.default = (0, _I18N.WrapLocaleReceiver)(props => {
13
+ var _window, _window2;
13
14
  const {
14
15
  record,
15
16
  onViewOpen,
16
- setOtherVisible,
17
17
  children,
18
18
  href,
19
19
  unmountHandle,
@@ -23,6 +23,7 @@ var _default = exports.default = (0, _I18N.WrapLocaleReceiver)(props => {
23
23
  I18N,
24
24
  ...rest
25
25
  } = props;
26
+ const isInIframe = ((_window = window) == null ? void 0 : _window.self) !== ((_window2 = window) == null ? void 0 : _window2.top);
26
27
  if (onViewOpen && record != null && record.canJump) {
27
28
  return /*#__PURE__*/_react.default.createElement(_tntd.HandleIcon, {
28
29
  className: "custom-class",
@@ -33,8 +34,20 @@ var _default = exports.default = (0, _I18N.WrapLocaleReceiver)(props => {
33
34
  }, /*#__PURE__*/_react.default.createElement(_tntd.Icon, {
34
35
  type: "profile",
35
36
  onClick: () => {
36
- const url = window.location.host + (record == null ? void 0 : record.goLink);
37
- window.parent.open(url);
37
+ const url = window.location.origin + (record == null ? void 0 : record.goLink);
38
+ if (isInIframe) {
39
+ let pathName = url;
40
+ if (url && url.includes('?')) {
41
+ pathName = url == null ? void 0 : url.split('?')[0];
42
+ }
43
+ if (pathName === window.location.pathname) {
44
+ window.parent.location.href = url;
45
+ } else {
46
+ window.parent.open(url);
47
+ }
48
+ return;
49
+ }
50
+ window.location.href = url;
38
51
  }
39
52
  })));
40
53
  }
@@ -47,15 +60,12 @@ var _default = exports.default = (0, _I18N.WrapLocaleReceiver)(props => {
47
60
  desc: I18N.referenceinfo.index.xiangqing
48
61
  }, /*#__PURE__*/_react.default.createElement(_tntd.Icon, {
49
62
  type: "profile",
50
- onClick: () => {
51
- setOtherVisible(record);
52
- }
63
+ onClick: () => onViewOpen(record)
53
64
  })));
54
65
  }
55
66
  if (window.__isMultiTab__) {
56
67
  return /*#__PURE__*/_react.default.createElement("a", {
57
68
  onClick: evt => {
58
- var _window, _window2;
59
69
  evt.preventDefault();
60
70
  if (unmountHandle && typeof unmountHandle === 'function') {
61
71
  unmountHandle();
@@ -68,7 +78,6 @@ var _default = exports.default = (0, _I18N.WrapLocaleReceiver)(props => {
68
78
  jumpFun(href);
69
79
  return;
70
80
  }
71
- const isInIframe = ((_window = window) == null ? void 0 : _window.self) !== ((_window2 = window) == null ? void 0 : _window2.top);
72
81
  if (iframeJump && isInIframe) {
73
82
  if (pathName === window.location.pathname) {
74
83
  window.parent.location.href = href;
@@ -77,11 +86,7 @@ var _default = exports.default = (0, _I18N.WrapLocaleReceiver)(props => {
77
86
  }
78
87
  return;
79
88
  }
80
- // if (pathName === window.location.pathname) {
81
89
  window.location.href = href;
82
- // } else {
83
- // window.push(href);
84
- // }
85
90
  }
86
91
  }, children);
87
92
  }
@@ -48,11 +48,6 @@ var _default = exports.default = (0, _I18N.WrapLocaleReceiver)(props => {
48
48
  });
49
49
  }
50
50
  }, [visible, I18N, fetchReference]);
51
- const handleSetOtherVisible = record => {
52
- if (onViewOpen) {
53
- onViewOpen(record);
54
- }
55
- };
56
51
  return /*#__PURE__*/_react.default.createElement(_tntd.Drawer, _extends({
57
52
  className: "reference-drawer",
58
53
  width: 900,
@@ -78,7 +73,6 @@ var _default = exports.default = (0, _I18N.WrapLocaleReceiver)(props => {
78
73
  appList: appList || [],
79
74
  orgMap: orgMap || {},
80
75
  unmountHandle: onClose,
81
- setOtherVisible: handleSetOtherVisible,
82
76
  showPagination: showPagination,
83
77
  onViewOpen: onViewOpen
84
78
  })), customDrawer);
@@ -24,7 +24,6 @@ var _default = exports.default = (0, _I18N.WrapLocaleReceiver)(props => {
24
24
  jumpFun,
25
25
  iframeJump,
26
26
  type,
27
- setOtherVisible,
28
27
  onViewOpen,
29
28
  I18N
30
29
  } = props;
@@ -63,7 +62,7 @@ var _default = exports.default = (0, _I18N.WrapLocaleReceiver)(props => {
63
62
  title: c == null ? void 0 : c.title,
64
63
  placement: "topLeft"
65
64
  }, c == null ? void 0 : c.title),
66
- width: referenceData.length > 4 ? '160px' : (1 / referenceData.length).toFixed(2) + "%",
65
+ width: columns.length > 4 ? '160px' : (1 / columns.length * 100).toFixed(2) + "%",
67
66
  ellipsis: true
68
67
  };
69
68
  if (from === 'ReferenceOnlineCheck' && c.dataIndex === 'status') {
@@ -104,7 +103,6 @@ var _default = exports.default = (0, _I18N.WrapLocaleReceiver)(props => {
104
103
  }
105
104
  if (c.dataIndex === goName && record != null && record.goLink) {
106
105
  return /*#__PURE__*/_react.default.createElement(_AHref.default, {
107
- setOtherVisible: setOtherVisible,
108
106
  onViewOpen: onViewOpen,
109
107
  record: record,
110
108
  jumpFun: jumpFun,
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
 
3
- var _excluded = ["record", "onViewOpen", "setOtherVisible", "children", "href", "unmountHandle", "jumpFun", "iframeJump", "Com", "I18N"];
3
+ var _excluded = ["record", "onViewOpen", "children", "href", "unmountHandle", "jumpFun", "iframeJump", "Com", "I18N"];
4
4
  function _objectWithoutProperties(e, t) { if (null == e) return {}; var o, r, i = _objectWithoutPropertiesLoose(e, t); if (Object.getOwnPropertySymbols) { var s = Object.getOwnPropertySymbols(e); for (r = 0; r < s.length; r++) o = s[r], t.includes(o) || {}.propertyIsEnumerable.call(e, o) && (i[o] = e[o]); } return i; }
5
5
  function _objectWithoutPropertiesLoose(r, e) { if (null == r) return {}; var t = {}; for (var n in r) if ({}.hasOwnProperty.call(r, n)) { if (e.includes(n)) continue; t[n] = r[n]; } return t; }
6
6
  Object.defineProperty(exports, "__esModule", {
@@ -25,9 +25,9 @@ function _extends() {
25
25
  }, _extends.apply(null, arguments);
26
26
  }
27
27
  var _default = exports["default"] = (0, _I18N.WrapLocaleReceiver)(function (props) {
28
+ var _window, _window2;
28
29
  var record = props.record,
29
30
  onViewOpen = props.onViewOpen,
30
- setOtherVisible = props.setOtherVisible,
31
31
  children = props.children,
32
32
  href = props.href,
33
33
  unmountHandle = props.unmountHandle,
@@ -36,6 +36,7 @@ var _default = exports["default"] = (0, _I18N.WrapLocaleReceiver)(function (prop
36
36
  Com = props.Com,
37
37
  I18N = props.I18N,
38
38
  rest = _objectWithoutProperties(props, _excluded);
39
+ var isInIframe = ((_window = window) == null ? void 0 : _window.self) !== ((_window2 = window) == null ? void 0 : _window2.top);
39
40
  if (onViewOpen && record != null && record.canJump) {
40
41
  return /*#__PURE__*/_react["default"].createElement(_tntd.HandleIcon, {
41
42
  className: "custom-class",
@@ -46,8 +47,20 @@ var _default = exports["default"] = (0, _I18N.WrapLocaleReceiver)(function (prop
46
47
  }, /*#__PURE__*/_react["default"].createElement(_tntd.Icon, {
47
48
  type: "profile",
48
49
  onClick: function onClick() {
49
- var url = window.location.host + (record == null ? void 0 : record.goLink);
50
- window.parent.open(url);
50
+ var url = window.location.origin + (record == null ? void 0 : record.goLink);
51
+ if (isInIframe) {
52
+ var pathName = url;
53
+ if (url && url.includes('?')) {
54
+ pathName = url == null ? void 0 : url.split('?')[0];
55
+ }
56
+ if (pathName === window.location.pathname) {
57
+ window.parent.location.href = url;
58
+ } else {
59
+ window.parent.open(url);
60
+ }
61
+ return;
62
+ }
63
+ window.location.href = url;
51
64
  }
52
65
  })));
53
66
  }
@@ -61,14 +74,13 @@ var _default = exports["default"] = (0, _I18N.WrapLocaleReceiver)(function (prop
61
74
  }, /*#__PURE__*/_react["default"].createElement(_tntd.Icon, {
62
75
  type: "profile",
63
76
  onClick: function onClick() {
64
- setOtherVisible(record);
77
+ return onViewOpen(record);
65
78
  }
66
79
  })));
67
80
  }
68
81
  if (window.__isMultiTab__) {
69
82
  return /*#__PURE__*/_react["default"].createElement("a", {
70
83
  onClick: function onClick(evt) {
71
- var _window, _window2;
72
84
  evt.preventDefault();
73
85
  if (unmountHandle && typeof unmountHandle === 'function') {
74
86
  unmountHandle();
@@ -81,7 +93,6 @@ var _default = exports["default"] = (0, _I18N.WrapLocaleReceiver)(function (prop
81
93
  jumpFun(href);
82
94
  return;
83
95
  }
84
- var isInIframe = ((_window = window) == null ? void 0 : _window.self) !== ((_window2 = window) == null ? void 0 : _window2.top);
85
96
  if (iframeJump && isInIframe) {
86
97
  if (pathName === window.location.pathname) {
87
98
  window.parent.location.href = href;
@@ -90,11 +101,7 @@ var _default = exports["default"] = (0, _I18N.WrapLocaleReceiver)(function (prop
90
101
  }
91
102
  return;
92
103
  }
93
- // if (pathName === window.location.pathname) {
94
104
  window.location.href = href;
95
- // } else {
96
- // window.push(href);
97
- // }
98
105
  }
99
106
  }, children);
100
107
  }
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/AHref/index.js"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,kDAA0B;AAC1B,kCAA6C;AAC7C,+BAAuC;AACvC,kBAAe,IAAA,yBAAkB,EAAC,CAAC,KAAK,EAAE,EAAE;IAC1C,MAAM,EAAE,MAAM,EAAC,UAAU,EAAC,eAAe,EAAE,QAAQ,EAAE,IAAI,EAAE,aAAa,EAAE,OAAO,EAAE,UAAU,EAAE,GAAG,EAAE,IAAI,KAAc,KAAK,EAAd,IAAI,UAAK,KAAK,EAArH,wHAA6G,CAAQ,CAAC;IAC5H,IAAG,UAAU,KAAI,MAAM,aAAN,MAAM,uBAAN,MAAM,CAAE,OAAO,CAAA,EAAC;QAC/B,OAAO,CACL,8BAAC,iBAAU,IAAC,SAAS,EAAC,cAAc,EAAC,GAAG,EAAE,CAAC;YACzC,8BAAC,iBAAU,CAAC,IAAI,IAAE,KAAK,EAAE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AC,CAAC,CAAC;iBAClC;gBACD,IAAG,OAAO,IAAI,OAAO,OAAO,KAAG,UAAU,EAAC;oBACtC,OAAO,CAAC,IAAI,CAAC,CAAC;oBACd,OAAM;iBACT;gBACD,MAAM,UAAU,GAAG,CAAA,MAAM,aAAN,MAAM,uBAAN,MAAM,CAAE,IAAI,OAAK,MAAM,aAAN,MAAM,uBAAN,MAAM,CAAE,GAAG,CAAA,CAAC;gBAChD,IAAG,UAAU,IAAI,UAAU,EAAC;oBACxB,IAAI,QAAQ,KAAK,MAAM,CAAC,QAAQ,CAAC,QAAQ,EAAE;wBACvC,MAAM,CAAC,MAAM,CAAC,QAAQ,CAAC,IAAI,GAAG,IAAI,CAAC;qBACtC;yBAAM;wBACH,MAAM,CAAC,MAAM,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;qBAC5B;oBACD,OAAM;iBACT;gBACD,+CAA+C;gBAC3C,MAAM,CAAC,QAAQ,CAAC,IAAI,GAAG,IAAI,CAAC;gBAChC,WAAW;gBACX,yBAAyB;gBACzB,IAAI;YACR,CAAC,IAEA,QAAQ,CACP,CACL,CAAC;KACH;IACD,OAAO,CACL,mDAAG,IAAI,EAAE,IAAI,IAAM,IAAI,GACpB,QAAQ,CACP,CACL,CAAC;AACJ,CAAC,CAAC,CAAC","sourcesContent":["import React from 'react';\nimport { WrapLocaleReceiver } from '../I18N';\nimport { HandleIcon,Icon } from 'tntd';\nexport default WrapLocaleReceiver((props) => {\n const { record,onViewOpen,setOtherVisible, children, href, unmountHandle, jumpFun, iframeJump, Com, I18N, ...rest } = props;\n if(onViewOpen && record?.canJump){\n return (\n <HandleIcon className=\"custom-class\" num={2}>\n <HandleIcon.Item title={I18N.referenceinfo.index.xiangqing} desc={I18N.referenceinfo.index.xiangqing}>\n <Icon type=\"profile\" onClick={()=>{\n const url = window.location.host + record?.goLink;\n window.parent.open(url);\n }}></Icon>\n </HandleIcon.Item>\n </HandleIcon>\n )}\n if(onViewOpen){\n return (\n <HandleIcon className=\"custom-class\" num={2}>\n <HandleIcon.Item title={I18N.referenceinfo.index.xiangqing} desc={I18N.referenceinfo.index.xiangqing}>\n <Icon type=\"profile\" onClick={()=>{\n setOtherVisible(record);\n }}></Icon>\n </HandleIcon.Item>\n </HandleIcon>\n )}\n if (window.__isMultiTab__) {\n return (\n <a\n onClick={(evt) => {\n evt.preventDefault();\n if (unmountHandle && typeof unmountHandle === 'function') {\n unmountHandle();\n }\n let pathName = href;\n if (href && href.includes('?')) {\n pathName = href?.split('?')[0];\n }\n if(jumpFun && typeof jumpFun==='function'){\n jumpFun(href);\n return\n }\n const isInIframe = window?.self !== window?.top;\n if(iframeJump && isInIframe){\n if (pathName === window.location.pathname) {\n window.parent.location.href = href;\n } else {\n window.parent.open(href);\n }\n return\n }\n // if (pathName === window.location.pathname) {\n window.location.href = href;\n // } else {\n // window.push(href);\n // }\n }}\n >\n {children}\n </a>\n );\n }\n return (\n <a href={href} {...rest}>\n {children}\n </a>\n );\n});\n"]}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/AHref/index.js"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,kDAA0B;AAC1B,kCAA6C;AAC7C,+BAAuC;AACvC,kBAAe,IAAA,yBAAkB,EAAC,CAAC,KAAK,EAAE,EAAE;IAC1C,MAAM,EAAE,MAAM,EAAE,UAAU,EAAE,QAAQ,EAAE,IAAI,EAAE,aAAa,EAAE,OAAO,EAAE,UAAU,EAAE,GAAG,EAAE,IAAI,KAAc,KAAK,EAAd,IAAI,UAAK,KAAK,EAAtG,qGAA8F,CAAQ,CAAC;IAC7G,MAAM,UAAU,GAAG,CAAA,MAAM,aAAN,MAAM,uBAAN,MAAM,CAAE,IAAI,OAAK,MAAM,aAAN,MAAM,uBAAN,MAAM,CAAE,GAAG,CAAA,CAAC;IAChD,IAAG,UAAU,KAAI,MAAM,aAAN,MAAM,uBAAN,MAAM,CAAE,OAAO,CAAA,EAAC;QAC/B,OAAO,CACL,8BAAC,iBAAU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\nexport default WrapLocaleReceiver((props) => {\n const { record, onViewOpen, children, href, unmountHandle, jumpFun, iframeJump, Com, I18N, ...rest } = props;\n const isInIframe = window?.self !== window?.top;\n if(onViewOpen && record?.canJump){\n return (\n <HandleIcon className=\"custom-class\" num={2}>\n <HandleIcon.Item title={I18N.referenceinfo.index.xiangqing} desc={I18N.referenceinfo.index.xiangqing}>\n <Icon type=\"profile\" onClick={()=>{\n const url = window.location.origin + record?.goLink;\n if(isInIframe){\n let pathName = url;\n if (url && url.includes('?')) {\n pathName = url?.split('?')[0];\n }\n if (pathName === window.location.pathname) {\n window.parent.location.href = url;\n } else {\n window.parent.open(url);\n }\n return\n }\n window.location.href = url;\n }}></Icon>\n </HandleIcon.Item>\n </HandleIcon>\n )}\n if(onViewOpen){\n return (\n <HandleIcon className=\"custom-class\" num={2}>\n <HandleIcon.Item title={I18N.referenceinfo.index.xiangqing} desc={I18N.referenceinfo.index.xiangqing}>\n <Icon type=\"profile\" onClick={()=>onViewOpen(record)}></Icon>\n </HandleIcon.Item>\n </HandleIcon>\n )}\n if (window.__isMultiTab__) {\n return (\n <a\n onClick={(evt) => {\n evt.preventDefault();\n if (unmountHandle && typeof unmountHandle === 'function') {\n unmountHandle();\n }\n let pathName = href;\n if (href && href.includes('?')) {\n pathName = href?.split('?')[0];\n }\n if(jumpFun && typeof jumpFun==='function'){\n jumpFun(href);\n return\n }\n if(iframeJump && isInIframe){\n if (pathName === window.location.pathname) {\n window.parent.location.href = href;\n } else {\n window.parent.open(href);\n }\n return\n }\n window.location.href = href;\n }}\n >\n {children}\n </a>\n );\n }\n return (\n <a href={href} {...rest}>\n {children}\n </a>\n );\n});\n"]}
@@ -101,11 +101,6 @@ var _default = exports["default"] = (0, _I18N.WrapLocaleReceiver)(function (prop
101
101
  });
102
102
  }
103
103
  }, [visible, I18N, fetchReference]);
104
- var handleSetOtherVisible = function handleSetOtherVisible(record) {
105
- if (onViewOpen) {
106
- onViewOpen(record);
107
- }
108
- };
109
104
  return /*#__PURE__*/_react["default"].createElement(_tntd.Drawer, _extends({
110
105
  className: "reference-drawer",
111
106
  width: 900,
@@ -131,7 +126,6 @@ var _default = exports["default"] = (0, _I18N.WrapLocaleReceiver)(function (prop
131
126
  appList: appList || [],
132
127
  orgMap: orgMap || {},
133
128
  unmountHandle: onClose,
134
- setOtherVisible: handleSetOtherVisible,
135
129
  showPagination: showPagination,
136
130
  onViewOpen: onViewOpen
137
131
  })), customDrawer);
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/ReferenceDrawer/index.js"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,kCAA6C;AAC7C,+CAAmD;AACnD,+BAAuD;AACvD,qEAA6C;AAC7C,wBAAsB;AAEtB,kBAAe,IAAA,yBAAkB,EAAC,CAAC,KAAK,EAAE,EAAE;IAC1C,MAAM,EACJ,cAAc,EACd,IAAI,GAAG,IAAI,EACX,MAAM,GAAG,EAAE,EACX,OAAO,GAAG,EAAE,EACZ,KAAK,EACL,OAAO,EACP,OAAO,EACP,SAAS,EACT,cAAc,EACd,cAAc,GAAG,IAAI,EACrB,OAAO,EACP,UAAU,EACV,IAAI,EACJ,YAAY,EACZ,UAAU,KAER,KAAK,EADJ,IAAI,UACL,KAAK,EAjBH,8LAiBL,CAAQ,CAAC;IACV,MAAM,CAAC,aAAa,EAAE,gBAAgB,CAAC,GAAG,IAAA,gBAAQ,EAAC,IAAI,CAAC,CAAC;IACzD,MAAM,CAAC,aAAa,EAAE,gBAAgB,CAAC,GAAG,IAAA,gBAAQ,EAAC,CAAC,IAAI,CAAC,CAAC;IAC1D,IAAA,iBAAS,EAAC,GAAG,EAAE;QACb,IAAI,OAAO,IAAI,cAAc,EAAE;YAC7B,cAAc,EAAE;iBACb,IAAI,CAAC,CAAC,GAAG,EAAE,EAAE;gBACZ,IAAI,CAAA,GAAG,aAAH,GAAG,uBAAH,GAAG,CAAE,OAAO,MAAI,GAAG,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AC,uBAAa,IACZ,OAAO,EAAE,OAAO,EAChB,UAAU,EAAE,UAAU,EACtB,SAAS,EAAE,SAAS,EACpB,aAAa,EAAE,aAAa,IAAI,EAAE,EAClC,OAAO,EAAE,OAAO,IAAI,EAAE,EACtB,MAAM,EAAE,MAAM,IAAI,EAAE,EACpB,aAAa,EAAE,OAAO,EACtB,eAAe,EAAE,qBAAqB,EACtC,cAAc,EAAE,cAAc,EAC9B,UAAU,EAAE,UAAU,GACtB,CACE,CACP;QACA,YAAY,CACN,CACV,CAAC;AACJ,CAAC,CAAC,CAAC","sourcesContent":["import { WrapLocaleReceiver } from '../I18N';\nimport React, { useEffect, useState } from 'react';\nimport { Drawer, Spin, Ellipsis, message } from 'tntd';\nimport ReferenceInfo from '../ReferenceInfo';\nimport './index.less';\n\nexport default WrapLocaleReceiver((props) => {\n const {\n fetchReference,\n data = null,\n orgMap = {},\n appList = [],\n title,\n visible,\n onClose,\n emptyType,\n showPagination,\n destroyOnClose = true,\n jumpFun,\n iframeJump,\n I18N,\n customDrawer,\n onViewOpen,\n ...rest\n } = props;\n const [referenceData, setReferenceData] = useState(data);\n const [referenceLoad, setReferenceLoad] = useState(!data);\n useEffect(() => {\n if (visible && fetchReference) {\n fetchReference()\n .then((res) => {\n if (res?.success && res?.data) {\n setReferenceData(res?.data || []);\n }\n if (!res?.success) {\n message.error(res.message || I18N.referencedrawer.index.chaXunYinYongGuan);\n }\n })\n .finally(() => {\n setReferenceLoad(false);\n });\n }\n }, [visible,I18N, fetchReference]);\n\n const handleSetOtherVisible = (record) => {\n if (onViewOpen) {\n onViewOpen(record);\n }\n };\n\n return (\n <Drawer\n className=\"reference-drawer\"\n width={900}\n title={typeof title==='string' ? <Ellipsis title={title || ''}/>:title}\n onClose={onClose}\n visible={visible}\n destroyOnClose={destroyOnClose}\n showFooter={false}\n {...rest}\n >\n {referenceLoad && <Spin className=\"globalSpin\" tip={I18N.referencedrawer.index.chaXunZhong}>\n <div className=\"globalSpin-div\"></div>\n </Spin>}\n {!referenceLoad && (\n <div className=\"drawer-reference-body\">\n <ReferenceInfo\n jumpFun={jumpFun}\n iframeJump={iframeJump}\n emptyType={emptyType}\n referenceData={referenceData || []}\n appList={appList || []}\n orgMap={orgMap || {}}\n unmountHandle={onClose}\n setOtherVisible={handleSetOtherVisible}\n showPagination={showPagination}\n onViewOpen={onViewOpen}\n />\n </div>\n )}\n {customDrawer}\n </Drawer>\n );\n});\n"]}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/ReferenceDrawer/index.js"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,kCAA6C;AAC7C,+CAAmD;AACnD,+BAAuD;AACvD,qEAA6C;AAC7C,wBAAsB;AAEtB,kBAAe,IAAA,yBAAkB,EAAC,CAAC,KAAK,EAAE,EAAE;IAC1C,MAAM,EACJ,cAAc,EACd,IAAI,GAAG,IAAI,EACX,MAAM,GAAG,EAAE,EACX,OAAO,GAAG,EAAE,EACZ,KAAK,EACL,OAAO,EACP,OAAO,EACP,SAAS,EACT,cAAc,EACd,cAAc,GAAG,IAAI,EACrB,OAAO,EACP,UAAU,EACV,IAAI,EACJ,YAAY,EACZ,UAAU,KAER,KAAK,EADJ,IAAI,UACL,KAAK,EAjBH,8LAiBL,CAAQ,CAAC;IACV,MAAM,CAAC,aAAa,EAAE,gBAAgB,CAAC,GAAG,IAAA,gBAAQ,EAAC,IAAI,CAAC,CAAC;IACzD,MAAM,CAAC,aAAa,EAAE,gBAAgB,CAAC,GAAG,IAAA,gBAAQ,EAAC,CAAC,IAAI,CAAC,CAAC;IAC1D,IAAA,iBAAS,EAAC,GAAG,EAAE;QACb,IAAI,OAAO,IAAI,cAAc,EAAE;YAC7B,cAAc,EAAE;iBACb,IAAI,CAAC,CAAC,GAAG,EAAE,EAAE;gBACZ,IAAI,CAAA,GAAG,aAAH,GAAG,uBAAH,GAAG,CAAE,OAAO,MAAI,GAAG,aAAH,GAAG,uBAAH,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AE,EACtB,MAAM,EAAE,MAAM,IAAI,EAAE,EACpB,aAAa,EAAE,OAAO,EACtB,cAAc,EAAE,cAAc,EAC9B,UAAU,EAAE,UAAU,GACtB,CACE,CACP;QACA,YAAY,CACN,CACV,CAAC;AACJ,CAAC,CAAC,CAAC","sourcesContent":["import { WrapLocaleReceiver } from '../I18N';\nimport React, { useEffect, useState } from 'react';\nimport { Drawer, Spin, Ellipsis, message } from 'tntd';\nimport ReferenceInfo from '../ReferenceInfo';\nimport './index.less';\n\nexport default WrapLocaleReceiver((props) => {\n const {\n fetchReference,\n data = null,\n orgMap = {},\n appList = [],\n title,\n visible,\n onClose,\n emptyType,\n showPagination,\n destroyOnClose = true,\n jumpFun,\n iframeJump,\n I18N,\n customDrawer,\n onViewOpen,\n ...rest\n } = props;\n const [referenceData, setReferenceData] = useState(data);\n const [referenceLoad, setReferenceLoad] = useState(!data);\n useEffect(() => {\n if (visible && fetchReference) {\n fetchReference()\n .then((res) => {\n if (res?.success && res?.data) {\n setReferenceData(res?.data || []);\n }\n if (!res?.success) {\n message.error(res.message || I18N.referencedrawer.index.chaXunYinYongGuan);\n }\n })\n .finally(() => {\n setReferenceLoad(false);\n });\n }\n }, [visible,I18N, fetchReference]);\n\n return (\n <Drawer\n className=\"reference-drawer\"\n width={900}\n title={typeof title==='string' ? <Ellipsis title={title || ''}/>:title}\n onClose={onClose}\n visible={visible}\n destroyOnClose={destroyOnClose}\n showFooter={false}\n {...rest}\n >\n {referenceLoad && <Spin className=\"globalSpin\" tip={I18N.referencedrawer.index.chaXunZhong}>\n <div className=\"globalSpin-div\"></div>\n </Spin>}\n {!referenceLoad && (\n <div className=\"drawer-reference-body\">\n <ReferenceInfo\n jumpFun={jumpFun}\n iframeJump={iframeJump}\n emptyType={emptyType}\n referenceData={referenceData || []}\n appList={appList || []}\n orgMap={orgMap || {}}\n unmountHandle={onClose}\n showPagination={showPagination}\n onViewOpen={onViewOpen}\n />\n </div>\n )}\n {customDrawer}\n </Drawer>\n );\n});\n"]}
@@ -47,7 +47,6 @@ var _default = exports["default"] = (0, _I18N.WrapLocaleReceiver)(function (prop
47
47
  jumpFun = props.jumpFun,
48
48
  iframeJump = props.iframeJump,
49
49
  type = props.type,
50
- setOtherVisible = props.setOtherVisible,
51
50
  onViewOpen = props.onViewOpen,
52
51
  I18N = props.I18N;
53
52
  var paginationInfo = {
@@ -82,7 +81,7 @@ var _default = exports["default"] = (0, _I18N.WrapLocaleReceiver)(function (prop
82
81
  title: c == null ? void 0 : c.title,
83
82
  placement: "topLeft"
84
83
  }, c == null ? void 0 : c.title),
85
- width: referenceData.length > 4 ? '160px' : (1 / referenceData.length).toFixed(2) + "%",
84
+ width: columns.length > 4 ? '160px' : (1 / columns.length * 100).toFixed(2) + "%",
86
85
  ellipsis: true
87
86
  });
88
87
  if (from === 'ReferenceOnlineCheck' && c.dataIndex === 'status') {
@@ -125,7 +124,6 @@ var _default = exports["default"] = (0, _I18N.WrapLocaleReceiver)(function (prop
125
124
  }
126
125
  if (c.dataIndex === goName && record != null && record.goLink) {
127
126
  return /*#__PURE__*/_react["default"].createElement(_AHref["default"], {
128
- setOtherVisible: setOtherVisible,
129
127
  onViewOpen: onViewOpen,
130
128
  record: record,
131
129
  jumpFun: jumpFun,
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/ReferenceInfo/index.js"],"names":[],"mappings":";;;;;AAAA,kCAA6C;AAC7C,kDAA0B;AAC1B,+BAA0E;AAC1E,qDAA6B;AAC7B,wBAAsB;AAEtB,kBAAe,IAAA,yBAAkB,EAAC,CAAC,KAAK,EAAE,EAAE;IAC1C,MAAM,EACJ,IAAI,EACJ,aAAa,GAAG,EAAE,EAClB,MAAM,GAAG,EAAE,EACX,OAAO,GAAG,EAAE,EACZ,WAAW,GAAG,EAAE,EAChB,aAAa,EACb,UAAU,GAAG,EAAE,EACf,cAAc,GAAG,IAAI,EACrB,OAAO,EACP,UAAU,EACV,IAAI,EACJ,eAAe,EACf,U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M,IAAI,CAAC,EAAE,IAClC,CACH,CACG,CACP,CAAC;QACJ,CAAC,CAAC,CACE,CACP,CAAC;AACJ,CAAC,CAAC,CAAC","sourcesContent":["import { WrapLocaleReceiver } from '../I18N';\nimport React from 'react';\nimport { Tooltip, Icon, Table, Empty, Ellipsis, Tag, Title } from \"tntd\";\nimport AHref from '../AHref';\nimport './index.less';\n\nexport default WrapLocaleReceiver((props) => {\n const {\n from,\n referenceData = [],\n orgMap = {},\n appList = [],\n description = '',\n unmountHandle,\n imageStyle = {},\n showPagination = true,\n jumpFun,\n iframeJump,\n type,\n setOtherVisible,\n onViewOpen,\n I18N\n } = props;\n\n let paginationInfo = {\n pagination: {\n hideOnSinglePage: true,\n size: 'small',\n },\n };\n\n if (!showPagination) {\n paginationInfo = {\n pagination: false,\n };\n }\n return (\n <div className=\"reference-body\">\n {!referenceData?.length && (\n <Empty\n description={description || I18N.referenceinfo.index.zanWuShuJu}\n type={type || 'no-result'}\n imageStyle={{ marginTop: 120, ...imageStyle }}\n />\n )}\n {referenceData?.map((d, dIndex) => {\n const { columns, goName } = d || {};\n let renderColumns = [];\n if (columns?.length) {\n renderColumns = columns?.map((c, i) => {\n const newC = {\n ...c,\n title: (\n <Tooltip title={c?.title} placement=\"topLeft\">\n {c?.title}\n </Tooltip>\n ),\n width: referenceData.length > 4 ? '160px' : ( 1 / referenceData.length ).toFixed(2) + \"%\",\n ellipsis: true,\n };\n if (from === 'ReferenceOnlineCheck' && c.dataIndex === 'status') {\n newC.className = 'refer-warning-txt';\n }\n newC.render = (t, record) => {\n let content = t;\n if (c.dataIndex === 'org') {\n content = orgMap[t]?.name || t;\n }\n if (c.dataIndex === 'app') {\n content = appList.find((a) => a.key === t)?.name || t;\n }\n // 强弱引用\n let tagInfo = null;\n if (i === 0 && record?.referenceCheckType) {\n let checkObj;\n // 能进行下一步操作\n const isStrong = ['STRONG'].includes(record?.referenceCheckType);\n if (isStrong) {\n checkObj = {\n name: record?.referenceCheckTypeName || I18N.referenceinfo.index.qiangYinYong,\n color: 'red',\n };\n } else {\n checkObj = {\n name: record?.referenceCheckTypeName || I18N.referenceinfo.index.ruoYinYong,\n color: 'grey',\n };\n }\n tagInfo = checkObj ? (\n <Tag className={content?'tag-max-width':''} size=\"small\" color={checkObj.color}>\n {checkObj.name}\n </Tag>\n ) : null;\n }\n\n if (c.dataIndex === goName && record?.goLink) {\n return (\n <AHref setOtherVisible={setOtherVisible} onViewOpen={onViewOpen} record={record} jumpFun={jumpFun} iframeJump={iframeJump} href={record?.goLink} target=\"_blank\" unmountHandle={unmountHandle}>\n <Tooltip placement=\"topLeft\" title={<>{tagInfo}{content || '- -'}</>}>\n <div className=\"content-span\">\n {tagInfo}\n <div>{content || '- -'}</div>\n </div>\n </Tooltip>\n </AHref>\n );\n }\n if (c.dataIndex === goName) {\n return (\n <Ellipsis\n placement=\"topLeft\"\n copyable={true}\n title={content || '- -'}\n prefix={tagInfo}\n />\n );\n }\n return (\n <Tooltip placement=\"topLeft\" title={<>{tagInfo}{content || '- -'}</>}>\n <div className=\"content-span\">\n {tagInfo}\n <div>{content || '- -'}</div>\n </div>\n </Tooltip>\n );\n };\n\n return newC;\n });\n }\n return (\n <div className=\"reference-body-item\" key={dIndex}>\n <Title\n className=\"reference-body-title\"\n title={d?.title}\n tooltip={d?.title}\n subTitle={\n d?.tips && (\n <Tooltip title={d?.tips} placement=\"topLeft\">\n <Icon type=\"info-circle\" />\n </Tooltip>\n )\n }\n />\n\n {renderColumns?.length && (\n <Table\n bordered\n className=\"reference-table\"\n striped={true}\n dataSource={d?.rows}\n columns={renderColumns}\n scroll={\n renderColumns.length > 4\n ? {\n x: renderColumns.length * 160,\n }\n : {}\n }\n {...paginationInfo}\n rowKey={(e, i) => `${dIndex}_${i}`}\n />\n )}\n </div>\n );\n })}\n </div>\n );\n});\n"]}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/ReferenceInfo/index.js"],"names":[],"mappings":";;;;;AAAA,kCAA6C;AAC7C,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OAAO,EAAE,IAAI,EACb,UAAU,EAAE,CAAC,aAAD,CAAC,uBAAD,CAAC,CAAE,IAAI,EACnB,OAAO,EAAE,aAAa,EACtB,MAAM,EACJ,aAAa,CAAC,MAAM,GAAG,CAAC;wBACtB,CAAC,CAAC;4BACE,CAAC,EAAE,aAAa,CAAC,MAAM,GAAG,GAAG;yBAC9B;wBACH,CAAC,CAAC,EAAE,IAEJ,cAAc,IAClB,MAAM,EAAE,CAAC,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC,GAAG,MAAM,IAAI,CAAC,EAAE,IAClC,CACH,CACG,CACP,CAAC;QACJ,CAAC,CAAC,CACE,CACP,CAAC;AACJ,CAAC,CAAC,CAAC","sourcesContent":["import { WrapLocaleReceiver } from '../I18N';\nimport React from 'react';\nimport { Tooltip, Icon, Table, Empty, Ellipsis, Tag, Title } from \"tntd\";\nimport AHref from '../AHref';\nimport './index.less';\n\nexport default WrapLocaleReceiver((props) => {\n const {\n from,\n referenceData = [],\n orgMap = {},\n appList = [],\n description = '',\n unmountHandle,\n imageStyle = {},\n showPagination = true,\n jumpFun,\n iframeJump,\n type,\n onViewOpen,\n I18N\n } = props;\n\n let paginationInfo = {\n pagination: {\n hideOnSinglePage: true,\n size: 'small',\n },\n };\n\n if (!showPagination) {\n paginationInfo = {\n pagination: false,\n };\n }\n return (\n <div className=\"reference-body\">\n {!referenceData?.length && (\n <Empty\n description={description || I18N.referenceinfo.index.zanWuShuJu}\n type={type || 'no-result'}\n imageStyle={{ marginTop: 120, ...imageStyle }}\n />\n )}\n {referenceData?.map((d, dIndex) => {\n const { columns, goName } = d || {};\n let renderColumns = [];\n if (columns?.length) {\n renderColumns = columns?.map((c, i) => {\n const newC = {\n ...c,\n title: (\n <Tooltip title={c?.title} placement=\"topLeft\">\n {c?.title}\n </Tooltip>\n ),\n width: columns.length > 4 ? '160px' : (( 1 / columns.length )*100).toFixed(2) + \"%\",\n ellipsis: true,\n };\n if (from === 'ReferenceOnlineCheck' && c.dataIndex === 'status') {\n newC.className = 'refer-warning-txt';\n }\n newC.render = (t, record) => {\n let content = t;\n if (c.dataIndex === 'org') {\n content = orgMap[t]?.name || t;\n }\n if (c.dataIndex === 'app') {\n content = appList.find((a) => a.key === t)?.name || t;\n }\n // 强弱引用\n let tagInfo = null;\n if (i === 0 && record?.referenceCheckType) {\n let checkObj;\n // 能进行下一步操作\n const isStrong = ['STRONG'].includes(record?.referenceCheckType);\n if (isStrong) {\n checkObj = {\n name: record?.referenceCheckTypeName || I18N.referenceinfo.index.qiangYinYong,\n color: 'red',\n };\n } else {\n checkObj = {\n name: record?.referenceCheckTypeName || I18N.referenceinfo.index.ruoYinYong,\n color: 'grey',\n };\n }\n tagInfo = checkObj ? (\n <Tag className={content?'tag-max-width':''} size=\"small\" color={checkObj.color}>\n {checkObj.name}\n </Tag>\n ) : null;\n }\n\n if (c.dataIndex === goName && record?.goLink) {\n return (\n <AHref onViewOpen={onViewOpen} record={record} jumpFun={jumpFun} iframeJump={iframeJump} href={record?.goLink} target=\"_blank\" unmountHandle={unmountHandle}>\n <Tooltip placement=\"topLeft\" title={<>{tagInfo}{content || '- -'}</>}>\n <div className=\"content-span\">\n {tagInfo}\n <div>{content || '- -'}</div>\n </div>\n </Tooltip>\n </AHref>\n );\n }\n if (c.dataIndex === goName) {\n return (\n <Ellipsis\n placement=\"topLeft\"\n copyable={true}\n title={content || '- -'}\n prefix={tagInfo}\n />\n );\n }\n return (\n <Tooltip placement=\"topLeft\" title={<>{tagInfo}{content || '- -'}</>}>\n <div className=\"content-span\">\n {tagInfo}\n <div>{content || '- -'}</div>\n </div>\n </Tooltip>\n );\n };\n\n return newC;\n });\n }\n return (\n <div className=\"reference-body-item\" key={dIndex}>\n <Title\n className=\"reference-body-title\"\n title={d?.title}\n tooltip={d?.title}\n subTitle={\n d?.tips && (\n <Tooltip title={d?.tips} placement=\"topLeft\">\n <Icon type=\"info-circle\" />\n </Tooltip>\n )\n }\n />\n\n {renderColumns?.length && (\n <Table\n bordered\n className=\"reference-table\"\n striped={true}\n dataSource={d?.rows}\n columns={renderColumns}\n scroll={\n renderColumns.length > 4\n ? {\n x: renderColumns.length * 160,\n }\n : {}\n }\n {...paginationInfo}\n rowKey={(e, i) => `${dIndex}_${i}`}\n />\n )}\n </div>\n );\n })}\n </div>\n );\n});\n"]}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tntd/reference",
3
- "version": "1.2.5",
3
+ "version": "1.2.7",
4
4
  "license": "MIT",
5
5
  "scripts": {
6
6
  "start": "heft start --storybook",
@@ -89,4 +89,4 @@
89
89
  "main": "es/index.js",
90
90
  "module": "es/index.js",
91
91
  "typings": "lib/index.d.ts"
92
- }
92
+ }
@@ -2,14 +2,27 @@ import React from 'react';
2
2
  import { WrapLocaleReceiver } from '../I18N';
3
3
  import { HandleIcon,Icon } from 'tntd';
4
4
  export default WrapLocaleReceiver((props) => {
5
- const { record,onViewOpen,setOtherVisible, children, href, unmountHandle, jumpFun, iframeJump, Com, I18N, ...rest } = props;
5
+ const { record, onViewOpen, children, href, unmountHandle, jumpFun, iframeJump, Com, I18N, ...rest } = props;
6
+ const isInIframe = window?.self !== window?.top;
6
7
  if(onViewOpen && record?.canJump){
7
8
  return (
8
9
  <HandleIcon className="custom-class" num={2}>
9
10
  <HandleIcon.Item title={I18N.referenceinfo.index.xiangqing} desc={I18N.referenceinfo.index.xiangqing}>
10
11
  <Icon type="profile" onClick={()=>{
11
- const url = window.location.host + record?.goLink;
12
- window.parent.open(url);
12
+ const url = window.location.origin + record?.goLink;
13
+ if(isInIframe){
14
+ let pathName = url;
15
+ if (url && url.includes('?')) {
16
+ pathName = url?.split('?')[0];
17
+ }
18
+ if (pathName === window.location.pathname) {
19
+ window.parent.location.href = url;
20
+ } else {
21
+ window.parent.open(url);
22
+ }
23
+ return
24
+ }
25
+ window.location.href = url;
13
26
  }}></Icon>
14
27
  </HandleIcon.Item>
15
28
  </HandleIcon>
@@ -18,9 +31,7 @@ export default WrapLocaleReceiver((props) => {
18
31
  return (
19
32
  <HandleIcon className="custom-class" num={2}>
20
33
  <HandleIcon.Item title={I18N.referenceinfo.index.xiangqing} desc={I18N.referenceinfo.index.xiangqing}>
21
- <Icon type="profile" onClick={()=>{
22
- setOtherVisible(record);
23
- }}></Icon>
34
+ <Icon type="profile" onClick={()=>onViewOpen(record)}></Icon>
24
35
  </HandleIcon.Item>
25
36
  </HandleIcon>
26
37
  )}
@@ -40,7 +51,6 @@ export default WrapLocaleReceiver((props) => {
40
51
  jumpFun(href);
41
52
  return
42
53
  }
43
- const isInIframe = window?.self !== window?.top;
44
54
  if(iframeJump && isInIframe){
45
55
  if (pathName === window.location.pathname) {
46
56
  window.parent.location.href = href;
@@ -49,11 +59,7 @@ export default WrapLocaleReceiver((props) => {
49
59
  }
50
60
  return
51
61
  }
52
- // if (pathName === window.location.pathname) {
53
- window.location.href = href;
54
- // } else {
55
- // window.push(href);
56
- // }
62
+ window.location.href = href;
57
63
  }}
58
64
  >
59
65
  {children}
@@ -42,12 +42,6 @@ export default WrapLocaleReceiver((props) => {
42
42
  }
43
43
  }, [visible,I18N, fetchReference]);
44
44
 
45
- const handleSetOtherVisible = (record) => {
46
- if (onViewOpen) {
47
- onViewOpen(record);
48
- }
49
- };
50
-
51
45
  return (
52
46
  <Drawer
53
47
  className="reference-drawer"
@@ -72,7 +66,6 @@ export default WrapLocaleReceiver((props) => {
72
66
  appList={appList || []}
73
67
  orgMap={orgMap || {}}
74
68
  unmountHandle={onClose}
75
- setOtherVisible={handleSetOtherVisible}
76
69
  showPagination={showPagination}
77
70
  onViewOpen={onViewOpen}
78
71
  />
@@ -17,7 +17,6 @@ export default WrapLocaleReceiver((props) => {
17
17
  jumpFun,
18
18
  iframeJump,
19
19
  type,
20
- setOtherVisible,
21
20
  onViewOpen,
22
21
  I18N
23
22
  } = props;
@@ -55,7 +54,7 @@ export default WrapLocaleReceiver((props) => {
55
54
  {c?.title}
56
55
  </Tooltip>
57
56
  ),
58
- width: referenceData.length > 4 ? '160px' : ( 1 / referenceData.length ).toFixed(2) + "%",
57
+ width: columns.length > 4 ? '160px' : (( 1 / columns.length )*100).toFixed(2) + "%",
59
58
  ellipsis: true,
60
59
  };
61
60
  if (from === 'ReferenceOnlineCheck' && c.dataIndex === 'status') {
@@ -95,7 +94,7 @@ export default WrapLocaleReceiver((props) => {
95
94
 
96
95
  if (c.dataIndex === goName && record?.goLink) {
97
96
  return (
98
- <AHref setOtherVisible={setOtherVisible} onViewOpen={onViewOpen} record={record} jumpFun={jumpFun} iframeJump={iframeJump} href={record?.goLink} target="_blank" unmountHandle={unmountHandle}>
97
+ <AHref onViewOpen={onViewOpen} record={record} jumpFun={jumpFun} iframeJump={iframeJump} href={record?.goLink} target="_blank" unmountHandle={unmountHandle}>
99
98
  <Tooltip placement="topLeft" title={<>{tagInfo}{content || '- -'}</>}>
100
99
  <div className="content-span">
101
100
  {tagInfo}