日志模块

master
sunzehua 9 months ago
parent b2652f3a04
commit 92339f4498

@ -2,13 +2,13 @@
<a-modal title="日志详情" :width="900" :visible="visible" :confirmLoading="confirmLoading" @cancel="handleCancel">
<a-spin :spinning="confirmLoading">
<a-form :model="form">
<a-row :gutter="24">
<!-- <a-row :gutter="24">
<a-col :md="12" :sm="24">
<a-form-item label="地址" :labelCol="labelCol" :wrapperCol="wrapperCol">
<a-input v-model="form.location" />
</a-form-item>
</a-col>
</a-row>
</a-row> -->
<a-row :gutter="24">
<a-col :md="12" :sm="24">
<a-form-item label="浏览器" :labelCol="labelCol" :wrapperCol="wrapperCol">
@ -24,26 +24,26 @@
<a-row :gutter="24">
<a-col :md="12" :sm="24">
<a-form-item label="请求参数" :labelCol="labelCol" :wrapperCol="wrapperCol">
<!-- <json-viewer
:value="JSON.parse(form.param)"
<json-viewer
:value="form.param"
:expand-depth="5"
boxed
sort
copyable
>
</json-viewer> -->
</json-viewer>
</a-form-item>
</a-col>
<a-col :md="12" :sm="24">
<a-form-item label="返回结果" :labelCol="labelCol" :wrapperCol="wrapperCol">
<!-- <json-viewer
:value="JSON.parse(form.result)"
<json-viewer
:value="form.result"
:expand-depth="5"
boxed
sort
copyable
>
</json-viewer> -->
</json-viewer>
</a-form-item>
</a-col>
</a-row>
@ -75,16 +75,23 @@ import JsonViewer from 'vue-json-viewer'
},
visible: false,
confirmLoading: false,
form: {}
form: {
result: '',
param: ''
}
}
},
methods: {
//
details(record) {
this.visible = true
setTimeout(() => {
this.form = record
}, 100)
if (record.param) {
record.param = JSON.parse(record.param)
}
if (record.result) {
record.result = JSON.parse(record.result)
}
this.form = record
this.confirmLoading = false
},
handleCancel() {
this.visible = false

@ -6,36 +6,37 @@
<a-row :gutter="48">
<a-col :md="20">
<a-row :gutter="48">
<a-col :md="6" :sm="24">
<a-form-item label="操作人名称">
<a-input v-model="queryParam.name" allow-clear placeholder="请输入操作人名称" />
<a-col :md="8" :sm="24">
<a-form-item label="url">
<a-select style="width: 100%" v-model="queryParam.url">
<a-select-option value="/BookingOrder/Save">
订舱详情保存/BookingOrder/Save
</a-select-option>
<a-select-option value="/BookingOrder/SaveDataInList">
订舱台账保存/BookingOrder/SaveDataInList
</a-select-option>
<a-select-option value="/BookingOrder/BachUpdate">
批量编辑台账/BookingOrder/BachUpdate
</a-select-option>
<a-select-option value="/BookingOrder/BachUpdateShipagency">
批量修改船代/BookingOrder/BachUpdateShipagency
</a-select-option>
</a-select>
</a-form-item>
</a-col>
<a-col :md="6" :sm="24">
<a-form-item label="请求方式">
<a-input v-model="queryParam.reqMethod" allow-clear placeholder="请求方式" />
<a-col :md="5" :sm="24">
<a-form-item label="业务ID">
<a-input v-model="queryParam.businessId" allow-clear placeholder="业务ID" />
</a-form-item>
</a-col>
<a-col :md="6" :sm="24">
<a-form-item label="是否成功">
<a-select v-model="queryParam.success" placeholder="请选择是否成功">
<a-select-option v-for="(item, index) in successDict" :key="index" :value="item.code">
{{ item.value }}</a-select-option
>
</a-select>
<a-form-item label="操作人名称">
<a-input v-model="queryParam.name" allow-clear placeholder="请输入操作人名称" />
</a-form-item>
</a-col>
<a-col :md="6" :sm="24">
<a-form-item label="操作时间">
<a-range-picker
v-model="queryParam.dates"
:show-time="{
hideDisabledOptions: true,
defaultValue: [moment('00:00:00', 'HH:mm:ss'), moment('23:59:59', 'HH:mm:ss')]
}"
format="YYYY-MM-DD HH:mm:ss"
:style="{ width: '100%' }"
/>
<a-col :md="5" :sm="24">
<a-form-item label="请求方式">
<a-input v-model="queryParam.reqMethod" allow-clear placeholder="请求方式" />
</a-form-item>
</a-col>
</a-row>
@ -63,8 +64,25 @@
<a-col :md="20">
<a-row :gutter="48">
<a-col :md="6" :sm="24">
<a-form-item label="url">
<a-input v-model="queryParam.url" allow-clear placeholder="url" />
<a-form-item label="是否成功">
<a-select v-model="queryParam.success" placeholder="请选择是否成功">
<a-select-option v-for="(item, index) in successDict" :key="index" :value="item.code">
{{ item.value }}</a-select-option
>
</a-select>
</a-form-item>
</a-col>
<a-col :md="6" :sm="24">
<a-form-item label="操作时间">
<a-range-picker
v-model="queryParam.dates"
:show-time="{
hideDisabledOptions: true,
defaultValue: [moment('00:00:00', 'HH:mm:ss'), moment('23:59:59', 'HH:mm:ss')]
}"
format="YYYY-MM-DD HH:mm:ss"
:style="{ width: '100%' }"
/>
</a-form-item>
</a-col>
<a-col :md="6" :sm="24">
@ -102,12 +120,6 @@
<span slot="name" slot-scope="text">
<ellipsis :length="10" tooltip>{{ text }}</ellipsis>
</span>
<span slot="url" slot-scope="text">
<ellipsis :length="10" tooltip>{{ text }}</ellipsis>
</span>
<span slot="opTime" slot-scope="text">
<ellipsis :length="10" tooltip>{{ text }}</ellipsis>
</span>
<span slot="action" slot-scope="text, record">
<span slot="action">
<a @click="handleLook(record)"></a>
@ -143,6 +155,7 @@ export default {
{
title: '请求方式',
dataIndex: 'reqMethod',
width: '80px',
scopedSlots: {
customRender: 'reqMethod',
sorter: true
@ -151,6 +164,7 @@ export default {
{
title: '执行结果',
dataIndex: 'success',
width: '80px',
scopedSlots: {
customRender: 'success',
sorter: true
@ -159,11 +173,13 @@ export default {
{
title: 'IP',
dataIndex: 'ip',
width: '130px',
sorter: true
},
{
title: '请求地址',
dataIndex: 'url',
width: '300px',
scopedSlots: {
customRender: 'url',
sorter: true
@ -172,6 +188,7 @@ export default {
{
title: '操作时间',
dataIndex: 'opTime',
width: '160px',
scopedSlots: {
customRender: 'opTime',
sorter: true
@ -180,6 +197,7 @@ export default {
{
title: '操作人',
dataIndex: 'name',
width: '100px',
scopedSlots: {
customRender: 'name',
sorter: true
@ -188,12 +206,13 @@ export default {
{
title: '操作人帐号',
dataIndex: 'account',
width: '150px',
sorter: true
},
{
title: '详情',
dataIndex: 'action',
width: '150px',
width: '80px',
scopedSlots: {
customRender: 'action'
}
@ -202,10 +221,6 @@ export default {
// Promise
loadData: parameter => {
return sysOpLogPage(Object.assign(parameter, this.switchingDate())).then(res => {
res.data.pageNo = res.data.pageIndex
res.data.totalPage = res.data.totalPages
res.data.totalCount = res.data.totalRows
res.data.rows = res.data.items
return res.data
})
},
@ -229,8 +244,12 @@ export default {
}
},
handleLook(row) {
this.$refs.detailsOplog.visible = true
this.$refs.detailsOplog.confirmLoading = true
sysOpLogdetail({ id: row.id }).then(res => {
if (res.success) {
this.$refs.detailsOplog.details(res.data)
}
})
},
successFilter(success) {

Loading…
Cancel
Save