| | |
| | | import { getSearchList } from '@/api/search'; |
| | | import { getPanoramaPic } from "@/api/panorama"; |
| | | export default { |
| | | data () { |
| | | data() { |
| | | return { |
| | | cW: 0, |
| | | cH: 0, |
| | |
| | | pickerOptions: { |
| | | shortcuts: [{ |
| | | text: '近一小时', |
| | | onClick (picker) { |
| | | onClick(picker) { |
| | | const end = new Date(); |
| | | const start = new Date(); |
| | | start.setTime(start.getTime() - 60 * 60 * 1000); |
| | |
| | | } |
| | | }, { |
| | | text: '近三小时', |
| | | onClick (picker) { |
| | | onClick(picker) { |
| | | const end = new Date(); |
| | | const start = new Date(); |
| | | start.setTime(start.getTime() - 60 * 60 * 1000 * 3); |
| | |
| | | } |
| | | }, { |
| | | text: '近六小时', |
| | | onClick (picker) { |
| | | onClick(picker) { |
| | | const end = new Date(); |
| | | const start = new Date(); |
| | | start.setTime(start.getTime() - 60 * 60 * 1000 * 6); |
| | |
| | | isInvert: false, |
| | | } |
| | | }, |
| | | mounted () { |
| | | mounted() { |
| | | this.searchData(); |
| | | //this.filterData(); |
| | | this.getPanorama(); |
| | | |
| | | }, |
| | | beforeDestroy () { |
| | | beforeDestroy() { |
| | | console.log('beforeDestroy') |
| | | clearInterval(this.timer); |
| | | }, |
| | | methods: { |
| | | checkTime () { |
| | | checkTime() { |
| | | if (!this.searchTime) { |
| | | this.$notify({ |
| | | type: 'warning', |
| | |
| | | this.searchData(); |
| | | } |
| | | }, |
| | | filterData () { |
| | | filterData() { |
| | | let _this = this; |
| | | var param = { |
| | | page: 1, |
| | |
| | | _this.drawTracePath(); |
| | | }) |
| | | }, |
| | | hideAllChange () { |
| | | hideAllChange() { |
| | | this.actObjs.forEach(target => { |
| | | target.isHide = this.isHideAll; |
| | | }); |
| | | this.drawTracePath(); |
| | | }, |
| | | invertChange () { |
| | | invertChange() { |
| | | console.log(this.isInvert) |
| | | this.actObjs.forEach(target => { |
| | | target.isHide = !target.isHide; |
| | |
| | | } |
| | | this.drawTracePath(); |
| | | }, |
| | | checkTarget (item) { |
| | | checkTarget(item) { |
| | | item.isHide = !item.isHide; |
| | | this.isHideAll = item.isHide; |
| | | this.drawTracePath(); |
| | | }, |
| | | getPanorama () { |
| | | getPanorama() { |
| | | let _this = this; |
| | | getPanoramaPic().then(res => { |
| | | let { panoramaPath, width, height } = res.data; |
| | |
| | | } |
| | | }) |
| | | }, |
| | | drawTracePath () { |
| | | drawTracePath() { |
| | | console.log(this.actObjs) |
| | | let canvas = this.$refs['trackArea']; |
| | | let ctx = canvas.getContext('2d'); |
| | |
| | | } |
| | | }) |
| | | }, |
| | | searchData () { |
| | | searchData() { |
| | | let _this = this; |
| | | var param = { |
| | | page: 1, |
| | |
| | | treeNodes: [], |
| | | isAll: false |
| | | }; |
| | | if((new Date() - _this.timeMark)<_this.intervalTime){ |
| | | if ((new Date() - _this.timeMark) < _this.intervalTime) { |
| | | return |
| | | } |
| | | getSearchList(param).then(res => { |