@icos-desktop/react-components 2.0.8 → 2.0.10

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.
@@ -1,6 +1,6 @@
1
1
  import React, { ReactNode } from 'react';
2
2
  import { ButtonProps } from 'antd/es/button/button';
3
- import { SelectProps, TableProps, TreeSelectProps, ModalProps, InputProps, CascaderProps } from '@xirang/design-antd';
3
+ import { SelectProps, TableProps, TreeSelectProps, ModalProps, InputProps, CascaderProps, ButtonProps as ButtonProps$1 } from '@xirang/design-antd';
4
4
  import { ContextMenuKey as ContextMenuKey$2 } from '@/components/BookTable/BookTable.types';
5
5
  import { ContextMenuKey as ContextMenuKey$3 } from '@/components/SenseTable/SenseTable.types';
6
6
  import { VideoPlayerProps as VideoPlayerProps$1 } from '@/components/VideoPlayer';
@@ -618,6 +618,9 @@ interface SenseFormRef {
618
618
 
619
619
  declare const SenseForm: React.ForwardRefExoticComponent<SenseFormProps & React.RefAttributes<SenseFormRef>>;
620
620
 
621
+ interface CustomButtonConfig extends ButtonProps$1 {
622
+ title: string;
623
+ }
621
624
  interface SenseFullTableProps {
622
625
  /**
623
626
  * 显示视图类型:system 系统视图,func 功能视图,默认值:`system`
@@ -654,6 +657,17 @@ interface SenseFullTableProps {
654
657
  * 显示实体记录列表
655
658
  */
656
659
  showSenseTable?: boolean;
660
+ /**
661
+ * 自定义按钮
662
+ */
663
+ customButtons?: (data: {
664
+ activeViewCode: string;
665
+ activeTable: '' | 'bookGroup' | 'book' | 'sense';
666
+ }) => CustomButtonConfig[];
667
+ /**
668
+ * 显示导出数据按钮
669
+ */
670
+ showExportButton?: boolean;
657
671
  /**
658
672
  * 显示导入数据按钮,为`true`时默认打开台账组导入,可按视图配置对应为台账导入/台账组导入,例如:`{ viewCode: 'book | bookGroup' }`
659
673
  */
@@ -976,6 +990,18 @@ interface SenseTreeProps {
976
990
  * 搜索参数
977
991
  */
978
992
  searchParams: any;
993
+ /**
994
+ * 散点聚合类型,可选项:`1` 空间聚合, `2` 地区聚合,默认值:`1`
995
+ */
996
+ aggregateType?: 1 | 2;
997
+ /**
998
+ * 地图缩放层级,存在此参数时会调用散点聚合接口
999
+ */
1000
+ zoom?: number;
1001
+ /**
1002
+ * 地图可视范围
1003
+ */
1004
+ geom?: string;
979
1005
  /**
980
1006
  * 地理层级显示区间-根层级 1~9 以此为省、市、区县、街道、社区、小区、楼、单元、户
981
1007
  */
@@ -1028,6 +1054,10 @@ interface SenseTreeProps {
1028
1054
  * 编辑实体记录
1029
1055
  */
1030
1056
  onEditSense?: (node: any, e: any) => void;
1057
+ /**
1058
+ * 散点聚合
1059
+ */
1060
+ onScatterAggregation?: (data: any) => void;
1031
1061
  }
1032
1062
 
1033
1063
  declare const SenseTree: (props: SenseTreeProps) => React.JSX.Element;
@@ -1081,6 +1111,14 @@ interface SenseViewProps {
1081
1111
  * region-sense: 地理层级-实体记录
1082
1112
  */
1083
1113
  treeType: 'entity-class' | 'region-book' | 'region-sense';
1114
+ /**
1115
+ * 地图缩放层级,存在此参数时会调用散点聚合接口
1116
+ */
1117
+ zoom?: number;
1118
+ /**
1119
+ * 地图可视范围
1120
+ */
1121
+ geom?: string;
1084
1122
  /**
1085
1123
  * 地理层级显示区间-根层级 1~9 以此为省、市、区县、街道、社区、小区、楼、单元、户
1086
1124
  */
@@ -1125,6 +1163,10 @@ interface SenseViewProps {
1125
1163
  * 编辑实体记录
1126
1164
  */
1127
1165
  onEditSense?: (node: any, e: any) => void;
1166
+ /**
1167
+ * 散点聚合
1168
+ */
1169
+ onScatterAggregation?: (data: any) => void;
1128
1170
  }
1129
1171
 
1130
1172
  declare const SenseView: (props: SenseViewProps) => React.JSX.Element;
@@ -5527,6 +5527,18 @@ var ContextMenu$4 = function (_a) {
5527
5527
  };
5528
5528
  ContextMenu$4.id = id$4;
5529
5529
 
5530
+ // 获取实体记录散点聚合信息
5531
+ function getSenseScatterAggregation(data) {
5532
+ return __awaiter(this, void 0, void 0, function () {
5533
+ return __generator(this, function (_a) {
5534
+ return [2 /*return*/, req({
5535
+ url: '/v1/open/sense-search/sense-scatter-aggregation',
5536
+ method: 'POST',
5537
+ data: data,
5538
+ })];
5539
+ });
5540
+ });
5541
+ }
5530
5542
  // 获取组织树
5531
5543
  function searchOrgTree(data) {
5532
5544
  return __awaiter(this, void 0, void 0, function () {
@@ -11355,7 +11367,7 @@ styleInject(css_248z$c);
11355
11367
 
11356
11368
  var SenseFullTable = forwardRef(function (props, ref) {
11357
11369
  var _a;
11358
- var _b = props.viewType, viewType = _b === void 0 ? 'system' : _b, _c = props.views, views = _c === void 0 ? [] : _c, showView = props.showView, showCatalog = props.showCatalog, showBreadcrumb = props.showBreadcrumb, showBookGroupTable = props.showBookGroupTable, showBookTable = props.showBookTable, showSenseTable = props.showSenseTable, showImportButton = props.showImportButton, importHiddenGeolevel = props.importHiddenGeolevel, bookContextMenuConfig = props.bookContextMenuConfig, senseContextMenuConfig = props.senseContextMenuConfig, enableTag = props.enableTag, leafRegionId = props.leafRegionId, pathRegionId = props.pathRegionId, onCreateSense = props.onCreateSense, onShowSense = props.onShowSense, onEditSense = props.onEditSense, onClickSense = props.onClickSense, onDoubleClickSense = props.onDoubleClickSense, filterBgColor = props.filterBgColor, filterIconColor = props.filterIconColor, filterActiveClor = props.filterActiveClor, filterContentBgColor = props.filterContentBgColor, rowHighlightColor = props.rowHighlightColor, proTableContainerHeight = props.proTableContainerHeight, proTableHeadBg = props.proTableHeadBg, proTableCloseAllBg = props.proTableCloseAllBg, proTableSortIconColor = props.proTableSortIconColor, proTableSelectIcon = props.proTableSelectIcon, proTableSelectMultipleIconColor = props.proTableSelectMultipleIconColor;
11370
+ var _b = props.viewType, viewType = _b === void 0 ? 'system' : _b, _c = props.views, views = _c === void 0 ? [] : _c, showView = props.showView, showCatalog = props.showCatalog, showBreadcrumb = props.showBreadcrumb, showBookGroupTable = props.showBookGroupTable, showBookTable = props.showBookTable, showSenseTable = props.showSenseTable, customButtons = props.customButtons, showExportButton = props.showExportButton, showImportButton = props.showImportButton, importHiddenGeolevel = props.importHiddenGeolevel, bookContextMenuConfig = props.bookContextMenuConfig, senseContextMenuConfig = props.senseContextMenuConfig, enableTag = props.enableTag, leafRegionId = props.leafRegionId, pathRegionId = props.pathRegionId, onCreateSense = props.onCreateSense, onShowSense = props.onShowSense, onEditSense = props.onEditSense, onClickSense = props.onClickSense, onDoubleClickSense = props.onDoubleClickSense, filterBgColor = props.filterBgColor, filterIconColor = props.filterIconColor, filterActiveClor = props.filterActiveClor, filterContentBgColor = props.filterContentBgColor, rowHighlightColor = props.rowHighlightColor, proTableContainerHeight = props.proTableContainerHeight, proTableHeadBg = props.proTableHeadBg, proTableCloseAllBg = props.proTableCloseAllBg, proTableSortIconColor = props.proTableSortIconColor, proTableSelectIcon = props.proTableSelectIcon, proTableSelectMultipleIconColor = props.proTableSelectMultipleIconColor;
11359
11371
  // 台账表格 ref
11360
11372
  var bookTableRef = useRef();
11361
11373
  // 实体记录表格 ref
@@ -11511,6 +11523,16 @@ var SenseFullTable = forwardRef(function (props, ref) {
11511
11523
  }
11512
11524
  return null;
11513
11525
  };
11526
+ // 显示按钮
11527
+ var showButtons = function () {
11528
+ if (customButtons) {
11529
+ var buttons = customButtons({ activeViewCode: activeViewCode, activeTable: activeTable });
11530
+ return buttons === null || buttons === void 0 ? void 0 : buttons.map(function (item) { return React__default.createElement(Button, __assign({}, item), item.title); });
11531
+ }
11532
+ return null;
11533
+ };
11534
+ // 导出数据
11535
+ var handleExport = function () { };
11514
11536
  // 导入数据
11515
11537
  var handleImport = function () {
11516
11538
  if (typeof showImportButton === 'boolean') {
@@ -11613,6 +11635,8 @@ var SenseFullTable = forwardRef(function (props, ref) {
11613
11635
  setTabsActiveKey(value.split('(')[0] === '台账' ? 'book' : 'sense');
11614
11636
  } }))) : null,
11615
11637
  React__default.createElement("div", { className: styles$c.filter },
11638
+ showButtons(),
11639
+ activeTable === 'sense' && showExportButton ? (React__default.createElement(Button, { onClick: handleExport }, "\u5BFC\u51FA\u6570\u636E")) : null,
11616
11640
  activeTable !== 'bookGroup' &&
11617
11641
  showImportButton &&
11618
11642
  (typeof showImportButton === 'boolean' || showImportButton[activeViewCode]) ? (React__default.createElement(Button, { onClick: handleImport }, "\u5BFC\u5165\u6570\u636E")) : null,
@@ -13906,7 +13930,7 @@ var getTreeChecked = function (_a) {
13906
13930
  };
13907
13931
 
13908
13932
  var SenseTree = function (props) {
13909
- var _a = props.treeType, treeType = _a === void 0 ? 'entity-class' : _a, _b = props.viewCodes, viewCodes = _b === void 0 ? [] : _b, searchParams = props.searchParams, regionLeafLevel = props.regionLeafLevel, regionRootLevel = props.regionRootLevel, defaultCheckedAll = props.defaultCheckedAll, titleExtra = props.titleExtra, senseContextMenuConfig = props.senseContextMenuConfig, bottomButtonConfig = props.bottomButtonConfig, onShare = props.onShare, onTotalChange = props.onTotalChange, onCheck = props.onCheck, onClick = props.onClick, onDoubleClick = props.onDoubleClick, onShowSense = props.onShowSense, onEditSense = props.onEditSense;
13933
+ var _a = props.treeType, treeType = _a === void 0 ? 'entity-class' : _a, _b = props.viewCodes, viewCodes = _b === void 0 ? [] : _b, searchParams = props.searchParams, aggregateType = props.aggregateType, zoom = props.zoom, geom = props.geom, regionLeafLevel = props.regionLeafLevel, regionRootLevel = props.regionRootLevel, defaultCheckedAll = props.defaultCheckedAll, titleExtra = props.titleExtra, senseContextMenuConfig = props.senseContextMenuConfig, bottomButtonConfig = props.bottomButtonConfig, onShare = props.onShare, onTotalChange = props.onTotalChange, onCheck = props.onCheck, onClick = props.onClick, onDoubleClick = props.onDoubleClick, onShowSense = props.onShowSense, onEditSense = props.onEditSense, onScatterAggregation = props.onScatterAggregation;
13910
13934
  var _c = App.useApp(), message = _c.message, modal = _c.modal;
13911
13935
  var showContextMenu = useContextMenu({ id: ContextMenu$1.id }).show;
13912
13936
  var ksCodeMap = useKsCode().ksCodeMap;
@@ -14546,6 +14570,37 @@ var SenseTree = function (props) {
14546
14570
  }
14547
14571
  }
14548
14572
  }, [viewCodes, treeType]);
14573
+ // 撒点
14574
+ useDebounceEffect(function () {
14575
+ if (!onScatterAggregation) {
14576
+ return;
14577
+ }
14578
+ var isGovUser = viewCodes.includes('system-icos_gov_user');
14579
+ if ((checkedInfo === null || checkedInfo === void 0 ? void 0 : checkedInfo.total) === 0) {
14580
+ onScatterAggregation === null || onScatterAggregation === void 0 ? void 0 : onScatterAggregation({
14581
+ aggregationList: [],
14582
+ senseList: [],
14583
+ });
14584
+ }
14585
+ else if (checkedInfo === null || checkedInfo === void 0 ? void 0 : checkedInfo.info) {
14586
+ var _geom = geom;
14587
+ if ((searchParams === null || searchParams === void 0 ? void 0 : searchParams.geom) && !geom) {
14588
+ _geom = searchParams.geom;
14589
+ }
14590
+ else if ((searchParams === null || searchParams === void 0 ? void 0 : searchParams.geom) && geom) {
14591
+ // 判断空间搜索geom
14592
+ _geom = wkt.stringify(turf.intersect(wkt.parse(searchParams.geom), wkt.parse(geom)));
14593
+ }
14594
+ var params = __assign(__assign(__assign(__assign({}, searchParams), { zoom: zoom, geom: _geom, searchGeom: searchParams === null || searchParams === void 0 ? void 0 : searchParams.geom, aggregateType: aggregateType }), checkedInfo.info), { viewCodes: viewCodes });
14595
+ if (zoom && _geom && viewCodes.length && !isGovUser) {
14596
+ getSenseScatterAggregation(params).then(function (res) {
14597
+ onScatterAggregation === null || onScatterAggregation === void 0 ? void 0 : onScatterAggregation(res);
14598
+ });
14599
+ }
14600
+ }
14601
+ }, [checkedInfo, zoom, geom], {
14602
+ wait: 300,
14603
+ });
14549
14604
  useEffect(function () {
14550
14605
  document.documentElement.style.setProperty('--sense-tree-download-icon-color', "".concat(token.colorPrimaryHover));
14551
14606
  }, [token.colorPrimaryHover]);
@@ -14775,6 +14830,8 @@ var SenseView = function (props) {
14775
14830
  'onMapDraw',
14776
14831
  ]);
14777
14832
  var senseTreeProps = pick(props, [
14833
+ 'zoom',
14834
+ 'geom',
14778
14835
  'treeType',
14779
14836
  'regionRootLevel',
14780
14837
  'regionLeafLevel',
@@ -14787,6 +14844,7 @@ var SenseView = function (props) {
14787
14844
  'onDoubleClick',
14788
14845
  'onShowSense',
14789
14846
  'onEditSense',
14847
+ 'onScatterAggregation',
14790
14848
  ]);
14791
14849
  // 搜索参数
14792
14850
  var _a = useState(), searchParams = _a[0], setSearchParams = _a[1];
@@ -15455,11 +15513,11 @@ var CcosVideoPlayer = function (props) {
15455
15513
  CcosVideoPlayer.settings = settings$1;
15456
15514
 
15457
15515
  try {
15458
- window._ICOS_DESKTOP_VERSION_ = JSON.parse('{"version":"2.0.8","branch":"remotes/origin/release_v2.0.0","buildDate":"2025-03-21 17:01:13"}');
15516
+ window._ICOS_DESKTOP_VERSION_ = JSON.parse('{"version":"2.0.10","branch":"release_v2.0.0","buildDate":"2025-03-24 11:30:35"}');
15459
15517
  }
15460
15518
  catch (err) {
15461
15519
  console.warn(err);
15462
- window._ICOS_DESKTOP_VERSION_ = '{"version":"2.0.8","branch":"remotes/origin/release_v2.0.0","buildDate":"2025-03-21 17:01:13"}';
15520
+ window._ICOS_DESKTOP_VERSION_ = '{"version":"2.0.10","branch":"release_v2.0.0","buildDate":"2025-03-24 11:30:35"}';
15463
15521
  }
15464
15522
 
15465
15523
  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, SenseCreate, SenseDetail, SenseEdit, SenseForm, SenseFullTable, SenseInfo, SenseManager, SenseSearch, SenseTable, SenseTree, SenseView, TagConfig, TagTreeSelect, VideoControl, VideoPlayer, setCconfig as config };