Merge branch 'wwt'
Some checks are pending
Check / lint (push) Waiting to run
Check / typecheck (push) Waiting to run
Check / build (build, 18.x, ubuntu-latest) (push) Waiting to run
Check / build (build, 18.x, windows-latest) (push) Waiting to run
Check / build (build:app, 18.x, ubuntu-latest) (push) Waiting to run
Check / build (build:app, 18.x, windows-latest) (push) Waiting to run
Check / build (build:mp-weixin, 18.x, ubuntu-latest) (push) Waiting to run
Check / build (build:mp-weixin, 18.x, windows-latest) (push) Waiting to run

This commit is contained in:
wwt 2025-03-18 09:45:56 +08:00
commit ba52f9a576
8 changed files with 66 additions and 13 deletions

View File

@ -26,6 +26,14 @@ export const departmentV2TreeAll = (data) => {
data,
})
}
// 通讯录过滤测试部门
export const departmentV2TreeAll2 = (data) => {
return request({
url: '/api/v1/contact/department/v2/tree/all',
method: 'POST',
data,
})
}
//获取指定部门下的所有岗位
export const v2TreePositionByDepartment = (data) => {

View File

@ -24,7 +24,7 @@ const { showUserInfoModal } = useInject()
<em v-show="index < extra.members.length - 1"></em>
</template>
<span>出群聊</span>
<span>出群聊</span>
</div>
</div>
</template>

View File

@ -17,7 +17,7 @@ export const ChatMsgSysText = 1000 // 系统文本消息
export const ChatMsgSysGroupCreate = 1101 // 创建群聊消息
export const ChatMsgSysGroupMemberJoin = 1102 // 加入群聊消息
export const ChatMsgSysGroupMemberQuit = 1103 // 群成员退出群消息
export const ChatMsgSysGroupMemberKicked = 1104 // 出群成员消息
export const ChatMsgSysGroupMemberKicked = 1104 // 出群成员消息
export const ChatMsgSysGroupMessageRevoke = 1105 // 管理员撤回成员消息
export const ChatMsgSysGroupDismissed = 1106 // 群解散
export const ChatMsgSysGroupMuted = 1107 // 群禁言
@ -47,7 +47,7 @@ export const ChatMsgTypeMapping = {
[ChatMsgSysGroupCreate]: '[创建群消息]',
[ChatMsgSysGroupMemberJoin]: '[加入群消息]',
[ChatMsgSysGroupMemberQuit]: '[退出群消息]',
[ChatMsgSysGroupMemberKicked]: '[出群消息]',
[ChatMsgSysGroupMemberKicked]: '[出群消息]',
[ChatMsgSysGroupMessageRevoke]: '[撤回消息]',
[ChatMsgSysGroupDismissed]: '[群解散消息]',
[ChatMsgSysGroupMuted]: '[群禁言消息]',

View File

@ -9,7 +9,7 @@
? ''
: '0',
}"
v-for="(memberItem, memberIndex) in props?.memberList"
v-for="(memberItem, memberIndex) in sortedMemberList"
@click="toUserDetailPage(memberItem)"
>
<div
@ -81,7 +81,7 @@
</div>
</template>
<script setup>
import { defineProps } from 'vue'
import { defineProps, computed } from 'vue'
const props = defineProps({
memberList: Array, //
memberListsLimit: Number, //
@ -90,6 +90,36 @@ const props = defineProps({
hideAddRemoveBtns: Boolean, //
})
//
const sortedMemberList = computed(() => {
if (!props.memberList || props.memberList.length === 0) return [];
//
const indexedList = props.memberList.map((item, index) => ({ item, index }));
// leader
return indexedList.sort((a, b) => {
const leaderA = a.item.leader || 0;
const leaderB = b.item.leader || 0;
// leaderleader
if ((leaderA === 1 || leaderA === 2) && (leaderB !== 1 && leaderB !== 2)) {
return -1; // a
}
if ((leaderB === 1 || leaderB === 2) && (leaderA !== 1 && leaderA !== 2)) {
return 1; // b
}
// leader
if ((leaderA === 1 || leaderA === 2) && (leaderB === 1 || leaderB === 2)) {
return leaderB - leaderA; // leader
}
//
return a.index - b.index;
}).map(item => item.item); //
})
//
const toUserDetailPage = (userItem) => {
console.log(userItem)

View File

@ -470,7 +470,7 @@ const { t } = useI18n()
const {
groupActiveIndex,
getDepsTreeMy,
getDepsTreeMy2,
depTreeMyList,
crumbs,
crumbsIndex,
@ -917,7 +917,7 @@ const init = async () => {
depTreeMyList.value = []
crumbs.value = []
await getDepsTreeMy()
await getDepsTreeMy2()
if (depTreeMyList.value.length) {
if (state.chooseMode === 1) {
// all

View File

@ -15,7 +15,7 @@
</div>
<div class="mt-[54rpx] w-full h-[872rpx]">
<div
@click="groupActiveIndex = 0"
@click="groupActiveIndex = 0;depCheckedKeys = []"
class="groupCard firstPanel"
:class="groupActiveIndex === 0 ? 'activePanel' : ''"
>
@ -95,7 +95,7 @@
</div>
</div>
<div
@click="groupActiveIndex = 2"
@click="groupActiveIndex = 2;depCheckedKeys = [];"
class="groupCard thirdPanel"
:class="groupActiveIndex === 2 ? 'activePanel' : ''"
>
@ -131,14 +131,16 @@
import ZPaging from '@/uni_modules/z-paging/components/z-paging/z-paging.vue'
import customBtn from '@/components/custom-btn/custom-btn.vue'
import { ref, watch, computed } from 'vue'
import { onShow, onLoad } from '@dcloudio/uni-app'
import { onShow, onLoad, onUnload } from '@dcloudio/uni-app'
import { useChatList } from '@/store/chatList/index.js'
import { useAuth } from '@/store/auth'
import { useTalkStore, useUserStore } from '@/store'
import { useGroupTypeStore } from '@/store/groupType'
const { groupActiveIndex, depCheckedKeys } = useGroupTypeStore()
onUnload(()=> {
})
const confirmBtnStatus = computed(() => {
let disabledT = false
switch (groupActiveIndex.value) {

View File

@ -187,7 +187,7 @@ import groupMemberList from '../chatSettings/components/groupMembersList.vue'
import avatarModule from '@/components/avatar-module/index.vue'
import { ref, watch, computed, onMounted } from 'vue'
import { onShow, onLoad } from '@dcloudio/uni-app'
import { onShow, onLoad, onUnload } from '@dcloudio/uni-app'
import { useChatList } from '@/store/chatList/index.js'
import { useAuth } from '@/store/auth'
import { useTalkStore, useUserStore, useGroupStore } from '@/store'
@ -214,10 +214,14 @@ const { userInfo } = useAuth()
const groupChatType = ref('')
const depsNoExpanded = ref(true)
onLoad(()=> {
groupStore.$reset()
})
onUnload(()=> {
groupName.value = '';
groupActiveIndex.value = -1;
})
onMounted(() => {
handleSetWebviewStyle()
})

View File

@ -10,6 +10,7 @@ import {
departmentV2AllPosition,
groupCreateDept,
departmentV2TreeAll,
departmentV2TreeAll2,
userV2List,
v2TreePositionByDepartment,
} from '@/api/deps/index.js'
@ -35,6 +36,13 @@ export const useGroupTypeStore = createGlobalState(() => {
}
}
const getDepsTreeMy2 = async () => {
const res = await departmentV2TreeAll2()
if (res.status === 0) {
depTreeMyList.value = res.data.nodes
}
}
//获取指定部门下的所有岗位
const getPositionByDepartment = async (params) => {
const res = await v2TreePositionByDepartment(params)
@ -124,6 +132,7 @@ export const useGroupTypeStore = createGlobalState(() => {
postTreeList,
departmentAllPositions,
getDepsTreeMy,
getDepsTreeMy2,
getPositionByDepartment,
getPositionsTree,
crumbs,