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
<template>
<div class="deptNews">
<div class="title">公司新闻</div>
<div class="lookMore" @click="newsDetail">查看更多</div>
<div class="content heightCut44">
<dv-scroll-board @click="handleClick" :config="config" style="width:calc(100% - 0.01rem);height:calc(100% - 0.01rem)" />
</div>
</div>
</template>
<script>
import * as API_BASIC from '@/api/sys.basic.js'
export default {
data () {
return {
config: {
columnWidth: [350, 100],
oddRowBGC: 'rgba(47,219,243,0.15)',
evenRowBGC: 'rgba(47,219,243,0.05)',
data: []
}
}
},
mounted () {
this.getNewsList()
},
methods: {
// 查询概况页面数据
getNewsList () {
API_BASIC.getNewsPageList({ _index: 1, _size: 10 }).then(res => {
const _newsList = res.data.records
this.newsList = _newsList
const _data = []
_newsList.forEach(element => {
_data.push([element.title, element.releaseDate ? element.releaseDate.substring(0, 10) : ''])
})
this.config = {
columnWidth: [300, 120],
oddRowBGC: 'rgba(47,219,243,0.15)',
evenRowBGC: 'rgba(47,219,243,0.05)',
data: _data
}
})
},
newsDetail () {
this.$router.push('/companyNews')
},
handleClick (row) {
this.$router.push({ path: '/newsDetail', query: { row: JSON.stringify(this.newsList[row.rowIndex]) } })
}
}
}
</script>
<style lang="scss" scoped>
.deptNews{
position: relative;
.content{
box-sizing: border-box;
padding: .24rem;
width: 100%;
}
::v-deep .dv-scroll-board .rows .row-item {
cursor: pointer;
}
}
</style>