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>
<GLDialog mode="big" bigTitle="碰撞位置" :before-close="closeDialogFn" @onCancel="closeDialogFn" :visible.sync="showFuncIntro" :hasFooter="false">
<div class="head-tip" v-if="detailDataObj.collisionTimeOutFlag">
<img class="tip-img" src="@/images/tip.png" alt="">
<span>车辆碰撞后,停留时间超过3分钟,建议去电回访。</span>
<span class="follow-up" @click="openRecordDialog">立即跟进</span>
</div>
<div class="accident-wrap">
<div class="accident-item">
<span class="title">事故情况</span>
<div class="media-box">
<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="">
<p>暂无碰撞视频、暂无碰撞图片</p>
</div>
</div>
</div>
<div class="accident-item">
<span class="title">行车速度趋势(Km/h)</span>
<div v-if="showMap" class="eChart-box" id="echarts"></div>
<div class="empty-wrap" v-else>
<img class="empty-img" style="height: 70px;width: 176px;" src="@/images/empty-speed.png" alt="">
<p>未获取到行车速度趋势</p>
</div>
<GLDialog mode="big" bigTitle="碰撞位置" :before-close="closeDialogFn" @onCancel="closeDialogFn" :visible.sync="showFuncIntro" :hasFooter="false">
<div class="head-tip" v-if="detailDataObj.collisionTimeOutFlag">
<img class="tip-img" src="@/images/tip.png" alt="" />
<span>车辆碰撞后,停留时间超过3分钟,建议去电回访。</span>
<span class="follow-up" @click="openRecordDialog">立即跟进</span>
</div>
<div class="accident-wrap">
<div class="accident-item">
<span class="title">事故情况</span>
<div class="media-box">
<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="" />
<p>暂无碰撞视频、暂无碰撞图片</p>
</div>
</div>
<div v-for="(item,index) in infoData" :key="index">
<span class="title">{{ item.title }}</span>
<div>
<div v-for="(ele, idx) in item.objList" :key="idx" class="obj-item">
<label class="label" for="">{{ele.name}}:</label>
<span class="value">{{detailDataObj[ele.key] || '--'}}</span>
</div>
</div>
</div>
<div class="accident-item">
<span class="title">行车速度趋势(Km/h)</span>
<div v-if="showMap" class="eChart-box" id="echarts"></div>
<div class="empty-wrap" v-else>
<img class="empty-img" style="height: 70px; width: 176px" src="@/images/empty-speed.png" alt="" />
<p>未获取到行车速度趋势</p>
</div>
<div >
<span class="title">事故地点</span>
<div v-if="showMap" id="mapContainer"></div>
<div class="empty-wrap" v-else>
<img class="empty-img" style="height: 120px;width: 100px;" src="@/images/empty-addr.png" alt="">
<p>未获取到设备定位</p>
</div>
</div>
</div>
<div v-for="(item, index) in infoData" :key="index">
<span class="title">{{ item.title }}</span>
<div>
<div v-for="(ele, idx) in item.objList" :key="idx" class="obj-item">
<label class="label" for="">{{ ele.name }}:</label>
<span class="value">{{ detailDataObj[ele.key] || '--' }}</span>
</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">
<glsx-combi-form class="record-form" ref="recordRef" :formRules="recordRule" labelWidth="154px" defaultWidth="432px" :formObj="recordForm" :formData="recordFormData">
</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>
</div>
</div>
<div>
<span class="title">事故地点</span>
<div v-if="showMap" id="mapContainer"></div>
<div class="empty-wrap" v-else>
<img class="empty-img" style="height: 120px; width: 100px" src="@/images/empty-addr.png" alt="" />
<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">
<glsx-combi-form class="record-form" ref="recordRef" :formRules="recordRule" labelWidth="154px" defaultWidth="432px" :formObj="recordForm" :formData="recordFormData"></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>
import * as echarts from 'echarts';
import * as echarts from 'echarts'
import * as dayjs from 'dayjs'
import startUrl from '@/images/icon_start.png'
import endUrl from '@/images/endPoint.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 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 = [
{
title: '客户信息',
objList: [
{
name: '联系人',
key: 'customerName'
},
{
name: '手机号码',
key: 'customerPhone'
},
]
},
{
title: '基本信息',
objList: [
{
name: '车架',
key: 'standNo'
},
{
name: '子品牌',
key: 'vehicleSubBrandName'
},
{
name: '车系',
key: 'vehicleSeriesName'
},
{
name: '车牌',
key: 'licensePlate'
},
]
},
{
title: '碰撞信息',
objList: [
{
name: '碰撞时间',
key: 'acciTime'
},
{
name: '碰撞点',
key: 'address'
}]
},
{
title: '跟进信息',
objList: [
{
name: '回访状态',
key: 'followUpStatus'
},
{
name: '回访时间',
key: 'followUpTime'
},
{
name: '回访结果',
key: 'followUpResult'
}
]
},
{
title: '客户信息',
objList: [
{
name: '联系人',
key: 'customerName'
},
{
name: '手机号码',
key: 'customerPhone'
}
]
},
{
title: '基本信息',
objList: [
{
name: '车架',
key: 'standNo'
},
{
name: '子品牌',
key: 'vehicleSubBrandName'
},
{
name: '车系',
key: 'vehicleSeriesName'
},
{
name: '车牌',
key: 'licensePlate'
}
]
},
{
title: '碰撞信息',
objList: [
{
name: '碰撞时间',
key: 'acciTime'
},
{
name: '碰撞点',
key: 'address'
}
]
},
{
title: '跟进信息',
objList: [
{
name: '回访状态',
key: 'followUpStatus'
},
{
name: '回访时间',
key: 'followUpTime'
},
{
name: '回访结果',
key: 'followUpResult'
}
]
}
]
export default {
name: 'leadManage',
......@@ -143,438 +143,500 @@ export default {
glsxCombiForm,
bigView
},
props:{
props: {
curCollId: String
},
data() {
return {
showMap: true,
previewFileVisible: false,
previewObj: {
previewFileUrl: '',
dialogType: 'video'
},
showFuncIntro: true,
recordVisible: false,
infoData,
detailDataObj: {},
recordRule: {
followResult: [{ required: true, message: '请选择跟进结果', trigger: 'change' }]
},
recordForm: {
followResult: '',
followRemark: ''
},
recordFormData: [
BMap: null,
showMap: true,
previewFileVisible: false,
previewObj: {
previewFileUrl: '',
dialogType: 'video'
},
showFuncIntro: true,
recordVisible: false,
infoData,
detailDataObj: {},
recordRule: {
followResult: [{ required: true, message: '请选择跟进结果', trigger: 'change' }]
},
recordForm: {
followResult: '',
followRemark: ''
},
recordFormData: [
{
label: '跟进结果',
name: 'followResult',
type: 'select',
optionLabel: 'label',
optionId: 'value',
optionList: [
{
label: '跟进结果',
name: 'followResult',
type: 'select',
optionLabel: 'label',
optionId: 'value',
optionList: [
{
label: '真实事故',
value: 0
},
{
label: '非真实事故',
value: 1
},
{
label: '无法处理',
value: 2
}
],
label: '真实事故',
value: 0
},
{
label: '备注',
name: 'followRemark',
type: 'input',
maxlength: 50,
showLimit: true,
inputType: 'textarea'
label: '非真实事故',
value: 1
},
{
label: '无法处理',
value: 2
}
],
]
},
{
label: '备注',
name: 'followRemark',
type: 'input',
maxlength: 50,
showLimit: true,
inputType: 'textarea'
}
]
}
},
created() {
},
created() {},
mounted() {
this.getDetail()
},
methods: {
previewFile(item) {
console.log(item)
this.previewFileVisible = true
this.previewObj = {
previewFileUrl: item.fileUrl,
dialogType: item.mediaType=="VIDEO" ? 'video' : 'img'
}
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){
const params = {
id: this.curCollId,
...this.recordForm
}
this.$apis.sendRepair.setFollowInfoApi(params).then(res => {
if(res){
this.$message({
type: 'success',
message: '操作成功',
customClass: 'customMessageClass'
})
// const { followResult, followRemark} = this.recordForm
// this.detailDataObj.followResult = followResult
// this.detailDataObj.followRemark = followRemark
this.getDetail()
this.resetRecordData()
}
})
this.$refs.recordRef.$refs.formRef.validate(valid => {
if (valid) {
const params = {
id: this.curCollId,
...this.recordForm
}
this.$apis.sendRepair.setFollowInfoApi(params).then(res => {
if (res) {
this.$message({
type: 'success',
message: '操作成功',
customClass: 'customMessageClass'
})
// const { followResult, followRemark} = this.recordForm
// this.detailDataObj.followResult = followResult
// this.detailDataObj.followRemark = followRemark
this.getDetail()
this.resetRecordData()
}
})
})
}
})
},
handleCancel() {
this.resetRecordData()
this.resetRecordData()
},
closeDialogFn() {
this.$emit('closeDialogFn')
},
closeDialogFn(){
this.$emit('closeDialogFn')
resetRecordData() {
this.recordVisible = false
this.recordForm = {
followResult: '',
followRemark: ''
}
},
resetRecordData(){
this.recordVisible = false
this.recordForm = {
followResult: '',
followRemark: ''
getDetail() {
this.$apis.sendRepair.getCollisionDetailApi({ id: this.curCollId }).then(res => {
if (res) {
console.log(res)
const result = FOLLOW_RESULT.find(item => item.value == res.followResult)
const status = FOLLOW_STATUS.find(item => item.value == res.followStatus)
res.followUpResult = result ? result.label : ''
res.followUpStatus = status ? status.label : ''
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)
const addr = [res.longitude ? +res.longitude : 0, res.latitude ? +res.latitude : 0]
this.handleData(res.carAddressList, res.collisionTime, addr)
}
})
},
getDetail(){
this.$apis.sendRepair.getCollisionDetailApi({id: this.curCollId}).then(res => {
if(res){
console.log(res)
const result = FOLLOW_RESULT.find(item => item.value==res.followResult)
const status = FOLLOW_STATUS.find(item => item.value==res.followStatus)
res.followUpResult = result ? result.label : ''
res.followUpStatus = status ? status.label : ''
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
const addr = [res.longitude? +res.longitude : 0, res.latitude? +res.latitude : 0]
this.handleData(res.carAddressList, res.collisionTime, addr)
}
})
openRecordDialog() {
this.recordForm = {
followResult: this.detailDataObj.followResult,
followRemark: this.detailDataObj.followRemark
}
this.recordVisible = true
},
openRecordDialog(){
this.recordForm = {
followResult: this.detailDataObj.followResult,
followRemark: this.detailDataObj.followRemark
handleData(list, collTime, addr) {
let xList = [],
yList = [],
lineList = [],
mapLnglatList = []
let startAddr = [],
pointAddr = [],
endAddr = []
const time = dayjs(collTime).format('HH:mm:ss')
list.forEach((ele, index) => {
// console.log(ele)
mapLnglatList.push(ele.lnglat)
if (index == 0 || index == list.length - 1) {
if (index == 0) startAddr = ele.lnglat
if (index != 0) endAddr = ele.lnglat
xList.push(`${ele.time}${index == 0 ? '起点' : '终点'}`)
} else {
if (ele.time == time) pointAddr = ele.lnglat
xList.push(ele.time == time ? ele.time + '碰撞点' : '')
}
this.recordVisible = true
},
handleData(list, collTime , addr){
let xList = [], yList = [], lineList = [], mapLnglatList=[];
let startAddr = [], pointAddr = [], endAddr = [];
const time = dayjs(collTime).format('HH:mm:ss')
list.forEach((ele,index) => {
mapLnglatList.push(ele.lnglat)
if(index==0 || index==list.length-1){
if(index==0) startAddr = ele.lnglat
if(index!=0) endAddr = ele.lnglat
xList.push(`${ele.time}${index==0 ? '起点' : '终点'}`)
}else{
if(ele.time==time) pointAddr = ele.lnglat
xList.push(ele.time==time ? ele.time + '碰撞点' : '')
}
yList.push(ele.sp)
});
const maxByList = Math.max.apply(null, yList);
const yMax = maxByList + (10-(maxByList%10!=0 ? maxByList%10 : 10))
xList.forEach(item => {
if(item){
const itemlist = [
{
lineStyle: {
type: 'solid',
color: '#e0e6f1'
},
coord: [item, 0]
},
{
coord: [item, yMax]
}
]
lineList.push(itemlist)
yList.push(ele.sp)
})
const maxByList = Math.max.apply(null, yList)
const yMax = maxByList + (10 - (maxByList % 10 != 0 ? maxByList % 10 : 10))
xList.forEach(item => {
if (item) {
const itemlist = [
{
lineStyle: {
type: 'solid',
color: '#e0e6f1'
},
coord: [item, 0]
},
{
coord: [item, yMax]
}
})
this.drawLine(xList, yList, lineList)
this.initMap(mapLnglatList, startAddr, addr, endAddr)
]
lineList.push(itemlist)
}
})
this.drawLine(xList, yList, lineList)
// this.initMap(mapLnglatList, startAddr, addr, endAddr)
this.initBMap(mapLnglatList, startAddr, addr, endAddr)
},
drawLine(xList, yList, lineList){
// 基于准备好的dom,初始化echarts实例
var myChart = echarts.init(document.getElementById('echarts'));
// 绘制图表
myChart.setOption({
tooltip: {
trigger: 'axis',
formatter: function(params) {
return (params[0]?.value || 0) + '(Km/h)'
}
},
grid: {
top: '3%',
left: '3%',
right: '8%',
bottom: '1%',
containLabel: true
},
xAxis: {
axisTick: {
show: false
}, // 隐藏 y 轴刻度线
type: 'category',
boundaryGap: false,
data: xList,
axisLine: {
lineStyle: {
color: '#e0e6f1' // 设置 x 轴的颜色为红色
}
drawLine(xList, yList, lineList) {
// 基于准备好的dom,初始化echarts实例
var myChart = echarts.init(document.getElementById('echarts'))
// 绘制图表
myChart.setOption({
tooltip: {
trigger: 'axis',
formatter: function (params) {
return (params[0]?.value || 0) + '(Km/h)'
}
},
grid: {
top: '3%',
left: '3%',
right: '8%',
bottom: '1%',
containLabel: true
},
xAxis: {
axisTick: {
show: false
}, // 隐藏 y 轴刻度线
type: 'category',
boundaryGap: false,
data: xList,
axisLine: {
lineStyle: {
color: '#e0e6f1' // 设置 x 轴的颜色为红色
}
},
axisLabel: {
interval: 0,
color: '#333333' // 让刻度标签的颜色自动适应主题
}
},
yAxis: {
type: 'value'
},
series: [
{
type: 'line',
smooth: true,
symbol: 'circle', // 将圆点改为点
stack: 'Total',
itemStyle: {
color: '#5850FF'
},
axisLabel: {
interval: 0,
color: '#333333' // 让刻度标签的颜色自动适应主题
lineStyle: {
color: '#5850FF', // 设置线条颜色
width: 1
},
areaStyle: {
// 使用 areaStyle 来设置渐变背景
color: new echarts.graphic.LinearGradient(0, 0, 0, 1, [
{
offset: 0,
color: 'rgba(88, 80, 255, 0.5)'
}, // 渐变起始颜色
{
offset: 1,
color: 'rgba(145, 136, 255, 0)'
} // 渐变结束颜色
])
},
yAxis: {
type: 'value'
markLine: {
name: 'cc',
symbol: 'none',
data: lineList
},
series: [{
type: 'line',
smooth: true,
symbol: 'circle', // 将圆点改为点
stack: 'Total',
itemStyle: {
color: '#5850FF',
},
lineStyle: {
color: '#5850FF', // 设置线条颜色
width: 1,
},
areaStyle: { // 使用 areaStyle 来设置渐变背景
color: new echarts.graphic.LinearGradient(0, 0, 0, 1, [{
offset: 0,
color: 'rgba(88, 80, 255, 0.5)'
}, // 渐变起始颜色
{
offset: 1,
color: 'rgba(145, 136, 255, 0)'
} // 渐变结束颜色
])
},
markLine: {
name: 'cc',
symbol: 'none',
data: lineList
},
data: yList
}]
});
data: yList
}
]
})
},
initMap(mapLnglatList, startAddr, pointAddr, endAddr) {
AMapLoader.load({
key: "44cc16e43ad7ed3358df507bd0618181", //此处填入我们注册账号后获取的Key
version: "2.0", //指定要加载的 JSAPI 的版本,缺省时默认为 1.4.15
plugins: ['AMap.Scale'], //需要使用的的插件列表,如比例尺'AMap.Scale'等
}).then((AMap) => {
var map = new AMap.Map('mapContainer', {
zoom: 12, // 初始缩放级别
center: startAddr // 初始地图中心点坐标
});
AMapLoader.load({
key: '44cc16e43ad7ed3358df507bd0618181', //此处填入我们注册账号后获取的Key
version: '2.0', //指定要加载的 JSAPI 的版本,缺省时默认为 1.4.15
plugins: ['AMap.Scale'] //需要使用的的插件列表,如比例尺'AMap.Scale'等
})
.then(AMap => {
var map = new AMap.Map('mapContainer', {
zoom: 12, // 初始缩放级别
center: startAddr // 初始地图中心点坐标
})
// 添加缩放控件
map.plugin(["AMap.ToolBar"], function() {
var toolbar = new AMap.ToolBar({
position: 'RT'
});
map.addControl(toolbar);
});
// 添加缩放控件
map.plugin(['AMap.ToolBar'], function () {
var toolbar = new AMap.ToolBar({
position: 'RT'
})
map.addControl(toolbar)
})
// 自定义起点图标
var startPointIcon = new AMap.Icon({
image: startUrl, // 替换成你的起点图标路径
size: new AMap.Size(36, 36)
});
// 自定义起点图标
var startPointIcon = new AMap.Icon({
image: startUrl, // 替换成你的起点图标路径
size: new AMap.Size(36, 36)
})
// 自定义终点图标
var endPointIcon = new AMap.Icon({
image: endUrl, // 替换成你的终点图标路径
size: new AMap.Size(36, 36)
});
// 自定义终点图标
var endPointIcon = new AMap.Icon({
image: endUrl, // 替换成你的终点图标路径
size: new AMap.Size(36, 36)
})
// 自定义碰撞位置图标
var collisionPointIcon = new AMap.Icon({
image: accidUrl, // 替换成你的碰撞位置图标路径
size: new AMap.Size(36, 36)
});
// 自定义碰撞位置图标
var collisionPointIcon = new AMap.Icon({
image: accidUrl, // 替换成你的碰撞位置图标路径
size: new AMap.Size(36, 36)
})
// 创建起点标记
var startPoint = new AMap.Marker({
position: startAddr,
icon: startPointIcon,
offset: new AMap.Pixel(-20, -35),
map: map
});
// 创建起点标记
var startPoint = new AMap.Marker({
position: startAddr,
icon: startPointIcon,
offset: new AMap.Pixel(-20, -35),
map: map
})
// 创建终点标记
var endPoint = new AMap.Marker({
position: endAddr,
icon: endPointIcon,
offset: new AMap.Pixel(-20, -35),
map: map
});
// 创建终点标记
var endPoint = new AMap.Marker({
position: endAddr,
icon: endPointIcon,
offset: new AMap.Pixel(-20, -35),
map: map
})
// 创建碰撞位置标记
var collisionPoint = new AMap.Marker({
position: pointAddr,
icon: collisionPointIcon,
offset: new AMap.Pixel(-20, -35),
map: map
});
// 创建碰撞位置标记
var collisionPoint = new AMap.Marker({
position: pointAddr,
icon: collisionPointIcon,
offset: new AMap.Pixel(-20, -35),
map: map
})
// 创建轨迹线
var polyline = new AMap.Polyline({
path: mapLnglatList,
strokeColor: "#3366FF",
strokeOpacity: 1.0,
strokeWeight: 5
});
polyline.setMap(map);
}).catch(e => {
console.log(e);
// 创建轨迹线
var polyline = new AMap.Polyline({
path: mapLnglatList,
strokeColor: '#3366FF',
strokeOpacity: 1.0,
strokeWeight: 5
})
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>
<style lang="scss" scoped>
.empty-wrap{
width: 100%;
height: 100%;
text-align: center;
.empty-img{
width: 64px;
height: 40px;
margin-bottom: 10px;
}
.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;
background: #E4E3FF;
border-radius: 4px;
width: 100%;
font-size: 14px;
box-sizing: border-box;
margin-bottom: 16px;
padding: 0 16px;
.tip-img{
height: 14px;
width: 14px;
vertical-align: middle;
margin-right: 8px;
}
.follow-up{
cursor: pointer;
color: #5850FF;
}
.head-tip {
height: 40px;
line-height: 40px;
background: #e4e3ff;
border-radius: 4px;
width: 100%;
font-size: 14px;
box-sizing: border-box;
margin-bottom: 16px;
padding: 0 16px;
.tip-img {
height: 14px;
width: 14px;
vertical-align: middle;
margin-right: 8px;
}
.follow-up {
cursor: pointer;
color: #5850ff;
}
}
.title{
display: inline-block;
height: 24px;
line-height: 24px;
font-family: PingFangSC-Medium;
font-weight: 600;
font-size: 16px;
color: #000000d9;
margin-bottom: 10px;
.title {
display: inline-block;
height: 24px;
line-height: 24px;
font-family: PingFangSC-Medium;
font-weight: 600;
font-size: 16px;
color: #000000d9;
margin-bottom: 10px;
}
.accident-wrap{
display: flex;
margin-bottom: 20px;
.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;
}
.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;
}
}
}
.accident-wrap {
display: flex;
margin-bottom: 20px;
.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;
}
.mask {
display: none;
}
}
.media-item:hover {
.mask {
position: absolute;
left: 0;
right: 0;
top: 0;
bottom: 0;
background: rgba(0, 0, 0, 0.3);
border-radius: 4px;
display: flex;
align-items: center;
justify-content: center;
.preview {
height: 20px;
width: 20px;
cursor: pointer;
}
}
}
}
}
}
.record-form{
/deep/ .el-textarea__inner{
height: 75px;
}
.record-form {
/deep/ .el-textarea__inner {
height: 75px;
}
}
.obj-item{
.obj-item {
display: inline-block;
margin-bottom: 20px;
.label {
display: inline-block;
margin-bottom: 20px;
.label{
display: inline-block;
text-align: right;
width: 154px;
line-height: 20px;
color: #666666;
}
.value{
display: inline-block;
min-width: 230px;
color: #333;
}
text-align: right;
width: 154px;
line-height: 20px;
color: #666666;
}
.value {
display: inline-block;
min-width: 230px;
color: #333;
}
}
.eChart-box{
width: 100%;
height: 187px;
.eChart-box {
width: 100%;
height: 187px;
}
#mapContainer {
width: 100%;
height: 275px;
width: 100%;
height: 275px;
}
</style>
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!