fix: improve formatting and consistency in ChatHistoryDrawer.vue
This commit is contained in:
parent
15ec70c4a8
commit
f78027818d
@ -10,7 +10,7 @@
|
||||
>
|
||||
<el-button class="collapse cursor" circle @click="show = !show">
|
||||
<el-icon>
|
||||
<component :is="!show ? 'ArrowRightBold' : 'ArrowLeftBold'" />
|
||||
<component :is="!show ? 'ArrowRightBold' : 'ArrowLeftBold'"/>
|
||||
</el-icon>
|
||||
</el-button>
|
||||
<HistoryPanel
|
||||
@ -32,12 +32,12 @@
|
||||
chatUser.chat_profile.authentication_type === 'password'
|
||||
"
|
||||
>
|
||||
<img src="@/assets/user-icon.svg" style="width: 54%" alt="" />
|
||||
<img src="@/assets/user-icon.svg" style="width: 54%" alt=""/>
|
||||
</el-avatar>
|
||||
<el-dropdown v-else trigger="click" type="primary" class="w-full">
|
||||
<div class="flex align-center">
|
||||
<el-avatar :size="32">
|
||||
<img src="@/assets/user-icon.svg" style="width: 54%" alt="" />
|
||||
<img src="@/assets/user-icon.svg" style="width: 54%" alt=""/>
|
||||
</el-avatar>
|
||||
<span class="ml-8 color-text-primary">{{ chatUser.chatUserProfile?.nick_name }}</span>
|
||||
</div>
|
||||
@ -47,7 +47,7 @@
|
||||
<div class="flex align-center p-8">
|
||||
<div class="mr-8 flex align-center">
|
||||
<el-avatar :size="40">
|
||||
<img src="@/assets/user-icon.svg" style="width: 54%" alt="" />
|
||||
<img src="@/assets/user-icon.svg" style="width: 54%" alt=""/>
|
||||
</el-avatar>
|
||||
</div>
|
||||
<div>
|
||||
@ -72,7 +72,7 @@
|
||||
style="padding-top: 8px; padding-bottom: 8px"
|
||||
@click="logout"
|
||||
>
|
||||
<AppIcon iconName="app-export" class="color-secondary" />
|
||||
<AppIcon iconName="app-export" class="color-secondary"/>
|
||||
{{ $t('layout.logout') }}
|
||||
</el-dropdown-item>
|
||||
</el-dropdown-menu>
|
||||
@ -91,15 +91,16 @@
|
||||
</template>
|
||||
|
||||
<script setup lang="ts">
|
||||
import { ref, computed, defineModel } from 'vue'
|
||||
import {ref, computed, defineModel} from 'vue'
|
||||
import useStore from '@/stores'
|
||||
import HistoryPanel from '@/views/chat/component/HistoryPanel.vue'
|
||||
import ResetPassword from '@/layout/layout-header/avatar/ResetPassword.vue'
|
||||
import type { ResetCurrentUserPasswordRequest } from '@/api/type/user'
|
||||
import type {ResetCurrentUserPasswordRequest} from '@/api/type/user'
|
||||
import chatAPI from '@/api/chat/chat'
|
||||
import { useRouter } from 'vue-router'
|
||||
const router = useRouter()
|
||||
import {useRoute, useRouter} from 'vue-router'
|
||||
|
||||
const router = useRouter()
|
||||
const route = useRoute()
|
||||
const show = defineModel<boolean>('show')
|
||||
|
||||
const props = defineProps<{
|
||||
@ -111,7 +112,7 @@ const props = defineProps<{
|
||||
|
||||
const emit = defineEmits(['newChat', 'clickLog', 'deleteLog', 'refreshFieldTitle', 'clearChat'])
|
||||
|
||||
const { chatUser } = useStore()
|
||||
const {chatUser} = useStore()
|
||||
|
||||
const clearChat = () => {
|
||||
emit('clearChat')
|
||||
@ -128,6 +129,7 @@ const handleClickList = (item: any) => {
|
||||
const deleteChatLog = (row: any) => {
|
||||
emit('deleteLog', row)
|
||||
}
|
||||
|
||||
function refreshFieldTitle(chatId: string, abstract: string) {
|
||||
emit('refreshFieldTitle', chatId, abstract)
|
||||
}
|
||||
@ -139,13 +141,18 @@ const openResetPassword = () => {
|
||||
|
||||
const handleResetPassword = (param: ResetCurrentUserPasswordRequest) => {
|
||||
chatAPI.resetCurrentPassword(param).then(() => {
|
||||
router.push({ name: 'login' })
|
||||
router.push({name: 'login'})
|
||||
})
|
||||
}
|
||||
|
||||
const logout = () => {
|
||||
chatUser.logout().then(() => {
|
||||
router.push({ name: 'login' })
|
||||
router.push({
|
||||
name: 'login',
|
||||
params: {accessToken: chatUser.accessToken},
|
||||
query: route.query,
|
||||
})
|
||||
|
||||
})
|
||||
}
|
||||
</script>
|
||||
|
||||
Loading…
Reference in New Issue
Block a user