|
@@ -390,6 +390,8 @@
|
|
|
import SelectTree from '@/components/treeSelect/treeSelect.vue'
|
|
|
import OSSSerive, {
|
|
|
httpRequest,
|
|
|
+ toHref,
|
|
|
+ openWindowOnUrl,
|
|
|
handleRemove,
|
|
|
fileName
|
|
|
} from '@/api/sys/OSSService'
|
|
@@ -527,6 +529,9 @@
|
|
|
this.ossService = new OSSSerive()
|
|
|
this.workClientService = new WorkClientService()
|
|
|
},
|
|
|
+ mounted () {
|
|
|
+ window.onPreview = this.onPreview
|
|
|
+ },
|
|
|
methods: {
|
|
|
uploadVideoProcess (event, file, fileList) {
|
|
|
this.progressFlag = true // 显示进度条
|
|
@@ -540,7 +545,7 @@
|
|
|
let value = this.inputForm.workClientInfo.name
|
|
|
if (value !== null && value !== undefined && value !== '') {
|
|
|
this.workClientService.isExist(value).then((data) => {
|
|
|
- console.log('data',data.data)
|
|
|
+ console.log('data', data.data)
|
|
|
if (data.data !== 0) {
|
|
|
this.$message.error('该客户名称已存在')
|
|
|
this.isSubmit = true
|
|
@@ -552,7 +557,7 @@
|
|
|
let value = this.inputForm.workClientInfo.uscCode
|
|
|
if (value !== null && value !== undefined && value !== '') {
|
|
|
this.workClientService.isExist(value).then((data) => {
|
|
|
- console.log('data',data.data)
|
|
|
+ console.log('data', data.data)
|
|
|
if (data.data !== 0) {
|
|
|
this.$message.error('该统一社会信用代码已存在')
|
|
|
this.isSubmit = true
|
|
@@ -561,36 +566,7 @@
|
|
|
}
|
|
|
},
|
|
|
async toHref (row) {
|
|
|
- const link = document.createElement('a')
|
|
|
- if (row.id === null || row.id === undefined || row.id === '') {
|
|
|
- await this.ossService.getTemporaryUrl(row.raw.url).then((data) => {
|
|
|
- const url = data.data // 完整的url则直接使用
|
|
|
- // 这里是将url转成blob地址,
|
|
|
- fetch(url).then(res => res.blob()).then(blob => { // 将链接地址字符内容转变成blob地址
|
|
|
- link.href = URL.createObjectURL(blob)
|
|
|
- link.download = row.name || '' // 下载文件的名字
|
|
|
- // a.download = url.split('/')[url.split('/').length -1] // // 下载文件的名字
|
|
|
- document.body.appendChild(link)
|
|
|
- link.click()
|
|
|
- // 在资源下载完成后 清除 占用的缓存资源
|
|
|
- window.URL.revokeObjectURL(link.href)
|
|
|
- document.body.removeChild(link)
|
|
|
- })
|
|
|
- })
|
|
|
- } else {
|
|
|
- const url = row.temporaryUrl // 完整的url则直接使用
|
|
|
- // 这里是将url转成blob地址,
|
|
|
- fetch(url).then(res => res.blob()).then(blob => { // 将链接地址字符内容转变成blob地址
|
|
|
- link.href = URL.createObjectURL(blob)
|
|
|
- link.download = row.name || '' // 下载文件的名字
|
|
|
- // a.download = url.split('/')[url.split('/').length -1] // // 下载文件的名字
|
|
|
- document.body.appendChild(link)
|
|
|
- link.click()
|
|
|
- // 在资源下载完成后 清除 占用的缓存资源
|
|
|
- window.URL.revokeObjectURL(link.href)
|
|
|
- document.body.removeChild(link)
|
|
|
- })
|
|
|
- }
|
|
|
+ toHref(row)
|
|
|
},
|
|
|
onPreview (url) {
|
|
|
this.url = url
|
|
@@ -732,6 +708,7 @@
|
|
|
doSubmit () {
|
|
|
if (this.progressFlag === true) {
|
|
|
this.$message.warning('文件正在上传中,请稍等')
|
|
|
+ return
|
|
|
}
|
|
|
this.$refs['inputForm'].validate((valid) => {
|
|
|
if (valid) {
|
|
@@ -831,7 +808,7 @@
|
|
|
this.showVi = true
|
|
|
},
|
|
|
httpRequest (file) {
|
|
|
- httpRequest(file, fileName(file), 'projectRecords')
|
|
|
+ httpRequest(file, fileName(file), 'workClient')
|
|
|
},
|
|
|
handleRemove () {
|
|
|
this.fileList = handleRemove()
|
|
@@ -854,38 +831,7 @@
|
|
|
}
|
|
|
},
|
|
|
async showFile (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 !== '') {
|
|
|
- this.onPreview(row.url)
|
|
|
- return
|
|
|
- } else {
|
|
|
- await this.ossService.getTemporaryUrl(row.raw.url).then((data) => {
|
|
|
- this.onPreview(data.data)
|
|
|
- })
|
|
|
- return
|
|
|
- }
|
|
|
- }
|
|
|
- if (row.url !== null && row.url !== undefined && row.url !== '') {
|
|
|
- if (suffix === 'pdf') {
|
|
|
- window.open('https://view.xdocin.com/xdoc?_xdoc=' + row.url, '_blank')
|
|
|
- } else if (suffix === 'rar' || suffix === 'zip' || suffix === 'jar' || suffix === '7z') {
|
|
|
- window.open('http://ow365.cn/?i=25008&furl=' + row.url, '_blank')
|
|
|
- } else {
|
|
|
- window.open('https://view.officeapps.live.com/op/view.aspx?src=' + row.url, '_blank')
|
|
|
- }
|
|
|
- } else if (row.raw.url !== null && row.raw.url !== undefined && row.raw.url !== '') {
|
|
|
- await this.ossService.getTemporaryUrl(row.raw.url).then((data) => {
|
|
|
- this.rowurl = data.data
|
|
|
- })
|
|
|
- if (suffix === 'pdf') {
|
|
|
- window.open('https://view.xdocin.com/xdoc?_xdoc=' + this.rowurl, '_blank')
|
|
|
- } else if (suffix === 'rar' || suffix === 'zip' || suffix === 'jar' || suffix === '7z') {
|
|
|
- window.open('http://ow365.cn/?i=25008&furl=' + this.rowurl, '_blank')
|
|
|
- } else {
|
|
|
- window.open('https://view.officeapps.live.com/op/view.aspx?src=' + this.rowurl, '_blank')
|
|
|
- }
|
|
|
- }
|
|
|
+ await openWindowOnUrl(row)
|
|
|
},
|
|
|
// 排序
|
|
|
sortChangeHandle (column) {
|