diplomacy.vue
4.08 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
<template>
<div>
<div class="box">
<el-breadcrumb class="mt20" :separator-icon="ArrowRight">
<el-breadcrumb-item :to="{ path: '/' }">
<el-icon>
<HomeFilled/>
</el-icon>
首页
</el-breadcrumb-item>
<el-breadcrumb-item>对外交流</el-breadcrumb-item>
</el-breadcrumb>
<el-card class="mt20 mb20" :body-style="{ padding: '0px' }">
<div class="infoPart">
<div class="newsBlock">
<div v-for="n in list" class="item" @click="goDetail(n)">
<div class="date">
<div class="day">{{ n.belongTime?.substring(8, 10) }}</div>
<p>{{ n.belongTime?.substring(0, 7).replace(/-/g, '/') }}</p>
</div>
<div v-if="n.url" class="imgbox">
<img :src="fillImgUrl_webSite(n.url)">
</div>
<div class="item-body">
<h3>{{ n.name }}</h3>
<p>{{ n.subName }}</p>
<a class="go"/>
</div>
</div>
</div>
</div>
<div class="pc-page-box mb20" v-if="total>9">
<PaginationPc v-model:page="query.pageNum" v-model:limit="query.pageSize" :total="total" @pagination="getList"/>
</div>
<el-empty v-if="list?.length == 0" description="暂无数据"/>
</el-card>
</div>
</div>
</template>
<script setup>
import { ArrowRight } from '@element-plus/icons-vue'
import { onMounted, ref } from 'vue'
import { getNewsListById } from '@/apiPc/webSite'
import { useRouter } from 'vue-router'
const router = useRouter()
const list = ref([])
const total = ref(0)
const query = ref({
pageSize: 10,
pageNum: 1,
sortId: 1002,
code: 10000001
})
onMounted(() => {
getList()
})
const getList = () => {
getNewsListById(query.value).then(res => {
list.value = res.rows
total.value = res.total
})
}
const goDetail = (n) => {
if (n.isOut == '1') {
window.open(n.jumpUrl)
} else {
router.push({
path: `/news/detail/${n.noteId}`
})
}
}
</script>
<style lang="scss" scoped>
.flexBody {
display: flex
}
.infoPart {
padding: 20px;
& > h3 {
font-size: 24px;
color: var(--el-color-primary);
}
}
.newsBlock {
.item {
display: flex;
position: relative;
width: 100%;
cursor: pointer;
border-bottom: 1px dashed #EEEEEE;
padding: 30px 0;
.date {
width: 60px;
height: 60px;
text-align: center;
background: #FAFAFA;
margin: 0 10px;
.day {
color: var(--el-color-primary);
transform: scaleX(0.7);
font-weight: bold;
font-size: 24px;
}
p {
font-size: 14px;
margin: 0;
transform: scaleX(0.7);
font-weight: bold;
color: #7B7F83;
}
}
.imgbox {width: 280px;margin-right: 10px; height: 157.5px;overflow: hidden;
flex: 0 0 auto;
img{width: 100%;height: 100%;object-fit: cover;object-position: top;}
}
.item-body {flex: 1 1 auto;
h3 {
padding: 0 10px;
white-space: nowrap;
overflow: hidden;
width: 60vw;
text-overflow: ellipsis;
font-size: 18px;
color: #000000;
margin: 0
}
p {
padding: 0 10px;
text-align: justify;
line-height: 24px;
height: 48px;
display: -webkit-box;
-webkit-box-orient: vertical;
-webkit-line-clamp: 2;
overflow: hidden;
text-overflow: ellipsis;
color: #7B7F83;
font-size: 14px;
}
}
.go {
background: url("@/assets/v1/about/more.png") no-repeat center;
background-size: contain;
width: 22px;
height: 8px;
display: block;
filter: grayscale(1);
margin: 0 10px;
}
}
.item:hover {
background: #F8F4FF;
.date {
background: var(--el-color-primary);
.day {
color: #fff;
}
p {
color: #fff;
}
}
.item-body {
h3 {
color: var(--el-color-primary);
}
}
a {
filter: none
}
}
}
</style>