<template>
    <div class="dcs">
        <HeaderComponent :title="'流程选择'"></HeaderComponent>
        <div class="flow_select">
            <dv-button @click="$router.push('/flowSelect/m1')" border="Border5" color="#e18a3b">M1流程</dv-button>
            <dv-button @click="$router.push('/flowSelect/m2')" border="Border5" color="#e18a3b">M2流程</dv-button>
            <dv-button @click="$router.push('/flowSelect/paramSetting')" border="Border5" color="#e18a3b">参数设置</dv-button>
        </div>
    </div>
</template>

<script setup>
import { ref, onMounted, onUnmounted } from 'vue';
import { useRouter } from 'vue-router';
import { wsClient } from '@/utils/ws/websocket.js';
import { getEquipmentIndexList } from '@/api/dcs/flowControl';
import useEqStore from '@/store/modules/dcs';
import HeaderComponent from '@/components/DCS/HeaderComponent.vue';
const eqStore = useEqStore();
const router = useRouter()

onUnmounted(() => {
    // 组件销毁时关闭 WebSocket
    wsClient.close();
});
onMounted(() => {
    getEquipmentIndexList().then(res => {
        eqStore.setEqIndexArr(res.data);
    })
})


</script>

<style lang="scss" scoped>
#app {
    width: 1920px;
    height: 1080px;

    .dcs {
        position: relative;
        width: 100%;
        height: 100%;
        min-width: fit-content;
        min-height: max-content;
        // background-color: #141414;
        overflow: hidden;

        // 背景层
        &::before {
            content: '';
            position: absolute;
            inset: 0;
            background-image: url('@/assets/dcs/flowBg.jpeg'); // 替换为你的路径
            background-size: cover;
            background-position: center;
            background-repeat: no-repeat;
            filter: blur(2px); // 控制模糊程度
            z-index: 0;
        }

        .flow_select {
            display: flex;
            height: -webkit-fill-available;
            flex-direction: row;
            // align-items: center;
            margin-top: 100px;
            justify-content: center;
            gap: 50px;

            .dv-button-wrapper {
                width: 200px;
                height: 100px;

                :deep(.dv-button) {
                    width: 100%;
                    height: 100%;
                }

                :deep(.dv-button-text) {
                    font-size: 33px;
                }
            }
        }
    }
}
</style>