Files
fastbee/docker/data/nginx/html/static/js/chunk-74f15b20.06636b6b.js
2022-08-19 00:28:36 +08:00

1 line
7.3 KiB
JavaScript
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

(window["webpackJsonp"]=window["webpackJsonp"]||[]).push([["chunk-74f15b20"],{"01ca":function(e,t,n){"use strict";n.d(t,"f",(function(){return a})),n.d(t,"d",(function(){return o})),n.d(t,"a",(function(){return r})),n.d(t,"e",(function(){return l})),n.d(t,"g",(function(){return s})),n.d(t,"c",(function(){return u})),n.d(t,"b",(function(){return d}));var i=n("b775");function a(e){return Object(i["a"])({url:"/iot/model/list",method:"get",params:e})}function o(e){return Object(i["a"])({url:"/iot/model/"+e,method:"get"})}function r(e){return Object(i["a"])({url:"/iot/model",method:"post",data:e})}function l(e){return Object(i["a"])({url:"/iot/model/import",method:"post",data:e})}function s(e){return Object(i["a"])({url:"/iot/model",method:"put",data:e})}function u(e){return Object(i["a"])({url:"/iot/model/"+e,method:"delete"})}function d(e){return Object(i["a"])({url:"/iot/model/cache/"+e,method:"get"})}},7168:function(e,t,n){"use strict";n.r(t);var i=function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("div",{staticStyle:{"padding-left":"20px"}},[n("el-form",{directives:[{name:"show",rawName:"v-show",value:e.showSearch,expression:"showSearch"}],ref:"queryForm",attrs:{model:e.queryParams,inline:!0,"label-width":"68px"}},[n("el-form-item",{attrs:{label:"日志类型",prop:"logType"}},[n("el-select",{attrs:{placeholder:"请选择类型",clearable:"",size:"small"},model:{value:e.queryParams.logType,callback:function(t){e.$set(e.queryParams,"logType",t)},expression:"queryParams.logType"}},e._l(e.dict.type.iot_device_log_type,(function(e){return n("el-option",{key:e.value,attrs:{label:e.label,value:e.value}})})),1)],1),n("el-form-item",{attrs:{label:"标识符",prop:"identity"}},[n("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.identity,callback:function(t){e.$set(e.queryParams,"identity",t)},expression:"queryParams.identity"}})],1),n("el-form-item",[n("el-button",{attrs:{type:"primary",icon:"el-icon-search",size:"mini"},on:{click:e.handleQuery}},[e._v("搜索")]),n("el-button",{attrs:{icon:"el-icon-refresh",size:"mini"},on:{click:e.resetQuery}},[e._v("重置")])],1)],1),n("el-table",{directives:[{name:"loading",rawName:"v-loading",value:e.loading,expression:"loading"}],attrs:{data:e.deviceLogList,size:"mini"}},[n("el-table-column",{attrs:{label:"类型",align:"center",prop:"logType",width:"120"},scopedSlots:e._u([{key:"default",fn:function(t){return[n("dict-tag",{attrs:{options:e.dict.type.iot_device_log_type,value:t.row.logType}})]}}])}),n("el-table-column",{attrs:{label:"模式",align:"center",prop:"logType",width:"120"},scopedSlots:e._u([{key:"default",fn:function(t){return[1==t.row.mode?n("el-tag",{attrs:{type:"primary"}},[e._v("影子模式")]):2==t.row.mode?n("el-tag",{attrs:{type:"success"}},[e._v("在线模式")]):n("el-tag",{attrs:{type:"info"}},[e._v("其他信息")])]}}])}),n("el-table-column",{attrs:{label:"时间",align:"center",prop:"createTime",width:"150"},scopedSlots:e._u([{key:"default",fn:function(t){return[n("span",[e._v(e._s(t.row.createTime))])]}}])}),n("el-table-column",{attrs:{label:"标识符",align:"center",prop:"identity"}}),n("el-table-column",{attrs:{label:"动作",align:"left","header-align":"center",prop:"logValue"},scopedSlots:e._u([{key:"default",fn:function(t){return[n("div",{domProps:{innerHTML:e._s(e.formatValueDisplay(t.row))}})]}}])}),n("el-table-column",{attrs:{label:"备注","header-align":"center",align:"left",prop:"remark"},scopedSlots:e._u([{key:"default",fn:function(t){return[e._v(" "+e._s(null==t.row.remark?"无":t.row.remark)+" ")]}}])})],1),n("div",{staticStyle:{height:"40px"}},[n("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}})],1)],1)},a=[],o=n("5530"),r=(n("b0c0"),n("a035")),l=n("01ca"),s={name:"DeviceLog",dicts:["iot_device_log_type","iot_yes_no"],props:{device:{type:Object,default:null}},watch:{device:function(e,t){this.deviceInfo=e,this.deviceInfo&&0!=this.deviceInfo.deviceId&&(this.queryParams.deviceId=this.deviceInfo.deviceId,this.getList(),this.getCacheThingsModdel(this.deviceInfo.productId))}},data:function(){return{thingsModel:{},loading:!0,showSearch:!0,total:0,deviceLogList:[],queryParams:{pageNum:1,pageSize:10,logType:null,logValue:null,deviceId:null,deviceName:null,identity:null,isMonitor:null}}},created:function(){},methods:{getList:function(){var e=this;this.loading=!0,Object(r["a"])(this.queryParams).then((function(t){e.deviceLogList=t.rows,e.total=t.total,e.loading=!1}))},handleQuery:function(){this.queryParams.pageNum=1,this.getList()},resetQuery:function(){this.resetForm("queryForm"),this.handleQuery()},handleExport:function(){this.download("iot/deviceLog/export",Object(o["a"])({},this.queryParams),"deviceLog_".concat((new Date).getTime(),".xlsx"))},getCacheThingsModdel:function(e){var t=this;Object(l["b"])(e).then((function(e){t.thingsModel=JSON.parse(e.data)}))},formatValueDisplay:function(e){if(1==e.logType){var t=this.getThingsModelItem(1,e.identity);if(""!=t)return t.name+' <span style="color:#409EFF;">'+this.getThingsModelItemValue(t,e.logValue)+" "+(void 0!=t.datatype.unit?t.datatype.unit:"")+"</span>"}else if(2==e.logType){var n=this.getThingsModelItem(2,e.identity);if(""!=n)return n.name+' <span style="color:#409EFF">'+this.getThingsModelItemValue(n,e.logValue)+" "+(void 0!=n.datatype.unit?n.datatype.unit:"")+"</span>"}else if(3==e.logType){var i=this.getThingsModelItem(3,e.identity);if(""!=i)return i.name+' <span style="color:#409EFF">'+this.getThingsModelItemValue(i,e.logValue)+" "+(void 0!=i.datatype.unit?i.datatype.unit:"")+"</span>"}else{if(4==e.logType)return'<span style="font-weight:bold">设备升级</span>';if(5==e.logType)return'<span style="font-weight:bold">设备上线</span>';if(6==e.logType)return'<span style="font-weight:bold">设备离线</span>'}return""},getThingsModelItemValue:function(e,t){if("bool"==e.datatype.type){if("0"==t)return e.datatype.falseText;if("1"==t)return e.datatype.trueText}else if("enum"==e.datatype.type)for(var n=0;n<e.datatype.enumList.length;n++)if(t==e.datatype.enumList[n].value)return e.datatype.enumList[n].text;return t},getThingsModelItem:function(e,t){if(1==e&&this.thingsModel.properties){for(var n=0;n<this.thingsModel.properties.length;n++)if(this.thingsModel.properties[n].id==t)return this.thingsModel.properties[n]}else if(2==e&&this.thingsModel.functions){for(var i=0;i<this.thingsModel.functions.length;i++)if(this.thingsModel.functions[i].id==t)return this.thingsModel.functions[i]}else if(3==e&&this.thingsModel.events)for(var a=0;a<this.thingsModel.events.length;a++)if(this.thingsModel.events[a].id==t)return this.thingsModel.events[a];return""}}},u=s,d=n("2877"),c=Object(d["a"])(u,i,a,!1,null,null,null);t["default"]=c.exports},a035:function(e,t,n){"use strict";n.d(t,"a",(function(){return a})),n.d(t,"b",(function(){return o}));var i=n("b775");function a(e){return Object(i["a"])({url:"/iot/deviceLog/list",method:"get",params:e})}function o(e){return Object(i["a"])({url:"/iot/deviceLog/monitor",method:"get",params:e})}}}]);