Skip to content
项目
群组
代码片段
帮助
当前项目
正在载入...
登录 / 注册
切换导航面板
P
police-bigdata-vue-all
概览
Overview
Details
Activity
Cycle Analytics
版本库
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
问题
0
Issues
0
列表
Board
标记
里程碑
合并请求
0
Merge Requests
0
CI / CD
CI / CD
流水线
作业
日程表
图表
维基
Wiki
代码片段
Snippets
成员
Members
Collapse sidebar
Close sidebar
活动
图像
聊天
创建新问题
作业
提交
Issue Boards
Open sidebar
Tian
police-bigdata-vue-all
Commits
31157b2c
Commit
31157b2c
authored
Mar 30, 2023
by
T
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
首页右下角统计bug修复、警员编号限制9位
parent
624bbb09
隐藏空白字符变更
内嵌
并排
正在显示
7 个修改的文件
包含
282 行增加
和
10 行删除
+282
-10
index.js
src/router/index.js
+2
-1
permission.js
src/store/modules/permission.js
+1
-0
form.vue
src/views/base/person/form.vue
+1
-1
ColumnarChart1.vue
src/views/dashboard/ColumnarChart1.vue
+156
-0
PieChart.vue
src/views/dashboard/PieChart.vue
+14
-7
PieChart1.vue
src/views/dashboard/PieChart1.vue
+107
-0
addPoliceForm.vue
src/views/warehouse/receive/apply/addPoliceForm.vue
+1
-1
没有找到文件。
src/router/index.js
View file @
31157b2c
...
...
@@ -54,7 +54,8 @@ router.beforeEach((to, from, next) => {
export
const
loadMenus
=
(
next
,
to
)
=>
{
buildMenus
().
then
(
res
=>
{
const
asyncRouter
=
filterAsyncRouter
(
res
)
const
asyncRouter
=
filterAsyncRouter
(
res
)
//console.log(asyncRouter)
asyncRouter
.
push
({
path
:
'*'
,
redirect
:
'/'
,
hidden
:
true
})
store
.
dispatch
(
'GenerateRoutes'
,
asyncRouter
).
then
(()
=>
{
// 存储路由
router
.
addRoutes
(
asyncRouter
)
// 动态添加可访问路由表
...
...
src/store/modules/permission.js
View file @
31157b2c
...
...
@@ -34,6 +34,7 @@ export const filterAsyncRouter = (routers) => { // 遍历后台传来的路由
}
return
true
})
//console.log(accessedRouters)
return
accessedRouters
}
...
...
src/views/base/person/form.vue
View file @
31157b2c
...
...
@@ -10,7 +10,7 @@
<el-input
v-model
.
trim=
"form.name"
style=
"width: 370px;"
placeholder=
"请输入姓名"
/>
</el-form-item>
<el-form-item
label=
"警员编号"
prop=
"policeCode"
>
<el-input
v-model=
"form.policeCode"
style=
"width: 370px;"
placeholder=
"请输入警员编号
"
/>
<el-input
v-model=
"form.policeCode"
style=
"width: 370px;"
maxlength=
"9"
show-word-limit
placeholder=
"请输入警员编号,不能超过9位
"
/>
</el-form-item>
<el-form-item
label=
"性别"
>
<el-radio
v-model=
"form.sex"
label=
"男"
border
>
男
</el-radio>
...
...
src/views/dashboard/ColumnarChart1.vue
0 → 100644
View file @
31157b2c
<
template
>
<el-card
style=
"height:350px"
>
<div
slot=
"header"
class=
"clearfix"
>
<span>
{{
radio
}}
</span>
<el-radio-group
v-model=
"radio"
size=
"small"
@
change=
"radioChange"
style=
"float: right;margin-top:-7px;margin-bottom:-10px;"
>
<el-radio-button
label=
"使用次数"
></el-radio-button>
<el-radio-button
label=
"维修次数"
></el-radio-button>
<el-radio-button
label=
"报废数"
></el-radio-button>
</el-radio-group>
</div>
<v-chart
:forceFit=
"true"
:height=
"300"
:data=
"chartData"
style=
"margin-left: -50px"
>
<v-tooltip
/>
<v-axis
data-key=
'维修次数'
:line=
"line"
:label=
"label"
/>
<v-axis
data-key=
'报废次数'
:line=
"line"
:label=
"label"
/>
<v-legend
/>
<v-line
:position=
"position"
color=
"parentName"
/>
<!--
<v-point
:position=
"position"
color=
"parentName"
:size=
"4"
:v-style=
"style"
:shape=
"'circle'"
/>
-->
</v-chart>
</el-card>
</
template
>
<
script
>
import
{
getSyPOrg
}
from
'@/api/view'
import
{
getWxPOrg
}
from
'@/api/view'
import
{
getBfPOrg
}
from
'@/api/view'
import
DataSet
from
'@antv/data-set'
export
default
{
data
()
{
const
label
=
{
offset
:
-
620
,
textStyle
:
{
textAlign
:
'left'
,
}
}
const
line
=
{
textAlign
:
'left'
}
return
{
orgId
:
this
.
$store
.
state
.
user
.
user
.
baseJpOrganization
.
id
,
radio
:
'使用次数'
,
dataSource
:
[],
adjust
:
[{
type
:
'dodge'
,
marginRatio
:
1
/
32
,
}],
style
:
{
stroke
:
'#fff'
,
lineWidth
:
1
},
chartData
:
[],
line
,
label
,
position
:
'装备类型*使用量'
}
},
computed
:
{
// chartData() {
// let dv = new DataSet.View().source(this.dataSource)
// dv.transform({
// type: 'fold',
// fields: ['近七天使用次数', '近三十天使用次数'],
// key: '装备类型',
// value: '使用量',
// });
// return dv.rows
// },
},
mounted
()
{
this
.
init
()
},
methods
:
{
init
(
orgId
)
{
this
.
orgId
=
orgId
||
this
.
$store
.
state
.
user
.
user
.
baseJpOrganization
.
id
getSyPOrg
({
orgId
:
this
.
orgId
}).
then
(
res
=>
{
if
(
res
.
code
==
"10000"
)
{
this
.
dataSource
=
res
.
data
//this.dataSource =[{parentName: "反恐救援装备", 近七天使用次数: 10, 近三十天使用次数: 10}, {parentName: "武器警械", 近七天使用次数: 10, 近三十天使用次数: 20}]
let
dv
=
new
DataSet
.
View
().
source
(
this
.
dataSource
)
dv
.
transform
({
type
:
'fold'
,
fields
:
[
'近七天使用次数'
,
'近三十天使用次数'
],
key
:
'装备类型'
,
value
:
'使用量'
,
});
this
.
chartData
=
dv
.
rows
this
.
position
=
'装备类型*使用量'
}
else
{
this
.
$message
.
error
(
res
.
msg
)
}
})
},
radioChange
(
value
)
{
if
(
value
==
'使用次数'
)
{
getSyPOrg
({
orgId
:
this
.
orgId
}).
then
(
res
=>
{
if
(
res
.
code
==
"10000"
)
{
this
.
dataSource
=
res
.
data
let
dv
=
new
DataSet
.
View
().
source
(
this
.
dataSource
)
dv
.
transform
({
type
:
'fold'
,
fields
:
[
'近七天使用次数'
,
'近三十天使用次数'
],
key
:
'装备类型'
,
value
:
'使用量'
,
});
this
.
chartData
=
dv
.
rows
this
.
position
=
'装备类型*使用量'
}
else
{
this
.
$message
.
error
(
res
.
msg
)
}
})
}
else
if
(
value
==
'维修次数'
)
{
getWxPOrg
({
orgId
:
this
.
orgId
}).
then
(
res
=>
{
if
(
res
.
code
==
"10000"
)
{
this
.
dataSource
=
res
.
data
let
dv
=
new
DataSet
.
View
().
source
(
this
.
dataSource
)
dv
.
transform
({
type
:
'fold'
,
fields
:
[
'近三个月维修次数'
,
'近半年维修次数'
],
key
:
'装备类型'
,
value
:
'维修次数'
,
});
this
.
chartData
=
dv
.
rows
this
.
position
=
'装备类型*维修次数'
}
else
{
this
.
$message
.
error
(
res
.
msg
)
}
})
}
else
if
(
value
==
'报废数'
)
{
getBfPOrg
({
orgId
:
this
.
orgId
}).
then
(
res
=>
{
if
(
res
.
code
==
"10000"
)
{
this
.
dataSource
=
res
.
data
let
dv
=
new
DataSet
.
View
().
source
(
this
.
dataSource
)
dv
.
transform
({
type
:
'fold'
,
fields
:
[
'近三个月报废数'
,
'近半年使报废数'
],
key
:
'装备类型'
,
value
:
'报废次数'
,
});
this
.
chartData
=
dv
.
rows
this
.
position
=
'装备类型*报废次数'
}
else
{
this
.
$message
.
error
(
res
.
msg
)
}
})
}
}
}
}
</
script
>
<
style
rel=
"stylesheet/scss"
lang=
"scss"
scoped
>
/
deep
/
.el-card
.el-card__header
{
background
:
#ffffff
;
color
:
#000000
;
font-size
:
16px
;
}
</
style
>
\ No newline at end of file
src/views/dashboard/PieChart.vue
View file @
31157b2c
...
...
@@ -97,11 +97,16 @@ export default {
if
(
res
.
code
==
"10000"
)
{
this
.
pieList
=
res
.
data
//对请求返回的数据进行处理,若为宁波市局则返回的数组中第三个字段item的内容应为销毁数,否则不做处理
if
(
this
.
$store
.
state
.
user
.
user
.
baseJpOrganization
.
code
==
'330200000000'
){
this
.
item
=
res
.
data
.
tjList
[
2
].
item
=
'销毁数'
// console.log('---宁波市局----已做处理为:'+this.item)
}
this
.
dataSource
=
res
.
data
.
tjList
// if(this.$store.state.user.user.baseJpOrganization.code == '330200000000'){
// this.item=res.data.tjList[2].item='销毁数'
// // console.log('---宁波市局----已做处理为:'+this.item)
// }
//法1splice:截掉报废部分,取原来的数组
//this.newDataSource = res.data.tjList.splice(2,1);
// this.dataSource = this.pieList
// 法2slice:截取需要的部分,取当前的数组
this
.
newDataSource
=
res
.
data
.
tjList
.
slice
(
0
,
2
);
this
.
dataSource
=
this
.
newDataSource
this
.
guideOpts
.
content
=
'装备总数'
this
.
guideOpts1
.
content
=
this
.
dataSource
.
map
(
item
=>
item
.
count
).
reduce
((
total
,
num
)
=>
total
+
num
)
}
...
...
@@ -109,12 +114,14 @@ export default {
},
radioChange
(
value
)
{
if
(
value
==
'库存状态'
)
{
this
.
dataSource
=
this
.
pieList
.
tjList
this
.
dataSource
=
this
.
pieList
.
tjList
.
slice
(
0
,
2
);
this
.
guideOpts
.
content
=
'装备总数'
}
if
(
value
==
'装备库存'
)
{
this
.
dataSource
=
this
.
pieList
.
typeList
this
.
guideOpts
.
content
=
'在库数量'
}
this
.
guideOpts
.
content
=
'装备总数'
//
this.guideOpts.content = '装备总数'
this
.
guideOpts1
.
content
=
this
.
dataSource
.
map
(
item
=>
item
.
count
).
reduce
((
total
,
num
)
=>
total
+
num
)
},
itemTplLegend
:
function
itemTpl
(
value
,
color
,
checked
,
index
)
{
...
...
src/views/dashboard/PieChart1.vue
0 → 100644
View file @
31157b2c
<
template
>
<el-card
style=
"height:360px"
>
<div
slot=
"header"
class=
"clearfix"
>
<span>
{{
radio
}}
</span>
<el-radio-group
v-model=
"radio"
size=
"small"
@
change=
"radioChange"
style=
"float: right;margin-top:-7px;margin-bottom:-10px;"
>
<el-radio-button
label=
"库存状态"
></el-radio-button>
<el-radio-button
label=
"装备库存"
></el-radio-button>
</el-radio-group>
</div>
<v-chart
:forceFit=
"true"
:height=
"height"
:data=
"dataSource"
>
<v-tooltip
/>
<v-axis
/>
<v-bar
position=
"item*数量"
/>
</v-chart>
</el-card>
</
template
>
<
script
>
import
{
getGroupByCountOrg
}
from
'@/api/view'
export
default
{
data
()
{
return
{
orgId
:
this
.
$store
.
state
.
user
.
user
.
baseJpOrganization
.
id
,
code
:
this
.
$store
.
state
.
user
.
user
.
baseJpOrganization
.
code
,
radio
:
'库存状态'
,
dataSource
:
[],
pieList
:
[],
scale
:
[],
count
:
0
,
height
:
330
,
}
},
mounted
()
{
this
.
getPieInfo
()
},
methods
:
{
getPieInfo
(
orgId
)
{
this
.
orgId
=
orgId
||
this
.
$store
.
state
.
user
.
user
.
baseJpOrganization
.
id
getGroupByCountOrg
({
orgId
:
this
.
orgId
}).
then
(
res
=>
{
if
(
res
.
code
==
'10000'
){
//对请求返回的数据进行处理,若为宁波市局则返回的数组中第三个字段item的内容应为销毁数,否则不做处理
if
(
this
.
$store
.
state
.
user
.
user
.
baseJpOrganization
.
code
==
'330200000000'
){
this
.
item
=
res
.
data
.
tjList
[
2
].
item
=
'销毁数'
console
.
log
(
'---宁波市局----已做处理为:'
+
this
.
count
)
}
// // 数据处理,将请求返回值的'count'字段属性处理为'数量'
let
newDataSource
=
res
.
data
.
tjList
.
map
(
obj
=>
{
return
{
item
:
obj
.
item
,
数量
:
obj
.
count
};
})
this
.
dataSource
=
newDataSource
}
})
},
radioChange
(
value
)
{
if
(
value
==
'库存状态'
)
{
this
.
orgId
=
this
.
$store
.
state
.
user
.
user
.
baseJpOrganization
.
id
getGroupByCountOrg
({
orgId
:
this
.
orgId
}).
then
(
res
=>
{
if
(
res
.
code
==
'10000'
){
//对请求返回的数据进行处理,若为宁波市局则返回的数组中第三个字段item的内容应为销毁数,否则不做处理
if
(
this
.
$store
.
state
.
user
.
user
.
baseJpOrganization
.
code
==
'330200000000'
){
this
.
item
=
res
.
data
.
tjList
[
2
].
item
=
'销毁数'
// console.log('---宁波市局----已做处理为:'+this.item)
}
// 数据处理,将请求返回值的'count'字段属性处理为'数量'
let
newDataSource
=
res
.
data
.
tjList
.
map
(
obj
=>
{
return
{
item
:
obj
.
item
,
数量
:
obj
.
count
};
})
this
.
dataSource
=
newDataSource
}
})
}
else
if
(
value
==
'装备库存'
)
{
this
.
orgId
=
this
.
$store
.
state
.
user
.
user
.
baseJpOrganization
.
id
getGroupByCountOrg
({
orgId
:
this
.
orgId
}).
then
(
res
=>
{
if
(
res
.
code
==
'10000'
){
// 数据处理,将请求返回值的'count'字段属性处理为'数量'
let
newDataSource
=
res
.
data
.
typeList
.
map
(
obj
=>
{
return
{
item
:
obj
.
item
,
数量
:
obj
.
count
};
})
this
.
dataSource
=
newDataSource
}
})
}
},
}
}
</
script
>
<
style
rel=
"stylesheet/scss"
lang=
"scss"
scoped
>
/
deep
/
.el-card
.el-card__header
{
background
:
#ffffff
;
color
:
#000000
;
font-size
:
16px
;
}
</
style
>
\ No newline at end of file
src/views/warehouse/receive/apply/addPoliceForm.vue
View file @
31157b2c
...
...
@@ -10,7 +10,7 @@
<el-input
v-model
.
trim=
"form.name"
style=
"width: 370px;"
placeholder=
"请输入姓名"
/>
</el-form-item>
<el-form-item
label=
"警员编号"
prop=
"policeCode"
>
<el-input
v-model=
"form.policeCode"
style=
"width: 370px;"
placeholder=
"请输入警员编号
"
/>
<el-input
v-model=
"form.policeCode"
style=
"width: 370px;"
maxlength=
"9"
show-word-limit
placeholder=
"请输入警员编号,不能超过9位
"
/>
</el-form-item>
<el-form-item
label=
"性别"
>
<el-radio
v-model=
"form.sex"
label=
"男"
border
>
男
</el-radio>
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论