Commit 053b5dfd authored by 李纪文's avatar 李纪文

fix: 组态增加当前设备视频查看

parent 0e86d7ff
...@@ -1410,7 +1410,6 @@ const ConfigurationView = (props) => { ...@@ -1410,7 +1410,6 @@ const ConfigurationView = (props) => {
// 画板跳转 // 画板跳转
switch (data.opType) { switch (data.opType) {
case '画板跳转': // 图片模型 case '画板跳转': // 图片模型
drawBoardMethod(data);
break; break;
case '功能跳转': // 功能模型 case '功能跳转': // 功能模型
menuJumpMethod(data); menuJumpMethod(data);
...@@ -1711,7 +1710,6 @@ const ConfigurationView = (props) => { ...@@ -1711,7 +1710,6 @@ const ConfigurationView = (props) => {
menuJumpMethod(data); menuJumpMethod(data);
break; break;
case '视频查看': // 视频查看 case '视频查看': // 视频查看
videoScanMethod(data);
break; break;
case '自定义交互': // 自定义交互 case '自定义交互': // 自定义交互
customBack(data); customBack(data);
......
...@@ -121,7 +121,9 @@ const ConfigurationView = (props) => { ...@@ -121,7 +121,9 @@ const ConfigurationView = (props) => {
screenshot: false, screenshot: false,
}, },
loadingText: '视频加载中', loadingText: '视频加载中',
decoder: widgets ? `/${widgets.product}/JessibucaVideo/decoder.js` : '/JessibucaVideo/decoder.js', decoder: widgets
? `/${widgets.product}/JessibucaVideo/decoder.js`
: '/JessibucaVideo/decoder.js',
}; };
/** **********************************获取工艺图画板信息*********************** */ /** **********************************获取工艺图画板信息*********************** */
...@@ -903,7 +905,7 @@ const ConfigurationView = (props) => { ...@@ -903,7 +905,7 @@ const ConfigurationView = (props) => {
loginauthen(); loginauthen();
loginTimer.current = setInterval(() => { loginTimer.current = setInterval(() => {
loginauthen(); loginauthen();
}, 1000 * 28800 ); }, 1000 * 28800);
return () => { return () => {
clearInterval(loginTimer.current); clearInterval(loginTimer.current);
loginTimer.current = null; loginTimer.current = null;
...@@ -945,7 +947,7 @@ const ConfigurationView = (props) => { ...@@ -945,7 +947,7 @@ const ConfigurationView = (props) => {
controlback: controlData, controlback: controlData,
}) })
: null; : null;
const diagramJson = typeof fromJson === 'string' ? fromJson : JSON.stringify(fromJson); const diagramJson = typeof fromJson === 'string' ? fromJson : JSON.stringify(fromJson);
diagramRender(diagramJson, list); diagramRender(diagramJson, list);
setNoInitial(false); setNoInitial(false);
try { try {
...@@ -953,7 +955,7 @@ const ConfigurationView = (props) => { ...@@ -953,7 +955,7 @@ const ConfigurationView = (props) => {
const nodeDataArray = JSON.parse(diagramJson)?.nodeDataArray || []; const nodeDataArray = JSON.parse(diagramJson)?.nodeDataArray || [];
nodeDataArray.forEach((item) => { nodeDataArray.forEach((item) => {
if (item.category === 'bgCase') dataSources = item.dataSources || 'MQTT'; if (item.category === 'bgCase') dataSources = item.dataSources || 'MQTT';
}) });
if (dataSources === 'MQTT') { if (dataSources === 'MQTT') {
mqttView && mqttView.saveWaterMqtt(); mqttView && mqttView.saveWaterMqtt();
} else { } else {
...@@ -1471,8 +1473,12 @@ const ConfigurationView = (props) => { ...@@ -1471,8 +1473,12 @@ const ConfigurationView = (props) => {
const videoScanMethod = async (data) => { const videoScanMethod = async (data) => {
try { try {
const opRule = JSON.parse(data.opRule); const opRule = JSON.parse(data.opRule);
const { vdCode, vdList, vdName } = opRule; const bindList = bindData.find((item) => {
if (!vdCode || !vdList) return setVideoData([]); return item.name === data.stationName;
});
const { vdCode = bindList.code, vdList = '', vdName = '', vdType = '' } = opRule;
if (!vdCode) return setVideoData([]);
if (vdType && !vdList) return setVideoData([]);
const detail = await getVideoDetail({ const detail = await getVideoDetail({
UserID: 1, UserID: 1,
DeviceCode: vdCode, DeviceCode: vdCode,
...@@ -1482,14 +1488,30 @@ const ConfigurationView = (props) => { ...@@ -1482,14 +1488,30 @@ const ConfigurationView = (props) => {
: '', : '',
}); });
const dataList = detail?.data; const dataList = detail?.data;
const videoList = vdList.split(',');
if (!dataList) return setVideoData([]); if (!dataList) return setVideoData([]);
const detailList = []; const detailList = [];
videoList.forEach((item, index) => { if (vdType) {
const list = dataList.find((obj) => { const videoList = vdList.split(',');
return item === obj.vmS_DeviceID; videoList.forEach((item, index) => {
const list = dataList.find((obj) => {
return item === obj.vmS_DeviceID;
});
if (list)
detailList.push({
id: list.vmS_DeviceID,
name: list.channelName,
protocol: list.protocol,
username: list.username,
password: list.password,
dataRate: 'Sub',
pandavmsHost: getVideoUrl(),
gateway: true,
address: list.address,
channel: list.channelID * 1,
});
}); });
if (list) } else {
dataList.forEach((list) => {
detailList.push({ detailList.push({
id: list.vmS_DeviceID, id: list.vmS_DeviceID,
name: list.channelName, name: list.channelName,
...@@ -1502,7 +1524,8 @@ const ConfigurationView = (props) => { ...@@ -1502,7 +1524,8 @@ const ConfigurationView = (props) => {
address: list.address, address: list.address,
channel: list.channelID * 1, channel: list.channelID * 1,
}); });
}); });
}
setVideoTitle(vdName + '视频查看'); setVideoTitle(vdName + '视频查看');
setVideoData(detailList); setVideoData(detailList);
detailList.length && setIsVideoVisible(true); detailList.length && setIsVideoVisible(true);
...@@ -3173,7 +3196,10 @@ const ConfigurationView = (props) => { ...@@ -3173,7 +3196,10 @@ const ConfigurationView = (props) => {
// title={historyInfoParams.length ? historyInfoParams[0].sensors || '' : ''} // title={historyInfoParams.length ? historyInfoParams[0].sensors || '' : ''}
wrapClassName={classNames(`${prefixCls}-historyInfoModal`)} wrapClassName={classNames(`${prefixCls}-historyInfoModal`)}
> >
<HistoryView deviceParams={historyInfoParams} title={historyInfoParams.length ? historyInfoParams[0].sensors || '' : ''} /> <HistoryView
deviceParams={historyInfoParams}
title={historyInfoParams.length ? historyInfoParams[0].sensors || '' : ''}
/>
</Modal> </Modal>
)} )}
{/* 统计历史曲线 */} {/* 统计历史曲线 */}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment