【招生平台用户端】 优化# 子账号管理:刷新组织架构,默认选中第一层节点
parent
15968dbfef
commit
662f221890
|
@ -81,17 +81,11 @@ watch(filterText, val => {
|
|||
const handleNodeClick = (data: Tree) => {
|
||||
parent?.setSelectedNode(data)
|
||||
}
|
||||
// 默认设置选中节点
|
||||
watch(
|
||||
() => props.currentNodeKey,
|
||||
val => {
|
||||
if (val) {
|
||||
const setCurrentKey = (val: any) => {
|
||||
nextTick(() => {
|
||||
treeRef.value?.setCurrentKey(val)
|
||||
})
|
||||
}
|
||||
}
|
||||
)
|
||||
}
|
||||
const handleCommand = (args: any[], data: Tree) => {
|
||||
const command = args[0]
|
||||
switch (command) {
|
||||
|
@ -106,6 +100,9 @@ const handleCommand = (args: any[], data: Tree) => {
|
|||
break
|
||||
}
|
||||
}
|
||||
defineExpose({
|
||||
setCurrentKey
|
||||
})
|
||||
</script>
|
||||
|
||||
<style scoped lang="scss">
|
||||
|
|
|
@ -19,7 +19,7 @@
|
|||
<el-select placeholder="请选择岗位名称" v-model="searchForm.postId" clearable @change="handleSelectChange">
|
||||
<el-option v-for="option in positionOptions" :key="option.id" :label="option.name" :value="option.id" />
|
||||
</el-select>
|
||||
<el-select placeholder="请选择账号状态" v-model="searchForm.status" clearable @change="handleSelectChange">
|
||||
<el-select placeholder="请选择账号状态" v-model="searchForm.isDisable" clearable @change="handleSelectChange">
|
||||
<el-option v-for="option in accountStatusOptions" :key="option.value" :label="option.label" :value="option.value" />
|
||||
</el-select>
|
||||
</el-space>
|
||||
|
|
|
@ -1,7 +1,13 @@
|
|||
<template>
|
||||
<div class="flex flex-col w-[240px] border-r-solid-light2">
|
||||
<structure />
|
||||
<organization-tree :data="data" :loading="loading" :currentNodeKey="curSelectedNode?.id" @set-group-leader="setGroupLeader" />
|
||||
<organization-tree
|
||||
ref="organizationTreeRef"
|
||||
:data="data"
|
||||
:loading="loading"
|
||||
:currentNodeKey="curSelectedNode?.id"
|
||||
@set-group-leader="setGroupLeader"
|
||||
/>
|
||||
</div>
|
||||
<group-leader-dialog ref="groupLeaderDialogRef" @refresh-list="$emit('fetchTableList')" />
|
||||
</template>
|
||||
|
@ -23,8 +29,10 @@ defineProps({
|
|||
const emit = defineEmits(['setSelectedNode', 'fetchTableList'])
|
||||
const data = ref<Tree[]>([])
|
||||
const loading = ref(false)
|
||||
const organizationTreeRef = ref<InstanceType<typeof organizationTree>>()
|
||||
const setSelectedNode = (data: Tree) => {
|
||||
emit('setSelectedNode', data)
|
||||
organizationTreeRef.value?.setCurrentKey(data)
|
||||
}
|
||||
const fetchOrganizationList = async () => {
|
||||
loading.value = true
|
||||
|
|
Loading…
Reference in New Issue