@tntd/reference 1.0.3 → 1.0.4

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
@@ -1,48 +1,62 @@
1
- var __rest = (this && this.__rest) || function (s, e) {
2
- var t = {};
3
- for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
4
- t[p] = s[p];
5
- if (s != null && typeof Object.getOwnPropertySymbols === "function")
6
- for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
7
- if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
8
- t[p[i]] = s[p[i]];
9
- }
10
- return t;
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.default = void 0;
7
+ var _react = _interopRequireDefault(require("react"));
8
+ function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
9
+ var __rest = void 0 && (void 0).__rest || function (s, e) {
10
+ var t = {};
11
+ for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0) t[p] = s[p];
12
+ if (s != null && typeof Object.getOwnPropertySymbols === "function") for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
13
+ if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i])) t[p[i]] = s[p[i]];
14
+ }
15
+ return t;
11
16
  };
12
- export default (props) => {
13
- const { children, href, unmountHandle, jumpFun, iframeJump } = props, rest = __rest(props, ["children", "href", "unmountHandle", "jumpFun", "iframeJump"]);
14
- if (window.__isMultiTab__) {
15
- return (React.createElement("a", { onClick: (evt) => {
16
- evt.preventDefault();
17
- if (unmountHandle && typeof unmountHandle === 'function') {
18
- unmountHandle();
19
- }
20
- let pathName = href;
21
- if (href && href.includes('?')) {
22
- pathName = href === null || href === void 0 ? void 0 : href.split('?')[0];
23
- }
24
- if (jumpFun && typeof jumpFun === 'function') {
25
- jumpFun(href);
26
- return;
27
- }
28
- const isInIframe = (window === null || window === void 0 ? void 0 : window.self) !== (window === null || window === void 0 ? void 0 : window.top);
29
- if (iframeJump && isInIframe) {
30
- if (pathName === window.location.pathname) {
31
- window.parent.location.href = href;
32
- }
33
- else {
34
- window.parent.open(href);
35
- }
36
- return;
37
- }
38
- if (pathName === window.location.pathname) {
39
- window.location.href = href;
40
- }
41
- else {
42
- window.push(href);
43
- }
44
- } }, children));
45
- }
46
- return (React.createElement("a", Object.assign({ href: href }, rest), children));
17
+ var _default = props => {
18
+ const {
19
+ children,
20
+ href,
21
+ unmountHandle,
22
+ jumpFun,
23
+ iframeJump
24
+ } = props,
25
+ rest = __rest(props, ["children", "href", "unmountHandle", "jumpFun", "iframeJump"]);
26
+ if (window.__isMultiTab__) {
27
+ return _react.default.createElement("a", {
28
+ onClick: evt => {
29
+ evt.preventDefault();
30
+ if (unmountHandle && typeof unmountHandle === 'function') {
31
+ unmountHandle();
32
+ }
33
+ let pathName = href;
34
+ if (href && href.includes('?')) {
35
+ pathName = href === null || href === void 0 ? void 0 : href.split('?')[0];
36
+ }
37
+ if (jumpFun && typeof jumpFun === 'function') {
38
+ jumpFun(href);
39
+ return;
40
+ }
41
+ const isInIframe = (window === null || window === void 0 ? void 0 : window.self) !== (window === null || window === void 0 ? void 0 : window.top);
42
+ if (iframeJump && isInIframe) {
43
+ if (pathName === window.location.pathname) {
44
+ window.parent.location.href = href;
45
+ } else {
46
+ window.parent.open(href);
47
+ }
48
+ return;
49
+ }
50
+ if (pathName === window.location.pathname) {
51
+ window.location.href = href;
52
+ } else {
53
+ window.push(href);
54
+ }
55
+ }
56
+ }, children);
57
+ }
58
+ return _react.default.createElement("a", Object.assign({
59
+ href: href
60
+ }, rest), children);
47
61
  };
48
- //# sourceMappingURL=index.js.map
62
+ exports.default = _default;
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/AHref/index.js"],"names":[],"mappings":";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AC,IAAI,GAAG,IAAI,CAAC;iBAC/B;qBAAM;oBACH,MAAM,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;iBACrB;YACL,CAAC,IAEA,QAAQ,CACP,CACL,CAAC;KACH;IACD,OAAO,CACL,yCAAG,IAAI,EAAE,IAAI,IAAM,IAAI,GACpB,QAAQ,CACP,CACL,CAAC;AACJ,CAAC,CAAC","sourcesContent":["export default (props) => {\n const { children, href, unmountHandle, jumpFun, iframeJump,...rest } = props;\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,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,eAAe,CAAC,KAAK,EAAE,EAAE;IACvB,MAAM,EAAE,QAAQ,EAAE,IAAI,EAAE,aAAa,EAAE,OAAO,EAAE,UAAU,KAAa,KAAK,EAAd,IAAI,UAAK,KAAK,EAAtE,8DAA8D,CAAQ,CAAC;IAC7E,IAAI,MAAM,CAAC,cAAc,EAAE;QACzB,OAAO,CACL,2BACE,OAAO,EAAE,CAAC,GAAG,EAAE,EAAE;gBACb,GAAG,CAAC,cAAc,EAAE,CAAC;gBACrB,IAAI,aAAa,IAAI,OAAO,aAAa,KAAK,UAAU,EAAE;oBACtD,aAAa,EAAE,CAAC;iBACnB;gBACD,IAAI,QAAQ,GAAG,IAAI,CAAC;gBACpB,IAAI,IAAI,IAAI,IAAI,CAAC,QAAQ,CAAC,GAAG,CAAC,EAAE;oBAC5B,QAAQ,GAAG,IAAI,aAAJ,IAAI,uBAAJ,IAAI,CAAE,KAAK,CAAC,GAAG,EAAE,CAAC,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,IAAI,QAAQ,KAAK,MAAM,CAAC,QAAQ,CAAC,QAAQ,EAAE;oBACvC,MAAM,CAAC,QAAQ,CAAC,IAAI,GAAG,IAAI,CAAC;iBAC/B;qBAAM;oBACH,MAAM,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;iBACrB;YACL,CAAC,IAEA,QAAQ,CACP,CACL,CAAC;KACH;IACD,OAAO,CACL,yCAAG,IAAI,EAAE,IAAI,IAAM,IAAI,GACpB,QAAQ,CACP,CACL,CAAC;AACJ,CAAC,CAAC","sourcesContent":["import React from 'react';\nexport default (props) => {\n const { children, href, unmountHandle, jumpFun, iframeJump,...rest } = props;\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"]}
package/es/I18N.js CHANGED
@@ -1,14 +1,21 @@
1
- import KiwiIntl from 'otp-intl';
2
- import Cookies from 'universal-cookie';
3
- import zhCN from '../.octopus/zh-CN';
4
- import enUS from '../.octopus/en-US';
5
- const cookies = new Cookies();
6
- export const getLang = () => {
7
- return cookies.get('lang') || 'cn';
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.getLang = exports.default = void 0;
7
+ var _otpIntl = _interopRequireDefault(require("otp-intl"));
8
+ var _universalCookie = _interopRequireDefault(require("universal-cookie"));
9
+ var _zhCN = _interopRequireDefault(require("../.octopus/zh-CN"));
10
+ var _enUS = _interopRequireDefault(require("../.octopus/en-US"));
11
+ function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
12
+ const cookies = new _universalCookie.default();
13
+ const getLang = () => {
14
+ return cookies.get('lang') || 'cn';
8
15
  };
9
- const kiwiIntl = KiwiIntl.init(getLang(), {
10
- cn: zhCN,
11
- en: enUS
16
+ exports.getLang = getLang;
17
+ const kiwiIntl = _otpIntl.default.init(getLang(), {
18
+ cn: _zhCN.default,
19
+ en: _enUS.default
12
20
  });
13
- export default kiwiIntl;
14
- //# sourceMappingURL=I18N.js.map
21
+ var _default = exports.default = kiwiIntl;
@@ -1,89 +1,163 @@
1
- import I18N from '../I18N';
2
- import ReactDOM from 'react-dom';
3
- import { Modal, Button, Collapse, message, Tag, Tooltip, Icon, Alert } from "tntd";
4
- import ReferenceInfo from '../ReferenceInfo';
5
- import './index.less';
6
- const { Panel } = Collapse;
7
- export default (props) => {
8
- const { title = (React.createElement(React.Fragment, null,
9
- React.createElement(Icon, { type: "warning", style: { marginRight: '4px', color: '#EF6555' } }),
10
- I18N.referencebatchcheck.index.shangXianJiaoYanShi)), rq, checkReferResponse, showPagination, destroyOnClose = true, orgMap = {}, appList = [], value = undefined, onChange = () => { }, cancelText, okText, emptyType, weakMsg = I18N.referencebatchcheck.index.cunZaiRuoYinYong, strongMsg = I18N.referencebatchcheck.index.cunZaiQiangYinYong, jumpFun } = props || {};
11
- const appendModal = (reject, resolve, referenceData = []) => {
12
- let type = '';
13
- if (!Array.isArray(referenceData) && (referenceData === null || referenceData === void 0 ? void 0 : referenceData.type)) {
14
- type = referenceData === null || referenceData === void 0 ? void 0 : referenceData.type;
15
- referenceData = (referenceData === null || referenceData === void 0 ? void 0 : referenceData.result) || [];
16
- }
17
- const modalWrap = document.createElement('div');
18
- modalWrap.setAttribute('id', 'tddc-reference-online-check-modal');
19
- const removeModal = () => {
20
- var _a;
21
- const tddcModal = document.querySelectorAll('#tddc-reference-online-check-modal');
22
- if (tddcModal) {
23
- tddcModal.forEach((ele) => { var _a; return (_a = ele === null || ele === void 0 ? void 0 : ele.parentNode) === null || _a === void 0 ? void 0 : _a.removeChild(ele); });
24
- }
25
- modalWrap && ((_a = modalWrap === null || modalWrap === void 0 ? void 0 : modalWrap.parentNode) === null || _a === void 0 ? void 0 : _a.removeChild(modalWrap));
26
- !type && reject && reject(referenceData);
27
- if (document.body.getAttribute('style')) {
28
- document.body.removeAttribute('style');
29
- }
30
- };
31
- removeModal();
32
- document.body.appendChild(modalWrap);
33
- // 能进行下一步操作
34
- const canNextOpera = !!type && !['STRONG'].includes(type);
35
- ReactDOM.render(React.createElement(Modal, { title: title, visible: true, width: 1000, destroyOnClose: destroyOnClose, getContainer: modalWrap, onCancel: removeModal, footer: [
36
- React.createElement(Button, { key: "back", onClick: removeModal }, cancelText || I18N.referencebatchcheck.index.quXiao),
37
- canNextOpera && (React.createElement(Button, { key: "submit", type: "primary", onClick: () => {
38
- removeModal();
39
- resolve(type);
40
- } }, okText || I18N.referencebatchcheck.index.xiaYiBu)),
41
- ] },
42
- React.createElement("div", { className: "reference-online-check-modal" },
43
- !!type && canNextOpera && (React.createElement("div", { className: "mb16" },
44
- React.createElement(Alert, { type: "warning", message: weakMsg || (referenceData === null || referenceData === void 0 ? void 0 : referenceData.message) || I18N.referencebatchcheck.index.cunZaiRuoYinYong }))),
45
- !!type && !canNextOpera && (React.createElement("div", { className: "mb16" },
46
- React.createElement(Alert, { type: "error", message: strongMsg || (referenceData === null || referenceData === void 0 ? void 0 : referenceData.message) || I18N.referencebatchcheck.index.cunZaiQiangYinYong }))),
47
- React.createElement(Collapse, { defaultActiveKey: value || [0], onChange: onChange }, referenceData === null || referenceData === void 0 ? void 0 : referenceData.map((d, i) => {
48
- let headerTxt = d === null || d === void 0 ? void 0 : d.componentName;
49
- if (d === null || d === void 0 ? void 0 : d.componentCode) {
50
- headerTxt += `[${d === null || d === void 0 ? void 0 : d.componentCode}]`;
51
- }
52
- return (React.createElement(Panel, { header: React.createElement("div", { className: "refer-panel-head" },
53
- React.createElement(Tooltip, { title: headerTxt, placement: "topLeft" },
54
- React.createElement("span", null, headerTxt)),
55
- (d === null || d === void 0 ? void 0 : d.componentVersion) && (React.createElement(Tag, { size: "small", color: "tnt-purple" },
56
- "V", d === null || d === void 0 ? void 0 :
57
- d.componentVersion)),
58
- (d === null || d === void 0 ? void 0 : d.type) === 'STRONG' && (React.createElement(Tag, { color: "red", size: "small" },
59
- I18N.referencebatchcheck.index.cunZai,
60
- (d === null || d === void 0 ? void 0 : d.typeName) || I18N.referencebatchcheck.index.qiangYinYong))), key: i },
61
- React.createElement(ReferenceInfo, { jumpFun: jumpFun, emptyType: emptyType, from: "ReferenceBatchCheck", unmountHandle: removeModal, referenceData: (d === null || d === void 0 ? void 0 : d.result) || [], orgMap: orgMap, appList: appList, showPagination: showPagination })));
62
- })))), modalWrap);
63
- };
64
- if (rq && typeof rq === 'function') {
65
- return new Promise((resolve, reject) => {
66
- return rq().then((res) => {
67
- const { success, data } = res || {};
68
- if (success) {
69
- if (Array.isArray(data) && !!(data === null || data === void 0 ? void 0 : data.length)) {
70
- appendModal(reject, resolve, data);
71
- }
72
- else if (!Array.isArray(data) && (data === null || data === void 0 ? void 0 : data.type) !== 'NO_EXIST') {
73
- appendModal(reject, resolve, data);
74
- }
75
- else {
76
- resolve(data);
77
- }
78
- }
79
- else {
80
- reject(I18N.referencebatchcheck.index.chaXunGuanLianGuan);
81
- }
82
- });
83
- });
84
- }
85
- else {
86
- message.error(I18N.referencebatchcheck.index.qingTiGongYiGe);
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.default = void 0;
7
+ var _message2 = _interopRequireDefault(require("tntd/es/message"));
8
+ var _tag = _interopRequireDefault(require("tntd/es/tag"));
9
+ var _tooltip = _interopRequireDefault(require("tntd/es/tooltip"));
10
+ var _alert = _interopRequireDefault(require("tntd/es/alert"));
11
+ var _button = _interopRequireDefault(require("tntd/es/button"));
12
+ var _modal = _interopRequireDefault(require("tntd/es/modal"));
13
+ var _icon = _interopRequireDefault(require("tntd/es/icon"));
14
+ var _collapse = _interopRequireDefault(require("tntd/es/collapse"));
15
+ var _I18N = _interopRequireDefault(require("../I18N"));
16
+ var _reactDom = _interopRequireDefault(require("react-dom"));
17
+ var _ReferenceInfo = _interopRequireDefault(require("../ReferenceInfo"));
18
+ require("./index.less");
19
+ function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
20
+ const {
21
+ Panel
22
+ } = _collapse.default;
23
+ var _default = props => {
24
+ const {
25
+ title = React.createElement(React.Fragment, null, React.createElement(_icon.default, {
26
+ type: "warning",
27
+ style: {
28
+ marginRight: '4px',
29
+ color: '#EF6555'
30
+ }
31
+ }), _I18N.default.referencebatchcheck.index.shangXianJiaoYanShi),
32
+ rq,
33
+ checkReferResponse,
34
+ showPagination,
35
+ destroyOnClose = true,
36
+ orgMap = {},
37
+ appList = [],
38
+ value = undefined,
39
+ onChange = () => {},
40
+ cancelText,
41
+ okText,
42
+ emptyType,
43
+ weakMsg = _I18N.default.referencebatchcheck.index.cunZaiRuoYinYong,
44
+ strongMsg = _I18N.default.referencebatchcheck.index.cunZaiQiangYinYong,
45
+ jumpFun
46
+ } = props || {};
47
+ const appendModal = function (reject, resolve) {
48
+ let referenceData = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : [];
49
+ let type = '';
50
+ if (!Array.isArray(referenceData) && (referenceData === null || referenceData === void 0 ? void 0 : referenceData.type)) {
51
+ type = referenceData === null || referenceData === void 0 ? void 0 : referenceData.type;
52
+ referenceData = (referenceData === null || referenceData === void 0 ? void 0 : referenceData.result) || [];
87
53
  }
54
+ const modalWrap = document.createElement('div');
55
+ modalWrap.setAttribute('id', 'tddc-reference-online-check-modal');
56
+ const removeModal = () => {
57
+ var _a;
58
+ const tddcModal = document.querySelectorAll('#tddc-reference-online-check-modal');
59
+ if (tddcModal) {
60
+ tddcModal.forEach(ele => {
61
+ var _a;
62
+ return (_a = ele === null || ele === void 0 ? void 0 : ele.parentNode) === null || _a === void 0 ? void 0 : _a.removeChild(ele);
63
+ });
64
+ }
65
+ modalWrap && ((_a = modalWrap === null || modalWrap === void 0 ? void 0 : modalWrap.parentNode) === null || _a === void 0 ? void 0 : _a.removeChild(modalWrap));
66
+ !type && reject && reject(referenceData);
67
+ if (document.body.getAttribute('style')) {
68
+ document.body.removeAttribute('style');
69
+ }
70
+ };
71
+ removeModal();
72
+ document.body.appendChild(modalWrap);
73
+ // 能进行下一步操作
74
+ const canNextOpera = !!type && !['STRONG'].includes(type);
75
+ _reactDom.default.render(React.createElement(_modal.default, {
76
+ title: title,
77
+ visible: true,
78
+ width: 1000,
79
+ destroyOnClose: destroyOnClose,
80
+ getContainer: modalWrap,
81
+ onCancel: removeModal,
82
+ footer: [React.createElement(_button.default, {
83
+ key: "back",
84
+ onClick: removeModal
85
+ }, cancelText || _I18N.default.referencebatchcheck.index.quXiao), canNextOpera && React.createElement(_button.default, {
86
+ key: "submit",
87
+ type: "primary",
88
+ onClick: () => {
89
+ removeModal();
90
+ resolve(type);
91
+ }
92
+ }, okText || _I18N.default.referencebatchcheck.index.xiaYiBu)]
93
+ }, React.createElement("div", {
94
+ className: "reference-online-check-modal"
95
+ }, !!type && canNextOpera && React.createElement("div", {
96
+ className: "mb16"
97
+ }, React.createElement(_alert.default, {
98
+ type: "warning",
99
+ message: weakMsg || (referenceData === null || referenceData === void 0 ? void 0 : referenceData.message) || _I18N.default.referencebatchcheck.index.cunZaiRuoYinYong
100
+ })), !!type && !canNextOpera && React.createElement("div", {
101
+ className: "mb16"
102
+ }, React.createElement(_alert.default, {
103
+ type: "error",
104
+ message: strongMsg || (referenceData === null || referenceData === void 0 ? void 0 : referenceData.message) || _I18N.default.referencebatchcheck.index.cunZaiQiangYinYong
105
+ })), React.createElement(_collapse.default, {
106
+ defaultActiveKey: value || [0],
107
+ onChange: onChange
108
+ }, referenceData === null || referenceData === void 0 ? void 0 : referenceData.map((d, i) => {
109
+ let headerTxt = d === null || d === void 0 ? void 0 : d.componentName;
110
+ if (d === null || d === void 0 ? void 0 : d.componentCode) {
111
+ headerTxt += `[${d === null || d === void 0 ? void 0 : d.componentCode}]`;
112
+ }
113
+ return React.createElement(Panel, {
114
+ header: React.createElement("div", {
115
+ className: "refer-panel-head"
116
+ }, React.createElement(_tooltip.default, {
117
+ title: headerTxt,
118
+ placement: "topLeft"
119
+ }, React.createElement("span", null, headerTxt)), (d === null || d === void 0 ? void 0 : d.componentVersion) && React.createElement(_tag.default, {
120
+ size: "small",
121
+ color: "tnt-purple"
122
+ }, "V", d === null || d === void 0 ? void 0 : d.componentVersion), (d === null || d === void 0 ? void 0 : d.type) === 'STRONG' && React.createElement(_tag.default, {
123
+ color: "red",
124
+ size: "small"
125
+ }, _I18N.default.referencebatchcheck.index.cunZai, (d === null || d === void 0 ? void 0 : d.typeName) || _I18N.default.referencebatchcheck.index.qiangYinYong)),
126
+ key: i
127
+ }, React.createElement(_ReferenceInfo.default, {
128
+ jumpFun: jumpFun,
129
+ emptyType: emptyType,
130
+ from: "ReferenceBatchCheck",
131
+ unmountHandle: removeModal,
132
+ referenceData: (d === null || d === void 0 ? void 0 : d.result) || [],
133
+ orgMap: orgMap,
134
+ appList: appList,
135
+ showPagination: showPagination
136
+ }));
137
+ })))), modalWrap);
138
+ };
139
+ if (rq && typeof rq === 'function') {
140
+ return new Promise((resolve, reject) => {
141
+ return rq().then(res => {
142
+ const {
143
+ success,
144
+ data
145
+ } = res || {};
146
+ if (success) {
147
+ if (Array.isArray(data) && !!(data === null || data === void 0 ? void 0 : data.length)) {
148
+ appendModal(reject, resolve, data);
149
+ } else if (!Array.isArray(data) && (data === null || data === void 0 ? void 0 : data.type) !== 'NO_EXIST') {
150
+ appendModal(reject, resolve, data);
151
+ } else {
152
+ resolve(data);
153
+ }
154
+ } else {
155
+ reject(_I18N.default.referencebatchcheck.index.chaXunGuanLianGuan);
156
+ }
157
+ });
158
+ });
159
+ } else {
160
+ _message2.default.error(_I18N.default.referencebatchcheck.index.qingTiGongYiGe);
161
+ }
88
162
  };
89
- //# sourceMappingURL=index.js.map
163
+ exports.default = _default;
@@ -1,54 +1,116 @@
1
- var __rest = (this && this.__rest) || function (s, e) {
2
- var t = {};
3
- for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
4
- t[p] = s[p];
5
- if (s != null && typeof Object.getOwnPropertySymbols === "function")
6
- for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
7
- if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
8
- t[p[i]] = s[p[i]];
9
- }
10
- return t;
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.default = void 0;
7
+ var _empty = _interopRequireDefault(require("tntd/es/empty"));
8
+ var _tag = _interopRequireDefault(require("tntd/es/tag"));
9
+ var _tooltip = _interopRequireDefault(require("tntd/es/tooltip"));
10
+ var _spin = _interopRequireDefault(require("tntd/es/spin"));
11
+ var _drawer = _interopRequireDefault(require("tntd/es/drawer"));
12
+ var _message2 = _interopRequireDefault(require("tntd/es/message"));
13
+ var _collapse = _interopRequireDefault(require("tntd/es/collapse"));
14
+ var _I18N = _interopRequireDefault(require("../I18N"));
15
+ var _react = _interopRequireWildcard(require("react"));
16
+ var _ReferenceInfo = _interopRequireDefault(require("../ReferenceInfo"));
17
+ function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function (e) { return e ? t : r; })(e); }
18
+ function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && {}.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; }
19
+ function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
20
+ var __rest = void 0 && (void 0).__rest || function (s, e) {
21
+ var t = {};
22
+ for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0) t[p] = s[p];
23
+ if (s != null && typeof Object.getOwnPropertySymbols === "function") for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
24
+ if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i])) t[p[i]] = s[p[i]];
25
+ }
26
+ return t;
11
27
  };
