对接新闻、专家

master
JayChou 2 weeks ago
parent d5f65ebc55
commit b91aa56b8e
  1. 45
      jeecgboot-vue3/src/api/mainHome/index.ts
  2. 2
      jeecgboot-vue3/src/router/helper/mainOut.ts
  3. 71
      jeecgboot-vue3/src/views/demo/main-home/components/NewsList/index.vue
  4. 68
      jeecgboot-vue3/src/views/demo/main-home/components/expertManagement/index.vue
  5. 7
      jeecgboot-vue3/src/views/demo/main-home/components/homePage/index.vue
  6. 57
      jeecgboot-vue3/src/views/demo/main-home/components/newsInfo/index.vue
  7. 34
      jeecgboot-vue3/src/views/demo/main-home/components/projectDeclaration/index.vue
  8. 2
      jeecgboot-vue3/src/views/demo/main-home/index.vue

@ -54,4 +54,49 @@ export function getindexarticle(params) {
method: 'GET',
params,
});
}
//
export function getindexallarticle() {
return defHttp.request({
url: '/cms/front/cmsfindallnews',
method: 'GET',
});
}
//
export function getindexarticleitem(params) {
return defHttp.request({
url: '/cms/front/getByArticleTitle',
method: 'GET',
params,
});
}
//
export function getindexnews() {
return defHttp.request({
url: '/cms/front/getindexnew',
method: 'GET',
});
}
//
export function getindexexpert(params) {
return defHttp.request({
url: '/expert/expert/listadminCMS',
method: 'GET',
params
});
}
//
export function getindexexpertdetail(params) {
return defHttp.request({
url: '/expert/expert/CMSexpinfo',
method: 'GET',
params,
});
}
//
export function getindexexperttype() {
return defHttp.request({
url: '/expert/expert/directioncalListCMS',
method: 'GET',
});
}

@ -90,7 +90,7 @@ export const mainOutRoutes: AppRouteModule[] = [
meta: {
title: '新闻详情',
ignoreAuth: true,
hidden: false
hidden: true
},
},

@ -2,39 +2,41 @@
<div class="container">
<div class="news-list">
<div class="item" v-for="i in newList" :key="i">
<div class="left"><div class="year">{{ i.publishTime.split('-')[0] }}-{{ i.publishTime.split('-')[1] }}</div><div class="day">{{ i.publishTime.split(' ')[0].split('-')[2] }}</div></div>
<div class="left"
><div class="year">{{ i.publishTime.split('-')[0] }}-{{ i.publishTime.split('-')[1] }}</div
><div class="day">{{ i.publishTime.split(' ')[0].split('-')[2] }}</div></div
>
<div class="right">
<div class="title">{{ i.title }}</div>
<div class="editor">{{ i.source }}</div>
<div class="description"
><div v-html="i.info"></div></div
>
<div class="get-info">查看详情</div>
<div class="description"><div v-html="i.info"></div></div>
<div class="get-info" @click="onGetInfo(i)">查看详情</div>
</div>
</div>
<!-- 分页 -->
<div class="pagination"> <Pagination :current="current" :pageSize="page.pageSize" :total="total" show-less-items @change="onChange" /></div>
<!-- 分页 -->
<div class="pagination"> <Pagination :current="current" :pageSize="page.pageSize" :total="total" show-less-items @change="onChange" /></div>
</div>
<!-- 栏目 -->
<div class="column-list">
<div class="title">栏目列表</div>
<div class="list">
<div class="item">全部</div>
<div class="item" @click="getindexallarticleEvent">全部</div>
<div class="item" v-for="i in newColumnList" :key="i.id" @click="getMyNewsList(i)">{{ i.name }}</div>
<!-- <div class="item">项目申报</div>
<div class="item">新闻列表</div> -->
</div>
</div>
</div>
</template>
<script setup>
import { Pagination } from 'ant-design-vue';
import { getindexcolumn, getindexarticle } from '@/api/mainHome';
import { getindexcolumn, getindexarticle, getindexallarticle } from '@/api/mainHome';
import { ref } from 'vue';
import { useRouter } from 'vue-router';
const router = useRouter();
const current = ref(1);
const total = ref(0);
const page = ref({
@ -55,15 +57,39 @@
};
const newList = ref([]);
const getindexarticleEvent = async (id) => {
columnId.value = id;
const res = await getindexarticle({ columnId: id, ...page.value });
console.log(res);
newList.value = res.records;
total.value = res.total;
};
const columnId = ref('');
const onChange = (page) => {
console.log(page);
page.pageNo = page;
getindexarticleEvent();
if (columnId.value) {
getindexarticleEvent(columnId.value);
} else {
getindexallarticleEvent();
}
};
const getindexallarticleEvent = async () => {
const res = await getindexallarticle();
console.log(res);
newList.value = res.records;
total.value = res.total;
};
getindexallarticleEvent();
//
const onGetInfo = (item) => {
console.log(item);
router.push({
path: '/main-home/newsInfo',
query: {
id: item.id,
},
})
}
</script>
@ -79,6 +105,7 @@
width: calc(1200px - 415px);
margin-right: 30px;
min-height: 755px;
padding-bottom: 80px;
.item {
display: flex;
width: 100%;
@ -168,14 +195,14 @@
}
}
.pagination {
// background-color: #fff;
position: absolute;
bottom: 0;
left: 50%;
transform: translateX(-50%);
margin-top: 20px;
height: 70px;
display: flex;
justify-content: center;
}
// background-color: #fff;
position: absolute;
bottom: -20px;
left: 50%;
transform: translateX(-50%);
margin-top: 20px;
height: 70px;
display: flex;
justify-content: center;
}
</style>

