From d5d7e33e403a4ffe49f5dd1d073fcdf21bc0bb88 Mon Sep 17 00:00:00 2001
From: Mr.Shi <1878285526@qq.com>
Date: 星期二, 22 八月 2023 14:28:02 +0800
Subject: [PATCH] 大屏
---
screen_standard/src/stores/counter.js | 28 ++++++++++++++++++++--------
1 files changed, 20 insertions(+), 8 deletions(-)
diff --git a/screen_standard/src/stores/counter.js b/screen_standard/src/stores/counter.js
index b6757ba..b933f23 100644
--- a/screen_standard/src/stores/counter.js
+++ b/screen_standard/src/stores/counter.js
@@ -1,12 +1,24 @@
-import { ref, computed } from 'vue'
-import { defineStore } from 'pinia'
+import { computed } from 'vue';
+import { defineStore } from 'pinia';
-export const useCounterStore = defineStore('counter', () => {
- const count = ref(0)
- const doubleCount = computed(() => count.value * 2)
- function increment() {
- count.value++
+export const useCounterStore = defineStore('enterprise', {
+
+ state: () => {
+ // 678
+ return { companyId: '', departId: '' };
+ },
+
+ actions: {
+ // 璁剧疆浼佷笟id
+ setCompanyId(companyId) {
+ this.companyId = companyId;
+ window.sessionStorage.setItem('companyId', companyId);
+ },
+ // 璁剧疆缁勭粐id
+ setDepartId(departId) {
+ this.departId = departId;
+ window.sessionStorage.setItem('departId', departId);
+ }
}
- return { count, doubleCount, increment }
})
--
Gitblit v1.9.3