Authored by 王涛

Merge branch 'master-v32-xwx' into 'master'

文档管理上传代码迁移



See merge request !520
... ... @@ -581,7 +581,7 @@ export default {
proxy.$global.showMsg("请输入关键字!", "warning")
return;
}
getPage('');
getPage(props.viewTypeId);
}
... ...
<cm-dialog v-if="!isInset" title="文件上传" width="500px" :showDialogVisible="show" @hidedialog="hidedialog" @okfunc="uploadFile" okText="上传">
<template v-slot>
<!-- //start lsq 文件上传更换为单文件通过multiple值判断,:on-change="handleChange",:file-list="fileListNow" 2022-03-30-->
<el-upload
:accept="accept"
ref="upload"
:http-request="getFile"
:multiple="true"
:multiple="multiple"
:before-upload="beforeUpload"
:on-change="handleChange"
:file-list="fileListNow"
:auto-upload="false">
<template #trigger>
<el-button size="small" type="primary">{{btnText}}</el-button>
... ... @@ -25,6 +27,7 @@
</template>
</el-upload>
<div class="text-tip" style="position: absolute;bottom:30px;left: 20px;color:#f78989">
<span v-if="!multiple">单文件上传,</span>
文件上传大小限制200M
</div>
</template>
... ...
... ... @@ -46,6 +46,11 @@ export default {
type: String,
default: ''
},
//lsq 是否为多文件上传 2022-03-30
multiple:{
type: Boolean,
default: false
},
accept: {
type: String,
default: [".3gpp",
... ... @@ -140,6 +145,17 @@ export default {
}
}
//start lsq 单文件上传时 新文件覆盖旧文件 2022-03-30
let fileListNow=props.fileList?Vue.ref(props.fileList):Vue.ref([]);
let handleChange=(file, fileList)=> {
if(!props.multiple){
if (fileList.length > 0) {
fileListNow.value= [fileList[fileList.length - 1]] // 这一步,是 展示最后一次选择的文件
}
}
}
//end lsq 2022-03-30
let fileChange = (file, fileList) =>{
console.log(file, fileList);
... ... @@ -182,7 +198,9 @@ export default {
uploadFile,
hidedialog,
beforeUpload,
fileChange
fileChange,
handleChange,
fileListNow
}
}
}
... ...