Skip to content

Commit fe4abfb

Browse files
committed
fix: 升级依赖,修复邀请群成员禁用及列表获取问题,被踢出群不能邀请群成员
1 parent 476fd44 commit fe4abfb

File tree

10 files changed

+918
-943
lines changed

10 files changed

+918
-943
lines changed

package.json

+22-22
Original file line numberDiff line numberDiff line change
@@ -21,46 +21,46 @@
2121
"prepare": "husky install"
2222
},
2323
"dependencies": {
24-
"@alova/scene-vue": "^1.1.7",
24+
"@alova/scene-vue": "^1.2.0",
2525
"@element-plus/icons-vue": "^2.1.0",
2626
"@imengyu/vue3-context-menu": "^1.3.3",
27-
"alova": "^2.10.0",
28-
"dayjs": "^1.11.9",
29-
"element-plus": "^2.3.9",
27+
"alova": "^2.13.1",
28+
"dayjs": "^1.11.10",
29+
"element-plus": "^2.3.14",
3030
"lodash": "^4.17.21",
3131
"mitt": "^3.0.1",
3232
"pinia": "^2.1.6",
3333
"pinia-plugin-persistedstate": "^3.2.0",
3434
"qrcode.vue": "^3.4.1",
3535
"vue": "^3.3.4",
36-
"vue-router": "^4.2.4"
36+
"vue-router": "^4.2.5"
3737
},
3838
"devDependencies": {
39-
"@commitlint/cli": "^17.7.1",
39+
"@commitlint/cli": "^17.7.2",
4040
"@commitlint/config-conventional": "^17.7.0",
4141
"@iconify-json/ep": "^1.1.12",
42-
"@rushstack/eslint-patch": "^1.3.3",
43-
"@types/lodash": "^4.14.197",
44-
"@types/node": "^18.17.5",
45-
"@vitejs/plugin-vue": "^4.2.3",
46-
"@vitejs/plugin-vue-jsx": "^3.0.1",
42+
"@rushstack/eslint-patch": "^1.5.1",
43+
"@types/lodash": "^4.14.199",
44+
"@types/node": "^18.18.4",
45+
"@vitejs/plugin-vue": "^4.4.0",
46+
"@vitejs/plugin-vue-jsx": "^3.0.2",
4747
"@vue/eslint-config-prettier": "^7.1.0",
4848
"@vue/eslint-config-typescript": "^11.0.3",
4949
"@vue/tsconfig": "^0.1.3",
50-
"@vueuse/core": "^10.3.0",
51-
"autoprefixer": "^10.4.14",
52-
"eslint": "^8.47.0",
50+
"@vueuse/core": "^10.5.0",
51+
"autoprefixer": "^10.4.16",
52+
"eslint": "^8.51.0",
5353
"eslint-plugin-vue": "^9.17.0",
5454
"husky": "^8.0.3",
55-
"lint-staged": "^13.2.3",
55+
"lint-staged": "^13.3.0",
5656
"npm-run-all": "^4.1.5",
5757
"postcss-html": "^1.5.0",
58-
"postcss-scss": "^4.0.6",
58+
"postcss-scss": "^4.0.9",
5959
"prettier": "^2.8.8",
60-
"rimraf": "^5.0.1",
60+
"rimraf": "^5.0.5",
6161
"rollup-plugin-visualizer": "^5.9.2",
62-
"sass": "^1.65.1",
63-
"stylelint": "^15.10.2",
62+
"sass": "^1.69.2",
63+
"stylelint": "^15.10.3",
6464
"stylelint-config-recess-order": "^4.3.0",
6565
"stylelint-config-recommended-vue": "^1.5.0",
6666
"stylelint-config-standard": "^33.0.0",
@@ -70,11 +70,11 @@
7070
"unplugin-auto-import": "^0.15.3",
7171
"unplugin-icons": "^0.15.3",
7272
"unplugin-vue-components": "^0.24.1",
73-
"vite": "4.4.9",
73+
"vite": "4.4.11",
7474
"vite-plugin-compression": "^0.5.1",
7575
"vite-plugin-imagemin": "^0.6.1",
76-
"vue-tsc": "^1.8.8",
77-
"xgplayer": "^2.32.3"
76+
"vue-tsc": "^1.8.19",
77+
"xgplayer": "^2.32.5"
7878
},
7979
"resolutions": {
8080
"bin-wrapper": "npm:bin-wrapper-china"

pnpm-lock.yaml

+866-897
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/components/CreateGroupModal/SelectUser.vue

+8-6
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
<script setup lang="ts" name="CreateGroupModal">
2-
import { ref, watch } from 'vue'
2+
import { ref, watch, computed } from 'vue'
33
import { useContactStore } from '@/stores/contacts'
44
import Avatar from '@/components/Avatar/index.vue'
55
import { useGlobalStore } from '@/stores/global'
@@ -20,37 +20,39 @@ const data = ref<
2020
disabled: boolean
2121
}[]
2222
>([])
23+
2324
// const data = computed(() =>
2425
// contactStore.contactsList.map((item) => ({
2526
// label: item.uid,
2627
// key: item.uid,
2728
// initial: item.uid,
2829
// })),
2930
// )
31+
const contactsList = computed(() => contactStore.contactsList)
32+
const selectedUid = computed(() => globalStore.createGroupModalInfo.selectedUid)
3033
watch(
31-
() => contactStore.contactsList,
34+
contactsList,
3235
(val) => {
3336
data.value = val.map((item) => ({
3437
label: item.uid,
3538
key: item.uid,
3639
initial: item.uid,
3740
disabled: false,
3841
}))
39-
console.log(data.value)
4042
},
41-
{ immediate: true },
43+
{ immediate: true, deep: true },
4244
)
4345
watch(
44-
() => globalStore.createGroupModalInfo.selectedUid,
46+
selectedUid,
4547
(val) => {
4648
val.forEach((item) => {
4749
const dataItem = data.value.find((i) => i.key === item)
4850
if (dataItem) {
4951
dataItem.disabled = true
5052
}
5153
})
52-
console.log('selectedUid', val, data.value)
5354
},
55+
{ immediate: true },
5456
)
5557
// const defaultChecked = computed(() => globalStore.createGroupModalInfo.selectedUid)
5658
const selected = ref([])

