diff --git a/src/views/ops/pages/dc/security/components/FormDialog.vue b/src/views/ops/pages/dc/security/components/FormDialog.vue index 4fd6d99..4209d19 100644 --- a/src/views/ops/pages/dc/security/components/FormDialog.vue +++ b/src/views/ops/pages/dc/security/components/FormDialog.vue @@ -28,8 +28,12 @@ - - + + + + {{ server.name }} ({{ server.server_identity }}) + + @@ -102,6 +106,7 @@ import { Message } from '@arco-design/web-vue' import type { FormInstance } from '@arco-design/web-vue' import { createSecurityService, updateSecurityService, SECURITY_TYPE_OPTIONS, type SecurityServiceFormData } from '@/api/ops/security' import { fetchPolicyOptions, type PolicyOptionItem } from '@/api/ops/alertPolicy' +import { fetchServerList, type ServerItem } from '@/api/ops/server' interface Props { visible: boolean @@ -117,6 +122,7 @@ const emit = defineEmits(['update:visible', 'success']) const formRef = ref() const confirmLoading = ref(false) const policyOptions = ref([]) +const serverOptions = ref([]) const isEdit = computed(() => !!props.record?.id) @@ -158,6 +164,20 @@ const loadPolicyOptions = async () => { } } +const loadServerOptions = async () => { + try { + const response: any = await fetchServerList({ page: 1, size: 1000 }) + if (response && response.details) { + serverOptions.value = response.details.data || [] + } else { + serverOptions.value = [] + } + } catch (error) { + console.error('加载服务器列表失败:', error) + serverOptions.value = [] + } +} + watch( () => props.visible, (val) => { @@ -253,5 +273,6 @@ const handleCancel = () => { onMounted(() => { loadPolicyOptions() + loadServerOptions() }) diff --git a/src/views/ops/pages/dc/security/config/columns.ts b/src/views/ops/pages/dc/security/config/columns.ts index 1f96366..6462429 100644 --- a/src/views/ops/pages/dc/security/config/columns.ts +++ b/src/views/ops/pages/dc/security/config/columns.ts @@ -30,10 +30,9 @@ export const columns = [ }, { dataIndex: 'server_identity', - title: '服务器标识', + title: '服务器', width: 150, - ellipsis: true, - tooltip: true, + slotName: 'serverIdentity', }, { dataIndex: 'enabled', diff --git a/src/views/ops/pages/dc/security/index.vue b/src/views/ops/pages/dc/security/index.vue index 2461420..890b646 100644 --- a/src/views/ops/pages/dc/security/index.vue +++ b/src/views/ops/pages/dc/security/index.vue @@ -25,6 +25,10 @@ + + - - - - 资产导入 - - - @@ -108,27 +99,23 @@ import { IconRefresh, IconDownload, IconRotateLeft, - IconImport, -} from '@arco-design/web-vue/es/icon'; +} from '@arco-design/web-vue/es/icon' interface Props { - onZoomIn: () => void; - onZoomOut: () => void; - onFitView: () => void; - onAddDevice: (value: string | number | Record | undefined) => void; - onLayout: (value: string | number | Record | undefined) => void; - onEdgeStyle: (value: string | number | Record | undefined) => void; - onRefresh: () => void; - onExport: () => void; - onReset?: () => void; - /** 打开「批量导入资产」对话框(无拓扑 ID 时不传) */ - onBatchImportAssets?: () => void; + onZoomIn: () => void + onZoomOut: () => void + onFitView: () => void + onAddDevice: (value: string | number | Record | undefined) => void + onLayout: (value: string | number | Record | undefined) => void + onEdgeStyle: (value: string | number | Record | undefined) => void + onRefresh: () => void + onExport: () => void + onReset?: () => void } const props = withDefaults(defineProps(), { onReset: undefined, - onBatchImportAssets: undefined, -}); +})