@duxweb/dvha-pro 1.0.47 → 1.0.49

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.
Files changed (49) hide show
  1. package/dist/cjs/component.cjs +1 -1
  2. package/dist/cjs/dvha-pro.css +1 -1
  3. package/dist/cjs/index.cjs +1 -1
  4. package/dist/cjs/langs/en-US.json.cjs +1 -1
  5. package/dist/cjs/langs/zh-CN.json.cjs +1 -1
  6. package/dist/cjs/pages/authLayout.cjs +1 -1
  7. package/dist/cjs/pages/layout/page.cjs +1 -1
  8. package/dist/cjs/pages/layout/tab.cjs +1 -1
  9. package/dist/cjs/pages/menu/avatar.cjs +1 -1
  10. package/dist/cjs/pages/menu/button.cjs +1 -1
  11. package/dist/cjs/pages/menu/dark.cjs +1 -0
  12. package/dist/cjs/pages/menu/menuApp.cjs +1 -0
  13. package/dist/cjs/pages/menu/menuMain.cjs +1 -0
  14. package/dist/cjs/pages/menu/mobile.cjs +1 -1
  15. package/dist/cjs/pages/menu/notice.cjs +1 -0
  16. package/dist/cjs/pages/pageException.cjs +1 -0
  17. package/dist/cjs/pages/pageStatus.cjs +1 -1
  18. package/dist/cjs/theme/uno.css.cjs +20 -4
  19. package/dist/esm/component.js +1 -1
  20. package/dist/esm/dvha-pro.css +1 -1
  21. package/dist/esm/index.js +115 -109
  22. package/dist/esm/langs/en-US.json.js +1 -1
  23. package/dist/esm/langs/zh-CN.json.js +2 -2
  24. package/dist/esm/pages/authLayout.js +20 -17
  25. package/dist/esm/pages/layout/page.js +1 -1
  26. package/dist/esm/pages/layout/tab.js +2 -2
  27. package/dist/esm/pages/menu/avatar.js +83 -71
  28. package/dist/esm/pages/menu/button.js +12 -13
  29. package/dist/esm/pages/menu/dark.js +54 -0
  30. package/dist/esm/pages/menu/menuApp.js +207 -0
  31. package/dist/esm/pages/menu/{main.js → menuMain.js} +46 -41
  32. package/dist/esm/pages/menu/mobile.js +16 -13
  33. package/dist/esm/pages/menu/notice.js +205 -0
  34. package/dist/esm/pages/pageException.js +45 -0
  35. package/dist/esm/pages/pageStatus.js +1 -1
  36. package/dist/esm/theme/uno.css.js +20 -4
  37. package/dist/types/index.d.ts +0 -1
  38. package/dist/types/main.d.ts +12 -0
  39. package/dist/types/pages/index.d.ts +1 -0
  40. package/dist/types/pages/menu/avatar.d.ts +18 -0
  41. package/dist/types/pages/menu/button.d.ts +9 -9
  42. package/dist/types/pages/menu/dark.d.ts +2 -0
  43. package/dist/types/pages/menu/index.d.ts +4 -1
  44. package/dist/types/pages/menu/{main.d.ts → menuApp.d.ts} +1 -1
  45. package/dist/types/pages/menu/menuMain.d.ts +22 -0
  46. package/dist/types/pages/menu/notice.d.ts +14 -0
  47. package/dist/types/pages/pageException.d.ts +1 -0
  48. package/package.json +3 -3
  49. package/dist/cjs/pages/menu/main.cjs +0 -1
