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
......@@ -9,17 +9,30 @@
<div class="accident-item">
<span class="title">事故情况</span>
<div class="media-box">
<div class="media-item" v-for="(item,index) in detailDataObj.mediaDetailList" :key="index">
<img class="img" v-if="item.mediaType == 'IMAGE'" :src="item.fileUrl" alt="">
<video v-if="item.mediaType == 'VIDEO'" class="video" preload loop muted>
<source :src="item.fileUrl" type="video/mp4"/>
</video>
<template v-if="detailDataObj.mediaDetailList && detailDataObj.mediaDetailList.length">
<div class="media-item" v-for="(item,index) in detailDataObj.mediaDetailList" :key="index">
<img class="img" v-if="item.mediaType == 'IMAGE'" :src="item.fileUrl" alt="">
<video v-if="item.mediaType == 'VIDEO'" class="video" preload loop muted>
<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 class="accident-item">
<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 v-for="(item,index) in infoData" :key="index">
......@@ -33,7 +46,10 @@
</div>
<div >
<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>
<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 @@
</glsx-combi-form>
</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>
</template>
<script>
......@@ -51,6 +70,7 @@ import endUrl from '@/images/endPoint.png'
import accidUrl from '@/images/accidPoint.png'
import AMapLoader from '@amap/amap-jsapi-loader';
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'
const infoData = [
{
......@@ -120,13 +140,20 @@ const infoData = [
export default {
name: 'leadManage',
components: {
glsxCombiForm
glsxCombiForm,
bigView
},
props:{
curCollId: String
},
data() {
return {
showMap: true,
previewFileVisible: false,
previewObj: {
previewFileUrl: '',
dialogType: 'video'
},
showFuncIntro: true,
recordVisible: false,
infoData,
......@@ -175,6 +202,14 @@ export default {
this.getDetail()
},
methods: {
previewFile(item) {
console.log(item)
this.previewFileVisible = true
this.previewObj = {
previewFileUrl: item.fileUrl,
dialogType: item.mediaType=="VIDEO" ? 'video' : 'img'
}
},
handleOk() {
this.$refs.recordRef.$refs.formRef.validate(valid => {
if(valid){
......@@ -219,6 +254,7 @@ export default {
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') : ''
this.detailDataObj = res
if(!res.carAddressList?.length) return this.showMap = false
this.handleData(res.carAddressList, res.collisionTime)
}
})
......@@ -274,7 +310,10 @@ export default {
// 绘制图表
myChart.setOption({
tooltip: {
trigger: 'axis'
trigger: 'axis',
formatter: function(params) {
return (params[0]?.value || 0) + '(Km/h)'
}
},
grid: {
left: '3%',
......@@ -368,7 +407,7 @@ export default {
var startPoint = new AMap.Marker({
position: startAddr,
icon: startPointIcon,
offset: new AMap.Pixel(-10, -35),
offset: new AMap.Pixel(-20, -35),
map: map
});
......@@ -376,7 +415,7 @@ export default {
var endPoint = new AMap.Marker({
position: endAddr,
icon: endPointIcon,
offset: new AMap.Pixel(-10, -35),
offset: new AMap.Pixel(-20, -35),
map: map
});
......@@ -384,7 +423,7 @@ export default {
var collisionPoint = new AMap.Marker({
position: pointAddr,
icon: collisionPointIcon,
offset: new AMap.Pixel(-10, -35),
offset: new AMap.Pixel(-20, -35),
map: map
});
......@@ -406,6 +445,17 @@ export default {
}
</script>
<style lang="scss" scoped>
.empty-wrap{
width: 100%;
height: 100%;
text-align: center;
.empty-img{
width: 64px;
height: 40px;
margin-bottom: 10px;
}
}
.head-tip{
height: 40px;
line-height: 40px;
......@@ -443,14 +493,38 @@ export default {
.accident-item{
flex: 1;
.media-box{
display: flex;
.media-item{
display: inline-block;
position: relative;
margin-right: 10px;
.img, .video{
display: inline-block;
width: 104px;
height: 104px;
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 {
{
label: '商户名称',
prop: 'merchantName',
width: 180
width: 200,
line: 1
},
{
label: '商户号',
......@@ -340,7 +341,8 @@ export default {
{
label: '车架号',
prop: 'standNo',
width: 140
width: 200,
line: 1
},
{
label: '车型',
......@@ -350,7 +352,8 @@ export default {
{
label: '碰撞地点',
prop: 'address',
minWidth: 140
width: 220,
line: 1
},
{
label: '碰撞时间',
......
......@@ -288,7 +288,8 @@ export default {
{
label: '商户名称',
prop: 'merchantName',
minWidth: 180
width: 200,
line: 1
},
{
label: '商户号',
......@@ -307,7 +308,8 @@ export default {
{
label: 'IMEI/SN',
prop: 'sn',
minWidth: 120
width: 200,
line: 1
},
{
label: 'ICCID',
......@@ -340,7 +342,8 @@ export default {
{
label: '车架号',
prop: 'standNo',
minWidth: 140
width: 220,
line: 1
},
{
label: '车型',
......@@ -350,7 +353,7 @@ export default {
{
label: '设备安装时的初始里程',
prop: 'initialMileage',
minWidth: 140
width: 200,
},
{
label: '上次保养里程',
......@@ -360,9 +363,6 @@ export default {
{
label: '上次保养时间',
prop: 'lastTime',
formatter: cell => {
return cell.lastTime ? dayjs(cell.lastTime).format('YYYY-MM-DD HH:mm:ss') : '--'
},
minWidth: 140
},
{
......@@ -373,9 +373,6 @@ export default {
{
label: '下次保养时间',
prop: 'lowerTime',
formatter: cell => {
return cell.lowerTime ? dayjs(cell.lowerTime).format('YYYY-MM-DD HH:mm:ss') : '--'
},
minWidth: 180
},
{
......@@ -390,9 +387,6 @@ export default {
{
label: '操作时间',
prop: 'updatedTime',
formatter: cell => {
return cell.updatedTime ? dayjs(cell.updatedTime).format('YYYY-MM-DD HH:mm:ss') : '--'
},
minWidth: 180
},
{
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!