|
|
@ -1,5 +1,5 @@ |
|
|
<script lang='ts' setup> |
|
|
<script lang='ts' setup> |
|
|
import { computed, onMounted, onBeforeMount,nextTick } from 'vue' |
|
|
import { computed, onMounted, onBeforeMount,nextTick,inject } from 'vue' |
|
|
import { criteriaForPeopleList } from '@/api/hr/org/type' |
|
|
import { criteriaForPeopleList } from '@/api/hr/org/type' |
|
|
import request from '@/utils/request'; |
|
|
import request from '@/utils/request'; |
|
|
import { useAttrs } from 'vue' |
|
|
import { useAttrs } from 'vue' |
|
|
@ -25,6 +25,7 @@ const treeData = ref([]) // 存储懒加载的数据 |
|
|
const isDataLoaded = ref(false) // 标记数据是否已加载 |
|
|
const isDataLoaded = ref(false) // 标记数据是否已加载 |
|
|
const loading = ref(false) // 是否正在加载 |
|
|
const loading = ref(false) // 是否正在加载 |
|
|
const treeSelectRef = ref() // 树选择器引用 |
|
|
const treeSelectRef = ref() // 树选择器引用 |
|
|
|
|
|
const { location, updateLocation } = inject('location') |
|
|
|
|
|
|
|
|
// 上一次选择的值,用于比较 |
|
|
// 上一次选择的值,用于比较 |
|
|
const lastSelectedValue = ref(null) |
|
|
const lastSelectedValue = ref(null) |
|
|
@ -56,6 +57,13 @@ const handleValueChange = (newValue) => { |
|
|
value.value = newValue; |
|
|
value.value = newValue; |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
|
|
|
//实现选择用户选择时,自动填充选择组织 liwenxuan 2025-11-11 start |
|
|
|
|
|
|
|
|
|
|
|
//监听选择用户的当前值,告知父组件form |
|
|
|
|
|
updateLocation(value.value,props.data.name) |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
//实现选择用户选择时,自动填充选择组织 liwenxuan 2025-11-11 end |
|
|
} else { |
|
|
} else { |
|
|
// 多选模式下的处理 |
|
|
// 多选模式下的处理 |
|
|
if (newValue.length > 0) { |
|
|
if (newValue.length > 0) { |
|
|
@ -123,7 +131,7 @@ onBeforeMount(() => { |
|
|
}) |
|
|
}) |
|
|
|
|
|
|
|
|
onUnmounted(()=>{ |
|
|
onUnmounted(()=>{ |
|
|
console.log("onUnmounted") |
|
|
//console.log("onUnmounted") |
|
|
}) |
|
|
}) |
|
|
|
|
|
|
|
|
// 递归处理树节点,将部门节点设置为禁用 |
|
|
// 递归处理树节点,将部门节点设置为禁用 |
|
|
@ -269,7 +277,7 @@ function hasNodesInTree(tree) { |
|
|
{{ loading ? '正在加载' : '无数据' }} |
|
|
{{ loading ? '正在加载' : '无数据' }} |
|
|
</div> |
|
|
</div> |
|
|
</template> |
|
|
</template> |
|
|
</el-tree-select> |
|
|
</el-tree-select><!-- <button >{{ location }}</button> --> |
|
|
</div> |
|
|
</div> |
|
|
</template> |
|
|
</template> |
|
|
<style lang='scss' scoped> |
|
|
<style lang='scss' scoped> |
|
|
|