fix: 操作日志查询类型
This commit is contained in:
@@ -16,6 +16,9 @@ export async function listOperationLog(query: Record<string, any>) {
|
|||||||
if (query.accountName) {
|
if (query.accountName) {
|
||||||
querySQL += ` and account_name like '%${query.accountName}%' `;
|
querySQL += ` and account_name like '%${query.accountName}%' `;
|
||||||
}
|
}
|
||||||
|
if (query.opType) {
|
||||||
|
querySQL += ` and op_type = '${query.opType}' `;
|
||||||
|
}
|
||||||
if (query.beginTime) {
|
if (query.beginTime) {
|
||||||
querySQL += ` and begin_time >= '${query.beginTime}' `;
|
querySQL += ` and begin_time >= '${query.beginTime}' `;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -8,17 +8,29 @@ import { ColumnsType } from 'ant-design-vue/lib/table';
|
|||||||
import { parseDateToStr } from '@/utils/date-utils';
|
import { parseDateToStr } from '@/utils/date-utils';
|
||||||
import { RESULT_CODE_SUCCESS } from '@/constants/result-constants';
|
import { RESULT_CODE_SUCCESS } from '@/constants/result-constants';
|
||||||
import { listOperationLog } from '@/api/logManage/operation';
|
import { listOperationLog } from '@/api/logManage/operation';
|
||||||
|
import useDictStore from '@/store/modules/dict';
|
||||||
import useI18n from '@/hooks/useI18n';
|
import useI18n from '@/hooks/useI18n';
|
||||||
|
const { getDict } = useDictStore();
|
||||||
const { t } = useI18n();
|
const { t } = useI18n();
|
||||||
const route = useRoute();
|
const route = useRoute();
|
||||||
|
|
||||||
/**路由标题 */
|
/**路由标题 */
|
||||||
let title = ref<string>((route.meta.title as string) ?? '标题');
|
let title = ref<string>((route.meta.title as string) ?? '标题');
|
||||||
|
|
||||||
|
/**字典数据 */
|
||||||
|
let dict: {
|
||||||
|
/**操作日志操作类型 */
|
||||||
|
operationLogType: DictType[];
|
||||||
|
} = reactive({
|
||||||
|
operationLogType: [],
|
||||||
|
});
|
||||||
|
|
||||||
/**查询参数 */
|
/**查询参数 */
|
||||||
let queryParams = reactive({
|
let queryParams = reactive({
|
||||||
/**登录账号 */
|
/**登录账号 */
|
||||||
accountName: '',
|
accountName: '',
|
||||||
|
/**操作类型 */
|
||||||
|
opType: undefined,
|
||||||
/**记录时间 */
|
/**记录时间 */
|
||||||
beginTime: '',
|
beginTime: '',
|
||||||
endTime: '',
|
endTime: '',
|
||||||
@@ -32,8 +44,9 @@ let queryParams = reactive({
|
|||||||
function fnQueryReset() {
|
function fnQueryReset() {
|
||||||
queryParams = Object.assign(queryParams, {
|
queryParams = Object.assign(queryParams, {
|
||||||
accountName: '',
|
accountName: '',
|
||||||
|
opType: undefined,
|
||||||
beginTime: '',
|
beginTime: '',
|
||||||
endTime: undefined,
|
endTime: '',
|
||||||
pageNum: 1,
|
pageNum: 1,
|
||||||
pageSize: 20,
|
pageSize: 20,
|
||||||
});
|
});
|
||||||
@@ -92,6 +105,7 @@ let tableColumns: ColumnsType = [
|
|||||||
{
|
{
|
||||||
title: '操作类型',
|
title: '操作类型',
|
||||||
dataIndex: 'opType',
|
dataIndex: 'opType',
|
||||||
|
key: 'opType',
|
||||||
align: 'center',
|
align: 'center',
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
@@ -181,6 +195,12 @@ function fnGetList() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
onMounted(() => {
|
onMounted(() => {
|
||||||
|
// 初始字典数据
|
||||||
|
Promise.allSettled([getDict('operation_log_type')]).then(resArr => {
|
||||||
|
if (resArr[0].status === 'fulfilled') {
|
||||||
|
dict.operationLogType = resArr[0].value;
|
||||||
|
}
|
||||||
|
});
|
||||||
// 获取列表数据
|
// 获取列表数据
|
||||||
fnGetList();
|
fnGetList();
|
||||||
});
|
});
|
||||||
@@ -205,6 +225,17 @@ onMounted(() => {
|
|||||||
></a-input>
|
></a-input>
|
||||||
</a-form-item>
|
</a-form-item>
|
||||||
</a-col>
|
</a-col>
|
||||||
|
<a-col :lg="6" :md="12" :xs="24">
|
||||||
|
<a-form-item label="操作类型" name="opType">
|
||||||
|
<a-select
|
||||||
|
v-model:value="queryParams.opType"
|
||||||
|
allow-clear
|
||||||
|
placeholder="请选择操作类型"
|
||||||
|
:options="dict.operationLogType"
|
||||||
|
>
|
||||||
|
</a-select>
|
||||||
|
</a-form-item>
|
||||||
|
</a-col>
|
||||||
<a-col :lg="6" :md="12" :xs="24">
|
<a-col :lg="6" :md="12" :xs="24">
|
||||||
<a-form-item label="开始时间" name="beginTime">
|
<a-form-item label="开始时间" name="beginTime">
|
||||||
<a-date-picker
|
<a-date-picker
|
||||||
@@ -213,6 +244,7 @@ onMounted(() => {
|
|||||||
value-format="YYYY-MM-DD HH:mm:ss"
|
value-format="YYYY-MM-DD HH:mm:ss"
|
||||||
format="YYYY-MM-DD HH:mm:ss"
|
format="YYYY-MM-DD HH:mm:ss"
|
||||||
placeholder="查询结束时间"
|
placeholder="查询结束时间"
|
||||||
|
style="width: 100%"
|
||||||
/>
|
/>
|
||||||
</a-form-item>
|
</a-form-item>
|
||||||
</a-col>
|
</a-col>
|
||||||
@@ -224,6 +256,7 @@ onMounted(() => {
|
|||||||
value-format="YYYY-MM-DD HH:mm:ss"
|
value-format="YYYY-MM-DD HH:mm:ss"
|
||||||
format="YYYY-MM-DD HH:mm:ss"
|
format="YYYY-MM-DD HH:mm:ss"
|
||||||
placeholder="查询结束时间"
|
placeholder="查询结束时间"
|
||||||
|
style="width: 100%"
|
||||||
/>
|
/>
|
||||||
</a-form-item>
|
</a-form-item>
|
||||||
</a-col>
|
</a-col>
|
||||||
@@ -306,6 +339,11 @@ onMounted(() => {
|
|||||||
:pagination="tablePagination"
|
:pagination="tablePagination"
|
||||||
:scroll="{ x: true }"
|
:scroll="{ x: true }"
|
||||||
>
|
>
|
||||||
|
<template #bodyCell="{ column, record }">
|
||||||
|
<template v-if="column.key === 'opType'">
|
||||||
|
<DictTag :options="dict.operationLogType" :value="record.opType" />
|
||||||
|
</template>
|
||||||
|
</template>
|
||||||
</a-table>
|
</a-table>
|
||||||
</a-card>
|
</a-card>
|
||||||
</PageContainer>
|
</PageContainer>
|
||||||
|
|||||||
Reference in New Issue
Block a user