From 6350f2d6ef0321575f3c9c2f89ef66cfd4425099 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=97=B6=E5=90=AF=E9=BE=99?= Date: Wed, 28 Aug 2024 16:02:19 +0800 Subject: [PATCH] =?UTF-8?q?feat:=20=E8=B5=84=E4=BA=A7=E7=AE=A1=E7=90=86=20?= =?UTF-8?q?3.0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/services/data-collection/history.ts | 23 ++++----- .../src/services/data-collection/task.ts | 5 +- webs/ams-web/src/services/data-link/rule.ts | 5 +- .../views/data-collection/history/index.vue | 15 ++---- .../views/data-collection/plugins/List.vue | 13 +++-- .../views/data-collection/plugins/index.vue | 11 +++-- .../data-collection/task/content/index.vue | 6 ++- .../task/content/normal/index.vue | 41 +++++++++------- .../task/content/settime/index.vue | 49 ++++++++++--------- .../src/views/data-collection/task/index.vue | 17 +++++-- .../src/views/data-link/history/index.vue | 12 ++++- .../src/views/data-link/rule/index.vue | 20 +++++--- webs/ams-web/src/views/log/index.vue | 23 +++++---- 13 files changed, 141 insertions(+), 99 deletions(-) diff --git a/webs/ams-web/src/services/data-collection/history.ts b/webs/ams-web/src/services/data-collection/history.ts index 3791a8f..a2304f3 100644 --- a/webs/ams-web/src/services/data-collection/history.ts +++ b/webs/ams-web/src/services/data-collection/history.ts @@ -1,26 +1,27 @@ import { request } from '@cmp/cmp-element' +import EnhancedRequestGet from '@/services/EnhancedRequestGet' const baseUrl = '/ams/v1/collection/tasks/instances' export function getCollectionTasksInstances(params: Base.IListParams) { - return request.get(baseUrl, { params }) + return EnhancedRequestGet(baseUrl, { params }) } export function getCollectionTasksInstancesDetail(id: boolean) { - return request.get(`${baseUrl}/${id}`) + return EnhancedRequestGet(`${baseUrl}/${id}`) } export function getNodeLogs(id: number, params: { end: boolean; priority?: number }) { - return request.get(`/cop/v1/tasks/instances/nodes/${id}/logs`, { + return EnhancedRequestGet(`/cop/v1/tasks/instances/nodes/${id}/logs`, { params, }) } export function getHosts(params: any) { - return request.get('/cop/v1/hosts', { params }) + return EnhancedRequestGet('/cop/v1/hosts', { params }) } // simple修改 export function getIdentsBySimple(params: any): any { - return request.get('/cop/v1/identifications/simple', { + return EnhancedRequestGet('/cop/v1/identifications/simple', { params, }) } @@ -28,17 +29,17 @@ export function getIdentsBySimple(params: any): any { const scriptsUrl = '/cop/v1/scripts' // simple修改 export function getScriptBySimple(params: any) { - return request.get(`${scriptsUrl}/simple`, { + return EnhancedRequestGet(`${scriptsUrl}/simple`, { params, }) } export function getScriptDetail(id) { - return request.get(`${scriptsUrl}/${id}`) + return EnhancedRequestGet(`${scriptsUrl}/${id}`) } const groupUrl = '/cop/v1/scripts/groups' export function getGroup(params: any) { - return request.get(groupUrl, { + return EnhancedRequestGet(groupUrl, { params, }) } @@ -46,20 +47,20 @@ export function getGroup(params: any) { // 采集历史 const historyUrl = '/ams/v1/collection/history' export function getCollectionhistory(params: any): any { - return request.get(historyUrl, { + return EnhancedRequestGet(historyUrl, { params, }) } // 未采集 export function getCollectionInstances(params: any): any { - return request.get(`${historyUrl}/instances`, { + return EnhancedRequestGet(`${historyUrl}/instances`, { params, }) } // 数据详情列表 export function getCollectionItem(params: any): any { - return request.get(`${historyUrl}/item`, { + return EnhancedRequestGet(`${historyUrl}/item`, { params, }) } diff --git a/webs/ams-web/src/services/data-collection/task.ts b/webs/ams-web/src/services/data-collection/task.ts index 2cf3535..3ff54e4 100644 --- a/webs/ams-web/src/services/data-collection/task.ts +++ b/webs/ams-web/src/services/data-collection/task.ts @@ -1,12 +1,13 @@ import { request } from '@cmp/cmp-element' +import EnhancedRequestGet from '@/services/EnhancedRequestGet' const baseUrl = '/ams/v1/collection/tasks' export function getCollectionTasks(params: Base.IListParams) { - return request.get(baseUrl, { params }) + return EnhancedRequestGet(baseUrl, { params }) } export function getCollectionTaskDetail(id: number) { - return request.get(`${baseUrl}/${id}`) + return EnhancedRequestGet(`${baseUrl}/${id}`) } export function createCollectionTask(params: any) { diff --git a/webs/ams-web/src/services/data-link/rule.ts b/webs/ams-web/src/services/data-link/rule.ts index 14fdabd..6641d0e 100644 --- a/webs/ams-web/src/services/data-link/rule.ts +++ b/webs/ams-web/src/services/data-link/rule.ts @@ -1,11 +1,12 @@ import { request } from '@cmp/cmp-element' +import EnhancedRequestGet from '@/services/EnhancedRequestGet' const baseUrl = '/ams/v1/rule' export function getRule(params: Base.IListParams) { - return request.get(baseUrl, { params }) + return EnhancedRequestGet(baseUrl, { params }) } export function getRuleDetail(id: number) { - return request.get(`${baseUrl}/${id}`) + return EnhancedRequestGet(`${baseUrl}/${id}`) } export function createRule(params: any) { return request.post(baseUrl, params) diff --git a/webs/ams-web/src/views/data-collection/history/index.vue b/webs/ams-web/src/views/data-collection/history/index.vue index e4e8d18..9395af5 100644 --- a/webs/ams-web/src/views/data-collection/history/index.vue +++ b/webs/ams-web/src/views/data-collection/history/index.vue @@ -1,13 +1,6 @@ -