From 27c8277d717b34b55f3ea967027b53b067f77df3 Mon Sep 17 00:00:00 2001
From: xiaoyi <908147524@qq.com>
Date: 星期四, 20 八月 2026 16:58:49 +0800
Subject: [PATCH] feat 功能变更

---
 src/views/hrm/performance-appraise/modules/result.vue |  138 ++++++++++++++++++++++++++++++++++++++++++++++
 1 files changed, 138 insertions(+), 0 deletions(-)

diff --git a/src/views/hrm/performance-appraise/modules/result.vue b/src/views/hrm/performance-appraise/modules/result.vue
new file mode 100644
index 0000000..ab45867
--- /dev/null
+++ b/src/views/hrm/performance-appraise/modules/result.vue
@@ -0,0 +1,138 @@
+<script lang="ts" setup>
+import type { HrmPerformanceAppraiseApi } from '#/api/hrm/performance-appraise';
+
+import { ref } from 'vue';
+
+import { useVbenModal } from '@vben/common-ui';
+
+import { Modal } from 'ant-design-vue';
+
+import { DICT_TYPE } from '@vben/constants';
+import { getDictLabel } from '@vben/hooks';
+
+import { getAppraiseResultPage } from '#/api/hrm/performance-appraise';
+
+const emit = defineEmits(['success']);
+
+const appraiseId = ref<number>();
+const resultList = ref<HrmPerformanceAppraiseApi.AppraiseResult[]>([]);
+const total = ref(0);
+const pageNo = ref(1);
+const pageSize = ref(10);
+const loading = ref(false);
+
+const detailOpen = ref(false);
+const detailRows = ref<HrmPerformanceAppraiseApi.ResultItem[]>([]);
+
+function getGradeLabel(grade?: number): string {
+  return grade == null ? '-' : getDictLabel(DICT_TYPE.HRM_PERFORMANCE_GRADE, grade);
+}
+
+async function loadResults() {
+  loading.value = true;
+  try {
+    const data = await getAppraiseResultPage({
+      appraiseId: appraiseId.value!,
+      pageNo: pageNo.value,
+      pageSize: pageSize.value,
+    });
+    resultList.value = data.list ?? [];
+    total.value = data.total ?? 0;
+  } finally {
+    loading.value = false;
+  }
+}
+
+function handlePageChange(page: number, size: number) {
+  pageNo.value = page;
+  pageSize.value = size;
+  loadResults();
+}
+
+function handleDetail(row: HrmPerformanceAppraiseApi.AppraiseResult) {
+  detailRows.value = row.items ?? [];
+  detailOpen.value = true;
+}
+
+const [ModalRoot, modalApi] = useVbenModal({
+  async onOpenChange(isOpen: boolean) {
+    if (!isOpen) {
+      appraiseId.value = undefined;
+      resultList.value = [];
+      total.value = 0;
+      pageNo.value = 1;
+      return;
+    }
+    const data = modalApi.getData<{ id: number }>();
+    appraiseId.value = data?.id;
+    await loadResults();
+  },
+});
+</script>
+
+<template>
+  <ModalRoot title="鑰冩牳缁撴灉" class="w-3/4">
+    <div class="mb-3 text-sm text-gray-500">
+      缁煎悎寰楀垎 = 危(鏉冮噸 脳 鍗曟寚鏍囧緱鍒�) / 危鏉冮噸锛涙。绾� 鈮�90 浼樼 / 鈮�80 鑹ソ / 鈮�60 鍚堟牸 / &lt;60 寰呮敼杩�
+    </div>
+    <a-table
+      :data-source="resultList"
+      :loading="loading"
+      :pagination="{
+        current: pageNo,
+        pageSize,
+        total,
+        showSizeChanger: true,
+        showTotal: (t: number) => `鍏� ${t} 浜篳,
+      }"
+      :scroll="{ y: 380 }"
+      bordered
+      row-key="id"
+      size="small"
+      @change="(pag: { current?: number; pageSize?: number }) =>
+        handlePageChange(pag.current ?? 1, pag.pageSize ?? 10)"
+    >
+      <a-table-column title="鍛樺伐" data-index="employeeName" min-width="120" />
+      <a-table-column title="鑷瘎鎬诲垎" data-index="selfScore" width="100" />
+      <a-table-column title="涓婄骇璇勬�诲垎" data-index="superiorScore" width="110" />
+      <a-table-column title="缁煎悎寰楀垎" data-index="finalScore" width="100">
+        <template #default="{ record }">
+          <span class="font-medium">{{ record.finalScore ?? '-' }}</span>
+        </template>
+      </a-table-column>
+      <a-table-column title="妗g骇" width="90">
+        <template #default="{ record }">
+          <a-tag :color="record.grade === 1 ? 'success' : record.grade === 2 ? 'processing' : record.grade === 3 ? 'warning' : 'error'">
+            {{ getGradeLabel(record.grade) }}
+          </a-tag>
+        </template>
+      </a-table-column>
+      <a-table-column title="璇勮" data-index="comment" min-width="160" ellipsis />
+      <a-table-column title="鎿嶄綔" width="90" align="center">
+        <template #default="{ record }">
+          <a-button type="link" @click="handleDetail(record)">鏄庣粏</a-button>
+        </template>
+      </a-table-column>
+    </a-table>
+
+    <Modal
+      v-model:open="detailOpen"
+      title="鎸囨爣璇勫垎鏄庣粏"
+      width="640px"
+      :footer="null"
+    >
+      <a-table
+        :data-source="detailRows"
+        :pagination="false"
+        bordered
+        row-key="id"
+        size="small"
+      >
+        <a-table-column title="鎸囨爣鍚嶇О" data-index="itemName" min-width="160" />
+        <a-table-column title="鏉冮噸" data-index="weight" width="90" />
+        <a-table-column title="鑷瘎寰楀垎" data-index="selfScore" width="100" />
+        <a-table-column title="涓婄骇璇勫緱鍒�" data-index="superiorScore" width="110" />
+      </a-table>
+    </Modal>
+  </ModalRoot>
+</template>

--
Gitblit v1.9.3