| | |
| | | </template> |
| | | |
| | | <script> |
| | | import {getUsualList, getUsualLogs} from "@/api/logs"; |
| | | import { listLogOperate } from "@/api/logs"; |
| | | import {mapGetters} from "vuex"; |
| | | |
| | | export default { |
| | |
| | | form: {}, |
| | | selectionList: [], |
| | | query: {}, |
| | | //是否是三员管理员日志 |
| | | isAdmin: 0, |
| | | // LoginOrLogout:登录日志,auth:授权日志,operate:操作日志 |
| | | logType: "LoginOrLogout", |
| | | loading: true, |
| | | page: { |
| | | pageSize: 10, |
| | |
| | | column: [ |
| | | { |
| | | label: "用户名", |
| | | prop: "serviceId", |
| | | prop: "userName", |
| | | search: true |
| | | }, |
| | | { |
| | | label: "姓名", |
| | | prop: "serverHost", |
| | | prop: "realName", |
| | | search: true |
| | | }, |
| | | { |
| | | label: "用户id", |
| | | prop: "serverIp" |
| | | label: "用户ip", |
| | | prop: "ip" |
| | | }, |
| | | { |
| | | label: "模块", |
| | | prop: "env", |
| | | width:'80' |
| | | prop: "model", |
| | | width:'160' |
| | | }, |
| | | { |
| | | label: "时间", |
| | | prop: "logLevel" |
| | | prop: "time" |
| | | }, |
| | | { |
| | | label: "操作结果", |
| | | prop: "logId" |
| | | prop: "operateResult" |
| | | }, |
| | | { |
| | | label: "描述", |
| | | prop: "requestUri" |
| | | prop: "description" |
| | | }, |
| | | ] |
| | | }, |
| | |
| | | return { |
| | | viewBtn: this.vaildData(this.permission.log_usual.log_usual_view, false) |
| | | }; |
| | | } |
| | | }, |
| | | }, |
| | | methods: { |
| | | searchReset() { |
| | |
| | | this.page.currentPage = 1; |
| | | this.onLoad(this.page, params); |
| | | done(); |
| | | }, |
| | | underscoreName(key) { |
| | | return key.replace(/([A-Z])/g, "_$1").toLowerCase(); |
| | | }, |
| | | beforeOpen(done, type) { |
| | | if (["edit", "view"].includes(type)) { |
| | |
| | | this.onLoad(this.page, this.query); |
| | | }, |
| | | onLoad(page, params = {}) { |
| | | let conditionMaps = {}; |
| | | conditionMaps["conditionMap[is_admin]"] = this.isAdmin; |
| | | conditionMaps["conditionMap[log_type]"] = this.logType.trim(); |
| | | if (params) { |
| | | Object.keys(params).forEach((key) => { |
| | | conditionMaps["conditionMap[" + this.underscoreName(key) + "_like]"] = params[key].trim(); |
| | | }); |
| | | } |
| | | this.loading = true; |
| | | getUsualList(page.currentPage, page.pageSize, Object.assign(params, this.query)).then(res => { |
| | | listLogOperate( |
| | | page.currentPage, |
| | | page.pageSize, |
| | | conditionMaps |
| | | ).then(res => { |
| | | const data = res.data.data; |
| | | this.page.total = data.total; |
| | | this.data = data.records; |