cosey 0.1.1 → 0.1.4
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/components/audio-card/audio-card.vue.js +1 -1
- package/components/audio-card/style/index.d.ts +1 -1
- package/components/audio-viewer/style/index.d.ts +1 -1
- package/components/close/close.vue.js +1 -1
- package/components/close/style/index.d.ts +1 -1
- package/components/col/style/index.d.ts +1 -1
- package/components/col/style/index.js +1 -1
- package/components/components.d.ts +98 -44
- package/components/config-provider/config-provider.js +1 -3
- package/components/config-provider/config-provider.vue.d.ts +2 -7
- package/components/config-provider/config-provider.vue.js +8 -4
- package/components/config-provider/index.d.ts +1 -1
- package/components/config-provider/override-element-plus.d.ts +3 -2
- package/components/config-provider/override-element-plus.js +2 -2
- package/components/container/container.d.ts +0 -1
- package/components/container/container.vue.js +0 -4
- package/components/container/style/index.d.ts +1 -1
- package/components/context-menu/content.vue.js +1 -1
- package/components/context-menu/context-menu.vue.js +2 -2
- package/components/context-menu/style/index.d.ts +1 -1
- package/components/copy/copy.d.ts +0 -2
- package/components/copy/copy.vue.d.ts +1 -7
- package/components/copy/copy.vue.js +1 -2
- package/components/copy/index.d.ts +3 -19
- package/components/copy/style/index.d.ts +1 -1
- package/components/cssinjs/parser.js +8 -25
- package/components/dnd-sort/dnd-sort-item.vue.js +3 -4
- package/components/dnd-sort/dnd-sort.vue.js +1 -2
- package/components/dnd-sort/index.d.ts +1 -1
- package/components/dnd-sort/style/index.d.ts +1 -1
- package/components/dnd-sort/style/index.js +1 -0
- package/components/editor/components/button-group.vue.d.ts +2 -7
- package/components/editor/components/button.vue.d.ts +2 -7
- package/components/editor/components/color-picker/color-picker.style.d.ts +1 -1
- package/components/editor/components/color-picker/color-picker.vue.d.ts +2 -43
- package/components/editor/components/color-picker/color-picker.vue.js +14 -11
- package/components/editor/components/list/list.style.d.ts +1 -1
- package/components/editor/components/picker/picker.style.d.ts +1 -1
- package/components/editor/components/picker/picker.vue.d.ts +2 -15
- package/components/editor/components/resize/resize.js +4 -4
- package/components/editor/components/resize/resize.style.d.ts +1 -1
- package/components/editor/components/resize/resize.style.js +9 -32
- package/components/editor/components/resize/resize.vue.js +21 -14
- package/components/editor/components/select-button.vue.d.ts +2 -9
- package/components/editor/components/select-button.vue.js +1 -1
- package/components/editor/components/split-button.vue.d.ts +2 -19
- package/components/editor/components/split-button.vue.js +1 -1
- package/components/editor/components/table-toolbar/table-toolbar.style.d.ts +1 -1
- package/components/editor/components/table-toolbar/table-toolbar.vue.js +9 -9
- package/components/editor/components/toolbar/formats/align.vue.js +4 -4
- package/components/editor/components/toolbar/formats/blockquote.vue.js +1 -1
- package/components/editor/components/toolbar/formats/bold.vue.js +1 -1
- package/components/editor/components/toolbar/formats/clean.vue.js +1 -1
- package/components/editor/components/toolbar/formats/code-block.vue.js +1 -1
- package/components/editor/components/toolbar/formats/code.vue.js +1 -1
- package/components/editor/components/toolbar/formats/formula.vue.js +4 -3
- package/components/editor/components/toolbar/formats/image.vue.js +1 -1
- package/components/editor/components/toolbar/formats/indent.vue.js +2 -2
- package/components/editor/components/toolbar/formats/italic.vue.js +1 -1
- package/components/editor/components/toolbar/formats/link.vue.js +15 -13
- package/components/editor/components/toolbar/formats/list.vue.js +3 -3
- package/components/editor/components/toolbar/formats/script.vue.js +2 -2
- package/components/editor/components/toolbar/formats/size-delta.vue.js +2 -2
- package/components/editor/components/toolbar/formats/strike.vue.js +1 -1
- package/components/editor/components/toolbar/formats/table.style.d.ts +1 -1
- package/components/editor/components/toolbar/formats/table.vue.js +1 -1
- package/components/editor/components/toolbar/formats/underline.vue.js +1 -1
- package/components/editor/components/toolbar/formats/video.vue.js +1 -1
- package/components/editor/components/toolbar/toolbar.d.ts +1 -2
- package/components/editor/components/toolbar/toolbar.js +17 -21
- package/components/editor/components/toolbar/toolbarContext.js +1 -3
- package/components/editor/editor.d.ts +0 -2
- package/components/editor/editor.vue.js +1 -11
- package/components/editor/formats/image.d.ts +13 -0
- package/components/editor/formats/image.js +46 -0
- package/components/editor/formats/indent.d.ts +2 -0
- package/components/editor/formats/indent.js +12 -7
- package/components/editor/formats/link.js +1 -5
- package/components/editor/formats/list.d.ts +0 -4
- package/components/editor/formats/list.js +10 -5
- package/components/editor/formats/video.js +6 -9
- package/components/editor/modules/custom-list.js +1 -6
- package/components/editor/modules/image-uploader/formats/image-loading.style.d.ts +1 -1
- package/components/editor/modules/image-uploader/formats/image-loading.style.js +4 -4
- package/components/editor/modules/image-uploader/image-uploader.js +1 -3
- package/components/editor/quill.js +7 -4
- package/components/editor/quillContext.js +1 -3
- package/components/editor/style/hljs.d.ts +1 -1
- package/components/editor/style/index.d.ts +1 -1
- package/components/editor/style/index.js +1 -5
- package/components/field/components/checkbox-group/panel.vue.d.ts +2 -20
- package/components/field/components/checkbox-group/panel.vue.js +2 -2
- package/components/field/components/tree-select/tree-select.d.ts +1 -2
- package/components/field/components/tree-select/tree-select.js +69 -0
- package/components/file-card/file-card.vue.js +1 -1
- package/components/file-card/style/index.d.ts +1 -1
- package/components/form/form-item.vue.js +1 -1
- package/components/form/style/index.d.ts +1 -1
- package/components/form/useFormItemWidth.js +1 -1
- package/components/form/useFormTemplate.js +2 -10
- package/components/form-dialog/form-dialog.vue.d.ts +0 -1
- package/components/form-dialog/form-dialog.vue.js +1 -1
- package/components/form-dialog/index.d.ts +0 -3
- package/components/form-group/form-group.vue.js +1 -1
- package/components/form-list/form-list.js +1 -6
- package/components/form-list/form-list.vue.js +2 -2
- package/components/form-list/style/index.d.ts +1 -1
- package/components/form-query/form-query.vue.js +5 -5
- package/components/form-query/style/index.d.ts +1 -1
- package/components/highlight/highlight.d.ts +1 -1
- package/components/highlight/highlight.vue.js +11 -4
- package/components/highlight/style/index.d.ts +1 -1
- package/components/highlight/style/index.js +15 -5
- package/components/horizontal-tree/horizontal-tree.vue.js +16 -12
- package/components/horizontal-tree/style/index.d.ts +1 -1
- package/components/icon/style/index.d.ts +1 -1
- package/components/iconify-icon/iconify-icon.d.ts +3 -0
- package/components/iconify-icon/iconify-icon.js +9 -0
- package/components/iconify-icon/iconify-icon.vue.js +2 -5
- package/components/iconify-icon/index.js +1 -0
- package/components/image-card/style/index.d.ts +1 -1
- package/components/index.js +4 -2
- package/components/long-text/style/index.d.ts +1 -1
- package/components/mask/style/index.d.ts +1 -1
- package/components/media-card-group/media-card-group.vue.js +4 -3
- package/components/media-card-group/style/index.d.ts +1 -1
- package/components/panel/style/index.d.ts +1 -1
- package/components/row/style/index.d.ts +1 -1
- package/components/scroll-view/scroll-view.vue.js +1 -2
- package/components/scroll-view/style/index.d.ts +1 -1
- package/components/snug-menu/snug-menu.vue.js +1 -2
- package/components/snug-menu/style/index.d.ts +1 -1
- package/components/style/animation.d.ts +5 -0
- package/components/style/animation.js +33 -0
- package/components/style/index.d.ts +1 -1
- package/components/style/index.js +2 -2
- package/components/style/mixins.d.ts +2 -0
- package/components/style/mixins.js +10 -1
- package/components/table/index.d.ts +0 -8
- package/components/table/style/index.d.ts +1 -1
- package/components/table/style/index.js +2 -2
- package/components/table/table-column/renderer.js +22 -18
- package/components/table/table-column/style/index.d.ts +1 -1
- package/components/table/table-column/table-column.vue.d.ts +3 -3
- package/components/table/table-column-editor/item.vue.js +5 -8
- package/components/table/table-column-editor/style/index.d.ts +1 -1
- package/components/table/table-column-editor/style/index.js +1 -0
- package/components/table/table-column-editor/table-column-editor.vue.d.ts +2 -246
- package/components/table/table-column-editor/table-column-editor.vue.js +9 -9
- package/components/table/table-export/style/index.d.ts +1 -1
- package/components/table/table-export/table-export.vue.js +2 -2
- package/components/table/table-query/table-query.d.ts +0 -4
- package/components/table/table-query/table-query.js +0 -4
- package/components/table/table-query/table-query.vue.d.ts +0 -9
- package/components/table/table-query/table-query.vue.js +14 -12
- package/components/table/table.js +1 -3
- package/components/table/table.vue.js +22 -24
- package/components/table/useTable.js +1 -4
- package/components/table/utils.js +1 -3
- package/components/table-action/item.vue.js +5 -5
- package/components/table-action/style/index.d.ts +1 -1
- package/components/table-action/table-action.vue.js +4 -3
- package/components/theme/StyleContext.js +1 -3
- package/components/theme/createCacheToken.js +1 -4
- package/components/theme/getGlobalStyleHook.d.ts +2 -3
- package/components/theme/getGlobalStyleHook.js +5 -13
- package/components/theme/getOverrideStyleHook.d.ts +8 -0
- package/components/theme/getOverrideStyleHook.js +39 -0
- package/components/theme/getSimpleStyleHook.d.ts +2 -2
- package/components/theme/getSimpleStyleHook.js +4 -11
- package/components/theme/getStyleHook.d.ts +2 -2
- package/components/theme/getStyleHook.js +4 -11
- package/components/theme/index.d.ts +2 -1
- package/components/theme/index.js +1 -0
- package/components/theme/interface/index.d.ts +1 -1
- package/components/theme/theme-context.d.ts +11 -2
- package/components/theme/theme-context.js +36 -6
- package/components/theme/themes/shared/genColorMapToken.js +1 -4
- package/components/theme/useStyleRegister.d.ts +1 -7
- package/components/theme/useStyleRegister.js +3 -6
- package/components/theme/util/alias.js +4 -16
- package/components/theme/util/getAlphaColor.js +1 -6
- package/components/theme/util/normalizeStyle.js +1 -1
- package/components/theme/util/statistic.js +4 -1
- package/components/theme/util/useToken.d.ts +4 -4
- package/components/theme/util/useToken.js +7 -10
- package/components/toggle/toggle.vue.js +1 -1
- package/components/transition/style/index.d.ts +1 -1
- package/components/transition/transition.vue.js +1 -2
- package/components/transition-group/index.d.ts +3 -3
- package/components/transition-group/style/index.d.ts +1 -1
- package/components/transition-group/transition-group.vue.d.ts +1 -1
- package/components/upload/index.d.ts +0 -3
- package/components/upload/style/index.d.ts +1 -1
- package/components/upload/upload-item.vue.js +8 -8
- package/components/upload/upload.d.ts +0 -2
- package/components/upload/upload.js +0 -1
- package/components/upload/upload.vue.d.ts +0 -1
- package/components/upload/upload.vue.js +1 -5
- package/components/video-card/style/index.d.ts +1 -1
- package/components/video-card/video-card.vue.js +1 -1
- package/components/video-viewer/style/index.d.ts +1 -1
- package/config/http.d.ts +1 -1
- package/config/http.js +1 -1
- package/config/index.d.ts +23 -22
- package/config/index.js +2 -7
- package/config/layout.d.ts +36 -0
- package/config/layout.js +37 -1
- package/config/nprogress.style.d.ts +2 -0
- package/config/nprogress.style.js +51 -0
- package/config/root-config-provider.vue.d.ts +2 -20
- package/config/root-config-provider.vue.js +2 -0
- package/hooks/useColorScheme.js +5 -9
- package/hooks/useEcharts.js +2 -4
- package/hooks/useFetch.d.ts +1 -1
- package/hooks/useFetch.js +1 -7
- package/hooks/useFullPage.js +7 -9
- package/hooks/useLocale.js +1 -3
- package/hooks/useLockscreenObserver.js +1 -1
- package/hooks/usePersist.js +1 -3
- package/hooks/useTreeCheck.js +13 -26
- package/hooks/useUpsert.d.ts +15 -16
- package/hooks/useUpsert.js +3 -3
- package/index.d.ts +1 -0
- package/index.js +5 -4
- package/layout/index.js +2 -2
- package/layout/layout-aside/layout-aside.vue.js +2 -1
- package/layout/layout-aside/style/index.d.ts +1 -1
- package/layout/layout-auth/style/index.d.ts +1 -1
- package/layout/layout-base/layout-base.vue.js +9 -9
- package/layout/layout-base/style/index.d.ts +1 -1
- package/layout/layout-brand/style/index.d.ts +1 -1
- package/layout/layout-change-password/layout-change-password.vue.js +8 -8
- package/layout/layout-change-password/style/index.d.ts +1 -1
- package/layout/layout-change-password/style/index.js +1 -1
- package/layout/layout-color-scheme/layout-color-scheme.vue.js +8 -14
- package/layout/layout-color-scheme/style/index.d.ts +2 -5
- package/layout/layout-color-scheme/style/index.js +26 -44
- package/layout/layout-content/layout-content.vue.d.ts +2 -13
- package/layout/layout-content/style/index.d.ts +1 -1
- package/layout/layout-exception/style/index.d.ts +1 -1
- package/layout/layout-forbidden/layout-forbidden.vue.js +2 -2
- package/layout/layout-header/layout-header.vue.d.ts +2 -14
- package/layout/layout-header/style/index.d.ts +1 -1
- package/layout/layout-iframe/style/index.d.ts +1 -1
- package/layout/layout-internal-server-error/layout-internal-server-error.vue.js +2 -2
- package/layout/layout-login/layout-login.vue.js +5 -5
- package/layout/layout-login/style/index.d.ts +1 -1
- package/layout/layout-login/style/index.js +1 -1
- package/layout/layout-main/style/index.d.ts +1 -1
- package/layout/layout-mask/style/index.d.ts +1 -1
- package/layout/layout-mask/style/index.js +1 -1
- package/layout/layout-menu/layout-menu.vue.js +5 -0
- package/layout/layout-menu/style/index.d.ts +1 -1
- package/layout/layout-not-found/layout-not-found.vue.js +2 -2
- package/layout/layout-search/layout-search.vue.js +37 -34
- package/layout/layout-search/style/index.d.ts +1 -1
- package/layout/layout-sidebar/layout-sidebar.vue.d.ts +2 -15
- package/layout/layout-sidebar/style/index.d.ts +1 -1
- package/layout/layout-sidebar/style/index.js +1 -1
- package/layout/layout-snug-aside/style/index.d.ts +1 -1
- package/layout/layout-switch-effect/layout-switch-effect.vue.d.ts +2 -7
- package/layout/layout-switch-effect/style/index.d.ts +1 -1
- package/layout/layout-tabbar/layout-tabbar.vue.js +8 -3
- package/layout/layout-tabbar/reload.vue.js +1 -1
- package/layout/layout-tabbar/style/index.d.ts +1 -1
- package/layout/layout-tabbar/style/index.js +6 -2
- package/layout/layout-toggle/layout-toggle.vue.js +1 -1
- package/layout/layout-top-snug-menu/layout-top-snug-menu.vue.js +4 -3
- package/layout/layout-topbar/layout-topbar.vue.d.ts +2 -1217
- package/layout/layout-topbar/style/index.d.ts +1 -1
- package/layout/layout-user-menu/index.d.ts +1 -0
- package/layout/layout-user-menu/index.js +1 -0
- package/layout/{layout-user/layout-user.vue.js → layout-user-menu/layout-user-menu.vue.js} +18 -13
- package/layout/{layout-user → layout-user-menu}/style/index.d.ts +1 -1
- package/layout/{layout-user → layout-user-menu}/style/index.js +9 -5
- package/layout/layout.d.ts +1 -1
- package/layout/layout.js +1 -1
- package/layout/merged/index.d.ts +1 -1
- package/layout/merged/index.js +1 -1
- package/layout/merged/{layout-user.js → layout-user-menu.js} +1 -1
- package/layout/utils.js +1 -4
- package/package.json +16 -6
- package/request/useRequest.js +1 -1
- package/router/guard/auth.js +2 -5
- package/router/guard/index.js +2 -2
- package/router/guard/pageTitle.d.ts +2 -0
- package/router/guard/pageTitle.js +11 -0
- package/router/guard/progress.js +11 -1
- package/router/index.d.ts +22 -0
- package/router/index.js +1 -1
- package/router/routes/static/auth.js +5 -6
- package/router/routes/static/exception.js +3 -3
- package/router/utils.js +11 -3
- package/store/layout.d.ts +4 -10
- package/store/layout.js +19 -31
- package/store/user.d.ts +4 -4
- package/store/user.js +2 -1
- package/utils/array.js +3 -0
- package/utils/dynamicCSS.d.ts +3 -2
- package/utils/dynamicCSS.js +12 -1
- package/utils/excel/index.js +1 -3
- package/utils/excel/utils.js +1 -5
- package/utils/file.js +1 -3
- package/utils/index.js +1 -1
- package/utils/object.js +1 -3
- package/utils/tree.js +2 -11
- package/utils/vue.js +1 -1
- package/components/global.d.js +0 -1
- package/components/style/motion/index.d.ts +0 -1
- package/components/style/motion/index.js +0 -1
- package/components/style/motion/loading.d.ts +0 -3
- package/components/style/motion/loading.js +0 -23
- package/layout/layout-user/index.d.ts +0 -1
- package/layout/layout-user/index.js +0 -1
- package/router/guard/popup.d.ts +0 -2
- package/router/guard/popup.js +0 -6
- package/types/vue-router.d.js +0 -1
- package/types/vue.d.js +0 -1
- /package/layout/{layout-user/layout-user.vue.d.ts → layout-user-menu/layout-user-menu.vue.d.ts} +0 -0
- /package/layout/merged/{layout-user.d.ts → layout-user-menu.d.ts} +0 -0
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
declare const _default: (_prefixCls?: import("vue").ComputedRef<string> | string,
|
|
1
|
+
declare const _default: (_prefixCls?: import("vue").ComputedRef<string> | string, themeManager?: import("../../../components/theme/theme-context").ThemeManager) => {
|
|
2
2
|
hashId: import("vue").Ref<string, string>;
|
|
3
3
|
};
|
|
4
4
|
export default _default;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { default } from './layout-user-menu.vue';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { default } from './layout-user-menu.vue.js';
|
|
@@ -1,26 +1,31 @@
|
|
|
1
|
-
import { defineComponent, resolveComponent, createBlock, openBlock, withCtx, createElementVNode, normalizeClass, unref, createVNode, toDisplayString } from 'vue';
|
|
1
|
+
import { defineComponent, resolveComponent, createBlock, openBlock, withCtx, createElementVNode, normalizeClass, unref, createVNode, toDisplayString, resolveDynamicComponent } from 'vue';
|
|
2
2
|
import { useRouter } from 'vue-router';
|
|
3
3
|
import { useGlobalConfig } from '../../config/index.js';
|
|
4
4
|
import { useUserStore } from '../../store/user.js';
|
|
5
5
|
import stdin_default$1 from './style/index.js';
|
|
6
6
|
import { useComponentConfig } from '../../components/config-provider/config-provider.js';
|
|
7
7
|
import { Icon as _Icon } from '../../components/icon/index.js';
|
|
8
|
+
import { defineTemplate } from '../../utils/vue.js';
|
|
8
9
|
|
|
9
10
|
var stdin_default = /* @__PURE__ */defineComponent({
|
|
10
11
|
...{
|
|
11
|
-
name: "
|
|
12
|
+
name: "LayoutUserMenu"
|
|
12
13
|
},
|
|
13
|
-
__name: "layout-user",
|
|
14
|
+
__name: "layout-user-menu",
|
|
14
15
|
setup(__props) {
|
|
15
16
|
const {
|
|
16
17
|
prefixCls
|
|
17
|
-
} = useComponentConfig("layout-user");
|
|
18
|
+
} = useComponentConfig("layout-user-menu");
|
|
18
19
|
const {
|
|
19
20
|
hashId
|
|
20
21
|
} = stdin_default$1(prefixCls);
|
|
21
22
|
const router = useRouter();
|
|
22
23
|
const userStore = useUserStore();
|
|
23
|
-
const
|
|
24
|
+
const {
|
|
25
|
+
router: routerConfig,
|
|
26
|
+
slots: slotsConfig
|
|
27
|
+
} = useGlobalConfig();
|
|
28
|
+
const UserMenu = defineTemplate(() => slotsConfig.userMenu?.());
|
|
24
29
|
const toHome = () => {
|
|
25
30
|
router.push(routerConfig.homePath);
|
|
26
31
|
};
|
|
@@ -45,22 +50,22 @@ var stdin_default = /* @__PURE__ */defineComponent({
|
|
|
45
50
|
onClick: toHome
|
|
46
51
|
}, {
|
|
47
52
|
default: withCtx(() => [createVNode(unref(_Icon), {
|
|
48
|
-
name: "
|
|
53
|
+
name: "co:home",
|
|
49
54
|
size: "lg"
|
|
50
55
|
}), createElementVNode("span", {
|
|
51
|
-
class: normalizeClass(`${unref(prefixCls)}-
|
|
56
|
+
class: normalizeClass(`${unref(prefixCls)}-item-title`)
|
|
52
57
|
}, "\u9996\u9875", 2
|
|
53
58
|
/* CLASS */)]),
|
|
54
59
|
_: 1
|
|
55
60
|
/* STABLE */
|
|
56
|
-
}), createVNode(_component_el_dropdown_item, {
|
|
61
|
+
}), (openBlock(), createBlock(resolveDynamicComponent(unref(UserMenu)))), createVNode(_component_el_dropdown_item, {
|
|
57
62
|
onClick: toChangePassword
|
|
58
63
|
}, {
|
|
59
64
|
default: withCtx(() => [createVNode(unref(_Icon), {
|
|
60
|
-
name: "
|
|
65
|
+
name: "co:password",
|
|
61
66
|
size: "lg"
|
|
62
67
|
}), createElementVNode("span", {
|
|
63
|
-
class: normalizeClass(`${unref(prefixCls)}-
|
|
68
|
+
class: normalizeClass(`${unref(prefixCls)}-item-title`)
|
|
64
69
|
}, "\u4FEE\u6539\u5BC6\u7801", 2
|
|
65
70
|
/* CLASS */)]),
|
|
66
71
|
_: 1
|
|
@@ -70,10 +75,10 @@ var stdin_default = /* @__PURE__ */defineComponent({
|
|
|
70
75
|
onClick: logout
|
|
71
76
|
}, {
|
|
72
77
|
default: withCtx(() => [createVNode(unref(_Icon), {
|
|
73
|
-
name: "
|
|
78
|
+
name: "co:logout",
|
|
74
79
|
size: "lg"
|
|
75
80
|
}), createElementVNode("span", {
|
|
76
|
-
class: normalizeClass(`${unref(prefixCls)}-
|
|
81
|
+
class: normalizeClass(`${unref(prefixCls)}-item-title`)
|
|
77
82
|
}, "\u9000\u51FA", 2
|
|
78
83
|
/* CLASS */)]),
|
|
79
84
|
_: 1
|
|
@@ -89,7 +94,7 @@ var stdin_default = /* @__PURE__ */defineComponent({
|
|
|
89
94
|
src: unref(userStore).userInfo?.avatar
|
|
90
95
|
}, {
|
|
91
96
|
default: withCtx(() => [createVNode(unref(_Icon), {
|
|
92
|
-
name: "
|
|
97
|
+
name: "co:user"
|
|
93
98
|
})]),
|
|
94
99
|
_: 1
|
|
95
100
|
/* STABLE */
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
declare const _default: (_prefixCls?: import("vue").ComputedRef<string> | string,
|
|
1
|
+
declare const _default: (_prefixCls?: import("vue").ComputedRef<string> | string, themeManager?: import("../../../components/theme/theme-context").ThemeManager) => {
|
|
2
2
|
hashId: import("vue").Ref<string, string>;
|
|
3
3
|
};
|
|
4
4
|
export default _default;
|
|
@@ -1,13 +1,17 @@
|
|
|
1
1
|
import { getTruncateStyle } from '../../../components/style/mixins.js';
|
|
2
2
|
import { getSimpleStyleHook } from '../../../components/theme/getSimpleStyleHook.js';
|
|
3
3
|
|
|
4
|
-
var stdin_default = getSimpleStyleHook("
|
|
4
|
+
var stdin_default = getSimpleStyleHook("LayoutUserMenu", (token) => {
|
|
5
5
|
const { componentCls } = token;
|
|
6
6
|
return {
|
|
7
7
|
[componentCls]: {
|
|
8
8
|
display: "flex",
|
|
9
9
|
alignItems: "center",
|
|
10
|
+
borderRadius: token.borderRadius,
|
|
10
11
|
cursor: "pointer",
|
|
12
|
+
"&:focus-visible": {
|
|
13
|
+
outline: "none"
|
|
14
|
+
},
|
|
11
15
|
[`${componentCls}-name`]: {
|
|
12
16
|
marginInlineStart: token.marginXS,
|
|
13
17
|
maxWidth: 160,
|
|
@@ -15,10 +19,10 @@ var stdin_default = getSimpleStyleHook("LayoutUser", (token) => {
|
|
|
15
19
|
}
|
|
16
20
|
},
|
|
17
21
|
[`${componentCls}-dropdown`]: {
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
+
minWidth: 140
|
|
23
|
+
},
|
|
24
|
+
[`${componentCls}-item-title`]: {
|
|
25
|
+
marginInlineStart: token.marginXS
|
|
22
26
|
}
|
|
23
27
|
};
|
|
24
28
|
});
|
package/layout/layout.d.ts
CHANGED
|
@@ -26,4 +26,4 @@ export { default as LayoutTabbar } from './layout-tabbar';
|
|
|
26
26
|
export { default as LayoutToggle } from './layout-toggle';
|
|
27
27
|
export { default as LayoutTopSnugMenu } from './layout-top-snug-menu';
|
|
28
28
|
export { default as LayoutTopbar } from './layout-topbar';
|
|
29
|
-
export { default as
|
|
29
|
+
export { default as LayoutUserMenu } from './layout-user-menu';
|
package/layout/layout.js
CHANGED
|
@@ -26,4 +26,4 @@ export { default as LayoutTabbar } from './layout-tabbar/layout-tabbar.vue.js';
|
|
|
26
26
|
export { default as LayoutToggle } from './layout-toggle/layout-toggle.vue.js';
|
|
27
27
|
export { default as LayoutTopSnugMenu } from './layout-top-snug-menu/layout-top-snug-menu.vue.js';
|
|
28
28
|
export { default as LayoutTopbar } from './layout-topbar/layout-topbar.vue.js';
|
|
29
|
-
export { default as
|
|
29
|
+
export { default as LayoutUserMenu } from './layout-user-menu/layout-user-menu.vue.js';
|
package/layout/merged/index.d.ts
CHANGED
|
@@ -26,4 +26,4 @@ export { default as MergedLayoutTabbar } from './layout-tabbar';
|
|
|
26
26
|
export { default as MergedLayoutToggle } from './layout-toggle';
|
|
27
27
|
export { default as MergedLayoutTopSnugMenu } from './layout-top-snug-menu';
|
|
28
28
|
export { default as MergedLayoutTopbar } from './layout-topbar';
|
|
29
|
-
export { default as
|
|
29
|
+
export { default as MergedLayoutUserMenu } from './layout-user-menu';
|
package/layout/merged/index.js
CHANGED
|
@@ -26,4 +26,4 @@ export { default as MergedLayoutTabbar } from './layout-tabbar.js';
|
|
|
26
26
|
export { default as MergedLayoutToggle } from './layout-toggle.js';
|
|
27
27
|
export { default as MergedLayoutTopSnugMenu } from './layout-top-snug-menu.js';
|
|
28
28
|
export { default as MergedLayoutTopbar } from './layout-topbar.js';
|
|
29
|
-
export { default as
|
|
29
|
+
export { default as MergedLayoutUserMenu } from './layout-user-menu.js';
|
package/layout/utils.js
CHANGED
|
@@ -6,10 +6,7 @@ function mergedLayout(name, defaultComponent) {
|
|
|
6
6
|
return defineComponent({
|
|
7
7
|
setup(props, { slots }) {
|
|
8
8
|
const { components } = useGlobalConfig();
|
|
9
|
-
const component = useOptionalComponent(
|
|
10
|
-
components?.[name],
|
|
11
|
-
defaultComponent
|
|
12
|
-
);
|
|
9
|
+
const component = useOptionalComponent(components?.[name], defaultComponent);
|
|
13
10
|
return () => h(component.value, props, slots);
|
|
14
11
|
}
|
|
15
12
|
});
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "cosey",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.4",
|
|
4
4
|
"description": "基于 Vue3 的后台管理框架",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "index.js",
|
|
@@ -8,17 +8,17 @@
|
|
|
8
8
|
"scripts": {
|
|
9
9
|
"test": "echo \"Error: no test specified\" && exit 1"
|
|
10
10
|
},
|
|
11
|
-
"author": "wuzhitao",
|
|
12
|
-
"license": "MIT",
|
|
13
11
|
"devDependencies": {
|
|
14
12
|
"@casl/ability": "^6.7.3",
|
|
13
|
+
"@cosey/icons": "^0.1.5",
|
|
15
14
|
"@ctrl/tinycolor": "^4.1.0",
|
|
16
15
|
"@element-plus/icons-vue": "^2.3.1",
|
|
17
16
|
"@emotion/hash": "^0.9.2",
|
|
18
17
|
"@emotion/unitless": "^0.10.0",
|
|
19
18
|
"@floating-ui/dom": "^1.6.13",
|
|
20
19
|
"@gunny/persist": "^1.0.1",
|
|
21
|
-
"@iconify
|
|
20
|
+
"@iconify/types": "^2.0.0",
|
|
21
|
+
"@types/nprogress": "^0.2.3",
|
|
22
22
|
"@types/stylis": "^4.2.7",
|
|
23
23
|
"@vue/shared": "^3.5.13",
|
|
24
24
|
"@vueuse/core": "^13.2.0",
|
|
@@ -32,6 +32,7 @@
|
|
|
32
32
|
"jszip": "^3.10.1",
|
|
33
33
|
"katex": "^0.16.22",
|
|
34
34
|
"lodash-es": "^4.17.21",
|
|
35
|
+
"nprogress": "^0.2.0",
|
|
35
36
|
"pinia": "^3.0.2",
|
|
36
37
|
"quill": "^2.0.3",
|
|
37
38
|
"stylis": "^4.3.6",
|
|
@@ -40,13 +41,15 @@
|
|
|
40
41
|
},
|
|
41
42
|
"peerDependencies": {
|
|
42
43
|
"@casl/ability": "^6.7.3",
|
|
44
|
+
"@cosey/icons": "^0.1.5",
|
|
43
45
|
"@ctrl/tinycolor": "^4.1.0",
|
|
44
46
|
"@element-plus/icons-vue": "^2.3.1",
|
|
45
47
|
"@emotion/hash": "^0.9.2",
|
|
46
48
|
"@emotion/unitless": "^0.10.0",
|
|
47
49
|
"@floating-ui/dom": "^1.6.13",
|
|
48
50
|
"@gunny/persist": "^1.0.1",
|
|
49
|
-
"@iconify
|
|
51
|
+
"@iconify/types": "^2.0.0",
|
|
52
|
+
"@types/nprogress": "^0.2.3",
|
|
50
53
|
"@vue/shared": "^3.5.13",
|
|
51
54
|
"@vueuse/core": "^13.2.0",
|
|
52
55
|
"axios": "^1.7.9",
|
|
@@ -59,10 +62,17 @@
|
|
|
59
62
|
"jszip": "^3.10.1",
|
|
60
63
|
"katex": "^0.16.22",
|
|
61
64
|
"lodash-es": "^4.17.21",
|
|
65
|
+
"nprogress": "^0.2.0",
|
|
62
66
|
"pinia": "^3.0.2",
|
|
63
67
|
"quill": "^2.0.3",
|
|
64
68
|
"stylis": "^4.3.6",
|
|
65
69
|
"vue": "^3.5.13",
|
|
66
70
|
"vue-router": "^4.5.0"
|
|
67
|
-
}
|
|
71
|
+
},
|
|
72
|
+
"repository": {
|
|
73
|
+
"type": "git",
|
|
74
|
+
"url": "git+https://github.com/sutras/cosey.git"
|
|
75
|
+
},
|
|
76
|
+
"author": "wuzhitao",
|
|
77
|
+
"license": "MIT"
|
|
68
78
|
}
|
package/request/useRequest.js
CHANGED
package/router/guard/auth.js
CHANGED
|
@@ -24,13 +24,10 @@ function registerAuthGuard(router) {
|
|
|
24
24
|
await userStore.getUserInfo();
|
|
25
25
|
await userStore.setAuthorization();
|
|
26
26
|
await userStore.addDynamicRoutes();
|
|
27
|
-
layoutStore.menus = getMenus([
|
|
28
|
-
...getAllStaticRoutes(),
|
|
29
|
-
...userStore.dynamicRoutes
|
|
30
|
-
]);
|
|
27
|
+
layoutStore.menus = getMenus([...getAllStaticRoutes(), ...userStore.dynamicRoutes]);
|
|
31
28
|
firstTimeAddRoutes = true;
|
|
32
29
|
userStore.requestedUserInfo = true;
|
|
33
|
-
} catch
|
|
30
|
+
} catch {
|
|
34
31
|
return false;
|
|
35
32
|
} finally {
|
|
36
33
|
persist.remove(ROUTER_TO);
|
package/router/guard/index.js
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import { registerProgressGuard } from './progress.js';
|
|
2
|
-
import { registerPopupGuard } from './popup.js';
|
|
3
2
|
import { registerAuthGuard } from './auth.js';
|
|
3
|
+
import { registerPageTitleGuard } from './pageTitle.js';
|
|
4
4
|
|
|
5
5
|
function registerRouterGuard(router) {
|
|
6
6
|
registerProgressGuard(router);
|
|
7
|
-
registerPopupGuard(router);
|
|
8
7
|
registerAuthGuard(router);
|
|
8
|
+
registerPageTitleGuard(router);
|
|
9
9
|
}
|
|
10
10
|
|
|
11
11
|
export { registerRouterGuard };
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { useGlobalConfig } from '../../config/index.js';
|
|
2
|
+
|
|
3
|
+
function registerPageTitleGuard(router) {
|
|
4
|
+
router.afterEach((to) => {
|
|
5
|
+
const siteConfig = useGlobalConfig().site;
|
|
6
|
+
const title = to.meta.title ? to.meta.title + " - " + siteConfig.name : siteConfig.name;
|
|
7
|
+
document.title = title;
|
|
8
|
+
});
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
export { registerPageTitleGuard };
|
package/router/guard/progress.js
CHANGED
|
@@ -1,5 +1,15 @@
|
|
|
1
|
+
import NProgress from 'nprogress';
|
|
2
|
+
|
|
1
3
|
function registerProgressGuard(router) {
|
|
2
|
-
|
|
4
|
+
const pathCache = {};
|
|
5
|
+
router.beforeEach((to) => {
|
|
6
|
+
if (!pathCache[to.path]) {
|
|
7
|
+
NProgress.start();
|
|
8
|
+
}
|
|
9
|
+
});
|
|
10
|
+
router.afterEach((to) => {
|
|
11
|
+
pathCache[to.path] = true;
|
|
12
|
+
NProgress.done();
|
|
3
13
|
});
|
|
4
14
|
}
|
|
5
15
|
|
package/router/index.d.ts
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { type RouteRecordRaw, type RouterOptions, type RouterHistory } from 'vue-router';
|
|
2
|
+
import type { AnyAbility } from '@casl/ability';
|
|
2
3
|
export { type MenuItem, type MenuNode, getMenus, getMenusMap, getMenuPathKeys, getBreadcrumbRoutes, } from './menus';
|
|
3
4
|
export { defineRoute, defineRoutes, mergeRouteModules } from './utils';
|
|
4
5
|
export interface CoseyRouterOptions extends Omit<RouterOptions, 'routes' | 'history'> {
|
|
@@ -9,3 +10,24 @@ export interface CoseyRouterOptions extends Omit<RouterOptions, 'routes' | 'hist
|
|
|
9
10
|
export declare const getAllDynamicRoutes: () => RouteRecordRaw[];
|
|
10
11
|
export declare const getAllStaticRoutes: () => RouteRecordRaw[];
|
|
11
12
|
export declare function createCoseyRouter(options?: CoseyRouterOptions): import("vue-router").Router;
|
|
13
|
+
declare module 'vue-router' {
|
|
14
|
+
interface RouteMeta {
|
|
15
|
+
title?: string;
|
|
16
|
+
icon?: string;
|
|
17
|
+
hideInMenu?: boolean;
|
|
18
|
+
hideChildrenInMenu?: boolean;
|
|
19
|
+
flatChildrenInMenu?: boolean;
|
|
20
|
+
type?: 'group';
|
|
21
|
+
closable?: boolean;
|
|
22
|
+
keepAlive?: boolean;
|
|
23
|
+
order?: number;
|
|
24
|
+
iframeSrc?: string;
|
|
25
|
+
authentication?: boolean;
|
|
26
|
+
authority?: (ability: AnyAbility) => boolean;
|
|
27
|
+
}
|
|
28
|
+
}
|
|
29
|
+
declare module 'vue-router' {
|
|
30
|
+
interface RouteMeta {
|
|
31
|
+
_externalLink?: boolean;
|
|
32
|
+
}
|
|
33
|
+
}
|
package/router/index.js
CHANGED
|
@@ -1,13 +1,12 @@
|
|
|
1
1
|
import { defineRoutes } from '../../utils.js';
|
|
2
|
-
import stdin_default$3 from '../../../layout/
|
|
3
|
-
import stdin_default$2 from '../../../layout/
|
|
4
|
-
import stdin_default$1 from '../../../layout/
|
|
2
|
+
import stdin_default$3 from '../../../layout/merged/layout-auth.js';
|
|
3
|
+
import stdin_default$2 from '../../../layout/merged/layout-change-password.js';
|
|
4
|
+
import stdin_default$1 from '../../../layout/merged/layout-login.js';
|
|
5
5
|
|
|
6
6
|
var stdin_default = defineRoutes({
|
|
7
7
|
path: "/auth",
|
|
8
8
|
name: "Auth",
|
|
9
9
|
component: stdin_default$3,
|
|
10
|
-
redirect: "/auth/login",
|
|
11
10
|
meta: {
|
|
12
11
|
hideInMenu: true
|
|
13
12
|
},
|
|
@@ -23,10 +22,10 @@ var stdin_default = defineRoutes({
|
|
|
23
22
|
},
|
|
24
23
|
{
|
|
25
24
|
path: "change-password",
|
|
26
|
-
name: "
|
|
25
|
+
name: "ChangePassword",
|
|
27
26
|
component: stdin_default$2,
|
|
28
27
|
meta: {
|
|
29
|
-
title: "\
|
|
28
|
+
title: "\u4FEE\u6539\u5BC6\u7801"
|
|
30
29
|
}
|
|
31
30
|
}
|
|
32
31
|
]
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { defineRoutes } from '../../utils.js';
|
|
2
|
-
import stdin_default$3 from '../../../layout/
|
|
3
|
-
import stdin_default$1 from '../../../layout/
|
|
4
|
-
import stdin_default$2 from '../../../layout/
|
|
2
|
+
import stdin_default$3 from '../../../layout/merged/layout-exception.js';
|
|
3
|
+
import stdin_default$1 from '../../../layout/merged/layout-forbidden.js';
|
|
4
|
+
import stdin_default$2 from '../../../layout/merged/layout-internal-server-error.js';
|
|
5
5
|
import { NotFoundRoute } from '../../not-found.js';
|
|
6
6
|
|
|
7
7
|
var stdin_default = defineRoutes([
|
package/router/utils.js
CHANGED
|
@@ -1,12 +1,11 @@
|
|
|
1
1
|
import { uuid } from '../utils/string.js';
|
|
2
2
|
|
|
3
3
|
function defineRoute(route) {
|
|
4
|
-
function recur(route2) {
|
|
4
|
+
function recur(route2, index = 0, parent) {
|
|
5
5
|
const meta = route2.meta || {};
|
|
6
|
-
|
|
6
|
+
const newRoute = {
|
|
7
7
|
...route2,
|
|
8
8
|
name: route2.name || uuid(),
|
|
9
|
-
children: Array.isArray(route2.children) ? route2.children.map(recur) : void 0,
|
|
10
9
|
meta: {
|
|
11
10
|
...meta,
|
|
12
11
|
closable: meta.closable ?? true,
|
|
@@ -14,6 +13,15 @@ function defineRoute(route) {
|
|
|
14
13
|
authentication: meta.authentication ?? true
|
|
15
14
|
}
|
|
16
15
|
};
|
|
16
|
+
if (Array.isArray(route2.children)) {
|
|
17
|
+
newRoute.children = route2.children.map((item, index2) => recur(item, index2, newRoute));
|
|
18
|
+
}
|
|
19
|
+
if (parent && !parent.redirect && index === 0) {
|
|
20
|
+
parent.redirect = {
|
|
21
|
+
name: newRoute.name
|
|
22
|
+
};
|
|
23
|
+
}
|
|
24
|
+
return newRoute;
|
|
17
25
|
}
|
|
18
26
|
return recur(route);
|
|
19
27
|
}
|
package/store/layout.d.ts
CHANGED
|
@@ -1,16 +1,14 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { RouteMeta } from 'vue-router';
|
|
2
2
|
import { type MenuItem } from '../router';
|
|
3
3
|
export type LayoutMenuType = 'vertical' | 'biserial' | 'horizontal' | 'horizontal-vertical' | 'horizontal-biserial';
|
|
4
4
|
export interface LayoutTab {
|
|
5
5
|
name: string;
|
|
6
|
-
meta:
|
|
6
|
+
meta: RouteMeta;
|
|
7
7
|
}
|
|
8
|
-
export declare const useLayoutStore: import("pinia").StoreDefinition<"layout", Pick<{
|
|
8
|
+
export declare const useLayoutStore: import("pinia").StoreDefinition<"cosey-layout", Pick<{
|
|
9
9
|
sidebarVisible: import("vue").Ref<boolean, boolean>;
|
|
10
10
|
collapse: import("vue").Ref<boolean, boolean>;
|
|
11
|
-
settingVisible: import("vue").Ref<boolean, boolean>;
|
|
12
11
|
isMobile: import("vue").Ref<boolean, boolean>;
|
|
13
|
-
fixedHead: import("vue").Ref<boolean, boolean>;
|
|
14
12
|
menuType: import("vue").Ref<LayoutMenuType, LayoutMenuType>;
|
|
15
13
|
includeHorizontal: import("vue").ComputedRef<boolean>;
|
|
16
14
|
isVertical: import("vue").ComputedRef<boolean>;
|
|
@@ -407,12 +405,10 @@ export declare const useLayoutStore: import("pinia").StoreDefinition<"layout", P
|
|
|
407
405
|
topbarHeight: import("vue").Ref<number, number>;
|
|
408
406
|
tabbarHeight: import("vue").Ref<number, number>;
|
|
409
407
|
headerHeight: import("vue").ComputedRef<number>;
|
|
410
|
-
}, "collapse" | "menus" | "sidebarVisible" | "
|
|
408
|
+
}, "collapse" | "menus" | "sidebarVisible" | "menuType" | "tabbarVisible" | "asideWidth" | "collapsedAsideWidth" | "snugAsideWidth" | "topbarHeight" | "tabbarHeight" | "isMobile" | "firstLevelMenus" | "firstLevelActive" | "secondLevelActive" | "topMenus" | "topActive" | "activeTab" | "refreshing" | "tabList" | "keepAliveInclude">, Pick<{
|
|
411
409
|
sidebarVisible: import("vue").Ref<boolean, boolean>;
|
|
412
410
|
collapse: import("vue").Ref<boolean, boolean>;
|
|
413
|
-
settingVisible: import("vue").Ref<boolean, boolean>;
|
|
414
411
|
isMobile: import("vue").Ref<boolean, boolean>;
|
|
415
|
-
fixedHead: import("vue").Ref<boolean, boolean>;
|
|
416
412
|
menuType: import("vue").Ref<LayoutMenuType, LayoutMenuType>;
|
|
417
413
|
includeHorizontal: import("vue").ComputedRef<boolean>;
|
|
418
414
|
isVertical: import("vue").ComputedRef<boolean>;
|
|
@@ -812,9 +808,7 @@ export declare const useLayoutStore: import("pinia").StoreDefinition<"layout", P
|
|
|
812
808
|
}, "keepAlive" | "isHorizontal" | "includeHorizontal" | "isVertical" | "isBiserial" | "isHorizontalVertical" | "isHorizontalBiserial" | "menusMap" | "secondLevelMenus" | "thirdLevelMenus" | "snugMenus" | "snugActive" | "defaultMenus" | "iframeTabList" | "keepAliveExclude" | "sidebarWidth" | "headerHeight">, Pick<{
|
|
813
809
|
sidebarVisible: import("vue").Ref<boolean, boolean>;
|
|
814
810
|
collapse: import("vue").Ref<boolean, boolean>;
|
|
815
|
-
settingVisible: import("vue").Ref<boolean, boolean>;
|
|
816
811
|
isMobile: import("vue").Ref<boolean, boolean>;
|
|
817
|
-
fixedHead: import("vue").Ref<boolean, boolean>;
|
|
818
812
|
menuType: import("vue").Ref<LayoutMenuType, LayoutMenuType>;
|
|
819
813
|
includeHorizontal: import("vue").ComputedRef<boolean>;
|
|
820
814
|
isVertical: import("vue").ComputedRef<boolean>;
|
package/store/layout.js
CHANGED
|
@@ -5,13 +5,11 @@ import { useGlobalConfig } from '../config/index.js';
|
|
|
5
5
|
import { ref, watch, computed, nextTick } from 'vue';
|
|
6
6
|
import { useWindowResize } from '../hooks/useWindowResize.js';
|
|
7
7
|
|
|
8
|
-
const useLayoutStore = defineStore("layout", () => {
|
|
8
|
+
const useLayoutStore = defineStore("cosey-layout", () => {
|
|
9
9
|
const { layout: layoutConfig } = useGlobalConfig();
|
|
10
10
|
const route = useRoute();
|
|
11
|
-
const sidebarVisible = ref(
|
|
12
|
-
const collapse = ref(
|
|
13
|
-
const settingVisible = ref(false);
|
|
14
|
-
const fixedHead = ref(true);
|
|
11
|
+
const sidebarVisible = ref(layoutConfig.sidebarVisible);
|
|
12
|
+
const collapse = ref(layoutConfig.collapse);
|
|
15
13
|
const isMobile = ref(false);
|
|
16
14
|
watch(
|
|
17
15
|
isMobile,
|
|
@@ -27,21 +25,15 @@ const useLayoutStore = defineStore("layout", () => {
|
|
|
27
25
|
};
|
|
28
26
|
onResize();
|
|
29
27
|
useWindowResize(onResize);
|
|
30
|
-
const menuType = ref(
|
|
28
|
+
const menuType = ref(layoutConfig.menuType);
|
|
31
29
|
const includeHorizontal = computed(
|
|
32
|
-
() => ["horizontal", "horizontal-vertical", "horizontal-biserial"].includes(
|
|
33
|
-
menuType.value
|
|
34
|
-
)
|
|
30
|
+
() => ["horizontal", "horizontal-vertical", "horizontal-biserial"].includes(menuType.value)
|
|
35
31
|
);
|
|
36
32
|
const isVertical = computed(() => menuType.value === "vertical");
|
|
37
33
|
const isBiserial = computed(() => menuType.value === "biserial");
|
|
38
34
|
const isHorizontal = computed(() => menuType.value === "horizontal");
|
|
39
|
-
const isHorizontalVertical = computed(
|
|
40
|
-
|
|
41
|
-
);
|
|
42
|
-
const isHorizontalBiserial = computed(
|
|
43
|
-
() => menuType.value === "horizontal-biserial"
|
|
44
|
-
);
|
|
35
|
+
const isHorizontalVertical = computed(() => menuType.value === "horizontal-vertical");
|
|
36
|
+
const isHorizontalBiserial = computed(() => menuType.value === "horizontal-biserial");
|
|
45
37
|
const menus = ref([]);
|
|
46
38
|
const menusMap = computed(() => getMenusMap(menus.value));
|
|
47
39
|
const firstLevelMenus = menus;
|
|
@@ -95,7 +87,7 @@ const useLayoutStore = defineStore("layout", () => {
|
|
|
95
87
|
}
|
|
96
88
|
}
|
|
97
89
|
});
|
|
98
|
-
const tabbarVisible = ref(
|
|
90
|
+
const tabbarVisible = ref(layoutConfig.tabbarVisible);
|
|
99
91
|
const activeTab = ref("");
|
|
100
92
|
const refreshing = ref(false);
|
|
101
93
|
const tabList = ref([]);
|
|
@@ -127,21 +119,16 @@ const useLayoutStore = defineStore("layout", () => {
|
|
|
127
119
|
const reload = () => {
|
|
128
120
|
refreshing.value = true;
|
|
129
121
|
if (keepAliveInclude.value.includes(route.name)) {
|
|
130
|
-
keepAliveInclude.value = keepAliveInclude.value.filter(
|
|
131
|
-
(item) => item !== route.name
|
|
132
|
-
);
|
|
122
|
+
keepAliveInclude.value = keepAliveInclude.value.filter((item) => item !== route.name);
|
|
133
123
|
}
|
|
134
124
|
nextTick(() => {
|
|
135
125
|
refreshing.value = false;
|
|
136
|
-
keepAliveInclude.value = [
|
|
137
|
-
...keepAliveInclude.value,
|
|
138
|
-
route.name
|
|
139
|
-
];
|
|
126
|
+
keepAliveInclude.value = [...keepAliveInclude.value, route.name];
|
|
140
127
|
});
|
|
141
128
|
};
|
|
142
|
-
const asideWidth = ref(
|
|
143
|
-
const collapsedAsideWidth = ref(
|
|
144
|
-
const snugAsideWidth = ref(
|
|
129
|
+
const asideWidth = ref(layoutConfig.asideWidth);
|
|
130
|
+
const collapsedAsideWidth = ref(layoutConfig.collapsedAsideWidth);
|
|
131
|
+
const snugAsideWidth = ref(layoutConfig.snugAsideWidth);
|
|
145
132
|
const sidebarWidth = computed(() => {
|
|
146
133
|
if (isMobile.value) {
|
|
147
134
|
return 0;
|
|
@@ -162,24 +149,25 @@ const useLayoutStore = defineStore("layout", () => {
|
|
|
162
149
|
}
|
|
163
150
|
return asideWidth.value;
|
|
164
151
|
case "biserial":
|
|
165
|
-
case "horizontal-biserial":
|
|
152
|
+
case "horizontal-biserial": {
|
|
166
153
|
const snugAsideW = snugMenus.value.length === 0 ? 0 : snugAsideWidth.value;
|
|
167
154
|
const asideW = defaultMenus.value.length === 0 ? 0 : collapse.value ? collapsedAsideWidth.value : asideWidth.value;
|
|
168
155
|
return snugAsideW + asideW;
|
|
156
|
+
}
|
|
157
|
+
default:
|
|
158
|
+
return 0;
|
|
169
159
|
}
|
|
170
160
|
}
|
|
171
161
|
});
|
|
172
|
-
const topbarHeight = ref(
|
|
173
|
-
const tabbarHeight = ref(
|
|
162
|
+
const topbarHeight = ref(layoutConfig.topbarHeight);
|
|
163
|
+
const tabbarHeight = ref(layoutConfig.tabbarHeight);
|
|
174
164
|
const headerHeight = computed(() => {
|
|
175
165
|
return topbarHeight.value + (tabbarVisible.value ? tabbarHeight.value : 0);
|
|
176
166
|
});
|
|
177
167
|
return {
|
|
178
168
|
sidebarVisible,
|
|
179
169
|
collapse,
|
|
180
|
-
settingVisible,
|
|
181
170
|
isMobile,
|
|
182
|
-
fixedHead,
|
|
183
171
|
menuType,
|
|
184
172
|
includeHorizontal,
|
|
185
173
|
isVertical,
|
package/store/user.d.ts
CHANGED
|
@@ -5,12 +5,12 @@ interface UserInfo {
|
|
|
5
5
|
avatar: string;
|
|
6
6
|
[key: PropertyKey]: any;
|
|
7
7
|
}
|
|
8
|
-
export declare const useUserStore: import("pinia").StoreDefinition<"user", Pick<{
|
|
8
|
+
export declare const useUserStore: import("pinia").StoreDefinition<"cosey-user", Pick<{
|
|
9
9
|
dynamicRoutes: import("vue").Ref<any[], any[]>;
|
|
10
10
|
userInfo: import("vue").Ref<UserInfo | undefined, UserInfo | undefined>;
|
|
11
11
|
requestedUserInfo: import("vue").Ref<boolean, boolean>;
|
|
12
12
|
login: (data: any) => Promise<void>;
|
|
13
|
-
getUserInfo: () => Promise<
|
|
13
|
+
getUserInfo: () => Promise<UserInfo | undefined>;
|
|
14
14
|
changePassword: (data: any) => Promise<void>;
|
|
15
15
|
setAuthorization: () => Promise<void | undefined>;
|
|
16
16
|
addDynamicRoutes: () => Promise<void>;
|
|
@@ -20,7 +20,7 @@ export declare const useUserStore: import("pinia").StoreDefinition<"user", Pick<
|
|
|
20
20
|
userInfo: import("vue").Ref<UserInfo | undefined, UserInfo | undefined>;
|
|
21
21
|
requestedUserInfo: import("vue").Ref<boolean, boolean>;
|
|
22
22
|
login: (data: any) => Promise<void>;
|
|
23
|
-
getUserInfo: () => Promise<
|
|
23
|
+
getUserInfo: () => Promise<UserInfo | undefined>;
|
|
24
24
|
changePassword: (data: any) => Promise<void>;
|
|
25
25
|
setAuthorization: () => Promise<void | undefined>;
|
|
26
26
|
addDynamicRoutes: () => Promise<void>;
|
|
@@ -30,7 +30,7 @@ export declare const useUserStore: import("pinia").StoreDefinition<"user", Pick<
|
|
|
30
30
|
userInfo: import("vue").Ref<UserInfo | undefined, UserInfo | undefined>;
|
|
31
31
|
requestedUserInfo: import("vue").Ref<boolean, boolean>;
|
|
32
32
|
login: (data: any) => Promise<void>;
|
|
33
|
-
getUserInfo: () => Promise<
|
|
33
|
+
getUserInfo: () => Promise<UserInfo | undefined>;
|
|
34
34
|
changePassword: (data: any) => Promise<void>;
|
|
35
35
|
setAuthorization: () => Promise<void | undefined>;
|
|
36
36
|
addDynamicRoutes: () => Promise<void>;
|