2 lines
13 KiB
JavaScript
2 lines
13 KiB
JavaScript
webpackJsonp([22],{uizM:function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var a=r("mvHQ"),i=r.n(a),l={data:function(){return{serverOptions:[],loading:!1,queryInfo:{serverName:"",pageNum:1,pageSize:10},serverlist:[],currpage:1,total:0,del:[],addDialogVisible:!1,editDialogVisible:!1,detailDialogVisible:!1,addForm:{serverName:"",ip:"",port:"",deployApplication:"",userName:"",password:"",remarks:""},fileIsChange:!1,editForm:{},detailForm:{},addFormRules:{serverName:[{required:!0,message:"请输入服务器名称",trigger:"blur"},{min:1,max:20,message:"长度在 1 到 200 个字符",trigger:"blur"}],ip:[{required:!0,message:"请输入服务器ip地址",trigger:"blur"},{min:1,max:100,message:"长度在 1 到 100 个字符",trigger:"blur"}],port:[{required:!1,message:"请输入应用端口",trigger:"blur"},{min:1,max:20,message:"长度在 1 到 20 个数字",trigger:"blur"}],userName:[{required:!0,message:"请输入用户名",trigger:"blur"},{min:1,max:100,message:"长度在 1 到 100 个字符",trigger:"blur"}],password:[{required:!0,message:"请输入密码",trigger:"blur"},{min:1,max:50,message:"长度在 1 到 50 个字符",trigger:"blur"}],remarks:[{required:!1,message:"请输入备注信息",trigger:"blur"},{min:1,max:200,message:"长度在 1 到 200 个字符",trigger:"blur"}]}}},mounted:function(){this.getServerIpList()},created:function(){this.getServerList()},methods:{getServerIpList:function(){var e=this;this.$api.server.queryAllServerIp(this.queryInfo.ip).then(function(t){e.loading=!1,e.serverOptions=t.data.data}).catch(function(){e.loading=!1})},getServerList:function(){var e=this;this.loading=!0,this.$api.server.queryAllServer(i()(this.queryInfo)).then(function(t){e.loading=!1,e.serverlist=t.data.data.list,e.total=t.data.data.total,e.currpage=t.data.data.pageNum}).catch(function(t){e.loading=!1}),this.currpage=1},editDialogClose:function(){this.$refs.addFormRef.resetFields()},addDialogClose:function(){this.$refs.addFormRef.resetFields()},addServer:function(){var e=this;this.$refs.addFormRef.validate(function(t){t&&e.$api.server.addServer(i()(e.addForm)).then(function(t){e.$notify({message:t.data.msg,type:"success"}),e.addDialogVisible=!1,e.getServerList(),e.getServerIpList()}).catch(function(){e.loading=!0})})},query:function(){this.queryInfo.pageNum=1,this.getServerList(),this.getServerIpList()},delServer:function(e){var t=this;this.$confirm("确定删除该服务器吗?","提示",{confirmButtonText:"确定",cancelButtonText:"取消",type:"warning"}).then(function(){t.$api.server.delserver(e).then(function(e){t.$notify({message:e.data.msg,type:"success"}),t.getServerList(),t.getServerIpList()}).catch(function(){}).catch(function(){}),t.loading=!1})},handleSizeChange:function(e){this.queryInfo.pageSize=e,this.getServerList()},handleCurrentChange:function(e){this.queryInfo.pageNum=e,this.getServerList()},showEditDialog:function(e){var t=this;this.editDialogVisible=!0,this.$api.server.queryServerById(e).then(function(e){t.editForm=e.data.data}).catch(function(){})},editServer:function(){var e=this;this.$refs.editFormRef.validate(function(t){t&&e.$api.server.updateServer(i()(e.editForm)).then(function(t){e.$notify({message:t.data.msg,type:"success"}),e.editDialogVisible=!1,e.getServerList(),e.getServerIpList()}).catch(function(){e.loading=!1})})},showDetailDialog:function(e){var t=this;this.detailDialogVisible=!0,this.$api.server.queryServerById(e).then(function(e){t.loading=!1,t.editForm=e.data.data}).catch(function(){}),this.loading=!1}}},o={render:function(){var e=this,t=e.$createElement,r=e._self._c||t;return r("div",{staticClass:"server-box"},[r("el-form",{staticClass:"item-form-inline",attrs:{inline:!0}},[r("el-form-item",{attrs:{label:"服务器名称"}},[r("el-input",{attrs:{placeholder:"请输入服务器名称",clearable:""},model:{value:e.queryInfo.serverName,callback:function(t){e.$set(e.queryInfo,"serverName",t)},expression:"queryInfo.serverName"}})],1),e._v(" "),r("el-form-item",{attrs:{label:"服务器IP"}},[r("el-select",{attrs:{placeholder:"请选择",clearable:""},model:{value:e.queryInfo.ip,callback:function(t){e.$set(e.queryInfo,"ip",t)},expression:"queryInfo.ip"}},e._l(e.serverOptions,function(e){return r("el-option",{key:e.ip,attrs:{label:e.ip,value:e.ip}})}),1)],1),e._v(" "),r("el-form-item",[r("el-button",{attrs:{type:"primary",size:"small"},on:{click:e.query}},[e._v("查询")])],1)],1),e._v(" "),r("el-row",{staticClass:"add_button"},[r("el-col",{attrs:{span:2}},[r("el-button",{attrs:{type:"primary",size:"small"},on:{click:function(t){e.addDialogVisible=!0}}},[e._v("添加")])],1)],1),e._v(" "),r("el-table",{attrs:{data:e.serverlist,border:"",fit:!0}},[r("el-table-column",{attrs:{type:"index",label:"序号",width:"60px",align:"center"}}),e._v(" "),r("el-table-column",{attrs:{label:"服务器名称",prop:"serverName",align:"center",width:"200px"}}),e._v(" "),r("el-table-column",{attrs:{label:"服务器IP",prop:"ip",align:"center"}}),e._v(" "),r("el-table-column",{attrs:{label:"部署应用",prop:"deployApplication",align:"center",width:"120px"}}),e._v(" "),r("el-table-column",{attrs:{label:"应用端口",prop:"port",align:"center",width:"120px"}}),e._v(" "),r("el-table-column",{attrs:{label:"用户名",prop:"userName",align:"center"}}),e._v(" "),r("el-table-column",{attrs:{label:"密码",prop:"password",align:"center"}}),e._v(" "),r("el-table-column",{attrs:{label:"备注",prop:"remarks",align:"center"}}),e._v(" "),r("el-table-column",{attrs:{label:"操作",align:"center",fixed:"right",width:"150px"},scopedSlots:e._u([{key:"default",fn:function(t){return[r("el-button",{attrs:{type:"text",size:"small"},on:{click:function(r){return e.showDetailDialog(t.row.id)}}},[e._v("查看")]),e._v(" "),r("el-button",{attrs:{type:"text",size:"small"},on:{click:function(r){return e.showEditDialog(t.row.id)}}},[e._v("编辑")]),e._v(" "),r("el-button",{attrs:{slot:"reference",type:"text",size:"small"},on:{click:function(r){return e.delServer(t.row.id)}},slot:"reference"},[e._v("删除")])]}}])})],1),e._v(" "),r("el-pagination",{attrs:{"current-page":e.currpage,"page-sizes":[5,10,20,30],"page-size":e.queryInfo.pageSize,layout:"total, prev, pager, next, sizes, jumper",total:e.total},on:{"size-change":e.handleSizeChange,"current-change":e.handleCurrentChange}}),e._v(" "),r("el-dialog",{attrs:{title:"添加",loadling:e.loading,visible:e.addDialogVisible,"close-on-click-modal":!1,width:"36%"},on:{"update:visible":function(t){e.addDialogVisible=t},close:e.addDialogClose}},[r("el-form",{ref:"addFormRef",attrs:{model:e.addForm,rules:e.addFormRules,"label-width":"100px"}},[r("el-form-item",{attrs:{label:"服务器名称",prop:"serverName"}},[r("el-input",{attrs:{placeholder:"请输入服务器名称"},model:{value:e.addForm.serverName,callback:function(t){e.$set(e.addForm,"serverName",t)},expression:"addForm.serverName"}})],1),e._v(" "),r("el-form-item",{attrs:{label:"服务器IP",prop:"ip"}},[r("el-input",{attrs:{placeholder:"请输入服务器IP"},model:{value:e.addForm.ip,callback:function(t){e.$set(e.addForm,"ip",t)},expression:"addForm.ip"}})],1),e._v(" "),r("el-form-item",{attrs:{label:"部署应用",prop:"deployApplication"}},[r("el-input",{attrs:{placeholder:"请输入部署应用"},model:{value:e.addForm.deployApplication,callback:function(t){e.$set(e.addForm,"deployApplication",t)},expression:"addForm.deployApplication"}})],1),e._v(" "),r("el-form-item",{attrs:{label:"应用端口",prop:"port"}},[r("el-input",{attrs:{placeholder:"请输入服务器端口",oninput:"value=value.replace(/[^\\d]/g,'')"},model:{value:e.addForm.port,callback:function(t){e.$set(e.addForm,"port",t)},expression:"addForm.port"}})],1),e._v(" "),r("el-form-item",{attrs:{label:"用户名",prop:"userName"}},[r("el-input",{attrs:{placeholder:"请输入用户名"},model:{value:e.addForm.userName,callback:function(t){e.$set(e.addForm,"userName",t)},expression:"addForm.userName"}})],1),e._v(" "),r("el-form-item",{attrs:{label:"密码",prop:"password"}},[r("el-input",{attrs:{placeholder:"请输入密码"},model:{value:e.addForm.password,callback:function(t){e.$set(e.addForm,"password",t)},expression:"addForm.password"}})],1),e._v(" "),r("el-form-item",{attrs:{label:"备注",prop:"remarks"}},[r("el-input",{attrs:{type:"textarea",placeholder:"请输入备注信息"},model:{value:e.addForm.remarks,callback:function(t){e.$set(e.addForm,"remarks",t)},expression:"addForm.remarks"}})],1)],1),e._v(" "),r("span",{staticClass:"dialog-footer",attrs:{slot:"footer"},slot:"footer"},[r("el-button",{on:{click:function(t){e.addDialogVisible=!1}}},[e._v("取 消")]),e._v(" "),r("el-button",{attrs:{type:"primary"},on:{click:e.addServer}},[e._v("确 定")])],1)],1),e._v(" "),r("el-dialog",{attrs:{title:"查看",visible:e.detailDialogVisible,"close-on-click-modal":!1,width:"30%"},on:{"update:visible":function(t){e.detailDialogVisible=t}}},[r("el-form",{ref:"editFormRef",attrs:{model:e.editForm,"label-width":"100px"}},[r("el-form-item",{attrs:{label:"服务器名称",prop:"serverName"}},[r("el-input",{attrs:{disabled:""},model:{value:e.editForm.serverName,callback:function(t){e.$set(e.editForm,"serverName",t)},expression:"editForm.serverName"}})],1),e._v(" "),r("el-form-item",{attrs:{label:"服务器IP",prop:"ip"}},[r("el-input",{attrs:{disabled:""},model:{value:e.editForm.ip,callback:function(t){e.$set(e.editForm,"ip",t)},expression:"editForm.ip"}})],1),e._v(" "),r("el-form-item",{attrs:{label:"部署应用",prop:"deployApplication"}},[r("el-input",{attrs:{disabled:""},model:{value:e.editForm.deployApplication,callback:function(t){e.$set(e.editForm,"deployApplication",t)},expression:"editForm.deployApplication"}})],1),e._v(" "),r("el-form-item",{attrs:{label:"应用端口",prop:"port"}},[r("el-input",{attrs:{disabled:""},model:{value:e.editForm.port,callback:function(t){e.$set(e.editForm,"port",t)},expression:"editForm.port"}})],1),e._v(" "),r("el-form-item",{attrs:{label:"用户名",prop:"userName"}},[r("el-input",{attrs:{disabled:""},model:{value:e.editForm.userName,callback:function(t){e.$set(e.editForm,"userName",t)},expression:"editForm.userName"}})],1),e._v(" "),r("el-form-item",{attrs:{label:"密码",prop:"password"}},[r("el-input",{attrs:{disabled:""},model:{value:e.editForm.password,callback:function(t){e.$set(e.editForm,"password",t)},expression:"editForm.password"}})],1),e._v(" "),r("el-form-item",{attrs:{label:"备注",prop:"remarks"}},[r("el-input",{attrs:{type:"textarea",disabled:""},model:{value:e.editForm.remarks,callback:function(t){e.$set(e.editForm,"remarks",t)},expression:"editForm.remarks"}})],1)],1),e._v(" "),r("span",{staticClass:"dialog-footer",attrs:{slot:"footer"},slot:"footer"},[r("el-button",{on:{click:function(t){e.detailDialogVisible=!1}}},[e._v("关 闭")])],1)],1),e._v(" "),r("el-dialog",{attrs:{title:"修改",visible:e.editDialogVisible,"close-on-click-modal":!1,width:"30%"},on:{"update:visible":function(t){e.editDialogVisible=t},close:e.editDialogClose}},[r("el-form",{ref:"editFormRef",attrs:{model:e.editForm,rules:e.addFormRules,"label-width":"100px"}},[r("el-form-item",{attrs:{label:"服务器名称",prop:"serverName"}},[r("el-input",{model:{value:e.editForm.serverName,callback:function(t){e.$set(e.editForm,"serverName",t)},expression:"editForm.serverName"}})],1),e._v(" "),r("el-form-item",{attrs:{label:"服务器IP",prop:"ip"}},[r("el-input",{model:{value:e.editForm.ip,callback:function(t){e.$set(e.editForm,"ip",t)},expression:"editForm.ip"}})],1),e._v(" "),r("el-form-item",{attrs:{label:"部署应用",prop:"deployApplication"}},[r("el-input",{model:{value:e.editForm.deployApplication,callback:function(t){e.$set(e.editForm,"deployApplication",t)},expression:"editForm.deployApplication"}})],1),e._v(" "),r("el-form-item",{attrs:{label:"应用端口",prop:"port"}},[r("el-input",{model:{value:e.editForm.port,callback:function(t){e.$set(e.editForm,"port",t)},expression:"editForm.port"}})],1),e._v(" "),r("el-form-item",{attrs:{label:"用户名",prop:"userName"}},[r("el-input",{model:{value:e.editForm.userName,callback:function(t){e.$set(e.editForm,"userName",t)},expression:"editForm.userName"}})],1),e._v(" "),r("el-form-item",{attrs:{label:"密码",prop:"password"}},[r("el-input",{model:{value:e.editForm.password,callback:function(t){e.$set(e.editForm,"password",t)},expression:"editForm.password"}})],1),e._v(" "),r("el-form-item",{attrs:{label:"备注",prop:"remarks"}},[r("el-input",{attrs:{type:"textarea"},model:{value:e.editForm.remarks,callback:function(t){e.$set(e.editForm,"remarks",t)},expression:"editForm.remarks"}})],1)],1),e._v(" "),r("span",{staticClass:"dialog-footer",attrs:{slot:"footer"},slot:"footer"},[r("el-button",{on:{click:function(t){e.editDialogVisible=!1}}},[e._v("取 消")]),e._v(" "),r("el-button",{attrs:{type:"primary"},on:{click:e.editServer}},[e._v("确 定")])],1)],1)],1)},staticRenderFns:[]};var s=r("VU/8")(l,o,!1,function(e){r("vZHM")},"data-v-072d6f10",null);t.default=s.exports},vZHM:function(e,t){}});
|
|
//# sourceMappingURL=22.5b97804d905a7be3d35d.js.map
|