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
7da36d43
Commit
7da36d43
authored
Jul 11, 2023
by
leon
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
feat:add charts parse data function
parent
ff064991
Expand all
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
499 additions
and
2 deletions
+499
-2
main.js
main.js
+2
-0
charts.js
mixins/charts.js
+491
-0
echartElementData.js
mixins/echartElementData.js
+6
-2
No files found.
main.js
View file @
7da36d43
...
...
@@ -35,5 +35,7 @@ Vue.use(HTTPApi, app)
// 自定义方法
import
common
from
'./utils/common.js'
Vue
.
use
(
common
,
app
)
import
charts
from
'./mixins/charts.js'
Vue
.
use
(
charts
,
app
)
app
.
$mount
()
mixins/charts.js
0 → 100644
View file @
7da36d43
This diff is collapsed.
Click to expand it.
mixins/echartElementData.js
View file @
7da36d43
...
...
@@ -32,7 +32,7 @@ export default {
*/
async
handleDynamicData
(
value
)
{
const
that
=
this
let
{
dataUrl
,
dataMethod
,
dataFormatter
,
dataProcessing
}
=
{
...
value
}
let
{
dataUrl
,
dataMethod
,
dataFormatter
,
dataProcessing
,
dataConfig
}
=
{
...
value
}
if
(
value
.
queryFormatter
)
dataFormatter
=
{...
dataFormatter
,
...
value
.
queryFormatter
}
dataUrl
=
dataUrl
.
replace
(
/^
(\/(
dashboardCharts|dashboardAPI
))?
/
,
''
)
dataFormatter
=
that
.
$u
.
common
.
filterRequestParams
({...
dataFormatter
})
...
...
@@ -41,6 +41,8 @@ export default {
})
if
(
dataProcessing
)
{
that
.
elementData
.
dataList
=
that
.
$u
.
common
.
converFunction
(
dataProcessing
,
res
.
data
,
value
.
queryFormatter
)
}
else
if
(
dataConfig
&&
dataConfig
.
value
&&
dataConfig
.
value
.
length
)
{
that
.
elementData
.
dataList
=
that
.
$u
.
charts
.
parseChartData
(
res
.
data
,
that
.
elementInfo
)
}
else
{
that
.
elementData
.
dataList
=
JSON
.
parse
(
JSON
.
stringify
(
res
.
data
.
Result
))
}
...
...
@@ -50,9 +52,11 @@ export default {
*/
handlePublicData
(
value
)
{
if
(
!
this
.
vuex_globalData
)
return
const
{
dataProcessing
}
=
{
...
value
}
const
{
dataProcessing
,
dataConfig
}
=
{
...
value
}
if
(
dataProcessing
)
{
this
.
elementData
.
dataList
=
this
.
$u
.
common
.
converFunction
(
dataProcessing
,
this
.
vuex_globalData
,
value
.
queryFormatter
)
}
else
if
(
dataConfig
&&
dataConfig
.
value
&&
dataConfig
.
value
.
length
)
{
this
.
elementData
.
dataList
=
this
.
$u
.
charts
.
parseChartData
(
this
.
vuex_globalData
,
this
.
elementInfo
)
}
else
{
this
.
elementData
.
dataList
=
this
.
vuex_globalData
}
...
...
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