riku
2024-09-27 1abb6a9ca01cc76f271542a063d1b19839448019
src/views/fysp/evaluation/EvalutationRecord.vue
@@ -1,7 +1,12 @@
<template>
  <!-- <CompPreCheck @pre-check="autoEvaluate"></CompPreCheck> -->
  <FYTable @search="onSearch" :pagination="false" ref="tableRef">
  <FYTable
    @search="onSearch"
    :pagination="false"
    ref="tableRef"
    @cell-click="cellClick"
    :cell-class-name="cellClassName"
    @table-paste="handlePaste"
  >
    <template #options>
      <!-- 区县 -->
      <FYOptionLocation
@@ -19,6 +24,16 @@
      <!-- 时间 -->
      <FYOptionTime :initValue="false" type="month" v-model:value="formSearch.time"></FYOptionTime>
    </template>
    <template #buttons>
      <!-- <el-button icon="Download" size="default" type="success" @click="download"
        >规范性评估与分析报告</el-button
      > -->
      <CompReport
        :locations="formSearch.locations"
        :scenetype="formSearch.scenetype"
        :time="formSearch.time"
      ></CompReport>
    </template>
    <template #options-expand>
      <el-form :inline="true">
@@ -27,17 +42,9 @@
    </template>
    <template #table-column>
      <el-table-column type="index" fixed="left" prop="sceneName" label="名称" width="300">
        <template #default="{ row }">
          <el-tooltip
            effect="dark"
            :content="row.sceneName"
            placement="top-start"
            :show-after="500"
          >
            {{ row.sceneName }}
          </el-tooltip>
        </template>
      <el-table-column fixed="left" sortable prop="sceneIndex" label="编号" width="80">
      </el-table-column>
      <el-table-column prop="sceneName" :show-overflow-tooltip="true" label="名称" width="300">
      </el-table-column>
      <el-table-column
        prop="subTaskTime"
@@ -70,12 +77,22 @@
      <el-table-column prop="evaluation.scenseaddress" label="地址" />
      <!-- <el-table-column prop="biArea" label="集中区" width="110" />
      <el-table-column prop="biManagementCompany" label="物业" min-width="110"/> -->
      <el-table-column fixed="right" align="right" label="操作" width="160">
        <template #header>
          <el-button icon="Download" size="default" type="success" @click="download"
            >下载结果</el-button
          >
      <el-table-column fixed="right" align="right" label="监测数据超标" width="160">
        <template #default="{ row }">
          <el-input v-model="row.score1" />
        </template>
      </el-table-column>
      <el-table-column fixed="right" align="right" label="监测数据超区月均值" width="160">
        <template #default="{ row }">
          <el-input v-model="row.score2" />
        </template>
      </el-table-column>
      <el-table-column fixed="right" align="right" label="操作" width="160">
        <!-- <template #header>
          <el-button icon="Download" size="default" type="success" @click="exportExcel"
            >导出结果</el-button
          >
        </template> -->
        <template #default="{ row }">
          <el-button type="primary" size="small" @click="editRow(row)">查看</el-button>
        </template>
@@ -88,11 +105,19 @@
import dayjs from 'dayjs';
import evaluateApi from '@/api/fysp/evaluateApi';
import { envCreditCode } from '@/constants/index';
import CompQuickSet from './components/CompQuickSet.vue';
import CompReport from './components/CompReport.vue';
import { useTablePaste } from '@/composables/tablePaste';
export default {
  name: 'ResultManage',
  components: { CompQuickSet },
  setup() {
    const { cellClick, cellClassName, handlePaste, setTableData, addRefreshEvent, tableData } =
      useTablePaste({
        score1: 8,
        score2: 9
      });
    return { cellClick, cellClassName, handlePaste, setTableData, addRefreshEvent, tableData };
  },
  components: { CompReport },
  data() {
    return {
      formSearch: {
@@ -117,6 +142,9 @@
        scensetypeid: scenetype.value
      };
    },
    editRow(row) {
      this.$router.push(`evalutationEdit/${row.subTaskId}`);
    },
    setOptions(param) {
      this.formSearch.locations = param.locations;
      this.formSearch.scenetype = param.scenetype;
@@ -126,14 +154,16 @@
    onSearch(page, func) {
      const area = this._getParam();
      evaluateApi.fetchAutoEvaluation(area).then((res) => {
        if (typeof func === 'function') {
          func({ data: res.data });
        }
        if (res.data) {
          this.tableData = res.data;
          this.getFilters(res.data);
          if (typeof func === 'function') {
            func({ data: this.tableData });
          }
        }
      });
    },
    // 规范性评估与分析报告后台生成任务
    download() {
      const area = this._getParam();
      evaluateApi.downloadAutoEvaluation(area).then((res) => {
@@ -143,6 +173,8 @@
        }
      });
    },
    // 导出表格为excel格式
    exportExcel() {},
    getFilters(data) {
      const townList = [];
      data.forEach((e) => {
@@ -177,7 +209,10 @@
      const s1 = a.evaluation ? parseInt(a.evaluation.resultscorebef) : 0;
      const s2 = b.evaluation ? parseInt(b.evaluation.resultscorebef) : 0;
      return s1 - s2;
    }
    },
  },
  mounted() {
    this.addRefreshEvent(this.$refs.tableRef.doLayout);
  }
};
</script>