日志详情
This commit is contained in:
parent
d85ee87215
commit
5b15ce2f32
@ -7,9 +7,9 @@
|
|||||||
:close-on-click-modal="false"
|
:close-on-click-modal="false"
|
||||||
:before-close="dialogClose"
|
:before-close="dialogClose"
|
||||||
>
|
>
|
||||||
<el-descriptions column="2">
|
<el-descriptions column="2" border>
|
||||||
<el-descriptions-item label="消息标题:">{{formData.title}}</el-descriptions-item>
|
<el-descriptions-item label="消息标题:"label-class-name="des-width">{{formData.title}}</el-descriptions-item>
|
||||||
<el-descriptions-item label="消息类型:">{{getTyepText(formData.type)}}</el-descriptions-item>
|
<el-descriptions-item label="消息类型:"label-class-name="des-width">{{getTyepText(formData.type)}}</el-descriptions-item>
|
||||||
<el-descriptions-item label="业务类型:">{{formData.bizType==1?'订单':'其他'}}</el-descriptions-item>
|
<el-descriptions-item label="业务类型:">{{formData.bizType==1?'订单':'其他'}}</el-descriptions-item>
|
||||||
<el-descriptions-item label="消息状态:">{{formData.status==1?'已读':'未读'}}</el-descriptions-item>
|
<el-descriptions-item label="消息状态:">{{formData.status==1?'已读':'未读'}}</el-descriptions-item>
|
||||||
<el-descriptions-item label="消息内容:">{{formData.content}}</el-descriptions-item>
|
<el-descriptions-item label="消息内容:">{{formData.content}}</el-descriptions-item>
|
||||||
@ -106,3 +106,11 @@ onMounted(() => {
|
|||||||
});
|
});
|
||||||
|
|
||||||
</script>
|
</script>
|
||||||
|
<style lang="scss" scoped>
|
||||||
|
:deep(.des-width) {
|
||||||
|
width:120px;
|
||||||
|
}
|
||||||
|
:deep(.el-descriptions__body .el-descriptions__table .el-descriptions__cell) {
|
||||||
|
word-break: break-all;
|
||||||
|
}
|
||||||
|
</style>
|
@ -7,7 +7,7 @@
|
|||||||
:close-on-click-modal="false"
|
:close-on-click-modal="false"
|
||||||
:before-close="dialogClose"
|
:before-close="dialogClose"
|
||||||
>
|
>
|
||||||
<el-descriptions column="2">
|
<el-descriptions column="2" border>
|
||||||
<el-descriptions-item label="日志标题:">{{formData.title}}</el-descriptions-item>
|
<el-descriptions-item label="日志标题:">{{formData.title}}</el-descriptions-item>
|
||||||
<el-descriptions-item label="日志类型:">{{getTyepText(formData.type)}}</el-descriptions-item>
|
<el-descriptions-item label="日志类型:">{{getTyepText(formData.type)}}</el-descriptions-item>
|
||||||
<el-descriptions-item label="模板编号:">{{formData.number}}</el-descriptions-item>
|
<el-descriptions-item label="模板编号:">{{formData.number}}</el-descriptions-item>
|
||||||
@ -26,22 +26,10 @@
|
|||||||
<script lang="ts" setup>
|
<script lang="ts" setup>
|
||||||
import type {FormInstance} from "element-plus";
|
import type {FormInstance} from "element-plus";
|
||||||
import {getEmailLogDetail} from "@/api/logger/emailLog";
|
import {getEmailLogDetail} from "@/api/logger/emailLog";
|
||||||
import {onMounted, reactive, shallowRef} from "vue";
|
import {onMounted, ref} from "vue";
|
||||||
import {message} from "@/utils/auth";
|
|
||||||
import {useLockFn} from "@/utils/useLockFn";
|
|
||||||
|
|
||||||
const emit = defineEmits(["success", "update:visible"]);
|
const emit = defineEmits(["success", "update:visible"]);
|
||||||
const formRef = shallowRef<FormInstance>();
|
const formData = ref({});
|
||||||
const formData = reactive({
|
|
||||||
id: "",
|
|
||||||
title: "",
|
|
||||||
type:'',
|
|
||||||
number:'',
|
|
||||||
receiveMobile:'',
|
|
||||||
receiveType:'',
|
|
||||||
consumeTime:'',
|
|
||||||
status:''
|
|
||||||
});
|
|
||||||
|
|
||||||
const props = defineProps({
|
const props = defineProps({
|
||||||
visible: {
|
visible: {
|
||||||
@ -63,12 +51,7 @@ const dialogClose = () => {
|
|||||||
|
|
||||||
const setFormData = async () => {
|
const setFormData = async () => {
|
||||||
const data = await getEmailLogDetail(props.emailId);
|
const data = await getEmailLogDetail(props.emailId);
|
||||||
for (const key in formData) {
|
formData.value= data
|
||||||
if (data[key] != null && data[key] != undefined) {
|
|
||||||
//@ts-ignore
|
|
||||||
formData[key] = data[key];
|
|
||||||
}
|
|
||||||
}
|
|
||||||
};
|
};
|
||||||
const getReviceType =(type)=>{
|
const getReviceType =(type)=>{
|
||||||
let typeText = ''
|
let typeText = ''
|
||||||
@ -118,3 +101,11 @@ onMounted(() => {
|
|||||||
});
|
});
|
||||||
|
|
||||||
</script>
|
</script>
|
||||||
|
<style lang="scss" scoped>
|
||||||
|
:deep(.des-width) {
|
||||||
|
width:120px;
|
||||||
|
}
|
||||||
|
:deep(.el-descriptions__body .el-descriptions__table .el-descriptions__cell) {
|
||||||
|
word-break: break-all;
|
||||||
|
}
|
||||||
|
</style>
|
||||||
|
@ -7,11 +7,21 @@
|
|||||||
:close-on-click-modal="false"
|
:close-on-click-modal="false"
|
||||||
:before-close="dialogClose"
|
:before-close="dialogClose"
|
||||||
>
|
>
|
||||||
<el-descriptions column="2">
|
<el-descriptions column="2" border>
|
||||||
<el-descriptions-item label="文件名称:"><a :href="formData.filePath" target="_blank">{{formData.originalName}}</a></el-descriptions-item>
|
<el-descriptions-item label="文件名称:"><a :href="formData.filePath" target="_blank">{{formData.originalName}}</a></el-descriptions-item>
|
||||||
<el-descriptions-item label="文件类型:">{{formData.fileType}}</el-descriptions-item>
|
<el-descriptions-item label="文件类型:">{{formData.fileType}}</el-descriptions-item>
|
||||||
<el-descriptions-item label="文件后缀:">{{formData.fileExtension}}</el-descriptions-item>
|
|
||||||
<el-descriptions-item label="文件大小:">{{formData.fileSize}}B</el-descriptions-item>
|
<el-descriptions-item label="文件大小:">{{formData.fileSize}}B</el-descriptions-item>
|
||||||
|
<el-descriptions-item label="请求耗时:">{{formData.consumeTime}}s</el-descriptions-item>
|
||||||
|
</el-descriptions>
|
||||||
|
<el-descriptions class="margin-top" :column="1" border>
|
||||||
|
<el-descriptions-item label="请求参数" label-class-name="des-width">
|
||||||
|
{{formData.param}}
|
||||||
|
</el-descriptions-item>
|
||||||
|
</el-descriptions>
|
||||||
|
<el-descriptions class="margin-top" :column="1" border>
|
||||||
|
<el-descriptions-item label="返回结果" label-class-name="des-width">
|
||||||
|
{{formData.result}}
|
||||||
|
</el-descriptions-item>
|
||||||
</el-descriptions>
|
</el-descriptions>
|
||||||
<template #footer>
|
<template #footer>
|
||||||
<span class="dialog-footer">
|
<span class="dialog-footer">
|
||||||
@ -22,18 +32,10 @@
|
|||||||
</template>
|
</template>
|
||||||
<script lang="ts" setup>
|
<script lang="ts" setup>
|
||||||
import {getFileLogDetail} from "@/api/logger/fileLog";
|
import {getFileLogDetail} from "@/api/logger/fileLog";
|
||||||
import {onMounted, reactive, shallowRef} from "vue";
|
import {onMounted, ref} from "vue";
|
||||||
|
|
||||||
const emit = defineEmits(["success", "update:visible"]);
|
const emit = defineEmits(["success", "update:visible"]);
|
||||||
const formData = reactive({
|
const formData = ref({});
|
||||||
id: "",
|
|
||||||
fileName: "",
|
|
||||||
filePath:'',
|
|
||||||
fileSize:'',
|
|
||||||
fileType:'',
|
|
||||||
fileExtension:'',
|
|
||||||
originalName:''
|
|
||||||
});
|
|
||||||
|
|
||||||
const props = defineProps({
|
const props = defineProps({
|
||||||
visible: {
|
visible: {
|
||||||
@ -55,12 +57,7 @@ const dialogClose = () => {
|
|||||||
|
|
||||||
const setFormData = async () => {
|
const setFormData = async () => {
|
||||||
const data = await getFileLogDetail(props.fileId);
|
const data = await getFileLogDetail(props.fileId);
|
||||||
for (const key in formData) {
|
formData.value = data
|
||||||
if (data[key] != null && data[key] != undefined) {
|
|
||||||
//@ts-ignore
|
|
||||||
formData[key] = data[key];
|
|
||||||
}
|
|
||||||
}
|
|
||||||
};
|
};
|
||||||
|
|
||||||
onMounted(() => {
|
onMounted(() => {
|
||||||
@ -70,3 +67,11 @@ onMounted(() => {
|
|||||||
});
|
});
|
||||||
|
|
||||||
</script>
|
</script>
|
||||||
|
<style lang="scss" scoped>
|
||||||
|
:deep(.des-width) {
|
||||||
|
width:120px;
|
||||||
|
}
|
||||||
|
:deep(.el-descriptions__body .el-descriptions__table .el-descriptions__cell) {
|
||||||
|
word-break: break-all;
|
||||||
|
}
|
||||||
|
</style>
|
||||||
|
@ -7,15 +7,25 @@
|
|||||||
:close-on-click-modal="false"
|
:close-on-click-modal="false"
|
||||||
:before-close="dialogClose"
|
:before-close="dialogClose"
|
||||||
>
|
>
|
||||||
<el-descriptions column="2">
|
<el-descriptions column="2" border>
|
||||||
<el-descriptions-item label="日志标题:">{{formData.title}}</el-descriptions-item>
|
<el-descriptions-item label="日志标题:">{{formData.title}}</el-descriptions-item>
|
||||||
<el-descriptions-item label="日志类型:">{{getTyepText(formData.type)}}</el-descriptions-item>
|
<el-descriptions-item label="日志类型:">{{getTyepText(formData.type)}}</el-descriptions-item>
|
||||||
<el-descriptions-item label="模板编号:">{{formData.number}}</el-descriptions-item>
|
<el-descriptions-item label="模板编号:">{{formData.number}}</el-descriptions-item>
|
||||||
<el-descriptions-item label="接收人手机:">{{formData.receiveMobile}}</el-descriptions-item>
|
<el-descriptions-item label="接收人手机:">{{formData.receiveMobile}}</el-descriptions-item>
|
||||||
<el-descriptions-item label="接收人类型:">{{getReviceType(formData.receiveType)}}</el-descriptions-item>
|
<el-descriptions-item label="接收人类型:">{{getReviceType(formData.receiveType)}}</el-descriptions-item>
|
||||||
<el-descriptions-item label="请求耗时:">{{formData.consumeTime}}</el-descriptions-item>
|
<el-descriptions-item label="请求耗时:">{{formData.consumeTime}}s</el-descriptions-item>
|
||||||
<el-descriptions-item label="日志状态:">{{formData.status==1?'已读':'未读'}}</el-descriptions-item>
|
<el-descriptions-item label="日志状态:">{{formData.status==1?'已读':'未读'}}</el-descriptions-item>
|
||||||
</el-descriptions>
|
</el-descriptions>
|
||||||
|
<el-descriptions class="margin-top" :column="1" border>
|
||||||
|
<el-descriptions-item label="请求参数" label-class-name="des-width">
|
||||||
|
{{formData.param}}
|
||||||
|
</el-descriptions-item>
|
||||||
|
</el-descriptions>
|
||||||
|
<el-descriptions class="margin-top" :column="1" border>
|
||||||
|
<el-descriptions-item label="返回结果" label-class-name="des-width">
|
||||||
|
{{formData.result}}
|
||||||
|
</el-descriptions-item>
|
||||||
|
</el-descriptions>
|
||||||
<template #footer>
|
<template #footer>
|
||||||
<span class="dialog-footer">
|
<span class="dialog-footer">
|
||||||
<el-button @click="dialogClose">关闭</el-button>
|
<el-button @click="dialogClose">关闭</el-button>
|
||||||
@ -26,22 +36,13 @@
|
|||||||
<script lang="ts" setup>
|
<script lang="ts" setup>
|
||||||
import type {FormInstance} from "element-plus";
|
import type {FormInstance} from "element-plus";
|
||||||
import {getSmsLogDetail} from "@/api/logger/smsLog";
|
import {getSmsLogDetail} from "@/api/logger/smsLog";
|
||||||
import {onMounted, reactive, shallowRef} from "vue";
|
import {onMounted, ref, shallowRef} from "vue";
|
||||||
import {message} from "@/utils/auth";
|
import {message} from "@/utils/auth";
|
||||||
import {useLockFn} from "@/utils/useLockFn";
|
import {useLockFn} from "@/utils/useLockFn";
|
||||||
|
|
||||||
const emit = defineEmits(["success", "update:visible"]);
|
const emit = defineEmits(["success", "update:visible"]);
|
||||||
const formRef = shallowRef<FormInstance>();
|
const formRef = shallowRef<FormInstance>();
|
||||||
const formData = reactive({
|
const formData = ref({});
|
||||||
id: "",
|
|
||||||
title: "",
|
|
||||||
type:'',
|
|
||||||
number:'',
|
|
||||||
receiveMobile:'',
|
|
||||||
receiveType:'',
|
|
||||||
consumeTime:'',
|
|
||||||
status:''
|
|
||||||
});
|
|
||||||
|
|
||||||
const props = defineProps({
|
const props = defineProps({
|
||||||
visible: {
|
visible: {
|
||||||
@ -63,12 +64,7 @@ const dialogClose = () => {
|
|||||||
|
|
||||||
const setFormData = async () => {
|
const setFormData = async () => {
|
||||||
const data = await getSmsLogDetail(props.smsId);
|
const data = await getSmsLogDetail(props.smsId);
|
||||||
for (const key in formData) {
|
formData.value = data
|
||||||
if (data[key] != null && data[key] != undefined) {
|
|
||||||
//@ts-ignore
|
|
||||||
formData[key] = data[key];
|
|
||||||
}
|
|
||||||
}
|
|
||||||
};
|
};
|
||||||
const getReviceType =(type)=>{
|
const getReviceType =(type)=>{
|
||||||
let typeText = ''
|
let typeText = ''
|
||||||
@ -118,3 +114,11 @@ onMounted(() => {
|
|||||||
});
|
});
|
||||||
|
|
||||||
</script>
|
</script>
|
||||||
|
<style lang="scss" scoped>
|
||||||
|
:deep(.des-width) {
|
||||||
|
width:120px;
|
||||||
|
}
|
||||||
|
:deep(.el-descriptions__body .el-descriptions__table .el-descriptions__cell) {
|
||||||
|
word-break: break-all;
|
||||||
|
}
|
||||||
|
</style>
|
@ -1,69 +1,65 @@
|
|||||||
<template>
|
<template>
|
||||||
<el-dialog
|
<el-dialog
|
||||||
v-model="props.visible"
|
v-model="props.visible"
|
||||||
:title="props.positionId?'编辑':'新增'"
|
title="登录日志详情"
|
||||||
|
width="700"
|
||||||
width="500"
|
|
||||||
:close-on-click-modal="false"
|
:close-on-click-modal="false"
|
||||||
:before-close="dialogClose"
|
:before-close="dialogClose"
|
||||||
>
|
>
|
||||||
<el-form
|
<el-descriptions class="margin-top" :column="2" border>
|
||||||
class="ls-form"
|
<el-descriptions-item label="操作用户" label-class-name="des-width">
|
||||||
ref="formRef"
|
{{formData.createUser}}
|
||||||
:model="formData"
|
</el-descriptions-item>
|
||||||
label-width="80px"
|
<el-descriptions-item label="IP地址" label-class-name="des-width">
|
||||||
>
|
{{formData.ip}}
|
||||||
<el-form-item
|
</el-descriptions-item>
|
||||||
label="名称"
|
<el-descriptions-item label="操作系统">
|
||||||
prop="name"
|
{{formData.os}}
|
||||||
:rules="{ required: true, message: '请输入名称', trigger: 'blur' }"
|
</el-descriptions-item>
|
||||||
>
|
<el-descriptions-item label="操作浏览器">
|
||||||
<el-input
|
{{formData.browser}}
|
||||||
class="ls-input"
|
</el-descriptions-item>
|
||||||
v-model="formData.name"
|
<el-descriptions-item label="请求耗时">
|
||||||
placeholder="请输入名称"
|
{{formData.consumeTime}}s
|
||||||
clearable
|
</el-descriptions-item>
|
||||||
/>
|
<el-descriptions-item label="请求地区">
|
||||||
</el-form-item>
|
{{formData.location}}
|
||||||
<el-form-item label="岗位状态" prop="status">
|
</el-descriptions-item>
|
||||||
<el-radio-group v-model="formData.status" name="status">
|
<el-descriptions-item label="请求方式">
|
||||||
<el-radio :value="1">正常</el-radio>
|
{{formData.requestMethod}}
|
||||||
<el-radio :value="2">禁用</el-radio>
|
</el-descriptions-item>
|
||||||
</el-radio-group>
|
<el-descriptions-item label="请求状态">
|
||||||
</el-form-item>
|
<el-tag :type="formData.status?'danger':'success'">{{formData.status?'异常':'正常'}}</el-tag>
|
||||||
<el-form-item label="排序" prop="sort">
|
</el-descriptions-item>
|
||||||
<el-input-number v-model="formData.sort"/>
|
</el-descriptions>
|
||||||
</el-form-item>
|
<el-descriptions class="margin-top" :column="1" border>
|
||||||
<el-form-item label="备注" prop="note">
|
<el-descriptions-item label="调用方法"label-class-name="des-width">
|
||||||
<el-input v-model="formData.note" type="textarea" placeholder="请输入备注" clearable />
|
{{formData.method}}
|
||||||
</el-form-item>
|
</el-descriptions-item>
|
||||||
</el-form>
|
</el-descriptions>
|
||||||
|
<el-descriptions class="margin-top" :column="1" border>
|
||||||
|
<el-descriptions-item label="请求参数"label-class-name="des-width">
|
||||||
|
{{formData.param}}
|
||||||
|
</el-descriptions-item>
|
||||||
|
</el-descriptions>
|
||||||
|
<el-descriptions class="margin-top" :column="1" border>
|
||||||
|
<el-descriptions-item label="返回结果" label-class-name="des-width">
|
||||||
|
{{formData.result}}
|
||||||
|
</el-descriptions-item>
|
||||||
|
</el-descriptions>
|
||||||
<template #footer>
|
<template #footer>
|
||||||
<span class="dialog-footer">
|
<span class="dialog-footer">
|
||||||
<el-button @click="dialogClose">取消</el-button>
|
<el-button @click="dialogClose">取消</el-button>
|
||||||
<el-button :loading="subLoading" type="primary" @click="submit">
|
|
||||||
确定
|
|
||||||
</el-button>
|
|
||||||
</span>
|
</span>
|
||||||
</template>
|
</template>
|
||||||
</el-dialog>
|
</el-dialog>
|
||||||
</template>
|
</template>
|
||||||
<script lang="ts" setup>
|
<script lang="ts" setup>
|
||||||
import type {FormInstance} from "element-plus";
|
import {getLoginLogDetail} from "@/api/system/loginLog";
|
||||||
import {getPositionDetail,positionAdd,positionUpdate} from "@/api/system/position";
|
import {onMounted, ref,} from "vue";
|
||||||
import {onMounted, reactive, shallowRef} from "vue";
|
|
||||||
import {message} from "@/utils/auth";
|
|
||||||
import {useLockFn} from "@/utils/useLockFn";
|
|
||||||
|
|
||||||
const emit = defineEmits(["success", "update:visible"]);
|
const emit = defineEmits(["success", "update:visible"]);
|
||||||
const formRef = shallowRef<FormInstance>();
|
const formData = ref({});
|
||||||
const formData = reactive({
|
|
||||||
id: "",
|
|
||||||
name: "",
|
|
||||||
status: 1,
|
|
||||||
sort: 0,
|
|
||||||
note:'',
|
|
||||||
});
|
|
||||||
|
|
||||||
const props = defineProps({
|
const props = defineProps({
|
||||||
visible: {
|
visible: {
|
||||||
@ -71,42 +67,36 @@ const props = defineProps({
|
|||||||
required: true,
|
required: true,
|
||||||
default: false
|
default: false
|
||||||
},
|
},
|
||||||
positionId: {
|
loginlogId: {
|
||||||
type: Number,
|
type: Number,
|
||||||
required: true,
|
required: true,
|
||||||
default: 0
|
default: 0
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
const handleSubmit = async () => {
|
|
||||||
await formRef.value?.validate();
|
|
||||||
props.positionId ? await positionUpdate(formData) : await positionAdd(formData);
|
|
||||||
message("操作成功");
|
|
||||||
emit("update:visible", false);
|
|
||||||
emit("success");
|
|
||||||
};
|
|
||||||
|
|
||||||
const dialogClose = () => {
|
const dialogClose = () => {
|
||||||
emit("update:visible", false);
|
emit("update:visible", false);
|
||||||
};
|
};
|
||||||
|
|
||||||
const { isLock:subLoading,lockFn: submit } = useLockFn(handleSubmit);
|
|
||||||
|
|
||||||
|
|
||||||
const setFormData = async () => {
|
const setFormData = async () => {
|
||||||
const data = await getPositionDetail(props.positionId);
|
const data = await getLoginLogDetail(props.loginlogId);
|
||||||
for (const key in formData) {
|
formData.value = data
|
||||||
if (data[key] != null && data[key] != undefined) {
|
|
||||||
//@ts-ignore
|
|
||||||
formData[key] = data[key];
|
|
||||||
}
|
|
||||||
}
|
|
||||||
};
|
};
|
||||||
|
|
||||||
onMounted(() => {
|
onMounted(() => {
|
||||||
if (props.positionId) {
|
if (props.loginlogId) {
|
||||||
setFormData();
|
setFormData();
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
</script>
|
</script>
|
||||||
|
<style lang="scss" scoped>
|
||||||
|
:deep(.des-width) {
|
||||||
|
width:120px;
|
||||||
|
}
|
||||||
|
:deep(.el-descriptions__body .el-descriptions__table .el-descriptions__cell) {
|
||||||
|
word-break: break-all;
|
||||||
|
}
|
||||||
|
</style>
|
||||||
|
|
||||||
|
@ -27,7 +27,7 @@
|
|||||||
|
|
||||||
<editDialog
|
<editDialog
|
||||||
v-if="editVisible"
|
v-if="editVisible"
|
||||||
:positionId="positionId"
|
:loginlogId="loginlogId"
|
||||||
v-model:visible="editVisible"
|
v-model:visible="editVisible"
|
||||||
@success="reloadTable('noRefresh')"
|
@success="reloadTable('noRefresh')"
|
||||||
>
|
>
|
||||||
@ -47,7 +47,7 @@
|
|||||||
const editDialog = defineAsyncComponent(() =>
|
const editDialog = defineAsyncComponent(() =>
|
||||||
import('./loginLog/edit.vue')
|
import('./loginLog/edit.vue')
|
||||||
)
|
)
|
||||||
const positionId =ref(0)
|
const loginlogId =ref(0)
|
||||||
const editVisible=ref(false)
|
const editVisible=ref(false)
|
||||||
const selectionData = ref([])
|
const selectionData = ref([])
|
||||||
const tableRef = ref();
|
const tableRef = ref();
|
||||||
@ -64,15 +64,12 @@ const editVisible=ref(false)
|
|||||||
return h(TableAction, {
|
return h(TableAction, {
|
||||||
style: 'button',
|
style: 'button',
|
||||||
actions: [
|
actions: [
|
||||||
// {
|
{
|
||||||
// label: '编辑',
|
label: '详情',
|
||||||
// type: 'warning',
|
type: 'warning',
|
||||||
// onClick: handleEdit.bind(null, record),
|
onClick: handleInfo.bind(null, record),
|
||||||
// ifShow: () => {
|
auth: ['sys:loginlog:detail'],
|
||||||
// return true;
|
},
|
||||||
// },
|
|
||||||
// auth: ['basic_list'],
|
|
||||||
// },
|
|
||||||
{
|
{
|
||||||
label: '删除',
|
label: '删除',
|
||||||
type: 'danger',
|
type: 'danger',
|
||||||
@ -112,8 +109,8 @@ const editVisible=ref(false)
|
|||||||
formParams[key] ='';
|
formParams[key] ='';
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
const handleEdit = async (record: Recordable) => {
|
const handleInfo = async (record: Recordable) => {
|
||||||
positionId.value=record.row.id
|
loginlogId.value=record.row.id
|
||||||
await nextTick();
|
await nextTick();
|
||||||
editVisible.value=true
|
editVisible.value=true
|
||||||
};
|
};
|
||||||
|
@ -1,68 +1,65 @@
|
|||||||
<template>
|
<template>
|
||||||
<el-dialog
|
<el-dialog
|
||||||
v-model="props.visible"
|
v-model="props.visible"
|
||||||
:title="props.positionId?'编辑':'新增'"
|
title="操作日志详情"
|
||||||
width="500"
|
width="700"
|
||||||
:close-on-click-modal="false"
|
:close-on-click-modal="false"
|
||||||
:before-close="dialogClose"
|
:before-close="dialogClose"
|
||||||
>
|
>
|
||||||
<el-form
|
<el-descriptions class="margin-top" :column="2" border>
|
||||||
class="ls-form"
|
<el-descriptions-item label="日志标题" label-class-name="des-width">
|
||||||
ref="formRef"
|
{{formData.title}}
|
||||||
:model="formData"
|
</el-descriptions-item>
|
||||||
label-width="80px"
|
<el-descriptions-item label="操作用户" label-class-name="des-width">
|
||||||
>
|
{{formData.createUser}}
|
||||||
<el-form-item
|
</el-descriptions-item>
|
||||||
label="名称"
|
<el-descriptions-item label="IP地址">
|
||||||
prop="name"
|
{{formData.ip}}
|
||||||
:rules="{ required: true, message: '请输入名称', trigger: 'blur' }"
|
</el-descriptions-item>
|
||||||
>
|
<el-descriptions-item label="操作系统">
|
||||||
<el-input
|
{{formData.os}}
|
||||||
class="ls-input"
|
</el-descriptions-item>
|
||||||
v-model="formData.name"
|
<el-descriptions-item label="操作浏览器">
|
||||||
placeholder="请输入名称"
|
{{formData.browser}}
|
||||||
clearable
|
</el-descriptions-item>
|
||||||
/>
|
<el-descriptions-item label="请求耗时">
|
||||||
</el-form-item>
|
{{formData.consumeTime}}s
|
||||||
<el-form-item label="岗位状态" prop="status">
|
</el-descriptions-item>
|
||||||
<el-radio-group v-model="formData.status" name="status">
|
<el-descriptions-item label="请求方式">
|
||||||
<el-radio :value="1">正常</el-radio>
|
{{formData.requestMethod}}
|
||||||
<el-radio :value="2">禁用</el-radio>
|
</el-descriptions-item>
|
||||||
</el-radio-group>
|
<el-descriptions-item label="请求状态">
|
||||||
</el-form-item>
|
<el-tag :type="formData.status?'danger':'success'">{{formData.status?'异常':'正常'}}</el-tag>
|
||||||
<el-form-item label="排序" prop="sort">
|
</el-descriptions-item>
|
||||||
<el-input-number v-model="formData.sort"/>
|
</el-descriptions>
|
||||||
</el-form-item>
|
<el-descriptions class="margin-top" :column="1" border>
|
||||||
<el-form-item label="备注" prop="note">
|
<el-descriptions-item label="调用方法"label-class-name="des-width">
|
||||||
<el-input v-model="formData.note" type="textarea" placeholder="请输入备注" clearable />
|
{{formData.method}}
|
||||||
</el-form-item>
|
</el-descriptions-item>
|
||||||
</el-form>
|
</el-descriptions>
|
||||||
|
<el-descriptions class="margin-top" :column="1" border>
|
||||||
|
<el-descriptions-item label="请求参数"label-class-name="des-width">
|
||||||
|
{{formData.param}}
|
||||||
|
</el-descriptions-item>
|
||||||
|
</el-descriptions>
|
||||||
|
<el-descriptions class="margin-top" :column="1" border>
|
||||||
|
<el-descriptions-item label="返回结果" label-class-name="des-width">
|
||||||
|
{{formData.result}}
|
||||||
|
</el-descriptions-item>
|
||||||
|
</el-descriptions>
|
||||||
<template #footer>
|
<template #footer>
|
||||||
<span class="dialog-footer">
|
<span class="dialog-footer">
|
||||||
<el-button @click="dialogClose">取消</el-button>
|
<el-button @click="dialogClose">取消</el-button>
|
||||||
<el-button :loading="subLoading" type="primary" @click="submit">
|
|
||||||
确定
|
|
||||||
</el-button>
|
|
||||||
</span>
|
</span>
|
||||||
</template>
|
</template>
|
||||||
</el-dialog>
|
</el-dialog>
|
||||||
</template>
|
</template>
|
||||||
<script lang="ts" setup>
|
<script lang="ts" setup>
|
||||||
import type {FormInstance} from "element-plus";
|
import {getOperLogDetail} from "@/api/system/operLog";
|
||||||
import {getPositionDetail,positionAdd,positionUpdate} from "@/api/system/position";
|
import {onMounted, ref} from "vue";
|
||||||
import {onMounted, reactive, shallowRef} from "vue";
|
|
||||||
import {message} from "@/utils/auth";
|
|
||||||
import {useLockFn} from "@/utils/useLockFn";
|
|
||||||
|
|
||||||
const emit = defineEmits(["success", "update:visible"]);
|
const emit = defineEmits(["success", "update:visible"]);
|
||||||
const formRef = shallowRef<FormInstance>();
|
const formData = ref({});
|
||||||
const formData = reactive({
|
|
||||||
id: "",
|
|
||||||
name: "",
|
|
||||||
status: 1,
|
|
||||||
sort: 0,
|
|
||||||
note:'',
|
|
||||||
});
|
|
||||||
|
|
||||||
const props = defineProps({
|
const props = defineProps({
|
||||||
visible: {
|
visible: {
|
||||||
@ -70,42 +67,36 @@ const props = defineProps({
|
|||||||
required: true,
|
required: true,
|
||||||
default: false
|
default: false
|
||||||
},
|
},
|
||||||
positionId: {
|
operlogId: {
|
||||||
type: Number,
|
type: Number,
|
||||||
required: true,
|
required: true,
|
||||||
default: 0
|
default: 0
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
const handleSubmit = async () => {
|
|
||||||
await formRef.value?.validate();
|
|
||||||
props.positionId ? await positionUpdate(formData) : await positionAdd(formData);
|
|
||||||
message("操作成功");
|
|
||||||
emit("update:visible", false);
|
|
||||||
emit("success");
|
|
||||||
};
|
|
||||||
|
|
||||||
const dialogClose = () => {
|
const dialogClose = () => {
|
||||||
emit("update:visible", false);
|
emit("update:visible", false);
|
||||||
};
|
};
|
||||||
|
|
||||||
const { isLock:subLoading,lockFn: submit } = useLockFn(handleSubmit);
|
|
||||||
|
|
||||||
|
|
||||||
const setFormData = async () => {
|
const setFormData = async () => {
|
||||||
const data = await getPositionDetail(props.positionId);
|
const data = await getOperLogDetail(props.operlogId);
|
||||||
for (const key in formData) {
|
formData.value = data
|
||||||
if (data[key] != null && data[key] != undefined) {
|
|
||||||
//@ts-ignore
|
|
||||||
formData[key] = data[key];
|
|
||||||
}
|
|
||||||
}
|
|
||||||
};
|
};
|
||||||
|
|
||||||
onMounted(() => {
|
onMounted(() => {
|
||||||
if (props.positionId) {
|
if (props.operlogId) {
|
||||||
setFormData();
|
setFormData();
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
</script>
|
</script>
|
||||||
|
<style lang="scss" scoped>
|
||||||
|
:deep(.des-width) {
|
||||||
|
width:120px;
|
||||||
|
}
|
||||||
|
:deep(.el-descriptions__body .el-descriptions__table .el-descriptions__cell) {
|
||||||
|
word-break: break-all;
|
||||||
|
}
|
||||||
|
</style>
|
||||||
|
|
||||||
|
@ -27,7 +27,7 @@
|
|||||||
|
|
||||||
<editDialog
|
<editDialog
|
||||||
v-if="editVisible"
|
v-if="editVisible"
|
||||||
:positionId="positionId"
|
:operlogId="operlogId"
|
||||||
v-model:visible="editVisible"
|
v-model:visible="editVisible"
|
||||||
@success="reloadTable('noRefresh')"
|
@success="reloadTable('noRefresh')"
|
||||||
>
|
>
|
||||||
@ -47,7 +47,7 @@
|
|||||||
const editDialog = defineAsyncComponent(() =>
|
const editDialog = defineAsyncComponent(() =>
|
||||||
import('./operLog/edit.vue')
|
import('./operLog/edit.vue')
|
||||||
)
|
)
|
||||||
const positionId =ref(0)
|
const operlogId =ref(0)
|
||||||
const editVisible=ref(false)
|
const editVisible=ref(false)
|
||||||
const selectionData = ref([])
|
const selectionData = ref([])
|
||||||
const tableRef = ref();
|
const tableRef = ref();
|
||||||
@ -64,15 +64,12 @@ const editVisible=ref(false)
|
|||||||
return h(TableAction, {
|
return h(TableAction, {
|
||||||
style: 'button',
|
style: 'button',
|
||||||
actions: [
|
actions: [
|
||||||
// {
|
{
|
||||||
// label: '编辑',
|
label: '详情',
|
||||||
// type: 'warning',
|
type: 'warning',
|
||||||
// onClick: handleEdit.bind(null, record),
|
onClick: handleInfo.bind(null, record),
|
||||||
// ifShow: () => {
|
auth: ['sys:operlog:detail'],
|
||||||
// return true;
|
},
|
||||||
// },
|
|
||||||
// auth: ['basic_list'],
|
|
||||||
// },
|
|
||||||
{
|
{
|
||||||
label: '删除',
|
label: '删除',
|
||||||
type: 'danger',
|
type: 'danger',
|
||||||
@ -112,8 +109,8 @@ const editVisible=ref(false)
|
|||||||
formParams[key] ='';
|
formParams[key] ='';
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
const handleEdit = async (record: Recordable) => {
|
const handleInfo = async (record: Recordable) => {
|
||||||
positionId.value=record.row.id
|
operlogId.value=record.row.id
|
||||||
await nextTick();
|
await nextTick();
|
||||||
editVisible.value=true
|
editVisible.value=true
|
||||||
};
|
};
|
||||||
|
Loading…
Reference in New Issue
Block a user