gis-view-webgl2 0.1.15 → 0.1.16

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.
Files changed (44) hide show
  1. package/dist/index.cjs +1 -1
  2. package/dist/index.d.ts +168 -20
  3. package/dist/index.js +1 -1
  4. package/docs/AI/345/257/271/350/257/235/346/261/207/346/200/273.md +67 -4
  5. package/docs/GisView.md +48 -48
  6. package/docs/ai/06-/344/274/232/350/257/235/347/264/242/345/274/225/344/270/216/345/244/215/346/237/245/346/226/271/346/263/225.md +67 -22
  7. package/docs/demos/BasicDemo.vue +76 -76
  8. package/docs/demos/ChannelDemo.vue +211 -0
  9. package/docs/demos/CopyMergeDemo.vue +1047 -872
  10. package/docs/demos/DemoShell.vue +336 -336
  11. package/docs/demos/EventDemo.vue +300 -300
  12. package/docs/demos/ExtensionDemo.vue +200 -200
  13. package/docs/demos/GisViewDemo.vue +64 -64
  14. package/docs/demos/LabelDemo.vue +489 -489
  15. package/docs/demos/StyleDemo.vue +67 -67
  16. package/docs/demos/api-index.js +23 -21
  17. package/docs/demos/demos.js +92 -92
  18. package/docs/demos/shared/demoData.js +107 -107
  19. package/docs/demos/shared/demoStyle.css +249 -249
  20. package/docs/internals/15-03-/351/200/220/350/275/256/350/256/260/345/275/225-/346/200/247/350/203/275/344/270/216/344/277/256/345/244/215-/344/270/213.md +14 -0
  21. package/docs/internals/15-04-/351/200/220/350/275/256/350/256/260/345/275/225-/347/203/255/345/212/233/345/233/276/344/270/216/346/200/247/350/203/275.md +14 -0
  22. package/docs/internals/16-03-/344/274/230/345/214/226/344/270/216/345/217/226/350/210/215-/344/270/213.md +8 -0
  23. package/docs/manual/03-/351/205/215/347/275/256/351/241/271.md +16 -4
  24. package/docs/manual/04-/344/272/213/344/273/266/344/270/216/345/233/236/350/260/203.md +2 -2
  25. package/docs/manual/06-/346/225/260/346/215/256/344/270/216/345/234/272/346/231/257/346/233/264/346/226/260.md +1 -1
  26. package/docs/manual/07-/346/214/207/351/222/210/344/270/216/350/246/201/347/264/240/347/274/226/350/276/221.md +51 -6
  27. package/docs/manual/09-/351/200/232/351/201/223/344/270/216/345/244/232/345/233/236/347/272/277.md +12 -0
  28. package/docs/manual/10-/351/200/232/351/201/223/347/274/226/350/276/221/344/270/216/346/226/260/345/242/236.md +112 -7
  29. package/docs/manual/14-/350/247/206/345/233/276/344/270/216/347/255/233/351/200/211.md +2 -1
  30. package/docs/manual/16-/345/256/236/344/276/213/346/226/271/346/263/225/346/200/273/350/241/250.md +27 -11
  31. package/docs/manual/17-/345/217/202/346/225/260/351/200/237/346/237/245.md +9 -7
  32. package/docs/manual/18-/351/200/220/346/226/271/346/263/225/347/244/272/344/276/213.md +71 -4
  33. package/docs/manual/20-/346/200/247/350/203/275/344/270/216/345/244/247/346/225/260/346/215/256.md +1 -0
  34. package/docs/steps/check-doc-truth.mjs +1 -1
  35. package/docs/steps/selftest-demos.html +1709 -1607
  36. package/docs/steps/selftest-docs.html +3 -3
  37. package/docs/steps/selftest-features.html +507 -1
  38. package/docs/steps/selftest-full.html +566 -566
  39. package/docs/steps/selftest-labels.html +647 -647
  40. package/docs/steps/selftest-perf.html +2245 -2193
  41. package/docs/steps/selftest-scale.html +6 -2
  42. package/docs/steps/selftest-select.html +9 -7
  43. package/docs//346/216/245/345/217/243/345/215/217/350/256/256.md +2 -0
  44. package/package.json +43 -43
