Pārlūkot izejas kodu

自动导入配置

RuoYi 1 mēnesi atpakaļ
vecāks
revīzija
5eb61403bb

+ 1 - 1
src/views/monitor/job/detail.vue

@@ -200,7 +200,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 form = computed(() => props.row || {})
 

+ 1 - 1
src/views/monitor/job/index.vue

@@ -245,7 +245,7 @@ import { listJob, getJob, delJob, addJob, updateJob, runJob, changeJobStatus } f
 
 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)

+ 1 - 1
src/views/monitor/job/log.vue

@@ -143,7 +143,7 @@ import { getJob } from "@/api/monitor/job"
 import { listJobLog, delJobLog, cleanJobLog } from "@/api/monitor/jobLog"
 
 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)

+ 1 - 1
src/views/monitor/logininfor/index.vue

@@ -128,7 +128,7 @@
 import { list, delLogininfor, cleanLogininfor, unlockLogininfor } from "@/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)

+ 2 - 4
src/views/monitor/operlog/detail.vue

@@ -112,8 +112,6 @@
 </template>
 
 <script setup>
-const { proxy } = getCurrentInstance()
-
 const props = defineProps({
   visible: { type: Boolean, default: false },
   row: { type: Object, default: () => ({}) }
@@ -127,10 +125,10 @@ const dialogVisible = computed({
 })
 
  
-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) {
   if (!str) return '(无数据)'

+ 1 - 1
src/views/monitor/operlog/index.vue

@@ -157,7 +157,7 @@ import OperlogDetail from './detail'
 import { list, delOperlog, cleanOperlog } from "@/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)

+ 1 - 1
src/views/system/config/index.vue

@@ -168,7 +168,7 @@
 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)

+ 1 - 1
src/views/system/dept/index.vue

@@ -157,7 +157,7 @@
 import { listDept, getDept, delDept, addDept, updateDept, updateDeptSort, listDeptExcludeChild } from "@/api/system/dept"
 
 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)

+ 1 - 1
src/views/system/dict/data.vue

@@ -181,7 +181,7 @@ import { optionselect as getDictOptionselect, getType } from "@/api/system/dict/
 import { listData, getData, delData, addData, updateData } from "@/api/system/dict/data"
 
 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)

+ 1 - 1
src/views/system/dict/index.vue

@@ -186,7 +186,7 @@ import useDictStore from '@/store/modules/dict'
 import { listType, getType, delType, addType, updateType, refreshCache } from "@/api/system/dict/type"
 
 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)

+ 1 - 1
src/views/system/menu/index.vue

@@ -311,7 +311,7 @@ import SvgIcon from "@/components/SvgIcon"
 import IconSelect from "@/components/IconSelect"
 
 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)

+ 1 - 1
src/views/system/notice/index.vue

@@ -162,7 +162,7 @@
 import { listNotice, getNotice, delNotice, addNotice, updateNotice } from "@/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)

+ 1 - 1
src/views/system/post/index.vue

@@ -148,7 +148,7 @@
 import { listPost, addPost, delPost, getPost, updatePost } from "@/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)

+ 1 - 1
src/views/system/role/authUser.vue

@@ -97,7 +97,7 @@ import { allocatedUserList, authUserCancel, authUserCancelAll } from "@/api/syst
 
 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)

+ 1 - 1
src/views/system/role/index.vue

@@ -247,7 +247,7 @@ import { roleMenuTreeselect, treeselect as menuTreeselect } from "@/api/system/m
 
 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)

+ 1 - 1
src/views/system/role/selectUser.vue

@@ -70,7 +70,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)

+ 1 - 1
src/views/system/user/index.vue

@@ -194,7 +194,7 @@ import { changeUserStatus, listUser, resetUserPwd, delUser, getUser, updateUser,
 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)

+ 2 - 3
src/views/system/user/view.vue

@@ -133,11 +133,10 @@ const loading = ref(false)
 const info = reactive({})
 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 ''

+ 5 - 1
vite/plugins/auto-import.js

@@ -5,7 +5,11 @@ export default function createAutoImport() {
     imports: [
       'vue',
       'vue-router',
-      'pinia'
+      'pinia',
+      {
+        '@/utils/dict': ['useDict'],
+        '@/utils/ruoyi': ['selectDictLabel']
+      }
     ],
     dts: false
   })