| | |
| | | <el-button type="primary" :disabled="this.selectedList.length==0" plain @click="exportExcel">导出到EXCEL</el-button> |
| | | </template> |
| | | <template #menu="scope"> |
| | | <el-button type="primary" text size="default" |
| | | @click.stop="handleAction(scope.row, scope.index)">审批 |
| | | </el-button> |
| | | <el-button type="primary" text size="default" @click.stop="showContent(scope.row)">查看</el-button> |
| | | <el-button type="primary" text size="default" @click.stop="download(scope.row, scope.index)">下载</el-button> |
| | | </template> |
| | | </avue-crud> |
| | | |
| | | <el-dialog title="程序内容" append-to-body v-model="fileViewModel"> |
| | | <div v-html="appContent" class="app-content"></div> |
| | | </el-dialog> |
| | | </basic-container> |
| | | </template> |
| | | |
| | |
| | | import { exportBlob } from '@/api/common'; |
| | | import { getToken } from '@/utils/auth'; |
| | | import NProgress from 'nprogress'; |
| | | import { downloadXls } from '@/utils/util'; |
| | | import { downloadXls,downloadFile } from '@/utils/util'; |
| | | import 'nprogress/nprogress.css'; |
| | | export default { |
| | | name: 'MachineReturnFileOp', |
| | |
| | | query: {status:1}, |
| | | loading: true, |
| | | data: [], |
| | | fileViewModel:false, |
| | | appContent:'', |
| | | option: { |
| | | addBtn: false, |
| | | editBtn: false, |
| | |
| | | border: true, |
| | | index: true, |
| | | selection: true, |
| | | menuWidth: 100, |
| | | menu: false, |
| | | menuWidth: 110, |
| | | menu: true, |
| | | dialogClickModal: false, |
| | | column: [ |
| | | |
| | |
| | | } |
| | | }, |
| | | methods: { |
| | | showContent(row) { |
| | | this.fileViewModel = true; |
| | | this.appContent = ''; |
| | | axios({ |
| | | url: '/blade-mdm/ossfile/file-content', |
| | | method: 'get', |
| | | params: {ossFileName: row.ossName} |
| | | }).then( |
| | | res => { |
| | | console.log(res) |
| | | if(res.data.code === 200) { |
| | | this.appContent = res.data.data; |
| | | } else { |
| | | this.appContent = '程序内容加载失败' |
| | | } |
| | | }); |
| | | }, |
| | | download(row){ |
| | | exportBlob( |
| | | `/blade-mdm/machinefile/filehandle/download-by-id?id=${row.id}&${this.website.tokenHeader}=${getToken()}`, |
| | | |
| | | ).then(res => { |
| | | |
| | | let name = res.headers['content-disposition'].split('filename=')[1] |
| | | //console.log(res.headers['content-disposition'].split('filename=')[1]); |
| | | name = decodeURI(name) |
| | | downloadFile(res.data, `${name}`); |
| | | NProgress.done(); |
| | | }); |
| | | }, |
| | | selectionChange (list) { |
| | | this.selectedList = list; |
| | | }, |