车间能级提升-智能设备管理系统
zhuguifei
2025-06-06 00cf6c13531447af59a8d2121bbfb1a3a1f68c0d
eims-ui/apps/web-antd/src/views/eims/insp-plan/insp-plan-import-modal.vue
@@ -26,15 +26,21 @@
async function handleSubmit() {
  try {
    modalApi.modalLoading(true);
    if (fileList.value.length !== 1) {
    if (fileList.value.length === 0) {
      handleCancel();
      return;
    }
    const data = {
      file: fileList.value[0]!.originFileObj as Blob,
      updateSupport: unref(checked),
    };
    const { code, msg } = await inspPlanImportData(data);
    // 构建包含多个文件的请求数据,支持多文件上传
    const formData = new FormData();
    fileList.value.forEach((file) => {
      const blob = file.originFileObj as Blob;
      formData.append('files', blob); // 将多个文件以数组形式添加到表单数据中
    });
    formData.append('updateSupport', unref(checked).toString()); // 添加 updateSupport 参数
    // 调用接口上传多文件
    const { code, msg } = await inspPlanImportData(formData);
    let modal = Modal.success;
    if (code === 200) {
      emit('reload');
@@ -76,7 +82,7 @@
    <UploadDragger
      v-model:file-list="fileList"
      :before-upload="() => false"
      :max-count="1"
      :multiple="true"
      :show-upload-list="true"
      accept="application/vnd.openxmlformats-officedocument.spreadsheetml.sheet, application/vnd.ms-excel"
    >