guhongwei 5 năm trước cách đây
mục cha
commit
844598db46

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

@@ -27,7 +27,7 @@
         </el-col> -->
         <el-col :span="24" class="newsMain">
           <el-col :span="24" v-for="(tag, index) in chengguolist" :key="index" :type="tag.type">
-            <el-carousel indicator-position="outside">
+            <el-carousel indicator-position="outside" type="card" :interval="3000">
               <el-carousel-item v-for="(item, index) in tag.children" :key="index">
                 <el-col :span="24" class="link" @click.native="$router.push({ name: 'detail', params:{id:item.id} })">
                   <el-col :span="24">

+ 94 - 0
src/layout/index/iconList.vue

@@ -0,0 +1,94 @@
+<template>
+  <div id="icon-link">
+    <el-row>
+      <el-col :span="24" class="news" style="background:#fff">
+        <el-col :span="24" class="topTit" v-if="title">
+          <el-col :span="18">
+            <span :style="`border-color:${borderColor}`">{{title}}</span>
+          </el-col>
+        </el-col>
+        <el-col :span="24" class="newsMain">
+          <el-row :gutter="10">
+            <el-col :span="4" v-for="(item, index) in dataList" :key="index" style="text-align:center;">
+              <el-link :href="item.url">
+                <el-image :src="item.pic" fit="scale-down" style="zoom:0.4"></el-image>
+                <p style="color:#409EFF">{{item.title}}</p>
+              </el-link>
+            </el-col>
+          </el-row>
+        </el-col>
+      </el-col>
+    </el-row>
+  </div>
+</template>
+
+<script>
+export default {
+  name: 'icon-link',
+  props: {
+    title: null,
+    list: null,
+  },
+  components: {},
+  data: () => ({
+    borderColor: '#850000',
+    Color: '#850000',
+    dataList: [],
+  }),
+  watch:{
+    list:{
+      handler(val){
+        if(val) this.$set(this, `dataList`, val);
+      },
+      immediate: true
+    }
+  },
+  created() {},
+  computed: {},
+  methods: {},
+};
+</script>
+
+<style lang="less" scoped>
+p {
+  margin: 0;
+  padding: 0;
+}
+.textOver {
+  overflow: hidden;
+  text-overflow: ellipsis;
+  white-space: nowrap;
+}
+.news {
+  padding: 10px;
+}
+.topTit {
+  border-bottom: 1px solid #ccc;
+}
+.topTit span {
+  display: inline-block;
+  height: 30px;
+  border-bottom: 1px solid transparent;
+}
+.chengguolist {
+  padding: 10px 0;
+  border-bottom: 1px dashed #ccc;
+  margin: 1px;
+}
+.newsMain {
+  padding: 5px 0;
+}
+.newsMain .title {
+  position: absolute;
+  bottom: 0;
+  background: rgba(119, 136, 153, 0.5);
+}
+.newsMain .title p {
+  font-size: 25px;
+  padding: 0 10px;
+  color: #fff;
+  overflow: hidden;
+  text-overflow: ellipsis;
+  white-space: nowrap;
+}
+</style>

+ 92 - 0
src/layout/index/link.vue

@@ -0,0 +1,92 @@
+<template>
+  <div id="chengguo">
+    <el-row>
+      <el-col :span="24" class="news" style="background:#fff">
+        <el-col :span="24" class="topTit">
+          <el-col :span="18">
+            <span :style="`border-color:${borderColor}`">{{title}}</span>
+          </el-col>
+        </el-col>
+        <el-col :span="24" class="newsMain">
+          <el-row :gutter="10">
+            <el-col :span="6" v-for="(item, index) in dataList" :key="index">
+              <el-image :src="item.pic" fit="scale-down"></el-image>
+            </el-col>
+          </el-row>
+        </el-col>
+      </el-col>
+    </el-row>
+  </div>
+</template>
+
+<script>
+export default {
+  name: 'chengguo',
+  props: {
+    title: null,
+    list: null,
+  },
+  components: {},
+  data: () => ({
+    borderColor: '#850000',
+    Color: '#850000',
+    dataList: [],
+  }),
+  watch:{
+    list:{
+      handler(val){
+        if(val) this.$set(this, `dataList`, val);
+      },
+      immediate: true
+    }
+  },
+  created() {
+  },
+  computed: {},
+  methods: {},
+};
+</script>
+
+<style lang="less" scoped>
+p {
+  margin: 0;
+  padding: 0;
+}
+.textOver {
+  overflow: hidden;
+  text-overflow: ellipsis;
+  white-space: nowrap;
+}
+.news {
+  padding: 10px;
+}
+.topTit {
+  border-bottom: 1px solid #ccc;
+}
+.topTit span {
+  display: inline-block;
+  height: 30px;
+  border-bottom: 1px solid transparent;
+}
+.chengguolist {
+  padding: 10px 0;
+  border-bottom: 1px dashed #ccc;
+  margin: 1px;
+}
+.newsMain {
+  padding: 5px 0;
+}
+.newsMain .title {
+  position: absolute;
+  bottom: 0;
+  background: rgba(119, 136, 153, 0.5);
+}
+.newsMain .title p {
+  font-size: 25px;
+  padding: 0 10px;
+  color: #fff;
+  overflow: hidden;
+  text-overflow: ellipsis;
+  white-space: nowrap;
+}
+</style>

