From 4a800a8fc83c6bd1f86a8e847b079a51a7532c09 Mon Sep 17 00:00:00 2001
From: zhangzengfei <zhangzengfei@smartai.com>
Date: 星期三, 20 七月 2022 15:05:58 +0800
Subject: [PATCH] 修复国标配置的bug

---
 src/pages/syslog/views/pollingLog.vue |  249 +++++++++++++++++++++++++++++++++++++++++++++----
 1 files changed, 226 insertions(+), 23 deletions(-)

diff --git a/src/pages/syslog/views/pollingLog.vue b/src/pages/syslog/views/pollingLog.vue
index bcbdbed..2897bf9 100644
--- a/src/pages/syslog/views/pollingLog.vue
+++ b/src/pages/syslog/views/pollingLog.vue
@@ -11,25 +11,42 @@
           <div class="opts">
             <div class="opt" @click="openDialog">閫夋嫨鎽勫儚鏈�</div>
           </div>
-          <div class="pick-num">宸查�� : {{ pickNum }}</div>
+          <div class="pick-num">宸查�� : ( {{ pickNum }} )</div>
         </div>
         <div class="search">
           <el-input
             placeholder="鎼滅储"
-            v-model="procName"
+            v-model="fuzzySearch"
             size="small"
             class="input-with-select"
+            @keyup.enter.native="getScheduleLog(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="getScheduleLog(1)"
+              slot="append"
+            >
+              &#xe714;
+            </span>
+
+            <!-- <el-button
               slot="append"
               icon="el-icon-search"
-              @click="getScheduleLog"
-            ></el-button>
+              @click="getOperationLog(1)"
+            ></el-button> -->
           </el-input>
         </div>
       </div>
       <div class="second">
-        <span>鏃ユ湡鏃堕棿锛�</span>
+        <span class="title">鏃ユ湡鏃堕棿锛�</span>
         <el-date-picker
           v-model="dateRange"
           size="small"
@@ -39,6 +56,8 @@
           start-placeholder="寮�濮嬫棩鏈�"
           @change="dateChange"
           end-placeholder="缁撴潫鏃ユ湡"
+          :picker-options="pickerOptions"
+          popper-class="pollingLog_timePicker"
         >
         </el-date-picker>
       </div>
@@ -52,7 +71,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
@@ -72,7 +95,7 @@
         <el-table-column
           :align="'center'"
           sortable
-          prop="procName"
+          prop="info"
           label="鎽勫儚鏈�"
         ></el-table-column>
         <el-table-column
@@ -108,6 +131,7 @@
         show-checkbox
         check-on-click-node
         default-expand-all
+        :default-checked-keys="selectedIDs"
       ></el-tree>
 
       <span slot="footer" class="dialog-footer">
@@ -130,6 +154,7 @@
 export default {
   data() {
     return {
+      png: require("../../../../public/images/syslog/娌℃暟鎹�.png"),
       loading: false,
       loadingText: "",
       tableData: [],
@@ -154,6 +179,38 @@
       procID: "",
       procName: "",
       pickNum: 0,
+      selectedIDs: [],
+      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() {
@@ -164,11 +221,11 @@
   methods: {
     handleSizeChange(val) {
       this.pageSize = val;
-      this.getOperationLog();
+      this.getScheduleLog();
     },
     handleCurrentChange(val) {
       this.page = val;
-      this.getOperationLog();
+      this.getScheduleLog();
     },
     cancelShow() {
       this.dialogVisible = false;
@@ -182,6 +239,8 @@
     },
     confirmCamera() {
       const selectedIDs = this.$refs.cameraTree.getCheckedKeys();
+      this.selectedIDs = selectedIDs;
+      console.log(selectedIDs);
       this.pickNum = selectedIDs.length;
       this.procID = selectedIDs.join(",");
       this.getScheduleLog();
@@ -210,12 +269,17 @@
         this.moduleOptions = res.data;
       });
     },
-    getScheduleLog() {
+    getScheduleLog(typ) {
+      if (typ == 1) {
+        this.page = 1;
+      }
+
       const data = {
         timeStart: this.timeStart,
         timeEnd: this.timeEnd,
         page: this.page,
         pageSize: this.pageSize,
+        fuzzySearch: this.fuzzySearch,
         procID: this.procID,
         procName: this.procName,
       };
@@ -242,6 +306,12 @@
       this.timeStart = this.getTimeStr(preDay);
       this.timeEnd = this.getTimeStr(date);
       this.dateRange = [this.timeStart, this.timeEnd];
+    },
+    handleSelectionChange() {},
+    handleClose() {},
+    clearSearch() {
+      this.fuzzySearch = "";
+      this.getScheduleLog(1);
     },
   },
 };
@@ -287,14 +357,15 @@
     }
   }
   .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;
@@ -302,44 +373,91 @@
         .title,
         .pick-num {
           margin-right: 10px;
-          font-size: 14px;
           min-width: fit-content;
+          font-weight: bold;
+          font-size: 12px;
         }
+
         .opts {
           display: flex;
           justify-content: space-between;
           .opt {
-            width: 70px;
-            height: 32px;
+            width: 100px;
+            height: 36px;
             padding: 0 15px;
             border-radius: 4px;
             cursor: pointer;
             margin-right: 20px;
-            line-height: 32px;
-            font-size: 14px;
+            line-height: 36px;
+            font-size: 12px;
+            font-weight: 700;
             color: #fff;
-            background-color: rgba(61, 104, 225, 1);
+            background-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;
-      padding: 0 20px;
       align-items: center;
-      font-size: 14px;
+      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;
         width: fit-content;
-        padding-left: 20px;
+        margin-right: 30px;
+        min-width: 120px;
+
         .name {
-          margin-right: 5px;
+          margin-right: 15px;
+          min-width: fit-content;
+          font-weight: bold;
+          font-size: 12px;
         }
       }
     }
@@ -350,16 +468,50 @@
     padding: 12px;
     background-color: white;
 
+    .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;
       }
     }
   }
@@ -370,4 +522,55 @@
     background-color: white;
   }
 }
+
+.pollingLog_timePicker {
+  width: 520px !important;
+  * {
+    font-size: 12px !important;
+    min-width: 0px !important;
+  }
+
+  .el-date-range-picker__time-header {
+    border: none;
+  }
+
+  .el-date-range-picker__content {
+    padding: 2px 9px;
+  }
+
+  .el-date-table th {
+    pad: 0 5px;
+  }
+
+  .el-picker-panel__shortcut {
+    padding-left: 20px;
+    padding-bottom: 10px;
+  }
+
+  .el-picker-panel__footer {
+    padding: 0 20px 10px 0;
+    background-color: none;
+    display: flex;
+    justify-content: end;
+    border: none;
+    button {
+      display: block;
+      width: 54px;
+      height: 24px;
+      border: 1px solid #e0e0e0;
+      border-radius: 25px;
+      line-height: 9px;
+
+      &:first-child {
+        color: #4f4f4f !important;
+      }
+
+      &:last-child {
+        color: #fff !important;
+        background-color: #4e94ff !important;
+        border-color: #4e94ff !important;
+      }
+    }
+  }
+}
 </style>

--
Gitblit v1.8.0