Compare commits

...

2 Commits

Author SHA1 Message Date
zh
91eb42b353 Merge branch 'zyl' of http://xny.yj-3d.com:3000/zhouyulong/electron-4 into zyl 2025-12-19 12:38:29 +08:00
zh
92ab2b9a9e 12-19 2025-12-19 12:28:49 +08:00
13 changed files with 84 additions and 53 deletions

View File

@ -1,7 +1,7 @@
server:
host: 127.0.0.1
port: 8859
path: C:\Users\Administrator\AppData\Roaming\dzsp_shijingjun_offline_Y_save
port: 8848
path: C:\Users\MSI\AppData\Roaming\dzsp_shijingjun_offline_Y_save
poi:
global:
enabled: false

File diff suppressed because one or more lines are too long

View File

@ -441,6 +441,9 @@ img {
.ztree .checkbox_false_full + a,.ztree .checkbox_false_full_focus + a {
color: #d7d7d7;
.svg-icon {
fill: #d7d7d7 !important;
}
}
.ztree li a.curSelectedNode {
background-color: #ffffff00;
@ -450,6 +453,8 @@ img {
.svg-icon {
color: rgba(var(--color-base1), 1) !important;
fill: rgba(var(--color-base1), 1) !important;
stroke: rgba(var(--color-base1), 1) !important;
}
}

File diff suppressed because one or more lines are too long

Before

Width:  |  Height:  |  Size: 1.8 KiB

After

Width:  |  Height:  |  Size: 22 KiB

File diff suppressed because one or more lines are too long

Before

Width:  |  Height:  |  Size: 1.8 KiB

After

Width:  |  Height:  |  Size: 22 KiB

View File

@ -315,7 +315,6 @@ watch(modelName, (val) => {
// treeRef.value!.filter(val)
// }
categories.value = []
currModelList.value = []
getModelList()
})
@ -510,10 +509,41 @@ const modelClick = (index, row) => {
const renderModel = async (data, model) => {
let selectedNode = window.treeObj.getSelectedNodes()[0]
let z
let index = 0
let ids:any = []
if (data.positions.length > 0) {
data.positions.forEach(async (position, index) => {
// let source_id = this.$md5(new Date().getTime() + model.model_name+index);
data.positions.forEach(async (position, i) => {
// let source_id = this.$md5(new Date().getTime() + model.model_name+i);
let id = new YJ.Tools().randomString()
ids.push(id)
if (data.type == '面') {
z = data.rotate - 90
} else if (data.type == '线') {
z = data.rotate[i] - 90
}
let option = {
id: id,
position,
name: model.modelName + i,
show: true,
scale: { x: 1, y: 1, z: 1 },
url: service.value + model.modelDataUrl,
maximumScale: 1,
// host: 'http://127.0.0.1:8848',
rotate: {
x: 0,
y: 0,
z
}
}
let Model = await new YJ.Obj.Model(window.earth, option);
// //鼠标右键点击事件
Model.onRightClick = () => {};
(window as any)._entityMap.set(id, Model)
})
for (let position of data.positions) {
let id = ids[index]
if (data.type == '面') {
z = data.rotate - 90
} else if (data.type == '线') {
@ -535,9 +565,7 @@ const renderModel = async (data, model) => {
z
}
}
let Model = await new YJ.Obj.Model(window.earth, option)
;(window as any)._entityMap.set(id, Model)
await new Promise(resolve => setTimeout(resolve, 50))
let DbOption: any = {
params: option,
id,
@ -553,31 +581,18 @@ const renderModel = async (data, model) => {
if (![0, 200].includes(res.code)) {
return
}
DbOption.isShow = true
DbOption.params = JSON.stringify(DbOption.params)
cusAddNodes(window.treeObj, DbOption.parentId, [DbOption])
index++
if (index >= data.positions.length - 1) {
ElMessage.closeAll()
ElMessage({
message: '添加成功',
type: 'success'
})
DbOption.isShow = true
DbOption.params = JSON.stringify(DbOption.params)
cusAddNodes(window.treeObj, DbOption.parentId, [DbOption])
// //鼠标右键点击事件
Model.onRightClick = () => {}
// window._entityMap.set(option.id, Model);
// Model.onClick = () => {
// leftClick(node);
// };
// let detailOption = JSON.parse(JSON.stringify(Model.options));
// detailOption.url = model.model_id + ".glb";
// let node = getNodeData(DbOption, detailOption);
// addSource(node).then((res) => {
// if ([0, 200].includes(res.code)) {
// // cusRenderNode(DbOption) DbOption.p_id
// cusAddNodes(this.treeObj, DbOption.p_id, [node]);
// }
// });
})
}
}
}
}

View File

@ -270,6 +270,7 @@ const translate = () => {
}
}
const confirm = () => {
that.positionEditing && (that.positionEditing = false)
originalOptions = structuredClone(that.options)
baseDialog.value?.close()
let params = structuredClone(that.options)
@ -350,10 +351,8 @@ const changeMaximumParticleLife = (event) => {
const closeCallback = async () => {
entityOptions.value.originalOptions = structuredClone(originalOptions)
that.positionEditing = false
that.positionEditing && (that.positionEditing = false)
that.reset()
await YJ.Global.multiViewportMode.syncData(window.earth, that.options.id)
await YJ.Global.splitScreen.syncData(window.earth, that.options.id)
eventBus?.emit("destroyComponent")
}

View File

@ -203,6 +203,7 @@ const open = async (id: any) => {
})
}
const confirm = () => {
that.closeNodeEdit()
originalOptions = structuredClone(that.options)
baseDialog.value?.close()
let params = structuredClone(that.options)

View File

@ -156,6 +156,7 @@ const open = async (id: any) => {
})
}
const confirm = () => {
that.closeNodeEdit()
originalOptions = structuredClone(that.options)
baseDialog.value?.close()
let params = structuredClone(that.options)

View File

@ -367,6 +367,13 @@ export const useRightOperate = () => {
entity.remove();
(window as any)._entityMap.delete(entity.options.id)
}
else {
let entity = (window as any).pressModelEntities.get(item)
if (entity) {
entity.remove();
(window as any).pressModelEntities.delete(entity.options.id)
}
}
// let node = window.treeObj.getNodeByParam("id", item, null);
eventBus.emit("destroyComponent", item);
});

View File

@ -490,7 +490,7 @@ export const useTreeNode = () => {
// return (type === 'directory' || type === 'FeatureCollection') ? undefined : `http://localhost:${availablePort}/icon/${name}.png`;
return (type === 'directory' || type === 'FeatureCollection' || type === 'folder') ? undefined : `
<svg class="svg-icon" style="color: rgba(var(--color-base2), 1);margin-top: 1px;width:100%;height:100%;fill: currentColor !important;stroke: currentColor !important;stroke-width: ${strokeWidth} !important;shape-rendering: geometricPrecision;">
<svg class="svg-icon" style="color: rgba(var(--color-base2), 1);margin-top: 1px;width:100%;height:100%;fill: #fff;stroke: #fff;stroke-width: ${strokeWidth} !important;shape-rendering: geometricPrecision;">
<use xlink:href="#icon-${name}" />
</svg>
`;

View File

@ -836,7 +836,7 @@ defineExpose({
// .custom-dropdown2 {
// width: 380px !important;
// }
.el-select-dropdown__empty,
.custom-dropdown .el-select-dropdown__empty,
.el-select-dropdown__loading {
margin-top: -150px !important;
}

View File

@ -708,18 +708,21 @@ function importAuth() {
filters: [{ name: '授权文件', extensions: ['YJ'] }]
}
$sendElectronChanel('open-directory-dialog', option)
$recvElectronChanel('selectedItem', (e, paths) => {
console.log(e, paths, 'oopop')
if (paths.length != 0) {
$recvElectronChanel('selectedItem', async (e, paths) => {
let formdata = new FormData()
if(!paths[0]) {
return
}
formdata.append('filePath', paths[0])
try {
let res = AuthApi.authImport(formdata)
let res = await AuthApi.authImport(formdata)
if(res.code === 0 || res.code === 200) {
ElMessage.success('文件授权成功')
isAuth.value = false
baseDialog.value?.close()
} catch (error) {}
} else {
}
} catch (error) {}
})
}
// setTimeout(() => {