feat: add header style for all pages

This commit is contained in:
2025-09-19 00:24:58 +08:00
parent a0ce2f8cb4
commit 826af89c81
4 changed files with 106 additions and 1 deletions
+37
View File
@@ -195,6 +195,43 @@ export default {
</script> </script>
<style scoped> <style scoped>
.el-header {
background-color: #ffffff;
box-shadow: 0 2px 4px rgba(0,0,0,.12), 0 0 6px rgba(0,0,0,.04);
height: 60px !important;
display: flex;
align-items: center;
padding: 0 20px;
position: sticky;
top: 0;
z-index: 1000;
}
.header-content {
display: flex;
align-items: center;
justify-content: space-between;
width: 100%;
}
.logo {
color: #409eff;
font-size: 20px;
font-weight: bold;
margin: 0;
}
.nav-menu {
border-bottom: none;
background-color: transparent;
}
.nav-menu .el-menu-item {
border-bottom: none;
height: 60px;
line-height: 60px;
}
.dashboard { .dashboard {
padding: 20px; padding: 20px;
} }
+19
View File
@@ -220,6 +220,25 @@ export default {
</script> </script>
<style scoped> <style scoped>
.el-header {
background-color: #ffffff;
box-shadow: 0 2px 4px rgba(0,0,0,.12), 0 0 6px rgba(0,0,0,.04);
height: 60px !important;
display: flex;
align-items: center;
padding: 0 20px;
position: sticky;
top: 0;
z-index: 1000;
}
.header-content {
display: flex;
align-items: center;
justify-content: space-between;
width: 100%;
}
.item-detail { .item-detail {
padding: 20px; padding: 20px;
} }
+31 -1
View File
@@ -296,7 +296,18 @@ export default {
async saveItem() { async saveItem() {
try { try {
await this.$refs.itemForm.validate() await this.$refs.itemForm.validate()
await itemService.createItem(this.newItem)
const itemData = { ...this.newItem }
// 格式化购买日期
if (itemData.purchase_date) {
const date = new Date(itemData.purchase_date)
itemData.purchase_date = date.getFullYear() + '-' +
String(date.getMonth() + 1).padStart(2, '0') + '-' +
String(date.getDate()).padStart(2, '0')
}
await itemService.createItem(itemData)
ElMessage.success('物品添加成功') ElMessage.success('物品添加成功')
this.showAddDialog = false this.showAddDialog = false
this.newItem = { this.newItem = {
@@ -364,6 +375,25 @@ export default {
</script> </script>
<style scoped> <style scoped>
.el-header {
background-color: #ffffff;
box-shadow: 0 2px 4px rgba(0,0,0,.12), 0 0 6px rgba(0,0,0,.04);
height: 60px !important;
display: flex;
align-items: center;
padding: 0 20px;
position: sticky;
top: 0;
z-index: 1000;
}
.header-content {
display: flex;
align-items: center;
justify-content: space-between;
width: 100%;
}
.item-list { .item-list {
padding: 20px; padding: 20px;
} }
+19
View File
@@ -312,6 +312,25 @@ export default {
</script> </script>
<style scoped> <style scoped>
.el-header {
background-color: #ffffff;
box-shadow: 0 2px 4px rgba(0,0,0,.12), 0 0 6px rgba(0,0,0,.04);
height: 60px !important;
display: flex;
align-items: center;
padding: 0 20px;
position: sticky;
top: 0;
z-index: 1000;
}
.header-content {
display: flex;
align-items: center;
justify-content: space-between;
width: 100%;
}
.item-usage { .item-usage {
padding: 20px; padding: 20px;
} }