Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
J
JINRUN-PERPOSITION
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
xinzhedeai
JINRUN-PERPOSITION
Commits
3c10db8d
Commit
3c10db8d
authored
Dec 03, 2025
by
xinzhedeai
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
add:人员统计接口对接
parent
90fd5fb8
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
67 additions
and
51 deletions
+67
-51
renyuantongji.js
src/api/jinrun/renyuantongji.js
+28
-0
renyuan.vue
src/views/tongji/renyuan.vue
+39
-51
No files found.
src/api/jinrun/renyuantongji.js
0 → 100644
View file @
3c10db8d
import
request
from
'
@/utils/request
'
// 查询人员信息列表
export
function
getPersonCount
(
query
)
{
return
request
({
url
:
'
/count/manage/getPersonCount
'
,
method
:
'
get
'
,
params
:
query
})
}
export
function
getPersonCountTrend
(
query
)
{
return
request
({
url
:
'
/count/manage/getPersonCountTrend
'
,
method
:
'
get
'
,
params
:
query
})
}
export
function
listInfo
(
query
)
{
return
request
({
url
:
'
/count/manage/getPersonDetails
'
,
method
:
'
get
'
,
params
:
query
})
}
src/views/tongji/renyuan.vue
View file @
3c10db8d
...
...
@@ -59,7 +59,7 @@
class=
"stat-value"
style=
"font-size: 18px; font-weight: 400; color: #2196f3"
>
3
人
{{
sumObj
.
person
}}
人
</div>
</div>
</el-col>
...
...
@@ -85,7 +85,7 @@
class=
"stat-value"
style=
"font-size: 18px; font-weight: 400; color: #2196f3"
>
3
人
{{
sumObj
.
visitor
}}
人
</div>
</div>
</el-col>
...
...
@@ -176,14 +176,18 @@
</
template
>
<
script
>
import
{
listInfo
}
from
"
@/api/jinrun/renyuan
"
;
import
{
getDict
}
from
"
@/api/jinrun/common
"
;
import
{
getPersonCount
,
getPersonCountTrend
,
listInfo
,
}
from
"
@/api/jinrun/renyuantongji
"
;
import
*
as
echarts
from
"
echarts
"
;
// 导入ECharts
export
default
{
name
:
"
Info
"
,
data
()
{
return
{
sumObj
:
{},
// 人员类型下拉列表数据
personTypeOptions
:
[],
// 遮罩层
...
...
@@ -206,8 +210,7 @@ export default {
open
:
false
,
// 查询参数
queryParams
:
{
dateRange
:
null
,
realName
:
null
,
dateRange
:
[],
pageNum
:
1
,
pageSize
:
10
,
},
...
...
@@ -222,9 +225,29 @@ export default {
},
mounted
()
{
this
.
initChart
();
this
.
getPersonCount
();
this
.
getPersonCountTrend
();
this
.
getList
();
},
methods
:
{
getPersonCountTrend
()
{
// 处理日期范围参数
this
.
queryParams
.
startDate
=
this
.
queryParams
.
dateRange
[
0
]
||
""
;
this
.
queryParams
.
endDate
=
this
.
queryParams
.
dateRange
[
1
]
||
""
;
getPersonCountTrend
(
this
.
queryParams
).
then
((
response
)
=>
{
// this.sumObj = response.data;
console
.
log
(
response
,
"
人员数量趋势图数据
"
);
this
.
updateChart
(
response
.
data
.
xData
,
response
.
data
.
yData
);
});
},
getPersonCount
()
{
getPersonCount
().
then
((
response
)
=>
{
this
.
sumObj
=
response
.
data
;
});
},
/** 初始化图表 */
initChart
()
{
// 获取DOM元素并初始化图表
const
chartDom
=
document
.
querySelector
(
"
.qushitu
"
);
...
...
@@ -268,7 +291,7 @@ export default {
},
yAxis
:
{
type
:
"
value
"
,
name
:
"
人员数量
"
,
//
name: "人员数量",
splitLine
:
{
show
:
true
,
// 显示每个刻度对应的横线
lineStyle
:
{
...
...
@@ -323,49 +346,8 @@ export default {
},
/** 更新图表数据 */
updateChart
()
{
updateChart
(
dates
,
values
)
{
if
(
this
.
chartInstance
)
{
// 模拟数据(实际项目中应根据后端返回数据处理)
const
dateRange
=
this
.
queryParams
.
dateRange
;
let
dates
=
[];
let
values
=
[];
if
(
dateRange
&&
dateRange
.
length
===
2
)
{
// 有日期范围时生成模拟数据
const
start
=
new
Date
(
dateRange
[
0
]);
const
end
=
new
Date
(
dateRange
[
1
]);
const
days
=
Math
.
ceil
((
end
-
start
)
/
(
1000
*
60
*
60
*
24
));
for
(
let
i
=
0
;
i
<=
days
;
i
++
)
{
const
currentDate
=
new
Date
(
start
);
currentDate
.
setDate
(
start
.
getDate
()
+
i
);
const
dateStr
=
currentDate
.
getFullYear
()
+
"
-
"
+
(
currentDate
.
getMonth
()
+
1
).
toString
().
padStart
(
2
,
"
0
"
)
+
"
-
"
+
currentDate
.
getDate
().
toString
().
padStart
(
2
,
"
0
"
);
dates
.
push
(
dateStr
);
// 生成随机数据,范围在1-10之间
values
.
push
(
Math
.
floor
(
Math
.
random
()
*
10
)
+
1
);
}
}
else
{
// 默认显示最近7天的数据
for
(
let
i
=
6
;
i
>=
0
;
i
--
)
{
const
currentDate
=
new
Date
();
currentDate
.
setDate
(
currentDate
.
getDate
()
-
i
);
const
dateStr
=
currentDate
.
getFullYear
()
+
"
-
"
+
(
currentDate
.
getMonth
()
+
1
).
toString
().
padStart
(
2
,
"
0
"
)
+
"
-
"
+
currentDate
.
getDate
().
toString
().
padStart
(
2
,
"
0
"
);
dates
.
push
(
dateStr
);
// 生成随机数据,范围在1-10之间
values
.
push
(
Math
.
floor
(
Math
.
random
()
*
10
)
+
1
);
}
}
// 更新图表数据
this
.
chartInstance
.
setOption
({
xAxis
:
{
...
...
@@ -390,6 +372,8 @@ export default {
/** 查询人员信息列表 */
getList
()
{
this
.
loading
=
true
;
this
.
queryParams
.
startDate
=
this
.
queryParams
.
dateRange
[
0
]
||
""
;
this
.
queryParams
.
endDate
=
this
.
queryParams
.
dateRange
[
1
]
||
""
;
listInfo
(
this
.
queryParams
).
then
((
response
)
=>
{
this
.
infoList
=
response
.
records
;
this
.
total
=
response
.
total
;
...
...
@@ -407,11 +391,15 @@ export default {
this
.
queryParams
.
pageNum
=
1
;
this
.
getList
();
// 搜索时更新图表数据(添加这行)
this
.
updateChart
();
// this.updateChart();
this
.
getPersonCountTrend
();
},
/** 重置按钮操作 */
resetQuery
()
{
this
.
resetForm
(
"
queryForm
"
);
// this.resetForm("queryForm");
this
.
queryParams
.
dateRange
=
[];
this
.
queryParams
.
startDate
=
""
;
this
.
queryParams
.
endDate
=
""
;
this
.
handleQuery
();
},
// 多选框选中数据
...
...
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