From b5e2e236828b7fbc0e8f2bdbf66651ad8907e3b1 Mon Sep 17 00:00:00 2001 From: heyujie <516346543@qq.com> Date: 星期三, 21 七月 2021 16:40:17 +0800 Subject: [PATCH] all --- src/pages/syslog/views/operationLog.vue | 85 ++++++++++++++++++++++++++---------------- 1 files changed, 53 insertions(+), 32 deletions(-) diff --git a/src/pages/logCenter/views/operationLog.vue b/src/pages/syslog/views/operationLog.vue similarity index 84% rename from src/pages/logCenter/views/operationLog.vue rename to src/pages/syslog/views/operationLog.vue index 568aa5a..523cf69 100644 --- a/src/pages/logCenter/views/operationLog.vue +++ b/src/pages/syslog/views/operationLog.vue @@ -24,7 +24,11 @@ size="small" class="input-with-select" > - <el-button slot="append" icon="el-icon-search" @click="getOperationLog"></el-button> + <el-button + slot="append" + icon="el-icon-search" + @click="getOperationLog" + ></el-button> </el-input> </div> </div> @@ -38,11 +42,7 @@ size="small" @change="moduleChange" > - <el-option - label="鍏ㄩ儴" - :value="''" - > - </el-option> + <el-option label="鍏ㄩ儴" :value="''"> </el-option> <el-option v-for="item in moduleOptions" :key="item.proc_name" @@ -58,6 +58,7 @@ v-model="gongneng" placeholder="璇烽�夋嫨" size="small" + :disabled="curModule == ''" @change="getOperationLog" > <!-- :disabled="gongnengOptions.length==0" --> @@ -72,7 +73,6 @@ </div> <div class="bar"> <div class="name">鎿嶄綔缁撴灉锛�</div> - <el-select v-model="result" placeholder="璇烽�夋嫨" @@ -96,16 +96,16 @@ ref="multipleTable" highlight-current-row :data="tableData" - style="width: 100%" :header-cell-style="{ background: '#f8f8f8', color: '#222222' }" @selection-change="handleSelectionChange" + style="width: 100%" > <el-table-column :align="'center'" label="搴忓彿" type="index" width="50"> </el-table-column> <el-table-column :align="'center'" sortable - min-width="98px" + min-width="150px" prop="add_time" label="鎿嶄綔鏃堕棿" ></el-table-column> @@ -146,20 +146,25 @@ ></el-table-column> </el-table> </div> + + <el-pagination + @size-change="handleSizeChange" + @current-change="handleCurrentChange" + :current-page="page" + :page-sizes="[15, 30, 50, 100]" + :page-size="15" + layout="total, sizes, prev, pager, next, jumper" + :total="total" + > + </el-pagination> </div> </template> <script> import { deleteDate } from "@/api/system"; +import { pad0 } from "@/api/utils"; import { queryOperationLog, getOperations, getModules } from "@/api/log"; -function pad0(i) { - if (i >= 0 && i <= 9) { - return "0" + i; - } else { - return i; - } -} export default { data() { return { @@ -194,7 +199,7 @@ timeStart: "", timeEnd: "", fuzzySearch: "", - total:0, + total: 0, }; }, mounted() { @@ -203,10 +208,17 @@ this.getOptions(); }, methods: { - gongnengChange(val) {}, + handleSizeChange(val) { + this.pageSize = val; + this.getOperationLog(); + }, + handleCurrentChange(val) { + this.page = val; + this.getOperationLog(); + }, moduleChange(val) { - this.getOperationLog() - this.gongneng="" + this.getOperationLog(); + this.gongneng = ""; getOperations({ module: this.curModule, }).then((res) => { @@ -242,7 +254,7 @@ this.activeDateChoise = i; }, getOperationLog(timeStart, timeEnd) { - const data= { + const data = { timeStart: this.timeStart, timeEnd: this.timeEnd, page: this.page, @@ -251,10 +263,10 @@ function: this.gongneng, result: this.result, fuzzySearch: this.fuzzySearch, - } + }; queryOperationLog(data).then((res) => { this.tableData = res.data.logs; - this.total = res.data.total + this.total = res.data.total; }); }, getTimeStr(date) { @@ -268,8 +280,8 @@ getTimeRange(gap) { var date = new Date(); //褰撳墠鏃堕棿 var preDay = new Date(new Date().getTime() - gap); - this.timeStart = this.getTimeStr(preDay) - this.timeEnd = this.getTimeStr(date) + this.timeStart = this.getTimeStr(preDay); + this.timeEnd = this.getTimeStr(date); }, }, }; @@ -278,11 +290,11 @@ .op-log { margin: 0 auto; padding: 10px 8px 10px 5px; - background-color: rgba(248, 248, 248, 1); width: 100%; display: flex; flex-direction: column; + overflow: auto; .top { height: 100px; background: #fff; @@ -296,21 +308,22 @@ display: flex; justify-content: space-between; align-items: center; - // padding-left: 20px; .title { - margin-right: 20px; + margin-right: 10px; + min-width: fit-content; + font-size: 14px; } .opts { display: flex; justify-content: space-between; .opt { - width: fit-content; + min-width: fit-content; + width: 50px; height: 32px; padding: 0 15px; - // background: aquamarine; border-radius: 4px; cursor: pointer; - margin-right: 20px; + margin-right: 10px; line-height: 32px; font-size: 14px; } @@ -332,13 +345,16 @@ .second { display: flex; margin: 10px 0; + padding: 0 20px; .bar { display: flex; align-items: baseline; width: fit-content; - padding-left: 20px; + margin-right: 20px; min-width: 120px; .name { margin-right: 5px; + min-width: fit-content; + font-size: 14px; } } } @@ -361,5 +377,10 @@ } } } + .el-pagination { + padding: 20px 5px; height: 100%; + box-sizing: border-box; background-color: white; + + } } </style> -- Gitblit v1.8.0