lepu-test-platform-web/dist/static/js/18.ed9a1dfedd699e4d2dce.js

2 lines
9.9 KiB
JavaScript
Raw Normal View History

webpackJsonp([18],{lPJ6:function(e,t,a){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var l=a("mvHQ"),o=a.n(l),i=a("bOdI"),n=a.n(i),r=(a("D/fc"),{data:function(){var e;return e={dbNames:[],timeout:null,itemOptions:["commnon","outer"],userOptions:[],detailForm:{envCheckList:[]},editForm:{},input:"",sqlList:[],addForm:{dbName:"",operatorTime:"",operatorPerson:"",sqlStatement:"",syncEnv:"",envCheckList:[]},operatorPerson:JSON.parse(localStorage.getItem("userInfo")).nick,dialogVisible:!1,detailDialogVisible:!1,queryInfo:{dbName:"",tableName:"",operatorPerson:"",pageNum:1,pageSize:10},currpage:1,itemList:[],total:0,envOptions:[]},n()(e,"timeout",null),n()(e,"addFormRules",{dbName:[{required:!0,message:"请输入数据库名称",trigger:"blur"}],sqlStatement:[{required:!0,message:"请输入sql语句",trigger:"blur"}],envCheckList:[{type:"array",required:!0,message:"请至少选择一个环境",trigger:"change"}]}),e},mounted:function(){this.getAllUserInfo(),this.queryAllDbName()},created:function(){this.queryAllSqlData()},methods:{handleSizeChange:function(e){this.queryInfo.pageSize=e,this.queryAllSqlData()},handleCurrentChange:function(e){this.queryInfo.pageNum=e,this.queryAllSqlData()},getAllUserInfo:function(){var e=this;this.$api.user.queryAllUserInfo().then(function(t){e.userOptions=t.data.data}).catch(function(){})},queryAllDbName:function(){var e=this,t=[];this.$api.sql.queryAllDbName().then(function(a){for(var l in e.envOptions=a.data.data,e.envOptions)t.push({id:e.envOptions[l].id,dbName:e.envOptions[l].dbName});e.dbNames=t,console.log(e.dbNames)}).catch(function(){return e.loading=!1,dbNames})},queryAllSqlData:function(){var e=this;this.$api.sql.queryAllSqlData(o()(this.queryInfo)).then(function(t){e.loading=!1,e.sqlList=t.data.data,e.total=t.data.count,console.log(t.data)}).catch(function(){e.loading=!1})},insertSqlConfigHistoryInfo:function(){var e=this;this.$refs.addFormRef.validate(function(t){if(t){if(e.addForm.operatorTime=e.$common.getCurrentDateTime(),e.addForm.operatorPerson=e.operatorPerson,e.addForm.envCheckList){for(var a="",l=0;l<e.addForm.envCheckList.length;l++)a+=e.addForm.envCheckList[l]+",";a=a.substring(0,a.lastIndexOf(",")),e.addForm.syncEnv=a}console.log(e.addForm),e.$api.sql.insertSqlConfigHistoryInfo(o()(e.addForm)).then(function(t){e.$notify({message:t.data.msg,type:"success"}),e.dialogVisible=!1,e.queryAllSqlData(),e.$refs.addFormRef.resetFields(),e.loading=!1}).catch(function(){e.loading=!1})}})},delsqlStatement:function(e){var t=this;this.$confirm("确定删除吗?","提示",{confirmButtonText:"确定",cancelButtonText:"取消",type:"warning"}).then(function(){t.$api.sql.deleteSqlStatementById(e).then(function(e){t.$notify({type:"success",message:e.data.msg}),t.selectSqlConfig()}).catch(function(){t.loading=!1})}).catch(function(){})},insertSqlConfigHistoryInfoAgain:function(){var e=this;this.dialogVisible=!1,this.$refs.detailFormRef.validate(function(t){if(t){if(e.detailForm.operatorTime=e.$common.getCurrentDateTime(),e.detailForm.operatorPerson=e.operatorPerson,e.addForm.envCheckList){for(var a="",l=0;l<e.addForm.envCheckList.length;l++)a+=e.addForm.envCheckList[l]+",";a=a.substring(0,a.lastIndexOf(",")),e.detailForm.syncEnv=a}console.log(e.detailForm),e.$api.sql.insertSqlConfigHistoryInfo(o()(e.detailForm)).then(function(t){e.$notify({message:t.data.msg,type:"success"}),e.detailDialogVisible=!1,e.selectSqlConfig(),e.$refs.detailFormRef.resetFields(),e.loading=!1}).catch(function(){e.loading=!1})}})},cancelDialogVisible:function(){this.$refs.addFormRef.resetFields(),this.dialogVisible=!1},canceldetailDialogVisible:function(){this.detailDialogVisible=!1},selectSqlConfig:function(){this.queryInfo.pageNum=1,this.total=0,this.queryAllSqlData()},showDetailDialog:function(e){var t=this;this.detailDialogVisible=!0,this.$api.sql.selectSqlConfigHistoryInfoById(e).then(function(e){t.$refs.detailFormRef.resetFields(),t.loading=!1,t.detailForm=e.data.data}).catch(function(){t.loading=!1})},querySearchAsync:function(e,t){for(var a=this.dbNames,l=0;l<a.length;l++)a[l].value=a[l].dbName
//# sourceMappingURL=18.ed9a1dfedd699e4d2dce.js.map