Skip to content
Toggle navigation
Projects
Groups
Snippets
Help
江名洋
/
linkwe-scrm
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 b5621897
authored
Jan 16, 2023
by
xinla
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
短链
1 parent
6cbec3f7
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
76 additions
and
5 deletions
linkwe-pc/src/api/intelligentShortLink.js
linkwe-pc/src/views/intelligentShortLink/detail.vue
linkwe-pc/src/api/intelligentShortLink.js
View file @
b562189
...
...
@@ -45,9 +45,24 @@ export function update(data) {
}
// 短链数据统计(传ID查单个)
export
function
getAnalysis
(
data
)
{
export
function
getAnalysis
(
id
)
{
return
request
({
url
:
service
+
'/data/statistics'
,
params
:
{
id
},
})
}
/**
* 短链折线统计
* {
beginTime,,string,false,,开始时间
endTime,,string,false,,结束时间
id,,integer,false,,主键id
}
*/
export
function
getLineAnalysis
(
data
)
{
return
request
({
url
:
service
+
'/line/statistics'
,
params
:
data
,
})
}
...
...
linkwe-pc/src/views/intelligentShortLink/detail.vue
View file @
b562189
<
script
>
import
{
getDetail
,
getLineAnalysis
,
getAnalysis
}
from
'@/api/intelligentShortLink'
export
default
{
name
:
''
,
components
:
{},
data
()
{
return
{}
return
{
loading
:
false
,
form
:
{},
dateRange
:
[
new
Date
().
setDate
(
-
7
)],
data
:
[],
xData
:
[],
series
:
[],
}
},
computed
:
{
ChartLine
:
()
=>
import
(
'@/components/ChartLine'
),
},
computed
:
{},
watch
:
{},
created
()
{},
created
()
{
let
id
=
this
.
$route
.
query
.
id
this
.
getList
(
id
)
this
.
getAnalysis
(
id
)
this
.
getLineAnalysis
()
},
mounted
()
{},
methods
:
{
getAnalysis
()
{
getDetail
(
id
)
{
this
.
loading
=
true
getDetail
(
id
)
.
then
(({
data
})
=>
{
this
.
form
=
data
})
.
catch
(()
=>
{})
.
finally
(()
=>
{
this
.
loading
=
false
})
},
getAnalysis
(
id
)
{
this
.
loading
=
true
getAnalysis
()
.
then
(({
data
})
=>
{
...
...
@@ -60,6 +86,19 @@ export default {
this
.
loading
=
false
})
},
getLineAnalysis
()
{
let
query
=
{
id
:
this
.
$route
.
query
.
id
,
beginTime
:
this
.
dateRange
[
0
],
endTime
:
this
.
dateRange
[
1
],
}
getLineAnalysis
(
query
).
then
(({
data
})
=>
{
this
.
xData
=
data
.
map
((
e
)
=>
e
.
xtime
)
this
.
series
.
push
(
data
.
map
((
e
)
=>
e
.
addCnt
))
this
.
series
.
push
(
data
.
map
((
e
)
=>
e
.
lostCnt
))
this
.
series
.
push
(
data
.
map
((
e
)
=>
e
.
netCnt
))
})
},
},
}
</
script
>
...
...
@@ -79,6 +118,23 @@ export default {
<div
class=
"g-card g-pad20"
>
<div
class=
"title"
>
数据趋势
</div>
<CardGroupIndex
:data=
"cardData"
></CardGroupIndex>
<div>
<el-date-picker
v-model=
"dateRange"
:picker-options=
"pickerOptions"
class=
"ml20"
value-format=
"yyyy-MM-dd"
type=
"daterange"
:clearable=
"false"
range-separator=
"-"
start-placeholder=
"开始日期"
end-placeholder=
"结束日期"
@
change=
"getLineAnalysis()"
></el-date-picker>
</div>
<ChartLine
:xData=
"xData"
:legend=
"['访问总数(pv)', '访问总人数(uv)', '小程序打开数']"
:series=
"series"
></ChartLine>
</div>
</div>
</
template
>
...
...
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