Quellcode durchsuchen

驾驶舱修改

zhaoke vor 2 Jahren
Ursprung
Commit
2ac12c6a22

+ 5 - 0
src/views/dashboard/hooks/usePublic.ts

@@ -499,6 +499,10 @@ export function usePublic() {
     })
     return res
   }
+  const formatWeight = (num: string | number) => {
+    const newNum = Number(num)
+    return Math.ceil(newNum / 1000)
+  }
   return {
     optionLeft,
     airlineAbnormalBaggage,
@@ -508,5 +512,6 @@ export function usePublic() {
     getPublicData,
     findData,
     formatGoods,
+    formatWeight,
   }
 }

+ 2 - 1
src/views/dashboard/index.vue

@@ -72,7 +72,7 @@
             </div>
             <div class="dashboard-content-top-center-top-list">
               <div class="dashboard-content-top-center-top-list-txt">已卸载总量(吨)</div>
-              <div class="dashboard-content-top-center-top-list-num">{{ weightNums }}</div>
+              <div class="dashboard-content-top-center-top-list-num">{{ formatWeight(weightNums) }}</div>
             </div>
           </div>
           <div v-loading="loading5" element-loading-text="数据加载中..." element-loading-svg-view-box="-10, -10, 50, 50" element-loading-background="rgba(0,0,0, 0.3)" class="dashboard-content-top-center-bottom">
@@ -200,6 +200,7 @@ const {
   airStutas,
   getPublicData,
   formatGoods,
+  formatWeight,
 } = usePublic();
 const timePickerName = ref<number>(0);
 const limitScrollNum = ref<number>(13);

+ 2 - 1
src/views/dashboard/indexHomeOut.vue

@@ -72,7 +72,7 @@
             </div>
             <div class="dashboard-content-top-center-top-list">
               <div class="dashboard-content-top-center-top-list-txt">已装载总量(吨)</div>
-              <div class="dashboard-content-top-center-top-list-num">{{ weightNums }}</div>
+              <div class="dashboard-content-top-center-top-list-num">{{ formatWeight(weightNums) }}</div>
             </div>
           </div>
           <div v-loading="loading5" element-loading-text="数据加载中..." element-loading-svg-view-box="-10, -10, 50, 50" element-loading-background="rgba(0,0,0, 0.3)" class="dashboard-content-top-center-bottom">
@@ -198,6 +198,7 @@ const {
   airlineAbnormalBaggage,
   getPublicData,
   formatGoods,
+  formatWeight,
 } = usePublic();
 const timePickerName = ref<number>(0);
 const limitScrollNum = ref<number>(13);

+ 2 - 1
src/views/dashboard/indexIn.vue

@@ -83,7 +83,7 @@
                 已卸载总量(吨)
               </div>
               <div class="dashboard-content-top-center-top-list-num">
-                {{ weightNums }}
+                {{ formatWeight(weightNums) }}
               </div>
             </div>
           </div>
@@ -244,6 +244,7 @@ const {
   airStutas,
   getPublicData,
   formatGoods,
+  formatWeight,
 } = usePublic();
 const timePickerName = ref<number>(0);
 const limitScrollNum = ref<number>(13);

+ 2 - 1
src/views/dashboard/indexOut.vue

@@ -83,7 +83,7 @@
                 已装载总量(吨)
               </div>
               <div class="dashboard-content-top-center-top-list-num">
-                {{ weightNums }}
+                {{ formatWeight(weightNums) }}
               </div>
             </div>
           </div>
@@ -240,6 +240,7 @@ const {
   airlineAbnormalBaggage,
   getPublicData,
   formatGoods,
+  formatWeight,
 } = usePublic();
 const timePickerName = ref<number>(0);
 const limitScrollNum = ref<number>(13);