package/dist/index.d.ts CHANGED
@@ -1557,6 +1557,12 @@ export interface GisViewLinePatch extends Partial<GisViewLine> {
1557
1557
  channelId?: string | number
1558
1558
  }
1559
1559
 
1560
+ /**
1561
+ * patchLines 里的一条:给定位(id / 下标 / `{ id }` / `{ index }`),其余字段与 updateLine 的补丁同一套
1562
+ * (线路字段 + groupId / groupIndex / channelId 三个分组指令)。分组指令不会写进 lines。
1563
+ */
1564
+ export type GisViewLineUpdateItemEntry = GisViewPointRef | (GisViewLinePatch & { id?: string | number; index?: number })
1565
+
1560
1566
  /**
1561
1567
  * updateChannel 第三段的一条:`{ id | index, ...字段 }` —— 用 id / index 定位这条通道的成员回线
1562
1568
  * (id 优先、数字回落下标,与 updateLine 的 id 参数同一套解析),其余字段与 `GisViewLinePatch` 完全同一套写法
@@ -1568,6 +1574,35 @@ export type GisViewChannelLinePatch = GisViewLinePatch & {
1568
1574
  index?: number
1569
1575
  }
1570
1576
 
1577
+ /**
1578
+ * updateChannel 第二段 / patchChannels 每条通道补丁:通道自己的字段之外,还可以写单组补丁 `group`
1579
+ * (按 id 找组、只合并写出来的字段;同时写 `groups` 时以整份声明为准)。
1580
+ * 这里的 `groups` / `lineIds` 是通道声明:不会新建 / 删除顶层 `lines` 里的真实线路。
1581
+ * 成员回线的逐条字段放在 updateChannel 第三段 / patchChannels 的 `linePatches`;
1582
+ * 新建回线用 addChannelGroupLines / addLine(s),挂入 / 摘出用 addChannelLines / removeChannelLines,
1583
+ * 删除线路用 removeLine(s),删除 / 合并分组用 removeChannelGroup / mergeChannelGroups。
1584
+ */
1585
+ export interface GisViewChannelPatch extends Partial<GisViewChannel> {
1586
+ /** 只改一组:认 id / groupId(也认 groupId 别名),找不到就新加一组;不写 id 就是第一组 */
1587
+ group?: Partial<GisViewChannelGroup> & { groupId?: string | number }
1588
+ }
1589
+
1590
+ /**
1591
+ * patchChannels 的一条:给定位(id / 下标 / `{ id }` / `{ index }`),带不带自己的补丁都认。
1592
+ * - 扁平写法:`{ id, name, groups, lineIds }`,`lineIds` 不带 `linePatches` 时是通道成员声明;
1593
+ * - updateChannel 形状:`{ id, patch, linePatches, lineIds }`,此时 `lineIds` 是第四段整表对齐;
1594
+ * - 扁平 + 成员:`{ id, name, linePatches, lineIds }`,顶层 `lineIds` 与 `linePatches` 配对时也按整表对齐解释。
1595
+ * 需要同时给声明 lineIds 与成员补丁时,把声明写进 `patch.lineIds`(或公共第二段)。
1596
+ */
1597
+ export type GisViewChannelUpdateItemEntry = GisViewPointRef | (GisViewChannelPatch & {
1598
+ id?: string | number
1599
+ index?: number
1600
+ /** updateChannel 第二段(逐条形式);与扁平字段同给时这里的字段优先 */
1601
+ patch?: GisViewChannelPatch
1602
+ /** updateChannel 第三段:这条通道的成员回线补丁 */
1603
+ linePatches?: GisViewChannelLinePatch | GisViewChannelLinePatch[]
1604
+ })
1605
+
1571
1606
  /** 通道偏移方式:tangent 走最外侧切点(按宽度均分),inset 从切点再向内收一段距离 */
1572
1607
  export type GisViewChannelOffsetMode = 'tangent' | 'inset'
1573
1608
 
