From c5dfaf2d4f16988f7be7f9d65df04c0c0d96b6ce Mon Sep 17 00:00:00 2001
From: ZZJ <zzjdsg2300@163.com>
Date: 星期二, 09 十一月 2021 16:35:33 +0800
Subject: [PATCH] 暂存

---
 src/pages/syslog/views/operationLog.vue |  142 +++++++++++++++++++++++++++++++++++------------
 1 files changed, 105 insertions(+), 37 deletions(-)

diff --git a/src/pages/syslog/views/operationLog.vue b/src/pages/syslog/views/operationLog.vue
index 523cf69..f904cfb 100644
--- a/src/pages/syslog/views/operationLog.vue
+++ b/src/pages/syslog/views/operationLog.vue
@@ -24,11 +24,18 @@
             size="small"
             class="input-with-select"
           >
-            <el-button
+            <span
+              class="icon iconfont"
+              @click="getOperationLog(1)"
+              slot="append"
+            >
+              &#xe714;
+            </span>
+            <!-- <el-button
               slot="append"
               icon="el-icon-search"
-              @click="getOperationLog"
-            ></el-button>
+              @click="getOperationLog(1)"
+            ></el-button> -->
           </el-input>
         </div>
       </div>
@@ -59,7 +66,7 @@
             placeholder="璇烽�夋嫨"
             size="small"
             :disabled="curModule == ''"
-            @change="getOperationLog"
+            @change="getOperationLog(1)"
           >
             <!-- :disabled="gongnengOptions.length==0" -->
             <el-option
@@ -77,7 +84,7 @@
             v-model="result"
             placeholder="璇烽�夋嫨"
             size="small"
-            @change="getOperationLog"
+            @change="getOperationLog(1)"
           >
             <el-option
               v-for="item in resultOptions"
@@ -97,7 +104,6 @@
         highlight-current-row
         :data="tableData"
         :header-cell-style="{ background: '#f8f8f8', color: '#222222' }"
-        @selection-change="handleSelectionChange"
         style="width: 100%"
       >
         <el-table-column :align="'center'" label="搴忓彿" type="index" width="50">
@@ -123,7 +129,7 @@
         ></el-table-column>
         <el-table-column
           :align="'center'"
-          prop="procName"
+          prop="function"
           label="鎿嶄綔鍔熻兘"
         ></el-table-column>
         <el-table-column
@@ -203,7 +209,7 @@
     };
   },
   mounted() {
-    this.getTimeRange(24 * 60 * 60 * 1000);
+    this.getTimeRange();
     this.getOperationLog();
     this.getOptions();
   },
@@ -217,7 +223,7 @@
       this.getOperationLog();
     },
     moduleChange(val) {
-      this.getOperationLog();
+      this.getOperationLog(1);
       this.gongneng = "";
       getOperations({
         module: this.curModule,
@@ -233,7 +239,7 @@
     choseRange(item, i) {
       switch (item) {
         case "浠婃棩":
-          this.getTimeRange(24 * 60 * 60 * 1000);
+          this.getTimeRange();
           break;
         case "杩戜笁澶�":
           this.getTimeRange(24 * 60 * 60 * 1000 * 3);
@@ -250,11 +256,14 @@
         default:
           break;
       }
-      this.getOperationLog();
+      this.getOperationLog(1);
       this.activeDateChoise = i;
     },
-    getOperationLog(timeStart, timeEnd) {
-      const data = {
+    getOperationLog(typ) {
+      if (typ == 1) {
+        this.page = 1;
+      }
+      queryOperationLog({
         timeStart: this.timeStart,
         timeEnd: this.timeEnd,
         page: this.page,
@@ -263,8 +272,7 @@
         function: this.gongneng,
         result: this.result,
         fuzzySearch: this.fuzzySearch,
-      };
-      queryOperationLog(data).then((res) => {
+      }).then((res) => {
         this.tableData = res.data.logs;
         this.total = res.data.total;
       });
@@ -278,10 +286,11 @@
       return `${date.getFullYear()}-${month}-${day} ${hour}:${minute}:${second}`;
     },
     getTimeRange(gap) {
-      var date = new Date(); //褰撳墠鏃堕棿
-      var preDay = new Date(new Date().getTime() - gap);
+      var preDay;
+      preDay = gap
+        ? new Date(new Date().getTime() - gap)
+        : new Date(new Date().setHours(0, 0, 0, 0));
       this.timeStart = this.getTimeStr(preDay);
-      this.timeEnd = this.getTimeStr(date);
     },
   },
 };
@@ -289,21 +298,23 @@
 <style lang="scss">
 .op-log {
   margin: 0 auto;
-  padding: 10px 8px 10px 5px;
-  background-color: rgba(248, 248, 248, 1);
+  padding: 0px 8px 10px 5px;
+  border-top: 1px solid #e1e0e6;
+  background-color: rgba(242, 242, 247, 1);
   width: 100%;
   display: flex;
   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;
@@ -311,50 +322,106 @@
         .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 + .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;    min-width: 120px;
+        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;
         }
       }
     }
@@ -378,9 +445,10 @@
     }
   }
   .el-pagination {
-    padding: 20px 5px;    height: 100%;
-    box-sizing: border-box;    background-color: white;
-
+    padding: 20px 5px;
+    height: 100%;
+    box-sizing: border-box;
+    background-color: white;
   }
 }
 </style>

--
Gitblit v1.8.0