From 0afa5783109674f080b420a7a0347974342fce14 Mon Sep 17 00:00:00 2001 From: RuoYi Date: Fri, 10 Apr 2026 11:00:46 +0800 Subject: [PATCH] =?UTF-8?q?=E8=87=AA=E5=8A=A8=E5=AF=BC=E5=85=A5=E9=85=8D?= =?UTF-8?q?=E7=BD=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/views/monitor/job/detail.vue | 2 +- src/views/monitor/job/index.vue | 2 +- src/views/monitor/job/log.vue | 2 +- src/views/monitor/logininfor/index.vue | 2 +- src/views/monitor/operlog/detail.vue | 4 ++-- src/views/monitor/operlog/index.vue | 2 +- src/views/system/config/index.vue | 2 +- src/views/system/dept/index.vue | 2 +- src/views/system/dict/data.vue | 2 +- src/views/system/dict/index.vue | 2 +- src/views/system/menu/index.vue | 2 +- src/views/system/notice/index.vue | 2 +- src/views/system/post/index.vue | 2 +- src/views/system/role/authUser.vue | 2 +- src/views/system/role/index.vue | 2 +- src/views/system/role/selectUser.vue | 2 +- src/views/system/user/index.vue | 2 +- src/views/system/user/view.vue | 4 ++-- vite/plugins/auto-import.ts | 6 +++++- 19 files changed, 25 insertions(+), 21 deletions(-) diff --git a/src/views/monitor/job/detail.vue b/src/views/monitor/job/detail.vue index 835a5e1..2900eba 100644 --- a/src/views/monitor/job/detail.vue +++ b/src/views/monitor/job/detail.vue @@ -206,7 +206,7 @@ const dialogVisible = computed({ }) const { proxy } = getCurrentInstance()! -const { sys_job_group } = proxy!.useDict('sys_job_group') +const { sys_job_group } = useDict('sys_job_group') const jobForm = computed(() => props.row as SysJob) const logForm = computed(() => props.row as SysJobLog) diff --git a/src/views/monitor/job/index.vue b/src/views/monitor/job/index.vue index 6e34b98..3fe6c21 100644 --- a/src/views/monitor/job/index.vue +++ b/src/views/monitor/job/index.vue @@ -246,7 +246,7 @@ import type { JobQueryParams, SysJob } from '@/types/api/monitor/job' const router = useRouter() const { proxy } = getCurrentInstance() -const { sys_job_group, sys_job_status } = proxy.useDict("sys_job_group", "sys_job_status") +const { sys_job_group, sys_job_status } = useDict("sys_job_group", "sys_job_status") const jobList = ref([]) const open = ref(false) diff --git a/src/views/monitor/job/log.vue b/src/views/monitor/job/log.vue index 33a6ee5..4734f09 100644 --- a/src/views/monitor/job/log.vue +++ b/src/views/monitor/job/log.vue @@ -145,7 +145,7 @@ import type { SysJobLog, JobLogQueryParams } from '@/types/api/monitor/jobLog' import type { SysJob } from '@/types/api/monitor/job' const { proxy } = getCurrentInstance() -const { sys_common_status, sys_job_group } = proxy.useDict("sys_common_status", "sys_job_group") +const { sys_common_status, sys_job_group } = useDict("sys_common_status", "sys_job_group") const jobLogList = ref([]) const open = ref(false) diff --git a/src/views/monitor/logininfor/index.vue b/src/views/monitor/logininfor/index.vue index b960708..e98f637 100644 --- a/src/views/monitor/logininfor/index.vue +++ b/src/views/monitor/logininfor/index.vue @@ -129,7 +129,7 @@ import { list, delLogininfor, cleanLogininfor, unlockLogininfor } from "@/api/mo import type { SysLogininfor, LogininforQueryParams } from '@/types/api/monitor/logininfor' const { proxy } = getCurrentInstance() -const { sys_common_status } = proxy.useDict("sys_common_status") +const { sys_common_status } = useDict("sys_common_status") const logininforList = ref([]) const loading = ref(true) diff --git a/src/views/monitor/operlog/detail.vue b/src/views/monitor/operlog/detail.vue index e9b5398..dd580c2 100644 --- a/src/views/monitor/operlog/detail.vue +++ b/src/views/monitor/operlog/detail.vue @@ -127,10 +127,10 @@ const dialogVisible = computed({ set: (val: boolean) => emit('update:visible', val) }) -const { sys_oper_type } = proxy.useDict('sys_oper_type') +const { sys_oper_type } = useDict('sys_oper_type') const form = computed(() => props.row || {}) -const typeLabel = computed(() => proxy.selectDictLabel(sys_oper_type.value, form.value.businessType) || '-') +const typeLabel = computed(() => selectDictLabel(sys_oper_type.value, form.value.businessType) || '-') function formatJson(str?: string): string { if (!str) return '(无数据)' diff --git a/src/views/monitor/operlog/index.vue b/src/views/monitor/operlog/index.vue index 037bb17..9ab8df3 100644 --- a/src/views/monitor/operlog/index.vue +++ b/src/views/monitor/operlog/index.vue @@ -158,7 +158,7 @@ import { list, delOperlog, cleanOperlog } from "@/api/monitor/operlog" import type { SysOperLog, OperlogQueryParams } from '@/types/api/monitor/operlog' const { proxy } = getCurrentInstance() -const { sys_oper_type, sys_common_status } = proxy.useDict("sys_oper_type", "sys_common_status") +const { sys_oper_type, sys_common_status } = useDict("sys_oper_type", "sys_common_status") const operlogList = ref([]) const detailVisible = ref(false) diff --git a/src/views/system/config/index.vue b/src/views/system/config/index.vue index 16660c1..bc0d35a 100644 --- a/src/views/system/config/index.vue +++ b/src/views/system/config/index.vue @@ -169,7 +169,7 @@ import type { SysConfig, ConfigQueryParams } from '@/types/api/system/config' import { listConfig, getConfig, delConfig, addConfig, updateConfig, refreshCache } from "@/api/system/config" const { proxy } = getCurrentInstance() -const { sys_yes_no } = proxy.useDict("sys_yes_no") +const { sys_yes_no } = useDict("sys_yes_no") const configList = ref([]) const open = ref(false) diff --git a/src/views/system/dept/index.vue b/src/views/system/dept/index.vue index 63aa50e..df623f8 100644 --- a/src/views/system/dept/index.vue +++ b/src/views/system/dept/index.vue @@ -159,7 +159,7 @@ import type { SysDept, DeptQueryParams } from '@/types/api/system/dept' import type { TreeSelect } from '@/types/api/common' const { proxy } = getCurrentInstance() -const { sys_normal_disable } = proxy.useDict("sys_normal_disable") +const { sys_normal_disable } = useDict("sys_normal_disable") const deptList = ref([]) const open = ref(false) diff --git a/src/views/system/dict/data.vue b/src/views/system/dict/data.vue index 45855ed..5ba97d1 100644 --- a/src/views/system/dict/data.vue +++ b/src/views/system/dict/data.vue @@ -187,7 +187,7 @@ interface ListClassOption { } const { proxy } = getCurrentInstance() -const { sys_normal_disable } = proxy.useDict("sys_normal_disable") +const { sys_normal_disable } = useDict("sys_normal_disable") const dataList = ref([]) const open = ref(false) diff --git a/src/views/system/dict/index.vue b/src/views/system/dict/index.vue index e56b4dc..bf16db1 100644 --- a/src/views/system/dict/index.vue +++ b/src/views/system/dict/index.vue @@ -187,7 +187,7 @@ import { listType, getType, delType, addType, updateType, refreshCache } from "@ import type { SysDictType, DictTypeQueryParams } from '@/types/api/system/dict' const { proxy } = getCurrentInstance() -const { sys_normal_disable } = proxy.useDict("sys_normal_disable") +const { sys_normal_disable } = useDict("sys_normal_disable") const typeList = ref([]) const open = ref(false) diff --git a/src/views/system/menu/index.vue b/src/views/system/menu/index.vue index 09b1f1d..d539b38 100644 --- a/src/views/system/menu/index.vue +++ b/src/views/system/menu/index.vue @@ -312,7 +312,7 @@ import IconSelect from "@/components/IconSelect/index.vue" import type { SysMenu, MenuQueryParams } from '@/types/api/system/menu' const { proxy } = getCurrentInstance() -const { sys_show_hide, sys_normal_disable } = proxy.useDict("sys_show_hide", "sys_normal_disable") +const { sys_show_hide, sys_normal_disable } = useDict("sys_show_hide", "sys_normal_disable") const menuList = ref([]) const open = ref(false) diff --git a/src/views/system/notice/index.vue b/src/views/system/notice/index.vue index c8a4608..bd2a342 100644 --- a/src/views/system/notice/index.vue +++ b/src/views/system/notice/index.vue @@ -163,7 +163,7 @@ import { listNotice, getNotice, delNotice, addNotice, updateNotice } from "@/api import type { SysNotice, NoticeQueryParams } from '@/types/api/system/notice' const { proxy } = getCurrentInstance() -const { sys_notice_status, sys_notice_type } = proxy.useDict("sys_notice_status", "sys_notice_type") +const { sys_notice_status, sys_notice_type } = useDict("sys_notice_status", "sys_notice_type") const noticeList = ref([]) const open = ref(false) diff --git a/src/views/system/post/index.vue b/src/views/system/post/index.vue index 50a3232..822778d 100644 --- a/src/views/system/post/index.vue +++ b/src/views/system/post/index.vue @@ -149,7 +149,7 @@ import { listPost, addPost, delPost, getPost, updatePost } from "@/api/system/po import type { SysPost, PostQueryParams } from '@/types/api/system/post' const { proxy } = getCurrentInstance() -const { sys_normal_disable } = proxy.useDict("sys_normal_disable") +const { sys_normal_disable } = useDict("sys_normal_disable") const postList = ref([]) const open = ref(false) diff --git a/src/views/system/role/authUser.vue b/src/views/system/role/authUser.vue index 5d16127..a25253a 100644 --- a/src/views/system/role/authUser.vue +++ b/src/views/system/role/authUser.vue @@ -98,7 +98,7 @@ import type { SysUser, AuthUserQueryParams } from '@/types/api/system/user' const route = useRoute() const { proxy } = getCurrentInstance() -const { sys_normal_disable } = proxy.useDict("sys_normal_disable") +const { sys_normal_disable } = useDict("sys_normal_disable") const userList = ref([]) const loading = ref(true) diff --git a/src/views/system/role/index.vue b/src/views/system/role/index.vue index b94f9d3..bc3492f 100644 --- a/src/views/system/role/index.vue +++ b/src/views/system/role/index.vue @@ -251,7 +251,7 @@ import type { RoleMenuTreeselectResult } from '@/types/api/system/menu' const router = useRouter() const { proxy } = getCurrentInstance() -const { sys_normal_disable } = proxy.useDict("sys_normal_disable") +const { sys_normal_disable } = useDict("sys_normal_disable") const roleList = ref([]) const open = ref(false) diff --git a/src/views/system/role/selectUser.vue b/src/views/system/role/selectUser.vue index cc0d656..d857c01 100644 --- a/src/views/system/role/selectUser.vue +++ b/src/views/system/role/selectUser.vue @@ -71,7 +71,7 @@ const props = defineProps({ }) const { proxy } = getCurrentInstance() -const { sys_normal_disable } = proxy.useDict("sys_normal_disable") +const { sys_normal_disable } = useDict("sys_normal_disable") const userList = ref([]) const visible = ref(false) diff --git a/src/views/system/user/index.vue b/src/views/system/user/index.vue index c829ff7..944159a 100644 --- a/src/views/system/user/index.vue +++ b/src/views/system/user/index.vue @@ -198,7 +198,7 @@ import type { TreeSelect, TableShowColumns, AjaxResult } from '@/types/api/commo const router = useRouter() const appStore = useAppStore() const { proxy } = getCurrentInstance() -const { sys_normal_disable, sys_user_sex } = proxy.useDict("sys_normal_disable", "sys_user_sex") +const { sys_normal_disable, sys_user_sex } = useDict("sys_normal_disable", "sys_user_sex") const userList = ref([]) const open = ref(false) diff --git a/src/views/system/user/view.vue b/src/views/system/user/view.vue index a150490..1b6808d 100644 --- a/src/views/system/user/view.vue +++ b/src/views/system/user/view.vue @@ -138,9 +138,9 @@ const postOptions = ref([]) const roleOptions = ref([]) const { proxy } = getCurrentInstance() -const { sys_user_sex } = proxy.useDict("sys_user_sex") +const { sys_user_sex } = useDict("sys_user_sex") -const sexLabel = computed(() => proxy.selectDictLabel(sys_user_sex.value, info.sex) || '-') +const sexLabel = computed(() => selectDictLabel(sys_user_sex.value, info.sex) || '-') const postNames = computed(() => { if (!postOptions.value.length || !info.postIds) return '' diff --git a/vite/plugins/auto-import.ts b/vite/plugins/auto-import.ts index c1d0fc4..ecdd414 100644 --- a/vite/plugins/auto-import.ts +++ b/vite/plugins/auto-import.ts @@ -5,7 +5,11 @@ export default function createAutoImport() { imports: [ 'vue', 'vue-router', - 'pinia' + 'pinia', + { + '@/utils/dict': ['useDict'], + '@/utils/ruoyi': ['selectDictLabel'] + } ], dts: true })