From 54e76b649f0b7b1f747dde48b0ea49a539fbc7a7 Mon Sep 17 00:00:00 2001 From: Qiuxia Fan Date: Fri, 31 Dec 2021 14:58:51 +0800 Subject: [PATCH] feat: create Card, ProgressBar components --- src/assets/icons/review-list.svg | 18 ++++ src/utils/copy.ts | 33 ++++++ src/views/dashboard/graphs/Card.vue | 57 ++++++++++ src/views/dashboard/graphs/ProgressBar.vue | 116 +++++++++++++++++++++ 4 files changed, 224 insertions(+) create mode 100755 src/assets/icons/review-list.svg create mode 100644 src/utils/copy.ts create mode 100644 src/views/dashboard/graphs/Card.vue create mode 100644 src/views/dashboard/graphs/ProgressBar.vue diff --git a/src/assets/icons/review-list.svg b/src/assets/icons/review-list.svg new file mode 100755 index 00000000..faa38f99 --- /dev/null +++ b/src/assets/icons/review-list.svg @@ -0,0 +1,18 @@ + + + + + diff --git a/src/utils/copy.ts b/src/utils/copy.ts new file mode 100644 index 00000000..3baddf0d --- /dev/null +++ b/src/utils/copy.ts @@ -0,0 +1,33 @@ +/** + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import { ElNotification } from "element-plus"; +export default (value: string): void => { + const input = document.createElement("input"); + input.value = value; + document.body.appendChild(input); + input.select(); + if (document.execCommand("Copy")) { + document.execCommand("Copy"); + } + input.remove(); + ElNotification({ + title: "Success", + message: "Copied", + type: "success", + }); +}; diff --git a/src/views/dashboard/graphs/Card.vue b/src/views/dashboard/graphs/Card.vue new file mode 100644 index 00000000..288c7197 --- /dev/null +++ b/src/views/dashboard/graphs/Card.vue @@ -0,0 +1,57 @@ + + + + + diff --git a/src/views/dashboard/graphs/ProgressBar.vue b/src/views/dashboard/graphs/ProgressBar.vue new file mode 100644 index 00000000..229c1047 --- /dev/null +++ b/src/views/dashboard/graphs/ProgressBar.vue @@ -0,0 +1,116 @@ + + + + +