Files
FiDA_Front/src/views/home/test.vue

45 lines
1015 B
Vue
Raw Normal View History

2026-02-02 14:12:23 +08:00
<template>
<div class="test">
2026-02-26 11:45:32 +08:00
<button @click="openCanvas">打开画布</button>
2026-03-06 15:50:05 +08:00
<button @click="openDepthCanvas">打开深度画布</button>
2026-02-02 14:12:23 +08:00
</div>
</template>
<script setup lang="ts">
2026-02-26 11:45:32 +08:00
import myEvent from '@/utils/myEvent'
import { computed, onMounted } from 'vue'
2026-02-05 10:45:02 +08:00
import { useRoute } from 'vue-router'
const route = useRoute()
2026-03-25 11:27:24 +08:00
const url =
2026-03-27 16:07:13 +08:00
'https://minio-api.aida.com.hk/fida-public-bucket/furniture/sketches/e3082a38-55d2-4313-ad53-55aad715cf67.png'
2026-02-26 11:45:32 +08:00
const openCanvas = () => {
2026-03-06 15:50:05 +08:00
myEvent.emit('openFlowCanvas', { url })
}
const openDepthCanvas = () => {
2026-03-27 16:07:13 +08:00
myEvent.emit('openDepthCanvas', { url, canvasId: '' })
2026-02-26 11:45:32 +08:00
}
onMounted(() => {
2026-03-06 15:50:05 +08:00
if (route.query.depth) {
openDepthCanvas()
} else {
openCanvas()
}
2026-02-26 11:45:32 +08:00
})
2026-02-02 14:12:23 +08:00
</script>
<style lang="less" scoped>
.test {
2026-02-05 15:26:34 +08:00
margin: 2rem;
border-radius: 2rem;
2026-02-27 17:32:56 +08:00
background-color: rgb(255, 255, 255);
2026-02-02 14:12:23 +08:00
display: flex;
align-items: center;
justify-content: center;
2026-02-26 11:45:32 +08:00
flex-direction: column;
2026-03-06 15:50:05 +08:00
gap: 2rem;
> button {
2026-02-26 11:45:32 +08:00
font-size: 10rem;
}
2026-02-02 14:12:23 +08:00
}
</style>