gis-view-webgl2 0.1.13 → 0.1.15
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/index.cjs +1 -1
- package/dist/index.d.ts +140 -60
- package/dist/index.js +1 -1
- package/docs/AI/345/257/271/350/257/235/346/261/207/346/200/273.md +73 -5
- package/docs/GisView.md +49 -49
- 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 +87 -16
- package/docs/demos/ApiCoverageDemo.vue +1 -5
- package/docs/demos/BackendSyncDemo.vue +1 -2
- package/docs/demos/BackgroundDemo.vue +68 -1
- package/docs/demos/BasicDemo.vue +76 -76
- package/docs/demos/BatchAddDemo.vue +2 -1
- package/docs/demos/ChannelDemo.vue +1 -3
- package/docs/demos/ClusterDemo.vue +48 -1
- package/docs/demos/CopyMergeDemo.vue +899 -904
- package/docs/demos/DemoShell.vue +336 -336
- package/docs/demos/EventDemo.vue +300 -300
- package/docs/demos/ExtensionDemo.vue +200 -200
- package/docs/demos/GisViewDemo.vue +64 -64
- package/docs/demos/LabelDemo.vue +489 -489
- package/docs/demos/StyleDemo.vue +67 -67
- package/docs/demos/api-index.js +24 -29
- package/docs/demos/demos.js +92 -92
- package/docs/demos/gis-view-demo/useGisViewDemo.js +19 -14
- package/docs/demos/shared/demoData.js +107 -107
- package/docs/demos/shared/demoStyle.css +249 -249
- package/docs/format/02-/350/212/202/347/202/271/344/270/216/347/272/277/350/267/257.md +3 -3
- package/docs/format/03-/346/213/220/347/202/271/350/243/205/351/245/260/344/270/216/346/240/267/345/274/217.md +3 -0
- package/docs/from0/01-/345/205/210/346/212/212/345/234/260/345/233/276/346/203/263/346/270/205/346/245/232.md +8 -7
- package/docs/index.html +3 -3
- package/docs/internals/04-/347/233/270/346/234/272/345/235/220/346/240/207/344/270/216/345/203/217/347/264/240.md +6 -4
- package/docs/internals/14-/350/203/214/346/231/257/345/261/202.md +2 -2
- package/docs/manual/02-/345/235/220/346/240/207/344/270/216/346/225/260/346/215/256.md +36 -16
- package/docs/manual/03-/351/205/215/347/275/256/351/241/271.md +38 -84
- package/docs/manual/04-/344/272/213/344/273/266/344/270/216/345/233/236/350/260/203.md +36 -19
- 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
- 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 +7 -7
- package/docs/manual/08-/351/200/211/344/270/255/344/270/216/346/213/220/347/202/271.md +15 -15
- 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 +1 -1
- package/docs/manual/12-/346/240/207/347/255/276/344/270/216/350/243/205/351/245/260.md +6 -0
- package/docs/manual/14-/350/247/206/345/233/276/344/270/216/347/255/233/351/200/211.md +1 -1
- package/docs/manual/15-/345/257/274/345/207/272/344/270/216/351/233/206/346/210/220.md +2 -0
- package/docs/manual/16-/345/256/236/344/276/213/346/226/271/346/263/225/346/200/273/350/241/250.md +10 -8
- package/docs/manual/17-/345/217/202/346/225/260/351/200/237/346/237/245.md +11 -7
- package/docs/manual/18-/351/200/220/346/226/271/346/263/225/347/244/272/344/276/213.md +27 -8
- package/docs/manual/20-/346/200/247/350/203/275/344/270/216/345/244/247/346/225/260/346/215/256.md +27 -4
- package/docs/manual/21-/350/257/264/346/230/216/344/270/216/345/270/270/350/247/201/351/227/256/351/242/230.md +3 -3
- package/docs/playground/index.html +1 -1
- package/docs/sample-document/345/255/227/346/256/265/350/257/246/350/247/243.md +2 -2
- package/docs/steps/check-doc-truth.mjs +1 -1
- package/docs/steps/selftest-actions.html +4 -4
- package/docs/steps/selftest-data.html +5 -5
- package/docs/steps/selftest-demos.html +1683 -1619
- package/docs/steps/selftest-docs.html +4 -4
- package/docs/steps/selftest-effects.html +1 -1
- package/docs/steps/selftest-features.html +548 -47
- package/docs/steps/selftest-full.html +566 -566
- package/docs/steps/selftest-labels.html +647 -647
- package/docs/steps/selftest-perf.html +2282 -2237
- package/docs/steps/selftest-select.html +53 -14
- package/docs/steps/step-10-full.js +1 -4
- package/docs/steps/step-12-events.js +1 -4
- package/package.json +43 -43
package/docs/demos/demos.js
CHANGED
|
@@ -1,34 +1,34 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* 演示注册表:一个功能一个演示,各自独立成组件(自己的画布 + 控件 + 读数),
|
|
3
|
-
* 由 DemoShell.vue 按页签懒加载 —— 想看哪一块就进哪一块,不用在一屏里翻几十个面板。
|
|
4
|
-
*
|
|
5
|
-
* `component` 是动态 import:切到哪个演示才加载哪个组件(综合示例最大,不进来就不下载)。
|
|
6
|
-
* `group` 是页签的分组(见 DEMO_GROUPS:基础 / 交互 / 样式 / 数据 / 性能 / 综合),
|
|
7
|
-
* `doc` 是「这块功能对应哪一份文档」的直达链接,外壳把那句说明旁边挂一个小链接。
|
|
8
|
-
*/
|
|
9
|
-
const docsBase = `${import.meta.env?.BASE_URL ?? '/'}docs/index.html`
|
|
10
|
-
/** 文档直达链接:`#` 后面是文档中心认识的 markdown 文件名(见 docs/index.html 的 load) */
|
|
11
|
-
const DOC_GUIDE = { href: `${docsBase}#GisView.md`, label: 'GisView.md' }
|
|
1
|
+
/**
|
|
2
|
+
* 演示注册表:一个功能一个演示,各自独立成组件(自己的画布 + 控件 + 读数),
|
|
3
|
+
* 由 DemoShell.vue 按页签懒加载 —— 想看哪一块就进哪一块,不用在一屏里翻几十个面板。
|
|
4
|
+
*
|
|
5
|
+
* `component` 是动态 import:切到哪个演示才加载哪个组件(综合示例最大,不进来就不下载)。
|
|
6
|
+
* `group` 是页签的分组(见 DEMO_GROUPS:基础 / 交互 / 样式 / 数据 / 性能 / 综合),
|
|
7
|
+
* `doc` 是「这块功能对应哪一份文档」的直达链接,外壳把那句说明旁边挂一个小链接。
|
|
8
|
+
*/
|
|
9
|
+
const docsBase = `${import.meta.env?.BASE_URL ?? '/'}docs/index.html`
|
|
10
|
+
/** 文档直达链接:`#` 后面是文档中心认识的 markdown 文件名(见 docs/index.html 的 load) */
|
|
11
|
+
const DOC_GUIDE = { href: `${docsBase}#GisView.md`, label: 'GisView.md' }
|
|
12
12
|
const DOC_INTERNALS = { href: `${docsBase}#GisView实现原理.md`, label: '实现原理' }
|
|
13
|
-
const DOC_EDIT = { href: `${docsBase}#manual/07-指针与要素编辑.md`, label: '07 指针与要素编辑' }
|
|
14
|
-
const DOC_UPDATE = { href: `${docsBase}#manual/06-数据与场景更新.md`, label: '06 数据与场景更新' }
|
|
15
|
-
const DOC_LABELS = { href: `${docsBase}#manual/12-标签与装饰.md`, label: '12 标签与装饰' }
|
|
13
|
+
const DOC_EDIT = { href: `${docsBase}#manual/07-指针与要素编辑.md`, label: '07 指针与要素编辑' }
|
|
14
|
+
const DOC_UPDATE = { href: `${docsBase}#manual/06-数据与场景更新.md`, label: '06 数据与场景更新' }
|
|
15
|
+
const DOC_LABELS = { href: `${docsBase}#manual/12-标签与装饰.md`, label: '12 标签与装饰' }
|
|
16
16
|
const DOC_VIEW = { href: `${docsBase}#manual/14-视图与筛选.md`, label: '14 视图与筛选' }
|
|
17
17
|
const DOC_PERF = { href: `${docsBase}#manual/20-性能与大数据.md`, label: '20 性能与大数据' }
|
|
18
18
|
const DOC_API = { href: `${docsBase}#接口协议.md`, label: '编辑接口协议' }
|
|
19
19
|
const DOC_EXTEND = { href: `${docsBase}#manual/15-导出与集成.md`, label: '15 导出与集成' }
|
|
20
|
-
|
|
21
|
-
/** 页签分组的固定次序与组名(每组里的演示按 DEMOS 里的顺序排) */
|
|
22
|
-
export const DEMO_GROUPS = [
|
|
23
|
-
{ id: 'basic', label: '基础' },
|
|
24
|
-
{ id: 'interact', label: '交互' },
|
|
25
|
-
{ id: 'style', label: '样式' },
|
|
26
|
-
{ id: 'data', label: '数据' },
|
|
27
|
-
{ id: 'perf', label: '性能' },
|
|
28
|
-
{ id: 'full', label: '综合' }
|
|
29
|
-
]
|
|
30
|
-
|
|
31
|
-
export const DEMOS = [
|
|
20
|
+
|
|
21
|
+
/** 页签分组的固定次序与组名(每组里的演示按 DEMOS 里的顺序排) */
|
|
22
|
+
export const DEMO_GROUPS = [
|
|
23
|
+
{ id: 'basic', label: '基础' },
|
|
24
|
+
{ id: 'interact', label: '交互' },
|
|
25
|
+
{ id: 'style', label: '样式' },
|
|
26
|
+
{ id: 'data', label: '数据' },
|
|
27
|
+
{ id: 'perf', label: '性能' },
|
|
28
|
+
{ id: 'full', label: '综合' }
|
|
29
|
+
]
|
|
30
|
+
|
|
31
|
+
export const DEMOS = [
|
|
32
32
|
{
|
|
33
33
|
id: 'basic',
|
|
34
34
|
title: '基础视图',
|
|
@@ -47,17 +47,17 @@ export const DEMOS = [
|
|
|
47
47
|
},
|
|
48
48
|
{
|
|
49
49
|
id: 'labels',
|
|
50
|
-
title: '标签交互',
|
|
51
|
-
group: 'interact',
|
|
52
|
-
blurb: '标签点选 / 拖拽 / 右键菜单(编辑、改位置、删除),以及用一套 API 给选中集批量加标签。',
|
|
53
|
-
doc: DOC_GUIDE,
|
|
54
|
-
component: () => import('./LabelDemo.vue')
|
|
55
|
-
},
|
|
50
|
+
title: '标签交互',
|
|
51
|
+
group: 'interact',
|
|
52
|
+
blurb: '标签点选 / 拖拽 / 右键菜单(编辑、改位置、删除),以及用一套 API 给选中集批量加标签。',
|
|
53
|
+
doc: DOC_GUIDE,
|
|
54
|
+
component: () => import('./LabelDemo.vue')
|
|
55
|
+
},
|
|
56
56
|
{
|
|
57
57
|
id: 'label-display',
|
|
58
58
|
title: '标签显示',
|
|
59
|
-
group: 'interact',
|
|
60
|
-
blurb: '动态切换节点 / 线路标签内容:名称、电压、负载率、自定义模板,还能分别改一类或自动轮播。',
|
|
59
|
+
group: 'interact',
|
|
60
|
+
blurb: '动态切换节点 / 线路标签内容:名称、电压、负载率、自定义模板,还能分别改一类或自动轮播。',
|
|
61
61
|
doc: DOC_LABELS,
|
|
62
62
|
component: () => import('./LabelDisplayDemo.vue')
|
|
63
63
|
},
|
|
@@ -77,35 +77,35 @@ export const DEMOS = [
|
|
|
77
77
|
doc: DOC_GUIDE,
|
|
78
78
|
component: () => import('./StyleDemo.vue')
|
|
79
79
|
},
|
|
80
|
-
{
|
|
81
|
-
id: 'hover-tooltip',
|
|
82
|
-
title: '悬停与提示',
|
|
83
|
-
group: 'style',
|
|
84
|
-
blurb: '悬浮节点 / 线路的高亮样式现场调;tooltip 内容可用模板、函数或 DOM 元素,悬停期间也能立刻刷新。',
|
|
85
|
-
doc: DOC_LABELS,
|
|
86
|
-
component: () => import('./HoverTooltipDemo.vue')
|
|
87
|
-
},
|
|
88
|
-
{
|
|
89
|
-
id: 'channel',
|
|
90
|
-
title: '通道与数据',
|
|
91
|
-
group: 'data',
|
|
80
|
+
{
|
|
81
|
+
id: 'hover-tooltip',
|
|
82
|
+
title: '悬停与提示',
|
|
83
|
+
group: 'style',
|
|
84
|
+
blurb: '悬浮节点 / 线路的高亮样式现场调;tooltip 内容可用模板、函数或 DOM 元素,悬停期间也能立刻刷新。',
|
|
85
|
+
doc: DOC_LABELS,
|
|
86
|
+
component: () => import('./HoverTooltipDemo.vue')
|
|
87
|
+
},
|
|
88
|
+
{
|
|
89
|
+
id: 'channel',
|
|
90
|
+
title: '通道与数据',
|
|
91
|
+
group: 'data',
|
|
92
92
|
blurb: '通道分组拆合、拐点增删拖、通道内指定回线显隐、节点 / 线路 / 通道 / 分组单条与批量显隐,以及隐藏回线车道 preserve / center 对照;另带整份 groups / path 覆盖的假接口联调与数据导出 / 回灌。',
|
|
93
|
-
doc: DOC_API,
|
|
94
|
-
component: () => import('./ChannelDemo.vue')
|
|
95
|
-
},
|
|
96
|
-
{
|
|
97
|
-
id: 'backend',
|
|
98
|
-
title: '编辑与保存',
|
|
99
|
-
group: 'data',
|
|
100
|
-
blurb: '分组增删改、拐点增删改、场站改坐标:每一步要发给后端的请求体都摊在面板上,配上待提交队列 / 版本号 / 409 与整份保存。',
|
|
101
|
-
doc: DOC_API,
|
|
102
|
-
component: () => import('./BackendSyncDemo.vue')
|
|
103
|
-
},
|
|
93
|
+
doc: DOC_API,
|
|
94
|
+
component: () => import('./ChannelDemo.vue')
|
|
95
|
+
},
|
|
96
|
+
{
|
|
97
|
+
id: 'backend',
|
|
98
|
+
title: '编辑与保存',
|
|
99
|
+
group: 'data',
|
|
100
|
+
blurb: '分组增删改、拐点增删改、场站改坐标:每一步要发给后端的请求体都摊在面板上,配上待提交队列 / 版本号 / 409 与整份保存。',
|
|
101
|
+
doc: DOC_API,
|
|
102
|
+
component: () => import('./BackendSyncDemo.vue')
|
|
103
|
+
},
|
|
104
104
|
{
|
|
105
105
|
id: 'events',
|
|
106
106
|
title: '事件与方法',
|
|
107
|
-
group: 'interact',
|
|
108
|
-
blurb: '一条 * 订阅看全部事件,配上常用方法按钮 —— 事件载荷与方法返回值都打在日志里。',
|
|
107
|
+
group: 'interact',
|
|
108
|
+
blurb: '一条 * 订阅看全部事件,配上常用方法按钮 —— 事件载荷与方法返回值都打在日志里。',
|
|
109
109
|
doc: DOC_GUIDE,
|
|
110
110
|
component: () => import('./EventDemo.vue')
|
|
111
111
|
},
|
|
@@ -119,12 +119,12 @@ export const DEMOS = [
|
|
|
119
119
|
},
|
|
120
120
|
{
|
|
121
121
|
id: 'copy-merge',
|
|
122
|
-
title: '批量复制与合并',
|
|
123
|
-
group: 'interact',
|
|
122
|
+
title: '批量复制与合并',
|
|
123
|
+
group: 'interact',
|
|
124
124
|
blurb: '在画布 Shift 框选后整组复制或合并:复制 / 合并都接假后端,演示版本号、opId 幂等、失败重试与本地回滚;合并可切碰撞 / 中心进入目标区域两种触发时机,Alt 点击 / Ctrl+V 的复制事件也可直接回滚或用 addPoint 接管。',
|
|
125
|
-
doc: DOC_API,
|
|
126
|
-
component: () => import('./CopyMergeDemo.vue')
|
|
127
|
-
},
|
|
125
|
+
doc: DOC_API,
|
|
126
|
+
component: () => import('./CopyMergeDemo.vue')
|
|
127
|
+
},
|
|
128
128
|
{
|
|
129
129
|
id: 'drag',
|
|
130
130
|
title: '拖拽落点',
|
|
@@ -143,28 +143,28 @@ export const DEMOS = [
|
|
|
143
143
|
},
|
|
144
144
|
{
|
|
145
145
|
id: 'decoration',
|
|
146
|
-
title: '动态装饰器',
|
|
147
|
-
group: 'interact',
|
|
146
|
+
title: '动态装饰器',
|
|
147
|
+
group: 'interact',
|
|
148
148
|
blurb: '线路与节点可分开或同时开启:悬停目标就出临时装饰,移开收掉、松手命中才发 ready;节点可调偏移 / 固定 / 鼠标吸附、连接线与白名单,线路可调平行方向与单线 / 分组 / 通道范围,确认才写数据。',
|
|
149
|
-
doc: DOC_LABELS,
|
|
150
|
-
component: () => import('./DecorationDraftDemo.vue')
|
|
151
|
-
},
|
|
149
|
+
doc: DOC_LABELS,
|
|
150
|
+
component: () => import('./DecorationDraftDemo.vue')
|
|
151
|
+
},
|
|
152
152
|
{
|
|
153
153
|
id: 'batch-add',
|
|
154
|
-
title: '批量新增',
|
|
155
|
-
group: 'data',
|
|
156
|
-
blurb: '五个批量入口各一颗按钮:多节点、多线路、多通道、多拐点、多分组;每次只记一步历史、只发一条数据变更,返回读数与当前规模都摊在面板上。',
|
|
157
|
-
doc: DOC_UPDATE,
|
|
158
|
-
component: () => import('./BatchAddDemo.vue')
|
|
159
|
-
},
|
|
160
|
-
{
|
|
161
|
-
id: 'search-filter',
|
|
162
|
-
title: '搜索与筛选',
|
|
163
|
-
group: 'data',
|
|
164
|
-
blurb: '关键字 / scope / fields / limit 现场调,同步搜索与 Worker 异步搜索对照;筛选条件、getFilterResult 与 getVisibleData 同屏读数。',
|
|
165
|
-
doc: DOC_VIEW,
|
|
166
|
-
component: () => import('./SearchFilterDemo.vue')
|
|
167
|
-
},
|
|
154
|
+
title: '批量新增',
|
|
155
|
+
group: 'data',
|
|
156
|
+
blurb: '五个批量入口各一颗按钮:多节点、多线路、多通道、多拐点、多分组;每次只记一步历史、只发一条数据变更,返回读数与当前规模都摊在面板上。',
|
|
157
|
+
doc: DOC_UPDATE,
|
|
158
|
+
component: () => import('./BatchAddDemo.vue')
|
|
159
|
+
},
|
|
160
|
+
{
|
|
161
|
+
id: 'search-filter',
|
|
162
|
+
title: '搜索与筛选',
|
|
163
|
+
group: 'data',
|
|
164
|
+
blurb: '关键字 / scope / fields / limit 现场调,同步搜索与 Worker 异步搜索对照;筛选条件、getFilterResult 与 getVisibleData 同屏读数。',
|
|
165
|
+
doc: DOC_VIEW,
|
|
166
|
+
component: () => import('./SearchFilterDemo.vue')
|
|
167
|
+
},
|
|
168
168
|
{
|
|
169
169
|
id: 'extension',
|
|
170
170
|
title: '扩展能力',
|
|
@@ -207,13 +207,13 @@ export const DEMOS = [
|
|
|
207
207
|
},
|
|
208
208
|
{
|
|
209
209
|
id: 'full',
|
|
210
|
-
title: '综合示例(全功能)',
|
|
211
|
-
group: 'full',
|
|
210
|
+
title: '综合示例(全功能)',
|
|
211
|
+
group: 'full',
|
|
212
212
|
blurb: '所有面板都在这一个演示里:十万级数据、热力图、鹰眼图、通道编辑、历史与快捷键;框选还能保留矩形、框内拖动整组平移,并切到 DOM 框演示线型 / 圆角 / className。',
|
|
213
|
-
doc: { href: docsBase, label: '文档中心' },
|
|
214
|
-
component: () => import('./GisViewDemo.vue')
|
|
215
|
-
}
|
|
216
|
-
]
|
|
217
|
-
|
|
218
|
-
/** 默认进综合示例:它信息量最全,也是文档里到处引用的那一个 */
|
|
219
|
-
export const DEFAULT_DEMO_ID = 'full'
|
|
213
|
+
doc: { href: docsBase, label: '文档中心' },
|
|
214
|
+
component: () => import('./GisViewDemo.vue')
|
|
215
|
+
}
|
|
216
|
+
]
|
|
217
|
+
|
|
218
|
+
/** 默认进综合示例:它信息量最全,也是文档里到处引用的那一个 */
|
|
219
|
+
export const DEFAULT_DEMO_ID = 'full'
|
|
@@ -613,9 +613,9 @@ export const useGisViewDemo = () => {
|
|
|
613
613
|
renderLabel.value = `第 ${payload.frame} 帧 · ${payload.fps.toFixed(0)} FPS · ${payload.drawCalls} 次绘制 · ${payload.interval}ms 节流`
|
|
614
614
|
}
|
|
615
615
|
/**
|
|
616
|
-
* 功能开关(features):
|
|
616
|
+
* 功能开关(features):19 个开关的**有效值**由 getFeatures() 给出来 —— 预设名
|
|
617
617
|
* ('edit' 全开 / 'view' 只读浏览 / 'static' 静态图)一行决定整体口径,单点开关再叠一层,
|
|
618
|
-
* 没写的开关跟随各自的详细配置(
|
|
618
|
+
* 没写的开关跟随各自的详细配置(boxSelect / copy.enabled…;拖拽只由 features.drag 控制)。
|
|
619
619
|
* 面板上的复选框直接照着这份有效值画:取消勾选=强制关掉这一个,勾回去=强制打开。
|
|
620
620
|
*/
|
|
621
621
|
const FEATURE_PRESET_OPTIONS = [
|
|
@@ -630,6 +630,8 @@ export const useGisViewDemo = () => {
|
|
|
630
630
|
zoom: '滚轮缩放',
|
|
631
631
|
hover: '悬停拾取',
|
|
632
632
|
select: '点击选中',
|
|
633
|
+
multiSelect: '无修饰键多选',
|
|
634
|
+
toggleSelect: '再次点击取消',
|
|
633
635
|
boxSelect: '框选',
|
|
634
636
|
drag: '拖动节点',
|
|
635
637
|
waypoint: '线路拐点',
|
|
@@ -4400,14 +4402,9 @@ export const useGisViewDemo = () => {
|
|
|
4400
4402
|
quality: qualityMode.value,
|
|
4401
4403
|
// 插件:把可复用的交互封装成一份(这里演示「F 键聚焦选中要素」,带自己的清理逻辑)
|
|
4402
4404
|
plugins: [focusSelectionPlugin],
|
|
4403
|
-
draggable: draggable.value,
|
|
4404
4405
|
liveDrag: liveDrag.value,
|
|
4405
|
-
clickable: clickable.value,
|
|
4406
|
-
boxSelect: boxSelect.value,
|
|
4407
4406
|
// 框选结束后保留矩形:框内拖动整组平移选中的节点;面板可随时改,右侧读数能看到坐标
|
|
4408
4407
|
selectionBoxPersistent: selectionBoxPersistent.value,
|
|
4409
|
-
multiSelect: multiSelect.value,
|
|
4410
|
-
toggleSelect: toggleSelect.value,
|
|
4411
4408
|
// 快捷键:框选 / 多选 / 加点 / 复制这四个「按住 + 操作」的修饰键都能改(缺省 Ctrl / Ctrl / Ctrl / Alt)
|
|
4412
4409
|
shortcuts: buildShortcuts(),
|
|
4413
4410
|
// 节点复制:Alt 点节点跟随鼠标落地,接口复制落在节点旁边(落点偏移在 copy.offset 里)
|
|
@@ -4423,7 +4420,6 @@ export const useGisViewDemo = () => {
|
|
|
4423
4420
|
selectionOnTop: selectionOnTop.value,
|
|
4424
4421
|
// 光标:按悬停目标分类 + 按住 Ctrl 的变体,见「光标档位」下拉
|
|
4425
4422
|
cursorStyle: cursorStylePatch(),
|
|
4426
|
-
waypointEditable: waypointEditable.value,
|
|
4427
4423
|
waypointVisibility: waypointAlways.value ? 'always' : 'selected',
|
|
4428
4424
|
fitPadding: 40,
|
|
4429
4425
|
// 鹰眼图由组件自带:这里只给尺寸、节点 / 线路各自的样式与交互参数
|
|
@@ -4569,18 +4565,27 @@ export const useGisViewDemo = () => {
|
|
|
4569
4565
|
// 换底图来源:定位到全省范围,并让数据映射跟着新底图重算一遍
|
|
4570
4566
|
watch(backgroundSource, value => applyBackground({ frame: value === 'province', remap: true }))
|
|
4571
4567
|
watch([backgroundMode, backgroundOpacity, backgroundImageFit, backgroundImageCorners, provinceAspectScale, provincePalette, provinceLabelShow, provinceLabelSize, provinceLabelColor], () => applyBackground())
|
|
4572
|
-
|
|
4568
|
+
const setDemoFeature = (name, value) => {
|
|
4569
|
+
const view = viewRef.value
|
|
4570
|
+
if (view) {
|
|
4571
|
+
view.setFeatures({ ...view.getFeatures(), [name]: value })
|
|
4572
|
+
}
|
|
4573
|
+
}
|
|
4574
|
+
watch(draggable, value => setDemoFeature('drag', value))
|
|
4573
4575
|
watch(liveDrag, value => viewRef.value?.updateOptions({ liveDrag: value }))
|
|
4574
|
-
watch(clickable, value =>
|
|
4575
|
-
|
|
4576
|
+
watch(clickable, value => {
|
|
4577
|
+
setDemoFeature('hover', value)
|
|
4578
|
+
setDemoFeature('select', value)
|
|
4579
|
+
})
|
|
4580
|
+
watch(boxSelect, value => setDemoFeature('boxSelect', value))
|
|
4576
4581
|
watch(selectionBoxPersistent, value => {
|
|
4577
4582
|
viewRef.value?.updateOptions({ selectionBoxPersistent: value })
|
|
4578
4583
|
if (!value) {
|
|
4579
4584
|
readSelectionBox()
|
|
4580
4585
|
}
|
|
4581
4586
|
})
|
|
4582
|
-
watch(multiSelect, value =>
|
|
4583
|
-
watch(toggleSelect, value =>
|
|
4587
|
+
watch(multiSelect, value => setDemoFeature('multiSelect', value))
|
|
4588
|
+
watch(toggleSelect, value => setDemoFeature('toggleSelect', value))
|
|
4584
4589
|
// 快捷键自定义:四个「按住 + 操作」的动作改完立刻下发(框选 / 多选 / 加点的修饰键同时也是光标变体的判据)
|
|
4585
4590
|
watch([shortcutBoxSelect, shortcutMultiSelect, shortcutAddWaypoint, shortcutDuplicate], () => {
|
|
4586
4591
|
viewRef.value?.updateOptions({ shortcuts: buildShortcuts() })
|
|
@@ -4601,7 +4606,7 @@ export const useGisViewDemo = () => {
|
|
|
4601
4606
|
viewRef.value?.updateOptions({ selectionBoxStyle: buildSelectionBoxStyle() })
|
|
4602
4607
|
readSelectionBox()
|
|
4603
4608
|
})
|
|
4604
|
-
watch(waypointEditable, value =>
|
|
4609
|
+
watch(waypointEditable, value => setDemoFeature('waypoint', value))
|
|
4605
4610
|
watch(waypointAlways, value => viewRef.value?.updateOptions({ waypointVisibility: value ? 'always' : 'selected' }))
|
|
4606
4611
|
watch([pointSize, lineWidth], () => viewRef.value?.updateOptions({ pointStyle: buildPointStyle(), lineStyle: buildLineStyle(), ...hoverStylePatch() }))
|
|
4607
4612
|
// 线型与直流标记:把当前的这批线重新加工一遍再交回视图 —— 相机、选中与筛选都不动,只是重解析这批线
|
|
@@ -1,107 +1,107 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* 几个功能演示(Basic / Label / Style / Channel / Event / Perf)共用的一份小规模演示数据:
|
|
3
|
-
* 字段名与真实样例数据保持一致(节点 id / name / x / y / vn_kv / station_type / zone_name,
|
|
4
|
-
* 线路 id / name / from / to / vn_kv / max_loading_rate),换成真实数据时写法不用改。
|
|
5
|
-
*
|
|
6
|
-
* 数据量刻意压在几十个节点:每个演示只讲一件事,读数与事件日志一眼能对上;
|
|
7
|
-
* 想看十万级规模的性能表现去「性能与质量」演示(它自己放大数据)。
|
|
8
|
-
*/
|
|
9
|
-
import { createChannels } from '../../../src/index.js'
|
|
10
|
-
|
|
11
|
-
/** 与真实样例同一套电压等级与站点类型 */
|
|
12
|
-
export const VOLTAGE_LEVELS = [1050, 525, 230, 15.7]
|
|
13
|
-
export const STATION_TYPES = ['station', 'storage', 'coal', 'gas', 'solar', 'wind', 'nuclear', 'load']
|
|
14
|
-
/** 电压等级配色:规则 / 图例 / 标签三处共用一份,改这里到处一致 */
|
|
15
|
-
export const VOLTAGE_COLORS = {
|
|
16
|
-
1050: '#ff4fa3',
|
|
17
|
-
525: '#a06bff',
|
|
18
|
-
230: '#3fa7ff',
|
|
19
|
-
15.7: '#4fd1a5'
|
|
20
|
-
}
|
|
21
|
-
|
|
22
|
-
/** 固定种子的随机数:每次刷新布局一致,方便对着文档看效果 */
|
|
23
|
-
export const createRandom = (seed) => () => {
|
|
24
|
-
seed = (seed * 1664525 + 1013904223) % 4294967296
|
|
25
|
-
return seed / 4294967296
|
|
26
|
-
}
|
|
27
|
-
|
|
28
|
-
/** 演示数据落在这块范围里:fitView 一次全看到 */
|
|
29
|
-
export const DEMO_CENTER = [116.35, 39.0]
|
|
30
|
-
export const DEMO_RADIUS = 2.2
|
|
31
|
-
/**
|
|
32
|
-
* 演示节点:环上撒点(半径按序号轻微起伏,不是标准圆),
|
|
33
|
-
* 电压 / 类型 / 分区按序号取模,分布均匀 —— 按属性配色、按规则改样式一眼能看出效果。
|
|
34
|
-
*/
|
|
35
|
-
export const createDemoPoints = (count = 28, seed = 20240915) => {
|
|
36
|
-
const random = createRandom(seed)
|
|
37
|
-
const points = []
|
|
38
|
-
for (let index = 0; index < count; index += 1) {
|
|
39
|
-
const angle = (index / count) * Math.PI * 2
|
|
40
|
-
const radius = DEMO_RADIUS * (0.6 + ((index % 5) / 5) * 0.4)
|
|
41
|
-
points.push({
|
|
42
|
-
id: `node-${index}`,
|
|
43
|
-
x: Number((DEMO_CENTER[0] + Math.cos(angle) * radius).toFixed(5)),
|
|
44
|
-
y: Number((DEMO_CENTER[1] + Math.sin(angle) * radius).toFixed(5)),
|
|
45
|
-
name: `变电站 ${index + 1}`,
|
|
46
|
-
vn_kv: VOLTAGE_LEVELS[index % VOLTAGE_LEVELS.length],
|
|
47
|
-
station_type: STATION_TYPES[(index * 3) % STATION_TYPES.length],
|
|
48
|
-
zone_name: `分区 ${(index % 4) + 1}`,
|
|
49
|
-
max_loading_rate: Number((0.4 + random() * 1.1).toFixed(3))
|
|
50
|
-
})
|
|
51
|
-
}
|
|
52
|
-
return points
|
|
53
|
-
}
|
|
54
|
-
/**
|
|
55
|
-
* 演示线路:沿环把相邻节点连起来(每点两条,度数均匀),
|
|
56
|
-
* 再补几条「辐条」连到 0 号节点 —— 环 + 辐条比纯环更像一张网,框选 / 拾取都有东西可点。
|
|
57
|
-
* 每 7 条里有一条标成直流线路(type: 'dc_line'),给装饰 / 规则演示用。
|
|
58
|
-
*/
|
|
59
|
-
export const connectDemoLines = (points) => {
|
|
60
|
-
const lines = []
|
|
61
|
-
const push = (fromIndex, toIndex) => {
|
|
62
|
-
const from = points[fromIndex]
|
|
63
|
-
const to = points[toIndex]
|
|
64
|
-
lines.push({
|
|
65
|
-
id: `line-${lines.length}`,
|
|
66
|
-
name: `线路 ${lines.length + 1}`,
|
|
67
|
-
from: from.id,
|
|
68
|
-
to: to.id,
|
|
69
|
-
vn_kv: from.vn_kv,
|
|
70
|
-
max_loading_rate: Number(((from.max_loading_rate + to.max_loading_rate) / 2).toFixed(3)),
|
|
71
|
-
...(lines.length % 7 === 3 ? { type: 'dc_line' } : {})
|
|
72
|
-
})
|
|
73
|
-
}
|
|
74
|
-
points.forEach((point, index) => push(index, (index + 1) % points.length))
|
|
75
|
-
points.forEach((point, index) => {
|
|
76
|
-
if (index > 0 && index % 5 === 0) {
|
|
77
|
-
push(0, index)
|
|
78
|
-
}
|
|
79
|
-
})
|
|
80
|
-
return lines
|
|
81
|
-
}
|
|
82
|
-
/**
|
|
83
|
-
* 一次拿齐:节点 + 线路(含通道回线)+ 通道。
|
|
84
|
-
* `lines` 已经带上通道回线,直接交给 createGisView({ points, lines, channels }) 就行;
|
|
85
|
-
* 只想演示普通线路时用 `linesWithoutChannel`。
|
|
86
|
-
*/
|
|
87
|
-
export const buildDemoData = (options = {}) => {
|
|
88
|
-
const { count = 28, seed = 20240915, channels = 3 } = options
|
|
89
|
-
const points = createDemoPoints(count, seed)
|
|
90
|
-
const lines = connectDemoLines(points)
|
|
91
|
-
if (!channels) {
|
|
92
|
-
return { points, lines, linesWithoutChannel: lines, channelLines: [], channels: [] }
|
|
93
|
-
}
|
|
94
|
-
const specs = [
|
|
95
|
-
{ id: 'channel-a', name: '甲通道', from: points[0].id, to: points[7 % count].id, circuits: 3, lineProps: { vn_kv: 1050, max_loading_rate: 1.12 } },
|
|
96
|
-
{ id: 'channel-b', name: '乙通道', from: points[12 % count].id, to: points[19 % count].id, circuits: 2, lineProps: { vn_kv: 525, max_loading_rate: 0.72 } },
|
|
97
|
-
{ id: 'channel-c', name: '丙通道', from: points[3 % count].id, to: points[15 % count].id, circuits: 4, lineProps: { vn_kv: 230, max_loading_rate: 0.51 } }
|
|
98
|
-
].slice(0, channels)
|
|
99
|
-
const built = createChannels(specs)
|
|
100
|
-
return {
|
|
101
|
-
points,
|
|
102
|
-
lines: [...lines, ...built.lines],
|
|
103
|
-
linesWithoutChannel: lines,
|
|
104
|
-
channelLines: built.lines,
|
|
105
|
-
channels: built.channels
|
|
106
|
-
}
|
|
107
|
-
}
|
|
1
|
+
/**
|
|
2
|
+
* 几个功能演示(Basic / Label / Style / Channel / Event / Perf)共用的一份小规模演示数据:
|
|
3
|
+
* 字段名与真实样例数据保持一致(节点 id / name / x / y / vn_kv / station_type / zone_name,
|
|
4
|
+
* 线路 id / name / from / to / vn_kv / max_loading_rate),换成真实数据时写法不用改。
|
|
5
|
+
*
|
|
6
|
+
* 数据量刻意压在几十个节点:每个演示只讲一件事,读数与事件日志一眼能对上;
|
|
7
|
+
* 想看十万级规模的性能表现去「性能与质量」演示(它自己放大数据)。
|
|
8
|
+
*/
|
|
9
|
+
import { createChannels } from '../../../src/index.js'
|
|
10
|
+
|
|
11
|
+
/** 与真实样例同一套电压等级与站点类型 */
|
|
12
|
+
export const VOLTAGE_LEVELS = [1050, 525, 230, 15.7]
|
|
13
|
+
export const STATION_TYPES = ['station', 'storage', 'coal', 'gas', 'solar', 'wind', 'nuclear', 'load']
|
|
14
|
+
/** 电压等级配色:规则 / 图例 / 标签三处共用一份,改这里到处一致 */
|
|
15
|
+
export const VOLTAGE_COLORS = {
|
|
16
|
+
1050: '#ff4fa3',
|
|
17
|
+
525: '#a06bff',
|
|
18
|
+
230: '#3fa7ff',
|
|
19
|
+
15.7: '#4fd1a5'
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
/** 固定种子的随机数:每次刷新布局一致,方便对着文档看效果 */
|
|
23
|
+
export const createRandom = (seed) => () => {
|
|
24
|
+
seed = (seed * 1664525 + 1013904223) % 4294967296
|
|
25
|
+
return seed / 4294967296
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
/** 演示数据落在这块范围里:fitView 一次全看到 */
|
|
29
|
+
export const DEMO_CENTER = [116.35, 39.0]
|
|
30
|
+
export const DEMO_RADIUS = 2.2
|
|
31
|
+
/**
|
|
32
|
+
* 演示节点:环上撒点(半径按序号轻微起伏,不是标准圆),
|
|
33
|
+
* 电压 / 类型 / 分区按序号取模,分布均匀 —— 按属性配色、按规则改样式一眼能看出效果。
|
|
34
|
+
*/
|
|
35
|
+
export const createDemoPoints = (count = 28, seed = 20240915) => {
|
|
36
|
+
const random = createRandom(seed)
|
|
37
|
+
const points = []
|
|
38
|
+
for (let index = 0; index < count; index += 1) {
|
|
39
|
+
const angle = (index / count) * Math.PI * 2
|
|
40
|
+
const radius = DEMO_RADIUS * (0.6 + ((index % 5) / 5) * 0.4)
|
|
41
|
+
points.push({
|
|
42
|
+
id: `node-${index}`,
|
|
43
|
+
x: Number((DEMO_CENTER[0] + Math.cos(angle) * radius).toFixed(5)),
|
|
44
|
+
y: Number((DEMO_CENTER[1] + Math.sin(angle) * radius).toFixed(5)),
|
|
45
|
+
name: `变电站 ${index + 1}`,
|
|
46
|
+
vn_kv: VOLTAGE_LEVELS[index % VOLTAGE_LEVELS.length],
|
|
47
|
+
station_type: STATION_TYPES[(index * 3) % STATION_TYPES.length],
|
|
48
|
+
zone_name: `分区 ${(index % 4) + 1}`,
|
|
49
|
+
max_loading_rate: Number((0.4 + random() * 1.1).toFixed(3))
|
|
50
|
+
})
|
|
51
|
+
}
|
|
52
|
+
return points
|
|
53
|
+
}
|
|
54
|
+
/**
|
|
55
|
+
* 演示线路:沿环把相邻节点连起来(每点两条,度数均匀),
|
|
56
|
+
* 再补几条「辐条」连到 0 号节点 —— 环 + 辐条比纯环更像一张网,框选 / 拾取都有东西可点。
|
|
57
|
+
* 每 7 条里有一条标成直流线路(type: 'dc_line'),给装饰 / 规则演示用。
|
|
58
|
+
*/
|
|
59
|
+
export const connectDemoLines = (points) => {
|
|
60
|
+
const lines = []
|
|
61
|
+
const push = (fromIndex, toIndex) => {
|
|
62
|
+
const from = points[fromIndex]
|
|
63
|
+
const to = points[toIndex]
|
|
64
|
+
lines.push({
|
|
65
|
+
id: `line-${lines.length}`,
|
|
66
|
+
name: `线路 ${lines.length + 1}`,
|
|
67
|
+
from: from.id,
|
|
68
|
+
to: to.id,
|
|
69
|
+
vn_kv: from.vn_kv,
|
|
70
|
+
max_loading_rate: Number(((from.max_loading_rate + to.max_loading_rate) / 2).toFixed(3)),
|
|
71
|
+
...(lines.length % 7 === 3 ? { type: 'dc_line' } : {})
|
|
72
|
+
})
|
|
73
|
+
}
|
|
74
|
+
points.forEach((point, index) => push(index, (index + 1) % points.length))
|
|
75
|
+
points.forEach((point, index) => {
|
|
76
|
+
if (index > 0 && index % 5 === 0) {
|
|
77
|
+
push(0, index)
|
|
78
|
+
}
|
|
79
|
+
})
|
|
80
|
+
return lines
|
|
81
|
+
}
|
|
82
|
+
/**
|
|
83
|
+
* 一次拿齐:节点 + 线路(含通道回线)+ 通道。
|
|
84
|
+
* `lines` 已经带上通道回线,直接交给 createGisView({ points, lines, channels }) 就行;
|
|
85
|
+
* 只想演示普通线路时用 `linesWithoutChannel`。
|
|
86
|
+
*/
|
|
87
|
+
export const buildDemoData = (options = {}) => {
|
|
88
|
+
const { count = 28, seed = 20240915, channels = 3 } = options
|
|
89
|
+
const points = createDemoPoints(count, seed)
|
|
90
|
+
const lines = connectDemoLines(points)
|
|
91
|
+
if (!channels) {
|
|
92
|
+
return { points, lines, linesWithoutChannel: lines, channelLines: [], channels: [] }
|
|
93
|
+
}
|
|
94
|
+
const specs = [
|
|
95
|
+
{ id: 'channel-a', name: '甲通道', from: points[0].id, to: points[7 % count].id, circuits: 3, lineProps: { vn_kv: 1050, max_loading_rate: 1.12 } },
|
|
96
|
+
{ id: 'channel-b', name: '乙通道', from: points[12 % count].id, to: points[19 % count].id, circuits: 2, lineProps: { vn_kv: 525, max_loading_rate: 0.72 } },
|
|
97
|
+
{ id: 'channel-c', name: '丙通道', from: points[3 % count].id, to: points[15 % count].id, circuits: 4, lineProps: { vn_kv: 230, max_loading_rate: 0.51 } }
|
|
98
|
+
].slice(0, channels)
|
|
99
|
+
const built = createChannels(specs)
|
|
100
|
+
return {
|
|
101
|
+
points,
|
|
102
|
+
lines: [...lines, ...built.lines],
|
|
103
|
+
linesWithoutChannel: lines,
|
|
104
|
+
channelLines: built.lines,
|
|
105
|
+
channels: built.channels
|
|
106
|
+
}
|
|
107
|
+
}
|