完成部门选择和人员选择页面新规则

This commit is contained in:
wangyifeng 2025-03-04 14:10:25 +08:00
parent 82ba6ddbd7
commit 69fd096c4d
2 changed files with 21 additions and 8 deletions

View File

@ -402,10 +402,15 @@
class="flex flex-col"
>
<div
v-if="index === 0 && allCheckedList.length == 0"
v-if="
index === 0 &&
allCheckedList.length == 0 &&
state.chooseMode === 2
"
class="divider"
></div>
<div
v-if="state.chooseMode === 2"
class="flex items-center justify-between mt-[36rpx] font-medium text-[#000000] leading-[40rpx] mb-[34rpx]"
>
<div class="text-[28rpx] ml-[10rpx] flex">
@ -429,7 +434,7 @@
></customBtn>
</div>
</div>
<div class="divider"></div>
<div class="divider" v-if="state.chooseMode === 2"></div>
</div>
</div>
</scroll-view>
@ -465,6 +470,7 @@ const {
crumbsIndex,
depCheckedKeys,
getDepMembers,
memberDepCheckedKeys,
membersCheckedKeys,
allChooseMembers,
} = useGroupTypeStore()
@ -851,14 +857,18 @@ const handleConfirm = async () => {
})
if (res.status == 0 && res.data?.data?.length) {
res.data?.data.forEach((v) => {
// ID
if (!listT.some((item) => item.ID === v.ID)) {
listT.push(v)
}
})
}
}
allChooseMembers.value = listT
memberDepCheckedKeys.value = lodash.cloneDeep(allCheckedList.value) //
} else {
depCheckedKeys.value = lodash.cloneDeep(allCheckedList.value) //
}
depCheckedKeys.value = lodash.cloneDeep(allCheckedList.value)
console.log('depCheckedKeys', depCheckedKeys.value)
uni.navigateBack()
}
@ -897,8 +907,8 @@ const init = async () => {
}
if (state.chooseMode === 2) {
//
depCheckedKeys.value.forEach((item) => {
//
memberDepCheckedKeys.value.forEach((item) => {
const node = findNodeById(depTreeMyList.value[0], item.ID)
if (node) {
node.checkStatus = 'checked'

View File

@ -22,8 +22,9 @@ export const useGroupTypeStore = createGlobalState(() => {
const departmentAllPositions = ref([]) //部门下所有岗位
const crumbs = ref([])
const crumbsIndex = ref(0)
const depCheckedKeys = ref([]) // 选中的部门keys
const depCheckedKeys = ref([]) // 部门选择模式下,选中的部门keys
const groupAdmins = ref([]) // 选中的管理员
const memberDepCheckedKeys = ref([]) // 人员选择模式下选中的部门keys
const membersCheckedKeys = ref([]) // 选中的人员keys
const allChooseMembers = ref([])
@ -63,6 +64,7 @@ export const useGroupTypeStore = createGlobalState(() => {
crumbsIndex.value = 0
depCheckedKeys.value = []
groupAdmins.value = []
memberDepCheckedKeys.value = []
membersCheckedKeys.value = []
allChooseMembers.value = []
}
@ -132,6 +134,7 @@ export const useGroupTypeStore = createGlobalState(() => {
createDepGroup,
getDepMembers,
membersCheckedKeys,
memberDepCheckedKeys,
allChooseMembers,
getDepartmentPositionsById,
}