修正主视图长/宽样式,修复外部导入调用时实体缺失问题

This commit is contained in:
2025-05-26 15:44:13 +08:00
parent 37158e7cb1
commit a1a541fff0
7 changed files with 21 additions and 13 deletions

View File

@@ -1,4 +1,4 @@
import { CADFactory, CADFiler, CADObject, Database, DuplicateRecordCloning, ObjectId, PhysicalMaterialRecord } from "webcad_ue4_api";
import { CADFactory, CADFiler, CADObject, Database, DuplicateRecordCloning, Factory, LayerNode, ObjectId, PhysicalMaterialRecord } from "webcad_ue4_api";
// TODO: Danger: 注意入侵性代码
// 疑似是WebCAD中的漏洞当传入new Database()时,

View File

@@ -10,10 +10,10 @@
<label>材质名</label>
<input v-model.trim="materialInfo.materialName" type="text" placeholder="材质名" />
<!-- <CfFlex gap="1em">
<CfFlex gap="1em" v-if="debugMode">
<button class="btn-success" style="min-width: 110px;" @click="HandleUpload">上传</button>
<button class="btn-danger" style="min-width: 110px;" @click="HandleCancel">取消</button>
</CfFlex> -->
</CfFlex>
</div>
<div class="adjust-section">

View File

@@ -59,8 +59,8 @@ async function HandleUpdateConfig() {
<style scoped lang="scss">
.material-view
{
width: 100%;
height: 100%;
width: 100cqw;
height: 100cqh;
box-sizing: border-box;
padding: 0;
margin: 0;

View File

@@ -8,8 +8,9 @@ export function ToDeflatedBase64(materialJson: string)
export function FromDeflateBase64(base64: string) {
let binaryString = atob(base64);
console.log("Bin", binaryString);
// TODO: Danger: 压缩数据有问题使用fflate或是pako@2.1.0会出现EOF/unknown compression method错误必须要使用pako@1.0.11才行
let data = Pako.inflate(binaryString as any, { to: "string" });
// let data = U8ToStr(Deflate(binaryString));
console.log("data", data);
return data;
}

View File

@@ -7,6 +7,7 @@ import { ConfigureLibOutput, type LibOutputConfig } from './libOutputConfig';
import { useEvent } from '../stores/eventStore';
import { useScene, useSceneRaw } from '../stores/sceneStore';
import { DeflateAsync } from '../helpers/helper.compression';
import { CADFactory, Factory, LayerNode } from 'webcad_ue4_api';
let app: VueApp<Element> = undefined;
@@ -19,6 +20,12 @@ export function Mount(element: Element, options: Partial<LibOutputConfig>) {
ConfigureLibOutput(options);
const pinia = createPinia();
// TODO: Warn: 有BUG部分实体的构造函数名带_1后缀原因未知这会导致CADFactory在创建实体时找不到注册的类名
// @ts-ignore
// console.log(CADFactory.factory.objectNameMap); // 为什么Map中的构造函数名带_1后缀
CADFactory.RegisterObjectAlias(LayerNode, "LayerNode");
app = createApp(App);
app.use(pinia)
.mount(element);