Files
fastbee/docker/data/nginx/html/static/js/chunk-7c5661b0.731e3ce1.js
2023-03-04 15:31:53 +08:00

1 line
11 KiB
JavaScript

(window["webpackJsonp"]=window["webpackJsonp"]||[]).push([["chunk-7c5661b0","chunk-1022b97a"],{2544:function(e,t,i){"use strict";i.d(t,"e",(function(){return r})),i.d(t,"d",(function(){return s})),i.d(t,"a",(function(){return a})),i.d(t,"b",(function(){return l})),i.d(t,"f",(function(){return o})),i.d(t,"c",(function(){return u}));var n=i("b775");function r(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 a(e){return Object(n["a"])({url:"/iot/deviceUser",method:"post",data:e})}function l(e){return Object(n["a"])({url:"/iot/deviceUser/addDeviceUsers",method:"post",data:e})}function o(e){return Object(n["a"])({url:"/iot/deviceUser",method:"put",data:e})}function u(e){return Object(n["a"])({url:"/iot/deviceUser",method:"delete",data:e})}},b52e:function(e,t,i){"use strict";i.r(t);var n=function(){var e=this,t=e.$createElement,i=e._self._c||t;return i("div",{staticStyle:{"padding-left":"20px"}},[i("el-row",{staticClass:"mb8",attrs:{gutter:10}},[i("el-col",{attrs:{span:1.5}},[i("el-button",{directives:[{name:"hasPermi",rawName:"v-hasPermi",value:["iot:device:share"],expression:"['iot:device:share']"}],attrs:{type:"primary",plain:"",icon:"el-icon-share",size:"mini"},on:{click:e.selectUser}},[e._v("分享设备")])],1),i("el-col",{attrs:{span:1.5}},[i("el-button",{attrs:{type:"warning",plain:"",icon:"el-icon-refresh",size:"mini"},on:{click:e.getList}},[e._v("刷新")])],1)],1),i("el-table",{directives:[{name:"loading",rawName:"v-loading",value:e.loading,expression:"loading"}],attrs:{data:e.deviceUserList,size:"mini"},on:{"selection-change":e.handleSelectionChange}},[i("el-table-column",{attrs:{label:"用户编号",align:"center",prop:"userId",width:"100"}}),i("el-table-column",{attrs:{label:"用户名称",align:"center",prop:"userName"}}),i("el-table-column",{attrs:{label:"手机号码",align:"center",prop:"phonenumber",width:"150"}}),i("el-table-column",{attrs:{label:"用户类型",align:"center",prop:"isOwner",width:"150"},scopedSlots:e._u([{key:"default",fn:function(t){return[t.row.isOwner?i("el-tag",{attrs:{type:"primary"}},[e._v("主人")]):i("el-tag",{attrs:{type:"success"}},[e._v("分享")])]}}])}),i("el-table-column",{attrs:{label:"分享时间",align:"center",prop:"createTime",width:"150"},scopedSlots:e._u([{key:"default",fn:function(t){return[i("span",[e._v(e._s(e.parseTime(t.row.createTime,"{y}-{m}-{d}")))])]}}])}),i("el-table-column",{attrs:{label:"备注",align:"left",prop:"remark","header-align":"center","min-width":"150"}}),i("el-table-column",{attrs:{label:"操作",align:"center","class-name":"small-padding fixed-width",width:"150"},scopedSlots:e._u([{key:"default",fn:function(t){return[0==t.row.isOwner?i("el-button",{directives:[{name:"hasPermi",rawName:"v-hasPermi",value:["iot:device:share"],expression:"['iot:device:share']"}],attrs:{size:"mini",type:"text",icon:"el-icon-edit"},on:{click:function(i){return e.handleUpdate(t.row)}}},[e._v("备注")]):e._e(),0==t.row.isOwner?i("el-button",{directives:[{name:"hasPermi",rawName:"v-hasPermi",value:["iot:device:share"],expression:"['iot:device:share']"}],attrs:{size:"mini",type:"text",icon:"el-icon-delete"},on:{click:function(i){return e.handleDelete(t.row)}}},[e._v("取消分享")]):e._e()]}}])})],1),i("el-dialog",{attrs:{title:e.title,visible:e.open,width:"500px","append-to-body":""},on:{"update:visible":function(t){e.open=t}}},[i("el-input",{attrs:{type:"textarea",placeholder:"请输入内容",rows:"4"},model:{value:e.form.remark,callback:function(t){e.$set(e.form,"remark",t)},expression:"form.remark"}}),i("div",{staticClass:"dialog-footer",attrs:{slot:"footer"},slot:"footer"},[i("el-button",{attrs:{type:"primary"},on:{click:e.submitForm}},[e._v("确 定")]),i("el-button",{on:{click:e.cancel}},[e._v("取 消")])],1)],1),i("user-list",{ref:"userList",attrs:{device:e.devices}})],1)},r=[],s=i("5530"),a=(i("d81d"),i("e018")),l=i("2544"),o={name:"device-user",dicts:["iot_yes_no"],components:{userList:a["default"]},props:{device:{type:Object,default:null}},watch:{device:function(e,t){this.deviceInfo=e,this.devices=[e],this.deviceInfo&&0!=this.deviceInfo.deviceId&&(this.queryParams.deviceId=this.deviceInfo.deviceId,this.getList())}},data:function(){return{devices:[],loading:!0,ids:[],single:!0,multiple:!0,total:0,deviceUserList:[],title:"",open:!1,queryParams:{pageNum:1,pageSize:10,deviceName:null,userName:null,userId:null,tenantName:null,isOwner:null},form:{},rules:{deviceName:[{required:!0,message:"设备名称不能为空",trigger:"blur"}],userName:[{required:!0,message:"用户昵称不能为空",trigger:"blur"}]}}},created:function(){this.queryParams.deviceId=this.device.deviceId,this.getList()},methods:{getList:function(){var e=this;this.loading=!0,Object(l["e"])(this.queryParams).then((function(t){e.deviceUserList=t.rows,e.total=t.total,e.loading=!1}))},cancel:function(){this.open=!1,this.reset()},reset:function(){this.form={deviceId:null,userId:null,deviceName:null,userName:null,tenantId:null,tenantName:null,isOwner:null,limitNum:null,delFlag:null,createBy:null,createTime:null,updateBy:null,updateTime:null,remark:null},this.resetForm("form")},handleQuery:function(){this.queryParams.pageNum=1,this.getList()},resetQuery:function(){this.resetForm("queryForm"),this.handleQuery()},handleSelectionChange:function(e){this.ids=e.map((function(e){return e.deviceId})),this.single=1!==e.length,this.multiple=!e.length},handleAdd:function(){this.reset(),this.open=!0,this.title="添加设备用户"},handleUpdate:function(e){var t=this;this.reset();var i=e.deviceId||this.ids;Object(l["d"])(i,e.userId).then((function(e){t.form=e.data,t.open=!0,t.title="用户备注"}))},submitForm:function(){var e=this;null!=this.form.deviceId&&Object(l["f"])(this.form).then((function(t){e.$modal.msgSuccess("备注成功"),e.open=!1,e.getList()}))},handleDelete:function(e){var t=this,i=e;this.$modal.confirm("确认取消分享设备?").then((function(){return Object(l["c"])(i)})).then((function(){t.getList(),t.$modal.msgSuccess("取消分享成功")})).catch((function(){}))},handleExport:function(){this.download("iot/deviceUser/export",Object(s["a"])({},this.queryParams),"deviceUser_".concat((new Date).getTime(),".xlsx"))},selectUser:function(){this.devices=[this.device],this.$refs.userList.openSelectUser=!0}}},u=o,c=i("2877"),d=Object(c["a"])(u,n,r,!1,null,null,null);t["default"]=d.exports},bb86:function(e,t,i){"use strict";i.d(t,"b",(function(){return r})),i.d(t,"a",(function(){return s}));var n=i("b775");i("bc3a"),i("5c96"),i("21a6"),i("5f87"),i("c38a");function r(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})}},e018:function(e,t,i){"use strict";i.r(t);var n=function(){var e=this,t=e.$createElement,i=e._self._c||t;return i("el-dialog",{attrs:{title:"选择用户",visible:e.openSelectUser,width:"800px"},on:{"update:visible":function(t){e.openSelectUser=t}}},[i("div",{staticStyle:{"margin-top":"-50px"}},[i("el-divider")],1),i("el-form",{ref:"queryForm",attrs:{model:e.queryParams,rules:e.rules,inline:!0,"label-width":"80px"}},[i("el-form-item",{attrs:{label:"手机号码",prop:"phonenumber"}},[i("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),i("el-form-item",[i("el-button",{attrs:{type:"primary",icon:"el-icon-search",size:"mini"},on:{click:e.handleQuery}},[e._v("查询")])],1)],1),i("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}},[i("el-table-column",{attrs:{label:"选择",width:"50",align:"center"},scopedSlots:e._u([{key:"default",fn:function(e){return[i("input",{attrs:{type:"radio",name:"user"},domProps:{checked:e.row.isSelect}})]}}])}),i("el-table-column",{key:"userId",attrs:{label:"用户编号",align:"center",prop:"userId",width:"120"}}),i("el-table-column",{key:"userName",attrs:{label:"用户名称",align:"center",prop:"userName"}}),i("el-table-column",{key:"nickName",attrs:{label:"用户昵称",align:"center",prop:"nickName"}}),i("el-table-column",{key:"phonenumber",attrs:{label:"手机号码",align:"center",prop:"phonenumber",width:"120"}}),i("el-table-column",{attrs:{label:"创建时间",align:"center",prop:"createTime",width:"160"},scopedSlots:e._u([{key:"default",fn:function(t){return[i("span",[e._v(e._s(e.parseTime(t.row.createTime)))])]}}])})],1),i("div",{staticClass:"dialog-footer",attrs:{slot:"footer"},slot:"footer"},[i("el-button",{attrs:{type:"primary"},on:{click:e.addDeviceUser}},[e._v("分享")]),i("el-button",{on:{click:e.closeSelectUser}},[e._v("关 闭")])],1)],1)},r=[],s=(i("d3b7"),i("159b"),i("bb86")),a=i("2544"),l={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["a"])(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(a["a"])(t).then((function(t){e.$modal.msgSuccess("新增成功"),e.resetQuery(),e.openSelectUser=!1,e.$parent.getList()}))}else{t=[];this.deviceInfo.forEach((function(i){var n={};n.deviceId=i.deviceId,n.deviceName=i.deviceName,n.userId=e.user.userId,n.userName=e.user.userName,n.phonenumber=e.user.phonenumber,t.push(n)})),Object(a["b"])(t).then((function(t){e.$modal.msgSuccess("新增成功"),e.resetQuery(),e.openSelectUser=!1,e.$parent.getList()}))}else this.openSelectUser=!1}}},o=l,u=i("2877"),c=Object(u["a"])(o,n,r,!1,null,null,null);t["default"]=c.exports}}]);