Merge branch 'zyl' of http://xny.yj-3d.com:3000/zhouyulong/electron-4 into zyl
This commit is contained in:
5
.idea/.gitignore
generated
vendored
Normal file
5
.idea/.gitignore
generated
vendored
Normal file
@ -0,0 +1,5 @@
|
||||
# Default ignored files
|
||||
/shelf/
|
||||
/workspace.xml
|
||||
# Editor-based HTTP Client requests
|
||||
/httpRequests/
|
||||
12
.idea/electron-4.iml
generated
Normal file
12
.idea/electron-4.iml
generated
Normal file
@ -0,0 +1,12 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<module type="WEB_MODULE" version="4">
|
||||
<component name="NewModuleRootManager">
|
||||
<content url="file://$MODULE_DIR$">
|
||||
<excludeFolder url="file://$MODULE_DIR$/temp" />
|
||||
<excludeFolder url="file://$MODULE_DIR$/.tmp" />
|
||||
<excludeFolder url="file://$MODULE_DIR$/tmp" />
|
||||
</content>
|
||||
<orderEntry type="inheritedJdk" />
|
||||
<orderEntry type="sourceFolder" forTests="false" />
|
||||
</component>
|
||||
</module>
|
||||
8
.idea/modules.xml
generated
Normal file
8
.idea/modules.xml
generated
Normal file
@ -0,0 +1,8 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project version="4">
|
||||
<component name="ProjectModuleManager">
|
||||
<modules>
|
||||
<module fileurl="file://$PROJECT_DIR$/.idea/electron-4.iml" filepath="$PROJECT_DIR$/.idea/electron-4.iml" />
|
||||
</modules>
|
||||
</component>
|
||||
</project>
|
||||
6
.idea/vcs.xml
generated
Normal file
6
.idea/vcs.xml
generated
Normal file
@ -0,0 +1,6 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project version="4">
|
||||
<component name="VcsDirectoryMappings">
|
||||
<mapping directory="" vcs="Git" />
|
||||
</component>
|
||||
</project>
|
||||
60
electron.vite.config.1760428378950.mjs
Normal file
60
electron.vite.config.1760428378950.mjs
Normal file
@ -0,0 +1,60 @@
|
||||
// electron.vite.config.ts
|
||||
import { resolve } from "path";
|
||||
import { defineConfig, externalizeDepsPlugin } from "electron-vite";
|
||||
import vue from "@vitejs/plugin-vue";
|
||||
import AutoImport from "unplugin-auto-import/vite";
|
||||
import Components from "unplugin-vue-components/vite";
|
||||
import { ElementPlusResolver } from "unplugin-vue-components/resolvers";
|
||||
import { createSvgIconsPlugin } from "vite-plugin-svg-icons";
|
||||
import path from "path";
|
||||
var electron_vite_config_default = defineConfig({
|
||||
main: {
|
||||
plugins: [externalizeDepsPlugin()]
|
||||
},
|
||||
preload: {
|
||||
plugins: [externalizeDepsPlugin()]
|
||||
},
|
||||
renderer: {
|
||||
resolve: {
|
||||
alias: {
|
||||
"@renderer": resolve("src/renderer/src"),
|
||||
"@": resolve("src/renderer/src")
|
||||
}
|
||||
},
|
||||
plugins: [
|
||||
vue(),
|
||||
AutoImport({
|
||||
imports: ["vue"],
|
||||
dts: "src/auto-imports.d.ts",
|
||||
// 自动生成类型声明文件
|
||||
resolvers: [ElementPlusResolver()]
|
||||
}),
|
||||
Components({
|
||||
resolvers: [ElementPlusResolver()]
|
||||
}),
|
||||
// SVG图标插件配置
|
||||
// 配置SVG图标插件
|
||||
createSvgIconsPlugin({
|
||||
iconDirs: [path.resolve(process.cwd(), "src/renderer/src/icons/svg")],
|
||||
symbolId: "icon-[name]",
|
||||
// 自动清除 SVG 中的 fill 和 stroke 属性
|
||||
svgoOptions: {
|
||||
plugins: [{ name: "removeAttrs", params: { attrs: ["fill", "stroke", "stroke-width"] } }]
|
||||
}
|
||||
})
|
||||
]
|
||||
// server: {
|
||||
// port: 8808,
|
||||
// proxy: {
|
||||
// '/api': {
|
||||
// target: localStorage.getItem('ip') || 'http://127.0.0.1:8808',
|
||||
// changeOrigin: true,
|
||||
// rewrite: (path) => path.replace(/^\/api/, '')
|
||||
// }
|
||||
// }
|
||||
// }
|
||||
}
|
||||
});
|
||||
export {
|
||||
electron_vite_config_default as default
|
||||
};
|
||||
7
package-lock.json
generated
7
package-lock.json
generated
@ -25,6 +25,7 @@
|
||||
"pinia": "^3.0.3",
|
||||
"pinia-plugin-persistedstate": "^4.4.1",
|
||||
"scss": "^0.2.4",
|
||||
"three": "^0.180.0",
|
||||
"verror": "^1.10.1",
|
||||
"vue-clipboard3": "^2.0.0",
|
||||
"vue-i18n": "^9.14.5",
|
||||
@ -12775,6 +12776,12 @@
|
||||
"node": ">= 10.0.0"
|
||||
}
|
||||
},
|
||||
"node_modules/three": {
|
||||
"version": "0.180.0",
|
||||
"resolved": "https://registry.npmmirror.com/three/-/three-0.180.0.tgz",
|
||||
"integrity": "sha512-o+qycAMZrh+TsE01GqWUxUIKR1AL0S8pq7zDkYOQw8GqfX8b8VoCKYUoHbhiX5j+7hr8XsuHDVU6+gkQJQKg9w==",
|
||||
"license": "MIT"
|
||||
},
|
||||
"node_modules/tiny-emitter": {
|
||||
"version": "2.1.0",
|
||||
"resolved": "https://registry.npmmirror.com/tiny-emitter/-/tiny-emitter-2.1.0.tgz",
|
||||
|
||||
@ -1,8 +1,8 @@
|
||||
import { app, shell, BrowserWindow, ipcMain, globalShortcut, dialog } from 'electron'
|
||||
import path, { join } from 'path'
|
||||
import { electronApp, optimizer, is } from '@electron-toolkit/utils'
|
||||
import {app, shell, BrowserWindow, ipcMain, globalShortcut, dialog} from 'electron'
|
||||
import path, {join} from 'path'
|
||||
import {electronApp, optimizer, is} from '@electron-toolkit/utils'
|
||||
import icon from '../../resources/earth.png?asset'
|
||||
import { Recorder } from "../preload/recorder";
|
||||
import {Recorder} from "../preload/recorder";
|
||||
import fs from 'fs'
|
||||
import { exec, spawn } from 'child_process'
|
||||
import dayjs from 'dayjs'
|
||||
@ -69,6 +69,7 @@ stopBatPath = process.platform === 'win32' ? stopBatPath.replace(/^(\w:)/, '/$1'
|
||||
// ? `${join(app.getAppPath(), 'src/renderer/public/startUp/startUp.html')}`
|
||||
// : `file://${join(app.getAppPath(), 'resources/app.asar/out/renderer/startUp/startUp.html')}`
|
||||
let isRestart = false
|
||||
|
||||
function createWindow(): void {
|
||||
// Create the browser window.
|
||||
|
||||
@ -104,7 +105,7 @@ function createWindow(): void {
|
||||
useContentSize: true, // 窗口尺寸包含内容区域而非边框
|
||||
simpleFullscreen: true, // 使用简单全屏模式(仅macOS有效)
|
||||
backgroundColor: '#00000000', // 添加这行设置透明背景
|
||||
...(process.platform === 'linux' ? { icon } : {}),
|
||||
...(process.platform === 'linux' ? {icon} : {}),
|
||||
webPreferences: {
|
||||
preload: join(__dirname, '../preload/index.js'),
|
||||
sandbox: false,
|
||||
@ -179,7 +180,7 @@ function createWindow(): void {
|
||||
event.sender.send("selectedItem", arr);
|
||||
});
|
||||
});
|
||||
ipcMain.on("saveFile", (event, { title, filename, filters }) => {
|
||||
ipcMain.on("saveFile", (event, {title, filename, filters}) => {
|
||||
dialog
|
||||
.showSaveDialog({
|
||||
title,
|
||||
@ -197,9 +198,13 @@ function createWindow(): void {
|
||||
ipcMain.handle('getIsFullScreen', () => {
|
||||
return mainWindow.isFullScreen()
|
||||
});
|
||||
ipcMain.on('toggle-fullscreen', (event) => {
|
||||
ipcMain.on('toggle-fullscreen', (event, flag = null) => {
|
||||
const win = BrowserWindow.fromWebContents(event.sender);
|
||||
win!.setFullScreen(!win!.isFullScreen());
|
||||
let full = !win!.isFullScreen()
|
||||
if (flag != null) {
|
||||
full = flag
|
||||
}
|
||||
win!.setFullScreen(full);
|
||||
});
|
||||
mainWindow.on('enter-full-screen', () => {
|
||||
mainWindow.webContents.send('fullscreen-status-changed', true)
|
||||
@ -226,7 +231,7 @@ function createWindow(): void {
|
||||
let path = dialog.showSaveDialogSync({
|
||||
title: "保存视频文件",
|
||||
defaultPath: dayjs().format("YYYYMMDDHHmmss") + "视频录制.mp4",
|
||||
filters: [{ name: "文件类型", extensions: ["mp4"] }],
|
||||
filters: [{name: "文件类型", extensions: ["mp4"]}],
|
||||
});
|
||||
if (path != undefined) {
|
||||
recorder.move(path, () => {
|
||||
@ -343,7 +348,7 @@ function createWindow(): void {
|
||||
// 设置窗口标题和图标
|
||||
mainWindow.webContents.setWindowOpenHandler((details) => {
|
||||
shell.openExternal(details.url)
|
||||
return { action: 'deny' }
|
||||
return {action: 'deny'}
|
||||
})
|
||||
// 注册 F5 快捷键刷新
|
||||
globalShortcut.register('CommandOrControl+F5', () => {
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
import { contextBridge } from 'electron'
|
||||
import { electronAPI } from '@electron-toolkit/preload'
|
||||
import {contextBridge} from 'electron'
|
||||
import {electronAPI} from '@electron-toolkit/preload'
|
||||
|
||||
// Custom APIs for renderer
|
||||
const api = {}
|
||||
|
||||
3
src/renderer/components.d.ts
vendored
3
src/renderer/components.d.ts
vendored
@ -11,6 +11,7 @@ declare module 'vue' {
|
||||
BaseDialog: typeof import('./src/components/dialog/baseDialog.vue')['default']
|
||||
Directory: typeof import('./src/components/dialog/directory.vue')['default']
|
||||
DirectoryEdit: typeof import('./src/components/dialog/directoryEdit.vue')['default']
|
||||
ElAutoResizer: typeof import('element-plus/es')['ElAutoResizer']
|
||||
ElButton: typeof import('element-plus/es')['ElButton']
|
||||
ElCard: typeof import('element-plus/es')['ElCard']
|
||||
ElCheckbox: typeof import('element-plus/es')['ElCheckbox']
|
||||
@ -20,6 +21,7 @@ declare module 'vue' {
|
||||
ElDialog: typeof import('element-plus/es')['ElDialog']
|
||||
ElForm: typeof import('element-plus/es')['ElForm']
|
||||
ElFormItem: typeof import('element-plus/es')['ElFormItem']
|
||||
ElIcon: typeof import('element-plus/es')['ElIcon']
|
||||
ElImage: typeof import('element-plus/es')['ElImage']
|
||||
ElInput: typeof import('element-plus/es')['ElInput']
|
||||
ElOption: typeof import('element-plus/es')['ElOption']
|
||||
@ -30,6 +32,7 @@ declare module 'vue' {
|
||||
ElSwitch: typeof import('element-plus/es')['ElSwitch']
|
||||
ElTable: typeof import('element-plus/es')['ElTable']
|
||||
ElTableColumn: typeof import('element-plus/es')['ElTableColumn']
|
||||
ElTableV2: typeof import('element-plus/es')['ElTableV2']
|
||||
ElTabPane: typeof import('element-plus/es')['ElTabPane']
|
||||
ElTabs: typeof import('element-plus/es')['ElTabs']
|
||||
ElTree: typeof import('element-plus/es')['ElTree']
|
||||
|
||||
34
src/renderer/src/api/deviceManage/index.ts
Normal file
34
src/renderer/src/api/deviceManage/index.ts
Normal file
@ -0,0 +1,34 @@
|
||||
//设备管理
|
||||
import request from '@/axios/request'
|
||||
import { param } from 'jquery'
|
||||
export const deviceApi = {
|
||||
updateDevice: async (data: any) => {
|
||||
return await request.post({
|
||||
url: `/device/update`,
|
||||
data
|
||||
})
|
||||
},
|
||||
addDevice: async (data: any) => {
|
||||
return await request.post({
|
||||
url: `/device/add`,
|
||||
data
|
||||
})
|
||||
},
|
||||
deviceList: async (data) => {
|
||||
return await request.get({
|
||||
url: `/device/list`,
|
||||
params: data,
|
||||
})
|
||||
},
|
||||
deviceById: async () => {
|
||||
return await request.get({
|
||||
url: `/device/getById`
|
||||
})
|
||||
},
|
||||
delDevice: async (data) => {
|
||||
return await request.get({
|
||||
url: `/device/delete`,
|
||||
params: data,
|
||||
})
|
||||
},
|
||||
}
|
||||
1
src/renderer/src/auto-imports.d.ts
vendored
1
src/renderer/src/auto-imports.d.ts
vendored
@ -8,7 +8,6 @@ export {}
|
||||
declare global {
|
||||
const EffectScope: typeof import('vue')['EffectScope']
|
||||
const ElMessage: typeof import('element-plus/es')['ElMessage']
|
||||
const ElMessageBox: typeof import('element-plus/es')['ElMessageBox']
|
||||
const computed: typeof import('vue')['computed']
|
||||
const createApp: typeof import('vue')['createApp']
|
||||
const customRef: typeof import('vue')['customRef']
|
||||
|
||||
1
src/renderer/src/icons/svg/arrow1.svg
Normal file
1
src/renderer/src/icons/svg/arrow1.svg
Normal file
@ -0,0 +1 @@
|
||||
<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" width="9.066558837890625" height="5.0849609375" viewBox="0 0 9.066558837890625 5.0849609375" fill="none"><path d="M4.53328 5.08491C4.40728 5.08491 4.28655 5.03419 4.19834 4.94419L0.134036 0.797225C-0.0472612 0.612256 -0.0442613 0.315334 0.140723 0.134053C0.325677 -0.0472122 0.622614 -0.0442433 0.803895 0.140741L4.53328 3.94595L8.26267 0.140741C8.44394 -0.0442591 8.74084 -0.0472745 8.92583 0.134053C9.11083 0.31535 9.11381 0.612256 8.93252 0.797225L4.8682 4.94417C4.78 5.03419 4.65928 5.08491 4.53328 5.08491Z" fill="#FFFFFF" ></path></svg>
|
||||
|
After Width: | Height: | Size: 627 B |
1
src/renderer/src/icons/svg/arrow2.svg
Normal file
1
src/renderer/src/icons/svg/arrow2.svg
Normal file
@ -0,0 +1 @@
|
||||
<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" width="9.06658935546875" height="5.0849609375" viewBox="0 0 9.06658935546875 5.0849609375" fill="none"><path d="M4.53328 5.48363e-05C4.40728 5.48363e-05 4.28655 0.0507736 4.19834 0.140773L0.134036 4.28774C-0.0472612 4.4727 -0.0442613 4.76963 0.140723 4.95091C0.325677 5.13217 0.622614 5.1292 0.803895 4.94422L4.53328 1.13901L8.26267 4.94422C8.44394 5.12922 8.74084 5.13224 8.92583 4.95091C9.11083 4.76961 9.11381 4.4727 8.93252 4.28774L4.8682 0.140789C4.78 0.0507736 4.65928 5.48363e-05 4.53328 5.48363e-05Z" fill="#FFFFFF" ></path></svg>
|
||||
|
After Width: | Height: | Size: 623 B |
1
src/renderer/src/icons/svg/loadTemp.svg
Normal file
1
src/renderer/src/icons/svg/loadTemp.svg
Normal file
File diff suppressed because one or more lines are too long
|
After Width: | Height: | Size: 18 KiB |
1
src/renderer/src/icons/svg/pitchImport.svg
Normal file
1
src/renderer/src/icons/svg/pitchImport.svg
Normal file
@ -0,0 +1 @@
|
||||
<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" width="12" height="12" viewBox="0 0 12 12" fill="none"><path d="M11.2506 2.25446L2.99221 2.25446C2.58012 2.25446 2.24268 2.59194 2.24268 3.00411L2.24268 11.2504C2.24268 11.6625 2.58012 12 2.99221 12L11.2506 12C11.6627 12 12.0001 11.6625 12.0001 11.2504L12.0001 3.0041C12.0001 2.59193 11.6627 2.25446 11.2506 2.25446ZM11.247 11.2468L2.99702 11.2468L2.99702 3.0041L11.247 3.0041L11.247 11.2468Z" fill="#FFFFFF" ></path><path d="M2.99209 9.00349L0.749541 9.00349L0.749541 0.757263L8.99838 0.757263L8.99838 2.26282L9.75747 2.26282L9.75747 0.757263C9.75747 0.345095 9.42002 0 9.00793 0L0.749541 0C0.337437 0 0 0.345095 0 0.757263L0 9.00349C0 9.41565 0.337437 9.75313 0.749541 9.75313L2.99209 9.75313L2.99209 9.00349Z" fill="#FFFFFF" ></path><path d="M9.74439 6.75013L7.49499 6.75013L7.49499 4.49957L6.73931 4.49957L6.73931 6.75013L4.49512 6.75013L4.49512 7.50113L6.7441 7.50113L6.7441 9.74953L7.49619 9.74953L7.49619 7.50113L9.74439 7.50113L9.74439 6.75013Z" fill="#FFFFFF" ></path></svg>
|
||||
|
After Width: | Height: | Size: 1.0 KiB |
@ -1,17 +1,19 @@
|
||||
import './assets/main.css'
|
||||
import { createApp } from 'vue'
|
||||
import {createApp} from 'vue'
|
||||
import ElementPlus from 'element-plus'
|
||||
import 'element-plus/dist/index.css'
|
||||
// 引入中文语言包
|
||||
import zhCn from 'element-plus/dist/locale/zh-cn.mjs'
|
||||
import App from './App.vue'
|
||||
import router from './router'
|
||||
import { createI18n } from 'vue-i18n'
|
||||
import { setupStore } from './store'
|
||||
import {createI18n} from 'vue-i18n'
|
||||
import {setupStore} from './store'
|
||||
import zhCN from './I18n/zh-CN'
|
||||
import zhTW from './I18n/zh-TW'
|
||||
import zhEN from './I18n/zh-EN'
|
||||
import 'virtual:svg-icons-register'
|
||||
import { setupSvgIcon } from './icons'
|
||||
import { EventBusPlugin } from './utils/bus'
|
||||
import {setupSvgIcon} from './icons'
|
||||
import {EventBusPlugin} from './utils/bus'
|
||||
import './assets/styles/font.css'
|
||||
import './assets/iconfont/font_4587902_y4fhjyq8fxn'
|
||||
// import './assets/styles/dhtmlxgantt.css'
|
||||
@ -54,7 +56,8 @@ if (!localStorage.getItem("AMapKey")) {
|
||||
sheetIndexStatusSwitch: false, //标准图幅
|
||||
skinInfo: 'yingguangse', //主题色
|
||||
language: 'zh-CN', //语言
|
||||
coordinate: 'EPSG:4326' //坐标系
|
||||
coordinate: 'EPSG:4326', //坐标系
|
||||
positionType: '度'
|
||||
})
|
||||
)
|
||||
: console.log("没有设置系统设置");
|
||||
@ -83,6 +86,8 @@ setupStore(setApp)
|
||||
setupSvgIcon(setApp)
|
||||
setApp.use(EventBusPlugin)
|
||||
setApp.use(router)
|
||||
setApp.use(ElementPlus)
|
||||
setApp.use(ElementPlus, {
|
||||
locale: zhCn
|
||||
})
|
||||
setApp.use(i18n)
|
||||
setApp.mount('#app')
|
||||
|
||||
@ -1,4 +1,4 @@
|
||||
import { createRouter, createWebHashHistory } from 'vue-router'
|
||||
import {createRouter, createWebHashHistory} from 'vue-router'
|
||||
import homeIndex from '@/views/home/index.vue'
|
||||
|
||||
const routes = [
|
||||
@ -7,7 +7,9 @@ const routes = [
|
||||
component: () => import('@/views/login/index.vue'),
|
||||
hidden: true
|
||||
},
|
||||
{ path: '/404', component: () => import('@/views/404.vue'), hidden: true },
|
||||
{path: '/ts', component: () => import('@/views/TS/index.vue'), hidden: true},
|
||||
{path: '/tsEdit', component: () => import('@/views/TS/edit.vue'), hidden: true},
|
||||
{path: '/404', component: () => import('@/views/404.vue'), hidden: true},
|
||||
|
||||
{
|
||||
path: '/home',
|
||||
@ -16,7 +18,7 @@ const routes = [
|
||||
hidden: true
|
||||
},
|
||||
|
||||
{ path: '/:pathMatch(.*)*', redirect: '/404', hidden: true }
|
||||
{path: '/:pathMatch(.*)*', redirect: '/404', hidden: true}
|
||||
]
|
||||
|
||||
const router = createRouter({
|
||||
@ -28,9 +30,9 @@ router.beforeEach((to, from, next) => {
|
||||
if (to.path === '/') {
|
||||
next()
|
||||
} else {
|
||||
if(localStorage.getItem('Authorization')) {
|
||||
if (localStorage.getItem('Authorization')) {
|
||||
next()
|
||||
}else
|
||||
} else
|
||||
next("/")
|
||||
}
|
||||
})
|
||||
|
||||
113
src/renderer/src/views/TS/cabin.vue
Normal file
113
src/renderer/src/views/TS/cabin.vue
Normal file
@ -0,0 +1,113 @@
|
||||
<template>
|
||||
<div class="cabin">
|
||||
<div>
|
||||
<span>仿真演练图层指挥舱</span>
|
||||
</div>
|
||||
<div>
|
||||
<el-input
|
||||
v-model="input2"
|
||||
class="responsive-input"
|
||||
placeholder="搜索"
|
||||
:prefix-icon="Search"
|
||||
/>
|
||||
</div>
|
||||
<div class="treeBox">
|
||||
<ul id="treeDemos" class="ztree" :setting="setting"></ul>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script setup lang="ts">
|
||||
import {onMounted, ref} from 'vue'
|
||||
import {Search} from '@element-plus/icons-vue'
|
||||
|
||||
const setting = {
|
||||
edit: {
|
||||
enable: true,
|
||||
showRemoveBtn: false,
|
||||
showRenameBtn: false,
|
||||
drag: {
|
||||
isMove: true,
|
||||
isCopy: false,
|
||||
},
|
||||
},
|
||||
check: {
|
||||
enable: true,
|
||||
nocheckInherit: false,
|
||||
chkboxType: {Y: "s", N: "s"},
|
||||
},
|
||||
view: {
|
||||
selectedMulti: true,
|
||||
dblClickExpand: false,
|
||||
// autoCancelSelected: true
|
||||
},
|
||||
data: {
|
||||
key: {
|
||||
//zdatas数据中表示节点name的属性key
|
||||
name: "name",
|
||||
checked: "is_show",
|
||||
},
|
||||
simpleData: {
|
||||
enable: true,
|
||||
idKey: "id",
|
||||
pIdKey: "p_id",
|
||||
nameKey: "name",
|
||||
},
|
||||
},
|
||||
callback: {
|
||||
/*onRightClick: this.rightClick,
|
||||
onClick: this.onClick,
|
||||
onDblClick: this.onDblClick,
|
||||
onCheck: this.onCheck,
|
||||
onDrop: this.onDrop,*/
|
||||
/*
|
||||
onDrop: this.onDrop,
|
||||
beforeRemove: this.beforeRemove,
|
||||
beforeDrop: this.beforeDrop,
|
||||
// beforeCollapse: this.beforeCollapse,
|
||||
onRemove: this.onRemove,
|
||||
onMouseDown: this.onMouseDown,
|
||||
onClick: this.onClick,
|
||||
onDblClick: this.onDblClick,
|
||||
beforeClick: this.zTreeBeforeClick,
|
||||
onCheck: this.onCheck*/
|
||||
},
|
||||
}
|
||||
|
||||
let input2 = ref('')
|
||||
onMounted(() => {
|
||||
let data = [
|
||||
{name: "88"}
|
||||
]
|
||||
$.fn.zTree.init($(`#treeDemos`), setting, data)
|
||||
})
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
.cabin {
|
||||
width: 16.3vw;
|
||||
height: 59.6vh;
|
||||
position: absolute;
|
||||
z-index: 99;
|
||||
top: 13.4259259259vh;
|
||||
right: 1.5625vw;
|
||||
border: 0.078125vw solid rgb(0, 255, 255);
|
||||
background: linear-gradient(180deg, rgba(0, 255, 255, 0.2) 0%, rgba(0, 255, 255, 0) 100%), rgba(0, 0, 0, 0.5);
|
||||
color: #fff;
|
||||
padding: 0 5px;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
|
||||
.treeBox {
|
||||
border: 1px solid red;
|
||||
flex: auto;
|
||||
}
|
||||
}
|
||||
|
||||
:deep(.el-input__wrapper), :deep(.el-input__inner ) {
|
||||
background: transparent;
|
||||
--el-input-placeholder-color: #fff;
|
||||
color: #fff;
|
||||
//border: 1px solid #0ff;
|
||||
}
|
||||
</style>
|
||||
49
src/renderer/src/views/TS/edit.vue
Normal file
49
src/renderer/src/views/TS/edit.vue
Normal file
@ -0,0 +1,49 @@
|
||||
<template>
|
||||
<div class="edit">
|
||||
<svg class="icon icon-tuichu" @click="closeSituationEdit" aria-hidden="true">
|
||||
<use xlink:href="#icon-tuichu"></use>
|
||||
</svg>
|
||||
<div id="earthContainer" class="fullSize"></div>
|
||||
<cabin></cabin>
|
||||
<element></element>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script setup lang="ts">
|
||||
import {ref, onMounted} from "vue";
|
||||
import {useRouter} from "vue-router";
|
||||
import cabin from "./cabin.vue"
|
||||
import element from "./element.vue"
|
||||
|
||||
const router = useRouter()
|
||||
const closeSituationEdit = () => {
|
||||
router.back()
|
||||
}
|
||||
const createEarth = async () => {
|
||||
window.earth_ts = await new YJ.YJEarth('earthContainer', {navigationHelpButton: false})
|
||||
YJ.Global.CesiumContainer(earth_ts, {compass: false, legend: false});
|
||||
setTimeout(() => {
|
||||
new YJ.Tools(window.earth_ts).flyHome()
|
||||
}, 1000)
|
||||
}
|
||||
onMounted(async () => {
|
||||
let baseURL = localStorage.getItem('service')
|
||||
// getAuthInfo()
|
||||
await YJ.on({host: baseURL})
|
||||
createEarth()
|
||||
})
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
.edit {
|
||||
.icon-tuichu {
|
||||
position: absolute;
|
||||
top: 0.462962963vh;
|
||||
right: 0.2604166667vw;
|
||||
z-index: 999;
|
||||
width: 1.25vw !important;
|
||||
height: 2.2222222222vh !important;
|
||||
cursor: pointer;
|
||||
}
|
||||
}
|
||||
</style>
|
||||
261
src/renderer/src/views/TS/element.vue
Normal file
261
src/renderer/src/views/TS/element.vue
Normal file
@ -0,0 +1,261 @@
|
||||
<template>
|
||||
<div class="element">
|
||||
<div class="title">
|
||||
<span>元素库</span>
|
||||
</div>
|
||||
<!-- <div>
|
||||
<el-input
|
||||
v-model="input2"
|
||||
class="responsive-input"
|
||||
placeholder="搜索"
|
||||
:prefix-icon="Search"
|
||||
/>
|
||||
</div>-->
|
||||
<div class="tabsBox">
|
||||
<div class="tabs">
|
||||
<div v-for="(item,index) in tabs" @click="handleTabClick(item,index)" :class="index==activIndex?'active':''">
|
||||
{{ item.name }}
|
||||
</div>
|
||||
</div>
|
||||
<div class="panel">
|
||||
<div class="treeOrList">
|
||||
<template v-if="dataType=='tree'">
|
||||
<el-tree
|
||||
:data="data"
|
||||
:props="defaultProps"
|
||||
@node-click="handleNodeClick"
|
||||
/>
|
||||
</template>
|
||||
<template v-if="dataType=='list'">
|
||||
<div v-for="item in lists">
|
||||
{{ item.name }}
|
||||
</div>
|
||||
</template>
|
||||
|
||||
</div>
|
||||
<div class="list" v-if="showList">
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script lang="ts" setup>
|
||||
import {ref} from "vue";
|
||||
import {Search} from '@element-plus/icons-vue'
|
||||
|
||||
interface Tree {
|
||||
label: string
|
||||
children?: Tree[]
|
||||
}
|
||||
|
||||
const activIndex = ref(0)
|
||||
const tabs = [
|
||||
{name: "人工模型", dataType: 'tree',},
|
||||
{name: "军事标绘", dataType: 'tree',},
|
||||
{
|
||||
name: "基础标绘", dataType: 'list', children:
|
||||
[
|
||||
{name: "点"},
|
||||
{name: "线"},
|
||||
{name: "面"},
|
||||
{name: "圆"}
|
||||
]
|
||||
},
|
||||
{name: "特效", dataType: 'list', children: [{name: "火焰"}]},
|
||||
]
|
||||
|
||||
|
||||
const data: Tree[] = [
|
||||
{
|
||||
label: 'Level one 1',
|
||||
children: [
|
||||
{
|
||||
label: 'Level two 1-1',
|
||||
children: [
|
||||
|
||||
{
|
||||
label: 'Level three 1-1-1',
|
||||
},
|
||||
],
|
||||
},
|
||||
],
|
||||
},
|
||||
{
|
||||
label: 'Level one 2',
|
||||
children: [
|
||||
{
|
||||
label: 'Level two 2-1',
|
||||
children: [
|
||||
{
|
||||
label: 'Level three 2-1-1',
|
||||
},
|
||||
],
|
||||
},
|
||||
{
|
||||
label: 'Level two 2-2',
|
||||
children: [
|
||||
{
|
||||
label: 'Level three 2-2-1',
|
||||
},
|
||||
],
|
||||
},
|
||||
],
|
||||
},
|
||||
{
|
||||
label: 'Level one 3',
|
||||
children: [
|
||||
{
|
||||
label: 'Level two 3-1',
|
||||
children: [
|
||||
{
|
||||
label: 'Level three 3-1-1',
|
||||
},
|
||||
],
|
||||
},
|
||||
{
|
||||
label: 'Level two 3-2',
|
||||
children: [
|
||||
{
|
||||
label: 'Level three 3-2-1',
|
||||
},
|
||||
],
|
||||
},
|
||||
],
|
||||
},
|
||||
]
|
||||
|
||||
const defaultProps = {
|
||||
children: 'children',
|
||||
label: 'label',
|
||||
}
|
||||
const lists = ref([])
|
||||
let input2 = ref('')
|
||||
// 显示某类型下的元素
|
||||
const showList = ref(false)
|
||||
// 是否为树结构
|
||||
const dataType = ref('tree')
|
||||
// 树形结构节点点击
|
||||
const handleTabClick = (item, index) => {
|
||||
activIndex.value = index
|
||||
console.log(item)
|
||||
dataType.value = item.dataType
|
||||
if (item.children) {
|
||||
lists.value = item.children
|
||||
}
|
||||
}
|
||||
const handleNodeClick = (data: Tree) => {
|
||||
console.log(data)
|
||||
showList.value = true
|
||||
}
|
||||
|
||||
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
.element {
|
||||
width: 16.3vw;
|
||||
height: 59.6vh;
|
||||
position: absolute;
|
||||
z-index: 99;
|
||||
top: 13.4259259259vh;
|
||||
left: 1.5625vw;
|
||||
border: 0.078125vw solid rgb(0, 255, 255);
|
||||
background: linear-gradient(180deg, rgba(0, 255, 255, 0.2) 0%, rgba(0, 255, 255, 0) 100%), rgba(0, 0, 0, 0.5);
|
||||
color: #fff;
|
||||
padding: 0 5px;
|
||||
//display: flex;
|
||||
//flex-direction: column;
|
||||
.title {
|
||||
height: 30px;
|
||||
line-height: 30px;
|
||||
}
|
||||
|
||||
.tabsBox {
|
||||
//flex: auto;
|
||||
height: calc(100% - 30px);
|
||||
//display: flex;
|
||||
//flex-direction: column;
|
||||
.tabs {
|
||||
height: 30px;
|
||||
line-height: 30px;
|
||||
display: flex;
|
||||
//justify-content: space-between;
|
||||
//border-bottom: 1px solid #eee;
|
||||
cursor: pointer;
|
||||
|
||||
& > div {
|
||||
width: 25%;
|
||||
border-bottom: 1px solid rgba(238, 238, 238, 0.36);
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
.active {
|
||||
border-bottom: 2px solid #0ff;
|
||||
}
|
||||
}
|
||||
|
||||
.panel {
|
||||
flex: auto;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
height: calc(100% - 30px);
|
||||
|
||||
.treeOrList {
|
||||
//flex: auto;
|
||||
height: calc(100% - 300px);
|
||||
overflow-y: auto;
|
||||
|
||||
.el-tree {
|
||||
background: transparent;
|
||||
width: 100%;
|
||||
}
|
||||
}
|
||||
|
||||
.list {
|
||||
border: 1px solid #eee;
|
||||
height: 300px;
|
||||
overflow-y: auto;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
:deep(.el-input__wrapper), :deep(.el-input__inner ) {
|
||||
background: transparent;
|
||||
--el-input-placeholder-color: #fff;
|
||||
color: #fff;
|
||||
//border: 1px solid #0ff;
|
||||
}
|
||||
|
||||
:deep(.el-tree-node__content:hover ) {
|
||||
--el-tree-node-hover-bg-color: rgba(0, 255, 255, 0.38);
|
||||
//--el-tree-node-hover-bg-color: linear-gradient(90deg, rgba(0, 255, 255, 0.5) 0%, rgba(0, 255, 255, 0) 100%) !important;
|
||||
|
||||
/* &:hover {
|
||||
.is-current {
|
||||
background-color: linear-gradient(90deg, rgba(0, 255, 255, 0.5) 0%, rgba(0, 255, 255, 0) 100%);
|
||||
}
|
||||
}*/
|
||||
|
||||
//--el-tree-expand-icon-color: #fff;
|
||||
}
|
||||
|
||||
:deep(.el-tree-node.is-current ) {
|
||||
|
||||
& > .el-tree-node__content {
|
||||
background: linear-gradient(90deg, rgba(0, 255, 255, 0.5) 0%, rgba(0, 255, 255, 0) 100%);
|
||||
|
||||
& > .el-tree-node__label {
|
||||
color: #0ff;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
:deep(.el-text ) {
|
||||
--el-text-color: #fff !important;
|
||||
}
|
||||
</style>
|
||||
367
src/renderer/src/views/TS/index.vue
Normal file
367
src/renderer/src/views/TS/index.vue
Normal file
@ -0,0 +1,367 @@
|
||||
<template>
|
||||
<div class="index">
|
||||
<!--<span @click="back">态势</span>-->
|
||||
<div class="titles">实景三维态势推演系统</div>
|
||||
<svg class="icon icon-top" aria-hidden="true">
|
||||
<use xlink:href="#icon-top"></use>
|
||||
</svg>
|
||||
<svg class="icon icon-tuichudenglu" @click="back" aria-hidden="true">
|
||||
<use xlink:href="#icon-tuichudenglu"></use>
|
||||
</svg>
|
||||
<div class="list-container">
|
||||
<div class="sub-title">
|
||||
<span>历史推演</span>
|
||||
<svg class="icon icon-title" aria-hidden="true">
|
||||
<use xlink:href="#icon-title"></use>
|
||||
</svg>
|
||||
</div>
|
||||
<div class="search">
|
||||
<span>推演名称 <el-input
|
||||
v-model="searchParams.name"
|
||||
style="width: 240px"
|
||||
placeholder="请输入推演名称"
|
||||
clearable
|
||||
/></span>
|
||||
<span>创建人 <el-input
|
||||
v-model="searchParams.create_by"
|
||||
style="width: 240px"
|
||||
placeholder="请输入创建人姓名"
|
||||
clearable
|
||||
/></span>
|
||||
<span>创建时间 <el-date-picker
|
||||
v-model="searchParams.datetime"
|
||||
type="datetimerange"
|
||||
start-placeholder="开始日期"
|
||||
end-placeholder="结束日期"
|
||||
format="YYYY-MM-DD HH:mm:ss"
|
||||
date-format="YYYY-MM-DD ddd"
|
||||
time-format="A hh:mm:ss"
|
||||
value-format="x"
|
||||
/></span>
|
||||
<el-button @click="search">搜索</el-button>
|
||||
<el-button @click="reset">重置</el-button>
|
||||
</div>
|
||||
<div class="option">
|
||||
<el-button :icon="CirclePlus">新建推演</el-button>
|
||||
<el-button :icon="Download">导入</el-button>
|
||||
<el-button :icon="Upload">导出</el-button>
|
||||
</div>
|
||||
<div class="tableBox">
|
||||
<el-table
|
||||
:data="tableData"
|
||||
:default-sort="{ prop: 'date', order: 'descending' }"
|
||||
style="width: 100%"
|
||||
>
|
||||
<el-table-column align="center" prop="name" label="推演名称"/>
|
||||
<el-table-column align="center" prop="description" label="推演描述"/>
|
||||
<el-table-column align="center" prop="create_by" label="创建人"/>
|
||||
<el-table-column align="center" prop="date" label="创建日期" sortable/>
|
||||
<el-table-column align="center" label="操作">
|
||||
<template #default="scope">
|
||||
<el-button text size="small" type="primary" :icon="Edit" @click="toTSEdit">编辑</el-button>
|
||||
<el-button text size="small" type="primary" :icon="Delete">删除</el-button>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
<!-- <el-auto-resizer>
|
||||
<template #default="{ height, width }">
|
||||
<el-table-v2
|
||||
:sort-by="sortState"
|
||||
:columns="columns"
|
||||
:data="data"
|
||||
:width="width"
|
||||
:height="height"
|
||||
fixed
|
||||
@column-sort="onSort"
|
||||
/>
|
||||
</template>
|
||||
</el-auto-resizer>-->
|
||||
</div>
|
||||
<!-- <div class="pageBox">
|
||||
|
||||
<el-pagination @size-change="handleSizeChange" @current-change="handleCurrentChange" :current-page="pageNum"
|
||||
:page-sizes="[5, 10, 50, 100]" :page-size="pageSize"
|
||||
layout="total, sizes, prev, pager, next, jumper"
|
||||
:total="total">
|
||||
</el-pagination>
|
||||
</div>-->
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script setup lang="ts">
|
||||
import {ref} from "vue";
|
||||
import {useRouter} from "vue-router";
|
||||
import {Delete, Edit, CirclePlus, Download, Upload} from '@element-plus/icons-vue'
|
||||
import {TableV2SortOrder} from 'element-plus'
|
||||
import type {SortBy} from 'element-plus'
|
||||
|
||||
const {ipcRenderer} = require('electron')
|
||||
const router = useRouter()
|
||||
let searchParams = ref({
|
||||
name: "",
|
||||
create_by: "",
|
||||
datetime: "",
|
||||
})
|
||||
|
||||
let pageSize = ref(5)
|
||||
let pageNum = ref(1)
|
||||
let total = ref(0)
|
||||
const back = () => {
|
||||
ipcRenderer.send('toggle-fullscreen', false)
|
||||
router.push({path: '/home'})
|
||||
}
|
||||
const handleSizeChange = (val) => {
|
||||
pageSize = val
|
||||
getList();
|
||||
}
|
||||
const handleCurrentChange = (val) => {
|
||||
pageNum = val
|
||||
getList();
|
||||
}
|
||||
const getList = () => {
|
||||
console.log(pageSize, pageNum)
|
||||
}
|
||||
const tableData: User[] = [
|
||||
{
|
||||
date: '2016-05-03',
|
||||
name: '测试',
|
||||
description: "这是一个方案描述",
|
||||
create_by: "admin",
|
||||
},
|
||||
{
|
||||
date: '2016-05-02',
|
||||
name: '协同方案',
|
||||
description: "这是一个方案描述",
|
||||
create_by: "admin",
|
||||
},
|
||||
{
|
||||
date: '2016-05-04',
|
||||
name: '1990',
|
||||
description: "这是一个方案描述",
|
||||
create_by: "admin",
|
||||
},
|
||||
{
|
||||
date: '2016-05-01',
|
||||
name: '2025',
|
||||
description: "这是一个方案描述",
|
||||
create_by: "admin",
|
||||
},
|
||||
]
|
||||
const search = () => {
|
||||
console.log(searchParams)
|
||||
|
||||
}
|
||||
const reset = () => {
|
||||
searchParams.value = {name: "", create_by: "", datetime: ""}
|
||||
}
|
||||
const toTSEdit = () => {
|
||||
router.push({path: '/tsEdit'})
|
||||
}
|
||||
/*
|
||||
const generateData = (
|
||||
columns: ReturnType<typeof generateColumns>,
|
||||
length = 200,
|
||||
prefix = 'row-'
|
||||
) =>
|
||||
Array.from({length}).map((_, rowIndex) => {
|
||||
return columns.reduce(
|
||||
(rowData, column, columnIndex) => {
|
||||
rowData[column.dataKey] = `Row ${rowIndex} - Col ${columnIndex}`
|
||||
return rowData
|
||||
},
|
||||
{
|
||||
id: `${prefix}${rowIndex}`,
|
||||
parentId: null,
|
||||
}
|
||||
)
|
||||
})
|
||||
const generateColumns = (length = 10, prefix = 'column-', props?: any) =>
|
||||
Array.from({length}).map((_, columnIndex) => ({
|
||||
...props,
|
||||
key: `${prefix}${columnIndex}`,
|
||||
dataKey: `${prefix}${columnIndex}`,
|
||||
title: `Column ${columnIndex}`,
|
||||
width: 150,
|
||||
}))
|
||||
const columns = generateColumns(3)
|
||||
const sortState = ref<SortBy>({
|
||||
key: 'column-0',
|
||||
order: TableV2SortOrder.ASC,
|
||||
})
|
||||
|
||||
let data = generateData(columns, 10)
|
||||
console.log(data)
|
||||
console.log(columns)
|
||||
columns[0].sortable = true
|
||||
const onSort = (sortBy: SortBy) => {
|
||||
console.log(sortBy)
|
||||
data = data.reverse()
|
||||
sortState.value = sortBy
|
||||
}
|
||||
*/
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
|
||||
|
||||
.index {
|
||||
background: url("../../assets/img/bkgif@3x.gif") no-repeat;
|
||||
background-size: 100% 100%;
|
||||
width: 100vw;
|
||||
height: 100vh !important;
|
||||
position: relative;
|
||||
|
||||
.titles {
|
||||
left: 50%;
|
||||
transform: translateX(-50%);
|
||||
font-size: 40px;
|
||||
top: 19px;
|
||||
line-height: 50px;
|
||||
font-family: "alimamashuheiti";
|
||||
z-index: 999;
|
||||
position: absolute;
|
||||
color: #fff;
|
||||
}
|
||||
|
||||
.icon-top {
|
||||
width: 100%;
|
||||
height: 95px;
|
||||
top: 0;
|
||||
left: 0;
|
||||
z-index: 99;
|
||||
position: absolute;
|
||||
}
|
||||
|
||||
.icon-tuichudenglu {
|
||||
cursor: pointer;
|
||||
position: absolute;
|
||||
z-index: 999;
|
||||
width: 26px;
|
||||
height: 26px;
|
||||
right: 8px;
|
||||
top: 8px;
|
||||
}
|
||||
|
||||
.list-container {
|
||||
border: 1px solid #0ff;
|
||||
position: absolute;
|
||||
top: 50%;
|
||||
left: 50%;
|
||||
transform: translate(-50%, -50%);
|
||||
width: 80vw;
|
||||
height: 72vh;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
background: linear-gradient(180deg, rgba(0, 255, 255, 0.2) 0%, rgba(0, 255, 255, 0) 100%), rgba(0, 0, 0, 0.6);
|
||||
border-image: linear-gradient(137.95deg, rgba(0, 255, 255, 1) 6.25%, rgba(0, 200, 255, 1) 100%) 2;
|
||||
backdrop-filter: blur(2px);
|
||||
|
||||
& > div {
|
||||
padding: 10px 0;
|
||||
margin: 0 auto;
|
||||
width: 95%;
|
||||
//border: 1px solid;
|
||||
box-sizing: content-box;
|
||||
}
|
||||
|
||||
.sub-title {
|
||||
font-size: 32px;
|
||||
width: 15.4350566864vw;
|
||||
height: 4.0740740741vh;
|
||||
//padding: vh(20);
|
||||
position: relative;
|
||||
|
||||
span {
|
||||
position: absolute;
|
||||
left: 50%;
|
||||
top: 50%;
|
||||
transform: translate(-50%, -50%);
|
||||
//font-family: W7;
|
||||
user-select: none;
|
||||
}
|
||||
|
||||
.icon-title {
|
||||
width: 15.4350566864vw;
|
||||
height: 4.0740740741vh;
|
||||
}
|
||||
}
|
||||
|
||||
.search {
|
||||
span {
|
||||
margin-right: 10px;
|
||||
}
|
||||
}
|
||||
|
||||
.tableBox {
|
||||
flex: auto;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
//将表格所有的背景色都改为透明色,字体改为白色
|
||||
:deep(.el-table), :deep(.el-table tr), :deep(.el-table .el-table__cell) {
|
||||
background-color: transparent;
|
||||
color: #fff;
|
||||
|
||||
}
|
||||
|
||||
//表格行hover和表头的背景色
|
||||
:deep(.el-table__header-wrapper),
|
||||
:deep(.el-table--enable-row-hover .el-table__body tr:hover>td.el-table__cell ) {
|
||||
background-color: rgba(0, 255, 255, 0.2);
|
||||
}
|
||||
|
||||
:deep(.el-button) {
|
||||
color: #fff;
|
||||
}
|
||||
|
||||
:deep(.el-button:not(.is-text)) {
|
||||
border: 1px solid #0ff;
|
||||
background: rgba(0, 255, 255, 0.2);
|
||||
}
|
||||
|
||||
:deep(.el-button:hover) {
|
||||
color: #0ff;
|
||||
//background-color: transparent !important;
|
||||
background: rgba(0, 255, 255, 0.2) !important;
|
||||
}
|
||||
|
||||
:deep(.el-input__wrapper), :deep(.el-range-input), :deep(.el-range-separator) {
|
||||
background: transparent;
|
||||
--el-input-placeholder-color: #fff;
|
||||
--el-text-color-placeholder: #fff;
|
||||
color: #fff;
|
||||
}
|
||||
|
||||
:deep(.el-input__inner:focus) {
|
||||
border-color: #f00;
|
||||
}
|
||||
|
||||
:deep(.el-table__inner-wrapper:before) {
|
||||
background: transparent;
|
||||
}
|
||||
|
||||
:deep(.el-table__header-wrapper .el-table__cell) {
|
||||
border-bottom: none !important;
|
||||
}
|
||||
|
||||
:deep(.el-table__row .el-table__cell) {
|
||||
border-bottom: 1px solid rgba(152, 152, 152, 0.5);
|
||||
}
|
||||
|
||||
/*
|
||||
表格V2
|
||||
:deep(.el-table-v2__main) {
|
||||
background-color: transparent;
|
||||
}
|
||||
|
||||
:deep(.el-table-v2__header-cell) {
|
||||
background-color: transparent;
|
||||
color: #fff;
|
||||
}
|
||||
|
||||
:deep(.el-table-v2__header-wrapper) {
|
||||
background-color: rgba(0, 255, 255, 0.2);
|
||||
}*/
|
||||
</style>
|
||||
@ -1,7 +1,11 @@
|
||||
<template>
|
||||
<div class="equipment">
|
||||
<div class="equipment_title">
|
||||
<el-button color="#004b4b" style="border: 1px solid rgba(0, 255, 255, 0.5)">
|
||||
<el-button
|
||||
color="#004b4b"
|
||||
style="border: 1px solid rgba(0, 255, 255, 0.5)"
|
||||
@click="edit('添加设备')"
|
||||
>
|
||||
<template #icon>
|
||||
<svg-icon name="leading_in" />
|
||||
</template>
|
||||
@ -9,40 +13,47 @@
|
||||
</el-button>
|
||||
<el-button color="#004b4b" style="border: 1px solid rgba(0, 255, 255, 0.5)">
|
||||
<template #icon>
|
||||
<svg-icon name="leading_in" />
|
||||
<svg-icon name="loadTemp" />
|
||||
</template>
|
||||
<span>批量导入</span>
|
||||
<span>下载模板</span>
|
||||
</el-button>
|
||||
<el-button color="#004b4b" style="border: 1px solid rgba(0, 255, 255, 0.5)">
|
||||
<template #icon>
|
||||
<svg-icon name="leading_in" />
|
||||
<svg-icon name="pitchImport" />
|
||||
</template>
|
||||
<span>批量模版</span>
|
||||
<span>批量导入</span>
|
||||
</el-button>
|
||||
<el-input
|
||||
v-model="input3"
|
||||
style="max-width: 250px"
|
||||
placeholder="Please input"
|
||||
placeholder="请输入设备名称进行搜索"
|
||||
class="input-with-select"
|
||||
:suffix-icon="Search"
|
||||
>
|
||||
<template #append>
|
||||
<el-button :icon="Search" color="#004b4b" />
|
||||
</template>
|
||||
</el-input>
|
||||
</div>
|
||||
|
||||
<div class="nav_table">
|
||||
<el-table :data="tableData" style="width: 100%">
|
||||
<el-table-column fixed prop="date" label="Date" width="150" />
|
||||
<el-table-column prop="name" label="Name" width="120" />
|
||||
<el-table-column prop="state" label="State" width="120" />
|
||||
<el-table-column prop="city" label="City" width="120" />
|
||||
<el-table-column prop="address" label="Address" width="600" />
|
||||
<el-table-column prop="zip" label="Zip" width="120" />
|
||||
<el-table-column fixed="right" label="Operations" min-width="120">
|
||||
<template #default>
|
||||
<el-button link type="primary" size="small"> Detail </el-button>
|
||||
<el-button link type="primary" size="small">Edit</el-button>
|
||||
<el-table :data="tableData" height="40vh" style="width: 100%">
|
||||
<el-table-column fixed prop="cameraName" label="设备名称" width="150" />
|
||||
<el-table-column prop="deviceType" label="设备类型" width="120">
|
||||
<template #default="scope">
|
||||
<span class="deviceType"></span>
|
||||
{{ statusTrans(scope.row.type) }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="ip" label="设备IP" width="120" />
|
||||
<el-table-column prop="port" label="设备端口" width="120" />
|
||||
<el-table-column prop="userName" label="用户名" width="120" />
|
||||
<el-table-column prop="password" label="密码" width="120" />
|
||||
<el-table-column prop="channel" label="通道号" width="120" />
|
||||
<el-table-column prop="flvUrl" label="flv地址" width="300" />
|
||||
<el-table-column fixed="right" label="操作" min-width="120">
|
||||
<template #default="scope">
|
||||
<el-button link type="primary" size="small" @click="edit('编辑设备', scope.row)">
|
||||
编辑
|
||||
</el-button>
|
||||
<el-button link type="primary" size="small" @click="delFun(scope.row)">删除</el-button>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
@ -50,7 +61,7 @@
|
||||
<div>
|
||||
<Pagination
|
||||
:total="total"
|
||||
v-model:page="pages.pageNo"
|
||||
v-model:page="pages.pageNum"
|
||||
v-model:limit="pages.pageSize"
|
||||
@pagination="getTableList"
|
||||
/>
|
||||
@ -60,33 +71,164 @@
|
||||
|
||||
<script setup lang="ts">
|
||||
import { Search } from '@element-plus/icons-vue'
|
||||
import { deviceApi } from '@/api/deviceManage/index'
|
||||
import Dialog from '@/components/dialog/baseDialog.vue'
|
||||
import { ElMessage, ElMessageBox } from 'element-plus'
|
||||
|
||||
const eventBus: any = inject('bus')
|
||||
|
||||
const input3 = ref('')
|
||||
const tableData: any = ref([])
|
||||
const total = ref(100)
|
||||
// 页码
|
||||
let pages: any = reactive({
|
||||
pageNo: 1,
|
||||
pageNum: 1,
|
||||
pageSize: 10
|
||||
})
|
||||
// 使用循环生成10条数据
|
||||
for (let i = 0; i < 10; i++) {
|
||||
tableData.value.push({
|
||||
date: `2023-05-${i < 9 ? '0' + (i + 1) : i + 1}`,
|
||||
name: `用户${i + 1}`,
|
||||
state: ['California', 'New York', 'Texas'][i % 3],
|
||||
city: ['Los Angeles', 'New York', 'Houston'][i % 3],
|
||||
address: `No. ${i + 1}00, Main St`,
|
||||
zip: ['CA 90036', 'NY 10001', 'TX 77002'][i % 3],
|
||||
tag: ['Home', 'Work', 'Other'][i % 3]
|
||||
// for (let i = 0; i < 10; i++) {
|
||||
// tableData.value.push({
|
||||
// cameraName: '123',
|
||||
// type: (i % 3) + '',
|
||||
// state: ['California', 'New York', 'Texas'][i % 3],
|
||||
// city: ['Los Angeles', 'New York', 'Houston'][i % 3],
|
||||
// address: `No. ${i + 1}00, Main St`,
|
||||
// zip: ['CA 90036', 'NY 10001', 'TX 77002'][i % 3],
|
||||
// tag: ['Home', 'Work', 'Other'][i % 3]
|
||||
// })
|
||||
// }
|
||||
|
||||
var statusTrans = (id) => {
|
||||
switch (id) {
|
||||
case '1':
|
||||
return '海康'
|
||||
case '2':
|
||||
return '大华'
|
||||
case '3':
|
||||
return '手动录入'
|
||||
}
|
||||
}
|
||||
|
||||
const getTableList = async () => {
|
||||
const res = await deviceApi.deviceList(pages)
|
||||
// if (res.code === 50) {
|
||||
// ElMessage.warning(res.message)
|
||||
// return
|
||||
// }
|
||||
if (res.code === 200) {
|
||||
tableData.value = res.data.records
|
||||
total.value = res.data.total
|
||||
}
|
||||
}
|
||||
|
||||
getTableList()
|
||||
|
||||
eventBus.on('addOptionResuit', () => {
|
||||
getTableList()
|
||||
})
|
||||
|
||||
//------------------添加--------------------
|
||||
const baseDialog: any = ref(null)
|
||||
var peopleFormRef: any = ref('')
|
||||
|
||||
const peopleRules: any = reactive({
|
||||
cameraName: [{ required: true, message: '请输入名称', trigger: 'blur' }],
|
||||
ip: [{ required: true, message: '请输入ip', trigger: 'blur' }],
|
||||
port: [{ required: true, message: '请输入设备端口号', trigger: 'blur' }],
|
||||
userName: [{ required: true, message: '请输入用户名', trigger: 'blur' }],
|
||||
password: [{ required: true, message: '请输入密码', trigger: 'blur' }],
|
||||
type: [{ required: true, message: '请选择设备类型', trigger: 'blur' }]
|
||||
})
|
||||
var close = () => {
|
||||
baseDialog.value?.close()
|
||||
// baseDialog.value = false
|
||||
}
|
||||
|
||||
var edit = (type, row) => {
|
||||
let addForm
|
||||
if (row) {
|
||||
addForm = JSON.parse(JSON.stringify(row))
|
||||
addForm.areaId = +row.areaId
|
||||
}
|
||||
eventBus.emit('openAddDevice', { title: type, data: addForm })
|
||||
}
|
||||
|
||||
var submitProtal = () => {
|
||||
peopleFormRef.value.validate(async (valid) => {
|
||||
if (valid) {
|
||||
if (
|
||||
addForm.value.channel === undefined ||
|
||||
addForm.value.channel === '' ||
|
||||
addForm.value.channel === null
|
||||
) {
|
||||
addForm.value.channel = 1
|
||||
}
|
||||
// const res = await cameraDataAdd(this.addForm)
|
||||
// if (res.code === 50) {
|
||||
// ElMessage.warning(res.message)
|
||||
// return
|
||||
// }
|
||||
// if (res.code === 0) {
|
||||
// ElMessage.success('添加成功')
|
||||
// pDialogVisible.value = false
|
||||
// // this.getList()
|
||||
// }
|
||||
} else {
|
||||
console.log('error submit!!')
|
||||
return false
|
||||
}
|
||||
})
|
||||
}
|
||||
const getTableList = () => {
|
||||
console.log(1111111)
|
||||
var delFun = (row) => {
|
||||
ElMessageBox.confirm(
|
||||
`删除该设备将在系统中永久消失,且及其所有关联数据将从系统中永久移除,您确定要执行该操作吗?`,
|
||||
'提示',
|
||||
{
|
||||
confirmButtonText: '确定',
|
||||
cancelButtonText: '取消',
|
||||
type: 'warning'
|
||||
}
|
||||
)
|
||||
.then(() => {
|
||||
// let formData = new FormData()
|
||||
// formData.append('id', row.id)
|
||||
deviceApi.delDevice({ id: row.id }).then((res) => {
|
||||
if (res.code === 200) {
|
||||
ElMessage.success('删除成功')
|
||||
getTableList()
|
||||
}
|
||||
})
|
||||
})
|
||||
.catch(() => {})
|
||||
}
|
||||
</script>
|
||||
|
||||
<style lang="scss">
|
||||
::v-deep .addDevice {
|
||||
background:
|
||||
linear-gradient(180deg, rgba(0, 255, 255, 0.2) 0%, rgba(0, 255, 255, 0) 100%), rgba(0, 0, 0, 1) !important;
|
||||
.el-dialog__title {
|
||||
color: #fff !important;
|
||||
}
|
||||
}
|
||||
</style>
|
||||
<style scoped lang="scss">
|
||||
::v-deep .el-form-item--label-right .el-form-item__label {
|
||||
color: #fff !important;
|
||||
}
|
||||
::v-deep .el-form-item .el-input__wrapper {
|
||||
background-color: transparent !important;
|
||||
box-shadow: 0 0 0 0.5px #00ffff inset !important; /* 新增此行 */
|
||||
}
|
||||
::v-deep .el-form-item .el-select__wrapper {
|
||||
background-color: transparent !important;
|
||||
box-shadow: 0 0 0 0.5px #00ffff inset !important; /* 新增此行 */
|
||||
}
|
||||
::v-deep .el-form-item .el-input__inner {
|
||||
color: #fff !important;
|
||||
}
|
||||
::v-deep .el-form-item .el-select__placeholder {
|
||||
color: #fff !important;
|
||||
}
|
||||
.equipment {
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
@ -126,7 +268,7 @@ const getTableList = () => {
|
||||
}
|
||||
.nav_table {
|
||||
width: 100%;
|
||||
height: 40vh;
|
||||
// height: 40vh;
|
||||
// box-sizing: border-box;
|
||||
overflow-y: auto; /* 垂直方向超出时显示滚动条 */
|
||||
:deep(.el-table, .el-table__expanded-cell) {
|
||||
@ -209,5 +351,37 @@ const getTableList = () => {
|
||||
.nav_table::-webkit-scrollbar-track {
|
||||
background-color: rgba(0, 255, 255, 0.2);
|
||||
}
|
||||
.deviceType {
|
||||
display: inline-block;
|
||||
width: 8px;
|
||||
height: 8px;
|
||||
border-radius: 4px;
|
||||
background: red;
|
||||
margin-right: 10px;
|
||||
}
|
||||
::v-deep .el-select__wrapper {
|
||||
background-color: unset !important;
|
||||
}
|
||||
::v-deep .el-select__placeholder {
|
||||
color: #fff !important;
|
||||
}
|
||||
::v-deep .el-select__wrapper.is-focused {
|
||||
box-shadow: 0 0 0 1px #fff inset !important;
|
||||
}
|
||||
::v-deep .el-input__wrapper {
|
||||
background-color: unset !important;
|
||||
}
|
||||
::v-deep .el-input__inner {
|
||||
color: #fff !important;
|
||||
}
|
||||
::v-deep .el-input__wrapper.is-focus {
|
||||
box-shadow: 0 0 0 1px #fff inset !important;
|
||||
}
|
||||
::v-deep .el-pager li * {
|
||||
color: rgba(0, 255, 255, 1) !important;
|
||||
}
|
||||
::v-deep .el-pager li.is-active {
|
||||
color: rgba(0, 255, 255, 1) !important;
|
||||
}
|
||||
}
|
||||
</style>
|
||||
|
||||
@ -48,7 +48,7 @@
|
||||
<!-- 坐标系 -->
|
||||
<div class="detailSkin">
|
||||
<span>{{ t('systemSetting.coordinateSystem') }}:</span>
|
||||
<el-select
|
||||
<!-- <el-select
|
||||
style="width: 175px"
|
||||
v-model="systemSetting.coordinate"
|
||||
@change="sysChange"
|
||||
@ -61,21 +61,81 @@
|
||||
:value="item.epsg"
|
||||
>
|
||||
</el-option>
|
||||
</el-select>
|
||||
</div>
|
||||
<div class="detailSkin">
|
||||
<span>{{ t('systemSetting.latitude') }}:</span>
|
||||
<el-select
|
||||
style="width: 175px"
|
||||
v-model="systemSetting.coordinate"
|
||||
@change="sysChange"
|
||||
placeholder="请选择"
|
||||
</el-select> -->
|
||||
<el-select v-model="systemSetting.coordinate" @change="sysChange">
|
||||
<div
|
||||
class="group-header"
|
||||
:class="isHotGroupOpen ? 'arrowActive' : ''"
|
||||
@click="toggleGroup('hot')"
|
||||
>
|
||||
地理坐标系
|
||||
<svg-icon
|
||||
v-if="isHotGroupOpen"
|
||||
name="arrow1"
|
||||
:size="10"
|
||||
color="rgba(0, 255, 255, 1)"
|
||||
style="margin-left: 10px"
|
||||
></svg-icon>
|
||||
<svg-icon
|
||||
v-else
|
||||
name="arrow2"
|
||||
:size="10"
|
||||
color="rgba(255, 255, 255, 1)"
|
||||
style="margin-left: 10px"
|
||||
></svg-icon>
|
||||
</div>
|
||||
<div v-show="isHotGroupOpen">
|
||||
<el-option
|
||||
v-for="item in name_map1"
|
||||
:key="item.epsg"
|
||||
:label="item.name"
|
||||
:value="item.epsg"
|
||||
></el-option>
|
||||
</div>
|
||||
<div
|
||||
class="group-header"
|
||||
:class="isHotGroupOpen2 ? 'arrowActive' : ''"
|
||||
@click="toggleGroup('ty')"
|
||||
>
|
||||
投影坐标系
|
||||
<svg-icon
|
||||
v-if="isHotGroupOpen2"
|
||||
name="arrow1"
|
||||
:size="10"
|
||||
color="rgba(0, 255, 255, 1)"
|
||||
style="margin-left: 10px"
|
||||
></svg-icon>
|
||||
<svg-icon
|
||||
v-else
|
||||
name="arrow2"
|
||||
:size="10"
|
||||
color="rgba(255, 255, 255, 1)"
|
||||
style="margin-left: 10px"
|
||||
></svg-icon>
|
||||
</div>
|
||||
<div v-show="isHotGroupOpen2">
|
||||
<el-option
|
||||
v-for="item in name_map"
|
||||
:key="item.epsg"
|
||||
:label="item.name"
|
||||
:value="item.epsg"
|
||||
></el-option>
|
||||
</div>
|
||||
</el-select>
|
||||
</div>
|
||||
<div class="detailSkin" v-show="showPosiType">
|
||||
<span>{{ t('systemSetting.latitude') }}:</span>
|
||||
<el-select
|
||||
style="width: 175px"
|
||||
v-model="systemSetting.positionType"
|
||||
@change="sysChange"
|
||||
placeholder="请选择"
|
||||
>
|
||||
<el-option
|
||||
v-for="item in position_map"
|
||||
:key="item.value"
|
||||
:label="item.name"
|
||||
:value="item.value"
|
||||
>
|
||||
</el-option>
|
||||
</el-select>
|
||||
@ -345,13 +405,15 @@ import { useI18n } from 'vue-i18n'
|
||||
import { ElMessage } from 'element-plus'
|
||||
import { inject, onMounted } from 'vue'
|
||||
import { TreeApi } from '@/api/tree'
|
||||
import { useTreeNode } from '../../../../tree/hooks/treeNode'
|
||||
import { $sendElectronChanel } from '@/utils/communication'
|
||||
|
||||
const eventBus: any = inject('bus')
|
||||
const { cusUpdateNode } = useTreeNode()
|
||||
|
||||
const { t, locale, global } = useI18n()
|
||||
const { t, locale } = useI18n()
|
||||
|
||||
const isHotGroupOpen: any = ref(false)
|
||||
const isHotGroupOpen2: any = ref(false)
|
||||
const showPosiType: any = ref(false)
|
||||
|
||||
const systemSetting = ref({
|
||||
showFangliNet: false, // 方里网
|
||||
@ -366,7 +428,8 @@ const systemSetting = ref({
|
||||
sheetIndexStatusSwitch: false, //标准图幅
|
||||
skinInfo: 'yingguangse', //主题色
|
||||
language: '', //语言
|
||||
coordinate: 'EPSG:4326' //坐标系
|
||||
coordinate: 'EPSG:4326', //坐标系
|
||||
positionType: '度'
|
||||
})
|
||||
const options = ref([
|
||||
{ id: 'zh-CN', label: '中文简体' },
|
||||
@ -403,6 +466,21 @@ const concurrentWorkloadList = ref([
|
||||
}
|
||||
])
|
||||
const name_map: any = ref([])
|
||||
const name_map1: any = ref([])
|
||||
const position_map: any = ref([
|
||||
{
|
||||
name: '度',
|
||||
value: '度'
|
||||
},
|
||||
{
|
||||
name: '度分',
|
||||
value: '度分'
|
||||
},
|
||||
{
|
||||
name: '度分秒',
|
||||
value: '度分秒'
|
||||
}
|
||||
])
|
||||
const searchWay = ref()
|
||||
const concurrentcode = ref()
|
||||
const showBattery = ref()
|
||||
@ -411,6 +489,7 @@ concurrentcode.value = localStorage.getItem('concurrentcode') || 10
|
||||
//系统坐标系
|
||||
let tool = new YJ.Tools(window.earth)
|
||||
name_map.value = Array.from(tool.name_map.values())
|
||||
name_map1.value = name_map.value.splice(0, 2)
|
||||
|
||||
const sysChange = async () => {
|
||||
locale.value = systemSetting.value.language
|
||||
@ -432,8 +511,15 @@ const sysChange = async () => {
|
||||
//地形遮挡
|
||||
YJ.Global.setGroundCover(window.earth, systemSetting.value.occlusion)
|
||||
//系统
|
||||
if (systemSetting.value.coordinate) {
|
||||
let data = name_map1.value.filter((item) => item.epsg === systemSetting.value.coordinate)
|
||||
showPosiType.value = data.length
|
||||
}
|
||||
|
||||
let coor = systemSetting.value.coordinate ? systemSetting.value.coordinate : 'EPSG:4326'
|
||||
YJ.Global.setCoordinateSystem(window.earth, coor)
|
||||
//设置坐标格式
|
||||
YJ.Global.setDMS(window.earth, systemSetting.value.positionType)
|
||||
|
||||
//比例尺
|
||||
await YJ.Global.SheetIndexStatusSwitch(window.earth, systemSetting.value.sheetIndexStatusSwitch)
|
||||
@ -488,10 +574,23 @@ const setData = () => {
|
||||
}
|
||||
})
|
||||
}
|
||||
const toggleGroup = (type: string) => {
|
||||
if (type === 'hot') isHotGroupOpen.value = !isHotGroupOpen.value
|
||||
if (type === 'ty') isHotGroupOpen2.value = !isHotGroupOpen2.value
|
||||
}
|
||||
const management = () => {}
|
||||
const batteryChange = () => {}
|
||||
onMounted(() => {
|
||||
systemSetting.value = JSON.parse(localStorage.getItem('systemSetting')||'{}')
|
||||
systemSetting.value = JSON.parse(localStorage.getItem('systemSetting') || '{}')
|
||||
if (systemSetting.value.coordinate) {
|
||||
let data = name_map1.value.filter((item) => item.epsg === systemSetting.value.coordinate)
|
||||
showPosiType.value = data.length
|
||||
if (data.length) {
|
||||
isHotGroupOpen.value = true
|
||||
} else {
|
||||
isHotGroupOpen2.value = true
|
||||
}
|
||||
}
|
||||
// sysChange()
|
||||
})
|
||||
</script>
|
||||
@ -588,4 +687,17 @@ onMounted(() => {
|
||||
margin-left: 5px;
|
||||
font-size: 0.8rem;
|
||||
}
|
||||
.group-header {
|
||||
width: 100%;
|
||||
height: 30px;
|
||||
padding: 8px 20px;
|
||||
cursor: pointer;
|
||||
font-weight: bold;
|
||||
color: rgba(255, 255, 255, 1);
|
||||
font-size: 12px;
|
||||
font-weight: 400;
|
||||
}
|
||||
.arrowActive {
|
||||
color: rgba(0, 255, 255, 1);
|
||||
}
|
||||
</style>
|
||||
|
||||
@ -33,13 +33,16 @@
|
||||
</template>
|
||||
|
||||
<script setup lang="ts">
|
||||
import { useI18n } from 'vue-i18n'
|
||||
import {useI18n} from 'vue-i18n'
|
||||
import {useRouter} from 'vue-router'
|
||||
|
||||
import { bus } from '@/utils/bus'
|
||||
import {bus} from '@/utils/bus'
|
||||
import leftSideSecond from '@/views/components/leftSide/leftSideSecond.vue'
|
||||
import { ElMessage, ElLoading } from 'element-plus'
|
||||
import {ElMessage, ElLoading} from 'element-plus'
|
||||
|
||||
const { t } = useI18n()
|
||||
const {ipcRenderer} = require('electron')
|
||||
const router = useRouter() // 路由实例
|
||||
const {t} = useI18n()
|
||||
const eventBus: any = inject('bus')
|
||||
const menuList: any = ref([
|
||||
// 方案推演
|
||||
@ -194,6 +197,19 @@ const handleClick = (item: any, e) => {
|
||||
if (item.children.length) {
|
||||
$('.leftSideSecond')[0].style.display = 'block'
|
||||
leftSideSecondRef.value.initList(item)
|
||||
} else if (item.key === 'situation') {
|
||||
//态势推演
|
||||
if ((window as any).checkAuthIsValid) {
|
||||
console.log('打开态势推演')
|
||||
ipcRenderer.send('toggle-fullscreen', true)
|
||||
router.push({path: '/ts'})
|
||||
|
||||
} else {
|
||||
ElMessage({
|
||||
message: '您没有该功能的权限',
|
||||
type: 'warning'
|
||||
})
|
||||
}
|
||||
} else if (item.key === 'model') {
|
||||
//模型库
|
||||
if ((window as any).checkAuthIsValid) {
|
||||
|
||||
@ -3,8 +3,11 @@
|
||||
<div class="leftSideSecondBox">
|
||||
<template v-if="obj">
|
||||
<div class="menuItem" v-for="value in obj.children" @click="handleClick(value)">
|
||||
<img :src="'http://localhost:' + `${availablePort}` + '/icon/' + `${value}` + '.png'"
|
||||
style="color: rgb(255, 0, 0)" alt="" />
|
||||
<img
|
||||
:src="'http://localhost:' + `${availablePort}` + '/icon/' + `${value}` + '.png'"
|
||||
style="color: rgb(255, 0, 0)"
|
||||
alt=""
|
||||
/>
|
||||
<!-- <svg-icon :name="value" :size="20" color="rgba(0, 255, 255, 1)"></svg-icon> -->
|
||||
<span :style="{ color: !clickChange[value] ? 'var(--color-text)' : 'rgb(255,0,0)' }">{{
|
||||
t(`${obj.key}.${value}`)
|
||||
@ -86,8 +89,6 @@ const handleKeyDown = (e) => {
|
||||
if (clickChange.videoRecord) {
|
||||
methodMap['videoRecord']()
|
||||
}
|
||||
|
||||
console.log('全局ESC监听')
|
||||
}
|
||||
}
|
||||
window.addEventListener('keydown', handleKeyDown)
|
||||
@ -176,7 +177,6 @@ const methodMap = {
|
||||
diffuseScan: () => {
|
||||
let draw = new YJ.Draw.DrawCircle(window.earth)
|
||||
draw.start((err, options) => {
|
||||
console.log('options', options)
|
||||
if (options) {
|
||||
let id = new YJ.Tools().randomString()
|
||||
let name = '扩散光波'
|
||||
@ -204,7 +204,6 @@ const methodMap = {
|
||||
radarScan: () => {
|
||||
let draw = new YJ.Draw.DrawCircle(window.earth)
|
||||
draw.start((err, options) => {
|
||||
console.log('options', options)
|
||||
if (options) {
|
||||
let id = new YJ.Tools().randomString()
|
||||
let name = '雷达光波'
|
||||
@ -491,23 +490,28 @@ const methodMap = {
|
||||
},
|
||||
//淹没分析
|
||||
inundationAnalysis() {
|
||||
eventBus.emit('submergeDialog')
|
||||
// eventBus.emit('submergeDialog')
|
||||
eventBus.emit('openDialog', 'submergeDialog')
|
||||
},
|
||||
//剖面分析
|
||||
profileAnalysis() {
|
||||
eventBus.emit('profileDialog')
|
||||
// eventBus.emit('profileDialog')
|
||||
eventBus.emit('openDialog', 'profileDialog')
|
||||
},
|
||||
// 视线分析
|
||||
sightAnalysis() {
|
||||
eventBus.emit('analysisDialog')
|
||||
// eventBus.emit('analysisDialog')
|
||||
eventBus.emit('openDialog', 'analysisDialog')
|
||||
},
|
||||
//视域分析
|
||||
kenAnalysis() {
|
||||
eventBus.emit('viewShedDialog')
|
||||
// eventBus.emit('viewShedDialog')
|
||||
eventBus.emit('openDialog', 'viewShedDialog')
|
||||
},
|
||||
//圆形视域分析
|
||||
circleKen() {
|
||||
eventBus.emit('circleViewShedDialog')
|
||||
// eventBus.emit('circleViewShedDialog')
|
||||
eventBus.emit('openDialog', 'circleViewShedDialog')
|
||||
},
|
||||
//坡向分析
|
||||
slopeDirection() {
|
||||
@ -515,11 +519,13 @@ const methodMap = {
|
||||
},
|
||||
// 填挖方分析
|
||||
cutFill() {
|
||||
eventBus.emit('cutFillDialog')
|
||||
// eventBus.emit('cutFillDialog')
|
||||
eventBus.emit('openDialog', 'cutFillDialog')
|
||||
},
|
||||
//全局等高线分析
|
||||
globalContour() {
|
||||
eventBus.emit('contourDialog')
|
||||
// eventBus.emit('contourDialog')
|
||||
eventBus.emit('openDialog', 'contourDialog')
|
||||
},
|
||||
//等高线分析
|
||||
contour() {
|
||||
@ -537,7 +543,8 @@ const methodMap = {
|
||||
//----------------工具------------------
|
||||
//路径规划
|
||||
routePlan() {
|
||||
eventBus.emit('routePlanningDialog')
|
||||
// eventBus.emit('routePlanningDialog')
|
||||
eventBus.emit('openDialog', 'routePlanningDialog')
|
||||
},
|
||||
//路径清除
|
||||
clearRoute() {
|
||||
@ -545,7 +552,8 @@ const methodMap = {
|
||||
},
|
||||
//涂鸦
|
||||
graffiti() {
|
||||
eventBus.emit('graffitiDialog')
|
||||
// eventBus.emit('graffitiDialog')
|
||||
eventBus.emit('openDialog', 'graffitiDialog')
|
||||
},
|
||||
//涂鸦清除
|
||||
clearGraffiti() {
|
||||
@ -555,11 +563,13 @@ const methodMap = {
|
||||
},
|
||||
//漫游
|
||||
roam() {
|
||||
eventBus.emit('flyRoamDialog')
|
||||
// eventBus.emit('flyRoamDialog')
|
||||
eventBus.emit('openDialog', 'flyRoamDialog')
|
||||
},
|
||||
//坐标定位
|
||||
coorLocation() {
|
||||
eventBus.emit('coorLocationDialog')
|
||||
// eventBus.emit('coorLocationDialog')
|
||||
eventBus.emit('openDialog', 'coorLocationDialog')
|
||||
},
|
||||
//鼠标定位
|
||||
mouseLocation() {
|
||||
@ -598,7 +608,7 @@ const methodMap = {
|
||||
filters: [{ name: '保存图片', extensions: ['jpg'] }]
|
||||
})
|
||||
$recvElectronChanel('selectedFileItem', (e, path) => {
|
||||
fs.writeFile(path, dataBuffer, (res) => { })
|
||||
fs.writeFile(path, dataBuffer, (res) => {})
|
||||
})
|
||||
}
|
||||
|
||||
@ -643,8 +653,9 @@ const methodMap = {
|
||||
},
|
||||
//高清出图
|
||||
highQuality() {
|
||||
eventBus.emit('screenShotDialog')
|
||||
// eventBus.emit('screenShotDialog')
|
||||
// YJ.Global.ScreenShotHD(window.earth)
|
||||
eventBus.emit('openDialog', 'screenShotDialog')
|
||||
},
|
||||
//视频录制
|
||||
videoRecord() {
|
||||
@ -687,7 +698,6 @@ const methodMap = {
|
||||
if (selectedNode) {
|
||||
let isTileset = ['bim', 'tileset'].includes(selectedNode.sourceType)
|
||||
if (!isTileset) {
|
||||
console.log('aaaaaa')
|
||||
ElMessage({
|
||||
message: '请在图层指挥舱选中对应模型进行操作',
|
||||
type: 'warning'
|
||||
@ -732,18 +742,17 @@ const methodMap = {
|
||||
TreeApi.addOtherSource(paramsData)
|
||||
paramsData.isShow = true
|
||||
paramsData.params = JSON.stringify(paramsData.params)
|
||||
; (window as any).pressModelMap.set(id + '_' + selectedNode.id, paramsData)
|
||||
; (window as any).pressModelEntities.set(id, flat)
|
||||
;(window as any).pressModelMap.set(id + '_' + selectedNode.id, paramsData)
|
||||
;(window as any).pressModelEntities.set(id, flat)
|
||||
cusAddNodes(window.treeObj, paramsData.parentId, [paramsData])
|
||||
// //鼠标右键点击事件
|
||||
flat.onRightClick = () => { }
|
||||
flat.onRightClick = () => {}
|
||||
// _entityMap.set(node.source_id, flat)
|
||||
} else {
|
||||
// this.$message.warning('至少三个点')
|
||||
}
|
||||
})
|
||||
} else {
|
||||
console.log('bbbbb')
|
||||
ElMessage({
|
||||
message: '请在图层指挥舱选中对应模型进行操作',
|
||||
type: 'warning'
|
||||
@ -760,7 +769,8 @@ const methodMap = {
|
||||
terrainDig() {
|
||||
if ((window as any).checkAuthIsValid) {
|
||||
// new YJ.Analysis.TerrainExcavation(window.Earth1);
|
||||
eventBus.emit('terrainExcavationDialog')
|
||||
// eventBus.emit('terrainExcavationDialog')
|
||||
eventBus.emit('openDialog', 'terrainExcavationDialog')
|
||||
} else {
|
||||
ElMessage({
|
||||
message: '您没有该功能的权限',
|
||||
@ -807,11 +817,13 @@ const methodMap = {
|
||||
},
|
||||
//度分秒
|
||||
projConvert() {
|
||||
eventBus.emit('projConvertDialog')
|
||||
// eventBus.emit('projConvertDialog')
|
||||
eventBus.emit('openDialog', 'projConvertDialog')
|
||||
},
|
||||
//投影转换
|
||||
projectionConvert() {
|
||||
eventBus.emit('ProjectionConvertDialog')
|
||||
// eventBus.emit('ProjectionConvertDialog')
|
||||
eventBus.emit('openDialog', 'ProjectionConvertDialog')
|
||||
},
|
||||
//GDB导入
|
||||
gdbImport() {
|
||||
@ -864,8 +876,8 @@ const methodMap = {
|
||||
DbOption.isShow = true
|
||||
DbOption.params = JSON.stringify(DbOption.params)
|
||||
cusAddNodes(window.treeObj, DbOption.parentId, [DbOption])
|
||||
let entityObject = renderVector(DbOption, true);
|
||||
(window as any)._entityMap.set(id, entityObject)
|
||||
let entityObject = renderVector(DbOption, true)
|
||||
;(window as any)._entityMap.set(id, entityObject)
|
||||
// }
|
||||
// })
|
||||
}
|
||||
@ -874,7 +886,8 @@ const methodMap = {
|
||||
//圆形统计
|
||||
circleStatistics() {
|
||||
if ((window as any).checkAuthIsValid) {
|
||||
eventBus.emit('goodsSearchCircleDialog')
|
||||
// eventBus.emit('goodsSearchCircleDialog')
|
||||
eventBus.emit('openDialog', 'goodsSearchCircleDialog')
|
||||
} else {
|
||||
ElMessage({
|
||||
message: '您没有该功能的权限',
|
||||
@ -885,7 +898,8 @@ const methodMap = {
|
||||
//多边形统计
|
||||
polygonStatistics() {
|
||||
if ((window as any).checkAuthIsValid) {
|
||||
eventBus.emit('goodsSearchPolgonDialog')
|
||||
// eventBus.emit('goodsSearchPolgonDialog')
|
||||
eventBus.emit('openDialog', 'goodsSearchPolgonDialog')
|
||||
} else {
|
||||
ElMessage({
|
||||
message: '您没有该功能的权限',
|
||||
@ -896,7 +910,6 @@ const methodMap = {
|
||||
}
|
||||
|
||||
const handleClick = (value = 'projectionDistanceMeasure') => {
|
||||
console.log('点击了', value)
|
||||
methodMap[value]()
|
||||
}
|
||||
defineExpose({
|
||||
|
||||
@ -65,7 +65,7 @@
|
||||
</template>
|
||||
|
||||
<script setup lang="ts">
|
||||
import { ref, reactive, onMounted } from 'vue'
|
||||
import { ref, reactive, onBeforeUnmount } from 'vue'
|
||||
import { inject } from 'vue'
|
||||
import Dialog from '@/components/dialog/baseDialog.vue'
|
||||
|
||||
@ -82,11 +82,21 @@ eventBus.on('circleViewShedDialog', () => {
|
||||
precision: precision.value
|
||||
})
|
||||
})
|
||||
const open = () => {
|
||||
baseDialog.value?.open()
|
||||
visibility = new YJ.Analysis.CircleViewShed(window.earth, {
|
||||
viewPointHeight: viewPointHeight.value,
|
||||
precision: precision.value
|
||||
})
|
||||
}
|
||||
const closeCallBack = (e) => {
|
||||
viewPointHeight.value = 1.8
|
||||
precision.value = 20
|
||||
YJ.Measure.SetMeasureStatus(false)
|
||||
}
|
||||
onBeforeUnmount(() => {
|
||||
closeCallBack('')
|
||||
})
|
||||
|
||||
const viewPointHeightChange = () => {
|
||||
visibility.viewPointHeights = viewPointHeight.value
|
||||
@ -118,6 +128,9 @@ const draw = (e) => {
|
||||
// !window.analysisArr && (window.analysisArr = [])
|
||||
// window.analysisArr.push(visibility)
|
||||
}
|
||||
defineExpose({
|
||||
open
|
||||
})
|
||||
</script>
|
||||
|
||||
<style scoped lang="scss"></style>
|
||||
|
||||
@ -152,7 +152,7 @@
|
||||
</template>
|
||||
|
||||
<script setup lang="ts">
|
||||
import { ref, reactive, onMounted } from 'vue'
|
||||
import { ref, reactive, onBeforeUnmount } from 'vue'
|
||||
import { inject } from 'vue'
|
||||
import Dialog from '@/components/dialog/baseDialog.vue'
|
||||
|
||||
@ -166,10 +166,19 @@ eventBus.on('contourDialog', () => {
|
||||
YJ.Global.Contour(window.earth)
|
||||
})
|
||||
})
|
||||
const open = () => {
|
||||
baseDialog.value?.open()
|
||||
setTimeout(() => {
|
||||
YJ.Global.Contour(window.earth)
|
||||
})
|
||||
}
|
||||
const closeCallBack = (e) => {
|
||||
YJ.Global.ContourReset()
|
||||
show.value = true
|
||||
}
|
||||
onBeforeUnmount(() => {
|
||||
closeCallBack('')
|
||||
})
|
||||
const close = (e) => {
|
||||
baseDialog.value?.close()
|
||||
}
|
||||
@ -177,6 +186,9 @@ const sure = (e) => {
|
||||
YJ.Global.ContourStartDraw(window.earth, show.value)
|
||||
baseDialog.value?.close()
|
||||
}
|
||||
defineExpose({
|
||||
open
|
||||
})
|
||||
</script>
|
||||
|
||||
<style scoped lang="scss"></style>
|
||||
|
||||
@ -124,7 +124,7 @@
|
||||
</template>
|
||||
|
||||
<script setup lang="ts">
|
||||
import { ref, reactive } from 'vue'
|
||||
import { ref, onBeforeUnmount } from 'vue'
|
||||
import { inject } from 'vue'
|
||||
import Dialog from '@/components/dialog/baseDialog.vue'
|
||||
import { addMapSource } from '../../../common/addMapSource'
|
||||
@ -149,6 +149,10 @@ eventBus.on('coorLocationDialog', () => {
|
||||
id.value = new YJ.Tools().randomString()
|
||||
baseDialog.value?.open()
|
||||
})
|
||||
const open = () => {
|
||||
id.value = new YJ.Tools().randomString()
|
||||
baseDialog.value?.open()
|
||||
}
|
||||
|
||||
// @ts-ignore (define in dts)
|
||||
const handleClick = (tab: TabsPaneContext, event: Event) => {
|
||||
@ -168,6 +172,9 @@ const closeCallBack = (e) => {
|
||||
latSec.value = null
|
||||
activeName.value = 'first'
|
||||
}
|
||||
onBeforeUnmount(() => {
|
||||
closeCallBack('')
|
||||
})
|
||||
const turnToPosition = async () => {
|
||||
let position
|
||||
switch (activeName.value) {
|
||||
@ -312,6 +319,9 @@ const draw = async (e) => {
|
||||
const close = (e) => {
|
||||
baseDialog.value?.close()
|
||||
}
|
||||
defineExpose({
|
||||
open
|
||||
})
|
||||
</script>
|
||||
|
||||
<style scoped lang="scss">
|
||||
|
||||
@ -108,7 +108,7 @@
|
||||
</template>
|
||||
|
||||
<script setup lang="ts">
|
||||
import { ref, reactive } from 'vue'
|
||||
import { ref, reactive, onBeforeUnmount } from 'vue'
|
||||
import { inject } from 'vue'
|
||||
import Dialog from '@/components/dialog/baseDialog.vue'
|
||||
|
||||
@ -133,7 +133,13 @@ eventBus.on('cutFillDialog', () => {
|
||||
precision: precision.value
|
||||
})
|
||||
})
|
||||
|
||||
const open = () => {
|
||||
baseDialog.value?.open()
|
||||
cutFill = new YJ.Analysis.CutFillAnalysis(window.earth, {
|
||||
height: height.value,
|
||||
precision: precision.value
|
||||
})
|
||||
}
|
||||
const heightInput = () => {
|
||||
let dom: any = document.getElementById('height')
|
||||
if (height.value < dom.min * 1) {
|
||||
@ -166,6 +172,9 @@ const closeCallBack = (e) => {
|
||||
YJ.Measure.SetMeasureStatus(false)
|
||||
// visibility && visibility.end()
|
||||
}
|
||||
onBeforeUnmount(() => {
|
||||
closeCallBack('')
|
||||
})
|
||||
function close() {
|
||||
baseDialog.value?.close()
|
||||
}
|
||||
@ -182,6 +191,9 @@ const draw = (e) => {
|
||||
cutVolume.value = cutFill.cutVolume
|
||||
}
|
||||
}
|
||||
defineExpose({
|
||||
open
|
||||
})
|
||||
</script>
|
||||
|
||||
<style scoped lang="scss"></style>
|
||||
|
||||
@ -172,7 +172,7 @@
|
||||
</template>
|
||||
|
||||
<script setup lang="ts">
|
||||
import { ref, reactive } from 'vue'
|
||||
import { ref, reactive, onBeforeUnmount } from 'vue'
|
||||
import { inject } from 'vue'
|
||||
import Dialog from '@/components/dialog/baseDialog.vue'
|
||||
import { app } from 'electron'
|
||||
@ -184,7 +184,7 @@ const { cusAddNodes } = useTreeNode()
|
||||
|
||||
const baseDialog: any = ref(null)
|
||||
const eventBus: any = inject('bus')
|
||||
let viewPointHeight:any = ref(0)
|
||||
let viewPointHeight: any = ref(0)
|
||||
|
||||
var show: any = ref(false)
|
||||
var flyRoam: any = reactive([])
|
||||
@ -195,6 +195,13 @@ eventBus.on('flyRoamDialog', () => {
|
||||
flyRoam = YJ.Global.FlyRoam.open(window.earth, { repeat: Infinity }, {}, draw)
|
||||
}, 100)
|
||||
})
|
||||
const open = () => {
|
||||
show.value = true
|
||||
baseDialog.value?.open()
|
||||
setTimeout(() => {
|
||||
flyRoam = YJ.Global.FlyRoam.open(window.earth, { repeat: Infinity }, {}, draw)
|
||||
}, 100)
|
||||
}
|
||||
const draw = (data) => {
|
||||
if (data.points.length != 0) {
|
||||
let selectedNodes = window.treeObj.getSelectedNodes()
|
||||
@ -233,7 +240,7 @@ const draw = (data) => {
|
||||
|
||||
const clangeViewPointHeight = () => {}
|
||||
const viewPointHeightInput = () => {
|
||||
let dom:any = document.getElementById('viewPointHeight')
|
||||
let dom: any = document.getElementById('viewPointHeight')
|
||||
if (viewPointHeight.value < dom.min * 1) {
|
||||
viewPointHeight.value = dom.min * 1
|
||||
} else if (viewPointHeight.value > dom.max * 1) {
|
||||
@ -244,6 +251,9 @@ const closeCallBack = (e) => {
|
||||
YJ.Global.FlyRoam.cease(window.earth)
|
||||
YJ.Global.FlyRoam.close()
|
||||
}
|
||||
onBeforeUnmount(() => {
|
||||
closeCallBack('')
|
||||
})
|
||||
const apply = (e) => {
|
||||
YJ.Global.FlyRoam.apply()
|
||||
}
|
||||
@ -251,6 +261,10 @@ const close = (e) => {
|
||||
show.value = false
|
||||
baseDialog.value?.close()
|
||||
}
|
||||
|
||||
defineExpose({
|
||||
open
|
||||
})
|
||||
</script>
|
||||
|
||||
<style scoped lang="scss">
|
||||
|
||||
@ -17,7 +17,7 @@
|
||||
</template>
|
||||
|
||||
<script setup lang="ts">
|
||||
import { ref, reactive } from 'vue'
|
||||
import { ref, reactive, onBeforeUnmount } from 'vue'
|
||||
import { inject } from 'vue'
|
||||
import { nextTick } from 'vue'
|
||||
import { ElMessage } from 'element-plus'
|
||||
@ -53,7 +53,6 @@ var draw: any = reactive([])
|
||||
|
||||
var show: any = ref(false)
|
||||
eventBus.on('goodsSearchCircleDialog', () => {
|
||||
console.log('kkkkkk')
|
||||
// baseDialog.value?.open()
|
||||
draw = new YJ.Draw.DrawCircle(window.earth)
|
||||
draw.start((err, positions) => {
|
||||
@ -67,10 +66,23 @@ eventBus.on('goodsSearchCircleDialog', () => {
|
||||
})
|
||||
})
|
||||
|
||||
const open = () => {
|
||||
draw = new YJ.Draw.DrawCircle(window.earth)
|
||||
draw.start((err, positions) => {
|
||||
console.log('err, positions', err, positions)
|
||||
if (!err && positions.center.lng) {
|
||||
show.value = true
|
||||
let nodes = booleanOverlaps(positions)
|
||||
console.log('goodsSearchCircle', nodes)
|
||||
renderCanvas(nodes)
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
function booleanOverlaps(positions1, flag = 'circle') {
|
||||
let cross = undefined
|
||||
function set3Array(positions) {
|
||||
let arr:any = []
|
||||
let arr: any = []
|
||||
positions.forEach((item) => {
|
||||
arr.push([item.lng, item.lat])
|
||||
})
|
||||
@ -94,19 +106,19 @@ function booleanOverlaps(positions1, flag = 'circle') {
|
||||
// 获取物资处(特定的标注类型)
|
||||
let allNodes = getNode(['point', 'vr', 'picture', 'Feature'])
|
||||
console.log('allNodes', allNodes)
|
||||
let itemInArea:any = [] //区域内的类型符合的标注
|
||||
let itemInArea: any = [] //区域内的类型符合的标注
|
||||
|
||||
for (let i = 0; i < allNodes.length; i++) {
|
||||
let item:any = allNodes[i]
|
||||
let item: any = allNodes[i]
|
||||
let getAllItemInArea = (lng, lat) => {
|
||||
if (flag == 'circle') {
|
||||
let { center, radius } = positions1
|
||||
let distance = new YJ.Tools().randomString(center, { lng, lat })
|
||||
distance < radius && itemInArea.push(item)
|
||||
} else {
|
||||
let polygon1 = (window as any).turf.polygon([set3Array(positions1)]);
|
||||
let pt = (window as any).turf.point([lng, lat]);
|
||||
(window as any).turf.booleanPointInPolygon(pt, polygon1) && itemInArea.push(item)
|
||||
let polygon1 = (window as any).turf.polygon([set3Array(positions1)])
|
||||
let pt = (window as any).turf.point([lng, lat])
|
||||
;(window as any).turf.booleanPointInPolygon(pt, polygon1) && itemInArea.push(item)
|
||||
}
|
||||
}
|
||||
console.log(item, item.sourceType, 'ooooo')
|
||||
@ -178,8 +190,8 @@ function renderCanvas(nodes) {
|
||||
console.log('x,y')
|
||||
console.log(x)
|
||||
console.log(y)
|
||||
let notZeroX:any = []
|
||||
let notZeroY:any = []
|
||||
let notZeroX: any = []
|
||||
let notZeroY: any = []
|
||||
for (let i = 0; i < y.length; i++) {
|
||||
if (y[i] != 0) {
|
||||
notZeroX.push(x[i])
|
||||
@ -193,7 +205,7 @@ function renderCanvas(nodes) {
|
||||
if (!x.length) show.value = false
|
||||
if (show.value) {
|
||||
nextTick(() => {
|
||||
let option:any = {
|
||||
let option: any = {
|
||||
grid: {
|
||||
top: '20%',
|
||||
left: '5%',
|
||||
@ -335,6 +347,12 @@ function renderCanvas(nodes) {
|
||||
}
|
||||
|
||||
const closeCallBack = (e) => {}
|
||||
onBeforeUnmount(() => {
|
||||
closeCallBack('')
|
||||
})
|
||||
defineExpose({
|
||||
open
|
||||
})
|
||||
</script>
|
||||
|
||||
<style scoped lang="scss"></style>
|
||||
|
||||
@ -17,7 +17,7 @@
|
||||
</template>
|
||||
|
||||
<script setup lang="ts">
|
||||
import { ref, reactive } from 'vue'
|
||||
import { ref, reactive, onBeforeUnmount } from 'vue'
|
||||
import { inject } from 'vue'
|
||||
import { nextTick } from 'vue'
|
||||
import { ElMessage } from 'element-plus'
|
||||
@ -63,11 +63,22 @@ eventBus.on('goodsSearchPolgonDialog', () => {
|
||||
})
|
||||
})
|
||||
|
||||
const open = () => {
|
||||
draw = new YJ.Draw.DrawPolygon(window.earth)
|
||||
draw.start((err, params) => {
|
||||
if (!err && params.length > 2) {
|
||||
show.value = true
|
||||
let nodes = booleanOverlaps(params, 'polygon')
|
||||
renderCanvas(nodes)
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
function booleanOverlaps(positions1, flag = 'circle') {
|
||||
let cross = undefined
|
||||
function set3Array(positions) {
|
||||
let arr:any = []
|
||||
positions.forEach((item:any) => {
|
||||
let arr: any = []
|
||||
positions.forEach((item: any) => {
|
||||
arr.push([item.lng, item.lat])
|
||||
})
|
||||
arr.push(arr[0])
|
||||
@ -87,19 +98,19 @@ function booleanOverlaps(positions1, flag = 'circle') {
|
||||
//绘制的区域
|
||||
// 获取物资处(特定的标注类型)
|
||||
let allNodes = getNode(['point', 'vr', 'picture', 'Feature'])
|
||||
let itemInArea:any = [] //区域内的类型符合的标注
|
||||
let itemInArea: any = [] //区域内的类型符合的标注
|
||||
|
||||
for (let i = 0; i < allNodes.length; i++) {
|
||||
let item:any = allNodes[i]
|
||||
let item: any = allNodes[i]
|
||||
let getAllItemInArea = (lng, lat) => {
|
||||
if (flag == 'circle') {
|
||||
let { center, radius } = positions1
|
||||
let distance = new YJ.Tools().randomString(center, { lng, lat })
|
||||
distance < radius && itemInArea.push(item)
|
||||
} else {
|
||||
let polygon1 = (window as any).turf.polygon([set3Array(positions1)]);
|
||||
let pt = (window as any).turf.point([lng, lat]);
|
||||
(window as any).turf.booleanPointInPolygon(pt, polygon1) && itemInArea.push(item)
|
||||
let polygon1 = (window as any).turf.polygon([set3Array(positions1)])
|
||||
let pt = (window as any).turf.point([lng, lat])
|
||||
;(window as any).turf.booleanPointInPolygon(pt, polygon1) && itemInArea.push(item)
|
||||
}
|
||||
}
|
||||
switch (item.sourceType) {
|
||||
@ -166,8 +177,8 @@ function renderCanvas(nodes) {
|
||||
console.log('x,y')
|
||||
console.log(x)
|
||||
console.log(y)
|
||||
let notZeroX:any = []
|
||||
let notZeroY:any = []
|
||||
let notZeroX: any = []
|
||||
let notZeroY: any = []
|
||||
for (let i = 0; i < y.length; i++) {
|
||||
if (y[i] != 0) {
|
||||
notZeroX.push(x[i])
|
||||
@ -181,7 +192,7 @@ function renderCanvas(nodes) {
|
||||
if (!x.length) show.value = false
|
||||
if (show.value) {
|
||||
nextTick(() => {
|
||||
let option:any = {
|
||||
let option: any = {
|
||||
grid: {
|
||||
top: '20%',
|
||||
left: '5%',
|
||||
@ -323,6 +334,12 @@ function renderCanvas(nodes) {
|
||||
}
|
||||
|
||||
const closeCallBack = (e) => {}
|
||||
onBeforeUnmount(() => {
|
||||
closeCallBack('')
|
||||
})
|
||||
defineExpose({
|
||||
open
|
||||
})
|
||||
</script>
|
||||
|
||||
<style scoped lang="scss"></style>
|
||||
|
||||
@ -44,7 +44,7 @@
|
||||
</template>
|
||||
|
||||
<script setup lang="ts">
|
||||
import { ref, reactive } from 'vue'
|
||||
import { ref, reactive, onBeforeUnmount } from 'vue'
|
||||
import { inject } from 'vue'
|
||||
import Dialog from '@/components/dialog/baseDialog.vue'
|
||||
|
||||
@ -61,8 +61,19 @@ eventBus.on('graffitiDialog', () => {
|
||||
})
|
||||
}, 10)
|
||||
})
|
||||
const open = () => {
|
||||
baseDialog.value?.open()
|
||||
setTimeout(() => {
|
||||
graffiti = new YJ.Obj.Graffiti(window.earth, {
|
||||
width: width.value
|
||||
})
|
||||
}, 10)
|
||||
}
|
||||
|
||||
const closeCallBack = (e) => {}
|
||||
onBeforeUnmount(() => {
|
||||
closeCallBack('')
|
||||
})
|
||||
const widthInput = () => {
|
||||
let dom: any = document.getElementById('width')
|
||||
if (width.value < dom.min * 1) {
|
||||
@ -80,6 +91,9 @@ const draw = (e) => {
|
||||
graffiti.start()
|
||||
baseDialog.value?.close()
|
||||
}
|
||||
defineExpose({
|
||||
open
|
||||
})
|
||||
</script>
|
||||
|
||||
<style scoped lang="scss"></style>
|
||||
|
||||
@ -21,7 +21,7 @@
|
||||
</template>
|
||||
|
||||
<script setup lang="ts">
|
||||
import { ref, reactive, onMounted } from 'vue'
|
||||
import { onBeforeUnmount } from 'vue'
|
||||
import { inject } from 'vue'
|
||||
import Dialog from '@/components/dialog/baseDialog.vue'
|
||||
|
||||
@ -40,12 +40,28 @@ eventBus.on('profileDialog', () => {
|
||||
})
|
||||
}
|
||||
})
|
||||
const open = () => {
|
||||
profile = new YJ.Analysis.Profile(window.earth)
|
||||
profile.onEnd = (point) => {
|
||||
baseDialog.value?.open()
|
||||
setTimeout(() => {
|
||||
initEcharts(point)
|
||||
})
|
||||
}
|
||||
}
|
||||
const closeCallBack = (e) => {
|
||||
echartsObject && echartsObject.clear()
|
||||
profile && profile.clean()
|
||||
profile = []
|
||||
echartsObject = []
|
||||
}
|
||||
|
||||
onBeforeUnmount(() => {
|
||||
echartsObject && echartsObject.clear()
|
||||
profile && profile.clean()
|
||||
profile = []
|
||||
echartsObject = []
|
||||
})
|
||||
function close() {
|
||||
baseDialog.value?.close()
|
||||
}
|
||||
@ -358,6 +374,9 @@ function initEcharts(points) {
|
||||
|
||||
echartsObject.setOption(option)
|
||||
}
|
||||
defineExpose({
|
||||
open
|
||||
})
|
||||
</script>
|
||||
|
||||
<style scoped lang="scss"></style>
|
||||
|
||||
@ -228,7 +228,7 @@
|
||||
</template>
|
||||
|
||||
<script setup lang="ts">
|
||||
import { ref, reactive } from 'vue'
|
||||
import { ref, reactive, onBeforeUnmount } from 'vue'
|
||||
import { inject } from 'vue'
|
||||
import Dialog from '@/components/dialog/baseDialog.vue'
|
||||
|
||||
@ -253,12 +253,30 @@ eventBus.on('projConvertDialog', () => {
|
||||
})
|
||||
}, 10)
|
||||
})
|
||||
const open = () => {
|
||||
baseDialog.value?.open()
|
||||
if (status1.value) {
|
||||
reset()
|
||||
status1.value = false
|
||||
}
|
||||
status1.value = !status1.value
|
||||
setTimeout(() => {
|
||||
tools = new YJ.Tools(window.earth)
|
||||
tools.projConvert(status1.value, () => {
|
||||
status1.value = false
|
||||
isShowing.value = true
|
||||
})
|
||||
}, 10)
|
||||
}
|
||||
|
||||
const closeCallBack = (e) => {
|
||||
status1.value = false
|
||||
}
|
||||
onBeforeUnmount(() => {
|
||||
closeCallBack('')
|
||||
})
|
||||
const reset = () => {
|
||||
let contentElm:any = document
|
||||
let contentElm: any = document
|
||||
.getElementsByClassName('proj-convert')[0]
|
||||
.getElementsByClassName('content')[0]
|
||||
contentElm.getElementsByClassName('lng-dms-d')[0].value = null
|
||||
@ -273,6 +291,9 @@ const reset = () => {
|
||||
const close = (e) => {
|
||||
baseDialog.value?.close()
|
||||
}
|
||||
defineExpose({
|
||||
open
|
||||
})
|
||||
</script>
|
||||
|
||||
<style scoped lang="scss">
|
||||
|
||||
@ -109,7 +109,7 @@
|
||||
</template>
|
||||
|
||||
<script setup lang="ts">
|
||||
import { ref, reactive } from 'vue'
|
||||
import { ref, reactive, onBeforeUnmount } from 'vue'
|
||||
import { inject } from 'vue'
|
||||
import Dialog from '@/components/dialog/baseDialog.vue'
|
||||
|
||||
@ -134,12 +134,31 @@ eventBus.on('ProjectionConvertDialog', () => {
|
||||
}, 100)
|
||||
})
|
||||
|
||||
const open = () => {
|
||||
baseDialog.value?.open()
|
||||
if (status1.value) {
|
||||
reset()
|
||||
status1.value = false
|
||||
tools && tools.projectionConvert(status1.value, () => {})
|
||||
}
|
||||
status1.value = !status1.value
|
||||
setTimeout(() => {
|
||||
tools = new YJ.Tools(window.earth)
|
||||
tools.projectionConvert(status1.value, () => {
|
||||
status1.value = false
|
||||
})
|
||||
}, 100)
|
||||
}
|
||||
|
||||
const closeCallBack = (e) => {
|
||||
status1.value = false
|
||||
tools && tools.projectionConvert(status1.value, () => {})
|
||||
}
|
||||
onBeforeUnmount(() => {
|
||||
closeCallBack('')
|
||||
})
|
||||
const reset = () => {
|
||||
let contentElm:any = document
|
||||
let contentElm: any = document
|
||||
.getElementsByClassName('projection-convert')[0]
|
||||
.getElementsByClassName('content')[0]
|
||||
contentElm.getElementsByClassName('left-x')[0].value = null
|
||||
@ -150,6 +169,9 @@ const reset = () => {
|
||||
const close = (e) => {
|
||||
baseDialog.value?.close()
|
||||
}
|
||||
defineExpose({
|
||||
open
|
||||
})
|
||||
</script>
|
||||
|
||||
<style scoped lang="scss">
|
||||
|
||||
@ -133,7 +133,7 @@
|
||||
</template>
|
||||
|
||||
<script setup lang="ts">
|
||||
import { ref, reactive } from 'vue'
|
||||
import { ref, reactive, onBeforeUnmount } from 'vue'
|
||||
import { inject } from 'vue'
|
||||
import Dialog from '@/components/dialog/baseDialog.vue'
|
||||
import { RouteApi } from '@/api/route/index'
|
||||
@ -179,6 +179,35 @@ eventBus.on('routePlanningDialog', () => {
|
||||
}
|
||||
}, 100)
|
||||
})
|
||||
const open = () => {
|
||||
baseDialog.value?.open()
|
||||
setTimeout(() => {
|
||||
//加载路网数据
|
||||
|
||||
let host = 'http://192.168.110.25:8848'
|
||||
routePlanning = new YJ.Obj.RoutePlanning(window.earth, {
|
||||
gps: false,
|
||||
host
|
||||
})
|
||||
routePlanning.Dialog.queryCallBack = async (v) => {
|
||||
// await queryRoute(params, (response) => {
|
||||
// if (response) {
|
||||
// routePlanning.createRoute(response.list[0].positions)
|
||||
// }
|
||||
// })
|
||||
let res = await RouteApi.queryRoute({
|
||||
startLng: startLng.value,
|
||||
startLat: startLat.value,
|
||||
endLng: endLng.value,
|
||||
endLat: endLat.value,
|
||||
waypoints: []
|
||||
})
|
||||
if (res.code === 200) {
|
||||
routePlanning.createRoute(res.data.pathPoints)
|
||||
}
|
||||
}
|
||||
}, 100)
|
||||
}
|
||||
|
||||
//加载路网数据
|
||||
|
||||
@ -199,6 +228,9 @@ const closeCallBack = (e) => {
|
||||
endLng.value = null
|
||||
endLat.value = null
|
||||
}
|
||||
onBeforeUnmount(() => {
|
||||
closeCallBack('')
|
||||
})
|
||||
const routeQuery = async (e) => {
|
||||
let res = await RouteApi.queryRoute({
|
||||
startLng: startLng.value,
|
||||
@ -270,6 +302,9 @@ const inputEndLat = () => {
|
||||
endLat.value = dom.max * 1
|
||||
}
|
||||
}
|
||||
defineExpose({
|
||||
open
|
||||
})
|
||||
</script>
|
||||
|
||||
<style scoped lang="scss">
|
||||
|
||||
@ -64,7 +64,7 @@
|
||||
</template>
|
||||
|
||||
<script setup lang="ts">
|
||||
import { ref, reactive, onMounted } from 'vue'
|
||||
import { ref, reactive, onBeforeUnmount } from 'vue'
|
||||
import { inject } from 'vue'
|
||||
import Dialog from '@/components/dialog/baseDialog.vue'
|
||||
|
||||
@ -91,12 +91,20 @@ eventBus.on('screenShotDialog', () => {
|
||||
canvasWidth.value = window.earth.viewer.canvas.width
|
||||
canvasHeight.value = window.earth.viewer.canvas.height
|
||||
})
|
||||
const open = () => {
|
||||
baseDialog.value?.open()
|
||||
canvasWidth.value = window.earth.viewer.canvas.width
|
||||
canvasHeight.value = window.earth.viewer.canvas.height
|
||||
}
|
||||
|
||||
const closeCallBack = (e) => {
|
||||
progressVal.value = 0
|
||||
scale.value = 1
|
||||
modify.value = false
|
||||
}
|
||||
onBeforeUnmount(() => {
|
||||
closeCallBack('')
|
||||
})
|
||||
const close = (e) => {
|
||||
baseDialog.value?.close()
|
||||
}
|
||||
@ -116,6 +124,9 @@ const getResultData = (data) => {
|
||||
// eventBus.emit('mapPrintDialog')
|
||||
}
|
||||
}
|
||||
defineExpose({
|
||||
open
|
||||
})
|
||||
</script>
|
||||
|
||||
<style scoped lang="scss">
|
||||
|
||||
@ -180,7 +180,7 @@
|
||||
</template>
|
||||
|
||||
<script setup lang="ts">
|
||||
import { ref, reactive, onMounted } from 'vue'
|
||||
import { ref, reactive, onBeforeUnmount } from 'vue'
|
||||
import { inject } from 'vue'
|
||||
import Dialog from '@/components/dialog/baseDialog.vue'
|
||||
|
||||
@ -217,6 +217,22 @@ eventBus.on('submergeDialog', () => {
|
||||
}
|
||||
})
|
||||
|
||||
const open = () => {
|
||||
baseDialog.value?.open()
|
||||
|
||||
submerge = new YJ.Analysis.Submerge(window.earth)
|
||||
submerge.onEnd = (areaV, posi) => {
|
||||
isPausng.value = false
|
||||
minWaterLevel.value = submerge.minWaterLevel
|
||||
maxWaterLevel.value = submerge.maxWaterLevel
|
||||
waterVolume.value = submerge.waterVolume
|
||||
risingSpeed.value = submerge.risingSpeed
|
||||
waterLevel.value = submerge.waterLevels
|
||||
area.value = areaV * 1
|
||||
positions = posi
|
||||
}
|
||||
}
|
||||
|
||||
const closeCallBack = (e) => {
|
||||
minWaterLevel.value = 0
|
||||
maxWaterLevel.value = 0
|
||||
@ -230,6 +246,9 @@ const closeCallBack = (e) => {
|
||||
|
||||
submerge.destroy()
|
||||
}
|
||||
onBeforeUnmount(() => {
|
||||
closeCallBack('')
|
||||
})
|
||||
function close() {
|
||||
baseDialog.value?.close()
|
||||
}
|
||||
@ -341,6 +360,9 @@ function risingSpeedInput() {
|
||||
submerge.risingSpeed = risingSpeed.value
|
||||
}
|
||||
}
|
||||
defineExpose({
|
||||
open
|
||||
})
|
||||
</script>
|
||||
|
||||
<style scoped lang="scss">
|
||||
|
||||
@ -49,7 +49,7 @@
|
||||
</template>
|
||||
|
||||
<script setup lang="ts">
|
||||
import { ref, reactive } from 'vue'
|
||||
import { ref, reactive, onBeforeUnmount } from 'vue'
|
||||
import { inject } from 'vue'
|
||||
import Dialog from '@/components/dialog/baseDialog.vue'
|
||||
|
||||
@ -65,11 +65,16 @@ eventBus.on('terrainExcavationDialog', () => {
|
||||
excavation = new (window as any).YJ.Analysis.TerrainExcavation(window.earth, { height: 10 })
|
||||
})
|
||||
|
||||
const open = () => {
|
||||
baseDialog.value?.open()
|
||||
|
||||
excavation = new (window as any).YJ.Analysis.TerrainExcavation(window.earth, { height: 10 })
|
||||
}
|
||||
const changeHeight = () => {
|
||||
excavation.height = height.value
|
||||
}
|
||||
const heightInput = () => {
|
||||
let dom:any = document.getElementById('height')
|
||||
let dom: any = document.getElementById('height')
|
||||
if (height.value < dom.min * 1) {
|
||||
height.value = dom.min * 1
|
||||
} else if (height.value > dom.max * 1) {
|
||||
@ -79,6 +84,9 @@ const heightInput = () => {
|
||||
const closeCallBack = (e) => {
|
||||
height.value = 10
|
||||
}
|
||||
onBeforeUnmount(() => {
|
||||
closeCallBack('')
|
||||
})
|
||||
const close = (e) => {
|
||||
baseDialog.value?.close()
|
||||
}
|
||||
@ -88,6 +96,9 @@ const draw = (e) => {
|
||||
const clear = (e) => {
|
||||
excavation.clear()
|
||||
}
|
||||
defineExpose({
|
||||
open
|
||||
})
|
||||
</script>
|
||||
|
||||
<style scoped lang="scss"></style>
|
||||
|
||||
@ -83,7 +83,7 @@
|
||||
</template>
|
||||
|
||||
<script setup lang="ts">
|
||||
import { ref, reactive } from 'vue'
|
||||
import { ref, reactive, onBeforeUnmount } from 'vue'
|
||||
import { inject } from 'vue'
|
||||
import Dialog from '@/components/dialog/baseDialog.vue'
|
||||
|
||||
@ -101,10 +101,10 @@ eventBus.on('viewShedDialog', () => {
|
||||
viewShed = new (window as any).YJ.Analysis.ViewShed((window as any).earth)
|
||||
setTimeout(() => {
|
||||
let contentElm = document.getElementsByClassName('view-shed')[0]
|
||||
let e_horizontalViewAngle:any = contentElm.querySelector("input[name='horizontalViewAngle']")
|
||||
let rangeNodeActive:any = contentElm.getElementsByClassName('range-node-active')[0]
|
||||
let e_horizontalViewAngle: any = contentElm.querySelector("input[name='horizontalViewAngle']")
|
||||
let rangeNodeActive: any = contentElm.getElementsByClassName('range-node-active')[0]
|
||||
let rangeNodeActiveText = rangeNodeActive.getElementsByClassName('range-node-active-text')[0]
|
||||
let rangeProcess:any = contentElm.getElementsByClassName('range-process')[0]
|
||||
let rangeProcess: any = contentElm.getElementsByClassName('range-process')[0]
|
||||
let percentage = (horizontalViewAngle.value / 180) * 100
|
||||
rangeNodeActive.style.left = percentage + '%'
|
||||
rangeProcess.style.width = percentage + '%'
|
||||
@ -115,11 +115,33 @@ eventBus.on('viewShedDialog', () => {
|
||||
e_horizontalViewAngle.addEventListener('change', changeFun)
|
||||
}, 10)
|
||||
})
|
||||
|
||||
const open = () => {
|
||||
baseDialog.value?.open()
|
||||
viewShed && viewShed.destroy && viewShed.destroy()
|
||||
viewShed = new (window as any).YJ.Analysis.ViewShed((window as any).earth)
|
||||
setTimeout(() => {
|
||||
let contentElm = document.getElementsByClassName('view-shed')[0]
|
||||
let e_horizontalViewAngle: any = contentElm.querySelector("input[name='horizontalViewAngle']")
|
||||
let rangeNodeActive: any = contentElm.getElementsByClassName('range-node-active')[0]
|
||||
let rangeNodeActiveText = rangeNodeActive.getElementsByClassName('range-node-active-text')[0]
|
||||
let rangeProcess: any = contentElm.getElementsByClassName('range-process')[0]
|
||||
let percentage = (horizontalViewAngle.value / 180) * 100
|
||||
rangeNodeActive.style.left = percentage + '%'
|
||||
rangeProcess.style.width = percentage + '%'
|
||||
rangeNodeActiveText.innerHTML = horizontalViewAngle.value + '°'
|
||||
e_horizontalViewAngle.removeEventListener('input', inputFun)
|
||||
e_horizontalViewAngle.removeEventListener('change', changeFun)
|
||||
e_horizontalViewAngle.addEventListener('input', inputFun)
|
||||
e_horizontalViewAngle.addEventListener('change', changeFun)
|
||||
}, 10)
|
||||
}
|
||||
|
||||
function inputFun() {
|
||||
let contentElm = document.getElementsByClassName('view-shed')[0]
|
||||
let rangeNodeActive:any = contentElm.getElementsByClassName('range-node-active')[0]
|
||||
let rangeNodeActiveText:any = rangeNodeActive.getElementsByClassName('range-node-active-text')[0]
|
||||
let rangeProcess:any = contentElm.getElementsByClassName('range-process')[0]
|
||||
let rangeNodeActive: any = contentElm.getElementsByClassName('range-node-active')[0]
|
||||
let rangeNodeActiveText: any = rangeNodeActive.getElementsByClassName('range-node-active-text')[0]
|
||||
let rangeProcess: any = contentElm.getElementsByClassName('range-process')[0]
|
||||
let percentage = (horizontalViewAngle.value / 180) * 100
|
||||
rangeNodeActive.style.left = percentage + '%'
|
||||
rangeProcess.style.width = percentage + '%'
|
||||
@ -137,8 +159,11 @@ const closeCallBack = (e) => {
|
||||
viewPointHeight.value = 1.8
|
||||
horizontalViewAngle.value = 90
|
||||
}
|
||||
onBeforeUnmount(() => {
|
||||
closeCallBack('')
|
||||
})
|
||||
function viewPointHeightInput(e) {
|
||||
let dom:any = document.getElementById('viewPointHeight')
|
||||
let dom: any = document.getElementById('viewPointHeight')
|
||||
if (viewPointHeight.value != '.') {
|
||||
if (viewPointHeight.value < dom.min * 1) {
|
||||
viewPointHeight.value = dom.min * 1
|
||||
@ -157,6 +182,9 @@ function close() {
|
||||
function edit() {
|
||||
viewShed.nodeEdit()
|
||||
}
|
||||
defineExpose({
|
||||
open
|
||||
})
|
||||
</script>
|
||||
|
||||
<style scoped lang="scss"></style>
|
||||
|
||||
@ -51,6 +51,10 @@ eventBus.on('analysisDialog', () => {
|
||||
baseDialog.value?.open()
|
||||
})
|
||||
|
||||
const open = () => {
|
||||
baseDialog.value?.open()
|
||||
}
|
||||
|
||||
const clangeViewPointHeight = () => {}
|
||||
const viewPointHeightInput = () => {
|
||||
let dom: any = document.getElementById('viewPointHeight')
|
||||
@ -61,18 +65,24 @@ const viewPointHeightInput = () => {
|
||||
}
|
||||
}
|
||||
const closeCallBack = (e) => {
|
||||
viewPointHeight.value = 1.8;
|
||||
(window as any).YJ.Measure.SetMeasureStatus(false)
|
||||
viewPointHeight.value = 1.8
|
||||
;(window as any).YJ.Measure.SetMeasureStatus(false)
|
||||
// visibility && visibility.end()
|
||||
}
|
||||
onBeforeUnmount(() => {
|
||||
closeCallBack('')
|
||||
})
|
||||
const draw = (e) => {
|
||||
visibility && visibility.end && visibility.end()
|
||||
visibility = new YJ.Analysis.Visibility(window.earth, { viewPointHeight: viewPointHeight.value })
|
||||
// visibility.create(this)
|
||||
!(window as any).analysisArr && ((window as any).analysisArr = []);
|
||||
(window as any).analysisArr.push(visibility);
|
||||
!(window as any).analysisArr && ((window as any).analysisArr = [])
|
||||
;(window as any).analysisArr.push(visibility)
|
||||
baseDialog.value?.close()
|
||||
}
|
||||
defineExpose({
|
||||
open
|
||||
})
|
||||
</script>
|
||||
|
||||
<style scoped lang="scss"></style>
|
||||
|
||||
196
src/renderer/src/views/components/propertyBox/addDevice.vue
Normal file
196
src/renderer/src/views/components/propertyBox/addDevice.vue
Normal file
@ -0,0 +1,196 @@
|
||||
<template>
|
||||
<Dialog
|
||||
ref="baseDialog"
|
||||
class="addDevice"
|
||||
:title="addTitle"
|
||||
left="calc(50% - 160px)"
|
||||
top="calc(50% - 120px)"
|
||||
>
|
||||
<template #content>
|
||||
<el-form label-width="100px" :model="addForm" :rules="peopleRules" ref="peopleFormRef">
|
||||
<el-form-item label="名称" prop="cameraName">
|
||||
<el-input v-model="addForm.cameraName" clearable />
|
||||
</el-form-item>
|
||||
<el-form-item label="设备IP" prop="ip">
|
||||
<el-input v-model="addForm.ip" clearable></el-input>
|
||||
</el-form-item>
|
||||
<el-form-item label="设备端口" prop="port">
|
||||
<el-input v-model="addForm.port" clearable></el-input>
|
||||
</el-form-item>
|
||||
<el-form-item label="用户名" prop="userName">
|
||||
<el-input v-model="addForm.userName" clearable></el-input>
|
||||
</el-form-item>
|
||||
<el-form-item label="密码" prop="password">
|
||||
<el-input v-model="addForm.password" clearable></el-input>
|
||||
</el-form-item>
|
||||
<el-form-item label="设备类型" prop="type">
|
||||
<el-select v-model="addForm.type" filterable placeholder="请选择">
|
||||
<el-option label="海康" value="1"> </el-option>
|
||||
<el-option label="大华" value="2"> </el-option>
|
||||
<!-- <el-option label="手动录入" value="3"> </el-option> -->
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item v-if="addForm.type === '3'" label="视频流地址" prop="flvUrl">
|
||||
<el-input v-model="addForm.flvUrl" clearable></el-input>
|
||||
</el-form-item>
|
||||
<el-form-item label="通道号" prop="channel">
|
||||
<el-input v-model="addForm.channel" clearable></el-input>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
</template>
|
||||
<template #footer>
|
||||
<el-button @click="cancel">取消</el-button>
|
||||
<el-button type="primary" @click="submitProtal"> 确定 </el-button>
|
||||
</template>
|
||||
</Dialog>
|
||||
</template>
|
||||
|
||||
<script setup lang="ts">
|
||||
import { ref } from 'vue'
|
||||
import { inject } from 'vue'
|
||||
import { TreeApi } from '@/api/tree'
|
||||
import Dialog from '@/components/dialog/baseDialog.vue'
|
||||
import { initMapData } from '../../../common/initMapData'
|
||||
import { useTreeNode } from '../tree/hooks/treeNode'
|
||||
import { deviceApi } from '@/api/deviceManage/index'
|
||||
import { ElMessage, ElMessageBox } from 'element-plus'
|
||||
|
||||
const { cusAddNodes } = useTreeNode()
|
||||
|
||||
const baseDialog: any = ref(null)
|
||||
const eventBus: any = inject('bus')
|
||||
|
||||
var addTitle = ref('')
|
||||
var peopleFormRef: any = ref('')
|
||||
|
||||
var addForm: any = reactive({
|
||||
cameraName: '',
|
||||
ip: '',
|
||||
port: '',
|
||||
userName: '',
|
||||
password: '',
|
||||
type: '',
|
||||
channel: '',
|
||||
flvUrl: ''
|
||||
})
|
||||
|
||||
const peopleRules: any = reactive({
|
||||
cameraName: [{ required: true, message: '请输入名称', trigger: 'blur' }],
|
||||
ip: [{ required: true, message: '请输入ip', trigger: 'blur' }],
|
||||
port: [{ required: true, message: '请输入设备端口号', trigger: 'blur' }],
|
||||
userName: [{ required: true, message: '请输入用户名', trigger: 'blur' }],
|
||||
password: [{ required: true, message: '请输入密码', trigger: 'blur' }],
|
||||
type: [{ required: true, message: '请选择设备类型', trigger: 'blur' }]
|
||||
})
|
||||
|
||||
var cancel = () => {
|
||||
// pDialogVisible.value = false
|
||||
baseDialog.value?.close()
|
||||
|
||||
addForm = {
|
||||
cameraName: '',
|
||||
ip: '',
|
||||
port: '',
|
||||
userName: '',
|
||||
password: '',
|
||||
type: '',
|
||||
channel: '',
|
||||
flvUrl: ''
|
||||
}
|
||||
}
|
||||
var submitProtal = () => {
|
||||
peopleFormRef.value.validate(async (valid) => {
|
||||
if (valid) {
|
||||
if (addForm.channel === undefined || addForm.channel === '' || addForm.channel === null) {
|
||||
addForm.channel = 1
|
||||
}
|
||||
if (addTitle.value == '添加设备') {
|
||||
const res = await deviceApi.addDevice(addForm)
|
||||
|
||||
if (res.code === 200) {
|
||||
ElMessage.success('操作成功')
|
||||
eventBus.emit('addOptionResuit')
|
||||
}
|
||||
} else {
|
||||
delete addForm.updatedAt
|
||||
delete addForm.areaId
|
||||
delete addForm.createdAt
|
||||
const res = await deviceApi.updateDevice(addForm)
|
||||
if (res.code === 200) {
|
||||
ElMessage.success('操作成功')
|
||||
eventBus.emit('addOptionResuit')
|
||||
}
|
||||
}
|
||||
baseDialog.value?.close()
|
||||
} else {
|
||||
console.log('error submit!!')
|
||||
return false
|
||||
}
|
||||
})
|
||||
}
|
||||
eventBus.on('openAddDevice', (params) => {
|
||||
addTitle.value = params.title
|
||||
if (addTitle.value != '添加设备') {
|
||||
addForm = params.data
|
||||
} else {
|
||||
addForm = {
|
||||
cameraName: '',
|
||||
ip: '',
|
||||
port: '',
|
||||
userName: '',
|
||||
password: '',
|
||||
type: '',
|
||||
channel: '',
|
||||
flvUrl: ''
|
||||
}
|
||||
}
|
||||
baseDialog.value?.open()
|
||||
})
|
||||
const open = () => {
|
||||
baseDialog.value?.open()
|
||||
}
|
||||
const confirm = () => {
|
||||
baseDialog.value?.close()
|
||||
}
|
||||
defineExpose({
|
||||
open
|
||||
})
|
||||
</script>
|
||||
|
||||
<style lang="scss">
|
||||
.YJ-custom-base-dialog.addDevice > .content input,
|
||||
.YJ-custom-base-dialog.addDevice > .content textarea {
|
||||
background-color: transparent !important;
|
||||
border: unset !important;
|
||||
}
|
||||
</style>
|
||||
<style scoped lang="scss">
|
||||
::v-deep .el-form-item--label-right .el-form-item__label {
|
||||
color: #fff !important;
|
||||
}
|
||||
::v-deep .el-form-item .el-input__wrapper {
|
||||
background-color: rgba(0, 0, 0, 0.5) !important;
|
||||
box-shadow: 0 0 0 0.5px #00ffff inset !important; /* 新增此行 */
|
||||
}
|
||||
::v-deep .el-form-item .el-select__wrapper {
|
||||
background-color: rgba(0, 0, 0, 0.5) !important;
|
||||
box-shadow: 0 0 0 0.5px #00ffff inset !important; /* 新增此行 */
|
||||
:deep(input) {
|
||||
background-color: transparent !important;
|
||||
border: unset !important;
|
||||
}
|
||||
}
|
||||
::v-deep .el-form-item .el-input__inner {
|
||||
color: #fff !important;
|
||||
}
|
||||
::v-deep .el-form-item .el-select__placeholder {
|
||||
color: #fff !important;
|
||||
}
|
||||
::v-deep .el-input__wrapper {
|
||||
padding: 0px !important;
|
||||
}
|
||||
::v-deep .el-button:hover {
|
||||
background-color: rgba(0, 255, 255, 0.2) !important;
|
||||
color: rgba(0, 255, 255, 1) !important;
|
||||
}
|
||||
</style>
|
||||
@ -31,6 +31,7 @@ const open = () => {
|
||||
baseDialog.value?.open()
|
||||
}
|
||||
const confirm = () => {
|
||||
console.log('121212121', baseDialog.value)
|
||||
baseDialog.value?.close()
|
||||
let name = text.value
|
||||
text.value = ''
|
||||
@ -40,11 +41,15 @@ const confirm = () => {
|
||||
return
|
||||
}
|
||||
let id = new YJ.Tools().randomString()
|
||||
let options: any = await initMapData('groundText', {
|
||||
let options: any = await initMapData(
|
||||
'groundText',
|
||||
{
|
||||
id: id,
|
||||
text: name,
|
||||
positions: positions
|
||||
}, null)
|
||||
},
|
||||
null
|
||||
)
|
||||
delete options.host
|
||||
delete options.positions
|
||||
let selectedNodes = window.treeObj.getSelectedNodes()
|
||||
@ -53,8 +58,7 @@ const confirm = () => {
|
||||
if (node) {
|
||||
if (node.sourceType === 'directory') {
|
||||
parentId = node.id
|
||||
}
|
||||
else {
|
||||
} else {
|
||||
parentId = node.parentId
|
||||
}
|
||||
}
|
||||
|
||||
@ -21,23 +21,23 @@
|
||||
/>
|
||||
|
||||
<!-- 多点视线分析 -->
|
||||
<Visibility ref="visibility"></Visibility>
|
||||
<CircleViewShed ref="circleViewShed"></CircleViewShed>
|
||||
<Submerge ref="submerge"></Submerge>
|
||||
<Profile ref="profile"></Profile>
|
||||
<ViewShed ref="viewShed"></ViewShed>
|
||||
<CutFill ref="cutFill"></CutFill>
|
||||
<Contour ref="contour"></Contour>
|
||||
<RoutePlanning ref="routePlanning"></RoutePlanning>
|
||||
<Graffiti ref="graffiti"></Graffiti>
|
||||
<!-- <Visibility ref="visibility"></Visibility> -->
|
||||
<!-- <CircleViewShed ref="circleViewShed"></CircleViewShed> -->
|
||||
<!-- <Submerge ref="submerge"></Submerge> -->
|
||||
<!-- <Profile ref="profile"></Profile> -->
|
||||
<!-- <ViewShed ref="viewShed"></ViewShed> -->
|
||||
<!-- <CutFill ref="cutFill"></CutFill> -->
|
||||
<!-- <Contour ref="contour"></Contour> -->
|
||||
<!-- <RoutePlanning ref="routePlanning"></RoutePlanning> -->
|
||||
<!-- <Graffiti ref="graffiti"></Graffiti> -->
|
||||
<FlyRoam ref="flyRoam"></FlyRoam>
|
||||
<CoorLocation ref="coorLocation"></CoorLocation>
|
||||
<ScreenShot ref="screenShot"></ScreenShot>
|
||||
<TerrainExcavation ref="terrainExcavation"></TerrainExcavation>
|
||||
<ProjConvert ref="projConvert"></ProjConvert>
|
||||
<ProjectionConvert ref="projectionConvert"></ProjectionConvert>
|
||||
<GoodsSearchCircle ref="goodsSearchCircle"></GoodsSearchCircle>
|
||||
<GoodsSearchPolgon ref="goodsSearchPolgon"></GoodsSearchPolgon>
|
||||
<!-- <CoorLocation ref="coorLocation"></CoorLocation> -->
|
||||
<!-- <ScreenShot ref="screenShot"></ScreenShot> -->
|
||||
<!-- <TerrainExcavation ref="terrainExcavation"></TerrainExcavation> -->
|
||||
<!-- <ProjConvert ref="projConvert"></ProjConvert> -->
|
||||
<!-- <ProjectionConvert ref="projectionConvert"></ProjectionConvert> -->
|
||||
<!-- <GoodsSearchCircle ref="goodsSearchCircle"></GoodsSearchCircle> -->
|
||||
<!-- <GoodsSearchPolgon ref="goodsSearchPolgon"></GoodsSearchPolgon> -->
|
||||
<tufuSelect ref="tufuselect"></tufuSelect>
|
||||
<imagePop ref="imagepop"></imagePop>
|
||||
<model ref="Model"></model>
|
||||
@ -50,6 +50,7 @@
|
||||
<modelSetting ref="modelsetting"></modelSetting>
|
||||
<modelObject ref="modelobject"></modelObject>
|
||||
<graphObject ref="graphobject"></graphObject>
|
||||
<addDevice ref="adddevice"></addDevice>
|
||||
</template>
|
||||
|
||||
<script setup lang="ts">
|
||||
@ -125,6 +126,7 @@ import graphObject from '../components/propertyBox/graphObject.vue'
|
||||
import graph from '../components/propertyBox/graph.vue'
|
||||
import graphSetting from '../components/propertyBox/graphSetting.vue'
|
||||
import photo from '../components/propertyBox/photo.vue'
|
||||
import addDevice from '../components/propertyBox/addDevice.vue'
|
||||
|
||||
import { GisApi } from '@/api/gisApi'
|
||||
|
||||
@ -139,7 +141,6 @@ let tree = ref()
|
||||
let selectImgRef = ref()
|
||||
let editdirectoryBox = ref()
|
||||
eventBus.on('openDialog', async (sourceType: any, id: any) => {
|
||||
console.log(sourceType, id)
|
||||
if (dynamicComponentRef.value && dynamicComponentRef.value.close) {
|
||||
dynamicComponentRef.value.close()
|
||||
}
|
||||
@ -312,11 +313,97 @@ eventBus.on('openDialog', async (sourceType: any, id: any) => {
|
||||
await nextTick()
|
||||
dynamicComponentRef.value?.open(id)
|
||||
break
|
||||
//分析库
|
||||
case 'submergeDialog': //淹没分析
|
||||
currentComponent.value = Submerge
|
||||
await nextTick()
|
||||
dynamicComponentRef.value?.open(id)
|
||||
break
|
||||
case 'profileDialog': //剖面分析
|
||||
currentComponent.value = Profile
|
||||
await nextTick()
|
||||
dynamicComponentRef.value?.open(id)
|
||||
break
|
||||
case 'analysisDialog': //视线分析
|
||||
currentComponent.value = Visibility
|
||||
await nextTick()
|
||||
dynamicComponentRef.value?.open(id)
|
||||
break
|
||||
case 'viewShedDialog': //视域分析
|
||||
currentComponent.value = ViewShed
|
||||
await nextTick()
|
||||
dynamicComponentRef.value?.open(id)
|
||||
break
|
||||
case 'circleViewShedDialog': //圆形视域分析
|
||||
currentComponent.value = CircleViewShed
|
||||
await nextTick()
|
||||
dynamicComponentRef.value?.open(id)
|
||||
break
|
||||
case 'cutFillDialog': //填挖方分析
|
||||
currentComponent.value = CutFill
|
||||
await nextTick()
|
||||
dynamicComponentRef.value?.open(id)
|
||||
break
|
||||
case 'contourDialog': //全局等高线分析
|
||||
currentComponent.value = Contour
|
||||
await nextTick()
|
||||
dynamicComponentRef.value?.open(id)
|
||||
break
|
||||
//工具库
|
||||
case 'routePlanningDialog': //路径规划
|
||||
currentComponent.value = RoutePlanning
|
||||
await nextTick()
|
||||
dynamicComponentRef.value?.open(id)
|
||||
break
|
||||
case 'graffitiDialog': //涂鸦
|
||||
currentComponent.value = Graffiti
|
||||
await nextTick()
|
||||
dynamicComponentRef.value?.open(id)
|
||||
break
|
||||
case 'flyRoamDialog': //飞行漫游
|
||||
currentComponent.value = FlyRoam
|
||||
await nextTick()
|
||||
dynamicComponentRef.value?.open(id)
|
||||
break
|
||||
case 'coorLocationDialog': //坐标定位
|
||||
currentComponent.value = CoorLocation
|
||||
await nextTick()
|
||||
dynamicComponentRef.value?.open(id)
|
||||
break
|
||||
case 'screenShotDialog': //高清出图
|
||||
currentComponent.value = ScreenShot
|
||||
await nextTick()
|
||||
dynamicComponentRef.value?.open(id)
|
||||
break
|
||||
case 'terrainExcavationDialog': //地形开挖
|
||||
currentComponent.value = TerrainExcavation
|
||||
await nextTick()
|
||||
dynamicComponentRef.value?.open(id)
|
||||
break
|
||||
case 'projConvertDialog': //度分秒
|
||||
currentComponent.value = ProjConvert
|
||||
await nextTick()
|
||||
dynamicComponentRef.value?.open(id)
|
||||
break
|
||||
case 'ProjectionConvertDialog': //投影转换
|
||||
currentComponent.value = ProjectionConvert
|
||||
await nextTick()
|
||||
dynamicComponentRef.value?.open(id)
|
||||
break
|
||||
case 'goodsSearchCircleDialog': //圆形统计
|
||||
currentComponent.value = GoodsSearchCircle
|
||||
await nextTick()
|
||||
dynamicComponentRef.value?.open(id)
|
||||
break
|
||||
case 'goodsSearchPolgonDialog': //多边形统计
|
||||
currentComponent.value = GoodsSearchPolgon
|
||||
await nextTick()
|
||||
dynamicComponentRef.value?.open(id)
|
||||
break
|
||||
default:
|
||||
break
|
||||
}
|
||||
dynamicComponentRef.value.id = id
|
||||
console.log(dynamicComponentRef.value)
|
||||
id && (dynamicComponentRef.value.id = id)
|
||||
})
|
||||
eventBus.on('openSelectImg', (selected, entity) => {
|
||||
// $sendElectronChanel("requireGEMarkerName", {
|
||||
@ -353,7 +440,6 @@ const createEarth = async () => {
|
||||
let openLeftClick = await new YJ.Global.openLeftClick(window.earth)
|
||||
let openRightClick = await new YJ.Global.openRightClick(window.earth)
|
||||
YJ.Global.MouseRightMenu(window.earth, true, (text, object) => {
|
||||
console.log(text)
|
||||
switch (text) {
|
||||
case 'rotateAround':
|
||||
YJ.Global.rotateAround(window.earth, object.position)
|
||||
@ -405,7 +491,6 @@ eventBus.on('defineClickAddLinkCb', (fun) => {
|
||||
|
||||
const sysChange = async () => {
|
||||
let systemSetting = JSON.parse(localStorage.getItem('systemSetting')||'{}')
|
||||
console.log('systemSetting', systemSetting)
|
||||
const obj = {
|
||||
compass: systemSetting.showCompass, //罗盘
|
||||
legend: systemSetting.showDistanceLegend, //比例尺
|
||||
@ -424,6 +509,7 @@ const sysChange = async () => {
|
||||
//系统
|
||||
let coor = systemSetting.coordinate ? systemSetting.coordinate : 'EPSG:4326'
|
||||
YJ.Global.setCoordinateSystem(window.earth, coor)
|
||||
YJ.Global.setDMS(window.earth, systemSetting.positionType)
|
||||
|
||||
//比例尺
|
||||
await YJ.Global.SheetIndexStatusSwitch(window.earth, systemSetting.sheetIndexStatusSwitch)
|
||||
|
||||
Reference in New Issue
Block a user