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
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:
commit
ba52f9a576
@ -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) => {
|
||||
|
@ -24,7 +24,7 @@ const { showUserInfoModal } = useInject()
|
||||
<em v-show="index < extra.members.length - 1">、</em>
|
||||
</template>
|
||||
|
||||
<span>踢出群聊</span>
|
||||
<span>移出群聊</span>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
|
@ -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]: '[群禁言消息]',
|
||||
|
@ -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;
|
||||
|
||||
// 如果leader状态不同,优先按leader排序
|
||||
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)
|
||||
|
@ -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 节点
|
||||
|
@ -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) {
|
||||
|
@ -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()
|
||||
})
|
||||
|
@ -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,
|
||||
|
Loading…
Reference in New Issue
Block a user