系统坐标、坐标格式、设备管理

This commit is contained in:
2025-10-15 11:11:47 +08:00
parent 6dceeca500
commit 175335bedb
13 changed files with 594 additions and 71 deletions

View File

@ -20,6 +20,7 @@ declare module 'vue' {
ElDialog: typeof import('element-plus/es')['ElDialog'] ElDialog: typeof import('element-plus/es')['ElDialog']
ElForm: typeof import('element-plus/es')['ElForm'] ElForm: typeof import('element-plus/es')['ElForm']
ElFormItem: typeof import('element-plus/es')['ElFormItem'] ElFormItem: typeof import('element-plus/es')['ElFormItem']
ElIcon: typeof import('element-plus/es')['ElIcon']
ElImage: typeof import('element-plus/es')['ElImage'] ElImage: typeof import('element-plus/es')['ElImage']
ElInput: typeof import('element-plus/es')['ElInput'] ElInput: typeof import('element-plus/es')['ElInput']
ElOption: typeof import('element-plus/es')['ElOption'] ElOption: typeof import('element-plus/es')['ElOption']

View 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,
})
},
}

View 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

View 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

File diff suppressed because one or more lines are too long

After

Width:  |  Height:  |  Size: 18 KiB

View 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

View File

@ -63,7 +63,8 @@ if (!localStorage.getItem("AMapKey")) {
sheetIndexStatusSwitch: false, //标准图幅 sheetIndexStatusSwitch: false, //标准图幅
skinInfo: 'yingguangse', //主题色 skinInfo: 'yingguangse', //主题色
language: 'zh', //语言 language: 'zh', //语言
coordinate: 'EPSG:4326' //坐标系 coordinate: 'EPSG:4326', //坐标系
positionType: '度'
}) })
) )
: console.log("没有设置系统设置"); : console.log("没有设置系统设置");

View File

