From 085ce4cf43e29965e56b3a4e492abe55d0d6948f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=96=AF=E7=8B=82=E7=9A=84=E7=8B=AE=E5=AD=90Li?= <15040126243@163.com> Date: Tue, 26 Dec 2023 00:47:59 +0800 Subject: [PATCH 1/4] =?UTF-8?q?update=20=E4=BC=98=E5=8C=96=20=E6=9B=B4?= =?UTF-8?q?=E6=94=B9=E5=AE=A2=E6=88=B7=E7=AB=AF=E7=8A=B6=E6=80=81=E6=8E=A5?= =?UTF-8?q?=E5=8F=A3=20=E4=BD=BF=E7=94=A8clientId=E4=BC=A0=E5=8F=82?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/api/system/client/index.ts | 6 +++--- src/api/system/client/types.ts | 2 +- src/views/system/client/index.vue | 2 +- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/src/api/system/client/index.ts b/src/api/system/client/index.ts index 06544da..6b302b0 100644 --- a/src/api/system/client/index.ts +++ b/src/api/system/client/index.ts @@ -64,12 +64,12 @@ export const delClient = (id: string | number | Array) => { /** * 状态修改 - * @param id ID + * @param clientId 客户端id * @param status 状态 */ -export function changeStatus(id: number | string, status: string) { +export function changeStatus(clientId: string, status: string) { const data = { - id, + clientId, status }; return request({ diff --git a/src/api/system/client/types.ts b/src/api/system/client/types.ts index d7cb926..142118d 100644 --- a/src/api/system/client/types.ts +++ b/src/api/system/client/types.ts @@ -7,7 +7,7 @@ export interface ClientVO { /** * 客户端id */ - clientId: string | number; + clientId: string; /** * 客户端key diff --git a/src/views/system/client/index.vue b/src/views/system/client/index.vue index e201da0..2244f4d 100644 --- a/src/views/system/client/index.vue +++ b/src/views/system/client/index.vue @@ -303,7 +303,7 @@ const handleStatusChange = async (row: ClientVO) => { let text = row.status === '0' ? '启用' : '停用'; try { await proxy?.$modal.confirm('确认要"' + text + '"吗?'); - await changeStatus(row.id, row.status); + await changeStatus(row.clientId, row.status); proxy?.$modal.msgSuccess(text + '成功'); } catch (err) { row.status = row.status === '0' ? '1' : '0'; From 321f21c4982c9cec198a27264d722180c79ef913 Mon Sep 17 00:00:00 2001 From: ahaos <8406649+lhailgl@user.noreply.gitee.com> Date: Tue, 26 Dec 2023 10:04:35 +0000 Subject: [PATCH 2/4] =?UTF-8?q?!73=20=E4=BF=AE=E5=A4=8D=E5=85=A8=E5=B1=80?= =?UTF-8?q?=E5=B1=9E=E6=80=A7=E6=89=BE=E4=B8=8D=E5=88=B0=E7=9A=84=E9=97=AE?= =?UTF-8?q?=E9=A2=98=20*=20Merge=20remote-tracking=20branch=20'origin/dev'?= =?UTF-8?q?=20into=20dev=20*=20fix=20=E4=BF=AE=E5=A4=8D=E5=85=A8=E5=B1=80?= =?UTF-8?q?=E5=B1=9E=E6=80=A7=E6=89=BE=E4=B8=8D=E5=88=B0=E7=9A=84=E9=97=AE?= =?UTF-8?q?=E9=A2=98=20*=20fix=20=E4=BF=AE=E5=A4=8D=E5=8F=98=E9=87=8F?= =?UTF-8?q?=E9=97=AE=E9=A2=98=20*=20fix=20=E4=BF=AE=E5=A4=8D=E5=8F=98?= =?UTF-8?q?=E9=87=8F=E9=97=AE=E9=A2=98=20*=20Merge=20remote-tracking=20bra?= =?UTF-8?q?nch=20'origin/dev'=20into=20dev=20*=20update=20=E4=BE=9D?= =?UTF-8?q?=E8=B5=96=E5=8D=87=E7=BA=A7=20*=20update=20=E4=BE=9D=E8=B5=96?= =?UTF-8?q?=E5=8D=87=E7=BA=A7=20*=20Merge=20remote-tracking=20branch=20'or?= =?UTF-8?q?igin/dev'=20into=20dev=20*=20=E5=8D=87=E7=BA=A7=E4=BE=9D?= =?UTF-8?q?=E8=B5=96=20*=20Merge=20remote-tracking=20branch=20'origin/ts'?= =?UTF-8?q?=20into=20ts=20*=20=E5=8D=87=E7=BA=A7=E4=BE=9D=E8=B5=96=20*=20M?= =?UTF-8?q?erge=20branch=20'dev'=20of=20gitee.com:JavaLionLi/plus-ui=20int?= =?UTF-8?q?o=20ts=20*=20=E5=8D=87=E7=BA=A7=E4=BE=9D=E8=B5=96=20*=20!61=20f?= =?UTF-8?q?ix:=20=E5=88=A0=E9=99=A4=E9=87=8D=E5=A4=8D=E7=8E=AF=E5=A2=83?= =?UTF-8?q?=E5=8F=98=E9=87=8FElUploadInstance=20*=20fix:=20=E5=88=A0?= =?UTF-8?q?=E9=99=A4=E9=87=8D=E5=A4=8D=E7=8E=AF=E5=A2=83=E5=8F=98=E9=87=8F?= =?UTF-8?q?ElUploadInstance?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- package.json | 3 ++- src/layout/components/Settings/index.vue | 2 +- src/layout/components/Sidebar/index.vue | 4 ++-- src/layout/components/TopBar/search.vue | 2 +- src/permission.ts | 2 -- src/types/axios.d.ts | 3 +-- src/types/element.d.ts | 26 +++++++++++++----------- src/types/global.d.ts | 3 +-- src/types/module.d.ts | 4 +++- src/views/monitor/cache/index.vue | 3 ++- src/views/system/dept/index.vue | 5 +++-- src/views/system/user/index.vue | 2 +- src/views/system/user/profile/index.vue | 11 ++++++++-- tsconfig.json | 3 ++- 14 files changed, 42 insertions(+), 31 deletions(-) diff --git a/package.json b/package.json index e1044d8..1395590 100644 --- a/package.json +++ b/package.json @@ -57,7 +57,8 @@ "@unocss/preset-attributify": "^0.58.0", "@unocss/preset-icons": "^0.58.0", "@unocss/preset-uno": "^0.58.0", - "@vue/compiler-sfc": "3.3.9", + "@vue/compiler-sfc": "3.3.11", + "@vue/runtime-core": "3.3.11", "@vitejs/plugin-vue": "4.5.2", "autoprefixer": "10.4.14", "eslint": "8.55.0", diff --git a/src/layout/components/Settings/index.vue b/src/layout/components/Settings/index.vue index 89b1f4c..3082beb 100644 --- a/src/layout/components/Settings/index.vue +++ b/src/layout/components/Settings/index.vue @@ -126,7 +126,7 @@ const toggleDark = () => useToggle(isDark); const topNavChange = (val: any) => { if (!val) { appStore.toggleSideBarHide(false); - permissionStore.setSidebarRouters(permissionStore.defaultRoutes); + permissionStore.setSidebarRouters(permissionStore.defaultRoutes as any); } }; diff --git a/src/layout/components/Sidebar/index.vue b/src/layout/components/Sidebar/index.vue index a905c70..f42473a 100644 --- a/src/layout/components/Sidebar/index.vue +++ b/src/layout/components/Sidebar/index.vue @@ -13,7 +13,7 @@ :collapse-transition="false" mode="vertical" > - + @@ -29,7 +29,7 @@ import useSettingsStore from '@/store/modules/settings'; import usePermissionStore from '@/store/modules/permission'; import { RouteRecordRaw } from 'vue-router'; -const { proxy } = getCurrentInstance(); +const { proxy } = getCurrentInstance() as ComponentInternalInstance; const route = useRoute(); const appStore = useAppStore(); diff --git a/src/layout/components/TopBar/search.vue b/src/layout/components/TopBar/search.vue index 62322a4..440b88d 100644 --- a/src/layout/components/TopBar/search.vue +++ b/src/layout/components/TopBar/search.vue @@ -54,7 +54,7 @@ const state = reactive({ const openSearch = () => { state.menuQuery = ''; state.isShowSearch = true; - state.menuList = generateRoutes(routes.value); + state.menuList = generateRoutes(routes.value as any); nextTick(() => { setTimeout(() => { layoutMenuAutocompleteRef.value.focus(); diff --git a/src/permission.ts b/src/permission.ts index 69795f8..ef9976a 100644 --- a/src/permission.ts +++ b/src/permission.ts @@ -40,8 +40,6 @@ router.beforeEach(async (to, from, next) => { router.addRoute(route); // 动态添加可访问路由表 } }); - const n = { ...to, replace: true }; - console.log(n); next({ path: to.path, replace: true, params: to.params, query: to.query, hash: to.hash, name: to.name as string }); // hack方法 确保addRoutes已完成 } } else { diff --git a/src/types/axios.d.ts b/src/types/axios.d.ts index 2451f2a..9f2c6d2 100644 --- a/src/types/axios.d.ts +++ b/src/types/axios.d.ts @@ -1,5 +1,4 @@ -import axios from 'axios'; - +export {}; declare module 'axios' { interface AxiosResponse { code: number; diff --git a/src/types/element.d.ts b/src/types/element.d.ts index 6a7bdef..2087773 100644 --- a/src/types/element.d.ts +++ b/src/types/element.d.ts @@ -5,30 +5,32 @@ declare global { declare type ElTableInstance = ep.TableInstance; declare type ElUploadInstance = ep.UploadInstance; declare type ElScrollbarInstance = ep.ScrollbarInstance; + declare type ElInputInstance = ep.InputInstance; + declare type ElInputNumberInstance = ep.InputNumberInstance; + declare type ElRadioInstance = ep.RadioInstance; + declare type ElRadioGroupInstance = ep.RadioGroupInstance; + declare type ElRadioButtonInstance = ep.RadioButtonInstance; + declare type ElCheckboxInstance = ep.CheckboxInstance; + declare type ElSwitchInstance = ep.SwitchInstance; + declare type ElCascaderInstance = ep.CascaderInstance; + declare type ElColorPickerInstance = ep.ColorPickerInstance; + declare type ElRateInstance = ep.RateInstance; + declare type ElSliderInstance = ep.SliderInstance; + declare type ElTreeInstance = InstanceType; declare type ElTreeSelectInstance = InstanceType; declare type ElSelectInstance = InstanceType; declare type ElCardInstance = InstanceType; declare type ElDialogInstance = InstanceType; - declare type ElInputInstance = InstanceType; - declare type ElInputNumberInstance = InstanceType; - declare type ElRadioInstance = InstanceType; - declare type ElRadioGroupInstance = InstanceType; - declare type ElRadioButtonInstance = InstanceType; - declare type ElCheckboxInstance = InstanceType; declare type ElCheckboxGroupInstance = InstanceType; - declare type ElSwitchInstance = InstanceType; declare type ElDatePickerInstance = InstanceType; declare type ElTimePickerInstance = InstanceType; declare type ElTimeSelectInstance = InstanceType; - declare type ElCascaderInstance = InstanceType; - declare type ElColorPickerInstance = InstanceType; - declare type ElRateInstance = InstanceType; - declare type ElSliderInstance = InstanceType; declare type TransferKey = ep.TransferKey; declare type CheckboxValueType = ep.CheckboxValueType; declare type ElFormRules = ep.FormRules; declare type DateModelType = ep.DateModelType; - declare type UploadFile = typeof ep.UploadFile; + declare type UploadFile = ep.UploadFile; + } diff --git a/src/types/global.d.ts b/src/types/global.d.ts index 10cc438..17476a3 100644 --- a/src/types/global.d.ts +++ b/src/types/global.d.ts @@ -1,5 +1,4 @@ -import type { ComponentInternalInstance as ComponentInstance } from 'vue/runtime-core'; -import type { PropType as VuePropType } from 'vue'; +import type { PropType as VuePropType, ComponentInternalInstance as ComponentInstance } from 'vue'; import { LanguageEnum } from '@/enums/LanguageEnum'; declare global { diff --git a/src/types/module.d.ts b/src/types/module.d.ts index 16b1116..bc2f16b 100644 --- a/src/types/module.d.ts +++ b/src/types/module.d.ts @@ -5,10 +5,12 @@ import auth from '@/plugins/auth'; import cache from '@/plugins/cache'; import animate from '@/animate'; import { useDict } from '@/utils/dict'; -import handleTree, { addDateRange, selectDictLabel, selectDictLabels, parseTime } from '@/utils/ruoyi'; +import { handleTree, addDateRange, selectDictLabel, selectDictLabels, parseTime } from '@/utils/ruoyi'; import { getConfigKey, updateConfigByKey } from '@/api/system/config'; import { download as rd } from '@/utils/request'; +export {}; + declare module '@vue/runtime-core' { interface ComponentCustomProperties { // 全局方法声明 diff --git a/src/views/monitor/cache/index.vue b/src/views/monitor/cache/index.vue index c58f89c..81bbf2d 100644 --- a/src/views/monitor/cache/index.vue +++ b/src/views/monitor/cache/index.vue @@ -126,8 +126,9 @@ diff --git a/src/components/ImageUpload/index.vue b/src/components/ImageUpload/index.vue index 6b7a39b..ae5cd45 100644 --- a/src/components/ImageUpload/index.vue +++ b/src/components/ImageUpload/index.vue @@ -81,14 +81,14 @@ const imageUploadRef = ref(); watch( () => props.modelValue, - async (val) => { + async (val: string) => { if (val) { // 首先将值转为数组 let list: OssVO[] = []; if (Array.isArray(val)) { list = val as OssVO[]; } else { - const res = await listByIds(val as string); + const res = await listByIds(val); list = res.data; } // 然后将数组转为对象数组 diff --git a/src/components/TopNav/index.vue b/src/components/TopNav/index.vue index 6b416d4..c41177e 100644 --- a/src/components/TopNav/index.vue +++ b/src/components/TopNav/index.vue @@ -43,7 +43,7 @@ const router = useRouter(); // 主题颜色 const theme = computed(() => settingsStore.theme); // 所有的路由信息 -const routers = computed(() => permissionStore.topbarRouters); +const routers = computed(() => permissionStore.getTopbarRoutes()); // 顶部显示菜单 const topMenus = computed(() => { diff --git a/src/layout/components/AppMain.vue b/src/layout/components/AppMain.vue index b7c6ef0..2b38a4e 100644 --- a/src/layout/components/AppMain.vue +++ b/src/layout/components/AppMain.vue @@ -12,8 +12,9 @@