增加顶部新闻列表

develoop
xy 2 weeks ago
parent 82738012e1
commit b23c8a3ff1
  1. 1
      src/Layout/index.vue
  2. 17
      src/Layout/main/index.vue
  3. 35
      src/styles/index.scss
  4. 76
      src/views/pedagogicalReform/index.vue
  5. 24
      src/views/scientificResearch/index.vue

@ -95,6 +95,7 @@ onMounted(() => {
<style lang="scss" scoped>
.main-container {
padding-top: 120px;
width: 100%;
min-height: 100vh;
background-color: #eef1fb;

@ -6,7 +6,22 @@
</section> -->
<div class="view-container">
<div class="banner">
<img :src="adminInfoStore.info.promotionalImages" alt="" style="max-height: 409px;">
<div class="left">
<img :src="adminInfoStore.info.promotionalImages" alt="" style="max-height: 409px;">
</div>
<div class="news">
<div class="newTop">新闻</div>
<div class="newButton">
<ul>
<li>未来产业由前沿技术驱动当前处于孕育萌发阶段或产业化初期</li>
<li>前瞻部署梯次培育顺应新一轮科技革命和产业变革趋势</li>
<li>创新驱动应用牵引以前沿技术突破引领未来产业发展</li>
<li>某高校正式启动新版教学一体化师生管理后台</li>
<li>教学一体化师生管理后台助力某高校实现智慧教学</li>
</ul>
</div>
</div>
<div class="source-box">
<div class="source">
{{ adminInfoStore.info.name }}

@ -3,16 +3,47 @@
.banner {
width: 100%;
height: 410px;
height: 300px;
// background: url('../assets/images/banner4.jpg') no-repeat;
// background-size: cover
position: relative;
display: flex;
.left{
width: 70%;
}
.news{
width: 30%;
background-color: #e6f3fc;
.newTop{
height: 40px;
line-height: 40px;
background-color: #eaf4fd;
padding-left: 10px;
font-size: 18px;
color: #3374ff;
}
.newButton{
height: 350px;
// background-color: pink;
}
.newButton ul li{
font-size: 15px;
padding: 16px;
list-style-type: disc ;
color:#6da0ff;
list-style-position:inside;
}
.newButton ul li:hover{
color: #081018;
}
}
img{
width: 100%;
height: 100%;
}
.source-box {
position: absolute;
top: 50%;
top: 40%;
left: 180px;
.source {

@ -1,7 +1,7 @@
<template>
<div class="header_title">
<div class="header_title" >
<span>资讯新闻</span>
<el-divider style="width: 800px"/>
<el-divider style="margin: 30px auto;"/>
</div>
<div class="container">
<div class="left">
@ -9,27 +9,27 @@
<li v-for="category in column" :key="category.id">
<div class="box">
<div class="categorySty">
<span>· {{category.categoryName}}</span>
<span>· {{ category.categoryName }}</span>
</div>
<div style="margin-left: 10px">
<ul v-if="category.essays">
<li class="essaySty" v-for="essay in category.essays" :key="essay.id" @click="selectEssay(essay)">
<span>{{essay.title}}</span>
<span>{{essay.publishTime}}</span>
<span>{{ essay.title }}</span>
<span>{{ essay.publishTime }}</span>
</li>
</ul>
</div>
</div>
</li>
</ul>
<el-divider/>
<el-divider />
</div>
</div>
</template>
<script lang='ts' setup>
import { onMounted, reactive, ref, toRefs, watch } from 'vue'
import {queryCategory,queryEssay} from '@/api/news'
import { queryCategory, queryEssay } from '@/api/news'
const column = ref([])
const essayContent = ref({})
//
@ -38,7 +38,7 @@ const CategoryList = async () => {
column.value = res.data
// console.log(column.value,'')
}
const selectEssay =async (essay)=>{
const selectEssay = async (essay) => {
essayContent.value = essay
// console.log(essayContent,'')
};
@ -51,7 +51,7 @@ const fetchCategoriesAndEssays = async () => {
for (const category of column.value) {
const essaysResponse = await queryEssay(category.id);
category.essays = essaysResponse.data || [];
console.log(category.essays,'s')
console.log(category.essays, 's')
}
} catch (error) {
console.error('查找信息失败', error);
@ -64,52 +64,64 @@ onMounted(() => {
</script>
<style scoped>
.header_title{
font-size: 20px;
color: dodgerblue;
.header_title {
font-size: 25px;
color: #293352;
text-align: center;
font-weight: bold;
margin-left:490px;
margin-top: 30px;
}
.left{
margin-left: 600px;
margin-top: 10px;
height: 85vh;
overflow-y: auto;
}
/* .left {
/* margin-left: 600px;
margin-top: 10px; */
/* height: 85vh; */
/* overflow-y: auto; */
.left::-webkit-scrollbar {
width: 0px;
}
.box{
width: 502px;
margin-bottom: 5px;
.box {
margin: 0 auto;
width: 900px;
margin-bottom: 10px;
/* border: 1px solid pink; */
}
.categorySty{
.categorySty {
margin-bottom: 10px;
font-size: 25px;
font-weight: 550;
width: 560px;
height: 50px;
height: 60px;
line-height: 50px;
/*background: #FFB21E;*/
}
.categorySty:hover{
.categorySty:hover {
background: gainsboro;
cursor: pointer;
}
.essaySty{
display: flex; /* 启用Flexbox布局 */
justify-content: space-between; /* 水平方向两端对齐 */
align-items: center; /* 垂直居中对齐 */
.essaySty {
display: flex;
/* 启用Flexbox布局 */
justify-content: space-between;
/* 水平方向两端对齐 */
align-items: center;
/* 垂直居中对齐 */
height: 40px;
line-height: 40px;
margin-bottom: 5px;
width:520px;
margin-bottom: 10px;
width: 800px;
font-size: 20px;
margin-left: 30px;
/*background: #FFB21E;*/
}
.essaySty:hover{
.essaySty:hover {
background: gainsboro;
cursor: pointer;
}

@ -1,18 +1,18 @@
<template>
<div class="content">
<el-card style="max-width:800px;height: 80vh">
<el-card style="max-width:1200px;height: 80vh">
<template #header>
<div class="card-header">
<span>关于我们</span>
</div>
</template>
<div class="news_main">
<!-- {{ aboutEssay.content }}-->
<!-- {{ aboutEssay.content }}-->
<textarea v-model="aboutEssay.content" class="textSty"></textarea>
</div>
<!-- <template #footer>-->
<!-- <span>...</span>-->
<!-- </template>-->
<!-- <template #footer>-->
<!-- <span>...</span>-->
<!-- </template>-->
</el-card>
</div>
</template>
@ -38,28 +38,32 @@ onMounted(()=>{
justify-content: center;
}
.el-card{
width: 800px;
width: 1200px;
height: 80vh;
margin-top: 30px;
margin-bottom: 30px;
margin-top: 0px;
margin-bottom: 0px;
background-color: #eef1fb;
}
.card-header{
font-size: 25px;
color: #6da0ff;
color:#293352;
text-align: center;
font-weight: bold;
}
.news_main{
padding: 20px;
height: 80vh;
font-size: 20px;
font-size: 18px;
line-height: 1.5;
overflow-y: auto;
color: #666666;
}
.textSty{
width: 100%;
height:65vh;
border: none;
background-color: #eef1fb;
}
.textSty::-webkit-scrollbar{
width: 0px;

Loading…
Cancel
Save