<template>
  <div id="asider-wrapper">
    <div class="asider-icon">
      <div></div>
    </div>
    <!-- 左边导航栏颜色  background-color="#f78989"-->
    <el-menu :default-active="indexPath" :default-openeds="openeds" :unique-opened='true' class="el-menu-vertical-demo max-height-95" @select="open" @open="handleOpen" @close="handleClose" :collapse="collapse" active-text-color="#5e9af5" text-color="white">
      <!-- 循环遍历列表 -->
      <template>
        <el-submenu v-for="(item) in menuList" :key="item.id" :index="item.index" v-role='item.number' id="icon">
          <template slot="title">
            <i :class="item.icon"></i>
            <span slot="title">{{item.name}}</span>
          </template>
          <router-link v-for="(items) in item.menuLists" :key="items.id" :to="items.route" v-role='items.number' tag="p">
            <el-menu-item :index="items.index" @click="rowClick(items)" v-if="!items.level">
              <span slot="title">{{items.name}}</span>
            </el-menu-item>
            <el-submenu :index="items.index" v-else class="submenu">
              <span slot="title">{{ items.name }}</span>
              <router-link  v-for="(ite) in items.children" :key="ite.id" :to="ite.route" v-role='ite.number' tag="p">
                <el-menu-item :index="ite.index" @click="rowClick(ite)"> 
                  <i :class="ite.icon"></i>
                  <span slot="title">{{ite.name}}</span>
                </el-menu-item>
              </router-link>
            </el-submenu>
          </router-link>
        </el-submenu>
      </template>
      <!-- 	<router-link :to="'/AboutUs'" tag="p" id="icons">
				<el-menu-item index="4">
					<i class="el-icon-office-building"></i>
					<span slot="title">关于我们</span>
				</el-menu-item>
			</router-link> -->
    </el-menu>
  </div>
