<template>
<!--  <el-menu-->

<!--    :unique-opened="true"-->
<!--    text-color="#a7b1c2"-->
<!--    active-text-color="#36639E"-->
<!--    router-->
<!--    class="my-menu"-->


<!--  >-->
<!--    <template v-for="item in currentM" :key="item.name">-->
<!--      <el-sub-menu :class="response." class="calc(var(&#45;&#45;el-menu-level))" :index="item.name + ''"   v-if="(item.children.length > 0)">-->
<!--        <template #title>-->
<!--          <span class="layer-1-title" >{{item.name}}</span>-->
<!--        </template>-->
<!--        <el-menu-item @click="homeCountAdd"  v-for="child in item.children" :route="{name:child.path}" :index="child.path + ''" >-->
<!--          <div class="name-item">-->
<!--            {{child.name}}-->
<!--          </div>-->
<!--        </el-menu-item>-->


<!--        &lt;!&ndash;        <template v-else>&ndash;&gt;-->

<!--        &lt;!&ndash;          <el-sub-menu v-for="child in item.childList" :key="child.CODE">&ndash;&gt;-->
<!--        &lt;!&ndash;            <template #title>{{child.NAME}}</template>&ndash;&gt;-->
<!--        &lt;!&ndash;            <el-menu-item v-for="childchild in child.childList" :index="childchild.CODE" >{{childchild.NAME}}</el-menu-item>&ndash;&gt;-->
<!--        &lt;!&ndash;          </el-sub-menu>&ndash;&gt;-->
<!--        &lt;!&ndash;        </template>&ndash;&gt;-->

<!--      </el-sub-menu>-->
<!--      <el-menu-item @click="homeCountAdd" v-else class="one-menu" :route="{name:item.path}"  :index="item.path + ''" >-->
<!--        <div class="layer-1-title">-->
<!--          {{item.name}}-->
<!--        </div>-->
<!--      </el-menu-item>-->
<!--    </template>-->
<!--  </el-menu>-->
  <infinity-el-menu :menu-list="currentM"/>
</template>

<script>
import {computed, ref} from "vue";
import {useRootStore} from "@/stores/useStore";
import {otherReflectArr} from "@/data/all-reflect";
import {useRoute} from "vue-router";
import InfinityElMenu from "@/components/common/InfinityElMenu.vue";

export default {
  name: "OtherMenu",
  components: {InfinityElMenu},
  setup() {
    const route =useRoute()
    const store = useRootStore()
    const currentM = computed(() => {


      // return otherReflectArr.find(i => i.name === store.pageType).menus
      return store.leftMenuList.find(i => i.O_PATH === store.pageType)?.childList
    })
    function homeCountAdd() {
      store.toHomeCounter++
    }
    return {
      currentM,
      homeCountAdd,
      otherReflectArr
    }
  }
}
</script>

<style scoped lang="scss">

</style>
