lrf402788946 5 vuotta sitten
vanhempi
commit
8ffea0bea4

+ 3 - 13
src/App.vue

@@ -1,7 +1,5 @@
 <template>
-  <div id="App" :style="`background:url(${bg}) no-repeat fixed;background-size: 100% 100%;`">
-    <router-view />
-  </div>
+  <router-view />
 </template>
 
 <script>
@@ -10,17 +8,9 @@ export default {
   name: 'App',
   props: {},
   components: {},
-  data: () => ({
-    bg: require('@/assets/home/bg.jpg'),
-  }),
+  data: () => ({}),
   created() {},
-  computed: {
-    isSubSite() {
-      let route = this.$route;
-      let res = _.get(route, 'meta.subSite', false);
-      return res;
-    },
-  },
+  computed: {},
   methods: {},
 };
 </script>

BIN
src/assets/cha.png


BIN
src/assets/dian1.jpg


BIN
src/assets/dian2.jpg


BIN
src/assets/dian3.jpg


BIN
src/assets/dian4.jpg


BIN
src/assets/dian5.jpg


BIN
src/assets/dian6.jpg


BIN
src/assets/diaocha.gif


BIN
src/assets/swfl.png


+ 0 - 130
src/components/HelloWorld.vue

@@ -1,130 +0,0 @@
-<template>
-  <div class="hello">
-    <h1>{{ msg }}</h1>
-    <p>
-      For a guide and recipes on how to configure / customize this project,<br />
-      check out the
-      <a href="https://cli.vuejs.org" target="_blank" rel="noopener"
-        >vue-cli documentation</a
-      >.
-    </p>
-    <h3>Installed CLI Plugins</h3>
-    <ul>
-      <li>
-        <a
-          href="https://github.com/vuejs/vue-cli/tree/dev/packages/%40vue/cli-plugin-babel"
-          target="_blank"
-          rel="noopener"
-          >babel</a
-        >
-      </li>
-      <li>
-        <a
-          href="https://github.com/vuejs/vue-cli/tree/dev/packages/%40vue/cli-plugin-router"
-          target="_blank"
-          rel="noopener"
-          >router</a
-        >
-      </li>
-      <li>
-        <a
-          href="https://github.com/vuejs/vue-cli/tree/dev/packages/%40vue/cli-plugin-vuex"
-          target="_blank"
-          rel="noopener"
-          >vuex</a
-        >
-      </li>
-      <li>
-        <a
-          href="https://github.com/vuejs/vue-cli/tree/dev/packages/%40vue/cli-plugin-eslint"
-          target="_blank"
-          rel="noopener"
-          >eslint</a
-        >
-      </li>
-    </ul>
-    <h3>Essential Links</h3>
-    <ul>
-      <li>
-        <a href="https://vuejs.org" target="_blank" rel="noopener">Core Docs</a>
-      </li>
-      <li>
-        <a href="https://forum.vuejs.org" target="_blank" rel="noopener"
-          >Forum</a
-        >
-      </li>
-      <li>
-        <a href="https://chat.vuejs.org" target="_blank" rel="noopener"
-          >Community Chat</a
-        >
-      </li>
-      <li>
-        <a href="https://twitter.com/vuejs" target="_blank" rel="noopener"
-          >Twitter</a
-        >
-      </li>
-      <li>
-        <a href="https://news.vuejs.org" target="_blank" rel="noopener">News</a>
-      </li>
-    </ul>
-    <h3>Ecosystem</h3>
-    <ul>
-      <li>
-        <a href="https://router.vuejs.org" target="_blank" rel="noopener"
-          >vue-router</a
-        >
-      </li>
-      <li>
-        <a href="https://vuex.vuejs.org" target="_blank" rel="noopener">vuex</a>
-      </li>
-      <li>
-        <a
-          href="https://github.com/vuejs/vue-devtools#vue-devtools"
-          target="_blank"
-          rel="noopener"
-          >vue-devtools</a
-        >
-      </li>
-      <li>
-        <a href="https://vue-loader.vuejs.org" target="_blank" rel="noopener"
-          >vue-loader</a
-        >
-      </li>
-      <li>
-        <a
-          href="https://github.com/vuejs/awesome-vue"
-          target="_blank"
-          rel="noopener"
-          >awesome-vue</a
-        >
-      </li>
-    </ul>
-  </div>
-</template>
-
-<script>
-export default {
-  name: "HelloWorld",
-  props: {
-    msg: String
-  }
-};
-</script>
-
-<!-- Add "scoped" attribute to limit CSS to this component only -->
-<style scoped lang="less">
-h3 {
-  margin: 40px 0 0;
-}
-ul {
-  list-style-type: none;
-  padding: 0;
-}
-li {
-  display: inline-block;
-  margin: 0 10px;
-}
-a {
-  color: #42b983;
-}
-</style>

+ 0 - 49
src/layout/home/foot.vue

@@ -1,49 +0,0 @@
-<template>
-  <div id="foot">
-    <el-row>
-      <el-col :span="24" class="foot">
-        <div class="div">
-          <p v-if="info" v-html="info.content"></p>
-        </div>
-      </el-col>
-    </el-row>
-  </div>
-</template>
-
-<script>
-export default {
-  name: 'foot',
-  props: {
-    info: null,
-  },
-  components: {},
-  data: () => ({}),
-  created() {},
-  computed: {},
-  methods: {},
-};
-</script>
-
-<style lang="less" scoped>
-/deep/.foot p p {
-  padding: 0;
-  margin: 0;
-}
-.foot {
-  width: 100%;
-  min-height: 120px;
-  background-color: rgba(0, 0, 0, 0.4);
-  overflow: hidden;
-}
-.foot .div {
-  width: 650px;
-  margin: 0 auto;
-}
-.foot p {
-  float: left;
-  color: #858f9b;
-  font-size: 14px;
-  margin-right: 24px;
-  line-height: 30px;
-}
-</style>

+ 0 - 165
src/layout/home/government.vue

