Quellcode durchsuchen

首页score图fix

zhudie vor 2 Jahren
Ursprung
Commit
3235034937

+ 0 - 4
src/views/cameras/overview/components/ShareCameraDetail.vue

@@ -207,10 +207,6 @@
 
   const handleConfirm = () => {
     if (!ruleFormRef.value) return;
-    // ruleFormRef.value.validate((valid) => {
-    //   if (!valid) {
-    //     return;
-    //   };
 
     ruleFormRef.value.validate((valid) => {
       if (!valid) {

+ 5 - 15
src/views/dashboard/home/components/AlgoDataPanel.vue

@@ -165,11 +165,15 @@
   //   };
   // });
 
+  //动态获取title的left比例
+  const screenWidth = window.innerWidth;
+  const titleLeft = computed(() => ((screenWidth * 0.3 - 350 * 0.2) * 100) / screenWidth + '%');
+
   const option = computed(() => {
     return {
       title: {
         text: '算法占比', // 设置标题文本
-        left: '25%', // 标题居中对齐
+        left: titleLeft.value, // 标题居中对齐
         top: 'center',
         textStyle: {
           fontSize: 20,
@@ -255,15 +259,6 @@
 </script>
 
 <style scoped>
-  /* .algo-data {
-    width: 484px;
-    padding: 12px 27px;
-    border-left: 2px solid #e8e8e8;
-    display: flex;
-    flex-direction: column;
-    align-items: flex-start;
-  } */
-
   .algo-header {
     display: flex;
     justify-content: space-between;
@@ -280,11 +275,6 @@
   }
 
   .algo-tit {
-    /* font-size: 16px;
-    font-weight: 500;
-    margin-bottom: 10px;
-    line-height: 44px;
-    color: #2e2e2e; */
     font-size: 16px;
     margin-top: 17px;
     margin-left: 18px;

+ 6 - 7
src/views/dashboard/home/components/Score.vue

@@ -8,11 +8,11 @@
         </el-radio-group>
       </div>
       <el-divider />
-      <div class="score-show">
-        <VChart class="pic-show" :option="options" />
+      <div v-if="scoreInfoList.length > 0" class="score-show">
+        <VChart class="pic-show" :option="options" :style="{ height: updateChartHeight }" />
       </div>
     </div>
-    <div class="score-divider"></div>
+    <div class="score-divider" :style="{ height: updateLineHeight }"></div>
     <div class="score-right">
       <div class="concern-title">重点关注车间</div>
       <ul v-if="workshopList.length > 0" class="concern-workspace">
@@ -72,6 +72,9 @@
   const timeSelect = ref<TimeEnum>(TimeEnum.DAY);
   //const workspaceList = ['车间1', '车间2', '车间3'];
 
+  const updateChartHeight = computed(() => window.innerHeight - 670 + 'px');
+  const updateLineHeight = computed(() => window.innerHeight - 618 + 'px');
+
   const dataZoomConfig = computed(() => [
     {
       type: 'slider',
@@ -216,10 +219,7 @@
 
   .score-divider {
     width: 1px;
-    height: 320px;
     background: #e9e9e9;
-    /* margin-left: 29px;
-    margin-right: 27px; */
   }
 
   .el-divider--horizontal {
@@ -228,7 +228,6 @@
 
   .pic-show {
     flex-grow: 1;
-    height: 270px;
   }
 
   .concern-title {

+ 1 - 7
src/views/dashboard/home/hooks/useScoreInfo.ts

@@ -8,13 +8,7 @@ import {
 } from '@/api/home/home-score.ts';
 
 export function useScoreInfo() {
-  const scoreInfoList = ref<ScoreType[]>([
-    {
-      date: '2024-05-06',
-      score: 99,
-      workshopList: ['ARJ21总装车间', 'C919部装车间', '维修交付中心'],
-    },
-  ]);
+  const scoreInfoList = ref<ScoreType[]>([]);
 
   const getDailyScoreList = () => {
     getDailyScore().then((res) => {