@icos-desktop/react-components 2.0.50 → 2.1.1
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/dist/icos-desktop.d.ts +34 -2
- package/dist/icos-desktop.js +247 -67
- package/dist/icos-desktop.umd.cjs +1 -1
- package/package.json +164 -68
package/dist/icos-desktop.d.ts
CHANGED
@@ -950,7 +950,29 @@ declare const CcosSenseManager: {
|
|
950
950
|
settings: ComponentPrototype;
|
951
951
|
};
|
952
952
|
|
953
|
+
interface SenseSearchRef {
|
954
|
+
/**
|
955
|
+
* 触发搜索
|
956
|
+
*/
|
957
|
+
search: () => void;
|
958
|
+
/**
|
959
|
+
* 设置表单值
|
960
|
+
*/
|
961
|
+
setFieldsValue: (values: any) => void;
|
962
|
+
/**
|
963
|
+
* 重置表单值
|
964
|
+
*/
|
965
|
+
resetFields: (fields: any) => void;
|
966
|
+
/**
|
967
|
+
* AI搜索
|
968
|
+
*/
|
969
|
+
aiSearch: (res: any) => void;
|
970
|
+
}
|
953
971
|
interface SenseSearchProps {
|
972
|
+
/**
|
973
|
+
* 隐藏搜索
|
974
|
+
*/
|
975
|
+
hiddenSearch?: boolean;
|
954
976
|
/**
|
955
977
|
* 功能视图编码
|
956
978
|
*/
|
@@ -988,7 +1010,7 @@ interface SenseSearchProps {
|
|
988
1010
|
inputIconColor?: string;
|
989
1011
|
}
|
990
1012
|
|
991
|
-
declare const SenseSearch:
|
1013
|
+
declare const SenseSearch: React.ForwardRefExoticComponent<SenseSearchProps & React.RefAttributes<SenseSearchRef>>;
|
992
1014
|
|
993
1015
|
interface CcosSenseSearchProps extends SenseSearchProps {
|
994
1016
|
'data-dnd': string;
|
@@ -1214,7 +1236,17 @@ declare const CcosSenseTree: {
|
|
1214
1236
|
settings: ComponentPrototype;
|
1215
1237
|
};
|
1216
1238
|
|
1239
|
+
interface SenseViewRef {
|
1240
|
+
/**
|
1241
|
+
* AI搜索
|
1242
|
+
*/
|
1243
|
+
aiSearch: (res: any) => void;
|
1244
|
+
}
|
1217
1245
|
interface SenseViewProps {
|
1246
|
+
/**
|
1247
|
+
* 隐藏搜索
|
1248
|
+
*/
|
1249
|
+
hiddenSearch?: boolean;
|
1218
1250
|
/**
|
1219
1251
|
* 功能视图编码
|
1220
1252
|
*/
|
@@ -1308,7 +1340,7 @@ interface SenseViewProps {
|
|
1308
1340
|
onScatterAggregation?: (data: any) => void;
|
1309
1341
|
}
|
1310
1342
|
|
1311
|
-
declare const SenseView:
|
1343
|
+
declare const SenseView: React.ForwardRefExoticComponent<SenseViewProps & React.RefAttributes<SenseViewRef>>;
|
1312
1344
|
|
1313
1345
|
interface CcosSenseViewProps extends SenseViewProps {
|
1314
1346
|
'data-dnd': string;
|
package/dist/icos-desktop.js
CHANGED
@@ -123,6 +123,7 @@ function bind(fn, thisArg) {
|
|
123
123
|
|
124
124
|
const {toString} = Object.prototype;
|
125
125
|
const {getPrototypeOf} = Object;
|
126
|
+
const {iterator, toStringTag} = Symbol;
|
126
127
|
|
127
128
|
const kindOf = (cache => thing => {
|
128
129
|
const str = toString.call(thing);
|
@@ -249,7 +250,7 @@ const isPlainObject = (val) => {
|
|
249
250
|
}
|
250
251
|
|
251
252
|
const prototype = getPrototypeOf(val);
|
252
|
-
return (prototype === null || prototype === Object.prototype || Object.getPrototypeOf(prototype) === null) && !(
|
253
|
+
return (prototype === null || prototype === Object.prototype || Object.getPrototypeOf(prototype) === null) && !(toStringTag in val) && !(iterator in val);
|
253
254
|
};
|
254
255
|
|
255
256
|
/**
|
@@ -600,13 +601,13 @@ const isTypedArray = (TypedArray => {
|
|
600
601
|
* @returns {void}
|
601
602
|
*/
|
602
603
|
const forEachEntry = (obj, fn) => {
|
603
|
-
const generator = obj && obj[
|
604
|
+
const generator = obj && obj[iterator];
|
604
605
|
|
605
|
-
const
|
606
|
+
const _iterator = generator.call(obj);
|
606
607
|
|
607
608
|
let result;
|
608
609
|
|
609
|
-
while ((result =
|
610
|
+
while ((result = _iterator.next()) && !result.done) {
|
610
611
|
const pair = result.value;
|
611
612
|
fn.call(obj, pair[0], pair[1]);
|
612
613
|
}
|
@@ -719,26 +720,6 @@ const toFiniteNumber = (value, defaultValue) => {
|
|
719
720
|
return value != null && Number.isFinite(value = +value) ? value : defaultValue;
|
720
721
|
};
|
721
722
|
|
722
|
-
const ALPHA = 'abcdefghijklmnopqrstuvwxyz';
|
723
|
-
|
724
|
-
const DIGIT = '0123456789';
|
725
|
-
|
726
|
-
const ALPHABET = {
|
727
|
-
DIGIT,
|
728
|
-
ALPHA,
|
729
|
-
ALPHA_DIGIT: ALPHA + ALPHA.toUpperCase() + DIGIT
|
730
|
-
};
|
731
|
-
|
732
|
-
const generateString = (size = 16, alphabet = ALPHABET.ALPHA_DIGIT) => {
|
733
|
-
let str = '';
|
734
|
-
const {length} = alphabet;
|
735
|
-
while (size--) {
|
736
|
-
str += alphabet[Math.random() * length|0];
|
737
|
-
}
|
738
|
-
|
739
|
-
return str;
|
740
|
-
};
|
741
|
-
|
742
723
|
/**
|
743
724
|
* If the thing is a FormData object, return true, otherwise return false.
|
744
725
|
*
|
@@ -747,7 +728,7 @@ const generateString = (size = 16, alphabet = ALPHABET.ALPHA_DIGIT) => {
|
|
747
728
|
* @returns {boolean}
|
748
729
|
*/
|
749
730
|
function isSpecCompliantForm(thing) {
|
750
|
-
return !!(thing && isFunction(thing.append) && thing[
|
731
|
+
return !!(thing && isFunction(thing.append) && thing[toStringTag] === 'FormData' && thing[iterator]);
|
751
732
|
}
|
752
733
|
|
753
734
|
const toJSONObject = (obj) => {
|
@@ -816,6 +797,10 @@ const asap = typeof queueMicrotask !== 'undefined' ?
|
|
816
797
|
|
817
798
|
// *********************
|
818
799
|
|
800
|
+
|
801
|
+
const isIterable = (thing) => thing != null && isFunction(thing[iterator]);
|
802
|
+
|
803
|
+
|
819
804
|
var utils$1 = {
|
820
805
|
isArray,
|
821
806
|
isArrayBuffer,
|
@@ -866,14 +851,13 @@ var utils$1 = {
|
|
866
851
|
findKey,
|
867
852
|
global: _global,
|
868
853
|
isContextDefined,
|
869
|
-
ALPHABET,
|
870
|
-
generateString,
|
871
854
|
isSpecCompliantForm,
|
872
855
|
toJSONObject,
|
873
856
|
isAsyncFn,
|
874
857
|
isThenable,
|
875
858
|
setImmediate: _setImmediate,
|
876
|
-
asap
|
859
|
+
asap,
|
860
|
+
isIterable
|
877
861
|
};
|
878
862
|
|
879
863
|
/**
|
@@ -1854,10 +1838,18 @@ let AxiosHeaders$1 = class AxiosHeaders {
|
|
1854
1838
|
setHeaders(header, valueOrRewrite);
|
1855
1839
|
} else if(utils$1.isString(header) && (header = header.trim()) && !isValidHeaderName(header)) {
|
1856
1840
|
setHeaders(parseHeaders(header), valueOrRewrite);
|
1857
|
-
} else if (utils$1.
|
1858
|
-
|
1859
|
-
|
1841
|
+
} else if (utils$1.isObject(header) && utils$1.isIterable(header)) {
|
1842
|
+
let obj = {}, dest, key;
|
1843
|
+
for (const entry of header) {
|
1844
|
+
if (!utils$1.isArray(entry)) {
|
1845
|
+
throw TypeError('Object iterator must return a key-value pair');
|
1846
|
+
}
|
1847
|
+
|
1848
|
+
obj[key = entry[0]] = (dest = obj[key]) ?
|
1849
|
+
(utils$1.isArray(dest) ? [...dest, entry[1]] : [dest, entry[1]]) : entry[1];
|
1860
1850
|
}
|
1851
|
+
|
1852
|
+
setHeaders(obj, valueOrRewrite);
|
1861
1853
|
} else {
|
1862
1854
|
header != null && setHeader(valueOrRewrite, header, rewrite);
|
1863
1855
|
}
|
@@ -1999,6 +1991,10 @@ let AxiosHeaders$1 = class AxiosHeaders {
|
|
1999
1991
|
return Object.entries(this.toJSON()).map(([header, value]) => header + ': ' + value).join('\n');
|
2000
1992
|
}
|
2001
1993
|
|
1994
|
+
getSetCookie() {
|
1995
|
+
return this.get("set-cookie") || [];
|
1996
|
+
}
|
1997
|
+
|
2002
1998
|
get [Symbol.toStringTag]() {
|
2003
1999
|
return 'AxiosHeaders';
|
2004
2000
|
}
|
@@ -2354,8 +2350,9 @@ function combineURLs(baseURL, relativeURL) {
|
|
2354
2350
|
*
|
2355
2351
|
* @returns {string} The combined full path
|
2356
2352
|
*/
|
2357
|
-
function buildFullPath(baseURL, requestedURL) {
|
2358
|
-
|
2353
|
+
function buildFullPath(baseURL, requestedURL, allowAbsoluteUrls) {
|
2354
|
+
let isRelativeUrl = !isAbsoluteURL(requestedURL);
|
2355
|
+
if (baseURL && (isRelativeUrl || allowAbsoluteUrls == false)) {
|
2359
2356
|
return combineURLs(baseURL, requestedURL);
|
2360
2357
|
}
|
2361
2358
|
return requestedURL;
|
@@ -2470,7 +2467,7 @@ var resolveConfig = (config) => {
|
|
2470
2467
|
|
2471
2468
|
newConfig.headers = headers = AxiosHeaders$1.from(headers);
|
2472
2469
|
|
2473
|
-
newConfig.url = buildURL(buildFullPath(newConfig.baseURL, newConfig.url), config.params, config.paramsSerializer);
|
2470
|
+
newConfig.url = buildURL(buildFullPath(newConfig.baseURL, newConfig.url, newConfig.allowAbsoluteUrls), config.params, config.paramsSerializer);
|
2474
2471
|
|
2475
2472
|
// HTTP basic authentication
|
2476
2473
|
if (auth) {
|
@@ -3033,7 +3030,7 @@ var fetchAdapter = isFetchSupported && (async (config) => {
|
|
3033
3030
|
} catch (err) {
|
3034
3031
|
unsubscribe && unsubscribe();
|
3035
3032
|
|
3036
|
-
if (err && err.name === 'TypeError' && /fetch/i.test(err.message)) {
|
3033
|
+
if (err && err.name === 'TypeError' && /Load failed|fetch/i.test(err.message)) {
|
3037
3034
|
throw Object.assign(
|
3038
3035
|
new AxiosError$1('Network Error', AxiosError$1.ERR_NETWORK, config, request),
|
3039
3036
|
{
|
@@ -3193,7 +3190,7 @@ function dispatchRequest(config) {
|
|
3193
3190
|
});
|
3194
3191
|
}
|
3195
3192
|
|
3196
|
-
const VERSION$1 = "1.
|
3193
|
+
const VERSION$1 = "1.9.0";
|
3197
3194
|
|
3198
3195
|
const validators$1 = {};
|
3199
3196
|
|
@@ -3301,7 +3298,7 @@ const validators = validator.validators;
|
|
3301
3298
|
*/
|
3302
3299
|
let Axios$1 = class Axios {
|
3303
3300
|
constructor(instanceConfig) {
|
3304
|
-
this.defaults = instanceConfig;
|
3301
|
+
this.defaults = instanceConfig || {};
|
3305
3302
|
this.interceptors = {
|
3306
3303
|
request: new InterceptorManager(),
|
3307
3304
|
response: new InterceptorManager()
|
@@ -3378,6 +3375,13 @@ let Axios$1 = class Axios {
|
|
3378
3375
|
}
|
3379
3376
|
}
|
3380
3377
|
|
3378
|
+
// Set config.allowAbsoluteUrls
|
3379
|
+
if (config.allowAbsoluteUrls !== undefined) ; else if (this.defaults.allowAbsoluteUrls !== undefined) {
|
3380
|
+
config.allowAbsoluteUrls = this.defaults.allowAbsoluteUrls;
|
3381
|
+
} else {
|
3382
|
+
config.allowAbsoluteUrls = true;
|
3383
|
+
}
|
3384
|
+
|
3381
3385
|
validator.assertOptions(config, {
|
3382
3386
|
baseUrl: validators.spelling('baseURL'),
|
3383
3387
|
withXsrfToken: validators.spelling('withXSRFToken')
|
@@ -3473,7 +3477,7 @@ let Axios$1 = class Axios {
|
|
3473
3477
|
|
3474
3478
|
getUri(config) {
|
3475
3479
|
config = mergeConfig$1(this.defaults, config);
|
3476
|
-
const fullPath = buildFullPath(config.baseURL, config.url);
|
3480
|
+
const fullPath = buildFullPath(config.baseURL, config.url, config.allowAbsoluteUrls);
|
3477
3481
|
return buildURL(fullPath, config.params, config.paramsSerializer);
|
3478
3482
|
}
|
3479
3483
|
};
|
@@ -3944,9 +3948,10 @@ var request = createInstance({
|
|
3944
3948
|
// signal: controller.signal,
|
3945
3949
|
});
|
3946
3950
|
var req = function (config) {
|
3947
|
-
|
3951
|
+
// const { apiPrefix = '/api/icos/desktop' } = getConfig();
|
3952
|
+
var _a = getConfig().apiPrefix, apiPrefix = _a === void 0 ? '/gatehub/icos-desktop-00001' : _a;
|
3948
3953
|
try {
|
3949
|
-
return request(__assign({ baseURL: apiPrefix }, config));
|
3954
|
+
return request(__assign({ baseURL: apiPrefix, headers: __assign({ 'X-OS-App-Id': 'debug-app' }, config.headers) }, config));
|
3950
3955
|
}
|
3951
3956
|
catch (e) {
|
3952
3957
|
console.log(e);
|
@@ -6869,7 +6874,9 @@ var showTotal$1 = function (total) {
|
|
6869
6874
|
};
|
6870
6875
|
var SenseTable = forwardRef(function (props, ref) {
|
6871
6876
|
var _a;
|
6872
|
-
var bookId = props.bookId, bookIds = props.bookIds, templateId = props.templateId, leafRegionId = props.leafRegionId, pathRegionId = props.pathRegionId, viewCodes = props.viewCodes, keyword = props.keyword, filter = props.filter, filterConfig = props.filterConfig, extendColumnParams = props.extendColumnParams, _b = props.hideColumns, hideColumns = _b === void 0 ? [] : _b, customColumns = props.customColumns, contextMenuConfig = props.contextMenuConfig, enableTag = props.enableTag, writeAuth = props.writeAuth, _c = props.pageSize, pageSize = _c === void 0 ? 1000 : _c, onClick = props.onClick, onDoubleClick = props.onDoubleClick, onShowSense = props.onShowSense, onEditSense = props.onEditSense, onRefresh = props.onRefresh,
|
6877
|
+
var bookId = props.bookId, bookIds = props.bookIds, templateId = props.templateId, leafRegionId = props.leafRegionId, pathRegionId = props.pathRegionId, viewCodes = props.viewCodes, keyword = props.keyword, filter = props.filter, filterConfig = props.filterConfig, extendColumnParams = props.extendColumnParams, _b = props.hideColumns, hideColumns = _b === void 0 ? [] : _b, customColumns = props.customColumns, contextMenuConfig = props.contextMenuConfig, enableTag = props.enableTag, writeAuth = props.writeAuth, _c = props.pageSize, pageSize = _c === void 0 ? 1000 : _c, onClick = props.onClick, onDoubleClick = props.onDoubleClick, onShowSense = props.onShowSense, onEditSense = props.onEditSense, onRefresh = props.onRefresh,
|
6878
|
+
// proTableContainerHeight,
|
6879
|
+
tableProps = __rest(props, ["bookId", "bookIds", "templateId", "leafRegionId", "pathRegionId", "viewCodes", "keyword", "filter", "filterConfig", "extendColumnParams", "hideColumns", "customColumns", "contextMenuConfig", "enableTag", "writeAuth", "pageSize", "onClick", "onDoubleClick", "onShowSense", "onEditSense", "onRefresh"]);
|
6873
6880
|
var PAGINATION = {
|
6874
6881
|
current: 1,
|
6875
6882
|
total: 0,
|
@@ -7205,7 +7212,8 @@ var SenseTable = forwardRef(function (props, ref) {
|
|
7205
7212
|
_a)), style: { '--row-selected-num': selectedRowKeys.length } },
|
7206
7213
|
React__default.createElement(ProTable$1, __assign({ header: header, columns: columns, dataSource: dataSource, loading: loading, pagination: pagination, size: "small", rowKey: "sense_global_code", onRow: onRow, rowClassName: rowClassName, onChange: handleChangeTable,
|
7207
7214
|
// rowSelection={tableProps?.rowSelection ?? rowSelection}
|
7208
|
-
containerHeight
|
7215
|
+
// containerHeight={proTableContainerHeight}
|
7216
|
+
scroll: { x: 'max-content', y: null } }, tableProps))),
|
7209
7217
|
React__default.createElement(ExportModal, null),
|
7210
7218
|
React__default.createElement(TagsModal, { open: showTagsModal, onCancel: handleCloseTagsModal, data: curRecord }),
|
7211
7219
|
(contextMenuConfig === null || contextMenuConfig === void 0 ? void 0 : contextMenuConfig.length) ? (React__default.createElement(ContextMenu$3, { config: contextMenuConfig, authTypes: authTypes })) : null));
|
@@ -8796,6 +8804,16 @@ var findAllParentNodes$1 = function (tree, targetKey, parentNodes) {
|
|
8796
8804
|
}
|
8797
8805
|
return null;
|
8798
8806
|
};
|
8807
|
+
// 获取指定节点的父节点链路
|
8808
|
+
var getParentChainKeys = function (tree, key) {
|
8809
|
+
var keys = [];
|
8810
|
+
var node = findNodeByKey(tree, key);
|
8811
|
+
while (node) {
|
8812
|
+
keys.unshift(node.key);
|
8813
|
+
node = findNodeByKey(tree, node.parentKey);
|
8814
|
+
}
|
8815
|
+
return keys;
|
8816
|
+
};
|
8799
8817
|
|
8800
8818
|
var _path$w;
|
8801
8819
|
function _extends$y() { return _extends$y = 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$y.apply(null, arguments); }
|
@@ -12896,10 +12914,9 @@ var getLinePolygonGeom = function (line, km) {
|
|
12896
12914
|
if (km === void 0) { km = 1; }
|
12897
12915
|
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
|
12898
12916
|
// @ts-expect-error
|
12899
|
-
var buffer = turf.buffer({
|
12900
|
-
|
12901
|
-
|
12902
|
-
}, km, { units: 'kilometers' });
|
12917
|
+
var buffer = turf.buffer({ type: 'Feature', geometry: wkt.parse(line) }, km, {
|
12918
|
+
units: 'kilometers',
|
12919
|
+
});
|
12903
12920
|
return turf.getGeom(buffer);
|
12904
12921
|
};
|
12905
12922
|
// 合并多个区域
|
@@ -13357,10 +13374,7 @@ KnnItems.EMPTY_KNN_ITEM = EMPTY_KNN_ITEM;
|
|
13357
13374
|
|
13358
13375
|
var RangePicker = DatePicker.RangePicker;
|
13359
13376
|
var AdvancedSearch = function (_a) {
|
13360
|
-
var searchModeConfig = _a.searchMode, onSearch = _a.onSearch, onMapDraw = _a.onMapDraw, onStartDraw = _a.onStartDraw;
|
13361
|
-
// 实体分类列表
|
13362
|
-
// const entityClassTree = useAtomValue(store.entityClassTree);
|
13363
|
-
var entityClassTree = [];
|
13377
|
+
var entityClassTree = _a.entityClassTree, searchModeConfig = _a.searchMode, onSearch = _a.onSearch, onMapDraw = _a.onMapDraw, onStartDraw = _a.onStartDraw;
|
13364
13378
|
// 当前的绘制模式
|
13365
13379
|
var _b = useState(''), drawMode = _b[0], setDrawMode = _b[1];
|
13366
13380
|
// 视图编码
|
@@ -13381,8 +13395,6 @@ var AdvancedSearch = function (_a) {
|
|
13381
13395
|
// 地区选择树数据
|
13382
13396
|
var _j = useState([]), regionTreeData = _j[0], setRegionTreeData = _j[1];
|
13383
13397
|
var form = Form.useFormInstance();
|
13384
|
-
var useToken = theme.useToken;
|
13385
|
-
useToken().token;
|
13386
13398
|
// 时空搜索类型
|
13387
13399
|
var searchMode = Form.useWatch(FORM_ITEMS.SEARCH_MODE, form);
|
13388
13400
|
// 空间搜索类型
|
@@ -13736,10 +13748,14 @@ var AdvancedSearch = function (_a) {
|
|
13736
13748
|
curLines = __spreadArray(__spreadArray([], (lines || []).map(function (item) { return ({
|
13737
13749
|
id: "line__".concat(item.id),
|
13738
13750
|
data: item.data,
|
13751
|
+
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
|
13752
|
+
// @ts-expect-error
|
13739
13753
|
polygon: lineRange ? wkt.stringify(getLinePolygonGeom(item.data, lineRange)) : null,
|
13740
13754
|
}); }), true), (selectLines || []).map(function (item) { return ({
|
13741
13755
|
id: "selectLine__".concat(item),
|
13742
13756
|
data: item,
|
13757
|
+
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
|
13758
|
+
// @ts-expect-error
|
13743
13759
|
polygon: lineRange ? wkt.stringify(getLinePolygonGeom(item, lineRange)) : null,
|
13744
13760
|
}); }), true);
|
13745
13761
|
curPolygons = __spreadArray(__spreadArray([], (polygons || []).map(function (item) { return ({
|
@@ -13861,21 +13877,24 @@ var AdvancedSearch = function (_a) {
|
|
13861
13877
|
React__default.createElement(Divider, { style: { margin: '0px' } })));
|
13862
13878
|
};
|
13863
13879
|
|
13864
|
-
var css_248z$7 = ":root {\n --sense-search-input-icon-color: #8c8c8c;\n}\n.SenseSearch-module_container__EMa7E {\n display: flex;\n flex-direction: column;\n gap: 12px;\n}\n.SenseSearch-module_container__EMa7E * {\n box-sizing: border-box;\n}\n.SenseSearch-module_container__EMa7E .SenseSearch-module_input-box__NrjXB {\n display: flex;\n height: 36px;\n}\n.SenseSearch-module_container__EMa7E .SenseSearch-module_input-box__NrjXB .SenseSearch-module_input__tLtuH {\n flex: 1;\n height: 36px;\n}\n.SenseSearch-module_container__EMa7E .SenseSearch-module_input-box__NrjXB .SenseSearch-module_input__tLtuH .ant-input-group {\n height: 36px;\n}\n.SenseSearch-module_container__EMa7E .SenseSearch-module_input-box__NrjXB .SenseSearch-module_input__tLtuH .ant-input-affix-wrapper {\n height: 36px;\n}\n.SenseSearch-module_container__EMa7E .SenseSearch-module_input-box__NrjXB .SenseSearch-module_input__tLtuH svg path {\n fill: var(--sense-search-input-icon-color);\n}\n.SenseSearch-module_container__EMa7E .SenseSearch-module_input-box__NrjXB .SenseSearch-module_input-addon__rKWhO .SenseSearch-module_icon__7pknl {\n display: flex;\n align-items: center;\n justify-content: center;\n height: 26px;\n padding: 0 8px;\n color: #fff;\n cursor: pointer;\n}\n.SenseSearch-module_container__EMa7E .SenseSearch-module_input-box__NrjXB .SenseSearch-module_searchBtn__Hpads {\n height: 36px;\n margin-left: 10px;\n}\n.SenseSearch-module_container__EMa7E .SenseSearch-module_input-box__NrjXB .SenseSearch-module_button__BMnYp {\n display: flex;\n align-items: center;\n justify-content: center;\n width: 36px;\n height: 36px;\n flex-shrink: 0;\n margin-left: 4px;\n cursor: pointer;\n}\n.SenseSearch-module_container__EMa7E .SenseSearch-module_input-box__NrjXB .ant-input-group-wrapper-borderless .ant-input-borderless {\n height: 35px;\n}\n.SenseSearch-module_container__EMa7E .SenseSearch-module_input-box__NrjXB .ant-input-group-wrapper-borderless .ant-input-group-addon {\n padding: 0;\n}\n";
|
13865
|
-
var styles$7 = {"container":"SenseSearch-module_container__EMa7E","input-box":"SenseSearch-module_input-box__NrjXB","input":"SenseSearch-module_input__tLtuH","input-addon":"SenseSearch-module_input-addon__rKWhO","icon":"SenseSearch-module_icon__7pknl","searchBtn":"SenseSearch-module_searchBtn__Hpads"};
|
13880
|
+
var css_248z$7 = ":root {\n --sense-search-input-icon-color: #8c8c8c;\n}\n.SenseSearch-module_container__EMa7E {\n display: flex;\n flex-direction: column;\n gap: 12px;\n}\n.SenseSearch-module_container__EMa7E * {\n box-sizing: border-box;\n}\n.SenseSearch-module_container__EMa7E .SenseSearch-module_form-hidden__5Yxia {\n position: absolute;\n pointer-events: none;\n opacity: 0;\n}\n.SenseSearch-module_container__EMa7E .SenseSearch-module_input-box__NrjXB {\n display: flex;\n height: 36px;\n}\n.SenseSearch-module_container__EMa7E .SenseSearch-module_input-box__NrjXB .SenseSearch-module_input__tLtuH {\n flex: 1;\n height: 36px;\n}\n.SenseSearch-module_container__EMa7E .SenseSearch-module_input-box__NrjXB .SenseSearch-module_input__tLtuH .ant-input-group {\n height: 36px;\n}\n.SenseSearch-module_container__EMa7E .SenseSearch-module_input-box__NrjXB .SenseSearch-module_input__tLtuH .ant-input-affix-wrapper {\n height: 36px;\n}\n.SenseSearch-module_container__EMa7E .SenseSearch-module_input-box__NrjXB .SenseSearch-module_input__tLtuH svg path {\n fill: var(--sense-search-input-icon-color);\n}\n.SenseSearch-module_container__EMa7E .SenseSearch-module_input-box__NrjXB .SenseSearch-module_input-addon__rKWhO .SenseSearch-module_icon__7pknl {\n display: flex;\n align-items: center;\n justify-content: center;\n height: 26px;\n padding: 0 8px;\n color: #fff;\n cursor: pointer;\n}\n.SenseSearch-module_container__EMa7E .SenseSearch-module_input-box__NrjXB .SenseSearch-module_searchBtn__Hpads {\n height: 36px;\n margin-left: 10px;\n}\n.SenseSearch-module_container__EMa7E .SenseSearch-module_input-box__NrjXB .SenseSearch-module_button__BMnYp {\n display: flex;\n align-items: center;\n justify-content: center;\n width: 36px;\n height: 36px;\n flex-shrink: 0;\n margin-left: 4px;\n cursor: pointer;\n}\n.SenseSearch-module_container__EMa7E .SenseSearch-module_input-box__NrjXB .ant-input-group-wrapper-borderless .ant-input-borderless {\n height: 35px;\n}\n.SenseSearch-module_container__EMa7E .SenseSearch-module_input-box__NrjXB .ant-input-group-wrapper-borderless .ant-input-group-addon {\n padding: 0;\n}\n";
|
13881
|
+
var styles$7 = {"container":"SenseSearch-module_container__EMa7E","form-hidden":"SenseSearch-module_form-hidden__5Yxia","input-box":"SenseSearch-module_input-box__NrjXB","input":"SenseSearch-module_input__tLtuH","input-addon":"SenseSearch-module_input-addon__rKWhO","icon":"SenseSearch-module_icon__7pknl","searchBtn":"SenseSearch-module_searchBtn__Hpads"};
|
13866
13882
|
styleInject(css_248z$7);
|
13867
13883
|
|
13868
13884
|
var useToken = theme.useToken;
|
13869
|
-
var SenseSearch = function (props) {
|
13870
|
-
var
|
13885
|
+
var SenseSearch = forwardRef(function (props, ref) {
|
13886
|
+
var _a;
|
13887
|
+
var hiddenSearch = props.hiddenSearch, viewCode = props.viewCode, showView = props.showView, views = props.views, searchMode = props.searchMode, onSearch = props.onSearch, onMapDraw = props.onMapDraw, onStartDraw = props.onStartDraw, inputIconColor = props.inputIconColor;
|
13871
13888
|
var token = useToken().token;
|
13872
13889
|
var form = Form.useForm()[0];
|
13890
|
+
// 实体分类树
|
13891
|
+
var _b = useState([]), entityClassTree = _b[0]; _b[1];
|
13873
13892
|
// 顶部菜单栏展示分类
|
13874
|
-
var
|
13893
|
+
var _c = useState([]), categories = _c[0], setCategories = _c[1];
|
13875
13894
|
// 当前选中的分类
|
13876
|
-
var
|
13895
|
+
var _d = useState(''), activeCategory = _d[0], setActiveCategory = _d[1];
|
13877
13896
|
// 显示高级搜索
|
13878
|
-
var
|
13897
|
+
var _e = useState(false), isShowAdvanced = _e[0], setIsShowAdvanced = _e[1];
|
13879
13898
|
// 触发搜索
|
13880
13899
|
var handleSearch = function () {
|
13881
13900
|
form.validateFields().then(function (values) { return __awaiter(void 0, void 0, void 0, function () {
|
@@ -13956,6 +13975,143 @@ var SenseSearch = function (props) {
|
|
13956
13975
|
});
|
13957
13976
|
}); });
|
13958
13977
|
};
|
13978
|
+
// 设置表单项
|
13979
|
+
var handleSetFieldsValue = function (values) {
|
13980
|
+
var senseObjCodes = values.senseObjCodes, knnItems = values.knnItems, fields = __rest(values, ["senseObjCodes", "knnItems"]);
|
13981
|
+
if (senseObjCodes) {
|
13982
|
+
fields.entityType = senseObjCodes
|
13983
|
+
.map(function (item) { return getParentChainKeys(entityClassTree, item); })
|
13984
|
+
.filter(function (item) { return item.length; });
|
13985
|
+
}
|
13986
|
+
if (knnItems) {
|
13987
|
+
fields.knnItems = knnItems.map(function (item) { return (__assign(__assign({}, item), { senseObjCode: item.senseObjCode
|
13988
|
+
? getParentChainKeys(entityClassTree, item.senseObjCode)
|
13989
|
+
: [] })); });
|
13990
|
+
}
|
13991
|
+
setIsShowAdvanced(true);
|
13992
|
+
form.setFieldsValue(fields);
|
13993
|
+
};
|
13994
|
+
// 处理 AI 搜索
|
13995
|
+
var handleAiSearch = function (res) {
|
13996
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j;
|
13997
|
+
console.log('aiSearch', res);
|
13998
|
+
// 搜索参数
|
13999
|
+
var params = {
|
14000
|
+
keyword: res.keyword || '',
|
14001
|
+
senseObjCodes: res.senseObjCodes || [],
|
14002
|
+
tagCodes: res.tagCodes || [],
|
14003
|
+
};
|
14004
|
+
// 时空搜索参数
|
14005
|
+
var timeSpaceParams = {};
|
14006
|
+
var isPoint = ((_a = res.pointSenseList) === null || _a === void 0 ? void 0 : _a.length) || ((_b = res.poiPointList) === null || _b === void 0 ? void 0 : _b.length);
|
14007
|
+
var isLine = (_c = res.lineSenseList) === null || _c === void 0 ? void 0 : _c.length;
|
14008
|
+
var isPolygon = (_d = res.polygonSenseList) === null || _d === void 0 ? void 0 : _d.length;
|
14009
|
+
var isRegion = (_e = res.regionIds) === null || _e === void 0 ? void 0 : _e.length;
|
14010
|
+
var isTime = res.startTime && res.endTime;
|
14011
|
+
var isSpace = isPoint || isLine || isPolygon || isRegion;
|
14012
|
+
var isKnn = res.knnInfo;
|
14013
|
+
var isTimeSpace = isTime && isSpace;
|
14014
|
+
if (isKnn) {
|
14015
|
+
// 最近邻
|
14016
|
+
timeSpaceParams.searchMode = 'knn';
|
14017
|
+
timeSpaceParams.location = "".concat(res.knnInfo.longitude, " ").concat(res.knnInfo.latitude);
|
14018
|
+
timeSpaceParams.knnItems = res.knnInfo.knnItem;
|
14019
|
+
}
|
14020
|
+
if (isTime) {
|
14021
|
+
// 时间
|
14022
|
+
timeSpaceParams.searchMode = 'time';
|
14023
|
+
timeSpaceParams.timeRange = [dayjs(res.startTime), dayjs(res.endTime)];
|
14024
|
+
}
|
14025
|
+
if (isSpace) {
|
14026
|
+
// 空间
|
14027
|
+
timeSpaceParams.searchMode = 'space';
|
14028
|
+
if (isPoint) {
|
14029
|
+
// - 点位
|
14030
|
+
// timeSpaceParams.spaceMode = 'point';
|
14031
|
+
timeSpaceParams.pointRange = res.distance / 1000;
|
14032
|
+
if ((_f = res.pointSenseList) === null || _f === void 0 ? void 0 : _f.length) {
|
14033
|
+
timeSpaceParams.selectPoints = res.pointSenseList.map(function (item) {
|
14034
|
+
var senseGlobalCode = item.senseGlobalCode, longitude = item.longitude, latitude = item.latitude, dataList = item.dataList;
|
14035
|
+
var fieldValue = dataList[0].fieldValue;
|
14036
|
+
return {
|
14037
|
+
key: senseGlobalCode,
|
14038
|
+
label: fieldValue,
|
14039
|
+
value: "".concat(longitude, "^").concat(latitude, "^").concat(senseGlobalCode),
|
14040
|
+
};
|
14041
|
+
});
|
14042
|
+
}
|
14043
|
+
if ((_g = res.poiPointList) === null || _g === void 0 ? void 0 : _g.length) {
|
14044
|
+
timeSpaceParams.points = res.poiPointList.map(function (item) { return ({
|
14045
|
+
id: v4(),
|
14046
|
+
data: [item.lon, item.lat],
|
14047
|
+
}); });
|
14048
|
+
}
|
14049
|
+
}
|
14050
|
+
if (isLine) {
|
14051
|
+
// - 路线
|
14052
|
+
timeSpaceParams.lineRange = res.distance / 1000;
|
14053
|
+
if ((_h = res.lineSenseList) === null || _h === void 0 ? void 0 : _h.length) {
|
14054
|
+
timeSpaceParams.selectLines = res.lineSenseList.map(function (item) {
|
14055
|
+
var senseGlobalCode = item.senseGlobalCode, geometry = item.geometry, dataList = item.dataList;
|
14056
|
+
var fieldValue = dataList[0].fieldValue;
|
14057
|
+
return {
|
14058
|
+
key: senseGlobalCode,
|
14059
|
+
label: fieldValue,
|
14060
|
+
value: geometry,
|
14061
|
+
};
|
14062
|
+
});
|
14063
|
+
}
|
14064
|
+
// lines
|
14065
|
+
}
|
14066
|
+
if (isPolygon) {
|
14067
|
+
// - 区域
|
14068
|
+
if ((_j = res.polygonSenseList) === null || _j === void 0 ? void 0 : _j.length) {
|
14069
|
+
timeSpaceParams.selectPolygons = res.polygonSenseList.map(function (item) {
|
14070
|
+
var senseGlobalCode = item.senseGlobalCode, geometry = item.geometry, dataList = item.dataList;
|
14071
|
+
var fieldValue = dataList[0].fieldValue;
|
14072
|
+
return {
|
14073
|
+
key: senseGlobalCode,
|
14074
|
+
label: fieldValue,
|
14075
|
+
value: geometry,
|
14076
|
+
};
|
14077
|
+
});
|
14078
|
+
}
|
14079
|
+
// polygons
|
14080
|
+
}
|
14081
|
+
if (isRegion) {
|
14082
|
+
// - 地区
|
14083
|
+
timeSpaceParams.region = res.regionIds.map(function (item) {
|
14084
|
+
var _a;
|
14085
|
+
return ({
|
14086
|
+
label: (_a = res.regionInfoList.find(function (it) { return it.regionId === item; })) === null || _a === void 0 ? void 0 : _a.regionName,
|
14087
|
+
value: item,
|
14088
|
+
});
|
14089
|
+
});
|
14090
|
+
}
|
14091
|
+
}
|
14092
|
+
if (isTimeSpace) {
|
14093
|
+
// 时空
|
14094
|
+
timeSpaceParams.searchMode = 'time-space';
|
14095
|
+
}
|
14096
|
+
console.log('params', params);
|
14097
|
+
console.log('timeSpaceParams', timeSpaceParams);
|
14098
|
+
form.resetFields();
|
14099
|
+
handleSetFieldsValue(params);
|
14100
|
+
if (timeSpaceParams) {
|
14101
|
+
setTimeout(function () {
|
14102
|
+
handleSetFieldsValue(timeSpaceParams);
|
14103
|
+
}, 10);
|
14104
|
+
setTimeout(function () {
|
14105
|
+
handleSetFieldsValue(timeSpaceParams);
|
14106
|
+
}, 40);
|
14107
|
+
setTimeout(function () {
|
14108
|
+
handleSetFieldsValue(timeSpaceParams);
|
14109
|
+
}, 70);
|
14110
|
+
}
|
14111
|
+
setTimeout(function () {
|
14112
|
+
handleSearch();
|
14113
|
+
}, 100);
|
14114
|
+
};
|
13959
14115
|
// 修改当前选中的分类
|
13960
14116
|
var handleChangeCategory = function (value) {
|
13961
14117
|
setActiveCategory(value);
|
@@ -14018,17 +14174,33 @@ var SenseSearch = function (props) {
|
|
14018
14174
|
}); })();
|
14019
14175
|
}
|
14020
14176
|
}, [views, token.colorText]);
|
14177
|
+
useImperativeHandle(ref, function () { return ({
|
14178
|
+
search: function () {
|
14179
|
+
handleSearch();
|
14180
|
+
},
|
14181
|
+
setFieldsValue: function (values) {
|
14182
|
+
handleSetFieldsValue(values);
|
14183
|
+
},
|
14184
|
+
resetFields: function (fields) {
|
14185
|
+
form.resetFields(fields);
|
14186
|
+
},
|
14187
|
+
aiSearch: function (res) {
|
14188
|
+
handleAiSearch(res);
|
14189
|
+
},
|
14190
|
+
}); });
|
14021
14191
|
return (React__default.createElement("div", { className: styles$7.container },
|
14022
14192
|
React__default.createElement(Tabs, { show: showView, items: categories, activeKey: activeCategory, onChange: handleChangeCategory, block: true }),
|
14023
|
-
React__default.createElement(Form, { form: form, requiredMark: false },
|
14193
|
+
React__default.createElement(Form, { form: form, requiredMark: false, className: classNames((_a = {},
|
14194
|
+
_a[styles$7['form-hidden']] = hiddenSearch,
|
14195
|
+
_a)) },
|
14024
14196
|
React__default.createElement("div", { className: styles$7['input-box'] },
|
14025
14197
|
React__default.createElement("div", { className: styles$7.input },
|
14026
14198
|
React__default.createElement(Form.Item, { name: "keyword", style: { width: '100%' }, initialValue: "", noStyle: true },
|
14027
14199
|
React__default.createElement(Input, { placeholder: "\u8F93\u5165\u5173\u952E\u8BCD", max: 50, allowClear: { clearIcon: clearIcon }, addonAfter: (searchMode === null || searchMode === void 0 ? void 0 : searchMode.length) ? addonAfter : null, onPressEnter: handleSearch }))),
|
14028
14200
|
React__default.createElement(Button, { type: "primary", className: styles$7.searchBtn, onClick: handleSearch },
|
14029
14201
|
React__default.createElement(SvgSearch, null))),
|
14030
|
-
isShowAdvanced ? (React__default.createElement(AdvancedSearch, { searchMode: searchMode, onSearch: handleSearch, onMapDraw: onMapDraw, onStartDraw: onStartDraw })) : null)));
|
14031
|
-
};
|
14202
|
+
isShowAdvanced ? (React__default.createElement(AdvancedSearch, { entityClassTree: entityClassTree, searchMode: searchMode, onSearch: handleSearch, onMapDraw: onMapDraw, onStartDraw: onStartDraw })) : null)));
|
14203
|
+
});
|
14032
14204
|
|
14033
14205
|
var settings$8 = {
|
14034
14206
|
name: 'CcosSenseSearch',
|
@@ -15630,8 +15802,10 @@ var css_248z$4 = ".SenseView-module_container__nk7i- {\n width: 100%;\n height
|
|
15630
15802
|
var styles$4 = {"container":"SenseView-module_container__nk7i-","tree":"SenseView-module_tree__7VpBe"};
|
15631
15803
|
styleInject(css_248z$4);
|
15632
15804
|
|
15633
|
-
var SenseView = function (props) {
|
15805
|
+
var SenseView = forwardRef(function (props, ref) {
|
15806
|
+
var senseSearchRef = useRef(null);
|
15634
15807
|
var senseSearchPrpos = pick(props, [
|
15808
|
+
'hiddenSearch',
|
15635
15809
|
'viewCode',
|
15636
15810
|
'showView',
|
15637
15811
|
'views',
|
@@ -15662,11 +15836,17 @@ var SenseView = function (props) {
|
|
15662
15836
|
var handleSearch = function (params) {
|
15663
15837
|
setSearchParams(params);
|
15664
15838
|
};
|
15839
|
+
useImperativeHandle(ref, function () { return ({
|
15840
|
+
aiSearch: function (res) {
|
15841
|
+
var _a;
|
15842
|
+
(_a = senseSearchRef.current) === null || _a === void 0 ? void 0 : _a.aiSearch(res);
|
15843
|
+
},
|
15844
|
+
}); });
|
15665
15845
|
return (React__default.createElement("div", { className: styles$4.container },
|
15666
|
-
React__default.createElement(SenseSearch, __assign({}, senseSearchPrpos, { onSearch: handleSearch })),
|
15846
|
+
React__default.createElement(SenseSearch, __assign({}, senseSearchPrpos, { ref: senseSearchRef, onSearch: handleSearch })),
|
15667
15847
|
React__default.createElement("div", { className: styles$4.tree },
|
15668
15848
|
React__default.createElement(SenseTree, __assign({}, senseTreeProps, { viewCodes: searchParams === null || searchParams === void 0 ? void 0 : searchParams.viewCodes, searchParams: searchParams })))));
|
15669
|
-
};
|
15849
|
+
});
|
15670
15850
|
|
15671
15851
|
var settings$4 = {
|
15672
15852
|
name: 'CcosSenseView',
|
@@ -16324,11 +16504,11 @@ var CcosVideoPlayer = function (props) {
|
|
16324
16504
|
CcosVideoPlayer.settings = settings$1;
|
16325
16505
|
|
16326
16506
|
try {
|
16327
|
-
window._ICOS_DESKTOP_VERSION_ = JSON.parse('{"version":"2.
|
16507
|
+
window._ICOS_DESKTOP_VERSION_ = JSON.parse('{"version":"2.1.1","branch":"release_v2.1.0","buildDate":"2025-05-13 15:40:47"}');
|
16328
16508
|
}
|
16329
16509
|
catch (err) {
|
16330
16510
|
console.warn(err);
|
16331
|
-
window._ICOS_DESKTOP_VERSION_ = '{"version":"2.
|
16511
|
+
window._ICOS_DESKTOP_VERSION_ = '{"version":"2.1.1","branch":"release_v2.1.0","buildDate":"2025-05-13 15:40:47"}';
|
16332
16512
|
}
|
16333
16513
|
|
16334
16514
|
export { BookDetail, BookGroupImport, BookGroupTable, BookImport, BookInfo, BookSelect, BookTable, CcosBookDetail, CcosImportTable, CcosSenseCreate, CcosSenseDetail, CcosSenseEdit, CcosSenseFullTable, CcosSenseManager, CcosSenseSearch, CcosSenseTree, CcosSenseView, CcosTagConfig, CcosVideoPlayer, EntityClassFilter, EntityClassTreeSelect, ImportTable, Modal, OrgTreeSelect, PersonSelector, ProSearch, ProTable$1 as ProTable, RegionCascader, RegionTreeSelect, RelationGraph, SenseContentTable, SenseCreate, SenseDetail, SenseEdit, SenseForm, SenseFullTable, SenseInfo, SenseManager, SenseSearch, SenseTable, SenseTree, SenseView, TagConfig, TagTreeSelect, VideoControl, VideoPlayer, setCconfig as config };
|