|
64 | 64 | :key="ref.id"
|
65 | 65 | v-bind="ref"
|
66 | 66 | :container-ref="root"
|
| 67 | + @click:ref="dblclickHelper(onRefDblClick, $event, ref)" |
67 | 68 | @click.passive="dblclickHelper(onRefDblClick, $event, ref)"
|
68 | 69 | @mouseenter.passive="onRefMouseEnter"
|
69 | 70 | @mouseleave.passive="onRefMouseLeave"
|
| 71 | + |
70 | 72 | />
|
71 | 73 | </g>
|
72 | 74 | <g id="tables-layer"
|
|
90 | 92 | <g id="panel-overlays-layer"
|
91 | 93 | v-if="store.loaded">
|
92 | 94 | <v-db-panel
|
93 |
| - @click:color="onColorClick" @touchend.passive="onColorClick"/> |
| 95 | + @click:color="onColorClick" |
| 96 | + @touchend.passive="onColorClick"/> |
| 97 | + |
| 98 | + </g> |
| 99 | + <g id="panel-ref-overlays-layer" |
| 100 | + v-if="store.loaded"> |
| 101 | + <v-db-ref-panel |
| 102 | + @click:cp="onCpClick" |
| 103 | + @touchend.passive="onCpClick"/> |
94 | 104 | </g>
|
95 | 105 |
|
96 | 106 | </g>
|
|
132 | 142 | import { computed, nextTick, onMounted, reactive, ref, watch, watchEffect } from 'vue'
|
133 | 143 | import VDbTable from './VDbTable'
|
134 | 144 | import VDbRef from './VDbRef'
|
135 |
| - import svgPanZoom from 'svg-pan-zoom' |
| 145 | + import svgPanZoom, { pan } from 'svg-pan-zoom' |
136 | 146 | import { useChartStore } from '../../store/chart'
|
137 | 147 | import VDbTooltip from './VDbTooltip'
|
138 | 148 | import VDbPanel from './VDbPanel.vue'
|
| 149 | + import VDbRefPanel from './VDbRefPanel.vue' |
139 | 150 | import VDbTableGroup from './VDbTableGroup'
|
140 | 151 |
|
141 | 152 | const store = useChartStore()
|
|
339 | 350 | panZoom.value.zoom(newZoom)
|
340 | 351 | })
|
341 | 352 |
|
| 353 | + |
| 354 | + |
| 355 | +
|
342 | 356 | function onRefDblClick (e, ref) {
|
343 | 357 | console.log("onRefDblClick", e, ref);
|
344 | 358 | emit('dblclick:ref', e, ref);
|
345 | 359 | }
|
346 | 360 |
|
| 361 | + function onCpClick (e,operation,points,wpid,refid) { |
| 362 | +
|
| 363 | + let rl = store.getRef(refid); |
| 364 | + if (operation == 'RESET'){ |
| 365 | + rl.vertices = []; |
| 366 | + } |
| 367 | + if (operation == 'ADD'){ |
| 368 | + rl.vertices.splice(rl.vertices.length-1,0,{x:points.x, y:points.y}); |
| 369 | + //rl.vertices.push({x:points.x, y:points.y}); |
| 370 | + } |
| 371 | + if (operation == 'DEL'){ |
| 372 | + if (rl.vertices.length > 2){ |
| 373 | + rl.vertices.splice(Number(wpid),1); |
| 374 | + } |
| 375 | + |
| 376 | + } |
| 377 | + store.updateRef(refid,rl) |
| 378 | + store.hideRefPanel(); |
| 379 | + } |
| 380 | +
|
347 | 381 | function onColorClick (e, id,name, color) {
|
348 | 382 |
|
349 | 383 | store.updateTableColor(name,id,color);
|
|
0 commit comments