feat: add operate log ui
This commit is contained in:
parent
642a284b33
commit
18e4647211
@ -1,5 +1,5 @@
|
|||||||
import { Result } from '@/request/Result'
|
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 { pageRequest } from '@/api/type/common'
|
||||||
import { type Ref } from 'vue'
|
import { type Ref } from 'vue'
|
||||||
|
|
||||||
@ -26,7 +26,21 @@ const getMenuList: () => Promise<Result<any>> = () => {
|
|||||||
return get(`${prefix}/menu_operate_option/`, undefined, undefined)
|
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 {
|
export default {
|
||||||
getOperateLog,
|
getOperateLog,
|
||||||
getMenuList
|
getMenuList,
|
||||||
|
exportOperateLog
|
||||||
}
|
}
|
||||||
|
|||||||
@ -28,43 +28,46 @@
|
|||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="flex-between complex-search">
|
<div style="display: flex;">
|
||||||
<el-select
|
<div class="flex-between complex-search">
|
||||||
v-model="filter_type"
|
<el-select
|
||||||
class="complex-search__left"
|
v-model="filter_type"
|
||||||
@change="changeFilterHandle"
|
class="complex-search__left"
|
||||||
style="width: 120px"
|
@change="changeFilterHandle"
|
||||||
>
|
style="width: 120px"
|
||||||
<el-option
|
>
|
||||||
v-for="item in filterOptions"
|
<el-option
|
||||||
:key="item.value"
|
v-for="item in filterOptions"
|
||||||
:label="item.label"
|
:key="item.value"
|
||||||
:value="item.value"
|
:label="item.label"
|
||||||
|
:value="item.value"
|
||||||
|
/>
|
||||||
|
</el-select>
|
||||||
|
<el-select
|
||||||
|
v-if="filter_type === 'status'"
|
||||||
|
v-model="filter_status"
|
||||||
|
@change="changeStatusHandle"
|
||||||
|
style="width: 220px"
|
||||||
|
clearable
|
||||||
|
>
|
||||||
|
<el-option
|
||||||
|
v-for="item in statusOptions"
|
||||||
|
:key="item.value"
|
||||||
|
:label="item.label"
|
||||||
|
:value="item.value"
|
||||||
|
/>
|
||||||
|
</el-select>
|
||||||
|
<el-input
|
||||||
|
v-else
|
||||||
|
v-model="searchValue"
|
||||||
|
@change="getList"
|
||||||
|
:placeholder="$t('common.search')"
|
||||||
|
prefix-icon="Search"
|
||||||
|
style="width: 220px"
|
||||||
|
clearable
|
||||||
/>
|
/>
|
||||||
</el-select>
|
</div>
|
||||||
<el-select
|
<el-button @click="exportLog" style="margin-left: 10px;">{{ $t('common.export') }}</el-button>
|
||||||
v-if="filter_type === 'status'"
|
|
||||||
v-model="filter_status"
|
|
||||||
@change="changeStatusHandle"
|
|
||||||
style="width: 220px"
|
|
||||||
clearable
|
|
||||||
>
|
|
||||||
<el-option
|
|
||||||
v-for="item in statusOptions"
|
|
||||||
:key="item.value"
|
|
||||||
:label="item.label"
|
|
||||||
:value="item.value"
|
|
||||||
/>
|
|
||||||
</el-select>
|
|
||||||
<el-input
|
|
||||||
v-else
|
|
||||||
v-model="searchValue"
|
|
||||||
@change="getList"
|
|
||||||
:placeholder="$t('common.search')"
|
|
||||||
prefix-icon="Search"
|
|
||||||
style="width: 220px"
|
|
||||||
clearable
|
|
||||||
/>
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
@ -275,7 +278,7 @@ function handleSizeChange() {
|
|||||||
getList()
|
getList()
|
||||||
}
|
}
|
||||||
|
|
||||||
function getList() {
|
function getRequestParams() {
|
||||||
let obj: any = {
|
let obj: any = {
|
||||||
start_time: daterange.value.start_time,
|
start_time: daterange.value.start_time,
|
||||||
end_time: daterange.value.end_time
|
end_time: daterange.value.end_time
|
||||||
@ -289,7 +292,11 @@ function getList() {
|
|||||||
if(operateTypeArr.value.length > 0) {
|
if(operateTypeArr.value.length > 0) {
|
||||||
obj['menu'] = JSON.stringify(operateTypeArr.value)
|
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
|
tableData.value = res.data.records
|
||||||
paginationConfig.total = res.data.total
|
paginationConfig.total = res.data.total
|
||||||
})
|
})
|
||||||
@ -306,6 +313,10 @@ function getMenuList() {
|
|||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
|
const exportLog = () => {
|
||||||
|
operateLog.exportOperateLog(getRequestParams(), loading)
|
||||||
|
}
|
||||||
|
|
||||||
onMounted(() => {
|
onMounted(() => {
|
||||||
getMenuList()
|
getMenuList()
|
||||||
changeDayHandle(history_day.value)
|
changeDayHandle(history_day.value)
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user