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

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

parent 0e86d7ff
......@@ -1410,7 +1410,6 @@ const ConfigurationView = (props) => {
// 画板跳转
switch (data.opType) {
case '画板跳转': // 图片模型
drawBoardMethod(data);
break;
case '功能跳转': // 功能模型
menuJumpMethod(data);
......@@ -1711,7 +1710,6 @@ const ConfigurationView = (props) => {
menuJumpMethod(data);
break;
case '视频查看': // 视频查看
videoScanMethod(data);
break;
case '自定义交互': // 自定义交互
customBack(data);
......
......@@ -121,7 +121,9 @@ const ConfigurationView = (props) => {
screenshot: false,
},
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) => {
loginauthen();
loginTimer.current = setInterval(() => {
loginauthen();
}, 1000 * 28800 );
}, 1000 * 28800);
return () => {
clearInterval(loginTimer.current);
loginTimer.current = null;
......@@ -945,7 +947,7 @@ const ConfigurationView = (props) => {
controlback: controlData,
})
: null;
const diagramJson = typeof fromJson === 'string' ? fromJson : JSON.stringify(fromJson);
const diagramJson = typeof fromJson === 'string' ? fromJson : JSON.stringify(fromJson);
diagramRender(diagramJson, list);
setNoInitial(false);
try {
......@@ -953,7 +955,7 @@ const ConfigurationView = (props) => {
const nodeDataArray = JSON.parse(diagramJson)?.nodeDataArray || [];
nodeDataArray.forEach((item) => {
if (item.category === 'bgCase') dataSources = item.dataSources || 'MQTT';
})
});
if (dataSources === 'MQTT') {
mqttView && mqttView.saveWaterMqtt();
} else {
......@@ -1471,8 +1473,12 @@ const ConfigurationView = (props) => {
const videoScanMethod = async (data) => {
try {
const opRule = JSON.parse(data.opRule);
const { vdCode, vdList, vdName } = opRule;
if (!vdCode || !vdList) return setVideoData([]);
const bindList = bindData.find((item) => {
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({
UserID: 1,
DeviceCode: vdCode,
......@@ -1482,14 +1488,30 @@ const ConfigurationView = (props) => {
: '',
});
const dataList = detail?.data;
const videoList = vdList.split(',');
if (!dataList) return setVideoData([]);
const detailList = [];
videoList.forEach((item, index) => {
const list = dataList.find((obj) => {
return item === obj.vmS_DeviceID;
if (vdType) {
const videoList = vdList.split(',');
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({
id: list.vmS_DeviceID,
name: list.channelName,
......@@ -1502,7 +1524,8 @@ const ConfigurationView = (props) => {
address: list.address,
channel: list.channelID * 1,
});
});
});
}
setVideoTitle(vdName + '视频查看');
setVideoData(detailList);
detailList.length && setIsVideoVisible(true);
......@@ -3173,7 +3196,10 @@ const ConfigurationView = (props) => {
// title={historyInfoParams.length ? historyInfoParams[0].sensors || '' : ''}
wrapClassName={classNames(`${prefixCls}-historyInfoModal`)}
>
<HistoryView deviceParams={historyInfoParams} title={historyInfoParams.length ? historyInfoParams[0].sensors || '' : ''} />
<HistoryView
deviceParams={historyInfoParams}
title={historyInfoParams.length ? historyInfoParams[0].sensors || '' : ''}
/>
</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