完成初版
This commit is contained in:
@@ -0,0 +1,311 @@
|
||||
/* 文件上传控件样式 */
|
||||
.file-upload-box {
|
||||
width: 100%;
|
||||
}
|
||||
.file-upload-btn {
|
||||
display: inline-flex;
|
||||
align-items: center;
|
||||
gap: 6px;
|
||||
padding: 6px 16px;
|
||||
background: #e74c3c;
|
||||
color: #fff;
|
||||
border: none;
|
||||
border-radius: 4px;
|
||||
cursor: pointer;
|
||||
font-size: 13px;
|
||||
font-weight: bold;
|
||||
transition: background 0.2s;
|
||||
}
|
||||
.file-upload-btn:hover {
|
||||
background: #c0392b;
|
||||
}
|
||||
.file-upload-btn::before {
|
||||
content: "📎";
|
||||
font-size: 14px;
|
||||
}
|
||||
|
||||
/* 已上传文件列表 */
|
||||
.file-upload-list {
|
||||
margin-top: 8px;
|
||||
}
|
||||
.file-upload-item {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
gap: 8px;
|
||||
padding: 6px 8px;
|
||||
background: #f8f9fa;
|
||||
border: 1px solid #eee;
|
||||
border-radius: 4px;
|
||||
margin-bottom: 4px;
|
||||
font-size: 12px;
|
||||
}
|
||||
.file-upload-item .file-icon {
|
||||
width: 24px;
|
||||
height: 24px;
|
||||
background: #e74c3c;
|
||||
color: #fff;
|
||||
border-radius: 4px;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
font-size: 10px;
|
||||
font-weight: bold;
|
||||
flex-shrink: 0;
|
||||
}
|
||||
.file-upload-item .file-name {
|
||||
flex: 1;
|
||||
min-width: 0;
|
||||
overflow: hidden;
|
||||
text-overflow: ellipsis;
|
||||
white-space: nowrap;
|
||||
color: #333;
|
||||
}
|
||||
.file-upload-item .file-size {
|
||||
color: #999;
|
||||
font-size: 11px;
|
||||
flex-shrink: 0;
|
||||
}
|
||||
.file-upload-item .file-del {
|
||||
color: #e74c3c;
|
||||
cursor: pointer;
|
||||
font-size: 16px;
|
||||
padding: 0 4px;
|
||||
flex-shrink: 0;
|
||||
}
|
||||
.file-upload-item .file-del:hover {
|
||||
color: #c0392b;
|
||||
}
|
||||
|
||||
/* 文件选择弹框 */
|
||||
.file-picker-overlay {
|
||||
position: fixed;
|
||||
top: 0; left: 0; right: 0; bottom: 0;
|
||||
background: rgba(0,0,0,0.5);
|
||||
z-index: 100000;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
}
|
||||
.file-picker {
|
||||
width: 700px;
|
||||
max-width: 90vw;
|
||||
max-height: 80vh;
|
||||
background: #fff;
|
||||
border-radius: 12px;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
overflow: hidden;
|
||||
box-shadow: 0 8px 32px rgba(0,0,0,0.25);
|
||||
}
|
||||
.file-picker-header {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: space-between;
|
||||
padding: 14px 20px;
|
||||
border-bottom: 1px solid #eee;
|
||||
flex-shrink: 0;
|
||||
}
|
||||
.file-picker-title {
|
||||
font-size: 16px;
|
||||
font-weight: bold;
|
||||
color: #333;
|
||||
}
|
||||
.file-picker-close {
|
||||
background: none;
|
||||
border: none;
|
||||
font-size: 22px;
|
||||
color: #888;
|
||||
cursor: pointer;
|
||||
width: 36px;
|
||||
height: 36px;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
border-radius: 50%;
|
||||
}
|
||||
.file-picker-close:hover {
|
||||
background: #f0f0f0;
|
||||
color: #333;
|
||||
}
|
||||
|
||||
/* 工具栏 */
|
||||
.file-picker-toolbar {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
gap: 8px;
|
||||
padding: 10px 20px;
|
||||
border-bottom: 1px solid #eee;
|
||||
flex-shrink: 0;
|
||||
}
|
||||
.file-picker-toolbar .breadcrumb {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
gap: 4px;
|
||||
font-size: 13px;
|
||||
color: #666;
|
||||
flex: 1;
|
||||
overflow: hidden;
|
||||
}
|
||||
.file-picker-toolbar .breadcrumb-item {
|
||||
cursor: pointer;
|
||||
color: #e74c3c;
|
||||
white-space: nowrap;
|
||||
}
|
||||
.file-picker-toolbar .breadcrumb-item:hover {
|
||||
text-decoration: underline;
|
||||
}
|
||||
.file-picker-toolbar .breadcrumb-sep {
|
||||
color: #ccc;
|
||||
}
|
||||
.file-picker-toolbar .breadcrumb-current {
|
||||
color: #333;
|
||||
font-weight: bold;
|
||||
white-space: nowrap;
|
||||
}
|
||||
.file-picker-toolbar .toolbar-btn {
|
||||
padding: 5px 10px;
|
||||
border: 1px solid #ddd;
|
||||
border-radius: 4px;
|
||||
background: #fff;
|
||||
cursor: pointer;
|
||||
font-size: 12px;
|
||||
white-space: nowrap;
|
||||
}
|
||||
.file-picker-toolbar .toolbar-btn:hover {
|
||||
border-color: #e74c3c;
|
||||
color: #e74c3c;
|
||||
}
|
||||
.file-picker-toolbar .toolbar-btn.upload-btn {
|
||||
background: #e74c3c;
|
||||
color: #fff;
|
||||
border-color: #e74c3c;
|
||||
}
|
||||
.file-picker-toolbar .toolbar-btn.upload-btn:hover {
|
||||
background: #c0392b;
|
||||
}
|
||||
|
||||
/* 文件列表 */
|
||||
.file-picker-body {
|
||||
flex: 1;
|
||||
overflow-y: auto;
|
||||
padding: 12px 20px;
|
||||
}
|
||||
.file-picker-empty {
|
||||
text-align: center;
|
||||
padding: 40px 0;
|
||||
color: #ccc;
|
||||
font-size: 14px;
|
||||
}
|
||||
.file-picker-grid {
|
||||
display: flex;
|
||||
flex-wrap: wrap;
|
||||
gap: 8px;
|
||||
}
|
||||
.file-picker-folder {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
gap: 8px;
|
||||
padding: 10px 12px;
|
||||
border: 1px solid #eee;
|
||||
border-radius: 6px;
|
||||
cursor: pointer;
|
||||
width: calc(50% - 4px);
|
||||
transition: border-color 0.15s;
|
||||
}
|
||||
.file-picker-folder:hover {
|
||||
border-color: #e74c3c;
|
||||
background: #fef8f7;
|
||||
}
|
||||
.file-picker-folder .folder-icon {
|
||||
font-size: 24px;
|
||||
flex-shrink: 0;
|
||||
}
|
||||
.file-picker-folder .folder-name {
|
||||
font-size: 13px;
|
||||
color: #333;
|
||||
overflow: hidden;
|
||||
text-overflow: ellipsis;
|
||||
white-space: nowrap;
|
||||
}
|
||||
.file-picker-file {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
gap: 8px;
|
||||
padding: 10px 12px;
|
||||
border: 1px solid #eee;
|
||||
border-radius: 6px;
|
||||
cursor: pointer;
|
||||
width: calc(50% - 4px);
|
||||
transition: border-color 0.15s;
|
||||
}
|
||||
.file-picker-file:hover {
|
||||
border-color: #e74c3c;
|
||||
background: #fef8f7;
|
||||
}
|
||||
.file-picker-file .file-icon-sm {
|
||||
width: 32px;
|
||||
height: 32px;
|
||||
background: #f0f0f0;
|
||||
border-radius: 4px;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
font-size: 11px;
|
||||
font-weight: bold;
|
||||
color: #666;
|
||||
flex-shrink: 0;
|
||||
}
|
||||
.file-picker-file .file-info {
|
||||
flex: 1;
|
||||
min-width: 0;
|
||||
}
|
||||
.file-picker-file .file-info .name {
|
||||
font-size: 13px;
|
||||
color: #333;
|
||||
overflow: hidden;
|
||||
text-overflow: ellipsis;
|
||||
white-space: nowrap;
|
||||
}
|
||||
.file-picker-file .file-info .size {
|
||||
font-size: 11px;
|
||||
color: #999;
|
||||
margin-top: 2px;
|
||||
}
|
||||
|
||||
/* 底部 */
|
||||
.file-picker-footer {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: space-between;
|
||||
padding: 12px 20px;
|
||||
border-top: 1px solid #eee;
|
||||
flex-shrink: 0;
|
||||
}
|
||||
.file-picker-footer .selected-count {
|
||||
font-size: 13px;
|
||||
color: #666;
|
||||
}
|
||||
.file-picker-footer .footer-btns {
|
||||
display: flex;
|
||||
gap: 8px;
|
||||
}
|
||||
.file-picker-footer .footer-btns button {
|
||||
padding: 8px 20px;
|
||||
border: none;
|
||||
border-radius: 6px;
|
||||
cursor: pointer;
|
||||
font-size: 13px;
|
||||
font-weight: bold;
|
||||
}
|
||||
.file-picker-footer .btn-confirm {
|
||||
background: #e74c3c;
|
||||
color: #fff;
|
||||
}
|
||||
.file-picker-footer .btn-confirm:hover {
|
||||
background: #c0392b;
|
||||
}
|
||||
.file-picker-footer .btn-cancel {
|
||||
background: #f0f0f0;
|
||||
color: #666;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user