@@ -1594,6 +1629,8 @@ export interface GisViewChannelGroup {
1594
1629
  /**
1595
1630
  * 通道:多条回线并行敷设的走廊,所有回线共用一条骨架折线(中心线)。
1596
1631
  * 回线几何由骨架按偏移量推导,拐点也挂在骨架上:编辑任一回线的拐点都会同步整条通道。
1632
+ * 通道声明只保存线路 id(`lineIds` / `groups[].lineIds`),真正的线路对象统一在顶层 `lines`;
1633
+ * 组件不会读取或写入 `channel.lineData` —— 新增接口第二段的同名 `lineData` 只是入参。
1597
1634
  */
1598
1635
  export interface GisViewChannel {
1599
1636
  /** 通道标识:同 id 的通道在数据刷新之间保留已编辑过的骨架 */
@@ -1908,14 +1945,17 @@ export interface GisViewChannelGroupAddResult {
1908
1945
  skipped?: Array<string | number>
1909
1946
  }
1910
1947
 
1911
- /** removeChannelGroup 的选项:把要删的那一组并进哪一组(缺省前一组,没有前一组就用后一组) */
1948
+ /** removeChannelGroup 的选项:缺省把要删的那一组并进相邻组;removeLines 为 true 时改为连组内回线一起删 */
1912
1949
  export interface GisViewChannelGroupRemoveOptions {
1950
+ /** 合并目标组:缺省前一组,没有前一组就用后一组;removeLines 为 true 时忽略 */
1913
1951
  targetGroupId?: string | number
1952
+ /** true 时删除这一组下的真实回线数据,不再把成员并到相邻组;通道还有其它组时继续保留 */
1953
+ removeLines?: boolean
1914
1954
  }
1915
1955
 
1916
1956
  /**
1917
1957
  * 删除一个分组的结果:ok 为 false 时 reason 说明原因(这条通道只有一组、找不到分组 / 目标组…)。
1918
- * targetGroupId 是并进的那一组(并完只剩一组时是通道自己的 id)
1958
+ * targetGroupId 是并进的那一组(并完只剩一组时是通道自己的 id);removeLines 模式为 null
1919
1959
  */
1920
1960
  export interface GisViewChannelGroupRemoveResult {
1921
1961
  ok: boolean
@@ -1927,6 +1967,12 @@ export interface GisViewChannelGroupRemoveResult {
1927
1967
  targetGroupId?: string | number | null
1928
1968
  /** 被并走的回线 id */
1929
1969
  lineIds?: Array<string | number>
1970
+ /** removeLines 模式真正从数据里删掉的回线 */
1971
+ lines?: GisViewLine[]
1972
+ /** 这次是否走了「连组内回线一起删」分支 */
1973
+ removedLines?: boolean
1974
+ /** 删完后这条通道一条成员都不剩,整条通道也一起删掉了 */
1975
+ removedChannel?: boolean
1930
1976
  /** 改完之后这条通道的分组现状(与 getChannelGroups 同一份) */
1931
1977
  groups?: GisViewChannelGroupInfo[]
1932
1978
  }
@@ -2474,16 +2520,42 @@ export interface GisViewRemoveLineResult {
2474
2520
  removedChannel?: boolean
2475
2521
  }
2476
2522
 
2477
- /** removeChannel 的结果:lineIds / lines 是跟着通道一起消失的回线 */
2523
+ /** removeChannel 的结果:lineIds / lines 是跟着通道一起消失的回线;keepLines 时改为 keptLineIds 保留下来 */
2478
2524
  export interface GisViewRemoveChannelResult {
2479
2525
  ok: boolean
2480
2526
  reason?: string
2481
2527
  channelId?: string | number
2482
2528
  lineIds?: Array<string | number>
2483
2529
  lines?: GisViewLine[]
2530
+ /** keepLines 模式保留下来的原成员回线 id(数据仍在,之后按独立线路绘制) */
2531
+ keptLineIds?: Array<string | number>
2484
2532
  removedChannel?: boolean
2485
2533
  }
2486
2534
 
2535
+ /** removeChannels 的逐条结果:在单条 removeChannel 的读数上补原通道下标与被删通道对象 */
2536
+ export interface GisViewRemoveChannelsItemResult extends GisViewRemoveChannelResult {
2537
+ index?: number
2538
+ item?: GisViewChannel
2539
+ }
2540
+
2541
+ /** removeChannels 的结果:results 与传入的有效通道一一对应,skipped 是认不出 / 重复的引用 */
2542
+ export interface GisViewRemoveChannelsResult {
2543
+ ok: boolean
2544
+ reason?: string
2545
+ count: number
2546
+ results: GisViewRemoveChannelsItemResult[]
2547
+ channelIds: Array<string | number>
2548
+ /** 删除前这些通道在 channels 数组里的下标 */
2549
+ channelIndexes: number[]
2550
+ lineIds: Array<string | number>
2551
+ lines: GisViewLine[]
2552
+ /** 本次一起消失的全部通道(含因成员回线被删而空掉的通道) */
2553
+ removedChannels: GisViewChannel[]
2554
+ /** keepLines 模式保留下来的原成员回线 id */
2555
+ keptLineIds?: Array<string | number>
2556
+ skipped: Array<{ ref?: unknown; reason: string }>
2557
+ }
2558
+
2487
2559
  /** removeLines 的结果:entries 是每条被移除的线路(含下标与原属通道),lines / lineIds / indexes 是同一批的顺手读数 */
2488
2560
  export interface GisViewRemoveLinesResult {
2489
2561
  ok: boolean
@@ -2572,7 +2644,11 @@ export interface GisViewLineAddSpec {
2572
2644
  lineData?: GisViewChannelLineData
2573
2645
  }
2574
2646
 
2575
- /** 第二段线路数据(lineData):对象里的 id 就是回线 id(没写的自动编号),裸字符串 / 数字等价于 { id } */
2647
+ /**
2648
+ * 第二段线路数据(lineData):对象里的 id 就是回线 id(没写的自动编号),裸字符串 / 数字等价于 { id }。
2649
+ * 只用于 addChannel / addLine / commitAddChannel 等新增入口;落地后线路进顶层 lines,通道只记 lineIds,
2650
+ * 不会在 channel 上再保存一份 lineData。
2651
+ */
2576
2652
  export type GisViewChannelLineData = Partial<GisViewLine> | string | number | Array<Partial<GisViewLine> | string | number | undefined>
2577
2653
 
2578
2654
  /** 新签名 addChannel 第三段的一项:新通道的分组信息(id / 成员 / 中间拐点;缺省整条通道一组) */
@@ -3590,8 +3666,8 @@ export type GisViewPointerActionType =
3590
3666
  | 'click'
3591
3667
  | 'pan'
3592
3668
  | 'copy'
3593
- | 'channelDraft'
3594
- | 'decorationDraft'
3669
+ | 'channelDraft'
3670
+ | 'decorationDraft'
3595
3671
  | 'drag'
3596
3672
  | 'pointer'
3597
3673
 
@@ -4010,6 +4086,8 @@ export interface GisViewPointMergePayload {
4010
4086
  impact: GisViewMergeImpact | null
4011
4087
  /** 合并后保留谁:'target'(缺省,碰撞目标)或 'source'(当前拖动的来源节点);确认时传 confirm({ keep }) */
4012
4088
  keep: GisViewMergeKeep
4089
+ /** 这一次合并采用的通道分组策略;confirm({ channelGroups }) / resolvePointMerge(true, { channelGroups }) 可覆盖全局配置 */
4090
+ channelGroups: GisViewMergeChannelGroups
4013
4091
  /**
4014
4092
  * confirm 阶段的合并结果(按 keep 决定的保留端业务字段优先、merge.maxKeys 列出的字段取双方最高值、
4015
4093
  * 尺寸取双方最大、图标用保留端):
@@ -4054,6 +4132,8 @@ export interface GisViewMergeResult {
4054
4132
  mergedChannels: number
4055
4133
  /** 端点改到目标节点的通道条数 */
4056
4134
  channelsChanged: number
4135
+ /** 决定撞在一起的两条通道怎么分组的策略(与 merge.channelGroups / 本次 options.channelGroups 同一口径) */
4136
+ channelGroups: GisViewMergeChannelGroups
4057
4137
  /** 与 confirm 阶段同一口径的影响读数;合并后需要按 id 查明细时也能直接用 */
4058
4138
  impact: GisViewMergeImpact
4059
4139
  /** 直接提交后端的完整变更集(删除来源节点、更新 / 删除线路与通道) */
@@ -4078,6 +4158,8 @@ export interface GisViewMergeFailure {
4078
4158
  removedLines: number
4079
4159
  removedChannels: number
4080
4160
  mergedChannels: number
4161
+ /** 这次调用采用的分组策略;失败载荷也带上,便于界面统一读同一字段 */
4162
+ channelGroups: GisViewMergeChannelGroups
4081
4163
  originalEvent: Event | null
4082
4164
  }
4083
4165
 
@@ -4105,6 +4187,8 @@ export interface GisViewMergeSelectedPayload {
4105
4187
  removedChannels: number
4106
4188
  mergedChannels: number
4107
4189
  channelsChanged: number
4190
+ /** 整批合并采用的通道分组策略(逐对 merge 结果里也各带一份) */
4191
+ channelGroups: GisViewMergeChannelGroups
4108
4192
  originalEvent: Event | null
4109
4193
  }
4110
4194
 
@@ -4139,6 +4223,12 @@ export interface GisViewMergeSelectedOptions {
4139
4223
  item?: Partial<GisViewPoint> | ((context: GisViewMergeSelectedItemContext) => Partial<GisViewPoint> | void)
4140
4224
  /** true 时连 mergeable: false 的节点也并(默认跳过它们) */
4141
4225
  force?: boolean
4226
+ /**
4227
+ * 覆盖 merge.channelGroups:撞成同一条的通道里,被并来源的回线怎么进保留通道。
4228
+ * 'keep' 各自保留 / 'merge' 合成一组 / 'newGroup' 收成一个新组 / 'first' 并进第一组 /
4229
+ * { groupId } 并进指定组(找不到回落第一组)
4230
+ */
4231
+ channelGroups?: GisViewMergeChannelGroups
4142
4232
  /** 这一步历史的标签(默认「合并选中节点」) */
4143
4233
  label?: string
4144
4234
  originalEvent?: Event | null
@@ -4313,6 +4403,7 @@ export type GisViewDataChangeType =
4313
4403
  | 'updatePoint'
4314
4404
  | 'updateLine'
4315
4405
  | 'updateChannel'
4406
+ | 'updateChannels'
4316
4407
  | 'pointDrag'
4317
4408
  | 'copyPoint'
4318
4409
  | 'copyPoints'
@@ -4332,6 +4423,7 @@ export type GisViewDataChangeType =
4332
4423
  | 'removeSelected'
4333
4424
  | 'removeLine'
4334
4425
  | 'removeChannel'
4426
+ | 'removeChannels'
4335
4427
  | 'channelGroups'
4336
4428
  /** 撤销 / 重做回放了一条历史记录(这是接口 undo() / redo() 与 Ctrl+Z / Ctrl+Shift+Z 发的那一条) */
4337
4429
  | 'undo'
@@ -4365,7 +4457,9 @@ export interface GisViewDataChangePayload {
4365
4457
  /** 动作对应的要素:更新的那一个、复制 / 合并出来的那一个、删掉的那一条线路或通道 */
4366
4458
  item?: GisViewPoint | GisViewLine | GisViewChannel
4367
4459
  /** 删掉 / 加上的那些要素(节点或线路) */
4368
- items?: Array<GisViewPoint | GisViewLine>
4460
+ items?: Array<GisViewPoint | GisViewLine | GisViewChannel>
4461
+ /** 批量更新的逐条定位结果(updateChannels / patchChannels 会带上认不出的引用) */
4462
+ skipped?: unknown[]
4369
4463
  /** 这次动到几个要素 */
4370
4464
  count?: number
4371
4465
  /** 拖拽结束:本次跟着改坐标的节点与线路(与 onPointDrag 的 points / lines 同一份) */
@@ -4387,6 +4481,8 @@ export interface GisViewDataChangePayload {
4387
4481
  /** 合并落地:与 onPointMerge 的 impact / changes 同一份(批量里逐条 mergePoints 也各带一份) */
4388
4482
  impact?: GisViewMergeImpact
4389
4483
  mergeChanges?: GisViewMergeChangeSet
4484
+ /** 合并落地:本次采用的通道分组策略 */
4485
+ channelGroups?: GisViewMergeChannelGroups
4390
4486
  /** 拐点增删:第几段(pathIndex)、坐标与所属集合 */
4391
4487
  pathIndex?: number
4392
4488
  phase?: string
@@ -6187,9 +6283,10 @@ export interface GisViewMergeOptions {
6187
6283
  /**
6188
6284
  * 两个节点合到一块儿之后,它们之间的通道撞成同一条时怎么处理:
6189
6285
  * 'keep'(缺省)各自保留自己的分组(声明照旧,只是端点改到目标节点);
6190
- * 'merge' 合成一个分组(回线取并集)
6286
+ * 'merge' 合成一个分组(回线取并集);'newGroup' 把被并通道的回线收成一个新组;
6287
+ * 'first' 并进保留通道第一组;{ groupId } 并进指定组(找不到回落第一组)
6191
6288
  */
6192
- channelGroups?: 'keep' | 'merge'
6289
+ channelGroups?: GisViewMergeChannelGroups
6193
6290
  /**
6194
6291
  * 合并后取双方最高值的字段:只认列出来的键,缺省空表(不取任何最高值,全部保留目标节点字段)。
6195
6292
  * 例如 `['vn_kv', 'value']`;也接受 `'vn_kv,value'` 写法。字段两边都是有限数字时取 Math.max,
@@ -6208,6 +6305,26 @@ export interface GisViewMergeOptions {
6208
6305
  /** 拖拽合并的触发时机:两个节点的屏幕半径相碰 / 拖动节点中心进入目标节点区域 */
6209
6306
  export type GisViewMergeTrigger = 'collision' | 'center'
6210
6307
 
6308
+ /**
6309
+ * 两条通道合并时的分组策略:
6310
+ * - 'keep'(缺省)各自保留原分组;
6311
+ * - 'merge' 合成一个分组;
6312
+ * - 'newGroup' 把被并通道的回线收成一个新分组,追加在保留通道后面;
6313
+ * - 'first' 把被并通道的回线并进保留通道第一组;
6314
+ * - { groupId } 并进保留通道指定 id 的那一组,找不到时回落第一组;{ groupId } 省略 id 等价于 'first'。
6315
+ */
6316
+ export type GisViewMergeChannelGroups =
6317
+ | 'keep'
6318
+ | 'merge'
6319
+ | 'newGroup'
6320
+ | 'first'
6321
+ | GisViewMergeChannelGroupTarget
6322
+
6323
+ /** 合并分组指定目标组:groupId 省略 / 为空时并入保留通道第一组 */
6324
+ export interface GisViewMergeChannelGroupTarget {
6325
+ groupId?: string | number
6326
+ }
6327
+
6211
6328
  /** 通道选中模式:点中通道里的一条回线时选中什么 */
6212
6329
  export type GisViewChannelSelectMode =
6213
6330
  /** 缺省:只选点中的这一条回线 */
@@ -6254,6 +6371,8 @@ export interface GisViewSelectInBoxOptions {
6254
6371
  /** resolvePointMerge / payload.confirm 的参数:保留哪一端,以及最终节点(可只给要改的字段) */
6255
6372
  export interface GisViewPointMergeConfirmOptions {
6256
6373
  keep?: GisViewMergeKeep
6374
+ /** 覆盖本次合并的通道分组策略;不传沿用 merge.channelGroups */
6375
+ channelGroups?: GisViewMergeChannelGroups
6257
6376
  item?: Partial<GisViewPoint> | null
6258
6377
  }
6259
6378
 
@@ -8722,7 +8841,12 @@ export interface GisViewInstance {
8722
8841
  * 返回 `{ ok, item, linesChanged, removedLines, removedChannels, mergedChannels }`,
8723
8842
  * 并不了返回 ok: false 并另发一条 `phase: 'merge', ok: false` 的事件
8724
8843
  */
8725
- mergePoints(source: GisViewPointRef, target: GisViewPointRef, options?: { originalEvent?: Event | null; item?: GisViewPoint }): GisViewMergeOutcome
8844
+ mergePoints(source: GisViewPointRef, target: GisViewPointRef, options?: {
8845
+ originalEvent?: Event | null
8846
+ item?: GisViewPoint
8847
+ /** 覆盖 merge.channelGroups 的通道分组策略;不传沿用全局配置 */
8848
+ channelGroups?: GisViewMergeChannelGroups
8849
+ }): GisViewMergeOutcome
8726
8850
  /**
8727
8851
  * 把一个节点拆成多份(mergePoints 的逆操作):parts 省略 / null / [] 且节点带 mergeInfo 时自动解除合并,
8728
8852
  * 恢复全部来源节点与合并前的线路 / 通道;给 parts 时第一份复用原下标与 id,其余追加到 points 末尾。
@@ -8976,12 +9100,21 @@ export interface GisViewInstance {
8976
9100
  addPoint(item: GisViewPoint, options?: { emit?: boolean; select?: boolean }): GisViewAddPointResult
8977
9101
  addPoints(items: GisViewPoint | GisViewPoint[], options?: { emit?: boolean; select?: boolean }): GisViewAddItemsResult<GisViewPoint>
8978
9102
  addLines(items: GisViewLine | GisViewLine[], options?: { emit?: boolean; select?: boolean }): GisViewAddItemsResult<GisViewLine>
8979
- /** 移除一条线路(撤销刚落地的新增线路):挂在通道上的回线会从通道声明里一起摘掉,通道空了整条删掉 */
9103
+ /** 移除一条线路(撤销刚落地的新增线路):挂在通道上的回线会从通道声明里一起摘掉;剩余成员按顶层 lineIds 与 groups 的并集判断,空了才整条删掉 */
8980
9104
  removeLine(lineId: string | number): GisViewRemoveLineResult
8981
- /** 一次移除多条线路(传数组):通道声明与分组跟着收拾,删空的通道整条走 */
9105
+ /** 一次移除多条线路(传数组):通道声明与分组跟着收拾;groups: [] 不会遮掉仍有成员的顶层 lineIds,删空的通道才整条走 */
8982
9106
  removeLines(lineIds: string | number | Array<string | number>): GisViewRemoveLinesResult
8983
- /** 移除整条通道:它名下的回线一条条摘掉,通道声明与回线一起消失 */
8984
- removeChannel(channelId: string | number): GisViewRemoveChannelResult
9107
+ /**
9108
+ * 移除整条通道:缺省连同成员回线一起删;options.keepLines 为 true 时只删通道声明,
9109
+ * 回线留在数据里成为独立线路,返回 keptLineIds 是保留下来的原成员引用
9110
+ */
9111
+ removeChannel(channelId: string | number, options?: { keepLines?: boolean }): GisViewRemoveChannelResult
9112
+ /**
9113
+ * 一次移除多条通道(removeChannel 的批量版):成员回线合成一次 removeLines,整批只重排一次、
9114
+ * 只记一步历史、只发一条 `removeChannels` 数据变更。重复引用只处理一次,认不出的引用进 `skipped`;
9115
+ * options.keepLines 为 true 时只删通道声明、回线全部保留;options.emit 传 false 时只改数据不发通知
9116
+ */
9117
+ removeChannels(channelIds: string | number | Array<string | number>, options?: { emit?: boolean; label?: string; keepLines?: boolean }): GisViewRemoveChannelsResult
8985
9118
  /** 改某个节点的数据(坐标 / 样式 / 符号)并重渲染:绑在它身上的线路与以它为锚点的通道跟着重排 */
8986
9119
  updatePoint(id: string | number, patch: Partial<GisViewPoint>): GisViewInstance
8987
9120
  /**
@@ -8998,15 +9131,30 @@ export interface GisViewInstance {
8998
9131
  * (id / index 之外的字段就是这一条的补丁),或者 `patchPoints(['a', 'b'], { status: 1 })`
8999
9132
  * 把同一份补丁盖到一批节点上。认不出来的记进 skipped,不影响其余条目;
9000
9133
  * 返回 `{ ok, indexes, items, count, skipped }`,只记一条历史、只发一条 updatePoints 数据变更。
9001
- * 与 `updateData({ points })` 的分工:那一条是整份替换节点数据,这里只动点到的这几条
9134
+ * 与 `updateData({ points })` 的分工:那一条是整份替换节点数据,这里只动点到的这几条。
9135
+ * 与 updatePoint 的分工是「一批 vs 一条」;旧的 updatePoints(points) 已按去重收口删除
9002
9136
  */
9003
9137
  patchPoints(entries: GisViewUpdateItemEntry<GisViewPoint> | Array<GisViewUpdateItemEntry<GisViewPoint>>, patch?: Partial<GisViewPoint>): GisViewUpdateItemsOutcome<GisViewPoint>
9004
9138
  /**
9005
- * 批量给线路打补丁:与 patchPoints 同一套写法(`patchLines([{ id: 'l1', width: 4 }])` /
9006
- * `patchLines(['l1', 'l2'], { color: '#f00' })`),返回 `{ ok, indexes, items, count, skipped }`,
9007
- * 只记一条历史、只发一条 updateLines 数据变更
9139
+ * updateLine 的批量版:与 patchPoints 同一套写法(`patchLines([{ id: 'l1', width: 4 }])` /
9140
+ * `patchLines(['l1', 'l2'], { color: '#f00' })`),每条与公共补丁都支持 updateLine 的线路字段和
9141
+ * `groupId` / `groupIndex` / `channelId` 分组指令。分组指令不写进线路数据;只给分组指令的条目不发
9142
+ * updateLines,有数据字段时整批只发一条 updateLines。一次调用只记一条历史;
9143
+ * 整份替换用 `updateData({ lines })`,旧的 updateLines(lines) 已按去重收口删除
9144
+ */
9145
+ patchLines(entries: GisViewLineUpdateItemEntry | GisViewLineUpdateItemEntry[], patch?: GisViewLinePatch): GisViewUpdateItemsOutcome<GisViewLine>
9146
+ /**
9147
+ * updateChannel 的批量版:`patchChannels([{ id: 'c1', name: '甲' }, { index: 2, width: 8 }])`
9148
+ * 一次改几条,或者 `patchChannels(['c1', 'c2'], { visible: false })` 把同一份通道补丁盖到一批上。
9149
+ * 也支持 `patchChannels(entries, patch?, linePatches?, lineIds?)` 以及逐条
9150
+ * `{ id, patch, linePatches, lineIds }`,三段与 updateChannel 的第二 / 三 / 四段同义。
9151
+ * 声明整批只推一次引擎;成员补丁、补建 / 整表少了删在同一 batch 内收尾,历史只算一步,
9152
+ * 主变更是一条 `updateChannels`;改过分组 / 成员表的通道另发 `channelGroups` / `channelGroupChange` 明细。
9153
+ * 旧扁平写法的 `groups` / `lineIds` 仍是声明级增删;逐条 `lineIds` 与 `linePatches` 配对时是整表对齐。
9154
+ * 认不出的定位、空表 / 不成对的整表进 `skipped`,不影响其余条目。整份换声明用
9155
+ * `updateData({ channels })`,旧的 updateChannels(channels) 已按去重收口删除
9008
9156
  */
9009
- patchLines(entries: GisViewUpdateItemEntry<GisViewLine> | Array<GisViewUpdateItemEntry<GisViewLine>>, patch?: Partial<GisViewLine>): GisViewUpdateItemsOutcome<GisViewLine>
9157
+ patchChannels(entries: GisViewChannelUpdateItemEntry | GisViewChannelUpdateItemEntry[], patch?: GisViewChannelPatch, linePatches?: GisViewChannelLinePatch | GisViewChannelLinePatch[], lineIds?: string | number | Array<string | number>): GisViewUpdateItemsOutcome<GisViewChannel>
9010
9158
  /**
9011
9159
  * 改某个通道的数据(分组、宽度、端点等)并重渲染(与整份换声明的 `updateData({ channels })` 一对):
9012
9160
  * 成员表没变时只把成员回线换成新几何,成员表换了(改 lineIds)整份重解析。
@@ -9031,7 +9179,7 @@ export interface GisViewInstance {
9031
9179
  * 什么都不做。只写 groups 缩小时回线留在数据里,被移出通道、又不在别的通道上的各报一句 warning;
9032
9180
  * 不属于这条通道的条目跳过并报一句 warning(同一个条目只提醒一次)
9033
9181
  */
9034
- updateChannel(id: string | number, patch: Partial<GisViewChannel>, linePatches?: GisViewChannelLinePatch | GisViewChannelLinePatch[], lineIds?: string | number | Array<string | number>): GisViewInstance
9182
+ updateChannel(id: string | number, patch: GisViewChannelPatch, linePatches?: GisViewChannelLinePatch | GisViewChannelLinePatch[], lineIds?: string | number | Array<string | number>): GisViewInstance
9035
9183
  /** 逐要素的复合改法:同时处理多种字段、通道分组或成员回线时用这些入口;单项字段直接用 updatePoint / updateLine / updateChannel */
9036
9184
  /** 挪一个节点:`movePoint('n1', { x, y })` / `movePoint('n1', [x, y])` / `movePoint('n1', x, y)` 都认,绑定线路与锚定通道跟着重排 */
9037
9185
  movePoint(id: string | number, coordinate: GisViewCoordinate): GisViewInstance