Compare commits

..

No commits in common. "fba56eb8614cfe6bec90e1c64cb9c57c3fe73793" and "a809eac53db69b4037e40ffd10a1da0b97bf6f36" have entirely different histories.

8 changed files with 40 additions and 71 deletions

View File

@ -1,82 +1,35 @@
<template>
<div id="app">
<component :is="currentComponent" />
<datav2 v-if="dataType==4"/>
<datav3 v-else-if="dataType==5"/>
<datav v-else/>
</div>
</template>
<script>
import datav from './components/baozuo-demo/index.vue'
import datav2 from './components/baozuo-demo2/index.vue'
import datav3 from './components/baozuo-demo3/index.vue'
// import datav from './components/datav/index.vue'
// import datav from './components/zidingyi/index.vue'
import api from './api.js'
//import testRes from './components/baozuo-demo/test'
const queryParams = new URLSearchParams(window.location.search);
const dataTypeParam = queryParams.get('q');
export default {
name: 'app',
components: {
datav,datav2,datav3
},
data() {
return {
dataType: '',
//testRes
currentComponent: null
dataType: ''
}
},
components: {
//
datav2: () => import('./components/baozuo-demo2/index.vue'),
datav: () => import('./components/baozuo-demo/index.vue')
},
created() {
this.dataType = dataTypeParam;
if (this.dataType == '3') {
this.init();
} else {
this.currentComponent = this.dataType == 4 ? 'datav2' : 'datav';
}
},
computed: {
},
methods: {
init() {
/**
* 获取当前地址
* @returns {string} 当前地址
*/
function getCurrentAddress() {
if (typeof window !== 'undefined' && window.location) {
return window.location.origin;
} else {
console.warn('当前环境非浏览器环境,无法使用 window.location 获取地址');
return null;
}
}
console.log(api.baseURL)
if (getCurrentAddress().includes('192.168') || api.baseURL.includes('natool')) {
console.log('当前环境为开发环境');
api.post2('/api/web/getBiData', ["yx_v_scgdgk", "yx_v_byzcl", "yx_v_wwcscdd", "yx_v_bzcl1w", "yx_v_bzcl6m", "yx_v_pgjd"]).then(res => {
window.htd_bidata = res;
console.log(window.htd_bidata);
this.currentComponent = 'datav';
}).catch(() => {
//window.htd_bidata = testRes;
console.log(window.htd_bidata);
this.currentComponent = 'datav';
})
} else {
//window.htd_bidata = testRes;
this.currentComponent = 'datav';
}
}
computed: {
}
}
</script>

View File

@ -8,8 +8,6 @@ const api = {
baseURL: 'http://36.139.158.169:9261',
baseURL3: 'http://vmikhs.demo.natool.cn',
get (url) {
return new Promise((resolve, reject) => {
axios({

View File

@ -29,7 +29,7 @@
<script>
import LabelTag from './LabelTag'
let testRes = window.htd_bidata;
import testRes from './test'
let timer = null;
export default {
name: 'BottomCharts',

View File

@ -122,8 +122,7 @@
import LabelTag from './LabelTag'
import PieChart from './pieChart.vue'
import * as echarts from 'echarts';
let testRes = window.htd_bidata;
import testRes from './test'
console.log(testRes)
export default {

View File

@ -26,8 +26,7 @@ function getRecentWeekDates() {
}
import * as echarts from 'echarts';
let testRes = window.htd_bidata;
import testRes from './test';
console.log(testRes)
export default {
name: 'RoseChart',

View File

@ -23,8 +23,7 @@ function getRecentSixMonths() {
return months;
}
let testRes = window.htd_bidata;
import testRes from './test';
console.log(testRes)
export default {
name: 'RoseChart',

View File

@ -36,7 +36,7 @@
<script>
import * as echarts from 'echarts';
let testRes = window.htd_bidata;
import testRes from './test'
console.log(testRes)
export default {
name: 'RoseChart',

View File

@ -1,4 +1,4 @@
import api from '../../api.js'
let testRes = {
"code": "200",
"data": {
@ -3197,7 +3197,28 @@ let testRes = {
]
}
}
/**
* 获取当前地址
* @returns {string} 当前地址
*/
function getCurrentAddress() {
if (typeof window !== 'undefined' && window.location) {
return window.location.origin;
} else {
console.warn('当前环境非浏览器环境,无法使用 window.location 获取地址');
return null;
}
}
if(getCurrentAddress().includes('192.168')){
console.log('当前环境为开发环境');
api.post2('/api/web/getBiData').then(res => {
if(res.code === 200){
testRes = res;
}
})
}else{
console.log('当前环境为生产环境');
}
export default testRes