修复开窗坐标错误的BUG
This commit is contained in:
parent
e422439a2e
commit
8464933057
|
@ -35,14 +35,24 @@ export default class ClientConnection {
|
||||||
return this._is_login;
|
return this._is_login;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private _destoryWS() {
|
||||||
|
this._destoryed = true;
|
||||||
|
if (this.ws) {
|
||||||
|
this.ws.onclose = null;
|
||||||
|
this.ws.onerror = null;
|
||||||
|
this.ws.onopen = null;
|
||||||
|
this.ws.onmessage = null;
|
||||||
|
}
|
||||||
|
this.ws?.close();
|
||||||
|
this.ws = null;
|
||||||
|
}
|
||||||
public reconnectTo(
|
public reconnectTo(
|
||||||
url: string,
|
url: string,
|
||||||
user_name?: string | null,
|
user_name?: string | null,
|
||||||
password?: string | null
|
password?: string | null
|
||||||
) {
|
) {
|
||||||
if (this._destoryed) {
|
if (this._destoryed) {
|
||||||
this.ws?.close();
|
this._destoryWS();
|
||||||
this.ws = null;
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
this.url = url;
|
this.url = url;
|
||||||
|
@ -76,8 +86,7 @@ export default class ClientConnection {
|
||||||
|
|
||||||
login() {
|
login() {
|
||||||
if (this._destoryed) {
|
if (this._destoryed) {
|
||||||
this.ws?.close();
|
this._destoryWS();
|
||||||
this.ws = null;
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
if (this.is_connected) {
|
if (this.is_connected) {
|
||||||
|
@ -102,8 +111,7 @@ export default class ClientConnection {
|
||||||
|
|
||||||
private _reconnect() {
|
private _reconnect() {
|
||||||
if (this._destoryed) {
|
if (this._destoryed) {
|
||||||
this.ws?.close();
|
this._destoryWS();
|
||||||
this.ws = null;
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
if (
|
if (
|
||||||
|
@ -123,8 +131,7 @@ export default class ClientConnection {
|
||||||
|
|
||||||
onOpen(ev: Event) {
|
onOpen(ev: Event) {
|
||||||
if (this._destoryed) {
|
if (this._destoryed) {
|
||||||
this.ws?.close();
|
this._destoryWS();
|
||||||
this.ws = null;
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -134,8 +141,7 @@ export default class ClientConnection {
|
||||||
|
|
||||||
onMessage(ev: MessageEvent) {
|
onMessage(ev: MessageEvent) {
|
||||||
if (this._destoryed) {
|
if (this._destoryed) {
|
||||||
this.ws?.close();
|
this._destoryWS();
|
||||||
this.ws = null;
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
try {
|
try {
|
||||||
|
|
|
@ -122,7 +122,7 @@
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script lang="ts">
|
<script lang="ts">
|
||||||
import { defineComponent, computed } from "vue";
|
import { defineComponent, computed, onMounted, ref, nextTick } from "vue";
|
||||||
import { useStore } from "src/store";
|
import { useStore } from "src/store";
|
||||||
import { SignalSourceTreeItemEntity } from "src/entities/SignalSourceEntity";
|
import { SignalSourceTreeItemEntity } from "src/entities/SignalSourceEntity";
|
||||||
import GroupDialog from "src/components/GroupDialog.vue";
|
import GroupDialog from "src/components/GroupDialog.vue";
|
||||||
|
@ -147,7 +147,18 @@ export default defineComponent({
|
||||||
set: (val) => $store.commit("setSignalSourceTree", val),
|
set: (val) => $store.commit("setSignalSourceTree", val),
|
||||||
});
|
});
|
||||||
|
|
||||||
|
const tree: any | null = ref(null);
|
||||||
|
|
||||||
|
onMounted(async () => {
|
||||||
|
while (!tree.value.nodes.length) {
|
||||||
|
await Common.waitFor(100);
|
||||||
|
}
|
||||||
|
tree.value?.setExpanded("", true);
|
||||||
|
});
|
||||||
|
|
||||||
return {
|
return {
|
||||||
|
est() {},
|
||||||
|
tree,
|
||||||
tree_nodes,
|
tree_nodes,
|
||||||
loga(a: any) {
|
loga(a: any) {
|
||||||
console.log(a);
|
console.log(a);
|
||||||
|
|
|
@ -403,17 +403,17 @@ export default defineComponent({
|
||||||
let signal_source = signal_sources[0];
|
let signal_source = signal_sources[0];
|
||||||
if (signal_source) {
|
if (signal_source) {
|
||||||
let dom: HTMLElement | null = e.target as HTMLElement;
|
let dom: HTMLElement | null = e.target as HTMLElement;
|
||||||
if (dom) {
|
if (wall.value && dom) {
|
||||||
if (dom.classList.contains("wall_item_flag")) {
|
if (dom.classList.contains("wall_item_flag")) {
|
||||||
|
console.log(wall.value.offsetTop);
|
||||||
|
console.log(wall.value.offsetLeft);
|
||||||
GlobalData.getInstance()
|
GlobalData.getInstance()
|
||||||
.getCurrentClient()
|
.getCurrentClient()
|
||||||
?.openWindow(
|
?.openWindow(
|
||||||
new Protocol.OpenWindowRequestEntity(
|
new Protocol.OpenWindowRequestEntity(
|
||||||
signal_source.uuid,
|
signal_source.uuid,
|
||||||
(dom.offsetLeft - (wall.value?.offsetLeft ?? 0)) *
|
dom.offsetLeft * wall_width_scaler.value,
|
||||||
wall_width_scaler.value,
|
dom.offsetTop * wall_height_scaler.value,
|
||||||
(dom.offsetTop - (wall.value?.offsetTop ?? 0)) *
|
|
||||||
wall_height_scaler.value,
|
|
||||||
dom.offsetWidth * wall_width_scaler.value,
|
dom.offsetWidth * wall_width_scaler.value,
|
||||||
dom.offsetHeight * wall_height_scaler.value
|
dom.offsetHeight * wall_height_scaler.value
|
||||||
)
|
)
|
||||||
|
|
|
@ -235,7 +235,6 @@ export default store(function (/* { ssrContext } */) {
|
||||||
state.signal_source_tree.push(root);
|
state.signal_source_tree.push(root);
|
||||||
|
|
||||||
buildGroup(root, signal_source_groups, signal_sources);
|
buildGroup(root, signal_source_groups, signal_sources);
|
||||||
console.log(state.signal_source_tree);
|
|
||||||
} else {
|
} else {
|
||||||
console.error(playload);
|
console.error(playload);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue