diff --git a/Api/Ewide.Core/Service/Org/SysOrgService.cs b/Api/Ewide.Core/Service/Org/SysOrgService.cs index 7c15c46..a0e5896 100644 --- a/Api/Ewide.Core/Service/Org/SysOrgService.cs +++ b/Api/Ewide.Core/Service/Org/SysOrgService.cs @@ -59,8 +59,8 @@ namespace Ewide.Core.Service var orgs = await _sysOrgRep.DetachedEntities .Where((name, u => EF.Functions.Like(u.Name, $"%{input.Name.Trim()}%")), // 根据机构名称模糊查询 (id, u => u.Id == input.Id.Trim()), // 根据机构id查询 - (pId, u => EF.Functions.Like(u.Pids, $"%[{input.Pid.Trim()}]%") - || u.Id == input.Pid.Trim())) // 根据父机构id查询 + (pId, u => input.TreeNodeDataScope.GetValueOrDefault(1) == 2 ? (EF.Functions.Like(u.Pids, $"%[{input.Pid.Trim()}]%") + || u.Id == input.Pid.Trim()) : u.Id == input.Pid.Trim() )) // 根据父机构id查询 .Where(dataScopeList.Count > 0, u => dataScopeList.Contains(u.Id)) // 非管理员范围限制 .Where(u => u.Status != CommonStatus.DELETED).OrderBy(u => u.Sort) .ToPageData(input); diff --git a/Api/Ewide.Core/Service/User/SysUserService.cs b/Api/Ewide.Core/Service/User/SysUserService.cs index 2a36cb5..ad041cd 100644 --- a/Api/Ewide.Core/Service/User/SysUserService.cs +++ b/Api/Ewide.Core/Service/User/SysUserService.cs @@ -79,8 +79,8 @@ namespace Ewide.Core.Service .Where(!string.IsNullOrEmpty(searchValue), x => (x.n.u.Account.Contains(input.SearchValue) || x.n.u.Name.Contains(input.SearchValue) || x.n.u.Phone.Contains(input.SearchValue))) - .Where(!string.IsNullOrEmpty(pid), x => (x.n.e.OrgId == pid || - x.o.Pids.Contains($"[{pid.Trim()}]"))) + .Where(!string.IsNullOrEmpty(pid), x => input.TreeNodeDataScope.GetValueOrDefault(1) == 2 ? (x.n.e.OrgId == pid || + x.o.Pids.Contains($"[{pid.Trim()}]")) : x.n.e.OrgId == pid ) .Where(input.SearchStatus >= 0, x => x.n.u.Status == input.SearchStatus) .Where(!superAdmin, x => x.n.u.AdminType != AdminType.SuperAdmin) .Where(!superAdmin && dataScopes.Count > 0, x => dataScopes.Contains(x.n.e.OrgId)) diff --git a/web-react/src/pages/system/org/index.jsx b/web-react/src/pages/system/org/index.jsx index d671ce5..76ac8f1 100644 --- a/web-react/src/pages/system/org/index.jsx +++ b/web-react/src/pages/system/org/index.jsx @@ -1,5 +1,5 @@ import React, { Component } from 'react' -import { Button, Card, Form, Input, message as Message, Popconfirm } from 'antd' +import { Button, Card, Form, Input, message as Message, Popconfirm, Select } from 'antd' import { AntIcon, Auth, @@ -159,7 +159,10 @@ export default class index extends Component { ...query, pid: this.selectId, } - + if (params) { + params.sortField = 'areaCode' + params.sortOrder = 'ascend' + } const { data } = await apiAction.page({ ...params, ...query, @@ -270,6 +273,17 @@ export default class index extends Component { + + + } operator={ diff --git a/web-react/src/pages/system/user/index.jsx b/web-react/src/pages/system/user/index.jsx index 080b4e0..fc0a0a0 100644 --- a/web-react/src/pages/system/user/index.jsx +++ b/web-react/src/pages/system/user/index.jsx @@ -322,6 +322,17 @@ export default class index extends Component { })} + + + } operator={