chore: fix build failure

refactor: delete /public/equiments api
This commit is contained in:
SikongJueluo 2025-05-19 22:29:28 +08:00
parent 7f37514dfa
commit 487e7c114a
3 changed files with 23 additions and 27 deletions

View File

@ -100,12 +100,6 @@ try
FileProvider = new PhysicalFileProvider(Path.Combine(Directory.GetCurrentDirectory(), "wwwroot", "assets")), FileProvider = new PhysicalFileProvider(Path.Combine(Directory.GetCurrentDirectory(), "wwwroot", "assets")),
RequestPath = "/assets" RequestPath = "/assets"
}); });
// Public Files
app.UseStaticFiles(new StaticFileOptions
{
FileProvider = new PhysicalFileProvider(Path.Combine(Directory.GetCurrentDirectory(), "wwwroot", "EquipmentTemplates")),
RequestPath = "/public/EquipmentTemplates"
});
// Log Files // Log Files
if (!Directory.Exists(Path.Combine(Directory.GetCurrentDirectory(), "log"))) if (!Directory.Exists(Path.Combine(Directory.GetCurrentDirectory(), "log")))
{ {

View File

@ -230,7 +230,7 @@ const availableTemplates = ref([
name: "PG2L100H 基础开发板", name: "PG2L100H 基础开发板",
id: "PG2L100H_Pango100pro", id: "PG2L100H_Pango100pro",
description: "包含主板和两个LED的基本设置", description: "包含主板和两个LED的基本设置",
path: "/public/EquipmentTemplates/PG2L100H_Pango100pro.json", path: "/EquipmentTemplates/PG2L100H_Pango100pro.json",
thumbnailUrl: motherboardSvg, thumbnailUrl: motherboardSvg,
}, },
]); ]);

View File

@ -1,9 +1,7 @@
<template> <template>
<div class="flex-1 h-full w-full bg-base-200 relative overflow-hidden diagram-container" ref="canvasContainer" <div class="flex-1 h-full w-full bg-base-200 relative overflow-hidden diagram-container" ref="canvasContainer"
@mousedown="handleCanvasMouseDown" @mousedown="handleCanvasMouseDown" @mousedown.middle.prevent="startMiddleDrag" @wheel.prevent="onZoom"
@mousedown.middle.prevent="startMiddleDrag" @contextmenu.prevent="handleContextMenu"> <!-- 工具栏 -->
@wheel.prevent="onZoom"
@contextmenu.prevent="handleContextMenu"> <!-- 工具栏 -->
<div class="absolute top-2 right-2 flex gap-2 z-30"> <div class="absolute top-2 right-2 flex gap-2 z-30">
<button class="btn btn-sm btn-primary" @click="openDiagramFileSelector"> <button class="btn btn-sm btn-primary" @click="openDiagramFileSelector">
<svg xmlns="http://www.w3.org/2000/svg" class="h-4 w-4 mr-1" fill="none" viewBox="0 0 24 24" <svg xmlns="http://www.w3.org/2000/svg" class="h-4 w-4 mr-1" fill="none" viewBox="0 0 24 24"
@ -27,9 +25,12 @@
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M12 4v16m8-8H4" /> <path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M12 4v16m8-8H4" />
</svg> </svg>
添加组件 添加组件
</button> <button class="btn btn-sm btn-primary" @click="emit('toggle-doc-panel')"> </button>
<svg xmlns="http://www.w3.org/2000/svg" class="h-4 w-4 mr-1" fill="none" viewBox="0 0 24 24" stroke="currentColor"> <button class="btn btn-sm btn-primary" @click="emit('toggle-doc-panel')">
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M9 12h6m-6 4h6m2 5H7a2 2 0 01-2-2V5a2 2 0 012-2h5.586a1 1 0 01.707.293l5.414 5.414a1 1 0 01.293.707V19a2 2 0 01-2 2z" /> <svg xmlns="http://www.w3.org/2000/svg" class="h-4 w-4 mr-1" fill="none" viewBox="0 0 24 24"
stroke="currentColor">
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2"
d="M9 12h6m-6 4h6m2 5H7a2 2 0 01-2-2V5a2 2 0 012-2h5.586a1 1 0 01.707.293l5.414 5.414a1 1 0 01.293.707V19a2 2 0 01-2 2z" />
</svg> </svg>
{{ props.showDocPanel ? '属性面板' : '文档' }} {{ props.showDocPanel ? '属性面板' : '文档' }}
</button> </button>
@ -63,15 +64,15 @@
'component-disabled': !component.isOn, 'component-disabled': !component.isOn,
'component-hidepins': component.hidepins, 'component-hidepins': component.hidepins,
}" :style="{ }" :style="{
top: component.y + 'px', top: component.y + 'px',
left: component.x + 'px', left: component.x + 'px',
zIndex: component.index ?? 0, zIndex: component.index ?? 0,
transform: component.rotate transform: component.rotate
? `rotate(${component.rotate}deg)` ? `rotate(${component.rotate}deg)`
: 'none', : 'none',
opacity: component.isOn ? 1 : 0.6, opacity: component.isOn ? 1 : 0.6,
display: 'block', display: 'block',
}" @mousedown.left.stop="startComponentDrag($event, component)" @mouseover="hoveredComponent = component.id" }" @mousedown.left.stop="startComponentDrag($event, component)" @mouseover="hoveredComponent = component.id"
@mouseleave="hoveredComponent = null"> @mouseleave="hoveredComponent = null">
<!-- 动态渲染组件 --> <!-- 动态渲染组件 -->
<component :is="getComponentDefinition(component.type)" v-if="props.componentModules[component.type]" <component :is="getComponentDefinition(component.type)" v-if="props.componentModules[component.type]"
@ -97,10 +98,10 @@
<!-- 通知组件 --> <!-- 通知组件 -->
<div v-if="showNotification" class="toast toast-top toast-center z-50 w-fit-content"> <div v-if="showNotification" class="toast toast-top toast-center z-50 w-fit-content">
<div :class="`alert ${notificationType === 'success' <div :class="`alert ${notificationType === 'success'
? 'alert-success' ? 'alert-success'
: notificationType === 'error' : notificationType === 'error'
? 'alert-error' ? 'alert-error'
: 'alert-info' : 'alert-info'
}`"> }`">
<span>{{ notificationMessage }}</span> <span>{{ notificationMessage }}</span>
</div> </div>
@ -162,6 +163,7 @@ const emit = defineEmits([
"component-selected", "component-selected",
"component-moved", "component-moved",
"component-delete", "component-delete",
"toggle-doc-panel",
"wire-created", "wire-created",
"wire-deleted", "wire-deleted",
"load-component-module", "load-component-module",