修改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
})
},
delPlan: async (data: any) => {
return await request.post({
url: '/tsPlan/delete',
@ -45,6 +46,19 @@ export const TsApi = {
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
addTsModelSource: async (data: any) => {
return await request.post({

View File

@ -157,7 +157,8 @@ const initTreeCallBack = () => {
if (!detail && !params) {
detail = {
id: arr[i].id,
name: arr[i].sourceName
name: arr[i].sourceName,
isShow: arr[i].isShow
}
}
layers.push(
@ -168,7 +169,7 @@ const initTreeCallBack = () => {
)
} else {
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) {
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 treeNode
*/
const onCheck = (event: any, treeId: any, treeNode: any) => {
const onCheck = async (event: any, treeId: any, treeNode: any) => {
console.log(treeNode, 'treeNode')
let p_ids: any = []
let parentNode = treeNode.getParentNode();
@ -262,7 +265,7 @@ const onCheck = (event: any, treeId: any, treeNode: any) => {
p_ids.push(
{
id: parentNode.id,
isShow: 0
isShow: 0,
}
)
window['treeObj'].checkNode(parentNode, false, true);
@ -270,7 +273,7 @@ const onCheck = (event: any, treeId: any, treeNode: any) => {
p_ids.push(
{
id: parentNode.id,
isShow: 1
isShow: 1,
}
)
}
@ -286,7 +289,7 @@ const onCheck = (event: any, treeId: any, treeNode: any) => {
function sourceStatus(node) {
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)
let entityObject
entityObject = (window as any)._entityMap.get(node.id)
@ -308,6 +311,18 @@ const onCheck = (event: any, treeId: any, treeNode: any) => {
sourceStatus(treeNode)
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) => {
console.log("onMouseDown")

View File

@ -1,6 +1,6 @@
<!--:style="'left:'+(index*Store.scales.distanceOfTicTiny+Store.scales.originOffset)+'px'"-->
<template>
<div class="timeScale">
<div class="timeScale" @click="clickTime">
<!-- 循环数组确保key唯一 -->
<template v-for="(_, index) in ticTiny" :key="index">
<span
@ -24,7 +24,12 @@ import {ref, watchEffect} from 'vue'
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 timeLabels = []
/* console.log("timeLabels", this.Store.scales.ticMain)

View File

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

View File

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

View File

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

View File

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

View File

@ -198,7 +198,7 @@ const getList = (params: any = null) => {
formData.append('pageSize', pageSize.value)
formData.append('pageNum', pageNum.value)
if (params) {
/*for (const paramsKey in params) {
for (const paramsKey in params) {
if (params[paramsKey]) {
if (paramsKey == 'datetime') {
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 => {

View File

@ -93,7 +93,6 @@ export class Store {
break
case "ticTiny":
val = value
break
case "ticMain":
this._scales.timeLabels = this._scales.timeLabels.slice(0, this._scales.ticMain)
@ -130,8 +129,12 @@ export class Store {
// 通过时间戳来设置位置
setCursorLeft(stamp) {
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)
// console.log("newLeft", newLeft)
}
dealData(key = "startTime", value = []) {