diff --git a/src/App.vue b/src/App.vue
index d14d250..0eec070 100644
--- a/src/App.vue
+++ b/src/App.vue
@@ -29,26 +29,23 @@ export default {
created() {
this.dataType = dataTypeParam;
-
- if (this.dataType == '6') {
- api.post2('/api/web/getBiData', ["yx_v_llzj", "yx_v_cpzj", "yx_v_zlkb", "yx_v_cpzj", "yx_v_byblv", "yx_v_byblzb"]).then(res => {
- console.log(res);
-
- });
- }
-
-
if (this.dataType == '3') {
this.init();
} else {
- window.htd_bidata = testRes;
if (this.dataType == '4') {
+ window.htd_bidata = testRes;
this.currentComponent = 'datav2';
} else if (this.dataType == '5') {
+ window.htd_bidata = testRes;
this.currentComponent = 'datav3';
} else if (this.dataType == '6') {
- this.currentComponent = 'datav2';
+ api.post2('/api/web/getBiData', ["yx_v_llzj", "yx_v_cpzj", "yx_v_zlkb", "yx_v_cpzj", "yx_v_byblv", "yx_v_byblzb"]).then(res => {
+ console.log(res)
+ window.htd_bidata = res;
+ this.currentComponent = 'datav2';
+ });
} else {
+ window.htd_bidata = testRes;
this.currentComponent = 'datav';
}
}
diff --git a/src/api.js b/src/api.js
index 6fbc9ba..dd207d9 100644
--- a/src/api.js
+++ b/src/api.js
@@ -8,7 +8,7 @@ const api = {
baseURL3: 'http://36.139.158.169:9261',
- baseURL: 'http://xynzix.demo.natool.cn',
+ baseURL: 'http://pxozlw.demo.natool.cn',
//堡座
baseURL4: 'http://39.101.165.228:9009',
diff --git a/src/components/baozuo-demo2/CenterCmp.vue b/src/components/baozuo-demo2/CenterCmp.vue
index ef6a0ac..041cfc0 100644
--- a/src/components/baozuo-demo2/CenterCmp.vue
+++ b/src/components/baozuo-demo2/CenterCmp.vue
@@ -11,13 +11,13 @@
-
{{ item.name }}
+
{{ item['类型'] }}
-
{{ item.value }}%
+
{{ item['合格率'] }}%
@@ -30,28 +30,28 @@
当日检验量
-
{{ dataType == '6'?middleTopData2.inspection:middleTopData.inspection }}
+
{{ dataType == '6'?middleTopData2[3]['数量']:middleTopData.inspection }}
{{dataType=='6'?'进水直通率': '机芯直通率'}}
-
{{dataType=='6'?'进水检验量': '机芯检验量'}}:250
+
{{dataType=='6'?'进水检验量': '机芯检验量'}}:{{ middleTopData2[0]['数量'] }}
{{dataType=='6'?'排水直通率': '盖板直通率'}}
-
{{dataType=='6'?'排水检验量': '盖板检验量'}}:580
+
{{dataType=='6'?'排水检验量': '盖板检验量'}}:{{ middleTopData2[1]['数量'] }}
{{dataType=='6'?'按钮直通率': '整机直通率'}}
-
{{dataType=='6'?'按钮检测量': '整机检测量'}}:420
+
{{dataType=='6'?'按钮检测量': '整机检测量'}}:{{ middleTopData2[2]['数量'] }}
@@ -76,9 +76,9 @@
import LabelTag from './LabelTag'
import PieChart from './pieChart.vue'
import * as echarts from 'echarts';
-import testRes from './test'
-
-console.log(testRes)
+// import testRes from './test'
+let testRes = window.htd_bidata;
+console.log('1111',testRes)
export default {
name: 'CenterCmp',
components: {
@@ -91,35 +91,6 @@ export default {
}
},
data () {
- // 定义原始数据
- const originalLeftData = [
-
- { icon: require(`@/img/icons/12.png`), name: '本月订单数', value: '3500' },
- { icon: require(`@/img/icons/12.png`), name: '本月派工数', value: '12500' },
- { icon: require(`@/img/icons/12.png`), name: '派工未完成数', value: '2500' },
- { icon: require(`@/img/icons/12.png`), name: '派工完成率', value: '92.6%' }
- ];
- const originalLeftData2 = [
- { icon: require(`@/img/icons/12.png`), name: '派工数量', value: testRes.data.yx_v_scgdgk[0]["派工数量"] },
- { icon: require(`@/img/icons/12.png`), name: '未完工数量', value: testRes.data.yx_v_scgdgk[0]["未完成数量"] },
- { icon: require(`@/img/icons/12.png`), name: '工单完成率', value: (testRes.data.yx_v_scgdgk[0]["未完成数量"]/testRes.data.yx_v_scgdgk[0]["派工数量"]).toFixed(2)*100+'%' }
- ];
-
- const originalRightData = [
- { icon: require(`@/img/icons/12.png`), name: '保养率', value: 20 },
- { icon: require(`@/img/icons/12.png`), name: '直通率', value: 100 },
- { icon: require(`@/img/icons/12.png`), name: '整机备料率', value: 90 },
- { icon: require(`@/img/icons/12.png`), name: '盖板备料率', value: 85 },
- { icon: require(`@/img/icons/12.png`), name: '机芯备料率', value: 90 },
- ];
- const originalRightData2 = [
- { icon: require(`@/img/icons/12.png`), name: '水件', value: testRes.data.yx_v_wwcscdd[0]["水件"] },
- { icon: require(`@/img/icons/12.png`), name: '排水阀', value: testRes.data.yx_v_wwcscdd[0]["排水阀"] },
- { icon: require(`@/img/icons/12.png`), name: '进水阀', value: testRes.data.yx_v_wwcscdd[0]["进水阀"] },
- { icon: require(`@/img/icons/12.png`), name: '按钮', value: testRes.data.yx_v_wwcscdd[0]["按钮"] }
- ];
-
-
return {
config: {
data: [
@@ -225,11 +196,16 @@ export default {
{ name: '组件', value: 99 },
{ name: '陶瓷', value: 99 }
],
-
- leftData: this.dataType == '3'?originalLeftData2:originalLeftData,
- rightData: this.dataType == '3'?originalRightData2:originalRightData
}
},
+ created(){
+ if(this.dataType == '6'){
+ this.rankData = testRes.data.yx_v_cpzj;
+ this.middleTopData2 = testRes.data.yx_v_zlkb;
+ this.rightChartData2 = testRes.data.yx_v_llzj;
+ }
+
+ },
// 在mounted()中调用
mounted() {
this.initRightChart();
@@ -263,7 +239,7 @@ export default {
},
xAxis: {
type: 'category',
- data: chartData.map(item => item.name),
+ data: chartData.map(item => item['类型']),
axisLabel: {
color: '#fff',
fontSize: 20,
@@ -297,7 +273,7 @@ export default {
},
series: [{
type: 'bar',
- data: chartData.map(item => item.value),
+ data: chartData.map(item => item['合格率']),
barWidth: '40%',
itemStyle: {
color: new echarts.graphic.LinearGradient(0, 0, 0, 1, [
@@ -333,11 +309,11 @@ export default {
},
initGaugeCharts() {
// 机芯直通率
- this.initGaugeChart('gauge-chart-1', this.dataType == '6'?this.middleTopData2.corePassRate: this.middleTopData.corePassRate);
+ this.initGaugeChart('gauge-chart-1', this.dataType == '6'?99.5: this.middleTopData.corePassRate);
// 盖板直通率
- this.initGaugeChart('gauge-chart-2', this.dataType == '6'?this.middleTopData2.coverPassRate: this.middleTopData.coverPassRate);
+ this.initGaugeChart('gauge-chart-2', this.dataType == '6'?99.5: this.middleTopData.coverPassRate);
// 整机直通率
- this.initGaugeChart('gauge-chart-3', this.dataType == '6'?this.middleTopData2.coverPassRate:this.middleTopData.wholePassRate);
+ this.initGaugeChart('gauge-chart-3', this.dataType == '6'?99.5:this.middleTopData.wholePassRate);
},
// 修改仪表盘样式部分
// 修改initGaugeChart方法
diff --git a/src/components/baozuo-demo2/LeftChart1.vue b/src/components/baozuo-demo2/LeftChart1.vue
index 60d7e09..6997533 100644
--- a/src/components/baozuo-demo2/LeftChart1.vue
+++ b/src/components/baozuo-demo2/LeftChart1.vue
@@ -9,7 +9,8 @@