123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170 |
- var _this;
- var nowTime;
- new Vue({
- el: '#app',
- data: function() {
- return {
- lidarLi: [{
- value: 'alivesb',
- label: '心跳识别'
- },{
- value: 'cameraoffline',
- label: '摄像头掉线'
- },{
- value: 'cameraonline',
- label: '摄像头重连'
- },{
- value: 'breakin',
- label: '目标闯入'
- },{
- value: 'leave',
- label: '目标离开'
- },{
- value: 'collision',
- label: '目标碰撞'
- }],
- wiraData: [],
- queryParem: {
- user: "",
- msgType: "",
- enddate: "",
- startdate: "",
- pageNum: 1,
- pageSize: 20
- },
- allTotal: 0,
- wramImg: "",
- dialogVisible: false,
- showPreview: false,
- imagePreview: [],
- endPicker: false,
- starPicker: false
- }
- },
- created() {
- _this = this;
- nowTime = parseTime(new Date(), '{y}-{m}-{d}');
- _this.getList();
- },
- methods: {
- getList(){
- const loading = _this.$toast({
- type: 'loading',
- loadingType: 'spinner',
- duration: 0
- });
- setTimeout(()=>{
- // let _opts = {
- // url: vipUrl + "/receive",
- // type:"GET"
- // };
- // _this.queryParem.user = "yzkj";
- // let _data = _this.queryParem;
- // let _hea = {};
- // getAxios(_opts, _data, _hea).then((res) => {
- let res = {
- data: [{
- createDate: "2023/07/10 18:13:44",
- camera: "摄像头左",
- type: "alivesb",
- msgType: "心跳",
- level: 1
- },{
- createDate: "2023/07/10 18:03:44",
- camera: "摄像头左",
- type: "cameraonline",
- msgType: "重连",
- level: 1
- },{
- createDate: "2023/07/10 17:53:29",
- camera: "摄像头左",
- type: "cameraoffline",
- msgType: "掉线",
- level: 1,
- imgUrl: ""
- },{
- createDate: "2023/07/10 17:43:52",
- camera: "摄像头左",
- type: "breakin",
- msgType: "闯入",
- level: 2,
- imgUrl: "http://210.76.81.182//hwService/cos/getObject/d4c2646fcd343d2c8f01e4d3b5555f140010.jpg"
- },{
- createDate: "2023/07/10 17:03:34",
- camera: "摄像头左",
- type: "leave",
- msgType: "离开",
- level: 2,
- imgUrl: "http://210.76.81.182//hwService/cos/getObject/d4c2646fcd343d2c8f01e4d3b5555f140010.jpg"
- },{
- createDate: "2023/07/10 16:07:20",
- camera: "摄像头左",
- type: "collision",
- msgType: "碰撞",
- level: 2,
- imgUrl: "http://210.76.81.182//hwService/cos/getObject/d4c2646fcd343d2c8f01e4d3b5555f140010.jpg"
- }],
- success: true,
- total: 6
- };
- if(res.success&&res.data.length){
- _this.allTotal = res.total;
- _this.wiraData = res.data;
- }else{
- _this.allTotal = 0;
- _this.wiraData = [];
- }
- loading.close();
- // })
- },200)
- },
- seachLi(){
- _this.queryParem.pageNum = 1;
- _this.checkQuery();
- },
- handleCurrentChange(){
- if(val != _this.queryParem.pageNum){
- _this.queryParem.pageNum = val;
- _this.initAjax();
- }
- },
- checkQuery(){
- if((isNaN(_this.queryParem.enddate)&&!isNaN(Date.parse(_this.queryParem.enddate)))&&(!isNaN(_this.queryParem.startdate)||isNaN(Date.parse(_this.queryParem.startdate)))){
- _this.$message({
- message: '请选择开始时间!',
- type: 'warning'
- });
- return;
- }
- if((isNaN(_this.queryParem.enddate)&&!isNaN(Date.parse(_this.queryParem.enddate)))&&(isNaN(_this.queryParem.startdate)&&!isNaN(Date.parse(_this.queryParem.startdate)))){
- if(new Date(_this.queryParem.enddate).getTime()<new Date(_this.queryParem.startdate).getTime()){
- let a = _this.queryParem.enddate;
- _this.queryParem.enddate = _this.queryParem.startdate;
- _this.queryParem.startdate = a;
- }
- }else if((!isNaN(_this.queryParem.enddate)||!isNaN(Date.parse(_this.queryParem.enddate)))&&(isNaN(_this.queryParem.startdate)&&!isNaN(Date.parse(_this.queryParem.startdate)))){
- _this.queryParem.enddate = nowTime;
- }
- _this.getList();
- },
- seeImg(row){
- _this.imagePreview = [row.imgUrl];
- _this.showPreview = true;
- },
- goBack(){
- top.location.href = "../mainPh.html?sn=4";
- },
- endConfirm(val){
- _this.queryParem.enddate = getDTime(val)[0];
- _this.endPicker = false;
- },
- startConfirm(val){
- _this.queryParem.startdate = getDTime(val)[0];
- _this.starPicker = false;
- },
- changePage(val){
- _this.queryParem.pageNum = val;
- _this.getList();
- }
- }
- })
|