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
82a6de26
authored
2024-12-26 09:36:49 +0800
by
xukangle
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
fix : 修复标签管理递归函数
1 parent
cf478289
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
35 additions
and
28 deletions
src/views/data_inventory/classStandardEdit.vue
src/views/data_inventory/classifyGradEdit.vue
src/views/data_inventory/dataLabel.vue
src/views/data_inventory/classStandardEdit.vue
View file @
82a6de2
...
...
@@ -116,7 +116,7 @@ const tableInfo = ref({
btns
:
[
{
label
:
"编辑"
,
value
:
"edit"
,
click
:
(
scope
)
=>
{
// console.log(drawerRef.value.drawerFormRef[0].ruleFormRef
);
console
.
log
(
scope
.
row
);
currentEditingGuid
.
value
=
scope
.
row
.
guid
;
selectParentEdit
(
scope
.
row
.
guid
);
currTableInfo
.
value
=
scope
.
row
;
...
...
@@ -387,7 +387,7 @@ const findStandardName = (guid: string) => {
const
item
:
any
=
classifyGradListData
.
value
.
find
((
item
:
any
)
=>
item
.
guid
==
guid
);
return
item
?
item
.
name
:
''
;
}
const
tableRef
=
ref
(
null
);
// 表格的 ref
// 获取分类树形列表
const
treeListParams
=
ref
({
pageIndex
:
1
,
...
...
@@ -404,6 +404,7 @@ const getTreeListData = async () => {
classEditFormItems
.
value
[
2
].
options
=
treeListData
.
value
;
shapeTreeListData
.
value
=
treeListData
.
value
;
tableInfo
.
value
.
loading
=
false
;
}
else
{
proxy
.
$ElMessage
.
error
(
res
.
msg
);
}
...
...
@@ -816,6 +817,11 @@ onMounted(() => {
})
const
isExpand
=
ref
<
boolean
>
(
router
.
currentRoute
.
value
.
query
.
isExpand
==
'true'
);
const
isExpand1
=
ref
<
boolean
>
(
true
);
const
expand
=
(
item
)
=>
{
console
.
log
(
item
);
isExpand1
.
value
=
item
}
</
script
>
...
...
@@ -827,13 +833,13 @@ const isExpand = ref<boolean>(router.currentRoute.value.query.isExpand == 'true'
<Form
ref=
"formRef"
:itemList=
"classStandardFormItems"
formId=
"main-model-edit"
col=
"col3"
/>
</ContentWrap>
<ContentWrap
id=
"id-classStandard"
class=
"detail-content"
title=
"分类规则"
description=
""
style=
"margin-top:16px; height: calc(100% - 161px)"
>
style=
"margin-top:16px; height: calc(100% - 161px)"
:expandSwicth=
"true"
:isExpand=
"isExpand1"
@
expand=
"expand"
>
<div
class=
"tools_btns"
>
<el-button
v-show=
"dataShowMethod == 'table'"
type=
"primary"
@
click=
"newCreateClass"
>
添加规则
</el-button>
<!--
<el-button
v-show=
"dataShowMethod == 'table'"
@
click=
"importClass"
>
导入分类
</el-button>
-->
<el-button
class=
"show-change-btn"
@
click=
"changeShowMethod"
>
{{
'图形展示'
}}
</el-button>
</div>
<Table
v-show=
"dataShowMethod == 'table'"
:tableInfo=
"tableInfo"
/>
<Table
v-show=
"dataShowMethod == 'table'"
:tableInfo=
"tableInfo"
:ref=
"tableRef"
/>
<div
ref=
"shapeMain"
class=
"shape-main"
v-show=
"dataShowMethod != 'table'"
></div>
<div
v-if=
"showNodeDetails"
class=
"node-details-popup"
:style=
"
{ top: popupPosition.top + 'px', left: popupPosition.left + 'px' }">
...
...
src/views/data_inventory/classifyGradEdit.vue
View file @
82a6de2
...
...
@@ -140,7 +140,7 @@ const tableInfo = ref({
console
.
log
(
scope
);
filterDataGradeEdit
(
scope
.
row
.
dataGrade
);
newCreateGradeStandardDialogInfo
.
value
.
visible
=
true
;
newCreateGradeStandardDialogInfo
.
value
.
title
=
'编辑
标准
'
;
newCreateGradeStandardDialogInfo
.
value
.
title
=
'编辑
规则
'
;
newCreateGradeFormItems
.
value
.
forEach
(
item
=>
{
item
.
default
=
scope
.
row
[
item
.
field
];
})
...
...
@@ -268,7 +268,7 @@ const newCreateGradeFormRules = ref({
const
newCreateGradeStandardDialogInfo
=
ref
({
visible
:
false
,
size
:
860
,
title
:
"新增
标准
"
,
title
:
"新增
规则
"
,
type
:
""
,
formInfo
:
{
id
:
"grade-form"
,
...
...
@@ -282,7 +282,7 @@ const newCreateGradeStandardDialogInfo = ref({
},
submit
:
async
(
btn
,
info
)
=>
{
newCreateGradeStandardDialogInfo
.
value
.
submitBtnLoading
=
true
;
if
(
newCreateGradeStandardDialogInfo
.
value
.
title
===
'编辑
标准
'
)
{
if
(
newCreateGradeStandardDialogInfo
.
value
.
title
===
'编辑
规则
'
)
{
const
params
=
{
...
info
,
guid
:
editClassifyGradeGuid
.
value
,
...
...
@@ -293,7 +293,7 @@ const newCreateGradeStandardDialogInfo = ref({
if
(
res
.
code
==
proxy
.
$passCode
)
{
proxy
.
$ElMessage
({
type
:
'success'
,
message
:
'编辑
标准
成功'
message
:
'编辑
规则
成功'
})
getGradeListData
();
newCreateGradeStandardDialogInfo
.
value
.
submitBtnLoading
=
false
;
...
...
@@ -311,7 +311,7 @@ const newCreateGradeStandardDialogInfo = ref({
if
(
res
.
code
==
proxy
.
$passCode
)
{
proxy
.
$ElMessage
({
type
:
'success'
,
message
:
'新增
标准
成功'
message
:
'新增
规则
成功'
})
getGradeListData
();
newCreateGradeStandardDialogInfo
.
value
.
submitBtnLoading
=
false
;
...
...
@@ -326,7 +326,7 @@ const newCreateGradeStandardDialogInfo = ref({
const
newStandard
=
()
=>
{
filterDataGrade
();
newCreateGradeStandardDialogInfo
.
value
.
title
=
'新增
标准
'
;
newCreateGradeStandardDialogInfo
.
value
.
title
=
'新增
规则
'
;
newCreateGradeStandardDialogInfo
.
value
.
visible
=
true
;
newCreateGradeFormItems
.
value
.
forEach
(
item
=>
item
.
default
=
''
);
}
...
...
@@ -396,7 +396,7 @@ const cancel = () => {
<ContentWrap
id=
"id-grade-info"
title=
"分级规则"
class=
"detail-content"
description=
""
style=
"margin-top: 8px;"
>
<div
class=
"content"
v-loading=
"fullscreenLoading"
>
<div
class=
"table-top-btns"
>
<el-button
type=
"primary"
@
click=
"newStandard"
>
新增
标准
</el-button>
<el-button
type=
"primary"
@
click=
"newStandard"
>
新增
规则
</el-button>
<el-button
@
click=
"batchRemobe"
>
批量删除
</el-button>
</div>
<Table
ref=
"tableRef"
:tableInfo=
"tableInfo"
@
tableSelectionChange=
"onTableSelectChange"
/>
...
...
src/views/data_inventory/dataLabel.vue
View file @
82a6de2
...
...
@@ -148,32 +148,33 @@ const findTopParentNode = (node: any) => {
if
(
!
node
)
return
;
// 判断是否为最后一层
i
f
(
node
.
childNodes
.
length
===
0
)
{
isLastLayer
.
value
=
true
;
i
sLastLayer
.
value
=
node
.
childNodes
.
length
===
0
;
if
(
isLastLayer
.
value
)
{
atGradeinfo
.
value
=
node
.
data
;
}
else
{
isLastLayer
.
value
=
false
;
}
// 如果当前节点的父节点符合条件
if
(
node
.
parent
&&
node
.
parent
.
data
.
type
===
'C'
)
{
findNodeDetails
.
value
=
node
.
parent
.
data
;
return
;
// 停止递归
}
// 递归向上查找符合条件的祖先节点
const
findCParent
=
(
currentNode
:
any
):
any
=>
{
if
(
!
currentNode
?.
parent
)
return
null
;
// 没有父节点,停止递归
if
(
currentNode
.
parent
.
data
?.
type
===
'C'
)
{
return
currentNode
.
parent
;
// 找到符合条件的节点
}
return
findCParent
(
currentNode
.
parent
);
// 继续向上查找
};
// 如果当前节点的祖父节点符合条件
if
(
node
.
parent
?.
parent
&&
node
.
parent
.
parent
.
data
.
type
===
'C'
)
{
findNodeDetails
.
value
=
node
.
parent
.
parent
.
data
;
return
;
// 停止递归
}
// 查找最接近的符合条件的祖先节点
const
topParent
=
findCParent
(
node
);
//
如果未找到,继续递归向上查找
if
(
node
.
p
arent
)
{
find
TopParentNode
(
node
.
parent
)
;
//
更新结果
if
(
topP
arent
)
{
find
NodeDetails
.
value
=
topParent
.
data
;
}
};
const
nodeClick
=
(
data
,
node
)
=>
{
findTopParentNode
(
node
);
newCreateGradeFormItems
.
value
[
1
].
options
=
transformDataForTree
([
findNodeDetails
.
value
])
...
...
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