Bladeren bron

fix: 可视化

ystl_myq 1 week geleden
bovenliggende
commit
9b2fdb7c97

+ 8 - 2
src/api/draw.ts

@@ -44,8 +44,14 @@ type quotaList = {
   msg: string;
 };
 // 所有考核
-export const getAssessmentList = () => {
-  return http.request<addDeptList>("get", "/specialPortrait/getAssessmentList");
+export const getAssessmentList = (params?: any) => {
+  return http.request<addDeptList>(
+    "get",
+    "/specialPortrait/getAssessmentList",
+    {
+      params
+    }
+  );
 };
 // 排名专题画像
 export const getChartsList = params => {

+ 52 - 25
src/views/draw/children/department/componements/seach.vue

@@ -4,6 +4,12 @@ import { getTemplateInfoList } from "@/api/templateInfo";
 import { userPageWhitOrganization } from "@/api/userSetting";
 import { getAssessmentPageList } from "@/api/manage";
 import { postListTree } from "@/api/department";
+import {
+  getAssessmentList,
+  getModelListByAssessmentId,
+  getUserListObjectByModelId
+} from "@/api/draw";
+
 const $emit = defineEmits(["handClick"]);
 
 const dataList = reactive({
@@ -19,35 +25,33 @@ const dataList = reactive({
   }
 });
 // 考核模板
-const getTemplateInfoListApi = async () => {
-  const { data, code } = await getTemplateInfoList({
-    pageNumber: 1,
-    pageSize: 1000
-  });
+const getTemplateInfoListApi = async selectedItem => {
+  const { data, code } = await getModelListByAssessmentId(selectedItem);
   if (code === 200) {
-    dataList.teplist = data.records;
+    dataList.teplist = data;
   }
 };
-getTemplateInfoListApi();
+// getTemplateInfoListApi();
 // 员工
-const userPageWhitOrganizationApi = async () => {
-  const { data, code } = await userPageWhitOrganization({
-    pageNumber: 1,
-    pageSize: 1000
+const userPageWhitOrganizationApi = async selectedItem => {
+  const { data, code } = await getUserListObjectByModelId({
+    type: 1,
+    assessmentId: selectedItem.assessmentId,
+    modelId: selectedItem.assessmentModelId
   });
+  console.log("1111", data);
   if (code === 200) {
-    dataList.personList = data.records;
+    dataList.personList = data;
   }
 };
-userPageWhitOrganizationApi();
+// userPageWhitOrganizationApi();
 // 考核活动
 const getAssessmentPageListApi = async () => {
-  const { data, code } = await getAssessmentPageList({
-    pageNumber: 1,
-    pageSize: 1000
+  const { data, code } = await getAssessmentList({
+    type: 1
   });
   if (code === 200) {
-    dataList.magList = data.records;
+    dataList.magList = data;
   }
   console.log("await", data);
 };
@@ -73,6 +77,7 @@ const handClickInit1 = value => {
   if (value) {
     const selectedItem = dataList.magList.find(item => item.id === value);
     init.assessmentName = selectedItem.name;
+    getTemplateInfoListApi(selectedItem);
   }
   $emit("handClick", {
     ...dataList.params,
@@ -81,8 +86,11 @@ const handClickInit1 = value => {
 };
 const handClickInit2 = value => {
   if (value) {
-    const selectedItem = dataList.teplist.find(item => item.id === value);
-    init.assessmentModelName = selectedItem.tpName;
+    const selectedItem = dataList.teplist.find(
+      item => item.assessmentModelId === value
+    );
+    init.assessmentModelName = selectedItem.assessmentModelName;
+    userPageWhitOrganizationApi(selectedItem);
   }
   $emit("handClick", {
     ...dataList.params,
@@ -91,6 +99,10 @@ const handClickInit2 = value => {
 };
 const handClickInit3 = value => {
   if (value) {
+    const selectedItem = dataList.teplist.find(
+      item => item.assessmentObjectId === value
+    );
+    init.assessmentObjectName = selectedItem.assessmentObjectName;
     init.deptName = value.deptName;
   }
   $emit("handClick", {
@@ -134,15 +146,15 @@ const handClickInit3 = value => {
           >
             <el-option
               v-for="item in dataList.teplist"
-              :key="item.id"
-              :label="item.tpName"
-              :value="item.id"
+              :key="item.assessmentModelId"
+              :label="item.assessmentModelName"
+              :value="item.assessmentModelId"
             />
           </el-select>
         </div>
         <div class="flex mr-2">
-          <div class="text-sm leading-8 mr-3">科主任</div>
-          <el-tree-select
+          <div class="text-sm leading-8 mr-3">科</div>
+          <!-- <el-tree-select
             v-model="dataList.params.deptCode"
             :data="dataList.deptList"
             check-strictly
@@ -155,7 +167,22 @@ const handClickInit3 = value => {
             }"
             style="width: 200px"
             @change="handClickInit3"
-          />
+          /> -->
+          <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>
         </div>
       </div>
     </div>

+ 2 - 2
src/views/draw/children/department/departmentDrank.vue

@@ -22,12 +22,14 @@ const activeName = ref("1");
 // 排行榜
 const rankTableRef = ref();
 const chartList = ref([]);
+const showLength = ref(0);
 const getChartsListApi = async () => {
   const { code, data } = await getChartsList({
     ...seachParams.value,
     type: 0
   });
   if (code == 200) {
+    showLength.value = data.length;
     setTimeout(() => {
       nextTick(() => {
         rankTableRef.value.init(data, "科室", "姓名");
@@ -43,7 +45,6 @@ const dataList = reactive({
   dimName: []
 });
 const seachParams = ref();
-const showLength = ref(0);
 const getPersonDimensionChartsListApi = async (
   dimensionName?: string,
   dimId?: number | string
@@ -57,7 +58,6 @@ const getPersonDimensionChartsListApi = async (
 
   if (code == 200) {
     if (data.length > 0) {
-      showLength.value = data.length;
       data.dimensionList.map(item => {
         dataList.dimName.push({
           name: item.dimName,

+ 35 - 9
src/views/draw/children/head/componements/seach.vue

@@ -1,9 +1,11 @@
 <script setup>
 import { ref, reactive } from "vue";
 import { getTemplateInfoList } from "@/api/templateInfo";
-import { userPageWhitOrganization } from "@/api/userSetting";
+import { userPageWhitOrganization, getLeaderList } from "@/api/userSetting";
 import { getAssessmentPageList } from "@/api/manage";
 import { postListTree } from "@/api/department";
+import { getAssessmentList } from "@/api/draw";
+
 const $emit = defineEmits(["handClick"]);
 
 const dataList = reactive({
@@ -11,6 +13,7 @@ const dataList = reactive({
   personList: [],
   magList: [],
   deptList: [],
+  leaderList: [],
   params: {
     assessmentId: "",
     assessmentModelId: "",
@@ -42,12 +45,11 @@ const userPageWhitOrganizationApi = async () => {
 userPageWhitOrganizationApi();
 // 考核活动
 const getAssessmentPageListApi = async () => {
-  const { data, code } = await getAssessmentPageList({
-    pageNumber: 1,
-    pageSize: 1000
+  const { data, code } = await getAssessmentList({
+    type: 3
   });
   if (code === 200) {
-    dataList.magList = data.records;
+    dataList.magList = data;
   }
   console.log("await", data);
 };
@@ -61,6 +63,14 @@ const postListTreeApi = async () => {
   console.log("await", data);
 };
 postListTreeApi();
+// 科主任
+const getLeaderListApi = async () => {
+  const { data, code } = await getLeaderList();
+  if (code === 200) {
+    dataList.leaderList = data;
+  }
+};
+getLeaderListApi();
 // ----------------------------
 const init = reactive({
   assessmentName: "",
@@ -91,7 +101,8 @@ const handClickInit2 = value => {
 };
 const handClickInit3 = value => {
   if (value) {
-    init.deptName = value.deptName;
+    const selectedItem = dataList.teplist.find(item => item.userCode === value);
+    init.assessmentObjectName = selectedItem.realName;
   }
   $emit("handClick", {
     ...dataList.params,
@@ -141,8 +152,8 @@ const handClickInit3 = value => {
           </el-select>
         </div>
         <div class="flex mr-2">
-          <div class="text-sm leading-8 mr-3">科</div>
-          <el-tree-select
+          <div class="text-sm leading-8 mr-3">科主任</div>
+          <!-- <el-tree-select
             v-model="dataList.params.deptCode"
             :data="dataList.deptList"
             check-strictly
@@ -155,7 +166,22 @@ const handClickInit3 = value => {
             }"
             style="width: 200px"
             @change="handClickInit3"
-          />
+          /> -->
+          <el-select
+            v-model="dataList.params.assessmentObjectId"
+            clearable
+            filterable
+            placeholder="请选择"
+            style="width: 200px"
+            @change="handClickInit3"
+          >
+            <el-option
+              v-for="item in dataList.leaderList"
+              :key="item.userCode"
+              :label="item.realName"
+              :value="item.userCode"
+            />
+          </el-select>
         </div>
       </div>
     </div>

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

@@ -20,6 +20,7 @@ import type { TabsPaneContext } from "element-plus";
 const router = useRouter();
 const activeName = ref("1");
 // 排行榜
+const showLength = ref(0);
 const chartList = ref([]);
 const getChartsListApi = async () => {
   const { code, data } = await getChartsList({
@@ -27,6 +28,7 @@ const getChartsListApi = async () => {
     type: 0
   });
   if (code == 200) {
+    showLength.value = data.length;
     rankTableRef.value.init(data, "科室", "姓名");
   }
 };
@@ -118,7 +120,7 @@ const fullBig = (item: any) => {
   <div class="w-[100%]">
     <div class="w-[100%]">
       <seachData @handClick="init" />
-      <div v-if="dataList.dimName.length > 0">
+      <div v-if="showLength > 0">
         <div class="flex mr-2">
           <radar ref="radarRef" />
         </div>

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

@@ -5,6 +5,7 @@ import { userPageWhitOrganization } from "@/api/userSetting";
 import { getAssessmentPageList } from "@/api/manage";
 import { postListTree } from "@/api/department";
 import { postPageGroup } from "@/api/userGroup";
+import { getAssessmentList } from "@/api/draw";
 const $emit = defineEmits(["handClick"]);
 
 const dataList = reactive({
@@ -32,12 +33,11 @@ getTemplateInfoListApi();
 
 // 考核活动
 const getAssessmentPageListApi = async () => {
-  const { data, code } = await getAssessmentPageList({
-    pageNumber: 1,
-    pageSize: 1000
+  const { data, code } = await getAssessmentList({
+    type: 2
   });
   if (code === 200) {
-    dataList.magList = data.records;
+    dataList.magList = data;
   }
   console.log("await", data);
 };
@@ -83,7 +83,7 @@ const handClickInit2 = value => {
 };
 const handClickInit3 = value => {
   if (value) {
-    const selectedItem = dataList.magList.find(
+    const selectedItem = dataList.userList.find(
       item => item.groupCode === value
     );
     init.deptName = selectedItem.groupName;

+ 3 - 1
src/views/draw/children/health/healthDrank.vue

@@ -25,6 +25,7 @@ const barEchartsRef = ref();
 const barDimEchartsRef = ref();
 const seachParams = ref();
 // 排行榜
+const showLength = ref(0);
 const chartList = ref([]);
 const getChartsListApi = async () => {
   const { code, data } = await getChartsList({
@@ -32,6 +33,7 @@ const getChartsListApi = async () => {
     type: 0
   });
   if (code == 200) {
+    showLength.value = data.length;
     rankTableRef.value.init(data, "医疗组");
   }
 };
@@ -120,7 +122,7 @@ const fullBig = (item: any) => {
   <div class="w-[100%]">
     <div class="w-[100%]">
       <seachData @handClick="init" />
-      <div v-if="dataList.dimName.length > 0">
+      <div v-if="showLength.length > 0">
         <div class="flex mr-2">
           <radar ref="radarRef" />
         </div>

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

@@ -4,6 +4,8 @@ import { getTemplateInfoList } from "@/api/templateInfo";
 import { userPageWhitOrganization } from "@/api/userSetting";
 import { getAssessmentPageList } from "@/api/manage";
 import { postListTree } from "@/api/department";
+import { getAssessmentList } from "@/api/draw";
+
 const value = ref("");
 const $emit = defineEmits(["handClick"]);
 const dataList = reactive({
@@ -44,14 +46,12 @@ const userPageWhitOrganizationApi = async () => {
 userPageWhitOrganizationApi();
 // 考核活动
 const getAssessmentPageListApi = async () => {
-  const { data, code } = await getAssessmentPageList({
-    pageNumber: 1,
-    pageSize: 1000
+  const { data, code } = await getAssessmentList({
+    type: 0
   });
   if (code === 200) {
-    dataList.magList = data.records;
+    dataList.magList = data;
   }
-  console.log("await", data);
 };
 getAssessmentPageListApi();
 // 部门

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

@@ -26,6 +26,7 @@ const barEchartsRef = ref();
 const barDimEchartsRef = ref();
 const seachParams = ref();
 // 排行榜
+const showLength = ref(0);
 const chartList = ref([]);
 const getChartsListApi = async () => {
   const { code, data } = await getChartsList({
@@ -33,6 +34,7 @@ const getChartsListApi = async () => {
     type: 0
   });
   if (code == 200) {
+    showLength.value = data.length;
     rankTableRef.value.init(data, "科室", "姓名");
   }
 };
@@ -119,7 +121,7 @@ const fullBig = (item: any) => {
   <div class="w-[100%]">
     <div class="w-[100%]">
       <seachData @handClick="init" />
-      <div v-if="dataList.dimName.length > 0">
+      <div v-if="showLength > 0">
         <div class="flex mr-2">
           <radar ref="radarRef" />
         </div>