53.e0db7bd527cbdc253667.js 7.2 KB

1
  1. webpackJsonp([53],{"6sMW":function(t,e,i){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var n=i("3cXf"),s=i.n(n),a={data:function(){return{id:this.$store.state.bzy_photo_id,d_id:this.$store.state.bzy_photo_did,zanwu:"/images/expertDiagnosis/zanwu.png",totalNum:0,timeRange:[],delBtnState:!0,downBtnState:!0,photoList:[],queryInfo:{begin:"",end:"",page:1},idList:[],photoDescDialogVisible:!1,times:50}},mounted:function(){this.getPhoteList()},computed:{userType:function(){return this.$store.state.myuser_type}},methods:{equipStatusCheck:function(t){this.active=t,0==t&&this.equipBtnControl("takephoto"),1==t&&this.getPhoteList(),2==t&&(this.delBtnState=!1),3==t&&(this.idList=this.photoList.filter(function(t){return 1==t.checked}).map(function(t){return t.id}),0==this.idList.length?this.$message.warning("请选择要删除的图片!"):this.delImgFun(this.idList)),4==t&&(this.photoList.map(function(t){t.checked=!1}),this.delBtnState=!0),5==t&&this.delImgFun(""),7==t&&(this.downBtnState=!this.downBtnState),8==t&&(this.idList=this.photoList.filter(function(t){return 1==t.checked}).map(function(t){return t.id}),0==this.idList.length?this.$message.warning("请选择要下载的图片!"):this.downPhoto(this.idList)),9==t&&(this.photoList.map(function(t){t.checked=!1}),this.downBtnState=!this.downBtnState)},equipBtnControl:function(t){var e=this;this.$axios({method:"POST",url:"/api/api_gateway?method=forecast.send_control.admin_device_control",data:this.qs.stringify({cmd:t,device_type_id:7,d_id:this.d_id})}).then(function(t){""==t.data.message&&e.$message.success("指令下发成功!")})},getPhoteList:function(){var t=this;this.$axios({method:"POST",url:"/api/api_gateway?method=forecast.forecast_system.equip_photo",data:this.qs.stringify({device_id:this.id,ret:"list",page:this.queryInfo.page,page_number:8,time_begin:this.queryInfo.begin,time_end:this.queryInfo.end})}).then(function(e){if(""==e.data.message){var i=e.data.data.data;t.photoList=i.map(function(t){return t.checked=!1,t}),t.totalNum=e.data.data.num,t.$message.success("请求最新图片成功!")}})},changePage:function(t){this.queryInfo.page=t,this.getPhoteList()},DateChange:function(){this.queryInfo.page=1,this.timeRange?(this.queryInfo.begin=parseInt(new Date(this.timeRange[0]).getTime()/1e3),this.queryInfo.end=parseInt(new Date(this.timeRange[1]).getTime()/1e3)):(this.queryInfo.begin="",this.queryInfo.end=""),this.getPhoteList()},viewDes:function(){var t=this;this.$prompt("图片描述","添加详情",{confirmButtonText:"保存",cancelButtonText:"取消"}).then(function(t){t.value}).catch(function(){t.$message({type:"info",message:"取消输入"})})},delImgFun:function(t){var e=this;this.$confirm("此操作将永久删除该设备图片, 是否继续?","提示",{confirmButtonText:"确定",cancelButtonText:"取消",type:"warning"}).then(function(){e.$axios({method:"POST",url:"/api/api_gateway?method=forecast.forecast_system.equip_photo_del",data:e.qs.stringify({device_id:e.id,addrlist:s()(t)})}).then(function(t){""==t.data.message&&(e.$message({type:"success",message:"删除成功!"}),e.getPhoteList())})}).catch(function(){e.$message({type:"info",message:"已取消删除"})})},delectImg:function(t){this.delImgFun([t])},goBackPage:function(){this.$router.go(-1)},downloadFile:function(t){var e=new Blob([t],{type:"application/zip"}),i=window.URL.createObjectURL(e),n=document.createElement("a");n.href=i,n.download="下载图片",n.click(),URL.revokeObjectURL(i)},downPhoto:function(t){var e=this,i=(this.$store.state.user_id,s()(t)),n=this.qs.stringify({id_list:i,device_id:this.id});this.$axios({method:"post",url:"/api/download",data:n,responseType:"blob"}).then(function(t){""==t.data.message&&(e.$message.success("图片下载中!"),e.downloadFile(t.data))})}}},o={render:function(){var t=this,e=t.$createElement,i=t._self._c||e;return i("div",{staticClass:"innerMargin"},[i("el-card",{staticClass:"box-card"},[i("div",{staticClass:"check-btns"},[i("div",{staticClass:"type-check"},[i("el-button",{attrs:{type:"blueInfo",size:"mini"},on:{click:function(e){return t.equipStatusCheck("0")}}},[t._v("拍照")]),t._v(" "),i("el-button",{attrs:{type:"blueInfo",size:"mini"},on:{click:function(e){return t.equipStatusCheck("1")}}},[t._v("刷新")]),t._v(" "),1==t.userType?[t.delBtnState?i("el-button",{attrs:{type:"blueInfo",size:"mini"},on:{click:function(e){return t.equipStatusCheck("2")}}},[t._v("批量删除")]):t._e(),t._v(" "),t.delBtnState?t._e():i("el-button",{attrs:{type:"blueInfo",size:"mini"},on:{click:function(e){return t.equipStatusCheck("3")}}},[t._v("删除")]),t._v(" "),t.delBtnState?t._e():i("el-button",{attrs:{size:"mini"},on:{click:function(e){return t.equipStatusCheck("4")}}},[t._v("取消")]),t._v(" "),i("el-button",{attrs:{type:"blueInfo",size:"mini"},on:{click:function(e){return t.equipStatusCheck("5")}}},[t._v("一键删除")]),t._v(" "),t.downBtnState?i("el-button",{attrs:{type:"blueInfo",size:"mini"},on:{click:function(e){return t.equipStatusCheck("7")}}},[t._v("图片下载")]):t._e(),t._v(" "),t.downBtnState?t._e():i("el-button",{attrs:{type:"blueInfo",size:"mini"},on:{click:function(e){return t.equipStatusCheck("8")}}},[t._v("下载")]),t._v(" "),t.downBtnState?t._e():i("el-button",{attrs:{size:"mini"},on:{click:function(e){return t.equipStatusCheck("9")}}},[t._v("取消")])]:t._e()],2),t._v(" "),i("div",{staticClass:"search-box"},[i("el-date-picker",{staticStyle:{cursor:"pointer"},attrs:{size:"mini",type:"daterange","range-separator":"至",clearable:"","start-placeholder":"开始日期","end-placeholder":"结束日期"},on:{change:t.DateChange},model:{value:t.timeRange,callback:function(e){t.timeRange=e},expression:"timeRange"}})],1)]),t._v(" "),t.photoList.length>0?i("el-row",{directives:[{name:"viewer",rawName:"v-viewer"}],attrs:{gutter:30}},t._l(t.photoList,function(e){return i("el-col",{key:e.addr,attrs:{xs:24,sm:24,md:12,lg:8,xl:6}},[i("div",{staticClass:"photoItem"},[i("div",{staticClass:"photoInfo"},[1==t.userType?[i("i",{directives:[{name:"show",rawName:"v-show",value:t.delBtnState&&t.downBtnState,expression:"delBtnState && downBtnState"}],staticClass:"iconfont icon-shanchu",on:{click:function(i){return t.delectImg(e.id)}}}),t._v(" "),i("el-checkbox",{directives:[{name:"show",rawName:"v-show",value:!t.delBtnState||!t.downBtnState,expression:"!delBtnState || !downBtnState"}],model:{value:e.checked,callback:function(i){t.$set(e,"checked",i)},expression:"item.checked"}})]:t._e()],2),t._v(" "),i("div",{staticClass:"photoImg"},[-1!=e.addr.indexOf("http")?[i("img",{directives:[{name:"lazy",rawName:"v-lazy",value:e.addr,expression:"item.addr"}],attrs:{alt:""}})]:[i("img",{directives:[{name:"lazy",rawName:"v-lazy",value:t.$host+e.addr,expression:"$host + item.addr"}]})]],2),t._v(" "),i("div",{staticClass:"date",staticStyle:{background:"#fff"}},[t._v("\n "+t._s(t._f("formatTime")(1e3*e.addtime))+"\n ")])])])}),1):i("div",{staticStyle:{"text-align":"center"}},[i("img",{attrs:{src:t.$imghost+t.zanwu,alt:""}})]),t._v(" "),t.photoList.length>0?i("el-pagination",{attrs:{background:"",layout:"prev, pager, next",total:t.totalNum},on:{"current-change":t.changePage}}):t._e()],1)],1)},staticRenderFns:[]};var c=i("C7Lr")(a,o,!1,function(t){i("NXf0")},"data-v-46ebb5b6",null);e.default=c.exports},NXf0:function(t,e){}});