@@ -1,165 +0,0 @@
-<template>
-  <div id="government">
-    <el-row>
-      <el-col :span="24" class="top">
-        <top></top>
-      </el-col>
-      <el-col :span="24" class="logo">
-        <div class="w_1200">
-          <logo :info="info"></logo>
-        </div>
-      </el-col>
-      <el-col :span="24" class="menu">
-        <div class="w_1200">
-          <menuInfo></menuInfo>
-        </div>
-      </el-col>
-      <el-col :span="24" class="main">
-        <!-- <div class="w_1200">
-          <el-col :span="12" class="phontoNews">
-            <photoNews :photoNews="photoNews"> </photoNews>
-          </el-col>
-          <el-col :span="12" class="news">
-            <news :chuangxinList="chuangxinList" :guoneiList="guoneiList" :zhengwuList="zhengwuList" :meitiList="meitiList"></news>
-          </el-col>
-          <el-col :span="8" class="notice">
-            <notice :tongzhiList="tongzhiList"></notice>
-          </el-col>
-          <el-col :span="16" class="zhengwu">
-            <zhengwu :zhengwu="zhengwu"></zhengwu>
-          </el-col>
-          <el-col :span="24" class="gongzhong">
-            <gongzhong :gongzhongList="gongzhongList"></gongzhong>
-          </el-col>
-          <el-col :span="24" class="link">
-            <linkInfo :linkList="linkList"></linkInfo>
-          </el-col>
-        </div> -->
-      </el-col>
-      <el-col :span="24" class="foot">
-        <div class="w_1200">
-          <foot :info="info"></foot>
-        </div>
-      </el-col>
-    </el-row>
-  </div>
-</template>
-
-<script>
-import top from '@/layout/index/top.vue';
-import logo from '@/layout/index/logo.vue';
-import menuInfo from '@/layout/index/menuInfo.vue';
-import foot from '@/layout/index/foot.vue';
-import photoNews from '@/layout/government/photoNews.vue';
-import news from '@/layout/government/news.vue';
-import notice from '@/layout/government/notice.vue';
-import zhengwu from '@/layout/government/zhengwu.vue';
-import gongzhong from '@/layout/government/gongzhong.vue';
-import linkInfo from '@/layout/index/linkInfo.vue';
-export default {
-  name: 'government',
-  props: {
-    info: null, //站点信息
-    photoNews: null, //图片新闻
-    chuangxinList: null, //科技政务图片旁边新闻
-    guoneiList: null, //科技政务图片旁边国内动态
-    zhengwuList: null, //科技政务图片旁边政务活动
-    meitiList: null, //科技政务图片旁边媒体焦距
-    tongzhiList: null, //通知公告
-    zhengwu: null, //政务公开
-    gongzhongList: null, //公众参与
-    linkList: null, //友情链接
-  },
-  components: {
-    top, //头部
-    logo, //logo
-    menuInfo, //导航
-    foot, //底部
-    // photoNews, //科技政务下的图片新闻照片
-    // news, //科技政务图片旁边新闻
-    // notice, //通知公告
-    // zhengwu, //政务公告
-    // gongzhong, //公众参与
-    // linkInfo, //相关链接
-  },
-  data: () => ({}),
-  created() {},
-  computed: {},
-  methods: {},
-};
-</script>
-
-<style lang="less" scoped>
-.w_1200 {
-  width: 1200px;
-  margin: 0 auto;
-}
-.top {
-  height: 40px;
-  overflow: hidden;
-  background-color: rgba(11, 58, 125, 0.8);
-}
-.logo {
-  height: 200px;
-  overflow: hidden;
-}
-.menu {
-  height: 70px;
-  overflow: hidden;
-}
-.main {
-  height: 1080px;
-  overflow: hidden;
-  margin: 10px 0;
-}
-.main .phontoNews {
-  float: left;
-  width: 590px;
-  height: 400px;
-  overflow: hidden;
-  margin: 0 10px 10px 0;
-  background-color: #fff;
-}
-.main .news {
-  float: left;
-  width: 600px;
-  height: 400px;
-  margin: 0 0 10px 0;
-  overflow: hidden;
-  background-color: #fff;
-}
-.main .notice {
-  float: left;
-  width: 390px;
-  height: 320px;
-  margin: 0 10px 10px 0;
-  overflow: hidden;
-  background-color: #fff;
-}
-.main .zhengwu {
-  float: left;
-  width: 800px;
-  height: 320px;
-  margin: 0 0 10px 0;
-  overflow: hidden;
-  background-color: #fff;
-}
-.main .gongzhong {
-  height: 240px;
-  margin: 0 0 10px 0;
-  background-color: #fff;
-}
-.main .link {
-  float: left;
-  width: 100%;
-  height: 100px;
-  overflow: hidden;
-  background-color: #fff;
-}
-.foot {
-  float: left;
-  width: 100%;
-  height: 120px;
-  overflow: hidden;
-}
-</style>

+ 0 - 83
src/layout/home/layout.vue

@@ -1,83 +0,0 @@
-<template>
-  <div id="government">
-    <el-row>
-      <el-col :span="24" class="top">
-        <top></top>
-      </el-col>
-      <el-col :span="24" class="logo">
-        <div class="w_1200">
-          <logo :info="info"></logo>
-        </div>
-      </el-col>
-      <el-col :span="24" class="menu">
-        <div class="w_1200">
-          <menuInfo></menuInfo>
-        </div>
-      </el-col>
-      <el-col :span="24" class="main">
-        <div class="w_1200">
-          <router-view />
-        </div>
-      </el-col>
-      <el-col :span="24" class="foot">
-        <div class="w_1200">
-          <foot :info="info"></foot>
-        </div>
-      </el-col>
-    </el-row>
-  </div>
-</template>
-
-<script>
-import top from './top.vue';
-import logo from './logo.vue';
-import menuInfo from './menuInfo.vue';
-import foot from './foot.vue';
-export default {
-  name: 'government',
-  props: {
-    info: null, //站点信息
-  },
-  components: {
-    top, //头部
-    logo, //logo
-    menuInfo, //导航
-    foot, //底部
-  },
-  data: () => ({}),
-  created() {},
-  computed: {},
-  methods: {},
-};
-</script>
-
-<style lang="less" scoped>
-.w_1200 {
-  width: 1200px;
-  margin: 0 auto;
-}
-.top {
-  height: 40px;
-  overflow: hidden;
-  background-color: rgba(11, 58, 125, 0.8);
-}
-.logo {
-  height: 200px;
-  overflow: hidden;
-}
-.menu {
-  height: 70px;
-  overflow: hidden;
-}
-.main {
-  height: 1080px;
-  overflow: hidden;
-  margin: 10px 0;
-}
-.foot {
-  float: left;
-  width: 100%;
-  height: 120px;
-  overflow: hidden;
-}
-</style>

