提交
This commit is contained in:
@ -43,10 +43,10 @@ export default defineConfig({
|
|||||||
})
|
})
|
||||||
]
|
]
|
||||||
// server: {
|
// server: {
|
||||||
// port: 8808,
|
// port: 8848,
|
||||||
// proxy: {
|
// proxy: {
|
||||||
// '/api': {
|
// '/api': {
|
||||||
// target: localStorage.getItem('ip') || 'http://127.0.0.1:8808',
|
// target: localStorage.getItem('ip') || 'http://127.0.0.1:8848',
|
||||||
// changeOrigin: true,
|
// changeOrigin: true,
|
||||||
// rewrite: (path) => path.replace(/^\/api/, '')
|
// rewrite: (path) => path.replace(/^\/api/, '')
|
||||||
// }
|
// }
|
||||||
|
|||||||
@ -10,12 +10,12 @@ import type {
|
|||||||
const pendingRequests = new Map<string, AbortController>()
|
const pendingRequests = new Map<string, AbortController>()
|
||||||
let baseURL: any
|
let baseURL: any
|
||||||
if (window && window.process && window.process.type === 'renderer') {
|
if (window && window.process && window.process.type === 'renderer') {
|
||||||
// baseURL = localStorage.getItem('ip') ||'http://192.168.110.25:8848'|| 'http://127.0.0.1:8808'
|
baseURL = localStorage.getItem('ip') || 'http://127.0.0.1:8848'
|
||||||
baseURL = 'http://127.0.0.1:8848'
|
// baseURL = 'http://127.0.0.1:8848'
|
||||||
} else {
|
} else {
|
||||||
baseURL = 'http://192.168.110.25:8848'
|
baseURL = 'http://192.168.110.25:8848'
|
||||||
}
|
}
|
||||||
localStorage.setItem('service', baseURL)
|
// localStorage.setItem('service', baseURL)
|
||||||
|
|
||||||
// 创建自定义配置的axios实例
|
// 创建自定义配置的axios实例
|
||||||
const service: AxiosInstance = axios.create({
|
const service: AxiosInstance = axios.create({
|
||||||
|
|||||||
@ -3,7 +3,7 @@ import { renderVector } from '../views/components/tree/components/hooks/renderVe
|
|||||||
export const initMapData = async (type, data, cd) => {
|
export const initMapData = async (type, data, cd) => {
|
||||||
let entityObject
|
let entityObject
|
||||||
let options
|
let options
|
||||||
let baseURL = localStorage.getItem('service')
|
let baseURL = localStorage.getItem('ip')
|
||||||
switch (type) {
|
switch (type) {
|
||||||
case 'groundText':
|
case 'groundText':
|
||||||
entityObject = new YJ.Obj.GroundText(window.earth, data)
|
entityObject = new YJ.Obj.GroundText(window.earth, data)
|
||||||
|
|||||||
1
src/renderer/src/global.d.ts
vendored
1
src/renderer/src/global.d.ts
vendored
@ -6,7 +6,6 @@ interface Window {
|
|||||||
sendMessage: (msg: string) => void
|
sendMessage: (msg: string) => void
|
||||||
onReply: (callback: (msg: string) => void) => void
|
onReply: (callback: (msg: string) => void) => void
|
||||||
}
|
}
|
||||||
isStandAlone: any
|
|
||||||
treeObj: any
|
treeObj: any
|
||||||
AllNodes: any
|
AllNodes: any
|
||||||
}
|
}
|
||||||
|
|||||||
@ -151,7 +151,7 @@ const fs = require('fs')
|
|||||||
const eventBus: any = inject('bus')
|
const eventBus: any = inject('bus')
|
||||||
var clickTreeNode: any = reactive({})
|
var clickTreeNode: any = reactive({})
|
||||||
var leftClickTreeNode: any = reactive({})
|
var leftClickTreeNode: any = reactive({})
|
||||||
const service = ref(localStorage.getItem('service'))
|
const service = ref(localStorage.getItem('ip'))
|
||||||
|
|
||||||
interface TypeNode {
|
interface TypeNode {
|
||||||
id: string
|
id: string
|
||||||
|
|||||||
@ -159,7 +159,7 @@ const fs = require('fs')
|
|||||||
const eventBus: any = inject('bus')
|
const eventBus: any = inject('bus')
|
||||||
var clickTreeNode: any = reactive({})
|
var clickTreeNode: any = reactive({})
|
||||||
var leftClickTreeNode: any = reactive({})
|
var leftClickTreeNode: any = reactive({})
|
||||||
const service = ref(localStorage.getItem('service'))
|
const service = ref(localStorage.getItem('ip'))
|
||||||
|
|
||||||
interface TypeNode {
|
interface TypeNode {
|
||||||
id: string
|
id: string
|
||||||
|
|||||||
@ -193,7 +193,7 @@ const fs = require('fs')
|
|||||||
const eventBus: any = inject('bus')
|
const eventBus: any = inject('bus')
|
||||||
const imageRef: any = ref('')
|
const imageRef: any = ref('')
|
||||||
var clickTreeNode: any = reactive({})
|
var clickTreeNode: any = reactive({})
|
||||||
const service = ref(localStorage.getItem('service'))
|
const service = ref(localStorage.getItem('ip'))
|
||||||
|
|
||||||
interface TypeNode {
|
interface TypeNode {
|
||||||
id: string
|
id: string
|
||||||
|
|||||||
@ -121,7 +121,7 @@ const isShowPup = ref(false)
|
|||||||
const eventBus: any = inject('bus')
|
const eventBus: any = inject('bus')
|
||||||
const { cusUpdateNode } = useTreeNode()
|
const { cusUpdateNode } = useTreeNode()
|
||||||
var modelName = ref('')
|
var modelName = ref('')
|
||||||
const service = ref(localStorage.getItem('service'))
|
const service = ref(localStorage.getItem('ip'))
|
||||||
|
|
||||||
//tab
|
//tab
|
||||||
interface Model {
|
interface Model {
|
||||||
|
|||||||
@ -45,7 +45,7 @@ const eventBus: any = inject('bus')
|
|||||||
const viewPointHeight: any = ref(1.8)
|
const viewPointHeight: any = ref(1.8)
|
||||||
var rowData: any = reactive([])
|
var rowData: any = reactive([])
|
||||||
var imageData: any = ref(null)
|
var imageData: any = ref(null)
|
||||||
const service = ref(localStorage.getItem('service'))
|
const service = ref(localStorage.getItem('ip'))
|
||||||
// var newData: any = reactive({
|
// var newData: any = reactive({
|
||||||
// name: ''
|
// name: ''
|
||||||
// })
|
// })
|
||||||
|
|||||||
@ -122,7 +122,7 @@ const eventBus: any = inject('bus')
|
|||||||
var modelName = ref('')
|
var modelName = ref('')
|
||||||
var clickTreeNode: any = ref('')
|
var clickTreeNode: any = ref('')
|
||||||
|
|
||||||
const service = ref(localStorage.getItem('service'))
|
const service = ref(localStorage.getItem('ip'))
|
||||||
|
|
||||||
//tab
|
//tab
|
||||||
interface Model {
|
interface Model {
|
||||||
|
|||||||
@ -173,7 +173,7 @@ const { cusUpdateNode } = useTreeNode()
|
|||||||
var modelName = ref('')
|
var modelName = ref('')
|
||||||
|
|
||||||
const availablePort = ref(55110)
|
const availablePort = ref(55110)
|
||||||
const service = ref(localStorage.getItem('service'))
|
const service = ref(localStorage.getItem('ip'))
|
||||||
|
|
||||||
ipcRenderer.invoke('get-available-port').then((port) => {
|
ipcRenderer.invoke('get-available-port').then((port) => {
|
||||||
availablePort.value = port
|
availablePort.value = port
|
||||||
|
|||||||
@ -168,7 +168,7 @@ const init = (obj, selected, hasGEMarker = true, isUrl) => {
|
|||||||
activeName.value = arr[0];
|
activeName.value = arr[0];
|
||||||
}
|
}
|
||||||
hasGEMarker1.value = hasGEMarker;
|
hasGEMarker1.value = hasGEMarker;
|
||||||
url.value = localStorage.getItem('service')
|
url.value = localStorage.getItem('ip')
|
||||||
|
|
||||||
for (const objKey in obj) {
|
for (const objKey in obj) {
|
||||||
let imgList: any = [];
|
let imgList: any = [];
|
||||||
|
|||||||
@ -104,7 +104,7 @@ export const useRightOperate = () => {
|
|||||||
renderVector(params, true)
|
renderVector(params, true)
|
||||||
}
|
}
|
||||||
else if (["geojson"].includes(sourceType)) {
|
else if (["geojson"].includes(sourceType)) {
|
||||||
let baseURL = localStorage.getItem('service')
|
let baseURL = localStorage.getItem('ip')
|
||||||
await addMapSource({
|
await addMapSource({
|
||||||
type: 'geojson',
|
type: 'geojson',
|
||||||
id: id,
|
id: id,
|
||||||
|
|||||||
@ -178,7 +178,7 @@ async function tankuang(id, node, info) {
|
|||||||
let availablePort = await ipcRenderer.invoke('get-available-port');
|
let availablePort = await ipcRenderer.invoke('get-available-port');
|
||||||
window.treeObj.selectNode(node);
|
window.treeObj.selectNode(node);
|
||||||
console.log('BrowserWindow---------------------', electron.BrowserWindow)
|
console.log('BrowserWindow---------------------', electron.BrowserWindow)
|
||||||
let baseURL = localStorage.getItem('service')
|
let baseURL = localStorage.getItem('ip')
|
||||||
// console.log("node.detail.namenode.detail.namenode.detail.name", node.detail);
|
// console.log("node.detail.namenode.detail.namenode.detail.name", node.detail);
|
||||||
let _winMap = await ipcRenderer.invoke('get-_winMap')
|
let _winMap = await ipcRenderer.invoke('get-_winMap')
|
||||||
if (!_winMap.has(id)) {
|
if (!_winMap.has(id)) {
|
||||||
|
|||||||
@ -436,7 +436,7 @@ const getStatus = (time) => {
|
|||||||
}
|
}
|
||||||
|
|
||||||
onMounted(async () => {
|
onMounted(async () => {
|
||||||
let baseURL = localStorage.getItem('service')
|
let baseURL = localStorage.getItem('ip')
|
||||||
getAuthInfo()
|
getAuthInfo()
|
||||||
await YJ.on({ host: baseURL })
|
await YJ.on({ host: baseURL })
|
||||||
createEarth()
|
createEarth()
|
||||||
|
|||||||
@ -1,6 +1,6 @@
|
|||||||
import { validateURL } from '@/utils/validate'
|
import { validateURL } from '@/utils/validate'
|
||||||
import { ElMessage } from 'element-plus'
|
import { ElMessage } from 'element-plus'
|
||||||
import { setIP } from '@/utils/index'
|
import { setIP,getIP } from '@/utils/index'
|
||||||
export const useSetUp = () => {
|
export const useSetUp = () => {
|
||||||
const serviceDialog = ref(false) // 服务设置对话框
|
const serviceDialog = ref(false) // 服务设置对话框
|
||||||
const servVal = ref('单机') // 服务类型选择值
|
const servVal = ref('单机') // 服务类型选择值
|
||||||
@ -8,13 +8,32 @@ export const useSetUp = () => {
|
|||||||
const ip = ref('192.168.1.1')
|
const ip = ref('192.168.1.1')
|
||||||
const port = ref('8890')
|
const port = ref('8890')
|
||||||
const localip = ref('127.0.0.1')
|
const localip = ref('127.0.0.1')
|
||||||
const localport = ref('8808')
|
const localport = ref('8848')
|
||||||
const gpsVal = ref('') // 服务类型选择值
|
const gpsVal = ref('') // 服务类型选择值
|
||||||
const gpsOptions: any = ref([])
|
const gpsOptions: any = ref([])
|
||||||
const servOptions: any = ref([{ name: '单机' }, { name: '网络' }])
|
const servOptions: any = ref([{ name: '单机' }, { name: '网络' }])
|
||||||
const selectedService = ref('接口服务')
|
const selectedService = ref('接口服务')
|
||||||
const serviceOptions: any = ref([{ name: '接口服务' }, { name: '北斗串口' }])
|
const serviceOptions: any = ref([{ name: '接口服务' }, { name: '北斗串口' }])
|
||||||
|
|
||||||
|
let serveUrl:any = getIP()
|
||||||
|
let isOk = validateURL(serveUrl)
|
||||||
|
let serverMode = localStorage.getItem('serverMode')
|
||||||
|
if(isOk) {
|
||||||
|
const parsedUrl = new URL(serveUrl);
|
||||||
|
const host = parsedUrl.host;
|
||||||
|
const ipPort = host.split(':');
|
||||||
|
if(serverMode === 'false') {
|
||||||
|
servVal.value = '网络'
|
||||||
|
ip.value = ipPort[0]
|
||||||
|
port.value = ipPort[1]
|
||||||
|
prototype.value = parsedUrl.protocol.slice(0, -1)
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
localip.value = ipPort[0]
|
||||||
|
localport.value = ipPort[1]
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
const submit = () => {
|
const submit = () => {
|
||||||
switch (selectedService.value) {
|
switch (selectedService.value) {
|
||||||
case '接口服务':
|
case '接口服务':
|
||||||
@ -39,7 +58,7 @@ export const useSetUp = () => {
|
|||||||
// 验证url 合法性
|
// 验证url 合法性
|
||||||
if (isOk) {
|
if (isOk) {
|
||||||
// 网络走这里
|
// 网络走这里
|
||||||
window.isStandAlone = false //判断走哪个服务
|
localStorage.setItem('serverMode', 'false') //判断走哪个服务
|
||||||
setIP(url)
|
setIP(url)
|
||||||
serviceDialog.value = false
|
serviceDialog.value = false
|
||||||
} else {
|
} else {
|
||||||
@ -47,13 +66,15 @@ export const useSetUp = () => {
|
|||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
//单机走这里
|
//单机走这里
|
||||||
window.isStandAlone = true
|
localStorage.setItem('serverMode', 'true')
|
||||||
setIP('http://127.0.0.1:' + localport.value)
|
setIP('http://127.0.0.1:' + localport.value)
|
||||||
serviceDialog.value = false
|
serviceDialog.value = false
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
const initialize = () => {
|
const initialize = () => {
|
||||||
if (!window.isStandAlone) {
|
if(localStorage.getItem('ip')) {}
|
||||||
|
else {
|
||||||
|
if (serverMode==='false') {
|
||||||
setIP('http://127.0.0.1:' + localport.value)
|
setIP('http://127.0.0.1:' + localport.value)
|
||||||
} else {
|
} else {
|
||||||
let url = prototype.value + '://' + ip.value + ':' + port.value
|
let url = prototype.value + '://' + ip.value + ':' + port.value
|
||||||
@ -65,6 +86,7 @@ export const useSetUp = () => {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
return {
|
return {
|
||||||
serviceDialog,
|
serviceDialog,
|
||||||
servVal,
|
servVal,
|
||||||
|
|||||||
Reference in New Issue
Block a user