Commit 83672c70 authored by xinzhedeai's avatar xinzhedeai

new from liqilin

parent bba8ce47
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
# if use a sub directory, it must be end with "/", like "/admin/" but not "/admin" # if use a sub directory, it must be end with "/", like "/admin/" but not "/admin"
VITE_BASE_URL=/ VITE_BASE_URL=/
VITE_APP_TITLE=SoybeanAdmin VITE_APP_TITLE=金润四化综合管理系统
VITE_APP_DESC=SoybeanAdmin is a fresh and elegant admin template VITE_APP_DESC=SoybeanAdmin is a fresh and elegant admin template
...@@ -63,12 +63,42 @@ VITE_DEVTOOLS_LAUNCH_EDITOR=code ...@@ -63,12 +63,42 @@ VITE_DEVTOOLS_LAUNCH_EDITOR=code
# VITE_VIDEO_URL=ws://192.168.3.248:9999 # VITE_VIDEO_URL=ws://192.168.3.248:9999
# 开发环境 - 所有服务接口地址 # 开发环境 - 所有服务接口地址
VITE_SERVICE_URL=http://192.168.2.53:9995 VITE_SERVICE_URL=http://192.168.2.67:9995
# 模型地址环境 # 模型地址环境
VITE_MODEL_URL=http://192.168.2.53:9995/model VITE_MODEL_URL=http://192.168.2.67:9995/model
# 开发环境 - WebSocket 全局地址 # 开发环境 - WebSocket 全局地址
# VITE_WEBSOCKET_URL=ws://192.168.3.248:9996 # VITE_WEBSOCKET_URL=ws://192.168.3.248:9996
\ No newline at end of file
# 人员定位 -- 前后端
VITE_PERSON_URL=http://192.168.2.67:8083
# 后 http://192.168.2.37:8082
# 定位卡 http://192.168.2.53:9997
# 边坡监测 -- 前后端
VITE_SIDE_URL=http://192.168.2.67:9087
# 后 http://192.168.2.37:9082
# 全方位监测 -- 前后端
VITE_POINT_URL=http://192.168.2.67:9088
# 后 http://192.168.2.37:9081
# 排土场 -- 前后端
VITE_CASTING_URL=http://192.168.2.67:9086
# 后 http://192.168.2.37:9080
# 卡车调度 -- 前后端
VITE_TRUCK_URL=http://192.168.2.67:8040
VITE_TRUCKS_URL=http://192.168.2.67:9089
# 后 http://192.168.2.53:9996
# AI系统 -- 前后端
VITE_AI_URL=http://192.168.2.67:9528
# 后 http://192.168.2.53:9528
# 综合系统 -- 前后端
# 前 http://192.168.2.54:9527
# 后 http://192.168.2.53:9995
...@@ -10,9 +10,9 @@ ...@@ -10,9 +10,9 @@
<script src="./public/js/proj4.js"></script> <script src="./public/js/proj4.js"></script>
<script src="./public/js/turf.min.js"></script> <script src="./public/js/turf.min.js"></script>
<link rel="stylesheet" type="text/css" href="./Cesium/Widgets/widgets.css" /> <link rel="stylesheet" type="text/css" href="./Cesium/Widgets/widgets.css" />
<script type="text/javascript" src="/public/webrtcstreamer.js"></script> <script type="text/javascript" src="./public/webrtcstreamer.js"></script>
<script type="text/javascript" src="./Cesium/Cesium.js"></script> <script type="text/javascript" src="./Cesium/Cesium.js"></script>
<script src="/public/jquery-1.7.1.min.js"></script> <script src="./public/jquery-1.7.1.min.js"></script>
<title>%VITE_APP_TITLE%</title> <title>%VITE_APP_TITLE%</title>
</head> </head>
......
...@@ -51,7 +51,7 @@ export const getCarLogList = async (): Promise<any> => await axios.get('home/car ...@@ -51,7 +51,7 @@ export const getCarLogList = async (): Promise<any> => await axios.get('home/car
// 修改报警状态 // 修改报警状态
export const setAlarmStatusApi = async (command: string): Promise<any> => await axios.post(`/home/sound/${command}`); export const setAlarmStatusApi = async (command: any): Promise<any> => await axios.post(`/home/sound/${command}`);
// 获取报警状态 // 获取报警状态
export const getAlarmStatusApi = async (): Promise<any> => await axios.get('/home/alarm/status'); export const getAlarmStatusApi = async (): Promise<any> => await axios.get('/home/alarm/status');
......
...@@ -34,6 +34,9 @@ export const api_tokenGet = async (): Promise<any> => await axios.get(`/api/toke ...@@ -34,6 +34,9 @@ export const api_tokenGet = async (): Promise<any> => await axios.get(`/api/toke
export const api_menuPageGet = async (data: any): Promise<any> => export const api_menuPageGet = async (data: any): Promise<any> =>
await axios.get(`/menu/page?pageNum=${data.pageNum}&pageSize=${data.pageSize}`); await axios.get(`/menu/page?pageNum=${data.pageNum}&pageSize=${data.pageSize}`);
export const api_menuListGet = async (): Promise<any> =>
await axios.get(`/menu/list`);
// ------------------- 用户管理接口 ------------------ // ------------------- 用户管理接口 ------------------
export const api_userPageGet = async (data: any): Promise<any> => export const api_userPageGet = async (data: any): Promise<any> =>
await axios.get(`/user/page?pageNum=${data.pageNum}&pageSize=${data.pageSize}&startTime=${data.startTime}&endTime=${data.endTime}&username=${data.username}&depName=${data.depname}`); await axios.get(`/user/page?pageNum=${data.pageNum}&pageSize=${data.pageSize}&startTime=${data.startTime}&endTime=${data.endTime}&username=${data.username}&depName=${data.depname}`);
...@@ -56,6 +59,8 @@ export const api_getDepList = async (): Promise<any> => await axios.get('/dep/li ...@@ -56,6 +59,8 @@ export const api_getDepList = async (): Promise<any> => await axios.get('/dep/li
export const api_putPassword = async (data:any): Promise<any> => await axios.put(`/user/password/${data.id}/${data.password}`); export const api_putPassword = async (data:any): Promise<any> => await axios.put(`/user/password/${data.id}/${data.password}`);
export const api_getRoleId = async (id:any): Promise<any> => await axios.get(`/role/${id}`);
// ------------------- 角色管理接口 ------------------ // ------------------- 角色管理接口 ------------------
export const api_rolePage = async (data: any): Promise<any> => export const api_rolePage = async (data: any): Promise<any> =>
await axios.get(`/role/page?pageNum=${data.pageNum}&pageSize=${data.pageSize}&roleName=${data.rolename}&startTime=${data.startTime}&endTime=${data.endTime}`); await axios.get(`/role/page?pageNum=${data.pageNum}&pageSize=${data.pageSize}&roleName=${data.rolename}&startTime=${data.startTime}&endTime=${data.endTime}`);
......
interface DetectionRecord { interface DetectionRecord {
type: string;
cardId: any;
id: number; id: number;
videoName: string; videoName: string;
cameraName: string; cameraName: string;
......
...@@ -32,4 +32,25 @@ export const create3D = async (viewer: any, url: any, height = 0) => { ...@@ -32,4 +32,25 @@ export const create3D = async (viewer: any, url: any, height = 0) => {
tiles.modelMatrix = Cesium.Matrix4.fromTranslation(translate); tiles.modelMatrix = Cesium.Matrix4.fromTranslation(translate);
create3D.id = viewer.scene.primitives.add(tiles); create3D.id = viewer.scene.primitives.add(tiles);
viewer.zoomTo(tiles); viewer.zoomTo(tiles);
}
export function pointLine(viewer) {
let polygonCoordList = [
122.04454563914409,37.489284875763744,
122.04561831986973,37.487027958982864,
122.05006039343479,37.48821693911029,
122.04881042851096,37.49135388724233,
]
// 创建红色线圈
viewer.entities.add({
id: 'allTotalArea',
name: 'allTotalArea',
polyline: {
positions: Cesium.Cartesian3.fromDegreesArray(polygonCoordList),
width: 4,
material: Cesium.Color.RED,
clampToGround: true, // 禁用贴地
},
})
} }
\ No newline at end of file
...@@ -182,17 +182,19 @@ function densifyPoints(positions: any[], stepSize: number = 2.0) { ...@@ -182,17 +182,19 @@ function densifyPoints(positions: any[], stepSize: number = 2.0) {
} }
export async function createNewPositionHeight(position: any, viewer: any) { export async function createNewPositionHeight(position: any, viewer: any) {
const denseCoordinates = densifyPoints(position, 10.0); // 每隔2米插入一个点 const denseCoordinates = densifyPoints(position, 20.0); // 每隔20米插入一个点
let clampedPositions: any[] = []; let clampedPositions: any[] = [];
try { try {
const updatedPositions = await viewer.scene.clampToHeightMostDetailed(denseCoordinates); const updatedPositions = await viewer.scene.clampToHeightMostDetailed(denseCoordinates);
for(let item of updatedPositions) {
clampedPositions = updatedPositions.map((pos: any) => { if(item) {
const cartographic = Cesium.Cartographic.fromCartesian(pos); const cartographic = Cesium.Cartographic.fromCartesian(item);
return Cesium.Cartesian3.fromRadians(cartographic.longitude, cartographic.latitude, cartographic.height + 0.8); let dataPoints = Cesium.Cartesian3.fromRadians(cartographic.longitude, cartographic.latitude, cartographic.height + 6);
}); clampedPositions.push(dataPoints);
}
}
} catch (error) { } catch (error) {
console.warn('高度贴合计算失败或部分失败:', error); console.warn('高度贴合计算失败或部分失败:', error);
clampedPositions = denseCoordinates; clampedPositions = denseCoordinates;
......
...@@ -2,7 +2,7 @@ import { loadEnv } from "vite"; ...@@ -2,7 +2,7 @@ import { loadEnv } from "vite";
import { getModelNewApi } from "../index"; import { getModelNewApi } from "../index";
export async function getModel() { export async function getModel() {
const url = 'http://192.168.2.53:9995/model/' const url = 'http://192.168.2.67:9995/model/'
let res = await getModelNewApi(); let res = await getModelNewApi();
......
...@@ -188,11 +188,13 @@ export async function createNewPositionHeight(position: any, viewer: any) { ...@@ -188,11 +188,13 @@ export async function createNewPositionHeight(position: any, viewer: any) {
try { try {
const updatedPositions = await viewer.scene.clampToHeightMostDetailed(denseCoordinates); const updatedPositions = await viewer.scene.clampToHeightMostDetailed(denseCoordinates);
for(let item of updatedPositions) {
clampedPositions = updatedPositions.map((pos: any) => { if(item) {
const cartographic = Cesium.Cartographic.fromCartesian(pos); const cartographic = Cesium.Cartographic.fromCartesian(item);
return Cesium.Cartesian3.fromRadians(cartographic.longitude, cartographic.latitude, cartographic.height + 6); let dataPoints = Cesium.Cartesian3.fromRadians(cartographic.longitude, cartographic.latitude, cartographic.height + 6);
}); clampedPositions.push(dataPoints);
}
}
} catch (error) { } catch (error) {
console.warn('高度贴合计算失败或部分失败:', error); console.warn('高度贴合计算失败或部分失败:', error);
clampedPositions = denseCoordinates; clampedPositions = denseCoordinates;
...@@ -224,7 +226,6 @@ export async function startVehicleMovement(viewer: any, totalDuration: number) { ...@@ -224,7 +226,6 @@ export async function startVehicleMovement(viewer: any, totalDuration: number) {
for (let i = 0; i < rawCoordinates.length - 1; i++) { for (let i = 0; i < rawCoordinates.length - 1; i++) {
totalDistance += Cesium.Cartesian3.distance(rawCoordinates[i], rawCoordinates[i + 1]); totalDistance += Cesium.Cartesian3.distance(rawCoordinates[i], rawCoordinates[i + 1]);
} }
let accumulatedTime = 0; let accumulatedTime = 0;
positionProperty.addSample(viewer.clock.currentTime, rawCoordinates[0]); positionProperty.addSample(viewer.clock.currentTime, rawCoordinates[0]);
......
...@@ -89,12 +89,16 @@ ...@@ -89,12 +89,16 @@
<template v-if="boundaryData.length > 0"> <template v-if="boundaryData.length > 0">
<template v-for="(item, index) in boundaryData" :key="index"> <template v-for="(item, index) in boundaryData" :key="index">
<dd class="list-item" :class="getItemClass(item)"> <dd class="list-item" :class="getItemClass(item)">
<span>{{ item.driver }}</span> <span>{{ item.driver || item.carName }}</span>
<span>{{ item.licensePlate }}</span> <span>{{ item.licensePlate || item.id }}</span>
<span class="time-cell"> <span class="time-cell" v-if="item.boundaryTime">
<div class="date-part">{{ item.boundaryTime?.split(' ')[0] }}</div> <div class="date-part">{{ item.boundaryTime?.split(' ')[0] }}</div>
<div class="time-part">{{ item.boundaryTime?.split(' ')[1] }}</div> <div class="time-part">{{ item.boundaryTime?.split(' ')[1] }}</div>
</span> </span>
<span class="time-cell" v-if="item.createTime">
<div class="date-part">{{ item.createTime?.split(' ')[0] }}</div>
<div class="time-part">{{ item.createTime?.split(' ')[1] }}</div>
</span>
</dd> </dd>
</template> </template>
</template> </template>
......
...@@ -55,10 +55,10 @@ function goToCesium() { ...@@ -55,10 +55,10 @@ function goToCesium() {
<img src="@/assets/daping.png" alt="" style="width: 16px; height: 16px; margin-right: 4px" /> <img src="@/assets/daping.png" alt="" style="width: 16px; height: 16px; margin-right: 4px" />
大屏 大屏
</NButton> </NButton>
<NButton quaternary circle style="width: 60px"> <!-- <NButton quaternary circle style="width: 60px">
<img src="@/assets/qiehuan.png" alt="" style="width: 16px; height: 16px; margin-right: 4px" /> <img src="@/assets/qiehuan.png" alt="" style="width: 16px; height: 16px; margin-right: 4px" />
切换 切换
</NButton> </NButton> -->
<!-- <!--
<NButton quaternary circle style="width: 60px" > <NButton quaternary circle style="width: 60px" >
<img src="@/assets/yonghu.png" alt="" style="width: 16px; height: 16px; margin-right: 4px" /> <img src="@/assets/yonghu.png" alt="" style="width: 16px; height: 16px; margin-right: 4px" />
......
...@@ -8,6 +8,7 @@ import { useThemeStore } from '@/store/modules/theme'; ...@@ -8,6 +8,7 @@ import { useThemeStore } from '@/store/modules/theme';
import { useRouteStore } from '@/store/modules/route'; import { useRouteStore } from '@/store/modules/route';
import { useRouterPush } from '@/hooks/common/router'; import { useRouterPush } from '@/hooks/common/router';
import { useMenu } from '../context'; import { useMenu } from '../context';
import { localStg } from '@/utils/storage';
defineOptions({ defineOptions({
name: 'VerticalMenu' name: 'VerticalMenu'
...@@ -51,11 +52,12 @@ watch( ...@@ -51,11 +52,12 @@ watch(
:collapsed="appStore.siderCollapse" :collapsed="appStore.siderCollapse"
:collapsed-width="themeStore.sider.collapsedWidth" :collapsed-width="themeStore.sider.collapsedWidth"
:collapsed-icon-size="22" :collapsed-icon-size="22"
:options="routeStore.menus" :options="localStg.get('routerList')"
:inverted="inverted" :inverted="inverted"
:indent="18" :indent="18"
@update:value="routerPushByKeyWithMetaQuery" @update:value="routerPushByKeyWithMetaQuery"
/> />
<!-- :options="localStg.get('routerList')" -->
</SimpleScrollbar> </SimpleScrollbar>
</Teleport> </Teleport>
</template> </template>
......
...@@ -222,7 +222,7 @@ const local: App.I18n.Schema = { ...@@ -222,7 +222,7 @@ const local: App.I18n.Schema = {
404: '页面不存在', 404: '页面不存在',
500: '服务器错误', 500: '服务器错误',
'iframe-page': '外链页面', 'iframe-page': '外链页面',
cesiumdeom: 'Cesium大屏', cesiumdeom: '综合大屏',
home: '越界开采系统', home: '越界开采系统',
home_police: '报警列表', home_police: '报警列表',
home_rail: '电子围栏管理', home_rail: '电子围栏管理',
......
...@@ -38,9 +38,9 @@ export function createRouteGuard(router: Router) { ...@@ -38,9 +38,9 @@ export function createRouteGuard(router: Router) {
const hasRole = authStore.userInfo.roles.some(role => routeRoles.includes(role)); const hasRole = authStore.userInfo.roles.some(role => routeRoles.includes(role));
const hasAuth = authStore.isStaticSuper || !routeRoles.length || hasRole; const hasAuth = authStore.isStaticSuper || !routeRoles.length || hasRole;
// if it is login route when logged in, then switch to the root page // if it is login route when logged in, then switch to the home page
if (to.name === loginRoute && isLogin) { if (to.name === loginRoute && isLogin) {
next({ name: rootRoute }); next({ path: '/home' });
return; return;
} }
......
...@@ -30,6 +30,7 @@ export const router = createRouter({ ...@@ -30,6 +30,7 @@ export const router = createRouter({
routes routes
}); });
/** Setup Vue Router */ /** Setup Vue Router */
export async function setupRouter(app: App) { export async function setupRouter(app: App) {
app.use(router); app.use(router);
...@@ -38,6 +39,6 @@ export async function setupRouter(app: App) { ...@@ -38,6 +39,6 @@ export async function setupRouter(app: App) {
} }
router.beforeEach((to, from, next) => { router.beforeEach((to, from, next) => {
connect(); connect('home');
next(); next();
}); });
...@@ -5,7 +5,7 @@ import { getRoutePath, transformElegantRoutesToVueRoutes } from '../elegant/tran ...@@ -5,7 +5,7 @@ import { getRoutePath, transformElegantRoutesToVueRoutes } from '../elegant/tran
export const ROOT_ROUTE: CustomRoute = { export const ROOT_ROUTE: CustomRoute = {
name: 'root', name: 'root',
path: '/', path: '/',
redirect: getRoutePath(import.meta.env.VITE_ROUTE_HOME) || '/home', redirect: '/login',
meta: { meta: {
title: 'root', title: 'root',
constant: true constant: true
......
...@@ -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'); const data = recordObject;
router.push('/login'); console.log('111', data);
if (data.type == 'router') {
router.push({
path: '/personnel/track',
query: {
cardId: data.cardId
}
});
} else { } else {
// 处理接收到的数据
const data = recordObject;
if (true) { if (true) {
playAudio(data.algorithmId); playAudio(data.algorithmId);
} }
...@@ -102,7 +108,7 @@ export function connect() { ...@@ -102,7 +108,7 @@ export function connect() {
]) ])
]), ]),
h(NRow, { gutter: 10, style: { marginTop: '10px' } }, [ h(NRow, { gutter: 10, style: { marginTop: '10px' } }, [
h(NCol, { span: 7 },[ h(NCol, { span: 7 }, [
h('div', { style: { fontSize: '14px', textAlign: 'center' } }, [ h('div', { style: { fontSize: '14px', textAlign: 'center' } }, [
h('span', '报警图片:') h('span', '报警图片:')
]) ])
...@@ -110,59 +116,14 @@ export function connect() { ...@@ -110,59 +116,14 @@ export function connect() {
h(NCol, { span: 15 }, [ h(NCol, { span: 15 }, [
h('img', { h('img', {
style: { height: '100px', width: '200px' }, style: { height: '100px', width: '200px' },
src: 'http://192.168.2.53:9995/image/979fc62b9f3a4097933e6e0a0aed489d.jpg' src: 'http://192.168.2.67:9995/image/979fc62b9f3a4097933e6e0a0aed489d.jpg'
}) })
]), ]),
// h(NCol, { span: 12 }, [
// h(NSpace, { vertical: true, justify: 'space-between' }, [
// // h('div', [
// // h(NButton, { quaternary: true, round: true }, () => data.cameraName || ''),
// // h('div', { style: { fontSize: '14px' } }, [
// // h(
// // NButton,
// // {
// // quaternary: true,
// // round: true,
// // type: 'info',
// // onClick: () => toLogPage(data)
// // },
// // () => '查看详情'
// // )
// // ])
// // ]),
// // h('div', { style: { display: 'flex', justifyContent: 'space-between', marginTop: '20px' } }, [
// // h(
// // NButton,
// // {
// // strong: true,
// // secondary: true,
// // size: 'small',
// // // onClick: () => modifyAlramStatus(data.id, '1')
// // style: {
// // color: 'white',
// // backgroundColor: '#2196f3'
// // }
// // },
// // () => '正确报警'
// // ),
// // h(
// // NButton,
// // {
// // strong: true,
// // secondary: true,
// // size: 'small',
// // style: { marginLeft: '20px', color: 'white', backgroundColor: '#f57b70' }
// // // onClick: () => modifyAlramStatus(data.id, '2')
// // },
// // () => '错误报警'
// // )
// // ])
// ])
// ])
]) ])
]) ])
}); });
} }
// 处理收到的消息 // 处理收到的消息
}; };
......
<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 {
getCameraIdApi, api_getRoleId,
getCarPointAllCarApi, getCameraIdApi,
getCemeraPointApi, getCarPointAllCarApi,
getFenceListsApi, getCemeraPointApi,
getHomeCarApi, getFenceListsApi,
getMonitorIdApi, getHomeCarApi,
getMonitorPointApi, getMonitorIdApi,
getPointAllPersonApi, getMonitorPointApi,
getPointListApi getPointAllPersonApi,
} from '@/api'; getPointListApi
import { create3D } from '@/api/utils/cesium'; } from '@/api';
import { getElevationFromRay, getElevationFromRays } from '@/api/utils/cesiumUtil'; import { create3D, pointLine } from '@/api/utils/cesium';
import { cesiumToLongitudeAndLatitude } from '@/api/utils/coordinateUtil'; import { getElevationFromRay, getElevationFromRays } from '@/api/utils/cesiumUtil';
import { getModel } from '@/api/utils/cesiumModel'; import { cesiumToLongitudeAndLatitude } from '@/api/utils/coordinateUtil';
import { iconPoint } from '@/api/utils/home/cesiumPositions'; import { getModel } from '@/api/utils/cesiumModel';
import { carSpeed } from '@/api/utils/carSpeed'; import { iconPoint } from '@/api/utils/home/cesiumPositions';
import fullScreen from '@/utils/full'; import { carSpeed } from '@/api/utils/carSpeed';
import { webVideo } from '@/utils/ai'; import fullScreen from '@/utils/full';
import bluePersonIcon from '@/assets/blueperson.png'; import { webVideo } from '@/utils/ai';
import arrowLeftImg from '@/assets/jinrun/arrow-left.png'; import bluePersonIcon from '@/assets/blueperson.png';
import arrowRightImg from '@/assets/jinrun/arrow-right.png'; import arrowLeftImg from '@/assets/jinrun/arrow-left.png';
import redCarIcon from '@/assets/icon15Red.png'; import arrowRightImg from '@/assets/jinrun/arrow-right.png';
import redVideoIcon from '@/assets/icon16Red.png'; import redCarIcon from '@/assets/icon15Red.png';
import redBianIcon from '@/assets/icon17Red.png'; import redVideoIcon from '@/assets/icon16Red.png';
import redPersonIcon from '../../../assets/redperson.png'; import redBianIcon from '@/assets/icon17Red.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 MultiSelect from './appselect.vue'; import redPersonIcon from '../../../assets/redperson.png';
import MultiSelect from './appselect.vue';
let viewer: any = null; import { useRouteStore } from '@/store/modules/route';
const message = useMessage(); import { router } from '@/router';
let personEntity: any; import { localStg } from '@/utils/storage';
const pins: any = [];
const full = ref(false); let viewer: any = null;
let entityId: any; const message = useMessage();
let link: any; let personEntity: any;
let speed = 0; const pins: any = [];
let text = ''; const full = ref(false);
const personList = ref([]); let entityId: any;
const modelData = ref([ const routeStore = useRouteStore();
[122.04736846370741, 37.48958083145254], let link: any;
[122.04760069379522, 37.489226301608184], let speed = 0;
[122.04823299200363, 37.489451482540346], let text = '';
[122.04802271634016, 37.48983410372907], const personList = ref([]);
[122.04748237248322, 37.49016152294277] const modelData = ref([
]); [122.04736846370741, 37.48958083145254],
[122.04760069379522, 37.489226301608184],
const options = [ [122.04823299200363, 37.489451482540346],
{ [122.04802271634016, 37.48983410372907],
label: '全选', [122.04748237248322, 37.49016152294277]
value: '1' ]);
},
{ const options = [
label: '在线监测设备', {
value: '3' label: '全选',
}, value: '1'
{ },
label: '视频监控', {
value: '2' label: '在线监测设备',
}, value: '3'
{ },
label: '人员定位', {
value: '4' label: '视频监控',
}, value: '2'
{ },
label: '车辆定位', {
value: '5' label: '人员定位',
}, value: '4'
{ },
label: '越界开采', {
value: '6' label: '车辆定位',
value: '5'
},
{
label: '越界开采',
value: '6'
}
];
const value = ref(options.map(opt => opt.value));
const data = ref([]);
const datasouce = ref();
const fence = ref<any>();
const personShow = ref(false);
const carShow = ref(false);
const equipmentShow = ref(false);
const videoShow = ref(false);
const treeFence = ref<any>([]);
const wallEntities = ref<any[]>([]);
const iconEntities = ref<any[]>([]);
const fenceData = ref({
imagePath: '',
imageColor: ''
});
const labelData = ref<any>();
const formData = ref([]);
// zhaojunbao 开始
// REM自适应配置
const active = ref(false);
const REM_CONFIG = {
// 设计稿宽度
designWidth: 1920,
designHeight: 1080,
// 基准值:1rem = 100px
baseSize: 100
};
// 动态路由
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);
} }
]; }
const value = ref(options.map(opt => opt.value));
const data = ref([]);
const datasouce = ref();
const fence = ref<any>();
const personShow = ref(false);
const carShow = ref(false);
const equipmentShow = ref(false);
const videoShow = ref(false);
const treeFence = ref<any>([]);
const wallEntities = ref<any[]>([]);
const iconEntities = ref<any[]>([]);
const fenceData = ref({
imagePath: '',
imageColor: ''
});
const labelData = ref<any>();
const formData = ref([]);
// zhaojunbao 开始
// REM自适应配置
const active = ref(false);
const REM_CONFIG = {
// 设计稿宽度
designWidth: 1920,
designHeight: 1080,
// 基准值:1rem = 100px
baseSize: 100
};
// 跳转首页
const navTo = () => {
window.location.href = '/home';
};
/**
* 设置REM单位
* 根据窗口宽度动态计算根元素font-size
*/
const setRemUnit = () => {
const { designWidth, designHeight, baseSize } = REM_CONFIG;
// 获取当前窗口尺寸
const windowWidth = window.innerWidth;
const windowHeight = window.innerHeight;
// 计算宽高缩放比例
const scaleX = windowWidth / designWidth;
const scaleY = windowHeight / designHeight;
// 取较小的缩放比例以适应屏幕,确保内容不会被裁剪
const scale = Math.min(scaleX, scaleY);
// 设置根元素font-size,确保最小为50px(可选)
const fontSize = Math.max(baseSize * scale, 50);
document.documentElement.style.fontSize = `${fontSize}px`;
};
// 控制左右模块显示状态的响应式变量
const isLeftModulesVisible = ref(true);
const isRightModulesVisible = ref(true);
const toggleBothModules = () => { localStg.set('routerList', routeList)
isLeftModulesVisible.value = !isLeftModulesVisible.value; window.location.href = '/home';
isRightModulesVisible.value = !isRightModulesVisible.value; };
/**
* 设置REM单位
* 根据窗口宽度动态计算根元素font-size
*/
const setRemUnit = () => {
const { designWidth, designHeight, baseSize } = REM_CONFIG;
// 获取当前窗口尺寸
const windowWidth = window.innerWidth;
const windowHeight = window.innerHeight;
// 计算宽高缩放比例
const scaleX = windowWidth / designWidth;
const scaleY = windowHeight / designHeight;
// 取较小的缩放比例以适应屏幕,确保内容不会被裁剪
const scale = Math.min(scaleX, scaleY);
// 设置根元素font-size,确保最小为50px(可选)
const fontSize = Math.max(baseSize * scale, 50);
document.documentElement.style.fontSize = `${fontSize}px`;
};
// 控制左右模块显示状态的响应式变量
const isLeftModulesVisible = ref(true);
const isRightModulesVisible = ref(true);
const toggleBothModules = () => {
isLeftModulesVisible.value = !isLeftModulesVisible.value;
isRightModulesVisible.value = !isRightModulesVisible.value;
};
// zhaojunbao 结束
// 模型
function add3dtiles() {
const CesiumConfig = {
defaultAccessToken:
'eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJqdGkiOiI2NTE1OTUxOS1jNTc5LTQwNmMtOWU5My1jNTI3NTIyYzAxNTUiLCJpZCI6MjUwODM5LCJpYXQiOjE3Mjk5MjE1MzV9.xromwPD3oA1e0YsWV035DE5KmYvivkC6fxt344vwObA'
}; };
// zhaojunbao 结束
// 模型 Cesium.Ion.defaultAccessToken = CesiumConfig.defaultAccessToken;
function add3dtiles() {
const CesiumConfig = { viewer = new Cesium.Viewer('cesiumContainer', {
defaultAccessToken: geocoder: false,
'eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJqdGkiOiI2NTE1OTUxOS1jNTc5LTQwNmMtOWU5My1jNTI3NTIyYzAxNTUiLCJpZCI6MjUwODM5LCJpYXQiOjE3Mjk5MjE1MzV9.xromwPD3oA1e0YsWV035DE5KmYvivkC6fxt344vwObA' homeButton: false,
}; infoBox: false,
animation: false,
Cesium.Ion.defaultAccessToken = CesiumConfig.defaultAccessToken; fullscreenButton: false,
enableCompass: true, // 启用指南针
viewer = new Cesium.Viewer('cesiumContainer', { enableCompassOuterRing: true, // 启用指南针外环
geocoder: false, sceneModePicker: false,
homeButton: false, timeline: false,
infoBox: false, navigationHelpButton: false,
animation: false, baseLayerPicker: false,
fullscreenButton: false, enableZoomControls: false, // 禁用缩放控件
enableCompass: true, // 启用指南针 enableDistanceLegend: false, // 禁用比例尺
enableCompassOuterRing: true, // 启用指南针外环 selectionIndicator: false
sceneModePicker: false, });
timeline: false,
navigationHelpButton: false, viewer.scene.globe.depthTestAgainstTerrain = true;
baseLayerPicker: false, viewer.cesiumWidget.creditContainer.style.display = 'none';
enableZoomControls: false, // 禁用缩放控件 viewer.cesiumWidget.screenSpaceEventHandler.removeInputAction(Cesium.ScreenSpaceEventType.LEFT_DOUBLE_CLICK);
enableDistanceLegend: false, // 禁用比例尺 getModel().then(item => {
selectionIndicator: false create3D(viewer, item, 0);
});
}
// 监听选中值的变化
watch(
value,
(newVal, oldVal) => {
// 防止无限递归
if (JSON.stringify(newVal) === JSON.stringify(oldVal)) return;
// 获取除全选外的所有选项值
const otherValues = options.slice(1).map(opt => opt.value);
// 检查是否选中了所有其他选项
const allOtherSelected = otherValues.every(val => newVal.includes(val));
// 检查是否点击了全选
const allSelectedNow = newVal.includes('1');
const allSelectedBefore = oldVal.includes('1');
// 点击了全选选项
if (allSelectedNow && !allSelectedBefore) {
value.value = options.map(opt => opt.value);
return;
}
// 取消了全选选项
if (!allSelectedNow && allSelectedBefore) {
// 检查是否所有其他选项都被选中
const allOtherOptionsSelected = otherValues.every(val => newVal.includes(val));
if (allOtherOptionsSelected) {
// 如果所有其他选项都被选中,取消所有选中状态
value.value = [];
} else {
// 如果不是所有其他选项都被选中,只取消全选选项
value.value = newVal.filter(val => val !== '1');
}
return;
}
const someOptionUnselected = oldVal.length > newVal.length;
if (someOptionUnselected && allSelectedNow) {
// 如果取消了某个选项且当前处于全选状态,取消全选,但保留其他选项
value.value = newVal.filter(val => val !== '1');
}
// 选中了所有其他选项,自动选中全选
if (allOtherSelected && !allSelectedNow) {
value.value = options.map(opt => opt.value);
}
// 如果取消了所有选项,清空value
if (newVal.length === 0) {
value.value = [];
}
},
{ deep: true }
);
// 监听选择框的变化
watch(
value,
newValue => {
// 如果选中了"全选",显示所有实体
if (newValue.includes('1')) {
wallEntities.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 {
// 根据选中的选项显示对应实体
wallEntities.value.forEach(entity => {
entity.show = newValue.includes('6'); // 越界开采对应电子围栏
});
// 根据选中的选项显示对应图标和标签
pins.forEach(pin => {
const type = pin.type;
let shouldShow = false;
switch (type) {
case 1: // 人员定位
shouldShow = newValue.includes('4');
break;
case 2: // 车辆定位
shouldShow = newValue.includes('5');
break;
case 3: // 在线监测设备
shouldShow = newValue.includes('3');
break;
case 4: // 视频监控
shouldShow = newValue.includes('2');
break;
default:
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 }
);
async function fenceListGet() {
const res = await getFenceListsApi();
formData.value = res.data.data;
for (const item of res.data.data) {
const positions = item.coordinate.map((item: { xcoordinate: any; ycoordinate: any }) => {
return [item.xcoordinate, item.ycoordinate];
}); });
const heights: any = [];
viewer.scene.globe.depthTestAgainstTerrain = true; for (const data of item.coordinate) {
viewer.cesiumWidget.creditContainer.style.display = 'none'; const cartographic = Cesium.Cartographic.fromDegrees(data.xcoordinate, data.ycoordinate);
viewer.cesiumWidget.screenSpaceEventHandler.removeInputAction(Cesium.ScreenSpaceEventType.LEFT_DOUBLE_CLICK); const height = await getElevationFromRay(cartographic, viewer);
getModel().then(item => {
create3D(viewer, item, 0); heights.push(height);
}
electronic(positions, heights, item.rangeType);
}
}
// 电子围栏
function electronic(position: any, heightData: any, rangeType: any) {
function map_common_addDatasouce(datasouceName: string) {
let datasouce = viewer.dataSources._dataSources.find(t => {
return t && t.name == datasouceName;
}); });
if (!datasouce) {
datasouce = new Cesium.CustomDataSource(datasouceName);
viewer.dataSources.add(datasouce);
}
return datasouce;
} }
// 监听选中值的变化 function DynamicWallMaterialProperty(options: any) {
watch( this._definitionChanged = new Cesium.Event();
value, this._color = undefined;
(newVal, oldVal) => { this._colorSubscription = undefined;
// 防止无限递归 this.color = options.color || Color.BLUE;
if (JSON.stringify(newVal) === JSON.stringify(oldVal)) return; this.duration = options.duration || 1000;
this.trailImage = options.trailImage;
// 获取除全选外的所有选项值 this._time = new Date().getTime();
const otherValues = options.slice(1).map(opt => opt.value); }
// 检查是否选中了所有其他选项 function _getDirectionWallShader(options: any) {
const allOtherSelected = otherValues.every(val => newVal.includes(val)); if (options && options.get) {
// 检查是否点击了全选 let materail =
const allSelectedNow = newVal.includes('1'); 'czm_material czm_getMaterial(czm_materialInput materialInput)\n\
const allSelectedBefore = oldVal.includes('1'); {\n\
czm_material material = czm_getDefaultMaterial(materialInput);\n\
// 点击了全选选项 vec2 st = materialInput.st;';
if (allSelectedNow && !allSelectedBefore) { if (options.freely == 'vertical') {
value.value = options.map(opt => opt.value); // (由下到上)
return; materail += `vec4 colorImage = texture(image, vec2(fract(st.s), fract(float(${options.count})*st.t${
} options.direction
} time)));\n\ `;
// 取消了全选选项 } else {
if (!allSelectedNow && allSelectedBefore) { // (逆时针)
// 检查是否所有其他选项都被选中 materail += `vec4 colorImage = texture(image, vec2(fract(float(${options.count})*st.s ${
const allOtherOptionsSelected = otherValues.every(val => newVal.includes(val)); options.direction
if (allOtherOptionsSelected) { } time), fract(st.t)));\n\ `;
// 如果所有其他选项都被选中,取消所有选中状态
value.value = [];
} else {
// 如果不是所有其他选项都被选中,只取消全选选项
value.value = newVal.filter(val => val !== '1');
}
return;
}
const someOptionUnselected = oldVal.length > newVal.length;
if (someOptionUnselected && allSelectedNow) {
// 如果取消了某个选项且当前处于全选状态,取消全选,但保留其他选项
value.value = newVal.filter(val => val !== '1');
}
// 选中了所有其他选项,自动选中全选
if (allOtherSelected && !allSelectedNow) {
value.value = options.map(opt => opt.value);
} }
// 如果取消了所有选项,清空value // 泛光
if (newVal.length === 0) { materail +=
value.value = []; 'vec4 fragColor;\n\
fragColor.rgb = (colorImage.rgb+color.rgb) / 1.0;\n\
fragColor = czm_gammaCorrect(fragColor);\n\
material.diffuse = colorImage.rgb;\n\
material.alpha = colorImage.a;\n\
material.emission = fragColor.rgb;\n\
return material;\n\
}';
return materail;
}
}
Object.defineProperties(DynamicWallMaterialProperty.prototype, {
isConstant: {
get() {
return false;
} }
}, },
{ deep: true } definitionChanged: {
); get() {
return this._definitionChanged;
// 监听选择框的变化
watch(
value,
newValue => {
// 如果选中了"全选",显示所有实体
if (newValue.includes('1')) {
wallEntities.value.forEach(entity => (entity.show = true));
iconEntities.value.forEach(entity => (entity.show = true));
} else {
// 根据选中的选项显示对应实体
wallEntities.value.forEach(entity => {
entity.show = newValue.includes('6'); // 越界开采对应电子围栏
});
iconEntities.value.forEach(entity => {
const type = entity.properties?.type?.getValue();
switch (type) {
case 1: // 在线监测设备
entity.show = newValue.includes('3');
break;
case 2: // 视频监控
entity.show = newValue.includes('4');
break;
case 3: // 车辆定位
entity.show = newValue.includes('2');
break;
case 4: // 人员定位
case 5: // 人员定位
entity.show = newValue.includes('1');
break;
default:
entity.show = false;
}
});
} }
}, },
{ immediate: true } color: Cesium.createPropertyDescriptor('color')
); });
async function fenceListGet() { const MaterialType = `wallType${Number.parseInt(Math.random() * 1000)}`;
const res = await getFenceListsApi(); DynamicWallMaterialProperty.prototype.getType = function (time) {
return MaterialType;
formData.value = res.data.data; };
for (const item of res.data.data) { DynamicWallMaterialProperty.prototype.getValue = function (time, result) {
const positions = item.coordinate.map((item: { xcoordinate: any; ycoordinate: any }) => { if (!Cesium.defined(result)) {
return [item.xcoordinate, item.ycoordinate]; result = {};
});
const heights: any = [];
for (const data of item.coordinate) {
const cartographic = Cesium.Cartographic.fromDegrees(data.xcoordinate, data.ycoordinate);
const height = await getElevationFromRay(cartographic, viewer);
heights.push(height);
}
electronic(positions, heights, item.rangeType);
} }
} result.color = Cesium.Property.getValueOrClonedDefault(this._color, time, Cesium.Color.WHITE, result.color);
result.image = this.trailImage;
// 电子围栏 if (this.duration) {
function electronic(position: any, heightData: any, rangeType: any) { result.time = ((new Date().getTime() - this._time) % this.duration) / this.duration;
function map_common_addDatasouce(datasouceName: string) {
let datasouce = viewer.dataSources._dataSources.find(t => {
return t && t.name == datasouceName;
});
if (!datasouce) {
datasouce = new Cesium.CustomDataSource(datasouceName);
viewer.dataSources.add(datasouce);
}
return datasouce;
} }
viewer.scene.requestRender();
function DynamicWallMaterialProperty(options: any) { return result;
this._definitionChanged = new Cesium.Event(); };
this._color = undefined;
this._colorSubscription = undefined; DynamicWallMaterialProperty.prototype.equals = function (other) {
this.color = options.color || Color.BLUE; return (
this.duration = options.duration || 1000; this === other ||
this.trailImage = options.trailImage; (other instanceof DynamicWallMaterialProperty && Cesium.Property.equals(this._color, other._color))
this._time = new Date().getTime(); );
};
Cesium.Material._materialCache.addMaterial(MaterialType, {
fabric: {
type: MaterialType,
uniforms: {
color: new Cesium.Color(1.0, 0.0, 0.0, 0.1),
image: Cesium.Material.DefaultImageId,
time: -20
},
source: _getDirectionWallShader({
get: true,
count: 3.0,
freely: 'vertical',
direction: '-'
})
},
translucent(material) {
return true;
} }
function _getDirectionWallShader(options: any) { });
if (options && options.get) { Cesium.DynamicWallMaterialProperty = DynamicWallMaterialProperty;
let materail =
'czm_material czm_getMaterial(czm_materialInput materialInput)\n\ function loadWall() {
{\n\ position.push(position[0]);
czm_material material = czm_getDefaultMaterial(materialInput);\n\ heightData.push(heightData[0]);
vec2 st = materialInput.st;';
if (options.freely == 'vertical') { const data = position.map((item: any) => {
// (由下到上) return item;
materail += `vec4 colorImage = texture(image, vec2(fract(st.s), fract(float(${options.count})*st.t${ });
options.direction const heightMax = heightData.map((item: any) => {
} time)));\n\ `; return item;
} else { });
// (逆时针)
materail += `vec4 colorImage = texture(image, vec2(fract(float(${options.count})*st.s ${ const coor = Array.prototype.concat.apply([], data);
options.direction
} time), fract(st.t)));\n\ `; const minHeightList = heightMax.map((item: any) => {
return item + 30;
});
datasouce.value = map_common_addDatasouce('wall');
if (fence.value) {
if (treeFence.value.length > 0) {
for (const item of treeFence.value) {
datasouce.value.entities.remove(item);
} }
// 泛光
materail +=
'vec4 fragColor;\n\
fragColor.rgb = (colorImage.rgb+color.rgb) / 1.0;\n\
fragColor = czm_gammaCorrect(fragColor);\n\
material.diffuse = colorImage.rgb;\n\
material.alpha = colorImage.a;\n\
material.emission = fragColor.rgb;\n\
return material;\n\
}';
return materail;
} }
} }
Object.defineProperties(DynamicWallMaterialProperty.prototype, { if (rangeType == 1) {
isConstant: { fenceData.value = {
get() { imagePath: '/src/assets/wallss.png',
return false; imageColor: 'Cesium.Color.ORANGE'
} };
}, } else if (rangeType == 2) {
definitionChanged: { fenceData.value = {
get() { imagePath: '/src/assets/walls.png',
return this._definitionChanged; imageColor: 'Cesium.Color.CYAN'
} };
}, } else {
color: Cesium.createPropertyDescriptor('color') fenceData.value = {
}); imagePath: '/src/assets/wallsRed.png',
imageColor: 'Cesium.Color.RED'
const MaterialType = `wallType${Number.parseInt(Math.random() * 1000)}`; };
DynamicWallMaterialProperty.prototype.getType = function (time) { }
return MaterialType;
}; const entity = datasouce.value.entities.add({
wall: {
DynamicWallMaterialProperty.prototype.getValue = function (time, result) { positions: Cesium.Cartesian3.fromDegreesArray(coor),
if (!Cesium.defined(result)) { maximumHeights: heightMax,
result = {}; minimumHeights: minHeightList,
} material: new Cesium.DynamicWallMaterialProperty({
result.color = Cesium.Property.getValueOrClonedDefault(this._color, time, Cesium.Color.WHITE, result.color); trailImage: fenceData.value.imagePath,
result.image = this.trailImage; color: fenceData.value.imageColor,
if (this.duration) { duration: 1500
result.time = ((new Date().getTime() - this._time) % this.duration) / this.duration;
}
viewer.scene.requestRender();
return result;
};
DynamicWallMaterialProperty.prototype.equals = function (other) {
return (
this === other ||
(other instanceof DynamicWallMaterialProperty && Cesium.Property.equals(this._color, other._color))
);
};
Cesium.Material._materialCache.addMaterial(MaterialType, {
fabric: {
type: MaterialType,
uniforms: {
color: new Cesium.Color(1.0, 0.0, 0.0, 0.1),
image: Cesium.Material.DefaultImageId,
time: -20
},
source: _getDirectionWallShader({
get: true,
count: 3.0,
freely: 'vertical',
direction: '-'
}) })
},
translucent(material) {
return true;
} }
}); });
Cesium.DynamicWallMaterialProperty = DynamicWallMaterialProperty;
wallEntities.value.push(entity);
function loadWall() { // 保存围栏数据用于边界检测
position.push(position[0]); window.fenceData = position;
heightData.push(heightData[0]);
const data = position.map((item: any) => {
return item;
});
const heightMax = heightData.map((item: any) => {
return item;
});
const coor = Array.prototype.concat.apply([], data);
const minHeightList = heightMax.map((item: any) => {
return item + 30;
});
datasouce.value = map_common_addDatasouce('wall');
if (fence.value) {
if (treeFence.value.length > 0) {
for (const item of treeFence.value) {
datasouce.value.entities.remove(item);
}
}
}
if (rangeType == 1) {
fenceData.value = {
imagePath: '/src/assets/wallss.png',
imageColor: 'Cesium.Color.ORANGE'
};
} else if (rangeType == 2) {
fenceData.value = {
imagePath: '/src/assets/walls.png',
imageColor: 'Cesium.Color.CYAN'
};
} else {
fenceData.value = {
imagePath: '/src/assets/wallsRed.png',
imageColor: 'Cesium.Color.RED'
};
}
const entity = datasouce.value.entities.add({
wall: {
positions: Cesium.Cartesian3.fromDegreesArray(coor),
maximumHeights: heightMax,
minimumHeights: minHeightList,
material: new Cesium.DynamicWallMaterialProperty({
trailImage: fenceData.value.imagePath,
color: fenceData.value.imageColor,
duration: 1500
})
}
});
wallEntities.value.push(entity);
// 保存围栏数据用于边界检测
window.fenceData = position;
}
loadWall();
} }
loadWall();
// 点击弹框隐藏 }
function videosShow() {
if (videoShow.value == true) { // 点击弹框隐藏
videoShow.value = false; function videosShow() {
iconShow(); if (videoShow.value == true) {
} videoShow.value = false;
iconShow();
} }
function equipmentsShow() { }
if (equipmentShow.value == true) { function equipmentsShow() {
equipmentShow.value = false; if (equipmentShow.value == true) {
iconShow(); equipmentShow.value = false;
} iconShow();
} }
function carsShow() { }
if (carShow.value == true) { function carsShow() {
carShow.value = false; if (carShow.value == true) {
iconShow(); carShow.value = false;
iconShow();
}
}
function personsShow() {
if (personShow.value == true) {
personShow.value = false;
iconShow();
}
}
function iconShow() {
for (const item of pins) {
if (item.type == 1) {
item.image = bluePersonIcon;
} else if (item.type == 2) {
item.image = blueCarIcon;
} else if (item.type == 3) {
item.image = blueBianIcon;
} else {
item.image = blueVideoIcon;
} }
} }
function personsShow() { iconPoint(viewer, pins);
if (personShow.value == true) { }
// 设置员工类型
function getPersonTypeName(type: number): string {
switch (type) {
case 1:
return '员工';
case 2:
return '访客';
default:
return '没有该类型';
}
}
async function setTimePerson() {
const res = await getPointAllPersonApi();
for (const item of pins) {
const pin = res.data.data.find((personData: any) => personData.cardId == item.id);
if (pin) {
personShow.value = false; personShow.value = false;
iconShow(); item.image = bluePersonIcon;
item.position = {
lon: pin.lon,
lat: pin.lat
};
} }
} }
const carRes = await getCarPointAllCarApi();
function iconShow() { for (const item of pins) {
const pin = carRes.data.data.find((carData: any) => carData.carNumber == item.id);
if (pin) {
carShow.value = false;
item.image = blueCarIcon;
item.position = {
lon: pin.lon,
lat: pin.lat
};
}
}
iconPoint(viewer, pins);
}
setInterval(setTimePerson, 20 * 1000);
// setInterval(setTimePerson, 2 * 60 * 1000);
onMounted(async () => {
add3dtiles();
pointLine(viewer);
setTimeout(async () => {
fenceListGet();
const res = await getPointAllPersonApi();
const personData = res.data.data;
personData.map(item => {
pins.push({
id: item.cardId,
name: item.realName,
type: 1,
image: bluePersonIcon,
position: {
lon: item.lon,
lat: item.lat
},
data: item,
entity: null
});
});
// 获取并显示车辆数据,使用不同的前缀
const resCar = await getCarPointAllCarApi();
const carData = resCar.data.data;
carData.map(item => {
pins.push({
id: item.carNumber,
name: item.carNumber,
type: 2,
image: blueCarIcon,
position: {
lon: item.lon,
lat: item.lat
},
data: item,
entity: null
});
});
// 获取在线监测
const resPoint = await getMonitorPointApi();
const pointData = resPoint.data.data;
pointData.map(item => {
pins.push({
id: item.id,
type: 3,
name: item.equipname,
image: blueBianIcon,
position: {
lon: item.longitude,
lat: item.latitude
},
data: item,
entity: null,
label: null
});
});
// 获取视频监控信息
const resVideo = await getCemeraPointApi();
const videoData = resVideo.data.data;
videoData.map(item => {
pins.push({
id: item.id,
name: item.cameraName,
type: 4,
image: blueVideoIcon,
position: {
lon: item.lon,
lat: item.lat
},
data: item,
entity: null
});
});
iconPoint(viewer, pins).then(result => {
console.log(result);
});
}, 2000);
// setTimePerson();
setRemUnit();
// 监听窗口大小变化
window.addEventListener('resize', setRemUnit);
// zhaojunbao 结束
const handler = new Cesium.ScreenSpaceEventHandler(viewer.scene.canvas);
handler.setInputAction(async function (click: any) {
const pickedObject = viewer.scene.pick(click.position);
for (const item of pins) { for (const item of pins) {
if (item.type == 1) { if (item.type == 1) {
item.image = bluePersonIcon; item.image = bluePersonIcon;
...@@ -504,1037 +689,886 @@ ...@@ -504,1037 +689,886 @@
item.image = blueVideoIcon; item.image = blueVideoIcon;
} }
} }
iconPoint(viewer, pins);
} if (Cesium.defined(pickedObject) && Cesium.defined(pickedObject.id)) {
const pin = pins.find(item => item.entity === pickedObject.id);
// 设置员工类型
function getPersonTypeName(type: number): string { if (pin.type == 1) {
switch (type) { equipmentShow.value = false;
case 1: videoShow.value = false;
return '员工';
case 2:
return '访客';
default:
return '没有该类型';
}
}
async function setTimePerson() {
const res = await getPointAllPersonApi();
for (const item of pins) {
const pin = res.data.data.find((personData: any) => personData.cardId == item.id);
if (pin) {
personShow.value = false;
item.image = bluePersonIcon;
item.position = {
lon: pin.lon,
lat: pin.lat
};
}
}
const carRes = await getCarPointAllCarApi();
for (const item of pins) {
const pin = carRes.data.data.find((carData: any) => carData.carNumber == item.id);
if (pin) {
carShow.value = false; carShow.value = false;
item.image = blueCarIcon; personShow.value = true;
item.position = { labelData.value = pin.data;
lon: pin.lon,
lat: pin.lat pin.image = redPersonIcon;
}; } else if (pin.type == 2) {
} // 车
} equipmentShow.value = false;
iconPoint(viewer, pins); videoShow.value = false;
} personShow.value = false;
setInterval(setTimePerson, 10 * 1000); carShow.value = true;
const res = await getHomeCarApi(pin.id);
onMounted(async () => { console.log(res);
add3dtiles();
setTimeout(async () => { if (res.data.code == 200) {
fenceListGet(); speed = res.data.data.point ? carSpeed(res.data.data) : 0;
labelData.value = res.data.data;
const res = await getPointAllPersonApi(); link = `${labelData.value.ipAddress}?lang=zh&devIdno=${labelData.value.cameraNo}&account=${labelData.value.username}&password=${labelData.value.password}&channel=1`;
const personData = res.data.data;
personData.map(item => {
pins.push({
id: item.cardId,
name: item.realName,
type: 1,
image: bluePersonIcon,
position: {
lon: item.lon,
lat: item.lat
},
data: item,
entity: null
});
});
// 获取并显示车辆数据,使用不同的前缀
const resCar = await getCarPointAllCarApi();
const carData = resCar.data.data;
carData.map(item => {
pins.push({
id: item.carNumber,
name: item.carNumber,
type: 2,
image: blueCarIcon,
position: {
lon: item.lon,
lat: item.lat
},
data: item,
entity: null
});
});
// 获取在线监测
const resPoint = await getMonitorPointApi();
const pointData = resPoint.data.data;
pointData.map(item => {
pins.push({
id: item.id,
type: 3,
name: item.equipname,
image: blueBianIcon,
position: {
lon: item.longitude,
lat: item.latitude
},
data: item,
entity: null,
label: null
});
});
// 获取视频监控信息
const resVideo = await getCemeraPointApi();
const videoData = resVideo.data.data;
videoData.map(item => {
pins.push({
id: item.id,
name: item.cameraName,
type: 4,
image: blueVideoIcon,
position: {
lon: item.lon,
lat: item.lat
},
data: item,
entity: null
});
});
iconPoint(viewer, pins).then(result => {
console.log(result);
});
}, 2000);
// setTimePerson();
setRemUnit();
// 监听窗口大小变化
window.addEventListener('resize', setRemUnit);
// zhaojunbao 结束
const handler = new Cesium.ScreenSpaceEventHandler(viewer.scene.canvas);
handler.setInputAction(async function (click: any) {
const pickedObject = viewer.scene.pick(click.position);
for (const item of pins) {
if (item.type == 1) {
item.image = bluePersonIcon;
} else if (item.type == 2) {
item.image = blueCarIcon;
} else if (item.type == 3) {
item.image = blueBianIcon;
} else {
item.image = blueVideoIcon;
} }
}
pin.image = redCarIcon;
if (Cesium.defined(pickedObject) && Cesium.defined(pickedObject.id)) { } else if (pin.type == 3) {
const pin = pins.find(item => item.entity === pickedObject.id); // 监测设备
videoShow.value = false;
if (pin.type == 1) { carShow.value = false;
equipmentShow.value = false; personShow.value = false;
videoShow.value = false; equipmentShow.value = true;
carShow.value = false; const res = await getMonitorIdApi(pin.id);
personShow.value = true; if (res.data.code == 200) {
labelData.value = pin.data; if (res.data.data.devicetype == 3) {
text = '表面位移';
pin.image = redPersonIcon; } else if (res.data.data.devicetype == 6) {
} else if (pin.type == 2) { text = '降雨量';
// 车
equipmentShow.value = false;
videoShow.value = false;
personShow.value = false;
carShow.value = true;
const res = await getHomeCarApi(pin.id);
console.log(res);
if (res.data.code == 200) {
speed = res.data.data.point ? carSpeed(res.data.data) : 0;
labelData.value = res.data.data;
link = `${labelData.value.ipAddress}?lang=zh&devIdno=${labelData.value.cameraNo}&account=${labelData.value.username}&password=${labelData.value.password}&channel=1`;
}
pin.image = redCarIcon;
} else if (pin.type == 3) {
// 监测设备
videoShow.value = false;
carShow.value = false;
personShow.value = false;
equipmentShow.value = true;
const res = await getMonitorIdApi(pin.id);
if (res.data.code == 200) {
if (res.data.data.devicetype == 3) {
text = '表面位移';
} else if (res.data.data.devicetype == 6) {
text = '降雨量';
}
labelData.value = res.data.data;
}
pin.image = redBianIcon;
} else {
// 摄像头
equipmentShow.value = false;
videoShow.value = true;
carShow.value = false;
personShow.value = false;
videoShow.value = true;
const res = await getCameraIdApi(pin.id);
if (res.data.code == 200) {
labelData.value = res.data.data;
console.log(labelData.value);
const webRtcServrce = ref();
nextTick(() => {
webRtcServrce.value = new WebRtcStreamer('video', `${location.protocol}//` + `192.168.2.53:8000`);
webRtcServrce.value.connect(res.data.data.videoStream);
});
} }
labelData.value = res.data.data;
pin.image = redVideoIcon;
} }
iconPoint(viewer, pins);
pin.image = redBianIcon;
} else { } else {
// 摄像头
equipmentShow.value = false; equipmentShow.value = false;
videoShow.value = false; videoShow.value = true;
carShow.value = false; carShow.value = false;
personShow.value = false; personShow.value = false;
videoShow.value = true;
iconPoint(viewer, pins); const res = await getCameraIdApi(pin.id);
if (res.data.code == 200) {
labelData.value = res.data.data;
console.log(labelData.value);
const webRtcServrce = ref();
nextTick(() => {
webRtcServrce.value = new WebRtcStreamer('video', `${location.protocol}//` + `192.168.2.53:8000`);
webRtcServrce.value.connect(res.data.data.videoStream);
});
}
pin.image = redVideoIcon;
} }
}, Cesium.ScreenSpaceEventType.LEFT_CLICK); iconPoint(viewer, pins);
}); } else {
equipmentShow.value = false;
onUnmounted(() => { videoShow.value = false;
// 清理Cesium资源 carShow.value = false;
if (viewer) { personShow.value = false;
viewer.destroy();
viewer = null; iconPoint(viewer, pins);
} }
}, Cesium.ScreenSpaceEventType.LEFT_CLICK);
});
onUnmounted(() => {
// 清理Cesium资源
if (viewer) {
viewer.destroy();
viewer = null;
}
// 移除窗口大小变化监听 // 移除窗口大小变化监听
window.removeEventListener('resize', setRemUnit); window.removeEventListener('resize', setRemUnit);
// 移除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">
声光报警 声光报警
<NSwitch v-model:value="active" /> <NSwitch v-model:value="active" />
</div>
<!-- <i class="split-line"></i> -->
<div class="split-line"></div>
<div class="houtaiguanli" @click="navTo">后台管理</div>
</div> </div>
<!-- cesium 容器 -->
<div class="cesium-container"> <!-- <i class="split-line"></i> -->
<div id="cesiumContainer"> <div class="split-line"></div>
<!-- 选择框 --> <div class="houtaiguanli" @click="navTo">后台管理</div>
<MultiSelect v-model="value" :options="options" style="position: fixed; z-index: 999; top: 100px; left: 63%" /> </div>
<!-- 人员信息弹框 --> <!-- cesium 容器 -->
<div v-if="personShow == true" class="personMessage"> <div class="cesium-container">
<div style="display: flex; justify-content: flex-start; align-items: center; margin-bottom: 10px"> <div id="cesiumContainer">
<div style="width: 90%; margin: 0; font-size: 16px"> <!-- 选择框 -->
<span>人员信息</span> <MultiSelect v-model="value" :options="options" style="position: fixed; z-index: 999; top: 100px; left: 63%" />
<div class="person1"></div> <!-- 人员信息弹框 -->
</div> <div v-if="personShow == true" class="personMessage">
<div style="display: flex; justify-content: flex-start; align-items: center; margin-bottom: 10px">
<button <div style="width: 90%; margin: 0; font-size: 16px">
id="close-info" <span>人员信息</span>
style="background: none; border: none; color: white; cursor: pointer; font-size: 18px; margin-left: 10px" <div class="person1"></div>
@click="personsShow()"
>
&times;
</button>
</div>
<div style="line-height: 1.8">
<p class="title1">
<strong class="title2">姓名:</strong>
{{ labelData.realName }}
</p>
<p class="title1">
<strong class="title2">定位卡号:</strong>
{{ labelData.cardId }}
</p>
<p class="title1">
<strong class="title2">人员类型:</strong>
{{ getPersonTypeName(labelData.personType) }}
</p>
<p class="title1">
<strong class="title2">电话:</strong>
{{ labelData.phone }}
</p>
<p class="title1">
<strong class="title2">部门:</strong>
{{ labelData.deptName }}
</p>
</div> </div>
<button
id="close-info"
style="background: none; border: none; color: white; cursor: pointer; font-size: 18px; margin-left: 10px"
@click="personsShow()"
>
&times;
</button>
</div> </div>
<!-- 车辆信息 --> <div style="line-height: 1.8">
<div v-if="carShow == true" class="carMessage"> <p class="title1">
<div style="display: flex; justify-content: flex-start; align-items: center; margin-bottom: 10px"> <strong class="title2">姓名:</strong>
<div style="width: 90%; margin: 0; font-size: 16px"> {{ labelData.realName }}
<span>车辆信息</span> </p>
<div class="person1"></div> <p class="title1">
</div> <strong class="title2">定位卡号:</strong>
<button {{ labelData.cardId }}
id="close-info" </p>
style="background: none; border: none; color: white; cursor: pointer; font-size: 18px; margin-left: 10px" <p class="title1">
@click="carsShow()" <strong class="title2">人员类型:</strong>
> {{ getPersonTypeName(labelData.personType) }}
&times; </p>
</button> <p class="title1">
<strong class="title2">电话:</strong>
{{ labelData.phone }}
</p>
<p class="title1">
<strong class="title2">部门:</strong>
{{ labelData.deptName }}
</p>
</div>
</div>
<!-- 车辆信息 -->
<div v-if="carShow == true" class="carMessage">
<div style="display: flex; justify-content: flex-start; align-items: center; margin-bottom: 10px">
<div style="width: 90%; margin: 0; font-size: 16px">
<span>车辆信息</span>
<div class="person1"></div>
</div> </div>
<div style="line-height: 1.8; display: flex; justify-content: space-between"> <button
<div class="car-left"> id="close-info"
<div class="left-top"> style="background: none; border: none; color: white; cursor: pointer; font-size: 18px; margin-left: 10px"
<p class="title1"> @click="carsShow()"
<strong class="title2">车牌号:</strong> >
{{ labelData.carNumber || '暂无数据' }} &times;
</p> </button>
<p class="title1"> </div>
<strong class="title2">车队名称:</strong> <div style="line-height: 1.8; display: flex; justify-content: space-between">
{{ labelData.teamName || '暂无数据' }} <div class="car-left">
</p> <div class="left-top">
<p class="title1"> <p class="title1">
<strong class="title2">当前车速:</strong> <strong class="title2">车牌号:</strong>
{{ speed }} km/h {{ labelData.carNumber || '暂无数据' }}
</p> </p>
<p class="title1"> <p class="title1">
<strong class="title2">车辆类型:</strong> <strong class="title2">车队名称:</strong>
{{ labelData.carType || '暂无数据' }} {{ labelData.teamName || '暂无数据' }}
</p> </p>
</div> <p class="title1">
<div class="left-center"></div> <strong class="title2">当前车速:</strong>
<div class="left-bottom"> {{ speed }} km/h
<p class="title1"> </p>
<strong class="title2">司机姓名:</strong> <p class="title1">
{{ labelData.driverName || '暂无数据' }} <strong class="title2">车辆类型:</strong>
</p> {{ labelData.carType || '暂无数据' }}
<p class="title1"> </p>
<strong class="title2">工作开始时间:</strong>
{{ labelData.workStartTime || '暂无数据' }}
</p>
<p class="title1">
<strong class="title2">工作时长:</strong>
{{ labelData.workTime || '暂无数据' }}
</p>
<p class="title1">
<strong class="title2">终端设备编号:</strong>
{{ labelData.terminalNumber || '暂无数据' }}
</p>
</div>
</div> </div>
<div class="car-right"> <div class="left-center"></div>
<iframe <div class="left-bottom">
allowfullscreen="true" <p class="title1">
allowtransparency="true" <strong class="title2">司机姓名:</strong>
allow="autoplay" {{ labelData.driverName || '暂无数据' }}
scrolling="no" </p>
:src="link" <p class="title1">
width="100%" <strong class="title2">工作开始时间:</strong>
height="100%" {{ labelData.workStartTime || '暂无数据' }}
frameborder="0" </p>
style="padding-right: 20px" <p class="title1">
></iframe> <strong class="title2">工作时长:</strong>
<!-- '${res.ipAddress}?lang=zh&devIdno=${res.cameraNo}&account=${res.username}&password=${res.password}&channel=1' --> {{ labelData.workTime || '暂无数据' }}
</p>
<p class="title1">
<strong class="title2">终端设备编号:</strong>
{{ labelData.terminalNumber || '暂无数据' }}
</p>
</div> </div>
</div> </div>
<div class="car-right">
<iframe
allowfullscreen="true"
allowtransparency="true"
allow="autoplay"
:src="link"
width="100%"
height="100%"
frameborder="0"
style="padding-right: 20px"
></iframe>
<!-- '${res.ipAddress}?lang=zh&devIdno=${res.cameraNo}&account=${res.username}&password=${res.password}&channel=1' -->
</div>
</div> </div>
<!-- 在线检测设备信息 --> </div>
<div v-if="equipmentShow == true" class="equipmentMessage"> <!-- 在线检测设备信息 -->
<div style="display: flex; justify-content: flex-start; align-items: center; margin-bottom: 10px"> <div v-if="equipmentShow == true" class="equipmentMessage">
<div style="width: 90%; margin: 0; font-size: 16px"> <div style="display: flex; justify-content: flex-start; align-items: center; margin-bottom: 10px">
<span>在线检测设备信息</span> <div style="width: 90%; margin: 0; font-size: 16px">
<div class="person1"></div> <span>在线检测设备信息</span>
</div> <div class="person1"></div>
<button
id="close-info"
style="background: none; border: none; color: white; cursor: pointer; font-size: 18px; margin-left: 10px"
@click="equipmentsShow()"
>
&times;
</button>
</div> </div>
<div style="line-height: 1.8"> <button
<p class="title1"> id="close-info"
<strong class="title2">设备名称:</strong> style="background: none; border: none; color: white; cursor: pointer; font-size: 18px; margin-left: 10px"
{{ labelData.equipname }} @click="equipmentsShow()"
</p> >
<p class="title1"> &times;
<strong class="title2">设备状态:</strong> </button>
{{ labelData.dataStatus === 0 ? '在线' : '离线' }} </div>
</p> <div style="line-height: 1.8">
<p class="title1"> <p class="title1">
<strong class="title2">设备类型:</strong> <strong class="title2">设备名称:</strong>
{{ text }} {{ labelData.equipname }}
</p> </p>
<p class="title1"> <p class="title1">
<strong class="title2">监测值:</strong> <strong class="title2">设备状态:</strong>
{{ labelData.value }} {{ labelData.dataStatus === 0 ? '在线' : '离线' }}
</p> </p>
<p class="title1"> <p class="title1">
<strong class="title2">监测时间:</strong> <strong class="title2">设备类型:</strong>
{{ labelData.time }} {{ text }}
</p> </p>
<p class="title1"> <p class="title1">
<strong class="title2">数据状态:</strong> <strong class="title2">监测值:</strong>
{{ labelData.onlineStatus === 0 ? '正常' : '蓝色报警' }} {{ labelData.value }}
</p> </p>
<p class="title1">
<strong class="title2">监测时间:</strong>
{{ labelData.time }}
</p>
<p class="title1">
<strong class="title2">数据状态:</strong>
{{ labelData.onlineStatus === 0 ? '正常' : '蓝色报警' }}
</p>
</div>
</div>
<!-- 视频监控信息 -->
<div v-if="videoShow == true" class="videoMessage">
<div style="display: flex; justify-content: flex-start; align-items: center; margin-bottom: 10px">
<div style="width: 90%; margin: 0; font-size: 16px">
<span>视频监控信息</span>
<div class="person1"></div>
</div> </div>
<button
id="close-info"
style="background: none; border: none; color: white; cursor: pointer; font-size: 18px; margin-left: 10px"
@click="videosShow()"
>
&times;
</button>
</div> </div>
<!-- 视频监控信息 --> <div style="line-height: 1.8; display: flex; flex-direction: column; flex-wrap: nowrap">
<div v-if="videoShow == true" class="videoMessage"> <div class="video-top">
<div style="display: flex; justify-content: flex-start; align-items: center; margin-bottom: 10px"> <div class="title3">
<div style="width: 90%; margin: 0; font-size: 16px"> <strong class="title2">● 摄像头名称:</strong>
<span>视频监控信息</span> {{ labelData.areaName }}
<div class="person1"></div>
</div> </div>
<button <div class="title3">
id="close-info" <strong class="title4">● 区域名称:</strong>
style="background: none; border: none; color: white; cursor: pointer; font-size: 18px; margin-left: 10px" {{ labelData.cameraName }}
@click="videosShow()"
>
&times;
</button>
</div>
<div style="line-height: 1.8; display: flex; flex-direction: column; flex-wrap: nowrap">
<div class="video-top">
<div class="title3">
<strong class="title2">● 摄像头名称:</strong>
{{ labelData.areaName }}
</div>
<div class="title3">
<strong class="title4">● 区域名称:</strong>
{{ labelData.cameraName }}
</div>
<div class="title3">
<strong class="title4">● 设备状态:</strong>
{{ labelData.status === 0 ? '在线' : '离线' }}
</div>
</div> </div>
<div class="video-bottom"> <div class="title3">
<video <strong class="title4">● 设备状态:</strong>
id="video" {{ labelData.status === 0 ? '在线' : '离线' }}
controls
autoplay
muted
playsinline
width="100%"
height="100%"
style="object-fit: fill; z-index: 1"
></video>
</div> </div>
</div> </div>
<div class="video-bottom">
<video
id="video"
controls
autoplay
muted
playsinline
width="100%"
height="100%"
style="object-fit: fill; z-index: 1"
></video>
</div>
</div> </div>
<!-- </div> -->
</div> </div>
<!-- </div> -->
</div> </div>
</div> </div>
</div>
<div class="top">
<div class="first-image"> <div class="top">
<img src="@/assets/jinrun/top.png" alt="" srcset="" /> <div class="first-image">
<div class="second-icon"> <img src="@/assets/jinrun/top.png" alt="" srcset="" />
<img src="@/assets/jinrun/title.png" alt="" /> <div class="second-icon">
</div> <img src="@/assets/jinrun/title.png" alt="" />
</div> </div>
</div> </div>
<div class="bottom"></div> </div>
<div v-show="isLeftModulesVisible" class="left"></div> <div class="bottom"></div>
<div v-show="isRightModulesVisible" class="right"></div> <div v-show="isLeftModulesVisible" class="left"></div>
<div v-show="isRightModulesVisible" class="right"></div>
<!-- 非cesium相关 开始 -->
<!-- 非cesium相关 开始 -->
<!-- 左侧收起按钮 -->
<div class="toggle-btn left-toggle" :class="{ collapsed: !isLeftModulesVisible }" @click="toggleBothModules"> <!-- 左侧收起按钮 -->
<div class="btn-arrow1"> <div class="toggle-btn left-toggle" :class="{ collapsed: !isLeftModulesVisible }" @click="toggleBothModules">
<div> <div class="btn-arrow1">
<img :src="isLeftModulesVisible ? arrowLeftImg : arrowRightImg" alt="" srcset="" /> <div>
<br /> <img :src="isLeftModulesVisible ? arrowLeftImg : arrowRightImg" alt="" srcset="" />
<div class="arrow-font"> <br />
{{ isLeftModulesVisible ? '收起' : '展开' }} <div class="arrow-font">
</div> {{ isLeftModulesVisible ? '收起' : '展开' }}
</div> </div>
</div> </div>
</div> </div>
</div>
<!-- 右侧收起按钮 -->
<div class="toggle-btn right-toggle" :class="{ collapsed: !isRightModulesVisible }" @click="toggleBothModules"> <!-- 右侧收起按钮 -->
<!-- <div class="btn-arrow1"><img src="@/assets/jinrun/arrow-right.png" alt="" srcset=""><br><br></div> --> <div class="toggle-btn right-toggle" :class="{ collapsed: !isRightModulesVisible }" @click="toggleBothModules">
<div class="btn-arrow1"> <!-- <div class="btn-arrow1"><img src="@/assets/jinrun/arrow-right.png" alt="" srcset=""><br><br></div> -->
<div> <div class="btn-arrow1">
<img :src="isLeftModulesVisible ? arrowRightImg : arrowLeftImg" alt="" srcset="" /> <div>
<br /> <img :src="isLeftModulesVisible ? arrowRightImg : arrowLeftImg" alt="" srcset="" />
<div class="arrow-font"> <br />
{{ isLeftModulesVisible ? '收起' : '展开' }} <div class="arrow-font">
</div> {{ isLeftModulesVisible ? '收起' : '展开' }}
</div> </div>
</div> </div>
</div> </div>
</div>
<!-- 左侧模块容器 -->
<Transition name="slide-left"> <!-- 左侧模块容器 -->
<div v-show="isLeftModulesVisible" class="left-modules"> <Transition name="slide-left">
<LeftDeviceStatus /> <div v-show="isLeftModulesVisible" class="left-modules">
<LeftRainfallTrend /> <LeftDeviceStatus />
<LeftOnlineMonitor /> <LeftRainfallTrend />
</div> <LeftOnlineMonitor />
</Transition> </div>
</Transition>
<!-- 右侧模块容器 -->
<Transition name="slide-right"> <!-- 右侧模块容器 -->
<div v-show="isRightModulesVisible" class="right-modules"> <Transition name="slide-right">
<RightAiWarning /> <div v-show="isRightModulesVisible" class="right-modules">
<RightEnvMonitor /> <RightAiWarning />
<RightTodayAlarm /> <RightEnvMonitor />
</div> <RightTodayAlarm />
</Transition> </div>
<!-- 非cesium相关 结束 --> </Transition>
</template> <!-- 非cesium相关 结束 -->
</template>
<style scoped>
html, <style scoped>
body { html,
width: 100%; body {
height: 100%; width: 100%;
overflow: hidden; height: 100%;
} overflow: hidden;
}
.cesium-container {
width: 100%; .cesium-container {
height: 100vh; width: 100%;
position: absolute; height: 100vh;
top: 0; position: absolute;
left: 0; top: 0;
} left: 0;
}
#cesiumContainer {
width: 100%; #cesiumContainer {
width: 100%;
height: 100%;
}
.personMessage {
width: 450px;
height: 250px;
position: absolute;
padding: 15px 20px;
color: white;
font-family: sans-serif;
font-size: 14px;
pointer-events: auto;
z-index: 9999;
top: 100px;
left: 20%;
background-image: url('@/assets/person2.png');
background-size: 100% 100%;
transform: translate(50%, 50%);
}
.carMessage {
width: 600px;
height: 380px;
position: absolute;
padding: 15px 20px;
color: white;
font-family: sans-serif;
font-size: 14px;
pointer-events: auto;
z-index: 9999;
top: 100px;
left: 20%;
background-image: url('@/assets/person2.png');
background-size: 100% 100%;
transform: translate(50%, 50%);
}
.equipmentMessage {
width: 450px;
height: 290px;
position: absolute;
padding: 15px 20px;
color: white;
font-family: sans-serif;
font-size: 14px;
pointer-events: auto;
z-index: 9999;
top: 100px;
left: 20%;
background-image: url('@/assets/person2.png');
background-size: 100% 100%;
transform: translate(50%, 50%);
}
.videoMessage {
width: 680px;
height: 380px;
position: absolute;
padding: 15px 20px;
color: white;
font-family: sans-serif;
font-size: 14px;
pointer-events: auto;
z-index: 9999;
top: 100px;
left: 20%;
background-image: url('@/assets/person2.png');
background-size: 100% 100%;
transform: translate(50%, 50%);
}
.title1 {
margin-top: 5px;
}
.title2 {
color: #29d7fb;
margin-right: 10px;
}
.title3 {
display: flex;
align-items: center;
margin: 0px 0px 8px 0px;
}
.title4 {
color: #29d7fb;
margin-right: 10px;
margin-left: 20px;
}
span {
position: absolute;
z-index: 4;
left: 30px;
top: 10px;
}
.person1 {
width: 85%;
height: 40px;
background-image: url('@/assets/person1.png');
background-size: 100% 100%;
position: absolute;
left: 6px;
top: 20px;
}
.left-center {
width: 100%;
height: 10px;
border-bottom: 1px solid #147f9c;
}
.right {
width: 60%;
height: 50%;
/* margin-right: 20px; */
/* margin-top: 20px; */
}
#video {
height: 250px;
}
.video-top {
width: 100%;
height: 50%;
display: flex;
flex-direction: row;
flex-wrap: nowrap;
}
.video-bottom {
margin-right: 20px;
}
.select {
width: 100%;
border: none;
background-image: url('@/assets/multiple-pop.png');
}
.n-select {
background-image: url('@/assets/multiple-pop.png');
background-position: center;
}
.n-select .n-select-trigger {
background-color: transparent;
}
.n-select .n-select-menu {
background-color: transparent;
}
:deep(.n-base-selection .n-base-selection-tags) {
background-color: transparent !important;
}
:deep(.n-base-selection .n-base-selection-label .n-base-selection-input .n-base-selection-input__content) {
color: white !important;
}
:deep(.n-base-selection .n-base-selection__border, .n-base-selection .n-base-selection__state-border) {
border: 1px solid #4ab9fd;
}
:deep(.n-tag) {
color: #fff;
background: #10273e00;
/* display:none; */
}
:deep(.n-tag .n-tag__border) {
border: none;
}
:deep(.n-base-selection-tag-wrapper) {
background: #10273e00;
}
/* zhaojunbao */
.top-toolbar {
position: absolute;
top: 0.5rem;
right: 0.5rem;
width: 240px;
height: 0.4rem;
color: #11e0ff;
z-index: 9;
display: flex;
align-items: center;
justify-content: space-between;
.split-line {
width: 0.03rem;
height: 100%; height: 100%;
background: #11e0ff;
} }
.personMessage { .baojing {
width: 450px; position: relative;
height: 250px; padding-left: 25px;
position: absolute; display: block;
padding: 15px 20px;
color: white; &::before {
font-family: sans-serif; content: '';
font-size: 14px; position: absolute;
pointer-events: auto; left: 0;
z-index: 9999; top: 50%;
top: 100px; transform: translateY(-50%);
left: 20%; width: 20px;
background-image: url('@/assets/person2.png'); height: 20px;
background-size: 100% 100%; background-image: url('@/assets/jinrun/baojing.png');
transform: translate(50%, 50%); background-size: contain;
} background-repeat: no-repeat;
.carMessage {
width: 600px;
height: 380px;
position: absolute;
padding: 15px 20px;
color: white;
font-family: sans-serif;
font-size: 14px;
pointer-events: auto;
z-index: 9999;
top: 100px;
left: 20%;
background-image: url('@/assets/person2.png');
background-size: 100% 100%;
transform: translate(50%, 50%);
}
.equipmentMessage {
width: 450px;
height: 290px;
position: absolute;
padding: 15px 20px;
color: white;
font-family: sans-serif;
font-size: 14px;
pointer-events: auto;
z-index: 9999;
top: 100px;
left: 20%;
background-image: url('@/assets/person2.png');
background-size: 100% 100%;
transform: translate(50%, 50%);
}
.videoMessage {
width: 680px;
height: 380px;
position: absolute;
padding: 15px 20px;
color: white;
font-family: sans-serif;
font-size: 14px;
pointer-events: auto;
z-index: 9999;
top: 100px;
left: 20%;
background-image: url('@/assets/person2.png');
background-size: 100% 100%;
transform: translate(50%, 50%);
}
.title1 {
margin-top: 5px;
}
.title2 {
color: #29d7fb;
margin-right: 10px;
}
.title3 {
display: flex;
align-items: center;
margin: 0px 0px 8px 0px;
}
.title4 {
color: #29d7fb;
margin-right: 10px;
margin-left: 20px;
}
span {
position: absolute;
z-index: 4;
left: 30px;
top: 10px;
}
.person1 {
width: 85%;
height: 40px;
background-image: url('@/assets/person1.png');
background-size: 100% 100%;
position: absolute;
left: 6px;
top: 20px;
}
.left-center {
width: 100%;
height: 10px;
border-bottom: 1px solid #147f9c;
}
.right {
width: 60%;
height: 50%;
/* margin-right: 20px; */
/* margin-top: 20px; */
}
#video {
height: 250px;
}
.video-top {
width: 100%;
height: 50%;
display: flex;
flex-direction: row;
flex-wrap: nowrap;
}
.video-bottom {
margin-right: 20px;
}
.select {
width: 100%;
border: none;
background-image: url('@/assets/multiple-pop.png');
}
.n-select {
background-image: url('@/assets/multiple-pop.png');
background-position: center;
}
.n-select .n-select-trigger {
background-color: transparent;
}
.n-select .n-select-menu {
background-color: transparent;
}
:deep(.n-base-selection .n-base-selection-tags) {
background-color: transparent !important;
}
:deep(.n-base-selection .n-base-selection-label .n-base-selection-input .n-base-selection-input__content) {
color: white !important;
}
:deep(.n-base-selection .n-base-selection__border, .n-base-selection .n-base-selection__state-border) {
border: 1px solid #4ab9fd;
}
:deep(.n-tag) {
color: #fff;
background: #10273e00;
/* display:none; */
}
:deep(.n-tag .n-tag__border) {
border: none;
}
:deep(.n-base-selection-tag-wrapper) {
background: #10273e00;
}
/* zhaojunbao */
.top-toolbar {
position: absolute;
top: 0.5rem;
right: 0.5rem;
width: 240px;
height: 0.4rem;
color: #11e0ff;
z-index: 99999;
display: flex;
align-items: center;
justify-content: space-between;
.split-line {
width: 0.03rem;
height: 100%;
background: #11e0ff;
}
.baojing {
position: relative;
padding-left: 25px;
display: block;
&::before {
content: '';
position: absolute;
left: 0;
top: 50%;
transform: translateY(-50%);
width: 20px;
height: 20px;
background-image: url('@/assets/jinrun/baojing.png');
background-size: contain;
background-repeat: no-repeat;
}
}
.houtaiguanli {
position: relative;
padding-left: 25px;
display: block;
&::before {
content: '';
position: absolute;
left: 0;
top: 50%;
transform: translateY(-50%);
width: 20px;
height: 20px;
background-image: url('@/assets/jinrun/houtai.png');
background-size: contain;
background-repeat: no-repeat;
}
} }
} }
.top, .houtaiguanli {
.bottom, position: relative;
.left, padding-left: 25px;
.right { display: block;
position: absolute;
background-repeat: no-repeat; &::before {
content: '';
position: absolute;
left: 0;
top: 50%;
transform: translateY(-50%);
width: 20px;
height: 20px;
background-image: url('@/assets/jinrun/houtai.png');
background-size: contain;
background-repeat: no-repeat;
}
} }
}
.top {
top: 0; .top,
.bottom,
.left,
.right {
position: absolute;
background-repeat: no-repeat;
}
.top {
top: 0;
width: 100%;
height: 1.25rem;
position: absolute;
.first-image {
width: 100%; width: 100%;
height: 1.25rem; height: 100%;
position: absolute; position: relative;
.first-image { & > img {
width: 100%; width: 100%;
height: 100%; }
position: relative;
.second-icon {
& > img { position: absolute;
width: 100%; top: 30%;
} left: 50%;
transform: translate(-50%, -50%);
.second-icon { width: 5.04rem;
position: absolute; /* 可根据实际需要调整大小 */
top: 30%; height: 0.54rem;
left: 50%; /* 可根据实际需要调整大小 */
transform: translate(-50%, -50%);
width: 5.04rem;
/* 可根据实际需要调整大小 */
height: 0.54rem;
/* 可根据实际需要调整大小 */
}
} }
} }
}
.bottom {
bottom: 0; .bottom {
left: 0; bottom: 0;
width: 100%; left: 0;
height: 0.4rem; width: 100%;
background-image: url('@/assets/jinrun/bottom.png'); height: 0.4rem;
background-size: cover; background-image: url('@/assets/jinrun/bottom.png');
background-size: cover;
}
.left {
top: 0rem;
left: 0;
width: 5.76rem;
height: calc(100vh);
background-size: contain;
background-position-x: left;
background-image: url('@/assets/jinrun/bg-left.png');
}
.right {
top: 0rem;
right: 0;
width: 5.76rem;
height: calc(100vh);
background-image: url('@/assets/jinrun/bg-right.png');
background-size: contain;
background-position-x: right;
}
.toggle-btn {
position: absolute;
top: 50%;
transform: translateY(-50%);
width: 0.71rem;
height: 1.87rem;
background-image: url('@/assets/jinrun/toggle-left.png');
background-size: cover;
background-repeat: no-repeat;
border-radius: 0 10px 10px 0;
cursor: pointer;
z-index: 100;
display: flex;
align-items: center;
justify-content: center;
transition: all 0.3s ease;
&.left-toggle {
left: 5rem;
/* 与左侧模块宽度一致 */
background-image: url('@/assets/jinrun/toggle-left.png');
} }
.left { &.left-toggle:hover {
top: 0rem; background-image: url('@/assets/jinrun/toggle-left_click.png');
left: 0;
width: 5.76rem;
height: calc(100vh);
background-size: contain;
background-position-x: left;
background-image: url('@/assets/jinrun/bg-left.png');
} }
.right { &.right-toggle {
top: 0rem; right: 5rem;
right: 0; /* 与左侧模块宽度一致 */
width: 5.76rem; background-image: url('@/assets/jinrun/toggle-right.png');
height: calc(100vh);
background-image: url('@/assets/jinrun/bg-right.png');
background-size: contain;
background-position-x: right;
} }
.toggle-btn { &.right-toggle:hover {
position: absolute; background-image: url('@/assets/jinrun/toggle-right_click.png');
top: 50%; }
transform: translateY(-50%);
width: 0.71rem; &.collapsed {
height: 1.87rem;
background-image: url('@/assets/jinrun/toggle-left.png');
background-size: cover;
background-repeat: no-repeat;
border-radius: 0 10px 10px 0;
cursor: pointer;
z-index: 100;
display: flex;
align-items: center;
justify-content: center;
transition: all 0.3s ease;
&.left-toggle { &.left-toggle {
left: 5rem; left: 0.55rem;
/* 与左侧模块宽度一致 */ border-radius: 0 10px 10px 0;
background-image: url('@/assets/jinrun/toggle-left.png');
}
&.left-toggle:hover {
background-image: url('@/assets/jinrun/toggle-left_click.png');
} }
&.right-toggle { &.right-toggle {
right: 5rem; right: 0.55rem;
/* 与左侧模块宽度一致 */ border-radius: 10px 0 0 10px;
background-image: url('@/assets/jinrun/toggle-right.png');
}
&.right-toggle:hover {
background-image: url('@/assets/jinrun/toggle-right_click.png');
} }
}
&.collapsed {
&.left-toggle { .btn-arrow1 {
left: 0.55rem; img {
border-radius: 0 10px 10px 0; width: 0.18rem;
}
&.right-toggle {
right: 0.55rem;
border-radius: 10px 0 0 10px;
}
}
.btn-arrow1 {
img {
width: 0.18rem;
}
} }
}
.btn-arrow {
width: 10px; .btn-arrow {
width: 10px;
height: 10px;
border-top: 2px solid #fff;
border-right: 2px solid #fff;
transition: transform 0.3s ease;
&::before {
content: '';
position: absolute;
width: 2px;
height: 10px; height: 10px;
border-top: 2px solid #fff; background: #fff;
border-right: 2px solid #fff; top: -4px;
transition: transform 0.3s ease; right: 4px;
&::before {
content: '';
position: absolute;
width: 2px;
height: 10px;
background: #fff;
top: -4px;
right: 4px;
}
} }
}
&.left-toggle .btn-arrow {
transform: rotate(135deg);
}
&.right-toggle .btn-arrow {
transform: rotate(-45deg);
}
&.collapsed {
&.left-toggle .btn-arrow { &.left-toggle .btn-arrow {
transform: rotate(135deg);
}
&.right-toggle .btn-arrow {
transform: rotate(-45deg); transform: rotate(-45deg);
} }
&.collapsed { &.right-toggle .btn-arrow {
&.left-toggle .btn-arrow { transform: rotate(135deg);
transform: rotate(-45deg);
}
&.right-toggle .btn-arrow {
transform: rotate(135deg);
}
}
&:hover {
} }
} }
.slide-left-enter-active, &:hover {
.slide-left-leave-active {
transition:
transform 0.5s ease,
opacity 0.5s ease;
}
.slide-left-enter-from {
transform: translateX(-100%);
opacity: 0;
}
.slide-left-leave-to {
transform: translateX(-100%);
opacity: 0;
}
.slide-right-enter-active,
.slide-right-leave-active {
transition:
transform 0.5s ease,
opacity 0.5s ease;
}
.slide-right-enter-from {
transform: translateX(100%);
opacity: 0;
}
.slide-right-leave-to {
transform: translateX(100%);
opacity: 0;
}
.left-modules:not(.v-enter-active):not(.v-leave-active).left-toggle:not(.collapsed) {
left: 0;
border-radius: 0 10px 10px 0;
}
.right-modules:not(.v-enter-active):not(.v-leave-active).right-toggle:not(.collapsed) {
right: 0;
border-radius: 10px 0 0 10px;
background: pink;
}
.left-modules,
.right-modules {
width: 4.6rem;
padding-top: 0.95rem;
position: absolute;
}
.left-modules {
left: 0;
margin-left: 0.4rem;
}
.right-modules {
right: 0;
margin-right: 0.4rem;
}
.arrow-font {
width: 20px;
color: #fff;
font-size: 0.18rem;
display: flex;
flex-direction: column;
}
.video-container {
width: 100%;
height: 250px;
border: 1px solid #ccc;
background: #f5f5f5;
position: relative;
}
#divPlugin {
width: 100%;
height: 100%;
}
.status-info {
position: absolute;
top: 10px;
right: 10px;
background: rgba(0, 0, 0, 0.7);
color: white;
padding: 5px 10px;
border-radius: 4px;
font-size: 12px;
} }
</style> }
\ No newline at end of file .slide-left-enter-active,
.slide-left-leave-active {
transition:
transform 0.5s ease,
opacity 0.5s ease;
}
.slide-left-enter-from {
transform: translateX(-100%);
opacity: 0;
}
.slide-left-leave-to {
transform: translateX(-100%);
opacity: 0;
}
.slide-right-enter-active,
.slide-right-leave-active {
transition:
transform 0.5s ease,
opacity 0.5s ease;
}
.slide-right-enter-from {
transform: translateX(100%);
opacity: 0;
}
.slide-right-leave-to {
transform: translateX(100%);
opacity: 0;
}
.left-modules:not(.v-enter-active):not(.v-leave-active).left-toggle:not(.collapsed) {
left: 0;
border-radius: 0 10px 10px 0;
}
.right-modules:not(.v-enter-active):not(.v-leave-active).right-toggle:not(.collapsed) {
right: 0;
border-radius: 10px 0 0 10px;
background: pink;
}
.left-modules,
.right-modules {
width: 4.6rem;
padding-top: 0.95rem;
position: absolute;
}
.left-modules {
left: 0;
margin-left: 0.4rem;
}
.right-modules {
right: 0;
margin-right: 0.4rem;
}
.arrow-font {
width: 20px;
color: #fff;
font-size: 0.18rem;
display: flex;
flex-direction: column;
}
.video-container {
width: 100%;
height: 250px;
border: 1px solid #ccc;
background: #f5f5f5;
position: relative;
}
#divPlugin {
width: 100%;
height: 100%;
}
.status-info {
position: absolute;
top: 10px;
right: 10px;
background: rgba(0, 0, 0, 0.7);
color: white;
padding: 5px 10px;
border-radius: 4px;
font-size: 12px;
}
</style>
...@@ -3,6 +3,7 @@ import { nextTick, onBeforeMount, onMounted, onUnmounted, ref, watch } from 'vue ...@@ -3,6 +3,7 @@ import { nextTick, onBeforeMount, onMounted, onUnmounted, ref, watch } from 'vue
import '../../../../Cesium/Widgets/widgets.css'; import '../../../../Cesium/Widgets/widgets.css';
import { useMessage } from 'naive-ui'; import { useMessage } from 'naive-ui';
import { import {
api_getRoleId,
getCameraIdApi, getCameraIdApi,
getCarPointAllCarApi, getCarPointAllCarApi,
getCemeraPointApi, getCemeraPointApi,
...@@ -13,7 +14,7 @@ import { ...@@ -13,7 +14,7 @@ import {
getPointAllPersonApi, getPointAllPersonApi,
getPointListApi getPointListApi
} from '@/api'; } from '@/api';
import { create3D } from '@/api/utils/cesium'; import { create3D, pointLine } from '@/api/utils/cesium';
import { getElevationFromRay, getElevationFromRays } from '@/api/utils/cesiumUtil'; import { getElevationFromRay, getElevationFromRays } from '@/api/utils/cesiumUtil';
import { cesiumToLongitudeAndLatitude } from '@/api/utils/coordinateUtil'; import { cesiumToLongitudeAndLatitude } from '@/api/utils/coordinateUtil';
import { getModel } from '@/api/utils/cesiumModel'; import { getModel } from '@/api/utils/cesiumModel';
...@@ -32,6 +33,10 @@ import blueVideoIcon from '@/assets/icon16.png'; ...@@ -32,6 +33,10 @@ import blueVideoIcon from '@/assets/icon16.png';
import blueBianIcon from '@/assets/icon17.png'; import blueBianIcon from '@/assets/icon17.png';
import redPersonIcon from '../../../assets/redperson.png'; import redPersonIcon from '../../../assets/redperson.png';
import MultiSelect from './appselect.vue'; import MultiSelect from './appselect.vue';
import { useRouteStore } from '@/store/modules/route';
import { router } from '@/router';
import { localStg } from '@/utils/storage';
import { getAlarmStatusApi, setAlarmStatusApi } from '@/api/index-dp';
let viewer: any = null; let viewer: any = null;
const message = useMessage(); const message = useMessage();
...@@ -39,17 +44,10 @@ let personEntity: any; ...@@ -39,17 +44,10 @@ let personEntity: any;
const pins: any = []; const pins: any = [];
const full = ref(false); const full = ref(false);
let entityId: any; let entityId: any;
const routeStore = useRouteStore();
let link: any; let link: any;
let speed = 0; let speed = 0;
let text = ''; let text = '';
const personList = ref([]);
const modelData = ref([
[122.04736846370741, 37.48958083145254],
[122.04760069379522, 37.489226301608184],
[122.04823299200363, 37.489451482540346],
[122.04802271634016, 37.48983410372907],
[122.04748237248322, 37.49016152294277]
]);
const options = [ const options = [
{ {
...@@ -78,7 +76,6 @@ const options = [ ...@@ -78,7 +76,6 @@ const options = [
} }
]; ];
const value = ref(options.map(opt => opt.value)); const value = ref(options.map(opt => opt.value));
const data = ref([]); const data = ref([]);
const datasouce = ref(); const datasouce = ref();
const fence = ref<any>(); const fence = ref<any>();
...@@ -99,6 +96,50 @@ const labelData = ref<any>(); ...@@ -99,6 +96,50 @@ const labelData = ref<any>();
const formData = ref([]); const formData = ref([]);
// zhaojunbao 开始 // zhaojunbao 开始
const activeAlarm = ref(false);
const alarmStatus = ref(0); // 新增:控制声光报警开关状态 0 关 1 开
const isRequesting = ref(false); // 新增:防止重复点击
// 新增:获取声光报警状态
const getAlarmStatus = async () => {
try {
const res = await getAlarmStatusApi();
// console.log('获取声光报警状态成功:', res);
if (res.data.code === 200) {
alarmStatus.value = res.data.data;
}
} catch (error) {
console.error('获取声光报警状态失败:', error);
}
};
// 新增:切换声光报警状态
const toggleAlarmStatus = async () => {
// 防止重复点击
if (isRequesting.value) {
return;
}
isRequesting.value = true;
try {
let newStatus = alarmStatus.value === 0 ? 1 : 0;
const res = await setAlarmStatusApi(newStatus);
if (res.data.code === 200) {
alarmStatus.value = newStatus;
} else {
// console.error('设置声光报警状态失败:', res.data.message);
message.error(res.data.data);
}
} catch (error) {
console.error('设置声光报警状态异常:', error);
} finally {
// 请求完成后重置标志
isRequesting.value = false;
}
};
/** 新增:修改报警状态结束 */
// REM自适应配置 // REM自适应配置
const active = ref(false); const active = ref(false);
const REM_CONFIG = { const REM_CONFIG = {
...@@ -108,8 +149,25 @@ const REM_CONFIG = { ...@@ -108,8 +149,25 @@ const REM_CONFIG = {
// 基准值:1rem = 100px // 基准值:1rem = 100px
baseSize: 100 baseSize: 100
}; };
// 跳转首页 // 动态路由
const navTo = () => { const navTo = async () => {
let result = routeStore.menus;
let getStorage = localStorage.getItem('loginId');
if(!getStorage) {
window.location.href = '/login';
}
let res = await api_getRoleId(getStorage);
let menus = res.data.data.permissionIds;
const routeList: any = []
for (let item of result) {
let res = menus.find(data => data.menuPath == item.key);
if (res) {
routeList.push(item);
}
}
localStg.set('routerList', routeList)
window.location.href = '/home'; window.location.href = '/home';
}; };
...@@ -559,46 +617,79 @@ async function setTimePerson() { ...@@ -559,46 +617,79 @@ async function setTimePerson() {
} }
iconPoint(viewer, pins); iconPoint(viewer, pins);
} }
setInterval(setTimePerson, 2 * 60 * 1000); setInterval(setTimePerson, 20 * 1000);
// setInterval(setTimePerson, 2 * 60 * 1000);
onMounted(async () => { onMounted(async () => {
await getAlarmStatus(); // 获取报警状态
add3dtiles(); add3dtiles();
pointLine(viewer);
setTimeout(async () => { setTimeout(async () => {
fenceListGet(); fenceListGet();
const res = await getPointAllPersonApi(); const res = await getPointAllPersonApi();
const personData = res.data.data; const personData = res.data.data;
console.log('--1--', personData);
personData.map(item => { personData.map(item => {
pins.push({ const createTime = new Date(item.createTime);
id: item.cardId, const now = new Date();
name: item.realName,
type: 1, // 计算两个时间的差值(毫秒)
image: bluePersonIcon, const diffInMs = now - createTime;
position: {
lon: item.lon, // 转换为分钟
lat: item.lat const diffInMinutes = diffInMs / (1000 * 60);
},
data: item,
entity: null // 判断是否超过3分钟
}); if (diffInMinutes > 3) {
} else {
pins.push({
id: item.cardId,
name: item.realName,
type: 1,
image: bluePersonIcon,
createTime: item.createTime,
position: {
lon: item.lon,
lat: item.lat
},
data: item,
entity: null
});
}
}); });
// 获取并显示车辆数据,使用不同的前缀 // 获取并显示车辆数据,使用不同的前缀
const resCar = await getCarPointAllCarApi(); const resCar = await getCarPointAllCarApi();
const carData = resCar.data.data; const carData = resCar.data.data;
carData.map(item => { carData.map(item => {
pins.push({ const createTime = new Date(item.createTime);
id: item.carNumber, const now = new Date();
name: item.carNumber, // 计算两个时间的差值(毫秒)
type: 2, const diffInMs = now - createTime;
image: blueCarIcon, // 转换为天数
position: { const diffInDays = diffInMs / (1000 * 60);
lon: item.lon,
lat: item.lat // 判断是否超过20分钟
}, if (diffInDays > 20) {
data: item,
entity: null } else {
}); pins.push({
id: item.carNumber,
name: item.carNumber,
type: 2,
image: blueCarIcon,
position: {
lon: item.lon,
lat: item.lat
},
data: item,
entity: null
});
}
}); });
// 获取在线监测 // 获取在线监测
...@@ -639,7 +730,7 @@ onMounted(async () => { ...@@ -639,7 +730,7 @@ onMounted(async () => {
}); });
iconPoint(viewer, pins).then(result => { iconPoint(viewer, pins).then(result => {
console.log(result); console.log('--2--',result);
}); });
}, 2000); }, 2000);
// setTimePerson(); // setTimePerson();
...@@ -647,7 +738,6 @@ onMounted(async () => { ...@@ -647,7 +738,6 @@ onMounted(async () => {
setRemUnit(); setRemUnit();
// 监听窗口大小变化 // 监听窗口大小变化
window.addEventListener('resize', setRemUnit); window.addEventListener('resize', setRemUnit);
// zhaojunbao 结束 // zhaojunbao 结束
const handler = new Cesium.ScreenSpaceEventHandler(viewer.scene.canvas); const handler = new Cesium.ScreenSpaceEventHandler(viewer.scene.canvas);
...@@ -724,7 +814,7 @@ onMounted(async () => { ...@@ -724,7 +814,7 @@ onMounted(async () => {
console.log(labelData.value); console.log(labelData.value);
const webRtcServrce = ref(); const webRtcServrce = ref();
nextTick(() => { nextTick(() => {
webRtcServrce.value = new WebRtcStreamer('video', `${location.protocol}//` + `192.168.2.53:8000`); webRtcServrce.value = new WebRtcStreamer('video', `${location.protocol}//` + `192.168.2.67:8000`);
webRtcServrce.value.connect(res.data.data.videoStream); webRtcServrce.value.connect(res.data.data.videoStream);
}); });
} }
...@@ -749,7 +839,7 @@ onUnmounted(() => { ...@@ -749,7 +839,7 @@ onUnmounted(() => {
viewer.destroy(); viewer.destroy();
viewer = null; viewer = null;
} }
// 移除窗口大小变化监听 // 移除窗口大小变化监听
window.removeEventListener('resize', setRemUnit); window.removeEventListener('resize', setRemUnit);
...@@ -761,9 +851,11 @@ onUnmounted(() => { ...@@ -761,9 +851,11 @@ onUnmounted(() => {
<template> <template>
<div class="wrapper"> <div class="wrapper">
<div class="top-toolbar"> <div class="top-toolbar">
<div class="baojing"> <div class="baojing" @click="toggleAlarmStatus">
声光报警 声光报警
<NSwitch v-model:value="active" /> <!-- <NSwitch v-model:value="active" /> -->
<img src="@/assets/jinrun/open.png" alt="" srcset="" v-show="alarmStatus == 1">
<img src="@/assets/jinrun/close.png" alt="" srcset="" v-show="alarmStatus == 0">
</div> </div>
<!-- <i class="split-line"></i> --> <!-- <i class="split-line"></i> -->
...@@ -874,7 +966,6 @@ onUnmounted(() => { ...@@ -874,7 +966,6 @@ onUnmounted(() => {
allowfullscreen="true" allowfullscreen="true"
allowtransparency="true" allowtransparency="true"
allow="autoplay" allow="autoplay"
scrolling="no"
:src="link" :src="link"
width="100%" width="100%"
height="100%" height="100%"
...@@ -1037,7 +1128,7 @@ onUnmounted(() => { ...@@ -1037,7 +1128,7 @@ onUnmounted(() => {
<!-- 非cesium相关 结束 --> <!-- 非cesium相关 结束 -->
</template> </template>
<style scoped> <style scoped lang="scss">
html, html,
body { body {
width: 100%; width: 100%;
...@@ -1241,9 +1332,9 @@ span { ...@@ -1241,9 +1332,9 @@ span {
/* zhaojunbao */ /* zhaojunbao */
.top-toolbar { .top-toolbar {
position: absolute; position: absolute;
top: 0.5rem; top: 0.44rem;
right: 0.5rem; right: 0.5rem;
width: 240px; width: 300px;
height: 0.4rem; height: 0.4rem;
color: #11e0ff; color: #11e0ff;
z-index: 99999; z-index: 99999;
...@@ -1258,9 +1349,24 @@ span { ...@@ -1258,9 +1349,24 @@ span {
} }
.baojing { .baojing {
.alarmTxt{
font-size: 0.18rem;
display: inline-block;
width: 100px;
}
position: relative; position: relative;
padding-left: 25px; padding-left: 25px;
display: block; display: block;
display: flex;
justify-content: start;
align-items: center;
height: 20px;
img{
width: 0.5rem;
height: 0.22rem;
cursor: pointer;
margin-left: 10px;
}
&::before { &::before {
content: ''; content: '';
......
...@@ -41,13 +41,17 @@ async function handleSubmit() { ...@@ -41,13 +41,17 @@ async function handleSubmit() {
const res = await api_loginPost(model); const res = await api_loginPost(model);
if (res.data.code == 200) { if (res.data.code == 200) {
// 模拟loginByToken的逻辑 // 模拟loginByToken的逻辑
localStorage.setItem('loginId', res.data.data.roleId);
localStorage.setItem('token', res.data.data.token); localStorage.setItem('token', res.data.data.token);
window.$notification?.success({ window.$notification?.success({
title: '登录成功', title: '登录成功',
content: '欢迎回来,登录已完成', content: '欢迎回来,登录已完成',
duration: 3000 duration: 3000,
style: {
zIndex: 9999
}
}); });
router.push('/home'); router.push('/cesiumDeom');
} else { } else {
window.$notification?.error({ window.$notification?.error({
title: '登录失败', title: '登录失败',
......
...@@ -3,6 +3,8 @@ import { api_tokenGet } from '@/api'; ...@@ -3,6 +3,8 @@ import { api_tokenGet } from '@/api';
import { useMessage } from 'naive-ui'; import { useMessage } from 'naive-ui';
import { onMounted } from 'vue'; import { onMounted } from 'vue';
const baseUrl = import.meta.env.VITE_AI_URL;
onMounted(async () => { onMounted(async () => {
const message = useMessage(); const message = useMessage();
let res = await api_tokenGet() let res = await api_tokenGet()
...@@ -13,7 +15,7 @@ onMounted(async () => { ...@@ -13,7 +15,7 @@ onMounted(async () => {
</script> </script>
<template> <template>
<iframe allowfullscreen="true" allowtransparency="true" allow="autoplay" scrolling="no" src="http://192.168.2.54:9528/large" frameborder="0"></iframe> <iframe allowfullscreen="true" allowtransparency="true" allow="autoplay" :src="`${baseUrl}/large`" frameborder="0"></iframe>
</template> </template>
<style scoped></style> <style scoped></style>
\ No newline at end of file
...@@ -3,6 +3,8 @@ import { api_tokenGet } from '@/api'; ...@@ -3,6 +3,8 @@ import { api_tokenGet } from '@/api';
import { useMessage } from 'naive-ui'; import { useMessage } from 'naive-ui';
import { onMounted } from 'vue'; import { onMounted } from 'vue';
const baseUrl = import.meta.env.VITE_AI_URL;
onMounted(async () => { onMounted(async () => {
const message = useMessage(); const message = useMessage();
let res = await api_tokenGet() let res = await api_tokenGet()
...@@ -13,7 +15,7 @@ onMounted(async () => { ...@@ -13,7 +15,7 @@ onMounted(async () => {
</script> </script>
<template> <template>
<iframe src="http://192.168.2.54:9528/result" frameborder="0"></iframe> <iframe allowfullscreen="true" allowtransparency="true" allow="autoplay" :src="`${baseUrl}/result`" frameborder="0"></iframe>
</template> </template>
<style scoped></style> <style scoped></style>
...@@ -3,6 +3,8 @@ import { api_tokenGet } from '@/api'; ...@@ -3,6 +3,8 @@ import { api_tokenGet } from '@/api';
import { useMessage } from 'naive-ui'; import { useMessage } from 'naive-ui';
import { onMounted } from 'vue'; import { onMounted } from 'vue';
const baseUrl = import.meta.env.VITE_AI_URL;
onMounted(async () => { onMounted(async () => {
const message = useMessage(); const message = useMessage();
let res = await api_tokenGet() let res = await api_tokenGet()
...@@ -13,7 +15,7 @@ onMounted(async () => { ...@@ -13,7 +15,7 @@ onMounted(async () => {
</script> </script>
<template> <template>
<iframe allowfullscreen="true" allowtransparency="true" allow="autoplay" scrolling="no" src="http://192.168.2.54:9528/camera" frameborder="0"></iframe> <iframe allowfullscreen="true" allowtransparency="true" allow="autoplay" :src="`${baseUrl}/camera`" frameborder="0"></iframe>
</template> </template>
<style scoped></style> <style scoped></style>
<template> <template>
<iframe src="http://192.168.2.54:9528/videos" frameborder="0"></iframe> <iframe allowfullscreen="true" allowtransparency="true" allow="autoplay" :src="`${baseUrl}/videos`" frameborder="0"></iframe>
</template> </template>
<script lang="ts" setup> <script lang="ts" setup>
...@@ -7,6 +7,8 @@ import { api_tokenGet } from '@/api'; ...@@ -7,6 +7,8 @@ import { api_tokenGet } from '@/api';
import { useMessage } from 'naive-ui'; import { useMessage } from 'naive-ui';
import { onMounted } from 'vue'; import { onMounted } from 'vue';
const baseUrl = import.meta.env.VITE_AI_URL;
onMounted(async () => { onMounted(async () => {
const message = useMessage(); const message = useMessage();
let res = await api_tokenGet() let res = await api_tokenGet()
......
<template> <template>
<iframe src="http://192.168.2.54:9528/arithmetic" frameborder="0"></iframe> <iframe allowfullscreen="true" allowtransparency="true" allow="autoplay" :src="`${baseUrl}/arithmetic`" frameborder="0"></iframe>
</template> </template>
<script lang="ts" setup> <script lang="ts" setup>
...@@ -7,6 +7,8 @@ import { api_tokenGet } from '@/api'; ...@@ -7,6 +7,8 @@ import { api_tokenGet } from '@/api';
import { useMessage } from 'naive-ui'; import { useMessage } from 'naive-ui';
import { onMounted } from 'vue'; import { onMounted } from 'vue';
const baseUrl = import.meta.env.VITE_AI_URL;
onMounted(async () => { onMounted(async () => {
const message = useMessage(); const message = useMessage();
let res = await api_tokenGet() let res = await api_tokenGet()
......
<template> <template>
<iframe src="http://192.168.2.54:9528/remind" frameborder="0"></iframe> <iframe allowfullscreen="true" allowtransparency="true" allow="autoplay" :src="`${baseUrl}/remind`" frameborder="0"></iframe>
</template> </template>
<script lang="ts" setup> <script lang="ts" setup>
...@@ -7,6 +7,8 @@ import { api_tokenGet } from '@/api'; ...@@ -7,6 +7,8 @@ import { api_tokenGet } from '@/api';
import { useMessage } from 'naive-ui'; import { useMessage } from 'naive-ui';
import { onMounted } from 'vue'; import { onMounted } from 'vue';
const baseUrl = import.meta.env.VITE_AI_URL;
onMounted(async () => { onMounted(async () => {
const message = useMessage(); const message = useMessage();
let res = await api_tokenGet() let res = await api_tokenGet()
......
<template> <template>
<iframe src="http://192.168.2.54:9528/pushmessage" frameborder="0"></iframe> <iframe allowfullscreen="true" allowtransparency="true" allow="autoplay" :src="`${baseUrl}/pushmessage`" frameborder="0"></iframe>
</template> </template>
<script lang="ts" setup> <script lang="ts" setup>
...@@ -7,6 +7,8 @@ import { api_tokenGet } from '@/api'; ...@@ -7,6 +7,8 @@ import { api_tokenGet } from '@/api';
import { useMessage } from 'naive-ui'; import { useMessage } from 'naive-ui';
import { onMounted } from 'vue'; import { onMounted } from 'vue';
const baseUrl = import.meta.env.VITE_AI_URL;
onMounted(async () => { onMounted(async () => {
const message = useMessage(); const message = useMessage();
let res = await api_tokenGet() let res = await api_tokenGet()
......
<template> <template>
<iframe src="http://192.168.2.15:81/dataMonitor/bmwy/history" frameborder="0"></iframe> <iframe :src="`${baseUrl}/dataMonitor/bmwy/history`" frameborder="0"></iframe>
</template> </template>
<script lang="ts" setup> <script lang="ts" setup>
...@@ -7,6 +7,8 @@ import { api_tokenGet } from '@/api'; ...@@ -7,6 +7,8 @@ import { api_tokenGet } from '@/api';
import { useMessage } from 'naive-ui'; import { useMessage } from 'naive-ui';
import { onMounted } from 'vue'; import { onMounted } from 'vue';
const baseUrl = import.meta.env.VITE_CASTING_URL;
onMounted(async () => { onMounted(async () => {
const message = useMessage(); const message = useMessage();
let res = await api_tokenGet() let res = await api_tokenGet()
......
<template> <template>
<iframe src="http://192.168.2.15:81/dataMonitor/jyl/history" frameborder="0"></iframe> <iframe :src="`${baseUrl}/dataMonitor/jyl/history`" frameborder="0"></iframe>
</template> </template>
<script lang="ts" setup> <script lang="ts" setup>
...@@ -7,6 +7,8 @@ import { api_tokenGet } from '@/api'; ...@@ -7,6 +7,8 @@ import { api_tokenGet } from '@/api';
import { useMessage } from 'naive-ui'; import { useMessage } from 'naive-ui';
import { onMounted } from 'vue'; import { onMounted } from 'vue';
const baseUrl = import.meta.env.VITE_CASTING_URL;
onMounted(async () => { onMounted(async () => {
const message = useMessage(); const message = useMessage();
let res = await api_tokenGet() let res = await api_tokenGet()
......
<template> <template>
<iframe style="width: 100%; height: 100%;" src="http://192.168.2.15:81/index" frameborder="0"></iframe> <iframe style="width: 100%; height: 100%;" :src="`${baseUrl}/index`" frameborder="0"></iframe>
</template> </template>
<script lang="ts" setup> <script lang="ts" setup>
...@@ -7,6 +7,8 @@ import { api_tokenGet } from '@/api'; ...@@ -7,6 +7,8 @@ import { api_tokenGet } from '@/api';
import { useMessage } from 'naive-ui'; import { useMessage } from 'naive-ui';
import { onMounted } from 'vue'; import { onMounted } from 'vue';
const baseUrl = import.meta.env.VITE_CASTING_URL;
onMounted(async () => { onMounted(async () => {
const message = useMessage(); const message = useMessage();
let res = await api_tokenGet() let res = await api_tokenGet()
......
<template> <template>
<iframe src="http://192.168.2.15:81/personMonitor/valueInput" frameborder="0"></iframe> <iframe :src="`${baseUrl}/personMonitor/valueInput`" frameborder="0"></iframe>
</template> </template>
<script lang="ts" setup> <script lang="ts" setup>
...@@ -7,6 +7,8 @@ import { api_tokenGet } from '@/api'; ...@@ -7,6 +7,8 @@ import { api_tokenGet } from '@/api';
import { useMessage } from 'naive-ui'; import { useMessage } from 'naive-ui';
import { onMounted } from 'vue'; import { onMounted } from 'vue';
const baseUrl = import.meta.env.VITE_CASTING_URL;
onMounted(async () => { onMounted(async () => {
const message = useMessage(); const message = useMessage();
let res = await api_tokenGet() let res = await api_tokenGet()
......
<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,14 +192,22 @@ async function topDelete() { ...@@ -192,14 +192,22 @@ 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 {
let id = ids.value.join(',') dialog.create({
let res = await delFenceLogApi(id); title: '提示',
if(res.data.code == 200) { content: '确定删除这条记录吗?',
search(); positiveText: '确定',
message.success('删除成功') negativeText: '取消',
} else { onPositiveClick: async () => {
message.error(res.data.msg) let id = ids.value.join(',')
} let res = await delFenceLogApi(id);
if (res.data.code == 200) {
search();
message.success('删除成功')
} else {
message.error(res.data.msg)
}
}
})
} }
} }
// 头部导出 // 头部导出
...@@ -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,18 +306,35 @@ async function handleSearch() { ...@@ -299,18 +306,35 @@ 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;
const cartesian = Cesium.Cartesian3.fromRadians(cartographic.longitude, cartographic.latitude, adjustedHeight); const cartesian = Cesium.Cartesian3.fromRadians(cartographic.longitude, cartographic.latitude, adjustedHeight);
if (resHeight != null) { if (resHeight != null) {
let dataHeight = Number(height) - Number(resHeight); let dataHeight = Number(height) - Number(resHeight);
if (dataHeight < 0.5) { if (dataHeight < 0.5) {
...@@ -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,9 +340,9 @@ async function handleSearch() { ...@@ -324,9 +340,9 @@ 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);
cesiumShow.value = false; cesiumShow.value = false;
...@@ -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