spring
4 天以前 75a462f8ee30491f05d29ccac1b65d31e835957b
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
<template>
  <div class="detail-container">
    <div class="header">
      <el-button @click="handleBack" type="primary" size="small">返回</el-button>
      <h2>图书详情</h2>
    </div>
    
    <div class="content" v-loading="loading">
      <el-card v-if="current">
        <template #header>
          <div class="card-header">
            <span>基本信息</span>
          </div>
        </template>
        
        <el-descriptions :column="2" border>
          <el-descriptions-item label="图书编号">{{ current.docNumber }}</el-descriptions-item>
          <el-descriptions-item label="图书名称">{{ current.docName }}</el-descriptions-item>
          <el-descriptions-item label="入库时间">{{ current.createTime }}</el-descriptions-item>
          <!-- <el-descriptions-item label="当前位置">{{ current.currentLocation }}</el-descriptions-item> -->
          <el-descriptions-item label="状态">{{ current.docStatus }}</el-descriptions-item>
        </el-descriptions>
        
        <!-- <div class="additional-info" v-if="current.description">
          <h4>图书简介</h4>
          <p>{{ current.description }}</p>
        </div> -->
      </el-card>
      
      <el-empty v-else description="暂无数据" />
    </div>
  </div>
</template>
 
<script setup>
import { ref } from 'vue'
 
// 定义props
const props = defineProps({
  current: {
    type: Object,
    required: true
  }
})
 
// 定义emits
const emit = defineEmits(['hanldeBack'])
 
// 响应式数据
const loading = ref(false)
// const bookInfo = ref(null)
 
// 方法
const handleBack = () => {
  emit('hanldeBack')
}
 
</script>
 
<style scoped>
.detail-container {
  padding: 20px;
  height: 100%;
  background-color: #f5f5f5;
}
 
.header {
  display: flex;
  align-items: center;
  margin-bottom: 20px;
  background-color: #fff;
  padding: 15px 20px;
  border-radius: 4px;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}
 
.header h2 {
  margin: 0 0 0 20px;
  color: #333;
}
 
.content {
  background-color: #fff;
  border-radius: 4px;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}
 
.card-header {
  font-weight: bold;
  color: #333;
}
 
.additional-info {
  margin-top: 20px;
  padding-top: 20px;
  border-top: 1px solid #ebeef5;
}
 
.additional-info h4 {
  margin: 0 0 10px 0;
  color: #333;
  font-size: 16px;
}
 
.additional-info p {
  margin: 0;
  color: #666;
  line-height: 1.6;
}
</style>