Compare commits
159 Commits
3463bc7993
...
main
| Author | SHA1 | Date | |
|---|---|---|---|
| 9ddb412b7a | |||
| 1c9c5ab639 | |||
| d6675050e6 | |||
| ee50e38292 | |||
| 29752a70af | |||
| 1307e1bddf | |||
| 0ff3e4b1bc | |||
| 3231df14d9 | |||
| 4880ffc37c | |||
| 26e4ab7539 | |||
| 5fb12d90ba | |||
| c424fbd04b | |||
| 15719b4a27 | |||
| a1b3d03a0c | |||
| 33d2123778 | |||
| 5139a112c5 | |||
| e7d2cc94f8 | |||
| eb8e4e1c69 | |||
| ead17e67bb | |||
| 7eb35c9a4e | |||
| 5597a4c2ca | |||
| 010028da0d | |||
| 30079ec854 | |||
| 3c504cb65c | |||
| aa7229e21b | |||
| 84af6f5cfe | |||
| c7a05f2118 | |||
| 7445e789a4 | |||
| fabab0a577 | |||
| 8b53fbe0ca | |||
| 65af3b6956 | |||
| 47d8f14ad4 | |||
| 1c664cc2f6 | |||
| b89bc455f6 | |||
| ee4eec1e2e | |||
| b6c64df004 | |||
| 93166e0f71 | |||
| dc28fb65ba | |||
| 03df0388b4 | |||
| 6d6d395bff | |||
| 75a7da4a19 | |||
| 8e552df724 | |||
| 72699abdec | |||
| 2dca6e3ff8 | |||
| 63804635de | |||
| eb598255f3 | |||
| 492d43c709 | |||
| 8f28eb920f | |||
| 4a4902ab72 | |||
| 462656880c | |||
| 80d1570e68 | |||
| fc3a8e58d9 | |||
| 9906c2653b | |||
| 52d18cf408 | |||
| 7081f28ee0 | |||
| cb9ea99008 | |||
| 4aac36cd4c | |||
| e7e58d28cc | |||
| af45e3fda3 | |||
| e0b9daa40e | |||
| 08c0d8ebd3 | |||
| 7eb64f2d70 | |||
| 13f72a49ae | |||
| 28aa794e3f | |||
| 6454933d59 | |||
| 848f471ef1 | |||
| a3be91c6ac | |||
| 25aa857758 | |||
| 52d90d490b | |||
| 428d5c90c8 | |||
| 4288867acf | |||
| 070a398f7e | |||
| 277bf123ea | |||
| dd01ed36bd | |||
| 47f5b7a0a6 | |||
| e8b19513b4 | |||
| b202de76ec | |||
| c4d00bfdc3 | |||
| e865ea34b9 | |||
| 997c88ae57 | |||
| 81df83be26 | |||
| 76c3a7c8bf | |||
| cc53ee4d29 | |||
| 066e6da017 | |||
| fb13f40ac1 | |||
| cf05f857bd | |||
| dda3b11326 | |||
| f811445451 | |||
| d5f7c218bd | |||
| ee795f3676 | |||
| 4527780cf8 | |||
| 5d1e2d0b1c | |||
| 5d073b47fb | |||
| 7b0460c4e0 | |||
| ae84b7cde4 | |||
| 2fc3d4ae67 | |||
| 872d7d1c14 | |||
| 1701b6e4d3 | |||
| c7cfa4c1de | |||
| d632ba514c | |||
| ed9b519b77 | |||
| 2d005a5456 | |||
| dbf39c5538 | |||
| b1f5cfdd7a | |||
| eb4bb8c208 | |||
| 517998a0db | |||
| e8ece06a44 | |||
| bf1eb3ecbb | |||
| f853349d1e | |||
| 1ee6efa80f | |||
| 2bee644444 | |||
| f249ff496f | |||
| 34c828bef3 | |||
| 2c6bf02773 | |||
| 5fa21849a4 | |||
| a407fb7f7a | |||
| 1c61f32cc8 | |||
| a14409cd7c | |||
| 2e11de3293 | |||
| df244a687a | |||
| fe01f1f0b0 | |||
| b7192b761e | |||
| 128e4f4074 | |||
| d78b7fd15e | |||
| d8665eda33 | |||
| 30f3167573 | |||
| 0653974969 | |||
| 8ba3128cb9 | |||
| cea834508e | |||
| a2ee519a22 | |||
| 030d305702 | |||
| d976443fb9 | |||
| 24cb308980 | |||
| 39dfdeacf3 | |||
| 8cc266d9b0 | |||
| e5d62c84a5 | |||
| 72d7e76bf9 | |||
| 2e54b6e85b | |||
| 589a1eafed | |||
| 8a65f4690c | |||
| 496c40f415 | |||
| 6a85ea01da | |||
| 84335de7c4 | |||
| a6cd6a5b3c | |||
| c818e7607a | |||
| 95b020d389 | |||
| b03d287dac | |||
| 92e22812d7 | |||
| c95c0e65d2 | |||
| a31318aa1a | |||
| 520d6b2b1a | |||
| 4749cdce3c | |||
| df3da71c59 | |||
| 2da26d5f47 | |||
| d80aa54c8e | |||
| aed63a26ac | |||
| 6557b79f0c | |||
| 78771e9551 | |||
| f17e878e0c |
@ -5,10 +5,13 @@ VITE_APP_TITLE = 云平台管理系统
|
|||||||
VITE_APP_ENV = 'development'
|
VITE_APP_ENV = 'development'
|
||||||
|
|
||||||
# 开发环境
|
# 开发环境
|
||||||
# VITE_APP_BASE_API = 'http://47.120.79.150/backend'
|
# VITE_APP_BASE_API = 'http://139.224.253.23:8000'
|
||||||
VITE_APP_BASE_API = 'http://192.168.110.54:8000'
|
VITE_APP_BASE_API = 'https://www.cnxhyc.com/jq'
|
||||||
# VITE_APP_BASE_API = 'http://localhost:8000'
|
# VITE_APP_BASE_API = 'http://192.168.110.57:8000'
|
||||||
|
#代永飞接口
|
||||||
|
# VITE_APP_BASE_API = 'http://457102h2d6.qicp.vip:24689'
|
||||||
|
|
||||||
|
VITE_AMAP_KEY='84a12a692ae378effdf741e16d584cd3'
|
||||||
|
|
||||||
# 应用访问路径 例如使用前缀 /admin/
|
# 应用访问路径 例如使用前缀 /admin/
|
||||||
VITE_APP_CONTEXT_PATH = '/'
|
VITE_APP_CONTEXT_PATH = '/'
|
||||||
|
|||||||
@ -2,13 +2,16 @@
|
|||||||
VITE_APP_TITLE = 云平台管理系统
|
VITE_APP_TITLE = 云平台管理系统
|
||||||
|
|
||||||
# 生产环境配置 晶全1
|
# 生产环境配置 晶全1
|
||||||
VITE_APP_ENV = 'https://fuyuanshen.com/backend'
|
VITE_APP_ENV = 'production'
|
||||||
|
|
||||||
# 生产环境配置 富源晟2
|
# 生产环境配置 富源晟2
|
||||||
# VITE_APP_ENV = 'https://fuyuanshen.com/backend-fys'
|
# VITE_APP_ENV = 'https://fuyuanshen.com/backend-fys'
|
||||||
|
|
||||||
# 应用访问路径 晶全1
|
# 应用访问路径 晶全1
|
||||||
VITE_APP_CONTEXT_PATH = '/jingquan/'
|
VITE_APP_CONTEXT_PATH = '/PC/'
|
||||||
|
|
||||||
|
# 高德地图Key
|
||||||
|
VITE_AMAP_KEY='84a12a692ae378effdf741e16d584cd3'
|
||||||
|
|
||||||
# 应用访问路径 富源晟2
|
# 应用访问路径 富源晟2
|
||||||
#VITE_APP_CONTEXT_PATH = '/sys/'
|
#VITE_APP_CONTEXT_PATH = '/sys/'
|
||||||
@ -19,8 +22,10 @@ VITE_APP_MONITOR_ADMIN = '/admin/applications'
|
|||||||
# SnailJob 控制台地址
|
# SnailJob 控制台地址
|
||||||
VITE_APP_SNAILJOB_ADMIN = '/snail-job'
|
VITE_APP_SNAILJOB_ADMIN = '/snail-job'
|
||||||
|
|
||||||
# 生产环境 晶全3
|
# 生产环境 晶全3 代理访问
|
||||||
VITE_APP_BASE_API = '/backend'
|
VITE_APP_BASE_API = 'https://www.cnxhyc.com/jq'
|
||||||
|
|
||||||
|
# VITE_APP_BASE_API = 'http://139.224.253.23:8000'
|
||||||
|
|
||||||
# 生产环境 富源晟3
|
# 生产环境 富源晟3
|
||||||
#VITE_APP_BASE_API = '/backend-fys'
|
#VITE_APP_BASE_API = '/backend-fys'
|
||||||
|
|||||||
@ -6,7 +6,12 @@
|
|||||||
<meta name="renderer" content="webkit" />
|
<meta name="renderer" content="webkit" />
|
||||||
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no" />
|
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no" />
|
||||||
<link rel="icon" href="/favicon.ico" />
|
<link rel="icon" href="/favicon.ico" />
|
||||||
<script src="https://webapi.amap.com/maps?v=2.0&key=90bc158992feb8ccd0145e168cab1307"></script>
|
<script type="text/javascript">
|
||||||
|
window._AMapSecurityConfig = {
|
||||||
|
securityJsCode: "4239900f4fb7b2569df651ac814a28de",
|
||||||
|
};
|
||||||
|
</script>
|
||||||
|
<script src="https://webapi.amap.com/maps?v=2.0&key=78c36a1e251a95f1a21a9e5ea7a1331c&plugin=AMap.CircleEditor"></script>
|
||||||
<title>物联网管理平台</title>
|
<title>物联网管理平台</title>
|
||||||
<!--[if lt IE 11
|
<!--[if lt IE 11
|
||||||
]><script>
|
]><script>
|
||||||
|
|||||||
11
package.json
@ -37,6 +37,7 @@
|
|||||||
"jsencrypt": "3.3.2",
|
"jsencrypt": "3.3.2",
|
||||||
"mitt": "^3.0.1",
|
"mitt": "^3.0.1",
|
||||||
"nprogress": "0.2.0",
|
"nprogress": "0.2.0",
|
||||||
|
"paho-mqtt": "^1.1.0",
|
||||||
"pinia": "3.0.2",
|
"pinia": "3.0.2",
|
||||||
"qrcode-vue3": "^1.7.1",
|
"qrcode-vue3": "^1.7.1",
|
||||||
"screenfull": "6.0.2",
|
"screenfull": "6.0.2",
|
||||||
@ -55,9 +56,9 @@
|
|||||||
"@types/js-cookie": "3.0.6",
|
"@types/js-cookie": "3.0.6",
|
||||||
"@types/node": "^22.13.4",
|
"@types/node": "^22.13.4",
|
||||||
"@types/nprogress": "0.2.3",
|
"@types/nprogress": "0.2.3",
|
||||||
"@unocss/preset-attributify": "66.0.0",
|
"@unocss/preset-attributify": "^66.0.0",
|
||||||
"@unocss/preset-icons": "66.0.0",
|
"@unocss/preset-icons": "^66.0.0",
|
||||||
"@unocss/preset-uno": "66.0.0",
|
"@unocss/preset-uno": "^66.0.0",
|
||||||
"@vitejs/plugin-vue": "5.2.3",
|
"@vitejs/plugin-vue": "5.2.3",
|
||||||
"@vue/compiler-sfc": "3.5.13",
|
"@vue/compiler-sfc": "3.5.13",
|
||||||
"@vue/eslint-config-prettier": "10.2.0",
|
"@vue/eslint-config-prettier": "10.2.0",
|
||||||
@ -71,12 +72,12 @@
|
|||||||
"sass": "1.87.0",
|
"sass": "1.87.0",
|
||||||
"terser": "^5.43.1",
|
"terser": "^5.43.1",
|
||||||
"typescript": "~5.8.3",
|
"typescript": "~5.8.3",
|
||||||
"unocss": "66.0.0",
|
"unocss": "^66.0.0",
|
||||||
"unplugin-auto-import": "19.1.2",
|
"unplugin-auto-import": "19.1.2",
|
||||||
"unplugin-icons": "22.1.0",
|
"unplugin-icons": "22.1.0",
|
||||||
"unplugin-vue-components": "28.5.0",
|
"unplugin-vue-components": "28.5.0",
|
||||||
"unplugin-vue-setup-extend-plus": "1.0.1",
|
"unplugin-vue-setup-extend-plus": "1.0.1",
|
||||||
"vite": "^7.1.3",
|
"vite": "^6.3.6",
|
||||||
"vite-plugin-compression": "0.5.1",
|
"vite-plugin-compression": "0.5.1",
|
||||||
"vite-plugin-svg-icons-ng": "^1.4.0",
|
"vite-plugin-svg-icons-ng": "^1.4.0",
|
||||||
"vite-plugin-vue-devtools": "7.7.5",
|
"vite-plugin-vue-devtools": "7.7.5",
|
||||||
|
|||||||
108
src/api/FenceManager/fence.ts
Normal file
@ -0,0 +1,108 @@
|
|||||||
|
import request from '@/utils/request';
|
||||||
|
|
||||||
|
//修改电子围栏
|
||||||
|
function updateFence(data) {
|
||||||
|
return request({
|
||||||
|
url: '/api/equipment/geoFence',
|
||||||
|
method: 'put',
|
||||||
|
data: data
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
//新增电子围栏
|
||||||
|
function AddFence(data) {
|
||||||
|
return request({
|
||||||
|
url: '/api/equipment/geoFence',
|
||||||
|
method: 'post',
|
||||||
|
data: data
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
//导出电子围栏列表
|
||||||
|
function exportFence (data){
|
||||||
|
return request({
|
||||||
|
url: '/api/equipment/geoFence/export',
|
||||||
|
method: 'post',
|
||||||
|
data: data
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
//位置检查
|
||||||
|
function check(data) {
|
||||||
|
return request({
|
||||||
|
url: '/api/equipment/geoFence/check',
|
||||||
|
method: 'post',
|
||||||
|
data: data
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
//获取电子围栏详细信息
|
||||||
|
function geoFenceById(id) {
|
||||||
|
return request({
|
||||||
|
url: '/api/equipment/geoFence/'+id,
|
||||||
|
method: 'get'
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
//查询电子围栏列表
|
||||||
|
function getList(data) {
|
||||||
|
if(!data){
|
||||||
|
data={pageNum:1,pageSize:9999};
|
||||||
|
}
|
||||||
|
return request({
|
||||||
|
url: '/api/equipment/geoFence/list',
|
||||||
|
method: 'get',
|
||||||
|
params: data
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
//删除电子围栏
|
||||||
|
function DelFence(ids) {
|
||||||
|
return request({
|
||||||
|
url: '/api/equipment/geoFence/' + ids,
|
||||||
|
method: 'delete'
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
//添加终端
|
||||||
|
function addTerminal(data){
|
||||||
|
return request({
|
||||||
|
url: '/api/equipment/geoFence/addTerminal',
|
||||||
|
method: 'post',
|
||||||
|
data: data
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
//删除终端
|
||||||
|
function delTerminal(data){
|
||||||
|
return request({
|
||||||
|
url: '/api/equipment/geoFence/delTerminal',
|
||||||
|
method: 'post',
|
||||||
|
data:data
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
//查询终端
|
||||||
|
function pageTerminal(data){
|
||||||
|
return request({
|
||||||
|
url:'api/device/pageTerminal',
|
||||||
|
method:'get',
|
||||||
|
params:data
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
export default{
|
||||||
|
updateFence:updateFence,
|
||||||
|
AddFence:AddFence,
|
||||||
|
exportFence:exportFence,
|
||||||
|
check:check,
|
||||||
|
geoFenceById:geoFenceById,
|
||||||
|
getList:getList,
|
||||||
|
DelFence:DelFence,
|
||||||
|
addTerminal:addTerminal,
|
||||||
|
delTerminal:delTerminal,
|
||||||
|
pageTerminal:pageTerminal
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
245
src/api/FenceManager/mapOpt.ts
Normal file
@ -0,0 +1,245 @@
|
|||||||
|
var map = null;
|
||||||
|
var circle = null;
|
||||||
|
var polygon = null;
|
||||||
|
import mapLocation from '@/assets/images/mapLocation.png';
|
||||||
|
|
||||||
|
function initMap() {
|
||||||
|
// let key = '90bc158992feb8ccd0145e168cab1307';
|
||||||
|
let init = function () {
|
||||||
|
map = new AMap.Map("map", {
|
||||||
|
viewMode: '2D', //默认使用 2D 模式
|
||||||
|
zoom: 11, //地图级别
|
||||||
|
dragEnable: true, // 强制开启拖拽
|
||||||
|
zoomEnable: true, // 开启滚轮缩放(辅助验证)
|
||||||
|
center: [114.420739, 30.487514], //地图中心点
|
||||||
|
});
|
||||||
|
|
||||||
|
|
||||||
|
setTimeout(() => {
|
||||||
|
map.resize();
|
||||||
|
}, 1000);
|
||||||
|
// map.on('click',function(evt){
|
||||||
|
// alert('您点击的位置:'+evt.lnglat.lng+' , '+ evt.lnglat.lat);
|
||||||
|
// });
|
||||||
|
}
|
||||||
|
return new Promise((resolve, reject) => {
|
||||||
|
if(map){
|
||||||
|
resolve(200);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
if (window.AMap) {
|
||||||
|
init();
|
||||||
|
resolve(200);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
reject({code:500,msg:'高德地图未能初始化成功'});
|
||||||
|
});
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
//添加一个点
|
||||||
|
function AddPoint(point, index, dragEnd, click) {
|
||||||
|
|
||||||
|
return new Promise((resolve, reject) => {
|
||||||
|
try {
|
||||||
|
let center = point ? new AMap.LngLat(point.lng, point.lat) : map.getCenter();
|
||||||
|
|
||||||
|
let marker = new AMap.Text({
|
||||||
|
icon: mapLocation,
|
||||||
|
position: center,
|
||||||
|
offset: new AMap.Pixel(-15, -24),
|
||||||
|
draggable: true,
|
||||||
|
cursor: 'point',
|
||||||
|
title: '点击删除',
|
||||||
|
text: index,
|
||||||
|
class: 'point',
|
||||||
|
extData: { type: 'point', txt: index }
|
||||||
|
});
|
||||||
|
marker.setMap(map);
|
||||||
|
|
||||||
|
let lays = map.getAllOverlays('text');
|
||||||
|
for (let i = 0; i < lays.length; i++) {
|
||||||
|
const element = lays[i];
|
||||||
|
let cls = element.getOptions();
|
||||||
|
if (cls.class) {
|
||||||
|
element.dom.classList.add(cls.class);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
marker.on('dragend', dragEnd);
|
||||||
|
marker.on('mouseover', function (evt) {
|
||||||
|
marker.setText('X');
|
||||||
|
|
||||||
|
});
|
||||||
|
marker.on('mouseout', function (evt) {
|
||||||
|
marker.setText(marker.getExtData().txt);
|
||||||
|
|
||||||
|
});
|
||||||
|
marker.on('click', function (evt) {
|
||||||
|
|
||||||
|
click(evt, marker);
|
||||||
|
});
|
||||||
|
resolve(center);
|
||||||
|
} catch (ex) {
|
||||||
|
reject(ex)
|
||||||
|
}
|
||||||
|
|
||||||
|
});
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
function getCenter() {
|
||||||
|
var center = map.getCenter().toJSON();
|
||||||
|
return center;
|
||||||
|
}
|
||||||
|
|
||||||
|
function setCenter(lon, lat) {
|
||||||
|
var position = new AMap.LngLat(lon, lat); //传入经纬度
|
||||||
|
map.setCenter(position); //简写 设置地图中心点
|
||||||
|
|
||||||
|
}
|
||||||
|
//画多边形
|
||||||
|
function DrawPoy(points) {
|
||||||
|
if(!map){
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
if (!points) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
let path = [];
|
||||||
|
if (polygon) {
|
||||||
|
map.remove(polygon);
|
||||||
|
polygon = null;
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
setTimeout(() => {
|
||||||
|
points.filter(v => {
|
||||||
|
path.push(new AMap.LngLat(v.lng, v.lat));
|
||||||
|
return true;
|
||||||
|
});
|
||||||
|
|
||||||
|
polygon = new AMap.Polygon({
|
||||||
|
path: path,
|
||||||
|
fillColor: '#ccebc5',
|
||||||
|
strokeOpacity: 1,
|
||||||
|
fillOpacity: 0.5,
|
||||||
|
strokeColor: '#FF0000',
|
||||||
|
strokeWeight: 5,
|
||||||
|
strokeStyle: 'solid',
|
||||||
|
strokeDasharray: [5, 5],
|
||||||
|
});
|
||||||
|
|
||||||
|
map.add(polygon);
|
||||||
|
|
||||||
|
// map.setFitView();
|
||||||
|
}, 0);
|
||||||
|
|
||||||
|
}
|
||||||
|
//画圆形
|
||||||
|
function DrawCicle(points, raduis, dragEnd) {
|
||||||
|
if(!map){
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
if (circle) {
|
||||||
|
map.remove(circle);
|
||||||
|
}
|
||||||
|
|
||||||
|
circle = new AMap.Circle({
|
||||||
|
center: [points[0].lng, points[0].lat],
|
||||||
|
radius: raduis ? raduis : 1000, //半径
|
||||||
|
borderWeight: 3,
|
||||||
|
strokeColor: "#FF33FF",
|
||||||
|
strokeWeight: 6,
|
||||||
|
strokeOpacity: 0.2,
|
||||||
|
fillOpacity: 0.4,
|
||||||
|
strokeStyle: 'solid',
|
||||||
|
strokeDasharray: [10, 10],
|
||||||
|
// 线样式还支持 'dashed'
|
||||||
|
fillColor: '#1791fc',
|
||||||
|
zIndex: 50,
|
||||||
|
})
|
||||||
|
|
||||||
|
// var circleEditor = new AMap.CircleEditor(map, circle,{
|
||||||
|
// editOptions: {
|
||||||
|
// moveable: false, // 禁止拖拽圆心
|
||||||
|
// // 可以同时配置其他编辑选项
|
||||||
|
// // scalable: true // 允许缩放(默认开启)
|
||||||
|
// }
|
||||||
|
// });
|
||||||
|
|
||||||
|
// circleEditor.open();
|
||||||
|
|
||||||
|
// circleEditor.on('move', function (event) {
|
||||||
|
|
||||||
|
// console.log('触发事件:move')
|
||||||
|
// })
|
||||||
|
|
||||||
|
// circleEditor.on('adjust', function (event) {
|
||||||
|
// console.log('触发事件:adjust');
|
||||||
|
|
||||||
|
// dragEnd(event.radius);
|
||||||
|
// })
|
||||||
|
|
||||||
|
// circleEditor.on('end', function (event) {
|
||||||
|
|
||||||
|
// console.log('触发事件: end')
|
||||||
|
// // event.target 即为编辑后的圆形对象
|
||||||
|
// })
|
||||||
|
|
||||||
|
map.add(circle);
|
||||||
|
// 缩放地图到合适的视野级别
|
||||||
|
map.setFitView([circle])
|
||||||
|
}
|
||||||
|
|
||||||
|
//清除所有
|
||||||
|
function clearOverLays() {
|
||||||
|
map && map.clearMap();
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
function removeOverLay(lay) {
|
||||||
|
map && map.remove(lay);
|
||||||
|
}
|
||||||
|
|
||||||
|
function removePoy() {
|
||||||
|
if(!map){
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
if (polygon) {
|
||||||
|
map.remove(polygon);
|
||||||
|
polygon = null;
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
function removeCircle() {
|
||||||
|
if(!map){
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
if (circle) {
|
||||||
|
map.remove(circle);
|
||||||
|
circle = null;
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
function setFitView() {
|
||||||
|
if(map){map.setFitView();}
|
||||||
|
}
|
||||||
|
export default {
|
||||||
|
gdMap: map,
|
||||||
|
initMap: initMap,
|
||||||
|
AddPoint: AddPoint,
|
||||||
|
getCenter: getCenter,
|
||||||
|
DrawPoy: DrawPoy,
|
||||||
|
DrawCicle: DrawCicle,
|
||||||
|
clearOverLays: clearOverLays,
|
||||||
|
removeOverLay: removeOverLay,
|
||||||
|
removePoy: removePoy,
|
||||||
|
removeCircle: removeCircle,
|
||||||
|
setFitView: setFitView
|
||||||
|
}
|
||||||
62
src/api/FenceManager/record.ts
Normal file
@ -0,0 +1,62 @@
|
|||||||
|
import request from '@/utils/request';
|
||||||
|
import common from '@/utils/common';
|
||||||
|
|
||||||
|
//修改围栏进出记录
|
||||||
|
function updateRecord(data) {
|
||||||
|
return request({
|
||||||
|
url: '/api/equipment/fenceAccessRecord',
|
||||||
|
method: 'put',
|
||||||
|
data: data
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
//新增围栏进出记录
|
||||||
|
function addRecord(data) {
|
||||||
|
return request({
|
||||||
|
url: '/api/equipment/fenceAccessRecord',
|
||||||
|
method: 'post',
|
||||||
|
data: data
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
//获取围栏进出记录详细信息
|
||||||
|
function getRecordById(id) {
|
||||||
|
return request({
|
||||||
|
url: '/api/equipment/fenceAccessRecord/' + id,
|
||||||
|
method: 'get'
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
//查询围栏进出记录列表
|
||||||
|
function RecordList(data) {
|
||||||
|
let queryParams = Object.assign({}, data);
|
||||||
|
if (queryParams.Date && queryParams.Date.length) {
|
||||||
|
queryParams.beginTime = common.DateFormat(queryParams.Date[0], 'yyyy-MM-dd');
|
||||||
|
queryParams.endTime = common.DateFormat(queryParams.Date.length > 1 ? queryParams.Date[1] : '', 'yyyy-MM-dd');
|
||||||
|
}
|
||||||
|
delete queryParams['Date'];
|
||||||
|
return request({
|
||||||
|
url: '/api/equipment/fenceAccessRecord/list',
|
||||||
|
method: 'get',
|
||||||
|
params: queryParams
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
//删除围栏进出记录
|
||||||
|
function DropRecord(ids) {
|
||||||
|
return request({
|
||||||
|
url: '/api/equipment/fenceAccessRecord/' + ids,
|
||||||
|
method: 'delete'
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
export default {
|
||||||
|
updateRecord: updateRecord,
|
||||||
|
addRecord: addRecord,
|
||||||
|
getRecordById: getRecordById,
|
||||||
|
RecordList: RecordList,
|
||||||
|
DropRecord: DropRecord
|
||||||
|
}
|
||||||
51
src/api/controlCenter/controlPanel/100J.ts
Normal file
@ -0,0 +1,51 @@
|
|||||||
|
import request from '@/utils/request';
|
||||||
|
|
||||||
|
// 详情信息
|
||||||
|
export const deviceDeatil = (id: string) => {
|
||||||
|
return request({
|
||||||
|
url: `/api/hby100j/device/${id}`,
|
||||||
|
method: 'get',
|
||||||
|
});
|
||||||
|
};
|
||||||
|
// 灯光模式
|
||||||
|
function lightModeSettings (data: any) {
|
||||||
|
return request({
|
||||||
|
url: `/app/hby100j/device/lightAdjustment`,
|
||||||
|
method: 'post',
|
||||||
|
data: data
|
||||||
|
});
|
||||||
|
};
|
||||||
|
//频率调节
|
||||||
|
function staticPowerSetting (data: any) {
|
||||||
|
return request({
|
||||||
|
url: `/app/hby100j/device/strobeFrequency`,
|
||||||
|
method: 'post',
|
||||||
|
data: data
|
||||||
|
});
|
||||||
|
};
|
||||||
|
// 修改音量
|
||||||
|
function settingUpdateVolume (data: any) {
|
||||||
|
return request({
|
||||||
|
url: `/app/hby100j/device/updateVolume`,
|
||||||
|
method: 'post',
|
||||||
|
data: data
|
||||||
|
});
|
||||||
|
};
|
||||||
|
|
||||||
|
// 强制报警
|
||||||
|
function SosSetting (data: any) {
|
||||||
|
return request({
|
||||||
|
url: `/app/hby100j/device/forceAlarmActivation`,
|
||||||
|
method: 'post',
|
||||||
|
data: data
|
||||||
|
});
|
||||||
|
};
|
||||||
|
|
||||||
|
|
||||||
|
export default {
|
||||||
|
deviceDeatil,
|
||||||
|
lightModeSettings:lightModeSettings,
|
||||||
|
SosSetting:SosSetting,
|
||||||
|
staticPowerSetting:staticPowerSetting,
|
||||||
|
settingUpdateVolume:settingUpdateVolume
|
||||||
|
};
|
||||||
75
src/api/controlCenter/controlPanel/670.ts
Normal file
@ -0,0 +1,75 @@
|
|||||||
|
import request from '@/utils/request';
|
||||||
|
|
||||||
|
// 人员信息发送
|
||||||
|
function SendUser (data: any) {
|
||||||
|
return request({
|
||||||
|
url: `/api/xinghan/device/registerPersonInfo`,
|
||||||
|
method: 'post',
|
||||||
|
data: data
|
||||||
|
});
|
||||||
|
};
|
||||||
|
|
||||||
|
// 灯光模式
|
||||||
|
function lightModeSettings (data: any) {
|
||||||
|
return request({
|
||||||
|
url: `/api/xinghan/device/LightGradeSettings`,
|
||||||
|
method: 'post',
|
||||||
|
data: data
|
||||||
|
});
|
||||||
|
};
|
||||||
|
|
||||||
|
// 强制报警
|
||||||
|
function SosSetting (data: any) {
|
||||||
|
return request({
|
||||||
|
url: `/api/xinghan/device/SOSGradeSettings`,
|
||||||
|
method: 'post',
|
||||||
|
data: data
|
||||||
|
});
|
||||||
|
};
|
||||||
|
//批量强制报警
|
||||||
|
function SosSettingBatch(data:any){
|
||||||
|
return request({
|
||||||
|
url: `/api/xinghan/device/SOSGradeSettingsBatch`,
|
||||||
|
method: 'post',
|
||||||
|
data: data
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
//静电探测档位控制
|
||||||
|
function staticPowerSetting (data: any) {
|
||||||
|
return request({
|
||||||
|
url: `/api/xinghan/device/DetectGradeSettings`,
|
||||||
|
method: 'post',
|
||||||
|
data: data
|
||||||
|
});
|
||||||
|
};
|
||||||
|
|
||||||
|
// 获取设备实时状态
|
||||||
|
function deviceRealTimeStatus (id: any) {
|
||||||
|
return request({
|
||||||
|
url: `/api/xinghan/device/`+id,
|
||||||
|
method: 'get'
|
||||||
|
});
|
||||||
|
};
|
||||||
|
|
||||||
|
// 发送信息
|
||||||
|
function SendMessage (data: any) {
|
||||||
|
return request({
|
||||||
|
url: `/api/xinghan/device/sendAlarmMessage`,
|
||||||
|
method: 'post',
|
||||||
|
data: data
|
||||||
|
});
|
||||||
|
};
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
export default {
|
||||||
|
SendUser:SendUser,
|
||||||
|
lightModeSettings:lightModeSettings,
|
||||||
|
SosSetting:SosSetting,
|
||||||
|
staticPowerSetting:staticPowerSetting,
|
||||||
|
deviceRealTimeStatus:deviceRealTimeStatus,
|
||||||
|
SendMessage:SendMessage,
|
||||||
|
SosSettingBatch:SosSettingBatch
|
||||||
|
};
|
||||||
114
src/api/controlCenter/controlPanel/eqControl.ts
Normal file
@ -0,0 +1,114 @@
|
|||||||
|
import xhyc from '@/api/controlCenter/controlPanel/670'
|
||||||
|
import fys from '@/api/controlCenter/controlPanel/index'
|
||||||
|
|
||||||
|
|
||||||
|
var dic = [{
|
||||||
|
typeNames: ['670'],//星汉的配置
|
||||||
|
sendMsg: {
|
||||||
|
cfg: ['sendMsg', 'deviceIds', 'deviceImeiList', 'instructValue', 'batchId'],
|
||||||
|
method: xhyc.SendMessage
|
||||||
|
},
|
||||||
|
SOS: {
|
||||||
|
|
||||||
|
cfg: ["deviceIds", "typeName", "batchId", "deviceImeiList", "instructValue"],
|
||||||
|
method: xhyc.SosSettingBatch
|
||||||
|
},
|
||||||
|
sendImg: {
|
||||||
|
cfg: [],
|
||||||
|
method: null
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
typeNames: ['6170', '210'],//富源晟的配置
|
||||||
|
sendMsg: {
|
||||||
|
cfg: ["deviceIds", "typeName", "batchId", "deviceImeiList", "sendMsg"],
|
||||||
|
method: fys.deviceSendMessage
|
||||||
|
},
|
||||||
|
SOS: {
|
||||||
|
cfg: ["deviceIds", "typeName", "batchId", "deviceImeiList", "instructValue"],
|
||||||
|
method: fys.sendAlarmMessage
|
||||||
|
},
|
||||||
|
sendImg: {
|
||||||
|
cfg: [],
|
||||||
|
method: null
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
typeNames: null,//如果找不到,以富源晟的配置为准
|
||||||
|
sendMsg: {
|
||||||
|
cfg: ["deviceIds", "typeName", "batchId", "deviceImeiList", "sendMsg"],
|
||||||
|
method: fys.deviceSendMessage
|
||||||
|
},
|
||||||
|
SOS: {
|
||||||
|
cfg: ["deviceIds", "typeName", "batchId", "deviceImeiList", "instructValue"],
|
||||||
|
method: fys.sendAlarmMessage
|
||||||
|
},
|
||||||
|
sendImg: {
|
||||||
|
cfg: [],
|
||||||
|
method: null
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
];
|
||||||
|
|
||||||
|
function getCfg(json, type) {
|
||||||
|
let f = dic.find(v => {
|
||||||
|
|
||||||
|
let flag = false;
|
||||||
|
for (let index = 0; index < v.typeNames.length; index++) {
|
||||||
|
let i = v.typeNames[index];
|
||||||
|
if (i.toLowerCase().indexOf(json.typeName.toLowerCase()) > -1 || json.typeName.toLowerCase().indexOf(i.toLowerCase()) > -1) {
|
||||||
|
flag = true;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return flag;
|
||||||
|
});
|
||||||
|
|
||||||
|
if (!f) {
|
||||||
|
f = dic.find(v => {
|
||||||
|
return !v.typeNames;
|
||||||
|
});
|
||||||
|
}
|
||||||
|
if (f) {
|
||||||
|
let keys = f[type].cfg;
|
||||||
|
let method = f[type].method;
|
||||||
|
|
||||||
|
let formData = {};
|
||||||
|
keys.forEach(key => {
|
||||||
|
formData[key] = json[key];
|
||||||
|
});
|
||||||
|
|
||||||
|
return {
|
||||||
|
formData: formData,
|
||||||
|
method: method
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
|
//发送信息
|
||||||
|
function deviceSendMessage(json) {
|
||||||
|
let cfg = getCfg(json, 'sendMsg');
|
||||||
|
if (cfg.method) {
|
||||||
|
return cfg.method(cfg.formData);
|
||||||
|
}
|
||||||
|
return Promise.reject({ code: 500, msg: '配置中找不到该类型的设备' });
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
//强制报警
|
||||||
|
function sendAlarmMessage(json) {
|
||||||
|
|
||||||
|
let cfg = getCfg(json, 'SOS');
|
||||||
|
if (cfg.method) {
|
||||||
|
return cfg.method(cfg.formData);
|
||||||
|
}
|
||||||
|
return Promise.reject({ code: 500, msg: '配置中找不到该类型的设备' });
|
||||||
|
}
|
||||||
|
export default {
|
||||||
|
deviceSendMessage: deviceSendMessage,
|
||||||
|
sendAlarmMessage: sendAlarmMessage
|
||||||
|
}
|
||||||
@ -3,14 +3,14 @@ export interface deviceQuery {
|
|||||||
pageNum: number;
|
pageNum: number;
|
||||||
deviceId: string;
|
deviceId: string;
|
||||||
deviceName: string;
|
deviceName: string;
|
||||||
deviceStatus: string;
|
onlineStatus: string;
|
||||||
deviceMac: string;
|
deviceMac: string;
|
||||||
deviceImei: string;
|
deviceImei: string;
|
||||||
personnelBy: string;
|
personnelBy: string;
|
||||||
communicationMode: string;
|
communicationMode: string;
|
||||||
pageSize: Number;
|
pageSize: Number;
|
||||||
deviceType: string;
|
deviceType: string;
|
||||||
content:string
|
content: string
|
||||||
|
|
||||||
}
|
}
|
||||||
export interface deviceVO {
|
export interface deviceVO {
|
||||||
@ -20,7 +20,7 @@ export interface deviceVO {
|
|||||||
onlineStatus: 0 | 1; // 设备状态(0=失效/离线,1=正常/在线,对应子组件的device.status)
|
onlineStatus: 0 | 1; // 设备状态(0=失效/离线,1=正常/在线,对应子组件的device.status)
|
||||||
lng?: number; // 经度(地图打点用)
|
lng?: number; // 经度(地图打点用)
|
||||||
lat?: number; // 纬度(地图打点用
|
lat?: number; // 纬度(地图打点用
|
||||||
|
|
||||||
// 其他字段...
|
// 其他字段...
|
||||||
}
|
}
|
||||||
// 1. 定义设备详情的类型(根据接口返回字段调整!关键:和后端返回的字段名一致)
|
// 1. 定义设备详情的类型(根据接口返回字段调整!关键:和后端返回的字段名一致)
|
||||||
@ -36,13 +36,10 @@ export interface DeviceDetail {
|
|||||||
currentLightMode?: string;// 当前选中的灯光模式(如"strong",对应强光)
|
currentLightMode?: string;// 当前选中的灯光模式(如"strong",对应强光)
|
||||||
sendMsg: string;
|
sendMsg: string;
|
||||||
lightBrightness: string;
|
lightBrightness: string;
|
||||||
personnelInfo: { // 人员信息(嵌套对象,根据接口调整)
|
strobeFrequency: string;
|
||||||
unitName: string; // 单位
|
volume: string;
|
||||||
position: string; // 职位
|
chargeState: string;
|
||||||
name: string; // 姓名
|
alarmStatus: number
|
||||||
code: string; // ID(身份证/工号)
|
|
||||||
};
|
|
||||||
|
|
||||||
}
|
}
|
||||||
// 定义灯光模式的类型接口
|
// 定义灯光模式的类型接口
|
||||||
export interface LightMode {
|
export interface LightMode {
|
||||||
|
|||||||
89
src/api/debugCenter/debugCenter.ts
Normal file
@ -0,0 +1,89 @@
|
|||||||
|
import request from '@/utils/request';
|
||||||
|
|
||||||
|
//获取列表数据
|
||||||
|
function getDevice(queryParams){
|
||||||
|
return request({
|
||||||
|
url: '/api/device/debug/list',
|
||||||
|
method: 'get',
|
||||||
|
params: queryParams
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
//上传文件
|
||||||
|
function uploadFile(formData){
|
||||||
|
return request({
|
||||||
|
url: '/api/device/debug/addFile',
|
||||||
|
method: 'post',
|
||||||
|
data: formData
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
//修改操作视频
|
||||||
|
function addVideo(formData){
|
||||||
|
return request({
|
||||||
|
url: '/api/device/debug/addVideo',
|
||||||
|
method: 'post',
|
||||||
|
data: formData
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
//修改单个数据的多个文件
|
||||||
|
function updateItem(formData){
|
||||||
|
|
||||||
|
return request({
|
||||||
|
url: '/api/device/debug/editDebug',
|
||||||
|
method: 'post',
|
||||||
|
data: formData
|
||||||
|
})
|
||||||
|
//开发时假装成功
|
||||||
|
// return new Promise((resolve,reject)=>{
|
||||||
|
// resolve({
|
||||||
|
// code:200,
|
||||||
|
// msg:"操作成功"
|
||||||
|
// });
|
||||||
|
// });
|
||||||
|
}
|
||||||
|
//批量上传开机画面
|
||||||
|
function uploadBoot(formData){
|
||||||
|
return request({
|
||||||
|
url: '/api/device/debug/addLogo',
|
||||||
|
method: 'post',
|
||||||
|
data: formData
|
||||||
|
})
|
||||||
|
//开发时假装成功
|
||||||
|
// return new Promise((resolve, reject) => {
|
||||||
|
// //开机画面
|
||||||
|
// resolve({ code: 200, msg: '操作成功' });
|
||||||
|
// });
|
||||||
|
}
|
||||||
|
|
||||||
|
// 6170上传logo开机画面
|
||||||
|
function deviceUploadLogo(formData){
|
||||||
|
return request({
|
||||||
|
url: '/api/bjq/device/batchUploadLogo',
|
||||||
|
method: 'post',
|
||||||
|
data: formData
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
function getDeviceInfoById(id){
|
||||||
|
return request({
|
||||||
|
url: '/api/device/debug/detail/'+id,
|
||||||
|
method: 'get'
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
export default{
|
||||||
|
getDevice:getDevice,
|
||||||
|
uploadFile:uploadFile,
|
||||||
|
addVideo:addVideo,
|
||||||
|
updateItem:updateItem,
|
||||||
|
uploadBoot:uploadBoot,
|
||||||
|
getDeviceInfoById:getDeviceInfoById,
|
||||||
|
deviceUploadLogo:deviceUploadLogo
|
||||||
|
}
|
||||||
29
src/api/debugCenter/deviceApi.ts
Normal file
@ -0,0 +1,29 @@
|
|||||||
|
|
||||||
|
import debugCenter from '@/api/debugCenter/debugCenter';
|
||||||
|
const uploadConfig = {
|
||||||
|
670: {
|
||||||
|
api: debugCenter.uploadBoot, // 670对应接口
|
||||||
|
requiredParams: ['deviceIds', 'file']
|
||||||
|
},
|
||||||
|
6170: {
|
||||||
|
api: debugCenter.deviceUploadLogo,
|
||||||
|
requiredParams: ['deviceIds', 'file',]
|
||||||
|
},
|
||||||
|
default: {
|
||||||
|
api: debugCenter.uploadBoot,
|
||||||
|
requiredParams: ['deviceIds', 'file']
|
||||||
|
}
|
||||||
|
};
|
||||||
|
function handleParams(deviceType, deviceIds, file) {
|
||||||
|
const formattedIds = Array.isArray(deviceIds) ? deviceIds : [deviceIds];
|
||||||
|
const formData = new FormData();
|
||||||
|
formattedIds.forEach(id => formData.append('deviceIds', id));
|
||||||
|
formData.append('file', file);
|
||||||
|
return formData;
|
||||||
|
}
|
||||||
|
export function uploadLogo(deviceType, deviceIds, file) {
|
||||||
|
const currentConfig = uploadConfig[deviceType] || uploadConfig.default;
|
||||||
|
const formData = handleParams(deviceType, deviceIds, file);
|
||||||
|
return currentConfig.api(formData);
|
||||||
|
}
|
||||||
|
export default { uploadLogo };
|
||||||
@ -16,6 +16,7 @@ export interface AlarmVO {
|
|||||||
deviceMac: string;
|
deviceMac: string;
|
||||||
devicePic:string;
|
devicePic:string;
|
||||||
finishTime: string;
|
finishTime: string;
|
||||||
|
timeDiff:string
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
86
src/api/equipmentManagement/device/shareManage.ts
Normal file
@ -0,0 +1,86 @@
|
|||||||
|
import request from '@/utils/request';
|
||||||
|
import { resolve } from 'path';
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
function DelShare(ids) {
|
||||||
|
return request({
|
||||||
|
url: '/api/equipment/share/' + ids,
|
||||||
|
method: 'delete'
|
||||||
|
});
|
||||||
|
}
|
||||||
|
//添加分享数据
|
||||||
|
function SaveShare(data,type){
|
||||||
|
|
||||||
|
let promise=null;
|
||||||
|
if(type=='add'){
|
||||||
|
promise=addShare(data);
|
||||||
|
}else{
|
||||||
|
promise=powerSet(data);
|
||||||
|
}
|
||||||
|
return promise;
|
||||||
|
}
|
||||||
|
//添加
|
||||||
|
function addShare(data) {
|
||||||
|
return request({
|
||||||
|
url: '/api/equipment/share/deviceShare',
|
||||||
|
method: 'post',
|
||||||
|
data: data
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
//修改
|
||||||
|
function powerSet(data) {
|
||||||
|
return request({
|
||||||
|
url: '/api/equipment/share/permission',
|
||||||
|
method: 'post',
|
||||||
|
data: data
|
||||||
|
});
|
||||||
|
|
||||||
|
}
|
||||||
|
//查询
|
||||||
|
function searchShare(params) {
|
||||||
|
return request({
|
||||||
|
url: '/api/equipment/share/deviceShareList',
|
||||||
|
method: 'get',
|
||||||
|
params: params
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
//发送验证码
|
||||||
|
function sendSms(phoneNumber) {
|
||||||
|
return request({
|
||||||
|
url: '/api/equipment/share/sms/code',
|
||||||
|
method: 'get',
|
||||||
|
params: {
|
||||||
|
phonenumber: phoneNumber
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
// return new Promise((resolve,reject)=>{
|
||||||
|
// resolve({
|
||||||
|
// code:200
|
||||||
|
// });
|
||||||
|
// });
|
||||||
|
}
|
||||||
|
|
||||||
|
function getUsrs(){
|
||||||
|
return request({
|
||||||
|
url: '/WebApp/user/list',
|
||||||
|
method: 'get',
|
||||||
|
params: {
|
||||||
|
pageNum:1,
|
||||||
|
pageSize:9999
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
export default {
|
||||||
|
powerSet: powerSet,
|
||||||
|
DelShare: DelShare,
|
||||||
|
SaveShare: SaveShare,
|
||||||
|
searchShare: searchShare,
|
||||||
|
sendSms:sendSms,
|
||||||
|
getUsrs:getUsrs
|
||||||
|
}
|
||||||
@ -5,6 +5,8 @@ export interface deviceQuery extends PageQuery {
|
|||||||
deviceType: string;
|
deviceType: string;
|
||||||
deviceStatus: string;
|
deviceStatus: string;
|
||||||
bluetoothName?: string; // 蓝牙名称查询字段
|
bluetoothName?: string; // 蓝牙名称查询字段
|
||||||
|
onlineStatus?: string;
|
||||||
|
bindingStatus?:string
|
||||||
}
|
}
|
||||||
|
|
||||||
export interface deviceForm {
|
export interface deviceForm {
|
||||||
@ -37,6 +39,7 @@ export interface deviceVO {
|
|||||||
customerId?: string | number;
|
customerId?: string | number;
|
||||||
typeName?: string;
|
typeName?: string;
|
||||||
bluetoothName?: string; // 蓝牙名称字段
|
bluetoothName?: string; // 蓝牙名称字段
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
export interface deviceTypeOption {
|
export interface deviceTypeOption {
|
||||||
|
|||||||
@ -17,7 +17,10 @@ export const addDeviceType = (data: any): AxiosPromise<deviceTypeVO[]> => {
|
|||||||
return request({
|
return request({
|
||||||
url: '/api/deviceType/add',
|
url: '/api/deviceType/add',
|
||||||
method: 'post',
|
method: 'post',
|
||||||
data: data
|
data: data,
|
||||||
|
headers:{
|
||||||
|
'Content-Type':'application/x-www-form-urlencoded;charset=UTF-8'
|
||||||
|
}
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
|
||||||
@ -26,6 +29,9 @@ export const updateDeviceType = (data: any): AxiosPromise<deviceTypeVO[]> => {
|
|||||||
return request({
|
return request({
|
||||||
url: '/api/deviceType/update',
|
url: '/api/deviceType/update',
|
||||||
method: 'put',
|
method: 'put',
|
||||||
|
headers:{
|
||||||
|
'Content-Type':'application/x-www-form-urlencoded;charset=UTF-8'
|
||||||
|
},
|
||||||
data
|
data
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
@ -34,6 +40,7 @@ export const deleteDeviceType = (ids: any): AxiosPromise<deviceTypeVO[]> => {
|
|||||||
return request({
|
return request({
|
||||||
url: '/api/deviceType/delete',
|
url: '/api/deviceType/delete',
|
||||||
method: 'delete',
|
method: 'delete',
|
||||||
|
|
||||||
data: ids
|
data: ids
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|||||||
@ -1,6 +1,4 @@
|
|||||||
import { func } from 'vue-types';
|
|
||||||
import request from '@/utils/request';
|
import request from '@/utils/request';
|
||||||
import { AxiosPromise } from 'axios';
|
|
||||||
|
|
||||||
//左侧节点的数据源
|
//左侧节点的数据源
|
||||||
function getTreeData(para: any) {
|
function getTreeData(para: any) {
|
||||||
|
|||||||
@ -89,8 +89,9 @@ function getRepairList(data) {
|
|||||||
"repairPart": data.repairPart,
|
"repairPart": data.repairPart,
|
||||||
"repairReason": data.repairReason,
|
"repairReason": data.repairReason,
|
||||||
"repairPerson": data.repairPerson,
|
"repairPerson": data.repairPerson,
|
||||||
"repairBeginTime": data.repairBeginTime,
|
"repairBeginTime":data.Date?data.Date[0]:'',
|
||||||
"repairEndTime": data.repairBeginTime,
|
"repairEndTime": data.Date?data.Date[1]:'',
|
||||||
|
"searchValue":data.searchValue,
|
||||||
"pageNum": data.pageNum,
|
"pageNum": data.pageNum,
|
||||||
"pageSize": data.pageSize
|
"pageSize": data.pageSize
|
||||||
}
|
}
|
||||||
@ -126,6 +127,13 @@ function getDeviceTypeAll() {
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function getDeviceAll(){
|
||||||
|
return request({
|
||||||
|
url:'api/device?pageNum=1&pageSize=99999',
|
||||||
|
method:'get'}
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
updateRepair: updateRepair,
|
updateRepair: updateRepair,
|
||||||
addRepir: addRepir,
|
addRepir: addRepir,
|
||||||
@ -133,5 +141,6 @@ export default {
|
|||||||
getRepirDetail: getRepirDetail,
|
getRepirDetail: getRepirDetail,
|
||||||
getRepairList: getRepairList,
|
getRepairList: getRepairList,
|
||||||
dropRepir: dropRepir,
|
dropRepir: dropRepir,
|
||||||
getDeviceTypeAll: getDeviceTypeAll
|
getDeviceTypeAll: getDeviceTypeAll,
|
||||||
|
getDeviceAll:getDeviceAll
|
||||||
}
|
}
|
||||||
43
src/api/home/index.ts
Normal file
@ -0,0 +1,43 @@
|
|||||||
|
import request from '@/utils/request';
|
||||||
|
import { AxiosPromise } from 'axios';
|
||||||
|
// 获取 数据总览 DataOverview
|
||||||
|
export const getDataOverview = (params) => {
|
||||||
|
return request({
|
||||||
|
url: '/api/device/homepage/getDataOverview',
|
||||||
|
method: 'get',
|
||||||
|
params: params
|
||||||
|
});
|
||||||
|
};
|
||||||
|
// 设备分类
|
||||||
|
export const getEquipmentClassification = (params) => {
|
||||||
|
return request({
|
||||||
|
url: '/api/device/homepage/getEquipmentClassification',
|
||||||
|
method: 'get',
|
||||||
|
params: params
|
||||||
|
});
|
||||||
|
};
|
||||||
|
// 获取设备使用情况
|
||||||
|
export const getEquipmentUsageData = (range, params = {}) => {
|
||||||
|
return request({
|
||||||
|
url: `/api/device/homepage/getEquipmentUsageData/${range}`,
|
||||||
|
method: 'get',
|
||||||
|
params: params
|
||||||
|
});
|
||||||
|
};
|
||||||
|
|
||||||
|
// 获取报警信息
|
||||||
|
export const getAlarmInformation = (params) => {
|
||||||
|
return request({
|
||||||
|
url: `/api/device/homepage/getAlarmInformation`,
|
||||||
|
method: 'get',
|
||||||
|
params: params
|
||||||
|
});
|
||||||
|
};
|
||||||
|
|
||||||
|
|
||||||
|
export default {
|
||||||
|
getDataOverview,
|
||||||
|
getEquipmentClassification,
|
||||||
|
getEquipmentUsageData,
|
||||||
|
getAlarmInformation
|
||||||
|
}
|
||||||
6
src/api/home/types.ts
Normal file
@ -0,0 +1,6 @@
|
|||||||
|
export interface DataOverviewType {
|
||||||
|
devicesNumber: number | string;
|
||||||
|
equipmentOnline: number | string;
|
||||||
|
binding: number | string;
|
||||||
|
equipmentAbnormal: number | string;
|
||||||
|
}
|
||||||
59
src/api/homeIndex/index.ts
Normal file
@ -0,0 +1,59 @@
|
|||||||
|
import request from '@/utils/request';
|
||||||
|
// 获取设备总览 DataOverview
|
||||||
|
export const getDeviceOverview = (params) => {
|
||||||
|
return request({
|
||||||
|
url: '/api/largeScreen/getDeviceOverview',
|
||||||
|
method: 'get',
|
||||||
|
params: params
|
||||||
|
});
|
||||||
|
};
|
||||||
|
|
||||||
|
|
||||||
|
// 报警事件,报警总数统计
|
||||||
|
export const getAlarmStatistics = (params) => {
|
||||||
|
return request({
|
||||||
|
url: '/api/largeScreen/getAlarmStatistics',
|
||||||
|
method: 'get',
|
||||||
|
params: params
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
// 报警次数
|
||||||
|
export const getMonthlyAlarmStatistics = (params) => {
|
||||||
|
return request({
|
||||||
|
url: '/api/largeScreen/getMonthlyAlarmStatistics',
|
||||||
|
method: 'get',
|
||||||
|
params: params
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
// 设备类别
|
||||||
|
export const getDeviceCommunicationModeStatistics = (params = {}) => {
|
||||||
|
return request({
|
||||||
|
url: '/api/largeScreen/getDeviceCommunicationModeStatistics',
|
||||||
|
method: 'get',
|
||||||
|
params: params
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
// 设备使用频次
|
||||||
|
export const getDeviceUsageFrequency = (params = {}) => {
|
||||||
|
return request({
|
||||||
|
url: '/api/largeScreen/getDeviceUsageFrequency',
|
||||||
|
method: 'get',
|
||||||
|
params: params
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
// 实时报警
|
||||||
|
export const getRealtimeAlarm = (params = {}) => {
|
||||||
|
return request({
|
||||||
|
url: '/api/largeScreen/getRealtimeAlarm',
|
||||||
|
method: 'get',
|
||||||
|
params: params
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
0
src/api/homeIndex/types.ts
Normal file
241
src/api/largeScreen/mapOpt.ts
Normal file
@ -0,0 +1,241 @@
|
|||||||
|
var map = null;
|
||||||
|
var layPoints = [];
|
||||||
|
|
||||||
|
function initMap(click) {
|
||||||
|
// let key = '90bc158992feb8ccd0145e168cab1307';
|
||||||
|
let init = function () {
|
||||||
|
map = new AMap.Map("map", {
|
||||||
|
viewMode: '2D', //默认使用 2D 模式
|
||||||
|
zoom: 11, //地图级别
|
||||||
|
center: [116.396477, 39.909278], //地图中心点
|
||||||
|
mapStyle: "amap://styles/darkblue"
|
||||||
|
});
|
||||||
|
|
||||||
|
map.on('click', function (evt) {
|
||||||
|
// alert('您点击的位置:'+evt.lnglat.lng+' , '+ evt.lnglat.lat);
|
||||||
|
if (click) {
|
||||||
|
click(evt.lnglat);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
return new Promise((resolve, reject) => {
|
||||||
|
if (map) {
|
||||||
|
resolve(200);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
if (window.AMap) {
|
||||||
|
init();
|
||||||
|
resolve(200);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
reject({ code: 500, msg: '高德地图未能初始化成功' });
|
||||||
|
});
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
//添加一个点
|
||||||
|
function AddPoint(point, index, dragEnd, click, iconImg) {
|
||||||
|
|
||||||
|
return new Promise((resolve, reject) => {
|
||||||
|
try {
|
||||||
|
if (!point) {
|
||||||
|
reject("point不可用")
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
if (!point.longitude || !point.latitude) {
|
||||||
|
reject("point的经纬度不可用")
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
layPoints.push({ lng: point.longitude, lat: point.latitude });
|
||||||
|
|
||||||
|
let center = new AMap.LngLat(point.longitude, point.latitude);
|
||||||
|
|
||||||
|
let icon = new AMap.Icon({
|
||||||
|
size: new AMap.Size(45, 45), //图标尺寸
|
||||||
|
image: iconImg, //Icon 的图像
|
||||||
|
|
||||||
|
imageSize: new AMap.Size(45, 45), //根据所设置的大小拉伸或压缩图片
|
||||||
|
});
|
||||||
|
let marker = new AMap.Marker({
|
||||||
|
icon: icon,
|
||||||
|
position: center,
|
||||||
|
offset: new AMap.Pixel(-15, -24),
|
||||||
|
draggable: dragEnd ? true : false,
|
||||||
|
cursor: 'point',
|
||||||
|
title: point.isAlarming ? '正在报警:' + point.deviceName : point.deviceName,
|
||||||
|
text: index,
|
||||||
|
class: 'point',
|
||||||
|
extData: point,
|
||||||
|
anchor:'bottom-center'
|
||||||
|
});
|
||||||
|
marker.setMap(map);
|
||||||
|
|
||||||
|
let lays = map.getAllOverlays('text');
|
||||||
|
for (let i = 0; i < lays.length; i++) {
|
||||||
|
const element = lays[i];
|
||||||
|
let cls = element.getOptions();
|
||||||
|
if (cls.class) {
|
||||||
|
element.dom.classList.add(cls.class);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
resolve(center);
|
||||||
|
} catch (ex) {
|
||||||
|
reject(ex)
|
||||||
|
}
|
||||||
|
|
||||||
|
});
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
function getCenter() {
|
||||||
|
var center = map.getCenter().toJSON();
|
||||||
|
return center;
|
||||||
|
}
|
||||||
|
|
||||||
|
function setCenter(lon, latitude) {
|
||||||
|
var position = new AMap.LngLat(lon, latitude); //传入经纬度
|
||||||
|
map.setCenter(position); //简写 设置地图中心点
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
function calcCenter() {
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
|
//画多边形
|
||||||
|
function DrawPoy(points) {
|
||||||
|
|
||||||
|
return new Promise((resolve, reject) => {
|
||||||
|
if (!map) {
|
||||||
|
reject("map未初始化");
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
if (!points) {
|
||||||
|
reject("points未初始化");
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
if (!points.coordinates) {
|
||||||
|
reject("coordinates未初始化");
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!Array.isArray(points.coordinates)) {
|
||||||
|
points.coordinates = JSON.parse(points.coordinates);
|
||||||
|
}
|
||||||
|
|
||||||
|
let path = [];
|
||||||
|
|
||||||
|
|
||||||
|
setTimeout(() => {
|
||||||
|
points.coordinates.filter(v => {
|
||||||
|
if (v.lng && v.lat) {
|
||||||
|
path.push(new AMap.LngLat(v.lng, v.lat));
|
||||||
|
layPoints.push({ lng: v.lng, lat: v.lat });
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
return false;
|
||||||
|
});
|
||||||
|
if (!path.length) {
|
||||||
|
reject("path为空");
|
||||||
|
}
|
||||||
|
let polygon = new AMap.Polygon({
|
||||||
|
path: path,
|
||||||
|
fillColor: '#F00C0C',
|
||||||
|
fillOpacity: 0.03,
|
||||||
|
strokeOpacity: 0.1,
|
||||||
|
strokeColor: '#F00C0C',
|
||||||
|
|
||||||
|
strokeWeight: 3,
|
||||||
|
strokeStyle: 'dashed',
|
||||||
|
// strokeDasharray: [50,50,50],
|
||||||
|
extData: points
|
||||||
|
});
|
||||||
|
map.add(polygon);
|
||||||
|
resolve("添加多边形成功");
|
||||||
|
}, 0);
|
||||||
|
});
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
|
//画圆形
|
||||||
|
function DrawCicle(points, raduis, dragEnd) {
|
||||||
|
|
||||||
|
return new Promise((resolve, reject) => {
|
||||||
|
if (!map) {
|
||||||
|
reject("map未初始化");
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
if (!points) {
|
||||||
|
reject("points未初始化");
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
if (!points.coordinates) {
|
||||||
|
reject("coordinates未初始化");
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!Array.isArray(points.coordinates)) {
|
||||||
|
points.coordinates = JSON.parse(points.coordinates);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!(points.coordinates[0].lng && points.coordinates[0].lat)) {
|
||||||
|
reject("圆的中心点不正确")
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
let circle = new AMap.Circle({
|
||||||
|
center: [points.coordinates[0].lng, points.coordinates[0].lat],
|
||||||
|
radius: raduis ? raduis : 1000, //半径
|
||||||
|
borderWeight: 3,
|
||||||
|
strokeColor: "#F00C0C",
|
||||||
|
strokeWeight: 1,
|
||||||
|
strokeOpacity: 0.2,
|
||||||
|
fillOpacity: 0.4,
|
||||||
|
strokeStyle: 'dashed',
|
||||||
|
strokeDasharray: [10, 10],
|
||||||
|
// 线样式还支持 'dashed'
|
||||||
|
fillColor: '#1791fc',
|
||||||
|
zIndex: 50,
|
||||||
|
})
|
||||||
|
map.add(circle);
|
||||||
|
layPoints.push({ lng: points.coordinates[0].lng, lat: points.coordinates[0].lat });
|
||||||
|
resolve("添加圆成功");
|
||||||
|
});
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
//清除所有
|
||||||
|
function clearOverLays() {
|
||||||
|
map && map.clearMap();
|
||||||
|
layPoints = [];
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
function removeOverLay(lay) {
|
||||||
|
map && map.remove(lay);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
function setFitView() {
|
||||||
|
if (map) { map.setFitView(); }
|
||||||
|
}
|
||||||
|
export default {
|
||||||
|
gdMap: map,
|
||||||
|
initMap: initMap,
|
||||||
|
AddPoint: AddPoint,
|
||||||
|
getCenter: getCenter,
|
||||||
|
DrawPoy: DrawPoy,
|
||||||
|
DrawCicle: DrawCicle,
|
||||||
|
clearOverLays: clearOverLays,
|
||||||
|
removeOverLay: removeOverLay,
|
||||||
|
setCenter: setCenter,
|
||||||
|
calcCenter: calcCenter,
|
||||||
|
setFitView: setFitView
|
||||||
|
}
|
||||||
118
src/api/system/service/api.ts
Normal file
@ -0,0 +1,118 @@
|
|||||||
|
import request from '@/utils/request';
|
||||||
|
import { AxiosPromise } from 'axios';
|
||||||
|
import { ServiceVO, ServiceForm, ServiceQuery } from '@/api/system/service/types';
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询轨迹服务列表
|
||||||
|
* @param query
|
||||||
|
* @returns {*}
|
||||||
|
*/
|
||||||
|
|
||||||
|
export const listService = (query?: ServiceQuery): AxiosPromise<ServiceVO[]> => {
|
||||||
|
return request({
|
||||||
|
url: '/api/trackService/list',
|
||||||
|
method: 'get',
|
||||||
|
params: query
|
||||||
|
});
|
||||||
|
};
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询轨迹服务详细
|
||||||
|
* @param id
|
||||||
|
*/
|
||||||
|
export const getService = (id: string | number): AxiosPromise<ServiceVO> => {
|
||||||
|
return request({
|
||||||
|
url: '/api/trackService/' + id,
|
||||||
|
method: 'get'
|
||||||
|
});
|
||||||
|
};
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 新增轨迹服务
|
||||||
|
* @param data
|
||||||
|
*/
|
||||||
|
export const addService = (data: ServiceForm) => {
|
||||||
|
return request({
|
||||||
|
url: '/api/trackService/add',
|
||||||
|
method: 'post',
|
||||||
|
data: data
|
||||||
|
});
|
||||||
|
};
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 修改轨迹服务
|
||||||
|
* @param data
|
||||||
|
*/
|
||||||
|
export const updateService = (data: ServiceForm) => {
|
||||||
|
return Promise.reject({code:500,msg:'不允许此操作'});
|
||||||
|
// return request({
|
||||||
|
// url: '/api/trackService/update',
|
||||||
|
// method: 'put',
|
||||||
|
// data: data
|
||||||
|
// });
|
||||||
|
};
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 删除轨迹服务
|
||||||
|
* @param id
|
||||||
|
*/
|
||||||
|
export const delService = (id: string | number | Array<string | number>) => {
|
||||||
|
// return request({
|
||||||
|
// url: '/api/trackService/' + id,
|
||||||
|
// method: 'delete'
|
||||||
|
// });
|
||||||
|
|
||||||
|
return Promise.reject({code:500,msg:'不允许此操作'});
|
||||||
|
};
|
||||||
|
|
||||||
|
|
||||||
|
//获取设备
|
||||||
|
export const getDevice = (data) => {
|
||||||
|
return request({
|
||||||
|
url: '/api/device',
|
||||||
|
method: 'get',
|
||||||
|
params:data
|
||||||
|
});
|
||||||
|
};
|
||||||
|
|
||||||
|
//获取设备
|
||||||
|
export const getDeviceList = (data) => {
|
||||||
|
return request({
|
||||||
|
url: '/api/device/list',
|
||||||
|
method: 'get',
|
||||||
|
params:data
|
||||||
|
});
|
||||||
|
};
|
||||||
|
//保存
|
||||||
|
export const terminalDevice=(data)=>{
|
||||||
|
return request({
|
||||||
|
url: '/api/trackService/terminal',
|
||||||
|
method: 'post',
|
||||||
|
data:data
|
||||||
|
});
|
||||||
|
}
|
||||||
|
//删除
|
||||||
|
export const delTerminalDevice=(id)=>{
|
||||||
|
return request({
|
||||||
|
url: '/api/trackService/delTerminal/'+id,
|
||||||
|
method: 'delete'
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
//获取地图的终端,列表查询
|
||||||
|
export const getMapDevice = (data) => {
|
||||||
|
return request({
|
||||||
|
url: '/api/trackService/listTerminal',
|
||||||
|
method: 'get',
|
||||||
|
params:data
|
||||||
|
});
|
||||||
|
};
|
||||||
|
|
||||||
|
//获取地图的终端,模糊查询
|
||||||
|
export const getMapDeviceByFilter = (data) => {
|
||||||
|
return request({
|
||||||
|
url: '/api/trackService/searchTerminal',
|
||||||
|
method: 'get',
|
||||||
|
params:data
|
||||||
|
});
|
||||||
|
};
|
||||||
56
src/api/system/service/types.ts
Normal file
@ -0,0 +1,56 @@
|
|||||||
|
export interface ServiceVO {
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
id: string | number;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 猎鹰服务ID
|
||||||
|
*/
|
||||||
|
sid: string | number;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 服务名称
|
||||||
|
*/
|
||||||
|
sname: string;
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
export interface ServiceForm extends BaseEntity {
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
id?: string | number;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 猎鹰服务ID
|
||||||
|
*/
|
||||||
|
sid?: string | number;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 服务名称
|
||||||
|
*/
|
||||||
|
sname?: string;
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
export interface ServiceQuery extends PageQuery {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 猎鹰服务ID
|
||||||
|
*/
|
||||||
|
sid?: string | number;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 服务名称
|
||||||
|
*/
|
||||||
|
sname?: string;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 日期范围参数
|
||||||
|
*/
|
||||||
|
params?: any;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
BIN
src/assets/homeIndex/alarmIMG.png
Normal file
|
After Width: | Height: | Size: 21 KiB |
BIN
src/assets/homeIndex/bottom.png
Normal file
|
After Width: | Height: | Size: 384 KiB |
BIN
src/assets/homeIndex/btn.png
Normal file
|
After Width: | Height: | Size: 5.1 KiB |
BIN
src/assets/homeIndex/btn_cur.png
Normal file
|
After Width: | Height: | Size: 6.7 KiB |
BIN
src/assets/homeIndex/card.png
Normal file
|
After Width: | Height: | Size: 21 KiB |
BIN
src/assets/homeIndex/card1.png
Normal file
|
After Width: | Height: | Size: 29 KiB |
BIN
src/assets/homeIndex/card2.png
Normal file
|
After Width: | Height: | Size: 29 KiB |
BIN
src/assets/homeIndex/card3.png
Normal file
|
After Width: | Height: | Size: 33 KiB |
BIN
src/assets/homeIndex/card4.png
Normal file
|
After Width: | Height: | Size: 30 KiB |
BIN
src/assets/homeIndex/card5.png
Normal file
|
After Width: | Height: | Size: 30 KiB |
BIN
src/assets/homeIndex/card6.png
Normal file
|
After Width: | Height: | Size: 30 KiB |
BIN
src/assets/homeIndex/card7.png
Normal file
|
After Width: | Height: | Size: 36 KiB |
BIN
src/assets/homeIndex/deviceIMG.png
Normal file
|
After Width: | Height: | Size: 23 KiB |
BIN
src/assets/homeIndex/left.png
Normal file
|
After Width: | Height: | Size: 332 KiB |
BIN
src/assets/homeIndex/nav.png
Normal file
|
After Width: | Height: | Size: 129 KiB |
BIN
src/assets/homeIndex/right.png
Normal file
|
After Width: | Height: | Size: 333 KiB |
BIN
src/assets/homeIndex/select.png
Normal file
|
After Width: | Height: | Size: 15 KiB |
BIN
src/assets/homeIndex/top.png
Normal file
|
After Width: | Height: | Size: 189 KiB |
4
src/assets/icons/svg/home.svg
Normal file
@ -0,0 +1,4 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<svg id="_图层_1" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 17.99 18">
|
||||||
|
<path id="_矢量_42" d="M17.82,5.81L9.5.08c-.16-.11-.38-.11-.54,0L.2,5.81c-.13.08-.2.21-.2.35v11.41c0,.24.21.43.46.43h5.54c.25,0,.46-.19.46-.43v-2.48c0-1.42,1.17-2.65,2.68-2.69,1.57-.04,2.85,1.13,2.85,2.58v2.59c0,.24.21.43.46.43h5.08c.25,0,.46-.19.46-.43V6.15c0-.14-.06-.26-.18-.35h.01Z"/>
|
||||||
|
</svg>
|
||||||
|
After Width: | Height: | Size: 417 B |
6
src/assets/icons/svg/报警信息1.1.svg
Normal file
@ -0,0 +1,6 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<svg xmlns="http://www.w3.org/2000/svg" version="1.1" viewBox="0 0 16 18">
|
||||||
|
|
||||||
|
<path d="M8.1,3.9c.6,0,1-.5,1-1v-1.9C9.1.5,8.6,0,8.1,0s-1,.4-1,1v1.9c0,.6.4,1,1,1h0ZM3.3,5.7c-.4.4-1,.4-1.4,0l-1.6-1.5c-.4-.4-.4-.9,0-1.3.4-.4,1-.4,1.4,0l1.6,1.5c.4.4.4.9,0,1.3ZM12.6,5.7c.4.4,1,.4,1.4,0l1.6-1.5c.4-.4.4-.9,0-1.3-.4-.4-1-.4-1.4,0l-1.6,1.5c-.4.4-.4.9,0,1.3ZM3,15.4v-5.4c0-2.8,2.3-5.1,5-5.1s5.1,2.3,5.1,5.1v5.4h1.6c.7,0,1.3.6,1.3,1.3s-.6,1.3-1.3,1.3H1.5c-.7,0-1.3-.6-1.3-1.3s.6-1.3,1.3-1.3c0,0,1.6,0,1.6,0ZM10.1,11.3h-1.1c-.1,0-.2,0-.2-.2l.4-2.1c0-.1-.2-.2-.3-.1l-2.9,2.6c0,0,0,.2.1.2h1.2c0,0,.2,0,.2.2l-.4,2.1c0,.1.2.2.3.1l2.9-2.6c.1,0,0-.2-.1-.2Z"/>
|
||||||
|
|
||||||
|
</svg>
|
||||||
|
After Width: | Height: | Size: 699 B |
4
src/assets/icons/svg/控制中心1.1.svg
Normal file
@ -0,0 +1,4 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<svg xmlns="http://www.w3.org/2000/svg" version="1.1" viewBox="0 0 18 16">
|
||||||
|
<path id="_矢量_54" class="cls-1" d="M13.5,12.6v-1.1h2.2v1.1h2.2v2.3h-2.2v1.1h-2.2v-1.1H0v-2.3h13.5ZM7.9,6.9v-1.1h2.2v1.1h7.9v2.3h-7.9v1.1h-2.2v-1.1H0v-2.3s7.9,0,7.9,0ZM2.2,1.1V0h2.2v1.1h13.5v2.3H4.5v1.1h-2.2v-1.1H0V1.1h2.2Z"/>
|
||||||
|
</svg>
|
||||||
|
After Width: | Height: | Size: 356 B |
6
src/assets/icons/svg/数据可视化1.1.svg
Normal file
@ -0,0 +1,6 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<svg xmlns="http://www.w3.org/2000/svg" version="1.1" viewBox="0 0 18 15">
|
||||||
|
|
||||||
|
<path d="M.8,0h16.4s.1,0,.2,0c0,0,.1,0,.1,0,0,0,.1,0,.1,0,0,0,0,0,.1,0,0,0,0,0,.1.1s0,0,0,.1c0,0,0,.1,0,.2,0,0,0,.1,0,.2v10.8c0,0,0,.1,0,.2,0,0,0,.1,0,.2,0,0,0,.1,0,.1,0,0,0,0-.1.1s0,0-.1.1c0,0,0,0-.1,0,0,0-.1,0-.1,0s-.1,0-.2,0H.8c0,0-.1,0-.2,0,0,0-.1,0-.1,0,0,0,0,0-.1,0s0,0-.1-.1c0,0,0,0,0-.1s0,0,0-.1c0,0,0-.1,0-.2C0,11.8,0,11.7,0,11.7V.8S0,.7,0,.7c0,0,0-.1,0-.2s0,0,0-.1c0,0,0,0,0-.1s0,0,.1,0c0,0,0,0,.1,0,0,0,.1,0,.1,0C.7,0,.8,0,.8,0h0ZM2.5,6.7h0s0,0,0,0c0,0,0,0,0,0s0,0,0,0,0,0,0,0,0,0,0,0c0,0,0,0,0,0v2.7s0,0,0,0,0,0,0,0c0,0,0,0,0,0s0,0,0,0c0,0,0,0,0,0s0,0,0,0h1s0,0,0,0c0,0,0,0,0,0,0,0,0,0,0,0s0,0,0,0,0,0,0,0c0,0,0,0,0,0v-2.7s0,0,0,0,0,0,0,0c0,0,0,0,0,0s0,0,0,0c0,0,0,0,0,0s0,0,0,0h-.9ZM6.5,5h0s0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0c0,0,0,0,0,0v4.3s0,0,0,0c0,0,0,0,0,0,0,0,0,0,0,0s0,0,0,0c0,0,0,0,0,0s0,0,0,0h1s0,0,0,0c0,0,0,0,0,0,0,0,0,0,0,0s0,0,0,0,0,0,0,0c0,0,0,0,0,0v-4.3s0,0,0,0c0,0,0,0,0,0,0,0,0,0,0,0s0,0,0,0c0,0,0,0,0,0s0,0,0,0c0,0-.9,0-.9,0ZM10.6,2.5h0s0,0,0,0c0,0,0,0,0,0,0,0,0,0,0,0s0,0,0,0,0,0,0,0c0,0,0,0,0,0v6.8s0,0,0,0,0,0,0,0c0,0,0,0,0,0s0,0,0,0c0,0,0,0,0,0,0,0,0,0,0,0h1s0,0,0,0c0,0,0,0,0,0s0,0,0,0,0,0,0,0,0,0,0,0c0,0,0,0,0,0V2.8s0,0,0,0,0,0,0,0c0,0,0,0,0,0s0,0,0,0c0,0,0,0,0,0s0,0,0,0h0s-.8,0-.8,0ZM14.7,5.8h0s0,0,0,0c0,0,0,0,0,0,0,0,0,0,0,0s0,0,0,0c0,0,0,0,0,0,0,0,0,0,0,0v3.5s0,0,0,0,0,0,0,0c0,0,0,0,0,0s0,0,0,0c0,0,0,0,0,0,0,0,0,0,0,0h1s0,0,0,0c0,0,0,0,0,0s0,0,0,0,0,0,0,0,0,0,0,0c0,0,0,0,0,0v-3.5s0,0,0,0c0,0,0,0,0,0,0,0,0,0,0,0s0,0,0,0c0,0,0,0,0,0s0,0,0,0h0s-.8,0-.8,0ZM6.6,14.2v-.5s0,0,0,0c0,0,0,0,0,0,0,0,0,0,0,0s0,0,0,0c0,0,0,0,0,0s0,0,0,0h4.3s0,0,0,0c0,0,0,0,0,0s0,0,0,0,0,0,0,0,0,0,0,0c0,0,0,0,0,0v.5h3.8s0,0,0,0c0,0,0,0,0,0s0,0,0,0,0,0,0,0,0,0,0,0c0,0,0,0,0,0v.2s0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0c0,0,0,0,0,0,0,0,0,0,0,0H2.8s0,0,0,0c0,0,0,0,0,0s0,0,0,0,0,0,0,0c0,0,0,0,0,0,0,0,0,0,0,0v-.2s0,0,0,0,0,0,0,0c0,0,0,0,0,0s0,0,0,0c0,0,0,0,0,0s0,0,0,0h3.8Z"/>
|
||||||
|
|
||||||
|
</svg>
|
||||||
|
After Width: | Height: | Size: 2.0 KiB |
7
src/assets/icons/svg/日志报表1.1.svg
Normal file
@ -0,0 +1,7 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<svg xmlns="http://www.w3.org/2000/svg" version="1.1" viewBox="0 0 16 18">
|
||||||
|
|
||||||
|
<path d="M5.8,2.4h4.4c.4,0,.7-.3.7-.7V.7c0-.4-.3-.7-.7-.7h-4.4c-.4,0-.7.3-.7.7v1.1c0,.4.3.7.7.7Z"/>
|
||||||
|
<path d="M13.8,1.3h-2.3v.7c0,.5-.4.8-.9.8h-5.2c-.5,0-.9-.4-.9-.8v-.7h-2.3C1,1.3,0,2.2,0,3.4v12.5c0,1.1,1,2.1,2.2,2.1h11.5c1.2,0,2.2-.9,2.2-2.1V3.4c0-1.2-1-2.1-2.2-2.1ZM13.2,13.4H3.3c-.3,0-.6-.2-.6-.5s.2-.5.6-.5h9.9c.3,0,.6.2.6.5s-.3.5-.6.5h0ZM13.2,10H3.3c-.3,0-.6-.2-.6-.5s.2-.5.6-.5h9.9c.3,0,.6.2.6.5s-.3.5-.6.5h0ZM13.2,6.5H3.3c-.3,0-.6-.2-.6-.5s.2-.5.6-.5h9.9c.3,0,.6.2.6.5s-.3.5-.6.5h0Z"/>
|
||||||
|
|
||||||
|
</svg>
|
||||||
|
After Width: | Height: | Size: 633 B |
6
src/assets/icons/svg/用户管理1.1.svg
Normal file
@ -0,0 +1,6 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<svg xmlns="http://www.w3.org/2000/svg" version="1.1" viewBox="0 0 18 18">
|
||||||
|
|
||||||
|
<path d="M16.9,12.8c-.1-.4-.3-.8-.5-1.2l.6-1-.5-.6-1,.6c-.3-.2-.7-.4-1.1-.4l-.3-1.2h-.8l-.3,1.2c-.4,0-.7.2-1.1.4l-1-.6-.5.6.6,1c-.2.4-.4.8-.5,1.2l-1.1.3v.8l1,.3c0,.5.2,1,.5,1.4l-.5.9.5.5.8-.5c.4.3.9.6,1.4.7l.2.9h.8l.2-.9c.3,0,.5-.1.8-.2s.5-.2.7-.4l.8.5.5-.5-.5-.9c.3-.4.4-.9.5-1.4l1-.3v-.8l-1.1-.3s0,0,0,0ZM13.7,15.6h-.2c0,0-.1,0-.2,0,0,0-.1,0-.2,0s-.1,0-.2,0c0,0-.1,0-.2,0,0,0-.1,0-.2-.1s-.1,0-.1-.1c0,0,0,0-.1-.1,0,0,0,0-.1-.1s0-.1-.1-.1c0,0,0-.1,0-.2,0,0,0-.1,0-.2s0-.1,0-.2,0-.1,0-.2c0,0,0-.1,0-.2v-.4c0,0,0-.1,0-.2,0,0,0-.1,0-.2,0,0,0-.1,0-.2s0-.1,0-.2c0,0,0-.1,0-.2s0-.1.1-.1c0,0,0-.1.1-.1,0,0,0,0,.1-.1s.1,0,.1-.1c0,0,.1,0,.2-.1s.1,0,.2,0c0,0,.1,0,.2,0,0,0,.1,0,.2,0,0,0,.1,0,.2,0h.4c0,0,.1,0,.2,0,0,0,.1,0,.2,0s.1,0,.2,0c0,0,.1,0,.2,0,0,0,.1,0,.2.1s.1,0,.1.1c0,0,0,0,.1.1,0,0,0,0,.1.1s0,.1.1.1c0,0,0,.1,0,.2,0,0,0,.1,0,.2s0,.1,0,.2,0,.1,0,.2c0,0,0,.1,0,.2v.4c0,0,0,.1,0,.2,0,0,0,.1,0,.2,0,0,0,.1,0,.2s0,.1,0,.2c0,0,0,.1,0,.2s0,.1-.1.1c0,0,0,.1-.1.1,0,0,0,0-.1.1s-.1,0-.1.1c0,0-.1,0-.2.1,0,0-.1,0-.2,0,0,0-.1,0-.2,0,0,0-.1,0-.2,0,0,0-.1,0-.2,0,0,0-.2,0-.2,0ZM10.4,9.6c-.6-.5-1.3-.8-2-1,1.4-.7,2.5-2.3,2.5-4S8.9,0,6.5,0,2.2,2,2.2,4.5s1,3.3,2.4,4C1.9,9.4,0,11.9,0,14.8,0,14.8,3.3,15.8,6.6,15.8s1.7,0,2.5-.2c-.1-.3-.2-.7-.3-1,0-.4-.1-.7-.1-1.1,0-1.6.7-3,1.7-3.9h0Z"/>
|
||||||
|
|
||||||
|
</svg>
|
||||||
|
After Width: | Height: | Size: 1.4 KiB |
8
src/assets/icons/svg/租户管理1.1.svg
Normal file
@ -0,0 +1,8 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<svg xmlns="http://www.w3.org/2000/svg" version="1.1" viewBox="0 0 18 18">
|
||||||
|
|
||||||
|
<path d="M7.4,12.7c.3-2,1.8-3.2,2.4-3.7h0c0,0,.2,0,.3-.2,1.9-.7,3.2-2.3,3.2-4.3,0-2.5-2.3-4.6-5.1-4.6S3.1,2.1,3.1,4.6s1.4,3.6,3.3,4.3c-.9.2-1.8.6-2.5,1C.6,11.7,0,14.2,0,17.7s.3.3.6.3h9.9l-.9-.4c-.9-.4-2.7-2.3-2.3-4.9h0Z"/>
|
||||||
|
<path d="M13.2,11.6l-1.7,1.4v2.4h.7v-1.2h2v1.2h.7v-2.4l-1.7-1.4h0ZM14.9,11.9h-.3l.3.3v-.3Z"/>
|
||||||
|
<path d="M13.2,9.1c-2.7,0-4.8,2-4.8,4.4s2.2,4.4,4.8,4.4,4.8-2,4.8-4.4-2.1-4.4-4.8-4.4ZM15.9,13.6c0,0-.1,0-.3,0s-.1,0-.2,0v2c0,.2-.2.4-.5.4h-1.6v-1.2h-.6v1.2h-1.6c-.3,0-.5-.2-.5-.4v-2s0,0-.2,0-.2,0-.3,0,0-.2,0-.2,0-.2,0-.2l2.4-2c.3-.2.6-.2.9,0l.4.4c0,0,.2-.2.3-.2h.9c.2,0,.3.2.3.3v.8c0,.1,0,.2-.1.2l.5.5c0,0,0,.1,0,.2,0,0,0,.1,0,.2h0Z"/>
|
||||||
|
|
||||||
|
</svg>
|
||||||
|
After Width: | Height: | Size: 804 B |
6
src/assets/icons/svg/维修记录1.1.svg
Normal file
@ -0,0 +1,6 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<svg xmlns="http://www.w3.org/2000/svg" version="1.1" viewBox="0 0 18 18">
|
||||||
|
|
||||||
|
<path d="M17.2,2.8s0,0,0,0c-.1-.1-.3-.1-.4,0l-3.2,3.2c-.4.4-1,.4-1.4,0h-.1c-.4-.5-.4-1.1,0-1.5l3.2-3.2s0,0,0,0c0-.1,0-.3-.1-.4-2.2-1.3-5.1-1-7,.9-1.4,1.4-1.9,3.2-1.6,5,0,.3,0,.7-.3,1L0,13.9c0,0,0,.2,0,.2l3.8,3.8c0,0,.2,0,.2,0l6.2-6.2c.2-.2.6-.3,1-.3,1.8.3,3.7-.2,5-1.6,1.9-1.9,2.2-4.8.9-7h0Z"/>
|
||||||
|
|
||||||
|
</svg>
|
||||||
|
After Width: | Height: | Size: 428 B |
4
src/assets/icons/svg/联调中心1.1.svg
Normal file
@ -0,0 +1,4 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<svg xmlns="http://www.w3.org/2000/svg" version="1.1" viewBox="0 0 18 18">
|
||||||
|
<path id="_联调中心图标" class="cls-1" d="M9.8,12.3c-1.1,0-2.1-.4-2.9-1.2-.2-.2-.3-.5-.3-.8s.1-.6.3-.8c.4-.4,1.2-.4,1.6,0,.8.8,2.1.7,3-.2l3.5-3.5c.5-.5.7-1.1.7-1.7s0-.9-.6-1.3c-.5-.5-1-.6-1.4-.5-.6,0-1.1.3-1.6.7l-2,2c-.5-.5-2.4-.8-2.9-.3l3.3-3.3c.9-.9,2-1.4,3.1-1.4,1.2,0,2.3.4,3.1,1.2.8.8,1.2,1.8,1.2,2.9s-.5,2.4-1.4,3.3l-3.5,3.5c-.9.9-2.1,1.4-3.3,1.4M4.9,7.1l-3.5,3.5C.5,11.5,0,12.7,0,13.9s.4,2.1,1.2,2.9c.8.8,1.9,1.3,3.1,1.2,1.1,0,2.2-.5,3.1-1.4l3.3-3.3c-.5.5-2.5.2-2.9-.3l-2,2c-.4.4-1,.7-1.6.7-.4,0-.9,0-1.4-.6-.5-.4-.5-1-.5-1.3,0-.6.3-1.2.7-1.7l3.5-3.5c.9-.9,2.2-1,3-.2s.5.3.8.3.6-.1.8-.3.3-.5.3-.8-.1-.6-.3-.8c-.8-.8-1.9-1.2-2.9-1.2s-2.4.5-3.3,1.4h0Z"/>
|
||||||
|
</svg>
|
||||||
|
After Width: | Height: | Size: 793 B |
6
src/assets/icons/svg/设备管理1.1.svg
Normal file
@ -0,0 +1,6 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<svg xmlns="http://www.w3.org/2000/svg" version="1.1" viewBox="0 0 18 18">
|
||||||
|
|
||||||
|
<path d="M17.6,14.4l-6.4,3.5s-.1,0-.1,0c0,0-.1,0-.2,0h-.2c0,0-.1,0-.2,0,0,0-.1,0-.2,0,0,0-.1,0-.1,0s0,0-.1-.1,0,0-.1-.1c0-.1-.1-.3-.1-.4v-5.9c0,0,0-.1,0-.2,0,0,0-.1,0-.2,0,0,0-.1.1-.2,0,0,.1,0,.2-.1l6.4-3.5s.1,0,.1,0,.1,0,.2,0h.2c0,0,.1,0,.2,0,0,0,.1,0,.2,0,0,0,.1,0,.1,0,0,0,0,0,.1.1s0,0,.1.1c0,.1.1.3.1.4v5.9c0,0,0,.1,0,.2,0,0,0,.1,0,.2,0,0,0,.1-.1.2,0,0-.1,0-.2.1h0ZM.4,14.4c0,0-.1,0-.2-.1,0,0,0-.1-.1-.2,0,0,0-.1,0-.2C0,13.8,0,13.7,0,13.6v-5.9C0,7.3.4,7,.9,7s.3,0,.4.1l6.4,3.5c0,0,.1,0,.2.1,0,0,0,.1.1.2s0,.1,0,.2,0,.1,0,.2v5.9c0,.5-.4.8-.9.8s-.3,0-.4-.1L.4,14.4H.4ZM8.6.1c.3-.1.6-.1.9,0l7.3,3.9s0,0,0,0,0,0,0,0c0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0v.2s0,0,0,0c0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0l-7.3,3.9c0,0-.1,0-.2,0,0,0-.1,0-.2,0s-.1,0-.2,0-.1,0-.2,0L1.3,5.5s0,0,0,0c0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0v-.2s0,0,0,0c0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0s0,0,0,0c0,0,0,0,0,0,0,0,0,0,0,0L8.6.1h0Z"/>
|
||||||
|
|
||||||
|
</svg>
|
||||||
|
After Width: | Height: | Size: 1.1 KiB |
6
src/assets/icons/svg/首页1.1.svg
Normal file
@ -0,0 +1,6 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<svg xmlns="http://www.w3.org/2000/svg" version="1.1" viewBox="0 0 18 18">
|
||||||
|
|
||||||
|
<path d="M17.8,5.8L9.5,0c-.2-.1-.4-.1-.5,0L.2,5.8c-.1,0-.2.2-.2.3v11.4c0,.2.2.4.5.4h5.5c.2,0,.5-.2.5-.4v-2.5c0-1.4,1.2-2.6,2.7-2.7,1.6,0,2.8,1.1,2.8,2.6v2.6c0,.2.2.4.5.4h5.1c.2,0,.5-.2.5-.4V6.2c0-.1,0-.3-.2-.3h0Z"/>
|
||||||
|
|
||||||
|
</svg>
|
||||||
|
After Width: | Height: | Size: 345 B |
BIN
src/assets/images/di.png
Normal file
|
After Width: | Height: | Size: 2.4 KiB |
BIN
src/assets/images/diAc.png
Normal file
|
After Width: | Height: | Size: 2.5 KiB |
BIN
src/assets/images/high.png
Normal file
|
After Width: | Height: | Size: 2.4 KiB |
BIN
src/assets/images/highAc.png
Normal file
|
After Width: | Height: | Size: 2.5 KiB |
BIN
src/assets/images/mapLocation.png
Normal file
|
After Width: | Height: | Size: 2.7 KiB |
BIN
src/assets/images/mapPoint.png
Normal file
|
After Width: | Height: | Size: 5.5 KiB |
BIN
src/assets/images/mapWarn.png
Normal file
|
After Width: | Height: | Size: 7.6 KiB |
BIN
src/assets/images/path.png
Normal file
|
After Width: | Height: | Size: 408 B |
BIN
src/assets/images/position_ico.png
Normal file
|
After Width: | Height: | Size: 2.7 KiB |
BIN
src/assets/images/rb.png
Normal file
|
After Width: | Height: | Size: 3.1 KiB |
BIN
src/assets/images/rbAc.png
Normal file
|
After Width: | Height: | Size: 3.0 KiB |
BIN
src/assets/images/sg.png
Normal file
|
After Width: | Height: | Size: 3.2 KiB |
BIN
src/assets/images/sgAc.png
Normal file
|
After Width: | Height: | Size: 3.1 KiB |
BIN
src/assets/images/zhong.png
Normal file
|
After Width: | Height: | Size: 2.5 KiB |
BIN
src/assets/images/zhongAc.png
Normal file
|
After Width: | Height: | Size: 2.6 KiB |
BIN
src/assets/index/IMG.png
Normal file
|
After Width: | Height: | Size: 1.2 KiB |
BIN
src/assets/index/add.png
Normal file
|
After Width: | Height: | Size: 35 KiB |
BIN
src/assets/index/conton.png
Normal file
|
After Width: | Height: | Size: 7.5 KiB |
BIN
src/assets/index/device_add.png
Normal file
|
After Width: | Height: | Size: 6.1 KiB |
BIN
src/assets/index/device_group.png
Normal file
|
After Width: | Height: | Size: 7.1 KiB |
BIN
src/assets/index/device_type.png
Normal file
|
After Width: | Height: | Size: 6.6 KiB |
BIN
src/assets/index/device_yc.png
Normal file
|
After Width: | Height: | Size: 36 KiB |
BIN
src/assets/index/devices_online.png
Normal file
|
After Width: | Height: | Size: 36 KiB |
BIN
src/assets/index/online.png
Normal file
|
After Width: | Height: | Size: 29 KiB |
@ -88,12 +88,7 @@ div:focus {
|
|||||||
.pl-5 {
|
.pl-5 {
|
||||||
padding-left: 5px;
|
padding-left: 5px;
|
||||||
}
|
}
|
||||||
.p-2{
|
|
||||||
background: rgba(247, 248, 252, 1);
|
|
||||||
min-height: 100vh;
|
|
||||||
box-sizing: border-box;
|
|
||||||
padding: 15px;
|
|
||||||
}
|
|
||||||
|
|
||||||
.block {
|
.block {
|
||||||
display: block;
|
display: block;
|
||||||
@ -163,6 +158,7 @@ aside {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
.components-container {
|
.components-container {
|
||||||
margin: 30px 50px;
|
margin: 30px 50px;
|
||||||
position: relative;
|
position: relative;
|
||||||
@ -214,4 +210,4 @@ aside {
|
|||||||
vertical-align: middle;
|
vertical-align: middle;
|
||||||
margin-bottom: 10px;
|
margin-bottom: 10px;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -28,7 +28,7 @@
|
|||||||
// 使用CSS变量定义边框样式,支持动态修改
|
// 使用CSS变量定义边框样式,支持动态修改
|
||||||
border-right: var(--sidebarBorderWidth) var(--sidebarBorderStyle) var(--sidebarBorderColor);
|
border-right: var(--sidebarBorderWidth) var(--sidebarBorderStyle) var(--sidebarBorderColor);
|
||||||
box-shadow: var(--sidebarBoxShadow);
|
box-shadow: var(--sidebarBoxShadow);
|
||||||
|
|
||||||
// 备用方案:如果CSS变量不支持,使用默认样式
|
// 备用方案:如果CSS变量不支持,使用默认样式
|
||||||
@supports not (border-right: var(--sidebarBorderWidth) var(--sidebarBorderStyle) var(--sidebarBorderColor)) {
|
@supports not (border-right: var(--sidebarBorderWidth) var(--sidebarBorderStyle) var(--sidebarBorderColor)) {
|
||||||
border-right: none;
|
border-right: none;
|
||||||
@ -81,11 +81,14 @@
|
|||||||
width: 100% !important;
|
width: 100% !important;
|
||||||
}
|
}
|
||||||
|
|
||||||
.el-menu-item,
|
.el-sub-menu,
|
||||||
.menu-title {
|
.menu-title {
|
||||||
overflow: hidden !important;
|
overflow: hidden !important;
|
||||||
text-overflow: ellipsis !important;
|
text-overflow: ellipsis !important;
|
||||||
white-space: nowrap !important;
|
white-space: nowrap !important;
|
||||||
|
font-family: Microsoft YaHei;
|
||||||
|
font-size: 13px;
|
||||||
|
font-weight: 600;
|
||||||
}
|
}
|
||||||
|
|
||||||
.el-menu-item .el-menu-tooltip__trigger {
|
.el-menu-item .el-menu-tooltip__trigger {
|
||||||
@ -100,6 +103,7 @@
|
|||||||
transition: all 0.3s ease;
|
transition: all 0.3s ease;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
.sub-menu-title-noDropdown,
|
.sub-menu-title-noDropdown,
|
||||||
.el-sub-menu__title {
|
.el-sub-menu__title {
|
||||||
&:hover {
|
&:hover {
|
||||||
@ -108,7 +112,7 @@
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
& .theme-dark .is-active > .el-sub-menu__title {
|
& .theme-dark .is-active>.el-sub-menu__title {
|
||||||
color: #ffffff !important;
|
color: #ffffff !important;
|
||||||
background: var(--menuActiveGradient) !important; // 使用正确的渐变颜色
|
background: var(--menuActiveGradient) !important; // 使用正确的渐变颜色
|
||||||
border-radius: 4px;
|
border-radius: 4px;
|
||||||
@ -116,16 +120,17 @@
|
|||||||
box-shadow: 0 2px 4px rgba(64, 158, 255, 0.3);
|
box-shadow: 0 2px 4px rgba(64, 158, 255, 0.3);
|
||||||
}
|
}
|
||||||
|
|
||||||
& .nest-menu .el-sub-menu > .el-sub-menu__title,
|
& .nest-menu .el-sub-menu>.el-sub-menu__title,
|
||||||
& .el-sub-menu .el-menu-item {
|
& .el-sub-menu .el-menu-item {
|
||||||
min-width: $base-sidebar-width !important;
|
min-width: $base-sidebar-width !important;
|
||||||
|
|
||||||
&:hover {
|
&:hover {
|
||||||
background-color: rgba(0, 0, 0, 0.1) !important;
|
background-color: rgba(0, 0, 0, 0.1) !important;
|
||||||
transition: all 0.3s ease;
|
transition: all 0.3s ease;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
& .theme-dark .nest-menu .el-sub-menu > .el-sub-menu__title,
|
& .theme-dark .nest-menu .el-sub-menu>.el-sub-menu__title,
|
||||||
& .theme-dark .el-sub-menu .el-menu-item {
|
& .theme-dark .el-sub-menu .el-menu-item {
|
||||||
background-color: $base-sub-menu-background !important;
|
background-color: $base-sub-menu-background !important;
|
||||||
|
|
||||||
@ -135,7 +140,7 @@
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
& .theme-dark .nest-menu .el-sub-menu > .el-sub-menu__title,
|
& .theme-dark .nest-menu .el-sub-menu>.el-sub-menu__title,
|
||||||
& .theme-dark .el-menu-item {
|
& .theme-dark .el-menu-item {
|
||||||
&:hover {
|
&:hover {
|
||||||
// you can use $sub-menuHover
|
// you can use $sub-menuHover
|
||||||
@ -143,7 +148,8 @@
|
|||||||
transition: all 0.3s ease;
|
transition: all 0.3s ease;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
& .nest-menu .el-sub-menu > .el-sub-menu__title,
|
|
||||||
|
& .nest-menu .el-sub-menu>.el-sub-menu__title,
|
||||||
& .el-menu-item {
|
& .el-menu-item {
|
||||||
&:hover {
|
&:hover {
|
||||||
// you can use $sub-menuHover
|
// you can use $sub-menuHover
|
||||||
@ -178,7 +184,7 @@
|
|||||||
.el-sub-menu {
|
.el-sub-menu {
|
||||||
overflow: hidden;
|
overflow: hidden;
|
||||||
|
|
||||||
& > .el-sub-menu__title {
|
&>.el-sub-menu__title {
|
||||||
padding: 0 !important;
|
padding: 0 !important;
|
||||||
|
|
||||||
.svg-icon {
|
.svg-icon {
|
||||||
@ -189,15 +195,16 @@
|
|||||||
|
|
||||||
.el-menu--collapse {
|
.el-menu--collapse {
|
||||||
.el-sub-menu {
|
.el-sub-menu {
|
||||||
& > .el-sub-menu__title {
|
&>.el-sub-menu__title {
|
||||||
& > span {
|
&>span {
|
||||||
height: 0;
|
height: 0;
|
||||||
width: 0;
|
width: 0;
|
||||||
overflow: hidden;
|
overflow: hidden;
|
||||||
visibility: hidden;
|
visibility: hidden;
|
||||||
display: inline-block;
|
display: inline-block;
|
||||||
}
|
}
|
||||||
& > i {
|
|
||||||
|
&>i {
|
||||||
height: 0;
|
height: 0;
|
||||||
width: 0;
|
width: 0;
|
||||||
overflow: hidden;
|
overflow: hidden;
|
||||||
@ -234,6 +241,7 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
.withoutAnimation {
|
.withoutAnimation {
|
||||||
|
|
||||||
.main-container,
|
.main-container,
|
||||||
.sidebar-container {
|
.sidebar-container {
|
||||||
transition: none;
|
transition: none;
|
||||||
@ -243,7 +251,7 @@
|
|||||||
|
|
||||||
// when menu collapsed
|
// when menu collapsed
|
||||||
.el-menu--vertical {
|
.el-menu--vertical {
|
||||||
& > .el-menu {
|
&>.el-menu {
|
||||||
.svg-icon {
|
.svg-icon {
|
||||||
margin-right: 16px;
|
margin-right: 16px;
|
||||||
}
|
}
|
||||||
@ -286,7 +294,7 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
// 子菜单激活状态
|
// 子菜单激活状态
|
||||||
.el-sub-menu.is-active > .el-sub-menu__title {
|
.el-sub-menu.is-active>.el-sub-menu__title {
|
||||||
background: var(--menuActiveGradient) !important; // 使用正确的渐变颜色
|
background: var(--menuActiveGradient) !important; // 使用正确的渐变颜色
|
||||||
color: #ffffff !important;
|
color: #ffffff !important;
|
||||||
border-radius: 4px;
|
border-radius: 4px;
|
||||||
@ -299,7 +307,7 @@
|
|||||||
.sidebar-container {
|
.sidebar-container {
|
||||||
// 确保背景色与图片一致
|
// 确保背景色与图片一致
|
||||||
background: #2c3e50 !important;
|
background: #2c3e50 !important;
|
||||||
|
|
||||||
.el-menu-item {
|
.el-menu-item {
|
||||||
&.is-active {
|
&.is-active {
|
||||||
background: var(--menuActiveGradient) !important; // 使用正确的渐变颜色
|
background: var(--menuActiveGradient) !important; // 使用正确的渐变颜色
|
||||||
@ -310,9 +318,9 @@
|
|||||||
transition: all 0.3s ease;
|
transition: all 0.3s ease;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
.el-sub-menu {
|
.el-sub-menu {
|
||||||
&.is-active > .el-sub-menu__title {
|
&.is-active>.el-sub-menu__title {
|
||||||
background: var(--menuActiveGradient) !important; // 使用正确的渐变颜色
|
background: var(--menuActiveGradient) !important; // 使用正确的渐变颜色
|
||||||
color: #ffffff !important;
|
color: #ffffff !important;
|
||||||
border-radius: 4px;
|
border-radius: 4px;
|
||||||
@ -321,12 +329,12 @@
|
|||||||
transition: all 0.3s ease;
|
transition: all 0.3s ease;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// 子菜单项激活状态(只有文字颜色变化,无背景)
|
// 子菜单项激活状态(只有文字颜色变化,无背景)
|
||||||
.el-sub-menu .el-menu-item {
|
.el-sub-menu .el-menu-item {
|
||||||
&.is-active {
|
&.is-active {
|
||||||
background: transparent !important;
|
background: transparent !important;
|
||||||
color: #409eff !important;
|
color: rgba(1, 159, 228, 1) !important;
|
||||||
border-radius: 0;
|
border-radius: 0;
|
||||||
margin: 0;
|
margin: 0;
|
||||||
box-shadow: none;
|
box-shadow: none;
|
||||||
@ -341,35 +349,35 @@
|
|||||||
box-shadow: 1px 0 4px rgba(0, 0, 0, 0.1) !important;
|
box-shadow: 1px 0 4px rgba(0, 0, 0, 0.1) !important;
|
||||||
border-right: none !important;
|
border-right: none !important;
|
||||||
}
|
}
|
||||||
|
|
||||||
.sidebar-logo-container {
|
.sidebar-logo-container {
|
||||||
background: #2c3e50 !important;
|
background: #2c3e50 !important;
|
||||||
}
|
}
|
||||||
|
|
||||||
.el-menu {
|
.el-menu {
|
||||||
background: #2c3e50 !important;
|
background: #2c3e50 !important;
|
||||||
}
|
}
|
||||||
|
|
||||||
// 非激活菜单项样式
|
// 非激活菜单项样式
|
||||||
.el-menu-item,
|
.el-menu-item,
|
||||||
.el-sub-menu__title {
|
.el-sub-menu__title {
|
||||||
color: #bfcbd9 !important;
|
color: #bfcbd9 !important;
|
||||||
|
|
||||||
&:hover {
|
&:hover {
|
||||||
background-color: rgba(0, 0, 0, 0.1) !important;
|
background-color: rgba(0, 0, 0, 0.1) !important;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// 激活的主菜单项(正确的渐变背景)
|
// 激活的主菜单项(正确的渐变背景)
|
||||||
.el-menu-item.is-active,
|
.el-menu-item.is-active,
|
||||||
.el-sub-menu.is-active > .el-sub-menu__title {
|
.el-sub-menu.is-active>.el-sub-menu__title {
|
||||||
background: var(--menuActiveGradient) !important; // 使用正确的渐变颜色
|
background: var(--menuActiveGradient) !important; // 使用正确的渐变颜色
|
||||||
color: #ffffff !important;
|
color: #ffffff !important;
|
||||||
border-radius: 4px;
|
border-radius: 4px;
|
||||||
margin: 2px 8px;
|
margin: 2px 8px;
|
||||||
box-shadow: 0 2px 4px rgba(64, 158, 255, 0.3);
|
box-shadow: 0 2px 4px rgba(64, 158, 255, 0.3);
|
||||||
}
|
}
|
||||||
|
|
||||||
// 激活的子菜单项(只有蓝色文字,无背景)
|
// 激活的子菜单项(只有蓝色文字,无背景)
|
||||||
.el-sub-menu .el-menu-item.is-active {
|
.el-sub-menu .el-menu-item.is-active {
|
||||||
background: transparent !important;
|
background: transparent !important;
|
||||||
@ -378,17 +386,17 @@
|
|||||||
margin: 0;
|
margin: 0;
|
||||||
box-shadow: none;
|
box-shadow: none;
|
||||||
}
|
}
|
||||||
|
|
||||||
// 子菜单背景色
|
// 子菜单背景色
|
||||||
.el-sub-menu .el-menu {
|
.el-sub-menu .el-menu {
|
||||||
background: #1f2d3d !important;
|
background: linear-gradient(0.00deg, rgba(0, 87, 159, 0.15), rgba(0, 87, 159, 0) 100%) !important;
|
||||||
}
|
}
|
||||||
|
|
||||||
// 子菜单项悬停效果
|
// 子菜单项悬停效果
|
||||||
.el-sub-menu .el-menu-item:hover {
|
.el-sub-menu .el-menu-item:hover {
|
||||||
background-color: rgba(0, 0, 0, 0.1) !important;
|
background-color: rgba(0, 0, 0, 0.1) !important;
|
||||||
}
|
}
|
||||||
|
|
||||||
// 主菜单项悬停效果
|
// 主菜单项悬停效果
|
||||||
.el-menu-item:hover,
|
.el-menu-item:hover,
|
||||||
.el-sub-menu__title:hover {
|
.el-sub-menu__title:hover {
|
||||||
@ -399,28 +407,29 @@
|
|||||||
// 全局菜单样式匹配设计UI
|
// 全局菜单样式匹配设计UI
|
||||||
#app .sidebar-container {
|
#app .sidebar-container {
|
||||||
// 确保背景色一致
|
// 确保背景色一致
|
||||||
background: #2c3e50 !important;
|
background: rgba(11, 24, 40, 1) !important;
|
||||||
|
//background: #2c3e50 !important;
|
||||||
|
|
||||||
// 菜单项基础样式
|
// 菜单项基础样式
|
||||||
.el-menu-item,
|
.el-menu-item,
|
||||||
.el-sub-menu__title {
|
.el-sub-menu__title {
|
||||||
color: #bfcbd9 !important;
|
color: #bfcbd9 !important;
|
||||||
|
|
||||||
&:hover {
|
&:hover {
|
||||||
background-color: rgba(0, 0, 0, 0.1) !important;
|
background-color: rgba(0, 0, 0, 0.1) !important;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// 激活的主菜单项
|
// 激活的主菜单项
|
||||||
.el-menu-item.is-active,
|
.el-menu-item.is-active,
|
||||||
.el-sub-menu.is-active > .el-sub-menu__title {
|
.el-sub-menu.is-active>.el-sub-menu__title {
|
||||||
background: var(--menuActiveGradient) !important; // 使用正确的渐变颜色
|
background: var(--menuActiveGradient) !important; // 使用正确的渐变颜色
|
||||||
color: #ffffff !important;
|
color: #ffffff !important;
|
||||||
border-radius: 4px;
|
border-radius: 4px;
|
||||||
margin: 2px 8px;
|
margin: 2px 8px;
|
||||||
box-shadow: 0 2px 4px rgba(64, 158, 255, 0.3);
|
box-shadow: 0 2px 4px rgba(64, 158, 255, 0.3);
|
||||||
}
|
}
|
||||||
|
|
||||||
// 激活的子菜单项
|
// 激活的子菜单项
|
||||||
.el-sub-menu .el-menu-item.is-active {
|
.el-sub-menu .el-menu-item.is-active {
|
||||||
background: transparent !important;
|
background: transparent !important;
|
||||||
@ -429,19 +438,19 @@
|
|||||||
margin: 0;
|
margin: 0;
|
||||||
box-shadow: none;
|
box-shadow: none;
|
||||||
}
|
}
|
||||||
|
|
||||||
// 子菜单背景
|
// 子菜单背景
|
||||||
.el-sub-menu .el-menu {
|
.el-sub-menu .el-menu {
|
||||||
background: #1f2d3d !important;
|
background: #1f2d3d !important;
|
||||||
}
|
}
|
||||||
|
|
||||||
// 图标颜色
|
// 图标颜色
|
||||||
.svg-icon {
|
.svg-icon {
|
||||||
color: inherit !important;
|
color: inherit !important;
|
||||||
}
|
}
|
||||||
|
|
||||||
// 箭头图标颜色
|
// 箭头图标颜色
|
||||||
.el-sub-menu__icon-arrow {
|
.el-sub-menu__icon-arrow {
|
||||||
color: inherit !important;
|
color: inherit !important;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -1,6 +1,6 @@
|
|||||||
// 全局SCSS变量
|
// 全局SCSS变量
|
||||||
:root {
|
:root {
|
||||||
--menuBg: #2c3e50; // 精确匹配图片中的深色背景
|
--menuBg: linear-gradient(0.00deg, rgba(0, 87, 159, 0.15),rgba(0, 87, 159, 0) 100%);; // 精确匹配图片中的深色背景
|
||||||
--menuColor: #bfcbd9; // 非激活菜单项的文字颜色
|
--menuColor: #bfcbd9; // 非激活菜单项的文字颜色
|
||||||
--menuActiveText: #ffffff; // 激活菜单项的文字颜色
|
--menuActiveText: #ffffff; // 激活菜单项的文字颜色
|
||||||
--menuHover: #34495e; // 悬停时的背景色
|
--menuHover: #34495e; // 悬停时的背景色
|
||||||
@ -11,7 +11,7 @@
|
|||||||
--subMenuTitleHover: #293444; // 子菜单标题悬停背景色
|
--subMenuTitleHover: #293444; // 子菜单标题悬停背景色
|
||||||
|
|
||||||
// 激活菜单项的渐变颜色 - 根据设计UI调整
|
// 激活菜单项的渐变颜色 - 根据设计UI调整
|
||||||
--menuActiveGradient: linear-gradient(90deg, #0080EA 0%, #000F27 100%);
|
--menuActiveGradient:linear-gradient(90.00deg, rgba(0, 128, 234, 1),rgba(0, 15, 39, 0) 100%);
|
||||||
|
|
||||||
--fixedHeaderBg: #ffffff;
|
--fixedHeaderBg: #ffffff;
|
||||||
--tableHeaderBg: #f8f8f9;
|
--tableHeaderBg: #f8f8f9;
|
||||||
@ -130,7 +130,7 @@ $--color-warning: #e6a23c;
|
|||||||
$--color-danger: #f56c6c;
|
$--color-danger: #f56c6c;
|
||||||
$--color-info: #909399;
|
$--color-info: #909399;
|
||||||
|
|
||||||
$base-sidebar-width: 280px;
|
$base-sidebar-width: 250px;
|
||||||
|
|
||||||
// the :export directive is the magic sauce for webpack
|
// the :export directive is the magic sauce for webpack
|
||||||
// https://www.bluematador.com/blog/how-to-share-variables-between-js-and-sass
|
// https://www.bluematador.com/blog/how-to-share-variables-between-js-and-sass
|
||||||
|
|||||||
@ -57,9 +57,9 @@ const props = defineProps({
|
|||||||
// 数量限制
|
// 数量限制
|
||||||
limit: propTypes.number.def(5),
|
limit: propTypes.number.def(5),
|
||||||
// 大小限制(MB)
|
// 大小限制(MB)
|
||||||
fileSize: propTypes.number.def(5),
|
fileSize: propTypes.number.def(200),
|
||||||
// 文件类型, 例如['png', 'jpg', 'jpeg']
|
// 文件类型, 例如['png', 'jpg', 'jpeg']
|
||||||
fileType: propTypes.array.def(['doc', 'docx', 'xls', 'xlsx', 'ppt', 'pptx', 'txt', 'pdf']),
|
fileType: propTypes.array.def(['doc', 'docx', 'xls', 'xlsx', 'ppt', 'pptx', 'txt', 'pdf','apk','wgt','html','mp3','mp4']),
|
||||||
// 是否显示提示
|
// 是否显示提示
|
||||||
isShowTip: propTypes.bool.def(true),
|
isShowTip: propTypes.bool.def(true),
|
||||||
// 禁用组件(仅查看文件)
|
// 禁用组件(仅查看文件)
|
||||||
|
|||||||
@ -28,7 +28,6 @@ function copyTextToClipboard(input: string, { target = document.body } = {}) {
|
|||||||
element.value = input;
|
element.value = input;
|
||||||
// Prevent keyboard from showing on mobile
|
// Prevent keyboard from showing on mobile
|
||||||
element.setAttribute('readonly', '');
|
element.setAttribute('readonly', '');
|
||||||
|
|
||||||
element.style.contain = 'strict';
|
element.style.contain = 'strict';
|
||||||
element.style.position = 'absolute';
|
element.style.position = 'absolute';
|
||||||
element.style.left = '-9999px';
|
element.style.left = '-9999px';
|
||||||
|
|||||||
@ -20,7 +20,7 @@
|
|||||||
<div class="avatar-wrapper">
|
<div class="avatar-wrapper">
|
||||||
<!-- <img :src="userStore.avatar" class="user-avatar" /> -->
|
<!-- <img :src="userStore.avatar" class="user-avatar" /> -->
|
||||||
<img src="@/assets/images/avatar.png" class="user-avatar" />
|
<img src="@/assets/images/avatar.png" class="user-avatar" />
|
||||||
<div style="margin-left: 10px;">{{ useUserStore().nickname }}</div>
|
<div style="margin-left: 10px; white-space: nowrap; font-size: 14px;">{{ useUserStore().nickname }}</div>
|
||||||
<el-icon><caret-bottom /></el-icon>
|
<el-icon><caret-bottom /></el-icon>
|
||||||
</div>
|
</div>
|
||||||
<template #dropdown>
|
<template #dropdown>
|
||||||
|
|||||||
@ -1,13 +1,16 @@
|
|||||||
<template>
|
<template>
|
||||||
<div v-if="!item.hidden">
|
<div v-if="!item.hidden">
|
||||||
<template v-if="hasOneShowingChild(item, item.children) && (!onlyOneChild.children || onlyOneChild.noShowingChildren) && !item.alwaysShow">
|
<template
|
||||||
|
v-if="hasOneShowingChild(item, item.children) && (!onlyOneChild.children || onlyOneChild.noShowingChildren) && !item.alwaysShow">
|
||||||
<app-link v-if="onlyOneChild.meta" :to="resolvePath(onlyOneChild.path, onlyOneChild.query)">
|
<app-link v-if="onlyOneChild.meta" :to="resolvePath(onlyOneChild.path, onlyOneChild.query)">
|
||||||
<el-menu-item :index="resolvePath(onlyOneChild.path)" :class="{ 'submenu-title-noDropdown': !isNest }">
|
<span @click="handleMenuClick(onlyOneChild, $event)">
|
||||||
<svg-icon :icon-class="onlyOneChild.meta.icon || (item.meta && item.meta.icon)" />
|
<el-menu-item :index="resolvePath(onlyOneChild.path)" :class="{ 'submenu-title-noDropdown': !isNest }">
|
||||||
<template #title>
|
<svg-icon :icon-class="onlyOneChild.meta.icon || (item.meta && item.meta.icon)" />
|
||||||
<span class="menu-title" :title="hasTitle(onlyOneChild.meta.title)">{{ onlyOneChild.meta.title }}</span>
|
<template #title>
|
||||||
</template>
|
<span class="menu-title" :title="hasTitle(onlyOneChild.meta.title)">{{ onlyOneChild.meta.title }}</span>
|
||||||
</el-menu-item>
|
</template>
|
||||||
|
</el-menu-item>
|
||||||
|
</span>
|
||||||
</app-link>
|
</app-link>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
@ -17,14 +20,8 @@
|
|||||||
<span class="menu-title" :title="hasTitle(item.meta?.title)">{{ item.meta?.title }}</span>
|
<span class="menu-title" :title="hasTitle(item.meta?.title)">{{ item.meta?.title }}</span>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<sidebar-item
|
<sidebar-item v-for="(child, index) in item.children" :key="child.path + index" :is-nest="true" :item="child"
|
||||||
v-for="(child, index) in item.children"
|
:base-path="resolvePath(child.path)" class="nest-menu" />
|
||||||
:key="child.path + index"
|
|
||||||
:is-nest="true"
|
|
||||||
:item="child"
|
|
||||||
:base-path="resolvePath(child.path)"
|
|
||||||
class="nest-menu"
|
|
||||||
/>
|
|
||||||
</el-sub-menu>
|
</el-sub-menu>
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
@ -77,8 +74,25 @@ const hasOneShowingChild = (parent: RouteRecordRaw, children?: RouteRecordRaw[])
|
|||||||
|
|
||||||
return false;
|
return false;
|
||||||
};
|
};
|
||||||
|
const router = useRouter();
|
||||||
|
// 处理菜单点击,完全控制跳转行为
|
||||||
|
const handleMenuClick = (route, event) => {
|
||||||
|
console.log(route, 'route');
|
||||||
|
if (route.meta.openInNewTab) {
|
||||||
|
// 完全阻止默认行为和事件冒泡
|
||||||
|
event.preventDefault();
|
||||||
|
event.stopPropagation();
|
||||||
|
console.log('Opening in new tab:', route);
|
||||||
|
const resolvedRoute = router.resolve({
|
||||||
|
name: route.name || route.path
|
||||||
|
});
|
||||||
|
const fullUrl = new URL(resolvedRoute.href, window.location.origin).href;
|
||||||
|
window.open(fullUrl, '_blank');
|
||||||
|
} else {
|
||||||
|
}
|
||||||
|
};
|
||||||
const resolvePath = (routePath: string, routeQuery?: string): any => {
|
const resolvePath = (routePath: string, routeQuery?: string): any => {
|
||||||
|
|
||||||
if (isExternal(routePath)) {
|
if (isExternal(routePath)) {
|
||||||
return routePath;
|
return routePath;
|
||||||
}
|
}
|
||||||
|
|||||||
@ -35,7 +35,7 @@ export default {
|
|||||||
ElMessageBox.alert(content, '系统提示', { type: 'warning' });
|
ElMessageBox.alert(content, '系统提示', { type: 'warning' });
|
||||||
},
|
},
|
||||||
// 通知提示
|
// 通知提示
|
||||||
notify(content: any) {
|
notify(content: any) {
|
||||||
ElNotification.info(content);
|
ElNotification.info(content);
|
||||||
},
|
},
|
||||||
// 错误通知
|
// 错误通知
|
||||||
@ -56,7 +56,7 @@ export default {
|
|||||||
confirmButtonText: '确定',
|
confirmButtonText: '确定',
|
||||||
cancelButtonText: '取消',
|
cancelButtonText: '取消',
|
||||||
type: 'warning'
|
type: 'warning'
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
// 提交内容
|
// 提交内容
|
||||||
prompt(content: any) {
|
prompt(content: any) {
|
||||||
|
|||||||
@ -39,6 +39,12 @@ export const constantRoutes: RouteRecordRaw[] = [
|
|||||||
component: () => import('@/views/error/401.vue'),
|
component: () => import('@/views/error/401.vue'),
|
||||||
hidden: true
|
hidden: true
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
path: "/homeIndex",
|
||||||
|
name: "HomeIndex",
|
||||||
|
component: () => import("@/views/homeIndex/index.vue"),
|
||||||
|
meta: { title: '数据大屏', icon: '首页1.1', preload: true, keepAlive: true, openInNewTab: true },
|
||||||
|
},
|
||||||
{
|
{
|
||||||
path: '',
|
path: '',
|
||||||
component: Layout,
|
component: Layout,
|
||||||
@ -48,10 +54,11 @@ export const constantRoutes: RouteRecordRaw[] = [
|
|||||||
path: '/index',
|
path: '/index',
|
||||||
component: () => import('@/views/index.vue'),
|
component: () => import('@/views/index.vue'),
|
||||||
name: 'Index',
|
name: 'Index',
|
||||||
meta: { title: '首页', icon: 'dashboard', affix: true }
|
meta: { title: '首页', icon: '首页1.1', affix: true, keepAlive: false }
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
|
|
||||||
{
|
{
|
||||||
path: '/user',
|
path: '/user',
|
||||||
component: Layout,
|
component: Layout,
|
||||||
|
|||||||
@ -1,6 +1,7 @@
|
|||||||
|
//日期格式化
|
||||||
function DateFormat(date, format) {
|
function DateFormat(date, format) {
|
||||||
if (!date) {
|
if (!date) {
|
||||||
date = new Date();
|
return '';
|
||||||
}
|
}
|
||||||
if (!format) {
|
if (!format) {
|
||||||
format = 'yyyy-MM-dd HH:mm:ss';
|
format = 'yyyy-MM-dd HH:mm:ss';
|
||||||
@ -39,8 +40,79 @@ function DateFormat(date, format) {
|
|||||||
return formatMap[match];
|
return formatMap[match];
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
//日期加减
|
||||||
|
function DateAdd(datePart, number, date) {
|
||||||
|
// 创建日期的副本,避免修改原日期对象
|
||||||
|
const newDate = new Date(date.getTime());
|
||||||
|
|
||||||
|
// 根据不同的时间单位添加相应的值
|
||||||
|
switch (datePart.toLowerCase()) {
|
||||||
|
case 'year':
|
||||||
|
newDate.setFullYear(newDate.getFullYear() + number);
|
||||||
|
break;
|
||||||
|
case 'month':
|
||||||
|
newDate.setMonth(newDate.getMonth() + number);
|
||||||
|
break;
|
||||||
|
case 'day':
|
||||||
|
newDate.setDate(newDate.getDate() + number);
|
||||||
|
break;
|
||||||
|
case 'hour':
|
||||||
|
newDate.setHours(newDate.getHours() + number);
|
||||||
|
break;
|
||||||
|
case 'minute':
|
||||||
|
newDate.setMinutes(newDate.getMinutes() + number);
|
||||||
|
break;
|
||||||
|
case 'second':
|
||||||
|
newDate.setSeconds(newDate.getSeconds() + number);
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
throw new Error('不支持的datePart参数。支持的参数: Year, Month, Day, Hour, Minute, Second');
|
||||||
|
}
|
||||||
|
|
||||||
|
return newDate;
|
||||||
|
}
|
||||||
|
|
||||||
|
//将字节转换成0.53kb 10.13MB 1GB这样的友好单位
|
||||||
|
function formatBytes(bytes, decimals = 2) {
|
||||||
|
// 处理0字节的情况
|
||||||
|
if (bytes === 0) return '0 B';
|
||||||
|
|
||||||
|
// 定义单位和换算比例
|
||||||
|
const k = 1024;
|
||||||
|
const dm = decimals < 0 ? 0 : decimals;
|
||||||
|
const sizes = ['B', 'KB', 'MB', 'GB', 'TB'];
|
||||||
|
|
||||||
|
// 计算最合适的单位
|
||||||
|
const i = Math.floor(Math.log(bytes) / Math.log(k));
|
||||||
|
|
||||||
|
// 格式化并返回结果
|
||||||
|
return parseFloat((bytes / Math.pow(k, i)).toFixed(dm)) + ' ' + sizes[i];
|
||||||
|
}
|
||||||
|
|
||||||
|
//数组某个字段取唯一值
|
||||||
|
function getUniqueValues(dataSource, field) {
|
||||||
|
if(!field){
|
||||||
|
return [];
|
||||||
|
}
|
||||||
|
// 使用Set来存储唯一值,因为Set会自动去重
|
||||||
|
const uniqueValues = new Set();
|
||||||
|
|
||||||
|
// 遍历数据源
|
||||||
|
for (const item of dataSource) {
|
||||||
|
// 检查对象是否包含指定字段
|
||||||
|
if (item.hasOwnProperty(field)) {
|
||||||
|
uniqueValues.add(item[field]);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// 将Set转换为数组并返回
|
||||||
|
return Array.from(uniqueValues);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
export default{
|
export default{
|
||||||
DateFormat:DateFormat
|
DateFormat:DateFormat,
|
||||||
|
DateAdd:DateAdd,
|
||||||
|
formatBytes:formatBytes,
|
||||||
|
getUniqueValues:getUniqueValues
|
||||||
}
|
}
|
||||||
211
src/utils/coordinate-transform.ts
Normal file
@ -0,0 +1,211 @@
|
|||||||
|
/**
|
||||||
|
* 坐标系转换工具
|
||||||
|
* WGS84(地球坐标系)与 GCJ02(火星坐标系)相互转换
|
||||||
|
*/
|
||||||
|
|
||||||
|
// 地标转国测常量
|
||||||
|
const X_PI = (3.14159265358979324 * 3000.0) / 180.0;
|
||||||
|
const PI = 3.1415926535897932384626;
|
||||||
|
const A = 6378245.0; // 卫星椭球坐标投影到平面地图坐标系的投影因子
|
||||||
|
const EE = 0.00669342162296594323; // 椭球的偏心率
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 坐标点类型定义
|
||||||
|
*/
|
||||||
|
export interface CoordinatePoint {
|
||||||
|
lng: number; // 经度
|
||||||
|
lat: number; // 纬度
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 判断是否在国内,在中国国内的经纬度才需要做偏移
|
||||||
|
* @param lng 经度
|
||||||
|
* @param lat 纬度
|
||||||
|
* @returns 是否在国外
|
||||||
|
*/
|
||||||
|
function outOfChina(lng: number, lat: number): boolean {
|
||||||
|
return (
|
||||||
|
lng < 72.004 ||
|
||||||
|
lng > 137.8347 ||
|
||||||
|
lat < 0.8293 ||
|
||||||
|
lat > 55.8271
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 转化经度
|
||||||
|
* @param lng 经度
|
||||||
|
* @param lat 纬度
|
||||||
|
* @returns 转换后的经度偏移量
|
||||||
|
*/
|
||||||
|
function transformLng(lng: number, lat: number): number {
|
||||||
|
let ret =
|
||||||
|
300.0 +
|
||||||
|
lng +
|
||||||
|
2.0 * lat +
|
||||||
|
0.1 * lng * lng +
|
||||||
|
0.1 * lng * lat +
|
||||||
|
0.1 * Math.sqrt(Math.abs(lng));
|
||||||
|
|
||||||
|
ret +=
|
||||||
|
((20.0 * Math.sin(6.0 * lng * PI) +
|
||||||
|
20.0 * Math.sin(2.0 * lng * PI)) *
|
||||||
|
2.0) /
|
||||||
|
3.0;
|
||||||
|
|
||||||
|
ret +=
|
||||||
|
((20.0 * Math.sin(lng * PI) +
|
||||||
|
40.0 * Math.sin((lng / 3.0) * PI)) *
|
||||||
|
2.0) /
|
||||||
|
3.0;
|
||||||
|
|
||||||
|
ret +=
|
||||||
|
((150.0 * Math.sin((lng / 12.0) * PI) +
|
||||||
|
300.0 * Math.sin((lng / 30.0) * PI)) *
|
||||||
|
2.0) /
|
||||||
|
3.0;
|
||||||
|
|
||||||
|
return ret;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 转化纬度
|
||||||
|
* @param lng 经度
|
||||||
|
* @param lat 纬度
|
||||||
|
* @returns 转换后的纬度偏移量
|
||||||
|
*/
|
||||||
|
function transformLat(lng: number, lat: number): number {
|
||||||
|
let ret =
|
||||||
|
-100.0 +
|
||||||
|
2.0 * lng +
|
||||||
|
3.0 * lat +
|
||||||
|
0.2 * lat * lat +
|
||||||
|
0.1 * lng * lat +
|
||||||
|
0.2 * Math.sqrt(Math.abs(lng));
|
||||||
|
|
||||||
|
ret +=
|
||||||
|
((20.0 * Math.sin(6.0 * lng * PI) +
|
||||||
|
20.0 * Math.sin(2.0 * lng * PI)) *
|
||||||
|
2.0) /
|
||||||
|
3.0;
|
||||||
|
|
||||||
|
ret +=
|
||||||
|
((20.0 * Math.sin(lat * PI) +
|
||||||
|
40.0 * Math.sin((lat / 3.0) * PI)) *
|
||||||
|
2.0) /
|
||||||
|
3.0;
|
||||||
|
|
||||||
|
ret +=
|
||||||
|
((160.0 * Math.sin((lat / 12.0) * PI) +
|
||||||
|
320 * Math.sin((lat * PI) / 30.0)) *
|
||||||
|
2.0) /
|
||||||
|
3.0;
|
||||||
|
|
||||||
|
return ret;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* WGS84坐标系转GCJ02坐标系(地球坐标系转火星坐标系)
|
||||||
|
* @param lng 经度
|
||||||
|
* @param lat 纬度
|
||||||
|
* @returns 转换后的坐标 [经度, 纬度]
|
||||||
|
*/
|
||||||
|
export function wgs84ToGcj02(lng: number, lat: number): [number, number] {
|
||||||
|
if (outOfChina(lng, lat)) {
|
||||||
|
return [lng, lat];
|
||||||
|
}
|
||||||
|
|
||||||
|
const dlat = transformLat(lng - 105.0, lat - 35.0);
|
||||||
|
const dlng = transformLng(lng - 105.0, lat - 35.0);
|
||||||
|
const radlat = (lat / 180.0) * PI;
|
||||||
|
let magic = Math.sin(radlat);
|
||||||
|
magic = 1 - EE * magic * magic;
|
||||||
|
const sqrtmagic = Math.sqrt(magic);
|
||||||
|
|
||||||
|
const transformedLat =
|
||||||
|
(dlat * 180.0) /
|
||||||
|
(((A * (1 - EE)) / (magic * sqrtmagic)) * PI);
|
||||||
|
const transformedLng =
|
||||||
|
(dlng * 180.0) / ((A / sqrtmagic) * Math.cos(radlat) * PI);
|
||||||
|
|
||||||
|
const mglat = lat + transformedLat;
|
||||||
|
const mglng = lng + transformedLng;
|
||||||
|
|
||||||
|
return [mglng, mglat];
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* GCJ02坐标系转WGS84坐标系(火星坐标系转地球坐标系)
|
||||||
|
* @param lng 经度
|
||||||
|
* @param lat 纬度
|
||||||
|
* @returns 转换后的坐标 [经度, 纬度]
|
||||||
|
*/
|
||||||
|
export function gcj02ToWgs84(lng: number, lat: number): [number, number] {
|
||||||
|
if (outOfChina(lng, lat)) {
|
||||||
|
return [lng, lat];
|
||||||
|
}
|
||||||
|
|
||||||
|
const dlat = transformLat(lng - 105.0, lat - 35.0);
|
||||||
|
const dlng = transformLng(lng - 105.0, lat - 35.0);
|
||||||
|
const radlat = (lat / 180.0) * PI;
|
||||||
|
let magic = Math.sin(radlat);
|
||||||
|
magic = 1 - EE * magic * magic;
|
||||||
|
const sqrtmagic = Math.sqrt(magic);
|
||||||
|
|
||||||
|
const transformedLat = (dlat * 180.0) / ((A * (1 - EE)) / (magic * sqrtmagic) * PI);
|
||||||
|
const transformedLng = (dlng * 180.0) / (A / sqrtmagic * Math.cos(radlat) * PI);
|
||||||
|
|
||||||
|
const mglat = lat + transformedLat;
|
||||||
|
const mglng = lng + transformedLng;
|
||||||
|
|
||||||
|
return [lng * 2 - mglng, lat * 2 - mglat];
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 对象形式的坐标转换 - WGS84转GCJ02
|
||||||
|
* @param point 坐标点对象 {lng: 经度, lat: 纬度}
|
||||||
|
* @returns 转换后的坐标点对象
|
||||||
|
*/
|
||||||
|
export function wgs84ToGcj02Point(point: CoordinatePoint): CoordinatePoint {
|
||||||
|
const [lng, lat] = wgs84ToGcj02(point.lng, point.lat);
|
||||||
|
return { lng, lat };
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 对象形式的坐标转换 - GCJ02转WGS84
|
||||||
|
* @param point 坐标点对象 {lng: 经度, lat: 纬度}
|
||||||
|
* @returns 转换后的坐标点对象
|
||||||
|
*/
|
||||||
|
export function gcj02ToWgs84Point(point: CoordinatePoint): CoordinatePoint {
|
||||||
|
const [lng, lat] = gcj02ToWgs84(point.lng, point.lat);
|
||||||
|
return { lng, lat };
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 批量转换坐标点 - WGS84转GCJ02
|
||||||
|
* @param points 坐标点数组
|
||||||
|
* @returns 转换后的坐标点数组
|
||||||
|
*/
|
||||||
|
export function batchWgs84ToGcj02(points: CoordinatePoint[]): CoordinatePoint[] {
|
||||||
|
return points.map(point => wgs84ToGcj02Point(point));
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 批量转换坐标点 - GCJ02转WGS84
|
||||||
|
* @param points 坐标点数组
|
||||||
|
* @returns 转换后的坐标点数组
|
||||||
|
*/
|
||||||
|
export function batchGcj02ToWgs84(points: CoordinatePoint[]): CoordinatePoint[] {
|
||||||
|
return points.map(point => gcj02ToWgs84Point(point));
|
||||||
|
}
|
||||||
|
|
||||||
|
// 默认导出
|
||||||
|
export default {
|
||||||
|
wgs84ToGcj02,
|
||||||
|
gcj02ToWgs84,
|
||||||
|
wgs84ToGcj02Point,
|
||||||
|
gcj02ToWgs84Point,
|
||||||
|
batchWgs84ToGcj02,
|
||||||
|
batchGcj02ToWgs84,
|
||||||
|
outOfChina
|
||||||
|
};
|
||||||
@ -316,3 +316,15 @@ export const removeClass = (ele: HTMLElement, cls: string) => {
|
|||||||
export const isExternal = (path: string) => {
|
export const isExternal = (path: string) => {
|
||||||
return /^(https?:|http?:|mailto:|tel:)/.test(path);
|
return /^(https?:|http?:|mailto:|tel:)/.test(path);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
// 导出坐标系转换工具
|
||||||
|
export { default as coordinateTransform } from './coordinate-transform';
|
||||||
|
export type { CoordinatePoint } from './coordinate-transform';
|
||||||
|
export {
|
||||||
|
wgs84ToGcj02,
|
||||||
|
gcj02ToWgs84,
|
||||||
|
wgs84ToGcj02Point,
|
||||||
|
gcj02ToWgs84Point,
|
||||||
|
batchWgs84ToGcj02,
|
||||||
|
batchGcj02ToWgs84
|
||||||
|
} from './coordinate-transform';
|
||||||
276
src/utils/mqtt.ts
Normal file
@ -0,0 +1,276 @@
|
|||||||
|
|
||||||
|
import * as Paho from 'paho-mqtt';
|
||||||
|
|
||||||
|
// MQTT消息类型定义
|
||||||
|
export interface MqttMessage {
|
||||||
|
topic: string;
|
||||||
|
payload: string | ArrayBuffer;
|
||||||
|
qos: number;
|
||||||
|
retained: boolean;
|
||||||
|
time: Date;
|
||||||
|
}
|
||||||
|
// 订阅选项
|
||||||
|
export interface SubscribeOptions {
|
||||||
|
qos: 0 | 1 | 2;
|
||||||
|
}
|
||||||
|
|
||||||
|
// 根据当前页面协议自动选择MQTT配置
|
||||||
|
const getMqttConfig = () => {
|
||||||
|
// 检测当前页面协议(http: 或 https:)
|
||||||
|
//const isHttps = window.location.protocol === 'https:';
|
||||||
|
|
||||||
|
const isHttps = import.meta.env.VITE_APP_ENV === 'production' || window.location.protocol === 'https:';
|
||||||
|
console.log(isHttps,'检测环境');
|
||||||
|
|
||||||
|
return {
|
||||||
|
// 自动切换协议:https页面用wss,http页面用ws
|
||||||
|
protocol: isHttps ? 'wss' : 'ws',
|
||||||
|
host: 'www.cnxhyc.com',
|
||||||
|
// 自动切换端口:https对应9084,http对应9083
|
||||||
|
port: isHttps ? 9084 : 9083,
|
||||||
|
// 认证信息
|
||||||
|
username: 'admin',
|
||||||
|
password: '#YtvpSfCNG',
|
||||||
|
clientId: `vue3-mqtt-client-${Date.now()}-${Math.random().toString(36).substring(2, 10)}`,
|
||||||
|
cleanSession: true,
|
||||||
|
keepAliveInterval: 60,
|
||||||
|
reconnect: true,
|
||||||
|
};
|
||||||
|
};
|
||||||
|
const MQTT_CONFIG = getMqttConfig();
|
||||||
|
|
||||||
|
// MQTT客户端组合式API
|
||||||
|
export function useMqtt() {
|
||||||
|
// 客户端实例
|
||||||
|
let client: Paho.Client | null = null;
|
||||||
|
// 状态管理(修复:已导入ref)
|
||||||
|
const connected = ref(false);
|
||||||
|
const connecting = ref(false);
|
||||||
|
const error = ref<Error | null>(null);
|
||||||
|
const messages = ref<MqttMessage[]>([]);
|
||||||
|
const subscribedTopics = ref<string[]>([]);
|
||||||
|
// 事件回调
|
||||||
|
const connectCallbacks: (() => void)[] = [];
|
||||||
|
const messageCallbacks: ((message: MqttMessage) => void)[] = [];
|
||||||
|
const errorCallbacks: ((err: Error) => void)[] = [];
|
||||||
|
const disconnectCallbacks: (() => void)[] = [];
|
||||||
|
// 修复:移除无用的p0参数,connect方法不接受回调(通过onConnect注册)
|
||||||
|
const connect = () => {
|
||||||
|
if (connected.value || connecting.value) return;
|
||||||
|
connecting.value = true;
|
||||||
|
error.value = null;
|
||||||
|
|
||||||
|
try {
|
||||||
|
// 打印当前使用的配置(方便调试)
|
||||||
|
console.log('当前MQTT连接配置:', {
|
||||||
|
protocol: MQTT_CONFIG.protocol,
|
||||||
|
host: MQTT_CONFIG.host,
|
||||||
|
port: MQTT_CONFIG.port,
|
||||||
|
clientId: MQTT_CONFIG.clientId
|
||||||
|
});
|
||||||
|
client = new Paho.Client(
|
||||||
|
MQTT_CONFIG.host,
|
||||||
|
MQTT_CONFIG.port,
|
||||||
|
MQTT_CONFIG.clientId
|
||||||
|
);
|
||||||
|
|
||||||
|
// 设置连接选项
|
||||||
|
const connectOptions: Paho.ConnectOptions = {
|
||||||
|
userName: MQTT_CONFIG.username,
|
||||||
|
password: MQTT_CONFIG.password,
|
||||||
|
cleanSession: MQTT_CONFIG.cleanSession,
|
||||||
|
keepAliveInterval: MQTT_CONFIG.keepAliveInterval,
|
||||||
|
reconnect: MQTT_CONFIG.reconnect,
|
||||||
|
useSSL: MQTT_CONFIG.protocol === 'wss', // 关键:根据协议自动启用 SSL
|
||||||
|
|
||||||
|
// 连接成功回调
|
||||||
|
onSuccess: () => {
|
||||||
|
console.log('MQTT连接成功');
|
||||||
|
connected.value = true;
|
||||||
|
connecting.value = false;
|
||||||
|
connectCallbacks.forEach(cb => cb()); // 触发所有连接成功回调
|
||||||
|
},
|
||||||
|
|
||||||
|
// 连接失败回调
|
||||||
|
onFailure: (err) => {
|
||||||
|
console.error('MQTT连接失败:', err);
|
||||||
|
error.value = new Error(err.errorMessage || '连接失败');
|
||||||
|
connected.value = false;
|
||||||
|
connecting.value = false;
|
||||||
|
errorCallbacks.forEach(cb => cb(error.value!));
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
// 设置客户端回调
|
||||||
|
client.onConnectionLost = (responseObject) => {
|
||||||
|
if (responseObject.errorCode !== 0) {
|
||||||
|
console.error('连接丢失:', responseObject.errorMessage);
|
||||||
|
error.value = new Error(responseObject.errorMessage || '连接丢失');
|
||||||
|
errorCallbacks.forEach(cb => cb(error.value!));
|
||||||
|
}
|
||||||
|
|
||||||
|
connected.value = false;
|
||||||
|
connecting.value = false;
|
||||||
|
disconnectCallbacks.forEach(cb => cb());
|
||||||
|
};
|
||||||
|
|
||||||
|
// 消息接收回调
|
||||||
|
client.onMessageArrived = (message) => {
|
||||||
|
const newMessage: MqttMessage = {
|
||||||
|
topic: message.destinationName,
|
||||||
|
payload: message.payloadString || message.payloadBytes,
|
||||||
|
qos: message.qos,
|
||||||
|
retained: message.retained,
|
||||||
|
time: new Date()
|
||||||
|
};
|
||||||
|
|
||||||
|
messages.value.push(newMessage);
|
||||||
|
messageCallbacks.forEach(cb => cb(newMessage));
|
||||||
|
};
|
||||||
|
|
||||||
|
// 连接服务器
|
||||||
|
client.connect(connectOptions);
|
||||||
|
} catch (err) {
|
||||||
|
console.error('MQTT连接异常:', err);
|
||||||
|
error.value = err as Error;
|
||||||
|
connected.value = false;
|
||||||
|
connecting.value = false;
|
||||||
|
errorCallbacks.forEach(cb => cb(error.value!));
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
// 断开连接
|
||||||
|
const disconnect = () => {
|
||||||
|
if (!client || !connected.value) return;
|
||||||
|
|
||||||
|
client.disconnect();
|
||||||
|
client = null;
|
||||||
|
connected.value = false;
|
||||||
|
subscribedTopics.value = [];
|
||||||
|
disconnectCallbacks.forEach(cb => cb());
|
||||||
|
};
|
||||||
|
|
||||||
|
// 订阅主题
|
||||||
|
const subscribe = (topic: string, options: SubscribeOptions): Promise<void> => {
|
||||||
|
return new Promise((resolve, reject) => {
|
||||||
|
if (!client || !connected.value) {
|
||||||
|
reject(new Error('未连接到MQTT服务器'));
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (subscribedTopics.value.includes(topic)) {
|
||||||
|
resolve();
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
client.subscribe(topic, {
|
||||||
|
qos: options.qos,
|
||||||
|
onSuccess: () => {
|
||||||
|
console.log(`订阅主题成功: ${topic}`);
|
||||||
|
subscribedTopics.value.push(topic);
|
||||||
|
resolve();
|
||||||
|
},
|
||||||
|
onFailure: (err) => {
|
||||||
|
console.error(`订阅主题失败: ${topic}`, err);
|
||||||
|
reject(new Error(err.errorMessage || `订阅主题 ${topic} 失败`));
|
||||||
|
}
|
||||||
|
});
|
||||||
|
});
|
||||||
|
};
|
||||||
|
|
||||||
|
// 取消订阅
|
||||||
|
const unsubscribe = (topic: string): Promise<void> => {
|
||||||
|
return new Promise((resolve, reject) => {
|
||||||
|
if (!client || !connected.value) {
|
||||||
|
reject(new Error('未连接到MQTT服务器'));
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!subscribedTopics.value.includes(topic)) {
|
||||||
|
resolve();
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
client.unsubscribe(topic, {
|
||||||
|
onSuccess: () => {
|
||||||
|
console.log(`取消订阅主题成功: ${topic}`);
|
||||||
|
subscribedTopics.value = subscribedTopics.value.filter(t => t !== topic);
|
||||||
|
resolve();
|
||||||
|
},
|
||||||
|
onFailure: (err) => {
|
||||||
|
console.error(`取消订阅主题失败: ${topic}`, err);
|
||||||
|
reject(new Error(err.errorMessage || `取消订阅主题 ${topic} 失败`));
|
||||||
|
}
|
||||||
|
});
|
||||||
|
});
|
||||||
|
};
|
||||||
|
|
||||||
|
// 发布消息
|
||||||
|
const publish = (
|
||||||
|
topic: string,
|
||||||
|
payload: string | ArrayBuffer,
|
||||||
|
options: { qos: 0 | 1 | 2; retained?: boolean }
|
||||||
|
): Promise<void> => {
|
||||||
|
return new Promise((resolve, reject) => {
|
||||||
|
if (!client || !connected.value) {
|
||||||
|
reject(new Error('未连接到MQTT服务器'));
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!topic) {
|
||||||
|
reject(new Error('主题不能为空'));
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
const message = new Paho.Message(
|
||||||
|
typeof payload === 'string' ? payload : payload.toString()
|
||||||
|
);
|
||||||
|
|
||||||
|
message.destinationName = topic;
|
||||||
|
message.qos = options.qos;
|
||||||
|
message.retained = options.retained ?? false;
|
||||||
|
|
||||||
|
client.send(message);
|
||||||
|
resolve();
|
||||||
|
});
|
||||||
|
};
|
||||||
|
|
||||||
|
// 事件注册
|
||||||
|
const onConnect = (callback: () => void) => {
|
||||||
|
connectCallbacks.push(callback);
|
||||||
|
};
|
||||||
|
|
||||||
|
const onMessage = (callback: (message: MqttMessage) => void) => {
|
||||||
|
messageCallbacks.push(callback);
|
||||||
|
};
|
||||||
|
|
||||||
|
const onError = (callback: (err: Error) => void) => {
|
||||||
|
errorCallbacks.push(callback);
|
||||||
|
};
|
||||||
|
|
||||||
|
const onDisconnect = (callback: () => void) => {
|
||||||
|
disconnectCallbacks.push(callback);
|
||||||
|
};
|
||||||
|
|
||||||
|
// 组件卸载时断开连接
|
||||||
|
onUnmounted(() => {
|
||||||
|
disconnect();
|
||||||
|
});
|
||||||
|
|
||||||
|
return {
|
||||||
|
connected,
|
||||||
|
connecting,
|
||||||
|
error,
|
||||||
|
messages,
|
||||||
|
subscribedTopics,
|
||||||
|
connect,
|
||||||
|
disconnect,
|
||||||
|
subscribe,
|
||||||
|
unsubscribe,
|
||||||
|
publish,
|
||||||
|
onConnect,
|
||||||
|
onMessage,
|
||||||
|
onError,
|
||||||
|
onDisconnect
|
||||||
|
};
|
||||||
|
}
|
||||||
113
src/utils/timeConverter.ts
Normal file
@ -0,0 +1,113 @@
|
|||||||
|
/**
|
||||||
|
* 时间转换工具类
|
||||||
|
* 提供时间格式化、时间差计算等功能
|
||||||
|
*/
|
||||||
|
export class TimeConverter {
|
||||||
|
/**
|
||||||
|
* 检查时间字符串是否有效
|
||||||
|
* @param timeStr 时间字符串
|
||||||
|
* @returns 是否有效的时间
|
||||||
|
*/
|
||||||
|
static isValidTime(timeStr: string): boolean {
|
||||||
|
if (!timeStr) return false;
|
||||||
|
return !isNaN(new Date(timeStr).getTime());
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 格式化时间
|
||||||
|
* @param timeStr 时间字符串
|
||||||
|
* @param format 格式,可选值: 'YYYY-MM-DD', 'HH:mm:ss', 'YYYY-MM-DD HH:mm:ss'
|
||||||
|
* @returns 格式化后的时间字符串
|
||||||
|
*/
|
||||||
|
static formatTime(timeStr: string, format: 'YYYY-MM-DD' | 'HH:mm:ss' | 'YYYY-MM-DD HH:mm:ss' = 'YYYY-MM-DD HH:mm:ss'): string {
|
||||||
|
if (!this.isValidTime(timeStr)) return '无效时间';
|
||||||
|
|
||||||
|
const date = new Date(timeStr);
|
||||||
|
const year = date.getFullYear();
|
||||||
|
const month = this.padZero(date.getMonth() + 1);
|
||||||
|
const day = this.padZero(date.getDate());
|
||||||
|
const hours = this.padZero(date.getHours());
|
||||||
|
const minutes = this.padZero(date.getMinutes());
|
||||||
|
const seconds = this.padZero(date.getSeconds());
|
||||||
|
|
||||||
|
switch (format) {
|
||||||
|
case 'YYYY-MM-DD':
|
||||||
|
return `${year}-${month}-${day}`;
|
||||||
|
case 'HH:mm:ss':
|
||||||
|
return `${hours}:${minutes}:${seconds}`;
|
||||||
|
case 'YYYY-MM-DD HH:mm:ss':
|
||||||
|
default:
|
||||||
|
return `${year}-${month}-${day} ${hours}:${minutes}:${seconds}`;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 计算与当前时间的差值(格式为 HH:mm:ss)
|
||||||
|
* @param startTimeStr 起始时间字符串
|
||||||
|
* @returns 格式化的时间差字符串
|
||||||
|
*/
|
||||||
|
static calculateTimeDiff(startTimeStr: string): string {
|
||||||
|
if (!this.isValidTime(startTimeStr)) return '';
|
||||||
|
|
||||||
|
const startTime = new Date(startTimeStr).getTime();
|
||||||
|
const nowTime = new Date().getTime();
|
||||||
|
const diffMs = nowTime - startTime;
|
||||||
|
|
||||||
|
// 处理未来时间
|
||||||
|
if (diffMs < 0) {
|
||||||
|
return '00:00:00';
|
||||||
|
}
|
||||||
|
|
||||||
|
// 计算总秒数
|
||||||
|
const totalSeconds = Math.floor(diffMs / 1000);
|
||||||
|
|
||||||
|
// 计算时、分、秒
|
||||||
|
const hours = this.padZero(Math.floor(totalSeconds / 3600));
|
||||||
|
const minutes = this.padZero(Math.floor((totalSeconds % 3600) / 60));
|
||||||
|
const seconds = this.padZero(totalSeconds % 60);
|
||||||
|
|
||||||
|
return `${hours}:${minutes}:${seconds}`;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 数字补零
|
||||||
|
* @param num 数字
|
||||||
|
* @returns 补零后的字符串
|
||||||
|
*/
|
||||||
|
private static padZero(num: number): string {
|
||||||
|
return num < 10 ? `0${num}` : num.toString();
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 创建一个时间差更新定时器
|
||||||
|
* @param startTimeStr 起始时间字符串
|
||||||
|
* @param callback 回调函数,接收计算后的时间差
|
||||||
|
* @param interval 刷新间隔(毫秒)
|
||||||
|
* @returns 定时器ID,用于清除定时器
|
||||||
|
*/
|
||||||
|
static createTimeDiffTimer(
|
||||||
|
startTimeStr: string,
|
||||||
|
callback: (diffText: string) => void,
|
||||||
|
interval: number = 1000
|
||||||
|
): number {
|
||||||
|
// 立即执行一次
|
||||||
|
callback(this.calculateTimeDiff(startTimeStr));
|
||||||
|
|
||||||
|
// 设置定时器
|
||||||
|
const timerId = window.setInterval(() => {
|
||||||
|
callback(this.calculateTimeDiff(startTimeStr));
|
||||||
|
}, interval);
|
||||||
|
|
||||||
|
return timerId;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 清除时间差更新定时器
|
||||||
|
* @param timerId 定时器ID
|
||||||
|
*/
|
||||||
|
static clearTimeDiffTimer(timerId: number | null): void {
|
||||||
|
if (timerId) {
|
||||||
|
clearInterval(timerId);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@ -11,7 +11,7 @@ export const initWebSocket = (url: any) => {
|
|||||||
useWebSocket(url, {
|
useWebSocket(url, {
|
||||||
autoReconnect: {
|
autoReconnect: {
|
||||||
// 重连最大次数
|
// 重连最大次数
|
||||||
retries: 3,
|
retries: 3,
|
||||||
// 重连间隔
|
// 重连间隔
|
||||||
delay: 1000,
|
delay: 1000,
|
||||||
onFailed() {
|
onFailed() {
|
||||||
|
|||||||
1090
src/views/controlCenter/018A/index.vue
Normal file
886
src/views/controlCenter/100J/index.vue
Normal file
@ -0,0 +1,886 @@
|
|||||||
|
<template>
|
||||||
|
<div class="device-page p-2">
|
||||||
|
<!-- 头部信息栏 -->
|
||||||
|
<div class="header-bar">
|
||||||
|
<div>设备名称:{{ deviceDetail.deviceName }}</div>
|
||||||
|
<div>设备型号:{{ deviceDetail.deviceImei }}</div>
|
||||||
|
<div class="device-status">设备状态:
|
||||||
|
<span :class="{ online: deviceDetail.onlineStatus === 1, offline: deviceDetail?.onlineStatus === 0 }">
|
||||||
|
{{ deviceDetail.onlineStatus === 1 ? '在线' : '离线' }}
|
||||||
|
</span>
|
||||||
|
</div>
|
||||||
|
<div>电量:{{ deviceDetail.batteryPercentage || 0 }}%</div>
|
||||||
|
<div>续航:{{ deviceDetail.batteryRemainingTime || "0" }} 分钟</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<!-- 主体内容区域 -->
|
||||||
|
<div class="content-wrapper">
|
||||||
|
<el-row :gutter="20" class="content-row" :class="deviceDetail.alarmStatus == 1 ? '' : 'displayNone'">
|
||||||
|
<el-col :lg="24" :xs="24">
|
||||||
|
<div class="staticRwo" :class="deviceDetail.alarmStatus == 1 ? '' : 'displayNone'"
|
||||||
|
@click="showClose()">
|
||||||
|
设备强制报警中!
|
||||||
|
</div>
|
||||||
|
</el-col>
|
||||||
|
</el-row>
|
||||||
|
<!-- 第一行:灯光模式 + 灯光亮度、强制报警、位置信息 -->
|
||||||
|
<el-row :gutter="20" class="content-row">
|
||||||
|
<el-col :lg="16" :xs="24">
|
||||||
|
<div class="content-card">
|
||||||
|
<h4 class="section-title">报警模式</h4>
|
||||||
|
<div class="light-mode">
|
||||||
|
<!-- 使用v-for循环渲染灯光模式卡片 -->
|
||||||
|
<div class="mode-card" :class="{ 'active': mode.active }"
|
||||||
|
@click.stop="handleVoiceType(mode.id)" v-for="mode in sta_VoiceType" :key="mode.id">
|
||||||
|
<img :src="mode.active ? mode.activeIcon : mode.icon" :alt="mode.name"
|
||||||
|
class="mode-icon" />
|
||||||
|
<div class="mode-name">{{ mode.name }}</div>
|
||||||
|
<el-switch v-model="mode.switchStatusVioice" />
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</el-col>
|
||||||
|
<el-col :lg="8" :xs="24">
|
||||||
|
<div class="brightness-alarm">
|
||||||
|
<el-button type="danger" class="alarm-btn" @click="forceAlarm" :loading="forceAlarmLoading"
|
||||||
|
v-if="deviceDetail.alarmStatus === 0 || deviceDetail.alarmStatus === null"
|
||||||
|
:loading-text="forceAlarmLoading ? '报警中...' : '强制报警'"> {{
|
||||||
|
forceAlarmLoading ? '报警中' : '强制报警' }}</el-button>
|
||||||
|
</div>
|
||||||
|
<div class="content-card_gps">
|
||||||
|
<h4 class="section-title">位置信息</h4>
|
||||||
|
<div class="location-info">
|
||||||
|
<div class="location-item">
|
||||||
|
<span class="location-icon"></span>
|
||||||
|
<span>经纬度 {{ deviceDetail && deviceDetail.longitude ?
|
||||||
|
Number(deviceDetail.longitude).toFixed(4) : '无' }}
|
||||||
|
{{ deviceDetail && deviceDetail.latitude ? Number(deviceDetail.latitude).toFixed(4)
|
||||||
|
: '无' }} </span>
|
||||||
|
</div>
|
||||||
|
<div class="location-item">
|
||||||
|
|
||||||
|
<div>地址 <span class="lacatin_gps">{{ deviceDetail.address || "未获取到地址" }}</span></div>
|
||||||
|
<el-button link type="primary" class="view-btn"
|
||||||
|
@click="lookMap(deviceDetail)">查看</el-button>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</el-col>
|
||||||
|
</el-row>
|
||||||
|
|
||||||
|
<!-- 第二行:人员信息登记 + 发送信息 -->
|
||||||
|
<el-row :gutter="20" class="content-row">
|
||||||
|
<el-col :lg="16" :xs="24">
|
||||||
|
<div class="content-card">
|
||||||
|
<h4 class="section-title">警示灯模式</h4>
|
||||||
|
<div class="light-mode">
|
||||||
|
<!-- 使用v-for循环渲染灯光模式卡片 -->
|
||||||
|
<div class="mode-card" :class="{ 'active': mode.active }"
|
||||||
|
@click.stop="handleModeClick(mode.id)" v-for="mode in lightModes" :key="mode.id">
|
||||||
|
<img :src="mode.active ? mode.activeIcon : mode.icon" :alt="mode.name"
|
||||||
|
class="mode-icon" />
|
||||||
|
<div class="mode-name">{{ mode.name }}</div>
|
||||||
|
<el-switch v-model="mode.switchStatus" />
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</el-col>
|
||||||
|
<el-col :lg="8" :xs="24">
|
||||||
|
<div class="content-card ">
|
||||||
|
<div class="brightness-alarm">
|
||||||
|
<div class="brightness-control">
|
||||||
|
<span class="brightness-label">亮度</span>
|
||||||
|
<el-input class="inputTFT" v-model="deviceDetail.lightBrightness" :min="10" :max="100"
|
||||||
|
:step="1" size="small" />
|
||||||
|
<span class="brightness-value">%</span>
|
||||||
|
<el-button type="primary" class="save-btn" v-loading="lightModesLoading"
|
||||||
|
@click="saveBtnlight">保存 </el-button>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div class="brightness-alarm">
|
||||||
|
<div class="brightness-control">
|
||||||
|
<span class="brightness-label">频率</span>
|
||||||
|
<el-input class="inputTFT" v-model="deviceDetail.strobeFrequency" :min="0.5" :max="10"
|
||||||
|
:step="1" size="small" />
|
||||||
|
<span class="brightness-value">HZ</span>
|
||||||
|
<el-button type="primary" class="save-btn" @click="saveBtnstrobe">保存 </el-button>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div class="brightness-alarm">
|
||||||
|
<div class="brightness-control">
|
||||||
|
<span class="brightness-label">音量</span>
|
||||||
|
<el-input class="inputTFT" v-model="deviceDetail.volume" :min="10" :max="100" :step="1"
|
||||||
|
size="small" />
|
||||||
|
<span class="brightness-value">%</span>
|
||||||
|
<el-button type="primary" class="save-btn" @click="saveBtnVolume">保存 </el-button>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</el-col>
|
||||||
|
</el-row>
|
||||||
|
</div>
|
||||||
|
<!-- ===========充电提示框====== -->
|
||||||
|
<el-dialog title="充电提示" v-model="centerDialogVisible" width="15%">
|
||||||
|
<div style="display: flex; align-items: center;">
|
||||||
|
<h3 style="color: rgba(224, 52, 52, 1)">设备电量低于20%</h3>
|
||||||
|
</div>
|
||||||
|
<div>请及时充电</div>
|
||||||
|
<span slot="footer" class="dialog-footer" style="text-align: right;display: block;">
|
||||||
|
<el-button type="primary" @click="centerDialogVisible = false">确 定</el-button>
|
||||||
|
</span>
|
||||||
|
</el-dialog>
|
||||||
|
</div>
|
||||||
|
</template>
|
||||||
|
<script setup name="DeviceControl" lang="ts">
|
||||||
|
const route = useRoute();
|
||||||
|
import { useMqtt } from '@/utils/mqtt';
|
||||||
|
import api from '@/api/controlCenter/controlPanel/100J'
|
||||||
|
import { DeviceDetail, LightMode } from '@/api/controlCenter/controlPanel/types';
|
||||||
|
import {getDeviceStatus } from '@/utils/function';
|
||||||
|
const { proxy } = getCurrentInstance() as ComponentInternalInstance;
|
||||||
|
const router = useRouter();
|
||||||
|
// 导入图片资源(确保路径正确)
|
||||||
|
import closeDefault from '@/assets/images/close.png';
|
||||||
|
import closeActive from '@/assets/images/close_HL.png';
|
||||||
|
import rb from '@/assets/images/rb.png';
|
||||||
|
import rbAc from '@/assets/images/rbAc.png';
|
||||||
|
import sg from '@/assets/images/sg.png';
|
||||||
|
import sgAc from '@/assets/images/sgAc.png';
|
||||||
|
const forceAlarmLoading = ref(false) //强制报警
|
||||||
|
const lightModesLoading = ref(false)
|
||||||
|
const centerDialogVisible = ref(false)
|
||||||
|
const {
|
||||||
|
connected,
|
||||||
|
connect,
|
||||||
|
subscribe,
|
||||||
|
onConnect,
|
||||||
|
onError,
|
||||||
|
onMessage,
|
||||||
|
disconnect
|
||||||
|
} = useMqtt();
|
||||||
|
// 报警模式
|
||||||
|
const sta_VoiceType = ref([
|
||||||
|
{
|
||||||
|
id: 'fire',
|
||||||
|
name: '消防',
|
||||||
|
icon: sg, // 直接使用导入的变量
|
||||||
|
activeIcon: sgAc,
|
||||||
|
switchStatusVioice: true,
|
||||||
|
active: true
|
||||||
|
},
|
||||||
|
{
|
||||||
|
id: '0',
|
||||||
|
name: '公安',
|
||||||
|
icon: sg, // 直接使用导入的变量
|
||||||
|
activeIcon: sgAc,
|
||||||
|
active: false,
|
||||||
|
switchStatusVioice: false,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
id: '3',
|
||||||
|
name: '交警',
|
||||||
|
icon: sg, // 直接使用导入的变量
|
||||||
|
activeIcon: sgAc,
|
||||||
|
switchStatusVioice: false,
|
||||||
|
active: false
|
||||||
|
},
|
||||||
|
{
|
||||||
|
id: '4',
|
||||||
|
name: '市政',
|
||||||
|
icon: sg, // 直接使用导入的变量
|
||||||
|
activeIcon: sgAc,
|
||||||
|
switchStatusVioice: false,
|
||||||
|
active: false
|
||||||
|
},
|
||||||
|
{
|
||||||
|
id: '2',
|
||||||
|
name: '应急',
|
||||||
|
icon: sg, // 直接使用导入的变量
|
||||||
|
activeIcon: sgAc,
|
||||||
|
switchStatusVioice: false,
|
||||||
|
active: false
|
||||||
|
},
|
||||||
|
{
|
||||||
|
id: '6',
|
||||||
|
name: '医疗',
|
||||||
|
icon: sg, // 直接使用导入的变量
|
||||||
|
activeIcon: sgAc,
|
||||||
|
switchStatusVioice: false,
|
||||||
|
active: false
|
||||||
|
},
|
||||||
|
{
|
||||||
|
id: '5',
|
||||||
|
name: '铁道',
|
||||||
|
icon: sg, // 直接使用导入的变量
|
||||||
|
activeIcon: sgAc,
|
||||||
|
switchStatusVioice: false,
|
||||||
|
active: false
|
||||||
|
},
|
||||||
|
{
|
||||||
|
id: '7',
|
||||||
|
name: 'app语音',
|
||||||
|
icon: sg, // 直接使用导入的变量
|
||||||
|
activeIcon: sgAc,
|
||||||
|
switchStatusVioice: false,
|
||||||
|
active: false
|
||||||
|
},
|
||||||
|
{
|
||||||
|
id: '-1',
|
||||||
|
name: '关闭',
|
||||||
|
icon: closeDefault, // 直接使用导入的变量
|
||||||
|
activeIcon: closeActive,
|
||||||
|
switchStatusVioice: false,
|
||||||
|
active: false
|
||||||
|
},
|
||||||
|
])
|
||||||
|
// 警示灯灯光模式数据(引用导入的图片)
|
||||||
|
const lightModes = ref<LightMode[]>([
|
||||||
|
{
|
||||||
|
id: 'redBlueAlternate', // 红蓝交替
|
||||||
|
name: '红蓝交替',
|
||||||
|
icon: rb,
|
||||||
|
activeIcon: rbAc,
|
||||||
|
switchStatus: true,
|
||||||
|
instructValue: '6',
|
||||||
|
active: true,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
id: 'redFlash', // 红闪
|
||||||
|
name: '红闪',
|
||||||
|
icon: rb,
|
||||||
|
activeIcon: rbAc,
|
||||||
|
switchStatus: false,
|
||||||
|
instructValue: '0',
|
||||||
|
active: false,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
id: 'yellowFlash', // 黄闪
|
||||||
|
name: '黄闪',
|
||||||
|
icon: rb,
|
||||||
|
activeIcon: rbAc,
|
||||||
|
switchStatus: false,
|
||||||
|
instructValue: '2',
|
||||||
|
active: false
|
||||||
|
},
|
||||||
|
{
|
||||||
|
id: 'blueFlash', // 蓝闪
|
||||||
|
name: '蓝闪',
|
||||||
|
icon: rb,
|
||||||
|
activeIcon: rbAc,
|
||||||
|
switchStatus: false,
|
||||||
|
instructValue: '1',
|
||||||
|
active: false
|
||||||
|
},
|
||||||
|
{
|
||||||
|
id: 'redClockwise', // 红色顺时针
|
||||||
|
name: '红色顺时针',
|
||||||
|
icon: rb,
|
||||||
|
activeIcon: rbAc,
|
||||||
|
switchStatus: false,
|
||||||
|
instructValue: '3',
|
||||||
|
active: false
|
||||||
|
},
|
||||||
|
{
|
||||||
|
id: 'yellowClockwise', // 黄色顺时针
|
||||||
|
name: '黄色顺时针',
|
||||||
|
icon: rb,
|
||||||
|
activeIcon: rbAc,
|
||||||
|
switchStatus: false,
|
||||||
|
instructValue: '4',
|
||||||
|
active: false
|
||||||
|
},
|
||||||
|
{
|
||||||
|
id: 'redBlueClockwise', // 红蓝顺时针
|
||||||
|
name: '红蓝顺时针',
|
||||||
|
icon: rb,
|
||||||
|
activeIcon: rbAc,
|
||||||
|
switchStatus: false,
|
||||||
|
instructValue: '5',
|
||||||
|
active: false
|
||||||
|
},
|
||||||
|
{
|
||||||
|
id: 'close', // 关闭
|
||||||
|
name: '关闭',
|
||||||
|
icon: closeDefault,
|
||||||
|
activeIcon: closeActive,
|
||||||
|
switchStatus: false,
|
||||||
|
instructValue: '-1',
|
||||||
|
active: false
|
||||||
|
},
|
||||||
|
]);
|
||||||
|
const deviceDetail = ref<DeviceDetail & { typeName: string }>({
|
||||||
|
lightBrightness: '',
|
||||||
|
deviceName: '',
|
||||||
|
deviceImei: '',
|
||||||
|
onlineStatus: 0,
|
||||||
|
batteryPercentage: 0,
|
||||||
|
batteryRemainingTime: '',
|
||||||
|
longitude: '',
|
||||||
|
latitude: '',
|
||||||
|
address: '',
|
||||||
|
sendMsg: '',
|
||||||
|
chargeState: '0',
|
||||||
|
typeName: '',
|
||||||
|
alarmStatus: 0,
|
||||||
|
strobeFrequency: '0.5',
|
||||||
|
volume: '10'
|
||||||
|
});
|
||||||
|
const isUpdatingStatus = ref(false);
|
||||||
|
// 报警模式// 2. 点击卡片事件
|
||||||
|
const handleVoiceType = async (targetId: string) => {
|
||||||
|
const deviceId = route.params.deviceId as string;
|
||||||
|
if (!deviceId) return;
|
||||||
|
const targetMode = sta_VoiceType.value.find(mode => mode.id === targetId);
|
||||||
|
if (!targetMode) return;
|
||||||
|
if (targetMode.active) return;
|
||||||
|
sta_VoiceType.value.forEach(mode => {
|
||||||
|
mode.active = mode.id === targetId;
|
||||||
|
if (mode.active) {
|
||||||
|
mode.switchStatusVioice = true;
|
||||||
|
} else {
|
||||||
|
mode.switchStatusVioice = false;
|
||||||
|
}
|
||||||
|
});
|
||||||
|
// 2. 调用强制报警接口
|
||||||
|
const params = {
|
||||||
|
deviceIds: [deviceId],
|
||||||
|
voiceStrobeAlarm: targetId === '-1' ? 0 : 1,
|
||||||
|
mode: targetId == '-1' ? 0 : targetId
|
||||||
|
};
|
||||||
|
try {
|
||||||
|
const res = await api.SosSetting(params);
|
||||||
|
if (res.code == 200) {
|
||||||
|
proxy?.$modal.msgSuccess(res.msg);
|
||||||
|
}
|
||||||
|
} catch (error) {
|
||||||
|
await getList()
|
||||||
|
}
|
||||||
|
};
|
||||||
|
// 警示灯模式
|
||||||
|
const handleModeClick = async (modeId: string) => {
|
||||||
|
if (isUpdatingStatus.value || isSyncingStatus.value) return;
|
||||||
|
try {
|
||||||
|
const deviceId = route.params.deviceId as string;
|
||||||
|
if (!deviceId) return;
|
||||||
|
const targetMode = lightModes.value.find(m => m.id === modeId);
|
||||||
|
if (!targetMode || !targetMode.instructValue) return;
|
||||||
|
isUpdatingStatus.value = true;
|
||||||
|
const res = await api.lightModeSettings({
|
||||||
|
deviceId,
|
||||||
|
instructValue: targetMode.instructValue,
|
||||||
|
deviceImei: deviceDetail.value.deviceImei,
|
||||||
|
typeName: deviceDetail.value.typeName,
|
||||||
|
});
|
||||||
|
if (res.code === 200) {
|
||||||
|
ElMessage.closeAll();
|
||||||
|
proxy?.$modal.msgSuccess(res.msg);
|
||||||
|
setActiveLightMode(modeId);
|
||||||
|
} else {
|
||||||
|
proxy?.$modal.msgError(res.msg);
|
||||||
|
const prevActiveMode = lightModes.value.find(m => m.active);
|
||||||
|
if (prevActiveMode) {
|
||||||
|
setActiveLightMode(prevActiveMode.id);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
} catch (error) {
|
||||||
|
// 异常时恢复状态
|
||||||
|
const prevActiveMode = lightModes.value.find(m => m.active);
|
||||||
|
if (prevActiveMode) {
|
||||||
|
setActiveLightMode(prevActiveMode.id);
|
||||||
|
}
|
||||||
|
} finally {
|
||||||
|
isUpdatingStatus.value = false;
|
||||||
|
}
|
||||||
|
};
|
||||||
|
const isSyncingStatus = ref(false);
|
||||||
|
// 警示灯接口
|
||||||
|
const setActiveLightMode = (targetModeId: string) => {
|
||||||
|
isSyncingStatus.value = true;
|
||||||
|
lightModes.value.forEach(mode => {
|
||||||
|
const isActive = mode.id === targetModeId;
|
||||||
|
mode.active = isActive;
|
||||||
|
mode.switchStatus = isActive;
|
||||||
|
});
|
||||||
|
isSyncingStatus.value = false;
|
||||||
|
};
|
||||||
|
const getList = async () => {
|
||||||
|
try {
|
||||||
|
const deviceId = route.params.deviceId;
|
||||||
|
if (!deviceId) return;
|
||||||
|
const res = await api.deviceDeatil(deviceId as string);
|
||||||
|
deviceDetail.value = res.data;
|
||||||
|
|
||||||
|
// ==========灯光模式逻辑==========
|
||||||
|
let targetModeId = "redBlueAlternate";
|
||||||
|
const mainLightMode = String(res.data.strobeMode);
|
||||||
|
const matchedMode = lightModes.value.find(
|
||||||
|
mode => mode.instructValue === mainLightMode
|
||||||
|
);
|
||||||
|
if (matchedMode) {
|
||||||
|
targetModeId = matchedMode.id;
|
||||||
|
}
|
||||||
|
setActiveLightMode(targetModeId);
|
||||||
|
// 报警模式
|
||||||
|
const alarmMode = String(res.data.alarmMode); // 报警模式ID
|
||||||
|
const voiceStrobeAlarm = String(res.data.voiceStrobeAlarm); // 报警开关状态:1开启,0关闭
|
||||||
|
// 先重置所有报警模式的状态
|
||||||
|
sta_VoiceType.value.forEach(mode => {
|
||||||
|
mode.active = false;
|
||||||
|
mode.switchStatusVioice = false;
|
||||||
|
});
|
||||||
|
if (voiceStrobeAlarm === '1') {
|
||||||
|
const matchedVoiceMode = sta_VoiceType.value.find(
|
||||||
|
mode => mode.id === alarmMode
|
||||||
|
);
|
||||||
|
if (matchedVoiceMode) {
|
||||||
|
matchedVoiceMode.active = true;
|
||||||
|
matchedVoiceMode.switchStatusVioice = true;
|
||||||
|
} else {
|
||||||
|
console.warn('未找到对应的报警模式:', alarmMode);
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
const closeMode = sta_VoiceType.value.find(mode => mode.id === '-1');
|
||||||
|
if (closeMode) {
|
||||||
|
closeMode.active = true;
|
||||||
|
closeMode.switchStatusVioice = true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
} catch (error) {
|
||||||
|
console.error('获取设备详情失败:', error);
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
// 灯光亮度
|
||||||
|
const saveBtnlight = () => {
|
||||||
|
lightModesLoading.value = true
|
||||||
|
let data = {
|
||||||
|
deviceId: route.params.deviceId,
|
||||||
|
brightness: deviceDetail.value.lightBrightness,
|
||||||
|
}
|
||||||
|
api.lightModeSettings(data).then((res) => {
|
||||||
|
if (res.code === 200) {
|
||||||
|
lightModesLoading.value = false
|
||||||
|
proxy?.$modal.msgSuccess(res.msg);
|
||||||
|
|
||||||
|
} else {
|
||||||
|
lightModesLoading.value = false
|
||||||
|
proxy?.$modal.msgError(res.msg);
|
||||||
|
}
|
||||||
|
|
||||||
|
}).catch((error) => {
|
||||||
|
lightModesLoading.value = false
|
||||||
|
});
|
||||||
|
}
|
||||||
|
// 爆闪频率
|
||||||
|
const saveBtnstrobe = () => {
|
||||||
|
let data = {
|
||||||
|
deviceId: route.params.deviceId,
|
||||||
|
frequency: deviceDetail.value.strobeFrequency,
|
||||||
|
}
|
||||||
|
api.staticPowerSetting(data).then((res) => {
|
||||||
|
if (res.code === 200) {
|
||||||
|
proxy?.$modal.msgSuccess(res.msg);
|
||||||
|
}
|
||||||
|
})
|
||||||
|
}
|
||||||
|
// 修改音量
|
||||||
|
const saveBtnVolume = () => {
|
||||||
|
let data = {
|
||||||
|
deviceId: route.params.deviceId,
|
||||||
|
volume: deviceDetail.value.volume,
|
||||||
|
}
|
||||||
|
api.settingUpdateVolume(data).then((res) => {
|
||||||
|
if (res.code === 200) {
|
||||||
|
proxy?.$modal.msgSuccess(res.msg);
|
||||||
|
}
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
// 解除报警
|
||||||
|
const showClose = async () => {
|
||||||
|
try {
|
||||||
|
await proxy?.$modal.confirm('确定要对该设备解除报警?', '提示');
|
||||||
|
// 2. 准备请求数据
|
||||||
|
let data = {
|
||||||
|
deviceIds: [route.params.deviceId],
|
||||||
|
typeName: deviceDetail.value.typeName,
|
||||||
|
deviceImeiList: [deviceDetail.value.deviceImei],
|
||||||
|
instructValue: '0', //强制报警1,解除报警0
|
||||||
|
}
|
||||||
|
} catch (error: any) {
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// 强制报警
|
||||||
|
const forceAlarm = async () => {
|
||||||
|
try {
|
||||||
|
await proxy?.$modal.confirm('确定要对该设备开启强制报警?', '提示');
|
||||||
|
forceAlarmLoading.value = true
|
||||||
|
// 2. 准备请求数据
|
||||||
|
let data = {
|
||||||
|
deviceIds: [route.params.deviceId],
|
||||||
|
typeName: deviceDetail.value.typeName,
|
||||||
|
deviceImeiList: [deviceDetail.value.deviceImei],
|
||||||
|
instructValue: '1', //强制报警1,解除报警0
|
||||||
|
}
|
||||||
|
|
||||||
|
} catch (error: any) {
|
||||||
|
// proxy?.$modal.msgWarning(error.msg)
|
||||||
|
forceAlarmLoading.value = false;
|
||||||
|
|
||||||
|
} finally {
|
||||||
|
forceAlarmLoading.value = false;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
const lookMap = (row: any) => {
|
||||||
|
console.log(row, 'rowrowrowrowrworowrowrowrowrowrow');
|
||||||
|
router.push({
|
||||||
|
path: '/controlCenter/controlPanel',
|
||||||
|
query: {
|
||||||
|
view: 'map',
|
||||||
|
deviceId: row.deviceId
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
onMounted(async () => {
|
||||||
|
await getList();
|
||||||
|
});
|
||||||
|
onUnmounted(() => {
|
||||||
|
});
|
||||||
|
|
||||||
|
</script>
|
||||||
|
<style lang="scss" scoped>
|
||||||
|
.p-2 {
|
||||||
|
background: rgba(247, 248, 252, 1);
|
||||||
|
min-height: 100vh;
|
||||||
|
box-sizing: border-box;
|
||||||
|
padding: 15px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.device-page {
|
||||||
|
.header-bar {
|
||||||
|
border-radius: 8px;
|
||||||
|
background: linear-gradient(135deg, #3400e7, #009bff);
|
||||||
|
color: white;
|
||||||
|
padding: 20px;
|
||||||
|
margin-bottom: 20px;
|
||||||
|
display: flex;
|
||||||
|
justify-content: space-between;
|
||||||
|
align-items: center;
|
||||||
|
font-weight: 600;
|
||||||
|
|
||||||
|
.device-status {
|
||||||
|
.online {
|
||||||
|
color: #00ff00;
|
||||||
|
}
|
||||||
|
|
||||||
|
.offline {
|
||||||
|
color: rgb(224, 52, 52);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
.content-wrapper {
|
||||||
|
.content-row {
|
||||||
|
margin-bottom: 10px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.content-card {
|
||||||
|
border-radius: 8px;
|
||||||
|
box-shadow: 0 2px 12px rgba(0, 34, 96, 0.1);
|
||||||
|
background: white;
|
||||||
|
padding: 0px 20px 50px;
|
||||||
|
border: 1px solid #ebeef5;
|
||||||
|
height: 289px;
|
||||||
|
position: relative;
|
||||||
|
}
|
||||||
|
|
||||||
|
.content-card_gps {
|
||||||
|
border-radius: 8px;
|
||||||
|
box-shadow: 0 2px 12px rgba(0, 34, 96, 0.1);
|
||||||
|
background: white;
|
||||||
|
padding: 0px 20px 50px;
|
||||||
|
border: 1px solid #ebeef5;
|
||||||
|
height: 78%;
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
.section-title {
|
||||||
|
font-size: 16px;
|
||||||
|
font-weight: 600;
|
||||||
|
margin-bottom: 20px;
|
||||||
|
color: #303133;
|
||||||
|
}
|
||||||
|
|
||||||
|
.light-mode {
|
||||||
|
display: flex;
|
||||||
|
|
||||||
|
justify-content: space-between;
|
||||||
|
}
|
||||||
|
|
||||||
|
.lacatin_gps {
|
||||||
|
height: 70px;
|
||||||
|
border-radius: 4px;
|
||||||
|
background: rgba(247, 248, 252, 1);
|
||||||
|
display: inline-block;
|
||||||
|
width: 400px;
|
||||||
|
padding: 10px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.mode-card {
|
||||||
|
display: flex;
|
||||||
|
flex-direction: column;
|
||||||
|
align-items: center;
|
||||||
|
padding: 15px;
|
||||||
|
border: 1px solid #dcdfe6;
|
||||||
|
border-radius: 8px;
|
||||||
|
width: 107px;
|
||||||
|
cursor: pointer;
|
||||||
|
transition: all 0.3s ease;
|
||||||
|
|
||||||
|
&.active {
|
||||||
|
border-color: #409eff;
|
||||||
|
background-color: rgba(64, 158, 255, 0.05);
|
||||||
|
}
|
||||||
|
|
||||||
|
.mode-icon {
|
||||||
|
width: 48px;
|
||||||
|
margin-bottom: 10px;
|
||||||
|
transition: all 0.3s ease;
|
||||||
|
object-fit: scale-down;
|
||||||
|
height: 50px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.mode-name {
|
||||||
|
font-size: 14px;
|
||||||
|
margin-bottom: 12px;
|
||||||
|
color: #606266;
|
||||||
|
}
|
||||||
|
|
||||||
|
.el-switch {
|
||||||
|
--el-switch-on-color: #409eff;
|
||||||
|
--el-switch-off-color: #dcdfe6;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
.brightness-alarm {
|
||||||
|
display: flex;
|
||||||
|
justify-content: space-between;
|
||||||
|
align-items: center;
|
||||||
|
margin-bottom: 10px;
|
||||||
|
|
||||||
|
.brightness-control {
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
gap: 10px;
|
||||||
|
border-radius: 39px;
|
||||||
|
// box-shadow: 0px 0px 6px 0px rgba(0, 34, 96, 0.1);
|
||||||
|
background: rgba(255, 255, 255, 1);
|
||||||
|
width: 100%;
|
||||||
|
// height: 54px;
|
||||||
|
padding: 10px 20px;
|
||||||
|
margin-top: 20px;
|
||||||
|
|
||||||
|
.brightness-label {
|
||||||
|
font-size: 14px;
|
||||||
|
color: #606266;
|
||||||
|
min-width: 70px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.brightness-value {
|
||||||
|
font-size: 14px;
|
||||||
|
color: #409eff;
|
||||||
|
font-weight: 500;
|
||||||
|
}
|
||||||
|
|
||||||
|
.save-btn {
|
||||||
|
padding: 6px 20px;
|
||||||
|
border-radius: 29px;
|
||||||
|
background: rgba(2, 124, 251, 1);
|
||||||
|
border: none
|
||||||
|
}
|
||||||
|
|
||||||
|
.inputTFT {
|
||||||
|
width: 130px;
|
||||||
|
height: 40px;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
.alarm-btn {
|
||||||
|
background-color: rgba(224, 52, 52, 1);
|
||||||
|
border-color: rgba(224, 52, 52, 1);
|
||||||
|
padding: 8px 20px;
|
||||||
|
border-radius: 27px;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
.location-info {
|
||||||
|
.location-item {
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
margin-bottom: 15px;
|
||||||
|
font-size: 14px;
|
||||||
|
color: #606266;
|
||||||
|
|
||||||
|
.location-icon {
|
||||||
|
margin-right: 8px;
|
||||||
|
font-weight: bold;
|
||||||
|
color: #409eff;
|
||||||
|
}
|
||||||
|
|
||||||
|
.view-btn {
|
||||||
|
margin: 0 8px;
|
||||||
|
padding: 0;
|
||||||
|
font-size: 13px;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
.form-grid {
|
||||||
|
display: grid;
|
||||||
|
grid-template-columns: 1fr 1fr;
|
||||||
|
gap: 15px;
|
||||||
|
margin-bottom: 15px;
|
||||||
|
text-align: right;
|
||||||
|
|
||||||
|
.form-item {
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
|
||||||
|
.form-label {
|
||||||
|
min-width: 35px;
|
||||||
|
font-size: 14px;
|
||||||
|
color: #606266;
|
||||||
|
margin-right: 10px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.el-input {
|
||||||
|
flex: 1;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
.register-btn {
|
||||||
|
grid-column: 1 / 3;
|
||||||
|
justify-self: start;
|
||||||
|
padding: 6px 20px;
|
||||||
|
position: absolute;
|
||||||
|
right: 19px;
|
||||||
|
bottom: 30px;
|
||||||
|
border-radius: 29px;
|
||||||
|
background: rgba(2, 124, 251, 1);
|
||||||
|
border: none
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
.message-content {
|
||||||
|
// display: flex;
|
||||||
|
// flex-direction: column;
|
||||||
|
// gap: 10px;
|
||||||
|
|
||||||
|
.el-textarea {
|
||||||
|
border: 1px solid rgba(29, 111, 255, 1);
|
||||||
|
border-radius: 4px;
|
||||||
|
background: rgba(247, 248, 252, 1);
|
||||||
|
border-radius: 6px;
|
||||||
|
padding: 10px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.el-textarea__inner {
|
||||||
|
background: rgba(247, 248, 252, 1);
|
||||||
|
}
|
||||||
|
|
||||||
|
.send-btn {
|
||||||
|
align-self: flex-end;
|
||||||
|
padding: 10px 20px;
|
||||||
|
border-radius: 29px;
|
||||||
|
background: rgba(2, 124, 251, 1);
|
||||||
|
border: none;
|
||||||
|
margin: 20px 0px 30px 0;
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
.upload-area {
|
||||||
|
display: flex;
|
||||||
|
justify-content: center;
|
||||||
|
align-items: center;
|
||||||
|
height: 100px;
|
||||||
|
border: 1px dashed #dcdfe6;
|
||||||
|
border-radius: 6px;
|
||||||
|
cursor: pointer;
|
||||||
|
}
|
||||||
|
|
||||||
|
.video-input {
|
||||||
|
display: flex;
|
||||||
|
gap: 10px;
|
||||||
|
align-items: center;
|
||||||
|
|
||||||
|
.el-input {
|
||||||
|
flex: 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
.save-video-btn {
|
||||||
|
padding: 6px 12px;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// 响应式调整
|
||||||
|
@media (max-width: 768px) {
|
||||||
|
.header-bar {
|
||||||
|
flex-direction: column;
|
||||||
|
align-items: flex-start;
|
||||||
|
gap: 16px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.form-grid {
|
||||||
|
grid-template-columns: 1fr;
|
||||||
|
}
|
||||||
|
|
||||||
|
.form-grid .register-btn {
|
||||||
|
grid-column: 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
.light-mode .mode-group {
|
||||||
|
gap: 10px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.light-mode .mode-item {
|
||||||
|
width: 60px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.light-mode .mode-icon {
|
||||||
|
width: 30px;
|
||||||
|
height: 30px;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
.path-img {
|
||||||
|
width: 52px;
|
||||||
|
height: 28px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.staticRwo {
|
||||||
|
border-radius: 8px;
|
||||||
|
box-shadow: 0 2px 12px rgba(0, 34, 96, 0.1);
|
||||||
|
background: white;
|
||||||
|
border: 1px solid #ebeef5;
|
||||||
|
height: auto;
|
||||||
|
line-height: 36px;
|
||||||
|
box-sizing: border-box;
|
||||||
|
text-indent: 15px;
|
||||||
|
color: #ff0000;
|
||||||
|
font-weight: bold;
|
||||||
|
font-size: 17px;
|
||||||
|
margin-bottom: 5px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.displayNone {
|
||||||
|
display: none !important;
|
||||||
|
}
|
||||||
|
</style>
|
||||||
14
src/views/controlCenter/210/index.vue
Normal file
@ -0,0 +1,14 @@
|
|||||||
|
<template>
|
||||||
|
<div class="device-page p-2">
|
||||||
|
这是210控制页面
|
||||||
|
</div>
|
||||||
|
</template>
|
||||||
|
<script setup lang="ts"></script>
|
||||||
|
<style lang="scss" scoped>
|
||||||
|
.p-2{
|
||||||
|
background: rgba(247, 248, 252, 1);
|
||||||
|
min-height: 100vh;
|
||||||
|
box-sizing: border-box;
|
||||||
|
padding: 15px;
|
||||||
|
}
|
||||||
|
</style>
|
||||||
@ -6,7 +6,7 @@
|
|||||||
<div>设备型号:{{ deviceDetail.deviceImei }}</div>
|
<div>设备型号:{{ deviceDetail.deviceImei }}</div>
|
||||||
<div class="device-status">设备状态:
|
<div class="device-status">设备状态:
|
||||||
<span :class="{ online: deviceDetail.onlineStatus === 1, offline: deviceDetail?.onlineStatus === 0 }">
|
<span :class="{ online: deviceDetail.onlineStatus === 1, offline: deviceDetail?.onlineStatus === 0 }">
|
||||||
{{ deviceDetail.onlineStatus === 1 ? "在线" : "离线" }}
|
{{ deviceDetail.onlineStatus === 1 ? '在线' : (deviceDetail.onlineStatus === 2 ? '故障' : '离线') }}
|
||||||
</span>
|
</span>
|
||||||
</div>
|
</div>
|
||||||
<div>电量:{{ deviceDetail.batteryPercentage || 0 }}%</div>
|
<div>电量:{{ deviceDetail.batteryPercentage || 0 }}%</div>
|
||||||
@ -15,6 +15,14 @@
|
|||||||
|
|
||||||
<!-- 主体内容区域 -->
|
<!-- 主体内容区域 -->
|
||||||
<div class="content-wrapper">
|
<div class="content-wrapper">
|
||||||
|
<el-row :gutter="20" class="content-row" :class="deviceDetail.alarmStatus == 1 ? '' : 'displayNone'" >
|
||||||
|
<el-col :lg="24" :xs="24">
|
||||||
|
<div class="staticRwo" :class="deviceDetail.alarmStatus == 1 ? '' : 'displayNone'"
|
||||||
|
@click="showClose()">
|
||||||
|
设备强制报警中!
|
||||||
|
</div>
|
||||||
|
</el-col>
|
||||||
|
</el-row>
|
||||||
<!-- 第一行:灯光模式 + 灯光亮度、强制报警、位置信息 -->
|
<!-- 第一行:灯光模式 + 灯光亮度、强制报警、位置信息 -->
|
||||||
<el-row :gutter="20" class="content-row">
|
<el-row :gutter="20" class="content-row">
|
||||||
<el-col :lg="16" :xs="24">
|
<el-col :lg="16" :xs="24">
|
||||||
@ -50,8 +58,8 @@
|
|||||||
:loading-text="lightModesLoading ? '保存中...' : '保存'"> {{
|
:loading-text="lightModesLoading ? '保存中...' : '保存'"> {{
|
||||||
lightModesLoading ? '保存中' : '保存' }}</el-button>
|
lightModesLoading ? '保存中' : '保存' }}</el-button>
|
||||||
</div>
|
</div>
|
||||||
<el-button type="danger" class="alarm-btn" @click="forceAlarm" :loading="forceAlarmLoading"
|
<el-button type="danger" class="alarm-btn" @click="forceAlarm" :loading="forceAlarmLoading" v-if="deviceDetail.alarmStatus === 0 || deviceDetail.alarmStatus === null"
|
||||||
:loading-text="forceAlarmLoading ? '报警中...' : '强制报警'"> {{
|
:loading-text="forceAlarmLoading ? '报警中...' : '强制报警'" > {{
|
||||||
forceAlarmLoading ? '报警中' : '强制报警' }}</el-button>
|
forceAlarmLoading ? '报警中' : '强制报警' }}</el-button>
|
||||||
</div>
|
</div>
|
||||||
<div class="content-card_gps">
|
<div class="content-card_gps">
|
||||||
@ -113,18 +121,32 @@
|
|||||||
<div class="message-content">
|
<div class="message-content">
|
||||||
<el-input type="textarea" class="textareaTFT" :rows="4" placeholder="现场危险,停止救援!紧急撤离至安全区域!"
|
<el-input type="textarea" class="textareaTFT" :rows="4" placeholder="现场危险,停止救援!紧急撤离至安全区域!"
|
||||||
v-model="deviceDetail.sendMsg" resize="none" />
|
v-model="deviceDetail.sendMsg" resize="none" />
|
||||||
<el-button type="primary" class="send-btn" @click="sendTextMessage"
|
<div style="text-align: end;clear: both;">
|
||||||
:loading="sendTextLoading" :loading-text="sendTextLoading ? '发送中...' : '发送'"> {{
|
<el-button type="primary" class="send-btn" @click="sendTextMessage"
|
||||||
sendTextLoading ? '发送中' : '发送' }}</el-button>
|
:loading="sendTextLoading" :loading-text="sendTextLoading ? '发送中...' : '发送'"> {{
|
||||||
|
sendTextLoading ? '发送中' : '发送' }}</el-button>
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
</el-col>
|
</el-col>
|
||||||
</el-row>
|
</el-row>
|
||||||
</div>
|
</div>
|
||||||
|
<!-- ===========充电提示框====== -->
|
||||||
|
<el-dialog title="充电提示" v-model="centerDialogVisible" width="15%">
|
||||||
|
<div style="display: flex; align-items: center;">
|
||||||
|
<h3 style="color: rgba(224, 52, 52, 1)">设备电量低于20%</h3>
|
||||||
|
</div>
|
||||||
|
<div>请及时充电</div>
|
||||||
|
<span slot="footer" class="dialog-footer" style="text-align: right;display: block;">
|
||||||
|
<el-button type="primary" @click="centerDialogVisible = false">确 定</el-button>
|
||||||
|
</span>
|
||||||
|
</el-dialog>
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
<script setup name="DeviceControl" lang="ts">
|
<script setup name="DeviceControl" lang="ts">
|
||||||
const route = useRoute();
|
const route = useRoute();
|
||||||
|
import { useMqtt } from '@/utils/mqtt';
|
||||||
import api from '@/api/controlCenter/controlPanel/index'
|
import api from '@/api/controlCenter/controlPanel/index'
|
||||||
import { DeviceDetail, LightMode } from '@/api/controlCenter/controlPanel/types';
|
import { DeviceDetail, LightMode } from '@/api/controlCenter/controlPanel/types';
|
||||||
import { generateShortId, getDeviceStatus } from '@/utils/function';
|
import { generateShortId, getDeviceStatus } from '@/utils/function';
|
||||||
@ -147,7 +169,16 @@ const fullscreenLoading = ref(false)
|
|||||||
const forceAlarmLoading = ref(false) //强制报警
|
const forceAlarmLoading = ref(false) //强制报警
|
||||||
const sendTextLoading = ref(false)
|
const sendTextLoading = ref(false)
|
||||||
const lightModesLoading = ref(false)
|
const lightModesLoading = ref(false)
|
||||||
|
const centerDialogVisible = ref(false)
|
||||||
|
const {
|
||||||
|
connected,
|
||||||
|
connect,
|
||||||
|
subscribe,
|
||||||
|
onConnect,
|
||||||
|
onError,
|
||||||
|
onMessage,
|
||||||
|
disconnect
|
||||||
|
} = useMqtt();
|
||||||
// 灯光模式数据(引用导入的图片)
|
// 灯光模式数据(引用导入的图片)
|
||||||
const lightModes = ref<LightMode[]>([
|
const lightModes = ref<LightMode[]>([
|
||||||
{
|
{
|
||||||
@ -206,7 +237,7 @@ const laserMode = ref<LightMode>({
|
|||||||
active: false
|
active: false
|
||||||
});
|
});
|
||||||
|
|
||||||
const deviceDetail = ref<DeviceDetail>({
|
const deviceDetail = ref<DeviceDetail & { typeName: string }>({
|
||||||
// 重点:personnelInfo 初始化为空对象,避免 undefined
|
// 重点:personnelInfo 初始化为空对象,避免 undefined
|
||||||
personnelInfo: {
|
personnelInfo: {
|
||||||
unitName: '',
|
unitName: '',
|
||||||
@ -223,7 +254,10 @@ const deviceDetail = ref<DeviceDetail>({
|
|||||||
longitude: '',
|
longitude: '',
|
||||||
latitude: '',
|
latitude: '',
|
||||||
address: '',
|
address: '',
|
||||||
sendMsg: ''
|
sendMsg: '',
|
||||||
|
chargeState: '0',
|
||||||
|
typeName: '',
|
||||||
|
alarmStatus: 0
|
||||||
});
|
});
|
||||||
// 保留原有的操作中标志位
|
// 保留原有的操作中标志位
|
||||||
const isUpdatingStatus = ref(false);
|
const isUpdatingStatus = ref(false);
|
||||||
@ -244,6 +278,7 @@ const handleModeClick = async (modeId: string) => {
|
|||||||
typeName: deviceDetail.value.typeName,
|
typeName: deviceDetail.value.typeName,
|
||||||
});
|
});
|
||||||
if (res.code === 200) {
|
if (res.code === 200) {
|
||||||
|
ElMessage.closeAll();
|
||||||
proxy?.$modal.msgSuccess(res.msg);
|
proxy?.$modal.msgSuccess(res.msg);
|
||||||
setActiveLightMode(modeId);
|
setActiveLightMode(modeId);
|
||||||
} else {
|
} else {
|
||||||
@ -254,7 +289,7 @@ const handleModeClick = async (modeId: string) => {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
proxy?.$modal.msgError("操作失败,请稍后重试");
|
// proxy?.$modal.msgError("操作失败,请稍后重试");
|
||||||
// 异常时恢复状态
|
// 异常时恢复状态
|
||||||
const prevActiveMode = lightModes.value.find(m => m.active);
|
const prevActiveMode = lightModes.value.find(m => m.active);
|
||||||
if (prevActiveMode) {
|
if (prevActiveMode) {
|
||||||
@ -300,7 +335,7 @@ const getList = async () => {
|
|||||||
targetModeId = matchedMode.id;
|
targetModeId = matchedMode.id;
|
||||||
}
|
}
|
||||||
setActiveLightMode(targetModeId);
|
setActiveLightMode(targetModeId);
|
||||||
const laserStatus = res.data.laserModeStatus ?? 0;
|
const laserStatus = Number(res.data.laserLightMode);
|
||||||
laserMode.value.active = laserStatus === 1;
|
laserMode.value.active = laserStatus === 1;
|
||||||
laserMode.value.switchStatus = laserStatus === 1;
|
laserMode.value.switchStatus = laserStatus === 1;
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
@ -321,6 +356,7 @@ const handleLaserClick = async () => {
|
|||||||
instructValue: targetStatus ? 1 : 0
|
instructValue: targetStatus ? 1 : 0
|
||||||
});
|
});
|
||||||
if (res.code === 200) {
|
if (res.code === 200) {
|
||||||
|
ElMessage.closeAll();
|
||||||
proxy?.$modal.msgSuccess(res.msg);
|
proxy?.$modal.msgSuccess(res.msg);
|
||||||
laserMode.value.active = targetStatus;
|
laserMode.value.active = targetStatus;
|
||||||
laserMode.value.switchStatus = targetStatus;
|
laserMode.value.switchStatus = targetStatus;
|
||||||
@ -330,7 +366,7 @@ const handleLaserClick = async () => {
|
|||||||
laserMode.value.switchStatus = !targetStatus;
|
laserMode.value.switchStatus = !targetStatus;
|
||||||
}
|
}
|
||||||
} catch (error: any) {
|
} catch (error: any) {
|
||||||
proxy?.$modal.msgError(error.msg);
|
// proxy?.$modal.msgError(error.msg);
|
||||||
// 恢复之前的状态
|
// 恢复之前的状态
|
||||||
laserMode.value.switchStatus = !laserMode.value.switchStatus;
|
laserMode.value.switchStatus = !laserMode.value.switchStatus;
|
||||||
} finally { }
|
} finally { }
|
||||||
@ -339,18 +375,22 @@ const handleLaserClick = async () => {
|
|||||||
// 人员信息发送
|
// 人员信息发送
|
||||||
const registerPostInit = () => {
|
const registerPostInit = () => {
|
||||||
if (!deviceDetail.value.personnelInfo.unitName) {
|
if (!deviceDetail.value.personnelInfo.unitName) {
|
||||||
|
ElMessage.closeAll();
|
||||||
proxy?.$modal.msgWarning('单位名称不能为空');
|
proxy?.$modal.msgWarning('单位名称不能为空');
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
if (!deviceDetail.value.personnelInfo.name) {
|
if (!deviceDetail.value.personnelInfo.name) {
|
||||||
|
ElMessage.closeAll();
|
||||||
proxy?.$modal.msgWarning('姓名不能为空');
|
proxy?.$modal.msgWarning('姓名不能为空');
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
if (!deviceDetail.value.personnelInfo.position) {
|
if (!deviceDetail.value.personnelInfo.position) {
|
||||||
|
ElMessage.closeAll();
|
||||||
proxy?.$modal.msgWarning('职位不能为空');
|
proxy?.$modal.msgWarning('职位不能为空');
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
if (!deviceDetail.value.personnelInfo.code) {
|
if (!deviceDetail.value.personnelInfo.code) {
|
||||||
|
ElMessage.closeAll();
|
||||||
proxy?.$modal.msgWarning('ID不能为空');
|
proxy?.$modal.msgWarning('ID不能为空');
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
@ -389,14 +429,60 @@ const saveBtn = () => {
|
|||||||
|
|
||||||
} else {
|
} else {
|
||||||
lightModesLoading.value = false
|
lightModesLoading.value = false
|
||||||
proxy?.$modal.msgError(res.msg);
|
//proxy?.$modal.msgError(res.msg);
|
||||||
}
|
}
|
||||||
|
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
// 解除报警
|
||||||
|
const showClose = async () => {
|
||||||
|
try {
|
||||||
|
await proxy?.$modal.confirm('确定要对该设备解除报警?', '提示');
|
||||||
|
// 2. 准备请求数据
|
||||||
|
const batchId = generateShortId();
|
||||||
|
let data = {
|
||||||
|
deviceIds: [route.params.deviceId],
|
||||||
|
typeName: deviceDetail.value.typeName,
|
||||||
|
deviceImeiList: [deviceDetail.value.deviceImei],
|
||||||
|
batchId: batchId,
|
||||||
|
instructValue: '0', //强制报警1,解除报警0
|
||||||
|
}
|
||||||
|
const registerRes = await api.sendAlarmMessage(data);
|
||||||
|
if (registerRes.code !== 200) {
|
||||||
|
proxy?.$modal.msgWarning(registerRes.msg)
|
||||||
|
return
|
||||||
|
}
|
||||||
|
// 4. 获取设备状态
|
||||||
|
let deviceImei = deviceDetail.value.deviceImei
|
||||||
|
const statusRes = await getDeviceStatus({
|
||||||
|
functionMode: 2,
|
||||||
|
batchId,
|
||||||
|
typeName: 'FunctionAccessBatchStatusRule',
|
||||||
|
deviceImei,
|
||||||
|
interval: 500
|
||||||
|
},
|
||||||
|
api.deviceRealTimeStatus
|
||||||
|
);
|
||||||
|
// 只有当状态为'OK'时才显示成功弹窗
|
||||||
|
if (statusRes.data.functionAccess === 'OK') {
|
||||||
|
proxy?.$modal.msgSuccess(statusRes.msg);
|
||||||
|
await getList();
|
||||||
|
}
|
||||||
|
|
||||||
|
} catch (error: any) {
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
// 强制报警
|
// 强制报警
|
||||||
const forceAlarm = async () => {
|
const forceAlarm = async () => {
|
||||||
try {
|
try {
|
||||||
|
await proxy?.$modal.confirm('确定要对该设备开启强制报警?', '提示');
|
||||||
forceAlarmLoading.value = true
|
forceAlarmLoading.value = true
|
||||||
// 2. 准备请求数据
|
// 2. 准备请求数据
|
||||||
const batchId = generateShortId();
|
const batchId = generateShortId();
|
||||||
@ -426,10 +512,12 @@ const forceAlarm = async () => {
|
|||||||
// 只有当状态为'OK'时才显示成功弹窗
|
// 只有当状态为'OK'时才显示成功弹窗
|
||||||
if (statusRes.data.functionAccess === 'OK') {
|
if (statusRes.data.functionAccess === 'OK') {
|
||||||
proxy?.$modal.msgSuccess(statusRes.msg);
|
proxy?.$modal.msgSuccess(statusRes.msg);
|
||||||
|
await getList();
|
||||||
}
|
}
|
||||||
|
|
||||||
} catch (error: any) {
|
} catch (error: any) {
|
||||||
proxy?.$modal.msgWarning(error.msg)
|
// proxy?.$modal.msgWarning(error.msg)
|
||||||
|
forceAlarmLoading.value = false;
|
||||||
|
|
||||||
} finally {
|
} finally {
|
||||||
forceAlarmLoading.value = false;
|
forceAlarmLoading.value = false;
|
||||||
@ -439,6 +527,7 @@ const forceAlarm = async () => {
|
|||||||
const sendTextMessage = async () => {
|
const sendTextMessage = async () => {
|
||||||
// 防重复提交
|
// 防重复提交
|
||||||
if (!deviceDetail.value.sendMsg) {
|
if (!deviceDetail.value.sendMsg) {
|
||||||
|
ElMessage.closeAll();
|
||||||
proxy?.$modal.msgWarning('发送信息不能为空');
|
proxy?.$modal.msgWarning('发送信息不能为空');
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@ -490,13 +579,129 @@ const lookMap = (row: any) => {
|
|||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
const getMainLightModeLabel = (mode: any) => {
|
||||||
|
const modeMap = {
|
||||||
|
0: 'close', // 0 → 关闭
|
||||||
|
1: 'strong', // 1 → 强光
|
||||||
|
2: 'weak', // 2 → 弱光
|
||||||
|
3: 'strobe', // 3 → 爆闪
|
||||||
|
4: 'flood' // 4 → 泛光
|
||||||
|
}
|
||||||
|
return modeMap[mode] || (console.log('未知的灯光模式:', mode), '未知');
|
||||||
|
}
|
||||||
|
// 处理设备消息
|
||||||
|
const handleDeviceMessage = (msg: any) => {
|
||||||
|
try {
|
||||||
|
const payloadObj = JSON.parse(msg.payload.toString());
|
||||||
|
const deviceState = payloadObj.state; // 设备状态数组
|
||||||
|
if (!Array.isArray(deviceState)) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
switch (deviceState[0]) {
|
||||||
|
case 1:
|
||||||
|
// 类型1灯光主键
|
||||||
|
const lightModeId = getMainLightModeLabel(deviceState[1]);
|
||||||
|
const brightness = deviceState[2]; // 亮度值
|
||||||
|
const batteryTime = deviceState[3]; // 续航时间
|
||||||
|
console.log('灯光模式消息:', { 模式ID: lightModeId, 亮度: brightness, 续航: batteryTime });
|
||||||
|
// 1. 同步灯光模式状态
|
||||||
|
if (lightModeId !== 'unknown') {
|
||||||
|
lightModes.value.forEach(mode => {
|
||||||
|
const isActive = mode.id === lightModeId;
|
||||||
|
mode.active = isActive;
|
||||||
|
mode.switchStatus = isActive;
|
||||||
|
});
|
||||||
|
}
|
||||||
|
// 2.亮度
|
||||||
|
if (brightness !== undefined) {
|
||||||
|
deviceDetail.value.lightBrightness = brightness.toString();
|
||||||
|
}
|
||||||
|
// 3.续航时间
|
||||||
|
if (batteryTime !== undefined) {
|
||||||
|
deviceDetail.value.batteryRemainingTime = batteryTime.toString();
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
case 12:
|
||||||
|
// 灯光主键
|
||||||
|
const lightModeIdA = getMainLightModeLabel(deviceState[1]);
|
||||||
|
if (lightModeIdA !== 'unknown') {
|
||||||
|
lightModes.value.forEach(mode => {
|
||||||
|
const isActive = mode.id === lightModeIdA;
|
||||||
|
mode.active = isActive;
|
||||||
|
mode.switchStatus = isActive;
|
||||||
|
});
|
||||||
|
}
|
||||||
|
// 激光
|
||||||
|
const laserValue = deviceState[2];
|
||||||
|
// 同步激光模式状态:1=开启(true),0=关闭(false)
|
||||||
|
laserMode.value.active = laserValue === 1;
|
||||||
|
laserMode.value.switchStatus = laserValue === 1;
|
||||||
|
deviceDetail.value.batteryPercentage = deviceState[3]; //电量
|
||||||
|
deviceDetail.value.batteryRemainingTime = deviceState[5]; //续航时间
|
||||||
|
// getList(); // 重新获取设备详情
|
||||||
|
if (deviceDetail.value.batteryPercentage < 20 && Number(deviceDetail.value.chargeState) == 0) {
|
||||||
|
centerDialogVisible.value = true
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
case 7:
|
||||||
|
deviceDetail.value.alarmStatus = deviceState[1];
|
||||||
|
|
||||||
onMounted(() => {
|
break;
|
||||||
getList();
|
default:
|
||||||
|
console.log('未处理的消息类型:', deviceState[0]);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
} catch (e) {
|
||||||
|
}
|
||||||
|
};
|
||||||
|
onMounted(async () => {
|
||||||
|
await getList();
|
||||||
|
// 连接mqtt
|
||||||
|
onConnect(async () => {
|
||||||
|
const deviceImei = deviceDetail.value.deviceImei;
|
||||||
|
if (!deviceImei) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
try {
|
||||||
|
await subscribe(`A/${deviceImei}`, { qos: 1 });
|
||||||
|
console.log('订阅成功');
|
||||||
|
} catch (err) {
|
||||||
|
console.error('订阅失败(onConnect内):', err);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
// 2. 注册消息接收回调(核心:处理设备发送的消息)
|
||||||
|
onMessage((msg) => {
|
||||||
|
console.log('收到新消息:', {
|
||||||
|
主题: msg.topic,
|
||||||
|
内容: msg.payload,
|
||||||
|
时间: msg.time,
|
||||||
|
QoS: msg.qos
|
||||||
|
});
|
||||||
|
// 在这里处理消息(根据实际业务逻辑)
|
||||||
|
handleDeviceMessage(msg);
|
||||||
|
});
|
||||||
|
onError((err) => {
|
||||||
|
console.error('MQTT连接失败原因:', err.message);
|
||||||
|
});
|
||||||
|
connect();
|
||||||
|
});
|
||||||
|
onUnmounted(() => {
|
||||||
|
// 只有当连接已建立时,才执行断开操作(避免无效调用)
|
||||||
|
if (connected.value) {
|
||||||
|
console.log('页面离开,断开MQTT连接');
|
||||||
|
disconnect(); // 调用断开连接方法
|
||||||
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
</script>
|
</script>
|
||||||
<style lang="scss" scoped>
|
<style lang="scss" scoped>
|
||||||
|
.p-2 {
|
||||||
|
background: rgba(247, 248, 252, 1);
|
||||||
|
min-height: 100vh;
|
||||||
|
box-sizing: border-box;
|
||||||
|
padding: 15px;
|
||||||
|
}
|
||||||
|
|
||||||
.device-page {
|
.device-page {
|
||||||
.header-bar {
|
.header-bar {
|
||||||
border-radius: 8px;
|
border-radius: 8px;
|
||||||
@ -513,6 +718,10 @@ onMounted(() => {
|
|||||||
.online {
|
.online {
|
||||||
color: #00ff00;
|
color: #00ff00;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.offline {
|
||||||
|
color: rgb(224, 52, 52);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -527,7 +736,7 @@ onMounted(() => {
|
|||||||
background: white;
|
background: white;
|
||||||
padding: 0px 20px 50px;
|
padding: 0px 20px 50px;
|
||||||
border: 1px solid #ebeef5;
|
border: 1px solid #ebeef5;
|
||||||
height: 100%;
|
height: 289px;
|
||||||
position: relative;
|
position: relative;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -710,9 +919,9 @@ onMounted(() => {
|
|||||||
}
|
}
|
||||||
|
|
||||||
.message-content {
|
.message-content {
|
||||||
display: flex;
|
// display: flex;
|
||||||
flex-direction: column;
|
// flex-direction: column;
|
||||||
gap: 10px;
|
// gap: 10px;
|
||||||
|
|
||||||
.el-textarea {
|
.el-textarea {
|
||||||
border: 1px solid rgba(29, 111, 255, 1);
|
border: 1px solid rgba(29, 111, 255, 1);
|
||||||
@ -731,7 +940,9 @@ onMounted(() => {
|
|||||||
padding: 10px 20px;
|
padding: 10px 20px;
|
||||||
border-radius: 29px;
|
border-radius: 29px;
|
||||||
background: rgba(2, 124, 251, 1);
|
background: rgba(2, 124, 251, 1);
|
||||||
border: none
|
border: none;
|
||||||
|
margin: 20px 0px 30px 0;
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -790,4 +1001,28 @@ onMounted(() => {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
</style>
|
|
||||||
|
.path-img {
|
||||||
|
width: 52px;
|
||||||
|
height: 28px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.staticRwo {
|
||||||
|
border-radius: 8px;
|
||||||
|
box-shadow: 0 2px 12px rgba(0, 34, 96, 0.1);
|
||||||
|
background: white;
|
||||||
|
border: 1px solid #ebeef5;
|
||||||
|
height: auto;
|
||||||
|
line-height: 36px;
|
||||||
|
box-sizing: border-box;
|
||||||
|
text-indent: 15px;
|
||||||
|
color: #ff0000;
|
||||||
|
font-weight: bold;
|
||||||
|
font-size: 17px;
|
||||||
|
margin-bottom: 5px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.displayNone {
|
||||||
|
display: none !important;
|
||||||
|
}
|
||||||
|
</style>
|
||||||
|
|||||||
1097
src/views/controlCenter/670/index.vue
Normal file
@ -2,20 +2,17 @@
|
|||||||
<div class="amap_page">
|
<div class="amap_page">
|
||||||
<div ref="mapRef" class="amap-container"></div>
|
<div ref="mapRef" class="amap-container"></div>
|
||||||
<div class="content_top">
|
<div class="content_top">
|
||||||
|
<!-- 左侧列表内容保持不变 -->
|
||||||
<div class="content_layout">
|
<div class="content_layout">
|
||||||
<!-- 左侧设备列表(带复选框) -->
|
|
||||||
<div class="device_list">
|
<div class="device_list">
|
||||||
<!-- 全选复选框 -->
|
<div class="list_header" v-if="!isSingleDevice">
|
||||||
<div class="list_header">
|
|
||||||
<el-checkbox v-model="checkAll" @change="handleCheckAllChange" label="全选"></el-checkbox>
|
<el-checkbox v-model="checkAll" @change="handleCheckAllChange" label="全选"></el-checkbox>
|
||||||
</div>
|
</div>
|
||||||
|
<div class="device_item" v-for="(device, index) in effectiveDeviceList" :key="device.id">
|
||||||
|
<el-checkbox :value="device.id" :model-value="checkedDeviceIds.includes(device.id)"
|
||||||
|
@update:model-value="(checked: boolean) => handleCheckboxChange(checked, device.id)"
|
||||||
|
class="device_checkbox" :hidden="isSingleDevice" :disabled="device.onlineStatus==0"></el-checkbox>
|
||||||
|
|
||||||
<!-- 设备项(带复选框) -->
|
|
||||||
<div class="device_item" v-for="(device, index) in props.deviceList" :key="index">
|
|
||||||
<!-- 复选框 -->
|
|
||||||
<el-checkbox :value="device.id" v-model="checkedDeviceIds" class="device_checkbox"></el-checkbox>
|
|
||||||
|
|
||||||
<!-- 设备信息 -->
|
|
||||||
<div class="device_page">
|
<div class="device_page">
|
||||||
<div class="device_info">
|
<div class="device_info">
|
||||||
<div class="device_name">{{ device.deviceName }}</div>
|
<div class="device_name">{{ device.deviceName }}</div>
|
||||||
@ -25,124 +22,192 @@
|
|||||||
{{ device.onlineStatus === 1 ? '在线' : '离线' }}
|
{{ device.onlineStatus === 1 ? '在线' : '离线' }}
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<!-- 控制按钮 -->
|
|
||||||
<el-button class="control_btn" @click="handleControl(device)">控制</el-button>
|
<el-button class="control_btn" @click="handleControl(device)">控制</el-button>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
<div v-if="effectiveDeviceList.length === 0" class="nodata">
|
||||||
|
<img src="@/assets/images/nodata.png" alt="" class="nodataImg">
|
||||||
|
<div class="title">暂无数据</div>
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script setup lang="ts">
|
<script setup lang="ts">
|
||||||
import {deviceVO } from '@/api/controlCenter/controlPanel/types';
|
import { deviceVO } from '@/api/controlCenter/controlPanel/types';
|
||||||
|
import { useRouter, useRoute } from 'vue-router';
|
||||||
|
import strongLightDefault from '@/assets/images/position_ico.png';
|
||||||
const props = defineProps({
|
const props = defineProps({
|
||||||
deviceList: {
|
deviceList: {
|
||||||
type: Array as PropType<deviceVO[]>, // 用PropType指定数组元素为DeviceItem
|
type: Array as PropType<deviceVO[]>,
|
||||||
required: false,
|
required: false,
|
||||||
default: () => [] // 数组/对象类型的默认值必须用函数返回,避免引用共享
|
default: () => []
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
console.log(props.deviceList);
|
|
||||||
const router = useRouter();
|
const router = useRouter();
|
||||||
// 声明高德地图全局类型
|
const route = useRoute();
|
||||||
declare var AMap: any;
|
declare var AMap: any;
|
||||||
// 地图实例
|
// 核心状态
|
||||||
const mapRef = ref<HTMLDivElement | null>(null);
|
const mapRef = ref<HTMLDivElement | null>(null);
|
||||||
let mapInstance: any = null;
|
let mapInstance: any = null;
|
||||||
// 复选框状态管理
|
let infoWindow: any = null; // 信息窗口实例
|
||||||
const checkedDeviceIds = ref(); // 存储选中的设备ID
|
const singleDeviceId = ref<string | null>(null);
|
||||||
const checkAll = ref(false); // 全选状态
|
const effectiveDeviceList = ref<deviceVO[]>([]);
|
||||||
// 全选/取消全选
|
const checkedDeviceIds = ref<string[]>([]); // 明确为字符串数组
|
||||||
const handleCheckAllChange = (val: boolean) => {
|
const checkAll = ref(false);
|
||||||
checkedDeviceIds.value = val
|
const isSingleDevice = ref(false);
|
||||||
? props.deviceList.map(device => device.id) // 全选:选中所有设备ID
|
const activeDeviceName = ref(); // 当前激活的设备名称
|
||||||
: []; // 取消全选:清空
|
// 初始化设备ID
|
||||||
|
const initSingleDeviceId = () => {
|
||||||
|
const idFromParams = route.params.deviceId as string;
|
||||||
|
const idFromQuery = route.query.deviceId as string;
|
||||||
|
singleDeviceId.value = idFromParams || idFromQuery || null;
|
||||||
|
isSingleDevice.value = !!singleDeviceId.value;
|
||||||
|
console.log('单设备模式:', isSingleDevice.value, '设备ID:', singleDeviceId.value);
|
||||||
};
|
};
|
||||||
|
const initDeviceList = () => {
|
||||||
|
if (!props.deviceList || !props.deviceList.length) {
|
||||||
|
effectiveDeviceList.value = [];
|
||||||
|
console.log('设备列表为空');
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
// 监听单个复选框变化,更新全选状态
|
if (isSingleDevice.value && singleDeviceId.value) {
|
||||||
watch(checkedDeviceIds, (newVal) => {
|
const targetDevice = props.deviceList.find(
|
||||||
checkAll.value = newVal.length === props.deviceList.length && props.deviceList.length > 0;
|
device => String(device.id) === String(singleDeviceId.value)
|
||||||
});
|
);
|
||||||
|
if (targetDevice) {
|
||||||
// 设备控制事件
|
effectiveDeviceList.value = [targetDevice]; // 只显示匹配的单个设备
|
||||||
const handleControl = (device: any) => {
|
checkedDeviceIds.value = [targetDevice.id];
|
||||||
console.log('控制设备:', device);
|
activeDeviceName.value = targetDevice.deviceName;
|
||||||
const deviceId = device.id;
|
} else {
|
||||||
router.push('/controlCenter/6170/' + deviceId);
|
effectiveDeviceList.value = []; // 未找到匹配设备
|
||||||
};
|
}
|
||||||
// 新增:获取地图中心坐标(优先用设备数据,无则用默认)
|
|
||||||
const getCenterCoord = () => {
|
|
||||||
// 1. 遍历设备列表,找第一个有有效经纬度的设备
|
|
||||||
const validDevice = props.deviceList.find(
|
|
||||||
(device:any) =>
|
|
||||||
device.longitude !== undefined &&
|
|
||||||
device.longitude !== null &&
|
|
||||||
device.latitude !== undefined &&
|
|
||||||
device.latitude !== null &&
|
|
||||||
!isNaN(Number(device.longitude)) && // 确保是数字(避免字符串空值/非数字)
|
|
||||||
!isNaN(Number(device.latitude))
|
|
||||||
);
|
|
||||||
|
|
||||||
// 2. 有有效设备则用它的坐标,否则用默认值
|
|
||||||
if (validDevice) {
|
|
||||||
return [Number(validDevice.longitude), Number(validDevice.latitude)]; // 转数字防字符串坐标
|
|
||||||
} else {
|
} else {
|
||||||
return [114.4074, 30.5928]; // 默认中心坐标
|
// 多设备模式:显示所有设备
|
||||||
|
effectiveDeviceList.value = props.deviceList;
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
// 地图初始化(修改center配置)
|
// 初始化地图(重点修复部分)
|
||||||
const initMap = () => {
|
const initMap = async () => {
|
||||||
if (!window.AMap || !mapRef.value) return;
|
await nextTick();
|
||||||
// 2. 调用函数获取中心坐标(不再用固定值)
|
if (!window.AMap || !mapRef.value) {
|
||||||
const centerCoord = getCenterCoord();
|
return;
|
||||||
|
}
|
||||||
|
// 销毁旧实例
|
||||||
|
if (mapInstance) mapInstance.destroy();
|
||||||
|
// 创建地图实例(确保容器DOM已渲染)
|
||||||
mapInstance = new AMap.Map(mapRef.value, {
|
mapInstance = new AMap.Map(mapRef.value, {
|
||||||
center: centerCoord, // 改用动态获取的坐标
|
center: getCenterCoord(),
|
||||||
zoom: 15,
|
zoom: isSingleDevice.value ? 8 : 8,
|
||||||
resizeEnable: true
|
resizeEnable: true
|
||||||
});
|
});
|
||||||
// 后续的设备打点逻辑不变...
|
|
||||||
if (Array.isArray(props.deviceList)) {
|
// 初始化信息窗口(用于显示设备名称)
|
||||||
props.deviceList.forEach(device => {
|
infoWindow = new AMap.InfoWindow({
|
||||||
console.log(device, 'devicedevice');
|
offset: new AMap.Pixel(0, -30) // 偏移量,避免遮挡标记
|
||||||
if (device.longitude && device.latitude) {
|
});
|
||||||
new AMap.Marker({
|
|
||||||
position: [device.longitude, device.latitude],
|
// 渲染标记
|
||||||
title: device.deviceName,
|
renderMarkers();
|
||||||
map: mapInstance
|
};
|
||||||
});
|
|
||||||
}
|
// 获取中心坐标(确保数字类型)
|
||||||
|
const getCenterCoord = () => {
|
||||||
|
if (!effectiveDeviceList.value.length) {
|
||||||
|
return [114.4074, 30.5928];
|
||||||
|
}
|
||||||
|
// 遍历找第一个有效坐标
|
||||||
|
const validDevice = effectiveDeviceList.value.find(device => {
|
||||||
|
const lng = Number(device.longitude);
|
||||||
|
const lat = Number(device.latitude);
|
||||||
|
return !isNaN(lng) && !isNaN(lat) && lng !== 0 && lat !== 0;
|
||||||
|
});
|
||||||
|
if (validDevice) {
|
||||||
|
const lng = Number(validDevice.longitude);
|
||||||
|
const lat = Number(validDevice.latitude);
|
||||||
|
return [lng, lat];
|
||||||
|
}
|
||||||
|
// 无有效坐标时用默认
|
||||||
|
return [114.4074, 30.5928];
|
||||||
|
};
|
||||||
|
|
||||||
|
// 渲染标记(核心修复点)
|
||||||
|
const renderMarkers = () => {
|
||||||
|
if (!mapInstance || !effectiveDeviceList.value.length) return;
|
||||||
|
mapInstance.clearMap();
|
||||||
|
effectiveDeviceList.value.forEach(device => {
|
||||||
|
const lng = device.longitude !== null && device.longitude !== undefined ? Number(device.longitude) : NaN;
|
||||||
|
const lat = device.latitude !== null && device.latitude !== undefined ? Number(device.latitude) : NaN;
|
||||||
|
if (isNaN(lng) || isNaN(lat) || lng === 0 || lat === 0) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
// 3. 创建标记(确保绑定到地图实例)
|
||||||
|
const marker = new AMap.Marker({
|
||||||
|
position: [lng, lat],
|
||||||
|
title: device.deviceName,
|
||||||
|
map: mapInstance,
|
||||||
|
icon: new AMap.Icon({
|
||||||
|
size: new AMap.Size(32, 32), // Marker显示尺寸
|
||||||
|
image: strongLightDefault,
|
||||||
|
imageSize: new AMap.Size(32, 32)
|
||||||
|
})
|
||||||
});
|
});
|
||||||
|
|
||||||
|
// 4. 标记点击事件
|
||||||
|
marker.on('click', () => {
|
||||||
|
activeDeviceName.value = device.deviceName;
|
||||||
|
infoWindow.setContent(`<div style="padding:8px">${device.deviceName}</div>`);
|
||||||
|
infoWindow.open(mapInstance, [lng, lat]);
|
||||||
|
});
|
||||||
|
});
|
||||||
|
};
|
||||||
|
|
||||||
|
// 全选处理
|
||||||
|
const handleCheckAllChange = (val: boolean) => {
|
||||||
|
if (isSingleDevice.value) return;
|
||||||
|
checkedDeviceIds.value = val ? effectiveDeviceList.value.map(d => d.id) : [];
|
||||||
|
};
|
||||||
|
|
||||||
|
// 处理单个复选框变更
|
||||||
|
const handleCheckboxChange = (checked: boolean, deviceId: string) => {
|
||||||
|
if (isSingleDevice.value) return;
|
||||||
|
if (checked) {
|
||||||
|
if (!checkedDeviceIds.value.includes(deviceId)) {
|
||||||
|
checkedDeviceIds.value.push(deviceId);
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
const index = checkedDeviceIds.value.indexOf(deviceId);
|
||||||
|
if (index > -1) {
|
||||||
|
checkedDeviceIds.value.splice(index, 1);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
watch(
|
|
||||||
() => props.deviceList, // 监听props中的deviceList
|
|
||||||
(newDeviceList) => {
|
|
||||||
if (!mapInstance || !Array.isArray(newDeviceList)) return;
|
|
||||||
// 1. 清除地图上已有的所有标记(避免重复打点)
|
|
||||||
mapInstance.clearMap();
|
|
||||||
// 2. 重新添加新的设备标记
|
|
||||||
newDeviceList.forEach((device:any) => {
|
|
||||||
console.log(device, 'device');
|
|
||||||
// 确保设备有经纬度(lng和lat),避免无效打点
|
|
||||||
if (device.longitude && device.latitude) {
|
|
||||||
new AMap.Marker({
|
|
||||||
position: [device.longitude, device.latitude],
|
|
||||||
title: device.deviceName, // 用设备名当标题(匹配父组件字段)
|
|
||||||
map: mapInstance,
|
|
||||||
});
|
|
||||||
}
|
|
||||||
});
|
|
||||||
},
|
|
||||||
{ deep: true } // 深度监听(如果设备列表里的子对象变化也能触发)
|
|
||||||
);
|
|
||||||
|
|
||||||
|
// 控制按钮点击
|
||||||
|
const handleControl = (device: deviceVO) => {
|
||||||
|
router.push(`/controlCenter/6170/${device.id}`);
|
||||||
|
};
|
||||||
|
|
||||||
|
// 监听路由和设备列表变化
|
||||||
|
watch(() => [route.params, route.query], () => {
|
||||||
|
initSingleDeviceId();
|
||||||
|
initDeviceList();
|
||||||
|
initMap();
|
||||||
|
}, { deep: true });
|
||||||
|
|
||||||
|
watch(() => props.deviceList, () => {
|
||||||
|
initDeviceList();
|
||||||
|
renderMarkers();
|
||||||
|
}, { deep: true });
|
||||||
|
|
||||||
|
// 初始化
|
||||||
onMounted(() => {
|
onMounted(() => {
|
||||||
initMap();
|
initSingleDeviceId();
|
||||||
|
initDeviceList();
|
||||||
|
initMap();
|
||||||
});
|
});
|
||||||
|
|
||||||
onUnmounted(() => {
|
onUnmounted(() => {
|
||||||
@ -151,55 +216,51 @@ onUnmounted(() => {
|
|||||||
</script>
|
</script>
|
||||||
|
|
||||||
<style scoped>
|
<style scoped>
|
||||||
/* 地图容器 */
|
/* 原有样式保持不变 */
|
||||||
.amap_page {
|
.amap_page {
|
||||||
position: relative;
|
position: relative;
|
||||||
}
|
}
|
||||||
|
|
||||||
.amap-container {
|
.amap-container {
|
||||||
height: 640px;
|
height: calc(100vh - 25vh);
|
||||||
border-radius: 4px;
|
border-radius: 4px;
|
||||||
overflow: hidden;
|
overflow: hidden;
|
||||||
width: 100%;
|
width: 100%;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* 设备名称提示框 */
|
||||||
.content_top {
|
.content_top {
|
||||||
width: 210px;
|
width: 210px;
|
||||||
border-radius: 4px;
|
border-radius: 4px;
|
||||||
box-shadow: 0px 0px 6px 0px rgba(0, 34, 96, 0.1);
|
box-shadow: 0px 0px 6px 0px rgba(0, 34, 96, 0.1);
|
||||||
background: rgba(255, 255, 255, 1);
|
background: rgba(255, 255, 255, 1);
|
||||||
height: 620px;
|
height: calc(100vh - 25vh);
|
||||||
position: absolute;
|
position: absolute;
|
||||||
z-index: 1;
|
z-index: 1;
|
||||||
top: 10px;
|
top: 10px;
|
||||||
left: 10px
|
left: 10px;
|
||||||
|
overflow: auto;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* 全选行样式 */
|
/* 其他样式保持不变... */
|
||||||
.list_header {
|
.list_header {
|
||||||
padding: 12px;
|
padding: 12px;
|
||||||
border-bottom: 1px solid #eee;
|
border-bottom: 1px solid #eee;
|
||||||
font-weight: 600;
|
font-weight: 600;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* 设备项样式 */
|
|
||||||
.device_item {
|
.device_item {
|
||||||
padding: 0px 12px;
|
padding: 0px 12px;
|
||||||
display: flex;
|
display: flex;
|
||||||
align-items: center;
|
align-items: center;
|
||||||
|
|
||||||
/* 复选框与内容间距 */
|
|
||||||
cursor: default;
|
cursor: default;
|
||||||
transition: background 0.2s;
|
transition: background 0.2s;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* 复选框样式 */
|
|
||||||
.device_checkbox {
|
.device_checkbox {
|
||||||
flex-shrink: 0;
|
flex-shrink: 0;
|
||||||
/* 复选框不压缩 */
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/* 设备信息区域 */
|
|
||||||
.device_page {
|
.device_page {
|
||||||
background-color: rgba(247, 248, 252, 1);
|
background-color: rgba(247, 248, 252, 1);
|
||||||
margin-bottom: 5px;
|
margin-bottom: 5px;
|
||||||
@ -235,7 +296,6 @@ onUnmounted(() => {
|
|||||||
color: #f53f3f;
|
color: #f53f3f;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* 控制按钮 */
|
|
||||||
.control_btn {
|
.control_btn {
|
||||||
font-size: 12px;
|
font-size: 12px;
|
||||||
padding: 0px 15px;
|
padding: 0px 15px;
|
||||||
@ -247,4 +307,16 @@ onUnmounted(() => {
|
|||||||
color: rgba(2, 124, 251, 1);
|
color: rgba(2, 124, 251, 1);
|
||||||
border: none;
|
border: none;
|
||||||
}
|
}
|
||||||
|
.nodata{
|
||||||
|
transform: translate(-1%,100%);
|
||||||
|
left:50%;
|
||||||
|
height: 30vh;
|
||||||
|
}
|
||||||
|
.nodataImg{
|
||||||
|
width: 130px;
|
||||||
|
}
|
||||||
|
.title{
|
||||||
|
color: #666;
|
||||||
|
padding-top: 20px;
|
||||||
|
}
|
||||||
</style>
|
</style>
|
||||||
|
|||||||