</template>
<script>
import { mapState } from "vuex";
export default {
  name: "asider",
  data() {
    return {
      openeds: [],
      // screenHeight: document.body.clientHeight,
      fullHeight: document.documentElement.clientHeight - 160,
      indexPath: "",
      sessionStorageData: {}, //门店参数集合
      isShow: false,
      search: "",
      rowList: [],
      menuList: [
        {
          name: "系统设置",
          icon: "el-icon-mobile-phone",
          index: "400",
          number: "400",
          id:"100100",
          menuLists: [
            {
              name: "首页",
              icon: "el-icon-s-home",
              route: "/home",
              index: "home",
              number: "400",
              id:"1001001",
            },
            {
              name: "门店参数",
              icon: "el-icon-s-data",
              route: "/storeParameters",
              index: "storeParameters",
              number: "400100",
              id:"1001002",
            },
            {
              name: "微信公众号",
              icon: "el-icon-s-data",
              route: "/tencentAccount",
              index: "tencentAccount",
              number: "400110",
              id:"100103",
            },
            {
              name: "角色档案",
              icon: "el-icon-user",
              route: "/role",
              index: "role",
              number: "400210",
              id:"100104",
            },
          ],
        },
        {
          name: "基础档案",
          icon: "el-icon-menu",
          index: "410",
          number: "400",
          id:"200200",
          menuLists: [
            {
              name: "项目类别",
              icon: "el-icon-reading",
              route: "/baseProjectType",
              index: "baseProjectType",
              number: "400400",
              id:"2002001",
            },
            {
              name: "项目",
              icon: "el-icon-files",
              route: "/baseProject",
              index: "baseProject",
              number: "400500",
              id:"2002002",
            },
            {
              name: "充值类别",
              icon: "el-icon-coin",
              route: "/rechargeType",
              index: "rechargeType",
              number: "400600",
              id:"2002003",
            },
            {
              name: "房间档案",
              icon: "el-icon-s-home",
              route: "/room",
              index: "room",
              number: "400810",
              id:"2002004",
            },
          ],
        },
        {
          name: "员工管理",
          icon: "el-icon-user",
          index: "420",
          number: "400",
          id:"300300",
          menuLists: [
            {
              name: "职务档案",
              icon: "el-icon-user-solid",
              route: "/gradeList",
              index: "gradeList",
              number: "400210",
              id:"3003001",
            },
            {
              name: "工种档案",
              icon: "el-icon-s-custom",
              route: "/jobList",
              index: "jobList",
              number: "400220",
              id:"3003002",
            },
            {
              name: "员工",
              icon: "el-icon-user",
              route: "/baseStaff",
              index: "baseStaff",
              number: "400200",
              id:"3003003",
            },
            {
              name: "员工作品",
              icon: "el-icon-info",
              route: "/staffWorks",
              index: "staffWorks",
              number: "400300",
              id:"3003004",
            },
            {
              name: "服务反馈",
              icon: "el-icon-suitcase",
              route: "/feedback",
              index: "feedback",
              number: "400310",
              id:"3003005",
            },
            {
              name: "消费评价",
              icon: "el-icon-files",
              route: "/evaluation",
              index: "evaluation",
              number: "400320",
              id:"3003006",
            },
          ],
        },
        {
          name: "会员管理",
          icon: "el-icon-s-custom",
          index: "430",
          number: "400",
          id:"400400",
          menuLists: [
            {
              name: "会员清单",
              icon: "el-icon-view",
              route: "/memberList",
              index: "memberList",
              number: "400700",
              id:"4004001",
            },
            {
              name: "会员等级",
              icon: "el-icon-info",
              route: "/memberClass",
              index: "memberClass",
              number: "400720",
              id:"4004002",
            },
            {
              name: "会员分派",
              icon: "el-icon-c-scale-to-original",
              route: "/menmberAllot",
              index: "menmberAllot",
              number: "400800",
              id:"4004003",
            },
            {
              name: "员工会员统计表",
              icon: "el-icon-sunset",
              route: "/staffVipSum",
              index: "staffVipSum",
              number: "400900",
              id:"4004004",
            },
            {
              name: "会员交易记录",
              icon: "el-icon-s-order",
              route: "/trading",
              index: "trading",
              number: "4001100",
              id:"4004005",
            },
            {
              name: "会员激活",
              icon: "el-icon-info",
              route: "/activationMember",
              index: "activationMember",
              number: "400710",
              id:"4004006",
            },
          ],
        },
        {
          name: "加盟商管理",
          icon: "el-icon-s-promotion",
          index: "440",
          number: "4400",
          id:"500500",
          menuLists: [
            // {
            //   name: "激活会员",
            //   icon: "el-icon-info",
            //   route: "/activationMember",
            //   index: "activationMember",
            //   number: "400710",
            // },
            {
              name: "加盟商档案",
              icon: "el-icon-s-check",
              route: "/alliance",
              index: "alliance",
              number: "4008100",
              id:"5005001",
            },
          ],
        },
        {
          name: "物资管理",
          icon: "el-icon-s-ticket",
          index: "450",
          number: "450",
          id:"600600",
          menuLists: [
            {
              name: "物资",
              icon: "el-icon-s-ticket",
              route: "/materials",
              index: "materials",
              number: "4008100",
              id:"6006001",
            },
            {
              name: "商品",
              icon: "el-icon-s-goods",
              route: "/goods",
              index: "goods",
              number: "400510",
              id:"6006002",
            },
          ],
        },
        {
          name: "业绩管理",
          icon: "el-icon-s-flag",
          index: "460",
          number: "400",
          id:"700700",
          menuLists: [
            {
              name: "门店月度任务",
              icon: "el-icon-s-flag",
              route: "/storeTask",
              index: "storeTask",
              number: "4001000",
              id:"7007001",
            },
          ],
        },
        {
          name: "收银员",
          index: "26",
          icon: "el-icon-user-solid",
          number: "500",
          id:"800800",
          menuLists: [
            // {
            //   name: "房间收银",
            //   icon: "el-icon-more",
            //   route: "/roomCash",
            //   index: "roomCash",
            //   number: "500200",
            //   id:"8008001",
            // },

            // {
            //   name: "员工出勤表",
            //   icon: "el-icon-wind-power",
            //   route: "/attendanceList",
            //   index: "attendanceList",
            //   number: "500100"
            // },

            // {
            //   name: "预约",
            //   icon: "el-icon-alarm-clock",
            //   route: "/subscribe",
            //   index: "subscribe"
            // },
            //        {
            //   name: "测试",
            //   icon: "el-icon-alarm-clock",
            //   route: "/rece",
            //   index: "rece",
            //   number:"500100"
            // },
            {
              name: "预约叫号",
              icon: "el-icon-loading",
              route: "/line",
              index: "line",
              number: "500100",
              id:"8008002",
            },
            {
              name: "服务单",
              icon: "el-icon-receiving",
              route: "/shareBill",
              index: "shareBill",
              number: "500200",
              id:"8008003",
            },
            {
              name: "直接收银",
              icon: "el-icon-receiving",
              route: "/services",
              index: "services",
              number: "500200",
              id:"8008004",
            },
            // {
            //   name: "会员协议",
            //   icon: "el-icon-receiving",
            //   route: "/memberAgreement",
            //   index: "memberAgreement",
            //   number: "500200",
            //   id:"80080042323",
            // },
            {
              name: "疗程内调单",
              icon: "el-icon-receiving",
              route: "/courseTune",
              index: "courseTune",
              number: "501000",
              id:"80080041",
            },
            {
              name: "充值卡转门店",
              icon: "el-icon-sort",
              route: "/cardToStore",
              index: "cardToStore",
              number: "5001900",
              id:"80080251",
            },
            {
              name: "充值",
              icon: "el-icon-info",
              route: "/collectionList",
              index: "collectionList",
              number: "500300",
              id:"8008005",
            },
            {
              name: "疗程",
              icon: "el-icon-bell",
              route: "/reatment",
              index: "reatment",
              number: "500400",
              id:"8008006",
            },
            {
              name: "充值内调单",
              icon: "el-icon-sort",
              route: "/within",
              index: "within",
              number: "501100",
              id:"8008009",
            },
            {
              name: "加价转疗程",
              icon: "el-icon-connection",
              route: "/raiseReatment",
              index: "raiseReatment",
              number: "500410",
              id:"8008007",
            },
            {
              name: "疗程转充值",
              icon: "el-icon-connection",
              route: "/coursetorec",
              index: "coursetorec",
              number: "501200",
              id:"8008008",
            },  
            {
              name: "疗程账户延期",
              icon: "el-icon-connection",
              route: "/ireatmentdelay",
              index: "ireatmentdelay",
              number: "5001600",
              id:"8008026",
            },
            {
              name: "充值账户延期",
              icon: "el-icon-connection",
              route: "/rechargingdelay",
              index: "/rechargingdelay",
              number: "5001800",
              id:"8008027",
            },
            // {
            //   level:true,
            //   name:"内调单",
            //   index:"/within",
            //   number:"500410",
            //   id:'99999999',
            //   route:"/within",
            //   icon: "el-icon-sort",
            //   children:[
            //     {
            //       name: "充值内调单",
            //       icon: "el-icon-sort",
            //       route: "/within",
            //       index: "within",
            //       number: "500410",
            //       id:"8008009",
            //     },
            //     {
            //       name: "加价转疗程",
            //       icon: "el-icon-connection",
            //       route: "/raiseReatment",
            //       index: "raiseReatment",
            //       number: "500410",
            //       id:"8008007",
            //     },
            //     {
            //       name: "疗程转充值",
            //       icon: "el-icon-connection",
            //       route: "/coursetorec",
            //       index: "coursetorec",
            //       number: "500410",
            //       id:"8008008",
            //     },                
            //   ]
            // },
            {
              name: "会员转卡",
              icon: "el-icon-sort",
              route: "/transfer",
              index: "transfer",
              number: "5001500",
              id:"8008024",
            },
            {
              name: "疗程转门店",
              icon: "el-icon-sort",
              route: "/transferstore",
              index: "transferstore",
              number: "5001700",
              id:"8008025",
            },
            // {
            //   name: "收款",
            //   icon: "el-icon-s-management",
            //   route: "/receipt",
            //   index: "receipt",
            // },
            {
              name: "充值退",
              icon: "el-icon-warning-outline",
              route: "/refundRecharge",
              index: "refundRecharge",
              number: "500500",
              id:"80080012",
            },
            {
              name: "疗程退",
              icon: "el-icon-s-ticket",
              route: "/refundCourse",
              index: "refundCourse",
              number: "500600",
              id:"80080013",
            },
            {
              name: "消费退",
              icon: "el-icon-sold-out",
              route: "/refund",
              index: "refund",
              number: "500700",
              id:"80080014",
            },
            {
              name: "房间单据退款",
              icon: "el-icon-sold-out",
              route: "/roomRefund",
              index: "roomRefund",
              number: "500710",
              id:"80080015",
            },
            {
              name: "还款单",
              icon: "el-icon-notebook-2",
              route: "/repayment",
              index: "repayment",
              number: "500800",
              id:"80080016",
            },
            {
              name: "取消欠款",
              icon: "el-icon-notebook-2",
              route: "/noarrears",
              index: "noarrears",
              number: "500900",
              id:"80080017",
            },
            {
              name: "异常单",
              icon: "el-icon-question",
              route: "/errorOrder",
              index: "errorOrder",
              number: "5001200",
              id:"80080018",
            },
            {
              name: "业绩重算",
              icon: "el-icon-refresh-right",
              route: "/recountOrder",
              index: "recountOrder",
              number: "5001300",
              id:"80080019",
            },

            // {
            //   name: "会员账户明细",
            //   icon: "el-icon-view",
            //   route: "/memberAccount",
            //   index: "memberAccount",
            //   number: "500900",
            // },
            {
              name: "会员初始化",
              icon: "el-icon-document-add",
              route: "/setImport",
              index: "setImport",
              number: "5001000",
              id:"80080020",
            },
            {
              name: "会员账户管理",
              icon: "el-icon-edit",
              route: "/accountSet",
              index: "accountSet",
              number: "5001100",
              id:"80080021",
            },

            {
              name: "员工业绩统计",
              icon: "el-icon-s-data",
              route: "/staffPerList",
              index: "staffPerList",
              number: "0",
              id:"80080022",
            },
            {
              name: "员工业绩明细",
              icon: "el-icon-view",
              route: "/perDetail",
              index: "perDetail",
              number: "0",
              id:"80080023",
            },
          ],
        },
        {
          name: "促销管理",
          index: "30",
          icon: "el-icon-takeaway-box",
          number: "700",
          id:"900900",
          menuLists: [
            {
              name: "打包价",
              icon: "el-icon-suitcase",
              route: "/packing",
              index: "packing",
              number: "700100",
              id:"9009001",
            },
            {
              name: "买就送",
              icon: "el-icon-present",
              route: "/buyandgive",
              index: "buyandgive",
              number: "700200",
              id:"9009002",
            },
            {
              name: "随心配",
              icon: "el-icon-present",
              route: "/handpick",
              index: "handpick",
              number: "700200",
              id:"9009003",
            },
            {
              name: "促销列表",
              icon: "el-icon-document",
              route: "/sellpackingTable",
              index: "sellpackingTable",
              number: "700300",
              id:"9009004",
            },
            {
              name: "充值促销",
              icon: "el-icon-money",
              route: "/recpromotion",
              index: "recpromotion",
              number: "700400",
              id:"9009005",
            },
            {
              name: "赠卡",
              icon: "el-icon-s-ticket",
              route: "/giftCards",
              index: "giftCards",
              number: "700400",
              id:"9009006",
            },
            {
              name: "团购卡",
              icon: "el-icon-message-solid",
              route: "/group",
              index: "group",
              number: "700400",
              id:"9009007",
            },
            {
              name: "腾讯地图",
              icon: "el-icon-suitcase",
              route: "/map",
              index: "map",
              number: "0",
              id:"9009008",
            },
          ],
        },
        {
          name: "统计报表",
          index: "40",
          icon: "el-icon-s-data",
          number: "600",
          id:"10001000",
          menuLists: [
            {
              name: "门店日报",
              icon: "el-icon-suitcase",
              route: "/storeDaily",
              index: "storeDaily",
              number: "600100",
              id:"100010001",
            },
            {
              name: "门店收款汇总",
              icon: "el-icon-suitcase",
              route: "/storeSummary",
              index: "storeSummary",
              number: "600900",
              id:"100110",
            },
            // 统计报表开始
            {
              name: "疗程统计表",
              icon: "el-icon-suitcase",
              route: "/courseStatistics",
              index: "courseStatistics",
              number: "600900",
              id:"1001101",
            },
            {
              name: "头皮疗程明细",
              icon: "el-icon-suitcase",
              route: "/scalpCourse",
              index: "scalpCourse",
              number: "600900",
              id:"1001102",
            },
            {
              name: "美容大项目疗程表",
              icon: "el-icon-suitcase",
              route: "/projectCourse",
              index: "projectCourse",
              number: "600900",
              id:"1001103",
            },
            {
              name: "管理层工资表",
              icon: "el-icon-suitcase",
              route: "/manageWages",
              index: "manageWages",
              number: "600900",
              id:"1001104",
            },
            {
              name: "员工业绩表",
              icon: "el-icon-suitcase",
              route: "/IndividualPerformance",
              index: "IndividualPerformance",
              number: "600900",
              id:"1001105",
            },
            {
              name: "头皮项目登记表",
              icon: "el-icon-suitcase",
              route: "/scalpProject",
              index: "scalpProject",
              number: "600900",
              id:"1001106",
            },
            {
              name: "门店业绩每日明细表",
              icon: "el-icon-suitcase",
              route: "/monCommission",
              index: "monCommission",
              number: "600900",
              id:"1001107",
            },
            {
              name: "门店现金奖励明细表",
              icon: "el-icon-suitcase",
              route: "/cashReward",
              index: "cashReward",
              number: "600900",
              id:"1001108",
            },
            {
              name: "奖励明细表",
              icon: "el-icon-suitcase",
              route: "/monthlyRegistrationDetails",
              index: "monthlyRegistrationDetails",
              number: "600900",
              id:"1001109",
            },
            {
              name: "大项目销卡表",
              icon: "el-icon-suitcase",
              route: "/projectPinCard",
              index: "projectPinCard",
              number: "600900",
              id:"10011010",
            },
            {
              name: "管理层每日业绩表",
              icon: "el-icon-suitcase",
              route: "/storeConsultant",
              index: "storeConsultant",
              number: "600900",
              id:"10011011",
            },
            {
              name: "门店营业额登记表",
              icon: "el-icon-suitcase",
              route: "/storeTurnover",
              index: "storeTurnover",
              number: "600900",
              id:"10011012",
            },
            {
              name: "产品统计",
              icon: "el-icon-suitcase",
              route: "/productStatistics",
              index: "productStatistics",
              number: "600900",
              id:"10011013",
            },          
            // 统计报表结束
            {
              name: "门店日总业绩",
              icon: "el-icon-suitcase",
              route: "/storeTotalPerformance",
              index: "storeTotalPerformance",
              number: "6001000",
              id:"100110112",
            },
            {
              name: "收款明细",
              icon: "el-icon-suitcase",
              route: "/cardCollection",
              index: "cardCollection",
              number: "6001500",
              id:"10011011",
            },
            {
              name: "活跃会员",
              icon: "el-icon-present",
              route: "/activeMember",
              index: "activeMember",
              number: "0",
              id:"100010002",
            },
            {
              name: "沉积会员",
              icon: "el-icon-warning-outline",
              route: "/notActiveMember",
              index: "notActiveMember",
              number: "0",
              id:"100010003",
            },
            {
              name: "新增会员",
              icon: "el-icon-warning-outline",
              route: "/newMember",
              index: "newMember",
              number: "0",
              id:"100010004",
            },
            {
              name: "负卡金",
              icon: "el-icon-s-finance",
              route: "/negativeCard",
              index: "negativeCard",
              number: "600100",
              id:"100010005",
            },
            {
              name: "月度营业额",
              icon: "el-icon-coin",
              route: "/monthlyTaking",
              index: "monthlyTaking",
              number: "600500",
              id:"100010006",
            },
            {
              name: "员工服务统计",
              icon: "el-icon-warning-outline",
              route: "/staffService",
              index: "staffService",
              number: "0",
              id:"100010007",
            },
            {
              name: "高管业绩",
              icon: "el-icon-s-order",
              route: "/managers",
              index: "managers",
              number: "6001200",
              id:"100010008",
            },
            {
              name: "管理层业绩",
              icon: "el-icon-s-order",
              route: "/admins",
              index: "admins",
              number: "6001300",
              id:"100010009",
            },

            {
              name: "部门业绩",
              icon: "el-icon-s-finance",
              route: "/dept",
              index: "dept",
              number: "6001400",
              id:"1000100010",
            },
            // {
            //   name: "员工工资",
            //   icon: "el-icon-wallet",
            //   route: "/staffSalary",
            //   index: "staffSalary",
            //   number: "600600",
            // },
            {
              name: "员工业绩提成表",
              icon: "el-icon-warning-outline",
              route: "/staffBrokerage",
              index: "staffBrokerage",
              number: "600200",
              id:"1000100011",
            },
            // {
            //   name: "员工排行榜",
            //   icon: "el-icon-s-marketing",
            //   route: "/staffRanking",
            //   index: "staffRanking",
            //   number: "600200",
            // },
            {
              name: "项目排行榜",
              icon: "el-icon-s-marketing",
              route: "/projectRanking",
              index: "projectRanking",
              number: "600300",
              id:"1000100012",
            },
            {
              name: "会员排行榜",
              icon: "el-icon-s-marketing",
              route: "/memberRanking",
              index: "memberRanking",
              number: "600400",
              id:"1000100013",
            },
            {
              name: "门店单品贡献率",
              icon: "el-icon-s-data",
              route: "/contribution",
              index: "contribution",
              number: "600200",
              id:"1000100014",
            },
            {
              name: "公司单品贡献率",
              icon: "el-icon-s-grid",
              route: "/contributions",
              index: "contributions",
              number: "600200",
              id:"1000100015",
            },
            {
              name: "会员拉新排行榜",
              icon: "el-icon-info",
              route: "/recommend",
              index: "recommend",
              number: "6001100",
              id:"1000100016",
            },
            {
              name: "人均单价",
              icon: "el-icon-s-finance",
              route: "/perCapita",
              index: "perCapita",
              number: "6001100",
              id:"1000100017",
            },
            {
              name: "活动排行榜",
              icon: "el-icon-s-cooperation",
              route: "/activity",
              index: "activity",
              number: "6001100",
              id:"1000100018",
            },
            {
              name: "计划达成",
              icon: "el-icon-s-flag",
              route: "/achieve",
              index: "achieve",
              number: "6001100",
              id:"1000100019",
            },
            {
              name: "商城营收",
              icon: "el-icon-s-marketing",
              route: "/turnover",
              index: "turnover",
              number: "6001100",
              id:"1000100020",
            },
            {
              name: "商品营收",
              icon: "el-icon-s-flag",
              route: "/commodity",
              index: "commodity",
              number: "6001100",
              id:"1000100021",
            },
            {
              name: "新增会员",
              icon: "el-icon-s-custom",
              route: "/addMember",
              index: "addMember",
              number: "6001100",
              id:"1000100022",
            },
            {
              name: "离职率",
              icon: "el-icon-finished",
              route: "/separation",
              index: "separation",
              number: "6001100",
              id:"1000100023",
            },
            {
              name: "费用清单",
              icon: "el-icon-tickets",
              route: "/expenses",
              index: "expenses",
              number: "6001100",
              id:"1000100024",
            },
            {
              name: "结算",
              icon: "el-icon-document",
              route: "/account",
              index: "account",
              number: "6001100",
              id:"1000100025",
            },
            {
              name: "活动效率比",
              icon: "el-icon-takeaway-box",
              route: "/efficiency",
              index: "efficiency",
              number: "6001100",
              id:"1000100026",
            },
            {
              name: "活动新会员",
              icon: "el-icon-user",
              route: "/activityNew",
              index: "activityNew",
              number: "6001100",
              id:"1000100027",
            },
            {
              name: "服务年限",
              icon: "el-icon-more-outline",
              route: "/seniority",
              index: "seniority",
              number: "6001100",
              id:"1000100028",
            },
            {
              name: "会员时长",
              icon: "el-icon-s-platform",
              route: "/memberTime",
              index: "memberTime",
              number: "6001100",
              id:"1000100029",
            },
            {
              name: "创收",
              icon: "el-icon-s-platform",
              route: "/income",
              index: "income",
              number: "6001100",
              id:"1000100030",
            },
            {
              name: "合作费用",
              icon: "el-icon-s-finance",
              route: "/collaboration",
              index: "collaboration",
              number: "6001100",
              id:"1000100031",
            },
            {
              name: "合作费用支付",
              icon: "el-icon-s-claim",
              route: "/verification",
              index: "verification",
              number: "6001100",
              id:"1000100032",
            },

            {
              name: "收入分类",
              icon: "el-icon-warning-outline",
              route: "/incomeClassify",
              index: "incomeClassify",
              number: "0",
              id:"1000100033",
            },
            {
              name: "门店业绩排行",
              icon: "el-icon-medal-1",
              route: "/performance",
              index: "performance",
              number: "0",
              id:"1000100034",
            },
            {
              name: "门店利润排行",
              icon: "el-icon-data-line",
              route: "/storeProfits",
              index: "storeProfits",
              number: "0",
              id:"1000100035",
            },
            {
              name: "单店经营分析",
              icon: "el-icon-s-shop",
              route: "/runAnalyse",
              index: "runAnalyse",
              number: "0",
              id:"1000100036",
            },
            {
              name: "公司经营分析",
              icon: "el-icon-office-building",
              route: "/firmAnalyse",
              index: "firmAnalyse",
              number: "0",
              id:"1000100037",
            },
          ],
        },
        {
          name: "分店管理",
          index: "90",
          icon: "el-icon-office-building",
          number: "900",
          id:"11001100",
          menuLists: [
            {
              name: "开通分店",
              icon: "el-icon-suitcase",
              route: "/openBranch",
              index: "openBranch",
              number: "900100",
              id:"110011001",
            },
            {
              name: "分店明细",
              icon: "el-icon-suitcase",
              route: "/subbranch",
              index: "subbranch",
              number: "900200",
              id:"110011002",
            },
          ],
        },
        // 优惠券
        {
          name: "优惠券",
          index: "100",
          icon: "el-icon-s-ticket",
          number: "800",
          menuLists: [
            {
              name: "建立",
              icon: "el-icon-s-promotion",
              route: "/couponIssue",
              index: "couponIssue",
              number: "800100",
            },
            {
              name: "管理",
              icon: "el-icon-s-operation",
              route: "/couponMane",
              index: "couponMane",
              number: "800200",
            },
            {
              name: "领取消费",
              icon: "el-icon-time",
              route: "/couponRecord",
              index: "couponRecord",
              number: "800300",
            },
          ],
        },
      ],
    };
  },
  computed: {
    ...mapState(["collapse"]),
  },
  methods: {
    rowClick(row) {
      if (this.rowList.length < 9) {
        let flag = true;
        this.rowList.forEach((item) => {
          if (row.index == item.index) {
            flag = false;
          }
        });
        if (flag) {
          this.rowList.push(row);
        }
      } else {
      }
    },
    handleOpen(key, keyPath) {
      //console.log(key, keyPath);
      sessionStorage.setItem("keyPath", key);
    },
    handleClose(key, keyPath) {
      //console.log(key, keyPath);
    },
    open(index) {
      sessionStorage.setItem("indexPath", index);
    },
    //菜单收放事件
    handleChangeCollapse(show) {
      this.$store.dispatch("actionChange", !this.collapse);
      this.isShow = !this.isShow;
    },
  },
  created() {
    var that = this;
    let menuList = [...that.menuList];
    setTimeout(() => {
      that.sessionStorageData = JSON.parse(
        sessionStorage.getItem("sessionStorageData")
      );
      that.indexPath = sessionStorage.getItem("indexPath");
      that.openeds.push(sessionStorage.getItem("keyPath"));
      menuList.forEach((item, index) => {
        if (sessionStorage.getItem("headOffice") * 1 != 1) {
          if (item.number == "900") {
            menuList.splice(index, 1);
          }
          item.menuLists.forEach((items, indexs) => {
            if (items.number == "4001200" || items.name == "角色档案") {
              item.menuLists.splice(indexs, 1);
            }
          });
        }
        item.menuLists.forEach((items) => {
          if (
            that.sessionStorageData.allowdebt == false &&
            item.number * 1 == 500 &&
            items.number * 1 == 500800
          ) {
            items.number = "0";
          }
        });
      });
      that.menuList = menuList;
      console.log(that.menuList);
    }, 1000);
  },
  mounted() {
    //console.log(document.body.clientHeight);
    var h = document.documentElement.clientHeight || document.body.clientHeight;
    var a = document.getElementById("asider-wrapper");
    a.style.height = h - 58 + "px"; //减去顶部高度
    a.style.height = document.body.clientHeight + "px";
  },
  watch: {
    $route(to, from) {
      //监听路由 把当前路由的index存到sessionStorage 页面刷新时不该变页面   把index赋值给this.indexPath 实现路由跳转
      sessionStorage.setItem("indexPath", to.meta.index);
      this.indexPath = this.$route.meta.index;
    },
  },
};
</script>

<style scoped>
/* .el-menu-item.is-active i {
  color: #a09f9f;
} */
.el-menu-vertical-demo:not(.el-menu--collapse) {
  width: 200px;
  min-width: 64px;
  /* border-top: #5e9af5 1px solid; */
}

/* 一级菜单字体 */
.el-submenu__title span {
  font-size: 14px;
}

/* 二级菜单字体 */
.el-menu-item {
  font-size: 12px;
}

* /deep/ .el-submenu__title i {
  color: white !important;
}

/* 收缩按钮样式 */
#i i:hover {
  background: #438efd;
}

#icon i {
  color: white;
}

#icons i {
  color: white;
}

#asider-wrapper {
  max-width: 200px;
  min-width: 64px;
  min-height: 940px;
}

.el-menu {
  border: none;
}
*>>> .el-menu-item, .el-submenu__title{
    height: 0.175rem;
    line-height: 0.175rem;
}
/* .asider-icon{

} */
</style>
