0602
This commit is contained in:
@@ -0,0 +1,92 @@
|
||||
<template>
|
||||
<uni-card padding="0">
|
||||
<view class="records-section">
|
||||
<view class="section-header">
|
||||
<text class="section-title">{{ title }}</text>
|
||||
</view>
|
||||
|
||||
<!-- 无数据 -->
|
||||
<view v-if="records.length === 0" class="empty-state">
|
||||
<text class="empty-text">{{ emptyText }}</text>
|
||||
</view>
|
||||
<!-- 列表 -->
|
||||
<view v-else class="record-list">
|
||||
<view class="record-card" v-for="(item, idx) in records" :key="idx">
|
||||
<text class="record-text">{{ item }}</text>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</uni-card>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
/**
|
||||
* 出入库历史列表组件
|
||||
*/
|
||||
export default {
|
||||
name: 'InoutHistory',
|
||||
props: {
|
||||
// 标题
|
||||
title: { type: String, default: '历史记录' },
|
||||
records: {
|
||||
type: Array,
|
||||
default: () => []
|
||||
},
|
||||
// 空数据提示
|
||||
emptyText: { type: String, default: '暂无历史记录' }
|
||||
},
|
||||
|
||||
}
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
.records-section {
|
||||
padding-top: 8px;
|
||||
min-height: 200rpx;
|
||||
}
|
||||
|
||||
.section-header {
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
align-items: center;
|
||||
margin-bottom: 12px;
|
||||
}
|
||||
|
||||
.section-title {
|
||||
font-size: 14px;
|
||||
font-weight: 500;
|
||||
color: #333;
|
||||
}
|
||||
|
||||
.empty-state {
|
||||
padding: 20px 16px;
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
.empty-text {
|
||||
font-size: 13px;
|
||||
color: #999;
|
||||
}
|
||||
|
||||
.record-list {
|
||||
// padding: 0 16px;
|
||||
}
|
||||
|
||||
.record-card {
|
||||
background: #fff;
|
||||
border-radius: 8px;
|
||||
margin-bottom: 10px;
|
||||
box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
|
||||
font-size: 13px;
|
||||
padding: 12px;
|
||||
}
|
||||
|
||||
.record-text {
|
||||
font-size: 13px;
|
||||
color: #333;
|
||||
flex: 1;
|
||||
overflow: hidden;
|
||||
text-overflow: ellipsis;
|
||||
white-space: nowrap;
|
||||
}
|
||||
</style>
|
||||
@@ -0,0 +1,69 @@
|
||||
<template>
|
||||
<div class="loading-mask" v-if="show">
|
||||
<div class="loading-content">
|
||||
<div class="loading-spinner"></div>
|
||||
<p class="loading-text">{{ text || '加载中...' }}</p>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
export default {
|
||||
name: 'LoadingMask',
|
||||
props: {
|
||||
show: {
|
||||
type: Boolean,
|
||||
default: false
|
||||
},
|
||||
text: {
|
||||
type: String,
|
||||
default: '加载中...'
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
.loading-mask {
|
||||
position: fixed;
|
||||
top: 0;
|
||||
left: 0;
|
||||
right: 0;
|
||||
bottom: 0;
|
||||
background: rgba(0, 0, 0, 0.5);
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
z-index: 9999;
|
||||
}
|
||||
|
||||
.loading-content {
|
||||
background: white;
|
||||
border-radius: 15rpx;
|
||||
padding: 40rpx;
|
||||
text-align: center;
|
||||
box-shadow: 0 4rpx 20rpx rgba(0, 0, 0, 0.2);
|
||||
min-width: 200rpx;
|
||||
}
|
||||
|
||||
.loading-spinner {
|
||||
width: 60rpx;
|
||||
height: 60rpx;
|
||||
margin: 0 auto 20rpx;
|
||||
border: 6rpx solid #f3f3f3;
|
||||
border-top: 6rpx solid #007AFF;
|
||||
border-radius: 50%;
|
||||
animation: spin 1s linear infinite;
|
||||
}
|
||||
|
||||
@keyframes spin {
|
||||
0% { transform: rotate(0deg); }
|
||||
100% { transform: rotate(360deg); }
|
||||
}
|
||||
|
||||
.loading-text {
|
||||
font-size: 28rpx;
|
||||
color: #333;
|
||||
margin: 0;
|
||||
}
|
||||
</style>
|
||||
@@ -0,0 +1,125 @@
|
||||
<template>
|
||||
<uni-card padding="0">
|
||||
<view class="records-section">
|
||||
<view class="section-header">
|
||||
<text class="section-title">{{ title }}</text>
|
||||
<text class="clear-btn" @click="$emit('clear')">清空</text>
|
||||
</view>
|
||||
<view v-if="records.length === 0" class="empty-state">
|
||||
<text class="empty-text">{{ emptyText }}</text>
|
||||
</view>
|
||||
<view v-else class="record-card" v-for="(record, idx) in records" :key="idx">
|
||||
<view class="record-header">
|
||||
<text class="record-status" :class="record.status">{{ record.message }}</text>
|
||||
<text class="record-code">{{ record.digitalId }}</text>
|
||||
<text class="record-time">{{ record.time }}</text>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</uni-card>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
export default {
|
||||
name: 'ScanRecords',
|
||||
props: {
|
||||
records: {
|
||||
type: Array,
|
||||
default: () => []
|
||||
},
|
||||
title: {
|
||||
type: String,
|
||||
default: '扫码记录'
|
||||
},
|
||||
emptyText: {
|
||||
type: String,
|
||||
default: '暂无记录'
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
.records-section {
|
||||
padding-top: 8px;
|
||||
min-height: 200rpx;
|
||||
}
|
||||
|
||||
.section-header {
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
align-items: center;
|
||||
margin-bottom: 12px;
|
||||
// padding: 0 16px;
|
||||
}
|
||||
|
||||
.section-title {
|
||||
font-size: 14px;
|
||||
font-weight: 500;
|
||||
color: #333;
|
||||
}
|
||||
|
||||
.clear-btn {
|
||||
font-size: 13px;
|
||||
color: #666;
|
||||
padding: 4px 12px;
|
||||
}
|
||||
|
||||
.empty-state {
|
||||
padding: 20px 16px;
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
.empty-text {
|
||||
font-size: 13px;
|
||||
color: #999;
|
||||
}
|
||||
|
||||
.record-card {
|
||||
background: #fff;
|
||||
border-radius: 8px;
|
||||
// margin: 0 16px 10px;
|
||||
box-shadow: 0 1px 3px rgba(0,0,0,0.08);
|
||||
font-size: 13px;
|
||||
padding: 12px;
|
||||
}
|
||||
|
||||
.record-header {
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
align-items: center;
|
||||
}
|
||||
|
||||
.record-code {
|
||||
color: #333;
|
||||
flex: 1;
|
||||
overflow: hidden;
|
||||
text-overflow: ellipsis;
|
||||
white-space: nowrap;
|
||||
margin-right: 8px;
|
||||
margin-left: 8px;
|
||||
}
|
||||
|
||||
.record-status {
|
||||
min-width: 50px;
|
||||
}
|
||||
|
||||
.record-status.success {
|
||||
color: #52c41a;
|
||||
}
|
||||
|
||||
.record-status.error {
|
||||
color: #ff6b00;
|
||||
}
|
||||
|
||||
.record-status.scan {
|
||||
color: #999;
|
||||
}
|
||||
|
||||
.record-time {
|
||||
font-size: 12px;
|
||||
color: #999;
|
||||
min-width: 70px;
|
||||
text-align: right;
|
||||
}
|
||||
</style>
|
||||
Reference in New Issue
Block a user