4 changed files with 154 additions and 277 deletions
-
19src/api/system/waterMask.js
-
141src/views/system/log/index2.vue
-
47src/views/system/watermarkManage/index.vue
-
224src/views/system/watermarkManage/module/form.vue
@ -0,0 +1,19 @@ |
|||
import request from '@/utils/request' |
|||
|
|||
export function getInitWatermark(params) { |
|||
return request({ |
|||
url: 'api/watermark/initWatermark', |
|||
method: 'get', |
|||
params |
|||
}) |
|||
} |
|||
|
|||
export function edit(data) { |
|||
return request({ |
|||
url: 'api/watermark/editWatermark', |
|||
method: 'post', |
|||
data |
|||
}) |
|||
} |
|||
|
|||
export default { edit, getInitWatermark } |
@ -1,141 +0,0 @@ |
|||
<template> |
|||
<div> |
|||
<div class="head-container"> |
|||
<Search /> |
|||
<crudOperation> |
|||
<el-button |
|||
slot="left" |
|||
type="danger" |
|||
icon="el-icon-delete" |
|||
size="mini" |
|||
:loading="crud.delAllLoading" |
|||
@click="delVisible = true" |
|||
> |
|||
清空 |
|||
</el-button> |
|||
</crudOperation> |
|||
</div> |
|||
<!--表格渲染--> |
|||
<div class="app-container container-wrap" style="min-height: calc(100vh - 242px)"> |
|||
<span class="right-top-line" /> |
|||
<span class="left-bottom-line" /> |
|||
<el-table ref="table" v-loading="crud.loading" :data="crud.data" style="width: 100%;" @selection-change="crud.selectionChangeHandler"> |
|||
<el-table-column type="expand"> |
|||
<template slot-scope="props"> |
|||
<el-form label-position="left" inline class="demo-table-expand"> |
|||
<el-form-item label="请求方法"> |
|||
<span>{{ props.row.method }}</span> |
|||
</el-form-item> |
|||
<el-form-item label="请求参数"> |
|||
<span>{{ props.row.params }}</span> |
|||
</el-form-item> |
|||
</el-form> |
|||
</template> |
|||
</el-table-column> |
|||
<el-table-column prop="username" label="用户名" /> |
|||
<el-table-column prop="requestIp" label="IP" /> |
|||
<el-table-column :show-overflow-tooltip="true" prop="address" label="IP来源" /> |
|||
<el-table-column prop="description" label="描述" /> |
|||
<el-table-column prop="browser" label="浏览器" /> |
|||
<el-table-column prop="time" label="请求耗时" align="center"> |
|||
<template slot-scope="scope"> |
|||
<el-tag v-if="scope.row.time <= 300">{{ scope.row.time }}ms</el-tag> |
|||
<el-tag v-else-if="scope.row.time <= 1000" type="warning">{{ scope.row.time }}ms</el-tag> |
|||
<el-tag v-else type="danger">{{ scope.row.time }}ms</el-tag> |
|||
</template> |
|||
</el-table-column> |
|||
<el-table-column prop="createTime" label="创建日期" width="180px" /> |
|||
</el-table> |
|||
<!--分页组件--> |
|||
<pagination /> |
|||
<!-- 清空 --> |
|||
<el-dialog :visible.sync="delVisible" title="确认清空"> |
|||
<span class="dialog-right-top" /> |
|||
<span class="dialog-left-bottom" /> |
|||
<div class="setting-dialog"> |
|||
<p class="delMsg">确认清空所有操作日志吗?</p> |
|||
<div slot="footer" class="dialog-footer"> |
|||
<el-button type="primary" @click="confirmDelAll">确定</el-button> |
|||
</div> |
|||
</div> |
|||
</el-dialog> |
|||
</div> |
|||
|
|||
</div> |
|||
</template> |
|||
|
|||
<script> |
|||
import Search from './search' |
|||
import { delAllInfo } from '@/api/monitor/log' |
|||
import CRUD, { presenter } from '@crud/crud' |
|||
import crudOperation from '@crud/CRUD.operation' |
|||
import pagination from '@crud/Pagination' |
|||
|
|||
export default { |
|||
name: 'Log', |
|||
components: { Search, crudOperation, pagination }, |
|||
cruds() { |
|||
return CRUD({ title: '日志', url: 'api/logs' }) |
|||
}, |
|||
mixins: [presenter()], |
|||
data() { |
|||
return { |
|||
delVisible: false |
|||
} |
|||
}, |
|||
created() { |
|||
this.crud.optShow = { |
|||
add: false, |
|||
edit: false, |
|||
del: false, |
|||
download: true |
|||
} |
|||
}, |
|||
methods: { |
|||
confirmDelAll() { |
|||
// this.$confirm(`确认清空所有操作日志吗?`, '提示', { |
|||
// confirmButtonText: '确定', |
|||
// cancelButtonText: '取消', |
|||
// type: 'warning' |
|||
// }).then(() => { |
|||
this.crud.delAllLoading = true |
|||
delAllInfo().then(res => { |
|||
this.crud.delAllLoading = false |
|||
this.crud.dleChangePage(1) |
|||
this.crud.delSuccessNotify() |
|||
this.crud.toQuery() |
|||
this.delVisible = false |
|||
}).catch(err => { |
|||
this.crud.delAllLoading = false |
|||
console.log(err.response.data.message) |
|||
}) |
|||
// }) |
|||
} |
|||
} |
|||
} |
|||
</script> |
|||
|
|||
<style lang="scss" scoped> |
|||
.demo-table-expand { |
|||
font-size: 0; |
|||
} |
|||
.demo-table-expand label { |
|||
width: 70px; |
|||
color: #99a9bf; |
|||
} |
|||
.demo-table-expand .el-form-item { |
|||
margin-right: 0; |
|||
margin-bottom: 0; |
|||
width: 100%; |
|||
} |
|||
.demo-table-expand .el-form-item__content { |
|||
font-size: 12px; |
|||
} |
|||
::v-deep .head-container{ |
|||
display: flex; |
|||
padding-bottom: 0; |
|||
} |
|||
.head-search{ |
|||
margin-bottom:0 ; |
|||
} |
|||
</style> |
Write
Preview
Loading…
Cancel
Save
Reference in new issue