qianlishi 3 years ago
parent 6cf86c3a40
commit 924a532ed6

@ -32,7 +32,7 @@ export const constantRouterMap = [
}, },
{ {
path: '/aj/**', path: '/aj/**',
component: () => import('@/views/report/aj'), component: () => import('@/views/bigScreenReport/aj'),
hidden: true hidden: true
}, },
{ {
@ -155,7 +155,7 @@ export const constantRouterMap = [
{ {
path: 'bigscreen', path: 'bigscreen',
name: 'bigscreen', name: 'bigscreen',
component: () => import('@/views/report/bigscreen/index'), component: () => import('@/views/bigScreenReport/bigscreen/index'),
meta: { meta: {
title: '大屏报表', title: '大屏报表',
icon: 'iconchufaqipeizhi-hui', icon: 'iconchufaqipeizhi-hui',
@ -230,7 +230,7 @@ export const constantRouterMap = [
}, },
{ {
path: '/bigscreen/viewer', path: '/bigscreen/viewer',
component: () => import('@/views/report/bigscreen/viewer'), component: () => import('@/views/bigScreenReport/bigscreen/viewer'),
hidden: true, hidden: true,
meta: { meta: {
requireAuth: true requireAuth: true
@ -238,7 +238,7 @@ export const constantRouterMap = [
}, },
{ {
path: '/bigscreen/designer', path: '/bigscreen/designer',
component: () => import('@/views/report/bigscreen/designer'), component: () => import('@/views/bigScreenReport/bigscreen/designer'),
hidden: true, hidden: true,
meta: { meta: {
requireAuth: true requireAuth: true

@ -0,0 +1,85 @@
<!--
* @Author: lide1202@hotmail.com
* @Date: 2021-3-13 11:04:24
* @Last Modified by: lide1202@hotmail.com
* @Last Modified time: 2021-3-13 11:04:24
!-->
<template>
<div>
<el-dialog
title="请输入分享码"
:visible.sync="dialogVisible"
width="30%"
:close-on-click-modal="false"
:before-close="handleClose"
>
<el-input v-model="password" placeholder="请输入分享码"></el-input>
<span slot="footer" class="dialog-footer">
<el-button @click="dialogVisible = false"> </el-button>
<el-button type="primary" @click="checkPassword()"> </el-button>
</span>
</el-dialog>
</div>
</template>
<script>
import { reportShareDetailByCode } from "@/api/reportShare";
import { setShareToken } from "@/utils/auth";
export default {
name: "Report",
components: {},
data() {
return {
password: "",
sharePassword: "",
dialogVisible: false,
reportCode: "",
shareToken: ""
};
},
created() {
this.handleOpen();
},
methods: {
async handleOpen() {
const url = window.location.href;
const shareCode = url.substring(url.lastIndexOf("/") + 1);
const { code, data } = await reportShareDetailByCode(shareCode);
if (code != "200") return;
this.reportCode = data.reportCode;
this.sharePassword = data.sharePassword;
this.shareToken = data.shareToken;
if (this.sharePassword) {
this.dialogVisible = true;
} else {
this.pushAj();
}
},
checkPassword() {
const md5 = require("js-md5");
const inputPassword = md5(this.password);
if (inputPassword == this.sharePassword) {
this.pushAj();
} else {
this.$message.error("分享码输入不正确");
}
},
pushAj() {
setShareToken(this.shareToken);
this.$router.push({
path: "/bigscreen/viewer",
query: {
reportCode: this.reportCode
}
});
},
handleClose(done) {
this.$confirm("确认关闭?")
.then(_ => {
done();
})
.catch(_ => {});
}
}
};
</script>

@ -1,4 +1,5 @@
<!-- <!--
* @Descripttion: 报表设计--大屏报表列表
* @Author: lide1202@hotmail.com * @Author: lide1202@hotmail.com
* @Date: 2021-3-13 11:04:24 * @Date: 2021-3-13 11:04:24
* @Last Modified by: lide1202@hotmail.com * @Last Modified by: lide1202@hotmail.com

@ -1,94 +0,0 @@
<!--
* @Author: lide1202@hotmail.com
* @Date: 2021-3-13 11:04:24
* @Last Modified by: lide1202@hotmail.com
* @Last Modified time: 2021-3-13 11:04:24
!-->
<template>
<div>
<el-dialog
title="请输入分享码"
:visible.sync="dialogVisible"
width="30%"
:close-on-click-modal="false"
:before-close="handleClose">
<el-input v-model="password" placeholder="请输入分享码"></el-input>
<span slot="footer" class="dialog-footer">
<el-button @click="dialogVisible = false"> </el-button>
<el-button type="primary" @click="checkPassword()"> </el-button>
</span>
</el-dialog>
</div>
</template>
<script>
import { reportShareDetailByCode} from '@/api/reportShare'
import { setShareToken } from '@/utils/auth'
export default {
name: "Report",
components: {
},
data() {
return {
password: '',
sharePassword: '',
dialogVisible: false,
reportCode: '',
shareToken: ''
};
},
created() {
this.handleOpen()
},
methods: {
async handleOpen() {
const url = window.location.href
const shareCode = url.substring(url.lastIndexOf("/") + 1);
console.log(shareCode)
const {code, data} = await reportShareDetailByCode(shareCode)
if (code != '200') return
console.log(data)
this.reportCode = data.reportCode
this.sharePassword = data.sharePassword
this.shareToken = data.shareToken
if (this.sharePassword) {
console.log(this.sharePassword)
this.dialogVisible = true
}else {
this.pushAj()
}
},
checkPassword(){
const md5 = require('js-md5')
const inputPassword = md5(this.password);
console.log(this.password +'--------------'+inputPassword + "--------" + this.sharePassword)
if (inputPassword == this.sharePassword) {
this.pushAj()
}else {
this.$message.error('分享码输入不正确')
}
},
pushAj(){
setShareToken(this.shareToken)
this.$router.push({
path: '/bigscreen/viewer',
query: {
reportCode: this.reportCode
},
})
},
handleClose(done) {
this.$confirm('确认关闭?')
.then(_ => {
done();
})
.catch(_ => {});
}
}
};
</script>
Loading…
Cancel
Save