<template>
	<div class="test">
		<button @click="openCanvas">打开画布</button>
		<button @click="openDepthCanvas">打开深度画布</button>
	</div>
</template>

<script setup lang="ts">
	import myEvent from '@/utils/myEvent'
	import { computed, onMounted } from 'vue'
	import { useRoute } from 'vue-router'
	const route = useRoute()
	const url = 'https://www.minio-api.aida.com.hk/fida-test/furniture/sketches/1a48ed3a-1faa-4fcd-bf07-765dba1702c5.png?X-Amz-Algorithm=AWS4-HMAC-SHA256&X-Amz-Credential=admin%2F20260320%2Fus-east-1%2Fs3%2Faws4_request&X-Amz-Date=20260320T020948Z&X-Amz-Expires=604800&X-Amz-SignedHeaders=host&X-Amz-Signature=7dc192bac887bce7b02c99d7037c08d9d684310f00add9b0e63b74b36ee63d37'
	const openCanvas = () => {
		myEvent.emit('openFlowCanvas', { url })
	}
	const openDepthCanvas = () => {
		myEvent.emit('openDepthCanvas', { url })
	}
	onMounted(() => {
		if (route.query.depth) {
			openDepthCanvas()
		} else {
			openCanvas()
		}
	})
</script>

<style lang="less" scoped>
	.test {
		margin: 2rem;
		border-radius: 2rem;
		background-color: rgb(255, 255, 255);
		display: flex;
		align-items: center;
		justify-content: center;
		flex-direction: column;
		gap: 2rem;
		> button {
			font-size: 10rem;
		}
	}
</style>
