修改禅道已知bug
This commit is contained in:
@@ -322,12 +322,12 @@
|
||||
})
|
||||
},
|
||||
dateChange(item) {
|
||||
this.formInline[item.db_field_name] = moment(this.formInline[item.db_field_name]).format('YYYY-MM-DD')
|
||||
this.formInline[item.db_field_name] = this.formInline[item.db_field_name] ? moment(this.formInline[item.db_field_name]).format('YYYY-MM-DD') : ''
|
||||
},
|
||||
onChange(item) {
|
||||
let dateOne = moment(this.formInline[item][0]).format('YYYY-MM-DD')
|
||||
let dateTwo = moment(this.formInline[item][1]).format('YYYY-MM-DD')
|
||||
this.formInline[item] = [dateOne, dateTwo]
|
||||
this.formInline[item] =dateOne ? [dateOne, dateTwo] : []
|
||||
},
|
||||
|
||||
clickButtonToUpload(current) {
|
||||
|
||||
@@ -27,7 +27,9 @@
|
||||
</a>
|
||||
</span>
|
||||
<span slot="detailClick" slot-scope="text,record">
|
||||
<a class="text" :title="text" @click="detailClick(record)">{{text}}</a>
|
||||
<a class="text" :title="text" @click="detailClick(record)">
|
||||
{{text && text.length > 18?text.slice(0,17)+'...':text}}
|
||||
</a>
|
||||
</span>
|
||||
<span slot="detailText" slot-scope="text,record">
|
||||
<span class="text" :title="text">
|
||||
|
||||
@@ -1,68 +1,71 @@
|
||||
<template>
|
||||
<div>
|
||||
<a-modal v-model="visible" :maskClosable="false" :footer="[]" :title="title">
|
||||
<a-upload-dragger
|
||||
accept='*.*'
|
||||
:disabled="disabled"
|
||||
class="ant-upload-list"
|
||||
name="file"
|
||||
:file-list="myfileList"
|
||||
:multiple="true"
|
||||
:action = 'uploadAction'
|
||||
:headers="headers"
|
||||
:before-upload="beforeUpload"
|
||||
:remove='remove'
|
||||
@change="handleChange">
|
||||
<p><a-icon style="font-size: 67px;color: #c0c4cc;" type="cloud-upload" /></p>
|
||||
<p class="ant-upload-text" style="font-size: 14px;line-height: 30px">{{this.$t('clickUpload')}}</p>
|
||||
</a-upload-dragger>
|
||||
</a-modal>
|
||||
</div>
|
||||
<div>
|
||||
<a-modal v-model="visible" :maskClosable="false" :footer="[]" :title="title">
|
||||
<a-upload-dragger
|
||||
accept='*.*'
|
||||
:disabled="disabled"
|
||||
class="ant-upload-list"
|
||||
name="file"
|
||||
:file-list="myfileList"
|
||||
:multiple="true"
|
||||
:action='uploadAction'
|
||||
:headers="headers"
|
||||
:before-upload="beforeUpload"
|
||||
:remove='remove'
|
||||
@change="handleChange">
|
||||
<p>
|
||||
<a-icon style="font-size: 67px;color: #c0c4cc;" type="cloud-upload"/>
|
||||
</p>
|
||||
<p class="ant-upload-text" style="font-size: 14px;line-height: 30px">{{this.$t('clickUpload')}}</p>
|
||||
</a-upload-dragger>
|
||||
</a-modal>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import Vue from 'vue'
|
||||
import { ACCESS_TOKEN } from "@/store/mutation-types"
|
||||
import { ACCESS_TOKEN } from '@/store/mutation-types'
|
||||
|
||||
export default {
|
||||
name: 'file',
|
||||
props:['disableds','disabled','thisFileUploadUrl','readonly','thisFileType'],
|
||||
data(){
|
||||
return{
|
||||
visible:false,
|
||||
title:this.$t('clickUpload'),
|
||||
uploadAction:window._CONFIG['domianURL']+"/sys/common/upload",
|
||||
myuploadAction:window._CONFIG['domianURL']+this.thisFileUploadUrl,
|
||||
upDataList:[],
|
||||
downLoadFileUrl:window._CONFIG['domianURL']+'/sys/common/static',
|
||||
fileList:[],
|
||||
myfileList:[],
|
||||
isLoding:false,
|
||||
}
|
||||
props: ['disableds', 'disabled', 'thisFileUploadUrl', 'readonly', 'thisFileType'],
|
||||
data() {
|
||||
return {
|
||||
visible: false,
|
||||
title: this.$t('clickUpload'),
|
||||
uploadAction: window._CONFIG['domianURL'] + '/sys/common/upload',
|
||||
myuploadAction: window._CONFIG['domianURL'] + this.thisFileUploadUrl,
|
||||
upDataList: [],
|
||||
downLoadFileUrl: window._CONFIG['domianURL'] + '/sys/common/static',
|
||||
fileList: [],
|
||||
myfileList: [],
|
||||
isLoding: false
|
||||
}
|
||||
},
|
||||
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:{
|
||||
perentHandleFunc(data){
|
||||
methods: {
|
||||
perentHandleFunc(data) {
|
||||
this.myfileList = data
|
||||
if (data && data.length > 0){
|
||||
this.myfileList.forEach((res)=>{
|
||||
if (data && data.length > 0) {
|
||||
this.myfileList.forEach((res) => {
|
||||
res.name = res.fileName
|
||||
res.uid = res.id
|
||||
})
|
||||
}else {
|
||||
} else {
|
||||
this.myfileList = []
|
||||
}
|
||||
},
|
||||
beforeUpload(file) {
|
||||
console.log(file)
|
||||
// let thisFileType = this.thisFileType.replace(/\s+/g, "");
|
||||
this.fileTypeSatus = true;
|
||||
this.fileTypeSatus = true
|
||||
//TODO 客户要求不拦截文件
|
||||
// if(file.type){
|
||||
// if (thisFileType.indexOf(file.type) != -1) {
|
||||
@@ -81,60 +84,60 @@
|
||||
// }
|
||||
this.$message.destroy()
|
||||
// 207M.doc文件大小超出100MB限制, 请压缩或降低文件质量!
|
||||
this.errorMessage = file.name + "文件大小超出100MB限制, 请压缩或降低文件质量!";
|
||||
this.errorMessage = file.name + '文件大小超出100MB限制, 请压缩或降低文件质量!'
|
||||
|
||||
},
|
||||
remove(){
|
||||
this.fileTypeSatus = true;
|
||||
remove() {
|
||||
this.fileTypeSatus = true
|
||||
},
|
||||
mydownload(item){
|
||||
var fileName = item.fileName;
|
||||
downFile(this.downLoadFileUrl+'/'+item.ext1,{}).then((data)=>{
|
||||
mydownload(item) {
|
||||
var fileName = item.fileName
|
||||
downFile(this.downLoadFileUrl + '/' + item.ext1, {}).then((data) => {
|
||||
if (!data) {
|
||||
this.$message.destroy()
|
||||
this.$message.warning("文件下载失败")
|
||||
this.$message.warning('文件下载失败')
|
||||
return
|
||||
}
|
||||
if (typeof window.navigator.msSaveBlob !== 'undefined') {
|
||||
window.navigator.msSaveBlob(new Blob([data],{type: 'application/vnd.ms-excel'}), fileName)
|
||||
}else{
|
||||
let url = window.URL.createObjectURL(new Blob([data],{type: 'application/vnd.ms-excel'}))
|
||||
window.navigator.msSaveBlob(new Blob([data], { type: 'application/vnd.ms-excel' }), fileName)
|
||||
} else {
|
||||
let url = window.URL.createObjectURL(new Blob([data], { type: 'application/vnd.ms-excel' }))
|
||||
let link = document.createElement('a')
|
||||
link.style.display = 'none'
|
||||
link.href = url
|
||||
link.setAttribute('download', fileName)
|
||||
document.body.appendChild(link)
|
||||
link.click()
|
||||
document.body.removeChild(link); //下载完成移除元素
|
||||
window.URL.revokeObjectURL(url); //释放掉blob对象
|
||||
document.body.removeChild(link) //下载完成移除元素
|
||||
window.URL.revokeObjectURL(url) //释放掉blob对象
|
||||
}
|
||||
})
|
||||
},
|
||||
mypreview(item){
|
||||
console.log(item);
|
||||
let url = window._CONFIG['onlinePreviewDomainURL'] + '?url=' + encodeURIComponent(this.downLoadFileUrl+'/'+item.ext1)
|
||||
mypreview(item) {
|
||||
console.log(item)
|
||||
let url = window._CONFIG['onlinePreviewDomainURL'] + '?url=' + encodeURIComponent(this.downLoadFileUrl + '/' + item.ext1)
|
||||
window.open(url, '_blank')
|
||||
},
|
||||
handleChange(info) {
|
||||
let { file } = 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 } = 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)
|
||||
}
|
||||
})
|
||||
if (this.fileTypeSatus) {
|
||||
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.$message.error(`${info.file.name} 文件上传失败。`)
|
||||
} else if (status === 'removed') {
|
||||
this.myfileList = info.fileList;
|
||||
this.myfileList = info.fileList
|
||||
this.fileList = []
|
||||
this.myfileList.forEach((res) => {
|
||||
if (res.response) {
|
||||
@@ -144,16 +147,16 @@
|
||||
}
|
||||
})
|
||||
this.$emit('uploadSuccess', this.fileList)
|
||||
if(this.myfileList.length > 0){
|
||||
if (this.myfileList.length > 0) {
|
||||
this.$message.destroy()
|
||||
this.$message.success(`${info.file.name} 删除成功。`);
|
||||
this.$message.success(`${info.file.name} 删除成功。`)
|
||||
}
|
||||
} else if (status === 'done') {
|
||||
this.fileList = []
|
||||
this.myfileList = info.fileList;
|
||||
this.myfileList = info.fileList
|
||||
if (info.fileList.length > 20) {
|
||||
info.fileList.splice(20)
|
||||
this.myfileList = info.fileList;
|
||||
this.myfileList = info.fileList
|
||||
this.myfileList.forEach((res) => {
|
||||
if (res.response) {
|
||||
this.fileList.push(res.response.result)
|
||||
@@ -163,7 +166,7 @@
|
||||
})
|
||||
this.$emit('uploadSuccess', this.fileList)
|
||||
this.$message.destroy()
|
||||
this.$message.error('最多只能上传二十个');
|
||||
this.$message.error('最多只能上传二十个')
|
||||
return
|
||||
}
|
||||
this.myfileList.forEach((res) => {
|
||||
@@ -174,30 +177,29 @@
|
||||
}
|
||||
})
|
||||
this.$emit('uploadSuccess', this.fileList)
|
||||
if(this.myfileList.length > 0){
|
||||
if (this.myfileList.length > 0) {
|
||||
this.$message.destroy()
|
||||
this.$message.success(`${info.file.name} 文件上传成功。`);
|
||||
this.$message.success(`${info.file.name} 文件上传成功。`)
|
||||
}
|
||||
} else if (status === 'uploading') {
|
||||
this.myfileList = info.fileList;
|
||||
this.$emit('uploadSuccess')
|
||||
this.myfileList = info.fileList
|
||||
// this.$message.success(`${info.file.name} 文件上传成功。`);
|
||||
}
|
||||
}
|
||||
}else{
|
||||
} else {
|
||||
this.$message.warning('不支持上传该类型的文件!')
|
||||
}
|
||||
},
|
||||
resetFileList(){
|
||||
this.myfileList = [];
|
||||
this.fileList = [];
|
||||
},
|
||||
},
|
||||
resetFileList() {
|
||||
this.myfileList = []
|
||||
this.fileList = []
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style>
|
||||
.ant-upload-list-item-name{
|
||||
.ant-upload-list-item-name {
|
||||
color: rgba(0, 0, 0, 0.65) !important;
|
||||
}
|
||||
}
|
||||
</style>
|
||||
Reference in New Issue
Block a user