|
@@ -7,6 +7,7 @@ import ETAForumChart from './ETAForumChart.vue'
|
|
|
import StatisticAnalysis from './StatisticAnalysis.vue'
|
|
|
import PriceChart from './PriceChart.vue'
|
|
|
import { showToast } from 'vant'
|
|
|
+import {apiMenuList} from '@/api/user'
|
|
|
import { vInfiniteScroll } from '@vueuse/components'
|
|
|
import { useNoAuth } from '@/hooks/useNoAuth'
|
|
|
|
|
@@ -15,6 +16,8 @@ const emits=defineEmits(['update'])
|
|
|
const searchVal=ref('')
|
|
|
const onlyMe=ref(false)
|
|
|
const activeType=ref('')
|
|
|
+const typeOpts=ref([])
|
|
|
+const isStatisticalAnalysis=ref(false) // 是否显示统计分析
|
|
|
|
|
|
const listState=reactive({
|
|
|
page:1,
|
|
@@ -90,12 +93,41 @@ function handleSelectChart(val){
|
|
|
emits('update',val)
|
|
|
}
|
|
|
|
|
|
+
|
|
|
+async function initTypeOpts(){
|
|
|
+ const res=await apiMenuList()
|
|
|
+ if(res.Ret===200){
|
|
|
+ const menuData=res.Data.List||[]
|
|
|
+ let pathArr=[]
|
|
|
+ menuData.forEach(item=>{
|
|
|
+ if(item.children){
|
|
|
+ item.children.forEach(_item=>{
|
|
|
+ pathArr.push(_item.path)
|
|
|
+ })
|
|
|
+ }else{
|
|
|
+ pathArr.push(item.path)
|
|
|
+ }
|
|
|
+ })
|
|
|
+ typeOpts.value = pathArr
|
|
|
+ const chartPathArr=[
|
|
|
+ 'chartrelevance',
|
|
|
+ 'fittingEquationList',
|
|
|
+ 'statisticFeatureList',
|
|
|
+ 'crossVarietyChartList',
|
|
|
+ 'rangeAnalysis'
|
|
|
+ ]
|
|
|
+ if(chartPathArr.some(item=>pathArr.includes(item))){
|
|
|
+ isStatisticalAnalysis.value=true
|
|
|
+ }
|
|
|
+ }
|
|
|
+}
|
|
|
+initTypeOpts()
|
|
|
</script>
|
|
|
|
|
|
<template>
|
|
|
<div class="ETA-chart-wrap">
|
|
|
<van-tabs v-model:active="activeType">
|
|
|
- <van-tab title="图库">
|
|
|
+ <van-tab title="图库" v-if="typeOpts.includes('chartsetting')">
|
|
|
<div class="sticky-box">
|
|
|
<van-search v-model="searchVal" shape="round" placeholder="请输入图表名称" @search="handleRefreshList" @clear="handleRefreshList" />
|
|
|
<van-checkbox v-model="onlyMe" @change="handleRefreshList">只看我的</van-checkbox>
|
|
@@ -126,16 +158,16 @@ function handleSelectChart(val){
|
|
|
</ul>
|
|
|
</div>
|
|
|
</van-tab>
|
|
|
- <van-tab title="我的图库">
|
|
|
+ <van-tab title="我的图库" v-if="typeOpts.includes('mychart')">
|
|
|
<MyETAChart @update="handleSelectChart"/>
|
|
|
</van-tab>
|
|
|
- <van-tab title="ETA社区图库">
|
|
|
+ <van-tab title="ETA社区图库" v-if="typeOpts.includes('etaForum')">
|
|
|
<ETAForumChart @update="handleSelectChart"/>
|
|
|
</van-tab>
|
|
|
- <van-tab title="统计分析">
|
|
|
+ <van-tab title="统计分析" v-if="isStatisticalAnalysis">
|
|
|
<StatisticAnalysis @update="handleSelectChart"/>
|
|
|
</van-tab>
|
|
|
- <van-tab title="商品价格曲线">
|
|
|
+ <van-tab title="商品价格曲线" v-if="typeOpts.includes('commordityChartBase')">
|
|
|
<PriceChart @update="handleSelectChart"/>
|
|
|
</van-tab>
|
|
|
</van-tabs>
|