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,10 +13,12 @@ export function insertDashboard(data) { | ||
| 13 | 13 | ||
| 14 | // 预览、查询大屏详情 | 14 | // 预览、查询大屏详情 |
| 15 | export function detailDashboard(data) { | 15 | export function detailDashboard(data) { |
| 16 | + let reportCode = data.reportCode; | ||
| 16 | return request({ | 17 | return request({ |
| 17 | - url: 'reportDashboard/' + data, | 18 | + url: 'reportDashboard/' + reportCode, |
| 18 | headers: { 'Share-Token': getShareToken(), 'Authorization': getToken() }, | 19 | headers: { 'Share-Token': getShareToken(), 'Authorization': getToken() }, |
| 19 | method: 'get', | 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,7 +33,8 @@ export default { | ||
| 33 | sharePassword: "", | 33 | sharePassword: "", |
| 34 | dialogVisible: false, | 34 | dialogVisible: false, |
| 35 | reportCode: "", | 35 | reportCode: "", |
| 36 | - shareToken: "" | 36 | + shareToken: "", |
| 37 | + otherParam:"" | ||
| 37 | }; | 38 | }; |
| 38 | }, | 39 | }, |
| 39 | 40 | ||
| @@ -49,6 +50,9 @@ export default { | @@ -49,6 +50,9 @@ export default { | ||
| 49 | this.reportCode = data.reportCode; | 50 | this.reportCode = data.reportCode; |
| 50 | this.sharePassword = data.sharePassword; | 51 | this.sharePassword = data.sharePassword; |
| 51 | this.shareToken = data.shareToken; | 52 | this.shareToken = data.shareToken; |
| 53 | + if(this.isNotBlank(data.otherParam)){ | ||
| 54 | + this.otherParam = "?"+data.otherParam; | ||
| 55 | + } | ||
| 52 | if (this.sharePassword) { | 56 | if (this.sharePassword) { |
| 53 | this.dialogVisible = true; | 57 | this.dialogVisible = true; |
| 54 | } else { | 58 | } else { |
| @@ -65,11 +69,12 @@ export default { | @@ -65,11 +69,12 @@ export default { | ||
| 65 | } | 69 | } |
| 66 | }, | 70 | }, |
| 67 | pushAj() { | 71 | pushAj() { |
| 72 | + console.log("ssss",this.reportCode,this.otherParam) | ||
| 68 | setShareToken(this.shareToken); | 73 | setShareToken(this.shareToken); |
| 69 | this.$router.push({ | 74 | this.$router.push({ |
| 70 | path: "/bigscreen/viewer", | 75 | path: "/bigscreen/viewer", |
| 71 | query: { | 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,7 +554,7 @@ export default { | ||
| 554 | this.layerWidget = layerWidgetArr; | 554 | this.layerWidget = layerWidgetArr; |
| 555 | }, | 555 | }, |
| 556 | async initEchartData() { | 556 | async initEchartData() { |
| 557 | - const reportCode = this.$route.query.reportCode; | 557 | + const reportCode = this.$route.query; |
| 558 | this.$showLoading(); | 558 | this.$showLoading(); |
| 559 | const { code, data } = await detailDashboard(reportCode); | 559 | const { code, data } = await detailDashboard(reportCode); |
| 560 | this.$hideLoading(); | 560 | this.$hideLoading(); |
src/views/bigscreenDesigner/viewer/index.vue
| @@ -39,7 +39,7 @@ export default { | @@ -39,7 +39,7 @@ export default { | ||
| 39 | methods: { | 39 | methods: { |
| 40 | ...mapMutations('dataSource', ['SET_STATIC_DATA','SET_REFRESHTIME']), | 40 | ...mapMutations('dataSource', ['SET_STATIC_DATA','SET_REFRESHTIME']), |
| 41 | async getData() { | 41 | async getData() { |
| 42 | - const reportCode = this.$route.query.reportCode; | 42 | + const reportCode = this.$route.query; |
| 43 | this.$showLoading(); | 43 | this.$showLoading(); |
| 44 | const { code, data } = await detailDashboard(reportCode); | 44 | const { code, data } = await detailDashboard(reportCode); |
| 45 | this.$hideLoading(); | 45 | this.$hideLoading(); |
src/views/screenDesigner/index.vue
| @@ -153,7 +153,7 @@ export default { | @@ -153,7 +153,7 @@ export default { | ||
| 153 | methods: { | 153 | methods: { |
| 154 | // 初始化 echrats | 154 | // 初始化 echrats |
| 155 | async initEchartData() { | 155 | async initEchartData() { |
| 156 | - const reportCode = this.$route.query.reportCode; | 156 | + const reportCode = this.$route.query; |
| 157 | const { code, data } = await detailDashboard(reportCode); | 157 | const { code, data } = await detailDashboard(reportCode); |
| 158 | if (code != 200) return; | 158 | if (code != 200) return; |
| 159 | const processData = handleInitEchartsData(data, getToolByCode); | 159 | const processData = handleInitEchartsData(data, getToolByCode); |
src/views/screenDesigner/preview.vue
| 1 | <!-- | 1 | <!-- |
| 2 | * @Descripttion: 大屏设置器 | 2 | * @Descripttion: 大屏设置器 |
| 3 | - * @version: | 3 | + * @version: |
| 4 | * @Author: qianlishi | 4 | * @Author: qianlishi |
| 5 | * @Date: 2022-03-14 14:05:15 | 5 | * @Date: 2022-03-14 14:05:15 |
| 6 | * @LastEditors: qianlishi | 6 | * @LastEditors: qianlishi |
| @@ -38,7 +38,7 @@ export default { | @@ -38,7 +38,7 @@ export default { | ||
| 38 | }, | 38 | }, |
| 39 | methods: { | 39 | methods: { |
| 40 | async getData() { | 40 | async getData() { |
| 41 | - const reportCode = this.$route.query.reportCode; | 41 | + const reportCode = this.$route.query; |
| 42 | const { code, data } = await detailDashboard(reportCode); | 42 | const { code, data } = await detailDashboard(reportCode); |
| 43 | if (code != 200) return; | 43 | if (code != 200) return; |
| 44 | const equipment = document.body.clientWidth; | 44 | const equipment = document.body.clientWidth; |