12
- import I18N from '../I18N';
13
- import React, { useEffect, useState } from 'react';
14
- import { Drawer, Spin, Tooltip, message, Collapse, Tag, Empty } from "tntd";
15
- import ReferenceInfo from '../ReferenceInfo';
16
- const { Panel } = Collapse;
17
- export default (props) => {
18
- const { fetchReference, data = null, orgMap = {}, appList = [], title, visible, onClose, value = undefined, onChange = () => { }, emptyType, showPagination, destroyOnClose = true, jumpFun, iframeJump } = props, rest = __rest(props, ["fetchReference", "data", "orgMap", "appList", "title", "visible", "onClose", "value", "onChange", "emptyType", "showPagination", "destroyOnClose", "jumpFun", "iframeJump"]);
19
- const [referenceData, setReferenceData] = useState(data);
20
- const [referenceLoad, setReferenceLoad] = useState(!data);
21
- useEffect(() => {
22
- if (visible && fetchReference) {
23
- fetchReference()
24
- .then((res) => {
25
- if ((res === null || res === void 0 ? void 0 : res.success) && (res === null || res === void 0 ? void 0 : res.data)) {
26
- setReferenceData((res === null || res === void 0 ? void 0 : res.data) || []);
27
- }
28
- if (!(res === null || res === void 0 ? void 0 : res.success)) {
29
- message.error(res.message || I18N.referencebatchdrawer.index.chaXunYinYongGuan);
30
- }
31
- })
32
- .finally(() => {
33
- setReferenceLoad(false);
34
- });
28
+ const {
29
+ Panel
30
+ } = _collapse.default;
31
+ var _default = props => {
32
+ const {
33
+ fetchReference,
34
+ data = null,
35
+ orgMap = {},
36
+ appList = [],
37
+ title,
38
+ visible,
39
+ onClose,
40
+ value = undefined,
41
+ onChange = () => {},
42
+ emptyType,
43
+ showPagination,
44
+ destroyOnClose = true,
45
+ jumpFun,
46
+ iframeJump
47
+ } = props,
48
+ rest = __rest(props, ["fetchReference", "data", "orgMap", "appList", "title", "visible", "onClose", "value", "onChange", "emptyType", "showPagination", "destroyOnClose", "jumpFun", "iframeJump"]);
49
+ const [referenceData, setReferenceData] = (0, _react.useState)(data);
50
+ const [referenceLoad, setReferenceLoad] = (0, _react.useState)(!data);
51
+ (0, _react.useEffect)(() => {
52
+ if (visible && fetchReference) {
53
+ fetchReference().then(res => {
54
+ if ((res === null || res === void 0 ? void 0 : res.success) && (res === null || res === void 0 ? void 0 : res.data)) {
55
+ setReferenceData((res === null || res === void 0 ? void 0 : res.data) || []);
56
+ }
57
+ if (!(res === null || res === void 0 ? void 0 : res.success)) {
58
+ _message2.default.error(res.message || _I18N.default.referencebatchdrawer.index.chaXunYinYongGuan);
35
59
  }
36
- }, [visible, fetchReference]);
37
- return (React.createElement(Drawer, Object.assign({ className: "reference-drawer", width: 650, title: React.createElement(Tooltip, { title: title }, title || ''), onClose: onClose, visible: visible, destroyOnClose: destroyOnClose }, rest),
38
- referenceLoad && React.createElement(Spin, { className: "globalSpin", tip: I18N.referencebatchdrawer.index.chaXunZhong }),
39
- (!referenceLoad && referenceData.length && (React.createElement("div", { className: "drawer-reference-body" },
40
- React.createElement(Collapse, { defaultActiveKey: value || [0], onChange: onChange }, referenceData === null || referenceData === void 0 ? void 0 : referenceData.map((d, i) => {
41
- let headerTxt = d === null || d === void 0 ? void 0 : d.componentName;
42
- if (d === null || d === void 0 ? void 0 : d.componentCode) {
43
- headerTxt += `[${d === null || d === void 0 ? void 0 : d.componentCode}]`;
44
- }
45
- return (React.createElement(Panel, { header: React.createElement("div", { className: "refer-panel-head" },
46
- React.createElement(Tooltip, { title: headerTxt, placement: "topLeft" },
47
- React.createElement("span", null, headerTxt)),
48
- (d === null || d === void 0 ? void 0 : d.componentVersion) && React.createElement(Tag, { color: "green" },
49
- "V", d === null || d === void 0 ? void 0 :
50
- d.componentVersion)), key: i },
51
- React.createElement(ReferenceInfo, { jumpFun: jumpFun, iframeJump: iframeJump, emptyType: emptyType, from: "ReferenceBatchCheck", unmountHandle: () => { }, referenceData: (d === null || d === void 0 ? void 0 : d.result) || [], orgMap: orgMap, appList: appList, showPagination: showPagination })));
52
- }))))) || (React.createElement(Empty, { description: I18N.referencebatchdrawer.index.zanWuShuJu, image: Empty.PRESENTED_IMAGE_SIMPLE, imageStyle: { marginTop: 120 } }))));
60
+ }).finally(() => {
61
+ setReferenceLoad(false);
62
+ });
63
+ }
64
+ }, [visible, fetchReference]);
65
+ return _react.default.createElement(_drawer.default, Object.assign({
66
+ className: "reference-drawer",
67
+ width: 650,
68
+ title: typeof title === 'string' ? _react.default.createElement(Ellipsis, {
69
+ title: title || ''
70
+ }) : title,
71
+ onClose: onClose,
72
+ visible: visible,
73
+ destroyOnClose: destroyOnClose
74
+ }, rest), referenceLoad && _react.default.createElement(_spin.default, {
75
+ className: "globalSpin",
76
+ tip: _I18N.default.referencebatchdrawer.index.chaXunZhong
77
+ }), !referenceLoad && referenceData.length && _react.default.createElement("div", {
78
+ className: "drawer-reference-body"
79
+ }, _react.default.createElement(_collapse.default, {
80
+ defaultActiveKey: value || [0],
81
+ onChange: onChange
82
+ }, referenceData === null || referenceData === void 0 ? void 0 : referenceData.map((d, i) => {
83
+ let headerTxt = d === null || d === void 0 ? void 0 : d.componentName;
84
+ if (d === null || d === void 0 ? void 0 : d.componentCode) {
85
+ headerTxt += `[${d === null || d === void 0 ? void 0 : d.componentCode}]`;
86
+ }
87
+ return _react.default.createElement(Panel, {
88
+ header: _react.default.createElement("div", {
89
+ className: "refer-panel-head"
90
+ }, _react.default.createElement(_tooltip.default, {
91
+ title: headerTxt,
92
+ placement: "topLeft"
93
+ }, _react.default.createElement("span", null, headerTxt)), (d === null || d === void 0 ? void 0 : d.componentVersion) && _react.default.createElement(_tag.default, {
94
+ color: "green"
95
+ }, "V", d === null || d === void 0 ? void 0 : d.componentVersion)),
96
+ key: i
97
+ }, _react.default.createElement(_ReferenceInfo.default, {
98
+ jumpFun: jumpFun,
99
+ iframeJump: iframeJump,
100
+ emptyType: emptyType,
101
+ from: "ReferenceBatchCheck",
102
+ unmountHandle: () => {},
103
+ referenceData: (d === null || d === void 0 ? void 0 : d.result) || [],
104
+ orgMap: orgMap,
105
+ appList: appList,
106
+ showPagination: showPagination
107
+ }));
108
+ }))) || _react.default.createElement(_empty.default, {
109
+ description: _I18N.default.referencebatchdrawer.index.zanWuShuJu,
110
+ image: _empty.default.PRESENTED_IMAGE_SIMPLE,
111
+ imageStyle: {
112
+ marginTop: 120
113
+ }
114
+ }));
53
115
  };
54
- //# sourceMappingURL=index.js.map
116
+ exports.default = _default;
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/ReferenceBatchDrawer/index.js"],"names":[],"mappings":";;;;;;;;;;;AAAA,OAAO,IAAI,MAAM,SAAS,CAAC;AAC3B,OAAO,KAAK,EAAE,EAAE,SAAS,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AACnD,OAAO,EAAE,MAAM,EAAE,IAAI,EAAE,OAAO,EAAE,OAAO,EAAE,QAAQ,EAAE,GAAG,EAAE,KAAK,EAAE,MAAM,MAAM,CAAC;AAC5E,OAAQ,aAAa,MAAO,kBAAkB,CAAC;AAE/C,MAAM,EAAE,KAAK,EAAE,GAAG,QAAQ,CAAC;AAE3B,eAAe,CAAC,KAAK,EAAE,EAAE;IACvB,MAAM,EACJ,cAAc,EACd,IAAI,GAAG,IAAI,EACX,MAAM,GAAG,EAAE,EACX,OAAO,GAAG,EAAE,EACZ,KAAK,EACL,OAAO,EACP,OAAO,EACP,KAAK,GAAG,SAAS,EACjB,QAAQ,GAAG,GAAG,EAAE,GAAE,CAAC,EACnB,SAAS,EACT,cAAc,EACd,cAAc,GAAG,IAAI,EACrB,OAAO,EACP,UAAU,KAER,KAAK,EADJ,IAAI,UACL,KAAK,EAhBH,6KAgBL,CAAQ,CAAC;IACV,MAAM,CAAC,aAAa,EAAE,gBAAgB,CAAC,GAAG,QAAQ,CAAC,IAAI,CAAC,CAAC;IACzD,MAAM,CAAC,aAAa,EAAE,gBAAgB,CAAC,GAAG,QAAQ,CAAC,CAAC,IAAI,CAAC,CAAC;IAC1D,SAAS,CAAC,GAAG,EAAE;QACb,IAAI,OAAO,IAAI,cAAc,EAAE;YAC7B,cAAc,EAAE;iBACb,IAAI,CAAC,CAAC,GAAG,EAAE,EAAE;gBACZ,IAAI,CAAA,GAAG,a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from 'react';\nimport { Drawer, Spin, Tooltip, message, Collapse, Tag, Empty } from \"tntd\";\nimport ReferenceInfo from '../ReferenceInfo';\n\nconst { Panel } = Collapse;\n\nexport default (props) => {\n const {\n fetchReference,\n data = null,\n orgMap = {},\n appList = [],\n title,\n visible,\n onClose,\n value = undefined,\n onChange = () => {},\n emptyType,\n showPagination,\n destroyOnClose = true,\n jumpFun,\n iframeJump,\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.referencebatchdrawer.index.chaXunYinYongGuan); \n }\n })\n .finally(() => {\n setReferenceLoad(false);\n });\n }\n }, [visible, fetchReference]);\n\n return (\n <Drawer\n className=\"reference-drawer\"\n width={650}\n title={<Tooltip title={title}>{title || ''}</Tooltip>}\n onClose={onClose}\n visible={visible}\n destroyOnClose={destroyOnClose}\n {...rest}\n >\n {referenceLoad && <Spin className=\"globalSpin\" tip={I18N.referencebatchdrawer.index.chaXunZhong} />}\n {(!referenceLoad && referenceData.length && (\n <div className=\"drawer-reference-body\">\n <Collapse defaultActiveKey={value || [0]} onChange={onChange}>\n {referenceData?.map((d, i) => {\n let headerTxt = d?.componentName;\n if (d?.componentCode) {\n headerTxt += `[${d?.componentCode}]`;\n }\n return (\n <Panel\n header={\n <div className=\"refer-panel-head\">\n <Tooltip title={headerTxt} placement=\"topLeft\">\n <span>{headerTxt}</span>\n </Tooltip>\n {d?.componentVersion && <Tag color=\"green\">V{d?.componentVersion}</Tag>}\n </div>\n }\n key={i}\n >\n <ReferenceInfo\n jumpFun={jumpFun}\n iframeJump={iframeJump}\n emptyType={emptyType}\n from=\"ReferenceBatchCheck\"\n unmountHandle={() => {}}\n referenceData={d?.result || []}\n orgMap={orgMap}\n appList={appList}\n showPagination={showPagination}\n />\n </Panel>\n );\n })}\n </Collapse>\n </div>\n )) || (\n <Empty\n description={I18N.referencebatchdrawer.index.zanWuShuJu}\n image={Empty.PRESENTED_IMAGE_SIMPLE}\n imageStyle={{ marginTop: 120 }}\n />\n )}\n </Drawer>\n );\n};\n"]}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/ReferenceBatchDrawer/index.js"],"names":[],"mappings":";;;;;;;;;;;AAAA,OAAO,IAAI,MAAM,SAAS,CAAC;AAC3B,OAAO,KAAK,EAAE,EAAE,SAAS,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AACnD,OAAO,EAAE,MAAM,EAAE,IAAI,EAAE,OAAO,EAAE,OAAO,EAAE,QAAQ,EAAE,GAAG,EAAE,KAAK,EAAE,MAAM,MAAM,CAAC;AAC5E,OAAQ,aAAa,MAAO,kBAAkB,CAAC;AAE/C,MAAM,EAAE,KAAK,EAAE,GAAG,QAAQ,CAAC;AAE3B,eAAe,CAAC,KAAK,EAAE,EAAE;IACvB,MAAM,EACJ,cAAc,EACd,IAAI,GAAG,IAAI,EACX,MAAM,GAAG,EAAE,EACX,OAAO,GAAG,EAAE,EACZ,KAAK,EACL,OAAO,EACP,OAAO,EACP,KAAK,GAAG,SAAS,EACjB,QAAQ,GAAG,GAAG,EAAE,GAAE,CAAC,EACnB,SAAS,EACT,cAAc,EACd,cAAc,GAAG,IAAI,EACrB,OAAO,EACP,UAAU,KAER,KAAK,EADJ,IAAI,UACL,KAAK,EAhBH,6KAgBL,CAAQ,CAAC;IACV,MAAM,CAAC,aAAa,EAAE,gBAAgB,CAAC,GAAG,QAAQ,CAAC,IAAI,CAAC,CAAC;IACzD,MAAM,CAAC,aAAa,EAAE,gBAAgB,CAAC,GAAG,QAAQ,CAAC,CAAC,IAAI,CAAC,CAAC;IAC1D,SAAS,CAAC,GAAG,EAAE;QACb,IAAI,OAAO,IAAI,cAAc,EAAE;YAC7B,cAAc,EAAE;iBACb,IAAI,CAAC,CAAC,GAAG,EAAE,EAA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AC9B,CACH,CACM,CACV,CAAC;AACJ,CAAC,CAAC","sourcesContent":["import I18N from '../I18N';\nimport React, { useEffect, useState } from 'react';\nimport { Drawer, Spin, Tooltip, message, Collapse, Tag, Empty } from \"tntd\";\nimport ReferenceInfo from '../ReferenceInfo';\n\nconst { Panel } = Collapse;\n\nexport default (props) => {\n const {\n fetchReference,\n data = null,\n orgMap = {},\n appList = [],\n title,\n visible,\n onClose,\n value = undefined,\n onChange = () => {},\n emptyType,\n showPagination,\n destroyOnClose = true,\n jumpFun,\n iframeJump,\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.referencebatchdrawer.index.chaXunYinYongGuan);\n }\n })\n .finally(() => {\n setReferenceLoad(false);\n });\n }\n }, [visible, fetchReference]);\n\n return (\n <Drawer\n className=\"reference-drawer\"\n width={650}\n title={typeof title==='string' ? <Ellipsis title={title || ''}/>:title}\n onClose={onClose}\n visible={visible}\n destroyOnClose={destroyOnClose}\n {...rest}\n >\n {referenceLoad && <Spin className=\"globalSpin\" tip={I18N.referencebatchdrawer.index.chaXunZhong} />}\n {(!referenceLoad && referenceData.length && (\n <div className=\"drawer-reference-body\">\n <Collapse defaultActiveKey={value || [0]} onChange={onChange}>\n {referenceData?.map((d, i) => {\n let headerTxt = d?.componentName;\n if (d?.componentCode) {\n headerTxt += `[${d?.componentCode}]`;\n }\n return (\n <Panel\n header={\n <div className=\"refer-panel-head\">\n <Tooltip title={headerTxt} placement=\"topLeft\">\n <span>{headerTxt}</span>\n </Tooltip>\n {d?.componentVersion && <Tag color=\"green\">V{d?.componentVersion}</Tag>}\n </div>\n }\n key={i}\n >\n <ReferenceInfo\n jumpFun={jumpFun}\n iframeJump={iframeJump}\n emptyType={emptyType}\n from=\"ReferenceBatchCheck\"\n unmountHandle={() => {}}\n referenceData={d?.result || []}\n orgMap={orgMap}\n appList={appList}\n showPagination={showPagination}\n />\n </Panel>\n );\n })}\n </Collapse>\n </div>\n )) || (\n <Empty\n description={I18N.referencebatchdrawer.index.zanWuShuJu}\n image={Empty.PRESENTED_IMAGE_SIMPLE}\n imageStyle={{ marginTop: 120 }}\n />\n )}\n </Drawer>\n );\n};\n"]}