linan 4 years ago
parent
commit
c07fd97bed
2 changed files with 6 additions and 60 deletions
  1. 6 7
      src/views/Home/Home.vue
  2. 0 53
      src/views/Home/mencCofig.js

+ 6 - 7
src/views/Home/Home.vue

@@ -53,27 +53,26 @@
                         text-color="#fff"
                         text-color="#fff"
                         active-text-color="#ffd04b"
                         active-text-color="#ffd04b"
                     >
                     >
-                        <div v-for="(item) in menuData " :key="item.index">
+                        <div v-for="(item, index1) in menuData " :key="index1">
                             <el-submenu
                             <el-submenu
                                 v-if="item.childList && item.childList.length > 0"
                                 v-if="item.childList && item.childList.length > 0"
-                                :index="item.index"
+                                :index="`${index1}`"
                             >
                             >
                                 <template slot="title">
                                 <template slot="title">
                                     <i :class="item.iconClassName"></i>
                                     <i :class="item.iconClassName"></i>
                                     <span slot="title">{{ !menuCollapse? item.optionName : '' }}</span>
                                     <span slot="title">{{ !menuCollapse? item.optionName : '' }}</span>
-                                    <!-- <span slot="title">{{ item.oneMenuName }}</span> -->
                                 </template>
                                 </template>
                                 <el-menu-item
                                 <el-menu-item
-                                    v-for="(item1) in item.childList"
-                                    :key="item1.index"
-                                    :index="item1.index"
+                                    v-for="(item1, index2) in item.childList"
+                                    :key="`${index1}-${index2}`"
+                                    :index="`${index1}-${index2}`"
                                     :routerName="item1.routerName"
                                     :routerName="item1.routerName"
                                     @click="onClickMenu(item1)"
                                     @click="onClickMenu(item1)"
                                 >{{ item1.optionName }}</el-menu-item>
                                 >{{ item1.optionName }}</el-menu-item>
                             </el-submenu>
                             </el-submenu>
                             <el-menu-item
                             <el-menu-item
                                 v-else
                                 v-else
-                                :index="item.index"
+                                :index="`${index1}`"
                                 :disabled="item.disabled"
                                 :disabled="item.disabled"
                                 :routerName="item.routerName"
                                 :routerName="item.routerName"
                                 @click="onClickMenu(item)"
                                 @click="onClickMenu(item)"

+ 0 - 53
src/views/Home/mencCofig.js

