Browse Source

添加详情页面包屑/列表点击事件

asd123a20 2 years ago
parent
commit
240948e59a

+ 4 - 4
src/components/foots/index.vue

@@ -58,12 +58,12 @@ export default {
   height: 300px;
   height: 300px;
   background-color: #f5f5fb;
   background-color: #f5f5fb;
   .main {
   .main {
-    width: 70%;
+    width: 50%;
     display: flex;
     display: flex;
     margin: 0 auto;
     margin: 0 auto;
     padding-top: 5%;
     padding-top: 5%;
     .sign {
     .sign {
-      width: 10%;
+      width: 13%;
     }
     }
     .info {
     .info {
       width: 80%;
       width: 80%;
@@ -80,11 +80,11 @@ export default {
       }
       }
       .itemBox2 {
       .itemBox2 {
         .item {
         .item {
-          width: 40%;
+          // width: 40%;
           text-align: center;
           text-align: center;
         }
         }
         .item2 {
         .item2 {
-          width: 20%;
+          // width: 20%;
         }
         }
       }
       }
       .itemBox3 .item {
       .itemBox3 .item {

+ 1 - 1
src/components/heads/nav/index.vue

@@ -45,7 +45,7 @@ export default {
       const parentCode = env.code.substring(0, 2);
       const parentCode = env.code.substring(0, 2);
       // 如果编码 = 00 进入主页
       // 如果编码 = 00 进入主页
       if (env.code == '00') {
       if (env.code == '00') {
-        this.$router.push('/www');
+        this.$router.push('/');
         return;
         return;
       }
       }
       // 如果编码 = 012(领导)进入领导页
       // 如果编码 = 012(领导)进入领导页

+ 5 - 0
src/components/list/index.vue

@@ -78,6 +78,11 @@ export default {
       this.$emit('tabClick', { name: this.code });
       this.$emit('tabClick', { name: this.code });
     },
     },
     itemClick(e) {
     itemClick(e) {
+      // 获取最后一级菜单
+      const item = this.$last({ menus: this.menusall, code: this.code });
+      // 缓存写入当前一例菜单
+      this.$setParentsetSession({ menus: this.menusall, iscode: item });
+      this.menu = this.$setChildrenSession({ menus: this.menusall, iscode: this.parentCode });
       this.$router.push(`/details/${e._id}`);
       this.$router.push(`/details/${e._id}`);
     },
     },
     async moreClick() {
     async moreClick() {

+ 5 - 0
src/components/list/threeList.vue

@@ -48,6 +48,11 @@ export default {
   mounted() {},
   mounted() {},
   methods: {
   methods: {
     itemClick(e) {
     itemClick(e) {
+      // 获取最后一级菜单
+      const item = this.$last({ menus: this.menusall, code: this.code });
+      // 缓存写入当前一例菜单
+      this.$setParentsetSession({ menus: this.menusall, iscode: item });
+      this.menu = this.$setChildrenSession({ menus: this.menusall, iscode: this.parentCode });
       this.$router.push(`/details/${e._id}`);
       this.$router.push(`/details/${e._id}`);
     },
     },
     async moreClick() {
     async moreClick() {

+ 6 - 1
src/views/details.vue

@@ -1,20 +1,25 @@
 <template>
 <template>
   <div class="detailsHome" v-if="contentsItem">
   <div class="detailsHome" v-if="contentsItem">
+    <breadcrumb ref="breadcrumb"></breadcrumb>
     <img class="thumbnail" v-if="isshow" :src="contentsItem.thumbnail">
     <img class="thumbnail" v-if="isshow" :src="contentsItem.thumbnail">
     <h1 class="title">{{ contentsItem.title }}</h1>
     <h1 class="title">{{ contentsItem.title }}</h1>
     <span class="describe">{{ contentsItem.describe }}</span>
     <span class="describe">{{ contentsItem.describe }}</span>
     <span class="date">发表时间: {{ contentsItem.updateAt | dates }}<span class="visit">访问量: {{ contentsItem.visit }}</span></span>
     <span class="date">发表时间: {{ contentsItem.updateAt | dates }}<span class="visit">访问量: {{ contentsItem.visit }}</span></span>
     <div class="content" v-html="contentsItem.content"></div>
     <div class="content" v-html="contentsItem.content"></div>
+    <a v-if="contentsItem && contentsItem.annex" :href="contentsItem.annex" :download="contentsItem.annex" target="view_window">下载附件</a>
   </div>
   </div>
   <el-divider class="divider" v-else>暂无数据</el-divider>
   <el-divider class="divider" v-else>暂无数据</el-divider>
 </template>
 </template>
 
 
 <script>
 <script>
 import moment from 'moment';
 import moment from 'moment';
+import breadcrumb from '../components/breadcrumb/index.vue';
 import { mapState, mapActions } from 'vuex';
 import { mapState, mapActions } from 'vuex';
 export default {
 export default {
   name: 'detailsHome',
   name: 'detailsHome',
-  components: {},
+  components: {
+    breadcrumb
+  },
   computed: {
   computed: {
     ...mapState(['contentsItem']),
     ...mapState(['contentsItem']),
     isshow() {
     isshow() {

+ 5 - 0
src/views/list.vue

@@ -69,6 +69,11 @@ export default {
     },
     },
     // 列表点击
     // 列表点击
     newClick(e) {
     newClick(e) {
+      // 获取最后一级菜单
+      const item = this.$last({ menus: this.menusall, code: this.code });
+      // 缓存写入当前一例菜单
+      this.$setParentsetSession({ menus: this.menusall, iscode: item });
+      this.menu = this.$setChildrenSession({ menus: this.menusall, iscode: this.parentCode });
       this.$router.push(`/details/${e._id}`);
       this.$router.push(`/details/${e._id}`);
     },
     },
     topage() {
     topage() {

+ 2 - 2
vue.config.js

@@ -9,8 +9,8 @@ module.exports = {
         // target: 'http://127.0.0.1:18090'
         // target: 'http://127.0.0.1:18090'
       },
       },
       '/upload/': {
       '/upload/': {
-        target: 'http://127.0.0.1:9002'
-        // target: 'http://192.168.0.45:18090'
+        // target: 'http://127.0.0.1:9002'
+        target: 'http://skl.cc-lotus.info'
       }
       }
     }
     }
   },
   },