【issues/846】上传多个列表只显示一个
parent
f4b902011e
commit
5eeab9c448
|
@ -31,7 +31,7 @@
|
|||
</div>
|
||||
</template>
|
||||
<script lang="ts">
|
||||
import { defineComponent, PropType, ref, reactive, watchEffect, computed, unref, watch, onMounted } from 'vue';
|
||||
import { defineComponent, PropType, ref, reactive, watchEffect, computed, unref, watch, onMounted, nextTick } from 'vue';
|
||||
import { LoadingOutlined, UploadOutlined } from '@ant-design/icons-vue';
|
||||
import { useRuleFormItem } from '/@/hooks/component/useFormItem';
|
||||
import { propTypes } from '/@/utils/propTypes';
|
||||
|
@ -175,28 +175,36 @@
|
|||
*/
|
||||
function handleChange({ file, fileList, event }) {
|
||||
initTag.value = false;
|
||||
uploadFileList.value = fileList;
|
||||
// update-begin--author:liaozhiyang---date:20231116---for:【issues/846】上传多个列表只显示一个
|
||||
// uploadFileList.value = fileList;
|
||||
if (file.status === 'error') {
|
||||
createMessage.error(`${file.name} 上传失败.`);
|
||||
}
|
||||
let fileUrls = [];
|
||||
//上传完成
|
||||
let noUploadingFileCount = 0;
|
||||
if (file.status != 'uploading') {
|
||||
fileList.forEach((file) => {
|
||||
if (file.status === 'done') {
|
||||
//update-begin---author:wangshuai ---date:20221121 for:[issues/248]原生表单内使用图片组件,关闭弹窗图片组件值不会被清空------------
|
||||
initTag.value = true;
|
||||
//update-end---author:wangshuai ---date:20221121 for:[issues/248]原生表单内使用图片组件,关闭弹窗图片组件值不会被清空------------
|
||||
fileUrls.push(file.response.message);
|
||||
}
|
||||
if (file.status != 'uploading') {
|
||||
noUploadingFileCount++;
|
||||
}
|
||||
});
|
||||
if (file.status === 'removed') {
|
||||
handleDelete(file);
|
||||
}
|
||||
if (noUploadingFileCount == fileList.length) {
|
||||
state.value = fileUrls.join(',');
|
||||
emit('update:value', fileUrls.join(','));
|
||||
// update-begin---author:wangshuai ---date:20221121 for:[issues/248]原生表单内使用图片组件,关闭弹窗图片组件值不会被清空------------
|
||||
nextTick(() => {
|
||||
initTag.value = true;
|
||||
});
|
||||
// update-end---author:wangshuai ---date:20221121 for:[issues/248]原生表单内使用图片组件,关闭弹窗图片组件值不会被清空------------
|
||||
}
|
||||
}
|
||||
// emitData.value = fileUrls.join(',');
|
||||
state.value = fileUrls.join(',');
|
||||
emit('update:value', fileUrls.join(','));
|
||||
// update-end--author:liaozhiyang---date:20231116---for:【issues/846】上传多个列表只显示一个
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
Loading…
Reference in New Issue