Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
E
ETL-admin
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
莫晓莉
ETL-admin
Commits
d609bd33
Commit
d609bd33
authored
Jan 20, 2021
by
莫晓莉
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
树形菜单
parent
e05bc478
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
131 additions
and
61 deletions
+131
-61
src/api/task/homework.js
+10
-0
src/api/task/transform.js
+1
-1
src/views/task/homework.vue
+91
-50
src/views/task/transform.vue
+29
-10
No files found.
src/api/task/homework.js
View file @
d609bd33
...
...
@@ -55,5 +55,15 @@ export function uploadRepositoryFile(data) {
method
:
'post'
})
}
//获取作业的树形菜单
export
function
getJobTree
(
data
)
{
return
request
({
url
:
'kettle/repository/getJobTree?repositoryId='
+
data
,
data
,
method
:
'post'
})
}
src/api/task/transform.js
View file @
d609bd33
...
...
@@ -69,7 +69,7 @@ export function stop(data) {
//获取转换的树形菜单
export
function
getTransTree
(
data
)
{
return
request
({
url
:
'kettle/repository/getTransTree
'
,
url
:
'kettle/repository/getTransTree
?repositoryId='
+
data
,
data
,
method
:
'post'
})
...
...
src/views/task/homework.vue
View file @
d609bd33
...
...
@@ -118,7 +118,7 @@
</el-select>
</el-form-item>
<el-form-item
label=
"作业:"
>
<el-input
@
click
.
native=
"
t
reeModal"
:disabled=
"true"
placeholder=
"请选择作业"
v-model=
"currenSelectNodePath"
class=
"input-length"
></el-input>
<el-input
@
click
.
native=
"
openT
reeModal"
:disabled=
"true"
placeholder=
"请选择作业"
v-model=
"currenSelectNodePath"
class=
"input-length"
></el-input>
</el-form-item>
<el-form-item
label=
"作业名称:"
prop=
"name"
>
<el-input
placeholder=
"请输入作业名称"
v-model=
"formOne.name"
class=
"input-length"
></el-input>
...
...
@@ -300,7 +300,7 @@
<el-dialog
title=
"请选择作业"
:visible
.
sync=
"treeDialogVisible"
:before-close=
"
jobTreeConfirm
"
:before-close=
"
closeTreeModal
"
width=
"30%"
>
<el-tree
:data=
"jobTreeList"
...
...
@@ -334,6 +334,7 @@ import {
start
,
//开始作业
stop
,
//停止作业
uploadRepositoryFile
,
//上传资源文件
getJobTree
,
//获取作业树形菜单
}
from
"@/api/task/homework"
;
import
{
...
...
@@ -435,48 +436,48 @@ export default {
},
fileList
:
[],
//上传的资源文件
jobTreeList
:[
{
path
:
'f0'
,
id
:
'1'
,
parent
:
'0'
,
lasted
:
false
,
},
{
path
:
'f01'
,
id
:
'2'
,
parent
:
'1'
,
lasted
:
true
,
},
{
path
:
'f02'
,
id
:
'3'
,
parent
:
'1'
,
lasted
:
true
,
},
{
path
:
'f021'
,
id
:
'6'
,
parent
:
'3'
,
lasted
:
false
,
},
{
path
:
'f021'
,
id
:
'7'
,
parent
:
'6'
,
lasted
:
false
,
},
{
path
:
'f40'
,
id
:
'4'
,
parent
:
'0'
,
lasted
:
false
,
},
{
path
:
'f41'
,
id
:
'5'
,
parent
:
'4'
,
lasted
:
true
,
}
//
{
//
path: 'f0',
//
id: '1',
//
parent: '0',
//
lasted: false,
//
},
//
{
//
path: 'f01',
//
id: '2',
//
parent: '1',
//
lasted: true,
//
},
//
{
//
path: 'f02',
//
id: '3',
//
parent: '1',
//
lasted: true,
//
},
//
{
//
path: 'f021',
//
id: '6',
//
parent: '3',
//
lasted: false,
//
},
//
{
//
path: 'f021',
//
id: '7',
//
parent: '6',
//
lasted: false,
//
},
//
{
//
path: 'f40',
//
id: '4',
//
parent: '0',
//
lasted: false,
//
},
//
{
//
path: 'f41',
//
id: '5',
//
parent: '4',
//
lasted: true,
//
}
],
defaultProps
:
{
label
:
'path'
,
...
...
@@ -492,7 +493,7 @@ export default {
this
.
getList
();
//获取数据库资源库列表
this
.
getKettleQuartzList
();
//获取策略配置列表
this
.
setHeaders
();
this
.
treeRevert
(
this
.
jobTreeList
);
//
this.treeRevert(this.jobTreeList);
},
methods
:
{
...
...
@@ -593,11 +594,11 @@ export default {
}
},
// 树形结构弹窗
treeModal
(){
this
.
treeDialogVisible
=
!
this
.
treeDialogVisible
;
console
.
log
(
'打开作业弹窗显示当前选择的作业id---'
,
this
.
currenSelectNodeId
);
this
.
$refs
.
tree
.
setCheckedKeys
([]);
},
//
treeModal(){
//
this.treeDialogVisible = !this.treeDialogVisible;
//
console.log('打开作业弹窗显示当前选择的作业id---',this.currenSelectNodeId);
//
this.$refs.tree.setCheckedKeys([]);
//
},
//获取数据库资源库列表
getList
()
{
...
...
@@ -726,6 +727,46 @@ export default {
this
.
pageInfo
.
page
=
e
;
this
.
getKettleJobList
();
},
//获取转换树形列表
getJobTree
(){
getJobTree
(
this
.
formOne
.
repositoryId
).
then
((
res
)
=>
{
console
.
log
(
'获取转换树形列表'
,
res
);
if
(
res
.
success
){
this
.
jobTreeList
=
res
.
data
;
if
(
res
.
data
.
length
>
0
){
this
.
treeRevert
(
this
.
jobTreeList
);
//数据转换
}
}
});
},
//打卡树形结构弹窗
openTreeModal
(){
this
.
getJobTree
();
if
(
this
.
formOne
.
repositoryId
){
if
(
this
.
jobTreeList
.
length
>
0
){
this
.
treeDialogVisible
=
!
this
.
treeDialogVisible
;
}
else
{
this
.
$message
.
success
(
"暂无数据!"
);
}
}
else
{
this
.
$message
.
error
(
"请先选择资源库!"
);
}
},
//关闭树形结构弹窗
closeTreeModal
(){
this
.
treeDialogVisible
=
!
this
.
treeDialogVisible
;
console
.
log
(
'打开作业弹窗显示当前选择的作业id---'
,
this
.
currenSelectNodeId
);
this
.
$refs
.
tree
.
setCheckedKeys
([]);
},
//数据转换
treeRevert
(
arrayList
){
let
formatObj
=
arrayList
.
reduce
((
pre
,
cur
)
=>
{
return
{...
pre
,
[
cur
[
'id'
]]:
cur
}
...
...
src/views/task/transform.vue
View file @
d609bd33
...
...
@@ -111,7 +111,7 @@
</el-select>
</el-form-item>
<el-form-item
label=
"转换:"
>
<el-input
@
click
.
native=
"
t
reeModal"
:disabled=
"true"
placeholder=
"请选择作业"
v-model=
"currenSelectNodePath"
class=
"input-length"
></el-input>
<el-input
@
click
.
native=
"
openT
reeModal"
:disabled=
"true"
placeholder=
"请选择作业"
v-model=
"currenSelectNodePath"
class=
"input-length"
></el-input>
</el-form-item>
<el-form-item
label=
"转换名称:"
prop=
"name"
>
<el-input
placeholder=
"请输入转换名称"
v-model=
"formOne.name"
class=
"input-length"
></el-input>
...
...
@@ -295,7 +295,7 @@
<el-dialog
title=
"请选择作业"
:visible
.
sync=
"treeDialogVisible"
:before-close=
"
jobTreeConfirm
"
:before-close=
"
closeTreeModal
"
width=
"30%"
>
<el-tree
:data=
"jobTreeList"
...
...
@@ -471,7 +471,7 @@ export default {
this
.
getList
();
//获取数据库资源库列表
this
.
getKettleQuartzList
();
//获取策略配置列表
this
.
setHeaders
();
this
.
getTransTree
();
//获取转换树形菜单
//
this.getTransTree();//获取转换树形菜单
// this.treeRevert(this.jobTreeList);
},
...
...
@@ -709,9 +709,9 @@ export default {
// "errCode": 0,
// "errMsg": "string",
// "success": true
//获取转换树形列表
getTransTree
(){
getTransTree
().
then
((
res
)
=>
{
getTransTree
(
this
.
formOne
.
repositoryId
).
then
((
res
)
=>
{
console
.
log
(
'获取转换树形列表'
,
res
);
if
(
res
.
success
){
this
.
jobTreeList
=
res
.
data
;
...
...
@@ -722,11 +722,30 @@ export default {
});
},
// 树形结构弹窗
treeModal
(){
this
.
treeDialogVisible
=
!
this
.
treeDialogVisible
;
console
.
log
(
'打开作业弹窗显示当前选择的作业id---'
,
this
.
currenSelectNodeId
);
this
.
$refs
.
tree
.
setCheckedKeys
([]);
//打卡树形结构弹窗
openTreeModal
(){
this
.
getTransTree
();
if
(
this
.
formOne
.
repositoryId
){
if
(
this
.
jobTreeList
.
length
>
0
){
this
.
treeDialogVisible
=
!
this
.
treeDialogVisible
;
}
else
{
this
.
$message
.
success
(
"暂无数据!"
);
}
// console.log('打开作业弹窗显示当前选择的作业id---',this.currenSelectNodeId);
// this.$refs.tree.setCheckedKeys([]);
// this.getTransTree();
}
else
{
this
.
$message
.
error
(
"请先选择资源库!"
);
}
},
//关闭树形结构弹窗
closeTreeModal
(){
this
.
treeDialogVisible
=
!
this
.
treeDialogVisible
;
console
.
log
(
'打开作业弹窗显示当前选择的作业id---'
,
this
.
currenSelectNodeId
);
this
.
$refs
.
tree
.
setCheckedKeys
([]);
},
// 上传资源文件成功
uplodSuccess
(
response
,
file
,
fileList
)
{
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment