Browse Source

查询机

master
xuhuajiao 2 months ago
parent
commit
7d0810f19a
  1. 36
      src/assets/styles/index.scss
  2. 10
      src/router/index.js
  3. 17
      src/store/column.js
  4. 92
      src/views/columnLayout copy.vue
  5. 146
      src/views/columnLayout.vue
  6. 234
      src/views/columnListMix.vue
  7. 4
      src/views/columnListMixDetail.vue
  8. 7
      src/views/imgTxtDetail.vue
  9. 6
      src/views/index.vue
  10. 174
      src/views/menu.vue
  11. 2
      src/views/module/waterfall.vue
  12. 1
      src/views/waterfallFlow.vue

36
src/assets/styles/index.scss

@ -68,20 +68,50 @@
}
}
.activity-list li {
height: 90px;
margin: 0 40px;
display: flex;
justify-content: space-between;
align-items: center;
// height: 100px;
// margin: 0 40px;
border-bottom: 1px solid #d9d9d9;
font-size: 30px;
line-height: 90px;
padding: 0 20px;
img{
display: block;
// width: 100px;
height: 90px;
margin-right: 20px;
}
span.date {
float: right;
// float: right;
display: block;
padding-left: 10px;
}
.activity-title {
flex: 1;
white-space: nowrap;
overflow: hidden;
text-overflow: ellipsis;
width: calc(100% - 282px);
display: inline-block;
}
}
.imgTxt-list{
li{
padding: 10px 20px;
}
}
.new-detial-info {
background: #ffffff;
width: 100%;
height: calc(100%);
padding: 20px;
overflow-y: auto;
}
.new-menu-detial-info{
height: calc(100% - 60px);
}

10
src/router/index.js

