Ver Fonte

feat: 画像列表bug修复

haifeng.zhang há 1 dia atrás
pai
commit
2b927cfab0

+ 9 - 3
src/components/personList/index.vue

@@ -2,7 +2,7 @@
  * @Author: zhanghaifeng
  * @Date: 2024-11-27 15:44:12
  * @LastEditors: zhanghaifeng
- * @LastEditTime: 2025-06-24 17:11:05
+ * @LastEditTime: 2025-07-01 17:34:10
  * @Description:
  * @FilePath: /hospital-project/src/components/personList/index.vue
 -->
@@ -58,7 +58,8 @@ const showList = ref();
 const watchData = ref();
 const props = defineProps({
   paramsIndex: {
-    type: Object
+    type: Object,
+    default: () => ({})
   },
   detailData: {
     type: Array,
@@ -68,10 +69,12 @@ const props = defineProps({
 watch(props, newVal => {
   showList.value = newVal.detailData[0]?.dimensionList[0];
   tableData.value = newVal.detailData[0]?.dimensionList[0]?.quotaList;
+  console.log(newVal, tableData.value, "11111111");
 });
 const init = (data?: any, id?: any) => {
   if (data) {
     tableData.value = [];
+    console.log(tableData.value, "22222222");
     watchData.value = data;
     setTimeout(() => {
       nextTick(() => {
@@ -82,19 +85,22 @@ const init = (data?: any, id?: any) => {
               tableData.value = it.quotaList;
             }
           });
+          console.log(tableData.value, "33333333");
         } else {
           showList.value = data[0]?.dimensionList[0];
           tableData.value = data[0]?.dimensionList[0].quotaList;
+          console.log(tableData.value, "44444444");
         }
       });
     }, 0);
   }
 };
 watch(
-  watchData.value,
+  () => watchData.value,
   newVal => {
     showList.value = newVal[0]?.dimensionList[0];
     tableData.value = newVal[0]?.dimensionList[0].quotaList;
+    console.log(tableData.value, "55555555");
   },
   { deep: true }
 );

+ 26 - 9
src/views/draw/children/department/departmentDrank.vue

@@ -94,19 +94,35 @@ const init = (item, type, val) => {
 // 维度表格
 const paramsIndex = ref({});
 const personListRef = ref();
+const radarRefList2 = ref([]);
 const handleClick = (tab: TabsPaneContext, event: Event) => {
   loading.value = true;
   if (tab.props.label == "总览") {
     getChartsListApi();
-  }
-  nextTick(() => {
-    Object.assign(paramsIndex.value, {
-      ...seachParams.value,
-      dimId: tab.props.name,
-      dimensionName: tab.props.label,
-      type: 1
+  } else {
+    nextTick(() => {
+      Object.assign(paramsIndex.value, {
+        ...seachParams.value,
+        dimId: tab.props.name,
+        dimensionName: tab.props.label,
+        type: 1
+      });
+      radarRefList2.value = [];
+      setTimeout(() => {
+        const data = [];
+        const lists = [...radarRefList.value];
+        lists.forEach(el => {
+          data.push({ ...el });
+        });
+        data[0].dimensionList = data[0].dimensionList.filter(item => {
+          if (item.dimId === tab.props.name) {
+            return true;
+          }
+        });
+        radarRefList2.value = data;
+      }, 1000);
     });
-  });
+  }
   setTimeout(() => {
     loading.value = false;
   }, 1000);
@@ -177,9 +193,10 @@ const loading = ref(false);
               <div class="flex justify-between">
                 <personList
                   ref="personListRef"
+                  :key="item.id + index"
                   class="w-11/12"
                   :paramsIndex="paramsIndex"
-                  :detailData="radarRefList"
+                  :detailData="radarRefList2"
                 />
                 <div
                   class="w-[30px] h-[30px] mr-10 cursor-pointer"

+ 17 - 1
src/views/draw/children/head/headDrank.vue

@@ -102,6 +102,7 @@ const init = (item, type, val) => {
 // 维度表格
 const paramsIndex = ref({});
 const personListRef = ref();
+const radarRefList2 = ref([]);
 const handleClick = (tab: TabsPaneContext, event: Event) => {
   loading.value = true;
   if (tab.props.label == "总览") {
@@ -110,6 +111,20 @@ const handleClick = (tab: TabsPaneContext, event: Event) => {
       loading.value = false;
     }, 1000);
   } else {
+    radarRefList2.value = [];
+    setTimeout(() => {
+      const data = [];
+      const lists = [...radarRefList.value];
+      lists.forEach(el => {
+        data.push({ ...el });
+      });
+      data[0].dimensionList = data[0].dimensionList.filter(item => {
+        if (item.dimId === tab.props.name) {
+          return true;
+        }
+      });
+      radarRefList2.value = data;
+    }, 1000);
     setTimeout(() => {
       loading.value = false;
     }, 1000);
@@ -188,10 +203,11 @@ const loading = ref(false);
             <div class="w-full">
               <div class="flex justify-between">
                 <personList
+                  :key="item.id + index"
                   ref="personListRef"
                   class="w-11/12"
                   :paramsIndex="paramsIndex"
-                  :detailData="radarRefList"
+                  :detailData="radarRefList2"
                 />
                 <div
                   class="w-[30px] h-[30px] mr-10 cursor-pointer"

+ 26 - 9
src/views/draw/children/health/healthDrank.vue

@@ -105,20 +105,36 @@ const init = (item, type, val) => {
 // 维度表格
 const paramsIndex = ref({});
 const personListRef = ref();
+const radarRefList2 = ref([]);
 const handleClick = (tab: TabsPaneContext, event: Event) => {
   loading.value = true;
 
   if (tab.props.label == "总览") {
     getChartsListApi();
-  }
-  nextTick(() => {
-    Object.assign(paramsIndex.value, {
-      ...seachParams.value,
-      dimId: tab.props.name,
-      dimensionName: tab.props.label,
-      type: 2
+  } else {
+    nextTick(() => {
+      Object.assign(paramsIndex.value, {
+        ...seachParams.value,
+        dimId: tab.props.name,
+        dimensionName: tab.props.label,
+        type: 2
+      });
+      radarRefList2.value = [];
+      setTimeout(() => {
+        const data = [];
+        const lists = [...radarRefList.value];
+        lists.forEach(el => {
+          data.push({ ...el });
+        });
+        data[0].dimensionList = data[0].dimensionList.filter(item => {
+          if (item.dimId === tab.props.name) {
+            return true;
+          }
+        });
+        radarRefList2.value = data;
+      }, 1000);
     });
-  });
+  }
   setTimeout(() => {
     loading.value = false;
   }, 1000);
@@ -198,9 +214,10 @@ const loading = ref(false);
               <div class="flex justify-between">
                 <personList
                   ref="personListRef"
+                  :key="item.id + index"
                   class="w-11/12"
                   :paramsIndex="paramsIndex"
-                  :detailData="radarRefList"
+                  :detailData="radarRefList2"
                 />
                 <div
                   class="w-[30px] h-[30px] mr-10 cursor-pointer"

+ 17 - 1
src/views/draw/children/worker/workerDrak.vue

@@ -111,6 +111,7 @@ const init = (item: any, type: any, val: any) => {
 // 维度表格
 const paramsIndex = ref({});
 const personListRef = ref();
+const radarRefList2 = ref([]);
 const handleClick = (tab: TabsPaneContext, event: Event) => {
   loading.value = true;
   if (tab.props.label == "总览") {
@@ -123,6 +124,20 @@ const handleClick = (tab: TabsPaneContext, event: Event) => {
         dimensionName: tab.props.label,
         type: 0
       });
+      radarRefList2.value = [];
+      setTimeout(() => {
+        const data = [];
+        const lists = [...radarRefList.value];
+        lists.forEach(el => {
+          data.push({ ...el });
+        });
+        data[0].dimensionList = data[0].dimensionList.filter(item => {
+          if (item.dimId === tab.props.name) {
+            return true;
+          }
+        });
+        radarRefList2.value = data;
+      }, 1000);
     });
   }
   setTimeout(() => {
@@ -197,10 +212,11 @@ const loading = ref(false);
             <div class="w-full">
               <div class="flex justify-between">
                 <personList
+                  :key="item.id + index"
                   ref="personListRef"
                   class="w-11/12"
                   :paramsIndex="paramsIndex"
-                  :detailData="radarRefList"
+                  :detailData="radarRefList2"
                 />
                 <div
                   class="w-[30px] h-[30px] mr-10 cursor-pointer"