Browse Source

状态码释义接口联调

release_1.1.1
deartibers 3 years ago
parent
commit
d4c9bca218
  1. BIN
      code/VideoAccess-VCMP/web/client/assets/images/favicon.ico
  2. 23
      code/VideoAccess-VCMP/web/client/src/sections/offline/actions/statuscode.js
  3. 148
      code/VideoAccess-VCMP/web/client/src/sections/offline/components/notesModal.jsx
  4. 14
      code/VideoAccess-VCMP/web/client/src/sections/offline/containers/statuscode.jsx
  5. 2
      code/VideoAccess-VCMP/web/client/src/utils/webapi.js

BIN
code/VideoAccess-VCMP/web/client/assets/images/favicon.ico

Binary file not shown.

After

Width:  |  Height:  |  Size: 205 KiB

23
code/VideoAccess-VCMP/web/client/src/sections/offline/actions/statuscode.js

@ -40,3 +40,26 @@ export function postStatusResolve(data) {
reducer: { name: "" }, reducer: { name: "" },
}); });
} }
export function postStatusCustom(data) {
return (dispatch) =>
basicAction({
type: "post",
dispatch: dispatch,
data,
actionType: "POST_STATUS_CUSTOM",
url: `${ApiTable.postStatusCustom}`,
msg: { option: "" }, //自定义状态码释义
reducer: { name: "" },
});
}
export function getStatusSimpleAll() {
return (dispatch) =>
basicAction({
type: "get",
dispatch: dispatch,
actionType: "GET_STATUS_SIMPLE_ALL",
url: `${ApiTable.getStatusSimpleAll}`,
msg: { option: "" }, //获取摄像头能力列表
reducer: { name: "" },
});
}

148
code/VideoAccess-VCMP/web/client/src/sections/offline/components/notesModal.jsx

