Skip to content

Commit

Permalink
Merge branch 'dev'
Browse files Browse the repository at this point in the history
# Conflicts:
#	src/views/datax/json-build/reader/RDBMSReader.vue
#	src/views/datax/json-build/writer/RDBMSWriter.vue
  • Loading branch information
weiye committed Jun 15, 2020
2 parents e115da9 + bcfc005 commit 8b6251a
Show file tree
Hide file tree
Showing 59 changed files with 3,020 additions and 784 deletions.
3 changes: 1 addition & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@
"codemirror": "5.45.0",
"driver.js": "0.9.5",
"dropzone": "5.5.1",
"echarts": "4.2.1",
"echarts": "^4.2.1",
"element-ui": "^2.13.0",
"file-saver": "2.0.1",
"fuse.js": "3.4.4",
Expand Down Expand Up @@ -90,7 +90,6 @@
"eslint": "5.15.3",
"eslint-plugin-vue": "5.2.2",
"html-webpack-plugin": "3.2.0",
"husky": "1.3.1",
"lint-staged": "8.1.5",
"mockjs": "1.0.1-beta3",
"node-sass": "^4.9.0",
Expand Down
8 changes: 8 additions & 0 deletions src/api/datax-jdbcDatasource.js
Original file line number Diff line number Diff line change
Expand Up @@ -48,3 +48,11 @@ export function test(data) {
data
})
}

export function getDataSourceList(params) {
return request({
url: '/api/jobJdbcDatasource/all',
method: 'get',
params
})
}
25 changes: 25 additions & 0 deletions src/api/datax-job-info.js
Original file line number Diff line number Diff line change
Expand Up @@ -74,3 +74,28 @@ export function viewJobLog(id) {
method: 'get'
})
}

export function getUsersList(params) {
return request({
url: 'api/user/list',
method: 'get',
params
})
}

export function getJobIdList(params) {
return request({
url: 'api/job/list',
method: 'get',
params
})
}
// batchAdd
export function batchAddJob(data) {
return request({
url: '/api/job/batchAdd',
method: 'post',
data
})
}

44 changes: 44 additions & 0 deletions src/api/datax-job-project.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
import request from '@/utils/request'

// project

export function list(params) {
return request({
url: '/api/jobProject',
method: 'get',
params
})
}

export function updated(data) {
return request({
url: '/api/jobProject',
method: 'put',
data
})
}

export function created(data) {
return request({
url: '/api/jobProject',
method: 'post',
data
})
}

export function deleted(data) {
return request({
url: '/api/jobProject',
method: 'delete',
params: data
})
}

export function getJobProjectList(params) {
return request({
url: 'api/jobProject/list',
method: 'get',
params
})
}

8 changes: 8 additions & 0 deletions src/api/datax-job-template.js
Original file line number Diff line number Diff line change
Expand Up @@ -46,3 +46,11 @@ export function nextTriggerTime(cron) {
method: 'get'
})
}

export function getUsersList(params) {
return request({
url: 'api/user/list',
method: 'get',
params
})
}
19 changes: 0 additions & 19 deletions src/api/datax-job.js

This file was deleted.

25 changes: 17 additions & 8 deletions src/api/ds-query.js → src/api/metadata-query.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,16 @@ import request from '@/utils/request'
// 获取表名
export function getTables(params) {
return request({
url: '/api/jdbcDatasourceQuery/getTables',
url: '/api/metadata/getTables',
method: 'get',
params
})
}

