Skip to content
Toggle navigation
Projects
Groups
Snippets
Help
h5
/
glsk-data-view-pd
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Merge Requests
0
Pipelines
Wiki
Settings
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit a4286ff5
authored
Jul 13, 2023
by
胡悦
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
修改
1 parent
d4a62abc
Show whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
34 additions
and
18 deletions
src/api/request.js
src/components/ViewDate.vue
src/store/modules/app.js
src/views/home/pages/ViewSolar.vue
src/views/home/solar/ContentLeft.vue
src/views/home/solar/MerchantTrends.vue
src/views/home/solar/PurchaseTrends.vue
src/api/request.js
View file @
a4286ff
...
@@ -3,20 +3,20 @@
...
@@ -3,20 +3,20 @@
* @Author: huyue
* @Author: huyue
* @Date: 2023-07-04 11:40:34
* @Date: 2023-07-04 11:40:34
* @LastEditors: huyue
* @LastEditors: huyue
* @LastEditTime: 2023-07-
04 11:40:40
* @LastEditTime: 2023-07-
13 17:55:25
*/
*/
class
Request
{
class
Request
{
DOMAIN
=
'/dev'
DOMAIN
=
'/dev'
constructor
(
_request_
)
{
constructor
(
_request_
)
{
this
.
DOMAIN
=
_request_
?
_request_
.
baseURL
:
this
.
DOMAIN
this
.
DOMAIN
=
_request_
?
_request_
.
baseURL
:
this
.
DOMAIN
}
}
get
(
url
,
params
,
returnAll
)
{
get
(
url
,
params
,
returnAll
)
{
return
this
.
request
(
'GET'
,
url
,
params
,
returnAll
)
return
this
.
request
(
'GET'
,
url
,
params
,
returnAll
)
}
}
post
(
url
,
params
,
returnAll
)
{
post
(
url
,
params
,
returnAll
)
{
return
this
.
request
(
'POST'
,
url
,
params
,
returnAll
)
return
this
.
request
(
'POST'
,
url
,
params
,
returnAll
)
}
}
request
(
method
,
url
,
params
,
returnAll
)
{
request
(
method
,
url
,
params
,
returnAll
)
{
var
requestConfig
=
{
var
requestConfig
=
{
headers
:
{
headers
:
{
// 'Content-Type': method == 'GET' ? 'application/json' : 'application/x-www-form-urlencoded; charset=UTF-8'
// 'Content-Type': method == 'GET' ? 'application/json' : 'application/x-www-form-urlencoded; charset=UTF-8'
...
@@ -26,7 +26,7 @@ class Request {
...
@@ -26,7 +26,7 @@ class Request {
}
}
if
(
method
===
'GET'
)
{
if
(
method
===
'GET'
)
{
var
paramsArray
=
[]
var
paramsArray
=
[]
params
&&
Object
.
keys
(
params
.
req
).
forEach
(
key
=>
paramsArray
.
push
(
'req.'
+
key
+
'='
+
params
.
req
[
key
]))
params
&&
Object
.
keys
(
params
).
forEach
(
key
=>
paramsArray
.
push
(
key
+
'='
+
params
[
key
]))
if
(
url
.
search
(
/
\?
/
)
===
-
1
)
{
if
(
url
.
search
(
/
\?
/
)
===
-
1
)
{
url
+=
'?'
+
paramsArray
.
join
(
'&'
)
url
+=
'?'
+
paramsArray
.
join
(
'&'
)
}
else
{
}
else
{
...
...
src/components/ViewDate.vue
View file @
a4286ff
...
@@ -3,7 +3,7 @@
...
@@ -3,7 +3,7 @@
* @Author: huyue
* @Author: huyue
* @Date: 2023-07-05 10:35:43
* @Date: 2023-07-05 10:35:43
* @LastEditors: huyue
* @LastEditors: huyue
* @LastEditTime: 2023-07-13 1
5:56
:27
* @LastEditTime: 2023-07-13 1
7:33
:27
-->
-->
<
template
>
<
template
>
<div
class=
"view-date"
>
统计年份:
<div
class=
"view-date"
>
统计年份:
...
@@ -42,6 +42,7 @@ export default {
...
@@ -42,6 +42,7 @@ export default {
},
},
selectVal
(
val
)
{
selectVal
(
val
)
{
this
.
year
=
val
this
.
year
=
val
this
.
$emit
(
'yearValue'
,
val
)
this
.
switchYear
()
this
.
switchYear
()
},
},
clickOutside
()
{
clickOutside
()
{
...
...
src/store/modules/app.js
View file @
a4286ff
...
@@ -4,23 +4,30 @@
...
@@ -4,23 +4,30 @@
* @Author: limin
* @Author: limin
* @Date: 2021-06-07 14:12:32
* @Date: 2021-06-07 14:12:32
* @LastEditors: huyue
* @LastEditors: huyue
* @LastEditTime: 2023-07-
04 11:46:21
* @LastEditTime: 2023-07-
13 17:31:56
*/
*/
const
state
=
{
const
state
=
{
reportParams
:
{
reportParams
:
{
reportType
:
0
//月表0,日表1
reportType
:
0
// 月表0,日表1
}
},
solarYear
:
'2023'
}
}
const
mutations
=
{
const
mutations
=
{
SET_PAGE_META
(
state
,
meta
)
{
SET_PAGE_META
(
state
,
meta
)
{
state
.
pageMeta
=
meta
state
.
pageMeta
=
meta
},
},
SET_SOLAR_YEAR
(
state
,
meta
)
{
state
.
solarYear
=
meta
}
}
}
const
actions
=
{
const
actions
=
{
// 设置name
// 设置name
setUserInfo
({
commit
},
user
)
{
setUserInfo
({
commit
},
user
)
{
commit
(
'SET_USER_INFO'
,
user
)
commit
(
'SET_USER_INFO'
,
user
)
},
},
setSolarYear
({
commit
},
year
)
{
commit
(
'SET_SOLAR_YEAR'
,
year
)
}
}
}
export
default
{
export
default
{
...
...
src/views/home/pages/ViewSolar.vue
View file @
a4286ff
...
@@ -3,11 +3,11 @@
...
@@ -3,11 +3,11 @@
* @Author: huyue
* @Author: huyue
* @Date: 2023-07-04 13:56:33
* @Date: 2023-07-04 13:56:33
* @LastEditors: huyue
* @LastEditors: huyue
* @LastEditTime: 2023-07-13 1
5:47:43
* @LastEditTime: 2023-07-13 1
7:43:57
-->
-->
<
template
>
<
template
>
<div
class=
"view-content"
>
<div
class=
"view-content"
>
<ViewDate
:businessTime=
"businessTime"
></ViewDate>
<ViewDate
:businessTime=
"businessTime"
@
yearValue=
"yearValue"
></ViewDate>
<div
class=
"content"
>
<div
class=
"content"
>
<ContentLeft></ContentLeft>
<ContentLeft></ContentLeft>
<ContentRight></ContentRight>
<ContentRight></ContentRight>
...
@@ -17,6 +17,7 @@
...
@@ -17,6 +17,7 @@
<
script
>
<
script
>
import
ContentLeft
from
'../solar/ContentLeft'
import
ContentLeft
from
'../solar/ContentLeft'
import
ContentRight
from
'../solar/ContentRight.vue'
import
ContentRight
from
'../solar/ContentRight.vue'
import
{
mapActions
}
from
'vuex'
export
default
{
export
default
{
name
:
'ViewSolar'
,
name
:
'ViewSolar'
,
components
:
{
components
:
{
...
@@ -25,6 +26,8 @@ export default {
...
@@ -25,6 +26,8 @@ export default {
},
},
props
:
{
props
:
{
},
},
computed
:
{
},
data
()
{
data
()
{
return
{
return
{
businessTime
:
''
businessTime
:
''
...
@@ -36,6 +39,10 @@ export default {
...
@@ -36,6 +39,10 @@ export default {
})
})
},
},
methods
:
{
methods
:
{
...
mapActions
([
'setSolarYear'
]),
yearValue
(
val
)
{
this
.
setSolarYear
(
val
)
}
}
}
}
}
</
script
>
</
script
>
...
...
src/views/home/solar/ContentLeft.vue
View file @
a4286ff
...
@@ -3,7 +3,7 @@
...
@@ -3,7 +3,7 @@
* @Author: huyue
* @Author: huyue
* @Date: 2023-07-05 10:35:43
* @Date: 2023-07-05 10:35:43
* @LastEditors: huyue
* @LastEditors: huyue
* @LastEditTime: 2023-07-13 1
6:38:26
* @LastEditTime: 2023-07-13 1
8:01:02
-->
-->
<
template
>
<
template
>
<div
class=
"left"
>
<div
class=
"left"
>
...
@@ -90,7 +90,8 @@ export default {
...
@@ -90,7 +90,8 @@ export default {
this
.
getSolarList
()
this
.
getSolarList
()
},
},
async
getSolarList
()
{
async
getSolarList
()
{
const
_data
=
await
this
.
api
.
solar
.
getAllPurchase
({
req
:
{
year
:
2023
}})
console
.
log
(
this
.
$store
.
state
)
const
_data
=
await
this
.
api
.
solar
.
getAllPurchase
({
year
:
2023
})
const
_dataList
=
_data
.
data
.
dataList
[
0
]
const
_dataList
=
_data
.
data
.
dataList
[
0
]
console
.
log
(
_dataList
)
console
.
log
(
_dataList
)
this
.
$bus
.
$emit
(
'businessstarttime'
,
_dataList
.
businessstarttime
)
this
.
$bus
.
$emit
(
'businessstarttime'
,
_dataList
.
businessstarttime
)
...
...
src/views/home/solar/MerchantTrends.vue
View file @
a4286ff
...
@@ -3,7 +3,7 @@
...
@@ -3,7 +3,7 @@
* @Author: huyue
* @Author: huyue
* @Date: 2023-07-06 16:19:15
* @Date: 2023-07-06 16:19:15
* @LastEditors: huyue
* @LastEditors: huyue
* @LastEditTime: 2023-07-13 1
6:39:55
* @LastEditTime: 2023-07-13 1
7:55:09
-->
-->
<
template
>
<
template
>
<div
class=
"merchant-box"
>
<div
class=
"merchant-box"
>
...
@@ -61,7 +61,7 @@ export default {
...
@@ -61,7 +61,7 @@ export default {
// })
// })
},
},
async
getTrendData
()
{
async
getTrendData
()
{
const
_data
=
await
this
.
api
.
solar
.
getAllOpenBuyTrend
({
req
:
{
year
:
2023
}
})
const
_data
=
await
this
.
api
.
solar
.
getAllOpenBuyTrend
({
year
:
2023
})
const
_dataList
=
_data
.
data
.
dataList
const
_dataList
=
_data
.
data
.
dataList
_dataList
.
forEach
(
item
=>
{
_dataList
.
forEach
(
item
=>
{
this
.
dataList
.
push
({
this
.
dataList
.
push
({
...
...
src/views/home/solar/PurchaseTrends.vue
View file @
a4286ff
...
@@ -73,7 +73,7 @@ export default {
...
@@ -73,7 +73,7 @@ export default {
// })
// })
},
},
async
getDataList
()
{
async
getDataList
()
{
const
_data
=
await
this
.
api
.
solar
.
getAllPurchaseTrend
({
req
:
{
year
:
2023
}
})
const
_data
=
await
this
.
api
.
solar
.
getAllPurchaseTrend
({
year
:
2023
})
const
_dataList
=
_data
.
data
.
dataList
const
_dataList
=
_data
.
data
.
dataList
_dataList
.
forEach
(
item
=>
{
_dataList
.
forEach
(
item
=>
{
this
.
dataList
.
push
({
this
.
dataList
.
push
({
...
...
Write
Preview
Markdown
is supported
Attach a file
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 post a comment