From 224053c0f4dbcba5db67ad20bee73f01895b8a2f Mon Sep 17 00:00:00 2001 From: Fine0830 Date: Mon, 6 Feb 2023 13:38:19 +0800 Subject: [PATCH] feat: Implement independent mode for widgets (#221) --- package.json | 10 +- src/App.vue | 13 +- src/layout/components/NavBar.vue | 2 +- src/layout/components/SideBar.vue | 14 +- src/locales/lang/en.ts | 2 + src/locales/lang/es.ts | 2 + src/locales/lang/zh.ts | 2 + src/router/dashboard.ts | 15 ++ src/store/modules/dashboard.ts | 5 + src/store/modules/selectors.ts | 6 +- src/styles/lib.scss | 8 + src/views/dashboard/Edit.vue | 11 +- src/views/dashboard/List.vue | 2 + src/views/dashboard/Widget.vue | 188 ++++++++++++++++++ src/views/dashboard/components/WidgetLink.vue | 125 ++++++++++++ src/views/dashboard/controls/Widget.vue | 14 +- 16 files changed, 403 insertions(+), 16 deletions(-) create mode 100644 src/views/dashboard/Widget.vue create mode 100644 src/views/dashboard/components/WidgetLink.vue diff --git a/package.json b/package.json index a84b375e..b15fa537 100644 --- a/package.json +++ b/package.json @@ -85,10 +85,14 @@ "not dead" ], "lint-staged": { - "*.{js,jsx,ts,tsx,vue,scss,less}": [ - "eslint . --ext .vue,.js,.jsx,.cjs,.mjs,.ts,.tsx,.cts,.mts --fix --ignore-path .gitignore", + "*.{js,jsx,ts,tsx,vue}": [ + "eslint . --ext .vue,.js,.jsx,.ts,.tsx --fix --ignore-path .gitignore", "prettier --write \"src/**/*.{js,tsx,css,less,scss,vue,html,md}\"", - "stylelint --cache --fix \"**/*.{vue,less,postcss,css,scss}\" --cache --cache-location node_modules/.cache/stylelint/" + "stylelint --cache --fix \"**/*.{vue}\" --cache --cache-location node_modules/.cache/stylelint/" + ], + "*.{scss,less}": [ + "prettier --write \"src/**/*.{js,tsx,css,less,scss,vue,html,md}\"", + "stylelint --cache --fix \"**/*.{less,postcss,css,scss}\" --cache --cache-location node_modules/.cache/stylelint/" ], "{!(package)*.json,*.code-snippets,.!(browserslist)*rc}": [ "prettier --write" diff --git a/src/App.vue b/src/App.vue index 194f4c04..93c3bce8 100644 --- a/src/App.vue +++ b/src/App.vue @@ -15,11 +15,22 @@ limitations under the License. --> + diff --git a/src/layout/components/NavBar.vue b/src/layout/components/NavBar.vue index fc9c0526..d50cc283 100644 --- a/src/layout/components/NavBar.vue +++ b/src/layout/components/NavBar.vue @@ -14,7 +14,7 @@ See the License for the specific language governing permissions and limitations under the License. -->