|
@@ -43,12 +43,12 @@
|
|
:multiple="false"
|
|
:multiple="false"
|
|
drag
|
|
drag
|
|
:limit="1"
|
|
:limit="1"
|
|
- :disabled="!!file"
|
|
|
|
:before-upload="upload"
|
|
:before-upload="upload"
|
|
:file-list="fileList"
|
|
:file-list="fileList"
|
|
:http-request="uploadNewFile"
|
|
:http-request="uploadNewFile"
|
|
:on-success="handleSuccess"
|
|
:on-success="handleSuccess"
|
|
:on-preview="previewFile"
|
|
:on-preview="previewFile"
|
|
|
|
+ :on-exceed="handleExceed"
|
|
:accept="accept"
|
|
:accept="accept"
|
|
:before-remove="removeFile"
|
|
:before-remove="removeFile"
|
|
>
|
|
>
|
|
@@ -142,6 +142,9 @@ const formatDesc = computed(() => {
|
|
const handleSuccess = (option) => {
|
|
const handleSuccess = (option) => {
|
|
console.log('handleSuccess', option);
|
|
console.log('handleSuccess', option);
|
|
}
|
|
}
|
|
|
|
+const handleExceed = (option) => {
|
|
|
|
+ ElMessage.error("只能上传1个文件!");
|
|
|
|
+}
|
|
|
|
|
|
const handleAdd = async () => {
|
|
const handleAdd = async () => {
|
|
let fileId = await addCaseScenes({formats: props.fileInfo?.formats || [".jpg", ".jpeg", ".png", '.mp4']});
|
|
let fileId = await addCaseScenes({formats: props.fileInfo?.formats || [".jpg", ".jpeg", ".png", '.mp4']});
|
|
@@ -169,7 +172,7 @@ watchEffect(() => {
|
|
defineExpose<QuiskExpose>({
|
|
defineExpose<QuiskExpose>({
|
|
async submit() {
|
|
async submit() {
|
|
let filesTypeId = caseFile.value.filesTypeId && Array.isArray(caseFile.value.filesTypeId)?caseFile.value.filesTypeId.slice(-1):caseFile.value.filesTypeId
|
|
let filesTypeId = caseFile.value.filesTypeId && Array.isArray(caseFile.value.filesTypeId)?caseFile.value.filesTypeId.slice(-1):caseFile.value.filesTypeId
|
|
- console.log('filesTypeId', caseFile.value, filesTypeId);
|
|
|
|
|
|
+ console.log('filesTypeId', file.value, filesTypeId);
|
|
if (!file.value && caseFile.value.filesType == 1 || caseFile.value.filesType == 0 && mtkList.value.length == 0) {
|
|
if (!file.value && caseFile.value.filesType == 1 || caseFile.value.filesType == 0 && mtkList.value.length == 0) {
|
|
ElMessage.error("请上传文件");
|
|
ElMessage.error("请上传文件");
|
|
throw "请上传文件";
|
|
throw "请上传文件";
|