【issues/846】上传多个列表只显示一个
parent
f4b902011e
commit
5eeab9c448
|
@ -31,7 +31,7 @@
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
<script lang="ts">
|
<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 { LoadingOutlined, UploadOutlined } from '@ant-design/icons-vue';
|
||||||
import { useRuleFormItem } from '/@/hooks/component/useFormItem';
|
import { useRuleFormItem } from '/@/hooks/component/useFormItem';
|
||||||
import { propTypes } from '/@/utils/propTypes';
|
import { propTypes } from '/@/utils/propTypes';
|
||||||
|
@ -175,28 +175,36 @@
|
||||||
*/
|
*/
|
||||||
function handleChange({ file, fileList, event }) {
|
function handleChange({ file, fileList, event }) {
|
||||||
initTag.value = false;
|
initTag.value = false;
|
||||||
uploadFileList.value = fileList;
|
// update-begin--author:liaozhiyang---date:20231116---for:【issues/846】上传多个列表只显示一个
|
||||||
|
// uploadFileList.value = fileList;
|
||||||
if (file.status === 'error') {
|
if (file.status === 'error') {
|
||||||
createMessage.error(`${file.name} 上传失败.`);
|
createMessage.error(`${file.name} 上传失败.`);
|
||||||
}
|
}
|
||||||
let fileUrls = [];
|
let fileUrls = [];
|
||||||
//上传完成
|
let noUploadingFileCount = 0;
|
||||||
if (file.status != 'uploading') {
|
if (file.status != 'uploading') {
|
||||||
fileList.forEach((file) => {
|
fileList.forEach((file) => {
|
||||||
if (file.status === 'done') {
|
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);
|
fileUrls.push(file.response.message);
|
||||||
}
|
}
|
||||||
|
if (file.status != 'uploading') {
|
||||||
|
noUploadingFileCount++;
|
||||||
|
}
|
||||||
});
|
});
|
||||||
if (file.status === 'removed') {
|
if (file.status === 'removed') {
|
||||||
handleDelete(file);
|
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(',');
|
// update-end--author:liaozhiyang---date:20231116---for:【issues/846】上传多个列表只显示一个
|
||||||
state.value = fileUrls.join(',');
|
|
||||||
emit('update:value', fileUrls.join(','));
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
Loading…
Reference in New Issue