From 5f1bc5f4444b3dd800ffcf2985cfd0744d50c2d3 Mon Sep 17 00:00:00 2001 From: ljx <864490211@qq.com> Date: Sun, 13 Jul 2025 20:49:14 +0800 Subject: [PATCH] =?UTF-8?q?=E7=94=B5=E9=A5=AD=E7=85=B2=E4=BD=BF=E7=94=A8?= =?UTF-8?q?=E6=8E=A5=E5=8F=A3=E6=95=B0=E6=8D=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/api.js | 4 +- src/components/dianfanbao-demo/index.vue | 38 ++++++++++--------- src/components/dianfanbao-demo/newContain.vue | 32 ++++++++-------- .../dianfanbao-demo/newContain2.vue | 17 +++++---- .../dianfanbao-demo/newContain3.vue | 23 +++++++---- .../dianfanbao-demo/newContain4.vue | 9 +++-- .../dianfanbao-demo/newContain5.vue | 9 +++-- 7 files changed, 75 insertions(+), 57 deletions(-) diff --git a/src/api.js b/src/api.js index cf2ff0a..ba2254f 100644 --- a/src/api.js +++ b/src/api.js @@ -8,7 +8,9 @@ const api = { baseURL3: 'http://36.139.158.169:9261', - baseURL: 'http://ppjlar.demo.natool.cn', + // baseURL: 'http://ppjlar.demo.natool.cn', + + baseURL: 'http://39.101.165.228:9009', get (url) { return new Promise((resolve, reject) => { diff --git a/src/components/dianfanbao-demo/index.vue b/src/components/dianfanbao-demo/index.vue index 14deaa6..74625b3 100644 --- a/src/components/dianfanbao-demo/index.vue +++ b/src/components/dianfanbao-demo/index.vue @@ -3,24 +3,24 @@ - -
+ +
- +
- +
- +
-
+
- +
- +
@@ -52,19 +52,21 @@ export default { }, created() { // 获取 URL 查询参数并设置 dataType - const queryParams = new URLSearchParams(window.location.search); - const dataTypeParam = queryParams.get('q'); - console.log(dataTypeParam) - if (dataTypeParam === '1') { - this.dataType = '整机'; - }else if(dataTypeParam === '3'){ - this.dataType = '3'; - }else{ - this.dataType = ''; // 如果不是 '1',则设置为空 - } + // const queryParams = new URLSearchParams(window.location.search); + // const dataTypeParam = queryParams.get('q'); + this.$api.post('/api/pg/GetBIDemo',{ + code:'11' + }).then(res=>{ + console.log(res.data) + if(res.code == 200){ + this.resData = res.data; + } + + }) }, data() { return { + resData:null, dataType:'', dataType2:'整机', switchType: 2 diff --git a/src/components/dianfanbao-demo/newContain.vue b/src/components/dianfanbao-demo/newContain.vue index 3c0e218..c92dcd4 100644 --- a/src/components/dianfanbao-demo/newContain.vue +++ b/src/components/dianfanbao-demo/newContain.vue @@ -13,28 +13,21 @@

总人数:

-

28人

+

{{resData.info.PersonNumber}}人

+
+ +

负责人:

-

张三:19909209201

-
-
-

负责人:

-

李四:19909209201

-
-
-

负责人:

-

王五:19909209201

+

{{item.Name}}:{{ item.Phone }}

+
@@ -56,6 +49,9 @@ export default { LabelTag, }, props: { + resData:{ + type:Object, + }, dataType: { type: String, default: '' @@ -67,6 +63,8 @@ export default { return { } }, + created(){ + }, // 在mounted()中调用 mounted() { diff --git a/src/components/dianfanbao-demo/newContain2.vue b/src/components/dianfanbao-demo/newContain2.vue index ecf4cdf..47a86b1 100644 --- a/src/components/dianfanbao-demo/newContain2.vue +++ b/src/components/dianfanbao-demo/newContain2.vue @@ -17,37 +17,37 @@
产品编码: - 1102030006 + {{resData.info.OrderCode}}
产品名称: - 电炖锅-MD-DGC4018-亮光银SL008-220V-600W-4L-中国-美的-MD-DGC4018- + {{resData.info.InventoryName}}
工单数量: - 1000 + {{resData.info.OrderQuantity}}
已完成数量: - 635 + {{resData.info.DoneQuantity}}
完工进度: - 67.5% + {{resData.info.DoneRate * 100}}%
备料齐套进度: - 98.84% + {{resData.info.MatchQuantity *100}}%
异常工时: - 0H + {{resData.info.ErrorHour}}H
@@ -70,6 +70,9 @@ export default { LabelTag, }, props: { + resData:{ + type:Object, + }, dataType: { type: String, default: '' diff --git a/src/components/dianfanbao-demo/newContain3.vue b/src/components/dianfanbao-demo/newContain3.vue index b15c1d6..956c753 100644 --- a/src/components/dianfanbao-demo/newContain3.vue +++ b/src/components/dianfanbao-demo/newContain3.vue @@ -16,7 +16,7 @@ 产线当日合格率
- 70% + {{resData.defectData.qualifiedRate}}%
@@ -28,13 +28,13 @@
数量
占比
-
-
No.1
-
不通电
-
4
-
30.77%
+
+
No.{{ item.rank }}
+
{{item.defectName}}
+
{{ item.count }}
+
{{item.ratio}}%
-
+
@@ -80,6 +80,9 @@ export default { LabelTag, }, props: { + resData:{ + type:Object, + }, dataType: { type: String, default: '' @@ -94,6 +97,10 @@ export default { ] } }, + created(){ + this.pieData[0].value = this.resData.defectData.qualifiedRate; + this.pieData[1].value = 100 - this.resData.defectData.qualifiedRate; + }, mounted() { this.initPieChart(); }, diff --git a/src/components/dianfanbao-demo/newContain4.vue b/src/components/dianfanbao-demo/newContain4.vue index 85a863f..2cdff05 100644 --- a/src/components/dianfanbao-demo/newContain4.vue +++ b/src/components/dianfanbao-demo/newContain4.vue @@ -27,6 +27,9 @@ export default { LabelTag, }, props: { + resData:{ + type:Object, + }, dataType: { type: String, default: '' @@ -42,8 +45,8 @@ export default { initMixedChart() { const chartDom = document.getElementById('nbc-line1'); const myChart = echarts.init(chartDom); - const actualData = [120, 132, 101, 120, 78, 0]; - const targetData = [120, 132, 101, 134, 90, 0]; + const actualData = this.resData.productionData.actual; + const targetData = this.resData.productionData.target; const option = { tooltip: { trigger: 'axis', @@ -64,7 +67,7 @@ export default { }, xAxis: { type: 'category', - data: ['08:00-09:00', '09:00-10:00', '10:00-12:00', '13:30-15:30', '15:30-17:30', '17:30-19:30'], + data:this.resData.productionData.timeSlots, axisLabel: { fontSize: 14, // 放大 x 轴文字 fontWeight: 'bold', // x 轴文字加粗 diff --git a/src/components/dianfanbao-demo/newContain5.vue b/src/components/dianfanbao-demo/newContain5.vue index bc8f455..b8bc797 100644 --- a/src/components/dianfanbao-demo/newContain5.vue +++ b/src/components/dianfanbao-demo/newContain5.vue @@ -32,6 +32,9 @@ export default { LabelTag, }, props: { + resData:{ + type:Object, + }, dataType: { type: String, default: '' @@ -52,8 +55,8 @@ export default { initMixedChart() { const chartDom = document.getElementById('nbc-line2'); const myChart = echarts.init(chartDom); - const actualData = [10.5, 10.5, 10.5, 10.5, 0, 0]; - const targetData = [10.5, 10.5, 10.5, 10.5, 0, 0]; + const actualData =this.resData.upphData.actual; + const targetData =this.resData.upphData.target; const option = { tooltip: { trigger: 'axis', @@ -74,7 +77,7 @@ export default { }, xAxis: { type: 'category', - data: ['08:00-09:00', '09:00-10:00', '10:00-12:00', '13:30-15:30', '15:30-17:30', '17:30-19:30'], + data:this.resData.upphData.timeSlots, axisLabel: { fontSize: 14, // 放大 x 轴文字 fontWeight: 'bold', // x 轴文字加粗