From b39109eae650eae6746e3e2cc6a7a689ab190db2 Mon Sep 17 00:00:00 2001 From: Qiuxia Fan Date: Thu, 23 Dec 2021 20:24:58 +0800 Subject: [PATCH] feat: add widget header --- src/assets/icons/clearclose.svg | 18 +++++++++++ src/assets/icons/createmode_editedit.svg | 18 +++++++++++ src/store/modules/dashboard.ts | 3 ++ src/views/dashboard/Edit.vue | 1 + src/views/dashboard/panel/Widget.vue | 40 ++++++++++++++++++++++-- 5 files changed, 78 insertions(+), 2 deletions(-) create mode 100644 src/assets/icons/clearclose.svg create mode 100644 src/assets/icons/createmode_editedit.svg diff --git a/src/assets/icons/clearclose.svg b/src/assets/icons/clearclose.svg new file mode 100644 index 00000000..af9e3a0a --- /dev/null +++ b/src/assets/icons/clearclose.svg @@ -0,0 +1,18 @@ + + +clearclose + + diff --git a/src/assets/icons/createmode_editedit.svg b/src/assets/icons/createmode_editedit.svg new file mode 100644 index 00000000..1a1f2d8b --- /dev/null +++ b/src/assets/icons/createmode_editedit.svg @@ -0,0 +1,18 @@ + + +createmode_editedit + + diff --git a/src/store/modules/dashboard.ts b/src/store/modules/dashboard.ts index e14a7745..df3a75f9 100644 --- a/src/store/modules/dashboard.ts +++ b/src/store/modules/dashboard.ts @@ -45,6 +45,9 @@ export const dashboardStore = defineStore({ }); this.layout.push(newWidget); }, + removeWidget(item: GridItemData) { + this.layout = this.layout.filter((d: GridItemData) => d.i !== item.i); + }, }, }); diff --git a/src/views/dashboard/Edit.vue b/src/views/dashboard/Edit.vue index a18818cb..6713d409 100644 --- a/src/views/dashboard/Edit.vue +++ b/src/views/dashboard/Edit.vue @@ -17,6 +17,7 @@ limitations under the License. --> Add Widget + Dashboard Settings Save As Discard Apply diff --git a/src/views/dashboard/panel/Widget.vue b/src/views/dashboard/panel/Widget.vue index 483a2b4d..01e4e67b 100644 --- a/src/views/dashboard/panel/Widget.vue +++ b/src/views/dashboard/panel/Widget.vue @@ -13,15 +13,51 @@ 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. --> +