Update schema.ts
This commit is contained in:
parent
8a90e46aae
commit
37d3afc63a
|
|
@ -3,61 +3,57 @@ import type { VbenFormProps } from "@vben/common-ui";
|
|||
export const ModelCertificateFrom: VbenFormProps = {
|
||||
schema: [
|
||||
{
|
||||
fieldName: 'CertificateType',
|
||||
fieldName: 'certificateType',
|
||||
label: '凭证类型',
|
||||
component: "Select",
|
||||
rules: "required",
|
||||
defaultValue: 'apiKey',
|
||||
componentProps: {
|
||||
options: [
|
||||
{ label: 'API密钥', value: 'apiKey' },
|
||||
{ label: '其他', value: 'other' },
|
||||
]
|
||||
],
|
||||
},
|
||||
},
|
||||
{
|
||||
fieldName: "modelName",
|
||||
label: "模型名称",
|
||||
fieldName: "modelProvider",
|
||||
label: "模型提供商",
|
||||
component: "Select",
|
||||
rules: "required",
|
||||
componentProps: {
|
||||
options: [
|
||||
{ label: '提供商A', value: 'providerA' },
|
||||
{ label: '提供商B', value: 'providerB' },
|
||||
],
|
||||
},
|
||||
dependencies: {
|
||||
triggerFields: ["certificateType"],
|
||||
show: (values) => values.certificateType === 'apiKey',
|
||||
}
|
||||
},
|
||||
{
|
||||
fieldName: "apiKey",
|
||||
label: "API密钥",
|
||||
component: "Input",
|
||||
rules: "required",
|
||||
dependencies: {
|
||||
triggerFields: ["CertificateType"],
|
||||
show: (values) => values.CertificateType === 'other',
|
||||
triggerFields: ["certificateType"],
|
||||
show: (values) => values.certificateType === 'apiKey',
|
||||
},
|
||||
},
|
||||
{
|
||||
fieldName: "modelType",
|
||||
label: "模型类型",
|
||||
component: "Select",
|
||||
rules: "selectRequired",
|
||||
componentProps: {
|
||||
options: [
|
||||
{ label: 'LLM', value: 'llm' },
|
||||
{ label: 'Text Embedding', value: 'textEmbedding' },
|
||||
{ label: 'Rerank', value: 'rerank' },
|
||||
]
|
||||
},
|
||||
dependencies: {
|
||||
triggerFields: ["CertificateType"],
|
||||
show: (values) => values.CertificateType === 'other',
|
||||
},
|
||||
},
|
||||
{
|
||||
fieldName: "certificateName",
|
||||
label: "凭证名称",
|
||||
component: "Input",
|
||||
},
|
||||
{
|
||||
fieldName: "baseUrl",
|
||||
label: "基础URL",
|
||||
label: "API基础URL",
|
||||
component: "Input",
|
||||
dependencies: {
|
||||
rules: ({ values }) => {
|
||||
if (values.CertificateType === 'other') {
|
||||
return "required";
|
||||
triggerFields: ["certificateType"],
|
||||
rules: (values) => {
|
||||
if (values.certificateType === 'other') {
|
||||
return "required"
|
||||
}
|
||||
return null;
|
||||
},
|
||||
triggerFields: ["CertificateType"],
|
||||
}
|
||||
},
|
||||
}
|
||||
]
|
||||
};
|
||||
|
|
|
|||
Loading…
Reference in New Issue