!226 优化及添加tdengine

* 修改默认端口
* 更新dist
* 添加tdengine
* 优化任务详情
* 优化任务详情
* 添加tdengine
* 添加tdengine
* 优化任务详情
* Merge remote-tracking branch 'remote/master'
* 模式名超出部分截断问题
* 优化任务详情
* 优化任务详情
* Merge remote-tracking branch 'remote/master'
* 任务详情优化
* 回滚配置信息
* 回滚配置信息
* 任务列表优化
* 代码优化
* 代码优化
* Merge remote-tracking branch 'upstream/master'
* Merge remote-tracking branch 'upstream/master'
* 任务管理 同步数据,增加指定SQL
* 任务管理 同步数据,增加指定SQL
* Merge remote-tracking branch 'upstream/master'
* 任务管理优化 10%
* Merge remote-tracking branch 'upstream/master'
* 优化任务管理详情
* 优化
* 优化
* Merge remote-tracking branch 'remote/master'
* 左侧列表优化
* 优化数据导航
* 优化样式
* Merge remote-tracking branch 'remote/master'
* 任务管理优化 10%
* 任务管理优化 10%
* Merge remote-tracking branch 'origin/master'
* Merge remote-tracking branch 'origin/master'
* Merge remote-tracking branch 'remote/master'
* Merge remote-tracking branch 'upstream/master'
* 数据导航优化
* 数据导航优化
* 删除数据源ID
* 驱动配置类型展示优化
* sync remote
* 删除任务详情展示限制
* 调度时间 添加默认值
* Merge remote-tracking branch 'remote/master'
* 更新dbswitch-admin/resources静态资源文件
* Merge remote-tracking branch 'origin/master'
* 解决 【npm run build】 打包报错问题
This commit is contained in:
叶子.
2024-12-19 11:32:48 +00:00
committed by inrgihc
parent 774426b74e
commit 52a955d9c8
22 changed files with 1690 additions and 261 deletions

Binary file not shown.

Before

Width:  |  Height:  |  Size: 55 KiB

After

Width:  |  Height:  |  Size: 2.7 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.5 KiB

View File

