guhongwei 4 years ago
parent
commit
065ebff62e

+ 33 - 0
dict/index.js

@@ -43,3 +43,36 @@ export const ticketType = [
   { label: '信息资料审查失败', value: '-3' },
   { label: '创新劵领取成功', value: '4' },
 ];
+
+// 所属领域
+export const field = [
+  { label: '先进制造与自动化', value: '先进制造与自动化' },
+  { label: '资源与环境技术', value: '资源与环境技术' },
+  { label: '新能源及节能技术', value: '新能源及节能技术' },
+  { label: '高技术服务业', value: '高技术服务业' },
+  { label: '航空航天技术', value: '航空航天技术' },
+  { label: '生物与新医药技术', value: '生物与新医药技术' },
+  { label: '电子信息技术', value: '电子信息技术' },
+];
+// 合作方式
+export const cooperation = [
+  { label: '技术入股', value: '技术入股' },
+  { label: '技术转让', value: '技术转让' },
+  { label: '合作开发', value: '合作开发' },
+  { label: '其他方式', value: '其他方式' },
+];
+// 成果状态
+export const achievestatus = [
+  { label: '产业化(成熟)技术', value: '产业化(成熟)技术' },
+  { label: '中试技术', value: '中试技术' },
+  { label: '小试产品', value: '小试产品' },
+  { label: '实验室阶段', value: '实验室阶段' },
+  { label: '原理样机', value: '原理样机' },
+];
+// 成果来源
+export const achievesource = [
+  { label: '国家项目', value: '国家项目' },
+  { label: '省级项目', value: '省级项目' },
+  { label: '市级项目', value: '市级项目' },
+  { label: '自选项目', value: '自选项目' },
+];

+ 128 - 0
src/components/adminCommon/frame copy.vue

@@ -0,0 +1,128 @@
+<template>
+  <div id="frame">
+    <el-container style="height: 100vh">
+      <el-header class="header">
+        <el-col :span="20" class="left">
+          <div>环南湖科创先导区双创服务平台-管理中心</div>
+        </el-col>
+        <el-col :span="4" class="right">
+          <span>{{ user ? user.name : '游客' }}</span>
+          <span @click="logoutBtn"><i class="el-icon-switch-button"></i></span>
+        </el-col>
+      </el-header>
+      <el-container class="container">
+        <el-aside width="200px" class="aside">
+          <el-menu
+            :default-active="$route.path"
+            class="el-menu-vertical-demo"
+            background-color="#242f42"
+            text-color="#fff"
+            active-text-color="#409eff"
+            router
+            overflow-y:
+            scroll
+          >
+            <el-menu-item index="/adminCenter/homeIndex">首页</el-menu-item>
+            <el-menu-item v-for="(item, index) in menuList" :key="index" :index="item.index">{{ item.name }}</el-menu-item>
+          </el-menu>
+        </el-aside>
+        <el-main class="main">
+          <router-view></router-view>
+        </el-main>
+      </el-container>
+    </el-container>
+  </div>
+</template>
+
+<script>
+import * as menu from './menu.js';
+import { mapState, createNamespacedHelpers } from 'vuex';
+export default {
+  name: 'frame',
+  props: {},
+  components: {},
+  data: function() {
+    return {
+      menuList: [],
+    };
+  },
+  created() {},
+  methods: {
+    // 退出登录
+    logoutBtn() {
+      localStorage.removeItem('token');
+      localStorage.removeItem('type');
+      this.$router.push({ path: '/' });
+    },
+    // 查询用户菜单
+    searchMenu() {
+      if (this.type == 'FWJG') {
+        this.$set(this, `menuList`, menu.fwjg);
+      } else if (this.type == 'QY') {
+        this.$set(this, `menuList`, menu.qy);
+      } else if (this.type == 'ZJJG') {
+        this.$set(this, `menuList`, menu.zjjg);
+      } else if (this.type == 'ZJ') {
+        this.$set(this, `menuList`, menu.ZJ);
+      }
+    },
+  },
+  computed: {
+    ...mapState(['user']),
+    type() {
+      return localStorage.getItem('type');
+    },
+  },
+  metaInfo() {
+    return { title: this.$route.meta.title };
+  },
+  watch: {
+    type: {
+      deep: true,
+      immediate: true,
+      handler(val) {
+        this.searchMenu();
+      },
+    },
+  },
+};
+</script>
+
+<style lang="less" scoped>
+.header {
+  border-bottom: 1px solid #f1f1f1;
+  background-color: #242f42;
+  .left {
+    height: 60px;
+    line-height: 60px;
+    font-size: 25px;
+    font-family: cursive;
+    font-weight: bold;
+    color: #fff;
+  }
+  .right {
+    height: 60px;
+    line-height: 60px;
+    font-size: 20px;
+    text-align: right;
+    color: #fff;
+    span {
+      padding: 0 10px;
+      i {
+        font-weight: bold;
+      }
+    }
+    span:hover {
+      cursor: pointer;
+      i {
+        color: #ff0000;
+      }
+    }
+  }
+}
+.container {
+  .aside {
+    background-color: #242f42;
+  }
+}
+</style>

