From 8421ce283636a1b255c099e511fb002b7d073cdd Mon Sep 17 00:00:00 2001 From: Kven <2955163637@qq.com> Date: Mon, 13 Jan 2025 12:14:12 +0800 Subject: [PATCH] =?UTF-8?q?fix(pinia=E6=A8=A1=E5=9D=97=EF=BC=8C=E5=B9=B6?= =?UTF-8?q?=E5=B0=86=E6=B6=88=E6=81=AF=E6=A8=A1=E5=9D=97=E5=8A=A0=E5=85=A5?= =?UTF-8?q?=E7=89=88=E6=9C=AC=E7=AE=A1=E7=90=86):=20=E4=BF=AE=E5=A4=8D?= =?UTF-8?q?=E4=B9=8B=E5=89=8D=E7=9A=84=E9=A1=B5=E9=9D=A2=E8=AF=B7=E6=B1=82?= =?UTF-8?q?=E5=A4=B1=E6=95=88=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit BUG出现在pinia的defineStore方法上,第一个参数是写唯一标识,此前错误的将所有都写成了dept,故导致出现请求失效BUG --- src/store/modules/bulle-mgmt/index.ts | 2 +- src/store/modules/bulletins/index.ts | 2 +- src/store/modules/message-mgmt/index.ts | 2 +- src/store/modules/messages/index.ts | 2 +- src/views/notification/bulletin/index.vue | 37 +- .../notice/components/message-edit.vue | 475 ++++++++++++++++++ src/views/notification/notice/index.vue | 352 +++++++++++++ 7 files changed, 849 insertions(+), 23 deletions(-) create mode 100644 src/views/notification/notice/components/message-edit.vue create mode 100644 src/views/notification/notice/index.vue diff --git a/src/store/modules/bulle-mgmt/index.ts b/src/store/modules/bulle-mgmt/index.ts index 6ee0642..a0c7886 100644 --- a/src/store/modules/bulle-mgmt/index.ts +++ b/src/store/modules/bulle-mgmt/index.ts @@ -18,7 +18,7 @@ import { } from '@/api/bulletin-mgmt'; import { bulletinsStore } from '@/store/modules/bulle-mgmt/type'; -const useBulletinStore = defineStore('dept', { +const useBulletinStore = defineStore('bulletin-mgmt', { state: ():bulletinsStore => ({ remark: undefined, title: undefined, diff --git a/src/store/modules/bulletins/index.ts b/src/store/modules/bulletins/index.ts index e2655e6..3923caa 100644 --- a/src/store/modules/bulletins/index.ts +++ b/src/store/modules/bulletins/index.ts @@ -6,7 +6,7 @@ import { } from '@/api/bulletins'; import { bulletinsStore } from './type'; -const useBulletinsStore = defineStore('auth', { +const useBulletinsStore = defineStore('bulletin', { state: (): bulletinsStore => ({ title: undefined, state: undefined, diff --git a/src/store/modules/message-mgmt/index.ts b/src/store/modules/message-mgmt/index.ts index 845ec1b..d157fdd 100644 --- a/src/store/modules/message-mgmt/index.ts +++ b/src/store/modules/message-mgmt/index.ts @@ -10,7 +10,7 @@ import { } from '@/api/message-mgmt'; import { messageStore } from '@/store/modules/message-mgmt/type'; -const useMessageStore = defineStore('dept', { +const useMessageStore = defineStore('message-mgmt', { state: ():messageStore => ({ remark: undefined, title: undefined, diff --git a/src/store/modules/messages/index.ts b/src/store/modules/messages/index.ts index fe8bd11..4740340 100644 --- a/src/store/modules/messages/index.ts +++ b/src/store/modules/messages/index.ts @@ -10,7 +10,7 @@ import { } from '@/api/messages'; import { messagesStore } from '@/store/modules/messages/type'; -const useMessagesStore = defineStore('dept', { +const useMessagesStore = defineStore('message', { state: ():messagesStore => ({ remark: undefined, title: undefined, diff --git a/src/views/notification/bulletin/index.vue b/src/views/notification/bulletin/index.vue index eff4c35..24c3acf 100644 --- a/src/views/notification/bulletin/index.vue +++ b/src/views/notification/bulletin/index.vue @@ -1,6 +1,6 @@