@@ -0,0 +1,207 @@
1
+ import { defineComponent as z, onMounted as A, computed as n, createVNode as e, Transition as N, createTextVNode as s, h as m } from "vue";
2
+ import { useManage as w, useI18n as k, useMenu as I, DuxLogoIcon as T } from "@duxweb/dvha-core";
3
+ import { cloneDeep as u } from "lodash-es";
4
+ import { NScrollbar as d, NMenu as c, NTag as f } from "naive-ui";
5
+ import { RouterLink as V } from "vue-router";
6
+ import L from "./avatar.js";
7
+ import S from "./button.js";
8
+ import "@vueuse/core";
9
+ import "vue-command-palette";
10
+ import "@overlastic/vue";
11
+ import { DuxCard as v } from "../../components/card/card.js";
12
+ import "clsx";
13
+ import "vue-echarts";
14
+ import "vue3-ace-editor";
15
+ import "ace-builds/src-noconflict/mode-vue";
16
+ import "ace-builds/src-noconflict/mode-javascript";
17
+ import "ace-builds/src-noconflict/mode-html";
18
+ import "ace-builds/src-noconflict/mode-json";
19
+ import "ace-builds/src-noconflict/mode-json5";
20
+ import "ace-builds/src-noconflict/theme-tomorrow_night";
21
+ import "ace-builds/src-noconflict/theme-tomorrow";
22
+ import "ace-builds/src-noconflict/ext-searchbox";
23
+ import "ace-builds/src-noconflict/ext-language_tools";
24
+ import "ace-builds/src-noconflict/mode-snippets";
25
+ import "vue-cropper";
26
+ import "jinrishici";
27
+ import "vue-draggable-plus";
28
+ import "@vee-validate/i18n";
29
+ import "colorizr";
30
+ import "echarts";
31
+ import "highlight.js/lib/core";
32
+ import "highlight.js/lib/languages/bash";
33
+ import "highlight.js/lib/languages/css";
34
+ import "highlight.js/lib/languages/go";
35
+ import "highlight.js/lib/languages/java";
36
+ import "highlight.js/lib/languages/javascript";
37
+ import "highlight.js/lib/languages/json";
38
+ import "highlight.js/lib/languages/markdown";
39
+ import "highlight.js/lib/languages/php";
40
+ import "highlight.js/lib/languages/python";
41
+ import "highlight.js/lib/languages/shell";
42
+ import "highlight.js/lib/languages/sql";
43
+ import "highlight.js/lib/languages/typescript";
44
+ import "highlight.js/lib/languages/xml";
45
+ import "@ant-design/colors";
46
+ import "@unocss/preset-icons/browser";
47
+ import "@unocss/preset-typography";
48
+ import "unocss/preset-wind4";
49
+ import "@vee-validate/i18n/dist/locale/en.json";
50
+ import "@vee-validate/i18n/dist/locale/zh_CN.json";
51
+ import "vee-validate";
52
+ import "@duxweb/dvha-naiveui";
53
+ import "../page404.js";
54
+ import "short-unique-id";
55
+ import "aieditor";
56
+ import "@vue-flow/core";
57
+ import "@vue-flow/background";
58
+ /* empty css */
59
+ import "mime";
60
+ import "@iconify-json/tabler/icons.json";
61
+ import "../../components/posterEditor/elements/index.js";
62
+ import "fabric";
63
+ import "dayjs";
64
+ import "@tanstack/vue-query";
65
+ import { useUI as U } from "../../hooks/ui.js";
66
+ import B from "./dark.js";
67
+ import F from "./notice.js";
68
+ const Ye = /* @__PURE__ */ z({
69
+ name: "DuxMenuApp",
70
+ props: {
71
+ collapsed: {
72
+ type: Boolean,
73
+ default: !1
74
+ }
75
+ },
76
+ setup() {
77
+ const {
78
+ setCmdVisible: x,
79
+ setMenuCollapsed: h
80
+ } = U(), {
81
+ config: l
82
+ } = w(), {
83
+ t: g
84
+ } = k(), {
85
+ mainMenu: b,
86
+ subMenu: y,
87
+ appActive: a,
88
+ subActive: p,
89
+ isSubMenu: M
90
+ } = I({
91
+ doubleMenu: !0
92
+ });
93
+ A(() => {
94
+ h(!1);
95
+ });
96
+ const i = (o) => o.map((t) => {
97
+ const r = {
98
+ ...t,
99
+ key: t.name,
100
+ icon: t?.icon ? () => m("div", {
101
+ class: `${t.icon} size-5`
102
+ }) : void 0,
103
+ labelName: t.label,
104
+ label: () => t.path ? m(V, {
105
+ to: {
106
+ path: t.path
107
+ }
108
+ }, {
109
+ default: () => t.label
110
+ }) : t.label
111
+ };
112
+ return r.children && r.children.length > 0 && (r.children = i(r.children)), r;
113
+ }), C = n(() => i(u(b.value))), D = n(() => i(u(y.value)));
114
+ return () => e("div", {
115
+ class: "flex h-screen gap-2 p-2"
116
+ }, [e(v, {
117
+ class: "bg-primary-950 w-16 text-inverted z-1"
118
+ }, {
119
+ default: () => [e("div", {
120
+ class: "h-full flex-none flex flex-col"
121
+ }, [e("div", {
122
+ class: "py-4 px-2 hidden lg:flex justify-center items-center"
123
+ }, [e("div", {
124
+ class: "bg-white dark:bg-primary-950 rounded-full p-2 shadow group-hover:shadow-lg"
125
+ }, [l.theme?.appLogo ? e("img", {
126
+ class: "size-4",
127
+ src: l.theme?.appLogo
128
+ }, null) : e(T, {
129
+ highlight: "fill-primary",
130
+ class: "size-4"
131
+ }, null)])]), e("div", {
132
+ class: "flex-1"
133
+ }, [e(d, null, {
134
+ default: () => [e(c, {
135
+ inverted: !0,
136
+ options: C.value,
137
+ value: a.value,
138
+ collapsed: !0,
139
+ collapsedWidth: 64,
140
+ collapsedIconSize: 22,
141
+ onUpdateValue: (o) => a.value = o
142
+ }, null)]
143
+ })]), e("div", {
144
+ class: "flex-none hidden lg:flex flex-col items-center gap-2 p-2"
145
+ }, [l.notice?.status && e(F, {
146
+ collapsed: !0
147
+ }, null), e(B, null, null), e(L, {
148
+ collapsed: !0
149
+ }, null)])])]
150
+ }), e(N, {
151
+ name: "submenu-slide",
152
+ enterActiveClass: "transition-all duration-150 ease-out",
153
+ enterFromClass: "opacity-0 translate-x-[-50%]",
154
+ enterToClass: "opacity-100 translate-x-0",
155
+ leaveActiveClass: "transition-all duration-150 ease-in",
156
+ leaveFromClass: "opacity-100 translate-x-0",
157
+ leaveToClass: "opacity-0 translate-x-[-50%]"
158
+ }, {
159
+ default: () => [M.value && e(v, {
160
+ class: "w-160px overflow-hidden flex flex-col gap-2"
161
+ }, {
162
+ default: () => [e("div", {
163
+ class: "p-2 flex-none"
164
+ }, [e(S, {
165
+ collapsed: !1,
166
+ class: "rounded relative py-1.5 px-3 bg-inverted/5",
167
+ onClick: () => x(!0)
168
+ }, {
169
+ icon: () => e("div", {
170
+ class: "i-tabler:search size-4 icon-gradient"
171
+ }, null),
172
+ default: () => e("div", {
173
+ class: "text-muted text-sm"
174
+ }, [g("common.search"), e("div", {
175
+ class: "flex items-center gap-1 absolute right-2.5 top-1.3"
176
+ }, [e(f, {
177
+ size: "small",
178
+ bordered: !1,
179
+ type: "primary"
180
+ }, {
181
+ default: () => [s("⌘")]
182
+ }), e(f, {
183
+ size: "small",
184
+ bordered: !1,
185
+ type: "primary"
186
+ }, {
187
+ default: () => [s("K")]
188
+ })])])
189
+ })]), e(d, {
190
+ class: "flex-1 min-h-0"
191
+ }, {
192
+ default: () => [e(c, {
193
+ rootIndent: 20,
194
+ indent: 15,
195
+ options: D.value,
196
+ value: p.value,
197
+ collapsed: !1,
198
+ onUpdateValue: (o) => p.value = o
199
+ }, null)]
200
+ })]
201
+ })]
202
+ })]);
203
+ }
204
+ });
205
+ export {
206
+ Ye as DuxMenuApp
207
+ };
@@ -1,12 +1,16 @@
1
- import { defineComponent as c, createVNode as o, createTextVNode as l } from "vue";
2
- import { useManage as f, useI18n as v, DuxLogoIcon as x } from "@duxweb/dvha-core";
1
+ import { defineComponent as c, createVNode as e, createTextVNode as l } from "vue";
2
+ import { useManage as f, useI18n as v, DuxLogoIcon as h } from "@duxweb/dvha-core";
3
3
  import { useNaiveMenu as g } from "@duxweb/dvha-naiveui";
