|
|
|
@ -71,6 +71,9 @@ const VideoAnalysis: React.FC = () => {
|
|
|
|
|
|
|
|
|
|
const [tab, setTab] = useState<string>(alarmVideoAnalysis[0].key);
|
|
|
|
|
const [tabs, setTabs] = useState<any>([]);
|
|
|
|
|
|
|
|
|
|
const [importDate, setImportDate] = useState<any>(null);
|
|
|
|
|
const [innerDate, setInnerDate] = useState<any>(null);
|
|
|
|
|
|
|
|
|
|
const changeProjectTab = (key: string) => {
|
|
|
|
|
setTab(key);
|
|
|
|
@ -224,12 +227,13 @@ const VideoAnalysis: React.FC = () => {
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// 初始化加载
|
|
|
|
|
async function initList(tabId:string = tab) {
|
|
|
|
|
async function initList(tabId:string = tab, date: any = null) {
|
|
|
|
|
const reqParams = {
|
|
|
|
|
page: currentPage,
|
|
|
|
|
pageSize: currentPageSize,
|
|
|
|
|
// desc: false,
|
|
|
|
|
warning_type: tabId,
|
|
|
|
|
analyse_time: date
|
|
|
|
|
// ...rest,
|
|
|
|
|
};
|
|
|
|
|
const resp = await postUploadAlarmList({ ...reqParams });
|
|
|
|
@ -237,33 +241,6 @@ const VideoAnalysis: React.FC = () => {
|
|
|
|
|
// setCurrentPageSize(resp?.data?.count)
|
|
|
|
|
setTotal(resp?.data?.count)
|
|
|
|
|
initDataTestList(resp?.data?.results);
|
|
|
|
|
// request={async (params = {}, sort) => {
|
|
|
|
|
// const { current, ...rest } = params;
|
|
|
|
|
// const reqParams = {
|
|
|
|
|
// page: current,
|
|
|
|
|
// desc: false,
|
|
|
|
|
// warning_type: tab,
|
|
|
|
|
// ...rest,
|
|
|
|
|
// };
|
|
|
|
|
// if (sort && Object.keys(sort).length) {
|
|
|
|
|
// reqParams.orderKey = Object.keys(sort)[0];
|
|
|
|
|
// let sort_select = sort[reqParams.orderKey];
|
|
|
|
|
// reqParams.desc = sort_select === 'descend';
|
|
|
|
|
// }
|
|
|
|
|
// // TODO 联调查询设备状态接口
|
|
|
|
|
// console.log(reqParams, 'reqParams');
|
|
|
|
|
// let resp = await postUploadAlarmList({ ...reqParams });
|
|
|
|
|
// console.log(resp, 'postAlarmList_result');
|
|
|
|
|
|
|
|
|
|
// initDataTestList(resp.result);
|
|
|
|
|
// // return {
|
|
|
|
|
// // data: resp.result,
|
|
|
|
|
// // success: resp.success,
|
|
|
|
|
// // total: resp.count,
|
|
|
|
|
// // current: resp.count,
|
|
|
|
|
// // pageSize: resp.count,
|
|
|
|
|
// // };
|
|
|
|
|
// }}
|
|
|
|
|
}
|
|
|
|
|
const handleChange: UploadProps['onChange'] = (info) => {
|
|
|
|
|
if (info.file.status === 'uploading') {
|
|
|
|
@ -282,7 +259,10 @@ const VideoAnalysis: React.FC = () => {
|
|
|
|
|
}
|
|
|
|
|
};
|
|
|
|
|
const onChange: DatePickerProps['onChange'] = (date, dateString) => {
|
|
|
|
|
console.log(date, dateString);
|
|
|
|
|
console.log(dateString);
|
|
|
|
|
setImportDate(date)
|
|
|
|
|
setInnerDate(dateString)
|
|
|
|
|
console.log(importDate,'importDate');
|
|
|
|
|
};
|
|
|
|
|
useEffect(() => {
|
|
|
|
|
getTabs();
|
|
|
|
@ -332,11 +312,13 @@ const VideoAnalysis: React.FC = () => {
|
|
|
|
|
}}
|
|
|
|
|
></Tabs>
|
|
|
|
|
<div style={{ padding: '16px 16px 0'}}>
|
|
|
|
|
选择导入时间:<DatePicker locale={locale} onChange={onChange} />
|
|
|
|
|
选择导入时间:<DatePicker locale={locale} value={importDate} onChange={onChange} allowClear />
|
|
|
|
|
<Button type="primary"
|
|
|
|
|
style={{ margin: '0 16px' }}
|
|
|
|
|
onClick={() => {
|
|
|
|
|
// setCreateModalOpen(true);
|
|
|
|
|
setImportDate(null);
|
|
|
|
|
initList(tab, null)
|
|
|
|
|
}}
|
|
|
|
|
>
|
|
|
|
|
重置
|
|
|
|
@ -344,6 +326,7 @@ const VideoAnalysis: React.FC = () => {
|
|
|
|
|
<Button type="primary"
|
|
|
|
|
onClick={() => {
|
|
|
|
|
// setCreateModalOpen(true);
|
|
|
|
|
initList(tab, innerDate)
|
|
|
|
|
}}
|
|
|
|
|
>
|
|
|
|
|
确定
|
|
|
|
|