You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
161 lines
3.5 KiB
Vue
161 lines
3.5 KiB
Vue
<!--
|
|
* @description: 悬停按钮
|
|
* @fileName: index
|
|
* @author: 17076
|
|
* @date: 2024/6/13-上午10:28
|
|
* @version: V1.0.0
|
|
-->
|
|
|
|
<template>
|
|
<div v-if="!isActived" class="HoverButton" @click="getList">
|
|
<el-popover
|
|
placement="left"
|
|
width="240"
|
|
trigger="click"
|
|
>
|
|
<div class="HoverButton-main">
|
|
<div class="main-new-item" @click="onBtnClicked">
|
|
<img src="@/assets/common/new.png" alt="">
|
|
<span>新对话</span>
|
|
</div>
|
|
<div class="main-message-item">
|
|
<img src="@/assets/common/message.png" alt="">
|
|
<span>最近对话</span>
|
|
<!-- <i class="el-icon-arrow-down el-icon--right" /> -->
|
|
</div>
|
|
<div class="case-list">
|
|
<span :title="item.caseName " v-for="(item,index) in caseList" :key="index" class="case-item" @click="openPage(item)">{{ item.caseName }}</span>
|
|
</div>
|
|
</div>
|
|
<div
|
|
ref="floatButton"
|
|
slot="reference"
|
|
class="float_info"
|
|
/>
|
|
</el-popover>
|
|
|
|
<!--对话弹窗-->
|
|
<conversation-dialog ref="conversion" />
|
|
</div>
|
|
</template>
|
|
<script>
|
|
import store from '@/store'
|
|
import { conversationList } from '@/api/caseManagement'
|
|
export default {
|
|
|
|
name: 'HoverButton',
|
|
data() {
|
|
return {
|
|
caseList: [
|
|
]
|
|
}
|
|
},
|
|
computed: {
|
|
isActived() {
|
|
return this.$route.path === '/policeAi'
|
|
}
|
|
|
|
},
|
|
mounted() {
|
|
this.getList()
|
|
},
|
|
methods: {
|
|
onBtnClicked() {
|
|
store.dispatch('user/setConversationId', 'addNew')
|
|
this.$router.push({
|
|
path: '/policeAi'
|
|
})
|
|
},
|
|
// 查询列表
|
|
async getList() {
|
|
const res = await conversationList({
|
|
pageNum: 1,
|
|
pageSize: 99999
|
|
})
|
|
if (res.code === 200) {
|
|
this.caseList = res.data.records.splice(0, 3)
|
|
}
|
|
},
|
|
openPage(item) {
|
|
store.dispatch('user/setConversationId', item.conversationId)
|
|
this.$router.push({
|
|
path: '/policeAi'
|
|
})
|
|
}
|
|
}
|
|
}
|
|
</script>
|
|
<style lang="scss" scoped>
|
|
.HoverButton {
|
|
.float_info {
|
|
position: fixed;
|
|
bottom: 120px;
|
|
right: 2%;
|
|
width: 50px;
|
|
height: 50px;
|
|
margin: 5px 10px;
|
|
display: flex;
|
|
z-index: 999;
|
|
cursor: pointer;
|
|
background: url("~@/assets/home/anjianzhushou@2x.png") center no-repeat;
|
|
background-size: 100% 100%;
|
|
}
|
|
}
|
|
.HoverButton-main {
|
|
// padding: 16px;
|
|
.main-new-item {
|
|
display: flex;
|
|
background: rgba(55,99,255,0.1);
|
|
border-radius: 8px 8px 8px 8px;
|
|
border: 1px solid #3763FF;
|
|
height: 49px;
|
|
align-items: center;
|
|
padding-left: 16px;
|
|
cursor: pointer;
|
|
img {
|
|
width: 18px;
|
|
height: 18px;
|
|
}
|
|
span {
|
|
font-size: 16px;
|
|
color: #3763FF;
|
|
margin-left: 10px;
|
|
}
|
|
}
|
|
.main-message-item {
|
|
display: flex; height: 49px;
|
|
align-items: center;
|
|
padding-left: 16px;
|
|
cursor: pointer;
|
|
img {
|
|
width: 18px;
|
|
height: 18px;
|
|
}
|
|
span {
|
|
font-size: 16px;
|
|
color: #333333;
|
|
margin-left: 10px;
|
|
margin-right: 100px;
|
|
}
|
|
}
|
|
.case-list {
|
|
display: flex;
|
|
flex-direction: column;
|
|
.case-item {
|
|
height: 34px;font-size: 14px;
|
|
color: #666666;
|
|
padding-left: 45px;
|
|
line-height: 34px;
|
|
cursor: pointer;
|
|
width: 200px;
|
|
overflow: hidden;
|
|
text-overflow: ellipsis;
|
|
white-space: nowrap;
|
|
}
|
|
.case-item:hover {
|
|
background: #F5F5F5;
|
|
}
|
|
}
|
|
}
|
|
</style>
|