Ver código fonte

fix: 可视化

ystl_myq 1 semana atrás
pai
commit
1369c1b0c8

+ 14 - 11
src/components/rankTable/draw.vue

@@ -47,6 +47,8 @@ const init = (item, deptNames, names) => {
   tableData.value = item;
   deptName.value = deptNames;
   name.value = names;
+  console.log("item111", item);
+  console.log("tableData", tableData.value);
 };
 defineExpose({
   init
@@ -58,21 +60,22 @@ defineExpose({
   display: flex;
   align-items: center;
   justify-content: center;
-  width: 25px; /* 菱形宽度 */
-  height: 25px; /* 菱形高度 */
+  width: 25px;
+
+  /* 菱形宽度 */
+  height: 25px;
+
+  /* 菱形高度 */
   padding-top: 1px;
   margin: auto;
-  clip-path: polygon(
-    50% 0%,
-    100% 25%,
-    100% 75%,
-    50% 100%,
-    0% 75%,
-    0% 25%
-  ); /* 定义六边形的形状 */
+  clip-path: polygon(50% 0%, 100% 25%, 100% 75%, 50% 100%, 0% 75%, 0% 25%);
+
+  /* 定义六边形的形状 */
 
   font-size: 12px;
   color: white;
-  background-color: #d3e8f0; /* 背景颜色 */
+  background-color: #d3e8f0;
+
+  /* 背景颜色 */
 }
 </style>

+ 21 - 15
src/components/rankTable/index.vue

@@ -35,7 +35,7 @@
       fixed
       width="100"
     />
-    <div v-for="(item, index) in tableData?.dimensionList" :key="index">
+    <div v-for="(item, index) in tableData.dimensionList" :key="index">
       <el-table-column :label="`${item.dimName}(${item.soreRate}%)`">
         <el-table-column
           v-for="(it, id) in item.quotaList"
@@ -69,9 +69,12 @@ const tableHeaderColor = ({ row, column, rowIndex, columnIndex }) => {
   return "aaaa";
 };
 const averageData = averageSore => {
-  tableData.value.unshift({
-    allScore: averageSore
-  });
+  if (tableData.value.length > 0) {
+    tableData.value.unshift({
+      dimensionList: [],
+      allScore: averageSore
+    });
+  }
 };
 
 const arraySpanMethod = ({ row, column, rowIndex, columnIndex }) => {
@@ -92,6 +95,8 @@ const init = (item, deptNames, names) => {
   averageData(item.averageSore);
   deptName.value = deptNames;
   name.value = names;
+  console.log("tableData.value", tableData.value);
+  console.log("deptName.value", item);
 };
 defineExpose({
   init
@@ -103,22 +108,23 @@ defineExpose({
   display: flex;
   align-items: center;
   justify-content: center;
-  width: 25px; /* 菱形宽度 */
-  height: 25px; /* 菱形高度 */
+  width: 25px;
+
+  /* 菱形宽度 */
+  height: 25px;
+
+  /* 菱形高度 */
   padding-top: 1px;
   margin: auto;
-  clip-path: polygon(
-    50% 0%,
-    100% 25%,
-    100% 75%,
-    50% 100%,
-    0% 75%,
-    0% 25%
-  ); /* 定义六边形的形状 */
+  clip-path: polygon(50% 0%, 100% 25%, 100% 75%, 50% 100%, 0% 75%, 0% 25%);
+
+  /* 定义六边形的形状 */
 
   font-size: 12px;
   color: white;
-  background-color: #d3e8f0; /* 背景颜色 */
+  background-color: #d3e8f0;
+
+  /* 背景颜色 */
 }
 
 .mytTable ::v-deep .el-table th.el-table__cell,

+ 6 - 5
src/views/draw/children/department/departmentRank.vue

@@ -17,13 +17,14 @@ const getPersonDimensionChartsListApi = async () => {
   });
 
   if (code == 200) {
+    console.log("data", data);
     if (data.length > 0) {
       lengthData.value = data.length;
-      setTimeout(() => {
-        nextTick(() => {
-          rankTableRef.value.init(data, "科室", "姓名");
-        });
-      }, 500);
+      console.log("lengthData.value", lengthData.value);
+      nextTick(() => {
+        rankTableRef.value.init(data, "科室", "姓名");
+      });
+      setTimeout(() => {}, 500);
     }
   }
 };

+ 14 - 12
src/views/draw/children/health/componements/seach.vue

@@ -44,16 +44,17 @@ const getAssessmentPageListApi = async () => {
 };
 getAssessmentPageListApi();
 // 用户组-用户组-医疗组
-const postPageGroupApi = async () => {
-  const { data, code } = await postPageGroup({
-    pageNumber: 1,
-    pageSize: 1000
+const postPageGroupApi = async selectedItem => {
+  const { data, code } = await getUserListObjectByModelId({
+    modelId: selectedItem.assessmentModelId,
+    assessmentId: selectedItem.assessmentId,
+    type: 2
   });
   if (code === 200) {
-    dataList.userList = data.records;
+    dataList.userList = data;
   }
 };
-postPageGroupApi();
+// postPageGroupApi();
 // -----------------------
 const init = reactive({
   assessmentName: "",
@@ -79,6 +80,7 @@ const handClickInit2 = value => {
       item => item.assessmentModelId === value
     );
     init.assessmentModelName = selectedItem.assessmentModelName;
+    postPageGroupApi(selectedItem);
   }
   $emit("handClick", {
     ...dataList.params,
@@ -88,9 +90,9 @@ const handClickInit2 = value => {
 const handClickInit3 = value => {
   if (value) {
     const selectedItem = dataList.userList.find(
-      item => item.groupCode === value
+      item => item.assessmentObjectId === value
     );
-    init.deptName = selectedItem.groupName;
+    init.assessmentObjectName = selectedItem.assessmentObjectName;
   }
   $emit("handClick", {
     ...dataList.params,
@@ -142,7 +144,7 @@ const handClickInit3 = value => {
         <div class="flex mr-2">
           <div class="text-sm leading-8 mr-3">医疗组</div>
           <el-select
-            v-model="dataList.params.deptCode"
+            v-model="dataList.params.assessmentObjectId"
             clearable
             filterable
             placeholder="请选择"
@@ -151,9 +153,9 @@ const handClickInit3 = value => {
           >
             <el-option
               v-for="item in dataList.userList"
-              :key="item.groupCode"
-              :label="item.groupName"
-              :value="item.groupCode"
+              :key="item.assessmentObjectId"
+              :label="item.assessmentObjectName"
+              :value="item.assessmentObjectId"
             />
           </el-select>
         </div>

+ 43 - 19
src/views/draw/children/worker/componements/seach.vue

@@ -36,16 +36,17 @@ const getTemplateInfoListApi = async selectedItem => {
 };
 getTemplateInfoListApi();
 // 员工
-const userPageWhitOrganizationApi = async () => {
-  const { data, code } = await userPageWhitOrganization({
-    pageNumber: 1,
-    pageSize: 1000
+const userPageWhitOrganizationApi = async selectedItem => {
+  const { data, code } = await getUserListObjectByModelId({
+    modelId: selectedItem.assessmentModelId,
+    assessmentId: selectedItem.assessmentId,
+    type: 0
   });
   if (code === 200) {
-    dataList.personList = data.records;
+    dataList.personList = data;
   }
 };
-userPageWhitOrganizationApi();
+// userPageWhitOrganizationApi();
 // 考核活动
 const getAssessmentPageListApi = async () => {
   const { data, code } = await getAssessmentList({
@@ -57,14 +58,17 @@ const getAssessmentPageListApi = async () => {
 };
 getAssessmentPageListApi();
 // 部门
-const postListTreeApi = async () => {
-  const { data, code } = await postListTree();
+const postListTreeApi = async selectedItem => {
+  const { data, code } = await getUserListObjectByModelId({
+    modelId: selectedItem.assessmentModelId,
+    type: 1,
+    assessmentId: selectedItem.assessmentId
+  });
   if (code === 200) {
     dataList.deptList = data;
   }
-  console.log("await", data);
 };
-postListTreeApi();
+// postListTreeApi();
 // -----------------------------------
 const init = reactive({
   assessmentName: "",
@@ -90,6 +94,8 @@ const handClickInit2 = value => {
       item => item.assessmentModelId === value
     );
     init.assessmentModelName = selectedItem.assessmentModelName;
+    userPageWhitOrganizationApi(selectedItem);
+    postListTreeApi(selectedItem);
   }
   $emit("handClick", {
     ...dataList.params,
@@ -98,7 +104,11 @@ const handClickInit2 = value => {
 };
 const handClickInit3 = value => {
   if (value) {
-    init.deptName = value.deptName;
+    const selectedItem = dataList.personList.find(
+      item => item.assessmentObjectId === value
+    );
+    init.deptName = selectedItem.assessmentObjectName;
+    // init.deptName = value.deptName;
   }
   $emit("handClick", {
     ...dataList.params,
@@ -108,10 +118,9 @@ const handClickInit3 = value => {
 const handClickInit4 = value => {
   if (value) {
     const selectedItem = dataList.personList.find(
-      item => item.userCode === value
+      item => item.assessmentObjectId === value
     );
-    console.log("selectedItem", selectedItem);
-    init.assessmentObjectName = selectedItem.realName;
+    init.assessmentObjectName = selectedItem.assessmentObjectName;
   }
   $emit("handClick", {
     ...dataList.params,
@@ -162,7 +171,22 @@ const handClickInit4 = value => {
         </div>
         <div class="flex mr-2">
           <div class="text-sm leading-8 mr-3">科室</div>
-          <el-tree-select
+          <el-select
+            v-model="dataList.params.deptCode"
+            clearable
+            filterable
+            placeholder="请选择"
+            style="width: 200px"
+            @change="handClickInit3"
+          >
+            <el-option
+              v-for="item in dataList.deptList"
+              :key="item.assessmentObjectId"
+              :label="item.assessmentObjectName"
+              :value="item.assessmentObjectId"
+            />
+          </el-select>
+          <!-- <el-tree-select
             v-model="dataList.params.deptCode"
             :data="dataList.deptList"
             check-strictly
@@ -175,7 +199,7 @@ const handClickInit4 = value => {
             }"
             style="width: 200px"
             @node-click="handClickInit3"
-          />
+          /> -->
         </div>
         <div class="flex mr-2">
           <div class="text-sm leading-8 mr-3">员工</div>
@@ -189,9 +213,9 @@ const handClickInit4 = value => {
           >
             <el-option
               v-for="item in dataList.personList"
-              :key="item.userCode"
-              :label="item.realName"
-              :value="item.userCode"
+              :key="item.assessmentObjectId"
+              :label="item.assessmentObjectName"
+              :value="item.assessmentObjectId"
             />
           </el-select>
         </div>