chunk-2d0aa53d.ab5be814.js 12 KB

1
  1. (window["webpackJsonp"]=window["webpackJsonp"]||[]).push([["chunk-2d0aa53d"],{1118:function(e,t,a){"use strict";a.r(t);var r=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,"label-width":"68px"}},[a("el-form-item",{attrs:{label:"系统名称",prop:"sysName"}},[a("el-input",{attrs:{placeholder:"请输入系统名称",clearable:""},nativeOn:{keyup:function(t){return!t.type.indexOf("key")&&e._k(t.keyCode,"enter",13,t.key,"Enter")?null:e.handleQuery(t)}},model:{value:e.queryParams.sysName,callback:function(t){e.$set(e.queryParams,"sysName",t)},expression:"queryParams.sysName"}})],1),a("el-form-item",{attrs:{label:"IP地址",prop:"ip"}},[a("el-input",{attrs:{placeholder:"请输入IP地址",clearable:""},nativeOn:{keyup:function(t){return!t.type.indexOf("key")&&e._k(t.keyCode,"enter",13,t.key,"Enter")?null:e.handleQuery(t)}},model:{value:e.queryParams.ip,callback:function(t){e.$set(e.queryParams,"ip",t)},expression:"queryParams.ip"}})],1),a("el-form-item",{attrs:{label:"是否在线",prop:"isOnline"}},[a("el-select",{attrs:{placeholder:"请选择是否在线",clearable:""},model:{value:e.queryParams.isOnline,callback:function(t){e.$set(e.queryParams,"isOnline",t)},expression:"queryParams.isOnline"}},e._l(e.dict.type.sys_notice_status,(function(e){return a("el-option",{key:e.value,attrs:{label:e.label,value:e.value}})})),1)],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-row",{staticClass:"mb8",attrs:{gutter:10}},[a("el-col",{attrs:{span:1.5}},[a("el-button",{directives:[{name:"hasPermi",rawName:"v-hasPermi",value:["monitor:sys:add"],expression:"['monitor:sys:add']"}],attrs:{type:"primary",plain:"",icon:"el-icon-plus",size:"mini"},on:{click:e.handleAdd}},[e._v("新增")])],1),a("el-col",{attrs:{span:1.5}},[a("el-button",{directives:[{name:"hasPermi",rawName:"v-hasPermi",value:["monitor:sys:edit"],expression:"['monitor:sys:edit']"}],attrs:{type:"success",plain:"",icon:"el-icon-edit",size:"mini",disabled:e.single},on:{click:e.handleUpdate}},[e._v("修改")])],1),a("el-col",{attrs:{span:1.5}},[a("el-button",{directives:[{name:"hasPermi",rawName:"v-hasPermi",value:["monitor:sys:remove"],expression:"['monitor:sys:remove']"}],attrs:{type:"danger",plain:"",icon:"el-icon-delete",size:"mini",disabled:e.multiple},on:{click:e.handleDelete}},[e._v("删除")])],1),a("el-col",{attrs:{span:1.5}},[a("el-button",{directives:[{name:"hasPermi",rawName:"v-hasPermi",value:["monitor:sys:export"],expression:"['monitor:sys:export']"}],attrs:{type:"warning",plain:"",icon:"el-icon-download",size:"mini"},on:{click:e.handleExport}},[e._v("导出")])],1),a("right-toolbar",{attrs:{showSearch:e.showSearch},on:{"update:showSearch":function(t){e.showSearch=t},"update:show-search":function(t){e.showSearch=t},queryTable:e.getList}})],1),a("el-table",{directives:[{name:"loading",rawName:"v-loading",value:e.loading,expression:"loading"}],attrs:{data:e.sysList},on:{"selection-change":e.handleSelectionChange}},[a("el-table-column",{attrs:{type:"selection",width:"55",align:"center"}}),a("el-table-column",{attrs:{fixed:"",label:"序号",width:"55",align:"center"},scopedSlots:e._u([{key:"default",fn:function(t){return[a("span",[e._v(e._s((e.queryParams.pageNum-1)*e.queryParams.pageSize+(t.$index+1))+" ")])]}}])}),a("el-table-column",{attrs:{label:"图标",align:"center",width:"100"}},[a("svg-icon",{attrs:{"icon-class":"linux"}})],1),e._e(),a("el-table-column",{attrs:{label:"系统名称",align:"center",prop:"sysName"}}),a("el-table-column",{attrs:{label:"IP地址",align:"center",prop:"ip"}}),a("el-table-column",{attrs:{label:"CPU(%)",align:"center",prop:"cpuInfo"}}),a("el-table-column",{attrs:{label:"CPU核心",align:"center",prop:"cpuCoreInfo"}}),a("el-table-column",{attrs:{label:"内存(%)",align:"center",prop:"memInfo"}}),a("el-table-column",{attrs:{label:"硬盘大小",align:"center",prop:"diskInfo"}}),a("el-table-column",{attrs:{label:"硬盘(%)",align:"center",prop:"diskPercent"}}),a("el-table-column",{attrs:{label:"是否在线",align:"center",prop:"isOnline"},scopedSlots:e._u([{key:"default",fn:function(t){return[a("dict-tag",{attrs:{options:e.dict.type.sys_notice_status,value:t.row.isOnline}})]}}])}),a("el-table-column",{attrs:{label:"操作",align:"center","class-name":"small-padding fixed-width"},scopedSlots:e._u([{key:"default",fn:function(t){return[a("el-button",{directives:[{name:"hasPermi",rawName:"v-hasPermi",value:["monitor:sys:edit"],expression:"['monitor:sys:edit']"}],attrs:{size:"mini",type:"text",icon:"el-icon-edit"},on:{click:function(a){return e.handleUpdate(t.row)}}},[e._v("修改")]),a("el-button",{directives:[{name:"hasPermi",rawName:"v-hasPermi",value:["monitor:sys:remove"],expression:"['monitor:sys:remove']"}],attrs:{size:"mini",type:"text",icon:"el-icon-delete"},on:{click:function(a){return e.handleDelete(t.row)}}},[e._v("删除")])]}}])})],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:e.title,visible:e.open,width:"500px","append-to-body":""},on:{"update:visible":function(t){e.open=t}}},[a("el-form",{ref:"form",attrs:{model:e.form,rules:e.rules,"label-width":"80px"}},[a("el-form-item",{attrs:{label:"系统名称",prop:"sysName"}},[a("el-input",{attrs:{placeholder:"请输入系统名称"},model:{value:e.form.sysName,callback:function(t){e.$set(e.form,"sysName",t)},expression:"form.sysName"}})],1),a("el-form-item",{attrs:{label:"IP地址",prop:"ip"}},[a("el-input",{attrs:{placeholder:"请输入IP地址"},model:{value:e.form.ip,callback:function(t){e.$set(e.form,"ip",t)},expression:"form.ip"}})],1),a("el-form-item",{attrs:{label:"用户名",prop:"userName"}},[a("el-input",{attrs:{placeholder:"请输入用户名"},model:{value:e.form.userName,callback:function(t){e.$set(e.form,"userName",t)},expression:"form.userName"}})],1),a("el-form-item",{attrs:{label:"用户密码",prop:"userPassword"}},[a("el-input",{attrs:{placeholder:"请输入用户密码",type:"password"},model:{value:e.form.userPassword,callback:function(t){e.$set(e.form,"userPassword",t)},expression:"form.userPassword"}})],1),a("el-form-item",{attrs:{label:"系统端口",prop:"ipPort"}},[a("el-input",{attrs:{placeholder:"请输入系统端口"},model:{value:e.form.ipPort,callback:function(t){e.$set(e.form,"ipPort",t)},expression:"form.ipPort"}})],1),a("el-form-item",{attrs:{label:"通知方式",prop:"messageType"}},[a("el-select",{attrs:{placeholder:"请选通知类型",size:"small"},on:{change:e.chanageMessageType},model:{value:e.form.messageType,callback:function(t){e.$set(e.form,"messageType",t)},expression:"form.messageType"}},e._l(e.dict.type.sys_message_type,(function(e){return a("el-option",{key:parseInt(e.value),attrs:{label:e.label,value:parseInt(e.value)}})})),1)],1),e.phoneshow?a("el-form-item",{attrs:{label:"手机号码",prop:"userPhone"}},[a("el-input",{attrs:{placeholder:"请输入内容"},model:{value:e.form.userPhone,callback:function(t){e.$set(e.form,"userPhone",t)},expression:"form.userPhone"}})],1):e._e(),e.emailshow?a("el-form-item",{attrs:{label:"邮箱地址",prop:"userEmail"}},[a("el-input",{attrs:{placeholder:"请输入内容"},model:{value:e.form.userEmail,callback:function(t){e.$set(e.form,"userEmail",t)},expression:"form.userEmail"}})],1):e._e(),a("el-form-item",{attrs:{label:"备注",prop:"remark"}},[a("el-input",{attrs:{type:"textarea",placeholder:"请输入内容"},model:{value:e.form.remark,callback:function(t){e.$set(e.form,"remark",t)},expression:"form.remark"}})],1)],1),a("div",{staticClass:"dialog-footer",attrs:{slot:"footer"},slot:"footer"},[a("el-button",{attrs:{type:"primary"},on:{click:e.testLink}},[e._v("测试连接")]),a("el-button",{attrs:{type:"primary"},on:{click:e.submitForm}},[e._v("确 定")]),a("el-button",{on:{click:e.cancel}},[e._v("取 消")])],1)],1)],1)},s=[],l=a("5530"),n=(a("d81d"),a("b775"));function i(e){return Object(n["a"])({url:"/monitor/sys/list",method:"get",params:e})}function o(e){return Object(n["a"])({url:"/monitor/sys/"+e,method:"get"})}function m(e){return Object(n["a"])({url:"/monitor/sys",method:"post",data:e})}function u(e){return Object(n["a"])({url:"/monitor/sys",method:"put",data:e})}function c(e){return Object(n["a"])({url:"/monitor/sys/"+e,method:"delete"})}function p(e){return Object(n["a"])({url:"/monitor/sys/testlink",method:"post",data:e})}var d=a("2da1"),h={name:"Sys",dicts:["sys_notice_status","sys_message_type"],data:function(){return{phoneshow:!0,emailshow:!1,loading:!0,ids:[],single:!0,multiple:!0,showSearch:!0,total:0,sysList:[],title:"",open:!1,queryParams:{pageNum:1,pageSize:10,sysName:null,ip:null,isOnline:null},form:{},rules:{ip:[{required:!0,message:"IP地址不能为空",trigger:"blur"}],userName:[{required:!0,message:"用户名不能为空",trigger:"blur"}],userPassword:[{required:!0,message:"用户密码不能为空",trigger:"blur"}],ipPort:[{required:!0,message:"系统端口不能为空",trigger:"blur"}],isOnline:[{required:!0,message:"是否在线 0在线 1离线不能为空",trigger:"change"}],userPhone:[{required:!0,message:"手机号码不能为空",trigger:"blur"},{pattern:/^1[3|4|5|6|7|8|9][0-9]\d{8}$/,message:"请输入正确的手机号码",trigger:"blur"}],userEmail:[{required:!0,message:"邮箱地址不能为空",trigger:"blur"},{type:"email",message:"请输入正确的邮箱地址",trigger:["blur","change"]}]}}},created:function(){this.getList()},methods:{chanageMessageType:function(e){this.phoneshow=1!=e,this.emailshow=1==e},getList:function(){var e=this;this.loading=!0,i(this.queryParams).then((function(t){e.sysList=t.data,e.total=t.total,e.loading=!1}))},cancel:function(){this.open=!1,this.reset()},reset:function(){this.form={id:null,sysName:null,ip:null,userName:null,userPassword:null,ipPort:null,rsaAddr:null,isOnline:null,createBy:null,createTime:null,updateBy:null,updateTime:null,remark:null,tenantId:null,messageType:0,userPhone:null,userEmail:null},this.resetForm("form")},handleQuery:function(){this.queryParams.pageNum=1,this.getList()},resetQuery:function(){this.resetForm("queryForm"),this.handleQuery()},handleSelectionChange:function(e){this.ids=e.map((function(e){return e.id})),this.single=1!==e.length,this.multiple=!e.length},handleAdd:function(){this.reset(),this.open=!0,this.title="添加服务器管理",this.phoneshow=1!=this.form.messageType,this.emailshow=1==this.form.messageType},handleUpdate:function(e){var t=this;this.reset();var a=e.id||this.ids;o(a).then((function(e){t.form=e.data,t.open=!0,t.title="修改服务器管理",t.phoneshow=1!=t.form.messageType,t.emailshow=1==t.form.messageType}))},submitForm:function(){var e=this;this.$refs["form"].validate((function(t){t&&(null!=e.form.id?u(e.form).then((function(t){e.$modal.msgSuccess("修改成功"),e.open=!1,e.getList()})):m(e.form).then((function(t){e.$modal.msgSuccess("新增成功"),e.open=!1,e.getList()})))}))},handleDelete:function(e){var t=this,a=e.id||this.ids;this.$modal.confirm("是否确认删除当前服务器管理数据项?").then((function(){return c(a)})).then((function(){t.getList(),t.$modal.msgSuccess("删除成功")})).catch((function(){}))},handleExport:function(){this.download("monitor/sys/export",Object(l["a"])({},this.queryParams),"服务器管理_".concat(Object(d["f"])((new Date).getTime(),"{y}-{m}-{d}"),".xlsx"))},testLink:function(){var e=this;p(this.form).then((function(t){"error"==t.data?e.$modal.msgError("连接失败!"):e.$modal.msgSuccess("连接成功!")}))}}},f=h,y=a("2877"),g=Object(y["a"])(f,r,s,!1,null,null,null);t["default"]=g.exports}}]);