@pubinfo/core 2.0.0-beta.7 → 2.0.0-beta.8
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/{AppSetting-Bv7xCe88.js → AppSetting-BQT7OI6K.js} +16 -16
- package/dist/{HCheckList.vue_vue_type_script_setup_true_lang-DanhyVxU.js → HCheckList.vue_vue_type_script_setup_true_lang-D4u_haxr.js} +2 -2
- package/dist/{PreferencesContent-5bwij0az.js → PreferencesContent-MR1Db7z7.js} +46 -46
- package/dist/{SettingBreadcrumb-DxnZ4kvv.js → SettingBreadcrumb-CgugOTgx.js} +2 -2
- package/dist/{SettingCopyright-C4rrvQ52.js → SettingCopyright-BPeCJBLi.js} +1 -1
- package/dist/{SettingEnableTransition-Dgss1jFn.js → SettingEnableTransition-BK0_EH_N.js} +1 -1
- package/dist/{SettingHome-Dcqz6iCb.js → SettingHome-DGnxlXLd.js} +1 -1
- package/dist/{SettingMenu-BMaSeklX.js → SettingMenu-BqAd9zbL.js} +2 -2
- package/dist/{SettingMode-CJXj9LL9.js → SettingMode-CgA3XDwW.js} +1 -1
- package/dist/{SettingNavSearch-BMN3jDNW.js → SettingNavSearch-WFnkcRQ3.js} +1 -1
- package/dist/{SettingOther-DeLyS4HI.js → SettingOther-CG4RI6mO.js} +1 -1
- package/dist/{SettingPage-B2Cj8x_L.js → SettingPage-C1CT1Mm8.js} +1 -1
- package/dist/{SettingTabbar-DipvqgLC.js → SettingTabbar-CQA6ZT9l.js} +2 -2
- package/dist/{SettingThemes-APuKr4OB.js → SettingThemes-BJu9czNK.js} +2 -2
- package/dist/{SettingToolbar-BIYD2Pvu.js → SettingToolbar-DdR2940j.js} +1 -1
- package/dist/{SettingTopbar-C8o6tnVH.js → SettingTopbar-C_jYO_Ax.js} +2 -2
- package/dist/{SettingWidthMode-DBz8Kxmh.js → SettingWidthMode-ir_28SE3.js} +1 -1
- package/dist/{TopThinMode-6oFZVnh7.js → TopThinMode-jHDpKsma.js} +1 -1
- package/dist/{_...all_-DI_QAUox.js → _...all_-18BnHmEa.js} +1 -1
- package/dist/{colors-oRlAXMUC.js → colors-gu4NABiz.js} +1 -1
- package/dist/{index-BkqnOkyO.js → index-C1p_tY7i.js} +1 -1
- package/dist/{index-CUFIyWeP.js → index-CCPTQYuB.js} +2108 -2111
- package/dist/{index-ChOUZNbk.js → index-CNUEMTao.js} +2 -2
- package/dist/{index-Dav3jQVP.js → index-CWIfG62O.js} +2 -2
- package/dist/{index-BvVAS3S-.js → index-CjsnFBwd.js} +14 -8
- package/dist/{index-BjwuS5bV.js → index-CmXo8ShY.js} +12 -12
- package/dist/{index-BHkrq701.js → index-DL8Y7jFG.js} +9 -9
- package/dist/{index-P2cA5UeU.js → index-Dj8zy7hH.js} +4 -4
- package/dist/{index-D8eeneI_.js → index-NpS61xSA.js} +22 -22
- package/dist/index.js +25 -26
- package/dist/{index.vue_vue_type_style_index_0_scoped_fa1c6ee4_lang-BBe8CvCV.js → index.vue_vue_type_style_index_0_scoped_fa1c6ee4_lang-BCo6Ft-Q.js} +1 -1
- package/dist/layout/composables/useContext.d.ts +1 -2
- package/dist/{notification-6D5hA7Bp.js → menu-CLiZ1BO_.js} +481 -513
- package/dist/{pick-Br-UKn7B.js → pick-C9bU8_xv.js} +1 -1
- package/dist/request.js +23 -23
- package/dist/stores/modules/index.d.ts +0 -2
- package/dist/style.css +1 -1
- package/package.json +7 -7
- package/src/layout/components/Tools/index.vue +2 -19
- package/src/layout/composables/useContext.ts +0 -2
- package/src/layout/provider.ts +0 -3
- package/src/route/routes.ts +0 -9
- package/src/stores/modules/index.ts +0 -2
- package/dist/stores/modules/notification.d.ts +0 -19
- package/src/layout/components/Tools/Notification.vue +0 -152
- package/src/pages/personal/notification.vue +0 -58
- package/src/stores/modules/notification.ts +0 -35
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@pubinfo/core",
|
|
3
3
|
"type": "module",
|
|
4
|
-
"version": "2.0.0-beta.
|
|
4
|
+
"version": "2.0.0-beta.8",
|
|
5
5
|
"exports": {
|
|
6
6
|
".": {
|
|
7
7
|
"types": "./dist/index.d.ts",
|
|
@@ -23,22 +23,22 @@
|
|
|
23
23
|
"types"
|
|
24
24
|
],
|
|
25
25
|
"peerDependencies": {
|
|
26
|
-
"alova": "^3.2.
|
|
27
|
-
"pinia": "^2.3.
|
|
26
|
+
"alova": "^3.2.9",
|
|
27
|
+
"pinia": "^2.3.1",
|
|
28
28
|
"vue": "^3.5.13",
|
|
29
29
|
"vue-i18n": "^10.0.5",
|
|
30
30
|
"vue-router": "^4.5.0",
|
|
31
|
-
"@pubinfo/config": "2.0.0-beta.
|
|
31
|
+
"@pubinfo/config": "2.0.0-beta.8"
|
|
32
32
|
},
|
|
33
33
|
"dependencies": {
|
|
34
34
|
"@alova/adapter-axios": "^2.0.13",
|
|
35
35
|
"@ant-design/icons-vue": "^7.0.1",
|
|
36
36
|
"@headlessui/vue": "^1.7.23",
|
|
37
37
|
"@imengyu/vue3-context-menu": "^1.4.4",
|
|
38
|
-
"@pubinfo/pro-components": "^1.
|
|
38
|
+
"@pubinfo/pro-components": "^1.7.0",
|
|
39
39
|
"@unocss/reset": "^65.5.0",
|
|
40
40
|
"@vueuse/core": "^12.7.0",
|
|
41
|
-
"@vueuse/integrations": "^12.
|
|
41
|
+
"@vueuse/integrations": "^12.8.2",
|
|
42
42
|
"ant-design-vue": "^4.2.6",
|
|
43
43
|
"axios": "^1.8.1",
|
|
44
44
|
"consola": "^3.4.0",
|
|
@@ -85,7 +85,7 @@
|
|
|
85
85
|
"vue": "^3.5.13",
|
|
86
86
|
"vue-i18n": "^10.0.5",
|
|
87
87
|
"vue-router": "^4.5.0",
|
|
88
|
-
"@pubinfo/config": "2.0.0-beta.
|
|
88
|
+
"@pubinfo/config": "2.0.0-beta.8"
|
|
89
89
|
},
|
|
90
90
|
"scripts": {
|
|
91
91
|
"dev": "vite build -w -m watch",
|
|
@@ -2,7 +2,6 @@
|
|
|
2
2
|
import { useFullscreen } from '@vueuse/core';
|
|
3
3
|
import { useI18n } from 'vue-i18n';
|
|
4
4
|
import CarbonUserAvatarFilledAlt from '~icons/carbon/user-avatar-filled-alt';
|
|
5
|
-
// import FluentAlert12Regular from '~icons/fluent/alert-12-regular';
|
|
6
5
|
import FluentArrowSync16Filled from '~icons/fluent/arrow-sync-16-filled';
|
|
7
6
|
import FluentFullScreenMaximize16Filled from '~icons/fluent/full-screen-maximize-16-filled';
|
|
8
7
|
import FluentFullScreenMinimize16Filled from '~icons/fluent/full-screen-minimize-16-filled';
|
|
@@ -17,7 +16,6 @@ import useViewTransition from '../../composables/useViewTransition';
|
|
|
17
16
|
import DayNightSwitch from './DayNightSwitch.vue';
|
|
18
17
|
import HotkeysIntro from './HotkeysIntro.vue';
|
|
19
18
|
// import I18nSelector from './I18nSelector.vue';
|
|
20
|
-
// import Notification from './Notification.vue';
|
|
21
19
|
import Preferences from './Preferences/index.vue';
|
|
22
20
|
import Search from './Search.vue';
|
|
23
21
|
|
|
@@ -26,9 +24,7 @@ defineOptions({
|
|
|
26
24
|
});
|
|
27
25
|
|
|
28
26
|
const router = useRouter();
|
|
29
|
-
const { settingsStore, userStore,
|
|
30
|
-
|
|
31
|
-
notificationStore.init();
|
|
27
|
+
const { settingsStore, userStore, generateI18nTitle } = useContext();
|
|
32
28
|
|
|
33
29
|
const { t } = useI18n();
|
|
34
30
|
|
|
@@ -175,20 +171,7 @@ const searchComponentsClass = computed(() => {
|
|
|
175
171
|
>
|
|
176
172
|
<IconamoonSearch text="14px" />
|
|
177
173
|
</span>
|
|
178
|
-
<!-- <
|
|
179
|
-
v-if="settingsStore.settings.toolbar.enableNotification"
|
|
180
|
-
class="item"
|
|
181
|
-
>
|
|
182
|
-
<HBadge
|
|
183
|
-
:value="notificationStore.total"
|
|
184
|
-
>
|
|
185
|
-
<FluentAlert12Regular text="15px" />
|
|
186
|
-
</HBadge>
|
|
187
|
-
<template #dropdown>
|
|
188
|
-
<Notification />
|
|
189
|
-
</template>
|
|
190
|
-
</HDropdown>
|
|
191
|
-
<I18nSelector class="item">
|
|
174
|
+
<!-- <I18nSelector class="item">
|
|
192
175
|
<RiTranslate text="15px" />
|
|
193
176
|
</I18nSelector> -->
|
|
194
177
|
<span
|
|
@@ -3,7 +3,6 @@ import type {
|
|
|
3
3
|
useIframeStore,
|
|
4
4
|
useKeepAliveStore,
|
|
5
5
|
useMenuStore,
|
|
6
|
-
useNotificationStore,
|
|
7
6
|
useRouteStore,
|
|
8
7
|
useSettingsStore,
|
|
9
8
|
useTabbarStore,
|
|
@@ -16,7 +15,6 @@ interface LayoutContext {
|
|
|
16
15
|
keepAliveStore: ReturnType<typeof useKeepAliveStore>
|
|
17
16
|
iframeStore: ReturnType<typeof useIframeStore>
|
|
18
17
|
userStore: ReturnType<typeof useUserStore>
|
|
19
|
-
notificationStore: ReturnType<typeof useNotificationStore>
|
|
20
18
|
menuStore: ReturnType<typeof useMenuStore>
|
|
21
19
|
routeStore: ReturnType<typeof useRouteStore>
|
|
22
20
|
tabbarStore: ReturnType<typeof useTabbarStore>
|
package/src/layout/provider.ts
CHANGED
|
@@ -3,7 +3,6 @@ import {
|
|
|
3
3
|
useIframeStore,
|
|
4
4
|
useKeepAliveStore,
|
|
5
5
|
useMenuStore,
|
|
6
|
-
useNotificationStore,
|
|
7
6
|
useRouteStore,
|
|
8
7
|
useSettingsStore,
|
|
9
8
|
useTabbarStore,
|
|
@@ -33,7 +32,6 @@ export const Provider = defineComponent({
|
|
|
33
32
|
const keepAliveStore = useKeepAliveStore();
|
|
34
33
|
const iframeStore = useIframeStore();
|
|
35
34
|
const userStore = useUserStore();
|
|
36
|
-
const notificationStore = useNotificationStore();
|
|
37
35
|
const routeStore = useRouteStore();
|
|
38
36
|
const tabbarStore = useTabbarStore();
|
|
39
37
|
const favoritesStore = useFavoritesStore();
|
|
@@ -46,7 +44,6 @@ export const Provider = defineComponent({
|
|
|
46
44
|
keepAliveStore,
|
|
47
45
|
iframeStore,
|
|
48
46
|
userStore,
|
|
49
|
-
notificationStore,
|
|
50
47
|
routeStore,
|
|
51
48
|
tabbarStore,
|
|
52
49
|
favoritesStore,
|
package/src/route/routes.ts
CHANGED
|
@@ -96,15 +96,6 @@ export const systemRoutes: RouteRecordRaw[] = [
|
|
|
96
96
|
icon: 'i-iconamoon-profile-duotone',
|
|
97
97
|
},
|
|
98
98
|
},
|
|
99
|
-
// {
|
|
100
|
-
// path: 'personal/notification',
|
|
101
|
-
// name: 'Notification',
|
|
102
|
-
// component: () => import('@/pages/personal/notification.vue'),
|
|
103
|
-
// meta: {
|
|
104
|
-
// title: '通知中心',
|
|
105
|
-
// i18n: 'route.personal.notification',
|
|
106
|
-
// },
|
|
107
|
-
// },
|
|
108
99
|
],
|
|
109
100
|
},
|
|
110
101
|
];
|
|
@@ -6,8 +6,6 @@ export { default as useKeepAliveStore } from './keepAlive';
|
|
|
6
6
|
export * from './keepAlive';
|
|
7
7
|
export { default as useMenuStore } from './menu';
|
|
8
8
|
export * from './menu';
|
|
9
|
-
export { default as useNotificationStore } from './notification';
|
|
10
|
-
export * from './notification';
|
|
11
9
|
export { default as useRouteStore } from './route';
|
|
12
10
|
export * from './route';
|
|
13
11
|
export { default as useSettingsStore } from './settings';
|
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
import { STORE_NAME } from '../enum';
|
|
2
|
-
declare const useNotificationStore: import('pinia').StoreDefinition<STORE_NAME.NOTIFICATION, Pick<{
|
|
3
|
-
message: any;
|
|
4
|
-
todo: any;
|
|
5
|
-
total: any;
|
|
6
|
-
init: () => void;
|
|
7
|
-
}, any>, Pick<{
|
|
8
|
-
message: any;
|
|
9
|
-
todo: any;
|
|
10
|
-
total: any;
|
|
11
|
-
init: () => void;
|
|
12
|
-
}, any>, Pick<{
|
|
13
|
-
message: any;
|
|
14
|
-
todo: any;
|
|
15
|
-
total: any;
|
|
16
|
-
init: () => void;
|
|
17
|
-
}, any>>;
|
|
18
|
-
export default useNotificationStore;
|
|
19
|
-
export type NotificationStore = ReturnType<typeof useNotificationStore>;
|
|
@@ -1,152 +0,0 @@
|
|
|
1
|
-
<script setup lang="ts">
|
|
2
|
-
import { OverlayScrollbarsComponent } from 'overlayscrollbars-vue';
|
|
3
|
-
import FluentMail16Filled from '~icons/fluent/mail-16-filled';
|
|
4
|
-
import RiFileEditFill from '~icons/ri/file-edit-fill';
|
|
5
|
-
import RiServiceFill from '~icons/ri/service-fill';
|
|
6
|
-
import TablerMoodSmile from '~icons/tabler/mood-smile';
|
|
7
|
-
|
|
8
|
-
defineOptions({
|
|
9
|
-
name: 'Notification',
|
|
10
|
-
});
|
|
11
|
-
|
|
12
|
-
const activeName = ref('message');
|
|
13
|
-
</script>
|
|
14
|
-
|
|
15
|
-
<template>
|
|
16
|
-
<div class="w-xs dark:bg-[var(--g-container-bg)]">
|
|
17
|
-
<template v-if="activeName === 'message'">
|
|
18
|
-
<OverlayScrollbarsComponent :options="{ scrollbars: { autoHide: 'leave', autoHideDelay: 300 } }" defer class="list max-h-300px dark:bg-[var(--g-container-bg)]">
|
|
19
|
-
<div class="item">
|
|
20
|
-
<div class="item-icon">
|
|
21
|
-
<FluentMail16Filled />
|
|
22
|
-
</div>
|
|
23
|
-
|
|
24
|
-
<div class="info">
|
|
25
|
-
<div class="title">
|
|
26
|
-
你收到了 8 份日报
|
|
27
|
-
</div>
|
|
28
|
-
<div class="date">
|
|
29
|
-
2020-10-10 10:00:00
|
|
30
|
-
</div>
|
|
31
|
-
</div>
|
|
32
|
-
</div>
|
|
33
|
-
<div class="item">
|
|
34
|
-
<div class="item-icon service">
|
|
35
|
-
<RiServiceFill />
|
|
36
|
-
</div>
|
|
37
|
-
<div class="info">
|
|
38
|
-
<div class="title">
|
|
39
|
-
你收到了 3 位同事的好友申请,请及时处理
|
|
40
|
-
</div>
|
|
41
|
-
<div class="date">
|
|
42
|
-
2020-10-10 10:00:00
|
|
43
|
-
</div>
|
|
44
|
-
</div>
|
|
45
|
-
</div>
|
|
46
|
-
<div class="item">
|
|
47
|
-
<div class="item-icon file-edit">
|
|
48
|
-
<RiFileEditFill />
|
|
49
|
-
</div>
|
|
50
|
-
<div class="info">
|
|
51
|
-
<div class="title">
|
|
52
|
-
你有 3 份合同待审批
|
|
53
|
-
</div>
|
|
54
|
-
<div class="date">
|
|
55
|
-
2020-10-10 10:00:00
|
|
56
|
-
</div>
|
|
57
|
-
</div>
|
|
58
|
-
</div>
|
|
59
|
-
<div class="item">
|
|
60
|
-
<div class="item-icon">
|
|
61
|
-
<FluentMail16Filled />
|
|
62
|
-
</div>
|
|
63
|
-
<div class="info">
|
|
64
|
-
<div class="title">
|
|
65
|
-
你收到了 8 份日报
|
|
66
|
-
</div>
|
|
67
|
-
<div class="date">
|
|
68
|
-
2020-10-10 10:00:00
|
|
69
|
-
</div>
|
|
70
|
-
</div>
|
|
71
|
-
</div>
|
|
72
|
-
<div class="item">
|
|
73
|
-
<div class="item-icon service">
|
|
74
|
-
<RiServiceFill />
|
|
75
|
-
</div>
|
|
76
|
-
<div class="info">
|
|
77
|
-
<div class="title">
|
|
78
|
-
你收到了 3 位同事的好友申请,请及时处理
|
|
79
|
-
</div>
|
|
80
|
-
<div class="date">
|
|
81
|
-
2020-10-10 10:00:00
|
|
82
|
-
</div>
|
|
83
|
-
</div>
|
|
84
|
-
</div>
|
|
85
|
-
</OverlayScrollbarsComponent>
|
|
86
|
-
<RouterLink v-slot="{ navigate }" :to="{ name: 'Notification' }" custom>
|
|
87
|
-
<div class="cursor-pointer py-4 text-center text-sm text-stone-5" @click="navigate">
|
|
88
|
-
进入消息列表
|
|
89
|
-
</div>
|
|
90
|
-
</RouterLink>
|
|
91
|
-
</template>
|
|
92
|
-
<template v-if="activeName === 'todo'">
|
|
93
|
-
<OverlayScrollbarsComponent :options="{ scrollbars: { autoHide: 'leave', autoHideDelay: 300 } }" defer class="list max-h-300px">
|
|
94
|
-
<div class="flex flex-col items-center py-6 text-stone-5">
|
|
95
|
-
<TablerMoodSmile text="40px" />
|
|
96
|
-
<p m-2 text-base>
|
|
97
|
-
没有新待办
|
|
98
|
-
</p>
|
|
99
|
-
</div>
|
|
100
|
-
</OverlayScrollbarsComponent>
|
|
101
|
-
<RouterLink v-slot="{ navigate }" :to="{ name: 'Notification' }" custom>
|
|
102
|
-
<div class="cursor-pointer py-4 text-center text-sm text-stone-5" @click="navigate">
|
|
103
|
-
进入待办列表
|
|
104
|
-
</div>
|
|
105
|
-
</RouterLink>
|
|
106
|
-
</template>
|
|
107
|
-
</div>
|
|
108
|
-
</template>
|
|
109
|
-
|
|
110
|
-
<style lang="scss" scoped>
|
|
111
|
-
:deep([data-overlayscrollbars-viewport]) {
|
|
112
|
-
overscroll-behavior: contain;
|
|
113
|
-
}
|
|
114
|
-
|
|
115
|
-
.list {
|
|
116
|
-
--at-apply: border-block-width-1 border-block-solid border-block-stone-2 dark:border-block-stone-7;
|
|
117
|
-
|
|
118
|
-
.item {
|
|
119
|
-
--at-apply: flex items-start gap-3 px-3 py-4 cursor-pointer border-b-width-1 last:border-b-width-0 border-b-solid border-b-stone-2 dark:border-b-stone-7 hover:bg-stone-1 dark:hover:bg-dark/50;
|
|
120
|
-
|
|
121
|
-
.item-icon {
|
|
122
|
-
display: flex;
|
|
123
|
-
align-items: center;
|
|
124
|
-
justify-content: center;
|
|
125
|
-
|
|
126
|
-
--at-apply: w-6 h-6 text-xs rounded-full text-white bg-blue;
|
|
127
|
-
|
|
128
|
-
&.service {
|
|
129
|
-
--at-apply: bg-green;
|
|
130
|
-
}
|
|
131
|
-
|
|
132
|
-
&.file-edit {
|
|
133
|
-
--at-apply: bg-orange;
|
|
134
|
-
}
|
|
135
|
-
|
|
136
|
-
&.bug {
|
|
137
|
-
--at-apply: bg-pink;
|
|
138
|
-
}
|
|
139
|
-
}
|
|
140
|
-
|
|
141
|
-
.info {
|
|
142
|
-
.title {
|
|
143
|
-
--at-apply: text-sm line-clamp-2;
|
|
144
|
-
}
|
|
145
|
-
|
|
146
|
-
.date {
|
|
147
|
-
--at-apply: mt-1 text-xs text-stone-5;
|
|
148
|
-
}
|
|
149
|
-
}
|
|
150
|
-
}
|
|
151
|
-
}
|
|
152
|
-
</style>
|
|
@@ -1,58 +0,0 @@
|
|
|
1
|
-
<script setup lang="ts">
|
|
2
|
-
import { PageHeader, PageMain, PubinfoIcon } from '@/components';
|
|
3
|
-
import { useNotificationStore } from '@/stores';
|
|
4
|
-
|
|
5
|
-
defineOptions({
|
|
6
|
-
name: 'PersonalNotification',
|
|
7
|
-
});
|
|
8
|
-
|
|
9
|
-
const notificationStore = useNotificationStore();
|
|
10
|
-
|
|
11
|
-
function messagePlus() {
|
|
12
|
-
notificationStore.$patch((state) => {
|
|
13
|
-
state.message += 1;
|
|
14
|
-
});
|
|
15
|
-
}
|
|
16
|
-
function messageMinus() {
|
|
17
|
-
notificationStore.$patch((state) => {
|
|
18
|
-
state.message -= state.message > 0 ? 1 : 0;
|
|
19
|
-
});
|
|
20
|
-
}
|
|
21
|
-
|
|
22
|
-
function todoPlus() {
|
|
23
|
-
notificationStore.$patch((state) => {
|
|
24
|
-
state.todo += 1;
|
|
25
|
-
});
|
|
26
|
-
}
|
|
27
|
-
function todoMinus() {
|
|
28
|
-
notificationStore.$patch((state) => {
|
|
29
|
-
state.todo -= state.todo > 0 ? 1 : 0;
|
|
30
|
-
});
|
|
31
|
-
}
|
|
32
|
-
</script>
|
|
33
|
-
|
|
34
|
-
<template>
|
|
35
|
-
<div>
|
|
36
|
-
<PageHeader title="通知中心" content="本页面仅模拟右上角通知数变化,具体业务逻辑请到 /src/store/modules/notification.ts 文件中编写" />
|
|
37
|
-
<PageMain title="消息">
|
|
38
|
-
<HButton @click="messagePlus">
|
|
39
|
-
<PubinfoIcon name="i-ep-plus" />
|
|
40
|
-
1
|
|
41
|
-
</HButton>
|
|
42
|
-
<HButton ml-2 @click="messageMinus">
|
|
43
|
-
<PubinfoIcon name="i-ep-minus" />
|
|
44
|
-
1
|
|
45
|
-
</HButton>
|
|
46
|
-
</PageMain>
|
|
47
|
-
<PageMain title="待办">
|
|
48
|
-
<HButton @click="todoPlus">
|
|
49
|
-
<PubinfoIcon name="i-ep-plus" />
|
|
50
|
-
1
|
|
51
|
-
</HButton>
|
|
52
|
-
<HButton ml-2 @click="todoMinus">
|
|
53
|
-
<PubinfoIcon name="i-ep-minus" />
|
|
54
|
-
1
|
|
55
|
-
</HButton>
|
|
56
|
-
</PageMain>
|
|
57
|
-
</div>
|
|
58
|
-
</template>
|
|
@@ -1,35 +0,0 @@
|
|
|
1
|
-
import { defineStore } from 'pinia';
|
|
2
|
-
import { STORE_NAME } from '../enum';
|
|
3
|
-
|
|
4
|
-
const useNotificationStore = defineStore(
|
|
5
|
-
// 唯一ID
|
|
6
|
-
STORE_NAME.NOTIFICATION,
|
|
7
|
-
() => {
|
|
8
|
-
const message = ref(0);
|
|
9
|
-
const todo = ref(0);
|
|
10
|
-
const total = computed(() => message.value + todo.value);
|
|
11
|
-
|
|
12
|
-
function init() {
|
|
13
|
-
getUnreadMessage();
|
|
14
|
-
getUnreadTodo();
|
|
15
|
-
}
|
|
16
|
-
function getUnreadMessage() {
|
|
17
|
-
// 为方便演示,这里直接写死的未读数
|
|
18
|
-
message.value = 9;
|
|
19
|
-
}
|
|
20
|
-
function getUnreadTodo() {
|
|
21
|
-
// 为方便演示,这里直接写死的未读数
|
|
22
|
-
todo.value = 0;
|
|
23
|
-
}
|
|
24
|
-
|
|
25
|
-
return {
|
|
26
|
-
message,
|
|
27
|
-
todo,
|
|
28
|
-
total,
|
|
29
|
-
init,
|
|
30
|
-
};
|
|
31
|
-
},
|
|
32
|
-
);
|
|
33
|
-
|
|
34
|
-
export default useNotificationStore;
|
|
35
|
-
export type NotificationStore = ReturnType<typeof useNotificationStore>;
|