diff --git a/code/VideoAccess-VCMP/api/app/lib/controllers/mirror/index.js b/code/VideoAccess-VCMP/api/app/lib/controllers/mirror/index.js index b705faf..b237b42 100644 --- a/code/VideoAccess-VCMP/api/app/lib/controllers/mirror/index.js +++ b/code/VideoAccess-VCMP/api/app/lib/controllers/mirror/index.js @@ -9,7 +9,7 @@ async function edit (ctx) { const { userId } = ctx.fs.api const data = ctx.request.body const timeNow = moment() - const { mirrorId, tree = [], filterGroup = [] } = data + const { mirrorId, tree = [], filterGroup = [], listOpen = false } = data let mirrorId_ = mirrorId if (mirrorId_) { @@ -18,6 +18,7 @@ async function edit (ctx) { updateTime: timeNow.format(), title: data.title, showHeader: Boolean(data.showHeader), + listOpen:listOpen } if (data.publish) { upData.publish = true @@ -62,7 +63,8 @@ async function edit (ctx) { title: data.title, showHeader: Boolean(data.showHeader), 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) { createData.publish = true diff --git a/code/VideoAccess-VCMP/api/app/lib/models/mirror.js b/code/VideoAccess-VCMP/api/app/lib/models/mirror.js index a15e004..909a4f5 100644 --- a/code/VideoAccess-VCMP/api/app/lib/models/mirror.js +++ b/code/VideoAccess-VCMP/api/app/lib/models/mirror.js @@ -69,6 +69,15 @@ module.exports = dc => { field: "show_header", autoIncrement: false }, + listOpen: { + type: DataTypes.BOOLEAN, + allowNull: false, + defaultValue: null, + comment: null, + primaryKey: false, + field: "list_open", + autoIncrement: false + }, publish: { type: DataTypes.BOOLEAN, allowNull: false, diff --git a/code/VideoAccess-VCMP/script/1.3.6/achema/1.update_mirror.sql b/code/VideoAccess-VCMP/script/1.3.6/achema/1.update_mirror.sql new file mode 100644 index 0000000..36596ec --- /dev/null +++ b/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 '镜像大屏列表是否折叠'; \ No newline at end of file diff --git a/code/VideoAccess-VCMP/web/client/src/sections/openness/components/videoScreen.jsx b/code/VideoAccess-VCMP/web/client/src/sections/openness/components/videoScreen.jsx index f71c0e4..3b4db65 100644 --- a/code/VideoAccess-VCMP/web/client/src/sections/openness/components/videoScreen.jsx +++ b/code/VideoAccess-VCMP/web/client/src/sections/openness/components/videoScreen.jsx @@ -8,7 +8,7 @@ import PerfectScrollbar from "perfect-scrollbar"; let timing let projectScrollbar; -const VideoScreen = ({ treeData, filterGroup, videoPlay, template, headerName, showHeader }) => { +const VideoScreen = ({ treeData, filterGroup, videoPlay, template, headerName, showHeader, listOpen }) => { // console.log('视频信息', treeData); // console.log('筛选组', filterGroup); // console.log(headerName); @@ -362,8 +362,8 @@ const VideoScreen = ({ treeData, filterGroup, videoPlay, template, headerName, s treeData={leftTree} value={leftValue} blockNode={false} - defaultExpandAll={true} - expandAll={true} + defaultExpandAll={listOpen ? true : false} + expandAll={listOpen ? true : false} // labelEllipsis={true} onChange={(e) => { // console.log(e); 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 ce0a1d8..d47412e 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 @@ -16,10 +16,13 @@ const CallService = (props) => { const [filterGroup, setFilterGroup] = useState([]) //筛选项数据 const [template, setTemplate] = useState('') //主题颜色 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 - 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) { let data = r?.payload?.data || {} let filterGrouplist = data.filterGroup @@ -34,6 +37,7 @@ const CallService = (props) => { setTreeData(tree(data.tree)) setHeaderName(data.title) setShowHeader(data.showHeader) + setlistOpen(data.listOpen || false) setFilterGroup(filterGrouplist) setTemplate(data.template) } else { @@ -44,19 +48,20 @@ const CallService = (props) => { }) } }) - + setLoading(true) }, []) return (
- {treeData ? : ""}
) diff --git a/code/VideoAccess-VCMP/web/client/src/sections/openness/containers/mirroringDetail.jsx b/code/VideoAccess-VCMP/web/client/src/sections/openness/containers/mirroringDetail.jsx index b9653b1..4c7525d 100644 --- a/code/VideoAccess-VCMP/web/client/src/sections/openness/containers/mirroringDetail.jsx +++ b/code/VideoAccess-VCMP/web/client/src/sections/openness/containers/mirroringDetail.jsx @@ -81,6 +81,7 @@ const MirroringDetail = (props) => { setFilterGroup(filterGrouplist); setMirrorId(res.payload.data.id);//id setShowHeader(res.payload.data.showHeader); + setlistOpen(res.payload.data.listOpen||false) setHeaderName(res.payload.data.title); let mytreeDatas= tree(res.payload.data.tree) @@ -91,6 +92,8 @@ const MirroringDetail = (props) => { }, []); const [hasModify, sethasModify] = useState(false)//有没有进行修改 const [showHeader, setShowHeader] = useState(false)//是否展示头部 + const [listOpen, setlistOpen] = useState(false)//是否展开列表 + const [mirrorId, setMirrorId] = useState(null)//id const [backVisible, setBackVisible] = useState(false)//返回上一页是否修改过 @@ -229,7 +232,8 @@ const MirroringDetail = (props) => { showHeader: showHeader, publish: publish, tree: treeData, - filterGroup: filterGroup + filterGroup: filterGroup, + listOpen:listOpen } dispatch(openness.putMirror(mirrordata)).then((res) => { if (res.success) { @@ -1091,6 +1095,15 @@ const MirroringDetail = (props) => {
header
{ setShowHeader(v); sethasModify(true) }} size="small" aria-label="是否有头部">
+
+
列表默认展开
+
+ { + setlistOpen(v) + sethasModify(true) + }} size="small" aria-label=""> +
+
{ setComingVisible(true) }}>
自定义样式
@@ -1271,7 +1284,7 @@ const MirroringDetail = (props) => { }
- +