UPDATE 机构管理/用户管理列表页新增"只看本级"和"查看本级及以下"的过滤条件
This commit is contained in:
@@ -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<SysOrg,OrgOutput>(input);
|
||||
|
||||
@@ -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))
|
||||
|
||||
@@ -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 {
|
||||
<Form.Item label="机构名称" name="name">
|
||||
<Input autoComplete="off" placeholder="请输入机构名称" />
|
||||
</Form.Item>
|
||||
<Form.Item label="区域范围" name="treeNodeDataScope">
|
||||
<Select
|
||||
allowClear
|
||||
placeholder="请选择状态"
|
||||
className="w-200"
|
||||
defaultValue={1}
|
||||
>
|
||||
<Select.Option value={1}>只看本级</Select.Option>
|
||||
<Select.Option value={2}>查看本级及以下</Select.Option>
|
||||
</Select>
|
||||
</Form.Item>
|
||||
</Auth>
|
||||
}
|
||||
operator={
|
||||
|
||||
@@ -322,6 +322,17 @@ export default class index extends Component {
|
||||
})}
|
||||
</Select>
|
||||
</Form.Item>
|
||||
<Form.Item label="区域范围" name="treeNodeDataScope">
|
||||
<Select
|
||||
allowClear
|
||||
placeholder="请选择状态"
|
||||
className="w-200"
|
||||
defaultValue={1}
|
||||
>
|
||||
<Select.Option value={1}>只看本级</Select.Option>
|
||||
<Select.Option value={2}>查看本级及以下</Select.Option>
|
||||
</Select>
|
||||
</Form.Item>
|
||||
</Auth>
|
||||
}
|
||||
operator={
|
||||
|
||||
Reference in New Issue
Block a user