Initial commit

This commit is contained in:
Zhongwei Li
2025-11-30 08:55:46 +08:00
commit b710247ba7
27 changed files with 6516 additions and 0 deletions

View File

@@ -0,0 +1,391 @@
/**
* 报工页面自定义样式
* 补充Tailwind CSS的样式定义
* 主题色: #02B980
*/
/* 全局样式 */
* {
box-sizing: border-box;
}
/* 主题色变量定义 */
:root {
--primary-color: #02B980;
--primary-hover: #029968;
--primary-light: #E6F7F1;
--primary-dark: #016B4A;
--primary-shadow: rgba(2, 185, 128, 0.1);
}
/* 主题色相关的通用样式 */
.btn-primary {
background-color: var(--primary-color);
color: white;
transition: background-color 0.2s ease;
}
.btn-primary:hover {
background-color: var(--primary-hover);
}
.btn-primary:disabled {
background-color: #9CA3AF;
cursor: not-allowed;
}
.border-primary {
border-color: var(--primary-color);
}
.text-primary {
color: var(--primary-color);
}
.bg-primary {
background-color: var(--primary-color);
}
.bg-primary-light {
background-color: var(--primary-light);
}
.ring-primary {
--tw-ring-color: var(--primary-color);
}
body {
font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
}
/* 下拉菜单动画 */
#work-order-dropdown {
transition: opacity 0.3s ease-in-out;
}
#work-order-dropdown.show {
display: flex !important;
flex-direction: column;
justify-content: flex-end;
}
#work-order-dropdown .bg-white {
transform: translateY(100%);
transition: transform 0.3s ease-out;
}
#work-order-dropdown.show .bg-white {
transform: translateY(0);
}
/* 下拉箭头旋转动画 */
#dropdown-arrow.rotate {
transform: rotate(90deg);
}
/* 工单列表项样式 */
.work-order-item {
padding: 12px 16px;
border-bottom: 1px solid #f3f4f6;
cursor: pointer;
transition: background-color 0.2s ease;
}
.work-order-item:hover {
background-color: #f9fafb;
}
.work-order-item:last-child {
border-bottom: none;
}
.work-order-item.selected {
background-color: var(--primary-light);
border-left: 4px solid var(--primary-color);
}
/* 输入框焦点样式增强 */
input:focus {
outline: none;
box-shadow: 0 0 0 3px rgba(2, 185, 128, 0.1);
border-color: var(--primary-color) !important;
}
/* 按钮点击效果 */
button:active {
transform: scale(0.98);
}
/* 主题色按钮悬停效果 */
button[style*="background-color: var(--primary-color)"]:hover {
background-color: var(--primary-hover) !important;
}
button[style*="border-color: var(--primary-color)"]:hover {
background-color: var(--primary-light) !important;
}
/* 复选框和单选框主题色 */
input[type="checkbox"]:checked,
input[type="radio"]:checked {
background-color: var(--primary-color) !important;
border-color: var(--primary-color) !important;
}
input[type="checkbox"]:focus,
input[type="radio"]:focus {
box-shadow: 0 0 0 3px var(--primary-shadow) !important;
border-color: var(--primary-color) !important;
}
/* 自定义CSS类 */
.hover-primary-bg:hover {
background-color: var(--primary-hover) !important;
}
.hover-primary-light-bg:hover {
background-color: var(--primary-light) !important;
}
.focus-primary-ring:focus {
--tw-ring-color: var(--primary-color) !important;
border-color: var(--primary-color) !important;
}
.checkbox-primary:checked {
background-color: var(--primary-color) !important;
border-color: var(--primary-color) !important;
}
.checkbox-primary:focus {
box-shadow: 0 0 0 3px var(--primary-shadow) !important;
border-color: var(--primary-color) !important;
}
/* 状态标签动画 */
.status-tag {
transition: transform 0.2s ease;
}
.status-tag:hover {
transform: scale(1.05);
}
/* 响应式调整 */
@media (max-width: 640px) {
/* 移动端下拉菜单全屏显示 */
#work-order-dropdown .bg-white {
min-height: 80vh;
border-radius: 16px 16px 0 0;
}
/* 移动端表单字段间距调整 */
#report-form .space-y-4 > * + * {
margin-top: 1.5rem;
}
/* 移动端工单选择区域优化 */
#work-order-selector {
margin-bottom: 1rem;
}
/* 移动端物料信息卡片优化 */
#material-info .bg-white {
padding: 1rem;
margin-bottom: 1rem;
}
/* 移动端状态标签优化 */
.status-tag {
font-size: 0.75rem;
padding: 0.25rem 0.75rem;
}
/* 移动端输入框优化 */
input[type="number"], input[type="text"] {
font-size: 16px; /* 防止iOS缩放 */
padding: 0.75rem;
}
/* 移动端按钮优化 */
#submit-btn {
padding: 1rem;
font-size: 1.125rem;
font-weight: 600;
}
}
/* 平板设备优化 */
@media (min-width: 641px) and (max-width: 1024px) {
/* 平板端下拉菜单适配 */
#work-order-dropdown .bg-white {
min-height: 60vh;
max-width: 600px;
margin: 0 auto;
border-radius: 12px;
margin-top: 10vh;
}
/* 平板端表单布局优化 */
#report-form .bg-white {
max-width: 500px;
margin: 0 auto;
}
}
/* 大屏设备优化 */
@media (min-width: 1025px) {
/* 桌面端容器最大宽度 */
#app {
max-width: 480px;
margin: 0 auto;
box-shadow: 0 0 20px rgba(0, 0, 0, 0.1);
}
/* 桌面端下拉菜单 */
#work-order-dropdown .bg-white {
max-width: 480px;
margin: 0 auto;
border-radius: 12px;
margin-top: 5vh;
min-height: 50vh;
}
}
/* 横屏适配 */
@media (orientation: landscape) and (max-height: 600px) {
/* 横屏时减少垂直间距 */
#header-nav {
padding: 0.5rem 1rem;
}
main {
padding: 1rem;
}
#work-order-dropdown .bg-white {
min-height: 70vh;
}
#empty-state {
padding: 2rem 0;
}
#empty-state .w-48 {
width: 8rem;
height: 8rem;
}
}
/* 高分辨率屏幕优化 */
@media (-webkit-min-device-pixel-ratio: 2), (min-resolution: 192dpi) {
/* 高分辨率屏幕下的图标和边框优化 */
.border {
border-width: 0.5px;
}
svg {
shape-rendering: geometricPrecision;
}
}
/* 深色模式支持 */
@media (prefers-color-scheme: dark) {
/* 可以添加深色模式样式 */
/* 目前保持浅色主题 */
}
/* 减少动画偏好 */
@media (prefers-reduced-motion: reduce) {
* {
animation-duration: 0.01ms !important;
animation-iteration-count: 1 !important;
transition-duration: 0.01ms !important;
}
#work-order-dropdown,
#work-order-dropdown .bg-white,
#dropdown-arrow {
transition: none !important;
}
}
/* 触摸设备优化 */
@media (pointer: coarse) {
/* 增大触摸目标 */
button, .cursor-pointer {
min-height: 44px;
min-width: 44px;
}
/* 工单列表项触摸优化 */
.work-order-item {
padding: 1rem;
min-height: 60px;
}
/* 输入框触摸优化 */
input, select, textarea {
min-height: 44px;
}
}
/* 无障碍优化 */
@media (prefers-contrast: high) {
/* 高对比度模式 */
.border-gray-300 {
border-color: #000 !important;
}
.text-gray-500 {
color: #333 !important;
}
.bg-gray-50 {
background-color: #fff !important;
}
}
/* 加载状态样式 */
.loading {
position: relative;
overflow: hidden;
}
.loading::after {
content: '';
position: absolute;
top: 0;
left: -100%;
width: 100%;
height: 100%;
background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.4), transparent);
animation: loading 1.5s infinite;
}
@keyframes loading {
0% {
left: -100%;
}
100% {
left: 100%;
}
}
/* 滚动条样式 */
#work-order-list::-webkit-scrollbar {
width: 4px;
}
#work-order-list::-webkit-scrollbar-track {
background: #f1f5f9;
}
#work-order-list::-webkit-scrollbar-thumb {
background: #cbd5e1;
border-radius: 2px;
}
#work-order-list::-webkit-scrollbar-thumb:hover {
background: #94a3b8;
}