附件格式
This commit is contained in:
@@ -34,7 +34,7 @@
|
||||
|
||||
export default {
|
||||
name: 'file',
|
||||
props: ['disableds', 'disabled', 'thisFileUploadUrl', 'readonly', 'thisFileType', 'isUploadFile', 'isMultiple', 'restrictUploads', 'Uploadable'],
|
||||
props: ['disableds', 'disabled', 'thisFileUploadUrl','accept', 'readonly', 'thisFileType', 'isUploadFile', 'isMultiple', 'restrictUploads', 'Uploadable'],
|
||||
data() {
|
||||
return {
|
||||
visible: false,
|
||||
@@ -88,6 +88,16 @@
|
||||
// let thisFileType = this.thisFileType.replace(/\s+/g, "");
|
||||
console.log(file)
|
||||
this.fileTypeSatus = true
|
||||
//根据格式拦截
|
||||
if(this.accept){
|
||||
let fileNames = file.name.split('.')
|
||||
let fileType = fileNames[fileNames.length - 1].toLocaleLowerCase()
|
||||
let extList = this.accept.split(',')
|
||||
if (!extList.find((item) => item == fileType)) {
|
||||
this.$message.error(this.$t('uploadOnly') + this.accept + this.$t('type'))
|
||||
reject(false)
|
||||
}
|
||||
}
|
||||
if (this.isMultiple) {
|
||||
if ((this.myfileList && this.myfileList.length == 1) || this.myfileList && this.myfileList.length > 1) {
|
||||
this.$message.warning(this.$t('onlyOnefileUploaded'))
|
||||
@@ -121,6 +131,7 @@
|
||||
// }else{
|
||||
// this.fileTypeSatus = false;
|
||||
// }
|
||||
// }
|
||||
// }
|
||||
this.$message.destroy()
|
||||
},
|
||||
|
||||
@@ -45,7 +45,7 @@
|
||||
:placeholder="$t('PleaseSelect')"
|
||||
:type="'select'"
|
||||
:triggerChange="false"
|
||||
:dictCode="record.dictCode"
|
||||
:dictCode="'driving_automation_level'"
|
||||
v-model="record.jszdhjb"/>
|
||||
</span>
|
||||
<!-- 技术参数-->
|
||||
|
||||
+1
-1
@@ -34,7 +34,7 @@
|
||||
<a-button type="primary" style='width: 73px;margin-right: 50px' @click="last">{{ $t('last') }}</a-button>
|
||||
<a-button type="primary" style='width: 73px' @click='next'>{{ $t('next') }}</a-button>
|
||||
</div>
|
||||
<uploadFile ref="uploadFile" @uploadSuccess="uploadSuccess"></uploadFile>
|
||||
<uploadFile ref="uploadFile" :accept="'.doc,.docx,.pdf'" @uploadSuccess="uploadSuccess"></uploadFile>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
|
||||
Reference in New Issue
Block a user