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

View File

@ -533,5 +533,5 @@ h5 {
.chat-background { .chat-background {
background-repeat: no-repeat; background-repeat: no-repeat;
background-position: center; 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 { const {
query: { mode }, query: { mode },
params: { accessToken },
} = route as any } = route as any
const currentTemplate = computed(() => { const currentTemplate = computed(() => {
console.log(common.isMobile())
let modeName = '' let modeName = ''
if (!mode || mode === 'pc') { if (!mode || mode === 'pc') {
modeName = common.isMobile() ? 'mobile' : 'pc' modeName = common.isMobile() ? 'mobile' : 'pc'

View File

@ -2,6 +2,7 @@
<div <div
class="chat-mobile layout-bg chat-background" class="chat-mobile layout-bg chat-background"
v-loading="loading" v-loading="loading"
:class="classObj"
:style="{ :style="{
'--el-color-primary': applicationDetail?.custom_theme?.theme_color, '--el-color-primary': applicationDetail?.custom_theme?.theme_color,
'--el-color-primary-light-9': hexToRgba(applicationDetail?.custom_theme?.theme_color, 0.1), '--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 UserCenter from './component/UserCenter.vue'
import chatAPI from '@/api/chat/chat' import chatAPI from '@/api/chat/chat'
const { user, chatLog, chatUser } = useStore() const { user, chatLog, chatUser, common } = useStore()
const AiChatRef = ref() const AiChatRef = ref()
const loading = ref(false) const loading = ref(false)
@ -199,6 +200,12 @@ const customStyle = computed(() => {
} }
}) })
const classObj = computed(() => {
return {
mobile: common.isMobile(),
}
})
function editName(val: string, item: any) { function editName(val: string, item: any) {
if (val) { if (val) {
const obj = { 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(() => { const classObj = computed(() => {
return { return {
mobile: common.isMobile(), mobile: common.isMobile(),
@ -576,12 +569,6 @@ async function exportHTML(): Promise<void> {
*初始化历史对话记录 *初始化历史对话记录
*/ */
const init = () => { const init = () => {
// if (
// (applicationDetail.value.show_history || !user.isEnterprise()) &&
// props.applicationAvailable
// ) {
// getChatLog(applicationDetail.value.id)
// }
getChatLog(applicationDetail.value?.id) getChatLog(applicationDetail.value?.id)
} }
onMounted(() => { onMounted(() => {
@ -639,6 +626,7 @@ function closeExecutionDetail() {
&__left { &__left {
position: relative; position: relative;
z-index: 1;
.el-menu { .el-menu {
display: flex; display: flex;