4
- import { NTag as p, NScrollbar as h, NMenu as b } from "naive-ui";
4
+ import { NTag as p, NScrollbar as x, NMenu as b } from "naive-ui";
5
+ import y from "./avatar.js";
6
+ import m from "./button.js";
7
+ import "@vueuse/core";
8
+ import "lodash-es";
9
+ import "vue-command-palette";
5
10
  import "vue-router";
6
11
  import "@overlastic/vue";
7
12
  import "clsx";
8
13
  import "vue-echarts";
9
- import "@vueuse/core";
10
14
  import "vue3-ace-editor";
11
15
  import "ace-builds/src-noconflict/mode-vue";
12
16
  import "ace-builds/src-noconflict/mode-javascript";
@@ -20,7 +24,6 @@ import "ace-builds/src-noconflict/ext-language_tools";
20
24
  import "ace-builds/src-noconflict/mode-snippets";
21
25
  import "vue-cropper";
22
26
  import "jinrishici";
23
- import "lodash-es";
24
27
  import "vue-draggable-plus";
25
28
  import "@vee-validate/i18n";
26
29
  import "colorizr";
@@ -46,9 +49,6 @@ import "unocss/preset-wind4";
46
49
  import "@vee-validate/i18n/dist/locale/en.json";
47
50
  import "@vee-validate/i18n/dist/locale/zh_CN.json";
