zhanghua
2023-03-15 d2b1bb1f77ad20b852d245a1bdd5a73156e37bcd
src/views/intelligentPatrol/statistics/unlawful/area/index.vue
@@ -13,6 +13,7 @@
            start-placeholder="开始日期"
            end-placeholder="结束日期"
            :picker-options="pickerOptions"
            value-format="yyyy-MM-dd HH:mm:ss"
          >
          </el-date-picker>
        </div>
@@ -40,8 +41,11 @@
      <div class="main-content">
        <!-- 数据展示 -->
        <el-table
          border
          stripe
          ref="multipleTable"
          :header-cell-style="{
            background: '#F5F5F5',
            'font-weight': '650',
            'line-height': '45px',
          }"
@@ -137,9 +141,40 @@
  methods: {
    ...mapActions(["searchByArea"]),
    handleExport(e) {},
    setTableDataHandle(e) {},
    resetTableData(e) {},
    handleExport(e) {
      this.$axios({
        method: "post",
        url: `sccg/intelligentPatrol/statistics/export/unlawful`,
        // url: `sccg/intelligentPatrol/statistics/export/unlawful/street`,
        responseType: "arraybuffer",
      }).then((res) => {
        let time = new Date();
        let deathdate = time.toLocaleDateString();
        const blob = new Blob([res.data], {
          type: "application/vnd.ms-excel;charset=utf-8",
        });
        if (window.navigator.msSaveBlob) {
          window.navigator.msSaveBlob(blob, deathdate + "按区域统计" + ".xlsx");
        } else {
          const url = window.URL.createObjectURL(blob);
          const link = document.createElement("a");
          link.style.display = "none";
          link.href = url;
          link.download = deathdate + "按区域统计" + ".xlsx";
          document.body.appendChild(link);
          link.click();
          document.body.removeChild(link);
        }
        this.$message.success("操作成功");
      });
    },
    setTableDataHandle(e) {
      this.setTableData()
    },
    resetTableData(e) {
      this.value2= ''
      this.setTableData()
    },
    // 设置表格斑马纹
    tableRowClassName({ row, rowIndex }) {
      if ((rowIndex + 1) % 2 == 0) {
@@ -155,11 +190,11 @@
      this.searchByArea({
        currentPage,
        pageSize,
        beginTime:'2022-05-01 00:00:00',
        endTime:'2022-09-01 00:00:00'
        beginTime: this.value2[0],
        endTime:this.value2[1],
      }).then((res) => {
          this.list = res.records;
          this.totalNum = res.total;
        this.list = res.records;
        this.totalNum = res.total;
      });
    },
    // 当前页改变触发事件
@@ -183,15 +218,15 @@
  <style lang="scss" scoped>
.list {
  text-align: left;
  margin: 10px 20px;
  padding: 10px 20px;
  color: #4b9bb7;
  border: 1px solid #ccc;
  header {
    background-color: white;
    border: 1pox solid #fff;
    border: 1px solid #fff;
    .header-content {
      padding: 0 40px;
      //padding: 0 40px;
      display: flex;
      line-height: 100px;
      justify-content: space-between;
@@ -231,14 +266,14 @@
    }
  }
  :deep(.el-range-separator) {
  ::v-deep(.el-range-separator) {
    padding: 0px !important;
  }
  main {
    // background-color: #09152f;
    margin-top: 20px;
    padding-bottom: 50px;
    border: 1pox solid #fff;
    border: 1px solid #fff;
    .main-title {
      line-height: 60px;
@@ -328,7 +363,7 @@
      // font-size: 10px;
      .operation {
        display: flex;
        color: var(--operation-color);;
        .line {
          padding: 0 5px;
        }
@@ -340,4 +375,4 @@
    }
  }
}
</style>
</style>