修改禅道已知bug 以及中英文
This commit is contained in:
@@ -4,19 +4,19 @@
|
||||
<a-upload
|
||||
accept='.zip'
|
||||
:disabled="disabled"
|
||||
class="ant-upload-list"
|
||||
class="ant-upload-list "
|
||||
name="file"
|
||||
:list-type="listType"
|
||||
:file-list="myfileList"
|
||||
:multiple="false"
|
||||
:action = 'uploadAction'
|
||||
:action='uploadAction'
|
||||
:headers="headers"
|
||||
:before-upload="beforeUpload"
|
||||
:remove='remove'
|
||||
|
||||
@change="handleChange">
|
||||
<!-- <p><a-icon style="font-size: 67px;color: #c0c4cc;" type="cloud-upload" /></p>-->
|
||||
<a-icon type="export" :rotate="-90" />
|
||||
<a-icon type="export" :rotate="-90"/>
|
||||
{{$t('splitFile')}}
|
||||
</a-upload>
|
||||
<!-- </a-modal>-->
|
||||
@@ -25,62 +25,63 @@
|
||||
|
||||
<script>
|
||||
import Vue from 'vue'
|
||||
import { ACCESS_TOKEN } from "@/store/mutation-types"
|
||||
import { ACCESS_TOKEN } from '@/store/mutation-types'
|
||||
|
||||
export default {
|
||||
name: 'importSplitUpload',
|
||||
props:['disableds','disabled','thisFileUploadUrl','readonly','thisFileType','accept','title','listType','module'],
|
||||
data(){
|
||||
return{
|
||||
visible:false,
|
||||
uploadAction:window._CONFIG['domianURL']+"/sys/common/upload",
|
||||
downLoadFileUrl:window._CONFIG['domianURL']+'/sys/common/static',
|
||||
myfileList:[],
|
||||
fileList:[],
|
||||
fileTypeSatus:false,
|
||||
headers:{},
|
||||
props: ['disableds', 'disabled', 'thisFileUploadUrl', 'readonly', 'thisFileType', 'accept', 'title', 'listType', 'module'],
|
||||
data() {
|
||||
return {
|
||||
visible: false,
|
||||
uploadAction: window._CONFIG['domianURL'] + '/sys/common/upload',
|
||||
downLoadFileUrl: window._CONFIG['domianURL'] + '/sys/common/static',
|
||||
myfileList: [],
|
||||
fileList: [],
|
||||
fileTypeSatus: false,
|
||||
headers: {}
|
||||
}
|
||||
},
|
||||
created(){
|
||||
const token = Vue.ls.get(ACCESS_TOKEN);
|
||||
this.headers = {"X-Access-Token":token};
|
||||
this.containerId = 'container-ty-'+new Date().getTime();
|
||||
created() {
|
||||
const token = Vue.ls.get(ACCESS_TOKEN)
|
||||
this.headers = { 'X-Access-Token': token }
|
||||
this.containerId = 'container-ty-' + new Date().getTime()
|
||||
},
|
||||
mounted(){
|
||||
mounted() {
|
||||
// console.log(this.thisFileType,this.thisFileSize,this.thisFileUploadUrl);
|
||||
},
|
||||
methods:{
|
||||
beforeUpload(file,fileList) {
|
||||
console.log('file',this.accept,file,fileList,this.myfileList)
|
||||
this.fileTypeSatus=false
|
||||
if(this.myfileList&&this.myfileList.length>=1){
|
||||
methods: {
|
||||
beforeUpload(file, fileList) {
|
||||
console.log('file', this.accept, file, fileList, this.myfileList)
|
||||
this.fileTypeSatus = false
|
||||
if (this.myfileList && this.myfileList.length >= 1) {
|
||||
// console.log()
|
||||
this.$message.warning(this.$t('onlyOnefileUploaded'))
|
||||
return false
|
||||
}else{
|
||||
let suffix=file.name.split('.')
|
||||
let acceptSuffix=suffix[suffix.length-1]
|
||||
if(acceptSuffix.toLowerCase()=='zip'){
|
||||
this.fileTypeSatus = true;
|
||||
this.$message.destroy()
|
||||
// 207M.doc文件大小超出100MB限制, 请压缩或降低文件质量!
|
||||
this.errorMessage = file.name + "文件大小超出100MB限制, 请压缩或降低文件质量!";
|
||||
} else {
|
||||
let suffix = file.name.split('.')
|
||||
let acceptSuffix = suffix[suffix.length - 1]
|
||||
if (acceptSuffix.toLowerCase() == 'zip') {
|
||||
this.fileTypeSatus = true
|
||||
this.$message.destroy()
|
||||
// 207M.doc文件大小超出100MB限制, 请压缩或降低文件质量!
|
||||
this.errorMessage = file.name + '文件大小超出100MB限制, 请压缩或降低文件质量!'
|
||||
// }
|
||||
}
|
||||
}
|
||||
},
|
||||
remove(){
|
||||
this.fileTypeSatus = true;
|
||||
remove() {
|
||||
this.fileTypeSatus = true
|
||||
// console.log('rrr',this.myfileList)
|
||||
},
|
||||
handleChange(info) {
|
||||
// console.log('info',info)
|
||||
|
||||
let { file,fileList } = info;
|
||||
const status = info.file.status;
|
||||
info.fileList.forEach((val,index)=>{
|
||||
if(val.response && !val.response.result){
|
||||
this.$message.error(val.response.message);
|
||||
info.fileList.splice(index,1)
|
||||
let { file, fileList } = info
|
||||
const status = info.file.status
|
||||
info.fileList.forEach((val, index) => {
|
||||
if (val.response && !val.response.result) {
|
||||
this.$message.error(val.response.message)
|
||||
info.fileList.splice(index, 1)
|
||||
}
|
||||
})
|
||||
// console.log('fileStatue',this.fileTypeSatus)
|
||||
@@ -88,13 +89,13 @@
|
||||
if (file.size > 100000000) {
|
||||
this.$message.error(this.errorMessage)
|
||||
return
|
||||
}else {
|
||||
} else {
|
||||
if (status === 'error') {
|
||||
this.$emit('uploadSuccess', this.fileList)
|
||||
this.$message.destroy()
|
||||
this.$message.error(`${info.file.name}`+this.$t('fileUploadFailed'));
|
||||
this.$message.error(`${info.file.name}` + this.$t('fileUploadFailed'))
|
||||
} else if (status === 'removed') {
|
||||
this.myfileList = info.fileList;
|
||||
this.myfileList = info.fileList
|
||||
this.fileList = []
|
||||
this.myfileList.forEach((res) => {
|
||||
if (res.response) {
|
||||
@@ -106,10 +107,10 @@
|
||||
// console.log('remove',this.fileList)
|
||||
this.$emit('uploadSuccess', this.fileList)
|
||||
this.$message.destroy()
|
||||
this.$message.success(`${info.file.name}`+this.$t('deletedSuccessfully'));
|
||||
this.$message.success(`${info.file.name}` + this.$t('deletedSuccessfully'))
|
||||
} else if (status === 'done') {
|
||||
this.fileList = []
|
||||
this.myfileList = info.fileList;
|
||||
this.myfileList = info.fileList
|
||||
// console.log('file3333',info.fileList)
|
||||
// if (info.fileList.length > 1) {
|
||||
// info.fileList.splice(1)
|
||||
@@ -139,22 +140,22 @@
|
||||
})
|
||||
// let fileList1=[]
|
||||
// fileList1[0]=this.fileList[this.fileList.length-1]
|
||||
if(this.myfileList.length > 0){
|
||||
if (this.myfileList.length > 0) {
|
||||
this.$emit('uploadSuccess', this.fileList)
|
||||
this.$message.destroy()
|
||||
this.$message.success(`${info.file.name}`+this.$t('uploadSuccessful'));
|
||||
this.$message.success(`${info.file.name}` + this.$t('uploadSuccessful'))
|
||||
// console.log('fileList111',file,this.fileList,fileList1)
|
||||
}
|
||||
} else if (status === 'uploading') {
|
||||
this.myfileList = info.fileList;
|
||||
this.myfileList = info.fileList
|
||||
this.$emit('uploadSuccess')
|
||||
// this.$message.success(`${info.file.name} 文件上传成功。`);
|
||||
}
|
||||
}
|
||||
}else if( !this.fileTypeSatus&&this.myfileList.length<1){
|
||||
} else if (!this.fileTypeSatus && this.myfileList.length < 1) {
|
||||
this.$message.warning(this.$t('typeCannotUploaded'))
|
||||
}
|
||||
},
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
@@ -165,18 +166,20 @@
|
||||
|
||||
|
||||
<style lang="less">
|
||||
.ocr-upload-modal{
|
||||
.ant-modal-wrap{
|
||||
.ocr-upload-modal {
|
||||
.ant-modal-wrap {
|
||||
z-index: 1002;
|
||||
}
|
||||
}
|
||||
.split-import-upload{
|
||||
.ant-upload-list-item-info{
|
||||
span{
|
||||
|
||||
.split-import-upload {
|
||||
.ant-upload-list-item-info {
|
||||
span {
|
||||
display: flex;
|
||||
justify-content: start;
|
||||
text-align: right;
|
||||
.ant-upload-list-item-name{
|
||||
|
||||
.ant-upload-list-item-name {
|
||||
margin-right: 20px;
|
||||
max-width: 800px;
|
||||
text-overflow: ellipsis;
|
||||
@@ -186,21 +189,22 @@
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@media screen and (min-width: 1600px) and (max-width: 2000px) {
|
||||
.ant-upload-list-text{
|
||||
.ant-upload-list-text {
|
||||
position: absolute;
|
||||
top: 140px;
|
||||
right: 240px;
|
||||
}
|
||||
}
|
||||
}
|
||||
@media screen and (min-width: 600px) and (max-width: 1600px) {
|
||||
.ant-upload-list-item {
|
||||
position: relative;
|
||||
height: 22px;
|
||||
margin-top: -22px;
|
||||
font-size: 14px;
|
||||
margin-right: 80px;
|
||||
@media screen and (min-width: 600px) and (max-width: 1600px) {
|
||||
.ant-upload-list-item {
|
||||
position: relative;
|
||||
height: 22px;
|
||||
margin-top: -22px;
|
||||
font-size: 14px;
|
||||
margin-right: 80px;
|
||||
}
|
||||
}
|
||||
}
|
||||
</style>
|
||||
Reference in New Issue
Block a user