Browse Source

Merge branch 'dev_trial' of https://gitea.anxinyun.cn/free-sun/FS-IOT into dev_trial

release_1.3.0
wenlele 3 years ago
parent
commit
fd80e69cfe
  1. 41
      code/VideoAccess-VCMP/api/Dockerfile
  2. 90
      code/VideoAccess-VCMP/script/1.3.0/schema/2.create_mirror_table.sql
  3. 48
      code/VideoAccess-VCMP/web/Dockerfile
  4. 12
      code/VideoAccess-VCMP/web/client/src/sections/openness/containers/mirroring.jsx
  5. 255
      code/VideoAccess-VCMP/web/client/src/sections/openness/containers/mirroringDetail.jsx

41
code/VideoAccess-VCMP/api/Dockerfile

@ -1,21 +1,36 @@
FROM repository.anxinyun.cn/devops/node:12-dev as builder # FROM repository.anxinyun.cn/devops/node:12-dev as builder
COPY . /var/app # COPY . /var/app
WORKDIR /var/app # WORKDIR /var/app
EXPOSE 8080 # EXPOSE 8080
# RUN npm config set registry=http://10.8.30.22:7000
# RUN echo "{\"time\":\"$BUILD_TIMESTAMP\",\"build\": \"$BUILD_NUMBER\",\"revision\": \"$SVN_REVISION_1\",\"URL\":\"$SVN_URL_1\"}" > version.json
# RUN npm cache clean -f
# RUN rm -rf package-lock.json
# RUN npm install --registry http://10.8.30.22:7000
# FROM registry.cn-hangzhou.aliyuncs.com/fs-devops/node:12
# COPY --from=builder --chown=node /var/app /home/node/app
# WORKDIR /home/node/app
RUN npm config set registry=http://10.8.30.22:7000 # CMD ["node", "server.js"]
RUN echo "{\"time\":\"$BUILD_TIMESTAMP\",\"build\": \"$BUILD_NUMBER\",\"revision\": \"$SVN_REVISION_1\",\"URL\":\"$SVN_URL_1\"}" > version.json
RUN npm cache clean -f
RUN rm -rf package-lock.json
RUN npm install --registry http://10.8.30.22:7000
FROM registry.cn-hangzhou.aliyuncs.com/fs-devops/node:12
COPY --from=builder --chown=node /var/app /home/node/app # 旧版本构建方式
FROM repository.anxinyun.cn/base-images/nodejs12:20.10.12.2
COPY . /var/app
WORKDIR /var/app
EXPOSE 8080
WORKDIR /home/node/app CMD ["-u", "http://localhost:8088"]
CMD ["node", "server.js"] ENTRYPOINT [ "node", "server.js" ]

90
code/VideoAccess-VCMP/script/1.3.0/schema/2.create_mirror_table.sql

