lrf402788946 hace 5 años
padre
commit
e375746adb
Se han modificado 3 ficheros con 29 adiciones y 7 borrados
  1. 5 2
      src/layout/index/native.vue
  2. 16 1
      src/layout/news/newsRight.vue
  3. 8 4
      src/views/news/list.vue

+ 5 - 2
src/layout/index/native.vue

@@ -7,7 +7,7 @@
           <el-submenu :index="`${index}`" :key="index" v-if="item.type !== 'url' && item.type !== 'content'">
             <!-- 输出一级栏目↓ -->
             <template slot="title">
-              {{ item.title }}
+              <span @click="levelOne(item)">{{ item.title }}</span>
             </template>
             <template v-for="(sub, subIndex) in item.children">
               <template v-if="sub.children">
@@ -63,7 +63,10 @@ export default {
     },
     handleSelect(key, keyPath) {
       // console.log(key, keyPath);
-    }
+    },
+    levelOne(item){
+      this.$router.push({ path: item.children[0].path })
+    },
   },
 };
 </script>

+ 16 - 1
src/layout/news/newsRight.vue

@@ -16,7 +16,7 @@
             </el-input>
           </div>
         </el-col>
-        <el-col :span="24" class="list">
+        <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="twoTitle">
@@ -38,6 +38,20 @@
             </el-col>
           </el-col>
         </el-col>
+        <el-col :span="24" class="list" v-else>
+          <el-tabs v-model="activeName" type="border-card">
+            <el-tab-pane v-for="(item, index) in newsRightList.data" :key="index" :name="`${index}`" :label="item.title">
+              <el-col :span="24" class="children" v-for="(tag, index) in item.children" :key="index">
+              <el-col :span="20" class="title" @click.native="$router.push({ name: 'detail', params:{id:tag.id} })">
+                <p class="textOver">{{ tag.title }}</p>
+              </el-col>
+              <el-col :span="4" class="time">
+                {{tag.publish_time}}
+              </el-col>
+            </el-col>
+            </el-tab-pane>
+          </el-tabs>
+        </el-col>
       </el-col>
     </el-row>
   </div>
@@ -53,6 +67,7 @@ export default {
   data: () => ({
     input3: '',
     currentPage: 1,
+    activeName: '0',
   }),
   created() { },
   computed: {},

+ 8 - 4
src/views/news/list.vue

@@ -14,11 +14,13 @@
       <el-col :span="24" class="main">
         <div class="w_1200">
           <el-col :span="6">
-            <newsLeft></newsLeft>
+            <newsLeft v-if="type === 'least'"></newsLeft>
+            <menuLeft v-else-if="type === 'needMenu'"></menuLeft>
+            <!-- TODO:还有cg(成果交流)和jl(交流)两个侧菜单 -->
           </el-col>
           <el-col :span="18">
-            <newsRight :newsRightList="newsRightList" :total="total" v-if="!type"></newsRight>
-            <noLeft v-else :newsRightList="newsRightList"></noLeft>
+            <newsRight :newsRightList="newsRightList" :total="total"></newsRight>
+            <!-- <noLeft v-else :newsRightList="newsRightList"></noLeft> -->
           </el-col>
         </div>
       </el-col>
@@ -33,6 +35,7 @@
 import top from '../../layout/index/top.vue';
 import native from '../../layout/index/native.vue';
 import newsRight from '../../layout/news/newsRight.vue';
+import menuLeft from '../../layout/list/mainLeft.vue';
 import newsLeft from '../../layout/news/newsLeft.vue';
 import footinfo from '../../layout/index/foot.vue';
 export default {
@@ -42,7 +45,7 @@ export default {
     topInfo: null,//网络头部
     newsRightList: null,//新闻右侧列表
     total: null,
-    type: { type: Boolean, default: false }
+    type: { type: String }
   },
   components: {
     top,//头部
@@ -50,6 +53,7 @@ export default {
     newsLeft,//新闻左侧
     newsRight,//新闻右侧
     footinfo,//底部信息
+    menuLeft,//菜单
   },
   data: () => ({}),
   created() { },