feat(frontend): 合入 RuoYi 3.9.2 前端升级
- 升级 vue-router 4.3 → 4.6.4 (router4 新写法) - 升级 echarts 5.4 → 5.6.0 - 修复 permission.js router4 过期 next() 写法 - 新增 isPathMatch 通配符白名单匹配 - 新增 TreePanel 树分割组件 (左树右表) - 新增 ExcelImportDialog 导入组件 - 新增锁屏功能 (lock.js + lock.vue) - 新增密码规则校验 (passwordRule.js) - 新增 HeaderNotice 顶部通知组件 - 新增 TopBar 顶部工具栏组件 - 新增 Copyright 版权组件 - 增强 TagsView 持久化标签页 - 添加升级计划文档 (UPGRADE_PLAN_v2.0.md)
This commit is contained in:
27
openhis-ui-vue3/src/store/modules/lock.js
Normal file
27
openhis-ui-vue3/src/store/modules/lock.js
Normal file
@@ -0,0 +1,27 @@
|
||||
const LOCK_KEY = 'screen-lock'
|
||||
const LOCK_PATH_KEY = 'screen-lock-path'
|
||||
|
||||
export const useLockStore = defineStore('lock', {
|
||||
state: () => ({
|
||||
isLock: JSON.parse(localStorage.getItem(LOCK_KEY) || 'false'),
|
||||
lockPath: localStorage.getItem(LOCK_PATH_KEY) || '/index'
|
||||
}),
|
||||
actions: {
|
||||
// 锁定屏幕,同时记录当前路径
|
||||
lockScreen(currentPath) {
|
||||
this.lockPath = currentPath || '/index'
|
||||
localStorage.setItem(LOCK_PATH_KEY, this.lockPath)
|
||||
this.isLock = true
|
||||
localStorage.setItem(LOCK_KEY, 'true')
|
||||
},
|
||||
// 解锁屏幕,清除路径
|
||||
unlockScreen() {
|
||||
this.isLock = false
|
||||
localStorage.setItem(LOCK_KEY, 'false')
|
||||
this.lockPath = '/index'
|
||||
localStorage.setItem(LOCK_PATH_KEY, '/index')
|
||||
}
|
||||
}
|
||||
})
|
||||
|
||||
export default useLockStore
|
||||
Reference in New Issue
Block a user