Browse Source

镜像大屏列表是否展示

dev_trial
wenlele 2 years ago
parent
commit
1ff85c71f0
  1. 6
      code/VideoAccess-VCMP/api/app/lib/controllers/mirror/index.js
  2. 9
      code/VideoAccess-VCMP/api/app/lib/models/mirror.js
  3. 4
      code/VideoAccess-VCMP/script/1.3.6/achema/1.update_mirror.sql
  4. 6
      code/VideoAccess-VCMP/web/client/src/sections/openness/components/videoScreen.jsx
  5. 13
      code/VideoAccess-VCMP/web/client/src/sections/openness/containers/callService.jsx
  6. 17
      code/VideoAccess-VCMP/web/client/src/sections/openness/containers/mirroringDetail.jsx
  7. 2
      code/VideoAccess-VCMP/web/package.json

6
code/VideoAccess-VCMP/api/app/lib/controllers/mirror/index.js

@ -9,7 +9,7 @@ async function edit (ctx) {
const { userId } = ctx.fs.api const { userId } = ctx.fs.api
const data = ctx.request.body const data = ctx.request.body
const timeNow = moment() const timeNow = moment()
const { mirrorId, tree = [], filterGroup = [] } = data const { mirrorId, tree = [], filterGroup = [], listOpen = false } = data
let mirrorId_ = mirrorId let mirrorId_ = mirrorId
if (mirrorId_) { if (mirrorId_) {
@ -18,6 +18,7 @@ async function edit (ctx) {
updateTime: timeNow.format(), updateTime: timeNow.format(),
title: data.title, title: data.title,
showHeader: Boolean(data.showHeader), showHeader: Boolean(data.showHeader),
listOpen:listOpen
} }
if (data.publish) { if (data.publish) {
upData.publish = true upData.publish = true
@ -62,7 +63,8 @@ async function edit (ctx) {
title: data.title, title: data.title,
showHeader: Boolean(data.showHeader), showHeader: Boolean(data.showHeader),
publish: false, publish: false,
mid: timeNow.format(`ssmmHHDDMMYY${Math.floor(Math.random() * 89 + 10)}`) mid: timeNow.format(`ssmmHHDDMMYY${Math.floor(Math.random() * 89 + 10)}`),
listOpen: listOpen
} }
if (data.publish) { if (data.publish) {
createData.publish = true createData.publish = true

9
code/VideoAccess-VCMP/api/app/lib/models/mirror.js

@ -69,6 +69,15 @@ module.exports = dc => {
field: "show_header", field: "show_header",
autoIncrement: false autoIncrement: false
}, },
listOpen: {
type: DataTypes.BOOLEAN,
allowNull: false,
defaultValue: null,
comment: null,
primaryKey: false,
field: "list_open",
autoIncrement: false
},
publish: { publish: {
type: DataTypes.BOOLEAN, type: DataTypes.BOOLEAN,
allowNull: false, allowNull: false,

4
code/VideoAccess-VCMP/script/1.3.6/achema/1.update_mirror.sql

@ -0,0 +1,4 @@
alter table mirror
add list_open boolean;
comment on column mirror.list_open is '镜像大屏列表是否折叠';

6
code/VideoAccess-VCMP/web/client/src/sections/openness/components/videoScreen.jsx

@ -8,7 +8,7 @@ import PerfectScrollbar from "perfect-scrollbar";
let timing let timing
let projectScrollbar; let projectScrollbar;
const VideoScreen = ({ treeData, filterGroup, videoPlay, template, headerName, showHeader }) => { const VideoScreen = ({ treeData, filterGroup, videoPlay, template, headerName, showHeader, listOpen }) => {
// console.log('', treeData); // console.log('', treeData);
// console.log('', filterGroup); // console.log('', filterGroup);
// console.log(headerName); // console.log(headerName);
@ -362,8 +362,8 @@ const VideoScreen = ({ treeData, filterGroup, videoPlay, template, headerName, s
treeData={leftTree} treeData={leftTree}
value={leftValue} value={leftValue}
blockNode={false} blockNode={false}
defaultExpandAll={true} defaultExpandAll={listOpen ? true : false}
expandAll={true} expandAll={listOpen ? true : false}
// labelEllipsis={true} // labelEllipsis={true}
onChange={(e) => { onChange={(e) => {
// console.log(e); // console.log(e);

13
code/VideoAccess-VCMP/web/client/src/sections/openness/containers/callService.jsx

@ -16,10 +16,13 @@ const CallService = (props) => {
const [filterGroup, setFilterGroup] = useState([]) // const [filterGroup, setFilterGroup] = useState([]) //
const [template, setTemplate] = useState('') // const [template, setTemplate] = useState('') //
const [videoPlay, setVideoPlay] = useState(true) // const [videoPlay, setVideoPlay] = useState(true) //
const [listOpen, setlistOpen] = useState(false)//
const [loading, setLoading] = useState(false)
useEffect(() => {
useEffect(async () => {
const mid = qs.parse(props.location.search.slice(1))?.mid const mid = qs.parse(props.location.search.slice(1))?.mid
dispatch(actions.openness.getMirrorMid(user?.mid || mid, { check: true })).then((r) => { await dispatch(actions.openness.getMirrorMid(user?.mid || mid, { check: true })).then((r) => {
if (r?.success) { if (r?.success) {
let data = r?.payload?.data || {} let data = r?.payload?.data || {}
let filterGrouplist = data.filterGroup let filterGrouplist = data.filterGroup
@ -34,6 +37,7 @@ const CallService = (props) => {
setTreeData(tree(data.tree)) setTreeData(tree(data.tree))
setHeaderName(data.title) setHeaderName(data.title)
setShowHeader(data.showHeader) setShowHeader(data.showHeader)
setlistOpen(data.listOpen || false)
setFilterGroup(filterGrouplist) setFilterGroup(filterGrouplist)
setTemplate(data.template) setTemplate(data.template)
} else { } else {
@ -44,19 +48,20 @@ const CallService = (props) => {
}) })
} }
}) })
setLoading(true)
}, []) }, [])
return ( return (
<div style={{ width: '100%', height: '100%' }}> <div style={{ width: '100%', height: '100%' }}>
{treeData ? <VideoScreen {treeData && loading ? <VideoScreen
treeData={treeData} treeData={treeData}
headerName={headerName} headerName={headerName}
showHeader={showHeader} showHeader={showHeader}
filterGroup={filterGroup} filterGroup={filterGroup}
template={template} template={template}
listOpen={listOpen}
videoPlay={videoPlay} /> : ""} videoPlay={videoPlay} /> : ""}
</div> </div>
) )

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

@ -81,6 +81,7 @@ const MirroringDetail = (props) => {
setFilterGroup(filterGrouplist); setFilterGroup(filterGrouplist);
setMirrorId(res.payload.data.id);//id setMirrorId(res.payload.data.id);//id
setShowHeader(res.payload.data.showHeader); setShowHeader(res.payload.data.showHeader);
setlistOpen(res.payload.data.listOpen||false)
setHeaderName(res.payload.data.title); setHeaderName(res.payload.data.title);
let mytreeDatas= tree(res.payload.data.tree) let mytreeDatas= tree(res.payload.data.tree)
@ -91,6 +92,8 @@ const MirroringDetail = (props) => {
}, []); }, []);
const [hasModify, sethasModify] = useState(false)// const [hasModify, sethasModify] = useState(false)//
const [showHeader, setShowHeader] = useState(false)// const [showHeader, setShowHeader] = useState(false)//
const [listOpen, setlistOpen] = useState(false)//
const [mirrorId, setMirrorId] = useState(null)//id const [mirrorId, setMirrorId] = useState(null)//id
const [backVisible, setBackVisible] = useState(false)// const [backVisible, setBackVisible] = useState(false)//
@ -229,7 +232,8 @@ const MirroringDetail = (props) => {
showHeader: showHeader, showHeader: showHeader,
publish: publish, publish: publish,
tree: treeData, tree: treeData,
filterGroup: filterGroup filterGroup: filterGroup,
listOpen:listOpen
} }
dispatch(openness.putMirror(mirrordata)).then((res) => { dispatch(openness.putMirror(mirrordata)).then((res) => {
if (res.success) { if (res.success) {
@ -1091,6 +1095,15 @@ const MirroringDetail = (props) => {
<div style={{ marginLeft: 20 }}>header</div> <div style={{ marginLeft: 20 }}>header</div>
<div style={{ marginRight: 13 }}><Switch checked={showHeader} onChange={(v, e) => { setShowHeader(v); sethasModify(true) }} size="small" aria-label="是否有头部"></Switch></div> <div style={{ marginRight: 13 }}><Switch checked={showHeader} onChange={(v, e) => { setShowHeader(v); sethasModify(true) }} 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' }}>
<div style={{ marginLeft: 20 }}>列表默认展开</div>
<div style={{ marginRight: 13 }}>
<Switch checked={listOpen} onChange={(v, e) => {
setlistOpen(v)
sethasModify(true)
}} size="small" aria-label="">
</Switch></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>
<div style={{ marginRight: 13, width: 9, height: 5, display: 'flex', alignItems: 'center', }}> <div style={{ marginRight: 13, width: 9, height: 5, display: 'flex', alignItems: 'center', }}>
@ -1271,7 +1284,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} listOpen={listOpen} showHeader={showHeader} filterGroup={filterGroup} template={template} videoPlay={videoPlay} />
</div> </div>
</div> </div>
<Modal <Modal

2
code/VideoAccess-VCMP/web/package.json

@ -30,7 +30,7 @@
"connected-react-router": "^6.8.0", "connected-react-router": "^6.8.0",
"css-loader": "^3.5.0", "css-loader": "^3.5.0",
"express": "^4.17.1", "express": "^4.17.1",
"file-loader": "^6.0.0", "perfect-scrollbar": "^6.0.0",
"html-webpack-plugin": "^4.5.0", "html-webpack-plugin": "^4.5.0",
"immutable": "^4.0.0-rc.12", "immutable": "^4.0.0-rc.12",
"less": "^3.12.2", "less": "^3.12.2",

Loading…
Cancel
Save