Browse Source

应用管理页面数据接入完成

release_1.2.1
wenlele 3 years ago
parent
commit
33d19ed200
  1. 55
      code/VideoAccess-VCMP/api/app/lib/controllers/application/index.js
  2. 76
      code/VideoAccess-VCMP/web/client/src/sections/application/actions/application.js
  3. 140
      code/VideoAccess-VCMP/web/client/src/sections/application/components/applyModal.jsx
  4. 679
      code/VideoAccess-VCMP/web/client/src/sections/application/containers/applicationCenter.jsx
  5. 1
      code/VideoAccess-VCMP/web/client/src/sections/equipmentWarehouse/components/nvrModal.jsx
  6. 33
      code/VideoAccess-VCMP/web/client/src/utils/webapi.js

55
code/VideoAccess-VCMP/api/app/lib/controllers/application/index.js

@ -29,14 +29,24 @@ async function check (ctx) {
} }
async function edit (ctx, next) { async function edit (ctx, next) {
let errMsg = '创建应用失败'
const transaction = await ctx.fs.dc.orm.transaction(); const transaction = await ctx.fs.dc.orm.transaction();
try { try {
const { models } = ctx.fs.dc; const { models } = ctx.fs.dc;
const { userId } = ctx.fs.api const { userId } = ctx.fs.api
const data = ctx.request.body; const data = ctx.request.body;
if (data.id) { let findOption = { where: { name: data.name } }
if (data.appId) {
findOption.where.id = { $ne: data.appId }
}
const applicationRes = await models.Application.findOne(findOption)
if (applicationRes) {
throw '已有相同应用名称'
}
if (data.appId) {
// 修改 // 修改
const storageData = Object.assign({}, data,) const storageData = Object.assign({}, data,)
await models.Application.update(storageData, { await models.Application.update(storageData, {
@ -66,7 +76,7 @@ async function edit (ctx, next) {
ctx.fs.logger.error(`path: ${ctx.path}, error: ${error}`); ctx.fs.logger.error(`path: ${ctx.path}, error: ${error}`);
ctx.status = 400; ctx.status = 400;
ctx.body = { ctx.body = {
message: errMsg message: typeof error == 'string' ? error : undefined
} }
} }
} }
@ -74,11 +84,11 @@ async function edit (ctx, next) {
async function get (ctx) { async function get (ctx) {
try { try {
const models = ctx.fs.dc.models; const models = ctx.fs.dc.models;
const { userId } = ctx.fs.api const { userId, token } = ctx.fs.api
const { limit, page, orderBy, orderDirection } = ctx.query const { limit, page, orderBy, orderDirection } = ctx.query
let findOption = { let findOption = {
where: { where: {
createUserId: userId, // createUserId: userId,
}, },
order: [ order: [
[orderBy || 'id', orderDirection || 'DESC'] //查询排序 [orderBy || 'id', orderDirection || 'DESC'] //查询排序
@ -91,12 +101,30 @@ async function get (ctx) {
if (page && limit) { if (page && limit) {
findOption.offset = page * limit findOption.offset = page * limit
} }
const nvrRes = await models.Application.findAndCountAll(findOption) const applicationRes = await models.Application.findAndCountAll(findOption)
let createUserIds = new Set()
let cameraIds = []
for (let c of applicationRes.rows) {
cameraIds.push(c.id)
createUserIds.add(c.createUserId)
}
// 查用户信息
const createUserRes = await ctx.app.fs.authRequest.get(`user/${[...createUserIds].join(',') || -1}/message`, { query: { token } })
for (let { dataValues: n } of applicationRes.rows) {
const corCreateUser = createUserRes.find(u => u.id == n.createUserId)
n.createUser = {
name: corCreateUser ? corCreateUser.username : ''
}
}
ctx.status = 200; ctx.status = 200;
ctx.body = { ctx.body = {
total: nvrRes.count, total: applicationRes.count,
data: nvrRes.rows data: applicationRes.rows
} }
} catch (error) { } catch (error) {
ctx.fs.logger.error(`path: ${ctx.path}, error: ${error}`); ctx.fs.logger.error(`path: ${ctx.path}, error: ${error}`);
@ -133,8 +161,15 @@ async function del (ctx, next) {
const transaction = await ctx.fs.dc.orm.transaction(); const transaction = await ctx.fs.dc.orm.transaction();
try { try {
const models = ctx.fs.dc.models; const models = ctx.fs.dc.models;
const { token } = ctx.fs.api
const { appId } = ctx.params const { appId } = ctx.params
const { appKey } = await models.Application.findOne({
where: {
id: appId
},
}) || {}
await models.Application.destroy({ await models.Application.destroy({
where: { where: {
id: appId id: appId
@ -142,6 +177,10 @@ async function del (ctx, next) {
transaction transaction
}) })
await ctx.app.fs.authRequest.delete(`oauth2/token/invalidate_all`, {
query: { token, appKey }
})
await transaction.commit(); await transaction.commit();
ctx.status = 204; ctx.status = 204;
} catch (error) { } catch (error) {

76
code/VideoAccess-VCMP/web/client/src/sections/application/actions/application.js

@ -3,40 +3,52 @@
import { basicAction } from "@peace/utils"; import { basicAction } from "@peace/utils";
import { ApiTable } from "$utils"; import { ApiTable } from "$utils";
export function getCamera(query) { export function getApplication (query) {
return (dispatch) => return (dispatch) =>
basicAction({ basicAction({
type: "get", type: "get",
dispatch: dispatch, dispatch: dispatch,
actionType: "GET_APPLICATION", actionType: "GET_APPLICATION",
query: query, query: query,
url: `${ApiTable.getCamera}`, url: `${ApiTable.getApplication}`,
msg: { option: "获取摄像头列表信息" }, msg: { option: "获取应用信息" },
reducer: { name: "applicationData", params: { noClear: true } }, reducer: { name: "applicationData", params: { noClear: true } },
}); });
} }
export function putForbidden(data, forbidden) { export function putApplication (data) {
return (dispatch) => return (dispatch) =>
basicAction({ basicAction({
type: "put", type: "put",
dispatch: dispatch, dispatch: dispatch,
actionType: "PUT_APPLICATION", actionType: "PUT_APPLICATION",
data, data,
url: `${ApiTable.putForbidden}`, url: `${ApiTable.putApplication}`,
msg: { option: forbidden ? "启用" : "禁用" }, //禁用摄像头 msg: { option: data?.forbidden ? "启用" : "禁用" }, //禁用摄像头
reducer: {}, reducer: {},
}); });
} }
export function delCamera(orgId) { export function delApplication (orgId) {
return (dispatch) => return (dispatch) =>
basicAction({ basicAction({
type: "del", type: "del",
dispatch: dispatch, dispatch: dispatch,
actionType: "DEL_APPLICATION", actionType: "DEL_APPLICATION",
url: `${ApiTable.delCamera.replace("{cameraId}", orgId)}`, url: `${ApiTable.delApplication.replace("{appId}", orgId)}`,
msg: { option: "设备会被存放在“设备回收站”中,删除" }, //删除摄像头 msg: { option: "删除" }, //删除应用
reducer: {}, reducer: {},
}); });
}
export function postApplication (data) {
return (dispatch) =>
basicAction({
type: "post",
dispatch: dispatch,
data,
actionType: "POST_CHANGE_NVR",
msg: { option: data?.appId ? "修改" : "添加" },
url: `${ApiTable.postApplication}`,
});
} }

140
code/VideoAccess-VCMP/web/client/src/sections/application/components/applyModal.jsx

@ -2,79 +2,85 @@ import React, { useState, useEffect, useRef } from "react";
import { connect } from "react-redux"; import { connect } from "react-redux";
import { Button, Form, Modal, } from "@douyinfe/semi-ui"; import { Button, Form, Modal, } from "@douyinfe/semi-ui";
const ApplyModal = ({ close, modalName, visible }) => { const ApplyModal = ({ dispatch, actions, close, modalName, visible, appData }) => {
const form = useRef(); const { applicationCenter } = actions;
const appDatas = appData || {}
const form = useRef();
const handleOk = () => {
const handleOk = () => { form.current
form.current .validate()
.validate() .then((values) => {
.then((values) => { if (appDatas?.id) {
console.log(values); values.appId = appDatas?.id
// close() }
dispatch(applicationCenter.postApplication(values)).then((res) => {
console.log(res);
if (res.success) {
close()
form.current.reset()
}
}) })
})
}
} return <Modal
title={modalName ? "修改应用" : "创建应用"}
return <Modal visible={visible}
title={modalName ? "修改应用" : "创建应用"} width={494}
visible={visible} onCancel={() => { close(); form.current.reset() }}
width={494} onOk={handleOk}
onCancel={() => close()} >
onOk={handleOk} <Form
> allowEmpty
<Form labelPosition="left"
allowEmpty labelAlign="left"
labelPosition="left" labelWidth="90px"
labelAlign="left" initValues={{ name: appDatas?.name || '', type: appDatas?.type || '' }}
labelWidth="90px" getFormApi={(formApi) => (form.current = formApi)}
onValueChange={(values) => console.log(values)} >
getFormApi={(formApi) => (form.current = formApi)} <Form.Input
> maxLength="15"
<Form.Input field="name"
maxLength="36" label="应用名称:"
field="name" allowEmpty={false}
label="应用名称:" placeholder="建议命名方式: [应用名 + 应用场景] 不超过15个字符"
allowEmpty={false} style={{ width: 350 }}
rules={[
initValue={'' || ""} {
placeholder="建议命名方式: [应用名 + 应用场景] 不超过15个字符" required: true,
style={{ width: 350 }} message: "建议命名方式: [应用名 + 应用场景] 不超过15个字符",
rules={[ },
{ ]}
required: true, />
message: "建议命名方式: [应用名 + 应用场景] 不超过15个字符", <Form.Select
}, label="设备厂家:"
]} field="type"
/> multiple
<Form.Select placeholder="请选择应用类型"
label="设备厂家:" allowEmpty={false}
field="venderId" style={{ width: 350 }}
initValue={'' || null} rules={[{ required: true, message: "请选择应用类型" }]}
placeholder="请选择应用类型" >
allowEmpty={false} {[{ name: 'web', value: 'web' }, { name: 'app', value: 'app' }, { name: '小程序', value: 'wxapp' }, { name: '其他', value: 'other' }].map((item, index) => (
style={{ width: 350 }} <Form.Select.Option key={index} value={item.value}>
rules={[{ required: true, message: "请选择应用类型" }]} {item.name}
> </Form.Select.Option>
{[{ name: 'web', id: 'web' }, { name: 'app', id: 'app' }, { name: '小程序', id: '小程序' }, { name: '其他', id: '其他' }].map((item, index) => ( ))}
<Form.Select.Option key={index} value={item.id}> </Form.Select>
{item.name} </Form>
</Form.Select.Option> </Modal>
))}
</Form.Select>
</Form>
</Modal>
} }
function mapStateToProps (state) { function mapStateToProps (state) {
const { auth, global, members } = state; const { auth, global, members } = state;
return { return {
loading: members.isRequesting, loading: members.isRequesting,
user: auth.user, user: auth.user,
actions: global.actions, actions: global.actions,
global: global, global: global,
members: members.data, members: members.data,
}; };
} }
export default connect(mapStateToProps)(ApplyModal); export default connect(mapStateToProps)(ApplyModal);

679
code/VideoAccess-VCMP/web/client/src/sections/application/containers/applicationCenter.jsx

@ -3,15 +3,15 @@ import { connect } from "react-redux";
import moment from "moment"; import moment from "moment";
import qs from "qs"; import qs from "qs";
import { import {
Button, Button,
Form, Form,
Table, Table,
Pagination, Pagination,
Popover, Popover,
Tag, Tag,
Skeleton, Skeleton,
Popconfirm, Popconfirm,
Row, Row,
} from "@douyinfe/semi-ui"; } from "@douyinfe/semi-ui";
import { SimpleFileDownButton, VideoPlayModal, SkeletonScreen, Setup } from "$components"; import { SimpleFileDownButton, VideoPlayModal, SkeletonScreen, Setup } from "$components";
// import "../style.less"; // import "../style.less";
@ -22,349 +22,368 @@ import ApplyModal from "../components/applyModal";
import '../style.less' import '../style.less'
const ApplicationCenter = (props) => { const ApplicationCenter = (props) => {
const { dispatch, actions, user, loading, equipmentWarehouseCamera } = props; const { dispatch, actions, user, loading, applicationData } = props;
// const { equipmentWarehouse } = actions; const { applicationCenter } = actions;
const [cameraModal, setCameraModal] = useState(false); const [modalName, setModalName] = useState(false); //
const [remarksModal, setRemarksModal] = useState(false); const [setup, setSetup] = useState(false); //
const [videoPlay, setVideoPlay] = useState(false); const [applyModal, setApplyModal] = useState(false);
const [modalName, setModalName] = useState(false); // const [setupp, setSetupp] = useState([]);
const [setup, setSetup] = useState(false); // const [query, setQuery] = useState({ limit: 10, page: 0 }); //
const [applyModal, setApplyModal] = useState(false); const [appData, setAppData] = useState(null); //id
const [cameraSetup, setcameraSetup] = useState(false); const APPLICATION = 'application'
const [setupp, setSetupp] = useState([]); const pageLimit = useRef({ limit: 10, page: 0 });
const [venderList, setvenderList] = useState([]); // const limits = useRef(); //
const [query, setQuery] = useState({ limit: 10, page: 0 }); //
const [search, setSearch] = useState({}); //
const [rowId, setRowId] = useState(); //id
const [cameraData, setCameraData] = useState({}); //
const [modify, setModify] = useState(false); //
const [parentCamera, setParentCamera] = useState(""); //
const [addNvr, setAddNvr] = useState(false); //nvrNVR
const [nvrNumber, setNvrNumber] = useState();
const [videoObj, setVideoObj] = useState(); //
const [axyData, setAxyData] = useState();
const [cameraRemarks, setCameraRemarks] = useState([]);//
const api = useRef();
const searchData = useRef({})
const limits = useRef(); //
const page = useRef(query.page);
const deviceClickb = useRef(true)
const APPLICATION = "application";
const columns = [
{
title: "序号",
dataIndex: "",
render: (text, r, index) => {
return index + 1;
},
},
{
title: "应用名称",
dataIndex: "name",
key: "name",
render: (text, r, index) => {
return r?.name.length > 8 ? `${r?.name.substr(0, 8)}...` : r?.name
},
const columns = [ },
{ {
title: "序号", title: "APPID",
dataIndex: "", dataIndex: "appKey",
render: (text, r, index) => { key: "appId",
return index + 1;
},
},
{
title: "应用名称",
dataIndex: "name",
key: "name",
},
{
title: "APPID",
dataIndex: "appId",
key: "appId",
},
{
title: "Secret Key",
dataIndex: "secretKey",
key: "secretKey",
}, },
{ {
title: "操作", title: "Secret Key",
width: "20%", dataIndex: "appSecret",
dataIndex: "", key: "secretKey",
render: (_, row) => {
return (
<div style={{ display: "flex" }}>
<Button
theme="borderless"
onClick={() => {
setApplyModal(true)
setModalName(true)
}}
>
修改
</Button>
{row.forbidden ? (
<Button
theme="borderless"
onClick={() => {
}} },
> {
启用 title: "操作",
</Button> width: "20%",
) : ( dataIndex: "",
<Popconfirm render: (_, row) => {
title="禁用后,应用系统引入的页面及能力将会暂时失效,请谨慎操作。" return (
arrowPointAtCenter={false} <div style={{ display: "flex" }}>
showArrow={true} <Button
position="topRight" theme="borderless"
onConfirm={() => { onClick={() => {
setApplyModal(true)
setModalName(true)
setAppData(row)
}}
>
修改
</Button>
{row?.forbidden ? (
<Button
theme="borderless"
onClick={() => {
dispatch(applicationCenter.putApplication({ appId: row?.id, forbidden: !row?.forbidden })).then(() => details())
}}
>
启用
</Button>
) : (
<Popconfirm
title={<div style={{ width: 200 }}>禁用后应用系统引入的页面及能力将会暂时失效请谨慎操作</div>}
arrowPointAtCenter={false}
showArrow={true}
position="topRight"
onConfirm={() => {
dispatch(applicationCenter.putApplication({ appId: row?.id, forbidden: !row?.forbidden })).then(() => {
setQuery({ limit: pageLimit.current.limit, page: pageLimit.current.page })
})
}}
>
<Button theme="borderless">禁用</Button>
</Popconfirm>
)}
<Popconfirm
title={<div style={{ width: 200 }}>删除后应用系统引入的页面及能力将会永久失效请谨慎操作</div>}
arrowPointAtCenter={false}
width={300}
showArrow={true}
position="topRight"
onConfirm={() => {
dispatch(applicationCenter.delApplication(row?.id)).then(() => {
if (pageLimit.current.page > 0 && limits.current < 2) {
setQuery({ limit: pageLimit.current.limit, page: pageLimit.current.page - 1 })
} else {
setQuery({ limit: pageLimit.current.limit, page: pageLimit.current.page })
}
})
}}
>
<Button theme="borderless">删除</Button>
</Popconfirm>
}} </div >
> );
<Button theme="borderless">禁用</Button> },
</Popconfirm> }
)} ];
<Popconfirm
title="删除后,应用系统引入的页面及能力将会永久失效,请谨慎操作。"
arrowPointAtCenter={false}
showArrow={true}
position="topRight"
onConfirm={() => {
}} //
> function attribute () {
<Button theme="borderless">删除</Button> const arr = localStorage.getItem(APPLICATION)
</Popconfirm> ? JSON.parse(localStorage.getItem(APPLICATION))
: [];
</div> const column = [
); {
title: "创建时间",
dataIndex: "createTime",
key: "createTime",
render: (_, r, index) => {
return r?.createUser?.name
}, },
} },
]; {
title: "创建账号",
// dataIndex: "createUserId",
function attribute () { key: "account",
const arr = localStorage.getItem(APPLICATION) render: (_, r, index) => {
? JSON.parse(localStorage.getItem(APPLICATION)) return moment(r.createTime).format("YYYY-MM-DD HH:MM:SS");
: [];
const column = [
{
title: "创建时间",
dataIndex: "createTime",
key: "createTime",
}, },
{ },
title: "创建账号", {
dataIndex: "account", title: "应用类型",
key: "account", dataIndex: "type",
key: "applicationType",
render: (_, r, index) => {
const type = r?.type?.map((item, index) => item + ';')
return type
}, },
{ },
title: "应用类型", ];
dataIndex: "applicationType",
key: "applicationType",
}, for (let i = 0; i < arr.length; i++) {
]; let colum = column.filter((item) => {
return item.key === arr[i];
});
columns.splice(i + 4, 0, colum[0]);
}
setSetupp(columns);
}
const tableList = [//
{
title: '详情信息',
list: [
{ name: "创建时间", value: "createTime" },
{ name: "创建账号", value: "account" },
{ name: "应用类型", value: "applicationType" },
]
},
];
for (let i = 0; i < arr.length; i++) { //
let colum = column.filter((item) => { const details = (data) => {
return item.key === arr[i]; pageLimit.current = query
}); dispatch(applicationCenter.getApplication(pageLimit.current)).then((res) => {
columns.splice(i + 4, 0, colum[0]); limits.current = res.payload.data.data.length
} });
setSetupp(columns); }
} useEffect(() => {
const tableList = [// details()
{ }, [query])
title: '详情信息',
list: [
{ name: "创建时间", value: "createTime" },
{ name: "创建账号", value: "account" },
{ name: "应用类型", value: "applicationType" },
]
},
];
useEffect(() => { useEffect(() => {
// //
localStorage.getItem(APPLICATION) == null localStorage.getItem(APPLICATION) == null
? localStorage.setItem( ? localStorage.setItem(
APPLICATION, APPLICATION,
JSON.stringify(["createTime",]) JSON.stringify(["createTime",])
) )
: ""; : "";
attribute(); attribute();
}, []) }, [])
return ( return (
<> <>
<div style={{ position: "" }}> <div style={{ position: "" }}>
<video <video
id="cameraBanner" id="cameraBanner"
autoPlay autoPlay
loop loop
muted muted
style={{ width: "100%", objectFit: "cover", height: 171 }} style={{ width: "100%", objectFit: "cover", height: 171 }}
src="/assets/video/camera_banner.mp4" src="/assets/video/camera_banner.mp4"
type="video/mp4" type="video/mp4"
/> />
<div style={{ position: "absolute", top: 12 }}> <div style={{ position: "absolute", top: 12 }}>
<div <div
style={{ style={{
fontSize: 22, fontSize: 22,
paddingTop: 15, paddingTop: 15,
marginLeft: 21, marginLeft: 21,
}} }}
> >
应用管理 应用管理
</div> </div>
<div <div
style={{ style={{
fontSize: 14, fontSize: 14,
paddingTop: 18, paddingTop: 18,
marginLeft: 20, marginLeft: 20,
}} }}
> >
创建接口对应子系统的APPID及能力调用时所需的秘钥 创建接口对应子系统的APPID及能力调用时所需的秘钥
</div> </div>
<div <div
style={{ style={{
fontSize: 14, fontSize: 14,
marginTop: 28, marginTop: 28,
marginLeft: 21, marginLeft: 21,
width: 89, width: 89,
height: 32, height: 32,
lineHeight: 32 + "px", lineHeight: 32 + "px",
textAlign: "center", textAlign: "center",
backgroundColor: "#D9EAFF", backgroundColor: "#D9EAFF",
color: "#1859C1", color: "#1859C1",
cursor: "pointer", cursor: "pointer",
}} }}
onClick={() => { onClick={() => {
setApplyModal(true) setApplyModal(true)
}} }}
> >
创建应用 创建应用
</div> </div>
</div>
</div> </div>
<div style={{ background: "#FFFFFF", marginTop: 5 }}> </div>
<div <div style={{ background: "#FFFFFF", marginTop: 5 }}>
style={{ <div
width: "100%", style={{
display: "flex", width: "100%",
justifyContent: "space-between", display: "flex",
padding: "13px 20px", justifyContent: "space-between",
}} padding: "13px 20px",
> }}
<div >
style={{ <div
width: 64, style={{
height: 22, width: 64,
fontSize: 16, height: 22,
fontfAmily: "PingFangSC-Medium, PingFang SC", fontSize: 16,
fontWeight: "bold", fontfAmily: "PingFangSC-Medium, PingFang SC",
color: "rgba(0, 0, 0, 0.85)", fontWeight: "bold",
lineHeight: "22px", color: "rgba(0, 0, 0, 0.85)",
}} lineHeight: "22px",
> }}
应用列表 >
</div> 应用列表
<div> </div>
<Button <div>
style={{ <Button
width: 32, style={{
height: 32, width: 32,
background: "#D9D9D9", height: 32,
borderadius: 3, background: "#D9D9D9",
marginRight: 20, borderadius: 3,
}} marginRight: 20,
type="primary" }}
key="primary" type="primary"
onClick={() => { key="primary"
setSetup(true); onClick={() => {
// setcameraSetup(true); setSetup(true);
}} // setcameraSetup(true);
> }}
<img >
src="/assets/images/background/setup.png" <img
alt="设置" src="/assets/images/background/setup.png"
style={{ width: 18, height: 18 }} alt="设置"
/> style={{ width: 18, height: 18 }}
</Button> />
{/* <SimpleFileDownButton src="camera/export" /> */} </Button>
</div> {/* <SimpleFileDownButton src="camera/export" /> */}
</div> </div>
<Skeleton
loading={false}
active={true}
placeholder={SkeletonScreen()}
>
<Table
columns={setupp.filter((s) => s)}
dataSource={[{ name: 'csadca', }]}
bordered={false}
empty="暂无数据"
style={{
padding: "0px 20px",
}}
pagination={false}
/>
</Skeleton>
<div
style={{
display: "flex",
justifyContent: "flex-end",
padding: "20px 20px",
}}
>
<span style={{ lineHeight: "30px" }}>
{100}个设备
</span>
<Pagination
className="22"
total={100}
showSizeChanger
currentPage={query.page + 1}
pageSizeOpts={[10, 20, 30, 40]}
onChange={(currentPage, pageSize) => {
setQuery({ limit: pageSize, page: currentPage - 1 });
page.current = currentPage - 1
}}
/>
</div>
</div> </div>
<Skeleton
loading={false}
active={true}
placeholder={SkeletonScreen()}
>
<Table
columns={setupp.filter((s) => s)}
dataSource={applicationData.data}
bordered={false}
empty="暂无数据"
style={{
padding: "0px 20px",
}}
pagination={false}
/>
</Skeleton>
<div
style={{
display: "flex",
justifyContent: "flex-end",
padding: "20px 20px",
}}
>
<span style={{ lineHeight: "30px" }}>
{applicationData.total}个设备
</span>
<Pagination
className="22"
total={applicationData.total}
showSizeChanger
currentPage={query.page + 1}
pageSizeOpts={[10, 20, 30, 40]}
onChange={(currentPage, pageSize) => {
setQuery({ limit: pageSize, page: currentPage - 1 });
pageLimit.current = { limit: pageSize, page: currentPage - 1 }
}}
/>
</div>
</div>
{/*表格设置*/} {/*表格设置*/}
{setup ? ( {setup ? (
<Setup <Setup
tableType={APPLICATION} tableType={APPLICATION}
tableList={tableList} tableList={tableList}
close={() => { close={() => {
setSetup(false); setSetup(false);
attribute(); attribute();
}} }}
/> />
) : ( ) : (
"" ""
)} )}
{applyModal ? ( {applyModal ? (
<ApplyModal <ApplyModal
visible={true} visible={true}
modalName={modalName} modalName={modalName}
close={() => { appData={appData}
setApplyModal(false) close={() => {
setModalName(false) setApplyModal(false)
}} setModalName(false)
/> setAppData(null)
) : ( details()
"" }}
)} />
) : (
""
)}
</> </>
) )
} }
function mapStateToProps (state) { function mapStateToProps (state) {
const { auth } = state; const { global, applicationData } = state;
return { return {
user: auth.user, actions: global.actions,
}; applicationData: applicationData.data || {}
};
} }
export default connect(mapStateToProps)(ApplicationCenter); export default connect(mapStateToProps)(ApplicationCenter);

1
code/VideoAccess-VCMP/web/client/src/sections/equipmentWarehouse/components/nvrModal.jsx

@ -43,7 +43,6 @@ function nvrModal(props) {
.validate() .validate()
.then((values) => { .then((values) => {
// //
console.log(values)
let valuesObj = JSON.parse(JSON.stringify(values)); let valuesObj = JSON.parse(JSON.stringify(values));
valuesObj.longitude = values.position.split(",")[0]; valuesObj.longitude = values.position.split(",")[0];
valuesObj.latitude = values.position.split(",")[1]; valuesObj.latitude = values.position.split(",")[1];

33
code/VideoAccess-VCMP/web/client/src/utils/webapi.js

@ -38,20 +38,27 @@ export const ApiTable = {
postVerifyCascade: "camera/verify/cascade", //验证级联摄像头信息 postVerifyCascade: "camera/verify/cascade", //验证级联摄像头信息
getCascadeStream: "camera/cascade_stream", //获取级联视频流 getCascadeStream: "camera/cascade_stream", //获取级联视频流
uploadYingshiVoice: 'camera/yingshi_voice/upload', //上传萤石语音 uploadYingshiVoice: 'camera/yingshi_voice/upload', //上传萤石语音
postCameraRemark: 'camera/remark',//编辑摄像头备注 postCameraRemark: 'camera/remark',//编辑摄像头备注
//获取状态码 //获取状态码
getStatus: 'status',//获取状态码 getStatus: 'status',//获取状态码
putStatueBanned:'status/banned',//禁用状态码自定义 putStatueBanned: 'status/banned',//禁用状态码自定义
postStatusResolve:'status/resolve',//编辑解决方案 postStatusResolve: 'status/resolve',//编辑解决方案
postStatusCustom:'status/custom',//自定义状态码释义 postStatusCustom: 'status/custom',//自定义状态码释义
getStatusSimpleAll:'status/simple_all',//获取全部状态码简略信息 getStatusSimpleAll: 'status/simple_all',//获取全部状态码简略信息
getCameraListAll:'camera/listAll',//获取所有摄像头信息 getCameraListAll: 'camera/listAll',//获取所有摄像头信息
getStatusPush:'status/push',//获取推送配置 getStatusPush: 'status/push',//获取推送配置
putSasdtatusPush:'status/push',//编辑推送配置 putSasdtatusPush: 'status/push',//编辑推送配置
delPush:'status/push/{configId}',//删除推送配置 delPush: 'status/push/{configId}',//删除推送配置
putPushBanned:'status/push/banned',//禁用推送配置 putPushBanned: 'status/push/banned',//禁用推送配置
getPushCopy:'status/push/{configId}/copy',//复制推送配置 getPushCopy: 'status/push/{configId}/copy',//复制推送配置
getPushLog:'/status/push/{configId}/log',//获取推送记录 getPushLog: '/status/push/{configId}/log',//获取推送记录
//应用管理
getApplication: '/application', //获取应用信息
putApplication: '/application', //禁用应用
delApplication: '/application/{appId}', //删除应用
postApplication: '/application', //创建/修改应用
}; };
export const VideoServeApi = { export const VideoServeApi = {

Loading…
Cancel
Save