zmc
2023-10-12 f3acb8ce787f3df0eda633031473be4e6a9ff448
src/views/analysis/DataShow.vue
@@ -54,7 +54,7 @@
      <!-- <el-main> -->
        <div class="table">
        <el-table :data="displayData" border="" id="table" ref="table" table-layout="auto" >
          <!-- <el-table-column prop="id" label="序号" width="60"></el-table-column> -->
          <el-table-column
            type="index"
            label="序号"
@@ -88,7 +88,7 @@
            label="供应商"
            v-if="showColumn.privides"
          ></el-table-column>
          <!-- <el-table-column prop="smokePushDensity" label="进烟浓度mg/m³" width="130"> </el-table-column> -->
          <el-table-column
            prop="smokePopDensity"
            label="油烟浓度(mg)"
@@ -131,7 +131,7 @@
            v-if="showColumn.attributiontime"
          >
          </el-table-column>
          <!-- <el-table-column prop="reportingTime" label="上报时间" width="100"> </el-table-column> -->
          <el-table-column fixed="right" width="100" align="center">
            <template v-slot:header>
@@ -141,13 +141,7 @@
            @click="showColumnOption">
          </i-ep-setting>
          </template>
            <!-- <template v-slot:header>
              <i
                class="el-icon-setting"
                style="font-size: 22px; cursor: pointer"
                @click="showColumnOption"
              ></i>
            </template> -->
          </el-table-column>
        </el-table>
@@ -199,8 +193,7 @@
          </div>
        </transition>
      </div>
      <!-- </el-main> -->
    <!-- </el-container> -->
  </div>
</template>
@@ -387,17 +380,7 @@
      // 将workbook转为二进制xlsx文件并下载
      XLSX.writeFile(wb, '页面数据.xlsx');
      // this.jsonData=this.tableData
      // const sheetName = '数据表';
      // const worksheet = XLSX.utils.json_to_sheet(this.jsonData);
      // // 导出Excel文件
      // const workbook = XLSX.utils.book_new();
      // XLSX.utils.book_append_sheet(workbook, worksheet, sheetName);
      // const excelBuffer = XLSX.write(workbook, { bookType: 'xlsx', type: 'array' });
      // const fileName = '页面数据.xlsx';
      // const file = new Blob([excelBuffer], {type: 'application/octet-stream'});
      // saveAs(file, fileName);
    },
    handleSizeChange(val) {
      this.pageSize = val;
@@ -407,12 +390,10 @@
      const startIndex = (val - 1) * this.pageSize;
      const endIndex = startIndex + this.pageSize;
      this.displayData = this.tableData.slice(startIndex, endIndex);
      // this.indexMethod(this.pageSize)
    },
    //序号递增
    indexMethod(index) {
      // let limitpage = this.pageSize; // 每页条数
      // let curpage = this.currentPage; // 当前页码
      return index + 1 + (this.currentPage - 1) * this.pageSize;
    },
@@ -432,7 +413,6 @@
    // 监听复选框配置列所有的变化
    checkList: {
      handler: function (newnew) {
        // console.log(newnew);
        this.showColumn = newnew;
        // 这里需要让表格重新绘制一下,否则会产生固定列错位的情况
        this.$nextTick(() => {
@@ -449,7 +429,6 @@
<style>
/* 表格 */
.table {
  /* margin: 10px,0px,10px,10px; */
  margin: 10px;
}
.button-and-export {