x
This commit is contained in:
+125
-2
@@ -473,8 +473,131 @@ body {
|
||||
}
|
||||
|
||||
.upload-zone.dragover {
|
||||
border-color: var(--primary-500);
|
||||
background: var(--primary-100);
|
||||
background: #e3f2fd;
|
||||
border-color: #1976d2;
|
||||
}
|
||||
|
||||
.material-panel {
|
||||
background: #fafafa;
|
||||
border-radius: 8px;
|
||||
padding: 16px;
|
||||
margin-top: 16px;
|
||||
border: 1px solid #e0e0e0;
|
||||
}
|
||||
|
||||
.panel-header {
|
||||
margin-bottom: 16px;
|
||||
}
|
||||
|
||||
.panel-title {
|
||||
font-size: 16px;
|
||||
font-weight: 600;
|
||||
color: #333;
|
||||
}
|
||||
|
||||
.form-group {
|
||||
margin-bottom: 16px;
|
||||
}
|
||||
|
||||
.form-label {
|
||||
display: block;
|
||||
font-size: 14px;
|
||||
font-weight: 500;
|
||||
color: #555;
|
||||
margin-bottom: 8px;
|
||||
}
|
||||
|
||||
.form-select {
|
||||
width: 100%;
|
||||
padding: 10px 12px;
|
||||
font-size: 14px;
|
||||
border: 1px solid #ddd;
|
||||
border-radius: 6px;
|
||||
background: white;
|
||||
color: #333;
|
||||
cursor: pointer;
|
||||
}
|
||||
|
||||
.form-select:focus {
|
||||
outline: none;
|
||||
border-color: #1976d2;
|
||||
box-shadow: 0 0 0 2px rgba(25, 118, 210, 0.1);
|
||||
}
|
||||
|
||||
optgroup {
|
||||
font-weight: 600;
|
||||
color: #333;
|
||||
}
|
||||
|
||||
.foam-params {
|
||||
margin-top: 16px;
|
||||
padding: 16px;
|
||||
background: #fff3e0;
|
||||
border-radius: 6px;
|
||||
border: 1px solid #ffb74d;
|
||||
}
|
||||
|
||||
.param-section {
|
||||
margin-bottom: 12px;
|
||||
}
|
||||
|
||||
.param-title {
|
||||
display: block;
|
||||
font-size: 14px;
|
||||
font-weight: 600;
|
||||
color: #e65100;
|
||||
margin-bottom: 12px;
|
||||
}
|
||||
|
||||
.form-row {
|
||||
display: flex;
|
||||
gap: 16px;
|
||||
margin-bottom: 12px;
|
||||
}
|
||||
|
||||
.form-row .form-group {
|
||||
flex: 1;
|
||||
}
|
||||
|
||||
.form-range {
|
||||
width: 100%;
|
||||
height: 6px;
|
||||
border-radius: 3px;
|
||||
background: #ddd;
|
||||
outline: none;
|
||||
-webkit-appearance: none;
|
||||
}
|
||||
|
||||
.form-range::-webkit-slider-thumb {
|
||||
-webkit-appearance: none;
|
||||
width: 16px;
|
||||
height: 16px;
|
||||
border-radius: 50%;
|
||||
background: #1976d2;
|
||||
cursor: pointer;
|
||||
}
|
||||
|
||||
.range-value {
|
||||
display: inline-block;
|
||||
margin-top: 4px;
|
||||
font-size: 13px;
|
||||
color: #666;
|
||||
font-weight: 500;
|
||||
}
|
||||
|
||||
.btn-clear {
|
||||
background: none;
|
||||
border: none;
|
||||
color: #999;
|
||||
font-size: 20px;
|
||||
cursor: pointer;
|
||||
padding: 4px 8px;
|
||||
border-radius: 4px;
|
||||
}
|
||||
|
||||
.btn-clear:hover {
|
||||
background: #f5f5f5;
|
||||
color: #f44336;
|
||||
}
|
||||
|
||||
.upload-icon {
|
||||
|
||||
+75
-1
@@ -762,6 +762,13 @@ const MoldInsightView = {
|
||||
const router = useRouter();
|
||||
const state = reactive({
|
||||
selectedFile: null,
|
||||
selectedMaterial: 'ABS',
|
||||
moldParams: {
|
||||
draftAngle: 2.0,
|
||||
shrinkageRate: 0.5,
|
||||
partingPrecision: 0.1,
|
||||
cavityMatch: 95
|
||||
},
|
||||
uploading: false,
|
||||
error: "",
|
||||
currentTask: null,
|
||||
@@ -834,6 +841,7 @@ const MoldInsightView = {
|
||||
|
||||
const formData = new FormData();
|
||||
formData.append("file", state.selectedFile);
|
||||
formData.append("material", state.selectedMaterial);
|
||||
|
||||
try {
|
||||
const res = await fetch("/api/upload", {
|
||||
@@ -944,6 +952,72 @@ const MoldInsightView = {
|
||||
<div v-if="state.selectedFile" class="file-info">
|
||||
<span class="file-name">{{ state.selectedFile.name }}</span>
|
||||
<span class="file-size">{{ formatFileSize(state.selectedFile.size) }}</span>
|
||||
<button class="btn-clear" @click="state.selectedFile = null" title="清除文件">×</button>
|
||||
</div>
|
||||
|
||||
<!-- 材料选择面板 -->
|
||||
<div v-if="state.selectedFile" class="material-panel">
|
||||
<div class="panel-header">
|
||||
<span class="panel-title">📦 材料与参数设置</span>
|
||||
</div>
|
||||
|
||||
<!-- 材料类型选择 -->
|
||||
<div class="form-group">
|
||||
<label class="form-label">材料类型</label>
|
||||
<select v-model="state.selectedMaterial" class="form-select">
|
||||
<optgroup label="普通塑料">
|
||||
<option value="ABS">ABS (1.05 g/cm³)</option>
|
||||
<option value="PP">PP (0.90 g/cm³)</option>
|
||||
<option value="PE">PE (0.95 g/cm³)</option>
|
||||
<option value="PC">PC (1.20 g/cm³)</option>
|
||||
<option value="PA">PA (1.14 g/cm³)</option>
|
||||
<option value="POM">POM (1.41 g/cm³)</option>
|
||||
<option value="PMMA">PMMA (1.18 g/cm³)</option>
|
||||
<option value="PBT">PBT (1.31 g/cm³)</option>
|
||||
</optgroup>
|
||||
<optgroup label="铝泡沫材料">
|
||||
<option value="AlSi10Mg">AlSi10Mg (0.45 g/cm³) - 常用铝硅泡沫</option>
|
||||
<option value="AlSi12">AlSi12 (0.50 g/cm³) - 高强度铝泡沫</option>
|
||||
<option value="Pure Al Foam">Pure Al Foam (0.35 g/cm³) - 纯铝泡沫</option>
|
||||
<option value="AlSi7Mg">AlSi7Mg (0.40 g/cm³) - 轻质铝镁泡沫</option>
|
||||
</optgroup>
|
||||
</select>
|
||||
</div>
|
||||
|
||||
<!-- 铝泡沫参数(仅在选择泡沫材料时显示) -->
|
||||
<div v-if="isFoamMaterial(state.selectedMaterial)" class="foam-params">
|
||||
<div class="param-section">
|
||||
<span class="param-title">⚙️ 铝泡沫专用参数</span>
|
||||
|
||||
<div class="form-row">
|
||||
<div class="form-group">
|
||||
<label class="form-label">拔模角 (°)</label>
|
||||
<input type="range" v-model.number="state.moldParams.draftAngle" min="1" max="10" step="0.5" class="form-range">
|
||||
<span class="range-value">{{ state.moldParams.draftAngle }}°</span>
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
<label class="form-label">收缩率 (%)</label>
|
||||
<input type="range" v-model.number="state.moldParams.shrinkageRate" min="0.5" max="3.0" step="0.1" class="form-range">
|
||||
<span class="range-value">{{ state.moldParams.shrinkageRate }}%</span>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="form-row">
|
||||
<div class="form-group">
|
||||
<label class="form-label">分型精度 (mm)</label>
|
||||
<input type="range" v-model.number="state.moldParams.partingPrecision" min="0.01" max="1.0" step="0.01" class="form-range">
|
||||
<span class="range-value">{{ state.moldParams.partingPrecision }} mm</span>
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
<label class="form-label">型腔匹配度 (%)</label>
|
||||
<input type="range" v-model.number="state.moldParams.cavityMatch" min="80" max="100" step="1" class="form-range">
|
||||
<span class="range-value">{{ state.moldParams.cavityMatch }}%</span>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div v-if="state.error" class="error-message">{{ state.error }}</div>
|
||||
@@ -1091,7 +1165,7 @@ const ResultView = {
|
||||
return priorityMap[priority] || priority;
|
||||
};
|
||||
|
||||
return { state, formatFileSize, formatDateTime, formatNumber, getPriorityText };
|
||||
return { state, formatFileSize, formatDateTime, formatNumber, getPriorityText, isFoamMaterial };
|
||||
},
|
||||
template: `
|
||||
<div class="page-container">
|
||||
|
||||
Reference in New Issue
Block a user