Merge remote-tracking branch 'origin/master'
This commit is contained in:
commit
6cd778c5d3
4
.env
4
.env
@ -21,8 +21,8 @@ VITE_APP_BAIDU_CODE = a1ff8825baa73c3a78eb96aa40325abc
|
|||||||
|
|
||||||
|
|
||||||
#AI路径
|
#AI路径
|
||||||
; VITE_AI_URL = http://192.168.1.25:8000
|
VITE_AI_URL = http://192.168.45.135:8000
|
||||||
VITE_AI_URL = http://140.143.164.40:9002
|
; VITE_AI_URL = http://140.143.164.40:9002
|
||||||
|
|
||||||
#Onlyoffice相关
|
#Onlyoffice相关
|
||||||
; VITE_ONLY_URL = http://140.143.164.40:48080
|
; VITE_ONLY_URL = http://140.143.164.40:48080
|
||||||
|
@ -18,6 +18,7 @@ export default {
|
|||||||
close: 'Close',
|
close: 'Close',
|
||||||
reload: 'Reload current',
|
reload: 'Reload current',
|
||||||
success: 'Success',
|
success: 'Success',
|
||||||
|
flow: 'Flow',
|
||||||
closeTab: 'Close current',
|
closeTab: 'Close current',
|
||||||
closeTheLeftTab: 'Close left',
|
closeTheLeftTab: 'Close left',
|
||||||
closeTheRightTab: 'Close right',
|
closeTheRightTab: 'Close right',
|
||||||
|
@ -43,6 +43,7 @@ export default {
|
|||||||
exportMessage: '是否确认导出数据项?',
|
exportMessage: '是否确认导出数据项?',
|
||||||
importMessage: '是否确认导入数据项?',
|
importMessage: '是否确认导入数据项?',
|
||||||
createSuccess: '新增成功',
|
createSuccess: '新增成功',
|
||||||
|
createFlow: '流程发起成功',
|
||||||
updateSuccess: '修改成功',
|
updateSuccess: '修改成功',
|
||||||
delMessage: '是否删除所选中数据?',
|
delMessage: '是否删除所选中数据?',
|
||||||
delDataMessage: '是否删除数据?',
|
delDataMessage: '是否删除数据?',
|
||||||
|
@ -783,7 +783,7 @@ const remainingRouter: AppRouteRecordRaw[] = [
|
|||||||
title: '查看考勤管理流程',
|
title: '查看考勤管理流程',
|
||||||
activeMenu: '/Home/kqnr/kqgl/Kqglflow'
|
activeMenu: '/Home/kqnr/kqgl/Kqglflow'
|
||||||
}
|
}
|
||||||
},
|
}
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
]
|
]
|
||||||
|
@ -162,6 +162,7 @@ export enum DICT_TYPE {
|
|||||||
INFRA_CONFIG_TYPE = 'infra_config_type',
|
INFRA_CONFIG_TYPE = 'infra_config_type',
|
||||||
INFRA_CODEGEN_TEMPLATE_TYPE = 'infra_codegen_template_type',
|
INFRA_CODEGEN_TEMPLATE_TYPE = 'infra_codegen_template_type',
|
||||||
INFRA_CODEGEN_FRONT_TYPE = 'infra_codegen_front_type',
|
INFRA_CODEGEN_FRONT_TYPE = 'infra_codegen_front_type',
|
||||||
|
INFRA_CODEGEN_MODEL_TYPE = 'infra_codegen_model_type',
|
||||||
INFRA_CODEGEN_SCENE = 'infra_codegen_scene',
|
INFRA_CODEGEN_SCENE = 'infra_codegen_scene',
|
||||||
INFRA_FILE_STORAGE = 'infra_file_storage',
|
INFRA_FILE_STORAGE = 'infra_file_storage',
|
||||||
INFRA_OPERATE_TYPE = 'infra_operate_type',
|
INFRA_OPERATE_TYPE = 'infra_operate_type',
|
||||||
@ -175,6 +176,7 @@ export enum DICT_TYPE {
|
|||||||
BPM_PROCESS_LISTENER_TYPE = 'bpm_process_listener_type',
|
BPM_PROCESS_LISTENER_TYPE = 'bpm_process_listener_type',
|
||||||
BPM_PROCESS_LISTENER_VALUE_TYPE = 'bpm_process_listener_value_type',
|
BPM_PROCESS_LISTENER_VALUE_TYPE = 'bpm_process_listener_value_type',
|
||||||
BPM_TASK_CANDIDATE_RANGE = 'bpm_task_candidate_range',
|
BPM_TASK_CANDIDATE_RANGE = 'bpm_task_candidate_range',
|
||||||
|
OA_PROJECT_TYPE ='oa_project_type',
|
||||||
// ========== PAY 模块 ==========
|
// ========== PAY 模块 ==========
|
||||||
PAY_CHANNEL_CODE = 'pay_channel_code', // 支付渠道编码类型
|
PAY_CHANNEL_CODE = 'pay_channel_code', // 支付渠道编码类型
|
||||||
PAY_ORDER_STATUS = 'pay_order_status', // 商户支付订单状态
|
PAY_ORDER_STATUS = 'pay_order_status', // 商户支付订单状态
|
||||||
|
@ -107,6 +107,7 @@ import * as UserApi from '@/api/system/user'
|
|||||||
import {useTagsViewStore} from "@/store/modules/tagsView";
|
import {useTagsViewStore} from "@/store/modules/tagsView";
|
||||||
import {getUserProfile, ProfileVO} from "@/api/system/user/profile";
|
import {getUserProfile, ProfileVO} from "@/api/system/user/profile";
|
||||||
import {DeptVO, getDept} from "@/api/system/dept";
|
import {DeptVO, getDept} from "@/api/system/dept";
|
||||||
|
import {FormProcessMappingApi} from "@/api/bpm/formprocessmapping";
|
||||||
/** 请假管理 表单 */
|
/** 请假管理 表单 */
|
||||||
defineOptions({ name: 'QjglCreate' })
|
defineOptions({ name: 'QjglCreate' })
|
||||||
|
|
||||||
@ -187,7 +188,7 @@ const getUserInfo = async () => {
|
|||||||
}
|
}
|
||||||
//flow begin++++++++++++++++++++
|
//flow begin++++++++++++++++++++
|
||||||
// 指定审批人
|
// 指定审批人
|
||||||
const processDefineKey = 'pch-qjgl-001' // 流程定义 Key
|
// const processDefineKey = 'pch-qjgl-001' // 流程定义 Key
|
||||||
const startUserSelectTasks = ref([]) // 发起人需要选择审批人的用户任务列表
|
const startUserSelectTasks = ref([]) // 发起人需要选择审批人的用户任务列表
|
||||||
const startUserSelectAssignees = ref({}) // 发起人选择审批人的数据
|
const startUserSelectAssignees = ref({}) // 发起人选择审批人的数据
|
||||||
const startUserSelectAssigneesFormRef = ref() // 发起人选择审批人的表单 Ref
|
const startUserSelectAssigneesFormRef = ref() // 发起人选择审批人的表单 Ref
|
||||||
@ -213,6 +214,15 @@ const submitForm = async () => {
|
|||||||
data.startUserSelectAssignees = startUserSelectAssignees.value
|
data.startUserSelectAssignees = startUserSelectAssignees.value
|
||||||
}
|
}
|
||||||
|
|
||||||
|
const curFullPath = currentRoute.value.fullPath
|
||||||
|
if( curFullPath ) {
|
||||||
|
data.curfullpath = curFullPath
|
||||||
|
}
|
||||||
|
const processKey = await FormProcessMappingApi.selectProcessKey( curFullPath )
|
||||||
|
if ( processKey) {
|
||||||
|
data.processDefinitionKey = processKey
|
||||||
|
}
|
||||||
|
|
||||||
await QjglApi.createQjgl(data)
|
await QjglApi.createQjgl(data)
|
||||||
message.success(t('发起成功!'))
|
message.success(t('发起成功!'))
|
||||||
// 关闭当前 Tab
|
// 关闭当前 Tab
|
||||||
@ -248,10 +258,17 @@ const resetForm = () => {
|
|||||||
onMounted(async () => {
|
onMounted(async () => {
|
||||||
await getUserInfo()
|
await getUserInfo()
|
||||||
// await getKnowtypeTree()
|
// await getKnowtypeTree()
|
||||||
console.log(processDefineKey,"key1")
|
const curFullPath = currentRoute.value.fullPath
|
||||||
|
const processKey = await FormProcessMappingApi.selectProcessKey( curFullPath )
|
||||||
|
|
||||||
|
if ( !processKey ) {
|
||||||
|
message.error('流程对应表单模型未配置,请检查!')
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
const processDefinitionDetail = await DefinitionApi.getProcessDefinition(
|
const processDefinitionDetail = await DefinitionApi.getProcessDefinition(
|
||||||
undefined,
|
undefined,
|
||||||
processDefineKey
|
processKey
|
||||||
)
|
)
|
||||||
|
|
||||||
if (!processDefinitionDetail) {
|
if (!processDefinitionDetail) {
|
||||||
@ -274,7 +291,7 @@ onMounted(async () => {
|
|||||||
|
|
||||||
// 加载用户列表
|
// 加载用户列表
|
||||||
userList.value = await UserApi.getSimpleUserList()
|
userList.value = await UserApi.getSimpleUserList()
|
||||||
console.log(userList.value ,"userList.value")
|
//console.log(userList.value ,"userList.value")
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
|
||||||
|
@ -1,20 +1,11 @@
|
|||||||
<template>
|
<template>
|
||||||
<el-container class="ai-layout">
|
<el-container class="ai-layout">
|
||||||
<!-- 左侧:对话列表 -->
|
|
||||||
<ConversationList
|
|
||||||
:active-id="activeConversationId"
|
|
||||||
ref="conversationListRef"
|
|
||||||
@on-conversation-create="handleConversationCreateSuccess"
|
|
||||||
@on-conversation-click="handleConversationClick"
|
|
||||||
@on-conversation-clear="handleConversationClear"
|
|
||||||
@on-conversation-delete="handlerConversationDelete"
|
|
||||||
/>
|
|
||||||
<!-- 右侧:对话详情 -->
|
|
||||||
<el-container class="detail-container">
|
<el-container class="detail-container">
|
||||||
<el-header class="header">
|
<el-header class="header">
|
||||||
<!-- 隐藏字段 pch add-->
|
<!-- 隐藏字段 pch add-->
|
||||||
<el-input name="userid" v-model="userid" v-show="false" />
|
<el-input name="userid" v-model="userid" v-show="false" />
|
||||||
<el-input name="userName" v-model="userName" v-show="false" />
|
<el-input name="userName" v-model="userName" v-show="false" />
|
||||||
|
<el-input name="deptId" v-model="deptId" v-show="false" />
|
||||||
<el-input name="deptfull" v-model="deptfull" v-show="false" />
|
<el-input name="deptfull" v-model="deptfull" v-show="false" />
|
||||||
<el-input name="postName" v-model="postName" v-show="false" />
|
<el-input name="postName" v-model="postName" v-show="false" />
|
||||||
<!-- 隐藏字段 pch end-->
|
<!-- 隐藏字段 pch end-->
|
||||||
@ -45,22 +36,16 @@
|
|||||||
<div class="message-container">
|
<div class="message-container">
|
||||||
<!-- 情况一:消息加载中 -->
|
<!-- 情况一:消息加载中 -->
|
||||||
<MessageLoading v-if="activeMessageListLoading" />
|
<MessageLoading v-if="activeMessageListLoading" />
|
||||||
<!-- 情况二:无聊天对话时 -->
|
|
||||||
<MessageNewConversation
|
|
||||||
v-if="!activeConversation"
|
|
||||||
@on-new-conversation="handleConversationCreate"
|
|
||||||
/>
|
|
||||||
<!-- 情况三:消息列表为空 -->
|
<!-- 情况三:消息列表为空 -->
|
||||||
<MessageListEmpty
|
<MessageListEmpty
|
||||||
v-if="!activeMessageListLoading && messageList.length === 0 && activeConversation"
|
v-if="!activeMessageListLoading && messageList.length === 0"
|
||||||
@on-prompt="doSendMessage"
|
@on-prompt="doSendMessage"
|
||||||
/>
|
/>
|
||||||
<!-- 情况四:消息列表不为空 -->
|
<!-- 情况四:消息列表不为空 -->
|
||||||
<MessageList
|
<MessageList
|
||||||
v-if="!activeMessageListLoading && messageList.length > 0"
|
v-if="!activeMessageListLoading && messageList.length > 0"
|
||||||
ref="messageRef"
|
ref="messageRef"
|
||||||
:conversation="activeConversation"
|
v-model:list="messageList"
|
||||||
:list="messageList"
|
|
||||||
@on-delete-success="handleMessageDelete"
|
@on-delete-success="handleMessageDelete"
|
||||||
@on-edit="handleMessageEdit"
|
@on-edit="handleMessageEdit"
|
||||||
@on-refresh="handleMessageRefresh"
|
@on-refresh="handleMessageRefresh"
|
||||||
@ -84,25 +69,25 @@
|
|||||||
<div class="prompt-btns">
|
<div class="prompt-btns">
|
||||||
<div>
|
<div>
|
||||||
<el-switch v-model="enableContext" />
|
<el-switch v-model="enableContext" />
|
||||||
<span class="ml-5px text-14px text-#8f8f8f">上下文</span>
|
<span class="ml-5px text-14px text-#8f8f8f">记忆内容</span>
|
||||||
</div>
|
</div>
|
||||||
|
<!-- v-if="conversationInProgress == false"-->
|
||||||
<el-button
|
<el-button
|
||||||
type="primary"
|
type="primary"
|
||||||
size="default"
|
size="default"
|
||||||
@click="handleSendByButton"
|
@click="handleSendByButton"
|
||||||
:loading="conversationInProgress"
|
:loading="conversationInProgress"
|
||||||
v-if="conversationInProgress == false"
|
|
||||||
>
|
>
|
||||||
{{ conversationInProgress ? '进行中' : '发送1' }}
|
{{ conversationInProgress ? '进行中' : '发送' }}
|
||||||
</el-button>
|
|
||||||
<el-button
|
|
||||||
type="danger"
|
|
||||||
size="default"
|
|
||||||
@click="stopStream()"
|
|
||||||
v-if="conversationInProgress == true"
|
|
||||||
>
|
|
||||||
停止
|
|
||||||
</el-button>
|
</el-button>
|
||||||
|
<!-- <el-button-->
|
||||||
|
<!-- type="danger"-->
|
||||||
|
<!-- size="default"-->
|
||||||
|
<!-- @click="stopStream()"-->
|
||||||
|
<!-- v-if="conversationInProgress == true"-->
|
||||||
|
<!-- >-->
|
||||||
|
<!-- 等待-->
|
||||||
|
<!-- </el-button>-->
|
||||||
</div>
|
</div>
|
||||||
</form>
|
</form>
|
||||||
</el-footer>
|
</el-footer>
|
||||||
@ -119,29 +104,30 @@
|
|||||||
<script setup lang="ts">
|
<script setup lang="ts">
|
||||||
import { ChatMessageApi, ChatMessageVO } from '@/api/ai/chat/message'
|
import { ChatMessageApi, ChatMessageVO } from '@/api/ai/chat/message'
|
||||||
import { ChatConversationApi, ChatConversationVO } from '@/api/ai/chat/conversation'
|
import { ChatConversationApi, ChatConversationVO } from '@/api/ai/chat/conversation'
|
||||||
import ConversationList from './components/conversation/ConversationList.vue'
|
// import ConversationList from './components/conversation/ConversationList.vue'
|
||||||
import ConversationUpdateForm from './components/conversation/ConversationUpdateForm.vue'
|
import ConversationUpdateForm from './components/conversation/ConversationUpdateForm.vue'
|
||||||
import MessageList from './components/message/MessageList.vue'
|
import MessageList from './components/message/MessageList.vue'
|
||||||
import MessageListEmpty from './components/message/MessageListEmpty.vue'
|
import MessageListEmpty from './components/message/MessageListEmpty.vue'
|
||||||
import MessageLoading from './components/message/MessageLoading.vue'
|
import MessageLoading from './components/message/MessageLoading.vue'
|
||||||
import MessageNewConversation from './components/message/MessageNewConversation.vue'
|
// import MessageNewConversation from './components/message/MessageNewConversation.vue'
|
||||||
import { Download, Top } from '@element-plus/icons-vue'
|
// import { Download, Top } from '@element-plus/icons-vue'
|
||||||
import axios from "axios";
|
import axios from "axios";
|
||||||
import {getUserProfile, ProfileVO} from "@/api/system/user/profile";
|
import {getUserProfile} from "@/api/system/user/profile";
|
||||||
import {DeptVO, getDept, getDeptInfo} from "@/api/system/dept";
|
import {getDeptInfo} from "@/api/system/dept";
|
||||||
import { getAccessToken } from '@/utils/auth'
|
import { getAccessToken } from '@/utils/auth'
|
||||||
import { config } from '@/config/axios/config'
|
import { config } from '@/config/axios/config'
|
||||||
/** AI 聊天对话 列表 */
|
/** AI 聊天对话 列表 */
|
||||||
defineOptions({ name: 'AiChat' })
|
defineOptions({ name: 'AiChat' })
|
||||||
|
|
||||||
const route = useRoute() // 路由
|
// const route = useRoute() // 路由
|
||||||
const message = useMessage() // 消息弹窗
|
const message = useMessage() // 消息弹窗
|
||||||
const userid = ref('') //pch add
|
const userid = ref('') //pch add
|
||||||
const userName = ref('') //pch add
|
const userName = ref('') //pch add
|
||||||
|
const deptId = ref('') //pch add
|
||||||
const deptfull = ref('') //pch add
|
const deptfull = ref('') //pch add
|
||||||
const postName = ref('') //pch add
|
const postName = ref('') //pch add
|
||||||
// 聊天对话
|
// 聊天对话
|
||||||
const conversationListRef = ref()
|
// const conversationListRef = ref()
|
||||||
const activeConversationId = ref<number | null>(null) // 选中的对话编号
|
const activeConversationId = ref<number | null>(null) // 选中的对话编号
|
||||||
const activeConversation = ref<ChatConversationVO | null>(null) // 选中的 Conversation
|
const activeConversation = ref<ChatConversationVO | null>(null) // 选中的 Conversation
|
||||||
const conversationInProgress = ref(false) // 对话是否正在进行中。目前只有【发送】消息时,会更新为 true,避免切换对话、删除对话等操作
|
const conversationInProgress = ref(false) // 对话是否正在进行中。目前只有【发送】消息时,会更新为 true,避免切换对话、删除对话等操作
|
||||||
@ -152,18 +138,19 @@ const activeMessageList = ref<ChatMessageVO[]>([]) // 选中对话的消息列
|
|||||||
const activeMessageListLoading = ref<boolean>(false) // activeMessageList 是否正在加载中
|
const activeMessageListLoading = ref<boolean>(false) // activeMessageList 是否正在加载中
|
||||||
const activeMessageListLoadingTimer = ref<any>() // activeMessageListLoading Timer 定时器。如果加载速度很快,就不进入加载中
|
const activeMessageListLoadingTimer = ref<any>() // activeMessageListLoading Timer 定时器。如果加载速度很快,就不进入加载中
|
||||||
// 消息滚动
|
// 消息滚动
|
||||||
const textSpeed = ref<number>(50) // Typing speed in milliseconds
|
// const textSpeed = ref<number>(50) // Typing speed in milliseconds
|
||||||
const textRoleRunning = ref<boolean>(false) // Typing speed in milliseconds
|
// const textRoleRunning = ref<boolean>(false) // Typing speed in milliseconds
|
||||||
|
|
||||||
// 发送消息输入框
|
// 发送消息输入框
|
||||||
const isComposing = ref(false) // 判断用户是否在输入
|
const isComposing = ref(false) // 判断用户是否在输入
|
||||||
const conversationInAbortController = ref<any>() // 对话进行中 abort 控制器(控制 stream 对话)
|
const conversationInAbortController = ref<any>() // 对话进行中 abort 控制器(控制 stream 对话)
|
||||||
const inputTimeout = ref<any>() // 处理输入中回车的定时器
|
const inputTimeout = ref<any>() // 处理输入中回车的定时器
|
||||||
const prompt = ref<string>() // prompt
|
const prompt = ref<string>() // prompt
|
||||||
const enableContext = ref<boolean>(true) // 是否开启上下文
|
const enableContext = ref<boolean>(true) // 是否开启记忆
|
||||||
|
const flag = ref<number>(1);//记忆功能参数
|
||||||
// 接收 Stream 消息
|
// 接收 Stream 消息
|
||||||
const receiveMessageFullText = ref('')
|
// const receiveMessageFullText = ref('')
|
||||||
const receiveMessageDisplayedText = ref('')
|
// const receiveMessageDisplayedText = ref('')
|
||||||
|
|
||||||
// =========== 【聊天对话】相关 ===========
|
// =========== 【聊天对话】相关 ===========
|
||||||
|
|
||||||
@ -186,43 +173,43 @@ const getConversation = async (id: number | null) => {
|
|||||||
* @param conversation 选中的对话
|
* @param conversation 选中的对话
|
||||||
* @return 是否切换成功
|
* @return 是否切换成功
|
||||||
*/
|
*/
|
||||||
const handleConversationClick = async (conversation: ChatConversationVO) => {
|
// const handleConversationClick = async (conversation: ChatConversationVO) => {
|
||||||
// 对话进行中,不允许切换
|
// // 对话进行中,不允许切换
|
||||||
if (conversationInProgress.value) {
|
// if (conversationInProgress.value) {
|
||||||
message.alert('对话中,不允许切换!')
|
// message.alert('对话中,不允许切换!')
|
||||||
return false
|
// return false
|
||||||
}
|
// }
|
||||||
|
//
|
||||||
// 更新选中的对话 id
|
// // 更新选中的对话 id
|
||||||
activeConversationId.value = conversation.id
|
// activeConversationId.value = conversation.id
|
||||||
activeConversation.value = conversation
|
// activeConversation.value = conversation
|
||||||
// 刷新 message 列表
|
// // 刷新 message 列表
|
||||||
await getMessageList()
|
// await getMessageList()
|
||||||
// 滚动底部
|
// // 滚动底部
|
||||||
scrollToBottom(true)
|
// scrollToBottom(true)
|
||||||
// 清空输入框
|
// // 清空输入框
|
||||||
prompt.value = ''
|
// prompt.value = ''
|
||||||
return true
|
// return true
|
||||||
}
|
// }
|
||||||
|
|
||||||
/** 删除某个对话*/
|
/** 删除某个对话*/
|
||||||
const handlerConversationDelete = async (delConversation: ChatConversationVO) => {
|
// const handlerConversationDelete = async (delConversation: ChatConversationVO) => {
|
||||||
// 删除的对话如果是当前选中的,那么就重置
|
// // 删除的对话如果是当前选中的,那么就重置
|
||||||
if (activeConversationId.value === delConversation.id) {
|
// if (activeConversationId.value === delConversation.id) {
|
||||||
await handleConversationClear()
|
// await handleConversationClear()
|
||||||
}
|
// }
|
||||||
}
|
// }
|
||||||
/** 清空选中的对话 */
|
/** 清空选中的对话 */
|
||||||
const handleConversationClear = async () => {
|
// const handleConversationClear = async () => {
|
||||||
// 对话进行中,不允许切换
|
// // 对话进行中,不允许切换
|
||||||
if (conversationInProgress.value) {
|
// if (conversationInProgress.value) {
|
||||||
message.alert('对话中,不允许切换!')
|
// message.alert('对话中,不允许切换!')
|
||||||
return false
|
// return false
|
||||||
}
|
// }
|
||||||
activeConversationId.value = null
|
// activeConversationId.value = null
|
||||||
activeConversation.value = null
|
// activeConversation.value = null
|
||||||
activeMessageList.value = []
|
// activeMessageList.value = []
|
||||||
}
|
// }
|
||||||
|
|
||||||
/** 修改聊天对话 */
|
/** 修改聊天对话 */
|
||||||
const conversationUpdateFormRef = ref()
|
const conversationUpdateFormRef = ref()
|
||||||
@ -235,15 +222,15 @@ const handleConversationUpdateSuccess = async () => {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/** 处理聊天对话的创建成功 */
|
/** 处理聊天对话的创建成功 */
|
||||||
const handleConversationCreate = async () => {
|
// const handleConversationCreate = async () => {
|
||||||
// 创建对话
|
// // 创建对话
|
||||||
await conversationListRef.value.createConversation()
|
// await conversationListRef.value.createConversation()
|
||||||
}
|
// }
|
||||||
/** 处理聊天对话的创建成功 */
|
/** 处理聊天对话的创建成功 */
|
||||||
const handleConversationCreateSuccess = async () => {
|
// const handleConversationCreateSuccess = async () => {
|
||||||
// 创建新的对话,清空输入框
|
// // 创建新的对话,清空输入框
|
||||||
prompt.value = ''
|
// prompt.value = ''
|
||||||
}
|
// }
|
||||||
|
|
||||||
// =========== 【消息列表】相关 ===========
|
// =========== 【消息列表】相关 ===========
|
||||||
|
|
||||||
@ -275,25 +262,64 @@ const getMessageList = async () => {
|
|||||||
activeMessageListLoading.value = false
|
activeMessageListLoading.value = false
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
const messli = ref<{ type: string; content: string }[]>([]);
|
||||||
|
/** 真正执行【发送】消息操作 */
|
||||||
|
const doSendMessage = async (content: string) => {
|
||||||
|
if (conversationInProgress.value){
|
||||||
|
message.error('发送失败,原因:发送中!')
|
||||||
|
return
|
||||||
|
}
|
||||||
|
if (messli.value.length==0){
|
||||||
|
activeMessageListLoading.value = true
|
||||||
|
}
|
||||||
|
conversationInProgress.value=true
|
||||||
|
// console.log("content",content)
|
||||||
|
// 校验
|
||||||
|
if (!content) {
|
||||||
|
activeMessageListLoading.value = false
|
||||||
|
conversationInProgress.value=false
|
||||||
|
message.error('发送失败,原因:内容为空!')
|
||||||
|
return
|
||||||
|
}
|
||||||
|
messli.value.push({
|
||||||
|
type: 'user',
|
||||||
|
content: content
|
||||||
|
})
|
||||||
|
// 清空输入框
|
||||||
|
prompt.value = ''
|
||||||
|
if (enableContext.value){
|
||||||
|
flag.value=1
|
||||||
|
}else if (!enableContext.value){
|
||||||
|
flag.value=0
|
||||||
|
}
|
||||||
|
// console.log("flag",flag.value)
|
||||||
|
let response
|
||||||
|
try {
|
||||||
|
const token = getAccessToken()
|
||||||
|
response = await axios.post(`http://192.168.45.135:8000/chat?query=${content}&token=${token}&userid=${userid.value}&username=${userName.value}&deptid=${deptId.value}&deptfull=${deptfull.value}&postname=${postName.value}&memoryflag=${flag.value}`);
|
||||||
|
activeMessageListLoading.value = false
|
||||||
|
conversationInProgress.value=false
|
||||||
|
// console.log("response",response)
|
||||||
|
messli.value.push({
|
||||||
|
type: 'system',
|
||||||
|
content: response.data.msg.output
|
||||||
|
})
|
||||||
|
}catch (error){
|
||||||
|
activeMessageListLoading.value = false
|
||||||
|
conversationInProgress.value=false
|
||||||
|
console.error("错误: ",error)
|
||||||
|
}
|
||||||
|
// console.log("messli",messli.value)
|
||||||
|
return response.data.msg.output
|
||||||
|
}
|
||||||
/**
|
/**
|
||||||
* 消息列表
|
* 消息列表
|
||||||
*
|
*
|
||||||
* 和 {@link #getMessageList()} 的差异是,把 systemMessage 考虑进去
|
* 和 {@link #getMessageList()} 的差异是,把 systemMessage 考虑进去
|
||||||
*/
|
*/
|
||||||
const messageList = computed(() => {
|
const messageList = computed(() => {
|
||||||
if (activeMessageList.value.length > 0) {
|
if (messli.value.length>0){
|
||||||
return activeMessageList.value
|
return messli.value
|
||||||
}
|
|
||||||
// 没有消息时,如果有 systemMessage 则展示它
|
|
||||||
if (activeConversation.value?.systemMessage) {
|
|
||||||
return [
|
|
||||||
{
|
|
||||||
id: 0,
|
|
||||||
type: 'system',
|
|
||||||
content: activeConversation.value.systemMessage
|
|
||||||
}
|
|
||||||
]
|
|
||||||
}
|
}
|
||||||
return []
|
return []
|
||||||
})
|
})
|
||||||
@ -389,91 +415,61 @@ const onCompositionend = () => {
|
|||||||
}, 200)
|
}, 200)
|
||||||
}
|
}
|
||||||
|
|
||||||
/** 真正执行【发送】消息操作 */
|
|
||||||
const doSendMessage = async (content: string) => {
|
|
||||||
// 校验
|
|
||||||
if (content.length < 1) {
|
|
||||||
message.error('发送失败,原因:内容为空!')
|
|
||||||
return
|
|
||||||
}
|
|
||||||
// if (activeConversationId.value == null) {
|
|
||||||
// message.error('还没创建对话,不能发送!')
|
|
||||||
// return
|
|
||||||
// }
|
|
||||||
// 清空输入框
|
|
||||||
prompt.value = ''
|
|
||||||
// 执行发送
|
|
||||||
// const result = await doSendMessageStream({
|
|
||||||
// userId : userid ,
|
|
||||||
// userName :userName ,
|
|
||||||
// content: content,
|
|
||||||
// deptFull:deptfull,
|
|
||||||
// postName:postName
|
|
||||||
// } as ChatMessageVO)
|
|
||||||
|
|
||||||
const token = getAccessToken()
|
|
||||||
|
|
||||||
alert(userid.value+" "+userName.value+" "+deptfull.value+" "+postName.value)
|
|
||||||
const response = await axios.post(`${config.ai_url}/chat?query=${content}&token=${token}&userid=${userid.value}&username=${userName.value}&deptfull=${deptfull.value}&postname=${postName.value}&memoryflag=1`);
|
|
||||||
console.log(response.data.msg.output,"response")
|
|
||||||
return response.data.msg.output
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
/** 真正执行【发送】消息操作 */
|
/** 真正执行【发送】消息操作 */
|
||||||
const doSendMessageStream = async (userMessage: ChatMessageVO) => {
|
// const doSendMessageStream = async (userMessage: ChatMessageVO) => {
|
||||||
|
//
|
||||||
// 创建 AbortController 实例,以便中止请求
|
// // 创建 AbortController 实例,以便中止请求
|
||||||
conversationInAbortController.value = new AbortController()
|
// conversationInAbortController.value = new AbortController()
|
||||||
// 标记对话进行中
|
// // 标记对话进行中
|
||||||
conversationInProgress.value = true
|
// conversationInProgress.value = true
|
||||||
// 设置为空
|
// // 设置为空
|
||||||
receiveMessageFullText.value = ''
|
// receiveMessageFullText.value = ''
|
||||||
|
//
|
||||||
try {
|
// try {
|
||||||
// 1.1 先添加两个假数据,等 stream 返回再替换
|
// // 1.1 先添加两个假数据,等 stream 返回再替换
|
||||||
activeMessageList.value.push({
|
// activeMessageList.value.push({
|
||||||
id: -1,
|
// id: -1,
|
||||||
conversationId: activeConversationId.value,
|
// conversationId: activeConversationId.value,
|
||||||
type: 'user',
|
// type: 'user',
|
||||||
content: userMessage.content,
|
// content: userMessage.content,
|
||||||
createTime: new Date()
|
// createTime: new Date()
|
||||||
} as ChatMessageVO)
|
// } as ChatMessageVO)
|
||||||
activeMessageList.value.push({
|
// activeMessageList.value.push({
|
||||||
id: -2,
|
// id: -2,
|
||||||
conversationId: activeConversationId.value,
|
// conversationId: activeConversationId.value,
|
||||||
type: 'assistant',
|
// type: 'assistant',
|
||||||
content: '思考中...',
|
// content: '思考中...',
|
||||||
createTime: new Date()
|
// createTime: new Date()
|
||||||
} as ChatMessageVO)
|
// } as ChatMessageVO)
|
||||||
|
//
|
||||||
// 1.2 滚动到最下面
|
// // 1.2 滚动到最下面
|
||||||
//await nextTick()
|
// //await nextTick()
|
||||||
|
//
|
||||||
// await scrollToBottom() // 底部
|
// // await scrollToBottom() // 底部
|
||||||
|
//
|
||||||
// 1.3 开始滚动
|
// // 1.3 开始滚动
|
||||||
//textRoll()
|
// //textRoll()
|
||||||
|
//
|
||||||
// 2. 发送 event stream
|
// // 2. 发送 event stream
|
||||||
let isFirstChunk = true // 是否是第一个 chunk 消息段
|
// // let isFirstChunk = true // 是否是第一个 chunk 消息段
|
||||||
await ChatMessageApi.sendChatMessageStream(
|
// // await ChatMessageApi.sendChatMessageStream(
|
||||||
userMessage.conversationId,
|
// // userMessage.conversationId,
|
||||||
userMessage.content,
|
// // userMessage.content,
|
||||||
|
// //
|
||||||
)
|
// // )
|
||||||
} catch {}
|
// } catch {}
|
||||||
}
|
// }
|
||||||
|
|
||||||
/** 停止 stream 流式调用 */
|
/** 停止 stream 流式调用 */
|
||||||
const stopStream = async () => {
|
// const stopStream = async () => {
|
||||||
// tip:如果 stream 进行中的 message,就需要调用 controller 结束
|
// // tip:如果 stream 进行中的 message,就需要调用 controller 结束
|
||||||
if (conversationInAbortController.value) {
|
// if (conversationInAbortController.value) {
|
||||||
conversationInAbortController.value.abort()
|
// conversationInAbortController.value.abort()
|
||||||
}
|
// }
|
||||||
// 设置为 false
|
// // 设置为 false
|
||||||
conversationInProgress.value = false
|
// conversationInProgress.value = false
|
||||||
}
|
// }
|
||||||
|
|
||||||
/** 编辑 message:设置为 prompt,可以再次编辑 */
|
/** 编辑 message:设置为 prompt,可以再次编辑 */
|
||||||
const handleMessageEdit = (message: ChatMessageVO) => {
|
const handleMessageEdit = (message: ChatMessageVO) => {
|
||||||
@ -496,71 +492,72 @@ const scrollToBottom = async (isIgnore?: boolean) => {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/** 自提滚动效果 */
|
/** 自提滚动效果 */
|
||||||
const textRoll = async () => {
|
// const textRoll = async () => {
|
||||||
let index = 0
|
// let index = 0
|
||||||
try {
|
// try {
|
||||||
// 只能执行一次
|
// // 只能执行一次
|
||||||
if (textRoleRunning.value) {
|
// if (textRoleRunning.value) {
|
||||||
return
|
// return
|
||||||
}
|
// }
|
||||||
// 设置状态
|
// // 设置状态
|
||||||
textRoleRunning.value = true
|
// textRoleRunning.value = true
|
||||||
receiveMessageDisplayedText.value = ''
|
// receiveMessageDisplayedText.value = ''
|
||||||
const task = async () => {
|
// const task = async () => {
|
||||||
// 调整速度
|
// // 调整速度
|
||||||
const diff =
|
// const diff =
|
||||||
(receiveMessageFullText.value.length - receiveMessageDisplayedText.value.length) / 10
|
// (receiveMessageFullText.value.length - receiveMessageDisplayedText.value.length) / 10
|
||||||
if (diff > 5) {
|
// if (diff > 5) {
|
||||||
textSpeed.value = 10
|
// textSpeed.value = 10
|
||||||
} else if (diff > 2) {
|
// } else if (diff > 2) {
|
||||||
textSpeed.value = 30
|
// textSpeed.value = 30
|
||||||
} else if (diff > 1.5) {
|
// } else if (diff > 1.5) {
|
||||||
textSpeed.value = 50
|
// textSpeed.value = 50
|
||||||
} else {
|
// } else {
|
||||||
textSpeed.value = 100
|
// textSpeed.value = 100
|
||||||
}
|
// }
|
||||||
// 对话结束,就按 30 的速度
|
// // 对话结束,就按 30 的速度
|
||||||
if (!conversationInProgress.value) {
|
// if (!conversationInProgress.value) {
|
||||||
textSpeed.value = 10
|
// textSpeed.value = 10
|
||||||
}
|
// }
|
||||||
|
//
|
||||||
if (index < receiveMessageFullText.value.length) {
|
// if (index < receiveMessageFullText.value.length) {
|
||||||
receiveMessageDisplayedText.value += receiveMessageFullText.value[index]
|
// receiveMessageDisplayedText.value += receiveMessageFullText.value[index]
|
||||||
index++
|
// index++
|
||||||
|
//
|
||||||
// 更新 message
|
// // 更新 message
|
||||||
const lastMessage = activeMessageList.value[activeMessageList.value.length - 1]
|
// const lastMessage = activeMessageList.value[activeMessageList.value.length - 1]
|
||||||
lastMessage.content = receiveMessageDisplayedText.value
|
// lastMessage.content = receiveMessageDisplayedText.value
|
||||||
// 滚动到住下面
|
// // 滚动到住下面
|
||||||
await scrollToBottom()
|
// await scrollToBottom()
|
||||||
// 重新设置任务
|
// // 重新设置任务
|
||||||
timer = setTimeout(task, textSpeed.value)
|
// timer = setTimeout(task, textSpeed.value)
|
||||||
} else {
|
// } else {
|
||||||
// 不是对话中可以结束
|
// // 不是对话中可以结束
|
||||||
if (!conversationInProgress.value) {
|
// if (!conversationInProgress.value) {
|
||||||
textRoleRunning.value = false
|
// textRoleRunning.value = false
|
||||||
clearTimeout(timer)
|
// clearTimeout(timer)
|
||||||
} else {
|
// } else {
|
||||||
// 重新设置任务
|
// // 重新设置任务
|
||||||
timer = setTimeout(task, textSpeed.value)
|
// timer = setTimeout(task, textSpeed.value)
|
||||||
}
|
// }
|
||||||
}
|
// }
|
||||||
}
|
// }
|
||||||
let timer = setTimeout(task, textSpeed.value)
|
// let timer = setTimeout(task, textSpeed.value)
|
||||||
} catch {}
|
// } catch {}
|
||||||
}
|
// }
|
||||||
/*得到当前访问的用户信息pch add*/
|
/*得到当前访问的用户信息pch add*/
|
||||||
const getUserInfo = async () => {
|
const getUserInfo = async () => {
|
||||||
|
|
||||||
const users = await getUserProfile()
|
const users = await getUserProfile()
|
||||||
//console.log(users,"users")
|
console.log(users,"users")
|
||||||
userid.value = users.username
|
userid.value = users.username
|
||||||
userName.value = users.nickname
|
userName.value = users.nickname
|
||||||
//alert("dept="+users.dept.id)
|
//alert("dept="+users.dept.id)
|
||||||
const deptid = users.dept.id
|
deptId.value = users.dept.id
|
||||||
const dept = await getDeptInfo(deptid)
|
//const dept = await getDeptInfo(users.dept.id)
|
||||||
//alert("deptname="+dept.name)
|
//alert("deptname="+dept.name)
|
||||||
deptfull.value = dept.name
|
//deptfull.value = dept.name
|
||||||
|
deptfull.value = users.dept.name
|
||||||
const roles= users.roles.map(role => role.name)
|
const roles= users.roles.map(role => role.name)
|
||||||
postName.value = roles
|
postName.value = roles
|
||||||
//console.log(roles)
|
//console.log(roles)
|
@ -1,282 +0,0 @@
|
|||||||
<template>
|
|
||||||
<div ref="messageContainer" class="h-100% overflow-y-auto relative">
|
|
||||||
<div class="chat-list" v-for="(item, index) in list" :key="index">
|
|
||||||
<!-- 靠左 message:system、assistant 类型 -->
|
|
||||||
<div class="left-message message-item" v-if="item.type !== 'user'">
|
|
||||||
<div class="avatar">
|
|
||||||
<el-avatar :src="roleAvatar" />
|
|
||||||
</div>
|
|
||||||
<div class="message">
|
|
||||||
<div>
|
|
||||||
<el-text class="time">{{ formatDate(item.createTime) }}</el-text>
|
|
||||||
</div>
|
|
||||||
<div class="left-text-container" ref="markdownViewRef">
|
|
||||||
<MarkdownView class="left-text" :content="item.content" />
|
|
||||||
</div>
|
|
||||||
<div class="left-btns">
|
|
||||||
<el-button class="btn-cus" link @click="copyContent(item.content)">
|
|
||||||
<img class="btn-image" src="../../../../../../assets/ai/copy.svg" />
|
|
||||||
</el-button>
|
|
||||||
<el-button v-if="item.id > 0" class="btn-cus" link @click="onDelete(item.id)">
|
|
||||||
<img class="btn-image h-17px" src="../../../../../../assets/ai/delete.svg" />
|
|
||||||
</el-button>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
<!-- 靠右 message:user 类型 -->
|
|
||||||
<div class="right-message message-item" v-if="item.type === 'user'">
|
|
||||||
<div class="avatar">
|
|
||||||
<el-avatar :src="userAvatar" />
|
|
||||||
</div>
|
|
||||||
<div class="message">
|
|
||||||
<div>
|
|
||||||
<el-text class="time">{{ formatDate(item.createTime) }}</el-text>
|
|
||||||
</div>
|
|
||||||
<div class="right-text-container">
|
|
||||||
<div class="right-text">{{ item.content }}</div>
|
|
||||||
</div>
|
|
||||||
<div class="right-btns">
|
|
||||||
<el-button class="btn-cus" link @click="copyContent(item.content)">
|
|
||||||
<img class="btn-image" src="../../../../../../assets/ai/copy.svg" />
|
|
||||||
</el-button>
|
|
||||||
<el-button class="btn-cus" link @click="onDelete(item.id)">
|
|
||||||
<img class="btn-image h-17px mr-12px" src="../../../../../../assets/ai/delete.svg" />
|
|
||||||
</el-button>
|
|
||||||
<el-button class="btn-cus" link @click="onRefresh(item)">
|
|
||||||
<el-icon size="17"><RefreshRight /></el-icon>
|
|
||||||
</el-button>
|
|
||||||
<el-button class="btn-cus" link @click="onEdit(item)">
|
|
||||||
<el-icon size="17"><Edit /></el-icon>
|
|
||||||
</el-button>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
<!-- 回到底部 -->
|
|
||||||
<div v-if="isScrolling" class="to-bottom" @click="handleGoBottom">
|
|
||||||
<el-button :icon="ArrowDownBold" circle />
|
|
||||||
</div>
|
|
||||||
</template>
|
|
||||||
<script setup lang="ts">
|
|
||||||
import { PropType } from 'vue'
|
|
||||||
import { formatDate } from '@/utils/formatTime'
|
|
||||||
import MarkdownView from '@/components/MarkdownView/index.vue'
|
|
||||||
import { useClipboard } from '@vueuse/core'
|
|
||||||
import { ArrowDownBold, Edit, RefreshRight } from '@element-plus/icons-vue'
|
|
||||||
import { ChatMessageApi, ChatMessageVO } from '@/api/ai/chat/message'
|
|
||||||
import { ChatConversationVO } from '@/api/ai/chat/conversation'
|
|
||||||
import { useUserStore } from '@/store/modules/user'
|
|
||||||
import userAvatarDefaultImg from '@/assets/imgs/avatar.gif'
|
|
||||||
import roleAvatarDefaultImg from '@/assets/ai/gpt.svg'
|
|
||||||
|
|
||||||
const message = useMessage() // 消息弹窗
|
|
||||||
const { copy } = useClipboard() // 初始化 copy 到粘贴板
|
|
||||||
const userStore = useUserStore()
|
|
||||||
|
|
||||||
// 判断“消息列表”滚动的位置(用于判断是否需要滚动到消息最下方)
|
|
||||||
const messageContainer: any = ref(null)
|
|
||||||
const isScrolling = ref(false) //用于判断用户是否在滚动
|
|
||||||
|
|
||||||
const userAvatar = computed(() => userStore.user.avatar ?? userAvatarDefaultImg)
|
|
||||||
const roleAvatar = computed(() => props.conversation.roleAvatar ?? roleAvatarDefaultImg)
|
|
||||||
|
|
||||||
// 定义 props
|
|
||||||
const props = defineProps({
|
|
||||||
conversation: {
|
|
||||||
type: Object as PropType<ChatConversationVO>,
|
|
||||||
required: true
|
|
||||||
},
|
|
||||||
list: {
|
|
||||||
type: Array as PropType<ChatMessageVO[]>,
|
|
||||||
required: true
|
|
||||||
}
|
|
||||||
})
|
|
||||||
|
|
||||||
const { list } = toRefs(props) // 消息列表
|
|
||||||
|
|
||||||
const emits = defineEmits(['onDeleteSuccess', 'onRefresh', 'onEdit']) // 定义 emits
|
|
||||||
|
|
||||||
// ============ 处理对话滚动 ==============
|
|
||||||
|
|
||||||
/** 滚动到底部 */
|
|
||||||
const scrollToBottom = async (isIgnore?: boolean) => {
|
|
||||||
// 注意要使用 nextTick 以免获取不到 dom
|
|
||||||
await nextTick()
|
|
||||||
if (isIgnore || !isScrolling.value) {
|
|
||||||
messageContainer.value.scrollTop =
|
|
||||||
messageContainer.value.scrollHeight - messageContainer.value.offsetHeight
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
function handleScroll() {
|
|
||||||
const scrollContainer = messageContainer.value
|
|
||||||
const scrollTop = scrollContainer.scrollTop
|
|
||||||
const scrollHeight = scrollContainer.scrollHeight
|
|
||||||
const offsetHeight = scrollContainer.offsetHeight
|
|
||||||
if (scrollTop + offsetHeight < scrollHeight - 100) {
|
|
||||||
// 用户开始滚动并在最底部之上,取消保持在最底部的效果
|
|
||||||
isScrolling.value = true
|
|
||||||
} else {
|
|
||||||
// 用户停止滚动并滚动到最底部,开启保持到最底部的效果
|
|
||||||
isScrolling.value = false
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/** 回到底部 */
|
|
||||||
const handleGoBottom = async () => {
|
|
||||||
const scrollContainer = messageContainer.value
|
|
||||||
scrollContainer.scrollTop = scrollContainer.scrollHeight
|
|
||||||
}
|
|
||||||
|
|
||||||
/** 回到顶部 */
|
|
||||||
const handlerGoTop = async () => {
|
|
||||||
const scrollContainer = messageContainer.value
|
|
||||||
scrollContainer.scrollTop = 0
|
|
||||||
}
|
|
||||||
|
|
||||||
defineExpose({ scrollToBottom, handlerGoTop }) // 提供方法给 parent 调用
|
|
||||||
|
|
||||||
// ============ 处理消息操作 ==============
|
|
||||||
|
|
||||||
/** 复制 */
|
|
||||||
const copyContent = async (content) => {
|
|
||||||
await copy(content)
|
|
||||||
message.success('复制成功!')
|
|
||||||
}
|
|
||||||
|
|
||||||
/** 删除 */
|
|
||||||
const onDelete = async (id) => {
|
|
||||||
// 删除 message
|
|
||||||
await ChatMessageApi.deleteChatMessage(id)
|
|
||||||
message.success('删除成功!')
|
|
||||||
// 回调
|
|
||||||
emits('onDeleteSuccess')
|
|
||||||
}
|
|
||||||
|
|
||||||
/** 刷新 */
|
|
||||||
const onRefresh = async (message: ChatMessageVO) => {
|
|
||||||
emits('onRefresh', message)
|
|
||||||
}
|
|
||||||
|
|
||||||
/** 编辑 */
|
|
||||||
const onEdit = async (message: ChatMessageVO) => {
|
|
||||||
emits('onEdit', message)
|
|
||||||
}
|
|
||||||
|
|
||||||
/** 初始化 */
|
|
||||||
onMounted(async () => {
|
|
||||||
messageContainer.value.addEventListener('scroll', handleScroll)
|
|
||||||
})
|
|
||||||
</script>
|
|
||||||
|
|
||||||
<style scoped lang="scss">
|
|
||||||
.message-container {
|
|
||||||
position: relative;
|
|
||||||
overflow-y: scroll;
|
|
||||||
}
|
|
||||||
|
|
||||||
// 中间
|
|
||||||
.chat-list {
|
|
||||||
display: flex;
|
|
||||||
flex-direction: column;
|
|
||||||
overflow-y: hidden;
|
|
||||||
padding: 0 20px;
|
|
||||||
.message-item {
|
|
||||||
margin-top: 50px;
|
|
||||||
}
|
|
||||||
|
|
||||||
.left-message {
|
|
||||||
display: flex;
|
|
||||||
flex-direction: row;
|
|
||||||
}
|
|
||||||
|
|
||||||
.right-message {
|
|
||||||
display: flex;
|
|
||||||
flex-direction: row-reverse;
|
|
||||||
justify-content: flex-start;
|
|
||||||
}
|
|
||||||
|
|
||||||
.message {
|
|
||||||
display: flex;
|
|
||||||
flex-direction: column;
|
|
||||||
text-align: left;
|
|
||||||
margin: 0 15px;
|
|
||||||
|
|
||||||
.time {
|
|
||||||
text-align: left;
|
|
||||||
line-height: 30px;
|
|
||||||
}
|
|
||||||
|
|
||||||
.left-text-container {
|
|
||||||
position: relative;
|
|
||||||
display: flex;
|
|
||||||
flex-direction: column;
|
|
||||||
overflow-wrap: break-word;
|
|
||||||
background-color: rgba(228, 228, 228, 0.8);
|
|
||||||
box-shadow: 0 0 0 1px rgba(228, 228, 228, 0.8);
|
|
||||||
border-radius: 10px;
|
|
||||||
padding: 10px 10px 5px 10px;
|
|
||||||
|
|
||||||
.left-text {
|
|
||||||
color: #393939;
|
|
||||||
font-size: 0.95rem;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
.right-text-container {
|
|
||||||
display: flex;
|
|
||||||
flex-direction: row-reverse;
|
|
||||||
|
|
||||||
.right-text {
|
|
||||||
font-size: 0.95rem;
|
|
||||||
color: #fff;
|
|
||||||
display: inline;
|
|
||||||
background-color: #267fff;
|
|
||||||
box-shadow: 0 0 0 1px #267fff;
|
|
||||||
border-radius: 10px;
|
|
||||||
padding: 10px;
|
|
||||||
width: auto;
|
|
||||||
overflow-wrap: break-word;
|
|
||||||
white-space: pre-wrap;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
.left-btns {
|
|
||||||
display: flex;
|
|
||||||
flex-direction: row;
|
|
||||||
margin-top: 8px;
|
|
||||||
}
|
|
||||||
|
|
||||||
.right-btns {
|
|
||||||
display: flex;
|
|
||||||
flex-direction: row-reverse;
|
|
||||||
margin-top: 8px;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
// 复制、删除按钮
|
|
||||||
.btn-cus {
|
|
||||||
display: flex;
|
|
||||||
background-color: transparent;
|
|
||||||
align-items: center;
|
|
||||||
|
|
||||||
.btn-image {
|
|
||||||
height: 20px;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
.btn-cus:hover {
|
|
||||||
cursor: pointer;
|
|
||||||
background-color: #f6f6f6;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
// 回到底部
|
|
||||||
.to-bottom {
|
|
||||||
position: absolute;
|
|
||||||
z-index: 1000;
|
|
||||||
bottom: 0;
|
|
||||||
right: 50%;
|
|
||||||
}
|
|
||||||
</style>
|
|
@ -1,83 +0,0 @@
|
|||||||
<!-- 消息列表为空时,展示 prompt 列表 -->
|
|
||||||
<template>
|
|
||||||
<div class="chat-empty">
|
|
||||||
<!-- title -->
|
|
||||||
<div class="center-container">
|
|
||||||
<div class="title">君风科技 AI</div>
|
|
||||||
<div class="role-list">
|
|
||||||
<div
|
|
||||||
class="role-item"
|
|
||||||
v-for="prompt in promptList"
|
|
||||||
:key="prompt.prompt"
|
|
||||||
@click="handlerPromptClick(prompt)"
|
|
||||||
>
|
|
||||||
{{ prompt.prompt }}
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</template>
|
|
||||||
<script setup lang="ts">
|
|
||||||
const promptList = [
|
|
||||||
{
|
|
||||||
prompt: '今天气怎么样?'
|
|
||||||
},
|
|
||||||
{
|
|
||||||
prompt: '写一首好听的诗歌?'
|
|
||||||
}
|
|
||||||
] // prompt 列表
|
|
||||||
|
|
||||||
const emits = defineEmits(['onPrompt'])
|
|
||||||
|
|
||||||
/** 选中 prompt 点击 */
|
|
||||||
const handlerPromptClick = async ({ prompt }) => {
|
|
||||||
emits('onPrompt', prompt)
|
|
||||||
}
|
|
||||||
</script>
|
|
||||||
<style scoped lang="scss">
|
|
||||||
.chat-empty {
|
|
||||||
position: relative;
|
|
||||||
display: flex;
|
|
||||||
flex-direction: row;
|
|
||||||
justify-content: center;
|
|
||||||
width: 100%;
|
|
||||||
height: 100%;
|
|
||||||
|
|
||||||
.center-container {
|
|
||||||
display: flex;
|
|
||||||
flex-direction: column;
|
|
||||||
justify-content: center;
|
|
||||||
|
|
||||||
.title {
|
|
||||||
font-size: 28px;
|
|
||||||
font-weight: bold;
|
|
||||||
text-align: center;
|
|
||||||
}
|
|
||||||
|
|
||||||
.role-list {
|
|
||||||
display: flex;
|
|
||||||
flex-direction: row;
|
|
||||||
flex-wrap: wrap;
|
|
||||||
align-items: center;
|
|
||||||
justify-content: center;
|
|
||||||
width: 460px;
|
|
||||||
margin-top: 20px;
|
|
||||||
|
|
||||||
.role-item {
|
|
||||||
display: flex;
|
|
||||||
justify-content: center;
|
|
||||||
width: 180px;
|
|
||||||
line-height: 50px;
|
|
||||||
border: 1px solid #e4e4e4;
|
|
||||||
border-radius: 10px;
|
|
||||||
margin: 10px;
|
|
||||||
cursor: pointer;
|
|
||||||
}
|
|
||||||
|
|
||||||
.role-item:hover {
|
|
||||||
background-color: rgba(243, 243, 243, 0.73);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
</style>
|
|
@ -1,15 +0,0 @@
|
|||||||
<!-- message 加载页面 -->
|
|
||||||
<template>
|
|
||||||
<div class="message-loading" >
|
|
||||||
<el-skeleton animated />
|
|
||||||
</div>
|
|
||||||
</template>
|
|
||||||
|
|
||||||
<script setup lang="ts">
|
|
||||||
|
|
||||||
</script>
|
|
||||||
<style scoped lang="scss">
|
|
||||||
.message-loading {
|
|
||||||
padding: 30px 30px;
|
|
||||||
}
|
|
||||||
</style>
|
|
@ -1,46 +0,0 @@
|
|||||||
<!-- 无聊天对话时,在 message 区域,可以新增对话 -->
|
|
||||||
<template>
|
|
||||||
<div class="new-chat">
|
|
||||||
<div class="box-center">
|
|
||||||
<div class="tip">点击下方按钮,开始你的对话吧</div>
|
|
||||||
<div class="btns">
|
|
||||||
<el-button type="primary" round @click="handlerNewChat">新建对话1</el-button>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</template>
|
|
||||||
<script setup lang="ts">
|
|
||||||
const emits = defineEmits(['onNewConversation'])
|
|
||||||
|
|
||||||
/** 新建 conversation 聊天对话 */
|
|
||||||
const handlerNewChat = () => {
|
|
||||||
emits('onNewConversation')
|
|
||||||
}
|
|
||||||
</script>
|
|
||||||
<style scoped lang="scss">
|
|
||||||
.new-chat {
|
|
||||||
display: flex;
|
|
||||||
flex-direction: row;
|
|
||||||
justify-content: center;
|
|
||||||
width: 100%;
|
|
||||||
height: 100%;
|
|
||||||
|
|
||||||
.box-center {
|
|
||||||
display: flex;
|
|
||||||
flex-direction: column;
|
|
||||||
justify-content: center;
|
|
||||||
|
|
||||||
.tip {
|
|
||||||
font-size: 14px;
|
|
||||||
color: #858585;
|
|
||||||
}
|
|
||||||
|
|
||||||
.btns {
|
|
||||||
display: flex;
|
|
||||||
flex-direction: row;
|
|
||||||
justify-content: center;
|
|
||||||
margin-top: 20px;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
</style>
|
|
@ -1,27 +0,0 @@
|
|||||||
<template>
|
|
||||||
<div class="container">
|
|
||||||
<h1>本版本中没有开放该功能!</h1>
|
|
||||||
</div>
|
|
||||||
</template>
|
|
||||||
|
|
||||||
<script>
|
|
||||||
export default {
|
|
||||||
name: 'UnderDevelopment',
|
|
||||||
};
|
|
||||||
</script>
|
|
||||||
|
|
||||||
<style scoped>
|
|
||||||
.container {
|
|
||||||
display: flex;
|
|
||||||
justify-content: center;
|
|
||||||
align-items: center;
|
|
||||||
height: 100vh;
|
|
||||||
text-align: center;
|
|
||||||
background-color: #f0f0f0;
|
|
||||||
}
|
|
||||||
|
|
||||||
h1 {
|
|
||||||
font-size: 2rem;
|
|
||||||
color: #333;
|
|
||||||
}
|
|
||||||
</style>
|
|
@ -101,7 +101,7 @@ const formRules = reactive({
|
|||||||
const formRef = ref() // 表单 Ref
|
const formRef = ref() // 表单 Ref
|
||||||
|
|
||||||
// 指定审批人
|
// 指定审批人
|
||||||
const processDefineKey = 'my-test-flow02' // 流程定义 Key
|
const processDefineKey = 'pch-qjgl-001' // 流程定义 Key
|
||||||
const startUserSelectTasks = ref([]) // 发起人需要选择审批人的用户任务列表
|
const startUserSelectTasks = ref([]) // 发起人需要选择审批人的用户任务列表
|
||||||
const startUserSelectAssignees = ref({}) // 发起人选择审批人的数据
|
const startUserSelectAssignees = ref({}) // 发起人选择审批人的数据
|
||||||
const startUserSelectAssigneesFormRef = ref() // 发起人选择审批人的表单 Ref
|
const startUserSelectAssigneesFormRef = ref() // 发起人选择审批人的表单 Ref
|
||||||
|
@ -358,10 +358,11 @@ const getProcessInstance = async () => {
|
|||||||
})
|
})
|
||||||
} else {
|
} else {
|
||||||
// 注意:data.processDefinition.formCustomViewPath 是组件的全路径,例如说:/crm/contract/detail/index.vue
|
// 注意:data.processDefinition.formCustomViewPath 是组件的全路径,例如说:/crm/contract/detail/index.vue
|
||||||
if ( data.processDefinition.formCustomViewPath == "") {
|
//console.log(data.processDefinition.formCustomViewPath,"data.processDefinition.formCustomViewPath")
|
||||||
|
if ( data.processDefinition.formCustomViewPath == "" || data.processDefinition.formCustomViewPath == null) {
|
||||||
const process_key = data.processDefinition.key
|
const process_key = data.processDefinition.key
|
||||||
const formCustomViewPath = await FormProcessMappingApi.getFormViewPath(process_key)
|
const formCustomViewPath = await FormProcessMappingApi.getFormViewPath(process_key)
|
||||||
|
//console.log(formCustomViewPath.length,"formCustomViewPath.length")
|
||||||
if ( formCustomViewPath.length == 1) {
|
if ( formCustomViewPath.length == 1) {
|
||||||
BusinessFormComponent.value = registerComponent(formCustomViewPath[0])
|
BusinessFormComponent.value = registerComponent(formCustomViewPath[0])
|
||||||
} else{
|
} else{
|
||||||
|
@ -147,6 +147,18 @@
|
|||||||
<el-input v-model="formData.classComment" />
|
<el-input v-model="formData.classComment" />
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
</el-col>
|
</el-col>
|
||||||
|
<el-col :span="12">
|
||||||
|
<el-form-item label="模块类型" prop="modelType">
|
||||||
|
<el-select v-model="formData.modelType">
|
||||||
|
<el-option
|
||||||
|
v-for="dict in getIntDictOptions(DICT_TYPE.INFRA_CODEGEN_MODEL_TYPE)"
|
||||||
|
:key="dict.value"
|
||||||
|
:label="dict.label"
|
||||||
|
:value="dict.value"
|
||||||
|
/>
|
||||||
|
</el-select>
|
||||||
|
</el-form-item>
|
||||||
|
</el-col>
|
||||||
|
|
||||||
<el-col v-if="formData.genType === '1'" :span="24">
|
<el-col v-if="formData.genType === '1'" :span="24">
|
||||||
<el-form-item prop="genPath">
|
<el-form-item prop="genPath">
|
||||||
@ -317,7 +329,8 @@ const props = defineProps({
|
|||||||
const formRef = ref()
|
const formRef = ref()
|
||||||
const formData = ref({
|
const formData = ref({
|
||||||
templateType: null,
|
templateType: null,
|
||||||
frontType: null,
|
frontType: 20,
|
||||||
|
modelType:0,
|
||||||
scene: null,
|
scene: null,
|
||||||
moduleName: '',
|
moduleName: '',
|
||||||
businessName: '',
|
businessName: '',
|
||||||
@ -336,6 +349,7 @@ const formData = ref({
|
|||||||
const rules = reactive({
|
const rules = reactive({
|
||||||
templateType: [required],
|
templateType: [required],
|
||||||
frontType: [required],
|
frontType: [required],
|
||||||
|
modelType: [required],
|
||||||
scene: [required],
|
scene: [required],
|
||||||
moduleName: [required],
|
moduleName: [required],
|
||||||
businessName: [required],
|
businessName: [required],
|
||||||
|
@ -1,9 +1,4 @@
|
|||||||
<template>
|
<template>
|
||||||
<doc-alert title="代码生成(单表)" url="https://doc.iocoder.cn/new-feature/" />
|
|
||||||
<doc-alert title="代码生成(树表)" url="https://doc.iocoder.cn/new-feature/tree/" />
|
|
||||||
<doc-alert title="代码生成(主子表)" url="https://doc.iocoder.cn/new-feature/master-sub/" />
|
|
||||||
<doc-alert title="单元测试" url="https://doc.iocoder.cn/unit-test/" />
|
|
||||||
|
|
||||||
<!-- 搜索 -->
|
<!-- 搜索 -->
|
||||||
<ContentWrap>
|
<ContentWrap>
|
||||||
<el-form
|
<el-form
|
||||||
|
Loading…
Reference in New Issue
Block a user