+ 0 - 40
src/layout/home/logo.vue

@@ -1,40 +0,0 @@
-<template>
-  <div id="logo">
-    <el-row>
-      <el-col :span="24" class="logo">
-        <span v-if="info && info.logourl">
-          <el-image style="width:690px;height:66px;" :src="info.logourl">
-            <div slot="error" class="image-slot">
-              <el-image style="width:690px;height:66px;" :src="logourl"></el-image>
-            </div>
-          </el-image>
-        </span>
-        <span v-else>
-          <el-image style="width:690px;height:66px;" :src="logourl"></el-image>
-        </span>
-      </el-col>
-    </el-row>
-  </div>
-</template>
-
-<script>
-export default {
-  name: 'logo',
-  props: {
-    info: null,
-  },
-  components: {},
-  data: () => ({
-    logourl: require('@/assets/home/logo.png'),
-  }),
-  created() {},
-  computed: {},
-  methods: {},
-};
-</script>
-
-<style lang="less" scoped>
-.logo {
-  padding: 65px 0;
-}
-</style>

+ 0 - 84
src/layout/home/menuInfo.vue

@@ -1,84 +0,0 @@
-<template>
-  <div id="menuInfo">
-    <el-row>
-      <el-col :span="24" class="menu">
-        <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="/">
-            <el-link
-              style="padding: 0px 0px;font-size: 22px;"
-              :underline="false"
-              href="http://139.210.167.203/free-technological-management/mapApply/getMap"
-              target="_blank"
-              >科技资源</el-link
-            >
-          </el-menu-item>
-          <el-menu-item index="/personnel/personnel">科技人才</el-menu-item>
-        </el-menu>
-      </el-col>
-    </el-row>
-  </div>
-</template>
-
-<script>
-export default {
-  name: 'menuInfo',
-  props: {},
-  components: {},
-  data: () => ({
-    defalutMenu: [],
-  }),
-  created() {},
-  computed: {},
-  methods: {
-    thisRouter() {
-      console.log(this.$route.path);
-    },
-    to(index) {
-      this.$router.push({ path: index });
-    },
-  },
-};
-</script>
-
-<style lang="less" scoped>
-.menu {
-  height: 70px;
-  overflow: hidden;
-  background-color: rgba(0, 0, 0, 0.4);
-}
-/deep/.el-menu {
-  background-color: rgba(0, 0, 0, 0.4);
-}
-/deep/.el-menu--horizontal > .el-menu-item {
-  height: 70px;
-  line-height: 70px;
-  border-right: 1px solid #ccc;
-  padding: 0 30px;
-  font-size: 22px;
-}
-/deep/.el-menu--horizontal > .el-menu-item:last-child {
-  padding: 0 34px;
-}
-/deep/.el-menu--horizontal > .el-menu-item.is-active {
-  border-bottom: none;
-  color: #fff;
-  background-color: #215299;
-}
-/deep/.el-menu--horizontal > .el-menu-item:hover {
-  background-color: #215299;
-}
-</style>

+ 0 - 77
src/layout/home/top.vue

@@ -1,77 +0,0 @@
-<template>
-  <div id="top">
-    <el-row>
-      <el-col :span="24" class="top">
-        <div class="w_1200">
-          <el-col :span="22" class="date">
-            {{ gettime }}
-          </el-col>
-          <el-col :span="2" class="btn" v-if="user && user.id"> {{ user.name }} | <el-link :underline="false" @click="toLogOut">注销</el-link> </el-col>
-          <el-col :span="2" class="btn">
-            <el-link :underline="false" @click="loginBtn()" target="_blank">注册</el-link>|<el-link :underline="false" @click="loginBtn()" target="_blank"
-              >登录</el-link
-            >
-          </el-col>
-        </div>
-      </el-col>
-    </el-row>
-  </div>
-</template>
-
-<script>
-import { mapActions, mapState, createNamespacedHelpers } from 'vuex';
-export default {
-  name: 'top',
-  props: {},
-  components: {},
-  data: () => ({
-    gettime: '',
-  }),
-  created() {
-    this.currentTime();
-  },
-  computed: {
-    ...mapState(['user']),
-  },
-  methods: {
-    currentTime() {
-      setInterval(this.getTime, 500);
-    },
-    getTime: function() {
-      var _this = this;
-      let yy = new Date().getFullYear();
-      let mm = new Date().getMonth() + 1;
-      let dd = new Date().getDate();
-      let day = new Date().getDay();
-      var weekday = ['星期日', '星期一', '星期二', '星期三', '星期四', '星期五', '星期六'];
-      _this.gettime = yy + '-' + mm + '-' + dd + ' ' + weekday[day];
-    },
-    loginBtn() {
-      this.$router.push({ path: '/login' });
-    },
-    toLogOut() {},
-  },
-};
-</script>
-
-<style lang="less" scoped>
-.w_1200 {
-  width: 1200px;
-  margin: 0 auto;
-}
-.date {
-  height: 40px;
-  line-height: 40px;
-  color: #fff;
-  font-size: 16px;
-}
-.btn {
-  height: 40px;
-  line-height: 40px;
-  color: #fff;
-}
-.btn .el-link {
-  color: #fff;
-  margin: 0 5px;
-}
-</style>