@ -54,12 +54,12 @@ const routes = [
// meta: {
// title: '活动详情'
// }
// // },
// {
// path: '/menu',
// name: 'menu',
// component: () => import('@/views/menu.vue')
// },
{
path: '/menu',
name: 'menu',
component: () => import('@/views/menu.vue')
},
{
path: '/imgTxtDetail',
name: 'imgTxtDetail',

17
src/store/column.js

@ -3,7 +3,12 @@
const state = {
tabList: [],
libcode: '',
selectMenuIndex: 0
selectMenuIndex: 0,
pagination: {
currentPage: 0,
pageSize: 10,
totalItems: 0
}
}
// mutations
@ -18,6 +23,16 @@ const mutations = {
// 更新选中的菜单索引
setSelectMenuIndex(state, index) {
state.selectMenuIndex = index
},
resetPagination(state) {
state.pagination = {
currentPage: 0,
pageSize: 10,
totalItems: 0
}
},
updatePagination(state, payload) {
state.pagination = { ...state.pagination, ...payload }
}
}

92
src/views/columnLayout copy.vue

@ -0,0 +1,92 @@
<template>
<div class="content-main introduction-main">
<div class="nav-menu">
<ul>
<li
v-for="(item,index) in tabList"
:key="index"
:class="{ 'is-active': selectMenuIndex === index }"
@click="selectMenuChange(item, index)"
>
{{ item.title }}
</li>
</ul>
</div>
<div class="introduction-info">
<router-view />
</div>
</div>
</template>
<script>
import { FetchQueryTopicDetails } from '@/api/inquiryMachine'
export default {
name: 'ColumnLayout',
data() {
return {
libcode: '',
tabList: [],
selectMenuIndex: 0
}
},
created() {
const savedIndex = localStorage.getItem('selectIndex')
if (savedIndex !== null) {
this.selectMenuIndex = parseInt(savedIndex)
}
this.getQueryTopicDetails()
},
methods: {
getQueryTopicDetails() {
const params = { 'id': this.$route.query.menuId }
FetchQueryTopicDetails(params).then(res => {
console.log('接口返回数据:', res)
if (res && res.queryTopicList && res.queryTopicList.length > 0) {
this.tabList = res.queryTopicList
this.libcode = res.queryMenu.libcode
// this.$store.commit
this.$store.commit('column/setColumnData', {
tabList: this.tabList,
libcode: this.libcode,
selectMenuIndex: this.selectMenuIndex
})
console.log('Vuex设置成功:', this.$store.state.column.tabList)
} else {
console.error('接口返回的queryTopicList为空或格式错误')
}
}).catch(err => {
console.error('接口请求失败:', err)
this.$message.error('接口错误')
})
},
selectMenuChange(item, index) {
this.selectMenuIndex = index
localStorage.setItem('selectIndex', index)
this.$store.commit('column/setSelectMenuIndex', index)
//
this.$store.commit('column/updatePagination', { currentPage: 0 })
const listMixComponent = this.$children.find(child => child.$options.name === 'ColumnListMix')
if (listMixComponent) {
// +
listMixComponent.infoList = []
listMixComponent.unbindScrollListener()
//
listMixComponent.getInitQueryTopicContext(item)
}
//
const targetRoute = { name: 'ColumnListMix', query: this.$route.query }
const currentRoute = this.$router.currentRoute
if (currentRoute.name !== targetRoute.name ||
JSON.stringify(currentRoute.query) !== JSON.stringify(targetRoute.query)) {
this.$router.push(targetRoute)
}
}
}
}
</script>
<style lang="scss" scoped>
@import "~@/assets/styles/index.scss";
</style>

146
src/views/columnLayout.vue

@ -1,18 +1,29 @@
<template>
<div class="content-main introduction-main">
<div class="nav-menu">
<div v-if="currentMenuType===1" class="nav-menu">
<ul>
<li v-for="(item, index) in leftMenuList" :key="index" :class="{ 'is-active': leftMenuIndex === index }" @click="handleMenuClick(item, index)"> {{ item.title }} </li>
</ul>
</div>
<div v-else class="nav-menu">
<ul>
<li v-for="(item, index) in tabList" :key="index" :class="{ 'is-active': selectMenuIndex === index }" @click="selectMenuChange(item, index)"> {{ item.title }} </li>
</ul>
</div>
<div class="introduction-info" style="overflow: hidden;">
<ul v-if="currentMenuType===1" class="menu-tab-list">
<li
v-for="(item,index) in tabList"
v-for="(item, index) in tabList"
:key="index"
:class="{ 'is-active': selectMenuIndex === index }"
:class="{ 'active': selectMenuIndex === index }"
@click="selectMenuChange(item, index)"
>
{{ item.title }}
</li>
</ul>
</div>
<div class="introduction-info">
<!-- <div v-if="currentMenuType===1" style="height: calc(100% - 70px)">
<router-view />
</div> -->
<router-view />
</div>
</div>
@ -26,9 +37,14 @@ export default {
return {
libcode: '',
tabList: [],
selectMenuIndex: 0
leftMenuList: [],
leftMenuIndex: 0,
selectMenuIndex: 0,
currentMenuType: 2
}
},
computed: {
},
created() {
const savedIndex = localStorage.getItem('selectIndex')
if (savedIndex !== null) {
@ -36,50 +52,81 @@ export default {
}
this.getQueryTopicDetails()
},
mounted() {
},
methods: {
getQueryTopicDetails() {
const params = { 'id': this.$route.query.menuId }
FetchQueryTopicDetails(params).then(res => {
console.log('接口返回数据:', res)
if (res && res.queryTopicList && res.queryTopicList.length > 0) {
this.tabList = res.queryTopicList
this.libcode = res.queryMenu.libcode
// this.$store.commit
this.$store.commit('column/setColumnData', {
tabList: this.tabList,
libcode: this.libcode,
selectMenuIndex: this.selectMenuIndex
})
console.log('Vuex设置成功:', this.$store.state.column.tabList)
this.currentMenuType = res.queryMenu?.type
this.libcode = res.queryMenu?.libcode || ''
if (this.currentMenuType === 1) {
if (res && res.queryMenu) {
this.leftMenuList = res.queryMenu.children || []
if (this.leftMenuList.length > 0) {
this.handleMenuClick(this.leftMenuList[this.leftMenuIndex], this.leftMenuIndex)
}
}
} else {
console.error('接口返回的queryTopicList为空或格式错误')
if (res && res.queryTopicList && res.queryTopicList.length > 0) {
this.tabList = res.queryTopicList
this.$store.commit('column/setColumnData', {
tabList: this.tabList,
libcode: this.libcode,
selectMenuIndex: this.selectMenuIndex
})
} else {
console.error('接口返回的queryTopicList为空或格式错误')
}
}
}).catch(err => {
console.error('接口请求失败:', err)
this.$message.error('接口错误')
})
},
handleMenuClick(childMenu, index) {
this.leftMenuIndex = index
this.tabList = []
if (childMenu.queryMenuTopics && childMenu.queryMenuTopics.length > 0) {
childMenu.queryMenuTopics.forEach(menuTopic => {
if (menuTopic.queryTopic) {
this.tabList.push(menuTopic.queryTopic)
this.$store.commit('column/setColumnData', {
tabList: this.tabList,
libcode: this.libcode,
selectMenuIndex: this.selectMenuIndex
})
this.selectMenuChange(this.tabList[0], 0)
}
})
}
},
selectMenuChange(item, index) {
this.selectMenuIndex = index
localStorage.setItem('selectIndex', index)
this.$store.commit('column/setSelectMenuIndex', index)
const targetRoute = {
name: 'ColumnListMix',
query: this.$route.query
this.$store.commit('column/updatePagination', { currentPage: 0 })
// ColumnListMix
const listMixComponent = this.$children.find(child => child.$options.name === 'ColumnListMix')
if (listMixComponent) {
listMixComponent.infoList = []
listMixComponent.unbindScrollListener()
listMixComponent.getInitQueryTopicContext(item)
}
//
const targetRoute = { name: 'ColumnListMix', query: this.$route.query }
const currentRoute = this.$router.currentRoute
if (currentRoute.name === targetRoute.name &&
JSON.stringify(currentRoute.query) === JSON.stringify(targetRoute.query)) {
if (this.$children.length > 0) {
this.$children[0].getInitQueryTopicContext(item)
}
return
if (currentRoute.name !== targetRoute.name ||
JSON.stringify(currentRoute.query) !== JSON.stringify(targetRoute.query)) {
this.$router.push(targetRoute)
}
this.$router.push(targetRoute).then(() => {
if (this.$children.length > 0) {
this.$children[0].getInitQueryTopicContext(item)
}
})
}
}
}
@ -87,4 +134,39 @@ export default {
<style lang="scss" scoped>
@import "~@/assets/styles/index.scss";
.menu-tab-list{
display: flex;
justify-content: flex-start;
font-size: 26px;
background-color: #fff;
// padding: 10px 0;
border-bottom: 2px solid #D9D9D9;
li{
padding: 10px 20px;
margin-right: 20px;
&.active{
position: relative;
color:#5394F1;
&::before{
position: absolute;
bottom: -2px;
left: 0;
content: '';
width: 100%;
height: 2px;
background-color: #5394F1;
}
}
}
}
//
.introduction-main {
display: flex;
width: 100%;
.introduction-info {
flex: 1;
padding: 20px;
}
}
</style>

234
src/views/columnListMix.vue

@ -1,27 +1,36 @@
<template>
<div style="height:calc(100%);">
<div v-if="detailData && tabList[selectMenuIndex].type ===1" class="new-detial-info">
<div v-if="detailData && tabList[selectMenuIndex] && tabList[selectMenuIndex].type ===1" :class="isMenu ? 'new-detial-info new-menu-detial-info' :'new-detial-info'">
<h2 class="detail-title">{{ detailData.overTitle }}</h2>
<div class="detail-date">发布时间{{ detailData.create_time }}</div>
<div class="detail-content" v-html="detailData.introHtml" />
</div>
<ul v-else-if="infoList.length !== 0 && (tabList[selectMenuIndex].type ===2 || tabList[selectMenuIndex]===3)" class="activity-list">
<ul v-else-if="infoList.length !== 0 && tabList[selectMenuIndex] && [2].includes(tabList[selectMenuIndex]?.type)" class="activity-list scroll-container" :style="isMenu ? 'height: calc(100vh - 200px)':''">
<li v-for="(item,index) in infoList" :key="index" @click="toDetail(item)">
<div class="activity-title">{{ item.overTitle?item.overTitle:'' }}</div>
<span class="date">{{ item.create_time }}</span>
</li>
<li v-if="loading" class="loading-tip">加载中...</li>
</ul>
<ul v-else-if="infoList.length !== 0 && tabList[selectMenuIndex] && [3].includes(tabList[selectMenuIndex]?.type)" class="activity-list imgTxt-list scroll-container" :style="isMenu ? 'height: calc(100vh - 200px)':''">
<li v-for="(item,index) in infoList" :key="index" @click="toDetail(item)">
<img :src="item.imgPath" alt="">
<div class="activity-title">{{ item.overTitle?item.overTitle:'' }}</div>
<span class="date">{{ item.create_time }}</span>
</li>
<li v-if="loading" class="loading-tip">加载中...</li>
</ul>
<Waterfall
v-else-if="infoList.length !== 0 && tabList[selectMenuIndex].type ===4"
v-else-if="infoList.length !== 0 && tabList[selectMenuIndex] && tabList[selectMenuIndex].type ===4"
:list="infoList"
:columns="columns"
:loading="loading"
:placeholder="placeholderImg"
:total-items="totalItems"
:style="isMenu ? 'height: 720px':''"
@scroll-end="loadMoreData"
/>
<div v-else style="height:calc(100%);display: flex; flex-direction: column; justify-content:center ; align-items: center;">
<div v-if="!detailData || infoList.length === 0" style="height:calc(100%);display: flex; flex-direction: column; justify-content:center ; align-items: center;">
<img style="display: block;" src="~@/assets/images/empty.png">
<p style="font-size: 30px;">暂无相关数据</p>
</div>
@ -30,7 +39,7 @@
<script>
import Waterfall from './module/waterfall.vue'
import { mapState } from 'vuex'
import { mapState, mapMutations } from 'vuex'
import { FetchInitQueryTopicContext } from '@/api/inquiryMachine'
export default {
name: 'ColumnListMix',
@ -42,21 +51,30 @@ export default {
detailData: {},
infoList: [],
columns: 2,
dataList: [],
loading: false,
currentPage: 0,
pageSize: 10,
totalItems: 0,
placeholderImg: require('@/assets/images/default-img.png')
// currentPage: 0,
// pageSize: 10,
// totalItems: 0,
placeholderImg: require('@/assets/images/default-img.png'),
lastRouteQuery: '',
isMenu: false
}
},
computed: {
...mapState('column', ['tabList', 'libcode', 'selectMenuIndex'])
...mapState('column', ['tabList', 'libcode', 'selectMenuIndex', 'pagination']),
currentPage() { return this.pagination.currentPage },
pageSize() { return this.pagination.pageSize },
totalItems() { return this.pagination.totalItems }
},
watch: {
$route: {
handler() {
console.log('当前Vuex中的tabList:', this.$store.state.column.tabList)
//
if (this.lastRouteQuery === JSON.stringify(this.$route.query)) {
return
}
this.lastRouteQuery = JSON.stringify(this.$route.query)
if (this.tabList.length > 0) {
this.getInitQueryTopicContext(this.tabList[this.selectMenuIndex])
} else {
@ -73,62 +91,167 @@ export default {
immediate: true
}
},
mounted() {
this.$nextTick(() => {
console.log('ColumnListMix mounted', this.$route.query)
console.log('ColumnListMix mounted', this.$route.query.menuType)
this.isMenu = Number(this.$route.query.menuType) === 1
})
},
beforeDestroy() {
this.unbindScrollListener()
},
methods: {
...mapMutations('column', ['updatePagination']),
handleTypeChange() {
const currentType = this.tabList[this.selectMenuIndex]?.type
this.unbindScrollListener()
if ([2, 3].includes(currentType) && this.infoList.length > 0) {
this.$nextTick(() => {
this.bindScrollListener()
})
}
},
getInitQueryTopicContext(result) {
console.log(result.type)
//
if (this.loading) {
console.log('正在加载中,阻止重复请求')
return Promise.resolve() // Promise便
}
//
if (!result || !result.id) {
console.error('缺少必要参数(result.id),终止请求')
return Promise.resolve()
}
this.loading = true //
const params = {
'page': this.currentPage,
'size': this.pageSize,
'libcode': this.libcode,
'topicId': result.id,
'topicType': result.type
page: this.currentPage,
size: this.pageSize,
libcode: this.libcode,
topicId: result.id,
topicType: result.type
}
FetchInitQueryTopicContext(params).then(res => {
if (res.totalElements) {
this.totalItems = res.totalElements
return FetchInitQueryTopicContext(params).then(res => { // Promise
//
if (res.totalElements !== undefined) {
this.updatePagination({ totalItems: res.totalElements })
}
const linkSrc = process.env.NODE_ENV === 'production'
? window.g.ApiUrl
: process.env.VUE_APP_BASE_API
if (res && res.content.length > 0) {
if (result.type === 4) {
const formattedData = res.content.map(item => ({
id: item.id || `item-${Date.now()}-${Math.random()}`,
type: 'image',
title: item.overTitle || '无标题',
image: item.imgUrl ? `${linkSrc}/api/fileRelevant/getImg?imgType=2&imgId=${item.imgUrl}` : this.placeholderImg,
linkUrl: item.linkUrl || '#'
}))
this.infoList = [...this.infoList, ...formattedData]
} else if (result.type === 1) {
this.detailData = res.content[0]
} else {
this.infoList = res.content
}
//
const isFirstPage = this.currentPage === 0
if (isFirstPage) {
this.infoList = []
this.detailData = {} //
}
//
const linkSrc = process.env.NODE_ENV === 'production' ? window.g.ApiUrl : process.env.VUE_APP_BASE_API
if ([2, 3].includes(result.type) && res.content.length > 0) {
const newItems = res.content.map(item => ({
...item,
imgPath: item.imgUrl ? `${linkSrc}/api/fileRelevant/getImg?imgType=2&imgId=${item.imgUrl}` : null
}))
this.infoList = isFirstPage ? newItems : [...this.infoList, ...newItems]
} else if (result.type === 1) {
this.detailData = res.content[0] || {}
} else if (result.type === 4) {
const formattedData = res.content.map(item => ({
id: item.id || `item-${Date.now()}-${Math.random()}`,
type: 'image',
title: item.overTitle || '无标题',
image: item.imgUrl ? `${linkSrc}/api/fileRelevant/getImg?imgType=2&imgId=${item.imgUrl}` : this.placeholderImg,
linkUrl: item.linkUrl || '#'
}))
this.infoList = isFirstPage ? formattedData : [...this.infoList, ...formattedData]
} else {
this.infoList = []
}
}).catch(() => {
this.$message.error('接口错误')
//
console.log('当前分页状态:', {
totalItems: this.totalItems,
infoListLength: this.infoList.length,
hasMore: this.infoList.length < this.totalItems,
currentPage: this.currentPage
})
//
if ([2, 3].includes(result.type) && this.infoList.length > 0) {
this.$nextTick(() => {
this.unbindScrollListener() //
this.bindScrollListener() //
})
}
}).catch(err => {
console.error('请求失败:', err)
this.$message.error('数据加载失败')
}).finally(() => {
this.loading = false //
})
},
bindScrollListener() {
const tryFindContainer = () => {
this.scrollContainer = this.$el.querySelector('.activity-list.scroll-container')
if (this.scrollContainer) {
this.scrollHandler = () => this.handleScroll()
this.scrollContainer.addEventListener('scroll', this.scrollHandler)
// console.log('', this.scrollContainer)
} else {
if (!this.retryCount) this.retryCount = 0
if (this.retryCount < 3) {
this.retryCount++
setTimeout(tryFindContainer, 100)
// console.warn(`${this.retryCount}`)
} else {
// console.error('DOM')
this.retryCount = 0 //
}
}
}
this.$nextTick(tryFindContainer)
},
unbindScrollListener() {
if (this.scrollContainer && this.scrollHandler) {
this.scrollContainer.removeEventListener('scroll', this.scrollHandler)
this.scrollContainer = null
this.scrollHandler = null
}
},
handleScroll() {
const container = this.scrollContainer
if (!container || this.loading) return
const isBottom = container.scrollTop + container.clientHeight + 20 >= container.scrollHeight
console.log('滚动到底部:', isBottom)
const hasMoreData = this.infoList.length < this.totalItems
if (isBottom && hasMoreData) {
this.loadMoreData()
}
},
loadMoreData() {
if (this.dataList.length >= this.totalItems) {
if (this.loading || this.infoList.length >= this.totalItems) {
console.log('无更多数据或正在加载,阻止请求')
return
}
if (this.loading) return
this.currentPage++
const nextPage = this.currentPage + 1
this.updatePagination({ currentPage: nextPage })
this.getInitQueryTopicContext(this.tabList[this.selectMenuIndex])
},
isAllDataLoaded() {
if (this.totalItems > 0) {
return this.dataList.length >= this.totalItems
return this.infoList.length >= this.totalItems
}
return this.currentPage > 0 && this.dataList.length % this.pageSize !== 0
return this.currentPage > 0 && this.infoList.length % this.pageSize !== 0
},
toDetail(item) {
// itemId: item.id
@ -146,6 +269,19 @@ export default {
<style lang="scss" scoped>
@import "~@/assets/styles/index.scss";
.scroll-container {
height: calc(100vh - 140px);
overflow-y: auto;
// padding-bottom: 20px;
}
.loading-tip {
text-align: center;
line-height: 40px;
color: #999;
font-size: 14px;
}
.detail-title{
font-size: 32px;
font-family: Source Han Sans CN-Regular, Source Han Sans CN;

4
src/views/columnListMixDetail.vue

@ -63,6 +63,10 @@ export default {
<style lang="scss" scoped>
@import "~@/assets/styles/index.scss";
.detail-content{
height: calc(100% - 60px);
overflow-y: scroll;
}
.detail-info{
.detail-title{
font-size: 32px;

7
src/views/imgTxtDetail.vue

@ -55,10 +55,5 @@ export default {
<style lang="scss" scoped>
@import "~@/assets/styles/index.scss";
.new-detial-info {
background: #ffffff;
width: 100%;
padding: 20px;
overflow-y: auto;
}
</style>

6
src/views/index.vue

@ -58,8 +58,8 @@ export default {
if (res.queryMenu.type === 1) {
//
this.$router.push({
path: '/menu',
query: { 'menuId': res.queryMenu.id }
path: '/column',
query: { 'menuId': res.queryMenu.id, 'menuType': res.queryMenu.type }
})
} else if (res.queryMenu.type === 2 && res.queryTopicList.length === 1 && res.queryTopicList[0].type === 1) {
//
@ -69,7 +69,7 @@ export default {
query: { 'menuId': res.queryMenu.id }
})
} else if (res.queryMenu.type === 3 && res.queryTopicList.length > 1) {
// columnListMix
//
this.$router.push({
path: '/column',
query: { 'menuId': res.queryMenu.id }

174
src/views/menu.vue

@ -1,174 +0,0 @@
<template>
<!-- 活动咨询 -->
<div class="content-main introduction-main">
<div class="nav-menu">
<ul>
<li
v-for="(item,index) in tabList"
:key="index"
:class="{ 'is-active': selectMenuIndex === index }"
@click="selectMenuChange(item, index)"
>
{{ item.title }}
</li>
</ul>
</div>
<div class="introduction-info">
<ul v-if="rightColumnTab.length !== 0" class="menu-tab-list">
<li
v-for="(item,index) in rightColumnTab"
:key="item.id"
:class="{ 'active': columeIndex === index }"
@click="handleColumnClick(item, index)"
>
{{ item.title }}
</li>
</ul>
<div style="height: calc(100% - 60px);">
<ul v-if="infoList.length !== 0" class="activity-list">
<li v-for="item in infoList" :key="item.id" @click="toDetail(item)">
<div class="activity-title">{{ item.overTitle?item.overTitle:'' }}</div>
<span class="date">{{ item.create_time }}</span>
</li>
</ul>
<div v-else style="height:calc(100%);display: flex; flex-direction: column; justify-content:center ; align-items: center;">
<img style="display: block;" src="~@/assets/images/empty.png">
<p style="font-size: 30px;">暂无相关数据</p>
</div>
</div>
</div>
</div>
</template>
<script>
import { FetchQueryTopicDetails, FetchInitQueryTopicContext } from '@/api/inquiryMachine'
export default {
name: 'ActivityFeed',
data() {
return {
libcode: '',
tabList: [],
selectMenuIndex: 0,
rightColumnTab: [],
columeIndex: 0,
infoList: []
}
},
created() {
this.getQueryTopicDetails()
},
methods: {
getQueryTopicDetails() {
const params = { 'id': this.$route.query.menuId }
FetchQueryTopicDetails(params).then(res => {
console.log('接口返回数据:', res)
if (res && res.queryMenu) {
this.tabList = res.queryMenu.children
this.libcode = res.queryMenu.libcode
this.rightColumnTab = []
this.tabList.forEach(childMenu => {
if (childMenu.queryMenuTopics && childMenu.queryMenuTopics.length > 0) {
childMenu.queryMenuTopics.forEach(menuTopic => {
if (menuTopic.queryTopic) {
this.rightColumnTab.push(menuTopic.queryTopic)
}
})
}
})
if (this.rightColumnTab.length > 0) {
this.columeIndex = 0 //
const defaultTopic = this.rightColumnTab[0] // queryTopic
this.getInitQueryTopicContext(defaultTopic) // topic
}
} else {
this.tabList = []
this.rightColumnTab = []
this.infoList = []
}
}).catch(err => {
console.error('接口请求失败:', err)
this.$message.error('接口错误')
this.rightColumnTab = []
this.infoList = []
})
},
getInitQueryTopicContext(currentTopic) {
const params = {
'page': 0,
'size': 10,
'libcode': this.libcode,
'topicId': currentTopic.id, // queryTopicidresult.id
'topicType': currentTopic.type // queryTopictyperesult.type
}
FetchInitQueryTopicContext(params).then(res => {
if (res && res.content.length > 0) {
this.infoList = res.content
} else {
this.infoList = [] //
}
}).catch(() => {
this.$message.error('接口错误')
this.infoList = []
})
},
handleColumnClick(currentTopic, index) {
this.columeIndex = index //
this.getInitQueryTopicContext(currentTopic) // topic
},
selectMenuChange(childMenu, index) {
this.selectMenuIndex = index
this.rightColumnTab = []
if (childMenu.queryMenuTopics && childMenu.queryMenuTopics.length > 0) {
childMenu.queryMenuTopics.forEach(menuTopic => {
if (menuTopic.queryTopic) {
this.rightColumnTab.push(menuTopic.queryTopic)
}
})
if (this.rightColumnTab.length > 0) {
this.columeIndex = 0
this.getInitQueryTopicContext(this.rightColumnTab[0])
} else {
this.infoList = []
}
} else {
this.rightColumnTab = []
this.infoList = []
}
},
toDetail(item) {
this.$router.push('/ActivityDetail')
localStorage.setItem('selectIndex', JSON.stringify(this.selectMenuIndex))
localStorage.setItem('activityDetail', JSON.stringify(item))
}
}
}
</script>
<style lang="scss" scoped>
@import "~@/assets/styles/index.scss";
.menu-tab-list{
display: flex;
justify-content: flex-start;
font-size: 26px;
// padding: 10px 0;
border-bottom: 2px solid #D9D9D9;
li{
padding: 10px 20px;
margin-right: 20px;
&.active{
position: relative;
color:#5394F1;
&::before{
position: absolute;
bottom: -2px;
left: 0;
content: '';
width: 100%;
height: 2px;
background-color: #5394F1;
}
}
}
}
</style>

2
src/views/module/waterfall.vue

@ -359,7 +359,7 @@ export default {
.waterfall-container {
position: relative;
width: calc(100%);
height: 800px;
height: 780px;
overflow: hidden;
overflow-y: auto;
}

1
src/views/waterfallFlow.vue

@ -22,7 +22,6 @@
</div>
</div>
<!-- Swiper导航按钮 -->
<div class="swiper-button-prev" />
<div class="swiper-button-next" />
</div>

Loading…
Cancel
Save