🐛 批量执行历史显示错误.
This commit is contained in:
@@ -84,27 +84,27 @@
|
||||
:hide-asterisk="true">
|
||||
<host-identity-selector v-model="formModel.identityId" />
|
||||
</a-form-item>
|
||||
<!-- 连接超时时间 -->
|
||||
<a-form-item field="connectTimeout"
|
||||
label="连接超时时间"
|
||||
:hide-asterisk="true">
|
||||
<a-input-number v-model="formModel.connectTimeout"
|
||||
placeholder="请输入连接超时时间"
|
||||
hide-button>
|
||||
<template #suffix>
|
||||
ms
|
||||
</template>
|
||||
</a-input-number>
|
||||
</a-form-item>
|
||||
<!-- 其他配置 -->
|
||||
<a-collapse :bordered="false">
|
||||
<a-collapse-item key="1">
|
||||
<template #header>
|
||||
<span class="usn">其他配置</span>
|
||||
</template>
|
||||
<!-- 连接超时时间 -->
|
||||
<a-form-item class="mt4"
|
||||
field="connectTimeout"
|
||||
label="连接超时时间"
|
||||
:hide-asterisk="true">
|
||||
<a-input-number v-model="formModel.connectTimeout"
|
||||
placeholder="请输入连接超时时间"
|
||||
hide-button>
|
||||
<template #suffix>
|
||||
ms
|
||||
</template>
|
||||
</a-input-number>
|
||||
</a-form-item>
|
||||
<!-- SSH 输出编码 -->
|
||||
<a-form-item field="charset"
|
||||
<a-form-item class="mt4"
|
||||
field="charset"
|
||||
label="SSH输出编码"
|
||||
:hide-asterisk="true">
|
||||
<a-input v-model="formModel.charset" placeholder="请输入 SSH 输出编码" />
|
||||
@@ -311,4 +311,14 @@
|
||||
width: 148px;
|
||||
margin-left: 8px;
|
||||
}
|
||||
|
||||
:deep(.arco-collapse-item-content) {
|
||||
background: unset;
|
||||
padding: 0;
|
||||
}
|
||||
|
||||
:deep(.arco-collapse-item-header) {
|
||||
border: none;
|
||||
}
|
||||
|
||||
</style>
|
||||
|
||||
@@ -143,7 +143,7 @@
|
||||
// 上传文件
|
||||
await filesRef.value.startUpload(data.token);
|
||||
} catch (e) {
|
||||
taskStatus.value = UploadTaskStepStatus.FAILED;
|
||||
taskStatus.value = UploadTaskStepStatus.WAITING;
|
||||
} finally {
|
||||
setLoading(false);
|
||||
}
|
||||
|
||||
@@ -47,7 +47,7 @@
|
||||
import type { ExecCommandRequest } from '@/api/exec/exec-command';
|
||||
import { onMounted, ref } from 'vue';
|
||||
import { getExecCommandLogHistory } from '@/api/exec/exec-command-log';
|
||||
import { historyCount } from '../types/const';
|
||||
import { historyCount, descOmit, omit } from '../types/const';
|
||||
import useLoading from '@/hooks/loading';
|
||||
|
||||
const emits = defineEmits(['selected']);
|
||||
@@ -58,12 +58,20 @@
|
||||
|
||||
// 添加
|
||||
const add = (record: ExecCommandRequest) => {
|
||||
const command = record.command as string;
|
||||
if (!record.description) {
|
||||
if (command.length < descOmit + omit.length) {
|
||||
record.description = command;
|
||||
} else {
|
||||
record.description = command.substring(0, descOmit) + omit;
|
||||
}
|
||||
}
|
||||
const index = historyLogs.value.findIndex(s => s.description === record.description);
|
||||
if (index === -1) {
|
||||
// 不存在
|
||||
historyLogs.value.unshift({
|
||||
description: record.description,
|
||||
command: record.command,
|
||||
command: command,
|
||||
parameterSchema: record.parameterSchema,
|
||||
timeout: record.timeout,
|
||||
hostIdList: record.hostIdList
|
||||
@@ -74,7 +82,7 @@
|
||||
historyLogs.value.splice(index, 1);
|
||||
historyLogs.value.unshift({
|
||||
...his,
|
||||
command: record.command,
|
||||
command: command,
|
||||
parameterSchema: record.parameterSchema,
|
||||
timeout: record.timeout,
|
||||
hostIdList: record.hostIdList
|
||||
|
||||
@@ -1,2 +1,8 @@
|
||||
// 历史数量
|
||||
export const historyCount = 15;
|
||||
|
||||
// 描述最大大小
|
||||
export const descOmit = 60;
|
||||
|
||||
// 省略
|
||||
export const omit = '...';
|
||||
|
||||
@@ -353,6 +353,7 @@
|
||||
|
||||
:deep(.sftp-path-unit) {
|
||||
cursor: pointer;
|
||||
white-space: nowrap;
|
||||
font-size: 12px;
|
||||
|
||||
&:hover {
|
||||
|
||||
@@ -148,7 +148,7 @@
|
||||
// 下载文件
|
||||
const downloadFiles = (paths: Array<string>) => {
|
||||
if (!paths.length) {
|
||||
return paths;
|
||||
return;
|
||||
}
|
||||
Message.success('已开始下载, 点击右侧传输列表查看进度');
|
||||
// 映射为文件
|
||||
|
||||
@@ -140,6 +140,30 @@
|
||||
</a-tag>
|
||||
</a-space>
|
||||
</template>
|
||||
<!-- 权限标识 -->
|
||||
<template #permission="{ record }">
|
||||
<span v-if="record.permission"
|
||||
class="text-copy"
|
||||
@click="copy(record.permission, '已复制')">
|
||||
{{ record.permission }}
|
||||
</span>
|
||||
</template>
|
||||
<!-- 组件名称 -->
|
||||
<template #component="{ record }">
|
||||
<span v-if="record.component"
|
||||
class="text-copy"
|
||||
@click="copy(record.component, '已复制')">
|
||||
{{ record.component }}
|
||||
</span>
|
||||
</template>
|
||||
<!-- 链接路径 -->
|
||||
<template #path="{ record }">
|
||||
<span v-if="record.path"
|
||||
class="text-copy"
|
||||
@click="copy(record.path, '已复制')">
|
||||
{{ record.path }}
|
||||
</span>
|
||||
</template>
|
||||
<!-- 操作 -->
|
||||
<template #handle="{ record }">
|
||||
<div class="table-handle-wrapper">
|
||||
@@ -193,28 +217,28 @@
|
||||
import { useCacheStore, useDictStore } from '@/store';
|
||||
import usePermission from '@/hooks/permission';
|
||||
import { findParentNode } from '@/utils/tree';
|
||||
import { copy } from '@/hooks/copy';
|
||||
|
||||
const emits = defineEmits(['openAdd', 'openUpdate']);
|
||||
|
||||
const { toOptions, getDictValue, toggleDictValue } = useDictStore();
|
||||
const cacheStore = useCacheStore();
|
||||
const { hasPermission } = usePermission();
|
||||
const { loading: fetchLoading, setLoading: setFetchLoading } = useLoading();
|
||||
const { toOptions, getDictValue, toggleDictValue } = useDictStore();
|
||||
|
||||
const formRef = ref();
|
||||
const tableRef = ref();
|
||||
const expandStatus = ref<boolean>(false);
|
||||
const tableRenderData = ref<Array<MenuQueryResponse>>([]);
|
||||
const formModel = reactive<MenuQueryRequest>({
|
||||
name: undefined,
|
||||
status: undefined
|
||||
});
|
||||
|
||||
const tableRef = ref();
|
||||
const expandStatus = ref<boolean>(false);
|
||||
|
||||
const tableRenderData = ref<MenuQueryResponse[]>([]);
|
||||
const { loading: fetchLoading, setLoading: setFetchLoading } = useLoading();
|
||||
|
||||
const emits = defineEmits(['openAdd', 'openUpdate']);
|
||||
|
||||
// 删除菜单
|
||||
const doDeleteMenu = async ({ id }: any) => {
|
||||
const doDeleteMenu = async (record: MenuQueryResponse) => {
|
||||
try {
|
||||
const id = record.id;
|
||||
setFetchLoading(true);
|
||||
// 调用删除接口
|
||||
await deleteMenu(id);
|
||||
|
||||
@@ -13,12 +13,14 @@ const columns = [
|
||||
title: '角色名称',
|
||||
dataIndex: 'name',
|
||||
slotName: 'name',
|
||||
minWidth: 118,
|
||||
ellipsis: true,
|
||||
tooltip: true,
|
||||
}, {
|
||||
title: '角色编码',
|
||||
dataIndex: 'code',
|
||||
slotName: 'code',
|
||||
minWidth: 118,
|
||||
}, {
|
||||
title: '角色状态',
|
||||
dataIndex: 'status',
|
||||
|
||||
Reference in New Issue
Block a user