修改bug

This commit is contained in:
zyl
2025-11-28 17:36:10 +08:00
parent 4958d6c218
commit dc5bb667f8
10 changed files with 87 additions and 26 deletions

Binary file not shown.

View File

@ -27,6 +27,7 @@ export const TsApi = {
data data
}) })
}, },
delPlan: async (data: any) => { delPlan: async (data: any) => {
return await request.post({ return await request.post({
url: '/tsPlan/delete', url: '/tsPlan/delete',
@ -45,6 +46,19 @@ export const TsApi = {
data data
}) })
}, },
//树的隐藏显示
updateTreeShow: async (data: any) => {
let datas = []
data.forEach(item => {
let obj = {id: item.id, show: item.isShow}
// @ts-ignore
datas.push(obj)
})
return await request.post({
url: `/tsSource/batchUpdateShowStatus`,
data: datas
})
},
///tsSource/addModelSource ///tsSource/addModelSource
addTsModelSource: async (data: any) => { addTsModelSource: async (data: any) => {
return await request.post({ return await request.post({

View File

@ -157,7 +157,8 @@ const initTreeCallBack = () => {
if (!detail && !params) { if (!detail && !params) {
detail = { detail = {
id: arr[i].id, id: arr[i].id,
name: arr[i].sourceName name: arr[i].sourceName,
isShow: arr[i].isShow
} }
} }
layers.push( layers.push(
@ -168,7 +169,7 @@ const initTreeCallBack = () => {
) )
} else { } else {
console.log({...detail, ...params}) console.log({...detail, ...params})
initMapData(arr[i].sourceType, {...detail, ...params}) initMapData(arr[i].sourceType, {...detail, ...params},)
} }
} }
@ -195,7 +196,9 @@ const initTreeCallBack = () => {
}); });
if ((window as any).earth_ts) { if ((window as any).earth_ts) {
for (let i = 0; i < layers.length; i++) { for (let i = 0; i < layers.length; i++) {
initMapData(layers[i].sourceType, layers[i].detail, null) initMapData(layers[i].sourceType, layers[i].detail, (layer) => {
layer.show = Boolean(layers[i].isShow)
})
} }
} }
}) })
@ -232,7 +235,7 @@ const onClick = (event: MouseEvent, treeId: string, treeNode: any) => {
* @param treeId * @param treeId
* @param treeNode * @param treeNode
*/ */
const onCheck = (event: any, treeId: any, treeNode: any) => { const onCheck = async (event: any, treeId: any, treeNode: any) => {
console.log(treeNode, 'treeNode') console.log(treeNode, 'treeNode')
let p_ids: any = [] let p_ids: any = []
let parentNode = treeNode.getParentNode(); let parentNode = treeNode.getParentNode();
@ -262,7 +265,7 @@ const onCheck = (event: any, treeId: any, treeNode: any) => {
p_ids.push( p_ids.push(
{ {
id: parentNode.id, id: parentNode.id,
isShow: 0 isShow: 0,
} }
) )
window['treeObj'].checkNode(parentNode, false, true); window['treeObj'].checkNode(parentNode, false, true);
@ -270,7 +273,7 @@ const onCheck = (event: any, treeId: any, treeNode: any) => {
p_ids.push( p_ids.push(
{ {
id: parentNode.id, id: parentNode.id,
isShow: 1 isShow: 1,
} }
) )
} }
@ -286,7 +289,7 @@ const onCheck = (event: any, treeId: any, treeNode: any) => {
function sourceStatus(node) { function sourceStatus(node) {
if (canCheckType.includes(node.sourceType)) { if (canCheckType.includes(node.sourceType)) {
ids.push({id: node.id, isShow: node.isShow ? 1 : 0}) ids.push({id: node.id, isShow: node.isShow ? 1 : 0,})
console.log(node) console.log(node)
let entityObject let entityObject
entityObject = (window as any)._entityMap.get(node.id) entityObject = (window as any)._entityMap.get(node.id)
@ -308,6 +311,18 @@ const onCheck = (event: any, treeId: any, treeNode: any) => {
sourceStatus(treeNode) sourceStatus(treeNode)
console.log("ids", ids) console.log("ids", ids)
const res = await TsApi.updateTreeShow(ids)
if (res.code == 0 || res.code == 200) {
ElMessage({
message: '操作成功',
type: 'success'
})
} else {
ElMessage({
message: '操作失败',
type: 'error'
})
}
} }
const onMouseDown = (event: MouseEvent, treeId: string, treeNode: any) => { const onMouseDown = (event: MouseEvent, treeId: string, treeNode: any) => {
console.log("onMouseDown") console.log("onMouseDown")

View File

@ -1,6 +1,6 @@
<!--:style="'left:'+(index*Store.scales.distanceOfTicTiny+Store.scales.originOffset)+'px'"--> <!--:style="'left:'+(index*Store.scales.distanceOfTicTiny+Store.scales.originOffset)+'px'"-->
<template> <template>
<div class="timeScale"> <div class="timeScale" @click="clickTime">
<!-- 循环数组确保key唯一 --> <!-- 循环数组确保key唯一 -->
<template v-for="(_, index) in ticTiny" :key="index"> <template v-for="(_, index) in ticTiny" :key="index">
<span <span
@ -24,7 +24,12 @@ import {ref, watchEffect} from 'vue'
const props = defineProps(['ticTiny', 'ticMain', 'distanceOfTicTiny', 'distanceOfTicMain', 'originOffset', 'originMainOffset']) const props = defineProps(['ticTiny', 'ticMain', 'distanceOfTicTiny', 'distanceOfTicMain', 'originOffset', 'originMainOffset'])
const clickTime = (e) => {
console.log("点击时间轴", e)
let offset = window['tsObj']._Store._scales.scrollLeft + (e.screenX - 400)
window['tsObj']._Store.currentTimestamp = window['tsObj']._Store._startTimestamp + (offset / window['tsObj']._Store._scales.preSecondPx) * 1000
window['tsObj']._Store.setCursorLeft(window['tsObj']._Store._currentTimestamp)
}
let ticLabel = (val) => { let ticLabel = (val) => {
let timeLabels = [] let timeLabels = []
/* console.log("timeLabels", this.Store.scales.ticMain) /* console.log("timeLabels", this.Store.scales.ticMain)

View File

@ -141,6 +141,7 @@ const propsMap = {
} }
// 更新数值触发视图更新 // 更新数值触发视图更新
window['updateProp'] = (key: string, val: any) => { window['updateProp'] = (key: string, val: any) => {
console.log("window['updateProp']", key, val)
if (propsMap[key]) if (propsMap[key])
propsMap[key].value = val propsMap[key].value = val
} }

View File

@ -316,7 +316,7 @@ onUnmounted(() => {
// 定义可复用的回调函数 // 定义可复用的回调函数
const handleClick = (e) => { const handleClick = (e) => {
console.log('点击事件触发', e) // console.log('点击事件触发', e)
let dom = $('.MouseRight')[0] let dom = $('.MouseRight')[0]
if (dom) dom.style.display = "none" if (dom) dom.style.display = "none"

View File

@ -14,14 +14,14 @@
<svg-icon :size="15" class="icon-svg-item" name="closeLeftTs"/>收起 <svg-icon :size="15" class="icon-svg-item" name="closeLeftTs"/>收起
</span> </span>
</div> </div>
<!-- <div> <div>
<el-input <el-input
v-model="input2" v-model="input2"
class="responsive-input" class="responsive-input"
placeholder="搜索" placeholder="搜索"
:prefix-icon="Search" :prefix-icon="Search"
/> />
</div>--> </div>
<div class="tabsBox"> <div class="tabsBox">
<div class="tabs"> <div class="tabs">
<div v-for="(item,index) in tabs" @click="handleTabClick(item,index)" :class="index==activIndex?'active':''"> <div v-for="(item,index) in tabs" @click="handleTabClick(item,index)" :class="index==activIndex?'active':''">
@ -32,9 +32,11 @@
<div class="treeOrList custom_scroll_bar_ts" :style="currentTypeId!=''?'height: calc(100% - 300px);':''"> <div class="treeOrList custom_scroll_bar_ts" :style="currentTypeId!=''?'height: calc(100% - 300px);':''">
<template v-if="dataType=='tree'"> <template v-if="dataType=='tree'">
<el-tree <el-tree
ref="treeRef"
:data="treeData" :data="treeData"
:props="defaultProps" :props="defaultProps"
@node-click="handleNodeClick" @node-click="handleNodeClick"
:filter-node-method="filterNode"
/> />
</template> </template>
<template v-if="dataType=='list'"> <template v-if="dataType=='list'">
@ -65,14 +67,14 @@
<script lang="ts" setup> <script lang="ts" setup>
//@ts-nocheck //@ts-nocheck
import {ref, onMounted} from "vue"; import {ref, onMounted, watch} from "vue";
import {Search} from '@element-plus/icons-vue' import {Search} from '@element-plus/icons-vue'
import {ModelApi} from "../../api/model"; import {ModelApi} from "../../api/model";
import {GraphApi} from "../../api/graphLabel"; import {GraphApi} from "../../api/graphLabel";
import {addMapSource} from "./entity"; import {addMapSource} from "./entity";
import {useTreeNode} from "../components/tree/hooks/treeNode"; import {useTreeNode} from "../components/tree/hooks/treeNode";
import {ElMessage} from "element-plus"; import {ElMessage, TreeInstance} from "element-plus";
const {getSelectedNodes} = useTreeNode() const {getSelectedNodes} = useTreeNode()
const service = ref(localStorage.getItem('ip')) const service = ref(localStorage.getItem('ip'))
@ -83,6 +85,7 @@ interface Tree {
children?: Tree[] children?: Tree[]
} }
const treeRef = ref<TreeInstance>()
const defaultProps = { const defaultProps = {
children: 'children', children: 'children',
label: 'name', label: 'name',
@ -114,10 +117,26 @@ let graphTypes = ref<Tree[]>([])
const lists = ref([]) const lists = ref([])
const elementList = ref([]) const elementList = ref([])
let input2 = ref('') let input2 = ref('')
watch(input2, (val) => {
console.log("input2", val)
console.log("lists", lists)
console.log("lists", lists.value.filter(item => item.name.includes(val)))
if (val == '') {
handleTabClick(tabs[activIndex.value], activIndex.value)
} else {
lists.value = lists.value.filter(item => item.name.includes(val))
}
treeRef.value && treeRef.value!.filter(val)
})
// 当前选择类型的Id // 当前选择类型的Id
const currentTypeId = ref('') const currentTypeId = ref('')
// 是否为树结构 // 是否为树结构
const dataType = ref('tree') const dataType = ref('tree')
const filterNode = (value: string, data: Tree) => {
if (!value) return true
return data.name.includes(value)
}
// 树形结构节点点击 // 树形结构节点点击
const handleTabClick = (item, index) => { const handleTabClick = (item, index) => {
activIndex.value = index activIndex.value = index
@ -272,7 +291,7 @@ let addMarker = (item) => {
.tabsBox { .tabsBox {
//flex: auto; //flex: auto;
height: calc(100% - 30px); height: calc(100% - 70.8px);
//display: flex; //display: flex;
//flex-direction: column; //flex-direction: column;
.tabs { .tabs {

View File

@ -60,18 +60,22 @@ export function initMapData(type, data, cb: any = null) {
case 'gdslImagery': case 'gdslImagery':
data.host = baseURL data.host = baseURL
entityObject = new YJ.Obj.GDSLImagery(window['earth_ts'], data) entityObject = new YJ.Obj.GDSLImagery(window['earth_ts'], data)
cb && cb(entityObject)
break break
case 'gdlwImagery': case 'gdlwImagery':
data.host = baseURL data.host = baseURL
entityObject = new YJ.Obj.GDLWImagery(window['earth_ts'], data) entityObject = new YJ.Obj.GDLWImagery(window['earth_ts'], data)
cb && cb(entityObject)
break break
case 'arcgisBlueImagery': case 'arcgisBlueImagery':
data.host = baseURL data.host = baseURL
entityObject = new YJ.Obj.ArcgisBLUEImagery(window['earth_ts'], data) entityObject = new YJ.Obj.ArcgisBLUEImagery(window['earth_ts'], data)
cb && cb(entityObject)
break break
case 'arcgisWximagery': case 'arcgisWximagery':
data.host = baseURL data.host = baseURL
entityObject = new YJ.Obj.ArcgisWXImagery(window['earth_ts'], data) entityObject = new YJ.Obj.ArcgisWXImagery(window['earth_ts'], data)
cb && cb(entityObject)
break break
case "guiji": case "guiji":
entityObject = new YJ.Obj.TrajectoryMotionObject( entityObject = new YJ.Obj.TrajectoryMotionObject(

View File

@ -198,7 +198,7 @@ const getList = (params: any = null) => {
formData.append('pageSize', pageSize.value) formData.append('pageSize', pageSize.value)
formData.append('pageNum', pageNum.value) formData.append('pageNum', pageNum.value)
if (params) { if (params) {
/*for (const paramsKey in params) { for (const paramsKey in params) {
if (params[paramsKey]) { if (params[paramsKey]) {
if (paramsKey == 'datetime') { if (paramsKey == 'datetime') {
formData.append('startTime', params[paramsKey][0]) formData.append('startTime', params[paramsKey][0])
@ -208,8 +208,8 @@ const getList = (params: any = null) => {
} }
} }
}*/ }
formData.append('username', params["createdBy"]) formData.append('nickname', params["createdBy"])
} }
TsApi.planList(formData).then(res => { TsApi.planList(formData).then(res => {

View File

@ -93,7 +93,6 @@ export class Store {
break break
case "ticTiny": case "ticTiny":
val = value val = value
break break
case "ticMain": case "ticMain":
this._scales.timeLabels = this._scales.timeLabels.slice(0, this._scales.ticMain) this._scales.timeLabels = this._scales.timeLabels.slice(0, this._scales.ticMain)
@ -130,8 +129,12 @@ export class Store {
// 通过时间戳来设置位置 // 通过时间戳来设置位置
setCursorLeft(stamp) { setCursorLeft(stamp) {
let newLeft = ((stamp - this._startTimestamp) / 1000) * this._scales.preSecondPx - this._scales.scrollLeft let newLeft = ((stamp - this._startTimestamp) / 1000) * this._scales.preSecondPx - this._scales.scrollLeft
console.log("stamp", stamp)
console.log("this._startTimestamp", this._startTimestamp)
console.log("this._scales.preSecondPx", this._scales.preSecondPx)
console.log("newLeft", newLeft)
this.setScale('cursorLeft', newLeft) this.setScale('cursorLeft', newLeft)
// console.log("newLeft", newLeft)
} }
dealData(key = "startTime", value = []) { dealData(key = "startTime", value = []) {