123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141 |
- var _this, dataObj = [],heAnth = null;
- new Vue({
- el: '#app',
- filters: {
- getNew(key){
- let _sf = getDTime(new Date((key+"").length>10?parseInt(key):parseInt(key)*1000));
- return _sf[0] + _sf[1];
- },
- setImg(_key){
- return [_key]
- }
- },
- data: function() {
- return {
- dataLi: [],
- nowTab: {},
- pictureLi: [],
- nowDate: null,
- vidSrc: "",
- dialogVisible: false,
- disAb: true
- }
- },
- created() {
- _this = this;
- heAnth = JSON.parse(localStorage.getItem("nowShip"));
- _this.initAjax();
- },
- watch: {
- nowDate(newVal){
- if(newVal == null){
- _this.nowDate = null;
- _this.disAb = true;
- _this.initAjax();
- }else{
- _this.disAb = false;
- }
- }
- },
- mounted(){
- window.addEventListener('message',(data)=>{
- if(data.data.cmd == undefined){
- heAnth = JSON.parse(localStorage.getItem("nowShip"));
- _this.nowDate = null;
- _this.initAjax();
- }
- })
- },
- methods: {
- initAjax(){
- if(heAnth !=null && heAnth != "null"&&heAnth.other_info !=null && heAnth.other_info != ""){
- var dsd = heAnth.other_info.split(",");
- const loading = this.$loading({
- background: 'rgba(0, 0, 0, 0.4)'
- })
- let _opts = {
- url: helUrl + "/index.php?ctl=bruce&act=get_group_member_list",
- type:"POST"
- };
- let _data = {
- admin_id: 7903,
- udid: "11111111",
- g_id: dsd[0]
- };
- postAxios(_opts, _data, {}).then((res) =>{
- if(res.status){
- let _obj = res.data;
- _this.dataLi = _obj.filter(item => item.device_id == dsd[1]);
- _this.nowTab = _this.dataLi[0];
- _this.getPlay();
- }else{
- _this.dataLi = [];
- }
- loading.close();
- })
- }else{
- _this.dataLi = [];
- }
- },
- getPlay(){
- const sfdsg = this.$loading({
- background: 'rgba(0, 0, 0, 0.4)'
- })
- setTimeout(()=>{
- let _opts = {
- url: helUrl + "/index.php?ctl=report&act=get_user_image",
- type:"POST"
- };
- let _data = {
- user_id: _this.nowTab.user_id,
- p: 1
- };
- let _dataY = {
- user_id: _this.nowTab.user_id,
- date: _this.nowDate,
- p: 1
- };
- postAxios(_opts,(_this.nowDate!=null?_dataY:_data), {}).then((res) =>{
- if(res.status){
- _this.pictureLi = res.data;
- }else{
- _this.pictureLi = [];
- }
- sfdsg.close();
- })
- },200)
- },
- changTab(id){
- let ind = _this.dataLi.findIndex((it,ind) => {return id == it.device_id});
- if(ind != -1){
- if(_this.dataLi[ind].device_id != _this.nowTab.device_id){
- _this.nowTab = _this.dataLi[ind];
- _this.getPlay();
- }
- }
- },
- handleClose(done) {
- _this.vidSrc = "";
- _this.dialogVisible = false;
- },
- prenDay(nu){
- if(_this.nowDate != null){
- let _dat = dayChange(_this.nowDate, parseInt(nu));
- if(_dat != undefined){
- _this.nowDate = getDTime(_dat)[0];
- _this.getPlay();
- }
- }else{
- _this.$message({
- message: '请先选择时间!',
- type: 'warning'
- });
- }
- },
- pickCli(ev){
- if(ev != null){
- _this.getPlay();
- }
- }
- }
- })
|