@ -0,0 +1,90 @@
create table if not exists mirror
(
id serial not null,
template varchar(63) not null,
create_user integer not null,
create_time timestamp with time zone not null,
update_time timestamp with time zone,
title varchar(128),
show_header boolean not null,
publish boolean default false not null,
mid varchar(32) not null,
publish_time timestamp with time zone,
constraint mirror_pk
primary key (id)
);
comment on column mirror.template is '模板标识';
create unique index if not exists mirror_id_uindex
on mirror (id);
create table if not exists mirror_tree
(
id serial not null,
name varchar(64) not null,
level integer not null,
dependence integer,
mirror_id integer not null,
constraint mirror_tree_pk
primary key (id),
constraint mirror_tree_mirror_id_fk
foreign key (mirror_id) references mirror
);
comment on table mirror_tree is '镜像服务的树节点';
comment on column mirror_tree.level is '层级标注';
create unique index if not exists mirror_tree_id_uindex
on mirror_tree (id);
create table if not exists mirror_filter_group
(
id serial not null,
name varchar(64) not null,
forbidden boolean default false not null,
mirror_id integer not null,
constraint mirror_filter_group_pk
primary key (id),
constraint mirror_filter_group_mirror_id_fk
foreign key (mirror_id) references mirror
);
comment on table mirror_filter_group is '筛选分组';
create unique index if not exists mirror_filter_group_id_uindex
on mirror_filter_group (id);
create table if not exists mirror_filter
(
id serial not null,
name varchar(64) not null,
group_id integer not null,
constraint mirror_filter_pk
primary key (id),
constraint mirror_filter_mirror_filter_group_id_fk
foreign key (group_id) references mirror_filter_group
);
create unique index if not exists mirror_filter_id_uindex
on mirror_filter (id);
create table if not exists mirror_camera
(
id serial not null,
camera_id integer not null,
tree_ids integer[] not null,
filter_ids integer[],
mirror_id integer not null,
constraint mirror_camera_pk
primary key (id),
constraint mirror_camera_camera_id_fk
foreign key (camera_id) references camera,
constraint mirror_camera_mirror_id_fk
foreign key (mirror_id) references mirror
);
create unique index if not exists mirror_camera_id_uindex
on mirror_camera (id);

48
code/VideoAccess-VCMP/web/Dockerfile

@ -1,24 +1,40 @@
FROM repository.anxinyun.cn/devops/node:12-dev as builder # FROM repository.anxinyun.cn/devops/node:12-dev as builder
COPY . /var/app # COPY . /var/app
WORKDIR /var/app # WORKDIR /var/app
EXPOSE 8080 # EXPOSE 8080
# RUN npm config set registry=http://10.8.30.22:7000
# RUN echo "{\"time\":\"$BUILD_TIMESTAMP\",\"build\": \"$BUILD_NUMBER\",\"revision\": \"$SVN_REVISION_1\",\"URL\":\"$SVN_URL_1\"}" > version.json
# RUN npm cache clean -f
# RUN npm install --registry http://10.8.30.22:7000
# RUN npm run build
# RUN rm -rf client/src
# RUN rm -rf node_modules
# RUN npm install --production --registry http://10.8.30.22:7000
# FROM registry.cn-hangzhou.aliyuncs.com/fs-devops/node-16:7.22-06-20
# COPY --from=builder --chown=node /var/app /home/node/app
# WORKDIR /home/node/app
# CMD ["node", "server.js"]
RUN npm config set registry=http://10.8.30.22:7000
RUN echo "{\"time\":\"$BUILD_TIMESTAMP\",\"build\": \"$BUILD_NUMBER\",\"revision\": \"$SVN_REVISION_1\",\"URL\":\"$SVN_URL_1\"}" > version.json
RUN npm cache clean -f
RUN npm install --registry http://10.8.30.22:7000
RUN npm run build
RUN rm -rf client/src
RUN rm -rf node_modules
RUN npm install --production --registry http://10.8.30.22:7000
FROM registry.cn-hangzhou.aliyuncs.com/fs-devops/node-16:7.22-06-20 # 就版本构建方式
COPY --from=builder --chown=node /var/app /home/node/app
WORKDIR /home/node/app FROM repository.anxinyun.cn/base-images/nodejs12:20.10.12.2
COPY . /var/app
WORKDIR /var/app
EXPOSE 8080
CMD ["-u", "http://localhost:8088"]
CMD ["node", "server.js"] ENTRYPOINT [ "node", "server.js" ]

12
code/VideoAccess-VCMP/web/client/src/sections/openness/containers/mirroring.jsx