48
51
  import "vee-validate";
49
- import M from "./avatar.js";
50
- import m from "./button.js";
51
- import "vue-command-palette";
52
52
  import "../page404.js";
53
53
  import "short-unique-id";
54
54
  import "aieditor";
@@ -61,93 +61,98 @@ import "../../components/posterEditor/elements/index.js";
61
61
  import "fabric";
62
62
  import "dayjs";
63
63
  import "@tanstack/vue-query";
64
- import { useUI as y } from "../../hooks/ui.js";
65
- const To = /* @__PURE__ */ c({
64
+ import { useUI as M } from "../../hooks/ui.js";
65
+ const Se = /* @__PURE__ */ c({
66
66
  name: "DuxMenuMain",
67
67
  props: {
68
68
  collapsed: {
69
69
  type: Boolean,
70
70
  default: !1
71
+ },
72
+ mobile: {
73
+ type: Boolean,
74
+ default: !1
71
75
  }
72
76
  },
73
- setup(e) {
77
+ setup(t) {
74
78
  const {
75
79
  options: a,
76
80
  active: s
77
81
  } = g({}), {
78
- menuCollapsed: t,
82
+ menuCollapsed: o,
79
83
  setCmdVisible: d,
80
84
  menuMobileCollapsed: r,
81
85
  setMenuCollapsed: n
82
- } = y(), {
86
+ } = M(), {
83
87
  config: i
84
88
  } = f(), {
85
89
  t: u
86
90
  } = v();
87
- return () => o("div", {
88
- class: "flex flex-col h-screen px-1"
89
- }, [o("div", {
91
+ return () => e("div", {
92
+ class: ["flex flex-col h-screen px-1"]
93
+ }, [e("div", {
90
94
  class: "h-13 px-2 hidden lg:flex justify-center items-center"
91
- }, [o(m, {
92
- onClick: () => n(!t.value),
93
- collapsed: e.collapsed
95
+ }, [e(m, {
96
+ onClick: () => n(!o.value),
97
+ collapsed: t.collapsed
94
98
  }, {
95
- icon: () => o("div", {
99
+ icon: () => e("div", {
96
100
  class: "bg-white dark:bg-primary-950 rounded-full p-2 shadow group-hover:shadow-lg"
97
- }, [i.theme?.appLogo ? o("img", {
101
+ }, [i.theme?.appLogo ? e("img", {
98
102
  class: "size-4",
99
103
  src: i.theme?.appLogo
100
- }, null) : o(x, {
104
+ }, null) : e(h, {
101
105
  highlight: "fill-primary",
102
106
  class: "size-4"
103
107
  }, null)]),
104
- default: () => o("div", null, [i.title])
105
- })]), o("div", {
108
+ default: () => e("div", null, [i.title])
109
+ })]), e("div", {
106
110
  class: "px-2 py-1 hidden lg:block"
107
- }, [o(m, {
108
- collapsed: e.collapsed,
109
- inverted: !0,
110
- class: "relative py-1.5 px-3",
111
+ }, [e(m, {
112
+ collapsed: t.collapsed,
113
+ class: "relative py-1.5 px-3 rounded-full bg-inverted/5 hover:bg-default hover:shadow-sm transition-all",
111
114
  onClick: () => d(!0)
112
115
  }, {
113
- icon: () => o("div", {
116
+ icon: () => e("div", {
114
117
  class: "i-tabler:search size-4 icon-gradient"
115
118
  }, null),
116
- default: () => o("div", {
119
+ default: () => e("div", {
117
120
  class: "text-muted text-sm"
118
- }, [u("common.search"), !t.value && o("div", {
121
+ }, [u("common.search"), !o.value && e("div", {
119
122
  class: "flex items-center gap-1 absolute right-2.5 top-1.3"
120
- }, [o(p, {
123
+ }, [e(p, {
121
124
  size: "small",
122
125
  bordered: !1,
123
126
  type: "primary"
124
127
  }, {
125
128
  default: () => [l("⌘")]
126
- }), o(p, {
129
+ }), e(p, {
127
130
  size: "small",
128
131
  bordered: !1,
129
132
  type: "primary"
130
133
  }, {
131
134
  default: () => [l("K")]
132
135
  })])])
133
- })]), o("div", {
136
+ })]), e("div", {
134
137
  class: ["flex-1 min-h-0", r.value ? "border-t border-muted" : ""]
135
- }, [o(h, null, {
136
- default: () => [o(b, {
138
+ }, [e(x, null, {
139
+ default: () => [e(b, {
140
+ class: "app-menu",
137
141
  options: a.value,
138
142
  value: s.value,
139
- collapsed: t.value && !r.value,
143
+ collapsed: o.value && !r.value,
140
144
  indent: 20,
141
145
  collapsedWidth: 60,
142
146
  collapsedIconSize: 20
143
147
  }, null)]
144
- })]), o("div", {
148
+ })]), e("div", {
145
149
  class: "flex-none hidden lg:flex flex-col items-center gap-2 p-2 border-t border-muted/50"
146
- }, [o(M, {
147
- collapsed: e.collapsed
150
+ }, [e(y, {
151
+ btnClass: o.value ? "relative rounded-md hover:bg-default hover:shadow-sm transition-all" : "",
152
+ collapsed: t.collapsed
148
153
  }, null)])]);
149
154
  }
150
155
  });
151
156
  export {
152
- To as DuxMenuMain
157
+ Se as DuxMenuMain
153
158
  };
@@ -1,5 +1,5 @@
1
- import { defineComponent as p, createVNode as r } from "vue";
2
- import { NDrawer as m } from "naive-ui";
1
+ import { defineComponent as p, createVNode as o } from "vue";
2
+ import { NDrawer as i } from "naive-ui";
3
3
  import "@duxweb/dvha-core";
4
4
  import "vue-router";
5
5
  import "@overlastic/vue";
@@ -46,7 +46,7 @@ import "@vee-validate/i18n/dist/locale/en.json";
46
46
  import "@vee-validate/i18n/dist/locale/zh_CN.json";
47
47
  import "vee-validate";
48
48
  import "vue-command-palette";
49
- import { DuxMenuMain as i } from "./main.js";
49
+ import { DuxMenuMain as m } from "./menuMain.js";
50
50
  import "@duxweb/dvha-naiveui";
51
51
  import "../page404.js";
52
52
  import "short-unique-id";
@@ -61,25 +61,28 @@ import "fabric";
61
61
  import "dayjs";
62
62
  import "@tanstack/vue-query";
63
63
  import { useUI as e } from "../../hooks/ui.js";
64
- const Do = /* @__PURE__ */ p({
64
+ const wo = /* @__PURE__ */ p({
65
65
  name: "DuxMobileMenu",
66
66
  props: {},
67
67
  setup(l) {
68
68
  const {
69
- menuMobileCollapsed: o
69
+ menuMobileCollapsed: t
70
70
  } = e();
71
- return () => r(m, {
72
- show: o.value,
73
- onUpdateShow: (t) => o.value = t,
74
- width: 250,
71
+ return () => o(i, {
72
+ show: t.value,
73
+ onUpdateShow: (r) => t.value = r,
74
+ width: 200,
75
75
  placement: "left"
76
76
  }, {
77
- default: () => [r(i, {
78
- collapsed: !1
79
- }, null)]
77
+ default: () => [o("div", {
78
+ class: ["flex-none transition-all"]
79
+ }, [o(m, {
80
+ collapsed: !1,
81
+ mobile: !0
82
+ }, null)])]
80
83
  });
81
84
  }
82
85
  });
83
86
  export {
84
- Do as DuxMobileMenu
87
+ wo as DuxMobileMenu
85
88
  };
@@ -0,0 +1,205 @@
1
+ import { defineComponent as b, computed as c, ref as w, createVNode as t, Fragment as k, isVNode as C } from "vue";
2
+ import { useI18n as S, useManage as F, useList as _, useCustomMutation as z } from "@duxweb/dvha-core";
3
+ import { NPopover as B, NButton as d, NSpin as M, NTooltip as D, NBadge as R } from "naive-ui";
4
+ import { useRouter as j } from "vue-router";
5
+ import { DuxCard as A } from "../../components/card/card.js";
6
+ import "clsx";
7
+ import "vue-echarts";
8
+ import "@overlastic/vue";
9
+ import "dayjs";
10
+ import "mime";
11
+ import "lodash-es";
12
+ import "@tanstack/vue-query";
13
+ import "@duxweb/dvha-naiveui";
14
+ import "@vueuse/core";
15
+ import "pinia";
16
+ import "vue3-ace-editor";
17
+ import "ace-builds/src-noconflict/mode-vue";
18
+ import "ace-builds/src-noconflict/mode-javascript";
19
+ import "ace-builds/src-noconflict/mode-html";
20
+ import "ace-builds/src-noconflict/mode-json";
21
+ import "ace-builds/src-noconflict/mode-json5";
22
+ import "ace-builds/src-noconflict/theme-tomorrow_night";
23
+ import "ace-builds/src-noconflict/theme-tomorrow";
24
+ import "ace-builds/src-noconflict/ext-searchbox";
25
+ import "ace-builds/src-noconflict/ext-language_tools";
26
+ import "ace-builds/src-noconflict/mode-snippets";
27
+ import "vue-cropper";
28
+ import "jinrishici";
29
+ import "vue-draggable-plus";
30
+ import { DuxBlockEmpty as L } from "../../components/status/blockEmpty.js";
31
+ import "@vee-validate/i18n";
32
+ import "colorizr";
33
+ import "echarts";
34
+ import "highlight.js/lib/core";
35
+ import "highlight.js/lib/languages/bash";
36
+ import "highlight.js/lib/languages/css";
37
+ import "highlight.js/lib/languages/go";
38
+ import "highlight.js/lib/languages/java";
39
+ import "highlight.js/lib/languages/javascript";
40
+ import "highlight.js/lib/languages/json";
41
+ import "highlight.js/lib/languages/markdown";
42
+ import "highlight.js/lib/languages/php";
43
+ import "highlight.js/lib/languages/python";
44
+ import "highlight.js/lib/languages/shell";
45
+ import "highlight.js/lib/languages/sql";
46
+ import "highlight.js/lib/languages/typescript";
47
+ import "highlight.js/lib/languages/xml";
48
+ import "@ant-design/colors";
49
+ import "@unocss/preset-icons/browser";
50
+ import "@unocss/preset-typography";
51
+ import "unocss/preset-wind4";
52
+ import "@vee-validate/i18n/dist/locale/en.json";
53
+ import "@vee-validate/i18n/dist/locale/zh_CN.json";
54
+ import "vee-validate";
55
+ import "vue-command-palette";
56
+ import "../page404.js";
57
+ import "short-unique-id";
58
+ import "aieditor";
59
+ import "@vue-flow/core";
60
+ import "@vue-flow/background";
61
+ /* empty css */
62
+ import "@iconify-json/tabler/icons.json";
63
+ import "../../components/posterEditor/elements/index.js";
64
+ import "fabric";
65
+ function O(o) {
66
+ return typeof o == "function" || Object.prototype.toString.call(o) === "[object Object]" && !C(o);
67
+ }
68
+ const Ht = /* @__PURE__ */ b({
69
+ name: "DuxMenuNotice",
70
+ props: {
71
+ collapsed: {
72
+ type: Boolean,
73
+ default: !1
74
+ }
75
+ },
76
+ setup() {
77
+ const {
78
+ t: o
79
+ } = S(), {
80
+ config: r
81
+ } = F(), a = j(), {
82
+ data: u,
83
+ isLoading: f,
84
+ refetch: v
85
+ } = _({
86
+ path: r.notice?.path || "notice",
87
+ pagination: {
88
+ page: 1,
89
+ pageSize: 10
90
+ }
91
+ }), {
92
+ mutate: n
93
+ } = z({
94
+ path: `${r.notice?.path || "notice"}`,
95
+ method: "POST",
96
+ onSuccess: () => {
97
+ v();
98
+ }
99
+ }), l = c(() => u.value?.data || []), p = c(() => l.value.some((e) => !e[r.notice?.readField || "read"])), i = w(!1), h = (e) => {
100
+ n({
101
+ payload: {
102
+ type: "all_read",
103
+ id: e.id
104
+ }
105
+ }), i.value = !1;
106
+ }, g = () => {
107
+ n({
108
+ payload: {
109
+ type: "all_read"
110
+ }
111
+ }), i.value = !1;
112
+ };
113
+ return () => t(B, {
114
+ trigger: "click",
115
+ arrowClass: "ml-2.5",
116
+ placement: "bottom-start",
117
+ style: "padding: 0",
118
+ width: 260,
119
+ show: i.value,
120
+ onClickoutside: () => i.value = !1
121
+ }, {
122
+ trigger: () => t(D, {
123
+ trigger: "hover",
124
+ placement: "right"
125
+ }, {
126
+ default: () => o("components.menu.notice", "Notice"),
127
+ trigger: () => t(d, {
128
+ onClick: () => i.value = !0,
129
+ quaternary: !0
130
+ }, {
131
+ icon: () => t(R, {
132
+ dot: p.value,
133
+ offset: [-8, 8]
134
+ }, {
135
+ default: () => [t("div", {
136
+ class: "transition-all text-muted p-2 hover:text-white"
137
+ }, [t("div", {
138
+ class: "i-tabler:bell size-5"
139
+ }, null)])]
140
+ })
141
+ })
142
+ }),
143
+ default: () => t(A, {
144
+ headerBordered: !0,
145
+ headerClass: "text-sm",
146
+ headerSize: "small",
147
+ contentSize: "none",
148
+ title: o("components.menu.notice", "Notice")
149
+ }, {
150
+ default: () => t(k, null, [t(M, {
151
+ show: f.value
152
+ }, {
153
+ default: () => [l.value.length > 0 ? t("div", {
154
+ class: "p-2"
155
+ }, [l.value?.map((e, x) => {
156
+ const m = e[r.notice?.action?.url || "action_url"], s = r.notice?.readField || "read", y = r.notice?.descField || "desc", N = r.notice?.titleField || "title";
157
+ return t("div", {
158
+ key: x,
159
+ class: "flex flex-col p-2 hover:bg-elevated rounded cursor-pointer",
160
+ onClick: () => {
161
+ m?.startsWith("http") ? window.open(m, "_blank") : a.push(r.notice?.path || "notice"), e[s] = !0, h(e);
162
+ }
163
+ }, [t("div", {
164
+ class: "flex items-center gap-2"
165
+ }, [e[s] ? t("div", {
166
+ class: "w-2 h-2 bg-elevated rounded-full"
167
+ }, null) : t("div", {
168
+ class: "w-2 h-2 bg-error rounded-full"
169
+ }, null), t("div", {
170
+ class: "flex-1 min-w-0 text-sm font-medium truncate"
171
+ }, [e[N]])]), t("div", {
172
+ class: "pl-4 text-xs text-muted line-clamp-2"
173
+ }, [e[y]])]);
174
+ })]) : t("div", {
175
+ class: "p-4"
176
+ }, [t(L, {
177
+ text: o("components.menu.noNotice", "No notices"),
178
+ simple: !0
179
+ }, null)])]
180
+ }), t("div", {
181
+ class: "border-t border-muted p-2"
182
+ }, [t("div", {
183
+ class: "text-center text-sm text-primary hover:text-primary-hover cursor-pointer py-1",
184
+ onClick: () => {
185
+ a.push(r.notice?.path || "notice"), i.value = !1;
186
+ }
187
+ }, [o("components.menu.viewAllNotices", "View all notices")])])]),
188
+ headerExtra: () => {
189
+ let e;
190
+ return t(d, {
191
+ size: "tiny",
192
+ quaternary: !0,
193
+ disabled: !p.value,
194
+ onClick: g
195
+ }, O(e = o("components.menu.markAllRead", "Mark all read")) ? e : {
196
+ default: () => [e]
197
+ });
198
+ }
199
+ })
200
+ });
201
+ }
202
+ });
203
+ export {
204
+ Ht as default
205
+ };
@@ -0,0 +1,45 @@
1
+ import { defineComponent as i, createVNode as e, resolveComponent as p, isVNode as s } from "vue";
2
+ import { useI18n as l } from "@duxweb/dvha-core";
3
+ import { NButton as a } from "naive-ui";
4
+ import { useRoute as f, useRouter as m } from "vue-router";
5
+ import { DuxPageStatus as d } from "./pageStatus.js";
6
+ function x(t) {
7
+ return typeof t == "function" || Object.prototype.toString.call(t) === "[object Object]" && !s(t);
8
+ }
9
+ const j = /* @__PURE__ */ i({
10
+ name: "DuxPageException",
11
+ setup(t) {
12
+ const n = f(), u = m(), {
13
+ t: o
14
+ } = l();
15
+ function c() {
16
+ u.push({
17
+ path: n.path,
18
+ query: {
19
+ ...n.query,
20
+ t: Date.now()
21
+ }
22
+ });
23
+ }
24
+ return () => e(d, {
25
+ title: o("pages.exception.title"),
26
+ desc: o("pages.exception.desc")
27
+ }, {
28
+ default: () => e("div", null, [e(p("dux-draw-error"), null, null)]),
29
+ action: () => {
30
+ let r;
31
+ return e(a, {
32
+ onClick: c,
33
+ renderIcon: () => e("div", {
34
+ class: "n-icon i-tabler:refresh"
35
+ }, null)
36
+ }, x(r = o("components.button.refresh")) ? r : {
37
+ default: () => [r]
38
+ });
39
+ }
40
+ });
41
+ }
42
+ });
43
+ export {
44
+ j as DuxPageException
45
+ };