From 1e4a3f702623a46bcd53dbc96e235d51e0edb155 Mon Sep 17 00:00:00 2001 From: zhangzengfei <zhangzengfei@smartai.com> Date: 星期五, 05 八月 2022 04:13:02 +0800 Subject: [PATCH] 管理中心添加分析 --- src/Pool/VideoPhotoData.ts | 247 +++++++++++++++++++++++++------------------------ 1 files changed, 127 insertions(+), 120 deletions(-) diff --git a/src/Pool/VideoPhotoData.ts b/src/Pool/VideoPhotoData.ts index 08ad20c..f6f7cab 100644 --- a/src/Pool/VideoPhotoData.ts +++ b/src/Pool/VideoPhotoData.ts @@ -6,69 +6,69 @@ findPersonByPic, findPerson, addToBase -} from "@/api/search"; +} from "@/api/search" export default class VideoPhotoData { - public searchFrom: string = 'search'; - public preCards: Array<object> = []; - public cards: Array<object> = []; - public persons: Array<object> = []; + public searchFrom: string = "search" + public preCards: Array<object> = [] + public cards: Array<object> = [] + public persons: Array<object> = [] public activeName: string = "pic" - public page: number = 1; - public size: number; - public pageSizeOption: Array<number>; - public alarmlevel: Array<object>; - public dictionary: object = {}; - public monitorLevel: Array<object> = []; - public queryAlarmlevel: Array<string> = []; - public inputValue: string; - public searchTime: Array<string>; - public showType: string; - public tabs: Array<object>; - public blackList: Array<object> = []; - public selectBlacks: Array<object> = []; - public whiteList: Array<object> = []; - public selectWhites: Array<object> = []; - public queryTabs: Array<string> = []; - public compareTabs: Array<string> = []; - public tasks: Array<object>; - public queryTasks: Array<string> = []; - public treeNodes: Array<string>; - public total: number = 0; - public tabsForUploadImg: Array<object> = []; - public picUrl: string = ""; - public threshold: number = 60; - public activeCard: number | string = ""; - public uploadImg: any = ""; - public captureId: string = ""; - public compareNum: string = ""; - public compTargetId: string = ""; - public compTargetType: string = "1"; - public rightSectionDisplay: boolean = false; - public scrollContainDom: any = ''; - public uploadDiaplay: boolean = false; - public uploadType: boolean = false; + public page: number = 1 + public size: number + public pageSizeOption: Array<number> + public alarmlevel: Array<object> + public dictionary: object = {} + public monitorLevel: Array<object> = [] + public queryAlarmlevel: Array<string> = [] + public inputValue: string + public searchTime: Array<string> + public showType: string + public tabs: Array<object> + public blackList: Array<object> = [] + public selectBlacks: Array<object> = [] + public whiteList: Array<object> = [] + public selectWhites: Array<object> = [] + public queryTabs: Array<string> = [] + public compareTabs: Array<string> = [] + public tasks: Array<object> + public queryTasks: Array<string> = [] + public treeNodes: Array<string> + public total: number = 0 + public tabsForUploadImg: Array<object> = [] + public picUrl: string = "" + public threshold: number = 60 + public activeCard: number | string = "" + public uploadImg: any = "" + public captureId: string = "" + public compareNum: string = "" + public compTargetId: string = "" + public compTargetType: string = "1" + public rightSectionDisplay: boolean = false + public scrollContainDom: any = "" + public uploadDiaplay: boolean = false + public uploadType: boolean = false constructor() { - this.cards = []; - this.size = 60; - this.pageSizeOption = [30, 60, 120] - this.alarmlevel = []; - this.inputValue = ""; - this.searchTime = []; - this.showType = "search"; - this.tabs = []; - this.tasks = []; - this.treeNodes = []; + this.cards = [] + this.size = 60 + this.pageSizeOption = [30, 60, 120, 1200] + this.alarmlevel = [] + this.inputValue = "" + this.searchTime = [] + this.showType = "search" + this.tabs = [] + this.tasks = [] + this.treeNodes = [] } clearStatus() { //this.cards = []; - this.page = 1; - this.size = 60; + this.page = 1 + this.size = 60 this.pageSizeOption = [30, 60, 120] - this.alarmlevel = []; - this.inputValue = ""; - this.showType = "search"; + this.alarmlevel = [] + this.inputValue = "" + this.showType = "search" } async querySearchList() { @@ -85,34 +85,33 @@ treeNodes: this.treeNodes, dataSource: "camera" } - if (this.searchFrom == 'cluster') { + if (this.searchFrom == "cluster") { param.isAll = true } - const rsp: any = await getSearchList(param); + const rsp: any = await getSearchList(param) if (rsp && rsp.success) { this.cards.length = 0 // 娓呬袱娆★紝绗竴娆℃槸涓轰簡鐐瑰畬涔嬪悗涓嶄細鍑虹幇涔嬪墠鏁版嵁鐨勬畫褰憋紝杩欐鏄负浜嗛槻姝㈠洜涓哄紓姝ラ棶棰樹袱娆¤姹備細鍑虹幇鍙屽�嶆暟鎹殑闂 this.preCards.length = 0 if (rsp.data.datalist) { - rsp.data.datalist.forEach(element => { + rsp.data.datalist.forEach((element) => { + if (element.activeObject.targetInfo && element.activeObject.targetInfo.length === 0) { + element.activeObject.targetInfo = null + } - if(element.activeObject.targetInfo&&element.activeObject.targetInfo.length === 0) { - element.activeObject.targetInfo = null - } - - if(element.list[0].targetInfo&&element.list[0].targetInfo.length === 0) { - element.list[0].targetInfo = null - } + if (element.list[0].targetInfo && element.list[0].targetInfo.length === 0) { + element.list[0].targetInfo = null + } element.ownerPage = this.page - this.cards.push(element as any); + this.cards.push(element as any) // 鍙厑璁告瘡涓猚ard娓叉煋涓�寮犲浘鐗� // var obj = {activeObject: element.activeObject,ownerPage: element.ownerPage,list: [],length: element.list.length} // obj.list.push(element.activeObject) // this.preCards.push(obj) - }); + }) } //console.log("cards鐨勬暟閲�",this.cards) - this.total = rsp.data.total; + this.total = rsp.data.total } } @@ -131,17 +130,17 @@ threshold: this.threshold, isAll: this.searchFrom == "cluster" ? true : false } - const rsp: any = await findPersonByPic(param); + const rsp: any = await findPersonByPic(param) if (rsp && rsp.success) { - rsp.data.totalList.forEach(element => { + rsp.data.totalList.forEach((element) => { var obj = { - activeObject: (element as any), + activeObject: element as any, list: [] } element.ownerPage = this.page - obj.list.push((element as any)) + obj.list.push(element as any) this.cards.push(obj) - }); + }) // console.log("浠ュ浘鎼滃浘鏌ュ洖鏉ョ殑浜�",this.persons) this.total = rsp.data.total this.compareNum = rsp.data.compareNum @@ -181,20 +180,20 @@ compTargetId: this.compTargetId, compTargetType: compType, databases: this.compareTabs, - threshold: this.threshold, + threshold: this.threshold } } - const rsp: any = await findPersonByPic(param); + const rsp: any = await findPersonByPic(param) if (rsp && rsp.success) { - rsp.data.totalList.forEach(element => { + rsp.data.totalList.forEach((element) => { var obj = { - activeObject: (element as any), + activeObject: element as any, list: [] } element.ownerPage = this.page - obj.list.push((element as any)) + obj.list.push(element as any) this.cards.push(obj) - }); + }) this.total = rsp.data.total this.compareNum = rsp.data.compareNum } @@ -215,65 +214,73 @@ threshold: this.threshold, isAll: this.searchFrom == "cluster" ? true : false } - const rsp: any = await findPerson(param); + const rsp: any = await findPerson(param) if (rsp && rsp.success) { - rsp.data.totalList.forEach(element => { + rsp.data.totalList.forEach((element) => { var obj = { - activeObject: (element as any), + activeObject: element as any, list: [] } element.ownerPage = this.page - obj.list.push((element as any)) + obj.list.push(element as any) this.cards.push(obj) - }); + }) this.total = rsp.data.total // console.log("findPersonByPage---", this.total, this.persons) } } async queryTagList() { - const rsp: any = await getTagList({}); + const rsp: any = await getTagList({}) this.tabsForUploadImg.splice(0, this.tabsForUploadImg.length) if (rsp && rsp.success) { - var arr1 = new Array - arr1 = rsp.data&&rsp.data.tags.filter(i => { - if (i.status === 1) { - i.title = i.title + '(宸插垹闄�)' - return i - } - }); - this.tabs = rsp.data&&rsp.data.tags.filter(function (i) { - if (i.status !== 1) { - return i - } - }) + var arr1 = new Array() + arr1 = + rsp.data && + rsp.data.tags.filter((i) => { + if (i.status === 1) { + i.title = i.title + "(宸插垹闄�)" + return i + } + }) + this.tabs = + rsp.data && + rsp.data.tags.filter(function(i) { + if (i.status !== 1) { + return i + } + }) this.tabs.push(...arr1) - this.tabsForUploadImg.push({ key: "esData", title: "鎶撴媿搴�" }); - rsp.data.tags.forEach(element => { - this.tabsForUploadImg.push(element as any); - }); + this.tabsForUploadImg.push({ key: "esData", title: "鎶撴媿搴�" }) + rsp.data.tags.forEach((element) => { + this.tabsForUploadImg.push(element as any) + }) // 鏀剧疆榛戠櫧鍚嶅崟 0涓虹櫧鍚嶅崟 this.blackList.length = 0 this.whiteList.length = 0 var josn = JSON.stringify(rsp) var resp = JSON.parse(josn) - resp.data.tags.forEach(i => { - if (i.status === 0 && i.bwType === "0") { //鐧藉悕鍗� - if (i.analyServerId === "") { //鍚屾搴� - i.title = i.title + '(鍚屾搴�)' + resp.data.tags.forEach((i) => { + if (i.status === 0 && i.bwType === "0") { + //鐧藉悕鍗� + if (i.analyServerId === "") { + //鍚屾搴� + i.title = i.title + "(鍚屾搴�)" this.whiteList.push(i) } else { this.whiteList.push(i) } } - if (i.status === 0 && i.bwType === "1") { //榛戝悕鍗� - if (i.analyServerId === "") { //鍚屾搴� - i.title = i.title + '(鍚屾搴�)' + if (i.status === 0 && i.bwType === "1") { + //榛戝悕鍗� + if (i.analyServerId === "") { + //鍚屾搴� + i.title = i.title + "(鍚屾搴�)" this.blackList.push(i) } else { this.blackList.push(i) } } - }); + }) } else { // this.$notify({ // title: "澶辫触", @@ -284,36 +291,36 @@ } async queryTaskList() { - let params: any = {}; - if (this.searchFrom == 'cluster') { + let params: any = {} + if (this.searchFrom == "cluster") { params.isPlatform = 1 } console.log(params) - const rsp: any = await getTaskList(params); + const rsp: any = await getTaskList(params) if (rsp && rsp.success) { // this.tasks.splice(0, this.tasks.length) // rsp.data.forEach(element => { // this.tasks.push((element as any).task); // }); - let taskNames = []; - this.tasks = []; + let taskNames = [] + this.tasks = [] rsp.data.aggs.forEach((d: any) => { if (taskNames.indexOf(d.name) < 0) { - taskNames.push(d.name); + taskNames.push(d.name) this.tasks.push(d) } else { - let repeatOne = this.tasks.find((one: any) => one.name == d.name); - repeatOne['id'] += `,${d.id}`; - repeatOne['isDelete'] = repeatOne['isDelete'] && d.isDelete + let repeatOne = this.tasks.find((one: any) => one.name == d.name) + repeatOne["id"] += `,${d.id}` + repeatOne["isDelete"] = repeatOne["isDelete"] && d.isDelete } - }); + }) } } async queryDictionary() { - const rsp: any = await getAlarmLevel({}); + const rsp: any = await getAlarmLevel({}) if (rsp && rsp.success) { - this.dictionary = rsp.data; + this.dictionary = rsp.data // console.log("瀛楀吀鏄細", this.dictionary) //this.dictionary['ALARMLEVEL'].unshift({ name: '鎾ら槻', value: "-1" }) -- Gitblit v1.8.0