feat:国际化view/application页面
This commit is contained in:
parent
dcc8e28c71
commit
1a7359b20c
@ -35,7 +35,7 @@
|
|||||||
@click="toUrl('https://bbs.fit2cloud.com/c/mk/11')"
|
@click="toUrl('https://bbs.fit2cloud.com/c/mk/11')"
|
||||||
></AppIcon>
|
></AppIcon>
|
||||||
</el-tooltip>
|
</el-tooltip>
|
||||||
<el-dropdown v-if="true" trigger="click" type="primary">
|
<el-dropdown v-if="false" trigger="click" type="primary">
|
||||||
<template #dropdown>
|
<template #dropdown>
|
||||||
<el-dropdown-menu>
|
<el-dropdown-menu>
|
||||||
<el-dropdown-item
|
<el-dropdown-item
|
||||||
|
|||||||
103
ui/src/locales/lang/en_US/views/application.ts
Normal file
103
ui/src/locales/lang/en_US/views/application.ts
Normal file
@ -0,0 +1,103 @@
|
|||||||
|
export default {
|
||||||
|
applicationList: {
|
||||||
|
title: "Applications",
|
||||||
|
searchBar: {
|
||||||
|
placeholder: "Search by name",
|
||||||
|
},
|
||||||
|
card: {
|
||||||
|
createApplication: "Create Application",
|
||||||
|
overview: "Overview",
|
||||||
|
demo: "Demo",
|
||||||
|
setting: "Settings",
|
||||||
|
delete: {
|
||||||
|
tooltip: "Delete",
|
||||||
|
confirmTitle: "Are you sure you want to delete this application?",
|
||||||
|
confirmMessage: "Deleting this application will no longer provide its services. Please proceed with caution.",
|
||||||
|
confirmButton: "Delete",
|
||||||
|
cancelButton: "Cancel",
|
||||||
|
successMessage: "Successfully deleted"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
tooltips: {
|
||||||
|
demo: "Demo",
|
||||||
|
setting: "Settings",
|
||||||
|
delete: "Delete"
|
||||||
|
},
|
||||||
|
},
|
||||||
|
applicationForm: {
|
||||||
|
title: {
|
||||||
|
create: "Create Application",
|
||||||
|
edit: "Edit Settings",
|
||||||
|
info:"Application Information"
|
||||||
|
},
|
||||||
|
form: {
|
||||||
|
appName: {
|
||||||
|
label: "Application Name",
|
||||||
|
placeholder: "Please enter the application name",
|
||||||
|
requiredMessage: "Application name is required"
|
||||||
|
},
|
||||||
|
appDescription: {
|
||||||
|
label: "Application Description",
|
||||||
|
placeholder: "Describe the application scenario and use, e.g.: MaxKB assistant answering user questions about MaxKB product usage"
|
||||||
|
},
|
||||||
|
aiModel: {
|
||||||
|
label: "AI Model",
|
||||||
|
placeholder: "Please select an AI model",
|
||||||
|
unavailable: "(Unavailable)"
|
||||||
|
},
|
||||||
|
prompt: {
|
||||||
|
label: "Prompt",
|
||||||
|
placeholder: "Please enter prompt",
|
||||||
|
tooltip: "By adjusting the content of the prompt, you can guide the direction of the large model conversation. This prompt will be fixed at the beginning of the context. Variables used: {data} carries known information from the knowledge base; {question} is the question posed by the user."
|
||||||
|
},
|
||||||
|
multipleRoundsDialogue: "Multiple Rounds Dialogue",
|
||||||
|
relatedKnowledgeBase: "Related Knowledge Base",
|
||||||
|
relatedKnowledgeBaseWhere: "Associated knowledge bases are displayed here",
|
||||||
|
prologue: "Prologue",
|
||||||
|
problemOptimization: {
|
||||||
|
label: "Problem Optimization",
|
||||||
|
tooltip: "Optimize the current question based on historical chat to better match knowledge points."
|
||||||
|
},
|
||||||
|
addModel: "Add Model",
|
||||||
|
paramSetting: "Parameter Settings",
|
||||||
|
add: "Add",
|
||||||
|
apptest:"Debug Preview"
|
||||||
|
},
|
||||||
|
buttons: {
|
||||||
|
confirm:"Confirm",
|
||||||
|
cancel: "Cancel",
|
||||||
|
create: "Create",
|
||||||
|
createSuccess: "Create Success",
|
||||||
|
save: "Save",
|
||||||
|
saveSuccess: "Save Success"
|
||||||
|
},
|
||||||
|
dialogues: {
|
||||||
|
addDataset: "Add Related Knowledge Base",
|
||||||
|
removeDataset: "Remove Knowledge Base",
|
||||||
|
paramSettings: "Parameter Settings",
|
||||||
|
refresh: "Refresh",
|
||||||
|
selectSearchMode: "Search Mode",
|
||||||
|
vectorSearch: "Vector Search",
|
||||||
|
vectorSearchTooltip: "Vector search is a retrieval method based on vector distance calculations, suitable for large data volumes in the knowledge base.",
|
||||||
|
fullTextSearch: "Full-text Search",
|
||||||
|
fullTextSearchTooltip: "Full-text search is a retrieval method based on text similarity, suitable for small data volumes in the knowledge base.",
|
||||||
|
hybridSearch: "Hybrid Search",
|
||||||
|
hybridSearchTooltip: "Hybrid search is a retrieval method based on both vector and text similarity, suitable for medium data volumes in the knowledge base.",
|
||||||
|
similarityThreshold: "Similarity Threshold",
|
||||||
|
topReferences: "Top N References",
|
||||||
|
maxCharacters: "Maximum Characters per Reference",
|
||||||
|
noReferencesAction: "When there are no knowledge base references",
|
||||||
|
continueQuestioning: "Continue Questioning AI Model",
|
||||||
|
provideAnswer: "Provide a Specific Answer",
|
||||||
|
prompt: "Prompt",
|
||||||
|
promptPlaceholder:"Please enter a prompt",
|
||||||
|
concent:"Content",
|
||||||
|
concentPlaceholder:"Please enter content",
|
||||||
|
designated_answer:"Hello, I am MaxKB Assistant. My knowledge base only contains information related to MaxKB products. Please rephrase your question."
|
||||||
|
}
|
||||||
|
},
|
||||||
|
prompt:{
|
||||||
|
defaultPrompt:"Known information:\n{{data}}\nResponse requirements:\n- Please use concise and professional language to answer the user's question.\n- If you do not know the answer, reply, \"No relevant information was found in the knowledge base; it is recommended to consult technical support or refer to the official documentation for operations.\"\n- Avoid mentioning that your knowledge is obtained from known information.\n- Ensure the answer is consistent with the information described in the known data.\n- Please use Markdown syntax to optimize the format of the answer.\n- Directly return any images, link addresses, and script languages found in the known information.\n- Please respond in the same language as the question.\nQuestion:\n{question}",
|
||||||
|
defaultPrologue:"Hello, I am MaxKB Assistant. You can ask me questions about using MaxKB.\n- What are the main features of MaxKB?\n- Which large language models does MaxKB support?\n- What document types does MaxKB support?"
|
||||||
|
}
|
||||||
|
};
|
||||||
@ -1,5 +1,6 @@
|
|||||||
import notFound from './404';
|
import notFound from './404';
|
||||||
|
import application from './application';
|
||||||
export default {
|
export default {
|
||||||
notFound,
|
notFound,
|
||||||
|
application,
|
||||||
};
|
};
|
||||||
|
|||||||
103
ui/src/locales/lang/zh_CN/views/application.ts
Normal file
103
ui/src/locales/lang/zh_CN/views/application.ts
Normal file
@ -0,0 +1,103 @@
|
|||||||
|
export default {
|
||||||
|
applicationList: {
|
||||||
|
title: "应用",
|
||||||
|
searchBar: {
|
||||||
|
placeholder: "按名称搜索",
|
||||||
|
},
|
||||||
|
card: {
|
||||||
|
createApplication: "创建应用",
|
||||||
|
overview: "概览",
|
||||||
|
demo: "演示",
|
||||||
|
setting: "设置",
|
||||||
|
delete: {
|
||||||
|
tooltip: "删除",
|
||||||
|
confirmTitle: "是否删除应用:",
|
||||||
|
confirmMessage: "删除后该应用将不再提供服务,请谨慎操作。",
|
||||||
|
confirmButton: "删除",
|
||||||
|
cancelButton: "取消",
|
||||||
|
successMessage: "删除成功"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
tooltips: {
|
||||||
|
demo: "演示",
|
||||||
|
setting: "设置",
|
||||||
|
delete: "删除"
|
||||||
|
},
|
||||||
|
},
|
||||||
|
applicationForm: {
|
||||||
|
title: {
|
||||||
|
create: "创建应用",
|
||||||
|
edit: "设置",
|
||||||
|
info:"应用信息"
|
||||||
|
},
|
||||||
|
form: {
|
||||||
|
appName: {
|
||||||
|
label: "应用名称",
|
||||||
|
placeholder: "请输入应用名称",
|
||||||
|
requiredMessage: "请输入应用名称"
|
||||||
|
},
|
||||||
|
appDescription: {
|
||||||
|
label: "应用描述",
|
||||||
|
placeholder: "描述该应用的应用场景及用途,如:MaxKB 小助手回答用户提出的 MaxKB 产品使用问题"
|
||||||
|
},
|
||||||
|
aiModel: {
|
||||||
|
label: "AI 模型",
|
||||||
|
placeholder: "请选择 AI 模型",
|
||||||
|
unavailable: "(不可用)"
|
||||||
|
},
|
||||||
|
prompt: {
|
||||||
|
label: "提示词",
|
||||||
|
placeholder: "请输入提示词",
|
||||||
|
tooltip: "通过调整提示词内容,可以引导大模型聊天方向,该提示词会被固定在上下文的开头。可以使用变量:{data} 是携带知识库中已知信息;{question}是用户提出的问题。"
|
||||||
|
},
|
||||||
|
multipleRoundsDialogue: "多轮对话",
|
||||||
|
relatedKnowledgeBase: "关联知识库",
|
||||||
|
relatedKnowledgeBaseWhere: "关联知识库展示在这里",
|
||||||
|
prologue: "开场白",
|
||||||
|
problemOptimization: {
|
||||||
|
label: "问题优化",
|
||||||
|
tooltip: "根据历史聊天优化完善当前问题,更利于匹配知识点。"
|
||||||
|
},
|
||||||
|
addModel: "添加模型",
|
||||||
|
paramSetting: "参数设置",
|
||||||
|
add: "添加",
|
||||||
|
apptest:"调试预览"
|
||||||
|
},
|
||||||
|
buttons: {
|
||||||
|
confirm:"确认",
|
||||||
|
cancel: "取消",
|
||||||
|
create: "创建",
|
||||||
|
createSuccess: "创建",
|
||||||
|
save: "保存",
|
||||||
|
saveSuccess: "保存"
|
||||||
|
},
|
||||||
|
dialogues: {
|
||||||
|
addDataset: "添加关联知识库",
|
||||||
|
removeDataset: "移除知识库",
|
||||||
|
paramSettings: "参数设置",
|
||||||
|
refresh: "刷新",
|
||||||
|
selectSearchMode: "检索模式",
|
||||||
|
vectorSearch: "向量检索",
|
||||||
|
vectorSearchTooltip: "向量检索是一种基于向量相似度的检索方式,适用于知识库中的大数据量场景。",
|
||||||
|
fullTextSearch: "全文检索",
|
||||||
|
fullTextSearchTooltip: "全文检索是一种基于文本相似度的检索方式,适用于知识库中的小数据量场景。",
|
||||||
|
hybridSearch: "混合检索",
|
||||||
|
hybridSearchTooltip: "混合检索是一种基于向量和文本相似度的检索方式,适用于知识库中的中等数据量场景。",
|
||||||
|
similarityThreshold: "相似度高于",
|
||||||
|
topReferences: "引用分段数 TOP",
|
||||||
|
maxCharacters: "最多引用字符数",
|
||||||
|
noReferencesAction: "无引用知识库分段时",
|
||||||
|
continueQuestioning: "继续向 AI 模型提问",
|
||||||
|
provideAnswer: "指定回答内容",
|
||||||
|
prompt: "提示词",
|
||||||
|
promptPlaceholder:"请输入提示词",
|
||||||
|
concent:"内容",
|
||||||
|
concentPlaceholder:"请输入内容",
|
||||||
|
designated_answer:"你好,我是 MaxKB 小助手,我的知识库只包含了 MaxKB 产品相关知识,请重新描述您的问题。"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
prompt:{
|
||||||
|
defaultPrompt:"已知信息:\n {{data}} \n回答要求:\n- 请使用简洁且专业的语言来回答用户的问题。\n- 如果你不知道答案,请回答“没有在知识库中查找到相关信息,建议咨询相关技术支持或参考官方文档进行操作”。\n- 避免提及你是从已知信息中获得的知识。\n- 请保证答案与已知信息中描述的一致。\n- 请使用 Markdown 语法优化答案的格式。\n- 已知信息中的图片、链接地址和脚本语言请直接返回。\n- 请使用与问题相同的语言来回答。\n问题:\n{question}",
|
||||||
|
defaultPrologue:"您好,我是 MaxKB 小助手,您可以向我提出 MaxKB 使用问题。\n- MaxKB 主要功能有什么?\n- MaxKB 支持哪些大语言模型?\n- MaxKB 支持哪些文档类型?"
|
||||||
|
}
|
||||||
|
};
|
||||||
@ -1,5 +1,6 @@
|
|||||||
import notFound from './404';
|
import notFound from './404';
|
||||||
|
import application from './application';
|
||||||
export default {
|
export default {
|
||||||
notFound,
|
notFound,
|
||||||
|
application,
|
||||||
};
|
};
|
||||||
|
|||||||
@ -1,13 +1,13 @@
|
|||||||
<template>
|
<template>
|
||||||
<LayoutContainer
|
<LayoutContainer
|
||||||
:header="id ? '设置' : '创建应用'"
|
:header="id ? $t('views.application.applicationForm.title.edit'): $t('views.application.applicationForm.title.create')"
|
||||||
:back-to="id ? '' : '-1'"
|
:back-to="id ? '' : '-1'"
|
||||||
class="create-application"
|
class="create-application"
|
||||||
>
|
>
|
||||||
<el-row v-loading="loading">
|
<el-row v-loading="loading">
|
||||||
<el-col :span="10">
|
<el-col :span="10">
|
||||||
<div class="p-24 mb-16" style="padding-bottom: 0">
|
<div class="p-24 mb-16" style="padding-bottom: 0">
|
||||||
<h4 class="title-decoration-1">应用信息</h4>
|
<h4 class="title-decoration-1">{{$t('views.application.applicationForm.title.info')}}</h4>
|
||||||
</div>
|
</div>
|
||||||
<div class="scrollbar-height-left">
|
<div class="scrollbar-height-left">
|
||||||
<el-scrollbar>
|
<el-scrollbar>
|
||||||
@ -24,36 +24,36 @@
|
|||||||
<el-form-item prop="name">
|
<el-form-item prop="name">
|
||||||
<template #label>
|
<template #label>
|
||||||
<div class="flex-between">
|
<div class="flex-between">
|
||||||
<span>应用名称 <span class="danger">*</span></span>
|
<span>{{$t('views.application.applicationForm.form.appName.label')}} <span class="danger">*</span></span>
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
<el-input
|
<el-input
|
||||||
v-model="applicationForm.name"
|
v-model="applicationForm.name"
|
||||||
maxlength="64"
|
maxlength="64"
|
||||||
placeholder="请输入应用名称"
|
:placeholder="$t('views.application.applicationForm.form.appName.placeholder')"
|
||||||
show-word-limit
|
show-word-limit
|
||||||
/>
|
/>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item label="应用描述">
|
<el-form-item :label="$t('views.application.applicationForm.form.appDescription.label')">
|
||||||
<el-input
|
<el-input
|
||||||
v-model="applicationForm.desc"
|
v-model="applicationForm.desc"
|
||||||
type="textarea"
|
type="textarea"
|
||||||
placeholder="描述该应用的应用场景及用途,如:MaxKB 小助手回答用户提出的 MaxKB 产品使用问题"
|
:placeholder="$t('views.application.applicationForm.form.appDescription.placeholder')"
|
||||||
:rows="3"
|
:rows="3"
|
||||||
maxlength="256"
|
maxlength="256"
|
||||||
show-word-limit
|
show-word-limit
|
||||||
/>
|
/>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
|
|
||||||
<el-form-item label="AI 模型" prop="model_id">
|
<el-form-item :label="$t('views.application.applicationForm.form.aiModel.label')" prop="model_id">
|
||||||
<template #label>
|
<template #label>
|
||||||
<div class="flex-between">
|
<div class="flex-between">
|
||||||
<span>AI 模型 </span>
|
<span>{{$t('views.application.applicationForm.form.aiModel.label')}}</span>
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
<el-select
|
<el-select
|
||||||
v-model="applicationForm.model_id"
|
v-model="applicationForm.model_id"
|
||||||
placeholder="请选择 AI 模型"
|
:placeholder="$t('views.application.applicationForm.form.aiModel.placeholder')"
|
||||||
class="w-full"
|
class="w-full"
|
||||||
popper-class="select-model"
|
popper-class="select-model"
|
||||||
:clearable="true"
|
:clearable="true"
|
||||||
@ -96,7 +96,7 @@
|
|||||||
class="model-icon mr-8"
|
class="model-icon mr-8"
|
||||||
></span>
|
></span>
|
||||||
<span>{{ item.name }}</span>
|
<span>{{ item.name }}</span>
|
||||||
<span class="danger">(不可用)</span>
|
<span class="danger">{{$t('views.application.applicationForm.form.aiModel.unavailable')}}</span>
|
||||||
</div>
|
</div>
|
||||||
<el-icon class="check-icon" v-if="item.id === applicationForm.model_id"
|
<el-icon class="check-icon" v-if="item.id === applicationForm.model_id"
|
||||||
><Check
|
><Check
|
||||||
@ -106,22 +106,21 @@
|
|||||||
<template #footer>
|
<template #footer>
|
||||||
<div class="w-full text-left cursor" @click="openCreateModel()">
|
<div class="w-full text-left cursor" @click="openCreateModel()">
|
||||||
<el-button type="primary" link>
|
<el-button type="primary" link>
|
||||||
<el-icon class="mr-4"><Plus /></el-icon> 添加模型
|
<el-icon class="mr-4"><Plus /></el-icon> {{$t('views.application.applicationForm.form.addModel')}}
|
||||||
</el-button>
|
</el-button>
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
</el-select>
|
</el-select>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item label="提示词" prop="model_setting.prompt">
|
<el-form-item :label="$t('views.application.applicationForm.form.prompt.label')" prop="model_setting.prompt">
|
||||||
<template #label>
|
<template #label>
|
||||||
<div class="flex align-center">
|
<div class="flex align-center">
|
||||||
<div class="flex-between mr-4">
|
<div class="flex-between mr-4">
|
||||||
<span>提示词 <span class="danger">*</span></span>
|
<span>{{$t('views.application.applicationForm.form.prompt.label')}} <span class="danger">*</span></span>
|
||||||
</div>
|
</div>
|
||||||
<el-tooltip effect="dark" placement="right">
|
<el-tooltip effect="dark" placement="right">
|
||||||
<template #content
|
<template #content
|
||||||
>通过调整提示词内容,可以引导大模型聊天方向,该提示词会被固定在上下文的开头。<br />可以使用变量:{data}
|
>{{$t('views.application.applicationForm.form.prompt.tooltip')}}</template
|
||||||
是携带知识库中已知信息;{question}是用户提出的问题。</template
|
|
||||||
>
|
>
|
||||||
<AppIcon iconName="app-warning" class="app-warning-icon"></AppIcon>
|
<AppIcon iconName="app-warning" class="app-warning-icon"></AppIcon>
|
||||||
</el-tooltip>
|
</el-tooltip>
|
||||||
@ -135,29 +134,29 @@
|
|||||||
:placeholder="defaultPrompt"
|
:placeholder="defaultPrompt"
|
||||||
/>
|
/>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item label="多轮对话" @click.prevent>
|
<el-form-item :label="$t('views.application.applicationForm.form.multipleRoundsDialogue')" @click.prevent>
|
||||||
<el-switch
|
<el-switch
|
||||||
size="small"
|
size="small"
|
||||||
v-model="applicationForm.multiple_rounds_dialogue"
|
v-model="applicationForm.multiple_rounds_dialogue"
|
||||||
></el-switch>
|
></el-switch>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item label="关联知识库">
|
<el-form-item label="$t('views.application.applicationForm.form.relatedKnowledgeBase')">
|
||||||
<template #label>
|
<template #label>
|
||||||
<div class="flex-between">
|
<div class="flex-between">
|
||||||
<span>关联知识库</span>
|
<span>{{$t('views.application.applicationForm.form.relatedKnowledgeBase')}}</span>
|
||||||
<div>
|
<div>
|
||||||
<el-button type="primary" link @click="openParamSettingDialog">
|
<el-button type="primary" link @click="openParamSettingDialog">
|
||||||
<AppIcon iconName="app-operation" class="mr-4"></AppIcon>参数设置
|
<AppIcon iconName="app-operation" class="mr-4"></AppIcon>{{$t('views.application.applicationForm.form.paramSetting')}}
|
||||||
</el-button>
|
</el-button>
|
||||||
<el-button type="primary" link @click="openDatasetDialog">
|
<el-button type="primary" link @click="openDatasetDialog">
|
||||||
<el-icon class="mr-4"><Plus /></el-icon>添加
|
<el-icon class="mr-4"><Plus /></el-icon>{{$t('views.application.applicationForm.form.add')}}
|
||||||
</el-button>
|
</el-button>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
<div class="w-full">
|
<div class="w-full">
|
||||||
<el-text type="info" v-if="applicationForm.dataset_id_list?.length === 0"
|
<el-text type="info" v-if="applicationForm.dataset_id_list?.length === 0"
|
||||||
>关联的知识库展示在这里</el-text
|
>{{$t('views.application.applicationForm.form.relatedKnowledgeBaseWhere')}}</el-text
|
||||||
>
|
>
|
||||||
<el-row :gutter="12" v-else>
|
<el-row :gutter="12" v-else>
|
||||||
<el-col
|
<el-col
|
||||||
@ -198,7 +197,7 @@
|
|||||||
</el-row>
|
</el-row>
|
||||||
</div>
|
</div>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item label="开场白">
|
<el-form-item :label="$t('views.application.applicationForm.form.prologue')">
|
||||||
<MdEditor
|
<MdEditor
|
||||||
class="prologue-md-editor"
|
class="prologue-md-editor"
|
||||||
v-model="applicationForm.prologue"
|
v-model="applicationForm.prologue"
|
||||||
@ -210,10 +209,10 @@
|
|||||||
<el-form-item @click.prevent>
|
<el-form-item @click.prevent>
|
||||||
<template #label>
|
<template #label>
|
||||||
<div class="flex align-center">
|
<div class="flex align-center">
|
||||||
<span class="mr-4">问题优化</span>
|
<span class="mr-4">{{$t('views.application.applicationForm.form.problemOptimization.label')}}</span>
|
||||||
<el-tooltip
|
<el-tooltip
|
||||||
effect="dark"
|
effect="dark"
|
||||||
content="根据历史聊天优化完善当前问题,更利于匹配知识点。"
|
:content="$t('views.application.applicationForm.form.problemOptimization.tooltip')"
|
||||||
placement="right"
|
placement="right"
|
||||||
>
|
>
|
||||||
<AppIcon iconName="app-warning" class="app-warning-icon"></AppIcon>
|
<AppIcon iconName="app-warning" class="app-warning-icon"></AppIcon>
|
||||||
@ -226,16 +225,16 @@
|
|||||||
</el-scrollbar>
|
</el-scrollbar>
|
||||||
</div>
|
</div>
|
||||||
<div class="text-right border-t p-16">
|
<div class="text-right border-t p-16">
|
||||||
<el-button v-if="!id" @click="router.push({ path: `/application` })"> 取消 </el-button>
|
<el-button v-if="!id" @click="router.push({ path: `/application` })">{{$t('views.application.applicationForm.buttons.cancel')}} </el-button>
|
||||||
<el-button type="primary" @click="submit(applicationFormRef)" :disabled="loading">
|
<el-button type="primary" @click="submit(applicationFormRef)" :disabled="loading">
|
||||||
{{ id ? '保存' : '创建' }}
|
{{ id ? $t('views.application.applicationForm.buttons.save') : $t('views.application.applicationForm.buttons.create') }}
|
||||||
</el-button>
|
</el-button>
|
||||||
</div>
|
</div>
|
||||||
</el-col>
|
</el-col>
|
||||||
<el-col :span="14" class="p-24 border-l">
|
<el-col :span="14" class="p-24 border-l">
|
||||||
<h4 class="title-decoration-1 mb-16">调试预览</h4>
|
<h4 class="title-decoration-1 mb-16">{{$t('views.application.applicationForm.form.apptest')}}</h4>
|
||||||
<div class="dialog-bg">
|
<div class="dialog-bg">
|
||||||
<h4 class="p-24">{{ applicationForm?.name || '应用名称' }}</h4>
|
<h4 class="p-24">{{ applicationForm?.name || $t('views.application.applicationForm.form.appName.label') }}</h4>
|
||||||
<div class="scrollbar-height">
|
<div class="scrollbar-height">
|
||||||
<AiChat :data="applicationForm"></AiChat>
|
<AiChat :data="applicationForm"></AiChat>
|
||||||
</div>
|
</div>
|
||||||
@ -277,7 +276,7 @@ import type { Provider } from '@/api/type/model'
|
|||||||
import { relatedObject } from '@/utils/utils'
|
import { relatedObject } from '@/utils/utils'
|
||||||
import { MsgSuccess } from '@/utils/message'
|
import { MsgSuccess } from '@/utils/message'
|
||||||
import useStore from '@/stores'
|
import useStore from '@/stores'
|
||||||
|
import { t } from '@/locales'
|
||||||
const { model, dataset, application, user } = useStore()
|
const { model, dataset, application, user } = useStore()
|
||||||
|
|
||||||
const router = useRouter()
|
const router = useRouter()
|
||||||
@ -285,20 +284,8 @@ const route = useRoute()
|
|||||||
const {
|
const {
|
||||||
params: { id }
|
params: { id }
|
||||||
} = route as any
|
} = route as any
|
||||||
|
// @ts-ignore
|
||||||
const defaultPrompt = `已知信息:
|
const defaultPrompt =t('views.application.prompt.defaultPrompt')
|
||||||
{data}
|
|
||||||
回答要求:
|
|
||||||
- 请使用简洁且专业的语言来回答用户的问题。
|
|
||||||
- 如果你不知道答案,请回答“没有在知识库中查找到相关信息,建议咨询相关技术支持或参考官方文档进行操作”。
|
|
||||||
- 避免提及你是从已知信息中获得的知识。
|
|
||||||
- 请保证答案与已知信息中描述的一致。
|
|
||||||
- 请使用 Markdown 语法优化答案的格式。
|
|
||||||
- 已知信息中的图片、链接地址和脚本语言请直接返回。
|
|
||||||
- 请使用与问题相同的语言来回答。
|
|
||||||
问题:
|
|
||||||
{question}
|
|
||||||
`
|
|
||||||
|
|
||||||
const ParamSettingDialogRef = ref<InstanceType<typeof ParamSettingDialog>>()
|
const ParamSettingDialogRef = ref<InstanceType<typeof ParamSettingDialog>>()
|
||||||
const createModelRef = ref<InstanceType<typeof CreateModelDialog>>()
|
const createModelRef = ref<InstanceType<typeof CreateModelDialog>>()
|
||||||
@ -314,10 +301,7 @@ const applicationForm = ref<ApplicationFormType>({
|
|||||||
desc: '',
|
desc: '',
|
||||||
model_id: '',
|
model_id: '',
|
||||||
multiple_rounds_dialogue: false,
|
multiple_rounds_dialogue: false,
|
||||||
prologue: `您好,我是 MaxKB 小助手,您可以向我提出 MaxKB 使用问题。
|
prologue: t('views.application.prompt.defaultPrologue'),
|
||||||
- MaxKB 主要功能有什么?
|
|
||||||
- MaxKB 支持哪些大语言模型?
|
|
||||||
- MaxKB 支持哪些文档类型?`,
|
|
||||||
dataset_id_list: [],
|
dataset_id_list: [],
|
||||||
dataset_setting: {
|
dataset_setting: {
|
||||||
top_n: 3,
|
top_n: 3,
|
||||||
@ -336,15 +320,15 @@ const applicationForm = ref<ApplicationFormType>({
|
|||||||
})
|
})
|
||||||
|
|
||||||
const rules = reactive<FormRules<ApplicationFormType>>({
|
const rules = reactive<FormRules<ApplicationFormType>>({
|
||||||
name: [{ required: true, message: '请输入应用名称', trigger: 'blur' }],
|
name: [{ required: true, message: t('views.application.applicationForm.appName.placeholder'), trigger: 'blur' }],
|
||||||
model_id: [
|
model_id: [
|
||||||
{
|
{
|
||||||
required: false,
|
required: false,
|
||||||
message: '请选择模型',
|
message: t('views.application.applicationForm.aiModel.placeholder'),
|
||||||
trigger: 'change'
|
trigger: 'change'
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
'model_setting.prompt': [{ required: true, message: '请输入提示词', trigger: 'blur' }]
|
'model_setting.prompt': [{ required: true, message:t('views.application.applicationForm.prompt.placeholder'), trigger: 'blur' }]
|
||||||
})
|
})
|
||||||
const modelOptions = ref<any>(null)
|
const modelOptions = ref<any>(null)
|
||||||
const providerOptions = ref<Array<Provider>>([])
|
const providerOptions = ref<Array<Provider>>([])
|
||||||
@ -356,11 +340,11 @@ const submit = async (formEl: FormInstance | undefined) => {
|
|||||||
if (valid) {
|
if (valid) {
|
||||||
if (id) {
|
if (id) {
|
||||||
application.asyncPutApplication(id, applicationForm.value, loading).then((res) => {
|
application.asyncPutApplication(id, applicationForm.value, loading).then((res) => {
|
||||||
MsgSuccess('保存成功')
|
MsgSuccess(t('views.application.buttons.saveSuccess'))
|
||||||
})
|
})
|
||||||
} else {
|
} else {
|
||||||
applicationApi.postApplication(applicationForm.value, loading).then((res) => {
|
applicationApi.postApplication(applicationForm.value, loading).then((res) => {
|
||||||
MsgSuccess('创建成功')
|
MsgSuccess(t('views.application.buttons.createSuccess'))
|
||||||
router.push({ path: `/application` })
|
router.push({ path: `/application` })
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|||||||
@ -1,10 +1,10 @@
|
|||||||
<template>
|
<template>
|
||||||
<el-dialog title="添加关联知识库" v-model="dialogVisible" width="600">
|
<el-dialog :title="$t('views.application.applicationForm.dialogues.addDataset')" v-model="dialogVisible" width="600">
|
||||||
<template #header="{ titleId, titleClass }">
|
<template #header="{ titleId, titleClass }">
|
||||||
<div class="my-header flex">
|
<div class="my-header flex">
|
||||||
<h4 :id="titleId" :class="titleClass">添加关联知识库</h4>
|
<h4 :id="titleId" :class="titleClass">{{$t('views.application.applicationForm.dialogues.addDataset')}}</h4>
|
||||||
<el-button link class="ml-16" @click="refresh">
|
<el-button link class="ml-16" @click="refresh">
|
||||||
<el-icon class="mr-4"><Refresh /></el-icon>刷新
|
<el-icon class="mr-4"><Refresh /></el-icon>{{$t('views.application.applicationForm.dialogues.refresh')}}
|
||||||
</el-button>
|
</el-button>
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
@ -19,8 +19,8 @@
|
|||||||
</el-row>
|
</el-row>
|
||||||
<template #footer>
|
<template #footer>
|
||||||
<span class="dialog-footer">
|
<span class="dialog-footer">
|
||||||
<el-button @click.prevent="dialogVisible = false"> 取消 </el-button>
|
<el-button @click.prevent="dialogVisible = false"> {{$t('views.application.applicationForm.buttons.cancel')}} </el-button>
|
||||||
<el-button type="primary" @click="submitHandle"> 确认 </el-button>
|
<el-button type="primary" @click="submitHandle"> {{$t('views.application.applicationForm.buttons.confirm')}} </el-button>
|
||||||
</span>
|
</span>
|
||||||
</template>
|
</template>
|
||||||
</el-dialog>
|
</el-dialog>
|
||||||
|
|||||||
@ -1,7 +1,7 @@
|
|||||||
<template>
|
<template>
|
||||||
<el-dialog
|
<el-dialog
|
||||||
align-center
|
align-center
|
||||||
title="参数设置"
|
:title="$t('views.application.applicationForm.dialogues.paramSettings')"
|
||||||
class="param-dialog"
|
class="param-dialog"
|
||||||
v-model="dialogVisible"
|
v-model="dialogVisible"
|
||||||
style="width: 550px"
|
style="width: 550px"
|
||||||
@ -10,7 +10,7 @@
|
|||||||
<el-scrollbar always>
|
<el-scrollbar always>
|
||||||
<div class="p-16">
|
<div class="p-16">
|
||||||
<el-form label-position="top" ref="paramFormRef" :model="form">
|
<el-form label-position="top" ref="paramFormRef" :model="form">
|
||||||
<el-form-item label="检索模式">
|
<el-form-item :label="$t('views.application.applicationForm.dialogues.selectSearchMode')">
|
||||||
<el-radio-group v-model="form.search_mode" class="card__radio" @change="changeHandle">
|
<el-radio-group v-model="form.search_mode" class="card__radio" @change="changeHandle">
|
||||||
<el-card
|
<el-card
|
||||||
shadow="never"
|
shadow="never"
|
||||||
@ -18,8 +18,8 @@
|
|||||||
:class="form.search_mode === 'embedding' ? 'active' : ''"
|
:class="form.search_mode === 'embedding' ? 'active' : ''"
|
||||||
>
|
>
|
||||||
<el-radio value="embedding" size="large">
|
<el-radio value="embedding" size="large">
|
||||||
<p class="mb-4">向量检索</p>
|
<p class="mb-4">{{$t('views.application.applicationForm.dialogues.vectorSearch')}}</p>
|
||||||
<el-text type="info">通过向量距离计算与用户问题最相似的文本分段</el-text>
|
<el-text type="info">{{$t('views.application.applicationForm.dialogues.vectorSearchTooltip')}}</el-text>
|
||||||
</el-radio>
|
</el-radio>
|
||||||
</el-card>
|
</el-card>
|
||||||
<el-card
|
<el-card
|
||||||
@ -28,15 +28,15 @@
|
|||||||
:class="form.search_mode === 'keywords' ? 'active' : ''"
|
:class="form.search_mode === 'keywords' ? 'active' : ''"
|
||||||
>
|
>
|
||||||
<el-radio value="keywords" size="large">
|
<el-radio value="keywords" size="large">
|
||||||
<p class="mb-4">全文检索</p>
|
<p class="mb-4">{{$t('views.application.applicationForm.dialogues.fullTextSearch')}}</p>
|
||||||
<el-text type="info">通过关键词检索,返回包含关键词最多的文本分段</el-text>
|
<el-text type="info">{{$t('views.application.applicationForm.dialogues.fullTextSearchTooltip')}}</el-text>
|
||||||
</el-radio>
|
</el-radio>
|
||||||
</el-card>
|
</el-card>
|
||||||
<el-card shadow="never" :class="form.search_mode === 'blend' ? 'active' : ''">
|
<el-card shadow="never" :class="form.search_mode === 'blend' ? 'active' : ''">
|
||||||
<el-radio value="blend" size="large">
|
<el-radio value="blend" size="large">
|
||||||
<p class="mb-4">混合检索</p>
|
<p class="mb-4">{{$t('views.application.applicationForm.dialogues.hybridSearch')}}</p>
|
||||||
<el-text type="info"
|
<el-text type="info"
|
||||||
>同时执行全文检索和向量检索,再进行重排序,从两类查询结果中选择匹配用户问题的最佳结果</el-text
|
>{{$t('views.application.applicationForm.dialogues.hybridSearcTooltip')}}</el-text
|
||||||
>
|
>
|
||||||
</el-radio>
|
</el-radio>
|
||||||
</el-card>
|
</el-card>
|
||||||
@ -47,7 +47,7 @@
|
|||||||
<el-form-item>
|
<el-form-item>
|
||||||
<template #label>
|
<template #label>
|
||||||
<div class="flex align-center">
|
<div class="flex align-center">
|
||||||
<span class="mr-4">相似度高于</span>
|
<span class="mr-4">{{$t('views.application.applicationForm.dialogues.similarityThreshold')}}</span>
|
||||||
<el-tooltip effect="dark" content="相似度越高相关性越强。" placement="right">
|
<el-tooltip effect="dark" content="相似度越高相关性越强。" placement="right">
|
||||||
<AppIcon iconName="app-warning" class="app-warning-icon"></AppIcon>
|
<AppIcon iconName="app-warning" class="app-warning-icon"></AppIcon>
|
||||||
</el-tooltip>
|
</el-tooltip>
|
||||||
@ -65,7 +65,7 @@
|
|||||||
</el-form-item>
|
</el-form-item>
|
||||||
</el-col>
|
</el-col>
|
||||||
<el-col :span="12">
|
<el-col :span="12">
|
||||||
<el-form-item label="引用分段数 TOP">
|
<el-form-item :label="$t('views.application.applicationForm.dialogues.topReferences')">
|
||||||
<el-input-number
|
<el-input-number
|
||||||
v-model="form.top_n"
|
v-model="form.top_n"
|
||||||
:min="1"
|
:min="1"
|
||||||
@ -77,7 +77,7 @@
|
|||||||
</el-col>
|
</el-col>
|
||||||
</el-row>
|
</el-row>
|
||||||
|
|
||||||
<el-form-item label="最多引用字符数">
|
<el-form-item :label="$t('views.application.applicationForm.dialogues.maxCharacters')">
|
||||||
<el-slider
|
<el-slider
|
||||||
v-model="form.max_paragraph_char_number"
|
v-model="form.max_paragraph_char_number"
|
||||||
show-input
|
show-input
|
||||||
@ -87,7 +87,7 @@
|
|||||||
class="custom-slider"
|
class="custom-slider"
|
||||||
/>
|
/>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item label="无引用知识库分段时">
|
<el-form-item :label="$t('views.application.applicationForm.dialogues.noReferencesAction')">
|
||||||
<el-form
|
<el-form
|
||||||
label-position="top"
|
label-position="top"
|
||||||
ref="noReferencesformRef"
|
ref="noReferencesformRef"
|
||||||
@ -102,10 +102,10 @@
|
|||||||
>
|
>
|
||||||
<div>
|
<div>
|
||||||
<el-radio value="ai_questioning">
|
<el-radio value="ai_questioning">
|
||||||
<p>继续向 AI 模型提问</p>
|
<p>{{$t('views.application.applicationForm.dialogues.continueQuestioning')}}</p>
|
||||||
<el-form-item
|
<el-form-item
|
||||||
v-if="form.no_references_setting.status === 'ai_questioning'"
|
v-if="form.no_references_setting.status === 'ai_questioning'"
|
||||||
label="提示词"
|
:label="$t('views.application.applicationForm.form.prompt.label')"
|
||||||
prop="ai_questioning"
|
prop="ai_questioning"
|
||||||
>
|
>
|
||||||
<el-input
|
<el-input
|
||||||
@ -120,7 +120,7 @@
|
|||||||
</div>
|
</div>
|
||||||
<div class="mt-8">
|
<div class="mt-8">
|
||||||
<el-radio value="designated_answer">
|
<el-radio value="designated_answer">
|
||||||
<p>指定回答内容</p>
|
<p>{{$t('views.application.applicationForm.dialogues.provideAnswer')}}</p>
|
||||||
<el-form-item
|
<el-form-item
|
||||||
v-if="form.no_references_setting.status === 'designated_answer'"
|
v-if="form.no_references_setting.status === 'designated_answer'"
|
||||||
prop="designated_answer"
|
prop="designated_answer"
|
||||||
@ -144,9 +144,9 @@
|
|||||||
</div>
|
</div>
|
||||||
<template #footer>
|
<template #footer>
|
||||||
<span class="dialog-footer p-16">
|
<span class="dialog-footer p-16">
|
||||||
<el-button @click.prevent="dialogVisible = false"> 取消 </el-button>
|
<el-button @click.prevent="dialogVisible = false">{{$t('views.application.applicationForm.buttons.cancel')}}</el-button>
|
||||||
<el-button type="primary" @click="submit(noReferencesformRef)" :loading="loading">
|
<el-button type="primary" @click="submit(noReferencesformRef)" :loading="loading">
|
||||||
保存
|
{{$t('views.application.applicationForm.buttons.save')}}
|
||||||
</el-button>
|
</el-button>
|
||||||
</span>
|
</span>
|
||||||
</template>
|
</template>
|
||||||
@ -156,7 +156,7 @@
|
|||||||
import { ref, watch, reactive } from 'vue'
|
import { ref, watch, reactive } from 'vue'
|
||||||
import { cloneDeep } from 'lodash'
|
import { cloneDeep } from 'lodash'
|
||||||
import type { FormInstance, FormRules } from 'element-plus'
|
import type { FormInstance, FormRules } from 'element-plus'
|
||||||
|
import { t } from '@/locales'
|
||||||
const emit = defineEmits(['refresh'])
|
const emit = defineEmits(['refresh'])
|
||||||
|
|
||||||
const paramFormRef = ref()
|
const paramFormRef = ref()
|
||||||
@ -164,8 +164,8 @@ const noReferencesformRef = ref()
|
|||||||
|
|
||||||
const defaultValue = {
|
const defaultValue = {
|
||||||
ai_questioning: '{question}',
|
ai_questioning: '{question}',
|
||||||
designated_answer:
|
// @ts-ignore
|
||||||
'你好,我是 MaxKB 小助手,我的知识库只包含了 MaxKB 产品相关知识,请重新描述您的问题。'
|
designated_answer:t('views.application.applicationForm.dialogues.designated_answer')
|
||||||
}
|
}
|
||||||
|
|
||||||
const form = ref<any>({
|
const form = ref<any>({
|
||||||
@ -185,8 +185,8 @@ const noReferencesform = ref<any>({
|
|||||||
})
|
})
|
||||||
|
|
||||||
const noReferencesRules = reactive<FormRules<any>>({
|
const noReferencesRules = reactive<FormRules<any>>({
|
||||||
ai_questioning: [{ required: true, message: '请输入提示词', trigger: 'blur' }],
|
ai_questioning: [{ required: true, message: t('views.application.applicationForm.dialogues.promptPlaceholder'), trigger: 'blur' }],
|
||||||
designated_answer: [{ required: true, message: '请输入内容', trigger: 'blur' }]
|
designated_answer: [{ required: true, message: t('views.application.applicationForm.dialogues.concentPlaceholder'), trigger: 'blur' }]
|
||||||
})
|
})
|
||||||
|
|
||||||
const dialogVisible = ref<boolean>(false)
|
const dialogVisible = ref<boolean>(false)
|
||||||
|
|||||||
@ -1,11 +1,11 @@
|
|||||||
<template>
|
<template>
|
||||||
<div class="application-list-container p-24" style="padding-top: 16px">
|
<div class="application-list-container p-24" style="padding-top: 16px">
|
||||||
<div class="flex-between mb-16">
|
<div class="flex-between mb-16">
|
||||||
<h3>应用</h3>
|
<h3>{{$t('views.application.applicationList.title')}}</h3>
|
||||||
<el-input
|
<el-input
|
||||||
v-model="searchValue"
|
v-model="searchValue"
|
||||||
@change="searchHandle"
|
@change="searchHandle"
|
||||||
placeholder="按名称搜索"
|
:placeholder="$t('views.application.applicationList.searchBar.placeholder')"
|
||||||
prefix-icon="Search"
|
prefix-icon="Search"
|
||||||
class="w-240"
|
class="w-240"
|
||||||
clearable
|
clearable
|
||||||
@ -22,7 +22,7 @@
|
|||||||
>
|
>
|
||||||
<el-row :gutter="15">
|
<el-row :gutter="15">
|
||||||
<el-col :xs="24" :sm="12" :md="8" :lg="6" :xl="4" class="mb-16">
|
<el-col :xs="24" :sm="12" :md="8" :lg="6" :xl="4" class="mb-16">
|
||||||
<CardAdd title="创建应用" @click="router.push({ path: '/application/create' })" />
|
<CardAdd :title="$t('views.application.applicationList.card.createApplication')" @click="router.push({ path: '/application/create' })" />
|
||||||
</el-col>
|
</el-col>
|
||||||
<el-col
|
<el-col
|
||||||
:xs="24"
|
:xs="24"
|
||||||
@ -62,13 +62,13 @@
|
|||||||
|
|
||||||
<template #footer>
|
<template #footer>
|
||||||
<div class="footer-content">
|
<div class="footer-content">
|
||||||
<el-tooltip effect="dark" content="演示" placement="top">
|
<el-tooltip effect="dark" :content="$t('views.application.applicationList.card.demo')" placement="top">
|
||||||
<el-button text @click.stop @click="getAccessToken(item.id)">
|
<el-button text @click.stop @click="getAccessToken(item.id)">
|
||||||
<AppIcon iconName="app-view"></AppIcon>
|
<AppIcon iconName="app-view"></AppIcon>
|
||||||
</el-button>
|
</el-button>
|
||||||
</el-tooltip>
|
</el-tooltip>
|
||||||
<el-divider direction="vertical" />
|
<el-divider direction="vertical" />
|
||||||
<el-tooltip effect="dark" content="设置" placement="top">
|
<el-tooltip effect="dark" :content="$t('views.application.applicationList.card.setting')" placement="top">
|
||||||
<el-button
|
<el-button
|
||||||
text
|
text
|
||||||
@click.stop="router.push({ path: `/application/${item.id}/setting` })"
|
@click.stop="router.push({ path: `/application/${item.id}/setting` })"
|
||||||
@ -77,7 +77,7 @@
|
|||||||
</el-button>
|
</el-button>
|
||||||
</el-tooltip>
|
</el-tooltip>
|
||||||
<el-divider direction="vertical" />
|
<el-divider direction="vertical" />
|
||||||
<el-tooltip effect="dark" content="删除" placement="top">
|
<el-tooltip effect="dark" :content="$t('views.application.applicationList.card.delete.tooltip')" placement="top">
|
||||||
<el-button text @click.stop="deleteApplication(item)">
|
<el-button text @click.stop="deleteApplication(item)">
|
||||||
<el-icon><Delete /></el-icon>
|
<el-icon><Delete /></el-icon>
|
||||||
</el-button>
|
</el-button>
|
||||||
@ -98,6 +98,7 @@ import { MsgSuccess, MsgConfirm } from '@/utils/message'
|
|||||||
import { isAppIcon } from '@/utils/application'
|
import { isAppIcon } from '@/utils/application'
|
||||||
import { useRouter } from 'vue-router'
|
import { useRouter } from 'vue-router'
|
||||||
import useStore from '@/stores'
|
import useStore from '@/stores'
|
||||||
|
import { t } from '@/locales'
|
||||||
const { application } = useStore()
|
const { application } = useStore()
|
||||||
const router = useRouter()
|
const router = useRouter()
|
||||||
|
|
||||||
@ -126,15 +127,19 @@ function getAccessToken(id: string) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
function deleteApplication(row: any) {
|
function deleteApplication(row: any) {
|
||||||
MsgConfirm(`是否删除应用:${row.name} ?`, `删除后该应用将不再提供服务,请谨慎操作。`, {
|
MsgConfirm(
|
||||||
confirmButtonText: '删除',
|
// @ts-ignore
|
||||||
confirmButtonClass: 'danger'
|
`${t('views.application.applicationList.card.delete.confirmTitle')}:${row.name} ?`,
|
||||||
})
|
t('views.application.applicationList.card.delete.confirmMessage'), {
|
||||||
|
confirmButtonText: t('views.application.applicationList.card.delete.confirmButton'),
|
||||||
|
cancelButtonText: t('views.application.applicationList.card.delete.cancelButton'),
|
||||||
|
confirmButtonClass: 'danger'
|
||||||
|
})
|
||||||
.then(() => {
|
.then(() => {
|
||||||
applicationApi.delApplication(row.id, loading).then(() => {
|
applicationApi.delApplication(row.id, loading).then(() => {
|
||||||
const index = applicationList.value.findIndex((v) => v.id === row.id)
|
const index = applicationList.value.findIndex((v) => v.id === row.id)
|
||||||
applicationList.value.splice(index, 1)
|
applicationList.value.splice(index, 1)
|
||||||
MsgSuccess('删除成功')
|
MsgSuccess(t('views.application.applicationList.card.delete.successMessage'))
|
||||||
})
|
})
|
||||||
})
|
})
|
||||||
.catch(() => {})
|
.catch(() => {})
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user