guhongwei před 3 roky
rodič
revize
c70ef51f48

+ 3 - 0
src/assets/css/theme-ele/color-ele.css

@@ -49,3 +49,6 @@
 .sidebar-el-menu:not(.el-menu--collapse) {
 .sidebar-el-menu:not(.el-menu--collapse) {
   background-color: #409eff !important;
   background-color: #409eff !important;
 }
 }
+.el-submenu__title:hover {
+  background-color: #403AFF !important;
+}

+ 5 - 2
src/assets/css/theme-green/color-green.css

@@ -43,9 +43,12 @@
   color: #ffffff;
   color: #ffffff;
   background-color: #00a78e !important;
   background-color: #00a78e !important;
 }
 }
-.el-menu-item:hover{
-   background-color: #00a78e !important;
+.el-menu-item:hover {
+  background-color: #00a78e !important;
 }
 }
 .sidebar-el-menu:not(.el-menu--collapse) {
 .sidebar-el-menu:not(.el-menu--collapse) {
   background-color: #00d1b2 !important;
   background-color: #00d1b2 !important;
 }
 }
+.el-submenu__title:hover {
+  background-color: #00a78e !important;
+}

+ 239 - 7
src/assets/icon/iconfont.css

@@ -1,8 +1,8 @@
 @font-face {
 @font-face {
-  font-family: "iconfont"; /* Project id 2596994 */
-  src: url('iconfont.woff2?t=1623051037621') format('woff2'),
-       url('iconfont.woff?t=1623051037621') format('woff'),
-       url('iconfont.ttf?t=1623051037621') format('truetype');
+  font-family: "iconfont"; /* Project id 2726812 */
+  src: url('iconfont.woff2?t=1644564414295') format('woff2'),
+       url('iconfont.woff?t=1644564414295') format('woff'),
+       url('iconfont.ttf?t=1644564414295') format('truetype');
 }
 }
 
 
 .iconfont {
 .iconfont {
@@ -13,11 +13,243 @@
   -moz-osx-font-smoothing: grayscale;
   -moz-osx-font-smoothing: grayscale;
 }
 }
 
 
-.icon-ceshi:before {
-  content: "\e61f";
+.icon-rencai:before {
+  content: "\e60d";
 }
 }
 
 
-.icon-shouye:before {
+.icon-peiyang:before {
+  content: "\e618";
+}
+
+.icon-zhicheng:before {
+  content: "\e68f";
+}
+
+.icon-jishufuwu:before {
+  content: "\eb64";
+}
+
+.icon-fabiao:before {
+  content: "\e654";
+}
+
+.icon-huodong:before {
+  content: "\e6f0";
+}
+
+.icon-kepu:before {
+  content: "\e6a9";
+}
+
+.icon-qita:before {
+  content: "\e6fe";
+}
+
+.icon-huojiangqingkuang:before {
+  content: "\e61a";
+}
+
+.icon-lunwen:before {
+  content: "\e62a";
+}
+
+.icon-zhishichanquanziliao_zhishichanquan-shenfenzheng:before {
+  content: "\e603";
+}
+
+.icon-xiangmuxinxi:before {
+  content: "\e661";
+}
+
+.icon-icon:before {
+  content: "\e69a";
+}
+
+.icon-jixiaoguanli:before {
+  content: "\e60f";
+}
+
+.icon-liebiao:before {
+  content: "\e601";
+}
+
+.icon-dabianyanjiuneirong:before {
+  content: "\e602";
+}
+
+.icon-guding:before {
+  content: "\e66e";
+}
+
+.icon-banzhuren:before {
+  content: "\e61b";
+}
+
+.icon-liudong:before {
+  content: "\e610";
+}
+
+.icon-xinxiliebiao:before {
+  content: "\e63d";
+}
+
+.icon-jibenxinxi:before {
+  content: "\e619";
+}
+
+.icon-jiekou:before {
+  content: "\e638";
+}
+
+.icon-xitongcaidan:before {
+  content: "\e696";
+}
+
+.icon-goujian:before {
+  content: "\e651";
+}
+
+.icon-daimashengcheng:before {
+  content: "\e636";
+}
+
+.icon-shenhe:before {
+  content: "\e65b";
+}
+
+.icon-moban:before {
+  content: "\e635";
+}
+
+.icon-zhanghao:before {
+  content: "\e65f";
+}
+
+.icon-xiugaishenqing:before {
+  content: "\e611";
+}
+
+.icon-ceshishenqing:before {
+  content: "\eb61";
+}
+
+.icon-shangchuan-copy:before {
+  content: "\e7a4";
+}
+
+.icon-shujujiankong:before {
+  content: "\e655";
+}
+
+.icon-dingshirenwu:before {
+  content: "\e621";
+}
+
+.icon-fuwujiankong:before {
+  content: "\e6a3";
+}
+
+.icon-zaixianyonghu:before {
+  content: "\e6ad";
+}
+
+.icon-huancunjiankong:before {
+  content: "\e637";
+}
+
+.icon-rizhiguanli:before {
+  content: "\e60e";
+}
+
+.icon-tongzhigonggao:before {
+  content: "\e65e";
+}
+
+.icon-denglurizhi:before {
+  content: "\e694";
+}
+
+.icon-zidianguanli:before {
+  content: "\e668";
+}
+
+.icon-bumenguanli:before {
   content: "\e608";
   content: "\e608";
 }
 }
 
 
+.icon-caozuorizhi:before {
+  content: "\e60a";
+}
+
+.icon-xitongguanli-caidanguanli:before {
+  content: "\e628";
+}
+
+.icon-xitongguanli-jiaoseguanli:before {
+  content: "\e627";
+}
+
+.icon-canshushezhi:before {
+  content: "\e6ab";
+}
+
+.icon-yonghuguanli:before {
+  content: "\e645";
+}
+
+.icon-gangweiguanli:before {
+  content: "\e6a4";
+}
+
+.icon-dangjian_duiwujianshe:before {
+  content: "\e67d";
+}
+
+.icon-xitonggongju:before {
+  content: "\e674";
+}
+
+.icon-structuremanage:before {
+  content: "\e629";
+}
+
+.icon-keyan:before {
+  content: "\e600";
+}
+
+.icon-gudingzichanguanli:before {
+  content: "\e61d";
+}
+
+.icon-jixiao:before {
+  content: "\e605";
+}
+
+.icon-huodongshijian:before {
+  content: "\e606";
+}
+
+.icon-chengguozhanshi:before {
+  content: "\e659";
+}
+
+.icon-shouye:before {
+  content: "\e8c6";
+}
+
+.icon-xitongguanli:before {
+  content: "\e614";
+}
+
+.icon-essential-information:before {
+  content: "\e612";
+}
+
+.icon-xueshuguanli:before {
+  content: "\e77f";
+}
+
+.icon-xitongjiankong:before {
+  content: "\e63c";
+}
+

