Browse Source

fix: 清空云效bug

haifeng.zhang 3 weeks ago
parent
commit
435787b275

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

@@ -271,7 +271,7 @@ defineExpose({
 const tabTitle = ref();
 const createColumns = () => {
   let columns = [];
-  if ($route.name == "workerDrak") {
+  if ($route.name == "workerDrak" || $route.name == "headDrank") {
     columns = [
       {
         title: "排名",
@@ -390,7 +390,7 @@ const createColumns = () => {
   // 构建多级表头
   headerMap.forEach((dimData, dimName) => {
     const children = dimData.quotas.map(quota => ({
-      title: `${quota.quotaName} (${quota.quotaWeight}%)`, // 在 title 后拼接 quotaWeight
+      title: `${quota.quotaName} ${quota.quotaWeight && quota.quotaWeight != "0" ? `(${quota.quotaWeight}%)` : ""}`, // 在 title 后拼接 quotaWeight
       width: 120,
       sortable: true,
       field: `${dimName}_${quota.quotaName}`, // 确保字段唯一
@@ -429,7 +429,7 @@ const createColumns = () => {
 
     // 添加维度名称及其对应的子列
     columns.push({
-      title: `${dimName} (${dimData.dimWeight}%)`, // 在 title 后拼接 dimWeight
+      title: `${dimName} ${dimData.dimWeight && dimData.dimWeight != "0" ? `(${dimData.dimWeight}%)` : ""}`, // 在 title 后拼接 dimWeight
       children
     });
 

+ 8 - 3
src/components/rankTable/index.vue

@@ -136,7 +136,12 @@ function getValueByKey(obj, key) {
 // 生成动态表头
 const createColumns = () => {
   let columns = [];
-  if ($route.name == "workerRank") {
+  console.log($route.name, "nnnnnn");
+  if (
+    $route.name == "workerDataDetail" ||
+    $route.name === "headDataDetail" ||
+    $route.name === "headDrank"
+  ) {
     columns = [
       {
         title: "排名",
@@ -254,7 +259,7 @@ const createColumns = () => {
   // 构建多级表头
   headerMap.forEach((dimData, dimName) => {
     const children = dimData.quotas.map(quota => ({
-      title: `${quota.quotaName} (${quota.quotaWeight}%)`, // 在 title 后拼接 quotaWeight
+      title: `${quota.quotaName} ${quota.quotaWeight != "null" && quota.quotaWeight != "0" ? `(${quota.quotaWeight}%)` : ""}`, // 在 title 后拼接 quotaWeight
       width: 120,
       sortable: true,
       field: `${dimName}_${quota.quotaName}`, // 确保字段唯一
@@ -293,7 +298,7 @@ const createColumns = () => {
 
     // 添加维度名称及其对应的子列
     columns.push({
-      title: `${dimName} (${dimData.dimWeight}%)`, // 在 title 后拼接 dimWeight
+      title: `${dimName} ${dimData.dimWeight != "null" && dimData.dimWeight != "0" ? `(${dimData.dimWeight}%)` : ""}`, // 在 title 后拼接 dimWeight
       children
     });
 

+ 26 - 9
src/layout/components/sidebar/mixNav.vue

@@ -6,7 +6,7 @@ import { useRouter } from "vue-router";
 import FullScreen from "./fullScreen.vue";
 import { isAllEmpty } from "@pureadmin/utils";
 import { useNav } from "@/layout/hooks/useNav";
-import { ref, toRaw, watch, onMounted, nextTick } from "vue";
+import { ref, toRaw, watch, onMounted, nextTick, computed } from "vue";
 import { useRenderIcon } from "@/components/ReIcon/src/hooks";
 import { getParentPaths, findRouteByPath } from "@/router/utils";
 import { usePermissionStoreHook } from "@/store/modules/permission";
@@ -17,12 +17,24 @@ const router = useRouter();
 const menuRef = ref();
 // 过滤父级菜单
 const menuActiveRef = ref([]);
-usePermissionStoreHook().wholeMenus.forEach(item => {
-  if (item.meta.filterMenu) {
-  } else {
-    menuActiveRef.value.push(item);
-  }
-});
+const menuNew = computed(() => usePermissionStoreHook().wholeMenus);
+watch(
+  menuNew,
+  newVal => {
+    usePermissionStoreHookList(newVal);
+  },
+  { deep: true }
+);
+const usePermissionStoreHookList = (arr = []) => {
+  const list = arr && arr.length ? arr : usePermissionStoreHook().wholeMenus;
+  list.forEach(item => {
+    if (item.meta.filterMenu) {
+    } else {
+      menuActiveRef.value.push(item);
+    }
+  });
+};
+
 // -
 const defaultActive = ref(null);
 
@@ -51,6 +63,7 @@ const nameData = ref();
 onMounted(() => {
   getDefaultActive(route.path);
   nameData.value = localStorage.getItem("userName");
+  usePermissionStoreHookList();
   // console.log("route.path", usePermissionStoreHook().wholeMenus);
 });
 
@@ -124,7 +137,9 @@ const open = () => {
           <!-- <img :src="userAvatar" :style="avatarsStyle" /> -->
           <!-- <p v-if="username" class="dark:text-white">{{ username }}</p> -->
           <p v-if="nameData" class="icon-img">
-            <el-icon><Avatar /></el-icon>
+            <el-icon>
+              <Avatar />
+            </el-icon>
           </p>
           <p class="ml-0.5">{{ nameData }}</p>
         </span>
@@ -196,7 +211,9 @@ const open = () => {
   // border: 1px solid red;
   // height: 30px;
   margin-right: 10px;
-  font-size: 12px !important; /* 修改菜单项的字体大小 */
+  font-size: 12px !important;
+
+  /* 修改菜单项的字体大小 */
   text-align: center;
 }
 

+ 34 - 3
src/views/draw/children/department/departmentRank.vue

@@ -16,8 +16,13 @@ import { useAppStoreHook } from "@/store/modules/app";
 // 考核活动点击交互
 const activityList: any = ref([]);
 const activeActivity = ref(0);
+const activeObj = ref({});
+const myTable = ref(null);
 const handleActiveActivity = (item: any, index: number) => {
+  tableData.value = [];
+  myTable.value && myTable.value.clearSort();
   activeActivity.value = index;
+  activeObj.value = item;
   getPageScoreInfoByAssessmentApi(item);
 };
 
@@ -57,10 +62,14 @@ const handleSearch = () => {
 const searchKeyword = ref("");
 const averageScore = ref<number | string>(0);
 const tableData = ref<any>([]);
-const getPageScoreInfoByAssessmentApi = async (obj: any = {}) => {
+const getPageScoreInfoByAssessmentApi = async (
+  obj: any = {},
+  sort: any = {}
+) => {
   const params = {
     assessmentId: obj.id,
-    assessmentType: `${obj.assessmentType}`
+    assessmentType: `${obj.assessmentType}`,
+    ...sort
   };
   const { code, msg, data = [] } = await getPageScoreInfoByAssessment(params);
   if (code === 200) {
@@ -98,6 +107,21 @@ const toDetail = (row: any = {}) => {
   });
   useAppStoreHook().toggleSideBar(false, "关闭");
 };
+
+// 倒叙
+const handleSortChange = ({ column, prop, order }) => {
+  fetchSortedData(order);
+};
+const fetchSortedData = sortOrder => {
+  console.log(sortOrder, "sssss");
+  let params: any = {};
+  if (sortOrder) {
+    params.type = sortOrder === "ascending" ? 1 : 2; // 1 从低到高 2从高到底
+  } else {
+    params = {};
+  }
+  getPageScoreInfoByAssessmentApi(activeObj.value, params);
+};
 </script>
 
 <template>
@@ -131,7 +155,13 @@ const toDetail = (row: any = {}) => {
         </div>
       </template>
 
-      <el-table :data="tableData" style="width: 100%" border>
+      <el-table
+        ref="myTable"
+        :data="tableData"
+        style="width: 100%"
+        border
+        @sort-change="handleSortChange"
+      >
         <el-table-column type="index" label="排名" width="80" align="center" />
         <el-table-column prop="templateName" label="考核模板" min-width="200">
           <template #default="{ row }">
@@ -152,6 +182,7 @@ const toDetail = (row: any = {}) => {
           label="实际得分"
           width="120"
           align="right"
+          sortable="custom"
         />
       </el-table>
     </el-card>

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

@@ -1,6 +1,6 @@
 <script setup lang="ts">
 defineOptions({
-  name: "healthDrank"
+  name: "headDrank"
 });
 import { ref, reactive, nextTick } from "vue";
 import { useRouter } from "vue-router";

+ 34 - 3
src/views/draw/children/head/headRank.vue

@@ -16,8 +16,13 @@ import { useAppStoreHook } from "@/store/modules/app";
 // 考核活动点击交互
 const activityList: any = ref([]);
 const activeActivity = ref(0);
+const activeObj = ref({});
+const myTable = ref(null);
 const handleActiveActivity = (item: any, index: number) => {
+  tableData.value = [];
+  myTable.value && myTable.value.clearSort();
   activeActivity.value = index;
+  activeObj.value = item;
   getPageScoreInfoByAssessmentApi(item);
 };
 
@@ -57,10 +62,14 @@ const handleSearch = () => {
 const searchKeyword = ref("");
 const averageScore = ref<number | string>(0);
 const tableData = ref<any>([]);
-const getPageScoreInfoByAssessmentApi = async (obj: any = {}) => {
+const getPageScoreInfoByAssessmentApi = async (
+  obj: any = {},
+  sort: any = {}
+) => {
   const params = {
     assessmentId: obj.id,
-    assessmentType: `${obj.assessmentType}`
+    assessmentType: `${obj.assessmentType}`,
+    ...sort
   };
   const { code, msg, data = [] } = await getPageScoreInfoByAssessment(params);
   if (code === 200) {
@@ -98,6 +107,21 @@ const toDetail = (row: any = {}) => {
   });
   useAppStoreHook().toggleSideBar(false, "关闭");
 };
+
+// 倒叙
+const handleSortChange = ({ column, prop, order }) => {
+  fetchSortedData(order);
+};
+const fetchSortedData = sortOrder => {
+  console.log(sortOrder, "sssss");
+  let params: any = {};
+  if (sortOrder) {
+    params.type = sortOrder === "ascending" ? 1 : 2; // 1 从低到高 2从高到底
+  } else {
+    params = {};
+  }
+  getPageScoreInfoByAssessmentApi(activeObj.value, params);
+};
 </script>
 
 <template>
@@ -131,7 +155,13 @@ const toDetail = (row: any = {}) => {
         </div>
       </template>
 
-      <el-table :data="tableData" style="width: 100%" border>
+      <el-table
+        ref="myTable"
+        :data="tableData"
+        style="width: 100%"
+        border
+        @sort-change="handleSortChange"
+      >
         <el-table-column type="index" label="排名" width="80" align="center" />
         <el-table-column prop="templateName" label="考核模板" min-width="200">
           <template #default="{ row }">
@@ -153,6 +183,7 @@ const toDetail = (row: any = {}) => {
           label="实际得分"
           width="120"
           align="right"
+          sortable="custom"
         />
       </el-table>
     </el-card>

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

@@ -1,6 +1,6 @@
 <script setup lang="ts">
 defineOptions({
-  name: "headDrank"
+  name: "healthDrank"
 });
 import { ref, reactive, nextTick } from "vue";
 import { useRouter } from "vue-router";

+ 34 - 3
src/views/draw/children/health/healthRank.vue

@@ -16,8 +16,13 @@ import { useAppStoreHook } from "@/store/modules/app";
 // 考核活动点击交互
 const activityList: any = ref([]);
 const activeActivity = ref(0);
+const activeObj = ref({});
+const myTable = ref(null);
 const handleActiveActivity = (item: any, index: number) => {
+  tableData.value = [];
+  myTable.value && myTable.value.clearSort();
   activeActivity.value = index;
+  activeObj.value = item;
   getPageScoreInfoByAssessmentApi(item);
 };
 
@@ -57,10 +62,14 @@ const handleSearch = () => {
 const searchKeyword = ref("");
 const averageScore = ref<number | string>(0);
 const tableData = ref<any>([]);
-const getPageScoreInfoByAssessmentApi = async (obj: any = {}) => {
+const getPageScoreInfoByAssessmentApi = async (
+  obj: any = {},
+  sort: any = {}
+) => {
   const params = {
     assessmentId: obj.id,
-    assessmentType: `${obj.assessmentType}`
+    assessmentType: `${obj.assessmentType}`,
+    ...sort
   };
   const { code, msg, data = [] } = await getPageScoreInfoByAssessment(params);
   if (code === 200) {
@@ -98,6 +107,21 @@ const toDetail = (row: any = {}) => {
   });
   useAppStoreHook().toggleSideBar(false, "关闭");
 };
+
+// 倒叙
+const handleSortChange = ({ column, prop, order }) => {
+  fetchSortedData(order);
+};
+const fetchSortedData = sortOrder => {
+  console.log(sortOrder, "sssss");
+  let params: any = {};
+  if (sortOrder) {
+    params.type = sortOrder === "ascending" ? 1 : 2; // 1 从低到高 2从高到底
+  } else {
+    params = {};
+  }
+  getPageScoreInfoByAssessmentApi(activeObj.value, params);
+};
 </script>
 
 <template>
@@ -131,7 +155,13 @@ const toDetail = (row: any = {}) => {
         </div>
       </template>
 
-      <el-table :data="tableData" style="width: 100%" border>
+      <el-table
+        ref="myTable"
+        :data="tableData"
+        style="width: 100%"
+        border
+        @sort-change="handleSortChange"
+      >
         <el-table-column type="index" label="排名" width="80" align="center" />
         <el-table-column prop="templateName" label="考核模板" min-width="200">
           <template #default="{ row }">
@@ -152,6 +182,7 @@ const toDetail = (row: any = {}) => {
           label="实际得分"
           width="120"
           align="right"
+          sortable="custom"
         />
       </el-table>
     </el-card>

+ 34 - 3
src/views/draw/children/worker/workerRank.vue

@@ -16,8 +16,13 @@ import { useAppStoreHook } from "@/store/modules/app";
 // 考核活动点击交互
 const activityList: any = ref([]);
 const activeActivity = ref(0);
+const activeObj = ref({});
+const myTable = ref(null);
 const handleActiveActivity = (item: any, index: number) => {
+  tableData.value = [];
+  myTable.value && myTable.value.clearSort();
   activeActivity.value = index;
+  activeObj.value = item;
   getPageScoreInfoByAssessmentApi(item);
 };
 
@@ -57,10 +62,14 @@ const handleSearch = () => {
 const searchKeyword = ref("");
 const averageScore = ref<number | string>(0);
 const tableData = ref<any>([]);
-const getPageScoreInfoByAssessmentApi = async (obj: any = {}) => {
+const getPageScoreInfoByAssessmentApi = async (
+  obj: any = {},
+  sort: any = {}
+) => {
   const params = {
     assessmentId: obj.id,
-    assessmentType: `${obj.assessmentType}`
+    assessmentType: `${obj.assessmentType}`,
+    ...sort
   };
   const { code, msg, data = [] } = await getPageScoreInfoByAssessment(params);
   if (code === 200) {
@@ -98,6 +107,21 @@ const toDetail = (row: any = {}) => {
   });
   useAppStoreHook().toggleSideBar(false, "关闭");
 };
+
+// 倒叙
+const handleSortChange = ({ column, prop, order }) => {
+  fetchSortedData(order);
+};
+const fetchSortedData = sortOrder => {
+  console.log(sortOrder, "sssss");
+  let params: any = {};
+  if (sortOrder) {
+    params.type = sortOrder === "ascending" ? 1 : 2; // 1 从低到高 2从高到底
+  } else {
+    params = {};
+  }
+  getPageScoreInfoByAssessmentApi(activeObj.value, params);
+};
 </script>
 
 <template>
@@ -131,7 +155,13 @@ const toDetail = (row: any = {}) => {
         </div>
       </template>
 
-      <el-table :data="tableData" style="width: 100%" border>
+      <el-table
+        ref="myTable"
+        :data="tableData"
+        style="width: 100%"
+        border
+        @sort-change="handleSortChange"
+      >
         <el-table-column type="index" label="排名" width="80" align="center" />
         <el-table-column prop="templateName" label="考核模板" min-width="200">
           <template #default="{ row }">
@@ -153,6 +183,7 @@ const toDetail = (row: any = {}) => {
           label="实际得分"
           width="120"
           align="right"
+          sortable="custom"
         />
       </el-table>
     </el-card>

+ 5 - 17
src/views/evaluate/children/change/mould/message.vue

@@ -270,25 +270,16 @@ const getAssessmentDetailsApi = async () => {
       groupedData.push(modelIdMap[modelId]);
     }
     // 打印结果
-    console.log(groupedData);
+    console.log(groupedData, 2222);
     assessmentObjectList.value = groupedData;
-    if (form.assessmentModelList && form.assessmentModelList.length > 0) {
+    if (form.assessmentObjectList && form.assessmentObjectList.length > 0) {
       form.assessmentObjectList.map(item => {
-        // assessmentObjectList.value.push({
-        //   assessmentObjectId: item.assessmentObjectId,
-        //   assessmentObjectName: item.assessmentObjectName
-        // });
         assessmentModelList.value.push({
           assessmentModelId: item.assessmentModelId,
           assessmentModelName: item.assessmentModelName
         });
       });
     }
-    // assessmentObjectList.value = Array.from(
-    //   new Map(
-    //     assessmentObjectList.value.map(item => [item.assessmentObjectId, item])
-    //   ).values()
-    // );
     assessmentModelList.value = Array.from(
       new Map(
         assessmentModelList.value.map(item => [item.assessmentModelId, item])
@@ -474,9 +465,6 @@ onMounted(() => {
                       :value="it.assessmentObjectId"
                     />
                   </el-select> -->
-                  {{
-                    console.log("assessmentObjectList", assessmentObjectList)
-                  }}
                   <div
                     v-for="(item, index) in assessmentObjectList"
                     :key="index"
@@ -497,7 +485,7 @@ onMounted(() => {
               :rules="formRightRules"
             >
               <el-form-item label="考核模板" prop="right">
-                <div class="w-full flex flex-wrap mt-1 aaa">
+                <div class="w-full flex flex-wrap mt-1">
                   <!-- <el-select
                     v-model="item.assessmentModelId"
                     disabled
@@ -515,9 +503,9 @@ onMounted(() => {
                   <div
                     v-for="(item, index) in assessmentModelList"
                     :key="index"
-                    class="text-gray-400"
+                    class="text-gray-400 w-full flex flex-wrap object mt-1"
                   >
-                    <div class="mt-2">{{ item.assessmentModelName }}</div>
+                    <div>{{ item.assessmentModelName }}</div>
                   </div>
                 </div>
               </el-form-item>

+ 1 - 2
src/views/indexData/components/addDialog.vue

@@ -251,9 +251,8 @@ const disabledFirstDayOfMonth = time => {
         <el-form-item label="数据时间" prop="specificTime">
           <el-date-picker
             v-model="form.specificTime"
-            type="date"
+            type="month"
             placeholder="请选择日期"
-            :disabled-date="disabledFirstDayOfMonth"
           />
         </el-form-item>
       </el-form>