(window["webpackJsonp_direwolf"]=window["webpackJsonp_direwolf"]||[]).push([["sODeviceList"],{1583:function(e,t,i){},"810c":function(e,t,i){"use strict";i.r(t);var a=function(){var e=this,t=e.$createElement,i=e._self._c||t;return i("div",{staticClass:"wrapper-cont",attrs:{id:"sODeviceList"}},[i("el-card",{staticClass:"box-card search-content",attrs:{shadow:"never"}},[i("el-form",{attrs:{"label-position":"right",size:"small","label-width":"100px",id:"sODeviceSearchForm",model:e.searchParams}},[i("el-row",[i("el-col",{attrs:{span:8}},[i("el-form-item",{attrs:{label:"名称"}},[i("el-input",{attrs:{placeholder:"请输入名称"},model:{value:e.searchParams.name,callback:function(t){e.$set(e.searchParams,"name",t)},expression:"searchParams.name"}})],1)],1),i("el-col",{attrs:{span:8}},[i("el-form-item",{attrs:{label:"编码"}},[i("el-input",{attrs:{placeholder:"请输入编码"},model:{value:e.searchParams.code,callback:function(t){e.$set(e.searchParams,"code",t)},expression:"searchParams.code"}})],1)],1),i("el-col",{attrs:{span:8}},[i("el-form-item",{attrs:{label:"类型"}},[i("el-input",{attrs:{placeholder:"请输入类型"},model:{value:e.searchParams.type,callback:function(t){e.$set(e.searchParams,"type",t)},expression:"searchParams.type"}})],1)],1)],1),i("el-row",[i("el-col",[i("el-form-item",{staticClass:"search-content-button-container"},[i("el-button-group",[i("el-button",{attrs:{type:"primary",size:"small",icon:"el-icon-search"},on:{click:e.refreshTable}},[e._v("查询\n ")]),i("el-button",{attrs:{size:"small",icon:"el-icon-refresh"},on:{click:e.resetSearchParam}},[e._v("重置\n ")])],1)],1)],1)],1)],1)],1),i("el-card",{staticClass:"box-card",attrs:{shadow:"hover"}},[e.inViewMode?e._e():i("el-button-group",[e.hasPermission("add")?i("el-button",{attrs:{size:"mini",icon:"el-icon-plus"},on:{click:e.addNewSODevice}},[e._v("新增\n ")]):e._e(),e.hasPermission("del")?i("el-button",{attrs:{type:"danger",size:"mini",icon:"el-icon-delete"},on:{click:e.deleteSelectedSODevice}},[e._v("删除\n ")]):e._e(),e.hasPermission("view")?i("el-button",{attrs:{size:"mini",icon:"el-icon-tickets"},on:{click:e.viewSelectedSODevice}},[e._v("查看\n ")]):e._e()],1),i("el-table",{directives:[{name:"loading",rawName:"v-loading",value:e.sODeviceTableLoading,expression:"sODeviceTableLoading"}],ref:"sODeviceTable",staticStyle:{width:"100%","margin-top":"15px","margin-bottom":"15px"},attrs:{size:"medium",stripe:"",border:"","tooltip-effect":"dark",data:e.sODeviceTablePage.list},on:{"row-click":e.handleRowClick,"sort-change":e.handleSortChange}},[i("el-table-column",{attrs:{type:"selection",width:"55"}}),i("el-table-column",{attrs:{prop:"name",label:"名称",sortable:"custom","show-overflow-tooltip":""}}),i("el-table-column",{attrs:{prop:"code",label:"编码",sortable:"custom","show-overflow-tooltip":""}}),i("el-table-column",{attrs:{prop:"type",label:"类型",sortable:"custom","show-overflow-tooltip":""}}),i("el-table-column",{attrs:{prop:"groupId",label:"所在分组",sortable:"custom","show-overflow-tooltip":""}}),e.inViewMode?e._e():i("el-table-column",{attrs:{label:"操作","min-width":100},scopedSlots:e._u([{key:"default",fn:function(t){return[i("el-tooltip",{attrs:{content:"编辑",placement:"top"}},[i("el-button",{attrs:{size:"mini",icon:"el-icon-edit"},on:{click:function(i){return e.sODeviceRecordEdit(t)}}})],1),i("el-tooltip",{attrs:{content:"删除",placement:"top"}},[i("el-button",{attrs:{size:"mini",type:"danger",icon:"el-icon-delete"},on:{click:function(i){return e.sODeviceRecordRemove(t)}}})],1)]}}],null,!1,2163705949)})],1),i("el-pagination",{attrs:{layout:"total, sizes, ->, prev, pager, next, jumper",total:e.sODeviceTablePage.count,"page-sizes":[5,10,15,20],"page-size":e.searchParams.limit,background:""},on:{"size-change":e.handleTableSizeChange,"current-change":e.handleTableCurrentChange}})],1)],1)},s=[],r=(i("ac6a"),i("28a5"),i("cebc")),o=i("dc30"),l=i("e6a9"),n=(window.getDirewolfLibrary(),{name:"",code:"",type:"",limit:5,offset:0,order:"",sort:""}),c={name:"sODeviceList",components:{},data:function(){return{searchParams:Object(r["a"])({},n),editType:this.$$utils.getQueryString("editType"),sODeviceTablePage:{},sODeviceTableLoading:!1,fieldDictTypeMap:{},pageDictMap:{},sODeviceGroupTablePage:{},sODeviceGroupTableLoading:!1}},computed:{inViewMode:function(){return"view"===this.editType||!this.hasPermission("add")&&!this.hasPermission("edit")&&!this.hasPermission("del")}},methods:{hasPermission:function(e){return this.$$utils.permission.hasPermission("".concat(l["b"]).concat(e))},refreshTable:function(){var e=this;e.sODeviceTableLoading=!0,o["a"].getSODeviceList(e.searchParams).then((function(t){e.sODeviceTablePage=t.data,e.sODeviceTableLoading=!1}))},resetSearchParam:function(){this.searchParams=Object(r["a"])({},n),this.refreshTable()},handleRowClick:function(e,t,i){this.$$utils.eleTableClickSelection(this.$refs.sODeviceTable,e,i)},handleTableSizeChange:function(e){this.searchParams.limit=e,this.refreshTable()},handleTableCurrentChange:function(e){this.searchParams.offset=this.searchParams.limit*(e-1),this.refreshTable()},handleSortChange:function(e){null===e.prop?(this.searchParams.sort=n.sort,this.searchParams.order=n.order):(this.searchParams.sort=e.prop,this.searchParams.order=e.order.split("ending")[0]),this.refreshTable()},addNewSODevice:function(){this.showFormDialog({editType:"add"})},viewSelectedSODevice:function(){var e=this,t=e.$refs.sODeviceTable.selection;1===t.length?e.showFormDialog({editType:"view",id:t[0].id}):e.$$utils.direwolfCommonTips("warning","仅能选择一条记录进行查看")},showFormDialog:function(e){var t=this;t.$$utils.openLayerDialog({el:"sODeviceForm",url:"".concat(l["c"],"/sODeviceForm"),props:e,title:"".concat(t.$$utils.getEditTypeName(e.editType),"设备表"),onConfirm:function(i,a){"view"!==e.editType?i.save((function(){t.refreshTable(),a()})):a()}})},deleteSelectedSODevice:function(){var e=this,t=e.$refs.sODeviceTable.selection;0!==t.length?e.$$utils.direwolfCommonConfirm({title:"删除提醒",message:"数据删除后不可恢复,确定继续删除吗?"},(function(){var i=[];t.forEach((function(e){e.id&&i.push(e.id)})),i.length>0&&o["a"].deleteAllSODevice(i).then((function(t){e.refreshTable(),e.$$utils.direwolfCommonTips("success","删除设备表成功")}))})):e.$$utils.direwolfCommonTips("warning","请选择要删除的记录")},editSelectedSODevice:function(){var e=this,t=this.$refs.sODeviceTable.selection;1===t.length?e.showFormDialog({editType:"edit",id:t[0].id}):e.$$utils.direwolfCommonTips("warning","仅能选择一条记录进行修改")},sODeviceRecordEdit:function(e){this.showFormDialog({editType:"edit",id:e.row.id})},sODeviceRecordRemove:function(e){var t=this;t.$$utils.direwolfCommonConfirm({title:"删除提醒",message:"数据删除后不可恢复,确定继续删除吗?"},(function(){var i="删除设备表";o["a"].deleteSODevice(e.row.id).then((function(e){t.refreshTable(),t.$$utils.direwolfCommonTips("success","".concat(i,"成功"))}))}))},handleSelectionChange:function(e){},getDictByField:function(e){var t=this;return t.pageDictMap[t.fieldDictTypeMap[e]]},eleTableColumnFormatter:function(e,t){var i=e.column.property,a=e.row[i];for(var s in t)if(a==t[s].id)return t[s].appName;return"-"},addRightSelect:function(){var e=this,t=this.$refs.sODeviceTable.selection;if(0!=t.length){var i=[];e.selectList.forEach((function(e){i.push(e.id)})),t.forEach((function(t){-1==i.indexOf(t.id)&&e.selectList.push(t)}))}else e.$$utils.direwolfCommonTips("warning","未选择记录不能添加")},deleteRightSelect:function(){var e=this,t=this.$refs.sODeviceTableForGroup.selection;0!=t.length?t.forEach((function(t){var i=e.selectList.indexOf(t);e.selectList.splice(i,1)})):e.$$utils.direwolfCommonTips("warning","未选择记录不能移除")},saveDeviceGroup:function(e){var t=this,i=t.$route.query.groupId;if(i){var a=[];t.selectList.forEach((function(e){a.push(e.id)}));var s={id:i,deviceIdList:a};o["a"].saveSODeviceGroup(s).then((function(i){t.$$utils.direwolfCommonTips("success","保存设备分组关联设备表成功"),e()}))}}},created:function(){var e=this;e.refreshTable()}},d=c,h=i("2877"),u=Object(h["a"])(d,a,s,!1,null,"4b0bb04c",null);t["default"]=u.exports},"8971e":function(e,t,i){"use strict";var a=i("1583"),s=i.n(a);s.a},"962d":function(e,t,i){"use strict";i.r(t);var a=function(){var e=this,t=e.$createElement,i=e._self._c||t;return i("div",{staticClass:"wrapper-cont"},[i("el-row",[i("el-col",{attrs:{span:4}},[i("div",{staticClass:"ibox float-e-margins"},[i("div",{staticClass:"ibox-title "},[i("h5",[e._v("角色树")])]),i("div",{staticClass:"ibox-content",attrs:{id:""}},[i("div",{staticClass:"ml-10",attrs:{id:"div_resTree"}},[i("ul",{staticClass:"ztree",staticStyle:{width:"300px",overflow:"auto"},attrs:{id:"roleTree"}})])])])]),i("el-col",{attrs:{span:4}},[i("div",{staticClass:"ibox float-e-margins"},[i("div",{staticClass:"ibox-title "},[i("h5",[e._v("设备类型树")])]),i("div",{staticClass:"ibox-content",attrs:{id:"2"}},[i("div",{staticClass:"ml-10",attrs:{id:"div_resTree2"}},[i("ul",{staticClass:"ztree",staticStyle:{width:"300px",overflow:"auto"},attrs:{id:"deviceTree"}})])])])]),i("el-col",{staticClass:"el-transfer",attrs:{span:2}},[i("div",{staticClass:"el-transfer__buttons"},[i("el-button",{staticClass:"el-transfer__button",attrs:{type:"primary",size:"medium",icon:"el-icon-arrow-right"},on:{click:e.addRightSelect}}),i("el-button",{staticClass:"el-transfer__button",attrs:{type:"primary",size:"medium",icon:"el-icon-arrow-left"},on:{click:e.deleteRightSelect}}),i("el-button",{staticClass:"el-transfer__button",attrs:{type:"primary",size:"medium",icon:"el-icon-d-arrow-right"},on:{click:e.addAllRightSelect}}),i("el-button",{staticClass:"el-transfer__button",attrs:{type:"primary",size:"medium",icon:"el-icon-d-arrow-left"},on:{click:e.deleteAllRightSelect}})],1)]),i("el-col",{attrs:{span:14}},[i("el-card",{staticClass:"box-card search-content",attrs:{shadow:"never"}},[i("el-form",{attrs:{"label-position":"right",size:"small","label-width":"100px",id:"sPRoleDeviceSearchForm",model:e.searchParams}},[i("el-row",[i("el-col",{attrs:{span:10}},[i("el-form-item",{attrs:{label:"设备类型"}},[i("el-input",{attrs:{placeholder:"请输入设备类型"},model:{value:e.searchParams.deviceName,callback:function(t){e.$set(e.searchParams,"deviceName",t)},expression:"searchParams.deviceName"}})],1)],1)],1),i("el-row",[i("el-col",{attrs:{span:4}},[i("el-form-",[i("el-button",{attrs:{type:"success",size:"small",icon:"el-icon-success"},on:{click:e.saveTable}},[e._v("保存\n ")])],1)],1),i("el-col",{attrs:{span:11,offset:9}},[i("el-form-item",[i("el-button-group",[i("el-button",{attrs:{type:"primary",size:"small",icon:"el-icon-search"},on:{click:e.refreshTable}},[e._v("查询\n ")]),i("el-button",{attrs:{size:"small",icon:"el-icon-refresh"},on:{click:e.resetSearchParam}},[e._v("重置\n ")])],1)],1)],1)],1)],1)],1),i("el-card",{staticClass:"box-card",attrs:{shadow:"hover"}},[i("el-table",{directives:[{name:"loading",rawName:"v-loading",value:e.sPRoleDeviceTableLoading,expression:"sPRoleDeviceTableLoading"}],ref:"sPRoleDeviceTable",staticStyle:{width:"100%","margin-top":"15px","margin-bottom":"15px"},attrs:{size:"medium",stripe:"",border:"","tooltip-effect":"dark",data:e.sPRoleDeviceTablePage.list},on:{"row-click":e.handleRowClick,"sort-change":e.handleSortChange}},[i("el-table-column",{attrs:{type:"selection",width:"55"}}),i("el-table-column",{attrs:{prop:"deviceName",label:"设备类型","show-overflow-tooltip":""}}),e._l(e.resourceList,(function(t){return i("el-table-column",{key:t.id,attrs:{property:t.id,label:t.resName},scopedSlots:e._u([{key:"default",fn:function(a){return[i("el-switch",{attrs:{"active-value":"1","inactive-value":"0","active-color":"#13ce66","inactive-color":"#ff4949"},model:{value:a.row[t.id],callback:function(i){e.$set(a.row,t.id,i)},expression:"scope.row[item.id]"}})]}}])})})),e.inViewMode?e._e():i("el-table-column",{attrs:{label:"操作","min-width":70},scopedSlots:e._u([{key:"default",fn:function(t){return[i("el-tooltip",{attrs:{content:"删除",placement:"top"}},[i("el-button",{attrs:{size:"mini",type:"danger",icon:"el-icon-delete"},on:{click:function(i){return e.sODeviceRecordRemove(t)}}})],1)]}}],null,!1,698082758)})],2),i("el-pagination",{attrs:{layout:"total, sizes, ->, prev, pager, next, jumper",total:e.sPRoleDeviceTablePage.count,"page-sizes":[5,10,15,20],"page-size":e.searchParams.limit,background:""},on:{"size-change":e.handleTableSizeChange,"current-change":e.handleTableCurrentChange}})],1)],1)],1)],1)},s=[],r=(i("7f7f"),i("28a5"),i("ac6a"),i("cebc")),o=i("dc30"),l=i("e6a9"),n=(window.getDirewolfLibrary(),{deviceId:"",roleId:"",deviceName:"",appId:"",limit:5,offset:0,order:"",sort:""}),c={name:"sPRoleDeviceList",components:{},data:function(){return{searchParams:Object(r["a"])({},n),editType:this.$$utils.getQueryString("editType"),sPRoleDeviceTablePage:{},sPRoleDeviceTableLoading:!1,resourceList:[],selectRoleNode:{},value:!0}},computed:{inViewMode:function(){return"view"===this.editType||!this.hasPermission("add")&&!this.hasPermission("edit")&&!this.hasPermission("del")}},methods:{hasPermission:function(e){return this.$$utils.permission.hasPermission("".concat(l["b"]).concat(e))},refreshTable:function(){var e=this;e.sPRoleDeviceTableLoading=!0,o["a"].getSPRoleDeviceList(e.searchParams).then((function(t){e.sPRoleDeviceTablePage=t.data,e.sPRoleDeviceTablePage.list.forEach((function(t){e.resourceList.forEach((function(e){t[e.id]=-1!==t.resourceIds.indexOf(e.id)?"1":"0"}))})),e.sPRoleDeviceTableLoading=!1}))},resetSearchParam:function(){this.searchParams=Object(r["a"])({},n),this.refreshTable()},handleRowClick:function(e,t,i){this.$$utils.eleTableClickSelection(this.$refs.sPRoleDeviceTable,e,i)},handleTableSizeChange:function(e){this.searchParams.limit=e,this.refreshTable()},handleTableCurrentChange:function(e){this.searchParams.offset=this.searchParams.limit*(e-1),this.refreshTable()},handleSortChange:function(e){null===e.prop?(this.searchParams.sort=n.sort,this.searchParams.order=n.order):(this.searchParams.sort=e.prop,this.searchParams.order=e.order.split("ending")[0]),this.refreshTable()},addNewSODevice:function(){this.showFormDialog({editType:"add"})},viewSelectedSODevice:function(){var e=this,t=e.$refs.sPRoleDeviceTable.selection;1===t.length?e.showFormDialog({editType:"view",id:t[0].id}):e.$$utils.direwolfCommonTips("warning","仅能选择一条记录进行查看")},showFormDialog:function(e){var t=this;e.roleName=t.selectRoleNode.name,t.$$utils.openLayerDialog({el:"sPRoleDeviceForm",url:"".concat(l["c"],"/sPRoleDeviceForm"),props:e,height:"550px",width:"700px",title:"".concat(t.$$utils.getEditTypeName(e.editType),"设备角色关联表"),onConfirm:function(i,a){"view"!==e.editType?i.save((function(){t.refreshTable(),a()})):a()}})},deleteSelectedSODevice:function(){var e=this,t=e.$refs.sPRoleDeviceTable.selection;0!==t.length?e.$$utils.direwolfCommonConfirm({title:"删除提醒",message:"数据删除后不可恢复,确定继续删除吗?"},(function(){var i=[];t.forEach((function(e){e.id&&i.push(e.id)})),i.length>0&&o["a"].deleteAllSPRoleDevice(i).then((function(t){e.refreshTable(),e.initialization(),e.$$utils.direwolfCommonTips("success","删除设备表成功")}))})):e.$$utils.direwolfCommonTips("warning","请选择要删除的记录")},editSelectedSODevice:function(){var e=this,t=this.$refs.sPRoleDeviceTable.selection;1===t.length?e.showFormDialog({editType:"edit",id:t[0].id,deviceName:t[0].deviceName}):e.$$utils.direwolfCommonTips("warning","仅能选择一条记录进行修改")},sODeviceRecordEdit:function(e){this.showFormDialog({editType:"edit",id:e.row.id,deviceName:e.row.deviceName})},sODeviceRecordRemove:function(e){var t=this;t.$$utils.direwolfCommonConfirm({title:"删除提醒",message:"数据删除后不可恢复,确定继续删除吗?"},(function(){var i="删除设备表";o["a"].deleteSPRoleDevice(e.row.id).then((function(e){t.refreshTable(),t.initialization(),t.$$utils.direwolfCommonTips("success","".concat(i,"成功"))}))}))},saveTable:function(){var e=this,t=e.sPRoleDeviceTablePage.list;if(t&&0===t.length)e.$$utils.direwolfCommonTips("warning","至少选择一条记录进行修改");else{var i=e.resourceList,a=[];t.forEach((function(e){var t={};t["id"]=e.id;var s=[];i.forEach((function(t){"1"===e[t.id]&&s.push(t.id)})),t["resourceIds"]=s.join(","),a.push(t)})),e.$$utils.direwolfCommonConfirm({title:"保存提醒",message:"确定保存所有修改按钮吗?"},(function(){var t="批量保存角色设备关联表";o["a"].batchEditSPRoleDevice(a).then((function(i){e.refreshTable(),e.initialization(),e.$$utils.direwolfCommonTips("success","".concat(t,"成功"))}))}))}},handleSelectionChange:function(e){},eleTableColumnFormatter:function(e){var t=e.column.property,i=e.row;return-1!==i.resourceIds.indexOf(t)?"是":"否"},addRightSelect:function(){var e=this,t=$.fn.zTree.getZTreeObj("roleTree").getSelectedNodes();if(1!==t.length||t[0].isParent)e.$$utils.direwolfCommonTips("warning","请选择角色节点");else{var i=$.fn.zTree.getZTreeObj("deviceTree").getCheckedNodes();if(0!==i.length){var a=[];i.forEach((function(e){e.isParent||a.push(e.id)}));var s={roleId:t[0].id,deviceIdList:a};o["a"].batchSaveSPRoleDevice(s).then((function(t){e.$$utils.direwolfCommonTips("success","保存角色设备关联成功"),e.refreshTable(),e.initialization()}))}else e.$$utils.direwolfCommonTips("warning","请选择设备类型节点")}},deleteRightSelect:function(){var e=this,t=$.fn.zTree.getZTreeObj("roleTree").getSelectedNodes();if(1!==t.length||t[0].isParent)e.$$utils.direwolfCommonTips("warning","请选择角色节点");else{var i=this.$refs.sPRoleDeviceTable.selection;if(0!==i.length){var a=[];i.forEach((function(e){e.id&&a.push(e.id)})),a.length>0&&o["a"].deleteAllSPRoleDevice(a).then((function(t){e.refreshTable(),e.initialization(),e.$$utils.direwolfCommonTips("success","删除设备表成功")}))}else e.$$utils.direwolfCommonTips("warning","请至少选择一条右边记录")}},addAllRightSelect:function(){var e=this,t=$.fn.zTree.getZTreeObj("roleTree").getSelectedNodes();1!==t.length||t[0].isParent?e.$$utils.direwolfCommonTips("warning","请选择角色节点"):e.$$utils.direwolfCommonConfirm({title:"添加提醒",message:"确定要添加所有设备类型吗?"},(function(){var i=$.fn.zTree.getZTreeObj("deviceTree"),a=i.transformToArray(i.getNodes()),s=[];a.forEach((function(e){e.isParent||s.push(e.id)}));var r={roleId:t[0].id,deviceIdList:s};o["a"].batchSaveSPRoleDevice(r).then((function(t){e.$$utils.direwolfCommonTips("success","保存角色设备关联成功"),e.refreshTable(),e.initialization()}))}))},deleteAllRightSelect:function(){var e=this,t=$.fn.zTree.getZTreeObj("roleTree").getSelectedNodes();1!==t.length||t[0].isParent?e.$$utils.direwolfCommonTips("warning","请选择角色节点"):e.$$utils.direwolfCommonConfirm({title:"删除提醒",message:"确定要删除该角色的所有设备类型吗?"},(function(){var i=t[0].id;o["a"].deleteAllByRoleId(i).then((function(t){e.refreshTable(),e.initialization(),e.$$utils.direwolfCommonTips("success","删除设备表成功")}))}))},initRoleTree:function(){var e=this,t={resTree:{setting:{view:{dblClickExpand:!0,showLine:!0,selectedMulti:!1,fontCss:function(e,t){return t.highlight?{color:"#A60000","font-weight":"bold"}:{color:"#333","font-weight":"normal"}}},data:{simpleData:{enable:!0,rootPId:""}},callback:{onClick:function(e,i,a){t.resTree.currentNodeId=a.id,t.resTable.updateTable(a)}}},zTreeOnClick:function(e,i,a){t.resTree.currentNodeId=a.id,t.resTable.updateTable(a.id)},updateTree:function(){e.$$utils.axiosRequest(sysUrlPrefix+"/sys/role/getRoleTreeByOrg").then((function(i){var a=i.data;$.fn.zTree.init($("#roleTree"),t.resTree.setting,a);var s=$.fn.zTree.getZTreeObj("roleTree"),r=s.getNodes();r.length>0?(s.selectNode(r[0]),s.setting.callback.onClick(null,s.setting.treeId,r[0])):e.$$utils.direwolfCommonTips("error","树加载失败或数据不存在")}))}},resTable:{updateTable:function(t){n.roleId=t.id,e.searchParams.roleId=t.id,e.selectRoleNode=t,e.initialization(),e.refreshTable()}}};e.resource=t,t.resTree.updateTree()},initDeviceGroupTree:function(e){var t=this,i={resTree:{setting:{view:{dblClickExpand:!0,showLine:!0,selectedMulti:!1,fontCss:function(e,t){return t.highlight?{color:"#A60000","font-weight":"bold"}:{color:"#333","font-weight":"normal"}}},data:{simpleData:{enable:!0,rootPId:""}},check:{chkboxType:{Y:"ps",N:"ps"},enable:!0,chkStyle:"checkbox"},callback:{onClick:function(e,t,a){i.resTree.currentNodeId=a.id,i.resTable.updateTable(a)}}},updateTree:function(){o["a"].getSODeviceTreeByGroup().then((function(a){var s=a.data;$.fn.zTree.init($("#deviceTree"),i.resTree.setting,s);for(var r=$.fn.zTree.getZTreeObj("deviceTree"),o=0;o, prev, pager, next",total:e.sODeviceTablePage.count,"page-sizes":[5,10,15,20],"page-size":e.searchParams.limit,background:""},on:{"size-change":e.handleTableSizeChange,"current-change":e.handleTableCurrentChange}})],1)],1),i("el-col",{staticClass:"el-transfer",attrs:{span:2}},[i("div",{staticClass:"el-transfer__buttons "},[i("el-button",{staticClass:"el-transfer__button",attrs:{type:"primary",icon:"el-icon-arrow-right"},on:{click:e.addRightSelect}}),i("el-button",{staticClass:"el-transfer__button",attrs:{type:"primary",icon:"el-icon-arrow-left"},on:{click:e.deleteRightSelect}})],1)]),i("el-col",{attrs:{span:11}},[i("el-card",{staticClass:"box-card search-content",attrs:{shadow:"never"}},[i("el-form",{attrs:{"label-position":"right",size:"small","label-width":"40px",id:"sODeviceRightSearchForm",model:e.rightSearchParams}},[i("el-row",[i("el-col",{attrs:{span:12}},[i("el-form-item",{attrs:{label:"编码"}},[i("el-input",{attrs:{placeholder:"请输入编码"},model:{value:e.rightSearchParams.deviceCode,callback:function(t){e.$set(e.rightSearchParams,"deviceCode",t)},expression:"rightSearchParams.deviceCode"}})],1)],1),i("el-col",{attrs:{span:12}},[i("el-form-item",{attrs:{label:"名称"}},[i("el-input",{attrs:{placeholder:"请输入名称"},model:{value:e.rightSearchParams.deviceName,callback:function(t){e.$set(e.rightSearchParams,"deviceName",t)},expression:"rightSearchParams.deviceName"}})],1)],1)],1),i("el-row",[i("el-col",[i("el-form-item",{staticClass:"search-content-button-container"},[i("el-button-group",[i("el-button",{attrs:{type:"primary",size:"small",icon:"el-icon-search"},on:{click:e.refreshRightTable}},[e._v("查询\n ")]),i("el-button",{attrs:{size:"small",icon:"el-icon-refresh"},on:{click:e.resetRightSearchParam}},[e._v("重置\n ")])],1)],1)],1)],1)],1)],1),i("el-card",{staticClass:"box-card",attrs:{shadow:"hover"}},[i("el-table",{directives:[{name:"loading",rawName:"v-loading",value:e.sODeviceGroupTableLoading,expression:"sODeviceGroupTableLoading"}],ref:"sODeviceTableForGroup",staticStyle:{width:"100%","margin-top":"15px","margin-bottom":"15px"},attrs:{size:"medium",stripe:"",border:"","tooltip-effect":"dark",data:e.sODeviceGroupTablePage.list}},[i("el-table-column",{attrs:{type:"selection",width:"40"}}),i("el-table-column",{attrs:{prop:"code",width:"100",label:"编码",sortable:"custom","show-overflow-tooltip":""}}),i("el-table-column",{attrs:{prop:"name",label:"名称",sortable:"custom","show-overflow-tooltip":""}})],1),i("el-pagination",{attrs:{layout:"total, sizes, ->, prev, pager, next",total:e.sODeviceGroupTablePage.count,"page-sizes":[5,10,15,20],"page-size":e.sODeviceGroupTablePage.limit,background:""},on:{"size-change":e.handleTableGroupSizeChange,"current-change":e.handleTableGroupCurrentChange}})],1)],1)],1)],1)},s=[],r=(i("ac6a"),i("28a5"),i("cebc")),o=i("dc30"),l=i("e6a9"),n=(window.getDirewolfLibrary(),{name:"",code:"",type:"",limit:5,offset:0,order:"",sort:""}),c={deviceName:"",deviceCode:"",groupId:"",limit:5,offset:0,order:"",sort:""},d={name:"sODeviceListForGroup",components:{},data:function(){var e=this;return{searchParams:Object(r["a"])({},n),rightSearchParams:Object(r["a"])({},c),editType:this.$$utils.getQueryString("editType"),sODeviceTablePage:{},sODeviceTableLoading:!1,sODeviceGroupTablePage:{},sODeviceGroupTableLoading:!1,groupId:e.$route.query.groupId}},computed:{inViewMode:function(){return"view"===this.editType||!this.hasPermission("add")&&!this.hasPermission("edit")&&!this.hasPermission("del")}},methods:{hasPermission:function(e){return this.$$utils.permission.hasPermission("".concat(l["b"]).concat(e))},refreshTable:function(){var e=this;e.sODeviceTableLoading=!0,o["a"].getSODeviceList(e.searchParams).then((function(t){e.sODeviceTablePage=t.data,e.sODeviceTableLoading=!1}))},resetSearchParam:function(){this.searchParams=Object(r["a"])({},n),this.refreshTable()},resetRightSearchParam:function(){this.rightSearchParams=Object(r["a"])({},n),this.refreshRightTable()},handleRowClick:function(e,t,i){this.$$utils.eleTableClickSelection(this.$refs.sODeviceTable,e,i)},handleTableSizeChange:function(e){this.searchParams.limit=e,this.refreshTable()},handleTableGroupSizeChange:function(e){this.rightSearchParams.limit=e,this.refreshRightTable()},handleTableCurrentChange:function(e){this.searchParams.offset=this.searchParams.limit*(e-1),this.refreshTable()},handleTableGroupCurrentChange:function(e){this.rightSearchParams.offset=this.rightSearchParams.limit*(e-1),this.refreshRightTable()},handleSortChange:function(e){null===e.prop?(this.searchParams.sort=n.sort,this.searchParams.order=n.order):(this.searchParams.sort=e.prop,this.searchParams.order=e.order.split("ending")[0]),this.refreshTable()},addNewSODevice:function(){this.showFormDialog({editType:"add"})},viewSelectedSODevice:function(){var e=this,t=e.$refs.sODeviceTable.selection;1===t.length?e.showFormDialog({editType:"view",id:t[0].id}):e.$$utils.direwolfCommonTips("warning","仅能选择一条记录进行查看")},showFormDialog:function(e){var t=this;t.$$utils.openLayerDialog({el:"sODeviceForm",url:"".concat(l["c"],"/sODeviceForm"),props:e,title:"".concat(t.$$utils.getEditTypeName(e.editType),"设备表"),onConfirm:function(i,a){"view"!==e.editType?i.save((function(){t.refreshTable(),a()})):a()}})},deleteSelectedSODevice:function(){var e=this,t=e.$refs.sODeviceTable.selection;0!==t.length?e.$$utils.direwolfCommonConfirm({title:"删除提醒",message:"数据删除后不可恢复,确定继续删除吗?"},(function(){var i=[];t.forEach((function(e){e.id&&i.push(e.id)})),i.length>0&&o["a"].deleteAllSODevice(i).then((function(t){e.refreshTable(),e.$$utils.direwolfCommonTips("success","删除设备表成功")}))})):e.$$utils.direwolfCommonTips("warning","请选择要删除的记录")},editSelectedSODevice:function(){var e=this,t=this.$refs.sODeviceTable.selection;1===t.length?e.showFormDialog({editType:"edit",id:t[0].id}):e.$$utils.direwolfCommonTips("warning","仅能选择一条记录进行修改")},sODeviceRecordEdit:function(e){this.showFormDialog({editType:"edit",id:e.row.id})},sODeviceRecordRemove:function(e){var t=this;t.$$utils.direwolfCommonConfirm({title:"删除提醒",message:"数据删除后不可恢复,确定继续删除吗?"},(function(){var i="删除设备表";o["a"].deleteSODevice(e.row.id).then((function(e){t.refreshTable(),t.$$utils.direwolfCommonTips("success","".concat(i,"成功"))}))}))},handleSelectionChange:function(e){},addRightSelect:function(){var e=this,t=this.$refs.sODeviceTable.selection;if(0!=t.length){var i=[];t.forEach((function(e){i.push(e.id)}));var a={id:e.groupId,deviceIdList:i};o["a"].saveSODeviceGroup(a).then((function(t){e.$$utils.direwolfCommonTips("success","保存设备分组关联设备表成功"),e.refreshRightTable()}))}else e.$$utils.direwolfCommonTips("warning","未选择记录不能添加")},deleteRightSelect:function(){var e=this,t=this.$refs.sODeviceTableForGroup.selection;if(0!=t.length){var i=[];t.forEach((function(e){i.push(e.id)}));var a={id:e.groupId,deviceIdList:i};o["a"].deleteSPDeviceGroup(a).then((function(t){e.$$utils.direwolfCommonTips("success","删除备分组关联设备表成功"),e.refreshRightTable()}))}else e.$$utils.direwolfCommonTips("warning","未选择记录不能移除")},refreshRightTable:function(){var e=this;e.sODeviceGroupTableLoading=!0,e.rightSearchParams.groupId=e.groupId,o["a"].getSODeviceListByGroup(e.rightSearchParams).then((function(t){e.sODeviceGroupTablePage=t.data,e.sODeviceGroupTableLoading=!1}))}},created:function(){var e=this;e.refreshTable(),e.refreshRightTable()}},h=d,u=(i("8971e"),i("2877")),m=Object(u["a"])(h,a,s,!1,null,null,null);t["default"]=m.exports}}]);