From 1daae83b90e0772a4e8d4e59e4f135af159c9cf3 Mon Sep 17 00:00:00 2001
From: zhangzengfei <zhangzengfei@smartai.com>
Date: 星期四, 02 十二月 2021 11:27:01 +0800
Subject: [PATCH] 完善事件推送日志
---
src/pages/syslog/views/eventPushLog.vue | 239 +++++++++++++++++++++++++++--------------------------------
1 files changed, 111 insertions(+), 128 deletions(-)
diff --git a/src/pages/syslog/views/eventPushLog.vue b/src/pages/syslog/views/eventPushLog.vue
index b17cb4b..a1757b8 100644
--- a/src/pages/syslog/views/eventPushLog.vue
+++ b/src/pages/syslog/views/eventPushLog.vue
@@ -23,18 +23,19 @@
v-model="fuzzySearch"
size="small"
class="input-with-select"
+ @keyup.enter.native="getPushLog(1)"
>
- <span
- class="icon iconfont"
- @click="getOperationLog(1)"
- slot="append"
- >
+ <span class="icon iconfont icon_clear" @click="clearSearch" slot="append" v-if="fuzzySearch">
+ 
+ </span>
+ <span class="icon iconfont icon_search" @click="getPushLog(1)" slot="append" v-else>

