Răsfoiți Sursa

移动端表格fix关联图库

chenlei 5 luni în urmă
părinte
comite
47635d7515

+ 27 - 17
src/views/sheetList/balanceChart.vue

@@ -10,6 +10,7 @@ const chartList = ref([]);
 const isShowAddToMyETADialog = ref(false);
 const route = useRoute()
 const { width } = useWindowSize()
+const chartItem = ref({});
 
 onMounted(() => {
     getChartList('init')
@@ -23,36 +24,44 @@ async function getChartList(){
     if(res.Ret!==200) return 
     chartList.value = res.Data.List||[]
     nextTick(()=>{
-        chartRender({
-            data:{
-                ...res.Data.List[0],
-                ChartInfo:{
-                    ...res.Data.List[0].ChartInfo,
+        chartList.value.forEach(element => {
+            chartRender({
+                data:{
+                    ...element,
+                    ChartInfo:{
+                        ...element.ChartInfo,
+                    },
                 },
-            },
-            renderId:'chart-box',
-            changeLangIsCheck:false,
-            showChartTitle:false,
-            shouldUseSelfLimit:true,
-        })
+                renderId: 'container' + element.ChartInfo.ChartInfoId,
+                changeLangIsCheck:false,
+                showChartTitle:false,
+                shouldUseSelfLimit:true,
+            })
+        });
     })
 }
+
+// 加入我的图库
+function addChart(item){
+    isShowAddToMyETADialog.value = true;
+    chartItem.value = item
+}
 </script>
 
 <template>
     <div class="sheet-chart-page" v-if="chartList.length">
-        <div class="sheet-name">表格名称sheet/版本</div>
+        <div class="sheet-name">{{ route.query.name }}</div>
         <!-- 图渲染区域 -->
-       <div class="chart-box">
-            <div class="chart-name">图表名称</div>
-            <div class="chart" id="chart-box"></div>
-            <div class="add-chart" @click="isShowAddToMyETADialog = true">加入我的图库</div>
+       <div class="chart-box" v-for="item in chartList" :key="item.ChartInfo.ChartInfoId">
+            <div class="chart-name">{{ item.ChartInfo.ChartName }}</div>
+            <div class="chart" :id="'container' + item.ChartInfo.ChartInfoId"></div>
+            <div class="add-chart" @click="addChart(item)">加入我的图库</div>
        </div>
         <!-- 加入我的图库弹窗 -->
         <AddChartToMyETA 
             :isShowDialog="isShowAddToMyETADialog"
             :dialogPosition="width>650?'center':'bottom'"
-            :chartInfo="chartList"
+            :chartInfo="chartItem.ChartInfo"
             @close="isShowAddToMyETADialog=false"
         />
     </div>
@@ -68,6 +77,7 @@ async function getChartList(){
         width: 100%;
         height: 50vh;
         padding: 20px;
+        margin-top: 10px;
         border: 1px solid rgba(0, 0, 0, 0.38);
         .chart-name {
             margin: 0 0 20px 0;

+ 2 - 2
src/views/sheetList/balanceDetail.vue

@@ -261,7 +261,7 @@ const onConfirmVersion = ({ selectedOptions }) => {
 
 // 关联图表页
 function goChart () {
-    router.push({ path: '/balance/chart', query: { id: queryData.value.ExcelInfoId } });
+    router.push({ path: '/balance/chart', query: { id: queryData.value.ExcelInfoId, name: queryData.value.ExcelName } });
 }
 </script>
 
@@ -364,7 +364,7 @@ function goChart () {
     .filter-box {
         font-size: 28px;
         width: 100%;
-        height: 84px;
+        // height: 84px;
         display: flex;
         justify-content: space-between;
         align-items: center;

+ 232 - 56
src/views/tabbar/Home.vue

@@ -64,36 +64,172 @@ const topImg=computed(()=>{
  * level 说明该菜单在数据中的第几级查找
  * type 类型 zh中文 en英文 ==> 默认中文点击切换
  */
+// const menuConfig=[
+//     // {
+//     //     zhName:'中文研报',
+//     //     zhDes:'研报一体化管理',
+//     //     key:'研报列表',
+//     //     type:'zh',
+//     //     level:2,
+//     //     path:'/report/list',
+//     //     icon:getStaticImg('tabbar/icon_report.png'),
+//     //     backgroundColor:'#FFFBF6',
+//     //     show:false
+//     // },
+//     // {
+//     //     zhName:'英文研报',
+//     //     zhDes:'支持共享协作编辑',
+//     //     enName:'English Research Report',
+//     //     enDes:'Integrated Research Report Management',
+//     //     key:'英文研报',
+//     //     type:'zh',
+//     //     level:2,
+//     //     path:'/reportEn/list',
+//     //     icon:getStaticImg('tabbar/icon_report.png'),
+//     //     backgroundColor:'#FFFBF6',
+//     //     show:false
+//     // },
+//     {
+//         zhName:'智能PPT',
+//         zhDes:"支持共享协作编辑",
+//         enName:'PPT Slides',
+//         enDes:'Support for collaborative editing',
+//         key:'智能ppt',
+//         type:'zh',
+//         level:1,
+//         path:'/ppt/index',
+//         icon:getStaticImg('tabbar/icon_PPT.png'),
+//         backgroundColor:'#FFF5F3',
+//         show:false
+//     },
+//     {
+//         zhName:'英文ppt',
+//         zhDes:'支持共享协作编辑',
+//         enName:'ppt in English',
+//         enDes:'Support for collaborative editing',
+//         key:'英文ppt',
+//         type:'zh',
+//         level:1,
+//         path:'/ppten/index',
+//         icon:getStaticImg('tabbar/icon_PPT.png'),
+//         backgroundColor:'#FFF5F3',
+//         show:false
+//     },
+//     // {
+//     //     zhName:'数据源',
+//     //     zhDes:'数据对接与整合',
+//     //     key:'数据源',
+//     //     type:'zh',
+//     //     level:1,
+//     //     path:'',
+//     //     icon:getStaticImg('tabbar/icon_dataSource.png'),
+//     //     backgroundColor:'#F8F9FF',
+//     //     show:false
+//     // },
+//     {
+//         zhName:'指标库',
+//         zhDes:'数据归类与分析',
+//         enName:'Indics',
+//         enDes:'Support for collaborative editing',
+//         key:'指标库',
+//         type:'zh',
+//         level:1,
+//         path:'/dataEDB/index',
+//         icon:getStaticImg('tabbar/icon_EDB.png'),
+//         backgroundColor:'#F5FAFF',
+//         show:false
+//     },
+//     // {
+//     //     zhName:'预测指标',
+//     //     zhDes:'模型预测趋势',
+//     //     key:'预测指标',
+//     //     type:'zh',
+//     //     level:1,
+//     //     path:'',
+//     //     icon:getStaticImg('tabbar/icon_preEDB.png'),
+//     //     backgroundColor:'#FFF5F3',
+//     //     show:false
+//     // },
+//     {
+//         zhName:'图库',
+//         zhDes:'数据可视化平台',
+//         enName:'Charts',
+//         enDes:'Support for collaborative editing',
+//         key:'图库',
+//         type:'zh',
+//         level:1,
+//         path:'/chartETA/list',
+//         icon:getStaticImg('tabbar/icon_chart.png'),
+//         backgroundColor:'#F8F9FF',
+//         show:false
+//     },
+//     {
+//         zhName:'我的图库',
+//         zhDes:'图表收藏',
+//         enName:'My Charts',
+//         enDes:'Support for collaborative editing',
+//         key:'我的投研',
+//         type:'zh',
+//         level:1,
+//         path:'/myETA/index',
+//         icon:getStaticImg('tabbar/icon_myChart.png'),
+//         backgroundColor:'#F5FAFF',
+//         show:false
+//     },
+//     {
+//         zhName:'表格',
+//         zhDes:'快速建立平衡表',
+//         enName:'Tables',
+//         enDes:'Quickly establish a balance sheet',
+//         key:'表格',
+//         type:'zh',
+//         level:1,
+//         path:'/sheetList/index',
+//         icon:getStaticImg('tabbar/icon_table.png'),
+//         backgroundColor:'#FFFBF6',
+//         show:false
+//     },
+// ]
+
+// 新增一个用于映射语言版本的函数
+
 const menuConfig=[
-    // {
-    //     zhName:'中文研报',
-    //     zhDes:'研报一体化管理',
-    //     key:'研报列表',
-    //     type:'zh',
-    //     level:2,
-    //     path:'/report/list',
-    //     icon:getStaticImg('tabbar/icon_report.png'),
-    //     backgroundColor:'#FFFBF6',
-    //     show:false
-    // },
-    // {
-    //     zhName:'英文研报',
-    //     zhDes:'支持共享协作编辑',
-    //     enName:'English Research Report',
-    //     enDes:'Integrated Research Report Management',
-    //     key:'英文研报',
-    //     type:'zh',
-    //     level:2,
-    //     path:'/reportEn/list',
-    //     icon:getStaticImg('tabbar/icon_report.png'),
-    //     backgroundColor:'#FFFBF6',
-    //     show:false
-    // },
     {
-        zhName:'智能PPT',
-        zhDes:"支持共享协作编辑",
-        enName:'PPT Slides',
-        enDes:'Support for collaborative editing',
+        name:'研报中心',
+        des:'研报一体化管理',
+        key:'研报中心',
+        type:'zh',
+        level:2,
+        path:'/report/list',
+        icon:getStaticImg('tabbar/icon_report.png'),
+        backgroundColor:'#FFFBF6',
+        show:false
+    },
+    {
+        name:'战研中心研报',
+        des:'',
+        key:'战研中心研报',
+        type:'zh',
+        level:1,
+        path:'/war_research_report/list',
+        icon:getStaticImg('tabbar/icon_report.png'),
+        backgroundColor:'#FFFBF6',
+        show:false
+    },
+    {
+        name:'英文研报',
+        des:'研报一体化管理',
+        key:'英文研报',
+        type:'zh',
+        level:2,
+        path:'/reportEn/list',
+        icon:getStaticImg('tabbar/icon_report.png'),
+        backgroundColor:'#FFFBF6',
+        show:false
+    },
+    {
+        name:'智能PPT',
+        des:"支持共享协作编辑",
         key:'智能ppt',
         type:'zh',
         level:1,
@@ -103,10 +239,19 @@ const menuConfig=[
         show:false
     },
     {
-        zhName:'英文ppt',
-        zhDes:'支持共享协作编辑',
-        enName:'ppt in English',
-        enDes:'Support for collaborative editing',
+        name:'文档管理库',
+        des:'支持上传文档报告',
+        key:'文档管理库',
+        type:'zh',
+        level:2,
+        path:'/external_report/list',
+        icon:getStaticImg('tabbar/icon_report.png'),
+        backgroundColor:'#FFFBF6',
+        show:false
+    },
+    {
+        name:'英文ppt',
+        des:'支持共享协作编辑',
         key:'英文ppt',
         type:'zh',
         level:1,
@@ -116,8 +261,8 @@ const menuConfig=[
         show:false
     },
     // {
-    //     zhName:'数据源',
-    //     zhDes:'数据对接与整合',
+    //     name:'数据源',
+    //     des:'数据对接与整合',
     //     key:'数据源',
     //     type:'zh',
     //     level:1,
@@ -127,10 +272,8 @@ const menuConfig=[
     //     show:false
     // },
     {
-        zhName:'指标库',
-        zhDes:'数据归类与分析',
-        enName:'Indics',
-        enDes:'Support for collaborative editing',
+        name:'指标库',
+        des:'数据归类与分析',
         key:'指标库',
         type:'zh',
         level:1,
@@ -140,8 +283,8 @@ const menuConfig=[
         show:false
     },
     // {
-    //     zhName:'预测指标',
-    //     zhDes:'模型预测趋势',
+    //     name:'预测指标',
+    //     des:'模型预测趋势',
     //     key:'预测指标',
     //     type:'zh',
     //     level:1,
@@ -151,10 +294,8 @@ const menuConfig=[
     //     show:false
     // },
     {
-        zhName:'图库',
-        zhDes:'数据可视化平台',
-        enName:'Charts',
-        enDes:'Support for collaborative editing',
+        name:'图库',
+        des:'数据可视化平台',
         key:'图库',
         type:'zh',
         level:1,
@@ -164,10 +305,8 @@ const menuConfig=[
         show:false
     },
     {
-        zhName:'我的图库',
-        zhDes:'图表收藏',
-        enName:'My Charts',
-        enDes:'Support for collaborative editing',
+        name:'我的图库',
+        des:'图表收藏',
         key:'我的投研',
         type:'zh',
         level:1,
@@ -177,10 +316,8 @@ const menuConfig=[
         show:false
     },
     {
-        zhName:'表格',
-        zhDes:'快速建立平衡表',
-        enName:'Tables',
-        enDes:'Quickly establish a balance sheet',
+        name:'表格',
+        des:'快速建立平衡表',
         key:'表格',
         type:'zh',
         level:1,
@@ -189,9 +326,19 @@ const menuConfig=[
         backgroundColor:'#FFFBF6',
         show:false
     },
+    {
+        name:'Tables',
+        des:'Quickly establish a balance sheet',
+        key:'表格',
+        type:'en',
+        level:1,
+        path:'/sheetList/index',
+        icon:getStaticImg('tabbar/icon_table.png'),
+        backgroundColor:'#FFFBF6',
+        show:false
+    },
 ]
 
-// 新增一个用于映射语言版本的函数
 function mapMenuToLanguage(item, language) {
     if (language === 'zh') {
         return { ...item, name: item.zhName, des: item.zhDes, type: 'zh' };
@@ -217,9 +364,38 @@ const filteredMenuConfig = computed(() => {
 });
 
 // 根据当前语言版本过滤并映射菜单项
-const menuOpts = computed(() => {
-    return filteredMenuConfig.value.map(item => mapMenuToLanguage(item, language_version.value));
-});
+// const menuOpts = computed(() => {
+//     return filteredMenuConfig.value.map(item => mapMenuToLanguage(item, language_version.value));
+// });
+
+const menuOpts=computed(()=>{
+    // 过滤中英文
+    let arr=menuConfig.filter(item=>item.type===language_version.value)
+    
+    // 根据菜单数据权限过滤
+    arr.forEach(item=>{
+        if(item.level===1){
+            resMenuList.value.forEach(f=>{
+                if(f.name.trim()===item.key){
+                    item.show=true
+                }
+            })
+        }
+        if(item.level===2){
+            resMenuList.value.forEach(f=>{
+                const arr=f.children||[]
+                arr.forEach(s=>{
+                    if(s.name.trim()===item.key){
+                        item.show=true
+                    }
+                })
+            })
+        }
+    })
+
+    arr=arr.filter(item=>item.show)
+    return arr||[]
+})
 
 
 // 获取菜单权限数据