Commit 64ee56cf by lichengming

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

parent 238b611b
...@@ -61,7 +61,7 @@ ...@@ -61,7 +61,7 @@
fixed="right"> fixed="right">
<template slot-scope="scope"> <template slot-scope="scope">
<VXEIconList <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> @on-result-change="_iconClick" :rowData="scope.row"></VXEIconList>
</template> </template>
</vxe-table-column> </vxe-table-column>
...@@ -338,6 +338,28 @@ export default { ...@@ -338,6 +338,28 @@ export default {
this.imgViewList = pngViewList this.imgViewList = pngViewList
this.imgViewIndex = 0 this.imgViewIndex = 0
break 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) // console.log(data)
// if (this.urlData.viewUri === '/meter/v1/entrust_attachment/preview/') { // if (this.urlData.viewUri === '/meter/v1/entrust_attachment/preview/') {
......
...@@ -60,7 +60,7 @@ ...@@ -60,7 +60,7 @@
fixed="right"> fixed="right">
<template slot-scope="scope"> <template slot-scope="scope">
<VXEIconList <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> @on-result-change="_iconClick" :rowData="scope.row"></VXEIconList>
</template> </template>
</vxe-table-column> </vxe-table-column>
...@@ -127,8 +127,8 @@ ...@@ -127,8 +127,8 @@
</div> </div>
<!--图片预览--> <!--图片预览-->
<div> <div>
<vue-gallery-slideshow :images="imgViewList" :index="imgViewIndex" <vue-gallery-slideshow :images="imgViewList" :index="imgViewIndex" @close="imgViewIndex = null"
@close="imgViewIndex = null"></vue-gallery-slideshow> style="height: 100vh"></vue-gallery-slideshow>
</div> </div>
</div> </div>
...@@ -335,6 +335,34 @@ export default { ...@@ -335,6 +335,34 @@ export default {
this.imgViewList = pngViewList this.imgViewList = pngViewList
this.imgViewIndex = 0 this.imgViewIndex = 0
break 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) // console.log(data)
// if (this.urlData.viewUri === '/meter/v1/entrust_attachment/preview/') { // if (this.urlData.viewUri === '/meter/v1/entrust_attachment/preview/') {
......
...@@ -361,24 +361,18 @@ export default { ...@@ -361,24 +361,18 @@ export default {
}) })
}, },
_exportTemplate() { _exportTemplate() {
if (this.selectIds.length === 0) { const data = {
this.$Message.warning('请至少选择一条数据') downloadUrl: '/soil/v1/excel/template_soil/SamplingList.xlsx'
} else { // downloadUrl: '/soil/v1/sample/export_sampling_list'
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)
}
})
} }
console.log(data)
this.$Modal.confirm({
title: '提示',
content: '确定要导出该模板?',
onOk: () => {
this._download(data)
}
})
}, },
_download(data) { _download(data) {
window.open(global.baseURL + data.downloadUrl, '_blank') 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