Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
V
V3-TailingPond-xiadian
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
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
Kimber
V3-TailingPond-xiadian
Commits
184e8453
Commit
184e8453
authored
Jul 22, 2023
by
forevertyler
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
'charts
parent
4024190e
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
12 additions
and
2 deletions
+12
-2
httpApi.js
src/assets/js/httpApi.js
+12
-2
No files found.
src/assets/js/httpApi.js
View file @
184e8453
...
@@ -1104,6 +1104,7 @@ var reqApis = function () {
...
@@ -1104,6 +1104,7 @@ var reqApis = function () {
var
chartOpts
=
{};
var
chartOpts
=
{};
box
.
onclick
=
function
(
e
)
{
box
.
onclick
=
function
(
e
)
{
chartOpts
.
cache
=
''
var
tag
=
e
.
target
||
e
.
srcElement
;
var
tag
=
e
.
target
||
e
.
srcElement
;
var
divID
=
document
.
getElementById
(
"
contentbox
"
);
var
divID
=
document
.
getElementById
(
"
contentbox
"
);
if
(
tag
.
classList
.
contains
(
'
query
'
))
{
if
(
tag
.
classList
.
contains
(
'
query
'
))
{
...
@@ -1113,6 +1114,7 @@ var reqApis = function () {
...
@@ -1113,6 +1114,7 @@ var reqApis = function () {
};
};
that
.
pageApi
.
reqchart
(
query
).
then
((
res
)
=>
{
that
.
pageApi
.
reqchart
(
query
).
then
((
res
)
=>
{
var
body
=
res
.
body
||
[];
var
body
=
res
.
body
||
[];
chartOpts
.
cache
=
Highchart
.
template
.
rich
.
call
(
that
,
chartEl
,
body
,
chartOpts
);
chartOpts
.
cache
=
Highchart
.
template
.
rich
.
call
(
that
,
chartEl
,
body
,
chartOpts
);
})
})
}
else
if
(
tag
.
classList
.
contains
(
'
cu-btn
'
))
{
}
else
if
(
tag
.
classList
.
contains
(
'
cu-btn
'
))
{
...
@@ -1120,9 +1122,11 @@ var reqApis = function () {
...
@@ -1120,9 +1122,11 @@ var reqApis = function () {
tag
.
classList
.
remove
(
'
cu-btn-null
'
);
tag
.
classList
.
remove
(
'
cu-btn-null
'
);
box
.
tagBtn
=
tag
;
box
.
tagBtn
=
tag
;
query
.
hours
=
~~
tag
.
dataset
.
id
;
query
.
hours
=
~~
tag
.
dataset
.
id
;
console
.
log
(
query
.
hours
,
'
query.hours
'
)
that
.
pageApi
.
reqchart
(
query
).
then
((
res
)
=>
{
that
.
pageApi
.
reqchart
(
query
).
then
((
res
)
=>
{
var
body
=
res
.
body
||
[];
var
body
=
res
.
body
||
[];
if
(
query
.
hours
==
1
)
{
if
(
query
.
hours
)
{
// if (query.hours == 1) {
let
rainData
=
body
.
lists
let
rainData
=
body
.
lists
let
valList
=
rainData
.
map
(
item
=>
{
let
valList
=
rainData
.
map
(
item
=>
{
return
Number
(
item
.
values
.
rainfall
)
return
Number
(
item
.
values
.
rainfall
)
...
@@ -1132,7 +1136,12 @@ var reqApis = function () {
...
@@ -1132,7 +1136,12 @@ var reqApis = function () {
return
total
+
value
;
return
total
+
value
;
},
0
);
},
0
);
num
=
num
.
toFixed
(
2
)
num
=
num
.
toFixed
(
2
)
divID
.
innerHTML
=
"
降雨总量:
"
+
num
+
body
.
danwei
divID
.
innerHTML
=
"
降雨总量:
"
+
num
+
body
.
danwei
;
that
.
pageApi
.
reqchart
(
query
).
then
((
res
)
=>
{
var
body
=
res
.
body
||
[];
chartOpts
.
cache
=
Highchart
.
template
.
rich
.
call
(
that
,
chartEl
,
body
,
chartOpts
);
})
}
else
{
}
else
{
divID
.
innerHTML
=
''
divID
.
innerHTML
=
''
}
}
...
@@ -1143,6 +1152,7 @@ var reqApis = function () {
...
@@ -1143,6 +1152,7 @@ var reqApis = function () {
};
};
};
};
that
.
pageApi
.
reqchart
(
query
).
then
((
res
)
=>
{
that
.
pageApi
.
reqchart
(
query
).
then
((
res
)
=>
{
console
.
log
(
query
,
'
???/
'
)
var
body
=
res
.
body
||
[];
var
body
=
res
.
body
||
[];
chartOpts
.
cache
=
Highchart
.
template
.
rich
.
call
(
that
,
chartEl
,
body
,
chartOpts
);
chartOpts
.
cache
=
Highchart
.
template
.
rich
.
call
(
that
,
chartEl
,
body
,
chartOpts
);
})
})
...
...
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