@ -15,11 +15,11 @@ const Mirroring = (props) => {
img: '/assets/images/imageImg/textblue.png', img: '/assets/images/imageImg/textblue.png',
color: 'blue' color: 'blue'
}, { }, {
title: '白', title: '静谧白',
img: '/assets/images/imageImg/textwhite.png', img: '/assets/images/imageImg/textwhite.png',
color: 'white' color: 'white'
}, { }, {
title: '黑色(深灰)', title: '神秘黑',
img: '/assets/images/imageImg/textblack.png', img: '/assets/images/imageImg/textblack.png',
color: 'black' color: 'black'
}, },
@ -44,10 +44,8 @@ const Mirroring = (props) => {
function todetail (color) {// function todetail (color) {//
dispatch(push('/mirroring_detail'+'?template='+color)); dispatch(push('/mirroring_detail'+'?template='+color));
} }
function tomirrordetail(mid){ function tomirrordetail(mid,template){
dispatch(openness.getMirrorDetail(mid)).then((res) => { dispatch(push('/mirroring_detail'+'?template='+template+'&mid='+mid));
// dispatch(push('/mirroring_detail'+'?id='+item.id+'&template='+item.template))
})
} }
function todelete (id) {// function todelete (id) {//
dispatch(openness.delMirror(id)).then((res) => { dispatch(openness.delMirror(id)).then((res) => {
@ -207,7 +205,7 @@ const Mirroring = (props) => {
src={item.template == 'blue' ? '/assets/images/imageImg/textblue.png' : item.template == 'black' ? '/assets/images/imageImg/textblack.png' : '/assets/images/imageImg/textwhite.png'} src={item.template == 'blue' ? '/assets/images/imageImg/textblue.png' : item.template == 'black' ? '/assets/images/imageImg/textblack.png' : '/assets/images/imageImg/textwhite.png'}
alt="设置" alt="设置"
style={{ width: 330, height: 153, cursor: 'pointer' }} style={{ width: 330, height: 153, cursor: 'pointer' }}
onClick={() => {tomirrordetail(item.mid)}} onClick={() => {tomirrordetail(item.mid,item.template)}}
/> />
<div style={{ color: '#2F2F2F', fontSize: 16, width: 300, textOverflow: 'ellipsis', whiteSpace: 'nowrap', overflow: 'hidden' }}> <div style={{ color: '#2F2F2F', fontSize: 16, width: 300, textOverflow: 'ellipsis', whiteSpace: 'nowrap', overflow: 'hidden' }}>
{item.title} {item.title}

255
code/VideoAccess-VCMP/web/client/src/sections/openness/containers/mirroringDetail.jsx

@ -1,30 +1,96 @@
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) => {
const { history, dispatch, actions, user, loading, StatusPushList } = props; const { history, dispatch, actions, user, loading, StatusPushList } = props;
const { openness } = actions; const { openness } = actions;
useEffect(() => { useEffect(() => {
let search=props.location.search let search = props.location.search
let result = search.slice(1) let result = search.slice(1)
let searcharr=result.split('&') let searcharr = result.split('&')
if(searcharr.length==1){ if (searcharr.length == 1) {
setTemplate(searcharr[0].split('=')[1])// setTemplate(searcharr[0].split('=')[1])//
} }
else{ else {
setTemplate(searcharr[0].split('=')[1])// setTemplate(searcharr[0].split('=')[1])//
setMirrorId(searcharr[2].split('=')[1])//id dispatch(openness.getMirrorDetail(searcharr[1].split('=')[1])).then((res) => {
let filterGrouplist = res.payload.data.filterGroup
for (let i = 0; i < filterGrouplist.length; i++) {
filterGrouplist[i].num = i
if (filterGrouplist[i].filters.length > 0) {
for (let j = 0; j < filterGrouplist[i].filters.length; j++) {
filterGrouplist[i].filters[j].num = j
}
}
}
setFilterGroup(filterGrouplist);
setMirrorId(res.payload.data.id);//id
setShowHeader(res.payload.data.showHeader);
setHeaderName(res.payload.data.title);
let mytreeData = res.payload.data.tree
for (let i = 0; i < mytreeData.length; i++) {//
mytreeData[i].value = mytreeData[i].key
for (let j = 0; j < mytreeData[i].children.length; j++) {//
mytreeData[i].children[j].value = mytreeData[i].children[j].key
if (mytreeData[i].children[j].camera) {
if (mytreeData[i].children[j].camera.type == 'yingshi') {
mytreeData[i].children[j].camera.content = mytreeData[i].children[j].camera.cameraRemarks.map(v => v.remark),
mytreeData[i].children[j].camera.yingshiToken = mytreeData[i].children[j].camera.secretYingshi.token
}
else {
mytreeData[i].children[j].camera.content = mytreeData[i].children[j].camera.cameraRemarks.map(v => v.remark),
mytreeData[i].children[j].camera.yingshiToken = null
}
}
else {
for (let k = 0; k < mytreeData[i].children[j].children.length; k++) {//
mytreeData[i].children[j].children[k].value = mytreeData[i].children[j].children[k].key
if (mytreeData[i].children[j].children[k].camera) {
if (mytreeData[i].children[j].children[k].camera.type == 'yingshi') {
mytreeData[i].children[j].children[k].camera.content = mytreeData[i].children[j].children[k].camera.cameraRemarks.map(v => v.remark),
mytreeData[i].children[j].children[k].camera.yingshiToken = mytreeData[i].children[j].children[k].camera.secretYingshi.token
}
else {
mytreeData[i].children[j].children[k].camera.content = mytreeData[i].children[j].children[k].camera.cameraRemarks.map(v => v.remark),
mytreeData[i].children[j].children[k].camera.yingshiToken = null
}
}
else {
for (let l = 0; l < mytreeData[i].children[j].children[k].children.length; l++) {
mytreeData[i].children[j].children[k].children[l].value = mytreeData[i].children[j].children[k].children[l].key
if (mytreeData[i].children[j].children[k].children[l].camera) {
if (mytreeData[i].children[j].children[k].children[l].camera.type == 'yingshi') {
mytreeData[i].children[j].children[k].children[l].camera.content = mytreeData[i].children[j].children[k].children[l].camera.cameraRemarks.map(v => v.remark),
mytreeData[i].children[j].children[k].children[l].camera.yingshiToken = mytreeData[i].children[j].children[k].children[l].camera.secretYingshi.token
}
else {
mytreeData[i].children[j].children[k].children[l].camera.content = mytreeData[i].children[j].children[k].children[l].camera.cameraRemarks.map(v => v.remark),
mytreeData[i].children[j].children[k].children[l].camera.yingshiToken = null
}
}
}
}
}
}
}
}
setTreeData(mytreeData);
})
} }
equipmentGetCamera(); equipmentGetCamera();
}, []); }, []);
const [showHeader,setShowHeader] = useState(false)// const [hasModify, sethasModify] = useState(false)//
const [mirrorId,setMirrorId] = useState(null)//id const [showHeader, setShowHeader] = useState(false)//
const [mirrorId, setMirrorId] = useState(null)//id
const [backVisible, setBackVisible] = useState(false)//
const [template,setTemplate] = useState('')//
const [template, setTemplate] = useState('')//
const [chooseNum, setChooseNum] = useState(0);//tab const [chooseNum, setChooseNum] = useState(0);//tab
const [chooseList, setChooseList] = useState(['节点', '样式', '功能']); const [chooseList, setChooseList] = useState(['节点', '样式', '功能']);
const [editKey, setEditKey] = useState('') const [editKey, setEditKey] = useState('')
@ -117,20 +183,53 @@ const MirroringDetail = (props) => {
setIndeterminate(!!checkedList.length && checkedList.length < showCameraList.length); setIndeterminate(!!checkedList.length && checkedList.length < showCameraList.length);
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) => { dispatch(openness.putMirror(mirrordata)).then((res) => {
console.log('res',res); history.goBack()
}) })
} }
}
function nodeDelete (item) {// function nodeDelete (item) {//
let mainData = JSON.parse(JSON.stringify(treeData)) let mainData = JSON.parse(JSON.stringify(treeData))
let nodeKeyArr = item.key.split('-') let nodeKeyArr = item.key.split('-')
@ -183,6 +282,7 @@ const MirroringDetail = (props) => {
} }
} }
} }
sethasModify(true)
setAddCamera(false) setAddCamera(false)
setTreeData(mainData) setTreeData(mainData)
} }
@ -240,6 +340,7 @@ const MirroringDetail = (props) => {
} }
} }
} }
sethasModify(true)
setTreeData(mainData) setTreeData(mainData)
} }
function changeLable (value, item) {// function changeLable (value, item) {//
@ -270,6 +371,7 @@ const MirroringDetail = (props) => {
} }
} }
} }
sethasModify(true)
setTreeData(mainData) setTreeData(mainData)
} }
function lableBlur () { function lableBlur () {
@ -277,7 +379,6 @@ const MirroringDetail = (props) => {
} }
function cameraAdd (item) {// function cameraAdd (item) {//
let myplainOptions = JSON.parse(JSON.stringify(plainOptions)) let myplainOptions = JSON.parse(JSON.stringify(plainOptions))
for (let i = 0; i < myplainOptions.length; i++) {//
for (let j = 0; j < treeData.length; j++) {// for (let j = 0; j < treeData.length; j++) {//
if (treeData[j].children) {// if (treeData[j].children) {//
for (let k = 0; k < treeData[j].children.length; k++) {// for (let k = 0; k < treeData[j].children.length; k++) {//
@ -286,20 +387,25 @@ const MirroringDetail = (props) => {
if (treeData[j].children[k].children[l].children) {// if (treeData[j].children[k].children[l].children) {//
for (let p = 0; p < treeData[j].children[k].children[l].children.length; p++) { for (let p = 0; p < treeData[j].children[k].children[l].children.length; p++) {
if (treeData[j].children[k].children[l].children[p].cameraId) { if (treeData[j].children[k].children[l].children[p].cameraId) {
for (let i = 0; i < myplainOptions.length; i++) {
if (myplainOptions[i].value == treeData[j].children[k].children[l].children[p].cameraId) { if (myplainOptions[i].value == treeData[j].children[k].children[l].children[p].cameraId) {
myplainOptions.splice(i, 1) myplainOptions.splice(i, 1)
} }
} }
} }
} }
}
else if (treeData[j].children[k].children[l].cameraId) {// else if (treeData[j].children[k].children[l].cameraId) {//
for (let i = 0; i < myplainOptions.length; i++) {
if (myplainOptions[i].value == treeData[j].children[k].children[l].cameraId) { if (myplainOptions[i].value == treeData[j].children[k].children[l].cameraId) {
myplainOptions.splice(i, 1) myplainOptions.splice(i, 1)
} }
} }
} }
} }
}
else if (treeData[j].children[k].cameraId) {// else if (treeData[j].children[k].cameraId) {//
for (let i = 0; i < myplainOptions.length; i++) {
if (myplainOptions[i].value == treeData[j].children[k].cameraId) { if (myplainOptions[i].value == treeData[j].children[k].cameraId) {
myplainOptions.splice(i, 1) myplainOptions.splice(i, 1)
} }
@ -396,7 +502,7 @@ const MirroringDetail = (props) => {
</div> </div>
</Popconfirm> </Popconfirm>
{ {
(item.children && item.children.length > 0 && item.children[0].cameraId) || keyArr.length > 2||item.cameraId ? ('') : ( (item.children && item.children.length > 0 && item.children[0].cameraId) || keyArr.length > 2 || item.cameraId ? ('') : (
<div style={{ width: 12, height: 12, cursor: 'pointer', marginRight: 4 }} onClick={() => nodeAdd(item)}> <div style={{ width: 12, height: 12, cursor: 'pointer', marginRight: 4 }} onClick={() => nodeAdd(item)}>
<img <img
src="/assets/images/imageImg/nodeadd.png" src="/assets/images/imageImg/nodeadd.png"
@ -411,8 +517,13 @@ const MirroringDetail = (props) => {
) )
}; };
function toback () {// function toback () {//
if (hasModify) {
setBackVisible(true)
}
else {
history.goBack() history.goBack()
} }
}
function tochange (index) {// function tochange (index) {//
setChooseNum(index); setChooseNum(index);
setAddCamera(false); setAddCamera(false);
@ -438,6 +549,7 @@ const MirroringDetail = (props) => {
key: '0', key: '0',
}) })
} }
sethasModify(true)
setTreeData(mainData) setTreeData(mainData)
} }
function searchCamera () {// function searchCamera () {//
@ -611,7 +723,7 @@ const MirroringDetail = (props) => {
} }
} }
} }
console.log('mainDatamainDatamainData',mainData); sethasModify(true)
setTreeData(mainData); setTreeData(mainData);
setAddCamera(false); setAddCamera(false);
setMykeyword('') setMykeyword('')
@ -642,22 +754,64 @@ const MirroringDetail = (props) => {
filters: [] filters: []
}) })
} }
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
setFilterGroup(filterGroupList) setFilterGroup(filterGroupList)
sethasModify(true)
} }
function screenDel (index) {// function screenDel (index) {//
let filterGroupList = JSON.parse(JSON.stringify(filterGroup)) let filterGroupList = JSON.parse(JSON.stringify(filterGroup))
filterGroupList.splice(index, 1) filterGroupList.splice(index, 1)
setFilterGroup(filterGroupList) setFilterGroup(filterGroupList)
sethasModify(true)
} }
function toEditscreen (val, index) {// function toEditscreen (val, index) {//
let filterGroupList = JSON.parse(JSON.stringify(filterGroup)) let filterGroupList = JSON.parse(JSON.stringify(filterGroup))
filterGroupList[index].name = val filterGroupList[index].name = val
setFilterGroup(filterGroupList) setFilterGroup(filterGroupList)
sethasModify(true)
} }
function toAddLabel () {// function toAddLabel () {//
let filterGroupList = JSON.parse(JSON.stringify(filterGroup)) let filterGroupList = JSON.parse(JSON.stringify(filterGroup))
@ -675,29 +829,33 @@ const MirroringDetail = (props) => {
cameraIds: [] cameraIds: []
}) })
} }
sethasModify(true)
setFilterGroup(filterGroupList) setFilterGroup(filterGroupList)
} }
function labelDel (index) {// function labelDel (index) {//
let filterGroupList = JSON.parse(JSON.stringify(filterGroup)) let filterGroupList = JSON.parse(JSON.stringify(filterGroup))
filterGroupList[addLabelNum].filters.splice(index, 1) filterGroupList[addLabelNum].filters.splice(index, 1)
setFilterGroup(filterGroupList) setFilterGroup(filterGroupList)
sethasModify(true)
} }
function addFiltersCamera (val, index) { function addFiltersCamera (val, index) {//
let filterGroupList = JSON.parse(JSON.stringify(filterGroup)) let filterGroupList = JSON.parse(JSON.stringify(filterGroup))
filterGroupList[addLabelNum].filters[index].cameraIds = val filterGroupList[addLabelNum].filters[index].cameraIds = val
setFilterGroup(filterGroupList) setFilterGroup(filterGroupList)
sethasModify(true)
} }
function toEditLabel (val, index) { function toEditLabel (val, index) {//
let filterGroupList = JSON.parse(JSON.stringify(filterGroup)) let filterGroupList = JSON.parse(JSON.stringify(filterGroup))
filterGroupList[addLabelNum].filters[index].name = val filterGroupList[addLabelNum].filters[index].name = val
setFilterGroup(filterGroupList) setFilterGroup(filterGroupList)
sethasModify(true)
} }
return ( return (
<div style={{ background: 'rgb(246, 250, 255)', height: '100%', width: '100%' }}> <div style={{ background: 'rgb(246, 250, 255)', height: '100%', width: '100%' }}>
<div style={{ <div style={{
height: 64, background: "url(/assets/images/imageImg/banner.png)", backgroundSize: "100% 100%", display: 'flex', alignItems: 'center', justifyContent: 'space-between' height: 64, background: "url(/assets/images/imageImg/banner.png)", backgroundSize: "100% 100%", display: 'flex', alignItems: 'center', justifyContent: 'space-between'
}}> }}>
<div style={{ display: 'flex',alignItems: 'center' }}> <div style={{ display: 'flex', alignItems: 'center' }}>
<div style={{ width: 20, height: 20, marginLeft: 19, cursor: 'pointer' }} onClick={toback}> <div style={{ width: 20, height: 20, marginLeft: 19, cursor: 'pointer' }} onClick={toback}>
<img <img
src="/assets/images/imageImg/toback.png" src="/assets/images/imageImg/toback.png"
@ -708,7 +866,7 @@ const MirroringDetail = (props) => {
{ {
editHeaderName ? ( editHeaderName ? (
<div style={{ fontSize: 16, color: '#FFFFFF', marginLeft: 20 }}> <div style={{ fontSize: 16, color: '#FFFFFF', marginLeft: 20 }}>
<Input value={headerName} onBlur={() => { setEditHeaderName(false) }} onChange={(value) => setHeaderName(value)} style={{ width: 200,color: 'rgba(255,255,255,0.9)',background: 'rgba(0,0,0,0.2)' }} maxLength={20} className='inputpadding'></Input> <Input value={headerName} onBlur={() => { setEditHeaderName(false) }} onChange={(value) => setHeaderName(value)} style={{ width: 200, color: 'rgba(255,255,255,0.9)', background: 'rgba(0,0,0,0.2)' }} maxLength={20} className='inputpadding'></Input>
</div> </div>
) : ( ) : (
<div style={{ fontSize: 16, color: '#FFFFFF', marginLeft: 20 }}> <div style={{ fontSize: 16, color: '#FFFFFF', marginLeft: 20 }}>
@ -716,7 +874,7 @@ const MirroringDetail = (props) => {
</div> </div>
) )
} }
<div style={{ width: 12, height: 12, marginLeft: 8, marginTop: 1, cursor: 'pointer',display:'flex' }} onClick={changeHeaderName}> <div style={{ width: 12, height: 12, marginLeft: 8, marginTop: 1, cursor: 'pointer', display: 'flex' }} onClick={changeHeaderName}>
<img <img
src="/assets/images/imageImg/nameChange.png" src="/assets/images/imageImg/nameChange.png"
alt="设置" alt="设置"
@ -725,21 +883,21 @@ const MirroringDetail = (props) => {
</div> </div>
</div> </div>
<div style={{ display: 'flex', }}> <div style={{ display: 'flex', }}>
<div style={{ width: 22, height: 22, marginRight: 30, cursor: 'pointer' }} onClick={()=>{setVideoPlay(!videoPlay)}}> <div style={{ width: 22, height: 22, marginRight: 30, cursor: 'pointer' }} onClick={() => { setVideoPlay(!videoPlay) }}>
<img <img
src="/assets/images/imageImg/generate.png" src="/assets/images/imageImg/generate.png"
alt="设置" alt="设置"
style={{ width: '100%' }} style={{ width: '100%' }}
/> />
</div> </div>
<div style={{ width: 22, height: 22, marginRight: 30, cursor: 'pointer' }} onClick={()=>{topublish(false)}}> <div style={{ width: 22, height: 22, marginRight: 30, cursor: hasModify ? 'pointer' : 'not-allowed' }} onClick={() => { hasModify ? topublish(false) : '' }}>
<img <img
src="/assets/images/imageImg/save.png" src="/assets/images/imageImg/save.png"
alt="设置" alt="设置"
style={{ width: '100%' }} style={{ width: '100%' }}
/> />
</div> </div>
<div style={{ width: 22, height: 22, marginRight: 44, cursor: 'pointer' }} onClick={()=>{topublish(true)}}> <div style={{ width: 22, height: 22, marginRight: 44, cursor: 'pointer' }} onClick={() => { topublish(true) }}>
<img <img
src="/assets/images/imageImg/upload.png" src="/assets/images/imageImg/upload.png"
alt="设置" alt="设置"
@ -848,7 +1006,7 @@ const MirroringDetail = (props) => {
<div style={{ display: chooseNum == "1" ? "block" : "none", fontSize: 12 }} className="hasHeader"> <div style={{ display: chooseNum == "1" ? "block" : "none", fontSize: 12 }} className="hasHeader">
<div style={{ height: 41, display: 'flex', alignItems: 'center', justifyContent: 'space-between', borderBottom: '1px solid rgba(226,226,226,0.2)' }}> <div style={{ height: 41, display: 'flex', alignItems: 'center', justifyContent: 'space-between', borderBottom: '1px solid rgba(226,226,226,0.2)' }}>
<div style={{ marginLeft: 20 }}>header</div> <div style={{ marginLeft: 20 }}>header</div>
<div style={{ marginRight: 13 }}><Switch onChange={(v, e) => setShowHeader(v)} size="small" aria-label="是否有头部"></Switch></div> <div style={{ marginRight: 13 }}><Switch checked={showHeader} onChange={(v, e) => setShowHeader(v)} size="small" aria-label="是否有头部"></Switch></div>
</div> </div>
<div style={{ height: 41, display: 'flex', alignItems: 'center', justifyContent: 'space-between', borderBottom: '1px solid rgba(226,226,226,0.2)', cursor: 'pointer' }} onClick={() => { setComingVisible(true) }}> <div style={{ height: 41, display: 'flex', alignItems: 'center', justifyContent: 'space-between', borderBottom: '1px solid rgba(226,226,226,0.2)', cursor: 'pointer' }} onClick={() => { setComingVisible(true) }}>
<div style={{ marginLeft: 20 }}>自定义样式</div> <div style={{ marginLeft: 20 }}>自定义样式</div>
@ -914,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>
@ -982,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>
@ -1023,7 +1181,7 @@ const MirroringDetail = (props) => {
} }
</div> </div>
<div style={{ flex: 1 }}> <div style={{ flex: 1 }}>
<VideoScreen treeData={treeData} headerName={headerName} showHeader={showHeader} filterGroup={filterGroup} template={template} videoPlay={videoPlay}/> <VideoScreen treeData={treeData} headerName={headerName} showHeader={showHeader} filterGroup={filterGroup} template={template} videoPlay={videoPlay} />
</div> </div>
</div> </div>
<Modal <Modal
@ -1035,6 +1193,7 @@ const MirroringDetail = (props) => {
width={610} width={610}
onCancel={() => { onCancel={() => {
setComingVisible(false) setComingVisible(false)
history.goBack()
}} }}
okText="确定" okText="确定"
cancelText="取消" cancelText="取消"
@ -1042,6 +1201,34 @@ const MirroringDetail = (props) => {
> >
开发中敬请期待~ 开发中敬请期待~
</Modal> </Modal>
<Modal
title="提醒"
visible={backVisible}
width={610}
onCancel={() => {
setBackVisible(false)
}}
// okText=""
// cancelText=""
closeOnEsc={true}
footer={
<div>
<Button type="primary" onClick={() => {
history.goBack()
}}>
取消
</Button>
<Button theme='solid' type="primary" onClick={() => {
topublish(false)
setBackVisible(false)
}}>
确定
</Button>
</div>
}
>
是否保存修改~
</Modal>
</div> </div>
) )
} }

Loading…
Cancel
Save