Commit 057c9cad authored by 小费同学阿's avatar 小费同学阿 💬

定位修改

parent 81aa115c
......@@ -27,7 +27,8 @@ border: 1px solid #CCCCCC;border-radius:0.3rem;padding: 0.25rem 1rem 0.25rem 1re
:position="markInfo.position">
<div style="margin:0rem 0.5rem 1rem 0.5rem; display: flex;flex-direction: column;">
<span>{{ markInfo.roadName }} </span>
<span> 路况分类: <span v-if="markInfo.type=='101'||markInfo.type=='102'||markInfo.type=='103'||markInfo.type=='104'">事件</span>
<span> 路况分类: <span
v-if="markInfo.type=='101'||markInfo.type=='102'||markInfo.type=='103'||markInfo.type=='104'">事件</span>
<span v-if="markInfo.type=='105'||markInfo.type=='106'">阻断</span>
<span v-if="markInfo.type=='107'||markInfo.type=='108'">管制 </span> </span>
<span> 路况分类: {{ markInfo.typeName }} </span>
......@@ -315,7 +316,7 @@ border-radius: 4px;color:#ffffff;padding:0.5rem;cursor:pointer;display: flex;ali
</div>
<div>
<span style="font-size: 1rem;font-weight: 400;color: #676A6C;">
{{ item.starttime }}
{{ moment(item.starttime * 1000).format('YYYY-MM-DD HH:mm:ss') }}
</span>
</div>
</div>
......@@ -364,6 +365,7 @@ import {
import _ from "lodash";
import {routerMessage} from "@/api/baidu-traffic";
import NavList from "@/views/Home/components/NavList/index.vue";
import moment from 'moment'
export default {
name: 'mobilityServices',
......@@ -423,7 +425,7 @@ export default {
{
cityCode: "332",
cityName: "天津",
content: "12:01,第一大街存在积水,请途经此处的驾驶员注意提前绕行。",
content: "16:27,新港二号路车流量大,请途径此处的驾驶员注意提前绕行。",
directionName: "西向东",
id: "1782500570450432",
lane: "",
......@@ -431,17 +433,17 @@ export default {
pile: "",
provinceCode: "332",
provinceName: "天津",
roadName: "第九大街",
roadName: "新港二号路",
roadType: "3",
semantic: "滨海建投集团(天津高速公路投资发展有限公司)北374米",
starttime: "1699925012",
starttime: "1700036828",
type: "101",
typeName: "拥堵"
},
{
cityCode: "332",
cityName: "天津",
content: "12:01,第一大街存在积水,请途经此处的驾驶员注意提前绕行。",
content: "15:20,北海路有故障车,请途经此处的驾驶员注意提前绕行。",
directionName: "西向东",
id: "1782500570450432",
lane: "",
......@@ -449,17 +451,17 @@ export default {
pile: "",
provinceCode: "332",
provinceName: "天津",
roadName: "第八大街",
roadName: "北海路",
roadType: "3",
semantic: "滨海建投集团(天津高速公路投资发展有限公司)北374米",
starttime: "1699925012",
starttime: "1700032842",
type: "101",
typeName: "拥堵"
},
{
cityCode: "332",
cityName: "天津",
content: "12:01,第一大街存在积水,请途经此处的驾驶员注意提前绕行。",
content: "12:01,大连东路存在积雪,请途经此处的驾驶员注意提前绕行。",
directionName: "西向东",
id: "1782500570450432",
lane: "",
......@@ -467,10 +469,10 @@ export default {
pile: "",
provinceCode: "332",
provinceName: "天津",
roadName: "第九大街",
roadName: "大连东路",
roadType: "3",
semantic: "滨海建投集团(天津高速公路投资发展有限公司)北374米",
starttime: "1699925012",
starttime: "1700032845",
type: "102",
typeName: "交通事故"
},
......@@ -485,17 +487,17 @@ export default {
pile: "",
provinceCode: "332",
provinceName: "天津",
roadName: "第大街",
roadName: "第大街",
roadType: "3",
semantic: "滨海建投集团(天津高速公路投资发展有限公司)北374米",
starttime: "1699925012",
starttime: "1699934467",
type: "101",
typeName: "拥堵"
},
{
cityCode: "332",
cityName: "天津",
content: "",
content: "18:12,新港三号路正在施工,请途经此处的驾驶员注意提前绕行。",
directionName: "西向东",
id: "1782500570450432",
lane: "",
......@@ -503,10 +505,10 @@ export default {
pile: "",
provinceCode: "332",
provinceName: "天津",
roadName: "第一大街",
roadName: "新港三号路",
roadType: "3",
semantic: "滨海建投集团(天津高速公路投资发展有限公司)北374米",
starttime: "1699925012",
starttime: "1699956729",
type: "101",
typeName: "拥堵"
},
......@@ -524,7 +526,7 @@ export default {
roadName: "第五大街",
roadType: "3",
semantic: "滨海泰达航母公园直行100米",
starttime: "1699925012",
starttime: "1699921012",
type: "101",
typeName: "拥堵"
},
......@@ -542,7 +544,7 @@ export default {
roadName: "第九大街",
roadType: "3",
semantic: "滨海建投集团(天津高速公路投资发展有限公司)北374米",
starttime: "1699925012",
starttime: "1699920012",
type: "101",
typeName: "拥堵"
},
......@@ -560,7 +562,7 @@ export default {
roadName: "第九大街",
roadType: "3",
semantic: "滨海建投集团(天津高速公路投资发展有限公司)北374米",
starttime: "1699925012",
starttime: "1699425012",
type: "108",
typeName: "积雪"
},
......@@ -578,7 +580,7 @@ export default {
roadName: "第九大街",
roadType: "3",
semantic: "滨海建投集团(天津高速公路投资发展有限公司)北374米",
starttime: "1699925012",
starttime: "1690925012",
type: "107",
typeName: "车祸"
},
......@@ -596,7 +598,7 @@ export default {
roadName: "第九大街",
roadType: "3",
semantic: "滨海建投集团(天津高速公路投资发展有限公司)北374米",
starttime: "1699925012",
starttime: "1693925012",
type: "105",
typeName: "施工"
},
......@@ -713,6 +715,7 @@ export default {
}
},
methods: {
moment,
/*转换查询*/
swapValues() {
const tempOption = this.navigator.formControl.start.options
......@@ -844,25 +847,7 @@ export default {
})
this.numberCheck++
}
/*做判断-是否为初始查询状态*/
if (type != 1) {
// 遍历 AllLocationList 中的每个对象
this.AllLocationList.forEach(item => {
// 打印转换后的 startTime 值
console.log('初始时间:', item.starttime);
// 将 startTime 属性的值转换为可读的日期格式
const timestamp = item.starttime; // 假设 starttime 是一个时间戳
const date = new Date(timestamp * 1000); // 使用时间戳创建一个 Date 对象,乘以1000以转换为正确的格式
// 格式化日期
const formattedDate = `${date.getFullYear()}/${(date.getMonth() + 1).toString().padStart(2, '0')}/${date.getDate().toString().padStart(2, '0')}\n${date.getHours().toString().padStart(2, '0')}:${date.getMinutes().toString().padStart(2, '0')}:${date.getSeconds().toString().padStart(2, '0')}`;
console.log('转换后的时间:', formattedDate); // 打印转换后的时间
// 将格式化后的日期赋值回 starttime 属性
item.starttime = formattedDate;
});
}
this.AllLocationList.sort((a, b) => b.starttime - a.starttime)
console.log("最终过滤完的精品表单", this.AllLocationList);
// 清空之前的 markers
this.markers = [];
......
......@@ -315,7 +315,7 @@ border-radius: 4px;color:#ffffff;padding:0.5rem;cursor:pointer;display: flex;ali
</div>
<div>
<span style="font-size: 1rem;font-weight: 400;color: #676A6C;">
{{ item.starttime }}
{{ moment(item.starttime * 1000).format('YYYY-MM-DD HH:mm:ss') }}
</span>
</div>
</div>
......@@ -364,6 +364,7 @@ import {
import _ from "lodash";
import {routerMessage} from "@/api/baidu-traffic";
import NavList from "@/views/Home/components/NavList/index.vue";
import moment from "moment";
export default {
name: 'routerCondition',
......@@ -435,7 +436,7 @@ export default {
{
cityCode: "332",
cityName: "天津",
content: "12:01,第一大街存在积水,请途经此处的驾驶员注意提前绕行。",
content: "16:27,新港二号路车流量大,请途径此处的驾驶员注意提前绕行。",
directionName: "西向东",
id: "1782500570450432",
lane: "",
......@@ -443,17 +444,17 @@ export default {
pile: "",
provinceCode: "332",
provinceName: "天津",
roadName: "第九大街",
roadName: "新港二号路",
roadType: "3",
semantic: "滨海建投集团(天津高速公路投资发展有限公司)北374米",
starttime: "1699925012",
starttime: "1700036828",
type: "101",
typeName: "拥堵"
},
{
cityCode: "332",
cityName: "天津",
content: "12:01,第一大街存在积水,请途经此处的驾驶员注意提前绕行。",
content: "15:20,北海路有故障车,请途经此处的驾驶员注意提前绕行。",
directionName: "西向东",
id: "1782500570450432",
lane: "",
......@@ -461,17 +462,17 @@ export default {
pile: "",
provinceCode: "332",
provinceName: "天津",
roadName: "第八大街",
roadName: "北海路",
roadType: "3",
semantic: "滨海建投集团(天津高速公路投资发展有限公司)北374米",
starttime: "1699925012",
starttime: "1700032842",
type: "101",
typeName: "拥堵"
},
{
cityCode: "332",
cityName: "天津",
content: "12:01,第一大街存在积水,请途经此处的驾驶员注意提前绕行。",
content: "12:01,大连东路存在积雪,请途经此处的驾驶员注意提前绕行。",
directionName: "西向东",
id: "1782500570450432",
lane: "",
......@@ -479,10 +480,10 @@ export default {
pile: "",
provinceCode: "332",
provinceName: "天津",
roadName: "第九大街",
roadName: "大连东路",
roadType: "3",
semantic: "滨海建投集团(天津高速公路投资发展有限公司)北374米",
starttime: "1699925012",
starttime: "1700032845",
type: "102",
typeName: "交通事故"
},
......@@ -497,17 +498,17 @@ export default {
pile: "",
provinceCode: "332",
provinceName: "天津",
roadName: "第大街",
roadName: "第大街",
roadType: "3",
semantic: "滨海建投集团(天津高速公路投资发展有限公司)北374米",
starttime: "1699925012",
starttime: "1699934467",
type: "101",
typeName: "拥堵"
},
{
cityCode: "332",
cityName: "天津",
content: "",
content: "18:12,新港三号路正在施工,请途经此处的驾驶员注意提前绕行。",
directionName: "西向东",
id: "1782500570450432",
lane: "",
......@@ -515,10 +516,10 @@ export default {
pile: "",
provinceCode: "332",
provinceName: "天津",
roadName: "第一大街",
roadName: "新港三号路",
roadType: "3",
semantic: "滨海建投集团(天津高速公路投资发展有限公司)北374米",
starttime: "1699925012",
starttime: "1699956729",
type: "101",
typeName: "拥堵"
},
......@@ -536,7 +537,7 @@ export default {
roadName: "第五大街",
roadType: "3",
semantic: "滨海泰达航母公园直行100米",
starttime: "1699925012",
starttime: "1699921012",
type: "101",
typeName: "拥堵"
},
......@@ -554,7 +555,7 @@ export default {
roadName: "第九大街",
roadType: "3",
semantic: "滨海建投集团(天津高速公路投资发展有限公司)北374米",
starttime: "1699925012",
starttime: "1699920012",
type: "101",
typeName: "拥堵"
},
......@@ -572,7 +573,7 @@ export default {
roadName: "第九大街",
roadType: "3",
semantic: "滨海建投集团(天津高速公路投资发展有限公司)北374米",
starttime: "1699925012",
starttime: "1699425012",
type: "108",
typeName: "积雪"
},
......@@ -590,7 +591,7 @@ export default {
roadName: "第九大街",
roadType: "3",
semantic: "滨海建投集团(天津高速公路投资发展有限公司)北374米",
starttime: "1699925012",
starttime: "1690925012",
type: "107",
typeName: "车祸"
},
......@@ -608,7 +609,7 @@ export default {
roadName: "第九大街",
roadType: "3",
semantic: "滨海建投集团(天津高速公路投资发展有限公司)北374米",
starttime: "1699925012",
starttime: "1693925012",
type: "105",
typeName: "施工"
},
......@@ -725,6 +726,7 @@ export default {
}
},
methods: {
moment,
/*转换查询*/
swapValues() {
const tempOption = this.navigator.formControl.start.options
......@@ -855,9 +857,9 @@ export default {
})
this.numberCheck++
}
this.AllLocationList.sort((a, b) => b.starttime - a.starttime)
/*做判断-是否为初始查询状态*/
if (type != 1) {
// 遍历 AllLocationList 中的每个对象
this.AllLocationList.forEach(item => {
// 打印转换后的 startTime 值
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment