feat:【ele】【ai】modal 部分的代码迁移
This commit is contained in:
@@ -136,7 +136,8 @@ export function useFormSchema(): VbenFormSchema[] {
|
||||
label: '是否公开',
|
||||
component: 'RadioGroup',
|
||||
componentProps: {
|
||||
options: getDictOptions(DICT_TYPE.INFRA_BOOLEAN_STRING, 'boolean'), },
|
||||
options: getDictOptions(DICT_TYPE.INFRA_BOOLEAN_STRING, 'boolean'),
|
||||
},
|
||||
defaultValue: true,
|
||||
dependencies: {
|
||||
triggerFields: ['formType'],
|
||||
@@ -153,7 +154,7 @@ export function useFormSchema(): VbenFormSchema[] {
|
||||
componentProps: {
|
||||
placeholder: '请输入角色排序',
|
||||
controlsPosition: 'right',
|
||||
class: 'w-full',
|
||||
class: '!w-full',
|
||||
},
|
||||
dependencies: {
|
||||
triggerFields: ['formType'],
|
||||
@@ -168,7 +169,8 @@ export function useFormSchema(): VbenFormSchema[] {
|
||||
label: '开启状态',
|
||||
component: 'RadioGroup',
|
||||
componentProps: {
|
||||
options: getDictOptions(DICT_TYPE.COMMON_STATUS, 'number'), },
|
||||
options: getDictOptions(DICT_TYPE.COMMON_STATUS, 'number'),
|
||||
},
|
||||
dependencies: {
|
||||
triggerFields: ['formType'],
|
||||
show: (values) => {
|
||||
|
||||
@@ -37,7 +37,6 @@ function handleEdit(row: AiModelChatRoleApi.ChatRole) {
|
||||
async function handleDelete(row: AiModelChatRoleApi.ChatRole) {
|
||||
const loadingInstance = ElLoading.service({
|
||||
text: $t('ui.actionMessage.deleting', [row.name]),
|
||||
duration: 0,
|
||||
});
|
||||
try {
|
||||
await deleteChatRole(row.id!);
|
||||
|
||||
@@ -5,7 +5,7 @@ import { computed, ref } from 'vue';
|
||||
|
||||
import { useVbenModal } from '@vben/common-ui';
|
||||
|
||||
import { ElMessage as message } from 'element-plus';
|
||||
import { ElMessage } from 'element-plus';
|
||||
|
||||
import { useVbenForm } from '#/adapter/form';
|
||||
import {
|
||||
|
||||
@@ -8,12 +8,9 @@ import { getDictOptions } from '@vben/hooks';
|
||||
import { z } from '#/adapter/form';
|
||||
import { getApiKeySimpleList } from '#/api/ai/model/apiKey';
|
||||
|
||||
/** 关联数据 */
|
||||
let apiKeyList: AiModelApiKeyApi.ApiKey[] = [];
|
||||
async function getApiKeyList() {
|
||||
apiKeyList = await getApiKeySimpleList();
|
||||
}
|
||||
|
||||
getApiKeyList();
|
||||
getApiKeySimpleList().then((data) => (apiKeyList = data));
|
||||
|
||||
/** 新增/修改的表单 */
|
||||
export function useFormSchema(): VbenFormSchema[] {
|
||||
|
||||
@@ -37,7 +37,6 @@ function handleEdit(row: AiModelModelApi.Model) {
|
||||
async function handleDelete(row: AiModelModelApi.Model) {
|
||||
const loadingInstance = ElLoading.service({
|
||||
text: $t('ui.actionMessage.deleting', [row.name]),
|
||||
duration: 0,
|
||||
});
|
||||
try {
|
||||
await deleteModel(row.id!);
|
||||
|
||||
@@ -5,7 +5,7 @@ import { computed, ref } from 'vue';
|
||||
|
||||
import { useVbenModal } from '@vben/common-ui';
|
||||
|
||||
import { ElMessage as message } from 'element-plus';
|
||||
import { ElMessage } from 'element-plus';
|
||||
|
||||
import { useVbenForm } from '#/adapter/form';
|
||||
import { createModel, getModel, updateModel } from '#/api/ai/model/model';
|
||||
|
||||
@@ -39,7 +39,8 @@ export function useFormSchema(): VbenFormSchema[] {
|
||||
label: '状态',
|
||||
component: 'RadioGroup',
|
||||
componentProps: {
|
||||
options: getDictOptions(DICT_TYPE.COMMON_STATUS, 'number'), },
|
||||
options: getDictOptions(DICT_TYPE.COMMON_STATUS, 'number'),
|
||||
},
|
||||
defaultValue: CommonStatusEnum.ENABLE,
|
||||
},
|
||||
];
|
||||
|
||||
@@ -37,7 +37,6 @@ function handleEdit(row: AiModelToolApi.Tool) {
|
||||
async function handleDelete(row: AiModelToolApi.Tool) {
|
||||
const loadingInstance = ElLoading.service({
|
||||
text: $t('ui.actionMessage.deleting', [row.name]),
|
||||
duration: 0,
|
||||
});
|
||||
try {
|
||||
await deleteTool(row.id!);
|
||||
|
||||
@@ -5,7 +5,7 @@ import { computed, ref } from 'vue';
|
||||
|
||||
import { useVbenModal } from '@vben/common-ui';
|
||||
|
||||
import { ElMessage as message } from 'element-plus';
|
||||
import { ElMessage } from 'element-plus';
|
||||
|
||||
import { useVbenForm } from '#/adapter/form';
|
||||
import { createTool, getTool, updateTool } from '#/api/ai/model/tool';
|
||||
|
||||
Reference in New Issue
Block a user