diff --git a/code/VideoAccess-VCMP/api/config.js b/code/VideoAccess-VCMP/api/config.js index b551f6f..151559d 100644 --- a/code/VideoAccess-VCMP/api/config.js +++ b/code/VideoAccess-VCMP/api/config.js @@ -101,7 +101,8 @@ const product = { { p: '/status/alarm', o: 'POST' }, { p: '/camera/unique/all', o: 'GET' }, { p: '/status/alarm/confirm', o: 'PUT' }, - { p: '/status/check', o: 'GET' } + { p: '/status/check', o: 'GET' }, + { p: '/mirror/:mirrorId', o: 'GET' }, ], // 不做认证的路由,也可以使用 exclude: ["*"] 跳过所有路由 redis: { host: IOTA_REDIS_SERVER_HOST, diff --git a/code/VideoAccess-VCMP/web/client/src/layout/containers/layout/index.jsx b/code/VideoAccess-VCMP/web/client/src/layout/containers/layout/index.jsx index 576ae3e..a24d152 100644 --- a/code/VideoAccess-VCMP/web/client/src/layout/containers/layout/index.jsx +++ b/code/VideoAccess-VCMP/web/client/src/layout/containers/layout/index.jsx @@ -49,7 +49,7 @@ const LayoutContainer = props => { useEffect(() => { NProgress.done(); - if ((!user || !user.authorized) && !authCrossLoading && props.location.pathname != '/video_play_status') { + if ((!user || !user.authorized) && !authCrossLoading && props.location.pathname != '/video_play_status'&& props.location.pathname != '/callService') { history.push('/signin'); } if (msg) { diff --git a/code/VideoAccess-VCMP/web/client/src/sections/openness/actions/mirroring.js b/code/VideoAccess-VCMP/web/client/src/sections/openness/actions/mirroring.js index c557566..04b1725 100644 --- a/code/VideoAccess-VCMP/web/client/src/sections/openness/actions/mirroring.js +++ b/code/VideoAccess-VCMP/web/client/src/sections/openness/actions/mirroring.js @@ -111,14 +111,27 @@ export function getErrorCode (query) {//查取指定状态码信息 } -export function getMirrorMid (orgId) {//获取指定镜像信息 +export function getMirrorMid (orgId,query) {//获取指定镜像信息 return (dispatch) => basicAction({ type: "get", + query, dispatch: dispatch, actionType: "GET_MIRRORMID", url: `${ApiTable.getMirrorMid.replace("{mid}", orgId)}`, msg: { option: "" }, reducer: { name: "" }, }) +} + +export function putUpdateMid (orgId) { //编辑推送配置 + return (dispatch) => + basicAction({ + type: "put", + dispatch: dispatch, + actionType: "PUT_UPDATE_MID", + url: `${ApiTable.putUpdateMid.replace('{mirrorId}', orgId)}`, + msg: { option: '更新镜像服务ID' }, + reducer: {}, + }); } \ No newline at end of file diff --git a/code/VideoAccess-VCMP/web/client/src/sections/openness/containers/callService.jsx b/code/VideoAccess-VCMP/web/client/src/sections/openness/containers/callService.jsx index 06b4cd5..d1c70b2 100644 --- a/code/VideoAccess-VCMP/web/client/src/sections/openness/containers/callService.jsx +++ b/code/VideoAccess-VCMP/web/client/src/sections/openness/containers/callService.jsx @@ -2,12 +2,14 @@ import React, { useEffect, useState } from 'react'; import { connect } from 'react-redux'; import { tree } from './mirroringDetail'; import VideoScreen from '../components/videoScreen'; - +import { push } from 'react-router-redux'; +import qs from "qs"; +import { Notification } from '@douyinfe/semi-ui'; const CallService = (props) => { - const { dispatch, actions, user } = props + const { dispatch, actions, user, } = props const [treeData, setTreeData] = useState([]) //树形控件数据 const [headerName, setHeaderName] = useState('dfvbfdbe') const [showHeader, setShowHeader] = useState(true) //是否展示头部 @@ -16,32 +18,30 @@ const CallService = (props) => { const [videoPlay, setVideoPlay] = useState(true) //视频预览 useEffect(() => { - - - dispatch(actions.openness.getMirrorList()).then((res) => { - if (res?.success && res?.payload?.data?.some(v => v.mid == user?.mid)) { - dispatch(actions.openness.getMirrorMid(user?.mid)).then((r) => { - if (r?.success) { - let data = r?.payload?.data || {} - - let filterGrouplist =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 - } - } + const mid = qs.parse(props.location.search.slice(1))?.mid + dispatch(actions.openness.getMirrorMid(user?.mid || mid, { check: true })).then((r) => { + if (r?.success) { + let data = r?.payload?.data || {} + let filterGrouplist = 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 } - setTreeData(tree(data.tree)) - setHeaderName(data.title) - setShowHeader(data.showHeader) - setFilterGroup(filterGrouplist) - setTemplate(data.template) } - }) + } + setTreeData(tree(data.tree)) + setHeaderName(data.title) + setShowHeader(data.showHeader) + setFilterGroup(filterGrouplist) + setTemplate(data.template) } else { - dispatch(push('/callService')); + dispatch(push('/noMatch')) + Notification.error({ + content: '获取镜像服务失败', + duration: 3, + }) } }) diff --git a/code/VideoAccess-VCMP/web/client/src/sections/openness/containers/mirroring.jsx b/code/VideoAccess-VCMP/web/client/src/sections/openness/containers/mirroring.jsx index 52b2577..2c79eff 100644 --- a/code/VideoAccess-VCMP/web/client/src/sections/openness/containers/mirroring.jsx +++ b/code/VideoAccess-VCMP/web/client/src/sections/openness/containers/mirroring.jsx @@ -2,298 +2,332 @@ import React, { useEffect, useState, useRef } from 'react'; import { connect } from 'react-redux'; import { push } from 'react-router-redux'; import '../style.less' -import { Notification, Popconfirm } from "@douyinfe/semi-ui"; +import { Notification, Popconfirm, Modal } from "@douyinfe/semi-ui"; import copy from "copy-to-clipboard"; import moment from "moment"; +import { IconRefresh } from '@douyinfe/semi-icons'; const Mirroring = (props) => { - const { history, dispatch, actions, user, loading, StatusPushList } = props; - const { openness } = actions; - const detailList = useRef([ - { - title: '科技蓝', - img: '/assets/images/imageImg/textblue.png', - color: 'blue' - }, { - title: '静谧白', - img: '/assets/images/imageImg/textwhite.png', - color: 'white' - }, { - title: '神秘黑', - img: '/assets/images/imageImg/textblack.png', - color: 'black' - }, - ]); + const { history, dispatch, actions, user, loading, StatusPushList } = props; + const { openness } = actions; + const detailList = useRef([ + { + title: '科技蓝', + img: '/assets/images/imageImg/textblue.png', + color: 'blue' + }, { + title: '静谧白', + img: '/assets/images/imageImg/textwhite.png', + color: 'white' + }, { + title: '神秘黑', + img: '/assets/images/imageImg/textblack.png', + color: 'black' + }, + ]); - const [myCustomList, setMyCustomList] = useState([])//我的自定义镜像服务 - useEffect(() => { - getMirror() - }, []); - function getMirror () { - dispatch(openness.getMirrorList()).then((res) => { - setMyCustomList(res.payload.data) - }) - } - const [maskNum, setMaskNum] = useState(1000); - function mouseOver (index) {//鼠标移入 - setMaskNum(index) - } - function mouseOut () {//鼠标移开 - setMaskNum(1000) - } - function todetail (color) {//去模板内部 - dispatch(push('/mirroring_detail'+'?template='+color)); - } - function tomirrordetail(mid,template){ - dispatch(push('/mirroring_detail'+'?template='+template+'&mid='+mid)); - } - function todelete (id) {//删除我的自定义镜像服务 - dispatch(openness.delMirror(id)).then((res) => { - getMirror() - }) - } - function tocopy (id) { - dispatch(openness.putMirrorCopy(id)).then((res) => { - getMirror() - }) - } - function topublish(id){ - dispatch(openness.putMirrorPublish(id)).then((res) => { - getMirror() - }) - } - function getTime(date){ - if(date){ - let year = moment(date).year() + '-' - let month = (moment(date).month() + 1) > 10 ? (moment(date).month() + 1) + '-' : '0' + (moment(date).month() + 1) + '-' - let day = moment(date).date() > 10 ? moment(date).date() : '0' + moment(date).date(); - let hour = moment(date).hour() > 10 ? moment(date).hour() : '0' + moment(date).hour(); - let minute = moment(date).minute() > 10 ? moment(date).minute() : '0' + moment(date).minute(); - let second = moment(date).second() > 10 ? moment(date).second() : '0' + moment(date).second(); - return year + month+day + ' ' + hour + ':' + minute + ':' + second - } - else{ - return '' - } - } - return ( - <> -