<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-user/2/d8512e53-f016-4ad6-8245-2f304d89e7b2.png?X-Amz-Algorithm=AWS4-HMAC-SHA256&X-Amz-Credential=admin%2F20260331%2Fus-east-1%2Fs3%2Faws4_request&X-Amz-Date=20260331T032733Z&X-Amz-Expires=604800&X-Amz-SignedHeaders=host&X-Amz-Signature=25e5ec227a0ca22942e71eff3a4f07a23f8812ff3db5522e1466b3a77288be70'
	const openCanvas = () => {
		myEvent.emit('openFlowCanvas', {
			url,
			imgId: '69bcaae11e0cee430b750050',
			nodeId: '69cde574a510db41350b404c'
		})
	}
	const openDepthCanvas = () => {
		myEvent.emit('openDepthCanvas', {
			url,
			canvasId: '69cb3f244a1dd46c0bdbb432',
			sketchId: '69c63417cb064e32ff6826a3'
		})
	}
	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>
