北斗应用技术培训报名系统
This commit is contained in:
45
src/stores/examMsg.js
Normal file
45
src/stores/examMsg.js
Normal file
@@ -0,0 +1,45 @@
|
||||
import { defineStore } from 'pinia';
|
||||
import { parse, stringify } from 'zipson';
|
||||
|
||||
const examMsgActiveStore = defineStore('examMsg', {
|
||||
state: () => ({
|
||||
// 持久化数据
|
||||
activeIndex: "1",
|
||||
offset: 1,
|
||||
limit: 10,
|
||||
dataCount: 0,
|
||||
pageCount: 0,
|
||||
searchOptions: {
|
||||
uid: "",
|
||||
exam_name: "",
|
||||
status: "",
|
||||
application_end: "",
|
||||
exam_start: "",
|
||||
exam_end: "",
|
||||
},
|
||||
sortOptions: {
|
||||
application_end: false,
|
||||
exam_start: false,
|
||||
exam_end: false,
|
||||
},
|
||||
dialogSearchVisible: false,
|
||||
dialogSortVisible: false,
|
||||
dialogOperationVisible: false
|
||||
}),
|
||||
persist: {
|
||||
enabled: true, // Store 中数据持久化生效
|
||||
strategies: [
|
||||
{
|
||||
key: 'examMsgActive', // 存储的 key
|
||||
storage: localStorage, // 存储位置
|
||||
paths: ["activeIndex", "offset", "limit", "dataCount", "pageCount", "searchOptions", "sortOptions", "dialogSearchVisible", "dialogSortVisible", "dialogOperationVisible"], // 需要持久化的字段
|
||||
serializer: {
|
||||
deserialize: parse,
|
||||
serialize: stringify,
|
||||
},
|
||||
}
|
||||
]
|
||||
},
|
||||
});
|
||||
|
||||
export default examMsgActiveStore;
|
||||
Reference in New Issue
Block a user