Browse Source

fix: 画像排行榜传值丢失bug

ystl_myq 2 months ago
parent
commit
1a1d9443c1

+ 1 - 1
src/components/rankTable/draw.vue

@@ -247,7 +247,7 @@ function getValueByKey(obj, key) {
 const rawData = ref([]);
 const rawData = ref([]);
 const init = async (item, deptNames, names) => {
 const init = async (item, deptNames, names) => {
   rawData.value = item;
   rawData.value = item;
-  console.log("item", item);
+  console.log("item11", item);
   deptName.value = deptNames;
   deptName.value = deptNames;
   name.value = names;
   name.value = names;
   if ($route.name != "workerDrak") {
   if ($route.name != "workerDrak") {

+ 10 - 12
src/views/draw/children/department/departmentDrank.vue

@@ -32,13 +32,11 @@ const getChartsListApi = async () => {
   if (code == 200) {
   if (code == 200) {
     if (data && data.length > 0) {
     if (data && data.length > 0) {
       showLength.value = data?.length;
       showLength.value = data?.length;
-      setTimeout(() => {
-        nextTick(() => {
-          if (rankTableRef.value) {
-            rankTableRef.value.init(data, "科室", "姓名");
-          }
-        });
-      }, 500);
+      nextTick(() => {
+        setTimeout(() => {
+          rankTableRef.value.init(data, "科室", "姓名");
+        }, 500);
+      });
     }
     }
   }
   }
 };
 };
@@ -134,12 +132,12 @@ const init = (item, type) => {
       radarRefList.value = { ...seachParams.value, type: 1 };
       radarRefList.value = { ...seachParams.value, type: 1 };
       barDimEchartsList.data = item;
       barDimEchartsList.data = item;
       barDimEchartsList.type = 1;
       barDimEchartsList.type = 1;
+      getPersonDimensionChartsListApi();
+      getPersonDimensionChartsListApiDimList();
+      getPersonDimensionChartsRankingApi();
+      getChartsListApi();
+      activeName.value = "1";
     });
     });
-    getPersonDimensionChartsListApi();
-    getPersonDimensionChartsListApiDimList();
-    getPersonDimensionChartsRankingApi();
-    getChartsListApi();
-    activeName.value = "1";
   }
   }
   // setTimeout(() => {
   // setTimeout(() => {
   //   nextTick(() => {
   //   nextTick(() => {

+ 13 - 15
src/views/draw/children/head/headDrank.vue

@@ -34,16 +34,14 @@ const getChartsListApi = async () => {
     type: 3
     type: 3
   });
   });
   if (code == 200) {
   if (code == 200) {
-    setTimeout(() => {
-      nextTick(() => {
-        if (data && data.length > 0) {
-          showLength.value = data?.length;
-          if (rankTableRef.value) {
-            rankTableRef.value.init(data, "科室", "姓名");
-          }
-        }
-      });
-    }, 500);
+    nextTick(() => {
+      if (data && data.length > 0) {
+        showLength.value = data?.length;
+        setTimeout(() => {
+          rankTableRef.value.init(data, "科室", "姓名");
+        }, 500);
+      }
+    });
   }
   }
 };
 };
 // 柱状图
 // 柱状图
@@ -147,12 +145,12 @@ const init = (item, type) => {
       radarRefList.value = { ...seachParams.value, type: 3 };
       radarRefList.value = { ...seachParams.value, type: 3 };
       barDimEchartsList.data = item;
       barDimEchartsList.data = item;
       barDimEchartsList.type = 3;
       barDimEchartsList.type = 3;
+      getPersonDimensionChartsListApi();
+      getPersonDimensionChartsRankingApi();
+      getPersonDimensionChartsListApiDimList();
+      getChartsListApi();
+      activeName.value = "1";
     });
     });
