From e066a7c4c7f29ecce63afa058b3f7b762f51532e Mon Sep 17 00:00:00 2001 From: "DESKTOP-FUDKNA8\\znjsz" Date: Mon, 29 Apr 2024 16:00:07 +0800 Subject: [PATCH] =?UTF-8?q?update=20=E8=8A=AF=E7=89=87=E8=89=AF=E7=8E=87?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../efficiency/components/ChipRate.vue | 40 +++-- .../copilot/efficiency/components/StdRate.vue | 2 +- .../components/sub/chip/ChipRateItem.vue | 139 ++++++++++++++++ .../components/sub/{ => std}/CityName.vue | 0 .../components/sub/{ => std}/ProgressBar.vue | 0 .../components/sub/{ => std}/StdRateItem.vue | 0 .../copilot/efficiency/options/chipOptions.js | 156 ++++++++++++++++++ 7 files changed, 326 insertions(+), 11 deletions(-) create mode 100644 src/views/copilot/efficiency/components/sub/chip/ChipRateItem.vue rename src/views/copilot/efficiency/components/sub/{ => std}/CityName.vue (100%) rename src/views/copilot/efficiency/components/sub/{ => std}/ProgressBar.vue (100%) rename src/views/copilot/efficiency/components/sub/{ => std}/StdRateItem.vue (100%) create mode 100644 src/views/copilot/efficiency/options/chipOptions.js diff --git a/src/views/copilot/efficiency/components/ChipRate.vue b/src/views/copilot/efficiency/components/ChipRate.vue index d1fed9e..8d71f73 100644 --- a/src/views/copilot/efficiency/components/ChipRate.vue +++ b/src/views/copilot/efficiency/components/ChipRate.vue @@ -6,22 +6,42 @@ --> diff --git a/src/views/copilot/efficiency/components/StdRate.vue b/src/views/copilot/efficiency/components/StdRate.vue index 42aaa3f..42d7d26 100644 --- a/src/views/copilot/efficiency/components/StdRate.vue +++ b/src/views/copilot/efficiency/components/StdRate.vue @@ -20,7 +20,7 @@ + + +l diff --git a/src/views/copilot/efficiency/components/sub/CityName.vue b/src/views/copilot/efficiency/components/sub/std/CityName.vue similarity index 100% rename from src/views/copilot/efficiency/components/sub/CityName.vue rename to src/views/copilot/efficiency/components/sub/std/CityName.vue diff --git a/src/views/copilot/efficiency/components/sub/ProgressBar.vue b/src/views/copilot/efficiency/components/sub/std/ProgressBar.vue similarity index 100% rename from src/views/copilot/efficiency/components/sub/ProgressBar.vue rename to src/views/copilot/efficiency/components/sub/std/ProgressBar.vue diff --git a/src/views/copilot/efficiency/components/sub/StdRateItem.vue b/src/views/copilot/efficiency/components/sub/std/StdRateItem.vue similarity index 100% rename from src/views/copilot/efficiency/components/sub/StdRateItem.vue rename to src/views/copilot/efficiency/components/sub/std/StdRateItem.vue diff --git a/src/views/copilot/efficiency/options/chipOptions.js b/src/views/copilot/efficiency/options/chipOptions.js new file mode 100644 index 0000000..bb27d43 --- /dev/null +++ b/src/views/copilot/efficiency/options/chipOptions.js @@ -0,0 +1,156 @@ +export default function ({ + single = false, + color, + titleValue, + subtitle, + previousSum, + currentSum, + targetSum, +}) { + return { + grid: { + left: 0, + right: 0, + bottom: 0, + top: 0, + containLabel: true, + }, + tooltip: {}, + title: { + text: titleValue, + left: "49%", + top: "39%", + textAlign: "center", + textStyle: { + fontWeight: 600, + fontSize: 32, + color: "#fffd", + }, + subtext: `\u2002${subtitle}\u2002`, + subtextStyle: { + fontSize: 14, + fontWeight: 100, + color: "#fffd", + align: "right", + }, + }, + series: [ + // 背景 series + { + type: "pie", + name: "当前目标", + radius: ["70%", "85%"], + center: ["50%", "52%"], + emptyCircleStyle: { + color: "#040c5f45", + }, + }, + // 数据 series + { + type: "pie", + radius: ["70%", "85%"], + center: ["50%", "52%"], + avoidLabelOvervlap: false, + label: { + show: false, + }, + labelLine: { + show: false, + }, + data: [ + { + value: currentSum, + name: "当前累计产出", + selected: false, + itemStyle: { + borderJoin: "round", + borderCap: "round", + borderWidth: 12, + borderRadius: "50%", + color: { + type: "linear", + x: 1, + y: 0, + x2: 0, + y2: 1, + colorStops: single + ? [ + { offset: 0, color: `${color}11` }, + { offset: 1, color: `${color}` }, + ] + : [ + { offset: 0, color: "#4CF0E811" }, + { offset: 1, color: "#4CF0E8" }, + ], + }, + }, + }, + { + value: + targetSum > currentSum + ? targetSum - currentSum + : targetSum == 0 + ? currentSum == 0 + ? 1 + : 0 + : 0, + + name: "未达成累计", + itemStyle: { color: "transparent" }, + label: { show: false }, + }, + ], + }, + // 数据 series2 - 2023累计 + single + ? null + : { + type: "pie", + radius: ["55%", "70%"], + center: ["50%", "52%"], + avoidLabelOvervlap: false, + label: { + show: false, + }, + labelLine: { + show: false, + }, + data: [ + { + value: previousSum, + name: "上期累计产出", + selected: false, + itemStyle: { + borderJoin: "round", + borderCap: "round", + borderWidth: 12, + borderRadius: "50%", + color: { + type: "linear", + x: 1, + y: 0, + x2: 0, + y2: 1, + colorStops: [ + { offset: 0, color: "#1065ff66" }, + { offset: 1, color: "#1065ff" }, + ], + }, + }, + }, + { + value: + targetSum > previousSum + ? targetSum - previousSum + : previousSum == 0 + ? 1 + : 0, + name: "-", + itemStyle: { color: "transparent" }, + label: { show: false }, + }, + ], + }, + ], + }; +}