对接新闻、专家

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. 49
      jeecgboot-vue3/src/views/demo/main-home/components/NewsList/index.vue
  4. 66
      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. 41
      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

@ -55,3 +55,48 @@ export function getindexarticle(params) {
params, 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: { meta: {
title: '新闻详情', title: '新闻详情',
ignoreAuth: true, ignoreAuth: true,
hidden: false hidden: true
}, },
}, },

@ -2,14 +2,15 @@
<div class="container"> <div class="container">
<div class="news-list"> <div class="news-list">
<div class="item" v-for="i in newList" :key="i"> <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="right">
<div class="title">{{ i.title }}</div> <div class="title">{{ i.title }}</div>
<div class="editor">{{ i.source }}</div> <div class="editor">{{ i.source }}</div>
<div class="description" <div class="description"><div v-html="i.info"></div></div>
><div v-html="i.info"></div></div <div class="get-info" @click="onGetInfo(i)">查看详情</div>
>
<div class="get-info">查看详情</div>
</div> </div>
</div> </div>
<!-- 分页 --> <!-- 分页 -->
@ -19,22 +20,23 @@
<div class="column-list"> <div class="column-list">
<div class="title">栏目列表</div> <div class="title">栏目列表</div>
<div class="list"> <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" v-for="i in newColumnList" :key="i.id" @click="getMyNewsList(i)">{{ i.name }}</div>
<!-- <div class="item">项目申报</div> <!-- <div class="item">项目申报</div>
<div class="item">新闻列表</div> --> <div class="item">新闻列表</div> -->
</div> </div>
</div> </div>
</div> </div>
</template> </template>
<script setup> <script setup>
import { Pagination } from 'ant-design-vue'; import { Pagination } from 'ant-design-vue';
import { getindexcolumn, getindexarticle } from '@/api/mainHome'; import { getindexcolumn, getindexarticle, getindexallarticle } from '@/api/mainHome';
import { ref } from 'vue'; import { ref } from 'vue';
import { useRouter } from 'vue-router';
const router = useRouter();
const current = ref(1); const current = ref(1);
const total = ref(0); const total = ref(0);
const page = ref({ const page = ref({
@ -55,15 +57,39 @@
}; };
const newList = ref([]); const newList = ref([]);
const getindexarticleEvent = async (id) => { const getindexarticleEvent = async (id) => {
columnId.value = id;
const res = await getindexarticle({ columnId: id, ...page.value }); const res = await getindexarticle({ columnId: id, ...page.value });
console.log(res); console.log(res);
newList.value = res.records; newList.value = res.records;
total.value = res.total; total.value = res.total;
}; };
const columnId = ref('');
const onChange = (page) => { const onChange = (page) => {
console.log(page); console.log(page);
page.pageNo = 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> </script>
@ -79,6 +105,7 @@
width: calc(1200px - 415px); width: calc(1200px - 415px);
margin-right: 30px; margin-right: 30px;
min-height: 755px; min-height: 755px;
padding-bottom: 80px;
.item { .item {
display: flex; display: flex;
width: 100%; width: 100%;
@ -170,7 +197,7 @@
.pagination { .pagination {
// background-color: #fff; // background-color: #fff;
position: absolute; position: absolute;
bottom: 0; bottom: -20px;
left: 50%; left: 50%;
transform: translateX(-50%); transform: translateX(-50%);
margin-top: 20px; margin-top: 20px;

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

@ -136,6 +136,7 @@
<script setup> <script setup>
import { ref, reactive } from 'vue'; import { ref, reactive } from 'vue';
import { vue3ScrollSeamless } from 'vue3-scroll-seamless'; import { vue3ScrollSeamless } from 'vue3-scroll-seamless';
import {getindexnews} from '/@/api/mainHome';
let list = reactive([1, 2, 3, 4, 5, 6]); let list = reactive([1, 2, 3, 4, 5, 6]);
const classOptions = { const classOptions = {
limitMoveNum: 2, 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://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', '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> </script>
<style scoped lang="less"> <style scoped lang="less">

@ -1,31 +1,49 @@
<template> <template>
<div class="container"> <div class="container">
<div class="news-list"> <div class="news-list">
<div>新闻列表>新闻详情</div>
<div class="item"> <div class="item">
<div class="right"> <div class="right">
<div class="title">新闻标题</div> <div class="title">{{ info.title }}</div>
<div class="editor"><div>2022-03-24 | 信息来源国际教育学院</div><div>负责人 | 无糖</div></div> <div class="editor"><div>{{info.publishTime}}| 信息来源{{ info.source }}</div></div>
<div class="description" <div class="description"
>小小文本小小文本小小文本小小文本小小文本小小文本小小文本小小文本小小文本小小文本小小文本小小文本小小文本小小文本小小文本小小文本小小文本小小文本小小文本小小文本小小文本小小文本</div ><div v-html="info.content"></div></div
> >
</div> </div>
</div> </div>
</div> </div>
<!-- 栏目 --> <!-- 栏目 -->
<div class="column-list"> <!-- <div class="column-list">
<div class="title">栏目列表</div> <div class="title">栏目列表</div>
<div class="list"> <div class="list">
<div class="item">全部</div> <div class="item">全部</div>
<div class="item">项目申报</div> <div class="item">项目申报</div>
<div class="item">新闻列表</div> <div class="item">新闻列表</div>
</div> </div>
</div> </div> -->
</div> </div>
</template> </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"> <style scoped lang="less">
.container { .container {
@ -35,7 +53,8 @@
display: flex; display: flex;
margin-top: 50px; margin-top: 50px;
.news-list { .news-list {
width: calc(1200px - 415px); // width: calc(1200px - 415px);
width: 100%;
margin-right: 30px; margin-right: 30px;
.item { .item {
@ -76,7 +95,7 @@
} }
.description { .description {
margin-top: 30px; margin-top: 30px;
width: 660px; // width: 660px;
text-indent: 2em; text-indent: 2em;
line-height: 28px; line-height: 28px;
} }
@ -110,7 +129,7 @@
color: #555; color: #555;
height: 50px; height: 50px;
line-height: 50px; line-height: 50px;
border-bottom: 1px solid #D9D9D9; border-bottom: 1px solid #d9d9d9;
cursor: pointer; cursor: pointer;
} }
} }

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

@ -8,7 +8,7 @@
<ul> <ul>
<li><a href="#">中国政府网</a></li> <li><a href="#">中国政府网</a></li>
<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> </ul>
</div> </div>
<div class="fr"> <div class="fr">

Loading…
Cancel
Save