Эх сурвалжийг харах

fix: 修正编排画布任务模板列表接口调用(task-templates/list → task-templates)

Sisyphus 1 өдөр өмнө
parent
commit
e3a59e13e1

+ 2 - 2
cfc-frontend/pages/orchestration/editor.vue

@@ -218,8 +218,8 @@ export default {
     },
     async loadTemplates() {
       try {
-        var res = await getNodeTemplateList({ page: 1, pageSize: 100 })
-        this.templates = res.data.list || []
+        var res = await getNodeTemplateList({ page: 1, size: 100 })
+        this.templates = res.data.records || res.data || []
       } catch (e) {
         console.error('加载模板失败', e)
         this.templates = []

+ 1 - 1
cfc-frontend/utils/api.js

@@ -3130,5 +3130,5 @@ export function terminateOrchestrationExecution(data) {
   return request('/api/orchestration/execution/terminate', 'POST', data)
 }
 export function getNodeTemplateList(params = {}) {
-  return request('/api/admin/task-templates/list', 'POST', params)
+  return request('/api/admin/task-templates', 'POST', params)
 }

+ 3 - 3
cfc-web/src/views/orchestration/FlowEditor.vue

@@ -99,6 +99,7 @@
 <script>
 import jsPlumb from 'jsplumb'
 import { saveFlow, publishFlow, getFlowDetail } from '@/api/orchestration'
+import { getTaskTemplateList } from '@/api/admin'
 
 let _nodeSeq = 0
 
@@ -136,9 +137,8 @@ export default {
   methods: {
     async loadTemplates() {
       try {
-        const request = require('@/utils/request').default
-        const res = await request({ url: '/api/admin/task-templates/list', method: 'post', data: { page: 1, pageSize: 100 } })
-        this.templates = res.data.list || []
+        const res = await getTaskTemplateList({ page: 1, size: 100 })
+        this.templates = res.data.records || res.data || []
       } catch (e) {
         console.error('加载任务模板失败', e)
         this.templates = []