Bladeren bron

fix:高度调整,平衡表版本和子表选择调整

chenlei 4 maanden geleden
bovenliggende
commit
61764331a9

+ 31 - 0
src/views/sheetList/Index.vue

@@ -122,4 +122,35 @@ function goPage(item){
         }
     }
 }
+@media screen and (min-width:$media-width){
+    .tabbar-box{
+        height: 56px;
+        .tabbar-item{
+            padding: 8px;
+            height: 100%;
+            &::after{
+                width: 1px;
+                height: calc(100% - 16px);
+                top: 8px;
+            }
+            .tabbar-item-con{
+                .icon{
+                    width: 24px;
+                    height: 24px;
+                }
+                .text{
+                    // color: rgba(0, 82, 217, 1);
+                    font-size: 16px;
+                    font-weight: 400;
+                    margin-top: 2px;
+                }
+            }
+        }
+        .tabbar-item_active{
+            .tabbar-item-con{
+                border-radius: 56px;
+            }
+        }
+    }
+}
 </style>

+ 30 - 18
src/views/sheetList/balanceChart.vue

@@ -11,6 +11,7 @@ const isShowAddToMyETADialog = ref(false);
 const route = useRoute()
 const { width } = useWindowSize()
 const chartItem = ref({});
+const isLoading = ref(false);
 
 onMounted(() => {
     getChartList('init')
@@ -18,9 +19,11 @@ onMounted(() => {
 
 // 获取图表数据
 async function getChartList(){
+    isLoading.value = true
     const res = await apiSheet.getBalanceChartData({
-            ExcelInfoId: Number(route.query.id)
-        })
+        ExcelInfoId: Number(route.query.id)
+    })
+    isLoading.value = false
     if(res.Ret!==200) return 
     chartList.value = res.Data.List||[]
     nextTick(()=>{
@@ -49,21 +52,26 @@ function addChart(item){
 </script>
 
 <template>
-    <div class="sheet-chart-page" v-if="chartList.length">
-        <div class="sheet-name">{{ route.query.name }}</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="chartItem.ChartInfo"
-            @close="isShowAddToMyETADialog=false"
-        />
+    <div class="sheet-chart-page">
+        <template v-if="chartList.length">
+            <div class="sheet-name">{{ route.query.name }}</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="chartItem.ChartInfo"
+                @close="isShowAddToMyETADialog=false"
+            />
+        </template>
+        <template v-if="!chartList.length && !isLoading">
+            <img class="list-empty-img" src="https://hzstatic.hzinsights.com/static/ETA_mobile/empty_img.png" alt="">
+        </template>
     </div>
 </template>
 
@@ -78,7 +86,11 @@ function addChart(item){
         height: 50vh;
         padding: 20px;
         margin-top: 10px;
-        border: 1px solid rgba(0, 0, 0, 0.38);
+        // padding: 14px 0px 0px 0px;
+        // gap: 14px;
+        border-radius: 4px;
+        border: 1px solid rgba(220, 220, 220, 1);
+        background: rgba(255, 255, 255, 1);
         .chart-name {
             margin: 0 0 20px 0;
             line-height: 30px;

+ 20 - 17
src/views/sheetList/balanceDetail.vue

@@ -15,7 +15,6 @@ const { width } = useWindowSize()
 const route = useRoute()
 const router = useRouter()
 const queryData = ref({})
-const link = ref(publicSettingStore.publicSetting.ChartViewUrl);
 //显示更多操作栏
 let showMoreAction = ref(false)
 let showPicker = ref(false)
@@ -44,6 +43,9 @@ const downExcelFileUrl = computed(() => {
     }/datamanage/excel_info/table/download?${localStorage.getItem("token")}`;
     return url;
 })
+const link = computed(() => {
+    return publicSettingStore.publicSetting.ChartViewUrl;
+})
 
 onMounted(() => {
     getVersionList()
@@ -214,13 +216,6 @@ function Base64() {
     }
 }
 
-const columns = [
-    { text: '杭州', value: 'Hangzhou' },
-    { text: '宁波', value: 'Ningbo' },
-    { text: '温州', value: 'Wenzhou' },
-    { text: '绍兴', value: 'Shaoxing' },
-    { text: '湖州', value: 'Huzhou' },
-];
 const versionOpts = ref([])
 const childTableOpts = ref([])
 const fieldValue = ref('表格名');
@@ -232,18 +227,22 @@ function getVersionList(){
         if(res.Ret === 200){
             const arr = res.Data.List || []
             versionOpts.value = arr
+            fieldValueVersion.value = arr[0].VersionName
         }
     })
 }
 
 // 平衡表获取子表列表
-function getChildTable(){
-    apiSheet.getBalanceChildTable({ParentId: route.query.id,}).then(res=>{
+function getChildTable(ParentId = route.query.id){
+    apiSheet.getBalanceChildTable({ParentId}).then(res=>{
         if(res.Ret === 200){
             const arr = res.Data.List || []
-            childTableOpts.value = arr
-            getExcelDetail( 'load', arr[0] ? arr[0].ExcelInfoId : route.query.id)
-            getChartList(arr[0] ? arr[0].ExcelInfoId : route.query.id)
+            if(arr.length === 0) return; // 修正逻辑错误
+            childTableOpts.value = arr;
+            const firstItemId = arr[0]?.ExcelInfoId || route.query.id; // 使用可选链操作符简化逻辑
+            getExcelDetail('load', firstItemId);
+            getChartList(firstItemId);
+            fieldValue.value = arr[0]?.ExcelName || '默认表格名';
         }
     })
 }
@@ -259,7 +258,8 @@ const onConfirm = ({ selectedOptions }) => {
 const onConfirmVersion = ({ selectedOptions }) => {
     showVersionPicker.value = false;
     fieldValueVersion.value = selectedOptions[0].VersionName;
-    getExcelDetail( 'load', selectedOptions[0].ExcelInfoId)
+    // getExcelDetail( 'load', selectedOptions[0].ExcelInfoId)
+    getChildTable(selectedOptions[0].ExcelInfoId);
 };
 
 // 关联图表页
@@ -473,10 +473,12 @@ function goChart () {
     }
     @media screen and (min-width: 650px) {
         .filter-box {
+            padding-top: 5px;
+            background-color: #fff;
             width: 50%;
             font-size: 16px;
-            height: 30px;
-            position: absolute;
+            height: 35px;
+            position: fixed;
             left: 12px;
             bottom: 18px;
             .filter-item {
@@ -532,11 +534,12 @@ function goChart () {
             height: calc(100% - 135px);
         }
         .bottom {
-            width: 30%;
+            width: 49%;
             // position: absolute;
             // right: 12px;
             // bottom: 12px;
             position: fixed;
+            background-color: #fff;
             bottom: 12px;
             right: 12px;
             z-index: 99;

+ 4 - 2
src/views/sheetList/sharedDetail.vue

@@ -277,7 +277,7 @@ function Base64() {
     }
     .sheet-box{
         width: 100%;
-        height: calc(100% - 220px);
+        height: calc(100% - 230px);
         // background-color: pink;
     }
     .sheet-more-action-wrap{
@@ -365,8 +365,10 @@ function Base64() {
             height: calc(100% - 110px);
         }
         .bottom {
-            margin: 10px 0;
+            margin-top: 5px;
+            padding-top: 10px;
             display: flex;
+            height: 60px;
             justify-content: space-around;
             .bottom-item {
                 color: rgba(51, 51, 51, 1);