From dd93144788cf9f4601a54346e4346c1120becdd2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=83=9D=E5=85=88=E7=91=9E?= <1490493387@qq.com> Date: Fri, 15 Apr 2022 00:45:06 +0800 Subject: [PATCH] =?UTF-8?q?refactor:=20eslint=E4=BB=A3=E7=A0=81=E6=A3=80?= =?UTF-8?q?=E6=9F=A5=E4=BC=98=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Former-commit-id: 4c11b5d0cdd10f28148cf3d9b593f85e082cdc51 --- src/api/pms/category.ts | 2 +- src/api/pms/goods.ts | 4 +- src/api/system/file.ts | 2 +- src/api/system/role.ts | 2 +- src/api/system/user.ts | 5 +- src/components.d.ts | 9 + src/components/IconSelect/index.vue | 21 +- src/components/Pagination/index.vue | 48 ++- src/components/RightPanel/index.vue | 31 +- src/components/Screenfull/index.vue | 8 +- src/components/SizeSelect/index.vue | 10 +- src/components/ThemePicker/index.vue | 3 +- src/components/TreeSelect/index.vue | 45 +-- src/components/Upload/SingleUpload.vue | 7 +- src/components/WangEditor/index.vue | 46 ++- src/layout/components/Navbar.vue | 1 - src/layout/components/Sidebar/Logo.vue | 22 +- src/layout/components/Sidebar/SidebarItem.vue | 4 +- src/layout/components/Sidebar/index.vue | 4 +- src/layout/components/TagsView/ScrollPane.vue | 6 +- src/layout/components/TagsView/index.vue | 2 +- src/layout/index.vue | 8 +- src/store/modules/permission.ts | 2 +- src/store/modules/tagsView.ts | 2 +- src/styles/element-plus.scss | 4 - src/types/api/oms/order.d.ts | 4 +- src/types/api/pms/brand.d.ts | 6 +- src/types/api/pms/goods.d.ts | 35 +- src/types/api/sms/advert.d.ts | 8 +- src/types/api/system/client.d.ts | 4 +- src/types/api/system/dict.d.ts | 13 +- src/types/api/system/{menu.ts => menu.d.ts} | 4 +- src/types/api/system/perm.d.ts | 4 +- src/types/api/system/role.d.ts | 6 +- src/types/api/system/user.d.ts | 13 +- src/types/api/ums/member.d.ts | 6 +- src/utils/index.ts | 20 +- src/utils/request.ts | 4 - src/utils/scroll-to.ts | 2 +- src/utils/storage.ts | 4 +- .../dashboard/components/Chart/PieChart.vue | 1 - src/views/dashboard/components/Team/index.vue | 13 +- src/views/dashboard/index.vue | 45 +-- src/views/login/index.vue | 2 - src/views/oms/order/index.vue | 11 +- src/views/pms/brand/index.vue | 97 ++---- .../pms/category/components/Attribute.vue | 74 ++-- .../pms/category/components/Category.vue | 116 ++----- src/views/pms/category/index.vue | 6 +- .../pms/goods/components/GoodsAttribute.vue | 121 +++---- .../pms/goods/components/GoodsCategory.vue | 52 +-- src/views/pms/goods/components/GoodsInfo.vue | 101 ++---- src/views/pms/goods/components/GoodsStock.vue | 321 +++++++----------- src/views/pms/goods/detail.vue | 145 ++++---- src/views/pms/goods/index.vue | 4 +- src/views/sms/advert/index.vue | 98 +----- src/views/system/client/index.vue | 125 ++----- src/views/system/dept/index.vue | 20 +- src/views/system/dict/components/Dict.vue | 104 ++---- src/views/system/dict/components/DictItem.vue | 127 ++----- src/views/system/dict/index.vue | 4 +- src/views/system/menu/components/Menu.vue | 168 ++------- src/views/system/menu/components/Perm.vue | 135 +++----- src/views/system/role/components/Menu.vue | 38 +-- src/views/system/role/components/Perm.vue | 59 ++-- src/views/system/role/components/Role.vue | 98 ++---- src/views/system/role/index.vue | 4 +- src/views/system/user/index.vue | 11 +- src/views/ums/member/index.vue | 63 +--- 69 files changed, 820 insertions(+), 1774 deletions(-) create mode 100644 src/components.d.ts rename src/types/api/system/{menu.ts => menu.d.ts} (93%) diff --git a/src/api/pms/category.ts b/src/api/pms/category.ts index 1a53322a..0975e407 100644 --- a/src/api/pms/category.ts +++ b/src/api/pms/category.ts @@ -18,7 +18,7 @@ export function listCategories(queryParams:object){ * * @param queryParams */ -export function listCascadeCategories(queryParams:object) { +export function listCascadeCategories(queryParams?:object) { return request({ url: '/mall-pms/api/v1/categories/cascade', method: 'get', diff --git a/src/api/pms/goods.ts b/src/api/pms/goods.ts index 16b1dd18..4d647842 100644 --- a/src/api/pms/goods.ts +++ b/src/api/pms/goods.ts @@ -1,4 +1,4 @@ -import { GoodsPageResult, GoodsQueryParam } from '@/types' +import { GoodsDetail, GoodsPageResult, GoodsQueryParam } from '@/types' import request from '@/utils/request' import { AxiosPromise } from 'axios' @@ -20,7 +20,7 @@ export function listGoodsPages(queryParams: GoodsQueryParam):AxiosPromise { return request({ url: '/mall-pms/api/v1/goods/' + id, method: 'get' diff --git a/src/api/system/file.ts b/src/api/system/file.ts index eae58f3c..61e6dd93 100644 --- a/src/api/system/file.ts +++ b/src/api/system/file.ts @@ -6,7 +6,7 @@ import request from '@/utils/request' * @param file */ export function uploadFile(file: File) { - let formData = new FormData() + const formData = new FormData() formData.append('file', file) return request( { diff --git a/src/api/system/role.ts b/src/api/system/role.ts index cece5f3c..384113bd 100644 --- a/src/api/system/role.ts +++ b/src/api/system/role.ts @@ -98,7 +98,7 @@ export function listRoleMenuIds(roleId: number):AxiosPromise { * @param roleId * @param menuIds */ -export function updateRoleMenu(roleId: number, menuIds: Array) { +export function updateRoleMenu(roleId: number, menuIds: Array) { return request({ url: '/youlai-admin/api/v1/roles/' + roleId + '/menus', method: 'put', diff --git a/src/api/system/user.ts b/src/api/system/user.ts index 973d788c..6e8c3dc5 100644 --- a/src/api/system/user.ts +++ b/src/api/system/user.ts @@ -1,6 +1,6 @@ import request from "@/utils/request"; import { AxiosPromise } from "axios"; -import { UserFormData, UserImportFormData, UserInfo, UserPageResult, UserQueryParam } from "@/types"; +import { UserFormData, UserInfo, UserPageResult, UserQueryParam } from "@/types"; /** * 登录成功后获取用户信息(昵称、头像、权限集合和角色集合) @@ -113,6 +113,7 @@ export function exportUser(queryParams: UserQueryParam) { return request({ url: '/youlai-admin/api/v1/users/_export', method: 'get', + params:queryParams, responseType: "arraybuffer" }) } @@ -123,7 +124,7 @@ export function exportUser(queryParams: UserQueryParam) { * @param file */ export function importUser(deptId: number, roleIds: string, file: File) { - let formData = new FormData() + const formData = new FormData() formData.append('file', file) formData.append('deptId',deptId.toString()) formData.append('roleIds',roleIds) diff --git a/src/components.d.ts b/src/components.d.ts new file mode 100644 index 00000000..0d89d9e9 --- /dev/null +++ b/src/components.d.ts @@ -0,0 +1,9 @@ +// 全局组件类型声明 +import Pagination from "@/components/Pagination/index.vue"; + +declare module "@vue/runtime-core" { + export interface GlobalComponents { + Pagination: typeof Pagination; + } +} +export {} \ No newline at end of file diff --git a/src/components/IconSelect/index.vue b/src/components/IconSelect/index.vue index f4be7071..88986239 100644 --- a/src/components/IconSelect/index.vue +++ b/src/components/IconSelect/index.vue @@ -1,13 +1,7 @@ - \ No newline at end of file diff --git a/src/components/SizeSelect/index.vue b/src/components/SizeSelect/index.vue index 32040a5a..dc8729fd 100644 --- a/src/components/SizeSelect/index.vue +++ b/src/components/SizeSelect/index.vue @@ -5,12 +5,8 @@ @@ -171,8 +135,7 @@ const nickname = computed(() => user.nickname); } .user-profile { - .user-name { - } + .user-name {} .box-center { padding-top: 10px; diff --git a/src/views/login/index.vue b/src/views/login/index.vue index eebaf084..17cac1f2 100644 --- a/src/views/login/index.vue +++ b/src/views/login/index.vue @@ -142,7 +142,6 @@ const state = reactive({ }, loading: false, passwordType: "password", - redirect: "", captchaBase64: "", // 大写提示禁用 capslockTooltipDisabled: true, @@ -164,7 +163,6 @@ const { loginRules, loading, passwordType, - redirect, captchaBase64, capslockTooltipDisabled, showCopyright, diff --git a/src/views/oms/order/index.vue b/src/views/oms/order/index.vue index eec64229..451622c7 100644 --- a/src/views/oms/order/index.vue +++ b/src/views/oms/order/index.vue @@ -118,10 +118,10 @@ diff --git a/src/views/pms/category/components/Category.vue b/src/views/pms/category/components/Category.vue index 58ac4a75..2daeb3a8 100644 --- a/src/views/pms/category/components/Category.vue +++ b/src/views/pms/category/components/Category.vue @@ -1,83 +1,47 @@ diff --git a/src/views/pms/goods/detail.vue b/src/views/pms/goods/detail.vue index 157d7a3a..f1316c27 100644 --- a/src/views/pms/goods/detail.vue +++ b/src/views/pms/goods/detail.vue @@ -1,108 +1,77 @@ -