// 获取schema
export function getTableSchema(params) {
return request({
url: '/api/metadata/getDBSchema',
method: 'get',
params
})
Expand All @@ -14,7 +23,7 @@ export function getTables(params) {
// 获取字段
export function getColumns(params) {
return request({
url: '/api/jdbcDatasourceQuery/getColumns',
url: '/api/metadata/getColumns',
method: 'get',
params
})
Expand All @@ -23,24 +32,24 @@ export function getColumns(params) {
// 根据sql获取字段
export function getColumnsByQuerySql(params) {
return request({
url: '/api/jdbcDatasourceQuery/getColumnsByQuerySql',
url: '/api/metadata/getColumnsByQuerySql',
method: 'get',
params
})
}

// 根据datasourceID、tablename、columns(数组)拼接的json传给后台三个条件创建表【目标端】
export function createTable(query) {
// 根据datasourceID、tablename创建表【目标端】
export function createTable(params) {
return request({
url: '/api/jdbcDatasourceQuery/createTable',
url: '/api/metadata/createTable',
method: 'post',
data: query
params
})
}
// 判断字段是否存在,存在,即更新值,否则添加字段
export function updateColumnsValue(query) {
return request({
url: '/api/jdbcDatasourceQuery/updateColumnsValue',
url: '/api/metadata/updateColumnsValue',
method: 'post',
data: query
})
Expand Down
173 changes: 173 additions & 0 deletions src/components/Cron/component/day.vue
Original file line number Diff line number Diff line change
@@ -0,0 +1,173 @@
<template lang="html">
<div :val="value_">
<div>
<el-radio v-model="type" label="1" size="mini" border>每日</el-radio>
</div>
<div>
<el-radio v-model="type" label="5" size="mini" border>不指定</el-radio>
</div>
<div>
<el-radio v-model="type" label="2" size="mini" border>周期</el-radio>
<span style="margin-left: 10px; margin-right: 5px;">从</span>
<el-input-number v-model="cycle.start" :min="1" :max="31" size="mini" style="width: 100px;" @change="type = '2'" />
<span style="margin-left: 5px; margin-right: 5px;">至</span>
<el-input-number v-model="cycle.end" :min="2" :max="31" size="mini" style="width: 100px;" @change="type = '2'" />
</div>
<div>
<el-radio v-model="type" label="3" size="mini" border>循环</el-radio>
<span style="margin-left: 10px; margin-right: 5px;">从</span>
<el-input-number v-model="loop.start" :min="1" :max="31" size="mini" style="width: 100px;" @change="type = '3'" />
<span style="margin-left: 5px; margin-right: 5px;">日开始,每</span>
<el-input-number v-model="loop.end" :min="1" :max="31" size="mini" style="width: 100px;" @change="type = '3'" />
日执行一次
</div>
<div>
<el-radio v-model="type" label="8" size="mini" border>工作日</el-radio>
<span style="margin-left: 10px; margin-right: 5px;">本月</span>
<el-input-number v-model="work" :min="1" :max="7" size="mini" style="width: 100px;" @change="type = '8'" />
号,最近的工作日
</div>
<div>
<el-radio v-model="type" label="6" size="mini" border>本月最后一天</el-radio>
</div>
<div>
<el-radio v-model="type" label="4" size="mini" border>指定</el-radio>
<el-checkbox-group v-model="appoint">
<div v-for="i in 4" :key="i" style="margin-left: 10px; line-height: 25px;">
<span v-for="j in 10" :key="j">
<el-checkbox v-if="parseInt((i - 1) + '' + (j - 1)) < 32 && !(i === 1 && j === 1)" :label="(i - 1) + '' + (j - 1)" style="margin-right: 30px;" @change="type = '4'" />
</span>
</div>
</el-checkbox-group>
</div>
</div>
</template>

<script>
export default {
props: {
value: {
type: String,
default: '?'
}
},
data() {
return {
type: '5', // 类型
cycle: {
// 周期
start: 0,
end: 0
},
loop: {
// 循环
start: 0,
end: 0
},
week: {
// 指定周
start: 0,
end: 0
},
work: 0,
last: 0,
appoint: [] // 指定
}
},
computed: {
value_() {
const result = []
switch (this.type) {
case '1': // 每秒
result.push('*')
break
case '2': // 周期
result.push(`${this.cycle.start}-${this.cycle.end}`)
break
case '3': // 循环
result.push(`${this.loop.start}/${this.loop.end}`)
break
case '4': // 指定
result.push(this.appoint.join(','))
break
case '6': // 最后
result.push(`${this.last === 0 ? '' : this.last}L`)
break
case '7': // 指定周
result.push(`${this.week.start}#${this.week.end}`)
break
case '8': // 工作日
result.push(`${this.work}W`)
break
default:
// 不指定
result.push('?')
break
}
this.$emit('input', result.join(''))
return result.join('')
}
},
watch: {
value(a, b) {
this.updateVal()
}
},
created() {
this.updateVal()
},
methods: {
updateVal() {
if (!this.value) {
return
}
if (this.value === '?') {
this.type = '5'
} else if (this.value.indexOf('-') !== -1) {
// 2周期
if (this.value.split('-').length === 2) {
this.type = '2'
this.cycle.start = this.value.split('-')[0]
this.cycle.end = this.value.split('-')[1]
}
} else if (this.value.indexOf('/') !== -1) {
// 3循环
if (this.value.split('/').length === 2) {
this.type = '3'
this.loop.start = this.value.split('/')[0]
this.loop.end = this.value.split('/')[1]
}
} else if (this.value.indexOf('*') !== -1) {
// 1每
this.type = '1'
} else if (this.value.indexOf('L') !== -1) {
// 6最后
this.type = '6'
this.last = this.value.replace('L', '')
} else if (this.value.indexOf('#') !== -1) {
// 7指定周
if (this.value.split('#').length === 2) {
this.type = '7'
this.week.start = this.value.split('#')[0]
this.week.end = this.value.split('#')[1]
}
} else if (this.value.indexOf('W') !== -1) {
// 8工作日
this.type = '8'
this.work = this.value.replace('W', '')
} else {
// *
this.type = '4'
this.appoint = this.value.split(',')
}
}
}
}
</script>

<style lang="css">
.el-checkbox + .el-checkbox {
margin-left: 10px;
}
</style>
Loading

0 comments on commit 8b6251a

Please sign in to comment.