Browse Source

类型添加完成

dev
wenlele 2 years ago
parent
commit
aac030adae
  1. 33
      web/client/src/sections/control/containers/control.jsx
  2. 9
      web/client/src/sections/install/components/systemModal.jsx
  3. 9
      web/client/src/sections/install/containers/system.jsx
  4. 8
      web/client/src/sections/problem/components/sideSheet.jsx

33
web/client/src/sections/control/containers/control.jsx

@ -155,13 +155,7 @@ const Control = ({ dispatch, actions, user, history, loading, socket, pepProject
}) })
} else { } else {
if (ProblemAlarm?.length > 0) { if (ProblemAlarm?.length > 0) {
ProblemAlarm.sort((a, b) => { ProblemAlarm.sort((a, b) => (moment(a.StartTime).isBefore(b.StartTime) ? 1 : -1))
if (moment(a.StartTime).isBefore(b.StartTime)) {
return 1
} else {
return -1
}
})
setProblemsList([...ProblemAlarm, ...problemsList]) setProblemsList([...ProblemAlarm, ...problemsList])
} }
} }
@ -187,19 +181,12 @@ const Control = ({ dispatch, actions, user, history, loading, socket, pepProject
} }
}) })
} }
newest.sort((a, b) => { newest.sort((a, b) => (moment(a.time).isBefore(b.time) ? 1 : -1))
if (moment(a.time).isBefore(b.time)) {
return 1
} else {
return -1
}
})
querydata.current = [...newest, ...querydata.current] querydata.current = [...newest, ...querydata.current]
setQueryData1([...querydata.current]) setQueryData1([...querydata.current])
} }
}, [socketData]) }, [socketData])
console.log(querydata.current);
useEffect(() => { useEffect(() => {
consoleToollink() consoleToollink()
@ -423,13 +410,7 @@ const Control = ({ dispatch, actions, user, history, loading, socket, pepProject
id: v.id, id: v.id,
})) }))
} }
data.sort((a, b) => { data.sort((a, b) => (moment(a.time).isBefore(b.time) ? 1 : -1))
if (moment(a.time).isBefore(b.time)) {
return 1
} else {
return -1
}
})
// console.log(data) // console.log(data)
querydata.current = data querydata.current = data
setQueryData1(data) setQueryData1(data)
@ -505,13 +486,7 @@ const Control = ({ dispatch, actions, user, history, loading, socket, pepProject
id: v.id, id: v.id,
})) }))
} }
data.sort((a, b) => { data.sort((a, b) => (moment(a.time).isBefore(b.time) ? 1 : -1))
if (moment(a.time).isBefore(b.time)) {
return 1
} else {
return -1
}
})
querydata.current = data querydata.current = data
setQueryData1(data) setQueryData1(data)
} }

9
web/client/src/sections/install/components/systemModal.jsx

@ -20,7 +20,8 @@ function adminModal (props) {
anxincloudArr,// anxincloudArr,//
anxinDelete,//, anxinDelete,//,
appArr,// appArr,//
bindId bindId,
mapping //
} = props; } = props;
const { install } = actions; const { install } = actions;
const form = useRef();// const form = useRef();//
@ -236,15 +237,13 @@ function adminModal (props) {
} }
</Form.Select> </Form.Select>
<Form.Select <Form.Select
label="添加映射分类:" label="映射分类:"
field="mappingClass" field="mappingClass"
multiple
filter filter
placeholder="请选择映射类型" placeholder="请选择映射类型"
style={{ width: 425 }} style={{ width: 425 }}
initValue={appArr || []} initValue={mapping}
showClear showClear
renderSelectedItem={renderMultipleWithCustomTag}
> >
{ {
[ [

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

@ -27,6 +27,7 @@ const Example = (props) => {
const [bindId, setBindId] = useState() //id const [bindId, setBindId] = useState() //id
const [tableKey, setTableKey] = useState([]) //id const [tableKey, setTableKey] = useState([]) //id
const page = useRef(query.page);// const page = useRef(query.page);//
const [mapping, setMapping] = useState() //
@ -228,7 +229,7 @@ const Example = (props) => {
dataIndex: "createTime", dataIndex: "createTime",
key: 'time', key: 'time',
render: (_, row) => { render: (_, row) => {
return moment(row.createTime).format("YYYY-MM-DD HH:mm:ss"); return moment(row.createTime).format("YYYY-MM-DD HH:mm:ss")
} }
}, },
{ {
@ -236,7 +237,7 @@ const Example = (props) => {
dataIndex: "updateTime", dataIndex: "updateTime",
key: 'updateTime', key: 'updateTime',
render: (_, row) => { render: (_, row) => {
return moment(row.updateTime).format("YYYY-MM-DD HH:mm:ss"); return moment(row.updateTime).format("YYYY-MM-DD HH:mm:ss")
} }
}, },
{ {
@ -284,9 +285,11 @@ const Example = (props) => {
delete myarrarrList[j].projectApp delete myarrarrList[j].projectApp
myapparr.push(JSON.stringify(myarrarrList[j])) myapparr.push(JSON.stringify(myarrarrList[j]))
} }
setAppArr(myapparr) setAppArr(myapparr)
setAnxincloudArr(myanxinArr) setAnxincloudArr(myanxinArr)
setBindId(row.id) setBindId(row.id)
setMapping(row?.mappingClass)
setSystemEdit(true) setSystemEdit(true)
}} }}
> >
@ -355,6 +358,7 @@ const Example = (props) => {
setAppArr([]) setAppArr([])
setAnxincloudArr() setAnxincloudArr()
setBindId() setBindId()
setMapping('')
}} }}
> >
添加映射关系 添加映射关系
@ -450,6 +454,7 @@ const Example = (props) => {
anxincloudArr={anxincloudArr} anxincloudArr={anxincloudArr}
pepProjectId={pepProjectId} pepProjectId={pepProjectId}
anxinDelete={anxinDelete} anxinDelete={anxinDelete}
mapping={mapping}
appArr={appArr} appArr={appArr}
bindId={bindId} bindId={bindId}
cancel={() => { cancel={() => {

8
web/client/src/sections/problem/components/sideSheet.jsx

@ -32,13 +32,7 @@ function SideSheets ({ dispatch, actions, close, alarmId }) {
dispatch(problem.getAlarmDataDetailAgg({ alarmId: alarmId })).then((res) => { dispatch(problem.getAlarmDataDetailAgg({ alarmId: alarmId })).then((res) => {
if (res?.success) { if (res?.success) {
let dataSort = res.payload.data || [] let dataSort = res.payload.data || []
dataSort.sort((a, b) => { dataSort.sort((a, b) => (moment(a.hours).isBefore(b.hours) ? -1 : 1))
if (moment(a.hours).isBefore(b.hours)) {
return -1
} else {
return 1
}
})
let data = { let data = {
grid: { grid: {
left: '5%', left: '5%',

Loading…
Cancel
Save