123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141 |
- var _this;
- var loading;
- var baseTok = null, shipForm = {}, nowDate = "";
- var fatCount = 1;
- new Vue({
- el: '#app',
- filters: {
- setTime(_key){
- let _sf = getDTime(new Date((_key+"").length>10?parseInt(_key):parseInt(_key)*1000));
- return _sf[0] + _sf[1];
- },
- setImg(_key){
- let _sfj = "";
- if(_key != undefined){
- let _safd = _sfj.split(";")[0];
- _sfj = "https://www.enstation.vip:9443" + _safd.split(":8170")[1];
- if(_key.indexOf("Waring") == -1){
- _sfj = _sfj.replace(/faceImg\/businessFile/g,"alarm_folder/display_image");
- }
- }
- return _sfj
- }
- },
- data: function() {
- return {
- alretList: [],
- alretType: "",
- shipName: "",
- loading: true,
- endDay: "",
- starDay: "",
- curPage: 1,
- allTotal: 0,
- endPicker: false,
- starPicker: false,
- showPreview: false,
- imagePreview: [],
- hisVideo: false,
- hisVideoSrc: ""
- }
- },
- created:function(){
- _this = this;
- nowDate = getDTime(new Date());
- shipForm = JSON.parse(localStorage.getItem("nowShip"));
- let dh = location.search.split("&");
- fatCount = dh[1].split("=")[1];
- _this.alretType = dh[0].split("=")[1];
- _this.getList();
- },
- methods: {
- getList(){
- if(shipForm !=null && shipForm != "null"&&shipForm.en_name != ""&&shipForm.en_name != null){
- loading = _this.$toast({
- type: 'loading',
- loadingType: 'spinner',
- duration: 0
- });
- let _opts = {
- url: vipUrl + "/receive",
- type:"GET"
- };
- let _data = {
- user: shipForm.en_name,
- msgType: _this.alretType,
- enddate: _this.endDay,
- startdate: _this.starDay,
- pageNum: (_this.curPage - 1),
- pageSize: 12,
- };
- let _hea = {
- "Authorization": "ZDhlNjhjOTAwM2EyJWd6eXolaWUldXNlciV6aF9DTg==",
- "Content-Type": "application/json;charset=UTF-8"
- };
- getAxios(_opts, _data, _hea).then((res) => {
- if(res.success&&res.data.length){
- _this.allTotal = res.total;
- _this.alretList = res.data;
- }else{
- _this.allTotal = 0;
- _this.alretList = [];
- }
- loading.close();
- })
- }else{
- _this.alretList = [];
- }
- },
- endConfirm(val){
- _this.endDay = getDTime(val)[0];
- _this.endPicker = false;
- },
- startConfirm(val){
- _this.starDay = getDTime(val)[0];
- _this.starPicker = false;
- },
- seachLi(){
- if(_this.endDay == ""&&_this.starDay == ""){
- this.$toast({
- type: 'fail',
- message: '至少选择一个时间段查询!'
- });
- }else{
- _this.curPage = 1;
- _this.starDay = _this.starDay == "" ? "2021-01-01" : _this.starDay;
- _this.endDay = _this.endDay == "" ? nowDate[0] : _this.endDay;
- _this.getList();
- }
- },
- previewImg(kyt){
- let _arr = [];
- if(kyt != undefined){
- let _safd = kyt.split(";");
- _safd.forEach(item =>{
- item = "https://www.enstation.vip:9443" + item.split(":8170")[1];
- if(item.indexOf("Waring") == -1){
- item = item.replace(/faceImg\/businessFile/g,"alarm_folder/display_image");
- }
- _arr.push(item);
- });
- }
- _this.showPreview = true;
- _this.imagePreview = _arr;
- },
- seeVid(val){
- _this.hisVideo = true;
- if(val.indexOf(":8170/") != -1){
- _this.hisVideoSrc = `https://www.enstation.vip:9443${val.split(":8170")[1]}`
- }else{
- _this.hisVideoSrc = "";
- }
- },
- changePage(val){
- _this.curPage = val;
- _this.getList();
- },
- goBack(){
- top.location.href = "../mainPh.html?sn="+fatCount;
- }
- }
- })
|