fix: 修改独立窗口样式
This commit is contained in:
49
src/views/paper/question/independent/ps.vue
Normal file
49
src/views/paper/question/independent/ps.vue
Normal file
@@ -0,0 +1,49 @@
|
||||
<template>
|
||||
<div class="independent-window">
|
||||
<PsForm ref="formRef" :isIndependent="true" />
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script lang="ts" setup>
|
||||
import { ref, onMounted } from 'vue'
|
||||
import { listen } from '@tauri-apps/api/event'
|
||||
import { getCurrentWindow } from '@tauri-apps/api/window'
|
||||
import PsForm from '@/views/paper/question/PsForm.vue'
|
||||
|
||||
defineOptions({ name: 'PsIndependent' })
|
||||
|
||||
const formRef = ref()
|
||||
|
||||
onMounted(async () => {
|
||||
console.log('PsIndependent mounted, sending ready signal...')
|
||||
|
||||
// 发送窗口准备就绪信号
|
||||
try {
|
||||
const { emit } = await import('@tauri-apps/api/event')
|
||||
await emit('ps-window-ready', { timestamp: Date.now() })
|
||||
console.log('Sent ps-window-ready event')
|
||||
} catch (error) {
|
||||
console.error('Failed to send ready signal:', error)
|
||||
}
|
||||
|
||||
// 监听表单提交成功事件,关闭窗口
|
||||
await listen('ps-form-success', async () => {
|
||||
const appWindow = getCurrentWindow()
|
||||
await appWindow.close()
|
||||
})
|
||||
|
||||
// 监听表单取消事件,关闭窗口
|
||||
await listen('ps-form-cancel', async () => {
|
||||
const appWindow = getCurrentWindow()
|
||||
await appWindow.close()
|
||||
})
|
||||
})
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
.independent-window {
|
||||
width: 100vw;
|
||||
height: 100vh;
|
||||
overflow: hidden;
|
||||
}
|
||||
</style>
|
||||
Reference in New Issue
Block a user