+ 26 - 6
src/layout/index/native.vue

@@ -3,7 +3,7 @@
     <el-row>
       <el-menu :default-active="activeIndex2" class="el-menu-demo" mode="horizontal" @select="handleSelect"
                background-color="rgba(0,0,0,0.4)" text-color="#fff" active-text-color="#fff">
-        <el-submenu index="1">
+        <!-- <el-submenu index="1">
           <template slot="title">新闻资讯</template>
           <el-menu-item index="1-1" style="float: left;height:60px;line-height:60px;font-size:20px;" class="hover">新闻资讯
           </el-menu-item>
@@ -16,11 +16,31 @@
           <template slot="title">计算服务</template>
           <el-menu-item index="2-1" style="float: left;height:60px;line-height:60px;font-size:20px;" class="hover">计算服务
           </el-menu-item>
-          <el-menu-item index="2-2" style="float: left;height:60px;line-height:60px;font-size:20px;" class="hover">计算服务
-          </el-menu-item>
-          <el-menu-item index="2-3" style="float: left;height:60px;line-height:60px;font-size:20px;" class="hover">计算服务
-          </el-menu-item>
-        </el-submenu>
+          <el-menu-item index="2-2" style="float: left;height:60px;line-height:60px;font-size:20px;" class="hover">计算服务</el-menu-item>
+          <el-menu-item index="2-3" style="float: left;height:60px;line-height:60px;font-size:20px;" class="hover">计算服务</el-menu-item>
+        </el-submenu> -->
+        <template v-for="(item, index) in menu">
+          <el-submenu :index="`${index}`" :key="index" v-if="item.type !== 'url' && item.type !== 'content'">
+            <!-- 输出一级栏目↓ -->
+            <template slot="title">
+              {{ item.title }}
+            </template>
+            <template v-for="(sub, subIndex) in item.children">
+              <template v-if="sub.children">
+                <template v-for="(thr,thrIndex) in sub.children">
+                  <el-menu-item :index="thr.path" :key="thrIndex+'thr'" v-if="thr.type !== 'url'" style="float: left;height:60px;line-height:60px;font-size:20px;" class="hover">{{ thr.title }}</el-menu-item>
+                  <el-menu-item :index="``" :key="thrIndex+'thr'" @click="turnTo(thr.url)" v-else style="float: left;height:60px;line-height:60px;font-size:20px;" class="hover"> {{ thr.title }}</el-menu-item>
+                </template>
+              </template>
+              <el-menu-item :index="sub.path" :key="subIndex+'sub'" v-else-if="sub.type === 'content'||sub.type==='column'" style="float: left;height:60px;line-height:60px;font-size:20px;" class="hover">{{ sub.title }}</el-menu-item>
+              <el-menu-item :index="`${index}-${subIndex}`" :key="subIndex+'sub'" @click="turnTo(sub.url)" v-else style="float: left;height:60px;line-height:60px;font-size:20px;" class="hover"> {{ sub.title }}</el-menu-item>
+            </template>
+          </el-submenu>
+          <!-- 一级栏目非常规栏目情况 -->
+          <el-menu-item v-else-if="item.type === 'content'" :index="item.path" :key="index" style="float: left;height:60px;line-height:60px;font-size:20px;" class="hover">{{ item.title }}</el-menu-item>
+          <el-menu-item v-else :index="``" :key="index" @click="turnTo(item.url)" style="float: left;height:60px;line-height:60px;font-size:20px;" class="hover">{{ item.title }}</el-menu-item>
+          <!-- 输出一级栏目结束↑ -->
+        </template>
       </el-menu>
     </el-row>
   </div>

+ 23 - 0
src/views/index/index.vue

@@ -43,6 +43,20 @@
           </el-row>
         </div>
       </el-col>
+      <el-col :span="24" class="mains" style="height:auto;">
+        <div class="w_1200">
+          <el-col :span="24" class="link">
+            <iconList :list="iconList"> </iconList>
+          </el-col>
+        </div>
+      </el-col>
+      <el-col :span="24" class="mains" style="height:auto;">
+        <div class="w_1200">
+          <el-col :span="24" class="link">
+            <links title="友情链接" :list="linkList"> </links>
+          </el-col>
+        </div>
+      </el-col>
       <el-col :span="24" class="down">
         <footinfo :topInfo="topInfo"></footinfo>
       </el-col>
@@ -60,6 +74,8 @@ import chengguo from '../../layout/index/chengguo.vue';
 import footinfo from '../../layout/index/foot.vue';
 import infoList from '../../layout/index/infoList.vue';
 import tabsList from '../../layout/index/tabsList.vue';
+import links from '../../layout/index/link.vue';
+import iconList from '../../layout/index/iconList.vue';
 export default {
   name: 'index',
   props: {
@@ -70,6 +86,8 @@ export default {
     chengguolist: null, //成果展示
     partyList: null, //党建信息
     tabsList: null, //标签页列表
+    linkList:null, //友情链接列表
+    iconList: null, //图标链接列表
     footlist: null,
   },
   components: {
@@ -82,6 +100,8 @@ export default {
     footinfo,
     infoList,
     tabsList,
+    links,
+    iconList,
   },
   data: () => ({}),
   created() { },
@@ -147,4 +167,7 @@ export default {
   box-shadow: 0 0 2px #ccc;
   overflow: hidden;
 }
+.link{
+  width:100%;
+}
 </style>