2025-01-07 10:57:29 +00:00
|
|
|
<template>
|
2025-01-17 05:56:06 +00:00
|
|
|
<div class="outer-layer manage-group-admin-page">
|
2025-01-07 10:57:29 +00:00
|
|
|
<div class="root">
|
|
|
|
<ZPaging ref="zPaging" :show-scrollbar="false">
|
|
|
|
<template #top>
|
|
|
|
<tm-navbar :hideBack="false" hideHome title="" :leftWidth="220">
|
|
|
|
<div class="navBar-title flex flex-col items-center justify-center">
|
|
|
|
<span class="text-[34rpx] font-medium">
|
|
|
|
{{ $t('chat.settings.groupAdmin') }}
|
|
|
|
</span>
|
|
|
|
</div>
|
|
|
|
</tm-navbar>
|
|
|
|
</template>
|
2025-01-17 05:56:06 +00:00
|
|
|
<div class="manage-group-admin">
|
|
|
|
<span class="manage-group-admin-title text-[28rpx] font-regular">
|
2025-01-07 10:57:29 +00:00
|
|
|
{{ $t('chat.settings.groupAdmin') }}
|
|
|
|
</span>
|
|
|
|
<div
|
2025-01-17 05:56:06 +00:00
|
|
|
class="group-admin-list chat-settings-card"
|
|
|
|
:style="{
|
|
|
|
margin: state.groupAdminList.length > 0 ? '20rpx 0 0' : '',
|
|
|
|
}"
|
|
|
|
>
|
|
|
|
<div
|
|
|
|
class="group-admin-list-each"
|
|
|
|
v-for="(item, index) in state.groupAdminList"
|
|
|
|
:key="index"
|
|
|
|
>
|
|
|
|
<span>{{ item }}</span>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
<div
|
|
|
|
class="add-admin-member-btn chat-settings-card"
|
2025-01-07 10:57:29 +00:00
|
|
|
@click="toSelectMembersPage"
|
2025-01-17 05:56:06 +00:00
|
|
|
:style="{
|
|
|
|
margin: state.groupAdminList.length == 0 ? '20rpx 0 0' : '',
|
|
|
|
}"
|
2025-01-07 10:57:29 +00:00
|
|
|
>
|
|
|
|
<img src="/src/static/image/chatSettings/add-btn.png" />
|
|
|
|
<span class="text-[28rpx] font-medium">
|
|
|
|
{{ $t('chat.manage.addAdmin') }}
|
|
|
|
</span>
|
|
|
|
</div>
|
|
|
|
</div>
|
2025-01-17 05:56:06 +00:00
|
|
|
<template #bottom>
|
|
|
|
<customBtn :isBottom="true" :btnText="$t('ok')"></customBtn>
|
|
|
|
</template>
|
2025-01-07 10:57:29 +00:00
|
|
|
</ZPaging>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</template>
|
|
|
|
<script setup>
|
2025-01-17 05:56:06 +00:00
|
|
|
import customBtn from '@/components/custom-btn/custom-btn.vue'
|
2025-01-07 10:57:29 +00:00
|
|
|
import ZPaging from '@/uni_modules/z-paging/components/z-paging/z-paging.vue'
|
|
|
|
import { onLoad } from '@dcloudio/uni-app'
|
|
|
|
import { computed, onMounted, reactive } from 'vue'
|
|
|
|
|
2025-01-13 08:56:13 +00:00
|
|
|
import { useGroupTypeStore } from '@/store/groupType'
|
2025-01-07 10:57:29 +00:00
|
|
|
import { useGroupStore, useDialogueStore } from '@/store'
|
|
|
|
|
|
|
|
import { useI18n } from 'vue-i18n'
|
|
|
|
const { t } = useI18n()
|
|
|
|
|
2025-01-13 08:56:13 +00:00
|
|
|
const groupTypeStore = useGroupTypeStore()
|
|
|
|
const groupTypeParams = reactive({
|
|
|
|
postTreeList: computed(() => groupTypeStore.postTreeList),
|
|
|
|
})
|
2025-01-07 10:57:29 +00:00
|
|
|
const groupStore = useGroupStore()
|
2025-01-17 05:56:06 +00:00
|
|
|
const groupParams = reactive({
|
|
|
|
groupInfo: computed(() => groupStore.groupInfo),
|
|
|
|
})
|
2025-01-07 10:57:29 +00:00
|
|
|
const dialogueStore = useDialogueStore()
|
|
|
|
const dialogueParams = reactive({
|
2025-01-08 08:31:31 +00:00
|
|
|
adminList: computed(() => dialogueStore.getAdminList),
|
2025-01-07 10:57:29 +00:00
|
|
|
})
|
|
|
|
|
|
|
|
const state = reactive({
|
|
|
|
silenceAllBtn: null, //全员禁言按钮
|
2025-01-17 05:56:06 +00:00
|
|
|
groupAdminList: [], //群管理员列表
|
2025-01-07 10:57:29 +00:00
|
|
|
})
|
|
|
|
|
|
|
|
onLoad((options) => {
|
|
|
|
console.log(options)
|
|
|
|
})
|
|
|
|
|
2025-01-13 08:56:13 +00:00
|
|
|
onMounted(async () => {
|
2025-01-07 10:57:29 +00:00
|
|
|
console.log(dialogueParams.adminList)
|
2025-01-17 05:56:06 +00:00
|
|
|
await groupStore.ServeGroupDetail()
|
2025-01-13 08:56:13 +00:00
|
|
|
await groupTypeStore.getPositionsTree()
|
2025-01-17 05:56:06 +00:00
|
|
|
console.log(groupParams.groupInfo)
|
|
|
|
console.log(groupTypeParams.postTreeList)
|
|
|
|
assembleDepartmentPositions()
|
2025-01-07 10:57:29 +00:00
|
|
|
})
|
|
|
|
|
2025-01-17 05:56:06 +00:00
|
|
|
//组装部门和岗位对应关系数据
|
|
|
|
const assembleDepartmentPositions = () => {
|
|
|
|
let deptPosArr = []
|
|
|
|
if (groupParams?.groupInfo?.deptInfos?.length > 0) {
|
|
|
|
if (groupParams?.groupInfo?.positionInfos?.length > 0) {
|
|
|
|
groupParams?.groupInfo?.deptInfos.forEach((deptInfo) => {
|
|
|
|
groupParams?.groupInfo?.positionInfos.forEach((positionInfo) => {
|
|
|
|
let deptPosItem = groupTypeStore.getDepartmentPositionsById(
|
|
|
|
deptInfo.dept_id,
|
|
|
|
positionInfo.position_id,
|
|
|
|
)
|
|
|
|
if (deptPosItem) {
|
|
|
|
deptPosArr.push(deptPosItem)
|
|
|
|
}
|
|
|
|
})
|
|
|
|
})
|
|
|
|
}
|
|
|
|
}
|
|
|
|
console.log(deptPosArr)
|
|
|
|
state.groupAdminList = deptPosArr
|
|
|
|
}
|
|
|
|
|
2025-01-07 10:57:29 +00:00
|
|
|
//点击跳转到添加禁言成员页面
|
|
|
|
const toSelectMembersPage = () => {
|
|
|
|
uni.navigateTo({
|
|
|
|
url: '/pages/chatSettings/groupManage/selectMembers?manageType=admin',
|
|
|
|
})
|
|
|
|
}
|
|
|
|
</script>
|
|
|
|
<style scoped lang="scss">
|
|
|
|
.outer-layer {
|
|
|
|
flex: 1;
|
|
|
|
background-image: url('@/static/image/clockIn/z3280@3x.png');
|
|
|
|
background-size: cover;
|
|
|
|
background-repeat: no-repeat;
|
|
|
|
}
|
|
|
|
|
2025-01-17 05:56:06 +00:00
|
|
|
.manage-group-admin {
|
2025-01-07 10:57:29 +00:00
|
|
|
padding: 20rpx 32rpx;
|
2025-01-17 05:56:06 +00:00
|
|
|
.manage-group-admin-title {
|
2025-01-07 10:57:29 +00:00
|
|
|
line-height: 40rpx;
|
|
|
|
color: #959598;
|
|
|
|
}
|
2025-01-17 05:56:06 +00:00
|
|
|
|
|
|
|
.group-admin-list {
|
|
|
|
.group-admin-list-each {
|
|
|
|
padding: 36rpx 0;
|
|
|
|
margin: 0 32rpx;
|
|
|
|
border-bottom: 1px solid $theme-border-color;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
.add-admin-member-btn {
|
2025-01-07 10:57:29 +00:00
|
|
|
padding: 32rpx;
|
|
|
|
display: flex;
|
|
|
|
flex-direction: row;
|
|
|
|
align-items: center;
|
|
|
|
justify-content: flex-start;
|
|
|
|
img {
|
|
|
|
width: 40rpx;
|
|
|
|
height: 40rpx;
|
|
|
|
margin: 0 22rpx 0 0;
|
|
|
|
}
|
|
|
|
span {
|
|
|
|
line-height: 40rpx;
|
|
|
|
color: $theme-text;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
.chat-settings-card {
|
|
|
|
width: 100%;
|
|
|
|
background-color: #fff;
|
|
|
|
border-radius: 8rpx;
|
|
|
|
box-shadow: 0 6px 12px 2px rgba(188, 188, 188, 0.08);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
</style>
|