|
@@ -329,10 +329,13 @@
|
|
|
:on-remove="handleRemove"
|
|
|
:show-file-list="false"
|
|
|
:on-change="changes"
|
|
|
+ :on-progress="uploadVideoProcess"
|
|
|
:file-list="filesArra2">
|
|
|
<el-button type="info" size="mini" v-if="inputForm.permissionFlag&&showVi">点击上传</el-button>
|
|
|
</el-upload>
|
|
|
<div style="height: calc(100% - 80px);margin-top: 10px">
|
|
|
+ <!-- 进度条 -->
|
|
|
+ <el-progress style="margin-left: 5em" v-if="progressFlag" :percentage="loadProgress"></el-progress>
|
|
|
<vxe-table
|
|
|
style="margin-left: 5em"
|
|
|
border="inner"
|
|
@@ -508,7 +511,9 @@
|
|
|
src: '',
|
|
|
showVi: true,
|
|
|
onedit: false,
|
|
|
- type: ''
|
|
|
+ type: '',
|
|
|
+ loadProgress: 0, // 动态显示进度条
|
|
|
+ progressFlag: false // 关闭进度条
|
|
|
}
|
|
|
},
|
|
|
components: {
|
|
@@ -522,6 +527,14 @@
|
|
|
this.workClientService = new WorkClientService()
|
|
|
},
|
|
|
methods: {
|
|
|
+ uploadVideoProcess (event, file, fileList) {
|
|
|
+ this.progressFlag = true // 显示进度条
|
|
|
+ this.loadProgress = parseInt(event.percent) // 动态获取文件上传进度
|
|
|
+ if (this.loadProgress >= 100) {
|
|
|
+ this.loadProgress = 100
|
|
|
+ setTimeout(() => { this.progressFlag = false }, 1000) // 一秒后关闭进度条
|
|
|
+ }
|
|
|
+ },
|
|
|
async toHref (row) {
|
|
|
const link = document.createElement('a')
|
|
|
if (row.id === null || row.id === undefined || row.id === '') {
|
|
@@ -530,7 +543,6 @@
|
|
|
// 这里是将url转成blob地址,
|
|
|
fetch(url).then(res => res.blob()).then(blob => { // 将链接地址字符内容转变成blob地址
|
|
|
link.href = URL.createObjectURL(blob)
|
|
|
- console.log(link.href)
|
|
|
link.download = row.name || '' // 下载文件的名字
|
|
|
// a.download = url.split('/')[url.split('/').length -1] // // 下载文件的名字
|
|
|
document.body.appendChild(link)
|
|
@@ -545,7 +557,6 @@
|
|
|
// 这里是将url转成blob地址,
|
|
|
fetch(url).then(res => res.blob()).then(blob => { // 将链接地址字符内容转变成blob地址
|
|
|
link.href = URL.createObjectURL(blob)
|
|
|
- console.log(link.href)
|
|
|
link.download = row.name || '' // 下载文件的名字
|
|
|
// a.download = url.split('/')[url.split('/').length -1] // // 下载文件的名字
|
|
|
document.body.appendChild(link)
|
|
@@ -694,6 +705,9 @@
|
|
|
},
|
|
|
// 表单提交
|
|
|
doSubmit () {
|
|
|
+ if (this.progressFlag === true) {
|
|
|
+ this.$message.warning('文件正在上传中,请稍等')
|
|
|
+ }
|
|
|
this.$refs['inputForm'].validate((valid) => {
|
|
|
if (valid) {
|
|
|
this.loading = true
|
|
@@ -798,8 +812,6 @@
|
|
|
this.fileList = handleRemove()
|
|
|
},
|
|
|
changes (file, fileList) {
|
|
|
- console.log('file', file)
|
|
|
- console.log('22', fileList)
|
|
|
this.dataListNew = []
|
|
|
this.dataList.forEach((item) => {
|
|
|
this.dataListNew.push(item)
|
|
@@ -809,8 +821,6 @@
|
|
|
item.createBy = this.$store.state.user.name
|
|
|
this.dataListNew.push(item)
|
|
|
})
|
|
|
- console.log('11', this.dataList)
|
|
|
- console.log('33', this.dataListNew)
|
|
|
const isLt2M = file.size / 1024 / 1024 < 300
|
|
|
if (isLt2M === false) {
|
|
|
this.$message.error('文件大小不能超过 ' + 300 + 'M !')
|
|
@@ -819,7 +829,6 @@
|
|
|
}
|
|
|
},
|
|
|
async showFile (row) {
|
|
|
- console.log('row', row)
|
|
|
let suffix = row.name.substring(row.name.lastIndexOf('.') + 1)
|
|
|
if (suffix === 'jpg' || suffix === 'png' || suffix === 'gif' || suffix === 'bmp' || suffix === 'jpeg') {
|
|
|
if (row.url !== null && row.url !== undefined && row.url !== '') {
|
|
@@ -862,7 +871,6 @@
|
|
|
this.refreshList()
|
|
|
},
|
|
|
deleteMsgById (row, index) {
|
|
|
- console.log(index)
|
|
|
this.dataListNew.splice(index, 1)
|
|
|
if (row.id !== null && row.id !== '' && row.id !== undefined) {
|
|
|
this.ossService.deleteMsgById(row.id)
|
|
@@ -961,7 +969,6 @@
|
|
|
async rowClick (event) {
|
|
|
let id = this.gridData[event.rowIndex].companyid
|
|
|
await this.workClientService.enterpriseTicketInfo(id).then((data) => {
|
|
|
- console.log(data)
|
|
|
this.inputForm.workClientInfo.name = data.data.ENTNAME
|
|
|
this.inputForm.workClientInfo.uscCode = data.data.UNCID
|
|
|
this.inputForm.workClientInfo.registerAddress = data.data.OPLOC
|