src/components/CreateGroupModal/index.vue

+2-1
Original file line numberDiff line numberDiff line change
@@ -68,8 +68,9 @@ const onChecked = (checked: number[]) => {
6868
@click="onSend"
6969
:loading="loading || inviteLoading"
7070
:disabled="selectUser.length === 0"
71-
>{{ isInvite ? '邀请' : '创建' }}</el-button
7271
>
72+
{{ isInvite ? '邀请' : '创建' }}
73+
</el-button>
7374
</span>
7475
</template>
7576
</ElDialog>

src/directives/v-login-show.ts

+7-7
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,16 @@
11
import type { Directive } from 'vue'
2+
import { watchEffect } from 'vue'
23

34
import { useUserStore } from '@/stores/user'
4-
const isSign = () => {
5-
const userStore = useUserStore()
6-
return userStore.isSign
7-
}
85

96
const vLoginShow: Directive = {
107
mounted(el) {
11-
if (!isSign()) {
12-
el?.remove()
13-
}
8+
const userStore = useUserStore()
9+
watchEffect(() => {
10+
if (!userStore.isSign) {
11+
el?.remove()
12+
}
13+
})
1414
},
1515
}
1616

src/stores/chat.ts

+4
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ import { useCachedStore } from '@/stores/cached'
1111
import { useUserStore } from '@/stores/user'
1212
import { useGlobalStore } from '@/stores/global'
1313
import { useGroupStore } from '@/stores/group'
14+
import { useContactStore } from '@/stores/contacts'
1415
import shakeTitle from '@/utils/shakeTitle'
1516
import notify from '@/utils/notification'
1617
import { MsgEnum } from '@/enums'
@@ -25,6 +26,7 @@ export const useChatStore = defineStore('chat', () => {
2526
const userStore = useUserStore()
2627
const globalStore = useGlobalStore()
2728
const groupStore = useGroupStore()
29+
const contactStore = useContactStore()
2830
const sessionList = reactive<SessionItem[]>([]) // 会话列表
2931
const sessionOptions = reactive({ isLast: false, isLoading: false, cursor: '' })
3032

@@ -225,6 +227,8 @@ export const useChatStore = defineStore('chat', () => {
225227
currentRoomType.value === RoomTypeEnum.Group && groupStore.getGroupUserList(true)
226228
// 初始化所有用户基本信息
227229
userStore.isSign && cachedStore.initAllUserBaseInfo()
230+
// 联系人列表
231+
contactStore.getContactList(true)
228232
}
229233
}
230234

src/stores/user.ts

+5-5
Original file line numberDiff line numberDiff line change
@@ -26,11 +26,11 @@ export const useUserStore = defineStore('user', () => {
2626
.then((data) => {
2727
userInfo.value = { ...userInfo.value, ...data }
2828
})
29-
.catch(()=> {
30-
// 删除缓存
31-
localStorage.removeItem("TOKEN")
32-
localStorage.removeItem("USER_INFO")
33-
})
29+
.catch(() => {
30+
// 删除缓存
31+
localStorage.removeItem('TOKEN')
32+
localStorage.removeItem('USER_INFO')
33+
})
3434
}
3535

3636
return { userInfo, isSign, getUserDetailAction }

src/styles/base.css

-2
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,6 @@ a:active {
9393
overflow: hidden;
9494
text-overflow: ellipsis;
9595
-webkit-line-clamp: 1;
96-
line-clamp: 1;
9796
}
9897

9998
.ellipsis-2 {
@@ -102,7 +101,6 @@ a:active {
102101
overflow: hidden;
103102
text-overflow: ellipsis;
104103
-webkit-line-clamp: 2;
105-
line-clamp: 2;
106104
}
107105

108106
.icon-spin {

src/views/Home/Chat/components/UserList/index.vue

+2-1
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ import { Plus } from '@element-plus/icons-vue'
55
import { useGroupStore } from '@/stores/group'
66
import { useGlobalStore } from '@/stores/global'
77
import { useCachedStore } from '@/stores/cached'
8+
import { RoleEnum } from '@/enums'
89
import UserItem from './UserItem/index.vue'
910
1011
const groupListLastElRef = ref<HTMLDivElement>()
@@ -42,7 +43,6 @@ const onAddGroupMember = () => {
4243
globalStore.createGroupModalInfo.show = true
4344
globalStore.createGroupModalInfo.isInvite = true
4445
// 禁用已经邀请的人
45-
console.log('cachedStore.currentAtUsersList', cachedStore.currentAtUsersList)
4646
globalStore.createGroupModalInfo.selectedUid = cachedStore.currentAtUsersList.map(
4747
(item) => item.uid,
4848
)
@@ -64,6 +64,7 @@ const onAddGroupMember = () => {
6464
type="primary"
6565
:icon="Plus"
6666
circle
67+
:disabled="statistic.role === RoleEnum.REMOVED"
6768
size="small"
6869
@click="onAddGroupMember"
6970
/>

src/views/Home/Contacts/components/ContactList/Side/styles.scss

+2-2
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@
2424
border-bottom-width: 0;
2525
}
2626

27-
:deep(.is-active) {
27+
:deep(.el-collapse-item.is-active) {
2828
display: flex;
2929

3030
// flex: 1;
@@ -33,7 +33,7 @@
3333
overflow: hidden;
3434
}
3535

36-
:deep(.is-active .el-collapse-item__content) {
36+
:deep(.el-collapse-item.is-active .el-collapse-item__content) {
3737
height: 100%;
3838
padding-bottom: 0;
3939
}

0 commit comments

Comments
 (0)