(window["webpackJsonp"]=window["webpackJsonp"]||[]).push([["chunk-1c8de8cb","chunk-28b7a9aa"],{"10f3":function(e,t,r){"use strict";r.d(t,"e",(function(){return n})),r.d(t,"d",(function(){return a})),r.d(t,"c",(function(){return o})),r.d(t,"a",(function(){return u})),r.d(t,"g",(function(){return l})),r.d(t,"f",(function(){return s})),r.d(t,"b",(function(){return c}));var i=r("b775");function n(e){return Object(i["a"])({url:"/iot/group/list",method:"get",params:e})}function a(e){return Object(i["a"])({url:"/iot/group/"+e,method:"get"})}function o(e){return Object(i["a"])({url:"/iot/group/getDeviceIds/"+e,method:"get"})}function u(e){return Object(i["a"])({url:"/iot/group",method:"post",data:e})}function l(e){return Object(i["a"])({url:"/iot/group",method:"put",data:e})}function s(e){return Object(i["a"])({url:"/iot/group/updateDeviceGroups",method:"put",data:e})}function c(e){return Object(i["a"])({url:"/iot/group/"+e,method:"delete"})}},1967:function(e,t,r){"use strict";r.r(t);var i=function(){var e=this,t=e.$createElement,r=e._self._c||t;return r("div",{staticStyle:{padding:"6px"}},[r("el-card",{directives:[{name:"show",rawName:"v-show",value:e.showSearch,expression:"showSearch"}],staticStyle:{"margin-bottom":"6px"}},[r("el-form",{ref:"queryForm",staticStyle:{"margin-bottom":"-20px"},attrs:{model:e.queryParams,inline:!0,"label-width":"68px"}},[r("el-form-item",{attrs:{label:"分组名称",prop:"groupName"}},[r("el-input",{attrs:{placeholder:"请输入分组名称",clearable:"",size:"small"},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.groupName,callback:function(t){e.$set(e.queryParams,"groupName",t)},expression:"queryParams.groupName"}})],1),e.isAdmin?r("el-form-item",{staticStyle:{margin:"0 20px"},attrs:{label:"我的分组"}},[r("el-switch",{on:{change:e.myGroupChange},model:{value:e.myGroup,callback:function(t){e.myGroup=t},expression:"myGroup"}})],1):e._e(),r("el-form-item",[r("el-button",{attrs:{type:"primary",icon:"el-icon-search",size:"mini"},on:{click:e.handleQuery}},[e._v("搜索")]),r("el-button",{attrs:{icon:"el-icon-refresh",size:"mini"},on:{click:e.resetQuery}},[e._v("重置")])],1),r("el-form-item",{staticStyle:{float:"right"}},[r("el-button",{directives:[{name:"hasPermi",rawName:"v-hasPermi",value:["iot:group:add"],expression:"['iot:group:add']"}],attrs:{type:"primary",plain:"",icon:"el-icon-plus",size:"mini"},on:{click:e.handleAdd}},[e._v("新增")])],1)],1)],1),r("el-card",{staticStyle:{"padding-bottom":"100px"}},[r("el-table",{directives:[{name:"loading",rawName:"v-loading",value:e.loading,expression:"loading"}],attrs:{data:e.groupList,border:""},on:{"selection-change":e.handleSelectionChange}},[r("el-table-column",{attrs:{label:"分组名称",align:"center",prop:"groupName",width:"200"}}),r("el-table-column",{attrs:{label:"分组排序",align:"center",prop:"groupOrder",width:"100"}}),r("el-table-column",{attrs:{label:"创建时间",align:"center",prop:"createTime",width:"180"},scopedSlots:e._u([{key:"default",fn:function(t){return[r("span",[e._v(e._s(e.parseTime(t.row.createTime,"{y}-{m}-{d}")))])]}}])}),e.isAdmin?r("el-table-column",{attrs:{label:"所属用户",align:"center",prop:"userName",width:"100"}}):e._e(),r("el-table-column",{attrs:{label:"备注",align:"left","header-align":"center",prop:"remark"}}),r("el-table-column",{attrs:{label:"操作",align:"center","class-name":"small-padding fixed-width",width:"320"},scopedSlots:e._u([{key:"default",fn:function(t){return[r("el-button",{directives:[{name:"hasPermi",rawName:"v-hasPermi",value:["iot:device:list"],expression:"['iot:device:list']"}],staticStyle:{padding:"5px"},attrs:{size:"small",type:"warning",icon:"el-icon-search"},on:{click:function(r){return e.handleViewDevice(t.row.groupId)}}},[e._v("查看设备")]),r("el-button",{directives:[{name:"hasPermi",rawName:"v-hasPermi",value:["iot:group:add"],expression:"['iot:group:add']"}],staticStyle:{padding:"5px"},attrs:{size:"small",type:"success",icon:"el-icon-edit"},on:{click:function(r){return e.selectDevice(t.row)}}},[e._v("添加设备")]),r("el-button",{directives:[{name:"hasPermi",rawName:"v-hasPermi",value:["iot:group:query"],expression:"['iot:group:query']"}],staticStyle:{padding:"5px"},attrs:{size:"small",type:"primary",icon:"el-icon-view"},on:{click:function(r){return e.handleUpdate(t.row)}}},[e._v("查看")]),r("el-button",{directives:[{name:"hasPermi",rawName:"v-hasPermi",value:["iot:group:remove"],expression:"['iot:group:remove']"}],staticStyle:{padding:"5px"},attrs:{size:"small",type:"danger",icon:"el-icon-delete"},on:{click:function(r){return e.handleDelete(t.row)}}},[e._v("删除")])]}}])})],1),r("pagination",{directives:[{name:"show",rawName:"v-show",value:e.total>0,expression:"total > 0"}],attrs:{total:e.total,page:e.queryParams.pageNum,limit:e.queryParams.pageSize},on:{"update:page":function(t){return e.$set(e.queryParams,"pageNum",t)},"update:limit":function(t){return e.$set(e.queryParams,"pageSize",t)},pagination:e.getList}}),r("deviceList",{ref:"groupDeviceList",attrs:{group:e.group}}),r("el-dialog",{attrs:{title:e.title,visible:e.open,width:"500px","append-to-body":""},on:{"update:visible":function(t){e.open=t}}},[r("el-form",{ref:"form",attrs:{model:e.form,rules:e.rules,"label-width":"80px"}},[r("el-form-item",{attrs:{label:"分组名称",prop:"groupName"}},[r("el-input",{attrs:{placeholder:"请输入分组名称"},model:{value:e.form.groupName,callback:function(t){e.$set(e.form,"groupName",t)},expression:"form.groupName"}})],1),r("el-form-item",{attrs:{label:"分组排序",prop:"groupOrder"}},[r("el-input",{attrs:{type:"number",placeholder:"请输入分组排序"},model:{value:e.form.groupOrder,callback:function(t){e.$set(e.form,"groupOrder",t)},expression:"form.groupOrder"}})],1),r("el-form-item",{attrs:{label:"备注",prop:"remark"}},[r("el-input",{attrs:{type:"textarea",placeholder:"请输入内容"},model:{value:e.form.remark,callback:function(t){e.$set(e.form,"remark",t)},expression:"form.remark"}})],1)],1),r("div",{staticClass:"dialog-footer",attrs:{slot:"footer"},slot:"footer"},[r("el-button",{directives:[{name:"show",rawName:"v-show",value:e.form.groupId,expression:"form.groupId"},{name:"hasPermi",rawName:"v-hasPermi",value:["iot:group:edit"],expression:"['iot:group:edit']"}],attrs:{type:"primary"},on:{click:e.submitForm}},[e._v("修 改")]),r("el-button",{directives:[{name:"hasPermi",rawName:"v-hasPermi",value:["iot:group:add"],expression:"['iot:group:add']"},{name:"show",rawName:"v-show",value:!e.form.groupId,expression:"!form.groupId"}],attrs:{type:"primary"},on:{click:e.submitForm}},[e._v("新 增")]),r("el-button",{on:{click:e.cancel}},[e._v("取 消")])],1)],1)],1)],1)},n=[],a=r("5530"),o=(r("d81d"),r("14d9"),r("d4b0")),u=r("10f3"),l=r("5f87"),s={name:"Group",components:{deviceList:o["default"]},data:function(){return{isAdmin:!1,myGroup:!1,loading:!0,ids:[],single:!0,multiple:!0,showSearch:!0,total:0,groupList:[],title:"",open:!1,queryParams:{pageNum:1,pageSize:10,groupName:null,userId:null},group:{},form:{},rules:{groupName:[{required:!0,message:"分组名称不能为空",trigger:"blur"}],groupOrder:[{required:!0,message:"分组排序不能为空,最大值为99",trigger:"blur"}]}}},created:function(){this.getList(),this.init()},methods:{init:function(){-1===this.$store.state.user.roles.indexOf("tenant")&&-1===this.$store.state.user.roles.indexOf("general")&&(this.isAdmin=!0)},myGroupChange:function(){this.queryParams.userId=this.myGroup?Object(l["b"])():null},handleViewDevice:function(e){this.$router.push({path:"/iot/device",query:{t:Date.now(),groupId:e}})},getList:function(){var e=this;this.loading=!0,Object(u["e"])(this.queryParams).then((function(t){e.groupList=t.rows,e.total=t.total,e.loading=!1}))},cancel:function(){this.open=!1,this.reset()},reset:function(){this.form={groupId:null,groupName:null,groupOrder:null,userId:null,userName: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.groupId})),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 r=e.groupId||this.ids;Object(u["d"])(r).then((function(e){t.form=e.data,t.open=!0,t.title="修改设备分组"}))},selectDevice:function(e){this.group=e,this.$refs.groupDeviceList.openDeviceList=!0},submitForm:function(){var e=this;this.$refs["form"].validate((function(t){t&&(null!=e.form.groupId?Object(u["g"])(e.form).then((function(t){e.$modal.msgSuccess("修改成功"),e.open=!1,e.getList()})):Object(u["a"])(e.form).then((function(t){e.$modal.msgSuccess("新增成功"),e.open=!1,e.getList()})))}))},handleDelete:function(e){var t=this,r=e.groupId||this.ids;this.$modal.confirm('是否确认删除设备分组编号为"'+r+'"的数据项?').then((function(){return Object(u["b"])(r)})).then((function(){t.getList(),t.$modal.msgSuccess("删除成功")})).catch((function(){}))},handleExport:function(){this.download("iot/group/export",Object(a["a"])({},this.queryParams),"group_".concat((new Date).getTime(),".xlsx"))}}},c=s,d=r("2877"),m=Object(d["a"])(c,i,n,!1,null,null,null);t["default"]=m.exports},"584f":function(e,t,r){"use strict";r.d(t,"l",(function(){return n})),r.d(t,"q",(function(){return a})),r.d(t,"m",(function(){return o})),r.d(t,"n",(function(){return u})),r.d(t,"k",(function(){return l})),r.d(t,"f",(function(){return s})),r.d(t,"c",(function(){return c})),r.d(t,"g",(function(){return d})),r.d(t,"i",(function(){return m})),r.d(t,"d",(function(){return p})),r.d(t,"r",(function(){return h})),r.d(t,"o",(function(){return f})),r.d(t,"p",(function(){return g})),r.d(t,"h",(function(){return v})),r.d(t,"a",(function(){return b})),r.d(t,"s",(function(){return y})),r.d(t,"b",(function(){return w})),r.d(t,"e",(function(){return O})),r.d(t,"j",(function(){return x}));var i=r("b775");function n(e){return Object(i["a"])({url:"/iot/device/list",method:"get",params:e})}function a(e){return Object(i["a"])({url:"/iot/device/unAuthlist",method:"get",params:e})}function o(e){return Object(i["a"])({url:"/iot/device/listByGroup",method:"get",params:e})}function u(e){return Object(i["a"])({url:"/iot/device/shortList",method:"get",params:e})}function l(){return Object(i["a"])({url:"/iot/device/all",method:"get"})}function s(e){return Object(i["a"])({url:"/iot/device/"+e,method:"get"})}function c(e){return Object(i["a"])({url:"/iot/device/synchronization/"+e,method:"get"})}function d(e){return Object(i["a"])({url:"/iot/device/getDeviceBySerialNumber/"+e,method:"get"})}function m(){return Object(i["a"])({url:"/iot/device/statistic",method:"get"})}function p(e,t){return Object(i["a"])({url:"/iot/device/assignment?deptId="+e+"&deviceIds="+t,method:"post"})}function h(e){return Object(i["a"])({url:"/iot/device/recovery?deviceIds="+e,method:"post"})}function f(){return Object(i["a"])({url:"",method:"get"})}function g(){return Object(i["a"])({url:"",method:"get"})}function v(e){return Object(i["a"])({url:"/iot/device/runningStatus",method:"get",params:e})}function b(e){return Object(i["a"])({url:"/iot/device",method:"post",data:e})}function y(e){return Object(i["a"])({url:"/iot/device",method:"put",data:e})}function w(e){return Object(i["a"])({url:"/iot/device/"+e,method:"delete"})}function O(e){return Object(i["a"])({url:"/iot/device/generator",method:"get",params:e})}function x(e){return Object(i["a"])({url:"/iot/device/getMqttConnectData",method:"get",params:e})}},d4b0:function(e,t,r){"use strict";r.r(t);var i=function(){var e=this,t=e.$createElement,r=e._self._c||t;return r("el-dialog",{attrs:{title:"选择设备",visible:e.openDeviceList,width:"800px","append-to-body":""},on:{"update:visible":function(t){e.openDeviceList=t}}},[r("el-form",{ref:"queryForm",attrs:{model:e.queryParams,inline:!0,"label-width":"68px"}},[r("el-form-item",{attrs:{label:"设备名称",prop:"deviceName"}},[r("el-input",{attrs:{placeholder:"请输入设备名称",clearable:"",size:"small"},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.deviceName,callback:function(t){e.$set(e.queryParams,"deviceName",t)},expression:"queryParams.deviceName"}})],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"}],ref:"multipleTable",attrs:{data:e.deviceList,size:"mini",border:""},on:{select:e.handleSelectionChange,"select-all":e.handleSelectionAll}},[r("el-table-column",{attrs:{type:"selection",width:"55",align:"center"}}),r("el-table-column",{attrs:{label:"设备名称",align:"center",prop:"deviceName"}}),r("el-table-column",{attrs:{label:"设备编号",align:"center",prop:"serialNumber"}}),r("el-table-column",{attrs:{label:"产品名称",align:"center",prop:"productName"}}),r("el-table-column",{attrs:{label:"设备类型",align:"center"},scopedSlots:e._u([{key:"default",fn:function(t){return[0==t.row.isOwner?r("el-tag",{attrs:{type:"success"}},[e._v("分享")]):r("el-tag",{attrs:{type:"primary"}},[e._v("拥有")])]}}])}),r("el-table-column",{attrs:{label:"设备状态",align:"center",prop:"status"},scopedSlots:e._u([{key:"default",fn:function(t){return[r("dict-tag",{attrs:{options:e.dict.type.iot_device_status,value:t.row.status}})]}}])})],1),r("pagination",{directives:[{name:"show",rawName:"v-show",value:e.total>0,expression:"total>0"}],attrs:{total:e.total,page:e.queryParams.pageNum,limit:e.queryParams.pageSize},on:{"update:page":function(t){return e.$set(e.queryParams,"pageNum",t)},"update:limit":function(t){return e.$set(e.queryParams,"pageSize",t)},pagination:e.getList}}),r("div",{staticClass:"dialog-footer",attrs:{slot:"footer"},slot:"footer"},[r("el-button",{attrs:{type:"primary"},on:{click:e.handleDeviceSelected}},[e._v("确 定")]),r("el-button",{on:{click:e.closeSelectDeviceList}},[e._v("取 消")])],1)],1)},n=[],a=(r("14d9"),r("a434"),r("d3b7"),r("159b"),r("10f3")),o=r("584f"),u={name:"device-list",dicts:["iot_device_status"],props:{group:{type:Object,default:null}},data:function(){return{deviceGroup:{},loading:!0,ids:[],openDeviceList:!1,total:0,deviceList:[],queryParams:{pageNum:1,pageSize:10,deviceName:null,productId:null,productName:null,userId:null,userName:null,tenantId:null,tenantName:null,serialNumber:null,status:null,networkAddress:null,activeTime:null}}},watch:{group:{handler:function(e,t){e.groupId&&(this.deviceGroup=e,this.queryParams.userId=this.deviceGroup.userId,this.queryParams.pageNum=1,this.getDeviceIdsByGroupId(this.deviceGroup.groupId))},immediate:!0}},created:function(){},methods:{getDeviceIdsByGroupId:function(e){var t=this;Object(a["c"])(e).then((function(e){t.ids=e.data,t.getList()}))},getList:function(){var e=this;this.loading=!0,this.queryParams.params={},null!=this.daterangeActiveTime&&""!=this.daterangeActiveTime&&(this.queryParams.params["beginActiveTime"]=this.daterangeActiveTime[0],this.queryParams.params["endActiveTime"]=this.daterangeActiveTime[1]),Object(o["m"])(this.queryParams).then((function(t){e.deviceList=t.rows,e.total=t.total,e.loading=!1,e.deviceList.forEach((function(t){e.$nextTick((function(){e.ids.some((function(e){return e===t.deviceId}))&&e.$refs.multipleTable.toggleRowSelection(t,!0)}))}))}))},handleQuery:function(){this.queryParams.pageNum=1,this.getList()},resetQuery:function(){this.daterangeActiveTime=[],this.resetForm("queryForm"),this.handleQuery()},handleSelectionChange:function(e,t){var r=this.ids.indexOf(t.deviceId),i=e.indexOf(t);-1==r&&-1!=i?this.ids.push(t.deviceId):-1!=r&&-1==i&&this.ids.splice(r,1)},handleSelectionAll:function(e){for(var t=0;t