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
36b9ee49
authored
2025-04-02 17:51:45 +0800
by
lihua
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
解决盘点按文件新建字段匹配分级分类
1 parent
ba77c5f9
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
5 additions
and
35 deletions
src/api/modules/dataInventory.ts
src/views/data_inventory/tableCreateFile.vue
src/api/modules/dataInventory.ts
View file @
36b9ee4
...
...
@@ -842,7 +842,7 @@ export const getBizRuleConfigDetail = (params) => request({
// })
export
const
getFidldEnName
=
(
data
)
=>
request
({
url
:
`
${
import
.
meta
.
env
.
VITE_APP_C
OMMON_URL
}
/common
/convert-field-ch-name`
,
url
:
`
${
import
.
meta
.
env
.
VITE_APP_C
HECK_BASEURL
}
/db-dir
/convert-field-ch-name`
,
method
:
'post'
,
data
})
...
...
src/views/data_inventory/tableCreateFile.vue
View file @
36b9ee4
...
...
@@ -115,7 +115,10 @@ const uploadFileRef = ref();
const
getSubjectField
=
()
=>
{
tableFieldsLoading
.
value
=
true
;
getFidldEnName
(
fileTableFields
.
value
.
map
(
f
=>
f
.
chName
)).
then
(
async
(
res
:
any
)
=>
{
getFidldEnName
({
fieldName
:
fileTableFields
.
value
.
map
(
f
=>
f
.
chName
),
execGuid
:
execGuid
.
value
}).
then
(
async
(
res
:
any
)
=>
{
tableFieldsLoading
.
value
=
false
;
if
(
res
.
code
==
proxy
.
$passCode
)
{
tableCreateInfo
.
value
.
tableFields
=
res
.
data
?.
map
((
field
,
i
)
=>
{
...
...
@@ -134,39 +137,6 @@ const getSubjectField = () => {
tableCreateInfo
.
value
.
tableFields
.
forEach
((
item
:
any
)
=>
{
tempFileNames
.
push
(
item
.
fieldName
);
});
const
classify
:
any
=
await
getFieldClassifyAndGrade
({
fieldName
:
tempFileNames
,
execGuid
:
execGuid
.
value
,
type
:
'C'
})
const
grade
:
any
=
await
getFieldClassifyAndGrade
({
fieldName
:
tempFileNames
,
execGuid
:
execGuid
.
value
,
type
:
'G'
})
// 通过分类数据和分级数据赋值给 tableFields 的每一项
tableCreateInfo
.
value
.
tableFields
.
forEach
((
item
:
any
)
=>
{
// 在分类数据中查找对应 fieldName 的项
const
classifyItem
=
classify
.
find
((
classify
:
any
)
=>
classify
.
fieldName
===
item
.
fieldName
);
// 在分级数据中查找对应 fieldName 的项
const
gradeItem
=
grade
.
find
((
grade
:
any
)
=>
grade
.
fieldName
===
item
.
fieldName
);
// 如果找到对应的分类数据,赋值给 tableFields 的相应项
if
(
classifyItem
)
{
item
.
classifyDetailGuid
=
classifyItem
.
classifyDetailGuid
||
null
;
item
.
classifyDetailName
=
classifyItem
.
classifyDetailName
||
null
;
item
.
classifyDetailGuidRoutes
=
classifyItem
.
classifyDetailGuidRoutes
||
null
;
item
.
classifyDetailNameRoutes
=
classifyItem
.
classifyDetailNameRoutes
||
null
;
}
// 如果找到对应的分级数据,赋值给 tableFields 的相应项
if
(
gradeItem
)
{
item
.
gradeDetailGuid
=
gradeItem
.
gradeDetailGuid
||
null
;
item
.
gradeDetailName
=
gradeItem
.
gradeDetailName
||
null
;
}
});
}
else
{
ElMessage
.
error
(
res
.
msg
);
}
...
...
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