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
d317a29e
authored
2024-12-24 17:25:40 +0800
by
xukangle
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
update :分类分级 增加滚动条
1 parent
f278ba6b
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
17 additions
and
58 deletions
src/views/data_inventory/tableCreateExisting.vue
src/views/data_inventory/tableCreateExisting.vue
View file @
d317a29
...
...
@@ -78,7 +78,7 @@ const treeSelectProps = {
};
const
treeSelectOptions
=
ref
<
any
>
([]);
// 存储引用的refGradeGuid
const
refGradeGuid
List
=
ref
<
any
>
([]
);
const
refGradeGuid
=
ref
<
any
>
(
);
const
getFieldTree
=
()
=>
{
getTaskExeTreeList
({
execGuid
:
execGuid
.
value
}).
then
((
res
:
any
)
=>
{
if
(
res
.
code
==
proxy
.
$passCode
)
{
...
...
@@ -86,11 +86,6 @@ const getFieldTree = () => {
classifyList
.
value
=
data
;
treeSelectOptions
.
value
=
data
;
// 遍历data,找到refGradeGuid,不用递归,找第一层
data
.
forEach
(
item
=>
{
if
(
item
.
refGradeGuid
)
{
refGradeGuidList
.
value
.
push
(
item
.
refGradeGuid
);
}
});
}
else
{
ElMessage
.
error
(
res
.
msg
);
...
...
@@ -102,46 +97,29 @@ const getFieldTree = () => {
// 获取分类名称的方法
const
matchedItem
=
ref
<
any
>
();
const
getClassifyName
=
(
guid
)
=>
{
const
findClassify
=
(
data
,
guid
)
=>
{
for
(
const
item
of
data
)
{
if
(
item
.
guid
===
guid
)
{
matchedItem
.
value
=
item
;
return
item
.
classifyName
;
}
// 确保 children 是一个数组
if
(
Array
.
isArray
(
item
.
children
))
{
const
childResult
=
findClassify
(
item
.
children
,
guid
);
if
(
childResult
)
return
childResult
;
}
}
return
null
;
};
const
result
=
findClassify
(
treeSelectOptions
.
value
,
guid
);
return
result
;
};
// 获取分级的数据
const
gradeSelectProps
=
{
value
:
'guid'
,
label
:
'name'
,
}
const
getGradeName
=
(
guid
)
=>
{
const
grade
=
gradeList
.
value
.
find
(
item
=>
item
.
guid
===
guid
);
return
grade
?
grade
.
gradeName
:
''
;
}
// 进入编辑模式
const
editRow
=
(
row
)
=>
{
console
.
log
(
'进入编辑模式'
,
row
)
// 进入编辑模式时,查找classifyDetailGuid
console
.
log
(
'进入编辑模式'
,
row
.
classifyDetailGuid
)
// 进入编辑模式时,查找classifyDetailGuid所在的refGradeGuid
treeSelectOptions
.
value
.
forEach
(
item
=>
{
if
(
item
.
classifyDetailGuid
===
row
.
classifyDetailGuid
)
{
refGradeGuid
.
value
=
item
.
refGradeGuid
;
}
});
getGradeList
({
classifyGradeGuid
:
row
.
refGradeGuid
,
pageIndex
:
1
,
pageSize
:
-
1
}).
then
((
res
:
any
)
=>
{
console
.
log
(
'row进来了吗'
)
if
(
res
.
code
===
proxy
.
$passCode
)
{
row
.
gradeOptions
=
res
.
data
.
records
||
[];
}
else
{
ElMessage
.
error
(
res
.
msg
);
}
});
// 这个是指定是否能编辑的字段
...
...
@@ -170,9 +148,6 @@ const stepsInfo = ref({
const
datasourceSelectedRows
:
Ref
<
any
>
=
ref
([]);
//记录下一步时选中的库表信息。
const
selectedDatabaseTable
:
Ref
<
any
>
=
ref
([]);
// 记录数据库databaseGuid
const
handlDsSelectedChange
=
(
v
,
guid
)
=>
{
datasourceSelectedRows
.
value
=
v
||
[];
...
...
@@ -199,7 +174,6 @@ const nextStep = async () => {
return
;
}
getFieldTree
();
initializeTableData
();
stepsInfo
.
value
.
step
=
1
;
};
...
...
@@ -213,22 +187,7 @@ const getNextTableInfo = async (params) => {
}
};
// 初始化表格分级数据显示
const
initializeTableData
=
()
=>
{
console
.
log
(
'初始化表格分级数据显示'
,
refGradeGuidList
.
value
)
tableDataDetailInfo
.
value
.
forEach
((
row
)
=>
{
if
(
row
.
refGradeGuid
)
{
getGradeList
({
classifyGradeGuid
:
row
.
refGradeGuid
,
pageIndex
:
1
,
pageSize
:
-
1
}).
then
((
res
:
any
)
=>
{
console
.
log
(
'row进来了吗'
)
if
(
res
.
code
===
proxy
.
$passCode
)
{
row
.
gradeOptions
=
res
.
data
.
records
||
[];
}
else
{
ElMessage
.
error
(
res
.
msg
);
}
});
}
});
};
const
handleClassifyChange
=
(
row
)
=>
{
if
(
!
row
.
classifyDetailGuid
)
{
...
...
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