|
@@ -0,0 +1,438 @@
|
|
|
+<script setup>
|
|
|
+import { apiReportIndexPageAuthList, apiReportIndexPageList,apiReportIndexNewbanner } from '@/api/report'
|
|
|
+import { onMounted, reactive, ref } from "vue"
|
|
|
+import { useRouter } from "vue-router"
|
|
|
+import moment from 'moment'
|
|
|
+import 'moment/dist/locale/zh-cn'
|
|
|
+moment.locale('zh-cn')
|
|
|
+
|
|
|
+import Search from "@/components/Search.vue"
|
|
|
+import SelfList from '@/components/SelfList.vue'
|
|
|
+
|
|
|
+const router = useRouter()
|
|
|
+
|
|
|
+
|
|
|
+// 获取顶部权限分类数据
|
|
|
+let firstTypeList = ref([])//一级分类数据
|
|
|
+let subTypeList = ref([])//二级分类数据
|
|
|
+let selectFirstType = ref('')//选择的一级分类
|
|
|
+let selectSubType = ref('')//选择的二级分类ID
|
|
|
+const getTopPermissionList = async () => {
|
|
|
+ const res = await apiReportIndexPageAuthList()
|
|
|
+ if (res.code === 200) {
|
|
|
+ firstTypeList.value = res.data.permission_list.filter(item => item.sort != 100000)
|
|
|
+ clickFirstType(firstTypeList.value[0])
|
|
|
+ }
|
|
|
+}
|
|
|
+getTopPermissionList()
|
|
|
+
|
|
|
+// 获取报告列表数据
|
|
|
+let reportState = reactive({
|
|
|
+ list: [],
|
|
|
+ page: 1,
|
|
|
+ pageSize: 20,
|
|
|
+ finished: false,
|
|
|
+ loading: false,
|
|
|
+ dateArr: [],//日期数据
|
|
|
+})
|
|
|
+const getReportList = async () => {
|
|
|
+ reportState.loading = true
|
|
|
+ const res = await apiReportIndexPageList({
|
|
|
+ chart_permission_id: Number(selectSubType.value),
|
|
|
+ current_index: reportState.page,
|
|
|
+ page_size: reportState.pageSize
|
|
|
+ })
|
|
|
+ reportState.loading = false
|
|
|
+ if (res.code === 200) {
|
|
|
+ if (res.data.paging.is_end) {
|
|
|
+ reportState.finished = true
|
|
|
+ }
|
|
|
+ //处理数据
|
|
|
+ if (res.data.list) {
|
|
|
+ if(reportState.list.length==0){
|
|
|
+ // 第一页数据
|
|
|
+ reportState.list = res.data.list
|
|
|
+ res.data.list.forEach(item => {
|
|
|
+ reportState.dateArr.push(item.date)
|
|
|
+ })
|
|
|
+ }else {
|
|
|
+ //判断是否前面已经有相同日期数据 有的话添加合并
|
|
|
+ let arr = []
|
|
|
+ let temTimearr = []
|
|
|
+ res.data.list.forEach(item => {
|
|
|
+ if (reportState.dateArr.includes(item.date)) {
|
|
|
+ reportState.list.forEach(_item => {
|
|
|
+ if (item.date === _item.date) {
|
|
|
+ _item.sub_list = [..._item.sub_list, ...item.sub_list]
|
|
|
+ }
|
|
|
+ })
|
|
|
+ } else {
|
|
|
+ arr.push(item)
|
|
|
+ temTimearr.push(item.date)
|
|
|
+ }
|
|
|
+ });
|
|
|
+ reportState.list = [...reportState.list, ...arr]
|
|
|
+ reportState.dateArr = [...reportState.dateArr, ...temTimearr]
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+}
|
|
|
+
|
|
|
+//点击顶部一级分类
|
|
|
+const clickFirstType = (item) => {
|
|
|
+ selectFirstType.value = item.classify_name
|
|
|
+ subTypeList.value = item.list
|
|
|
+ clickSubType(item.list[0])
|
|
|
+}
|
|
|
+//点击二级分类
|
|
|
+const clickSubType = (item) => {
|
|
|
+ selectSubType.value = item.chart_permission_id
|
|
|
+ reportState.list = []
|
|
|
+ reportState.page = 1
|
|
|
+ reportState.finished = false
|
|
|
+ getReportList()
|
|
|
+}
|
|
|
+
|
|
|
+// 列表加载更多
|
|
|
+const onLoad=()=>{
|
|
|
+ reportState.page++
|
|
|
+ getReportList()
|
|
|
+}
|
|
|
+
|
|
|
+
|
|
|
+// 获取上新公告
|
|
|
+const getNewAnnounce=async ()=>{
|
|
|
+ // const res1=await apiReportIndexNewbanner()
|
|
|
+}
|
|
|
+getNewAnnounce()
|
|
|
+
|
|
|
+//跳转至研报分类页
|
|
|
+const handleGoMoreClassify = () => {
|
|
|
+ router.push({ path:'/report/classify' });
|
|
|
+};
|
|
|
+
|
|
|
+//跳转报告详情
|
|
|
+const handleGoReportDetail=(item)=>{
|
|
|
+ if(['晨报','周报'].includes(item.classify_name_first)){
|
|
|
+ router.push({
|
|
|
+ path:'/report/chapterdetail',
|
|
|
+ query:{
|
|
|
+ chapterId:item.report_chapter_id
|
|
|
+ }
|
|
|
+ })
|
|
|
+ }else{
|
|
|
+ router.push({
|
|
|
+ path:'/report/detail',
|
|
|
+ query:{
|
|
|
+ reportId:item.report_id
|
|
|
+ }
|
|
|
+ })
|
|
|
+ }
|
|
|
+
|
|
|
+}
|
|
|
+
|
|
|
+let isMounted = ref(false);
|
|
|
+onMounted(() => {
|
|
|
+ isMounted.value = true;
|
|
|
+});
|
|
|
+
|
|
|
+// 格式化列表日期
|
|
|
+const formatDate=(e)=>{
|
|
|
+ const isSameYear=moment(e).isSame(new Date(), 'year');
|
|
|
+ if(isSameYear){//今年
|
|
|
+ return moment(e).format('MM.DD')+' '+ moment(e).format('ddd')
|
|
|
+ }else{
|
|
|
+ return moment(e).format('YY.MM.DD')+' '+moment(e).format('ddd')
|
|
|
+ }
|
|
|
+}
|
|
|
+
|
|
|
+</script>
|
|
|
+<template>
|
|
|
+ <!-- 搜索 -->
|
|
|
+ <template v-if="isMounted&&$route.path=='/report/index'">
|
|
|
+ <teleport to="#reportIndex-in-head">
|
|
|
+ <Search
|
|
|
+ style="margin-top: 10px;"
|
|
|
+ placeholder="请输入标题/关键词"
|
|
|
+ :disabled="true"
|
|
|
+ @click="$router.push('/report/search')"
|
|
|
+ ></Search>
|
|
|
+ </teleport>
|
|
|
+ </template>
|
|
|
+ <div class="hasrightaside-box report-list-page">
|
|
|
+ <div class="report-main">
|
|
|
+ <div class="top-nav-wrap">
|
|
|
+ <div class="flex first-nav">
|
|
|
+ <div
|
|
|
+ :class="['item', item.classify_name == selectFirstType && 'item-active']"
|
|
|
+ v-for="item in firstTypeList"
|
|
|
+ :key="item.classify_name"
|
|
|
+ @click="clickFirstType(item)"
|
|
|
+ >{{ item.classify_name }}</div>
|
|
|
+ <!-- 查看更多 -->
|
|
|
+ <div class="see-more" @click="handleGoMoreClassify">查看更多</div>
|
|
|
+ </div>
|
|
|
+ <div class="flex sub-nav">
|
|
|
+ <span
|
|
|
+ :class="['sub-item', item.chart_permission_id == selectSubType && 'sub-active']"
|
|
|
+ v-for="item in subTypeList"
|
|
|
+ :key="item.chart_permission_id"
|
|
|
+ @click="clickSubType(item)"
|
|
|
+ >{{ item.chart_permission_name }}</span>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ <!-- 报告列表 -->
|
|
|
+ <SelfList
|
|
|
+ :finished="reportState.finished"
|
|
|
+ :isEmpty="reportState.list.length === 0 && reportState.finished"
|
|
|
+ :loading="reportState.loading"
|
|
|
+ @listOnload="onLoad"
|
|
|
+ >
|
|
|
+ <div class="report-list-wrap">
|
|
|
+ <div class="item" v-for="item in reportState.list" :key="item.date">
|
|
|
+ <div class="item-time">{{ formatDate(item.date) }}</div>
|
|
|
+ <div class="content-list">
|
|
|
+ <div class="content-item" v-for="citem in item.sub_list" :key="citem.report_id">
|
|
|
+ <div class="content-box">
|
|
|
+ <div class="all-btn" @click="handleGoReportDetail(citem)">查看全部</div>
|
|
|
+ <div class="c-time">{{ moment(citem.publish_time).format('HH:mm:ss') }}</div>
|
|
|
+ <div class="c-title">{{ citem.title }}</div>
|
|
|
+ <div class="desc" v-html="citem.content_sub"></div>
|
|
|
+ <div class="tags">
|
|
|
+ <span style="margin-right:30px" v-if="citem.classify_name_first">#{{ citem.classify_name_first }}</span>
|
|
|
+ <span v-if="citem.classify_name_second">#{{ citem.classify_name_second }}</span>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ </SelfList>
|
|
|
+
|
|
|
+ </div>
|
|
|
+ <div class="right-aside-box" style="position: relative;z-index: 100;">
|
|
|
+ <div class="fix-top" style="z-index: 100;">
|
|
|
+ <div class="recmd-box">
|
|
|
+ <div class="label">最新资讯</div>
|
|
|
+ <div class="recmd-item">
|
|
|
+ <div class="title">股债日评</div>
|
|
|
+ <div>178 | 关注中美领导交流</div>
|
|
|
+ </div>
|
|
|
+ <div class="recmd-item">
|
|
|
+ <div class="title">股债日评</div>
|
|
|
+ <div>178 | 关注中美领导交流</div>
|
|
|
+ </div>
|
|
|
+ <div class="recmd-item">
|
|
|
+ <div class="title">股债日评</div>
|
|
|
+ <div>178 | 关注中美领导交流</div>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ <div class="hot-box" style="margin-top: 60px;">
|
|
|
+ <div class="label">上新公告</div>
|
|
|
+ <div class="img-con"></div>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ <!-- 回到顶部 -->
|
|
|
+ <el-backtop :bottom="100" visibility-height="500">
|
|
|
+ <img src="@/assets/icon-back-top.png" alt="" style="width: 60px;">
|
|
|
+ </el-backtop>
|
|
|
+</template>
|
|
|
+
|
|
|
+<style lang="scss" scoped>
|
|
|
+.el-backtop{
|
|
|
+ z-index: 1000;
|
|
|
+}
|
|
|
+$bg-color: #f6f6f6;
|
|
|
+$active-color: #f3a52f;
|
|
|
+
|
|
|
+.report-list-page {
|
|
|
+ position: relative;
|
|
|
+ .report-main {
|
|
|
+ padding-right: 250px;
|
|
|
+ .top-nav-wrap {
|
|
|
+ position: fixed;
|
|
|
+ top: 60px;
|
|
|
+ z-index: 99;
|
|
|
+ background-color: #fff;
|
|
|
+ padding-top: 30px;
|
|
|
+ padding-bottom: 12px;
|
|
|
+ min-width: 880px;
|
|
|
+ max-width: 1240px;
|
|
|
+ width: 100%;
|
|
|
+ border-bottom: 1px solid #f2f2f2;
|
|
|
+ .first-nav {
|
|
|
+ .item {
|
|
|
+ width: 140px;
|
|
|
+ height: 40px;
|
|
|
+ flex-shrink: 0;
|
|
|
+ background: #F6F6F6;
|
|
|
+ border-radius: 20px;
|
|
|
+ text-align: center;
|
|
|
+ line-height: 40px;
|
|
|
+ font-size: 16px;
|
|
|
+ margin-right: 30px;
|
|
|
+ cursor: pointer;
|
|
|
+
|
|
|
+ &:hover {
|
|
|
+ background: #FFFBF5;
|
|
|
+ color: #F3A52F;
|
|
|
+ border: 1px solid #F3A52F;
|
|
|
+ box-shadow: 0px 6px 7px 1px #FFF7EB;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ .item-active {
|
|
|
+ background: #FFFBF5;
|
|
|
+ color: #F3A52F;
|
|
|
+ border: 1px solid #F3A52F;
|
|
|
+ box-shadow: 0px 6px 7px 1px #FFF7EB;
|
|
|
+ }
|
|
|
+ .see-more{
|
|
|
+ color: #f3a52f;
|
|
|
+ font-size: 16px;
|
|
|
+ position: relative;
|
|
|
+ top: 10px;
|
|
|
+ margin-left: 30px;
|
|
|
+ cursor: pointer;
|
|
|
+ &::after{
|
|
|
+ content: '';
|
|
|
+ display: inline-block;
|
|
|
+ width: 16px;
|
|
|
+ height: 16px;
|
|
|
+ background-image: url('../../assets/icon-more.png');
|
|
|
+ background-size: cover;
|
|
|
+ position: relative;
|
|
|
+ top: 2px;
|
|
|
+ left: 5px;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ .sub-nav {
|
|
|
+ margin-top: 30px;
|
|
|
+ overflow-x: scroll;
|
|
|
+
|
|
|
+ &::-webkit-scrollbar {
|
|
|
+ display: none;
|
|
|
+ }
|
|
|
+
|
|
|
+ .sub-item {
|
|
|
+ flex-shrink: 0;
|
|
|
+ margin-right: 30px;
|
|
|
+ font-size: 16px;
|
|
|
+ color: #666666;
|
|
|
+ cursor: pointer;
|
|
|
+ }
|
|
|
+
|
|
|
+ .sub-active {
|
|
|
+ color: #F3A52F;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ .report-list-wrap {
|
|
|
+ margin-top: 120px;
|
|
|
+ .item{
|
|
|
+ margin-bottom: 30px;
|
|
|
+ }
|
|
|
+ .item-time {
|
|
|
+ font-size: 16px;
|
|
|
+ margin-bottom: 40px;
|
|
|
+ }
|
|
|
+
|
|
|
+ .content-list {
|
|
|
+ padding-left: 20px;
|
|
|
+ .content-box {
|
|
|
+ padding: 0 0px 20px 14px;
|
|
|
+ position: relative;
|
|
|
+ .all-btn {
|
|
|
+ position: absolute;
|
|
|
+ right: 20px;
|
|
|
+ bottom: 20px;
|
|
|
+ width: 88px;
|
|
|
+ height: 30px;
|
|
|
+ line-height: 30px;
|
|
|
+ background: #FFFBF5;
|
|
|
+ border-radius: 15px;
|
|
|
+ border: 1px solid #F3A52F;
|
|
|
+ color: #F3A52F;
|
|
|
+ font-size: 14px;
|
|
|
+ text-align: center;
|
|
|
+ cursor: pointer;
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ .content-item {
|
|
|
+ padding: 0 0 50px 20px;
|
|
|
+ border-left: 1px solid #F3A52F;
|
|
|
+ position: relative;
|
|
|
+
|
|
|
+ &:last-child {
|
|
|
+ border-bottom: none;
|
|
|
+ padding-bottom: 0px;
|
|
|
+ }
|
|
|
+
|
|
|
+ &::before {
|
|
|
+ content: '';
|
|
|
+ display: block;
|
|
|
+ box-sizing: border-box;
|
|
|
+ width: 14px;
|
|
|
+ height: 14px;
|
|
|
+ border-radius: 50%;
|
|
|
+ border: 3px solid #FADBAC;
|
|
|
+ position: absolute;
|
|
|
+ left: 0;
|
|
|
+ top: 0;
|
|
|
+ background: #F3A52F;
|
|
|
+ transform: translate(-50%, -50%);
|
|
|
+ z-index: 2;
|
|
|
+ }
|
|
|
+
|
|
|
+ &::after {
|
|
|
+ content: '';
|
|
|
+ display: block;
|
|
|
+ width: 20px;
|
|
|
+ height: 1px;
|
|
|
+ background-color: #F3A52F;
|
|
|
+ position: absolute;
|
|
|
+ top: 0;
|
|
|
+ left: 0;
|
|
|
+ z-index: 1;
|
|
|
+ }
|
|
|
+
|
|
|
+ .c-time {
|
|
|
+ position: relative;
|
|
|
+ top: -8px;
|
|
|
+ font-size: 14px;
|
|
|
+ color: #666;
|
|
|
+ }
|
|
|
+
|
|
|
+ .c-title {
|
|
|
+ font-size: 16px;
|
|
|
+ font-weight: bold;
|
|
|
+ word-wrap: break-word;
|
|
|
+ white-space: normal;
|
|
|
+ word-break: break-all;
|
|
|
+ margin-top: 5px;
|
|
|
+ }
|
|
|
+
|
|
|
+ .desc {
|
|
|
+ line-height: 1.5;
|
|
|
+ margin-top: 10px;
|
|
|
+ color: #666666;
|
|
|
+ font-size: 14px;
|
|
|
+ }
|
|
|
+
|
|
|
+ .tags {
|
|
|
+ margin-top: 14px;
|
|
|
+ color: #F3A52F;
|
|
|
+ min-height: 30px;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ }
|
|
|
+}
|
|
|
+</style>
|