RuoYi-Cloud/ruoyi-ui/src/views/index.vue

131 lines
2.8 KiB
Vue
Raw Normal View History

<template>
2022-06-14 18:01:42 +08:00
<div class="app-container">
<el-row :gutter="5">
<el-col :span="8">
<div class="grid-content bg-purple">
<el-card class="box-card" :body-style="{padding:'3px'}" shadow="hover">
<div slot="header" style="font-size: 18px;color: #3A71A8;font-weight: 800;padding: 0">
<span>最新微博热搜</span>
</div>
<div v-for="wb in WbDataList" :key="wb.id" style="color: #8492a6;">
{{ wb.hotword }}
</div>
2022-01-26 16:44:31 +08:00
</el-card>
</div>
</el-col>
2022-06-14 18:01:42 +08:00
<el-col :span="16">
<div class="grid-content bg-purple">
<el-card class="box-card" :body-style="{padding:'3px'}" shadow="hover">
<div slot="header" style="font-size: 18px;color: #00BCD4;font-weight: 800;padding: 0">
<span>文案</span>
</div>
2022-06-14 18:01:42 +08:00
<div v-for="copyWriting in copyWritingList" :key="copyWriting.id" class="top_content"
style="color: #bfcbd9;">
<el-tooltip effect="light" :content="copyWriting.content+' ——— '+copyWriting.type" placement="top">
<span>{{ copyWriting.content }} <span style="color: #bfcbc5">{{ copyWriting.type }}</span></span>
</el-tooltip>
</div>
2022-01-26 16:44:31 +08:00
</el-card>
</div>
</el-col>
</el-row>
2022-06-14 18:01:42 +08:00
<el-row :gutter="5">
<el-col :span="24">
<div class="grid-content bg-purple"></div>
2022-01-26 16:44:31 +08:00
</el-col>
2022-06-14 18:01:42 +08:00
</el-row>
<el-row :gutter="5">
<el-col :span="24">
<div class="grid-content bg-purple"></div>
</el-col>
</el-row>
<el-row :gutter="5">
<el-col :span="24">
<div class="grid-content bg-purple"></div>
2022-01-26 16:44:31 +08:00
</el-col>
</el-row>
</div>
</template>
<script>
2022-06-14 18:01:42 +08:00
import {showCopyWriting, showWbSearch} from "@/api";
export default {
name: "Index",
data() {
return {
2022-06-14 18:01:42 +08:00
WbDataList: {},
copyWritingList: {},
};
},
created() {
2022-06-14 18:01:42 +08:00
this.showWbSearch()
this.showCopyWriting()
},
2022-01-26 16:44:31 +08:00
mounted() {
2022-06-14 18:01:42 +08:00
},
2022-01-26 16:44:31 +08:00
methods: {
2022-06-14 18:01:42 +08:00
showWbSearch() {
showWbSearch().then(res => {
this.WbDataList = res.data
2022-01-26 16:44:31 +08:00
})
},
2022-06-14 18:01:42 +08:00
showCopyWriting() {
showCopyWriting().then(res => {
this.copyWritingList = res.data
})
},
2022-06-14 18:01:42 +08:00
},
2022-06-14 18:01:42 +08:00
};
</script>
2022-06-14 18:01:42 +08:00
<style scoped lang="scss">
2022-06-14 18:01:42 +08:00
.top_content {
white-space: nowrap; /*把文本强制显示在一行*/
overflow: hidden; /*隐藏超出部分的文字*/
text-overflow: ellipsis; /*超出显示省略号*/
2022-06-14 18:01:42 +08:00
font-size: 14px;
font-weight: 700;
}
2022-06-14 18:01:42 +08:00
.el-col {
border-radius: 4px;
}
2022-01-26 16:44:31 +08:00
2022-06-14 18:01:42 +08:00
.bg-purple-dark {
background: #99a9bf;
}
2022-01-26 16:44:31 +08:00
2022-06-14 18:01:42 +08:00
.bg-purple {
background: #d3dce6;
}
2022-06-14 18:01:42 +08:00
.bg-purple-light {
background: #e5e9f2;
2022-01-26 16:44:31 +08:00
}
2022-06-14 18:01:42 +08:00
.grid-content {
border-radius: 4px;
min-height: 36px;
}
2022-06-14 18:01:42 +08:00
.row-bg {
padding: 10px 0;
background-color: #f9fafc;
}
</style>