Commit 5cc88147 authored by 周远喜's avatar 周远喜

异常日志功能开发。

parent 3e77715f
import Api from '@/plugins/request'
export default {
index:`${systemUrl}/runlog/paged`,
paged(params){
return Api.post(`${systemUrl}/runlog/paged`,params);
index: `${systemUrl}/runlog/paged`,
paged(params) {
return Api.post(`${systemUrl}/runlog/paged`, params);
},
get(params){
return Api.get(`${systemUrl}/runlog/get`,params);
get(params) {
return Api.get(`${systemUrl}/runlog/get`, params);
},
create(params){
return Api.post(`${systemUrl}/runlog/create`,params);
create(params) {
return Api.post(`${systemUrl}/runlog/create`, params);
},
update(params){
return Api.post(`${systemUrl}/runlog/update`,params);
update(params) {
return Api.post(`${systemUrl}/runlog/update`, params);
},
delete(id) {
return Api.delete(`${systemUrl}/runlog/delete`,{params:{id:id}});
return Api.delete(`${systemUrl}/runlog/delete`, {
params: {
id: id
}
});
// return Api.post(`${systemUrl}/runlog/delete`,{params:{id:id}});
},
deletes(params) {
return Api.post(`${systemUrl}/runlog/batchdelete`,params);
}
deleteAll(end) {
return Api.post(`${systemUrl}/runlog/deletebefore`, {
dateTime: end
});
}
}
......@@ -2,16 +2,16 @@
<div class="detail">
<Row>
<Filed :span="12" :name="l('creationTime')">{{entity.creationTime}}</Filed>
<!-- <Filed :span="12" :name="l('creationTime')">{{entity.creationTime}}</Filed>
<Filed :span="12" :name="l('creatorUserId')">{{entity.creatorUserId}}</Filed>
<Filed :span="12" :name="l('lastModificationTime')">{{entity.lastModificationTime}}</Filed>
<Filed :span="12" :name="l('lastModifierUserId')">{{entity.lastModifierUserId}}</Filed>
<Filed :span="12" :name="l('isDeleted')">{{entity.isDeleted}}</Filed>
<Filed :span="12" :name="l('deletionTime')">{{entity.deletionTime}}</Filed>
<Filed :span="12" :name="l('deleterUserId')">{{entity.deleterUserId}}</Filed>
<Filed :span="12" :name="l('deleterUserId')">{{entity.deleterUserId}}</Filed> -->
<Filed :span="12" :name="l('timestamp')">{{entity.timestamp}}</Filed>
<Filed :span="12" :name="l('level')">{{entity.level}}</Filed>
<Filed :span="12" :name="l('messageTemplate')">{{entity.messageTemplate}}</Filed>
<!-- <Filed :span="12" :name="l('messageTemplate')">{{entity.messageTemplate}}</Filed> -->
<Filed :span="12" :name="l('renderedMessage')">{{entity.renderedMessage}}</Filed>
<Filed :span="12" :name="l('clientIpAddress')">{{entity.clientIpAddress}}</Filed>
<Filed :span="12" :name="l('loginName')">{{entity.loginName}}</Filed>
......@@ -20,9 +20,8 @@
<Filed :span="12" :name="l('status')">{{entity.status}}</Filed>
<Filed :span="12" :name="l('requestUrl')">{{entity.requestUrl}}</Filed>
<Filed :span="12" :name="l('requestParam')">{{entity.requestParam}}</Filed>
<Filed :span="12" :name="l('exception')">{{entity.exception}}</Filed>
<Filed :span="24" :name="l('exception')">{{entity.exception}}</Filed>
</Row>
</div>
</template>
<script>
......
<template>
<div>
<DataGrid :columns="columns" ref="grid" :action="action"><template slot="easySearch"><Form ref="formInline" :model="easySearch" inline><FormItem prop="keys"><Input placeholder="请输入关键字登录账号/租户编号" v-model="easySearch.keys.value" /> </FormItem>
<FormItem><Button type="primary" @click="search">查询</Button></FormItem>
</Form></template>
<DataGrid :columns="columns" ref="grid" :action="action">
<template slot="easySearch">
<Form ref="formInline" :model="easySearch" inline>
<FormItem prop="keys">
<Input placeholder="请输入关键字登录账号/租户编号" v-model="easySearch.keys.value" v-width="300"/>
</FormItem>
<FormItem>
<Button type="primary" @click="search">查询</Button>
</FormItem>
</Form>
</template>
<template slot="searchForm">
<Search />
</template>
<template slot="buttons">
<!-- <Button type="primary" @click="add">新增</Button> -->
<DatePicker type="date" v-model="end" placeholder="选择终止日期" style="width: 150px"></DatePicker>
<Button type="error" @click="clear">清理</Button>
</template>
</DataGrid>
<Modal v-model="modal" :title="title" width="1200" footer-hide>
<Modal v-model="modal" :title="title" fullscreen footer-hide>
<component :is="detail" :eid="curId" @on-close="cancel" @on-ok="ok" />
</Modal>
</div>
</template>
<script>
import Api from './api'
import Search from './search'
import Api from "./api";
import Search from "./search";
export default {
name: 'list',
components:{
Search
name: "list",
components: {
Search,
},
head: {
title: "系统异常日志",
author: "henq",
description: "run_log 7/23/2020 10:55:35 AM",
},
},
data() {
return {
action: Api.index,
easySearch: {
keys:{op:"loginName,tanentCode",value:null}
},
keys: { op: "loginName,tanentCode", value: null },
},
end:null,
modal: false,
title:"新增",
detail:null,
title: "新增",
detail: null,
curId: 0,
columns: [
{ key:"id",title:this.$t("id") ,hide:true ,align:"left" ,high:true },
{
key: "id",
title: this.$t("id"),
hide: true,
align: "left",
high: true,
},
// { key:"creationTime",title:this.l("creationTime") ,align:"left" ,high:true },
// { key:"creatorUserId",title:this.l("creatorUserId") ,align:"left" ,high:true },
// { key:"lastModificationTime",title:this.l("lastModificationTime") ,align:"left" ,high:true },
......@@ -48,86 +64,176 @@ keys:{op:"loginName,tanentCode",value:null}
// { key:"deletionTime",title:this.l("deletionTime") ,align:"left" ,high:true },
// { key:"deleterUserId",title:this.l("deleterUserId") ,align:"left" ,high:true },
{ key:"level",title:this.l("level") ,align:"left" ,high:true ,width:100 },
{ key:"requestUrl",title:this.l("requestUrl") ,align:"left" ,width:300 ,high:true ,tooltip:true },
{
key: "level",
title: this.l("level"),
align: "left",
high: true,
width: 100,
},
{
key: "requestUrl",
title: this.l("requestUrl"),
align: "left",
width: 300,
high: true,
tooltip: true,
},
// { key:"messageTemplate",title:this.l("messageTemplate") ,align:"left" ,high:true },
{ key:"renderedMessage",title:this.l("renderedMessage") ,align:"left" ,high:true ,tooltip:true },
{ key:"timestamp",title:this.l("timestamp") ,align:"left" ,high:true ,width:200 },
{ key:"clientIpAddress",title:this.l("clientIpAddress") ,align:"left" ,width:150 ,high:true },
{ key:"loginName",title:this.l("loginName") ,align:"left" ,easy:true ,high:true ,width:150 },
{ key:"tanentCode",title:this.l("tanentCode") ,align:"left" ,easy:true ,high:true ,width:80 },
{ key:"host",title:this.l("host") ,align:"left",hide:true ,high:true },
{
key: "renderedMessage",
title: this.l("renderedMessage"),
align: "left",
high: true,
tooltip: true,
},
{
key: "timestamp",
title: this.l("timestamp"),
align: "left",
high: true,
width: 200,
},
{
key: "clientIpAddress",
title: this.l("clientIpAddress"),
align: "left",
width: 150,
high: true,
},
{
key: "loginName",
title: this.l("loginName"),
align: "left",
easy: true,
high: true,
width: 150,
},
{
key: "tanentCode",
title: this.l("tanentCode"),
align: "left",
easy: true,
high: true,
width: 80,
},
{
key: "host",
title: this.l("host"),
align: "left",
hide: true,
high: true,
},
// { key:"status",title:this.l("status") ,align:"left" ,high:true },
{ key:"requestParam",title:this.l("requestParam") ,hide:true ,align:"left" ,high:true },
{
key: "requestParam",
title: this.l("requestParam"),
hide: true,
align: "left",
high: true,
},
// { key:"exception",title:this.l("exception") ,align:"left" ,high:true },
{
title: '操作',
key: 'action',
title: "操作",
key: "action",
width: 140,
align: 'center',
align: "center",
render: (h, params) => {
return h('div', { class: "action" }, [
h('op', { attrs: { oprate: 'detail' }, on: { click: () => this.view(params.row.id) } }, '查看'),
return h("div", { class: "action" }, [
h(
"op",
{
attrs: { oprate: "detail" },
on: { click: () => this.view(params.row.id) },
},
"查看"
),
//h('op', { attrs: { oprate: 'copy' }, on: { click: () => this.copy(params.row.id) } }, '克隆'),
// h('op', { attrs: { oprate: 'edit'}, on: { click: () => this.edit(params.row.id) } }, '编辑'),
h('op', { attrs: { oprate: 'delete' }, on: { click: () => this.remove(params.row.id) } }, '删除')
])
}
h(
"op",
{
attrs: { oprate: "delete" },
on: { click: () => this.remove(params.row.id) },
},
"删除"
),
]);
},
]
}
},
mounted(){
],
};
},
mounted() {
var date=new Date().getTime()-24*60*60*1000*5;
this.end=new Date(date);
console.log(this);
},
async fetch({ store, params }) {
await store.dispatch('loadDictionary') // 加载数据字典
await store.dispatch("loadDictionary"); // 加载数据字典
},
methods:{
methods: {
ok() {
this.$refs.grid.load()
this.modal = false
this.$refs.grid.load();
this.modal = false;
this.curId = 0;
},
search() {
this.$refs.grid.reload(this.easySearch)
this.$refs.grid.reload(this.easySearch);
},
add() {
this.curId = 0;
this.title = "新增";
this.detail =()=> import('./add')
this.detail = () => import("./add");
this.modal = true;
},
copy(id) {
this.curId = id;
this.title = "克隆";
this.detail = () =>import('./add')
this.detail = () => import("./add");
this.modal = true;
},
view(id) {
this.curId = id;
this.title = "详情";
this.detail = () =>import('./detail')
this.detail = () => import("./detail");
this.modal = true;
},
edit(id) {
this.curId = id;
this.title = "编辑";
this.detail = () => import('./edit')
this.detail = () => import("./edit");
this.modal = true;
},
remove(id) {
Api.delete(id).then((r) => {
if (r.success) {
this.$refs.grid.load();
this.$Message.success('删除成功')
this.$Message.success("删除成功");
}
});
},
clear(){
this.$Modal.confirm({
title:"确认",
content:"确认要删除"+this.end+"以前的数据吗",
onOk:()=>{
Api.deleteAll(this.end).then(r=>{
if(r.success){
this.$Message.success("删除成功")
this.$refs.grid.load();
}else{
this.$Message.error("出现异常")
}
})
}
})
},
cancel() {
this.curId = 0;
this.modal = false
this.modal = false;
},
l(key) {
/*
......@@ -154,10 +260,10 @@ keys:{op:"loginName,tanentCode",value:null}
}
*/
let vkey = "run_log" + "." + key;
return this.$t(vkey)||key
}
}
}
return this.$t(vkey) || key;
},
},
};
</script>
<style lang="less">
</style>
\ No newline at end of file
This diff is collapsed.
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment