解决 name search 下一个不按照视图顺序来的 bug | 解决连续框选重复的 bug
This commit is contained in:
parent
0f8859c922
commit
de7600a578
@ -31,7 +31,6 @@
|
||||
import { computed, defineComponent } from 'vue';
|
||||
import { contextmenu } from './handle-contextmenu';
|
||||
import { currentGroups } from './manage-group';
|
||||
import { globalLookup } from '@/hook/global';
|
||||
import { useI18n } from 'vue-i18n';
|
||||
import { joinGroup } from './exist-group';
|
||||
|
||||
@ -65,6 +64,7 @@ function getItemName(view) {
|
||||
|
||||
function onClick(group) {
|
||||
joinGroup(group);
|
||||
contextmenu.show = false;
|
||||
}
|
||||
|
||||
</script>
|
||||
|
@ -5,7 +5,7 @@ import { WaveContainerView } from "@/hook/wave-container-view";
|
||||
import { sidebarSelectedWires } from "@/hook/sidebar-select-wire";
|
||||
|
||||
/**
|
||||
* @namespace contextmenu
|
||||
* @description 控制左侧 sidebar 右击菜单栏
|
||||
*/
|
||||
export const contextmenu = reactive({
|
||||
show: false,
|
||||
|
@ -53,6 +53,7 @@ import { computed, defineComponent, reactive, ref } from 'vue';
|
||||
import { useI18n } from 'vue-i18n';
|
||||
import { onClickNext, onClickPrev, searchMode, toolbarValueSearch, valueSearchText } from './value-search';
|
||||
import { sidebarSelectedWires } from '@/hook/sidebar-select-wire';
|
||||
import { genOrderedLinks } from '@/hook/wave-container-view';
|
||||
|
||||
|
||||
defineComponent({ name: 'value-search' })
|
||||
@ -108,11 +109,14 @@ function searchByName() {
|
||||
toolbarValueSearch.searchResult.length = 0;
|
||||
toolbarValueSearch.resultLinkSet.clear();
|
||||
const name = toolbarValueSearch.content.trim();
|
||||
for (const wireItem of globalLookup.currentWires) {
|
||||
if (wireItem.name.includes(name)) {
|
||||
addWire(wireItem);
|
||||
|
||||
for (const wireLink of genOrderedLinks({ returnGroup: false })) {
|
||||
const signal = globalLookup.link2CurrentWires.get(wireLink);
|
||||
if (signal && signal.name.includes(name)) {
|
||||
addWire(signal);
|
||||
}
|
||||
}
|
||||
|
||||
if (toolbarValueSearch.searchResult.length > 0) {
|
||||
toolbarValueSearch.cursorIndex = 0;
|
||||
const { link } = toolbarValueSearch.searchResult[0];
|
||||
|
@ -21,6 +21,9 @@ export const WaveContainerView = {
|
||||
* @param {WireItem} signal
|
||||
*/
|
||||
add(signal) {
|
||||
if (globalLookup.currentWires.has(signal)) {
|
||||
return;
|
||||
}
|
||||
// 增加高效 CRUD 视图
|
||||
globalLookup.currentWires.add(signal);
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user