提交 c17c9d19 authored 作者: 苏帅's avatar 苏帅

fix(创新示范大屏):跳转信用评价大屏

上级 16c255f5
window.baseURL = {
prodUrl: "/api",
devUrl: "http://192.168.62.77:9095",
devUrl: "http://192.168.102.153:9095",
qyxypj: "http://192.168.102.153:9098", //获取token接口
// devUrl: "http://192.168.102.183:9095",
// devUrl: "http://192.168.102.220:9095",
xypjUrl:"http://222.75.116.235:9020", //信用评价线上地址
xypjUrl: "http://222.75.116.235:9020/#/", //信用评价线上地址
// xypjUrl: "http://192.168.100.220:99/#/",
// xypjUrl: "http://192.168.101.243:81/#/",
api: ''
}
\ No newline at end of file
}
\ No newline at end of file
......@@ -2,27 +2,28 @@ import Axios from "axios"
import responseMiddle from "./responseMiddle"
const ENV_PARAMS = import.meta.env; // 这是Vite官方指导获取环境变量的方式
/**
* 判断是生产环境还是本地环境
* 生成环境使用 /api 前缀
* 本地环境使用 /mock 前缀
*/
export const getBaseUrl = (): string => {
const { DEV, VITE_DEV_API, VITE_PRD_API } = ENV_PARAMS;
return DEV ? VITE_DEV_API : VITE_PRD_API;
};
// export const getBaseUrl = (): string => {
// const { DEV, VITE_DEV_API, VITE_PRD_API } = ENV_PARAMS;
// return DEV ? VITE_DEV_API : VITE_PRD_API;
// };
// console.log(getBaseUrl(),'getBaseUrl()');
const axios = Axios.create({
baseURL: getBaseUrl(),
// baseURL: getBaseUrl(),
baseURL: window.baseURL.devUrl,
timeout: 1000,
});
// 添加请求拦截器
axios.interceptors.request.use(function (config) {
config.headers['Authorization'] = 'Bearer ' + localStorage.getItem("cxsf_echarts_token")
// 在发送请求之前做些什么
return config;
}, function (error) {
......
......@@ -219,10 +219,14 @@ export default defineComponent({
methods: {
//跳转到信用评价
goxypj() {
const { xypjUrl = "" } = window.baseURL || {};
if (xypjUrl) {
//window.location.href = xypjUrl;
window.open(xypjUrl, "_blank");
// const { xypjUrl = "" } = window.baseURL || {};
const xypjUrl = window.baseURL.xypjUrl
// const xypjUrl = "http://192.168.101.243:81/#/"
const token = localStorage.getItem("xypjToken")
const qyxypj = xypjUrl + 'sso?token=' + token +'&route=bigData'
if (qyxypj) {
// window.location.href = qyxypj;
window.open(qyxypj, "_blank");
}
},
// getCycleData() {
......
import request from "@/axios";
export const bigscreen = async (username: string, password: string) => {
return request({
url: "/fb/bigscreen",
method: "get",
})
}
\ No newline at end of file
......@@ -2,10 +2,37 @@
<el-row class="map-warpper" :gutter="16">
<el-col class="map-left" :span="8">
<div class="performance-com card-item">
<Performance />
<div v-for="item in tableData" :key="item.id">
<div v-if="(item.dictLabel == '全省军民融合创新示范绩效评价情况' && item.sort == 1 && item.isView == '1')">
<Performance />
</div>
<div v-if="(item.dictLabel == '创新示范区县(市、区)排名' && item.sort == 1 && item.isView == '1')">
<RankList />
</div>
<div v-if="(item.dictLabel == '红榜' && item.sort == 1 && item.isView == '1')">
<InvestmentProgress />
</div>
<div v-if="(item.dictLabel == '指标预警' && item.sort == 1 && item.isView == '1')">
<IndicatorWarning />
</div>
</div>
</div>
<div class="performance-com card-item">
<InvestmentProgress />
<div v-for="item in tableData" :key="item.id">
<div v-if="(item.dictLabel == '全省军民融合创新示范绩效评价情况' && item.sort == 3 && item.isView == '1')">
<Performance />
</div>
<div v-if="(item.dictLabel == '创新示范区县(市、区)排名' && item.sort == 3 && item.isView == '1')">
<RankList />
</div>
<div v-if="(item.dictLabel == '红榜' && item.sort == 3 && item.isView == '1')">
<InvestmentProgress />
</div>
<div v-if="(item.dictLabel == '指标预警' && item.sort == 3 && item.isView == '1')">
<IndicatorWarning />
</div>
</div>
<!-- <InvestmentProgress /> -->
</div>
</el-col>
<el-col :span="9">
......@@ -26,10 +53,38 @@
<el-col :span="7">
<div class="map-right">
<div class="card-item rank-list">
<RankList />
<div v-for="item in tableData" :key="item.id">
<div v-if="(item.dictLabel == '全省军民融合创新示范绩效评价情况' && item.sort == 2 && item.isView == '1')">
<Performance />
</div>
<div v-if="(item.dictLabel == '创新示范区县(市、区)排名' && item.sort == 2 && item.isView == '1')">
<RankList />
</div>
<div v-if="(item.dictLabel == '红榜' && item.sort == 2 && item.isView == '1')">
<InvestmentProgress />
</div>
<div v-if="(item.dictLabel == '指标预警' && item.sort == 2 && item.isView == '1')">
<IndicatorWarning />
</div>
</div>
<!-- <RankList /> -->
</div>
<div class="card-item incom-graphic">
<IndicatorWarning />
<div v-for="item in tableData" :key="item.id">
<div v-if="(item.dictLabel == '全省军民融合创新示范绩效评价情况' && item.sort == 4 && item.isView == '1')">
<Performance />
</div>
<div v-if="(item.dictLabel == '创新示范区县(市、区)排名' && item.sort == 4 && item.isView == '1')">
<RankList />
</div>
<div v-if="(item.dictLabel == '红榜' && item.sort == 4 && item.isView == '1')">
<InvestmentProgress />
</div>
<div v-if="(item.dictLabel == '指标预警' && item.sort == 4 && item.isView == '1')">
<IndicatorWarning />
</div>
</div>
<!-- <IndicatorWarning /> -->
</div>
<!-- <div class="card-item incom-graphic">
<Income />
......@@ -44,21 +99,13 @@
<StrongArmyCard />
</el-col>
<el-col class="card-item">
<CardItem
title="军民协同创新"
:infoList="list"
:toPage="dataCenterRouter.INNOVATION"
/>
<CardItem title="军民协同创新" :infoList="list" :toPage="dataCenterRouter.INNOVATION" />
</el-col>
<el-col class="card-item">
<Industrial />
</el-col>
<el-col class="card-item">
<CardItem
:infoList="list2x"
title="资源开放共享"
:toPage="dataCenterRouter.RESORCE_SHARE"
/>
<CardItem :infoList="list2x" title="资源开放共享" :toPage="dataCenterRouter.RESORCE_SHARE" />
</el-col>
<el-col class="card-item">
<SystemConstruct />
......@@ -82,7 +129,13 @@ import { DataCenterRouter } from "@/route/dataCenter";
import Mock from "./cradMock";
import { mapState } from "vuex";
import { bigscreen } from './index.ts'
const BIGSCREEN = {
'全省军民融合创新示范绩效评价情况': Performance,
'创新示范区县(市、区)排名': InvestmentProgress,
'红榜': RankList,
'指标预警': IndicatorWarning
}
export default defineComponent({
components: {
Performance,
......@@ -96,7 +149,7 @@ export default defineComponent({
Industrial,
SystemConstruct,
},
setup() {},
setup() { },
computed: {
...mapState({
curDataType: (state) => state.curDataType,
......@@ -108,7 +161,9 @@ export default defineComponent({
return Mock[this.curDataType].list2x;
},
},
created() {
this.getBigScreen()
},
data() {
return {
dataCenterRouter: DataCenterRouter,
......@@ -121,8 +176,23 @@ export default defineComponent({
"北仑区,海宁市,柯桥区",
"普陀区",
],
tableData: []
};
},
methods: {
getBigScreen() {
bigscreen().then(res => {
this.tableData = res.data
})
},
// getModule(label){
// this.tableData.map(item => {
// for(let list in BIGSCREEN){
// console.log(list);
// }
// })
// }
}
});
</script>
<style lang="scss" scoped>
......@@ -203,7 +273,7 @@ export default defineComponent({
.rank-list {
margin-top: 16px;
height: 312px;
max-height: calc(640px / 2 - 8px);
box-sizing: border-box;
}
}
......@@ -228,9 +298,12 @@ export default defineComponent({
.incom-graphic {
margin-top: 16px;
height: 312px;
max-height: calc(640px / 2 - 8px);
box-sizing: border-box;
}
.rank-list{
max-height: calc(640px / 2 - 8px);
}
}
}
......
......@@ -74,7 +74,7 @@ import { TOKEN_KEY } from "@/utils/enum/token";
import { defineComponent } from "vue";
import { getToken, login } from "./service";
import { DataCenterRouter } from "@/route/dataCenter";
import axios from "axios"
export default defineComponent({
name: "Login",
data() {
......@@ -107,6 +107,7 @@ export default defineComponent({
watch: {},
created() {
localStorage.removeItem(TOKEN_KEY);
localStorage.removeItem('xypjToken');
},
methods: {
wstLogin() {
......@@ -128,17 +129,29 @@ export default defineComponent({
},
handleLogin() {
const loginForm = this.loginForm;
login(loginForm.username, loginForm.password)
login(loginForm)
.then(async (res) => {
const { data } = res;
localStorage.setItem(TOKEN_KEY, data);
const { token } = res;
localStorage.setItem(TOKEN_KEY, token);
this.$router.push(DataCenterRouter.DATA_MAP);
this.getXypjToken()
})
.catch((err) => {
this.$message.error("用户名或密码错误!");
});
},
getXypjToken(){
const loginForm = this.loginForm;
axios({
url:window.baseURL.qyxypj + "/login/external",
method:"POST",
data:loginForm
}).then(res => {
const { token } = res.data;
localStorage.setItem("xypjToken",token)
})
}
},
});
</script>
......
......@@ -13,9 +13,10 @@ export const getToken = async () => {
* @param username
* @param password
*/
export const login = async (username: string, password: string) => {
export const login = async (data:Object) => {
return request({
url: "/user/login?username=" + username + '&password=' + password,
url: "/login",
method: "POST",
data:data
})
}
\ No newline at end of file
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论