</span>
+
<!-- <el-button
slot="append"
icon="el-icon-search"
- @click="getOperationLog(1)"
+ @click="getPushLog(1)"
></el-button> -->
</el-input>
</div>
@@ -43,19 +44,9 @@
<div class="bar">
<div class="name">鐘舵�侊細</div>
- <el-select
- v-model="level"
- placeholder="璇烽�夋嫨"
- size="small"
- @change="levelChange"
- >
+ <el-select v-model="level" placeholder="璇烽�夋嫨" size="small" @change="levelChange">
<el-option label="鍏ㄩ儴" :value="''"> </el-option>
- <el-option
- v-for="item in levelOptions"
- :key="item.proc_name"
- :label="item.proc_name"
- :value="item.proc_name"
- >
+ <el-option v-for="(item, i) in levelOptions" :key="i" :label="item.proc_name" :value="item.proc_name">
</el-option>
</el-select>
</div>
@@ -64,7 +55,6 @@
<div class="table">
<el-table
class="tableBox"
- @cell-click="clickFaults"
ref="multipleTable"
:cell-style="styleFunc"
highlight-current-row
@@ -72,49 +62,30 @@
:header-cell-style="{ background: '#f8f8f8', color: '#222222' }"
style="width: 100%"
v-if="!showSubTable"
+ border
>
- <el-table-column :align="'center'" label="搴忓彿" type="index" width="50">
+ <template slot="empty">
+ <img :src="png1" class="empty_img" alt="" />
+ </template>
+ <el-table-column :align="'center'" label="搴忓彿" type="index" width="50"> </el-table-column>
+ <el-table-column sortable :align="'center'" prop="name" label="浠诲姟鍚嶇О"></el-table-column>
+ <el-table-column :align="'center'" sortable prop="state" label="鐘舵��"></el-table-column>
+ <el-table-column :align="'center'" sortable prop="lastSendDate" label="鏈�杩戜竴娆℃帹閫佹椂闂�"></el-table-column>
+ <el-table-column :align="'center'" prop="lastSendState" label="鏈�杩戜竴娆℃帹閫佺姸鎬�">
+ <template #default="{ row }">
+ <span v-show="row.lastSendState != ''" :style="row.lastSendState === 'true' ? 'color:green' : 'color:red'"
+ >{{ row.lastSendState === "true" ? "鎴愬姛" : "澶辫触" }}
+ </span>
+ </template>
</el-table-column>
- <el-table-column
- :align="'center'"
- sortable
- prop="add_time"
- label="鐘舵��"
- ></el-table-column>
- <el-table-column
- sortable
- :align="'center'"
- prop="userName"
- label="浠诲姟鍚嶇О"
- ></el-table-column>
- <el-table-column
- :align="'center'"
- sortable
- prop="module"
- label="鏈�杩戜竴娆℃帹閫佹椂闂�"
- ></el-table-column>
- <el-table-column
- :align="'center'"
- prop="procName"
- label="鏈�杩戜竴娆℃帹閫佺姸鎬�"
- ></el-table-column>
- <el-table-column
- :align="'center'"
- sortable
- prop="result"
- label="鎴愬姛鎬婚噺"
- ></el-table-column>
- <el-table-column
- :align="'center'"
- prop="msg"
- min-width="100px"
- label="澶辫触鎬婚噺"
- ></el-table-column>
+ <el-table-column :align="'center'" sortable prop="totalSuccess" label="鎴愬姛鎬婚噺"></el-table-column>
+ <el-table-column :align="'center'" prop="totalFailure" label="澶辫触鎬婚噺"></el-table-column>
+ <!-- <el-table-column :align="'center'" prop="totalCached" label="绛夊緟閲嶆帹"></el-table-column> -->
</el-table>
<div class="back" v-if="showSubTable" @click="showSubTable = false">
<span class="icon iconfont"></span>
- <span class="title">浜嬩欢鎺ㄩ�佹棩蹇�</span>
+ <span class="title" style="color: #4e94ff">浜嬩欢鎺ㄩ�佹棩蹇�</span>
</div>
<el-table
class="tableBox"
@@ -125,38 +96,17 @@
:header-cell-style="{ background: '#f8f8f8', color: '#222222' }"
style="width: 100%"
v-if="showSubTable"
+ border
>
- <el-table-column :align="'center'" label="搴忓彿" type="index" width="50">
- </el-table-column>
- <el-table-column
- :align="'center'"
- sortable
- prop="add_time"
- label="鎺ㄩ�佹椂闂�"
- ></el-table-column>
- <el-table-column
- sortable
- :align="'center'"
- prop="userName"
- label="鎺ㄩ�佺姸鎬�"
- ></el-table-column>
- <el-table-column
- :align="'center'"
- sortable
- prop="module"
- label="璇︾粏淇℃伅"
- ></el-table-column>
- <el-table-column
- :align="'center'"
- prop="procName"
- label="鍐嶆鎺ㄩ�佹椂闂�"
- ></el-table-column>
- <el-table-column
- :align="'center'"
- sortable
- prop="result"
- label="鍐嶆鎺ㄩ�佺姸鎬�"
- ></el-table-column>
+ <template slot="empty">
+ <img :src="png2" class="empty_img2" alt="" />
+ </template>
+ <el-table-column :align="'center'" label="搴忓彿" type="index" width="50"> </el-table-column>
+ <el-table-column :align="'center'" sortable prop="add_time" label="鎺ㄩ�佹椂闂�"></el-table-column>
+ <el-table-column sortable :align="'center'" prop="userName" label="鎺ㄩ�佺姸鎬�"></el-table-column>
+ <el-table-column :align="'center'" sortable prop="module" label="璇︾粏淇℃伅"></el-table-column>
+ <el-table-column :align="'center'" prop="procName" label="鍐嶆鎺ㄩ�佹椂闂�"></el-table-column>
+ <el-table-column :align="'center'" sortable prop="result" label="鍐嶆鎺ㄩ�佺姸鎬�"></el-table-column>
</el-table>
</div>
@@ -174,20 +124,18 @@
</template>
<script>
-import { deleteDate } from "@/api/system";
import { pad0 } from "@/api/utils";
-import {} from "@/api/log";
+import { queryDataPushLog } from "@/api/log";
export default {
data() {
return {
+ png1: "",
+ png2: require("../../../../public/images/syslog/娌℃暟鎹�.png"),
loading: false,
loadingText: "",
showSubTable: false,
- tableData: [
- { msg: 2, userName: "杞﹁締璇嗗埆" },
- { userName: "浜鸿劯璇嗗埆", msg: 4 },
- ],
+ tableData: [],
subTableData: [],
dateArr: ["浠婃棩", "杩戜笁澶�", "杩戜竷澶�", "杩戜竴涓湀", "杩戝叚涓湀"],
levelOptions: [],
@@ -195,16 +143,16 @@
resultOptions: [
{
value: "",
- label: "鍏ㄩ儴",
+ label: "鍏ㄩ儴"
},
{
value: "鎴愬姛",
- label: "鎴愬姛",
+ label: "鎴愬姛"
},
{
value: "澶辫触",
- label: "澶辫触",
- },
+ label: "澶辫触"
+ }
],
value: "",
page: 1,
@@ -216,13 +164,12 @@
timeStart: "",
timeEnd: "",
fuzzySearch: "",
- total: 0,
+ total: 0
};
},
mounted() {
this.getTimeRange(24 * 60 * 60 * 1000);
- // this.getOperationLog();
- this.getOptions();
+ this.getPushLog();
},
methods: {
styleFunc({ row, column, rowIndex, columnIndex }) {
@@ -233,25 +180,20 @@
},
handleSizeChange(val) {
this.pageSize = val;
- // this.getOperationLog();
+ // this.getPushLog();
},
handleCurrentChange(val) {
this.page = val;
- // this.getOperationLog();
+ // this.getPushLog();
},
levelChange(val) {
- // this.getOperationLog(1);
+ // this.getPushLog(1);
// this.hostName = "";
// getOperations({
// module: this.level,
// }).then((res) => {
// this.hostNameOptions = res.data;
// });
- },
- getOptions() {
- getModules().then((res) => {
- this.levelOptions = res.data;
- });
},
clickFaults(row, column, cell, event) {
this.showSubTable = true;
@@ -276,26 +218,26 @@
default:
break;
}
- // this.getOperationLog(1);
+ // this.getPushLog(1);
this.activeDateChoise = i;
},
- getOperationLog(typ) {
+ getPushLog(typ) {
if (typ == 1) {
this.page = 1;
}
- // queryOperationLog({
- // timeStart: this.timeStart,
- // timeEnd: this.timeEnd,
- // page: this.page,
- // pageSize: this.pageSize,
- // module: this.level,
- // function: this.hostName,
- // result: this.result,
- // fuzzySearch: this.fuzzySearch,
- // }).then((res) => {
- // this.tableData = res.data.logs;
- // this.total = res.data.total;
- // });
+ queryDataPushLog({
+ timeStart: this.timeStart,
+ timeEnd: this.timeEnd,
+ page: this.page,
+ pageSize: this.pageSize,
+ state: this.level,
+ function: this.hostName,
+ result: this.result,
+ fuzzySearch: this.fuzzySearch
+ }).then((res) => {
+ this.tableData = res.data.logs;
+ this.total = res.data.total;
+ });
},
getTimeStr(date) {
var month = pad0(date.getMonth() + 1); //鏈�
@@ -311,7 +253,11 @@
this.timeStart = this.getTimeStr(preDay);
this.timeEnd = this.getTimeStr(date);
},
- },
+ clearSearch() {
+ this.fuzzySearch = "";
+ this.getPushLog(1);
+ }
+ }
};
</script>
<style lang="scss">
@@ -387,13 +333,14 @@
border: 2px solid #f2f2f7;
border-right: none;
- // &:focus + .el-input-group__append {
- // border-color: #409eff;
- // }
+ &: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);
+ 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;
@@ -450,6 +397,14 @@
border-radius: 5px;
padding: 12px;
background-color: white;
+ .empty_img {
+ margin: 80px auto;
+ width: 164px;
+ }
+ .empty_img2 {
+ margin: 50px auto;
+ width: 164px;
+ }
.back {
display: flex;
align-items: center;
@@ -465,15 +420,43 @@
}
}
.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;
}
}
}
--
Gitblit v1.8.0