adtec-core-package 1.7.1 → 1.7.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "adtec-core-package",
|
|
3
|
-
"version": "1.7.
|
|
3
|
+
"version": "1.7.2",
|
|
4
4
|
"private": false,
|
|
5
5
|
"type": "module",
|
|
6
6
|
"scripts": {
|
|
@@ -28,7 +28,8 @@
|
|
|
28
28
|
"exceljs": "4.4.0",
|
|
29
29
|
"jsencrypt": "^3.3.2",
|
|
30
30
|
"linq-to-ts": "^1.3.0",
|
|
31
|
-
"pinia": "^
|
|
31
|
+
"pinia": "^3.0.3",
|
|
32
|
+
"pinia-plugin-persistedstate": "^4.3.0",
|
|
32
33
|
"pinia-plugin-store": "^2.2.9",
|
|
33
34
|
"scss": "^0.2.4",
|
|
34
35
|
"scss-loader": "^0.0.1",
|
package/src/stores/dictStore.ts
CHANGED
|
@@ -7,8 +7,7 @@ import type { ISysMessageVo } from '../interface/Message.ts'
|
|
|
7
7
|
* 创建时间: 2024/9/4 下午4:25
|
|
8
8
|
* 修改时间: 2024/9/4 下午4:25
|
|
9
9
|
*/
|
|
10
|
-
export const messageStore = defineStore({
|
|
11
|
-
id: 'messageStore',
|
|
10
|
+
export const messageStore = defineStore("messageStore",{
|
|
12
11
|
state: () => ({
|
|
13
12
|
//@ts-ignore
|
|
14
13
|
messageList: [] as ISysMessageVo[],
|
|
@@ -45,5 +44,7 @@ export const messageStore = defineStore({
|
|
|
45
44
|
this.messageList.splice(index, 1)
|
|
46
45
|
}
|
|
47
46
|
},
|
|
48
|
-
},
|
|
47
|
+
},persist: {
|
|
48
|
+
storage: sessionStorage
|
|
49
|
+
}
|
|
49
50
|
})
|
|
@@ -5,8 +5,7 @@ import WujieVue from 'wujie-vue3'
|
|
|
5
5
|
import Utf8 from 'crypto-js/enc-utf8'
|
|
6
6
|
import Base64 from 'crypto-js/enc-base64'
|
|
7
7
|
const bus = useEventBus<string>('ActiveMenuInfo')
|
|
8
|
-
export const permissionStore = defineStore({
|
|
9
|
-
id: 'permissionStore',
|
|
8
|
+
export const permissionStore = defineStore("permissionStore",{
|
|
10
9
|
state: () => ({
|
|
11
10
|
/**
|
|
12
11
|
* 当前激活的一级菜单
|
|
@@ -67,7 +66,6 @@ export const permissionStore = defineStore({
|
|
|
67
66
|
*/
|
|
68
67
|
setActiveMenuInfoLevel1(menuInfo: ISysMenuInfoVo) {
|
|
69
68
|
this.activeMenuInfoLevel1 = menuInfo
|
|
70
|
-
this.updatesessionStorage()
|
|
71
69
|
},
|
|
72
70
|
/**
|
|
73
71
|
* 设置打开的菜单
|
|
@@ -80,7 +78,6 @@ export const permissionStore = defineStore({
|
|
|
80
78
|
}
|
|
81
79
|
this.activeMenuInfo = menuInfo
|
|
82
80
|
bus.emit()
|
|
83
|
-
this.updatesessionStorage()
|
|
84
81
|
},
|
|
85
82
|
/**
|
|
86
83
|
* 移除打开的菜单
|
|
@@ -92,7 +89,6 @@ export const permissionStore = defineStore({
|
|
|
92
89
|
//关闭子应用菜单
|
|
93
90
|
WujieVue.bus.$emit('wujie-router-close', menuInfo)
|
|
94
91
|
}
|
|
95
|
-
this.updatesessionStorage()
|
|
96
92
|
},
|
|
97
93
|
/**
|
|
98
94
|
* 移除所有打开的菜单
|
|
@@ -100,11 +96,6 @@ export const permissionStore = defineStore({
|
|
|
100
96
|
*/
|
|
101
97
|
removeAllOpenMenuInfo(menuInfo: ISysMenuInfoVo) {
|
|
102
98
|
this.openMenuInfo = []
|
|
103
|
-
this.updatesessionStorage()
|
|
104
|
-
},
|
|
105
|
-
updatesessionStorage(){
|
|
106
|
-
sessionStorage.setItem("permissionStore",Base64.stringify(Utf8.parse(JSON.stringify(this.$state))))
|
|
107
|
-
console.log(this.$state)
|
|
108
99
|
},
|
|
109
100
|
clear() {
|
|
110
101
|
this.openMenuInfo = []
|
|
@@ -112,7 +103,9 @@ export const permissionStore = defineStore({
|
|
|
112
103
|
this.activeMenuInfoLevel1 = null
|
|
113
104
|
//@ts-ignore
|
|
114
105
|
this.activeMenuInfo = null
|
|
115
|
-
this.updatesessionStorage()
|
|
116
106
|
},
|
|
117
107
|
},
|
|
108
|
+
persist: {
|
|
109
|
+
storage: sessionStorage
|
|
110
|
+
},
|
|
118
111
|
})
|
|
@@ -3,6 +3,7 @@ import { storePlugin } from 'pinia-plugin-store'
|
|
|
3
3
|
import Utf8 from 'crypto-js/enc-utf8'
|
|
4
4
|
import Base64 from 'crypto-js/enc-base64'
|
|
5
5
|
|
|
6
|
+
import piniaPluginPersistedstate from 'pinia-plugin-persistedstate'
|
|
6
7
|
const store = createPinia()
|
|
7
8
|
function encrypt(value: string): string {
|
|
8
9
|
return Base64.stringify(Utf8.parse(value))
|
|
@@ -11,13 +12,14 @@ function decrypt(value: string): string {
|
|
|
11
12
|
return Base64.parse(value).toString(Utf8)
|
|
12
13
|
}
|
|
13
14
|
|
|
14
|
-
const plugin = storePlugin({
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
})
|
|
22
|
-
store.use(
|
|
15
|
+
// const plugin = storePlugin({
|
|
16
|
+
// stores: ['userInfoStore', 'messageStore', 'dictStore','permissionStore'],
|
|
17
|
+
// // use alone storage
|
|
18
|
+
// // stores: [{name:'theme_store',storage: localStorage}]
|
|
19
|
+
// storage: sessionStorage, //default storage
|
|
20
|
+
// encrypt,
|
|
21
|
+
// decrypt,
|
|
22
|
+
// })
|
|
23
|
+
store.use(piniaPluginPersistedstate)
|
|
24
|
+
// store.use(plugin)
|
|
23
25
|
export default store
|
|
@@ -7,8 +7,7 @@
|
|
|
7
7
|
import { defineStore } from 'pinia'
|
|
8
8
|
import type { IUserPermissionVo } from '../interface/IUserPermissionVo'
|
|
9
9
|
|
|
10
|
-
export const userInfoStore = defineStore({
|
|
11
|
-
id: 'userInfoStore',
|
|
10
|
+
export const userInfoStore = defineStore("userInfoStore",{
|
|
12
11
|
state: () => ({
|
|
13
12
|
//@ts-ignore
|
|
14
13
|
user: null as IUserPermissionVo
|
|
@@ -27,5 +26,7 @@ export const userInfoStore = defineStore({
|
|
|
27
26
|
//@ts-ignore
|
|
28
27
|
this.user = null
|
|
29
28
|
}
|
|
30
|
-
}
|
|
29
|
+
},persist: {
|
|
30
|
+
storage: sessionStorage
|
|
31
|
+
},
|
|
31
32
|
})
|