xiejiacheng 5 years ago
parent
commit
8ddc8bcc7d

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

@@ -8,7 +8,7 @@
           </el-col>
           <el-col :span="6" style="text-align:right;">
             <el-link :underline="false" :style="`color:${Color}`"
-                     @click="$router.push({ path: `list/${chengguolist[0].id}` })">MORE<i
+                     @click="$router.push({ path: `list/moreList/${chengguolist[0].id}` })">MORE<i
                  class="el-icon-video-play"></i></el-link>
           </el-col>
         </el-col>

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

@@ -8,7 +8,7 @@
           </el-col>
           <el-col :span="6" style="text-align:right;">
             <el-link :underline="false" :style="`color:${Color}`"
-                     @click="$router.push({ path: `list/${fabuList[0].id}` })">MORE<i class="el-icon-video-play"></i>
+                     @click="$router.push({ path: `list/moreList/${fabuList[0].id}` })">MORE<i class="el-icon-video-play"></i>
             </el-link>
           </el-col>
         </el-col>

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

@@ -7,7 +7,7 @@
             <span :style="`border-color:${borderColor}`">{{title}}</span>
           </el-col>
           <el-col :span="6" style="text-align:right;">
-            <el-link :underline="false" :style="`color:${Color}`"  @click="$router.push({ path: `list/${noticelist.column.id}` })">MORE<i class="el-icon-video-play"></i></el-link>
+            <el-link :underline="false" :style="`color:${Color}`"  @click="$router.push({ path: `list/moreList/${noticelist.column.id}` })">MORE<i class="el-icon-video-play"></i></el-link>
           </el-col>
         </el-col>
         <el-col :span="24" class="newsMain">

+ 2 - 2
src/layout/news/newsRight.vue

@@ -25,7 +25,7 @@
               </el-col>
               <el-col :span="3" class="more">
                 <!-- @click="$router.push({ path: `moreList/${newsRightList[0].id}` })" -->
-                <el-link :underline="false" @click="$router.push({ path: `moreList/${newsRightList[0].id}` })">more</el-link>
+                <el-link :underline="false" @click="$router.push({ path: `moreList/${item.id}` })">more</el-link>
               </el-col>
             </el-col>
             <el-col :span="24" class="children" v-for="(tag, index) in item.children" :key="index">
@@ -69,7 +69,7 @@ export default {
     currentPage: 1,
     activeName: '0',
   }),
-  created() { },
+  created() {},
   computed: {},
   methods: {
     handleSizeChange(val) {

+ 116 - 0
src/layout/news/newsRights.vue

@@ -0,0 +1,116 @@
+<template>
+  <div id="newsRights">
+    <el-row>
+      <el-col :span="24" class="main">
+        <el-col :span="24" class="top">
+          <el-breadcrumb separator-class="el-icon-arrow-right">
+            <el-breadcrumb-item :to="{ path: '/' }"><i class="el-icon-s-home"></i>网站首页</el-breadcrumb-item>
+            <el-breadcrumb-item>导航一</el-breadcrumb-item>
+            <el-breadcrumb-item>数据列表</el-breadcrumb-item>
+          </el-breadcrumb>
+        </el-col>
+        <el-col :span="24" class="search">
+          <div>
+            <el-input placeholder="请输入内容" v-model="input3" class="input-with-select">
+              <el-button slot="append" icon="el-icon-search"></el-button>
+            </el-input>
+          </div>
+        </el-col>
+        <el-col :span="24" class="list" v-if="!newsRightList.type">
+          <el-col :span="24" class="mainRightList" v-for="(item,index) in newsRightList" :key="index" :type="item.type">
+            <el-col :span="24" class="children">
+              <el-col :span="20" class="title" @click.native="$router.push({name:'detail',params:{id:item.id}})">
+                <p class="textOver">{{item.title}}</p>
+              </el-col>
+              <el-col :span="4" class="time">
+                {{item.publish_time}}
+              </el-col>
+            </el-col>
+          </el-col>
+        </el-col>
+      </el-col>
+    </el-row>
+  </div>
+</template>
+
+<script>
+export default {
+  name: 'newsRights',
+  props: {
+    newsRightList: null,
+  },
+  components: {},
+  data: () => ({
+    activeName: '0',
+    currentPage: 1,
+    input3: '',
+  }),
+  created() { },
+  computed: {},
+  methods: {
+    handleSizeChange(val) {
+      // eslint-disable-next-line no-console
+      console.log(`每页 ${val} 条`);
+    },
+    handleCurrentChange(val) {
+      // eslint-disable-next-line no-console
+      console.log(`当前页: ${val}`);
+    }
+  },
+};
+</script>
+
+<style lang="less" scoped>
+p {
+  margin: 0;
+  padding: 0;
+}
+.textOver {
+  overflow: hidden;
+  text-overflow: ellipsis;
+  white-space: nowrap;
+}
+.main {
+  width: 880px;
+  min-height: 500px;
+  margin: 0 0 0 20px;
+  background-color: rgba(255, 255, 255, 0.8);
+}
+.top {
+  margin: 10px 0 0 20px;
+}
+.search {
+  margin: 20px 0;
+  padding: 0 20px;
+}
+/deep/.el-input-group {
+  width: 40%;
+}
+/deep/.el-input__inner {
+  border: 1px solid #336699;
+}
+/deep/.el-input-group__append {
+  border: 1px solid #336699;
+  background-color: #336699;
+  color: #fff;
+}
+.list {
+  padding: 0 20px;
+}
+.children {
+  padding: 8px 10px;
+  border-bottom: 1px dashed #000;
+}
+.children:hover .title {
+  color: #336699;
+  cursor: pointer;
+}
+.children .title {
+  font-size: 18px;
+}
+.children .time {
+  font-size: 18px;
+  text-align: center;
+  color: red;
+}
+</style>

+ 6 - 1
src/views/news/list.vue

@@ -21,7 +21,10 @@
             <!-- TODO:还有cg(成果交流)和jl(交流)两个侧菜单 -->
           </el-col>
           <el-col :span="18">
-            <newsRight :newsRightList="newsRightList" :total="total"></newsRight>
+           <newsRight v-if="type === 'least'" :newsRightList="newsRightList" :total="total"></newsRight>
+            <newsRight v-else-if="type === 'needMenu'" :newsRightList="newsRightList" :total="total"></newsRight>
+            <newsRights v-else-if="type === 'cg'" :newsRightList="newsRightList" :total="total"></newsRights>
+            <newsRight v-else-if="type === 'jl'" :newsRightList="newsRightList" :total="total"></newsRight>
             <!-- <noLeft v-else :newsRightList="newsRightList"></noLeft> -->
           </el-col>
         </div>
@@ -37,6 +40,7 @@
 import top from '../../layout/index/top.vue';
 import native from '../../layout/index/native.vue';
 import newsRight from '../../layout/news/newsRight.vue';
+import newsRights from '../../layout/news/newsRights.vue';
 import menuLeft from '../../layout/list/mainLeft.vue';
 import gainLeft from '../../layout/gain/gainLeft.vue';
 import interflowLeft from '../../layout/interflow/interflowLeft.vue';
@@ -60,6 +64,7 @@ export default {
     menuLeft,//菜单
     gainLeft,//成果展示左侧菜单
     interflowLeft,//交流互动左侧菜单
+    newsRights,
   },
   data: () => ({}),
   created() { },