@ -1,7 +1,11 @@
<template> <template>
<div class="equipment"> <div class="equipment">
<div class="equipment_title"> <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> <template #icon>
<svg-icon name="leading_in" /> <svg-icon name="leading_in" />
</template> </template>
@ -9,40 +13,47 @@
</el-button> </el-button>
<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)">
<template #icon> <template #icon>
<svg-icon name="leading_in" /> <svg-icon name="loadTemp" />
</template> </template>
<span>批量导入</span> <span>下载模板</span>
</el-button> </el-button>
<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)">
<template #icon> <template #icon>
<svg-icon name="leading_in" /> <svg-icon name="pitchImport" />
</template> </template>
<span>批量模版</span> <span>批量导入</span>
</el-button> </el-button>
<el-input <el-input
v-model="input3" v-model="input3"
style="max-width: 250px" style="max-width: 250px"
placeholder="Please input" placeholder="请输入设备名称进行搜索"
class="input-with-select" class="input-with-select"
:suffix-icon="Search"
> >
<template #append>
<el-button :icon="Search" color="#004b4b" />
</template>
</el-input> </el-input>
</div> </div>
<div class="nav_table"> <div class="nav_table">
<el-table :data="tableData" style="width: 100%"> <el-table :data="tableData" height="40vh" style="width: 100%">
<el-table-column fixed prop="date" label="Date" width="150" /> <el-table-column fixed prop="cameraName" label="设备名称" width="150" />
<el-table-column prop="name" label="Name" width="120" /> <el-table-column prop="deviceType" label="设备类型" width="120">
<el-table-column prop="state" label="State" width="120" /> <template #default="scope">
<el-table-column prop="city" label="City" width="120" /> <span class="deviceType"></span>
<el-table-column prop="address" label="Address" width="600" /> {{ statusTrans(scope.row.type) }}
<el-table-column prop="zip" label="Zip" width="120" /> </template>
<el-table-column fixed="right" label="Operations" min-width="120"> </el-table-column>
<template #default> <el-table-column prop="ip" label="设备IP" width="120" />
<el-button link type="primary" size="small"> Detail </el-button> <el-table-column prop="port" label="设备端口" width="120" />
<el-button link type="primary" size="small">Edit</el-button> <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> </template>
</el-table-column> </el-table-column>
</el-table> </el-table>
@ -50,7 +61,7 @@
<div> <div>
<Pagination <Pagination
:total="total" :total="total"
v-model:page="pages.pageNo" v-model:page="pages.pageNum"
v-model:limit="pages.pageSize" v-model:limit="pages.pageSize"
@pagination="getTableList" @pagination="getTableList"
/> />
@ -60,33 +71,164 @@
<script setup lang="ts"> <script setup lang="ts">
import { Search } from '@element-plus/icons-vue' 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 input3 = ref('')
const tableData: any = ref([]) const tableData: any = ref([])
const total = ref(100) const total = ref(100)
// 页码 // 页码
let pages: any = reactive({ let pages: any = reactive({
pageNo: 1, pageNum: 1,
pageSize: 10 pageSize: 10
}) })
// 使用循环生成10条数据 // 使用循环生成10条数据
for (let i = 0; i < 10; i++) { // for (let i = 0; i < 10; i++) {
tableData.value.push({ // tableData.value.push({
date: `2023-05-${i < 9 ? '0' + (i + 1) : i + 1}`, // cameraName: '123',
name: `用户${i + 1}`, // type: (i % 3) + '',
state: ['California', 'New York', 'Texas'][i % 3], // state: ['California', 'New York', 'Texas'][i % 3],
city: ['Los Angeles', 'New York', 'Houston'][i % 3], // city: ['Los Angeles', 'New York', 'Houston'][i % 3],
address: `No. ${i + 1}00, Main St`, // address: `No. ${i + 1}00, Main St`,
zip: ['CA 90036', 'NY 10001', 'TX 77002'][i % 3], // zip: ['CA 90036', 'NY 10001', 'TX 77002'][i % 3],
tag: ['Home', 'Work', 'Other'][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 = () => { var delFun = (row) => {
console.log(1111111) 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> </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"> <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 { .equipment {
width: 100%; width: 100%;
height: 100%; height: 100%;
@ -126,7 +268,7 @@ const getTableList = () => {
} }
.nav_table { .nav_table {
width: 100%; width: 100%;
height: 40vh; // height: 40vh;
// box-sizing: border-box; // box-sizing: border-box;
overflow-y: auto; /* 垂直方向超出时显示滚动条 */ overflow-y: auto; /* 垂直方向超出时显示滚动条 */
:deep(.el-table, .el-table__expanded-cell) { :deep(.el-table, .el-table__expanded-cell) {
@ -209,5 +351,37 @@ const getTableList = () => {
.nav_table::-webkit-scrollbar-track { .nav_table::-webkit-scrollbar-track {
background-color: rgba(0, 255, 255, 0.2); 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> </style>

View File

@ -48,7 +48,7 @@
<!-- 坐标系 --> <!-- 坐标系 -->
<div class="detailSkin"> <div class="detailSkin">
<span>{{ t('systemSetting.coordinateSystem') }}</span> <span>{{ t('systemSetting.coordinateSystem') }}</span>
<el-select <!-- <el-select
style="width: 175px" style="width: 175px"
v-model="systemSetting.coordinate" v-model="systemSetting.coordinate"
@change="sysChange" @change="sysChange"
@ -61,21 +61,81 @@
:value="item.epsg" :value="item.epsg"
> >
</el-option> </el-option>
</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> </el-select>
</div> </div>
<div class="detailSkin"> <div class="detailSkin" v-show="showPosiType">
<span>{{ t('systemSetting.latitude') }}</span> <span>{{ t('systemSetting.latitude') }}</span>
<el-select <el-select
style="width: 175px" style="width: 175px"
v-model="systemSetting.coordinate" v-model="systemSetting.positionType"
@change="sysChange" @change="sysChange"
placeholder="请选择" placeholder="请选择"
> >
<el-option <el-option
v-for="item in name_map" v-for="item in position_map"
:key="item.epsg" :key="item.value"
:label="item.name" :label="item.name"
:value="item.epsg" :value="item.value"
> >
</el-option> </el-option>
</el-select> </el-select>
@ -353,6 +413,10 @@ const { cusUpdateNode } = useTreeNode()
const { t } = useI18n() const { t } = useI18n()
const isHotGroupOpen: any = ref(false)
const isHotGroupOpen2: any = ref(false)
const showPosiType: any = ref(false)
const systemSetting = ref({ const systemSetting = ref({
showFangliNet: false, // 方里网 showFangliNet: false, // 方里网
showLatitudeLongitudeNetwork: false, //经纬网 showLatitudeLongitudeNetwork: false, //经纬网
@ -366,7 +430,8 @@ const systemSetting = ref({
sheetIndexStatusSwitch: false, //标准图幅 sheetIndexStatusSwitch: false, //标准图幅
skinInfo: 'yingguangse', //主题色 skinInfo: 'yingguangse', //主题色
language: '', //语言 language: '', //语言
coordinate: 'EPSG:4326' //坐标系 coordinate: 'EPSG:4326', //坐标系
positionType: '度'
}) })
const options = ref([ const options = ref([
{ id: 'zh', label: '中文简体' }, { id: 'zh', label: '中文简体' },
@ -403,6 +468,21 @@ const concurrentWorkloadList = ref([
} }
]) ])
const name_map: any = 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 searchWay = ref()
const concurrentcode = ref() const concurrentcode = ref()
const showBattery = ref() const showBattery = ref()
@ -411,6 +491,7 @@ concurrentcode.value = localStorage.getItem('concurrentcode') || 10
//系统坐标系 //系统坐标系
let tool = new YJ.Tools(window.earth) let tool = new YJ.Tools(window.earth)
name_map.value = Array.from(tool.name_map.values()) name_map.value = Array.from(tool.name_map.values())
name_map1.value = name_map.value.splice(0, 2)
const sysChange = async () => { const sysChange = async () => {
const obj = { const obj = {
@ -430,8 +511,15 @@ const sysChange = async () => {
//地形遮挡 //地形遮挡
YJ.Global.setGroundCover(window.earth, systemSetting.value.occlusion) 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' let coor = systemSetting.value.coordinate ? systemSetting.value.coordinate : 'EPSG:4326'
YJ.Global.setCoordinateSystem(window.earth, coor) YJ.Global.setCoordinateSystem(window.earth, coor)
//设置坐标格式
YJ.Global.setDMS(window.earth, systemSetting.value.positionType)
//比例尺 //比例尺
await YJ.Global.SheetIndexStatusSwitch(window.earth, systemSetting.value.sheetIndexStatusSwitch) await YJ.Global.SheetIndexStatusSwitch(window.earth, systemSetting.value.sheetIndexStatusSwitch)
@ -486,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 management = () => {}
const batteryChange = () => {} const batteryChange = () => {}
onMounted(() => { 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() // sysChange()
}) })
</script> </script>
@ -586,4 +687,17 @@ onMounted(() => {
margin-left: 5px; margin-left: 5px;
font-size: 0.8rem; 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> </style>

View File

@ -3,12 +3,15 @@
<div class="leftSideSecondBox"> <div class="leftSideSecondBox">
<template v-if="obj"> <template v-if="obj">
<div class="menuItem" v-for="value in obj.children" @click="handleClick(value)"> <div class="menuItem" v-for="value in obj.children" @click="handleClick(value)">
<img :src="'http://localhost:' + `${availablePort}` + '/icon/' + `${value}` + '.png'" <img
style="color: rgb(255, 0, 0)" alt="" /> :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> --> <!-- <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)' }">{{ <span :style="{ color: !clickChange[value] ? 'var(--color-text)' : 'rgb(255,0,0)' }">{{
t(`${obj.key}.${value}`) t(`${obj.key}.${value}`)
}}</span> }}</span>
</div> </div>
</template> </template>
</div> </div>
@ -86,8 +89,6 @@ const handleKeyDown = (e) => {
if (clickChange.videoRecord) { if (clickChange.videoRecord) {
methodMap['videoRecord']() methodMap['videoRecord']()
} }
console.log('全局ESC监听')
} }
} }
window.addEventListener('keydown', handleKeyDown) window.addEventListener('keydown', handleKeyDown)
@ -176,7 +177,6 @@ const methodMap = {
diffuseScan: () => { diffuseScan: () => {
let draw = new YJ.Draw.DrawCircle(window.earth) let draw = new YJ.Draw.DrawCircle(window.earth)
draw.start((err, options) => { draw.start((err, options) => {
console.log('options', options)
if (options) { if (options) {
let id = new YJ.Tools().randomString() let id = new YJ.Tools().randomString()
let name = '扩散光波' let name = '扩散光波'
@ -204,7 +204,6 @@ const methodMap = {
radarScan: () => { radarScan: () => {
let draw = new YJ.Draw.DrawCircle(window.earth) let draw = new YJ.Draw.DrawCircle(window.earth)
draw.start((err, options) => { draw.start((err, options) => {
console.log('options', options)
if (options) { if (options) {
let id = new YJ.Tools().randomString() let id = new YJ.Tools().randomString()
let name = '雷达光波' let name = '雷达光波'
@ -598,7 +597,7 @@ const methodMap = {
filters: [{ name: '保存图片', extensions: ['jpg'] }] filters: [{ name: '保存图片', extensions: ['jpg'] }]
}) })
$recvElectronChanel('selectedFileItem', (e, path) => { $recvElectronChanel('selectedFileItem', (e, path) => {
fs.writeFile(path, dataBuffer, (res) => { }) fs.writeFile(path, dataBuffer, (res) => {})
}) })
} }
@ -687,7 +686,6 @@ const methodMap = {
if (selectedNode) { if (selectedNode) {
let isTileset = ['bim', 'tileset'].includes(selectedNode.sourceType) let isTileset = ['bim', 'tileset'].includes(selectedNode.sourceType)
if (!isTileset) { if (!isTileset) {
console.log('aaaaaa')
ElMessage({ ElMessage({
message: '请在图层指挥舱选中对应模型进行操作', message: '请在图层指挥舱选中对应模型进行操作',
type: 'warning' type: 'warning'
@ -732,18 +730,17 @@ const methodMap = {
TreeApi.addOtherSource(paramsData) TreeApi.addOtherSource(paramsData)
paramsData.isShow = true paramsData.isShow = true
paramsData.params = JSON.stringify(paramsData.params) paramsData.params = JSON.stringify(paramsData.params)
; (window as any).pressModelMap.set(id + '_' + selectedNode.id, paramsData) ;(window as any).pressModelMap.set(id + '_' + selectedNode.id, paramsData)
; (window as any).pressModelEntities.set(id, flat) ;(window as any).pressModelEntities.set(id, flat)
cusAddNodes(window.treeObj, paramsData.parentId, [paramsData]) cusAddNodes(window.treeObj, paramsData.parentId, [paramsData])
// //鼠标右键点击事件 // //鼠标右键点击事件
flat.onRightClick = () => { } flat.onRightClick = () => {}
// _entityMap.set(node.source_id, flat) // _entityMap.set(node.source_id, flat)
} else { } else {
// this.$message.warning('至少三个点') // this.$message.warning('至少三个点')
} }
}) })
} else { } else {
console.log('bbbbb')
ElMessage({ ElMessage({
message: '请在图层指挥舱选中对应模型进行操作', message: '请在图层指挥舱选中对应模型进行操作',
type: 'warning' type: 'warning'
@ -864,8 +861,8 @@ const methodMap = {
DbOption.isShow = true DbOption.isShow = true
DbOption.params = JSON.stringify(DbOption.params) DbOption.params = JSON.stringify(DbOption.params)
cusAddNodes(window.treeObj, DbOption.parentId, [DbOption]) cusAddNodes(window.treeObj, DbOption.parentId, [DbOption])
let entityObject = renderVector(DbOption, true); let entityObject = renderVector(DbOption, true)
(window as any)._entityMap.set(id, entityObject) ;(window as any)._entityMap.set(id, entityObject)
// } // }
// }) // })
} }
@ -896,7 +893,6 @@ const methodMap = {
} }
const handleClick = (value = 'projectionDistanceMeasure') => { const handleClick = (value = 'projectionDistanceMeasure') => {
console.log('点击了', value)
methodMap[value]() methodMap[value]()
} }
defineExpose({ defineExpose({

View 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>

View File

@ -29,6 +29,7 @@ const open = () => {
baseDialog.value?.open() baseDialog.value?.open()
} }
const confirm = () => { const confirm = () => {
console.log('121212121', baseDialog.value)
baseDialog.value?.close() baseDialog.value?.close()
let name = text.value let name = text.value
text.value = '' text.value = ''
@ -38,11 +39,15 @@ const confirm = () => {
return return
} }
let id = new YJ.Tools().randomString() let id = new YJ.Tools().randomString()
let options: any = await initMapData('groundText', { let options: any = await initMapData(
id: id, 'groundText',
text: name, {
positions: positions id: id,
}, null) text: name,
positions: positions
},
null
)
delete options.host delete options.host
delete options.positions delete options.positions
let selectedNodes = window.treeObj.getSelectedNodes() let selectedNodes = window.treeObj.getSelectedNodes()
@ -51,8 +56,7 @@ const confirm = () => {
if (node) { if (node) {
if (node.sourceType === 'directory') { if (node.sourceType === 'directory') {
parentId = node.id parentId = node.id
} } else {
else {
parentId = node.parentId parentId = node.parentId
} }
} }

View File

@ -50,6 +50,7 @@
<modelSetting ref="modelsetting"></modelSetting> <modelSetting ref="modelsetting"></modelSetting>
<modelObject ref="modelobject"></modelObject> <modelObject ref="modelobject"></modelObject>
<graphObject ref="graphobject"></graphObject> <graphObject ref="graphobject"></graphObject>
<addDevice ref="adddevice"></addDevice>
</template> </template>
<script setup lang="ts"> <script setup lang="ts">
@ -125,6 +126,7 @@ import graphObject from '../components/propertyBox/graphObject.vue'
import graph from '../components/propertyBox/graph.vue' import graph from '../components/propertyBox/graph.vue'
import graphSetting from '../components/propertyBox/graphSetting.vue' import graphSetting from '../components/propertyBox/graphSetting.vue'
import photo from '../components/propertyBox/photo.vue' import photo from '../components/propertyBox/photo.vue'
import addDevice from '../components/propertyBox/addDevice.vue'
import { GisApi } from '@/api/gisApi' import { GisApi } from '@/api/gisApi'
@ -139,7 +141,6 @@ let tree = ref()
let selectImgRef = ref() let selectImgRef = ref()
let editdirectoryBox = ref() let editdirectoryBox = ref()
eventBus.on('openDialog', async (sourceType: any, id: any) => { eventBus.on('openDialog', async (sourceType: any, id: any) => {
console.log(sourceType, id)
if (dynamicComponentRef.value && dynamicComponentRef.value.close) { if (dynamicComponentRef.value && dynamicComponentRef.value.close) {
dynamicComponentRef.value.close() dynamicComponentRef.value.close()
} }
@ -316,7 +317,6 @@ eventBus.on('openDialog', async (sourceType: any, id: any) => {
break break
} }
dynamicComponentRef.value.id = id dynamicComponentRef.value.id = id
console.log(dynamicComponentRef.value)
}) })
eventBus.on('openSelectImg', (selected, entity) => { eventBus.on('openSelectImg', (selected, entity) => {
// $sendElectronChanel("requireGEMarkerName", { // $sendElectronChanel("requireGEMarkerName", {
@ -353,7 +353,6 @@ const createEarth = async () => {
let openLeftClick = await new YJ.Global.openLeftClick(window.earth) let openLeftClick = await new YJ.Global.openLeftClick(window.earth)
let openRightClick = await new YJ.Global.openRightClick(window.earth) let openRightClick = await new YJ.Global.openRightClick(window.earth)
YJ.Global.MouseRightMenu(window.earth, true, (text, object) => { YJ.Global.MouseRightMenu(window.earth, true, (text, object) => {
console.log(text)
switch (text) { switch (text) {
case 'rotateAround': case 'rotateAround':
YJ.Global.rotateAround(window.earth, object.position) YJ.Global.rotateAround(window.earth, object.position)
@ -405,7 +404,6 @@ eventBus.on('defineClickAddLinkCb', (fun) => {
const sysChange = async () => { const sysChange = async () => {
let systemSetting = JSON.parse(localStorage.getItem('systemSetting')) let systemSetting = JSON.parse(localStorage.getItem('systemSetting'))
console.log('systemSetting', systemSetting)
const obj = { const obj = {
compass: systemSetting.showCompass, //罗盘 compass: systemSetting.showCompass, //罗盘
legend: systemSetting.showDistanceLegend, //比例尺 legend: systemSetting.showDistanceLegend, //比例尺
@ -424,6 +422,7 @@ const sysChange = async () => {
//系统 //系统
let coor = systemSetting.coordinate ? systemSetting.coordinate : 'EPSG:4326' let coor = systemSetting.coordinate ? systemSetting.coordinate : 'EPSG:4326'
YJ.Global.setCoordinateSystem(window.earth, coor) YJ.Global.setCoordinateSystem(window.earth, coor)
YJ.Global.setDMS(window.earth, systemSetting.positionType)
//比例尺 //比例尺
await YJ.Global.SheetIndexStatusSwitch(window.earth, systemSetting.sheetIndexStatusSwitch) await YJ.Global.SheetIndexStatusSwitch(window.earth, systemSetting.sheetIndexStatusSwitch)