From 3d74a46342ae048ac078f38c363919456b8b16f4 Mon Sep 17 00:00:00 2001 From: ljx <864490211@qq.com> Date: Fri, 8 Aug 2025 16:44:22 +0800 Subject: [PATCH] =?UTF-8?q?=E3=80=90=E5=A0=A1=E5=BA=A7=E3=80=91=E3=80=90?= =?UTF-8?q?=E6=81=92=E9=80=9A=E8=BE=BEBI=E3=80=91=E6=81=92=E9=80=9A?= =?UTF-8?q?=E8=BE=BE=E6=95=B0=E5=AD=97=E5=8C=96=E6=99=BA=E8=83=BD=E5=B7=A5?= =?UTF-8?q?=E5=8E=82=E8=B4=A8=E9=87=8F=E7=9C=8B=E6=9D=BF=20=E9=9C=80?= =?UTF-8?q?=E8=A6=81=E6=8E=A5=E5=85=A5=E6=95=B0=E6=8D=AE=20q=3D6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/App.vue | 19 +++--- src/api.js | 2 +- src/components/baozuo-demo2/CenterCmp.vue | 70 +++++++--------------- src/components/baozuo-demo2/LeftChart1.vue | 21 ++++--- src/components/baozuo-demo2/LeftChart2.vue | 5 +- src/components/baozuo-demo2/pieChart.vue | 13 +++- 6 files changed, 59 insertions(+), 71 deletions(-) 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 @@