推送/操作日志下载改location.href;移动组关闭自动select;所在组改单选

This commit is contained in:
chenxing
2026-08-18 00:04:08 +08:00
parent 58a606764b
commit 8fd5a21fcc
7 changed files with 37 additions and 33 deletions
+14 -20
View File
@@ -43,7 +43,8 @@
<span>{{ formatTime(row?.createdAt) }}</span>
</FormItem>
<FormItem label="请求体:">
<pre class="json-pre">{{ formatJson(row?.payload) }}</pre>
<a v-if="row?.id" href="javascript:;" class="download-link" @click.prevent="handleDownload">下载请求体</a>
<span v-else>-</span>
</FormItem>
</Form>
<template #footer>
@@ -54,6 +55,7 @@
<script lang="ts" setup>
import { computed } from 'vue';
import useCurrentInstance from '@/utils/hook/useCurrentInstance';
import Utils from '@/utils';
interface Props {
@@ -83,13 +85,11 @@ function onVisibleChange(val: boolean) {
if (!val) emit('update:modelValue', false);
}
function formatJson(val: any): string {
if (!val) return '-';
try {
return JSON.stringify(JSON.parse(val), null, 2);
} catch {
return String(val);
}
const { $conf } = useCurrentInstance();
function handleDownload() {
if (!props.row?.id) return;
location.href = `${$conf.serviceHost}/api/push/Download/${props.row.id}`;
}
function formatTime(val: any): string {
@@ -127,18 +127,12 @@ function formatTime(val: any): string {
word-break: break-all;
}
.json-pre {
margin: 0;
padding: 10px 12px;
background: #f7f8fa;
border: 1px solid #e8eaec;
border-radius: 4px;
max-height: 240px;
overflow: auto;
white-space: pre-wrap;
word-break: break-all;
font-size: 13px;
line-height: 1.6;
.download-link {
color: #577afb;
&:hover {
color: #3d5afe;
}
}
}
</style>