Browse Source

最新动态

dev
wenlele 2 years ago
parent
commit
2ab50e0b68
  1. 218
      web/client/src/components/setup.jsx
  2. 24
      web/client/src/sections/control/actions/control.js
  3. 908
      web/client/src/sections/control/containers/control.jsx
  4. 4
      web/client/src/utils/webapi.js

218
web/client/src/components/setup.jsx

@ -1,122 +1,124 @@
import React, { useState, useEffect } from "react";
import {
Modal,
CheckboxGroup,
Checkbox,
Modal,
CheckboxGroup,
Checkbox,
} from "@douyinfe/semi-ui";
function Setup(props) {
const {
close,
tableType,
tableList
} = props;
function Setup (props) {
const {
close,
tableType,
tableList,
layout, //
} = props;
const [check, setCheck] = useState([]);
const checkboxcss = { width: "25%", height: 16, margin: "0 0 20px 0" };
const [check, setCheck] = useState([]);
useEffect(() => {
//
const checkItem = localStorage.getItem(tableType);
setCheck(checkItem?JSON.parse(checkItem) : [])
ischeck();
}, []);
function ischeck(value) {
if (check.length >= 8) {
if (check.includes(value)) {
return false;
} else {
return true;
const checkboxcss = { width: "25%", height: 16, margin: "0 0 20px 0" };
useEffect(() => {
//
const checkItem = localStorage.getItem(tableType);
setCheck(checkItem ? JSON.parse(checkItem) : [])
ischeck();
}, []);
function ischeck (value) {
if (check.length >= 8) {
if (check.includes(value)) {
return false;
} else {
return true;
}
}
}
}
}
return (
<Modal
title={
<div>
表格属性设置
<span
style={{
width: 50,
lineHeight: "19px",
display: "inline-block",
return (
<Modal
title={
<div>
表格属性设置
<span
style={{
width: 50,
lineHeight: "19px",
display: "inline-block",
color: "white",
textAlign: "center",
marginLeft: 6,
background:
check.length == 8
? "rgba(40, 123, 255, 1)"
: "rgba(176, 176, 176, 1)",
}}
>
{check.length}/8
</span>
</div>
}
visible={true}
style={{ width: 600 }}
onOk={() => {
localStorage.setItem(tableType, JSON.stringify(check));
close();
}}
onCancel={() => {
close();
}}
>
<CheckboxGroup
style={{ width: "100%", fontSize: 14 }}
key="primary1"
direction="horizontal"
defaultValue={check}
aria-label="表格属性设置"
onChange={(check) => {
setCheck(check);
ischeck();
}}
color: "white",
textAlign: "center",
marginLeft: 6,
background:
check.length == 8
? "rgba(40, 123, 255, 1)"
: "rgba(176, 176, 176, 1)",
}}
>
{check.length}/8
</span>
</div>
}
visible={true}
style={{ width: 600 }}
onOk={() => {
localStorage.setItem(tableType, JSON.stringify(check));
close();
}}
onCancel={() => {
close();
}}
>
{tableList.map((item,index)=>{
return(
<div
key={index}
style={{
width: 550,
border: "1px solid #EAEAEA",
padding: "0px 5px",
borderRadius: 4,
marginBottom: "20px",
<CheckboxGroup
style={{ width: "100%", fontSize: 14 }}
key="primary1"
direction="horizontal"
defaultValue={check}
aria-label="表格属性设置"
onChange={(check) => {
setCheck(check);
ischeck();
}}
>
<div
style={{
borderBottom: "1px solid #EAEAEA",
marginLeft: "10px",
padding: "8px 0px",
}}
>
{item.title}
</div>
<div style={{ padding: "15px 12px", width: 530 }}>
{item.list?.map((itm) => {
return (
<Checkbox
key={itm.value}
value={itm.value}
style={checkboxcss}
disabled={ischeck(itm.value)}
>
{itm.name}
</Checkbox>
);
})}
</div>
</div>
)})}
</CheckboxGroup>
</Modal>
);
>
{tableList.map((item, index) => {
return (
<div
key={index}
style={{
width: 550,
border: "1px solid #EAEAEA",
padding: "0px 5px",
borderRadius: 4,
marginBottom: "20px",
}}
>
<div
style={{
borderBottom: "1px solid #EAEAEA",
marginLeft: "10px",
padding: "8px 0px",
}}
>
{item.title}
</div>
<div style={{ padding: "15px 12px", width: 530, display: layout == 'long' ? 'flex' : "", flexDirection: layout == 'long' ? 'column' : "" }}>
{item.list?.map((itm) => {
return (
<Checkbox
key={itm.value}
value={itm.value}
style={layout == 'long' ? {} : checkboxcss}
disabled={ischeck(itm.value) || ['workbench', 'dynamic', 'handle', 'DeviceAccess','discovery'].includes(itm.value)}
>
{itm.name}
</Checkbox>
);
})}
</div>
</div>
)
})}
</CheckboxGroup>
</Modal>
);
}
export default Setup;

24
web/client/src/sections/control/actions/control.js

@ -105,4 +105,28 @@ export function getAppAlarmsAggDay (query) { //查询BI分析数据-应用
msg: { option: '查询BI分析应用数据' },
reducer: { name: '' }
});
}
export function getAlarmsHandleStatistics (query) { //查询BI分析数据-问题处理效率分析
return dispatch => basicAction({
type: 'get',
dispatch: dispatch,
query,
actionType: 'GET_ALARMS_HANDLE_STATISTICS',
url: `${ApiTable.getAlarmsHandleStatistics}`,
msg: { option: '查询BI问题处理效率分析' },
reducer: { name: '' }
});
}
export function getLatestDynamic (query) { //查询最新动态
return dispatch => basicAction({
type: 'get',
dispatch: dispatch,
query,
actionType: 'GET_LATEST_DYNAMIC',
url: `${ApiTable.getLatestDynamic}`,
msg: { option: '查询最新动态' },
reducer: { name: '' }
});
}

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

File diff suppressed because it is too large

4
web/client/src/utils/webapi.js

@ -65,6 +65,10 @@ export const ApiTable = {
getDataAlarmsAggDay: 'data/alarms/agg/day', //查询BI分析数据-数据
getVideoAlarmsAggDay: 'video/alarms/agg/day', //查询BI分析数据-视频异常
getAppAlarmsAggDay: 'app/alarms/agg/day', //查询BI分析数据-应用
getAlarmsHandleStatistics: '/alarms/handle/statistics', //查询BI分析数据-问题处理效率分析
getLatestDynamic: '/latest/dynamic', // 查询最新动态
};
export const RouteTable = {
apiRoot: "/api/root",

Loading…
Cancel
Save