webpackJsonp([92],{gcLA:function(e,t,a){var n=a("sRQ2");"string"==typeof n&&(n=[[e.i,n,""]]),n.locals&&(e.exports=n.locals);a("rjj0")("689413f2",n,!0)},rALy:function(e,t,a){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n=a("//Fk"),i=a.n(n),s=a("Dd8w"),o=a.n(s),r=a("lHA8"),l=a.n(r),c=a("c/Tr"),p=a.n(c),d=a("BO1k"),u=a.n(d),h=a("Gu7T"),v=a.n(h),g=a("yfAY"),m=a("FNiI"),f=a("ByBV"),b=a("/W+i"),x=a("hmNX"),y={data:function(){return{single:!1,dynamicValidateForm:{domains:[{value:""}],email:""},isNext:!0,openApp:!1,active:0,curType:1,forbidden:!1,editId:this.$route.params.id,editName:this.$route.params.name,createdLoading:!1,form:{typeCode:null,groupCode:null,name:null,code:null,address:null},engineOptions:[],engineData:[],publishTypes:[{label:"服务发现",value:1},{label:"IP+端口",value:2}],isNextTwo:!1,appTypes:[],appSubTypes:[],appNames:[],ServiceTypes:[],serviceCodes:[],showAddService:!1,availableEngineData:[],engineCascaderValue:[],engineForm:{availableEngineData:[{version:[]}]},tabPosition:"top",keyTableData:[],dialogVisible:!1,ruleForm2:{password:""},cur:"",isFalse:!1,expands:[],cities:[],checkAll:!0,secretId:"",totalList:[],errMessage:"",errApp:"",typeName:"",typeApp:""}},computed:{ifEdit:function(){return"ApplicationEdit"===this.$route.name||"ApplicationUp"},msg:function(){return this.ifEdit?"更新成功":"添加成功"},isEnable:function(){return"goEnable"===this.$route.params.type}},created:function(){this.fetchEditInfo(),this.fetchOptions(),this.getEngineOptions(),(localStorage.getItem("aieditId")&&this.editId&&this.editId!=localStorage.getItem("aieditId")||!localStorage.getItem("aieditId"))&&localStorage.setItem("aieditId",this.editId),(localStorage.getItem("aieditName")&&this.editName&&this.editName!=localStorage.getItem("aieditName")||!localStorage.getItem("aieditName"))&&localStorage.setItem("aieditName",this.editName)},methods:{versionChange:function(){this.engineForm.availableEngineData=[].concat(v()(this.engineForm.availableEngineData))},engineOptionsChange:function(e,t){var a=this;m.a.getAiServerType({abilityGroup:e[0],serviceName:e[1]}).then(function(e){if(e.success){var n=e.data;n.length?(a.engineForm.availableEngineData[t].version=n.map(function(e){return{id:e.extension.modelVersion,serveVersion:e.extension.modelVersion}}),a.isNext=!1):(a.engineForm.availableEngineData[t]={version:[]},a.isNext=!0),a.engineForm.availableEngineData=[].concat(v()(a.engineForm.availableEngineData))}})},handleEngineOptions:function(e){var t=[],a=function(e){var a=t.findIndex(function(t){return t.value===e.abilityGroup});-1!==a?t[a].children.push({label:e.algorithmSubTypeName,value:e.algorithmSubType}):t.push({label:e.abilityGroupDesc,value:e.abilityGroup,children:[{label:e.algorithmSubTypeName,value:e.algorithmSubType}]})},n=!0,i=!1,s=void 0;try{for(var o,r=u()(e);!(n=(o=r.next()).done);n=!0){a(o.value)}}catch(e){i=!0,s=e}finally{try{!n&&r.return&&r.return()}finally{if(i)throw s}}return t},getEngineOptions:function(){var e=this;m.a.aiServerType({}).then(function(t){e.engineData=t,e.engineOptions=e.handleEngineOptions(t)})},fetchAvailableEngine:function(){var e=this;localStorage.getItem("aieditId")&&x.a.fetchAvailableEngine(localStorage.getItem("aieditId")).then(function(t){e.engineForm.availableEngineData=t.data,e.engineForm.availableEngineData.forEach(function(t){t.version.length&&(e.isNext=!1)})}).catch(function(t){e.$message.error(t.message)})},changeSq:function(e){this.openApp=!this.openApp,"top"==e?(this.fetchCurKey(),this.openAuthStatus()):this.closeAuthStatus()},openAuthStatus:function(){var e=this;x.a.openAuthStatus(localStorage.getItem("aieditId")).then(function(e){}).catch(function(t){e.$message.error(t.message)})},closeAuthStatus:function(){var e=this;x.a.closeAuthStatus(localStorage.getItem("aieditId")).then(function(e){}).catch(function(t){e.$message.error(t.message)})},fetchCurKey:function(){var e=this,t={bindType:1,bindValue:localStorage.getItem("aieditId")};x.a.queryKeySecret(t).then(function(t){e.keyTableData=t.data,e.totalList=t.data[0]&&t.data[0].totalList?t.data[0].totalList:[],e.keyTableData.forEach(function(t){var a=[];t.extendList.forEach(function(e,t){a.push(e.bindValue)}),a=p()(new l.a(a)),e.$set(t,"bindInfos",a)})}).catch(function(t){e.$message.error(t.message)})},creatKey:function(){var e=this;if(this.keyTableData.length>=10)return this.$message.error("应用授权最多允许创建10组"),!1;var t={applicationName:localStorage.getItem("aieditName"),applicationId:localStorage.getItem("aieditId")};x.a.creatKey(t).then(function(t){var a=[];t.data.totalList.forEach(function(e){a.push(e.bindValue)}),e.$set(t.data,"bindInfos",a),e.keyTableData.push(t.data),e.$message.success("成功"),e.fetchCurKey()}).catch(function(t){e.$message.error(t.message)})},next:function(){var e=this;this.$refs.engineForm.validate(function(t){if(!t)return!1;var a=[];(a=e.engineForm.availableEngineData.map(function(e){return{serviceVersion:e.currentVersion}}))[0].serviceType=e.engineCascaderValue[1];var n=o()({},e.form,{engineParamList:a});x.a.nextOne(n).then(function(t){if(!e.single)return e.$message.success("编辑成功"),void e.$router.push("/application/index");e.active++>2&&(e.active=0)}).catch(function(t){e.$message.error(t.message)})})},twoNext:function(){var e=this;if(0==this.keyTableData.length&&"top"==this.tabPosition)return this.$message.error("必须有一组授权且有一渠道为启用状态"),!1;if(!this.keyTableData.some(function(e){if(2!=e.authStatus&&0!=e.bindInfos.length)return!0})&&"top"==this.tabPosition)return this.$message.error("必须有一组授权且有一渠道为启用状态"),!1;this.isNextTwo=!0,this.keyTableData.forEach(function(e){e.bindInfos=p()(new l.a(e.bindInfos));var t=e.bindInfos;e.bindInfos=e.totalList.filter(function(e){return t.indexOf(e.bindValue)>-1}),e.keySecretId=e.id,e.bindType=2});var t={keySecretExts:this.keyTableData};x.a.keyAdd(t).then(function(t){e.isNextTwo=!1,e.isEnable&&e.up(e.editId),e.isFalse=!1,e.active++>2&&(e.active=0)}).catch(function(t){e.isFalse=!0,e.isNextTwo=!1,e.errMessage=t.message,e.errApp=e.editName})},upStep:function(){this.active--},showAS:function(e,t){this.dialogVisible=!0,this.cur=t,this.secretId=e.id},hideAS:function(e){this.keyTableData[e].AS=""},getRowKeys:function(e){return e.id},open:function(e){if(0==this.expands.length)this.expands.push(this.keyTableData[e].id);else if(this.expands.includes(this.keyTableData[e].id)){var t=this.expands.indexOf(this.keyTableData[e].id);this.expands.splice(t,1)}else this.expands.push(this.keyTableData[e].id)},handleCheckedCitiesChange:function(e){},goList:function(){this.$router.push("/application/index")},goDetail:function(){this.$router.push({name:"ApplicationDetail",params:{id:this.editId}})},checkPassword:function(e){var t=this;this.$refs[e].validate(function(a){if(!a)return!1;x.a.checkPassword({secretId:t.secretId,password:Object(b.a)(t.ruleForm2.password)}).then(function(e){t.$set(t.keyTableData[t.cur],"AS",e.data),t.dialogVisible=!1}).catch(function(e){t.$message.error(e.message)}),t.$refs[e].resetFields()})},creatApp:function(){this.cont++;var e={id:this.cont,app:{AK:"xKQ_sucaKN-87Rdqhv27IGIXVRn2B9uLcqO_5000",AS:""},name:"2019-05-31",status:1,channels:["ATM","手机银行","网上银行","柜台"],checkAll:!0};this.keyTableData.unshift(e)},disable:function(e){var t=this;this.$confirm("确认禁用此秘钥吗?","禁用",{confirmButtonText:"确定",cancelButtonText:"取消",type:"warning"}).then(function(){t.$set(e,"loading",!0);var a={id:e.id,authKey:e.authKey,authStatus:2};x.a.enableKey(a).then(function(a){t.$set(e,"loading",!1),t.fetchCurKey(),t.$message.success(a.message)}).catch(function(a){t.$message.error(a.message),t.$set(e,"loading",!1)})}).catch(function(){})},enable:function(e){var t=this,a={id:e.id,authKey:e.authKey,authStatus:1};x.a.enableKey(a).then(function(e){t.fetchCurKey(),t.$message.success(e.message)}).catch(function(e){t.$message.error(e.message)})},up:function(e){var t=this;x.a.enable(e).then(function(e){t.$message.success(e.message)}).catch(function(e){t.$message.error(e.message)})},del:function(e){var t=this;this.$confirm("确认删除此秘钥吗?","提示",{confirmButtonText:"确定",cancelButtonText:"取消",type:"warning"}).then(function(){x.a.delKey(e.id).then(function(e){t.$message.success(e.message),t.fetchCurKey()}).catch(function(e){t.$message.error(e.message)})}).catch(function(){})},getServiceDetail:function(e){var t=this;1==this.curType&&m.a.getServiceDetail(e).then(function(e){var a=[];try{a=e.data.urls}catch(e){}t.form.address=a.join(";")})},fetchEditInfo:function(){var e=this;(localStorage.getItem("aieditId")&&this.editId&&this.editId!=localStorage.getItem("aieditId")||!localStorage.getItem("aieditId"))&&localStorage.setItem("aieditId",this.editId),this.ifEdit&&localStorage.getItem("aieditId")&&(this.forbidden=!0,x.a.detail(localStorage.getItem("aieditId")).then(function(t){setTimeout(function(){e.appTypes.forEach(function(a){a.value==t.typeCode&&(e.typeName=a.label)}),e.appSubTypes.forEach(function(a){a.code==t.groupCode&&(e.typeApp=a.name)})},500),1==t.authStatus?(e.tabPosition="top",e.openApp=!0,e.fetchCurKey()):e.tabPosition="right";for(var a=0;a