Commit 4e1bc022 by 前端

Merge branch 'v1.23.0' into 'master'

V1.23.0版本需求已上线,合并代码到master

See merge request !8
2 parents cdd08f8b 7540d033
......@@ -44,3 +44,8 @@ export const ADD_FENCE = (params) => {
export const CHECK_SHARE = (params) => {
return request(params, `${prefix}/vehicle/sharedDetails`);
};
// 大数据设备信息查询
export const GET_VEHICLE_INFO = (params) => {
return request(params, `/devicemonitor/api/track/getDeviceInformationBySn`);
};
.page_box {
display: flex;
flex-direction: column;
background: #F5F6F7;
height: 100vh;
overflow: hidden;
}
// 顶部菜单栏
.top_menu {
position: relative;
display: flex;
align-items: center;
justify-content: center;
height: 44px;
background: #fff;
.cell {
position: relative;
flex: 1;
text-align: center;
height: 44px;
line-height: 44px;
font-family: PingFangSC-Regular;
font-weight: 400;
font-size: 14px;
color: #6c737a;
}
.cell_active {
font-weight: 500;
color: #111111;
}
.cell_active:after {
display: block;
content: "";
position: absolute;
width: 28px;
height: 3px;
background: #0077ff;
border-radius: 1px;
left: 50%;
bottom: 0;
transform: translateX(-50%);
}
}
.top_menu:after {
display: block;
content: "";
position: absolute;
left: 0;
right: 0;
bottom: 0;
height: 1px;
background: #f2f2f2;
}
// 顶部搜索框
.search_box {
padding: 6px 12px;
height: 56px;
box-sizing: border-box;
display: flex;
align-items: center;
background: #fff;
.input_box {
flex: 1;
height: 44px;
background: #F5F6F7;
border-radius: 6px;
display: flex;
align-items: center;
padding: 12px;
box-sizing: border-box;
.img {
width: 20px;
height: 20px;
margin-right: 8px;
}
.close {
width: 20px;
height: 20px;
}
.a_input {
flex: 1;
height: 100%;
background: #F5F6F7;
border: 0;
font-family: PingFangSC-Regular;
font-weight: 400;
font-size: 14px;
}
}
.btn {
width: 60px;
background: #0077FF;
border-radius: 4px;
font-family: PingFangSC-Regular;
font-weight: 400;
font-size: 14px;
color: #FFFFFF;
margin-left: 8px;
}
}
.search_title {
background: #fff;
padding: 10px 20px;
font-family: PingFangSC-Medium;
font-weight: 500;
font-size: 14px;
color: #111111;
}
.result_list {
flex: 1;
overflow-y: auto;
}
.result_box {
position: relative;
padding: 8px 12px 6px 36px;
.result {
min-height: 148px;
background: #FFFFFF;
border-radius: 8px;
padding: 0 16px;
box-sizing: border-box;
.head {
position: relative;
display: flex;
align-items: center;
justify-content: space-between;
padding: 10px 0;
.name {
font-family: PingFangSC-Medium;
font-weight: 500;
font-size: 14px;
color: #111111;
}
.icon {
width: 16px;
height: 16px;
}
}
.head:after {
display: block;
content: "";
height: 1px;
background: #F5F6F7;
position: absolute;
left: 0;
right: 0;
bottom: 0;
}
.cell_list {
position: relative;
padding: 0 0 10px 0;
.cell {
display: flex;
margin: 8px 0;
.name {
flex-shrink: 0;
width: 50px;
font-family: PingFangSC-Regular;
font-weight: 400;
font-size: 12px;
color: #9FA6AD;
line-height: 16px;
}
.txt {
font-family: PingFangSC-Regular;
font-weight: 400;
font-size: 12px;
color: #111111;
line-height: 16px;
margin-left: 16px;
}
}
}
.cell_list:after {
display: block;
content: "";
height: 1px;
position: absolute;
left: 0;
right: 0;
bottom: 0;
background: #F5F6F7;
}
.cell_list:last-child:after {
display: none;
}
}
}
.result_box:first-child:after {
top: 22px;
}
.result_box:after {
display: block;
content: "";
position: absolute;
left: 17px;
top: 0px;
bottom: 0;
width: 1px;
background: #000000;
opacity: 0.1;
z-index: 1;
}
.result_box:last-child:after {
height: 20px;
bottom: auto;
}
.result_box:before {
position: absolute;
display: block;
content: "";
width: 12px;
height: 12px;
background: #F5F6F7;
border: 3px solid #0077FF;
border-radius: 100%;
left: 12px;
top: 14px;
box-sizing: border-box;
z-index: 2;
}
.cred {
color: #f00 !important;
}
\ No newline at end of file
.page_box {
display: flex;
flex-direction: column;
background: #F5F6F7;
height: 100vh;
padding: 24px 20px;
overflow-y: auto;
}
// 顶部菜单栏
.top_menu {
position: relative;
display: flex;
align-items: center;
height: 44px;
background: #fff;
padding: 0 10px;
.cell {
position: relative;
text-align: center;
height: 44px;
line-height: 44px;
padding: 0 10px;
font-family: PingFangSC-Regular;
font-weight: 400;
font-size: 14px;
color: #6c737a;
cursor: pointer;
}
.cell_active {
font-weight: 500;
color: #0077FF;
}
.cell_active:after {
display: block;
content: "";
position: absolute;
width: 28px;
height: 3px;
background: #0077ff;
border-radius: 1px;
left: 50%;
bottom: 0;
transform: translateX(-50%);
}
}
.top_menu:after {
display: block;
content: "";
position: absolute;
left: 0;
right: 0;
bottom: 0;
height: 1px;
background: #f2f2f2;
}
// 顶部搜索框
.search_box {
padding: 0px 20px 20px 20px;
// height: 56px;
box-sizing: border-box;
display: flex;
align-items: center;
background: #fff;
.input_box {
width: 351px;
height: 44px;
background: #F5F6F7;
display: flex;
align-items: center;
padding: 12px;
box-sizing: border-box;
border-radius: 6px 0 0 6px;
.img {
width: 20px;
height: 20px;
margin-right: 8px;
}
.a_input {
flex: 1;
height: 100%;
background: #F5F6F7;
border: 0;
font-family: PingFangSC-Regular;
font-weight: 400;
font-size: 14px;
}
.close {
width: 20px;
height: 20px;
cursor: pointer;
}
}
.search_btn {
width: 126px;
height: 44px;
background: #0077FF;
border-radius: 0 6px 6px 0;
font-family: PingFangSC-SNaNpxibold;
font-weight: 600;
font-size: 14px;
color: #FFFFFF;
cursor: pointer;
}
}
.search_result {
margin-top: 16px;
}
.search_title {
position: relative;
background: #fff;
padding: 12px 20px;
font-family: PingFangSC-Medium;
font-weight: 500;
font-size: 14px;
color: #111111;
}
.search_title:after {
display: block;
content: "";
position: absolute;
height: 1px;
left: 0;
right: 0;
bottom: 0;
background: #f2f2f2;
}
.result_list {
background: #fff;
padding: 20px;
.cell_list {
position: relative;
padding: 16px;
.h2 {
font-family: PingFangSC-Medium;
font-weight: 500;
font-size: 14px;
color: #111111;
}
.cell {
// display: flex;
margin: 8px 0;
font-family: PingFangSC-Regular;
font-weight: 400;
font-size: 14px;
color: #111111;
span {
font-family: PingFangSC-Regular;
font-weight: 400;
font-size: 14px;
color: #111111;
margin-right: 10px;
}
}
}
.blue_bg {
background: #F7FBFF;
}
.red_color {
.h2,
.cell {
color: #f00;
span{
color: #f00;
}
}
}
}
\ No newline at end of file
......@@ -2,24 +2,27 @@
.icon-battery-empty { width: 24px; height: 16px; background-position: -144px -124px; }
.icon-battery-enough { width: 24px; height: 16px; background-position: -168px -124px; }
.icon-begin { width: 26px; height: 36px; background-position: -140px -52px; }
.icon-close { width: 20px; height: 20px; background-position: -118px -52px; }
.icon-copy { width: 28px; height: 28px; background-position: -144px -96px; }
.icon-device { width: 14px; height: 14px; background-position: -118px -68px; }
.icon-device { width: 14px; height: 14px; background-position: -88px -82px; }
.icon-icon_01 { width: 16px; height: 16px; background-position: -172px -96px; }
.icon-icon_02 { width: 16px; height: 16px; background-position: -64px -144px; }
.icon-loc-icon { width: 30px; height: 30px; background-position: -88px -52px; }
.icon-locate-sm { width: 14px; height: 14px; background-position: -88px -82px; }
.icon-locate-sm { width: 14px; height: 14px; background-position: -102px -82px; }
.icon-location { width: 24px; height: 24px; background-position: -28px -160px; }
.icon-navgation { width: 28px; height: 28px; background-position: 0px -160px; }
.icon-off-car { width: 52px; height: 52px; background-position: -88px 0px; }
.icon-offline-time { width: 14px; height: 14px; background-position: -102px -82px; }
.icon-offline-time { width: 14px; height: 14px; background-position: -116px -82px; }
.icon-on-car { width: 52px; height: 52px; background-position: -140px 0px; }
.icon-online-time { width: 14px; height: 14px; background-position: -116px -82px; }
.icon-online-time { width: 14px; height: 14px; background-position: -112px -144px; }
.icon-put-away { width: 64px; height: 16px; background-position: 0px -144px; }
.icon-refresh-car { width: 24px; height: 24px; background-position: -52px -160px; }
.icon-replay-pause { width: 48px; height: 48px; background-position: 0px -96px; }
.icon-replay-play { width: 48px; height: 48px; background-position: -48px -96px; }
.icon-replay-refresh { width: 48px; height: 48px; background-position: -96px -96px; }
.icon-resident { width: 26px; height: 36px; background-position: -166px -52px; }
.icon-search { width: 16px; height: 16px; background-position: -118px -52px; }
.icon-search { width: 16px; height: 16px; background-position: -80px -144px; }
.icon-setting-btn { width: 24px; height: 24px; background-position: -76px -160px; }
.icon-share { width: 88px; height: 96px; background-position: 0px 0px; }
.icon-typeList { width: 14px; height: 14px; background-position: -64px -144px; }
.icon-warning { width: 16px; height: 16px; background-position: -172px -96px; }
\ No newline at end of file
.icon-typeList { width: 14px; height: 14px; background-position: -126px -144px; }
.icon-warning { width: 16px; height: 16px; background-position: -96px -144px; }
\ No newline at end of file

37 KB | W: | H:

42.1 KB | W: | H:

src/assets/spritesmith-generated/sprite.png
src/assets/spritesmith-generated/sprite.png
src/assets/spritesmith-generated/sprite.png
src/assets/spritesmith-generated/sprite.png
  • 2-up
  • Swipe
  • Onion skin
......@@ -19,6 +19,22 @@ const baseRoutes = [
},
component: () => import("../views/info.vue"),
},
{
path: "/search/equipment",
name: "searchEquipment",
meta: {
title: "业务支撑查询系统",
},
component: () => import("../views/searchEquipment.vue"),
},
{
path: "/search/pc/equipment",
name: "searchEquipmentPc",
meta: {
title: "业务支撑查询系统",
},
component: () => import("../views/searchEquipmentPc.vue"),
},
];
const tabRoutes = [
{
......
// 判断浏览器是移动端还是pc端
export const isMobile = () => {
let userAgent = navigator.userAgent.toLowerCase();
let reg =
/ipad|iphone|midp|rv:1.2.3.4|ucweb|android|windows ce|windows mobile/;
// 用 test 匹配浏览器信息
if (reg.test(userAgent)) {
console.log("前端是移动端");
return true;
} else {
console.log("前端是pc端");
return false;
}
};
......@@ -367,6 +367,10 @@ export default defineComponent({
let locates = [];
res.data.forEach((item) => {
item.locationType = "gpsLocation";
// 如果gps信息没有,则展示基站信息
if (!item.gpsLocation || !item.gpsLocation.elng) {
item.locationType = "bsLocation";
}
if (
item.gpsLocation &&
item.gpsLocation.elng &&
......@@ -405,6 +409,7 @@ export default defineComponent({
MAPGEO.transferAddressByGroup(
{ data: locates, timeoutIds: [] },
() => {
console.log(markers);
map.setFitView(markers);
}
);
......@@ -415,7 +420,7 @@ export default defineComponent({
});
};
const drawMarker = (item, map, locates) => {
item.locationType = "gpsLocation";
//item.locationType = "gpsLocation";
if (!item[item.locationType]) return;
//修改数据格式方便获取
locates.forEach((val) => {
......@@ -464,20 +469,22 @@ export default defineComponent({
}</span></p>`;
}
carInfoWindowTpl += `<p class="time-info"><i class="icon icon-online-time"></i><span class="label">在线时间</span><span data-onlineTime></span></p>
<p class="locate-info"><i class="icon icon-locate-sm"></i><span class="label">详细地址</span><span data-tranferAddress></span></p>`;
<p class="locate-info"><i class="icon icon-locate-sm"></i><span class="label">详细地址</span><span data-tranferAddress></span></p><p p class="list-info" > <i class="icon icon-typeList"></i><span class="label">定位类型</span>`;
// 判断是否有gps信息
if (item.gpsLocation && item.gpsLocation.lng) {
carInfoWindowTpl += `<a data-GPS><span class="radio active"></span>GPS</a>`;
}
// 判断是否有基站信息
if (item.bsLocation && item.bsLocation.lng) {
carInfoWindowTpl += `<a data-GPRS><span class="radio"></span>基站</a>`;
}
// 判断是否有WIFI信息
if (item.hasWifi) {
carInfoWindowTpl += `<p p class="list-info" > <i class="icon icon-typeList"></i><span class="label">定位类型</span>
<a data-GPS><span class="radio active"></span>GPS</a>
<a data-GPRS><span class="radio"></span></i>基站</a>
<a data-WIFI><span class="radio"></span></i>WIFI</a>
</p>`;
} else {
carInfoWindowTpl += `<p p class="list-info" > <i class="icon icon-typeList"></i><span class="label">定位类型</span>
<a data-GPS><span class="radio active"></span><span>GPS</span></a>
<a data-GPRS><span class="radio"></span><span>基站</span></a>
</p>`;
carInfoWindowTpl += `<a data-WIFI><span class="radio"></span></i>WIFI</a>`;
}
carInfoWindowTpl += `</div>
carInfoWindowTpl += `</p></div>
</div>
<div class="cmd-list">
<div class="cmd-list-top">
......@@ -520,8 +527,8 @@ export default defineComponent({
let carFreqBtn = infoDiv.querySelector("[data-freq]");
let carFenceBtn = infoDiv.querySelector("[data-fence]");
let shareBtn = infoDiv.querySelector("[data-share]");
let GPSIcon = GPSBtn.querySelector(".radio");
let GPRSIcon = GPRSBtn.querySelector(".radio");
let GPSIcon = GPSBtn && GPSBtn.querySelector(".radio");
let GPRSIcon = GPRSBtn && GPRSBtn.querySelector(".radio");
let WIFIIcon = WIFIBtn && WIFIBtn.querySelector(".radio");
// 地址赋值
const setAddress = () => {
......@@ -548,6 +555,12 @@ export default defineComponent({
shareBtn && shareBtn.classList.add("disabled");
carFenceBtn && carFenceBtn.classList.add("disabled");
}
// 如果没有gps点,则默认勾选基站
if (!item.gpsLocation) {
GPRSIcon && GPRSIcon.classList.add("active");
}
// 点击GPS
GPSBtn &&
(GPSBtn.onclick = () => {
......
<template>
<div class="page_box">
<!-- 顶部菜单 开始 -->
<div class="top_menu">
<div
class="cell"
:class="menuActive == item.id ? 'cell_active' : ''"
v-for="(item, index) in menuList"
:key="`menu_${index}`"
@click="menuEvent(item)"
>
{{ item.name }}
</div>
</div>
<!-- 顶部菜单 end -->
<!-- 搜索框 开始 -->
<div class="search_box">
<div class="input_box">
<img src="@/assets/icon/search.png" class="img" alt="" />
<input
type="text"
v-model="searchText"
class="a_input"
maxlength="20"
placeholder="设备号"
@input="onInput"
/>
<img
src="@/assets/icon/close.png"
class="close"
alt=""
v-if="searchText"
@click="onClear()"
/>
</div>
<!-- <button class="search_btn">立即查询</button> -->
<van-button type="primary" class="search_btn" @click="getList"
>立即查询</van-button
>
</div>
<!-- 搜索框 end -->
<!-- 搜索结果 开始 -->
<div class="search_result">
<!-- 搜索标题 开始 -->
<div class="search_title">查询结果</div>
<!-- 搜索标题 end -->
<!-- 搜索结果 开始 -->
<div class="result_list">
<!-- 最近1条GPS记录 开始 -->
<div class="cell_list">
<h2 class="h2">————最近1条GPS记录————</h2>
<template v-if="lastOneGPSRecord && lastOneGPSRecord.lng">
<div class="cell">
<span>接收时间:{{ lastOneGPSRecord.receiveTime || "--" }};</span>
<span>经度:{{ lastOneGPSRecord.lng || "--" }};</span>
<span>纬度:{{ lastOneGPSRecord.lat || "--" }};</span>
<span>位置:{{ lastOneGPSRecord.address || "--" }}</span>
</div>
</template>
<div class="cell" v-else>无</div>
</div>
<!-- 最近1条GPS记录 end -->
<!-- 最近3条GPS记录 开始 -->
<div class="cell_list">
<h2 class="h2">————最近3条GPS记录————</h2>
<template v-if="lastThreeGPSRecord && lastThreeGPSRecord.length">
<div
class="cell"
v-for="(item, index) in lastThreeGPSRecord"
:key="`last_three_gps_${index}`"
>
<span>接收时间:{{ item.receiveTime || "--" }};</span>
<span>经度:{{ item.lng || "--" }};</span>
<span>纬度:{{ item.lat || "--" }};</span>
<span>位置:{{ item.address || "--" }}</span>
</div>
</template>
<div class="cell" v-else>无</div>
</div>
<!-- 最近3条GPS记录 end -->
<!-- 最近3条基站记录 开始 -->
<div class="cell_list">
<h2 class="h2">————最近3条基站记录————</h2>
<template v-if="lastThreeBSRecord && lastThreeBSRecord.length">
<div
class="cell"
v-for="(item, index) in lastThreeBSRecord"
:key="`last_three_bs_${index}`"
>
<span>接收时间:{{ item.receiveTime || "--" }};</span>
<span>mcc: {{ item.mcc || "--" }}</span>
<span>mnc: {{ item.mnc || "--" }}</span>
<span>lac: {{ item.lac || "--" }}</span>
<span>cellid: {{ item.cellid || "--" }}</span>
<span>signal: {{ item.signal || "--" }}</span>
<span>经度:{{ item.lng || "--" }};</span>
<span>纬度:{{ item.lat || "--" }};</span>
<span>位置:{{ item.address || "--" }}</span>
</div>
</template>
<div class="cell" v-else>无</div>
</div>
<!-- 最近3条基站记录 end -->
<!-- 最近3条断电报警记录 开始 -->
<div class="cell_list red_color" v-if="source == 1 || source == null">
<h2 class="h2">————最近3条断电报警记录————</h2>
<template
v-if="lastThreeTearDownRecord && lastThreeTearDownRecord.length"
>
<div
class="cell"
v-for="(item, index) in lastThreeTearDownRecord"
:key="`last_power_${index}`"
>
<span>接收时间:{{ item.receiveTime || "--" }};</span>
<span>经度:{{ item.lng || "--" }};</span>
<span>纬度:{{ item.lat || "--" }};</span>
<span>位置:{{ item.address || "--" }}</span>
</div>
</template>
<div class="cell" v-else>无</div>
</div>
<!-- 最近3条断电报警记录 end -->
<!-- 最近3条光感报警记录 开始 -->
<div class="cell_list red_color" v-if="source == 0 || source == null">
<h2 class="h2">————最近3条光感报警记录————</h2>
<template
v-if="lastThreePowerOffRecord && lastThreePowerOffRecord.length"
>
<div
class="cell"
v-for="(item, index) in lastThreePowerOffRecord"
:key="`last_tear_${index}`"
>
<span>接收时间:{{ item.receiveTime || "--" }};</span>
<span>经度:{{ item.lng || "--" }};</span>
<span>纬度:{{ item.lat || "--" }};</span>
<span>位置:{{ item.address || "--" }}</span>
</div>
</template>
<div class="cell" v-else>无</div>
</div>
<!-- 最近3条光感报警记录 end -->
</div>
<!-- 搜索结果 end -->
</div>
<!-- 搜索结果 end -->
</div>
</template>
<script setup>
import { Toast } from "vant";
import { ref, onBeforeMount } from "vue";
import { isMobile } from "@/utils/common";
import { useRouter } from "vue-router";
import { GET_VEHICLE_INFO } from "@/api/index";
const router = useRouter();
// 菜单列表
const menuList = ref([
{ name: "GPS", id: "gps" },
{ name: "OBD", id: "obd" },
]);
// 当前选中的菜单
const menuActive = ref("gps");
// 输入内容
const searchText = ref("");
// 菜单点击事件
const menuEvent = (row) => {
menuActive.value = row.id;
if (searchText.value) {
getList();
}
};
// 最近1条GPS记录
const lastOneGPSRecord = ref({});
// 最近3条GPS记录
const lastThreeGPSRecord = ref([]);
// 最近3条基站记录
const lastThreeBSRecord = ref([]);
// 最近3条断电报警记录
const lastThreeTearDownRecord = ref([]);
// 最近3条光感报警记录
const lastThreePowerOffRecord = ref([]);
// 设备类型 0:无线设备 1:有线设备 null:默认初始,展示全部报警
const source = ref(null);
// 查询设备信息
const getList = () => {
let _params = {};
let reg = /^[0-9|A-Z|a-z]+$/;
_params.sn = searchText.value;
_params.deviceCode = menuActive.value;
if (!searchText.value) {
Toast("请输入设备号");
return false;
}
if (!reg.test(searchText.value)) {
Toast("请输入正确的设备号");
return false;
}
GET_VEHICLE_INFO(_params).then((res) => {
console.log(res);
let _obj = res.data || {};
lastOneGPSRecord.value = _obj.lastOneGPSRecord || {};
lastThreeBSRecord.value = _obj.lastThreeBSRecord || [];
lastThreeGPSRecord.value = _obj.lastThreeGPSRecord || [];
lastThreePowerOffRecord.value = _obj.lastThreePowerOffRecord || [];
lastThreeTearDownRecord.value = _obj.lastThreeTearDownRecord || [];
source.value = _obj.source;
});
};
// 清空数据
const onClear = () => {
lastOneGPSRecord.value = {};
lastThreeBSRecord.value = [];
lastThreeGPSRecord.value = [];
lastThreePowerOffRecord.value = [];
lastThreeTearDownRecord.value = [];
searchText.value = "";
source.value = null;
};
// 监听输入
const onInput = () => {
let _txt = searchText.value;
console.log(_txt);
searchText.value = _txt.replace(/[^a-zA-Z0-9]/g, "");
};
// 生命周期-页面加载之前执行
onBeforeMount(() => {
let _isMobile = isMobile();
console.log(_isMobile);
if (_isMobile) {
router.push({ name: "searchEquipment" });
}
});
</script>
<style lang="scss" scoped>
@import "../assets/css/searchEquipmentPc.scss";
</style>
......@@ -17,7 +17,7 @@ module.exports = defineConfig({
port: 9527,
proxy: {
'/api': {
target: 'https://eshield.test.glsx.com.cn/',
target: 'https://eshield.dev.glsx.com.cn/',
changeOrigin: true,
secure: false,
pathRewrite: { "^/api": "" },
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!