+ 0 - 2
src/main.js

@@ -9,7 +9,6 @@ import '@/plugins/meta';
 import '@/plugins/filters';
 import '@/plugins/loading';
 import '@/plugins/setting';
-// import InitStomp from '@/plugins/stomp';
 Vue.config.productionTip = false;
 
 new Vue({
@@ -17,4 +16,3 @@ new Vue({
   store,
   render: h => h(App),
 }).$mount('#app');
-// InitStomp();

+ 0 - 19
src/router/before.js

@@ -1,19 +0,0 @@
-import store from '@/store/index';
-
-const checkLogin = router => {
-  router.beforeEach((to, form, next) => {
-    store.commit('setUser');
-    // if (to.name === 'login') {
-    //   next();
-    //   return;
-    // }
-    // let user = store.state.user;
-    // if (user) {
-    //   next();
-    // }
-    // //下面是没登录的情况,需要跳转页面到用户未登录页
-    // else next({ name: 'login' });
-    next();
-  });
-};
-export default checkLogin;

+ 13 - 1
src/router/index.js

@@ -1,6 +1,6 @@
 import Vue from 'vue';
 import VueRouter from 'vue-router';
-import checkLogin from './before';
+import checkLogin from '@common/router/before';
 
 Vue.use(VueRouter);
 
@@ -17,6 +17,18 @@ const routes = [
         name: 'index',
         component: () => import('../views/home/index.vue'),
       },
+      {
+        path: '/list',
+        meta: { title: '科技政务' },
+        name: 'list',
+        component: () => import('../views/list/index.vue'),
+      },
+      {
+        path: '/detail',
+        meta: { title: '科技政务' },
+        name: 'detail',
+        component: () => import('../views/detail/index.vue'),
+      },
     ],
   },
 ];

+ 7 - 3
src/store/index.js

@@ -1,12 +1,16 @@
 import Vue from 'vue';
 import Vuex from 'vuex';
-import * as ustate from './user/state';
-import * as umutations from './user/mutations';
+import site from '@common/store/site';
+import link from '@common/store/gov/link';
+import affairsColumn from '@common/store/gov/affairsColumn';
+import affairsNews from '@common/store/gov/affairsNews';
+import * as ustate from '@common/store/user/state';
+import * as umutations from '@common/store/user/mutations';
 Vue.use(Vuex);
 
 export default new Vuex.Store({
   state: { ...ustate },
   mutations: { ...umutations },
   actions: {},
-  modules: {},
+  modules: { affairsColumn, affairsNews, site, link },
 });

+ 0 - 33
src/store/user/mutations.js

@@ -1,33 +0,0 @@
-const jwt = require('jsonwebtoken');
-export const setUser = (state, payload) => {
-  let res = true;
-  //登陆时
-  if (payload) {
-    state.token = payload;
-  } else {
-    //已经登陆,切换路由时取出用户信息放在总store中
-    let token = localStorage.getItem('token');
-    if (token && token !== 'guest') {
-      state.user = jwt.decode(token);
-    } else if (token && token == 'guest') {
-      let user = localStorage.getItem('user');
-      state.user = JSON.parse(user);
-    } else {
-      let timestamp = new Date().getTime();
-      let user = {
-        // id: `guest${timestamp}`,
-        name: `游客${timestamp}`,
-      };
-      state.user = user;
-      localStorage.setItem('token', 'guest');
-      localStorage.setItem('user', JSON.stringify(user));
-      console.warn('游客身份');
-    }
-  }
-  return res;
-};
-
-export const deleteUser = (state, payload) => {
-  state.user = {};
-  localStorage.removeItem('user');
-};

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

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

+ 1 - 1
src/views/Home.vue

@@ -5,7 +5,7 @@
 </template>
 
 <script>
