ZZJ
2021-11-11 0357cd11e6cd7ce095ab72eb41c563cccb0f9617
src/pages/syslog/views/pollingLog.vue
@@ -36,7 +36,7 @@
        </div>
      </div>
      <div class="second">
        <span>日期时间:</span>
        <span class="title">日期时间:</span>
        <el-date-picker
          v-model="dateRange"
          size="small"
@@ -46,6 +46,7 @@
          start-placeholder="开始日期"
          @change="dateChange"
          end-placeholder="结束日期"
          :picker-options="pickerOptions"
        >
        </el-date-picker>
      </div>
@@ -59,7 +60,11 @@
        :header-cell-style="{ background: '#f8f8f8', color: '#222222' }"
        @selection-change="handleSelectionChange"
        style="width: 100%"
        border
      >
        <template slot="empty">
          <img :src="png" class="empty_img" alt="" />
        </template>
        <el-table-column :align="'center'" label="序号" type="index" width="50">
        </el-table-column>
        <el-table-column
@@ -137,6 +142,7 @@
export default {
  data() {
    return {
      png: "",
      loading: false,
      loadingText: "",
      tableData: [],
@@ -161,6 +167,37 @@
      procID: "",
      procName: "",
      pickNum: 0,
      pickerOptions: {
        shortcuts: [
          {
            text: "最近一周",
            onClick(picker) {
              const end = new Date();
              const start = new Date();
              start.setTime(start.getTime() - 3600 * 1000 * 24 * 7);
              picker.$emit("pick", [start, end]);
            },
          },
          {
            text: "最近一个月",
            onClick(picker) {
              const end = new Date();
              const start = new Date();
              start.setTime(start.getTime() - 3600 * 1000 * 24 * 30);
              picker.$emit("pick", [start, end]);
            },
          },
          {
            text: "最近三个月",
            onClick(picker) {
              const end = new Date();
              const start = new Date();
              start.setTime(start.getTime() - 3600 * 1000 * 24 * 90);
              picker.$emit("pick", [start, end]);
            },
          },
        ],
      },
    };
  },
  mounted() {
@@ -229,6 +266,7 @@
      queryScheduleLog(data).then((res) => {
        this.tableData = res.data.logs;
        this.total = res.data.total;
        this.png = require("../../../../public/images/syslog/没数据.png");
      });
    },
    dateChange(val) {
@@ -250,6 +288,8 @@
      this.timeEnd = this.getTimeStr(date);
      this.dateRange = [this.timeStart, this.timeEnd];
    },
    handleSelectionChange() {},
    handleClose() {},
  },
};
</script>
@@ -374,8 +414,15 @@
    }
    .second {
      display: flex;
      align-items: center;
      margin: 15px 0 20px 0;
      padding: 0 20px;
      .title {
        margin-right: 10px;
        min-width: fit-content;
        font-weight: bold;
        font-size: 12px;
      }
      .bar {
        display: flex;
        align-items: baseline;
@@ -398,16 +445,43 @@
    padding: 12px;
    background-color: white;
    .empty_img {
      margin: 80px auto;
      width: 164px;
    }
    .tableBox {
      border: none;
      &::before,
      &::after {
        display: none;
      }
      tr {
        &.current-row td {
          background-color: #4e94ff !important;
          color: #fff;
        }
        &:hover td {
          background-color: rgb(242, 242, 247);
        }
      }
      th {
        padding: 0 !important;
        height: 40px;
        line-height: 40px;
        border-color: #fff !important;
        border-right: 2px solid #fff;
        border-radius: 4px;
        font-size: 12px;
        background: #f2f2f7;
      }
      td {
        padding: 0 !important;
        height: 34px;
        line-height: 34px;
        border: none;
        font-size: 12px;
      }
    }
  }