[add] 首页
This commit is contained in:
@@ -0,0 +1,79 @@
|
||||
<template>
|
||||
<a-card :bordered="false">
|
||||
<a-spin :spinning="loading">
|
||||
<div class="top-wrapper">
|
||||
<span class="left-p"><i class="iconfont icon-link left-icon"></i>友情链接</span>
|
||||
<span class="right-p" @click="moreLink">更多链接<i class="iconfont icon-right"></i></span>
|
||||
</div>
|
||||
<div class="content-wrapper">
|
||||
<div class="content-div" v-for="item in dataSource" :key="item.id">
|
||||
{{ item.name }}
|
||||
</div>
|
||||
</div>
|
||||
</a-spin>
|
||||
</a-card>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import { getAction } from '@/api/manage'
|
||||
|
||||
export default {
|
||||
name: 'FriendLinkCard',
|
||||
data () {
|
||||
return {
|
||||
loading: true,
|
||||
dataSource: [],
|
||||
url: {
|
||||
list: '/sys/lawsFriendlyLinks/list'
|
||||
}
|
||||
}
|
||||
},
|
||||
mounted () {
|
||||
this.loadData()
|
||||
},
|
||||
methods: {
|
||||
loadData () {
|
||||
this.loading = true
|
||||
getAction(this.url.list, {}).then((res) => {
|
||||
if (res.success) {
|
||||
this.dataSource = res.result
|
||||
} else {
|
||||
this.$message.warning(res.message)
|
||||
}
|
||||
}).finally(() => {
|
||||
this.loading = false
|
||||
})
|
||||
},
|
||||
// 点击更多链接
|
||||
moreLink () {
|
||||
this.$router.push({
|
||||
path: '/isystem/friendshipLink'
|
||||
})
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style scoped lang="less">
|
||||
|
||||
.content-wrapper {
|
||||
display: grid;
|
||||
grid-template-columns: 1fr 1fr 1fr 1fr 1fr 1fr;
|
||||
grid-gap: 20px;
|
||||
margin-top: 12px;
|
||||
}
|
||||
.content-div {
|
||||
height: 62px;
|
||||
line-height: 62px;
|
||||
box-shadow: 0px 0px 8px 0px rgba(0,0,0,0.1);
|
||||
overflow: hidden;
|
||||
text-overflow: ellipsis;
|
||||
white-space: nowrap;
|
||||
font-size: 16px;
|
||||
font-family: PingFang SC-Regular, PingFang SC;
|
||||
font-weight: 400;
|
||||
color: @primary-color;
|
||||
text-align: center;
|
||||
background-image: url('../../../assets/image/dashboardLinkBack.png');
|
||||
}
|
||||
</style>
|
||||
Reference in New Issue
Block a user