wenlele 2 years ago
parent
commit
58945fd6cf
  1. 6
      api/.vscode/settings.json
  2. 4
      api/app/lib/controllers/alarm/data.js
  3. 5
      api/app/lib/controllers/alarm/video.js
  4. 25
      api/app/lib/controllers/project/index.js
  5. 15
      web/client/src/sections/install/components/memberModal.jsx
  6. 16
      web/client/src/sections/install/containers/system.jsx

6
api/.vscode/settings.json

@ -0,0 +1,6 @@
//
{
"editor.fontSize": 16,
"eslint.format.enable": true,
"editor.tabSize": 3,
}

4
api/app/lib/controllers/alarm/data.js

@ -12,7 +12,7 @@ async function groupList (ctx) {
for (let g of groupRes) { for (let g of groupRes) {
g.unit = await await clickHouse.anxinyun.query(` g.unit = await await clickHouse.anxinyun.query(`
SELECT * FROM t_alarm_group_unit WHERE group_id = ${g.id} SELECT * FROM t_alarm_group_unit WHERE group_id = ${g.id}
`).toPromise(); `).toPromise();
} }
@ -84,7 +84,7 @@ async function list (ctx) {
whereOption.push(`DeviceStatus.Status = ${0}`) whereOption.push(`DeviceStatus.Status = ${0}`)
} }
} }
let alarmQueryOptionStr = ` let alarmQueryOptionStr = `
FROM FROM
alarms alarms

5
api/app/lib/controllers/alarm/video.js

