From a28ec90695f329901006eb4e87106c9b8fcce85a Mon Sep 17 00:00:00 2001 From: baishun Date: Fri, 24 Feb 2023 14:52:22 +0800 Subject: [PATCH] =?UTF-8?q?=E8=A7=84=E8=8C=83=E5=8C=96=E4=BB=A3=E7=A0=81?= =?UTF-8?q?=E5=92=8Cbg-ui=E4=B8=80=E4=BA=9B=E9=97=AE=E9=A2=98=E4=BF=AE?= =?UTF-8?q?=E5=A4=8D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .editorconfig | 6 + .eslintignore | 6 + .eslintrc.js | 121 +++++ .prettierignore | 5 + .prettierrc | 5 + package.json | 7 +- src/App.vue | 61 +-- src/bg-ui/bg-btns.vue | 15 +- src/bg-ui/bg-card.vue | 12 +- src/bg-ui/bg-code-editor.vue | 59 ++- src/bg-ui/bg-detail-table.vue | 40 +- src/bg-ui/bg-detail-table2.vue | 10 +- src/bg-ui/bg-detail.vue | 56 +-- src/bg-ui/bg-filter-date.vue | 3 +- src/bg-ui/bg-filter-group.vue | 20 +- src/bg-ui/bg-filter.vue | 17 +- src/bg-ui/bg-filtrate.vue | 2 +- src/bg-ui/bg-icon.vue | 4 +- src/bg-ui/bg-info.vue | 20 +- src/bg-ui/bg-inner-tabs.vue | 93 ++-- src/bg-ui/bg-layout-card.vue | 13 +- src/bg-ui/bg-list.vue | 48 +- src/bg-ui/bg-nav-list.vue | 67 ++- src/bg-ui/bg-nav.vue | 3 +- src/bg-ui/bg-pagination.vue | 16 +- src/bg-ui/bg-rich-text.vue | 28 +- src/bg-ui/bg-switch.vue | 9 +- src/bg-ui/bg-tab.vue | 8 +- src/bg-ui/bg-table-btn.vue | 2 +- src/bg-ui/bg-table-btns-more.vue | 19 +- src/bg-ui/bg-table-btns.vue | 17 +- src/bg-ui/bg-table-btns2.vue | 14 +- src/bg-ui/bg-table-pro.vue | 41 +- src/bg-ui/bg-table.vue | 120 +++-- src/bg-ui/bg-tabs.vue | 13 +- src/bg-ui/bg-tags.vue | 10 +- src/bg-ui/bg-upload-image.vue | 40 +- src/bg-ui/bg-upload.vue | 121 ++++- src/bg-ui/bg-user-upload-image.vue | 8 +- src/bg-ui/debounce.js | 77 +-- src/bg-ui/hook/mixin-select-table.js | 46 +- src/bg-ui/iconfont/iconfont.js | 2 +- src/bg-ui/imgs/img-no-data.png | Bin 0 -> 3701 bytes src/bg-ui/index.js | 64 +-- src/bg-ui/utils/index.js | 18 +- src/components/componentWrapper.vue | 4 +- yarn.lock | 725 ++++++++++++++++++++++++++- 47 files changed, 1593 insertions(+), 502 deletions(-) create mode 100644 .editorconfig create mode 100644 .eslintignore create mode 100644 .eslintrc.js create mode 100644 .prettierignore create mode 100644 .prettierrc create mode 100644 src/bg-ui/imgs/img-no-data.png diff --git a/.editorconfig b/.editorconfig new file mode 100644 index 0000000..7095e7f --- /dev/null +++ b/.editorconfig @@ -0,0 +1,6 @@ +root = true + +[*] +indent_size = 2 +end_of_line = lf +insert_final_newline = true diff --git a/.eslintignore b/.eslintignore new file mode 100644 index 0000000..c6a6b19 --- /dev/null +++ b/.eslintignore @@ -0,0 +1,6 @@ +auto-imports.d.ts +components.d.ts +env.d.ts +pnpm-lock.yaml +*.md +iconfont.js diff --git a/.eslintrc.js b/.eslintrc.js new file mode 100644 index 0000000..52626cc --- /dev/null +++ b/.eslintrc.js @@ -0,0 +1,121 @@ +const INLINE_ELEMENTS = [ + "a", + "abbr", + "audio", + "b", + "bdi", + "bdo", + "canvas", + "cite", + "code", + "data", + "del", + "dfn", + "em", + "i", + "iframe", + "ins", + "kbd", + "label", + "map", + "mark", + "noscript", + "object", + "output", + "picture", + "q", + "ruby", + "s", + "samp", + "small", + "span", + "strong", + "sub", + "sup", + "svg", + "time", + "u", + "var", + "video", +]; + +module.exports = { + root: true, + env: { + browser: true, + es2021: true, + node: true, + }, + parser: "vue-eslint-parser", + extends: [ + "plugin:vue/vue3-recommended", + "eslint:recommended", + ], + parserOptions: { + ecmaVersion: 2021, + }, + rules: { + "quote-props": ["error", "as-needed"], + "import/prefer-default-export": "off", + "no-param-reassign": "off", + "space-before-function-paren": ["error", "never"], + "no-unused-vars": "off", + "no-undef": "off", // auto import + "prefer-rest-params": "off", + "vue/script-setup-uses-vars": "off", + "@typescript-eslint/no-unused-vars": "off", + // "@typescript-eslint/no-explicit-any": "off", + // "@typescript-eslint/no-var-requires": "off", + "no-empty-function": "off", + "no-non-null-assertion": "off", + "@typescript-eslint/no-non-null-assertion": "off", + "@typescript-eslint/no-empty-function": "off", + "@typescript-eslint/no-explicit-any": "off", + "@typescript-eslint/explicit-module-boundary-types": "off", + quotes: [2, "double"], + semi: [2, "always"], + "vue/html-closing-bracket-newline": [ + 2, + { + singleline: "never", + multiline: "never", + }, + ], + "vue/singleline-html-element-content-newline": "off", + "vue/max-attributes-per-line": [ + 2, + { + singleline: 3, + multiline: 1, + }, + ], + "vue/html-self-closing": [ + "error", + { + html: { + normal: "never", + void: "always", + }, + svg: "always", + math: "always", + }, + ], + "vue/no-unused-vars": [ + "error", + { + ignorePattern: "^[_scope]", + }, + ], + "vue/no-setup-props-destructure": "off", + "vue/no-mutating-props": "off", + "eslint no-empty": "off", + "vue/multiline-html-element-content-newline": [ + "error", + { + ignoreWhenEmpty: true, + ignores: ["el-button", ...INLINE_ELEMENTS], + allowEmptyLines: false, + }, + ], + }, +}; diff --git a/.prettierignore b/.prettierignore new file mode 100644 index 0000000..a241427 --- /dev/null +++ b/.prettierignore @@ -0,0 +1,5 @@ +node_modules +dist +pnpm-lock.yaml +auto-imports.d.ts +components.d.ts diff --git a/.prettierrc b/.prettierrc new file mode 100644 index 0000000..88c0117 --- /dev/null +++ b/.prettierrc @@ -0,0 +1,5 @@ +{ + "$schema": "http://json.schemastore.org/prettierrc", + "semi": true, + "singleQuote": false +} diff --git a/package.json b/package.json index b9297b0..cb3bcec 100644 --- a/package.json +++ b/package.json @@ -6,7 +6,9 @@ "scripts": { "dev": "vite", "build": "vite build", - "preview": "vite preview" + "preview": "vite preview", + "lint": "eslint --ext .js,vue --ignore-pattern '!.*ignore' .", + "lint:fix": "pnpm lint --fix" }, "dependencies": { "@element-plus/icons-vue": "^2.0.10", @@ -22,6 +24,9 @@ }, "devDependencies": { "@vitejs/plugin-vue": "^4.0.0", + "eslint": "^8.34.0", + "eslint-define-config": "^1.15.0", + "eslint-plugin-vue": "^9.9.0", "sass": "^1.58.2", "vite": "^4.1.1" } diff --git a/src/App.vue b/src/App.vue index 5aabe20..52d5f5f 100644 --- a/src/App.vue +++ b/src/App.vue @@ -121,7 +121,7 @@ const { title: cardTitle, icon: cardIcon } = toRefs(card);
- + @@ -134,29 +134,33 @@ const { title: cardTitle, icon: cardIcon } = toRefs(card); - + - + - + - - - - + + + + - - + + - + - + @@ -167,24 +171,24 @@ const { title: cardTitle, icon: cardIcon } = toRefs(card); - - - - - - - - + + + + + + + + - - - - - + + + + + - +
diff --git a/src/bg-ui/bg-btns.vue b/src/bg-ui/bg-btns.vue index 1140505..142fbbf 100644 --- a/src/bg-ui/bg-btns.vue +++ b/src/bg-ui/bg-btns.vue @@ -3,12 +3,11 @@ @@ -16,20 +15,20 @@ diff --git a/src/bg-ui/bg-card.vue b/src/bg-ui/bg-card.vue index c34605e..9baa986 100644 --- a/src/bg-ui/bg-card.vue +++ b/src/bg-ui/bg-card.vue @@ -3,18 +3,18 @@

- + - + {{ title }} - {{ subTitle }} + {{ subTitle }}

-
- +
+
@@ -37,7 +37,7 @@ const props = defineProps({ type:Boolean, default:false, } -}) +}); diff --git a/src/bg-ui/bg-layout-card.vue b/src/bg-ui/bg-layout-card.vue index 708e139..151d169 100644 --- a/src/bg-ui/bg-layout-card.vue +++ b/src/bg-ui/bg-layout-card.vue @@ -2,7 +2,7 @@

{{ title }}

-
    +
    + @click="downloadAction">
-
- +
+
@@ -57,6 +57,7 @@ const props = defineProps({ }, }); +const emit = defineEmits(["update:btn"]); const style = computed(() => { return { width: `calc(${props.width} - 20px)`, diff --git a/src/bg-ui/bg-list.vue b/src/bg-ui/bg-list.vue index 1ee7803..06d8f81 100644 --- a/src/bg-ui/bg-list.vue +++ b/src/bg-ui/bg-list.vue @@ -2,67 +2,71 @@
- +
-
- +
+
-
-
+
+
- +
-
+
- +
-
-
- +
+
+
- 查询 + + 查询 + 重置
-
- +
+
-
- +
+
- +
- +
- +
@@ -81,4 +85,6 @@ const props = defineProps({ default: false, }, }); + +const emit = defineEmits(["update:visible", "search-action", "search-reset"]); diff --git a/src/bg-ui/bg-nav-list.vue b/src/bg-ui/bg-nav-list.vue index bde6ff9..89a944a 100644 --- a/src/bg-ui/bg-nav-list.vue +++ b/src/bg-ui/bg-nav-list.vue @@ -1,32 +1,39 @@