|
|
@@ -1,96 +1,89 @@
|
|
|
<template>
|
|
|
- <div class="p-2">
|
|
|
- <transition :enter-active-class="proxy?.animate.searchAnimate.enter" :leave-active-class="proxy?.animate.searchAnimate.leave">
|
|
|
- <div class="search" v-show="showSearch" style="display: flex;flex-direction: row;">
|
|
|
- <div style="width: 85%;">
|
|
|
- <el-form :model="queryParams" ref="queryFormRef" :inline="true" label-width="68px">
|
|
|
- <el-form-item label="车牌" prop="carNum">
|
|
|
- <el-input v-model="queryParams.carNum" placeholder="请输入车牌号" clearable style="width: 160px" @keyup.enter="handleQuery" />
|
|
|
- </el-form-item>
|
|
|
- <el-form-item label="状态" prop="carNum">
|
|
|
- <el-input v-model="queryParams.carNum" placeholder="请输入车牌号" clearable style="width: 160px" @keyup.enter="handleQuery" />
|
|
|
- </el-form-item>
|
|
|
- <el-form-item label="站点" prop="carNum">
|
|
|
- <el-input v-model="queryParams.carNum" placeholder="请输入车牌号" clearable style="width: 160px" @keyup.enter="handleQuery" />
|
|
|
- </el-form-item>
|
|
|
- <el-form-item label="司机" prop="carNum">
|
|
|
- <el-input v-model="queryParams.carNum" placeholder="请输入车牌号" clearable style="width: 160px" @keyup.enter="handleQuery" />
|
|
|
- </el-form-item>
|
|
|
- <el-form-item label="时间" prop="carNum">
|
|
|
- <el-date-picker
|
|
|
- v-model="value2"
|
|
|
- type="datetimerange"
|
|
|
- :shortcuts="shortcuts"
|
|
|
- range-separator="至"
|
|
|
- start-placeholder="开始时间"
|
|
|
- end-placeholder="结束时间"
|
|
|
- />
|
|
|
- </el-form-item>
|
|
|
- </el-form>
|
|
|
- </div>
|
|
|
- <div style="width: 15%;">
|
|
|
- <el-form-item>
|
|
|
- <el-button type="primary" @click="goadd">新增</el-button>
|
|
|
- <el-button type="primary" @click="resetQuery">查询</el-button>
|
|
|
- </el-form-item>
|
|
|
+ <div class="p-2">
|
|
|
+ <transition :enter-active-class="proxy?.animate.searchAnimate.enter"
|
|
|
+ :leave-active-class="proxy?.animate.searchAnimate.leave">
|
|
|
+ <div class="search" v-show="showSearch" style="display: flex;flex-direction: row;">
|
|
|
+ <div style="width: 85%;">
|
|
|
+ <el-form :model="queryParams" ref="queryFormRef" :inline="true" label-width="68px">
|
|
|
+ <el-form-item label="车牌" prop="carNum">
|
|
|
+ <el-input v-model="queryParams.carNum" placeholder="请输入车牌号" clearable style="width: 160px"
|
|
|
+ @keyup.enter="handleQuery" />
|
|
|
+ </el-form-item>
|
|
|
+ <el-form-item label="状态" prop="carNum">
|
|
|
+ <el-input v-model="queryParams.carNum" placeholder="请输入车牌号" clearable style="width: 160px"
|
|
|
+ @keyup.enter="handleQuery" />
|
|
|
+ </el-form-item>
|
|
|
+ <el-form-item label="站点" prop="carNum">
|
|
|
+ <el-input v-model="queryParams.carNum" placeholder="请输入车牌号" clearable style="width: 160px"
|
|
|
+ @keyup.enter="handleQuery" />
|
|
|
+ </el-form-item>
|
|
|
+ <el-form-item label="司机" prop="carNum">
|
|
|
+ <el-input v-model="queryParams.carNum" placeholder="请输入车牌号" clearable style="width: 160px"
|
|
|
+ @keyup.enter="handleQuery" />
|
|
|
+ </el-form-item>
|
|
|
+ <el-form-item label="时间" prop="carNum">
|
|
|
+ <el-date-picker v-model="value2" type="datetimerange" :shortcuts="shortcuts"
|
|
|
+ range-separator="至" start-placeholder="开始时间" end-placeholder="结束时间" />
|
|
|
+ </el-form-item>
|
|
|
+ </el-form>
|
|
|
+ </div>
|
|
|
+ <div style="width: 15%;">
|
|
|
+ <el-form-item>
|
|
|
+ <el-button type="primary" @click="goadd">新增</el-button>
|
|
|
+ <el-button type="primary" @click="resetQuery">查询</el-button>
|
|
|
+ </el-form-item>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ </transition>
|
|
|
+ <div style="text-align: center;margin-bottom:10px">
|
|
|
+ <el-tag type="success" effect="dark" round>正常作业</el-tag>
|
|
|
+ <el-tag style="margin-left: 40px;" type="danger" effect="dark" round>异常作业</el-tag>
|
|
|
</div>
|
|
|
- </div>
|
|
|
- </transition>
|
|
|
- <div style="text-align: center;margin-bottom:10px">
|
|
|
- <el-tag type="success" effect="dark" round>正常作业</el-tag>
|
|
|
- <el-tag style="margin-left: 40px;" type="danger" effect="dark" round>异常作业</el-tag>
|
|
|
- </div>
|
|
|
|
|
|
- <div v-for="(item, index) in carScheduleList">
|
|
|
- <el-card shadow="never">
|
|
|
- <div class="carDiv" style="position: relative;">
|
|
|
- <div
|
|
|
- style="width: 18%;background: #7BC932;text-align: center;display: flex;flex-direction: column;justify-content: center;align-items:center;"
|
|
|
- >
|
|
|
- <div class="carDetail">{{ item.carNum }}</div>
|
|
|
- <div class="carFont" style="font-size: 12px;">{{ getTimeFormat(item.pathInfo) }}</div>
|
|
|
- <div class="carFont" style="font-size: 12px;margin-top:8px;">{{ getAddr(item.pathInfo) }}</div>
|
|
|
- <!-- <div class="carFont">{{ JSON.parse(item.pathInfo).driver_info.nickName }}</div> -->
|
|
|
- <div class="carFont" style="font-size: 12px;margin-top:8px;color:rgba(255,255,255,0.9)">
|
|
|
- 司机:{{ getUserName(JSON.parse(item.pathInfo).driverInfo) }}
|
|
|
- </div>
|
|
|
- <div class="carFont" style="font-size: 12px;margin-top:8px">{{ getCatInfo(item.carNum) }}</div>
|
|
|
- </div>
|
|
|
- <div style="width: 80%;">
|
|
|
- <el-scrollbar ref="scrollbarRef" height="400px" always @scroll="scroll">
|
|
|
- <timeLineDiv :list="JSON.parse(item.pathInfo).pathLine" :stationInfo="JSON.parse(item.stationInfo)"></timeLineDiv>
|
|
|
- </el-scrollbar>
|
|
|
- </div>
|
|
|
- <div style="position:absolute;top:10px;right:6px">
|
|
|
- <div style="width: 30px;height: 30px; cursor: pointer;" @click="dialogMap.visible = true">
|
|
|
- <img style="width: 28px;height: 28px;" src="@/assets/images/icon/map1.png" />
|
|
|
- </div>
|
|
|
- <div style="width: 30px;height: 20px; cursor: pointer;" @click="dialog.visible = true">
|
|
|
- <img style="width: 28px;height: 28px;" src="@/assets/images/icon/cam.png" />
|
|
|
- </div>
|
|
|
- </div>
|
|
|
- <div style="position:absolute;bottom:10px;right:6px;font-size:10px">
|
|
|
- <span>乘客:11人 </span> <span style="margin-left: 10px;">货物:11个</span>
|
|
|
- </div>
|
|
|
+ <div v-for="(item, index) in carScheduleList">
|
|
|
+ <el-card shadow="never">
|
|
|
+ <div class="carDiv" style="position: relative;">
|
|
|
+ <div
|
|
|
+ style="width: 18%;background: #7BC932;text-align: center;display: flex;flex-direction: column;justify-content: center;align-items:center;">
|
|
|
+ <div class="carDetail">{{ item.carNum }}</div>
|
|
|
+ <div class="carFont" style="font-size: 12px;">{{ getTimeFormat(item.pathInfo) }}</div>
|
|
|
+ <div class="carFont" style="font-size: 12px;margin-top:8px;">{{ getAddr(item.pathInfo) }}</div>
|
|
|
+ <!-- <div class="carFont">{{ JSON.parse(item.pathInfo).driver_info.nickName }}</div> -->
|
|
|
+ <div class="carFont" style="font-size: 12px;margin-top:8px;color:rgba(255,255,255,0.9)">
|
|
|
+ 司机:{{ getUserName(JSON.parse(item.pathInfo).driverInfo) }}
|
|
|
+ </div>
|
|
|
+ <div class="carFont" style="font-size: 12px;margin-top:8px">{{ getCatInfo(item.carNum) }}</div>
|
|
|
+ </div>
|
|
|
+ <div style="width: 80%;">
|
|
|
+ <el-scrollbar ref="scrollbarRef" height="400px" always @scroll="scroll">
|
|
|
+ <timeLineDiv :list="JSON.parse(item.pathInfo).pathLine"
|
|
|
+ :stationInfo="JSON.parse(item.stationInfo)"></timeLineDiv>
|
|
|
+ </el-scrollbar>
|
|
|
+ </div>
|
|
|
+ <div style="position:absolute;top:10px;right:6px">
|
|
|
+ <div style="width: 30px;height: 30px; cursor: pointer;" @click="openMapDiv(item)">
|
|
|
+ <img style="width: 28px;height: 28px;" src="@/assets/images/icon/map1.png" />
|
|
|
+ </div>
|
|
|
+ <div style="width: 30px;height: 20px; cursor: pointer;" @click="dialog.visible = true">
|
|
|
+ <img style="width: 28px;height: 28px;" src="@/assets/images/icon/cam.png" />
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ <div style="position:absolute;bottom:10px;right:6px;font-size:10px">
|
|
|
+ <span>乘客:11人 </span> <span style="margin-left: 10px;">货物:11个</span>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ </el-card>
|
|
|
</div>
|
|
|
- </el-card>
|
|
|
- </div>
|
|
|
|
|
|
- <el-dialog :title="dialogMap.title" v-model="dialogMap.visible" width="40vw" append-to-body>
|
|
|
- <mapDiv style="width:40vw;height:40vh;"></mapDiv>
|
|
|
- </el-dialog>
|
|
|
-
|
|
|
- <el-dialog :title="dialog.title" v-model="dialog.visible" width="40vw" append-to-body>
|
|
|
- <video
|
|
|
- v-for="item in 1"
|
|
|
- style="width: 99%;margin-left:0.5%"
|
|
|
- controls="controls"
|
|
|
- :autoplay="false"
|
|
|
- muted="muted"
|
|
|
- :ref="`videoref${item}`"
|
|
|
- ></video>
|
|
|
- </el-dialog>
|
|
|
- </div>
|
|
|
+ <el-dialog :title="dialogMap.title" v-model="dialogMap.visible" width="40vw" append-to-body>
|
|
|
+ <mapDiv style="width:40vw;height:40vh;" ref="mapElm"></mapDiv>
|
|
|
+ </el-dialog>
|
|
|
+
|
|
|
+ <el-dialog :title="dialog.title" v-model="dialog.visible" width="40vw" append-to-body>
|
|
|
+ <video v-for="item in 1" style="width: 99%;margin-left:0.5%" controls="controls" :autoplay="false"
|
|
|
+ muted="muted" :ref="`videoref${item}`"></video>
|
|
|
+ </el-dialog>
|
|
|
+ </div>
|
|
|
</template>
|
|
|
|
|
|
<script setup name="CarInfo" lang="ts">
|
|
|
@@ -144,7 +137,7 @@ const dialog = reactive<DialogOption>({
|
|
|
title: '在线视频'
|
|
|
});
|
|
|
|
|
|
-const table = ref(tableElm)
|
|
|
+const mapElm = ref(mapDiv)
|
|
|
|
|
|
const columns = ref([
|
|
|
// {label: '上层位置', prop: 'v', visible: true},
|
|
|
@@ -258,12 +251,11 @@ const getScheduleList = async () => {
|
|
|
}
|
|
|
const res = await listCarSchedule(param);
|
|
|
carScheduleList.value = res.rows;
|
|
|
- console.log(carScheduleList.value)
|
|
|
}
|
|
|
|
|
|
const getTimeFormat = (data) => {
|
|
|
var value = JSON.parse(data).pathLine
|
|
|
- console.log(value)
|
|
|
+ console.log(JSON.parse(data))
|
|
|
if (value[0].planInTime && value[value.length - 1].planOutTime) {
|
|
|
return value[0].planInTime + '-' + value[value.length - 1].planOutTime
|
|
|
} else {
|
|
|
@@ -296,9 +288,7 @@ const cancel = () => {
|
|
|
|
|
|
const getUserList = () => {
|
|
|
api.listUser({ pageSize: 1000 }).then(res => {
|
|
|
- console.log(res.rows)
|
|
|
userList.value = res.rows;
|
|
|
- console.log(userList.value)
|
|
|
});
|
|
|
}
|
|
|
|
|
|
@@ -322,6 +312,36 @@ const handleQuery = () => {
|
|
|
getList();
|
|
|
}
|
|
|
|
|
|
+const openMapDiv = (data) => {
|
|
|
+ dialogMap.visible = true;
|
|
|
+ const info = getCatInfoData(data.carNum);
|
|
|
+ console.log(info)
|
|
|
+ var deviceInfo = JSON.parse(info.deviceInfos)
|
|
|
+ console.log(deviceInfo)
|
|
|
+ var code = '';
|
|
|
+ for (var index in deviceInfo) {
|
|
|
+ if (deviceInfo[index].type == 'gps') {
|
|
|
+ code = deviceInfo[index].code
|
|
|
+ }
|
|
|
+ }
|
|
|
+ var value = JSON.parse(data.pathInfo).pathLine
|
|
|
+ var date = moment(new Date()).format('YYYY-MM-DD')
|
|
|
+ if (value[0].planInTime && value[value.length - 1].planOutTime) {
|
|
|
+ var param = {
|
|
|
+ devicecode: code,
|
|
|
+ params: {
|
|
|
+ starttime: date + ' ' + value[0].planInTime,
|
|
|
+ endtime: date + ' ' + value[value.length - 1].planOutTime,
|
|
|
+ }
|
|
|
+ }
|
|
|
+ // console.log(mapElm.value);
|
|
|
+ // mapElm.value.getGpsDataList(param);
|
|
|
+ setTimeout(() => {
|
|
|
+ mapElm.value.getGpsDataList(param);
|
|
|
+ }, 1000);
|
|
|
+ }
|
|
|
+}
|
|
|
+
|
|
|
/** 重置按钮操作 */
|
|
|
const resetQuery = () => {
|
|
|
queryFormRef.value?.resetFields();
|
|
|
@@ -404,18 +424,22 @@ const getDictLabel = (value, list) => {
|
|
|
}
|
|
|
|
|
|
const getCatInfo = (value) => {
|
|
|
- console.log(value)
|
|
|
- console.log(carInfoList.value);
|
|
|
for (var index in carInfoList.value) {
|
|
|
- console.log(carInfoList.value[index].carNum)
|
|
|
if (carInfoList.value[index].carNum == value) {
|
|
|
- console.log(carInfoList.value[index]);
|
|
|
var data = JSON.parse(carInfoList.value[index].ext1)
|
|
|
return getDictLabel(data.energyType, energyTypeList).replaceAll("车", "") + getDictLabel(data.bussinessType, bussinessTypeList)
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
|
|
|
+const getCatInfoData = (value) => {
|
|
|
+ for (var index in carInfoList.value) {
|
|
|
+ if (carInfoList.value[index].carNum == value) {
|
|
|
+ return carInfoList.value[index]
|
|
|
+ }
|
|
|
+ }
|
|
|
+}
|
|
|
+
|
|
|
onMounted(() => {
|
|
|
initData();
|
|
|
});
|