This commit is contained in:
2023-09-19 14:34:21 +08:00
parent 4c2c1739fc
commit e1446b6082
256 changed files with 262 additions and 227 deletions

View File

@ -3,6 +3,10 @@ import { getToken, setToken, removeToken } from '@/utils/auth'
import defAva from '@/assets/images/profile.jpg'
import cache from '@/plugins/cache'
import { decrypt } from '@/utils/jsencrypt'
function interceptUrl(url, cha) {
var ind = url.lastIndexOf(cha)
return url.substring(ind + 1)
}
const useUserStore = defineStore(
'user',
{
@ -37,8 +41,19 @@ const useUserStore = defineStore(
getInfo() {
return new Promise((resolve, reject) => {
getInfo().then(res => {
let avatar = ''
const user = res.user
const avatar = (user.avatar == "" || user.avatar == null) ? defAva : import.meta.env.VITE_APP_BASE_API + user.avatar;
var domain = window.location.host;
let url = window.location.href
var rule = /^(([-\u4E00-\u9FA5a-z0-9]{1,63})\.)+([\u4E00-\u9FA5a-z]{2,63})\.?$/;
if (rule.test(domain)) {
avatar = (user.avatar == "" || user.avatar == null) ? defAva : user.avatar;
} else {
if (url.indexOf(":8080") != -1) {
url = url.split(":8080")[0];
avatar = (user.avatar == "" || user.avatar == null) ? defAva : url + interceptUrl(user.avatar, '0/');
}
}
if (res.roles && res.roles.length > 0) { // 验证返回的roles是否是一个非空数组
this.roles = res.roles
this.permissions = res.permissions

View File

@ -1320,7 +1320,7 @@
fixed="left"
width="160"
v-if="BsFlag"
label="村名"
label="位置"
>
<template #default="scope">
{{ scope.row.town }}
@ -1382,6 +1382,7 @@
background-color: rgba(255, 62, 57, 1);
color: rgba(255, 255, 255, 1);
padding: 2px 12px 2px 12px;
width: 100%;
border-radius: 2px;
white-space: nowrap;
"
@ -1936,7 +1937,7 @@
v-if="label3 == '大田视频病害监测'"
append-to-body
:zoom-rate="1.2"
style="width: 100%"
style="width: 100%; height: 500px"
fit="cover"
:src="`${DetailArr.hdStreaming}`"
></image-preview>
@ -3803,20 +3804,18 @@ const tabulationCurrentChange = val => {
});
} else if (label3.value == '大田视频病害监测') {
getCameraNameTo({
startTime: value1.value[0]
? moment(value1.value[0]).format('YYYY-MM-DD HH:mm:ss')
: null,
endTime: value1.value[1]
? moment(value1.value[1]).format('YYYY-MM-DD HH:mm:ss')
: null,
warning: formInline.value.flag,
name: label2.value,
whetherToDownload: false,
pageNums: tabulationcurrentPage.value,
pageSizes: tabulationpageSize.value,
}).then(res => {
tableNewData.value = res.data;
});
startTime: value1.value[0]
? moment(value1.value[0]).format('YYYY-MM-DD HH:mm:ss')
: null,
endTime: value1.value[1] ? moment(value1.value[1]).format('YYYY-MM-DD HH:mm:ss') : null,
warning: formInline.value.flag,
name: label2.value,
whetherToDownload: false,
pageNums: tabulationcurrentPage.value,
pageSizes: tabulationpageSize.value,
}).then(res => {
tableNewData.value = res.data;
});
} else if (label3.value == '苗情监测') {
getCapturePointCamera({
startTime: value1.value[0]
@ -4743,7 +4742,7 @@ const handleClick = (tab, event) => {
];
getSeedlingMonitoring({ divisions: code }).then(res => {
label2.value =res.data[0] && res.data[0].children[0].label;
label2.value = res.data[0] && res.data[0].children[0].label;
res.data.forEach(item => {
devicesArr.value.push(item);
});
@ -4763,16 +4762,16 @@ const getdeviceNumbers = num => {
// viewers.entities.removeAll();
// }
if (num == '1') {
label3.value = '智能孢子仪';
} else if (num == '2') {
label3.value = '虫情监测仪';
} else if (num == '3') {
label3.value = '土壤墒情、土质';
} else if (num == '4') {
label3.value = '大田视频病害监测';
} else if (num == '5') {
label3.value = '苗情监测';
}
label3.value = '智能孢子仪';
} else if (num == '2') {
label3.value = '虫情监测仪';
} else if (num == '3') {
label3.value = '土壤墒情、土质';
} else if (num == '4') {
label3.value = '大田视频病害监测';
} else if (num == '5') {
label3.value = '苗情监测';
}
getdeviceNumber({ flag: num, divisions: code }).then(res => {
map.eachLayer(layer => {
// 检查图层是否为底图
@ -4784,14 +4783,24 @@ const getdeviceNumbers = num => {
});
nums.value = num;
if (num == 0) {
label2.value = res.data[0] && res.data[0].children[0].children[0].label;
label2.value =
res.data[0].children[0].children && res.data[0].children[0].children[0].label;
label3.value = res.data[0] && res.data[0].children[0].label;
getsporeEquipmentConditions(1);
} else if (num < 4) {
label2.value =res.data[0] && res.data[0].children[0].label;
label2.value = res.data[0] && res.data[0].children[0].label;
}
if (num < 4) {
res.data.forEach(item => {
if (num == 0) {
for (const key in item) {
item['children'].forEach((i, index) => {
if (!i.children) {
item['children'].splice(index, 1);
}
});
}
}
devicesArr.value.push(item);
tableNewData.value = res.data.slice(
(tabulationcurrentPage.value - 1) * tabulationpageSize.value,
@ -4805,8 +4814,8 @@ const getdeviceNumbers = num => {
getsporeEquipmentCondition({ equipment: label2.value, divisions: code }).then(res => {
// 创建一个Entity对象加图片
// res.data.forEach((item, index) => {
if(res.data.length==0){
return
if (res.data.length == 0) {
return;
}
center = L.latLng(res.data[0].msLatitude, res.data[0].msLongitude);
map.setView(center, 16);
@ -4825,8 +4834,8 @@ const getdeviceNumbers = num => {
geteqLightEquipmentCondition({ equipment: label2.value, divisions: code }).then(res => {
// 创建一个Entity对象加图片
// res.data.forEach((item, index) => {
if(res.data.length==0){
return
if (res.data.length == 0) {
return;
}
center = L.latLng(res.data[0].msLatitude, res.data[0].msLongitude);
map.setView(center, 16);
@ -4843,11 +4852,10 @@ const getdeviceNumbers = num => {
});
} else if (num == 3) {
getequipmentCondition({ equipment: label2.value, divisions: code }).then(res => {
// 创建一个Entity对象加图片
// res.data.forEach((item, index) => {
if(res.data.length==0){
return
if (res.data.length == 0) {
return;
}
center = L.latLng(res.data[0].msLatitude, res.data[0].msLongitude);
map.setView(center, 16);

View File

@ -893,7 +893,7 @@ const selectTime = () => {
const subText = () => {
//发送短信
getsendSms(multipleSelection.value).then(res => {
if (res.data.code == 'OK') {
if (res.data.code == '200') {
ElMessage({
message: '发送成功',
type: 'success',

View File

@ -899,7 +899,7 @@ const selectTime = () => {
const subText = () => {
//发送短信
getsendSms(multipleSelection.value).then(res => {
if (res.data.code == 'OK') {
if (res.data.code == '200') {
ElMessage({
message: '发送成功',
type: 'success',

View File

@ -911,7 +911,7 @@ const selectTime = () => {
const subText = () => {
//发送短信
getsendSms(multipleSelection.value).then(res => {
if (res.data.code == 'OK') {
if (res.data.code == '200') {
ElMessage({
message: '发送成功',
type: 'success',

View File

@ -889,7 +889,7 @@ const selectTime = () => {
const subText = () => {
//发送短信
getsendSms(multipleSelection.value).then(res => {
if (res.data.code == 'OK') {
if (res.data.code == '200') {
ElMessage({
message: '发送成功',
type: 'success',

View File

@ -519,7 +519,7 @@ const depthclick = item => {
};
const dowcity = () => {
getmeteorology({
name: city.value,
msName: city.value,
whetherToDownload: true,
startTime: value1.value[0] ? moment(value1.value[0]).format('YYYY-MM-DD HH:mm:ss') : null,
endTime: value1.value[1] ? moment(value1.value[1]).format('YYYY-MM-DD HH:mm:ss') : null,

View File

@ -126,7 +126,9 @@
range-separator="-"
start-placeholder="开始日期"
end-placeholder="结束日期"
clearable
:size="size"
@change="e => pickerChangeFn(e)"
/>
</div>
<br />
@ -507,50 +509,30 @@ onUpdated(() => {
window.document.querySelector('#screenfull').style.display = 'block';
});
const pickerChangeFn = e => {
if(!e){
let startTime =''
let endTime =''
gettyphoonDamageSelect({ startTime: startTime, endTime: endTime }).then(res => {
SaveResultsDiv.value = res.data;
});
}
};
/*-------------地图------------------------*/
//外网底图
const mapOption = {
url:
'http://{s}.tianditu.gov.cn/img_c/wmts?service=wmts&request=GetTile&version=1.0.0' +
'&LAYER=img&tileMatrixSet=c&TileMatrix={TileMatrix}&TileRow={TileRow}&TileCol={TileCol}' +
'&style=default&format=tiles&tk=31091965e263284a501a723b8909f405',
layer: 'tdtCva',
style: 'default',
format: 'tiles',
tileMatrixSetID: 'c',
subdomains: ['t0', 't1', 't2', 't3', 't4', 't5', 't6', 't7'],
tilingScheme: new Cesium.GeographicTilingScheme(),
tileMatrixLabels: [
'1',
'2',
'3',
'4',
'5',
'6',
'7',
'8',
'9',
'10',
'11',
'12',
'13',
'14',
'15',
'16',
'17',
'18',
'19',
],
maximumLevel: 18,
};
//内网地图服务
// const mapOption = {
// url: 'http://59.206.203.34/tileservice/SdRasterPubMap?tilematrixset=img2017',
// layer: 'sdimg2017',
// url:
// 'http://{s}.tianditu.gov.cn/img_c/wmts?service=wmts&request=GetTile&version=1.0.0' +
// '&LAYER=img&tileMatrixSet=c&TileMatrix={TileMatrix}&TileRow={TileRow}&TileCol={TileCol}' +
// '&style=default&format=tiles&tk=31091965e263284a501a723b8909f405',
// layer: 'tdtCva',
// style: 'default',
// tileMatrixSetID: 'img2017',
// format: 'image/png',
// format: 'tiles',
// tileMatrixSetID: 'c',
// subdomains: ['t0', 't1', 't2', 't3', 't4', 't5', 't6', 't7'],
// tilingScheme: new Cesium.GeographicTilingScheme(),
// tileMatrixLabels: [
// '1',
// '2',
@ -572,11 +554,41 @@ const mapOption = {
// '18',
// '19',
// ],
// tilingScheme: new Cesium.GeographicTilingScheme(),
// // tileMatrixSetID: 'your-tile-matrix-set-id',
// maximumLevel: 18,
// errorEvent: 'preventDefault',
// };
//内网地图服务
const mapOption = {
url: 'http://59.206.203.34/tileservice/SdRasterPubMap?tilematrixset=img2017',
layer: 'sdimg2017',
style: 'default',
tileMatrixSetID: 'img2017',
format: 'image/png',
tileMatrixLabels: [
'1',
'2',
'3',
'4',
'5',
'6',
'7',
'8',
'9',
'10',
'11',
'12',
'13',
'14',
'15',
'16',
'17',
'18',
'19',
],
tilingScheme: new Cesium.GeographicTilingScheme(),
// tileMatrixSetID: 'your-tile-matrix-set-id',
maximumLevel: 18,
errorEvent: 'preventDefault',
};
Cesium.Ion.defaultAccessToken =
'eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJqdGkiOiJiYzcwZmJmNi02MzQ5LTQ1MGEtODgzMy0yZTZiZGExY2MzMGMiLCJpZCI6MTAxOTgsInNjb3BlcyI6WyJhc2wiLCJhc3IiLCJnYyJdLCJpYXQiOjE1ODEzMDgxNTR9.NeJU4yfUi-SnLrNDOBYsQgmiSh3B4axCTi1m84Qw99c';

View File

@ -169,8 +169,8 @@ onMounted(() => {
getCameraNameSs();
});
onUpdated(() => {
document.querySelector('.mode').style.display = 'none';
window.document.querySelector('#screenfull').style.display = 'none';
window.document.querySelector('.mode') && (document.querySelector('.mode').style.display = 'none');
window.document.querySelector('#screenfull') && (window.document.querySelector('#screenfull').style.display = 'none');
});
const initLeafletMap = () => {
map = L.map('cesiumContainers', {