guhongwei 4 years ago
parent
commit
5602cb22e1

+ 17 - 14
src/components/common/foot.vue

@@ -4,17 +4,7 @@
       <el-col :span="24" class="foot">
         <div class="w_1200">
           <el-col :span="24" class="one">
-            <p>版权所有:吉林省技术算中心</p>
-            <p>
-              <span>技术支持:长春福瑞科技有限公司</span>
-              <span>邮编:130000</span>
-              <span>传真:239823982</span>
-            </p>
-            <p>
-              <span>地址:吉林省长春市朝阳区前进大街1244号</span>
-              <span>电话:0134-1234567</span>
-              <span>邮箱:123456@163.com</span>
-            </p>
+            <p v-html="info.footinfo"></p>
           </el-col>
         </div>
       </el-col>
@@ -24,15 +14,28 @@
 
 <script>
 import { mapState, createNamespacedHelpers } from 'vuex';
+const { mapActions: siteinfo } = createNamespacedHelpers('siteinfo');
 export default {
   name: 'foot',
   props: {},
   components: {},
   data: function() {
-    return {};
+    return {
+      info: {},
+    };
+  },
+  async created() {
+    await this.search();
+  },
+  methods: {
+    ...siteinfo(['query']),
+    async search() {
+      let res = await this.query();
+      if (this.$checkRes(res)) {
+        this.$set(this, `info`, res.data[0]);
+      }
+    },
   },
-  created() {},
-  methods: {},
   computed: {
     ...mapState(['user']),
   },

+ 18 - 7
src/components/common/links.vue

@@ -7,7 +7,7 @@
         </el-col>
         <el-col :span="21" class="info">
           <el-col :span="6" class="list" v-for="(item, index) in linkList" :key="index">
-            <el-link :href="item.url" :underline="false">
+            <el-link :href="item.url" :underline="false" target="_blank">
               <el-image :src="item.pic" style="width:245px;height:53px;"></el-image>
             </el-link>
           </el-col>
@@ -19,17 +19,28 @@
 
 <script>
 import { mapState, createNamespacedHelpers } from 'vuex';
+const { mapActions: link } = createNamespacedHelpers('links');
 export default {
   name: 'links',
-  props: {
-    linkList: { type: Array },
-  },
+  props: {},
   components: {},
   data: function() {
-    return {};
+    return {
+      linkList: [],
+    };
+  },
+  async created() {
+    await this.search();
+  },
+  methods: {
+    ...link(['query']),
+    async search() {
+      let res = await this.query();
+      if (this.$checkRes(res)) {
+        this.$set(this, `linkList`, res.data);
+      }
+    },
   },
-  created() {},
-  methods: {},
   computed: {
     ...mapState(['user']),
   },

+ 15 - 4
src/components/common/top.vue

@@ -11,8 +11,8 @@
           <div class="w_1200">
             <el-col :span="18" class="logo">
               <a href="/">
-                <p class="title">阿勒泰地区科技创新创业服务平台</p>
-                <p class="e-title">Altay technology innovation and entrepreneurship service platform</p>
+                <p class="title">{{ info.title }}</p>
+                <p class="e-title">{{ info.engtitle }}</p>
               </a>
             </el-col>
             <el-col :span="6" class="search">
@@ -27,6 +27,7 @@
 
 <script>
 import { mapState, createNamespacedHelpers } from 'vuex';
+const { mapActions: siteinfo } = createNamespacedHelpers('siteinfo');
 var moment = require('moment');
 export default {
   metaInfo() {
@@ -39,13 +40,23 @@ export default {
     return {
       input: '',
       today: '',
+      info: {},
     };
   },
-  created() {
+  async created() {
+    await this.search();
     let today = moment().format('LL dddd');
     if (today) this.$set(this, `today`, today);
   },
-  methods: {},
+  methods: {
+    ...siteinfo(['query']),
+    async search() {
+      let res = await this.query();
+      if (this.$checkRes(res)) {
+        this.$set(this, `info`, res.data[0]);
+      }
+    },
+  },
   computed: {
     ...mapState(['user']),
   },

+ 8 - 2
src/layout/index/tztg.vue

@@ -18,7 +18,7 @@
               {{ item.title }}
             </el-col>
             <el-col :span="4" class="date textOver">
-              {{ item.date }}
+              {{ getdata(item.create_time) }}
             </el-col>
           </el-col>
         </el-col>
@@ -29,6 +29,7 @@
 
 <script>
 import { mapState, createNamespacedHelpers } from 'vuex';
+var moment = require('moment');
 export default {
   metaInfo() {
     return { title: this.$route.meta.title };
@@ -40,7 +41,12 @@ export default {
     return {};
   },
   created() {},
-  methods: {},
+  methods: {
+    getdata(value) {
+      let date = moment(value).format('MM-DD');
+      if (date) return date;
+    },
+  },
   computed: {
     ...mapState(['user']),
   },

+ 8 - 2
src/layout/index/zcfg.vue

@@ -18,7 +18,7 @@
               {{ item.title }}
             </el-col>
             <el-col :span="4" class="date textOver">
-              {{ item.date }}
+              {{ getdata(item.create_time) }}
             </el-col>
           </el-col>
         </el-col>
@@ -29,6 +29,7 @@
 
 <script>
 import { mapState, createNamespacedHelpers } from 'vuex';
+var moment = require('moment');
 export default {
   metaInfo() {
     return { title: this.$route.meta.title };
@@ -40,7 +41,12 @@ export default {
     return {};
   },
   created() {},
-  methods: {},
+  methods: {
+    getdata(value) {
+      let date = moment(value).format('MM-DD');
+      if (date) return date;
+    },
+  },
   computed: {
     ...mapState(['user']),
   },

+ 1 - 1
src/layout/index/zxzx.vue

@@ -18,7 +18,7 @@
               {{ item.title }}
             </el-col>
             <el-col :span="4" class="date textOver">
-              {{ item.date }}
+              {{ item.create_time }}
             </el-col>
           </el-col>
         </el-col>

+ 30 - 2
src/views/index copy.vue

@@ -56,6 +56,9 @@ import zxfw from '@/layout/index/zxfw.vue';
 // 基本配置
 import { kjfw } from '@/util/Basics';
 import { mapState, createNamespacedHelpers } from 'vuex';
+const { mapActions: concolumn } = createNamespacedHelpers('concolumn');
+const { mapActions: connews } = createNamespacedHelpers('connews');
+
 export default {
   metaInfo() {
     return { title: this.$route.meta.title };
@@ -127,8 +130,33 @@ export default {
       ],
     };
   },
-  created() {},
-  methods: {},
+  async created() {
+    await this.search();
+  },
+  methods: {
+    ...concolumn({ columnquery: 'query', columnfetch: 'fetch' }),
+    ...connews({ connewsquery: 'query', connewsfetch: 'fetch' }),
+    async search() {
+      let res = await this.columnquery();
+      if (this.$checkRes(res)) {
+        let zxzx = res.data.find(i => i.site == 'zxzx');
+        if (zxzx) {
+          let res = await this.connewsquery({ limit: 9, column_id: zxzx.id });
+          if (this.$checkRes(res)) this.$set(this, `${zxzx.site}List`, res.data);
+        }
+        let tztg = res.data.find(i => i.site == 'tztg');
+        if (tztg) {
+          let res = await this.connewsquery({ limit: 5, column_id: tztg.id });
+          if (this.$checkRes(res)) this.$set(this, `${tztg.site}List`, res.data);
+        }
+        let zcfg = res.data.find(i => i.site == 'zcfg');
+        if (zcfg) {
+          let res = await this.connewsquery({ limit: 5, column_id: zcfg.id });
+          if (this.$checkRes(res)) this.$set(this, `${zcfg.site}List`, res.data);
+        }
+      }
+    },
+  },
   computed: {
     ...mapState(['user']),
   },