From b476eb1c59a3e68f14bb4f686f7b7a65b45cbe35 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, 14 Nov 2024 17:30:25 +0800 Subject: [PATCH] =?UTF-8?q?=E6=97=A5=E5=BF=97=E7=AE=A1=E7=90=86=E3=80=81?= =?UTF-8?q?=E5=9C=A8=E7=BA=BF=E7=94=A8=E6=88=B7?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/components/Table/src/hooks/useColumns.ts | 1 + src/views/logger/emailLog/columns.ts | 102 +++++++++++ src/views/logger/emailLog/edit.vue | 154 +++++++++++++++++ src/views/logger/emailLog/index.vue | 162 ++++++++++++++++++ src/views/logger/emailLog/querySchemas.ts | 72 ++++++++ src/views/logger/fileLog/columns.ts | 81 +++++++++ src/views/logger/fileLog/edit.vue | 101 +++++++++++ src/views/logger/fileLog/index.vue | 162 ++++++++++++++++++ src/views/logger/fileLog/querySchemas.ts | 34 ++++ src/views/logger/smsLog/columns.ts | 79 +++++++++ src/views/logger/smsLog/edit.vue | 154 +++++++++++++++++ src/views/logger/smsLog/index.vue | 162 ++++++++++++++++++ src/views/logger/smsLog/querySchemas.ts | 72 ++++++++ src/views/monitor/online/columns.ts | 58 +++++++ src/views/monitor/online/index.vue | 128 ++++++++++++++ src/views/monitor/online/querySchemas.ts | 19 ++ src/views/system/logger/loginLog.vue | 161 +++++++++++++++++ src/views/system/logger/loginLog/columns.ts | 87 ++++++++++ src/views/system/logger/loginLog/edit.vue | 109 ++++++++++++ .../system/logger/loginLog/querySchemas.ts | 49 ++++++ src/views/system/logger/operLog.vue | 161 +++++++++++++++++ src/views/system/logger/operLog/columns.ts | 92 ++++++++++ src/views/system/logger/operLog/edit.vue | 109 ++++++++++++ .../system/logger/operLog/querySchemas.ts | 30 ++++ src/views/system/role/querySchemas.ts | 11 ++ 25 files changed, 2350 insertions(+) create mode 100644 src/views/logger/emailLog/columns.ts create mode 100644 src/views/logger/emailLog/edit.vue create mode 100644 src/views/logger/emailLog/index.vue create mode 100644 src/views/logger/emailLog/querySchemas.ts create mode 100644 src/views/logger/fileLog/columns.ts create mode 100644 src/views/logger/fileLog/edit.vue create mode 100644 src/views/logger/fileLog/index.vue create mode 100644 src/views/logger/fileLog/querySchemas.ts create mode 100644 src/views/logger/smsLog/columns.ts create mode 100644 src/views/logger/smsLog/edit.vue create mode 100644 src/views/logger/smsLog/index.vue create mode 100644 src/views/logger/smsLog/querySchemas.ts create mode 100644 src/views/monitor/online/columns.ts create mode 100644 src/views/monitor/online/index.vue create mode 100644 src/views/monitor/online/querySchemas.ts create mode 100644 src/views/system/logger/loginLog.vue create mode 100644 src/views/system/logger/loginLog/columns.ts create mode 100644 src/views/system/logger/loginLog/edit.vue create mode 100644 src/views/system/logger/loginLog/querySchemas.ts create mode 100644 src/views/system/logger/operLog.vue create mode 100644 src/views/system/logger/operLog/columns.ts create mode 100644 src/views/system/logger/operLog/edit.vue create mode 100644 src/views/system/logger/operLog/querySchemas.ts create mode 100644 src/views/system/role/querySchemas.ts diff --git a/src/components/Table/src/hooks/useColumns.ts b/src/components/Table/src/hooks/useColumns.ts index 26e9c5c..ce3ffb8 100644 --- a/src/components/Table/src/hooks/useColumns.ts +++ b/src/components/Table/src/hooks/useColumns.ts @@ -72,6 +72,7 @@ export function useColumns(propsRef: ComputedRef) { .map((column) => { //默认 ellipsis 为true column.ellipsis = typeof column.ellipsis === 'undefined' ? { tooltip: true } : false; + column.align = typeof column.align === 'undefined' ?'center':column.align ; const { edit, title, helpMessage, helpMessageProps } = column; // 支持 helpMessage if (helpMessage) { diff --git a/src/views/logger/emailLog/columns.ts b/src/views/logger/emailLog/columns.ts new file mode 100644 index 0000000..f4e43c8 --- /dev/null +++ b/src/views/logger/emailLog/columns.ts @@ -0,0 +1,102 @@ +import { h } from 'vue'; +export const columns = [ + { + type: 'selection', + width: 50, + fixed:"left" + }, + { + title: 'ID', + key: 'id', + fixed: 'left', + width: 50, + }, + { + title: '日志标题', + key: 'title', + width: 100, + }, + { + title: '日志类型', + key: 'type', + width: 100, + render(record) { + let typeText = ''; + switch (record.type) { + case 1: + typeText = '登录'; + break; + case 2: + typeText = '注册'; + break; + case 3: + typeText = '找回密码'; + break; + case 4: + typeText = '业务'; + break; + case 5: + typeText = '其他'; + break; + default: + break; + } + return h('span', typeText || '-'); + }, + }, + { + title: '模板编号', + key: 'code', + width: 100, + }, + { + title: '接收人邮箱', + key: 'receiveEmail', + width: 100, + }, + { + title: '接收人类型', + key: 'status', + width: 100, + render(record) { + let typeText = ''; + switch (record.receiveType) { + case 1: + typeText = '系统用户'; + break; + case 2: + typeText = '会员用户'; + break; + case 3: + typeText = '其他'; + break; + default: + break; + } + return h('span', typeText || '-'); + }, + }, + { + title: '请求耗时', + key: 'consumeTime', + width: 100, + }, + { + title: '日志状态', + key: 'status', + width: 100, + render(record) { + return h('span', record.status === 1 ? '已读' : '未读'); + }, + }, + { + title: '创建人', + key: 'createUser', + width: 100, + }, + { + title: '创建时间', + key: 'createTime', + width: 180, + } +]; diff --git a/src/views/logger/emailLog/edit.vue b/src/views/logger/emailLog/edit.vue new file mode 100644 index 0000000..ef334b0 --- /dev/null +++ b/src/views/logger/emailLog/edit.vue @@ -0,0 +1,154 @@ + + + diff --git a/src/views/logger/emailLog/index.vue b/src/views/logger/emailLog/index.vue new file mode 100644 index 0000000..c192b65 --- /dev/null +++ b/src/views/logger/emailLog/index.vue @@ -0,0 +1,162 @@ + + + + + diff --git a/src/views/logger/emailLog/querySchemas.ts b/src/views/logger/emailLog/querySchemas.ts new file mode 100644 index 0000000..aab8594 --- /dev/null +++ b/src/views/logger/emailLog/querySchemas.ts @@ -0,0 +1,72 @@ +import { FormSchema } from '@/components/Form/index'; +export const schemas: FormSchema[] = [ + { + field: 'title', + component: 'NInput', + label: '短信标题', + componentProps: { + placeholder: '请输入短信标题', + }, + }, + { + field: 'receiveType', + component: 'NSelect', + label: '接收类型', + componentProps: { + placeholder: '请选择接收类型', + clearable: true, + options: [ + { + label: '系统用户', + value: '1', + }, + { + label: '会员用户', + value: '2', + }, + { + label: '其他', + value: '3', + }, + ], + }, + }, + { + field: 'bizType', + component: 'NSelect', + label: '业务类型', + componentProps: { + placeholder: '请选择业务类型', + clearable: true, + options: [ + { + label: '订单', + value: '1', + }, + { + label: '其他', + value: '2', + }, + ], + }, + }, + { + field: 'status', + component: 'NSelect', + label: '状态', + componentProps: { + placeholder: '请选择状态', + clearable: true, + options: [ + { + label: '已读', + value: '1', + }, + { + label: '未读', + value: '0', + }, + ], + }, + }, +]; diff --git a/src/views/logger/fileLog/columns.ts b/src/views/logger/fileLog/columns.ts new file mode 100644 index 0000000..820fece --- /dev/null +++ b/src/views/logger/fileLog/columns.ts @@ -0,0 +1,81 @@ +import { h } from 'vue'; +export const columns = [ + { + type: 'selection', + width: 50, + fixed:"left" + }, + { + title: 'ID', + key: 'id', + fixed: 'left', + width: 50, + }, + { + title: '文件名称', + key: 'originalName', + width: 200, + render(record) { + return h( + 'a', + { + href: record.filePath, + target: '_blank', + }, + record.originalName, + ); + }, + }, + { + title: '日志类型', + key: 'type', + width: 100, + render(record) { + let typeText = ''; + switch (record.type) { + case 0: + typeText = '单个文件'; + break; + case 1: + typeText = '多个文件'; + break; + case 2: + typeText = '其他'; + break; + default: + break; + } + return h('span', typeText || '-'); + }, + }, + { + title: '文件类型', + key: 'fileType', + align:'center', + width: 100, + }, + { + title: '文件大小', + key: 'fileSize', + width: 100, + customRender({ record }) { + return h('span', record.fileSize + 'B'); + }, + }, + { + title: '文件后缀', + key: 'fileExtension', + + width: 100, + }, + { + title: '创建人', + key: 'createUser', + width: 100, + }, + { + title: '创建时间', + key: 'createTime', + width: 180, + } +]; diff --git a/src/views/logger/fileLog/edit.vue b/src/views/logger/fileLog/edit.vue new file mode 100644 index 0000000..3cab8cc --- /dev/null +++ b/src/views/logger/fileLog/edit.vue @@ -0,0 +1,101 @@ + + + diff --git a/src/views/logger/fileLog/index.vue b/src/views/logger/fileLog/index.vue new file mode 100644 index 0000000..51db333 --- /dev/null +++ b/src/views/logger/fileLog/index.vue @@ -0,0 +1,162 @@ + + + + + diff --git a/src/views/logger/fileLog/querySchemas.ts b/src/views/logger/fileLog/querySchemas.ts new file mode 100644 index 0000000..a0829fb --- /dev/null +++ b/src/views/logger/fileLog/querySchemas.ts @@ -0,0 +1,34 @@ +import { FormSchema } from '@/components/Form/index'; +export const schemas: FormSchema[] = [ + { + field: 'fileName', + component: 'NInput', + label: '文件名称', + componentProps: { + placeholder: '请输入文件名称', + }, + }, + { + field: 'fileType', + component: 'NSelect', + label: '文件类型', + componentProps: { + clearable: true, + placeholder: '请选择文件类型', + options: [ + { + label: '文档', + value: '1', + }, + { + label: '视频', + value: '2', + }, + { + label: '其他', + value: '3', + }, + ], + }, + }, +]; diff --git a/src/views/logger/smsLog/columns.ts b/src/views/logger/smsLog/columns.ts new file mode 100644 index 0000000..a8ba960 --- /dev/null +++ b/src/views/logger/smsLog/columns.ts @@ -0,0 +1,79 @@ +import { h } from 'vue'; +export const columns = [ + { + type: 'selection', + width: 50, + fixed:"left" + }, + { + title: 'ID', + key: 'id', + fixed: 'left', + width: 50, + }, + { + title: '日志标题', + key: 'title', + width: 100, + }, + { + title: '日志类型', + key: 'typeText', + width: 100, + }, + { + title: '模板编号', + key: 'number', + width: 100, + }, + { + title: '接收人手机', + key: 'receiveMobile', + width: 100, + }, + { + title: '接收人类型', + key: 'receiveType', + width: 100, + render(record ) { + let typeText = ''; + switch (record.receiveType) { + case 1: + typeText = '系统用户'; + break; + case 2: + typeText = '会员用户'; + break; + case 3: + typeText = '其他'; + break; + default: + break; + } + return h('span', typeText || '-'); + }, + }, + { + title: '请求耗时', + key: 'consumeTime', + width: 100, + }, + { + title: '日志状态', + key: 'status', + width: 100, + render(record ) { + return h('span', record.status === 1 ? '已读' : '未读'); + }, + }, + { + title: '创建人', + width: 100, + key: 'createUser', + }, + { + title: '创建时间', + key: 'createTime', + width: 180, + }, +]; diff --git a/src/views/logger/smsLog/edit.vue b/src/views/logger/smsLog/edit.vue new file mode 100644 index 0000000..cf360d0 --- /dev/null +++ b/src/views/logger/smsLog/edit.vue @@ -0,0 +1,154 @@ + + + diff --git a/src/views/logger/smsLog/index.vue b/src/views/logger/smsLog/index.vue new file mode 100644 index 0000000..4a22c5f --- /dev/null +++ b/src/views/logger/smsLog/index.vue @@ -0,0 +1,162 @@ + + + + + diff --git a/src/views/logger/smsLog/querySchemas.ts b/src/views/logger/smsLog/querySchemas.ts new file mode 100644 index 0000000..aab8594 --- /dev/null +++ b/src/views/logger/smsLog/querySchemas.ts @@ -0,0 +1,72 @@ +import { FormSchema } from '@/components/Form/index'; +export const schemas: FormSchema[] = [ + { + field: 'title', + component: 'NInput', + label: '短信标题', + componentProps: { + placeholder: '请输入短信标题', + }, + }, + { + field: 'receiveType', + component: 'NSelect', + label: '接收类型', + componentProps: { + placeholder: '请选择接收类型', + clearable: true, + options: [ + { + label: '系统用户', + value: '1', + }, + { + label: '会员用户', + value: '2', + }, + { + label: '其他', + value: '3', + }, + ], + }, + }, + { + field: 'bizType', + component: 'NSelect', + label: '业务类型', + componentProps: { + placeholder: '请选择业务类型', + clearable: true, + options: [ + { + label: '订单', + value: '1', + }, + { + label: '其他', + value: '2', + }, + ], + }, + }, + { + field: 'status', + component: 'NSelect', + label: '状态', + componentProps: { + placeholder: '请选择状态', + clearable: true, + options: [ + { + label: '已读', + value: '1', + }, + { + label: '未读', + value: '0', + }, + ], + }, + }, +]; diff --git a/src/views/monitor/online/columns.ts b/src/views/monitor/online/columns.ts new file mode 100644 index 0000000..abf3443 --- /dev/null +++ b/src/views/monitor/online/columns.ts @@ -0,0 +1,58 @@ +import { h } from 'vue'; + +export const columns = [ + { + title: '序号', + render: (_, index) => { + return `${index + 1}` + }, + fixed: 'left', + width: 80, + }, + { + title: '会话编号', + key: 'tokenId', + width: 300, + }, + { + title: '登录名称', + key: 'username', + width: 100, + }, + { + title: '部门名称', + key: 'deptName', + width: 150, + }, + { + title: 'IP地址', + key: 'ipAddr', + width: 150, + }, + { + title: '登录地点', + key: 'loginLocation', + width: 100, + }, + { + title: '浏览器', + key: 'browser', + width: 150, + }, + { + title: '操作系统', + key: 'os', + width: 150, + }, + { + title: '登录时间', + key: 'loginTime', + width: 180, + }, + { + title: '操作', + fixed: 'right', + key: 'action', + width: 100, + }, +]; diff --git a/src/views/monitor/online/index.vue b/src/views/monitor/online/index.vue new file mode 100644 index 0000000..cd2f50d --- /dev/null +++ b/src/views/monitor/online/index.vue @@ -0,0 +1,128 @@ + + + + + diff --git a/src/views/monitor/online/querySchemas.ts b/src/views/monitor/online/querySchemas.ts new file mode 100644 index 0000000..fcdbd59 --- /dev/null +++ b/src/views/monitor/online/querySchemas.ts @@ -0,0 +1,19 @@ +import { FormSchema } from '@/components/Form/index'; +export const schemas: FormSchema[] = [ + { + field: 'ipAddr', + component: 'NInput', + label: '登录IP', + componentProps: { + placeholder: '请输入登录IP', + }, + }, + { + field: 'username', + component: 'NInput', + label: '登录账号', + componentProps: { + placeholder: '请输入登录账号', + }, + }, +]; diff --git a/src/views/system/logger/loginLog.vue b/src/views/system/logger/loginLog.vue new file mode 100644 index 0000000..f0f8c42 --- /dev/null +++ b/src/views/system/logger/loginLog.vue @@ -0,0 +1,161 @@ + + + + + diff --git a/src/views/system/logger/loginLog/columns.ts b/src/views/system/logger/loginLog/columns.ts new file mode 100644 index 0000000..95410c8 --- /dev/null +++ b/src/views/system/logger/loginLog/columns.ts @@ -0,0 +1,87 @@ +import { h } from 'vue'; +import { NTag } from 'naive-ui'; + +export const columns = [ + { + type: 'selection', + width: 50, + fixed:"left" + }, + { + title: 'ID', + key: 'id', + fixed: 'left', + width: 50, + }, + { + title: '操作用户', + key: 'username', + width: 100, + }, + { + title: '请求ip', + key: 'ip', + width: 100, + }, + { + title: '浏览器', + key: 'browser', + width: 100, + }, + { + title: '操作系统', + key: 'os', + width: 100, + }, + { + title: '操作类型', + key: 'typeText', + width: 100, + }, + { + title: '操作来源', + key: 'sourceText', + width: 100, + }, + { + title: '请求方式', + key: 'requestMethod', + width: 100, + }, + { + title: '请求URL', + key: 'url', + width: 100, + }, + { + title: '请求地区', + key: 'location', + width: 100, + }, + { + title: '请求耗时', + key: 'consumeTime', + width: 100, + }, + { + title: '状态', + key: 'status', + render(record) { + return h( + NTag, + { + type: record.status == 0 ? 'success' : 'error', + }, + { + default: () => (record.status == 0 ? '正常' : '异常'), + }, + ); + }, + width: 100, + }, + { + title: '创建时间', + key: 'createTime', + width: 180, + }, +]; diff --git a/src/views/system/logger/loginLog/edit.vue b/src/views/system/logger/loginLog/edit.vue new file mode 100644 index 0000000..665850b --- /dev/null +++ b/src/views/system/logger/loginLog/edit.vue @@ -0,0 +1,109 @@ + + + diff --git a/src/views/system/logger/loginLog/querySchemas.ts b/src/views/system/logger/loginLog/querySchemas.ts new file mode 100644 index 0000000..7c03a28 --- /dev/null +++ b/src/views/system/logger/loginLog/querySchemas.ts @@ -0,0 +1,49 @@ +import { FormSchema } from '@/components/Form/index'; +export const schemas: FormSchema[] = [ + { + field: 'username', + component: 'NInput', + label: '操作用户', + componentProps: { + placeholder: '请输入操作用户', + }, + }, + { + field: 'type', + component: 'NSelect', + label: '请求类型', + componentProps: { + placeholder: '请选择请求类型', + clearable: true, + options: [ + { + label: '登录', + value: '0', + }, + { + label: '退出', + value: '1', + }, + ], + }, + }, + { + field: 'status', + component: 'NSelect', + label: '请求状态', + componentProps: { + placeholder: '请选择状态', + clearable: true, + options: [ + { + label: '正常', + value: '0', + }, + { + label: '异常', + value: '1', + }, + ], + }, + }, +]; diff --git a/src/views/system/logger/operLog.vue b/src/views/system/logger/operLog.vue new file mode 100644 index 0000000..e41f0e7 --- /dev/null +++ b/src/views/system/logger/operLog.vue @@ -0,0 +1,161 @@ + + + + + diff --git a/src/views/system/logger/operLog/columns.ts b/src/views/system/logger/operLog/columns.ts new file mode 100644 index 0000000..9bb2599 --- /dev/null +++ b/src/views/system/logger/operLog/columns.ts @@ -0,0 +1,92 @@ +import { h } from 'vue'; +import { NTag } from 'naive-ui'; + +export const columns = [ + { + type: 'selection', + width: 50, + fixed:"left" + }, + { + title: 'ID', + key: 'id', + fixed: 'left', + width: 100, + }, + { + title: '日志标题', + key: 'title', + width: 100, + }, + { + title: '操作用户', + key: 'createUser', + width: 100, + }, + { + title: '请求ip', + key: 'ip', + width: 140, + }, + { + title: '浏览器', + key: 'browser', + width: 100, + }, + { + title: '操作系统', + key: 'os', + width: 100, + }, + { + title: '操作类型', + key: 'typeText', + width: 100, + }, + { + title: '操作来源', + key: 'sourceText', + width: 100, + }, + { + title: '请求方式', + key: 'requestMethod', + width: 100, + }, + { + title: '请求URL', + key: 'url', + width: 150, + }, + { + title: '请求地区', + key: 'location', + width: 100, + }, + { + title: '请求耗时', + key: 'consumeTime', + width: 100, + }, + { + title: '状态', + key: 'status', + render(record) { + return h( + NTag, + { + type: record.status == 0 ? 'success' : 'error', + }, + { + default: () => (record.status == 0 ? '正常' : '异常'), + }, + ); + }, + width: 100, + }, + { + title: '创建时间', + key: 'createTime', + width: 180, + } +]; diff --git a/src/views/system/logger/operLog/edit.vue b/src/views/system/logger/operLog/edit.vue new file mode 100644 index 0000000..9762ed4 --- /dev/null +++ b/src/views/system/logger/operLog/edit.vue @@ -0,0 +1,109 @@ + + + diff --git a/src/views/system/logger/operLog/querySchemas.ts b/src/views/system/logger/operLog/querySchemas.ts new file mode 100644 index 0000000..689c27f --- /dev/null +++ b/src/views/system/logger/operLog/querySchemas.ts @@ -0,0 +1,30 @@ +import { FormSchema } from '@/components/Form/index'; +export const schemas: FormSchema[] = [ + { + field: 'title', + component: 'NInput', + label: '日志标题', + componentProps: { + placeholder: '请输入日志标题', + }, + }, + { + field: 'status', + component: 'NSelect', + label: '请求状态', + componentProps: { + placeholder: '请选择状态', + clearable: true, + options: [ + { + label: '正常', + value: '0', + }, + { + label: '异常', + value: '1', + }, + ], + }, + }, +]; diff --git a/src/views/system/role/querySchemas.ts b/src/views/system/role/querySchemas.ts new file mode 100644 index 0000000..79d5c9b --- /dev/null +++ b/src/views/system/role/querySchemas.ts @@ -0,0 +1,11 @@ +import { FormSchema } from '@/components/Form/index'; +export const schemas: FormSchema[] = [ + { + field: 'name', + component: 'NInput', + label: '角色名称', + componentProps: { + placeholder: '请输入角色名称', + }, + }, +];