🔨 表格字段.
This commit is contained in:
@@ -76,16 +76,12 @@
|
|||||||
<!-- 修改 -->
|
<!-- 修改 -->
|
||||||
<a-doption v-permission="['${package.ModuleName}:${typeHyphen}:update']"
|
<a-doption v-permission="['${package.ModuleName}:${typeHyphen}:update']"
|
||||||
@click="emits('openUpdate', record)">
|
@click="emits('openUpdate', record)">
|
||||||
<span class="more-doption normal">
|
<span class="more-doption normal">修改</span>
|
||||||
<icon-edit /> 修改
|
|
||||||
</span>
|
|
||||||
</a-doption>
|
</a-doption>
|
||||||
<!-- 删除 -->
|
<!-- 删除 -->
|
||||||
<a-doption v-permission="['${package.ModuleName}:${typeHyphen}:delete']"
|
<a-doption v-permission="['${package.ModuleName}:${typeHyphen}:delete']"
|
||||||
@click="deleteRow(record.id)">
|
@click="deleteRow(record.id)">
|
||||||
<span class="more-doption error">
|
<span class="more-doption error">删除</span>
|
||||||
<icon-delete /> 删除
|
|
||||||
</span>
|
|
||||||
</a-doption>
|
</a-doption>
|
||||||
</template>
|
</template>
|
||||||
</a-dropdown>
|
</a-dropdown>
|
||||||
@@ -96,17 +92,13 @@
|
|||||||
<!-- 修改 -->
|
<!-- 修改 -->
|
||||||
<a-doption v-permission="['${package.ModuleName}:${typeHyphen}:update']"
|
<a-doption v-permission="['${package.ModuleName}:${typeHyphen}:update']"
|
||||||
@click="emits('openUpdate', record)">
|
@click="emits('openUpdate', record)">
|
||||||
<span class="more-doption normal">
|
<span class="more-doption normal">修改</span>
|
||||||
<icon-edit /> 修改
|
|
||||||
</span>
|
|
||||||
</a-doption>
|
</a-doption>
|
||||||
<!-- 删除 -->
|
<!-- 删除 -->
|
||||||
<a-doption v-permission="['${package.ModuleName}:${typeHyphen}:delete']"
|
<a-doption v-permission="['${package.ModuleName}:${typeHyphen}:delete']"
|
||||||
class="span-red"
|
class="span-red"
|
||||||
@click="deleteRow(record.id)">
|
@click="deleteRow(record.id)">
|
||||||
<span class="more-doption error">
|
<span class="more-doption error">删除</span>
|
||||||
<icon-delete /> 删除
|
|
||||||
</span>
|
|
||||||
</a-doption>
|
</a-doption>
|
||||||
</template>
|
</template>
|
||||||
</card-list>
|
</card-list>
|
||||||
|
|||||||
@@ -87,6 +87,11 @@
|
|||||||
</template>
|
</template>
|
||||||
</a-button>
|
</a-button>
|
||||||
</a-popconfirm>
|
</a-popconfirm>
|
||||||
|
<!-- 调整 -->
|
||||||
|
<table-adjust :columns="columns"
|
||||||
|
:columns-hook="columnsHook"
|
||||||
|
:query-order="queryOrder"
|
||||||
|
@query="fetchTableData" />
|
||||||
</a-space>
|
</a-space>
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
@@ -96,7 +101,7 @@
|
|||||||
ref="tableRef"
|
ref="tableRef"
|
||||||
:loading="loading"
|
:loading="loading"
|
||||||
:row-selection="rowSelection"
|
:row-selection="rowSelection"
|
||||||
:columns="columns"
|
:columns="tableColumns"
|
||||||
:data="tableRenderData"
|
:data="tableRenderData"
|
||||||
:pagination="pagination"
|
:pagination="pagination"
|
||||||
:bordered="false"
|
:bordered="false"
|
||||||
@@ -209,8 +214,8 @@
|
|||||||
import type { TerminalConnectLogQueryRequest, TerminalConnectLogQueryResponse } from '@/api/asset/terminal-connect-log';
|
import type { TerminalConnectLogQueryRequest, TerminalConnectLogQueryResponse } from '@/api/asset/terminal-connect-log';
|
||||||
import { reactive, ref, onMounted } from 'vue';
|
import { reactive, ref, onMounted } from 'vue';
|
||||||
import { deleteTerminalConnectLog, getTerminalConnectLogPage, hostForceOffline } from '@/api/asset/terminal-connect-log';
|
import { deleteTerminalConnectLog, getTerminalConnectLogPage, hostForceOffline } from '@/api/asset/terminal-connect-log';
|
||||||
import { connectStatusKey, connectTypeKey, TerminalConnectStatus } from '../types/const';
|
import { TableName, connectStatusKey, connectTypeKey, TerminalConnectStatus } from '../types/const';
|
||||||
import { useTablePagination, useRowSelection } from '@/hooks/table';
|
import { useTablePagination, useRowSelection, useTableColumns } from '@/hooks/table';
|
||||||
import { useDictStore, useUserStore } from '@/store';
|
import { useDictStore, useUserStore } from '@/store';
|
||||||
import { Message } from '@arco-design/web-vue';
|
import { Message } from '@arco-design/web-vue';
|
||||||
import columns from '../types/table.columns';
|
import columns from '../types/table.columns';
|
||||||
@@ -219,14 +224,18 @@
|
|||||||
import { useRoute } from 'vue-router';
|
import { useRoute } from 'vue-router';
|
||||||
import { dateFormat } from '@/utils';
|
import { dateFormat } from '@/utils';
|
||||||
import { openNewRoute } from '@/router';
|
import { openNewRoute } from '@/router';
|
||||||
|
import { DESC, useQueryOrder } from '@/hooks/query-order';
|
||||||
import UserSelector from '@/components/user/user/selector/index.vue';
|
import UserSelector from '@/components/user/user/selector/index.vue';
|
||||||
import HostSelector from '@/components/asset/host/selector/index.vue';
|
import HostSelector from '@/components/asset/host/selector/index.vue';
|
||||||
|
import TableAdjust from '@/components/app/table-adjust/index.vue';
|
||||||
|
|
||||||
const emits = defineEmits(['openClear', 'openDetail']);
|
const emits = defineEmits(['openClear', 'openDetail']);
|
||||||
|
|
||||||
const route = useRoute();
|
const route = useRoute();
|
||||||
const pagination = useTablePagination();
|
|
||||||
const rowSelection = useRowSelection();
|
const rowSelection = useRowSelection();
|
||||||
|
const pagination = useTablePagination();
|
||||||
|
const queryOrder = useQueryOrder(TableName, DESC);
|
||||||
|
const { tableColumns, columnsHook } = useTableColumns(TableName, columns);
|
||||||
const { loading, setLoading } = useLoading();
|
const { loading, setLoading } = useLoading();
|
||||||
const { toOptions, getDictValue } = useDictStore();
|
const { toOptions, getDictValue } = useDictStore();
|
||||||
|
|
||||||
@@ -247,7 +256,7 @@
|
|||||||
const doFetchTableData = async (request: TerminalConnectLogQueryRequest) => {
|
const doFetchTableData = async (request: TerminalConnectLogQueryRequest) => {
|
||||||
try {
|
try {
|
||||||
setLoading(true);
|
setLoading(true);
|
||||||
const { data } = await getTerminalConnectLogPage(request);
|
const { data } = await getTerminalConnectLogPage(queryOrder.markOrderly(request));
|
||||||
tableRenderData.value = data.rows;
|
tableRenderData.value = data.rows;
|
||||||
pagination.total = data.total;
|
pagination.total = data.total;
|
||||||
pagination.current = request.page;
|
pagination.current = request.page;
|
||||||
|
|||||||
@@ -1,3 +1,6 @@
|
|||||||
|
// 表名称
|
||||||
|
export const TableName = 'conn-log';
|
||||||
|
|
||||||
// 终端连接类型
|
// 终端连接类型
|
||||||
export const TerminalConnectType = {
|
export const TerminalConnectType = {
|
||||||
SSH: 'SSH',
|
SSH: 'SSH',
|
||||||
|
|||||||
@@ -8,6 +8,7 @@ const columns = [
|
|||||||
width: 100,
|
width: 100,
|
||||||
align: 'left',
|
align: 'left',
|
||||||
fixed: 'left',
|
fixed: 'left',
|
||||||
|
default: true,
|
||||||
}, {
|
}, {
|
||||||
title: '连接用户',
|
title: '连接用户',
|
||||||
dataIndex: 'username',
|
dataIndex: 'username',
|
||||||
@@ -15,24 +16,28 @@ const columns = [
|
|||||||
width: 140,
|
width: 140,
|
||||||
align: 'left',
|
align: 'left',
|
||||||
ellipsis: true,
|
ellipsis: true,
|
||||||
|
default: true,
|
||||||
}, {
|
}, {
|
||||||
title: '连接主机',
|
title: '连接主机',
|
||||||
dataIndex: 'hostName',
|
dataIndex: 'hostName',
|
||||||
slotName: 'hostName',
|
slotName: 'hostName',
|
||||||
align: 'left',
|
align: 'left',
|
||||||
ellipsis: true,
|
ellipsis: true,
|
||||||
|
default: true,
|
||||||
}, {
|
}, {
|
||||||
title: '类型',
|
title: '类型',
|
||||||
dataIndex: 'type',
|
dataIndex: 'type',
|
||||||
slotName: 'type',
|
slotName: 'type',
|
||||||
width: 74,
|
width: 116,
|
||||||
align: 'left',
|
align: 'left',
|
||||||
|
default: true,
|
||||||
}, {
|
}, {
|
||||||
title: '状态',
|
title: '状态',
|
||||||
dataIndex: 'status',
|
dataIndex: 'status',
|
||||||
slotName: 'status',
|
slotName: 'status',
|
||||||
align: 'left',
|
align: 'left',
|
||||||
width: 118,
|
width: 118,
|
||||||
|
default: true,
|
||||||
}, {
|
}, {
|
||||||
title: '留痕地址',
|
title: '留痕地址',
|
||||||
dataIndex: 'address',
|
dataIndex: 'address',
|
||||||
@@ -40,18 +45,21 @@ const columns = [
|
|||||||
width: 156,
|
width: 156,
|
||||||
align: 'left',
|
align: 'left',
|
||||||
ellipsis: true,
|
ellipsis: true,
|
||||||
|
default: true,
|
||||||
}, {
|
}, {
|
||||||
title: '连接时间',
|
title: '连接时间',
|
||||||
dataIndex: 'connectTime',
|
dataIndex: 'connectTime',
|
||||||
slotName: 'connectTime',
|
slotName: 'connectTime',
|
||||||
align: 'left',
|
align: 'left',
|
||||||
width: 192,
|
width: 192,
|
||||||
|
default: true,
|
||||||
}, {
|
}, {
|
||||||
title: '操作',
|
title: '操作',
|
||||||
slotName: 'handle',
|
slotName: 'handle',
|
||||||
width: 218,
|
width: 218,
|
||||||
align: 'left',
|
align: 'left',
|
||||||
fixed: 'right',
|
fixed: 'right',
|
||||||
|
default: true,
|
||||||
},
|
},
|
||||||
] as TableColumnData[];
|
] as TableColumnData[];
|
||||||
|
|
||||||
|
|||||||
@@ -71,6 +71,11 @@
|
|||||||
</template>
|
</template>
|
||||||
</a-button>
|
</a-button>
|
||||||
</a-popconfirm>
|
</a-popconfirm>
|
||||||
|
<!-- 调整 -->
|
||||||
|
<table-adjust :columns="columns"
|
||||||
|
:columns-hook="columnsHook"
|
||||||
|
:query-order="queryOrder"
|
||||||
|
@query="fetchTableData" />
|
||||||
</a-space>
|
</a-space>
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
@@ -80,7 +85,7 @@
|
|||||||
ref="tableRef"
|
ref="tableRef"
|
||||||
:loading="loading"
|
:loading="loading"
|
||||||
:row-selection="rowSelection"
|
:row-selection="rowSelection"
|
||||||
:columns="columns"
|
:columns="tableColumns"
|
||||||
:data="tableRenderData"
|
:data="tableRenderData"
|
||||||
:pagination="pagination"
|
:pagination="pagination"
|
||||||
:bordered="false"
|
:bordered="false"
|
||||||
@@ -187,19 +192,23 @@
|
|||||||
import type { TerminalSftpLogQueryRequest, TerminalSftpLogQueryResponse } from '@/api/asset/terminal-sftp';
|
import type { TerminalSftpLogQueryRequest, TerminalSftpLogQueryResponse } from '@/api/asset/terminal-sftp';
|
||||||
import { reactive, ref, onMounted } from 'vue';
|
import { reactive, ref, onMounted } from 'vue';
|
||||||
import { getTerminalSftpLogPage, deleteTerminalSftpLog } from '@/api/asset/terminal-sftp';
|
import { getTerminalSftpLogPage, deleteTerminalSftpLog } from '@/api/asset/terminal-sftp';
|
||||||
import { sftpOperatorTypeKey, sftpOperatorResultKey, SftpOperatorType, showPathMaxCount } from '../types/const';
|
import { sftpOperatorTypeKey, sftpOperatorResultKey, SftpOperatorType, showPathMaxCount, TableName } from '../types/const';
|
||||||
import { useTablePagination, useRowSelection } from '@/hooks/table';
|
import { useTablePagination, useRowSelection, useTableColumns } from '@/hooks/table';
|
||||||
import { useDictStore } from '@/store';
|
import { useDictStore } from '@/store';
|
||||||
import { Message } from '@arco-design/web-vue';
|
import { Message } from '@arco-design/web-vue';
|
||||||
import columns from '../types/table.columns';
|
import columns from '../types/table.columns';
|
||||||
import useLoading from '@/hooks/loading';
|
import useLoading from '@/hooks/loading';
|
||||||
import { copy } from '@/hooks/copy';
|
import { copy } from '@/hooks/copy';
|
||||||
import { permission10toString } from '@/utils/file';
|
import { permission10toString } from '@/utils/file';
|
||||||
|
import { DESC, useQueryOrder } from '@/hooks/query-order';
|
||||||
import UserSelector from '@/components/user/user/selector/index.vue';
|
import UserSelector from '@/components/user/user/selector/index.vue';
|
||||||
import HostSelector from '@/components/asset/host/selector/index.vue';
|
import HostSelector from '@/components/asset/host/selector/index.vue';
|
||||||
|
import TableAdjust from '@/components/app/table-adjust/index.vue';
|
||||||
|
|
||||||
const pagination = useTablePagination();
|
|
||||||
const rowSelection = useRowSelection();
|
const rowSelection = useRowSelection();
|
||||||
|
const pagination = useTablePagination();
|
||||||
|
const queryOrder = useQueryOrder(TableName, DESC);
|
||||||
|
const { tableColumns, columnsHook } = useTableColumns(TableName, columns);
|
||||||
const { loading, setLoading } = useLoading();
|
const { loading, setLoading } = useLoading();
|
||||||
const { toOptions, getDictValue } = useDictStore();
|
const { toOptions, getDictValue } = useDictStore();
|
||||||
|
|
||||||
@@ -218,7 +227,7 @@
|
|||||||
try {
|
try {
|
||||||
setLoading(true);
|
setLoading(true);
|
||||||
// 查询
|
// 查询
|
||||||
const { data } = await getTerminalSftpLogPage(request);
|
const { data } = await getTerminalSftpLogPage(queryOrder.markOrderly(request));
|
||||||
// 设置最大数量
|
// 设置最大数量
|
||||||
data.rows.forEach(s => {
|
data.rows.forEach(s => {
|
||||||
s.extra.maxCount = showPathMaxCount;
|
s.extra.maxCount = showPathMaxCount;
|
||||||
|
|||||||
@@ -1,3 +1,6 @@
|
|||||||
|
// 表名称
|
||||||
|
export const TableName = 'sftp-log';
|
||||||
|
|
||||||
// sftp 操作类型
|
// sftp 操作类型
|
||||||
export const SftpOperatorType = {
|
export const SftpOperatorType = {
|
||||||
SFTP_MOVE: 'terminal:sftp-move',
|
SFTP_MOVE: 'terminal:sftp-move',
|
||||||
|
|||||||
@@ -9,6 +9,7 @@ const columns = [
|
|||||||
width: 100,
|
width: 100,
|
||||||
align: 'left',
|
align: 'left',
|
||||||
fixed: 'left',
|
fixed: 'left',
|
||||||
|
default: true,
|
||||||
}, {
|
}, {
|
||||||
title: '操作用户',
|
title: '操作用户',
|
||||||
dataIndex: 'username',
|
dataIndex: 'username',
|
||||||
@@ -16,6 +17,7 @@ const columns = [
|
|||||||
width: 140,
|
width: 140,
|
||||||
align: 'left',
|
align: 'left',
|
||||||
ellipsis: true,
|
ellipsis: true,
|
||||||
|
default: true,
|
||||||
}, {
|
}, {
|
||||||
title: '操作主机',
|
title: '操作主机',
|
||||||
dataIndex: 'hostName',
|
dataIndex: 'hostName',
|
||||||
@@ -23,30 +25,35 @@ const columns = [
|
|||||||
width: 180,
|
width: 180,
|
||||||
align: 'left',
|
align: 'left',
|
||||||
ellipsis: true,
|
ellipsis: true,
|
||||||
|
default: true,
|
||||||
}, {
|
}, {
|
||||||
title: '操作类型',
|
title: '操作类型',
|
||||||
dataIndex: 'type',
|
dataIndex: 'type',
|
||||||
slotName: 'type',
|
slotName: 'type',
|
||||||
width: 116,
|
width: 116,
|
||||||
align: 'left',
|
align: 'left',
|
||||||
|
default: true,
|
||||||
}, {
|
}, {
|
||||||
title: '文件数量',
|
title: '文件数量',
|
||||||
dataIndex: 'fileCount',
|
dataIndex: 'fileCount',
|
||||||
slotName: 'fileCount',
|
slotName: 'fileCount',
|
||||||
align: 'left',
|
align: 'left',
|
||||||
width: 100,
|
width: 100,
|
||||||
|
default: true,
|
||||||
}, {
|
}, {
|
||||||
title: '操作文件',
|
title: '操作文件',
|
||||||
dataIndex: 'paths',
|
dataIndex: 'paths',
|
||||||
slotName: 'paths',
|
slotName: 'paths',
|
||||||
align: 'left',
|
align: 'left',
|
||||||
minWidth: 238,
|
minWidth: 238,
|
||||||
|
default: true,
|
||||||
}, {
|
}, {
|
||||||
title: '执行结果',
|
title: '执行结果',
|
||||||
dataIndex: 'result',
|
dataIndex: 'result',
|
||||||
slotName: 'result',
|
slotName: 'result',
|
||||||
align: 'left',
|
align: 'left',
|
||||||
width: 88,
|
width: 88,
|
||||||
|
default: true,
|
||||||
}, {
|
}, {
|
||||||
title: '留痕地址',
|
title: '留痕地址',
|
||||||
dataIndex: 'address',
|
dataIndex: 'address',
|
||||||
@@ -54,6 +61,7 @@ const columns = [
|
|||||||
width: 156,
|
width: 156,
|
||||||
align: 'left',
|
align: 'left',
|
||||||
ellipsis: true,
|
ellipsis: true,
|
||||||
|
default: true,
|
||||||
}, {
|
}, {
|
||||||
title: '操作时间',
|
title: '操作时间',
|
||||||
dataIndex: 'startTime',
|
dataIndex: 'startTime',
|
||||||
@@ -63,12 +71,14 @@ const columns = [
|
|||||||
render: ({ record }) => {
|
render: ({ record }) => {
|
||||||
return (record.startTime && dateFormat(new Date(record.startTime)));
|
return (record.startTime && dateFormat(new Date(record.startTime)));
|
||||||
},
|
},
|
||||||
|
default: true,
|
||||||
}, {
|
}, {
|
||||||
title: '操作',
|
title: '操作',
|
||||||
slotName: 'handle',
|
slotName: 'handle',
|
||||||
width: 80,
|
width: 80,
|
||||||
align: 'center',
|
align: 'center',
|
||||||
fixed: 'right',
|
fixed: 'right',
|
||||||
|
default: true,
|
||||||
},
|
},
|
||||||
] as TableColumnData[];
|
] as TableColumnData[];
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user