<template>
  <Dialog title="绩效考核详情" v-model="show" width="1200px">
    <el-table :data="list" border stripe>
      <el-table-column prop="examineTarget" label="考核指标" width="100" />
      <el-table-column prop="typeName" label="分值模式" width="90" />
      <el-table-column prop="weight" label="权重%" width="90" />
      <el-table-column label="考核内容">
        <template #default="{ row }">
          <div v-dompurify-html="row.examineContent"></div>
        </template>
      </el-table-column>
      <el-table-column label="考核规则" prop="examineRule">
        <template #default="{ row }">
          <div v-dompurify-html="row.examineRule"></div>
        </template>
      </el-table-column>
      <el-table-column label="评分上限" prop="examineScore" width="90" />
      <el-table-column label="考核评分" width="90" prop="score" />
      <el-table-column label="评分备注" width="90" prop="remark" />
      <el-table-column label="加权得分" prop="weightSocre" width="90" />
    </el-table>

    <template #footer>
      <span>
        <el-button @click="show = false">关 闭</el-button>
      </span>
    </template>
  </Dialog>
</template>

<script setup name="DialogScoreDetail">
import * as KpiApi from '@/api/kpi/score.js'

const show = ref(false)
const list = ref([])

async function open(id) {
  show.value = true
  try {
    const data = await KpiApi.getScoreDetail({ id })
    list.value = data.list
  } finally {
  }
}
defineExpose({ open }) // 提供 open 方法，用于打开弹窗
</script>

<style lang="scss" scoped></style>
