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

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

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

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

@ -27,6 +27,7 @@ const Example = (props) => {
const [bindId, setBindId] = useState() //id
const [tableKey, setTableKey] = useState([]) //id
const page = useRef(query.page);//
const [mapping, setMapping] = useState() //
@ -46,7 +47,7 @@ const Example = (props) => {
const [tableData, setTableData] = useState([]) //
const getPepProject = ()=>{
const getPepProject = () => {
dispatch(install.getProjectPmanage(query)).then((res) => {//PEP
setPeplist(res.payload.data)
})
@ -60,7 +61,7 @@ const Example = (props) => {
dispatch(install.getProjectAppList(query)).then((res) => {//
setAppList(res.payload.data)
})
console.log('user',user);
console.log('user', user);
}, [])
useEffect(() => {
getProjectPomsList();
@ -228,7 +229,7 @@ const Example = (props) => {
dataIndex: "createTime",
key: 'time',
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",
key: 'updateTime',
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
myapparr.push(JSON.stringify(myarrarrList[j]))
}
setAppArr(myapparr)
setAnxincloudArr(myanxinArr)
setBindId(row.id)
setMapping(row?.mappingClass)
setSystemEdit(true)
}}
>
@ -310,7 +313,7 @@ const Example = (props) => {
>
<Button theme="borderless">删除</Button>
</Popconfirm>
</div>
</div >
);
},
},
@ -355,6 +358,7 @@ const Example = (props) => {
setAppArr([])
setAnxincloudArr()
setBindId()
setMapping('')
}}
>
添加映射关系
@ -450,6 +454,7 @@ const Example = (props) => {
anxincloudArr={anxincloudArr}
pepProjectId={pepProjectId}
anxinDelete={anxinDelete}
mapping={mapping}
appArr={appArr}
bindId={bindId}
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) => {
if (res?.success) {
let dataSort = res.payload.data || []
dataSort.sort((a, b) => {
if (moment(a.hours).isBefore(b.hours)) {
return -1
} else {
return 1
}
})
dataSort.sort((a, b) => (moment(a.hours).isBefore(b.hours) ? -1 : 1))
let data = {
grid: {
left: '5%',

Loading…
Cancel
Save