Rozdílová data souboru nebyla zobrazena, protože soubor je příliš velký
+ 1 - 1
src/assets/icon/iconfont.js


+ 417 - 11
src/assets/icon/iconfont.json

@@ -1,23 +1,429 @@
 {
 {
-  "id": "2596994",
-  "name": "study",
+  "id": "2726812",
+  "name": "基础动态研究管理平台",
   "font_family": "iconfont",
   "font_family": "iconfont",
   "css_prefix_text": "icon-",
   "css_prefix_text": "icon-",
-  "description": "学习平台",
+  "description": "",
   "glyphs": [
   "glyphs": [
     {
     {
-      "icon_id": "15296109",
-      "name": "测试",
-      "font_class": "ceshi",
-      "unicode": "e61f",
-      "unicode_decimal": 58911
+      "icon_id": "3640193",
+      "name": "人才",
+      "font_class": "rencai",
+      "unicode": "e60d",
+      "unicode_decimal": 58893
     },
     },
     {
     {
-      "icon_id": "7587742",
-      "name": "首页",
-      "font_class": "shouye",
+      "icon_id": "14690257",
+      "name": "培养",
+      "font_class": "peiyang",
+      "unicode": "e618",
+      "unicode_decimal": 58904
+    },
+    {
+      "icon_id": "14996003",
+      "name": "职称",
+      "font_class": "zhicheng",
+      "unicode": "e68f",
+      "unicode_decimal": 59023
+    },
+    {
+      "icon_id": "3868269",
+      "name": "技术服务",
+      "font_class": "jishufuwu",
+      "unicode": "eb64",
+      "unicode_decimal": 60260
+    },
+    {
+      "icon_id": "6548533",
+      "name": "发表",
+      "font_class": "fabiao",
+      "unicode": "e654",
+      "unicode_decimal": 58964
+    },
+    {
+      "icon_id": "6926770",
+      "name": "活动",
+      "font_class": "huodong",
+      "unicode": "e6f0",
+      "unicode_decimal": 59120
+    },
+    {
+      "icon_id": "11819079",
+      "name": "科普",
+      "font_class": "kepu",
+      "unicode": "e6a9",
+      "unicode_decimal": 59049
+    },
+    {
+      "icon_id": "687391",
+      "name": "其他",
+      "font_class": "qita",
+      "unicode": "e6fe",
+      "unicode_decimal": 59134
+    },
+    {
+      "icon_id": "3893266",
+      "name": "获奖情况",
+      "font_class": "huojiangqingkuang",
+      "unicode": "e61a",
+      "unicode_decimal": 58906
+    },
+    {
+      "icon_id": "6508142",
+      "name": "论文",
+      "font_class": "lunwen",
+      "unicode": "e62a",
+      "unicode_decimal": 58922
+    },
+    {
+      "icon_id": "11358804",
+      "name": "知识产权资料_知识产权-身份证",
+      "font_class": "zhishichanquanziliao_zhishichanquan-shenfenzheng",
+      "unicode": "e603",
+      "unicode_decimal": 58883
+    },
+    {
+      "icon_id": "8039248",
+      "name": "项目信息",
+      "font_class": "xiangmuxinxi",
+      "unicode": "e661",
+      "unicode_decimal": 58977
+    },
+    {
+      "icon_id": "1090745",
+      "name": "设备",
+      "font_class": "icon",
+      "unicode": "e69a",
+      "unicode_decimal": 59034
+    },
+    {
+      "icon_id": "7318940",
+      "name": "投入产出",
+      "font_class": "jixiaoguanli",
+      "unicode": "e60f",
+      "unicode_decimal": 58895
+    },
+    {
+      "icon_id": "5029",
+      "name": "列表",
+      "font_class": "liebiao",
+      "unicode": "e601",
+      "unicode_decimal": 58881
+    },
+    {
+      "icon_id": "3859727",
+      "name": "研究内容",
+      "font_class": "dabianyanjiuneirong",
+      "unicode": "e602",
+      "unicode_decimal": 58882
+    },
+    {
+      "icon_id": "6537190",
+      "name": "固定",
+      "font_class": "guding",
+      "unicode": "e66e",
+      "unicode_decimal": 58990
+    },
+    {
+      "icon_id": "11776602",
+      "name": "班主任",
+      "font_class": "banzhuren",
+      "unicode": "e61b",
+      "unicode_decimal": 58907
+    },
+    {
+      "icon_id": "22782353",
+      "name": "流动",
+      "font_class": "liudong",
+      "unicode": "e610",
+      "unicode_decimal": 58896
+    },
+    {
+      "icon_id": "978352",
+      "name": "信息列表",
+      "font_class": "xinxiliebiao",
+      "unicode": "e63d",
+      "unicode_decimal": 58941
+    },
+    {
+      "icon_id": "1376047",
+      "name": "基本信息",
+      "font_class": "jibenxinxi",
+      "unicode": "e619",
+      "unicode_decimal": 58905
+    },
+    {
+      "icon_id": "11520228",
+      "name": "接口",
+      "font_class": "jiekou",
+      "unicode": "e638",
+      "unicode_decimal": 58936
+    },
+    {
+      "icon_id": "666892",
+      "name": "系统菜单",
+      "font_class": "xitongcaidan",
+      "unicode": "e696",
+      "unicode_decimal": 59030
+    },
+    {
+      "icon_id": "12975227",
+      "name": "构建",
+      "font_class": "goujian",
+      "unicode": "e651",
+      "unicode_decimal": 58961
+    },
+    {
+      "icon_id": "24848379",
+      "name": "代码生成",
+      "font_class": "daimashengcheng",
+      "unicode": "e636",
+      "unicode_decimal": 58934
+    },
+    {
+      "icon_id": "623940",
+      "name": "审核",
+      "font_class": "shenhe",
+      "unicode": "e65b",
+      "unicode_decimal": 58971
+    },
+    {
+      "icon_id": "731583",
+      "name": "模板",
+      "font_class": "moban",
+      "unicode": "e635",
+      "unicode_decimal": 58933
+    },
+    {
+      "icon_id": "900157",
+      "name": "账号",
+      "font_class": "zhanghao",
+      "unicode": "e65f",
+      "unicode_decimal": 58975
+    },
+    {
+      "icon_id": "2129863",
+      "name": "修改申请",
+      "font_class": "xiugaishenqing",
+      "unicode": "e611",
+      "unicode_decimal": 58897
+    },
+    {
+      "icon_id": "3868271",
+      "name": "测试申请",
+      "font_class": "ceshishenqing",
+      "unicode": "eb61",
+      "unicode_decimal": 60257
+    },
+    {
+      "icon_id": "24847395",
+      "name": "上报",
+      "font_class": "shangchuan-copy",
+      "unicode": "e7a4",
+      "unicode_decimal": 59300
+    },
+    {
+      "icon_id": "11878039",
+      "name": "数据监控",
+      "font_class": "shujujiankong",
+      "unicode": "e655",
+      "unicode_decimal": 58965
+    },
+    {
+      "icon_id": "12896474",
+      "name": "定时任务",
+      "font_class": "dingshirenwu",
+      "unicode": "e621",
+      "unicode_decimal": 58913
+    },
+    {
+      "icon_id": "20853330",
+      "name": "服务监控",
+      "font_class": "fuwujiankong",
+      "unicode": "e6a3",
+      "unicode_decimal": 59043
+    },
+    {
+      "icon_id": "20853374",
+      "name": "在线用户",
+      "font_class": "zaixianyonghu",
+      "unicode": "e6ad",
+      "unicode_decimal": 59053
+    },
+    {
+      "icon_id": "24848420",
+      "name": "缓存监控",
+      "font_class": "huancunjiankong",
+      "unicode": "e637",
+      "unicode_decimal": 58935
+    },
+    {
+      "icon_id": "12694033",
+      "name": "日志管理",
+      "font_class": "rizhiguanli",
+      "unicode": "e60e",
+      "unicode_decimal": 58894
+    },
+    {
+      "icon_id": "570353",
+      "name": "通知公告",
+      "font_class": "tongzhigonggao",
+      "unicode": "e65e",
+      "unicode_decimal": 58974
+    },
+    {
+      "icon_id": "3978460",
+      "name": "登录日志",
+      "font_class": "denglurizhi",
+      "unicode": "e694",
+      "unicode_decimal": 59028
+    },
+    {
+      "icon_id": "8605754",
+      "name": "字典管理",
+      "font_class": "zidianguanli",
+      "unicode": "e668",
+      "unicode_decimal": 58984
+    },
+    {
+      "icon_id": "11409124",
+      "name": "部门管理",
+      "font_class": "bumenguanli",
       "unicode": "e608",
       "unicode": "e608",
       "unicode_decimal": 58888
       "unicode_decimal": 58888
+    },
+    {
+      "icon_id": "12694009",
+      "name": "操作日志",
+      "font_class": "caozuorizhi",
+      "unicode": "e60a",
+      "unicode_decimal": 58890
+    },
+    {
+      "icon_id": "12889884",
+      "name": "系统管理-菜单管理",
+      "font_class": "xitongguanli-caidanguanli",
+      "unicode": "e628",
+      "unicode_decimal": 58920
+    },
+    {
+      "icon_id": "12889885",
+      "name": "系统管理-角色管理",
+      "font_class": "xitongguanli-jiaoseguanli",
+      "unicode": "e627",
+      "unicode_decimal": 58919
+    },
+    {
+      "icon_id": "15643731",
+      "name": "参数设置",
+      "font_class": "canshushezhi",
+      "unicode": "e6ab",
+      "unicode_decimal": 59051
+    },
+    {
+      "icon_id": "18321645",
+      "name": "用户管理",
+      "font_class": "yonghuguanli",
+      "unicode": "e645",
+      "unicode_decimal": 58949
+    },
+    {
+      "icon_id": "20853332",
+      "name": "岗位管理",
+      "font_class": "gangweiguanli",
+      "unicode": "e6a4",
+      "unicode_decimal": 59044
+    },
+    {
+      "icon_id": "23245152",
+      "name": "党建_队伍建设",
+      "font_class": "dangjian_duiwujianshe",
+      "unicode": "e67d",
+      "unicode_decimal": 59005
+    },
+    {
+      "icon_id": "576281",
+      "name": "系统工具",
+      "font_class": "xitonggongju",
+      "unicode": "e674",
+      "unicode_decimal": 58996
+    },
+    {
+      "icon_id": "2204157",
+      "name": "员工,人员,结构、管理",
+      "font_class": "structuremanage",
+      "unicode": "e629",
+      "unicode_decimal": 58921
+    },
+    {
+      "icon_id": "2584374",
+      "name": "科研",
+      "font_class": "keyan",
+      "unicode": "e600",
+      "unicode_decimal": 58880
+    },
+    {
+      "icon_id": "2959021",
+      "name": "固定资产管理",
+      "font_class": "gudingzichanguanli",
+      "unicode": "e61d",
+      "unicode_decimal": 58909
+    },
+    {
+      "icon_id": "4161081",
+      "name": "绩效",
+      "font_class": "jixiao",
+      "unicode": "e605",
+      "unicode_decimal": 58885
+    },
+    {
+      "icon_id": "5056403",
+      "name": "活动时间",
+      "font_class": "huodongshijian",
+      "unicode": "e606",
+      "unicode_decimal": 58886
+    },
+    {
+      "icon_id": "5106733",
+      "name": "成果展示",
+      "font_class": "chengguozhanshi",
+      "unicode": "e659",
+      "unicode_decimal": 58969
+    },
+    {
+      "icon_id": "11372774",
+      "name": "首页",
+      "font_class": "shouye",
+      "unicode": "e8c6",
+      "unicode_decimal": 59590
+    },
+    {
+      "icon_id": "12694055",
+      "name": "系统管理",
+      "font_class": "xitongguanli",
+      "unicode": "e614",
+      "unicode_decimal": 58900
+    },
+    {
+      "icon_id": "14440235",
+      "name": "基本信息",
+      "font_class": "essential-information",
+      "unicode": "e612",
+      "unicode_decimal": 58898
+    },
+    {
+      "icon_id": "15562232",
+      "name": "学术管理",
+      "font_class": "xueshuguanli",
+      "unicode": "e77f",
+      "unicode_decimal": 59263
+    },
+    {
+      "icon_id": "24848551",
+      "name": "系统监控",
+      "font_class": "xitongjiankong",
+      "unicode": "e63c",
+      "unicode_decimal": 58940
     }
     }
   ]
   ]
 }
 }

