。。。
This commit is contained in:
parent
6587637649
commit
94934f5b80
|
@ -1,107 +1,110 @@
|
||||||
import axios, { AxiosError, AxiosInstance, AxiosRequestConfig, AxiosResponse, InternalAxiosRequestConfig } from "axios";
|
import axios, {AxiosError, AxiosInstance, AxiosRequestConfig, AxiosResponse, InternalAxiosRequestConfig} from 'axios'
|
||||||
import { message } from 'ant-design-vue';
|
import {message} from 'ant-design-vue'
|
||||||
import { useUserStore } from "@/stores/modules/userStore";
|
import {useUserStore} from '@/stores/modules/userStore'
|
||||||
import { useLoadingStore } from "@/stores/modules/loadingStore";
|
import {useLoadingStore} from '@/stores/modules/loadingStore'
|
||||||
import { useRouter } from "vue-router";
|
// import { useRouter } from "vue-router";
|
||||||
const router = useRouter();
|
// const router = useRouter();
|
||||||
import { LOGIN_ROUTER } from "@/configs";
|
// import { LOGIN_ROUTER } from "@/configs";
|
||||||
axios.defaults.withCredentials = false;
|
axios.defaults.withCredentials = false
|
||||||
export interface JsonResult<T> {
|
export interface JsonResult<T> {
|
||||||
code: number;
|
code: number
|
||||||
msg: string;
|
msg: string
|
||||||
data?: T;
|
data?: T
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
export interface CustomAxiosRequestConfig extends AxiosRequestConfig {
|
export interface CustomAxiosRequestConfig extends AxiosRequestConfig {
|
||||||
//是否需要全屏禁用
|
//是否需要全屏禁用
|
||||||
loading?: boolean,
|
loading?: boolean
|
||||||
loadingMessage?: string
|
loadingMessage?: string
|
||||||
}
|
}
|
||||||
|
|
||||||
export interface CustomInternalAxiosRequestConfig extends InternalAxiosRequestConfig {
|
export interface CustomInternalAxiosRequestConfig extends InternalAxiosRequestConfig {
|
||||||
//是否需要全屏禁用
|
//是否需要全屏禁用
|
||||||
loading?: boolean,
|
loading?: boolean
|
||||||
loadingMessage?: string
|
loadingMessage?: string
|
||||||
}
|
}
|
||||||
|
|
||||||
const axiosConfig: AxiosRequestConfig = {
|
const axiosConfig: AxiosRequestConfig = {
|
||||||
baseURL: import.meta.env.VITE_APP_BASE_API,
|
baseURL: import.meta.env.VITE_APP_BASE_API,
|
||||||
timeout: import.meta.env.VITE_APP_ENV === 'production' ? 10000 : 60000,
|
timeout: import.meta.env.VITE_APP_ENV === 'production' ? 10000 : 60000,
|
||||||
timeoutErrorMessage: "请求超时......"
|
timeoutErrorMessage: '请求超时......'
|
||||||
};
|
|
||||||
|
|
||||||
class RequestHttp {
|
|
||||||
service: AxiosInstance;
|
|
||||||
public constructor(config: AxiosRequestConfig) {
|
|
||||||
this.service = axios.create(config);
|
|
||||||
//1.添加请求拦截
|
|
||||||
this.service.interceptors.request.use((config: CustomInternalAxiosRequestConfig) => {
|
|
||||||
if (config.loading) {
|
|
||||||
useLoadingStore().showLoading(config.loadingMessage);
|
|
||||||
}
|
|
||||||
//默认带上用户token
|
|
||||||
config.headers.set('Authorization', useUserStore().getToken)
|
|
||||||
return config;
|
|
||||||
}, (error: AxiosError): Promise<string> => {
|
|
||||||
useLoadingStore().hideLoading();
|
|
||||||
message.error(error.message).then(() => {
|
|
||||||
})
|
|
||||||
return Promise.reject(error);
|
|
||||||
})
|
|
||||||
//2.添加响应拦截
|
|
||||||
this.service.interceptors.response.use(async (response: AxiosResponse): Promise<any> => {
|
|
||||||
useLoadingStore().hideLoading();
|
|
||||||
const jsonResult: JsonResult<unknown> = response.data;
|
|
||||||
if (jsonResult.code !== 0) {
|
|
||||||
//一些特定的错误需要重新登录
|
|
||||||
if ([-101].includes(jsonResult.code)) {
|
|
||||||
//跳转登录页
|
|
||||||
await useUserStore().resetUserInfo();
|
|
||||||
await message.error(jsonResult.msg)
|
|
||||||
// alert('??')
|
|
||||||
location.reload()
|
|
||||||
// router.push({
|
|
||||||
// path: LOGIN_ROUTER.path
|
|
||||||
// })
|
|
||||||
|
|
||||||
|
|
||||||
} else {
|
|
||||||
await message.error(jsonResult.msg)
|
|
||||||
}
|
|
||||||
return Promise.reject(jsonResult);
|
|
||||||
}
|
|
||||||
return Promise.resolve(jsonResult);
|
|
||||||
}, async (error: AxiosError): Promise<string> => {
|
|
||||||
useLoadingStore().hideLoading();
|
|
||||||
await message.error(error.msg)
|
|
||||||
return Promise.reject(error);
|
|
||||||
})
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 常用请求方法封装
|
|
||||||
*/
|
|
||||||
get<T>(url: string, params?: object, _object: CustomAxiosRequestConfig = {}): Promise<JsonResult<T>> {
|
|
||||||
return this.service.get(url, { params, ..._object });
|
|
||||||
}
|
|
||||||
|
|
||||||
post<T>(url: string, params?: object | object[], _object: CustomAxiosRequestConfig = {}): Promise<JsonResult<T>> {
|
|
||||||
return this.service.post(url, params, _object);
|
|
||||||
}
|
|
||||||
|
|
||||||
put<T>(url: string, params?: object | object[], _object: CustomAxiosRequestConfig = {}): Promise<JsonResult<T>> {
|
|
||||||
return this.service.put(url, params, _object);
|
|
||||||
}
|
|
||||||
|
|
||||||
delete<T>(url: string, params?: object, _object: CustomAxiosRequestConfig = {}): Promise<JsonResult<T>> {
|
|
||||||
return this.service.delete(url, { params, ..._object });
|
|
||||||
}
|
|
||||||
|
|
||||||
download(url: string, params?: object, _object: CustomAxiosRequestConfig = {}): Promise<BlobPart> {
|
|
||||||
return this.service.post(url, params, { ..._object, responseType: "blob" });
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
const api = new RequestHttp(axiosConfig);
|
class RequestHttp {
|
||||||
export default api
|
service: AxiosInstance
|
||||||
|
public constructor(config: AxiosRequestConfig) {
|
||||||
|
this.service = axios.create(config)
|
||||||
|
//1.添加请求拦截
|
||||||
|
this.service.interceptors.request.use(
|
||||||
|
(config: CustomInternalAxiosRequestConfig) => {
|
||||||
|
if (config.loading) {
|
||||||
|
useLoadingStore().showLoading(config.loadingMessage)
|
||||||
|
}
|
||||||
|
//默认带上用户token
|
||||||
|
config.headers.set('Authorization', useUserStore().getToken)
|
||||||
|
return config
|
||||||
|
},
|
||||||
|
(error: AxiosError): Promise<string> => {
|
||||||
|
useLoadingStore().hideLoading()
|
||||||
|
message.error(error.message).then(() => {})
|
||||||
|
return Promise.reject(error)
|
||||||
|
}
|
||||||
|
)
|
||||||
|
//2.添加响应拦截
|
||||||
|
this.service.interceptors.response.use(
|
||||||
|
async (response: AxiosResponse): Promise<any> => {
|
||||||
|
useLoadingStore().hideLoading()
|
||||||
|
const jsonResult: JsonResult<unknown> = response.data
|
||||||
|
// console.log('🚀 ~ RequestHttp ~ this.service.interceptors.response.use ~ jsonResult:', jsonResult)
|
||||||
|
if (jsonResult.code !== 0) {
|
||||||
|
//一些特定的错误需要重新登录
|
||||||
|
if ([-101].includes(jsonResult.code)) {
|
||||||
|
//跳转登录页
|
||||||
|
await useUserStore().resetUserInfo()
|
||||||
|
await message.error(jsonResult.msg)
|
||||||
|
// alert('??')
|
||||||
|
location.reload()
|
||||||
|
// router.push({
|
||||||
|
// path: LOGIN_ROUTER.path
|
||||||
|
// })
|
||||||
|
} else {
|
||||||
|
await message.error(jsonResult.msg)
|
||||||
|
}
|
||||||
|
return Promise.reject(jsonResult)
|
||||||
|
}
|
||||||
|
return Promise.resolve(jsonResult)
|
||||||
|
},
|
||||||
|
async (error: AxiosError): Promise<string> => {
|
||||||
|
useLoadingStore().hideLoading()
|
||||||
|
await message.error(error.msg)
|
||||||
|
return Promise.reject(error)
|
||||||
|
}
|
||||||
|
)
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 常用请求方法封装
|
||||||
|
*/
|
||||||
|
get<T>(url: string, params?: object, _object: CustomAxiosRequestConfig = {}): Promise<JsonResult<T>> {
|
||||||
|
return this.service.get(url, {params, ..._object})
|
||||||
|
}
|
||||||
|
|
||||||
|
post<T>(url: string, params?: object | object[], _object: CustomAxiosRequestConfig = {}): Promise<JsonResult<T>> {
|
||||||
|
return this.service.post(url, params, _object)
|
||||||
|
}
|
||||||
|
|
||||||
|
put<T>(url: string, params?: object | object[], _object: CustomAxiosRequestConfig = {}): Promise<JsonResult<T>> {
|
||||||
|
return this.service.put(url, params, _object)
|
||||||
|
}
|
||||||
|
|
||||||
|
delete<T>(url: string, params?: object, _object: CustomAxiosRequestConfig = {}): Promise<JsonResult<T>> {
|
||||||
|
return this.service.delete(url, {params, ..._object})
|
||||||
|
}
|
||||||
|
|
||||||
|
download(url: string, params?: object, _object: CustomAxiosRequestConfig = {}): Promise<BlobPart> {
|
||||||
|
return this.service.post(url, params, {..._object, responseType: 'blob'})
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
const api = new RequestHttp(axiosConfig)
|
||||||
|
export default api
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
import { defineStore } from "pinia";
|
import { defineStore } from "pinia";
|
||||||
import jwtDecode from "jwt-decode";
|
// import jwtDecode from "jwt-decode";
|
||||||
import api from "@/axios";
|
import api from "@/axios";
|
||||||
import { useTabsStore } from "@/stores/modules/tabsStore";
|
import { useTabsStore } from "@/stores/modules/tabsStore";
|
||||||
|
|
||||||
|
|
|
@ -59,7 +59,7 @@ const loginParams = ref<{
|
||||||
passWord: string
|
passWord: string
|
||||||
code: string
|
code: string
|
||||||
}>({
|
}>({
|
||||||
userNameOrTelephone: import.meta.env.VITE_APP_ENV === 'development' ? 'test001' : '',
|
userNameOrTelephone: import.meta.env.VITE_APP_ENV === 'development' ? 'test002' : '',
|
||||||
passWord: import.meta.env.VITE_APP_ENV === 'development' ? '123456' : '',
|
passWord: import.meta.env.VITE_APP_ENV === 'development' ? '123456' : '',
|
||||||
code: import.meta.env.VITE_APP_ENV === 'development' ? '1234' : ''
|
code: import.meta.env.VITE_APP_ENV === 'development' ? '1234' : ''
|
||||||
})
|
})
|
||||||
|
@ -80,22 +80,25 @@ const login = async () => {
|
||||||
loading: true
|
loading: true
|
||||||
}
|
}
|
||||||
)
|
)
|
||||||
|
userStore.saveUserInfo(resp.data)
|
||||||
//保存用户信息
|
// console.log('登录',resp.data,loginParams.value.userNameOrTelephone)
|
||||||
|
localStorage.setItem('loginname', loginParams.value.userNameOrTelephone)
|
||||||
|
localStorage.setItem('geoCode', resp.data.geoCode)
|
||||||
|
console.log(111)
|
||||||
|
// 保存用户信息
|
||||||
api
|
api
|
||||||
.post('/common/client/user/org/tree4', {
|
.post('/common/client/user/org/tree4', {
|
||||||
name: loginParams.value.userNameOrTelephone
|
name: loginParams.value.userNameOrTelephone
|
||||||
})
|
})
|
||||||
.then((res) => {
|
.then((res) => {
|
||||||
|
console.log(222)
|
||||||
|
|
||||||
if (res.code == 0) {
|
if (res.code == 0) {
|
||||||
localStorage.setItem('tree4data', JSON.stringify(res.data))
|
localStorage.setItem('tree4data', JSON.stringify(res.data))
|
||||||
} else {
|
} else {
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
userStore.saveUserInfo(resp.data)
|
|
||||||
// console.log('登录',resp.data,loginParams.value.userNameOrTelephone)
|
|
||||||
localStorage.setItem('loginname', loginParams.value.userNameOrTelephone)
|
|
||||||
localStorage.setItem('geoCode', resp.data.geoCode)
|
|
||||||
api
|
api
|
||||||
.post('multialarm/system/alarm/total', {
|
.post('multialarm/system/alarm/total', {
|
||||||
name: loginParams.value.userNameOrTelephone,
|
name: loginParams.value.userNameOrTelephone,
|
||||||
|
|
|
@ -450,7 +450,6 @@ const qhzty2 = (data: any) => {
|
||||||
watch(
|
watch(
|
||||||
() => useUserStore().getsoketData,
|
() => useUserStore().getsoketData,
|
||||||
(newValue: any) => {
|
(newValue: any) => {
|
||||||
// console.log('newValue', newValue)
|
|
||||||
if (newValue != undefined) {
|
if (newValue != undefined) {
|
||||||
jinbao.value.push(newValue)
|
jinbao.value.push(newValue)
|
||||||
}
|
}
|
||||||
|
@ -505,7 +504,7 @@ const lock = (data: any) => {
|
||||||
message: '锁定成功',
|
message: '锁定成功',
|
||||||
type: 'success'
|
type: 'success'
|
||||||
})
|
})
|
||||||
// console.log('listindex',listindex.value,jinbao.value)
|
|
||||||
getdayline()
|
getdayline()
|
||||||
let city = JSON.parse(localStorage.getItem('user-stores'))['userInfo']['levelvalue']
|
let city = JSON.parse(localStorage.getItem('user-stores'))['userInfo']['levelvalue']
|
||||||
api
|
api
|
||||||
|
@ -527,6 +526,8 @@ const lock = (data: any) => {
|
||||||
}
|
}
|
||||||
|
|
||||||
const printLeafs = (tree: any, jirearr: any) => {
|
const printLeafs = (tree: any, jirearr: any) => {
|
||||||
|
// console.log('🚀 ~ printLeafs ~ tree:', tree)
|
||||||
|
// console.log('🚀 ~ printLeafs ~ list:', jirearr)
|
||||||
if (tree.children === null) {
|
if (tree.children === null) {
|
||||||
if (tree.hasOwnProperty('stationId')) {
|
if (tree.hasOwnProperty('stationId')) {
|
||||||
tree.code = tree?.stationId
|
tree.code = tree?.stationId
|
||||||
|
@ -535,12 +536,7 @@ const printLeafs = (tree: any, jirearr: any) => {
|
||||||
jirearr.forEach((x: any) => {
|
jirearr.forEach((x: any) => {
|
||||||
if (tree.stationId == x.stationId) {
|
if (tree.stationId == x.stationId) {
|
||||||
tree.children.push(x)
|
tree.children.push(x)
|
||||||
//加入报警的
|
|
||||||
}
|
}
|
||||||
// 添加测试数据:往文艺路 下面的 长沙市芙蓉高级中学 添加 育英小学的数据
|
|
||||||
// if (tree.stationId === 'eead2a15-d6ca-433d-ba44-998f87c6092f' && x.stationId === '917ae0e4-d2cb-434b-a859-b6eb8abda036') {
|
|
||||||
// tree.children.push(x)
|
|
||||||
// }
|
|
||||||
})
|
})
|
||||||
} else {
|
} else {
|
||||||
tree.children.forEach((child: any) => {
|
tree.children.forEach((child: any) => {
|
||||||
|
@ -600,9 +596,7 @@ const scrollToMatchedNode = (searchValue: string) => {
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
const treedataall = ref([])
|
const treedataall = ref([])
|
||||||
|
|
||||||
const treeRef = ref() // 创建一个 ref 用来引用 a-tree 组件
|
const treeRef = ref() // 创建一个 ref 用来引用 a-tree 组件
|
||||||
// checkKeyExists___验证 key 方法
|
|
||||||
const checkKeyExists = (nodes: any, key: string): boolean => {
|
const checkKeyExists = (nodes: any, key: string): boolean => {
|
||||||
return nodes.some((node: any) => {
|
return nodes.some((node: any) => {
|
||||||
if (node.code === key) return true
|
if (node.code === key) return true
|
||||||
|
@ -630,11 +624,12 @@ const gettree4 = (data: any) => {
|
||||||
ele.code = ele.pointId //为什么是pointId,因为key需要唯一
|
ele.code = ele.pointId //为什么是pointId,因为key需要唯一
|
||||||
})
|
})
|
||||||
let data = [res.data]
|
let data = [res.data]
|
||||||
|
console.log('🚀 ~ .then ~ data:', data)
|
||||||
data.forEach((tree) => {
|
data.forEach((tree) => {
|
||||||
// console.log('tree______', tree)
|
|
||||||
tree.children.reverse() // 长沙市排在前
|
tree.children.reverse() // 长沙市排在前
|
||||||
printLeafs(tree, res1.data)
|
printLeafs(tree, res1.data)
|
||||||
})
|
})
|
||||||
|
|
||||||
treedataall.value = [...data]
|
treedataall.value = [...data]
|
||||||
console.log('🚀 ~ .then ~ treedataall.value:', treedataall.value)
|
console.log('🚀 ~ .then ~ treedataall.value:', treedataall.value)
|
||||||
options.value = [...data]
|
options.value = [...data]
|
||||||
|
@ -715,7 +710,6 @@ const clickKz = (dat2a: any) => {
|
||||||
})
|
})
|
||||||
.then((res) => {
|
.then((res) => {
|
||||||
if (res.code == 0) {
|
if (res.code == 0) {
|
||||||
// console.log('ress', res)
|
|
||||||
ingrssddata.value = res.data
|
ingrssddata.value = res.data
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
@ -749,12 +743,6 @@ var _renderClusterMarker = function (context: any) {
|
||||||
}
|
}
|
||||||
|
|
||||||
var _renderMarker = function (context: any) {
|
var _renderMarker = function (context: any) {
|
||||||
// console.log('🚀 ~ context:', context)
|
|
||||||
// var offsetX = (Math.random() - 0.5) * 30
|
|
||||||
// var offsetY = (Math.random() - 0.5) * 30
|
|
||||||
// var offsetX = (Math.random() - 0.5) * 10
|
|
||||||
// var offsetY = (Math.random() - 0.5) * 10
|
|
||||||
// var offset = new AMap.Pixel(offsetX, offsetY) // 应用随机偏移
|
|
||||||
var offset = new AMap.Pixel(-9, -9)
|
var offset = new AMap.Pixel(-9, -9)
|
||||||
context.marker.setIcon(
|
context.marker.setIcon(
|
||||||
new AMap.Icon({
|
new AMap.Icon({
|
||||||
|
@ -777,7 +765,6 @@ var _renderMarker = function (context: any) {
|
||||||
}
|
}
|
||||||
|
|
||||||
const createCluster = () => {
|
const createCluster = () => {
|
||||||
// cluster = null
|
|
||||||
if (cluster) cluster.setMap(null) // 避免重复创建
|
if (cluster) cluster.setMap(null) // 避免重复创建
|
||||||
// @ts-ignore
|
// @ts-ignore
|
||||||
cluster = new AMap.MarkerCluster(state.map, points, {
|
cluster = new AMap.MarkerCluster(state.map, points, {
|
||||||
|
@ -810,12 +797,9 @@ const treedata = () => {
|
||||||
count = points.length
|
count = points.length
|
||||||
console.log('points___________________________', points)
|
console.log('points___________________________', points)
|
||||||
createCluster() // 初始化聚合点
|
createCluster() // 初始化聚合点
|
||||||
// 在点击聚合点时创建Marker
|
|
||||||
cluster.on('click', function (e: any) {
|
cluster.on('click', function (e: any) {
|
||||||
// console.log('🚀 ~ e:', e)
|
|
||||||
const {clusterData, lnglat} = e
|
const {clusterData, lnglat} = e
|
||||||
let currentZoom = state.map.getZoom()
|
let currentZoom = state.map.getZoom()
|
||||||
// console.log('🚀 ~ currentZoom:_____________________________', currentZoom)
|
|
||||||
if (clusterData?.length > 0) {
|
if (clusterData?.length > 0) {
|
||||||
state.map.setZoomAndCenter(currentZoom + 1, lnglat) // 放大1级,聚焦到点击位置
|
state.map.setZoomAndCenter(currentZoom + 1, lnglat) // 放大1级,聚焦到点击位置
|
||||||
}
|
}
|
||||||
|
@ -836,7 +820,6 @@ const getdayline = () => {
|
||||||
})
|
})
|
||||||
.then((res: JsonResult<any>) => {
|
.then((res: JsonResult<any>) => {
|
||||||
if (res.code == 0) {
|
if (res.code == 0) {
|
||||||
// console.log('当日报警列表', res)
|
|
||||||
jinbao.value = res.data
|
jinbao.value = res.data
|
||||||
if (res.data.length > 0) {
|
if (res.data.length > 0) {
|
||||||
res.data.map((x: any) => {
|
res.data.map((x: any) => {
|
||||||
|
@ -947,7 +930,6 @@ const handleScroll = throttle(async (event: any) => {
|
||||||
showLoading.value = true
|
showLoading.value = true
|
||||||
pageIndex.value++
|
pageIndex.value++
|
||||||
await getAi()
|
await getAi()
|
||||||
// console.log(aiCount.value, AIyujing.value.length)
|
|
||||||
}
|
}
|
||||||
if (aiCount.value === AIyujing.value.length) return
|
if (aiCount.value === AIyujing.value.length) return
|
||||||
}
|
}
|
||||||
|
@ -967,7 +949,6 @@ const gettotal = () => {
|
||||||
})
|
})
|
||||||
.then((res) => {
|
.then((res) => {
|
||||||
if (res.code == 0) {
|
if (res.code == 0) {
|
||||||
// console.log('??', res)
|
|
||||||
total.value = res.data
|
total.value = res.data
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
@ -978,7 +959,6 @@ const selectA = (selectedKeys: any, e: any) => {
|
||||||
console.log('selectedKeys___________________________', selectedKeys, 'e______________________', e)
|
console.log('selectedKeys___________________________', selectedKeys, 'e______________________', e)
|
||||||
if (selectedKeys[0].length >= 13) {
|
if (selectedKeys[0].length >= 13) {
|
||||||
let targetLangLat = [e.selectedNodes[0].longitude == null ? 0 : e.selectedNodes[0].longitude, e.selectedNodes[0].latitude == null ? 0 : e.selectedNodes[0].latitude]
|
let targetLangLat = [e.selectedNodes[0].longitude == null ? 0 : e.selectedNodes[0].longitude, e.selectedNodes[0].latitude == null ? 0 : e.selectedNodes[0].latitude]
|
||||||
|
|
||||||
deviceInfoWindow.value = new AMap.InfoWindow({
|
deviceInfoWindow.value = new AMap.InfoWindow({
|
||||||
isCustom: true, //使用自定义窗体
|
isCustom: true, //使用自定义窗体
|
||||||
content: createSubstanceInfowindow2(e.selectedNodes[0], '1'),
|
content: createSubstanceInfowindow2(e.selectedNodes[0], '1'),
|
||||||
|
@ -986,9 +966,6 @@ const selectA = (selectedKeys: any, e: any) => {
|
||||||
})
|
})
|
||||||
deviceInfoWindow.value.open(state.map, [e.selectedNodes[0].longitude == null ? 0 : e.selectedNodes[0].longitude, e.selectedNodes[0].latitude == null ? 0 : e.selectedNodes[0].latitude])
|
deviceInfoWindow.value.open(state.map, [e.selectedNodes[0].longitude == null ? 0 : e.selectedNodes[0].longitude, e.selectedNodes[0].latitude == null ? 0 : e.selectedNodes[0].latitude])
|
||||||
|
|
||||||
// state.map.setZoomAndCenter(12, targetLangLat, true) // 这个过渡 不平滑
|
|
||||||
// state.map.setZoom(12, {animate: true})
|
|
||||||
// state.map.setCenter(targetLangLat, true)
|
|
||||||
state.map.setFitView(
|
state.map.setFitView(
|
||||||
new AMap.Marker({position: [e.selectedNodes[0].longitude == null ? 0 : e.selectedNodes[0].longitude, e.selectedNodes[0].latitude == null ? 0 : e.selectedNodes[0].latitude]}),
|
new AMap.Marker({position: [e.selectedNodes[0].longitude == null ? 0 : e.selectedNodes[0].longitude, e.selectedNodes[0].latitude == null ? 0 : e.selectedNodes[0].latitude]}),
|
||||||
true,
|
true,
|
||||||
|
@ -1154,12 +1131,8 @@ const getSubstanceInfoWindowContent2 = (obj: any, type: any) => {
|
||||||
}
|
}
|
||||||
|
|
||||||
if (a.alarmType == 'ipc') {
|
if (a.alarmType == 'ipc') {
|
||||||
// let routeData = router.resolve({ path: '/index/cwPlay', query: { pointId: a.pointId } })
|
|
||||||
// window.open(routeData.href, '_blank')
|
|
||||||
|
|
||||||
var url = `/cw_/index.html?id=${a.pointId}&title=${a.title}`
|
var url = `/cw_/index.html?id=${a.pointId}&title=${a.title}`
|
||||||
window.open(url, '_blank')
|
window.open(url, '_blank')
|
||||||
// const newWindow = window.open(url, '', 'width=' + 1920 + ',height=' + 1080 + ",top=0,left=0,status='no',location='no',resizable='no',toolbar='no'")
|
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
// 手持设备的播放
|
// 手持设备的播放
|
||||||
|
@ -1330,11 +1303,10 @@ const upstatuslist = ref([])
|
||||||
const listindex = ref()
|
const listindex = ref()
|
||||||
const toinfo = (item: any, index: number) => {
|
const toinfo = (item: any, index: number) => {
|
||||||
listindex.value = index
|
listindex.value = index
|
||||||
// dialogTableVisible.value = false;
|
|
||||||
nextTick(() => {
|
nextTick(() => {
|
||||||
infoData.value = item
|
infoData.value = item
|
||||||
if (item.state == 'new') {
|
if (item.state == 'new') {
|
||||||
//新事件转成处理中/firectrl/client/sensor/alarm_event/changestate
|
|
||||||
api
|
api
|
||||||
.post('/multialarm/client/alarm_event/changestate', {
|
.post('/multialarm/client/alarm_event/changestate', {
|
||||||
eventId: item.multiAlarmId,
|
eventId: item.multiAlarmId,
|
||||||
|
@ -1362,14 +1334,12 @@ const toinfo = (item: any, index: number) => {
|
||||||
eventId: item.multiAlarmId
|
eventId: item.multiAlarmId
|
||||||
})
|
})
|
||||||
.then((res) => {
|
.then((res) => {
|
||||||
// console.log('PPres1', res)
|
|
||||||
if (res.code == 0) {
|
if (res.code == 0) {
|
||||||
upstatuslist.value = res.data as any[]
|
upstatuslist.value = res.data as any[]
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
//跳转地图marke
|
|
||||||
let targetLangLat = [item.longitude, item.latitude]
|
let targetLangLat = [item.longitude, item.latitude]
|
||||||
state.map.panTo(targetLangLat)
|
state.map.panTo(targetLangLat)
|
||||||
state.map.setZoomAndCenter(15, targetLangLat)
|
state.map.setZoomAndCenter(15, targetLangLat)
|
||||||
|
@ -1390,7 +1360,6 @@ const initMap = () => {
|
||||||
})
|
})
|
||||||
treedata()
|
treedata()
|
||||||
getdayline()
|
getdayline()
|
||||||
// stationWebsocket();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
onMounted(() => {
|
onMounted(() => {
|
||||||
|
|
Loading…
Reference in New Issue