Commit 64ee56cf by lichengming

修改了附件打开文件和独立预检导出抽样单模板

parent 238b611b
......@@ -61,7 +61,7 @@
fixed="right">
<template slot-scope="scope">
<VXEIconList
:msg="scope.row.type === 'jpg'||scope.row.type === 'pdf'||scope.row.type === 'png' ?iconMsgJpg:iconMsg"
:msg="scope.row.type === 'jpg'||scope.row.type === 'pdf'||scope.row.type === 'png'||scope.row.type === 'xlsx'||scope.row.type === 'docx'||scope.row.type === 'bmp' ?iconMsgJpg:iconMsg"
@on-result-change="_iconClick" :rowData="scope.row"></VXEIconList>
</template>
</vxe-table-column>
......@@ -338,6 +338,28 @@ export default {
this.imgViewList = pngViewList
this.imgViewIndex = 0
break
case 'bmp':
const bmpViewList = []
bmpViewList.push(global.baseURL + this.downloadFileUrlFile + data.id)
this.imgViewList = bmpViewList
this.imgViewIndex = 0
break
case 'xlsx':
this.$openWindowModeless({
objectKey: data.objectKey,
idType: 10,
id: data.id,
isReport: 4
})
break
case 'docx':
this.$openWindowModeless({
objectKey: data.objectKey,
idType: 10,
id: data.id,
isReport: 4
})
break
}
// console.log(data)
// if (this.urlData.viewUri === '/meter/v1/entrust_attachment/preview/') {
......
......@@ -60,7 +60,7 @@
fixed="right">
<template slot-scope="scope">
<VXEIconList
:msg="scope.row.type === 'jpg'||scope.row.type === 'pdf'||scope.row.type === 'png' ?iconMsgJpg:iconMsg"
:msg="scope.row.type === 'jpg'||scope.row.type === 'pdf'||scope.row.type === 'png'||scope.row.type === 'xlsx'||scope.row.type === 'docx'||scope.row.type === 'bmp' ?iconMsgJpg:iconMsg"
@on-result-change="_iconClick" :rowData="scope.row"></VXEIconList>
</template>
</vxe-table-column>
......@@ -127,8 +127,8 @@
</div>
<!--图片预览-->
<div>
<vue-gallery-slideshow :images="imgViewList" :index="imgViewIndex"
@close="imgViewIndex = null"></vue-gallery-slideshow>
<vue-gallery-slideshow :images="imgViewList" :index="imgViewIndex" @close="imgViewIndex = null"
style="height: 100vh"></vue-gallery-slideshow>
</div>
</div>
......@@ -335,6 +335,34 @@ export default {
this.imgViewList = pngViewList
this.imgViewIndex = 0
break
case 'bmp':
const bmpViewList = []
bmpViewList.push(global.baseURL + this.downloadFileUrlFile + data.id)
this.imgViewList = bmpViewList
this.imgViewIndex = 0
break
case 'xlsx':
this.$openWindowModeless({
objectKey: data.objectKey,
idType: 10,
id: data.id,
isReport: 4
})
break
case 'docx':
this.$openWindowModeless({
objectKey: data.objectKey,
idType: 10,
id: data.id,
isReport: 4
})
break
case 'doc':
this.$Message.warning('预览功能不支持doc格式')
break
case 'xls':
this.$Message.warning('预览功能不支持xls格式')
break
}
// console.log(data)
// if (this.urlData.viewUri === '/meter/v1/entrust_attachment/preview/') {
......
......@@ -361,24 +361,18 @@ export default {
})
},
_exportTemplate() {
if (this.selectIds.length === 0) {
this.$Message.warning('请至少选择一条数据')
} else {
const data = {
downloadUrl:
'/soil/v1/sample/export_sampling_list?ids=' +
this.selectIds.join(',')
// downloadUrl: '/soil/v1/sample/export_sampling_list'
}
console.log(data)
this.$Modal.confirm({
title: '提示',
content: '确定要导出该模板?',
onOk: () => {
this._download(data)
}
})
const data = {
downloadUrl: '/soil/v1/excel/template_soil/SamplingList.xlsx'
// downloadUrl: '/soil/v1/sample/export_sampling_list'
}
console.log(data)
this.$Modal.confirm({
title: '提示',
content: '确定要导出该模板?',
onOk: () => {
this._download(data)
}
})
},
_download(data) {
window.open(global.baseURL + data.downloadUrl, '_blank')
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment