|
@ -93,23 +93,19 @@ const AlarmChart = ({ dispatch, actions, user, history, projectPoms, loading, so |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
//数据连续率 |
|
|
//数据连续率 |
|
|
const getStrucSeries = async (id) => { |
|
|
const getStrucSeries = async (id, strucId) => { |
|
|
await dispatch(control.getStrucSeries({ pepProjectId: id })).then(res => { |
|
|
await dispatch(control.getStrucSeries({ pepProjectId: id, strucId: strucId })).then(res => { |
|
|
if (res.success) { |
|
|
if (res.success) { |
|
|
let data = res.payload.data |
|
|
let data = res.payload.data?.sensor |
|
|
setSuccessionId(Number(id)) |
|
|
let struc = res.payload.data?.anxinStruc?.map(s => ({ value: s.strucId, label: s?.strucName })) |
|
|
let struc = [] |
|
|
if (!strucId) { |
|
|
data?.forEach(f => { |
|
|
setSuccessionId(Number(id)) |
|
|
if (!struc?.find(h => h.value == f.structure)) { |
|
|
setSeriesStruc(struc) |
|
|
struc.push({ value: f.structure, label: f?.struc?.strucName }) |
|
|
setSeriesValue(struc[0]?.value) |
|
|
} |
|
|
} |
|
|
}) |
|
|
setSeries(data?.slice(0, 10) || []) |
|
|
setSeriesStruc(struc) |
|
|
setSensorList(data?.map(v => ({ value: v.id, label: v.name })) || []) |
|
|
setSeriesValue(struc[0]?.value) |
|
|
setSensorValue(data?.map(v => v.id)?.slice(0, 10) || []) |
|
|
let findStruc = data?.filter(d => d.structure == struc[0]?.value) |
|
|
|
|
|
setSeries(findStruc?.slice(0, 10) || []) |
|
|
|
|
|
setSensorList(findStruc?.map(v => ({ value: v.id, label: v.name })) || []) |
|
|
|
|
|
setSensorValue(findStruc?.map(v => v.id)?.slice(0, 10) || []) |
|
|
|
|
|
} |
|
|
} |
|
|
}) |
|
|
}) |
|
|
} |
|
|
} |
|
@ -645,7 +641,7 @@ const AlarmChart = ({ dispatch, actions, user, history, projectPoms, loading, so |
|
|
optionList={onlineStruc} |
|
|
optionList={onlineStruc} |
|
|
onChange={v => { |
|
|
onChange={v => { |
|
|
setValue(v) |
|
|
setValue(v) |
|
|
setOnline(statisticOnline?.filter(s => s.structure == v)) |
|
|
setOnline(statisticOnline?.filter(s => !v.length > 0 || v.includes(s.strucId))) |
|
|
}} |
|
|
}} |
|
|
/> |
|
|
/> |
|
|
|
|
|
|
|
@ -656,8 +652,8 @@ const AlarmChart = ({ dispatch, actions, user, history, projectPoms, loading, so |
|
|
text: '数据在线率', |
|
|
text: '数据在线率', |
|
|
}, |
|
|
}, |
|
|
grid: { |
|
|
grid: { |
|
|
left: 27, |
|
|
left: 30, |
|
|
right: 10, |
|
|
right: 30, |
|
|
bottom: 20, |
|
|
bottom: 20, |
|
|
}, |
|
|
}, |
|
|
tooltip: { |
|
|
tooltip: { |
|
@ -718,12 +714,9 @@ const AlarmChart = ({ dispatch, actions, user, history, projectPoms, loading, so |
|
|
maxTagCount={1} |
|
|
maxTagCount={1} |
|
|
style={{ width: 160, marginRight: 10 }} |
|
|
style={{ width: 160, marginRight: 10 }} |
|
|
optionList={seriesStruc} |
|
|
optionList={seriesStruc} |
|
|
onChange={v => { |
|
|
onChange={async v => { |
|
|
setSeriesValue(v) |
|
|
setSeriesValue(v) |
|
|
let data = strucSeries?.filter(s => v == s.structure) |
|
|
await getStrucSeries(successionId, v) |
|
|
setSeries(data?.slice(0, 10) || []) |
|
|
|
|
|
setSensorList(data?.map(v => ({ value: v.id, label: v.name })) || []) |
|
|
|
|
|
setSensorValue(data?.slice(0, 10)?.map(d => d.id) || []) |
|
|
|
|
|
}} |
|
|
}} |
|
|
/> |
|
|
/> |
|
|
<Select showClear |
|
|
<Select showClear |
|
@ -736,7 +729,7 @@ const AlarmChart = ({ dispatch, actions, user, history, projectPoms, loading, so |
|
|
optionList={sensorList} |
|
|
optionList={sensorList} |
|
|
onChange={v => { |
|
|
onChange={v => { |
|
|
setSensorValue(v) |
|
|
setSensorValue(v) |
|
|
let data = strucSeries?.filter(s => (!v.length > 0 || v.includes(s.id)) && seriesValue == s.structure) |
|
|
let data = strucSeries?.sensor?.filter(s => (!v.length > 0 || v.includes(s.id)) && seriesValue == s.structure) |
|
|
setSeries(data || []) |
|
|
setSeries(data || []) |
|
|
}} |
|
|
}} |
|
|
/> |
|
|
/> |
|
@ -748,8 +741,8 @@ const AlarmChart = ({ dispatch, actions, user, history, projectPoms, loading, so |
|
|
text: '数据连续率', |
|
|
text: '数据连续率', |
|
|
}, |
|
|
}, |
|
|
grid: { |
|
|
grid: { |
|
|
left: 27, |
|
|
left: 30, |
|
|
right: 10, |
|
|
right: 30, |
|
|
bottom: 20, |
|
|
bottom: 20, |
|
|
}, |
|
|
}, |
|
|
tooltip: { |
|
|
tooltip: { |