浏览代码

科技数据更新+后续加详情

guhongwei 5 年之前
父节点
当前提交
16f93f5e1f
共有 3 个文件被更改,包括 58 次插入110 次删除
  1. 17 8
      src/layout/government/news.vue
  2. 1 1
      src/layout/government/notice.vue
  3. 40 101
      src/views/government/government.vue

+ 17 - 8
src/layout/government/news.vue

@@ -8,10 +8,10 @@
             <ul>
               <li class="chuangxinList" v-for="(item, index) in chuangxinList" :key="index">
                 <el-col :span="19" class="title textOver">{{ item.title }}</el-col>
-                <el-col :span="4" class="date"> {{ item.date }}</el-col>
+                <el-col :span="4" class="date"> {{ item.meta && item.meta.createdAt ? new Date(item.meta.createdAt).toLocaleDateString() : '' || '' }}</el-col>
               </li>
             </ul>
-            <el-col class="more" :span="24">查看更多</el-col>
+            <!-- <el-col class="more" :span="24">查看更多</el-col> -->
           </el-col>
         </el-tab-pane>
         <el-tab-pane>
@@ -20,10 +20,10 @@
             <ul>
               <li class="chuangxinList" v-for="(item, index) in guoneiList" :key="index">
                 <el-col :span="19" class="title textOver">{{ item.title }}</el-col>
-                <el-col :span="4" class="date"> {{ item.date }}</el-col>
+                <el-col :span="4" class="date"> {{ item.meta && item.meta.createdAt ? new Date(item.meta.createdAt).toLocaleDateString() : '' || '' }}</el-col>
               </li>
             </ul>
-            <el-col class="more" :span="24">查看更多</el-col>
+            <!-- <el-col class="more" :span="24">查看更多</el-col> -->
           </el-col>
         </el-tab-pane>
         <el-tab-pane>
@@ -32,10 +32,10 @@
             <ul>
               <li class="chuangxinList" v-for="(item, index) in zhengwuList" :key="index">
                 <el-col :span="19" class="title textOver">{{ item.title }}</el-col>
-                <el-col :span="4" class="date"> {{ item.date }}</el-col>
+                <el-col :span="4" class="date"> {{ item.meta && item.meta.createdAt ? new Date(item.meta.createdAt).toLocaleDateString() : '' || '' }}</el-col>
               </li>
             </ul>
-            <el-col class="more" :span="24">查看更多</el-col>
+            <!-- <el-col class="more" :span="24">查看更多</el-col> -->
           </el-col>
         </el-tab-pane>
         <el-tab-pane>
@@ -44,10 +44,10 @@
             <ul>
               <li class="chuangxinList" v-for="(item, index) in meitiList" :key="index">
                 <el-col :span="19" class="title textOver">{{ item.title }}</el-col>
-                <el-col :span="4" class="date"> {{ item.date }}</el-col>
+                <el-col :span="4" class="date"> {{ item.meta && item.meta.createdAt ? new Date(item.meta.createdAt).toLocaleDateString() : '' || '' }}</el-col>
               </li>
             </ul>
-            <el-col class="more" :span="24">查看更多</el-col>
+            <!-- <el-col class="more" :span="24">查看更多</el-col> -->
           </el-col>
         </el-tab-pane>
       </el-tabs>
@@ -94,6 +94,15 @@ li {
   width: 540px;
   padding: 0 0 7px 0;
 }
