From 5f5fa34e558ca97a9060a6863e904348f9636a4b Mon Sep 17 00:00:00 2001 From: zhouhaibin Date: Wed, 18 Dec 2024 10:11:33 +0800 Subject: [PATCH] =?UTF-8?q?=E6=96=B0=E5=A2=9E=E6=8F=90=E7=A4=BA=E8=AF=8D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../modelConfiguration/ModelPrompts/index.ts | 57 ++++++ .../modelConfiguration/ModelPrompts/model.ts | 188 +++++++++++++++++ .../ModelPrompts/ModelPrompts.data.ts | 191 ++++++++++++++++++ .../ModelPrompts/ModelPromptsModal.vue | 94 +++++++++ .../modelConfiguration/ModelPrompts/index.vue | 127 ++++++++++++ 5 files changed, 657 insertions(+) create mode 100644 src/api/modelConfiguration/ModelPrompts/index.ts create mode 100644 src/api/modelConfiguration/ModelPrompts/model.ts create mode 100644 src/views/modelConfiguration/ModelPrompts/ModelPrompts.data.ts create mode 100644 src/views/modelConfiguration/ModelPrompts/ModelPromptsModal.vue create mode 100644 src/views/modelConfiguration/ModelPrompts/index.vue diff --git a/src/api/modelConfiguration/ModelPrompts/index.ts b/src/api/modelConfiguration/ModelPrompts/index.ts new file mode 100644 index 0000000..2ae7f23 --- /dev/null +++ b/src/api/modelConfiguration/ModelPrompts/index.ts @@ -0,0 +1,57 @@ +import { defHttp } from '@/utils/http/axios'; +import { ID, IDS, commonExport } from '@/api/base'; +import { ModelPromptsVO, ModelPromptsForm, ModelPromptsQuery } from './model'; + +/** + * 查询用于存储模型提示词列表 + * @param params + * @returns + */ +export function ModelPromptsList(params?: ModelPromptsQuery) { + return defHttp.get({ url: '/productManagement/ModelPrompts/list', params }); +} + +/** + * 导出用于存储模型提示词列表 + * @param params + * @returns + */ +export function ModelPromptsExport(params?: ModelPromptsQuery) { + return commonExport('/productManagement/ModelPrompts/export', params ?? {}); +} + +/** + * 查询用于存储模型提示词详细 + * @param id id + * @returns + */ +export function ModelPromptsInfo(id: ID) { + return defHttp.get({ url: '/productManagement/ModelPrompts/' + id }); +} + +/** + * 新增用于存储模型提示词 + * @param data + * @returns + */ +export function ModelPromptsAdd(data: ModelPromptsForm) { + return defHttp.postWithMsg({ url: '/productManagement/ModelPrompts', data }); +} + +/** + * 更新用于存储模型提示词 + * @param data + * @returns + */ +export function ModelPromptsUpdate(data: ModelPromptsForm) { + return defHttp.putWithMsg({ url: '/productManagement/ModelPrompts', data }); +} + +/** + * 删除用于存储模型提示词 + * @param id id + * @returns + */ +export function ModelPromptsRemove(id: ID | IDS) { + return defHttp.deleteWithMsg({ url: '/productManagement/ModelPrompts/' + id },); +} diff --git a/src/api/modelConfiguration/ModelPrompts/model.ts b/src/api/modelConfiguration/ModelPrompts/model.ts new file mode 100644 index 0000000..fd70755 --- /dev/null +++ b/src/api/modelConfiguration/ModelPrompts/model.ts @@ -0,0 +1,188 @@ +import { BaseEntity, PageQuery } from '@/api/base'; + +export interface ModelPromptsVO { + /** + * id + */ + id: string | number; + + /** + * 任务角色描述 + */ + taskRoleDesc: string; + + /** + * 模型任务名称 + */ + taskName: string; + + /** + * 模型所属区域 + */ + taskRegion: string; + + /** + * 模型所属行业 + */ + taskIndustry: string; + + /** + * 任务背景 + */ + context: string; + + /** + * 任务描述 + */ + description: string; + + /** + * 任务流程 + */ + workflow: string; + + /** + * 输出说明 + */ + outputDesc: string; + + /** + * 注意事项 + */ + cautions: string; + + /** + * 模型版本 + */ + modelVersion: string; + + /** + * 备注 + */ + note: string; + +} + +export interface ModelPromptsForm extends BaseEntity { + /** + * 任务角色描述 + */ + taskRoleDesc?: string; + + /** + * 模型任务名称 + */ + taskName?: string; + + /** + * 模型所属区域 + */ + taskRegion?: string; + + /** + * 模型所属行业 + */ + taskIndustry?: string; + + /** + * 任务背景 + */ + context?: string; + + /** + * 任务描述 + */ + description?: string; + + /** + * 任务流程 + */ + workflow?: string; + + /** + * 输出说明 + */ + outputDesc?: string; + + /** + * 注意事项 + */ + cautions?: string; + + /** + * 模型版本 + */ + modelVersion?: string; + + /** + * 备注 + */ + note?: string; + + +} + +export interface ModelPromptsQuery extends PageQuery { + + /** + * id + */ + id?: string | number; + + /** + * 任务角色描述 + */ + taskRoleDesc?: string; + + /** + * 模型任务名称 + */ + taskName?: string; + + /** + * 模型所属区域 + */ + taskRegion?: string; + + /** + * 模型所属行业 + */ + taskIndustry?: string; + + /** + * 任务背景 + */ + context?: string; + + /** + * 任务描述 + */ + description?: string; + + /** + * 任务流程 + */ + workflow?: string; + + /** + * 输出说明 + */ + outputDesc?: string; + + /** + * 注意事项 + */ + cautions?: string; + + /** + * 模型版本 + */ + modelVersion?: string; + + /** + * 备注 + */ + note?: string; + + +} diff --git a/src/views/modelConfiguration/ModelPrompts/ModelPrompts.data.ts b/src/views/modelConfiguration/ModelPrompts/ModelPrompts.data.ts new file mode 100644 index 0000000..158758b --- /dev/null +++ b/src/views/modelConfiguration/ModelPrompts/ModelPrompts.data.ts @@ -0,0 +1,191 @@ +import { BasicColumn } from '@/components/Table'; +import { FormSchema } from '@/components/Form'; +import { getDictOptions } from '@/utils/dict'; +import { useRender } from '@/hooks/component/useRender'; +export const formSchemas: FormSchema[] = [ + { + label: '模型任务名称', + field: 'taskName', + component: 'Select', + componentProps: { + options: getDictOptions('document_task'), + }, + }, + { + label: '模型所属区域', + field: 'taskRegion', + component: 'Select', + componentProps: { + options: getDictOptions('model_region'), + }, + }, + { + label: '模型所属行业', + field: 'taskIndustry', + component: 'Select', + componentProps: { + options: getDictOptions('model_industry'), + }, + }, +]; + +const { renderDict } = useRender(); +export const columns: BasicColumn[] = [ + { + title: 'id', + dataIndex: 'id', + ifShow: false, + }, + { + title: '模型任务名称', + dataIndex: 'taskName', + customRender: ({ value }) => renderDict(value, 'document_task'), + }, + { + title: '模型所属区域', + dataIndex: 'taskRegion', + customRender: ({ value }) => renderDict(value, 'model_region'), + }, + { + title: '模型所属行业', + dataIndex: 'taskIndustry', + customRender: ({ value }) => renderDict(value, 'model_industry'), + }, + { + title: '任务角色描述', + dataIndex: 'taskRoleDesc', + }, + { + title: '任务背景', + dataIndex: 'context', + }, + { + title: '任务描述', + dataIndex: 'description', + }, + { + title: '任务流程', + dataIndex: 'workflow', + }, + { + title: '输出说明', + dataIndex: 'outputDesc', + }, + { + title: '注意事项', + dataIndex: 'cautions', + }, + { + title: '备注', + dataIndex: 'note', + }, + { + title: '模型版本', + dataIndex: 'modelVersion', + }, +]; + +export const modalSchemas: FormSchema[] = [ + { + field:"id", + component:"Input", + ifShow:false + }, + { + label: '模型任务名称', + field: 'taskName', + required: true, + component: 'Select', + componentProps: { + options: getDictOptions('document_task'), + }, + }, + { + label: '模型所属区域', + field: 'taskRegion', + required: true, + component: 'Select', + componentProps: { + options: getDictOptions('model_region'), + }, + }, + { + label: '模型所属行业', + field: 'taskIndustry', + required: true, + component: 'Select', + componentProps: { + options: getDictOptions('model_industry'), + }, + }, + { + label: '任务角色描述', + field: 'taskRoleDesc', + required: true, + component: 'InputTextArea', + componentProps:{ + rows:10, + } + }, + { + label: '任务背景', + field: 'context', + required: true, + component: 'InputTextArea', + componentProps:{ + rows:10, + } + }, + { + label: '任务描述', + field: 'description', + required: true, + component: 'InputTextArea', + componentProps:{ + rows:10, + } + }, + { + label: '任务流程', + field: 'workflow', + required: false, + component: 'InputTextArea', + componentProps:{ + rows:10, + } + }, + { + label: '输出说明', + field: 'outputDesc', + required: true, + component: 'InputTextArea', + componentProps:{ + rows:10, + } + }, + { + label: '注意事项', + field: 'cautions', + required: false, + component: 'InputTextArea', + componentProps:{ + rows:10, + } + }, + { + label: '备注', + field: 'note', + required: false, + component: 'InputTextArea', + componentProps:{ + rows:10, + } + }, + { + label: '模型版本', + field: 'modelVersion', + required: false, + ifShow:false, + component: 'Input', + }, +]; diff --git a/src/views/modelConfiguration/ModelPrompts/ModelPromptsModal.vue b/src/views/modelConfiguration/ModelPrompts/ModelPromptsModal.vue new file mode 100644 index 0000000..4afc739 --- /dev/null +++ b/src/views/modelConfiguration/ModelPrompts/ModelPromptsModal.vue @@ -0,0 +1,94 @@ + + + + + diff --git a/src/views/modelConfiguration/ModelPrompts/index.vue b/src/views/modelConfiguration/ModelPrompts/index.vue new file mode 100644 index 0000000..dee7a4e --- /dev/null +++ b/src/views/modelConfiguration/ModelPrompts/index.vue @@ -0,0 +1,127 @@ + + + + +