yujinwen 4 روز پیش
والد
کامیت
8c2b1fb3d7

+ 21 - 0
src/api/etaForum.js

@@ -0,0 +1,21 @@
+// eta社区模块
+import { get,post } from "./index";
+
+export default{
+  //用户收藏列表的分类数据
+  myClassifyList:params=>{
+    return get('/eta_forum/collect/chart_classify',{})
+  },
+  //获取用户收藏的图表
+  getChartListForCollect:params=>{
+    return get('/eta_forum/collect/chart',params)
+  },
+  // 获取社区图表详情
+  getChartDetail:params=>{
+    return get('/eta_forum/chart/from_unique_code',params)
+  },
+  // 获取用户在ETA社区中有权限的图表
+  getChartList:params=>{
+    return get('/eta_forum/chart_list',params)
+  }
+}

+ 8 - 6
src/views/myETA/ChartDetail.vue

@@ -11,6 +11,7 @@ import apiMyETAChart from '@/api/myETA'
 import apiDataEDB from '@/api/dataEDB'
 import apiSheet from '@/api/sheet'
 import apiIntervalAnalysis from '@/api/intervalAnalysis'
+import apiETAForum from '@/api/etaForum'
 import { useRoute, useRouter } from 'vue-router'
 import {useChartRender} from '@/hooks/chart/render'
 import {yearSelectOpt,sameOptionType} from '@/hooks/chart/config'
@@ -52,6 +53,7 @@ const {options,axisLimitState,chartRender,setLimitData,isUseSelfLimit}=useChartR
 const route=useRoute()
 const router=useRouter()
 let chartCode=route.query.code
+const isETAForumChart=ref(route.query.isETAForumChart=='true'?true:false)
 let CHARTINS=null//图表实例
 
 // 获取当前图表所在分类下的所有图表数据 用于上一张下一张切换
