From 15a3bc00c76dc3c5ac4f688a99f1efbf3ea6f5a5 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?=E9=99=88=E7=BA=A2=E4=B8=BD?= <1181930680@qq.com>
Date: Thu, 11 Jul 2024 12:46:38 +0800
Subject: [PATCH] =?UTF-8?q?=E6=93=8D=E4=BD=9C=E6=97=A5=E5=BF=97?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
src/api/system/dept.ts | 9 --
src/api/system/operLog.ts | 40 ++++++
src/views/system/operLog/columns.ts | 71 +++++++++++
src/views/system/operLog/edit.vue | 112 +++++++++++++++++
src/views/system/operLog/index.vue | 147 +++++++++++++++++++++++
src/views/system/operLog/querySchemas.ts | 39 ++++++
src/views/system/position/index.vue | 2 +-
7 files changed, 410 insertions(+), 10 deletions(-)
create mode 100644 src/api/system/operLog.ts
create mode 100644 src/views/system/operLog/columns.ts
create mode 100644 src/views/system/operLog/edit.vue
create mode 100644 src/views/system/operLog/index.vue
create mode 100644 src/views/system/operLog/querySchemas.ts
diff --git a/src/api/system/dept.ts b/src/api/system/dept.ts
index 54ac5e5..6cfa90e 100644
--- a/src/api/system/dept.ts
+++ b/src/api/system/dept.ts
@@ -47,13 +47,4 @@ export function deptDelete(deptId) {
url: '/dept/delete/'+deptId,
method: 'DELETE',
});
-}
-/**
- * @description: 批量删除部门
- */
-export function deptBatchDelete(deptId) {
- return http.request({
- url: '/dept/batchDelete/'+deptId,
- method: 'DELETE',
- });
}
\ No newline at end of file
diff --git a/src/api/system/operLog.ts b/src/api/system/operLog.ts
new file mode 100644
index 0000000..280ad8a
--- /dev/null
+++ b/src/api/system/operLog.ts
@@ -0,0 +1,40 @@
+import { http } from '@/utils/http/axios';
+
+/**
+ * @description: 操作日志列表
+ */
+export function getOperLogList(params?) {
+ return http.request({
+ url: '/oper/log/page',
+ method: 'GET',
+ params,
+ });
+}
+/**
+ * @description: 根据ID获取详情
+ */
+export function getOperLogDetail(id) {
+ return http.request({
+ url: '/oper/log/detail/'+id,
+ method: 'get',
+ });
+}
+/**
+ * @description: 删除操作日志
+ */
+export function operLogDelete(id) {
+ return http.request({
+ url: '/oper/log/delete/'+id,
+ method: 'DELETE',
+ });
+}
+/**
+ * @description: 批量删除操作日志
+ */
+export function operLogBatchDelete(data:any) {
+ return http.request({
+ url: '/oper/log/batchDelete',
+ method: 'DELETE',
+ data
+ });
+}
\ No newline at end of file
diff --git a/src/views/system/operLog/columns.ts b/src/views/system/operLog/columns.ts
new file mode 100644
index 0000000..15a3e05
--- /dev/null
+++ b/src/views/system/operLog/columns.ts
@@ -0,0 +1,71 @@
+import { h } from 'vue';
+import { ElTag } from 'element-plus';
+
+export const columns = [
+ {
+ type: 'selection',
+ },
+ {
+ label: '日志标题',
+ prop: 'title',
+ },
+ {
+ label: '操作用户',
+ prop: 'createUser',
+ },
+ {
+ label: '请求ip',
+ prop: 'ip',
+ },
+ {
+ label: '浏览器',
+ prop: 'browser',
+ },
+ {
+ label: '操作系统',
+ prop: 'os',
+ },
+ {
+ label: '操作类型',
+ prop: 'typeText',
+ },
+ {
+ label: '操作来源',
+ prop: 'sourceText',
+ },
+ {
+ label: '请求方式',
+ prop: 'requestMethod',
+ },
+ {
+ label: '请求URL',
+ prop: 'url',
+ },
+ {
+ label: '请求地区',
+ prop: 'location',
+ },
+ {
+ label: '请求耗时',
+ prop: 'consumeTime',
+ },
+ {
+ label: '状态',
+ prop: 'status',
+ render(record) {
+ return h(
+ ElTag,
+ {
+ type: record.row.status ==0 ? 'success' : 'danger',
+ },
+ {
+ default: () => (record.row.status ==0 ? '正常' : '异常'),
+ },
+ );
+ },
+ },
+ {
+ label: '创建时间',
+ prop: 'createTime',
+ },
+];
diff --git a/src/views/system/operLog/edit.vue b/src/views/system/operLog/edit.vue
new file mode 100644
index 0000000..051e949
--- /dev/null
+++ b/src/views/system/operLog/edit.vue
@@ -0,0 +1,112 @@
+
+
+
+
+
+
+
+
+ 正常
+ 禁用
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/src/views/system/operLog/index.vue b/src/views/system/operLog/index.vue
new file mode 100644
index 0000000..9c25428
--- /dev/null
+++ b/src/views/system/operLog/index.vue
@@ -0,0 +1,147 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ 删除
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/src/views/system/operLog/querySchemas.ts b/src/views/system/operLog/querySchemas.ts
new file mode 100644
index 0000000..d362940
--- /dev/null
+++ b/src/views/system/operLog/querySchemas.ts
@@ -0,0 +1,39 @@
+import { FormSchema } from '@/components/Form/index';
+export const schemas: FormSchema[] = [
+ {
+ field: 'type',
+ component: 'Select',
+ label: '请求类型',
+ componentProps: {
+ placeholder: '请选择请求类型',
+ options: [
+ {
+ label: '登录',
+ value: '0',
+ },
+ {
+ label: '退出',
+ value: '1',
+ },
+ ],
+ },
+ },
+ {
+ field: 'status',
+ component: 'Select',
+ label: '请求状态',
+ componentProps: {
+ placeholder: '请选择状态',
+ options: [
+ {
+ label: '正常',
+ value: '0',
+ },
+ {
+ label: '异常',
+ value: '1',
+ },
+ ],
+ },
+ },
+];
diff --git a/src/views/system/position/index.vue b/src/views/system/position/index.vue
index 9e6ab83..e018db0 100644
--- a/src/views/system/position/index.vue
+++ b/src/views/system/position/index.vue
@@ -62,7 +62,7 @@
)
const positionId =ref(0)
const editVisible=ref(false)
- const selectionData = ref([])
+const selectionData = ref([])
const tableRef = ref();
const formParams = reactive({
name:'',