From 798c3694f315cf052555a85ed9fc0671667d843a Mon Sep 17 00:00:00 2001 From: TangShanDD Date: Wed, 5 Nov 2025 14:52:21 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=EF=BC=8C=E6=94=AF=E6=8C=81=E9=80=9A?= =?UTF-8?q?=E8=BF=87=E7=BB=84=E7=BB=87=E3=80=81=E9=83=A8=E9=97=A8=E3=80=81?= =?UTF-8?q?=E5=BA=94=E7=94=A8=E6=A0=87=E7=AD=BE=E6=9F=A5=E8=AF=A2=E5=B9=B6?= =?UTF-8?q?=E9=80=89=E6=8B=A9=E8=99=9A=E6=8B=9F=E6=9C=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/services/platform/index.js | 14 +++++++++++ .../graph/targetServer/selectServerConfig.ts | 24 ++++++++++++++++++- 2 files changed, 37 insertions(+), 1 deletion(-) diff --git a/src/services/platform/index.js b/src/services/platform/index.js index a4dabdb..a99da62 100644 --- a/src/services/platform/index.js +++ b/src/services/platform/index.js @@ -157,3 +157,17 @@ export function getLbListen(params) { export function getRegionCondition(params) { return request.get('/ims/v1/regions/condition', { params: { condition: JSON.stringify(params) } }) } +// 标签 +const labelUrl = '/ims/v1/tags' +export function getLabel(params) { + return request.get(labelUrl, { + params + }) +} +// 部门 +const departUrl = '/sms/v1/departments' +export function getDepart(params) { + return request.get(departUrl, { + params + }) +} diff --git a/src/views/task/graph/targetServer/selectServerConfig.ts b/src/views/task/graph/targetServer/selectServerConfig.ts index 7269582..9eee752 100644 --- a/src/views/task/graph/targetServer/selectServerConfig.ts +++ b/src/views/task/graph/targetServer/selectServerConfig.ts @@ -1,4 +1,5 @@ -import { getCloudVendor } from 'services/platform/index' +import { getCloudVendor, getLabel, getDepart } from 'services/platform/index' +import { getProject } from 'services/system/project' export const columns = [ { @@ -38,6 +39,27 @@ export const searchConfigs = [ }, { label: 'IP地址', value: 'ip', type: 'Input' }, { label: '主机名', value: 'name', type: 'Input' }, + { + label: '标签', + value: 'label', + type: 'Cascade', + props: { value: 'content', label: 'name', children: 'children', checkStrictly: false }, + data: [], + service: { + api: getLabel, + params: { simple: true }, + attr: 'data.rows' + } + }, + { label: '项目', value: 'projectId', type: 'Select', data: [], service: { api: getProject, params: { simple: true }, attr: 'data.rows' } }, + { + label: '部门', + value: 'departId', + type: 'Cascade', + props: { value: 'id', label: 'name', children: 'children', checkStrictly: false }, + data: [], + service: { api: getDepart, params: { parentId: 0 }, attr: 'data' } + }, { value: 'catalog', type: 'Const', initValue: 'Computer' }, { value: 'osCategory', type: 'Const', initValue: '' } ]