+ 50 - 24
src/components/adminCommon/frame.vue

@@ -12,27 +12,30 @@
       </el-header>
       <el-container class="container">
         <el-aside width="200px" class="aside">
-          <el-menu
-            :default-active="$route.path"
-            class="el-menu-vertical-demo"
-            background-color="#242f42"
-            text-color="#fff"
-            active-text-color="#409eff"
-            router
-            overflow-y:
-            scroll
-            ><el-menu-item index="/adminCenter/homeIndex">首页</el-menu-item>
-            <el-menu-item v-for="(item, index) in menuList" :key="index" :index="item.index">{{ item.name }}</el-menu-item>
-            <!-- <el-menu-item index="/adminCenter/homeIndex">首页</el-menu-item>
-            <el-menu-item index="/adminCenter/news">新闻管理</el-menu-item>
-            <el-menu-item index="/adminCenter/product">科技成果管理</el-menu-item>
-            <el-menu-item index="/adminCenter/patent">专利管理</el-menu-item>
-            <el-menu-item index="/adminCenter/roadShow">路演管理</el-menu-item>
-            <el-menu-item index="/adminCenter/expert">专家管理</el-menu-item>
-            <el-menu-item index="/adminCenter/organization">企业管理</el-menu-item>
-            <el-menu-item index="/adminCenter/mechanism">机构管理</el-menu-item>
-            <el-menu-item index="/adminCenter/online">线上管理</el-menu-item>
-            <el-menu-item index="/adminCenter/policy">高企政策服务管理</el-menu-item> -->
+          <el-menu class="sidebar-el-menu" :default-active="onRoutes" background-color="#242f42" text-color="#fff" active-text-color="#409eff" router>
+            <template v-for="item in items">
+              <template v-if="item.subs">
+                <el-submenu class="second" :index="item.index" :key="item.index">
+                  <template slot="title">
+                    <i class="iconfont" :class="item.icon"></i>
+                    <span slot="title">{{ item.title }}</span>
+                  </template>
+                  <template v-for="subItem in item.subs">
+                    <el-submenu v-if="subItem.subs" :index="subItem.index" :key="subItem.index">
+                      <template slot="title" style="text-align:center">{{ subItem.title }}</template>
+                      <el-menu-item v-for="(threeItem, i) in subItem.subs" :key="i" :index="threeItem.index">{{ threeItem.title }}</el-menu-item>
+                    </el-submenu>
+                    <el-menu-item v-else :index="subItem.index" :key="subItem.index">{{ subItem.title }}</el-menu-item>
+                  </template>
+                </el-submenu>
+              </template>
+              <template v-else>
+                <el-menu-item class="first" :index="item.index" :key="item.index">
+                  <i class="iconfont" :class="item.icon"></i>
+                  <span slot="title">{{ item.title }}</span>
+                </el-menu-item>
+              </template>
+            </template>
           </el-menu>
         </el-aside>
         <el-main class="main">
