移动端浏览器处理吊坠报警。
Vous ne pouvez pas sélectionner plus de 25 sujets Les noms de sujets doivent commencer par une lettre ou un nombre, peuvent contenir des tirets ('-') et peuvent comporter jusqu'à 35 caractères.

1 ligne
11KB

  1. (function(e){function t(t){for(var r,a,s=t[0],c=t[1],l=t[2],u=0,h=[];u<s.length;u++)a=s[u],o[a]&&h.push(o[a][0]),o[a]=0;for(r in c)Object.prototype.hasOwnProperty.call(c,r)&&(e[r]=c[r]);f&&f(t);while(h.length)h.shift()();return i.push.apply(i,l||[]),n()}function n(){for(var e,t=0;t<i.length;t++){for(var n=i[t],r=!0,a=1;a<n.length;a++){var s=n[a];0!==o[s]&&(r=!1)}r&&(i.splice(t--,1),e=c(c.s=n[0]))}return e}var r={},a={app:0},o={app:0},i=[];function s(e){return c.p+"static/js/"+({}[e]||e)+"."+{"chunk-2d0df214":"55b65f36","chunk-4ca71562":"02fcf80f"}[e]+".js"}function c(t){if(r[t])return r[t].exports;var n=r[t]={i:t,l:!1,exports:{}};return e[t].call(n.exports,n,n.exports,c),n.l=!0,n.exports}c.e=function(e){var t=[],n={"chunk-4ca71562":1};a[e]?t.push(a[e]):0!==a[e]&&n[e]&&t.push(a[e]=new Promise(function(t,n){for(var r="static/css/"+({}[e]||e)+"."+{"chunk-2d0df214":"31d6cfe0","chunk-4ca71562":"c4fd982f"}[e]+".css",o=c.p+r,i=document.getElementsByTagName("link"),s=0;s<i.length;s++){var l=i[s],u=l.getAttribute("data-href")||l.getAttribute("href");if("stylesheet"===l.rel&&(u===r||u===o))return t()}var h=document.getElementsByTagName("style");for(s=0;s<h.length;s++){l=h[s],u=l.getAttribute("data-href");if(u===r||u===o)return t()}var f=document.createElement("link");f.rel="stylesheet",f.type="text/css",f.onload=t,f.onerror=function(t){var r=t&&t.target&&t.target.src||o,i=new Error("Loading CSS chunk "+e+" failed.\n("+r+")");i.request=r,delete a[e],f.parentNode.removeChild(f),n(i)},f.href=o;var d=document.getElementsByTagName("head")[0];d.appendChild(f)}).then(function(){a[e]=0}));var r=o[e];if(0!==r)if(r)t.push(r[2]);else{var i=new Promise(function(t,n){r=o[e]=[t,n]});t.push(r[2]=i);var l,u=document.getElementsByTagName("head")[0],h=document.createElement("script");h.charset="utf-8",h.timeout=120,c.nc&&h.setAttribute("nonce",c.nc),h.src=s(e),l=function(t){h.onerror=h.onload=null,clearTimeout(f);var n=o[e];if(0!==n){if(n){var r=t&&("load"===t.type?"missing":t.type),a=t&&t.target&&t.target.src,i=new Error("Loading chunk "+e+" failed.\n("+r+": "+a+")");i.type=r,i.request=a,n[1](i)}o[e]=void 0}};var f=setTimeout(function(){l({type:"timeout",target:h})},12e4);h.onerror=h.onload=l,u.appendChild(h)}return Promise.all(t)},c.m=e,c.c=r,c.d=function(e,t,n){c.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:n})},c.r=function(e){"undefined"!==typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},c.t=function(e,t){if(1&t&&(e=c(e)),8&t)return e;if(4&t&&"object"===typeof e&&e&&e.__esModule)return e;var n=Object.create(null);if(c.r(n),Object.defineProperty(n,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var r in e)c.d(n,r,function(t){return e[t]}.bind(null,r));return n},c.n=function(e){var t=e&&e.__esModule?function(){return e["default"]}:function(){return e};return c.d(t,"a",t),t},c.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},c.p="/",c.oe=function(e){throw console.error(e),e};var l=window["webpackJsonp"]=window["webpackJsonp"]||[],u=l.push.bind(l);l.push=t,l=l.slice();for(var h=0;h<l.length;h++)t(l[h]);var f=u;i.push([0,"chunk-vendors"]),n()})({0:function(e,t,n){e.exports=n("56d7")},"56d7":function(e,t,n){"use strict";n.r(t);var r=n("2b0e"),a=function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("div",{attrs:{id:"app"}},["/login"!==e.path?n("van-nav-bar",{attrs:{title:e.navTitle,fixed:""}}):e._e(),n("router-view"),"/login"!==e.path?n("van-tabbar",{on:{change:e.handleChangeTabbar},model:{value:e.active,callback:function(t){e.active=t},expression:"active"}},[n("van-tabbar-item",{attrs:{icon:"wap-home",to:{path:"/"}}},[e._v("首页")]),n("van-tabbar-item",{attrs:{icon:"setting",to:{path:"/setting"}}},[e._v("设置")])],1):e._e()],1)},o=[],i={data(){return{navTitle:"警报列表"}},computed:{path(){return this.$route.path},active:{get:function(){return"/"===this.$route.path?0:1},set:function(){}}},mounted(){const e=localStorage.getItem("navTitle");e?this.navTitle=e:localStorage.setItem("navTitle",this.navTitle)},methods:{handleChangeTabbar(e){this.navTitle=0===e?"警报列表":"设置中心",localStorage.setItem("navTitle",this.navTitle)}}},s=i,c=(n("7c55"),n("2877")),l=Object(c["a"])(s,a,o,!1,null,null,null);l.options.__file="App.vue";var u=l.exports,h=n("8c4f"),f=function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("div",{staticStyle:{height:"calc(100vh - 2.5rem)",overflow:"auto","margin-top":"1.3rem"}},[n("van-pull-refresh",{on:{refresh:e.onRefresh},model:{value:e.refreshing,callback:function(t){e.refreshing=t},expression:"refreshing"}},[n("van-list",{attrs:{finished:e.finished,"finished-text":e.finishedText},on:{load:e.onLoad},model:{value:e.loading,callback:function(t){e.loading=t},expression:"loading"}},e._l(e.list,function(t){return n("van-cell",{key:t.id,staticClass:"panel-container"},[n("van-panel",{attrs:{title:(t.userName?t.userName:"")+" "+(t.userMobile?t.userMobile:""),desc:""+t.createTime,status:"紧急报警"}},[n("div",{staticClass:"panel-content"},[t.address&&0!==t.longitude&&0!==t.latitude?n("div",{staticStyle:{"font-size":"0.27rem"}},[e._v("设备"+e._s(t.imei)+",在"+e._s(t.address)+"附近发起紧急报警。")]):n("div",{staticStyle:{"font-size":"0.27rem"}},[e._v("设备"+e._s(t.imei)+", "+e._s(t.address))]),n("div",{staticStyle:{"text-align":"right"}},[n("van-button",{attrs:{size:"small",type:"primary"},nativeOn:{click:function(n){e.handleDetailAlarm(t)}}},[e._v("处理")])],1)])])],1)}))],1)],1)},d=[],m=n("b970"),g=n("2f62"),p={data(){return{list:[],dialogLoading:!1,loading:!1,finished:!1,refreshing:!1,page:1,finishedText:"已经到底啦~~"}},computed:{...Object(g["c"])(["alarmList"])},methods:{...Object(g["b"])({getAlarmList:"alarm/fetchAlarmList",handleAlarms:"alarm/handleAlarms"}),onLoad(){setTimeout(()=>{this.refreshing&&(this.list=[],this.refreshing=!1),this.getAlarmList(`startTime=&endTime=&state=0&limit=10&page=${this.page}&type=0&sidx=&order=asc&serviceTime=1`).then(e=>{this.loading=!1,0===e.code?(this.list.push(...this.alarmList),this.page==e.totalPage&&(this.finishedText="已经到底啦~~",this.finished=!0),this.page++):(this.finished=!0,this.finishedText="服务器异常,请稍后重试~~")})},500)},onRefresh(){this.finished=!1,this.loading=!0,this.page=1,this.onLoad()},handleDetailAlarm(e){m["a"].confirm({title:"报警处理",message:"是否处理该紧急报警?",beforeClose:(t,n)=>{"confirm"===t?this.handleAlarms([e.id]).then(e=>{0===e.code&&(m["b"].success("处理成功!"),this.list=[],this.onRefresh()),n()}):n()}}).catch(()=>{console.log("返回")})}}},v=p,b=(n("de16"),Object(c["a"])(v,f,d,!1,null,null,null));b.options.__file="Home.vue";var T=b.exports;r["a"].use(h["a"]);var y=new h["a"]({mode:"history",routes:[{path:"/login",component:()=>n.e("chunk-4ca71562").then(n.bind(null,"d9c9")),hidden:!0},{path:"/",name:"home",component:T,meta:{title:"警报列表"}},{path:"/setting",name:"setting",component:()=>n.e("chunk-2d0df214").then(n.bind(null,"8930")),meta:{title:"设置中心"}}]}),_=n("bc3a"),S=n.n(_),w=n("a78e"),E=n.n(w);const O="User-Token";function L(){return E.a.get(O)}function k(e){return E.a.set(O,e)}function x(){return E.a.remove(O)}const A=S.a.create({baseURL:"/platform-framework",timeout:5e3});A.interceptors.request.use(e=>{return e},e=>{Promise.reject(e)}),A.interceptors.response.use(e=>{return e.code&&0!==e.code?(Message({message:e.msg||"Error",type:"error",duration:5e3}),(e.code&&401===e.code||"没有权限,请联系管理员授权"==e.msg)&&MessageBox.confirm("您已经退出登录,请重新重新登录","退出登录",{confirmButtonText:"重新登录",showCancelButton:!1,type:"warning"}).then(()=>{X.dispatch("FedLogOut").then(()=>{location.reload()})}),Promise.reject(new Error(e.msg||"Error"))):e.data||e},e=>{return console.log("err"+e),Promise.reject(e)});var P=A;function j(e){return P({url:"/sys/login",method:"post",data:e})}function C(e){return P({url:`/sys/user/info?${e}`,method:"get"})}function I(e){return P({url:`/logout?${e}`,method:"get"})}var M=n("ed08");const N={state:{token:L(),userInfo:{}},mutations:{SET_TOKEN:(e,t)=>{e.token=t},SET_USERINFO:(e,t)=>{e.userInfo=t}},actions:{Login({commit:e},t){return new Promise((n,r)=>{j(t).then(t=>{const{code:r}=t;if(n(t),0!==r)return;const a=Object(M["b"])();k(a),e("SET_TOKEN",a)}).catch(e=>{r(e)})})},GetUserInfo({commit:e,state:t}){return new Promise((t,n)=>{C((new Date).getTime()).then(n=>{const{code:r,user:a}=n;0===r&&e("SET_USERINFO",a),t(r)}).catch(e=>{n(e)})})},LogOut({commit:e,time:t}){return new Promise((n,r)=>{I(t).then(()=>{e("SET_TOKEN",""),x(),n()}).catch(e=>{r(e)})})},FedLogOut({commit:e}){return new Promise(t=>{e("SET_TOKEN",""),x(),t()})}}};var $=N;function R(e){return P({url:`/alarm/list?${e}`,method:"get"})}function F(e){return P({url:"/alarm/handle",method:"post",data:e})}const B={alarmList:"",alarmMsg:""},G={SET_ALARM_LIST:(e,t)=>{e.alarmList=t},SET_ALARM_MSG:(e,t)=>{e.alarmMsg=t}},U={fetchAlarmList({commit:e},t){return new Promise((n,r)=>{R(t).then(t=>{if(0===t.code){const{page:n}=t;e("SET_ALARM_LIST",n.list)}"没有权限,请联系管理员授权"==t.msg&&e("SET_ALARM_LIST",[]),n(t)}).catch(e=>{r(e)})})},handleAlarms({commit:e},t){return new Promise((e,n)=>{F(t).then(t=>{e(t)}).catch(e=>{n(e)})})}};var K={namespaced:!0,state:B,mutations:G,actions:U};function q(e){return P({url:`/sys/config/list?${e}`,method:"get"})}function z(e){return P({url:"/sys/config/update",method:"post",data:e})}const D={sysConfig:""},Y={SET_SYS_CONFIG:(e,t)=>{e.sysConfig=t}},J={fetchSysConfig({commit:e},t){return new Promise((n,r)=>{q(t).then(t=>{if(0===t.code){const{page:n}=t;e("SET_SYS_CONFIG",...n.list)}"没有权限,请联系管理员授权"==t.msg&&e("SET_SYS_CONFIG",""),n(t)}).catch(e=>{r(e)})})},handleSysConfigs({commit:e},t){return new Promise((e,n)=>{z(t).then(t=>{e(t)}).catch(e=>{n(e)})})}};var H={namespaced:!0,state:D,mutations:Y,actions:J};const Q={token:e=>e.user.token,userInfo:e=>e.user.userInfo,alarmList:e=>e.alarm.alarmList,alarmMsg:e=>e.alarm.alarmMsg,sysConfig:e=>e.setting.sysConfig};var V=Q;r["a"].use(g["a"]);const W=new g["a"].Store({modules:{user:$,alarm:K,setting:H},getters:V});var X=W;n("a4b1");const Z=["/login"];y.beforeEach(async(e,t,n)=>{if(L())if("/login"===e.path)n({path:"/"});else if(X.getters.userInfo.userId)n();else{const t=await X.dispatch("GetUserInfo");0===t?n():X.dispatch("FedLogOut").then(()=>{n(`/login?redirect=${e.path}`)})}else-1!==Z.indexOf(e.path)||-1!==Z.indexOf(e.path.split("to/")[0]+"to")?n():n(`/login?redirect=${e.path}`)});n("157a"),n("5cfb");r["a"].use(m["c"]),r["a"].config.productionTip=!1,new r["a"]({router:y,store:X,render:e=>e(u)}).$mount("#app")},"5c48":function(e,t,n){},"7c55":function(e,t,n){"use strict";var r=n("5c48"),a=n.n(r);a.a},a4b1:function(e,t,n){},de16:function(e,t,n){"use strict";var r=n("f3e7"),a=n.n(r);a.a},ed08:function(e,t,n){"use strict";function r(e){var t="该用户名合法";return""==e?(t="用户名为空",t):e.length<5||e.length>20?(t="用户名必须为5 ~ 20位",t):a(e)?(t="不能含有特殊字符",t):t}function a(e){for(var t=["&","\\","/","*",">","<","@","!"],n=0;n<t.length;n++)for(var r=0;r<e.length;r++)if(t[n]==e.charAt(r))return!0;return!1}function o(){const e=[],t="0123456789abcdef";for(let r=0;r<36;r++)e[r]=t.substr(Math.floor(16*Math.random()),1);e[14]="4",e[19]=t.substr(3&e[19]|8,1),e[8]=e[13]=e[18]=e[23]="-";const n=e.join("");return n}n.d(t,"a",function(){return r}),n.d(t,"b",function(){return o})},f3e7:function(e,t,n){}});