@@ -119,6 +119,12 @@ const constantRouter = new Router({
hidden: true,
component: () => import('@/views/task/detail')
},
{
path: '/task/detail_old',
name: '查看任务(原)',
hidden: true,
component: () => import('@/views/task/detail_old')
},
{
path: '/connection/list/addDataSource1',
name: '数据源创建步骤1',

View File

@@ -49,33 +49,15 @@
min-width="10%"></el-table-column>
<el-table-column label="操作"
min-width="35%">
<template slot-scope="scope">
<el-button-group>
<el-button size="small"
type="danger"
icon="el-icon-video-play"
@click="handleTest(scope.$index, scope.row)"
round>测试
</el-button>
<el-button size="small"
type="primary"
icon="el-icon-document"
@click="handleMore(scope.$index, scope.row)"
round>详情
</el-button>
<el-button size="small"
type="warning"
icon="el-icon-edit"
@click="handleUpdate(scope.$index, scope.row)"
round>编辑
</el-button>
<el-button size="small"
type="success"
icon="el-icon-delete"
@click="handleDelete(scope.$index, scope.row)"
round>删除
</el-button>
</el-button-group>
<el-link class="btn-text" type="primary" @click="handleTest(scope.$index, scope.row)">测试</el-link>
<label class="btn-style">&nbsp;|&nbsp;</label>
<el-link class="btn-text" type="primary" @click="handleUpdate(scope.$index, scope.row)">编辑</el-link>
<label class="btn-style">&nbsp;|&nbsp;</label>
<el-link class="btn-text" type="primary" @click="handleMore(scope.$index, scope.row)">详情</el-link>
<label class="btn-style">&nbsp;|&nbsp;</label>
<el-link class="btn-text" type="primary" @click="handleDelete(scope.$index, scope.row)">删除</el-link>
</template>
</el-table-column>
</el-table>
@@ -347,4 +329,13 @@ export default {
margin-left: auto;
margin: 10px 5px;
}
.btn-style {
color: #e9e9f3;
}
.btn-text {
font-size: 12px;
color: #6873ce;
}
</style>

View File

@@ -22,7 +22,7 @@
type="primary"
size="mini"
icon="el-icon-document-add"
@click="handleCreate">创建
@click="handleCreate">创建任务
</el-button>
</el-row>
<div class="assignment-list-top">
@@ -73,7 +73,7 @@
<p>源端模式名{{ scope.row.sourceSchema }}</p>
<div slot="reference"
class="name-wrapper">
<el-tag size="medium">{{ scope.row.sourceSchema }}</el-tag>
<el-tag size="medium" class="name-wrapper-tag">{{ scope.row.sourceSchema }}</el-tag>
</div>
</el-popover>
</template>
@@ -87,7 +87,7 @@
<p>目标端模式名{{ scope.row.targetSchema }}</p>
<div slot="reference"
class="name-wrapper">
<el-tag size="medium">{{ scope.row.targetSchema }}</el-tag>
<el-tag size="medium" class="name-wrapper-tag">{{ scope.row.targetSchema }}</el-tag>
</div>
</el-popover>
</template>
@@ -125,62 +125,85 @@
<el-table-column label="操作"
min-width="35%">
<template slot-scope="scope">
<el-button-group>
<el-tooltip content="跳转到调度监控"
placement="top">
<el-button size="small"
type="primary"
icon="el-icon-timer"
v-if="scope.row.isPublished===true"
@click="schedulingLog(scope.$index, scope.row)"
round>日志
</el-button>
</el-tooltip>
<el-button size="small"
type="primary"
icon="el-icon-timer"
v-if="scope.row.isPublished===false"
@click="handlePublish(scope.$index, scope.row)"
round>启动
</el-button>
<el-button size="small"
type="info"
icon="el-icon-delete-location"
v-if="scope.row.isPublished===true"
@click="handleRetireTask(scope.$index, scope.row)"
round>停用
</el-button>
<el-tooltip content="人工触发调度执行"
placement="top">
<el-button size="small"
type="danger"
icon="el-icon-video-play"
v-if="scope.row.isPublished===true"
@click="handleRunTask(scope.$index, scope.row)"
round>执行
</el-button>
</el-tooltip>
<el-button size="small"
type="warning"
icon="el-icon-edit"
v-if="scope.row.isPublished===false"
@click="handleUpdate(scope.$index, scope.row)"
round>修改
</el-button>
<el-button size="small"
type="success"
icon="el-icon-document"
@click="handleDetail(scope.$index, scope.row)"
round>详情
</el-button>
<el-button size="small"
type="danger"
icon="el-icon-delete"
v-if="scope.row.isPublished===false"
@click="handleDelete(scope.$index, scope.row)"
round>删除
</el-button>
</el-button-group>
<el-tooltip content="跳转到监控调度" placement="top">
<el-link class="btn-text" type="primary" @click="schedulingLog(scope.$index, scope.row)">日志</el-link>
</el-tooltip>
<label class="btn-style">&nbsp;|&nbsp;</label>
<el-link class="btn-text" type="primary" v-if="scope.row.isPublished===false"
@click="handlePublish(scope.$index, scope.row)">启动</el-link>
<el-link class="btn-text" type="primary" v-if="scope.row.isPublished===true"
@click="handleRetireTask(scope.$index, scope.row)">停止</el-link>
<label v-if="scope.row.isPublished===true" class="btn-style">&nbsp;|&nbsp;</label>
<el-link class="btn-text" type="primary" v-if="scope.row.isPublished===true"
@click="handleRunTask(scope.$index, scope.row)">执行</el-link>
<label v-if="scope.row.isPublished===false" class="btn-style">&nbsp;|&nbsp;</label>
<el-link class="btn-text" type="primary" v-if="scope.row.isPublished===false"
@click="handleUpdate(scope.$index, scope.row)">修改</el-link>
<label class="btn-style">&nbsp;|&nbsp;</label>
<el-link class="btn-text" type="primary"
@click="handleDetail(scope.$index, scope.row)">详情</el-link>
<label v-if="scope.row.isPublished===false" class="btn-style">&nbsp;|&nbsp;</label>
<el-link class="btn-text" type="primary" v-if="scope.row.isPublished===false"
@click="handleDelete(scope.$index, scope.row)">删除</el-link>
<!-- <label class="btn-style">&nbsp;|&nbsp;</label>-->
<!-- <el-link class="btn-text" type="primary"-->
<!-- @click="handleDetailOld(scope.$index, scope.row)">老详情</el-link>-->
<!-- <el-button-group>-->
<!-- <el-button size="small"-->
<!-- type="primary"-->
<!-- icon="el-icon-timer"-->
<!-- v-if="scope.row.isPublished===false"-->
<!-- @click="handlePublish(scope.$index, scope.row)"-->
<!-- round>启动-->
<!-- </el-button>-->
<!-- <el-button size="small"-->
<!-- type="info"-->
<!-- icon="el-icon-delete-location"-->
<!-- v-if="scope.row.isPublished===true"-->
<!-- @click="handleRetireTask(scope.$index, scope.row)"-->
<!-- round>停用-->
<!-- </el-button>-->
<!-- <el-tooltip content="人工触发调度执行"-->
<!-- placement="top">-->
<!-- <el-button size="small"-->
<!-- type="danger"-->
<!-- icon="el-icon-video-play"-->
<!-- v-if="scope.row.isPublished===true"-->
<!-- @click="handleRunTask(scope.$index, scope.row)"-->
<!-- round>执行-->
<!-- </el-button>-->
<!-- </el-tooltip>-->
<!-- <el-button size="small"-->
<!-- type="warning"-->
<!-- icon="el-icon-edit"-->
<!-- v-if="scope.row.isPublished===false"-->
<!-- @click="handleUpdate(scope.$index, scope.row)"-->
<!-- round>修改-->
<!-- </el-button>-->
<!-- <el-button size="small"-->
<!-- type="success"-->
<!-- icon="el-icon-document"-->
<!-- @click="handleDetail(scope.$index, scope.row)"-->
<!-- round>详情-->
<!-- </el-button>-->
<!-- <el-button size="small"-->
<!-- type="danger"-->
<!-- icon="el-icon-delete"-->
<!-- v-if="scope.row.isPublished===false"-->
<!-- @click="handleDelete(scope.$index, scope.row)"-->
<!-- round>删除-->
<!-- </el-button>-->
<!-- <el-tooltip content="跳转到调度监控"-->
<!-- placement="top">-->
<!-- <el-button size="small"-->
<!-- type="primary"-->
<!-- icon="el-icon-timer"-->
<!-- @click="schedulingLog(scope.$index, scope.row)"-->
<!-- round>日志-->
<!-- </el-button>-->
<!-- </el-tooltip>-->
<!-- </el-button-group>-->
</template>
</el-table-column>
</el-table>
@@ -247,9 +270,9 @@ export default {
},
boolFormatPublish (row, column) {
if (row.isPublished === true) {
return "启动";
return "启动";
} else {
return "停止";
return "停止";
}
},
scheduleTimeFormat (row, column) {
@@ -382,7 +405,10 @@ export default {
this.$router.push('/task/create')
},
handleDetail: function (index, row) {
this.$router.push({ path: '/task/detail', query: { id: row.id } })
this.$router.push({ path: '/task/detail', query: { id: row.id, record: row } })
},
handleDetailOld: function (index, row) {
this.$router.push({ path: '/task/detail_old', query: { id: row.id } })
},
handleUpdate: function (index, row) {
this.$router.push({ path: '/task/update', query: { id: row.id } })
@@ -592,4 +618,19 @@ export default {
text-decoration: underline;
}
.btn-style {
color: #e9e9f3;
}
.btn-text {
font-size: 12px;
color: #6873ce;
}
.name-wrapper-tag {
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
max-width: 100%;
}
</style>

View File

@@ -1,168 +1,386 @@
<template>
<el-card>
<el-form :model="updateform"
status-icon
ref="updateform">
<el-descriptions size="small"
:column="1"
label-class-name="el-descriptions-item-label-class"
border>
<el-descriptions-item label="任务名称">{{ updateform.name }}</el-descriptions-item>
<el-descriptions-item label="任务描述">{{ updateform.description }}</el-descriptions-item>
<el-descriptions-item label="集成模式">
<span v-if="updateform.scheduleMode == 'MANUAL'">
<div class="app-container">
<el-tabs v-model="activeName" @tab-click="handleClick">
<el-tab-pane label="基本信息" name="first">
<el-card class="box-card">
<el-row class="row-gutter">
<el-col :span="2">
<label class="key-text">任务ID</label>
</el-col>
<el-col :span="6">
<label class="value-text">{{ infoform.id }}</label>
</el-col>
<el-col :span="2">
<label class="key-text">任务名称</label>
</el-col>
<el-col :span="6">
<label class="value-text">{{ infoform.name }}</label>
</el-col>
<el-col :span="2">
<label class="key-text">任务类型</label>
</el-col>
<el-col :span="6">
<label class="value-text">
普通任务
</label>
</el-col>
</el-row>
<el-row class="row-gutter">
<el-col :span="2">
<label class="key-text">任务状态</label>
</el-col>
<el-col :span="6">
<label class="value-text">
{{ $route.query.record.runStatus }}
</label>
</el-col>
<el-col :span="2">
<label class="key-text">运行状态</label>
</el-col>
<el-col :span="6">
<label class="value-text">
{{ $route.query.record.isPublished === true ? '启动' : '停止' }}
</label>
</el-col>
<el-col :span="2">
<label class="key-text">集成模式</label>
</el-col>
<el-col :span="6">
<label class="value-text"><span v-if="infoform.scheduleMode == 'MANUAL'">
手动
</span>
<span v-if="updateform.scheduleMode == 'SYSTEM_SCHEDULED'">
<span v-if="infoform.scheduleMode == 'SYSTEM_SCHEDULED'">
定时
</span>
</el-descriptions-item>
<el-descriptions-item v-if="updateform.scheduleMode == 'SYSTEM_SCHEDULED'"
label="CRON表达式">{{ updateform.cronExpression }}
</el-descriptions-item>
<el-descriptions-item label="源端数据源">[{{ updateform.sourceConnectionId }}]
{{ updateform.sourceConnectionName }}
</el-descriptions-item>
<el-descriptions-item label="源端schema">{{ updateform.sourceSchema }}</el-descriptions-item>
<el-descriptions-item label="源端表类型">{{ updateform.tableType }}</el-descriptions-item>
<el-descriptions-item label="源端表选择方式">
<span v-if="updateform.includeOrExclude == 'INCLUDE'">
包含表
</span>
<span v-if="updateform.includeOrExclude == 'EXCLUDE'">
排除表
</span>
</el-descriptions-item>
<el-descriptions-item label="源端表名列表">
<span
v-show="updateform.includeOrExclude == 'INCLUDE' && (!updateform.sourceTables || updateform.sourceTables.length==0)"><b>所有物理表</b></span>
<p v-for="item in updateform.sourceTables"
v-bind:key="item">{{ item }}</p>
</el-descriptions-item>
<el-descriptions-item label="目地端数据源">[{{ updateform.targetConnectionId }}]
{{ updateform.targetConnectionName }}
</el-descriptions-item>
<el-descriptions-item label="目地端schema">{{ updateform.targetSchema }}</el-descriptions-item>
<el-descriptions-item label="自动同步模式">
<span v-if="updateform.autoSyncMode == 2">
目标端建表并同步数据
</span>
<span v-if="updateform.autoSyncMode == 1">
目标端只创建物理表
</span>
<span v-if="updateform.autoSyncMode == 0">
目标端只同步表里数据
</span>
</el-descriptions-item>
<el-descriptions-item label="建表字段自增"
v-if=" updateform.autoSyncMode!==0 ">{{ updateform.targetAutoIncrement }}
</el-descriptions-item>
<el-descriptions-item label="表名转换方法"
v-if=" updateform.autoSyncMode!==0 ">
<span v-if="updateform.tableNameCase == 'NONE'">
无转换
</span>
<span v-if="updateform.tableNameCase == 'UPPER'">
转大写
</span>
<span v-if="updateform.tableNameCase == 'LOWER'">
转小写
</span>
<span v-if="updateform.tableNameCase == 'CAMEL'">
下划线转驼峰
</span>
<span v-if="updateform.tableNameCase == 'SNAKE'">
驼峰转下换线
</span>
</el-descriptions-item>
<el-descriptions-item label="列名转换方法"
v-if=" updateform.autoSyncMode!==0 ">
<span v-if="updateform.columnNameCase == 'NONE'">
无转换
</span>
<span v-if="updateform.columnNameCase == 'UPPER'">
转大写
</span>
<span v-if="updateform.columnNameCase == 'LOWER'">
转小写
</span>
<span v-if="updateform.columnNameCase == 'CAMEL'">
下划线转驼峰
</span>
<span v-if="updateform.columnNameCase == 'SNAKE'">
驼峰转下换线
</span>
</el-descriptions-item>
<el-descriptions-item label="数据批次大小"
v-if=" updateform.autoSyncMode!==1 ">{{ updateform.batchSize }}
</el-descriptions-item>
<el-descriptions-item label="通道队列大小"
v-if=" updateform.autoSyncMode!==1 ">{{ updateform.channelSize }}
</el-descriptions-item>
<el-descriptions-item label="同步操作方法"
v-if=" updateform.autoSyncMode!==1 ">{{ updateform.targetSyncOption }}
</el-descriptions-item>
<el-descriptions-item label="同步前置执行SQL脚本"
v-if=" updateform.autoSyncMode!==1 ">
<span v-show="!updateform.beforeSqlScripts || updateform.beforeSqlScripts.length==0">[SQL脚本内容为空]</span>
<span
v-show="updateform.beforeSqlScripts && updateform.beforeSqlScripts.length>0">{{ updateform.beforeSqlScripts }}</span>
</el-descriptions-item>
<el-descriptions-item label="同步后置执行SQL脚本"
v-if=" updateform.autoSyncMode!==1 ">
<span v-show="!updateform.afterSqlScripts || updateform.afterSqlScripts.length==0">[SQL脚本内容为空]</span>
<span
v-show="updateform.afterSqlScripts && updateform.afterSqlScripts.length>0">{{ updateform.afterSqlScripts }}</span>
</el-descriptions-item>
<el-descriptions-item label="表名映射规则">
<span v-show="!updateform.tableNameMapper || updateform.tableNameMapper.length==0">[映射关系为空]</span>
<table v-if="updateform.tableNameMapper && updateform.tableNameMapper.length>0"
class="name-mapper-table">
<tr>
<th>表名匹配的正则名</th>
<th>替换的目标值</th>
</tr>
<tr v-for='(item,index) in updateform.tableNameMapper'
:key="index">
<td>{{ item['fromPattern'] }}</td>
<td>{{ item['toValue'] }}</td>
</tr>
</table>
</el-descriptions-item>
<el-descriptions-item label="字段名映射规则">
<span v-show="!updateform.columnNameMapper || updateform.columnNameMapper.length==0">[映射关系为空]</span>
<table v-if="updateform.columnNameMapper && updateform.columnNameMapper.length>0"
class="name-mapper-table">
<tr>
<th>字段名匹配的正则名</th>
<th>替换的目标值</th>
</tr>
<tr v-for='(item,index) in updateform.columnNameMapper'
:key="index">
<td>{{ item['fromPattern'] }}</td>
<td>{{ item['toValue'] }}</td>
</tr>
</table>
</el-descriptions-item>
</el-descriptions>
</span></label>
</el-col>
</el-row>
<el-row class="row-gutter">
<el-col :span="2">
<label class="key-text">调度计划</label>
</el-col>
<el-col :span="6">
<label class="value-text">
<span v-if="infoform.scheduleMode == 'MANUAL'">
--
</span>
<span v-if="infoform.scheduleMode == 'SYSTEM_SCHEDULED'">
{{ infoform.cronExpression }}
</span>
</label>
</el-col>
<el-col :span="2">
<label class="key-text">开始调度时间</label>
</el-col>
<el-col :span="6">
<label class="value-text">{{ $route.query.record.scheduleTime }}</label>
</el-col>
<el-col :span="2">
<label class="key-text">创建时间</label>
</el-col>
<el-col :span="6">
<label class="value-text">{{ $route.query.record.createTime }}</label>
</el-col>
</el-row>
<el-row class="row-gutter">
<el-col :span="2">
<label class="key-text">描述</label>
</el-col>
<el-col :span="6">
<label class="value-text">{{ infoform.description }}</label>
</el-col>
<el-col :span="2">
<label class="key-text">任务标签</label>
</el-col>
<el-col :span="6">
<label class="value-text">--</label>
</el-col>
<el-col :span="8">
</el-col>
</el-row>
</el-card>
<div class="common-box">
<div class="datainfo">
<div class="source">
<div class="head">
<div class="head-img">
<el-image
style="width: 60px; height: 60px"
:src="require('@/assets/icons/' + $route.query.record.sourceType +'.png')"
:fit="fit"></el-image>
</div>
<div class="head-text">
<div class="title">{{ infoform.sourceConnectionName }}</div>
<div class="sub-title">源端数据源</div>
</div>
</div>
<div class="body">
<el-row class="row-gutter">
<el-col :span="8">
<label class="key-text">源端schema</label>
</el-col>
<el-col :span="16">
<label class="value-text">{{ infoform.sourceSchema }}</label>
</el-col>
</el-row>
<el-row class="row-gutter">
<el-col :span="8">
<label class="key-text">源端表类型</label>
</el-col>
<el-col :span="16">
<label class="value-text">{{ infoform.tableType }}</label>
</el-col>
</el-row>
<el-row class="row-gutter">
<el-col :span="8">
<label class="key-text">源端表选择方式</label>
</el-col>
<el-col :span="16">
<label class="value-text">{{
infoform.includeOrExclude === 'INCLUDE' ? '包含表' : '排除表'
}}</label>
</el-col>
</el-row>
<el-row class="row-gutter">
<el-col :span="8">
<label class="key-text">源端表名列表</label>
</el-col>
<el-col :span="16">
<label class="value-text" v-for="item in infoform.sourceTables"
v-bind:key="item">{{ item }}</label>
</el-col>
</el-row>
</div>
</div>
<div class="target">
<div class="head">
<div class="head-img">
<el-image
style="width: 60px; height: 60px"
:src="require('@/assets/icons/' + $route.query.record.targetType +'.png')"
:fit="fit"></el-image>
</div>
<div class="head-text">
<div class="title">{{ infoform.targetConnectionName }}</div>
<div class="sub-title">目标端数据源</div>
</div>
</div>
<div class="body">
<el-row class="row-gutter">
<el-col :span="8">
<label class="key-text">目地端schema</label>
</el-col>
<el-col :span="16">
<label class="value-text">{{ infoform.targetSchema }}</label>
</el-col>
</el-row>
<el-row class="row-gutter">
<el-col :span="8">
<label class="key-text">自动同步模式</label>
</el-col>
<el-col :span="16">
<span class="value-text" v-if="infoform.autoSyncMode == 2">
目标端建表并同步数据
</span>
<span class="value-text" v-if="infoform.autoSyncMode == 1">
目标端只创建物理表
</span>
<span class="value-text" v-if="infoform.autoSyncMode == 0">
目标端只同步表里数据
</span>
</el-col>
</el-row>
<el-row class="row-gutter">
<el-col :span="8">
<label class="key-text">建表字段自增</label>
</el-col>
<el-col :span="16">
<label class="value-text"
v-if=" infoform.autoSyncMode!==0 ">{{ infoform.targetAutoIncrement }}
</label>
</el-col>
</el-row>
<el-row class="row-gutter">
<el-col :span="8">
<label class="key-text">表名转换方法</label>
</el-col>
<el-col :span="16">
<label class="value-text" v-if=" infoform.autoSyncMode!==0 ">
<span v-if="infoform.tableNameCase == 'NONE'">
无转换
</span>
<span v-if="infoform.tableNameCase == 'UPPER'">
转大写
</span>
<span v-if="infoform.tableNameCase == 'LOWER'">
转小写
</span>
<span v-if="infoform.tableNameCase == 'CAMEL'">
下划线转驼峰
</span>
<span v-if="infoform.tableNameCase == 'SNAKE'">
驼峰转下换线
</span>
</label>
</el-col>
</el-row>
<el-row class="row-gutter">
<el-col :span="8">
<label class="key-text">列名转换方法</label>
</el-col>
<el-col :span="16">
<label class="value-text" v-if=" infoform.autoSyncMode!==0 ">
<span v-if="infoform.columnNameCase == 'NONE'">
无转换
</span>
<span v-if="infoform.columnNameCase == 'UPPER'">
转大写
</span>
<span v-if="infoform.columnNameCase == 'LOWER'">
转小写
</span>
<span v-if="infoform.columnNameCase == 'CAMEL'">
下划线转驼峰
</span>
<span v-if="infoform.columnNameCase == 'SNAKE'">
驼峰转下换线
</span>
</label>
</el-col>
</el-row>
<el-row class="row-gutter">
<el-col :span="8">
<label class="key-text">数据批次大小</label>
</el-col>
<el-col :span="16">
<label class="value-text"
v-if=" infoform.autoSyncMode!==1 ">{{ infoform.batchSize }}
</label>
</el-col>
</el-row>
<el-row class="row-gutter">
<el-col :span="8">
<label class="key-text">通道队列大小</label>
</el-col>
<el-col :span="16">
<label class="value-text"
v-if=" infoform.autoSyncMode!==1 ">{{ infoform.channelSize }}
</label>
</el-col>
</el-row>
<el-row class="row-gutter">
<el-col :span="8">
<label class="key-text">同步操作方法</label>
</el-col>
<el-col :span="16">
<label class="value-text"
v-if="infoform.autoSyncMode!==1 ">{{ infoform.targetSyncOption }}
</label>
</el-col>
</el-row>
<el-row class="row-gutter">
<el-col :span="8">
<label class="key-text">同步前置执行SQL脚本</label>
</el-col>
<el-col :span="16">
<label class="value-text"
v-if=" infoform.autoSyncMode!==1 ">
<span
v-show="!infoform.beforeSqlScripts || infoform.beforeSqlScripts.length==0">[SQL脚本内容为空]</span>
<span
v-show="infoform.beforeSqlScripts && infoform.beforeSqlScripts.length>0">{{
infoform.beforeSqlScripts
}}</span>
</label>
</el-col>
</el-row>
<el-row class="row-gutter">
<el-col :span="8">
<label class="key-text">同步后置执行SQL脚本</label>
</el-col>
<el-col :span="16">
<label class="value-text"
v-if=" infoform.autoSyncMode!==1 ">
<span
v-show="!infoform.afterSqlScripts || infoform.afterSqlScripts.length==0">[SQL脚本内容为空]</span>
<span
v-show="infoform.afterSqlScripts && infoform.afterSqlScripts.length>0">{{
infoform.afterSqlScripts
}}</span>
</label>
</el-col>
</el-row>
</div>
</div>
</div>
<div class="mapper">
<div class="table-left">
<div>表名映射规则</div>
<div>
<el-table
:data="infoform.tableNameMapper"
style="width: 100%"
:row-class-name="tableRowClassName">
<el-table-column
prop="fromPattern"
label="表名匹配的正则名">
</el-table-column>
<el-table-column
prop="toValue"
label="替换的目标值">
</el-table-column>
</el-table>
</div>
</div>
<div class="table-right">
<div>字段名映射规则</div>
<div>
<el-table
:data="infoform.columnNameMapper"
style="width: 100%"
:row-class-name="tableRowClassName">
<el-table-column
prop="fromPattern"
label="表名匹配的正则名">
</el-table-column>
<el-table-column
prop="toValue"
label="替换的目标值">
</el-table-column>
</el-table>
</div>
</div>
</div>
</div>
</el-tab-pane>
<!-- <el-tab-pane label="调度日志" name="second">调度日志22</el-tab-pane>-->
<!-- <el-tab-pane label="操作日志" name="third">操作日志33</el-tab-pane>-->
</el-tabs>
</div>
</el-form>
<el-button type="primary"
size="mini"
icon="el-icon-arrow-left"
@click="handleGoBack"
style="margin: 12px 0px 20px;float: right">
返回
</el-button>
</el-card>
</template>
<script>
export default {
data() {
return {
updateform: {
activeName: 'first',
infoform: {
id: 0,
name: "",
description: "",
@@ -170,6 +388,7 @@ export default {
cronExpression: "",
sourceConnectionId: '请选择',
sourceSchema: "",
runStatus: "",
tableType: "TABLE",
includeOrExclude: "",
sourceTables: [],
@@ -210,7 +429,8 @@ export default {
} else {
varAutoSyncMode = 2;
}
this.updateform = {
debugger
this.infoform = {
id: detail.id,
name: detail.name,
description: detail.description,
@@ -239,9 +459,9 @@ export default {
beforeSqlScripts: detail.configuration.beforeSqlScripts,
afterSqlScripts: detail.configuration.afterSqlScripts,
}
this.selectChangedSourceConnection(this.updateform.sourceConnectionId)
this.selectUpdateChangedSourceSchema(this.updateform.sourceSchema)
this.selectChangedTargetConnection(this.updateform.targetConnectionId)
this.selectChangedSourceConnection(this.infoform.sourceConnectionId)
this.selectUpdateChangedSourceSchema(this.infoform.sourceSchema)
this.selectChangedTargetConnection(this.infoform.targetConnectionId)
} else {
if (res.data.message) {
alert("查询任务失败," + res.data.message);
@@ -269,9 +489,9 @@ export default {
},
selectUpdateChangedSourceSchema: function (value) {
this.sourceSchemaTables = [];
if ('TABLE' === this.updateform.tableType) {
if ('TABLE' === this.infoform.tableType) {
this.$http.get(
"/dbswitch/admin/api/v1/connection/tables/get/" + this.updateform.sourceConnectionId + "?schema=" + value
"/dbswitch/admin/api/v1/connection/tables/get/" + this.infoform.sourceConnectionId + "?schema=" + value
).then(res => {
if (0 === res.data.code) {
this.sourceSchemaTables = res.data.data;
@@ -282,7 +502,7 @@ export default {
});
} else {
this.$http.get(
"/dbswitch/admin/api/v1/connection/views/get/" + this.updateform.sourceConnectionId + "?schema=" + value
"/dbswitch/admin/api/v1/connection/views/get/" + this.infoform.sourceConnectionId + "?schema=" + value
).then(res => {
if (0 === res.data.code) {
this.sourceSchemaTables = res.data.data;
@@ -314,25 +534,163 @@ export default {
handleGoBack() {
this.$router.go(-1);
},
handleClick(tab, event) {
if (tab.index !== 0) {
this.$message({
message: '功能暂未开放,敬请期待!',
center: true
});
}
},
tableRowClassName({row, rowIndex}) {
if (rowIndex === 1) {
return 'warning-row';
} else if (rowIndex === 3) {
return 'success-row';
}
return '';
}
},
created() {
this.loadAssignmentDetail();
console.log(this.$route.query.record)
},
}
</script>
<style scoped>
.el-card {
width: 100%;
height: 100%;
overflow: auto;
.app-container {
background-color: white;
height: 40px;
}
.el-descriptions__body
.el-descriptions__table
.el-descriptions-row
.el-descriptions-item__label {
min-width: 20px;
max-width: 60px;
/deep/ .el-tabs {
padding-left: 24px;
}
/deep/ .el-tabs__content {
width: 98.5%;
}
/deep/ .el-tabs__nav-wrap:after {
width: 270px;
}
.box-card {
width: 100%;
}
.row-gutter {
margin-bottom: 12px;
}
.common-box {
margin-top: 16px;
width: 100%;
display: flex;
flex-direction: column;
row-gap: 16px;
padding-bottom: 24px;
.datainfo {
display: flex;
justify-content: center;
align-items: center;
width: 100%;
gap: 24px;
.source {
flex: 1;
border-radius: 4px;
}
.target {
flex: 1;
border-radius: 4px;
}
.head {
display: flex;
height: 72px;
align-items: center;
background-color: #F7FBFF;
width: 100%;
justify-content: space-between;
.head-img {
width: 40px;
padding-left: 24px;
}
.head-text {
flex-grow: 1;
padding-left: 48px;
.title {
font-size: 14px;
color: #0051FF;
font-weight: bold;
}
.sub-title {
margin-top: 4px;
font-size: 12px;
color: #7D7D7D;
}
}
}
.body {
background-color: white;
padding: 24px;
min-height: 328px;
}
}
.mapper {
display: flex;
justify-content: center;
align-items: center;
width: 100%;
gap: 24px;
.table-left {
background-color: white;
width: 100%;
padding: 24px;
}
.table-right {
background-color: white;
width: 100%;
padding: 24px;
}
}
}
</style>
<style>
.viewer-container {
background-color: white;
padding: 0px !important;
}
.key-text {
color: #7D7D7D;
font-size: 14px;
}
.value-text {
margin-left: 8px;
font-size: 12px;
color: #000000;
}
.el-table .warning-row {
background: oldlace;
}
.el-table .success-row {
background: #f0f9eb;
}
</style>

View File

@@ -0,0 +1,338 @@
<template>
<el-card>
<el-form :model="updateform"
status-icon
ref="updateform">
<el-descriptions size="small"
:column="1"
label-class-name="el-descriptions-item-label-class"
border>
<el-descriptions-item label="任务名称">{{ updateform.name }}</el-descriptions-item>
<el-descriptions-item label="任务描述">{{ updateform.description }}</el-descriptions-item>
<el-descriptions-item label="集成模式">
<span v-if="updateform.scheduleMode == 'MANUAL'">
手动
</span>
<span v-if="updateform.scheduleMode == 'SYSTEM_SCHEDULED'">
定时
</span>
</el-descriptions-item>
<el-descriptions-item v-if="updateform.scheduleMode == 'SYSTEM_SCHEDULED'"
label="CRON表达式">{{ updateform.cronExpression }}
</el-descriptions-item>
<el-descriptions-item label="源端数据源">[{{ updateform.sourceConnectionId }}]
{{ updateform.sourceConnectionName }}
</el-descriptions-item>
<el-descriptions-item label="源端schema">{{ updateform.sourceSchema }}</el-descriptions-item>
<el-descriptions-item label="源端表类型">{{ updateform.tableType }}</el-descriptions-item>
<el-descriptions-item label="源端表选择方式">
<span v-if="updateform.includeOrExclude == 'INCLUDE'">
包含表
</span>
<span v-if="updateform.includeOrExclude == 'EXCLUDE'">
排除表
</span>
</el-descriptions-item>
<el-descriptions-item label="源端表名列表">
<span
v-show="updateform.includeOrExclude == 'INCLUDE' && (!updateform.sourceTables || updateform.sourceTables.length==0)"><b>所有物理表</b></span>
<p v-for="item in updateform.sourceTables"
v-bind:key="item">{{ item }}</p>
</el-descriptions-item>
<el-descriptions-item label="目地端数据源">[{{ updateform.targetConnectionId }}]
{{ updateform.targetConnectionName }}
</el-descriptions-item>
<el-descriptions-item label="目地端schema">{{ updateform.targetSchema }}</el-descriptions-item>
<el-descriptions-item label="自动同步模式">
<span v-if="updateform.autoSyncMode == 2">
目标端建表并同步数据
</span>
<span v-if="updateform.autoSyncMode == 1">
目标端只创建物理表
</span>
<span v-if="updateform.autoSyncMode == 0">
目标端只同步表里数据
</span>
</el-descriptions-item>
<el-descriptions-item label="建表字段自增"
v-if=" updateform.autoSyncMode!==0 ">{{ updateform.targetAutoIncrement }}
</el-descriptions-item>
<el-descriptions-item label="表名转换方法"
v-if=" updateform.autoSyncMode!==0 ">
<span v-if="updateform.tableNameCase == 'NONE'">
无转换
</span>
<span v-if="updateform.tableNameCase == 'UPPER'">
转大写
</span>
<span v-if="updateform.tableNameCase == 'LOWER'">
转小写
</span>
<span v-if="updateform.tableNameCase == 'CAMEL'">
下划线转驼峰
</span>
<span v-if="updateform.tableNameCase == 'SNAKE'">
驼峰转下换线
</span>
</el-descriptions-item>
<el-descriptions-item label="列名转换方法"
v-if=" updateform.autoSyncMode!==0 ">
<span v-if="updateform.columnNameCase == 'NONE'">
无转换
</span>
<span v-if="updateform.columnNameCase == 'UPPER'">
转大写
</span>
<span v-if="updateform.columnNameCase == 'LOWER'">
转小写
</span>
<span v-if="updateform.columnNameCase == 'CAMEL'">
下划线转驼峰
</span>
<span v-if="updateform.columnNameCase == 'SNAKE'">
驼峰转下换线
</span>
</el-descriptions-item>
<el-descriptions-item label="数据批次大小"
v-if=" updateform.autoSyncMode!==1 ">{{ updateform.batchSize }}
</el-descriptions-item>
<el-descriptions-item label="通道队列大小"
v-if=" updateform.autoSyncMode!==1 ">{{ updateform.channelSize }}
</el-descriptions-item>
<el-descriptions-item label="同步操作方法"
v-if=" updateform.autoSyncMode!==1 ">{{ updateform.targetSyncOption }}
</el-descriptions-item>
<el-descriptions-item label="同步前置执行SQL脚本"
v-if=" updateform.autoSyncMode!==1 ">
<span v-show="!updateform.beforeSqlScripts || updateform.beforeSqlScripts.length==0">[SQL脚本内容为空]</span>
<span
v-show="updateform.beforeSqlScripts && updateform.beforeSqlScripts.length>0">{{ updateform.beforeSqlScripts }}</span>
</el-descriptions-item>
<el-descriptions-item label="同步后置执行SQL脚本"
v-if=" updateform.autoSyncMode!==1 ">
<span v-show="!updateform.afterSqlScripts || updateform.afterSqlScripts.length==0">[SQL脚本内容为空]</span>
<span
v-show="updateform.afterSqlScripts && updateform.afterSqlScripts.length>0">{{ updateform.afterSqlScripts }}</span>
</el-descriptions-item>
<el-descriptions-item label="表名映射规则">
<span v-show="!updateform.tableNameMapper || updateform.tableNameMapper.length==0">[映射关系为空]</span>
<table v-if="updateform.tableNameMapper && updateform.tableNameMapper.length>0"
class="name-mapper-table">
<tr>
<th>表名匹配的正则名</th>
<th>替换的目标值</th>
</tr>
<tr v-for='(item,index) in updateform.tableNameMapper'
:key="index">
<td>{{ item['fromPattern'] }}</td>
<td>{{ item['toValue'] }}</td>
</tr>
</table>
</el-descriptions-item>
<el-descriptions-item label="字段名映射规则">
<span v-show="!updateform.columnNameMapper || updateform.columnNameMapper.length==0">[映射关系为空]</span>
<table v-if="updateform.columnNameMapper && updateform.columnNameMapper.length>0"
class="name-mapper-table">
<tr>
<th>字段名匹配的正则名</th>
<th>替换的目标值</th>
</tr>
<tr v-for='(item,index) in updateform.columnNameMapper'
:key="index">
<td>{{ item['fromPattern'] }}</td>
<td>{{ item['toValue'] }}</td>
</tr>
</table>
</el-descriptions-item>
</el-descriptions>
</el-form>
<el-button type="primary"
size="mini"
icon="el-icon-arrow-left"
@click="handleGoBack"
style="margin: 12px 0px 20px;float: right">
返回
</el-button>
</el-card>
</template>
<script>
export default {
data() {
return {
updateform: {
id: 0,
name: "",
description: "",
scheduleMode: "MANUAL",
cronExpression: "",
sourceConnectionId: '请选择',
sourceSchema: "",
tableType: "TABLE",
includeOrExclude: "",
sourceTables: [],
tableNameMapper: [],
columnNameMapper: [],
tableNameCase: 'NONE',
columnNameCase: 'NONE',
targetConnectionId: '请选择',
targetDropTable: true,
targetOnlyCreate: false,
autoSyncMode: 2,
targetSchema: "",
batchSize: 5000,
channelSize: 100,
targetSyncOption: 'INSERT_UPDATE_DELETE',
beforeSqlScripts: '',
afterSqlScripts: '',
},
sourceConnection: {},
targetConnection: {},
sourceConnectionSchemas: [],
sourceSchemaTables: [],
targetConnectionSchemas: [],
}
},
methods: {
loadAssignmentDetail: function () {
this.$http.get(
"/dbswitch/admin/api/v1/assignment/detail/id/" + this.$route.query.id
).then(res => {
if (0 === res.data.code) {
let detail = res.data.data;
let varAutoSyncMode = 2;
if (detail.configuration.targetDropTable && detail.configuration.targetOnlyCreate) {
varAutoSyncMode = 1;
} else if (!detail.configuration.targetDropTable && !detail.configuration.targetOnlyCreate) {
varAutoSyncMode = 0;
} else {
varAutoSyncMode = 2;
}
this.updateform = {
id: detail.id,
name: detail.name,
description: detail.description,
scheduleMode: detail.scheduleMode,
cronExpression: detail.cronExpression,
sourceConnectionId: detail.configuration.sourceConnectionId,
sourceConnectionName: detail.configuration.sourceConnectionName,
sourceSchema: detail.configuration.sourceSchema,
tableType: detail.configuration.tableType,
includeOrExclude: detail.configuration.includeOrExclude,
sourceTables: detail.configuration.sourceTables,
tableNameMapper: detail.configuration.tableNameMapper,
columnNameMapper: detail.configuration.columnNameMapper,
tableNameCase: detail.configuration.tableNameCase,
columnNameCase: detail.configuration.columnNameCase,
targetConnectionId: detail.configuration.targetConnectionId,
targetConnectionName: detail.configuration.targetConnectionName,
targetDropTable: detail.configuration.targetDropTable,
targetOnlyCreate: detail.configuration.targetOnlyCreate,
targetAutoIncrement: detail.configuration.targetAutoIncrement,
autoSyncMode: varAutoSyncMode,
targetSchema: detail.configuration.targetSchema,
batchSize: detail.configuration.batchSize,
channelSize: detail.configuration.channelSize,
targetSyncOption: detail.configuration.targetSyncOption,
beforeSqlScripts: detail.configuration.beforeSqlScripts,
afterSqlScripts: detail.configuration.afterSqlScripts,
}
this.selectChangedSourceConnection(this.updateform.sourceConnectionId)
this.selectUpdateChangedSourceSchema(this.updateform.sourceSchema)
this.selectChangedTargetConnection(this.updateform.targetConnectionId)
} else {
if (res.data.message) {
alert("查询任务失败," + res.data.message);
}
}
});
},
selectChangedSourceConnection: function (value) {
this.sourceConnection = this.connectionNameList.find(
(item) => {
return item.id === value;
});
this.sourceConnectionSchemas = [];
this.$http.get(
"/dbswitch/admin/api/v1/connection/schemas/get/" + value
).then(res => {
if (0 === res.data.code) {
this.sourceConnectionSchemas = res.data.data;
} else {
this.$message.error("查询来源端数据库的Schema失败," + res.data.message);
this.sourceConnectionSchemas = [];
}
});
},
selectUpdateChangedSourceSchema: function (value) {
this.sourceSchemaTables = [];
if ('TABLE' === this.updateform.tableType) {
this.$http.get(
"/dbswitch/admin/api/v1/connection/tables/get/" + this.updateform.sourceConnectionId + "?schema=" + value
).then(res => {
if (0 === res.data.code) {
this.sourceSchemaTables = res.data.data;
} else {
this.$message.error("查询来源端数据库在指定Schema下的物理表列表失败," + res.data.message);
this.sourceSchemaTables = [];
}
});
} else {
this.$http.get(
"/dbswitch/admin/api/v1/connection/views/get/" + this.updateform.sourceConnectionId + "?schema=" + value
).then(res => {
if (0 === res.data.code) {
this.sourceSchemaTables = res.data.data;
} else {
this.$message.error("查询来源端数据库在指定Schema下的视图表列表失败," + res.data.message);
this.sourceSchemaTables = [];
}
});
}
},
selectChangedTargetConnection: function (value) {
this.targetConnection = this.connectionNameList.find(
(item) => {
return item.id === value;
});
this.targetConnectionSchemas = [];
this.$http.get(
"/dbswitch/admin/api/v1/connection/schemas/get/" + value
).then(res => {
if (0 === res.data.code) {
this.targetConnectionSchemas = res.data.data;
} else {
this.$message.error("查询目的端数据库的Schema失败," + res.data.message);
this.targetConnectionSchemas = [];
}
});
},
handleGoBack() {
this.$router.go(-1);
},
},
created() {
this.loadAssignmentDetail();
},
}
</script>
<style scoped>
.el-card {
width: 100%;
height: 100%;
overflow: auto;
}
.el-descriptions__body
.el-descriptions__table
.el-descriptions-row
.el-descriptions-item__label {
min-width: 20px;
max-width: 60px;
}
</style>