@@ -3,27 +3,22 @@ export const menuData = [
     {
     {
         optionName: "档案信息",
         optionName: "档案信息",
         iconClassName: "el-icon-files",
         iconClassName: "el-icon-files",
-        index: '0',
         disabled: false, // 是否禁用
         disabled: false, // 是否禁用
         childList: [
         childList: [
             {
             {
                 optionName: '企业信息',
                 optionName: '企业信息',
-                index: '0-1',
                 routerName: "firmInfo"
                 routerName: "firmInfo"
             },
             },
             {
             {
                 optionName: '牧场信息',
                 optionName: '牧场信息',
-                index: '0-2',
                 routerName: "pastureInfo"
                 routerName: "pastureInfo"
             },
             },
             {
             {
                 optionName: '栋舍信息',
                 optionName: '栋舍信息',
-                index: '0-3',
                 routerName: "areaInfo"
                 routerName: "areaInfo"
             },
             },
             {
             {
                 optionName: '员工信息',
                 optionName: '员工信息',
-                index: '0-4',
                 routerName: "workerInfo"
                 routerName: "workerInfo"
             }
             }
         ]
         ]
@@ -31,57 +26,46 @@ export const menuData = [
     {
     {
         optionName: "繁殖管理",
         optionName: "繁殖管理",
         iconClassName: "el-icon-magic-stick",
         iconClassName: "el-icon-magic-stick",
-        index: '1',
         disabled: false, // 是否禁用
         disabled: false, // 是否禁用
         childList: [
         childList: [
             {
             {
                 optionName: '种羊档案',
                 optionName: '种羊档案',
-                index: '1-1',
                 routerName: "seedSheepFile"
                 routerName: "seedSheepFile"
             },
             },
             {
             {
                 optionName: '商品羊档案',
                 optionName: '商品羊档案',
-                index: '1-100',
                 routerName: "commoditySheepFile"
                 routerName: "commoditySheepFile"
             },
             },
             {
             {
                 optionName: '采精记录',
                 optionName: '采精记录',
-                index: '1-2',
                 routerName: "collectSeedLog"
                 routerName: "collectSeedLog"
             },
             },
             {
             {
                 optionName: '查情记录',
                 optionName: '查情记录',
-                index: '1-3',
                 routerName: "matingSuccLog"
                 routerName: "matingSuccLog"
             },
             },
             {
             {
                 optionName: '配种记录',
                 optionName: '配种记录',
-                index: '1-4',
                 routerName: "matingLog"
                 routerName: "matingLog"
             },
             },
             {
             {
                 optionName: '妊检记录',
                 optionName: '妊检记录',
-                index: '1-5',
                 routerName: "pregnancyTestLog"
                 routerName: "pregnancyTestLog"
             },
             },
             {
             {
                 optionName: '分娩记录',
                 optionName: '分娩记录',
-                index: '1-6',
                 routerName: "parturitionLog"
                 routerName: "parturitionLog"
             },
             },
             {
             {
                 optionName: '断奶记录',
                 optionName: '断奶记录',
-                index: '1-7',
                 routerName: "weaningLog"
                 routerName: "weaningLog"
             },
             },
             {
             {
                 optionName: '离场记录',
                 optionName: '离场记录',
-                index: '1-8',
                 routerName: "offFieldLog"
                 routerName: "offFieldLog"
             },
             },
             {
             {
                 optionName: '转舍记录',
                 optionName: '转舍记录',
-                index: '1-9',
                 routerName: "shiftFieldLog"
                 routerName: "shiftFieldLog"
             }
             }
         ]
         ]
@@ -89,27 +73,22 @@ export const menuData = [
     {
     {
         optionName: "防疫管理",
         optionName: "防疫管理",
         iconClassName: "el-icon-s-flag",
         iconClassName: "el-icon-s-flag",
-        index: '2',
         disabled: false,
         disabled: false,
         childList: [
         childList: [
             {
             {
                 optionName: '免疫程序',
                 optionName: '免疫程序',
-                index: '2-1',
                 routerName: "immuneProce"
                 routerName: "immuneProce"
             },
             },
             {
             {
                 optionName: '免疫计划',
                 optionName: '免疫计划',
-                index: '2-2',
                 routerName: "immunePlan"
                 routerName: "immunePlan"
             },
             },
             {
             {
                 optionName: '免疫记录',
                 optionName: '免疫记录',
-                index: '2-3',
                 routerName: "immuneLog"
                 routerName: "immuneLog"
             },
             },
             {
             {
                 optionName: '疾病登记',
                 optionName: '疾病登记',
-                index: '2-4',
                 routerName: "illnessLog"
                 routerName: "illnessLog"
             }
             }
         ]
         ]
@@ -118,37 +97,30 @@ export const menuData = [
     {
     {
         optionName: "生产管理",
         optionName: "生产管理",
         iconClassName: "el-icon-first-aid-kit",
         iconClassName: "el-icon-first-aid-kit",
-        index: '3',
         disabled: false,
         disabled: false,
         childList: [
         childList: [
             {
             {
                 optionName: '批次管理',
                 optionName: '批次管理',
-                index: '3-1',
                 routerName: "batch"
                 routerName: "batch"
             },
             },
             {
             {
                 optionName: '生产预警',
                 optionName: '生产预警',
-                index: '3-2',
                 routerName: "productionWarn"
                 routerName: "productionWarn"
             },
             },
             {
             {
                 optionName: '调拨转舍',
                 optionName: '调拨转舍',
-                index: '3-3',
                 routerName: "shiftField"
                 routerName: "shiftField"
             },
             },
             {
             {
                 optionName: '死淘管理',
                 optionName: '死淘管理',
-                index: '3-4',
                 routerName: "dieWeedOut"
                 routerName: "dieWeedOut"
             },
             },
             {
             {
                 optionName: '耳标管理',
                 optionName: '耳标管理',
-                index: '3-5',
                 routerName: "earTag"
                 routerName: "earTag"
             },
             },
             {
             {
                 optionName: '检测报告',
                 optionName: '检测报告',
-                index: '3-7',
                 routerName: "examiningReport"
                 routerName: "examiningReport"
             }
             }
            
            
@@ -157,17 +129,14 @@ export const menuData = [
     {
     {
         optionName: "无害化管理",
         optionName: "无害化管理",
         iconClassName: "el-icon-set-up",
         iconClassName: "el-icon-set-up",
-        index: '4',
         disabled: false,
         disabled: false,
         childList: [
         childList: [
             {
             {
                 optionName: '无害化确认',
                 optionName: '无害化确认',
-                index: '4-1',
                 routerName: "harmlessConfirm"
                 routerName: "harmlessConfirm"
             },
             },
             {
             {
                 optionName: '智能提醒',
                 optionName: '智能提醒',
-                index: '4-2',
                 routerName: "intelligentHint"
                 routerName: "intelligentHint"
             }
             }
         ]
         ]
@@ -175,27 +144,22 @@ export const menuData = [
     {
     {
         optionName: "物料管理",
         optionName: "物料管理",
         iconClassName: "el-icon-news",
         iconClassName: "el-icon-news",
-        index: '5',
         disabled: false,
         disabled: false,
         childList: [
         childList: [
             {
             {
                 optionName: '基础信息',
                 optionName: '基础信息',
-                index: '5-1',
                 routerName: "basicsInfo"
                 routerName: "basicsInfo"
             },
             },
             {
             {
                 optionName: '物料入库',
                 optionName: '物料入库',
-                index: '5-2',
                 routerName: "materialInStore"
                 routerName: "materialInStore"
             },
             },
             {
             {
                 optionName: '物料出库',
                 optionName: '物料出库',
-                index: '5-3',
                 routerName: "materialOutStore"
                 routerName: "materialOutStore"
             },
             },
             {
             {
                 optionName: '库存盘点',
                 optionName: '库存盘点',
-                index: '5-4',
                 routerName: "storeList"
                 routerName: "storeList"
             }
             }
         ]
         ]
@@ -203,12 +167,10 @@ export const menuData = [
     {
     {
         optionName: "育种管理",
         optionName: "育种管理",
         iconClassName: "el-icon-bank-card",
         iconClassName: "el-icon-bank-card",
-        index: '6',
         disabled: false,
         disabled: false,
         childList: [
         childList: [
             {
             {
                 optionName: '等级评定',
                 optionName: '等级评定',
-                index: '6-1',
                 routerName: "gradeAssess"
                 routerName: "gradeAssess"
             }
             }
         ]
         ]
@@ -216,22 +178,18 @@ export const menuData = [
     {
     {
         optionName: "设备管理",
         optionName: "设备管理",
         iconClassName: "el-icon-setting",
         iconClassName: "el-icon-setting",
-        index: '7',
         disabled: false,
         disabled: false,
         childList: [
         childList: [
             {
             {
                 optionName: '环境检测',
                 optionName: '环境检测',
-                index: '7-1',
                 routerName: "environmentMonitoring"
                 routerName: "environmentMonitoring"
             },
             },
             {
             {
                 optionName: '视频监控',
                 optionName: '视频监控',
-                index: '7-2',
                 routerName: "video"
                 routerName: "video"
             },
             },
             {
             {
                 optionName: '设备故障',
                 optionName: '设备故障',
-                index: '7-3',
                 routerName: "deviceFault"
                 routerName: "deviceFault"
             }
             }
         ]
         ]
@@ -239,12 +197,10 @@ export const menuData = [
     {
     {
         optionName: "销售管理",
         optionName: "销售管理",
         iconClassName: "el-icon-sell",
         iconClassName: "el-icon-sell",
-        index: '8',
         disabled: false,
         disabled: false,
         childList: [
         childList: [
             {
             {
                 optionName: '销售记录',
                 optionName: '销售记录',
-                index: '8-1',
                 routerName: "sellLog"
                 routerName: "sellLog"
             }
             }
         ]
         ]
@@ -252,17 +208,14 @@ export const menuData = [
     {
     {
         optionName: "统计分析",
         optionName: "统计分析",
         iconClassName: "el-icon-monitor",
         iconClassName: "el-icon-monitor",
-        index: '9',
         disabled: false,
         disabled: false,
         childList: [
         childList: [
             {
             {
                 optionName: '存栏统计',
                 optionName: '存栏统计',
-                index: '9-1',
                 routerName: "existSstatistic"
                 routerName: "existSstatistic"
             },
             },
             {
             {
                 optionName: '生产数据',
                 optionName: '生产数据',
-                index: '9-2',
                 routerName: "productData"
                 routerName: "productData"
             }
             }
         ]
         ]
@@ -280,11 +233,9 @@ const menuData描述 = [
     {
     {
         oneMenuName: "导航一", // 一级菜单名
         oneMenuName: "导航一", // 一级菜单名
         iconClassName: "aaa", // element-ui图标名
         iconClassName: "aaa", // element-ui图标名
-        index: '1', // 唯一标志
         childList: [ // 分组的
         childList: [ // 分组的
             {
             {
                 groupName: '组名一',
                 groupName: '组名一',
-                index: '1-1-1',
                 list: [
                 list: [
                     {
                     {
                         optionName: '选项1',
                         optionName: '选项1',
@@ -295,7 +246,6 @@ const menuData描述 = [
             },
             },
             {
             {
                 groupName: '组名二',
                 groupName: '组名二',
-                index: '1-1-2',
                 list: [
                 list: [
                     {
                     {
                         optionName: '选项1',
                         optionName: '选项1',
@@ -310,12 +260,10 @@ const menuData描述 = [
     {
     {
         oneMenuName: "导航二",
         oneMenuName: "导航二",
         iconClassName: "el-icon-menu",
         iconClassName: "el-icon-menu",
-        index: '2',
         disabled: false, // 是否禁用
         disabled: false, // 是否禁用
         childList: [ // 不分组的
         childList: [ // 不分组的
             {
             {
                 optionName: '选项1',
                 optionName: '选项1',
-                index: '2-1',
                 routerName: "home"
                 routerName: "home"
             },
             },
             {}
             {}
@@ -326,7 +274,6 @@ const menuData描述 = [
         oneMenuName: "导航三",
         oneMenuName: "导航三",
         iconClassName: "el-icon-document",
         iconClassName: "el-icon-document",
         routerName: "home",
         routerName: "home",
-        index: '3',
         disabled: false
         disabled: false
     },
     },