@ -1,41 +1,78 @@
import React, { useState, useRef, useEffect } from "react"; import React, { useState, useRef, useEffect } from "react";
import { connect } from "react-redux"; import { connect } from "react-redux";
import { Modal, Spin,Input,TagInput } from "@douyinfe/semi-ui"; import { Modal, Spin,Input,TagInput ,Select} from "@douyinfe/semi-ui";
function programmeModal (props) { function programmeModal (props) {
const { const {
close, close,
rowId, rowId,
dispatch, dispatch,
actions, actions,
nodesAll nodesAll,//
tableNews,//
} = props; } = props;
const { equipmentWarehouse } = actions; const { offline } = actions;
const [notesValue, setNotesValue] = useState('');//
const [codeList, setCodeList] = useState([]);//
const [codeIdList, setcodeIdList] = useState([]);//id
const [platform, setPlatform] = useState(['yingshi']);//
const [notesValue, setNotesValue] = useState('');//
// //
useEffect(() => { useEffect(() => {
setNotesValue(tableNews.paraphraseCustom||'')
dispatch(
offline.getStatusSimpleAll()
).then((res) => {
let mycodeList=[];
if(res.payload&&res.payload.data){
for (let index = 0; index < res.payload.data.length; index++) {
mycodeList.push({id:res.payload.data[index].id,status:res.payload.data[index].status+' '+res.payload.data[index].describe,platform:res.payload.data[index].platform})
}
}
setCodeList(mycodeList)
})
}, []); }, []);
function handleOk () { function handleOk () {
// //
// dispatch( if(nodesAll){
// equipmentWarehouse.postCameraRemark({ dispatch(
// cameraId:rowId, offline.postStatusCustom({
// remark:showScrollList statusId:codeIdList,
// }) paraphrase:notesValue
// ).then((res) => { })
// close(); ).then((res) => {
// }) close();
})
}
else{
dispatch(
offline.postStatusCustom({
statusId:[rowId],
paraphrase:notesValue
})
).then((res) => {
close();
})
}
} }
function handleCancel () { function handleCancel () {
close(); close();
// //
} }
function onChange(value){ function onChange(value){//
console.log('value',value); if(value!==''){
setNotesValue(value) setNotesValue(value)
}
else{
setNotesValue(null)
}
}
function onSelect(value){//
setcodeIdList(value)
}
function oneSelect(value){//
setPlatform(value)
} }
return ( return (
<> <>
@ -48,26 +85,43 @@ function programmeModal (props) {
width={607} width={607}
onCancel={handleCancel} onCancel={handleCancel}
> >
{/* <div style={{margin:"17px 56px 18px 31px"}}>
<div style={{color:'rgba(0, 0, 0, 0.65)',}}>
解决方案设置
</div>
<div style={{color:'rgba(0, 0, 0, 0.45)',fontSize:12,marginTop:4}}>
敲击回车键后输入内容将成为标签
</div>
<div style={{marginTop:10}}>
<TagInput
defaultValue={['设备是否接触良好','刷新重试,检测设备网络,重启设备']}
placeholder='请输入解决方案'
size='large'
maxLength={18}
onChange={v => console.log(v)}
/>
</div>
</div> */}
{nodesAll?( {nodesAll?(
<div style={{margin:"17px 32px 28px 32px"}}> <div style={{margin:"17px 32px 28px 32px"}}>
<div style={{display: 'flex',alignItems: 'center'}}>
<div style={{width:84,textAlign:'right',color: 'rgba(0,0,0,0.65)'}}>状态码</div>
<div>
<Select defaultValue='yingshi' onChange={oneSelect} style={{ width: 108 }}>
<Select.Option value='yingshi'>萤石云</Select.Option>
<Select.Option value='gb'>国标摄像头</Select.Option>
</Select>
</div>
<div style={{marginLeft:12}}>
<Select filter multiple style={{ width: 300 }} onChange={onSelect} placeholder='请选择状态码' maxTagCount={1} autoClearSearchValue={false}>
{codeList.map((item) => {
return(
item.platform==platform ? (
<Select.Option key={item.id} value={item.id}>
{item.status}
</Select.Option>
) : (
""
)
)
})}
</Select>
</div>
</div>
<div style={{display: 'flex',alignItems: 'center',marginTop:21}}>
<div style={{width:84,textAlign:'right',color: 'rgba(0,0,0,0.65)'}}>修改释义</div>
<div style={{width:'100%'}}><Input
style={{width:'100%'}}
value={notesValue}
onChange={onChange}
maxLength={18}
placeholder="请输入自定义释义"
showClear>
</Input></div>
</div>
</div> </div>
):( ):(
<div style={{margin:"17px 32px 28px 32px"}}> <div style={{margin:"17px 32px 28px 32px"}}>
@ -84,12 +138,12 @@ function programmeModal (props) {
</div> </div>
)} )}
<div style={{display:'flex',margin:'0px 20px',alignItems: 'center',justifyContent: 'space-between'}}> <div style={{display:'flex',margin:'0px 20px',alignItems: 'center',justifyContent: 'space-between'}}>
<div> <div style={{display:'flex',justifyContent: 'center',
<img alignItems:'center', width: 240, height: 146 ,
src="/assets/images/background/codeBefore.png" background: "url(/assets/images/background/codeBefore.png)",backgroundSize: "100% 100%",}}>
alt="设置" <div style={{color: 'rgba(255,255,255,0.8)',textShadow: '0px 1px 1px rgba(0,0,0,0)',textAlign: 'center',width: 130}}>
style={{ width: 240, height: 146 }} {tableNews.paraphrase||'初始化释义'}
/> </div>
</div> </div>
<div> <div>
<img <img
@ -98,12 +152,12 @@ function programmeModal (props) {
style={{ width: 18, height: 15 }} style={{ width: 18, height: 15 }}
/> />
</div> </div>
<div> <div style={{ display:'flex',justifyContent: 'center',
<img alignItems:'center', width: 240, height: 146 ,
src="/assets/images/background/codeAfter.png" background: "url(/assets/images/background/codeAfter.png)",backgroundSize: "100% 100%",}}>
alt="设置" <div style={{color: 'rgba(255,255,255,1)',textShadow: '0px 1px 1px #001969',textAlign: 'center',width: 130}}>
style={{ width: 240, height: 146 }} {notesValue}
/> </div>
</div> </div>
</div> </div>
</Modal> </Modal>

14
code/VideoAccess-VCMP/web/client/src/sections/offline/containers/statuscode.jsx

@ -29,14 +29,13 @@ const Statuscode = (props) => {
const [rowId, setRowId] = useState(); //id const [rowId, setRowId] = useState(); //id
const api = useRef(); const api = useRef();
const searchData = useRef(search) const searchData = useRef(search)
const limits = useRef(); //
const page = useRef(query.page); const page = useRef(query.page);
const CODE = "code"; const CODE = "code";
const [nodesAll, setNodesAll] = useState(true);// const [nodesAll, setNodesAll] = useState(true);//
const [mysorter, setMysorter] = useState(true);// const [mysorter, setMysorter] = useState(true);//
const sorter = useRef(false);// const sorter = useRef(false);//
const [resolve, setResolve] = useState([]);// const [resolve, setResolve] = useState([]);//
const [tableNews, setTableNews] = useState([]);//
const tableList = [// const tableList = [//
{ {
title:'状态码信息', title:'状态码信息',
@ -160,6 +159,7 @@ const Statuscode = (props) => {
onClick={() => { onClick={() => {
setNotes(true); setNotes(true);
setNodesAll(false); setNodesAll(false);
setTableNews(row);
setRowId(row.id); setRowId(row.id);
}} }}
> >
@ -319,7 +319,7 @@ const Statuscode = (props) => {
style={{ position: "relative", width: "100%", flex: 1 }} style={{ position: "relative", width: "100%", flex: 1 }}
> >
<Form.Input <Form.Input
label="释义搜索: " label="释义搜索:"
field="keyword" field="keyword"
maxLength="36" maxLength="36"
placeholder="请输入错误描述、释义或自定义释义" placeholder="请输入错误描述、释义或自定义释义"
@ -452,7 +452,9 @@ const Statuscode = (props) => {
borderRadius: 3, borderRadius: 3,
}} }}
onClick={() => { onClick={() => {
setNotes(true);
setNodesAll(true);
setTableNews([]);
}} }}
> >
批量设置 批量设置
@ -484,7 +486,7 @@ const Statuscode = (props) => {
}} }}
> >
<span style={{ lineHeight: "30px" }}> <span style={{ lineHeight: "30px" }}>
{StatusList.count}设备 {StatusList.count}状态码
</span> </span>
<Pagination <Pagination
total={StatusList.count} total={StatusList.count}
@ -522,9 +524,11 @@ const Statuscode = (props) => {
{notes&&<NotesModal {notes&&<NotesModal
rowId={rowId} rowId={rowId}
nodesAll={nodesAll} nodesAll={nodesAll}
tableNews={tableNews}
close={() => { close={() => {
setNotes(false); setNotes(false);
setRowId(); setRowId();
codegetStatus();
}} }}
/>} />}
</div> </div>

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

@ -43,6 +43,8 @@ export const ApiTable = {
getStatus: 'status',//获取状态码 getStatus: 'status',//获取状态码
putStatueBanned:'status/banned',//禁用状态码自定义 putStatueBanned:'status/banned',//禁用状态码自定义
postStatusResolve:'status/resolve',//编辑解决方案 postStatusResolve:'status/resolve',//编辑解决方案
postStatusCustom:'status/custom',//自定义状态码释义
getStatusSimpleAll:'status/simple_all',//获取全部状态码简略信息
}; };
export const VideoServeApi = { export const VideoServeApi = {

Loading…
Cancel
Save