update 更新报表预览

This commit is contained in:
lb 2023-03-06 16:15:12 +08:00
parent 770e8866a9
commit ff17c94e78
5 changed files with 56 additions and 11 deletions

View File

@ -326,7 +326,7 @@ export default {
return this.$router.push({ return this.$router.push({
name: "pms-reportPreview", name: "pms-reportPreview",
query: { query: {
name: data, name: data.name,
}, },
}); });
} }
@ -336,10 +336,9 @@ export default {
return this.$router.push({ return this.$router.push({
name: "pms-reportDesign", name: "pms-reportDesign",
query: { query: {
name: data, name: data.name,
}, },
}); });
break;
} }
} }
}, },

View File

@ -1,5 +1,5 @@
<template> <template>
<div></div> <div>design</div>
</template> </template>
<script> <script>

View File

@ -1,5 +1,7 @@
<template> <template>
<div></div> <div v-loading="loading" style="" class="main-container">
<iframe ref="report-view" id="report-view" name="main-iframe" :src="url" frameborder="0" scrolling="auto" />
</div>
</template> </template>
<script> <script>
@ -7,12 +9,51 @@ export default {
name: "ReportPreview", name: "ReportPreview",
props: {}, props: {},
data() { data() {
return {}; return {
loading: true,
// url: "/pms-am/ureport/preview", //
// url: "http://192.168.1.62:8080/pms-am/ureport/preview",
url: window.SITE_CONFIG['apiURL'] + '/ureport/preview'
};
}, },
created() {}, created() {},
mounted() {}, mounted() {
this.url += "?_u=db:" + this.$route.query.name // + ".ureport.xml";
if (this.$route.query.substrateId) {
this.url += "&substrateId=" + this.$route.query.substrateId;
}
if (this.$route.query.equipmentId) {
this.url += "&equipmentId=" + this.$route.query.equipmentId;
}
if (this.$route.query.dataId) {
this.url += "&dataId=" + this.$route.query.dataId;
}
if (this.$route.query.workOrderNo) {
this.url += "&workOrderNo=" + this.$route.query.workOrderNo;
}
if (this.$route.query.id) {
this.url += "&id=" + this.$route.query.id;
}
const iframe = this.$refs['report-view']
console.log('iframe', iframe)
iframe.onload = () => this.loading = false
},
methods: {}, methods: {},
}; };
</script> </script>
<style scoped></style> <style scoped>
.main-container {
min-height: inherit;
/* padding: 16px; */
background: white;
/* border-radius: 6px; */
/* box-shadow: 0 0 1.125px 0.125px rgba(0, 0, 0, 0.125); */
/* height: 100%; */
}
#report-view {
width: 100%;
min-height: inherit;
}
</style>

View File

@ -35,7 +35,7 @@ const CategoryList = {
// console.log('【报表分类】', item.value) // console.log('【报表分类】', item.value)
childOptions.push(h("el-option", { props: { label: item.label, value: item.value } }, null)); childOptions.push(h("el-option", { props: { label: item.label, value: item.value } }, null));
}); });
return h("el-select", { props: { value: this.pickedId }, on: { change: this.handleChange } }, childOptions); return h("el-select", { props: { size: 'small', value: this.pickedId }, on: { change: this.handleChange } }, childOptions);
}, },
}; };
@ -59,8 +59,8 @@ export default function () {
width: 240, width: 240,
subcomponent: TableOperaionComponent, subcomponent: TableOperaionComponent,
options: [ options: [
{ name: "preview", permission: "pms:reportSheet:preview" }, { name: "preview", emitFull: true, permission: "pms:reportSheet:preview" },
{ name: "design", permission: "pms:reportSheet:design" }, { name: "design", emitFull: true, permission: "pms:reportSheet:design" },
"edit", "edit",
{ name: "delete", emitFull: true, permission: "pms:reportSheet:delete" }, { name: "delete", emitFull: true, permission: "pms:reportSheet:delete" },
], ],

View File

@ -25,6 +25,11 @@ module.exports = {
overlay: { overlay: {
errors: true, errors: true,
warnings: true warnings: true
},
proxy: {
'/pms-am/ureport/preview': {
target: 'http://192.168.1.62:8080/' // TODO: 线上发布时需修改此处
}
} }
} }
} }