From e62633981a832410ed6057eb905b029c71554cd4 Mon Sep 17 00:00:00 2001 From: wenlele Date: Mon, 22 Aug 2022 11:02:08 +0800 Subject: [PATCH] =?UTF-8?q?basicAction=E5=BC=95=E5=85=A5=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../application/actions/application.js | 3 +- .../equipmentWarehouse/actions/camera.js | 3 +- .../src/sections/example/actions/example.js | 3 +- .../journaling/components/videoScreen.jsx | 79 ++++++++++--------- .../sections/offline/actions/carrierpigeon.js | 3 +- .../sections/offline/actions/statuscode.js | 3 +- code/VideoAccess-VCMP/web/readme.md | 3 +- 7 files changed, 47 insertions(+), 50 deletions(-) diff --git a/code/VideoAccess-VCMP/web/client/src/sections/application/actions/application.js b/code/VideoAccess-VCMP/web/client/src/sections/application/actions/application.js index e0fb457..3279729 100644 --- a/code/VideoAccess-VCMP/web/client/src/sections/application/actions/application.js +++ b/code/VideoAccess-VCMP/web/client/src/sections/application/actions/application.js @@ -1,7 +1,6 @@ "use strict"; -import { basicAction } from "@peace/utils"; -import { ApiTable } from "$utils"; +import { ApiTable,basicAction } from "$utils"; export function getApplication (query) { return (dispatch) => diff --git a/code/VideoAccess-VCMP/web/client/src/sections/equipmentWarehouse/actions/camera.js b/code/VideoAccess-VCMP/web/client/src/sections/equipmentWarehouse/actions/camera.js index cfface6..3d25b6a 100644 --- a/code/VideoAccess-VCMP/web/client/src/sections/equipmentWarehouse/actions/camera.js +++ b/code/VideoAccess-VCMP/web/client/src/sections/equipmentWarehouse/actions/camera.js @@ -1,7 +1,6 @@ "use strict"; -import { basicAction } from "@peace/utils"; -import { ApiTable } from "$utils"; +import { ApiTable,basicAction } from "$utils"; export function getCamera(query) { return (dispatch) => diff --git a/code/VideoAccess-VCMP/web/client/src/sections/example/actions/example.js b/code/VideoAccess-VCMP/web/client/src/sections/example/actions/example.js index 367fa0e..01ebbae 100644 --- a/code/VideoAccess-VCMP/web/client/src/sections/example/actions/example.js +++ b/code/VideoAccess-VCMP/web/client/src/sections/example/actions/example.js @@ -1,7 +1,6 @@ 'use strict'; -import { basicAction } from '@peace/utils' -import { ApiTable } from '$utils' +import { ApiTable ,basicAction} from '$utils' export function getMembers (orgId) { return dispatch => basicAction({ diff --git a/code/VideoAccess-VCMP/web/client/src/sections/journaling/components/videoScreen.jsx b/code/VideoAccess-VCMP/web/client/src/sections/journaling/components/videoScreen.jsx index be57b9f..71d96a5 100644 --- a/code/VideoAccess-VCMP/web/client/src/sections/journaling/components/videoScreen.jsx +++ b/code/VideoAccess-VCMP/web/client/src/sections/journaling/components/videoScreen.jsx @@ -6,43 +6,6 @@ import VideoCard from './videoCard' const VideoScreen = (props) => { - const [pageSize, setPageSize] = useState(4) //每页视频数量 - const [queryData, setQueryData] = useState([{ label: '全部', value: '全部', key: '0' }]) //查询树状数据 - const [leftTree, setLefTtree] = useState([{ label: '全部', value: '全部', key: '0' }]) //左侧树状数据 - const [playData, setPlayData] = useState([]) //视频数据 - const [queryValue, setQueryValue] = useState(['全部']) //查询条件 - const [leftValue, setLeftValue] = useState() // - - const api = useRef(); - - useEffect(() => { - let query = [] - treeData?.map(v => [ - query.push({ label: v.label, value: v.value, key: v.key }) - ]) - setQueryData([{ label: '全部', value: '全部', key: '0', children: query }]) - - }, []) - - useEffect(() => { - if (treeData && queryValue.includes('全部')) { - setLefTtree(treeData) - } else { - let leftData = [] - queryValue.map(item => leftData.push(treeData?.find(({ value }) => item == value))) //获取左侧树状数据 - setLefTtree([{ label: '全部', value: '全部', key: '0', children: leftData }]) - } - - - }, [queryData, queryValue]) - - - useEffect(() => { - - setLeftValue() - }, []) - - const treeData = [{ label: '公司', value: '公司', @@ -102,7 +65,7 @@ const VideoScreen = (props) => { content: ['5442542542', '452345', '234524525'], serialNo: "F61504020", type: "yingshi", - yingshiToken: "at.7pl4c5orb9fpndtlbjpsn5m11szujnf7-1laxxre0ob-010o8fw-kqeuwthva" + yingshiToken: "at.7pl4c5orb9fpndtlbjpsn5m11szujnf7-1laxxre0ob-010o8fw-kqeuwthva", } }, ] @@ -128,6 +91,43 @@ const VideoScreen = (props) => { ] }] + const [pageSize, setPageSize] = useState(4) //每页视频数量 + const [queryData, setQueryData] = useState([{ label: '全部', value: '全部', key: '0' }]) //查询树状数据 + const [leftTree, setLefTtree] = useState([{ label: '全部', value: '全部', key: '0', children: treeData}]) //左侧树状数据 + const [playData, setPlayData] = useState([]) //视频数据 + const [queryValue, setQueryValue] = useState(['全部']) //查询条件 + const [leftValue, setLeftValue] = useState() // + + const api = useRef(); + + useEffect(() => { + let query = [] + treeData?.map(v => [ + query.push({ label: v.label, value: v.value, key: v.key }) + ]) + setQueryData([{ label: '全部', value: '全部', key: '0', children: query }]) + }, []) + + useEffect(() => { + if (treeData && queryValue.includes('全部')) { + setLefTtree(treeData) + } else { + let leftData = [] + queryValue.map(item => leftData.push(treeData?.find(({ value }) => item == value))) //获取左侧树状数据 + setLefTtree([{ label: '全部', value: '全部', key: '0', children: leftData }]) + } + + + }, [queryData, queryValue]) + + + useEffect(() => { + setLeftValue() + }, []) + + + + //搜索条件赛选样式 const screen = { width: 193, marginRight: 20, marginBottom: 16, color: "#fff", }; @@ -214,6 +214,9 @@ const VideoScreen = (props) => { console.log(e); setLeftValue(e) }} + onSelect={(e)=>{ + console.log(e); + }} style={{ width: 150, color: '#FFFFFF' }} /> diff --git a/code/VideoAccess-VCMP/web/client/src/sections/offline/actions/carrierpigeon.js b/code/VideoAccess-VCMP/web/client/src/sections/offline/actions/carrierpigeon.js index 1d3147b..680751f 100644 --- a/code/VideoAccess-VCMP/web/client/src/sections/offline/actions/carrierpigeon.js +++ b/code/VideoAccess-VCMP/web/client/src/sections/offline/actions/carrierpigeon.js @@ -1,7 +1,6 @@ "use strict"; -import { basicAction } from "@peace/utils"; -import { ApiTable } from "$utils"; + import { ApiTable,basicAction } from "$utils"; export function getCameraListAll() {//获取摄像头能力列表 return (dispatch) => diff --git a/code/VideoAccess-VCMP/web/client/src/sections/offline/actions/statuscode.js b/code/VideoAccess-VCMP/web/client/src/sections/offline/actions/statuscode.js index 8539f07..800013d 100644 --- a/code/VideoAccess-VCMP/web/client/src/sections/offline/actions/statuscode.js +++ b/code/VideoAccess-VCMP/web/client/src/sections/offline/actions/statuscode.js @@ -1,7 +1,6 @@ "use strict"; -import { basicAction } from "@peace/utils"; -import { ApiTable } from "$utils"; +import { ApiTable,basicAction } from "$utils"; export function getStatus(query) { return (dispatch) => diff --git a/code/VideoAccess-VCMP/web/readme.md b/code/VideoAccess-VCMP/web/readme.md index 69f86da..6204d4d 100644 --- a/code/VideoAccess-VCMP/web/readme.md +++ b/code/VideoAccess-VCMP/web/readme.md @@ -116,8 +116,7 @@ ``` js 'use strict'; - import { basicAction } from '@peace/utils' - import { ApiTable } from '$utils' + import { ApiTable ,basicAction} from '$utils' export function getMembers(orgId) { return dispatch => basicAction({