text: webpackJsonp([4],{KsHl:function(e,t,a){"use strict";var r=a("6bmU"),o={data:function(){return{ruleForm:{address:"",name:""},rules:{address:[{validator:function(e,t,a){""===t?a(new Error("请输入服务地址")):new RegExp("(https?|ftp|file)://[-A-Za-z0-9+&@#/%?=~_|!:,.;]+[-A-Za-z0-9+&@#/%=~_|]").test(t)||a(new Error("服务地址非法(示例:http://10.80.0.73:9002)"));a()},trigger:"blur"}],name:[{validator:function(e,t,a){if(!t)return a(new Error("请输入名称"));a()},trigger:"blur"}]}}},methods:{submitForm:function(e){var t=this;this.$refs[e].validate(function(e){if(!e)return console.log("error submit!!"),!1;Object(r.j)(null,t.ruleForm.address,t.ruleForm.name,null).then(function(e){e&&(200===e.data.code?(t.$message({showClose:!0,message:"服务添加成功",type:"success"}),t.$store.dispatch("getKafkaMonitorManagerList"),t.AddKafkaMonitorManagerDialogShow=!1):t.$message({showClose:!0,message:"服务添加失败:"+e.data,type:"error"}))})})},resetForm:function(e){this.$refs[e].resetFields()},getTopicList:function(e){var t=this;Object(r.g)(e).then(function(e){e&&(200!==e.data.code?t.$notify.error({title:"服务不可用",message:e.data.msg}):t.$notify({title:"连接成功",type:"success"}))})},checkAddress:function(e){var t=this;this.$refs.ruleForm.validate(function(a){a&&t.getTopicList(e)})}},computed:{AddKafkaMonitorManagerDialogShow:{get:function(){return this.$store.state.AddKafkaMonitorManagerDialogShow},set:function(e){this.$store.state.AddKafkaMonitorManagerDialogShow=e}}},watch:{AddKafkaMonitorManagerDialogShow:function(){this.AddKafkaMonitorManagerDialogShow||this.resetForm("ruleForm")}}},n={render:function(){var e=this,t=e.$createElement,a=e._self._c||t;return a("div",[a("el-dialog",{attrs:{title:"添加服务",visible:e.AddKafkaMonitorManagerDialogShow,width:"40%"},on:{"update:visible":function(t){e.AddKafkaMonitorManagerDialogShow=t}}},[a("el-form",{ref:"ruleForm",staticClass:"demo-ruleForm",attrs:{model:e.ruleForm,"status-icon":"",rules:e.rules,"label-width":"100px"}},[a("el-form-item",{attrs:{label:"服务地址",prop:"address"}},[a("el-row",{attrs:{gutter:10}},[a("el-col",{attrs:{span:15}},[a("el-input",{attrs:{autocomplete:"off",placeholder:"http://ip:port"},model:{value:e.ruleForm.address,callback:function(t){e.$set(e.ruleForm,"address",t)},expression:"ruleForm.address"}})],1),e._v(" "),a("el-col",{attrs:{span:5}},[a("el-button",{on:{click:function(t){return e.checkAddress(e.ruleForm.address)}}},[e._v("连接测试")])],1)],1)],1),e._v(" "),a("el-form-item",{attrs:{label:"服务名称",prop:"name"}},[a("el-col",{attrs:{span:15}},[a("el-input",{attrs:{autocomplete:"off"},model:{value:e.ruleForm.name,callback:function(t){e.$set(e.ruleForm,"name",t)},expression:"ruleForm.name"}})],1)],1),e._v(" "),a("el-form-item",[a("el-button",{attrs:{type:"primary"},on:{click:function(t){return e.submitForm("ruleForm")}}},[e._v("提交")]),e._v(" "),a("el-button",{on:{click:function(t){return e.resetForm("ruleForm")}}},[e._v("重置")])],1)],1)],1)],1)},staticRenderFns:[]},s=a("VU/8")(o,n,!1,null,null,null);t.a=s.exports},"Soq/":function(e,t,a){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=a("KsHl"),o=a("fc7Y"),n=a.n(o),s=a("6bmU"),i={name:"",components:{AddKafkaMonitorManagerDialog:r.a},methods:{showAddKafkaMonitorManagerDialog:function(){this.$store.state.AddKafkaMonitorManagerDialogShow=!0},formatUpdateDate:function(e,t){var a=new Date(e.updateDate);return n.a.format(a,"yyyy-MM-dd HH:mm:ss")},handleEdit:function(e,t){console.log(e,t)},handleDelete:function(e,t){var a=this;this.$confirm("确定删除?","提示",{confirmButtonText:"确定",cancelButtonText:"取消",type:"warning"}).then(function(){Object(s.j)(t.id,t.address,t.name,!0,null).then(function(e){e&&(200===e.data.code?(a.$message({showClose:!0,message:"删除成功",type:"success"}),a.$store.dispatch("getKafkaMonitorManagerList")):a.$message({showClose:!0,message:"删除失败:"+e.data,type:"error"}))})}).catch(function(){a.$message({type:"info",message:"已取消删除"})})}},computed:{KafkaMonitorManagerList:function(){return this.$store.state.KafkaMonitorManagerList}},mounted:function(){this.$store.dispatch("getKafkaMonitorManagerList")}},l={render:function(){var e=this,t=e.$createElement,a=e._self._c||t;return a("div",{staticClass:"container"},[a("AddKafkaMonitorManagerDialog"),e._v(" "),a("div",{staticStyle:{margin:"20px 20px 20px"}},[a("el-button",{attrs:{type:"primary",size:"mini"},on:{click:e.showAddKafkaMonitorManagerDialog}},[e._v("添加服务")])],1),e._v(" "),a("el-table",{staticStyle:{width:"100%"},attrs:{data:e.KafkaMonitorManagerList}},[a("el-table-column",{attrs:{prop:"name",label:"服务名称"}}),e._v(" "),a("el-table-column",{attrs:{prop:"address",label:"服务地址"}}),e._v(" "),a("el-table-column",{attrs:{prop:"updateDate",formatter:e.formatUpdateDate,label:"更新日期"}}),e._v(" "),a("el-table-column",{attrs:{label:"操作"},scopedSlots:e._u([{key:"default",fn:function(t){return[a("el-button",{attrs:{size:"mini",type:"danger",icon:"el-icon-delete"},on:{click:function(a){return e.handleDelete(t.$index,t.row)}}},[e._v("删除\n          ")])]}}])})],1)],1)},staticRenderFns:[]};var u=a("VU/8")(i,l,!1,function(e){a("nR0b")},"data-v-41a5f5c2",null);t.default=u.exports},nR0b:function(e,t){}});
  //# sourceMappingURL=4.1321fddb419bdaa37e1f.js.map