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
d1ed8df0
Commit
d1ed8df0
authored
May 06, 2022
by
leon
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
feat: data request support view config
parent
81d9e507
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
36 additions
and
6 deletions
+36
-6
http.api.js
common/http.api.js
+7
-0
echartElementData.js
mixins/echartElementData.js
+29
-6
No files found.
common/http.api.js
View file @
d1ed8df0
...
...
@@ -20,6 +20,12 @@ const install = (Vue, vm) => {
loading
:
false
}
})
// 视图
const
buildChart
=
params
=>
postHttp
(
`
${
reportUrl
}
/report/dataview/buildChart`
,
params
,
{
custom
:
{
loading
:
false
}
})
// 检查授权状态
const
getAuthorized
=
params
=>
getHttp
(
`
${
baseUrl
}
/report/user/getAuthorized`
,
params
)
// 获取用户数据
...
...
@@ -41,6 +47,7 @@ const install = (Vue, vm) => {
getReportList
,
getReportCharts
,
dataSetPreview
,
buildChart
,
getAuthorized
,
getUserListCount
,
changePassword
,
...
...
mixins/echartElementData.js
View file @
d1ed8df0
...
...
@@ -70,6 +70,23 @@ export default {
that
.
$u
.
toast
(
Msg
)
}
},
/**
* 视图配置
*/
async
handleViewConfig
(
value
)
{
const
{
viewConfig
}
=
value
if
(
!
viewConfig
.
dataSetId
)
return
const
that
=
this
const
res
=
await
that
.
$u
.
api
.
buildChart
(
viewConfig
)
const
{
Status
,
Msg
,
Result
}
=
res
.
data
if
(
Status
===
'true'
)
{
that
.
elementData
.
dataList
=
Result
}
else
{
message
.
warning
(
Msg
)
}
},
clearTimer
()
{
clearInterval
(
this
.
timer
)
this
.
timer
=
null
...
...
@@ -102,8 +119,7 @@ export default {
if
(
that
.
elementInfo
.
hide
)
return
false
if
(
newVal
.
dataType
===
'static'
)
{
that
.
handleStaticData
(
newVal
)
}
else
if
(
newVal
.
dataType
===
'dynamic'
)
{
}
else
if
(
newVal
.
dataType
===
'dynamic'
)
{
that
.
handleDynamicData
(
newVal
)
if
(
newVal
.
dataPolling
)
{
that
.
timer
=
setInterval
(()
=>
{
...
...
@@ -112,11 +128,9 @@ export default {
}
else
{
clearInterval
(
that
.
timer
)
}
}
else
if
(
newVal
.
dataType
===
'public'
)
{
}
else
if
(
newVal
.
dataType
===
'public'
)
{
that
.
handlePublicData
(
newVal
)
}
else
if
(
newVal
.
dataType
===
'dataSet'
)
{
}
else
if
(
newVal
.
dataType
===
'dataSet'
)
{
that
.
handleDataSet
(
newVal
)
if
(
newVal
.
dataPolling
)
{
that
.
timer
=
setInterval
(()
=>
{
...
...
@@ -125,6 +139,15 @@ export default {
}
else
{
clearInterval
(
that
.
timer
)
}
}
else
if
(
newVal
.
dataType
===
'viewConfig'
)
{
that
.
handleViewConfig
(
newVal
)
if
(
newVal
.
dataPolling
)
{
that
.
timer
=
setInterval
(()
=>
{
that
.
handleViewConfig
(
newVal
)
},
newVal
.
dataPollingInterval
*
1000
)
}
else
{
clearInterval
(
that
.
timer
)
}
}
},
deep
:
true
,
...
...
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