tanghaolin
2025-03-06 2fdfc7907920e9003c62445b6000dc3c9edd6edb
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
//选型模块
import { defineStore } from "pinia";
const corpFlag = "IEE";
const keyBySimu = `${corpFlag}_BySimu`;
const keyByParas = `${corpFlag}_ByParas`;
export const useSelect = defineStore("select", {
  state: () => ({
    /**参数选型 */
    ByParas:JSON.parse(sessionStorage.getItem(keyByParas)) || {}
  }),
  actions: {
    setByParas(current) {
      sessionStorage.setItem(keyByParas,JSON.stringify(current));
      Object.assign(this.ByParas, current);
    },
 
    setBySimu(current) {
      sessionStorage.setItem(keyBySimu, JSON.stringify(current));
      Object.assign(this.BySimu, current);
    },
 
    setBySWParas(current) {
      sessionStorage.setItem("BySWParas", JSON.stringify(current));
      Object.assign(this.BySWParas, current);
    },
    
    clear(key) {
      sessionStorage.remove(key);
    },
  },
});