<template>
  <aside :class="['aui-sidebar', `aui-sidebar--${$store.state.sidebarLayoutSkin}`]">
    <div class="aui-sidebar__inner">
      <el-menu
        :default-active="$store.state.sidebarMenuActiveName"
        :collapse="$store.state.sidebarFold"
        :unique-opened="true"
        :collapseTransition="false"
        class="aui-sidebar__menu"
      >
        <el-submenu index="basic">
          <template slot="title">
            <svg class="icon-svg aui-sidebar__menu-icon"><use xlink:href="#icon-bianji"></use></svg>
            <span>基础信息</span>
          </template>
          <el-submenu index="product">
            <template slot="title">
              <svg class="icon-svg aui-sidebar__menu-icon">
                <use xlink:href="#icon-config"></use>
              </svg>
              <span>产品管理</span>
            </template>
            <el-menu-item index="productType" @click="$router.push({ name: 'productType' })">
              <!-- <svg class="icon-svg aui-sidebar__menu-icon">
                <use xlink:href="#icon-zonghe"></use>
              </svg> -->
              <svg class="icon-svg aui-sidebar__menu-icon-son" aria-hidden="true">
                <use xlink:href="#椭圆形"></use>
              </svg>
              <span slot="title">产品类型</span>
            </el-menu-item>
            <el-menu-item index="productList" @click="$router.push({ name: 'productList' })">
              <svg class="icon-svg aui-sidebar__menu-icon-son" aria-hidden="true">
                <use xlink:href="#椭圆形"></use>
              </svg>
              <!-- <svg class="icon-svg aui-sidebar__menu-icon"><use xlink:href="#icon-log"></use></svg> -->
              <span slot="title">产品列表</span>
            </el-menu-item>
          </el-submenu>
          <el-menu-item index="factoryManage" @click="$router.push({ name: 'factoryManage' })">
            <svg class="icon-svg aui-sidebar__menu-icon-son" aria-hidden="true">
              <use xlink:href="#椭圆形"></use>
            </svg>
            <!-- <svg class="icon-svg aui-sidebar__menu-icon"><use xlink:href="#icon-config"></use></svg> -->
            <span slot="title">工厂管理</span>
          </el-menu-item>
          <el-submenu index="process">
            <template slot="title">
              <svg class="icon-svg aui-sidebar__menu-icon">
                <use xlink:href="#组织管理"></use>
              </svg>
              <span>过程管理</span>
            </template>
            <el-menu-item index="processType" @click="$router.push({ name: 'processType' })">
              <!-- <svg class="icon-svg aui-sidebar__menu-icon">
                <use xlink:href="#icon-zonghe"></use>
              </svg> -->
              <svg class="icon-svg aui-sidebar__menu-icon-son" aria-hidden="true">
                <use xlink:href="#椭圆形"></use>
              </svg>
              <span slot="title">工序类型</span>
            </el-menu-item>
            <el-menu-item index="processDefine" @click="$router.push({ name: 'processDefine' })">
              <!-- <svg class="icon-svg aui-sidebar__menu-icon">
                <use xlink:href="#icon-zonghe"></use>
              </svg> -->
              <svg class="icon-svg aui-sidebar__menu-icon-son" aria-hidden="true">
                <use xlink:href="#椭圆形"></use>
              </svg>
              <span slot="title">工序定义</span>
            </el-menu-item>
            <!-- <el-menu-item index="processFlow" @click="$router.push({ name: 'processFlow' })">
            <svg class="icon-svg aui-sidebar__menu-icon"><use xlink:href="#icon-zonghe"></use></svg>
              <span slot="title">工艺流程</span>
            </el-menu-item> -->
          </el-submenu>
          <el-submenu index="Machine">
            <template slot="title">
              <svg class="icon-svg aui-sidebar__menu-icon">
                <use xlink:href="#icon-zonghe"></use>
              </svg>
              <span>机台管理</span>
            </template>
            <el-menu-item index="siteManage" @click="$router.push({ name: 'siteManage' })">
              <!-- <svg class="icon-svg aui-sidebar__menu-icon">
                <use xlink:href="#icon-zonghe"></use>
              </svg> -->
              <svg class="icon-svg aui-sidebar__menu-icon-son" aria-hidden="true">
                <use xlink:href="#椭圆形"></use>
              </svg>
              <span slot="title">站点管理</span>
            </el-menu-item>
            <el-menu-item index="machineManage" @click="$router.push({ name: 'machineManage' })">
              <!-- <svg class="icon-svg aui-sidebar__menu-icon">
                <use xlink:href="#icon-zonghe"></use>
              </svg> -->
              <svg class="icon-svg aui-sidebar__menu-icon-son" aria-hidden="true">
                <use xlink:href="#椭圆形"></use>
              </svg>
              <span slot="title">机台管理</span>
            </el-menu-item>
          </el-submenu>
          <el-menu-item index="toolsType" @click="$router.push({ name: 'toolsType' })">
            <svg class="icon-svg aui-sidebar__menu-icon-son" aria-hidden="true">
              <use xlink:href="#椭圆形"></use>
            </svg>
            <!-- <svg class="icon-svg aui-sidebar__menu-icon"><use xlink:href="#icon-zonghe"></use></svg> -->
            <span slot="title">量具管理</span>
          </el-menu-item>
          <el-menu-item index="unitList" @click="$router.push({ name: 'unitList' })">
            <svg class="icon-svg aui-sidebar__menu-icon-son" aria-hidden="true">
              <use xlink:href="#椭圆形"></use>
            </svg>
            <!-- <svg class="icon-svg aui-sidebar__menu-icon"><use xlink:href="#icon-log"></use></svg> -->
            <span slot="title">计量单位管理</span>
          </el-menu-item>
        </el-submenu>
        <el-submenu index="quality">
          <template slot="title">
            <svg class="icon-svg aui-sidebar__menu-icon">
              <use xlink:href="#08质量"></use>
            </svg>
            <span>质量规划</span>
          </template>
          <el-menu-item index="controlGraph" @click="$router.push({ name: 'controlGraph' })">
            <svg class="icon-svg aui-sidebar__menu-icon-son" aria-hidden="true">
              <use xlink:href="#椭圆形"></use>
            </svg>
            <!-- <svg class="icon-svg aui-sidebar__menu-icon"><use xlink:href="#控制中心"></use></svg> -->
            <span slot="title">控制图形</span>
          </el-menu-item>
          <el-menu-item index="controlRatio" @click="$router.push({ name: 'controlRatio' })">
            <svg class="icon-svg aui-sidebar__menu-icon-son" aria-hidden="true">
              <use xlink:href="#椭圆形"></use>
            </svg>
            <!-- <svg class="icon-svg aui-sidebar__menu-icon"><use xlink:href="#控制中心"></use></svg> -->
            <span slot="title">控制系数</span>
          </el-menu-item>
          <el-menu-item
            index="interpretationScheme"
            @click="$router.push({ name: 'interpretationScheme' })"
          >
            <svg class="icon-svg aui-sidebar__menu-icon-son" aria-hidden="true">
              <use xlink:href="#椭圆形"></use>
            </svg>
            <!-- <svg class="icon-svg aui-sidebar__menu-icon"><use xlink:href="#方案管理"></use></svg> -->
            <span slot="title">判读方案</span>
          </el-menu-item>
        </el-submenu>
        <el-submenu index="inspection">
          <template slot="title">
            <svg class="icon-svg aui-sidebar__menu-icon">
              <use xlink:href="#icon-shoucang"></use>
            </svg>
            <span>过程检验</span>
          </template>
          <el-menu-item
            index="generalOperation"
            @click="$router.push({ name: 'generalOperation' })"
          >
            <!-- <svg class="icon-svg aui-sidebar__menu-icon">
                <use xlink:href="#icon-log"></use>
              </svg> -->
            <svg class="icon-svg aui-sidebar__menu-icon-son" aria-hidden="true">
              <use xlink:href="#椭圆形"></use>
            </svg>
            <span slot="title">通用作业</span>
          </el-menu-item>
          <el-submenu index="Metrological">
            <template slot="title">
              <svg class="icon-svg aui-sidebar__menu-icon">
                <use xlink:href="#icon-tubiao"></use>
              </svg>
              <span>计量分析</span>
            </template>
            <el-menu-item index="XbarRGraph" @click="$router.push({ name: 'XbarRGraph' })">
              <!-- <svg class="icon-svg aui-sidebar__menu-icon">
                <use xlink:href="#icon-tubiao"></use>
              </svg> -->
              <svg class="icon-svg aui-sidebar__menu-icon-son" aria-hidden="true">
                <use xlink:href="#椭圆形"></use>
              </svg>
              <span slot="title">均值极差控制图</span>
            </el-menu-item>
            <el-menu-item index="XbarSGraph" @click="$router.push({ name: 'XbarSGraph' })">
              <!-- <svg class="icon-svg aui-sidebar__menu-icon">
                <use xlink:href="#icon-tubiao"></use>
              </svg> -->
              <svg class="icon-svg aui-sidebar__menu-icon-son" aria-hidden="true">
                <use xlink:href="#椭圆形"></use>
              </svg>
              <span slot="title">均值标准差控制图</span>
            </el-menu-item>
            <el-menu-item index="XMRGraph" @click="$router.push({ name: 'XMRGraph' })">
              <!-- <svg class="icon-svg aui-sidebar__menu-icon">
                <use xlink:href="#icon-tubiao"></use>
              </svg> -->
              <svg class="icon-svg aui-sidebar__menu-icon-son" aria-hidden="true">
                <use xlink:href="#椭圆形"></use>
              </svg>
              <span slot="title">单值移动极差控制图</span>
            </el-menu-item>
          </el-submenu>
          <el-submenu index="Counting">
            <template slot="title">
              <svg class="icon-svg aui-sidebar__menu-icon">
                <use xlink:href="#icon-tubiao"></use>
              </svg>
              <span>计数分析</span>
            </template>
            <el-menu-item index="CGraph" @click="$router.push({ name: 'CGraph' })">
              <!-- <svg class="icon-svg aui-sidebar__menu-icon">
                <use xlink:href="#icon-tubiao"></use>
              </svg> -->
              <svg class="icon-svg aui-sidebar__menu-icon-son" aria-hidden="true">
                <use xlink:href="#椭圆形"></use>
              </svg>
              <span slot="title">C图</span>
            </el-menu-item>
            <el-menu-item index="UGraph" @click="$router.push({ name: 'UGraph' })">
              <!-- <svg class="icon-svg aui-sidebar__menu-icon">
                <use xlink:href="#icon-tubiao"></use>
              </svg> -->
              <svg class="icon-svg aui-sidebar__menu-icon-son" aria-hidden="true">
                <use xlink:href="#椭圆形"></use>
              </svg>
              <span slot="title">U图</span>
            </el-menu-item>
            <el-menu-item index="NPGraph" @click="$router.push({ name: 'NPGraph' })">
              <!-- <svg class="icon-svg aui-sidebar__menu-icon">
                <use xlink:href="#icon-tubiao"></use>
              </svg> -->
              <svg class="icon-svg aui-sidebar__menu-icon-son" aria-hidden="true">
                <use xlink:href="#椭圆形"></use>
              </svg>
              <span slot="title">NP图</span>
            </el-menu-item>
            <el-menu-item index="PGraph" @click="$router.push({ name: 'PGraph' })">
              <!-- <svg class="icon-svg aui-sidebar__menu-icon">
                <use xlink:href="#icon-tubiao"></use>
              </svg> -->
              <svg class="icon-svg aui-sidebar__menu-icon-son" aria-hidden="true">
                <use xlink:href="#椭圆形"></use>
              </svg>
              <span slot="title">P图</span>
            </el-menu-item>
          </el-submenu>
        </el-submenu>
        <sub-menu v-for="menu in $store.state.sidebarMenuList" :key="menu.id" :menu="menu" />
      </el-menu>
    </div>
  </aside>
</template>

<script>
import SubMenu from "./main-sidebar-sub-menu";
export default {
  data() {
    return {};
  },
  components: {
    SubMenu,
  },
  created() {
    this.$store.state.sidebarMenuList = window.SITE_CONFIG["menuList"];
  },
};
</script>
