Browse Source

优化代码

RuoYi 3 months ago
parent
commit
1428299f55

+ 0 - 1
src/directive/common/copyText.js

@@ -2,7 +2,6 @@
 * v-copyText 复制文本内容
 * Copyright (c) 2022 ruoyi
 */
-
 export default {
   beforeMount(el, { value, arg }) {
     if (arg === "callback") {

+ 0 - 1
src/directive/permission/hasPermi.js

@@ -2,7 +2,6 @@
  * v-hasPermi 操作权限处理
  * Copyright (c) 2019 ruoyi
  */
- 
 import useUserStore from '@/store/modules/user'
 
 export default {

+ 0 - 1
src/directive/permission/hasRole.js

@@ -2,7 +2,6 @@
  * v-hasRole 角色权限处理
  * Copyright (c) 2019 ruoyi
  */
- 
 import useUserStore from '@/store/modules/user'
 
 export default {

+ 6 - 5
src/layout/components/Settings/index.vue

@@ -66,7 +66,7 @@
     <div class="drawer-item">
       <span>动态标题</span>
       <span class="comp-style">
-        <el-switch v-model="settingsStore.dynamicTitle" class="drawer-switch" />
+        <el-switch v-model="settingsStore.dynamicTitle" @change="dynamicTitleChange" class="drawer-switch" />
       </span>
     </div>
 
@@ -79,10 +79,6 @@
 </template>
 
 <script setup>
-import variables from '@/assets/styles/variables.module.scss'
-import axios from 'axios'
-import { ElLoading, ElMessage } from 'element-plus'
-import { useDynamicTitle } from '@/utils/dynamicTitle'
 import useAppStore from '@/store/modules/app'
 import useSettingsStore from '@/store/modules/settings'
 import usePermissionStore from '@/store/modules/permission'
@@ -106,6 +102,11 @@ function topNavChange(val) {
   }
 }
 
+/** 是否需要dynamicTitle */
+function dynamicTitleChange() {
+  useSettingsStore().setTitle(useSettingsStore().title)
+}
+
 function themeChange(val) {
   settingsStore.theme = val
   handleThemeStyle(val)

+ 0 - 2
src/layout/index.vue

@@ -17,8 +17,6 @@
 import { useWindowSize } from '@vueuse/core'
 import Sidebar from './components/Sidebar/index.vue'
 import { AppMain, Navbar, Settings, TagsView } from './components'
-import defaultSettings from '@/settings'
-
 import useAppStore from '@/store/modules/app'
 import useSettingsStore from '@/store/modules/settings'
 

+ 2 - 0
src/settings.js

@@ -3,10 +3,12 @@ export default {
    * 网页标题
    */
   title: import.meta.env.VITE_APP_TITLE,
+
   /**
    * 侧边栏主题 深色主题theme-dark,浅色主题theme-light
    */
   sideTheme: 'theme-dark',
+
   /**
    * 是否系统布局配置
    */

+ 0 - 1
src/utils/dynamicTitle.js

@@ -1,4 +1,3 @@
-import store from '@/store'
 import defaultSettings from '@/settings'
 import useSettingsStore from '@/store/modules/settings'
 

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

@@ -285,8 +285,9 @@
 </template>
 
 <script setup name="Job">
-import { listJob, getJob, delJob, addJob, updateJob, runJob, changeJobStatus } from "@/api/monitor/job"
 import Crontab from '@/components/Crontab'
+import { listJob, getJob, delJob, addJob, updateJob, runJob, changeJobStatus } from "@/api/monitor/job"
+
 const router = useRouter()
 const { proxy } = getCurrentInstance()
 const { sys_job_group, sys_job_status } = proxy.useDict("sys_job_group", "sys_job_status")

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

@@ -201,7 +201,7 @@
 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 } = proxy.useDict("sys_oper_type", "sys_common_status")
 
 const operlogList = ref([])
 const open = ref(false)