This commit is contained in:
zh
2025-09-25 16:21:00 +08:00
parent 5a0db4052d
commit 7d770ac126
99 changed files with 1686 additions and 291 deletions

View File

@ -121,7 +121,7 @@ interface Category {
}
// 模拟数据
const categories = ref<Category[]>([])
const categories = ref<any[]>([])
const activeTab = ref('0')
const galleryRef = ref<HTMLElement>()
@ -225,7 +225,7 @@ const toggleExpand = (row: any) => {
currentTypeId.value = row.id
// loadModelsByType(row.id)
}
const addType = ref('')
let typeArr = {
point: '点',
line: '线',
@ -240,6 +240,13 @@ const modelClick = (index, row) => {
// return
// }
// 轨迹运动选择模型
if(selectCallback && typeof selectCallback === 'function' && addType.value === 'trajectoryMotion'){
selectCallback('http://127.0.0.1:8848' + row.data)
close()
return
}
if (!isSetting) {
ElMessage.warning('请先设置模型默认参数')
return
@ -303,7 +310,7 @@ const renderModel = async (data, model) => {
}
let Model = await new YJ.Obj.Model(window.earth, option)
let DbOption = {
let DbOption:any = {
params: option,
id,
sourceName: model.modelName + index,
@ -380,7 +387,9 @@ onBeforeUnmount(() => {
})
//end
eventBus.on('openModel', (data) => {
eventBus.on('openModel', (data, cb, type) => {
selectCallback = cb
addType.value = type
isShowPup.value = data
if (data) {
getModelList()
@ -388,6 +397,8 @@ eventBus.on('openModel', (data) => {
}
})
eventBus.on('closeModelSet', (data) => {
addType.value = ''
selectCallback = null
isShowPup.value = data
if (data) {
console.log('设置后')
@ -396,7 +407,7 @@ eventBus.on('closeModelSet', (data) => {
})
//查看是否有设置模型设置
var isSetting = null
var isSetting:any = null
const getSetting = () => {
ModelApi.getModelSetting().then((res) => {
if (res.code == 0 || res.code == 200) {
@ -409,13 +420,18 @@ const open = () => {
isShowPup.value = true
}
const close = () => {
addType.value = ''
selectCallback = null
isShowPup.value = false
}
const setting = () => {
isShowPup.value = false
// @ts-ignore
eventBus.emit('openModelSetting', (true, isSetting))
}
let selectCallback:any = null
defineExpose({
open,
close