更新组件,新增NCheckbox支持,删除不必要的图标文件,优化ContactModal.vue和MultiSelectFooter.vue中的逻辑

This commit is contained in:
Phoenix 2025-05-16 09:48:35 +08:00
parent 94cf0f9f63
commit fca127b42b
11 changed files with 12 additions and 43 deletions

1
components.d.ts vendored
View File

@ -50,6 +50,7 @@ declare module 'vue' {
MixedMessage: typeof import('./src/components/talk/message/MixedMessage.vue')['default'] MixedMessage: typeof import('./src/components/talk/message/MixedMessage.vue')['default']
NAvatar: typeof import('naive-ui')['NAvatar'] NAvatar: typeof import('naive-ui')['NAvatar']
NButton: typeof import('naive-ui')['NButton'] NButton: typeof import('naive-ui')['NButton']
NCheckbox: typeof import('naive-ui')['NCheckbox']
NEmpty: typeof import('naive-ui')['NEmpty'] NEmpty: typeof import('naive-ui')['NEmpty']
NIcon: typeof import('naive-ui')['NIcon'] NIcon: typeof import('naive-ui')['NIcon']
NImage: typeof import('naive-ui')['NImage'] NImage: typeof import('naive-ui')['NImage']

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.1 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.1 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.1 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.1 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.1 KiB

View File

@ -1,7 +1,5 @@
<script lang="ts" setup> <script lang="ts" setup>
import { ref, computed, onMounted, watch } from 'vue' import { ref, computed, onMounted, watch } from 'vue'
import { NModal, NInput, NScrollbar, NCheckbox, NTabs, NTab, NButton, NIcon, NImage, NRadio, NVirtualList, NEmpty } from 'naive-ui'
import { Search, Delete } from '@icon-park/vue-next'
import { ServeGetContacts } from '@/api/contact' import { ServeGetContacts } from '@/api/contact'
import { ServeGetGroups } from '@/api/group' import { ServeGetGroups } from '@/api/group'
import XNModal from '@/components/x-naive-ui/x-n-modal/index.vue' import XNModal from '@/components/x-naive-ui/x-n-modal/index.vue'
@ -22,7 +20,9 @@ const loading = ref(true)
const items = ref<Item[]>([]) const items = ref<Item[]>([])
const keywords = ref('') const keywords = ref('')
const loadGroupStatus = ref(false) const loadGroupStatus = ref(false)
defineProps<{
forwardMode: number
}>()
// //
const searchFilter = computed(() => { const searchFilter = computed(() => {
return items.value.filter((item: Item) => { return items.value.filter((item: Item) => {
@ -155,16 +155,14 @@ onLoad()
</script> </script>
<template> <template>
<x-n-modal v-model:show="isShowBox" title="合并转发/逐条转发" style="width: 997px; height: 740px;background-color: #F9F9FD" <x-n-modal v-model:show="isShowBox" :title="forwardMode === 2 ? '合并转发' : '逐条转发'" style="width: 997px; height: 740px;background-color: #F9F9FD"
:on-after-leave="onMaskClick" content-style="display: flex; justify-content: center; align-items: center;"> :on-after-leave="onMaskClick" content-style="display: flex; justify-content: center; align-items: center;">
<div class="w-927px h-627px bg-#fff rounded-3px px-35px py-20px"> <div class="w-927px h-627px bg-#fff rounded-3px px-35px py-20px">
<div class="flex items-center justify-between mb-28px"> <div class="flex items-center justify-between mb-28px">
<div class="text-#333639">搜索</div> <div class="text-#333639">搜索</div>
<div class="w-779px h-34px"> <div class="w-779px h-34px">
<n-input v-model:value="keywords" type="text" clearable placeholder="请输入"> <n-input v-model:value="keywords" type="text" clearable placeholder="请输入">
<template #prefix>
<n-icon :component="Search" />
</template>
</n-input> </n-input>
</div> </div>
</div> </div>
@ -232,7 +230,7 @@ onLoad()
</div> </div>
<div class="flex flex-col items-center justify-center h-120px"> <div class="flex flex-col items-center justify-center h-120px">
<div class="text-14px text-#999999 mb-23px"> <div class="text-14px text-#999999 mb-23px">
<span>[{{ selectType === 1 ? '合并转发' : '逐条转发' }}]</span> <span>[{{ forwardMode === 2 ? '合并转发' : '逐条转发' }}]</span>
<span v-if="checkedFilter.length > 0"> <span v-if="checkedFilter.length > 0">
{{ checkedFilter.map(item => item.name).join('、') }}的会话记录 {{ checkedFilter.map(item => item.name).join('、') }}的会话记录
</span> </span>
@ -249,33 +247,3 @@ onLoad()
</div> </div>
</x-n-modal> </x-n-modal>
</template> </template>
<style lang="less" scoped>
:deep(.n-divider__title) {
font-weight: unset;
}
.flex-center {
display: flex;
justify-content: center;
align-items: center;
}
.text-ellipsis {
white-space: nowrap;
overflow: hidden;
text-overflow: ellipsis;
max-width: 180px;
}
.badge {
&.group {
color: #3370ff !important;
background-color: #e1eaff !important;
font-size: 12px;
padding: 0 5px;
border-radius: 4px;
}
margin: 0 3px;
}
</style>

View File

@ -18,7 +18,7 @@ export function isLoggedIn() {
*/ */
export function getAccessToken() { export function getAccessToken() {
// return storage.get(AccessToken) || '' // return storage.get(AccessToken) || ''
return JSON.parse(localStorage.getItem('token'))||'46d71a72d8d845ad7ed23eba9bdde260e635407190c2ce1bf7fd22088e41682ea07773ec65cae8946d2003f264d55961f96e0fc5da10eb96d3a348c1664e9644ce2108c311309f398ae8ea1b8200bfd490e5cb6e8c52c9e5d493cbabb163368f8351420451a631dbfa749829ee4cda49b77b5ed2d3dced5d0f2b7dd9ee76ba5465c84a17c23af040cd92b6b2a4ea48befbb5c729dcdad0a9c9668befe84074cc24f78899c1d947f8e7f94c7eda5325b8ed698df729e76febb98549ef3482ae942fb4f4a1c92d21836fa784728f0c5483aab2760a991b6b36e6b10c84f840a6433a6ecc31dee36e8f1c6158818bc89d228655b2039673c1108d29c13b75d1fc2bfd3d1071f49b461822d6c2a320ae711492ac514d1a31043c8b7f2d10ff9e3869928844485d0ed575b936311797f3446e4a6c7ee1d9a63aba9445bc8b41c89143' return JSON.parse(localStorage.getItem('token'))||'46d71a72d8d845ad7ed23eba9bdde260e635407190c2ce1bf7fd22088e41682ea07773ec65cae8946d2003f264d55961f96e0fc5da10eb96d3a348c1664e9644ce2108c311309f398ae8ea1b8200bfd490e5cb6e8c52c9e5d493cbabb163368f8351420451a631dbfa749829ee4cda49b77b5ed2d3dced5d0f2b7dd9ee76ba5465c84a17c23af040cd92b6b2a4ea48befbb5c729dcdad0a9c9668befe84074cc24f78899c1d947f8e7f94c7eda5325b8ed698df729e76febb98549ef3482ae942fb4f4a1c92d21836fa784728f0c5483aab2760a991b6b36e6b10c84f840a6433a6ecc31dee36e8f1c6158818bc89d22851b5e2f6cbf01ab4b3da6e3d06b57c8f750e106226a5a4b9d7fc1d381a54cb92375c09ba1fa8e5fde0392d919c2f2cbcc7e4e2eca8d9860749af00374b249f7d04e2bc43a1fa4e7d7384dde0212f0a5'
} }
/** /**

View File

@ -28,9 +28,9 @@ const labelColor=[
:userName="data?.name" :customStyle="{width:'42px',height:'42px'}"></avatarModule> :userName="data?.name" :customStyle="{width:'42px',height:'42px'}"></avatarModule>
<div v-if="[2,3,4].includes(data.group_type)" class="absolute w-32px h-18px border-2px border-solid rounded-3px top-28px bg-#fff text-10px flex justify-center items-center leading-none" :style="`color:${labelColor.find(x=>x.group_type===data.group_type)?.color};border-color:${labelColor.find(x=>x.group_type===data.group_type)?.color}`">{{ labelColor.find(x=>x.group_type===data.group_type)?.label }}</div> <div v-if="[2,3,4].includes(data.group_type)" class="absolute w-32px h-18px border-2px border-solid rounded-3px top-28px bg-#fff text-10px flex justify-center items-center leading-none" :style="`color:${labelColor.find(x=>x.group_type===data.group_type)?.color};border-color:${labelColor.find(x=>x.group_type===data.group_type)?.color}`">{{ labelColor.find(x=>x.group_type===data.group_type)?.label }}</div>
<!-- <im-avatar :src="avatar" :size="34" :username="data.name" /> --> <!-- <im-avatar :src="avatar" :size="34" :username="data.name" /> -->
<div class="top-mask" @click.stop="emit('top-talk', data)"> <!-- <div class="top-mask" @click.stop="emit('top-talk', data)">
<n-icon :component="data.is_top == 1 ? ArrowDown : ArrowUp" /> <n-icon :component="data.is_top == 1 ? ArrowDown : ArrowUp" />
</div> </div> -->
</div> </div>
<div class="content-box"> <div class="content-box">

View File

@ -111,6 +111,7 @@ const onContactModal = (data: { id: number; type: number }[]) => {
v-if="isShowContactModal" v-if="isShowContactModal"
v-on:close="isShowContactModal = false" v-on:close="isShowContactModal = false"
v-on:on-submit="onContactModal" v-on:on-submit="onContactModal"
:forward-mode="forwardMode"
/> />
</template> </template>
<style lang="less" scoped> <style lang="less" scoped>

View File

@ -328,10 +328,9 @@ onMounted(() => {
<div class="talk-content" :class="{ pointer: dialogueStore.isOpenMultiSelect }" @click="onRowClick(item)"> <div class="talk-content" :class="{ pointer: dialogueStore.isOpenMultiSelect }" @click="onRowClick(item)">
<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"
:max-width="true" :source="'panel'" @contextmenu.prevent="onContextMenu($event, item)" /> :max-width="true" :source="'panel'" @contextmenu.prevent="onContextMenu($event, item)" />
<div class="mr-10px"> <n-button text style="font-size: 20px"> <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>