Ver código fonte

fix: 根据接口字段

haifeng.zhang 2 dias atrás
pai
commit
071324a73d

+ 10 - 2
src/views/draw/children/department/departmentRank.vue

@@ -77,7 +77,11 @@ const getPageScoreInfoByAssessmentApi = async (
     if (tableData.value.length) {
       let allCount = 0;
       tableData.value.forEach(item => {
-        allCount += item.score ? Number(item.score) : 0;
+        if (item.changeScore) {
+          allCount += Number(item.changeScore);
+        } else if (item.score) {
+          allCount += Number(item.score);
+        }
       });
       let resultNum: number | string = allCount / tableData.value.length;
       if (
@@ -183,7 +187,11 @@ const fetchSortedData = sortOrder => {
           width="120"
           align="right"
           sortable="custom"
-        />
+        >
+          <template #default="{ row }">
+            <span>{{ row.changeScore || row.score }}</span>
+          </template>
+        </el-table-column>
       </el-table>
     </el-card>
   </div>

+ 10 - 2
src/views/draw/children/head/headRank.vue

@@ -77,7 +77,11 @@ const getPageScoreInfoByAssessmentApi = async (
     if (tableData.value.length) {
       let allCount = 0;
       tableData.value.forEach(item => {
-        allCount += item.score ? Number(item.score) : 0;
+        if (item.changeScore) {
+          allCount += Number(item.changeScore);
+        } else if (item.score) {
+          allCount += Number(item.score);
+        }
       });
       let resultNum: number | string = allCount / tableData.value.length;
       if (
@@ -184,7 +188,11 @@ const fetchSortedData = sortOrder => {
           width="120"
           align="right"
           sortable="custom"
-        />
+        >
+          <template #default="{ row }">
+            <span>{{ row.changeScore || row.score }}</span>
+          </template>
+        </el-table-column>
       </el-table>
     </el-card>
   </div>

+ 10 - 2
src/views/draw/children/health/healthRank.vue

@@ -77,7 +77,11 @@ const getPageScoreInfoByAssessmentApi = async (
     if (tableData.value.length) {
       let allCount = 0;
       tableData.value.forEach(item => {
-        allCount += item.score ? Number(item.score) : 0;
+        if (item.changeScore) {
+          allCount += Number(item.changeScore);
+        } else if (item.score) {
+          allCount += Number(item.score);
+        }
       });
       let resultNum: number | string = allCount / tableData.value.length;
       if (
@@ -183,7 +187,11 @@ const fetchSortedData = sortOrder => {
           width="120"
           align="right"
           sortable="custom"
-        />
+        >
+          <template #default="{ row }">
+            <span>{{ row.changeScore || row.score }}</span>
+          </template>
+        </el-table-column>
       </el-table>
     </el-card>
   </div>

+ 10 - 2
src/views/draw/children/worker/workerRank.vue

@@ -77,7 +77,11 @@ const getPageScoreInfoByAssessmentApi = async (
     if (tableData.value.length) {
       let allCount = 0;
       tableData.value.forEach(item => {
-        allCount += item.score ? Number(item.score) : 0;
+        if (item.changeScore) {
+          allCount += Number(item.changeScore);
+        } else if (item.score) {
+          allCount += Number(item.score);
+        }
       });
       let resultNum: number | string = allCount / tableData.value.length;
       if (
@@ -184,7 +188,11 @@ const fetchSortedData = sortOrder => {
           width="120"
           align="right"
           sortable="custom"
-        />
+        >
+          <template #default="{ row }">
+            <span>{{ row.changeScore || row.score }}</span>
+          </template>
+        </el-table-column>
       </el-table>
     </el-card>
   </div>