@ -27,7 +27,7 @@ async function alarmList (ctx) {
const { clickHouse } = ctx.app.fs const { clickHouse } = ctx.app.fs
const { utils: { judgeSuper, anxinStrucIdRange } } = ctx.app.fs const { utils: { judgeSuper, anxinStrucIdRange } } = ctx.app.fs
const { database: anxinyun } = clickHouse.anxinyun.opts.config const { database: anxinyun } = clickHouse.anxinyun.opts.config
const { pepProjectId, keywordTarget, keyword, state, kindId, sustainTimeStart, sustainTimeEnd, limit, page, } = ctx.query const { pepProjectId, keywordTarget, keyword, state, kindId, sustainTimeStart, sustainTimeEnd, limit, page, statusId} = ctx.query
let anxinStruc = await anxinStrucIdRange({ let anxinStruc = await anxinStrucIdRange({
ctx, pepProjectId, keywordTarget, keyword ctx, pepProjectId, keywordTarget, keyword
@ -71,6 +71,9 @@ async function alarmList (ctx) {
) )
`) `)
} }
if(statusId){
statusAlarmWhereOption.push(`camera_status_alarm.status_id = ${statusId}`)
}
const queryStr = ` const queryStr = `
SELECT SELECT

25
api/app/lib/controllers/project/index.js

@ -52,16 +52,39 @@ async function pomsProject (ctx) {
let pepProjectIds = new Set() let pepProjectIds = new Set()
let anxinProjectIds = new Set() let anxinProjectIds = new Set()
let createUsers = new Set()
for (let p of proRes.rows) { for (let p of proRes.rows) {
if (p.pepProjectId) { if (p.pepProjectId) {
pepProjectIds.add(p.pepProjectId) pepProjectIds.add(p.pepProjectId)
} }
if(p.createUser){
createUsers.add(p.createUser)
}
for (let ap of p.anxinProjectId) { for (let ap of p.anxinProjectId) {
if (ap) { if (ap) {
anxinProjectIds.add(ap) anxinProjectIds.add(ap)
} }
} }
} }
const pomsUser = await models.User.findAll({
where: {
id: { $in: [...createUsers]}
}
})
let pepUserIds = new Set()
for (let p of pomsUser) {
if (p.pepUserId) {
pepUserIds.add(p.pepUserId)
}
}
const pepcaUser = pepUserIds.size ?
await clickHouse.pepEmis.query(
`
SELECT * FROM user
WHERE id IN (${[...pepUserIds].join(',')}, -1)
`
).toPromise() :
[]
const pepProjectRes = pepProjectIds.size ? const pepProjectRes = pepProjectIds.size ?
await clickHouse.projectManage.query( await clickHouse.projectManage.query(
` `
@ -89,6 +112,7 @@ async function pomsProject (ctx) {
for (let p of proRes.rows) { for (let p of proRes.rows) {
const corPro = pepProjectRes.find(pp => pp.id == p.pepProjectId) || {} const corPro = pepProjectRes.find(pp => pp.id == p.pepProjectId) || {}
const pepUserName = (pepcaUser.find(qq => qq.id == (pomsUser.find(oo => oo.id == p.createUser)||{}).pepUserId)||{}).name ||''
p.dataValues.pepProjectName = corPro.project_name p.dataValues.pepProjectName = corPro.project_name
p.dataValues.pepProjectIsDelete = corPro.isdelete p.dataValues.pepProjectIsDelete = corPro.isdelete
p.dataValues.constructionStatusId = corPro.construction_status_id p.dataValues.constructionStatusId = corPro.construction_status_id
@ -96,6 +120,7 @@ async function pomsProject (ctx) {
let nextAnxinProject = anxinProjectRes.filter(ap => p.anxinProjectId.includes(ap.id)) let nextAnxinProject = anxinProjectRes.filter(ap => p.anxinProjectId.includes(ap.id))
p.dataValues.anxinProject = nextAnxinProject p.dataValues.anxinProject = nextAnxinProject
p.dataValues.pepUserName = pepUserName
delete p.dataValues.anxinProjectId delete p.dataValues.anxinProjectId
} }
ctx.status = 200; ctx.status = 200;

15
web/client/src/sections/install/components/memberModal.jsx

@ -1,6 +1,6 @@
import React, { useState, useRef, useEffect } from "react"; import React, { useState, useRef, useEffect } from "react";
import { connect } from "react-redux"; import { connect } from "react-redux";
import { Modal, Form, CheckboxGroup, Checkbox } from "@douyinfe/semi-ui"; import { Modal, Form, CheckboxGroup, Checkbox,Button } from "@douyinfe/semi-ui";
import { IconAlertCircle } from '@douyinfe/semi-icons'; import { IconAlertCircle } from '@douyinfe/semi-icons';
@ -42,6 +42,7 @@ function memberModal (props) {
text: '拥有服务、工单、资料相关的权限' text: '拥有服务、工单、资料相关的权限'
}, },
]); // ]); //
const [pomsList_, setPomsList_] = useState([])
// //
useEffect(() => { useEffect(() => {
if (editObj.id) { if (editObj.id) {
@ -54,6 +55,7 @@ function memberModal (props) {
setDepartmentId(editObj.departments[0].id) setDepartmentId(editObj.departments[0].id)
setPeopleList(departmentList) setPeopleList(departmentList)
} }
setPomsList_(pomsList.filter(p=>p.pepProjectIsDelete != -1))
}, []); }, []);
function handleOk () { function handleOk () {
@ -212,15 +214,20 @@ function memberModal (props) {
style={{ width: 417 }} style={{ width: 417 }}
filter filter
showClear showClear
outerBottomSlot={
<p style={{ margin:"6px 26px",}}>
<Button theme='borderless' onClick={()=>{
form.current.setValue('correlationProject',pomsList_.map(p=> p.id))
}}>全选</Button>
</p>
}
> >
{ {
pomsList.map((item, index) => { pomsList_.map((item, index) => {
return ( return (
item.pepProjectIsDelete !== 1 ? (
<Form.Select.Option key={index} value={item.id}> <Form.Select.Option key={index} value={item.id}>
{item.pepProjectName || item.name} {item.pepProjectName || item.name}
</Form.Select.Option> </Form.Select.Option>
) : ('')
) )
}) })
} }

16
web/client/src/sections/install/containers/system.jsx

@ -231,6 +231,22 @@ const Example = (props) => {
return moment(row.createTime).format("YYYY-MM-DD HH:mm:ss"); return moment(row.createTime).format("YYYY-MM-DD HH:mm:ss");
} }
}, },
{
title: '修改时间',
dataIndex: "updateTime",
key: 'updateTime',
render: (_, row) => {
return moment(row.updateTime).format("YYYY-MM-DD HH:mm:ss");
}
},
{
title: '添加人员',
dataIndex: "pepUserName",
key: 'pepUserName',
render: (_, row) => {
return row.pepUserName
}
},
{ {
title: "管理", title: "管理",
width: "20%", width: "20%",

Loading…
Cancel
Save