Merge branch 'main' of http://172.16.100.91:3000/scout666/chat-pc
This commit is contained in:
commit
c7df773b97
1
components.d.ts
vendored
1
components.d.ts
vendored
@ -63,6 +63,7 @@ declare module 'vue' {
|
|||||||
NotificationApi: typeof import('./src/components/common/NotificationApi.vue')['default']
|
NotificationApi: typeof import('./src/components/common/NotificationApi.vue')['default']
|
||||||
NPopover: typeof import('naive-ui')['NPopover']
|
NPopover: typeof import('naive-ui')['NPopover']
|
||||||
NRadio: typeof import('naive-ui')['NRadio']
|
NRadio: typeof import('naive-ui')['NRadio']
|
||||||
|
NScrollbar: typeof import('naive-ui')['NScrollbar']
|
||||||
NSpin: typeof import('naive-ui')['NSpin']
|
NSpin: typeof import('naive-ui')['NSpin']
|
||||||
NTag: typeof import('naive-ui')['NTag']
|
NTag: typeof import('naive-ui')['NTag']
|
||||||
NVirtualList: typeof import('naive-ui')['NVirtualList']
|
NVirtualList: typeof import('naive-ui')['NVirtualList']
|
||||||
|
@ -80,7 +80,7 @@ const props = defineProps({
|
|||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
|
||||||
const emit = defineEmits(['update:show', 'cancel', 'confirm'])
|
const emit = defineEmits(['update:show', 'cancel', 'confirm', 'customCloseModal'])
|
||||||
|
|
||||||
const show = computed({
|
const show = computed({
|
||||||
get: () => props.show,
|
get: () => props.show,
|
||||||
@ -111,7 +111,7 @@ const state = reactive({
|
|||||||
|
|
||||||
const handleCloseModal = () => {
|
const handleCloseModal = () => {
|
||||||
if (props.customCloseEvent) {
|
if (props.customCloseEvent) {
|
||||||
emit('closeModal')
|
emit('customCloseModal')
|
||||||
} else {
|
} else {
|
||||||
show.value = false
|
show.value = false
|
||||||
}
|
}
|
||||||
|
@ -663,7 +663,10 @@ const handleEditGroupNameConfirm = () => {
|
|||||||
清空聊天记录
|
清空聊天记录
|
||||||
</n-button>
|
</n-button>
|
||||||
<n-button
|
<n-button
|
||||||
v-if="isAdmin || isLeader"
|
v-if="
|
||||||
|
(isAdmin || isLeader) &&
|
||||||
|
(state.detail.group_type === 1 || state.detail.group_type === 3)
|
||||||
|
"
|
||||||
class="btn"
|
class="btn"
|
||||||
type="error"
|
type="error"
|
||||||
ghost
|
ghost
|
||||||
@ -671,7 +674,13 @@ const handleEditGroupNameConfirm = () => {
|
|||||||
>
|
>
|
||||||
解散该群
|
解散该群
|
||||||
</n-button>
|
</n-button>
|
||||||
<n-button class="btn" type="error" ghost @click="showChatSettingOperateModal('quit')">
|
<n-button
|
||||||
|
class="btn"
|
||||||
|
type="error"
|
||||||
|
ghost
|
||||||
|
@click="showChatSettingOperateModal('quit')"
|
||||||
|
v-if="state.detail.group_type === 1 || state.detail.group_type === 3"
|
||||||
|
>
|
||||||
退出群聊
|
退出群聊
|
||||||
</n-button>
|
</n-button>
|
||||||
</div>
|
</div>
|
||||||
@ -731,7 +740,8 @@ const handleEditGroupNameConfirm = () => {
|
|||||||
|
|
||||||
<UserCardModal
|
<UserCardModal
|
||||||
v-model:show="state.isShowUserCardModal"
|
v-model:show="state.isShowUserCardModal"
|
||||||
v-model:uid="(state.userInfo as any).erp_user_id"
|
v-model:uid="(state.userInfo as any).user_id"
|
||||||
|
:euid="(state.userInfo as any).erp_user_id"
|
||||||
/>
|
/>
|
||||||
</template>
|
</template>
|
||||||
<style lang="less" scoped>
|
<style lang="less" scoped>
|
||||||
|
@ -4,7 +4,7 @@
|
|||||||
:class="props?.conditionType ? 'search-item-condition' : ''"
|
:class="props?.conditionType ? 'search-item-condition' : ''"
|
||||||
v-if="resultName"
|
v-if="resultName"
|
||||||
:style="{
|
:style="{
|
||||||
'margin': props.searchResultKey === 'talk_record_infos_receiver' ? '12px 0 0' : '',
|
margin: props.searchResultKey === 'talk_record_infos_receiver' ? '12px 0 0' : '',
|
||||||
'background-color': props.isClickStay ? '#EEE9F8' : ''
|
'background-color': props.isClickStay ? '#EEE9F8' : ''
|
||||||
}"
|
}"
|
||||||
>
|
>
|
||||||
@ -70,6 +70,9 @@
|
|||||||
:text="resultDetail"
|
:text="resultDetail"
|
||||||
:searchText="props.searchText"
|
:searchText="props.searchText"
|
||||||
/>
|
/>
|
||||||
|
<div class="searchRecordDetail-fastLocal" v-if="searchRecordDetail">
|
||||||
|
<span>定位到聊天位置</span>
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="search-item-pointer" v-if="pointerIconSrc">
|
<div class="search-item-pointer" v-if="pointerIconSrc">
|
||||||
@ -270,25 +273,25 @@ const resultDetail = computed(() => {
|
|||||||
cursor: pointer;
|
cursor: pointer;
|
||||||
position: relative;
|
position: relative;
|
||||||
|
|
||||||
.search-item-avatar{
|
.search-item-avatar {
|
||||||
position: relative;
|
position: relative;
|
||||||
.info-tag {
|
.info-tag {
|
||||||
display: flex;
|
display: flex;
|
||||||
flex-direction: row;
|
flex-direction: row;
|
||||||
align-items: center;
|
align-items: center;
|
||||||
justify-content: center;
|
justify-content: center;
|
||||||
padding: 0px 6px;
|
padding: 0px 6px;
|
||||||
border: 1px solid #000;
|
border: 1px solid #000;
|
||||||
border-radius: 3px;
|
border-radius: 3px;
|
||||||
flex-shrink: 0;
|
flex-shrink: 0;
|
||||||
background-color: #fff;
|
background-color: #fff;
|
||||||
position: absolute;
|
position: absolute;
|
||||||
bottom: 0;
|
bottom: 0;
|
||||||
left: 4px;
|
left: 4px;
|
||||||
span {
|
span {
|
||||||
line-height: 14px;
|
line-height: 14px;
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
.result-info {
|
.result-info {
|
||||||
@ -320,10 +323,24 @@ const resultDetail = computed(() => {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
.info-detail-searchRecordDetail {
|
.info-detail-searchRecordDetail {
|
||||||
|
display: flex;
|
||||||
|
flex-direction: row;
|
||||||
|
align-items: center;
|
||||||
|
justify-content: space-between;
|
||||||
span {
|
span {
|
||||||
color: #191919;
|
color: #191919;
|
||||||
word-break: break-all;
|
word-break: break-all;
|
||||||
}
|
}
|
||||||
|
.searchRecordDetail-fastLocal {
|
||||||
|
display: none;
|
||||||
|
line-height: 20px;
|
||||||
|
span {
|
||||||
|
color: #46299d;
|
||||||
|
font-size: 12px;
|
||||||
|
font-weight: 400;
|
||||||
|
line-height: 17px;
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
.search-item-pointer {
|
.search-item-pointer {
|
||||||
@ -339,7 +356,7 @@ const resultDetail = computed(() => {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
.search-item::after{
|
.search-item::after {
|
||||||
content: '';
|
content: '';
|
||||||
display: block;
|
display: block;
|
||||||
width: 100%;
|
width: 100%;
|
||||||
@ -355,5 +372,11 @@ const resultDetail = computed(() => {
|
|||||||
}
|
}
|
||||||
.search-item:hover {
|
.search-item:hover {
|
||||||
background-color: #f8f8f8;
|
background-color: #f8f8f8;
|
||||||
|
|
||||||
|
.info-detail-searchRecordDetail {
|
||||||
|
.searchRecordDetail-fastLocal {
|
||||||
|
display: block;
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
</style>
|
</style>
|
||||||
|
@ -1,60 +1,73 @@
|
|||||||
<template>
|
<template>
|
||||||
<div class="search-list">
|
<div class="search-list">
|
||||||
<div class="search-result">
|
<n-infinite-scroll
|
||||||
<div class="search-result-list">
|
:style="{ maxHeight: props.searchResultMaxHeight }"
|
||||||
<div
|
:distance="47"
|
||||||
class="search-result-each-part"
|
@load="doLoadMore"
|
||||||
v-for="(searchResultValue, searchResultKey, searchResultIndex) in state.searchResult"
|
>
|
||||||
:key="searchResultKey"
|
<div class="search-result">
|
||||||
>
|
<div class="search-result-list">
|
||||||
<div
|
<div
|
||||||
class="search-result-part"
|
class="search-result-each-part"
|
||||||
v-if="
|
v-for="(searchResultValue, searchResultKey, searchResultIndex) in state.searchResult"
|
||||||
Array.isArray(state?.searchResult[searchResultKey]) &&
|
:key="searchResultKey"
|
||||||
state?.searchResult[searchResultKey].length > 0 &&
|
|
||||||
searchResultKey !== 'group_infos' &&
|
|
||||||
searchResultKey !== 'group_member_infos'
|
|
||||||
"
|
|
||||||
>
|
>
|
||||||
<div class="result-title">
|
|
||||||
<span class="text-[14px] font-regular">
|
|
||||||
{{ getResultKeysValue(searchResultKey) }}
|
|
||||||
</span>
|
|
||||||
</div>
|
|
||||||
<div class="result-list">
|
|
||||||
<div
|
|
||||||
class="result-list-each"
|
|
||||||
v-for="(item, index) in state?.searchResult[searchResultKey]"
|
|
||||||
:key="index"
|
|
||||||
>
|
|
||||||
<searchItem
|
|
||||||
@click="clickSearchItem(searchResultKey, item)"
|
|
||||||
v-if="(props.listLimit && index < 3) || !props.listLimit"
|
|
||||||
:searchResultKey="searchResultKey"
|
|
||||||
:searchItem="item"
|
|
||||||
:searchText="state.searchText"
|
|
||||||
:searchRecordDetail="props.searchRecordDetail"
|
|
||||||
:isClickStay="
|
|
||||||
props.useClickStay &&
|
|
||||||
typeof state.clickStayItem === 'string' &&
|
|
||||||
state.clickStayItem === `${item.talk_type}_${item.receiver_id}`
|
|
||||||
"
|
|
||||||
></searchItem>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
<div
|
<div
|
||||||
class="result-has-more"
|
class="search-result-part"
|
||||||
v-if="getHasMoreResult(searchResultKey)"
|
v-if="
|
||||||
@click="toMoreResultPage(searchResultKey)"
|
Array.isArray(state?.searchResult[searchResultKey]) &&
|
||||||
|
state?.searchResult[searchResultKey].length > 0 &&
|
||||||
|
searchResultKey !== 'group_infos' &&
|
||||||
|
searchResultKey !== 'group_member_infos'
|
||||||
|
"
|
||||||
|
:style="{ margin: props.useCustomTitle ? '0' : '' }"
|
||||||
>
|
>
|
||||||
<span class="text-[14px] font-regular">
|
<!-- <div class="result-title" v-if="!props.useCustomTitle">
|
||||||
{{ getHasMoreResult(searchResultKey) }}
|
<span class="text-[14px] font-regular">
|
||||||
</span>
|
{{ getResultKeysValue(searchResultKey) }}
|
||||||
|
</span>
|
||||||
|
</div> -->
|
||||||
|
<slot
|
||||||
|
name="result-title"
|
||||||
|
:getResultKeysValue="getResultKeysValue"
|
||||||
|
:searchResultKey="searchResultKey"
|
||||||
|
:searchResultIndex="searchResultIndex"
|
||||||
|
></slot>
|
||||||
|
<div class="result-list">
|
||||||
|
<div
|
||||||
|
class="result-list-each"
|
||||||
|
v-for="(item, index) in state?.searchResult[searchResultKey]"
|
||||||
|
:key="index"
|
||||||
|
>
|
||||||
|
<searchItem
|
||||||
|
@click="clickSearchItem(searchResultKey, item)"
|
||||||
|
v-if="(props.listLimit && index < 3) || !props.listLimit"
|
||||||
|
:searchResultKey="searchResultKey"
|
||||||
|
:searchItem="item"
|
||||||
|
:searchText="state.searchText"
|
||||||
|
:searchRecordDetail="props.searchRecordDetail"
|
||||||
|
:isClickStay="
|
||||||
|
props.useClickStay &&
|
||||||
|
typeof state.clickStayItem === 'string' &&
|
||||||
|
state.clickStayItem === `${item.talk_type}_${item.receiver_id}`
|
||||||
|
"
|
||||||
|
></searchItem>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div
|
||||||
|
class="result-has-more"
|
||||||
|
v-if="getHasMoreResult(searchResultKey)"
|
||||||
|
@click="toMoreResultPage(searchResultKey)"
|
||||||
|
>
|
||||||
|
<span class="text-[14px] font-regular">
|
||||||
|
{{ getHasMoreResult(searchResultKey) }}
|
||||||
|
</span>
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</n-infinite-scroll>
|
||||||
<!-- <ZPaging
|
<!-- <ZPaging
|
||||||
ref="zPaging"
|
ref="zPaging"
|
||||||
:show-scrollbar="false"
|
:show-scrollbar="false"
|
||||||
@ -131,6 +144,7 @@
|
|||||||
// const zPaging = ref()
|
// const zPaging = ref()
|
||||||
// useZPaging(zPaging)
|
// useZPaging(zPaging)
|
||||||
|
|
||||||
|
import { NInfiniteScroll } from 'naive-ui'
|
||||||
import searchItem from './searchItem.vue'
|
import searchItem from './searchItem.vue'
|
||||||
import { ref, reactive, defineEmits, defineProps, onMounted, watch } from 'vue'
|
import { ref, reactive, defineEmits, defineProps, onMounted, watch } from 'vue'
|
||||||
|
|
||||||
@ -139,7 +153,7 @@ const emits = defineEmits([
|
|||||||
'lastIdChange',
|
'lastIdChange',
|
||||||
'clickSearchItem',
|
'clickSearchItem',
|
||||||
'clickStayItemChange',
|
'clickStayItemChange',
|
||||||
'doLoadMore'
|
'resultTotalCount'
|
||||||
])
|
])
|
||||||
|
|
||||||
const state = reactive({
|
const state = reactive({
|
||||||
@ -148,7 +162,9 @@ const state = reactive({
|
|||||||
searchResult: null, //搜索结果
|
searchResult: null, //搜索结果
|
||||||
pageNum: 1, //当前请求数据页数
|
pageNum: 1, //当前请求数据页数
|
||||||
uid: 12303, //当前用户id
|
uid: 12303, //当前用户id
|
||||||
clickStayItem: '' //点击停留的item
|
clickStayItem: '', //点击停留的item
|
||||||
|
hasMore: true, //是否还有更多数据
|
||||||
|
loading: false //加载锁
|
||||||
})
|
})
|
||||||
|
|
||||||
const props = defineProps({
|
const props = defineProps({
|
||||||
@ -190,7 +206,15 @@ const props = defineProps({
|
|||||||
useClickStay: {
|
useClickStay: {
|
||||||
type: Boolean,
|
type: Boolean,
|
||||||
default: false
|
default: false
|
||||||
} //是否使用点击停留样式
|
}, //是否使用点击停留样式
|
||||||
|
searchResultMaxHeight: {
|
||||||
|
type: String,
|
||||||
|
default: '677px'
|
||||||
|
}, //搜索结果最大高度
|
||||||
|
useCustomTitle: {
|
||||||
|
type: Boolean,
|
||||||
|
default: false
|
||||||
|
} //是否使用自定义标题
|
||||||
})
|
})
|
||||||
|
|
||||||
onMounted(() => {
|
onMounted(() => {
|
||||||
@ -212,28 +236,21 @@ watch(
|
|||||||
watch(
|
watch(
|
||||||
() => props.searchText,
|
() => props.searchText,
|
||||||
(newVal, oldVal) => {
|
(newVal, oldVal) => {
|
||||||
queryAllSearch()
|
// 同步更新 state.searchText
|
||||||
|
state.searchText = newVal
|
||||||
|
// 清空搜索结果
|
||||||
|
state.searchResult = null
|
||||||
|
// 重置页码
|
||||||
|
state.pageNum = 1
|
||||||
|
//重置点击停留列表项
|
||||||
state.clickStayItem = ''
|
state.clickStayItem = ''
|
||||||
emits('clickStayItemChange', state.clickStayItem)
|
emits('clickStayItemChange', state.clickStayItem)
|
||||||
|
//重置搜索条件
|
||||||
|
emits('lastIdChange', 0, 0, 0, '', '')
|
||||||
|
queryAllSearch()
|
||||||
}
|
}
|
||||||
)
|
)
|
||||||
|
|
||||||
//输入搜索文本
|
|
||||||
const inputSearchText = (e) => {
|
|
||||||
if (e.trim() != state.searchText.trim()) {
|
|
||||||
state.pageNum = 1
|
|
||||||
state.searchResult = null // 清空搜索结果
|
|
||||||
emits('lastIdChange', 0, 0, 0, '', '')
|
|
||||||
}
|
|
||||||
state.searchText = e.trim()
|
|
||||||
if (!e.trim()) {
|
|
||||||
state.searchResult = null // 清空搜索结果
|
|
||||||
emits('lastIdChange', 0, 0, 0, '', '')
|
|
||||||
}
|
|
||||||
// zPaging.value?.reload()
|
|
||||||
queryAllSearch()
|
|
||||||
}
|
|
||||||
|
|
||||||
// ES搜索聊天记录-主页搜索什么都有、指定用户、指定群、群与用户概览
|
// ES搜索聊天记录-主页搜索什么都有、指定用户、指定群、群与用户概览
|
||||||
const queryAllSearch = (doClearSearchResult) => {
|
const queryAllSearch = (doClearSearchResult) => {
|
||||||
if (doClearSearchResult) {
|
if (doClearSearchResult) {
|
||||||
@ -354,6 +371,12 @@ const queryAllSearch = (doClearSearchResult) => {
|
|||||||
total = data.group_record_count
|
total = data.group_record_count
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
if (total < props.searchResultPageSize) {
|
||||||
|
state.hasMore = false
|
||||||
|
} else {
|
||||||
|
state.hasMore = true
|
||||||
|
}
|
||||||
|
emits('resultTotalCount', total)
|
||||||
// zPaging.value?.completeByTotal([data], total)
|
// zPaging.value?.completeByTotal([data], total)
|
||||||
} else {
|
} else {
|
||||||
state.searchResult = data
|
state.searchResult = data
|
||||||
@ -383,6 +406,7 @@ const queryAllSearch = (doClearSearchResult) => {
|
|||||||
// zPaging.value?.complete(state.searchResult ? [state.searchResult] : [])
|
// zPaging.value?.complete(state.searchResult ? [state.searchResult] : [])
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
return resp
|
||||||
}
|
}
|
||||||
|
|
||||||
//点击取消搜索
|
//点击取消搜索
|
||||||
@ -514,13 +538,14 @@ const clickSearchItem = (searchResultKey, searchItem) => {
|
|||||||
|
|
||||||
//加载更多数据
|
//加载更多数据
|
||||||
const doLoadMore = (doClearSearchResult) => {
|
const doLoadMore = (doClearSearchResult) => {
|
||||||
queryAllSearch(doClearSearchResult)
|
if (!state.hasMore || state.loading) {
|
||||||
|
return
|
||||||
|
}
|
||||||
|
state.loading = true
|
||||||
|
queryAllSearch(doClearSearchResult).finally(() => {
|
||||||
|
state.loading = false
|
||||||
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
// 暴露doLoadMore方法给父组件
|
|
||||||
defineExpose({
|
|
||||||
doLoadMore
|
|
||||||
})
|
|
||||||
</script>
|
</script>
|
||||||
<style lang="scss" scoped>
|
<style lang="scss" scoped>
|
||||||
.search-list {
|
.search-list {
|
||||||
@ -555,7 +580,7 @@ defineExpose({
|
|||||||
// padding: 0 10px;
|
// padding: 0 10px;
|
||||||
|
|
||||||
.search-result-part {
|
.search-result-part {
|
||||||
margin: 18px 0 0;
|
// margin: 18px 0 0;
|
||||||
|
|
||||||
.result-title {
|
.result-title {
|
||||||
padding: 0 10px 5px;
|
padding: 0 10px 5px;
|
||||||
|
@ -11,6 +11,17 @@ interface Params {
|
|||||||
limit: number
|
limit: number
|
||||||
}
|
}
|
||||||
|
|
||||||
|
interface SpecialParams extends Params {
|
||||||
|
msg_id?: string
|
||||||
|
cursor?: number
|
||||||
|
direction?: 'up' | 'down'
|
||||||
|
}
|
||||||
|
|
||||||
|
interface LoadOptions {
|
||||||
|
specifiedMsg?: SpecialParams
|
||||||
|
middleMsgCreatedAt?: string
|
||||||
|
}
|
||||||
|
|
||||||
export const useTalkRecord = (uid: number) => {
|
export const useTalkRecord = (uid: number) => {
|
||||||
const dialogueStore = useDialogueStore()
|
const dialogueStore = useDialogueStore()
|
||||||
|
|
||||||
@ -25,9 +36,19 @@ export const useTalkRecord = (uid: number) => {
|
|||||||
receiver_id: 0,
|
receiver_id: 0,
|
||||||
talk_type: 0,
|
talk_type: 0,
|
||||||
status: 0,
|
status: 0,
|
||||||
cursor: 0
|
cursor: 0,
|
||||||
|
specialParams: undefined as SpecialParams | undefined
|
||||||
})
|
})
|
||||||
|
|
||||||
|
// 重置 loadConfig
|
||||||
|
const resetLoadConfig = () => {
|
||||||
|
loadConfig.receiver_id = 0
|
||||||
|
loadConfig.talk_type = 0
|
||||||
|
loadConfig.status = 0
|
||||||
|
loadConfig.cursor = 0
|
||||||
|
loadConfig.specialParams = undefined
|
||||||
|
}
|
||||||
|
|
||||||
const onJumpMessage = (msgid: string) => {
|
const onJumpMessage = (msgid: string) => {
|
||||||
const element = document.getElementById(msgid)
|
const element = document.getElementById(msgid)
|
||||||
if (!element) {
|
if (!element) {
|
||||||
@ -135,8 +156,160 @@ export const useTalkRecord = (uid: number) => {
|
|||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// 获取当前消息的最小 sequence
|
||||||
|
const getMinSequence = () => {
|
||||||
|
console.error('records.value', records.value)
|
||||||
|
if (!records.value.length) return 0
|
||||||
|
console.error(Math.min(...records.value.map(item => item.sequence)))
|
||||||
|
return Math.min(...records.value.map(item => item.sequence))
|
||||||
|
}
|
||||||
|
// 获取当前消息的最大 sequence
|
||||||
|
const getMaxSequence = () => {
|
||||||
|
if (!records.value.length) return 0
|
||||||
|
return Math.max(...records.value.map(item => item.sequence))
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 加载数据主入口,支持指定消息定位模式
|
||||||
|
* @param params 原有参数
|
||||||
|
* @param options 可选,{ specifiedMsg } 指定消息对象
|
||||||
|
*/
|
||||||
|
const onLoad = (params: Params, options?: LoadOptions) => {
|
||||||
|
// 如果会话切换,重置所有状态
|
||||||
|
if (params.talk_type !== loadConfig.talk_type || params.receiver_id !== loadConfig.receiver_id) {
|
||||||
|
resetLoadConfig()
|
||||||
|
}
|
||||||
|
|
||||||
|
loadConfig.cursor = 0
|
||||||
|
loadConfig.receiver_id = params.receiver_id
|
||||||
|
loadConfig.talk_type = params.talk_type
|
||||||
|
|
||||||
|
console.error('onLoad', params, options)
|
||||||
|
|
||||||
|
// 新增:支持指定消息定位模式,参数以传入为准合并
|
||||||
|
if (options?.specifiedMsg?.cursor !== undefined) {
|
||||||
|
loadConfig.specialParams = { ...options.specifiedMsg } // 记录特殊参数,供分页加载用
|
||||||
|
console.error('options', options)
|
||||||
|
loadConfig.status = 0 // 复用主流程 loading 状态
|
||||||
|
// 以 params 为基础,合并 specifiedMsg 的所有字段(只要有就覆盖)
|
||||||
|
const contextParams = {
|
||||||
|
...params,
|
||||||
|
...options.specifiedMsg
|
||||||
|
}
|
||||||
|
ServeTalkRecords(contextParams).then(({ data, code }) => {
|
||||||
|
if (code !== 200) {
|
||||||
|
loadConfig.status = 2
|
||||||
|
return
|
||||||
|
}
|
||||||
|
dialogueStore.clearDialogueRecord()
|
||||||
|
const items = (data.items || []).map((item: ITalkRecord) => formatTalkRecord(uid, item))
|
||||||
|
dialogueStore.unshiftDialogueRecord(items.reverse())
|
||||||
|
loadConfig.status = items.length >= contextParams.limit ? 1 : 2
|
||||||
|
loadConfig.cursor = data.cursor
|
||||||
|
nextTick(() => {
|
||||||
|
setTimeout(() => {
|
||||||
|
const el = document.getElementById('imChatPanel')
|
||||||
|
const target = document.getElementById(options.specifiedMsg?.msg_id || '')
|
||||||
|
if (el && target) {
|
||||||
|
const containerRect = el.getBoundingClientRect()
|
||||||
|
const targetRect = target.getBoundingClientRect()
|
||||||
|
const offset = targetRect.top - containerRect.top
|
||||||
|
// 居中
|
||||||
|
const scrollTo = el.scrollTop + offset - el.clientHeight / 2 + target.clientHeight / 2
|
||||||
|
el.scrollTo({ top: scrollTo, behavior: 'smooth' })
|
||||||
|
|
||||||
|
addClass(target, 'border')
|
||||||
|
setTimeout(() => removeClass(target, 'border'), 3000)
|
||||||
|
} else if (el) {
|
||||||
|
el.scrollTop = el.scrollHeight
|
||||||
|
}
|
||||||
|
}, 50)
|
||||||
|
})
|
||||||
|
})
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
loadConfig.specialParams = undefined // 普通模式清空
|
||||||
|
// 原有逻辑
|
||||||
|
load(params)
|
||||||
|
}
|
||||||
|
|
||||||
|
// 向上加载更多(兼容特殊参数模式)
|
||||||
const onRefreshLoad = () => {
|
const onRefreshLoad = () => {
|
||||||
|
console.error('loadConfig.status', loadConfig.status)
|
||||||
if (loadConfig.status == 1) {
|
if (loadConfig.status == 1) {
|
||||||
|
console.log('specialParams', loadConfig.specialParams)
|
||||||
|
// 判断是否是特殊参数模式
|
||||||
|
if (loadConfig.specialParams && typeof loadConfig.specialParams === 'object') {
|
||||||
|
// 检查特殊参数是否与当前会话匹配
|
||||||
|
if (loadConfig.specialParams.talk_type === loadConfig.talk_type &&
|
||||||
|
loadConfig.specialParams.receiver_id === loadConfig.receiver_id) {
|
||||||
|
// 特殊参数模式下,direction: 'up',cursor: 当前最小 sequence
|
||||||
|
onLoad(
|
||||||
|
{
|
||||||
|
receiver_id: loadConfig.receiver_id,
|
||||||
|
talk_type: loadConfig.talk_type,
|
||||||
|
limit: 30
|
||||||
|
},
|
||||||
|
{
|
||||||
|
specifiedMsg: {
|
||||||
|
...loadConfig.specialParams,
|
||||||
|
direction: 'up',
|
||||||
|
cursor: getMinSequence()
|
||||||
|
}
|
||||||
|
}
|
||||||
|
)
|
||||||
|
} else {
|
||||||
|
// 如果不匹配,重置为普通模式
|
||||||
|
resetLoadConfig()
|
||||||
|
load({
|
||||||
|
receiver_id: loadConfig.receiver_id,
|
||||||
|
talk_type: loadConfig.talk_type,
|
||||||
|
limit: 30
|
||||||
|
})
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
// 原有逻辑
|
||||||
|
load({
|
||||||
|
receiver_id: loadConfig.receiver_id,
|
||||||
|
talk_type: loadConfig.talk_type,
|
||||||
|
limit: 30
|
||||||
|
})
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// 向下加载更多(兼容特殊参数模式)
|
||||||
|
const onLoadMoreDown = () => {
|
||||||
|
// 判断是否是特殊参数模式
|
||||||
|
if (loadConfig.specialParams && typeof loadConfig.specialParams === 'object') {
|
||||||
|
// 检查特殊参数是否与当前会话匹配
|
||||||
|
if (loadConfig.specialParams.talk_type === loadConfig.talk_type &&
|
||||||
|
loadConfig.specialParams.receiver_id === loadConfig.receiver_id) {
|
||||||
|
onLoad(
|
||||||
|
{
|
||||||
|
receiver_id: loadConfig.receiver_id,
|
||||||
|
talk_type: loadConfig.talk_type,
|
||||||
|
limit: 30
|
||||||
|
},
|
||||||
|
{
|
||||||
|
specifiedMsg: {
|
||||||
|
...loadConfig.specialParams,
|
||||||
|
direction: 'down',
|
||||||
|
cursor: getMaxSequence()
|
||||||
|
}
|
||||||
|
}
|
||||||
|
)
|
||||||
|
} else {
|
||||||
|
// 如果不匹配,重置为普通模式
|
||||||
|
resetLoadConfig()
|
||||||
|
load({
|
||||||
|
receiver_id: loadConfig.receiver_id,
|
||||||
|
talk_type: loadConfig.talk_type,
|
||||||
|
limit: 30
|
||||||
|
})
|
||||||
|
}
|
||||||
|
} else {
|
||||||
load({
|
load({
|
||||||
receiver_id: loadConfig.receiver_id,
|
receiver_id: loadConfig.receiver_id,
|
||||||
talk_type: loadConfig.talk_type,
|
talk_type: loadConfig.talk_type,
|
||||||
@ -145,13 +318,5 @@ export const useTalkRecord = (uid: number) => {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
const onLoad = (params: Params) => {
|
return { loadConfig, records, onLoad, onRefreshLoad, onLoadMoreDown, onJumpMessage, resetLoadConfig }
|
||||||
loadConfig.cursor = 0
|
|
||||||
loadConfig.receiver_id = params.receiver_id
|
|
||||||
loadConfig.talk_type = params.talk_type
|
|
||||||
|
|
||||||
load(params)
|
|
||||||
}
|
|
||||||
|
|
||||||
return { loadConfig, records, onLoad, onRefreshLoad, onJumpMessage }
|
|
||||||
}
|
}
|
||||||
|
@ -34,6 +34,12 @@ export const useDialogueStore = defineStore('dialogue', {
|
|||||||
// 聊天记录
|
// 聊天记录
|
||||||
records: [],
|
records: [],
|
||||||
|
|
||||||
|
// 查询指定消息上下文的消息信息
|
||||||
|
specifiedMsg: '',
|
||||||
|
|
||||||
|
// 是否是手动切换会话
|
||||||
|
isManualSwitch: false,
|
||||||
|
|
||||||
// 新消息提示
|
// 新消息提示
|
||||||
unreadBubble: 0,
|
unreadBubble: 0,
|
||||||
|
|
||||||
@ -87,6 +93,12 @@ export const useDialogueStore = defineStore('dialogue', {
|
|||||||
this.records = []
|
this.records = []
|
||||||
this.unreadBubble = 0
|
this.unreadBubble = 0
|
||||||
this.isShowEditor = data?.is_robot === 0
|
this.isShowEditor = data?.is_robot === 0
|
||||||
|
|
||||||
|
// 只在手动切换会话时清空 specifiedMsg
|
||||||
|
// if (this.isManualSwitch) {
|
||||||
|
// this.specifiedMsg = ''
|
||||||
|
// this.isManualSwitch = false
|
||||||
|
// }
|
||||||
|
|
||||||
this.members = []
|
this.members = []
|
||||||
if (data.talk_type == 2) {
|
if (data.talk_type == 2) {
|
||||||
|
@ -31,7 +31,8 @@ const talkParams = reactive({
|
|||||||
online: computed(() => dialogueStore.online),
|
online: computed(() => dialogueStore.online),
|
||||||
keyboard: computed(() => dialogueStore.keyboard),
|
keyboard: computed(() => dialogueStore.keyboard),
|
||||||
num: computed(() => dialogueStore.members.length),
|
num: computed(() => dialogueStore.members.length),
|
||||||
avatar:computed(() => dialogueStore.talk.avatar)
|
avatar:computed(() => dialogueStore.talk.avatar),
|
||||||
|
specifiedMsg: computed(() => dialogueStore.specifiedMsg)
|
||||||
})
|
})
|
||||||
|
|
||||||
const state = reactive({
|
const state = reactive({
|
||||||
@ -394,6 +395,7 @@ const handleGroupNoticeModalShow = (isAdmin) => {
|
|||||||
:talk_type="talkParams.type"
|
:talk_type="talkParams.type"
|
||||||
:receiver_id="talkParams.receiver_id"
|
:receiver_id="talkParams.receiver_id"
|
||||||
:index_name="talkParams.index_name"
|
:index_name="talkParams.index_name"
|
||||||
|
:specifiedMsg="talkParams.specifiedMsg"
|
||||||
/>
|
/>
|
||||||
</main>
|
</main>
|
||||||
|
|
||||||
@ -544,7 +546,7 @@ const handleGroupNoticeModalShow = (isAdmin) => {
|
|||||||
@confirm="handleGroupNoticeModalConfirm"
|
@confirm="handleGroupNoticeModalConfirm"
|
||||||
@cancel="handleGroupNoticeModalCancel"
|
@cancel="handleGroupNoticeModalCancel"
|
||||||
:customCloseEvent="state.groupNoticeEditMode === 2 ? true : false"
|
:customCloseEvent="state.groupNoticeEditMode === 2 ? true : false"
|
||||||
@closeModal="handleGroupNoticeModalClose"
|
@customCloseModal="handleGroupNoticeModalClose"
|
||||||
>
|
>
|
||||||
<template #content>
|
<template #content>
|
||||||
<div class="group-notice-modal-content">
|
<div class="group-notice-modal-content">
|
||||||
|
@ -23,7 +23,7 @@ import {
|
|||||||
NButton,
|
NButton,
|
||||||
NPagination
|
NPagination
|
||||||
} from 'naive-ui'
|
} from 'naive-ui'
|
||||||
import { Search, Plus } from '@icon-park/vue-next'
|
import { Search, Plus, Right } from '@icon-park/vue-next'
|
||||||
import TalkItem from './TalkItem.vue'
|
import TalkItem from './TalkItem.vue'
|
||||||
import Skeleton from './Skeleton.vue'
|
import Skeleton from './Skeleton.vue'
|
||||||
import { ServeClearTalkUnreadNum } from '@/api/chat'
|
import { ServeClearTalkUnreadNum } from '@/api/chat'
|
||||||
@ -39,7 +39,7 @@ import { processError, processSuccess } from '@/utils/helper/message.js'
|
|||||||
import chatAppSearchList from '@/components/search/searchList.vue'
|
import chatAppSearchList from '@/components/search/searchList.vue'
|
||||||
import { ServeSeachQueryAll, ServeQueryTalkRecord, ServeUserGroupChatList } from '@/api/search'
|
import { ServeSeachQueryAll, ServeQueryTalkRecord, ServeUserGroupChatList } from '@/api/search'
|
||||||
import { getUserInfoByERPUserId } from '@/api/user'
|
import { getUserInfoByERPUserId } from '@/api/user'
|
||||||
|
import HighlightText from '@/components/search/highLightText.vue'
|
||||||
import { useRouter } from 'vue-router'
|
import { useRouter } from 'vue-router'
|
||||||
const router = useRouter()
|
const router = useRouter()
|
||||||
|
|
||||||
@ -66,21 +66,10 @@ const renderChatAppSearch = () => {
|
|||||||
return h(
|
return h(
|
||||||
chatAppSearchList,
|
chatAppSearchList,
|
||||||
{
|
{
|
||||||
// searchResultKey: 'user_infos',
|
|
||||||
// searchItem: {
|
|
||||||
// avatar:
|
|
||||||
// 'https://e-cdn.fontree.cn/fonchain-main/prod/image/18248/avatar/a0b2bee7-947f-465a-986e-10a1b2b87032.png',
|
|
||||||
// created_at: '2025-03-27 14:44:23',
|
|
||||||
// erp_user_id: 18248,
|
|
||||||
// id: 44,
|
|
||||||
// mobile: '18994430450',
|
|
||||||
// nickname: '周俊耀'
|
|
||||||
// },
|
|
||||||
// searchText: '周'
|
|
||||||
searchResultPageSize: 3,
|
searchResultPageSize: 3,
|
||||||
listLimit: true,
|
listLimit: true,
|
||||||
apiRequest: ServeSeachQueryAll,
|
apiRequest: ServeSeachQueryAll,
|
||||||
searchText: '王',
|
searchText: searchKeyword.value,
|
||||||
onClickSearchItem: (searchText, searchResultKey, talk_type, receiver_id, res) => {
|
onClickSearchItem: (searchText, searchResultKey, talk_type, receiver_id, res) => {
|
||||||
console.log(searchText, searchResultKey, talk_type, receiver_id)
|
console.log(searchText, searchResultKey, talk_type, receiver_id)
|
||||||
const result = JSON.parse(decodeURIComponent(res))
|
const result = JSON.parse(decodeURIComponent(res))
|
||||||
@ -103,7 +92,29 @@ const renderChatAppSearch = () => {
|
|||||||
console.log(searchResultKey, searchText)
|
console.log(searchResultKey, searchText)
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
{}
|
{
|
||||||
|
'result-title': ({ getResultKeysValue, searchResultKey, searchResultIndex }) => {
|
||||||
|
return h(
|
||||||
|
'div',
|
||||||
|
{
|
||||||
|
style: {
|
||||||
|
padding: searchResultIndex === 0 ? '6px 10px 5px' : '18px 10px 5px',
|
||||||
|
borderBottom: '1px solid #f8f8f8'
|
||||||
|
}
|
||||||
|
},
|
||||||
|
[
|
||||||
|
h(
|
||||||
|
'span',
|
||||||
|
{
|
||||||
|
class: 'text-[14px] font-regular',
|
||||||
|
style: 'line-height: 20px; color: #999999;'
|
||||||
|
},
|
||||||
|
getResultKeysValue(searchResultKey)
|
||||||
|
)
|
||||||
|
]
|
||||||
|
)
|
||||||
|
}
|
||||||
|
}
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -254,7 +265,19 @@ const state = reactive({
|
|||||||
searchRecordText: '', // 搜索聊天记录文本
|
searchRecordText: '', // 搜索聊天记录文本
|
||||||
ServeQueryTalkRecordParams: '', // 搜索聊天记录参数
|
ServeQueryTalkRecordParams: '', // 搜索聊天记录参数
|
||||||
ServeQueryTalkRecordDetailParams: '', // 搜索聊天记录详情参数
|
ServeQueryTalkRecordDetailParams: '', // 搜索聊天记录详情参数
|
||||||
isShowSearchRecordDetailInfo: false // 是否显示搜索聊天记录详情
|
isShowSearchRecordDetailInfo: false, // 是否显示搜索聊天记录详情
|
||||||
|
// 拆分 searchList 和 searchDetailList 独立状态
|
||||||
|
searchList: {
|
||||||
|
searchText: '',
|
||||||
|
apiParams: '',
|
||||||
|
lastId: undefined as any
|
||||||
|
},
|
||||||
|
searchDetailList: {
|
||||||
|
searchText: '',
|
||||||
|
apiParams: '',
|
||||||
|
lastId: undefined as any,
|
||||||
|
total: 0
|
||||||
|
}
|
||||||
})
|
})
|
||||||
|
|
||||||
const items = computed((): ISession[] => {
|
const items = computed((): ISession[] => {
|
||||||
@ -310,22 +333,31 @@ watch(
|
|||||||
}
|
}
|
||||||
)
|
)
|
||||||
|
|
||||||
// watch(
|
// 监听搜索关键字变化,重置所有相关状态
|
||||||
// () => state.searchRecordText,
|
watch(
|
||||||
// (newValue, oldValue) => {
|
() => state.searchRecordText,
|
||||||
// console.log(newValue, 'newValue')
|
(newVal, oldVal) => {
|
||||||
// state.ServeQueryTalkRecordParams = encodeURIComponent(
|
// 重置左侧
|
||||||
// JSON.stringify({
|
state.searchList.searchText = newVal
|
||||||
// talk_type: 0, //1私聊2群聊
|
state.searchList.apiParams = encodeURIComponent(
|
||||||
// receiver_id: 0, //查详情的时候需传入
|
JSON.stringify({
|
||||||
// last_group_id: 0, //最后一条群id
|
talk_type: 0,
|
||||||
// last_member_id: 0, //最后一条用户id
|
receiver_id: 0,
|
||||||
// last_receiver_user_name: '', //最后一条用户名
|
last_group_id: 0,
|
||||||
// last_receiver_group_name: '' //最后一条群名
|
last_member_id: 0,
|
||||||
// })
|
last_receiver_user_name: '',
|
||||||
// )
|
last_receiver_group_name: ''
|
||||||
// }
|
})
|
||||||
// )
|
)
|
||||||
|
state.searchList.lastId = undefined
|
||||||
|
// 重置右侧
|
||||||
|
state.searchDetailList.searchText = newVal
|
||||||
|
state.searchDetailList.apiParams = ''
|
||||||
|
state.searchDetailList.lastId = undefined
|
||||||
|
// 关闭右侧详情
|
||||||
|
state.isShowSearchRecordDetailInfo = false
|
||||||
|
}
|
||||||
|
)
|
||||||
|
|
||||||
// 列表加载状态
|
// 列表加载状态
|
||||||
const loadStatus = computed(() => talkStore.loadStatus)
|
const loadStatus = computed(() => talkStore.loadStatus)
|
||||||
@ -335,12 +367,14 @@ const indexName = computed(() => dialogueStore.index_name)
|
|||||||
|
|
||||||
// 切换会话
|
// 切换会话
|
||||||
const onTabTalk = (item: ISession, follow = false) => {
|
const onTabTalk = (item: ISession, follow = false) => {
|
||||||
console.log('onTabTalk');
|
console.log('onTabTalk')
|
||||||
|
|
||||||
if (item.index_name === indexName.value) return
|
if (item.index_name === indexName.value) return
|
||||||
|
|
||||||
searchKeyword.value = ''
|
searchKeyword.value = ''
|
||||||
|
|
||||||
|
dialogueStore.isManualSwitch = true
|
||||||
|
|
||||||
// 更新编辑信息
|
// 更新编辑信息
|
||||||
dialogueStore.setDialogue(item)
|
dialogueStore.setDialogue(item)
|
||||||
|
|
||||||
@ -565,19 +599,43 @@ const handleClickSearchItem = (searchText, searchResultKey, talk_type, receiver_
|
|||||||
const result = JSON.parse(decodeURIComponent(res))
|
const result = JSON.parse(decodeURIComponent(res))
|
||||||
console.log(result)
|
console.log(result)
|
||||||
if (searchResultKey === 'general_infos') {
|
if (searchResultKey === 'general_infos') {
|
||||||
state.ServeQueryTalkRecordDetailParams = encodeURIComponent(
|
// 先清空右侧
|
||||||
|
state.isShowSearchRecordDetailInfo = false
|
||||||
|
state.searchDetailList.apiParams = encodeURIComponent(
|
||||||
JSON.stringify({
|
JSON.stringify({
|
||||||
last_group_id: 0, //最后一条群id
|
last_group_id: 0,
|
||||||
last_member_id: 0, //最后一条用户id
|
last_member_id: 0,
|
||||||
receiver_id: receiver_id, //查详情的时候需传入
|
receiver_id: receiver_id,
|
||||||
talk_type: talk_type //1私聊2群聊
|
talk_type: talk_type
|
||||||
})
|
})
|
||||||
)
|
)
|
||||||
|
state.searchDetailList.searchText = state.searchRecordText
|
||||||
|
state.searchDetailList.lastId = undefined
|
||||||
|
// 再显示
|
||||||
nextTick(() => {
|
nextTick(() => {
|
||||||
searchDetailListRef.value?.doLoadMore(true)
|
state.isShowSearchRecordDetailInfo = true
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
//处理点击搜索结果item
|
||||||
|
const handleClickSearchResultItem = (searchText, searchResultKey, talk_type, receiver_id, res) => {
|
||||||
|
const result = JSON.parse(decodeURIComponent(res))
|
||||||
|
console.error(result, 'result')
|
||||||
|
// 根据搜索结果, 指定用于查询指定消息上下文的sequence
|
||||||
|
dialogueStore.specifiedMsg = encodeURIComponent(
|
||||||
|
JSON.stringify({
|
||||||
|
talk_type,
|
||||||
|
receiver_id,
|
||||||
|
msg_id: result.msg_id,
|
||||||
|
cursor: result.sequence - 15 > 0 ? result.sequence - 15 : 0,
|
||||||
|
direction: 'down',
|
||||||
|
sort_sequence: 'asc',
|
||||||
|
create_time: result.created_at
|
||||||
|
})
|
||||||
|
)
|
||||||
|
console.error(dialogueStore.specifiedMsg, 'dialogueStore.specifiedMsg')
|
||||||
|
talkStore.toTalk(talk_type, receiver_id, router)
|
||||||
|
}
|
||||||
//处理点击停留item变化
|
//处理点击停留item变化
|
||||||
const handleClickStayItemChange = (item) => {
|
const handleClickStayItemChange = (item) => {
|
||||||
if (item) {
|
if (item) {
|
||||||
@ -593,52 +651,62 @@ const searchListRef = ref()
|
|||||||
// 定义搜索详情列表组件的ref
|
// 定义搜索详情列表组件的ref
|
||||||
const searchDetailListRef = ref()
|
const searchDetailListRef = ref()
|
||||||
|
|
||||||
//搜索聊天记录列表加载更多
|
// lastIdChange 事件区分来源
|
||||||
const loadMoreRecordList = () => {
|
const handleSearchListLastIdChange = (
|
||||||
searchListRef.value?.doLoadMore()
|
|
||||||
}
|
|
||||||
|
|
||||||
// 搜索聊天记录详情列表加载更多
|
|
||||||
const loadMoreRecordDetail = () => {
|
|
||||||
searchDetailListRef.value?.doLoadMore()
|
|
||||||
}
|
|
||||||
|
|
||||||
const handleMoreRecordLastIdChange = (
|
|
||||||
last_id,
|
last_id,
|
||||||
last_group_id,
|
last_group_id,
|
||||||
last_member_id,
|
last_member_id,
|
||||||
last_receiver_user_name,
|
last_receiver_user_name,
|
||||||
last_receiver_group_name
|
last_receiver_group_name
|
||||||
) => {
|
) => {
|
||||||
let idChanges = {
|
state.searchList.lastId = {
|
||||||
last_id,
|
last_id,
|
||||||
last_group_id,
|
last_group_id,
|
||||||
last_member_id,
|
last_member_id,
|
||||||
last_receiver_user_name,
|
last_receiver_user_name,
|
||||||
last_receiver_group_name
|
last_receiver_group_name
|
||||||
}
|
}
|
||||||
state.ServeQueryTalkRecordParams = encodeURIComponent(
|
state.searchList.apiParams = encodeURIComponent(
|
||||||
JSON.stringify(
|
JSON.stringify({
|
||||||
Object.assign({}, JSON.parse(decodeURIComponent(state.ServeQueryTalkRecordParams)), idChanges)
|
...JSON.parse(decodeURIComponent(state.searchList.apiParams)),
|
||||||
)
|
last_id,
|
||||||
|
last_group_id,
|
||||||
|
last_member_id,
|
||||||
|
last_receiver_user_name,
|
||||||
|
last_receiver_group_name
|
||||||
|
})
|
||||||
|
)
|
||||||
|
}
|
||||||
|
const handleSearchDetailListLastIdChange = (last_id, last_group_id, last_member_id) => {
|
||||||
|
state.searchDetailList.lastId = { last_id, last_group_id, last_member_id }
|
||||||
|
state.searchDetailList.apiParams = encodeURIComponent(
|
||||||
|
JSON.stringify({
|
||||||
|
...JSON.parse(decodeURIComponent(state.searchDetailList.apiParams)),
|
||||||
|
last_id,
|
||||||
|
last_group_id,
|
||||||
|
last_member_id
|
||||||
|
})
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
const handleRecordDetailLastIdChange = (last_id, last_group_id, last_member_id) => {
|
// 关闭搜索聊天记录模态框
|
||||||
let idChanges = {
|
const handleCloseSearchRecordModal = () => {
|
||||||
last_id,
|
state.isShowSearchRecordModal = false
|
||||||
last_group_id,
|
state.searchRecordText = ''
|
||||||
last_member_id
|
}
|
||||||
}
|
|
||||||
state.ServeQueryTalkRecordDetailParams = encodeURIComponent(
|
// 获取搜索结果总数
|
||||||
JSON.stringify(
|
const getResultTotalCount = (total) => {
|
||||||
Object.assign(
|
state.searchDetailList.total = total
|
||||||
{},
|
}
|
||||||
JSON.parse(decodeURIComponent(state.ServeQueryTalkRecordDetailParams)),
|
|
||||||
idChanges
|
// 进入搜索结果聊天
|
||||||
)
|
const handleEnterSearchResultChat = () => {
|
||||||
)
|
const searchResult = JSON.parse(decodeURIComponent(state.searchDetailList.apiParams))
|
||||||
)
|
talkStore.toTalk(searchResult.talk_type, searchResult.receiver_id, router)
|
||||||
|
state.isShowSearchRecordModal = false
|
||||||
|
state.searchRecordText = ''
|
||||||
|
searchKeyword.value = ''
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
@ -660,7 +728,7 @@ const handleRecordDetailLastIdChange = (last_id, last_group_id, last_member_id)
|
|||||||
<n-dropdown
|
<n-dropdown
|
||||||
trigger="click"
|
trigger="click"
|
||||||
:options="state.chatSearchOptions"
|
:options="state.chatSearchOptions"
|
||||||
style="width: 248px; height: 677px; overflow-y: scroll;"
|
style="width: 248px; height: 677px;"
|
||||||
>
|
>
|
||||||
<n-input
|
<n-input
|
||||||
placeholder="搜索好友 / 群聊"
|
placeholder="搜索好友 / 群聊"
|
||||||
@ -854,6 +922,8 @@ const handleRecordDetailLastIdChange = (last_id, last_group_id, last_member_id)
|
|||||||
:style="state.customSearchRecordModalStyle"
|
:style="state.customSearchRecordModalStyle"
|
||||||
:customCloseBtn="true"
|
:customCloseBtn="true"
|
||||||
:closable="false"
|
:closable="false"
|
||||||
|
:customCloseEvent="true"
|
||||||
|
@customCloseModal="handleCloseSearchRecordModal"
|
||||||
>
|
>
|
||||||
<template #content>
|
<template #content>
|
||||||
<div class="search-record-modal-content">
|
<div class="search-record-modal-content">
|
||||||
@ -872,34 +942,54 @@ const handleRecordDetailLastIdChange = (last_id, last_group_id, last_member_id)
|
|||||||
</n-input>
|
</n-input>
|
||||||
</div>
|
</div>
|
||||||
<div class="search-record-card" v-if="state.searchRecordText">
|
<div class="search-record-card" v-if="state.searchRecordText">
|
||||||
<div class="search-record-list" v-loadmore="loadMoreRecordList">
|
<div class="search-record-list">
|
||||||
<chatAppSearchList
|
<chatAppSearchList
|
||||||
ref="searchListRef"
|
ref="searchListRef"
|
||||||
:searchResultPageSize="10"
|
:searchResultPageSize="10"
|
||||||
:listLimit="false"
|
:listLimit="false"
|
||||||
:apiRequest="ServeQueryTalkRecord"
|
:apiRequest="ServeQueryTalkRecord"
|
||||||
:apiParams="state.ServeQueryTalkRecordParams"
|
:apiParams="state.searchList.apiParams"
|
||||||
:searchText="state.searchRecordText"
|
:searchText="state.searchList.searchText"
|
||||||
:isPagination="true"
|
:isPagination="true"
|
||||||
searchResultKey="general_infos"
|
searchResultKey="general_infos"
|
||||||
@clickSearchItem="handleClickSearchItem"
|
@clickSearchItem="handleClickSearchItem"
|
||||||
:useClickStay="true"
|
:useClickStay="true"
|
||||||
@clickStayItemChange="handleClickStayItemChange"
|
@clickStayItemChange="handleClickStayItemChange"
|
||||||
@lastIdChange="handleMoreRecordLastIdChange"
|
@lastIdChange="handleSearchListLastIdChange"
|
||||||
|
:searchResultMaxHeight="'517px'"
|
||||||
></chatAppSearchList>
|
></chatAppSearchList>
|
||||||
</div>
|
</div>
|
||||||
<div class="search-record-detail" v-loadmore="loadMoreRecordDetail">
|
<div class="search-record-detail">
|
||||||
|
<div class="search-record-detail-header" v-if="state.isShowSearchRecordDetailInfo">
|
||||||
|
<HighlightText
|
||||||
|
class="text-[14px] text-[#B0B0B0] leading-[20px]"
|
||||||
|
:text="
|
||||||
|
state.searchDetailList.total +
|
||||||
|
'条与“' +
|
||||||
|
state.searchRecordText +
|
||||||
|
'”相关的搜索结果'
|
||||||
|
"
|
||||||
|
:searchText="state.searchRecordText"
|
||||||
|
/>
|
||||||
|
<div class="search-record-detail-header-btn" @click="handleEnterSearchResultChat">
|
||||||
|
<span>进入聊天</span>
|
||||||
|
<n-icon :component="Right" color="#46299D" size="14px" />
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
<chatAppSearchList
|
<chatAppSearchList
|
||||||
ref="searchDetailListRef"
|
ref="searchDetailListRef"
|
||||||
v-if="state.isShowSearchRecordDetailInfo"
|
v-if="state.isShowSearchRecordDetailInfo"
|
||||||
:searchResultPageSize="10"
|
:searchResultPageSize="10"
|
||||||
:listLimit="false"
|
:listLimit="false"
|
||||||
:apiRequest="ServeQueryTalkRecord"
|
:apiRequest="ServeQueryTalkRecord"
|
||||||
:apiParams="state.ServeQueryTalkRecordDetailParams"
|
:apiParams="state.searchDetailList.apiParams"
|
||||||
:searchText="state.searchRecordText"
|
:searchText="state.searchDetailList.searchText"
|
||||||
:isPagination="true"
|
:isPagination="true"
|
||||||
:searchRecordDetail="true"
|
:searchRecordDetail="true"
|
||||||
@lastIdChange="handleRecordDetailLastIdChange"
|
@lastIdChange="handleSearchDetailListLastIdChange"
|
||||||
|
:searchResultMaxHeight="'469px'"
|
||||||
|
@resultTotalCount="getResultTotalCount"
|
||||||
|
@clickSearchItem="handleClickSearchResultItem"
|
||||||
></chatAppSearchList>
|
></chatAppSearchList>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
@ -1094,13 +1184,33 @@ html[theme-mode='dark'] {
|
|||||||
width: 260px;
|
width: 260px;
|
||||||
height: 517px;
|
height: 517px;
|
||||||
border: 1px solid #efeff5;
|
border: 1px solid #efeff5;
|
||||||
overflow-y: scroll;
|
|
||||||
}
|
}
|
||||||
.search-record-detail {
|
.search-record-detail {
|
||||||
width: 578px;
|
width: 578px;
|
||||||
height: 517px;
|
height: 517px;
|
||||||
border: 1px solid #efeff5;
|
border: 1px solid #efeff5;
|
||||||
overflow-y: scroll;
|
.search-record-detail-header {
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
justify-content: space-between;
|
||||||
|
padding: 14px 4px 14px 10px;
|
||||||
|
box-sizing: border-box;
|
||||||
|
.search-record-detail-header-btn {
|
||||||
|
line-height: 20px;
|
||||||
|
display: flex;
|
||||||
|
flex-direction: row;
|
||||||
|
align-items: center;
|
||||||
|
justify-content: flex-end;
|
||||||
|
gap: 8px;
|
||||||
|
cursor: pointer;
|
||||||
|
span {
|
||||||
|
line-height: 20px;
|
||||||
|
color: #46299d;
|
||||||
|
font-size: 14px;
|
||||||
|
font-weight: 400;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
.search-record-empty {
|
.search-record-empty {
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
<script lang="ts" setup>
|
<script lang="ts" setup>
|
||||||
import { watch, onMounted, ref } from 'vue'
|
import { watch, onMounted, ref, nextTick } from 'vue'
|
||||||
import { NDropdown, NCheckbox } from 'naive-ui'
|
import { NDropdown, NCheckbox } from 'naive-ui'
|
||||||
import { Loading, MoreThree, ToTop } from '@icon-park/vue-next'
|
import { Loading, MoreThree, ToTop } from '@icon-park/vue-next'
|
||||||
import { bus } from '@/utils/event-bus'
|
import { bus } from '@/utils/event-bus'
|
||||||
@ -13,7 +13,7 @@ import SkipBottom from './SkipBottom.vue'
|
|||||||
import { ITalkRecord } from '@/types/chat'
|
import { ITalkRecord } from '@/types/chat'
|
||||||
import { EditorConst } from '@/constant/event-bus'
|
import { EditorConst } from '@/constant/event-bus'
|
||||||
import { useInject, useTalkRecord, useUtil } from '@/hooks'
|
import { useInject, useTalkRecord, useUtil } from '@/hooks'
|
||||||
import { ExclamationCircleFilled } from '@ant-design/icons-vue';
|
import { ExclamationCircleFilled } from '@ant-design/icons-vue'
|
||||||
import { useUserStore } from '@/store'
|
import { useUserStore } from '@/store'
|
||||||
import RevokeMessage from '@/components/talk/message/RevokeMessage.vue'
|
import RevokeMessage from '@/components/talk/message/RevokeMessage.vue'
|
||||||
import { voiceToText } from '@/api/chat.js'
|
import { voiceToText } from '@/api/chat.js'
|
||||||
@ -33,6 +33,10 @@ const props = defineProps({
|
|||||||
index_name: {
|
index_name: {
|
||||||
type: String,
|
type: String,
|
||||||
default: ''
|
default: ''
|
||||||
|
},
|
||||||
|
specifiedMsg: {
|
||||||
|
type: String,
|
||||||
|
default: ''
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
|
||||||
@ -237,15 +241,15 @@ const onContextMenu = (e: any, item: ITalkRecord) => {
|
|||||||
e.preventDefault()
|
e.preventDefault()
|
||||||
}
|
}
|
||||||
|
|
||||||
const onConvertText =async (data: ITalkRecord) => {
|
const onConvertText = async (data: ITalkRecord) => {
|
||||||
console.log('data',data)
|
console.log('data', data)
|
||||||
data.is_convert_text = 1
|
data.is_convert_text = 1
|
||||||
const res = await voiceToText({msgId:data.msg_id,voiceUrl:data.extra.url})
|
const res = await voiceToText({ msgId: data.msg_id, voiceUrl: data.extra.url })
|
||||||
if(res.code == 200){
|
if (res.code == 200) {
|
||||||
data.extra.content = res.data.convText
|
data.extra.content = res.data.convText
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
const onloseConvertText=(data: ITalkRecord)=>{
|
const onloseConvertText = (data: ITalkRecord) => {
|
||||||
data.is_convert_text = 0
|
data.is_convert_text = 0
|
||||||
}
|
}
|
||||||
const evnets = {
|
const evnets = {
|
||||||
@ -257,7 +261,7 @@ const evnets = {
|
|||||||
quote: onQuoteMessage,
|
quote: onQuoteMessage,
|
||||||
collect: onCollectImage,
|
collect: onCollectImage,
|
||||||
convertText: onConvertText,
|
convertText: onConvertText,
|
||||||
closeConvertText:onloseConvertText
|
closeConvertText: onloseConvertText
|
||||||
}
|
}
|
||||||
|
|
||||||
// 会话列表右键菜单回调事件
|
// 会话列表右键菜单回调事件
|
||||||
@ -277,18 +281,48 @@ const onRowClick = (item: ITalkRecord) => {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
watch(props, () => {
|
const lastParams = ref('')
|
||||||
onLoad({ ...props, limit: 30 })
|
|
||||||
})
|
|
||||||
|
|
||||||
onMounted(() => {
|
// 监听整个 props 对象的变化
|
||||||
onLoad({ ...props, limit: 30 })
|
watch(
|
||||||
})
|
() => props,
|
||||||
|
async (newProps) => {
|
||||||
|
await nextTick()
|
||||||
|
let specialParams = undefined
|
||||||
|
console.error(newProps, 'newProps')
|
||||||
|
if (newProps.specifiedMsg) {
|
||||||
|
try {
|
||||||
|
const parsed = JSON.parse(decodeURIComponent(newProps.specifiedMsg))
|
||||||
|
// 只有会话id和参数都匹配才进入特殊模式
|
||||||
|
if (parsed.talk_type === newProps.talk_type && parsed.receiver_id === newProps.receiver_id) {
|
||||||
|
specialParams = parsed
|
||||||
|
}
|
||||||
|
} catch (e) {}
|
||||||
|
}
|
||||||
|
onLoad(
|
||||||
|
{
|
||||||
|
receiver_id: newProps.receiver_id,
|
||||||
|
talk_type: newProps.talk_type,
|
||||||
|
limit: 30
|
||||||
|
},
|
||||||
|
specialParams ? { specifiedMsg: specialParams } : undefined
|
||||||
|
)
|
||||||
|
},
|
||||||
|
{ immediate: true, deep: true }
|
||||||
|
)
|
||||||
|
|
||||||
|
// onMounted(() => {
|
||||||
|
// onLoad({ ...props, limit: 30 })
|
||||||
|
// })
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<template>
|
<template>
|
||||||
<section class="section">
|
<section class="section">
|
||||||
<div id="imChatPanel" class="me-scrollbar me-scrollbar-thumb talk-container" @scroll="onPanelScroll($event)">
|
<div
|
||||||
|
id="imChatPanel"
|
||||||
|
class="me-scrollbar me-scrollbar-thumb talk-container"
|
||||||
|
@scroll="onPanelScroll($event)"
|
||||||
|
>
|
||||||
<!-- 数据加载状态栏 -->
|
<!-- 数据加载状态栏 -->
|
||||||
<div class="load-toolbar pointer">
|
<div class="load-toolbar pointer">
|
||||||
<span v-if="loadConfig.status == 0"> 正在加载数据中 ... </span>
|
<span v-if="loadConfig.status == 0"> 正在加载数据中 ... </span>
|
||||||
@ -296,53 +330,96 @@ onMounted(() => {
|
|||||||
<span v-else class="no-more"> 没有更多消息了 </span>
|
<span v-else class="no-more"> 没有更多消息了 </span>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="message-item" v-for="(item, index) in records" :key="item.msg_id" :id="item.msg_id">
|
<div
|
||||||
|
class="message-item"
|
||||||
|
v-for="(item, index) in records"
|
||||||
|
:key="item.msg_id"
|
||||||
|
:id="item.msg_id"
|
||||||
|
>
|
||||||
<!-- 系统消息 -->
|
<!-- 系统消息 -->
|
||||||
<div v-if="item.msg_type >= 1000" class="message-box">
|
<div v-if="item.msg_type >= 1000" class="message-box">
|
||||||
<component :is="MessageComponents[item.msg_type] || 'unknown-message'" :extra="item.extra" :data="item" />
|
<component
|
||||||
|
:is="MessageComponents[item.msg_type] || 'unknown-message'"
|
||||||
|
:extra="item.extra"
|
||||||
|
:data="item"
|
||||||
|
/>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<!-- 撤回消息 -->
|
<!-- 撤回消息 -->
|
||||||
<div v-else-if="item.is_revoke == 1" class="message-box">
|
<div v-else-if="item.is_revoke == 1" class="message-box">
|
||||||
<revoke-message :login_uid="uid" :data="item" :user_id="item.user_id" :nickname="item.nickname" :talk_type="item.talk_type"
|
<revoke-message
|
||||||
:datetime="item.created_at" />
|
:login_uid="uid"
|
||||||
|
:data="item"
|
||||||
|
:user_id="item.user_id"
|
||||||
|
:nickname="item.nickname"
|
||||||
|
:talk_type="item.talk_type"
|
||||||
|
:datetime="item.created_at"
|
||||||
|
/>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div v-else class="message-box record-box" :class="{
|
<div
|
||||||
'direction-rt': item.float == 'right',
|
v-else
|
||||||
'multi-select': dialogueStore.isOpenMultiSelect,
|
class="message-box record-box"
|
||||||
'multi-select-check': item.isCheck
|
:class="{
|
||||||
}">
|
'direction-rt': item.float == 'right',
|
||||||
|
'multi-select': dialogueStore.isOpenMultiSelect,
|
||||||
|
'multi-select-check': item.isCheck
|
||||||
|
}"
|
||||||
|
>
|
||||||
<!-- 多选按钮 -->
|
<!-- 多选按钮 -->
|
||||||
<aside v-if="dialogueStore.isOpenMultiSelect" class="checkbox-column shrink-0">
|
<aside v-if="dialogueStore.isOpenMultiSelect" class="checkbox-column shrink-0">
|
||||||
<n-checkbox size="small" :checked="item.isCheck" @update:checked="item.isCheck = !item.isCheck" />
|
<n-checkbox size="small" :checked="item.isCheck" @update:checked="item.isCheck = !item.isCheck" />
|
||||||
</aside>
|
</aside>
|
||||||
<!-- 头像信息 -->
|
<!-- 头像信息 -->
|
||||||
|
|
||||||
<aside class="avatar-column">
|
<aside class="avatar-column">
|
||||||
<im-avatar class="pointer" :src="item.avatar" :size="42" :username="item.nickname"
|
<im-avatar
|
||||||
@click="showUserInfoModal(item.erp_user_id,item.user_id)" />
|
class="pointer"
|
||||||
|
:src="item.avatar"
|
||||||
|
:size="42"
|
||||||
|
:username="item.nickname"
|
||||||
|
@click="showUserInfoModal(item.erp_user_id, item.user_id)"
|
||||||
|
/>
|
||||||
</aside>
|
</aside>
|
||||||
|
|
||||||
<!-- 主体信息 -->
|
<!-- 主体信息 -->
|
||||||
<main class="main-column">
|
<main class="main-column">
|
||||||
<div class="talk-title">
|
<div class="talk-title">
|
||||||
<span class="nickname pointer" v-show="talk_type == 2 && item.float == 'left'"
|
<span
|
||||||
@click="onClickNickname(item)">
|
class="nickname pointer"
|
||||||
|
v-show="talk_type == 2 && item.float == 'left'"
|
||||||
|
@click="onClickNickname(item)"
|
||||||
|
>
|
||||||
<span class="at">@</span>{{ item.nickname }}
|
<span class="at">@</span>{{ item.nickname }}
|
||||||
</span>
|
</span>
|
||||||
<span>{{ parseTime(item.created_at, '{y}/{m}/{d} {h}:{i}') }}</span>
|
<span>{{ parseTime(item.created_at, '{y}/{m}/{d} {h}:{i}') }}</span>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="talk-content" :class="{ pointer: dialogueStore.isOpenMultiSelect }" @click="onRowClick(item)">
|
<div
|
||||||
|
class="talk-content"
|
||||||
<component :is="MessageComponents[item.msg_type] || 'unknown-message'" :extra="item.extra" :data="item"
|
:class="{ pointer: dialogueStore.isOpenMultiSelect }"
|
||||||
:max-width="true" :source="'panel'" @contextmenu.prevent="onContextMenu($event, item)" />
|
@click="onRowClick(item)"
|
||||||
<div v-if="item.float==='right'&&item.extra.percentage===-1&&item.extra.is_uploading" class="mr-10px"> <n-button text style="font-size: 20px">
|
>
|
||||||
|
<component
|
||||||
|
:is="MessageComponents[item.msg_type] || 'unknown-message'"
|
||||||
|
:extra="item.extra"
|
||||||
|
:data="item"
|
||||||
|
:max-width="true"
|
||||||
|
:source="'panel'"
|
||||||
|
@contextmenu.prevent="onContextMenu($event, item)"
|
||||||
|
/>
|
||||||
|
<div
|
||||||
|
v-if="
|
||||||
|
item.float === 'right' && item.extra.percentage === -1 && item.extra.is_uploading
|
||||||
|
"
|
||||||
|
class="mr-10px"
|
||||||
|
>
|
||||||
|
<n-button text style="font-size: 20px;">
|
||||||
<n-icon color="#CF3050">
|
<n-icon color="#CF3050">
|
||||||
<ExclamationCircleFilled />
|
<ExclamationCircleFilled />
|
||||||
</n-icon>
|
</n-icon>
|
||||||
</n-button></div>
|
</n-button>
|
||||||
|
</div>
|
||||||
<!-- <div class="talk-tools">
|
<!-- <div class="talk-tools">
|
||||||
<template v-if="talk_type == 1 && item.float == 'right'">
|
<template v-if="talk_type == 1 && item.float == 'right'">
|
||||||
<loading
|
<loading
|
||||||
@ -362,7 +439,11 @@ onMounted(() => {
|
|||||||
</div> -->
|
</div> -->
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div v-if="item.extra.reply" class="talk-reply pointer" @click="onJumpMessage(item.extra?.reply?.msg_id)">
|
<div
|
||||||
|
v-if="item.extra.reply"
|
||||||
|
class="talk-reply pointer"
|
||||||
|
@click="onJumpMessage(item.extra?.reply?.msg_id)"
|
||||||
|
>
|
||||||
<n-icon :component="ToTop" size="14" class="icon-top" />
|
<n-icon :component="ToTop" size="14" class="icon-top" />
|
||||||
<span class="ellipsis">
|
<span class="ellipsis">
|
||||||
回复 {{ item.extra?.reply?.nickname }}:
|
回复 {{ item.extra?.reply?.nickname }}:
|
||||||
@ -383,8 +464,15 @@ onMounted(() => {
|
|||||||
</section>
|
</section>
|
||||||
|
|
||||||
<!-- 右键菜单 -->
|
<!-- 右键菜单 -->
|
||||||
<n-dropdown :show="dropdown.show" :x="dropdown.x" :y="dropdown.y" style="width: 142px;" :options="dropdown.options"
|
<n-dropdown
|
||||||
@select="onContextMenuHandle" @clickoutside="closeDropdownMenu" />
|
:show="dropdown.show"
|
||||||
|
:x="dropdown.x"
|
||||||
|
:y="dropdown.y"
|
||||||
|
style="width: 142px;"
|
||||||
|
:options="dropdown.options"
|
||||||
|
@select="onContextMenuHandle"
|
||||||
|
@clickoutside="closeDropdownMenu"
|
||||||
|
/>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<style lang="less" scoped>
|
<style lang="less" scoped>
|
||||||
|
Loading…
Reference in New Issue
Block a user