Skip to content

Commit 12a263c

Browse files
committed
refactor: 文件上传超过限制时禁止按钮
1 parent 5d86265 commit 12a263c

File tree

1 file changed

+5
-1
lines changed
  • ui/src/components/ai-chat/component/chat-input-operate

1 file changed

+5
-1
lines changed

ui/src/components/ai-chat/component/chat-input-operate/index.vue

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,7 @@
9393
}}
9494
</div>
9595
</template>
96-
<el-button text>
96+
<el-button text :disabled="checkMaxFilesLimit()">
9797
<el-icon><Paperclip /></el-icon>
9898
</el-button>
9999
</el-tooltip>
@@ -223,6 +223,10 @@ const getAcceptList = () => {
223223
return accepts.map((ext: any) => '.' + ext).join(',')
224224
}
225225
226+
const checkMaxFilesLimit = () => {
227+
return props.applicationDetails.file_upload_setting.maxFiles <= (uploadImageList.value.length + uploadDocumentList.value.length)
228+
}
229+
226230
const uploadFile = async (file: any, fileList: any) => {
227231
const { maxFiles, fileLimit } = props.applicationDetails.file_upload_setting
228232
// 单次上传文件数量限制

0 commit comments

Comments
 (0)