<template>
  <Step @handClick="handleClick"></Step>
</template>

<script setup lang="ts">
  import { ref } from 'vue';

  import Step from '../components/viewSelct.vue';
  import { useRouter } from 'vue-router';

  let router = useRouter();
  const param = ref<any>(router.currentRoute.value.query);

  function handleClick(v, data) {
    if (v == 'S2') {
      router.push(
        `/directory/mlzk/view?wrdkid=${param.value.wrdkid}&scjdbm=S2&jdnzt=${data.value.S2.baseDetails[0].tbjdbm}&dksdzt=${param.value.dksdzt}`
      );
    } else if (v == 'S3') {
      router.push(
        `/directory/mlzk/view?wrdkid=${param.value.wrdkid}&scjdbm=S3&jdnzt=${data.value.S3.baseDetails.tbjdbm}&dksdzt=${param.value.dksdzt}`
      );
    } else if (v == 'S6') {
      router.push(
        `/directory/mlzk/faList?wrdkid=${param.value.wrdkid}&scjdbm=S6&jdnzt=SHORBPS&dksdzt=${param.value.dksdzt}`
      );
    } else {
      if (data.value.S4) {
        router.push(
          `/directory/mlzk/faList?wrdkid=${param.value.wrdkid}&scjdbm=S4&jdnzt=SHORBPS&dksdzt=${param.value.dksdzt}`
        );
      } else if (data.value.S5) {
        console.log('S5');
        router.push(
          `/directory/mlzk/faList?wrdkid=${param.value.wrdkid}&scjdbm=S5&jdnzt=SHORBPS&dksdzt=${param.value.dksdzt}`
        );
      } else if (data.value.S10) {
        router.push(
          `/directory/mlzk/faList?wrdkid=${param.value.wrdkid}&scjdbm=S10&jdnzt=SHORBPS&dksdzt=${param.value.dksdzt}`
        );
      }
    }
  }
</script>

<style lang="less" scoped>
  :deep(.steps) {
    box-shadow: 0 2px 7px 0 #bfc1c4;
  }

  :deep(.ant-steps) {
    width: 95%;
    margin: 0 auto;
  }

  :deep(.border) {
    border: 1px solid #e6e6e6;
    padding-left: 0 !important;
  }

  :deep(.border-bt) {
    border-bottom: 0 !important;
  }

  :deep(.boder-br) {
    border-right: 0;
  }
</style>
