Merge branch 'main' of ssh://18.167.251.121:10002/aidlab/FiDA_Front

This commit is contained in:
X1627315083@163.com
2026-04-02 14:46:11 +08:00
21 changed files with 271 additions and 169 deletions

View File

@@ -16,8 +16,8 @@ export const initThree = (threeDom)=>{
/**
* 创建渲染器对象
*/
let width = threeDom.offsetWidth; //窗口宽度
let height = threeDom.offsetHeight; //窗口高度
const width = threeDom.offsetWidth; //窗口宽度
const height = threeDom.offsetHeight; //窗口高度
const renderer = new THREE.WebGLRenderer({
antialias: true,
logarithmicDepthBuffer: true,//深度缓存 防止模型闪烁重影
@@ -35,9 +35,9 @@ export const initThree = (threeDom)=>{
// 设置渲染器大小
//环境光
let ambient = new THREE.AmbientLight(0xffffff,.8);
const ambient = new THREE.AmbientLight(0xffffff,.8);
scene.add(ambient);
let controls = new OrbitControls(camera,renderer.domElement)//监听鼠标、键盘事件;
const controls = new OrbitControls(camera,renderer.domElement)//监听鼠标、键盘事件;
// controls.minDistance = 500; // 设置相机与焦点的最小距离
// controls.maxDistance = 4000; // 设置相机与焦点的最大距离
controls.mouseButtons = {
@@ -166,14 +166,14 @@ export const addModel = async (
load: any
) => {
await new Promise((resolve, reject) => {
var fbxLoader = new GLTFLoader();
let drac = new DRACOLoader()
const fbxLoader = new GLTFLoader();
const drac = new DRACOLoader()
drac.setDecoderPath('/draco/')
fbxLoader.setDRACOLoader(drac)
fbxLoader.load(url,
(obj: any) => {
let scene = obj.scene;
const scene = obj.scene;
scene.traverse((child: any) => {
if (child.isMesh) {
// 如果是基础材质,转换为标准材质

View File

@@ -27,13 +27,13 @@ export class GenerateManager {
async getTasksIdImg() {
clearInterval(this.getTaskIdsImgTime)
this.getTaskIdsImgTime = setInterval(()=>{
let taskIds = this.taskIds.map((item)=>item.taskId)
const taskIds = this.taskIds.map((item)=>item.taskId)
getTaskidResult({taskIds}).then((rv:any)=>{
//找出成功和失败的任务
let returnedTasks = rv.filter((item)=>item.status == 'RETURNED' || item.status == 'FAILED')
const returnedTasks = rv.filter((item)=>item.status == 'RETURNED' || item.status == 'FAILED')
if(returnedTasks.length == 0)return
//剔除调成功的
let taskIds_ = JSON.parse(JSON.stringify(this.taskIds))
const taskIds_ = JSON.parse(JSON.stringify(this.taskIds))
this.taskIds = taskIds_.filter(itemA =>
!returnedTasks.some(itemB => itemB.taskId === itemA.taskId)
)

View File

@@ -142,7 +142,7 @@ export class NodeManager {
copyNodeById(id: string) {
const node = this.stateManager.getNodeById(id)
let copyNode = JSON.parse(JSON.stringify(node))
const copyNode = JSON.parse(JSON.stringify(node))
const flowNode = this.stateManager.flowManager.getNodeById(id)
if (!node) return console.warn(`${id}找不到对应节点`)
if (node.data?.disableCopy) return console.warn(`${id}节点已禁用复制`)

View File

@@ -276,7 +276,7 @@ export class StateManager {
}
/** 撤回状态 */
undoState() {
var index = this.historyIndex.value - 1
const index = this.historyIndex.value - 1
const state = this.historyList.value[index]
if (!state) return
this.historyIndex.value = index
@@ -285,7 +285,7 @@ export class StateManager {
}
/** 重做状态 */
redoState() {
var index = this.historyIndex.value + 1
const index = this.historyIndex.value + 1
const state = this.historyList.value[index]
if (!state) return
this.historyIndex.value = index