feat: chat

This commit is contained in:
wangdan-fit2cloud 2025-07-04 11:09:33 +08:00
parent be759701cc
commit 45444bb256
5 changed files with 14 additions and 20 deletions

View File

@ -1,5 +1,4 @@
import { nextTick, onBeforeMount, onMounted, onBeforeUnmount } from 'vue'
import { useRoute } from 'vue-router'
import useStore from '@/stores'
import { DeviceType } from '@/enums/common'
/** 参考 Bootstrap 的响应式设计 WIDTH = 768 */
@ -32,7 +31,7 @@ export default () => {
})
})
onBeforeUnmount(() => {
window.removeEventListener('resize', _resizeHandler)
})
// onBeforeUnmount(() => {
// window.removeEventListener('resize', _resizeHandler)
// })
}

View File

@ -533,5 +533,5 @@ h5 {
.chat-background {
background-repeat: no-repeat;
background-position: center;
background-size: auto 100%;
background-size: cover;
}

View File

@ -21,10 +21,10 @@ const components: any = import.meta.glob('@/views/chat/**/index.vue', {
const {
query: { mode },
params: { accessToken },
} = route as any
const currentTemplate = computed(() => {
console.log(common.isMobile())
let modeName = ''
if (!mode || mode === 'pc') {
modeName = common.isMobile() ? 'mobile' : 'pc'

View File

@ -2,6 +2,7 @@
<div
class="chat-mobile layout-bg chat-background"
v-loading="loading"
:class="classObj"
:style="{
'--el-color-primary': applicationDetail?.custom_theme?.theme_color,
'--el-color-primary-light-9': hexToRgba(applicationDetail?.custom_theme?.theme_color, 0.1),
@ -164,7 +165,7 @@ import { t } from '@/locales'
import UserCenter from './component/UserCenter.vue'
import chatAPI from '@/api/chat/chat'
const { user, chatLog, chatUser } = useStore()
const { user, chatLog, chatUser, common } = useStore()
const AiChatRef = ref()
const loading = ref(false)
@ -199,6 +200,12 @@ const customStyle = computed(() => {
}
})
const classObj = computed(() => {
return {
mobile: common.isMobile(),
}
})
function editName(val: string, item: any) {
if (val) {
const obj = {

View File

@ -367,13 +367,6 @@ const handleResetPassword = (param: ResetCurrentUserPasswordRequest) => {
})
}
const customStyle = computed(() => {
return {
background: applicationDetail.value?.custom_theme?.theme_color,
color: applicationDetail.value?.custom_theme?.header_font_color,
}
})
const classObj = computed(() => {
return {
mobile: common.isMobile(),
@ -576,12 +569,6 @@ async function exportHTML(): Promise<void> {
*初始化历史对话记录
*/
const init = () => {
// if (
// (applicationDetail.value.show_history || !user.isEnterprise()) &&
// props.applicationAvailable
// ) {
// getChatLog(applicationDetail.value.id)
// }
getChatLog(applicationDetail.value?.id)
}
onMounted(() => {
@ -639,6 +626,7 @@ function closeExecutionDetail() {
&__left {
position: relative;
z-index: 1;
.el-menu {
display: flex;