Files
starRiverProperty/frontend/canoe-device.bak20231018/js/chunk-commons.68dd08e6.js
T
反编译工作区 0c56a3e599 chore(frontend): add static frontend build artifacts (portal, front_acs, etc.)
Made-with: Cursor

Former-commit-id: 571c9a99ee26d90505e550c287eb8ad8d743ff8d
2026-04-27 13:40:23 +08:00

1 line
25 KiB
JavaScript

(window["webpackJsonp_cwos-general-device"]=window["webpackJsonp_cwos-general-device"]||[]).push([["chunk-commons"],{"2df0":function(e,t,a){"use strict";var i=function(){var e=this,t=e.$createElement,a=e._self._c||t;return a("main",[a("mk-dialog",{ref:"editAreaDialog",staticClass:"editAreaDialog",attrs:{width:"560px",title:"编辑区域",appendToBody:!0}},[a("div",{staticClass:"edit-area-dialog",attrs:{slot:"content"},slot:"content"},[a("el-input",{attrs:{placeholder:"输入关键字进行过滤",maxlength:"40"},model:{value:e.filterText,callback:function(t){e.filterText=t},expression:"filterText"}}),a("el-tree",{ref:"areaTree",attrs:{data:e.treeData,"node-key":"id","default-expanded-keys":e.defaultExpandedKeys,"expand-on-click-node":!0,props:e.treeProps,"filter-node-method":e.filterNode},scopedSlots:e._u([{key:"default",fn:function(t){var i=t.node,r=t.data;return a("div",{staticClass:"custom-tree-node"},[r.edit?a("div",{},[a("el-input",{model:{value:r.label,callback:function(t){e.$set(r,"label",t)},expression:"data.label"}})],1):a("span",{staticClass:"tree-label"},[e._v(e._s(r.name))]),a("span",{staticClass:"button-list"},[[r.level>=0?a("el-button",{attrs:{type:"text"},on:{click:function(t){return e.edit(t,i,r)}}},[a("svg-icon",{attrs:{name:"edit"}})],1):e._e(),a("el-button",{attrs:{type:"text"},on:{click:function(t){return e.append(t,i,r)}}},[a("svg-icon",{attrs:{name:"add"}})],1),r.level>=0?a("el-button",{attrs:{icon:"el-icon-minus",type:"text"},on:{click:function(t){return e.remove(t,i,r)}}}):e._e()]],2)])}}])})],1)]),a("mk-dialog",{ref:"addNodeDialog",staticClass:"addNodeDialog",attrs:{width:"560px",title:e.addNodeDialogTitle,appendToBody:!0}},[a("div",{attrs:{slot:"content"},slot:"content"},[a("el-input",{staticStyle:{width:"100%"},attrs:{placeholder:"请输入节点名称",maxlength:"64"},nativeOn:{keyup:function(t){return!t.type.indexOf("key")&&e._k(t.keyCode,"enter",13,t.key,"Enter")?null:e.submitNodeName(t)}},model:{value:e.newNodeName,callback:function(t){e.newNodeName=t},expression:"newNodeName"}})],1),a("div",{attrs:{slot:"footer"},slot:"footer"},[a("el-button",{on:{click:e.closeSubmitDialog}},[e._v("取消")]),a("el-button",{attrs:{type:"primary",loading:e.submitNodeNameLoding},on:{click:e.submitNodeName}},[e._v("确定")])],1)])],1)},r=[],n=(a("a4d3"),a("99af"),a("4de4"),a("c740"),a("4160"),a("c975"),a("a434"),a("b0c0"),a("e439"),a("dbb4"),a("b64b"),a("d3b7"),a("159b"),a("ade3")),s=a("d4ec"),o=a("bee2"),c=a("99de"),l=a("7e84"),d=a("262e"),p=a("9ab4"),m=a("60a3"),u=a("e33d");function f(e,t){var a=Object.keys(e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);t&&(i=i.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),a.push.apply(a,i)}return a}function v(e){for(var t=1;t<arguments.length;t++){var a=null!=arguments[t]?arguments[t]:{};t%2?f(Object(a),!0).forEach((function(t){Object(n["a"])(e,t,a[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(a)):f(Object(a)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(a,t))}))}return e}var h=function(e){function t(){var e;return Object(s["a"])(this,t),e=Object(c["a"])(this,Object(l["a"])(t).apply(this,arguments)),e.treeProps={id:"id",businessId:"businessId",code:"code",name:"name",orderBy:"orderBy",parentId:"parentId",level:"level",children:"children"},e.treeData=[{id:"",name:"区域列表",parentId:"",level:-1,children:[]}],e.operateType="",e.addNodeDialogTitle="",e.filterText="",e.currentArea={},e.currentNode={},e.newNodeName="",e.submitNodeNameLoding=!1,e.defaultExpandedKeys=[],e}return Object(d["a"])(t,e),Object(o["a"])(t,[{key:"filterText_listener",value:function(e){this.$refs.areaTree.filter(e)}},{key:"filterNode",value:function(e,t){return!e||-1!==t.name.indexOf(e)}},{key:"append",value:function(e,t,a){e.stopPropagation(),this.operateType="add",this.currentNode=t,this.addNodeDialogTitle="新增节点",this.currentArea=a,this.newNodeName="",this.$refs.addNodeDialog.open()}},{key:"submitNodeName",value:function(){var e=this;if(this.submitNodeNameLoding=!0,Object(u["ValidSpaceWarp"])(this.newNodeName))return this.submitNodeNameLoding=!1,void this.$message.warning("请输入节点名称!");var t={},a=null;"edit"===this.operateType?(t={id:this.currentArea.id,name:this.newNodeName},a=this.service.updateDeviceAreaInfo(v({},t))):"add"===this.operateType&&(t={parentId:this.currentArea.id,name:this.newNodeName,level:this.currentArea.level+1,districtId:this.districtId},a=this.service.postAddDeviceArea(t)),a.then((function(t){t.success?(e.submitNodeNameLoding=!1,e.$message.success("操作成功!"),e.$refs.addNodeDialog.close(),"edit"===e.operateType?e.currentArea.name=e.newNodeName:(e.currentArea.children||e.$set(e.currentArea,"children",[]),e.defaultExpandedKeys=[].concat(e.currentNode.key),e.currentArea.children.push(t.data)),e.$nextTick((function(){e.$emit("change",e.treeData)}))):e.$message.error(t.message)}))}},{key:"closeSubmitDialog",value:function(){this.$refs.addNodeDialog.close()}},{key:"remove",value:function(e,t,a){var i=this;e.stopPropagation(),this.currentArea=a,this.$confirm("确定删除么?","提示",{confirmButtonText:"确定",cancelButtonText:"取消",type:"warning"}).then((function(){i.service.deleteDeviceArea({id:i.currentArea.id}).then((function(e){if(e.success){i.$message.success("操作成功!");var r=t.parent,n=r.data.children||r.data,s=n.findIndex((function(e){return e.id===a.id}));n.splice(s,1),i.$nextTick((function(){i.$emit("change",i.treeData)}))}else i.$message.error(e.message)}))})).catch((function(){}))}},{key:"edit",value:function(e,t,a){e.stopPropagation(),this.currentArea=a,this.currentNode=t,this.newNodeName=a.name,this.operateType="edit",this.$refs.addNodeDialog.open(),this.addNodeDialogTitle="编辑节点"}},{key:"getLocationAllTree",value:function(){var e=this;this.service.getDeviceAreaAllTree({districtId:this.districtId}).then((function(t){t.success?(e.$set(e.treeData[0],"children",t.data),e.$forceUpdate()):e.$message.error(t.message)}))}},{key:"open",value:function(){var e=this;return new Promise((function(t){e.getLocationAllTree(),e.resetEdit(),e.$refs.editAreaDialog.open()}))}},{key:"close",value:function(){var e=this;return new Promise((function(t){e.resetEdit(),e.$refs.editAreaDialog.close()}))}},{key:"resetEdit",value:function(){var e=function e(t){(t.children||[]).forEach((function(t){t.edit=!1,e(t)}))};this.treeData.forEach((function(t){t.edit=!1,e(t)}))}},{key:"created",value:function(){}},{key:"mounted",value:function(){}}]),t}(m["d"]);p["a"]([Object(m["c"])({type:String,default:function(){}})],h.prototype,"districtId",void 0),p["a"]([Object(m["e"])("filterText")],h.prototype,"filterText_listener",null),h=p["a"]([Object(m["a"])({})],h);var g=h,y=g,b=(a("f052"),a("2877")),w=Object(b["a"])(y,i,r,!1,null,null,null);t["a"]=w.exports},"2ecc":function(e,t,a){},"313f":function(e,t,a){"use strict";var i=function(){var e=this,t=e.$createElement,a=e._self._c||t;return a("div",{staticClass:"device-area-container"},[a("Treeselect",{staticClass:"width-320",style:e.disabled?"cursor:not-allowed":"",attrs:{clearable:!0,searchable:!0,"open-on-click":!0,"clear-on-select":!0,"close-on-select":!0,limit:3,"max-height":200,options:e.areaOptions,normalizer:e.treeSelectNormalizer,placeholder:"请选择",noResultsText:"无数据",noOptionsText:"无数据",disabled:e.disabled},on:{input:e.areaIdChange},scopedSlots:e._u([{key:"value-label",fn:function(t){t.node;return a("span",{style:e.disabled?"color: #c0c4cc":""},[e._v(e._s(e.getLabel(e.areaOptions,e.areaId)))])}}]),model:{value:e.areaId,callback:function(t){e.areaId=t},expression:"areaId"}}),a("el-button",{attrs:{type:"text",disabled:e.disabled},on:{click:e.editDeviceAreaClick}},[e._v("编辑设备区域")]),a("device-area-dialog",{ref:"editAreaDialog",on:{change:e.getLocationAllTree}})],1)},r=[],n=(a("99af"),a("4160"),a("a15b"),a("b0c0"),a("159b"),a("d4ec")),s=a("bee2"),o=a("99de"),c=a("7e84"),l=a("262e"),d=a("9ab4"),p=a("60a3"),m=a("2df0"),u=a("ca17"),f=a.n(u),v=function(e){function t(){var e;return Object(n["a"])(this,t),e=Object(o["a"])(this,Object(c["a"])(t).apply(this,arguments)),e.areaId=null,e.areaOptions=[],e}return Object(l["a"])(t,e),Object(s["a"])(t,[{key:"created",value:function(){this.getLocationAllTree()}},{key:"mounted",value:function(){this.areaId=this.value||""}},{key:"treeSelectNormalizer",value:function(e){return{id:e.id,label:e.name,children:e.children}}},{key:"areaIdChange",value:function(e){this.$emit("input",e)}},{key:"editDeviceAreaClick",value:function(){var e=window.__POWERED_BY_QIANKUN__;e?window.history.pushState({},"","/sub-sysetting-front#/deviceArea/list"):(window.history.pushState({},"","/sysetting-front#/deviceArea/list"),location.reload())}},{key:"getLocationAllTree",value:function(){var e=this;this.service.getDeviceAreaTree().then((function(t){if(t.success){var a=t.data||[],i=function e(t){(t.children||[]).forEach((function(t){t.children||delete t.children,e(t)}))};a.forEach((function(e){e.children||delete e.children,i(e)})),e.areaOptions=a,e.$forceUpdate()}else e.$message.error(t.message)}))}},{key:"getLabel",value:function(e,t){if(t){var a=this.getParentId(e,t);return a&&a.length?a.reverse().join("-"):""}}},{key:"getParentId",value:function(e,t){for(var a in e){if(e[a].id==t)return[e[a].name];if(e[a].children){var i=this.getParentId(e[a].children,t);if(void 0!==i)return i.concat(e[a].name)}}}}]),t}(p["d"]);d["a"]([Object(p["c"])({})],v.prototype,"value",void 0),d["a"]([Object(p["c"])({default:!1})],v.prototype,"disabled",void 0),v=d["a"]([Object(p["a"])({components:{DeviceAreaDialog:m["a"],Treeselect:f.a}})],v);var h=v,g=h,y=(a("ac7a"),a("2877")),b=Object(y["a"])(g,i,r,!1,null,"d0af2e48",null);t["a"]=b.exports},"876c":function(e,t,a){e.exports={elInputWidth:"200px",elInputNumberWidth:"200px",elTextareaWidth:"300px",elSelectWidth:"200px",appHeaderBg:"#014051",appIconBg:"#6758f3",appIconColor:"#fff",appIconSize:"30px",appNameColor:"#fff",appNameSize:"30px"}},ac7a:function(e,t,a){"use strict";var i=a("2ecc"),r=a.n(i);r.a},c64a:function(e,t,a){"use strict";var i=a("d070"),r=a.n(i);r.a},c70e:function(e,t,a){"use strict";var i=function(){var e=this,t=e.$createElement,a=e._self._c||t;return a("div",{staticStyle:{width:"1200px"}},[a("el-form",{ref:"deviceBasicInfoForm",attrs:{rules:e.formRules,model:e.formData,"label-width":e.labelWidth,inline:""}},[a("el-form-item",{attrs:{label:"设备名称",prop:"deviceName"}},[!e.isPreview||e.isPreview&&e.isEditing?a("el-input",{staticClass:"width-320",attrs:{maxlength:"40",placeholder:"请输入"},model:{value:e.formData.deviceName,callback:function(t){e.$set(e.formData,"deviceName","string"===typeof t?t.trim():t)},expression:"formData.deviceName"}}):[a("div",{staticClass:"width-320 content"},[e._v(" "+e._s(e.formData.deviceName)+" ")])]],2),a("el-form-item",{attrs:{label:"设备类型",prop:"typeIdTree"}},[e.deviceTypeOptions.length?a("el-cascader",{directives:[{name:"show",rawName:"v-show",value:!e.isPreview,expression:"!isPreview"}],staticClass:"width-320",attrs:{options:e.deviceTypeOptions,clearable:"",filterable:"",props:{label:"name",value:"id"},placeholder:"请选择"},on:{change:e.deviceTypeChange},model:{value:e.formData.typeIdTree,callback:function(t){e.$set(e.formData,"typeIdTree",t)},expression:"formData.typeIdTree"}}):e._e(),e.isPreview?a("div",{staticClass:"width-320 width-320 content"},[e._v(" "+e._s(e.formData.deviceTypeName)+" ")]):e._e()],1),a("el-form-item",{attrs:{label:"设备编号",prop:"deviceCode"}},[e.isPreview?e._e():a("el-input",{staticClass:"width-320",attrs:{maxlength:"32",placeholder:"ga1400"===e.deviceType?"请填写视图库对应的设备编号":"设备的序列号,打开设备在设备信息中可见"},model:{value:e.formData.deviceCode,callback:function(t){e.$set(e.formData,"deviceCode","string"===typeof t?t.trim():t)},expression:"formData.deviceCode"}}),e.isPreview?a("div",{staticClass:"width-320 content"},[e._v(" "+e._s(e.formData.deviceCode)+" ")]):e._e()],1),"rtsp"!==e.deviceType?[a("el-form-item",{attrs:{prop:"cameraUserName",label:"ga1400"===e.deviceType?"视图库用户名":"用户名",rules:"ga1400"===e.deviceType?e.usernameRequiredRule:[]}},[!e.isPreview||e.isPreview&&e.isEditing?a("el-input",{staticClass:"width-320",attrs:{maxlength:"32",placeholder:"请输入"},model:{value:e.formData.cameraUserName,callback:function(t){e.$set(e.formData,"cameraUserName","string"===typeof t?t.trim():t)},expression:"formData.cameraUserName"}}):[a("div",{staticClass:"width-320 content"},[e._v(" "+e._s(e.formData.cameraUserName)+" ")])]],2),a("el-form-item",{attrs:{prop:"cameraPassword",label:"ga1400"===e.deviceType?"视图库密码":"密码",rules:"ga1400"===e.deviceType?e.passwordRequiredRule:[]}},[!e.isPreview||e.isPreview&&e.isEditing?a("el-input",{staticClass:"width-320",attrs:{type:"password",maxlength:"32",placeholder:"请输入"},model:{value:e.formData.cameraPassword,callback:function(t){e.$set(e.formData,"cameraPassword",t)},expression:"formData.cameraPassword"}}):[a("div",{staticClass:"width-320 content"},[e._v(" "+e._s(e.password)+" ")])]],2),a("el-form-item",{attrs:{label:"IP",prop:"cameraIp",rules:e.isIpRequired?e.ipRequiredRule:e.ipRule}},[!e.isPreview||e.isPreview&&e.isEditing?a("el-input",{staticClass:"width-320",attrs:{maxlength:"40",placeholder:"请输入"},model:{value:e.formData.cameraIp,callback:function(t){e.$set(e.formData,"cameraIp","string"===typeof t?t.trim():t)},expression:"formData.cameraIp"}}):[a("div",{staticClass:"width-320 content"},[e._v(" "+e._s(e.formData.cameraIp)+" ")])]],2),a("el-form-item",{attrs:{label:"端口",prop:"cameraControlPort"}},[!e.isPreview||e.isPreview&&e.isEditing?a("el-input",{staticClass:"width-320",attrs:{maxlength:"5",placeholder:"请输入"},model:{value:e.formData.cameraControlPort,callback:function(t){e.$set(e.formData,"cameraControlPort","string"===typeof t?t.trim():t)},expression:"formData.cameraControlPort"}}):[a("div",{staticClass:"width-320 content"},[e._v(" "+e._s(e.formData.cameraControlPort)+" ")])]],2),e.isThirdPartyMachine?a("el-form-item",{attrs:{label:"第三方网关",prop:"parentCode"}},[!e.isPreview||e.isPreview&&e.isEditing?a("el-select",{staticClass:"width-320",attrs:{placeholder:"请选择"},model:{value:e.formData.parentCode,callback:function(t){e.$set(e.formData,"parentCode",t)},expression:"formData.parentCode"}},e._l(e.thirdNetOptions,(function(e){return a("el-option",{key:e.value,attrs:{label:e.label,value:e.value}})})),1):[a("div",{staticClass:"width-320 content"},[e._v(" "+e._s(e.formData.parentCode)+" ")])]],2):e._e(),a("el-form-item",{ref:"identify",attrs:{label:"识别类型",prop:"identifyType"}},[!e.isPreview||e.isPreview&&e.isEditing&&"ga1400"!==e.deviceType&&"dcs"!==e.deviceType?a("el-radio-group",{attrs:{disabled:"ga1400"===e.deviceType||"dcs"===e.deviceType},model:{value:e.formData.identifyType,callback:function(t){e.$set(e.formData,"identifyType",t)},expression:"formData.identifyType"}},[a("el-radio",{attrs:{label:0}},[e._v("前端识别")]),a("el-radio",{attrs:{label:1}},[e._v("后端识别")])],1):[a("div",{staticClass:"width-320 content"},[e._v(" "+e._s(0===e.formData.identifyType?"前端识别":"后端识别")+" ")])]],2)]:e._e(),"nvr"===e.deviceType?[a("el-form-item",{attrs:{label:"起始通道号",prop:"beginChannel"}},[e.isPreview?e._e():a("el-input",{staticClass:"width-320",attrs:{placeholder:"请输入"},model:{value:e.formData.beginChannel,callback:function(t){e.$set(e.formData,"beginChannel","string"===typeof t?t.trim():t)},expression:"formData.beginChannel"}}),e.isPreview?a("div",{staticClass:"width-320 content"},[e._v(" "+e._s(e.formData.beginChannel)+" ")]):e._e()],1),a("el-form-item",{attrs:{label:"通道数",prop:"channelCount"}},[e.isPreview?e._e():a("el-input",{staticClass:"width-320",attrs:{placeholder:"请输入"},model:{value:e.formData.channelCount,callback:function(t){e.$set(e.formData,"channelCount","string"===typeof t?t.trim():t)},expression:"formData.channelCount"}}),e.isPreview?a("div",{staticClass:"width-320 content"},[e._v(" "+e._s(e.formData.channelCount)+" ")]):e._e()],1)]:e._e(),"rtsp"===e.deviceType?a("div",{key:"cameraMainRtspUrl",staticClass:"inline-form-item"},[a("el-form-item",{attrs:{label:"rtsp流地址",prop:"cameraMainRtspUrl",rules:e.rtspRequiredRule}},[!e.isPreview||e.isPreview&&e.isEditing?a("el-input",{staticClass:"width-320",attrs:{maxlength:"255",placeholder:"请确认相机支持RTSP标准协议,输入RTSP流地址"},model:{value:e.formData.cameraMainRtspUrl,callback:function(t){e.$set(e.formData,"cameraMainRtspUrl","string"===typeof t?t.trim():t)},expression:"formData.cameraMainRtspUrl"}}):[a("div",{staticClass:"width-320 content"},[e._v(" "+e._s(e.formData.cameraMainRtspUrl)+" ")])]],2)],1):e._e(),"capture"===e.deviceType?a("div",[a("el-form-item",{attrs:{label:"视频流模式",prop:"cameraMode"}},[a("div",{staticClass:"capture-mode-container"},[a("el-form-item",{attrs:{label:"接入模式",prop:"protocol",inline:"","label-width":"100px"}},[!e.isPreview||e.isPreview&&e.isEditing?a("el-select",{staticClass:"width-320",model:{value:e.formData.protocol,callback:function(t){e.$set(e.formData,"protocol",t)},expression:"formData.protocol"}},[a("el-option",{attrs:{value:"onvif",label:"通用协议/标准onvif流相机"}}),a("el-option",{attrs:{value:"rtsp",label:"通用协议/标准rtsp流相机"}})],1):[a("div",{staticClass:"content",staticStyle:{"margin-right":"20px"}},[e._v(" "+e._s(e.formData.protocol)+" ")])]],2),"onvif"===e.formData.protocol?[a("el-form-item",{attrs:{label:"ONVIF账号",prop:"cameraOnvifUsername",inline:"","label-width":"100px"}},[!e.isPreview||e.isPreview&&e.isEditing?a("el-input",{staticClass:"width-320",attrs:{maxlength:"255",placeholder:"请输入onvif协议账号"},model:{value:e.formData.cameraOnvifUsername,callback:function(t){e.$set(e.formData,"cameraOnvifUsername","string"===typeof t?t.trim():t)},expression:"formData.cameraOnvifUsername"}}):[a("div",{staticClass:"content",staticStyle:{"margin-right":"20px"}},[e._v(" "+e._s(e.formData.cameraOnvifUsername)+" ")])]],2),a("el-form-item",{attrs:{label:"ONVIF密码",prop:"cameraOnvifPassword",inline:"","label-width":"100px"}},[!e.isPreview||e.isPreview&&e.isEditing?a("el-input",{staticClass:"width-320",attrs:{maxlength:"255",placeholder:"请输入onvif协议密码"},model:{value:e.formData.cameraOnvifPassword,callback:function(t){e.$set(e.formData,"cameraOnvifPassword",t)},expression:"formData.cameraOnvifPassword"}}):[a("div",{staticClass:"content",staticStyle:{"margin-right":"20px"}},[e._v(" "+e._s(e.formData.cameraOnvifUsername)+" ")])]],2),a("el-form-item",{attrs:{label:"端口",prop:"cameraOnvifPort",inline:"","label-width":"100px"}},[!e.isPreview||e.isPreview&&e.isEditing?a("el-input",{staticClass:"width-320",attrs:{maxlength:"255",placeholder:"请输入onvif协议端口"},model:{value:e.formData.cameraOnvifPort,callback:function(t){e.$set(e.formData,"cameraOnvifPort","string"===typeof t?t.trim():t)},expression:"formData.cameraOnvifPort"}}):[a("div",{staticClass:"content",staticStyle:{"margin-right":"20px"}},[e._v(" "+e._s(e.formData.cameraOnvifPort)+" ")])]],2)]:e._e(),"rtsp"===e.formData.protocol?a("el-form-item",{attrs:{label:"rtsp流地址",prop:"cameraMainRtspUrl",inline:"","label-width":"100px",rules:e.rtspRule}},[!e.isPreview||e.isPreview&&e.isEditing?a("el-input",{staticClass:"width-320",attrs:{maxlength:"255",placeholder:"请输入RTSP流地址"},model:{value:e.formData.cameraMainRtspUrl,callback:function(t){e.$set(e.formData,"cameraMainRtspUrl","string"===typeof t?t.trim():t)},expression:"formData.cameraMainRtspUrl"}}):[a("div",{staticClass:"width-320 content"},[e._v(" "+e._s(e.formData.cameraMainRtspUrl)+" ")])]],2):e._e()],2)])],1):e._e()],2)],1)},r=[],n=(a("4160"),a("a15b"),a("d3b7"),a("ac1f"),a("5319"),a("1276"),a("159b"),a("d4ec")),s=a("bee2"),o=a("99de"),c=a("7e84"),l=a("262e"),d=a("9ab4"),p=a("60a3"),m=a("e33d"),u=a("313f"),f=function(e){function t(){var e;return Object(n["a"])(this,t),e=Object(o["a"])(this,Object(c["a"])(t).apply(this,arguments)),e.formData={deviceName:"",deviceTypeId:"",typeIdTree:[],deviceCode:"",deviceTypeName:"",identifyType:1,parentCode:"",cameraUserName:"",cameraPassword:"",cameraIp:"",cameraControlPort:"",cameraMainRtspUrl:"",beginChannel:"",channelCount:"",protocol:"",cameraOnvifUsername:"",cameraOnvifPassword:""},e.deviceBasicInfo={},e.deviceType="",e.isThirdPartyMachine=!1,e.deviceTypeOptions=[],e.areaOptions=[],e.thirdNetOptions=[],e.formRules={deviceName:[{required:!0,message:"请填写设备名称",trigger:"blur"}],deviceCode:[{required:!0,message:"请填写设备编号",trigger:"blur"},{pattern:/^[A-Za-z0-9]+$/g,message:"设备编号仅限英文字母和数字",trigger:"change"}],typeIdTree:[{required:!0,message:"请选择设备类型",trigger:"input"}],cameraControlPort:[{pattern:m["ValidIPPortReg"],message:"请检查端口号",trigger:"change"}],cameraOnvifPort:[{pattern:m["ValidIPPortReg"],message:"请检查端口号",trigger:"change"}],parentCode:[{required:!0,message:"请选择第三方网关",trigger:"input"}],identifyType:[{required:!0,message:"请选择识别类型",trigger:"change"}],beginChannel:[{required:!0,message:"请填写起始通道号",trigger:"blur"},{pattern:/^([1-9]\d?|100)$/,message:"请填写1-100内的数字"}],channelCount:[{required:!0,message:"请填写通道数",trigger:"blur"},{pattern:/^([1-9]\d?|100)$/,message:"请填写1-100内的数字"}]},e.ipRequiredRule=[{required:!0,message:"请输入IP地址",trigger:"blur"},{trigger:"blur",pattern:m["ValidIPReg"],message:"请检查IP地址"}],e.ipRule=[{trigger:"blur",pattern:m["ValidIPReg"],message:"请检查IP地址"}],e.usernameRequiredRule=[{required:!0,message:"请输入视图库用户名",trigger:"blur"}],e.passwordRequiredRule=[{required:!0,message:"请输入视图库密码",trigger:"blur"}],e.rtspRequiredRule=[{required:!0,message:"请输入rtsp流地址",trigger:"blur"},{pattern:m["rtspReg"],message:"请检查rtsp流地址"}],e.rtspRule=[{pattern:m["rtspReg"],message:"请检查rtsp流地址"}],e}return Object(l["a"])(t,e),Object(s["a"])(t,[{key:"created",value:function(){}},{key:"mounted",value:function(){var e=this;this.data?(this.formData=Object.assign({},this.data),this.data.fromDcm&&(this.formData.typeIdTree=this.data.typeIdTree&&this.data.typeIdTree.split(",")||[]),this.formData.cameraOnvifPassword=this.data.onvifPassword,this.formData.cameraOnvifUsername=this.data.onvifUsername,this.getDevcieTypeTreeByVendor().then((function(){e.setDeviceType(e.formData.typeIdTree)}))):this.getDevcieTypeTreeByVendor(),this.getThirdDevice()}},{key:"deviceTypeChange",value:function(e){var t=this;this.deviceType="",this.$nextTick((function(){t.$refs.deviceBasicInfoForm.clearValidate()})),0!==e.length&&this.service.checkTypeNum({deviceTypeId:2===e.length?e[1]:e[0]}).then((function(a){a.success?(t.setDeviceType(e),"ga1400"!==t.deviceType&&"dcs"!==t.deviceType||(t.formData.identifyType=1),"dcs"===t.deviceType&&(t.formData.cameraControlPort="6103")):t.$alert(a.message,"提示",{callback:function(e){t.formData.typeIdTree=[]}})}))}},{key:"setDeviceType",value:function(e){var t=this;if(e&&e.length){var a=e[0],i=e[1];"6"===a?this.deviceType="nvr":"4"===a?this.deviceType="ipc":"5"===a&&(this.deviceType="capture"),this.isThirdPartyMachine=!1,(this.deviceTypeOptions||[]).forEach((function(e){e.id===a&&(e.children||[]).forEach((function(e){e.id===i&&(t.isThirdPartyMachine=e.ifThirdParty,"ga1400"===e.deviceTypeCode?t.deviceType="ga1400":"8017"===e.deviceTypeCode?t.deviceType="third_party_gateway":"rtsp"===e.deviceTypeCode?t.deviceType="rtsp":"onvif"===e.deviceTypeCode?t.deviceType="onvif":"dcs"===e.deviceTypeCode&&(t.deviceType="dcs"),0===e.formDcm&&(t.deviceType="dcs_device"))}))}))}}},{key:"getDevcieTypeTreeByVendor",value:function(){var e=this;return new Promise((function(t){e.service.getDevcieTypeTreeByVendor({}).then((function(a){a.success?(e.deviceTypeOptions=a.data||[],t(!0)):e.$message.error(a.message)}))}))}},{key:"getThirdDevice",value:function(){var e=this;this.thirdNetOptions=[],this.service.getAllDeviceList({deviceTypeCode:"8017"}).then((function(t){t.success?(t.data||[]).forEach((function(t){e.thirdNetOptions.push({label:t.deviceName,value:t.deviceCode})})):e.$message.error(t.message)}))}},{key:"formatFormData",value:function(){var e=Object.assign({},this.formData);e.deviceTypeId=e.typeIdTree[e.typeIdTree.length-1],e.typeIdTree=e.typeIdTree.join(","),"third_party_gateway"===this.deviceType&&(e.isParent=0);"nvr"===this.deviceType&&(e.beginChannel=this.formData.beginChannel,e.channelCount=this.formData.channelCount),this.deviceBasicInfo=e}},{key:"_validateForm",value:function(){var e=this;return new Promise((function(t,a){e.$refs.deviceBasicInfoForm.validate((function(i){i?(e.formatFormData(),t()):a(new Error("请检查表单字段是否填写正确"))}))}))}},{key:"password",get:function(){return this.formData.cameraPassword&&this.formData.cameraPassword.replace(/[^]/g,"*")}},{key:"isIpRequired",get:function(){return"third_party_gateway"===this.deviceType||"nvr"===this.deviceType||"onvif"===this.deviceType||"ipc"===this.deviceType||"dcs"===this.deviceType||this.isThirdPartyMachine}}]),t}(p["d"]);d["a"]([Object(p["c"])({})],f.prototype,"data",void 0),d["a"]([Object(p["c"])({default:!1})],f.prototype,"isPreview",void 0),d["a"]([Object(p["c"])({default:!1})],f.prototype,"isEditing",void 0),d["a"]([Object(p["c"])({default:"140px"})],f.prototype,"labelWidth",void 0),f=d["a"]([Object(p["a"])({components:{DeviceArea:u["a"]}})],f);var v=f,h=v,g=(a("c64a"),a("2877")),y=Object(g["a"])(h,i,r,!1,null,"68267b2e",null);t["a"]=y.exports},d070:function(e,t,a){},f052:function(e,t,a){"use strict";var i=a("876c"),r=a.n(i);r.a}}]);