1 line
11 KiB
JavaScript
1 line
11 KiB
JavaScript
(window["webpackJsonp"]=window["webpackJsonp"]||[]).push([["chunk-3eed9936"],{"872b":function(e,t,a){},a9db:function(e,t,a){"use strict";a("872b")},abf9:function(e,t,a){"use strict";a.r(t);var r=function(){var e=this,t=e.$createElement,a=e._self._c||t;return a("div",{staticClass:"app-container"},[a("div",{staticClass:"bgHeight"},[a("div",{ref:"box",staticClass:"searchStys transition_dom"},[a("el-form",{ref:"queryInfo",attrs:{model:e.queryInfo}},[a("div",{ref:"form_box",staticClass:"searchBar"},[a("div",{staticClass:"searchInput"},[a("el-row",{attrs:{gutter:20}},[a("el-col",{attrs:{span:6}},[a("el-form-item",{attrs:{prop:"name"}},[a("el-input",{attrs:{clearable:"",placeholder:"边设备名称"},model:{value:e.queryInfo.name,callback:function(t){e.$set(e.queryInfo,"name",t)},expression:"queryInfo.name"}})],1)],1),e._v(" "),a("el-col",{attrs:{span:6}},[a("el-form-item",{attrs:{prop:"deviceTypeId"}},[a("el-select",{attrs:{placeholder:"请选择边设备类型",clearable:""},model:{value:e.queryInfo.deviceTypeId,callback:function(t){e.$set(e.queryInfo,"deviceTypeId",t)},expression:"queryInfo.deviceTypeId"}},e._l(e.deviceTypeIdList,(function(e,t){return a("el-option",{key:t,attrs:{label:e.label,value:e.value}})})),1)],1)],1),e._v(" "),a("el-col",{attrs:{span:6}},[a("el-form-item",{attrs:{prop:"status"}},[a("el-select",{attrs:{placeholder:"请选择状态",clearable:""},model:{value:e.queryInfo.status,callback:function(t){e.$set(e.queryInfo,"status",t)},expression:"queryInfo.status"}},e._l(e.deviceStatus,(function(e,t){return a("el-option",{key:t,attrs:{label:e.label,value:e.value}})})),1)],1)],1)],1)],1),e._v(" "),a("div",{staticClass:"searchBtn"},[a("el-form-item",[a("el-button",{directives:[{name:"points",rawName:"v-points",value:500,expression:"500"}],on:{click:function(t){return e.resetForm("queryInfo")}}},[e._v("重置")]),e._v(" "),a("el-button",{directives:[{name:"points",rawName:"v-points",value:500,expression:"500"}],attrs:{type:"primary"},on:{click:e.getList}},[e._v("查询")])],1)],1)])])],1),e._v(" "),a("el-card",{staticClass:"box-card",attrs:{shadow:"never"}},[a("div",{staticClass:"planLst",attrs:{slot:"header"},slot:"header"},[a("span",{staticClass:"planTitle"},[e._v("边缘设备列表")]),e._v(" "),a("div",[a("el-button",{directives:[{name:"points",rawName:"v-points",value:500,expression:"500"}],attrs:{type:"primary",icon:"el-icon-plus"},on:{click:e.addItem}},[e._v("新增")])],1)]),e._v(" "),a("el-table",{directives:[{name:"loading",rawName:"v-loading",value:e.listLoading,expression:"listLoading"}],attrs:{border:"",data:e.listData,"header-cell-style":e.headClass}},[a("el-table-column",{attrs:{type:"index",label:"#",align:"center","min-width":"50",fixed:""},scopedSlots:e._u([{key:"default",fn:function(t){return[a("span",[e._v(e._s(t.$index+(e.queryInfo.pageNumber-1)*e.queryInfo.pageSize+1))])]}}])}),e._v(" "),a("el-table-column",{attrs:{align:"center","min-width":"150",label:"\n 边设备名称","show-overflow-tooltip":""},scopedSlots:e._u([{key:"default",fn:function(t){return[e._v(e._s(t.row.name||"-"))]}}])}),e._v(" "),a("el-table-column",{attrs:{align:"center","min-width":"150",label:"边设备类型","show-overflow-tooltip":""},scopedSlots:e._u([{key:"default",fn:function(t){return[e._v(e._s(e._f("getItemType")(t.row.deviceTypeId,e.deviceTypeIdList)))]}}])}),e._v(" "),a("el-table-column",{attrs:{align:"center","min-width":"80",label:"边设备厂家","show-overflow-tooltip":""},scopedSlots:e._u([{key:"default",fn:function(t){return[e._v(e._s(e._f("getItemType")(t.row.manufacturerId,e.deviceManufacturers)))]}}])}),e._v(" "),a("el-table-column",{attrs:{align:"center","min-width":"120",label:"边设备ID","show-overflow-tooltip":""},scopedSlots:e._u([{key:"default",fn:function(t){return[e._v(e._s(t.row.deviceId))]}}])}),e._v(" "),a("el-table-column",{attrs:{align:"center","min-width":"120",label:"自动发送工单","show-overflow-tooltip":""},scopedSlots:e._u([{key:"default",fn:function(t){return[e._v(e._s(1==t.row.autoCreateOrder?"是":"否"))]}}])}),e._v(" "),a("el-table-column",{attrs:{align:"center","min-width":"100",label:"状态","show-overflow-tooltip":""},scopedSlots:e._u([{key:"default",fn:function(t){return[e._v(e._s(e._f("getItemType")(t.row.status,e.deviceStatus)))]}}])}),e._v(" "),a("el-table-column",{attrs:{align:"center","min-width":"100",label:"操作人","show-overflow-tooltip":""},scopedSlots:e._u([{key:"default",fn:function(t){return[e._v(e._s(t.row.opUserName||"-"))]}}])}),e._v(" "),a("el-table-column",{attrs:{align:"center","min-width":"170",label:"心跳时间","show-overflow-tooltip":""},scopedSlots:e._u([{key:"default",fn:function(t){return[e._v(e._s(t.row.heartbeatTime||"-"))]}}])}),e._v(" "),a("el-table-column",{attrs:{align:"center","min-width":"170",label:"操作时间","show-overflow-tooltip":""},scopedSlots:e._u([{key:"default",fn:function(t){return[e._v(e._s(t.row.updateTime||"-"))]}}])}),e._v(" "),a("el-table-column",{attrs:{align:"center",label:"操作","min-width":"80",fixed:"right"},scopedSlots:e._u([{key:"default",fn:function(t){return[a("el-button",{directives:[{name:"points",rawName:"v-points",value:500,expression:"500"}],attrs:{size:"mini",type:"text"},on:{click:function(a){return e.editItem(t.row)}}},[e._v("编辑")])]}}])})],1),e._v(" "),a("div",{staticClass:"pagination-container",staticStyle:{"margin-top":"10px","text-align":"right"}},[a("el-pagination",{attrs:{background:"","page-sizes":[10,30,50,100,200],"page-size":1,layout:"total, sizes, prev, pager, next, jumper",total:e.total},on:{"size-change":e.handleSizeChange,"current-change":e.handleCurrentChange}})],1)],1)],1),e._v(" "),a("el-dialog",{staticClass:"dialogHead",attrs:{title:e.title,"show-close":!1,"close-on-click-modal":!1,"close-on-press-escape":!1,visible:e.addDialog,width:"30%",height:"300px"},on:{closed:function(t){return e.closeDialog("categoryFrom")},"update:visible":function(t){e.addDialog=t}}},[a("el-form",{ref:"categoryFrom",attrs:{model:e.addForm,rules:e.addRules,"label-width":"120px"}},[a("el-form-item",{attrs:{label:"边设备名称:",prop:"name"}},[a("el-input",{attrs:{placeholder:"请输入边设备名称"},model:{value:e.addForm.name,callback:function(t){e.$set(e.addForm,"name","string"===typeof t?t.trim():t)},expression:"addForm.name"}})],1),e._v(" "),a("el-form-item",{attrs:{label:"边设备类型:",prop:"deviceTypeId"}},[a("el-select",{attrs:{placeholder:"请选择边设备类型",clearable:""},model:{value:e.addForm.deviceTypeId,callback:function(t){e.$set(e.addForm,"deviceTypeId",t)},expression:"addForm.deviceTypeId"}},e._l(e.deviceTypeIdList,(function(e,t){return a("el-option",{key:t,attrs:{label:e.label,value:e.value}})})),1)],1),e._v(" "),a("el-form-item",{attrs:{label:"边设备厂家:",prop:"manufacturerId"}},[a("el-select",{attrs:{placeholder:"请选择边设备厂家",clearable:""},model:{value:e.addForm.manufacturerId,callback:function(t){e.$set(e.addForm,"manufacturerId",t)},expression:"addForm.manufacturerId"}},e._l(e.deviceManufacturers,(function(e,t){return a("el-option",{key:t,attrs:{label:e.label,value:e.value}})})),1)],1),e._v(" "),a("el-form-item",{attrs:{label:"边设备ID:",prop:"deviceId"}},[a("el-input",{attrs:{placeholder:"请输入边设备ID",onkeyup:"value=value.replace(/[^\\w\\.\\/]/ig,'')"},model:{value:e.addForm.deviceId,callback:function(t){e.$set(e.addForm,"deviceId","string"===typeof t?t.trim():t)},expression:"addForm.deviceId"}})],1),e._v(" "),a("el-form-item",{attrs:{label:"自动发送工单:",prop:"autoCreateOrder"}},[a("el-switch",{attrs:{"active-value":1,"inactive-value":0,"active-text":"是","inactive-text":"否"},model:{value:e.addForm.autoCreateOrder,callback:function(t){e.$set(e.addForm,"autoCreateOrder",t)},expression:"addForm.autoCreateOrder"}})],1),e._v(" "),a("div",{staticClass:"btnBox"},[a("el-button",{directives:[{name:"points",rawName:"v-points",value:500,expression:"500"}],on:{click:function(t){return e.cancelFrom("categoryFrom")}}},[e._v("关闭")]),e._v(" "),a("el-button",{directives:[{name:"points",rawName:"v-points",value:500,expression:"500"}],attrs:{type:"primary"},on:{click:function(t){return e.saveInfoList("categoryFrom")}}},[e._v("提交")])],1)],1)],1)],1)},o=[],s=a("f564"),i=a("dce5"),n={components:{},data:function(){return{listData:[],listLoading:!1,total:0,addDialog:!1,title:"",deviceTypeIdList:i["P"],deviceStatus:i["O"],deviceManufacturers:i["N"],queryInfo:{name:"",deviceTypeId:"",status:"",pageNumber:1,pageSize:10,projectUuid:"",autoCreateOrder:""},projectId:"",addForm:{name:"",deviceTypeId:"",manufacturerId:"",deviceId:"",autoCreateOrder:0},editForm:{},addRules:{name:[{required:!0,message:"请输入边设备名称",trigger:"blur"}],deviceTypeId:[{required:!0,message:"请选择边设备类型",trigger:"change"}],manufacturerId:[{required:!0,message:"请选择边设备厂家",trigger:"change"}],deviceId:[{required:!0,message:"请输入边设备ID",trigger:"blur"}]}}},created:function(){this.projectId=this.$store.state.community_uuid,this.headClass(),this.getList()},mounted:function(){},methods:{getList:function(){var e=this;this.queryInfo.projectUuid=this.projectId,Object(s["a"])(this.queryInfo).then((function(t){0==t.code?(e.listData=t.data.records,e.total=t.data.rowsCount):e.$message.error(t.message),sessionStorage.setItem(e.$route.name,JSON.stringify(e.queryInfo))}))},resetForm:function(e){this.$refs[e].resetFields(),this.getList()},addItem:function(){var e=this;this.addDialog=!0,this.title="边缘设备",this.$nextTick((function(){e.$refs.categoryFrom.resetFields()}))},editItem:function(e){var t=this;this.title="编辑边缘设备",this.addDialog=!0,this.$nextTick((function(){t.addForm=JSON.parse(JSON.stringify(e)),console.log(t.addForm),t.addForm.opUserId=t.$store.state.user.userInfo.memberId,t.addForm.opUserName=t.$store.state.user.userInfo.memberName}))},cancelFrom:function(e){this.$refs[e].resetFields(),this.addDialog=!1},closeDialog:function(e){this.$refs[e].resetFields(),this.addDialog=!1},addInvoice:function(){var e=this;this.addForm.opUserId=this.$store.state.user.userInfo.memberId,this.addForm.opUserName=this.$store.state.user.userInfo.memberName,this.addForm.projectName=this.$store.state.community_name,this.addForm.projectUuid=this.$store.state.community_uuid,this.addForm.companyId=this.$store.state.companyId,this.addForm.companyName=localStorage.getItem("companyName"),Object(s["b"])(this.addForm).then((function(t){0===t.code&&(e.$message({message:"添加成功",type:"success"}),e.getList(),e.$refs["categoryFrom"].resetFields(),e.addDialog=!1)}))},editInvoice:function(){var e=this;Object(s["c"])(this.addForm).then((function(t){0===t.code&&(e.$message({message:"编辑成功",type:"success"}),e.getList(),e.$refs["categoryFrom"].resetFields(),e.addDialog=!1)}))},saveInfoList:function(e){var t=this;this.$refs[e].validate((function(e){if(!e)return!1;"边缘设备"==t.title?t.addInvoice():t.editInvoice()}))},headClass:function(){return"text-align:center;background:#FAFAFA;"},handleSizeChange:function(e){this.queryInfo.pageSize=e,this.getList()},handleCurrentChange:function(e){this.queryInfo.pageNumber=e,this.getList()}}},l=n,d=(a("a9db"),a("829d")),c=Object(d["a"])(l,r,o,!1,null,null,null);t["default"]=c.exports},f564:function(e,t,a){"use strict";a.d(t,"a",(function(){return o})),a.d(t,"b",(function(){return s})),a.d(t,"c",(function(){return i}));var r=a("b775");function o(e){return Object(r["a"])({url:"/appproject/EdgeDevice/pageList",method:"post",data:e})}function s(e){return Object(r["a"])({url:"/appproject/EdgeDevice/create",method:"post",data:e})}function i(e){return Object(r["a"])({url:"/appproject/EdgeDevice/update",method:"post",data:e})}}}]); |