feat(ai-web): 完成执行任务的创建
This commit is contained in:
@@ -1,9 +1,9 @@
|
||||
import {isEmpty, isEqual} from 'licia'
|
||||
import React from 'react'
|
||||
import {useParams} from 'react-router'
|
||||
import styled from 'styled-components'
|
||||
import {amisRender, commonInfo, horizontalFormOptions} from '../../../../util/amis.tsx'
|
||||
import {generateInputForm, typeMap} from '../InputSchema.tsx'
|
||||
import { useParams } from 'react-router'
|
||||
|
||||
const TemplateEditDiv = styled.div`
|
||||
.antd-EditorControl {
|
||||
@@ -54,7 +54,7 @@ const FlowTaskTemplateEdit: React.FC = () => {
|
||||
actionType: 'setValue',
|
||||
args: {
|
||||
value: {
|
||||
inputPreview: generateInputForm(inputSchema),
|
||||
inputPreview: generateInputForm(inputSchema, '入参表单预览'),
|
||||
},
|
||||
},
|
||||
})
|
||||
@@ -75,6 +75,8 @@ const FlowTaskTemplateEdit: React.FC = () => {
|
||||
label: '名称',
|
||||
required: true,
|
||||
clearable: true,
|
||||
maxLength: 10,
|
||||
showCounter: true,
|
||||
},
|
||||
{
|
||||
type: 'textarea',
|
||||
@@ -82,6 +84,8 @@ const FlowTaskTemplateEdit: React.FC = () => {
|
||||
label: '描述',
|
||||
required: true,
|
||||
clearable: true,
|
||||
maxLength: 500,
|
||||
showCounter: true,
|
||||
},
|
||||
{
|
||||
type: 'group',
|
||||
|
||||
@@ -10,8 +10,8 @@ import {isEqual} from 'licia'
|
||||
export const commonInfo = {
|
||||
debug: isEqual(import.meta.env.MODE, 'development'),
|
||||
baseUrl: 'http://132.126.207.130:35690/hudi_services/service_web',
|
||||
// baseAiUrl: 'http://132.126.207.130:35690/hudi_services/service_ai_web',
|
||||
baseAiUrl: 'http://localhost:8080',
|
||||
baseAiUrl: 'http://132.126.207.130:35690/hudi_services/service_ai_web',
|
||||
// baseAiUrl: 'http://localhost:8080',
|
||||
authorizationHeaders: {
|
||||
'Authorization': 'Basic QXhoRWJzY3dzSkRiWU1IMjpjWXhnM2I0UHRXb1ZENVNqRmF5V3h0blNWc2p6UnNnNA==',
|
||||
'Content-Type': 'application/json',
|
||||
@@ -278,7 +278,7 @@ export function horizontalFormOptions() {
|
||||
return {
|
||||
mode: 'horizontal',
|
||||
horizontal: {
|
||||
leftFixed: 'sm'
|
||||
leftFixed: 'sm',
|
||||
},
|
||||
}
|
||||
}
|
||||
@@ -2517,4 +2517,61 @@ export function time(field: string) {
|
||||
|
||||
export function pictureFromIds(field: string) {
|
||||
return `\${ARRAYMAP(${field},id => '${commonInfo.baseAiUrl}/upload/download/' + id)}`
|
||||
}
|
||||
|
||||
const formInputFileStaticColumns = [
|
||||
{
|
||||
name: 'filename',
|
||||
label: '文件名',
|
||||
},
|
||||
{
|
||||
type: 'operation',
|
||||
label: '操作',
|
||||
width: 140,
|
||||
buttons: [
|
||||
{
|
||||
type: 'action',
|
||||
label: '预览',
|
||||
level: 'link',
|
||||
icon: 'fas fa-eye'
|
||||
},
|
||||
{
|
||||
type: 'action',
|
||||
label: '下载',
|
||||
level: 'link',
|
||||
icon: 'fa fa-download',
|
||||
actionType: 'ajax',
|
||||
// api: {
|
||||
// ...apiGet('${base}/upload/download/${id}'),
|
||||
// responseType: 'blob',
|
||||
// }
|
||||
}
|
||||
]
|
||||
}
|
||||
]
|
||||
|
||||
export function formInputSingleFileStatic(field: string, label: string) {
|
||||
return {
|
||||
visibleOn: '${static}',
|
||||
type: 'control',
|
||||
label: label,
|
||||
required: true,
|
||||
body: {
|
||||
type: 'table',
|
||||
source: `\${${field}|asArray}`,
|
||||
columns: formInputFileStaticColumns,
|
||||
},
|
||||
}
|
||||
}
|
||||
|
||||
export function formInputMultiFileStatic(field: string, label: string) {
|
||||
return {
|
||||
visibleOn: '${static}',
|
||||
type: 'input-table',
|
||||
label: label,
|
||||
name: field,
|
||||
required: true,
|
||||
resizable: false,
|
||||
columns: formInputFileStaticColumns,
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user