|
@ -1,8 +1,9 @@ |
|
|
import React, { useEffect, useState, useRef } from 'react'; |
|
|
import React, { useEffect, useState, useRef } from 'react'; |
|
|
import { connect } from 'react-redux'; |
|
|
import { connect } from 'react-redux'; |
|
|
import '../style.less' |
|
|
import '../style.less' |
|
|
import { Tree, Popconfirm, Typography, Input, Switch, Modal, Checkbox, CheckboxGroup, Select } from "@douyinfe/semi-ui" |
|
|
import { Tree, Popconfirm, Typography, Input, Switch, Modal, Checkbox, CheckboxGroup, Select, Toast,Button } from "@douyinfe/semi-ui" |
|
|
import VideoScreen from '../components/videoScreen'; |
|
|
import VideoScreen from '../components/videoScreen'; |
|
|
|
|
|
import { set } from 'nprogress'; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
const MirroringDetail = (props) => { |
|
|
const MirroringDetail = (props) => { |
|
@ -183,18 +184,51 @@ const MirroringDetail = (props) => { |
|
|
setCheckall(checkedList.length === showCameraList.length); |
|
|
setCheckall(checkedList.length === showCameraList.length); |
|
|
} |
|
|
} |
|
|
function topublish (publish) {//编辑镜像信息 |
|
|
function topublish (publish) {//编辑镜像信息 |
|
|
let mirrordata = { |
|
|
let filterGroupnum=0 |
|
|
mirrorId: mirrorId, |
|
|
let cantopublish=true |
|
|
template: template, |
|
|
for (let i = 0; i < filterGroup.length; i++) { |
|
|
title: headerName, |
|
|
for (let j = 0; j < filterGroup.length; j++) { |
|
|
showHeader: showHeader, |
|
|
if(filterGroup[i].name==filterGroup[j].name){ |
|
|
publish: publish, |
|
|
filterGroupnum++ |
|
|
tree: treeData, |
|
|
} |
|
|
filterGroup: filterGroup |
|
|
} |
|
|
|
|
|
} |
|
|
|
|
|
if(filterGroupnum>filterGroup.length){ |
|
|
|
|
|
cantopublish=false |
|
|
|
|
|
let opts = { |
|
|
|
|
|
content: '筛选项名称不能重复,请修改', |
|
|
|
|
|
duration: 3, |
|
|
|
|
|
}; |
|
|
|
|
|
Toast.error(opts) |
|
|
|
|
|
}else{ |
|
|
|
|
|
for (let k = 0; k < filterGroup.length; k++) { |
|
|
|
|
|
let filtersarr=[] |
|
|
|
|
|
for (let l = 0; l < filterGroup[k].filters.length; l++) { |
|
|
|
|
|
filtersarr.push(filterGroup[k].filters[l].name) |
|
|
|
|
|
} |
|
|
|
|
|
if(Array.from(new Set(filtersarr)).length<filterGroup[k].filters.length){ |
|
|
|
|
|
cantopublish=false |
|
|
|
|
|
Toast.error({ |
|
|
|
|
|
content: '标签组名称不能重复,请修改', |
|
|
|
|
|
duration: 3, |
|
|
|
|
|
}) |
|
|
|
|
|
} |
|
|
|
|
|
} |
|
|
|
|
|
} |
|
|
|
|
|
if(cantopublish){ |
|
|
|
|
|
let mirrordata = { |
|
|
|
|
|
mirrorId: mirrorId, |
|
|
|
|
|
template: template, |
|
|
|
|
|
title: headerName, |
|
|
|
|
|
showHeader: showHeader, |
|
|
|
|
|
publish: publish, |
|
|
|
|
|
tree: treeData, |
|
|
|
|
|
filterGroup: filterGroup |
|
|
|
|
|
} |
|
|
|
|
|
dispatch(openness.putMirror(mirrordata)).then((res) => { |
|
|
|
|
|
history.goBack() |
|
|
|
|
|
}) |
|
|
} |
|
|
} |
|
|
dispatch(openness.putMirror(mirrordata)).then((res) => { |
|
|
|
|
|
history.goBack() |
|
|
|
|
|
}) |
|
|
|
|
|
} |
|
|
} |
|
|
function nodeDelete (item) {//删除树状子节点 |
|
|
function nodeDelete (item) {//删除树状子节点 |
|
|
let mainData = JSON.parse(JSON.stringify(treeData)) |
|
|
let mainData = JSON.parse(JSON.stringify(treeData)) |
|
@ -723,6 +757,44 @@ const MirroringDetail = (props) => { |
|
|
sethasModify(true) |
|
|
sethasModify(true) |
|
|
setFilterGroup(filterGroupList) |
|
|
setFilterGroup(filterGroupList) |
|
|
} |
|
|
} |
|
|
|
|
|
function toChangeScreen (num, name) {//筛选项去重 |
|
|
|
|
|
let samenum = 0 |
|
|
|
|
|
for (let i = 0; i < filterGroup.length; i++) { |
|
|
|
|
|
if (filterGroup[i].name == name) { |
|
|
|
|
|
samenum++ |
|
|
|
|
|
} |
|
|
|
|
|
} |
|
|
|
|
|
if (samenum > 1) { |
|
|
|
|
|
let opts = { |
|
|
|
|
|
content: '筛选项名称不能重复,请修改', |
|
|
|
|
|
duration: 3, |
|
|
|
|
|
}; |
|
|
|
|
|
Toast.error(opts) |
|
|
|
|
|
setEditNum(num) |
|
|
|
|
|
} |
|
|
|
|
|
else { |
|
|
|
|
|
setEditNum(1000) |
|
|
|
|
|
} |
|
|
|
|
|
} |
|
|
|
|
|
function toChangeLabel (num, name, index) {//标签组去重 |
|
|
|
|
|
let samenum = 0 |
|
|
|
|
|
for (let i = 0; i < filterGroup[index].filters.length; i++) { |
|
|
|
|
|
if (filterGroup[index].filters[i].name == name) { |
|
|
|
|
|
samenum++ |
|
|
|
|
|
} |
|
|
|
|
|
} |
|
|
|
|
|
if (samenum > 1) { |
|
|
|
|
|
let opts = { |
|
|
|
|
|
content: '标签组名称不能重复,请修改', |
|
|
|
|
|
duration: 3, |
|
|
|
|
|
}; |
|
|
|
|
|
Toast.error(opts) |
|
|
|
|
|
setLabelEditNum(num) |
|
|
|
|
|
} |
|
|
|
|
|
else { |
|
|
|
|
|
setLabelEditNum(1000) |
|
|
|
|
|
} |
|
|
|
|
|
} |
|
|
function switchOnChange (val, index) {//筛选项是否禁用 |
|
|
function switchOnChange (val, index) {//筛选项是否禁用 |
|
|
let filterGroupList = JSON.parse(JSON.stringify(filterGroup)) |
|
|
let filterGroupList = JSON.parse(JSON.stringify(filterGroup)) |
|
|
filterGroupList[index].forbidden = val |
|
|
filterGroupList[index].forbidden = val |
|
@ -1000,7 +1072,7 @@ const MirroringDetail = (props) => { |
|
|
<div style={{ marginLeft: 20, color: 'rgba(0,0,0,0.65)' }}> |
|
|
<div style={{ marginLeft: 20, color: 'rgba(0,0,0,0.65)' }}> |
|
|
{ |
|
|
{ |
|
|
editNum == item.num ? ( |
|
|
editNum == item.num ? ( |
|
|
<Input value={item.name} onBlur={() => { setEditNum(1000) }} onChange={(value) => toEditscreen(value, index)} style={{ width: 120 }} maxLength={8} className='inputpadding' size='small'></Input> |
|
|
<Input value={item.name} onBlur={() => { toChangeScreen(item.num, item.name) }} onChange={(value) => toEditscreen(value, index)} style={{ width: 120 }} maxLength={8} className='inputpadding' size='small'></Input> |
|
|
) : (item.name) |
|
|
) : (item.name) |
|
|
} |
|
|
} |
|
|
</div> |
|
|
</div> |
|
@ -1068,7 +1140,7 @@ const MirroringDetail = (props) => { |
|
|
<div style={{ color: 'rgba(0,0,0,0.65)' }}> |
|
|
<div style={{ color: 'rgba(0,0,0,0.65)' }}> |
|
|
{ |
|
|
{ |
|
|
labelEditNum == item.num ? ( |
|
|
labelEditNum == item.num ? ( |
|
|
<Input value={item.name} onBlur={() => { setLabelEditNum(1000) }} onChange={(value) => toEditLabel(value, index)} style={{ width: 120 }} maxLength={8} className='inputpadding' size='small'></Input> |
|
|
<Input value={item.name} onBlur={() => { toChangeLabel(item.num, item.name, addLabelNum) }} onChange={(value) => toEditLabel(value, index)} style={{ width: 120 }} maxLength={8} className='inputpadding' size='small'></Input> |
|
|
) : (item.name) |
|
|
) : (item.name) |
|
|
} |
|
|
} |
|
|
</div> |
|
|
</div> |
|
@ -1121,6 +1193,7 @@ const MirroringDetail = (props) => { |
|
|
width={610} |
|
|
width={610} |
|
|
onCancel={() => { |
|
|
onCancel={() => { |
|
|
setComingVisible(false) |
|
|
setComingVisible(false) |
|
|
|
|
|
history.goBack() |
|
|
}} |
|
|
}} |
|
|
okText="确定" |
|
|
okText="确定" |
|
|
cancelText="取消" |
|
|
cancelText="取消" |
|
@ -1131,17 +1204,28 @@ const MirroringDetail = (props) => { |
|
|
<Modal |
|
|
<Modal |
|
|
title="提醒" |
|
|
title="提醒" |
|
|
visible={backVisible} |
|
|
visible={backVisible} |
|
|
onOk={() => { |
|
|
|
|
|
topublish(false) |
|
|
|
|
|
setBackVisible(false) |
|
|
|
|
|
}} |
|
|
|
|
|
width={610} |
|
|
width={610} |
|
|
onCancel={() => { |
|
|
onCancel={() => { |
|
|
setBackVisible(false) |
|
|
setBackVisible(false) |
|
|
}} |
|
|
}} |
|
|
okText="确定" |
|
|
// okText="确定" |
|
|
cancelText="取消" |
|
|
// cancelText="取消" |
|
|
closeOnEsc={true} |
|
|
closeOnEsc={true} |
|
|
|
|
|
footer={ |
|
|
|
|
|
<div> |
|
|
|
|
|
<Button type="primary" onClick={() => { |
|
|
|
|
|
history.goBack() |
|
|
|
|
|
}}> |
|
|
|
|
|
取消 |
|
|
|
|
|
</Button> |
|
|
|
|
|
<Button theme='solid' type="primary" onClick={() => { |
|
|
|
|
|
topublish(false) |
|
|
|
|
|
setBackVisible(false) |
|
|
|
|
|
}}> |
|
|
|
|
|
确定 |
|
|
|
|
|
</Button> |
|
|
|
|
|
</div> |
|
|
|
|
|
} |
|
|
> |
|
|
> |
|
|
是否保存修改?~ |
|
|
是否保存修改?~ |
|
|
</Modal> |
|
|
</Modal> |
|
|