This commit is contained in:
2025-11-21 16:37:46 +08:00
6 changed files with 240 additions and 138 deletions

View 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: 8848,
proxy: {
'/api': {
target: localStorage.getItem('ip') || 'http://127.0.0.1:8848',
changeOrigin: true,
rewrite: (path) => path.replace(/^\/api/, '')
}
}
}*/
}
});
export {
electron_vite_config_default as default
};

View File

@ -39,6 +39,12 @@ export const TsApi = {
data data
}) })
}, },
updateTsSource: async (data: any) => {
return await request.post({
url: '/tsSource/update',
data
})
},
///tsSource/addModelSource ///tsSource/addModelSource
addTsModelSource: async (data: any) => { addTsModelSource: async (data: any) => {
return await request.post({ return await request.post({

View File

@ -1,7 +1,7 @@
<template> <template>
<div class="MouseRight"> <div class="MouseRight">
<div v-for="item in menus" class="item" @click="item.fun"> <div v-for="item in menus" class="item" @click="item.fun">
<svg-icon :name="item.icon||item.key" :size="14"></svg-icon> <svg-icon :name="item.key" :size="14"></svg-icon>
{{ item.name }} {{ item.name }}
</div> </div>
</div> </div>
@ -15,7 +15,7 @@ import {useRightOperate} from './rightOperate'
let {delNode, addEvent} = useRightOperate() let {delNode, addEvent} = useRightOperate()
const eventBus = inject("bus"); const eventBus: any = inject("bus");
let setOrReset = ref(1) let setOrReset = ref(1)
let setView = (flag) => { let setView = (flag) => {
// let cusView = window['YJ'].Global.getCurrentView(window['earth_ts']) // let cusView = window['YJ'].Global.getCurrentView(window['earth_ts'])
@ -74,7 +74,7 @@ let menus = ref([
]) ])
eventBus.on("initMenus", () => { eventBus.on("initMenus", () => {
let customView = null let customView
let entity = window['_entityMap'].get(window['selectedIdTs']) let entity = window['_entityMap'].get(window['selectedIdTs'])
customView = Boolean(entity.customView && entity.customView.orientation) customView = Boolean(entity.customView && entity.customView.orientation)
setOrReset.value = customView ? 0 : 1 setOrReset.value = customView ? 0 : 1

View File

@ -127,7 +127,10 @@
<span class="arrow"></span> <span class="arrow"></span>
</div> </div>
<button class="add-point" style="margin-left: 10px"> <button class="add-point" style="margin-left: 10px">
<svg class="icon-add"><use xlink:href="#yj-icon-add"></use></svg>增加视点 <svg class="icon-add">
<use xlink:href="#yj-icon-add"></use>
</svg>
增加视点
</button> </button>
</div> </div>
</div> </div>
@ -192,13 +195,18 @@
<template #footer> <template #footer>
<div style="position: absolute; left: 24px; display: flex"> <div style="position: absolute; left: 24px; display: flex">
<button class="afreshPlay"> <button class="afreshPlay">
<svg class="icon-play"><use xlink:href="#yj-icon-play"></use></svg>播放 <svg class="icon-play">
<use xlink:href="#yj-icon-play"></use>
</svg>
播放
</button> </button>
<button class="cease" style="margin-left: 10px"> <button class="cease" style="margin-left: 10px">
<svg-icon name="stop" :size="12" color="rgba(255, 255, 255, 1)"></svg-icon>结束 <svg-icon name="stop" :size="12" color="rgba(255, 255, 255, 1)"></svg-icon>
结束
</button> </button>
<button class="video" style="margin-left: 10px" @click="startVideo"> <button class="video" style="margin-left: 10px" @click="startVideo">
<svg-icon name="video" :size="12"></svg-icon>录制 <svg-icon name="video" :size="12"></svg-icon>
录制
</button> </button>
</div> </div>
<button class="saveRoam" @click="draw">保存</button> <button class="saveRoam" @click="draw">保存</button>
@ -208,6 +216,7 @@
</template> </template>
<script setup lang="ts"> <script setup lang="ts">
//@ts-nocheck
import {ref, reactive, onBeforeUnmount} from 'vue' import {ref, reactive, onBeforeUnmount} from 'vue'
import {inject} from 'vue' import {inject} from 'vue'
import {useI18n} from 'vue-i18n' import {useI18n} from 'vue-i18n'
@ -293,7 +302,8 @@ const startVideo = () => {
window.addEventListener('keydown', handleKeyDown) window.addEventListener('keydown', handleKeyDown)
} }
const clangeViewPointHeight = () => {} const clangeViewPointHeight = () => {
}
const viewPointHeightInput = () => { const viewPointHeightInput = () => {
let dom: any = document.getElementById('viewPointHeight') let dom: any = document.getElementById('viewPointHeight')
if (viewPointHeight.value < dom.min * 1) { if (viewPointHeight.value < dom.min * 1) {
@ -324,28 +334,29 @@ defineExpose({
<style scoped lang="scss"> <style scoped lang="scss">
.afreshPlay { .afreshPlay {
background: background: linear-gradient(0deg, rgba(0, 0, 0, 0.5), rgba(0, 0, 0, 0.5)),
linear-gradient(0deg, rgba(0, 0, 0, 0.5), rgba(0, 0, 0, 0.5)),
linear-gradient(180deg, rgba(27, 248, 195, 0.2) 0%, rgba(27, 248, 195, 0) 100%) !important; linear-gradient(180deg, rgba(27, 248, 195, 0.2) 0%, rgba(27, 248, 195, 0) 100%) !important;
border: 1px solid rgba(27, 248, 195, 1) !important; border: 1px solid rgba(27, 248, 195, 1) !important;
color: rgba(27, 248, 195, 1) !important; color: rgba(27, 248, 195, 1) !important;
svg { svg {
fill: rgba(27, 248, 195, 1) !important; fill: rgba(27, 248, 195, 1) !important;
} }
} }
.cease { .cease {
background: background: linear-gradient(180deg, rgba(241, 108, 85, 0.2) 0%, rgba(241, 108, 85, 0) 100%),
linear-gradient(180deg, rgba(241, 108, 85, 0.2) 0%, rgba(241, 108, 85, 0) 100%),
rgba(0, 0, 0, 0.5) !important; rgba(0, 0, 0, 0.5) !important;
border: 1px solid rgba(241, 108, 85, 1) !important; border: 1px solid rgba(241, 108, 85, 1) !important;
color: rgba(241, 108, 85, 1) !important; color: rgba(241, 108, 85, 1) !important;
svg { svg {
fill: rgba(241, 108, 85, 1) !important; fill: rgba(241, 108, 85, 1) !important;
} }
} }
.video { .video {
background: background: linear-gradient(
linear-gradient(
180deg, 180deg,
rgba(71, 27, 5, 0.3) 0%, rgba(71, 27, 5, 0.3) 0%,
rgba(71, 27, 5, 0.3) 0%, rgba(71, 27, 5, 0.3) 0%,
@ -355,10 +366,12 @@ defineExpose({
border: 1px solid rgba(255, 165, 92, 1) !important; border: 1px solid rgba(255, 165, 92, 1) !important;
color: rgba(255, 165, 92, 1) !important; color: rgba(255, 165, 92, 1) !important;
} }
::v-deep .content input.YJ-custom-checkbox[type='checkbox'] { ::v-deep .content input.YJ-custom-checkbox[type='checkbox'] {
border: 1px solid rgba(var(--color-base1), 1) !important; border: 1px solid rgba(var(--color-base1), 1) !important;
background-color: unset !important; background-color: unset !important;
} }
::v-deep .iconBut { ::v-deep .iconBut {
background: unset !important; background: unset !important;
border: unset !important; border: unset !important;

View File

@ -122,10 +122,16 @@
</template> </template>
<template #footer> <template #footer>
<button id="routeQuery" @clik="routeQuery"> <button id="routeQuery" @clik="routeQuery">
<svg class="icon-query"><use xlink:href="#yj-icon-query"></use></svg>查询 <svg class="icon-query">
<use xlink:href="#yj-icon-query"></use>
</svg>
查询
</button> </button>
<button id="clearRoute" @click="clearRoute"> <button id="clearRoute" @click="clearRoute">
<svg class="icon-route"><use xlink:href="#yj-icon-route"></use></svg>清除路线 <svg class="icon-route">
<use xlink:href="#yj-icon-route"></use>
</svg>
清除路线
</button> </button>
<button @click="close">取消</button> <button @click="close">取消</button>
</template> </template>
@ -133,6 +139,7 @@
</template> </template>
<script setup lang="ts"> <script setup lang="ts">
//@ts-nocheck
import {ref, reactive, onBeforeUnmount} from 'vue' import {ref, reactive, onBeforeUnmount} from 'vue'
import {inject} from 'vue' import {inject} from 'vue'
import Dialog from '@/components/dialog/baseDialog.vue' import Dialog from '@/components/dialog/baseDialog.vue'
@ -207,6 +214,7 @@ const open = () => {
routePlanning.createRoute(res.data.routes[0]?.points) routePlanning.createRoute(res.data.routes[0]?.points)
} }
} catch (error) { } catch (error) {
document.getElementById('clearRoute').click() document.getElementById('clearRoute').click()
} }
} }
@ -244,7 +252,8 @@ const routeQuery = async (e) => {
waypoints: [] waypoints: []
}) })
} }
const clearRoute = (e) => {} const clearRoute = (e) => {
}
const pickStartPos = () => { const pickStartPos = () => {
routePlanning.pickStartPos((position) => { routePlanning.pickStartPos((position) => {
startLng.value = position.lng startLng.value = position.lng
@ -317,14 +326,17 @@ defineExpose({
left: 10px; left: 10px;
display: flex; display: flex;
} }
#clearRoute { #clearRoute {
position: absolute; position: absolute;
left: 95px; left: 95px;
display: flex; display: flex;
} }
.YJ-custom-base-dialog > .content .row > .col { .YJ-custom-base-dialog > .content .row > .col {
margin: 0 5px !important; margin: 0 5px !important;
} }
.crossPoint:hover { .crossPoint:hover {
color: rgba(var(--color-base1), 1); color: rgba(var(--color-base1), 1);
} }

View File

@ -4,7 +4,8 @@
<div class="col attribute-select-box"> <div class="col attribute-select-box">
<span class="label" style="line-height: 32px">{{ t('general.内容类型') }}</span> <span class="label" style="line-height: 32px">{{ t('general.内容类型') }}</span>
<el-select style="width: 175px" v-model="attributeType" @change="attributeChange" placeholder="请选择"> <el-select style="width: 175px" v-model="attributeType" @change="attributeChange" placeholder="请选择">
<el-option v-for="item in attributeSelect" :key="item.key" :label="t('general.' + item.name)" :value="item.key"> <el-option v-for="item in attributeSelect" :key="item.key" :label="t('general.' + item.name)"
:value="item.key">
</el-option> </el-option>
</el-select> </el-select>
</div> </div>
@ -46,7 +47,10 @@
</div> </div>
<div class="td" v-else>{{ item.url }}</div> <div class="td" v-else>{{ item.url }}</div>
<div class="td operation" v-if="linkEditActive.index === index"> <div class="td operation" v-if="linkEditActive.index === index">
<button style="width: 76px;flex: 0 0 76px" @click="linkConfirmEdit(index)">{{ t('general.确认') }}</button> <button style="width: 76px;flex: 0 0 76px" @click="linkConfirmEdit(index)">{{
t('general.确认')
}}
</button>
<button style="width: 76px;flex: 0 0 76px" @click="linkCancelEdit">{{ t('general.取消') }}</button> <button style="width: 76px;flex: 0 0 76px" @click="linkCancelEdit">{{ t('general.取消') }}</button>
</div> </div>
<div class="td operation" v-else> <div class="td operation" v-else>
@ -66,7 +70,9 @@
<div class="col"> <div class="col">
<span class="label">{{ t('general.编辑内容') }}</span> <span class="label">{{ t('general.编辑内容') }}</span>
<input class="input" type="text" v-model="cameraParams.keyWord" style="width: 180px;margin-right: 10px;"/> <input class="input" type="text" v-model="cameraParams.keyWord" style="width: 180px;margin-right: 10px;"/>
<button class="select btn" @click="cameraSelect({page: 1, limit: cameraParams.pageSize })">{{ t('general.搜索') }}</button> <button class="select btn" @click="cameraSelect({page: 1, limit: cameraParams.pageSize })">
{{ t('general.搜索') }}
</button>
</div> </div>
</div> </div>
<div> <div>
@ -104,7 +110,8 @@
</div> </div>
</div> </div>
<div class="row"> <div class="row">
<Pagination :total="cameraParams.total" v-model:page="cameraParams.page" v-model:limit="cameraParams.pageSize" :pageSizes="false" @pagination="cameraSelect" /> <Pagination :total="cameraParams.total" v-model:page="cameraParams.page" v-model:limit="cameraParams.pageSize"
:pageSizes="false" @pagination="cameraSelect"/>
</div> </div>
</div> </div>
<div class="attribute-content attribute-content-isc" v-show="attributeType === 'isc'"> <div class="attribute-content attribute-content-isc" v-show="attributeType === 'isc'">
@ -275,6 +282,7 @@ import { inject } from 'vue'
import {deviceApi} from '@/api/deviceManage' import {deviceApi} from '@/api/deviceManage'
import {MaterialApi} from '@/api/material' import {MaterialApi} from '@/api/material'
import {useI18n} from 'vue-i18n' import {useI18n} from 'vue-i18n'
const {t} = useI18n() const {t} = useI18n()
let ipcRenderer; let ipcRenderer;
@ -357,8 +365,7 @@ const goodsSelect = async (page) => {
const cameraSelect = ({page, limit}) => { const cameraSelect = ({page, limit}) => {
if (!props.entityOptions.attributeSelect) { if (!props.entityOptions.attributeSelect) {
return return
} } else {
else {
let flag = false let flag = false
for (let i = 0; i < props.entityOptions.attributeSelect.length; i++) { for (let i = 0; i < props.entityOptions.attributeSelect.length; i++) {
if (props.entityOptions.attributeSelect[i].key === 'camera') { if (props.entityOptions.attributeSelect[i].key === 'camera') {
@ -494,8 +501,7 @@ const _addLink = async () => {
}) })
} }
}); });
} } else {
else {
// const pickerOpts = { // const pickerOpts = {
// types: [ // types: [
// { // {
@ -634,7 +640,7 @@ const _addRtmp = () => {
} }
} }
const rtmpEdit = (index: any, item: { name: any; url: any; }) => { const rtmpEdit = (index: any, item: { name: any; url: any; id: any }) => {
let active = { let active = {
index: index, index: index,
name: item.name, name: item.name,
@ -654,7 +660,8 @@ const rtmpCancelEdit = () => {
rtmpEditActive.value = {} rtmpEditActive.value = {}
} }
const attributeChange = () => { } const attributeChange = () => {
}
const changeAttributeGoods = (item) => { const changeAttributeGoods = (item) => {
let flag = false let flag = false
@ -664,8 +671,7 @@ const changeAttributeGoods = (item) => {
flag = true flag = true
if (item.cnt) { if (item.cnt) {
props.entityOptions.attributeGoods[m].cnt = item.cnt props.entityOptions.attributeGoods[m].cnt = item.cnt
} } else {
else {
props.entityOptions.attributeGoods.splice(m, 1) props.entityOptions.attributeGoods.splice(m, 1)
} }
break break
@ -743,6 +749,7 @@ const changeAttributeCamera = (e) => {
width: 150px; width: 150px;
justify-content: center; justify-content: center;
} }
.YJ-custom-base-dialog.dialog-en > .content .attribute-content-link .table .tr .th:nth-child(3), .YJ-custom-base-dialog.dialog-en > .content .attribute-content-link .table .tr .th:nth-child(3),
.YJ-custom-base-dialog.dialog-en > .content .attribute-content-link .table .tr .td:nth-child(3), .YJ-custom-base-dialog.dialog-en > .content .attribute-content-link .table .tr .td:nth-child(3),
.YJ-custom-base-dialog.dialog-en > .content .attribute-content-vr .table .tr .th:nth-child(3), .YJ-custom-base-dialog.dialog-en > .content .attribute-content-vr .table .tr .th:nth-child(3),
@ -811,24 +818,28 @@ const changeAttributeCamera = (e) => {
width: 100px; width: 100px;
min-width: 100px; min-width: 100px;
} }
.YJ-custom-base-dialog.dialog-en > .content .table.camera-table .tr .th, .YJ-custom-base-dialog.dialog-en > .content .table.camera-table .tr .th,
.YJ-custom-base-dialog.dialog-en > .content .table.camera-table .tr .td { .YJ-custom-base-dialog.dialog-en > .content .table.camera-table .tr .td {
flex: 0 0 110px; flex: 0 0 110px;
width: 110px; width: 110px;
min-width: 110px; min-width: 110px;
} }
.YJ-custom-base-dialog.dialog-en > .content .table.camera-table .tr .th:nth-of-type(3), .YJ-custom-base-dialog.dialog-en > .content .table.camera-table .tr .th:nth-of-type(3),
.YJ-custom-base-dialog.dialog-en > .content .table.camera-table .tr .td:nth-of-type(3) { .YJ-custom-base-dialog.dialog-en > .content .table.camera-table .tr .td:nth-of-type(3) {
flex: 0 0 110px !important; flex: 0 0 110px !important;
width: 110px !important; width: 110px !important;
min-width: 110px !important; min-width: 110px !important;
} }
.YJ-custom-base-dialog.dialog-en > .content .table.camera-table .tr .th:nth-of-type(5), .YJ-custom-base-dialog.dialog-en > .content .table.camera-table .tr .th:nth-of-type(5),
.YJ-custom-base-dialog.dialog-en > .content .table.camera-table .tr .td:nth-of-type(5) { .YJ-custom-base-dialog.dialog-en > .content .table.camera-table .tr .td:nth-of-type(5) {
flex: 0 0 95px !important; flex: 0 0 95px !important;
width: 95px !important; width: 95px !important;
min-width: 95px !important; min-width: 95px !important;
} }
.YJ-custom-base-dialog.dialog-en > .content .table.camera-table .tr .th:nth-of-type(6), .YJ-custom-base-dialog.dialog-en > .content .table.camera-table .tr .th:nth-of-type(6),
.YJ-custom-base-dialog.dialog-en > .content .table.camera-table .tr .td:nth-of-type(6) { .YJ-custom-base-dialog.dialog-en > .content .table.camera-table .tr .td:nth-of-type(6) {
flex: 0 0 95px !important; flex: 0 0 95px !important;