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
Hide 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
...
@@ -3,31 +3,33 @@
...
@@ -3,31 +3,33 @@
<p
<p
:class=
"[elementInfo.marquee.isOpen ? 'merquee-txt' : '' ]"
:class=
"[elementInfo.marquee.isOpen ? 'merquee-txt' : '' ]"
:style=
"
{
:style=
"
{
'font-size':`${elementInfo.option.title.textStyle.fontSize}px`,
'font-size':`${elementInfo.option.title.textStyle.fontSize}px`,
'color': elementInfo.option.title.textStyle.color,
'color': elementInfo.option.title.textStyle.color,
'font-weight': elementInfo.option.title.textStyle.fontWeight,
'font-weight': elementInfo.option.title.textStyle.fontWeight,
'text-align': elementInfo.option.title.left,
'text-align': elementInfo.option.title.left,
'animation-duration':`${elementInfo.marquee.speed ? elementInfo.marquee.speed : defaultSpeed}s`
'animation-duration':`${elementInfo.marquee.speed ? elementInfo.marquee.speed : defaultSpeed}s`
}"
}"
>
>
{{
elementInfo
.
option
.
title
.
text
}}
{{
text
}}
</p>
</p>
</view>
</view>
</
template
>
</
template
>
<
script
>
<
script
>
import
echartElementData
from
'@/mixins/echartElementData.js'
export
default
{
export
default
{
name
:
"BasicText"
,
name
:
"BasicText"
,
props
:
{
mixins
:
[
echartElementData
],
elementInfo
:
{
type
:
Object
,
required
:
true
}
},
data
()
{
data
()
{
return
{
return
{
defaultSpeed
:
5
defaultSpeed
:
5
,
text
:
''
};
};
},
methods
:
{
initChart
()
{
this
.
text
=
this
.
elementData
.
dataList
.
text
||
this
.
elementInfo
.
option
.
title
.
text
}
}
}
}
}
</
script
>
</
script
>
...
...
components/NormalTabs/NormalTabs.vue
View file @
5c7db1f7
...
@@ -55,7 +55,7 @@
...
@@ -55,7 +55,7 @@
/**
/**
* 改变选项卡的值
* 改变选项卡的值
*/
*/
tabsValueChange
()
{
tabsValueChange
()
{
const
{
index
,
paramName
,
data
}
=
this
.
elementInfo
.
child
const
{
index
,
paramName
,
data
}
=
this
.
elementInfo
.
child
if
(
this
.
elementInfo
.
child
.
type
===
'param'
)
{
if
(
this
.
elementInfo
.
child
.
type
===
'param'
)
{
uni
.
$emit
(
'handleLinkParams'
,
{
index
,
paramName
,
value
:
this
.
tabsValue
})
uni
.
$emit
(
'handleLinkParams'
,
{
index
,
paramName
,
value
:
this
.
tabsValue
})
...
...
pages/index/index.vue
View file @
5c7db1f7
...
@@ -159,11 +159,15 @@
...
@@ -159,11 +159,15 @@
handleValueChange
(
index
,
paramName
,
value
)
{
handleValueChange
(
index
,
paramName
,
value
)
{
if
(
index
.
length
&&
paramName
&&
value
)
{
if
(
index
.
length
&&
paramName
&&
value
)
{
this
.
reportData
.
map
(
item
=>
{
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
=
{}
if
(
!
item
.
data
.
dataFormatter
)
item
.
data
.
dataFormatter
=
{}
this
.
$set
(
item
.
data
.
dataFormatter
,
paramName
,
value
)
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
=
{}
if
(
!
item
.
data
.
dataSetInfo
.
queryFormatter
)
item
.
data
.
dataSetInfo
.
queryFormatter
=
{}
this
.
$set
(
item
.
data
.
dataSetInfo
.
queryFormatter
,
paramName
,
value
)
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