binární
src/assets/icon/iconfont.ttf


binární
src/assets/icon/iconfont.woff


binární
src/assets/icon/iconfont.woff2


+ 5 - 4
src/components/admin-frame/Header.vue

@@ -12,8 +12,8 @@
           </el-col>
           </el-col>
           <el-col :span="12" class="right">
           <el-col :span="12" class="right">
             <i class="el-icon-user-solid"></i>
             <i class="el-icon-user-solid"></i>
-            <!-- <span>{{ user.name || '游客' }}</span> -->
-            <span>游客</span>
+            <span>{{ user.name || '游客' }}</span>
+            <!-- <span>游客</span> -->
             <el-button type="danger" size="mini" @click="logout">退出登录</el-button>
             <el-button type="danger" size="mini" @click="logout">退出登录</el-button>
           </el-col>
           </el-col>
         </el-col>
         </el-col>
@@ -24,7 +24,7 @@
 
 
 <script>
 <script>
 const { siteInfo } = require('../../layout/deploy/site');
 const { siteInfo } = require('../../layout/deploy/site');
-import { mapState, createNamespacedHelpers } from 'vuex';
+import { mapState, mapMutations, createNamespacedHelpers } from 'vuex';
 import bus from './bus';
 import bus from './bus';
 export default {
 export default {
   name: 'Header',
   name: 'Header',
@@ -35,6 +35,7 @@ export default {
   },
   },
   created() {},
   created() {},
   methods: {
   methods: {
+    ...mapMutations(['deleteUser']),
     // 侧边栏折叠
     // 侧边栏折叠
     collapseChage() {
     collapseChage() {
       this.collapse = !this.collapse;
       this.collapse = !this.collapse;
@@ -42,7 +43,7 @@ export default {
     },
     },
     // 退出登录
     // 退出登录
     logout() {
     logout() {
-      localStorage.removeItem('token');
+      this.deleteUser();
       this.$router.push('/login');
       this.$router.push('/login');
     },
     },
   },
   },

+ 32 - 12
src/components/admin-frame/Sidebar.vue

@@ -13,26 +13,46 @@
             unique-opened
             unique-opened
             router
             router
           >
           >
-            <template v-for="item in items">
-              <template v-if="item.subs">
-                <el-submenu :index="item.index" :key="item.index">
+            <template v-for="item in menuList">
+              <!-- 二级菜单 -->
+              <template v-if="item.type === '0'">
+                <el-submenu :index="item._id" :key="item._id">
                   <template slot="title">
                   <template slot="title">
                     <i :class="['iconfont', item.icon]"></i>
                     <i :class="['iconfont', item.icon]"></i>
-                    <span slot="title">{{ item.title }}</span>
+                    <span slot="title">{{ item.name }}</span>
                   </template>
                   </template>
-                  <template v-for="subItem in item.subs">
-                    <el-submenu v-if="subItem.subs" :index="subItem.index" :key="subItem.index">
-                      <template slot="title">{{ subItem.title }}</template>
-                      <el-menu-item v-for="(threeItem, i) in subItem.subs" :key="i" :index="threeItem.index">{{ threeItem.title }}</el-menu-item>
+                  <template v-for="subItem in item.children">
+                    <!-- 三级菜单 -->
+                    <el-submenu
+                      v-if="subItem.children && subItem.children.length > 0 && subItem.children.every(f => f.type === '0' || f.type === '1')"
+                      :index="subItem._id"
+                      :key="subItem._id"
+                    >
+                      <template slot="title">
+                        <i :class="['iconfont', subItem.icon]"></i>
+                        <span slot="title">{{ subItem.name }}</span>
+                      </template>
+                      <el-menu-item v-for="(threeItem, i) in subItem.children" :key="i" :index="threeItem.path">
+                        <template slot="title">
+                          <i :class="['iconfont', threeItem.icon]"></i>
+                          <span slot="title">{{ threeItem.name }}</span>
+                        </template>
+                      </el-menu-item>
                     </el-submenu>
                     </el-submenu>
-                    <el-menu-item v-else :index="subItem.index" :key="subItem.index">{{ subItem.title }}</el-menu-item>
+                    <el-menu-item v-else :index="subItem.path" :key="subItem.path">
+                      <template slot="title">
+                        <i :class="['iconfont', subItem.icon]"></i>
+                        <span slot="title">{{ subItem.name }}</span>
+                      </template>
+                    </el-menu-item>
                   </template>
                   </template>
                 </el-submenu>
                 </el-submenu>
               </template>
               </template>
+              <!-- 一级菜单 -->
               <template v-else>
               <template v-else>
-                <el-menu-item class="first" :index="item.index" :key="item.index">
+                <el-menu-item class="first" :index="item.path" :key="item.path">
                   <i :class="['iconfont', item.icon]"></i>
                   <i :class="['iconfont', item.icon]"></i>
-                  <span slot="title">{{ item.title }}</span>
+                  <span slot="title">{{ item.name }}</span>
                 </el-menu-item>
                 </el-menu-item>
               </template>
               </template>
             </template>
             </template>
@@ -74,7 +94,7 @@ export default {
     },
     },
   },
   },
   computed: {
   computed: {
-    ...mapState(['user']),
+    ...mapState(['user', 'menuList']),
     onRoutes() {
     onRoutes() {
       return this.$route.path;
       return this.$route.path;
     },
     },

+ 49 - 0
src/components/frame/e-dialog.vue

@@ -0,0 +1,49 @@
+<template>
+  <div id="e-dialog">
+    <el-dialog :title="dialog.title" :visible.sync="dialog.show" width="40%" :before-close="toClose" :close-on-click-modal="false" :append-to-body="true">
+      <slot name="info"></slot>
+    </el-dialog>
+  </div>
+</template>
+
+<script>
+import { mapState, createNamespacedHelpers } from 'vuex';
+export default {
+  name: 'e-dialog',
+  props: {
+    dialog: { type: Object, default: () => {} },
+  },
+  components: {},
+  data: function() {
+    return {};
+  },
+  created() {},
+  methods: {
+    toClose() {
+      this.$emit('toClose');
+    },
+  },
+  computed: {
+    ...mapState(['user']),
+  },
+  metaInfo() {
+    return { title: this.$route.meta.title };
+  },
+  watch: {
+    test: {
+      deep: true,
+      immediate: true,
+      handler(val) {},
+    },
+  },
+};
+</script>
+
+<style lang="less" scoped>
+/deep/.el-dialog__body {
+  padding: 10px;
+  min-height: 30px;
+  max-height: 400px;
+  overflow-y: auto;
+}
+</style>

+ 15 - 12
src/components/frame/filter-page-table.vue

@@ -1,8 +1,8 @@
 <template>
 <template>
   <div id="data-table">
   <div id="data-table">
-    <el-form :model="searchInfo" :inline="true" style="padding:0.9rem·1.875rem" size="mini" v-if="useFilter">
-      <el-row type="flex">
-        <el-col :span="22">
+    <el-form :model="searchInfo" :inline="true" style="padding:8px 0" size="mini">
+      <el-row type="flex" justify="end">
+        <el-col :span="22" v-if="useFilter">
           <el-form-item v-for="(item, index) in filterList" :key="index">
           <el-form-item v-for="(item, index) in filterList" :key="index">
             <template v-if="item.filter === 'select'">
             <template v-if="item.filter === 'select'">
               <el-select
               <el-select
@@ -59,7 +59,7 @@
       @row-click="rowClick"
       @row-click="rowClick"
       :summary-method="computedSum"
       :summary-method="computedSum"
     >
     >
-      <el-table-column type="selection" width="55" v-if="select" prop="id" :reserve-selection="true"> </el-table-column>
+      <el-table-column type="selection" width="55" v-if="select" prop="_id" :reserve-selection="true"> </el-table-column>
       <template v-for="(item, index) in fields">
       <template v-for="(item, index) in fields">
         <template v-if="!item.notable">
         <template v-if="!item.notable">
           <template v-if="item.custom">
           <template v-if="item.custom">
@@ -76,7 +76,7 @@
               :label="item.label"
               :label="item.label"
               :prop="item.prop"
               :prop="item.prop"
               :formatter="toFormatter"
               :formatter="toFormatter"
-              sortable
+              :sortable="sortable"
               v-bind="item.options"
               v-bind="item.options"
               :show-overflow-tooltip="item.showTip || true"
               :show-overflow-tooltip="item.showTip || true"
             >
             >
@@ -109,7 +109,7 @@
                   size="mini"
                   size="mini"
                   style="padding-right:10px"
                   style="padding-right:10px"
                   :underline="false"
                   :underline="false"
-                  @click="handleOpera(row, item.method, item.confirm, item.methodZh, item.label, $index)"
+                  @click="handleOpera(row, item.method, item.confirm, item.methodZh, item.label, $index, item.confirmWord)"
                 >
                 >
                   {{ item.label }}
                   {{ item.label }}
                 </el-link>
                 </el-link>
@@ -158,6 +158,7 @@ export default {
     sumres: { type: String, default: 'total' },
     sumres: { type: String, default: 'total' },
     filter: { type: Array, default: () => [] },
     filter: { type: Array, default: () => [] },
     operaWidth: { type: Number, default: 200 },
     operaWidth: { type: Number, default: 200 },
+    sortable: { type: Boolean, default: true },
     limit: { type: Number, default: _.get(this, `$limit`, undefined) !== undefined ? this.$limit : process.env.VUE_APP_LIMIT * 1 || 10 },
     limit: { type: Number, default: _.get(this, `$limit`, undefined) !== undefined ? this.$limit : process.env.VUE_APP_LIMIT * 1 || 10 },
   },
   },
   components: {},
   components: {},
@@ -190,7 +191,7 @@ export default {
         } else return cellValue;
         } else return cellValue;
       }
       }
     },
     },
