liuxiaolong
2019-05-06 f99bc8c6a1d10610373738edd7d0aa0181c81d99
1
webpackJsonp([13],{"+IsS":function(t,e,n){"use strict";n.d(e,"e",function(){return i}),n.d(e,"a",function(){return r}),n.d(e,"g",function(){return s}),n.d(e,"b",function(){return o}),n.d(e,"d",function(){return c}),n.d(e,"c",function(){return l}),n.d(e,"f",function(){return u});var a=n("59if"),i=function(t){return Object(a.b)("data/api-d/device/findDeviceList",{body:t})},r=function(t){return Object(a.c)("data/api-d/device/add",{body:t})},s=function(t){return Object(a.c)("data/api-d/device/update",{body:t})},o=function(t){return Object(a.b)("data/api-d/device/delete",{body:t})},c=function(t){return Object(a.b)("data/api-d/device/findDeviceById",{body:t})},l=function(t){return Object(a.c)("data/api-d/DataSync/getCaptureImage1",{body:t,header:{"Content-Type":"application/x-www-form-urlencoded"}})},u=function(t){return Object(a.c)("data/api-d/DataSync/testConnection",{body:t,header:{"Content-Type":"application/x-www-form-urlencoded"}})}},"G0+C":function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});n("XPMo"),n("+BTi");var a=n("uEG6"),i=n.n(a),r=(n("8mNY"),n("YnkO")),s=n.n(r),o=(n("Dte2"),n("q4le")),c=n.n(o),l=(n("isE6"),n("LR6y")),u=n.n(l),d=n("Ls4C"),p=n("+IsS"),f=n("cCw9");function v(t){return function(){var e=t.apply(this,arguments);return new Promise(function(t,n){return function a(i,r){try{var s=e[i](r),o=s.value}catch(t){return void n(t)}if(!s.done)return Promise.resolve(o).then(function(t){a("next",t)},function(t){a("throw",t)});t(o)}("next")})}}function h(t){if(Array.isArray(t)){for(var e=0,n=Array(t.length);e<t.length;e++)n[e]=t[e];return n}return Array.from(t)}var b={name:"deviceManagement",metaInfo:{title:"设备管理"},data:function(){return{noneImg:'this.src="'+n("FiMw")+'"',userInfo:this.$store.getters.basicUserInfo,deviceType:"",deviceTypeDicts:[],authorizationSystem:"",sysDicts:[],searchName:"",tableList:[],total:0,pageSize:10,activePage:1,sideboxOpened:!1,activeCollapse:"basic",deviceInfo:null}},computed:{newSysDicts:function(){return[{value:"",lable:"全部"}].concat(h(this.sysDicts))},newDeviceTypeDicts:function(){return[{value:"",lable:"全部"}].concat(h(this.deviceTypeDicts))},newTableList:function(){var t=this.sysDicts;return this.tableList.map(function(e){if(e.authorizationSystem){var n=e.authorizationSystem.replace(/^,+|,+$/g,"").split(","),a="",i=!0,r=!1,s=void 0;try{for(var o,c=n[Symbol.iterator]();!(i=(o=c.next()).done);i=!0){var l=o.value,u=!0,d=!1,p=void 0;try{for(var f,v=t[Symbol.iterator]();!(u=(f=v.next()).done);u=!0){var h=f.value;h.value===l&&(a+=""===a?h.lable:","+h.lable)}}catch(t){d=!0,p=t}finally{try{!u&&v.return&&v.return()}finally{if(d)throw p}}}}catch(t){r=!0,s=t}finally{try{!i&&c.return&&c.return()}finally{if(r)throw s}}return e.authorizationSystemName=a,e}})}},methods:{closeSidebox:function(){this.sideboxOpened=!1,this.$refs.leftTable.setCurrentRow(null)},snMethod:function(t){return this.activePage>1?this.pageSize*(this.activePage-1)+t+1:t+1},getSysDicts:function(){var t=this;return v(regeneratorRuntime.mark(function e(){var n;return regeneratorRuntime.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,Object(f.e)({orgId:t.userInfo.orgId,userId:t.userInfo.id,tags:"device"});case 2:(n=e.sent)&&!n.error&&(t.sysDicts=n);case 4:case"end":return e.stop()}},e,t)}))()},getDeviceTypeDicts:function(){var t=this;return v(regeneratorRuntime.mark(function e(){var n;return regeneratorRuntime.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,Object(f.c)({orgId:t.userInfo.orgId});case 2:(n=e.sent)&&(t.deviceTypeDicts=n);case 4:case"end":return e.stop()}},e,t)}))()},_initData:function(){var t=this;return v(regeneratorRuntime.mark(function e(){var n;return regeneratorRuntime.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,Object(p.e)({orgId:t.userInfo.orgId,length:t.pageSize,start:t.pageSize*(t.activePage-1),searchName:t.searchName,deviceType:t.deviceType,authorizationSystem:t.authorizationSystem});case 2:(n=e.sent)&&(t.tableList=n.data,t.total=n.total);case 4:case"end":return e.stop()}},e,t)}))()},getDeviceInfo:function(t){var e=this;return v(regeneratorRuntime.mark(function n(){var a;return regeneratorRuntime.wrap(function(n){for(;;)switch(n.prev=n.next){case 0:return n.next=2,Object(p.d)({orgId:e.userInfo.orgId,id:t});case 2:(a=n.sent)?(e.deviceInfo=a,e.sideboxOpened=!0):e.$notify({group:"foo",type:"warn",title:"抱歉,这条数据有错误",text:"这条数据有错误,请联系管理员"});case 4:case"end":return n.stop()}},n,e)}))()},handleSearch:function(){this._initData()},handleDel:function(t){var e=this;this.$swal({title:"确定删除吗?",type:"warning",showCancelButton:!0,allowOutsideClick:!0,confirmButtonText:"确定删除!",cancelButtonText:"取消删除!",closeOnConfirm:!0},v(regeneratorRuntime.mark(function n(){var a;return regeneratorRuntime.wrap(function(n){for(;;)switch(n.prev=n.next){case 0:return n.next=2,Object(p.b)({orgId:e.userInfo.orgId,id:t});case 2:(a=n.sent)&&a.success?(e.$toast({type:"success",message:"删除成功"}),e._initData()):e.$toast({type:"error",message:"删除失败"});case 4:case"end":return n.stop()}},n,e)})))},checkDeviceInfo:function(t){t&&t.id&&this.getDeviceInfo(t.id)}},watch:{activePage:function(t,e){t!==e&&(this.activePage=t,this._initData())}},created:function(){this.getSysDicts(),this.getDeviceTypeDicts(),this._initData()},components:{Table:u.a,TableColumn:c.a,elCollapse:s.a,elCollapseItem:i.a,PerfectScrollbar:d.a}},m=n("XyMi");var y=function(t){n("yKwB"),n("P6OE")},g=Object(m.a)(b,function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("div",{staticClass:"clients-wrapper",class:{"clients-sidebox-open":t.sideboxOpened},staticStyle:{position:"initial"}},[n("div",{staticClass:"clients-content clients-scroll container-p-x container-p-y overflow-y"},[n("h4",{staticClass:"d-flex flex-wrap justify-content-between align-items-center font-weight-bold pt-2 mb-2"},[n("div",{staticClass:"mb-2"},[t._v("设备管理")]),t._v(" "),n("div",{staticClass:"mb-2",staticStyle:{"max-width":"200px"}},[n("fButton",{attrs:{type:"warning",authority:"sys:device:add"},nativeOn:{click:function(e){t.$router.push({path:"/device/add"})}}},[n("span",{staticClass:"fas fa-plus pr10"}),t._v("\n          添加设备\n        ")])],1)]),t._v(" "),n("b-card",{attrs:{"no-body":""}},[n("b-card-header",{staticClass:"media flex-wrap align-items-center py-4",attrs:{"header-tag":"h4"}},[n("b-button-group",{staticClass:"mr10"},t._l(t.newDeviceTypeDicts,function(e){return n("b-button",{key:e.id,attrs:{variant:t.deviceType===e.value?"primary":"outline-primary"},on:{click:function(n){t.deviceType=e.value,t._initData()}}},[t._v("\n            "+t._s(e.lable)+"\n            ")])})),t._v(" "),n("b-form-select",{staticClass:"mr10",staticStyle:{"max-width":"10rem"},attrs:{"text-field":"lable",options:t.newSysDicts},on:{change:function(e){t.authorizationSystem=e,t._initData()}},model:{value:t.authorizationSystem,callback:function(e){t.authorizationSystem=e},expression:"authorizationSystem"}}),t._v(" "),n("b-input",{staticClass:"mr10",staticStyle:{"max-width":"20rem"},attrs:{placeholder:"请输入IP地址、设备名称或位置描述...",autocomplete:"off"},nativeOn:{keyup:function(e){return"button"in e||!t._k(e.keyCode,"enter",13,e.key,"Enter")?t.handleSearch(e):null}},model:{value:t.searchName,callback:function(e){t.searchName=e},expression:"searchName"}}),t._v(" "),n("b-btn",{staticClass:"mr10",attrs:{variant:"primary"},on:{click:t.handleSearch}},[n("span",{staticClass:"fs fas-search"}),t._v("搜索")])],1),t._v(" "),n("div",{staticClass:"pl20 pr20 pt10 pb30"},[n("Table",{ref:"leftTable",attrs:{data:t.newTableList,"highlight-current-row":""},on:{"current-change":t.checkDeviceInfo}},[n("TableColumn",{attrs:{type:"index",prop:"index",label:"序号",index:t.snMethod,width:"50"}}),t._v(" "),n("TableColumn",{attrs:{label:"类型",prop:"type",width:"50"},scopedSlots:t._u([{key:"default",fn:function(e){return[n("img",{attrs:{src:"/static/img/map/"+e.row.icon+".png",width:"30",height:"30",onerror:t.noneImg,alt:e.row.icon}})]}}])}),t._v(" "),n("TableColumn",{attrs:{label:"设备名称",prop:"deviceName"}}),t._v(" "),n("TableColumn",{attrs:{label:"IP地址",prop:"ip"}}),t._v(" "),n("TableColumn",{attrs:{label:"位置描述",prop:"description"}}),t._v(" "),n("TableColumn",{attrs:{label:"授权系统",prop:"authorizationSystemName"}}),t._v(" "),n("TableColumn",{attrs:{label:"操作",width:"180"},scopedSlots:t._u([{key:"default",fn:function(e){return[n("div",{on:{click:function(t){t.stopPropagation()}}},[n("fButton",{staticStyle:{padding:"2px"},attrs:{type:"link",authority:"sys:device:delete"},nativeOn:{click:function(n){t.handleDel(e.row.id)}}},[t._v("\n                  删除\n                ")]),t._v(" "),n("fButton",{staticStyle:{padding:"2px"},attrs:{type:"link",authority:"sys:device:update"},nativeOn:{click:function(n){if(n.target!==n.currentTarget)return null;t.$router.push({path:"/device/add",query:{id:e.row.id}})}}},[t._v("\n                  编辑\n                ")])],1)]}}])})],1),t._v(" "),n("div",{staticClass:"pt20 pb20"},[t.total?n("b-pagination",{staticClass:"justify-content-center justify-content-sm-end m-0",attrs:{"total-rows":t.total,"per-page":t.pageSize},model:{value:t.activePage,callback:function(e){t.activePage=e},expression:"activePage"}}):t._e()],1)],1)],1)],1),t._v(" "),n("div",{staticClass:"clients-sidebox"},[n("a",{staticClass:"clients-sidebox-close setCloseBtn text-muted text-xlarge font-weight-light",attrs:{href:"#"},on:{click:function(e){return e.preventDefault(),t.closeSidebox(e)}}},[n("i",{staticClass:"fa fa-angle-double-right"})]),t._v(" "),n("perfect-scrollbar",{staticClass:"clients-scroll  pl20 pr20",attrs:{options:{suppressScrollX:!0,wheelPropagation:!0}}},[n("h5",{staticClass:"pt30"},[t._v("设备属性 ")]),t._v(" "),n("b-card",{staticClass:"pt30 pl20 pr20 pb20",attrs:{"no-body":""}},[n("el-collapse",{model:{value:t.activeCollapse,callback:function(e){t.activeCollapse=e},expression:"activeCollapse"}},[n("el-collapse-item",{attrs:{title:"概况",name:"basic"}},[n("b-form-group",{attrs:{horizontal:"","label-class":"text-sm-right pt-0","label-cols":5,label:"IP地址:"}},[n("div",[t._v(t._s(t.deviceInfo&&t.deviceInfo.ip))])]),t._v(" "),n("b-form-group",{attrs:{horizontal:"","label-class":"text-sm-right pt-0","label-cols":5,label:"端口号:"}},[n("div",[t._v(t._s(t.deviceInfo&&t.deviceInfo.port))])])],1),t._v(" "),n("el-collapse-item",{attrs:{title:"维修记录",name:"repair"}},[n("div",{staticClass:"text-center"},[t._v("暂无数据")])])],1)],1)],1)],1)])},[],!1,y,null,null);e.default=g.exports},P6OE:function(t,e){}});