+.chuangxinList:hover {
+  cursor: pointer;
+}
+.chuangxinList:hover .title {
+  color: #22529a;
+}
+.chuangxinList:hover .date {
+  color: #22529a;
+}
 .list .title {
   margin: 0 20px 0 0;
   color: #6d6d77;

+ 1 - 1
src/layout/government/notice.vue

@@ -13,7 +13,7 @@
             <li class="zixunList" v-for="(item, index) in tongzhiList" :key="index">
               <el-link :underline="false">
                 <span class="title textOver">{{ item.title }}</span>
-                <span class="date textOver">{{ item.date }}</span>
+                <span class="date textOver">{{ item.meta && item.meta.createdAt ? new Date(item.meta.createdAt).toLocaleDateString() : '' || '' }}</span>
               </el-link>
             </li>
           </ul>

+ 40 - 101
src/views/government/government.vue

@@ -3,12 +3,12 @@
     <government-detail
       :info="info"
       :photoNews="tpxwList"
+      :chuangxinList="cxjlList"
+      :guoneiList="gndtList"
+      :zhengwuList="zwhdList"
+      :meitiList="mtjjList"
+      :tongzhiList="tzggList"
       :zhengwu="zhengwu"
-      :chuangxinList="chuangxinList"
-      :guoneiList="guoneiList"
-      :zhengwuList="zhengwuList"
-      :meitiList="meitiList"
-      :tongzhiList="tongzhiList"
       :gongzhongList="gongzhongList"
       :linkList="linkList"
     ></government-detail>
@@ -30,61 +30,53 @@ export default {
   },
   data: () => ({
     info: {},
+    leftId: '',
     // 图片新闻
-    photoNews: {
-      pic: require('@/assets/photoNews.jpg'),
-      title: '标题',
-    },
-    chuangxinList: [
-      {
-        title: '创新吉林',
-        date: '2019-03-06',
-      },
-      {
-        title: '十条数据',
-        date: '2019-03-06',
-      },
-    ],
-    guoneiList: [
-      {
-        title: '国内动态',
-        date: '2019-03-06',
-      },
-      {
-        title: '十条数据',
-        date: '2019-03-06',
-      },
-    ],
-    zhengwuList: [
+    tpxwList: [],
+    // 创新吉林
+    cxjlList: [],
+    // 国内动态
+    gndtList: [],
+    // 媒体聚焦
+    mtjjList: [],
+    // 通知公告
+    tzggList: [],
+    // 政务活动
+    zwhdList: [],
+    // 公众参与
+    gongzhongList: [
       {
-        title: '政务活动',
-        date: '2019-03-06',
+        url: 'http://kjt.jl.gov.cn/gzcy/tzxx/',
+        pic: require('@/assets/gk1.png'),
+        title: '厅长信箱',
       },
       {
-        title: '十条数据',
-        date: '2019-03-06',
+        url: 'http://kjt.jl.gov.cn/gzcy/zxzx/',
+        pic: require('@/assets/gk2.png'),
+        title: '在线咨询',
       },
-    ],
-    meitiList: [
       {
-        title: '媒体聚焦',
-        date: '2019-03-06',
+        url: 'http://kjt.jl.gov.cn/gzcy/jdts/',
+        pic: require('@/assets/gk3.png'),
+        title: '监督投诉',
       },
       {
-        title: '十条数据',
-        date: '2019-03-06',
+        url: 'http://kjt.jl.gov.cn/gzcy/jyxc/',
+        pic: require('@/assets/gk4.png'),
+        title: '建言献策',
       },
-    ],
-    tongzhiList: [
       {
-        title: '通知公告',
-        date: '2019-03-06',
+        url: 'http://kjt.jl.gov.cn/gzcy/wsdc/',
+        pic: require('@/assets/gk5.png'),
+        title: '网上调查',
       },
       {
-        title: '八条数据',
-        date: '2019-03-06',
+        title: '党政资料',
+        url: 'http://139.210.167.203/free-technological-management/PersonalFiles/getPersonalFileList?pageNumber=1',
+        pic: require('@/assets/gk6.png'),
       },
     ],
+    // 政务公开
     zhengwu: [
       {
         title: '高企认定',
@@ -127,46 +119,8 @@ export default {
         pic: require('@/assets/zw8.png'),
       },
     ],
-    gongzhongList: [
-      {
-        url: 'http://kjt.jl.gov.cn/gzcy/tzxx/',
-        pic: require('@/assets/gk1.png'),
-        title: '厅长信箱',
-      },
-      {
-        url: 'http://kjt.jl.gov.cn/gzcy/zxzx/',
-        pic: require('@/assets/gk2.png'),
-        title: '在线咨询',
-      },
-      {
-        url: 'http://kjt.jl.gov.cn/gzcy/jdts/',
-        pic: require('@/assets/gk3.png'),
-        title: '监督投诉',
-      },
-      {
-        url: 'http://kjt.jl.gov.cn/gzcy/jyxc/',
-        pic: require('@/assets/gk4.png'),
-        title: '建言献策',
-      },
-      {
-        url: 'http://kjt.jl.gov.cn/gzcy/wsdc/',
-        pic: require('@/assets/gk5.png'),
-        title: '网上调查',
-      },
-      {
-        title: '党政资料',
-        url: 'http://139.210.167.203/free-technological-management/PersonalFiles/getPersonalFileList?pageNumber=1',
-        pic: require('@/assets/gk6.png'),
-      },
-    ],
+    // 友情链接
     linkList: [],
-    leftId: '',
-    tzggList: [],
-    mtjjList: [],
-    zwhdList: [],
-    gndtList: [],
-    cxjlList: [],
-    tpxwList: [],
   }),
   created() {
     this.searchSite();
@@ -200,33 +154,18 @@ export default {
     async searchColumn({ ...info } = {}) {
       const res = await this.columnList({ ...info });
       for (const val of res.data) {
-        // if (val.site == 'tpxw') {
-        //   console.log(val.id);
-        //   this.$set(this, `leftId`, val.id);
-        //   this.tpxwSearch();
-        // } else if (val.site == 'cxjl') {
-        //   console.log(val.id);
-        // } else if (val.site == 'gndt') {
-        //   console.log(val.id);
-        // } else if (val.site == 'zwhd') {
-        //   console.log(val.id);
-        // } else if (val.site == 'mtjj') {
-        //   console.log(val.id);
-        // } else if (val.site == 'tzgg') {
-        //   console.log(val.id);
-        // }
         this.tpxwSearch({ column_id: val.id, site: val.site });
       }
     },
     // 查询信息列表
     async tpxwSearch({ skip = 0, limit = 10, column_id, site } = {}) {
-      console.log(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);
     },
   },
 };