Compare commits
No commits in common. "67e58660ff0928fb56030093e736118bc3f0da50" and "c194d5fa7a02acccbd0e765c0fdef832815fc340" have entirely different histories.
67e58660ff
...
c194d5fa7a
@ -1,31 +0,0 @@
|
|||||||
import axios from 'axios';
|
|
||||||
|
|
||||||
export interface LogsRecord {
|
|
||||||
moduleType?: string;
|
|
||||||
functionType?: string;
|
|
||||||
publishTimeBegin?: string;
|
|
||||||
publishTimeEnd?: string;
|
|
||||||
current: number;
|
|
||||||
size: number;
|
|
||||||
}
|
|
||||||
|
|
||||||
// 日志分页查询
|
|
||||||
export function queryLogList(data: LogsRecord) {
|
|
||||||
return axios({
|
|
||||||
url: '/api/rest/log',
|
|
||||||
method: 'get',
|
|
||||||
params: data,
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
// 日志详情
|
|
||||||
export function queryLogDetail(id: number) {
|
|
||||||
return axios.get(`/api/rest/log/${id}`);
|
|
||||||
}
|
|
||||||
|
|
||||||
// 日志批量删除
|
|
||||||
export function deleteLogs(ids: number[]) {
|
|
||||||
return axios.delete(`/api/rest/log/batch`, {
|
|
||||||
data: ids,
|
|
||||||
});
|
|
||||||
}
|
|
@ -72,22 +72,11 @@ const SYSTEM: AppRouteRecordRaw = {
|
|||||||
name: 'Menu',
|
name: 'Menu',
|
||||||
component: () => import('@/views/system/menu/index.vue'),
|
component: () => import('@/views/system/menu/index.vue'),
|
||||||
meta: {
|
meta: {
|
||||||
locale: '权限管理',
|
|
||||||
title: '菜单管理',
|
title: '菜单管理',
|
||||||
requiresAuth: true,
|
requiresAuth: true,
|
||||||
permissions: ['system:menu'],
|
permissions: ['system:menu'],
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
{
|
|
||||||
path: 'log',
|
|
||||||
name: 'Log',
|
|
||||||
component: () => import('@/views/system/log/index.vue'),
|
|
||||||
meta: {
|
|
||||||
title: '操作日志管理',
|
|
||||||
requiresAuth: true,
|
|
||||||
permissions: ['system:menu'],
|
|
||||||
},
|
|
||||||
},
|
|
||||||
],
|
],
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -30,16 +30,6 @@
|
|||||||
</a-form-item>
|
</a-form-item>
|
||||||
</a-col>
|
</a-col>
|
||||||
<a-col :span="9">
|
<a-col :span="9">
|
||||||
<a-form-item field="status" label="所属产品">
|
|
||||||
<a-select
|
|
||||||
v-model="formModel.productName"
|
|
||||||
style="width: 360px"
|
|
||||||
placeholder="请选择所属产品"
|
|
||||||
:options="productOptions"
|
|
||||||
/>
|
|
||||||
</a-form-item>
|
|
||||||
</a-col>
|
|
||||||
<a-col :span="10">
|
|
||||||
<a-form-item field="isOnline" label="在线">
|
<a-form-item field="isOnline" label="在线">
|
||||||
<a-select
|
<a-select
|
||||||
v-model="formModel.isOnline"
|
v-model="formModel.isOnline"
|
||||||
@ -232,7 +222,6 @@
|
|||||||
name: '',
|
name: '',
|
||||||
status: '',
|
status: '',
|
||||||
isOnline: '',
|
isOnline: '',
|
||||||
productName: '',
|
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
@ -263,10 +252,6 @@
|
|||||||
title: '名称',
|
title: '名称',
|
||||||
dataIndex: 'name',
|
dataIndex: 'name',
|
||||||
},
|
},
|
||||||
{
|
|
||||||
title: '所属产品',
|
|
||||||
dataIndex: 'productName',
|
|
||||||
},
|
|
||||||
{
|
{
|
||||||
title: '状态',
|
title: '状态',
|
||||||
dataIndex: 'state',
|
dataIndex: 'state',
|
||||||
@ -296,14 +281,6 @@
|
|||||||
value: 'false',
|
value: 'false',
|
||||||
},
|
},
|
||||||
]);
|
]);
|
||||||
const productOptions = computed(() => {
|
|
||||||
return [
|
|
||||||
{
|
|
||||||
label: '全部',
|
|
||||||
value: '',
|
|
||||||
},
|
|
||||||
];
|
|
||||||
});
|
|
||||||
|
|
||||||
// 获取设备列表
|
// 获取设备列表
|
||||||
const fetchData = async (params = { size: 10, current: 1 }) => {
|
const fetchData = async (params = { size: 10, current: 1 }) => {
|
||||||
|
@ -14,8 +14,8 @@
|
|||||||
</template>
|
</template>
|
||||||
<template #description>
|
<template #description>
|
||||||
<a-descriptions :column="1">
|
<a-descriptions :column="1">
|
||||||
<a-descriptions-item label="所属产品">
|
<a-descriptions-item label="创建人">
|
||||||
{{ productName }}
|
{{ createBy }}
|
||||||
</a-descriptions-item>
|
</a-descriptions-item>
|
||||||
<a-descriptions-item label="创建时间">
|
<a-descriptions-item label="创建时间">
|
||||||
{{ dayjs(createTime).format('YYYY-MM-DD HH:mm:ss') }}
|
{{ dayjs(createTime).format('YYYY-MM-DD HH:mm:ss') }}
|
||||||
@ -68,7 +68,7 @@
|
|||||||
type: Number,
|
type: Number,
|
||||||
default: -1,
|
default: -1,
|
||||||
},
|
},
|
||||||
productName: {
|
createBy: {
|
||||||
type: String,
|
type: String,
|
||||||
default: '',
|
default: '',
|
||||||
},
|
},
|
||||||
|
@ -30,16 +30,6 @@
|
|||||||
</a-form-item>
|
</a-form-item>
|
||||||
</a-col>
|
</a-col>
|
||||||
<a-col :span="9">
|
<a-col :span="9">
|
||||||
<a-form-item field="status" label="所属产品">
|
|
||||||
<a-select
|
|
||||||
v-model="formModel.productName"
|
|
||||||
style="width: 360px"
|
|
||||||
placeholder="请选择所属产品"
|
|
||||||
:options="productOptions"
|
|
||||||
/>
|
|
||||||
</a-form-item>
|
|
||||||
</a-col>
|
|
||||||
<a-col :span="10">
|
|
||||||
<a-form-item field="isOnline" label="在线">
|
<a-form-item field="isOnline" label="在线">
|
||||||
<a-select
|
<a-select
|
||||||
v-model="formModel.isOnline"
|
v-model="formModel.isOnline"
|
||||||
@ -88,7 +78,7 @@
|
|||||||
:loading="loading"
|
:loading="loading"
|
||||||
:id="item.id"
|
:id="item.id"
|
||||||
:title="item.name"
|
:title="item.name"
|
||||||
:productName="item.productName"
|
:createBy="item.createBy"
|
||||||
:createTime="item.createTime"
|
:createTime="item.createTime"
|
||||||
open-txt="详情"
|
open-txt="详情"
|
||||||
>
|
>
|
||||||
@ -104,6 +94,25 @@
|
|||||||
</CardWrap>
|
</CardWrap>
|
||||||
</a-col>
|
</a-col>
|
||||||
<DeviceEdit ref="createUserRef" :is-create="true" />
|
<DeviceEdit ref="createUserRef" :is-create="true" />
|
||||||
|
<!-- <a-col-->
|
||||||
|
<!-- :xs="12"-->
|
||||||
|
<!-- :sm="12"-->
|
||||||
|
<!-- :md="12"-->
|
||||||
|
<!-- :lg="6"-->
|
||||||
|
<!-- :xl="6"-->
|
||||||
|
<!-- :xxl="6"-->
|
||||||
|
<!-- class="list-col"-->
|
||||||
|
<!-- >-->
|
||||||
|
<!-- <div class="card-wrap empty-wrap">-->
|
||||||
|
<!-- <a-card :bordered="false" hoverable>-->
|
||||||
|
<!-- <a-result :status="null" title="点击创建设备">-->
|
||||||
|
<!-- <template #icon>-->
|
||||||
|
<!-- <icon-plus style="font-size: 20px" />-->
|
||||||
|
<!-- </template>-->
|
||||||
|
<!-- </a-result>-->
|
||||||
|
<!-- </a-card>-->
|
||||||
|
<!-- </div>-->
|
||||||
|
<!-- </a-col>-->
|
||||||
</a-row>
|
</a-row>
|
||||||
</div>
|
</div>
|
||||||
<a-pagination
|
<a-pagination
|
||||||
@ -157,15 +166,6 @@
|
|||||||
value: 'false',
|
value: 'false',
|
||||||
},
|
},
|
||||||
]);
|
]);
|
||||||
const productOptions = computed(() => {
|
|
||||||
return [
|
|
||||||
{
|
|
||||||
label: '全部',
|
|
||||||
value: '',
|
|
||||||
},
|
|
||||||
];
|
|
||||||
});
|
|
||||||
|
|
||||||
|
|
||||||
// 获取设备列表
|
// 获取设备列表
|
||||||
const fetchData = async (params = { size: 10, current: 1 }) => {
|
const fetchData = async (params = { size: 10, current: 1 }) => {
|
||||||
@ -207,6 +207,26 @@
|
|||||||
formModel.value = generateFormModel();
|
formModel.value = generateFormModel();
|
||||||
};
|
};
|
||||||
|
|
||||||
|
// // 打开详情
|
||||||
|
// function openDetail(id:number): void{
|
||||||
|
// const url = router.resolve({
|
||||||
|
// name: 'deviceDetail',
|
||||||
|
// params: {id}
|
||||||
|
// }).href;
|
||||||
|
// router.push(url);
|
||||||
|
// }
|
||||||
|
|
||||||
|
// // 删除
|
||||||
|
// const handleDelete = async (id: number) => {
|
||||||
|
// const res = await deleteDevice(id);
|
||||||
|
// if (res.status === 200) {
|
||||||
|
// Message.success({
|
||||||
|
// content: '删除成功',
|
||||||
|
// duration: 5 * 1000,
|
||||||
|
// });
|
||||||
|
// search();
|
||||||
|
// }
|
||||||
|
// };
|
||||||
onMounted(() => {
|
onMounted(() => {
|
||||||
search();
|
search();
|
||||||
});
|
});
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
<template>
|
<template>
|
||||||
<div class="container">
|
<div class="container">
|
||||||
<Breadcrumb :items="['系统管理', '操作日志管理']" />
|
<Breadcrumb :items="['系统管理', '权限管理']" />
|
||||||
<a-card class="general-card" title=" ">
|
<a-card class="general-card" title=" ">
|
||||||
<a-row>
|
<a-row>
|
||||||
<a-col :flex="1">
|
<a-col :flex="1">
|
||||||
|
@ -1,5 +0,0 @@
|
|||||||
<script setup lang="ts"></script>
|
|
||||||
|
|
||||||
<template> </template>
|
|
||||||
|
|
||||||
<style scoped lang="less"></style>
|
|
@ -1,257 +0,0 @@
|
|||||||
<template>
|
|
||||||
<div class="container">
|
|
||||||
<Breadcrumb :items="['系统管理', '操作日志']" />
|
|
||||||
<a-card class="general-card" title=" ">
|
|
||||||
<a-row>
|
|
||||||
<a-col :flex="1">
|
|
||||||
<a-form
|
|
||||||
:model="formModel"
|
|
||||||
:label-col-props="{ span: 6 }"
|
|
||||||
:wrapper-col-props="{ span: 18 }"
|
|
||||||
label-align="right"
|
|
||||||
>
|
|
||||||
<a-row :gutter="18">
|
|
||||||
<a-col :span="9">
|
|
||||||
<a-form-item field="moduleType" label="模块类型">
|
|
||||||
<a-input
|
|
||||||
v-model="formModel.moduleType"
|
|
||||||
style="width: 360px"
|
|
||||||
placeholder="请输入模块类型"
|
|
||||||
/>
|
|
||||||
</a-form-item>
|
|
||||||
</a-col>
|
|
||||||
<a-col :span="10">
|
|
||||||
<a-form-item field="Time" label="时间">
|
|
||||||
<a-range-picker
|
|
||||||
show-time
|
|
||||||
format="YYYY-MM-DD HH:mm"
|
|
||||||
@ok="timeRang"
|
|
||||||
/>
|
|
||||||
</a-form-item>
|
|
||||||
</a-col>
|
|
||||||
<a-col :span="9">
|
|
||||||
<a-form-item field="functionType" label="功能类型">
|
|
||||||
<a-input
|
|
||||||
v-model="formModel.functionType"
|
|
||||||
style="width: 360px"
|
|
||||||
placeholder="请输入功能类型"
|
|
||||||
/>
|
|
||||||
</a-form-item>
|
|
||||||
</a-col>
|
|
||||||
</a-row>
|
|
||||||
</a-form>
|
|
||||||
</a-col>
|
|
||||||
<a-divider style="height: 84px" direction="vertical" />
|
|
||||||
<a-col :flex="'86px'" style="text-align: right">
|
|
||||||
<a-space direction="vertical" :size="18">
|
|
||||||
<a-button type="primary" @click="search">
|
|
||||||
<template #icon>
|
|
||||||
<icon-search />
|
|
||||||
</template>
|
|
||||||
查询
|
|
||||||
</a-button>
|
|
||||||
<a-button @click="reset">
|
|
||||||
<template #icon>
|
|
||||||
<icon-refresh />
|
|
||||||
</template>
|
|
||||||
重置
|
|
||||||
</a-button>
|
|
||||||
</a-space>
|
|
||||||
</a-col>
|
|
||||||
</a-row>
|
|
||||||
|
|
||||||
<a-divider style="margin-top: 0" />
|
|
||||||
<a-row>
|
|
||||||
<a-col :span="12">
|
|
||||||
<a-space>
|
|
||||||
<a-button
|
|
||||||
type="primary"
|
|
||||||
status="danger"
|
|
||||||
@click="deleteLog(selectedIds)"
|
|
||||||
>
|
|
||||||
<template #icon><icon-delete /></template>
|
|
||||||
批量删除
|
|
||||||
</a-button>
|
|
||||||
</a-space>
|
|
||||||
</a-col>
|
|
||||||
<a-col
|
|
||||||
:span="12"
|
|
||||||
style="
|
|
||||||
display: flex;
|
|
||||||
align-items: center;
|
|
||||||
justify-content: end;
|
|
||||||
padding-bottom: 20px;
|
|
||||||
"
|
|
||||||
>
|
|
||||||
<a-tooltip content="刷新">
|
|
||||||
<div class="action-icon" @click="search">
|
|
||||||
<icon-refresh size="18" />
|
|
||||||
</div>
|
|
||||||
</a-tooltip>
|
|
||||||
</a-col>
|
|
||||||
</a-row>
|
|
||||||
<a-table
|
|
||||||
row-key="id"
|
|
||||||
:loading="loading"
|
|
||||||
:pagination="false"
|
|
||||||
:columns="(cloneColumns as TableColumnData[])"
|
|
||||||
:data="renderData"
|
|
||||||
:bordered="false"
|
|
||||||
:size="size"
|
|
||||||
:row-selection="rowSelection"
|
|
||||||
style="margin-bottom: 40px"
|
|
||||||
@select="select"
|
|
||||||
@page-change="onPageChange"
|
|
||||||
>
|
|
||||||
<template #operationTime="{ record }">
|
|
||||||
{{ dayjs(record.operationTime).format('YYYY-MM-DD HH:mm') }}
|
|
||||||
</template>
|
|
||||||
</a-table>
|
|
||||||
<a-pagination
|
|
||||||
style="float: right; position: relative; right: 1px; bottom: 25px"
|
|
||||||
:total="pagination.total"
|
|
||||||
:size="size"
|
|
||||||
show-total
|
|
||||||
show-jumper
|
|
||||||
show-page-size
|
|
||||||
@page-size-change="onSizeChange"
|
|
||||||
@change="onPageChange"
|
|
||||||
/>
|
|
||||||
</a-card>
|
|
||||||
</div>
|
|
||||||
</template>
|
|
||||||
|
|
||||||
<script lang="ts" setup>
|
|
||||||
import { computed, onMounted, reactive, ref, watch } from 'vue';
|
|
||||||
import useLoading from '@/hooks/loading';
|
|
||||||
import type { TableColumnData } from '@arco-design/web-vue/es/table/interface';
|
|
||||||
import useTableOption from '@/hooks/table-option';
|
|
||||||
import usePagination from '@/hooks/pagination';
|
|
||||||
import dayjs from 'dayjs';
|
|
||||||
import { LogsRecord, queryLogList, deleteLogs } from '@/api/log';
|
|
||||||
import { Message } from '@arco-design/web-vue';
|
|
||||||
|
|
||||||
const generateFormModel = () => {
|
|
||||||
return {
|
|
||||||
moduleType: '',
|
|
||||||
functionType: '',
|
|
||||||
publishTimeBegin: '',
|
|
||||||
publishTimeEnd: '',
|
|
||||||
};
|
|
||||||
};
|
|
||||||
|
|
||||||
const { pagination, setPagination } = usePagination();
|
|
||||||
const { loading, setLoading } = useLoading(true);
|
|
||||||
const renderData = ref<any[]>([]);
|
|
||||||
const formModel = ref(generateFormModel());
|
|
||||||
const selectedIds = ref<number[]>([]);
|
|
||||||
const { cloneColumns, size, deepClone } = useTableOption();
|
|
||||||
|
|
||||||
const columns = computed<TableColumnData[]>(() => [
|
|
||||||
{
|
|
||||||
title: '模块类型',
|
|
||||||
dataIndex: 'moduleType',
|
|
||||||
},
|
|
||||||
{
|
|
||||||
title: '功能类型',
|
|
||||||
dataIndex: 'functionType',
|
|
||||||
},
|
|
||||||
{
|
|
||||||
title: '操作时间',
|
|
||||||
dataIndex: 'operationTime',
|
|
||||||
slotName: 'operationTime',
|
|
||||||
sortable: {
|
|
||||||
sortDirections: ['ascend', 'descend'],
|
|
||||||
},
|
|
||||||
},
|
|
||||||
{
|
|
||||||
title: '操作内容',
|
|
||||||
dataIndex: 'content',
|
|
||||||
},
|
|
||||||
// {
|
|
||||||
// title: '操作',
|
|
||||||
// dataIndex: 'operation',
|
|
||||||
// },
|
|
||||||
]);
|
|
||||||
const rowSelection = {
|
|
||||||
type: 'checkbox',
|
|
||||||
showCheckedAll: true, // 默认选中的行 ID
|
|
||||||
};
|
|
||||||
|
|
||||||
const select= (selectedRowKeys: number[]) => {
|
|
||||||
selectedIds.value = selectedRowKeys;
|
|
||||||
};
|
|
||||||
|
|
||||||
// 获取日志列表
|
|
||||||
const fetchData = async (params = { size: 10, current: 1 }) => {
|
|
||||||
setLoading(true);
|
|
||||||
try {
|
|
||||||
const res: any = await queryLogList(params);
|
|
||||||
renderData.value = res.data.records;
|
|
||||||
setPagination(res.data);
|
|
||||||
} catch (err) {
|
|
||||||
// you can report use errorHandler or other
|
|
||||||
} finally {
|
|
||||||
setLoading(false);
|
|
||||||
}
|
|
||||||
};
|
|
||||||
|
|
||||||
// 查询
|
|
||||||
const search = () => {
|
|
||||||
fetchData({
|
|
||||||
...pagination.value,
|
|
||||||
...formModel.value,
|
|
||||||
} as unknown as LogsRecord);
|
|
||||||
selectedIds.value = [];
|
|
||||||
};
|
|
||||||
|
|
||||||
// 分页发生改变
|
|
||||||
const onPageChange = (current: number) => {
|
|
||||||
pagination.value.page = current;
|
|
||||||
pagination.value.current = current;
|
|
||||||
search();
|
|
||||||
};
|
|
||||||
|
|
||||||
// 时间范围
|
|
||||||
const timeRang = (dateString: string[]) => {
|
|
||||||
// eslint-disable-next-line prefer-destructuring
|
|
||||||
formModel.value.publishTimeBegin = dateString[0];
|
|
||||||
// eslint-disable-next-line prefer-destructuring
|
|
||||||
formModel.value.publishTimeEnd = dateString[1];
|
|
||||||
};
|
|
||||||
|
|
||||||
// 数据条数改变
|
|
||||||
const onSizeChange = (Size: number) => {
|
|
||||||
pagination.value.size = Size;
|
|
||||||
search();
|
|
||||||
};
|
|
||||||
|
|
||||||
// 重置
|
|
||||||
const reset = () => {
|
|
||||||
formModel.value = generateFormModel();
|
|
||||||
};
|
|
||||||
|
|
||||||
// 批量删除日志
|
|
||||||
const deleteLog = async (ids: number[]) => {
|
|
||||||
if (ids.length === 0) {
|
|
||||||
// 如果没有选中任何日志,提示用户
|
|
||||||
Message.warning('请选择要删除的日志');
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
try {
|
|
||||||
// 调用批量删除日志的接口
|
|
||||||
await deleteLogs(ids);
|
|
||||||
Message.success('日志删除成功');
|
|
||||||
// 删除成功后刷新日志列表
|
|
||||||
search();
|
|
||||||
} catch (error) {
|
|
||||||
Message.error('日志删除失败');
|
|
||||||
}
|
|
||||||
};
|
|
||||||
|
|
||||||
onMounted(() => {
|
|
||||||
search();
|
|
||||||
});
|
|
||||||
|
|
||||||
watch(() => columns.value, deepClone, { deep: true, immediate: true });
|
|
||||||
</script>
|
|
@ -68,7 +68,12 @@
|
|||||||
>
|
>
|
||||||
<a-input v-model="formData.path" placeholder="请输入路径" />
|
<a-input v-model="formData.path" placeholder="请输入路径" />
|
||||||
</a-form-item>
|
</a-form-item>
|
||||||
<a-form-item field="icon" label="图标">
|
<a-form-item
|
||||||
|
field="icon"
|
||||||
|
label="图标"
|
||||||
|
:validate-trigger="['change', 'input']"
|
||||||
|
:rules="[{ required: true, message: '请输入图标' }]"
|
||||||
|
>
|
||||||
<a-input v-model="formData.icon" placeholder="请输入图标" />
|
<a-input v-model="formData.icon" placeholder="请输入图标" />
|
||||||
</a-form-item>
|
</a-form-item>
|
||||||
<a-form-item
|
<a-form-item
|
||||||
@ -99,10 +104,7 @@
|
|||||||
:validate-trigger="['change', 'input']"
|
:validate-trigger="['change', 'input']"
|
||||||
:rules="[{ required: true, message: '请选择菜单排序' }]"
|
:rules="[{ required: true, message: '请选择菜单排序' }]"
|
||||||
>
|
>
|
||||||
<a-input
|
<a-input v-model="formData.menuOrder" placeholder="请输入菜单排序" />
|
||||||
:model-value="String(formData.menuOrder)"
|
|
||||||
placeholder="请输入菜单排序"
|
|
||||||
/>
|
|
||||||
</a-form-item>
|
</a-form-item>
|
||||||
<a-form-item
|
<a-form-item
|
||||||
field="permissions"
|
field="permissions"
|
||||||
|
@ -133,6 +133,7 @@
|
|||||||
<!-- 编辑 -->
|
<!-- 编辑 -->
|
||||||
<MenuEdit
|
<MenuEdit
|
||||||
ref="editRef"
|
ref="editRef"
|
||||||
|
:menu="record"
|
||||||
:id="record.id"
|
:id="record.id"
|
||||||
:menuData="renderData"
|
:menuData="renderData"
|
||||||
:is-create="false"
|
:is-create="false"
|
||||||
|
Loading…
Reference in New Issue
Block a user