-import frame from '@/layout/home/layout.vue';
+import frame from '@common/layout/home/layout.vue';
 import { mapState, createNamespacedHelpers } from 'vuex';
 export default {
   name: 'home',

+ 108 - 0
src/views/detail/index.vue

@@ -0,0 +1,108 @@
+<template>
+  <div id="index">
+    <el-row>
+      <el-col :span="5" class="left">
+        <el-col :span="24" class="leftTop">
+          <native :nativeList="nativeList"></native>
+        </el-col>
+        <el-col :span="24" class="leftDiao">
+          <examine></examine>
+        </el-col>
+      </el-col>
+      <el-col :span="19" class="right">
+        <message :columnTitle="columnTitle" :governmentDetail="governmentDetail"></message>
+      </el-col>
+    </el-row>
+  </div>
+</template>
+
+<script>
+import native from './parts/native.vue';
+import message from './parts/message.vue';
+import examine from '@common/layout/subPage/question.vue';
+import { mapState, createNamespacedHelpers } from 'vuex';
+const { mapActions: mapSite } = createNamespacedHelpers('site');
+const { mapActions: mapColumn } = createNamespacedHelpers('affairsColumn');
+const { mapActions: mapNews } = createNamespacedHelpers('affairsNews');
+export default {
+  name: 'index',
+  props: {},
+  components: { examine, message, native },
+  data: () => {
+    return {
+      info: {},
+      nativeList: [],
+      columnTitle: '',
+      governmentDetail: {},
+    };
+  },
+  created() {
+    this.searchSite();
+    this.searchColumn();
+    this.searchInfo();
+  },
+
+  methods: {
+    ...mapSite(['showInfo']),
+    ...mapColumn({ columnList: 'query', columnInfo: 'fetch' }),
+    ...mapNews({ newsList: 'query', newsInfo: 'fetch' }),
+    // 查询站点信息
+    async searchSite() {
+      let res = await this.showInfo();
+      let object = JSON.parse(JSON.stringify(res.data));
+      if (object) {
+        this.$set(this, `info`, res.data);
+      } else {
+        this.$message.error(res.errmsg ? res.errmsg : 'error');
+      }
+    },
+    // 查询科技政务栏目
+    async searchColumn({ ...info } = {}) {
+      const res = await this.columnList({ ...info });
+      this.$set(this, `nativeList`, res.data);
+      console.log(res);
+      // for (const val of res.data) {
+      //   this.tpxwSearch({ column_id: val.id, site: val.site });
+      // }
+    },
+    async searchInfo() {
+      let detailId = this.$route.query.id;
+      const res = await this.newsInfo(detailId);
+      const result = await this.columnInfo(res.data.column_id);
+      this.$set(this, `columnTitle`, result.data.name);
+      this.$set(this, `governmentDetail`, res.data);
+    },
+  },
+  computed: {
+    ...mapState(['user']),
+    pageTitle() {
+      return `${this.$route.meta.title}`;
+    },
+  },
+  metaInfo() {
+    return { title: this.$route.meta.title };
+  },
+};
+</script>
+
+<style lang="less" scoped>
+.left {
+  width: 240px;
+  min-height: 800px;
+  margin: 0 10px 0 0;
+}
+.left .leftTop {
+  height: 420px;
+  background-color: #fff;
+  margin: 0 0 10px 0;
+}
+.left .leftDiao {
+  background: #fff;
+  height: 370px;
+  overflow: hidden;
+}
+.right {
+  min-height: 800px;
+  background-color: #fff;
+}
+</style>

+ 91 - 0
src/views/detail/parts/message.vue

@@ -0,0 +1,91 @@
+<template>
+  <div id="message">
+    <el-row>
+      <el-col :span="24" class="info">
+        <el-col :span="24" class="topInfo">
+          <span>{{ columnTitle }}</span>
+        </el-col>
+        <el-col :span="24" class="infoMess">
+          <el-col :span="24" class="title">
+            {{ governmentDetail.title }}
+          </el-col>
+          <el-col :span="24" class="infoDate">
+            <p>
+              <span>发布人:{{ governmentDetail.publish }}</span>
+              <span>来源:{{ governmentDetail.orgin }}</span>
+              <span
+                >发布时间:
+                {{ governmentDetail.meta && governmentDetail.meta.createdAt ? new Date(governmentDetail.meta.createdAt).toLocaleDateString() : '' || '' }}</span
+              >
+            </p>
+          </el-col>
+          <el-col v-if="governmentDetail.picture" class="image">
+            <el-image style="width:50%" :src="governmentDetail.picture"></el-image>
+          </el-col>
+          <el-col :span="24" class="content">
+            <p v-html="governmentDetail.content"></p>
+          </el-col>
+        </el-col>
+      </el-col>
+    </el-row>
+  </div>
+</template>
+
+<script>
+export default {
+  name: 'message',
+  props: {
+    columnTitle: null,
+    governmentDetail: null,
+  },
+  components: {},
+  data: () => ({}),
+  created() {},
+  computed: {},
+  methods: {},
+};
+</script>
+
+<style lang="less" scoped>
+p {
+  padding: 0;
+  margin: 0;
+}
+.info {
+  padding: 0 20px;
+}
+.topInfo {
+  height: 60px;
+  line-height: 60px;
+  font-size: 22px;
+}
+.infoMess .title {
+  line-height: 30px;
+  text-align: center;
+  font-size: 16px;
+  font-weight: bold;
+  color: #000000;
+  margin: 0 0 20px 0;
+}
+.infoDate {
+  height: 36px;
+  line-height: 36px;
+}
+.infoDate p {
+  width: 700px;
+  background: #eeeeee;
+  margin: 0 105px;
+}
+.infoDate p span {
+  font-size: 14px;
+  color: #000;
+  padding: 0 0 0 80px;
+}
+.infoMess .image {
+  text-align: center;
+  margin: 20px 0 0 0;
+}
+.content {
+  padding: 0px 0 20px 0;
+}
+</style>

+ 65 - 0
src/views/detail/parts/native.vue

@@ -0,0 +1,65 @@
+<template>
+  <div id="native">
+    <el-col class="swfl">
+      <el-image style="width:22px;height:22px;margin:0 5px -5px 0;" :src="src"></el-image>
+      <span>标签栏</span>
+    </el-col>
+    <el-col>
+      <el-menu default-active="1" class="el-menu-vertical-demo" @open="handleOpen" @close="handleClose" text-color="#215299" active-text-color="#215299">
+        <el-menu-item index="1" v-for="(item, index) in nativeList" :key="index"
+          ><span slot="title" @click="clickUrl()">{{ item.name }}</span></el-menu-item
+        >
+      </el-menu>
+    </el-col>
+  </div>
+</template>
+
+<script>
+export default {
+  name: 'native',
+  props: {
+    nativeList: null,
+  },
+  components: {},
+  data: () => ({
+    src: require('@/assets/swfl.png'),
+  }),
+  created() {},
+  computed: {},
+  methods: {
+    clickUrl() {
+      this.$router.push({ path: '/government/governmentList' });
+    },
+    handleOpen(key, keyPath) {
+      console.log(key, keyPath);
+    },
+    handleClose(key, keyPath) {
+      console.log(key, keyPath);
+    },
+  },
+};
+</script>
+
+<style lang="less" scoped>
+.swfl {
+  height: 60px;
+  width: 240px;
+  line-height: 60px;
+  background-color: #22529a;
+  text-align: center;
+}
+.swfl span {
+  font-size: 22px;
+  color: #ffffff;
+}
+/deep/.el-menu-item {
+  height: 60px;
+  text-align: center;
+  line-height: 60px;
+  border-bottom: 1px dashed;
+  font-size: 22px;
+}
+/deep/.el-menu-item:last-child {
+  border-bottom: none;
+}
+</style>

+ 53 - 16
src/views/home/index.vue

@@ -1,13 +1,13 @@
 <template>
   <div id="index">
     <el-col :span="12" class="phontoNews">
-      <photoNews :photoNews="photoNews"> </photoNews>
+      <photoNews :photoNews="tpxwList"> </photoNews>
     </el-col>
     <el-col :span="12" class="news">
-      <news :chuangxinList="chuangxinList" :guoneiList="guoneiList" :zhengwuList="zhengwuList" :meitiList="meitiList"></news>
+      <news :chuangxinList="cxjlList" :guoneiList="gndtList" :zhengwuList="zwhdList" :meitiList="mtjjList"></news>
     </el-col>
     <el-col :span="8" class="notice">
-      <notice :tongzhiList="tongzhiList"></notice>
+      <notice :tongzhiList="tzggList"></notice>
     </el-col>
     <el-col :span="16" class="zhengwu">
       <zhengwu :zhengwu="zhengwu"></zhengwu>
@@ -29,19 +29,13 @@ import zhengwu from './parts/zhengwu.vue';
 import gongzhong from './parts/gongzhong.vue';
 import linkInfo from './parts/linkInfo.vue';
 import { mapState, createNamespacedHelpers } from 'vuex';
+const { mapActions: mapSite } = createNamespacedHelpers('site');
+const { mapActions: mapLink } = createNamespacedHelpers('link');
+const { mapActions: mapColumn } = createNamespacedHelpers('affairsColumn');
+const { mapActions: mapNews } = createNamespacedHelpers('affairsNews');
 export default {
   name: 'index',
-  props: {
-    // photoNews: { type: Array, default: () => [] }, //图片新闻
-    // chuangxinList: { type: Array, default: () => [] }, //科技政务图片旁边新闻
-    // guoneiList: { type: Array, default: () => [] }, //科技政务图片旁边国内动态
-    // zhengwuList: { type: Array, default: () => [] }, //科技政务图片旁边政务活动
-    // meitiList: { type: Array, default: () => [] }, //科技政务图片旁边媒体焦距
-    // tongzhiList: { type: Array, default: () => [] }, //通知公告
-    // zhengwu: { type: Array, default: () => [] }, //政务公开
-    // gongzhongList: { type: Array, default: () => [] }, //公众参与
-    // linkList: { type: Array, default: () => [] }, //友情链接
-  },
+  props: {},
   components: { photoNews, news, notice, zhengwu, gongzhong, linkInfo },
   data: () => {
     return {
@@ -137,8 +131,51 @@ export default {
       linkList: [],
     };
   },
-  created() {},
-  methods: {},
+  created() {
+    this.searchSite();
+    this.searchLink();
+    this.searchColumn();
+  },
+  methods: {
+    ...mapSite(['showInfo']),
+    ...mapLink({ linksList: 'query' }),
+    ...mapColumn({ columnList: 'query', columnInfo: 'fetch' }),
+    ...mapNews({ newsList: 'query' }),
+    // 查询站点信息
+    async searchSite() {
+      let res = await this.showInfo();
+      let object = JSON.parse(JSON.stringify(res.data));
+      if (object) {
+        this.$set(this, `info`, res.data);
+      } else {
+        this.$message.error(res.errmsg ? res.errmsg : 'error');
+      }
+    },
+    //查询标题
+    async searchLink({ ...info } = {}) {
+      const res = await this.linksList({ ...info });
+      if (this.$checkRes(res)) {
+        this.$set(this, `linkList`, res.data);
+      }
+    },
+    // 查询科技政务栏目
+    async searchColumn({ ...info } = {}) {
+      const res = await this.columnList({ ...info });
+      for (const val of res.data) {
+        this.tpxwSearch({ column_id: val.id, site: val.site });
+      }
+    },
+    // 查询信息列表
+    async tpxwSearch({ skip = 0, limit = 10, column_id, site } = {}) {
+      const res = await this.newsList({ skip, limit, column_id: column_id });
+      for (const val of res.data) {
+        const result = await this.columnInfo(val.column_id);
+        val.column_name = result.data.name;
+      }
+      this.$set(this, `${site}List`, res.data);
+      console.log(res.data);
+    },
+  },
   computed: {
     ...mapState(['user']),
     pageTitle() {

+ 1 - 1
src/views/home/parts/notice.vue

@@ -43,7 +43,7 @@ export default {
   computed: {},
   methods: {
     moreClick() {
-      this.$router.push({ path: '/government/governmentList' });
+      this.$router.push({ path: '/list' });
     },
   },
 };

+ 1 - 1
src/views/home/parts/photoNews.vue

@@ -2,7 +2,7 @@
   <div id="phontoNews">
     <el-col :span="24" class="info">
       <div class="block">
-        <el-carousel height="360px">
+        <el-carousel height="360px" v-if="photoNews">
           <el-carousel-item
             v-for="(item, index) in photoNews"
             :key="index"

+ 133 - 0
src/views/list/index.vue

@@ -0,0 +1,133 @@
+<template>
+  <div id="index">
+    <el-row>
+      <el-col :span="5" class="left">
+        <el-col :span="24" class="leftTop">
+          <natives :nativeList="nativeList" v-on="$listeners"></natives>
+        </el-col>
+        <el-col :span="24" class="leftDiao">
+          <examine></examine>
+        </el-col>
+      </el-col>
+      <el-col :span="19" class="right">
+        <rightcont v-on="$listeners" :columnName="columnName" :contentList="contentList" :total="total" v-if="display === 'list'"></rightcont>
+        <policyrightcont v-else :columnTitle="columnTitle" :policyInfo="policyInfo"></policyrightcont>
+      </el-col>
+    </el-row>
+  </div>
+</template>
+
+<script>
+import natives from './parts/natives.vue';
+import examine from '@common/layout/subPage/question.vue';
+import rightcont from './parts/rightcont.vue';
+import policyrightcont from './parts/policyrightcont.vue';
+import { mapState, createNamespacedHelpers } from 'vuex';
+import _ from 'lodash';
+const { mapActions: mapSite } = createNamespacedHelpers('site');
+const { mapActions: mapColumn } = createNamespacedHelpers('affairsColumn');
+const { mapActions: mapNews } = createNamespacedHelpers('affairsNews');
+export default {
+  name: 'index',
+  props: {},
+  components: { natives, examine, rightcont, policyrightcont },
+  data: () => {
+    return {
+      info: {},
+      nativeList: [],
+      display: 'list',
+      columnName: '',
+      contentList: [],
+      total: 1,
+      leftId: '',
+      columnTitle: '',
+      policyInfo: {},
+    };
+  },
+  async created() {
+    this.searchSite();
+    await this.searchColumn();
+    await this.defaultColumn();
+  },
+  methods: {
+    ...mapSite(['showInfo']),
+    ...mapColumn({ columnList: 'query', columnInfo: 'fetch' }),
+    ...mapNews({ policyNew: 'query', newsFetch: 'fetch' }),
+    // 查询站点信息
+    async searchSite() {
+      let res = await this.showInfo();
+      let object = JSON.parse(JSON.stringify(res.data));
+      if (object) {
+        this.$set(this, `info`, res.data);
+      } else {
+        this.$message.error(res.errmsg ? res.errmsg : 'error');
+      }
+    },
+    // 查询科技政务栏目
+    async searchColumn({ ...info } = {}) {
+      const res = await this.columnList({ ...info });
+      if (this.$checkRes(res)) {
+        this.$set(this, `nativeList`, res.data);
+      }
+    },
+    submit({ id }) {
+      this.$set(this, `leftId`, id);
+      this.display = 'list';
+      this.searchRight();
+    },
+    async searchRight({ skip = 0, limit = 10, column_id } = {}) {
+      const res = await this.policyNew({ skip, limit, column_id: this.leftId });
+      for (const val of res.data) {
+        const result = await this.columnInfo(val.column_id);
+        val.column_name = result.data.name;
+      }
+      this.$set(this, `contentList`, res.data);
+      this.$set(this, `total`, res.data.length);
+      for (const val of res.data) {
+        this.$set(this, `columnName`, val.column_name);
+      }
+    },
+    async defaultColumn() {
+      if (!(this.nativeList.length > 0)) return;
+      let id = _.get(this.nativeList[0], 'id', false);
+      if (!id) return;
+      this.submit({ id });
+    },
+    async fetchInfo(id) {
+      this.display = 'detail';
+      const res = await this.newsFetch(id);
+      const result = await this.columnInfo(res.data.column_id);
+      this.$set(this, `columnTitle`, result.data.name);
+      this.$set(this, `policyInfo`, res.data);
+      // 查询详情,赋值
+    },
+  },
+  computed: {
+    ...mapState(['user']),
+    pageTitle() {
+      return `${this.$route.meta.title}`;
+    },
+  },
+  metaInfo() {
+    return { title: this.$route.meta.title };
+  },
+};
+</script>
+
+<style lang="less" scoped>
+.left {
+  width: 240px;
+  min-height: 800px;
+  margin: 0 10px 0 0;
+}
+.left .leftTop {
+  height: 420px;
+  background-color: #fff;
+  margin: 0 0 10px 0;
+}
+.left .leftDiao {
+  background: #fff;
+  height: 370px;
+  overflow: hidden;
+}
+</style>

+ 65 - 0
src/views/list/parts/natives.vue

@@ -0,0 +1,65 @@
+<template>
+  <div id="native">
+    <el-col class="swfl">
+      <el-image style="width:22px;height:22px;margin:0 5px -5px 0;" :src="src"></el-image>
+      <span>标签栏</span>
+    </el-col>
+    <el-col>
+      <el-menu default-active="1" class="el-menu-vertical-demo" @open="handleOpen" @close="handleClose" text-color="#215299" active-text-color="#215299">
+        <el-menu-item index="1" v-for="(item, index) in nativeList" :key="index"
+          ><span slot="title" @click="clickUrl(item.id)">{{ item.name }}</span></el-menu-item
+        >
+      </el-menu>
+    </el-col>
+  </div>
+</template>
+
+<script>
+export default {
+  name: 'native',
+  props: {
+    nativeList: null,
+  },
+  components: {},
+  data: () => ({
+    src: require('@/assets/swfl.png'),
+  }),
+  created() {},
+  computed: {},
+  methods: {
+    clickUrl(id) {
+      this.$emit('clickLists', { id });
+    },
+    handleOpen(key, keyPath) {
+      console.log(key, keyPath);
+    },
+    handleClose(key, keyPath) {
+      console.log(key, keyPath);
+    },
+  },
+};
+</script>
+
+<style lang="less" scoped>
+.swfl {
+  height: 60px;
+  width: 240px;
+  line-height: 60px;
+  background-color: #22529a;
+  text-align: center;
+}
+.swfl span {
+  font-size: 22px;
+  color: #ffffff;
+}
+/deep/.el-menu-item {
+  height: 60px;
+  text-align: center;
+  line-height: 60px;
+  border-bottom: 1px dashed;
+  font-size: 22px;
+}
+/deep/.el-menu-item:last-child {
+  border-bottom: none;
+}
+</style>

+ 90 - 0
src/views/list/parts/policyrightcont.vue

@@ -0,0 +1,90 @@
+<template>
+  <div id="policyrightcont">
+    <el-row>
+      <el-col :span="24" class="info">
+        <el-col :span="24" class="topInfo">
+          <span>{{ columnTitle }}</span>
+        </el-col>
+        <el-col :span="24" class="infoMess">
+          <el-col :span="24" class="title">
+            {{ policyInfo.title }}
+          </el-col>
+          <el-col :span="24" class="infoDate">
+            <p>
+              <span>发布人:{{ policyInfo.publish }}</span>
+              <span>来源:{{ policyInfo.orgin }}</span>
+              <span>发布时间: {{ policyInfo.meta && policyInfo.meta.createdAt ? new Date(policyInfo.meta.createdAt).toLocaleDateString() : '' || '' }}</span>
+            </p>
+          </el-col>
+          <el-col v-if="policyInfo.picture" class="image">
+            <el-image style="width:50%" :src="policyInfo.picture"></el-image>
+          </el-col>
+          <el-col :span="24" class="content">
+            <p v-html="policyInfo.content"></p>
+          </el-col>
+        </el-col>
+      </el-col>
+    </el-row>
+  </div>
+</template>
+
+<script>
+export default {
+  name: 'policyrightcont',
+  props: {
+    columnTitle: null,
+    policyInfo: null,
+  },
+  components: {},
+  data: () => ({}),
+  created() {},
+  computed: {},
+  methods: {},
+};
+</script>
+
+<style lang="less" scoped>
+p {
+  padding: 0;
+  margin: 0;
+}
+.info {
+  min-height: 800px;
+  padding: 0 20px;
+  background-color: #fff;
+}
+.topInfo {
+  height: 60px;
+  line-height: 60px;
+  font-size: 22px;
+}
+.infoMess .title {
+  line-height: 30px;
+  text-align: center;
+  font-size: 16px;
+  font-weight: bold;
+  color: #000000;
+  margin: 0 0 20px 0;
+}
+.infoDate {
+  height: 36px;
+  line-height: 36px;
+}
+.infoDate p {
+  width: 700px;
+  background: #eeeeee;
+  margin: 0 105px;
+}
+.infoDate p span {
+  font-size: 14px;
+  color: #000;
+  padding: 0 0 0 80px;
+}
+.infoMess .image {
+  text-align: center;
+  margin: 20px 0 0 0;
+}
+.content {
+  padding: 0px 0 20px 0;
+}
+</style>

+ 157 - 0
src/views/list/parts/rightcont.vue

@@ -0,0 +1,157 @@
+<template>
+  <div id="rightcont">
+    <el-row>
+      <el-col class="zhengce">
+        <el-col :span="24" class="topTitle">
+          {{ columnName }}
+        </el-col>
+        <el-col :span="24" class="info">
+          <ul>
+            <li v-for="(item, index) in contentList" :key="index" @click="$emit('fetch', item.id)">
+              <el-col :span="21" class="title textOver">{{ item.title }}</el-col>
+              <el-col :span="3" class="date">
+                {{ item.meta && item.meta.createdAt ? new Date(item.meta.createdAt).toLocaleDateString() : '' || '' }}
+              </el-col>
+            </li>
+          </ul>
+          <el-col class="page" :span="24">
+            <el-pagination
+              @size-change="handleSizeChange"
+              @current-change="handleCurrentChange"
+              :current-page="currentPage"
+              layout="total,  prev, pager, next, jumper"
+              :total="total"
+            >
+            </el-pagination>
+          </el-col>
+        </el-col>
+      </el-col>
+      <el-col :span="24" class="linkList">
+        <el-col :span="4" v-for="(item, index) in linkList" :key="index" class="listSize">
+          <el-link :underline="false" :href="item.url" target="_blank">
+            <el-image style="width:130px;height:160px;" :src="item.pic"></el-image>
+          </el-link>
+        </el-col>
+      </el-col>
+    </el-row>
+  </div>
+</template>
+
+<script>
+export default {
+  name: 'rightcont',
+  props: {
+    columnName: null,
+    contentList: null,
+    total: null,
+  },
+  components: {},
+  data: () => ({
+    currentPage: 1,
+    linkList: [
+      {
+        url: '',
+        pic: require('@/assets/dian1.jpg'),
+      },
+      {
+        url: '',
+        pic: require('@/assets/dian2.jpg'),
+      },
+      {
+        url: '',
+        pic: require('@/assets/dian3.jpg'),
+      },
+      {
+        url: '',
+        pic: require('@/assets/dian4.jpg'),
+      },
+      {
+        url: '',
+        pic: require('@/assets/dian5.jpg'),
+      },
+      {
+        url: '',
+        pic: require('@/assets/dian6.jpg'),
+      },
+    ],
+  }),
+  created() {},
+  computed: {},
+  methods: {
+    handleSizeChange(val) {
+      console.log(`每页 ${val} 条`);
+    },
+    handleCurrentChange(val) {
+      console.log(`当前页: ${val}`);
+    },
+  },
+};
+</script>
+
+<style lang="less" scoped>
+ul {
+  margin: 0;
+}
+li {
+  padding: 0;
+  margin: 0;
+  color: #a8abb7;
+}
+.zhengce {
+  height: 620px;
+  padding: 20px 20px 0 20px;
+  background-color: #fff;
+  margin: 0 0 20px 0;
+}
+.topTitle {
+  font-size: 22px;
+  color: #22529a;
+  margin: 0 0 20px 0;
+}
+.info {
+  height: 550px;
+  overflow: hidden;
+}
+.info ul {
+  height: 498px;
+  overflow: hidden;
+  padding: 0 0 0 20px;
+}
+.info ul li {
+  float: left;
+  width: 100%;
+  padding: 0 0 13px 0;
+}
+.info ul li .title {
+  font-size: 16px;
+  color: #60636d;
+}
+.info ul li .date {
+  font-size: 16px;
+  color: #a8abb7;
+  text-align: right;
+}
+.info ul li:hover {
+  cursor: pointer;
+}
+.info ul li:hover .title {
+  color: #22529a;
+}
+.info ul li:hover .date {
+  color: #22529a;
+}
+.page {
+  padding: 11px 0;
+  text-align: center;
+}
+.linkList {
+  height: 160px;
+  overflow: hidden;
+  background-color: #fff;
+}
+.listSize {
+  width: 130px;
+  height: 160px;
+  margin: 0 14px;
+}
+</style>

+ 2 - 0
vue.config.js

@@ -1,4 +1,5 @@
 const path = require('path');
+const common = path.resolve(__dirname, '../common');
 module.exports = {
   publicPath: process.env.NODE_ENV === 'development' ? '/' : process.env.VUE_APP_ROUTER,
   // outputDir: process.env.VUE_APP_ROUTER,
@@ -10,6 +11,7 @@ module.exports = {
           '@': path.resolve(__dirname, './src'),
           '@c': path.resolve(__dirname, './src/components'),
           '@a': path.resolve(__dirname, './src/assets'),
+          '@common': common,
         },
       },
     });