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: '' } ]