@@ -99,7 +101,7 @@ let chartInfoData=null
 let chartInfo=ref(null)
 let edbList=ref([])//指标数据
 async function getChartInfo(){
-    const res=await apiETAChart.chartInfoByCode({UniqueCode:chartCode})
+    const res=isETAForumChart.value?await apiETAForum.getChartDetail({UniqueCode:chartCode}) : await apiETAChart.chartInfoByCode({UniqueCode:chartCode})
     if(res.Ret!==200) return
     chartInfoData=res.Data
 
@@ -782,7 +784,7 @@ const showSaveToMaterial=ref(false)
             <!-- 一般曲线图选择时间区间或者季节图选择日期 -->
             <div 
                 class="select-time-box" 
-                v-if="(sameOptionType.includes(chartInfo.ChartType)&& chartInfo.Source===1)||chartInfo.ChartType===2" 
+                v-if="!isETAForumChart&&((sameOptionType.includes(chartInfo.ChartType)&& chartInfo.Source===1)||chartInfo.ChartType===2)" 
                 @click="openDateSelect"
             >
                 <img class="left-icon" src="@/assets/imgs/icon_calendar.png" alt="">
@@ -791,7 +793,7 @@ const showSaveToMaterial=ref(false)
             </div>
 
             <!-- pad端时间和操作按钮模块 -->
-            <div class="pad-time-action-wrap">
+            <div class="pad-time-action-wrap" v-if="!isETAForumChart">
                 <div class="left-time-box" >
                     <template v-if="sameOptionType.includes(chartInfo.ChartType)&& chartInfo.Source===1">
                         <span :class="['item',chartState.yearVal==''?'active':'']" @click="handleYearChange({value:''})">全部</span>
@@ -855,7 +857,7 @@ const showSaveToMaterial=ref(false)
             </div>
 
             <!-- 一般曲线图选择时间区间 -->
-            <div class="select-year-box" v-if="sameOptionType.includes(chartInfo.ChartType)&& chartInfo.Source===1">
+            <div class="select-year-box" v-if="!isETAForumChart&&sameOptionType.includes(chartInfo.ChartType)&& chartInfo.Source===1">
                 <span :class="['item',chartState.yearVal==''?'active':'']" @click="handleYearChange({value:''})">全部</span>
                 <span 
                     :class="['item',chartState.yearVal==item.value?'active':'']"
@@ -865,7 +867,7 @@ const showSaveToMaterial=ref(false)
                 >{{item.name}}</span>
             </div>
             <!-- 季节图切换公/农历 -->
-            <div class="calendar-type-box" v-if="chartInfo.ChartType === 2">
+            <div class="calendar-type-box" v-if="!isETAForumChart&&chartInfo.ChartType === 2">
                 <span 
                     :class="chartState.calendarType=='公历'?'active':''"
                     @click="handleSeasonTypeChange('公历')"
@@ -901,7 +903,7 @@ const showSaveToMaterial=ref(false)
                     <img class="icon" src="@/assets/imgs/myETA/icon_limit.png" alt="">
                     <div>上下限</div>
                 </div>
-                <div class="item" @click="showMoreAction=true" v-if="isMoreActionShow||$route.query.from==='edbRelationChart'">
+                <div class="item" @click="showMoreAction=true" v-if="!isETAForumChart&&(isMoreActionShow||$route.query.from==='edbRelationChart')">
                     <img class="icon" src="@/assets/imgs/myETA/icon_menu.png" alt="">
                     <div>更多</div>
                 </div>

+ 61 - 10
src/views/myETA/Index.vue

@@ -3,6 +3,7 @@ import {ref,reactive,computed} from 'vue'
 import { useRouter } from 'vue-router'
 import {useClassify} from './hooks/useClassify'
 import apiMyETA  from '@/api/myETA'
+import apiETAForum from '@/api/etaForum'
 import { showConfirmDialog, showToast } from 'vant';
 import { useWindowSize } from '@vueuse/core'
 import draggable from 'vuedraggable'
@@ -21,6 +22,7 @@ const {
     classifyState,
     getMyClassify,
     getPubClassify,
+    getETAForumClassify,
     classifyTypeChange,
     handleAddClassify,
     handleConfirmEditClassify,
@@ -33,7 +35,9 @@ const {
 }=useClassify()
 
 const curChartClassifyList=computed(()=>{
-    return classifyState.classifyTypeAct==1?classifyState.myClassifyList:classifyState.pubClassifyList
+    if(classifyState.classifyTypeAct==1) return classifyState.myClassifyList
+    if(classifyState.classifyTypeAct==2) return classifyState.pubClassifyList
+    if(classifyState.classifyTypeAct==3) return classifyState.forumClassifyList
 })
 //我的图库/公共图库opt:重命名、可见、复制、删除
 const isOptShow = computed(()=>{
@@ -66,6 +70,7 @@ function onClassifySortEnd(e){
 const showClassifyPop=ref(false)
 
 async function initPage(){
+    getETAForumClassify()
     getPubClassify()
     await getMyClassify()
     listState.cid=classifyState.myClassifyList[0]?.MyChartClassifyId
@@ -92,7 +97,11 @@ const listState = reactive({
     total:0,
 })
 async function getChartList(){
-    const res=await apiMyETA.myChartList({
+    const res=classifyState.classifyTypeAct==3?await apiETAForum.getChartListForCollect({
+        CollectClassifyIds:`${listState.cid}`,
+        PageSize:listState.pageSize,
+        CurrentIndex:listState.page,
+    }) : await apiMyETA.myChartList({
         CurrentIndex:listState.page,
         PageSize:listState.pageSize,
         MyChartClassifyId:listState.cid
@@ -107,7 +116,17 @@ async function getChartList(){
         
         listState.finished=res.Data.Paging.IsEnd
         const arr=res.Data.List||[]
-        listState.list=[...listState.list,...arr]
+        if(classifyState.classifyTypeAct==3){
+            arr.forEach(_item=>{
+                listState.list.push({
+                    ..._item,
+                    HaveOperaAuth:true
+                })
+            })
+        }else{
+            listState.list=[...listState.list,...arr]
+        }
+        
         listState.total=res.Data.Paging.Totals
     }
 }
@@ -118,7 +137,14 @@ function onLoad(){
 
 // 切换分类
 function handleSwitchClassify(item){
-    listState.ctype=classifyState.classifyTypeAct==1?'我的图库':'公共图库'
+    if(classifyState.classifyTypeAct==1){
+        listState.ctype='我的图库'
+    }else if(classifyState.classifyTypeAct==2){
+        listState.ctype='公共图库'
+    }else if(classifyState.classifyTypeAct==3){
+        listState.ctype='ETA社区图库'
+    }
+    
     listState.cid=item.MyChartClassifyId
     listState.cname=item.MyChartClassifyName
     listState.list=[]
@@ -180,7 +206,8 @@ function goDetail(item){
         query:{
             code:item.UniqueCode,
             cid:listState.cid,
-            iscommon:listState.ctype=='我的图库'?false:true
+            iscommon:listState.ctype=='我的图库'?false:true,
+            isETAForumChart:classifyState.classifyTypeAct==3?true:false
         }
     })
 }
@@ -226,7 +253,7 @@ async function goSearch(){
                     @click="goDetail(item)"
                 >
                     <div class="van-multi-ellipsis--l2 name">{{item.ChartName}}</div>
-                    <img class="img" :src="!item.HaveOperaAuth?useNoAuth().noAuthImg:item.ChartImage" alt="">   
+                    <img class="img" :src="([1,11].includes(item.Source)&&!item.HaveOperaAuth)?useNoAuth().noAuthImg:item.ChartImage" alt="">   
                     <div class="time">
                         <span>{{item.CreateTime.slice(0,10)}}</span>
                         <img v-if="listState.ctype==='我的图库'&&checkAuthBtn(myETABtn.myChart_move)" class="remove-box" @click.stop="handleRemoveChart(item,index)" src="@/assets/imgs/myETA/icon_remove2.png" alt="">
@@ -244,12 +271,20 @@ async function goSearch(){
     >
         <div class="classify-wrap">
             <div class="type-box">
-                <span
+                <van-tabs class="type-tab" :active="classifyState.classifyTypeAct" @click-tab="classifyTypeChange">
+                    <van-tab 
+                        :title="item.name" 
+                        :name="item.type" 
+                        v-for="item in classifyTypeOpt"
+                        :key="item.type"
+                    ></van-tab>
+                </van-tabs>
+                <!-- <span
                     :class="['item',item.type===classifyState.classifyTypeAct?'active':'']"
                     v-for="item in classifyTypeOpt" 
                     :key="item.id"
                     @click="classifyTypeChange(item)"
-                >{{item.name}}</span>
+                >{{item.name}}</span> -->
             </div>
             <draggable 
                 v-if="classifyState.classifyTypeAct==1"
@@ -281,6 +316,21 @@ async function goSearch(){
                     </li>
                 </template>
             </draggable>
+            <ul 
+                class="list-box"
+                v-else-if="classifyState.classifyTypeAct==3"
+            >
+                <li 
+                    class="select-text-disabled item" 
+                    v-for="element in curChartClassifyList" 
+                    :key="element.CollectClassifyId"
+                    @click="handleSwitchClassify(element)"
+                >
+                    <div :class="['van-ellipsis name',element.CollectClassifyId===listState.cid&&'active-name']">{{element.ClassifyName}}</div>
+                </li>
+            </ul>
+            
+
             <div class="public-classify-wrap" v-else>
                 <van-collapse class="classify-level" v-model="activeMenu" :border="false">
                     <van-collapse-item
@@ -480,8 +530,9 @@ async function goSearch(){
     display: flex;
     flex-direction: column;
     .type-box{
-        padding: $page-padding;
-        box-shadow: 0px 4px 8px rgba(0, 0, 0, 0.08);
+        // padding: $page-padding;
+        border-bottom: 1px solid #C6C6C6;
+        // box-shadow: 0px 4px 8px rgba(0, 0, 0, 0.08);
         .item{
             margin-right: 40px;
             font-size: 32px;

+ 27 - 1
src/views/myETA/hooks/useClassify.js

@@ -7,6 +7,7 @@ import {
     apiShareClassify,
     apiClassifyCopy
 } from '@/api/myETA.js'
+import apiETAForum from '@/api/etaForum'
 import {reactive} from 'vue'
 import { showToast,showDialog,Dialog } from 'vant';
 
@@ -17,6 +18,10 @@ export function useClassify(){
             name:"我的图库",
             type:1
         },
+        {
+            name:"ETA社区图库",
+            type:3
+        },
         {
             name:"公共图库",
             type:2
@@ -27,6 +32,7 @@ export function useClassify(){
         classifyTypeAct:1,//当前选中的类型
         myClassifyList:[],//我的图库分类
         pubClassifyList:[],//公共图库分类
+        forumClassifyList:[],//ETA社区图库分类
         classifyAct:0,//当前选中的分类id
 
         showEidtClassifyName:false,//显示新增/编辑分类弹窗
@@ -52,9 +58,28 @@ export function useClassify(){
         }
     }
 
+    // 获取ETA社区图库分类
+    const getETAForumClassify=async()=>{
+        const res=await apiETAForum.myClassifyList()
+        if(res.Ret===200){
+            const arr=res.Data.List||[]
+            classifyState.forumClassifyList=arr.map(item=>{
+                return {
+                    ...item,
+                    MyChartClassifyId:item.CollectClassifyId,
+                    MyChartClassifyName:item.ClassifyName
+                }
+            })
+            // 没有分类则去除eta社区分类模块
+            if(classifyState.forumClassifyList.length===0){
+                classifyTypeOpt.splice(1,1)
+            }
+        }
+    }
+
     // 切换图库分类类型
     const classifyTypeChange=(e)=>{
-        classifyState.classifyTypeAct=e.type
+        classifyState.classifyTypeAct=e.name
     }
 
     // 显示新增分类弹窗
@@ -153,6 +178,7 @@ export function useClassify(){
         classifyState,
         getMyClassify,
         getPubClassify,
+        getETAForumClassify,
         classifyTypeChange,
         handleAddClassify,
         handleConfirmEditClassify,

+ 6 - 1
src/views/ppt/components/ChartWrap.vue

@@ -1,6 +1,7 @@
 <script setup>
 import {computed,onMounted,ref} from 'vue'
 import apiChart from '@/api/chart.js'
+import apiETAForum from '@/api/etaForum'
 import {chartRender,useChartRender} from '@/hooks/chart/render'
 
 
@@ -24,7 +25,11 @@ const sourceFrom=ref(null)
 // 获取图表详情
 let chartIsDelete=ref(false)//图表是否被删除
 async function getChartInfo(){
-    const res=await apiChart.chartInfoByCode({UniqueCode:props.itemData.chartId,IsCache: true})
+    const isETAForumChart=props.itemData.chartId.startsWith('isETAForumChart_')
+
+    const res=isETAForumChart?await apiETAForum.getChartDetail({
+        UniqueCode:props.itemData.chartId.replace(/^isETAForumChart_/, '')
+    }) :await apiChart.chartInfoByCode({UniqueCode:props.itemData.chartId,IsCache: true})
     if(res.Ret===200){
         if(!res.Data.ChartInfo){
             chartIsDelete.value=true

+ 3 - 2
src/views/report/AddReport.vue

@@ -82,7 +82,7 @@ async function handleReportBaseInfoChange(e){
 // 报告插入数据弹窗
 const showReportInsertPop=ref(false)
 /**
- * list:[UniqueCode] 图表code
+ * list:[UniqueCode] 图表code 如果是以 isETAForumChart_ 开头则说明是社区图表
  * type:iframe/img 插入的为iframe或者图片
  * chartType: chart-图表,sheet-表格
  */
@@ -98,8 +98,9 @@ function handleInsert({list,type,chartType}){
             // link=import.meta.env.MODE==='production'?'https://chartlib.hzinsights.com/chartshow':'https://charttest.hzinsights.com/chartshow'
             link=link+'/chartshow'
             list.forEach(item => {
+                const isETAForumChart=item.startsWith('isETAForumChart_')?true:false
                 reportContentEditorIns.html.insert(`<p style='text-align:left; margin-top:10px;'>
-						<iframe src='${link}?code=${item}&fromPage=' width='100%' height='350' style='border-width:0px; min-height:350px;'></iframe>
+						<iframe src='${link}?code=${isETAForumChart?item.replace(/^isETAForumChart_/, ''):item}&fromPage=&isETAForumChart=${isETAForumChart}' width='100%' height='350' style='border-width:0px; min-height:350px;'></iframe>
 					</p>`)
             });
         }else if(chartType==='sheet'){

+ 2 - 1
src/views/report/EditReport.vue

@@ -176,8 +176,9 @@ function handleInsert({list,type,chartType}){
             // link=import.meta.env.MODE==='production'?'https://chartlib.hzinsights.com/chartshow':'https://charttest.hzinsights.com/chartshow'
             link=link+'/chartshow'
             list.forEach(item => {
+                const isETAForumChart=item.startsWith('isETAForumChart_')?true:false
                 reportContentEditorIns.html.insert(`<p style='text-align:left; margin-top:10px;'>
-						<iframe src='${link}?code=${item}&fromPage=' width='100%' height='350' style='border-width:0px; min-height:350px;'></iframe>
+						<iframe src='${link}?code=${isETAForumChart?item.replace(/^isETAForumChart_/, ''):item}&fromPage=&isETAForumChart=${isETAForumChart}' width='100%' height='350' style='border-width:0px; min-height:350px;'></iframe>
 					</p>`,false)
             });
         }else if(chartType==='sheet'){

+ 204 - 0
src/views/report/components/reportInsert/ETAForumChart.vue

@@ -0,0 +1,204 @@
+<script setup>
+import {reactive, ref, watch} from 'vue'
+import apiETAForum from '@/api/etaForum'
+import { showToast } from 'vant'
+import { vInfiniteScroll } from '@vueuse/components'
+import { useNoAuth } from '@/hooks/useNoAuth'
+
+const emits=defineEmits(['update'])
+
+const searchVal=ref('')
+
+const listState=reactive({
+    page:1,
+    pageSize:20,
+    list:[],
+    finished:false,
+    loading:false
+})
+
+async function getChartList(){
+    const params={
+        Keyword:searchVal.value,
+        CurrentIndex:listState.page,
+        PageSize:listState.pageSize,
+    }
+    listState.loading=true
+    
+    let res = await apiETAForum.getChartList(params)
+    
+    listState.loading=false
+    if(res.Ret===200){
+        const arr=res.Data.ChartInfoList||[]
+        arr.forEach(item => {
+          listState.list.push({
+            ...item,
+            UniqueCode:`isETAForumChart_${item.UniqueCode}`,//在获取图表详情时通过前缀区分
+            HaveOperaAuth:true
+          })
+        });
+        listState.finished=res.Data?.Paging.IsEnd
+    }
+}
+getChartList()
+// 触底加载更多
+function onLoadMore(){
+    if(listState.finished||listState.loading||!listState.Keyword) return
+    listState.page++
+    getChartList()
+}
+
+function handleRefreshList(){
+    listState.list=[]
+    listState.page=1
+    listState.finished=false
+    selectChartList.value=[]
+    getChartList()
+}
+
+const selectChartList=ref([])
+function handleSelect(item){
+    const index=selectChartList.value.indexOf(item.UniqueCode)
+    if(index!==-1){
+        selectChartList.value.splice(index,1)
+    }else{
+        selectChartList.value.push(item.UniqueCode)
+    }
+    
+}
+
+watch(
+    ()=>selectChartList.value,
+    ()=>{
+        emits('update',selectChartList.value)
+    },
+    {
+        immediate:true
+    }
+)
+
+</script>
+
+<template>
+    <div class="ETA-chart-wrap">
+        <div class="sticky-box">
+            <van-search v-model="searchVal" shape="round" placeholder="请输入图表名称" @search="handleRefreshList" @clear="handleRefreshList" />
+        </div>
+        <div class="content-box">
+            <div v-if="listState.list.length==0&&listState.finished">
+                <img class="list-empty-img" src="https://hzstatic.hzinsights.com/static/ETA_mobile/empty_img.png" alt="">
+                <p style="text-align:center;color:#999999;font-size:12px">暂无图表</p>
+            </div>
+            
+            <ul class="chart-list" v-infinite-scroll="[onLoadMore, { 'distance' : 10 }]">
+                <li 
+                    :class="['chart-item',selectChartList.includes(item.UniqueCode)&&'active']" 
+                    v-for="item in listState.list" 
+                    :key="item.ChartInfoId"
+                    @click="handleSelect(item)"
+                >
+                    <div class="van-multi-ellipsis--l2 title">{{item.ChartName}}</div>
+                    <img :src="item.ChartImage" alt="">
+
+                    <svg v-if="selectChartList.includes(item.UniqueCode)" width="29" height="28" viewBox="0 0 29 28" fill="none" xmlns="http://www.w3.org/2000/svg">
+                        <path d="M14.5 28C22.232 28 28.5 21.732 28.5 14C28.5 6.26801 22.232 0 14.5 0C6.76801 0 0.5 6.26801 0.5 14C0.5 21.732 6.76801 28 14.5 28ZM7.5 14.413L8.913 13L12.5 16.586L20.085 9L21.5 10.415L12.5 19.414L7.5 14.413Z" fill="#0052D9"/>
+                    </svg>
+
+                </li>
+                <li class="chart-item" style="height:0;border:none;margin-bottom:0;padding:0"></li>
+                <li class="chart-item" style="height:0;border:none;margin-bottom:0;padding:0"></li>
+            </ul>
+        </div>
+    </div>
+</template>
+
+<style lang="scss" scoped>
+.ETA-chart-wrap{
+    height: 100%;
+    display: flex;
+    flex-direction: column;
+    .content-box{
+        overflow: hidden;
+        flex: 1;
+        padding: var(--van-padding-sm);
+        min-height: 300PX;
+    }
+    .chart-list{
+        height: 100%;
+        overflow-y: auto;
+        display: flex;
+        flex-wrap: wrap;
+        justify-content: space-between;
+        .chart-item{
+            width: 48%;
+            background: #FFFFFF;
+            border: 3px solid $border-color;
+            box-shadow: 0px 0px 12px rgba(0, 0, 0, 0.03);
+            border-radius: 4px;
+            margin-bottom: 30px;
+            overflow: hidden;
+            padding: 14px;
+            box-sizing: border-box;
+            position: relative;
+            max-height: 336px;
+            .title{
+                font-size: 28px;
+                min-height: 60px;
+            }
+            img{
+                width: 100%;
+            }
+        }
+        .active{
+            border-color: $theme-color;
+            svg{
+                width: 28px;
+                height: 28px;
+                position: absolute;
+                right: 22px;
+                bottom: 22px;
+            }
+        }
+    }
+}
+.sticky-box{
+    flex-shrink: 0;
+    // position: sticky;
+    // top: 0;
+    // z-index: 10;
+    background-color: #fff;
+    .van-tabs{
+        border-bottom: 1px solid $border-color;
+    }
+    .van-checkbox{
+        margin: var(--van-padding-sm);
+    }
+}
+@media screen and (min-width:$media-width){
+    .ETA-chart-wrap{
+        .chart-list{
+            
+            .chart-item{
+                width: 260px;
+                border-width: 1px;
+                border-radius: 2px;
+                margin-bottom: 15px;
+                padding: 7px;
+                max-height: 220px;
+                .title{
+                    font-size: 14px;
+                    min-height: 30px;
+                }
+            }
+            .active{
+                svg{
+                    width: 14px;
+                    height: 14px;
+                    right: 11px;
+                    bottom: 11px;
+                }
+            }
+        }
+    }
+}
+</style>

+ 8 - 2
src/views/report/components/reportInsert/Index.vue

@@ -10,6 +10,7 @@ import MaterialImg from './reportMaterial/Index.vue'
 import StatisticAnalysis from './StatisticAnalysis.vue'
 import PriceChart from './PriceChart.vue'
 import BalanceSheet from './BalanceSheet/Index.vue'
+import ETAForumChart from './ETAForumChart.vue'
 
 const emits=defineEmits(['insert'])
 
@@ -30,6 +31,11 @@ const typeOpt=ref([
         label:'我的图库',
         path:'mychart'
     },
+    {
+        value:'etaForum',
+        label:'ETA社区图库',
+        path:'mychart'
+    },
     {
         value:'表格插入',
         label:'表格',
@@ -92,7 +98,7 @@ function handleSelectChart(data){
 }
 
 function handleConfirmInsert(){
-    if(['图表插入','批量插入','统计分析','商品价格曲线'].includes(activeType.value)){
+    if(['图表插入','批量插入','统计分析','商品价格曲线','etaForum'].includes(activeType.value)){
         console.log(list.value)
         let filterList = list.value;
 
@@ -127,7 +133,7 @@ function handleConfirmInsert(){
             <StatisticAnalysis @update="handleSelectChart" v-if="activeType==='统计分析'"/>
             <PriceChart @update="handleSelectChart" v-if="activeType==='商品价格曲线'"/>
             <BalanceSheet @update="handleSelectChart" @insert="handleConfirmInsert" v-if="activeType==='平衡表'"/>
-            
+            <ETAForumChart @update="handleSelectChart" v-if="activeType==='etaForum'"/>
         </div>
         <div class="bot-btn" v-if="activeType!=='平衡表'">
             <van-button type="primary" block @click="handleConfirmInsert" :disabled="list.length===0">插入</van-button>

+ 59 - 10
src/views/report/components/reportInsert/MyETAChart.vue

@@ -1,11 +1,13 @@
 <script setup>
 import {reactive,ref,watch} from 'vue'
 import apiMyETAChart from '@/api/myETA'
+import apiETAForum from '@/api/etaForum'
 import { vInfiniteScroll } from '@vueuse/components'
 import { useNoAuth } from '@/hooks/useNoAuth'
 
 const emits=defineEmits(['update'])
 
+const classifyType=ref('myETA')
 // 获取我的图库中分类
 let showClassify=ref(false)
 let classifyList=[]
@@ -13,9 +15,20 @@ let activeClassify=ref('')
 let activeClassifyName=ref('')
 let curClassifyList=ref([])
 async function getClassifyList(){
-    const res=await apiMyETAChart.myClassifyList()
+    const res=classifyType.value==='myETA'? await apiMyETAChart.myClassifyList():await apiETAForum.myClassifyList()
     if(res.Ret===200){
-        classifyList=res.Data?.List??[]
+        if(classifyType.value==='myETA'){
+            classifyList=res.Data?.List||[]
+        }else{
+            const arr=res.Data.List||[]
+            classifyList=arr.map(item=>{
+                return {
+                    MyChartClassifyId:item.CollectClassifyId,
+                    MyChartClassifyName:item.ClassifyName
+                }
+            })
+        }
+        
         curClassifyList.value=classifyList
     }
 }
@@ -26,10 +39,22 @@ function handleRefreshList(){
     activeClassify=ref('')
     curClassifyList.value=classifyList.filter(item=>item.MyChartClassifyName.includes(searchVal.value))
 }
+// 切换分类类型
+function handleClassifyTypeChange(){
+    searchVal.value=''
+    activeClassify.value=''
+    activeClassifyName.value=''
+    curClassifyList.value=[]
+    classifyList=[]
+    getClassifyList()
+}
 
 function handleSave(){
     activeClassifyName.value=classifyList.filter(item=>item.MyChartClassifyId==activeClassify.value)[0]?.MyChartClassifyName
     showClassify.value=false
+    listState.page=1
+    listState.list=[]
+    listState.finished=false
     getChartList()
 }
 
@@ -41,18 +66,34 @@ const listState=reactive({
     loading:false
 })
 async function getChartList(){
-    const params={
+    listState.loading=true
+    let res=classifyType.value==='myETA'? await apiMyETAChart.myChartList({
         CurrentIndex:listState.page,
         PageSize:listState.pageSize,
         MyChartClassifyId:activeClassify.value
-    }
-    listState.loading=true
-    let res=await apiMyETAChart.myChartList(params)
+    }):await apiETAForum.getChartListForCollect({
+        CurrentIndex:listState.page,
+        PageSize:listState.pageSize,
+        CollectClassifyIds:`${activeClassify.value}`
+    })
     listState.loading=false
     if(res.Ret===200){
-        const arr=res.Data.List||[]
-        listState.list=[...listState.list,...arr]
-        listState.finished=res.Data?.Paging.IsEnd
+        if(classifyType.value==='myETA'){
+            const arr=res.Data?.List||[]
+            listState.list=[...listState.list,...arr]
+            listState.finished=res.Data?.Paging.IsEnd
+        }else{
+            const arr=res.Data?.List||[]
+            arr.forEach(_item => {
+                listState.list.push({
+                    ..._item,
+                    HaveOperaAuth:true,
+                    UniqueCode:`isETAForumChart_${_item.UniqueCode}`
+                })
+            });
+            listState.finished=res.Data?.Paging.IsEnd
+        }
+        
     }
 }
 // 触底加载更多
@@ -68,7 +109,8 @@ watch(
         emits('update',listState.list.map(item=>item.UniqueCode))
     },
     {
-        immediate:true
+        immediate:true,
+        deep:true
     }
 )
 
@@ -108,6 +150,10 @@ watch(
         :style="{ height: '100%' }"
     >
         <div class="select-classify-wrap">
+            <van-tabs class="type-tab" v-model:active="classifyType" @change="handleClassifyTypeChange">
+                <van-tab title="我的图库" name="myETA"></van-tab>
+                <van-tab title="ETA社区图库" name="ETAForum"></van-tab>
+            </van-tabs>
             <van-search v-model="searchVal" shape="round" placeholder="请输入分类名称" @search="handleRefreshList" @clear="handleRefreshList" />
             <ul class="list">
                 <van-radio-group v-model="activeClassify">
@@ -177,6 +223,9 @@ watch(
     display: flex;
     flex-direction: column;
     overflow: hidden;
+    .type-tab{
+        border-bottom: 1px solid #E7E7E7;
+    }
     .list{
         overflow-y: auto;
         flex: 1;

+ 13 - 9
src/views/report/smartReport/EditReport.vue

@@ -509,15 +509,19 @@ function handleChartInsert({list,type,chartType}){
 
           link=link+'/chartshow'
 
-          tempCompDataArr = list.map(item =>({
-            compId:3,
-            compType:'chart',
-            id:getCompId(3),
-            content:`${link}?code=${item}`,
-            titleText: '',
-            style:'height:350px',
-            child:[]
-          }))
+          tempCompDataArr = list.map(item =>{
+						const isETAForumChart=item.startsWith('isETAForumChart_')?true:false
+						console.log(item,isETAForumChart);
+						return {
+							compId:3,
+							compType:'chart',
+							id:getCompId(3),
+							content:`${link}?code=${isETAForumChart?item.replace(/^isETAForumChart_/, ''):item}&isETAForumChart=${isETAForumChart}`,
+							titleText: '',
+							style:'height:350px',
+							child:[]
+						}
+					})
         }else if(chartType==='sheet'){
             link=link+'/sheetshow'
             tempCompDataArr = list.map(item =>({

+ 2 - 1
src/views/reportEn/AddReport.vue

@@ -179,8 +179,9 @@ function handleInsert({list,type,chartType}){
             // link=import.meta.env.MODE==='production'?'https://chartlib.hzinsights.com/chartshow':'https://charttest.hzinsights.com/chartshow'
             link=link+'/chartshow'
             list.forEach(item => {
+                const isETAForumChart=item.startsWith('isETAForumChart_')?true:false
                 reportContentIns.html.insert(`<p style='text-align:left; margin-top:10px;'>
-						<iframe src='${link}?code=${item}&fromPage=en' width='100%' height='350' style='border-width:0px; min-height:350px;'></iframe>
+						<iframe src='${link}?code=${isETAForumChart?item.replace(/^isETAForumChart_/, ''):item}&fromPage=en&isETAForumChart=${isETAForumChart}' width='100%' height='350' style='border-width:0px; min-height:350px;'></iframe>
 					</p>`)
             });
         }else if(chartType==='sheet'){