Skip to content
Toggle navigation
Toggle navigation
This project
Loading...
Sign in
csbr-daop
/
fe-data-trusted-space
Go to a project
Toggle navigation
Toggle navigation pinning
Projects
Groups
Snippets
Help
Project
Activity
Repository
Pipelines
Graphs
Issues
0
Merge Requests
0
Wiki
Network
Create a new issue
Builds
Commits
Issue Boards
Files
Commits
Network
Compare
Branches
Tags
ffc427d6
authored
2024-12-24 14:07:44 +0800
by
lxs
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
分类分级任务联调
1 parent
a36959df
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
97 additions
and
54 deletions
src/views/data_inventory/taskConfig.vue
src/views/data_inventory/taskDetail.vue
src/views/data_inventory/taskLog.vue
src/views/data_inventory/taskConfig.vue
View file @
ffc427d
...
...
@@ -159,7 +159,7 @@ const toPath = (type) => {
query
:
{
guid
:
currTableData
.
value
.
guid
,
name
:
currTableData
.
value
.
taskName
,
detail
:
JSON
.
stringify
(
currTableData
.
value
)
,
execGuid
:
currTableData
.
value
.
execGuid
,
type
},
});
...
...
src/views/data_inventory/taskDetail.vue
View file @
ffc427d
...
...
@@ -12,6 +12,7 @@ import { setItemsDisabled, tagMethod, tagType, changeNum, } from "@/utils/common
import
useDataAssetStore
from
"@/store/modules/dataAsset"
;
import
TableTools
from
'@/components/Tools/table_tools.vue'
;
import
{
getCgTaskDetail
,
getTaskExeTreeList
,
getTaskFieldCount
,
execTaskFieldList
,
...
...
@@ -26,22 +27,17 @@ import {
const
{
proxy
}
=
getCurrentInstance
()
as
any
;
const
router
=
useRouter
();
const
route
=
useRoute
();
const
userStore
=
useUserStore
();
const
userData
=
JSON
.
parse
(
userStore
.
userData
);
const
assetStore
=
useDataAssetStore
();
const
detailData
=
JSON
.
parse
(
route
.
query
.
detail
);
const
loading
=
ref
(
false
);
const
gradeList
=
ref
([]);
const
treeData
=
ref
([
{
classifyName
:
"全部"
,
guid
:
"all"
,
children
:
[
{
classifyName
:
'未分类'
,
guid
:
'unclassified'
}
],
classifyDetailGuid
:
"all"
,
children
:
[],
},
]);
const
currTreeNode
=
ref
({
classifyName
:
"全部"
,
g
uid
:
"all"
})
const
currTreeNode
=
ref
({
classifyName
:
"全部"
,
classifyDetailG
uid
:
"all"
})
const
treeInfoRef
=
ref
();
const
treeInfo
:
any
=
ref
({
id
:
"data-pickup-tree"
,
...
...
@@ -50,9 +46,9 @@ const treeInfo: any = ref({
queryPlaceholder
:
"输入组织名称搜索"
,
props
:
{
label
:
"classifyName"
,
value
:
"
g
uid"
,
value
:
"
classifyDetailG
uid"
,
},
nodeKey
:
'
g
uid'
,
nodeKey
:
'
classifyDetailG
uid'
,
expandedKey
:
[],
expandOnNodeClick
:
false
,
data
:
[],
...
...
@@ -69,6 +65,7 @@ const tabsInfo = ref({
});
const
cascaderRef
=
ref
();
const
sheetParams
=
ref
({});
const
sheetSearchRef
=
ref
();
const
sheetItemList
=
ref
([
{
type
:
"select"
,
...
...
@@ -99,6 +96,7 @@ const sheetItemList = ref([
},
]);
const
fieldParams
=
ref
({});
const
fieldSearchRef
=
ref
();
const
fieldItemList
=
ref
([
{
type
:
"select"
,
...
...
@@ -165,7 +163,7 @@ const fieldItemList = ref([
checkStrictly
:
true
,
expandTrigger
:
"hover"
,
label
:
"classifyName"
,
value
:
"
g
uid"
,
value
:
"
classifyDetailG
uid"
,
},
filterable
:
true
,
clearable
:
true
,
...
...
@@ -250,7 +248,7 @@ const fieldTableInfo = ref({
checkStrictly
:
false
,
expandTrigger
:
"hover"
,
label
:
"classifyName"
,
value
:
"
g
uid"
,
value
:
"
classifyDetailG
uid"
,
},
filterable
:
true
,
clearable
:
true
,
...
...
@@ -301,7 +299,7 @@ const formItems = ref([
checkStrictly
:
false
,
expandTrigger
:
"hover"
,
label
:
"classifyName"
,
value
:
"
g
uid"
,
value
:
"
classifyDetailG
uid"
,
},
filterable
:
true
,
clearable
:
true
,
...
...
@@ -363,6 +361,29 @@ const dialogInfo: any = ref({
},
})
// 获取任务详情
const
getTaskDetail
=
(
param
)
=>
{
loading
.
value
=
true
;
getCgTaskDetail
(
param
).
then
((
res
:
any
)
=>
{
loading
.
value
=
false
;
if
(
res
.
code
==
proxy
.
$passCode
)
{
taskDetail
.
value
=
res
.
data
||
{};
getFieldCount
()
getSheetFieldList
({
type
:
1
});
getFieldTree
()
getGradeData
();
nextTick
(()
=>
{
getSheetTableData
();
getFieldTableData
();
})
}
else
{
ElMessage
.
error
(
res
.
msg
);
}
}).
catch
(()
=>
{
loading
.
value
=
false
;
})
}
// 获取字段统计
const
getFieldCount
=
()
=>
{
getTaskFieldCount
({
execGuid
:
taskDetail
.
value
.
execGuid
}).
then
((
res
:
any
)
=>
{
...
...
@@ -398,13 +419,16 @@ const getFieldTree = () => {
treeInfo
.
value
.
loading
=
false
;
if
(
res
.
code
==
proxy
.
$passCode
)
{
const
data
=
res
.
data
||
[];
treeData
.
value
[
0
].
children
.
splice
(
1
);
treeData
.
value
[
0
].
children
.
push
(...
data
);
const
children
:
any
=
[
{
classifyName
:
'未分类'
,
classifyDetailGuid
:
'unclassified'
},
...
data
]
treeData
.
value
[
0
].
children
=
children
;
treeInfo
.
value
.
data
=
treeData
.
value
;
treeInfo
.
value
.
expandedKey
=
[
'all'
];
treeInfoRef
.
value
.
setCurrentKey
(
'all'
);
formItems
.
value
[
0
].
options
=
JSON
.
parse
(
JSON
.
stringify
(
data
));
fieldItemList
.
value
[
4
].
options
=
JSON
.
parse
(
JSON
.
stringify
(
data
));
fieldItemList
.
value
[
4
].
options
=
JSON
.
parse
(
JSON
.
stringify
(
children
));
fieldTableInfo
.
value
.
fields
[
4
].
options
=
JSON
.
parse
(
JSON
.
stringify
(
data
));
}
else
{
ElMessage
.
error
(
res
.
msg
);
...
...
@@ -444,25 +468,26 @@ const tabChange = (val) => {
tabsInfo
.
value
.
activeName
=
val
;
}
const
nodeClick
=
(
data
)
=>
{
const
nodeClick
=
(
data
,
node
)
=>
{
currTreeNode
.
value
=
data
;
if
(
data
.
guid
==
'all'
)
{
getFieldTableData
({
isClassify
:
''
})
}
else
if
(
data
.
guid
==
'unclassified'
)
{
getFieldTableData
({
isClassify
:
'N'
})
if
(
data
.
classifyDetailGuid
==
'all'
)
{
fieldItemList
.
value
[
4
].
default
=
[];
getFieldTableData
()
}
else
{
getFieldTableData
({
isClassify
:
'Y'
,
classifyDetail
:
data
.
guid
});
const
parentGuids
=
data
.
parentGuids
||
[];
parentGuids
.
push
(
data
.
g
uid
)
parentGuids
.
push
(
data
.
classifyDetailG
uid
)
fieldItemList
.
value
[
4
].
default
=
parentGuids
;
console
.
log
(
'tree'
,
parentGuids
)
getFieldTableData
();
}
}
// 获取库表数据
const
getSheetTableData
=
()
=>
{
sheetTableInfo
.
value
.
loading
=
true
;
const
sheetParams
=
sheetSearchRef
.
value
.
toolSearch
.
formInline
||
{};
execTaskSheetList
(
Object
.
assign
({},
{
...
sheetParams
.
value
},
{
Object
.
assign
({},
{
...
sheetParams
},
{
execGuid
:
taskDetail
.
value
.
execGuid
,
pageIndex
:
sheetTableInfo
.
value
.
page
.
curr
,
pageSize
:
sheetTableInfo
.
value
.
page
.
limit
,
...
...
@@ -484,15 +509,20 @@ const getSheetTableData = () => {
};
// 获取字段表格数据
const
getFieldTableData
=
(
param
:
any
=
{}
)
=>
{
const
getFieldTableData
=
()
=>
{
fieldTableInfo
.
value
.
loading
=
true
;
const
fieldParams
=
fieldSearchRef
.
value
.
toolSearch
.
formInline
||
{};
let
params
:
any
=
{
...
fieldParams
.
value
,
...
param
,
...
fieldParams
,
execGuid
:
taskDetail
.
value
.
execGuid
,
pageIndex
:
fieldTableInfo
.
value
.
page
.
curr
,
pageSize
:
fieldTableInfo
.
value
.
page
.
limit
,
}
const
classifyName
=
params
.
classifyName
?.
at
(
-
1
)
||
undefined
;
params
.
isClassify
=
classifyName
===
undefined
?
''
:
classifyName
==
'unclassified'
?
'N'
:
'Y'
;
if
(
classifyName
&&
classifyName
!=
'unclassified'
)
{
params
.
classifyDetail
=
classifyName
;
}
delete
params
.
classifyName
execTaskFieldList
(
params
).
then
((
res
:
any
)
=>
{
fieldTableInfo
.
value
.
loading
=
false
;
...
...
@@ -542,7 +572,7 @@ const tableBtnClick = (scope, btn) => {
treeInfo
.
value
.
expandedKey
=
[
'all'
];
treeInfoRef
.
value
.
setCurrentKey
(
'all'
);
getSheetFieldList
({
type
:
2
,
databaseGuid
:
row
.
databaseGuid
},
row
.
tableGuid
);
getFieldTableData
(
{
databaseGuid
:
row
.
databaseGuid
,
tableGuid
:
row
.
tableGuid
}
);
getFieldTableData
();
}
else
if
(
type
==
"edit"
)
{
row
.
STATE
=
'Running'
;
}
else
if
(
type
==
'save'
)
{
...
...
@@ -573,8 +603,8 @@ const tablePageChange = (info) => {
sheetTableInfo
.
value
.
page
.
curr
=
Number
(
info
.
curr
);
getSheetTableData
();
}
else
{
fieldTableInfo
.
value
.
page
.
limit
=
page
.
value
.
limit
;
fieldTableInfo
.
value
.
page
.
curr
=
page
.
value
.
curr
;
fieldTableInfo
.
value
.
page
.
limit
=
Number
(
info
.
limit
)
;
fieldTableInfo
.
value
.
page
.
curr
=
Number
(
info
.
curr
)
;
getFieldTableData
();
}
};
...
...
@@ -602,27 +632,35 @@ const btnClick = async (btn, bType = null) => {
// 保存字段
const
saveFields
=
(
params
,
isBatch
=
false
)
=>
{
loading
.
value
=
true
;
execFieldConfirm
(
params
).
then
((
res
:
any
)
=>
{
loading
.
value
=
false
;
if
(
res
.
code
==
proxy
.
$passCode
)
{
ElMessage
.
success
(
'保存成功'
);
isBatch
&&
getFieldTableData
();
}
else
{
ElMessage
.
error
(
res
.
msg
);
}
}).
catch
(()
=>
{
loading
.
value
=
false
;
})
}
// 任务确认
const
saveTask
=
()
=>
{
loading
.
value
=
true
;
execTaskConfirm
({
execGuid
:
taskDetail
.
value
.
execGuid
}).
then
((
res
:
any
)
=>
{
loading
.
value
=
false
;
if
(
res
.
code
==
proxy
.
$passCode
)
{
ElMessage
.
success
(
'
保存
成功'
);
ElMessage
.
success
(
'
变更
成功'
);
router
.
push
({
name
:
"taskConfig"
,
});
}
else
{
ElMessage
.
error
(
res
.
msg
);
}
}).
catch
(()
=>
{
loading
.
value
=
false
;
})
}
...
...
@@ -644,7 +682,10 @@ const searchField = (val: any, clear: boolean = false) => {
};
const
cascaderChange
=
(
val
,
row
)
=>
{
console
.
log
(
val
,
row
);
treeInfoRef
.
value
.
expandedKey
=
val
||
[
'all'
];
treeInfoRef
.
value
.
setCurrentKey
(
val
?.
at
(
-
1
)
||
'all'
);
console
.
log
(
'cascader'
,
val
)
getFieldTableData
();
};
const
selectChange
=
(
val
,
item
,
scope
=
null
)
=>
{
...
...
@@ -716,19 +757,21 @@ onActivated(() => {
})
onBeforeMount
(()
=>
{
taskDetail
.
value
=
detailData
;
getFieldCount
()
getSheetFieldList
({
type
:
1
});
getFieldTree
()
getSheetTableData
();
getFieldTableData
();
getGradeData
();
if
(
route
.
query
.
type
==
'log'
)
{
getTaskDetail
({
guid
:
route
.
query
.
guid
,
execGuid
:
taskDetail
.
value
.
execGuid
});
}
else
{
getTaskDetail
({
guid
:
route
.
query
.
guid
});
}
})
onMounted
(()
=>
{
})
</
script
>
<
template
>
<div
class=
"container_wrap full flex"
>
<div
class=
"container_wrap full flex"
v-loading=
"loading"
>
<div
class=
"main_wrap full"
>
<div
class=
"content_main panel"
>
<div
class=
"template_panel"
>
...
...
@@ -749,17 +792,17 @@ onBeforeMount(() => {
</div>
<div
class=
"desc_item"
>
<span
class=
"desc_label"
>
执行时间:
</span>
<span
class=
"desc_value"
>
{{
taskDetail
.
cgDirNa
me
||
'--'
}}
</span>
<span
class=
"desc_value"
>
{{
taskDetail
.
updateTi
me
||
'--'
}}
</span>
</div>
</div>
<div
class=
"desc_group"
>
<div
class=
"desc_item"
>
<span
class=
"desc_label"
>
分类:
</span>
<span
class=
"desc_value
text_btn
"
>
{{
taskDetail
.
classifyName
||
'--'
}}
</span>
<span
class=
"desc_value"
>
{{
taskDetail
.
classifyName
||
'--'
}}
</span>
</div>
<div
class=
"desc_item"
>
<span
class=
"desc_label"
>
分级:
</span>
<span
class=
"desc_value
text_btn
"
>
{{
taskDetail
.
gradeName
||
'--'
}}
</span>
<span
class=
"desc_value"
>
{{
taskDetail
.
gradeName
||
'--'
}}
</span>
</div>
<div
class=
"desc_item"
>
<span
class=
"desc_label"
>
元数据名称:
</span>
...
...
@@ -787,7 +830,7 @@ onBeforeMount(() => {
<Tabs
class=
"panel_tabs"
:tabs-info=
"tabsInfo"
@
tab-change=
"tabChange"
/>
<div
class=
"panel"
v-show=
"tabsInfo.activeName == 'sheet'"
>
<div
class=
"table_tool_wrap"
>
<TableTools
:searchItems=
"sheetItemList"
:searchId=
"'sheet-search'"
:init=
"false"
<TableTools
ref=
"sheetSearchRef"
:searchItems=
"sheetItemList"
:searchId=
"'sheet-search'"
:init=
"false"
@
selectChange=
"selectChange"
@
search=
"searchSheet"
/>
</div>
<div
class=
"table_panel_wrap"
>
...
...
@@ -800,7 +843,7 @@ onBeforeMount(() => {
</div>
<div
class=
"box_right"
>
<div
class=
"table_tool_wrap"
>
<TableTools
:searchItems=
"fieldItemList"
:searchId=
"'field-search'"
:init=
"false"
<TableTools
ref=
"fieldSearchRef"
:searchItems=
"fieldItemList"
:searchId=
"'field-search'"
:init=
"false"
@
selectChange=
"selectChange"
@
cascaderChange=
"cascaderChange"
@
search=
"searchField"
/>
<div
class=
"tools_btns"
>
<div
class=
"btns"
>
...
...
src/views/data_inventory/taskLog.vue
View file @
ffc427d
...
...
@@ -71,12 +71,11 @@ const tableInfo = ref({
actionInfo
:
{
label
:
"操作"
,
type
:
"btn"
,
width
:
10
0
,
width
:
9
0
,
btns
:
(
scope
)
=>
{
let
row
=
scope
.
row
,
btnArr
:
any
=
[
{
label
:
"查看结果"
,
value
:
"
path
"
},
return
[
{
label
:
"查看结果"
,
value
:
"
log
"
},
];
return
btnArr
;
},
},
});
...
...
@@ -107,7 +106,7 @@ const tableBtnClick = (scope, btn) => {
const
type
=
btn
.
value
;
const
row
=
scope
.
row
;
currTableData
.
value
=
row
;
if
(
type
==
"
path
"
)
{
if
(
type
==
"
log
"
)
{
toPath
(
type
);
}
};
...
...
@@ -116,8 +115,9 @@ const toPath = (type) => {
router
.
push
({
name
:
"taskDetail"
,
query
:
{
guid
:
currTableData
.
value
.
guid
,
name
:
currTableData
.
value
.
damName
,
guid
:
currTableData
.
value
.
taskGuid
,
name
:
currTableData
.
value
.
taskName
,
execGuid
:
currTableData
.
value
.
guid
,
type
},
});
...
...
Write
Preview
Styling with
Markdown
is supported
Attach a file
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 post a comment