Commit 3ec3a931 by zhangquan

开发优化

1 parent 47f81ddd
<template>
<div class="view-panel">
<img :src="dialogSrc" width="100%" v-if="dialogType == 'img'" />
<video width="100%" autoplay controls :src="dialogSrc" v-else></video>
</div>
</template>
<script>
export default {
name: 'view',
data() {
return {
dialogVisibleImg: true
}
},
props: {
dialogType: String,
dialogSrc: String
},
methods: {
test() {
console.log('点击了按钮')
this.$messenger.send({ message: { from: 11, message: '11111' } })
}
}
}
</script>
\ No newline at end of file \ No newline at end of file
...@@ -9,17 +9,30 @@ ...@@ -9,17 +9,30 @@
<div class="accident-item"> <div class="accident-item">
<span class="title">事故情况</span> <span class="title">事故情况</span>
<div class="media-box"> <div class="media-box">
<div class="media-item" v-for="(item,index) in detailDataObj.mediaDetailList" :key="index"> <template v-if="detailDataObj.mediaDetailList && detailDataObj.mediaDetailList.length">
<img class="img" v-if="item.mediaType == 'IMAGE'" :src="item.fileUrl" alt=""> <div class="media-item" v-for="(item,index) in detailDataObj.mediaDetailList" :key="index">
<video v-if="item.mediaType == 'VIDEO'" class="video" preload loop muted> <img class="img" v-if="item.mediaType == 'IMAGE'" :src="item.fileUrl" alt="">
<source :src="item.fileUrl" type="video/mp4"/> <video v-if="item.mediaType == 'VIDEO'" class="video" preload loop muted>
</video> <source :src="item.fileUrl" type="video/mp4"/>
</video>
<div class="mask">
<img class="preview" src="@/images/eyes.png" alt="" @click="previewFile(item)">
</div>
</div>
</template>
<div class="empty-wrap" v-else>
<img class="empty-img" src="@/images/empty-file.png" alt="" @click="previewFile(item)">
<p>暂无碰撞视频、暂无碰撞图片</p>
</div> </div>
</div> </div>
</div> </div>
<div class="accident-item"> <div class="accident-item">
<span class="title">事故地点</span> <span class="title">事故地点</span>
<div id="mapContainer"></div> <div v-if="showMap" id="mapContainer"></div>
<div class="empty-wrap" v-else>
<img class="empty-img" style="height: 60px;" src="@/images/empty-addr.png" alt="" @click="previewFile(item)">
<p>未获取到设备定位</p>
</div>
</div> </div>
</div> </div>
<div v-for="(item,index) in infoData" :key="index"> <div v-for="(item,index) in infoData" :key="index">
...@@ -33,7 +46,10 @@ ...@@ -33,7 +46,10 @@
</div> </div>
<div > <div >
<span class="title">行车速度趋势(Km/h)</span> <span class="title">行车速度趋势(Km/h)</span>
<div class="eChart-box" id="echarts"> <div v-if="showMap" class="eChart-box" id="echarts"></div>
<div class="empty-wrap" v-else>
<img class="empty-img" style="height: 142px;width: 338px;" src="@/images/empty-speed.png" alt="" @click="previewFile(item)">
<p>未获取到行车速度趋势</p>
</div> </div>
</div> </div>
<GLDialog mode="mid" title="新增跟进记录" :modal-append-to-body="true" :append-to-body="true" :visible.sync="recordVisible" :hasFooter="true" :before-close="handleCancel" @onOk="handleOk" @onCancel="handleCancel"> <GLDialog mode="mid" title="新增跟进记录" :modal-append-to-body="true" :append-to-body="true" :visible.sync="recordVisible" :hasFooter="true" :before-close="handleCancel" @onOk="handleOk" @onCancel="handleCancel">
...@@ -41,6 +57,9 @@ ...@@ -41,6 +57,9 @@
</glsx-combi-form> </glsx-combi-form>
</GLDialog> </GLDialog>
<el-dialog class="image-dialog" :modal-append-to-body="true" :append-to-body="true" :visible.sync="previewFileVisible" width="30%">
<big-View ref="viewForm" v-if="previewFileVisible" :dialogSrc="previewObj.previewFileUrl" :dialogType="previewObj.dialogType"></big-View>
</el-dialog>
</GLDialog> </GLDialog>
</template> </template>
<script> <script>
...@@ -51,6 +70,7 @@ import endUrl from '@/images/endPoint.png' ...@@ -51,6 +70,7 @@ import endUrl from '@/images/endPoint.png'
import accidUrl from '@/images/accidPoint.png' import accidUrl from '@/images/accidPoint.png'
import AMapLoader from '@amap/amap-jsapi-loader'; import AMapLoader from '@amap/amap-jsapi-loader';
import glsxCombiForm from '@/components/glsx-combi-form' import glsxCombiForm from '@/components/glsx-combi-form'
import bigView from '@/components/big-view'
import {PHONE_MAX_NUM, FOLLOW_STATUS, FOLLOW_RESULT, SN_TYPE} from './constant' import {PHONE_MAX_NUM, FOLLOW_STATUS, FOLLOW_RESULT, SN_TYPE} from './constant'
const infoData = [ const infoData = [
{ {
...@@ -120,13 +140,20 @@ const infoData = [ ...@@ -120,13 +140,20 @@ const infoData = [
export default { export default {
name: 'leadManage', name: 'leadManage',
components: { components: {
glsxCombiForm glsxCombiForm,
bigView
}, },
props:{ props:{
curCollId: String curCollId: String
}, },
data() { data() {
return { return {
showMap: true,
previewFileVisible: false,
previewObj: {
previewFileUrl: '',
dialogType: 'video'
},
showFuncIntro: true, showFuncIntro: true,
recordVisible: false, recordVisible: false,
infoData, infoData,
...@@ -175,6 +202,14 @@ export default { ...@@ -175,6 +202,14 @@ export default {
this.getDetail() this.getDetail()
}, },
methods: { methods: {
previewFile(item) {
console.log(item)
this.previewFileVisible = true
this.previewObj = {
previewFileUrl: item.fileUrl,
dialogType: item.mediaType=="VIDEO" ? 'video' : 'img'
}
},
handleOk() { handleOk() {
this.$refs.recordRef.$refs.formRef.validate(valid => { this.$refs.recordRef.$refs.formRef.validate(valid => {
if(valid){ if(valid){
...@@ -219,6 +254,7 @@ export default { ...@@ -219,6 +254,7 @@ export default {
res.followUpTime = res.followTime ? dayjs(res.followTime).format('YYYY-MM-DD HH:mm:ss') : '' res.followUpTime = res.followTime ? dayjs(res.followTime).format('YYYY-MM-DD HH:mm:ss') : ''
res.acciTime = res.collisionTime ? dayjs(res.collisionTime).format('YYYY-MM-DD HH:mm:ss') : '' res.acciTime = res.collisionTime ? dayjs(res.collisionTime).format('YYYY-MM-DD HH:mm:ss') : ''
this.detailDataObj = res this.detailDataObj = res
if(!res.carAddressList?.length) return this.showMap = false
this.handleData(res.carAddressList, res.collisionTime) this.handleData(res.carAddressList, res.collisionTime)
} }
}) })
...@@ -274,7 +310,10 @@ export default { ...@@ -274,7 +310,10 @@ export default {
// 绘制图表 // 绘制图表
myChart.setOption({ myChart.setOption({
tooltip: { tooltip: {
trigger: 'axis' trigger: 'axis',
formatter: function(params) {
return (params[0]?.value || 0) + '(Km/h)'
}
}, },
grid: { grid: {
left: '3%', left: '3%',
...@@ -368,7 +407,7 @@ export default { ...@@ -368,7 +407,7 @@ export default {
var startPoint = new AMap.Marker({ var startPoint = new AMap.Marker({
position: startAddr, position: startAddr,
icon: startPointIcon, icon: startPointIcon,
offset: new AMap.Pixel(-10, -35), offset: new AMap.Pixel(-20, -35),
map: map map: map
}); });
...@@ -376,7 +415,7 @@ export default { ...@@ -376,7 +415,7 @@ export default {
var endPoint = new AMap.Marker({ var endPoint = new AMap.Marker({
position: endAddr, position: endAddr,
icon: endPointIcon, icon: endPointIcon,
offset: new AMap.Pixel(-10, -35), offset: new AMap.Pixel(-20, -35),
map: map map: map
}); });
...@@ -384,7 +423,7 @@ export default { ...@@ -384,7 +423,7 @@ export default {
var collisionPoint = new AMap.Marker({ var collisionPoint = new AMap.Marker({
position: pointAddr, position: pointAddr,
icon: collisionPointIcon, icon: collisionPointIcon,
offset: new AMap.Pixel(-10, -35), offset: new AMap.Pixel(-20, -35),
map: map map: map
}); });
...@@ -406,6 +445,17 @@ export default { ...@@ -406,6 +445,17 @@ export default {
} }
</script> </script>
<style lang="scss" scoped> <style lang="scss" scoped>
.empty-wrap{
width: 100%;
height: 100%;
text-align: center;
.empty-img{
width: 64px;
height: 40px;
margin-bottom: 10px;
}
}
.head-tip{ .head-tip{
height: 40px; height: 40px;
line-height: 40px; line-height: 40px;
...@@ -443,14 +493,38 @@ export default { ...@@ -443,14 +493,38 @@ export default {
.accident-item{ .accident-item{
flex: 1; flex: 1;
.media-box{ .media-box{
display: flex;
.media-item{ .media-item{
display: inline-block; display: inline-block;
position: relative;
margin-right: 10px;
.img, .video{ .img, .video{
display: inline-block; display: inline-block;
width: 104px; width: 104px;
height: 104px; height: 104px;
border-radius: 4px; border-radius: 4px;
margin-right: 10px; }
.mask{
display: none;
}
}
.media-item:hover{
.mask{
position: absolute;
left: 0;
right: 0;
top: 0;
bottom: 0;
background: rgba(0, 0, 0, .3);
border-radius: 4px;
display: flex;
align-items: center;
justify-content: center;
.preview{
height: 20px;
width: 20px;
cursor: pointer;
}
} }
} }
} }
......
...@@ -301,7 +301,8 @@ export default { ...@@ -301,7 +301,8 @@ export default {
{ {
label: '商户名称', label: '商户名称',
prop: 'merchantName', prop: 'merchantName',
width: 180 width: 200,
line: 1
}, },
{ {
label: '商户号', label: '商户号',
...@@ -340,7 +341,8 @@ export default { ...@@ -340,7 +341,8 @@ export default {
{ {
label: '车架号', label: '车架号',
prop: 'standNo', prop: 'standNo',
width: 140 width: 200,
line: 1
}, },
{ {
label: '车型', label: '车型',
...@@ -350,7 +352,8 @@ export default { ...@@ -350,7 +352,8 @@ export default {
{ {
label: '碰撞地点', label: '碰撞地点',
prop: 'address', prop: 'address',
minWidth: 140 width: 220,
line: 1
}, },
{ {
label: '碰撞时间', label: '碰撞时间',
......
...@@ -288,7 +288,8 @@ export default { ...@@ -288,7 +288,8 @@ export default {
{ {
label: '商户名称', label: '商户名称',
prop: 'merchantName', prop: 'merchantName',
minWidth: 180 width: 200,
line: 1
}, },
{ {
label: '商户号', label: '商户号',
...@@ -307,7 +308,8 @@ export default { ...@@ -307,7 +308,8 @@ export default {
{ {
label: 'IMEI/SN', label: 'IMEI/SN',
prop: 'sn', prop: 'sn',
minWidth: 120 width: 200,
line: 1
}, },
{ {
label: 'ICCID', label: 'ICCID',
...@@ -340,7 +342,8 @@ export default { ...@@ -340,7 +342,8 @@ export default {
{ {
label: '车架号', label: '车架号',
prop: 'standNo', prop: 'standNo',
minWidth: 140 width: 220,
line: 1
}, },
{ {
label: '车型', label: '车型',
...@@ -350,7 +353,7 @@ export default { ...@@ -350,7 +353,7 @@ export default {
{ {
label: '设备安装时的初始里程', label: '设备安装时的初始里程',
prop: 'initialMileage', prop: 'initialMileage',
minWidth: 140 width: 200,
}, },
{ {
label: '上次保养里程', label: '上次保养里程',
...@@ -360,9 +363,6 @@ export default { ...@@ -360,9 +363,6 @@ export default {
{ {
label: '上次保养时间', label: '上次保养时间',
prop: 'lastTime', prop: 'lastTime',
formatter: cell => {
return cell.lastTime ? dayjs(cell.lastTime).format('YYYY-MM-DD HH:mm:ss') : '--'
},
minWidth: 140 minWidth: 140
}, },
{ {
...@@ -373,9 +373,6 @@ export default { ...@@ -373,9 +373,6 @@ export default {
{ {
label: '下次保养时间', label: '下次保养时间',
prop: 'lowerTime', prop: 'lowerTime',
formatter: cell => {
return cell.lowerTime ? dayjs(cell.lowerTime).format('YYYY-MM-DD HH:mm:ss') : '--'
},
minWidth: 180 minWidth: 180
}, },
{ {
...@@ -390,9 +387,6 @@ export default { ...@@ -390,9 +387,6 @@ export default {
{ {
label: '操作时间', label: '操作时间',
prop: 'updatedTime', prop: 'updatedTime',
formatter: cell => {
return cell.updatedTime ? dayjs(cell.updatedTime).format('YYYY-MM-DD HH:mm:ss') : '--'
},
minWidth: 180 minWidth: 180
}, },
{ {
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!