Riku
2025-09-20 32eedf2857255cf29985ffc0cc73e75eccda39bf
src/views/fysp/data-product/middle-data-product/ProdEvaluationSummary.vue
@@ -6,6 +6,57 @@
    @onStep3="onStep3"
    :loading="loading"
  >
    <template #step2="{ contentHeight }">
      <el-table
        id="prod-evaluation-summary-table"
        :data="tableData"
        v-loading="loading"
        :height="contentHeight + 'px'"
        table-layout="fixed"
        :show-overflow-tooltip="true"
        size="small"
        border
      >
        <el-table-column fixed="left" prop="index" label="排名" width="50">
        </el-table-column>
        <el-table-column prop="townName" label="街镇" min-width="110" />
        <el-table-column
          prop="validSceneCount"
          label="建设中工地数"
          min-width="90"
        >
        </el-table-column>
        <el-table-column
          prop="evaluationCount"
          label="评估点次"
          min-width="50"
        />
        <el-table-column label="防治规范性点次评估" min-width="60">
          <el-table-column prop="evalLevelACount" label="规范" min-width="50" />
          <el-table-column
            prop="evalLevelBCount"
            label="基本规范"
            min-width="50"
          />
          <el-table-column
            prop="evalLevelCCount"
            label="不规范"
            min-width="50"
          />
          <el-table-column
            prop="evalLevelDCount"
            label="严重不规范"
            min-width="50"
          />
        </el-table-column>
        <el-table-column
          prop="evalLevelRatioAB"
          label="规范及基本规范评估占比"
          min-width="90"
          :formatter="ratioFormat"
        />
      </el-table>
    </template>
  </BaseProdProcess>
</template>
<script setup>
@@ -17,12 +68,48 @@
const { active, changeActive } = useProdStepChange();
const loading = ref(false);
const tableData = ref([]);
function onStep1(opt) {}
function onStep1(opt) {
  loading.value = true;
  dataprodmiddleApi
    .fetchEvaluationByArea(opt)
    .then((res) => {
      if (res.success) {
        tableData.value = res.data
          .sort((a, b) => {
            return b.evalLevelRatioAB - a.evalLevelRatioAB;
          })
          .map((item, index) => {
            return {
              ...item,
              index: index + 1
            };
          });
      }
      changeActive();
    })
    .finally(() => {
      loading.value = false;
    });
}
function onStep2() {
  changeActive();
}
function onStep3(val) {}
function onStep3(val) {
  if (val.downloadType == '1') {
    loading.value = true;
    conversionFromTable(
      'prod-evaluation-summary-table',
      '扬尘污染问题类型占比清单'
    );
    loading.value = false;
  }
}
function ratioFormat(row, column, cellValue, index) {
  return Math.round(cellValue * 1000) / 10 + '%';
}
</script>