Commit a8255247 by 夏新然

展示页面

1 parent 4c917f85
File mode changed
NODE_ENV = '"development"'
\ No newline at end of file
NODE_ENV = 'development'
VUE_APP_URL = 'http://192.168.9.133:20080'
\ No newline at end of file
VUE_APP_URL = ''
\ No newline at end of file
......@@ -44,22 +44,6 @@ service.interceptors.response.use(
},
(error) => {
console.log(error)
let info = {}
if (!error.response) {
info = {
code: 5000,
msg: 'Network Error'
}
} else {
let { status, statusText, data } = error.response
// 此处整理错误信息格式
info = {
code: status,
data: data,
msg: statusText
}
}
return Promise.reject(error)
}
)
......
let baseUrl = '/api' // 本地代理
console.log(process.env.NODE_ENV)
switch (process.env.NODE_ENV) {
case 'development':
baseUrl = 'http://192.168.9.133:20080' // 测试环境url
// baseUrl="http://192.168.9.162:20080"
break
case 'pre':
baseUrl = 'https://pre-server.feleti.cn' // 预上线环境url
break
case 'production':
baseUrl = 'https://api.feleti.cn' // 生产环境url
break
}
export default baseUrl
\ No newline at end of file
export default process.env.VUE_APP_URL
\ No newline at end of file
......@@ -37,7 +37,7 @@ export default {
let options = {}
if (params) {
options.params = params
options.data = params
}
if (headers) {
options.headers = headers
......
......@@ -2,8 +2,8 @@ import api from '../index'
import urls from './urls'
export default {
vehicleList(params) {
return api.get(urls.vehicleList, params)
tableList(params) {
return api.get(urls.tableList, params)
},
detailImg(params,id) {
return api.get(urls.detailImg+id, params)
......@@ -12,4 +12,8 @@ export default {
// return出去了一个promise
return api.delete(urls.delVehicle+id,params)
},
patchdel(params,id) {
// return出去了一个promise
return api.delete(urls.patchdel,params)
},
}
\ No newline at end of file
import baseUrl from '../baseUrl'
export default {
vehicleList: baseUrl + '/api/v1/traffic/events',
tableList: baseUrl + '/api/v1/traffic/events',
detailImg: baseUrl + '/api/v1/web/pics/',
delVehicle: baseUrl + '/api/v1/traffic/events/',
patchdel: baseUrl + '/api/v1/traffic/events/patchdel'
}
\ No newline at end of file
......@@ -19,6 +19,7 @@ class Codes {
this.result = {}
this.result = allData
this.classify();
console.log(this.result)
return this.result
}
// 分类
......@@ -221,6 +222,12 @@ class Codes {
} catch (error) {
this.result.xcycle_color_type = '未识别'
}
// 违法类型
try {
this.result.illegalType = parseInt(this.allData.event_data.illegal.state) === 1 ? this.getCode('违法类型', this.allData.event_data.illegal.code) : '正常'
} catch (err) {
this.result.illegalType = '未识别'
}
// 行人上身颜色
try {
this.result.driver_face_upbody_text = this.getCode('车身颜色', this.allData.event_data.driver.face[0].upbody.code)
......@@ -241,48 +248,54 @@ class Codes {
}
// 地点名称
try {
this.allData.location_name = this.allData.event_this.allData.location.name === '' ? '无' : this.allData.event_this.allData.location.name
this.result.location_name =this.allData.event_data.location.name === '' ? '未知' : this.allData.event_data.location.name
} catch (e) {
this.allData.location_name = '未识别'
this.result.location_name = '未识别'
}
// 车牌号码
try {
this.result.xcycle_plate_text = this.allData.event_data.xcycle.plate.text || '未识别'
} catch (error) {
this.result.xcycle_plate_text = '未识别'
}
// 骑车类型
try {
switch (this.allData.event_this.allData.xcycle_type) {
switch (this.allData.event_data.xcycle_type) {
case 'motorcycle':
this.allData.xcycle_type_text = '摩托车'
this.result.xcycle_type_text = '摩托车'
break
case 'bicycle':
this.allData.xcycle_type_text = '自行车'
this.result.xcycle_type_text = '自行车'
break
case 'tricycle':
this.allData.xcycle_type_text = '三轮车'
this.result.xcycle_type_text = '三轮车'
break
default:
break
}
} catch (err) {
this.allData.xcycle_type_text = '未识别'
this.result.xcycle_type_text = '未识别'
}
try {
if (this.allData.xcycle_type_text === '自行车') {
this.allData.company = this.allData.event_this.allData.xcycle.company.name
} else if (this.allData.xcycle_type_text === '摩托车') {
if (typeof (this.allData.event_this.allData.xcycle.company.code) !== 'number') {
this.allData.company = '未识别'
if (this.result.xcycle_type_text === '自行车') {
this.result.company = this.allData.event_data.xcycle.company.name
} else if (this.result.xcycle_type_text === '摩托车') {
if (typeof (this.allData.event_data.xcycle.company.code) !== 'number') {
this.result.company = '未识别'
} else {
this.allData.company = this.getCode('外卖公司', this.allData.event_this.allData.xcycle.company.code)
this.result.company = this.getCode('外卖公司', this.allData.event_data.xcycle.company.code)
}
} else if (this.allData.xcycle_type_text === '三轮车') {
if (typeof (this.allData.event_this.allData.xcycle.company.code) !== 'number') {
this.allData.company = '未识别'
} else if (this.result.xcycle_type_text === '三轮车') {
if (typeof (this.allData.event_data.xcycle.company.code) !== 'number') {
this.result.company = '未识别'
} else {
this.allData.company = this.getCode('快递公司', this.allData.event_this.allData.xcycle.company.code)
this.result.company = this.getCode('快递公司', this.allData.event_data.xcycle.company.code)
}
} else {
this.allData.company = '无'
this.result.company = '无'
}
} catch (error) {
this.allData.company = '未识别'
this.result.company = '未识别'
}
}
// 客流
......
......@@ -107,3 +107,8 @@ a:active{
@extend .arrow;
right: -27px;
}
.delIcon{
cursor: pointer;
color:#f2365a;
font-size:16px;
}
......@@ -28,6 +28,11 @@ const routes = [
path: "/search/vehicleSearch",
name: "taskSet",
component: resolve => require(['../views/search/vehicleSearch.vue'], resolve),
},
{
path: "/search/xcycle",
name: "xcycle",
component: resolve => require(['../views/search/xcycle.vue'], resolve),
}
]
},
......@@ -38,6 +43,14 @@ const routes = [
// this generates a separate chunk (about.[hash].js) for this route
// which is lazy-loaded when the route is visited.
component: resolve => require(['../views/Login.vue'], resolve)
},
{
path: "/show",
name: "show",
// route level code-splitting
// this generates a separate chunk (about.[hash].js) for this route
// which is lazy-loaded when the route is visited.
component: resolve => require(['../views/Show.vue'], resolve)
}
];
......
<template>
<div class="about">
<h1>This is an about page</h1>
</div>
</template>
......@@ -33,6 +33,7 @@
<span slot="title">智能检索</span>
</template>
<el-menu-item index="/search/vehicleSearch"> <i class="el-icon-location"></i>过车记录检索</el-menu-item>
<el-menu-item index="/search/xcycle"> <i class="el-icon-location"></i>非机动车检索</el-menu-item>
</el-submenu>
<el-submenu index="4">
<template slot="title">
......
......@@ -121,7 +121,7 @@ import types from '../store/types.js'
</script>
<!-- Add "scoped" attribute to limit CSS to this component only -->
<style scoped>
<style scoped lang="scss">
.loginTitle{
height:60px;
background: #dcdcdc;
......
<template>
<div class="home">
<el-header class="headers">
<span class="title">实事分析展示</span>
</el-header>
<el-container style="min-height:calc(100vh - 64px);">
<el-main style="padding: 12px;">
<div style="margin-bottom: 12px;">
<div class="videoCon">
<!-- 加入视频 -->
</div>
<div class="imgCon">
<div class="imgDiv">
<!-- 加入img 100% -->
</div>
<div class="textDiv">
<p>抓拍时间:2019年10月29日 17:01:47</p>
<p>抓拍地点:丰豪东路与北清路交叉口</p>
<p>车牌号码:京B123456</p>
<p>车辆类型:小轿车</p>
<p>车身颜色:白色</p>
<p>违法类型:占用公交车道年</p>
</div>
</div>
<div style="clear: both;"></div>
</div>
<div class="bottomDiv">
<!-- 循环生成lDiv -->
<div class="lDiv">
<div class="leftImg">
<!-- 加入img 100% -->
</div>
<div class="rightDiv">
<p>抓拍时间:2019年10月29日 17:01:47</p>
<p>抓拍地点:丰豪东路与北清路交叉口</p>
<p>车牌号码:京B123456</p>
<p>车辆类型:小轿车</p>
<p>车身颜色:白色</p>
<p>违法类型:占用公交车道年</p>
</div>
<div style="clear: both;"></div>
</div>
<div class="lDiv">
<div class="leftImg">
<!-- 加入img 100% -->
</div>
<div class="rightDiv">
<p>抓拍时间:2019年10月29日 17:01:47</p>
<p>抓拍地点:丰豪东路与北清路交叉口</p>
<p>车牌号码:京B123456</p>
<p>车辆类型:小轿车</p>
<p>车身颜色:白色</p>
<p>违法类型:占用公交车道年</p>
</div>
<div style="clear: both;"></div>
</div>
<div class="lDiv">
<div class="leftImg">
<!-- 加入img 100% -->
</div>
<div class="rightDiv">
<p>抓拍时间:2019年10月29日 17:01:47</p>
<p>抓拍地点:丰豪东路与北清路交叉口</p>
<p>车牌号码:京B123456</p>
<p>车辆类型:小轿车</p>
<p>车身颜色:白色</p>
<p>违法类型:占用公交车道年</p>
</div>
<div style="clear: both;"></div>
</div>
<div style="clear: both;"></div>
</div>
</el-main>
</el-container>
</div>
</template>
<script>
// import HelloWorld from "@/components/HelloWorld.vue";
export default {
name: "home",
data(){
return{
isCollapse: false,
conHeight:0
};
},
created(){
},
mounted(){
},
components: {
// HelloWorld
},
methods:{}
};
</script>
<style scoped="scoped" lang="scss">
body{
overflow: hidden;
}
.title{
font-size:24px;
font-family:MicrosoftYaHeiUI;
color:rgba(255,255,255,1);
line-height:30px;
-webkit-background-clip:text;
}
.videoCon{
width:1212px;
height:682px;
background: red;
float: left;
margin-right: 12px;
}
.imgCon{
float: left;
background: #FFFFFF;
padding: 12px;
width: 644px;
}
.imgDiv{
width:644px;
height:360px;
background:rgba(216,216,216,1);
}
.lDiv{
float: left;
margin-right: 12px;
}
.lDiv:nth-last-of-type(2){
margin: 0;
}
.rightDiv{
width:226px;
height:176px;
border:1px solid rgba(229,229,229,1);
border-left: none;
color: #555555;
font-size: 12px;
padding-top: 8px;
float: left;
}
.rightDiv p{
margin: 10px 0;
margin-left: 10px;
}
.textDiv{
width:643px;
height:286px;
border:1px solid rgba(229,229,229,1);
color: #555555;
font-size:22px;
padding-top: 12px;
}
.textDiv p{
margin: 14px 0;
margin-left: 37px;
}
.bottomDiv{
padding: 7px;
background: #FFFFFF;
}
.leftImg{
width: 390px;
height: 186px;
background: #d8d8d8;
float: left;
}
</style>
\ No newline at end of file
......@@ -89,10 +89,10 @@
<el-col :span="2">
<div style="margin-bottom: 6px;padding-top: 3px;">
<el-button type="primary" style="" @click="query" class="block">查询</el-button>
<el-button type="success" class="block">导出</el-button>
<el-button type="success" class="block" @click="exportFun">导出</el-button>
</div>
<div>
<el-button type="success" class="block">批量删除</el-button>
<el-button type="success" class="block" @click="batchdel">批量删除</el-button>
</div>
</el-col>
<div style="">
......@@ -189,7 +189,7 @@
<div class="leftArrow" @click="leftFun"><i class="el-icon-d-arrow-left"></i></div>
<div class="detaiCon">
<img :src="detailImg" alt="" style="width: 100%;">
<el-form label-width="80px" inline>
<el-form label-width="120px" inline>
<div>
<el-form-item label="车牌号码:">
<span>{{ detailObj.vehicle_plate_text }}</span>
......@@ -289,6 +289,40 @@
this.getData()
},
methods:{
exportFun(){
window.open(encodeURI(process.env.VUE_APP_URL + '/api/v1/traffic/events/export?s=' + Math.random()+'&event_type=&event_dt__gte='+this.$moment(this.conditions.start_dt).utc().format('YYYY-MM-DD HH:mm:ss')+'&event_dt__lt='+this.$moment(this.conditions.end_dt).utc().format('YYYY-MM-DD HH:mm:ss')+'&source_type='+this.conditions.source_type+'&vchan_name__like='+this.conditions.vchan_name+'&vehicle_type='+this.conditions.car_type+'&body_color='+this.conditions.car_color+'&logo_type='+this.conditions.logo_type+'&plate_number__like='+this.conditions.plate+'&marker='+this.conditions.marker+'&task_name='+this.conditions.task_name+'&special_type='+this.conditions.special_type))
},
batchdel(){
if(this.selectcheck.length==0){
this.$message({
message: '请选择至少一条记录',
type: 'warning'
});
return false
}
this.$confirm('此操作将永久删除选中记录, 是否继续?', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(() => {
this.$api.search.patchdel({
"event_unids":this.selectcheck
}).then(res=>{
if(res.ecode == '200'){
this.$message({
type: 'success',
message: '删除成功!'
});
this.getData();
}else{
this.$message.error('删除失败!');
}
})
})
},
leftFun(){
if(this.currentIndex-1<0){
this.$message({
......@@ -349,7 +383,7 @@
special_type:this.conditions.special_type,
task_name: this.conditions.task_name ? this.conditions.task_name.replace(/\s\s*/g, '') : this.conditions.task_name
}
this.$api.search.vehicleList(search_params
this.$api.search.tableList(search_params
).then((res)=>{
this.total=res.total_num;
res.list_data.forEach((item,index)=>{
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!