- 重构扫码页面结构,采用标签页形式组织功能模块 - 新增分卷录入功能组件(apart.vue)和基础录入功能组件(typing.vue) - 新增物料选择组件(klp-product-select)和标签页组件(klp-tabs) - 新增WMS相关API接口(product.js, warehouse.js等) - 更新uni-data-select组件支持多选和插槽功能 - 更新uni-icons和uni-load-more组件版本及功能 - 移除冗余样式和代码,优化现有组件结构 refactor(组件): 优化acidity.vue组件使用新的标签页组件 style: 移除冗余CSS样式代码 chore: 更新多个uni_modules组件的package.json版本号
274 lines
7.8 KiB
Vue
274 lines
7.8 KiB
Vue
<template>
|
||
<view>
|
||
<view class="tab">
|
||
<uni-data-checkbox
|
||
mode="tag"
|
||
selectedColor="#2bf"
|
||
v-model="currentTab"
|
||
:localdata="tabData"
|
||
></uni-data-checkbox>
|
||
</view>
|
||
|
||
<scroll-view scroll-y v-if="currentTab === 1">
|
||
<view class="content-card">
|
||
<k-metric-card
|
||
:items="status"
|
||
:columns="2"
|
||
></k-metric-card>
|
||
</view>
|
||
|
||
<view class="content-card">
|
||
<klp-collapse-panel title="状态统计">
|
||
<qiun-data-charts type="line" :chartData="chartData" />
|
||
</klp-collapse-panel>
|
||
</view>
|
||
|
||
<view class="content-card">
|
||
<klp-collapse-panel title="轧机状态">
|
||
<qiun-data-charts type="column" :chartData="chartData" />
|
||
</klp-collapse-panel>
|
||
</view>
|
||
|
||
<view class="content-card">
|
||
<klp-collapse-panel title="机组跟踪">
|
||
<view style="padding: 30rpx; display: flex; flex-direction: column; align-items: stretch; justify-content: center; gap: 20rpx;">
|
||
<view style="display: flex; justify-content: space-between; align-items: center; padding: 20rpx; background-color: #d9edf6; border-radius: 10rpx;">
|
||
<text>轧机</text>
|
||
<text>6390000</text>
|
||
</view>
|
||
|
||
<view style="border-radius: 10rpx; overflow: hidden;">
|
||
<view style="display: flex; justify-content: space-between; align-items: center; padding: 20rpx; background-color: #d9edf6; border: 1px solid #d9edf6;">
|
||
<text>圆剪盘</text>
|
||
<text>6390000</text>
|
||
</view>
|
||
<view class="info-container">
|
||
<view class="info-row">
|
||
<view class="info-item">
|
||
<text class="info-label">设备编号:</text>
|
||
<text class="info-value">M-001</text>
|
||
</view>
|
||
<view class="info-item">
|
||
<text class="info-label">运行状态:</text>
|
||
<text class="info-value">正常</text>
|
||
</view>
|
||
</view>
|
||
|
||
<view class="info-row">
|
||
<view class="info-item">
|
||
<text class="info-label">当前产量:</text>
|
||
<text class="info-value">2580 件</text>
|
||
</view>
|
||
<view class="info-item">
|
||
<text class="info-label">合格率:</text>
|
||
<text class="info-value">98.5%</text>
|
||
</view>
|
||
</view>
|
||
</view>
|
||
</view>
|
||
|
||
<view style="display: flex; justify-content: space-between; align-items: center; padding: 20rpx; background-color: #d9edf6; border-radius: 10rpx;">
|
||
<text>酸洗</text>
|
||
<text>6390000</text>
|
||
</view>
|
||
|
||
<view style="border-radius: 10rpx; overflow: hidden;">
|
||
<view style="display: flex; justify-content: space-between; align-items: center; padding: 20rpx; background-color: #d9edf6; border: 1px solid #d9edf6;">
|
||
<text>入口活套</text>
|
||
<text>6390000</text>
|
||
</view>
|
||
<view class="info-container">
|
||
<view class="info-row">
|
||
<view class="info-item">
|
||
<text class="info-label">设备编号:</text>
|
||
<text class="info-value">M-001</text>
|
||
</view>
|
||
<view class="info-item">
|
||
<text class="info-label">运行状态:</text>
|
||
<text class="info-value">正常</text>
|
||
</view>
|
||
</view>
|
||
|
||
<view class="info-row">
|
||
<view class="info-item">
|
||
<text class="info-label">当前产量:</text>
|
||
<text class="info-value">2580 件</text>
|
||
</view>
|
||
<view class="info-item">
|
||
<text class="info-label">合格率:</text>
|
||
<text class="info-value">98.5%</text>
|
||
</view>
|
||
</view>
|
||
</view>
|
||
</view>
|
||
</view>
|
||
</klp-collapse-panel>
|
||
</view>
|
||
|
||
<view class="content-card">
|
||
<klp-collapse-panel title="能耗">
|
||
<view class="metric-container">
|
||
<!-- 网络状态指标 -->
|
||
<view class="metric-item">
|
||
<view class="metric-value">
|
||
9.9
|
||
</view>
|
||
<view class="metric-label">
|
||
工艺缎带钢线速度
|
||
</view>
|
||
</view>
|
||
|
||
<!-- 班组指标 -->
|
||
<view class="metric-item">
|
||
<view class="metric-value team-number">
|
||
126.0
|
||
</view>
|
||
<view class="metric-label">
|
||
轧机出口带钢线速度
|
||
</view>
|
||
</view>
|
||
</view>
|
||
</klp-collapse-panel>
|
||
</view>
|
||
</scroll-view>
|
||
|
||
<scroll-view scroll-y v-if="currentTab == 2">
|
||
<klp-product-statistic></klp-product-statistic>
|
||
</scroll-view>
|
||
|
||
<scroll-view scroll-y v-if="currentTab == 3">
|
||
<klp-shutdown-statistic></klp-shutdown-statistic>
|
||
</scroll-view>
|
||
|
||
<scroll-view scroll-y v-if="currentTab == 4">
|
||
<klp-team-performance></klp-team-performance>
|
||
</scroll-view>
|
||
</view>
|
||
</template>
|
||
|
||
<script>
|
||
export default {
|
||
// 响应式数据(替代 Vue 3 的 ref)
|
||
data() {
|
||
return {
|
||
currentTab: 1, // 当前选中的标签页
|
||
status: [ // 状态指标数据(供 k-metric-card 使用)
|
||
{ label: '网络状态', value: '正常' },
|
||
{ label: '当前班组', value: '乙 / 中' }
|
||
],
|
||
chartData: {} // 图表数据(初始化空对象)
|
||
}
|
||
},
|
||
// 生命周期钩子(替代 Vue 3 的 onMounted)
|
||
mounted() {
|
||
this.getServerData() // 页面挂载后加载数据
|
||
},
|
||
// 方法定义(所有函数需放在 methods 中)
|
||
methods: {
|
||
// 模拟从服务器获取数据
|
||
getServerData() {
|
||
setTimeout(() => {
|
||
const res = {
|
||
categories: ['2016', '2017', '2018', '2019', '2020', '2021'],
|
||
series: [
|
||
{ name: '目标值', data: [35, 36, 31, 33, 13, 34] },
|
||
{ name: '完成量', data: [18, 27, 21, 24, 6, 28] }
|
||
]
|
||
}
|
||
// 深拷贝避免引用问题(Vue 2 响应式兼容)
|
||
this.chartData = JSON.parse(JSON.stringify(res))
|
||
}, 500)
|
||
}
|
||
}
|
||
}
|
||
</script>
|
||
|
||
<style scoped lang="scss">
|
||
page {
|
||
background-color: #b2b2b2;
|
||
height: 100vh;
|
||
overflow: auto;
|
||
}
|
||
|
||
view-scroll {
|
||
gap: 30rpx;
|
||
}
|
||
|
||
.tab {
|
||
margin: auto;
|
||
display: flex;
|
||
box-sizing: border-box;
|
||
justify-content: center;
|
||
top: 88rpx;
|
||
z-index: 999;
|
||
background-color: #fff;
|
||
}
|
||
|
||
.content-card {
|
||
background-color: white;
|
||
}
|
||
|
||
.metric-container {
|
||
display: flex;
|
||
justify-content: space-around;
|
||
background-color: white;
|
||
}
|
||
|
||
.metric-item {
|
||
flex: 1;
|
||
text-align: center;
|
||
padding: 32rpx;
|
||
border-radius: 12rpx;
|
||
transition: all 0.3s;
|
||
}
|
||
|
||
.metric-value {
|
||
font-size: 48rpx;
|
||
font-weight: 600;
|
||
margin-bottom: 16rpx;
|
||
line-height: 1.2;
|
||
}
|
||
|
||
.metric-label {
|
||
font-size: 28rpx;
|
||
color: #666;
|
||
letter-spacing: 2rpx;
|
||
}
|
||
|
||
/** 机组跟踪信息容器样式 */
|
||
.info-container {
|
||
padding: 20rpx;
|
||
background: #fff;
|
||
border-radius: 12rpx;
|
||
}
|
||
|
||
.info-row {
|
||
display: flex;
|
||
justify-content: space-between;
|
||
margin-bottom: 24rpx;
|
||
|
||
&:last-child {
|
||
margin-bottom: 0;
|
||
}
|
||
}
|
||
|
||
.info-item {
|
||
flex: 0 0 48%; /* 留出4%的间隔,避免内容溢出 */
|
||
display: flex;
|
||
align-items: baseline; /* 文字基线对齐,保证排版整齐 */
|
||
}
|
||
|
||
.info-label {
|
||
color: #666;
|
||
font-size: 28rpx;
|
||
flex-shrink: 0;
|
||
margin-right: 16rpx;
|
||
}
|
||
|
||
.info-value {
|
||
color: #333;
|
||
font-size: 30rpx;
|
||
font-weight: 500;
|
||
word-break: break-all; /* 长文本自动换行,防止超出容器 */
|
||
}
|
||
</style> |