车间能级提升-智能设备管理系统
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
import { defineStore } from 'pinia'
import { ref } from 'vue'
 
const initState = {
  remberPassword: false,
  username: '',
  password: '',
}
 
export const useSystemConfigStore = defineStore(
  'systemConfig',
  () => {
    const systemConfigInfo = ref<any>({ ...initState })
 
    const setConfigInfo = (val: any) => {
      systemConfigInfo.value = val
    }
 
    const clearConfigInfo = () => {
      systemConfigInfo.value = { ...initState }
    }
    // 一般没有reset需求,不需要的可以删除
    const reset = () => {
      systemConfigInfo.value = { ...initState }
    }
 
    return {
      systemConfigInfo,
      setConfigInfo,
      clearConfigInfo,
      reset,
    }
  },
  {
    persist: true,
  },
)