Merge branch 'zyl' of http://xny.yj-3d.com:3000/zhouyulong/electron-4 into zyl
This commit is contained in:
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
18
src/renderer/public/sdk/YJEarth.min.js
vendored
18
src/renderer/public/sdk/YJEarth.min.js
vendored
File diff suppressed because one or more lines are too long
@ -163,10 +163,10 @@ export default {
|
||||
version: '版本信息'
|
||||
},
|
||||
project: {
|
||||
engineeringSettings: '工程设置',
|
||||
engineeringSettings: '路网数据',
|
||||
importRoadNetwork: '路网导入',
|
||||
locationData: '地点数据',
|
||||
importPOLI: 'POLI导入',
|
||||
importPOLI: 'POIL导入',
|
||||
engineeringData: '工程数据',
|
||||
engineeringOverrideImport: '工程覆盖导入',
|
||||
engineeringMergeImports: '工程合并导入',
|
||||
@ -353,7 +353,7 @@ export default {
|
||||
},
|
||||
},
|
||||
},
|
||||
// 态势部分
|
||||
// 态势部分
|
||||
ts: {
|
||||
historyDeduce: "历史推演",
|
||||
deduceName: "推演名称",
|
||||
|
||||
@ -11,7 +11,8 @@ export const LoginApi = {
|
||||
logout: async () => {
|
||||
return await request.post({
|
||||
url: `/user/logout`,
|
||||
|
||||
|
||||
})
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@ -13,4 +13,10 @@ export const AuthApi = {
|
||||
url: `/auth/info`
|
||||
})
|
||||
},
|
||||
authImport: async (data) => {
|
||||
return await request.post({
|
||||
url: `/auth/import`,
|
||||
data: data
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
BIN
src/renderer/src/assets/images/pbfl.png
Normal file
BIN
src/renderer/src/assets/images/pbfl.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 788 B |
BIN
src/renderer/src/assets/images/poil.png
Normal file
BIN
src/renderer/src/assets/images/poil.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 738 B |
@ -1,5 +1,6 @@
|
||||
import theme from "@/utils/theme";
|
||||
export const sysChange = async (eventBus) => {
|
||||
import { set } from "date-fns";
|
||||
export const sysChange = async (eventBus, isFirst) => {
|
||||
let systemSetting = JSON.parse(localStorage.getItem("systemSetting") || '{}')
|
||||
|
||||
const obj = {
|
||||
@ -31,7 +32,11 @@ export const sysChange = async (eventBus) => {
|
||||
YJ.Global.setDMS(window.earth, systemSetting.positionType)
|
||||
|
||||
//比例尺
|
||||
await YJ.Global.SheetIndexStatusSwitch(window.earth, systemSetting.sheetIndexStatusSwitch)
|
||||
console.log(systemSetting.sheetIndexStatusSwitch, window.earth, '标准图幅')
|
||||
setTimeout(async () => {
|
||||
await YJ.Global.SheetIndexStatusSwitch(window.earth, systemSetting.sheetIndexStatusSwitch)
|
||||
}, isFirst ? 1000 : 0)
|
||||
|
||||
eventBus.emit('tufuInput', systemSetting.sheetIndexStatusSwitch)
|
||||
|
||||
//鹰眼图
|
||||
|
||||
@ -74,7 +74,8 @@
|
||||
</div>
|
||||
</template>
|
||||
<template #footer>
|
||||
<uploadFiles accept=".YJ" :maxSize="1"></uploadFiles>
|
||||
<!-- <uploadFiles accept=".YJ" :maxSize="1"></uploadFiles> -->
|
||||
<button @click="importAuth">授权导入</button>
|
||||
<button @click="close">退出系统</button>
|
||||
</template>
|
||||
</Dialog>
|
||||
@ -362,6 +363,25 @@ const copy = async (text) => {
|
||||
ElMessage.error('复制失败')
|
||||
}
|
||||
}
|
||||
|
||||
function importAuth() {
|
||||
// importWin = true
|
||||
let option = {
|
||||
properties: ['openFile'],
|
||||
filters: [{ name: '授权文件', extensions: ['YJ'] }]
|
||||
}
|
||||
$sendElectronChanel('open-directory-dialog', option)
|
||||
$recvElectronChanel('selectedItem', (e, paths) => {
|
||||
console.log(paths, 'paths')
|
||||
let formdata = new FormData()
|
||||
formdata.append('filePath', paths[0])
|
||||
try {
|
||||
let res = AuthApi.authImport(formdata)
|
||||
ElMessage.success('文件授权成功')
|
||||
getAuthInfo()
|
||||
} catch (error) {}
|
||||
})
|
||||
}
|
||||
</script>
|
||||
<style scoped lang="scss">
|
||||
.rightBox {
|
||||
|
||||
@ -49,7 +49,15 @@
|
||||
{{ t('auths.noAuthexpire') }}
|
||||
</div>
|
||||
</div>
|
||||
<uploadFiles accept=".YJ" :maxSize="1"></uploadFiles>
|
||||
<!-- <uploadFiles accept=".YJ" :maxSize="1"></uploadFiles> -->
|
||||
|
||||
<el-button
|
||||
@click="importAuth"
|
||||
color="#004b4b"
|
||||
style="border: 1px solid rgba(var(--color-base1), 0.5); width: 90px"
|
||||
>
|
||||
<span>{{ t('auths.upload') }}</span>
|
||||
</el-button>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
@ -59,6 +67,11 @@ import uploadFiles from '@/components/upload/uploadFiles.vue'
|
||||
import { AuthApi } from '@/api/setting/auth'
|
||||
import useClipboard from 'vue-clipboard3'
|
||||
import { ElMessage, ElMessageBox } from 'element-plus'
|
||||
import {
|
||||
$sendElectronChanel,
|
||||
$recvElectronChanel,
|
||||
$changeComponentShow
|
||||
} from '@/utils/communication'
|
||||
|
||||
const eventBus: any = inject('bus')
|
||||
const { t } = useI18n()
|
||||
@ -84,6 +97,24 @@ onUnmounted(() => {
|
||||
eventBus.off('upload', func)
|
||||
})
|
||||
|
||||
function importAuth() {
|
||||
// importWin = true
|
||||
let option = {
|
||||
properties: ['openFile'],
|
||||
filters: [{ name: '授权文件', extensions: ['YJ'] }]
|
||||
}
|
||||
$sendElectronChanel('open-directory-dialog', option)
|
||||
$recvElectronChanel('selectedItem', (e, paths) => {
|
||||
let formdata = new FormData()
|
||||
formdata.append('filePath', paths[0])
|
||||
try {
|
||||
let res = AuthApi.authImport(formdata)
|
||||
ElMessage.success('文件授权成功')
|
||||
getAuthInfo()
|
||||
} catch (error) {}
|
||||
})
|
||||
}
|
||||
|
||||
// eventBus.on('upload', (data) => {
|
||||
// if (data) {
|
||||
// getAuthInfo()
|
||||
|
||||
@ -32,7 +32,7 @@
|
||||
<div class="item_left">
|
||||
<div class="img">
|
||||
<img
|
||||
src="../../../../../../assets/images/pdf.png"
|
||||
src="../../../../../../assets/images/pbfl.png"
|
||||
style="width: 40px; height: 50px"
|
||||
/>
|
||||
</div>
|
||||
@ -88,7 +88,7 @@
|
||||
<div class="item_left">
|
||||
<div class="img">
|
||||
<img
|
||||
src="../../../../../../assets/images/poi.png"
|
||||
src="../../../../../../assets/images/poil.png"
|
||||
style="width: 40px; height: 50px"
|
||||
/>
|
||||
</div>
|
||||
|
||||
@ -105,6 +105,7 @@ import {
|
||||
$recvElectronChanel,
|
||||
$removeElectronChanel
|
||||
} from '@/utils/communication'
|
||||
import { set } from 'date-fns'
|
||||
|
||||
const eventBus: any = inject('bus')
|
||||
|
||||
@ -258,7 +259,15 @@ const attachUpload = async () => {
|
||||
}
|
||||
})
|
||||
}
|
||||
let isClick = true
|
||||
const downloadTemp = async () => {
|
||||
if (!isClick) {
|
||||
return
|
||||
}
|
||||
isClick = false
|
||||
setTimeout(() => {
|
||||
isClick = true
|
||||
}, 1000)
|
||||
let p = 'xlsx'
|
||||
if (process.platform == 'linux') {
|
||||
p = 'et'
|
||||
|
||||
@ -258,6 +258,7 @@ watch(photoName, (val) => {
|
||||
// treeRef.value!.filter(val)
|
||||
// }
|
||||
modelList.value = []
|
||||
currModelList.value = []
|
||||
getModelList()
|
||||
})
|
||||
const filterNode: any = (value, data) => {
|
||||
@ -401,7 +402,8 @@ const handleFileChange = (e: Event) => {
|
||||
}
|
||||
//创建模型库
|
||||
const createModelDB = async () => {
|
||||
let date = new Date().toISOString().split('T')[0]
|
||||
// let date = new Date().toISOString().split('T')[0]
|
||||
let date = getCurrentDateFormatted()
|
||||
let option = {
|
||||
title: '创建军标库',
|
||||
// filename: 'YJEarth.junbiao',
|
||||
@ -423,6 +425,13 @@ const createModelDB = async () => {
|
||||
}
|
||||
})
|
||||
}
|
||||
function getCurrentDateFormatted() {
|
||||
const now = new Date()
|
||||
const year = now.getFullYear()
|
||||
const month = String(now.getMonth() + 1).padStart(2, '0')
|
||||
const day = String(now.getDate()).padStart(2, '0')
|
||||
return `${year}${month}${day}`
|
||||
}
|
||||
|
||||
//导入模型库
|
||||
const importModelDB = () => {
|
||||
@ -891,24 +900,24 @@ const handleDelete = (row: any) => {
|
||||
type: 'warning'
|
||||
}
|
||||
)
|
||||
.then(() => {
|
||||
let formData = new FormData()
|
||||
formData.append('militaryId', row.id)
|
||||
GraphApi.delModel(formData).then((res) => {
|
||||
if (res.code == 0 || res.code == 200) {
|
||||
getModelListByType(row.militaryTypeId)
|
||||
ElMessage.success('删除成功')
|
||||
if (res.data?.length) {
|
||||
//删除对应的树数据和地图数据
|
||||
res.data.forEach((item) => {
|
||||
let node = window.treeObj.getNodeByParam('id', item, null)
|
||||
let source_ids = cusRemoveNode(window.treeObj, [node])
|
||||
;(window as any).earth.entityMap.get(source_ids[0]).remove()
|
||||
;(window as any)._entityMap.delete(item)
|
||||
})
|
||||
}
|
||||
.then(async () => {
|
||||
try {
|
||||
let formData = new FormData()
|
||||
formData.append('militaryId', row.id)
|
||||
let res = await GraphApi.delModel(formData)
|
||||
|
||||
getModelListByType(row.militaryTypeId)
|
||||
ElMessage.success('删除成功')
|
||||
if (res.data?.length) {
|
||||
//删除对应的树数据和地图数据
|
||||
res.data.forEach((item) => {
|
||||
let node = window.treeObj.getNodeByParam('id', item, null)
|
||||
let source_ids = cusRemoveNode(window.treeObj, [node])
|
||||
;(window as any).earth.entityMap.get(source_ids[0]).remove()
|
||||
;(window as any)._entityMap.delete(item)
|
||||
})
|
||||
}
|
||||
})
|
||||
} catch (error) {}
|
||||
})
|
||||
.catch(() => {})
|
||||
}
|
||||
|
||||
@ -286,6 +286,7 @@ watch(photoName, (val) => {
|
||||
// }
|
||||
getModelList()
|
||||
modelList.value = []
|
||||
currModelList.value = []
|
||||
})
|
||||
const filterNode: any = (value, data) => {
|
||||
if (!value) return true
|
||||
@ -448,7 +449,8 @@ const handleFileChange = (e: Event) => {
|
||||
|
||||
//创建模型库
|
||||
const createModelDB = async () => {
|
||||
let date = new Date().toISOString().split('T')[0]
|
||||
// let date = new Date().toISOString().split('T')[0]
|
||||
let date = getCurrentDateFormatted()
|
||||
let option = {
|
||||
title: '创建模型库',
|
||||
// filename: 'YJEarth.model',
|
||||
@ -470,6 +472,13 @@ const createModelDB = async () => {
|
||||
}
|
||||
})
|
||||
}
|
||||
function getCurrentDateFormatted() {
|
||||
const now = new Date()
|
||||
const year = now.getFullYear()
|
||||
const month = String(now.getMonth() + 1).padStart(2, '0')
|
||||
const day = String(now.getDate()).padStart(2, '0')
|
||||
return `${year}${month}${day}`
|
||||
}
|
||||
|
||||
//导入模型库
|
||||
const importModelDB = () => {
|
||||
@ -838,16 +847,15 @@ const handleEdit = (row: ModelItem) => {
|
||||
updatePoster(row)
|
||||
}
|
||||
const updatePoster1 = (row, flag = false, path = '') => {
|
||||
let cb = (c) => {
|
||||
const formData = new FormData()
|
||||
formData.append('modelId', row.id)
|
||||
formData.append('file', c)
|
||||
ModelApi.updatePoster(formData).then((res) => {
|
||||
if (res.code == 0 || res.code == 200) {
|
||||
getModelListByType(row.modelTypeId)
|
||||
ElMessage.success('添加成功')
|
||||
}
|
||||
})
|
||||
let cb = async (c) => {
|
||||
try {
|
||||
const formData = new FormData()
|
||||
formData.append('modelId', row.id)
|
||||
formData.append('file', c)
|
||||
let res = await ModelApi.updatePoster(formData)
|
||||
getModelListByType(row.modelTypeId)
|
||||
ElMessage.success('更换成功')
|
||||
} catch (error) {}
|
||||
}
|
||||
if (!flag) {
|
||||
let option = {
|
||||
@ -872,16 +880,16 @@ const updatePoster1 = (row, flag = false, path = '') => {
|
||||
|
||||
const updatePoster = (row, flag = false, path = '') => {
|
||||
let that = this
|
||||
let cb = (c) => {
|
||||
const formData = new FormData()
|
||||
formData.append('modelId', row.id)
|
||||
formData.append('file', c)
|
||||
ModelApi.updatePoster(formData).then((res) => {
|
||||
if (res.code == 0 || res.code == 200) {
|
||||
getModelListByType(row.modelTypeId)
|
||||
ElMessage.success('添加成功')
|
||||
}
|
||||
})
|
||||
let cb = async (c) => {
|
||||
try {
|
||||
const formData = new FormData()
|
||||
formData.append('modelId', row.id)
|
||||
formData.append('file', c)
|
||||
let res = await ModelApi.updatePoster(formData)
|
||||
|
||||
getModelListByType(row.modelTypeId)
|
||||
ElMessage.success('更换成功')
|
||||
} catch (error) {}
|
||||
}
|
||||
if (!flag) {
|
||||
let option = {
|
||||
@ -945,26 +953,25 @@ const handleDelete = (row: ModelItem) => {
|
||||
type: 'warning'
|
||||
}
|
||||
)
|
||||
.then(() => {
|
||||
let formData = new FormData()
|
||||
formData.append('modelId', row.id)
|
||||
ModelApi.delModel(formData).then((res) => {
|
||||
if (res.code == 0 || res.code == 200) {
|
||||
// @ts-ignore
|
||||
getModelListByType(row.modelTypeId)
|
||||
ElMessage.success('删除成功')
|
||||
.then(async () => {
|
||||
try {
|
||||
let formData = new FormData()
|
||||
formData.append('modelId', row.id)
|
||||
let res = await ModelApi.delModel(formData)
|
||||
// @ts-ignore
|
||||
getModelListByType(row.modelTypeId)
|
||||
ElMessage.success('删除成功')
|
||||
|
||||
if (res.data?.length) {
|
||||
//删除对应的树数据和地图数据
|
||||
res.data.forEach((item) => {
|
||||
let node = window.treeObj.getNodeByParam('id', item, null)
|
||||
let source_ids = cusRemoveNode(window.treeObj, [node])
|
||||
;(window as any).earth.entityMap.get(source_ids[0]).remove()
|
||||
;(window as any)._entityMap.delete(item)
|
||||
})
|
||||
}
|
||||
if (res.data?.length) {
|
||||
//删除对应的树数据和地图数据
|
||||
res.data.forEach((item) => {
|
||||
let node = window.treeObj.getNodeByParam('id', item, null)
|
||||
let source_ids = cusRemoveNode(window.treeObj, [node])
|
||||
;(window as any).earth.entityMap.get(source_ids[0]).remove()
|
||||
;(window as any)._entityMap.delete(item)
|
||||
})
|
||||
}
|
||||
})
|
||||
} catch (error) {}
|
||||
})
|
||||
.catch(() => {})
|
||||
}
|
||||
|
||||
@ -292,6 +292,7 @@ watch(photoName, (val) => {
|
||||
// treeRef.value!.filter(val)
|
||||
// }
|
||||
getModelList()
|
||||
modelList.value = []
|
||||
currModelList.value = []
|
||||
})
|
||||
const filterNode: any = (value, data) => {
|
||||
@ -483,7 +484,8 @@ const handleFileChange = (e: Event) => {
|
||||
}
|
||||
//创建模型库
|
||||
const createModelDB = async () => {
|
||||
let date = new Date().toISOString().split('T')[0]
|
||||
// let date = new Date().toISOString().split('T')[0]
|
||||
let date = getCurrentDateFormatted()
|
||||
let option = {
|
||||
title: '创建图标库',
|
||||
// filename: 'YJEarth.tubiao',
|
||||
@ -505,6 +507,13 @@ const createModelDB = async () => {
|
||||
}
|
||||
})
|
||||
}
|
||||
function getCurrentDateFormatted() {
|
||||
const now = new Date()
|
||||
const year = now.getFullYear()
|
||||
const month = String(now.getMonth() + 1).padStart(2, '0')
|
||||
const day = String(now.getDate()).padStart(2, '0')
|
||||
return `${year}${month}${day}`
|
||||
}
|
||||
|
||||
//导入模型库
|
||||
const importModelDB = () => {
|
||||
@ -970,15 +979,15 @@ const handleDelete = (row: any) => {
|
||||
type: 'warning'
|
||||
}
|
||||
)
|
||||
.then(() => {
|
||||
let formData = new FormData()
|
||||
formData.append('iconId', row.id)
|
||||
PhotoApi.delModel(formData).then((res) => {
|
||||
if (res.code == 0 || res.code == 200) {
|
||||
getModelListByType(row.iconTypeId)
|
||||
ElMessage.success('删除成功')
|
||||
}
|
||||
})
|
||||
.then(async () => {
|
||||
try {
|
||||
let formData = new FormData()
|
||||
formData.append('iconId', row.id)
|
||||
let res = await PhotoApi.delModel(formData)
|
||||
|
||||
getModelListByType(row.iconTypeId)
|
||||
ElMessage.success('删除成功')
|
||||
} catch (error) {}
|
||||
})
|
||||
.catch(() => {})
|
||||
}
|
||||
|
||||
@ -782,7 +782,7 @@ onMounted(() => {
|
||||
.detailSkin {
|
||||
width: 50%;
|
||||
display: flex;
|
||||
align-items: left;
|
||||
align-items: center;
|
||||
box-sizing: border-box;
|
||||
flex-direction: row;
|
||||
padding-bottom: 15px;
|
||||
|
||||
@ -168,10 +168,37 @@ eventBus.on('contourDialog', () => {
|
||||
})
|
||||
const open = () => {
|
||||
baseDialog.value?.open()
|
||||
setVal()
|
||||
setTimeout(() => {
|
||||
YJ.Global.Contour(window.earth)
|
||||
})
|
||||
}
|
||||
const setVal = () => {
|
||||
//设置初始值
|
||||
let material = window.earth.viewer.scene.globe.material
|
||||
if (!material) {
|
||||
return
|
||||
}
|
||||
|
||||
let val = {
|
||||
secondaryLinesCount: material.uniforms.secondaryLinesCount,
|
||||
equalHeightDistance: material.uniforms.spacing / 5,
|
||||
activeColor: material.uniforms.activeColor,
|
||||
indexContourShow: material.uniforms.indexContourShow,
|
||||
indexContourWidth: material.uniforms.indexContourWidth,
|
||||
indexContourColor: material.uniforms.indexContourColor,
|
||||
intermediateContourShow: material.uniforms.intermediateContourShow,
|
||||
intermediateContourWidth: material.uniforms.intermediateContourWidth,
|
||||
intermediateContourColor: material.uniforms.intermediateContourColor,
|
||||
halfIntervalContourShow: material.uniforms.halfIntervalContourShow,
|
||||
halfIntervalContourWidth: material.uniforms.halfIntervalContourWidth,
|
||||
halfIntervalContourColor: material.uniforms.halfIntervalContourColor,
|
||||
supplementaryContourShow: material.uniforms.supplementaryContourShow,
|
||||
supplementaryContourWidth: material.uniforms.supplementaryContourWidth,
|
||||
supplementaryContourColor: material.uniforms.supplementaryContourColor
|
||||
}
|
||||
YJ.Global.ContourSetVal(val)
|
||||
}
|
||||
const closeCallBack = (e) => {
|
||||
YJ.Global.ContourReset()
|
||||
show.value = true
|
||||
@ -190,8 +217,7 @@ const sure = (e) => {
|
||||
message: value,
|
||||
type: 'error'
|
||||
})
|
||||
}
|
||||
else {
|
||||
} else {
|
||||
baseDialog.value?.close()
|
||||
}
|
||||
}
|
||||
|
||||
@ -489,8 +489,17 @@ const flyto = async (e) => {
|
||||
})
|
||||
return
|
||||
}
|
||||
if (window.earthPlaceMap === undefined) {
|
||||
window.earthPlaceMap = new Map()
|
||||
}
|
||||
if (window.earthPlaceMap.size) {
|
||||
window.earthPlaceMap.forEach((item) => {
|
||||
item.remove()
|
||||
})
|
||||
window.earthPlaceMap.clear()
|
||||
}
|
||||
new YJ.Global.flyTo(window.earth, {
|
||||
position: { lng: pointPosi.lng, lat: pointPosi.lat, alt: pointPosi.alt + 100 }
|
||||
position: { lng: pointPosi.lng, lat: pointPosi.lat, alt: pointPosi.alt + 300 }
|
||||
})
|
||||
let name = '点标注'
|
||||
let params = {
|
||||
@ -574,4 +583,7 @@ defineExpose({
|
||||
line-height: 0px;
|
||||
text-shadow: 0px 0px 9px rgb(20, 118, 255);
|
||||
}
|
||||
::v-deep .content input[type='number'] {
|
||||
font-size: 15px !important;
|
||||
}
|
||||
</style>
|
||||
|
||||
@ -135,7 +135,7 @@
|
||||
</div>
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="col" style="flex: 0 0 300px">
|
||||
<div class="col" style="flex: 0 0 350px">
|
||||
<!-- <input
|
||||
type="checkbox"
|
||||
name="isTotalTime"
|
||||
|
||||
@ -300,6 +300,7 @@ const open = () => {
|
||||
|
||||
const closeCallBack = (e) => {
|
||||
status1.value = false
|
||||
tools.projConvert(status1.value, () => {})
|
||||
}
|
||||
onBeforeUnmount(() => {
|
||||
closeCallBack('')
|
||||
|
||||
@ -6,6 +6,7 @@
|
||||
style="z-index: 1000"
|
||||
left="calc(50% - 160px)"
|
||||
top="calc(50% - 120px)"
|
||||
width="350px"
|
||||
>
|
||||
<template #content>
|
||||
<el-form label-width="100px" :model="addForm" :rules="peopleRules" ref="peopleFormRef">
|
||||
@ -51,16 +52,16 @@
|
||||
</template>
|
||||
|
||||
<script setup lang="ts">
|
||||
import {ref} from 'vue'
|
||||
import {inject} from 'vue'
|
||||
import {TreeApi} from '@/api/tree'
|
||||
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'
|
||||
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 { cusAddNodes } = useTreeNode()
|
||||
|
||||
const baseDialog: any = ref(null)
|
||||
const eventBus: any = inject('bus')
|
||||
@ -79,10 +80,28 @@ var addForm: any = ref({
|
||||
})
|
||||
|
||||
const peopleRules: any = reactive({
|
||||
cameraName: [{required: true, message: '请输入名称', trigger: 'blur'}],
|
||||
ip: [{required: true, message: '请输入ip', trigger: 'blur'}],
|
||||
cameraName: [{ required: true, message: '请输入名称', trigger: 'blur' }],
|
||||
ip: [
|
||||
{ required: true, message: '请输入ip', trigger: 'blur' },
|
||||
{
|
||||
validator: (rule, value, callback) => {
|
||||
const ipPattern = /^(\d{1,3}\.){3}\d{1,3}$/
|
||||
if (!ipPattern.test(value)) {
|
||||
callback(new Error('请输入有效的IP地址'))
|
||||
} else {
|
||||
const parts = value.split('.').map(Number)
|
||||
if (parts.some((part) => part < 0 || part > 255)) {
|
||||
callback(new Error('IP地址段必须在0-255之间'))
|
||||
} else {
|
||||
callback()
|
||||
}
|
||||
}
|
||||
},
|
||||
trigger: 'blur'
|
||||
}
|
||||
],
|
||||
port: [
|
||||
{required: true, message: '请输入设备端口号', trigger: 'blur'},
|
||||
{ required: true, message: '请输入设备端口号', trigger: 'blur' },
|
||||
{
|
||||
validator: (rule, value, callback) => {
|
||||
if (!value) {
|
||||
@ -111,10 +130,10 @@ const peopleRules: any = reactive({
|
||||
trigger: 'blur'
|
||||
}
|
||||
],
|
||||
username: [{required: true, message: '请输入用户名', trigger: 'blur'}],
|
||||
password: [{required: true, message: '请输入密码', trigger: 'blur'}],
|
||||
type: [{required: true, message: '请选择设备类型', trigger: 'blur'}],
|
||||
channel: [{required: true, message: '请输入通道号', trigger: 'blur'}]
|
||||
username: [{ required: true, message: '请输入用户名', trigger: 'blur' }],
|
||||
password: [{ required: true, message: '请输入密码', trigger: 'blur' }],
|
||||
type: [{ required: true, message: '请选择设备类型', trigger: 'blur' }],
|
||||
channel: [{ required: true, message: '请输入通道号', trigger: 'blur' }]
|
||||
})
|
||||
|
||||
var cancel = () => {
|
||||
|
||||
@ -219,9 +219,12 @@ let observer: IntersectionObserver | null = null
|
||||
|
||||
const treeRef: any = ref('')
|
||||
watch(modelName, (val) => {
|
||||
if (treeRef.value && treeRef.value !== '') {
|
||||
treeRef.value!.filter(val)
|
||||
}
|
||||
// if (treeRef.value && treeRef.value !== '') {
|
||||
// treeRef.value!.filter(val)
|
||||
// }
|
||||
categories.value = []
|
||||
currModelList.value = []
|
||||
getModelList()
|
||||
})
|
||||
|
||||
watch(isShowPup, (val) => {
|
||||
@ -443,6 +446,7 @@ const renderModel = async (model) => {
|
||||
const getModelListByType = (id) => {
|
||||
let formData = new FormData()
|
||||
formData.append('militaryTypeId', id)
|
||||
formData.append('name', modelName.value)
|
||||
GraphApi.showModelByType(formData).then((res) => {
|
||||
categories.value = res.data
|
||||
|
||||
@ -453,7 +457,9 @@ const getModelListByType = (id) => {
|
||||
}
|
||||
|
||||
const getModelList = async () => {
|
||||
const res: any = await GraphApi.modelTypeList()
|
||||
const params = new URLSearchParams()
|
||||
params.append('militaryName', modelName.value)
|
||||
const res: any = await GraphApi.modelTypeList(params)
|
||||
if (res.code == 0 || res.code == 200) {
|
||||
let data = transformNestedJson(res.data, 'name', 'label')
|
||||
typeTreeData.value = data
|
||||
|
||||
@ -315,6 +315,7 @@ watch(modelName, (val) => {
|
||||
// treeRef.value!.filter(val)
|
||||
// }
|
||||
categories.value = []
|
||||
currModelList.value = []
|
||||
getModelList()
|
||||
})
|
||||
|
||||
|
||||
@ -98,7 +98,19 @@ var addForm: any = ref({
|
||||
})
|
||||
|
||||
const peopleRules: any = reactive({
|
||||
distance: [{ required: true, message: '请输入间距', trigger: 'blur' }]
|
||||
distance: [
|
||||
{ required: true, message: '请输入间距', trigger: 'blur' },
|
||||
{
|
||||
validator: (rule, value, callback) => {
|
||||
if (value < 0 || value === 0) {
|
||||
callback(new Error('间距需大于0'))
|
||||
} else {
|
||||
callback()
|
||||
}
|
||||
},
|
||||
trigger: 'blur'
|
||||
}
|
||||
]
|
||||
})
|
||||
|
||||
var type: any = ref('point')
|
||||
|
||||
@ -136,6 +136,7 @@ import { getdefaultStyle } from '../components/propertyBox/defaultStyle/style'
|
||||
import { getdefaultLabelStyle } from '../components/propertyBox/defaultLabelStyle/style'
|
||||
|
||||
import { setEventBus } from './eventBus'
|
||||
import router from '@renderer/router'
|
||||
|
||||
const { rightMenus } = useRightOperate()
|
||||
const firstMenuRef = ref(null)
|
||||
@ -150,7 +151,6 @@ let editdirectoryBox = ref()
|
||||
|
||||
setEventBus(eventBus)
|
||||
|
||||
|
||||
// 标注标绘默认样式
|
||||
if (!localStorage.getItem('defaultStyle')) {
|
||||
let defaultStyle = getdefaultStyle(null)
|
||||
@ -474,7 +474,7 @@ eventBus.on('destroyComponent', (id) => {
|
||||
}
|
||||
})
|
||||
|
||||
utilsSysChange(eventBus)
|
||||
utilsSysChange(eventBus, 'first')
|
||||
|
||||
const createEarth = async () => {
|
||||
window.earth = await new YJ.YJEarth('earthContainer')
|
||||
@ -552,7 +552,10 @@ const uploadFile = (event) => {
|
||||
}
|
||||
const getAuthInfo = async () => {
|
||||
const res = await AuthApi.showAuth()
|
||||
if (typeof res.data === 'object') {
|
||||
if (res.message == '未找到授权文件') {
|
||||
router.push('/')
|
||||
localStorage.removeItem('Authorization')
|
||||
} else if (typeof res.data === 'object') {
|
||||
let time = res.data.expireTime
|
||||
getStatus(time)
|
||||
}
|
||||
|
||||
@ -40,28 +40,57 @@
|
||||
</svg>
|
||||
</el-button>
|
||||
<el-button class="exit" size="small" @click="goExit">
|
||||
<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" width="40" height="40"
|
||||
viewBox="-8 -8 40 40" fill="none">
|
||||
<svg
|
||||
xmlns="http://www.w3.org/2000/svg"
|
||||
xmlns:xlink="http://www.w3.org/1999/xlink"
|
||||
width="40"
|
||||
height="40"
|
||||
viewBox="-8 -8 40 40"
|
||||
fill="none"
|
||||
>
|
||||
<g xmlns="http://www.w3.org/2000/svg">
|
||||
<path xmlns="http://www.w3.org/2000/svg"
|
||||
<path
|
||||
xmlns="http://www.w3.org/2000/svg"
|
||||
d="M15.8747 5.23095L16.8448 3.27277C16.9578 3.32908 17.0698 3.38736 17.1809 3.44758C17.2919 3.5078 17.4018 3.56992 17.5107 3.63395C17.6195 3.69799 17.7273 3.76389 17.8338 3.83167C17.9404 3.89944 18.0458 3.96904 18.15 4.04046C18.2541 4.1119 18.357 4.18512 18.4587 4.26012C18.5603 4.33512 18.6606 4.41186 18.7596 4.49034C18.8586 4.56881 18.9561 4.64899 19.0523 4.73086C19.1485 4.81273 19.2433 4.89624 19.3366 4.9814C19.4299 5.06657 19.5217 5.15332 19.612 5.24167C19.7023 5.33 19.791 5.41988 19.8782 5.51131C19.9654 5.60273 20.051 5.69563 20.1349 5.79003C20.2189 5.88443 20.3012 5.98026 20.3818 6.0775C20.4625 6.17474 20.5414 6.27335 20.6186 6.37335C20.6958 6.47335 20.7713 6.57465 20.8451 6.67726C20.9188 6.77986 20.9907 6.88372 21.0608 6.98884C21.1309 7.09395 21.1992 7.20024 21.2656 7.3077C21.3321 7.41516 21.3966 7.52375 21.4593 7.63347C21.522 7.74318 21.5827 7.85397 21.6415 7.96578C21.7004 8.07759 21.7573 8.1904 21.8122 8.3042C21.8671 8.41801 21.9201 8.53274 21.971 8.64836C22.0219 8.764 22.0709 8.88049 22.1178 8.99783C22.1647 9.11516 22.2096 9.23326 22.2524 9.35215C22.2952 9.47105 22.336 9.59066 22.3747 9.71096C22.4133 9.83126 22.4499 9.9522 22.4844 10.0738C22.5189 10.1954 22.5513 10.3175 22.5815 10.4402C22.6118 10.5629 22.6399 10.6861 22.6659 10.8097C22.6919 10.9334 22.7157 11.0575 22.7374 11.182C22.7591 11.3065 22.7786 11.4313 22.796 11.5565C22.8134 11.6817 22.8285 11.8071 22.8416 11.9329C22.8546 12.0586 22.8654 12.1845 22.8741 12.3105C22.8827 12.4366 22.8892 12.5628 22.8935 12.6891C22.8977 12.8154 22.8998 12.9418 22.8998 13.0681C22.8998 19.1053 18.0198 24.0002 11.9997 24.0002C5.97958 24.0002 1.09961 19.1053 1.09961 13.0681C1.09961 8.87354 3.47583 5.10551 7.15461 3.27277L8.12471 5.23095C8.03425 5.27602 7.9446 5.32264 7.8558 5.37081C7.76695 5.41898 7.67899 5.46868 7.59188 5.5199C7.50476 5.57114 7.41857 5.62386 7.33329 5.67807C7.24799 5.73229 7.16366 5.78797 7.08032 5.84511C6.99696 5.90225 6.91462 5.96083 6.83331 6.02084C6.75197 6.08085 6.67172 6.14224 6.59253 6.20503C6.51333 6.26781 6.43523 6.33196 6.35826 6.39746C6.28129 6.46294 6.20546 6.52975 6.13082 6.59789C6.05617 6.66603 5.98269 6.73543 5.91045 6.80612C5.8382 6.87679 5.76718 6.94869 5.69744 7.02184C5.62767 7.095 5.5592 7.16935 5.49201 7.24485C5.42482 7.32038 5.35896 7.39704 5.29443 7.47484C5.2299 7.55265 5.16672 7.63155 5.10495 7.71155C5.04313 7.79156 4.98273 7.87261 4.92377 7.95471C4.86478 8.03681 4.80722 8.11991 4.75112 8.204C4.69502 8.2881 4.64038 8.37314 4.58724 8.45912C4.53405 8.54511 4.48239 8.63199 4.43227 8.71977C4.3821 8.80755 4.33348 8.89619 4.28642 8.98566C4.23934 9.07512 4.19381 9.16538 4.14987 9.25643C4.10591 9.34748 4.06355 9.43927 4.0228 9.5318C3.98203 9.62433 3.94287 9.71753 3.90534 9.81139C3.86778 9.90528 3.83186 9.99978 3.79761 10.0949C3.76332 10.19 3.73072 10.2857 3.69979 10.382C3.66882 10.4782 3.63956 10.575 3.61197 10.6723C3.58436 10.7695 3.55846 10.8673 3.53426 10.9654C3.51004 11.0636 3.48753 11.1622 3.46674 11.2611C3.44594 11.3601 3.42687 11.4594 3.40951 11.559C3.39216 11.6586 3.37653 11.7585 3.36263 11.8587C3.34875 11.9588 3.3366 12.0592 3.32618 12.1598C3.31577 12.2603 3.3071 12.3611 3.30017 12.4619C3.29324 12.5628 3.28806 12.6638 3.28464 12.7649C3.28122 12.866 3.27955 12.967 3.27963 13.0681C3.27963 17.8987 7.18404 21.814 11.9997 21.814C16.8153 21.814 20.7197 17.8976 20.7197 13.0681C20.7198 12.967 20.7181 12.866 20.7147 12.7649C20.7113 12.6638 20.7061 12.5628 20.6992 12.4619C20.6922 12.3611 20.6836 12.2603 20.6732 12.1598C20.6628 12.0592 20.6506 11.9588 20.6367 11.8587C20.6228 11.7585 20.6072 11.6586 20.5898 11.559C20.5725 11.4594 20.5534 11.3601 20.5326 11.2611C20.5118 11.1622 20.4893 11.0636 20.4651 10.9654C20.4409 10.8673 20.415 10.7696 20.3874 10.6723C20.3598 10.575 20.3305 10.4782 20.2996 10.382C20.2686 10.2857 20.236 10.19 20.2018 10.0949C20.1675 9.99978 20.1316 9.90528 20.0941 9.81139C20.0565 9.71753 20.0173 9.62433 19.9766 9.5318C19.9358 9.43927 19.8934 9.34748 19.8495 9.25643C19.8056 9.16538 19.76 9.07512 19.7129 8.98566C19.6659 8.89619 19.6172 8.80755 19.5671 8.71977C19.5169 8.63199 19.4653 8.54511 19.4122 8.45912C19.359 8.37314 19.3043 8.2881 19.2482 8.204C19.1921 8.11991 19.1346 8.03681 19.0756 7.95471C19.0166 7.87261 18.9562 7.79156 18.8944 7.71155C18.8326 7.63155 18.7695 7.55265 18.7049 7.47484C18.6404 7.39704 18.5745 7.32038 18.5074 7.24485C18.4402 7.16935 18.3717 7.095 18.302 7.02184C18.2322 6.94869 18.1612 6.87679 18.0889 6.80612C18.0167 6.73543 17.9432 6.66603 17.8686 6.59789C17.7939 6.52975 17.7181 6.46294 17.6411 6.39746C17.5641 6.33196 17.486 6.26781 17.4068 6.20503C17.3276 6.14224 17.2474 6.08085 17.1661 6.02084C17.0847 5.96083 17.0024 5.90225 16.919 5.84511C16.8357 5.78797 16.7514 5.73229 16.6661 5.67807C16.5808 5.62386 16.4946 5.57114 16.4075 5.5199C16.3204 5.46868 16.2324 5.41898 16.1436 5.37081C16.0547 5.32264 15.9651 5.27602 15.8747 5.23095Z"
|
||||
fill="#FFFFFF" />
|
||||
<path xmlns="http://www.w3.org/2000/svg" d="M10.9102 0L13.0902 0L13.0902 8.72736L10.9102 8.72736L10.9102 0Z"
|
||||
fill="#FFFFFF" />
|
||||
fill="#FFFFFF"
|
||||
/>
|
||||
<path
|
||||
xmlns="http://www.w3.org/2000/svg"
|
||||
d="M10.9102 0L13.0902 0L13.0902 8.72736L10.9102 8.72736L10.9102 0Z"
|
||||
fill="#FFFFFF"
|
||||
/>
|
||||
</g>
|
||||
<defs>
|
||||
<filter id="filter_2442_480" x="-10" y="-10" width="52.000244" height="53.800659"
|
||||
filterUnits="userSpaceOnUse" color-interpolation-filters="sRGB">
|
||||
<filter
|
||||
id="filter_2442_480"
|
||||
x="-10"
|
||||
y="-10"
|
||||
width="52.000244"
|
||||
height="53.800659"
|
||||
filterUnits="userSpaceOnUse"
|
||||
color-interpolation-filters="sRGB"
|
||||
>
|
||||
<feFlood flood-opacity="0" result="feFloodId_2442_480" />
|
||||
<feColorMatrix in="SourceAlpha" type="matrix" values="0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 127 0"
|
||||
result="hardAlpha_2442_480" />
|
||||
<feColorMatrix
|
||||
in="SourceAlpha"
|
||||
type="matrix"
|
||||
values="0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 127 0"
|
||||
result="hardAlpha_2442_480"
|
||||
/>
|
||||
<feOffset dx="0" dy="0" />
|
||||
<feGaussianBlur stdDeviation="4.5" />
|
||||
<feComposite in2="hardAlpha_2442_480" operator="out" />
|
||||
<feColorMatrix type="matrix"
|
||||
values="0 0 0 0 0.0784313725490196 0 0 0 0 0.4627450980392157 0 0 0 0 1 0 0 0 1 0" />
|
||||
<feColorMatrix
|
||||
type="matrix"
|
||||
values="0 0 0 0 0.0784313725490196 0 0 0 0 0.4627450980392157 0 0 0 0 1 0 0 0 1 0"
|
||||
/>
|
||||
<feBlend mode="normal" in2="feFloodId_2442_480" result="dropShadow_1_2442_480" />
|
||||
<feBlend mode="normal" in="SourceGraphic" in2="dropShadow_1_2442_480" result="shape_2442_480" />
|
||||
<feBlend
|
||||
mode="normal"
|
||||
in="SourceGraphic"
|
||||
in2="dropShadow_1_2442_480"
|
||||
result="shape_2442_480"
|
||||
/>
|
||||
</filter>
|
||||
</defs>
|
||||
</svg>
|
||||
@ -265,7 +294,14 @@
|
||||
</div>
|
||||
</template>
|
||||
<template #footer>
|
||||
<uploadFiles accept=".YJ" :maxSize="1"></uploadFiles>
|
||||
<!-- <uploadFiles accept=".YJ" :maxSize="1"></uploadFiles> -->
|
||||
<el-button
|
||||
@click="importAuth"
|
||||
color="#004b4b"
|
||||
style="border: 1px solid rgba(var(--color-base1), 0.5)"
|
||||
>
|
||||
<span>{{ t('auths.upload') }}</span>
|
||||
</el-button>
|
||||
<button @click="close">退出系统</button>
|
||||
</template>
|
||||
</Dialog>
|
||||
@ -284,7 +320,7 @@ import { ipcMain } from 'electron'
|
||||
import { AuthApi } from '@/api/setting/auth'
|
||||
import Dialog from '@/components/dialog/baseDialog.vue'
|
||||
import { ElMessage, ElMessageBox } from 'element-plus'
|
||||
import { $sendElectronChanel } from '@/utils/communication'
|
||||
import { $sendElectronChanel, $recvElectronChanel } from '@/utils/communication'
|
||||
|
||||
const {
|
||||
loginFormRef,
|
||||
@ -530,6 +566,25 @@ const getAuthCode = async () => {
|
||||
const res = await AuthApi.authInfo()
|
||||
authInfo.value.license_code = res.data
|
||||
}
|
||||
|
||||
function importAuth() {
|
||||
// importWin = true
|
||||
let option = {
|
||||
properties: ['openFile'],
|
||||
filters: [{ name: '授权文件', extensions: ['YJ'] }]
|
||||
}
|
||||
$sendElectronChanel('open-directory-dialog', option)
|
||||
$recvElectronChanel('selectedItem', (e, paths) => {
|
||||
let formdata = new FormData()
|
||||
formdata.append('filePath', paths[0])
|
||||
try {
|
||||
let res = AuthApi.authImport(formdata)
|
||||
ElMessage.success('文件授权成功')
|
||||
isAuth.value = false
|
||||
baseDialog.value?.close()
|
||||
} catch (error) {}
|
||||
})
|
||||
}
|
||||
// setTimeout(() => {
|
||||
// getAuthCode()
|
||||
// }, 8000)
|
||||
|
||||
Reference in New Issue
Block a user