可信代码库-AI大模型批量管理功能对接
This commit is contained in:
@@ -21,14 +21,14 @@
|
|||||||
</div>
|
</div>
|
||||||
|
|
||||||
<d-button v-if="isLogin" class="output-btn" @click="exportResult">导出列表</d-button>
|
<d-button v-if="isLogin" class="output-btn" @click="exportResult">导出列表</d-button>
|
||||||
<div class="bubble-bottom-operations">
|
<!-- <div class="bubble-bottom-operations">-->
|
||||||
<img onclick="handleRefresh()" src="@/assets/imgs/jyh/ai/icon_generate.png" />
|
<!-- <img onclick="handleRefresh()" src="@/assets/imgs/jyh/ai/icon_generate.png" />-->
|
||||||
<i class="icon-file" title="复制" onclick="handleFile()"></i>
|
<!-- <i class="icon-file" title="复制" onclick="handleFile()"></i>-->
|
||||||
<i class="icon-like" title="点赞" onclick="handleLike()"></i>
|
<!-- <i class="icon-like" title="点赞" onclick="handleLike()"></i>-->
|
||||||
<i class="icon-dislike" title="踩" onclick="handleDislike()"></i>
|
<!-- <i class="icon-dislike" title="踩" onclick="handleDislike()"></i>-->
|
||||||
<i class="icon-clever-customer" title="智能客服" onclick="handleCustomerService()"></i>
|
<!-- <i class="icon-clever-customer" title="智能客服" onclick="handleCustomerService()"></i>-->
|
||||||
<i class="icon-more-operate" title="更多操作" onclick="handleMore()"></i>
|
<!-- <i class="icon-more-operate" title="更多操作" onclick="handleMore()"></i>-->
|
||||||
</div>
|
<!-- </div>-->
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
@@ -218,6 +218,7 @@ function handleMore() {
|
|||||||
//min-height: 600px;
|
//min-height: 600px;
|
||||||
background: #ffffff;
|
background: #ffffff;
|
||||||
padding: 20px;
|
padding: 20px;
|
||||||
|
padding-bottom: 40px;
|
||||||
margin-top: 16px;
|
margin-top: 16px;
|
||||||
border-radius: 15px;
|
border-radius: 15px;
|
||||||
|
|
||||||
|
|||||||
@@ -7,14 +7,6 @@
|
|||||||
</div>
|
</div>
|
||||||
|
|
||||||
<d-button v-if="isLogin" class="output-btn" @click="openSubscription">订阅</d-button>
|
<d-button v-if="isLogin" class="output-btn" @click="openSubscription">订阅</d-button>
|
||||||
<div class="bubble-bottom-operations">
|
|
||||||
<img onclick="handleRefresh()" src="@/assets/imgs/jyh/ai/icon_generate.png" />
|
|
||||||
<i class="icon-file" title="复制" onclick="handleFile()"></i>
|
|
||||||
<i class="icon-like" title="点赞" onclick="handleLike()"></i>
|
|
||||||
<i class="icon-dislike" title="踩" onclick="handleDislike()"></i>
|
|
||||||
<i class="icon-clever-customer" title="智能客服" onclick="handleCustomerService()"></i>
|
|
||||||
<i class="icon-more-operate" title="更多操作" onclick="handleMore()"></i>
|
|
||||||
</div>
|
|
||||||
</div>
|
</div>
|
||||||
<NoData v-else />
|
<NoData v-else />
|
||||||
</div>
|
</div>
|
||||||
@@ -189,6 +181,7 @@ function handleMore() {
|
|||||||
//min-height: 600px;
|
//min-height: 600px;
|
||||||
background: #ffffff;
|
background: #ffffff;
|
||||||
padding: 20px;
|
padding: 20px;
|
||||||
|
padding-bottom: 40px;
|
||||||
margin-top: 16px;
|
margin-top: 16px;
|
||||||
border-radius: 15px;
|
border-radius: 15px;
|
||||||
|
|
||||||
|
|||||||
@@ -100,14 +100,14 @@
|
|||||||
</div>
|
</div>
|
||||||
|
|
||||||
<d-button v-if="isLogin" class="output-btn" @click="exportResult">导出列表</d-button>
|
<d-button v-if="isLogin" class="output-btn" @click="exportResult">导出列表</d-button>
|
||||||
<div class="bubble-bottom-operations">
|
<!-- <div class="bubble-bottom-operations">-->
|
||||||
<img onclick="handleRefresh()" src="@/assets/imgs/jyh/ai/icon_generate.png" />
|
<!-- <img onclick="handleRefresh()" src="@/assets/imgs/jyh/ai/icon_generate.png" />-->
|
||||||
<i class="icon-file" title="复制" onclick="handleFile()"></i>
|
<!-- <i class="icon-file" title="复制" onclick="handleFile()"></i>-->
|
||||||
<i class="icon-like" title="点赞" onclick="handleLike()"></i>
|
<!-- <i class="icon-like" title="点赞" onclick="handleLike()"></i>-->
|
||||||
<i class="icon-dislike" title="踩" onclick="handleDislike()"></i>
|
<!-- <i class="icon-dislike" title="踩" onclick="handleDislike()"></i>-->
|
||||||
<i class="icon-clever-customer" title="智能客服" onclick="handleCustomerService()"></i>
|
<!-- <i class="icon-clever-customer" title="智能客服" onclick="handleCustomerService()"></i>-->
|
||||||
<i class="icon-more-operate" title="更多操作" onclick="handleMore()"></i>
|
<!-- <i class="icon-more-operate" title="更多操作" onclick="handleMore()"></i>-->
|
||||||
</div>
|
<!-- </div>-->
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
@@ -431,6 +431,7 @@ function handleMore() {
|
|||||||
//min-height: 600px;
|
//min-height: 600px;
|
||||||
background: #ffffff;
|
background: #ffffff;
|
||||||
padding: 20px;
|
padding: 20px;
|
||||||
|
padding-bottom: 40px;
|
||||||
margin-top: 16px;
|
margin-top: 16px;
|
||||||
border-radius: 15px;
|
border-radius: 15px;
|
||||||
|
|
||||||
|
|||||||
@@ -149,6 +149,7 @@ const activePagination = computed(() => {
|
|||||||
|
|
||||||
// 接口调用 - 对话历史
|
// 接口调用 - 对话历史
|
||||||
const getQuestionHistory = async () => {
|
const getQuestionHistory = async () => {
|
||||||
|
debugger
|
||||||
if (!props.username) {
|
if (!props.username) {
|
||||||
Message.error('请先登录');
|
Message.error('请先登录');
|
||||||
return;
|
return;
|
||||||
|
|||||||
@@ -230,7 +230,7 @@
|
|||||||
</template>
|
</template>
|
||||||
批量管理
|
批量管理
|
||||||
</d-button>
|
</d-button>
|
||||||
<BatchManageModal ref="BatchManageModalRef"/>
|
<BatchManageModal :username="props.username" ref="BatchManageModalRef"/>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</d-tab>
|
</d-tab>
|
||||||
|
|||||||
@@ -39,14 +39,14 @@
|
|||||||
</div>
|
</div>
|
||||||
|
|
||||||
<d-button v-if="isLogin" class="output-btn" @click="exportResult">导出列表</d-button>
|
<d-button v-if="isLogin" class="output-btn" @click="exportResult">导出列表</d-button>
|
||||||
<div class="bubble-bottom-operations">
|
<!-- <div class="bubble-bottom-operations">-->
|
||||||
<img onclick="handleRefresh()" src="@/assets/imgs/jyh/ai/icon_generate.png" />
|
<!-- <img onclick="handleRefresh()" src="@/assets/imgs/jyh/ai/icon_generate.png" />-->
|
||||||
<i class="icon-file" title="复制" onclick="handleFile()"></i>
|
<!-- <i class="icon-file" title="复制" onclick="handleFile()"></i>-->
|
||||||
<i class="icon-like" title="点赞" onclick="handleLike()"></i>
|
<!-- <i class="icon-like" title="点赞" onclick="handleLike()"></i>-->
|
||||||
<i class="icon-dislike" title="踩" onclick="handleDislike()"></i>
|
<!-- <i class="icon-dislike" title="踩" onclick="handleDislike()"></i>-->
|
||||||
<i class="icon-clever-customer" title="智能客服" onclick="handleCustomerService()"></i>
|
<!-- <i class="icon-clever-customer" title="智能客服" onclick="handleCustomerService()"></i>-->
|
||||||
<i class="icon-more-operate" title="更多操作" onclick="handleMore()"></i>
|
<!-- <i class="icon-more-operate" title="更多操作" onclick="handleMore()"></i>-->
|
||||||
</div>
|
<!-- </div>-->
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
@@ -200,6 +200,7 @@ function handleMore() {
|
|||||||
//min-height: 600px;
|
//min-height: 600px;
|
||||||
background: #ffffff;
|
background: #ffffff;
|
||||||
padding: 20px;
|
padding: 20px;
|
||||||
|
padding-bottom: 40px;
|
||||||
margin-top: 16px;
|
margin-top: 16px;
|
||||||
border-radius: 15px;
|
border-radius: 15px;
|
||||||
|
|
||||||
|
|||||||
@@ -26,6 +26,15 @@
|
|||||||
<AIList v-else-if="msg.type==='df'" :content="msg.content"/>
|
<AIList v-else-if="msg.type==='df'" :content="msg.content"/>
|
||||||
<!--text或者富文本展示-->
|
<!--text或者富文本展示-->
|
||||||
<Other v-else :content="msg.content"></Other>
|
<Other v-else :content="msg.content"></Other>
|
||||||
|
|
||||||
|
<div class="bubble-bottom-operations">
|
||||||
|
<img onclick="handleRefresh()" src="@/assets/imgs/jyh/ai/icon_generate.png" />
|
||||||
|
<i class="icon-file" title="复制" onclick="handleFile()"></i>
|
||||||
|
<i :class="msg.islike==='like'?'icon-like-solid':'icon-like'" title="点赞" @click="() => handleLike(idx, 'like')" ></i>
|
||||||
|
<i :class="msg.islike==='dislike'?'icon-dislike-solid':'icon-dislike'" class="icon-dislike" title="踩" @click="() => handleLike(idx, 'dislike')" ></i>
|
||||||
|
<!-- <i class="icon-clever-customer" title="智能客服" onclick="handleCustomerService()"></i>-->
|
||||||
|
<!-- <i class="icon-more-operate" title="更多操作" onclick="handleMore()"></i>-->
|
||||||
|
</div>
|
||||||
</McBubble>
|
</McBubble>
|
||||||
|
|
||||||
<!-- <McBubble v-else :loading="msg.loading ?? false" :avatarConfig="msg.avatarConfig">-->
|
<!-- <McBubble v-else :loading="msg.loading ?? false" :avatarConfig="msg.avatarConfig">-->
|
||||||
@@ -239,6 +248,63 @@ const onSubmit = async (e, answer = undefined) => {
|
|||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
|
||||||
|
// 刷新回答(重新发送上一个用户问题)
|
||||||
|
const handleRefresh = (index: number) => {
|
||||||
|
const currentMsg = messages.value[index];
|
||||||
|
if (currentMsg.role === 'ai-model' && currentMsg.question) { // 假设AI回答的question字段存储了用户原始问题
|
||||||
|
onSubmit(currentMsg.question); // 调用原有发送方法
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
// 复制回答内容
|
||||||
|
const handleFile = (index: number) => {
|
||||||
|
const currentMsg = messages.value[index];
|
||||||
|
if (currentMsg.role === 'ai-model') {
|
||||||
|
const content = currentMsg.content || '';
|
||||||
|
// 处理富文本或特殊格式(示例中直接提取文本)
|
||||||
|
const textContent = typeof content === 'string' ? content : JSON.stringify(content);
|
||||||
|
|
||||||
|
// 执行复制操作
|
||||||
|
const textarea = document.createElement('textarea');
|
||||||
|
textarea.value = textContent;
|
||||||
|
document.body.appendChild(textarea);
|
||||||
|
textarea.select();
|
||||||
|
document.execCommand('copy');
|
||||||
|
document.body.removeChild(textarea);
|
||||||
|
|
||||||
|
Message.success('内容已复制');
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
// 点赞/点踩处理
|
||||||
|
const handleLike = (index: number, type: 'like' | 'dislike') => {
|
||||||
|
const currentMsg = messages.value[index];
|
||||||
|
if (currentMsg.role === 'ai-model' && currentMsg.id) { // 假设消息有唯一ID
|
||||||
|
messages.value[currentMsg.id].islike = type;
|
||||||
|
|
||||||
|
// // 调用接口(示例中需替换为实际API)
|
||||||
|
// axios.post('/api/rateConversation', {
|
||||||
|
// conversationId: CONV_ID.value, // 会话ID
|
||||||
|
// messageId: currentMsg.id, // 消息ID
|
||||||
|
// type: type === 'like' ? 1 : 2 // 1=点赞,2=点踩
|
||||||
|
// }).then(() => {
|
||||||
|
// Message.success(type === 'like' ? '点赞成功' : '点踩成功');
|
||||||
|
// }).catch(() => {
|
||||||
|
// messageReactions.value[currentMsg.id] = null; // 失败时回滚状态
|
||||||
|
// Message.error('操作失败');
|
||||||
|
// });
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
// 智能客服与更多操作(示例中暂留空逻辑,可根据需求扩展)
|
||||||
|
const handleCustomerService = () => {
|
||||||
|
Message.info('智能客服功能即将上线');
|
||||||
|
};
|
||||||
|
|
||||||
|
const handleMore = () => {
|
||||||
|
Message.info('更多操作功能待开发');
|
||||||
|
};
|
||||||
|
|
||||||
const VITE_AI_API_HOST = (import.meta as any).env.VITE_AI_API_HOST;
|
const VITE_AI_API_HOST = (import.meta as any).env.VITE_AI_API_HOST;
|
||||||
|
|
||||||
// AI对话接口对接
|
// AI对话接口对接
|
||||||
@@ -410,7 +476,6 @@ const getConversationDetail = async (convId: string) => {
|
|||||||
|
|
||||||
// 处理详情数据(示例:更新消息列表)
|
// 处理详情数据(示例:更新消息列表)
|
||||||
const handleDetailResponse = (detail: any) => {
|
const handleDetailResponse = (detail: any) => {
|
||||||
debugger
|
|
||||||
// 假设接口返回消息列表为 messagesList
|
// 假设接口返回消息列表为 messagesList
|
||||||
messages.value = detail.map(i=>{
|
messages.value = detail.map(i=>{
|
||||||
let messages = i;
|
let messages = i;
|
||||||
@@ -589,6 +654,7 @@ onMounted(() => {
|
|||||||
}
|
}
|
||||||
:deep(.mc-bubble-left) {
|
:deep(.mc-bubble-left) {
|
||||||
.mc-bubble-content-container {
|
.mc-bubble-content-container {
|
||||||
|
position: relative;
|
||||||
background: transparent;
|
background: transparent;
|
||||||
width: 100%;
|
width: 100%;
|
||||||
.span1{
|
.span1{
|
||||||
@@ -603,6 +669,18 @@ onMounted(() => {
|
|||||||
.mc-bubble-content.filled {
|
.mc-bubble-content.filled {
|
||||||
background: transparent;
|
background: transparent;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
.bubble-bottom-operations {
|
||||||
|
position: absolute;
|
||||||
|
right: 20px;
|
||||||
|
bottom: 20px;
|
||||||
|
display: flex;
|
||||||
|
gap: 8px; /* 图标之间的间隔 */
|
||||||
|
align-items: center; /* 垂直居中图标 */
|
||||||
|
justify-content: end;
|
||||||
|
font-size: 14px;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
.conversation-cnxw {
|
.conversation-cnxw {
|
||||||
|
|||||||
Reference in New Issue
Block a user