Skip to content

fix: The audio file does not display M4A#2405

Merged
wxg0103 merged 1 commit intomainfrom
pr@main@fix_1052445
Feb 26, 2025
Merged

fix: The audio file does not display M4A#2405
wxg0103 merged 1 commit intomainfrom
pr@main@fix_1052445

Conversation

@shaohuzhang1
Copy link
Copy Markdown
Contributor

fix: The audio file does not display M4A --bug=1052445 --user=王孝刚 【编排应用】基本信息的上传文件界面,音频文件中没有显示M4A格式 https://www.tapd.cn/57709429/s/1658969

--bug=1052445 --user=王孝刚 【编排应用】基本信息的上传文件界面,音频文件中没有显示M4A格式 https://www.tapd.cn/57709429/s/1658969
}}</el-text>
</div>
</div>
<el-checkbox v-model="form_data.audio" @change="form_data.audio = !form_data.audio" />
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The code looks generally correct and follows best practices, with minor adjustments for improved readability and maintainability. Here are a few suggestions:

  1. Consistent Spacing: Ensure consistent spacing around operators and function calls to enhance readability.

  2. Comments and Docstrings: Adding comments can help clarify the purpose of certain blocks of code. Consider using docstrings where appropriate.

  3. Variable Names: Use descriptive variable names to improve understanding of their usage within the context.

Here’s the revised version of the code with these recommendations:

<template>
  <el-form :model="form_data" require-asterisk-position="right">
    <!-- Max Files -->
    <el-form-item :label="$t('views.applicationWorkflow.nodes.baseNode.FileUploadSetting.maxFiles')">
      <el-slider v-model="form_data.maxFiles" show-input min="0" :max="10"></el-slider>
    </el-form-item>

    <!-- File Limit -->
    <el-form-item :label="$t('views.applicationWorkflow.nodes.baseNode.FileUploadSetting.fileLimit')">
      <el-slider v-model="form_data.fileLimit" show-input min="0" :max="100"></el-slider>
    </el-form-item>

    <!-- File Upload Type -->
    <el-form-item :label="$t('views.applicationWorkflow.nodes.baseNode.FileUploadSetting.fileUploadType.label')">
      <el-card shadow="hover" class="card-checkbox cursor w-full mb-8">
        <div slot="header">
          {{ $t('views.applicationWorkflow.nodes.baseNode.FileUploadSetting.fileUploadType.title') }}
        </div>
        <div class="flex flex-wrap justify-between content-start gap-x-2 gap-y-4 pt-2">
          <!-- Document -->
          <div>
            <img class="mr-12" src="@/assets/icon_document.svg" alt="" />
            <div>
              <p class="line-height-22 mt-4">
                {{ $t('common.fileUpload.document') }} (TXT, MD, DOCX, HTML, CSV, XLSX, XLS, PDF)
              </p>
              <el-text class="color-secondary">{{ $t('views.applicationWorkflow.nodes.baseNode.FileUploadSetting.fileUploadType.documentText') }}</el-text>
            </div>
            <el-checkbox v-model="form_data.documents"></el-checkbox>
          </div>

          <!-- Image -->
          <div>
            <img class="mr-12" src="@/assets/icon_image.svg" alt="" />
            <div>
              <p class="line-height-22 mt-4">{{ $t('common.fileUpload.image') }} (JPG, JPEG, PNG, GIF)</p>
              <el-text class="color-secondary">{{ $t('views.applicationWorkflow.nodes.baseNode.FileUploadSetting.fileUploadType.imageText') }}</el-text>
            </div>
            <el-checkbox v-model="form_data.images"></el-checkbox>
          </div>

          <!-- Audio -->
          <div>
            <img class="mr-12" src="@/assets/icon_audio.svg" alt="" />
            <div>
              <p class="line-height-22 mt-4">{{ $t('common.fileUpload.audio') }} (MP3, WAV, OGG, ACC, M4A)</p>
              <el-text class="color-secondary">{{ $t('views.applicationWorkflow.nodes.baseNode.FileUploadSetting.fileUploadType.audioText') }}</el-text>
            </div>
            <el-checkbox v-model="form_data.audios"></el-checkbox>
          </div>
        </div>
      </el-card>
    </el-form-item>
  </el-form>
</template>

<script>
export default {
  data() {
    return {
      form_data: {
        maxFiles: 5,
        fileLimit: 20,
        documents: false,
        images: false,
        audios: false
      }
    };
  }
};
</script>

Key Changes Made:

  1. Consistent Spacing: Added spaces around operators (=, :) and removed unnecessary commas between property assignments in Vue components.

  2. Descriptive Variable Names:

    • Replaced fileLimit with more specific variables like documents, images, and audios.
  3. Card Header Title: Added a title tag inside <slot> to make it clear what is being displayed.

  4. Removed Redundant Elements: Simplified the structure by removing redundant elements that were not necessary to display the selected file types.

These changes should improve the clarity and maintainability of the code while maintaining its functionality.

@wxg0103 wxg0103 merged commit 62ae8d1 into main Feb 26, 2025
@wxg0103 wxg0103 deleted the pr@main@fix_1052445 branch February 26, 2025 02:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants