clay commit : 新闻中心对接完成

This commit is contained in:
clay
2022-10-05 23:35:21 +08:00
parent 256e4ab2ea
commit fe4dd98a58
12 changed files with 648 additions and 286 deletions

View File

@@ -20,15 +20,15 @@
</div>
<div class="list">
<!--<el-row>-->
<div class="file" v-for="(file ,index) in value.data" :key="index">
<div class="file_name">
<div class="article" v-for="(file ,index) in value.data" :key="index">
<div class="article_name">
<span class="span">
<img class="def_img" src="@/assets/file_list/xz_icon_xz.png">
<img class="hover_img" src="@/assets/file_list/xz_icon_xzls.png">
</span>
<a :href="file.fileAddr">{{ file.fileName }}</a>
</div>
<div class="file_time">
<div class="article_time">
{{ getDateTime(file.createTime) }}
</div>
@@ -43,8 +43,8 @@
</div>
<el-row>
<el-col class="pagination_p">
<el-pagination class="pagination"
:small="small"
<el-pagination v-if="!smallType"
:small="!smallType"
@size-change="handleSizeChange"
@current-change="handleCurrentChange"
:current-page.sync="value.pageNum"
@@ -52,6 +52,14 @@
layout="prev, pager,next,sizes, jumper"
:total="value.total">
</el-pagination>
<el-pagination v-if="smallType"
:small="smallType"
@size-change="handleSizeChange"
@current-change="handleCurrentChange"
:current-page.sync="value.pageNum"
layout="prev ,pager,next"
:total="value.total">
</el-pagination>
</el-col>
</el-row>
</div>
@@ -66,8 +74,8 @@ export default {
value: {
type: Object,
default() {
return{
data:[],
return {
data: [],
pageNum: 1,
pageSize: 10,
}
@@ -77,11 +85,14 @@ export default {
data() {
return {
width: document.documentElement.clientWidth,
small: document.documentElement.clientWidth <= 992,
smallType: document.documentElement.clientWidth <= 992,
query: '',
pageSize:value.pageSize
pageSize: value.pageSize
}
},
created() {
this.smallType = document.documentElement.clientWidth <= 992
},
methods: {
getDateTime(date) {
let time = new Date(date);
@@ -125,7 +136,7 @@ export default {
if (this.type != null && this.type != 0) {
data.id = this.value.secondId
}
console.log(data,"data")
console.log(data, "data")
getNode(data).then(res => {
this.value.data = res.rows
this.value.total = res.total
@@ -150,13 +161,18 @@ export default {
padding-top: 5rem;
font-size: 1.6rem;
.file {
.article {
color: #757575;
clear: both;
padding: 2rem 3rem;
.file_name {
.article_name {
float: left;
overflow: hidden;
text-overflow: ellipsis;
display: -webkit-box; //作为弹性伸缩盒子模型显示。
-webkit-box-orient: vertical; //设置伸缩盒子的子元素排列方式--从上到下垂直排列
-webkit-line-clamp: 1; //显示的行
.span {
padding-right: 1rem;
@@ -175,7 +191,7 @@ export default {
}
}
.file_time {
.article_time {
float: right;
}
@@ -184,7 +200,7 @@ export default {
}
}
.file:hover {
.article:hover {
//background-color: gray;
color: #1956BC;
@@ -193,7 +209,7 @@ export default {
font-weight: bold;
}
.file_name {
.article_name {
.def_img {
display: none;
}

View File

@@ -54,14 +54,21 @@
<el-row>
<el-col class="pagination_p">
<el-pagination class="pagination" v-if="listData"
<el-pagination v-if="!small"
:small="!small"
@size-change="handleSizeChange"
@current-change="handleCurrentChange"
:current-page.sync="listData.pageNum"
:page-sizes="[10,20, 30, 50, 100]"
layout="prev, pager,next,sizes, jumper"
:total="listData.total">
</el-pagination>
<el-pagination v-if="small"
:small="small"
@size-change="handleSizeChange"
@current-change="handleCurrentChange"
:current-page.sync="listData.pageNum"
:page-sizes="[5,10,20, 30, 50, 100]"
:page-size="4"
layout="prev, pager, next,sizes, jumper"
layout="prev ,pager,next"
:total="listData.total">
</el-pagination>
</el-col>
@@ -165,15 +172,6 @@ export default {
}
}
</script>
<style>
.el-input__inner {
border-color: #1956BC !important;
border-radius: 0 !important;
/*line-height: 3.5rem !important;*/
/*height: 3.5rem !important;*/
}
</style>
<style scoped lang="scss">
@@ -280,15 +278,6 @@ export default {
}
}
.pagination_p {
text-align: center;
margin-bottom: 2rem;
.pagination {
display: inline-block;
float: none;
}
}
.query {
//margin: 1rem 0;
@@ -312,7 +301,8 @@ export default {
width: 80% !important;
}
.context {
margin-top: 6rem;
width: 80% !important;
margin-top: 4rem;
}
}
</style>

View File

@@ -0,0 +1,288 @@
<template>
<div class="article_list" style="background-color:#fff; margin-top: 3rem;">
<div class="query">
<el-row>
<el-col :xs="14" :sm="14" :md="14" :lg="20" :xl="20">
<!--<div style="width: 95%;">-->
<div>
<!--<input class="query_input" v-model="query"/>-->
<el-input class="query_input" v-model="query" size="small"
:placeholder="$t('message.placeholder')"></el-input>
</div>
</el-col>
<el-col :xs="10" :sm="10" :md="10" :lg="4" :xl="4" style="float: right">
<el-button class="query_button" type="primary" size="small" icon="el-icon-search"
@click="handleCurrentChange(-1)">
{{ $t('message.search') }}
</el-button>
</el-col>
</el-row>
</div>
<div class="list">
<!--<el-row>-->
<div class="article" v-for="(item ,index) in listData.data" :key="index">
<el-row>
<el-col :span="20">
<div class="article_name" @click="getContext(item)">
<span class="span">
<img class="def_img" src="@/assets/index/scientific_research_trends/huidian@2x.png">
<img class="hover_img" src="@/assets/index/scientific_research_trends/sy_icon_b1@2x.png">
</span>
<!-- <a :href="file.fileAddr">{{ file.fileName }}</a>-->
{{ item.title }}
</div>
</el-col>
<el-col :span="4">
<div class="article_time">
{{ getDateTime(item.publishTime) }}
</div>
</el-col>
</el-row>
</div>
</div>
<el-row>
<el-col class="pagination_p">
<el-pagination v-if="!small"
:small="!small"
@size-change="handleSizeChange"
@current-change="handleCurrentChange"
:current-page.sync="listData.pageNum"
:page-sizes="[10,20, 30, 50, 100]"
layout="prev, pager,next,sizes, jumper"
:total="listData.total">
</el-pagination>
<el-pagination v-if="small"
:small="small"
@size-change="handleSizeChange"
@current-change="handleCurrentChange"
:current-page.sync="listData.pageNum"
layout="prev ,pager,next"
:total="listData.total">
</el-pagination>
</el-col>
</el-row>
</div>
</template>
<script>
import {getNode} from "@/api";
export default {
name: "list",
props: {
list: {
type: Object,
default() {
return {
data: [],
pageNum: 1,
pageSize: 10,
}
},
},
},
data() {
return {
listData : this.list,
width: document.documentElement.clientWidth,
small: document.documentElement.clientWidth <= 992,
query: '',
}
},
watch:{
list(val){
this.listData = val
}
},
created() {
},
methods: {
getDateTime(date) {
let time = new Date(date);
let year = time.getFullYear();
let month = time.getMonth() + 1
let day = time.getDate();
return year + "-" + month + "-" + day;
},
getContext(context) {
let type = this.$route.query && this.$route.query.type
let router = ''
if (type != null) {
router = "?id=" + context.id + '&type=' + type + "&lang=" + sessionStorage.getItem("lang")
} else {
router = "/" + this.listData.navId + "?id=" + context.id + "&lang=" + sessionStorage.getItem("lang")
}
let routeData = null;
if (this.width <= 992) {
routeData = this.$router.resolve({path: "/mobile/" + this.listData.secondId + router});
} else {
routeData = this.$router.resolve({path: "/pc/" + this.listData.secondId + router});
}
window.open(routeData.href,"_blank")
},
handleSizeChange(val) {
console.log(`每页 ${val}`);
if (val === -1) {
this.listData.pageSize = 1
} else {
this.listData.pageSize = val
}
this.getData()
},
handleCurrentChange(val) {
if (val === -1) {
this.listData.pageNum = 1
} else {
this.listData.pageNum = val
}
this.getData()
},
getData() {
let data = {
title: this.query,
id: this.listData.navId,
pageNum: this.listData.pageNum,
pageSize: this.listData.pageSize
}
if (this.small){
data.pageSize = 20
}
this.type = this.$route.query && this.$route.query.type
if (this.type != null && this.type !== 0) {
data.id = this.listData.secondId
} else {
console.log(this.listData);
}
// console.log(data);
getNode(data).then(res => {
this.listData.data = res.rows
this.listData.total = res.total
})
},
}
}
</script>
<style scoped lang="scss">
.list {
padding-top: 5rem;
font-size: 1.6rem;
.article {
color: #757575;
clear: both;
padding: 1rem 3rem;
.article_name {
float: left;
overflow: hidden;
text-overflow: ellipsis;
display: -webkit-box; //作为弹性伸缩盒子模型显示。
-webkit-box-orient: vertical; //设置伸缩盒子的子元素排列方式--从上到下垂直排列
-webkit-line-clamp: 1; //显示的行
.span {
padding-right: 1rem;
.def_img, .hover_img {
width: 1.5rem;
}
.def_img {
display: inline-block;
}
.hover_img {
display: none;
}
}
}
.article_time {
float: right;
}
a {
color: #757575 !important;
}
}
.article:hover {
//background-color: gray;
color: #1956BC;
a {
color: #1956BC !important;
font-weight: bold;
}
.article_name {
.def_img {
display: none;
}
.hover_img {
display: inline-block;
}
}
}
a {
text-decoration: none;
}
}
.pagination_p {
text-align: center;
margin-bottom: 2rem;
margin-top: 5rem;
.pagination {
display: inline-block;
float: none;
}
}
.query {
//margin: 1rem 0;
z-index: 999;
width: 30%;
position: absolute;
right: 3rem;
top: -2.4rem;
//float: right;
.query_input {
border-color: #1956BC !important;
border-radius: 0 !important;
}
.query_button {
//height: 3.5rem;
border-radius: 0rem 1rem 1rem 0rem;
background-color: #1956BC;
border-color: #1956BC !important;
}
}
@media screen and (min-width: 1100px) and (max-width: 1400px) {
.query {
width: 40% !important;
}
}
@media screen and (max-width: 1100px) {
.query {
height: 1rem;
width: 80% !important;
margin-top: 4rem;
}
}
</style>

View File

@@ -100,7 +100,8 @@
<el-row>
<el-col>
<Introduction :introduction="contextData" v-if="type === 1"/>
<List :list="contextData" v-if="type === 2"/>
<List :list="contextData" v-if="type === 2 && listDataType == 0"/>
<SimpleList :list="contextData" v-if="type === 2 && listDataType == 1"/>
<FileList :value="contextData" v-if="type === 4"/>
<DireData :value="contextData" v-if="type === 3 && dreDataType == '1'"/>
<DireDataTow :value="contextData" v-if="type === 3 && dreDataType == '2'"/>
@@ -139,7 +140,8 @@
<el-row>
<el-col>
<Introduction :introduction="contextData" v-if="type === 1"/>
<List :list="contextData" v-if="type === 2"/>
<List :list="contextData" v-if="type === 2 && listDataType == 0"/>
<SimpleList :list="contextData" v-if="type === 2 && listDataType == 1"/>
<FileList :value="contextData" v-if="type === 4"/>
<DireData :value="contextData" v-if="type === 3 && dreDataType == '1'"/>
<DireDataTow :value="contextData" v-if="type === 3 && dreDataType == '2'"/>
@@ -164,6 +166,7 @@ import DireData from './components/dire_data.vue'
import DireDataTow from './components/dire_data_tow.vue'
import Details from './components/details.vue'
import FileList from './components/file_list.vue'
import SimpleList from './components/simple_list.vue'
import {handleTree} from "@/utils/ebts";
import {getParentNode, setLanguage} from "@/utils/sist";
@@ -175,7 +178,8 @@ export default {
DireData,
Details,
FileList,
DireDataTow
DireDataTow,
SimpleList
},
data() {
return {
@@ -183,6 +187,7 @@ export default {
secondId: null,
navId: null,
dreDataType: "",
listDataType: 0,
navList: [],
showIndex: 0,
showSecond: true,
@@ -387,8 +392,10 @@ export default {
pageNum: 1,
pageSize: 5
}
if (this.type === 4) {
this.listDataType = 0
if (this.type === 4||menu.isSimple == 1) {
data.pageSize = 10
this.listDataType = 1
}
} else {
data = {