chunk-0e58d070.301f48df.js 13 KB

1
  1. (window["webpackJsonp"]=window["webpackJsonp"]||[]).push([["chunk-0e58d070"],{"68e9":function(e,t,a){},"7b4e":function(e,t,a){"use strict";a("68e9")},b15f:function(e,t,a){"use strict";a.d(t,"b",(function(){return n})),a.d(t,"e",(function(){return i})),a.d(t,"a",(function(){return r})),a.d(t,"d",(function(){return s})),a.d(t,"c",(function(){return l}));var o=a("b775");function n(){return Object(o["a"])({url:"/sis/onvif/discover",method:"get"})}function i(e){return Object(o["a"])({url:"/sis/onvif/camera/testAndSave",method:"post",data:e})}function r(e){return Object(o["a"])({url:"/sis/onvif/ptz/control",method:"post",data:e})}function s(e){return Object(o["a"])({url:"/sis/onvif/osd/set",method:"post",data:e})}function l(e){return Object(o["a"])({url:"/sis/onvif/osd/get",method:"get",params:e})}},b1d7:function(e,t,a){"use strict";a.d(t,"b",(function(){return n})),a.d(t,"e",(function(){return i})),a.d(t,"d",(function(){return r})),a.d(t,"c",(function(){return s})),a.d(t,"a",(function(){return l})),a.d(t,"f",(function(){return d}));var o=a("b775");function n(e){return Object(o["a"])({url:"/sis/camera/selectSisCameraListPage",method:"get",params:e})}function i(e){return Object(o["a"])({url:"/hikvision/network",method:"post",data:e})}function r(e){return Object(o["a"])({url:"/hikvision/encode",method:"post",data:e})}function s(e){return Object(o["a"])({url:"/hikvision/reboot",method:"post",data:e})}function l(e){return Object(o["a"])({url:"/hikvision/encode",method:"get",params:e})}function d(e){return Object(o["a"])({url:"/hikvision/shutdown",method:"post",data:e})}},f86a:function(e,t,a){"use strict";a.r(t);var o=function(){var e=this,t=e.$createElement,a=e._self._c||t;return a("div",{staticClass:"app-container"},[a("el-form",{directives:[{name:"show",rawName:"v-show",value:e.showSearch,expression:"showSearch"}],ref:"queryForm",attrs:{model:e.queryParams,size:"small",inline:!0}},[a("el-form-item",{attrs:{label:"摄像头名称",prop:"cameraName"}},[a("el-input",{attrs:{placeholder:"请输入摄像头名称",clearable:""},model:{value:e.queryParams.cameraName,callback:function(t){e.$set(e.queryParams,"cameraName",t)},expression:"queryParams.cameraName"}})],1),a("el-form-item",[a("el-button",{attrs:{type:"primary",icon:"el-icon-search",size:"mini"},on:{click:e.handleQuery}},[e._v("搜索")]),a("el-button",{attrs:{icon:"el-icon-refresh",size:"mini"},on:{click:e.resetQuery}},[e._v("重置")])],1)],1),a("el-table",{directives:[{name:"loading",rawName:"v-loading",value:e.loading,expression:"loading"}],attrs:{data:e.cameraList}},[a("el-table-column",{attrs:{label:"序号",align:"center",type:"index",width:"50"}}),a("el-table-column",{attrs:{label:"摄像头名称",align:"center",prop:"cameraName"}}),a("el-table-column",{attrs:{label:"IP地址",align:"center",prop:"ip"}}),a("el-table-column",{attrs:{label:"设备状态",align:"center",prop:"onlinePresence"},scopedSlots:e._u([{key:"default",fn:function(t){return[a("dict-tag",{attrs:{options:e.dict.type.sys_online_offline,value:t.row.onlinePresence}})]}}])}),a("el-table-column",{attrs:{fixed:"right",label:"操作",align:"center",width:"180px"},scopedSlots:e._u([{key:"default",fn:function(t){return[a("el-button",{attrs:{size:"mini",type:"text",icon:"el-icon-edit"},on:{click:function(a){return e.openOsdDialog(t.row)}}},[e._v("OSD配置")])]}}])})],1),a("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}}),a("el-dialog",{attrs:{title:"OSD参数配置",visible:e.osdDialogVisible,width:"1200px","append-to-body":""},on:{"update:visible":function(t){e.osdDialogVisible=t}}},[a("el-row",{attrs:{gutter:20}},[a("el-col",{attrs:{span:12}},[a("div",{staticClass:"preview-box"},[a("label",{staticClass:"preview-label"},[e._v("OSD 预览 (元素可拖拽)")]),a("div",{ref:"osdScreen",staticClass:"osd-screen-preview"},e._l(e.osdVisualElements,(function(t){return a("div",{directives:[{name:"show",rawName:"v-show",value:t.enabled,expression:"item.enabled"},{name:"drag",rawName:"v-drag",value:t,expression:"item"}],key:t.id,staticClass:"osd-element",style:e.getElementStyle(t)},[e._v(" "+e._s(t.text)+" ")])})),0)])]),a("el-col",{attrs:{span:12}},[a("el-form",{ref:"osdForm",attrs:{model:e.osdForm,"label-width":"120px"}},[a("el-tabs",{model:{value:e.activeTab,callback:function(t){e.activeTab=t},expression:"activeTab"}},[a("el-tab-pane",{attrs:{label:"基本显示",name:"basic"}},[a("el-form-item",{attrs:{label:"通道名称"}},[a("el-switch",{staticStyle:{"margin-right":"20px"},model:{value:e.osdForm.channelName.enabled,callback:function(t){e.$set(e.osdForm.channelName,"enabled",t)},expression:"osdForm.channelName.enabled"}}),a("el-input",{staticStyle:{width:"250px"},attrs:{placeholder:"请输入通道名称",disabled:!e.osdForm.channelName.enabled},model:{value:e.osdForm.channelName.text,callback:function(t){e.$set(e.osdForm.channelName,"text",t)},expression:"osdForm.channelName.text"}})],1),a("el-divider"),a("el-form-item",{attrs:{label:"日期时间"}},[a("el-switch",{model:{value:e.osdForm.dateTime.enabled,callback:function(t){e.$set(e.osdForm.dateTime,"enabled",t)},expression:"osdForm.dateTime.enabled"}})],1),a("el-form-item",{attrs:{label:"时间格式",prop:"dateTime.timeMode",disabled:!e.osdForm.dateTime.enabled}},[a("el-select",{attrs:{placeholder:"请选择"},model:{value:e.osdForm.dateTime.timeMode,callback:function(t){e.$set(e.osdForm.dateTime,"timeMode",t)},expression:"osdForm.dateTime.timeMode"}},[a("el-option",{attrs:{label:"24小时",value:2}}),a("el-option",{attrs:{label:"12小时",value:1}})],1)],1),a("el-form-item",{attrs:{label:"日期格式",prop:"dateTime.dateMode",disabled:!e.osdForm.dateTime.enabled}},[a("el-select",{attrs:{placeholder:"请选择"},model:{value:e.osdForm.dateTime.dateMode,callback:function(t){e.$set(e.osdForm.dateTime,"dateMode",t)},expression:"osdForm.dateTime.dateMode"}},[a("el-option",{attrs:{label:"YYYY-MM-DD",value:3}}),a("el-option",{attrs:{label:"MM-DD-YYYY",value:1}}),a("el-option",{attrs:{label:"DD-MM-YYYY",value:2}})],1)],1),a("el-form-item",{attrs:{label:"显示星期",prop:"dateTime.displayWeek",disabled:!e.osdForm.dateTime.enabled}},[a("el-switch",{model:{value:e.osdForm.dateTime.displayWeek,callback:function(t){e.$set(e.osdForm.dateTime,"displayWeek",t)},expression:"osdForm.dateTime.displayWeek"}})],1)],1),a("el-tab-pane",{attrs:{label:"字符叠加",name:"text"}},e._l(e.osdForm.customTexts,(function(t,o){return a("div",{key:t.id},[a("el-form-item",{attrs:{label:"叠加字符 "+(o+1)}},[a("el-switch",{staticStyle:{"margin-right":"20px"},model:{value:t.enabled,callback:function(a){e.$set(t,"enabled",a)},expression:"item.enabled"}}),a("el-input",{staticStyle:{width:"250px"},attrs:{placeholder:"请输入叠加字符 "+(o+1),disabled:!t.enabled},model:{value:t.text,callback:function(a){e.$set(t,"text",a)},expression:"item.text"}})],1)],1)})),0),a("el-tab-pane",{attrs:{label:"OSD属性",name:"style"}},[a("el-form-item",{attrs:{label:"字体大小"}},[a("el-select",{attrs:{placeholder:"请选择"},model:{value:e.osdForm.fontSize,callback:function(t){e.$set(e.osdForm,"fontSize",t)},expression:"osdForm.fontSize"}},[a("el-option",{attrs:{label:"自适应",value:"adaptive"}}),a("el-option",{attrs:{label:"小",value:16}}),a("el-option",{attrs:{label:"中",value:24}}),a("el-option",{attrs:{label:"大",value:32}})],1)],1),a("el-form-item",{attrs:{label:"对齐方式"}},[a("el-select",{attrs:{placeholder:"请选择"},model:{value:e.osdForm.alignment,callback:function(t){e.$set(e.osdForm,"alignment",t)},expression:"osdForm.alignment"}},[a("el-option",{attrs:{label:"自定义",value:"customize"}}),a("el-option",{attrs:{label:"左对齐",value:"left"}}),a("el-option",{attrs:{label:"右对齐",value:"right"}})],1)],1),a("el-form-item",{attrs:{label:"OSD 颜色"}},[a("el-color-picker",{model:{value:e.osdForm.color,callback:function(t){e.$set(e.osdForm,"color",t)},expression:"osdForm.color"}})],1)],1)],1)],1)],1)],1),a("div",{staticClass:"dialog-footer",attrs:{slot:"footer"},slot:"footer"},[a("el-button",{on:{click:function(t){e.osdDialogVisible=!1}}},[e._v("取 消")]),a("el-button",{attrs:{type:"primary"},on:{click:e.submitOsdForm}},[e._v("确 定")])],1)],1)],1)},n=[],i=a("5530"),r=(a("14d9"),a("d3b7"),a("ac1f"),a("5319"),a("159b"),a("b1d7")),s=a("b15f"),l=a("333d"),d={name:"OsdConfig",components:{Pagination:l["a"]},dicts:["sys_online_offline"],directives:{drag:{bind:function(e,t,a){e.onmousedown=function(o){o.preventDefault();var n=t.value,i=a.context,r=i.$refs.osdScreen;if(r){var s=r.getBoundingClientRect();if(0!==s.width&&0!==s.height){var l=e.getBoundingClientRect(),d=o.clientX-l.left,c=o.clientY-l.top;document.onmousemove=function(e){var t=e.clientX-s.left-d,a=e.clientY-s.top-c;t=Math.max(0,Math.min(t,s.width-l.width)),a=Math.max(0,Math.min(a,s.height-l.height));var o=i.osdForm.normalizedScreenWidth||704,r=i.osdForm.normalizedScreenHeight||576;n.data.x=Math.round(t/s.width*o),n.data.y=Math.round(r-a/s.height*r)},document.onmouseup=function(){document.onmousemove=null,document.onmouseup=null}}}}}}},data:function(){return{loading:!0,showSearch:!0,total:0,cameraList:[],currentRow:null,queryParams:{pageNum:1,pageSize:10,cameraName:"",cameraBrand:"Hikvision"},osdDialogVisible:!1,activeTab:"basic",osdForm:{normalizedScreenWidth:704,normalizedScreenHeight:576,fontSize:"adaptive",alignment:"customize",color:"#FFFFFF",channelName:{enabled:!1,text:"",x:0,y:0},dateTime:{enabled:!1,x:0,y:0,timeMode:2,dateMode:3,displayWeek:!1},customTexts:[{id:1,enabled:!1,text:"",x:0,y:0},{id:2,enabled:!1,text:"",x:0,y:0},{id:3,enabled:!1,text:"",x:0,y:0},{id:4,enabled:!1,text:"",x:0,y:0}]}}},computed:{osdVisualElements:function(){var e=[];this.osdForm.normalizedScreenWidth;e.push({id:"channelName",text:this.osdForm.channelName.text||"[通道名称]",enabled:this.osdForm.channelName.enabled,data:this.osdForm.channelName});var t="YYYY-MM-DD HH:MM:SS";return 1===this.osdForm.dateTime.dateMode?t="MM-DD-YYYY":2===this.osdForm.dateTime.dateMode&&(t="DD-MM-YYYY"),1===this.osdForm.dateTime.timeMode&&(t+=" AM/PM"),this.osdForm.dateTime.displayWeek&&(t+=" [星期]"),e.push({id:"dateTime",text:t,enabled:this.osdForm.dateTime.enabled,data:this.osdForm.dateTime}),this.osdForm.customTexts.forEach((function(t,a){e.push({id:"text".concat(t.id),text:t.text||"[叠加字符 ".concat(a+1,"]"),enabled:t.enabled,data:t})})),e}},created:function(){this.getList()},methods:{getList:function(){var e=this;this.loading=!0,this.queryParams.cameraBrand="Hikvision",Object(r["b"])(this.queryParams).then((function(t){e.cameraList=t.rows,e.total=t.total,e.loading=!1})).catch((function(){e.loading=!1}))},handleQuery:function(){this.queryParams.pageNum=1,this.getList()},resetQuery:function(){this.resetForm("queryForm"),this.handleQuery()},getElementStyle:function(e){if(!this.$refs.osdScreen)return{left:"0px",top:"0px"};var t=this.$refs.osdScreen.getBoundingClientRect(),a=this.osdForm.normalizedScreenWidth||704,o=this.osdForm.normalizedScreenHeight||576;if(0===t.width||0===t.height)return{left:"0px",top:"0px"};var n=e.data.x/a*t.width,i=(o-e.data.y)/o*t.height,r=Math.min(i,t.height-18),s=Math.min(n,t.width-50);return{left:"".concat(s,"px"),top:"".concat(r,"px"),color:this.formatColorForPicker(this.osdForm.color)}},formatColorForPicker:function(e){return e?"#"+e.replace("#",""):"#FFFFFF"},openOsdDialog:function(e){var t=this;this.currentRow=e,this.activeTab="basic",this.resetOsdForm(),this.$modal.loading("正在获取当前 OSD 配置...");var a={ip:e.ip,username:e.username,password:e.password,channelId:parseInt(e.chan)};Object(s["c"])(a).then((function(e){if(t.$modal.closeLoading(),200===e.code&&e.data){t.osdForm=e.data,t.osdForm.customTexts||(t.osdForm.customTexts=[]);while(t.osdForm.customTexts.length<4)t.osdForm.customTexts.push({id:t.osdForm.customTexts.length+1,enabled:!1,text:"",x:0,y:0});t.osdDialogVisible=!0,t.$nextTick((function(){t.$refs.osdForm&&t.$refs.osdForm.clearValidate(),t.$forceUpdate()}))}else t.$message.error("获取 OSD 配置失败: "+(e.msg||"设备未返回有效数据"))})).catch((function(e){t.$modal.closeLoading(),t.$message.error("获取 OSD 配置失败: "+(e.message||"请求失败"))}))},resetOsdForm:function(){this.osdForm={normalizedScreenWidth:704,normalizedScreenHeight:576,fontSize:"adaptive",alignment:"customize",color:"#FFFFFF",channelName:{enabled:!1,text:"",x:0,y:0},dateTime:{enabled:!1,x:0,y:0,timeMode:2,dateMode:3,displayWeek:!1},customTexts:[{id:1,enabled:!1,text:"",x:0,y:0},{id:2,enabled:!1,text:"",x:0,y:0},{id:3,enabled:!1,text:"",x:0,y:0},{id:4,enabled:!1,text:"",x:0,y:0}]}},submitOsdForm:function(){var e=this;this.$refs["osdForm"].validate((function(t){if(t){var a=Object(i["a"])({ip:e.currentRow.ip,username:e.currentRow.username,password:e.currentRow.password,channelId:parseInt(e.currentRow.chan)},e.osdForm);e.$modal.loading("正在设置 OSD 参数..."),Object(s["d"])(a).then((function(){e.$modal.closeLoading(),e.$message.success("OSD 参数设置成功!"),e.osdDialogVisible=!1})).catch((function(t){e.$modal.closeLoading(),e.$message.error("OSD 参数设置失败: "+(t.message||"未知错误"))}))}}))}}},c=d,m=(a("7b4e"),a("2877")),u=Object(m["a"])(c,o,n,!1,null,"34364a04",null);t["default"]=u.exports}}]);