riku
2024-07-08 8756117a473facf0bf64c9e28f821b52e46cce85
src/views/management/EvaluateSummary.vue
@@ -1,7 +1,7 @@
<template>
  <div class="border-r-small">
    <div class="font-large">风险评估</div>
    <el-row justify="space-evenly">
    <div ref="titleRef" class="font-large">综合风险评估</div>
    <el-row ref="statisticRef" justify="space-evenly">
      <el-statistic title="高风险" :value="10"> </el-statistic>
      <el-statistic title="中风险" :value="10"> </el-statistic>
      <el-statistic title="低风险" :value="10"> </el-statistic>
@@ -26,23 +26,50 @@
      </el-table-column>
      <el-table-column prop="score" :show-overflow-tooltip="true" label="评分" width="60">
      </el-table-column>
      <el-table-column prop="score" :show-overflow-tooltip="true" label="风险" width="60">
      <el-table-column prop="risk" :show-overflow-tooltip="true" label="风险" width="60">
      </el-table-column>
      <!-- <el-table-column prop="recheck" :show-overflow-tooltip="true" label="复核" width="60">
      </el-table-column> -->
    </el-table>
  </div>
</template>
<script>
import { unCalc } from '@/utils/css-util'
/**
 * 对完成的任务进行评估风险,显示高风险场景,显示复核的场景的情况
 */
export default {
  props: {
    height: {
      type: String,
      default: '200'
    }
  },
  data() {
    return {
      tableData: []
      tableData: [],
      tableHeight: '200'
    }
  },
  watch: {
    height(nV, oV) {
      if (nV != oV) {
        this.tableHeight = this.calcTableHeight()
      }
    }
  },
  methods: {
    calcTableHeight() {
      const h1 = this.$refs.titleRef.offsetHeight
      const h2 = this.$refs.statisticRef.$el.offsetHeight
      const h = h1 + h2
      const r = `calc(${unCalc(this.height)} - ${h}px)`
      return r
    }
  },
  mounted() {
    this.tableHeight = this.calcTableHeight()
    let i = 0
    while (i < 20) {
      this.tableData.push({
@@ -56,7 +83,9 @@
        status: '已结束',
        total: 4,
        checked: 2,
        score: 90
        score: 90,
        risk: '高',
        recheck: 1
      })
      i++
    }