-    getPersonDimensionChartsListApi();
-    getPersonDimensionChartsRankingApi();
-    getPersonDimensionChartsListApiDimList();
-    getChartsListApi();
-    activeName.value = "1";
   }
   }
   setTimeout(() => {
   setTimeout(() => {
     nextTick(() => {
     nextTick(() => {

+ 15 - 23
src/views/draw/children/health/healthDrank.vue

@@ -40,19 +40,15 @@ const getChartsListApi = async () => {
   });
   });
   if (code == 200) {
   if (code == 200) {
     // showLength.value = data.length;
     // showLength.value = data.length;
-    setTimeout(() => {
-      nextTick(() => {
-        if (data && data.length > 0) {
-          showLength.value = data.length;
-          if (rankTableRef.value) {
-            rankTableRef.value.init(data, "医疗组");
-          }
-          // rankTableRefList.data = data;
-          // rankTableRefList.dept = "医疗组";
-          // rankTableRef.value.init(data, "医疗组");
-        }
-      });
-    }, 500);
+    nextTick(() => {
+      if (data && data.length > 0) {
+        showLength.value = data.length;
+        setTimeout(() => {
+          console.log("1243tethdgfsa", data);
+          rankTableRef.value.init(data, "医疗组");
+        }, 500);
+      }
+    });
   }
   }
 };
 };
 // 雷达图
 // 雷达图
@@ -107,7 +103,6 @@ const getPersonDimensionChartsListApi = async (
             // radarRef.value.initChart(data);
             // radarRef.value.initChart(data);
           });
           });
         }, 500);
         }, 500);
-        // rankTableRef.value.init(data, "医疗组");
       }
       }
     }
     }
   }
   }
@@ -141,12 +136,12 @@ const init = (item, type) => {
       radarRefList.value = { ...seachParams.value, type: 2 };
       radarRefList.value = { ...seachParams.value, type: 2 };
       barDimEchartsList.data = item;
       barDimEchartsList.data = item;
       barDimEchartsList.type = 2;
       barDimEchartsList.type = 2;
+      getPersonDimensionChartsListApi();
+      getPersonDimensionChartsRankingApi();
+      getPersonDimensionChartsListApiDimList();
+      getChartsListApi();
+      activeName.value = "1";
     });
     });
-    getPersonDimensionChartsListApi();
-    getPersonDimensionChartsRankingApi();
-    getPersonDimensionChartsListApiDimList();
-    getChartsListApi();
-    activeName.value = "1";
   }
   }
   setTimeout(() => {
   setTimeout(() => {
     nextTick(() => {
     nextTick(() => {
@@ -220,10 +215,7 @@ const loading = ref(false);
         >
         >
           <el-tab-pane label="总览" name="1">
           <el-tab-pane label="总览" name="1">
             <div class="flex mr-8">
             <div class="flex mr-8">
-              <rankTable
-                ref="rankTableRef"
-                :rankTableRefList="rankTableRefList"
-              />
+              <rankTable ref="rankTableRef" />
             </div>
             </div>
             <!-- 总得分 -->
             <!-- 总得分 -->
             <div class="mt-5 pr-8 w-full h-60">
             <div class="mt-5 pr-8 w-full h-60">

+ 12 - 19
src/views/draw/children/worker/workerDrak.vue

@@ -38,21 +38,14 @@ const getChartsListApi = async () => {
     type: 0
     type: 0
   });
   });
   if (code == 200) {
   if (code == 200) {
-    setTimeout(() => {
-      nextTick(() => {
-        if (data && data.length > 0) {
-          showLength.value = data.length;
+    nextTick(() => {
+      if (data && data.length > 0) {
+        showLength.value = data.length;
+        setTimeout(() => {
           rankTableRef.value.init(data, "科室", "姓名");
           rankTableRef.value.init(data, "科室", "姓名");
-          // rankTableRefList.data = data;
-          // rankTableRefList.dept = "科室";
-          // rankTableRefList.name = "姓名";
-        }
-        // console.log("排行榜", rankTableRef.value);
-        // if (rankTableRef.value) {
-        //   rankTableRef.value.init(data, "科室", "姓名");
-        // }
-      });
-    }, 500);
+        }, 500);
+      }
+    });
   }
   }
 };
 };
 // 雷达图
 // 雷达图
@@ -146,12 +139,12 @@ const init = (item: any, type: any) => {
       radarRefList.value = { ...seachParams.value, type: 0 };
       radarRefList.value = { ...seachParams.value, type: 0 };
       barDimEchartsList.data = item;
       barDimEchartsList.data = item;
       barDimEchartsList.type = 0;
       barDimEchartsList.type = 0;
+      getPersonDimensionChartsListApi();
+      // getPersonDimensionChartsRankingApi();
+      getPersonDimensionChartsListApiDimList();
+      getChartsListApi();
+      activeName.value = "1";
     });
     });
-    getPersonDimensionChartsListApi();
-    // getPersonDimensionChartsRankingApi();
-    getPersonDimensionChartsListApiDimList();
-    getChartsListApi();
-    activeName.value = "1";
   }
   }
   setTimeout(() => {
   setTimeout(() => {
     nextTick(() => {
     nextTick(() => {