Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in
Toggle navigation
E
ec-report-refactor
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
lihuizhen
ec-report-refactor
Commits
5c7db1f7
Commit
5c7db1f7
authored
Jan 26, 2022
by
Jenny
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
feat: 文本组件支持动态数据和传参
parent
ccbda6f0
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
23 additions
and
17 deletions
+23
-17
BasicText.vue
components/BasicText/BasicText.vue
+16
-14
NormalTabs.vue
components/NormalTabs/NormalTabs.vue
+1
-1
index.vue
pages/index/index.vue
+6
-2
No files found.
components/BasicText/BasicText.vue
View file @
5c7db1f7
...
...
@@ -10,24 +10,26 @@
'animation-duration':`${elementInfo.marquee.speed ? elementInfo.marquee.speed : defaultSpeed}s`
}"
>
{{
elementInfo
.
option
.
title
.
text
}}
{{
text
}}
</p>
</view>
</
template
>
<
script
>
import
echartElementData
from
'@/mixins/echartElementData.js'
export
default
{
name
:
"BasicText"
,
props
:
{
elementInfo
:
{
type
:
Object
,
required
:
true
}
},
mixins
:
[
echartElementData
],
data
()
{
return
{
defaultSpeed
:
5
defaultSpeed
:
5
,
text
:
''
};
},
methods
:
{
initChart
()
{
this
.
text
=
this
.
elementData
.
dataList
.
text
||
this
.
elementInfo
.
option
.
title
.
text
}
}
}
</
script
>
...
...
components/NormalTabs/NormalTabs.vue
View file @
5c7db1f7
pages/index/index.vue
View file @
5c7db1f7
...
...
@@ -159,11 +159,15 @@
handleValueChange
(
index
,
paramName
,
value
)
{
if
(
index
.
length
&&
paramName
&&
value
)
{
this
.
reportData
.
map
(
item
=>
{
if
(
index
.
includes
(
item
.
id
)
&&
item
.
data
.
dataType
===
'dynamic'
)
{
const
flag
=
index
.
includes
(
item
.
id
)
if
(
flag
&&
item
.
type
===
'BasicText'
&&
item
.
data
.
dataType
===
'static'
)
{
this
.
$set
(
item
.
data
.
dataList
,
'text'
,
value
)
}
if
(
flag
&&
item
.
data
.
dataType
===
'dynamic'
)
{
if
(
!
item
.
data
.
dataFormatter
)
item
.
data
.
dataFormatter
=
{}
this
.
$set
(
item
.
data
.
dataFormatter
,
paramName
,
value
)
}
if
(
index
.
includes
(
item
.
id
)
&&
item
.
data
.
dataType
===
'dataSet'
)
{
if
(
flag
&&
item
.
data
.
dataType
===
'dataSet'
)
{
if
(
!
item
.
data
.
dataSetInfo
.
queryFormatter
)
item
.
data
.
dataSetInfo
.
queryFormatter
=
{}
this
.
$set
(
item
.
data
.
dataSetInfo
.
queryFormatter
,
paramName
,
value
)
}
...
...
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