Commit 437adb86 by 前端

Merge branch 'change-map' into 'master'

上线合并

See merge request !6
2 parents cc8674f7 9216dbe7
!function(t,r){"object"==typeof exports&&"undefined"!=typeof module?module.exports=r():"function"==typeof define&&define.amd?define(r):(t="undefined"!=typeof globalThis?globalThis:t||self).GlMap=r()}(this,(function(){"use strict";function t(t,r){(null==r||r>t.length)&&(r=t.length);for(var e=0,n=Array(r);e<r;e++)n[e]=t[e];return n}function r(t,r,e,n,o,i,a){try{var c=t[i](a),u=c.value}catch(t){return void e(t)}c.done?r(u):Promise.resolve(u).then(n,o)}function e(t,r,e){return r&&function(t,r){for(var e=0;e<r.length;e++){var n=r[e];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,i(n.key),n)}}(t.prototype,r),Object.defineProperty(t,"prototype",{writable:!1}),t}function n(){n=function(){return r};var t,r={},e=Object.prototype,o=e.hasOwnProperty,i=Object.defineProperty||function(t,r,e){t[r]=e.value},a="function"==typeof Symbol?Symbol:{},c=a.iterator||"@@iterator",u=a.asyncIterator||"@@asyncIterator",f=a.toStringTag||"@@toStringTag";function l(t,r,e){return Object.defineProperty(t,r,{value:e,enumerable:!0,configurable:!0,writable:!0}),t[r]}try{l({},"")}catch(t){l=function(t,r,e){return t[r]=e}}function s(t,r,e,n){var o=r&&r.prototype instanceof g?r:g,a=Object.create(o.prototype),c=new P(n||[]);return i(a,"_invoke",{value:O(t,e,c)}),a}function h(t,r,e){try{return{type:"normal",arg:t.call(r,e)}}catch(t){return{type:"throw",arg:t}}}r.wrap=s;var p="suspendedStart",y="suspendedYield",v="executing",d="completed",m={};function g(){}function w(){}function b(){}var L={};l(L,c,(function(){return this}));var x=Object.getPrototypeOf,E=x&&x(x(T([])));E&&E!==e&&o.call(E,c)&&(L=E);var j=b.prototype=g.prototype=Object.create(L);function G(t){["next","throw","return"].forEach((function(r){l(t,r,(function(t){return this._invoke(r,t)}))}))}function S(t,r){function e(n,i,a,c){var u=h(t[n],t,i);if("throw"!==u.type){var f=u.arg,l=f.value;return l&&"object"==typeof l&&o.call(l,"__await")?r.resolve(l.__await).then((function(t){e("next",t,a,c)}),(function(t){e("throw",t,a,c)})):r.resolve(l).then((function(t){f.value=t,a(f)}),(function(t){return e("throw",t,a,c)}))}c(u.arg)}var n;i(this,"_invoke",{value:function(t,o){function i(){return new r((function(r,n){e(t,o,r,n)}))}return n=n?n.then(i,i):i()}})}function O(r,e,n){var o=p;return function(i,a){if(o===v)throw Error("Generator is already running");if(o===d){if("throw"===i)throw a;return{value:t,done:!0}}for(n.method=i,n.arg=a;;){var c=n.delegate;if(c){var u=_(c,n);if(u){if(u===m)continue;return u}}if("next"===n.method)n.sent=n._sent=n.arg;else if("throw"===n.method){if(o===p)throw o=d,n.arg;n.dispatchException(n.arg)}else"return"===n.method&&n.abrupt("return",n.arg);o=v;var f=h(r,e,n);if("normal"===f.type){if(o=n.done?d:y,f.arg===m)continue;return{value:f.arg,done:n.done}}"throw"===f.type&&(o=d,n.method="throw",n.arg=f.arg)}}}function _(r,e){var n=e.method,o=r.iterator[n];if(o===t)return e.delegate=null,"throw"===n&&r.iterator.return&&(e.method="return",e.arg=t,_(r,e),"throw"===e.method)||"return"!==n&&(e.method="throw",e.arg=new TypeError("The iterator does not provide a '"+n+"' method")),m;var i=h(o,r.iterator,e.arg);if("throw"===i.type)return e.method="throw",e.arg=i.arg,e.delegate=null,m;var a=i.arg;return a?a.done?(e[r.resultName]=a.value,e.next=r.nextLoc,"return"!==e.method&&(e.method="next",e.arg=t),e.delegate=null,m):a:(e.method="throw",e.arg=new TypeError("iterator result is not an object"),e.delegate=null,m)}function k(t){var r={tryLoc:t[0]};1 in t&&(r.catchLoc=t[1]),2 in t&&(r.finallyLoc=t[2],r.afterLoc=t[3]),this.tryEntries.push(r)}function A(t){var r=t.completion||{};r.type="normal",delete r.arg,t.completion=r}function P(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(k,this),this.reset(!0)}function T(r){if(r||""===r){var e=r[c];if(e)return e.call(r);if("function"==typeof r.next)return r;if(!isNaN(r.length)){var n=-1,i=function e(){for(;++n<r.length;)if(o.call(r,n))return e.value=r[n],e.done=!1,e;return e.value=t,e.done=!0,e};return i.next=i}}throw new TypeError(typeof r+" is not iterable")}return w.prototype=b,i(j,"constructor",{value:b,configurable:!0}),i(b,"constructor",{value:w,configurable:!0}),w.displayName=l(b,f,"GeneratorFunction"),r.isGeneratorFunction=function(t){var r="function"==typeof t&&t.constructor;return!!r&&(r===w||"GeneratorFunction"===(r.displayName||r.name))},r.mark=function(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,b):(t.__proto__=b,l(t,f,"GeneratorFunction")),t.prototype=Object.create(j),t},r.awrap=function(t){return{__await:t}},G(S.prototype),l(S.prototype,u,(function(){return this})),r.AsyncIterator=S,r.async=function(t,e,n,o,i){void 0===i&&(i=Promise);var a=new S(s(t,e,n,o),i);return r.isGeneratorFunction(e)?a:a.next().then((function(t){return t.done?t.value:a.next()}))},G(j),l(j,f,"Generator"),l(j,c,(function(){return this})),l(j,"toString",(function(){return"[object Generator]"})),r.keys=function(t){var r=Object(t),e=[];for(var n in r)e.push(n);return e.reverse(),function t(){for(;e.length;){var n=e.pop();if(n in r)return t.value=n,t.done=!1,t}return t.done=!0,t}},r.values=T,P.prototype={constructor:P,reset:function(r){if(this.prev=0,this.next=0,this.sent=this._sent=t,this.done=!1,this.delegate=null,this.method="next",this.arg=t,this.tryEntries.forEach(A),!r)for(var e in this)"t"===e.charAt(0)&&o.call(this,e)&&!isNaN(+e.slice(1))&&(this[e]=t)},stop:function(){this.done=!0;var t=this.tryEntries[0].completion;if("throw"===t.type)throw t.arg;return this.rval},dispatchException:function(r){if(this.done)throw r;var e=this;function n(n,o){return c.type="throw",c.arg=r,e.next=n,o&&(e.method="next",e.arg=t),!!o}for(var i=this.tryEntries.length-1;i>=0;--i){var a=this.tryEntries[i],c=a.completion;if("root"===a.tryLoc)return n("end");if(a.tryLoc<=this.prev){var u=o.call(a,"catchLoc"),f=o.call(a,"finallyLoc");if(u&&f){if(this.prev<a.catchLoc)return n(a.catchLoc,!0);if(this.prev<a.finallyLoc)return n(a.finallyLoc)}else if(u){if(this.prev<a.catchLoc)return n(a.catchLoc,!0)}else{if(!f)throw Error("try statement without catch or finally");if(this.prev<a.finallyLoc)return n(a.finallyLoc)}}}},abrupt:function(t,r){for(var e=this.tryEntries.length-1;e>=0;--e){var n=this.tryEntries[e];if(n.tryLoc<=this.prev&&o.call(n,"finallyLoc")&&this.prev<n.finallyLoc){var i=n;break}}i&&("break"===t||"continue"===t)&&i.tryLoc<=r&&r<=i.finallyLoc&&(i=null);var a=i?i.completion:{};return a.type=t,a.arg=r,i?(this.method="next",this.next=i.finallyLoc,m):this.complete(a)},complete:function(t,r){if("throw"===t.type)throw t.arg;return"break"===t.type||"continue"===t.type?this.next=t.arg:"return"===t.type?(this.rval=this.arg=t.arg,this.method="return",this.next="end"):"normal"===t.type&&r&&(this.next=r),m},finish:function(t){for(var r=this.tryEntries.length-1;r>=0;--r){var e=this.tryEntries[r];if(e.finallyLoc===t)return this.complete(e.completion,e.afterLoc),A(e),m}},catch:function(t){for(var r=this.tryEntries.length-1;r>=0;--r){var e=this.tryEntries[r];if(e.tryLoc===t){var n=e.completion;if("throw"===n.type){var o=n.arg;A(e)}return o}}throw Error("illegal catch attempt")},delegateYield:function(r,e,n){return this.delegate={iterator:T(r),resultName:e,nextLoc:n},"next"===this.method&&(this.arg=t),m}},r}function o(r){return function(r){if(Array.isArray(r))return t(r)}(r)||function(t){if("undefined"!=typeof Symbol&&null!=t[Symbol.iterator]||null!=t["@@iterator"])return Array.from(t)}(r)||function(r,e){if(r){if("string"==typeof r)return t(r,e);var n={}.toString.call(r).slice(8,-1);return"Object"===n&&r.constructor&&(n=r.constructor.name),"Map"===n||"Set"===n?Array.from(r):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?t(r,e):void 0}}(r)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function i(t){var r=function(t,r){if("object"!=typeof t||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var n=e.call(t,r);if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t,"string");return"symbol"==typeof r?r:r+""}function a(t){return a="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},a(t)}var c={1:"develop",2:"test",3:"production",4:"beta"},u=function(){return e((function t(){var e=this;!function(t,r){if(!(t instanceof r))throw new TypeError("Cannot call a class as a function")}(this,t);var o,i,u={env:3,version:3},f=arguments[0];if(arguments.length>1&&(u="object"==a(arguments[0])?arguments[0]:u,f=arguments[1],null!==(o=u)&&void 0!==o&&o.env||(u.env=3),null!==(i=u)&&void 0!==i&&i.version||(u.version=3)),"undefined"!=typeof window){var l=function(){var t,o=(t=n().mark((function t(){var r,o,i,a;return n().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.prev=0,t.next=3,fetch("https://config-center-backend.glsx.com.cn/glsxAdmin/config?moduleUrl=map-api-js&env=".concat(c[u.env]));case 3:return r=t.sent,t.next=6,r.json();case 6:o=t.sent,i=Array.from(document.head.getElementsByTagName("script")).some((function(t){return t.src===o.apiUrl})),i?f&&"function"==typeof f&&(e.GLMap=new window.$GlMapApi(u,(function(){f&&"function"==typeof f&&f(e)}))):((a=document.createElement("script")).src=o.apiUrl,document.head.appendChild(a),a.onload=function(){e.GLMap=new window.$GlMapApi(u,(function(){f&&"function"==typeof f&&f(e)}))}),t.next=14;break;case 11:t.prev=11,t.t0=t.catch(0),console.error("Failed to fetch configuration:",t.t0);case 14:case"end":return t.stop()}}),t,null,[[0,11]])})),function(){var e=this,n=arguments;return new Promise((function(o,i){var a=t.apply(e,n);function c(t){r(a,o,i,c,u,"next",t)}function u(t){r(a,o,i,c,u,"throw",t)}c(void 0)}))});return function(){return o.apply(this,arguments)}}();l()}}),[{key:"invoke",value:function(t){var r,e=Array.prototype.slice.call(arguments,1);return(r=this.GLMap)[t].apply(r,o(e))}},{key:"map",get:function(){return this.GLMap._BMAP}},{key:"mapGL",get:function(){return this.GLMap._BMapGL}}])}();return u}));
<template> <template>
<GLDialog mode="big" bigTitle="碰撞位置" :before-close="closeDialogFn" @onCancel="closeDialogFn" :visible.sync="showFuncIntro" :hasFooter="false"> <GLDialog mode="big" bigTitle="碰撞位置" :before-close="closeDialogFn" @onCancel="closeDialogFn" :visible.sync="showFuncIntro" :hasFooter="false">
<div class="head-tip" v-if="detailDataObj.collisionTimeOutFlag"> <div class="head-tip" v-if="detailDataObj.collisionTimeOutFlag">
<img class="tip-img" src="@/images/tip.png" alt=""> <img class="tip-img" src="@/images/tip.png" alt="" />
<span>车辆碰撞后,停留时间超过3分钟,建议去电回访。</span> <span>车辆碰撞后,停留时间超过3分钟,建议去电回访。</span>
<span class="follow-up" @click="openRecordDialog">立即跟进</span> <span class="follow-up" @click="openRecordDialog">立即跟进</span>
</div> </div>
...@@ -10,18 +10,18 @@ ...@@ -10,18 +10,18 @@
<span class="title">事故情况</span> <span class="title">事故情况</span>
<div class="media-box"> <div class="media-box">
<template v-if="detailDataObj.mediaDetailList && detailDataObj.mediaDetailList.length"> <template v-if="detailDataObj.mediaDetailList && detailDataObj.mediaDetailList.length">
<div class="media-item" v-for="(item,index) in detailDataObj.mediaDetailList" :key="index"> <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=""> <img class="img" v-if="item.mediaType == 'IMAGE'" :src="item.fileUrl" alt="" />
<video v-if="item.mediaType == 'VIDEO'" class="video" preload loop muted> <video v-if="item.mediaType == 'VIDEO'" class="video" preload loop muted>
<source :src="item.fileUrl" type="video/mp4"/> <source :src="item.fileUrl" type="video/mp4" />
</video> </video>
<div class="mask"> <div class="mask">
<img class="preview" src="@/images/eyes.png" alt="" @click="previewFile(item)"> <img class="preview" src="@/images/eyes.png" alt="" @click="previewFile(item)" />
</div> </div>
</div> </div>
</template> </template>
<div class="empty-wrap" v-else> <div class="empty-wrap" v-else>
<img class="empty-img" src="@/images/empty-file.png" alt=""> <img class="empty-img" src="@/images/empty-file.png" alt="" />
<p>暂无碰撞视频、暂无碰撞图片</p> <p>暂无碰撞视频、暂无碰撞图片</p>
</div> </div>
</div> </div>
...@@ -30,32 +30,30 @@ ...@@ -30,32 +30,30 @@
<span class="title">行车速度趋势(Km/h)</span> <span class="title">行车速度趋势(Km/h)</span>
<div v-if="showMap" class="eChart-box" id="echarts"></div> <div v-if="showMap" class="eChart-box" id="echarts"></div>
<div class="empty-wrap" v-else> <div class="empty-wrap" v-else>
<img class="empty-img" style="height: 70px;width: 176px;" src="@/images/empty-speed.png" alt=""> <img class="empty-img" style="height: 70px; width: 176px" src="@/images/empty-speed.png" alt="" />
<p>未获取到行车速度趋势</p> <p>未获取到行车速度趋势</p>
</div> </div>
</div> </div>
</div> </div>
<div v-for="(item,index) in infoData" :key="index"> <div v-for="(item, index) in infoData" :key="index">
<span class="title">{{ item.title }}</span> <span class="title">{{ item.title }}</span>
<div> <div>
<div v-for="(ele, idx) in item.objList" :key="idx" class="obj-item"> <div v-for="(ele, idx) in item.objList" :key="idx" class="obj-item">
<label class="label" for="">{{ele.name}}:</label> <label class="label" for="">{{ ele.name }}:</label>
<span class="value">{{detailDataObj[ele.key] || '--'}}</span> <span class="value">{{ detailDataObj[ele.key] || '--' }}</span>
</div> </div>
</div> </div>
</div> </div>
<div > <div>
<span class="title">事故地点</span> <span class="title">事故地点</span>
<div v-if="showMap" id="mapContainer"></div> <div v-if="showMap" id="mapContainer"></div>
<div class="empty-wrap" v-else> <div class="empty-wrap" v-else>
<img class="empty-img" style="height: 120px;width: 100px;" src="@/images/empty-addr.png" alt=""> <img class="empty-img" style="height: 120px; width: 100px" src="@/images/empty-addr.png" alt="" />
<p>未获取到设备定位</p> <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">
<glsx-combi-form class="record-form" ref="recordRef" :formRules="recordRule" labelWidth="154px" defaultWidth="432px" :formObj="recordForm" :formData="recordFormData"> <glsx-combi-form class="record-form" ref="recordRef" :formRules="recordRule" labelWidth="154px" defaultWidth="432px" :formObj="recordForm" :formData="recordFormData"></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%"> <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> <big-View ref="viewForm" v-if="previewFileVisible" :dialogSrc="previewObj.previewFileUrl" :dialogType="previewObj.dialogType"></big-View>
...@@ -63,15 +61,16 @@ ...@@ -63,15 +61,16 @@
</GLDialog> </GLDialog>
</template> </template>
<script> <script>
import * as echarts from 'echarts'; import * as echarts from 'echarts'
import * as dayjs from 'dayjs' import * as dayjs from 'dayjs'
import startUrl from '@/images/icon_start.png' import startUrl from '@/images/icon_start.png'
import endUrl from '@/images/endPoint.png' 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 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'
import GLMapSdk from '@/utils/glsk-map-sdk'
const infoData = [ const infoData = [
{ {
title: '客户信息', title: '客户信息',
...@@ -83,7 +82,7 @@ const infoData = [ ...@@ -83,7 +82,7 @@ const infoData = [
{ {
name: '手机号码', name: '手机号码',
key: 'customerPhone' key: 'customerPhone'
}, }
] ]
}, },
{ {
...@@ -104,7 +103,7 @@ const infoData = [ ...@@ -104,7 +103,7 @@ const infoData = [
{ {
name: '车牌', name: '车牌',
key: 'licensePlate' key: 'licensePlate'
}, }
] ]
}, },
{ {
...@@ -117,7 +116,8 @@ const infoData = [ ...@@ -117,7 +116,8 @@ const infoData = [
{ {
name: '碰撞点', name: '碰撞点',
key: 'address' key: 'address'
}] }
]
}, },
{ {
title: '跟进信息', title: '跟进信息',
...@@ -135,7 +135,7 @@ const infoData = [ ...@@ -135,7 +135,7 @@ const infoData = [
key: 'followUpResult' key: 'followUpResult'
} }
] ]
}, }
] ]
export default { export default {
name: 'leadManage', name: 'leadManage',
...@@ -143,11 +143,12 @@ export default { ...@@ -143,11 +143,12 @@ export default {
glsxCombiForm, glsxCombiForm,
bigView bigView
}, },
props:{ props: {
curCollId: String curCollId: String
}, },
data() { data() {
return { return {
BMap: null,
showMap: true, showMap: true,
previewFileVisible: false, previewFileVisible: false,
previewObj: { previewObj: {
...@@ -185,7 +186,7 @@ export default { ...@@ -185,7 +186,7 @@ export default {
label: '无法处理', label: '无法处理',
value: 2 value: 2
} }
], ]
}, },
{ {
label: '备注', label: '备注',
...@@ -195,11 +196,10 @@ export default { ...@@ -195,11 +196,10 @@ export default {
showLimit: true, showLimit: true,
inputType: 'textarea' inputType: 'textarea'
} }
], ]
} }
}, },
created() { created() {},
},
mounted() { mounted() {
this.getDetail() this.getDetail()
}, },
...@@ -209,18 +209,18 @@ export default { ...@@ -209,18 +209,18 @@ export default {
this.previewFileVisible = true this.previewFileVisible = true
this.previewObj = { this.previewObj = {
previewFileUrl: item.fileUrl, previewFileUrl: item.fileUrl,
dialogType: item.mediaType=="VIDEO" ? 'video' : 'img' 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) {
const params = { const params = {
id: this.curCollId, id: this.curCollId,
...this.recordForm ...this.recordForm
} }
this.$apis.sendRepair.setFollowInfoApi(params).then(res => { this.$apis.sendRepair.setFollowInfoApi(params).then(res => {
if(res){ if (res) {
this.$message({ this.$message({
type: 'success', type: 'success',
message: '操作成功', message: '操作成功',
...@@ -239,60 +239,66 @@ export default { ...@@ -239,60 +239,66 @@ export default {
handleCancel() { handleCancel() {
this.resetRecordData() this.resetRecordData()
}, },
closeDialogFn(){ closeDialogFn() {
this.$emit('closeDialogFn') this.$emit('closeDialogFn')
}, },
resetRecordData(){ resetRecordData() {
this.recordVisible = false this.recordVisible = false
this.recordForm = { this.recordForm = {
followResult: '', followResult: '',
followRemark: '' followRemark: ''
} }
}, },
getDetail(){ getDetail() {
this.$apis.sendRepair.getCollisionDetailApi({id: this.curCollId}).then(res => { this.$apis.sendRepair.getCollisionDetailApi({ id: this.curCollId }).then(res => {
if(res){ if (res) {
console.log(res) console.log(res)
const result = FOLLOW_RESULT.find(item => item.value==res.followResult) const result = FOLLOW_RESULT.find(item => item.value == res.followResult)
const status = FOLLOW_STATUS.find(item => item.value==res.followStatus) const status = FOLLOW_STATUS.find(item => item.value == res.followStatus)
res.followUpResult = result ? result.label : '' res.followUpResult = result ? result.label : ''
res.followUpStatus = status ? status.label : '' res.followUpStatus = status ? status.label : ''
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 if (!res.carAddressList?.length) return (this.showMap = false)
const addr = [res.longitude? +res.longitude : 0, res.latitude? +res.latitude : 0] const addr = [res.longitude ? +res.longitude : 0, res.latitude ? +res.latitude : 0]
this.handleData(res.carAddressList, res.collisionTime, addr) this.handleData(res.carAddressList, res.collisionTime, addr)
} }
}) })
}, },
openRecordDialog(){ openRecordDialog() {
this.recordForm = { this.recordForm = {
followResult: this.detailDataObj.followResult, followResult: this.detailDataObj.followResult,
followRemark: this.detailDataObj.followRemark followRemark: this.detailDataObj.followRemark
} }
this.recordVisible = true this.recordVisible = true
}, },
handleData(list, collTime , addr){ handleData(list, collTime, addr) {
let xList = [], yList = [], lineList = [], mapLnglatList=[]; let xList = [],
let startAddr = [], pointAddr = [], endAddr = []; yList = [],
lineList = [],
mapLnglatList = []
let startAddr = [],
pointAddr = [],
endAddr = []
const time = dayjs(collTime).format('HH:mm:ss') const time = dayjs(collTime).format('HH:mm:ss')
list.forEach((ele,index) => { list.forEach((ele, index) => {
// console.log(ele)
mapLnglatList.push(ele.lnglat) mapLnglatList.push(ele.lnglat)
if(index==0 || index==list.length-1){ if (index == 0 || index == list.length - 1) {
if(index==0) startAddr = ele.lnglat if (index == 0) startAddr = ele.lnglat
if(index!=0) endAddr = ele.lnglat if (index != 0) endAddr = ele.lnglat
xList.push(`${ele.time}${index==0 ? '起点' : '终点'}`) xList.push(`${ele.time}${index == 0 ? '起点' : '终点'}`)
}else{ } else {
if(ele.time==time) pointAddr = ele.lnglat if (ele.time == time) pointAddr = ele.lnglat
xList.push(ele.time==time ? ele.time + '碰撞点' : '') xList.push(ele.time == time ? ele.time + '碰撞点' : '')
} }
yList.push(ele.sp) yList.push(ele.sp)
}); })
const maxByList = Math.max.apply(null, yList); const maxByList = Math.max.apply(null, yList)
const yMax = maxByList + (10-(maxByList%10!=0 ? maxByList%10 : 10)) const yMax = maxByList + (10 - (maxByList % 10 != 0 ? maxByList % 10 : 10))
xList.forEach(item => { xList.forEach(item => {
if(item){ if (item) {
const itemlist = [ const itemlist = [
{ {
lineStyle: { lineStyle: {
...@@ -309,16 +315,17 @@ export default { ...@@ -309,16 +315,17 @@ export default {
} }
}) })
this.drawLine(xList, yList, lineList) this.drawLine(xList, yList, lineList)
this.initMap(mapLnglatList, startAddr, addr, endAddr) // this.initMap(mapLnglatList, startAddr, addr, endAddr)
this.initBMap(mapLnglatList, startAddr, addr, endAddr)
}, },
drawLine(xList, yList, lineList){ drawLine(xList, yList, lineList) {
// 基于准备好的dom,初始化echarts实例 // 基于准备好的dom,初始化echarts实例
var myChart = echarts.init(document.getElementById('echarts')); var myChart = echarts.init(document.getElementById('echarts'))
// 绘制图表 // 绘制图表
myChart.setOption({ myChart.setOption({
tooltip: { tooltip: {
trigger: 'axis', trigger: 'axis',
formatter: function(params) { formatter: function (params) {
return (params[0]?.value || 0) + '(Km/h)' return (params[0]?.value || 0) + '(Km/h)'
} }
}, },
...@@ -344,25 +351,28 @@ export default { ...@@ -344,25 +351,28 @@ export default {
axisLabel: { axisLabel: {
interval: 0, interval: 0,
color: '#333333' // 让刻度标签的颜色自动适应主题 color: '#333333' // 让刻度标签的颜色自动适应主题
}, }
}, },
yAxis: { yAxis: {
type: 'value' type: 'value'
}, },
series: [{ series: [
{
type: 'line', type: 'line',
smooth: true, smooth: true,
symbol: 'circle', // 将圆点改为点 symbol: 'circle', // 将圆点改为点
stack: 'Total', stack: 'Total',
itemStyle: { itemStyle: {
color: '#5850FF', color: '#5850FF'
}, },
lineStyle: { lineStyle: {
color: '#5850FF', // 设置线条颜色 color: '#5850FF', // 设置线条颜色
width: 1, width: 1
}, },
areaStyle: { // 使用 areaStyle 来设置渐变背景 areaStyle: {
color: new echarts.graphic.LinearGradient(0, 0, 0, 1, [{ // 使用 areaStyle 来设置渐变背景
color: new echarts.graphic.LinearGradient(0, 0, 0, 1, [
{
offset: 0, offset: 0,
color: 'rgba(88, 80, 255, 0.5)' color: 'rgba(88, 80, 255, 0.5)'
}, // 渐变起始颜色 }, // 渐变起始颜色
...@@ -378,45 +388,47 @@ export default { ...@@ -378,45 +388,47 @@ export default {
data: lineList data: lineList
}, },
data: yList data: yList
}] }
}); ]
})
}, },
initMap(mapLnglatList, startAddr, pointAddr, endAddr) { initMap(mapLnglatList, startAddr, pointAddr, endAddr) {
AMapLoader.load({ AMapLoader.load({
key: "44cc16e43ad7ed3358df507bd0618181", //此处填入我们注册账号后获取的Key key: '44cc16e43ad7ed3358df507bd0618181', //此处填入我们注册账号后获取的Key
version: "2.0", //指定要加载的 JSAPI 的版本,缺省时默认为 1.4.15 version: '2.0', //指定要加载的 JSAPI 的版本,缺省时默认为 1.4.15
plugins: ['AMap.Scale'], //需要使用的的插件列表,如比例尺'AMap.Scale'等 plugins: ['AMap.Scale'] //需要使用的的插件列表,如比例尺'AMap.Scale'等
}).then((AMap) => { })
.then(AMap => {
var map = new AMap.Map('mapContainer', { var map = new AMap.Map('mapContainer', {
zoom: 12, // 初始缩放级别 zoom: 12, // 初始缩放级别
center: startAddr // 初始地图中心点坐标 center: startAddr // 初始地图中心点坐标
}); })
// 添加缩放控件 // 添加缩放控件
map.plugin(["AMap.ToolBar"], function() { map.plugin(['AMap.ToolBar'], function () {
var toolbar = new AMap.ToolBar({ var toolbar = new AMap.ToolBar({
position: 'RT' position: 'RT'
}); })
map.addControl(toolbar); map.addControl(toolbar)
}); })
// 自定义起点图标 // 自定义起点图标
var startPointIcon = new AMap.Icon({ var startPointIcon = new AMap.Icon({
image: startUrl, // 替换成你的起点图标路径 image: startUrl, // 替换成你的起点图标路径
size: new AMap.Size(36, 36) size: new AMap.Size(36, 36)
}); })
// 自定义终点图标 // 自定义终点图标
var endPointIcon = new AMap.Icon({ var endPointIcon = new AMap.Icon({
image: endUrl, // 替换成你的终点图标路径 image: endUrl, // 替换成你的终点图标路径
size: new AMap.Size(36, 36) size: new AMap.Size(36, 36)
}); })
// 自定义碰撞位置图标 // 自定义碰撞位置图标
var collisionPointIcon = new AMap.Icon({ var collisionPointIcon = new AMap.Icon({
image: accidUrl, // 替换成你的碰撞位置图标路径 image: accidUrl, // 替换成你的碰撞位置图标路径
size: new AMap.Size(36, 36) size: new AMap.Size(36, 36)
}); })
// 创建起点标记 // 创建起点标记
var startPoint = new AMap.Marker({ var startPoint = new AMap.Marker({
...@@ -424,7 +436,7 @@ export default { ...@@ -424,7 +436,7 @@ export default {
icon: startPointIcon, icon: startPointIcon,
offset: new AMap.Pixel(-20, -35), offset: new AMap.Pixel(-20, -35),
map: map map: map
}); })
// 创建终点标记 // 创建终点标记
var endPoint = new AMap.Marker({ var endPoint = new AMap.Marker({
...@@ -432,7 +444,7 @@ export default { ...@@ -432,7 +444,7 @@ export default {
icon: endPointIcon, icon: endPointIcon,
offset: new AMap.Pixel(-20, -35), offset: new AMap.Pixel(-20, -35),
map: map map: map
}); })
// 创建碰撞位置标记 // 创建碰撞位置标记
var collisionPoint = new AMap.Marker({ var collisionPoint = new AMap.Marker({
...@@ -440,59 +452,108 @@ export default { ...@@ -440,59 +452,108 @@ export default {
icon: collisionPointIcon, icon: collisionPointIcon,
offset: new AMap.Pixel(-20, -35), offset: new AMap.Pixel(-20, -35),
map: map map: map
}); })
// 创建轨迹线 // 创建轨迹线
var polyline = new AMap.Polyline({ var polyline = new AMap.Polyline({
path: mapLnglatList, path: mapLnglatList,
strokeColor: "#3366FF", strokeColor: '#3366FF',
strokeOpacity: 1.0, strokeOpacity: 1.0,
strokeWeight: 5 strokeWeight: 5
});
polyline.setMap(map);
}).catch(e => {
console.log(e);
}) })
polyline.setMap(map)
})
.catch(e => {
console.log(e)
})
},
initBMap(mapLnglatList, startAddr, pointAddr, endAddr) {
console.log(mapLnglatList, startAddr, pointAddr, endAddr)
new GLMapSdk(
{
env: 3,
version: 1
},
async mapapi => {
this.BMap = mapapi
let map = await mapapi.invoke('Map', 'mapContainer')
map.enableScrollWheelZoom() //启用滚轮放大缩小
map.enableAutoResize() //启用自动适应容器尺寸变化
mapapi.invoke('OverviewMapControl')
mapapi.invoke('centerAndZoom', mapapi.invoke('Point', 116.404, 39.915), 13)
// mapapi.invoke('LocalCity', res => {
// mapapi.invoke('panTo', res.center)
// })
// 添加比例尺
mapapi.invoke('ScaleControl')
// 距离测量
mapapi.invoke('DistanceTool', map)
// 创建起点标记
var startPoint = this.createMarker(startUrl, startAddr)
// 创建终点标记
var endPoint = this.createMarker(endUrl, endAddr)
// 创建碰撞位置标记
var collisionPoint = this.createMarker(accidUrl, pointAddr)
let lnglatXY = mapLnglatList.map(item => {
return this.BMap.invoke('Point', item[0], item[1])
})
// 创建轨迹线
let polyline = this.BMap.invoke('Polyline', lnglatXY, { strokeColor: '#3366FF', strokeWeight: 5, strokeOpacity: 1.0 })
this.BMap.invoke('addOverlay', polyline)
this.BMap.invoke('addOverlay', startPoint)
this.BMap.invoke('addOverlay', endPoint)
this.BMap.invoke('addOverlay', collisionPoint)
}
)
},
createMarker(url, lnglat) {
console.log(url, lnglat)
let self = this
let lnglatXY = this.BMap.invoke('Point', lnglat[0], lnglat[1])
let marker = self.BMap.invoke('Marker', lnglatXY, {
icon: self.BMap.invoke('Icon', url, self.BMap.invoke('Size', 24, 34))
})
console.log(marker)
self.BMap.invoke('panTo', lnglatXY)
return marker
} }
} }
} }
</script> </script>
<style lang="scss" scoped> <style lang="scss" scoped>
.empty-wrap{ .empty-wrap {
width: 100%; width: 100%;
height: 100%; height: 100%;
text-align: center; text-align: center;
.empty-img{ .empty-img {
width: 64px; width: 64px;
height: 40px; height: 40px;
margin-bottom: 10px; margin-bottom: 10px;
} }
} }
.head-tip{ .head-tip {
height: 40px; height: 40px;
line-height: 40px; line-height: 40px;
background: #E4E3FF; background: #e4e3ff;
border-radius: 4px; border-radius: 4px;
width: 100%; width: 100%;
font-size: 14px; font-size: 14px;
box-sizing: border-box; box-sizing: border-box;
margin-bottom: 16px; margin-bottom: 16px;
padding: 0 16px; padding: 0 16px;
.tip-img{ .tip-img {
height: 14px; height: 14px;
width: 14px; width: 14px;
vertical-align: middle; vertical-align: middle;
margin-right: 8px; margin-right: 8px;
} }
.follow-up{ .follow-up {
cursor: pointer; cursor: pointer;
color: #5850FF; color: #5850ff;
} }
} }
.title{ .title {
display: inline-block; display: inline-block;
height: 24px; height: 24px;
line-height: 24px; line-height: 24px;
...@@ -502,40 +563,41 @@ export default { ...@@ -502,40 +563,41 @@ export default {
color: #000000d9; color: #000000d9;
margin-bottom: 10px; margin-bottom: 10px;
} }
.accident-wrap{ .accident-wrap {
display: flex; display: flex;
margin-bottom: 20px; margin-bottom: 20px;
.accident-item{ .accident-item {
flex: 1; flex: 1;
.media-box{ .media-box {
display: flex; display: flex;
.media-item{ .media-item {
display: inline-block; display: inline-block;
position: relative; position: relative;
margin-right: 10px; 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;
} }
.mask{ .mask {
display: none; display: none;
} }
} }
.media-item:hover{ .media-item:hover {
.mask{ .mask {
position: absolute; position: absolute;
left: 0; left: 0;
right: 0; right: 0;
top: 0; top: 0;
bottom: 0; bottom: 0;
background: rgba(0, 0, 0, .3); background: rgba(0, 0, 0, 0.3);
border-radius: 4px; border-radius: 4px;
display: flex; display: flex;
align-items: center; align-items: center;
justify-content: center; justify-content: center;
.preview{ .preview {
height: 20px; height: 20px;
width: 20px; width: 20px;
cursor: pointer; cursor: pointer;
...@@ -546,29 +608,29 @@ export default { ...@@ -546,29 +608,29 @@ export default {
} }
} }
.record-form{ .record-form {
/deep/ .el-textarea__inner{ /deep/ .el-textarea__inner {
height: 75px; height: 75px;
} }
} }
.obj-item{ .obj-item {
display: inline-block; display: inline-block;
margin-bottom: 20px; margin-bottom: 20px;
.label{ .label {
display: inline-block; display: inline-block;
text-align: right; text-align: right;
width: 154px; width: 154px;
line-height: 20px; line-height: 20px;
color: #666666; color: #666666;
} }
.value{ .value {
display: inline-block; display: inline-block;
min-width: 230px; min-width: 230px;
color: #333; color: #333;
} }
} }
.eChart-box{ .eChart-box {
width: 100%; width: 100%;
height: 187px; height: 187px;
} }
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!