-    handleOpera(data, method, confirm = false, methodZh, label, index) {
+    handleOpera(data, method, confirm = false, methodZh, label, index, confirmWord) {
       let self = true;
       let self = true;
       if (_.isFunction(methodZh)) {
       if (_.isFunction(methodZh)) {
         methodZh = methodZh(data);
         methodZh = methodZh(data);
@@ -199,7 +200,9 @@ export default {
         self = false;
         self = false;
       }
       }
       if (confirm) {
       if (confirm) {
-        this.$confirm(self ? methodZh : `您确认${methodZh}该数据?`, '提示', {
+        let word = self ? methodZh : `您确认${methodZh}该数据?`;
+        if (confirmWord) word = confirmWord;
+        this.$confirm(word, '提示', {
           confirmButtonText: '确定',
           confirmButtonText: '确定',
           cancelButtonText: '取消',
           cancelButtonText: '取消',
           type: 'warning',
           type: 'warning',
@@ -224,7 +227,7 @@ export default {
         res = this.pageSelected;
         res = this.pageSelected;
       }
       }
       this.$set(this, `pageSelected`, res);
       this.$set(this, `pageSelected`, res);
-      this.$emit(`handleSelect`, _.uniqBy(res, 'id'));
+      this.$emit(`handleSelect`, _.uniqBy(res, '_id'));
     },
     },
     handleSelectAll(selection) {
     handleSelectAll(selection) {
       //处于没全选状态,选择之后一定是全选,只有处于全选状态时,才会反选(全取消)
       //处于没全选状态,选择之后一定是全选,只有处于全选状态时,才会反选(全取消)
@@ -232,10 +235,10 @@ export default {
       let res = [];
       let res = [];
       if (selection.length > 0) {
       if (selection.length > 0) {
         //全选
         //全选
-        res = _.uniqBy(this.pageSelected.concat(selection), 'id');
+        res = _.uniqBy(this.pageSelected.concat(selection), '_id');
       } else {
       } else {
         //全取消
         //全取消
-        res = _.differenceBy(this.pageSelected, this.data, 'id');
+        res = _.differenceBy(this.pageSelected, this.data, '_id');
       }
       }
       this.$set(this, `pageSelected`, res);
       this.$set(this, `pageSelected`, res);
       this.$emit(`handleSelect`, res);
       this.$emit(`handleSelect`, res);
@@ -244,7 +247,7 @@ export default {
       this.$nextTick(() => {
       this.$nextTick(() => {
         this.$refs.table.clearSelection();
         this.$refs.table.clearSelection();
         this.selected.forEach(info => {
         this.selected.forEach(info => {
-          let d = this.data.filter(p => p.id === info.id);
+          let d = this.data.filter(p => p._id === info._id);
           if (d.length > 0) this.$refs.table.toggleRowSelection(d[0]);
           if (d.length > 0) this.$refs.table.toggleRowSelection(d[0]);
         });
         });
       });
       });

+ 130 - 0
src/components/frame/s-upload.vue

@@ -0,0 +1,130 @@
+<template>
+  <div id="upload">
+    <el-upload
+      v-if="url"
+      ref="upload"
+      :action="url"
+      :list-type="listType"
+      :file-list="fileList"
+      :limit="limit"
+      :on-exceed="outLimit"
+      :on-preview="handlePictureCardPreview"
+      :before-remove="beforeRemove"
+      :on-success="onSuccess"
+      :before-upload="beforeUpload"
+      :show-file-list="showList"
+      :accept="accept"
+    >
+      <el-button size="small" type="primary" v-if="isBtn">点击上传</el-button>
+      <template v-else-if="uploadBtn">
+        <el-button type="danger">选择文件</el-button>
+      </template>
+      <template v-else>
+        <el-button type="primary" size="mini">选择文件</el-button>
+      </template>
+      <template #tip v-if="tip">
+        {{ tip }}
+      </template>
+    </el-upload>
+    <el-dialog :visible.sync="dialogVisible" append-to-body>
+      <img width="100%" :src="dialogImageUrl" alt="" />
+    </el-dialog>
+  </div>
+</template>
+
+<script>
+import _ from 'lodash';
+export default {
+  name: 'upload',
+  props: {
+    url: { type: null },
+    limit: { type: Number },
+    data: { type: null },
+    type: { type: String },
+    isBtn: { type: Boolean, default: false },
+    uploadBtn: { type: Boolean, default: false },
+    showList: { type: Boolean, default: true },
+    accept: { type: String, default: '' },
+    tip: { type: String, default: undefined },
+    listType: { type: String, default: 'picture-card' },
+    file_type: { type: String, default: 'jpeg' },
+  },
+  components: {},
+  data: () => ({
+    dialogVisible: false,
+    dialogImageUrl: '',
+    fileList: [],
+  }),
+  created() {
+    if (this.data) {
+      this.defalutProcess(this.data);
+    }
+  },
+  watch: {
+    data: {
+      handler(val) {
+        this.defalutProcess(val);
+      },
+    },
+  },
+  computed: {},
+  methods: {
+    handlePictureCardPreview(file) {
+      this.dialogImageUrl = file.url;
+      this.dialogVisible = true;
+    },
+    beforeRemove(file) {
+      // this.$set(this, `fileList`, []);
+      // let index = fileList.findIndex(f => _.isEqual(f, file));
+      this.$emit('delete', { file: file, type: this.type });
+      return false;
+    },
+    outLimit() {
+      this.$message.error(`只允许上传${this.limit}个文件`);
+    },
+    onSuccess(response, file, fileList) {
+      //将文件整理好传回父组件
+      this.$emit('upload', { type: this.type, data: { ...response, name: file.name } });
+    },
+    beforeUpload(file) {
+      let setting_type = this.file_type.split('|');
+      let file_type = file.type.split('/')[1];
+      let isType = false;
+      for (const val of setting_type) {
+        if (val == file_type) isType = true;
+      }
+      // 文件大小改为10Mb
+      const isLt20M = file.size / 1024 / 1024 < 10;
+      // if (!isType) {
+      //   this.$message.error('图片格式不正确');
+      // }
+      if (!isLt20M) {
+        this.$message.error('文件超出10M');
+      }
+      return isLt20M;
+    },
+    defalutProcess(val) {
+      if (_.isArray(val)) {
+        let newArr = val.map(item => {
+          let object = {};
+          object.name = item.name;
+          object.url = item.url;
+          return object;
+        });
+        this.$set(this, `fileList`, newArr);
+      } else if (_.isObject(val)) {
+        let object = {};
+        if (_.get(val, `url`)) {
+          object.name = val.name;
+          object.url = val.url;
+          this.$set(this, `fileList`, [object]);
+        }
+      } else if (typeof val === 'string') {
+        this.$set(this, `fileList`, [{ name: '附件', url: val }]);
+      }
+    },
+  },
+};
+</script>
+
+<style lang="less" scoped></style>

+ 0 - 0
src/layout/deploy/dict.js


+ 9 - 8
src/layout/deploy/menu.js

@@ -1,13 +1,14 @@
-export const system = [{ icon: 'icon-shouye', index: '/adminCenter/homeIndex', title: '系统首页' }];
-export const userMenu = [
+export const system = [
   {
   {
-    icon: 'icon-ceshi',
-    index: '/adminCenter/test/index',
-    title: '测试页面',
+    icon: 'icon-shouye',
+    index: '/adminCenter/homeIndex',
+    title: '系统首页',
   },
   },
+];
+export const userMenu = [
   {
   {
-    icon: 'icon-ceshi',
-    index: '/adminCenter/statistics/index',
-    title: '绩效目标表',
+    icon: 'icon-shouye',
+    index: '/adminCenter/test',
+    title: '测试页面',
   },
   },
 ];
 ];

+ 1 - 1
src/layout/deploy/site.js

@@ -1,7 +1,7 @@
 // 网站基本设置
 // 网站基本设置
 export const siteInfo = {
 export const siteInfo = {
   display: true,
   display: true,
-  zhTitle: '长春市福瑞科技有限公司',
+  zhTitle: '白山市边境卷烟打假打私协同平台',
   enTitle: 'Changchun Furui Technology Co., Ltd',
   enTitle: 'Changchun Furui Technology Co., Ltd',
   logo_url: require('../../assets/logo.png'),
   logo_url: require('../../assets/logo.png'),
 };
 };

+ 7 - 8
src/store/test.js

@@ -3,7 +3,7 @@ import Vuex from 'vuex';
 import _ from 'lodash';
 import _ from 'lodash';
 Vue.use(Vuex);
 Vue.use(Vuex);
 const api = {
 const api = {
-  test: `/api/serviceStudy/test`,
+  test: `/tobaccoAdmin/api/test`,
 };
 };
 const state = () => ({});
 const state = () => ({});
 const mutations = {};
 const mutations = {};
@@ -17,19 +17,18 @@ const actions = {
     });
     });
     return res;
     return res;
   },
   },
-  async create({ commit }, payload) {
-    const res = await this.$axios.$post(`${api.test}`, payload);
-    return res;
-  },
   async fetch({ commit }, payload) {
   async fetch({ commit }, payload) {
     const res = await this.$axios.$get(`${api.test}/${payload}`);
     const res = await this.$axios.$get(`${api.test}/${payload}`);
     return res;
     return res;
   },
   },
-  async update({ commit }, { id, ...data }) {
-    const res = await this.$axios.$post(`${api.test}/update/${id}`, data);
+  async create({ commit }, payload) {
+    const res = await this.$axios.$post(`${api.test}`, payload);
+    return res;
+  },
+  async update({ commit }, { _id, ...info } = {}) {
+    const res = await this.$axios.$post(`${api.test}/${_id}`, { ...info });
     return res;
     return res;
   },
   },
-
   async delete({ commit }, payload) {
   async delete({ commit }, payload) {
     const res = await this.$axios.$delete(`${api.test}/${payload}`);
     const res = await this.$axios.$delete(`${api.test}/${payload}`);
     return res;
     return res;

+ 8 - 2
src/store/user/mutations.js

@@ -29,6 +29,12 @@ export const setUser = (state, payload) => {
 
 
 export const deleteUser = (state, payload) => {
 export const deleteUser = (state, payload) => {
   state.user = {};
   state.user = {};
-  localStorage.removeItem('token');
-  localStorage.removeItem('type');
+  state.menuList = [];
+  state.isLoadMenu = false;
+  sessionStorage.removeItem('token');
 };
 };
+
+// export const addMenu = (state, payload) => {
+//   state.menuList = payload;
+//   state.isLoadMenu = true;
+// };

+ 1 - 0
src/store/user/state.js

@@ -1,2 +1,3 @@
 export const user = {};
 export const user = {};
 export const menuList = [];
 export const menuList = [];
+export const isLoadMenu = false;

+ 32 - 0
table.js

@@ -0,0 +1,32 @@
+'use strict';
+module.exports = [
+  { key: 'ActivitiesTimes', zh: '实验室活动时间表' },
+  { key: 'BasicInformation', zh: '基础信息' },
+  { key: 'BearScience', zh: '承担科研任务' },
+  { key: 'BearScienceUsers', zh: '承担科研任务参加人表' },
+  { key: 'ChiefAssistant', zh: '主任及科研助理' },
+  { key: 'Committee', zh: '学术委员会' },
+  { key: 'Dpr', zh: '方向与人员(核心人员)关系表' },
+  { key: 'Equipment', zh: '设备情况' },
+  { key: 'File', zh: '文件表' },
+  { key: 'FileModule', zh: '模块文件表' },
+  { key: 'FixedInput', zh: '固定投入' },
+  { key: 'FixedPersonnel', zh: '固定人员' },
+  { key: 'FlowPersonnel', zh: '流动人员' },
+  { key: 'InputNumb', zh: '实验室填写情况' },
+  { key: 'Laiyuan', zh: '项目来源' },
+  { key: 'Lor', zh: '发表/提交报告' },
+  { key: 'Losc', zh: '科普活动' },
+  { key: 'Loso', zh: '省级及以上活动' },
+  { key: 'Lote', zh: '技术服务、转移、检测' },
+  { key: 'Outcome', zh: '重要成果' },
+  { key: 'RanksDoctor', zh: '博硕培养' },
+  { key: 'RanksPerson', zh: '省部级及以上人才称号' },
+  { key: 'RanksTitle', zh: '职称晋升' },
+  { key: 'ResearchDirection', zh: '研究方向' },
+  { key: 'Soa', zh: '制定标准明细' },
+  { key: 'Sopaper', zh: '发表论文情况' },
+  { key: 'Sopatent', zh: '获奖情况' },
+  { key: 'Sopu', zh: '获奖情况人员' },
+  { key: 'Soro', zh: '其他成果' },
+];

+ 117 - 0
util/axios-wrapper.js

@@ -0,0 +1,117 @@
+/* eslint-disable no-console */
+/* eslint-disable no-param-reassign */
+
+import _ from 'lodash';
+import Axios from 'axios';
+import { Util, Error } from 'naf-core';
+// import { Indicator } from 'mint-ui';
+import util from './user-util';
+
+const { trimData, isNullOrUndefined } = Util;
+const { ErrorCode } = Error;
+
+let currentRequests = 0;
+
+export default class AxiosWrapper {
+  constructor({ baseUrl = '', unwrap = true } = {}) {
+    this.baseUrl = baseUrl;
+    this.unwrap = unwrap;
+  }
+
+  // 替换uri中的参数变量
+  static merge(uri, query = {}) {
+    if (!uri.includes(':')) {
+      return uri;
+    }
+    const keys = [];
+    const regexp = /\/:([a-z0-9_]+)/gi;
+    let res;
+    // eslint-disable-next-line no-cond-assign
+    while ((res = regexp.exec(uri)) != null) {
+      keys.push(res[1]);
+    }
+    keys.forEach((key) => {
+      if (!isNullOrUndefined(query[key])) {
+        uri = uri.replace(`:${key}`, query[key]);
+      }
+    });
+    return uri;
+  }
+
+  $get(uri, query, options) {
+    return this.$request(uri, null, query, options);
+  }
+
+  $post(uri, data = {}, query, options) {
+    return this.$request(uri, data, query, options);
+  }
+  $delete(uri, data = {}, router, query, options = {}) {
+    options = { ...options, method: 'delete' };
+    return this.$request(uri, data, query, options, router);
+  }
+  async $request(uri, data, query, options) {
+    // TODO: 合并query和options
+    if (_.isObject(query) && _.isObject(options)) {
+      options = { ...options, params: query, method: 'get' };
+    } else if (_.isObject(query) && !query.params) {
+      options = { params: query };
+    } else if (_.isObject(query) && query.params) {
+      options = query;
+    }
+    if (!options) options = {};
+    if (options.params) options.params = trimData(options.params);
+    const url = AxiosWrapper.merge(uri, options.params);
+    currentRequests += 1;
+    // Indicator.open({
+    //   spinnerType: 'fading-circle',
+    // });
+
+    try {
+      const axios = Axios.create({
+        baseURL: this.baseUrl,
+      });
+      axios.defaults.headers.common.Authorization = util.token;
+      let res = await axios.request({
+        method: isNullOrUndefined(data) ? 'get' : 'post',
+        url,
+        data,
+        responseType: 'json',
+        ...options,
+      });
+      res = res.data;
+      const { errcode, errmsg, details } = res;
+      if (errcode) {
+        console.warn(`[${uri}] fail: ${errcode}-${errmsg} ${details}`);
+        return res;
+      }
+      // unwrap data
+      if (this.unwrap) {
+        res = _.omit(res, ['errmsg', 'details']);
+        const keys = Object.keys(res);
+        if (keys.length === 1 && keys.includes('data')) {
+          res = res.data;
+        }
+      }
+      return res;
+    } catch (err) {
+      let errmsg = '接口请求失败,请稍后重试';
+      if (err.response) {
+        const { status } = err.response;
+        if (status === 401) errmsg = '用户认证失败,请重新登录';
+        if (status === 403) errmsg = '当前用户不允许执行该操作';
+      }
+      console.error(
+        `[AxiosWrapper] 接口请求失败: ${err.config && err.config.url} - 
+        ${err.message}`
+      );
+      return { errcode: ErrorCode.SERVICE_FAULT, errmsg, details: err.message };
+    } finally {
+      /* eslint-disable */
+      currentRequests -= 1;
+      if (currentRequests <= 0) {
+        currentRequests = 0;
+        // Indicator.close();
+      }
+    }
+  }
+}

+ 50 - 0
util/methods-util.js

@@ -0,0 +1,50 @@
+import { Util } from 'naf-core';
+
+const { isNullOrUndefined } = Util;
+
+export default {
+  //判断信息是否过期
+  isDateOff(dataDate) {
+    const now = new Date(new Date().getTime() - 24 * 60 * 60 * 1000);
+    dataDate = new Date(dataDate);
+    return now.getTime() <= dataDate.getTime();
+  },
+  //判断企业是否可以执行此动作/显示
+  checkCorp(data) {
+    const { role, unit, selfUnit, status, displayType, userid } = data;
+    if (!isNullOrUndefined(selfUnit) && !isNullOrUndefined(status)) {
+      return role === 'corp' && selfUnit === unit && status === '0';
+    } else if (!isNullOrUndefined(displayType)) {
+      if (role === 'corp') {
+        return role === displayType;
+      } else {
+        return role === displayType && !isNullOrUndefined(userid);
+      }
+    }
+  },
+  //获取url的参数params
+  getParams() {
+    let str = location.href;
+    let num = str.indexOf('?');
+    const param = {};
+    str = str.substr(num + 1);
+    let num2 = str.indexOf('#');
+    let str2 = '';
+    if (num2 > 0) {
+      str2 = str.substr(0, num2);
+    } else {
+      num2 = str.indexOf('/');
+      str2 = str.substr(0, num2);
+    }
+    const arr = str2.split('&');
+    for (let i = 0; i < arr.length; i++) {
+      num = arr[i].indexOf('=');
+      if (num > 0) {
+        const name = arr[i].substring(0, num);
+        const value = arr[i].substr(num + 1);
+        param[name] = decodeURI(value);
+      }
+    }
+    return param;
+  },
+};

+ 69 - 0
util/user-util.js

@@ -0,0 +1,69 @@
+/* eslint-disable no-console */
+export default {
+  get user() {
+    const val = sessionStorage.getItem('user');
+    try {
+      if (val) return JSON.parse(val);
+    } catch (err) {
+      console.error(err);
+    }
+    return null;
+  },
+  set user(userinfo) {
+    sessionStorage.setItem('user', JSON.stringify(userinfo));
+  },
+  get token() {
+    return sessionStorage.getItem('token');
+  },
+  set token(token) {
+    sessionStorage.setItem('token', token);
+  },
+  get openid() {
+    return sessionStorage.getItem('openid');
+  },
+  set openid(openid) {
+    sessionStorage.setItem('openid', openid);
+  },
+  get isGuest() {
+    return !this.user || this.user.role === 'guest';
+  },
+  save({ userinfo, token }) {
+    sessionStorage.setItem('user', JSON.stringify(userinfo));
+    sessionStorage.setItem('token', token);
+  },
+
+  get corpInfo() {
+    const val = sessionStorage.getItem('corpInfo');
+    if (val) return JSON.parse(val);
+    return null;
+  },
+  set corpInfo(corpInfo) {
+    sessionStorage.setItem('corpInfo', JSON.stringify(corpInfo));
+  },
+  saveCorpInfo(corpInfo) {
+    sessionStorage.setItem('corpInfo', JSON.stringify(corpInfo));
+  },
+
+  get unit() {
+    const val = sessionStorage.getItem('unit');
+    if (val) return JSON.parse(val);
+    return null;
+  },
+  set unit(unitList) {
+    sessionStorage.setItem('unit', JSON.stringify(unitList));
+  },
+  saveUnit(unitList) {
+    sessionStorage.setItem('unit', JSON.stringify(unitList));
+  },
+  get userInfo() {
+    const val = sessionStorage.getItem('userInfo');
+    if (val) return JSON.parse(val);
+    return null;
+  },
+  set userInfo(userInfo) {
+    sessionStorage.setItem('userInfo', JSON.stringify(userInfo));
+  },
+  saveUserInfo(userInfo) {
+    sessionStorage.setItem('userInfo', JSON.stringify(userInfo));
+  },
+};