| 12 |
- (global["webpackJsonp"]=global["webpackJsonp"]||[]).push([["pages/cbqxyj/warnset"],{1096:function(e,n,t){"use strict";(function(e,n){var o=t(4);t(26);o(t(25));var i=o(t(1097));e.__webpack_require_UNI_MP_PLUGIN__=t,n(i.default)}).call(this,t(1)["default"],t(2)["createPage"])},1097:function(e,n,t){"use strict";t.r(n);var o=t(1098),i=t(1100);for(var s in i)["default"].indexOf(s)<0&&function(e){t.d(n,e,(function(){return i[e]}))}(s);t(1102);var a,r=t(32),u=Object(r["default"])(i["default"],o["render"],o["staticRenderFns"],!1,null,null,null,!1,o["components"],a);u.options.__file="pages/cbqxyj/warnset.vue",n["default"]=u.exports},1098:function(e,n,t){"use strict";t.r(n);var o=t(1099);t.d(n,"render",(function(){return o["render"]})),t.d(n,"staticRenderFns",(function(){return o["staticRenderFns"]})),t.d(n,"recyclableRender",(function(){return o["recyclableRender"]})),t.d(n,"components",(function(){return o["components"]}))},1099:function(e,n,t){"use strict";var o;t.r(n),t.d(n,"render",(function(){return i})),t.d(n,"staticRenderFns",(function(){return a})),t.d(n,"recyclableRender",(function(){return s})),t.d(n,"components",(function(){return o}));try{o={uInput:function(){return Promise.all([t.e("common/vendor"),t.e("uview-ui/components/u-input/u-input")]).then(t.bind(null,1264))},uIcon:function(){return t.e("uview-ui/components/u-icon/u-icon").then(t.bind(null,1200))},uRadioGroup:function(){return Promise.all([t.e("common/vendor"),t.e("uview-ui/components/u-radio-group/u-radio-group")]).then(t.bind(null,1371))},uRadio:function(){return t.e("uview-ui/components/u-radio/u-radio").then(t.bind(null,1378))},uSwitch:function(){return t.e("uview-ui/components/u-switch/u-switch").then(t.bind(null,1423))},uMask:function(){return t.e("uview-ui/components/u-mask/u-mask").then(t.bind(null,1466))},uSelect:function(){return t.e("uview-ui/components/u-select/u-select").then(t.bind(null,1402))}}}catch(r){if(-1===r.message.indexOf("Cannot find module")||-1===r.message.indexOf(".vue"))throw r;console.error(r.message),console.error("1. 排查组件名称拼写是否正确"),console.error("2. 排查组件是否符合 easycom 规范,文档:https://uniapp.dcloud.net.cn/collocation/pages?id=easycom"),console.error("3. 若组件不符合 easycom 规范,需手动引入,并在 components 中注册该组件")}var i=function(){var e=this,n=e.$createElement,t=(e._self._c,e.selbaselist.length),o=e.selbaselist.length,i=e.selbaselist.length,s=e.userphone.length,a=e.userphone.length;e._isMounted||(e.e0=function(n){e.accServiceShow=!0},e.e1=function(n,t){var o=arguments[arguments.length-1].currentTarget.dataset,i=o.eventParams||o["event-params"];t=i.index;e.selwormindex=t,e.wormshow=!0},e.e2=function(n){e.accServiceShowphone=!0}),e.$mp.data=Object.assign({},{$root:{g0:t,g1:o,g2:i,g3:s,g4:a}})},s=!1,a=[];i._withStripped=!0},1100:function(e,n,t){"use strict";t.r(n);var o=t(1101),i=t.n(o);for(var s in o)["default"].indexOf(s)<0&&function(e){t.d(n,e,(function(){return o[e]}))}(s);n["default"]=i.a},1101:function(e,n,t){"use strict";(function(e){var o=t(4);Object.defineProperty(n,"__esModule",{value:!0}),n.default=void 0;var i=o(t(41)),s=o(t(43)),a=o(t(290)),r=function(){t.e("components/multiple-select").then(function(){return resolve(t(1480))}.bind(null,t)).catch(t.oe)},u={components:{multipleSelect:r},data:function(){return{warning_id:"",selbaselist:[],warnjihe:"0",accServiceShow:!1,serviceList:[],defaultSelected:[],userphone:[],accServiceShowphone:!1,serviceListphone:[],defaultSelectedphone:[],title:"",conf:{pestCategory:!1,pestCategoryNum:"",appointPest:!1,pestTotalNum:"",pestTotal:!1,pestWarn:!1},confnum:[{appointPestName:"",appointPestNum:"",appointPestNameid:""}],device_ids:[],send_user:[],wormshow:!1,wormlist:[],selwormindex:0}},methods:{accServiceConfirm:function(e){this.selbaselist=[],this.device_ids=[];for(var n=0;n<e.length;n++)this.selbaselist.push(e[n].name),this.device_ids.push(e[n].value);console.log(e)},accServiceConfirmphone:function(e){this.userphone=[],this.send_user=[];for(var n=0;n<e.length;n++)this.userphone.push(e[n].name),this.send_user.push(e[n].value)},getpeizhi:function(e){var n=this;return(0,s.default)(i.default.mark((function t(){var o,s,r,u,c;return i.default.wrap((function(t){while(1)switch(t.prev=t.next){case 0:return t.next=2,n.$myRequest({url:"/api/api_gateway?method=device.device_sms_alert.user_pest_warning_statsu",data:{warning_id:e}});case 2:for(s in o=t.sent,console.log(o),n.confnum=[],n.conf.pestCategory="on"==o.conf.pestCategory,n.conf.appointPest="on"==o.conf.appointPest,n.conf.pestTotal="on"==o.conf.pestTotal,n.conf.pestWarn="on"==o.conf.pestWarn,n.conf.pestCategoryNum=o.conf.pestCategoryNum,n.conf.pestTotalNum=o.conf.pestTotalNum,n.title=o.warning_name,o.device_ids)n.selbaselist.push(o.device_ids[s]),n.defaultSelected.push(Number(s)),n.device_ids.push(Number(s));for(s in console.log(n.defaultSelected),o.send_user)n.userphone.push(o.send_user[s][0]+"/"+o.send_user[s][1]),n.defaultSelectedphone.push(Number(s)),n.send_user.push(Number(s));for(s in r=0,o.conf)-1!=s.indexOf("appointPestName")&&r++;for(u=0;u<r;u++)c=0==u?{appointPestName:a.default[Number(o.conf["appointPestName"])],appointPestNum:o.conf["appointPestNum"],appointPestNameid:o.conf["appointPestName"]}:{appointPestName:a.default[Number(o.conf["appointPestName"+u])],appointPestNum:o.conf["appointPestNum"+u],appointPestNameid:o.conf["appointPestName"+u]},n.confnum.push(c);case 18:case"end":return t.stop()}}),t)})))()},getbaselist:function(){var e=this;return(0,s.default)(i.default.mark((function n(){var t,o,s;return i.default.wrap((function(n){while(1)switch(n.prev=n.next){case 0:return n.next=2,e.$myRequest({url:"/api/api_gateway?method=device.device_sms_alert.user_warning_device_list",data:{device_type_id:"3",page:"1",page_size:"999999999"}});case 2:for(t=n.sent,o=0;o<t.data.length;o++)s={value:t.data[o].d_id,name:t.data[o].device_id},e.serviceList.push(s);case 4:case"end":return n.stop()}}),n)})))()},getuseriphonelist:function(){var e=this;return(0,s.default)(i.default.mark((function n(){var t,o,s;return i.default.wrap((function(n){while(1)switch(n.prev=n.next){case 0:return n.next=2,e.$myRequest({url:"/api/api_gateway?method=device.device_sms_alert.user_warning_liaisons_list",data:{page:1,page_size:9999999}});case 2:for(t=n.sent,e.serviceListphone=[],o=0;o<t.data.length;o++)s={value:t.data[o].d_id,name:t.data[o].liaisons+"/"+t.data[o].phone},e.serviceListphone.push(s);case 5:case"end":return n.stop()}}),n)})))()},tobook:function(){e.navigateTo({url:"./addressbook"})},selconfirm:function(e){console.log(e,this.selwormindex),this.confnum[this.selwormindex].appointPestName=e[0].label,this.confnum[this.selwormindex].appointPestNameid=e[0].value},addconfitem:function(){for(var n=0;n<this.confnum.length;n++)if(""==this.confnum[n].appointPestName||""==this.confnum[n].appointPestNum)return void e.showToast({title:"请先将信息填写完成后添加",icon:"none"});var t={appointPestName:"",appointPestNum:""};this.confnum.push(t)},delconfitem:function(e){this.confnum.splice(e,1)},yanzheng:function(){for(var e=0;e<this.confnum.length;e++)if(""==this.confnum[e].appointPestName||""==this.confnum[e].appointPestNum)return!0;return!1},send:function(){var n=this;return(0,s.default)(i.default.mark((function t(){var o,s,a,r;return i.default.wrap((function(t){while(1)switch(t.prev=t.next){case 0:if(0!=n.selbaselist.length){t.next=4;break}e.showToast({title:"请选择预警设备",icon:"none"}),t.next=38;break;case 4:if(0!=n.conf.pestCategory||0!=n.conf.appointPest||0!=n.conf.pestTotal||0!=n.conf.pestWarn){t.next=8;break}e.showToast({title:"请开启至少一种预警",icon:"none"}),t.next=38;break;case 8:if(!n.conf.pestCategory||""!=n.conf.pestCategoryNum){t.next=12;break}e.showToast({title:"请将目标种类预警信息填写完整",icon:"none"}),t.next=38;break;case 12:if(!n.conf.appointPest||!n.yanzheng()){t.next=16;break}e.showToast({title:"请将数量预警信息填写完整",icon:"none"}),t.next=38;break;case 16:if(!n.conf.pestTotal||""!=n.conf.pestTotalNum){t.next=20;break}e.showToast({title:"请将总数预警信息填写完整",icon:"none"}),t.next=38;break;case 20:if(0!=n.userphone.length){t.next=24;break}e.showToast({title:"请选择短信接收人",icon:"none"}),t.next=38;break;case 24:if(console.log(n.device_ids),console.log(n.send_user),!(n.title.length>32||""==n.title)){t.next=29;break}return e.showToast({title:"标题不能为空且长度不大于32个字符",icon:"none"}),t.abrupt("return");case 29:for(o={},s=0;s<n.confnum.length;s++)0==s?(o["appointPestName"]=n.confnum[s].appointPestNameid,o["appointPestNum"]=n.confnum[s].appointPestNum):(o["appointPestName"+s]=n.confnum[s].appointPestNameid,o["appointPestNum"+s]=n.confnum[s].appointPestNum);for(a in n.conf)o[a]="pestCategory"==a||"appointPest"==a||"pestTotal"==a||"pestWarn"==a?n.conf[a]?"on":"off":n.conf[a];return console.log(o),t.next=35,n.$myRequest({url:"/api/api_gateway?method=device.device_sms_alert.create_user_pest_warning",data:{conf:JSON.stringify(o),device_ids:n.device_ids.join(","),send_user:n.send_user.join(","),warning_id:n.warning_id,warning_type:n.warnjihe,title:n.title}});case 35:r=t.sent,console.log(r),r&&e.showToast({title:"预警配置成功",icon:"none",complete:function(){e.navigateBack({delta:1})}});case 38:case"end":return t.stop()}}),t)})))()}},onLoad:function(e){for(var n in this.wormlist=[],a.default){var t={value:n,label:a.default[n]};this.wormlist.push(t)}this.getbaselist(),this.getuseriphonelist(),e.id&&(this.getpeizhi(e.id),this.warning_id=e.id)}};n.default=u}).call(this,t(2)["default"])},1102:function(e,n,t){"use strict";t.r(n);var o=t(1103),i=t.n(o);for(var s in o)["default"].indexOf(s)<0&&function(e){t.d(n,e,(function(){return o[e]}))}(s);n["default"]=i.a},1103:function(e,n,t){}},[[1096,"common/runtime","common/vendor"]]]);
- //# sourceMappingURL=../../../.sourcemap/mp-weixin/pages/cbqxyj/warnset.js.map
|