refactor(ui): 优化界面布局和交互体验

- 移除body的overflow:hidden样式以支持页面滚动
- 调整标签渲染页面的按钮位置和样式
- 将缺陷列表从表格改为卡片式布局
- 移除仓库类型相关代码
- 修改按钮文本从"预览标签"改为"导出标签"
This commit is contained in:
砂糖
2025-10-30 16:36:17 +08:00
parent 77ccb51672
commit 265ad2fda6
5 changed files with 182 additions and 51 deletions

View File

@@ -1,10 +1,7 @@
<template>
<div class="label-render-container">
<!-- 操作按钮 -->
<div class="action-buttons">
<el-button type="primary" @click="downloadLabelAsImage">下载标签图片</el-button>
<el-button type="primary" @click="printLabel" style="margin-left: 10px;">打印标签</el-button>
</div>
<!-- 标签预览容器 -->
<div class="preview-container" id="label-preview-container" ref="labelRef">
<ProductionTagPreview v-if="labelType === '2'" :content="content" />
@@ -13,6 +10,10 @@
<ForgeTagPreview v-if="labelType === '5'" :content="content" />
<SaltSprayTagPreview v-if="labelType === '6'" :content="content" />
</div>
<div class="action-buttons">
<el-button type="primary" @click="downloadLabelAsImage">下载标签图片</el-button>
<el-button type="primary" @click="printLabel" style="margin-left: 10px;">打印标签</el-button>
</div>
</div>
</template>
@@ -105,18 +106,17 @@ export default {
<style scoped>
.label-render-container {
width: 100%;
height: calc(100vh - 200px);
display: flex;
flex-direction: column;
/* 按钮与预览垂直排列 */
justify-content: flex-start;
align-items: center;
padding: 2rem;
padding: 1rem;
box-sizing: border-box;
}
.action-buttons {
margin-bottom: 1rem;
margin-top: 1rem;
/* 按钮与预览区的间距 */
}

View File

@@ -87,12 +87,12 @@
<el-table-column label="备注" align="center" prop="remark" />
<el-table-column label="操作" align="center" class-name="small-padding fixed-width">
<template slot-scope="scope">
<el-button size="mini" type="text" icon="el-icon-download" @click="handleDownloadQRCode(scope.row)"
<!-- <el-button size="mini" type="text" icon="el-icon-download" @click="handleDownloadQRCode(scope.row)"
v-if="qrcode">
下载二维码
</el-button>
</el-button> -->
<el-button size="mini" type="text" icon="el-icon-view" @click="handlePreviewLabel(scope.row)">
预览标签
导出标签
</el-button>
<el-button size="mini" type="text" icon="el-icon-edit" @click="handleCheck(scope.row)">修正</el-button>
<el-button size="mini" type="text" icon="el-icon-delete" @click="handleDelete(scope.row)">删除</el-button>