From 9a849f95fc95077af32402744add30e31d77e261 Mon Sep 17 00:00:00 2001 From: weiyin Date: Fri, 23 Aug 2024 17:36:13 +0800 Subject: [PATCH] =?UTF-8?q?wip:=20=E8=BF=90=E8=90=A5=E7=AE=A1=E7=90=86?= =?UTF-8?q?=E6=89=8B=E6=9C=AF=E9=87=8F=E7=BB=9F=E8=AE=A1=E6=8E=A5=E5=8F=A3?= =?UTF-8?q?=E6=95=B0=E6=8D=AE=E5=AF=B9=E6=8E=A5=E5=8F=8A=E4=BC=98=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../pageMonitor/bottomLeft/OpHistogram.vue | 26 ++++++++++++++----- .../pageMonitor/bottomRight/DepHistogram.vue | 1 + 2 files changed, 20 insertions(+), 7 deletions(-) diff --git a/src/views/pageMonitor/bottomLeft/OpHistogram.vue b/src/views/pageMonitor/bottomLeft/OpHistogram.vue index 123bf06..d048d16 100644 --- a/src/views/pageMonitor/bottomLeft/OpHistogram.vue +++ b/src/views/pageMonitor/bottomLeft/OpHistogram.vue @@ -85,6 +85,12 @@ export default { data() { return { labels: ["择期", "急诊", "日间", "门诊"], + fields: [ + "electiveCount", + "emergencyCount", + "daySurgeryCount", + "outSurgeryCount", + ], seriesData: [ { label: "择期", @@ -235,10 +241,11 @@ export default { }, label: { show: true, // 显示数值 - position: "insideTop", // 数值显示的位置 + position: "outsideTop", // 数值显示的位置 textStyle: { //数值样式 color: "#fff", + padding: [0, 0, 0, 7], }, formatter: function (data) { let txt = ""; @@ -301,14 +308,19 @@ export default { }, wrapData(list) { let that = this; - that.labels = []; + // that.labels = []; that.seriesData = []; list.forEach((item) => { - that.labels.push(item.deptName); - that.seriesData.push({ - label: item.deptName, - value: [item.deptCount], - isHave: false, + that.fields.forEach((a, index) => { + for (let key in item) { + if (a == key) { + that.seriesData.push({ + label: that.labels[index], + value: [item[key]], + isHave: false, + }); + } + } }); }); }, diff --git a/src/views/pageMonitor/bottomRight/DepHistogram.vue b/src/views/pageMonitor/bottomRight/DepHistogram.vue index 50b392c..557c6e2 100644 --- a/src/views/pageMonitor/bottomRight/DepHistogram.vue +++ b/src/views/pageMonitor/bottomRight/DepHistogram.vue @@ -247,6 +247,7 @@ export default { textStyle: { //数值样式 color: "#fff", + padding: [0, 0, 0, 7], }, formatter: function (data) { let txt = "";