1:实现效果
2 :页面使用步骤
- 引入组件
import JTreeDepartSelect from '@/components/jeecg/JTreeDepartSelect'
components: {
JTreeDepartSelect,
}
- 页面添加
<a-col :xl="6" :lg="7" :md="8" :sm="24">
<a-form-item label="所属部门">
<j-tree-depart-select
ref="reset"
v-model="queryParam.sysOrgCode"
placeholder="请选择所属部门"
dict="sys_permission,name,id"
pidField="parent_id"
pidValue=""
/>
</a-form-item>
</a-col>
- 友情提示:queryParam.sysOrgCode(获取的是部门id)
3:切换部门名称
@Autowired
private ISysDepartService sysDepartService;
- 查询数据
SysDepart sysDepart = sysDepartService.getById(id);
- 数据组装
String orgCode = "";
if(oConvertUtils.isNotEmpty(cspDocLog.getSysOrgCode())){
SysDepart sysDepart = sysDepartService.getById(cspDocLog.getSysOrgCode());
orgCode = sysDepart.getOrgCode();
cspDocLog.setSysOrgCode(null);
}
if(oConvertUtils.isNotEmpty(orgCode)){
queryWrapper.like("sys_org_code",orgCode);
}
- 重置部门数据
// 重置
searchReset(){
var that = this;
var logType = that.queryParam.logType;
that.queryParam = {}; //清空查询区域参数
that.queryParam.logType = logType;
//重置部门
console.log("重置部门")
this.$refs['reset'].resetDepart()
that.loadData(this.ipagination.current);
},