提交 828fc014 authored 作者: 苏帅's avatar 苏帅

fix(创新示范分保大屏)请求接口逻辑修改

上级 77e5eaa7
<!DOCTYPE html>
<html lang="en">
<head>
<head>
<meta charset="UTF-8" />
<link rel="icon" href="/favicon.ico" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>创新示范平台</title>
<script src="./public/config.js"></script>
</head>
<body>
<script src="./config.js"></script>
</head>
<body>
<div id="app"></div>
<script type="module" src="/src/main.ts"></script>
</body>
</html>
</body>
</html>
\ No newline at end of file
window.baseURL = {
prodUrl: "/api",
devUrl: "http://192.168.102.153:9095",
qyxypj: "http://192.168.102.153:9098", //获取token接口
devUrl: "http://192.168.100.220:9085",
qyxypj: "http://192.168.100.220: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://192.168.100.220:99/#/",
// xypjUrl: "http://192.168.101.243:81/#/",
// 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
......@@ -160,17 +160,21 @@ export default defineComponent({
],
curYearIndex: 5,
token: '',
username:'',
password:''
};
},
created() {
// 获取token
this.getXypjToken()
const url = window.location.href;
const str = url.split('?token=')[1] || '';
const token = str.split(this.$route.href)[0];
const token = str.split('&name=')[0];
const nameStr = str.split('&name=')[1].split('&')[0]
const passStr = str.split('&pass=')[1].split('#')[0]
this.username = decodeURI(nameStr)
this.password = passStr
this.token = token;
sessionStorage.setItem("cxsf_echarts_token",token)
console.log(this.years, 'years');
this.years.map((item, index) => {
if (index == this.curYearIndex) {
this.$store.commit("SET_CUR_DATA_TYPE", item.value);
......@@ -178,6 +182,7 @@ export default defineComponent({
this.$store.commit("SET_CUR_DATA", { year: item.year, quarter: item.quarter });
}
})
this.getXypjToken()
},
computed: {
...mapState({
......@@ -225,17 +230,21 @@ export default defineComponent({
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'
const qyxypj = xypjUrl + '/#/sso?token=' + token +'&route=bigData'
if (qyxypj) {
// window.location.href = qyxypj;
window.open(qyxypj, "_blank");
window.location.href = qyxypj;
// window.open(qyxypj, "_blank");
}
},
getXypjToken(){
// const loginForm = this.loginForm;
const loginForm = {
username:this.username,
password:this.password,
}
axios({
url:window.baseURL.qyxypj + "/login/external",
method:"POST",
data:loginForm,
headers: { 'Authorization': 'Bearer ' + this.token }
}).then(res => {
const { token } = res.data;
......
......@@ -3,32 +3,32 @@
<el-col class="map-left" :span="8">
<div class="performance-com card-item">
<div v-for="item in tableData" :key="item.id">
<div v-if="(item.dictLabel == '全省军民融合创新示范绩效评价情况' && item.sort == 1 && item.isView == '1')">
<div v-if="(item.dictLabel == '全省军民融合创新示范绩效评价情况' && item.sortIndex == 1 && item.isView == '1')">
<Performance />
</div>
<div v-if="(item.dictLabel == '创新示范区县(市、区)排名' && item.sort == 1 && item.isView == '1')">
<div v-if="(item.dictLabel == '创新示范区县(市、区)排名' && item.sortIndex == 1 && item.isView == '1')">
<RankList />
</div>
<div v-if="(item.dictLabel == '红榜' && item.sort == 1 && item.isView == '1')">
<div v-if="(item.dictLabel == '红榜' && item.sortIndex == 1 && item.isView == '1')">
<InvestmentProgress />
</div>
<div v-if="(item.dictLabel == '指标预警' && item.sort == 1 && item.isView == '1')">
<div v-if="(item.dictLabel == '指标预警' && item.sortIndex == 1 && item.isView == '1')">
<IndicatorWarning />
</div>
</div>
</div>
<div class="performance-com card-item">
<div v-for="item in tableData" :key="item.id">
<div v-if="(item.dictLabel == '全省军民融合创新示范绩效评价情况' && item.sort == 3 && item.isView == '1')">
<div v-if="(item.dictLabel == '全省军民融合创新示范绩效评价情况' && item.sortIndex == 3 && item.isView == '1')">
<Performance />
</div>
<div v-if="(item.dictLabel == '创新示范区县(市、区)排名' && item.sort == 3 && item.isView == '1')">
<div v-if="(item.dictLabel == '创新示范区县(市、区)排名' && item.sortIndex == 3 && item.isView == '1')">
<RankList />
</div>
<div v-if="(item.dictLabel == '红榜' && item.sort == 3 && item.isView == '1')">
<div v-if="(item.dictLabel == '红榜' && item.sortIndex == 3 && item.isView == '1')">
<InvestmentProgress />
</div>
<div v-if="(item.dictLabel == '指标预警' && item.sort == 3 && item.isView == '1')">
<div v-if="(item.dictLabel == '指标预警' && item.sortIndex == 3 && item.isView == '1')">
<IndicatorWarning />
</div>
</div>
......@@ -54,16 +54,16 @@
<div class="map-right">
<div class="card-item rank-list">
<div v-for="item in tableData" :key="item.id">
<div v-if="(item.dictLabel == '全省军民融合创新示范绩效评价情况' && item.sort == 2 && item.isView == '1')">
<div v-if="(item.dictLabel == '全省军民融合创新示范绩效评价情况' && item.sortIndex == 2 && item.isView == '1')">
<Performance />
</div>
<div v-if="(item.dictLabel == '创新示范区县(市、区)排名' && item.sort == 2 && item.isView == '1')">
<div v-if="(item.dictLabel == '创新示范区县(市、区)排名' && item.sortIndex == 2 && item.isView == '1')">
<RankList />
</div>
<div v-if="(item.dictLabel == '红榜' && item.sort == 2 && item.isView == '1')">
<div v-if="(item.dictLabel == '红榜' && item.sortIndex == 2 && item.isView == '1')">
<InvestmentProgress />
</div>
<div v-if="(item.dictLabel == '指标预警' && item.sort == 2 && item.isView == '1')">
<div v-if="(item.dictLabel == '指标预警' && item.sortIndex == 2 && item.isView == '1')">
<IndicatorWarning />
</div>
</div>
......@@ -71,16 +71,16 @@
</div>
<div class="card-item incom-graphic">
<div v-for="item in tableData" :key="item.id">
<div v-if="(item.dictLabel == '全省军民融合创新示范绩效评价情况' && item.sort == 4 && item.isView == '1')">
<div v-if="(item.dictLabel == '全省军民融合创新示范绩效评价情况' && item.sortIndex == 4 && item.isView == '1')">
<Performance />
</div>
<div v-if="(item.dictLabel == '创新示范区县(市、区)排名' && item.sort == 4 && item.isView == '1')">
<div v-if="(item.dictLabel == '创新示范区县(市、区)排名' && item.sortIndex == 4 && item.isView == '1')">
<RankList />
</div>
<div v-if="(item.dictLabel == '红榜' && item.sort == 4 && item.isView == '1')">
<div v-if="(item.dictLabel == '红榜' && item.sortIndex == 4 && item.isView == '1')">
<InvestmentProgress />
</div>
<div v-if="(item.dictLabel == '指标预警' && item.sort == 4 && item.isView == '1')">
<div v-if="(item.dictLabel == '指标预警' && item.sortIndex == 4 && item.isView == '1')">
<IndicatorWarning />
</div>
</div>
......@@ -187,7 +187,14 @@ export default defineComponent({
method:"GET",
headers: { 'Authorization': 'Bearer ' + sessionStorage.getItem("cxsf_echarts_token") }
}).then(res => {
this.tableData = res.data.data
// this.tableData = res.data.data
let data = res.data.data.sort(function(a,b){
return a.sort-b.sort
})
this.tableData = data.map((item,index) => {
item.sortIndex = index+1
return item
})
})
},
// getModule(label){
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论