text: (window["webpackJsonp"]=window["webpackJsonp"]||[]).push([["chunk-1616165d"],{"0377":function(t,e,a){},"08ad":function(t,e,a){},"2b82":function(t,e,a){"use strict";a("0377")},"2bb3":function(t,e,a){"use strict";var i=function(){var t=this,e=t.$createElement,a=t._self._c||e;return a("div",{staticClass:"things-card"},[a("el-card",{attrs:{shadow:"hover"}},[a("div",{staticClass:"things-card-content"},[a("div",{staticClass:"things-card__header",class:{"header-enable":t.data.interval<200,"header-disable":t.data.interval>=200}},[a("div",{staticClass:"things-card-header-icon"},[a("img",{attrs:{src:t.icon,alt:t.data.name}})]),a("div",{staticClass:"things-card-header-name nowrap-name",on:{click:function(e){return t.copyId(t.data.id)}}},[t._v(t._s(t.point(t.data.pointId)))]),a("div",{staticClass:"things-card-header-status",attrs:{title:"读写类型"}},[0===t.data.rw?a("el-tag",{attrs:{type:"warning",effect:"plain"}},[t._v("只读")]):1===t.data.rw?a("el-tag",{attrs:{type:"info",effect:"plain"}},[t._v("只写")]):2===t.data.rw?a("el-tag",{attrs:{type:"success",effect:"plain"}},[t._v("读写")]):t._e()],1)]),a("div",{staticClass:"things-card__body"},[a("div",{staticClass:"things-card-body-content"},[a("ul",{staticClass:"things-card-body-content-value"},[a("li",{staticClass:"nowrap-item value",attrs:{title:"处理值，点击复制"},on:{click:function(e){return t.copyValue(t.data)}}},[t._v(t._s(t.data.value)+" "+t._s(t.data.unit))]),a("li",{staticClass:"nowrap-item",attrs:{title:"计算值"}},[t._v(t._s(t.data.calculateValue||"-"))]),a("li",{staticClass:"nowrap-item"},[a("span",[a("i",{staticClass:"el-icon-sunrise"}),t._v(" 原始值: ")]),t._v(t._s(t.data.rawValue))]),t.embedded?t._e():a("li",{staticClass:"nowrap-item value-point"},[a("span",[a("i",{staticClass:"el-icon-s-finance"}),t._v(" 所属设备: ")]),t._v(t._s(t.device(t.data.deviceId)))]),t.embedded?t._e():a("li",{staticClass:"nowrap-item"},[a("span",[a("i",{staticClass:"el-icon-timer"}),t._v(" 数据延时: ")]),t._v(t._s(t.data.interval)+" ms")]),a("li",{staticClass:"nowrap-item"},[a("span",[a("i",{staticClass:"el-icon-edit-outline"}),t._v(" 采集日期: ")]),t._v(t._s(t.timestamp(t.data.originTime)))]),a("li",{staticClass:"nowrap-item"},[a("span",[a("i",{staticClass:"el-icon-sunset"}),t._v(" 保存日期: ")]),t._v(t._s(t.timestamp(t.data.createTime)))]),t.embedded?a("li",{staticClass:"value-detail nowrap-item",attrs:{title:"详细内容"}},[a("i",{staticClass:"el-icon-zoom-in",on:{click:function(e){return t.showDetail(t.data)}}})]):t._e()])]),t.embedded?a("div",{staticClass:"things-card-body-content-time"},[a("sparkline",[a("sparklineCurve",{attrs:{data:t.line,limit:100,refLineStyles:t.spRefLineStyles,styles:t.spCurveStyles}})],1)],1):t._e()]),t.embedded?t._e():a("div",{staticClass:"things-card__footer"},[a("div",{staticClass:"things-card-footer-operation"},[a("el-popconfirm",{attrs:{title:"是否确定删除该数据？",placement:"top",icon:"el-icon-remove-outline"}},[a("el-button",{staticClass:"operation-tooltip",attrs:{slot:"reference",type:"text"},slot:"reference"},[t._v("删除")])],1),a("el-button",{attrs:{type:"text"}},[t._v("编辑")]),a("el-button",{attrs:{type:"text"}},[t._v("详情")])],1)])])])],1)},n=[],o=a("0e0b"),s={name:"point-value-card",props:{embedded:{type:Boolean,default:function(){return!1}},deviceTable:{type:Object,default:function(){return{}}},pointTable:{type:Object,default:function(){return{}}},historyData:{type:Object,default:function(){return{}}},data:{type:Object,default:function(){return{deviceId:"",pointId:"",value:"",rawValue:"",calculateValue:"",interval:"",createTime:"",originTime:""}}},icon:{type:String,default:"images/common/point.png"}},data:function(){return{spRefLineStyles:{stroke:"#54a5ff",strokeOpacity:.5,strokeDasharray:"2, 2"},spCurveStyles:{stroke:"#54a5ff"}}},mounted:function(){},computed:{line:function(){return this.embedded?this.historyData[this.data.pointId]:[]}},methods:{device:function(t){return this.deviceTable[t]||"NaN"},point:function(t){return this.pointTable[t]||"NaN"},showEdit:function(t){this.$emit("showEdit",t)},showDetail:function(t){var e=t.value;try{e=JSON.parse(t.value)}catch(i){}var a={deviceId:t.deviceId,pointId:t.pointId,type:t.type,value:e,calculateValue:t.calculateValue,rawValue:t.rawValue};this.$emit("showDetail",a)},copyId:function(t){Object(o["c"])(t,!0,"位号值ID")},copyValue:function(t){var e={deviceId:t.deviceId,pointId:t.pointId,value:t.value};Object(o["c"])(JSON.stringify(e,null,2),!0,"位号值")},timestamp:function(t){return Object(o["a"])(new Date(t))}}},l=s,r=(a("2b82"),a("2877")),c=Object(r["a"])(l,i,n,!1,null,null,null);e["a"]=c.exports},4263:function(t,e,a){"use strict";a("b12e")},"48b2":function(t,e,a){},"58a3":function(t,e,a){"use strict";a("fec2")},"66ce":function(t,e,a){"use strict";a.r(e);var i=function(){var t=this,e=t.$createElement,a=t._self._c||e;return a("div",[a("base-card",[a("el-tabs",{on:{"tab-click":t.changeActive},model:{value:t.active,callback:function(e){t.active=e},expression:"active"}},[a("el-tab-pane",{attrs:{label:"设备详情",name:"detail"}},[a("detail-card",[a("ul",[a("li",[a("i",{staticClass:"el-icon-data-line"}),t._v(" 设备名称: "+t._s(t.data.name))]),a("li",[a("i",{staticClass:"el-icon-tickets"}),t._v(" 包含模板 ["+t._s(t.data.profileIds.length||0)+" 个]: "+t._s(t.profileName(t.data.profileIds)))]),a("li",[a("i",{staticClass:"el-icon-collection-tag"}),t._v(" 包含位号 ["+t._s(t.listPointData.length||0)+" 个]: "+t._s(t.pointName()))]),a("li",[a("i",{staticClass:"el-icon-s-promotion"}),t._v(" 所属驱动: "+t._s(t.driverName(t.data.driverId)))]),a("li",[a("i",{staticClass:"el-icon-edit-outline"}),t._v(" 修改日期: "+t._s(t.timestamp(t.data.createTime)))]),a("li",[a("i",{staticClass:"el-icon-sunset"}),t._v(" 创建日期: "+t._s(t.timestamp(t.data.updateTime)))])])])],1),a("el-tab-pane",{attrs:{label:"包含模板",name:"profile"}},[a("el-row",t._l(t.listProfileData,(function(e){return a("el-col",{key:e.id,attrs:{xs:24,sm:12,md:8,lg:6,xl:4}},[a("profile-card",{attrs:{data:e,pointTable:t.pointTable,embedded:!0}})],1)})),1)],1),a("el-tab-pane",{attrs:{label:"包含位号",name:"point"}},[a("el-row",t._l(t.listPointData,(function(e){return a("el-col",{key:e.id,attrs:{xs:24,sm:12,md:12,lg:8,xl:6}},[a("point-card",{attrs:{data:e,profileTable:t.profileTable,embedded:!0}})],1)})),1)],1),a("el-tab-pane",{attrs:{label:"设备数据",name:"pointValue"}},[a("el-row",t._l(t.listPointValueData,(function(e){return e?a("el-col",{key:e.id,attrs:{xs:24,sm:12,md:8,lg:6,xl:4}},[e?a("point-value-card",{attrs:{data:e,deviceTable:t.deviceTable,pointTable:t.pointTable,historyData:t.listPointValueHistoryData,embedded:!0},on:{showEdit:t.showPointValueEdit,showDetail:t.showPointValueDetail}}):t._e()],1):t._e()})),1)],1),a("el-tab-pane",{attrs:{label:"设备事件",name:"deviceEvent"}},[a("el-timeline",[a("el-timeline-item",{attrs:{timestamp:"2021/7/30",placement:"top"}},[a("el-card",[a("h4",[t._v("设备数据上报")]),a("p",[t._v("该设备于 2021/7/30 20:46 开始上报数据")])])],1),a("el-timeline-item",{attrs:{timestamp:"2021/7/30",placement:"top"}},[a("el-card",[a("h4",[t._v("设备上线")]),a("p",[t._v("该设备于 2021/7/30 20:46 上线")])])],1),a("el-timeline-item",{attrs:{timestamp:"2021/7/30",placement:"top"}},[a("el-card",[a("h4",[t._v("设备注册")]),a("p",[t._v("该设备于 2021/7/30 20:46 注册成功")])])],1)],1)],1)],1)],1),a("point-value-edit-form",{ref:"point-value-edit-form",attrs:{formData:t.pointValueFormData},on:{"update-thing":t.updateThing}}),a("point-value-detail",{ref:"point-value-detail",attrs:{detailData:t.pointValueDetailData}})],1)},n=[],o=a("5530"),s=(a("b0c0"),a("159b"),a("d81d"),a("a15b"),a("a712")),l=a("af18"),r=a("3a79"),c=a("f8cf"),d=a("7b66"),u=a("2bb3"),p=function(){var t=this,e=t.$createElement,a=t._self._c||e;return a("el-dialog",{staticClass:"things-dialog",attrs:{title:"编辑位号值",visible:t.formVisible,"show-close":!1,"append-to-body":!0,"model-append-to-body":!1,"close-on-click-modal":!1,"close-on-press-escape":!1},on:{"update:visible":function(e){t.formVisible=e}}},[a("el-form",{ref:"formData",attrs:{size:"small",model:t.formData,rules:t.formRule}},[a("el-form-item",{staticClass:"things-dialog-form-item",attrs:{label:"位号值",prop:"value"}},[a("el-input",{attrs:{clearable:"",placeholder:"请输入位号值"},model:{value:t.formData.value,callback:function(e){t.$set(t.formData,"value",e)},expression:"formData.value"}})],1),a("el-form-item",{staticClass:"things-dialog-form-item",attrs:{label:"操作描述",prop:"description"}},[a("el-input",{attrs:{clearable:"",type:"textarea",maxlength:"300","show-word-limit":"",placeholder:"请输入本次操作描述"},model:{value:t.formData.description,callback:function(e){t.$set(t.formData,"description",e)},expression:"formData.description"}})],1)],1),a("div",{staticClass:"dialog-footer",attrs:{slot:"footer"},slot:"footer"},[a("el-button",{attrs:{size:"small"},on:{click:t.cancel}},[t._v("取消")]),a("el-button",{attrs:{type:"success",size:"small",plain:""},on:{click:t.reset}},[t._v("重置")]),a("el-button",{attrs:{type:"primary",size:"small"},on:{click:t.updateThing}},[t._v("确定")])],1)],1)},f=[],m=a("0e0b"),v={name:"point-value-edit-form",props:{formData:{type:Object,default:function(){return{}}}},data:function(){return{formRule:{value:[{required:!0,message:"请输入位号值",trigger:"blur"}],description:[{max:300,message:"最多输入300个字符",trigger:"blur"}]},formVisible:!1}},methods:{show:function(){this.formVisible=!0},cancel:function(){this.formVisible=!1},reset:function(){this.$refs["formData"].resetFields()},updateThing:function(){var t=this;this.$refs["formData"].validate((function(e){e&&t.$emit("update-thing",t.formData,(function(){t.cancel(),t.reset(),Object(m["d"])()}))}))}}},h=v,b=(a("b3fa"),a("2877")),_=Object(b["a"])(h,p,f,!1,null,null,null),g=_.exports,y=function(){var t=this,e=t.$createElement,a=t._self._c||e;return a("el-dialog",{staticClass:"things-dialog",attrs:{title:"数据详情",visible:t.detailVisible,"show-close":!1,"append-to-body":!0,"model-append-to-body":!1,"close-on-click-modal":!1,"close-on-press-escape":!1},on:{"update:visible":function(e){t.detailVisible=e}}},[a("pre",{directives:[{name:"highlightjs",rawName:"v-highlightjs"}]},[a("code",{staticClass:"json"},[t._v(t._s(t.detailData))])]),a("div",{staticClass:"dialog-footer",attrs:{slot:"footer"},slot:"footer"},[a("el-button",{attrs:{type:"success",size:"small"},on:{click:t.cancel}},[t._v("关闭")])],1)])},C=[],D={name:"point-value-detail",props:{detailData:{type:Object,default:function(){return{}}}},data:function(){return{detailVisible:!1}},methods:{show:function(){this.detailVisible=!0},cancel:function(){this.detailVisible=!1}}},w=D,j=(a("a714"),Object(b["a"])(w,y,C,!1,null,null,null)),O=j.exports,V=a("aa98"),T=a("e56e"),I=a("7f87"),k=a("8bd7"),x={components:{baseCard:s["a"],detailCard:l["a"],deviceCard:r["a"],profileCard:c["a"],pointCard:d["a"],pointValueCard:u["a"],pointValueEditForm:g,pointValueDetail:O},props:{name:String},data:function(){return{id:this.$route.query.id,active:this.$route.query.active,data:{profileIds:[]},driverDictionary:[],profileDictionary:[],pointDictionary:[],driverTable:{},profileTable:{},pointTable:{},deviceTable:{},statusTable:{},listProfileData:[],listPointData:[],listPointValueData:[],listPointValueHistoryData:{},pointValueFormData:{},pointValueDetailData:{}}},created:function(){this.pointValues(),this.driver(),this.profile(),this.point(),this.device(),this.status(),this.profiles(),this.points()},methods:{device:function(){var t=this;Object(V["c"])(this.id).then((function(e){t.data=e.data,t.deviceTable[t.data.id]=t.data.name}))},profiles:function(){var t=this;Object(I["b"])(this.id).then((function(e){t.listProfileData=e.data}))},points:function(){var t=this;Object(k["b"])(this.id).then((function(e){t.listPointData=e.data}))},pointValues:function(){var t=this;Object(k["i"])(this.id,!0).then((function(e){t.listPointValueData=e.data,e.data.forEach((function(e){"string"===e.type?t.listPointValueHistoryData[e.pointId]=[]:"boolean"===e.type?t.listPointValueHistoryData[e.pointId]=e.children.reverse().map((function(t){return"true"===t.value?1:0})):t.listPointValueHistoryData[e.pointId]=e.children.reverse().map((function(t){return t.value}))}))}))},status:function(){var t=this;Object(V["g"])({id:this.id}).then((function(e){t.statusTable=e.data})).catch((function(){}))},driver:function(){var t=this;Object(T["b"])().then((function(e){t.driverDictionary=e.data,t.driverTable=t.driverDictionary.reduce((function(t,e){return t[e.value]=e.label,t}),{})})).catch((function(){}))},profile:function(){var t=this;Object(T["d"])().then((function(e){t.profileDictionary=e.data,t.profileTable=t.profileDictionary.reduce((function(t,e){return t[e.value]=e.label,t}),{})})).catch((function(){}))},point:function(){var t=this;Object(T["c"])("point").then((function(e){t.pointDictionary=e.data,t.pointTable=t.pointDictionary.reduce((function(t,e){return t[e.value]=e.label,t}),{})})).catch((function(){}))},showPointValueEdit:function(t){this.pointValueFormData={deviceId:t.deviceId,pointId:t.pointId,value:t.value,type:t.type},this.$refs["point-value-edit-form"].show()},showPointValueDetail:function(t){this.pointValueDetailData=t,this.$refs["point-value-detail"].show()},updateThing:function(t){console.log("update things",t)},driverName:function(t){return this.driverTable[t]},profileName:function(t){var e=this;if(t)return t.map((function(t){return e.profileTable[t]})).join(", ")},pointName:function(){var t=this;return this.listPointData.map((function(e){return t.pointTable[e.id]})).join(", ")},changeActive:function(t){var e=this.$route.query;this.$router.push({query:Object(o["a"])(Object(o["a"])({},e),{},{active:t.name})})},copyId:function(t){Object(m["c"])(t,!0,"设备ID")},timestamp:function(t){return Object(m["a"])(new Date(t))}}},$=x,P=(a("cb1a"),Object(b["a"])($,i,n,!1,null,null,null));e["default"]=P.exports},"6efd":function(t,e,a){},"7f87":function(t,e,a){"use strict";a.d(e,"a",(function(){return n})),a.d(e,"d",(function(){return o})),a.d(e,"f",(function(){return s})),a.d(e,"c",(function(){return l})),a.d(e,"b",(function(){return r})),a.d(e,"e",(function(){return c}));var i=a("9179"),n=function(t){return Object(i["a"])({url:"api/v3/manager/profile/add",method:"post",data:t})},o=function(t){return Object(i["a"])({url:"api/v3/manager/profile/delete/"+t,method:"post"})},s=function(t){return Object(i["a"])({url:"api/v3/manager/profile/update",method:"post",data:t})},l=function(t){return Object(i["a"])({url:"api/v3/manager/profile/id/"+t,method:"get"})},r=function(t){return Object(i["a"])({url:"api/v3/manager/profile/device_id/"+t,method:"get"})},c=function(t){return Object(i["a"])({url:"api/v3/manager/profile/list",method:"post",data:t})}},"8bd7":function(t,e,a){"use strict";a.d(e,"a",(function(){return n})),a.d(e,"e",(function(){return o})),a.d(e,"h",(function(){return s})),a.d(e,"c",(function(){return l})),a.d(e,"f",(function(){return r})),a.d(e,"g",(function(){return c})),a.d(e,"d",(function(){return d})),a.d(e,"b",(function(){return u})),a.d(e,"i",(function(){return p})),a.d(e,"j",(function(){return f}));var i=a("9179"),n=function(t){return Object(i["a"])({url:"api/v3/manager/point/add",method:"post",data:t})},o=function(t){return Object(i["a"])({url:"api/v3/manager/point/delete/"+t,method:"post"})},s=function(t){return Object(i["a"])({url:"api/v3/manager/point/update",method:"post",data:t})},l=function(t){return Object(i["a"])({url:"api/v3/manager/point/id/"+t,method:"get"})},r=function(t){return Object(i["a"])({url:"api/v3/manager/point/list",method:"post",data:t})},c=function(t){return Object(i["a"])({url:"api/v3/manager/point/unit",method:"post",data:t})},d=function(t){return Object(i["a"])({url:"api/v3/manager/point/profile_id/"+t,method:"get"})},u=function(t){return Object(i["a"])({url:"api/v3/manager/point/device_id/"+t,method:"get"})},p=function(t,e){return Object(i["a"])({url:"api/v3/data/point_value/latest/device_id/"+t,method:"get",params:{history:e}})},f=function(t){return Object(i["a"])({url:"api/v3/data/point_value/list",method:"post",data:t})}},a714:function(t,e,a){"use strict";a("48b2")},af18:function(t,e,a){"use strict";var i=function(){var t=this,e=t.$createElement,a=t._self._c||e;return a("div",{staticClass:"detail-card"},[a("el-card",{attrs:{shadow:"hover"}},[t._t("default")],2)],1)},n=[],o={name:"detail-card"},s=o,l=(a("4263"),a("2877")),r=Object(l["a"])(s,i,n,!1,null,null,null);e["a"]=r.exports},b12e:function(t,e,a){},b3fa:function(t,e,a){"use strict";a("6efd")},cb1a:function(t,e,a){"use strict";a("08ad")},f8cf:function(t,e,a){"use strict";var i=function(){var t=this,e=t.$createElement,a=t._self._c||e;return a("div",{staticClass:"things-card"},[a("el-card",{attrs:{shadow:"hover"}},[a("div",{staticClass:"things-card-content"},[a("div",{staticClass:"things-card__header",class:{"header-enable":t.data.enable,"header-disable":!t.data.enable}},[a("div",{staticClass:"things-card-header-icon"},[a("img",{attrs:{src:t.icon,alt:t.data.name}})]),a("div",{staticClass:"things-card-header-name nowrap-name",on:{click:function(e){return t.copyId(t.data.id)}}},[t._v(t._s(t.data.name))]),a("div",{staticClass:"things-card-header-status",attrs:{title:"状态"}})]),a("div",{staticClass:"things-card__body"},[a("div",{staticClass:"things-card-body-content"},[a("ul",[a("li",{staticClass:"nowrap-item"},[a("span",[a("i",{staticClass:"el-icon-ice-cream-square"}),t._v(" 位号个数: ")]),t._v(t._s(t.data.pointIds.length||0))]),a("li",{staticClass:"nowrap-item"},[a("span",[a("i",{staticClass:"el-icon-collection-tag"}),t._v(" 位号: ")]),t._v(t._s(t.point(t.data.pointIds)))]),a("li",{staticClass:"nowrap-item"},[a("span",[a("i",{staticClass:"el-icon-edit-outline"}),t._v(" 修改日期: ")]),t._v(t._s(t.timestamp(t.data.updateTime)))]),a("li",{staticClass:"nowrap-item"},[a("span",[a("i",{staticClass:"el-icon-sunset"}),t._v(" 创建日期: ")]),t._v(t._s(t.timestamp(t.data.createTime)))])])]),a("div",{staticClass:"things-card-body-content",attrs:{title:"模板描述信息"}},[a("p",{staticClass:"nowrap-description"},[t._v(t._s(t.data.description?t.data.description:"无描述信息"))])])]),t.embedded?t._e():a("div",{staticClass:"things-card__footer"},[a("div",{staticClass:"things-card-footer-operation"},[a("el-popconfirm",{attrs:{title:"是否确定停用该模板？",placement:"top",icon:"el-icon-remove-outline"}},[a("el-button",{staticClass:"operation-tooltip",attrs:{slot:"reference",type:"text",disabled:!t.data.enable},slot:"reference"},[t._v("停用")])],1),a("el-popconfirm",{attrs:{title:"是否确定启用该模板？",placement:"top",icon:"el-icon-remove-outline"}},[a("el-button",{staticClass:"operation-tooltip",attrs:{slot:"reference",type:"text",disabled:t.data.enable},slot:"reference"},[t._v("启用")])],1),a("el-popconfirm",{attrs:{title:"是否确定删除该模板？",placement:"top",icon:"el-icon-circle-close","icon-color":"red"},on:{confirm:function(e){return t.deleteThing(t.data.id)}}},[a("el-button",{staticClass:"operation-tooltip",attrs:{slot:"reference",type:"text"},slot:"reference"},[t._v("删除")])],1),a("el-button",{attrs:{type:"text"},on:{click:function(e){return t.edit(t.data.id)}}},[t._v("编辑")]),a("el-button",{attrs:{type:"text"},on:{click:function(e){return t.detail(t.data.id)}}},[t._v("详情")])],1)])])])],1)},n=[],o=(a("fb6a"),a("a15b"),a("d81d"),a("0e0b")),s={name:"profile-card",props:{embedded:{type:Boolean,default:function(){return!1}},pointTable:{type:Object,default:function(){return{}}},data:{type:Object,default:function(){return{name:"",enable:"",description:"",createTime:"",updateTime:""}}},icon:{type:String,default:"images/common/profile.png"}},methods:{point:function(t){var e=this;if(t)return t.length>10&&(t=t.slice(0,10)),t.map((function(t){return e.pointTable[t]})).join(", ")},deleteThing:function(t){this.$emit("delete-thing",t,(function(){Object(o["d"])()}))},edit:function(t){this.$router.push({name:"profileEdit",query:{id:t,active:"0"}})},detail:function(t){this.$router.push({name:"profileDetail",query:{id:t,active:"detail"}})},copyId:function(t){Object(o["c"])(t,!0,"模板ID")},timestamp:function(t){return Object(o["a"])(new Date(t))}}},l=s,r=(a("58a3"),a("2877")),c=Object(r["a"])(l,i,n,!1,null,null,null);e["a"]=c.exports},fec2:function(t,e,a){}}]);