日志管理
Showing
7 changed files
with
258 additions
and
8 deletions
src/api/manage.js
0 → 100644
| 1 | import request from '@/plugin/axios' | ||
| 2 | |||
| 3 | /** | ||
| 4 | * 获取操作日志 | ||
| 5 | */ | ||
| 6 | export function getLogData(data) { | ||
| 7 | return request({ | ||
| 8 | url: '/system/manage/operationLog', | ||
| 9 | method: 'post', | ||
| 10 | data: data, | ||
| 11 | }) | ||
| 12 | } | ||
| 13 | |||
| 14 | |||
| 15 | /** | ||
| 16 | * 获取错误日志 | ||
| 17 | */ | ||
| 18 | export function getErrorLog() { | ||
| 19 | return request({ | ||
| 20 | url: '/system/manage/getErrorLog', | ||
| 21 | method: 'post', | ||
| 22 | }) | ||
| 23 | } | ||
| ... | \ No newline at end of file | ... | \ No newline at end of file |
| ... | @@ -97,6 +97,7 @@ | ... | @@ -97,6 +97,7 @@ |
| 97 | <tr> | 97 | <tr> |
| 98 | <td colspan="2" class="tdright"><i class="requisite">*</i>电话</td> | 98 | <td colspan="2" class="tdright"><i class="requisite">*</i>电话</td> |
| 99 | <td colspan="3"> | 99 | <td colspan="3"> |
| 100 | <!-- @blur="inputBlur($event)"--> | ||
| 100 | <input type="text" class="formInput" v-model="formData.dh" /> | 101 | <input type="text" class="formInput" v-model="formData.dh" /> |
| 101 | </td> | 102 | </td> |
| 102 | <td colspan="2" class="tdright"><i class="requisite">*</i>地址</td> | 103 | <td colspan="2" class="tdright"><i class="requisite">*</i>地址</td> |
| ... | @@ -465,14 +466,21 @@ | ... | @@ -465,14 +466,21 @@ |
| 465 | } | 466 | } |
| 466 | }, | 467 | }, |
| 467 | 468 | ||
| 468 | inputBlur(e){ | 469 | // inputBlur(e){ |
| 469 | if(e.target.value!=''){ | 470 | // if(e.target.value!=''){ |
| 470 | e.target.style.border="" | 471 | // console.log(e.target.value) |
| 471 | }else{ | 472 | // console.log(!(/^1(3|4|5|6|7|8|9)d{9}$/.test(e.target.value))) |
| 472 | e.target.style.border="1px solid red"; | 473 | // if(!(/^1(3|4|5|6|7|8|9)d{9}$/.test(e.target.value))){ |
| 473 | e.target.style.boxSizing = 'border-box'; | 474 | // e.target.style.border="1px solid red"; |
| 474 | } | 475 | // e.target.style.boxSizing = 'border-box'; |
| 475 | }, | 476 | // }else { |
| 477 | // e.target.style.border="" | ||
| 478 | // } | ||
| 479 | // }else{ | ||
| 480 | // e.target.style.border="1px solid red"; | ||
| 481 | // e.target.style.boxSizing = 'border-box'; | ||
| 482 | // } | ||
| 483 | // }, | ||
| 476 | 484 | ||
| 477 | //删除行数据 | 485 | //删除行数据 |
| 478 | delRow() { | 486 | delRow() { | ... | ... |
| ... | @@ -81,6 +81,12 @@ const constantRoutes = [ | ... | @@ -81,6 +81,12 @@ const constantRoutes = [ |
| 81 | name: "地图", | 81 | name: "地图", |
| 82 | code: "0-6", | 82 | code: "0-6", |
| 83 | component: () => import("@/views/systemTX/map"), | 83 | component: () => import("@/views/systemTX/map"), |
| 84 | }, | ||
| 85 | { | ||
| 86 | path: "/manage", | ||
| 87 | name: "系统管理", | ||
| 88 | code: "0-7", | ||
| 89 | component: () => import("@/views/manage/index"), | ||
| 84 | } | 90 | } |
| 85 | ], | 91 | ], |
| 86 | }, | 92 | }, | ... | ... |
| ... | @@ -105,6 +105,10 @@ export default { | ... | @@ -105,6 +105,10 @@ export default { |
| 105 | path: "/search", | 105 | path: "/search", |
| 106 | select: false, | 106 | select: false, |
| 107 | }, | 107 | }, |
| 108 | { | ||
| 109 | path: "/manage", | ||
| 110 | select: false, | ||
| 111 | }, | ||
| 108 | ], | 112 | ], |
| 109 | // 上导航选中id | 113 | // 上导航选中id |
| 110 | indId: undefined, | 114 | indId: undefined, |
| ... | @@ -199,6 +203,11 @@ export default { | ... | @@ -199,6 +203,11 @@ export default { |
| 199 | icon: "iconfont iconzonghechaxun", | 203 | icon: "iconfont iconzonghechaxun", |
| 200 | path: "/search", | 204 | path: "/search", |
| 201 | }, | 205 | }, |
| 206 | { | ||
| 207 | name: "系统管理", | ||
| 208 | icon: "iconfont iconzonghechaxun", | ||
| 209 | path: "/manage", | ||
| 210 | } | ||
| 202 | ]; | 211 | ]; |
| 203 | this.navigationList = list; | 212 | this.navigationList = list; |
| 204 | } | 213 | } | ... | ... |
src/views/manage/dictionary/index.vue
0 → 100644
src/views/manage/index.vue
0 → 100644
| 1 | <template> | ||
| 2 | <div> | ||
| 3 | <el-tabs v-model="activeName" class="tabs" @tab-click="handleClick"> | ||
| 4 | <el-tab-pane label="日志管理" name="log"><log></log></el-tab-pane> | ||
| 5 | <el-tab-pane label="字典管理" name="dictionary"><dictionary></dictionary></el-tab-pane> | ||
| 6 | </el-tabs> | ||
| 7 | </div> | ||
| 8 | </template> | ||
| 9 | |||
| 10 | <script> | ||
| 11 | import log from "./log/index" | ||
| 12 | import dictionary from "./dictionary/index" | ||
| 13 | export default { | ||
| 14 | name: "index", | ||
| 15 | components: { | ||
| 16 | log,dictionary | ||
| 17 | }, | ||
| 18 | data() { | ||
| 19 | return { | ||
| 20 | activeName: "log", | ||
| 21 | }; | ||
| 22 | }, | ||
| 23 | methods: { | ||
| 24 | handleClick(tab, event) { | ||
| 25 | }, | ||
| 26 | }, | ||
| 27 | created() {}, | ||
| 28 | mounted() {}, | ||
| 29 | computed: {}, | ||
| 30 | watch: {}, | ||
| 31 | } | ||
| 32 | </script> | ||
| 33 | |||
| 34 | <style scoped> | ||
| 35 | |||
| 36 | </style> | ||
| ... | \ No newline at end of file | ... | \ No newline at end of file |
src/views/manage/log/index.vue
0 → 100644
| 1 | <template> | ||
| 2 | <div class="log-content"> | ||
| 3 | <div class="log-search"> | ||
| 4 | 开始时间: | ||
| 5 | <el-date-picker | ||
| 6 | v-model="startValue" | ||
| 7 | type="datetime" | ||
| 8 | placeholder="选择日期时间" | ||
| 9 | align="right" | ||
| 10 | value-format="yyyy-MM-dd HH:mm:ss" | ||
| 11 | :picker-options="pickerOptions"> | ||
| 12 | </el-date-picker> | ||
| 13 | 结束时间: | ||
| 14 | <el-date-picker | ||
| 15 | v-model="endValue" | ||
| 16 | type="datetime" | ||
| 17 | placeholder="选择日期时间" | ||
| 18 | align="right" | ||
| 19 | value-format="yyyy-MM-dd HH:mm:ss" | ||
| 20 | :picker-options="pickerOptions"> | ||
| 21 | </el-date-picker> | ||
| 22 | <el-button type="primary" @click="query">查询</el-button> | ||
| 23 | <el-button type="warning" @click="reset">重置</el-button> | ||
| 24 | <el-button type="info" @click="getError">错误日志</el-button> | ||
| 25 | </div> | ||
| 26 | |||
| 27 | <el-dialog title="错误日志" :visible.sync="outerVisible"> | ||
| 28 | <div v-for="item in errorLog"> | ||
| 29 | {{item.name}} | ||
| 30 | {{item.value}} | ||
| 31 | </div> | ||
| 32 | </el-dialog> | ||
| 33 | |||
| 34 | <div class="log-table"> | ||
| 35 | <el-table :data="tableData"> | ||
| 36 | <el-table-column type="index" width="80" align="center" label="序号"> | ||
| 37 | </el-table-column> | ||
| 38 | <el-table-column prop="operationtype" align="center" label="操作类型"> | ||
| 39 | </el-table-column> | ||
| 40 | <el-table-column prop="username" align="center" width="100" label="操作人"> | ||
| 41 | </el-table-column> | ||
| 42 | <el-table-column prop="addtime" align="center" label="操作时间"> | ||
| 43 | </el-table-column> | ||
| 44 | </el-table> | ||
| 45 | </div> | ||
| 46 | </div> | ||
| 47 | </template> | ||
| 48 | |||
| 49 | <script> | ||
| 50 | import {getLogData,getErrorLog} from "@api/manage"; | ||
| 51 | export default { | ||
| 52 | name: "index", | ||
| 53 | data(){ | ||
| 54 | return{ | ||
| 55 | tableData:[], | ||
| 56 | errorLog:[], | ||
| 57 | |||
| 58 | outerVisible: false, | ||
| 59 | innerVisible: false, | ||
| 60 | |||
| 61 | pickerOptions: { | ||
| 62 | shortcuts: [{ | ||
| 63 | text: '今天', | ||
| 64 | onClick(picker) { | ||
| 65 | picker.$emit('pick', new Date()); | ||
| 66 | } | ||
| 67 | }, { | ||
| 68 | text: '昨天', | ||
| 69 | onClick(picker) { | ||
| 70 | const date = new Date(); | ||
| 71 | date.setTime(date.getTime() - 3600 * 1000 * 24); | ||
| 72 | picker.$emit('pick', date); | ||
| 73 | } | ||
| 74 | }, { | ||
| 75 | text: '一周前', | ||
| 76 | onClick(picker) { | ||
| 77 | const date = new Date(); | ||
| 78 | date.setTime(date.getTime() - 3600 * 1000 * 24 * 7); | ||
| 79 | picker.$emit('pick', date); | ||
| 80 | } | ||
| 81 | }] | ||
| 82 | }, | ||
| 83 | startValue: '', | ||
| 84 | endValue:'', | ||
| 85 | |||
| 86 | } | ||
| 87 | }, | ||
| 88 | methods:{ | ||
| 89 | getData(){ | ||
| 90 | let data={ | ||
| 91 | "startTime": "", | ||
| 92 | "pageNo": 1, | ||
| 93 | "pageSize": 50 | ||
| 94 | }; | ||
| 95 | getLogData(data).then((res)=>{ | ||
| 96 | console.log(res.result); | ||
| 97 | this.tableData = res.result.records; | ||
| 98 | }) | ||
| 99 | }, | ||
| 100 | query(){ | ||
| 101 | let data={ | ||
| 102 | "startTime": this.startValue, | ||
| 103 | "endTime": this.endValue, | ||
| 104 | "pageNo": 1, | ||
| 105 | "pageSize": 50 | ||
| 106 | }; | ||
| 107 | getLogData(data).then((res)=>{ | ||
| 108 | console.log(res.result); | ||
| 109 | this.tableData = res.result.records; | ||
| 110 | }) | ||
| 111 | }, | ||
| 112 | getError(){ | ||
| 113 | getErrorLog().then((res)=>{ | ||
| 114 | console.log(res.result) | ||
| 115 | this.errorLog= res.result; | ||
| 116 | this.outerVisible = true; | ||
| 117 | }) | ||
| 118 | }, | ||
| 119 | reset(){ | ||
| 120 | this.startValue = ""; | ||
| 121 | this.endValue = ""; | ||
| 122 | } | ||
| 123 | }, | ||
| 124 | mounted() { | ||
| 125 | this.getData(); | ||
| 126 | } | ||
| 127 | } | ||
| 128 | </script> | ||
| 129 | |||
| 130 | <style scoped> | ||
| 131 | .log-content{ | ||
| 132 | width: 100%; | ||
| 133 | /*border: 1px solid red;*/ | ||
| 134 | } | ||
| 135 | .log-search{ | ||
| 136 | margin-top: 10px; | ||
| 137 | padding-left: 15px; | ||
| 138 | padding-top: 20px; | ||
| 139 | width: 100%; | ||
| 140 | border: 1px solid #a8adad; | ||
| 141 | height: 60px; | ||
| 142 | background-color: white; | ||
| 143 | } | ||
| 144 | .log-table{ | ||
| 145 | margin-top: 10px; | ||
| 146 | width: 100%; | ||
| 147 | border: 1px solid #a8adad; | ||
| 148 | } | ||
| 149 | .el-button { | ||
| 150 | width: 100px; | ||
| 151 | margin-left: 15px; | ||
| 152 | } | ||
| 153 | </style> | ||
| ... | \ No newline at end of file | ... | \ No newline at end of file |
-
Please register or sign in to post a comment