@icos-desktop/react-components 0.1.1 → 0.1.3
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/README.md +2 -0
- package/build/index.d.ts +19 -8
- package/build/index.js +1 -1058
- package/package.json +2 -2
package/README.md
CHANGED
package/build/index.d.ts
CHANGED
@@ -5,13 +5,6 @@ interface Config {
|
|
5
5
|
}
|
6
6
|
declare const configFn: (config: Config) => void;
|
7
7
|
|
8
|
-
interface TestComponentProps {
|
9
|
-
heading: string;
|
10
|
-
content: ReactNode;
|
11
|
-
}
|
12
|
-
|
13
|
-
declare const TestComponent: React.FC<TestComponentProps>;
|
14
|
-
|
15
8
|
interface CheckInfo {
|
16
9
|
info: {
|
17
10
|
selectSenseObjCodes?: string[];
|
@@ -32,4 +25,22 @@ interface EntityTreeProps {
|
|
32
25
|
|
33
26
|
declare const EntityTree: React.FC<EntityTreeProps>;
|
34
27
|
|
35
|
-
|
28
|
+
interface EntityInfoProps {
|
29
|
+
senseGlobalCode: string;
|
30
|
+
}
|
31
|
+
|
32
|
+
declare const EntityInfo: React.FC<EntityInfoProps>;
|
33
|
+
|
34
|
+
interface EntityTableProps {
|
35
|
+
bookId: string;
|
36
|
+
}
|
37
|
+
|
38
|
+
declare const EntityTable: React.FC<EntityTableProps>;
|
39
|
+
|
40
|
+
interface RegionTreeProps {
|
41
|
+
children?: ReactNode;
|
42
|
+
}
|
43
|
+
|
44
|
+
declare const RegionTree: React.FC<RegionTreeProps>;
|
45
|
+
|
46
|
+
export { EntityInfo, EntityTable, EntityTree, RegionTree, configFn as config };
|
package/build/index.js
CHANGED
@@ -1,1058 +1 @@
|
|
1
|
-
import * as React from 'react';
|
2
|
-
import React__default, { useState, useEffect } from 'react';
|
3
|
-
import { produce } from 'immer';
|
4
|
-
import Highlighter from 'react-highlight-words';
|
5
|
-
import { message, Spin, Tree, Popover } from 'antd';
|
6
|
-
import { LoadingOutlined } from '@ant-design/icons';
|
7
|
-
import axios from 'axios';
|
8
|
-
import { cloneDeep } from 'lodash';
|
9
|
-
|
10
|
-
/******************************************************************************
|
11
|
-
Copyright (c) Microsoft Corporation.
|
12
|
-
|
13
|
-
Permission to use, copy, modify, and/or distribute this software for any
|
14
|
-
purpose with or without fee is hereby granted.
|
15
|
-
|
16
|
-
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
|
17
|
-
REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
|
18
|
-
AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
|
19
|
-
INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
|
20
|
-
LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
|
21
|
-
OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
|
22
|
-
PERFORMANCE OF THIS SOFTWARE.
|
23
|
-
***************************************************************************** */
|
24
|
-
/* global Reflect, Promise, SuppressedError, Symbol */
|
25
|
-
|
26
|
-
|
27
|
-
var __assign = function() {
|
28
|
-
__assign = Object.assign || function __assign(t) {
|
29
|
-
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
30
|
-
s = arguments[i];
|
31
|
-
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p];
|
32
|
-
}
|
33
|
-
return t;
|
34
|
-
};
|
35
|
-
return __assign.apply(this, arguments);
|
36
|
-
};
|
37
|
-
|
38
|
-
function __rest(s, e) {
|
39
|
-
var t = {};
|
40
|
-
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
41
|
-
t[p] = s[p];
|
42
|
-
if (s != null && typeof Object.getOwnPropertySymbols === "function")
|
43
|
-
for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
44
|
-
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
|
45
|
-
t[p[i]] = s[p[i]];
|
46
|
-
}
|
47
|
-
return t;
|
48
|
-
}
|
49
|
-
|
50
|
-
function __awaiter(thisArg, _arguments, P, generator) {
|
51
|
-
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
52
|
-
return new (P || (P = Promise))(function (resolve, reject) {
|
53
|
-
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
54
|
-
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
55
|
-
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
56
|
-
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
57
|
-
});
|
58
|
-
}
|
59
|
-
|
60
|
-
function __generator(thisArg, body) {
|
61
|
-
var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
|
62
|
-
return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
|
63
|
-
function verb(n) { return function (v) { return step([n, v]); }; }
|
64
|
-
function step(op) {
|
65
|
-
if (f) throw new TypeError("Generator is already executing.");
|
66
|
-
while (g && (g = 0, op[0] && (_ = 0)), _) try {
|
67
|
-
if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
|
68
|
-
if (y = 0, t) op = [op[0] & 2, t.value];
|
69
|
-
switch (op[0]) {
|
70
|
-
case 0: case 1: t = op; break;
|
71
|
-
case 4: _.label++; return { value: op[1], done: false };
|
72
|
-
case 5: _.label++; y = op[1]; op = [0]; continue;
|
73
|
-
case 7: op = _.ops.pop(); _.trys.pop(); continue;
|
74
|
-
default:
|
75
|
-
if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
|
76
|
-
if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
|
77
|
-
if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
|
78
|
-
if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
|
79
|
-
if (t[2]) _.ops.pop();
|
80
|
-
_.trys.pop(); continue;
|
81
|
-
}
|
82
|
-
op = body.call(thisArg, _);
|
83
|
-
} catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
|
84
|
-
if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
|
85
|
-
}
|
86
|
-
}
|
87
|
-
|
88
|
-
function __spreadArray(to, from, pack) {
|
89
|
-
if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) {
|
90
|
-
if (ar || !(i in from)) {
|
91
|
-
if (!ar) ar = Array.prototype.slice.call(from, 0, i);
|
92
|
-
ar[i] = from[i];
|
93
|
-
}
|
94
|
-
}
|
95
|
-
return to.concat(ar || Array.prototype.slice.call(from));
|
96
|
-
}
|
97
|
-
|
98
|
-
typeof SuppressedError === "function" ? SuppressedError : function (error, suppressed, message) {
|
99
|
-
var e = new Error(message);
|
100
|
-
return e.name = "SuppressedError", e.error = error, e.suppressed = suppressed, e;
|
101
|
-
};
|
102
|
-
|
103
|
-
var configFn = function (config) {
|
104
|
-
window._ICOS_DESKTOP_ = __assign(__assign({}, window._ICOS_DESKTOP_), config);
|
105
|
-
};
|
106
|
-
|
107
|
-
function styleInject(css, ref) {
|
108
|
-
if ( ref === void 0 ) ref = {};
|
109
|
-
var insertAt = ref.insertAt;
|
110
|
-
|
111
|
-
if (!css || typeof document === 'undefined') { return; }
|
112
|
-
|
113
|
-
var head = document.head || document.getElementsByTagName('head')[0];
|
114
|
-
var style = document.createElement('style');
|
115
|
-
style.type = 'text/css';
|
116
|
-
|
117
|
-
if (insertAt === 'top') {
|
118
|
-
if (head.firstChild) {
|
119
|
-
head.insertBefore(style, head.firstChild);
|
120
|
-
} else {
|
121
|
-
head.appendChild(style);
|
122
|
-
}
|
123
|
-
} else {
|
124
|
-
head.appendChild(style);
|
125
|
-
}
|
126
|
-
|
127
|
-
if (style.styleSheet) {
|
128
|
-
style.styleSheet.cssText = css;
|
129
|
-
} else {
|
130
|
-
style.appendChild(document.createTextNode(css));
|
131
|
-
}
|
132
|
-
}
|
133
|
-
|
134
|
-
var css_248z$1 = ".TestComponent-module_test-component__nta6Z {\n background-color: var(--background);\n color: var(--font-color);\n border: 1px solid var(--harvey-black);\n padding: 16px;\n width: 360px;\n text-align: center;\n}\n.TestComponent-module_test-component__nta6Z .TestComponent-module_heading__TOFqv {\n font-size: var(--heading-font-size);\n}\n";
|
135
|
-
var styles$1 = {"test-component":"TestComponent-module_test-component__nta6Z","heading":"TestComponent-module_heading__TOFqv"};
|
136
|
-
styleInject(css_248z$1);
|
137
|
-
|
138
|
-
var TestComponent = function (_a) {
|
139
|
-
var heading = _a.heading, content = _a.content;
|
140
|
-
return (React__default.createElement("div", { className: styles$1['test-component'] },
|
141
|
-
React__default.createElement("h1", { className: styles$1.heading }, heading),
|
142
|
-
React__default.createElement("div", null, content)));
|
143
|
-
};
|
144
|
-
|
145
|
-
var _path$5;
|
146
|
-
function _extends$5() { return _extends$5 = 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$5.apply(null, arguments); }
|
147
|
-
var SvgDown = function SvgDown(props) {
|
148
|
-
return /*#__PURE__*/React.createElement("svg", _extends$5({
|
149
|
-
xmlns: "http://www.w3.org/2000/svg",
|
150
|
-
width: 16,
|
151
|
-
height: 16,
|
152
|
-
fill: "none"
|
153
|
-
}, props), _path$5 || (_path$5 = /*#__PURE__*/React.createElement("path", {
|
154
|
-
fill: "currentColor",
|
155
|
-
d: "m13.354 6.354-5 5a.5.5 0 0 1-.708 0l-5-5a.5.5 0 0 1 .708-.708L8 10.293l4.646-4.647a.5.5 0 1 1 .708.708"
|
156
|
-
})));
|
157
|
-
};
|
158
|
-
|
159
|
-
var _path$4;
|
160
|
-
function _extends$4() { return _extends$4 = 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$4.apply(null, arguments); }
|
161
|
-
var SvgTreePerson = function SvgTreePerson(props) {
|
162
|
-
return /*#__PURE__*/React.createElement("svg", _extends$4({
|
163
|
-
xmlns: "http://www.w3.org/2000/svg",
|
164
|
-
width: 16,
|
165
|
-
height: 16,
|
166
|
-
fill: "none"
|
167
|
-
}, props), _path$4 || (_path$4 = /*#__PURE__*/React.createElement("path", {
|
168
|
-
fill: "currentColor",
|
169
|
-
d: "M14.433 13.75A.5.5 0 0 1 14 14H2a.5.5 0 0 1-.433-.75c.952-1.646 2.42-2.826 4.131-3.385a4.5 4.5 0 1 1 4.604 0c1.712.56 3.179 1.74 4.13 3.385a.5.5 0 0 1 .001.5"
|
170
|
-
})));
|
171
|
-
};
|
172
|
-
|
173
|
-
var _path$3;
|
174
|
-
function _extends$3() { return _extends$3 = 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$3.apply(null, arguments); }
|
175
|
-
var SvgTreePlace = function SvgTreePlace(props) {
|
176
|
-
return /*#__PURE__*/React.createElement("svg", _extends$3({
|
177
|
-
xmlns: "http://www.w3.org/2000/svg",
|
178
|
-
width: 16,
|
179
|
-
height: 16,
|
180
|
-
fill: "none"
|
181
|
-
}, props), _path$3 || (_path$3 = /*#__PURE__*/React.createElement("path", {
|
182
|
-
fill: "currentColor",
|
183
|
-
d: "M8 1.5A6.5 6.5 0 1 0 14.5 8 6.507 6.507 0 0 0 8 1.5M3.893 11.654l.158-.103a1 1 0 0 0 .449-.83l.013-2.265L5.823 6.5l.02.014 1.23.804c.206.146.459.207.709.173l1.968-.267a1 1 0 0 0 .625-.338l1.386-1.61A1 1 0 0 0 12 4.625v-.396a5.49 5.49 0 0 1 1.236 5.459l-1.01-.923a1 1 0 0 0-1.057-.187l-1.904.79a1 1 0 0 0-.605.778l-.15 1.012a1 1 0 0 0 .736 1.113l1.342.354.147.148a5.49 5.49 0 0 1-6.842-1.119"
|
184
|
-
})));
|
185
|
-
};
|
186
|
-
|
187
|
-
var _path$2;
|
188
|
-
function _extends$2() { return _extends$2 = 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$2.apply(null, arguments); }
|
189
|
-
var SvgTreeEvent = function SvgTreeEvent(props) {
|
190
|
-
return /*#__PURE__*/React.createElement("svg", _extends$2({
|
191
|
-
xmlns: "http://www.w3.org/2000/svg",
|
192
|
-
width: 17,
|
193
|
-
height: 16,
|
194
|
-
fill: "none"
|
195
|
-
}, props), _path$2 || (_path$2 = /*#__PURE__*/React.createElement("path", {
|
196
|
-
fill: "currentColor",
|
197
|
-
d: "M14.3 10.6a.5.5 0 0 0-.3-.1h-.5V4a2 2 0 0 0-2-2H3a2 2 0 0 0-2 2c0 .85.628 1.346.7 1.4a.49.49 0 0 0 .59.006.5.5 0 0 0 .014-.802C2.302 4.601 2 4.36 2 4a1 1 0 0 1 2 0v8a2 2 0 0 0 2 2h7a2 2 0 0 0 2-2c0-.85-.625-1.346-.7-1.4M7 6h4a.5.5 0 0 1 0 1H7a.5.5 0 1 1 0-1m-.5 2.5A.5.5 0 0 1 7 8h4a.5.5 0 0 1 0 1H7a.5.5 0 0 1-.5-.5M13 13H7.232c.176-.304.268-.649.268-1q0-.256-.076-.5H13.8a.8.8 0 0 1 .202.5A1 1 0 0 1 13 13"
|
198
|
-
})));
|
199
|
-
};
|
200
|
-
|
201
|
-
var _path$1;
|
202
|
-
function _extends$1() { return _extends$1 = 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$1.apply(null, arguments); }
|
203
|
-
var SvgTreeObject = function SvgTreeObject(props) {
|
204
|
-
return /*#__PURE__*/React.createElement("svg", _extends$1({
|
205
|
-
xmlns: "http://www.w3.org/2000/svg",
|
206
|
-
width: 16,
|
207
|
-
height: 16,
|
208
|
-
fill: "none"
|
209
|
-
}, props), _path$1 || (_path$1 = /*#__PURE__*/React.createElement("path", {
|
210
|
-
fill: "currentColor",
|
211
|
-
d: "m13.98 4.134-5.5-3.009a.99.99 0 0 0-.96 0l-5.5 3.01a1 1 0 0 0-.52.876v5.977a1 1 0 0 0 .52.875l5.5 3.01a.99.99 0 0 0 .96 0l5.5-3.01a1 1 0 0 0 .52-.875V5.011a1 1 0 0 0-.52-.877M8 2l5.022 2.75-1.861 1.018-5.022-2.75zm0 5.5L2.978 4.75l2.12-1.16 5.021 2.75zm5.5 3.49-5 2.737V8.365l2-1.094V9.5a.5.5 0 0 0 1 0V6.723l2-1.095v5.363"
|
212
|
-
})));
|
213
|
-
};
|
214
|
-
|
215
|
-
var _path;
|
216
|
-
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); }
|
217
|
-
var SvgTreeOrg = function SvgTreeOrg(props) {
|
218
|
-
return /*#__PURE__*/React.createElement("svg", _extends({
|
219
|
-
xmlns: "http://www.w3.org/2000/svg",
|
220
|
-
width: 16,
|
221
|
-
height: 16,
|
222
|
-
fill: "none"
|
223
|
-
}, props), _path || (_path = /*#__PURE__*/React.createElement("path", {
|
224
|
-
fill: "currentColor",
|
225
|
-
d: "M14.983 13H14V6a1 1 0 0 0-1-1h-2.75a.25.25 0 0 0-.25.25V13H9V2.026a1.03 1.03 0 0 0-.385-.813 1 1 0 0 0-1.17-.043l-5 3.33A1 1 0 0 0 2 5.334V13h-.983a.51.51 0 0 0-.517.467A.5.5 0 0 0 1 14h14a.499.499 0 0 0 .333-.868.5.5 0 0 0-.35-.132M4.75 11.5a.5.5 0 0 1-.533.5.51.51 0 0 1-.467-.518v-.965A.51.51 0 0 1 4.217 10a.5.5 0 0 1 .533.5zm0-3.5a.5.5 0 0 1-.533.5.51.51 0 0 1-.467-.517v-.966a.51.51 0 0 1 .467-.517.5.5 0 0 1 .533.5zm2.5 3.5a.5.5 0 0 1-.533.5.51.51 0 0 1-.467-.516v-.967A.51.51 0 0 1 6.717 10a.5.5 0 0 1 .533.5zm0-3.5a.5.5 0 0 1-.533.5.51.51 0 0 1-.467-.516v-.967a.51.51 0 0 1 .467-.516.5.5 0 0 1 .533.5z"
|
226
|
-
})));
|
227
|
-
};
|
228
|
-
|
229
|
-
// 默认配置
|
230
|
-
var defaultConfig = {
|
231
|
-
timeout: 30000,
|
232
|
-
};
|
233
|
-
var Request = /** @class */ (function () {
|
234
|
-
function Request(config) {
|
235
|
-
var getAccessToken = config.getAccessToken, onUnauthorized = config.onUnauthorized, axiosConfig = __rest(config, ["getAccessToken", "onUnauthorized"]);
|
236
|
-
this.axiosInstance = axios.create(__assign(__assign({}, defaultConfig), axiosConfig));
|
237
|
-
this.axiosInstance.interceptors.request.use(this.requestInterceptor.bind(this));
|
238
|
-
this.axiosInstance.interceptors.response.use(this.responseSuccessInterceptor.bind(this), this.responseErrorInterceptor.bind(this));
|
239
|
-
this.getAccessToken = getAccessToken;
|
240
|
-
this.onUnauthorized = onUnauthorized;
|
241
|
-
}
|
242
|
-
// 请求拦截器
|
243
|
-
Request.prototype.requestInterceptor = function (axiosConfig) {
|
244
|
-
return __awaiter(this, void 0, void 0, function () {
|
245
|
-
var accessToken;
|
246
|
-
var _a;
|
247
|
-
return __generator(this, function (_b) {
|
248
|
-
switch (_b.label) {
|
249
|
-
case 0: return [4 /*yield*/, ((_a = this.getAccessToken) === null || _a === void 0 ? void 0 : _a.call(this))];
|
250
|
-
case 1:
|
251
|
-
accessToken = _b.sent();
|
252
|
-
if (accessToken) {
|
253
|
-
axiosConfig.headers.Authorization = "Bearer ".concat(accessToken);
|
254
|
-
}
|
255
|
-
return [2 /*return*/, Promise.resolve(axiosConfig)];
|
256
|
-
}
|
257
|
-
});
|
258
|
-
});
|
259
|
-
};
|
260
|
-
// 响应成功拦截器
|
261
|
-
Request.prototype.responseSuccessInterceptor = function (response) {
|
262
|
-
return __awaiter(this, void 0, void 0, function () {
|
263
|
-
var _a, code, data, msg;
|
264
|
-
return __generator(this, function (_b) {
|
265
|
-
_a = response.data, code = _a.code, data = _a.data, msg = _a.message;
|
266
|
-
if (code === 0) {
|
267
|
-
return [2 /*return*/, Promise.resolve(data)];
|
268
|
-
}
|
269
|
-
else {
|
270
|
-
message.error(msg || '服务器内部错误');
|
271
|
-
return [2 /*return*/, Promise.reject(msg || '服务器内部错误')];
|
272
|
-
}
|
273
|
-
});
|
274
|
-
});
|
275
|
-
};
|
276
|
-
// 响应错误拦截器
|
277
|
-
Request.prototype.responseErrorInterceptor = function (error) {
|
278
|
-
return __awaiter(this, void 0, void 0, function () {
|
279
|
-
var _a, status, data;
|
280
|
-
var _b;
|
281
|
-
return __generator(this, function (_c) {
|
282
|
-
_a = (error === null || error === void 0 ? void 0 : error.response) || {}, status = _a.status, data = _a.data;
|
283
|
-
if (status === 401) {
|
284
|
-
message.error('登录已过期,请重新登录');
|
285
|
-
(_b = this.onUnauthorized) === null || _b === void 0 ? void 0 : _b.call(this);
|
286
|
-
}
|
287
|
-
else if (status === 404) {
|
288
|
-
message.error('请求的资源不存在');
|
289
|
-
}
|
290
|
-
else {
|
291
|
-
message.error((data === null || data === void 0 ? void 0 : data.message) || '服务器内部错误');
|
292
|
-
}
|
293
|
-
return [2 /*return*/, Promise.reject(error)];
|
294
|
-
});
|
295
|
-
});
|
296
|
-
};
|
297
|
-
// GET
|
298
|
-
Request.prototype.get = function (url, config) {
|
299
|
-
return this.axiosInstance.get(url, config);
|
300
|
-
};
|
301
|
-
// POST
|
302
|
-
Request.prototype.post = function (url, data, config) {
|
303
|
-
return this.axiosInstance.post(url, data, config);
|
304
|
-
};
|
305
|
-
// PUT
|
306
|
-
Request.prototype.put = function (url, data, config) {
|
307
|
-
return this.axiosInstance.put(url, data, config);
|
308
|
-
};
|
309
|
-
// DELETE
|
310
|
-
Request.prototype.delete = function (url, config) {
|
311
|
-
return this.axiosInstance.delete(url, config);
|
312
|
-
};
|
313
|
-
return Request;
|
314
|
-
}());
|
315
|
-
var request = new Request({
|
316
|
-
baseURL: '/api/icos/desktop',
|
317
|
-
getAccessToken: function () { var _a, _b; return (_b = (_a = window._ICOS_DESKTOP_) === null || _a === void 0 ? void 0 : _a.getAccessToken) === null || _b === void 0 ? void 0 : _b.call(_a); },
|
318
|
-
});
|
319
|
-
|
320
|
-
// 获取知识体系编码
|
321
|
-
var getCategoryKsCode = function () {
|
322
|
-
return request.get('/v1/entity-manager/category-ks-code-map');
|
323
|
-
};
|
324
|
-
|
325
|
-
var useKsCode = function () {
|
326
|
-
// 加载完成
|
327
|
-
var _a = useState(false), loaded = _a[0], setLoaded = _a[1];
|
328
|
-
// 知识体系编码
|
329
|
-
var _b = useState(), ksCode = _b[0], setKsCode = _b[1];
|
330
|
-
useEffect(function () {
|
331
|
-
var _a;
|
332
|
-
if ((_a = window._ICOS_DESKTOP_) === null || _a === void 0 ? void 0 : _a.ksCode) {
|
333
|
-
setKsCode(window._ICOS_DESKTOP_.ksCode);
|
334
|
-
setLoaded(true);
|
335
|
-
return;
|
336
|
-
}
|
337
|
-
getCategoryKsCode().then(function (res) {
|
338
|
-
if (window._ICOS_DESKTOP_) {
|
339
|
-
window._ICOS_DESKTOP_.ksCode = res;
|
340
|
-
}
|
341
|
-
else {
|
342
|
-
window._ICOS_DESKTOP_ = { ksCode: res };
|
343
|
-
}
|
344
|
-
setKsCode(res);
|
345
|
-
setLoaded(true);
|
346
|
-
});
|
347
|
-
}, []);
|
348
|
-
return { loaded: loaded, ksCode: ksCode };
|
349
|
-
};
|
350
|
-
|
351
|
-
var judgeArrayEmpty = function (data) {
|
352
|
-
return (data === null || data === void 0 ? void 0 : data.length) ? data : undefined;
|
353
|
-
};
|
354
|
-
// 获取树勾选参数
|
355
|
-
var getTreeChecked = function (_a) {
|
356
|
-
var _treeData = _a.treeData, checkedKeys = _a.checkedKeys, halfCheckedKeys = _a.halfCheckedKeys;
|
357
|
-
if (!(_treeData === null || _treeData === void 0 ? void 0 : _treeData.length)) {
|
358
|
-
return {
|
359
|
-
info: {},
|
360
|
-
total: 0,
|
361
|
-
};
|
362
|
-
}
|
363
|
-
var treeData = _treeData[0].type === 'all' ? _treeData[0].children : _treeData;
|
364
|
-
var total = 0;
|
365
|
-
var senseObjCodes = [];
|
366
|
-
var bookIds = [];
|
367
|
-
var excludeBookIds = [];
|
368
|
-
var senseGlobalCodes = [];
|
369
|
-
var excludeGlobalCodes = [];
|
370
|
-
var orgIds = [];
|
371
|
-
// 获取节点勾选状态
|
372
|
-
var nodeChecked = function (node) {
|
373
|
-
var checked = checkedKeys.indexOf(node.key) !== -1;
|
374
|
-
var halfChecked = halfCheckedKeys.indexOf(node.key) !== -1;
|
375
|
-
return { checked: checked || halfChecked, halfChecked: halfChecked };
|
376
|
-
};
|
377
|
-
// 处理实体记录
|
378
|
-
var judgeSense = function (data, parent) {
|
379
|
-
if (!(data === null || data === void 0 ? void 0 : data.length)) {
|
380
|
-
return;
|
381
|
-
}
|
382
|
-
// 判断实体记录加载状态
|
383
|
-
var more = data.find(function (item) { return item.type === 'more'; });
|
384
|
-
if (more) {
|
385
|
-
// 实体记录未全部加载
|
386
|
-
// 判断未加载实体记录勾选状态
|
387
|
-
var moreChecked = checkedKeys.indexOf(more.key) !== -1;
|
388
|
-
if (moreChecked) {
|
389
|
-
// 未加载实体记录勾选
|
390
|
-
// 台账添加到 bookIds
|
391
|
-
// 未勾选实体记录添加到 excludeSenseGlobalCodes
|
392
|
-
// 判断父级类型
|
393
|
-
if (parent.type === 'senseObj') {
|
394
|
-
senseObjCodes.push(parent.key);
|
395
|
-
}
|
396
|
-
else if (parent.type === 'senseBook') {
|
397
|
-
bookIds.push(parent.key);
|
398
|
-
}
|
399
|
-
var excludeTotal_1 = 0;
|
400
|
-
data.forEach(function (item) {
|
401
|
-
if (item.type !== 'more') {
|
402
|
-
if (checkedKeys.indexOf(item.key) === -1) {
|
403
|
-
excludeGlobalCodes.push(item.key);
|
404
|
-
excludeTotal_1 += 1;
|
405
|
-
}
|
406
|
-
}
|
407
|
-
});
|
408
|
-
total += parent.total - excludeTotal_1;
|
409
|
-
}
|
410
|
-
else {
|
411
|
-
// 未加载实体记录未勾选
|
412
|
-
// 勾选的实体记录添加到 senseGlobalCodes
|
413
|
-
data.forEach(function (item) {
|
414
|
-
if (item !== 'more') {
|
415
|
-
if (checkedKeys.indexOf(item.key) !== -1) {
|
416
|
-
senseGlobalCodes.push(item.key);
|
417
|
-
total += 1;
|
418
|
-
}
|
419
|
-
}
|
420
|
-
});
|
421
|
-
}
|
422
|
-
}
|
423
|
-
else {
|
424
|
-
// 实体记录已全部加载
|
425
|
-
// 实体记录添加到 senseGlobalCodes
|
426
|
-
data.forEach(function (item) {
|
427
|
-
if (checkedKeys.indexOf(item.key) !== -1) {
|
428
|
-
senseGlobalCodes.push(item.key);
|
429
|
-
total += 1;
|
430
|
-
}
|
431
|
-
});
|
432
|
-
}
|
433
|
-
};
|
434
|
-
// 处理 台账
|
435
|
-
var judgeBook = function (data, parent) {
|
436
|
-
if (!(data === null || data === void 0 ? void 0 : data.length)) {
|
437
|
-
return;
|
438
|
-
}
|
439
|
-
// 判断台账加载情况
|
440
|
-
var more = data.find(function (item) { return item.type === 'more'; });
|
441
|
-
if (more) {
|
442
|
-
// 台账未全部加载
|
443
|
-
// 判断未加载部分台账勾选状态
|
444
|
-
var moreChecked = checkedKeys.indexOf(more.key) !== -1;
|
445
|
-
if (moreChecked) {
|
446
|
-
// 未加载台账勾选
|
447
|
-
// 实体分类添加到 senseObjCodes
|
448
|
-
senseObjCodes.push(parent.key);
|
449
|
-
// 判断已加载台账勾选状态
|
450
|
-
var excludeTotal_2 = 0;
|
451
|
-
data.forEach(function (item) {
|
452
|
-
if (item !== 'more') {
|
453
|
-
var _a = nodeChecked(item), checked = _a.checked, halfChecked = _a.halfChecked;
|
454
|
-
if (checked) {
|
455
|
-
if (halfChecked) {
|
456
|
-
// 已加载台账半勾选
|
457
|
-
judgeSense(item.children, item);
|
458
|
-
}
|
459
|
-
}
|
460
|
-
else {
|
461
|
-
// 已加载台账未勾选
|
462
|
-
// 台账添加到 excludeBookIds
|
463
|
-
excludeBookIds.push(item.key);
|
464
|
-
excludeTotal_2 += 1;
|
465
|
-
}
|
466
|
-
}
|
467
|
-
});
|
468
|
-
total += parent.total - excludeTotal_2;
|
469
|
-
}
|
470
|
-
else {
|
471
|
-
// 未加载台账未勾选
|
472
|
-
// 判断已加载台账勾选状态
|
473
|
-
data.forEach(function (item) {
|
474
|
-
if (item !== 'more') {
|
475
|
-
var _a = nodeChecked(item), checked = _a.checked, halfChecked = _a.halfChecked;
|
476
|
-
if (checked) {
|
477
|
-
if (halfChecked) {
|
478
|
-
// 已加载台账半勾选
|
479
|
-
judgeSense(item.children, item);
|
480
|
-
}
|
481
|
-
else {
|
482
|
-
// 已加载台账勾选
|
483
|
-
// 台账添加到 bookIds
|
484
|
-
bookIds.push(item.key);
|
485
|
-
total += item.total;
|
486
|
-
}
|
487
|
-
}
|
488
|
-
}
|
489
|
-
});
|
490
|
-
}
|
491
|
-
}
|
492
|
-
else {
|
493
|
-
// 台账已全部加载
|
494
|
-
data.forEach(function (item) {
|
495
|
-
// 判断台账勾选状态
|
496
|
-
var _a = nodeChecked(item), checked = _a.checked, halfChecked = _a.halfChecked;
|
497
|
-
if (checked) {
|
498
|
-
if (halfChecked) {
|
499
|
-
// 台账半勾选
|
500
|
-
judgeSense(item.children, item);
|
501
|
-
}
|
502
|
-
else {
|
503
|
-
// 台账全部勾选
|
504
|
-
// 台账添加到 bookIds
|
505
|
-
bookIds.push(item.key);
|
506
|
-
total += item.total;
|
507
|
-
}
|
508
|
-
}
|
509
|
-
});
|
510
|
-
}
|
511
|
-
};
|
512
|
-
// 处理 senseObj
|
513
|
-
var judgeSenseObj = function (data) {
|
514
|
-
if (!(data === null || data === void 0 ? void 0 : data.length)) {
|
515
|
-
return;
|
516
|
-
}
|
517
|
-
data.forEach(function (item) {
|
518
|
-
var _a;
|
519
|
-
if (item.type === 'senseObj') {
|
520
|
-
// 判断实体分类勾选状态
|
521
|
-
var _b = nodeChecked(item), checked = _b.checked, halfChecked = _b.halfChecked;
|
522
|
-
if (checked) {
|
523
|
-
if (halfChecked) {
|
524
|
-
// 实体分类半勾选
|
525
|
-
// 判断下级类型
|
526
|
-
if ((_a = item.children) === null || _a === void 0 ? void 0 : _a.length) {
|
527
|
-
if (item.children[0].type === 'senseBook') {
|
528
|
-
judgeBook(item.children, item);
|
529
|
-
}
|
530
|
-
else if (item.children[0].type === 'sense') {
|
531
|
-
judgeSense(item.children, item);
|
532
|
-
}
|
533
|
-
}
|
534
|
-
}
|
535
|
-
else {
|
536
|
-
// 实体分类全勾选
|
537
|
-
// 实体分类添加到 senseObjCodes
|
538
|
-
senseObjCodes.push(item.key);
|
539
|
-
total += item.total;
|
540
|
-
}
|
541
|
-
}
|
542
|
-
}
|
543
|
-
else if (item.type === 'senseType') {
|
544
|
-
judgeSenseObj(item.children);
|
545
|
-
}
|
546
|
-
});
|
547
|
-
};
|
548
|
-
// 处理政府通讯录
|
549
|
-
var judgeOrg = function (data) {
|
550
|
-
data.forEach(function (item) {
|
551
|
-
if (item.type === 'senseOrg') {
|
552
|
-
// 判断组织(senseOrg)勾选状态
|
553
|
-
var _a = nodeChecked(item), checked = _a.checked, halfChecked = _a.halfChecked;
|
554
|
-
if (checked) {
|
555
|
-
if (halfChecked) {
|
556
|
-
// 组织半勾选
|
557
|
-
judgeOrg(item.children);
|
558
|
-
}
|
559
|
-
else {
|
560
|
-
// 组织全勾选
|
561
|
-
// 添加到 orgIds
|
562
|
-
orgIds.push(item.key);
|
563
|
-
total += item.total;
|
564
|
-
}
|
565
|
-
}
|
566
|
-
}
|
567
|
-
else {
|
568
|
-
// 判断组织人员勾选状态
|
569
|
-
var checked = checkedKeys.indexOf(item.key) !== -1;
|
570
|
-
if (checked) {
|
571
|
-
senseGlobalCodes.push(item.key);
|
572
|
-
total += 1;
|
573
|
-
}
|
574
|
-
}
|
575
|
-
});
|
576
|
-
};
|
577
|
-
if (treeData[0].type === 'senseOrg') {
|
578
|
-
judgeOrg(treeData);
|
579
|
-
}
|
580
|
-
else {
|
581
|
-
judgeSenseObj(treeData);
|
582
|
-
}
|
583
|
-
return {
|
584
|
-
info: {
|
585
|
-
selectSenseObjCodes: judgeArrayEmpty(senseObjCodes),
|
586
|
-
selectBookIds: judgeArrayEmpty(bookIds),
|
587
|
-
unSelectBookIds: judgeArrayEmpty(excludeBookIds),
|
588
|
-
selectSenseGlobalCodes: judgeArrayEmpty(senseGlobalCodes),
|
589
|
-
unSelectSenseGlobalCodes: judgeArrayEmpty(excludeGlobalCodes),
|
590
|
-
selectOrgIds: judgeArrayEmpty(orgIds),
|
591
|
-
},
|
592
|
-
total: total,
|
593
|
-
};
|
594
|
-
};
|
595
|
-
|
596
|
-
// 根据key查找树节点
|
597
|
-
var findNodeByKey = function (tree, key) {
|
598
|
-
var stack = __spreadArray([], tree, true);
|
599
|
-
while (stack.length > 0) {
|
600
|
-
var node = stack.pop();
|
601
|
-
if (node.key === key) {
|
602
|
-
return node;
|
603
|
-
}
|
604
|
-
if (node.children) {
|
605
|
-
stack.push.apply(stack, node.children);
|
606
|
-
}
|
607
|
-
}
|
608
|
-
return null;
|
609
|
-
};
|
610
|
-
// 数组转树结构
|
611
|
-
var arrayToTree = function (array, loop, fieldNames) {
|
612
|
-
var tree = [];
|
613
|
-
var map = {};
|
614
|
-
var _a = (fieldNames || {}).children, childrenName = _a === void 0 ? 'children' : _a;
|
615
|
-
var data = cloneDeep(array);
|
616
|
-
for (var i = 0; i < data.length; i++) {
|
617
|
-
var item = loop(data[i]);
|
618
|
-
data[i] = item;
|
619
|
-
map[item.key] = item;
|
620
|
-
}
|
621
|
-
data.forEach(function (item) {
|
622
|
-
var parent = map[item.parentKey];
|
623
|
-
if (parent && parent.key !== item.key) {
|
624
|
-
(parent[childrenName] || (parent[childrenName] = [])).push(item);
|
625
|
-
}
|
626
|
-
else {
|
627
|
-
tree.push(item);
|
628
|
-
}
|
629
|
-
});
|
630
|
-
return tree;
|
631
|
-
};
|
632
|
-
|
633
|
-
// 获取组织树
|
634
|
-
var getOrgTree = function (data) {
|
635
|
-
return request.post('/v1/map-window/search/org-tree', data);
|
636
|
-
};
|
637
|
-
// 获取实体分类树
|
638
|
-
var getEntityClassTree = function (data) {
|
639
|
-
return request.post('/v1/map-window/search/entity-class-tree', data);
|
640
|
-
};
|
641
|
-
// 分页获取台账列表
|
642
|
-
var getBookList = function (data) {
|
643
|
-
return request.post('/v1/map-window/search/book-list', data);
|
644
|
-
};
|
645
|
-
// 分页获取实体记录列表
|
646
|
-
var getSenseList = function (data) {
|
647
|
-
return request.post('/v2/map-window/search/sense-list', data);
|
648
|
-
};
|
649
|
-
|
650
|
-
var css_248z = ".EntityTree-module_container__F8BNC {\n width: 100%;\n height: 100%;\n overflow-x: hidden;\n overflow-y: auto;\n}\n.EntityTree-module_container__F8BNC * {\n box-sizing: border-box;\n}\n.EntityTree-module_container__F8BNC .ant-spin-nested-loading {\n width: 100%;\n height: 100%;\n}\n.EntityTree-module_container__F8BNC .ant-tree {\n background: transparent;\n color: rgba(255, 255, 255, 0.8);\n}\n.EntityTree-module_container__F8BNC .ant-tree .ant-tree-node-content-wrapper:hover,\n.EntityTree-module_container__F8BNC .ant-tree .ant-tree-checkbox + span:hover,\n.EntityTree-module_container__F8BNC .ant-tree .ant-tree-switcher:not(.ant-tree-switcher-noop):hover:before {\n background: transparent;\n}\n.EntityTree-module_container__F8BNC .ant-tree.ant-tree-block-node .ant-tree-list-holder-inner .ant-tree-node-content-wrapper {\n width: 0;\n}\n.EntityTree-module_container__F8BNC .ant-tree .ant-tree-treenode {\n align-items: center;\n padding: 0;\n min-height: 40px;\n}\n.EntityTree-module_container__F8BNC .ant-tree .ant-tree-treenode .ant-tree-switcher {\n line-height: 40px;\n}\n.EntityTree-module_container__F8BNC .ant-tree .ant-tree-treenode .ant-tree-checkbox {\n align-self: center;\n margin: 0;\n}\n.EntityTree-module_container__F8BNC .ant-tree .ant-tree-treenode[data-type=\"root\"] {\n min-height: 32px;\n margin-bottom: 4px;\n background-image: url('data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAvUAAABACAMAAACtBHhQAAAAdVBMVEVAm/hDsvNDvPJCqPg/jPgAAAA8hv4+nvY/u+49ivxAtfI9jfo+lfg+mfdBsfNAqfNByu8/we8+kfo+xu89ovE+pPI+p/ZBsfI+tfA+kfs/nvc+ifxCnflAwvA9h/4+h/8xnsMoc65Cp/QjcZojbpkpdLIjb5ioMoMLAAAAJnRSTlMmJiYmJgBGQDhGOkZEQjs9NDZFNUA+LisuOjQ+Ki1CJkyiKuZflsDG+oIAAAsfSURBVHja7JpRjgQhCERR7HN4/1uupfZW9m+SFSYE3yj2AV4qQEaeyyUb1/pLPqS11ttb+HEIaZIWHceEomXVcWJTSx0UHE8e6XT+PCKZvVdRxbWhDFSjil9xvX2n9Q10K+1zKq+r0nkLylY/buJXyu/LI/TdwHxJm/Qr5+2k/7UdnxpV/QocI5/W28V81qjf1qPawM4maodTZ6Xsvto/Audx/3BbnP+huNbjbODmpuLOwrh3gtZD+97bzfqT/Y0YdjiM+piN/ZB8PgDVF06zu1zvTy8tDcTfSR/UeJoP4cu87pvLtiF3W38AtWX39HEb+/L9rDebZ5N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qUA8zqHmsbstlvu1T2Xhrn30ofxHus51llnkvRT/zSoyLycB6eSdAICC4ivAtn2zyWidPyYGs9btWZdSj1wTkcK26UzsXBt1SX9WZn8hLEL7/eI3UZCGLvxgj7a3qz37heJs6u1qXKPVjftvFwDvj9Ax4scODjBEJElDd0aT4WT6M/WF+1HvBT9VEmTmf64jxzyV9cl3FkAa/ZRfxivVOdD0zjyCR/h5KaOK2hPZv/mn0BGRZn7LppW7YAAAAASUVORK5CYII=');\n background-repeat: no-repeat;\n background-size: 100% 100%;\n}\n.EntityTree-module_container__F8BNC .ant-tree .ant-tree-treenode[data-type=\"root\"] .ant-tree-title {\n color: #FFF;\n font-family: YouSheBiaoTiHei;\n font-size: 16px;\n font-style: normal;\n font-weight: 400;\n}\n.EntityTree-module_container__F8BNC .ant-tree .ant-tree-treenode[data-type='more'] .ant-tree-switcher,\n.EntityTree-module_container__F8BNC .ant-tree .ant-tree-treenode[data-type='more'] .ant-tree-checkbox {\n display: none;\n}\n.EntityTree-module_container__F8BNC .ant-tree .ant-tree-treenode[data-type='sense'],\n.EntityTree-module_container__F8BNC .ant-tree .ant-tree-treenode[data-type='more'] {\n padding-top: 8px;\n}\n.EntityTree-module_container__F8BNC .EntityTree-module_node-more__Zo2wM {\n display: flex;\n align-items: center;\n justify-content: center;\n font-size: 12px;\n color: #2bf2f8;\n column-gap: 4px;\n}\n.EntityTree-module_container__F8BNC .EntityTree-module_node-default__iVIc- {\n display: flex;\n}\n.EntityTree-module_container__F8BNC .EntityTree-module_node-default__iVIc- .EntityTree-module_title__BJnDv {\n overflow: hidden;\n white-space: nowrap;\n text-overflow: ellipsis;\n}\n.EntityTree-module_container__F8BNC .EntityTree-module_node-default__iVIc- .EntityTree-module_total__icLCA {\n flex-shrink: 0;\n}\n.EntityTree-module_container__F8BNC .EntityTree-module_node-sense__s75ax {\n display: flex;\n flex-direction: column;\n row-gap: 12px;\n padding: 8px;\n background: rgba(69, 147, 255, 0.1);\n}\n.EntityTree-module_container__F8BNC .EntityTree-module_node-sense__s75ax .EntityTree-module_title__BJnDv {\n display: flex;\n align-items: center;\n gap: 4px;\n}\n.EntityTree-module_container__F8BNC .EntityTree-module_node-sense__s75ax .EntityTree-module_title__BJnDv > svg {\n width: 20px;\n height: 20px;\n flex-shrink: 0;\n}\n.EntityTree-module_container__F8BNC .EntityTree-module_node-sense__s75ax .EntityTree-module_title__BJnDv > span {\n flex: 1;\n width: 0;\n overflow: hidden;\n white-space: nowrap;\n text-overflow: ellipsis;\n}\n.EntityTree-module_container__F8BNC .EntityTree-module_node-sense__s75ax .EntityTree-module_fields__jwWMe {\n overflow: hidden;\n white-space: nowrap;\n text-overflow: ellipsis;\n}\n.EntityTree-module_node-sense-content__FHgPl {\n display: flex;\n flex-direction: column;\n max-width: 440px;\n}\n.EntityTree-module_highlight__QWIYs {\n background: transparent;\n color: #0FF;\n}\n";
|
651
|
-
var styles = {"container":"EntityTree-module_container__F8BNC","node-more":"EntityTree-module_node-more__Zo2wM","node-default":"EntityTree-module_node-default__iVIc-","title":"EntityTree-module_title__BJnDv","total":"EntityTree-module_total__icLCA","node-sense":"EntityTree-module_node-sense__s75ax","fields":"EntityTree-module_fields__jwWMe","node-sense-content":"EntityTree-module_node-sense-content__FHgPl","highlight":"EntityTree-module_highlight__QWIYs"};
|
652
|
-
styleInject(css_248z);
|
653
|
-
|
654
|
-
var EntityTree = function (props) {
|
655
|
-
var _a = props.viewCodes, viewCodes = _a === void 0 ? [] : _a, onTotalChange = props.onTotalChange, onCheck = props.onCheck, defaultCheckedAll = props.defaultCheckedAll;
|
656
|
-
var searchParams = {};
|
657
|
-
var ksCode = useKsCode().ksCode;
|
658
|
-
// 加载中
|
659
|
-
var _b = useState(false), loading = _b[0], setLoading = _b[1];
|
660
|
-
// 树数据
|
661
|
-
var _c = useState([]), treeData = _c[0], setTreeData = _c[1];
|
662
|
-
// 选中复选框的树节点
|
663
|
-
var _d = useState([]), checkedKeys = _d[0], setCheckedKeys = _d[1];
|
664
|
-
// 展开指定的树节点
|
665
|
-
var _f = useState([]), expandedKeys = _f[0], setExpandedKeys = _f[1];
|
666
|
-
// 渲染高亮
|
667
|
-
var keywordHighlight = function (text) {
|
668
|
-
return (searchParams === null || searchParams === void 0 ? void 0 : searchParams.keyword) ? (React__default.createElement(Highlighter, { highlightClassName: styles.highlight, searchWords: [searchParams.keyword], textToHighlight: text || '', autoEscape: true })) : (text);
|
669
|
-
};
|
670
|
-
// 获取图标
|
671
|
-
var getIcon = function (key) {
|
672
|
-
var _a;
|
673
|
-
if (ksCode) {
|
674
|
-
var iconMap = (_a = {},
|
675
|
-
_a[ksCode.person] = React__default.createElement(SvgTreePerson, null),
|
676
|
-
_a[ksCode.place] = React__default.createElement(SvgTreePlace, null),
|
677
|
-
_a[ksCode.event] = React__default.createElement(SvgTreeEvent, null),
|
678
|
-
_a[ksCode.object] = React__default.createElement(SvgTreeObject, null),
|
679
|
-
_a[ksCode.org] = React__default.createElement(SvgTreeOrg, null),
|
680
|
-
_a);
|
681
|
-
return iconMap[key];
|
682
|
-
}
|
683
|
-
};
|
684
|
-
// 获取实体记录列表
|
685
|
-
var getSenseList$1 = function (node) { return __awaiter(void 0, void 0, void 0, function () {
|
686
|
-
var isMore, isSenseOrg, reqId, parentKey, params, res, list, pageNum, total, moreChecked;
|
687
|
-
return __generator(this, function (_a) {
|
688
|
-
switch (_a.label) {
|
689
|
-
case 0:
|
690
|
-
isMore = node.type === 'more';
|
691
|
-
isSenseOrg = node.type === 'senseOrg';
|
692
|
-
reqId = isMore ? node.reqId : node.key;
|
693
|
-
parentKey = node.type === 'senseIcosBook' || isMore ? node.parentKey : reqId;
|
694
|
-
params = __assign(__assign({}, searchParams), { viewCodes: viewCodes, page: isMore ? node.morePage : 1, pageSize: 100 });
|
695
|
-
if (isSenseOrg) {
|
696
|
-
// 组织
|
697
|
-
params.orgIds = [reqId];
|
698
|
-
}
|
699
|
-
else {
|
700
|
-
// 台账
|
701
|
-
params.bookIds = [reqId];
|
702
|
-
}
|
703
|
-
// 加载更多loading动画
|
704
|
-
if (isMore) {
|
705
|
-
setTreeData(produce(function (draftState) {
|
706
|
-
var cur = findNodeByKey(draftState, node.key);
|
707
|
-
cur.loading = true;
|
708
|
-
}));
|
709
|
-
}
|
710
|
-
return [4 /*yield*/, getSenseList(params)];
|
711
|
-
case 1:
|
712
|
-
res = _a.sent();
|
713
|
-
list = res.list, pageNum = res.pageNum, total = res.total;
|
714
|
-
setTreeData(produce(function (draftState) {
|
715
|
-
var _a;
|
716
|
-
var cur = findNodeByKey(draftState, parentKey);
|
717
|
-
if (cur) {
|
718
|
-
var data = [];
|
719
|
-
if (cur.extraChildren) {
|
720
|
-
data.push.apply(data, cur.extraChildren);
|
721
|
-
}
|
722
|
-
data.push.apply(data, (list || []).map(function (item) { return ({
|
723
|
-
key: item.senseGlobalCode,
|
724
|
-
parentKey: parentKey,
|
725
|
-
ksCode: node.ksCode,
|
726
|
-
title: item.dataList[0].fieldValue,
|
727
|
-
dataList: item.dataList,
|
728
|
-
tagCodes: item.tagCodes,
|
729
|
-
tagNames: item.tagNames,
|
730
|
-
'data-type': 'sense',
|
731
|
-
type: 'sense',
|
732
|
-
isLeaf: true,
|
733
|
-
dataRef: item,
|
734
|
-
}); }));
|
735
|
-
if (isMore) {
|
736
|
-
// 删除加载更多节点
|
737
|
-
cur.children.pop();
|
738
|
-
(_a = cur.children).push.apply(_a, data);
|
739
|
-
}
|
740
|
-
else {
|
741
|
-
cur.children = data;
|
742
|
-
}
|
743
|
-
if (cur.children.length < total) {
|
744
|
-
// 加载更多
|
745
|
-
var page = pageNum + 1;
|
746
|
-
cur.children.push({
|
747
|
-
key: "more__".concat(reqId, "__").concat(page),
|
748
|
-
parentKey: parentKey,
|
749
|
-
reqId: reqId,
|
750
|
-
ksCode: node.ksCode,
|
751
|
-
title: '加载更多',
|
752
|
-
morePage: page,
|
753
|
-
loading: false,
|
754
|
-
moreType: 'sense',
|
755
|
-
'data-type': 'more',
|
756
|
-
type: 'more',
|
757
|
-
isLeaf: true,
|
758
|
-
});
|
759
|
-
}
|
760
|
-
}
|
761
|
-
}));
|
762
|
-
// 加载更多时勾选状态
|
763
|
-
if (isMore) {
|
764
|
-
moreChecked = checkedKeys.indexOf(node.key) !== -1;
|
765
|
-
if (moreChecked) {
|
766
|
-
setCheckedKeys(produce(function (draftState) {
|
767
|
-
draftState.push.apply(draftState, (list || []).map(function (item) { return item.senseGlobalCode; }));
|
768
|
-
}));
|
769
|
-
}
|
770
|
-
}
|
771
|
-
return [2 /*return*/];
|
772
|
-
}
|
773
|
-
});
|
774
|
-
}); };
|
775
|
-
// 获取台账列表
|
776
|
-
var getBookList$1 = function (node) { return __awaiter(void 0, void 0, void 0, function () {
|
777
|
-
var isMore, params, res, list, next, item, moreChecked;
|
778
|
-
return __generator(this, function (_a) {
|
779
|
-
switch (_a.label) {
|
780
|
-
case 0:
|
781
|
-
isMore = node.type === 'more';
|
782
|
-
params = __assign(__assign({}, searchParams), { viewCodes: viewCodes, senseObjCodes: [node.key], isMore: isMore });
|
783
|
-
// 加载更多
|
784
|
-
if (isMore) {
|
785
|
-
setTreeData(produce(function (draftState) {
|
786
|
-
var cur = findNodeByKey(draftState, node.key);
|
787
|
-
cur.loading = true;
|
788
|
-
}));
|
789
|
-
params.excludeBookIds = (function () {
|
790
|
-
var _a;
|
791
|
-
var data = (_a = findNodeByKey(treeData, node.key)) === null || _a === void 0 ? void 0 : _a.children;
|
792
|
-
if (data) {
|
793
|
-
return data.map(function (item) { return item.key; });
|
794
|
-
}
|
795
|
-
return [];
|
796
|
-
})();
|
797
|
-
}
|
798
|
-
return [4 /*yield*/, getBookList(params)];
|
799
|
-
case 1:
|
800
|
-
res = _a.sent();
|
801
|
-
list = res.list, next = res.next;
|
802
|
-
if (!((list === null || list === void 0 ? void 0 : list.length) && list[0].type === 'senseIcosBook')) return [3 /*break*/, 3];
|
803
|
-
item = list[0];
|
804
|
-
return [4 /*yield*/, getSenseList$1({
|
805
|
-
key: item.code,
|
806
|
-
parentKey: item.parentCode,
|
807
|
-
ksCode: node.ksCode,
|
808
|
-
type: item.type,
|
809
|
-
})];
|
810
|
-
case 2:
|
811
|
-
_a.sent();
|
812
|
-
return [2 /*return*/];
|
813
|
-
case 3:
|
814
|
-
setTreeData(produce(function (draftState) {
|
815
|
-
var _a;
|
816
|
-
var cur = findNodeByKey(draftState, node.key);
|
817
|
-
if (cur) {
|
818
|
-
var data = (list || []).map(function (item) { return ({
|
819
|
-
key: item.code,
|
820
|
-
parentKey: item.parentCode,
|
821
|
-
ksCode: node.ksCode,
|
822
|
-
title: item.name,
|
823
|
-
total: item.count,
|
824
|
-
'data-type': item.type,
|
825
|
-
type: item.type,
|
826
|
-
isLeaf: !item.count,
|
827
|
-
dataRef: item,
|
828
|
-
}); });
|
829
|
-
if (isMore) {
|
830
|
-
// 删除加载更多节点
|
831
|
-
cur.children.pop();
|
832
|
-
(_a = cur.children).push.apply(_a, data);
|
833
|
-
}
|
834
|
-
else {
|
835
|
-
cur.children = data;
|
836
|
-
}
|
837
|
-
if (next) {
|
838
|
-
// 加载更多
|
839
|
-
cur.children.push({
|
840
|
-
key: "more__".concat(node.key, "__").concat(Date.now()),
|
841
|
-
parentKey: node.key,
|
842
|
-
ksCode: node.ksCode,
|
843
|
-
title: '加载更多',
|
844
|
-
loading: false,
|
845
|
-
moreType: 'senseBook',
|
846
|
-
'data-type': 'more',
|
847
|
-
type: 'more',
|
848
|
-
isLeaf: true,
|
849
|
-
});
|
850
|
-
}
|
851
|
-
}
|
852
|
-
}));
|
853
|
-
// 加载更多时勾选状态
|
854
|
-
if (isMore) {
|
855
|
-
moreChecked = checkedKeys.indexOf(node.key) !== -1;
|
856
|
-
if (moreChecked) {
|
857
|
-
setCheckedKeys((list || []).map(function (item) { return item.code; }));
|
858
|
-
}
|
859
|
-
}
|
860
|
-
return [2 /*return*/];
|
861
|
-
}
|
862
|
-
});
|
863
|
-
}); };
|
864
|
-
// 获取实体分类
|
865
|
-
var getEntityClassTree$1 = function () { return __awaiter(void 0, void 0, void 0, function () {
|
866
|
-
var isGovUser, params, res, ksCategoryCode, data, total, children, keys;
|
867
|
-
var _a, _b;
|
868
|
-
return __generator(this, function (_c) {
|
869
|
-
switch (_c.label) {
|
870
|
-
case 0:
|
871
|
-
setLoading(true);
|
872
|
-
isGovUser = viewCodes.includes('system-icos_gov_user');
|
873
|
-
params = __assign(__assign({}, searchParams), { viewCodes: viewCodes });
|
874
|
-
return [4 /*yield*/, getEntityClassTree(params)];
|
875
|
-
case 1:
|
876
|
-
res = _c.sent();
|
877
|
-
if (!isGovUser) return [3 /*break*/, 3];
|
878
|
-
ksCategoryCode = (_a = res[0]) === null || _a === void 0 ? void 0 : _a.ksCategoryCode;
|
879
|
-
return [4 /*yield*/, getOrgTree(params)];
|
880
|
-
case 2:
|
881
|
-
res = _c.sent();
|
882
|
-
_c.label = 3;
|
883
|
-
case 3:
|
884
|
-
data = arrayToTree(res, function (item) { return ({
|
885
|
-
key: item.code,
|
886
|
-
parentKey: item.parentCode,
|
887
|
-
ksCode: ksCategoryCode || item.ksCategoryCode,
|
888
|
-
title: item.name,
|
889
|
-
total: item.count,
|
890
|
-
'data-type': item.parentCode === '0000000000' ? 'root' : item.type,
|
891
|
-
type: item.type,
|
892
|
-
isLeaf: !item.count,
|
893
|
-
dataRef: item,
|
894
|
-
}); }, isGovUser ? { children: 'extraChildren' } : null);
|
895
|
-
if (isGovUser) {
|
896
|
-
data.forEach(function (item) {
|
897
|
-
item['data-type'] = 'root';
|
898
|
-
});
|
899
|
-
}
|
900
|
-
total = res.reduce(function (acc, item) {
|
901
|
-
return isGovUser || item.parentCode === '0000000000' ? acc + item.count : acc;
|
902
|
-
}, 0);
|
903
|
-
// 添加全部
|
904
|
-
if (data.length > 1) {
|
905
|
-
children = __spreadArray([], data, true);
|
906
|
-
data = [
|
907
|
-
{
|
908
|
-
key: 'all',
|
909
|
-
parentKey: '',
|
910
|
-
title: '全部',
|
911
|
-
total: total,
|
912
|
-
'data-type': 'root',
|
913
|
-
type: 'all',
|
914
|
-
children: children.map(function (item) { return (__assign(__assign({}, item), { parentKey: 'all', 'data-type': item.type })); }),
|
915
|
-
},
|
916
|
-
];
|
917
|
-
}
|
918
|
-
setTreeData(data);
|
919
|
-
onTotalChange === null || onTotalChange === void 0 ? void 0 : onTotalChange(total);
|
920
|
-
// 选中
|
921
|
-
if (defaultCheckedAll) {
|
922
|
-
keys = data.map(function (item) { return item.key; });
|
923
|
-
setCheckedKeys(keys);
|
924
|
-
onCheck === null || onCheck === void 0 ? void 0 : onCheck({ info: {}, total: total });
|
925
|
-
}
|
926
|
-
else {
|
927
|
-
setCheckedKeys([]);
|
928
|
-
onCheck === null || onCheck === void 0 ? void 0 : onCheck({ info: {}, total: 0 });
|
929
|
-
}
|
930
|
-
// 展开
|
931
|
-
if (((_b = data === null || data === void 0 ? void 0 : data[0]) === null || _b === void 0 ? void 0 : _b.type) === 'all') {
|
932
|
-
setExpandedKeys([data[0].key]);
|
933
|
-
}
|
934
|
-
else {
|
935
|
-
setExpandedKeys([]);
|
936
|
-
}
|
937
|
-
setLoading(false);
|
938
|
-
return [2 /*return*/];
|
939
|
-
}
|
940
|
-
});
|
941
|
-
}); };
|
942
|
-
// 懒加载树节点
|
943
|
-
var loadData = function (node) { return __awaiter(void 0, void 0, void 0, function () {
|
944
|
-
return __generator(this, function (_a) {
|
945
|
-
switch (_a.label) {
|
946
|
-
case 0:
|
947
|
-
if (node.children) {
|
948
|
-
return [2 /*return*/];
|
949
|
-
}
|
950
|
-
if (!(node.type === 'senseObj')) return [3 /*break*/, 2];
|
951
|
-
return [4 /*yield*/, getBookList$1(node)];
|
952
|
-
case 1:
|
953
|
-
_a.sent();
|
954
|
-
_a.label = 2;
|
955
|
-
case 2:
|
956
|
-
if (!(node.type === 'senseBook' || node.type === 'senseOrg')) return [3 /*break*/, 4];
|
957
|
-
return [4 /*yield*/, getSenseList$1(node)];
|
958
|
-
case 3:
|
959
|
-
_a.sent();
|
960
|
-
_a.label = 4;
|
961
|
-
case 4: return [2 /*return*/];
|
962
|
-
}
|
963
|
-
});
|
964
|
-
}); };
|
965
|
-
// 其他方法触发展开树节点
|
966
|
-
var otherExpand = function (key) {
|
967
|
-
var index = expandedKeys.indexOf(key);
|
968
|
-
if (index === -1) {
|
969
|
-
setExpandedKeys(produce(function (draftState) {
|
970
|
-
draftState.push(key);
|
971
|
-
}));
|
972
|
-
}
|
973
|
-
else {
|
974
|
-
setExpandedKeys(produce(function (draftState) {
|
975
|
-
draftState.splice(index, 1);
|
976
|
-
}));
|
977
|
-
}
|
978
|
-
};
|
979
|
-
// 点击树节点
|
980
|
-
var handleSelect = function (_keys, _a) {
|
981
|
-
var node = _a.node;
|
982
|
-
if (node.type === 'more') {
|
983
|
-
if (node.moreType === 'senseBook') {
|
984
|
-
getBookList$1(node);
|
985
|
-
}
|
986
|
-
if (node.moreType === 'sense') {
|
987
|
-
getSenseList$1(node);
|
988
|
-
}
|
989
|
-
}
|
990
|
-
else if (node.type !== 'sense') {
|
991
|
-
// 展开
|
992
|
-
otherExpand(node.key);
|
993
|
-
}
|
994
|
-
};
|
995
|
-
// 收起展开树节点
|
996
|
-
var handleExpand = function (keys) {
|
997
|
-
setExpandedKeys(keys);
|
998
|
-
};
|
999
|
-
// 选择树节点
|
1000
|
-
var handleCheck = function (keys, info) {
|
1001
|
-
setCheckedKeys(keys);
|
1002
|
-
var checkedInfo = getTreeChecked({
|
1003
|
-
treeData: treeData,
|
1004
|
-
checkedKeys: keys,
|
1005
|
-
halfCheckedKeys: info.halfCheckedKeys,
|
1006
|
-
});
|
1007
|
-
onCheck === null || onCheck === void 0 ? void 0 : onCheck(checkedInfo);
|
1008
|
-
};
|
1009
|
-
// 树节点双击
|
1010
|
-
var handleDoubleClick = function (_e, node) {
|
1011
|
-
if (node.type === 'sense') ;
|
1012
|
-
};
|
1013
|
-
// 树节点标题渲染
|
1014
|
-
var titleRender = function (node) {
|
1015
|
-
var _a;
|
1016
|
-
if (node.type === 'more') {
|
1017
|
-
// 加载更多
|
1018
|
-
return (React__default.createElement("div", { className: styles['node-more'] },
|
1019
|
-
node.title,
|
1020
|
-
node.loading ? React__default.createElement(LoadingOutlined, null) : React__default.createElement(SvgDown, null)));
|
1021
|
-
}
|
1022
|
-
if (node.type === 'sense') {
|
1023
|
-
// 实体记录
|
1024
|
-
var tagText = ((_a = node.tagNames) === null || _a === void 0 ? void 0 : _a.length) ? node.tagNames.join(', ') : '';
|
1025
|
-
var content = (React__default.createElement("div", { className: styles['node-sense-content'] },
|
1026
|
-
(node.dataList || []).map(function (item) { return (React__default.createElement("div", { key: item.fieldId }, keywordHighlight("".concat(item.fieldName, "\uFF1A").concat(item.fieldValue)))); }),
|
1027
|
-
tagText ? React__default.createElement("div", null, keywordHighlight("\u6807\u7B7E\uFF1A".concat(tagText))) : null));
|
1028
|
-
var fields = (node.dataList || [])
|
1029
|
-
.map(function (item) { return "".concat(item.fieldName, "\uFF1A").concat(item.fieldValue); })
|
1030
|
-
.join(' ');
|
1031
|
-
if (tagText) {
|
1032
|
-
fields += " \u6807\u7B7E\uFF1A".concat(tagText);
|
1033
|
-
}
|
1034
|
-
return (React__default.createElement("div", { className: styles['node-sense'] },
|
1035
|
-
React__default.createElement("div", { className: styles.title, title: node.title },
|
1036
|
-
node.ksCode ? getIcon(node.ksCode) : null,
|
1037
|
-
React__default.createElement("span", null, keywordHighlight(node.title))),
|
1038
|
-
fields ? (React__default.createElement(Popover, { content: content },
|
1039
|
-
React__default.createElement("div", { className: styles.fields, title: "" }, keywordHighlight(fields)))) : null));
|
1040
|
-
}
|
1041
|
-
return (React__default.createElement("div", { className: styles['node-default'] },
|
1042
|
-
React__default.createElement("div", { className: styles.title }, keywordHighlight(node.title)),
|
1043
|
-
React__default.createElement("div", { className: styles.total },
|
1044
|
-
"\uFF08",
|
1045
|
-
node.total,
|
1046
|
-
"\uFF09")));
|
1047
|
-
};
|
1048
|
-
useEffect(function () {
|
1049
|
-
getEntityClassTree$1();
|
1050
|
-
}, [viewCodes]);
|
1051
|
-
return (React__default.createElement("div", { className: styles.container },
|
1052
|
-
React__default.createElement(Spin, { spinning: loading, delay: 500 },
|
1053
|
-
React__default.createElement(Tree, { treeData: treeData, titleRender: titleRender, loadData: loadData, selectedKeys: [], expandedKeys: expandedKeys, checkedKeys: checkedKeys, onSelect: handleSelect, onExpand: handleExpand, onCheck: handleCheck, onDoubleClick: handleDoubleClick,
|
1054
|
-
// onRightClick={handleRightClick as any}
|
1055
|
-
checkable: true, blockNode: true }))));
|
1056
|
-
};
|
1057
|
-
|
1058
|
-
export { EntityTree, TestComponent, configFn as config };
|
1
|
+
import*as e from"react";import n,{useState as t,useEffect as r}from"react";import{produce as o}from"immer";import i from"react-highlight-words";import{message as a,Spin as l,Tree as d,Popover as c,Image as s,Modal as u,Table as f,Space as p,Tooltip as h}from"antd";import{LoadingOutlined as m,ExclamationCircleOutlined as g}from"@ant-design/icons";import v from"axios";import{cloneDeep as y}from"lodash";import{useRequest as E,useMount as A}from"ahooks";var _=function(){return _=Object.assign||function(e){for(var n,t=1,r=arguments.length;t<r;t++)for(var o in n=arguments[t])Object.prototype.hasOwnProperty.call(n,o)&&(e[o]=n[o]);return e},_.apply(this,arguments)};function k(e,n,t,r){return new(t||(t=Promise))((function(o,i){function a(e){try{d(r.next(e))}catch(e){i(e)}}function l(e){try{d(r.throw(e))}catch(e){i(e)}}function d(e){var n;e.done?o(e.value):(n=e.value,n instanceof t?n:new t((function(e){e(n)}))).then(a,l)}d((r=r.apply(e,n||[])).next())}))}function w(e,n){var t,r,o,i,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:l(0),throw:l(1),return:l(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function l(l){return function(d){return function(l){if(t)throw new TypeError("Generator is already executing.");for(;i&&(i=0,l[0]&&(a=0)),a;)try{if(t=1,r&&(o=2&l[0]?r.return:l[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,l[1])).done)return o;switch(r=0,o&&(l=[2&l[0],o.value]),l[0]){case 0:case 1:o=l;break;case 4:return a.label++,{value:l[1],done:!1};case 5:a.label++,r=l[1],l=[0];continue;case 7:l=a.ops.pop(),a.trys.pop();continue;default:if(!(o=a.trys,(o=o.length>0&&o[o.length-1])||6!==l[0]&&2!==l[0])){a=0;continue}if(3===l[0]&&(!o||l[1]>o[0]&&l[1]<o[3])){a.label=l[1];break}if(6===l[0]&&a.label<o[1]){a.label=o[1],o=l;break}if(o&&a.label<o[2]){a.label=o[2],a.ops.push(l);break}o[2]&&a.ops.pop(),a.trys.pop();continue}l=n.call(e,a)}catch(e){l=[6,e],r=0}finally{t=o=0}if(5&l[0])throw l[1];return{value:l[0]?l[1]:void 0,done:!0}}([l,d])}}}function x(e,n,t){if(t||2===arguments.length)for(var r,o=0,i=n.length;o<i;o++)!r&&o in n||(r||(r=Array.prototype.slice.call(n,0,o)),r[o]=n[o]);return e.concat(r||Array.prototype.slice.call(n))}"function"==typeof SuppressedError&&SuppressedError;var b,C=function(e){window._ICOS_DESKTOP_=_(_({},window._ICOS_DESKTOP_),e)};function B(){return B=Object.assign?Object.assign.bind():function(e){for(var n=1;n<arguments.length;n++){var t=arguments[n];for(var r in t)({}).hasOwnProperty.call(t,r)&&(e[r]=t[r])}return e},B.apply(null,arguments)}var N,Q=function(n){return e.createElement("svg",B({xmlns:"http://www.w3.org/2000/svg",width:16,height:16,fill:"none"},n),b||(b=e.createElement("path",{fill:"currentColor",d:"m13.354 6.354-5 5a.5.5 0 0 1-.708 0l-5-5a.5.5 0 0 1 .708-.708L8 10.293l4.646-4.647a.5.5 0 1 1 .708.708"})))};function I(){return I=Object.assign?Object.assign.bind():function(e){for(var n=1;n<arguments.length;n++){var t=arguments[n];for(var r in t)({}).hasOwnProperty.call(t,r)&&(e[r]=t[r])}return e},I.apply(null,arguments)}var T,O=function(n){return e.createElement("svg",I({xmlns:"http://www.w3.org/2000/svg",width:16,height:16,fill:"none"},n),N||(N=e.createElement("path",{fill:"currentColor",d:"M14.433 13.75A.5.5 0 0 1 14 14H2a.5.5 0 0 1-.433-.75c.952-1.646 2.42-2.826 4.131-3.385a4.5 4.5 0 1 1 4.604 0c1.712.56 3.179 1.74 4.13 3.385a.5.5 0 0 1 .001.5"})))};function S(){return S=Object.assign?Object.assign.bind():function(e){for(var n=1;n<arguments.length;n++){var t=arguments[n];for(var r in t)({}).hasOwnProperty.call(t,r)&&(e[r]=t[r])}return e},S.apply(null,arguments)}var j,z=function(n){return e.createElement("svg",S({xmlns:"http://www.w3.org/2000/svg",width:16,height:16,fill:"none"},n),T||(T=e.createElement("path",{fill:"currentColor",d:"M8 1.5A6.5 6.5 0 1 0 14.5 8 6.507 6.507 0 0 0 8 1.5M3.893 11.654l.158-.103a1 1 0 0 0 .449-.83l.013-2.265L5.823 6.5l.02.014 1.23.804c.206.146.459.207.709.173l1.968-.267a1 1 0 0 0 .625-.338l1.386-1.61A1 1 0 0 0 12 4.625v-.396a5.49 5.49 0 0 1 1.236 5.459l-1.01-.923a1 1 0 0 0-1.057-.187l-1.904.79a1 1 0 0 0-.605.778l-.15 1.012a1 1 0 0 0 .736 1.113l1.342.354.147.148a5.49 5.49 0 0 1-6.842-1.119"})))};function P(){return P=Object.assign?Object.assign.bind():function(e){for(var n=1;n<arguments.length;n++){var t=arguments[n];for(var r in t)({}).hasOwnProperty.call(t,r)&&(e[r]=t[r])}return e},P.apply(null,arguments)}var J,F=function(n){return e.createElement("svg",P({xmlns:"http://www.w3.org/2000/svg",width:17,height:16,fill:"none"},n),j||(j=e.createElement("path",{fill:"currentColor",d:"M14.3 10.6a.5.5 0 0 0-.3-.1h-.5V4a2 2 0 0 0-2-2H3a2 2 0 0 0-2 2c0 .85.628 1.346.7 1.4a.49.49 0 0 0 .59.006.5.5 0 0 0 .014-.802C2.302 4.601 2 4.36 2 4a1 1 0 0 1 2 0v8a2 2 0 0 0 2 2h7a2 2 0 0 0 2-2c0-.85-.625-1.346-.7-1.4M7 6h4a.5.5 0 0 1 0 1H7a.5.5 0 1 1 0-1m-.5 2.5A.5.5 0 0 1 7 8h4a.5.5 0 0 1 0 1H7a.5.5 0 0 1-.5-.5M13 13H7.232c.176-.304.268-.649.268-1q0-.256-.076-.5H13.8a.8.8 0 0 1 .202.5A1 1 0 0 1 13 13"})))};function R(){return R=Object.assign?Object.assign.bind():function(e){for(var n=1;n<arguments.length;n++){var t=arguments[n];for(var r in t)({}).hasOwnProperty.call(t,r)&&(e[r]=t[r])}return e},R.apply(null,arguments)}var D,M=function(n){return e.createElement("svg",R({xmlns:"http://www.w3.org/2000/svg",width:16,height:16,fill:"none"},n),J||(J=e.createElement("path",{fill:"currentColor",d:"m13.98 4.134-5.5-3.009a.99.99 0 0 0-.96 0l-5.5 3.01a1 1 0 0 0-.52.876v5.977a1 1 0 0 0 .52.875l5.5 3.01a.99.99 0 0 0 .96 0l5.5-3.01a1 1 0 0 0 .52-.875V5.011a1 1 0 0 0-.52-.877M8 2l5.022 2.75-1.861 1.018-5.022-2.75zm0 5.5L2.978 4.75l2.12-1.16 5.021 2.75zm5.5 3.49-5 2.737V8.365l2-1.094V9.5a.5.5 0 0 0 1 0V6.723l2-1.095v5.363"})))};function K(){return K=Object.assign?Object.assign.bind():function(e){for(var n=1;n<arguments.length;n++){var t=arguments[n];for(var r in t)({}).hasOwnProperty.call(t,r)&&(e[r]=t[r])}return e},K.apply(null,arguments)}var L=function(n){return e.createElement("svg",K({xmlns:"http://www.w3.org/2000/svg",width:16,height:16,fill:"none"},n),D||(D=e.createElement("path",{fill:"currentColor",d:"M14.983 13H14V6a1 1 0 0 0-1-1h-2.75a.25.25 0 0 0-.25.25V13H9V2.026a1.03 1.03 0 0 0-.385-.813 1 1 0 0 0-1.17-.043l-5 3.33A1 1 0 0 0 2 5.334V13h-.983a.51.51 0 0 0-.517.467A.5.5 0 0 0 1 14h14a.499.499 0 0 0 .333-.868.5.5 0 0 0-.35-.132M4.75 11.5a.5.5 0 0 1-.533.5.51.51 0 0 1-.467-.518v-.965A.51.51 0 0 1 4.217 10a.5.5 0 0 1 .533.5zm0-3.5a.5.5 0 0 1-.533.5.51.51 0 0 1-.467-.517v-.966a.51.51 0 0 1 .467-.517.5.5 0 0 1 .533.5zm2.5 3.5a.5.5 0 0 1-.533.5.51.51 0 0 1-.467-.516v-.967A.51.51 0 0 1 6.717 10a.5.5 0 0 1 .533.5zm0-3.5a.5.5 0 0 1-.533.5.51.51 0 0 1-.467-.516v-.967a.51.51 0 0 1 .467-.516.5.5 0 0 1 .533.5z"})))},Z={timeout:3e4},H=new(function(){function e(e){var n=e.getAccessToken,t=e.onUnauthorized,r=function(e,n){var t={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&n.indexOf(r)<0&&(t[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(r=Object.getOwnPropertySymbols(e);o<r.length;o++)n.indexOf(r[o])<0&&Object.prototype.propertyIsEnumerable.call(e,r[o])&&(t[r[o]]=e[r[o]])}return t}(e,["getAccessToken","onUnauthorized"]);this.axiosInstance=v.create(_(_({},Z),r)),this.axiosInstance.interceptors.request.use(this.requestInterceptor.bind(this)),this.axiosInstance.interceptors.response.use(this.responseSuccessInterceptor.bind(this),this.responseErrorInterceptor.bind(this)),this.getAccessToken=n,this.onUnauthorized=t}return e.prototype.requestInterceptor=function(e){return k(this,void 0,void 0,(function(){var n,t;return w(this,(function(r){switch(r.label){case 0:return[4,null===(t=this.getAccessToken)||void 0===t?void 0:t.call(this)];case 1:return(n=r.sent())&&(n.startsWith("Bearer ")?e.headers.Authorization=n:e.headers.Authorization="Bearer ".concat(n)),[2,Promise.resolve(e)]}}))}))},e.prototype.responseSuccessInterceptor=function(e){return k(this,void 0,void 0,(function(){var n,t,r,o;return w(this,(function(i){return n=e.data,t=n.code,r=n.data,o=n.message,0===t?[2,Promise.resolve(r)]:(a.error(o||"服务器内部错误"),[2,Promise.reject(o||"服务器内部错误")])}))}))},e.prototype.responseErrorInterceptor=function(e){return k(this,void 0,void 0,(function(){var n,t,r,o;return w(this,(function(i){return n=(null==e?void 0:e.response)||{},t=n.status,r=n.data,401===t?(a.error("登录已过期,请重新登录"),null===(o=this.onUnauthorized)||void 0===o||o.call(this)):404===t?a.error("请求的资源不存在"):a.error((null==r?void 0:r.message)||"服务器内部错误"),[2,Promise.reject(e)]}))}))},e.prototype.get=function(e,n,t){return this.axiosInstance.get(e,_({params:n},t))},e.prototype.post=function(e,n,t){return this.axiosInstance.post(e,n,t)},e.prototype.put=function(e,n,t){return this.axiosInstance.put(e,n,t)},e.prototype.delete=function(e,n,t){return this.axiosInstance.delete(e,_({params:n},t))},e}())({baseURL:"/api/icos/desktop",getAccessToken:function(){var e,n;return null===(n=null===(e=window._ICOS_DESKTOP_)||void 0===e?void 0:e.getAccessToken)||void 0===n?void 0:n.call(e)}}),V=function(){var e=t(!1),n=e[0],o=e[1],i=t(),a=i[0],l=i[1];return r((function(){var e;if(null===(e=window._ICOS_DESKTOP_)||void 0===e?void 0:e.ksCode)return l(window._ICOS_DESKTOP_.ksCode),void o(!0);H.get("/v1/entity-manager/category-ks-code-map").then((function(e){window._ICOS_DESKTOP_?window._ICOS_DESKTOP_.ksCode=e:window._ICOS_DESKTOP_={ksCode:e},l(e),o(!0)}))}),[]),{loaded:n,ksCode:a}},U=function(e){return(null==e?void 0:e.length)?e:void 0},Y=function(e){var n=e.treeData,t=e.checkedKeys,r=e.halfCheckedKeys;if(!(null==n?void 0:n.length))return{info:{},total:0};var o="all"===n[0].type?n[0].children:n,i=0,a=[],l=[],d=[],c=[],s=[],u=[],f=function(e){var n=-1!==t.indexOf(e.key),o=-1!==r.indexOf(e.key);return{checked:n||o,halfChecked:o}},p=function(e,n){if(null==e?void 0:e.length){var r=e.find((function(e){return"more"===e.type}));if(r)if(-1!==t.indexOf(r.key)){"senseObj"===n.type?a.push(n.key):"senseBook"===n.type&&l.push(n.key);var o=0;e.forEach((function(e){"more"!==e.type&&-1===t.indexOf(e.key)&&(s.push(e.key),o+=1)})),i+=n.total-o}else e.forEach((function(e){"more"!==e&&-1!==t.indexOf(e.key)&&(c.push(e.key),i+=1)}));else e.forEach((function(e){-1!==t.indexOf(e.key)&&(c.push(e.key),i+=1)}))}},h=function(e){(null==e?void 0:e.length)&&e.forEach((function(e){var n;if("senseObj"===e.type){var r=f(e),o=r.checked,c=r.halfChecked;o&&(c?(null===(n=e.children)||void 0===n?void 0:n.length)&&("senseBook"===e.children[0].type?function(e,n){if(null==e?void 0:e.length){var r=e.find((function(e){return"more"===e.type}));if(r)if(-1!==t.indexOf(r.key)){a.push(n.key);var o=0;e.forEach((function(e){if("more"!==e){var n=f(e),t=n.checked,r=n.halfChecked;t?r&&p(e.children,e):(d.push(e.key),o+=1)}})),i+=n.total-o}else e.forEach((function(e){if("more"!==e){var n=f(e),t=n.checked,r=n.halfChecked;t&&(r?p(e.children,e):(l.push(e.key),i+=e.total))}}));else e.forEach((function(e){var n=f(e),t=n.checked,r=n.halfChecked;t&&(r?p(e.children,e):(l.push(e.key),i+=e.total))}))}}(e.children,e):"sense"===e.children[0].type&&p(e.children,e)):(a.push(e.key),i+=e.total))}else"senseType"===e.type&&h(e.children)}))},m=function(e){e.forEach((function(e){if("senseOrg"===e.type){var n=f(e),r=n.checked,o=n.halfChecked;r&&(o?m(e.children):(u.push(e.key),i+=e.total))}else{(r=-1!==t.indexOf(e.key))&&(c.push(e.key),i+=1)}}))};return"senseOrg"===o[0].type?m(o):h(o),{info:{selectSenseObjCodes:U(a),selectBookIds:U(l),unSelectBookIds:U(d),selectSenseGlobalCodes:U(c),unSelectSenseGlobalCodes:U(s),selectOrgIds:U(u)},total:i}},G=function(e,n){for(var t=x([],e,!0);t.length>0;){var r=t.pop();if(r.key===n)return r;r.children&&t.push.apply(t,r.children)}return null},q=function(e){return H.post("/v1/map-window/search/org-tree",e)},W=function(e){return H.post("/v1/map-window/search/entity-class-tree",e)};function X(e,n){void 0===n&&(n={});var t=n.insertAt;if(e&&"undefined"!=typeof document){var r=document.head||document.getElementsByTagName("head")[0],o=document.createElement("style");o.type="text/css","top"===t&&r.firstChild?r.insertBefore(o,r.firstChild):r.appendChild(o),o.styleSheet?o.styleSheet.cssText=e:o.appendChild(document.createTextNode(e))}}var $="EntityTree-module_container__F8BNC",ee="EntityTree-module_node-more__Zo2wM",ne="EntityTree-module_node-default__iVIc-",te="EntityTree-module_title__BJnDv",re="EntityTree-module_total__icLCA",oe="EntityTree-module_node-sense__s75ax",ie="EntityTree-module_fields__jwWMe",ae="EntityTree-module_node-sense-content__FHgPl",le="EntityTree-module_highlight__QWIYs";X(".EntityTree-module_container__F8BNC {\n width: 100%;\n height: 100%;\n overflow-x: hidden;\n overflow-y: auto;\n}\n.EntityTree-module_container__F8BNC * {\n box-sizing: border-box;\n}\n.EntityTree-module_container__F8BNC .ant-spin-nested-loading {\n width: 100%;\n height: 100%;\n}\n.EntityTree-module_container__F8BNC .ant-tree {\n background: transparent;\n color: rgba(255, 255, 255, 0.8);\n}\n.EntityTree-module_container__F8BNC .ant-tree .ant-tree-node-content-wrapper:hover,\n.EntityTree-module_container__F8BNC .ant-tree .ant-tree-checkbox + span:hover,\n.EntityTree-module_container__F8BNC .ant-tree .ant-tree-switcher:not(.ant-tree-switcher-noop):hover:before {\n background: transparent;\n}\n.EntityTree-module_container__F8BNC .ant-tree.ant-tree-block-node .ant-tree-list-holder-inner .ant-tree-node-content-wrapper {\n width: 0;\n}\n.EntityTree-module_container__F8BNC .ant-tree .ant-tree-treenode {\n align-items: center;\n padding: 0;\n min-height: 40px;\n}\n.EntityTree-module_container__F8BNC .ant-tree .ant-tree-treenode .ant-tree-switcher {\n line-height: 40px;\n}\n.EntityTree-module_container__F8BNC .ant-tree .ant-tree-treenode .ant-tree-checkbox {\n align-self: center;\n margin: 0;\n}\n.EntityTree-module_container__F8BNC .ant-tree .ant-tree-treenode[data-type=\"root\"] {\n min-height: 32px;\n margin-bottom: 4px;\n background-image: url('data:image/png;base64,iVBORw0KGgoAA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vi+xJfl1kPgT9V1/EKeRzzOYluO8NHNJ9ib59S4Wnp4HTrUtxPz6kevL+2Qr4jOSFs4H0OQfx268l1GEjZxoc7E2cupuK5AzMmEcahd63z369RD9erZ8v1td31fcccysUoeO3Fytera/xCvELQgJ6258Pfszflfxl7wxSAISBGAjd//9ZbZfOVZGshjbVH4RQCplESHE4zkzXVLv+YuF6hPV3Xfy9lOVBKoReZdkpcr4+8GkQnkehH3WpahX9U/g+6Qjn8eS6poC7Vousl8zzLNsYV0OgsHwYwbuHUMZ8ORqErJ+ghB30LiBvT6sjxqhuu95joWdlGE63vm6gJ8eVjUfZ2sOU96FArRr1eafXXnIs2U+ofTZVwg1H4v0e9Uu+Ww7TS10f4cuvP9q7ghyGYRAmwv//vGbJYqFqh2lA4xZrivIADznGBetc3mxDz1NrvYZN/APj+0E84BK6Ptu3xMQ/+5Ytx95x5h/gr294R9cv63KQPxFgvUGZOE4T7DUYzGV+4OPeSG7FR6231K/h9VtvK/lw3kQS+BYS5i4oObO+/+ZRAsfPxImBzJ8odSLhQNsjh9NRz1mCIM6AvDFupOONWzrOrMebthSORwon1rqUA8zqHmsbstlvu1T2Xhrn30ofxHus51llnkvRT/zSoyLycB6eSdAICC4ivAtn2zyWidPyYGs9btWZdSj1wTkcK26UzsXBt1SX9WZn8hLEL7/eI3UZCGLvxgj7a3qz37heJs6u1qXKPVjftvFwDvj9Ax4scODjBEJElDd0aT4WT6M/WF+1HvBT9VEmTmf64jxzyV9cl3FkAa/ZRfxivVOdD0zjyCR/h5KaOK2hPZv/mn0BGRZn7LppW7YAAAAASUVORK5CYII=');\n background-repeat: no-repeat;\n background-size: 100% 100%;\n}\n.EntityTree-module_container__F8BNC .ant-tree .ant-tree-treenode[data-type=\"root\"] .ant-tree-title {\n color: #FFF;\n font-family: YouSheBiaoTiHei;\n font-size: 16px;\n font-style: normal;\n font-weight: 400;\n}\n.EntityTree-module_container__F8BNC .ant-tree .ant-tree-treenode[data-type='more'] .ant-tree-switcher,\n.EntityTree-module_container__F8BNC .ant-tree .ant-tree-treenode[data-type='more'] .ant-tree-checkbox {\n display: none;\n}\n.EntityTree-module_container__F8BNC .ant-tree .ant-tree-treenode[data-type='sense'],\n.EntityTree-module_container__F8BNC .ant-tree .ant-tree-treenode[data-type='more'] {\n padding-top: 8px;\n}\n.EntityTree-module_container__F8BNC .EntityTree-module_node-more__Zo2wM {\n display: flex;\n align-items: center;\n justify-content: center;\n font-size: 12px;\n color: #2bf2f8;\n column-gap: 4px;\n}\n.EntityTree-module_container__F8BNC .EntityTree-module_node-default__iVIc- {\n display: flex;\n}\n.EntityTree-module_container__F8BNC .EntityTree-module_node-default__iVIc- .EntityTree-module_title__BJnDv {\n overflow: hidden;\n white-space: nowrap;\n text-overflow: ellipsis;\n}\n.EntityTree-module_container__F8BNC .EntityTree-module_node-default__iVIc- .EntityTree-module_total__icLCA {\n flex-shrink: 0;\n}\n.EntityTree-module_container__F8BNC .EntityTree-module_node-sense__s75ax {\n display: flex;\n flex-direction: column;\n row-gap: 12px;\n padding: 8px;\n background: rgba(69, 147, 255, 0.1);\n}\n.EntityTree-module_container__F8BNC .EntityTree-module_node-sense__s75ax .EntityTree-module_title__BJnDv {\n display: flex;\n align-items: center;\n gap: 4px;\n}\n.EntityTree-module_container__F8BNC .EntityTree-module_node-sense__s75ax .EntityTree-module_title__BJnDv > svg {\n width: 20px;\n height: 20px;\n flex-shrink: 0;\n}\n.EntityTree-module_container__F8BNC .EntityTree-module_node-sense__s75ax .EntityTree-module_title__BJnDv > span {\n flex: 1;\n width: 0;\n overflow: hidden;\n white-space: nowrap;\n text-overflow: ellipsis;\n}\n.EntityTree-module_container__F8BNC .EntityTree-module_node-sense__s75ax .EntityTree-module_fields__jwWMe {\n overflow: hidden;\n white-space: nowrap;\n text-overflow: ellipsis;\n}\n.EntityTree-module_node-sense-content__FHgPl {\n display: flex;\n flex-direction: column;\n max-width: 440px;\n}\n.EntityTree-module_highlight__QWIYs {\n background: transparent;\n color: #0FF;\n}\n");var de,ce=function(e){var a=e.viewCodes,s=void 0===a?[]:a,u=e.onTotalChange,f=e.onCheck,p=e.defaultCheckedAll,h={},g=V().ksCode,v=t(!1),E=v[0],A=v[1],b=t([]),C=b[0],B=b[1],N=t([]),I=N[0],T=N[1],S=t([]),j=S[0],P=S[1],J=function(e){return(null==h?void 0:h.keyword)?n.createElement(i,{highlightClassName:le,searchWords:[h.keyword],textToHighlight:e||"",autoEscape:!0}):e},R=function(e){return k(void 0,void 0,void 0,(function(){var n,t,r,i,a,l,d,c,u;return w(this,(function(f){switch(f.label){case 0:return n="more"===e.type,t="senseOrg"===e.type,r=n?e.reqId:e.key,i="senseIcosBook"===e.type||n?e.parentKey:r,a=_(_({},h),{viewCodes:s,page:n?e.morePage:1,pageSize:100}),t?a.orgIds=[r]:a.bookIds=[r],n&&B(o((function(n){G(n,e.key).loading=!0}))),[4,(p=a,H.post("/v2/map-window/search/sense-list",p))];case 1:return l=f.sent(),d=l.list,c=l.pageNum,u=l.total,B(o((function(t){var o,a=G(t,i);if(a){var l=[];if(a.extraChildren&&l.push.apply(l,a.extraChildren),l.push.apply(l,(d||[]).map((function(n){return{key:n.senseGlobalCode,parentKey:i,ksCode:e.ksCode,title:n.dataList[0].fieldValue,dataList:n.dataList,tagCodes:n.tagCodes,tagNames:n.tagNames,"data-type":"sense",type:"sense",isLeaf:!0,dataRef:n}}))),n?(a.children.pop(),(o=a.children).push.apply(o,l)):a.children=l,a.children.length<u){var s=c+1;a.children.push({key:"more__".concat(r,"__").concat(s),parentKey:i,reqId:r,ksCode:e.ksCode,title:"加载更多",morePage:s,loading:!1,moreType:"sense","data-type":"more",type:"more",isLeaf:!0})}}}))),n&&-1!==I.indexOf(e.key)&&T(o((function(e){e.push.apply(e,(d||[]).map((function(e){return e.senseGlobalCode})))}))),[2]}var p}))}))},D=function(e){return k(void 0,void 0,void 0,(function(){var n,t,r,i,a,l;return w(this,(function(d){switch(d.label){case 0:return n="more"===e.type,t=_(_({},h),{viewCodes:s,senseObjCodes:[e.key],isMore:n}),n&&(B(o((function(n){G(n,e.key).loading=!0}))),t.excludeBookIds=function(){var n,t=null===(n=G(C,e.key))||void 0===n?void 0:n.children;return t?t.map((function(e){return e.key})):[]}()),[4,(c=t,H.post("/v1/map-window/search/book-list",c))];case 1:return r=d.sent(),i=r.list,a=r.next,(null==i?void 0:i.length)&&"senseIcosBook"===i[0].type?(l=i[0],[4,R({key:l.code,parentKey:l.parentCode,ksCode:e.ksCode,type:l.type})]):[3,3];case 2:return d.sent(),[2];case 3:return B(o((function(t){var r,o=G(t,e.key);if(o){var l=(i||[]).map((function(n){return{key:n.code,parentKey:n.parentCode,ksCode:e.ksCode,title:n.name,total:n.count,"data-type":n.type,type:n.type,isLeaf:!n.count,dataRef:n}}));n?(o.children.pop(),(r=o.children).push.apply(r,l)):o.children=l,a&&o.children.push({key:"more__".concat(e.key,"__").concat(Date.now()),parentKey:e.key,ksCode:e.ksCode,title:"加载更多",loading:!1,moreType:"senseBook","data-type":"more",type:"more",isLeaf:!0})}}))),n&&-1!==I.indexOf(e.key)&&T((i||[]).map((function(e){return e.code}))),[2]}var c}))}))},K=function(){return k(void 0,void 0,void 0,(function(){var e,n,t,r,o,i,a,l,d,c;return w(this,(function(m){switch(m.label){case 0:return A(!0),e=s.includes("system-icos_gov_user"),n=_(_({},h),{viewCodes:s}),[4,W(n)];case 1:return t=m.sent(),e?(r=null===(d=t[0])||void 0===d?void 0:d.ksCategoryCode,[4,q(n)]):[3,3];case 2:t=m.sent(),m.label=3;case 3:return o=function(e,n,t){for(var r=[],o={},i=(t||{}).children,a=void 0===i?"children":i,l=y(e),d=0;d<l.length;d++){var c=n(l[d]);l[d]=c,o[c.key]=c}return l.forEach((function(e){var n=o[e.parentKey];n&&n.key!==e.key?(n[a]||(n[a]=[])).push(e):r.push(e)})),r}(t,(function(e){return{key:e.code,parentKey:e.parentCode,ksCode:r||e.ksCategoryCode,title:e.name,total:e.count,"data-type":"0000000000"===e.parentCode?"root":e.type,type:e.type,isLeaf:!e.count,dataRef:e}}),e?{children:"extraChildren"}:null),e&&o.forEach((function(e){e["data-type"]="root"})),i=t.reduce((function(n,t){return e||"0000000000"===t.parentCode?n+t.count:n}),0),o.length>1&&(a=x([],o,!0),o=[{key:"all",parentKey:"",title:"全部",total:i,"data-type":"root",type:"all",children:a.map((function(e){return _(_({},e),{parentKey:"all","data-type":e.type})}))}]),B(o),null==u||u(i),p?(l=o.map((function(e){return e.key})),T(l),null==f||f({info:{},total:i})):(T([]),null==f||f({info:{},total:0})),"all"===(null===(c=null==o?void 0:o[0])||void 0===c?void 0:c.type)?P([o[0].key]):P([]),A(!1),[2]}}))}))};return r((function(){K()}),[s]),n.createElement("div",{className:$},n.createElement(l,{spinning:E,delay:500},n.createElement(d,{treeData:C,titleRender:function(e){var t;if("more"===e.type)return n.createElement("div",{className:ee},e.title,e.loading?n.createElement(m,null):n.createElement(Q,null));if("sense"===e.type){var r=(null===(t=e.tagNames)||void 0===t?void 0:t.length)?e.tagNames.join(", "):"",o=n.createElement("div",{className:ae},(e.dataList||[]).map((function(e){return n.createElement("div",{key:e.fieldId},J("".concat(e.fieldName,":").concat(e.fieldValue)))})),r?n.createElement("div",null,J("标签:".concat(r))):null),i=(e.dataList||[]).map((function(e){return"".concat(e.fieldName,":").concat(e.fieldValue)})).join(" ");return r&&(i+=" 标签:".concat(r)),n.createElement("div",{className:oe},n.createElement("div",{className:te,title:e.title},e.ksCode?function(e){var t;if(g)return((t={})[g.person]=n.createElement(O,null),t[g.place]=n.createElement(z,null),t[g.event]=n.createElement(F,null),t[g.object]=n.createElement(M,null),t[g.org]=n.createElement(L,null),t)[e]}(e.ksCode):null,n.createElement("span",null,J(e.title))),i?n.createElement(c,{content:o},n.createElement("div",{className:ie,title:""},J(i))):null)}return n.createElement("div",{className:ne},n.createElement("div",{className:te},J(e.title)),n.createElement("div",{className:re},"(",e.total,")"))},loadData:function(e){return k(void 0,void 0,void 0,(function(){return w(this,(function(n){switch(n.label){case 0:return e.children?[2]:"senseObj"!==e.type?[3,2]:[4,D(e)];case 1:n.sent(),n.label=2;case 2:return"senseBook"!==e.type&&"senseOrg"!==e.type?[3,4]:[4,R(e)];case 3:n.sent(),n.label=4;case 4:return[2]}}))}))},selectedKeys:[],expandedKeys:j,checkedKeys:I,onSelect:function(e,n){var t,r,i=n.node;"more"===i.type?("senseBook"===i.moreType&&D(i),"sense"===i.moreType&&R(i)):"sense"!==i.type&&(t=i.key,r=j.indexOf(t),P(o(-1===r?function(e){e.push(t)}:function(e){e.splice(r,1)})))},onExpand:function(e){P(e)},onCheck:function(e,n){T(e);var t=Y({treeData:C,checkedKeys:e,halfCheckedKeys:n.halfCheckedKeys});null==f||f(t)},onDoubleClick:function(e,n){n.type},checkable:!0,blockNode:!0})))};function se(){return se=Object.assign?Object.assign.bind():function(e){for(var n=1;n<arguments.length;n++){var t=arguments[n];for(var r in t)({}).hasOwnProperty.call(t,r)&&(e[r]=t[r])}return e},se.apply(null,arguments)}var ue=function(n){return e.createElement("svg",se({xmlns:"http://www.w3.org/2000/svg",width:21,height:20,fill:"none"},n),de||(de=e.createElement("path",{fill:"#3CF0E1",d:"m17.65 6.433-4.374-4.375a.63.63 0 0 0-.442-.183h-7.5a1.25 1.25 0 0 0-1.25 1.25v13.75a1.25 1.25 0 0 0 1.25 1.25h11.25a1.25 1.25 0 0 0 1.25-1.25v-10a.63.63 0 0 0-.183-.442M13.46 13.75h-5a.625.625 0 1 1 0-1.25h5a.624.624 0 1 1 0 1.25m0-2.5h-5a.625.625 0 1 1 0-1.25h5a.624.624 0 1 1 0 1.25m-.625-4.375V3.438l3.437 3.437z"})))},fe="index-module_container__7YD-E",pe="index-module_item__OSsjr";X(".index-module_container__7YD-E {\n display: flex;\n flex-direction: column;\n row-gap: 4px;\n}\n.index-module_container__7YD-E .index-module_item__OSsjr {\n color: #0ff;\n font-size: 14px;\n word-break: break-all;\n}\n.index-module_container__7YD-E .index-module_item__OSsjr > svg {\n transform: translateY(4px);\n}\n");var he=function(e){var t=e.value;return(null==t?void 0:t.length)?n.createElement("div",{className:fe},t.map((function(e){return n.createElement("a",{key:e.fileName,className:pe,href:e.url,download:e.fileName},n.createElement(ue,null),e.fileName)}))):"-"},me="index-module_container__fDmC2";X(".index-module_container__fDmC2 {\n display: flex;\n flex-wrap: wrap;\n gap: 8px;\n}\n");var ge=function(e){var t=e.value;return(null==t?void 0:t.length)?n.createElement("div",{className:me},n.createElement(s.PreviewGroup,null,t.map((function(e){return n.createElement(s,{key:e.fileName,width:60,height:60,src:e.url,fallback:"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAMIAAADDCAYAAADQvc6UAAABRWlDQ1BJQ0MgUHJvZmlsZQAAKJFjYGASSSwoyGFhYGDIzSspCnJ3UoiIjFJgf8LAwSDCIMogwMCcmFxc4BgQ4ANUwgCjUcG3awyMIPqyLsis7PPOq3QdDFcvjV3jOD1boQVTPQrgSkktTgbSf4A4LbmgqISBgTEFyFYuLykAsTuAbJEioKOA7DkgdjqEvQHEToKwj4DVhAQ5A9k3gGyB5IxEoBmML4BsnSQk8XQkNtReEOBxcfXxUQg1Mjc0dyHgXNJBSWpFCYh2zi+oLMpMzyhRcASGUqqCZ16yno6CkYGRAQMDKMwhqj/fAIcloxgHQqxAjIHBEugw5sUIsSQpBobtQPdLciLEVJYzMPBHMDBsayhILEqEO4DxG0txmrERhM29nYGBddr//5/DGRjYNRkY/l7////39v///y4Dmn+LgeHANwDrkl1AuO+pmgAAADhlWElmTU0AKgAAAAgAAYdpAAQAAAABAAAAGgAAAAAAAqACAAQAAAABAAAAwqADAAQAAAABAAAAwwAAAAD9b/HnAAAHlklEQVR4Ae3dP3PTWBSGcbGzM6GCKqlIBRV0dHRJFarQ0eUT8LH4BnRU0NHR0UEFVdIlFRV7TzRksomPY8uykTk/zewQfKw/9znv4yvJynLv4uLiV2dBoDiBf4qP3/ARuCRABEFAoBEgghggQAQZQKAnYEaQBAQaASKIAQJEkAEEegJmBElAoBEgghggQAQZQKAnYE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TbUnAARcjYqhQgQoVCzDTUnQIScjUohAkQo1GxDzQkQIWejUogAEQo121BzAkTI2agUIkCEQs021JwAEXI2KoUIEKFQsw01J0CEnI1KIQJEKNRsQ80JECFno1KIABEKNdtQcwJEyNmoFCJAhELNNtScABFyNiqFCBChULMNNSdAhJyNSiEC/wGgKKC4YMA4TAAAAABJRU5ErkJggg=="})})))):"-"},ve="index-module_container__q5ZGw",ye="index-module_value__4UnN-";X(".index-module_container__q5ZGw {\n display: flex;\n flex-wrap: wrap;\n gap: 8px;\n}\n.index-module_container__q5ZGw .index-module_value__4UnN- {\n border-radius: 4px;\n background: rgba(0, 255, 255, 0.2);\n padding: 4px 12px;\n color: #0FF;\n font-size: 12px;\n font-style: normal;\n font-weight: 400;\n line-height: 18px;\n}\n");var Ee,Ae=function(e){var t=e.value;return(null==t?void 0:t.length)?n.createElement("div",{className:ve},t.map((function(e){return n.createElement("div",{key:e,className:ye},e)}))):"-"};function _e(){return _e=Object.assign?Object.assign.bind():function(e){for(var n=1;n<arguments.length;n++){var t=arguments[n];for(var r in t)({}).hasOwnProperty.call(t,r)&&(e[r]=t[r])}return e},_e.apply(null,arguments)}var ke=function(n){return e.createElement("svg",_e({xmlns:"http://www.w3.org/2000/svg",width:16,height:16,fill:"none"},n),Ee||(Ee=e.createElement("path",{fill:"#0FF",d:"M12 4.5v7a1 1 0 0 1-1 1H2a1 1 0 0 1-1-1v-7a1 1 0 0 1 1-1h9a1 1 0 0 1 1 1m3.625.016a.52.52 0 0 0-.415.076l-2.099 1.4a.25.25 0 0 0-.111.207v3.602a.25.25 0 0 0 .111.208l2.111 1.407a.5.5 0 0 0 .537.012.52.52 0 0 0 .24-.448V5a.5.5 0 0 0-.374-.484"})))},we="index-module_container__4mEf4",xe="index-module_item__0764d",be="index-module_label__tTm1g",Ce="index-module_value__vycbA",Be="index-module_button__HL70E";X(".index-module_container__4mEf4 {\n display: flex;\n flex-direction: column;\n}\n.index-module_container__4mEf4 .index-module_item__0764d {\n display: flex;\n width: 100%;\n margin-top: -1px;\n color: #FFF;\n font-size: 16px;\n font-style: normal;\n font-weight: 500;\n line-height: 24px;\n}\n.index-module_container__4mEf4 .index-module_item__0764d .index-module_label__tTm1g,\n.index-module_container__4mEf4 .index-module_item__0764d .index-module_value__vycbA {\n padding: 16px;\n border: 1px solid rgba(255, 255, 255, 0.1);\n}\n.index-module_container__4mEf4 .index-module_item__0764d .index-module_label__tTm1g {\n flex: 0 0 138px;\n width: 138px;\n background: linear-gradient(90deg, rgba(60, 125, 250, 0.1) -3.63%, rgba(60, 240, 225, 0.08) 100%);\n}\n.index-module_container__4mEf4 .index-module_item__0764d .index-module_value__vycbA {\n flex: 1;\n display: flex;\n align-items: center;\n border-left: none;\n}\n.index-module_container__4mEf4 .index-module_item__0764d .index-module_value__vycbA > span {\n display: inline-flex;\n margin-left: 4px;\n cursor: pointer;\n}\n.index-module_container__4mEf4 .index-module_item__0764d .index-module_button__HL70E {\n color: #00FEFE;\n cursor: pointer;\n}\n");var Ne=function(e){var t=e.data,r=function(e){return k(void 0,void 0,void 0,(function(){var n,t,r;return w(this,(function(o){switch(o.label){case 0:return(null==e?void 0:e.length)?[4,(i={openUserIds:e},H.post("/v1/sense-form/meeting-info",i))]:[3,2];case 1:n=o.sent(),t=n.confirmMessage,r=n.url,t?u.confirm({content:t,onOk:function(){window.open(r)}}):r&&window.open(r),o.label=2;case 2:return[2]}var i}))}))};if(!t)return null;var o=function(e){var t;return"string"==typeof e.fieldValue?e.fieldValue&&(null===(t=e.props)||void 0===t?void 0:t.unit)?"".concat(e.fieldValue).concat(e.props.unit):e.fieldValue||"-":"object"==typeof e.fieldValue?function(e){var t=e.widget,r=e.fieldValue;return"IdCardWidget"===t?"".concat(r.idCardType," - ").concat(r.idCardNumber):"RegionWidget"===t?r.regionDesc||"-":"AddressFillWidget"===t?"".concat(r.regionDesc,"/").concat(r.addressDetail):"MapPointWidget"===t?"".concat(r.lon,", ").concat(r.lat):"MapLineWidget"===t?"请在地图上查看路线信息":"MapPolygonWidget"===t?"请在地图上查看区块信息":"FileUploadWidget"===t?n.createElement(he,{value:r}):"ImageUploadWidget"===t?n.createElement(ge,{value:r}):["IncrementInputWidget","MultiSelectWidget","CascadeSelectWidget"].includes(t)?r?r.join("/"):"-":"CustomTags"===t?n.createElement(Ae,{value:r}):JSON.stringify(e.fieldValue)||"-"}(e):"-"};return n.createElement("div",{className:we},t.map((function(e){return e.hidden?null:n.createElement("div",{key:e.fieldId,className:xe},n.createElement("div",{className:be},e.fieldName),n.createElement("div",{className:Ce},e.linkEntityCode?n.createElement("span",{className:Be,onClick:function(){return n=e.linkEntityCode,void console.log(n);var n}},o(e)):o(e),e.openUserId?n.createElement("span",{onClick:function(){return r([e.openUserId])}},n.createElement(ke,null)):null))})))},Qe=function(e){var n=e.bookId,t=e.senseCode;return H.get("/v2/sense-form/sense-detail/".concat(n,"/").concat(t))},Ie="EntityInfo-module_container__n1dmP";X(".EntityInfo-module_container__n1dmP * {\n box-sizing: border-box;\n}\n");var Te=function(e){var t=e.senseGlobalCode,r=E((function(){return k(void 0,void 0,void 0,(function(){var e,n,r,o,i,a,l,d;return w(this,(function(c){switch(c.label){case 0:return e=function(e){if(!e)return{};var n=e.split("|");return{senseObjCode:n[0],templateId:n[1],bookId:n[2],senseCode:n.slice(3).join("|")}}(t),n=e.bookId,r=e.senseCode,[4,Qe({bookId:n,senseCode:r})];case 1:return(null==(o=c.sent())?void 0:o.icosSenseDetail)?i=o.icosSenseDetail.fieldInfoList:(null==o?void 0:o.jmtSenseDetail)&&(s=o.jmtSenseDetail.schemaJSON,u=JSON.parse(s).schema,f=[],p=function(e,n){e.forEach((function(e){var t=e.id,r=e.props,o=e.maps,i=e.widget,a=e.children;a&&0!==a.length?p(a,x(x([],n,!0),[t],!1)):f.push({id:t,path:x(x([],n,!0),[t],!1),props:r,maps:o,widget:i})}))},p(u.children||[],[u.id]),a=f,o.jmtSenseDetail.entityInfo&&(l=JSON.parse(o.jmtSenseDetail.entityInfo),i=a.map((function(e){var n,t,r,i,a;return{fieldId:e.id,fieldName:e.props.title,fieldValue:(i=l,a=e.path,a.reduce((function(e,n){return e&&void 0!==e[n]?e[n]:void 0}),i)),maps:e.maps,props:e.props,widget:e.widget,linkEntityCode:null===(t=null===(n=o.jmtSenseDetail.jumpVOList)||void 0===n?void 0:n.find((function(n){return n.fieldName===e.id})))||void 0===t?void 0:t.entityCode,hidden:e.props.hidden||!e.props.title,readonly:null===(r=o.readonlyList)||void 0===r?void 0:r.includes(e.id)}})))),i.length&&(null===(d=o.tagNames)||void 0===d?void 0:d.length)&&i.push({fieldId:"CustomTags",fieldName:"标签",fieldValue:o.tagNames,widget:"CustomTags"}),[2,i]}var s,u,f,p}))}))}),{refreshDeps:[t]}).data;return r?n.createElement("div",{className:Ie},n.createElement(Ne,{data:r})):null},Oe="EntityTable-module_container__vwTV3";X(".EntityTable-module_container__vwTV3 * {\n box-sizing: border-box;\n}\n");var Se={current:1,total:0,pageSize:50,pageSizeOptions:["20","50","100","200"],showSizeChanger:!0,showQuickJumper:!0,hideOnSinglePage:!1,showTotal:function(e){return"共 ".concat(e," 条")}},je=function(e){var o=e.bookId,i=t([]),a=i[0],l=i[1],d=t([]),c=d[0],s=d[1],u=t(_({},Se)),m=u[0],v=u[1],y=t({}),E=y[0],A=y[1],x=function(e){return k(void 0,[e],void 0,(function(e){var t,r,i,a,d=e.pagination,c=void 0===d?m:d,u=e.sorter,f=void 0===u?E:u;return w(this,(function(e){switch(e.label){case 0:return t=f.order?{sortField:f.field,sortFieldOrder:"descend"===f.order?"desc":"asc"}:{},[4,(d=_(_({page:c.current,pageSize:c.pageSize},t),{bookId:o,keyword:"",viewCodes:["system-icos_city_object"]}),H.post("/v1/entity-manager/sense-page",d))];case 1:return r=e.sent(),l(null===(i=r.header)||void 0===i?void 0:i.map((function(e){return{key:e.code,dataIndex:e.code,title:e.name,width:200,sorter:e.sort,sortOrder:r.sortField===e.code?"desc"===r.sortFieldOrder?"descend":"ascend":null,ellipsis:!0}}))),v(function(e,t){var r=e||{},o=r.pageNum,i=r.pageSize,a=r.total;return _(_({},t),{total:a?a>1e4?1e4:a:0,current:o||1,pageSize:i||t.pageSize,showTotal:function(){return n.createElement(p,{align:"center"},a>1e4?n.createElement(h,{title:"最大展示10000条"},n.createElement(g,null)):null,n.createElement("span",null,"共",a,"条"))}})}(r.body,c)),s(null===(a=r.body)||void 0===a?void 0:a.list),[2,r]}var d}))}))};return r((function(){x({})}),[]),n.createElement("div",{className:Oe},n.createElement(f,{columns:a,dataSource:c,pagination:m,onChange:function(e,n,t){v(e),A(t),x({pagination:e,sorter:t})},scroll:{x:"100%"},sticky:!0}))},ze=function(e){return e.map((function(e){return{key:e.regionId,title:e.regionName,isLeaf:!!e.leaf}}))},Pe=function(e){return H.get("/open/gis/v1/region-children",e)},Je="RegionTree-module_container__baOAt";X(".RegionTree-module_container__baOAt {\n width: 100%;\n height: 100%;\n overflow-x: hidden;\n overflow-y: auto;\n}\n.RegionTree-module_container__baOAt * {\n box-sizing: border-box;\n}\n.RegionTree-module_container__baOAt .ant-spin-nested-loading {\n width: 100%;\n height: 100%;\n}\n.RegionTree-module_container__baOAt .ant-tree {\n background: transparent;\n color: rgba(255, 255, 255, 0.8);\n}\n.RegionTree-module_container__baOAt .ant-tree .ant-tree-node-content-wrapper:hover,\n.RegionTree-module_container__baOAt .ant-tree .ant-tree-checkbox + span:hover,\n.RegionTree-module_container__baOAt .ant-tree .ant-tree-switcher:not(.ant-tree-switcher-noop):hover:before {\n background: transparent;\n}\n.RegionTree-module_container__baOAt .ant-tree.ant-tree-block-node .ant-tree-list-holder-inner .ant-tree-node-content-wrapper {\n width: 0;\n}\n.RegionTree-module_container__baOAt .ant-tree .ant-tree-treenode {\n align-items: center;\n padding: 0;\n min-height: 40px;\n}\n.RegionTree-module_container__baOAt .ant-tree .ant-tree-treenode .ant-tree-switcher {\n line-height: 40px;\n}\n.RegionTree-module_container__baOAt .ant-tree .ant-tree-treenode .ant-tree-checkbox {\n align-self: center;\n margin: 0;\n}\n");var Fe=function(){var e=t(!1),r=e[0],i=e[1],a=t([]),c=a[0],s=a[1];return A((function(){return k(void 0,void 0,void 0,(function(){var e;return w(this,(function(n){switch(n.label){case 0:return i(!0),[4,Pe()];case 1:return e=n.sent(),s(ze(e)),i(!1),[2]}}))}))})),n.createElement("div",{className:Je},n.createElement(l,{spinning:r,delay:500},n.createElement(d,{treeData:c,loadData:function(e){return k(void 0,void 0,void 0,(function(){var n;return w(this,(function(t){switch(t.label){case 0:return[4,Pe({regionId:e.key})];case 1:return n=t.sent(),console.log(n),s(o((function(t){G(t,e.key).children=ze(n)}))),[2]}}))}))},selectedKeys:[],blockNode:!0})))};export{Te as EntityInfo,je as EntityTable,ce as EntityTree,Fe as RegionTree,C as config};
|
package/package.json
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"name": "@icos-desktop/react-components",
|
3
|
-
"version": "0.1.
|
3
|
+
"version": "0.1.3",
|
4
4
|
"description": "ICOS Desktop React Components",
|
5
5
|
"module": "build/index.js",
|
6
6
|
"types": "build/index.d.ts",
|
@@ -35,6 +35,7 @@
|
|
35
35
|
"@rollup/plugin-image": "^3.0.3",
|
36
36
|
"@rollup/plugin-json": "^6.1.0",
|
37
37
|
"@rollup/plugin-node-resolve": "^15.2.3",
|
38
|
+
"@rollup/plugin-terser": "^0.4.4",
|
38
39
|
"@rollup/plugin-typescript": "^11.1.6",
|
39
40
|
"@storybook/addon-essentials": "^8.2.9",
|
40
41
|
"@storybook/addon-interactions": "^8.2.9",
|
@@ -62,7 +63,6 @@
|
|
62
63
|
"react": "^18.3.1",
|
63
64
|
"react-dom": "^18.3.1",
|
64
65
|
"rollup": "^4.20.0",
|
65
|
-
"rollup-plugin-copy": "^3.5.0",
|
66
66
|
"rollup-plugin-delete": "^2.0.0",
|
67
67
|
"rollup-plugin-dts": "^6.1.1",
|
68
68
|
"rollup-plugin-peer-deps-external": "^2.2.4",
|