1 line
6.1 KiB
JavaScript
1 line
6.1 KiB
JavaScript
(window["webpackJsonp"]=window["webpackJsonp"]||[]).push([["chunk-1022b97a"],{2544:function(e,t,r){"use strict";r.d(t,"e",(function(){return i})),r.d(t,"d",(function(){return s})),r.d(t,"f",(function(){return u})),r.d(t,"a",(function(){return a})),r.d(t,"b",(function(){return o})),r.d(t,"g",(function(){return c})),r.d(t,"c",(function(){return l}));var n=r("b775");function i(e){return Object(n["a"])({url:"/iot/deviceUser/list",method:"get",params:e})}function s(e,t){return Object(n["a"])({url:"/iot/deviceUser/"+e+"/"+t,method:"get"})}function u(e){return Object(n["a"])({url:"/iot/deviceUser/shareUser",method:"get",params:e})}function a(e){return Object(n["a"])({url:"/iot/deviceUser",method:"post",data:e})}function o(e){return Object(n["a"])({url:"/iot/deviceUser/addDeviceUsers",method:"post",data:e})}function c(e){return Object(n["a"])({url:"/iot/deviceUser",method:"put",data:e})}function l(e){return Object(n["a"])({url:"/iot/deviceUser",method:"delete",data:e})}},bb86:function(e,t,r){"use strict";r.d(t,"d",(function(){return i})),r.d(t,"c",(function(){return s})),r.d(t,"b",(function(){return u})),r.d(t,"a",(function(){return a})),r.d(t,"e",(function(){return o}));var n=r("b775");r("bc3a"),r("5c96"),r("21a6"),r("5f87"),r("c38a");function i(e){return Object(n["a"])({url:"/iot/tool/register",headers:{isToken:!1},method:"post",data:e})}function s(e){return Object(n["a"])({url:"/iot/tool/userList",method:"get",params:e})}function u(e){return Object(n["a"])({url:"/iot/tool/getTopics",method:"get",params:e})}function a(e){return Object(n["a"])({url:"/iot/tool/decode",method:"get",params:e})}function o(e){return Object(n["a"])({url:"/iot/tool/simulate",method:"get",params:e})}},e018:function(e,t,r){"use strict";r.r(t);var n=function(){var e=this,t=e.$createElement,r=e._self._c||t;return r("el-dialog",{attrs:{title:"选择用户",visible:e.openSelectUser,width:"800px"},on:{"update:visible":function(t){e.openSelectUser=t}}},[r("div",{staticStyle:{"margin-top":"-50px"}},[r("el-divider")],1),r("el-form",{ref:"queryForm",attrs:{model:e.queryParams,rules:e.rules,inline:!0,"label-width":"80px"}},[r("el-form-item",{attrs:{label:"手机号码",prop:"phonenumber"}},[r("el-input",{staticStyle:{width:"240px"},attrs:{type:"text",placeholder:"请输入用户手机号码",minlength:"10",clearable:"",size:"small","show-word-limit":""},nativeOn:{keyup:function(t){return!t.type.indexOf("key")&&e._k(t.keyCode,"enter",13,t.key,"Enter")?null:e.handleQuery(t)}},model:{value:e.queryParams.phonenumber,callback:function(t){e.$set(e.queryParams,"phonenumber",t)},expression:"queryParams.phonenumber"}})],1),r("el-form-item",[r("el-button",{attrs:{type:"primary",icon:"el-icon-search",size:"mini"},on:{click:e.handleQuery}},[e._v("查询")])],1)],1),r("el-table",{directives:[{name:"loading",rawName:"v-loading",value:e.loading,expression:"loading"}],attrs:{data:e.userList,"highlight-current-row":"",size:"mini",border:""},on:{"current-change":e.handleCurrentChange}},[r("el-table-column",{attrs:{label:"选择",width:"50",align:"center"},scopedSlots:e._u([{key:"default",fn:function(e){return[r("input",{attrs:{type:"radio",name:"user"},domProps:{checked:e.row.isSelect}})]}}])}),r("el-table-column",{key:"userId",attrs:{label:"用户编号",align:"center",prop:"userId",width:"120"}}),r("el-table-column",{key:"userName",attrs:{label:"用户名称",align:"center",prop:"userName"}}),r("el-table-column",{key:"nickName",attrs:{label:"用户昵称",align:"center",prop:"nickName"}}),r("el-table-column",{key:"phonenumber",attrs:{label:"手机号码",align:"center",prop:"phonenumber",width:"120"}}),r("el-table-column",{attrs:{label:"创建时间",align:"center",prop:"createTime",width:"160"},scopedSlots:e._u([{key:"default",fn:function(t){return[r("span",[e._v(e._s(e.parseTime(t.row.createTime)))])]}}])})],1),r("div",{staticClass:"dialog-footer",attrs:{slot:"footer"},slot:"footer"},[r("el-button",{attrs:{type:"primary"},on:{click:e.addDeviceUser}},[e._v("分享")]),r("el-button",{on:{click:e.closeSelectUser}},[e._v("关 闭")])],1)],1)},i=[],s=(r("d3b7"),r("159b"),r("14d9"),r("bb86")),u=r("2544"),a={name:"user-list",props:{device:{type:Array,default:null}},watch:{device:function(e,t){this.deviceInfo=e}},data:function(){return{loading:!1,ids:[],title:"",userList:[],user:{},deviceInfo:{},openSelectUser:!1,queryParams:{pageNum:1,pageSize:10,userName:void 0,phonenumber:void 0,status:0,deptId:void 0},rules:{phonenumber:[{required:!0,message:"手机号码不能为空",trigger:"blur"},{min:11,max:11,message:"手机号码长度为11位",trigger:"blur"}]}}},created:function(){},methods:{getList:function(){var e=this;this.loading=!0,Object(s["c"])(this.addDateRange(this.queryParams,this.dateRange)).then((function(t){e.userList=t.rows,e.total=t.total,e.loading=!1}))},handleQuery:function(){var e=this;this.$refs["queryForm"].validate((function(t){t&&(e.queryParams.pageNum=1,e.getList())}))},resetQuery:function(){this.$refs["queryForm"].resetFields(),this.userList=[]},setRadioSelected:function(e){for(var t=0;t<this.userList.length;t++)this.userList[t].userId==e?(this.userList[t].isSelect=!0,this.user=this.userList[t]):this.userList[t].isSelect=!1},handleCurrentChange:function(e){null!=e&&(this.setRadioSelected(e.userId),this.user=e)},closeSelectUser:function(){this.openSelectUser=!1,this.resetQuery()},addDeviceUser:function(){var e=this;if(null!=this.deviceInfo&&this.deviceInfo.length>0&&null!=this.user)if(1==this.deviceInfo.length){var t={};t.deviceId=this.deviceInfo[0].deviceId,t.deviceName=this.deviceInfo[0].deviceName,t.userId=this.user.userId,t.userName=this.user.userName,t.phonenumber=this.user.phonenumber,Object(u["a"])(t).then((function(t){e.$modal.msgSuccess("新增成功"),e.resetQuery(),e.openSelectUser=!1,e.$parent.getList()}))}else{t=[];this.deviceInfo.forEach((function(r){var n={};n.deviceId=r.deviceId,n.deviceName=r.deviceName,n.userId=e.user.userId,n.userName=e.user.userName,n.phonenumber=e.user.phonenumber,t.push(n)})),Object(u["b"])(t).then((function(t){e.$modal.msgSuccess("新增成功"),e.resetQuery(),e.openSelectUser=!1,e.$parent.getList()}))}else this.openSelectUser=!1}}},o=a,c=r("2877"),l=Object(c["a"])(o,n,i,!1,null,null,null);t["default"]=l.exports}}]); |