diff --git a/ruoyi-ui/src/views/ccdiProject/components/detail/UploadData.vue b/ruoyi-ui/src/views/ccdiProject/components/detail/UploadData.vue index 7a23272..2e3dc5e 100644 --- a/ruoyi-ui/src/views/ccdiProject/components/detail/UploadData.vue +++ b/ruoyi-ui/src/views/ccdiProject/components/detail/UploadData.vue @@ -245,6 +245,7 @@ multiple :auto-upload="false" :on-change="handleBatchFileChange" + :show-file-list="false" :file-list="selectedFiles" > diff --git a/ruoyi-ui/tests/unit/upload-data-batch-upload.test.js b/ruoyi-ui/tests/unit/upload-data-batch-upload.test.js new file mode 100644 index 0000000..911d314 --- /dev/null +++ b/ruoyi-ui/tests/unit/upload-data-batch-upload.test.js @@ -0,0 +1,31 @@ +const assert = require("assert"); +const fs = require("fs"); +const path = require("path"); + +const componentPath = path.resolve( + __dirname, + "../../src/views/ccdiProject/components/detail/UploadData.vue" +); +const source = fs.readFileSync(componentPath, "utf8"); + +const dialogIndex = source.indexOf(':visible.sync="batchUploadDialogVisible"'); +assert.notStrictEqual(dialogIndex, -1, "未找到批量上传流水文件弹窗"); + +const dialogEndIndex = source.indexOf("", dialogIndex); +assert.notStrictEqual(dialogEndIndex, -1, "未找到批量上传流水文件弹窗结束标签"); + +const dialogSource = source.slice(dialogIndex, dialogEndIndex); +const uploadMatch = dialogSource.match(//); +assert(uploadMatch, "未找到批量上传区域的 el-upload 组件"); + +assert( + /(:show-file-list|show-file-list)\s*=\s*"false"/.test(uploadMatch[1]), + "批量上传区域必须关闭 el-upload 默认文件列表,避免与自定义文件列表重复显示" +); + +assert( + /class="selected-files"/.test(dialogSource), + "批量上传弹窗应保留自定义已选文件列表" +); + +console.log("upload-data-batch-upload test passed");