|
92 | 92 | }" |
93 | 93 | format="YYYY-MM-DD" |
94 | 94 | @change="handleDateChange(index, $event)" |
95 | | - :popup-container="'body'" |
96 | 95 | /> |
97 | 96 | </div> |
98 | 97 | </div> |
@@ -1293,24 +1292,43 @@ export default { |
1293 | 1292 |
|
1294 | 1293 | // 文件夹选择处理 |
1295 | 1294 | const handleFolderSelect = (index) => { |
| 1295 | + // 创建一个隐藏的文件夹选择器 |
1296 | 1296 | const input = document.createElement('input') |
1297 | 1297 | input.type = 'file' |
1298 | 1298 | input.webkitdirectory = true |
| 1299 | + input.multiple = true |
1299 | 1300 | input.style.position = 'absolute' |
1300 | 1301 | input.style.left = '-9999px' |
| 1302 | + input.style.opacity = '0' |
1301 | 1303 | document.body.appendChild(input) |
1302 | 1304 | |
1303 | 1305 | input.addEventListener('change', (e) => { |
1304 | | - if (e.target.files && e.target.files[0]) { |
1305 | | - // 获取文件夹路径(去掉文件名) |
1306 | | - const path = e.target.files[0].webkitRelativePath |
1307 | | - const folderPath = path.substring(0, path.lastIndexOf('/')) |
1308 | | - inputValues.value[index] = folderPath || e.target.files[0].name |
| 1306 | + if (e.target.files && e.target.files.length > 0) { |
| 1307 | + // 从第一个文件的路径中提取文件夹路径 |
| 1308 | + const firstFile = e.target.files[0] |
| 1309 | + const relativePath = firstFile.webkitRelativePath |
| 1310 | + |
| 1311 | + if (relativePath) { |
| 1312 | + // 获取文件夹名称(第一级目录) |
| 1313 | + const folderName = relativePath.split('/')[0] |
| 1314 | + inputValues.value[index] = folderName |
| 1315 | + } else { |
| 1316 | + // 如果没有相对路径,使用文件名去掉扩展名 |
| 1317 | + const fileName = firstFile.name |
| 1318 | + const folderName = fileName.substring(0, fileName.lastIndexOf('.')) || fileName |
| 1319 | + inputValues.value[index] = folderName |
| 1320 | + } |
| 1321 | + |
1309 | 1322 | validateInput(index) |
1310 | 1323 | } |
1311 | 1324 | document.body.removeChild(input) |
1312 | 1325 | }) |
1313 | 1326 | |
| 1327 | + // 添加取消事件监听 |
| 1328 | + input.addEventListener('cancel', () => { |
| 1329 | + document.body.removeChild(input) |
| 1330 | + }) |
| 1331 | + |
1314 | 1332 | input.click() |
1315 | 1333 | } |
1316 | 1334 |
|
@@ -1862,9 +1880,26 @@ export default { |
1862 | 1880 |
|
1863 | 1881 | /* 确保日期选择器面板正确显示 */ |
1864 | 1882 | .date-picker-modern :deep(.arco-picker-dropdown) { |
1865 | | - z-index: 9999; |
| 1883 | + z-index: 9999 !important; |
| 1884 | +} |
| 1885 | +
|
| 1886 | +/* 修复日期选择器弹出层样式 */ |
| 1887 | +.date-picker-modern :deep(.arco-picker-panel) { |
| 1888 | + z-index: 9999 !important; |
1866 | 1889 | } |
1867 | 1890 |
|
| 1891 | +.date-picker-modern :deep(.arco-picker-popup) { |
| 1892 | + z-index: 9999 !important; |
| 1893 | +} |
| 1894 | +
|
| 1895 | +/* 确保日期选择器容器不被遮挡 */ |
| 1896 | +.date-picker-modern :deep(.arco-picker-container) { |
| 1897 | + position: relative; |
| 1898 | + z-index: 1; |
| 1899 | +} |
| 1900 | +
|
| 1901 | +
|
| 1902 | +
|
1868 | 1903 | /* 输入操作按钮 */ |
1869 | 1904 | .input-actions { |
1870 | 1905 | display: flex; |
|
0 commit comments