Skip to content

Commit

Permalink
index ok
Browse files Browse the repository at this point in the history
  • Loading branch information
testuser01 committed Dec 17, 2024
1 parent acc1a90 commit 050a881
Showing 1 changed file with 21 additions and 17 deletions.
38 changes: 21 additions & 17 deletions src/views/home.vue
Original file line number Diff line number Diff line change
Expand Up @@ -34,26 +34,26 @@
v-model:activeKey="activeKey"
>
<a-collapse-panel
:header="`任务${index + 1} X: ${startX[index] + endX[index] / 2} Y: ${
y[index]
}`"
:header="`任务${index} X: ${
startX[index - 1] + endX[index - 1] / 2
} Y: ${y[index - 1]}`"
v-for="(index, item) in startX.length"
:key="index"
>
<a-space direction="vertical">
<a-input-number
size="small"
v-model:value="startX[index]"
v-model:value="startX[index - 1]"
addon-before="起始X"
/>
<a-input-number
size="small"
v-model:value="endX[index]"
v-model:value="endX[index - 1]"
addon-before="终止X"
/>
<a-input-number
size="small"
v-model:value="y[index]"
v-model:value="y[index - 1]"
addon-before="高度 Y"
/>
</a-space>
Expand All @@ -63,7 +63,7 @@
<a-button
size="small"
:icon="h(CloseOutlined)"
@click="deleteTask(index)"
@click="deleteTask(index - 1)"
></a-button>
</a-space>
</template>
Expand All @@ -80,16 +80,20 @@
import { invoke } from "@tauri-apps/api/core";
import { listen } from "@tauri-apps/api/event";
import { useStorage } from "@vueuse/core";
import { ref, h, onMounted } from "vue";
import { ref, h, onMounted, onBeforeMount, onUnmounted } from "vue";
import {
PlayCircleOutlined,
PauseCircleOutlined,
CloseOutlined,
} from "@ant-design/icons-vue";
import { register } from "@tauri-apps/plugin-global-shortcut";
import {
register,
unregister,
unregisterAll,
} from "@tauri-apps/plugin-global-shortcut";
import { getCurrentWindow } from "@tauri-apps/api/window";
const activeKey = ref("0");
const activeKey = ref("1");
const startX = useStorage<number[]>("startX", [0]);
const endX = useStorage<number[]>("endX", [0]);
const y = useStorage<number[]>("y", [0]);
Expand Down Expand Up @@ -137,19 +141,19 @@ function handleStop() {
//invoke("stop_scan");
console.log("stop");
}
let unregisterAltQ:any;
let unregisterAltZ:any;
onMounted(async () => {
await register("Alt+Q", (event) => {
unregisterAltQ = await register("Alt+Q", (event) => {
if (event.state === "Pressed") {
handleStop();
getCurrentWindow().hide();
handleStop();
getCurrentWindow().hide();
}
});
await register("Alt+Z", (event) => {
unregisterAltZ = await register("Alt+Z", (event) => {
if (event.state === "Pressed") {
handleScanLoop();
//handleScanLoop();
getCurrentWindow().show();
}
});
Expand Down

0 comments on commit 050a881

Please sign in to comment.