Commit 932727e2e8eb98bf62c782ceea505a5b899b94ba
1 parent
6a0b895b
1、大屏支持分享 获取地址栏传参数,数据源根据地址栏传参替换报表中参数(配合ERP推送消息使用)
Showing
6 changed files
with
15 additions
and
8 deletions
src/api/bigscreen.js
| ... | ... | @@ -13,10 +13,12 @@ export function insertDashboard(data) { |
| 13 | 13 | |
| 14 | 14 | // 预览、查询大屏详情 |
| 15 | 15 | export function detailDashboard(data) { |
| 16 | + let reportCode = data.reportCode; | |
| 16 | 17 | return request({ |
| 17 | - url: 'reportDashboard/' + data, | |
| 18 | + url: 'reportDashboard/' + reportCode, | |
| 18 | 19 | headers: { 'Share-Token': getShareToken(), 'Authorization': getToken() }, |
| 19 | 20 | method: 'get', |
| 21 | + params: data | |
| 20 | 22 | }) |
| 21 | 23 | } |
| 22 | 24 | ... | ... |
src/views/bigScreenReport/aj/index.vue
| ... | ... | @@ -33,7 +33,8 @@ export default { |
| 33 | 33 | sharePassword: "", |
| 34 | 34 | dialogVisible: false, |
| 35 | 35 | reportCode: "", |
| 36 | - shareToken: "" | |
| 36 | + shareToken: "", | |
| 37 | + otherParam:"" | |
| 37 | 38 | }; |
| 38 | 39 | }, |
| 39 | 40 | |
| ... | ... | @@ -49,6 +50,9 @@ export default { |
| 49 | 50 | this.reportCode = data.reportCode; |
| 50 | 51 | this.sharePassword = data.sharePassword; |
| 51 | 52 | this.shareToken = data.shareToken; |
| 53 | + if(this.isNotBlank(data.otherParam)){ | |
| 54 | + this.otherParam = "?"+data.otherParam; | |
| 55 | + } | |
| 52 | 56 | if (this.sharePassword) { |
| 53 | 57 | this.dialogVisible = true; |
| 54 | 58 | } else { |
| ... | ... | @@ -65,11 +69,12 @@ export default { |
| 65 | 69 | } |
| 66 | 70 | }, |
| 67 | 71 | pushAj() { |
| 72 | + console.log("ssss",this.reportCode,this.otherParam) | |
| 68 | 73 | setShareToken(this.shareToken); |
| 69 | 74 | this.$router.push({ |
| 70 | 75 | path: "/bigscreen/viewer", |
| 71 | 76 | query: { |
| 72 | - reportCode: this.reportCode | |
| 77 | + reportCode: this.reportCode+this.otherParam, | |
| 73 | 78 | } |
| 74 | 79 | }); |
| 75 | 80 | }, | ... | ... |
src/views/bigscreenDesigner/designer/index.vue
| ... | ... | @@ -554,7 +554,7 @@ export default { |
| 554 | 554 | this.layerWidget = layerWidgetArr; |
| 555 | 555 | }, |
| 556 | 556 | async initEchartData() { |
| 557 | - const reportCode = this.$route.query.reportCode; | |
| 557 | + const reportCode = this.$route.query; | |
| 558 | 558 | this.$showLoading(); |
| 559 | 559 | const { code, data } = await detailDashboard(reportCode); |
| 560 | 560 | this.$hideLoading(); | ... | ... |
src/views/bigscreenDesigner/viewer/index.vue
| ... | ... | @@ -39,7 +39,7 @@ export default { |
| 39 | 39 | methods: { |
| 40 | 40 | ...mapMutations('dataSource', ['SET_STATIC_DATA','SET_REFRESHTIME']), |
| 41 | 41 | async getData() { |
| 42 | - const reportCode = this.$route.query.reportCode; | |
| 42 | + const reportCode = this.$route.query; | |
| 43 | 43 | this.$showLoading(); |
| 44 | 44 | const { code, data } = await detailDashboard(reportCode); |
| 45 | 45 | this.$hideLoading(); | ... | ... |
src/views/screenDesigner/index.vue
| ... | ... | @@ -153,7 +153,7 @@ export default { |
| 153 | 153 | methods: { |
| 154 | 154 | // 初始化 echrats |
| 155 | 155 | async initEchartData() { |
| 156 | - const reportCode = this.$route.query.reportCode; | |
| 156 | + const reportCode = this.$route.query; | |
| 157 | 157 | const { code, data } = await detailDashboard(reportCode); |
| 158 | 158 | if (code != 200) return; |
| 159 | 159 | const processData = handleInitEchartsData(data, getToolByCode); | ... | ... |
src/views/screenDesigner/preview.vue
| 1 | 1 | <!-- |
| 2 | 2 | * @Descripttion: 大屏设置器 |
| 3 | - * @version: | |
| 3 | + * @version: | |
| 4 | 4 | * @Author: qianlishi |
| 5 | 5 | * @Date: 2022-03-14 14:05:15 |
| 6 | 6 | * @LastEditors: qianlishi |
| ... | ... | @@ -38,7 +38,7 @@ export default { |
| 38 | 38 | }, |
| 39 | 39 | methods: { |
| 40 | 40 | async getData() { |
| 41 | - const reportCode = this.$route.query.reportCode; | |
| 41 | + const reportCode = this.$route.query; | |
| 42 | 42 | const { code, data } = await detailDashboard(reportCode); |
| 43 | 43 | if (code != 200) return; |
| 44 | 44 | const equipment = document.body.clientWidth; | ... | ... |