Commit 83672c70 authored by xinzhedeai's avatar xinzhedeai

new from liqilin

parent bba8ce47
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
# if use a sub directory, it must be end with "/", like "/admin/" but not "/admin" # if use a sub directory, it must be end with "/", like "/admin/" but not "/admin"
VITE_BASE_URL=/ VITE_BASE_URL=/
VITE_APP_TITLE=SoybeanAdmin VITE_APP_TITLE=金润四化综合管理系统
VITE_APP_DESC=SoybeanAdmin is a fresh and elegant admin template VITE_APP_DESC=SoybeanAdmin is a fresh and elegant admin template
...@@ -63,12 +63,42 @@ VITE_DEVTOOLS_LAUNCH_EDITOR=code ...@@ -63,12 +63,42 @@ VITE_DEVTOOLS_LAUNCH_EDITOR=code
# VITE_VIDEO_URL=ws://192.168.3.248:9999 # VITE_VIDEO_URL=ws://192.168.3.248:9999
# 开发环境 - 所有服务接口地址 # 开发环境 - 所有服务接口地址
VITE_SERVICE_URL=http://192.168.2.53:9995 VITE_SERVICE_URL=http://192.168.2.67:9995
# 模型地址环境 # 模型地址环境
VITE_MODEL_URL=http://192.168.2.53:9995/model VITE_MODEL_URL=http://192.168.2.67:9995/model
# 开发环境 - WebSocket 全局地址 # 开发环境 - WebSocket 全局地址
# VITE_WEBSOCKET_URL=ws://192.168.3.248:9996 # VITE_WEBSOCKET_URL=ws://192.168.3.248:9996
\ No newline at end of file
# 人员定位 -- 前后端
VITE_PERSON_URL=http://192.168.2.67:8083
# 后 http://192.168.2.37:8082
# 定位卡 http://192.168.2.53:9997
# 边坡监测 -- 前后端
VITE_SIDE_URL=http://192.168.2.67:9087
# 后 http://192.168.2.37:9082
# 全方位监测 -- 前后端
VITE_POINT_URL=http://192.168.2.67:9088
# 后 http://192.168.2.37:9081
# 排土场 -- 前后端
VITE_CASTING_URL=http://192.168.2.67:9086
# 后 http://192.168.2.37:9080
# 卡车调度 -- 前后端
VITE_TRUCK_URL=http://192.168.2.67:8040
VITE_TRUCKS_URL=http://192.168.2.67:9089
# 后 http://192.168.2.53:9996
# AI系统 -- 前后端
VITE_AI_URL=http://192.168.2.67:9528
# 后 http://192.168.2.53:9528
# 综合系统 -- 前后端
# 前 http://192.168.2.54:9527
# 后 http://192.168.2.53:9995
...@@ -10,9 +10,9 @@ ...@@ -10,9 +10,9 @@
<script src="./public/js/proj4.js"></script> <script src="./public/js/proj4.js"></script>
<script src="./public/js/turf.min.js"></script> <script src="./public/js/turf.min.js"></script>
<link rel="stylesheet" type="text/css" href="./Cesium/Widgets/widgets.css" /> <link rel="stylesheet" type="text/css" href="./Cesium/Widgets/widgets.css" />
<script type="text/javascript" src="/public/webrtcstreamer.js"></script> <script type="text/javascript" src="./public/webrtcstreamer.js"></script>
<script type="text/javascript" src="./Cesium/Cesium.js"></script> <script type="text/javascript" src="./Cesium/Cesium.js"></script>
<script src="/public/jquery-1.7.1.min.js"></script> <script src="./public/jquery-1.7.1.min.js"></script>
<title>%VITE_APP_TITLE%</title> <title>%VITE_APP_TITLE%</title>
</head> </head>
......
...@@ -51,7 +51,7 @@ export const getCarLogList = async (): Promise<any> => await axios.get('home/car ...@@ -51,7 +51,7 @@ export const getCarLogList = async (): Promise<any> => await axios.get('home/car
// 修改报警状态 // 修改报警状态
export const setAlarmStatusApi = async (command: string): Promise<any> => await axios.post(`/home/sound/${command}`); export const setAlarmStatusApi = async (command: any): Promise<any> => await axios.post(`/home/sound/${command}`);
// 获取报警状态 // 获取报警状态
export const getAlarmStatusApi = async (): Promise<any> => await axios.get('/home/alarm/status'); export const getAlarmStatusApi = async (): Promise<any> => await axios.get('/home/alarm/status');
......
...@@ -34,6 +34,9 @@ export const api_tokenGet = async (): Promise<any> => await axios.get(`/api/toke ...@@ -34,6 +34,9 @@ export const api_tokenGet = async (): Promise<any> => await axios.get(`/api/toke
export const api_menuPageGet = async (data: any): Promise<any> => export const api_menuPageGet = async (data: any): Promise<any> =>
await axios.get(`/menu/page?pageNum=${data.pageNum}&pageSize=${data.pageSize}`); await axios.get(`/menu/page?pageNum=${data.pageNum}&pageSize=${data.pageSize}`);
export const api_menuListGet = async (): Promise<any> =>
await axios.get(`/menu/list`);
// ------------------- 用户管理接口 ------------------ // ------------------- 用户管理接口 ------------------
export const api_userPageGet = async (data: any): Promise<any> => export const api_userPageGet = async (data: any): Promise<any> =>
await axios.get(`/user/page?pageNum=${data.pageNum}&pageSize=${data.pageSize}&startTime=${data.startTime}&endTime=${data.endTime}&username=${data.username}&depName=${data.depname}`); await axios.get(`/user/page?pageNum=${data.pageNum}&pageSize=${data.pageSize}&startTime=${data.startTime}&endTime=${data.endTime}&username=${data.username}&depName=${data.depname}`);
...@@ -56,6 +59,8 @@ export const api_getDepList = async (): Promise<any> => await axios.get('/dep/li ...@@ -56,6 +59,8 @@ export const api_getDepList = async (): Promise<any> => await axios.get('/dep/li
export const api_putPassword = async (data:any): Promise<any> => await axios.put(`/user/password/${data.id}/${data.password}`); export const api_putPassword = async (data:any): Promise<any> => await axios.put(`/user/password/${data.id}/${data.password}`);
export const api_getRoleId = async (id:any): Promise<any> => await axios.get(`/role/${id}`);
// ------------------- 角色管理接口 ------------------ // ------------------- 角色管理接口 ------------------
export const api_rolePage = async (data: any): Promise<any> => export const api_rolePage = async (data: any): Promise<any> =>
await axios.get(`/role/page?pageNum=${data.pageNum}&pageSize=${data.pageSize}&roleName=${data.rolename}&startTime=${data.startTime}&endTime=${data.endTime}`); await axios.get(`/role/page?pageNum=${data.pageNum}&pageSize=${data.pageSize}&roleName=${data.rolename}&startTime=${data.startTime}&endTime=${data.endTime}`);
......
interface DetectionRecord { interface DetectionRecord {
type: string;
cardId: any;
id: number; id: number;
videoName: string; videoName: string;
cameraName: string; cameraName: string;
......
...@@ -32,4 +32,25 @@ export const create3D = async (viewer: any, url: any, height = 0) => { ...@@ -32,4 +32,25 @@ export const create3D = async (viewer: any, url: any, height = 0) => {
tiles.modelMatrix = Cesium.Matrix4.fromTranslation(translate); tiles.modelMatrix = Cesium.Matrix4.fromTranslation(translate);
create3D.id = viewer.scene.primitives.add(tiles); create3D.id = viewer.scene.primitives.add(tiles);
viewer.zoomTo(tiles); viewer.zoomTo(tiles);
}
export function pointLine(viewer) {
let polygonCoordList = [
122.04454563914409,37.489284875763744,
122.04561831986973,37.487027958982864,
122.05006039343479,37.48821693911029,
122.04881042851096,37.49135388724233,
]
// 创建红色线圈
viewer.entities.add({
id: 'allTotalArea',
name: 'allTotalArea',
polyline: {
positions: Cesium.Cartesian3.fromDegreesArray(polygonCoordList),
width: 4,
material: Cesium.Color.RED,
clampToGround: true, // 禁用贴地
},
})
} }
\ No newline at end of file
...@@ -182,17 +182,19 @@ function densifyPoints(positions: any[], stepSize: number = 2.0) { ...@@ -182,17 +182,19 @@ function densifyPoints(positions: any[], stepSize: number = 2.0) {
} }
export async function createNewPositionHeight(position: any, viewer: any) { export async function createNewPositionHeight(position: any, viewer: any) {
const denseCoordinates = densifyPoints(position, 10.0); // 每隔2米插入一个点 const denseCoordinates = densifyPoints(position, 20.0); // 每隔20米插入一个点
let clampedPositions: any[] = []; let clampedPositions: any[] = [];
try { try {
const updatedPositions = await viewer.scene.clampToHeightMostDetailed(denseCoordinates); const updatedPositions = await viewer.scene.clampToHeightMostDetailed(denseCoordinates);
for(let item of updatedPositions) {
clampedPositions = updatedPositions.map((pos: any) => { if(item) {
const cartographic = Cesium.Cartographic.fromCartesian(pos); const cartographic = Cesium.Cartographic.fromCartesian(item);
return Cesium.Cartesian3.fromRadians(cartographic.longitude, cartographic.latitude, cartographic.height + 0.8); let dataPoints = Cesium.Cartesian3.fromRadians(cartographic.longitude, cartographic.latitude, cartographic.height + 6);
}); clampedPositions.push(dataPoints);
}
}
} catch (error) { } catch (error) {
console.warn('高度贴合计算失败或部分失败:', error); console.warn('高度贴合计算失败或部分失败:', error);
clampedPositions = denseCoordinates; clampedPositions = denseCoordinates;
......
...@@ -2,7 +2,7 @@ import { loadEnv } from "vite"; ...@@ -2,7 +2,7 @@ import { loadEnv } from "vite";
import { getModelNewApi } from "../index"; import { getModelNewApi } from "../index";
export async function getModel() { export async function getModel() {
const url = 'http://192.168.2.53:9995/model/' const url = 'http://192.168.2.67:9995/model/'
let res = await getModelNewApi(); let res = await getModelNewApi();
......
...@@ -188,11 +188,13 @@ export async function createNewPositionHeight(position: any, viewer: any) { ...@@ -188,11 +188,13 @@ export async function createNewPositionHeight(position: any, viewer: any) {
try { try {
const updatedPositions = await viewer.scene.clampToHeightMostDetailed(denseCoordinates); const updatedPositions = await viewer.scene.clampToHeightMostDetailed(denseCoordinates);
for(let item of updatedPositions) {
clampedPositions = updatedPositions.map((pos: any) => { if(item) {
const cartographic = Cesium.Cartographic.fromCartesian(pos); const cartographic = Cesium.Cartographic.fromCartesian(item);
return Cesium.Cartesian3.fromRadians(cartographic.longitude, cartographic.latitude, cartographic.height + 6); let dataPoints = Cesium.Cartesian3.fromRadians(cartographic.longitude, cartographic.latitude, cartographic.height + 6);
}); clampedPositions.push(dataPoints);
}
}
} catch (error) { } catch (error) {
console.warn('高度贴合计算失败或部分失败:', error); console.warn('高度贴合计算失败或部分失败:', error);
clampedPositions = denseCoordinates; clampedPositions = denseCoordinates;
...@@ -224,7 +226,6 @@ export async function startVehicleMovement(viewer: any, totalDuration: number) { ...@@ -224,7 +226,6 @@ export async function startVehicleMovement(viewer: any, totalDuration: number) {
for (let i = 0; i < rawCoordinates.length - 1; i++) { for (let i = 0; i < rawCoordinates.length - 1; i++) {
totalDistance += Cesium.Cartesian3.distance(rawCoordinates[i], rawCoordinates[i + 1]); totalDistance += Cesium.Cartesian3.distance(rawCoordinates[i], rawCoordinates[i + 1]);
} }
let accumulatedTime = 0; let accumulatedTime = 0;
positionProperty.addSample(viewer.clock.currentTime, rawCoordinates[0]); positionProperty.addSample(viewer.clock.currentTime, rawCoordinates[0]);
......
...@@ -89,12 +89,16 @@ ...@@ -89,12 +89,16 @@
<template v-if="boundaryData.length > 0"> <template v-if="boundaryData.length > 0">
<template v-for="(item, index) in boundaryData" :key="index"> <template v-for="(item, index) in boundaryData" :key="index">
<dd class="list-item" :class="getItemClass(item)"> <dd class="list-item" :class="getItemClass(item)">
<span>{{ item.driver }}</span> <span>{{ item.driver || item.carName }}</span>
<span>{{ item.licensePlate }}</span> <span>{{ item.licensePlate || item.id }}</span>
<span class="time-cell"> <span class="time-cell" v-if="item.boundaryTime">
<div class="date-part">{{ item.boundaryTime?.split(' ')[0] }}</div> <div class="date-part">{{ item.boundaryTime?.split(' ')[0] }}</div>
<div class="time-part">{{ item.boundaryTime?.split(' ')[1] }}</div> <div class="time-part">{{ item.boundaryTime?.split(' ')[1] }}</div>
</span> </span>
<span class="time-cell" v-if="item.createTime">
<div class="date-part">{{ item.createTime?.split(' ')[0] }}</div>
<div class="time-part">{{ item.createTime?.split(' ')[1] }}</div>
</span>
</dd> </dd>
</template> </template>
</template> </template>
......
...@@ -55,10 +55,10 @@ function goToCesium() { ...@@ -55,10 +55,10 @@ function goToCesium() {
<img src="@/assets/daping.png" alt="" style="width: 16px; height: 16px; margin-right: 4px" /> <img src="@/assets/daping.png" alt="" style="width: 16px; height: 16px; margin-right: 4px" />
大屏 大屏
</NButton> </NButton>
<NButton quaternary circle style="width: 60px"> <!-- <NButton quaternary circle style="width: 60px">
<img src="@/assets/qiehuan.png" alt="" style="width: 16px; height: 16px; margin-right: 4px" /> <img src="@/assets/qiehuan.png" alt="" style="width: 16px; height: 16px; margin-right: 4px" />
切换 切换
</NButton> </NButton> -->
<!-- <!--
<NButton quaternary circle style="width: 60px" > <NButton quaternary circle style="width: 60px" >
<img src="@/assets/yonghu.png" alt="" style="width: 16px; height: 16px; margin-right: 4px" /> <img src="@/assets/yonghu.png" alt="" style="width: 16px; height: 16px; margin-right: 4px" />
......
...@@ -8,6 +8,7 @@ import { useThemeStore } from '@/store/modules/theme'; ...@@ -8,6 +8,7 @@ import { useThemeStore } from '@/store/modules/theme';
import { useRouteStore } from '@/store/modules/route'; import { useRouteStore } from '@/store/modules/route';
import { useRouterPush } from '@/hooks/common/router'; import { useRouterPush } from '@/hooks/common/router';
import { useMenu } from '../context'; import { useMenu } from '../context';
import { localStg } from '@/utils/storage';
defineOptions({ defineOptions({
name: 'VerticalMenu' name: 'VerticalMenu'
...@@ -51,11 +52,12 @@ watch( ...@@ -51,11 +52,12 @@ watch(
:collapsed="appStore.siderCollapse" :collapsed="appStore.siderCollapse"
:collapsed-width="themeStore.sider.collapsedWidth" :collapsed-width="themeStore.sider.collapsedWidth"
:collapsed-icon-size="22" :collapsed-icon-size="22"
:options="routeStore.menus" :options="localStg.get('routerList')"
:inverted="inverted" :inverted="inverted"
:indent="18" :indent="18"
@update:value="routerPushByKeyWithMetaQuery" @update:value="routerPushByKeyWithMetaQuery"
/> />
<!-- :options="localStg.get('routerList')" -->
</SimpleScrollbar> </SimpleScrollbar>
</Teleport> </Teleport>
</template> </template>
......
...@@ -222,7 +222,7 @@ const local: App.I18n.Schema = { ...@@ -222,7 +222,7 @@ const local: App.I18n.Schema = {
404: '页面不存在', 404: '页面不存在',
500: '服务器错误', 500: '服务器错误',
'iframe-page': '外链页面', 'iframe-page': '外链页面',
cesiumdeom: 'Cesium大屏', cesiumdeom: '综合大屏',
home: '越界开采系统', home: '越界开采系统',
home_police: '报警列表', home_police: '报警列表',
home_rail: '电子围栏管理', home_rail: '电子围栏管理',
......
...@@ -38,9 +38,9 @@ export function createRouteGuard(router: Router) { ...@@ -38,9 +38,9 @@ export function createRouteGuard(router: Router) {
const hasRole = authStore.userInfo.roles.some(role => routeRoles.includes(role)); const hasRole = authStore.userInfo.roles.some(role => routeRoles.includes(role));
const hasAuth = authStore.isStaticSuper || !routeRoles.length || hasRole; const hasAuth = authStore.isStaticSuper || !routeRoles.length || hasRole;
// if it is login route when logged in, then switch to the root page // if it is login route when logged in, then switch to the home page
if (to.name === loginRoute && isLogin) { if (to.name === loginRoute && isLogin) {
next({ name: rootRoute }); next({ path: '/home' });
return; return;
} }
......
...@@ -30,6 +30,7 @@ export const router = createRouter({ ...@@ -30,6 +30,7 @@ export const router = createRouter({
routes routes
}); });
/** Setup Vue Router */ /** Setup Vue Router */
export async function setupRouter(app: App) { export async function setupRouter(app: App) {
app.use(router); app.use(router);
...@@ -38,6 +39,6 @@ export async function setupRouter(app: App) { ...@@ -38,6 +39,6 @@ export async function setupRouter(app: App) {
} }
router.beforeEach((to, from, next) => { router.beforeEach((to, from, next) => {
connect(); connect('home');
next(); next();
}); });
...@@ -5,7 +5,7 @@ import { getRoutePath, transformElegantRoutesToVueRoutes } from '../elegant/tran ...@@ -5,7 +5,7 @@ import { getRoutePath, transformElegantRoutesToVueRoutes } from '../elegant/tran
export const ROOT_ROUTE: CustomRoute = { export const ROOT_ROUTE: CustomRoute = {
name: 'root', name: 'root',
path: '/', path: '/',
redirect: getRoutePath(import.meta.env.VITE_ROUTE_HOME) || '/home', redirect: '/login',
meta: { meta: {
title: 'root', title: 'root',
constant: true constant: true
......
This diff is collapsed.
...@@ -4,7 +4,7 @@ let webRtcServrce = ref(); ...@@ -4,7 +4,7 @@ let webRtcServrce = ref();
export function webVideo(rtsp: any) { export function webVideo(rtsp: any) {
console.log('111',rtsp); console.log('111',rtsp);
webRtcServrce.value = new WebRtcStreamer('video', location.protocol + '//' + "192.168.2.53:8000") webRtcServrce.value = new WebRtcStreamer('video', location.protocol + '//' + "192.168.2.67:8000")
webRtcServrce.value.connect('rtsp://admin:Gemho120611@192.168.0.17:554/h264/ch1/main/av_stream'); webRtcServrce.value.connect('rtsp://admin:Gemho120611@192.168.0.17:554/h264/ch1/main/av_stream');
}; };
...@@ -4,16 +4,16 @@ import { router } from '@/router'; ...@@ -4,16 +4,16 @@ import { router } from '@/router';
import { localStg } from './storage'; import { localStg } from './storage';
import { AudioPlayer } from './common'; import { AudioPlayer } from './common';
let ws: any = null; let ws: any = null;
const severName = 'home'; let severName = 'home';
// 定义WebSocket连接的URL // 定义WebSocket连接的URL
const webSocketUrl = `ws://192.168.2.53:8080/ws/${severName}`; const webSocketUrl = `ws://192.168.2.67:9995/ws/${severName}`;
// 存储活动通知实例的数组,用于限制通知数量 // 存储活动通知实例的数组,用于限制通知数量
const activeNotifications: any[] = []; const activeNotifications: any[] = [];
const MAX_NOTIFICATIONS = 3; const MAX_NOTIFICATIONS = 3;
const htmlStr = ref(''); const htmlStr = ref('');
// JSON字符串转对象函数 // JSON字符串转对象函数
function parseDetectionRecord(jsonString: string): DetectionRecord { export function parseDetectionRecord(jsonString: string): DetectionRecord {
try { try {
// 注意:需要先清理字符串中的额外反引号 // 注意:需要先清理字符串中的额外反引号
const cleanedString = jsonString.replace(/^\s*`|`\s*$/g, ''); const cleanedString = jsonString.replace(/^\s*`|`\s*$/g, '');
...@@ -53,11 +53,12 @@ function createLimitedNotification(options: any) { ...@@ -53,11 +53,12 @@ function createLimitedNotification(options: any) {
return notification; return notification;
} }
const playAudio = async (id: any) => { const playAudio = async (id: any) => {
const player = new AudioPlayer(`http://192.168.2.53:9995/v1/play/${id}`); const player = new AudioPlayer(`http://192.168.2.67:9995/v1/play/${id}`);
player.play().catch(err => console.error('播放失败',err)); player.play().catch(err => console.error('播放失败', err));
}; };
export function connect() { export function connect(name:any) {
severName = name;
if ('WebSocket' in window) { if ('WebSocket' in window) {
ws = new WebSocket(webSocketUrl); ws = new WebSocket(webSocketUrl);
// 连接成功时触发 // 连接成功时触发
...@@ -69,12 +70,17 @@ export function connect() { ...@@ -69,12 +70,17 @@ export function connect() {
// 接收到消息时触发 // 接收到消息时触发
ws.onmessage = function (event) { ws.onmessage = function (event) {
const recordObject: DetectionRecord = parseDetectionRecord(event.data); const recordObject: DetectionRecord = parseDetectionRecord(event.data);
if (event.data == 401) { // 处理接收到的数据
localStorage.removeItem('token'); const data = recordObject;
router.push('/login'); console.log('111', data);
if (data.type == 'router') {
router.push({
path: '/personnel/track',
query: {
cardId: data.cardId
}
});
} else { } else {
// 处理接收到的数据
const data = recordObject;
if (true) { if (true) {
playAudio(data.algorithmId); playAudio(data.algorithmId);
} }
...@@ -102,7 +108,7 @@ export function connect() { ...@@ -102,7 +108,7 @@ export function connect() {
]) ])
]), ]),
h(NRow, { gutter: 10, style: { marginTop: '10px' } }, [ h(NRow, { gutter: 10, style: { marginTop: '10px' } }, [
h(NCol, { span: 7 },[ h(NCol, { span: 7 }, [
h('div', { style: { fontSize: '14px', textAlign: 'center' } }, [ h('div', { style: { fontSize: '14px', textAlign: 'center' } }, [
h('span', '报警图片:') h('span', '报警图片:')
]) ])
...@@ -110,59 +116,14 @@ export function connect() { ...@@ -110,59 +116,14 @@ export function connect() {
h(NCol, { span: 15 }, [ h(NCol, { span: 15 }, [
h('img', { h('img', {
style: { height: '100px', width: '200px' }, style: { height: '100px', width: '200px' },
src: 'http://192.168.2.53:9995/image/979fc62b9f3a4097933e6e0a0aed489d.jpg' src: 'http://192.168.2.67:9995/image/979fc62b9f3a4097933e6e0a0aed489d.jpg'
}) })
]), ]),
// h(NCol, { span: 12 }, [
// h(NSpace, { vertical: true, justify: 'space-between' }, [
// // h('div', [
// // h(NButton, { quaternary: true, round: true }, () => data.cameraName || ''),
// // h('div', { style: { fontSize: '14px' } }, [
// // h(
// // NButton,
// // {
// // quaternary: true,
// // round: true,
// // type: 'info',
// // onClick: () => toLogPage(data)
// // },
// // () => '查看详情'
// // )
// // ])
// // ]),
// // h('div', { style: { display: 'flex', justifyContent: 'space-between', marginTop: '20px' } }, [
// // h(
// // NButton,
// // {
// // strong: true,
// // secondary: true,
// // size: 'small',
// // // onClick: () => modifyAlramStatus(data.id, '1')
// // style: {
// // color: 'white',
// // backgroundColor: '#2196f3'
// // }
// // },
// // () => '正确报警'
// // ),
// // h(
// // NButton,
// // {
// // strong: true,
// // secondary: true,
// // size: 'small',
// // style: { marginLeft: '20px', color: 'white', backgroundColor: '#f57b70' }
// // // onClick: () => modifyAlramStatus(data.id, '2')
// // },
// // () => '错误报警'
// // )
// // ])
// ])
// ])
]) ])
]) ])
}); });
} }
// 处理收到的消息 // 处理收到的消息
}; };
......
...@@ -3,6 +3,7 @@ import { nextTick, onBeforeMount, onMounted, onUnmounted, ref, watch } from 'vue ...@@ -3,6 +3,7 @@ import { nextTick, onBeforeMount, onMounted, onUnmounted, ref, watch } from 'vue
import '../../../../Cesium/Widgets/widgets.css'; import '../../../../Cesium/Widgets/widgets.css';
import { useMessage } from 'naive-ui'; import { useMessage } from 'naive-ui';
import { import {
api_getRoleId,
getCameraIdApi, getCameraIdApi,
getCarPointAllCarApi, getCarPointAllCarApi,
getCemeraPointApi, getCemeraPointApi,
...@@ -13,7 +14,7 @@ import { ...@@ -13,7 +14,7 @@ import {
getPointAllPersonApi, getPointAllPersonApi,
getPointListApi getPointListApi
} from '@/api'; } from '@/api';
import { create3D } from '@/api/utils/cesium'; import { create3D, pointLine } from '@/api/utils/cesium';
import { getElevationFromRay, getElevationFromRays } from '@/api/utils/cesiumUtil'; import { getElevationFromRay, getElevationFromRays } from '@/api/utils/cesiumUtil';
import { cesiumToLongitudeAndLatitude } from '@/api/utils/coordinateUtil'; import { cesiumToLongitudeAndLatitude } from '@/api/utils/coordinateUtil';
import { getModel } from '@/api/utils/cesiumModel'; import { getModel } from '@/api/utils/cesiumModel';
...@@ -32,6 +33,10 @@ import blueVideoIcon from '@/assets/icon16.png'; ...@@ -32,6 +33,10 @@ import blueVideoIcon from '@/assets/icon16.png';
import blueBianIcon from '@/assets/icon17.png'; import blueBianIcon from '@/assets/icon17.png';
import redPersonIcon from '../../../assets/redperson.png'; import redPersonIcon from '../../../assets/redperson.png';
import MultiSelect from './appselect.vue'; import MultiSelect from './appselect.vue';
import { useRouteStore } from '@/store/modules/route';
import { router } from '@/router';
import { localStg } from '@/utils/storage';
import { getAlarmStatusApi, setAlarmStatusApi } from '@/api/index-dp';
let viewer: any = null; let viewer: any = null;
const message = useMessage(); const message = useMessage();
...@@ -39,17 +44,10 @@ let personEntity: any; ...@@ -39,17 +44,10 @@ let personEntity: any;
const pins: any = []; const pins: any = [];
const full = ref(false); const full = ref(false);
let entityId: any; let entityId: any;
const routeStore = useRouteStore();
let link: any; let link: any;
let speed = 0; let speed = 0;
let text = ''; let text = '';
const personList = ref([]);
const modelData = ref([
[122.04736846370741, 37.48958083145254],
[122.04760069379522, 37.489226301608184],
[122.04823299200363, 37.489451482540346],
[122.04802271634016, 37.48983410372907],
[122.04748237248322, 37.49016152294277]
]);
const options = [ const options = [
{ {
...@@ -78,7 +76,6 @@ const options = [ ...@@ -78,7 +76,6 @@ const options = [
} }
]; ];
const value = ref(options.map(opt => opt.value)); const value = ref(options.map(opt => opt.value));
const data = ref([]); const data = ref([]);
const datasouce = ref(); const datasouce = ref();
const fence = ref<any>(); const fence = ref<any>();
...@@ -99,6 +96,50 @@ const labelData = ref<any>(); ...@@ -99,6 +96,50 @@ const labelData = ref<any>();
const formData = ref([]); const formData = ref([]);
// zhaojunbao 开始 // zhaojunbao 开始
const activeAlarm = ref(false);
const alarmStatus = ref(0); // 新增:控制声光报警开关状态 0 关 1 开
const isRequesting = ref(false); // 新增:防止重复点击
// 新增:获取声光报警状态
const getAlarmStatus = async () => {
try {
const res = await getAlarmStatusApi();
// console.log('获取声光报警状态成功:', res);
if (res.data.code === 200) {
alarmStatus.value = res.data.data;
}
} catch (error) {
console.error('获取声光报警状态失败:', error);
}
};
// 新增:切换声光报警状态
const toggleAlarmStatus = async () => {
// 防止重复点击
if (isRequesting.value) {
return;
}
isRequesting.value = true;
try {
let newStatus = alarmStatus.value === 0 ? 1 : 0;
const res = await setAlarmStatusApi(newStatus);
if (res.data.code === 200) {
alarmStatus.value = newStatus;
} else {
// console.error('设置声光报警状态失败:', res.data.message);
message.error(res.data.data);
}
} catch (error) {
console.error('设置声光报警状态异常:', error);
} finally {
// 请求完成后重置标志
isRequesting.value = false;
}
};
/** 新增:修改报警状态结束 */
// REM自适应配置 // REM自适应配置
const active = ref(false); const active = ref(false);
const REM_CONFIG = { const REM_CONFIG = {
...@@ -108,8 +149,25 @@ const REM_CONFIG = { ...@@ -108,8 +149,25 @@ const REM_CONFIG = {
// 基准值:1rem = 100px // 基准值:1rem = 100px
baseSize: 100 baseSize: 100
}; };
// 跳转首页 // 动态路由
const navTo = () => { const navTo = async () => {
let result = routeStore.menus;
let getStorage = localStorage.getItem('loginId');
if(!getStorage) {
window.location.href = '/login';
}
let res = await api_getRoleId(getStorage);
let menus = res.data.data.permissionIds;
const routeList: any = []
for (let item of result) {
let res = menus.find(data => data.menuPath == item.key);
if (res) {
routeList.push(item);
}
}
localStg.set('routerList', routeList)
window.location.href = '/home'; window.location.href = '/home';
}; };
...@@ -559,46 +617,79 @@ async function setTimePerson() { ...@@ -559,46 +617,79 @@ async function setTimePerson() {
} }
iconPoint(viewer, pins); iconPoint(viewer, pins);
} }
setInterval(setTimePerson, 2 * 60 * 1000); setInterval(setTimePerson, 20 * 1000);
// setInterval(setTimePerson, 2 * 60 * 1000);
onMounted(async () => { onMounted(async () => {
await getAlarmStatus(); // 获取报警状态
add3dtiles(); add3dtiles();
pointLine(viewer);
setTimeout(async () => { setTimeout(async () => {
fenceListGet(); fenceListGet();
const res = await getPointAllPersonApi(); const res = await getPointAllPersonApi();
const personData = res.data.data; const personData = res.data.data;
console.log('--1--', personData);
personData.map(item => { personData.map(item => {
pins.push({ const createTime = new Date(item.createTime);
id: item.cardId, const now = new Date();
name: item.realName,
type: 1, // 计算两个时间的差值(毫秒)
image: bluePersonIcon, const diffInMs = now - createTime;
position: {
lon: item.lon, // 转换为分钟
lat: item.lat const diffInMinutes = diffInMs / (1000 * 60);
},
data: item,
entity: null // 判断是否超过3分钟
}); if (diffInMinutes > 3) {
} else {
pins.push({
id: item.cardId,
name: item.realName,
type: 1,
image: bluePersonIcon,
createTime: item.createTime,
position: {
lon: item.lon,
lat: item.lat
},
data: item,
entity: null
});
}
}); });
// 获取并显示车辆数据,使用不同的前缀 // 获取并显示车辆数据,使用不同的前缀
const resCar = await getCarPointAllCarApi(); const resCar = await getCarPointAllCarApi();
const carData = resCar.data.data; const carData = resCar.data.data;
carData.map(item => { carData.map(item => {
pins.push({ const createTime = new Date(item.createTime);
id: item.carNumber, const now = new Date();
name: item.carNumber, // 计算两个时间的差值(毫秒)
type: 2, const diffInMs = now - createTime;
image: blueCarIcon, // 转换为天数
position: { const diffInDays = diffInMs / (1000 * 60);
lon: item.lon,
lat: item.lat // 判断是否超过20分钟
}, if (diffInDays > 20) {
data: item,
entity: null } else {
}); pins.push({
id: item.carNumber,
name: item.carNumber,
type: 2,
image: blueCarIcon,
position: {
lon: item.lon,
lat: item.lat
},
data: item,
entity: null
});
}
}); });
// 获取在线监测 // 获取在线监测
...@@ -639,7 +730,7 @@ onMounted(async () => { ...@@ -639,7 +730,7 @@ onMounted(async () => {
}); });
iconPoint(viewer, pins).then(result => { iconPoint(viewer, pins).then(result => {
console.log(result); console.log('--2--',result);
}); });
}, 2000); }, 2000);
// setTimePerson(); // setTimePerson();
...@@ -647,7 +738,6 @@ onMounted(async () => { ...@@ -647,7 +738,6 @@ onMounted(async () => {
setRemUnit(); setRemUnit();
// 监听窗口大小变化 // 监听窗口大小变化
window.addEventListener('resize', setRemUnit); window.addEventListener('resize', setRemUnit);
// zhaojunbao 结束 // zhaojunbao 结束
const handler = new Cesium.ScreenSpaceEventHandler(viewer.scene.canvas); const handler = new Cesium.ScreenSpaceEventHandler(viewer.scene.canvas);
...@@ -724,7 +814,7 @@ onMounted(async () => { ...@@ -724,7 +814,7 @@ onMounted(async () => {
console.log(labelData.value); console.log(labelData.value);
const webRtcServrce = ref(); const webRtcServrce = ref();
nextTick(() => { nextTick(() => {
webRtcServrce.value = new WebRtcStreamer('video', `${location.protocol}//` + `192.168.2.53:8000`); webRtcServrce.value = new WebRtcStreamer('video', `${location.protocol}//` + `192.168.2.67:8000`);
webRtcServrce.value.connect(res.data.data.videoStream); webRtcServrce.value.connect(res.data.data.videoStream);
}); });
} }
...@@ -749,7 +839,7 @@ onUnmounted(() => { ...@@ -749,7 +839,7 @@ onUnmounted(() => {
viewer.destroy(); viewer.destroy();
viewer = null; viewer = null;
} }
// 移除窗口大小变化监听 // 移除窗口大小变化监听
window.removeEventListener('resize', setRemUnit); window.removeEventListener('resize', setRemUnit);
...@@ -761,9 +851,11 @@ onUnmounted(() => { ...@@ -761,9 +851,11 @@ onUnmounted(() => {
<template> <template>
<div class="wrapper"> <div class="wrapper">
<div class="top-toolbar"> <div class="top-toolbar">
<div class="baojing"> <div class="baojing" @click="toggleAlarmStatus">
声光报警 声光报警
<NSwitch v-model:value="active" /> <!-- <NSwitch v-model:value="active" /> -->
<img src="@/assets/jinrun/open.png" alt="" srcset="" v-show="alarmStatus == 1">
<img src="@/assets/jinrun/close.png" alt="" srcset="" v-show="alarmStatus == 0">
</div> </div>
<!-- <i class="split-line"></i> --> <!-- <i class="split-line"></i> -->
...@@ -874,7 +966,6 @@ onUnmounted(() => { ...@@ -874,7 +966,6 @@ onUnmounted(() => {
allowfullscreen="true" allowfullscreen="true"
allowtransparency="true" allowtransparency="true"
allow="autoplay" allow="autoplay"
scrolling="no"
:src="link" :src="link"
width="100%" width="100%"
height="100%" height="100%"
...@@ -1037,7 +1128,7 @@ onUnmounted(() => { ...@@ -1037,7 +1128,7 @@ onUnmounted(() => {
<!-- 非cesium相关 结束 --> <!-- 非cesium相关 结束 -->
</template> </template>
<style scoped> <style scoped lang="scss">
html, html,
body { body {
width: 100%; width: 100%;
...@@ -1241,9 +1332,9 @@ span { ...@@ -1241,9 +1332,9 @@ span {
/* zhaojunbao */ /* zhaojunbao */
.top-toolbar { .top-toolbar {
position: absolute; position: absolute;
top: 0.5rem; top: 0.44rem;
right: 0.5rem; right: 0.5rem;
width: 240px; width: 300px;
height: 0.4rem; height: 0.4rem;
color: #11e0ff; color: #11e0ff;
z-index: 99999; z-index: 99999;
...@@ -1258,9 +1349,24 @@ span { ...@@ -1258,9 +1349,24 @@ span {
} }
.baojing { .baojing {
.alarmTxt{
font-size: 0.18rem;
display: inline-block;
width: 100px;
}
position: relative; position: relative;
padding-left: 25px; padding-left: 25px;
display: block; display: block;
display: flex;
justify-content: start;
align-items: center;
height: 20px;
img{
width: 0.5rem;
height: 0.22rem;
cursor: pointer;
margin-left: 10px;
}
&::before { &::before {
content: ''; content: '';
......
...@@ -41,13 +41,17 @@ async function handleSubmit() { ...@@ -41,13 +41,17 @@ async function handleSubmit() {
const res = await api_loginPost(model); const res = await api_loginPost(model);
if (res.data.code == 200) { if (res.data.code == 200) {
// 模拟loginByToken的逻辑 // 模拟loginByToken的逻辑
localStorage.setItem('loginId', res.data.data.roleId);
localStorage.setItem('token', res.data.data.token); localStorage.setItem('token', res.data.data.token);
window.$notification?.success({ window.$notification?.success({
title: '登录成功', title: '登录成功',
content: '欢迎回来,登录已完成', content: '欢迎回来,登录已完成',
duration: 3000 duration: 3000,
style: {
zIndex: 9999
}
}); });
router.push('/home'); router.push('/cesiumDeom');
} else { } else {
window.$notification?.error({ window.$notification?.error({
title: '登录失败', title: '登录失败',
......
...@@ -3,6 +3,8 @@ import { api_tokenGet } from '@/api'; ...@@ -3,6 +3,8 @@ import { api_tokenGet } from '@/api';
import { useMessage } from 'naive-ui'; import { useMessage } from 'naive-ui';
import { onMounted } from 'vue'; import { onMounted } from 'vue';
const baseUrl = import.meta.env.VITE_AI_URL;
onMounted(async () => { onMounted(async () => {
const message = useMessage(); const message = useMessage();
let res = await api_tokenGet() let res = await api_tokenGet()
...@@ -13,7 +15,7 @@ onMounted(async () => { ...@@ -13,7 +15,7 @@ onMounted(async () => {
</script> </script>
<template> <template>
<iframe allowfullscreen="true" allowtransparency="true" allow="autoplay" scrolling="no" src="http://192.168.2.54:9528/large" frameborder="0"></iframe> <iframe allowfullscreen="true" allowtransparency="true" allow="autoplay" :src="`${baseUrl}/large`" frameborder="0"></iframe>
</template> </template>
<style scoped></style> <style scoped></style>
\ No newline at end of file
...@@ -3,6 +3,8 @@ import { api_tokenGet } from '@/api'; ...@@ -3,6 +3,8 @@ import { api_tokenGet } from '@/api';
import { useMessage } from 'naive-ui'; import { useMessage } from 'naive-ui';
import { onMounted } from 'vue'; import { onMounted } from 'vue';
const baseUrl = import.meta.env.VITE_AI_URL;
onMounted(async () => { onMounted(async () => {
const message = useMessage(); const message = useMessage();
let res = await api_tokenGet() let res = await api_tokenGet()
...@@ -13,7 +15,7 @@ onMounted(async () => { ...@@ -13,7 +15,7 @@ onMounted(async () => {
</script> </script>
<template> <template>
<iframe src="http://192.168.2.54:9528/result" frameborder="0"></iframe> <iframe allowfullscreen="true" allowtransparency="true" allow="autoplay" :src="`${baseUrl}/result`" frameborder="0"></iframe>
</template> </template>
<style scoped></style> <style scoped></style>
...@@ -3,6 +3,8 @@ import { api_tokenGet } from '@/api'; ...@@ -3,6 +3,8 @@ import { api_tokenGet } from '@/api';
import { useMessage } from 'naive-ui'; import { useMessage } from 'naive-ui';
import { onMounted } from 'vue'; import { onMounted } from 'vue';
const baseUrl = import.meta.env.VITE_AI_URL;
onMounted(async () => { onMounted(async () => {
const message = useMessage(); const message = useMessage();
let res = await api_tokenGet() let res = await api_tokenGet()
...@@ -13,7 +15,7 @@ onMounted(async () => { ...@@ -13,7 +15,7 @@ onMounted(async () => {
</script> </script>
<template> <template>
<iframe allowfullscreen="true" allowtransparency="true" allow="autoplay" scrolling="no" src="http://192.168.2.54:9528/camera" frameborder="0"></iframe> <iframe allowfullscreen="true" allowtransparency="true" allow="autoplay" :src="`${baseUrl}/camera`" frameborder="0"></iframe>
</template> </template>
<style scoped></style> <style scoped></style>
<template> <template>
<iframe src="http://192.168.2.54:9528/videos" frameborder="0"></iframe> <iframe allowfullscreen="true" allowtransparency="true" allow="autoplay" :src="`${baseUrl}/videos`" frameborder="0"></iframe>
</template> </template>
<script lang="ts" setup> <script lang="ts" setup>
...@@ -7,6 +7,8 @@ import { api_tokenGet } from '@/api'; ...@@ -7,6 +7,8 @@ import { api_tokenGet } from '@/api';
import { useMessage } from 'naive-ui'; import { useMessage } from 'naive-ui';
import { onMounted } from 'vue'; import { onMounted } from 'vue';
const baseUrl = import.meta.env.VITE_AI_URL;
onMounted(async () => { onMounted(async () => {
const message = useMessage(); const message = useMessage();
let res = await api_tokenGet() let res = await api_tokenGet()
......
<template> <template>
<iframe src="http://192.168.2.54:9528/arithmetic" frameborder="0"></iframe> <iframe allowfullscreen="true" allowtransparency="true" allow="autoplay" :src="`${baseUrl}/arithmetic`" frameborder="0"></iframe>
</template> </template>
<script lang="ts" setup> <script lang="ts" setup>
...@@ -7,6 +7,8 @@ import { api_tokenGet } from '@/api'; ...@@ -7,6 +7,8 @@ import { api_tokenGet } from '@/api';
import { useMessage } from 'naive-ui'; import { useMessage } from 'naive-ui';
import { onMounted } from 'vue'; import { onMounted } from 'vue';
const baseUrl = import.meta.env.VITE_AI_URL;
onMounted(async () => { onMounted(async () => {
const message = useMessage(); const message = useMessage();
let res = await api_tokenGet() let res = await api_tokenGet()
......
<template> <template>
<iframe src="http://192.168.2.54:9528/remind" frameborder="0"></iframe> <iframe allowfullscreen="true" allowtransparency="true" allow="autoplay" :src="`${baseUrl}/remind`" frameborder="0"></iframe>
</template> </template>
<script lang="ts" setup> <script lang="ts" setup>
...@@ -7,6 +7,8 @@ import { api_tokenGet } from '@/api'; ...@@ -7,6 +7,8 @@ import { api_tokenGet } from '@/api';
import { useMessage } from 'naive-ui'; import { useMessage } from 'naive-ui';
import { onMounted } from 'vue'; import { onMounted } from 'vue';
const baseUrl = import.meta.env.VITE_AI_URL;
onMounted(async () => { onMounted(async () => {
const message = useMessage(); const message = useMessage();
let res = await api_tokenGet() let res = await api_tokenGet()
......
<template> <template>
<iframe src="http://192.168.2.54:9528/pushmessage" frameborder="0"></iframe> <iframe allowfullscreen="true" allowtransparency="true" allow="autoplay" :src="`${baseUrl}/pushmessage`" frameborder="0"></iframe>
</template> </template>
<script lang="ts" setup> <script lang="ts" setup>
...@@ -7,6 +7,8 @@ import { api_tokenGet } from '@/api'; ...@@ -7,6 +7,8 @@ import { api_tokenGet } from '@/api';
import { useMessage } from 'naive-ui'; import { useMessage } from 'naive-ui';
import { onMounted } from 'vue'; import { onMounted } from 'vue';
const baseUrl = import.meta.env.VITE_AI_URL;
onMounted(async () => { onMounted(async () => {
const message = useMessage(); const message = useMessage();
let res = await api_tokenGet() let res = await api_tokenGet()
......
<template> <template>
<iframe src="http://192.168.2.15:81/dataMonitor/bmwy/history" frameborder="0"></iframe> <iframe :src="`${baseUrl}/dataMonitor/bmwy/history`" frameborder="0"></iframe>
</template> </template>
<script lang="ts" setup> <script lang="ts" setup>
...@@ -7,6 +7,8 @@ import { api_tokenGet } from '@/api'; ...@@ -7,6 +7,8 @@ import { api_tokenGet } from '@/api';
import { useMessage } from 'naive-ui'; import { useMessage } from 'naive-ui';
import { onMounted } from 'vue'; import { onMounted } from 'vue';
const baseUrl = import.meta.env.VITE_CASTING_URL;
onMounted(async () => { onMounted(async () => {
const message = useMessage(); const message = useMessage();
let res = await api_tokenGet() let res = await api_tokenGet()
......
<template> <template>
<iframe src="http://192.168.2.15:81/dataMonitor/jyl/history" frameborder="0"></iframe> <iframe :src="`${baseUrl}/dataMonitor/jyl/history`" frameborder="0"></iframe>
</template> </template>
<script lang="ts" setup> <script lang="ts" setup>
...@@ -7,6 +7,8 @@ import { api_tokenGet } from '@/api'; ...@@ -7,6 +7,8 @@ import { api_tokenGet } from '@/api';
import { useMessage } from 'naive-ui'; import { useMessage } from 'naive-ui';
import { onMounted } from 'vue'; import { onMounted } from 'vue';
const baseUrl = import.meta.env.VITE_CASTING_URL;
onMounted(async () => { onMounted(async () => {
const message = useMessage(); const message = useMessage();
let res = await api_tokenGet() let res = await api_tokenGet()
......
<template> <template>
<iframe style="width: 100%; height: 100%;" src="http://192.168.2.15:81/index" frameborder="0"></iframe> <iframe style="width: 100%; height: 100%;" :src="`${baseUrl}/index`" frameborder="0"></iframe>
</template> </template>
<script lang="ts" setup> <script lang="ts" setup>
...@@ -7,6 +7,8 @@ import { api_tokenGet } from '@/api'; ...@@ -7,6 +7,8 @@ import { api_tokenGet } from '@/api';
import { useMessage } from 'naive-ui'; import { useMessage } from 'naive-ui';
import { onMounted } from 'vue'; import { onMounted } from 'vue';
const baseUrl = import.meta.env.VITE_CASTING_URL;
onMounted(async () => { onMounted(async () => {
const message = useMessage(); const message = useMessage();
let res = await api_tokenGet() let res = await api_tokenGet()
......
<template> <template>
<iframe src="http://192.168.2.15:81/personMonitor/valueInput" frameborder="0"></iframe> <iframe :src="`${baseUrl}/personMonitor/valueInput`" frameborder="0"></iframe>
</template> </template>
<script lang="ts" setup> <script lang="ts" setup>
...@@ -7,6 +7,8 @@ import { api_tokenGet } from '@/api'; ...@@ -7,6 +7,8 @@ import { api_tokenGet } from '@/api';
import { useMessage } from 'naive-ui'; import { useMessage } from 'naive-ui';
import { onMounted } from 'vue'; import { onMounted } from 'vue';
const baseUrl = import.meta.env.VITE_CASTING_URL;
onMounted(async () => { onMounted(async () => {
const message = useMessage(); const message = useMessage();
let res = await api_tokenGet() let res = await api_tokenGet()
......
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
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