@icos-desktop/react-components 2.0.7 → 2.0.9

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
  */
@@ -1029,13 +1055,9 @@ interface SenseTreeProps {
1029
1055
  */
1030
1056
  onEditSense?: (node: any, e: any) => void;
1031
1057
  /**
1032
- * 数据情况背景颜色
1033
- */
1034
- statisticsBgColor?: string;
1035
- /**
1036
- * 数据情况字体颜色
1058
+ * 散点聚合
1037
1059
  */
1038
- statisticsFontColor?: string;
1060
+ onScatterAggregation?: (data: any) => void;
1039
1061
  }
1040
1062
 
1041
1063
  declare const SenseTree: (props: SenseTreeProps) => React.JSX.Element;
@@ -1089,6 +1111,14 @@ interface SenseViewProps {
1089
1111
  * region-sense: 地理层级-实体记录
1090
1112
  */
1091
1113
  treeType: 'entity-class' | 'region-book' | 'region-sense';
1114
+ /**
1115
+ * 地图缩放层级,存在此参数时会调用散点聚合接口
1116
+ */
1117
+ zoom?: number;
1118
+ /**
1119
+ * 地图可视范围
1120
+ */
1121
+ geom?: string;
1092
1122
  /**
1093
1123
  * 地理层级显示区间-根层级 1~9 以此为省、市、区县、街道、社区、小区、楼、单元、户
1094
1124
  */
@@ -1133,6 +1163,10 @@ interface SenseViewProps {
1133
1163
  * 编辑实体记录
1134
1164
  */
1135
1165
  onEditSense?: (node: any, e: any) => void;
1166
+ /**
1167
+ * 散点聚合
1168
+ */
1169
+ onScatterAggregation?: (data: any) => void;
1136
1170
  }
1137
1171
 
1138
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, statisticsBgColor = props.statisticsBgColor, statisticsFontColor = props.statisticsFontColor;
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,9 +14570,37 @@ var SenseTree = function (props) {
14546
14570
  }
14547
14571
  }
14548
14572
  }, [viewCodes, treeType]);
14573
+ // 撒点
14574
+ useDebounceEffect(function () {
14575
+ var isGovUser = viewCodes.includes('system-icos_gov_user');
14576
+ if ((checkedInfo === null || checkedInfo === void 0 ? void 0 : checkedInfo.total) === 0) {
14577
+ onScatterAggregation({
14578
+ aggregationList: [],
14579
+ senseList: [],
14580
+ });
14581
+ }
14582
+ else if (checkedInfo === null || checkedInfo === void 0 ? void 0 : checkedInfo.info) {
14583
+ var _geom = geom;
14584
+ if ((searchParams === null || searchParams === void 0 ? void 0 : searchParams.geom) && !geom) {
14585
+ _geom = searchParams.geom;
14586
+ }
14587
+ else if ((searchParams === null || searchParams === void 0 ? void 0 : searchParams.geom) && geom) {
14588
+ // 判断空间搜索geom
14589
+ _geom = wkt.stringify(turf.intersect(wkt.parse(searchParams.geom), wkt.parse(geom)));
14590
+ }
14591
+ 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 });
14592
+ if (zoom && _geom && viewCodes.length && !isGovUser) {
14593
+ getSenseScatterAggregation(params).then(function (res) {
14594
+ onScatterAggregation(res);
14595
+ });
14596
+ }
14597
+ }
14598
+ }, [checkedInfo, zoom, geom], {
14599
+ wait: 300,
14600
+ });
14549
14601
  useEffect(function () {
14550
- document.documentElement.style.setProperty('--sense-tree-download-icon-color', statisticsFontColor ? statisticsFontColor : '#0ff');
14551
- }, [statisticsFontColor]);
14602
+ document.documentElement.style.setProperty('--sense-tree-download-icon-color', "".concat(token.colorPrimaryHover));
14603
+ }, [token.colorPrimaryHover]);
14552
14604
  useEffect(function () {
14553
14605
  console.log(token.colorText);
14554
14606
  document.documentElement.style.setProperty('--sense-tree-tree-text-color', token.colorText);
@@ -14558,8 +14610,8 @@ var SenseTree = function (props) {
14558
14610
  React__default.createElement(Tree, { treeData: treeData, titleRender: titleRender, loadData: loadData, selectedKeys: [], expandedKeys: expandedKeys, checkedKeys: checkedKeys, onSelect: handleSelect, onExpand: handleExpand, onCheck: handleCheck, onClick: handleClick, onDoubleClick: handleDoubleClick, onRightClick: handleRightClick, checkable: true, blockNode: true })),
14559
14611
  React__default.createElement("div", { className: styles$5.footer },
14560
14612
  React__default.createElement("div", { className: styles$5.statistics, style: {
14561
- color: statisticsFontColor ? statisticsFontColor : '#3370FF',
14562
- backgroundColor: statisticsBgColor ? statisticsBgColor : '#F2F6FE',
14613
+ color: "".concat(token.colorPrimaryHover),
14614
+ backgroundColor: "".concat(token.colorBgContainer),
14563
14615
  } },
14564
14616
  "\u5171 ",
14565
14617
  total,
@@ -14775,6 +14827,8 @@ var SenseView = function (props) {
14775
14827
  'onMapDraw',
14776
14828
  ]);
14777
14829
  var senseTreeProps = pick(props, [
14830
+ 'zoom',
14831
+ 'geom',
14778
14832
  'treeType',
14779
14833
  'regionRootLevel',
14780
14834
  'regionLeafLevel',
@@ -14787,6 +14841,7 @@ var SenseView = function (props) {
14787
14841
  'onDoubleClick',
14788
14842
  'onShowSense',
14789
14843
  'onEditSense',
14844
+ 'onScatterAggregation',
14790
14845
  ]);
14791
14846
  // 搜索参数
14792
14847
  var _a = useState(), searchParams = _a[0], setSearchParams = _a[1];
@@ -15455,11 +15510,11 @@ var CcosVideoPlayer = function (props) {
15455
15510
  CcosVideoPlayer.settings = settings$1;
15456
15511
 
15457
15512
  try {
15458
- window._ICOS_DESKTOP_VERSION_ = JSON.parse('{"version":"2.0.7","branch":"remotes/origin/release_v2.0.0","buildDate":"2025-03-21 16:05:52"}');
15513
+ window._ICOS_DESKTOP_VERSION_ = JSON.parse('{"version":"2.0.9","branch":"release_v2.0.0","buildDate":"2025-03-24 10:46:54"}');
15459
15514
  }
15460
15515
  catch (err) {
15461
15516
  console.warn(err);
15462
- window._ICOS_DESKTOP_VERSION_ = '{"version":"2.0.7","branch":"remotes/origin/release_v2.0.0","buildDate":"2025-03-21 16:05:52"}';
15517
+ window._ICOS_DESKTOP_VERSION_ = '{"version":"2.0.9","branch":"release_v2.0.0","buildDate":"2025-03-24 10:46:54"}';
15463
15518
  }
15464
15519
 
15465
15520
  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 };