| | |
| | | import { defineStore } from 'pinia'; |
| | | |
| | | export const useCounterStore = defineStore('enterprise', { |
| | | |
| | | state: () => { |
| | | return { count: 0 } |
| | | // 678 |
| | | return { companyId: '8', departId: '132' }; |
| | | }, |
| | | // 也可以定义为 |
| | | // state: () => ({ count: 0 }) |
| | | |
| | | actions: { |
| | | increment() { |
| | | this.count++ |
| | | // 设置企业id |
| | | setCompanyId(companyId) { |
| | | this.companyId = companyId; |
| | | window.sessionStorage.setItem('companyId', companyId); |
| | | }, |
| | | // 设置组织id |
| | | setDepartId(departId) { |
| | | this.departId = departId; |
| | | window.sessionStorage.setItem('departId', departId); |
| | | } |
| | | } |
| | | |
| | | }) |