feat: add operate log ui
This commit is contained in:
parent
642a284b33
commit
18e4647211
@ -1,5 +1,5 @@
|
||||
import { Result } from '@/request/Result'
|
||||
import { get } from '@/request/index'
|
||||
import { get, exportExcelPost } from '@/request/index'
|
||||
import type { pageRequest } from '@/api/type/common'
|
||||
import { type Ref } from 'vue'
|
||||
|
||||
@ -26,7 +26,21 @@ const getMenuList: () => Promise<Result<any>> = () => {
|
||||
return get(`${prefix}/menu_operate_option/`, undefined, undefined)
|
||||
}
|
||||
|
||||
const exportOperateLog: (
|
||||
param: any,
|
||||
loading?: Ref<boolean>
|
||||
) => void = (param, loading) => {
|
||||
exportExcelPost(
|
||||
'log.xlsx',
|
||||
`${prefix}/export/`,
|
||||
param,
|
||||
undefined,
|
||||
loading
|
||||
)
|
||||
}
|
||||
|
||||
export default {
|
||||
getOperateLog,
|
||||
getMenuList
|
||||
getMenuList,
|
||||
exportOperateLog
|
||||
}
|
||||
|
||||
@ -28,6 +28,7 @@
|
||||
/>
|
||||
</div>
|
||||
|
||||
<div style="display: flex;">
|
||||
<div class="flex-between complex-search">
|
||||
<el-select
|
||||
v-model="filter_type"
|
||||
@ -66,6 +67,8 @@
|
||||
clearable
|
||||
/>
|
||||
</div>
|
||||
<el-button @click="exportLog" style="margin-left: 10px;">{{ $t('common.export') }}</el-button>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<app-table
|
||||
@ -275,7 +278,7 @@ function handleSizeChange() {
|
||||
getList()
|
||||
}
|
||||
|
||||
function getList() {
|
||||
function getRequestParams() {
|
||||
let obj: any = {
|
||||
start_time: daterange.value.start_time,
|
||||
end_time: daterange.value.end_time
|
||||
@ -289,7 +292,11 @@ function getList() {
|
||||
if(operateTypeArr.value.length > 0) {
|
||||
obj['menu'] = JSON.stringify(operateTypeArr.value)
|
||||
}
|
||||
return operateLog.getOperateLog(paginationConfig, obj, loading).then((res) => {
|
||||
return obj
|
||||
}
|
||||
|
||||
function getList() {
|
||||
return operateLog.getOperateLog(paginationConfig, getRequestParams(), loading).then((res) => {
|
||||
tableData.value = res.data.records
|
||||
paginationConfig.total = res.data.total
|
||||
})
|
||||
@ -306,6 +313,10 @@ function getMenuList() {
|
||||
})
|
||||
}
|
||||
|
||||
const exportLog = () => {
|
||||
operateLog.exportOperateLog(getRequestParams(), loading)
|
||||
}
|
||||
|
||||
onMounted(() => {
|
||||
getMenuList()
|
||||
changeDayHandle(history_day.value)
|
||||
|
||||
Loading…
Reference in New Issue
Block a user