/*! * build: vue-admin-beautiful * vue-admin-beautiful author: chuzhixin 1204505056@qq.com * vue-admin-beautiful QQ Group(QQ群): 972435319、1139183756 * time: 2024-10-10 11:14:28 */ (window["webpackJsonp"]=window["webpackJsonp"]||[]).push([["chunk-a186bb94","chunk-04801e49","chunk-48c6c59a","chunk-bb7ffe10","chunk-bb7ffe10","chunk-bb7ffe10","chunk-bb7ffe10","chunk-bb7ffe10","chunk-bb7ffe10","chunk-bb7ffe10"],{"271a":function(e,t,a){"use strict";var o=a("cb2d"),n=a("e330"),r=a("577e"),c=a("d6d6"),i=URLSearchParams,d=i.prototype,u=n(d.getAll),s=n(d.has),l=new i("a=1");!l.has("a",2)&&l.has("a",void 0)||o(d,"has",(function(e){var t=arguments.length,a=t<2?void 0:arguments[1];if(t&&void 0===a)return s(this,e);var o=u(this,e);c(t,1);var n=r(a),i=0;while(i(e.headers={token:i},e),e=>Promise.reject(e));const d=async(e,t)=>{await c.get(e,{responseType:"arraybuffer"}).then(e=>l(e,t))},u=async(e,t)=>{await c.post(e,{responseType:"arraybuffer"}).then(e=>l(e,t))},s=async(e,t)=>{await c.get(e,{responseType:"blob"}).then(e=>l(e,t))},l=(e,t)=>{const a=new Blob([e.data],{type:t.fileType?t.fileType:"application/octet-binary"}),o=window.URL.createObjectURL(a);f(o,t.fileName)},f=(e,t,a)=>{const o=document.createElement("a");o.href=e,o.download=t,document.body.appendChild(o),o.click(),document.body.removeChild(o),(null==a||a)&&window.URL.revokeObjectURL(e)},b=async(e,t)=>{let a;return await c.get(e,{responseType:"blob"}).then(e=>{a=new Blob([e.data],{type:t||"application/octet-binary"})}),window.URL.createObjectURL(a)},m=async(e,t,a)=>{let o;return await c.post(e,t,{responseType:"blob"}).then(e=>{o=new Blob([e.data],{type:a||"application/octet-binary"})}),window.URL.createObjectURL(o)},p=async(e,t)=>{let a;return await c.get(e,{responseType:"blob"}).then(e=>{a=new Blob([e.data],{type:t||"application/octet-binary"})}),a};t["default"]={ajax:c,downloadFile:d,getFile:s,getDownloadFileUrl:b,downloadPostFile:u,getDownloadFileUrlByPost:m,getDownloadFileBlob:p,downloadBlob:f}},4180:function(e,t,a){"use strict";a("b584")},5494:function(e,t,a){"use strict";var o=a("83ab"),n=a("e330"),r=a("edd0"),c=URLSearchParams.prototype,i=n(c.forEach);o&&!("size"in c)&&r(c,"size",{get:function(){var e=0;return i(this,(function(){e++})),e},configurable:!0,enumerable:!0})},"5f99":function(e,t,a){"use strict";function o(e,t){const a=parseInt(e),o=new Date,n=o.getDate(),r=new Date(o.setDate(n+a)),c=r.getFullYear(),i=r.getMonth()+1,d=r.getDate();let u,s;u=i<10?"0"+i:i,s=d<10?"0"+d:d;const l=t||"-";return c+l+u+l+s}function n(e=""){var t=new Date;""!=e&&(t=new Date(e));const a=t.getFullYear();let o=t.getMonth(),n=t.getDate();return o+=1,o=o.toString().padStart(2,"0"),n=n.toString().padStart(2,"0"),`${a}-${o}-${n}`}function r(e=""){var t=new Date;""!=e&&(t=new Date(e));const a=t.getFullYear();let o=t.getMonth();return o+=1,o=o.toString().padStart(2,"0"),`${a}-${o}`}function c(e=""){var t=new Date;""!=e&&(t=new Date(e));const a=t.getFullYear();return""+a}function i(e){const t=new Date,a=t.getFullYear(),o=t.getMonth()+1,n=t.getDate(),r=o-e,c=r<0?r+12:r>10?r:"0"+r,i=o>9?o:"0"+o,d=n>9?n:"0"+n,u=a+"-"+c+"-"+d,s=a+"-"+i+"-"+d;return[u,s]}function d(){const e=new Date,t=e.getFullYear(),a=e.getMonth()+1,o=e.getDate(),n=new Date(e);n.setDate(e.getDate()-1);const r=n.getFullYear(),c=(n.getMonth()+1).toString().padStart(2,"0"),i=n.getDate().toString().padStart(2,"0"),d=a>9?a:"0"+a,u=o>9?o:"0"+o,s=r+"-"+c+"-"+i,l=t+"-"+d+"-"+u;return[s,l]}function u(e){var t=new Date;""!=e&&(t=new Date(e));const a=t.getFullYear();let o=t.getMonth()+1;o=o<10?"0"+o:o;let n=t.getDate();n=n<10?"0"+n:n;let r=t.getHours();r=r<10?"0"+r:r;let c=t.getMinutes();c=c<10?"0"+c:c;let i=t.getSeconds();return i=i<10?"0"+i:i,a+"-"+o+"-"+n+" "+r+":"+c+":"+i}a.r(t),a.d(t,"getFMdate",(function(){return o})),a.d(t,"getDate",(function(){return n})),a.d(t,"getDate1",(function(){return r})),a.d(t,"getDate2",(function(){return c})),a.d(t,"getPastTime",(function(){return i})),a.d(t,"getPastTime1",(function(){return d})),a.d(t,"formatDateTime",(function(){return u}))},"88a7":function(e,t,a){"use strict";var o=a("cb2d"),n=a("e330"),r=a("577e"),c=a("d6d6"),i=URLSearchParams,d=i.prototype,u=n(d.append),s=n(d["delete"]),l=n(d.forEach),f=n([].push),b=new i("a=1&a=2&b=3");b["delete"]("a",1),b["delete"]("b",void 0),b+""!=="a=2"&&o(d,"delete",(function(e){var t=arguments.length,a=t<2?void 0:arguments[1];if(t&&void 0===a)return s(this,e);var o=[];l(this,(function(e,t){f(o,{key:t,value:e})})),c(t,1);var n,i=r(e),d=r(a),b=0,m=0,p=!1,h=o.length;while(b[Object(o["createVNode"])(b,null,{default:Object(o["withCtx"])(()=>[Object(o["createVNode"])(l,{width:"100",prop:"deviceCode",label:e.$t("sensor.qgq")},{default:Object(o["withCtx"])(()=>[Object(o["createVNode"])(s,{modelValue:i.queryForm.dataKey,"onUpdate:modelValue":t[0]||(t[0]=e=>i.queryForm.dataKey=e),placeholder:e.$t("sensor.qxzqgq")},{default:Object(o["withCtx"])(()=>[(Object(o["openBlock"])(!0),Object(o["createElementBlock"])(o["Fragment"],null,Object(o["renderList"])(i.sensorsData,e=>(Object(o["openBlock"])(),Object(o["createBlock"])(u,{key:e.transferId,label:e.name,value:e.transferId},null,8,["label","value"]))),128))]),_:1},8,["modelValue","placeholder"])]),_:1},8,["label"]),Object(o["createVNode"])(l,{width:"100"},{default:Object(o["withCtx"])(()=>[Object(o["createVNode"])(f,{onClick:t[1]||(t[1]=e=>d.resetForm())},{default:Object(o["withCtx"])(()=>[Object(o["createTextVNode"])(Object(o["toDisplayString"])(e.$t("defalult.chongz")),1)]),_:1}),Object(o["createVNode"])(f,{type:"primary",size:"medium",onClick:d.search},{default:Object(o["withCtx"])(()=>[Object(o["createTextVNode"])(Object(o["toDisplayString"])(e.$t("defalult.cx")),1)]),_:1},8,["onClick"]),Object(o["createVNode"])(f,{type:"primary",size:"medium",onClick:d.exportData},{default:Object(o["withCtx"])(()=>[Object(o["createTextVNode"])(Object(o["toDisplayString"])(e.$t("defalult.dc")),1)]),_:1},8,["onClick"])]),_:1})]),_:1})]),_:1},8,["model"]),Object(o["createVNode"])(p,{style:{height:"380px"}},{default:Object(o["withCtx"])(()=>[Object(o["createElementVNode"])("div",r,null,512)]),_:1}),Object(o["withDirectives"])((Object(o["openBlock"])(),Object(o["createBlock"])(g,{data:i.newTableData,border:"",stripe:"",style:{width:"100%"}},{default:Object(o["withCtx"])(()=>[Object(o["createVNode"])(h,{prop:"time",label:e.$t("sensor.ccsj"),align:"center"},null,8,["label"]),Object(o["createVNode"])(h,{prop:"name",label:e.$t("sensor.cgqmc"),align:"center"},null,8,["label"]),Object(o["createVNode"])(h,{prop:"dataKey",label:e.$t("sensor.csid"),align:"center"},null,8,["label"]),Object(o["createVNode"])(h,{prop:"value",label:e.$t("sensor.zhi"),align:"center"},null,8,["label"]),Object(o["createVNode"])(h,{prop:"unit",label:e.$t("sensor.dw"),align:"center"},null,8,["label"])]),_:1},8,["data"])),[[j,i.listLoading]]),Object(o["createVNode"])(b,null,{default:Object(o["withCtx"])(()=>[Object(o["createVNode"])(v,null,{default:Object(o["withCtx"])(()=>[Object(o["createVNode"])(y,{background:i.background,"current-page":i.queryForm.page,layout:i.layout,"page-size":i.queryForm.size,total:i.total,onCurrentChange:d.handleCurrentChange,onSizeChange:d.handleSizeChange},null,8,["background","current-page","layout","page-size","total","onCurrentChange","onSizeChange"])]),_:1})]),_:1})])}a("14d9");var i=a("aa98"),d=a("5f99"),u=a("313e"),s=a("3038"),l={components:{},data(){return{newTableData:[],data:[],deviceCode:"",projectId:"",lazy:!0,layout:"total, sizes, prev, pager, next, jumper",total:0,background:!0,listLoading:!0,elementLoadingText:"正在加载...",deviceId:"",historyData:[],sensorsData:[],sensorInfoData:[],queryForm:{page:1,size:10,sensorName:"",deviceCode:"",dataKey:"",end:""},startDate:""}},computed:{height(){return 500}},created(){this.queryForm.end=this.queryForm.start=Object(d["getFMdate"])(-1),this.queryForm.dataKey=this.$route.query.dataKey,this.queryForm.deviceCode=this.$route.query.deviceCode,this.setDefaultTime(),this.getSensorsData(),this.sensorInfo(),this.fetchData()},methods:{async fetchData(){this.listLoading=!0;const{data:e}=await Object(i["getHistoryData"])(this.queryForm);this.data=e,this.total=e.length,this.handleCurrentChange(1),setTimeout(()=>{this.listLoading=!1,this.getHistoryData()},500)},async sensorInfo(){const{data:e}=await Object(i["sensorInfo"])(this.queryForm);this.sensorInfoData=e},async getSensorsData(){const{data:e}=await Object(i["sensors"])(this.queryForm);this.sensorsData=e},async getHistoryData(){var e,t=u["a"](document.getElementById("main2"));const{data:a}=await Object(i["getReportHistoryData"])(this.queryForm);var o=[];for(let c=0;c{t["time"]=Object(d["formatDateTime"])(t[0]),t["value"]=t[1],t["name"]=e.name,t["unit"]=e.unit,t["dataKey"]=e.dataKey})},resetForm(){this.$refs.queryForm.resetFields()},showData(e){this.queryForm.dataKey=e.dataKey,this.fetchData()},handleQuery(){this.queryForm.page=1},handleSizeChange(e){this.queryForm.size=e},handleCurrentChange(e){this.queryForm.page=e;const t=this.queryForm.size;this.newTableData=this.data.slice((e-1)*t,e*t),console.log(this.newTableData),this.timeToStr()}}},f=(a("4180"),a("d959")),b=a.n(f);const m=b()(l,[["render",c],["__scopeId","data-v-15144208"]]);t["default"]=m},edd0:function(e,t,a){"use strict";var o=a("13d2"),n=a("9bf2");e.exports=function(e,t,a){return a.get&&o(a.get,t,{getter:!0}),a.set&&o(a.set,t,{setter:!0}),n.f(e,t,a)}}}]);