Files
im-uniapp/components/hrm/detailPanels/seal.vue
砂糖 304c032c80 feat(HRM): 新增HRM办公模块初版并优化详情页样式
重构报销、用印、请假、出差详情页组件,统一UI风格和交互规范
- 为各字段添加语义化图标提升可读性
- 优化多行文本显示和间距布局
- 突出显示金额等关键信息
- 统一卡片样式和阴影效果
2026-02-05 13:23:16 +08:00

167 lines
5.2 KiB
Vue
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

<template>
<view class="reimburse-detail-container">
<!-- 用印类型 - 带分类图标 -->
<view class="detail-item single-item">
<text class="item-icon icon-seal-type"></text>
<view class="item-label">用印类型</view>
<view class="item-value">{{ detail.sealType || '无' }}</view>
</view>
<!-- 用印原因 - 带原因图标适配多行文 -->
<view class="detail-item single-item multi-line">
<text class="item-icon icon-reason"></text>
<view class="item-label">原因</view>
<view class="item-value">{{ detail.purpose || '无' }}</view>
</view>
<!-- 备注 - 带笔记图标适配多行文 -->
<view class="detail-item single-item multi-line">
<text class="item-icon icon-remark"></text>
<view class="item-label">备注</view>
<view class="item-value">{{ detail.remark || '无' }}</view>
</view>
<!-- 创建人 - 带用户图标 -->
<view class="detail-item single-item">
<text class="item-icon icon-user"></text>
<view class="item-label">创建人</view>
<view class="item-value">{{ detail.createBy || '无' }}</view>
</view>
<view class="detail-item single-item">
<text class="item-icon icon-user"></text>
<view class="item-label">创建时间</view>
<view class="item-value">{{ detail.createTime || '无' }}</view>
</view>
<!-- 更新人 - 带编辑用户图标最后一项自动移除下边框 -->
<view class="detail-item single-item">
<text class="item-icon icon-update-user"></text>
<view class="item-label">更新人</view>
<view class="item-value">{{ detail.updateBy || '无' }}</view>
</view>
</view>
</template>
<script>
import { getSealReq } from '@/api/hrm/seal.js'
export default {
props: {
bizId: {
type: String,
required: true
}
},
data() {
return {
detail: {}
}
},
watch: {
bizId: {
handler(newVal) {
getSealReq(newVal).then(res => {
this.detail = res.data
console.log(this.detail)
})
},
immediate: true
}
},
}
</script>
<style scoped>
/* 主容器 - 与请假/报销详情完全一致的卡片风格,精致阴影+大圆角+合理内边距 */
.reimburse-detail-container {
background: #ffffff;
border-radius: 18rpx;
margin: 20rpx 16rpx;
box-shadow: 0 4rpx 16rpx rgba(0, 0, 0, 0.05);
box-sizing: border-box;
}
/* 基础项样式 - 全局统一flex布局、行高、间距分隔线更柔和 */
.detail-item {
display: flex;
align-items: flex-start;
line-height: 48rpx;
padding: 20rpx 0;
border-bottom: 1px solid #f9f9f9;
}
/* 最后一项移除下边框,原生样式逻辑保留 */
.detail-item:last-child {
border-bottom: none;
}
/* 单独行项 - 基础适配,与统一风格保持一致 */
.single-item {
flex-direction: row;
}
/* 同行双项 - 核心布局(创建/更新时间),复用统一布局逻辑 */
.double-item {
flex-direction: row;
justify-content: space-between;
}
/* 图标样式 - 与请假/报销详情完全统一规范Unicode图标无需额外引入 */
.item-icon {
display: inline-block;
width: 32rpx;
height: 32rpx;
margin-right: 12rpx;
margin-top: 8rpx;
flex-shrink: 0; /* 固定尺寸,防止被挤压 */
color: #409eff; /* 项目统一主题色,一键全局替换 */
font-family: "iconfont";
}
/* 各字段专属语义化图标贴合用印场景Unicode格式直接使用 */
.icon-seal-apply { content: "\e767"; } /* 印章图标,贴合用印申请核心场景 */
.icon-seal-type { content: "\e645"; } /* 分类图标,适配类型选择场景 */
.icon-reason { content: "\e614"; } /* 原因图标,与其他组件保持一致 */
.icon-remark { content: "\e634"; } /* 笔记图标,适配备注场景 */
.icon-user { content: "\e6b8"; } /* 用户图标,适配创建人场景 */
.icon-create-time { content: "\e629"; }/* 时间图标,适配创建时间 */
.icon-update-time { content: "\e684"; }/* 更新图标,适配更新时间 */
.icon-update-user { content: "\e64c"; }/* 编辑用户,适配更新人场景 */
/* 标签样式 - 统一视觉规范,同行时间项标签窄化适配,保留原标签无冒号逻辑 */
.item-label {
width: 160rpx;
font-size: 30rpx;
color: #909399; /* 统一次要文字色,提升视觉层次 */
font-weight: 500;
flex-shrink: 0; /* 固定宽度,防止挤压 */
padding-top: 2rpx; /* 微调对齐,适配多行文本 */
}
/* 同行时间项标签 - 窄化宽度,适配双项同行布局 */
.time-item .item-label {
width: 100rpx;
}
/* 内容值样式 - 统一规范,弹性占比,适配所有文本场景 */
.item-value {
flex: 1;
font-size: 30rpx;
color: #333333; /* 统一主要文字色,保证可读性 */
word-break: break-all; /* 适配超长文本,防止溢出 */
line-height: 48rpx;
}
/* 多行文适配 - 用印原因/备注,加大行高提升阅读体验,与其他组件一致 */
.multi-line .item-value {
line-height: 52rpx;
padding-top: 4rpx;
}
/* 同行时间项 - 各占48%宽度,防止互相挤压,布局更稳定 */
.time-item {
display: flex;
align-items: flex-start;
width: 48%;
}
/* 竖线分隔 - 与请假/报销详情完全一致,视觉边界清晰,不混淆 */
.split-line {
width: 1px;
height: 60rpx;
background-color: #f9f9f9;
margin: 8rpx 16rpx 0;
flex-shrink: 0;
}
</style>