Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Contribute to GitLab
Sign in / Register
Toggle navigation
T
TF-MOM-WEB
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
TFMOM
TF-MOM-WEB
Commits
fddd23bb
Commit
fddd23bb
authored
Oct 16, 2023
by
jingnan
👀
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
合并产品代码【6961】 界面配置无法加载 dee-doc下的组件,控制台报错
parent
5e84d711
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
12 additions
and
0 deletions
+12
-0
index.js
applications/dee-doc/src/asyncCompontents/index.js
+12
-0
No files found.
applications/dee-doc/src/asyncCompontents/index.js
View file @
fddd23bb
import
Vue
from
'vue'
import
_get
from
'lodash.get'
let
resultComps
=
[]
const
requireComponent
=
require
.
context
(
'./'
,
// 在当前目录下查找
...
...
@@ -13,6 +15,7 @@ function findKey(data) {
data
.
forEach
(
el
=>
{
const
comp
=
requireComponent
(
el
)
const
item
=
comp
.
default
item
.
modelRelationObjs
=
getModelRelationObjs
(
item
)
if
(
!
(
item
.
modelRelationObjs
.
length
===
0
||
(
item
.
modelRelationObjs
.
length
===
1
&&
item
.
modelRelationObjs
[
0
]
===
''
)))
{
item
.
modelRelationObjs
.
forEach
(
key
=>
{
if
(
allkey
.
indexOf
(
key
)
<=
-
1
)
{
...
...
@@ -35,6 +38,7 @@ function handleData(data) {
const
item
=
comp
.
default
const
mfileName
=
el
.
split
(
'/'
)[
el
.
split
(
'/'
).
length
-
1
]
Vue
.
component
(
mfileName
.
slice
(
0
,
-
4
),
comp
.
default
)
item
.
modelRelationObjs
=
getModelRelationObjs
(
item
)
if
(
item
.
modelRelationObjs
.
length
===
0
||
(
item
.
modelRelationObjs
.
length
===
1
&&
item
.
modelRelationObjs
[
0
]
===
''
))
{
if
(
!
obj
[
'commonComponent'
])
{
obj
[
'commonComponent'
]
=
[]
...
...
@@ -62,4 +66,12 @@ function handleData(data) {
})
return
obj
}
function
getModelRelationObjs
(
item
)
{
let
modelRelationObjs
=
_get
(
item
,
'modelRelationObjs'
)
modelRelationObjs
=
Array
.
isArray
(
modelRelationObjs
)
?
modelRelationObjs
:
[]
modelRelationObjs
=
modelRelationObjs
.
filter
(
name
=>
!!
(
name
||
''
).
trim
())
return
modelRelationObjs
}
export
default
resultComps
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
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 comment