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