From a15fb7be510715567d8d6152a56d52ad52f88322 Mon Sep 17 00:00:00 2001 From: "gao.zhiyuan" Date: Wed, 15 Jun 2022 18:41:42 +0800 Subject: [PATCH] =?UTF-8?q?=E7=99=BB=E5=87=BA=E3=80=81=E9=85=8D=E7=BD=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../api/app/lib/controllers/camera/index.js | 32 ++++++++++++------- .../web/client/src/components/videoPlay.jsx | 9 ++++-- .../web/client/src/layout/index.jsx | 2 +- .../client/src/sections/auth/actions/auth.js | 2 +- .../equipmentWarehouse/containers/camera.jsx | 2 +- code/VideoAccess-VCMP/web/package.json | 2 +- 6 files changed, 31 insertions(+), 18 deletions(-) diff --git a/code/VideoAccess-VCMP/api/app/lib/controllers/camera/index.js b/code/VideoAccess-VCMP/api/app/lib/controllers/camera/index.js index 7a65903..5b50a48 100644 --- a/code/VideoAccess-VCMP/api/app/lib/controllers/camera/index.js +++ b/code/VideoAccess-VCMP/api/app/lib/controllers/camera/index.js @@ -22,9 +22,13 @@ async function getCameraProject (ctx, next) { model: models.CameraKind }, { model: models.Nvr, + where: nvrId ? { + id: nvrId + } : {}, required: Boolean(nvrId), attributes: ['id', 'name', 'serialNo'] - }] + }], + distinct: true } let abilityFind = { model: models.CameraAbility @@ -36,14 +40,15 @@ async function getCameraProject (ctx, next) { findOption.offset = page * limit } if (keyword) { - findOption.where.$or = [ - { - name: { $like: `%${keyword}%` } - }, - // { - // serialNo: { $like: `%${keyword}%` } - // } - ] + findOption.where.name = { $like: `%${keyword}%` } + // findOption.where.$or = [ + // { + // name: { $like: `%${keyword}%` } + // }, + // // { + // // serialNo: { $like: `%${keyword}%` } + // // } + // ] } if (type) { findOption.where.type = type @@ -62,9 +67,12 @@ async function getCameraProject (ctx, next) { findOption.include.push(abilityFind) const cameraRes = await models.Camera.findAll(findOption) - const total = await models.Camera.count({ - where: findOption.where - }) + + delete findOption.order + delete findOption.limit + delete findOption.offset + delete findOption.attributes + const total = await models.Camera.count(findOption) let cameraIds = [] let createUserIds = new Set() diff --git a/code/VideoAccess-VCMP/web/client/src/components/videoPlay.jsx b/code/VideoAccess-VCMP/web/client/src/components/videoPlay.jsx index e6a8f42..811ca0e 100644 --- a/code/VideoAccess-VCMP/web/client/src/components/videoPlay.jsx +++ b/code/VideoAccess-VCMP/web/client/src/components/videoPlay.jsx @@ -12,7 +12,12 @@ const VideoPlay = ({ height, width }) => { const [operationState, setoperationState] = useState() const operation = [{ key: 'control', - click: () => { console.log(121212); } + click: () => { + console.log(object); + const nextOperationState = JSON.parse(JSON.stringify(operationState)) + nextOperationState['control'].select = !nextOperationState['control'].select + setoperationState(nextOperationState) + } }, { key: 'talk', click: () => { console.log(121212); } @@ -98,7 +103,7 @@ const VideoPlay = ({ height, width }) => { }}>123
- +
diff --git a/code/VideoAccess-VCMP/web/client/src/layout/index.jsx b/code/VideoAccess-VCMP/web/client/src/layout/index.jsx index 9e34ef3..8fd0559 100644 --- a/code/VideoAccess-VCMP/web/client/src/layout/index.jsx +++ b/code/VideoAccess-VCMP/web/client/src/layout/index.jsx @@ -163,7 +163,7 @@ const Root = props => { setAuthCrossLoading(false) }); - setAuthCrossLoading(false) + // setAuthCrossLoading(false) }, []) return ( diff --git a/code/VideoAccess-VCMP/web/client/src/sections/auth/actions/auth.js b/code/VideoAccess-VCMP/web/client/src/sections/auth/actions/auth.js index 536a274..d1fdf11 100644 --- a/code/VideoAccess-VCMP/web/client/src/sections/auth/actions/auth.js +++ b/code/VideoAccess-VCMP/web/client/src/sections/auth/actions/auth.js @@ -64,7 +64,7 @@ export function login (username, password) { export const LOGOUT = 'LOGOUT'; export function logout () { const user = JSON.parse(sessionStorage.getItem('user')) - AxyRequest.put(ApiTable.logout, { + AxyRequest.post(ApiTable.logout, { token: user.token }); sessionStorage.removeItem('user'); diff --git a/code/VideoAccess-VCMP/web/client/src/sections/equipmentWarehouse/containers/camera.jsx b/code/VideoAccess-VCMP/web/client/src/sections/equipmentWarehouse/containers/camera.jsx index 45525c1..f773f44 100644 --- a/code/VideoAccess-VCMP/web/client/src/sections/equipmentWarehouse/containers/camera.jsx +++ b/code/VideoAccess-VCMP/web/client/src/sections/equipmentWarehouse/containers/camera.jsx @@ -699,7 +699,7 @@ const CameraHeader = (props) => { "" )} { - // + } ); diff --git a/code/VideoAccess-VCMP/web/package.json b/code/VideoAccess-VCMP/web/package.json index edd6de2..bc40472 100644 --- a/code/VideoAccess-VCMP/web/package.json +++ b/code/VideoAccess-VCMP/web/package.json @@ -7,7 +7,7 @@ "test": "mocha", "start-vite": "cross-env NODE_ENV=developmentVite npm run start-params", "start": "cross-env NODE_ENV=development npm run start-params", - "start-params": "node server -p 5000 -u http://10.8.30.7:4000 --apiAuthUrl http://10.8.30.7:4200 --apiAnxinyunUrl http://10.8.30.7:4100 --iotAuthWeb http://10.8.30.7:5200", + "start-params": "node server -p 5000 -u http://10.8.30.7:4000 --apiAuthUrl http://10.8.30.7:4200 --apiAnxinyunUrl http://10.8.30.7:4100 --iotAuthWeb http://localhost:5200", "deploy": "export NODE_ENV=production&& npm run build && node server", "build-dev": "cross-env NODE_ENV=development&&webpack --config webpack.config.js", "build": "export NODE_ENV=production&&webpack --config webpack.config.prod.js"