Browse Source

feat:大屏在建项目数字改动+一般管理不能删除部门

dev
zhaobing 2 years ago
parent
commit
31b4d943bb
  1. 8
      api/app/lib/controllers/overview/building.js
  2. 6
      web/client/src/sections/organization/containers/user.js
  3. 4
      web/client/src/sections/quanju/containers/footer/build/index.js

8
api/app/lib/controllers/overview/building.js

@ -36,6 +36,10 @@ async function roadState(ctx) {
const projectRoadRes = await models.Project.findAll({
type: 'road',
})
//在建工程
const buildingCount = await models.Project.count({
where: { done: true }
})
const bridgeRes = await models.Bridge.findAll({})
let constructionYear = []
@ -45,8 +49,8 @@ async function roadState(ctx) {
constructionYear.reverse()
const roadState = {
//总数
projectAll: projectRoadRes.length,
//在建总数
buildingCount: buildingCount,
// 在建数量
buildingRoad: 0,
// 已建数量

6
web/client/src/sections/organization/containers/user.js

@ -25,7 +25,7 @@ const UserManage = (props) => {
const [depModalRecord, setDepModalRecord] = useState();
const [selectedTree, setSelectedTree] = useState();
const [depCrumbs, setDepCrumbs] = useState([]);
const [depUserCopy, setDepUserCopy] = useState([])//用于存放除了自己的管理的数组,即自己不能调整自己是否为管理员
const [depUserCopy, setDepUserCopy] = useState([])
const [uid, setuid] = useState()
const [editAble, setEditAble] = useState(user?.username !== 'SuperAdmin' && user?.userResources?.find(i => i.resourceId === 'USERMANAGE')?.isshow === "true" ? true : '')//控制操作(新增删除等操作,对应权限的'不可编辑')是否可操作
const [depMessagedata, setdepMessagedata] = useState(depMessage)
@ -274,9 +274,9 @@ const UserManage = (props) => {
setDepModalVisible(true)
setDepModalType('edit')
}} />
<Popconfirm title='是否确认删除?' onConfirm={() => { delDepartment(id) }}>
{user?.username === 'SuperAdmin' ? <Popconfirm title='是否确认删除?' onConfirm={() => { delDepartment(id) }} >
<DeleteOutlined style={{ marginLeft: 5 }} />
</Popconfirm>
</Popconfirm> : ''}
</> : null
}
</div>

4
web/client/src/sections/quanju/containers/footer/build/index.js

@ -97,7 +97,7 @@ const Build = (props) => {
})
//console.log('onlineproject', onlineproject)
let sunonlineproject = onlineproject?.reduce((x, y) => x + y.total, 0)
let projectAll = buildingnumber?.projectAll
let buildingCount = buildingnumber?.buildingCount
//console.log('projectAll', projectAll)
//let projectAll=
let safetyData = alldengji?.filter(item => item.name === '一级公路' || item.name === '二级公路' || item.name === '三级公路' || item.name === '四级公路' || item.name === '等外公路')
@ -164,7 +164,7 @@ const Build = (props) => {
</div> */}
<img src='/assets/images/quanju/yuanhuan.webp' className='build-left-top-center' />
<div className='build-left-top-item'>
<div>{projectAll || 0}</div>
<div>{buildingCount || 0}</div>
<div>
{/* <i>&#9658;</i> */}
{/* <span /> */}

Loading…
Cancel
Save