|
@@ -1,21 +1,27 @@
|
|
|
<template>
|
|
|
<div class="chat-container">
|
|
|
- <el-collapse v-model="activeNames" v-if="$route.name !== 'ai'">
|
|
|
- <el-collapse-item title="应用配置" name="1">
|
|
|
- <div class="header" style="margin-top: 15px">
|
|
|
- <el-form
|
|
|
- :inline="true"
|
|
|
- :model="AIform"
|
|
|
- :rules="rules"
|
|
|
- ref="AIformRef"
|
|
|
- class="demo-form-inline"
|
|
|
- style="margin-top: 15px"
|
|
|
- label-position="right"
|
|
|
- label-width="90px"
|
|
|
- >
|
|
|
- <el-row :gutter="24">
|
|
|
- <el-col :span="8">
|
|
|
- <!-- <el-form-item label="模型库:" prop="modelLibrary">
|
|
|
+ <el-dialog
|
|
|
+ title="应用配置"
|
|
|
+ :visible.sync="applicationDialogVisible"
|
|
|
+ width="80%"
|
|
|
+ :before-close="handleCloseApplicationDialog"
|
|
|
+ :close-on-click-modal="false"
|
|
|
+ :append-to-body="true"
|
|
|
+ >
|
|
|
+ <div class="header" style="margin-top: 15px">
|
|
|
+ <el-form
|
|
|
+ :inline="true"
|
|
|
+ :model="AIform"
|
|
|
+ :rules="rules"
|
|
|
+ ref="AIformRef"
|
|
|
+ class="demo-form-inline"
|
|
|
+ style="margin-top: 15px"
|
|
|
+ label-position="right"
|
|
|
+ label-width="90px"
|
|
|
+ >
|
|
|
+ <el-row :gutter="24">
|
|
|
+ <el-col :span="8">
|
|
|
+ <!-- <el-form-item label="模型库:" prop="modelLibrary">
|
|
|
<el-select
|
|
|
v-model="AIform.modelLibrary"
|
|
|
placeholder="ollama"
|
|
@@ -24,15 +30,15 @@
|
|
|
<el-option label="ollama" value="ollama"></el-option>
|
|
|
</el-select>
|
|
|
</el-form-item> -->
|
|
|
- <el-form-item label="应用名称:" prop="chat_name">
|
|
|
- <el-input
|
|
|
- v-model="AIform.chat_name"
|
|
|
- placeholder="请输入应用名称"
|
|
|
- ></el-input>
|
|
|
- </el-form-item>
|
|
|
- </el-col>
|
|
|
- <el-col :span="8">
|
|
|
- <!-- <el-form-item label="模型类型:" prop="model_type">
|
|
|
+ <el-form-item label="应用名称:" prop="chat_name">
|
|
|
+ <el-input
|
|
|
+ v-model="AIform.chat_name"
|
|
|
+ placeholder="请输入应用名称"
|
|
|
+ ></el-input>
|
|
|
+ </el-form-item>
|
|
|
+ </el-col>
|
|
|
+ <el-col :span="8">
|
|
|
+ <!-- <el-form-item label="模型类型:" prop="model_type">
|
|
|
<el-select
|
|
|
v-model="AIform.model_type"
|
|
|
placeholder="请输入选择"
|
|
@@ -41,108 +47,124 @@
|
|
|
<el-option label="chat" value="chat"></el-option>
|
|
|
</el-select>
|
|
|
</el-form-item> -->
|
|
|
- <el-form-item label="模型名称:" prop="model_name">
|
|
|
- <el-select
|
|
|
- v-model="AIform.model_name"
|
|
|
- placeholder="请输入选择"
|
|
|
- style="width: 100%"
|
|
|
- >
|
|
|
- <el-option
|
|
|
- v-for="(item, index) in modelNameList"
|
|
|
- :label="item.name"
|
|
|
- :value="item.name"
|
|
|
- :key="index"
|
|
|
- ></el-option>
|
|
|
- </el-select>
|
|
|
- </el-form-item>
|
|
|
- </el-col>
|
|
|
- <el-col :span="8">
|
|
|
- <el-form-item label="知识库:" prop="knowledge_base_names">
|
|
|
- <el-select
|
|
|
- v-model="AIform.knowledge_base_names"
|
|
|
- multiple
|
|
|
- placeholder="请选择知识库"
|
|
|
- style="width: 100%"
|
|
|
- @change="handleKnowledgeBaseChange"
|
|
|
- >
|
|
|
- <el-option
|
|
|
- v-for="(item, index) in kneList"
|
|
|
- :label="item.name"
|
|
|
- :value="item.id"
|
|
|
- :key="index"
|
|
|
- ></el-option>
|
|
|
- </el-select> </el-form-item
|
|
|
- ></el-col>
|
|
|
- </el-row>
|
|
|
- <el-row :gutter="24">
|
|
|
- <el-col :span="8">
|
|
|
- <el-form-item label="文档目录:" prop="document_directories">
|
|
|
- <el-select
|
|
|
- v-model="AIform.document_directories"
|
|
|
- placeholder="请选择文档目录"
|
|
|
- style="width: 100%"
|
|
|
- :disabled="!AIform.knowledge_base_names.length"
|
|
|
- @change="handleDirectoryChange"
|
|
|
- >
|
|
|
- <el-option
|
|
|
- v-for="(dir, index) in directoryList"
|
|
|
- :label="dir.name"
|
|
|
- :value="dir.id"
|
|
|
- :key="index"
|
|
|
- ></el-option>
|
|
|
- </el-select> </el-form-item
|
|
|
- ></el-col>
|
|
|
- <el-col :span="8">
|
|
|
- <el-form-item label="文 档:" prop="documents">
|
|
|
- <el-select
|
|
|
- v-model="AIform.documents"
|
|
|
- multiple
|
|
|
- placeholder="请选择文档"
|
|
|
- style="width: 100%"
|
|
|
- :disabled="!AIform.document_directories"
|
|
|
- >
|
|
|
- <el-option
|
|
|
- v-for="(doc, index) in documentList"
|
|
|
- :label="doc.name"
|
|
|
- :value="doc.id"
|
|
|
- :key="index"
|
|
|
- ></el-option>
|
|
|
- </el-select>
|
|
|
- </el-form-item>
|
|
|
- </el-col>
|
|
|
- <el-col :span="8">
|
|
|
- <el-form-item label="描 述:">
|
|
|
- <el-input
|
|
|
- v-model="AIform.role_description"
|
|
|
- type="textarea"
|
|
|
- style="width: 350px"
|
|
|
- ></el-input>
|
|
|
- </el-form-item>
|
|
|
- </el-col>
|
|
|
- </el-row>
|
|
|
- </el-form>
|
|
|
- <div class="selection-summary">
|
|
|
- <div class="summary-content">
|
|
|
- <span class="summary-label">当前选择了:</span>
|
|
|
- <p class="summary-text">
|
|
|
- 模型库: OLLAMA 模型类型: CHAT 模型名称:
|
|
|
- <span>{{ AIform.model_name }}</span>
|
|
|
- </p>
|
|
|
- <p class="summary-text">
|
|
|
- 知识库:<span>{{ getKnowledgeBaseNames }}</span> 文档:
|
|
|
- <span>{{ getDocumentNames }}</span>
|
|
|
- </p>
|
|
|
- </div>
|
|
|
- <el-button
|
|
|
+ <el-form-item label="模型名称:" prop="model_name">
|
|
|
+ <el-select
|
|
|
+ v-model="AIform.model_name"
|
|
|
+ placeholder="请输入选择"
|
|
|
+ style="width: 100%"
|
|
|
+ clearable
|
|
|
+ >
|
|
|
+ <el-option
|
|
|
+ v-for="(item, index) in modelNameList"
|
|
|
+ :label="item.name"
|
|
|
+ :value="item.name"
|
|
|
+ :key="index"
|
|
|
+ ></el-option>
|
|
|
+ </el-select>
|
|
|
+ </el-form-item>
|
|
|
+ </el-col>
|
|
|
+ <el-col :span="8">
|
|
|
+ <el-form-item label="知识库:" prop="knowledge_base_names">
|
|
|
+ <el-select
|
|
|
+ v-model="AIform.knowledge_base_names"
|
|
|
+ multiple
|
|
|
+ placeholder="请选择知识库"
|
|
|
+ style="width: 100%"
|
|
|
+ @change="handleKnowledgeBaseChange"
|
|
|
+ clearable
|
|
|
+ filterable
|
|
|
+ >
|
|
|
+ <el-option
|
|
|
+ v-for="(item, index) in kneList"
|
|
|
+ :label="item.name"
|
|
|
+ :value="item.id"
|
|
|
+ :key="index"
|
|
|
+ ></el-option>
|
|
|
+ </el-select> </el-form-item
|
|
|
+ ></el-col>
|
|
|
+ </el-row>
|
|
|
+ <el-row :gutter="24">
|
|
|
+ <el-col :span="8">
|
|
|
+ <el-form-item label="文档目录:" prop="document_directories">
|
|
|
+ <el-select
|
|
|
+ v-model="AIform.document_directories"
|
|
|
+ placeholder="请选择文档目录"
|
|
|
+ style="width: 100%"
|
|
|
+ :disabled="!AIform.knowledge_base_names.length"
|
|
|
+ @change="handleDirectoryChange"
|
|
|
+ clearable
|
|
|
+ filterable
|
|
|
+ >
|
|
|
+ <el-option
|
|
|
+ v-for="(dir, index) in directoryList"
|
|
|
+ :label="dir.name"
|
|
|
+ :value="dir.id"
|
|
|
+ :key="index"
|
|
|
+ ></el-option>
|
|
|
+ </el-select> </el-form-item
|
|
|
+ ></el-col>
|
|
|
+ <el-col :span="8">
|
|
|
+ <el-form-item label="文 档:" prop="documents">
|
|
|
+ <el-select
|
|
|
+ v-model="AIform.documents"
|
|
|
+ multiple
|
|
|
+ placeholder="请选择文档"
|
|
|
+ style="width: 100%"
|
|
|
+ :disabled="isDocumentSelectDisabled"
|
|
|
+ clearable
|
|
|
+ filterable
|
|
|
+ >
|
|
|
+ <el-option
|
|
|
+ v-for="(doc, index) in documentList"
|
|
|
+ :label="doc.name"
|
|
|
+ :value="doc.id"
|
|
|
+ :key="index"
|
|
|
+ ></el-option>
|
|
|
+ </el-select>
|
|
|
+ </el-form-item>
|
|
|
+ </el-col>
|
|
|
+ <el-col :span="8">
|
|
|
+ <el-form-item label="描 述:">
|
|
|
+ <el-input
|
|
|
+ v-model="AIform.role_description"
|
|
|
+ type="textarea"
|
|
|
+ style="width: 350px"
|
|
|
+ ></el-input>
|
|
|
+ </el-form-item>
|
|
|
+ </el-col>
|
|
|
+ </el-row>
|
|
|
+ </el-form>
|
|
|
+ <div class="selection-summary">
|
|
|
+ <div class="summary-content">
|
|
|
+ <span class="summary-label">当前选择了:</span>
|
|
|
+ <p class="summary-text">
|
|
|
+ 模型库: OLLAMA 模型类型: CHAT 模型名称:
|
|
|
+ <span>{{ AIform.model_name }}</span>
|
|
|
+ </p>
|
|
|
+ <p class="summary-text">
|
|
|
+ 知识库:<span>{{ getKnowledgeBaseNames }}</span> 文档:
|
|
|
+ <span>{{ getDocumentNames }}</span>
|
|
|
+ </p>
|
|
|
+ </div>
|
|
|
+ <!-- <el-button
|
|
|
type="primary"
|
|
|
class="generate-button"
|
|
|
@click="generateApplication"
|
|
|
>生成应用</el-button
|
|
|
- >
|
|
|
- </div>
|
|
|
+ > -->
|
|
|
</div>
|
|
|
- </el-collapse-item></el-collapse
|
|
|
- >
|
|
|
+ </div>
|
|
|
+ <span slot="footer" class="dialog-footer">
|
|
|
+ <el-button @click="cancelApplication">取 消</el-button>
|
|
|
+ <el-button type="primary" @click="generateApplication"
|
|
|
+ >生成应用</el-button
|
|
|
+ >
|
|
|
+ </span>
|
|
|
+ </el-dialog>
|
|
|
+ <div class="header_btn">
|
|
|
+ <el-button type="primary" @click="addApplication">新增应用</el-button>
|
|
|
+ </div>
|
|
|
+
|
|
|
<div class="title" v-if="$route.name !== 'ai'">
|
|
|
<h1>聊天应用列表</h1>
|
|
|
<!-- <span class="title_info">选择其他应用</span> -->
|
|
@@ -158,7 +180,9 @@
|
|
|
<i class="el-icon-more"></i>
|
|
|
</span>
|
|
|
<el-dropdown-menu slot="dropdown">
|
|
|
- <el-dropdown-item @click.native="viewApplication(card)">查看</el-dropdown-item>
|
|
|
+ <el-dropdown-item @click.native="viewApplication(card)"
|
|
|
+ >查看</el-dropdown-item
|
|
|
+ >
|
|
|
<el-dropdown-item @click.native="editApplication(card)"
|
|
|
>编辑</el-dropdown-item
|
|
|
>
|
|
@@ -297,6 +321,7 @@
|
|
|
v-model="editForm.model_name"
|
|
|
placeholder="请输入选择"
|
|
|
style="width: 100%"
|
|
|
+ clearable
|
|
|
>
|
|
|
<el-option
|
|
|
v-for="(item, index) in modelNameList"
|
|
@@ -324,6 +349,8 @@
|
|
|
placeholder="请选择知识库"
|
|
|
style="width: 100%"
|
|
|
@change="handleEditKnowledgeBaseChange"
|
|
|
+ clearable
|
|
|
+ filterable
|
|
|
>
|
|
|
<el-option
|
|
|
v-for="(item, index) in kneList"
|
|
@@ -349,6 +376,8 @@
|
|
|
)
|
|
|
"
|
|
|
@change="handleEditDirectoryChange"
|
|
|
+ clearable
|
|
|
+ filterable
|
|
|
>
|
|
|
<el-option
|
|
|
v-for="(dir, index) in editDirectoryList"
|
|
@@ -366,7 +395,9 @@
|
|
|
multiple
|
|
|
placeholder="请选择文档"
|
|
|
style="width: 100%"
|
|
|
- :disabled="!editForm.document_directories"
|
|
|
+ :disabled="editForm.document_directories==''"
|
|
|
+ clearable
|
|
|
+ filterable
|
|
|
>
|
|
|
<el-option
|
|
|
v-for="(doc, index) in editDocumentList"
|
|
@@ -400,7 +431,7 @@
|
|
|
width="80%"
|
|
|
:append-to-body="true"
|
|
|
>
|
|
|
- <div v-if="viewForm" style="padding:0 20px;">
|
|
|
+ <div v-if="viewForm" style="padding: 0 20px">
|
|
|
<p><strong>应用名称:</strong> {{ viewForm.chat_name }}</p>
|
|
|
<p><strong>模型名称:</strong> {{ viewForm.model_name }}</p>
|
|
|
<p>
|