@ -1,24 +1,73 @@
<template>
<div class="container">
<div class="filter">
<div :class="activeIndex === index ? 'item avtive' : 'item'" @click="activeIndex = index" v-for="(i, index) in filterList" :key="i">{{
i
<div :class="activeIndex === index ? 'item avtive' : 'item'" @click="filterType(i.id, index)" v-for="(i, index) in typeList" :key="i">{{
i.name
}}</div>
</div>
<div class="user-list">
<div class="item" v-for="i in 10" :key="i">
<div class="item" v-for="i in expertList" :key="i.id">
<div class="avater"></div>
<div class="name">张三</div>
<div class="description">专家介绍</div>
<div class="name">{{ i.realname }}</div>
<div class="description">{{ i.expinfo || '暂无' }}</div>
</div>
</div>
<!-- 分页 -->
<div class="pagination"> <Pagination :current="page.pageNo" :pageSize="page.pageSize" :total="total" show-less-items @change="onChange" /></div>
</div>
</template>
<script setup>
import { ref } from 'vue';
import { getindexexpert ,getindexexperttype} from '@/api/mainHome';
import { Pagination } from 'ant-design-vue';
const activeIndex = ref(0);
const filterList = ref(['全部', '科技学科领域', '高新技术', '化学精密', '其他筛选']);
const expertList = ref([]);
const current = ref(1);
const total = ref(0);
const page = ref({
pageSize: 8,
pageNo: 1,
directioncal:''
});
const getList = async () => {
const data = page.value
for (const key in data) {
if (!data[key]) {
delete data[key];
}
}
const res = await getindexexpert(data);
expertList.value = res.records;
total.value = res.total;
};
getList();
const onChange = (pageIndex) => {
console.log(pageIndex);
page.value.pageNo = pageIndex;
getList()
};
const typeList = ref([]);
const getTypeList = async () => {
const res = await getindexexperttype();
typeList.value = res;
typeList.value.unshift({ id: 0, name: '全部' });
};
getTypeList();
const filterType = (id, index) => {
if(id === 0) {
page.value.directioncal = '';
getList();
return
}
activeIndex.value = index;
page.value.directioncal = id;
getList();
}
</script>
<style scoped lang="less">
@ -48,6 +97,7 @@
grid-template-columns: repeat(4, minmax(100px, 1fr));
grid-template-rows: repeat(auto - fill, minmax(50px, 100px));
gap: 15px;
min-height: 500px;
.item {
position: relative;
width: 287px;
@ -80,7 +130,7 @@
.item::before {
content: ' ';
position: absolute;
top:10px;
top: 10px;
left: -5px;
display: block;
width: 25px;
@ -89,4 +139,10 @@
}
}
}
.pagination {
// background-color: #fff;
height: 70px;
display: flex;
justify-content: center;
}
</style>

@ -136,6 +136,7 @@
<script setup>
import { ref, reactive } from 'vue';
import { vue3ScrollSeamless } from 'vue3-scroll-seamless';
import {getindexnews} from '/@/api/mainHome';
let list = reactive([1, 2, 3, 4, 5, 6]);
const classOptions = {
limitMoveNum: 2,
@ -145,6 +146,12 @@
'https://ts1.cn.mm.bing.net/th/id/R-C.987f582c510be58755c4933cda68d525?rik=C0D21hJDYvXosw&riu=http%3a%2f%2fimg.pconline.com.cn%2fimages%2fupload%2fupc%2ftx%2fwallpaper%2f1305%2f16%2fc4%2f20990657_1368686545122.jpg&ehk=netN2qzcCVS4ALUQfDOwxAwFcy41oxC%2b0xTFvOYy5ds%3d&risl=&pid=ImgRaw&r=0',
'https://tse1-mm.cn.bing.net/th/id/OIP-C.DOOxGtkUiW8QevWtAxsRtAHaEK?rs=1&pid=ImgDetMain',
]);
const getlist = async () => {
const res = await getindexnews();
console.log(res);
}
getlist()
</script>
<style scoped lang="less">

