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
# 人员定位 -- 前后端
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;
......
...@@ -33,3 +33,24 @@ export const create3D = async (viewer: any, url: any, height = 0) => { ...@@ -33,3 +33,24 @@ export const create3D = async (viewer: any, url: any, height = 0) => {
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;
...@@ -225,7 +227,6 @@ export async function startVehicleMovement(viewer: any, totalDuration: number) { ...@@ -225,7 +227,6 @@ export async function startVehicleMovement(viewer: any, totalDuration: number) {
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
......
...@@ -19,24 +19,10 @@ declare module 'vue' { ...@@ -19,24 +19,10 @@ declare module 'vue' {
DarkModeContainer: typeof import('./../components/common/dark-mode-container.vue')['default'] DarkModeContainer: typeof import('./../components/common/dark-mode-container.vue')['default']
ExceptionBase: typeof import('./../components/common/exception-base.vue')['default'] ExceptionBase: typeof import('./../components/common/exception-base.vue')['default']
FullScreen: typeof import('./../components/common/full-screen.vue')['default'] FullScreen: typeof import('./../components/common/full-screen.vue')['default']
IconAntDesignEnterOutlined: typeof import('~icons/ant-design/enter-outlined')['default']
IconAntDesignReloadOutlined: typeof import('~icons/ant-design/reload-outlined')['default'] IconAntDesignReloadOutlined: typeof import('~icons/ant-design/reload-outlined')['default']
IconGridiconsFullscreen: typeof import('~icons/gridicons/fullscreen')['default'] IconGridiconsFullscreen: typeof import('~icons/gridicons/fullscreen')['default']
IconGridiconsFullscreenExit: typeof import('~icons/gridicons/fullscreen-exit')['default'] IconGridiconsFullscreenExit: typeof import('~icons/gridicons/fullscreen-exit')['default']
'IconIc:baselineFileDownload': typeof import('~icons/ic/baseline-file-download')['default']
'IconIc:baselinePlus': typeof import('~icons/ic/baseline-plus')['default']
'IconIc:roundClose': typeof import('~icons/ic/round-close')['default']
'IconIc:roundFileUpload': typeof import('~icons/ic/round-file-upload')['default']
'IconIc:roundTableView': typeof import('~icons/ic/round-table-view')['default']
'IconIc:twotoneFormatListBulleted': typeof import('~icons/ic/twotone-format-list-bulleted')['default']
IconLocalBanner: typeof import('~icons/local/banner')['default']
IconLocalLogo: typeof import('~icons/local/logo')['default']
IconMdiArrowDownThin: typeof import('~icons/mdi/arrow-down-thin')['default']
IconMdiArrowUpThin: typeof import('~icons/mdi/arrow-up-thin')['default']
IconMdiKeyboardEsc: typeof import('~icons/mdi/keyboard-esc')['default']
IconMdiKeyboardReturn: typeof import('~icons/mdi/keyboard-return')['default']
IconTooltip: typeof import('./../components/common/icon-tooltip.vue')['default'] IconTooltip: typeof import('./../components/common/icon-tooltip.vue')['default']
IconUilSearch: typeof import('~icons/uil/search')['default']
LangSwitch: typeof import('./../components/common/lang-switch.vue')['default'] LangSwitch: typeof import('./../components/common/lang-switch.vue')['default']
LeftDeviceStatus: typeof import('./../components/MineMonitor/LeftDeviceStatus.vue')['default'] LeftDeviceStatus: typeof import('./../components/MineMonitor/LeftDeviceStatus.vue')['default']
LeftOnlineMonitor: typeof import('./../components/MineMonitor/LeftOnlineMonitor.vue')['default'] LeftOnlineMonitor: typeof import('./../components/MineMonitor/LeftOnlineMonitor.vue')['default']
...@@ -49,12 +35,10 @@ declare module 'vue' { ...@@ -49,12 +35,10 @@ declare module 'vue' {
NBreadcrumb: typeof import('naive-ui')['NBreadcrumb'] NBreadcrumb: typeof import('naive-ui')['NBreadcrumb']
NBreadcrumbItem: typeof import('naive-ui')['NBreadcrumbItem'] NBreadcrumbItem: typeof import('naive-ui')['NBreadcrumbItem']
NButton: typeof import('naive-ui')['NButton'] NButton: typeof import('naive-ui')['NButton']
NButtonGroup: typeof import('naive-ui')['NButtonGroup']
NCard: typeof import('naive-ui')['NCard'] NCard: typeof import('naive-ui')['NCard']
NCheckbox: typeof import('naive-ui')['NCheckbox'] NCheckbox: typeof import('naive-ui')['NCheckbox']
NCol: typeof import('naive-ui')['NCol'] NCol: typeof import('naive-ui')['NCol']
NColorPicker: typeof import('naive-ui')['NColorPicker'] NColorPicker: typeof import('naive-ui')['NColorPicker']
NConfigProvider: typeof import('naive-ui')['NConfigProvider']
NDataTable: typeof import('naive-ui')['NDataTable'] NDataTable: typeof import('naive-ui')['NDataTable']
NDatePicker: typeof import('naive-ui')['NDatePicker'] NDatePicker: typeof import('naive-ui')['NDatePicker']
NDialogProvider: typeof import('naive-ui')['NDialogProvider'] NDialogProvider: typeof import('naive-ui')['NDialogProvider']
...@@ -62,42 +46,26 @@ declare module 'vue' { ...@@ -62,42 +46,26 @@ declare module 'vue' {
NDrawer: typeof import('naive-ui')['NDrawer'] NDrawer: typeof import('naive-ui')['NDrawer']
NDrawerContent: typeof import('naive-ui')['NDrawerContent'] NDrawerContent: typeof import('naive-ui')['NDrawerContent']
NDropdown: typeof import('naive-ui')['NDropdown'] NDropdown: typeof import('naive-ui')['NDropdown']
NEmpty: typeof import('naive-ui')['NEmpty']
NFlex: typeof import('naive-ui')['NFlex'] NFlex: typeof import('naive-ui')['NFlex']
NForm: typeof import('naive-ui')['NForm'] NForm: typeof import('naive-ui')['NForm']
NFormItem: typeof import('naive-ui')['NFormItem'] NFormItem: typeof import('naive-ui')['NFormItem']
NGi: typeof import('naive-ui')['NGi']
NGrid: typeof import('naive-ui')['NGrid']
NIcon: typeof import('naive-ui')['NIcon'] NIcon: typeof import('naive-ui')['NIcon']
NInfiniteScroll: typeof import('naive-ui')['NInfiniteScroll']
NInput: typeof import('naive-ui')['NInput'] NInput: typeof import('naive-ui')['NInput']
NInputGroup: typeof import('naive-ui')['NInputGroup']
NInputNumber: typeof import('naive-ui')['NInputNumber'] NInputNumber: typeof import('naive-ui')['NInputNumber']
NList: typeof import('naive-ui')['NList']
NListItem: typeof import('naive-ui')['NListItem']
NLoadingBarProvider: typeof import('naive-ui')['NLoadingBarProvider'] NLoadingBarProvider: typeof import('naive-ui')['NLoadingBarProvider']
NMenu: typeof import('naive-ui')['NMenu'] NMenu: typeof import('naive-ui')['NMenu']
NMessageProvider: typeof import('naive-ui')['NMessageProvider'] NMessageProvider: typeof import('naive-ui')['NMessageProvider']
NModal: typeof import('naive-ui')['NModal'] NModal: typeof import('naive-ui')['NModal']
NNotificationProvider: typeof import('naive-ui')['NNotificationProvider'] NNotificationProvider: typeof import('naive-ui')['NNotificationProvider']
NPagination: typeof import('naive-ui')['NPagination']
NPopover: typeof import('naive-ui')['NPopover']
NPopselect: typeof import('naive-ui')['NPopselect']
NRadio: typeof import('naive-ui')['NRadio']
NRadioGroup: typeof import('naive-ui')['NRadioGroup'] NRadioGroup: typeof import('naive-ui')['NRadioGroup']
NRow: typeof import('naive-ui')['NRow'] NRow: typeof import('naive-ui')['NRow']
NSc: typeof import('naive-ui')['NSc']
NScord: typeof import('naive-ui')['NScord']
NScrollbar: typeof import('naive-ui')['NScrollbar'] NScrollbar: typeof import('naive-ui')['NScrollbar']
NSelect: typeof import('naive-ui')['NSelect'] NSelect: typeof import('naive-ui')['NSelect']
NSpace: typeof import('naive-ui')['NSpace'] NSpace: typeof import('naive-ui')['NSpace']
NSpaceNCOl: typeof import('naive-ui')['NSpaceNCOl']
NSpin: typeof import('naive-ui')['NSpin'] NSpin: typeof import('naive-ui')['NSpin']
NStatistic: typeof import('naive-ui')['NStatistic']
NSwitch: typeof import('naive-ui')['NSwitch'] NSwitch: typeof import('naive-ui')['NSwitch']
NTab: typeof import('naive-ui')['NTab'] NTab: typeof import('naive-ui')['NTab']
NTabs: typeof import('naive-ui')['NTabs'] NTabs: typeof import('naive-ui')['NTabs']
NThing: typeof import('naive-ui')['NThing']
NTooltip: typeof import('naive-ui')['NTooltip'] NTooltip: typeof import('naive-ui')['NTooltip']
NTree: typeof import('naive-ui')['NTree'] NTree: typeof import('naive-ui')['NTree']
NTreeSelect: typeof import('naive-ui')['NTreeSelect'] NTreeSelect: typeof import('naive-ui')['NTreeSelect']
...@@ -129,24 +97,10 @@ declare global { ...@@ -129,24 +97,10 @@ declare global {
const DarkModeContainer: typeof import('./../components/common/dark-mode-container.vue')['default'] const DarkModeContainer: typeof import('./../components/common/dark-mode-container.vue')['default']
const ExceptionBase: typeof import('./../components/common/exception-base.vue')['default'] const ExceptionBase: typeof import('./../components/common/exception-base.vue')['default']
const FullScreen: typeof import('./../components/common/full-screen.vue')['default'] const FullScreen: typeof import('./../components/common/full-screen.vue')['default']
const IconAntDesignEnterOutlined: typeof import('~icons/ant-design/enter-outlined')['default']
const IconAntDesignReloadOutlined: typeof import('~icons/ant-design/reload-outlined')['default'] const IconAntDesignReloadOutlined: typeof import('~icons/ant-design/reload-outlined')['default']
const IconGridiconsFullscreen: typeof import('~icons/gridicons/fullscreen')['default'] const IconGridiconsFullscreen: typeof import('~icons/gridicons/fullscreen')['default']
const IconGridiconsFullscreenExit: typeof import('~icons/gridicons/fullscreen-exit')['default'] const IconGridiconsFullscreenExit: typeof import('~icons/gridicons/fullscreen-exit')['default']
const 'IconIc:baselineFileDownload': typeof import('~icons/ic/baseline-file-download')['default']
const 'IconIc:baselinePlus': typeof import('~icons/ic/baseline-plus')['default']
const 'IconIc:roundClose': typeof import('~icons/ic/round-close')['default']
const 'IconIc:roundFileUpload': typeof import('~icons/ic/round-file-upload')['default']
const 'IconIc:roundTableView': typeof import('~icons/ic/round-table-view')['default']
const 'IconIc:twotoneFormatListBulleted': typeof import('~icons/ic/twotone-format-list-bulleted')['default']
const IconLocalBanner: typeof import('~icons/local/banner')['default']
const IconLocalLogo: typeof import('~icons/local/logo')['default']
const IconMdiArrowDownThin: typeof import('~icons/mdi/arrow-down-thin')['default']
const IconMdiArrowUpThin: typeof import('~icons/mdi/arrow-up-thin')['default']
const IconMdiKeyboardEsc: typeof import('~icons/mdi/keyboard-esc')['default']
const IconMdiKeyboardReturn: typeof import('~icons/mdi/keyboard-return')['default']
const IconTooltip: typeof import('./../components/common/icon-tooltip.vue')['default'] const IconTooltip: typeof import('./../components/common/icon-tooltip.vue')['default']
const IconUilSearch: typeof import('~icons/uil/search')['default']
const LangSwitch: typeof import('./../components/common/lang-switch.vue')['default'] const LangSwitch: typeof import('./../components/common/lang-switch.vue')['default']
const LeftDeviceStatus: typeof import('./../components/MineMonitor/LeftDeviceStatus.vue')['default'] const LeftDeviceStatus: typeof import('./../components/MineMonitor/LeftDeviceStatus.vue')['default']
const LeftOnlineMonitor: typeof import('./../components/MineMonitor/LeftOnlineMonitor.vue')['default'] const LeftOnlineMonitor: typeof import('./../components/MineMonitor/LeftOnlineMonitor.vue')['default']
...@@ -159,12 +113,10 @@ declare global { ...@@ -159,12 +113,10 @@ declare global {
const NBreadcrumb: typeof import('naive-ui')['NBreadcrumb'] const NBreadcrumb: typeof import('naive-ui')['NBreadcrumb']
const NBreadcrumbItem: typeof import('naive-ui')['NBreadcrumbItem'] const NBreadcrumbItem: typeof import('naive-ui')['NBreadcrumbItem']
const NButton: typeof import('naive-ui')['NButton'] const NButton: typeof import('naive-ui')['NButton']
const NButtonGroup: typeof import('naive-ui')['NButtonGroup']
const NCard: typeof import('naive-ui')['NCard'] const NCard: typeof import('naive-ui')['NCard']
const NCheckbox: typeof import('naive-ui')['NCheckbox'] const NCheckbox: typeof import('naive-ui')['NCheckbox']
const NCol: typeof import('naive-ui')['NCol'] const NCol: typeof import('naive-ui')['NCol']
const NColorPicker: typeof import('naive-ui')['NColorPicker'] const NColorPicker: typeof import('naive-ui')['NColorPicker']
const NConfigProvider: typeof import('naive-ui')['NConfigProvider']
const NDataTable: typeof import('naive-ui')['NDataTable'] const NDataTable: typeof import('naive-ui')['NDataTable']
const NDatePicker: typeof import('naive-ui')['NDatePicker'] const NDatePicker: typeof import('naive-ui')['NDatePicker']
const NDialogProvider: typeof import('naive-ui')['NDialogProvider'] const NDialogProvider: typeof import('naive-ui')['NDialogProvider']
...@@ -172,42 +124,26 @@ declare global { ...@@ -172,42 +124,26 @@ declare global {
const NDrawer: typeof import('naive-ui')['NDrawer'] const NDrawer: typeof import('naive-ui')['NDrawer']
const NDrawerContent: typeof import('naive-ui')['NDrawerContent'] const NDrawerContent: typeof import('naive-ui')['NDrawerContent']
const NDropdown: typeof import('naive-ui')['NDropdown'] const NDropdown: typeof import('naive-ui')['NDropdown']
const NEmpty: typeof import('naive-ui')['NEmpty']
const NFlex: typeof import('naive-ui')['NFlex'] const NFlex: typeof import('naive-ui')['NFlex']
const NForm: typeof import('naive-ui')['NForm'] const NForm: typeof import('naive-ui')['NForm']
const NFormItem: typeof import('naive-ui')['NFormItem'] const NFormItem: typeof import('naive-ui')['NFormItem']
const NGi: typeof import('naive-ui')['NGi']
const NGrid: typeof import('naive-ui')['NGrid']
const NIcon: typeof import('naive-ui')['NIcon'] const NIcon: typeof import('naive-ui')['NIcon']
const NInfiniteScroll: typeof import('naive-ui')['NInfiniteScroll']
const NInput: typeof import('naive-ui')['NInput'] const NInput: typeof import('naive-ui')['NInput']
const NInputGroup: typeof import('naive-ui')['NInputGroup']
const NInputNumber: typeof import('naive-ui')['NInputNumber'] const NInputNumber: typeof import('naive-ui')['NInputNumber']
const NList: typeof import('naive-ui')['NList']
const NListItem: typeof import('naive-ui')['NListItem']
const NLoadingBarProvider: typeof import('naive-ui')['NLoadingBarProvider'] const NLoadingBarProvider: typeof import('naive-ui')['NLoadingBarProvider']
const NMenu: typeof import('naive-ui')['NMenu'] const NMenu: typeof import('naive-ui')['NMenu']
const NMessageProvider: typeof import('naive-ui')['NMessageProvider'] const NMessageProvider: typeof import('naive-ui')['NMessageProvider']
const NModal: typeof import('naive-ui')['NModal'] const NModal: typeof import('naive-ui')['NModal']
const NNotificationProvider: typeof import('naive-ui')['NNotificationProvider'] const NNotificationProvider: typeof import('naive-ui')['NNotificationProvider']
const NPagination: typeof import('naive-ui')['NPagination']
const NPopover: typeof import('naive-ui')['NPopover']
const NPopselect: typeof import('naive-ui')['NPopselect']
const NRadio: typeof import('naive-ui')['NRadio']
const NRadioGroup: typeof import('naive-ui')['NRadioGroup'] const NRadioGroup: typeof import('naive-ui')['NRadioGroup']
const NRow: typeof import('naive-ui')['NRow'] const NRow: typeof import('naive-ui')['NRow']
const NSc: typeof import('naive-ui')['NSc']
const NScord: typeof import('naive-ui')['NScord']
const NScrollbar: typeof import('naive-ui')['NScrollbar'] const NScrollbar: typeof import('naive-ui')['NScrollbar']
const NSelect: typeof import('naive-ui')['NSelect'] const NSelect: typeof import('naive-ui')['NSelect']
const NSpace: typeof import('naive-ui')['NSpace'] const NSpace: typeof import('naive-ui')['NSpace']
const NSpaceNCOl: typeof import('naive-ui')['NSpaceNCOl']
const NSpin: typeof import('naive-ui')['NSpin'] const NSpin: typeof import('naive-ui')['NSpin']
const NStatistic: typeof import('naive-ui')['NStatistic']
const NSwitch: typeof import('naive-ui')['NSwitch'] const NSwitch: typeof import('naive-ui')['NSwitch']
const NTab: typeof import('naive-ui')['NTab'] const NTab: typeof import('naive-ui')['NTab']
const NTabs: typeof import('naive-ui')['NTabs'] const NTabs: typeof import('naive-ui')['NTabs']
const NThing: typeof import('naive-ui')['NThing']
const NTooltip: typeof import('naive-ui')['NTooltip'] const NTooltip: typeof import('naive-ui')['NTooltip']
const NTree: typeof import('naive-ui')['NTree'] const NTree: typeof import('naive-ui')['NTree']
const NTreeSelect: typeof import('naive-ui')['NTreeSelect'] const NTreeSelect: typeof import('naive-ui')['NTreeSelect']
......
...@@ -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');
router.push('/login');
} else {
// 处理接收到的数据 // 处理接收到的数据
const data = recordObject; const data = recordObject;
console.log('111', data);
if (data.type == 'router') {
router.push({
path: '/personnel/track',
query: {
cardId: data.cardId
}
});
} else {
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')
// // },
// // () => '错误报警'
// // )
// // ])
// ])
// ])
]) ])
]) ])
}); });
} }
// 处理收到的消息 // 处理收到的消息
}; };
......
<script setup lang="ts"> <script setup lang="ts">
import { nextTick, onBeforeMount, onMounted, onUnmounted, ref, watch } from 'vue'; 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,
...@@ -12,46 +13,50 @@ ...@@ -12,46 +13,50 @@
getMonitorPointApi, getMonitorPointApi,
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';
import { iconPoint } from '@/api/utils/home/cesiumPositions'; import { iconPoint } from '@/api/utils/home/cesiumPositions';
import { carSpeed } from '@/api/utils/carSpeed'; import { carSpeed } from '@/api/utils/carSpeed';
import fullScreen from '@/utils/full'; import fullScreen from '@/utils/full';
import { webVideo } from '@/utils/ai'; import { webVideo } from '@/utils/ai';
import bluePersonIcon from '@/assets/blueperson.png'; import bluePersonIcon from '@/assets/blueperson.png';
import arrowLeftImg from '@/assets/jinrun/arrow-left.png'; import arrowLeftImg from '@/assets/jinrun/arrow-left.png';
import arrowRightImg from '@/assets/jinrun/arrow-right.png'; import arrowRightImg from '@/assets/jinrun/arrow-right.png';
import redCarIcon from '@/assets/icon15Red.png'; import redCarIcon from '@/assets/icon15Red.png';
import redVideoIcon from '@/assets/icon16Red.png'; import redVideoIcon from '@/assets/icon16Red.png';
import redBianIcon from '@/assets/icon17Red.png'; import redBianIcon from '@/assets/icon17Red.png';
import redPersonIcon from '../../../assets/redperson.png'; import blueCarIcon from '@/assets/icon15.png';
import blueCarIcon from '@/assets/icon15.png'; import blueVideoIcon from '@/assets/icon16.png';
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 MultiSelect from './appselect.vue'; import MultiSelect from './appselect.vue';
import { useRouteStore } from '@/store/modules/route';
let viewer: any = null; import { router } from '@/router';
const message = useMessage(); import { localStg } from '@/utils/storage';
let personEntity: any;
const pins: any = []; let viewer: any = null;
const full = ref(false); const message = useMessage();
let entityId: any; let personEntity: any;
let link: any; const pins: any = [];
let speed = 0; const full = ref(false);
let text = ''; let entityId: any;
const personList = ref([]); const routeStore = useRouteStore();
const modelData = ref([ let link: any;
let speed = 0;
let text = '';
const personList = ref([]);
const modelData = ref([
[122.04736846370741, 37.48958083145254], [122.04736846370741, 37.48958083145254],
[122.04760069379522, 37.489226301608184], [122.04760069379522, 37.489226301608184],
[122.04823299200363, 37.489451482540346], [122.04823299200363, 37.489451482540346],
[122.04802271634016, 37.48983410372907], [122.04802271634016, 37.48983410372907],
[122.04748237248322, 37.49016152294277] [122.04748237248322, 37.49016152294277]
]); ]);
const options = [ const options = [
{ {
label: '全选', label: '全选',
value: '1' value: '1'
...@@ -76,48 +81,64 @@ ...@@ -76,48 +81,64 @@
label: '越界开采', label: '越界开采',
value: '6' value: '6'
} }
]; ];
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>(); const personShow = ref(false);
const personShow = ref(false); const carShow = ref(false);
const carShow = ref(false); const equipmentShow = ref(false);
const equipmentShow = ref(false); const videoShow = ref(false);
const videoShow = ref(false); const treeFence = ref<any>([]);
const treeFence = ref<any>([]);
const wallEntities = ref<any[]>([]);
const wallEntities = ref<any[]>([]); const iconEntities = ref<any[]>([]);
const iconEntities = ref<any[]>([]); const fenceData = ref({
const fenceData = ref({
imagePath: '', imagePath: '',
imageColor: '' imageColor: ''
}); });
const labelData = ref<any>(); const labelData = ref<any>();
const formData = ref([]); const formData = ref([]);
// zhaojunbao 开始 // zhaojunbao 开始
// REM自适应配置 // REM自适应配置
const active = ref(false); const active = ref(false);
const REM_CONFIG = { const REM_CONFIG = {
// 设计稿宽度 // 设计稿宽度
designWidth: 1920, designWidth: 1920,
designHeight: 1080, designHeight: 1080,
// 基准值: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';
}; };
/** /**
* 设置REM单位 * 设置REM单位
* 根据窗口宽度动态计算根元素font-size * 根据窗口宽度动态计算根元素font-size
*/ */
const setRemUnit = () => { const setRemUnit = () => {
const { designWidth, designHeight, baseSize } = REM_CONFIG; const { designWidth, designHeight, baseSize } = REM_CONFIG;
// 获取当前窗口尺寸 // 获取当前窗口尺寸
const windowWidth = window.innerWidth; const windowWidth = window.innerWidth;
...@@ -133,19 +154,19 @@ ...@@ -133,19 +154,19 @@
// 设置根元素font-size,确保最小为50px(可选) // 设置根元素font-size,确保最小为50px(可选)
const fontSize = Math.max(baseSize * scale, 50); const fontSize = Math.max(baseSize * scale, 50);
document.documentElement.style.fontSize = `${fontSize}px`; document.documentElement.style.fontSize = `${fontSize}px`;
}; };
// 控制左右模块显示状态的响应式变量 // 控制左右模块显示状态的响应式变量
const isLeftModulesVisible = ref(true); const isLeftModulesVisible = ref(true);
const isRightModulesVisible = ref(true); const isRightModulesVisible = ref(true);
const toggleBothModules = () => { const toggleBothModules = () => {
isLeftModulesVisible.value = !isLeftModulesVisible.value; isLeftModulesVisible.value = !isLeftModulesVisible.value;
isRightModulesVisible.value = !isRightModulesVisible.value; isRightModulesVisible.value = !isRightModulesVisible.value;
}; };
// zhaojunbao 结束 // zhaojunbao 结束
// 模型 // 模型
function add3dtiles() { function add3dtiles() {
const CesiumConfig = { const CesiumConfig = {
defaultAccessToken: defaultAccessToken:
'eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJqdGkiOiI2NTE1OTUxOS1jNTc5LTQwNmMtOWU5My1jNTI3NTIyYzAxNTUiLCJpZCI6MjUwODM5LCJpYXQiOjE3Mjk5MjE1MzV9.xromwPD3oA1e0YsWV035DE5KmYvivkC6fxt344vwObA' 'eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJqdGkiOiI2NTE1OTUxOS1jNTc5LTQwNmMtOWU5My1jNTI3NTIyYzAxNTUiLCJpZCI6MjUwODM5LCJpYXQiOjE3Mjk5MjE1MzV9.xromwPD3oA1e0YsWV035DE5KmYvivkC6fxt344vwObA'
...@@ -176,10 +197,10 @@ ...@@ -176,10 +197,10 @@
getModel().then(item => { getModel().then(item => {
create3D(viewer, item, 0); create3D(viewer, item, 0);
}); });
} }
// 监听选中值的变化 // 监听选中值的变化
watch( watch(
value, value,
(newVal, oldVal) => { (newVal, oldVal) => {
// 防止无限递归 // 防止无限递归
...@@ -227,48 +248,61 @@ ...@@ -227,48 +248,61 @@
} }
}, },
{ deep: true } { deep: true }
); );
// 监听选择框的变化 // 监听选择框的变化
watch( watch(
value, value,
newValue => { newValue => {
// 如果选中了"全选",显示所有实体 // 如果选中了"全选",显示所有实体
if (newValue.includes('1')) { if (newValue.includes('1')) {
wallEntities.value.forEach(entity => (entity.show = true)); wallEntities.value.forEach(entity => (entity.show = true));
iconEntities.value.forEach(entity => (entity.show = true));
// 显示所有图标和标签
pins.forEach(pin => {
if (pin.entity) pin.entity.show = true;
if (pin.labelEntity) pin.labelEntity.show = true;
if (pin.backgroundEntity) pin.backgroundEntity.show = true;
});
} else { } else {
// 根据选中的选项显示对应实体 // 根据选中的选项显示对应实体
wallEntities.value.forEach(entity => { wallEntities.value.forEach(entity => {
entity.show = newValue.includes('6'); // 越界开采对应电子围栏 entity.show = newValue.includes('6'); // 越界开采对应电子围栏
}); });
iconEntities.value.forEach(entity => { // 根据选中的选项显示对应图标和标签
const type = entity.properties?.type?.getValue(); pins.forEach(pin => {
const type = pin.type;
let shouldShow = false;
switch (type) { switch (type) {
case 1: // 在线监测设备 case 1: // 人员定位
entity.show = newValue.includes('3'); shouldShow = newValue.includes('4');
break; break;
case 2: // 视频监控 case 2: // 车辆定位
entity.show = newValue.includes('4'); shouldShow = newValue.includes('5');
break; break;
case 3: // 车辆定位 case 3: // 在线监测设备
entity.show = newValue.includes('2'); shouldShow = newValue.includes('3');
break; break;
case 4: // 人员定位 case 4: // 视频监控
case 5: // 人员定位 shouldShow = newValue.includes('2');
entity.show = newValue.includes('1');
break; break;
default: default:
entity.show = false; shouldShow = false;
} }
// 设置图标和标签的显示状态
if (pin.entity) pin.entity.show = shouldShow;
if (pin.labelEntity) pin.labelEntity.show = shouldShow;
if (pin.backgroundEntity) pin.backgroundEntity.show = shouldShow;
}); });
} }
}, },
{ immediate: true } { immediate: true }
); );
async function fenceListGet() { async function fenceListGet() {
const res = await getFenceListsApi(); const res = await getFenceListsApi();
formData.value = res.data.data; formData.value = res.data.data;
...@@ -286,10 +320,10 @@ ...@@ -286,10 +320,10 @@
} }
electronic(positions, heights, item.rangeType); electronic(positions, heights, item.rangeType);
} }
} }
// 电子围栏 // 电子围栏
function electronic(position: any, heightData: any, rangeType: any) { function electronic(position: any, heightData: any, rangeType: any) {
function map_common_addDatasouce(datasouceName: string) { function map_common_addDatasouce(datasouceName: string) {
let datasouce = viewer.dataSources._dataSources.find(t => { let datasouce = viewer.dataSources._dataSources.find(t => {
return t && t.name == datasouceName; return t && t.name == datasouceName;
...@@ -464,35 +498,35 @@ ...@@ -464,35 +498,35 @@
window.fenceData = position; window.fenceData = position;
} }
loadWall(); loadWall();
} }
// 点击弹框隐藏 // 点击弹框隐藏
function videosShow() { function videosShow() {
if (videoShow.value == true) { if (videoShow.value == true) {
videoShow.value = false; videoShow.value = false;
iconShow(); iconShow();
} }
} }
function equipmentsShow() { function equipmentsShow() {
if (equipmentShow.value == true) { if (equipmentShow.value == true) {
equipmentShow.value = false; equipmentShow.value = false;
iconShow(); iconShow();
} }
} }
function carsShow() { function carsShow() {
if (carShow.value == true) { if (carShow.value == true) {
carShow.value = false; carShow.value = false;
iconShow(); iconShow();
} }
} }
function personsShow() { function personsShow() {
if (personShow.value == true) { if (personShow.value == true) {
personShow.value = false; personShow.value = false;
iconShow(); iconShow();
} }
} }
function iconShow() { function iconShow() {
for (const item of pins) { for (const item of pins) {
if (item.type == 1) { if (item.type == 1) {
item.image = bluePersonIcon; item.image = bluePersonIcon;
...@@ -505,10 +539,10 @@ ...@@ -505,10 +539,10 @@
} }
} }
iconPoint(viewer, pins); iconPoint(viewer, pins);
} }
// 设置员工类型 // 设置员工类型
function getPersonTypeName(type: number): string { function getPersonTypeName(type: number): string {
switch (type) { switch (type) {
case 1: case 1:
return '员工'; return '员工';
...@@ -517,9 +551,9 @@ ...@@ -517,9 +551,9 @@
default: default:
return '没有该类型'; return '没有该类型';
} }
} }
async function setTimePerson() { async function setTimePerson() {
const res = await getPointAllPersonApi(); const res = await getPointAllPersonApi();
for (const item of pins) { for (const item of pins) {
const pin = res.data.data.find((personData: any) => personData.cardId == item.id); const pin = res.data.data.find((personData: any) => personData.cardId == item.id);
...@@ -545,11 +579,13 @@ ...@@ -545,11 +579,13 @@
} }
} }
iconPoint(viewer, pins); iconPoint(viewer, pins);
} }
setInterval(setTimePerson, 10 * 1000); setInterval(setTimePerson, 20 * 1000);
// setInterval(setTimePerson, 2 * 60 * 1000);
onMounted(async () => { onMounted(async () => {
add3dtiles(); add3dtiles();
pointLine(viewer);
setTimeout(async () => { setTimeout(async () => {
fenceListGet(); fenceListGet();
...@@ -616,6 +652,7 @@ ...@@ -616,6 +652,7 @@
name: item.cameraName, name: item.cameraName,
type: 4, type: 4,
image: blueVideoIcon, image: blueVideoIcon,
position: { position: {
lon: item.lon, lon: item.lon,
lat: item.lat lat: item.lat
...@@ -634,7 +671,6 @@ ...@@ -634,7 +671,6 @@
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);
...@@ -728,9 +764,9 @@ ...@@ -728,9 +764,9 @@
iconPoint(viewer, pins); iconPoint(viewer, pins);
} }
}, Cesium.ScreenSpaceEventType.LEFT_CLICK); }, Cesium.ScreenSpaceEventType.LEFT_CLICK);
}); });
onUnmounted(() => { onUnmounted(() => {
// 清理Cesium资源 // 清理Cesium资源
if (viewer) { if (viewer) {
viewer.destroy(); viewer.destroy();
...@@ -742,10 +778,10 @@ ...@@ -742,10 +778,10 @@
// 移除html元素style属性中的font-size // 移除html元素style属性中的font-size
document.documentElement.style.fontSize = ''; document.documentElement.style.fontSize = '';
}); });
</script> </script>
<template> <template>
<div class="wrapper"> <div class="wrapper">
<div class="top-toolbar"> <div class="top-toolbar">
<div class="baojing"> <div class="baojing">
...@@ -861,7 +897,6 @@ ...@@ -861,7 +897,6 @@
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%"
...@@ -1022,30 +1057,30 @@ ...@@ -1022,30 +1057,30 @@
</div> </div>
</Transition> </Transition>
<!-- 非cesium相关 结束 --> <!-- 非cesium相关 结束 -->
</template> </template>
<style scoped> <style scoped>
html, html,
body { body {
width: 100%; width: 100%;
height: 100%; height: 100%;
overflow: hidden; overflow: hidden;
} }
.cesium-container { .cesium-container {
width: 100%; width: 100%;
height: 100vh; height: 100vh;
position: absolute; position: absolute;
top: 0; top: 0;
left: 0; left: 0;
} }
#cesiumContainer { #cesiumContainer {
width: 100%; width: 100%;
height: 100%; height: 100%;
} }
.personMessage { .personMessage {
width: 450px; width: 450px;
height: 250px; height: 250px;
position: absolute; position: absolute;
...@@ -1060,9 +1095,9 @@ ...@@ -1060,9 +1095,9 @@
background-image: url('@/assets/person2.png'); background-image: url('@/assets/person2.png');
background-size: 100% 100%; background-size: 100% 100%;
transform: translate(50%, 50%); transform: translate(50%, 50%);
} }
.carMessage { .carMessage {
width: 600px; width: 600px;
height: 380px; height: 380px;
position: absolute; position: absolute;
...@@ -1077,9 +1112,9 @@ ...@@ -1077,9 +1112,9 @@
background-image: url('@/assets/person2.png'); background-image: url('@/assets/person2.png');
background-size: 100% 100%; background-size: 100% 100%;
transform: translate(50%, 50%); transform: translate(50%, 50%);
} }
.equipmentMessage { .equipmentMessage {
width: 450px; width: 450px;
height: 290px; height: 290px;
position: absolute; position: absolute;
...@@ -1094,9 +1129,9 @@ ...@@ -1094,9 +1129,9 @@
background-image: url('@/assets/person2.png'); background-image: url('@/assets/person2.png');
background-size: 100% 100%; background-size: 100% 100%;
transform: translate(50%, 50%); transform: translate(50%, 50%);
} }
.videoMessage { .videoMessage {
width: 680px; width: 680px;
height: 380px; height: 380px;
position: absolute; position: absolute;
...@@ -1111,37 +1146,37 @@ ...@@ -1111,37 +1146,37 @@
background-image: url('@/assets/person2.png'); background-image: url('@/assets/person2.png');
background-size: 100% 100%; background-size: 100% 100%;
transform: translate(50%, 50%); transform: translate(50%, 50%);
} }
.title1 { .title1 {
margin-top: 5px; margin-top: 5px;
} }
.title2 { .title2 {
color: #29d7fb; color: #29d7fb;
margin-right: 10px; margin-right: 10px;
} }
.title3 { .title3 {
display: flex; display: flex;
align-items: center; align-items: center;
margin: 0px 0px 8px 0px; margin: 0px 0px 8px 0px;
} }
.title4 { .title4 {
color: #29d7fb; color: #29d7fb;
margin-right: 10px; margin-right: 10px;
margin-left: 20px; margin-left: 20px;
} }
span { span {
position: absolute; position: absolute;
z-index: 4; z-index: 4;
left: 30px; left: 30px;
top: 10px; top: 10px;
} }
.person1 { .person1 {
width: 85%; width: 85%;
height: 40px; height: 40px;
background-image: url('@/assets/person1.png'); background-image: url('@/assets/person1.png');
...@@ -1149,91 +1184,91 @@ ...@@ -1149,91 +1184,91 @@
position: absolute; position: absolute;
left: 6px; left: 6px;
top: 20px; top: 20px;
} }
.left-center { .left-center {
width: 100%; width: 100%;
height: 10px; height: 10px;
border-bottom: 1px solid #147f9c; border-bottom: 1px solid #147f9c;
} }
.right { .right {
width: 60%; width: 60%;
height: 50%; height: 50%;
/* margin-right: 20px; */ /* margin-right: 20px; */
/* margin-top: 20px; */ /* margin-top: 20px; */
} }
#video { #video {
height: 250px; height: 250px;
} }
.video-top { .video-top {
width: 100%; width: 100%;
height: 50%; height: 50%;
display: flex; display: flex;
flex-direction: row; flex-direction: row;
flex-wrap: nowrap; flex-wrap: nowrap;
} }
.video-bottom { .video-bottom {
margin-right: 20px; margin-right: 20px;
} }
.select { .select {
width: 100%; width: 100%;
border: none; border: none;
background-image: url('@/assets/multiple-pop.png'); background-image: url('@/assets/multiple-pop.png');
} }
.n-select { .n-select {
background-image: url('@/assets/multiple-pop.png'); background-image: url('@/assets/multiple-pop.png');
background-position: center; background-position: center;
} }
.n-select .n-select-trigger { .n-select .n-select-trigger {
background-color: transparent; background-color: transparent;
} }
.n-select .n-select-menu { .n-select .n-select-menu {
background-color: transparent; background-color: transparent;
} }
:deep(.n-base-selection .n-base-selection-tags) { :deep(.n-base-selection .n-base-selection-tags) {
background-color: transparent !important; background-color: transparent !important;
} }
:deep(.n-base-selection .n-base-selection-label .n-base-selection-input .n-base-selection-input__content) { :deep(.n-base-selection .n-base-selection-label .n-base-selection-input .n-base-selection-input__content) {
color: white !important; color: white !important;
} }
:deep(.n-base-selection .n-base-selection__border, .n-base-selection .n-base-selection__state-border) { :deep(.n-base-selection .n-base-selection__border, .n-base-selection .n-base-selection__state-border) {
border: 1px solid #4ab9fd; border: 1px solid #4ab9fd;
} }
:deep(.n-tag) { :deep(.n-tag) {
color: #fff; color: #fff;
background: #10273e00; background: #10273e00;
/* display:none; */ /* display:none; */
} }
:deep(.n-tag .n-tag__border) { :deep(.n-tag .n-tag__border) {
border: none; border: none;
} }
:deep(.n-base-selection-tag-wrapper) { :deep(.n-base-selection-tag-wrapper) {
background: #10273e00; background: #10273e00;
} }
/* zhaojunbao */ /* zhaojunbao */
.top-toolbar { .top-toolbar {
position: absolute; position: absolute;
top: 0.5rem; top: 0.5rem;
right: 0.5rem; right: 0.5rem;
width: 240px; width: 240px;
height: 0.4rem; height: 0.4rem;
color: #11e0ff; color: #11e0ff;
z-index: 99999; z-index: 9;
display: flex; display: flex;
align-items: center; align-items: center;
justify-content: space-between; justify-content: space-between;
...@@ -1281,17 +1316,17 @@ ...@@ -1281,17 +1316,17 @@
background-repeat: no-repeat; background-repeat: no-repeat;
} }
} }
} }
.top, .top,
.bottom, .bottom,
.left, .left,
.right { .right {
position: absolute; position: absolute;
background-repeat: no-repeat; background-repeat: no-repeat;
} }
.top { .top {
top: 0; top: 0;
width: 100%; width: 100%;
height: 1.25rem; height: 1.25rem;
...@@ -1317,18 +1352,18 @@ ...@@ -1317,18 +1352,18 @@
/* 可根据实际需要调整大小 */ /* 可根据实际需要调整大小 */
} }
} }
} }
.bottom { .bottom {
bottom: 0; bottom: 0;
left: 0; left: 0;
width: 100%; width: 100%;
height: 0.4rem; height: 0.4rem;
background-image: url('@/assets/jinrun/bottom.png'); background-image: url('@/assets/jinrun/bottom.png');
background-size: cover; background-size: cover;
} }
.left { .left {
top: 0rem; top: 0rem;
left: 0; left: 0;
width: 5.76rem; width: 5.76rem;
...@@ -1336,9 +1371,9 @@ ...@@ -1336,9 +1371,9 @@
background-size: contain; background-size: contain;
background-position-x: left; background-position-x: left;
background-image: url('@/assets/jinrun/bg-left.png'); background-image: url('@/assets/jinrun/bg-left.png');
} }
.right { .right {
top: 0rem; top: 0rem;
right: 0; right: 0;
width: 5.76rem; width: 5.76rem;
...@@ -1346,9 +1381,9 @@ ...@@ -1346,9 +1381,9 @@
background-image: url('@/assets/jinrun/bg-right.png'); background-image: url('@/assets/jinrun/bg-right.png');
background-size: contain; background-size: contain;
background-position-x: right; background-position-x: right;
} }
.toggle-btn { .toggle-btn {
position: absolute; position: absolute;
top: 50%; top: 50%;
transform: translateY(-50%); transform: translateY(-50%);
...@@ -1441,92 +1476,92 @@ ...@@ -1441,92 +1476,92 @@
&:hover { &:hover {
} }
} }
.slide-left-enter-active, .slide-left-enter-active,
.slide-left-leave-active { .slide-left-leave-active {
transition: transition:
transform 0.5s ease, transform 0.5s ease,
opacity 0.5s ease; opacity 0.5s ease;
} }
.slide-left-enter-from { .slide-left-enter-from {
transform: translateX(-100%); transform: translateX(-100%);
opacity: 0; opacity: 0;
} }
.slide-left-leave-to { .slide-left-leave-to {
transform: translateX(-100%); transform: translateX(-100%);
opacity: 0; opacity: 0;
} }
.slide-right-enter-active, .slide-right-enter-active,
.slide-right-leave-active { .slide-right-leave-active {
transition: transition:
transform 0.5s ease, transform 0.5s ease,
opacity 0.5s ease; opacity 0.5s ease;
} }
.slide-right-enter-from { .slide-right-enter-from {
transform: translateX(100%); transform: translateX(100%);
opacity: 0; opacity: 0;
} }
.slide-right-leave-to { .slide-right-leave-to {
transform: translateX(100%); transform: translateX(100%);
opacity: 0; opacity: 0;
} }
.left-modules:not(.v-enter-active):not(.v-leave-active).left-toggle:not(.collapsed) { .left-modules:not(.v-enter-active):not(.v-leave-active).left-toggle:not(.collapsed) {
left: 0; left: 0;
border-radius: 0 10px 10px 0; border-radius: 0 10px 10px 0;
} }
.right-modules:not(.v-enter-active):not(.v-leave-active).right-toggle:not(.collapsed) { .right-modules:not(.v-enter-active):not(.v-leave-active).right-toggle:not(.collapsed) {
right: 0; right: 0;
border-radius: 10px 0 0 10px; border-radius: 10px 0 0 10px;
background: pink; background: pink;
} }
.left-modules, .left-modules,
.right-modules { .right-modules {
width: 4.6rem; width: 4.6rem;
padding-top: 0.95rem; padding-top: 0.95rem;
position: absolute; position: absolute;
} }
.left-modules { .left-modules {
left: 0; left: 0;
margin-left: 0.4rem; margin-left: 0.4rem;
} }
.right-modules { .right-modules {
right: 0; right: 0;
margin-right: 0.4rem; margin-right: 0.4rem;
} }
.arrow-font { .arrow-font {
width: 20px; width: 20px;
color: #fff; color: #fff;
font-size: 0.18rem; font-size: 0.18rem;
display: flex; display: flex;
flex-direction: column; flex-direction: column;
} }
.video-container { .video-container {
width: 100%; width: 100%;
height: 250px; height: 250px;
border: 1px solid #ccc; border: 1px solid #ccc;
background: #f5f5f5; background: #f5f5f5;
position: relative; position: relative;
} }
#divPlugin { #divPlugin {
width: 100%; width: 100%;
height: 100%; height: 100%;
} }
.status-info { .status-info {
position: absolute; position: absolute;
top: 10px; top: 10px;
right: 10px; right: 10px;
...@@ -1535,6 +1570,5 @@ ...@@ -1535,6 +1570,5 @@
padding: 5px 10px; padding: 5px 10px;
border-radius: 4px; border-radius: 4px;
font-size: 12px; font-size: 12px;
} }
</style> </style>
\ No newline at end of file
...@@ -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,21 +617,41 @@ async function setTimePerson() { ...@@ -559,21 +617,41 @@ 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 => {
const createTime = new Date(item.createTime);
const now = new Date();
// 计算两个时间的差值(毫秒)
const diffInMs = now - createTime;
// 转换为分钟
const diffInMinutes = diffInMs / (1000 * 60);
// 判断是否超过3分钟
if (diffInMinutes > 3) {
} else {
pins.push({ pins.push({
id: item.cardId, id: item.cardId,
name: item.realName, name: item.realName,
type: 1, type: 1,
image: bluePersonIcon, image: bluePersonIcon,
createTime: item.createTime,
position: { position: {
lon: item.lon, lon: item.lon,
lat: item.lat lat: item.lat
...@@ -581,12 +659,24 @@ onMounted(async () => { ...@@ -581,12 +659,24 @@ onMounted(async () => {
data: item, data: item,
entity: null 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 => {
const createTime = new Date(item.createTime);
const now = new Date();
// 计算两个时间的差值(毫秒)
const diffInMs = now - createTime;
// 转换为天数
const diffInDays = diffInMs / (1000 * 60);
// 判断是否超过20分钟
if (diffInDays > 20) {
} else {
pins.push({ pins.push({
id: item.carNumber, id: item.carNumber,
name: item.carNumber, name: item.carNumber,
...@@ -599,6 +689,7 @@ onMounted(async () => { ...@@ -599,6 +689,7 @@ onMounted(async () => {
data: item, data: item,
entity: null 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);
}); });
} }
...@@ -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()
......
<template> <template>
<iframe src="http://192.168.2.15:81/personMonitor/monitorPoints" frameborder="0"></iframe> <iframe :src="`${baseUrl}/personMonitor/monitorPoints`" 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/alarmManage/history" frameborder="0"></iframe> <iframe :src="`${baseUrl}/alarmManage/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/alarmManage/warning" frameborder="0"></iframe> <iframe :src="`${baseUrl}/alarmManage/warning`" 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/personInspection/checkItem" frameborder="0"></iframe> <iframe :src="`${baseUrl}/personInspection/checkItem`" 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/personInspection/checkResult" frameborder="0"></iframe> <iframe :src="`${baseUrl}/personInspection/checkResult`" 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/personInspection/checkMode" frameborder="0"></iframe> <iframe :src="`${baseUrl}/personInspection/checkMode`" 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/system/wastedumpManage" frameborder="0"></iframe> <iframe :src="`${baseUrl}/system/wastedumpManage`" 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/system/deviceManage" frameborder="0"></iframe> <iframe :src="`${baseUrl}/system/deviceManage`" 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/system/monitorItems" frameborder="0"></iframe> <iframe :src="`${baseUrl}/system/monitorItems`" 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/system/moduleConfig" frameborder="0"></iframe> <iframe :src="`${baseUrl}/system/moduleConfig`" 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/system/monitorPointConfig" frameborder="0"></iframe> <iframe :src="`${baseUrl}/system/monitorPointConfig`" 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()
......
...@@ -192,15 +192,23 @@ async function topDelete() { ...@@ -192,15 +192,23 @@ async function topDelete() {
if (ids.value == null || ids.value.length == 0) { if (ids.value == null || ids.value.length == 0) {
message.error('请选择要删除的用户'); message.error('请选择要删除的用户');
} else { } else {
dialog.create({
title: '提示',
content: '确定删除这条记录吗?',
positiveText: '确定',
negativeText: '取消',
onPositiveClick: async () => {
let id = ids.value.join(',') let id = ids.value.join(',')
let res = await delFenceLogApi(id); let res = await delFenceLogApi(id);
if(res.data.code == 200) { if (res.data.code == 200) {
search(); search();
message.success('删除成功') message.success('删除成功')
} else { } else {
message.error(res.data.msg) message.error(res.data.msg)
} }
} }
})
}
} }
// 头部导出 // 头部导出
async function topDerive() { async function topDerive() {
...@@ -326,7 +334,7 @@ onMounted(() => { ...@@ -326,7 +334,7 @@ onMounted(() => {
<div style="margin-left: 30px"> <div style="margin-left: 30px">
车牌号 车牌号
<NInput v-model:value="serarchData.username" placeholder="请输入车牌号" <NInput v-model:value="serarchData.carNumber" placeholder="请输入车牌号"
style="width: 250px; margin-left: 10px" clearable="true" /> style="width: 250px; margin-left: 10px" clearable="true" />
</div> </div>
......
<template> <template>
<iframe style="width: 100%; height: 100%;" src="http://192.168.2.15:84/dataMonitor/bmwy/history" frameborder="0"></iframe> <iframe style="width: 100%; height: 100%;" :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_SIDE_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:84/dataMonitor/jyl/history" frameborder="0"></iframe> <iframe style="width: 100%; height: 100%;" :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_SIDE_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:84/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_SIDE_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:84/personMonitor/valueInput" frameborder="0"></iframe> <iframe style="width: 100%; height: 100%;" :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_SIDE_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:84/personMonitor/monitorPoints" frameborder="0"></iframe> <iframe style="width: 100%; height: 100%;" :src="`${baseUrl}/personMonitor/monitorPoints`" 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_SIDE_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:84/alarmManage/history" frameborder="0"></iframe> <iframe style="width: 100%; height: 100%;" :src="`${baseUrl}/alarmManage/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_SIDE_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:84/alarmManage/warning" frameborder="0"></iframe> <iframe style="width: 100%; height: 100%;" :src="`${baseUrl}/alarmManage/warning`" 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_SIDE_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:84/personInspection/checkItem" frameborder="0"></iframe> <iframe style="width: 100%; height: 100%;" :src="`${baseUrl}/personInspection/checkItem`" 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_SIDE_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:84/personInspection/checkResult" frameborder="0"></iframe> <iframe style="width: 100%; height: 100%;" :src="`${baseUrl}/personInspection/checkResult`" 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_SIDE_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:84/personInspection/checkMode" frameborder="0"></iframe> <iframe style="width: 100%; height: 100%;" :src="`${baseUrl}/personInspection/checkMode`" 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_SIDE_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:84/system/deviceManage" frameborder="0"></iframe> <iframe style="width: 100%; height: 100%;" :src="`${baseUrl}/system/deviceManage`" 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_SIDE_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:84/system/monitorItems" frameborder="0"></iframe> <iframe style="width: 100%; height: 100%;" :src="`${baseUrl}/system/monitorItems`" 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_SIDE_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:84/system/moduleConfig" frameborder="0"></iframe> <iframe style="width: 100%; height: 100%;" :src="`${baseUrl}/system/moduleConfig`" 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_SIDE_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:84/system/monitorPointConfig" frameborder="0"></iframe> <iframe style="width: 100%; height: 100%;" :src="`${baseUrl}/system/monitorPointConfig`" 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_SIDE_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/drybeachequipinfor/deviceManage" frameborder="0"></iframe> <iframe :src="`${baseUrl}/drybeachequipinfor/deviceManage`" 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_POINT_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/drybeachequipinfor/monitoringHistory" frameborder="0"></iframe> <iframe :src="`${baseUrl}/drybeachequipinfor/monitoringHistory`" 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_POINT_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/drybeachequipinfor/jylHistory" frameborder="0"></iframe> <iframe :src="`${baseUrl}/drybeachequipinfor/jylHistory`" 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_POINT_URL;
onMounted(async () => { onMounted(async () => {
const message = useMessage(); const message = useMessage();
let res = await api_tokenGet() let res = await api_tokenGet()
......
...@@ -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/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>
\ No newline at end of file
<template> <template>
<iframe src="http://192.168.2.11/device/card" frameborder="0"></iframe> <iframe :src="`${baseUrl}/device/card`" 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_PERSON_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.11/person/renyuan" frameborder="0"></iframe> <iframe :src="`${baseUrl}/person/renyuan`" 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_PERSON_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.11/person/fangke" frameborder="0"></iframe> <iframe :src="`${baseUrl}/person/fangke`" frameborder="0"></iframe>
</template> </template>
<script lang="ts" setup> <script lang="ts" setup>
import { api_tokenGet } from '@/api'; import { api_tokenGet } from '@/api';
import { useMessage } from 'naive-ui'; import { useMessage } from 'naive-ui';
import { onMounted } from 'vue'; import { onMounted } from 'vue';
import { connect, parseDetectionRecord } from '@/utils/webSocket';
import { router } from '@/router';
const baseUrl = import.meta.env.VITE_PERSON_URL;
let ws: any = null;
// 定义WebSocket连接的URL
const webSocketUrl = `ws://192.168.2.67:9995/ws/${'router'}`;
function connect() {
if ('WebSocket' in window) {
ws = new WebSocket(webSocketUrl);
// 连接成功时触发
ws.onopen = function (event) {
console.log('WebSocket连接成功');
};
// 接收到消息时触发
ws.onmessage = function (event) {
const recordObject: DetectionRecord = parseDetectionRecord(event.data);
// 处理接收到的数据
const data = recordObject;
console.log('111', data);
if (data.type == 'router') {
router.push({
path: '/personnel/track',
query: {
cardId: data.cardId
}
});
}
// 处理收到的消息
};
}
}
onMounted(async () => { onMounted(async () => {
const message = useMessage(); const message = useMessage();
...@@ -13,6 +46,7 @@ onMounted(async () => { ...@@ -13,6 +46,7 @@ onMounted(async () => {
if (res.data.code == 401) { if (res.data.code == 401) {
message.error('登录过期'); message.error('登录过期');
} }
connect()
}) })
</script> </script>
......
<template> <template>
<iframe src="http://192.168.2.11/person/yuangong" frameborder="0"></iframe> <iframe :src="`${baseUrl}/person/yuangong`" frameborder="0"></iframe>
</template> </template>
<script lang="ts" setup> <script lang="ts" setup>
import { api_tokenGet } from '@/api'; 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_PERSON_URL;
onMounted(async () => { onMounted(async () => {
const message = useMessage(); const message = useMessage();
......
...@@ -64,17 +64,6 @@ function add3dtiles() { ...@@ -64,17 +64,6 @@ function add3dtiles() {
} }
async function createRedLine() { async function createRedLine() {
// polygonCoordList = [
// { id:'1', name: '李四1', x: 122.04635389346244, y: 37.488806671581244, },
// { id:'2', name: '李四2', x: 122.04889441347648, y: 37.489652755263485, },
// { id:'3', name: '李四3', x: 122.04866968206369, y: 37.49009150670726, },
// { id:'4', name: '李四4', x: 122.04742994760802, y: 37.48962490165547, },
// { id:'5', name: '李四5', x: 122.0462100510411, y: 37.48919903307283 },
// { id:'6', name: '李四6', x: 122.04604253116817, y: 37.48950907923646 },
// { id:'7', name: '李四7', x: 122.04722854327062, y: 37.48991898274459 },
// { id:'8', name: '李四8', x: 122.04706661542971, y: 37.49024792859644}
// ];
let res = await getPointAllPersonApi(); let res = await getPointAllPersonApi();
polygonCoordList = res.data.data; polygonCoordList = res.data.data;
...@@ -140,7 +129,6 @@ async function createRedLine() { ...@@ -140,7 +129,6 @@ async function createRedLine() {
} }
function selectChange(item:any) { function selectChange(item:any) {
console.log('222',item);
personValue.value = item; personValue.value = item;
} }
...@@ -150,6 +138,10 @@ function handleSearch() { ...@@ -150,6 +138,10 @@ function handleSearch() {
return; return;
} else { } else {
personList.value = polygonCoordList.filter((item:any) => item.personId == personValue.value); personList.value = polygonCoordList.filter((item:any) => item.personId == personValue.value);
if(personList.value.length <= 0){
message.error('该人员未在线');
return;
}
personShow.value = true; personShow.value = true;
message.success('查询成功'); message.success('查询成功');
} }
......
<template> <template>
<iframe src="http://192.168.2.11/sos/alarm" frameborder="0"></iframe> <iframe :src="`${baseUrl}/sos/alarm`" 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_PERSON_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.11/tongji/fenbu" frameborder="0"></iframe> <iframe :src="`${baseUrl}/tongji/fenbu`" 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_PERSON_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.11/tongji/baojing" frameborder="0"></iframe> <iframe :src="`${baseUrl}/tongji/baojing`" 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_PERSON_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.11/tongji/kaoqin" frameborder="0"></iframe> <iframe :src="`${baseUrl}/tongji/kaoqin`" 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_PERSON_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.11/tongji/renyuan" frameborder="0"></iframe> <iframe :src="`${baseUrl}/tongji/renyuan`" 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_PERSON_URL;
onMounted(async () => { onMounted(async () => {
const message = useMessage(); const message = useMessage();
let res = await api_tokenGet() let res = await api_tokenGet()
......
...@@ -9,14 +9,17 @@ import { remove } from 'nprogress'; ...@@ -9,14 +9,17 @@ import { remove } from 'nprogress';
import { toConvertLongitudeAndLatitude } from '@/api/utils/coordinateUtil'; import { toConvertLongitudeAndLatitude } from '@/api/utils/coordinateUtil';
import { getModel } from '@/api/utils/cesiumModel'; import { getModel } from '@/api/utils/cesiumModel';
import { getModelAllApi, getPersonPointApi } from '@/api'; import { getModelAllApi, getPersonPointApi } from '@/api';
import { useRoute } from 'vue-router';
let viewer: any = null; let viewer: any = null;
const route = useRoute();
const range = ref<any>(null); const range = ref<any>(null);
const personValue = ref(''); const personValue = ref('');
const serarchData = ref({ const serarchData = ref({
username: '', cardId: '',
personId: '',
startTime: '', startTime: '',
endTime: '' endTime: '',
}); });
const cesiumShow = ref(false) const cesiumShow = ref(false)
const isShow = ref(false); const isShow = ref(false);
...@@ -143,6 +146,9 @@ function pauseProgress() { ...@@ -143,6 +146,9 @@ function pauseProgress() {
// 监听选取的人员 // 监听选取的人员
function selectChange(item: any) { function selectChange(item: any) {
personValue.value = item; personValue.value = item;
let res = options.value.find(data => data.cardId == item)
serarchData.value.personId = res.personId;
} }
// 监听时间范围变化 // 监听时间范围变化
function watchTimeData(newRange: any) { function watchTimeData(newRange: any) {
...@@ -215,6 +221,7 @@ function handleclear() { ...@@ -215,6 +221,7 @@ function handleclear() {
function handleReset() { function handleReset() {
isShow.value = false; isShow.value = false;
cesiumShow.value = false;
//删除模型 //删除模型
if (model.value) { if (model.value) {
viewer.entities.remove(model.value); viewer.entities.remove(model.value);
...@@ -299,13 +306,30 @@ async function handleSearch() { ...@@ -299,13 +306,30 @@ async function handleSearch() {
cesiumShow.value = true; cesiumShow.value = true;
let data = { let data = {
cardId: personValue.value, cardId: personValue.value,
personId: serarchData.value.personId,
startTime: serarchData.value.startTime, startTime: serarchData.value.startTime,
endTime: serarchData.value.endTime endTime: serarchData.value.endTime
} }
let resHeight = null; let resHeight = null;
let res = await getPersonPointApi(data); let res = await getPersonPointApi(data);
if (res.data.code == 200) { if (res.data.code == 200) {
for (let item of res.data.data) { let dataList = [];
if (res.data.data.length <= 0) {
message.warning('暂无人员轨迹');
cesiumShow.value = false;
return;
}
if(res.data.data.length > 100){
let index = Math.floor(res.data.data.length / 100);
console.log(index);
for(let i = 0; i < 98; i++){
dataList.push(res.data.data[i * index]);
}
dataList.push(res.data.data[0],res.data.data[res.data.data.length - 1]);
} else {
dataList = res.data.data;
}
for (let item of dataList) {
const cartographic = Cesium.Cartographic.fromDegrees(item.lon, item.lat); const cartographic = Cesium.Cartographic.fromDegrees(item.lon, item.lat);
const height = await getElevationFromRays(cartographic, viewer); const height = await getElevationFromRays(cartographic, viewer);
const adjustedHeight = height; const adjustedHeight = height;
...@@ -322,6 +346,7 @@ async function handleSearch() { ...@@ -322,6 +346,7 @@ async function handleSearch() {
resHeight = height; resHeight = height;
} }
let newPositions = await createNewPositionHeight(positions.value, viewer) let newPositions = await createNewPositionHeight(positions.value, viewer)
model.value = createModel(newPositions, viewer); model.value = createModel(newPositions, viewer);
undataLine(newPositions); undataLine(newPositions);
cesiumShow.value = false; cesiumShow.value = false;
...@@ -370,6 +395,18 @@ onMounted(() => { ...@@ -370,6 +395,18 @@ onMounted(() => {
updateProgress(); updateProgress();
}, 2000); }, 2000);
search(); search();
search().then(() => {
// 在获取到选项后再处理路由参数
const cardId = route.query.cardId;
if (cardId && options.value) {
const matchedOption = options.value.find(option => option.cardId === cardId);
if (matchedOption) {
value.value = cardId;
personValue.value = cardId;
}
}
});
}); });
</script> </script>
...@@ -396,9 +433,9 @@ onMounted(() => { ...@@ -396,9 +433,9 @@ onMounted(() => {
</NSpace> </NSpace>
</div> </div>
<n-spin class="spinDiv" v-show="cesiumShow"> <n-spin class="spinDiv" v-show="cesiumShow" stroke="#0088FFFF">
<template #description> <template #description>
<span style="color: #2198f2;">加载中...</span> <span style="color: #0088FFFF;">加载中...</span>
</template> </template>
</n-spin> </n-spin>
......
<template> <template>
<iframe src="http://192.168.2.53:8040/#/regional/fence" frameborder="0"></iframe> <iframe :src="`${baseUrl}/#/regional/fence`" 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_TRUCK_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.53:8040/#/regional/information" frameborder="0"></iframe> <iframe :src="`${baseUrl}/#/regional/information`" 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_TRUCK_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:83/carManagement/carType" frameborder="0"></iframe> <iframe :src="`${baseUrl}/carManagement/carType`" 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_TRUCKS_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:83/carManagement/carFault" frameborder="0"></iframe> <iframe :src="`${baseUrl}/carManagement/carFault`" 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_TRUCKS_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:83/carManagement/carRepair" frameborder="0"></iframe> <iframe :src="`${baseUrl}/carManagement/carRepair`" 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_TRUCKS_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:83/carManagement/carInformation" frameborder="0"></iframe> <iframe :src="`${baseUrl}/carManagement/carInformation`" 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_TRUCKS_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:83/carManagement/carFleet" frameborder="0"></iframe> <iframe :src="`${baseUrl}/carManagement/carFleet`" 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_TRUCKS_URL;
onMounted(async () => { onMounted(async () => {
const message = useMessage(); const message = useMessage();
let res = await api_tokenGet() let res = await api_tokenGet()
......
...@@ -145,7 +145,6 @@ function pauseProgress() { ...@@ -145,7 +145,6 @@ function pauseProgress() {
// 监听选取的人员 // 监听选取的人员
function selectChange(item: any) { function selectChange(item: any) {
console.log(item);
personValue.value = item; personValue.value = item;
} }
...@@ -220,6 +219,7 @@ function handleclear() { ...@@ -220,6 +219,7 @@ function handleclear() {
function handleReset() { function handleReset() {
isShow.value = false; isShow.value = false;
cesiumShow.value = false;
//删除模型 //删除模型
if (model.value) { if (model.value) {
viewer.entities.remove(model.value); viewer.entities.remove(model.value);
...@@ -297,6 +297,7 @@ function selectSpeed(e) { ...@@ -297,6 +297,7 @@ function selectSpeed(e) {
// }, 100); // }, 100);
} }
} }
async function handleSearch() { async function handleSearch() {
handlerClean() handlerClean()
if (serarchData.value.startTime && serarchData.value.endTime) { if (serarchData.value.startTime && serarchData.value.endTime) {
...@@ -309,7 +310,22 @@ async function handleSearch() { ...@@ -309,7 +310,22 @@ async function handleSearch() {
let resHeight = null; let resHeight = null;
let res = await getCarPointApi(data); let res = await getCarPointApi(data);
if (res.data.code == 200) { if (res.data.code == 200) {
for (let item of res.data.data) { let dataList = [];
if (res.data.data.length <= 0) {
message.warning('暂无车辆轨迹');
cesiumShow.value = false;
return;
}
if(res.data.data.length > 100){
let index = Math.floor(res.data.data.length / 100);
for(let i = 0; i < 98; i++){
dataList.push(res.data.data[i * index]);
}
dataList.push(res.data.data[0],res.data.data[res.data.data.length - 1]);
} else {
dataList = res.data.data;
}
for (let item of dataList) {
const cartographic = Cesium.Cartographic.fromDegrees(item.lon, item.lat); const cartographic = Cesium.Cartographic.fromDegrees(item.lon, item.lat);
const height = await getElevationFromRays(cartographic, viewer); const height = await getElevationFromRays(cartographic, viewer);
const adjustedHeight = height; const adjustedHeight = height;
...@@ -324,8 +340,8 @@ async function handleSearch() { ...@@ -324,8 +340,8 @@ async function handleSearch() {
} }
resHeight = height; resHeight = height;
} }
let newPositions = await createNewPositionHeight(positions.value, viewer) let newPositions = await createNewPositionHeight(positions.value, viewer)
console.log(newPositions);
model.value = createModel(newPositions, viewer); model.value = createModel(newPositions, viewer);
undataLine(newPositions); undataLine(newPositions);
...@@ -339,14 +355,6 @@ async function handleSearch() { ...@@ -339,14 +355,6 @@ async function handleSearch() {
} }
} }
// watch([model.value, lineValue.value], ([newModel, newLineValue], [oldModel, oldLineValue]) => {
// if (newModel && newLineValue) {
// cesiumShow.value = false;
// } else {
// cesiumShow.value = true;
// }
// },{ deep: true });
// 添加开始和结束时间显示 // 添加开始和结束时间显示
function formatDateTime(date: any) { function formatDateTime(date: any) {
if (!date) return ''; if (!date) return '';
...@@ -399,9 +407,9 @@ onMounted(() => { ...@@ -399,9 +407,9 @@ onMounted(() => {
</NSpace> </NSpace>
</div> </div>
<!-- 加载中 --> <!-- 加载中 -->
<n-spin class="spinDiv" v-show="cesiumShow"> <n-spin class="spinDiv" v-show="cesiumShow" stroke="#0088FFFF">
<template #description> <template #description>
<span style="color: #2198f2;">加载中...</span> <span style="color: #0088FFFF;">加载中...</span>
</template> </template>
</n-spin> </n-spin>
<!-- cesium --> <!-- cesium -->
......
<template> <template>
<iframe src="http://192.168.2.15:83/carManagement/carFaultType" frameborder="0"></iframe> <iframe :src="`${baseUrl}/carManagement/carFaultType`" 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_TRUCKS_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.53:8040/#/intelligent/person" frameborder="0"></iframe> <iframe :src="`${baseUrl}/#/intelligent/person`" 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_TRUCK_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:83/safetyManagement/checkModel" frameborder="0"></iframe> <iframe :src="`${baseUrl}/#/safetyManagement/checkModel`" 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_TRUCKS_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:83/safetyManagement/checkLog" frameborder="0"></iframe> <iframe :src="`${baseUrl}/safetyManagement/checkLog`" 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_TRUCKS_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.53:8040/#/intelligent/order" frameborder="0"></iframe> <iframe :src="`${baseUrl}/#/intelligent/order`" 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_TRUCK_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.53:8040/#/terminal" frameborder="0"></iframe> <iframe :src="`${baseUrl}/#/terminal`" 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_TRUCK_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.53:8040/#/history/log" frameborder="0"></iframe> <iframe :src="`${baseUrl}/#/history/log`" 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_TRUCK_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.53:8040/#/ai/camera" frameborder="0"></iframe> <iframe allowfullscreen="true" allowtransparency="true" allow="autoplay" :src="`${baseUrl}/#/ai/camera`" 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_TRUCK_URL;
onMounted(async () => { onMounted(async () => {
const message = useMessage(); const message = useMessage();
let res = await api_tokenGet() let res = await api_tokenGet()
......
...@@ -17,7 +17,7 @@ import { ...@@ -17,7 +17,7 @@ import {
useDialog, useDialog,
useMessage useMessage
} from 'naive-ui'; } from 'naive-ui';
import { api_addRole, api_deleteRole, api_exportRoleData, api_getUserRole, api_menuPageGet, api_rolePage, api_updateRole } from '@/api'; import { api_addRole, api_deleteRole, api_exportRoleData, api_getUserRole, api_menuListGet, api_menuPageGet, api_rolePage, api_updateRole } from '@/api';
import { roleRules } from '@/rules/rules'; import { roleRules } from '@/rules/rules';
const message = useMessage(); const message = useMessage();
...@@ -193,6 +193,10 @@ async function handleEdit(row: any) { ...@@ -193,6 +193,10 @@ async function handleEdit(row: any) {
title.value = '编辑角色' title.value = '编辑角色'
let res = await api_getUserRole(row.id) let res = await api_getUserRole(row.id)
formData.value = res.data.data; formData.value = res.data.data;
formData.value.permissionIds = res.data.data.permissionIds.map((item:any) => {
return item.menuId;
})
console.log('permissionIds:', formData.value.permissionIds); // 检查这里的数据
createModal.value = true; createModal.value = true;
} }
const dialog = useDialog(); const dialog = useDialog();
...@@ -245,6 +249,9 @@ async function topCompile() { ...@@ -245,6 +249,9 @@ async function topCompile() {
createModal.value = true; createModal.value = true;
if(res.data.code == 200) { if(res.data.code == 200) {
formData.value = res.data.data formData.value = res.data.data
formData.value.permissionIds = res.data.data.permissionIds.map((item:any) => {
return item.menuId;
})
} else { } else {
message.error(res.data.msg) message.error(res.data.msg)
} }
...@@ -347,11 +354,9 @@ async function search() { ...@@ -347,11 +354,9 @@ async function search() {
} }
async function authoritySearch(){ async function authoritySearch(){
let res = await api_menuPageGet(pageData1.value); let res = await api_menuListGet();
if (res.data.code == 200) { if (res.data.code == 200) {
console.log(res); authorityData.value = res.data.data.children;
authorityData.value = res.data.data.data[0].children;
} else { } else {
message.error(res.msg); message.error(res.msg);
} }
......
...@@ -357,7 +357,7 @@ onMounted(() => { ...@@ -357,7 +357,7 @@ onMounted(() => {
@update:value="updataType1" /> @update:value="updataType1" />
</NFormItem> </NFormItem>
<n-form-item label="模型上传"> <n-form-item label="模型上传">
<n-upload action="http://192.168.2.53:9995/information/model/file" :headers="{ <n-upload action="http://192.168.2.67:9995/information/model/file" :headers="{
'naive-info': 'hello!', 'naive-info': 'hello!',
}" :data="{ }" :data="{
'naive-data': 'cool! naive!', 'naive-data': 'cool! naive!',
......
...@@ -367,7 +367,7 @@ onMounted(() => { ...@@ -367,7 +367,7 @@ onMounted(() => {
@update:value="updataType1" /> @update:value="updataType1" />
</NFormItem> </NFormItem>
<NFormItem label="文件上传"> <NFormItem label="文件上传">
<n-upload action="http://192.168.2.53:9995/information/image/upload/iamge" :headers="{ <n-upload action="http://192.168.2.67:9995/information/image/upload/iamge" :headers="{
'naive-info': 'hello!' 'naive-info': 'hello!'
}" :data="{ }" :data="{
'naive-data': 'cool! naive!' 'naive-data': 'cool! naive!'
......
...@@ -423,10 +423,22 @@ function watchTimeData(value: any) { ...@@ -423,10 +423,22 @@ function watchTimeData(value: any) {
async function search() { async function search() {
let res = await api_userPageGet(serarchData.value); let res = await api_userPageGet(serarchData.value);
// let resList = await api_getRoleList();
// let resUser = resList.data.data;
if (res.data.code == 200) { if (res.data.code == 200) {
tableData.value = res.data.data.records; tableData.value = res.data.data.records;
pageData.value.total = Number(res.data.data.total); pageData.value.total = Number(res.data.data.total);
// resUser.forEach((item:any) => {
// for (let i = 0; i < tableData.value.length; i++) {
// const element = tableData.value[i];
// if (element.roleName == item.roleName) {
// element.roleName = item.roleRemark;
// console.log('111',element);
// console.log('222',item);
// }
// }
// })
} else { } else {
message.error(res.data.msg); message.error(res.data.msg);
} }
......
...@@ -8,8 +8,8 @@ export default defineConfig(configEnv => { ...@@ -8,8 +8,8 @@ export default defineConfig(configEnv => {
const viteEnv = loadEnv(configEnv.mode, process.cwd()) as unknown as Env.ImportMeta; const viteEnv = loadEnv(configEnv.mode, process.cwd()) as unknown as Env.ImportMeta;
const buildTime = getBuildTime(); const buildTime = getBuildTime();
const proxyTarget = 'http://192.168.2.53:8080';
const url = viteEnv.VITE_SERVICE_URL; const proxyTarget = 'http://192.168.2.67:9995';
// const enableProxy = configEnv.command === 'serve' && !configEnv.isPreview; // const enableProxy = configEnv.command === 'serve' && !configEnv.isPreview;
return { return {
...@@ -39,7 +39,7 @@ export default defineConfig(configEnv => { ...@@ -39,7 +39,7 @@ export default defineConfig(configEnv => {
proxy: { proxy: {
...createViteProxy(viteEnv, configEnv.command === 'serve'), ...createViteProxy(viteEnv, configEnv.command === 'serve'),
'/v1': { '/v1': {
target: url, target: proxyTarget,
changeOrigin: true, changeOrigin: true,
rewrite: path => path.replace(/^\/v1/, '') rewrite: path => path.replace(/^\/v1/, '')
} }
......
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