asd123a20 1 年間 前
コミット
beb38eea29

+ 16 - 0
src/assets/index.scss

@@ -162,6 +162,14 @@ html, body, #app{
         }
       }
     }
+    .templateslist {
+      .title {
+        width: 90% !important;
+      }
+      .listBox {
+        width: 90% !important;
+      }
+    }
   }
   // 小于1800
   @media (max-width: 1260px) {
@@ -221,6 +229,14 @@ html, body, #app{
         }
       }
     }
+    .templateslist {
+      .title {
+        width: 100% !important;
+      }
+      .listBox {
+        width: 100% !important;
+      }
+    }
   }
   @media (max-width: 1170px) {
     h4 {

+ 1 - 1
src/views/list.vue

@@ -17,7 +17,7 @@
         <div class="titlebox" v-for="(item, index) in isnewcontentList" :key="index">
           <div class="left" v-for="i in item" :key="i._id">
             <img src="../assets/jt.png" class="jt">
-            <span class="text" @click="newClick(i)">{{ i.title }}</span>
+            <span class="text" @click="newClick(i)">{{ i.title | titles }}</span>
           </div>
         </div>
       </div>

+ 16 - 8
src/views/templates/ztjy/details.vue

@@ -3,13 +3,16 @@
     <img src="../../../assets/ztjytop.jpg" class="topimg" />
     <div class="listBox">
       <div class="listtitle" v-if="menu.name">{{ menu.name }}</div>
-      <div class="title" :class="{ top: !menu.name }" v-html="contentsItem.title"></div>
+      <div class="title" :class="{ top: !menu.name }" v-html="contentsItem && contentsItem.title"></div>
       <div class="timeBox">
-        <div class="time">时间:{{ contentsItem.createAt | dates }}</div>
-        <div class="time2">来源:{{ contentsItem.source }}</div>
-        <div class="time">作者:{{ contentsItem.author }}</div>
+        <div class="times">
+          <span class="time">时间:{{ contentsItem && contentsItem.createAt | dates }}</span>
+          <span class="time2"  v-if="contentsItem && contentsItem.source">来源:{{ contentsItem && contentsItem.source }}</span>
+          <span class="time2"  v-if="contentsItem && contentsItem.author">作者:{{ contentsItem && contentsItem.author }}</span>
+          <span class="time2">访问量: {{ contentsItem && contentsItem.visit }}</span>
+        </div>
       </div>
-      <div class="bodyHtml" v-html="contentsItem.content"></div>
+      <div class="bodyHtml" v-html="contentsItem && contentsItem.content"></div>
     </div>
   </div>
 </template>
@@ -66,6 +69,7 @@ export default {
   font-weight: bold;
   margin: 0 auto;
   margin-bottom: 1%;
+  text-align: center;
 }
 .listBox {
   width: 75%;
@@ -89,22 +93,26 @@ export default {
   width: 95%;
   height: auto;
   overflow: hidden;
-  font-size: 1.875em;
+  font-size: 2.5em;
   font-weight: bold;
   color: #ba0612;
   margin: 3% auto;
 }
 .timeBox {
-  display: flex;
   width: 95%;
   margin: 0 auto;
-  height: auto;
+  // height: auto;
   overflow: hidden;
   padding-bottom: 1%;
   margin-bottom: 3%;
   border-bottom: #cdd1e5 1px solid;
   font-size: 0.875em;
   color: #727586;
+  text-align: center;
+}
+.times {
+  margin: 0 auto;
+  text-align: center;
 }
 .time2 {
   margin: 0 15px;

+ 8 - 2
src/views/templates/ztjy/index.vue

@@ -1,5 +1,5 @@
 <template>
-  <div class="list">
+  <div class="templateslist">
     <img src="../../../assets/ztjytop.jpg" class="topimg">
     <div class="title" @click="titleClick">习近平:在学习贯彻习近平新时代中国特色社会主义思想主题教育工作会议上的讲话</div>
     <div class="listBox" v-for="item in menu" :key="item.code">
@@ -9,7 +9,7 @@
       </div>
       <ul class="listBody">
         <li class="listItem" v-for="i in list[item.code]" :key="i._id" @click="detailsClick(i)">
-          <div class="listname">{{ i.title }}</div>
+          <div class="listname">{{ i.title | titles }}</div>
           <div class="listtime">{{ i.createAt | dates }}</div>
         </li>
       </ul>
@@ -72,6 +72,9 @@ export default {
   filters: {
     dates(e) {
       return moment(e).format('YYYY-MM-DD');
+    },
+    titles(e) {
+      return e.replace(/\n|\r/g, '');
     }
   }
 };
@@ -142,6 +145,9 @@ export default {
   width: 90%;
   text-align: left;
   float: left;
+  white-space: nowrap;
+  overflow: hidden;
+  text-overflow: ellipsis;
 }
 .listtime {
   width: 10%;

+ 4 - 2
src/views/templates/ztjy/list.vue

@@ -1,5 +1,5 @@
 <template>
-  <div class="list">
+  <div class="templateslist">
     <img src="../../../assets/ztjytop.jpg" class="topimg">
     <div class="listBox">
       <div class="listtitle">{{ menu.name }}</div>
@@ -40,7 +40,6 @@ export default {
   methods: {
     ...mapActions(['contentsList', 'menusQueryAll']),
     async handleCurrentChange(e) {
-      console.log(e, 'eee');
       this.page = e;
       await this.filterQuery();
     },
@@ -126,6 +125,9 @@ export default {
   width: 90%;
   text-align: left;
   float: left;
+  white-space: nowrap;
+  overflow: hidden;
+  text-overflow: ellipsis;
 }
 .listtime {
   width: 10%;