@@ -52,7 +55,13 @@ export default {
   components: {},
   data: function() {
     return {
-      menuList: [],
+      items: [
+        {
+          icon: 'iconindex-copy',
+          index: '/adminCenter/homeIndex',
+          title: '首页',
+        },
+      ],
     };
   },
   created() {},
@@ -65,10 +74,13 @@ export default {
     },
     // 查询用户菜单
     searchMenu() {
+      let list = _.cloneDeep(this.items);
       if (this.type == 'FWJG') {
-        this.$set(this, `menuList`, menu.fwjg);
+        list.push(...menu.fwjg);
+        this.$set(this, `items`, _.uniqBy(list, 'index'));
       } else if (this.type == 'QY') {
-        this.$set(this, `menuList`, menu.qy);
+        list.push(...menu.qy);
+        this.$set(this, `items`, _.uniqBy(list, 'index'));
       } else if (this.type == 'ZJJG') {
         this.$set(this, `menuList`, menu.zjjg);
       } else if (this.type == 'ZJ') {
@@ -78,6 +90,9 @@ export default {
   },
   computed: {
     ...mapState(['user']),
+    onRoutes() {
+      return this.$route.path.replace('/', '');
+    },
     type() {
       return localStorage.getItem('type');
     },
@@ -132,6 +147,17 @@ export default {
 .container {
   .aside {
     background-color: #242f42;
+    /deep/.el-menu-item i {
+      margin: 0 5px 0 0;
+    }
+    .second {
+      i {
+        margin: 0 5px 0 0;
+      }
+      /deep/.el-menu-item {
+        padding-left: 60px !important;
+      }
+    }
   }
 }
 </style>

+ 93 - 19
src/components/adminCommon/menu.js

@@ -1,23 +1,97 @@
 export const fwjg = [
-  { name: '企业管理', index: '/adminCenter/organization' },
-  { name: '机构管理', index: '/adminCenter/mechanism' },
-  { name: '专家管理', index: '/adminCenter/expert' },
-  { name: '新闻管理', index: '/adminCenter/news' },
-  { name: '信息公开管理', index: '/adminCenter/openinfo' },
-  { name: '科技成果管理', index: '/adminCenter/product' },
-  { name: '专利管理', index: '/adminCenter/patent' },
-  { name: '路演管理', index: '/adminCenter/roadShow' },
-  { name: '线上管理', index: '/adminCenter/online' },
-  { name: '高企政策服务管理', index: '/adminCenter/policy' },
-  { name: '创新劵服务管理', index: '/adminCenter/ticket' },
+  {
+    icon: 'iconchaoshi1',
+    index: '/adminCenter/product',
+    title: '技术超市管理',
+    subs: [
+      {
+        icon: 'el-icon-s-home',
+        index: '/adminCenter/product?type=1',
+        title: '技术成果',
+      },
+      {
+        icon: 'el-icon-s-home',
+        index: '/adminCenter/product?type=0',
+        title: '科技需求',
+      },
+      {
+        icon: 'el-icon-s-home',
+        index: '/adminCenter/product?type=2',
+        title: '商务服务',
+      },
+    ],
+  },
+  // {
+  //   icon: 'iconjibenxinxi',
+  //   index: '/adminCenter/organization',
+  //   title: '企业管理',
+  // },
+  //   { title: '机构管理', index: '/adminCenter/mechanism' },
+  //   { title: '专家管理', index: '/adminCenter/expert' },
+  //   { title: '新闻管理', index: '/adminCenter/news' },
+  //   { title: '信息公开管理', index: '/adminCenter/openinfo' },
+  //   { title: '科技成果管理', index: '/adminCenter/product' },
+  //   { title: '专利管理', index: '/adminCenter/patent' },
+  //   { title: '路演管理', index: '/adminCenter/roadShow' },
+  //   { title: '线上管理', index: '/adminCenter/online' },
+  //   { title: '高企政策服务管理', index: '/adminCenter/policy' },
+  //   { title: '创新劵服务管理', index: '/adminCenter/ticket' },
 ];
 export const qy = [
-  { name: '基本信息管理', index: '/adminCenter/company/basic' },
-  { name: '政策服务管理', index: '/adminCenter/company/policy' },
-  { name: '创新券管理', index: '/adminCenter/company/ticket' },
+  {
+    icon: 'iconjibenxinxi',
+    index: '/adminCenter/company/basic',
+    title: '基本信息管理',
+  },
+  {
+    icon: 'iconzhengce',
+    index: '1',
+    title: '政策服务',
+    subs: [
+      {
+        icon: 'iconzhengce',
+        index: '/1',
+        title: '研发补贴',
+      },
+      {
+        icon: 'el-icon-s-home',
+        index: '/2',
+        title: '奖励兑现',
+      },
+      {
+        icon: 'el-icon-s-home',
+        index: '/3',
+        title: '高企认定',
+      },
+    ],
+  },
+  {
+    icon: 'iconchaoshi1',
+    index: '2',
+    title: '技术超市管理',
+    subs: [
+      {
+        icon: 'el-icon-s-home',
+        index: '/adminCenter/company/product?type=1',
+        title: '技术成果',
+      },
+      {
+        icon: 'el-icon-s-home',
+        index: '/adminCenter/company/product?type=0',
+        title: '科技需求',
+      },
+      {
+        icon: 'el-icon-s-home',
+        index: '/adminCenter/company/product?type=2',
+        title: '商务服务',
+      },
+    ],
+  },
+  // { title: '政策服务管理', index: '/adminCenter/company/policy' },
+  // { title: '创新券管理', index: '/adminCenter/company/ticket' },
 ];
-export const zjjg = [
-  { name: '基本信息管理', index: '/adminCenter/inter/basic' },
-  { name: '创新券审核管理', index: '/adminCenter/inter/ticket' },
-];
-export const ZJ = [{ name: '基本信息管理', index: '/adminCenter/experts/basic' }];
+// export const zjjg = [
+//   { title: '基本信息管理', index: '/adminCenter/inter/basic' },
+//   { title: '创新券审核管理', index: '/adminCenter/inter/ticket' },
+// ];
+// export const ZJ = [{ title: '基本信息管理', index: '/adminCenter/experts/basic' }];