@ -1,31 +1,49 @@
<template>
<div class="container">
<div class="news-list">
<div>新闻列表>新闻详情</div>
<div class="item">
<div class="right">
<div class="title">新闻标题</div>
<div class="editor"><div>2022-03-24 | 信息来源国际教育学院</div><div>负责人 | 无糖</div></div>
<div class="title">{{ info.title }}</div>
<div class="editor"><div>{{info.publishTime}}| 信息来源{{ info.source }}</div></div>
<div class="description"
>小小文本小小文本小小文本小小文本小小文本小小文本小小文本小小文本小小文本小小文本小小文本小小文本小小文本小小文本小小文本小小文本小小文本小小文本小小文本小小文本小小文本小小文本</div
><div v-html="info.content"></div></div
>
</div>
</div>
</div>
<!-- 栏目 -->
<div class="column-list">
<!-- <div class="column-list">
<div class="title">栏目列表</div>
<div class="list">
<div class="item">全部</div>
<div class="item">项目申报</div>
<div class="item">新闻列表</div>
</div>
</div>
</div> -->
</div>
</template>
<script setup></script>
<script setup>
import {getindexarticleitem} from '@/api/mainHome'
import { useRoute } from 'vue-router';
import { ref } from 'vue';
const route = useRoute()
const id = route.query.id
const info = ref({
title: '',
publishTime: '',
source: '',
content: ''
})
const getInfo = async () => {
const res = await getindexarticleitem({id})
info.value = res[0]
}
getInfo()
</script>
<style scoped lang="less">
.container {
@ -35,16 +53,17 @@
display: flex;
margin-top: 50px;
.news-list {
width: calc(1200px - 415px);
margin-right: 30px;
// width: calc(1200px - 415px);
width: 100%;
margin-right: 30px;
.item {
display: flex;
width: 100%;
padding-bottom: 45px;
margin-top: 40px;
.right {
margin-left: 30px;
.title {
@ -69,14 +88,14 @@
content: '';
display: block;
position: absolute;
width:4px;
left: -40px;
width: 4px;
left: -40px;
height: 53px;
background-color: #d9d9d9;
}
.description {
margin-top: 30px;
width: 660px;
// width: 660px;
text-indent: 2em;
line-height: 28px;
}
@ -99,18 +118,18 @@
background-color: #fff;
height: 755px;
padding: 30px;
.title{
.title {
font-size: 20px;
font-weight: 600;
color: #555;
}
.list{
.item{
.list {
.item {
font-size: 16px;
color: #555;
height: 50px;
line-height: 50px;
border-bottom: 1px solid #D9D9D9;
border-bottom: 1px solid #d9d9d9;
cursor: pointer;
}
}

@ -1,12 +1,6 @@
<template>
<div class="container">
<div class="top-filter">
<div :class="activeIndex === index ? 'active item' : 'item'" @click="activeIndex = index" class="item "
v-for="(item, index) in filterList" :key="index">
<component :is="item.icon"></component>
<div style="margin-left: 10px">{{ item.label }}</div>
</div>
</div>
<div class="mainTop">
<div class="resultShow">
<div class="top">
@ -27,10 +21,10 @@
</div>
<div class="userInto">
<h2>用户登录</h2>
<div class="more">个人登录</div>
<div class="more">法人登录</div>
<div class="more">主管部门登录</div>
<div class="more">省科技厅登录</div>
<div class="more" @click="goToLogin">个人登录</div>
<div class="more" @click="goToLogin">法人登录</div>
<div class="more" @click="goToLogin">主管部门登录</div>
<div class="more" @click="goToLogin">省科技厅登录</div>
</div>
</div>
<div class="mainCenter">
@ -46,17 +40,14 @@
<script setup>
import { ref } from 'vue';
import { PartitionOutlined, DollarCircleOutlined } from '@ant-design/icons-vue';
import { useRouter } from 'vue-router';
const router = useRouter();
const activeIndex = ref(0);
const filterList = ref([
{ label: '科技省厅', icon: PartitionOutlined },
{ label: '管理制度', icon: DollarCircleOutlined },
{ label: '申报项目', icon: DollarCircleOutlined },
{ label: '项目受理', icon: DollarCircleOutlined },
{ label: '立项信息', icon: DollarCircleOutlined },
{ label: '验收情况', icon: DollarCircleOutlined },
{ label: '创新券', icon: DollarCircleOutlined },
]);
const goToLogin = () => {
router.push({
path: '/login',
});
}
</script>
<style scoped lang="less">
@ -138,6 +129,7 @@ const filterList = ref([
color: #e3ebf8;
border-radius: 1cap;
margin: 15px 58px;
cursor: pointer;
}
}
}

@ -8,7 +8,7 @@
<ul>
<li><a href="#">中国政府网</a></li>
<li><a href="#">科学技术部</a></li>
<li><a href="#" style="border: none">河南省人民政府</a></li>
<li><a href="#" style="border: none">驻马店人民政府</a></li>
</ul>
</div>
<div class="fr">

Loading…
Cancel
Save