From 4ca4e5271d03989e41bb5c0d6914a1dec380e47b Mon Sep 17 00:00:00 2001
From: jiangping <jp@doumee.com>
Date: 星期二, 22 八月 2023 11:08:06 +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..d4b3256 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: '8', departId: '132' };
+ },
+
+ 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