feat(zinc): 新增PDO接口和日期筛选组件,重构生产统计页面
refactor(api): 移除冗余API路径前缀 style(websocket): 移除重复的日志打印 feat(label): 新增原料标签组件并替换生产标签 refactor(lines): 移除废弃的流程图组件和配置 feat(utils): 新增日期范围工具函数 feat(statistic): 集成日期筛选和图表分析功能
This commit is contained in:
@@ -2,7 +2,7 @@
|
||||
<div class="label-render-container">
|
||||
<!-- 标签预览容器 -->
|
||||
<div class="preview-container" :id="hideActions ? undefined : 'label-preview-container'" ref="labelRef">
|
||||
<ProductionTagPreview
|
||||
<MaterialTag
|
||||
v-if="labelType === '2'"
|
||||
:content="content"
|
||||
:paperWidthMm="100"
|
||||
@@ -31,7 +31,7 @@ import html2canvas from 'html2canvas'; // 高清渲染
|
||||
import { Message } from 'element-ui';
|
||||
import { PDFDocument } from 'pdf-lib';
|
||||
|
||||
import ProductionTagPreview from './ProductionTagPreview.vue';
|
||||
import MaterialTag from './MaterialTag.vue';
|
||||
import OuterTagPreview from './OuterTagPreview.vue';
|
||||
import SampleTagPreview from './SampleTagPreview.vue';
|
||||
import ForgeTagPreview from './ForgeTagPreview.vue';
|
||||
@@ -40,17 +40,22 @@ import SaltSprayTagPreview from './SaltSprayTagPreview.vue';
|
||||
export default {
|
||||
name: 'LabelRender',
|
||||
components: {
|
||||
ProductionTagPreview,
|
||||
MaterialTag,
|
||||
OuterTagPreview,
|
||||
SampleTagPreview,
|
||||
ForgeTagPreview,
|
||||
SaltSprayTagPreview,
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
labelType: '2',
|
||||
}
|
||||
},
|
||||
props: {
|
||||
labelType: {
|
||||
type: String,
|
||||
required: true,
|
||||
},
|
||||
// labelType: {
|
||||
// type: String,
|
||||
// required: true,
|
||||
// },
|
||||
content: {
|
||||
type: Object,
|
||||
required: true,
|
||||
@@ -60,6 +65,27 @@ export default {
|
||||
default: false,
|
||||
},
|
||||
},
|
||||
watch: {
|
||||
content: {
|
||||
handler(newVal) {
|
||||
const { itemName, itemType } = newVal;
|
||||
if (itemType == 'raw_material') {
|
||||
this.labelType = '2';
|
||||
} else if (itemType == 'product' && itemName == '冷硬卷') {
|
||||
this.labelType = '3';
|
||||
} else if (itemType == 'product' && itemName == '热轧卷板') {
|
||||
this.labelType = '3';
|
||||
} else if (itemType == 'product' && itemName == '镀锌卷') {
|
||||
this.labelType = '3';
|
||||
} else if (itemType == 'product' && itemName == '冷轧卷') {
|
||||
this.labelType = '3';
|
||||
} else {
|
||||
this.labelType = '3';
|
||||
}
|
||||
},
|
||||
deep: true
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
// -------- 图片下载方法(保留,可按需替换为html2canvas) --------
|
||||
async downloadLabelAsImage() {
|
||||
|
||||
Reference in New Issue
Block a user