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
782b8b6d
authored
2024-12-22 09:59:00 +0800
by
lxs
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
分类分级任务联调
1 parent
495dd53e
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
180 additions
and
26 deletions
src/components/Tools/table_search.vue
src/components/Tools/table_tools.vue
src/views/data_inventory/taskDetail.vue
src/components/Tools/table_search.vue
View file @
782b8b6
...
...
@@ -29,7 +29,6 @@ const props = defineProps({
}
})
const
formRef
=
ref
()
const
formCascaderRef
=
ref
();
const
formInline
:
any
=
computed
(()
=>
{
let
items
=
setFormFields
(
props
.
itemList
);
return
reactive
(
items
);
...
...
@@ -45,16 +44,10 @@ const resetForm = (formEl: FormInstance | undefined) => {
emits
(
'tableSearch'
,
form
,
true
)
})
}
const
getCascaderCheckedData
=
()
=>
{
const
formCascader
=
formCascaderRef
.
value
[
0
]
||
formCascaderRef
.
value
;
const
data
=
formCascader
.
getCheckedNodes
();
return
data
;
};
defineExpose
({
formInline
,
formRef
,
getCascaderCheckedData
formRef
})
const
setFormFields
=
(
list
:
any
)
=>
{
let
obj
=
{}
...
...
src/components/Tools/table_tools.vue
View file @
782b8b6
...
...
@@ -57,10 +57,6 @@ const cascaderChange = (val, item) => {
emits
(
"cascaderChange"
,
val
,
item
);
}
const
getCascaderCheckedData
=
()
=>
{
return
toolSearch
.
value
.
getCascaderCheckedData
();
}
defineExpose
({
toolSearch
,
})
...
...
src/views/data_inventory/taskDetail.vue
View file @
782b8b6
...
...
@@ -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
,
execTaskSheetList
,
execTaskConfirm
,
execFieldConfirm
,
filterVal
,
}
from
"@/api/modules/dataInventory"
;
import
{
ro
}
from
"element-plus/es/locale"
;
const
{
proxy
}
=
getCurrentInstance
()
as
any
;
const
router
=
useRouter
();
...
...
@@ -57,7 +58,7 @@ const tabsInfo = ref({
{
label
:
'字段'
,
name
:
'field'
},
]
});
const
cascaderRef
=
ref
();
const
sheetParams
=
ref
({});
const
sheetItemList
=
ref
([
{
...
...
@@ -128,7 +129,7 @@ const fieldItemList = ref([
options
:
[],
showAllLevels
:
true
,
props
:
{
checkStrictly
:
tru
e
,
checkStrictly
:
fals
e
,
expandTrigger
:
"hover"
,
label
:
"classifyName"
,
value
:
"guid"
,
...
...
@@ -216,18 +217,22 @@ const fieldTableInfo = ref({
{
label
:
"字段名"
,
field
:
"fieldName"
,
width
:
120
},
{
label
:
"字段中文名"
,
field
:
"fieldChName"
,
width
:
200
},
{
label
:
"分类"
,
field
:
"classify
DetailName
"
,
width
:
280
,
label
:
"分类"
,
field
:
"classify
Guids
"
,
width
:
280
,
type
:
"cascader"
,
options
:
[],
showAllLevels
:
tru
e
,
showAllLevels
:
fals
e
,
props
:
{
checkStrictly
:
tru
e
,
checkStrictly
:
fals
e
,
expandTrigger
:
"hover"
,
label
:
"classifyName"
,
value
:
"guid"
,
},
filterable
:
true
,
clearable
:
true
,
getName
:
(
scope
)
=>
{
const
classifyNames
=
scope
.
row
.
classifyNames
||
[];
return
classifyNames
.
join
(
'/'
);
}
},
{
label
:
"分级"
,
field
:
"gradeDetailName"
,
width
:
120
,
type
:
'select'
},
{
label
:
"标签"
,
field
:
"label"
,
width
:
96
},
...
...
@@ -251,6 +256,79 @@ const fieldTableInfo = ref({
},
})
const
formItems
=
ref
([
{
label
:
"分类"
,
type
:
"cascader"
,
placeholder
:
"请选择"
,
field
:
"classifyName"
,
default
:
[],
options
:
[],
showAllLevels
:
false
,
props
:
{
checkStrictly
:
false
,
expandTrigger
:
"hover"
,
label
:
"classifyName"
,
value
:
"guid"
,
},
filterable
:
true
,
clearable
:
true
,
required
:
true
,
},
{
label
:
'分级'
,
type
:
'select'
,
placeholder
:
'请选择'
,
field
:
'gradeName'
,
default
:
''
,
block
:
true
,
options
:
[],
props
:
{
value
:
'guid'
,
label
:
'daName'
},
clearable
:
true
,
required
:
true
},
]);
const
formRules
=
ref
({
classifyName
:
[
{
required
:
true
,
trigger
:
'change'
,
message
:
"请选择分类"
}
],
gradeName
:
[
{
required
:
true
,
trigger
:
'change'
,
message
:
"请选择分级"
}
],
});
const
dialogInfo
:
any
=
ref
({
visible
:
false
,
size
:
480
,
direction
:
"column"
,
header
:
{
title
:
"新建"
,
},
type
:
'form'
,
contents
:
[
{
type
:
'form'
,
title
:
''
,
formInfo
:
{
id
:
'confirm-upload-file'
,
items
:
formItems
.
value
,
rules
:
formRules
.
value
}
}
],
footer
:
{
visible
:
true
,
btns
:
[
{
type
:
"default"
,
label
:
"取消"
,
value
:
"cancel"
},
{
type
:
"primary"
,
label
:
"确定"
,
value
:
"submit"
},
],
},
})
// 获取任务详情
const
getTaskDetail
=
(
data
)
=>
{
getCgTaskDetail
(
data
).
then
((
res
:
any
)
=>
{
...
...
@@ -277,7 +355,9 @@ const getFieldCount = (data) => {
// 获取字段统计
const
getFieldTree
=
(
data
)
=>
{
treeInfo
.
value
.
loading
=
true
;
getTaskExeTreeList
(
data
).
then
((
res
:
any
)
=>
{
treeInfo
.
value
.
loading
=
false
;
if
(
res
.
code
==
proxy
.
$passCode
)
{
const
data
=
res
.
data
||
[];
treeData
.
value
[
0
].
children
.
splice
(
1
);
...
...
@@ -289,6 +369,8 @@ const getFieldTree = (data) => {
fieldItemList
.
value
[
3
].
options
=
JSON
.
parse
(
JSON
.
stringify
(
classifyData
.
value
));
fieldTableInfo
.
value
.
fields
[
4
].
options
=
JSON
.
parse
(
JSON
.
stringify
(
classifyData
.
value
));
}
}).
catch
(()
=>
{
treeInfo
.
value
.
loading
=
false
;
})
}
...
...
@@ -333,9 +415,9 @@ const getFieldTableData = () => {
isClassify
:
checked1
.
value
?
'Y'
:
'N'
,
changeStatus
:
''
,
execGuid
:
taskDetail
.
value
.
execGuid
,
classifyDetailGuid
:
currTreeNode
.
value
.
guid
,
pageIndex
:
fieldTableInfo
.
value
.
page
.
curr
,
pageSize
:
fieldTableInfo
.
value
.
page
.
limit
,
classifyDetailGuid
:
currTreeNode
.
value
.
guid
==
'all'
||
currTreeNode
.
value
.
guid
==
'unclassified'
?
''
:
currTreeNode
.
value
.
guid
,
})
).
then
((
res
:
any
)
=>
{
fieldTableInfo
.
value
.
loading
=
false
;
...
...
@@ -357,6 +439,12 @@ const tableCellClassName = (scope) => {
return
(
scope
.
column
.
label
==
'分类'
||
scope
.
column
.
label
==
'分级'
)
&&
scope
.
row
[
'STATE'
]
===
'Running'
?
'edit_cell'
:
''
}
const
getCascaderCheckedData
=
()
=>
{
const
formCascader
=
cascaderRef
.
value
[
0
]
||
cascaderRef
.
value
;
const
data
=
formCascader
.
getCheckedNodes
();
return
data
;
};
const
tableBtnClick
=
(
scope
,
btn
)
=>
{
const
type
=
btn
.
value
;
const
row
=
scope
.
row
;
...
...
@@ -367,9 +455,24 @@ const tableBtnClick = (scope, btn) => {
}
else
if
(
type
==
"edit"
)
{
row
.
STATE
=
'Running'
;
}
else
if
(
type
==
'save'
)
{
const
cascaderData
=
getCascaderCheckedData
();
row
.
classifyNames
=
cascaderData
.
length
?
cascaderData
.
pathLabels
:
[];
row
.
classifyGuids
=
cascaderData
.
length
?
cascaderData
.
pathValues
:
[];
row
.
classifyDetailGuid
=
cascaderData
.
length
?
cascaderData
.
value
:
''
;
row
.
classifyDetailName
=
cascaderData
.
length
?
cascaderData
.
label
:
''
;
row
.
STATE
=
''
;
if
(
cascaderData
.
length
&&
row
.
gradeDetailGuid
)
{
const
params
=
[
{
guid
:
row
.
guid
,
classifyDetailGuid
:
row
.
classifyDetailGuid
,
classifyDetailName
:
row
.
classifyDetailName
,
gradeDetailGuid
:
row
.
gradeDetailGuid
,
gradeDetailName
:
row
.
gradeDetailName
,
}
];
saveFields
(
params
)
}
}
};
...
...
@@ -401,6 +504,28 @@ const btnClick = async (btn, bType = null) => {
}
};
// 保存字段
const
saveFields
=
(
params
,
isBatch
=
false
)
=>
{
execFieldConfirm
(
params
).
then
((
res
:
any
)
=>
{
if
(
res
.
code
==
proxy
.
$passCode
)
{
ElMessage
.
success
(
'保存成功'
);
isBatch
&&
getFieldTableData
();
}
})
}
// 任务确认
const
saveTask
=
(
params
)
=>
{
execTaskConfirm
(
params
).
then
((
res
:
any
)
=>
{
if
(
res
.
code
==
proxy
.
$passCode
)
{
ElMessage
.
success
(
'保存成功'
);
router
.
push
({
name
:
"taskConfig"
,
});
}
})
}
/** 搜索查询分类分级模板。 */
const
searchSheet
=
(
val
:
any
,
clear
:
boolean
=
false
)
=>
{
if
(
clear
)
{
...
...
@@ -418,6 +543,40 @@ const searchField = (val: any, clear: boolean = false) => {
getFieldTableData
();
};
const
cascaderChange
=
(
val
)
=>
{
// dictionaryGuid.value = val ? val.at(-1) : ''
}
const
selectChange
=
(
val
)
=>
{
// standardSetGuid.value = val
}
const
dialogBtnClick
=
(
btn
,
info
)
=>
{
if
(
btn
.
value
==
'submit'
)
{
// let daInfo = assetListData.value.find(a => a.guid == info.registerGuid);
// savePromise.value = saveQuality({
// tenantGuid: userData.tenantGuid,
// registerGuid: info.registerGuid,
// daName: daInfo.daName,
// registerTime: daInfo.registerTime,
// issuingEntityGuid: daInfo.exchangeGuid,
// qualityEvaluationFile: info.qualityEvaluationFile?.map(f => f.url) || []
// }).then((res: any) => {
// savePromise.value = null;
// if (res?.code == proxy.$passCode) {
// ElMessage.success('质量评价发起成功');
// dialogInfo.value.visible = false;
// page.value.curr = 1;
// getTableData();
// } else {
// ElMessage.error(res.msg);
// }
// })
}
else
if
(
btn
.
value
==
'cancel'
)
{
dialogInfo
.
value
.
visible
=
false
;
}
};
onActivated
(()
=>
{
})
...
...
@@ -513,9 +672,9 @@ onBeforeMount(() => {
</div>
</div>
<div
class=
"table_panel_wrap panel"
>
<div
class=
"table_panel"
>
<div
class=
"table_panel"
v-loading=
"fieldTableInfo.loading"
>
<el-table
ref=
"costTableRef"
:data=
"fieldTableInfo.data"
border
:height=
"'100%'"
style=
"width: 100%; display: inline-block"
:style=
"
{ 'm
in-height': '100%
' }"
style=
"width: 100%; display: inline-block"
:style=
"
{ 'm
ax-height': 'calc(100% - 44px)
' }"
:cell-class-name="tableCellClassName">
<el-table-column
v-for=
"(item, i) in fieldTableInfo.fields"
:label=
"item.label"
:width=
"item.width"
:min-width=
"item.minWidth"
:fixed=
"item.fixed"
:align=
"item.align"
...
...
@@ -530,8 +689,9 @@ onBeforeMount(() => {
v-model=
"scope.row[item.field]"
:placeholder=
"item.placeholder"
:disabled=
"item.disabled ?? false"
:clearable=
"item.clearable ?? true"
size=
"small"
/>
<el-cascader
v-else-if=
"item.type == 'cascader' && scope.row['STATE'] === 'Running'"
v-model=
"scope.row[item.field]"
:options=
"item.options"
:props=
"item.props"
:disabled=
"item.disabled ?? false"
:clearable=
"item.clearable ?? true"
size=
"small"
/>
ref=
"cascaderRef"
v-model=
"scope.row[item.field]"
:options=
"item.options"
:props=
"item.props"
:show-all-levels=
"item.showAllLevels ?? true"
:disabled=
"item.disabled ?? false"
:clearable=
"item.clearable ?? true"
size=
"small"
/>
<span
v-else
>
{{
item
.
getName
?
item
.
getName
(
scope
)
:
scope
.
row
[
item
.
field
]
!==
0
&&
!
scope
.
row
[
item
.
field
]
?
...
...
@@ -562,6 +722,8 @@ onBeforeMount(() => {
</div>
</div>
</div>
<Dialog
:dialogInfo=
"dialogInfo"
@
btnClick=
"dialogBtnClick"
@
cascaderChange=
"cascaderChange"
@
selectChange=
"selectChange"
/>
</div>
</template>
...
...
@@ -733,6 +895,8 @@ onBeforeMount(() => {
.box_right
{
width
:
calc
(
100%
-
240px
);
height
:
100%
;
display
:
flex
;
flex-direction
:
column
;
}
}
}
...
...
@@ -764,15 +928,16 @@ onBeforeMount(() => {
.table_panel_wrap
{
width
:
100%
;
height
:
calc
(
100%
-
4
8
px
);
height
:
calc
(
100%
-
4
9
px
);
padding
:
4px
0
0
;
&.panel
{
height
:
calc
(
100%
-
171px
)
;
flex
:
1
;
.table_panel
{
width
:
100%
;
height
:
100%
;
overflow
:
hidden
;
}
}
...
...
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