|
|
|
@ -48,11 +48,22 @@ export default { |
|
|
|
return; |
|
|
|
} |
|
|
|
downLoadObjectFile(row).then(({data}) => { |
|
|
|
const blob = new Blob([data], { type: type }); |
|
|
|
// 创建URL来生成预览 |
|
|
|
const fileURL = URL.createObjectURL(blob); |
|
|
|
// 在新标签页中打开文件预览 |
|
|
|
const newTab = window.open(fileURL, '_blank') |
|
|
|
// const blob = new Blob([data], { type: type }); |
|
|
|
// // 创建URL来生成预览 |
|
|
|
// const fileURL = URL.createObjectURL(blob); |
|
|
|
// // 在新标签页中打开文件预览 |
|
|
|
// const newTab = window.open(fileURL, '_blank') |
|
|
|
|
|
|
|
const type = 'text/plain;charset=utf-8'; // 指定编码 |
|
|
|
const blob = new Blob([data], { type }); |
|
|
|
const reader = new FileReader(); |
|
|
|
reader.onload = function(e) { |
|
|
|
const content = e.target.result; |
|
|
|
// 新窗口展示内容 |
|
|
|
const newTab = window.open(); |
|
|
|
newTab.document.write('<pre>' + content + '</pre>'); |
|
|
|
}; |
|
|
|
reader.readAsText(blob, 'utf-8'); |
|
|
|
}) |
|
|
|
}, |
|
|
|
|
|
|
|
@ -156,7 +167,8 @@ export default { |
|
|
|
}).then(() => { |
|
|
|
deleteObjectFile(row).then(({data}) => { |
|
|
|
if (data && data.code == 0) { |
|
|
|
this.getFileContentData(tempData) |
|
|
|
// this.getFileContentData(tempData) |
|
|
|
this.$emit('refresh') |
|
|
|
this.$message({ |
|
|
|
message: '操作成功', |
|
|
|
type: 'success', |
|
|
|
@ -210,8 +222,8 @@ export default { |
|
|
|
<el-link v-if="scope.row.orderReftype !== 'mes'" style="cursor: pointer" @click="previewFile(scope.row)">预览</el-link> |
|
|
|
<el-link v-if="scope.row.orderReftype !== 'mes'" style="cursor: pointer" @click="downloadFile(scope.row)">下载</el-link> |
|
|
|
<el-link v-if="scope.row.orderReftype !== 'mes'" style="cursor: pointer" @click="deleteFile(scope.row)">删除</el-link> |
|
|
|
<el-link v-if="scope.row.orderReftype === 'mes'" style="cursor: pointer" @click="previewFileMes(scope.row)">预览</el-link> |
|
|
|
<el-link v-if="scope.row.orderReftype === 'mes'" style="cursor: pointer" @click="downloadFileMes(scope.row)">下载</el-link> |
|
|
|
<!-- <el-link v-if="scope.row.orderReftype === 'mes'" style="cursor: pointer" @click="previewFileMes(scope.row)">预览</el-link>--> |
|
|
|
<!-- <el-link v-if="scope.row.orderReftype === 'mes'" style="cursor: pointer" @click="downloadFileMes(scope.row)">下载</el-link>--> |
|
|
|
</template> |
|
|
|
</el-table-column> |
|
|
|
</el-table> |
|
|
|
|