From 71b92b0c6d3d7efd603d9fcb84506be0cbf0e4a6 Mon Sep 17 00:00:00 2001
From: 明梦爽 <2972214568@qq.com>
Date: 星期一, 08 八月 2022 18:20:39 +0800
Subject: [PATCH] 完善Readme
---
src/components/page/zhengce.vue | 131 ++++++++++++++++++++++---------------------
1 files changed, 68 insertions(+), 63 deletions(-)
diff --git a/src/components/page/zhengce.vue b/src/components/page/zhengce.vue
index 02e7cb6..9e11455 100644
--- a/src/components/page/zhengce.vue
+++ b/src/components/page/zhengce.vue
@@ -7,39 +7,27 @@
<!-- 灏忔爣棰� -->
<el-col :span="4" class="marr10">
<ul>
- <li
- v-for="(item, index) in menuList"
- :key="index"
- class="liStylenone liPointer marb10"
- @click="changeMenu(item)"
- >
- <b :class="cont == item.categoryName ? 'ft-blue' : 'ft-black'">{{
- item.categoryName
- }}</b>
+ <li v-for="(item, index) in menuList" :key="index" class="liStylenone liPointer marb10" @click="changeMenu(item)">
+ <b :class="cont == item.name ? 'ft-blue' : 'ft-black'">{{ item.name }}</b>
</li>
</ul>
</el-col>
<el-card class="box-card">
- <el-col :span="18">
+ <p class="name">{{ this.cont }}</p>
+ <hr class="namehr" />
+ <el-col :span="24">
<div>
- <el-row
- class="marb10"
- :key="index"
- v-for="(item, index) in newsList"
- >
- {{ item.title }}
+ <el-row class="marb10" :key="index" v-for="(item, index) in newsList">
+ <div class="flex-v flex-between marb5 cursor" @click="show(item)">
+ <div>{{ item.title }}</div>
+ <div>{{ item.releaseTime }}</div>
+ </div>
+ <el-divider class="hr"></el-divider>
</el-row>
</div>
<!-- 鍒嗛〉 -->
- <div>
- <el-pagination
- @current-change="handleCurrentChange"
- :current-page.sync="currentPage"
- :page-size="20"
- layout="total, pager, next"
- :total="total"
- >
- </el-pagination>
+ <div class="fenye">
+ <el-pagination background @current-change="handleCurrentChange" :current-page.sync="currentPage" :page-size="pageSize" layout="prev, pager, next,total" :total="total"> </el-pagination>
</div>
</el-col>
</el-card>
@@ -57,64 +45,73 @@
},
data() {
return {
- cont: '',
+ cont: '', //灏忔爣棰樺彉鑹�
menuList: [],
newsList: [],
+ pageSize: 6,
+ currentPage: 1,
total: 0,
- currentPage: 1
+ item: {}
}
},
- created() {
- this.getMinTitleList()
+ created() {},
+ mounted() {
+ this.getTitle()
},
- mounted() {},
watch: {
- menuList(newval, oldval) {
- this.getAllNewsList(this.menuList[0])
- this.cont = this.menuList[0].categoryName
+ menuList(n, o) {
+ this.cont = this.menuList[0].name
+ this.item = this.menuList[0]
+ this.getnews(this.menuList[0])
}
},
methods: {
- handleCurrentChange(val) {
- console.log(`褰撳墠椤�: ${val}`)
- },
- changeMenu(val) {
- this.getAllNewsList(val)
- this.cont = val.categoryName
- },
- getMinTitleList() {
- const data = {
- contypeId: this.$route.query.id,
- p: 1
- }
+ getTitle() {
+ const data = Number(this.$route.query.id)
getMinTitle(data)
- .then((res) => {
- console.log('res', res)
+ .then(res => {
+ console.log(res)
if (res.code == 200) {
- this.menuList = res.data.records
+ this.menuList = res.data
}
})
- .catch((err) => {
- console.log('err', err)
+ .catch(err => {
+ console.log(err)
})
},
- getAllNewsList(item) {
+ changeMenu(val) {
+ this.cont = val.name
+ this.item = val
+ this.currentPage = 1
+ this.getnews(val)
+ },
+ getnews(item) {
const data = {
- categoryId: item.id,
- contypeId: item.contypeId,
- p: this.currentPage
+ current: this.currentPage,
+ newsCategoryId: item.id,
+ size: this.pageSize
}
getNewsList(data)
- .then((res) => {
- console.log('res', res)
+ .then(res => {
+ console.log(res)
if (res.code == 200) {
this.newsList = res.data.records
this.total = Number(res.data.total)
}
})
- .catch((err) => {
- console.log('err', err)
+ .catch(error => {
+ console.log(error)
})
+ },
+ handleCurrentChange(val) {
+ console.log(`褰撳墠椤�: ${val}`)
+ // this.currentPage = val
+ this.getnews(this.item)
+ },
+ // 璺宠浆鍒版柊闂诲睍绀洪〉闈�
+ show(item) {
+ // console.log(item.id);
+ this.$router.push({ path: '/home/news', query: { id: item.id } })
}
}
}
@@ -122,7 +119,7 @@
<style lang="less" scoped>
ul {
- width: 200px;
+ // width: 200px;
li {
background-color: rgb(242, 243, 245);
height: 50px;
@@ -130,10 +127,18 @@
text-align: center;
}
}
-.ft-blue{
- color:rgb(9, 143, 252);
+.ft-blue {
+ color: rgb(9, 143, 252);
}
-.ft-black{
+.ft-black {
color: #000;
}
-</style>
\ No newline at end of file
+.box-card {
+ height: 500px;
+ position: relative;
+ .fenye {
+ position: absolute;
+ bottom: 10px;
+ }
+}
+</style>
--
Gitblit v1.8.0