| | |
| | | reset() {
|
| | | this.form = {
|
| | | deptId: undefined,
|
| | | parentId: 100,
|
| | | parentId: undefined,
|
| | | deptName: undefined,
|
| | | orderNum: undefined,
|
| | | leader: undefined,
|
| | |
| | | <el-table v-loading="loading" :data="userList" @selection-change="handleSelectionChange">
|
| | | <el-table-column type="selection" width="40" align="center" />
|
| | | <el-table-column label="用户编号" align="center" prop="userId" />
|
| | | <el-table-column label="用户名称" align="center" prop="userName" />
|
| | | <el-table-column label="用户昵称" align="center" prop="nickName" />
|
| | | <el-table-column label="部门" align="center" prop="dept.deptName" />
|
| | | <el-table-column label="用户名称" align="center" prop="userName" :show-overflow-tooltip="true" />
|
| | | <el-table-column label="用户昵称" align="center" prop="nickName" :show-overflow-tooltip="true" />
|
| | | <el-table-column label="部门" align="center" prop="dept.deptName" :show-overflow-tooltip="true" />
|
| | | <el-table-column label="手机号码" align="center" prop="phonenumber" width="120" />
|
| | | <el-table-column label="状态" align="center">
|
| | | <template slot-scope="scope">
|
| | |
| | | reset() {
|
| | | this.form = {
|
| | | userId: undefined,
|
| | | deptId: 100,
|
| | | deptId: undefined,
|
| | | userName: undefined,
|
| | | nickName: undefined,
|
| | | password: undefined,
|
| | |
| | | public List<SysDept> buildDeptTree(List<SysDept> depts)
|
| | | {
|
| | | List<SysDept> returnList = new ArrayList<SysDept>();
|
| | | if (StringUtils.isNotEmpty(depts) && StringUtils.isNotNull(depts.stream().findFirst()))
|
| | | {
|
| | | depts.stream().findFirst().get().setParentId(null);
|
| | | }
|
| | | for (Iterator<SysDept> iterator = depts.iterator(); iterator.hasNext();)
|
| | | {
|
| | | SysDept t = (SysDept) iterator.next();
|
| | | // 根据传入的某个父节点ID,遍历该父节点的所有子节点
|
| | | if (t.getParentId() == 0)
|
| | | if (StringUtils.isNull(t.getParentId()) || t.getParentId() == 0)
|
| | | {
|
| | | recursionFn(depts, t);
|
| | | returnList.add(t);
|
| | |
| | | while (it.hasNext())
|
| | | {
|
| | | SysDept n = (SysDept) it.next();
|
| | | if (n.getParentId().longValue() == t.getDeptId().longValue())
|
| | | if (StringUtils.isNotNull(n.getParentId()) && n.getParentId().longValue() == t.getDeptId().longValue())
|
| | | {
|
| | | tlist.add(n);
|
| | | }
|