调整前端代码格式符合ESLint规范
This commit is contained in:
@@ -32,48 +32,48 @@
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import {downloadFile} from "@/utils/downloadFile";
|
||||
import {formatDate} from '@/utils/date'
|
||||
import { downloadFile } from '@/utils/downloadFile'
|
||||
import { formatDate } from '@/utils/date'
|
||||
|
||||
export default {
|
||||
name: "ReportDetail",
|
||||
data(){
|
||||
return {
|
||||
watermarkText: '', // 水印
|
||||
content: '',
|
||||
row: {},
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
// 预览
|
||||
previewRow() {
|
||||
if(!this.$route.query.row){
|
||||
this.$router.push({path: '/report/list', query: {id: this.$route.query.id}});
|
||||
return
|
||||
}
|
||||
this.watermarkText = `${this.$store.state.userInfo.usname} ${formatDate(+new Date(), 'yyyy年MM月dd日 hh:mm:ss')}`;
|
||||
this.row = JSON.parse(this.$route.query.row);
|
||||
this.$api.report.reportGetReportHtmlId({id: this.row.id}).then(({data}) => {
|
||||
this.content = data.content;
|
||||
})
|
||||
},
|
||||
// 下载
|
||||
downloadRow(row){
|
||||
// this.$confirm('此操作将下载所选数据文件, 是否继续?', '提示', {
|
||||
// confirmButtonText: '确定',
|
||||
// cancelButtonText: '取消',
|
||||
// type: 'warning'
|
||||
// }).then(() => {
|
||||
this.$api.report.reportDownload({fileId: row.fileId}).then(res => {
|
||||
downloadFile(res);
|
||||
})
|
||||
// })
|
||||
}
|
||||
},
|
||||
created() {
|
||||
this.previewRow();
|
||||
}
|
||||
export default {
|
||||
name: 'ReportDetail',
|
||||
data () {
|
||||
return {
|
||||
watermarkText: '', // 水印
|
||||
content: '',
|
||||
row: {}
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
// 预览
|
||||
previewRow () {
|
||||
if (!this.$route.query.row) {
|
||||
this.$router.push({ path: '/report/list', query: { id: this.$route.query.id } })
|
||||
return
|
||||
}
|
||||
this.watermarkText = `${this.$store.state.userInfo.usname} ${formatDate(+new Date(), 'yyyy年MM月dd日 hh:mm:ss')}`
|
||||
this.row = JSON.parse(this.$route.query.row)
|
||||
this.$api.report.reportGetReportHtmlId({ id: this.row.id }).then(({ data }) => {
|
||||
this.content = data.content
|
||||
})
|
||||
},
|
||||
// 下载
|
||||
downloadRow (row) {
|
||||
// this.$confirm('此操作将下载所选数据文件, 是否继续?', '提示', {
|
||||
// confirmButtonText: '确定',
|
||||
// cancelButtonText: '取消',
|
||||
// type: 'warning'
|
||||
// }).then(() => {
|
||||
this.$api.report.reportDownload({ fileId: row.fileId }).then(res => {
|
||||
downloadFile(res)
|
||||
})
|
||||
// })
|
||||
}
|
||||
},
|
||||
created () {
|
||||
this.previewRow()
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
|
||||
Reference in New Issue
Block a user