增加删除所有选择信号的功能
This commit is contained in:
parent
1ce4338248
commit
92c5c2b486
@ -63,22 +63,20 @@ function onMousemove(event) {
|
|||||||
MovingPivot.label = formatTime(currentT, timescale);
|
MovingPivot.label = formatTime(currentT, timescale);
|
||||||
MovingPivot.left = time2cursorX(currentT);
|
MovingPivot.left = time2cursorX(currentT);
|
||||||
|
|
||||||
const pivot = UserPivots.get(currentT);
|
// const pivot = UserPivots.get(currentT);
|
||||||
if (pivot !== undefined) {
|
// if (pivot !== undefined) {
|
||||||
MovingPivot.show = false;
|
// MovingPivot.show = false;
|
||||||
MovingPivot.currentTakenPivot = pivot;
|
// MovingPivot.currentTakenPivot = pivot;
|
||||||
return;
|
// return;
|
||||||
}
|
// }
|
||||||
|
|
||||||
|
|
||||||
if (MovingPivot.currentTakenPivot !== undefined) {
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
// 通过计算距离最近的用户信标,来决定是否要消失,给与用户信标空间来执行额外操作
|
// 通过计算距离最近的用户信标,来决定是否要消失,给与用户信标空间来执行额外操作
|
||||||
const userPivot = getNearestUserPivot(currentT);
|
const userPivot = getNearestUserPivot(currentT);
|
||||||
|
|
||||||
if (userPivot) {
|
if (userPivot) {
|
||||||
const marginX = Math.abs(x - userPivot.x);
|
const marginX = Math.abs(x - userPivot.x);
|
||||||
if (marginX < 25) {
|
if (marginX < 12) {
|
||||||
// 此时距离用户信标比较近,隐藏主信标
|
// 此时距离用户信标比较近,隐藏主信标
|
||||||
MovingPivot.show = false;
|
MovingPivot.show = false;
|
||||||
MovingPivot.currentTakenPivot = userPivot;
|
MovingPivot.currentTakenPivot = userPivot;
|
||||||
|
@ -39,7 +39,6 @@ const containerStyle = computed(() => ({
|
|||||||
|
|
||||||
const itemStyle = computed(() => ({
|
const itemStyle = computed(() => ({
|
||||||
left: getPivot().left - boxShift + 'px',
|
left: getPivot().left - boxShift + 'px',
|
||||||
|
|
||||||
}));
|
}));
|
||||||
|
|
||||||
function getPivot() {
|
function getPivot() {
|
||||||
|
@ -2,6 +2,7 @@ import { globalLookup } from "@/hook/global";
|
|||||||
import { computed, nextTick, reactive } from "vue";
|
import { computed, nextTick, reactive } from "vue";
|
||||||
import { updateColorPickerManage } from "./color-picker";
|
import { updateColorPickerManage } from "./color-picker";
|
||||||
import { WaveContainerView } from "@/hook/wave-container-view";
|
import { WaveContainerView } from "@/hook/wave-container-view";
|
||||||
|
import { sidebarSelectedWires } from "@/hook/sidebar-select-wire";
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @namespace contextmenu
|
* @namespace contextmenu
|
||||||
@ -249,6 +250,21 @@ export function deleteSignalByView() {
|
|||||||
const signal = contextmenu.currentWire;
|
const signal = contextmenu.currentWire;
|
||||||
if (signal) {
|
if (signal) {
|
||||||
WaveContainerView.delete(signal);
|
WaveContainerView.delete(signal);
|
||||||
|
sidebarSelectedWires.delete(signal.link);
|
||||||
|
}
|
||||||
|
|
||||||
|
contextmenu.show = false;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
export function deleteAllSelectedSignals() {
|
||||||
|
|
||||||
|
for (const link of globalLookup.sidebarSelectedWireLinks) {
|
||||||
|
const signal = globalLookup.link2CurrentWires.get(link);
|
||||||
|
if (signal) {
|
||||||
|
WaveContainerView.delete(signal);
|
||||||
|
sidebarSelectedWires.delete(link);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
contextmenu.show = false;
|
contextmenu.show = false;
|
||||||
|
@ -8,6 +8,13 @@
|
|||||||
<span class="menu-item-icon iconfont icon-delete"></span>
|
<span class="menu-item-icon iconfont icon-delete"></span>
|
||||||
<span class="menu-item-name">{{ t('context-menu.delete') }}</span>
|
<span class="menu-item-name">{{ t('context-menu.delete') }}</span>
|
||||||
</div>
|
</div>
|
||||||
|
<div
|
||||||
|
class="menu-item-container"
|
||||||
|
@click="deleteAllSelectedSignals()"
|
||||||
|
>
|
||||||
|
<span class="menu-item-icon iconfont icon-delete"></span>
|
||||||
|
<span class="menu-item-name">{{ t('context-menu.delete-all-select') }}</span>
|
||||||
|
</div>
|
||||||
<div
|
<div
|
||||||
class="menu-item-container"
|
class="menu-item-container"
|
||||||
@click="createGroup()"
|
@click="createGroup()"
|
||||||
@ -74,7 +81,7 @@ import { defineComponent, reactive, ref } from 'vue';
|
|||||||
|
|
||||||
import { globalLookup } from '@/hook/global';
|
import { globalLookup } from '@/hook/global';
|
||||||
import { useI18n } from 'vue-i18n';
|
import { useI18n } from 'vue-i18n';
|
||||||
import { colorPicker, contextmenu, deleteSignalByView } from './handle-contextmenu';
|
import { colorPicker, contextmenu, deleteAllSelectedSignals, deleteSignalByView } from './handle-contextmenu';
|
||||||
import { makeIconClass } from '@/hook/utils';
|
import { makeIconClass } from '@/hook/utils';
|
||||||
import ColorPicker from './color-picker.vue';
|
import ColorPicker from './color-picker.vue';
|
||||||
import ExistGroup from './exist-group.vue';
|
import ExistGroup from './exist-group.vue';
|
||||||
|
@ -58,6 +58,7 @@
|
|||||||
"context-menu.join-group": "join created group",
|
"context-menu.join-group": "join created group",
|
||||||
"context-menu.change-color": "change color",
|
"context-menu.change-color": "change color",
|
||||||
"context-menu.delete": "delete signal",
|
"context-menu.delete": "delete signal",
|
||||||
|
"context-menu.delete-all-select": "delete all the selected signals",
|
||||||
|
|
||||||
"context-menu.signal.name": "signal name",
|
"context-menu.signal.name": "signal name",
|
||||||
"context-menu.signal.type": "signal type",
|
"context-menu.signal.type": "signal type",
|
||||||
|
@ -56,6 +56,7 @@
|
|||||||
"context-menu.join-group": "加入已有分组",
|
"context-menu.join-group": "加入已有分组",
|
||||||
"context-menu.change-color": "修改颜色",
|
"context-menu.change-color": "修改颜色",
|
||||||
"context-menu.delete": "删除信号",
|
"context-menu.delete": "删除信号",
|
||||||
|
"context-menu.delete-all-select": "删除所有选中信号",
|
||||||
|
|
||||||
"context-menu.signal.name": "信号名称",
|
"context-menu.signal.name": "信号名称",
|
||||||
"context-menu.signal.type": "信号类型",
|
"context-menu.signal.type": "信号类型",
|
||||||
|
Loading…
x
Reference in New Issue
Block a user