webpackJsonp([11],{"/rCC":function(e,t,a){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=a("mvHQ"),o=a.n(r),n={data:function(){return{cronPopover:!1,createform:{name:"",description:"",scheduleMode:"MANUAL",cronExpression:"",sourceConnectionId:"请选择",sourceSchema:"",includeOrExclude:"",sourceTables:[],tableNameMapper:[],columnNameMapper:[],targetConnectionId:"请选择",targetDropTable:!0,targetOnlyCreate:!1,targetSchema:"",batchSize:5e3},rules:{name:[{required:!0,message:"任务名称不能为空",trigger:"blur"}],scheduleMode:[{required:!0,type:"string",message:"调度方式必须选择",trigger:"change"}],sourceConnectionId:[{required:!0,type:"integer",message:"必选选择一个来源端",trigger:"change"}],sourceSchema:[{required:!0,type:"string",message:"必选选择一个Schema名",trigger:"change"}],includeOrExclude:[{required:!0,type:"string",message:"配置方式必须选择",trigger:"change"}],sourceTables:[{required:!1,type:"array",message:"必选选择一个Table名",trigger:"change"}],targetConnectionId:[{required:!0,type:"integer",message:"必选选择一个目的端",trigger:"change"}],targetSchema:[{required:!0,type:"string",message:"必选选择一个Schema名",trigger:"change"}],batchSize:[{required:!0,type:"integer",message:"必选选择一个批大小",trigger:"change"}]},active:1,sourceConnection:{},targetConnection:{},sourceConnectionSchemas:[],sourceSchemaTables:[],targetConnectionSchemas:[],tableNameMapperDialogVisible:!1,columnNameMapperDialogVisible:!1,tableNamesMapperData:[],columnNamesMapperData:[],preiveSeeTableNameList:[],preiveTableName:""}},methods:{handleClose:function(e){},next:function(){this.active++>4&&(this.active=5)},pre:function(){this.active--<2&&(this.active=1)},loadConnections:function(){var e=this;this.connectionNameList=[],this.$http({method:"GET",url:"/dbswitch/admin/api/v1/connection/list/name"}).then(function(t){0===t.data.code?e.connectionNameList=t.data.data:t.data.message&&(alert("加载任务列表失败:"+t.data.message),e.connectionNameList=[])},function(){console.log("failed")})},changeCreateCronExpression:function(e){this.createform.cronExpression=e},selectChangedSourceConnection:function(e){var t=this;this.sourceConnection=this.connectionNameList.find(function(t){return t.id===e}),this.sourceConnectionSchemas=[],this.$http.get("/dbswitch/admin/api/v1/connection/schemas/get/"+e).then(function(e){0===e.data.code?t.sourceConnectionSchemas=e.data.data:(t.$message.error("查询来源端数据库的Schema失败,"+e.data.message),t.sourceConnectionSchemas=[])})},selectCreateChangedSourceSchema:function(e){var t=this;this.sourceSchemaTables=[],this.$http.get("/dbswitch/admin/api/v1/connection/tables/get/"+this.createform.sourceConnectionId+"?schema="+e).then(function(e){0===e.data.code?t.sourceSchemaTables=e.data.data:(t.$message.error("查询来源端数据库在制定Schema下的表列表失败,"+e.data.message),t.sourceSchemaTables=[])})},selectChangedTargetConnection:function(e){var t=this;this.targetConnection=this.connectionNameList.find(function(t){return t.id===e}),this.targetConnectionSchemas=[],this.$http.get("/dbswitch/admin/api/v1/connection/schemas/get/"+e).then(function(e){0===e.data.code?t.targetConnectionSchemas=e.data.data:(t.$message.error("查询目的端数据库的Schema失败,"+e.data.message),t.targetConnectionSchemas=[])})},addTableNameMapperListRow:function(){this.createform.tableNameMapper.push({fromPattern:"",toValue:""})},deleteTableNameMapperListItem:function(e){this.createform.tableNameMapper.splice(e,1)},previewTableNameMapList:function(){var e=this;!this.createform.sourceConnectionId||this.createform.sourceConnectionId<0||!this.createform.sourceSchema||0==this.createform.sourceSchema.length?alert("请选择【源端数据源】和【源端模式名】!"):this.$http({method:"POST",headers:{"Content-Type":"application/json"},url:"/dbswitch/admin/api/v1/mapper/preview/table",data:o()({id:this.createform.sourceConnectionId,schemaName:this.createform.sourceSchema,isInclude:"INCLUDE"==this.createform.includeOrExclude,tableNames:this.createform.sourceTables,nameMapper:this.createform.tableNameMapper})}).then(function(t){0===t.data.code?(e.tableNamesMapperData=t.data.data,e.tableNameMapperDialogVisible=!0):(e.tableNamesMapperData=[],t.data.message&&alert(t.data.message))})},addColumnNameMapperListRow:function(){this.createform.columnNameMapper.push({fromPattern:"",toValue:""})},deleteColumnNameMapperListItem:function(e){this.createform.columnNameMapper.splice(e,1)},previewColumnNameMapList:function(){var e=this;if(!this.createform.sourceConnectionId||this.createform.sourceConnectionId<=0||!this.createform.sourceSchema||0==this.createform.sourceSchema.length)alert("请选择【源端数据源】和【源端模式名】!");else if(this.createform.includeOrExclude){if("INCLUDE"==this.createform.includeOrExclude)0==this.createform.sourceTables.length?this.preiveSeeTableNameList=this.sourceSchemaTables:this.preiveSeeTableNameList=this.createform.sourceTables;else{if(0==this.createform.sourceTables.length)return void alert("请选择排除表的【表名配置】!");this.preiveSeeTableNameList=JSON.parse(o()(this.sourceSchemaTables));for(var t=0;t0?a("table",{staticClass:"name-mapper-table"},[a("tr",[a("th",[e._v("表名匹配的正则名")]),e._v(" "),a("th",[e._v("替换的目标值")])]),e._v(" "),e._l(e.createform.tableNameMapper,function(t,r){return a("tr",{key:r},[a("td",[e._v(e._s(t.fromPattern))]),e._v(" "),a("td",[e._v(e._s(t.toValue))])])})],2):e._e()]),e._v(" "),a("el-descriptions-item",{attrs:{label:"字段名映射规则"}},[a("span",{directives:[{name:"show",rawName:"v-show",value:0==e.createform.columnNameMapper.length,expression:"createform.columnNameMapper.length==0"}]},[e._v("[映射关系为空]")]),e._v(" "),e.createform.columnNameMapper.length>0?a("table",{staticClass:"name-mapper-table"},[a("tr",[a("th",[e._v("字段名匹配的正则名")]),e._v(" "),a("th",[e._v("替换的目标值")])]),e._v(" "),e._l(e.createform.columnNameMapper,function(t,r){return a("tr",{key:r},[a("td",[e._v(e._s(t.fromPattern))]),e._v(" "),a("td",[e._v(e._s(t.toValue))])])})],2):e._e()])],1)],1)]),e._v(" "),e.active>1?a("el-button",{staticStyle:{"margin-top":"12px"},attrs:{round:""},on:{click:e.pre}},[e._v("\n 上一步\n ")]):e._e(),e._v(" "),e.active>0&&e.active<5?a("el-button",{attrs:{round:""},on:{click:e.next}},[e._v("\n 下一步\n ")]):e._e(),e._v(" "),5==e.active?a("el-button",{attrs:{round:""},on:{click:e.handleSave}},[e._v("\n 提交\n ")]):e._e(),e._v(" "),4==e.active?a("el-dialog",{attrs:{title:"查看表名映射关系",visible:e.tableNameMapperDialogVisible,showClose:!1,"before-close":e.handleClose},on:{"update:visible":function(t){e.tableNameMapperDialogVisible=t}}},[a("el-table",{attrs:{"header-cell-style":{background:"#eef1f6",color:"#606266"},data:e.tableNamesMapperData,size:"mini",border:""}},[a("el-table-column",{attrs:{prop:"originalName",label:"源端表名","min-width":"20%"}}),e._v(" "),a("el-table-column",{attrs:{prop:"targetName",label:"目标表名","min-width":"20%"}})],1),e._v(" "),a("div",{staticClass:"dialog-footer",attrs:{slot:"footer"},slot:"footer"},[a("el-button",{on:{click:function(t){e.tableNameMapperDialogVisible=!1}}},[e._v("关闭")])],1)],1):e._e(),e._v(" "),4==e.active?a("el-dialog",{attrs:{title:"查看字段影射关系",visible:e.columnNameMapperDialogVisible,showClose:!1,"before-close":e.handleClose},on:{"update:visible":function(t){e.columnNameMapperDialogVisible=t}}},[a("el-select",{attrs:{placeholder:"请选择"},on:{change:e.queryPreviewColumnNameMapperList},model:{value:e.preiveTableName,callback:function(t){e.preiveTableName=t},expression:"preiveTableName"}},e._l(e.preiveSeeTableNameList,function(e,t){return a("el-option",{key:t,attrs:{label:e,value:e}})}),1),e._v(" "),a("el-table",{attrs:{"header-cell-style":{background:"#eef1f6",color:"#606266"},data:e.columnNamesMapperData,size:"mini",border:""}},[a("el-table-column",{attrs:{prop:"originalName",label:"原始字段名","min-width":"20%"}}),e._v(" "),a("el-table-column",{attrs:{prop:"targetName",label:"目标表字段名","min-width":"20%"}})],1),e._v(" "),a("div",{staticClass:"dialog-footer",attrs:{slot:"footer"},slot:"footer"},[a("el-button",{on:{click:function(t){e.columnNameMapperDialogVisible=!1}}},[e._v("关闭")])],1)],1):e._e()],1)},staticRenderFns:[]};var s=a("VU/8")(n,l,!1,function(e){a("5pBK")},"data-v-7e3fc275",null);t.default=s.exports},"5pBK":function(e,t){}}); //# sourceMappingURL=11.095e904476d1f54d76ff.js.map