Browse Source

更新网站基本设置

guhongwei 5 years ago
parent
commit
aa24e6cf0d
4 changed files with 48 additions and 33 deletions
  1. 23 12
      src/layout/index/menuInfo.vue
  2. 6 0
      src/router/index.js
  3. 0 21
      src/store/site.js
  4. 19 0
      src/views/resource/resource.vue

+ 23 - 12
src/layout/index/menuInfo.vue

@@ -2,15 +2,23 @@
   <div id="menuInfo">
   <div id="menuInfo">
     <el-row>
     <el-row>
       <el-col :span="24" class="menu">
       <el-col :span="24" class="menu">
-        <el-menu :default-active="activeIndex" class="el-menu-demo" mode="horizontal" @select="handleSelect" text-color="#fff">
-          <el-menu-item index="1">网站首页</el-menu-item>
-          <el-menu-item index="2">科技政务</el-menu-item>
-          <el-menu-item index="3">科技政策</el-menu-item>
-          <el-menu-item index="4">科技超市</el-menu-item>
-          <el-menu-item index="5">科技数据</el-menu-item>
-          <el-menu-item index="6">科技服务</el-menu-item>
-          <el-menu-item index="7">科技资源</el-menu-item>
-          <el-menu-item index="8">科技人才</el-menu-item>
+        <el-menu
+          :default-active="thisRouter()"
+          class="el-menu-demo"
+          mode="horizontal"
+          :router="false"
+          :default-openeds="defalutMenu"
+          @select="to"
+          text-color="#fff"
+        >
+          <el-menu-item index="/">网站首页</el-menu-item>
+          <el-menu-item index="/government/government">科技政务</el-menu-item>
+          <el-menu-item index="/policy/policy">科技政策</el-menu-item>
+          <el-menu-item index="/supermaket/supermarket">科技超市</el-menu-item>
+          <el-menu-item index="/shuju/shuju">科技数据</el-menu-item>
+          <el-menu-item index="/service/service">科技服务</el-menu-item>
+          <el-menu-item index="/resource/resource">科技资源</el-menu-item>
+          <el-menu-item index="/personnel/personnel">科技人才</el-menu-item>
         </el-menu>
         </el-menu>
       </el-col>
       </el-col>
     </el-row>
     </el-row>
@@ -23,13 +31,16 @@ export default {
   props: {},
   props: {},
   components: {},
   components: {},
   data: () => ({
   data: () => ({
-    activeIndex: '1',
+    defalutMenu: [],
   }),
   }),
   created() {},
   created() {},
   computed: {},
   computed: {},
   methods: {
   methods: {
-    handleSelect(key, keyPath) {
-      console.log(key, keyPath);
+    thisRouter() {
+      console.log(this.$route.path);
+    },
+    to(index) {
+      this.$router.push({ path: index });
     },
     },
   },
   },
 };
 };

+ 6 - 0
src/router/index.js

@@ -87,6 +87,12 @@ const routes = [
     name: 'service',
     name: 'service',
     component: () => import('../views/service/service.vue'),
     component: () => import('../views/service/service.vue'),
   },
   },
+  // 科技资源
+  {
+    path: '/resource/resource',
+    name: 'service',
+    component: () => import('../views/resource/resource.vue'),
+  },
   //登录和注册
   //登录和注册
   {
   {
     path: '/login',
     path: '/login',

+ 0 - 21
src/store/site.js

@@ -3,37 +3,16 @@ import Vuex from 'vuex';
 import _ from 'lodash';
 import _ from 'lodash';
 Vue.use(Vuex);
 Vue.use(Vuex);
 const api = {
 const api = {
-  site: `/api/setting/set`,
   shows: `/api/setting/set/show`,
   shows: `/api/setting/set/show`,
 };
 };
 const state = () => ({});
 const state = () => ({});
 const mutations = {};
 const mutations = {};
 
 
 const actions = {
 const actions = {
-  async query({ commit }, { skip = 0, limit, ...info } = {}) {
-    const res = await this.$axios.$get(`${api.site}`, { skip, limit, ...info });
-    return res;
-  },
   async showInfo({ commit }, { ...info } = {}) {
   async showInfo({ commit }, { ...info } = {}) {
     const res = await this.$axios.$get(`${api.shows}`, { ...info });
     const res = await this.$axios.$get(`${api.shows}`, { ...info });
     return res;
     return res;
   },
   },
-  async create({ commit }, payload) {
-    const res = await this.$axios.$post(`${api.site}`, payload);
-    return res;
-  },
-  async fetch({ commit }, payload) {
-    const res = await this.$axios.$get(`${api.site}/${payload}`);
-    return res;
-  },
-  async update({ commit }, { id, ...data }) {
-    const res = await this.$axios.$post(`${api.site}/update/${id}`, data);
-    return res;
-  },
-  async delete({ commit }, payload) {
-    const res = await this.$axios.$delete(`${api.site}/${payload}`);
-    return res;
-  },
 };
 };
 export default {
 export default {
   namespaced: true,
   namespaced: true,

+ 19 - 0
src/views/resource/resource.vue

@@ -0,0 +1,19 @@
+<template>
+  <div id="resource">
+    <p>科技资源,地图形式</p>
+  </div>
+</template>
+
+<script>
+export default {
+  name: 'resource',
+  props: {},
+  components: {},
+  data: () => ({}),
+  created() {},
+  computed: {},
+  methods: {},
+};
+</script>
+
+<style lang="less" scoped></style>