mirror of
https://github.com/1Panel-dev/MaxKB.git
synced 2025-12-26 10:12:51 +00:00
This commit is contained in:
parent
4de998dee2
commit
cb4b1c927c
|
|
@ -0,0 +1,90 @@
|
|||
import { Result } from '@/request/Result'
|
||||
import { get, post, del, put } from '@/request/index'
|
||||
|
||||
import { type Ref } from 'vue'
|
||||
|
||||
const prefix = '/application'
|
||||
|
||||
/**
|
||||
* API_KEY列表
|
||||
* @param 参数 application_id
|
||||
*/
|
||||
const getAPIKey: (application_id: string, loading?: Ref<boolean>) => Promise<Result<any>> = (
|
||||
application_id,
|
||||
loading
|
||||
) => {
|
||||
return get(`${prefix}/${application_id}/api_key`, undefined, loading)
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增API_KEY
|
||||
* @param 参数 application_id
|
||||
*/
|
||||
const postAPIKey: (application_id: string, loading?: Ref<boolean>) => Promise<Result<any>> = (
|
||||
application_id,
|
||||
loading
|
||||
) => {
|
||||
return post(`${prefix}/${application_id}/api_key`, {}, undefined, loading)
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除API_KEY
|
||||
* @param 参数 application_id api_key_id
|
||||
*/
|
||||
const delAPIKey: (
|
||||
application_id: String,
|
||||
api_key_id: String,
|
||||
loading?: Ref<boolean>
|
||||
) => Promise<Result<boolean>> = (application_id, api_key_id, loading) => {
|
||||
return del(`${prefix}/${application_id}/api_key/${api_key_id}`, undefined, undefined, loading)
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改API_KEY
|
||||
* @param 参数 application_id,api_key_id
|
||||
* data {
|
||||
* is_active: boolean
|
||||
* }
|
||||
*/
|
||||
const putAPIKey: (
|
||||
application_id: string,
|
||||
api_key_id: String,
|
||||
data: any,
|
||||
loading?: Ref<boolean>
|
||||
) => Promise<Result<any>> = (application_id, api_key_id, data, loading) => {
|
||||
return put(`${prefix}/${application_id}/api_key/${api_key_id}`, data, undefined, loading)
|
||||
}
|
||||
|
||||
/**
|
||||
* 统计
|
||||
* @param 参数 application_id, data
|
||||
*/
|
||||
const getStatistics: (
|
||||
application_id: string,
|
||||
data: any,
|
||||
loading?: Ref<boolean>
|
||||
) => Promise<Result<any>> = (application_id, data, loading) => {
|
||||
return get(`${prefix}/${application_id}/statistics/chat_record_aggregate_trend`, data, loading)
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改应用icon
|
||||
* @param 参数 application_id
|
||||
* data: file
|
||||
*/
|
||||
const putAppIcon: (
|
||||
application_id: string,
|
||||
data: any,
|
||||
loading?: Ref<boolean>
|
||||
) => Promise<Result<any>> = (application_id, data, loading) => {
|
||||
return put(`${prefix}/${application_id}/edit_icon`, data, undefined, loading)
|
||||
}
|
||||
|
||||
export default {
|
||||
getAPIKey,
|
||||
postAPIKey,
|
||||
delAPIKey,
|
||||
putAPIKey,
|
||||
getStatistics,
|
||||
putAppIcon
|
||||
}
|
||||
|
|
@ -0,0 +1,41 @@
|
|||
import { Result } from '@/request/Result'
|
||||
import { get, put } from '@/request/index'
|
||||
import { type Ref } from 'vue'
|
||||
|
||||
const prefix = '/application'
|
||||
|
||||
/**
|
||||
* 替换社区版-获取AccessToken
|
||||
* @param 参数 application_id
|
||||
*/
|
||||
const getAccessToken: (application_id: string, loading?: Ref<boolean>) => Promise<Result<any>> = (
|
||||
application_id,
|
||||
loading
|
||||
) => {
|
||||
return get(`${prefix}/${application_id}/setting`, undefined, loading)
|
||||
}
|
||||
|
||||
/**
|
||||
* 替换社区版-修改AccessToken
|
||||
* @param 参数 application_id
|
||||
* data {
|
||||
* "show_source": boolean,
|
||||
* "show_history": boolean,
|
||||
* "draggable": boolean,
|
||||
* "show_guide": boolean,
|
||||
* "avatar": file,
|
||||
* "float_icon": file,
|
||||
* }
|
||||
*/
|
||||
const putAccessToken: (
|
||||
application_id: string,
|
||||
data: any,
|
||||
loading?: Ref<boolean>
|
||||
) => Promise<Result<any>> = (application_id, data, loading) => {
|
||||
return put(`${prefix}/${application_id}/setting`, data, undefined, loading)
|
||||
}
|
||||
|
||||
export default {
|
||||
getAccessToken,
|
||||
putAccessToken
|
||||
}
|
||||
|
|
@ -0,0 +1,589 @@
|
|||
import { Result } from '@/request/Result'
|
||||
import { get, post, postStream, del, put, request, download, exportFile } from '@/request/index'
|
||||
import type { pageRequest } from '@/api/type/common'
|
||||
import type { ApplicationFormType } from '@/api/type/application'
|
||||
import { type Ref } from 'vue'
|
||||
import type { FormField } from '@/components/dynamics-form/type'
|
||||
|
||||
const prefix = '/workspace'
|
||||
|
||||
/**
|
||||
* 获取全部应用
|
||||
* @param 参数
|
||||
*/
|
||||
const getAllAppilcation: () => Promise<Result<any[]>> = () => {
|
||||
return get(`${prefix}`)
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取分页应用
|
||||
* param {
|
||||
"name": "string",
|
||||
}
|
||||
*/
|
||||
const getApplication: (
|
||||
wordspace_id: string,
|
||||
page: pageRequest,
|
||||
param: any,
|
||||
loading?: Ref<boolean>,
|
||||
) => Promise<Result<any>> = (wordspace_id, page, param, loading) => {
|
||||
return get(
|
||||
`${prefix}/${wordspace_id}/application/${page.current_page}/${page.page_size}`,
|
||||
param,
|
||||
loading,
|
||||
)
|
||||
}
|
||||
|
||||
/**
|
||||
* 创建应用
|
||||
* @param 参数
|
||||
*/
|
||||
const postApplication: (
|
||||
data: ApplicationFormType,
|
||||
loading?: Ref<boolean>,
|
||||
) => Promise<Result<any>> = (data, loading) => {
|
||||
return post(`${prefix}`, data, undefined, loading)
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改应用
|
||||
* @param 参数
|
||||
*/
|
||||
const putApplication: (
|
||||
application_id: String,
|
||||
data: ApplicationFormType,
|
||||
loading?: Ref<boolean>,
|
||||
) => Promise<Result<any>> = (application_id, data, loading) => {
|
||||
return put(`${prefix}/${application_id}`, data, undefined, loading)
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除应用
|
||||
* @param 参数 application_id
|
||||
*/
|
||||
const delApplication: (
|
||||
application_id: String,
|
||||
loading?: Ref<boolean>,
|
||||
) => Promise<Result<boolean>> = (application_id, loading) => {
|
||||
return del(`${prefix}/${application_id}`, undefined, {}, loading)
|
||||
}
|
||||
|
||||
/**
|
||||
* 应用详情
|
||||
* @param 参数 application_id
|
||||
*/
|
||||
const getApplicationDetail: (
|
||||
application_id: string,
|
||||
loading?: Ref<boolean>,
|
||||
) => Promise<Result<any>> = (application_id, loading) => {
|
||||
return get(`${prefix}/${application_id}`, undefined, loading)
|
||||
}
|
||||
|
||||
/**
|
||||
* 获得当前应用可使用的知识库
|
||||
* @param 参数 application_id
|
||||
*/
|
||||
const getApplicationDataset: (
|
||||
application_id: string,
|
||||
loading?: Ref<boolean>,
|
||||
) => Promise<Result<any>> = (application_id, loading) => {
|
||||
return get(`${prefix}/${application_id}/list_dataset`, undefined, loading)
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取AccessToken
|
||||
* @param 参数 application_id
|
||||
*/
|
||||
const getAccessToken: (application_id: string, loading?: Ref<boolean>) => Promise<Result<any>> = (
|
||||
application_id,
|
||||
loading,
|
||||
) => {
|
||||
return get(`${prefix}/${application_id}/access_token`, undefined, loading)
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改AccessToken
|
||||
* @param 参数 application_id
|
||||
* data {
|
||||
* "is_active": true
|
||||
* }
|
||||
*/
|
||||
const putAccessToken: (
|
||||
application_id: string,
|
||||
data: any,
|
||||
loading?: Ref<boolean>,
|
||||
) => Promise<Result<any>> = (application_id, data, loading) => {
|
||||
return put(`${prefix}/${application_id}/access_token`, data, undefined, loading)
|
||||
}
|
||||
|
||||
/**
|
||||
* 应用认证
|
||||
* @param 参数
|
||||
{
|
||||
"access_token": "string"
|
||||
}
|
||||
*/
|
||||
const postAppAuthentication: (
|
||||
access_token: string,
|
||||
loading?: Ref<boolean>,
|
||||
authentication_value?: any,
|
||||
) => Promise<any> = (access_token, loading, authentication_value) => {
|
||||
return post(
|
||||
`${prefix}/authentication`,
|
||||
{ access_token: access_token, authentication_value },
|
||||
undefined,
|
||||
loading,
|
||||
)
|
||||
}
|
||||
|
||||
/**
|
||||
* 对话获取应用相关信息
|
||||
* @param 参数
|
||||
{
|
||||
"access_token": "string"
|
||||
}
|
||||
*/
|
||||
const getAppProfile: (loading?: Ref<boolean>) => Promise<any> = (loading) => {
|
||||
return get(`${prefix}/profile`, undefined, loading)
|
||||
}
|
||||
|
||||
/**
|
||||
* 获得临时回话Id
|
||||
* @param 参数
|
||||
|
||||
}
|
||||
*/
|
||||
const postChatOpen: (data: ApplicationFormType) => Promise<Result<any>> = (data) => {
|
||||
return post(`${prefix}/chat/open`, data)
|
||||
}
|
||||
|
||||
/**
|
||||
* 获得工作流临时回话Id
|
||||
* @param 参数
|
||||
|
||||
}
|
||||
*/
|
||||
const postWorkflowChatOpen: (data: ApplicationFormType) => Promise<Result<any>> = (data) => {
|
||||
return post(`${prefix}/chat_workflow/open`, data)
|
||||
}
|
||||
|
||||
/**
|
||||
* 正式回话Id
|
||||
* @param 参数
|
||||
* {
|
||||
"model_id": "string",
|
||||
"multiple_rounds_dialogue": true,
|
||||
"dataset_id_list": [
|
||||
"string"
|
||||
]
|
||||
}
|
||||
*/
|
||||
const getChatOpen: (application_id: String) => Promise<Result<any>> = (application_id) => {
|
||||
return get(`${prefix}/${application_id}/chat/open`)
|
||||
}
|
||||
/**
|
||||
* 对话
|
||||
* @param 参数
|
||||
* chat_id: string
|
||||
* data
|
||||
*/
|
||||
const postChatMessage: (chat_id: string, data: any) => Promise<any> = (chat_id, data) => {
|
||||
return postStream(`/api${prefix}/chat_message/${chat_id}`, data)
|
||||
}
|
||||
|
||||
/**
|
||||
* 点赞、点踩
|
||||
* @param 参数
|
||||
* application_id : string; chat_id : string; chat_record_id : string
|
||||
* {
|
||||
"vote_status": "string", // -1 0 1
|
||||
}
|
||||
*/
|
||||
const putChatVote: (
|
||||
application_id: string,
|
||||
chat_id: string,
|
||||
chat_record_id: string,
|
||||
vote_status: string,
|
||||
loading?: Ref<boolean>,
|
||||
) => Promise<any> = (application_id, chat_id, chat_record_id, vote_status, loading) => {
|
||||
return put(
|
||||
`${prefix}/${application_id}/chat/${chat_id}/chat_record/${chat_record_id}/vote`,
|
||||
{
|
||||
vote_status,
|
||||
},
|
||||
undefined,
|
||||
loading,
|
||||
)
|
||||
}
|
||||
|
||||
/**
|
||||
* 命中测试列表
|
||||
* @param application_id
|
||||
* @param loading
|
||||
* @query { query_text: string, top_number: number, similarity: number }
|
||||
* @returns
|
||||
*/
|
||||
const getApplicationHitTest: (
|
||||
application_id: string,
|
||||
data: any,
|
||||
loading?: Ref<boolean>,
|
||||
) => Promise<Result<Array<any>>> = (application_id, data, loading) => {
|
||||
return get(`${prefix}/${application_id}/hit_test`, data, loading)
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取当前用户可使用的模型列表
|
||||
* @param application_id
|
||||
* @param loading
|
||||
* @query { query_text: string, top_number: number, similarity: number }
|
||||
* @returns
|
||||
*/
|
||||
const getApplicationModel: (
|
||||
application_id: string,
|
||||
loading?: Ref<boolean>,
|
||||
) => Promise<Result<Array<any>>> = (application_id, loading) => {
|
||||
return get(`${prefix}/${application_id}/model`, loading)
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取当前用户可使用的模型列表
|
||||
* @param application_id
|
||||
* @param loading
|
||||
* @query { query_text: string, top_number: number, similarity: number }
|
||||
* @returns
|
||||
*/
|
||||
const getApplicationRerankerModel: (
|
||||
application_id: string,
|
||||
loading?: Ref<boolean>,
|
||||
) => Promise<Result<Array<any>>> = (application_id, loading) => {
|
||||
return get(`${prefix}/${application_id}/model`, { model_type: 'RERANKER' }, loading)
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取当前用户可使用的模型列表
|
||||
* @param application_id
|
||||
* @param loading
|
||||
* @query { query_text: string, top_number: number, similarity: number }
|
||||
* @returns
|
||||
*/
|
||||
const getApplicationSTTModel: (
|
||||
application_id: string,
|
||||
loading?: Ref<boolean>,
|
||||
) => Promise<Result<Array<any>>> = (application_id, loading) => {
|
||||
return get(`${prefix}/${application_id}/model`, { model_type: 'STT' }, loading)
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取当前用户可使用的模型列表
|
||||
* @param application_id
|
||||
* @param loading
|
||||
* @query { query_text: string, top_number: number, similarity: number }
|
||||
* @returns
|
||||
*/
|
||||
const getApplicationTTSModel: (
|
||||
application_id: string,
|
||||
loading?: Ref<boolean>,
|
||||
) => Promise<Result<Array<any>>> = (application_id, loading) => {
|
||||
return get(`${prefix}/${application_id}/model`, { model_type: 'TTS' }, loading)
|
||||
}
|
||||
|
||||
const getApplicationImageModel: (
|
||||
application_id: string,
|
||||
loading?: Ref<boolean>,
|
||||
) => Promise<Result<Array<any>>> = (application_id, loading) => {
|
||||
return get(`${prefix}/${application_id}/model`, { model_type: 'IMAGE' }, loading)
|
||||
}
|
||||
|
||||
const getApplicationTTIModel: (
|
||||
application_id: string,
|
||||
loading?: Ref<boolean>,
|
||||
) => Promise<Result<Array<any>>> = (application_id, loading) => {
|
||||
return get(`${prefix}/${application_id}/model`, { model_type: 'TTI' }, loading)
|
||||
}
|
||||
|
||||
/**
|
||||
* 发布应用
|
||||
* @param 参数
|
||||
*/
|
||||
const putPublishApplication: (
|
||||
application_id: String,
|
||||
data: ApplicationFormType,
|
||||
loading?: Ref<boolean>,
|
||||
) => Promise<Result<any>> = (application_id, data, loading) => {
|
||||
return put(`${prefix}/${application_id}/publish`, data, undefined, loading)
|
||||
}
|
||||
/**
|
||||
* 获取应用所属的函数库列表
|
||||
* @param application_id 应用id
|
||||
* @param loading
|
||||
* @returns
|
||||
*/
|
||||
const listFunctionLib: (application_id: String, loading?: Ref<boolean>) => Promise<Result<any>> = (
|
||||
application_id,
|
||||
loading,
|
||||
) => {
|
||||
return get(`${prefix}/${application_id}/function_lib`, undefined, loading)
|
||||
}
|
||||
/**
|
||||
* 获取当前人的所有应用列表
|
||||
* @param application_id 应用id
|
||||
* @param loading
|
||||
* @returns
|
||||
*/
|
||||
export const getApplicationList: (
|
||||
application_id: string,
|
||||
loading?: Ref<boolean>,
|
||||
) => Promise<Result<any>> = (application_id, loading) => {
|
||||
return get(`${prefix}/${application_id}/application`, undefined, loading)
|
||||
}
|
||||
/**
|
||||
* 获取应用所属的函数库
|
||||
* @param application_id
|
||||
* @param function_lib_id
|
||||
* @param loading
|
||||
* @returns
|
||||
*/
|
||||
const getFunctionLib: (
|
||||
application_id: String,
|
||||
function_lib_id: String,
|
||||
loading?: Ref<boolean>,
|
||||
) => Promise<Result<any>> = (application_id, function_lib_id, loading) => {
|
||||
return get(`${prefix}/${application_id}/function_lib/${function_lib_id}`, undefined, loading)
|
||||
}
|
||||
|
||||
const getMcpTools: (data: any, loading?: Ref<boolean>) => Promise<Result<any>> = (
|
||||
data,
|
||||
loading,
|
||||
) => {
|
||||
return get(`${prefix}/mcp_servers`, data, loading)
|
||||
}
|
||||
|
||||
const getApplicationById: (
|
||||
application_id: String,
|
||||
app_id: String,
|
||||
loading?: Ref<boolean>,
|
||||
) => Promise<Result<any>> = (application_id, app_id, loading) => {
|
||||
return get(`${prefix}/${application_id}/application/${app_id}`, undefined, loading)
|
||||
}
|
||||
/**
|
||||
* 获取模型参数表单
|
||||
* @param application_id 应用id
|
||||
* @param model_id 模型id
|
||||
* @param loading
|
||||
* @returns
|
||||
*/
|
||||
const getModelParamsForm: (
|
||||
application_id: String,
|
||||
model_id: String,
|
||||
loading?: Ref<boolean>,
|
||||
) => Promise<Result<Array<FormField>>> = (application_id, model_id, loading) => {
|
||||
return get(`${prefix}/${application_id}/model_params_form/${model_id}`, undefined, loading)
|
||||
}
|
||||
|
||||
/**
|
||||
* 上传文档图片附件
|
||||
*/
|
||||
const uploadFile: (
|
||||
application_id: String,
|
||||
chat_id: String,
|
||||
data: any,
|
||||
loading?: Ref<boolean>,
|
||||
) => Promise<Result<any>> = (application_id, chat_id, data, loading) => {
|
||||
return post(`${prefix}/${application_id}/chat/${chat_id}/upload_file`, data, undefined, loading)
|
||||
}
|
||||
|
||||
/**
|
||||
* 语音转文本
|
||||
*/
|
||||
const postSpeechToText: (
|
||||
application_id: String,
|
||||
data: any,
|
||||
loading?: Ref<boolean>,
|
||||
) => Promise<Result<any>> = (application_id, data, loading) => {
|
||||
return post(`${prefix}/${application_id}/speech_to_text`, data, undefined, loading)
|
||||
}
|
||||
|
||||
/**
|
||||
* 文本转语音
|
||||
*/
|
||||
const postTextToSpeech: (
|
||||
application_id: String,
|
||||
data: any,
|
||||
loading?: Ref<boolean>,
|
||||
) => Promise<Result<any>> = (application_id, data, loading) => {
|
||||
return download(`${prefix}/${application_id}/text_to_speech`, 'post', data, undefined, loading)
|
||||
}
|
||||
|
||||
/**
|
||||
* 播放测试文本
|
||||
*/
|
||||
const playDemoText: (
|
||||
application_id: String,
|
||||
data: any,
|
||||
loading?: Ref<boolean>,
|
||||
) => Promise<Result<any>> = (application_id, data, loading) => {
|
||||
return download(`${prefix}/${application_id}/play_demo_text`, 'post', data, undefined, loading)
|
||||
}
|
||||
/**
|
||||
* 获取平台状态
|
||||
*/
|
||||
const getPlatformStatus: (application_id: string) => Promise<Result<any>> = (application_id) => {
|
||||
return get(`/platform/${application_id}/status`)
|
||||
}
|
||||
/**
|
||||
* 获取平台配置
|
||||
*/
|
||||
const getPlatformConfig: (application_id: string, type: string) => Promise<Result<any>> = (
|
||||
application_id,
|
||||
type,
|
||||
) => {
|
||||
return get(`/platform/${application_id}/${type}`)
|
||||
}
|
||||
/**
|
||||
* 更新平台配置
|
||||
*/
|
||||
const updatePlatformConfig: (
|
||||
application_id: string,
|
||||
type: string,
|
||||
data: any,
|
||||
loading?: Ref<boolean>,
|
||||
) => Promise<Result<any>> = (application_id, type, data, loading) => {
|
||||
return post(`/platform/${application_id}/${type}`, data, undefined, loading)
|
||||
}
|
||||
/**
|
||||
* 更新平台状态
|
||||
*/
|
||||
const updatePlatformStatus: (application_id: string, data: any) => Promise<Result<any>> = (
|
||||
application_id,
|
||||
data,
|
||||
) => {
|
||||
return post(`/platform/${application_id}/status`, data)
|
||||
}
|
||||
/**
|
||||
* 验证密码
|
||||
*/
|
||||
const validatePassword: (
|
||||
application_id: string,
|
||||
password: string,
|
||||
loading?: Ref<boolean>,
|
||||
) => Promise<Result<any>> = (application_id, password, loading) => {
|
||||
return get(`/application/${application_id}/auth/${password}`, undefined, loading)
|
||||
}
|
||||
|
||||
/**
|
||||
* workflow历史版本
|
||||
*/
|
||||
const getWorkFlowVersion: (
|
||||
application_id: string,
|
||||
loading?: Ref<boolean>,
|
||||
) => Promise<Result<any>> = (application_id, loading) => {
|
||||
return get(`/application/${application_id}/work_flow_version`, undefined, loading)
|
||||
}
|
||||
|
||||
/**
|
||||
* workflow历史版本详情
|
||||
*/
|
||||
const getWorkFlowVersionDetail: (
|
||||
application_id: string,
|
||||
application_version_id: string,
|
||||
loading?: Ref<boolean>,
|
||||
) => Promise<Result<any>> = (application_id, application_version_id, loading) => {
|
||||
return get(
|
||||
`/application/${application_id}/work_flow_version/${application_version_id}`,
|
||||
undefined,
|
||||
loading,
|
||||
)
|
||||
}
|
||||
/**
|
||||
* 修改workflow历史版本
|
||||
*/
|
||||
const putWorkFlowVersion: (
|
||||
application_id: string,
|
||||
application_version_id: string,
|
||||
data: any,
|
||||
loading?: Ref<boolean>,
|
||||
) => Promise<Result<any>> = (application_id, application_version_id, data, loading) => {
|
||||
return put(
|
||||
`/application/${application_id}/work_flow_version/${application_version_id}`,
|
||||
data,
|
||||
undefined,
|
||||
loading,
|
||||
)
|
||||
}
|
||||
|
||||
const getUserList: (type: string, loading?: Ref<boolean>) => Promise<Result<any>> = (
|
||||
type,
|
||||
loading,
|
||||
) => {
|
||||
return get(`/user/list/${type}`, undefined, loading)
|
||||
}
|
||||
|
||||
const exportApplication = (
|
||||
application_id: string,
|
||||
application_name: string,
|
||||
loading?: Ref<boolean>,
|
||||
) => {
|
||||
return exportFile(
|
||||
application_name + '.mk',
|
||||
`/application/${application_id}/export`,
|
||||
undefined,
|
||||
loading,
|
||||
)
|
||||
}
|
||||
|
||||
/**
|
||||
* 导入应用
|
||||
*/
|
||||
const importApplication: (data: any, loading?: Ref<boolean>) => Promise<Result<any>> = (
|
||||
data,
|
||||
loading,
|
||||
) => {
|
||||
return post(`${prefix}/import`, data, undefined, loading)
|
||||
}
|
||||
export default {
|
||||
getAllAppilcation,
|
||||
getApplication,
|
||||
postApplication,
|
||||
putApplication,
|
||||
postChatOpen,
|
||||
getChatOpen,
|
||||
postChatMessage,
|
||||
delApplication,
|
||||
getApplicationDetail,
|
||||
getApplicationDataset,
|
||||
getAccessToken,
|
||||
putAccessToken,
|
||||
postAppAuthentication,
|
||||
getAppProfile,
|
||||
putChatVote,
|
||||
getApplicationHitTest,
|
||||
getApplicationModel,
|
||||
putPublishApplication,
|
||||
postWorkflowChatOpen,
|
||||
listFunctionLib,
|
||||
getFunctionLib,
|
||||
getModelParamsForm,
|
||||
getApplicationRerankerModel,
|
||||
getApplicationSTTModel,
|
||||
getApplicationTTSModel,
|
||||
getApplicationImageModel,
|
||||
getApplicationTTIModel,
|
||||
postSpeechToText,
|
||||
postTextToSpeech,
|
||||
getPlatformStatus,
|
||||
getPlatformConfig,
|
||||
updatePlatformConfig,
|
||||
updatePlatformStatus,
|
||||
validatePassword,
|
||||
getWorkFlowVersion,
|
||||
getWorkFlowVersionDetail,
|
||||
putWorkFlowVersion,
|
||||
playDemoText,
|
||||
getUserList,
|
||||
getApplicationList,
|
||||
uploadFile,
|
||||
exportApplication,
|
||||
importApplication,
|
||||
getApplicationById,
|
||||
getMcpTools,
|
||||
}
|
||||
|
|
@ -0,0 +1,27 @@
|
|||
export enum SearchMode {
|
||||
embedding = 'views.application.applicationForm.dialog.vectorSearch',
|
||||
keywords = 'views.application.applicationForm.dialog.fullTextSearch',
|
||||
blend = 'views.application.applicationForm.dialog.hybridSearch'
|
||||
}
|
||||
|
||||
export enum WorkflowType {
|
||||
Base = 'base-node',
|
||||
Start = 'start-node',
|
||||
AiChat = 'ai-chat-node',
|
||||
SearchDataset = 'search-dataset-node',
|
||||
Question = 'question-node',
|
||||
Condition = 'condition-node',
|
||||
Reply = 'reply-node',
|
||||
FunctionLib = 'function-lib-node',
|
||||
FunctionLibCustom = 'function-node',
|
||||
RrerankerNode = 'reranker-node',
|
||||
Application = 'application-node',
|
||||
DocumentExtractNode = 'document-extract-node',
|
||||
ImageUnderstandNode = 'image-understand-node',
|
||||
VariableAssignNode = 'variable-assign-node',
|
||||
FormNode = 'form-node',
|
||||
TextToSpeechNode = 'text-to-speech-node',
|
||||
SpeechToTextNode = 'speech-to-text-node',
|
||||
ImageGenerateNode = 'image-generate-node',
|
||||
McpNode = 'mcp-node',
|
||||
}
|
||||
|
|
@ -1,4 +1,3 @@
|
|||
// import Layout from '@/layout/layout-template/DetailLayout.vue'
|
||||
import { ComplexPermission } from '@/utils/permission/type'
|
||||
|
||||
const applicationRouter = {
|
||||
|
|
@ -12,83 +11,10 @@ const applicationRouter = {
|
|||
path: '/application',
|
||||
name: 'application-index',
|
||||
meta: { title: '应用主页', activeMenu: '/application' },
|
||||
component: () => import('@/views/application/index.vue')
|
||||
component: () => import('@/views/application/index.vue'),
|
||||
hidden: true,
|
||||
},
|
||||
// {
|
||||
// path: '/application/:id/:type',
|
||||
// name: 'ApplicationDetail',
|
||||
// meta: { title: '应用详情', activeMenu: '/application' },
|
||||
// component: Layout,
|
||||
// hidden: true,
|
||||
// children: [
|
||||
// {
|
||||
// path: 'overview',
|
||||
// name: 'AppOverview',
|
||||
// meta: {
|
||||
// icon: 'app-all-menu',
|
||||
// iconActive: 'app-all-menu-active',
|
||||
// title: 'views.applicationOverview.title',
|
||||
// active: 'overview',
|
||||
// parentPath: '/application/:id/:type',
|
||||
// parentName: 'ApplicationDetail'
|
||||
// },
|
||||
// component: () => import('@/views/application-overview/index.vue')
|
||||
// },
|
||||
// {
|
||||
// path: 'setting',
|
||||
// name: 'AppSetting',
|
||||
// meta: {
|
||||
// icon: 'app-setting',
|
||||
// iconActive: 'app-setting-active',
|
||||
// title: 'common.setting',
|
||||
// active: 'setting',
|
||||
// parentPath: '/application/:id/:type',
|
||||
// parentName: 'ApplicationDetail'
|
||||
// },
|
||||
// component: () => import('@/views/application/ApplicationSetting.vue')
|
||||
// },
|
||||
// {
|
||||
// path: 'access',
|
||||
// name: 'AppAccess',
|
||||
// meta: {
|
||||
// icon: 'app-access',
|
||||
// iconActive: 'app-access-active',
|
||||
// title: 'views.application.applicationAccess.title',
|
||||
// active: 'access',
|
||||
// parentPath: '/application/:id/:type',
|
||||
// parentName: 'ApplicationDetail',
|
||||
// permission: new ComplexPermission([], ['x-pack'], 'OR')
|
||||
// },
|
||||
// component: () => import('@/views/application/ApplicationAccess.vue')
|
||||
// },
|
||||
// {
|
||||
// path: 'hit-test',
|
||||
// name: 'AppHitTest',
|
||||
// meta: {
|
||||
// icon: 'app-hit-test',
|
||||
// title: 'views.application.hitTest.title',
|
||||
// active: 'hit-test',
|
||||
// parentPath: '/application/:id/:type',
|
||||
// parentName: 'ApplicationDetail'
|
||||
// },
|
||||
// component: () => import('@/views/hit-test/index.vue')
|
||||
// },
|
||||
// // {
|
||||
// // path: 'log',
|
||||
// // name: 'Log',
|
||||
// // meta: {
|
||||
// // icon: 'app-document',
|
||||
// // iconActive: 'app-document-active',
|
||||
// // title: 'views.log.title',
|
||||
// // active: 'log',
|
||||
// // parentPath: '/application/:id/:type',
|
||||
// // parentName: 'ApplicationDetail'
|
||||
// // },
|
||||
// // component: () => import('@/views/log/index.vue')
|
||||
// // }
|
||||
// ]
|
||||
// }
|
||||
]
|
||||
],
|
||||
}
|
||||
|
||||
export default applicationRouter
|
||||
|
|
|
|||
|
|
@ -0,0 +1,76 @@
|
|||
const ApplicationDetailRouter = {
|
||||
path: '/application/:id/:type',
|
||||
name: 'ApplicationDetail',
|
||||
meta: { title: '应用详情', activeMenu: '/application', breadcrumb: true },
|
||||
component: () => import('@/layout/layout-template/MainLayout.vue'),
|
||||
hidden: true,
|
||||
children: [
|
||||
{
|
||||
path: 'overview',
|
||||
name: 'AppOverview',
|
||||
meta: {
|
||||
icon: 'app-all-menu',
|
||||
iconActive: 'app-all-menu-active',
|
||||
title: 'views.applicationOverview.title',
|
||||
active: 'overview',
|
||||
parentPath: '/application/:id/:type',
|
||||
parentName: 'ApplicationDetail',
|
||||
},
|
||||
component: () => import('@/views/application-overview/index.vue'),
|
||||
},
|
||||
{
|
||||
path: 'setting',
|
||||
name: 'AppSetting',
|
||||
meta: {
|
||||
icon: 'app-setting',
|
||||
iconActive: 'app-setting-active',
|
||||
title: 'common.setting',
|
||||
active: 'setting',
|
||||
parentPath: '/application/:id/:type',
|
||||
parentName: 'ApplicationDetail',
|
||||
},
|
||||
component: () => import('@/views/application/ApplicationSetting.vue'),
|
||||
},
|
||||
{
|
||||
path: 'access',
|
||||
name: 'AppAccess',
|
||||
meta: {
|
||||
icon: 'app-access',
|
||||
iconActive: 'app-access-active',
|
||||
title: 'views.application.applicationAccess.title',
|
||||
active: 'access',
|
||||
parentPath: '/application/:id/:type',
|
||||
parentName: 'ApplicationDetail',
|
||||
// permission: new ComplexPermission([], ['x-pack'], 'OR'),
|
||||
},
|
||||
component: () => import('@/views/application/ApplicationAccess.vue'),
|
||||
},
|
||||
{
|
||||
path: 'hit-test',
|
||||
name: 'AppHitTest',
|
||||
meta: {
|
||||
icon: 'app-hit-test',
|
||||
title: 'views.application.hitTest.title',
|
||||
active: 'hit-test',
|
||||
parentPath: '/application/:id/:type',
|
||||
parentName: 'ApplicationDetail',
|
||||
},
|
||||
component: () => import('@/views/hit-test/index.vue'),
|
||||
},
|
||||
// {
|
||||
// path: 'log',
|
||||
// name: 'Log',
|
||||
// meta: {
|
||||
// icon: 'app-document',
|
||||
// iconActive: 'app-document-active',
|
||||
// title: 'views.log.title',
|
||||
// active: 'log',
|
||||
// parentPath: '/application/:id/:type',
|
||||
// parentName: 'ApplicationDetail'
|
||||
// },
|
||||
// component: () => import('@/views/log/index.vue')
|
||||
// }
|
||||
],
|
||||
}
|
||||
|
||||
export default ApplicationDetailRouter
|
||||
|
|
@ -1,4 +1,4 @@
|
|||
const ModelRouter = {
|
||||
const DocumentRouter = {
|
||||
path: '/knowledge/:id',
|
||||
name: 'KnowledgeDetail',
|
||||
meta: { title: 'common.fileUpload.document', activeMenu: '/knowledge', breadcrumb: true },
|
||||
|
|
@ -59,4 +59,4 @@ const ModelRouter = {
|
|||
],
|
||||
}
|
||||
|
||||
export default ModelRouter
|
||||
export default DocumentRouter
|
||||
|
|
|
|||
|
|
@ -6,7 +6,7 @@ export const routes: Array<RouteRecordRaw> = [
|
|||
{
|
||||
path: '/',
|
||||
name: 'home',
|
||||
redirect: '/knowledge',
|
||||
redirect: '/application',
|
||||
children: [...rolesRoutes],
|
||||
},
|
||||
|
||||
|
|
|
|||
|
|
@ -61,7 +61,7 @@
|
|||
import { ref, watch } from 'vue'
|
||||
import { useRoute } from 'vue-router'
|
||||
import { copyClick } from '@/utils/clipboard'
|
||||
import overviewApi from '@/api/application-overview'
|
||||
import overviewApi from '@/api/application/application-overview'
|
||||
import SettingAPIKeyDialog from './SettingAPIKeyDialog.vue'
|
||||
import { datetimeFormat } from '@/utils/time'
|
||||
import { MsgSuccess, MsgConfirm } from '@/utils/message'
|
||||
|
|
|
|||
|
|
@ -47,7 +47,7 @@
|
|||
import { ref, watch } from 'vue'
|
||||
import { useRoute } from 'vue-router'
|
||||
import type { FormInstance, FormRules, UploadFiles } from 'element-plus'
|
||||
import applicationApi from '@/api/application'
|
||||
import applicationApi from '@/api/application/application'
|
||||
import { isWorkFlow } from '@/utils/application'
|
||||
import { MsgSuccess, MsgError } from '@/utils/message'
|
||||
import { getBrowserLang, langList, t } from '@/locales'
|
||||
|
|
|
|||
|
|
@ -61,7 +61,7 @@
|
|||
<script setup lang="ts">
|
||||
import { ref, watch } from 'vue'
|
||||
import { useRoute } from 'vue-router'
|
||||
import overviewApi from '@/api/application-overview'
|
||||
import overviewApi from '@/api/application/application-overview'
|
||||
import { cloneDeep } from 'lodash'
|
||||
import { MsgSuccess, MsgError } from '@/utils/message'
|
||||
import { defaultIcon, isAppIcon } from '@/utils/common'
|
||||
|
|
|
|||
|
|
@ -103,7 +103,7 @@
|
|||
import { ref, watch } from 'vue'
|
||||
import { useRoute } from 'vue-router'
|
||||
import type { FormInstance, FormRules } from 'element-plus'
|
||||
import applicationApi from '@/api/application'
|
||||
import applicationApi from '@/api/application/application'
|
||||
import { MsgSuccess } from '@/utils/message'
|
||||
import { t } from '@/locales'
|
||||
import { copyClick } from '@/utils/clipboard'
|
||||
|
|
|
|||
|
|
@ -37,7 +37,7 @@
|
|||
import { ref, watch } from 'vue'
|
||||
import { useRoute } from 'vue-router'
|
||||
import type { FormInstance, FormRules } from 'element-plus'
|
||||
import overviewApi from '@/api/application-overview'
|
||||
import overviewApi from '@/api/application/application-overview'
|
||||
import overviewSystemApi from '@/api/system-api-key'
|
||||
import { MsgSuccess } from '@/utils/message'
|
||||
import { t } from '@/locales'
|
||||
|
|
|
|||
|
|
@ -418,7 +418,7 @@ import { useRoute } from 'vue-router'
|
|||
import type { FormInstance, FormRules, UploadFiles } from 'element-plus'
|
||||
import { isWorkFlow } from '@/utils/application'
|
||||
import { isAppIcon } from '@/utils/common'
|
||||
import applicationXpackApi from '@/api/application-xpack'
|
||||
import applicationXpackApi from '@/api/application/application-xpack'
|
||||
import { MsgSuccess, MsgError } from '@/utils/message'
|
||||
import { langList, t } from '@/locales'
|
||||
import useStore from '@/stores'
|
||||
|
|
|
|||
|
|
@ -203,8 +203,8 @@ import DisplaySettingDialog from './component/DisplaySettingDialog.vue'
|
|||
import XPackDisplaySettingDialog from './component/XPackDisplaySettingDialog.vue'
|
||||
import EditAvatarDialog from './component/EditAvatarDialog.vue'
|
||||
import StatisticsCharts from './component/StatisticsCharts.vue'
|
||||
import applicationApi from '@/api/application'
|
||||
import overviewApi from '@/api/application-overview'
|
||||
import applicationApi from '@/api/application/application'
|
||||
import overviewApi from '@/api/application/application-overview'
|
||||
import { nowDate, beforeDay } from '@/utils/time'
|
||||
import { MsgSuccess, MsgConfirm } from '@/utils/message'
|
||||
import { copyClick } from '@/utils/clipboard'
|
||||
|
|
|
|||
|
|
@ -132,7 +132,7 @@
|
|||
import { ref, onMounted, computed } from 'vue'
|
||||
import { menuNodes, functionLibNode, functionNode, applicationNode } from '@/workflow/common/data'
|
||||
import { iconComponent } from '@/workflow/icons/utils'
|
||||
import applicationApi from '@/api/application'
|
||||
import applicationApi from '@/api/application/application'
|
||||
import { isWorkFlow } from '@/utils/application'
|
||||
import { isAppIcon } from '@/utils/common'
|
||||
const search_text = ref<string>('')
|
||||
|
|
|
|||
|
|
@ -71,7 +71,7 @@
|
|||
<script setup lang="ts">
|
||||
import { ref, onMounted, computed } from 'vue'
|
||||
import { useRoute } from 'vue-router'
|
||||
import applicationApi from '@/api/application'
|
||||
import applicationApi from '@/api/application/application'
|
||||
import { datetimeFormat } from '@/utils/time'
|
||||
import { MsgSuccess, MsgError } from '@/utils/message'
|
||||
import { t } from '@/locales'
|
||||
|
|
|
|||
|
|
@ -140,7 +140,7 @@ import type { Action } from 'element-plus'
|
|||
import Workflow from '@/workflow/index.vue'
|
||||
import DropdownMenu from '@/views/application-workflow/component/DropdownMenu.vue'
|
||||
import PublishHistory from '@/views/application-workflow/component/PublishHistory.vue'
|
||||
import applicationApi from '@/api/application'
|
||||
import applicationApi from '@/api/application/application'
|
||||
import { isAppIcon } from '@/utils/common'
|
||||
import { MsgSuccess, MsgError, MsgConfirm } from '@/utils/message'
|
||||
import { datetimeFormat } from '@/utils/time'
|
||||
|
|
|
|||
|
|
@ -45,7 +45,7 @@
|
|||
<script setup lang="ts">
|
||||
import { reactive, ref, onMounted } from 'vue'
|
||||
import AccessSettingDrawer from './component/AccessSettingDrawer.vue'
|
||||
import applicationApi from '@/api/application'
|
||||
import applicationApi from '@/api/application/application'
|
||||
import { MsgSuccess } from '@/utils/message'
|
||||
import { useRoute } from 'vue-router'
|
||||
import { t } from '@/locales'
|
||||
|
|
|
|||
|
|
@ -500,7 +500,7 @@ import AIModeParamSettingDialog from './component/AIModeParamSettingDialog.vue'
|
|||
import ParamSettingDialog from './component/ParamSettingDialog.vue'
|
||||
import AddDatasetDialog from './component/AddDatasetDialog.vue'
|
||||
import EditAvatarDialog from '@/views/application-overview/component/EditAvatarDialog.vue'
|
||||
import applicationApi from '@/api/application'
|
||||
import applicationApi from '@/api/application/application'
|
||||
import { isAppIcon } from '@/utils/common'
|
||||
import type { FormInstance, FormRules } from 'element-plus'
|
||||
import type { ApplicationFormType } from '@/api/type/application'
|
||||
|
|
|
|||
|
|
@ -36,7 +36,7 @@
|
|||
import { ref } from 'vue'
|
||||
import type { FormField } from '@/components/dynamics-form/type'
|
||||
import modelAPi from '@/api/model'
|
||||
import applicationApi from '@/api/application'
|
||||
import applicationApi from '@/api/application/application'
|
||||
import DynamicsForm from '@/components/dynamics-form/index.vue'
|
||||
const model_form_field = ref<Array<FormField>>([])
|
||||
const emit = defineEmits(['refresh'])
|
||||
|
|
|
|||
|
|
@ -101,7 +101,7 @@
|
|||
<script setup lang="ts">
|
||||
import { ref, reactive, computed } from 'vue'
|
||||
import type { FormInstance } from 'element-plus'
|
||||
import applicationApi from '@/api/application'
|
||||
import applicationApi from '@/api/application/application'
|
||||
import { useRoute } from 'vue-router'
|
||||
import { MsgError, MsgSuccess } from '@/utils/message'
|
||||
import { copyClick } from '@/utils/clipboard'
|
||||
|
|
|
|||
|
|
@ -51,7 +51,7 @@ import { useRouter, useRoute } from 'vue-router'
|
|||
import { cloneDeep } from 'lodash'
|
||||
import type { ApplicationFormType } from '@/api/type/application'
|
||||
import type { FormInstance, FormRules } from 'element-plus'
|
||||
import applicationApi from '@/api/application'
|
||||
import applicationApi from '@/api/application/application'
|
||||
import { MsgSuccess, MsgAlert } from '@/utils/message'
|
||||
import { isWorkFlow } from '@/utils/application'
|
||||
import { t } from '@/locales'
|
||||
|
|
|
|||
|
|
@ -107,7 +107,7 @@ import { ref, watch, reactive } from 'vue'
|
|||
import { useRouter, useRoute } from 'vue-router'
|
||||
import type { ApplicationFormType } from '@/api/type/application'
|
||||
import type { FormInstance, FormRules } from 'element-plus'
|
||||
import applicationApi from '@/api/application'
|
||||
import applicationApi from '@/api/application/application'
|
||||
import { MsgSuccess, MsgAlert } from '@/utils/message'
|
||||
import { isWorkFlow } from '@/utils/application'
|
||||
import { baseNodes } from '@/workflow/common/data'
|
||||
|
|
|
|||
|
|
@ -44,7 +44,7 @@
|
|||
import { ref } from 'vue'
|
||||
import type { FormField } from '@/components/dynamics-form/type'
|
||||
import modelAPi from '@/api/model'
|
||||
import applicationApi from '@/api/application'
|
||||
import applicationApi from '@/api/application/application'
|
||||
import DynamicsForm from '@/components/dynamics-form/index.vue'
|
||||
import { keys } from 'lodash'
|
||||
import { app } from '@/main'
|
||||
|
|
|
|||
|
|
@ -1,137 +1,146 @@
|
|||
<template>
|
||||
<div class="application-list-container p-24" style="padding-top: 16px">
|
||||
<div class="flex-between mb-16">
|
||||
<h4>{{ $t('views.application.title') }}</h4>
|
||||
<div class="flex-between">
|
||||
<el-select
|
||||
v-model="selectUserId"
|
||||
class="mr-12"
|
||||
@change="searchHandle"
|
||||
style="max-width: 240px; width: 150px"
|
||||
>
|
||||
<el-option
|
||||
v-for="item in userOptions"
|
||||
:key="item.value"
|
||||
:label="item.label"
|
||||
:value="item.value"
|
||||
/>
|
||||
</el-select>
|
||||
<el-input
|
||||
v-model="searchValue"
|
||||
@change="searchHandle"
|
||||
:placeholder="$t('views.application.searchBar.placeholder')"
|
||||
prefix-icon="Search"
|
||||
class="w-240"
|
||||
style="min-width: 240px"
|
||||
clearable
|
||||
/>
|
||||
</div>
|
||||
</div>
|
||||
<div v-loading.fullscreen.lock="paginationConfig.current_page === 1 && loading">
|
||||
<InfiniteScroll
|
||||
:size="applicationList.length"
|
||||
:total="paginationConfig.total"
|
||||
:page_size="paginationConfig.page_size"
|
||||
v-model:current_page="paginationConfig.current_page"
|
||||
@load="getList"
|
||||
:loading="loading"
|
||||
>
|
||||
<el-row :gutter="15">
|
||||
<el-col :xs="24" :sm="12" :md="8" :lg="6" :xl="6" class="mb-16">
|
||||
<el-card shadow="hover" class="application-card-add" style="--el-card-padding: 8px">
|
||||
<div class="card-add-button flex align-center cursor p-8" @click="openCreateDialog">
|
||||
<AppIcon iconName="app-add-application" class="mr-8"></AppIcon>
|
||||
{{ $t('views.application.createApplication') }}
|
||||
</div>
|
||||
<el-divider style="margin: 8px 0" />
|
||||
<el-upload
|
||||
ref="elUploadRef"
|
||||
:file-list="[]"
|
||||
action="#"
|
||||
multiple
|
||||
:auto-upload="false"
|
||||
:show-file-list="false"
|
||||
:limit="1"
|
||||
:on-change="(file: any, fileList: any) => importApplication(file)"
|
||||
class="card-add-button"
|
||||
>
|
||||
<div class="flex align-center cursor p-8">
|
||||
<AppIcon iconName="app-import" class="mr-8"></AppIcon>
|
||||
{{ $t('views.application.importApplication') }}
|
||||
</div>
|
||||
</el-upload>
|
||||
</el-card>
|
||||
</el-col>
|
||||
<el-col
|
||||
:xs="24"
|
||||
:sm="12"
|
||||
:md="8"
|
||||
:lg="6"
|
||||
:xl="6"
|
||||
v-for="(item, index) in applicationList"
|
||||
:key="index"
|
||||
class="mb-16"
|
||||
>
|
||||
<CardBox
|
||||
:title="item.name"
|
||||
:description="item.desc"
|
||||
class="application-card cursor"
|
||||
@click="router.push({ path: `/application/${item.id}/${item.type}/overview` })"
|
||||
<LayoutContainer class="application-manage">
|
||||
<template #left>
|
||||
<h4 class="p-16 pb-0">{{ $t('views.application.title') }}</h4>
|
||||
<folder-tree
|
||||
:data="folderList"
|
||||
:currentNodeKey="currentFolder?.id"
|
||||
@handleNodeClick="folderClickHandel"
|
||||
class="p-8"
|
||||
/>
|
||||
</template>
|
||||
<ContentContainer :header="currentFolder?.name">
|
||||
<template #search>
|
||||
<div class="flex">
|
||||
<div class="flex-between complex-search">
|
||||
<el-select
|
||||
class="complex-search__left"
|
||||
v-model="search_type"
|
||||
style="width: 120px"
|
||||
@change="search_type_change"
|
||||
>
|
||||
<template #icon>
|
||||
<AppAvatar
|
||||
v-if="isAppIcon(item?.icon)"
|
||||
shape="square"
|
||||
:size="32"
|
||||
style="background: none"
|
||||
class="mr-8"
|
||||
>
|
||||
<img :src="item?.icon" alt="" />
|
||||
</AppAvatar>
|
||||
<AppAvatar
|
||||
v-else-if="item?.name"
|
||||
:name="item?.name"
|
||||
pinyinColor
|
||||
shape="square"
|
||||
:size="32"
|
||||
class="mr-8"
|
||||
/>
|
||||
</template>
|
||||
<template #subTitle>
|
||||
<el-text class="color-secondary" size="small">
|
||||
<auto-tooltip :content="item.username">
|
||||
{{ $t('common.creator') }}: {{ item.username }}
|
||||
</auto-tooltip>
|
||||
</el-text>
|
||||
</template>
|
||||
<div class="status-tag">
|
||||
<el-tag type="warning" v-if="isWorkFlow(item.type)" style="height: 22px">
|
||||
{{ $t('views.application.workflow') }}
|
||||
</el-tag>
|
||||
<el-tag class="blue-tag" v-else style="height: 22px">
|
||||
{{ $t('views.application.simple') }}
|
||||
</el-tag>
|
||||
</div>
|
||||
<el-option :label="$t('common.creator')" value="create_user" />
|
||||
|
||||
<template #footer>
|
||||
<div class="footer-content">
|
||||
<el-tooltip
|
||||
effect="dark"
|
||||
:content="$t('views.application.setting.demo')"
|
||||
placement="top"
|
||||
>
|
||||
<el-button text @click.stop @click="getAccessToken(item.id)">
|
||||
<AppIcon iconName="app-view"></AppIcon>
|
||||
</el-button>
|
||||
</el-tooltip>
|
||||
<el-divider direction="vertical" />
|
||||
<el-tooltip effect="dark" :content="$t('common.setting')" placement="top">
|
||||
<el-button text @click.stop="settingApplication(item)">
|
||||
<AppIcon iconName="Setting"></AppIcon>
|
||||
</el-button>
|
||||
</el-tooltip>
|
||||
<el-divider direction="vertical" />
|
||||
<span @click.stop>
|
||||
<el-option :label="$t('common.name')" value="name" />
|
||||
</el-select>
|
||||
<el-input
|
||||
v-if="search_type === 'name'"
|
||||
v-model="search_form.name"
|
||||
@change="getList"
|
||||
:placeholder="$t('common.searchBar.placeholder')"
|
||||
style="width: 220px"
|
||||
clearable
|
||||
/>
|
||||
<el-select
|
||||
v-else-if="search_type === 'create_user'"
|
||||
v-model="search_form.create_user"
|
||||
@change="getList"
|
||||
clearable
|
||||
style="width: 220px"
|
||||
>
|
||||
<el-option v-for="u in user_options" :key="u.id" :value="u.id" :label="u.username" />
|
||||
</el-select>
|
||||
</div>
|
||||
<el-button class="ml-16" type="primary"> {{ $t('common.create') }}</el-button>
|
||||
</div>
|
||||
</template>
|
||||
<div>
|
||||
<el-row v-if="applicationList.length > 0" :gutter="15">
|
||||
<!-- <template v-for="(item, index) in datasetFolderList" :key="index">
|
||||
<el-col :xs="24" :sm="12" :md="12" :lg="8" :xl="6" class="mb-16">
|
||||
<CardBox
|
||||
:title="item.name"
|
||||
:description="item.desc || $t('common.noData')"
|
||||
class="cursor"
|
||||
>
|
||||
<template #icon>
|
||||
<el-avatar shape="square" :size="32" style="background: none">
|
||||
<AppIcon iconName="app-folder" style="font-size: 32px"></AppIcon>
|
||||
</el-avatar>
|
||||
</template>
|
||||
<template #subTitle>
|
||||
<el-text class="color-secondary lighter" size="small">
|
||||
{{ $t('common.creator') }}: {{ item.username }}
|
||||
</el-text>
|
||||
</template>
|
||||
</CardBox>
|
||||
</el-col>
|
||||
</template> -->
|
||||
<template v-for="(item, index) in applicationList" :key="index">
|
||||
<el-col :xs="24" :sm="12" :md="12" :lg="8" :xl="6" class="mb-16">
|
||||
<CardBox
|
||||
:title="item.name"
|
||||
:description="item.desc"
|
||||
class="cursor"
|
||||
@click="router.push({ path: `/application/${item.id}/${item.type}/overview` })"
|
||||
>
|
||||
<template #icon>
|
||||
<LogoIcon height="28px" style="width: 28px; height: 28px; display: block" />
|
||||
</template>
|
||||
<template #subTitle>
|
||||
<el-text class="color-secondary" size="small">
|
||||
<auto-tooltip :content="item.username">
|
||||
{{ $t('common.creator') }}: {{ item.username }}
|
||||
</auto-tooltip>
|
||||
</el-text>
|
||||
</template>
|
||||
<div class="status-tag">
|
||||
<el-tag type="warning" v-if="isWorkFlow(item.type)" style="height: 22px">
|
||||
{{ $t('views.application.workflow') }}
|
||||
</el-tag>
|
||||
<el-tag class="blue-tag" v-else style="height: 22px">
|
||||
{{ $t('views.application.simple') }}
|
||||
</el-tag>
|
||||
</div>
|
||||
|
||||
<template #footer>
|
||||
<div class="footer-content">
|
||||
<el-tooltip
|
||||
effect="dark"
|
||||
:content="$t('views.application.setting.demo')"
|
||||
placement="top"
|
||||
>
|
||||
<el-button text @click.stop @click="getAccessToken(item.id)">
|
||||
<AppIcon iconName="app-view"></AppIcon>
|
||||
</el-button>
|
||||
</el-tooltip>
|
||||
<el-divider direction="vertical" />
|
||||
<el-tooltip effect="dark" :content="$t('common.setting')" placement="top">
|
||||
<el-button text @click.stop="settingApplication(item)">
|
||||
<AppIcon iconName="Setting"></AppIcon>
|
||||
</el-button>
|
||||
</el-tooltip>
|
||||
<el-divider direction="vertical" />
|
||||
<span @click.stop>
|
||||
<el-dropdown trigger="click">
|
||||
<el-button text @click.stop>
|
||||
<el-icon><MoreFilled /></el-icon>
|
||||
</el-button>
|
||||
<template #dropdown>
|
||||
<el-dropdown-menu>
|
||||
<el-dropdown-item
|
||||
v-if="is_show_copy_button(item)"
|
||||
@click="copyApplication(item)"
|
||||
>
|
||||
<AppIcon iconName="app-copy"></AppIcon>
|
||||
{{ $t('common.copy') }}
|
||||
</el-dropdown-item>
|
||||
<el-dropdown-item @click.stop="exportApplication(item)">
|
||||
<AppIcon iconName="app-export"></AppIcon>
|
||||
|
||||
{{ $t('common.export') }}
|
||||
</el-dropdown-item>
|
||||
<el-dropdown-item icon="Delete" @click.stop="deleteApplication(item)">{{
|
||||
$t('common.delete')
|
||||
}}</el-dropdown-item>
|
||||
</el-dropdown-menu>
|
||||
</template>
|
||||
</el-dropdown>
|
||||
</span>
|
||||
</div>
|
||||
</template>
|
||||
<template #mouseEnter>
|
||||
<div @click.stop>
|
||||
<el-dropdown trigger="click">
|
||||
<el-button text @click.stop>
|
||||
<el-icon><MoreFilled /></el-icon>
|
||||
|
|
@ -139,306 +148,133 @@
|
|||
<template #dropdown>
|
||||
<el-dropdown-menu>
|
||||
<el-dropdown-item
|
||||
v-if="is_show_copy_button(item)"
|
||||
@click="copyApplication(item)"
|
||||
icon="Refresh"
|
||||
@click.stop="syncDataset(item)"
|
||||
v-if="item.type === 1"
|
||||
>{{ $t('views.knowledge.setting.sync') }}</el-dropdown-item
|
||||
>
|
||||
<AppIcon iconName="app-copy"></AppIcon>
|
||||
{{ $t('common.copy') }}
|
||||
<el-dropdown-item @click.stop="reEmbeddingDataset(item)">
|
||||
<AppIcon iconName="app-vectorization"></AppIcon>
|
||||
{{ $t('views.knowledge.setting.vectorization') }}
|
||||
</el-dropdown-item>
|
||||
<el-dropdown-item @click.stop="exportApplication(item)">
|
||||
<AppIcon iconName="app-export"></AppIcon>
|
||||
<!--
|
||||
|
||||
{{ $t('common.export') }}
|
||||
</el-dropdown-item>
|
||||
<el-dropdown-item icon="Delete" @click.stop="deleteApplication(item)">{{
|
||||
<el-dropdown-item
|
||||
icon="Connection"
|
||||
@click.stop="openGenerateDialog(item)"
|
||||
>{{ $t('views.document.generateQuestion.title') }}</el-dropdown-item
|
||||
>
|
||||
<el-dropdown-item
|
||||
icon="Setting"
|
||||
@click.stop="router.push({ path: `/dataset/${item.id}/setting` })"
|
||||
>
|
||||
{{ $t('common.setting') }}</el-dropdown-item
|
||||
>
|
||||
<el-dropdown-item @click.stop="export_dataset(item)">
|
||||
<AppIcon iconName="app-export"></AppIcon
|
||||
>{{ $t('views.document.setting.export') }} Excel</el-dropdown-item
|
||||
>
|
||||
<el-dropdown-item @click.stop="export_zip_dataset(item)">
|
||||
<AppIcon iconName="app-export"></AppIcon
|
||||
>{{ $t('views.document.setting.export') }} ZIP</el-dropdown-item
|
||||
>
|
||||
<el-dropdown-item icon="Delete" @click.stop="deleteDataset(item)">{{
|
||||
$t('common.delete')
|
||||
}}</el-dropdown-item>
|
||||
}}</el-dropdown-item> -->
|
||||
</el-dropdown-menu>
|
||||
</template>
|
||||
</el-dropdown>
|
||||
</span>
|
||||
</div>
|
||||
</template>
|
||||
</CardBox>
|
||||
</el-col>
|
||||
</div>
|
||||
</template>
|
||||
</CardBox>
|
||||
</el-col>
|
||||
</template>
|
||||
</el-row>
|
||||
</InfiniteScroll>
|
||||
</div>
|
||||
<CreateApplicationDialog ref="CreateApplicationDialogRef" />
|
||||
<CopyApplicationDialog ref="CopyApplicationDialogRef" />
|
||||
</div>
|
||||
<el-empty :description="$t('common.noData')" v-else />
|
||||
</div>
|
||||
</ContentContainer>
|
||||
</LayoutContainer>
|
||||
</template>
|
||||
<script setup lang="ts">
|
||||
import { ref, onMounted, reactive } from 'vue'
|
||||
import applicationApi from '@/api/application'
|
||||
import CreateApplicationDialog from './component/CreateApplicationDialog.vue'
|
||||
import CopyApplicationDialog from './component/CopyApplicationDialog.vue'
|
||||
import { MsgSuccess, MsgConfirm, MsgAlert, MsgError } from '@/utils/message'
|
||||
import { isAppIcon } from '@/utils/common'
|
||||
import { useRouter } from 'vue-router'
|
||||
import { isWorkFlow } from '@/utils/application'
|
||||
import { ValidType, ValidCount } from '@/enums/common'
|
||||
import { t } from '@/locales'
|
||||
|
||||
<script lang="ts" setup>
|
||||
import { onMounted, ref, reactive, computed } from 'vue'
|
||||
import ApplicaitonApi from '@/api/application/application'
|
||||
import { MsgSuccess, MsgConfirm } from '@/utils/message'
|
||||
import useStore from '@/stores'
|
||||
import { numberFormat } from '@/utils/common'
|
||||
import { t } from '@/locales'
|
||||
import { useRouter } from 'vue-router'
|
||||
|
||||
const elUploadRef = ref<any>()
|
||||
const { application, user, common } = useStore()
|
||||
const router = useRouter()
|
||||
const { folder } = useStore()
|
||||
|
||||
const CopyApplicationDialogRef = ref()
|
||||
const CreateApplicationDialogRef = ref()
|
||||
const loading = ref(false)
|
||||
|
||||
const applicationList = ref<any[]>([])
|
||||
const search_type = ref('name')
|
||||
const search_form = ref<{
|
||||
name: string
|
||||
create_user: string
|
||||
}>({
|
||||
name: '',
|
||||
create_user: '',
|
||||
})
|
||||
|
||||
const user_options = ref<any[]>([])
|
||||
|
||||
const paginationConfig = reactive({
|
||||
current_page: 1,
|
||||
page_size: 30,
|
||||
total: 0
|
||||
total: 0,
|
||||
})
|
||||
|
||||
interface UserOption {
|
||||
label: string
|
||||
value: string
|
||||
}
|
||||
const folderList = ref<any[]>([])
|
||||
const applicationList = ref<any[]>([])
|
||||
const datasetFolderList = ref<any[]>([])
|
||||
const currentFolder = ref<any>({})
|
||||
|
||||
const userOptions = ref<UserOption[]>([])
|
||||
|
||||
const selectUserId = ref('all')
|
||||
|
||||
const searchValue = ref('')
|
||||
|
||||
const apiInputParams = ref([])
|
||||
|
||||
function copyApplication(row: any) {
|
||||
application.asyncGetApplicationDetail(row.id, loading).then((res: any) => {
|
||||
if (res?.data) {
|
||||
CopyApplicationDialogRef.value.open({ ...res.data, model_id: res.data.model })
|
||||
}
|
||||
function reEmbeddingDataset(row: any) {
|
||||
KnowledgeApi.putReEmbeddingDataset('default', row.id).then(() => {
|
||||
MsgSuccess(t('common.submitSuccess'))
|
||||
})
|
||||
}
|
||||
|
||||
const is_show_copy_button = (row: any) => {
|
||||
return user.userInfo ? user.userInfo.id == row.user_id : false
|
||||
const SyncWebDialogRef = ref()
|
||||
function syncDataset(row: any) {
|
||||
SyncWebDialogRef.value.open(row.id)
|
||||
}
|
||||
|
||||
function settingApplication(row: any) {
|
||||
if (isWorkFlow(row.type)) {
|
||||
router.push({ path: `/application/${row.id}/workflow` })
|
||||
} else {
|
||||
router.push({ path: `/application/${row.id}/${row.type}/setting` })
|
||||
}
|
||||
}
|
||||
|
||||
const exportApplication = (application: any) => {
|
||||
applicationApi.exportApplication(application.id, application.name, loading).catch((e) => {
|
||||
if (e.response.status !== 403) {
|
||||
e.response.data.text().then((res: string) => {
|
||||
MsgError(`${t('views.application.tip.ExportError')}:${JSON.parse(res).message}`)
|
||||
})
|
||||
}
|
||||
})
|
||||
}
|
||||
const importApplication = (file: any) => {
|
||||
const formData = new FormData()
|
||||
formData.append('file', file.raw, file.name)
|
||||
elUploadRef.value.clearFiles()
|
||||
applicationApi
|
||||
.importApplication(formData, loading)
|
||||
.then(async (res: any) => {
|
||||
if (res?.data) {
|
||||
searchHandle()
|
||||
}
|
||||
})
|
||||
.catch((e) => {
|
||||
if (e.code === 400) {
|
||||
MsgConfirm(t('common.tip'), t('views.application.tip.professionalMessage'), {
|
||||
cancelButtonText: t('common.confirm'),
|
||||
confirmButtonText: t('common.professional')
|
||||
}).then(() => {
|
||||
window.open('https://maxkb.cn/pricing.html', '_blank')
|
||||
})
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
function openCreateDialog() {
|
||||
common
|
||||
.asyncGetValid(ValidType.Application, ValidCount.Application, loading)
|
||||
.then(async (res: any) => {
|
||||
if (res?.data) {
|
||||
CreateApplicationDialogRef.value.open()
|
||||
} else if (res?.code === 400) {
|
||||
MsgConfirm(t('common.tip'), t('views.application.tip.professionalMessage'), {
|
||||
cancelButtonText: t('common.confirm'),
|
||||
confirmButtonText: t('common.professional')
|
||||
}).then(() => {
|
||||
window.open('https://maxkb.cn/pricing.html', '_blank')
|
||||
})
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
function searchHandle() {
|
||||
if (user.userInfo) {
|
||||
localStorage.setItem(user.userInfo.id + 'application', selectUserId.value)
|
||||
}
|
||||
applicationList.value = []
|
||||
paginationConfig.current_page = 1
|
||||
paginationConfig.total = 0
|
||||
getList()
|
||||
}
|
||||
|
||||
function mapToUrlParams(map: any[]) {
|
||||
const params = new URLSearchParams()
|
||||
|
||||
map.forEach((item: any) => {
|
||||
params.append(encodeURIComponent(item.name), encodeURIComponent(item.value))
|
||||
})
|
||||
|
||||
return params.toString() // 返回 URL 查询字符串
|
||||
}
|
||||
|
||||
function getAccessToken(id: string) {
|
||||
applicationList.value
|
||||
.filter((app) => app.id === id)[0]
|
||||
?.work_flow?.nodes?.filter((v: any) => v.id === 'base-node')
|
||||
.map((v: any) => {
|
||||
apiInputParams.value = v.properties.api_input_field_list
|
||||
? v.properties.api_input_field_list.map((v: any) => {
|
||||
return {
|
||||
name: v.variable,
|
||||
value: v.default_value
|
||||
}
|
||||
})
|
||||
: v.properties.input_field_list
|
||||
? v.properties.input_field_list
|
||||
.filter((v: any) => v.assignment_method === 'api_input')
|
||||
.map((v: any) => {
|
||||
return {
|
||||
name: v.variable,
|
||||
value: v.default_value
|
||||
}
|
||||
})
|
||||
: []
|
||||
})
|
||||
|
||||
const apiParams = mapToUrlParams(apiInputParams.value)
|
||||
? '?' + mapToUrlParams(apiInputParams.value)
|
||||
: ''
|
||||
application.asyncGetAccessToken(id, loading).then((res: any) => {
|
||||
window.open(application.location + res?.data?.access_token + apiParams)
|
||||
})
|
||||
}
|
||||
|
||||
function deleteApplication(row: any) {
|
||||
MsgConfirm(
|
||||
// @ts-ignore
|
||||
`${t('views.application.delete.confirmTitle')}${row.name} ?`,
|
||||
t('views.application.delete.confirmMessage'),
|
||||
{
|
||||
confirmButtonText: t('common.confirm'),
|
||||
cancelButtonText: t('common.cancel'),
|
||||
confirmButtonClass: 'danger'
|
||||
}
|
||||
)
|
||||
.then(() => {
|
||||
applicationApi.delApplication(row.id, loading).then(() => {
|
||||
const index = applicationList.value.findIndex((v) => v.id === row.id)
|
||||
applicationList.value.splice(index, 1)
|
||||
MsgSuccess(t('common.deleteSuccess'))
|
||||
})
|
||||
})
|
||||
.catch(() => {})
|
||||
const search_type_change = () => {
|
||||
search_form.value = { name: '', create_user: '' }
|
||||
}
|
||||
|
||||
function getList() {
|
||||
const params = {
|
||||
...(searchValue.value && { name: searchValue.value }),
|
||||
...(selectUserId.value &&
|
||||
selectUserId.value !== 'all' && { select_user_id: selectUserId.value })
|
||||
folder_id: currentFolder.value?.id || 'root',
|
||||
}
|
||||
applicationApi.getApplication(paginationConfig, params, loading).then((res) => {
|
||||
res.data.records.forEach((item: any) => {
|
||||
if (user.userInfo && item.user_id === user.userInfo.id) {
|
||||
item.username = user.userInfo.username
|
||||
} else {
|
||||
item.username = userOptions.value.find((v) => v.value === item.user_id)?.label
|
||||
}
|
||||
})
|
||||
applicationList.value = [...applicationList.value, ...res.data.records]
|
||||
ApplicaitonApi.getApplication('default', paginationConfig, params, loading).then((res) => {
|
||||
paginationConfig.total = res.data.total
|
||||
applicationList.value = [...applicationList.value, ...res.data.records]
|
||||
})
|
||||
}
|
||||
|
||||
function getUserList() {
|
||||
applicationApi.getUserList('APPLICATION', loading).then((res) => {
|
||||
if (res.data) {
|
||||
userOptions.value = res.data.map((item: any) => {
|
||||
return {
|
||||
label: item.username,
|
||||
value: item.id
|
||||
}
|
||||
})
|
||||
if (user.userInfo) {
|
||||
const selectUserIdValue = localStorage.getItem(user.userInfo.id + 'application')
|
||||
if (selectUserIdValue && userOptions.value.find((v) => v.value === selectUserIdValue)) {
|
||||
selectUserId.value = selectUserIdValue
|
||||
}
|
||||
}
|
||||
getList()
|
||||
}
|
||||
function getFolder() {
|
||||
const params = {}
|
||||
folder.asynGetFolder('default', 'APPLICATION', params, loading).then((res: any) => {
|
||||
folderList.value = res.data
|
||||
currentFolder.value = res.data?.[0] || {}
|
||||
getList()
|
||||
})
|
||||
}
|
||||
|
||||
function folderClickHandel(row: any) {
|
||||
currentFolder.value = row
|
||||
datasetFolderList.value = []
|
||||
getList()
|
||||
}
|
||||
|
||||
onMounted(() => {
|
||||
getUserList()
|
||||
getFolder()
|
||||
})
|
||||
</script>
|
||||
<style lang="scss" scoped>
|
||||
.application-card-add {
|
||||
width: 100%;
|
||||
font-size: 14px;
|
||||
min-height: var(--card-min-height);
|
||||
border: 1px dashed var(--el-border-color);
|
||||
background: var(--el-disabled-bg-color);
|
||||
border-radius: 8px;
|
||||
box-sizing: border-box;
|
||||
|
||||
&:hover {
|
||||
border: 1px solid var(--el-card-bg-color);
|
||||
background-color: var(--el-card-bg-color);
|
||||
}
|
||||
|
||||
.card-add-button {
|
||||
&:hover {
|
||||
border-radius: 4px;
|
||||
background: var(--app-text-color-light-1);
|
||||
}
|
||||
|
||||
:deep(.el-upload) {
|
||||
display: block;
|
||||
width: 100%;
|
||||
color: var(--el-text-color-regular);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.application-card {
|
||||
.status-tag {
|
||||
position: absolute;
|
||||
right: 16px;
|
||||
top: 15px;
|
||||
}
|
||||
}
|
||||
|
||||
.dropdown-custom-switch {
|
||||
padding: 5px 11px;
|
||||
font-size: 14px;
|
||||
font-weight: 400;
|
||||
|
||||
span {
|
||||
margin-right: 26px;
|
||||
}
|
||||
}
|
||||
</style>
|
||||
<style lang="scss" scoped></style>
|
||||
|
|
|
|||
|
|
@ -222,7 +222,7 @@ import { nextTick, ref, onMounted, computed } from 'vue'
|
|||
import { useRoute } from 'vue-router'
|
||||
import { cloneDeep } from 'lodash'
|
||||
import KnowledgeApi from '@/api/knowledge/knowledge'
|
||||
// import applicationApi from '@/api/application'
|
||||
// import applicationApi from '@/api/application/application'
|
||||
import ParagraphDialog from '@/views/paragraph/component/ParagraphDialog.vue'
|
||||
import { arraySort } from '@/utils/common'
|
||||
import emptyImg from '@/assets/hit-test-empty.png'
|
||||
|
|
|
|||
|
|
@ -171,7 +171,7 @@ import DropdownMenu from '@/views/application-workflow/component/DropdownMenu.vu
|
|||
import { set } from 'lodash'
|
||||
import { iconComponent } from '../icons/utils'
|
||||
import { copyClick } from '@/utils/clipboard'
|
||||
import { WorkflowType } from '@/enums/workflow'
|
||||
import { WorkflowType } from '@/enums/application'
|
||||
import { MsgError, MsgConfirm } from '@/utils/message'
|
||||
import type { FormInstance } from 'element-plus'
|
||||
import { t } from '@/locales'
|
||||
|
|
|
|||
|
|
@ -7,7 +7,7 @@ import { h as lh } from '@logicflow/core'
|
|||
import { createApp, h } from 'vue'
|
||||
import directives from '@/directives'
|
||||
import i18n from '@/locales'
|
||||
import { WorkflowType } from '@/enums/workflow'
|
||||
import { WorkflowType } from '@/enums/application'
|
||||
import { nodeDict } from '@/workflow/common/data'
|
||||
import { isActive, connect, disconnect } from './teleport'
|
||||
import { t } from '@/locales'
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
import { WorkflowType } from '@/enums/workflow'
|
||||
import { WorkflowType } from '@/enums/application'
|
||||
import { t } from '@/locales'
|
||||
|
||||
export const startNode = {
|
||||
|
|
|
|||
|
|
@ -1,7 +1,7 @@
|
|||
import type LogicFlow from '@logicflow/core'
|
||||
import { type GraphModel } from '@logicflow/core'
|
||||
import { MsgSuccess, MsgError, MsgConfirm } from '@/utils/message'
|
||||
import { WorkflowType } from '@/enums/workflow'
|
||||
import { WorkflowType } from '@/enums/application'
|
||||
import { t } from '@/locales'
|
||||
let selected: any | null = null
|
||||
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
import { WorkflowType } from '@/enums/workflow'
|
||||
import { WorkflowType } from '@/enums/application'
|
||||
import { t } from '@/locales'
|
||||
|
||||
const end_nodes: Array<string> = [
|
||||
|
|
|
|||
|
|
@ -178,7 +178,7 @@ import { app } from '@/main'
|
|||
import NodeContainer from '@/workflow/common/NodeContainer.vue'
|
||||
import type { FormInstance } from 'element-plus'
|
||||
import { ref, computed, onMounted } from 'vue'
|
||||
import applicationApi from '@/api/application'
|
||||
import applicationApi from '@/api/application/application'
|
||||
import useStore from '@/stores'
|
||||
import { isLastNode } from '@/workflow/common/data'
|
||||
import AIModeParamSettingDialog from '@/views/application/component/AIModeParamSettingDialog.vue'
|
||||
|
|
|
|||
|
|
@ -172,7 +172,7 @@ import NodeContainer from '@/workflow/common/NodeContainer.vue'
|
|||
import { ref, computed, onMounted, onActivated } from 'vue'
|
||||
import NodeCascader from '@/workflow/common/NodeCascader.vue'
|
||||
import type { FormInstance } from 'element-plus'
|
||||
import applicationApi from '@/api/application'
|
||||
import applicationApi from '@/api/application/application'
|
||||
import { isWorkFlow } from '@/utils/application'
|
||||
|
||||
const form = {
|
||||
|
|
|
|||
|
|
@ -182,7 +182,7 @@ import { groupBy, set } from 'lodash'
|
|||
import NodeContainer from '@/workflow/common/NodeContainer.vue'
|
||||
import type { FormInstance } from 'element-plus'
|
||||
import { ref, computed, onMounted } from 'vue'
|
||||
import applicationApi from '@/api/application'
|
||||
import applicationApi from '@/api/application/application'
|
||||
import { MsgError, MsgSuccess, MsgWarning } from '@/utils/message'
|
||||
import { t } from '@/locales'
|
||||
import TTSModeParamSettingDialog from '@/views/application/component/TTSModeParamSettingDialog.vue'
|
||||
|
|
|
|||
|
|
@ -89,7 +89,7 @@ import NodeCascader from '@/workflow/common/NodeCascader.vue'
|
|||
import type { FormInstance } from 'element-plus'
|
||||
import { ref, computed, onMounted } from 'vue'
|
||||
import { isLastNode } from '@/workflow/common/data'
|
||||
import applicationApi from '@/api/application'
|
||||
import applicationApi from '@/api/application/application'
|
||||
import { app } from '@/main'
|
||||
const props = defineProps<{ nodeModel: any }>()
|
||||
|
||||
|
|
|
|||
|
|
@ -156,7 +156,7 @@
|
|||
import NodeContainer from '@/workflow/common/NodeContainer.vue'
|
||||
import { computed, onMounted, ref } from 'vue'
|
||||
import { groupBy, set } from 'lodash'
|
||||
import applicationApi from '@/api/application'
|
||||
import applicationApi from '@/api/application/application'
|
||||
import { app } from '@/main'
|
||||
import useStore from '@/stores'
|
||||
import type { FormInstance } from 'element-plus'
|
||||
|
|
|
|||
|
|
@ -174,7 +174,7 @@
|
|||
import NodeContainer from '@/workflow/common/NodeContainer.vue'
|
||||
import { computed, onMounted, ref } from 'vue'
|
||||
import { groupBy, set } from 'lodash'
|
||||
import applicationApi from '@/api/application'
|
||||
import applicationApi from '@/api/application/application'
|
||||
import { app } from '@/main'
|
||||
import useStore from '@/stores'
|
||||
import NodeCascader from '@/workflow/common/NodeCascader.vue'
|
||||
|
|
|
|||
|
|
@ -209,7 +209,7 @@ import { cloneDeep, set } from 'lodash'
|
|||
import NodeContainer from '@/workflow/common/NodeContainer.vue'
|
||||
import { computed, onMounted, ref } from 'vue'
|
||||
import { isLastNode } from '@/workflow/common/data'
|
||||
import applicationApi from '@/api/application'
|
||||
import applicationApi from '@/api/application/application'
|
||||
import { t } from '@/locales'
|
||||
import { MsgError, MsgSuccess } from '@/utils/message'
|
||||
import TooltipLabel from '@/components/dynamics-form/items/label/TooltipLabel.vue'
|
||||
|
|
|
|||
|
|
@ -141,7 +141,7 @@ import NodeContainer from '@/workflow/common/NodeContainer.vue'
|
|||
import AIModeParamSettingDialog from '@/views/application/component/AIModeParamSettingDialog.vue'
|
||||
import type { FormInstance } from 'element-plus'
|
||||
import { ref, computed, onMounted } from 'vue'
|
||||
import applicationApi from '@/api/application'
|
||||
import applicationApi from '@/api/application/application'
|
||||
import useStore from '@/stores'
|
||||
import { isLastNode } from '@/workflow/common/data'
|
||||
import { t } from '@/locales'
|
||||
|
|
|
|||
|
|
@ -173,7 +173,7 @@ import NodeCascader from '@/workflow/common/NodeCascader.vue'
|
|||
import ParamSettingDialog from './ParamSettingDialog.vue'
|
||||
import { ref, computed, onMounted } from 'vue'
|
||||
|
||||
import applicationApi from '@/api/application'
|
||||
import applicationApi from '@/api/application/application'
|
||||
import useStore from '@/stores'
|
||||
import { app } from '@/main'
|
||||
|
||||
|
|
|
|||
|
|
@ -99,7 +99,7 @@
|
|||
import NodeContainer from '@/workflow/common/NodeContainer.vue'
|
||||
import { computed, onMounted, ref } from 'vue'
|
||||
import { groupBy, set } from 'lodash'
|
||||
import applicationApi from '@/api/application'
|
||||
import applicationApi from '@/api/application/application'
|
||||
import { app } from '@/main'
|
||||
import useStore from '@/stores'
|
||||
import NodeCascader from '@/workflow/common/NodeCascader.vue'
|
||||
|
|
|
|||
|
|
@ -108,7 +108,7 @@
|
|||
import NodeContainer from '@/workflow/common/NodeContainer.vue'
|
||||
import { computed, onMounted, ref } from 'vue'
|
||||
import { groupBy, set } from 'lodash'
|
||||
import applicationApi from '@/api/application'
|
||||
import applicationApi from '@/api/application/application'
|
||||
import { app } from '@/main'
|
||||
import useStore from '@/stores'
|
||||
import NodeCascader from '@/workflow/common/NodeCascader.vue'
|
||||
|
|
|
|||
Loading…
Reference in New Issue