heyujie
2021-12-07 4ff29e301de38488db0ff04f0209c99e37cf30b4
src/pages/syslog/views/systemLog.vue
@@ -23,12 +23,30 @@
            v-model="fuzzySearch"
            size="small"
            class="input-with-select"
            @keyup.enter.native="getOperationLog(1)"
          >
            <el-button
            <span
              class="icon iconfont icon_clear"
              @click="clearSearch"
              slot="append"
              v-if="fuzzySearch"
            >
              &#xe785;
            </span>
            <span
              class="icon iconfont icon_search"
              @click="getOperationLog(1)"
              slot="append"
              v-else
            >
              &#xe714;
            </span>
            <!-- <el-button
              slot="append"
              icon="el-icon-search"
              @click="getOperationLog(1)"
            ></el-button>
            ></el-button> -->
          </el-input>
        </div>
      </div>
@@ -44,8 +62,8 @@
          >
            <el-option label="全部" :value="''"> </el-option>
            <el-option
              v-for="item in levelOptions"
              :key="item.proc_name"
              v-for="(item, index) in levelOptions"
              :key="index"
              :label="item.proc_name"
              :value="item.proc_name"
            >
@@ -61,8 +79,8 @@
            @change="getOperationLog(1)"
          >
            <el-option
              v-for="item in hostNameOptions"
              :key="item.value"
              v-for="(item, index) in hostNameOptions"
              :key="index"
              :label="item.label"
              :value="item.value"
            >
@@ -79,7 +97,11 @@
        :data="tableData"
        :header-cell-style="{ background: '#f8f8f8', color: '#222222' }"
        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
@@ -135,12 +157,14 @@
<script>
import { deleteDate } from "@/api/system";
import { getModules } from "@/api/log";
import { pad0 } from "@/api/utils";
import {} from "@/api/log";
export default {
  data() {
    return {
      png: "",
      loading: false,
      loadingText: "",
      input3: "",
@@ -201,6 +225,7 @@
    getOptions() {
      getModules().then((res) => {
        this.levelOptions = res.data;
        this.png = require("../../../../public/images/syslog/没数据.png");
      });
    },
    choseRange(item, i) {
@@ -258,6 +283,10 @@
      this.timeStart = this.getTimeStr(preDay);
      this.timeEnd = this.getTimeStr(date);
    },
    clearSearch() {
      this.fuzzySearch = "";
      this.getOperationLog(1);
    },
  },
};
</script>
@@ -272,14 +301,15 @@
  flex-direction: column;
  overflow: auto;
  .top {
    height: 100px;
    height: 132px;
    background: #fff;
    border-radius: 5px;
    .first {
      display: flex;
      justify-content: space-between;
      align-items: center;
      height: 45px;
      padding: 0 20px;
      padding: 20px 20px 0 20px;
      .time-option {
        display: flex;
        justify-content: space-between;
@@ -287,51 +317,107 @@
        .title {
          margin-right: 10px;
          min-width: fit-content;
          font-size: 14px;
          font-weight: bold;
          font-size: 12px;
        }
        .opts {
          display: flex;
          justify-content: space-between;
          .opt {
            box-sizing: border-box;
            border: 2px solid #efeff6;
            min-width: fit-content;
            width: 50px;
            height: 32px;
            width: 100px;
            height: 36px;
            padding: 0 15px;
            border-radius: 4px;
            cursor: pointer;
            margin-right: 10px;
            margin-right: 2px;
            line-height: 32px;
            font-size: 14px;
            font-size: 12px;
            color: #333;
          }
          .opt:hover {
            background-color: rgba(61, 104, 225, 1);
            color: #fff;
            border-color: #4e94ff;
          }
          .opt-active {
            color: #fff;
            background-color: rgba(61, 104, 225, 1);
            background-color: #4e94ff;
            border-color: #4e94ff;
          }
        }
      }
      .search {
        width: 280px;
        height: 36px;
        display: flex;
        align-items: center;
        .input-with-select {
          width: 100%;
          height: 100%;
          input {
            height: 100%;
            border-radius: 18px 0 0 18px;
            border: 2px solid #f2f2f7;
            border-right: none;
            &:focus,
            &:focus + .el-input-group__append {
              border-color: #409eff;
            }
          }
          .el-input-group__append {
            transition: border-color 0.2s cubic-bezier(0.645, 0.045, 0.355, 1);
            background-color: #fff;
            border: 2px solid #f2f2f7;
            border-radius: 0 18px 18px 0;
            border-left: none;
          }
        }
        span {
          cursor: pointer;
          color: rgb(47, 45, 61);
          font-weight: 700;
          font-size: 19px;
        }
      }
    }
    .second {
      display: flex;
      margin: 10px 0;
      margin: 15px 0 20px 0;
      padding: 0 20px;
      .bar {
        display: flex;
        align-items: baseline;
        width: fit-content;
        margin-right: 20px;
        margin-right: 30px;
        min-width: 120px;
        .el-select {
          width: 200px;
          height: 36px;
          .el-input {
            width: 100%;
            height: 100%;
            input {
              width: 100%;
              height: 100%;
              border: 2px solid #f2f2f7;
              border-radius: 20px;
            }
          }
        }
        .name {
          margin-right: 5px;
          margin-right: 15px;
          min-width: fit-content;
          font-size: 14px;
          font-weight: bold;
          font-size: 12px;
        }
      }
    }
@@ -340,17 +426,49 @@
    margin-top: 16px;
    border-radius: 5px;
    padding: 12px;
    background-color: white;
    background-color: rgb(255, 255, 255);
    .empty_img {
      margin: 80px auto;
      width: 164px;
    }
    .tableBox {
      border: none;
      &::before,
      &::after {
        display: none;
      }
      tr {
        td:first-child {
          border-radius: 4px 0 0 4px;
        }
        td:last-child {
          border-radius: 0 4px 4px 0;
        }
        &.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;
      }
    }
  }