更新
This commit is contained in:
@ -1,26 +1,12 @@
|
||||
<template>
|
||||
<div class="departmentTree-box" :style="{ width: width, height: '100%' }">
|
||||
<div class="depar_hear">
|
||||
<el-input
|
||||
v-model="listQuery.deptname"
|
||||
v-if="filterable"
|
||||
clearable
|
||||
:debounce="500"
|
||||
@input="filterTextChange"
|
||||
placeholder="请输入筛选条件"
|
||||
/>
|
||||
<el-input v-model="listQuery.deptname" v-if="filterable" clearable :debounce="500" @input="filterTextChange"
|
||||
placeholder="请输入筛选条件" />
|
||||
</div>
|
||||
<div class="depar_foot">
|
||||
<el-tree
|
||||
ref="treeRef"
|
||||
class="filter-tree"
|
||||
:props="endProps"
|
||||
lazy
|
||||
:load="loadNode"
|
||||
@node-click="nodeClick"
|
||||
:filter-node-method="filterNode"
|
||||
:data="treeData"
|
||||
/>
|
||||
<el-tree ref="treeRef" class="filter-tree" :props="endProps" lazy :load="loadNode" @node-click="nodeClick"
|
||||
:filter-node-method="filterNode" :data="treeData" />
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
@ -52,9 +38,13 @@ const props = defineProps({
|
||||
default: COMPONENT_WIDTH,
|
||||
type: String
|
||||
},
|
||||
isBmId:{
|
||||
type:Boolean,
|
||||
default:false
|
||||
isBmId: {
|
||||
type: Boolean,
|
||||
default: false
|
||||
},
|
||||
propValue:{
|
||||
type:String,
|
||||
default:"id"
|
||||
}
|
||||
});
|
||||
const listQuery = ref({
|
||||
@ -67,7 +57,7 @@ const node_had = ref([]);
|
||||
const resolve_had = ref([]);
|
||||
//防抖处理
|
||||
const filterTextChange = debounce(inputChange, 500);
|
||||
onMounted(() => {});
|
||||
onMounted(() => { });
|
||||
//获取部门数据
|
||||
function getTreeData() {
|
||||
selectDeptPage(listQuery.value).then((res) => {
|
||||
@ -120,9 +110,9 @@ const filterNode = (value, data) => {
|
||||
};
|
||||
|
||||
const nodeClick = (node) => {
|
||||
if(props.isBmId){
|
||||
if (props.isBmId) {
|
||||
emits("update:modelValue", node.id);
|
||||
}else{
|
||||
} else {
|
||||
emits("update:modelValue", node.orgCode);
|
||||
}
|
||||
};
|
||||
@ -145,6 +135,7 @@ const handleChange = (e) => {
|
||||
.depar_hear {
|
||||
height: 32px;
|
||||
}
|
||||
|
||||
.depar_foot {
|
||||
height: calc(100% - 32px);
|
||||
overflow: auto;
|
||||
@ -152,6 +143,7 @@ const handleChange = (e) => {
|
||||
width: 100%;
|
||||
min-width: 300px;
|
||||
}
|
||||
|
||||
.departmentTree-box {
|
||||
overflow: auto;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user