Commit 31ff0559fe3b635fc2091aac0e2f5e340629134c
1 parent
c031163f
feat(page-wrapper): added pageWrapper component
Showing
79 changed files
with
756 additions
and
471 deletions
.vscode/settings.json
@@ -12,6 +12,7 @@ | @@ -12,6 +12,7 @@ | ||
12 | "editor.cursorSmoothCaretAnimation": true, | 12 | "editor.cursorSmoothCaretAnimation": true, |
13 | "editor.detectIndentation": false, | 13 | "editor.detectIndentation": false, |
14 | "diffEditor.ignoreTrimWhitespace": false, | 14 | "diffEditor.ignoreTrimWhitespace": false, |
15 | + "javascript.format.insertSpaceBeforeFunctionParenthesis": true, | ||
15 | "editor.formatOnPaste": true, | 16 | "editor.formatOnPaste": true, |
16 | "editor.formatOnSave": true, | 17 | "editor.formatOnSave": true, |
17 | "editor.suggestSelection": "first", | 18 | "editor.suggestSelection": "first", |
@@ -108,18 +109,22 @@ | @@ -108,18 +109,22 @@ | ||
108 | // =========================================== | 109 | // =========================================== |
109 | // ================ Eslint =================== | 110 | // ================ Eslint =================== |
110 | // =========================================== | 111 | // =========================================== |
111 | - "eslint.enable": true, | 112 | + // "eslint.enable": true, |
113 | + "eslint.alwaysShowStatus": true, | ||
112 | "eslint.options": { | 114 | "eslint.options": { |
113 | // 配置 | 115 | // 配置 |
114 | - "plugins": [ | ||
115 | - "html", | ||
116 | - "vue", | ||
117 | - "javascript", | ||
118 | - "jsx", | ||
119 | - "typescript" | ||
120 | - ] | ||
121 | - }, | ||
122 | - "eslint.autoFixOnSave": true, | 116 | + "plugins": ["html", "vue", "javascript", "jsx", "typescript"], |
117 | + "extensions": [".js", ".jsx", ".ts", ".tsx", ".vue"] | ||
118 | + }, | ||
119 | + "eslint.validate": [ | ||
120 | + "javascript", | ||
121 | + "typescript", | ||
122 | + "reacttypescript", | ||
123 | + "reactjavascript", | ||
124 | + "html", | ||
125 | + "vue" | ||
126 | + ], | ||
127 | + // "eslint.autoFixOnSave": true, | ||
123 | // =========================================== | 128 | // =========================================== |
124 | // ================ Vetur ==================== | 129 | // ================ Vetur ==================== |
125 | // =========================================== | 130 | // =========================================== |
@@ -181,19 +186,12 @@ | @@ -181,19 +186,12 @@ | ||
181 | "editor.codeActionsOnSave": { | 186 | "editor.codeActionsOnSave": { |
182 | "source.fixAll.eslint": true | 187 | "source.fixAll.eslint": true |
183 | }, | 188 | }, |
184 | - "i18n-ally.localesPaths": [ | ||
185 | - "src/locales/lang", | ||
186 | - ], | 189 | + "i18n-ally.localesPaths": ["src/locales/lang"], |
187 | "i18n-ally.keystyle": "nested", | 190 | "i18n-ally.keystyle": "nested", |
188 | "i18n-ally.sortKeys": true, | 191 | "i18n-ally.sortKeys": true, |
189 | "i18n-ally.namespace": true, | 192 | "i18n-ally.namespace": true, |
190 | "i18n-ally.pathMatcher": "{locale}/{namespaces}.{ext}", | 193 | "i18n-ally.pathMatcher": "{locale}/{namespaces}.{ext}", |
191 | - "i18n-ally.enabledParsers": [ | ||
192 | - "ts" | ||
193 | - ], | 194 | + "i18n-ally.enabledParsers": ["ts"], |
194 | "i18n-ally.sourceLanguage": "zh", | 195 | "i18n-ally.sourceLanguage": "zh", |
195 | - "i18n-ally.enabledFrameworks": [ | ||
196 | - "vue", | ||
197 | - "react" | ||
198 | - ] | ||
199 | -} | ||
200 | \ No newline at end of file | 196 | \ No newline at end of file |
197 | + "i18n-ally.enabledFrameworks": ["vue", "react"] | ||
198 | +} |
CHANGELOG.zh_CN.md
@@ -5,6 +5,7 @@ | @@ -5,6 +5,7 @@ | ||
5 | - 新增`mixSideTrigger`配置。用于配置左侧混合模式菜单打开方式。可选`hover`,默认`click` | 5 | - 新增`mixSideTrigger`配置。用于配置左侧混合模式菜单打开方式。可选`hover`,默认`click` |
6 | - 新增`mixSideFixed`配置。用于固定左侧混合模式菜单 | 6 | - 新增`mixSideFixed`配置。用于固定左侧混合模式菜单 |
7 | - modal 组件新增`height`和`min-height`属性 | 7 | - modal 组件新增`height`和`min-height`属性 |
8 | +- 新增`PageWrapper`组件。并应用于示例页面 | ||
8 | 9 | ||
9 | ### 🐛 Bug Fixes | 10 | ### 🐛 Bug Fixes |
10 | 11 |
src/components/Form/src/hooks/useFormContext.ts
1 | -import { InjectionKey } from 'vue'; | 1 | +import type { InjectionKey } from 'vue'; |
2 | import { createContext, useContext } from '/@/hooks/core/useContext'; | 2 | import { createContext, useContext } from '/@/hooks/core/useContext'; |
3 | 3 | ||
4 | export interface FormContextProps { | 4 | export interface FormContextProps { |
src/components/Page/index.ts
1 | import { createAsyncComponent } from '/@/utils/factory/createAsyncComponent'; | 1 | import { createAsyncComponent } from '/@/utils/factory/createAsyncComponent'; |
2 | export const PageFooter = createAsyncComponent(() => import('./src/PageFooter.vue')); | 2 | export const PageFooter = createAsyncComponent(() => import('./src/PageFooter.vue')); |
3 | + | ||
4 | +export { default as PageWrapper } from './src/PageWrapper.vue'; |
src/components/Page/src/PageFooter.vue
1 | <template> | 1 | <template> |
2 | - <div class="app-footer" :style="{ width: getCalcContentWidth }"> | ||
3 | - <div class="app-footer__left"> | 2 | + <div :class="prefixCls" :style="{ width: getCalcContentWidth }"> |
3 | + <div :class="`${prefixCls}__left`"> | ||
4 | <slot name="left" /> | 4 | <slot name="left" /> |
5 | </div> | 5 | </div> |
6 | - <div class="app-footer__right"> | 6 | + <slot /> |
7 | + <div :class="`${prefixCls}__right`"> | ||
7 | <slot name="right" /> | 8 | <slot name="right" /> |
8 | </div> | 9 | </div> |
9 | </div> | 10 | </div> |
@@ -12,19 +13,21 @@ | @@ -12,19 +13,21 @@ | ||
12 | import { defineComponent } from 'vue'; | 13 | import { defineComponent } from 'vue'; |
13 | 14 | ||
14 | import { useMenuSetting } from '/@/hooks/setting/useMenuSetting'; | 15 | import { useMenuSetting } from '/@/hooks/setting/useMenuSetting'; |
16 | + import { useDesign } from '/@/hooks/web/useDesign'; | ||
15 | 17 | ||
16 | export default defineComponent({ | 18 | export default defineComponent({ |
17 | name: 'PageFooter', | 19 | name: 'PageFooter', |
18 | setup() { | 20 | setup() { |
21 | + const { prefixCls } = useDesign('page-footer'); | ||
19 | const { getCalcContentWidth } = useMenuSetting(); | 22 | const { getCalcContentWidth } = useMenuSetting(); |
20 | - return { getCalcContentWidth }; | 23 | + return { prefixCls, getCalcContentWidth }; |
21 | }, | 24 | }, |
22 | }); | 25 | }); |
23 | </script> | 26 | </script> |
24 | <style lang="less" scoped> | 27 | <style lang="less" scoped> |
25 | - @import (reference) '../../../design/index.less'; | 28 | + @prefix-cls: ~'@{namespace}-page-footer'; |
26 | 29 | ||
27 | - .app-footer { | 30 | + .@{prefix-cls} { |
28 | position: fixed; | 31 | position: fixed; |
29 | right: 0; | 32 | right: 0; |
30 | bottom: 0; | 33 | bottom: 0; |
src/components/Page/src/PageWrapper.vue
0 → 100644
1 | +<template> | ||
2 | + <div :class="getClass"> | ||
3 | + <PageHeader :ghost="ghost" v-bind="$attrs" ref="headerRef"> | ||
4 | + <template #default> | ||
5 | + <template v-if="content"> | ||
6 | + {{ content }} | ||
7 | + </template> | ||
8 | + <slot name="headerContent" v-else /> | ||
9 | + </template> | ||
10 | + <template #[item]="data" v-for="item in getHeaderSlots"> | ||
11 | + <slot :name="item" v-bind="data" /> | ||
12 | + </template> | ||
13 | + </PageHeader> | ||
14 | + <div :class="[`${prefixCls}-content`, $attrs.contentClass]" :style="getContentStyle"> | ||
15 | + <slot /> | ||
16 | + </div> | ||
17 | + <PageFooter v-if="getShowFooter" ref="footerRef"> | ||
18 | + <template #left> | ||
19 | + <slot name="leftFooter" /> | ||
20 | + </template> | ||
21 | + <template #right> | ||
22 | + <slot name="rightFooter" /> | ||
23 | + </template> | ||
24 | + </PageFooter> | ||
25 | + </div> | ||
26 | +</template> | ||
27 | +<script lang="ts"> | ||
28 | + import type { CSSProperties, PropType } from 'vue'; | ||
29 | + | ||
30 | + import { defineComponent, computed, watch, nextTick, ref, unref } from 'vue'; | ||
31 | + import PageFooter from './PageFooter.vue'; | ||
32 | + import { usePageContext } from '/@/hooks/component/usePageContext'; | ||
33 | + | ||
34 | + import { useDesign } from '/@/hooks/web/useDesign'; | ||
35 | + import { propTypes } from '/@/utils/propTypes'; | ||
36 | + import { omit } from 'lodash-es'; | ||
37 | + import { PageHeader } from 'ant-design-vue'; | ||
38 | + export default defineComponent({ | ||
39 | + name: 'PageWrapper', | ||
40 | + components: { PageFooter, PageHeader }, | ||
41 | + props: { | ||
42 | + dense: propTypes.bool, | ||
43 | + ghost: propTypes.bool, | ||
44 | + content: propTypes.string, | ||
45 | + contentStyle: { | ||
46 | + type: Object as PropType<CSSProperties>, | ||
47 | + }, | ||
48 | + contentBackgrond: propTypes.bool, | ||
49 | + contentFullHeight: propTypes.bool, | ||
50 | + }, | ||
51 | + setup(props, { slots }) { | ||
52 | + const headerRef = ref<ComponentRef>(null); | ||
53 | + const footerRef = ref<ComponentRef>(null); | ||
54 | + const { prefixCls } = useDesign('page-wrapper'); | ||
55 | + const { contentHeight, setPageHeight, pageHeight } = usePageContext(); | ||
56 | + | ||
57 | + const getClass = computed(() => { | ||
58 | + return [ | ||
59 | + prefixCls, | ||
60 | + { | ||
61 | + [`${prefixCls}--dense`]: props.dense, | ||
62 | + }, | ||
63 | + ]; | ||
64 | + }); | ||
65 | + | ||
66 | + const getShowFooter = computed(() => slots?.leftFooter || slots?.rightFooter); | ||
67 | + | ||
68 | + const getHeaderSlots = computed(() => { | ||
69 | + return Object.keys(omit(slots, 'default', 'leftFooter', 'rightFooter', 'headerContent')); | ||
70 | + }); | ||
71 | + | ||
72 | + const getContentStyle = computed( | ||
73 | + (): CSSProperties => { | ||
74 | + const { contentBackgrond, contentFullHeight, contentStyle } = props; | ||
75 | + const bg = contentBackgrond ? { backgroundColor: '#fff' } : {}; | ||
76 | + if (!contentFullHeight) { | ||
77 | + return { ...bg, ...contentStyle }; | ||
78 | + } | ||
79 | + return { | ||
80 | + ...bg, | ||
81 | + ...contentStyle, | ||
82 | + minHeight: `${unref(pageHeight)}px`, | ||
83 | + }; | ||
84 | + } | ||
85 | + ); | ||
86 | + | ||
87 | + watch( | ||
88 | + () => contentHeight?.value, | ||
89 | + (height) => { | ||
90 | + if (!props.contentFullHeight) { | ||
91 | + return; | ||
92 | + } | ||
93 | + nextTick(() => { | ||
94 | + const footer = unref(footerRef); | ||
95 | + const header = unref(headerRef); | ||
96 | + let footetHeight = 0; | ||
97 | + const footerEl = footer?.$el; | ||
98 | + if (footerEl) { | ||
99 | + footetHeight += footerEl?.offsetHeight ?? 0; | ||
100 | + } | ||
101 | + let headerHeight = 0; | ||
102 | + const headerEl = header?.$el; | ||
103 | + if (headerEl) { | ||
104 | + headerHeight += headerEl?.offsetHeight ?? 0; | ||
105 | + } | ||
106 | + setPageHeight?.(height - footetHeight - headerHeight); | ||
107 | + }); | ||
108 | + }, | ||
109 | + { | ||
110 | + immediate: true, | ||
111 | + } | ||
112 | + ); | ||
113 | + | ||
114 | + return { | ||
115 | + getContentStyle, | ||
116 | + footerRef, | ||
117 | + headerRef, | ||
118 | + getClass, | ||
119 | + getHeaderSlots, | ||
120 | + prefixCls, | ||
121 | + getShowFooter, | ||
122 | + pageHeight, | ||
123 | + omit, | ||
124 | + }; | ||
125 | + }, | ||
126 | + }); | ||
127 | +</script> | ||
128 | +<style lang="less"> | ||
129 | + @prefix-cls: ~'@{namespace}-page-wrapper'; | ||
130 | + | ||
131 | + .@{prefix-cls} { | ||
132 | + position: relative; | ||
133 | + | ||
134 | + .ant-page-header { | ||
135 | + padding: 12px 16px; | ||
136 | + | ||
137 | + &:empty { | ||
138 | + padding: 0; | ||
139 | + } | ||
140 | + } | ||
141 | + | ||
142 | + &-content { | ||
143 | + // padding: 12px; | ||
144 | + margin: 16px; | ||
145 | + } | ||
146 | + | ||
147 | + &--dense { | ||
148 | + .@{prefix-cls}-content { | ||
149 | + margin: 0; | ||
150 | + } | ||
151 | + } | ||
152 | + } | ||
153 | +</style> |
src/components/Table/src/hooks/useDataSource.ts
@@ -7,7 +7,7 @@ import { useTimeoutFn } from '/@/hooks/core/useTimeout'; | @@ -7,7 +7,7 @@ import { useTimeoutFn } from '/@/hooks/core/useTimeout'; | ||
7 | 7 | ||
8 | import { buildUUID } from '/@/utils/uuid'; | 8 | import { buildUUID } from '/@/utils/uuid'; |
9 | import { isFunction, isBoolean } from '/@/utils/is'; | 9 | import { isFunction, isBoolean } from '/@/utils/is'; |
10 | -import { get } from 'lodash-es'; | 10 | +import { get, cloneDeep } from 'lodash-es'; |
11 | 11 | ||
12 | import { FETCH_SETTING, ROW_KEY, PAGE_SIZE } from '../const'; | 12 | import { FETCH_SETTING, ROW_KEY, PAGE_SIZE } from '../const'; |
13 | 13 | ||
@@ -114,7 +114,8 @@ export function useDataSource( | @@ -114,7 +114,8 @@ export function useDataSource( | ||
114 | 114 | ||
115 | if (firstItem && lastItem) { | 115 | if (firstItem && lastItem) { |
116 | if (!firstItem[ROW_KEY] || !lastItem[ROW_KEY]) { | 116 | if (!firstItem[ROW_KEY] || !lastItem[ROW_KEY]) { |
117 | - unref(dataSourceRef).forEach((item) => { | 117 | + const data = cloneDeep(unref(dataSourceRef)); |
118 | + data.forEach((item) => { | ||
118 | if (!item[ROW_KEY]) { | 119 | if (!item[ROW_KEY]) { |
119 | item[ROW_KEY] = buildUUID(); | 120 | item[ROW_KEY] = buildUUID(); |
120 | } | 121 | } |
@@ -122,6 +123,7 @@ export function useDataSource( | @@ -122,6 +123,7 @@ export function useDataSource( | ||
122 | setTableKey(item.children); | 123 | setTableKey(item.children); |
123 | } | 124 | } |
124 | }); | 125 | }); |
126 | + dataSourceRef.value = data; | ||
125 | } | 127 | } |
126 | } | 128 | } |
127 | } | 129 | } |
src/components/Upload/index.ts
1 | -import { createAsyncComponent } from '/@/utils/factory/createAsyncComponent'; | ||
2 | -export const BasicUpload = createAsyncComponent(() => import('./src/BasicUpload.vue')); | 1 | +// import { createAsyncComponent } from '/@/utils/factory/createAsyncComponent'; |
2 | +// export const BasicUpload = createAsyncComponent(() => import('./src/BasicUpload.vue')); | ||
3 | + | ||
4 | +export { default as BasicUpload } from './src/BasicUpload.vue'; |
src/hooks/component/usePageContext.ts
0 → 100644
1 | +import type { InjectionKey, ComputedRef, Ref } from 'vue'; | ||
2 | +import { createContext, useContext } from '/@/hooks/core/useContext'; | ||
3 | + | ||
4 | +import {} from 'vue'; | ||
5 | + | ||
6 | +export interface PageContextProps { | ||
7 | + contentHeight: ComputedRef<number>; | ||
8 | + pageHeight: Ref<number>; | ||
9 | + setPageHeight: (height: number) => Promise<void>; | ||
10 | +} | ||
11 | + | ||
12 | +const key: InjectionKey<PageContextProps> = Symbol(); | ||
13 | + | ||
14 | +export function createPageContext(context: PageContextProps) { | ||
15 | + return createContext<PageContextProps>(context, key, { native: true }); | ||
16 | +} | ||
17 | + | ||
18 | +export function usePageContext() { | ||
19 | + return useContext<PageContextProps>(key); | ||
20 | +} |
src/hooks/core/useContext.ts
@@ -11,6 +11,7 @@ import { | @@ -11,6 +11,7 @@ import { | ||
11 | export interface CreateContextOptions { | 11 | export interface CreateContextOptions { |
12 | readonly?: boolean; | 12 | readonly?: boolean; |
13 | createProvider?: boolean; | 13 | createProvider?: boolean; |
14 | + native?: boolean; | ||
14 | } | 15 | } |
15 | 16 | ||
16 | type ShallowUnwrap<T> = { | 17 | type ShallowUnwrap<T> = { |
@@ -22,11 +23,11 @@ export function createContext<T>( | @@ -22,11 +23,11 @@ export function createContext<T>( | ||
22 | key: InjectionKey<T> = Symbol(), | 23 | key: InjectionKey<T> = Symbol(), |
23 | options: CreateContextOptions = {} | 24 | options: CreateContextOptions = {} |
24 | ) { | 25 | ) { |
25 | - const { readonly = true, createProvider = false } = options; | 26 | + const { readonly = true, createProvider = false, native = false } = options; |
26 | 27 | ||
27 | const state = reactive(context); | 28 | const state = reactive(context); |
28 | const provideData = readonly ? defineReadonly(state) : state; | 29 | const provideData = readonly ? defineReadonly(state) : state; |
29 | - !createProvider && provide(key, provideData); | 30 | + !createProvider && provide(key, native ? context : provideData); |
30 | 31 | ||
31 | const Provider = createProvider | 32 | const Provider = createProvider |
32 | ? defineComponent({ | 33 | ? defineComponent({ |
@@ -42,12 +43,12 @@ export function createContext<T>( | @@ -42,12 +43,12 @@ export function createContext<T>( | ||
42 | return { Provider, state }; | 43 | return { Provider, state }; |
43 | } | 44 | } |
44 | 45 | ||
45 | -export const useContext = <T>( | ||
46 | - key: InjectionKey<T> = Symbol(), | ||
47 | - defaultValue?: any, | ||
48 | - readonly = false | ||
49 | -): ShallowUnwrap<T> => { | ||
50 | - const state = inject(key, defaultValue || {}); | 46 | +export function useContext<T>(key: InjectionKey<T>, native?: boolean): T; |
47 | +export function useContext<T>(key: InjectionKey<T>, defaultValue?: any, native?: boolean): T; | ||
51 | 48 | ||
52 | - return readonly ? defineReadonly(state) : state; | ||
53 | -}; | 49 | +export function useContext<T>( |
50 | + key: InjectionKey<T> = Symbol(), | ||
51 | + defaultValue?: any | ||
52 | +): ShallowUnwrap<T> { | ||
53 | + return inject(key, defaultValue || {}); | ||
54 | +} |
src/layouts/default/content/index.vue
@@ -19,6 +19,7 @@ | @@ -19,6 +19,7 @@ | ||
19 | import { useRootSetting } from '/@/hooks/setting/useRootSetting'; | 19 | import { useRootSetting } from '/@/hooks/setting/useRootSetting'; |
20 | import { useTransitionSetting } from '/@/hooks/setting/useTransitionSetting'; | 20 | import { useTransitionSetting } from '/@/hooks/setting/useTransitionSetting'; |
21 | import PageLayout from '/@/layouts/page/index'; | 21 | import PageLayout from '/@/layouts/page/index'; |
22 | + import { useContentViewHeight } from './useContentViewHeight'; | ||
22 | import { Loading } from '/@/components/Loading'; | 23 | import { Loading } from '/@/components/Loading'; |
23 | 24 | ||
24 | export default defineComponent({ | 25 | export default defineComponent({ |
@@ -28,6 +29,8 @@ | @@ -28,6 +29,8 @@ | ||
28 | const { prefixCls } = useDesign('layout-content'); | 29 | const { prefixCls } = useDesign('layout-content'); |
29 | const { getOpenPageLoading } = useTransitionSetting(); | 30 | const { getOpenPageLoading } = useTransitionSetting(); |
30 | const { getLayoutContentMode, getPageLoading } = useRootSetting(); | 31 | const { getLayoutContentMode, getPageLoading } = useRootSetting(); |
32 | + | ||
33 | + useContentViewHeight(); | ||
31 | return { | 34 | return { |
32 | prefixCls, | 35 | prefixCls, |
33 | getOpenPageLoading, | 36 | getOpenPageLoading, |
src/layouts/default/content/useContentContext.ts
0 → 100644
1 | +import type { InjectionKey, ComputedRef } from 'vue'; | ||
2 | +import { createContext, useContext } from '/@/hooks/core/useContext'; | ||
3 | + | ||
4 | +import {} from 'vue'; | ||
5 | + | ||
6 | +export interface ContentContextProps { | ||
7 | + contentHeight: ComputedRef<number>; | ||
8 | + setPageHeight: (height: number) => Promise<void>; | ||
9 | +} | ||
10 | + | ||
11 | +const key: InjectionKey<ContentContextProps> = Symbol(); | ||
12 | + | ||
13 | +export function createContentContext(context: ContentContextProps) { | ||
14 | + return createContext<ContentContextProps>(context, key, { native: true }); | ||
15 | +} | ||
16 | + | ||
17 | +export function useContentContext() { | ||
18 | + return useContext<ContentContextProps>(key); | ||
19 | +} |
src/layouts/default/content/useContentViewHeight.ts
0 → 100644
1 | +import { ref, computed, unref } from 'vue'; | ||
2 | +import { createPageContext } from '/@/hooks/component/usePageContext'; | ||
3 | +import { useWindowSizeFn } from '/@/hooks/event/useWindowSizeFn'; | ||
4 | +export const headerHeightRef = ref(0); | ||
5 | + | ||
6 | +export function useContentViewHeight() { | ||
7 | + const contentHeight = ref(window.innerHeight); | ||
8 | + const pageHeight = ref(window.innerHeight); | ||
9 | + const getViewHeight = computed(() => { | ||
10 | + return unref(contentHeight) - unref(headerHeightRef) || 0; | ||
11 | + }); | ||
12 | + | ||
13 | + useWindowSizeFn( | ||
14 | + () => { | ||
15 | + contentHeight.value = window.innerHeight; | ||
16 | + }, | ||
17 | + 100, | ||
18 | + { immediate: true } | ||
19 | + ); | ||
20 | + | ||
21 | + async function setPageHeight(height: number) { | ||
22 | + pageHeight.value = height; | ||
23 | + } | ||
24 | + | ||
25 | + createPageContext({ | ||
26 | + contentHeight: getViewHeight, | ||
27 | + setPageHeight, | ||
28 | + pageHeight, | ||
29 | + }); | ||
30 | +} |
src/layouts/default/header/MultipleHeader.vue
@@ -17,6 +17,7 @@ | @@ -17,6 +17,7 @@ | ||
17 | import { useMultipleTabSetting } from '/@/hooks/setting/useMultipleTabSetting'; | 17 | import { useMultipleTabSetting } from '/@/hooks/setting/useMultipleTabSetting'; |
18 | import { useAppInject } from '/@/hooks/web/useAppInject'; | 18 | import { useAppInject } from '/@/hooks/web/useAppInject'; |
19 | import { useDesign } from '/@/hooks/web/useDesign'; | 19 | import { useDesign } from '/@/hooks/web/useDesign'; |
20 | + import { headerHeightRef } from '../content/useContentViewHeight'; | ||
20 | 21 | ||
21 | const HEADER_HEIGHT = 48; | 22 | const HEADER_HEIGHT = 48; |
22 | 23 | ||
@@ -75,6 +76,7 @@ | @@ -75,6 +76,7 @@ | ||
75 | if (unref(getShowMultipleTab)) { | 76 | if (unref(getShowMultipleTab)) { |
76 | height += TABS_HEIGHT; | 77 | height += TABS_HEIGHT; |
77 | } | 78 | } |
79 | + headerHeightRef.value = height; | ||
78 | return { | 80 | return { |
79 | height: `${height}px`, | 81 | height: `${height}px`, |
80 | }; | 82 | }; |
src/layouts/page/index.tsx
1 | -import type { FunctionalComponent } from 'vue'; | ||
2 | import type { DefaultContext } from './transition'; | 1 | import type { DefaultContext } from './transition'; |
3 | 2 | ||
4 | import { computed, defineComponent, unref, Transition, KeepAlive } from 'vue'; | 3 | import { computed, defineComponent, unref, Transition, KeepAlive } from 'vue'; |
5 | -import { RouterView, RouteLocation } from 'vue-router'; | 4 | +import { RouterView } from 'vue-router'; |
6 | 5 | ||
7 | import FrameLayout from '/@/layouts/iframe/index.vue'; | 6 | import FrameLayout from '/@/layouts/iframe/index.vue'; |
8 | 7 | ||
@@ -12,14 +11,7 @@ import { useTransitionSetting } from '/@/hooks/setting/useTransitionSetting'; | @@ -12,14 +11,7 @@ import { useTransitionSetting } from '/@/hooks/setting/useTransitionSetting'; | ||
12 | import { useCache } from './useCache'; | 11 | import { useCache } from './useCache'; |
13 | import { useMultipleTabSetting } from '/@/hooks/setting/useMultipleTabSetting'; | 12 | import { useMultipleTabSetting } from '/@/hooks/setting/useMultipleTabSetting'; |
14 | import { getTransitionName } from './transition'; | 13 | import { getTransitionName } from './transition'; |
15 | -// import { createAsyncComponent } from '/@/utils/factory/createAsyncComponent'; | ||
16 | 14 | ||
17 | -interface DefaultContext { | ||
18 | - Component: FunctionalComponent & { type: Indexable }; | ||
19 | - route: RouteLocation; | ||
20 | -} | ||
21 | - | ||
22 | -// const FrameLayout=createAsyncComponent(()=>'/@/layouts/iframe/index.vue') | ||
23 | export default defineComponent({ | 15 | export default defineComponent({ |
24 | name: 'PageLayout', | 16 | name: 'PageLayout', |
25 | setup() { | 17 | setup() { |
src/settings/projectSetting.ts
@@ -85,7 +85,7 @@ const setting: ProjectConfig = { | @@ -85,7 +85,7 @@ const setting: ProjectConfig = { | ||
85 | collapsedShowTitle: false, | 85 | collapsedShowTitle: false, |
86 | // Whether it can be dragged | 86 | // Whether it can be dragged |
87 | // Only limited to the opening of the left menu, the mouse has a drag bar on the right side of the menu | 87 | // Only limited to the opening of the left menu, the mouse has a drag bar on the right side of the menu |
88 | - canDrag: true, | 88 | + canDrag: false, |
89 | // Whether to show no dom | 89 | // Whether to show no dom |
90 | show: true, | 90 | show: true, |
91 | // Whether to show dom | 91 | // Whether to show dom |
src/views/demo/comp/button/index.vue
1 | <template> | 1 | <template> |
2 | - <div class="p-4"> | ||
3 | - <Alert | ||
4 | - message="温馨提醒" | ||
5 | - description="基础组件依赖于 ant-design-vue,组件库已有的基础组件,项目中不会再次进行demo展示(二次封装组件除外)" | ||
6 | - type="info" | ||
7 | - show-icon | ||
8 | - /> | 2 | + <PageWrapper |
3 | + title="基础组件" | ||
4 | + content=" 基础组件依赖于ant-design-vue,组件库已有的基础组件,项目中不会再次进行demo展示(二次封装组件除外)" | ||
5 | + > | ||
6 | + <template #rightFooter> | ||
7 | + <a-button type="primary">确认</a-button> | ||
8 | + </template> | ||
9 | 9 | ||
10 | <div class="my-2"> | 10 | <div class="my-2"> |
11 | <h3>success</h3> | 11 | <h3>success</h3> |
@@ -73,15 +73,12 @@ | @@ -73,15 +73,12 @@ | ||
73 | <a-button type="dashed" class="ml-2" disabled> 禁用 </a-button> | 73 | <a-button type="dashed" class="ml-2" disabled> 禁用 </a-button> |
74 | <a-button type="dashed" class="ml-2" loading> loading </a-button> | 74 | <a-button type="dashed" class="ml-2" loading> loading </a-button> |
75 | </div> | 75 | </div> |
76 | - </div> | 76 | + </PageWrapper> |
77 | </template> | 77 | </template> |
78 | <script lang="ts"> | 78 | <script lang="ts"> |
79 | import { defineComponent } from 'vue'; | 79 | import { defineComponent } from 'vue'; |
80 | - import { Alert } from 'ant-design-vue'; | 80 | + import { PageWrapper } from '/@/components/Page'; |
81 | export default defineComponent({ | 81 | export default defineComponent({ |
82 | - components: { Alert }, | ||
83 | - setup() { | ||
84 | - return {}; | ||
85 | - }, | 82 | + components: { PageWrapper }, |
86 | }); | 83 | }); |
87 | </script> | 84 | </script> |
src/views/demo/comp/count-to/index.vue
1 | <template> | 1 | <template> |
2 | - <div class="p-4 count-to-demo"> | 2 | + <PageWrapper title="数字动画示例"> |
3 | <Card> | 3 | <Card> |
4 | <CardGrid class="count-to-demo-card"> | 4 | <CardGrid class="count-to-demo-card"> |
5 | <CountTo prefix="$" :startVal="1" :endVal="200000" :duration="8000" /> | 5 | <CountTo prefix="$" :startVal="1" :endVal="200000" :duration="8000" /> |
@@ -14,20 +14,20 @@ | @@ -14,20 +14,20 @@ | ||
14 | <CountTo separator="-" :startVal="10000" :endVal="500000" :duration="8000" /> | 14 | <CountTo separator="-" :startVal="10000" :endVal="500000" :duration="8000" /> |
15 | </CardGrid> | 15 | </CardGrid> |
16 | </Card> | 16 | </Card> |
17 | - </div> | 17 | + </PageWrapper> |
18 | </template> | 18 | </template> |
19 | <script lang="ts"> | 19 | <script lang="ts"> |
20 | import { defineComponent } from 'vue'; | 20 | import { defineComponent } from 'vue'; |
21 | import { Card } from 'ant-design-vue'; | 21 | import { Card } from 'ant-design-vue'; |
22 | import { CountTo } from '/@/components/CountTo/index'; | 22 | import { CountTo } from '/@/components/CountTo/index'; |
23 | + import { PageWrapper } from '/@/components/Page'; | ||
24 | + | ||
23 | export default defineComponent({ | 25 | export default defineComponent({ |
24 | components: { | 26 | components: { |
25 | Card, | 27 | Card, |
26 | CardGrid: Card.Grid, | 28 | CardGrid: Card.Grid, |
27 | CountTo, | 29 | CountTo, |
28 | - }, | ||
29 | - setup() { | ||
30 | - return {}; | 30 | + PageWrapper, |
31 | }, | 31 | }, |
32 | }); | 32 | }); |
33 | </script> | 33 | </script> |
src/views/demo/comp/desc/index.vue
1 | <template> | 1 | <template> |
2 | - <div class="p-4"> | 2 | + <PageWrapper title="详情组件示例"> |
3 | <Description | 3 | <Description |
4 | title="基础示例" | 4 | title="基础示例" |
5 | :collapseOptions="{ canExpand: true, helpMessage: 'help me' }" | 5 | :collapseOptions="{ canExpand: true, helpMessage: 'help me' }" |
@@ -20,13 +20,14 @@ | @@ -20,13 +20,14 @@ | ||
20 | 20 | ||
21 | <Description @register="register" class="mt-4" /> | 21 | <Description @register="register" class="mt-4" /> |
22 | <Description @register="register1" class="mt-4" /> | 22 | <Description @register="register1" class="mt-4" /> |
23 | - </div> | 23 | + </PageWrapper> |
24 | </template> | 24 | </template> |
25 | <script lang="ts"> | 25 | <script lang="ts"> |
26 | import { defineComponent } from 'vue'; | 26 | import { defineComponent } from 'vue'; |
27 | - import { Alert } from 'ant-design-vue'; | ||
28 | import { Description, DescItem, useDescription } from '/@/components/Description/index'; | 27 | import { Description, DescItem, useDescription } from '/@/components/Description/index'; |
29 | - const mockData: any = { | 28 | + import { PageWrapper } from '/@/components/Page'; |
29 | + | ||
30 | + const mockData: Recordable = { | ||
30 | username: 'test', | 31 | username: 'test', |
31 | nickName: 'VB', | 32 | nickName: 'VB', |
32 | age: 25, | 33 | age: 25, |
@@ -63,7 +64,7 @@ | @@ -63,7 +64,7 @@ | ||
63 | }, | 64 | }, |
64 | ]; | 65 | ]; |
65 | export default defineComponent({ | 66 | export default defineComponent({ |
66 | - components: { Description, Alert }, | 67 | + components: { Description, PageWrapper }, |
67 | setup() { | 68 | setup() { |
68 | const [register] = useDescription({ | 69 | const [register] = useDescription({ |
69 | title: 'useDescription', | 70 | title: 'useDescription', |
src/views/demo/comp/drawer/index.vue
1 | <template> | 1 | <template> |
2 | - <div class="px-10 py-4"> | 2 | + <PageWrapper title="抽屉组件使用示例"> |
3 | <Alert message="使用 useDrawer 进行抽屉操作" show-icon /> | 3 | <Alert message="使用 useDrawer 进行抽屉操作" show-icon /> |
4 | <a-button type="primary" class="my-4" @click="openDrawerLoading">打开Drawer</a-button> | 4 | <a-button type="primary" class="my-4" @click="openDrawerLoading">打开Drawer</a-button> |
5 | 5 | ||
@@ -20,7 +20,7 @@ | @@ -20,7 +20,7 @@ | ||
20 | <Drawer3 @register="register3" /> | 20 | <Drawer3 @register="register3" /> |
21 | <Drawer4 @register="register4" /> | 21 | <Drawer4 @register="register4" /> |
22 | <Drawer5 @register="register5" /> | 22 | <Drawer5 @register="register5" /> |
23 | - </div> | 23 | + </PageWrapper> |
24 | </template> | 24 | </template> |
25 | <script lang="ts"> | 25 | <script lang="ts"> |
26 | import { defineComponent } from 'vue'; | 26 | import { defineComponent } from 'vue'; |
@@ -31,9 +31,10 @@ | @@ -31,9 +31,10 @@ | ||
31 | import Drawer3 from './Drawer3.vue'; | 31 | import Drawer3 from './Drawer3.vue'; |
32 | import Drawer4 from './Drawer4.vue'; | 32 | import Drawer4 from './Drawer4.vue'; |
33 | import Drawer5 from './Drawer5.vue'; | 33 | import Drawer5 from './Drawer5.vue'; |
34 | + import { PageWrapper } from '/@/components/Page'; | ||
34 | 35 | ||
35 | export default defineComponent({ | 36 | export default defineComponent({ |
36 | - components: { Alert, Drawer1, Drawer2, Drawer3, Drawer4, Drawer5 }, | 37 | + components: { Alert, PageWrapper, Drawer1, Drawer2, Drawer3, Drawer4, Drawer5 }, |
37 | setup() { | 38 | setup() { |
38 | const [register1, { openDrawer: openDrawer1, setDrawerProps }] = useDrawer(); | 39 | const [register1, { openDrawer: openDrawer1, setDrawerProps }] = useDrawer(); |
39 | const [register2, { openDrawer: openDrawer2 }] = useDrawer(); | 40 | const [register2, { openDrawer: openDrawer2 }] = useDrawer(); |
src/views/demo/comp/lazy/Transition.vue
1 | <template> | 1 | <template> |
2 | - <div class="p-4 lazy-base-demo"> | ||
3 | - <Alert message="自定义动画" description="懒加载组件显示动画" type="info" show-icon /> | 2 | + <PageWrapper title="懒加载自定义动画示例" content="懒加载组件显示动画"> |
4 | <div class="lazy-base-demo-wrap"> | 3 | <div class="lazy-base-demo-wrap"> |
5 | <h1>向下滚动</h1> | 4 | <h1>向下滚动</h1> |
6 | 5 | ||
@@ -10,18 +9,17 @@ | @@ -10,18 +9,17 @@ | ||
10 | </LazyContainer> | 9 | </LazyContainer> |
11 | </div> | 10 | </div> |
12 | </div> | 11 | </div> |
13 | - </div> | 12 | + </PageWrapper> |
14 | </template> | 13 | </template> |
15 | <script lang="ts"> | 14 | <script lang="ts"> |
16 | import { defineComponent } from 'vue'; | 15 | import { defineComponent } from 'vue'; |
17 | - import { Skeleton, Alert } from 'ant-design-vue'; | 16 | + import { Skeleton } from 'ant-design-vue'; |
18 | import TargetContent from './TargetContent.vue'; | 17 | import TargetContent from './TargetContent.vue'; |
19 | import { LazyContainer } from '/@/components/Container/index'; | 18 | import { LazyContainer } from '/@/components/Container/index'; |
19 | + import { PageWrapper } from '/@/components/Page'; | ||
20 | + | ||
20 | export default defineComponent({ | 21 | export default defineComponent({ |
21 | - components: { LazyContainer, TargetContent, Skeleton, Alert }, | ||
22 | - setup() { | ||
23 | - return {}; | ||
24 | - }, | 22 | + components: { LazyContainer, TargetContent, Skeleton, PageWrapper }, |
25 | }); | 23 | }); |
26 | </script> | 24 | </script> |
27 | <style lang="less"> | 25 | <style lang="less"> |
src/views/demo/comp/lazy/index.vue
1 | <template> | 1 | <template> |
2 | - <div class="p-4 lazy-base-demo"> | ||
3 | - <Alert message="基础示例" description="向下滚动到可见区域才会加载组件" type="info" show-icon /> | 2 | + <PageWrapper title="懒加载基础示例" content="向下滚动到可见区域才会加载组件"> |
4 | <div class="lazy-base-demo-wrap"> | 3 | <div class="lazy-base-demo-wrap"> |
5 | <h1>向下滚动</h1> | 4 | <h1>向下滚动</h1> |
6 | 5 | ||
@@ -13,18 +12,17 @@ | @@ -13,18 +12,17 @@ | ||
13 | </LazyContainer> | 12 | </LazyContainer> |
14 | </div> | 13 | </div> |
15 | </div> | 14 | </div> |
16 | - </div> | 15 | + </PageWrapper> |
17 | </template> | 16 | </template> |
18 | <script lang="ts"> | 17 | <script lang="ts"> |
19 | import { defineComponent } from 'vue'; | 18 | import { defineComponent } from 'vue'; |
20 | - import { Skeleton, Alert } from 'ant-design-vue'; | 19 | + import { Skeleton } from 'ant-design-vue'; |
21 | import TargetContent from './TargetContent.vue'; | 20 | import TargetContent from './TargetContent.vue'; |
22 | import { LazyContainer } from '/@/components/Container/index'; | 21 | import { LazyContainer } from '/@/components/Container/index'; |
22 | + import { PageWrapper } from '/@/components/Page'; | ||
23 | + | ||
23 | export default defineComponent({ | 24 | export default defineComponent({ |
24 | - components: { LazyContainer, TargetContent, Skeleton, Alert }, | ||
25 | - setup() { | ||
26 | - return {}; | ||
27 | - }, | 25 | + components: { LazyContainer, PageWrapper, TargetContent, Skeleton }, |
28 | }); | 26 | }); |
29 | </script> | 27 | </script> |
30 | <style lang="less"> | 28 | <style lang="less"> |
src/views/demo/comp/loading/index.vue
1 | <template> | 1 | <template> |
2 | - <div class="p-5" ref="wrapEl" v-loading="loadingRef" loading-tip="加载中..."> | 2 | + <PageWrapper v-loading="loadingRef" loading-tip="加载中..." title="Loading组件示例"> |
3 | <a-alert message="组件方式" /> | 3 | <a-alert message="组件方式" /> |
4 | <a-button class="my-4 mr-4" type="primary" @click="openCompFullLoading">全屏 Loading</a-button> | 4 | <a-button class="my-4 mr-4" type="primary" @click="openCompFullLoading">全屏 Loading</a-button> |
5 | <a-button class="my-4" type="primary" @click="openCompAbsolute">容器内 Loading</a-button> | 5 | <a-button class="my-4" type="primary" @click="openCompAbsolute">容器内 Loading</a-button> |
@@ -14,13 +14,15 @@ | @@ -14,13 +14,15 @@ | ||
14 | <a-button class="my-4 mr-4" type="primary" @click="openDirectiveLoading"> | 14 | <a-button class="my-4 mr-4" type="primary" @click="openDirectiveLoading"> |
15 | 打开指令Loading | 15 | 打开指令Loading |
16 | </a-button> | 16 | </a-button> |
17 | - </div> | 17 | + </PageWrapper> |
18 | </template> | 18 | </template> |
19 | <script lang="ts"> | 19 | <script lang="ts"> |
20 | import { defineComponent, reactive, toRefs, ref } from 'vue'; | 20 | import { defineComponent, reactive, toRefs, ref } from 'vue'; |
21 | import { Loading, useLoading } from '/@/components/Loading'; | 21 | import { Loading, useLoading } from '/@/components/Loading'; |
22 | + import { PageWrapper } from '/@/components/Page'; | ||
23 | + | ||
22 | export default defineComponent({ | 24 | export default defineComponent({ |
23 | - components: { Loading }, | 25 | + components: { Loading, PageWrapper }, |
24 | setup() { | 26 | setup() { |
25 | const wrapEl = ref<ElRef>(null); | 27 | const wrapEl = ref<ElRef>(null); |
26 | 28 |
src/views/demo/comp/modal/index.vue
1 | <template> | 1 | <template> |
2 | - <div class="px-10 py-4"> | 2 | + <PageWrapper title="modal组件使用示例"> |
3 | <Alert | 3 | <Alert |
4 | message="使用 useModal 进行弹窗操作,默认可以拖动,可以通过 draggable | 4 | message="使用 useModal 进行弹窗操作,默认可以拖动,可以通过 draggable |
5 | 参数进行控制是否可以拖动/全屏" | 5 | 参数进行控制是否可以拖动/全屏" |
@@ -24,7 +24,7 @@ | @@ -24,7 +24,7 @@ | ||
24 | <Modal2 @register="register2" /> | 24 | <Modal2 @register="register2" /> |
25 | <Modal3 @register="register3" /> | 25 | <Modal3 @register="register3" /> |
26 | <Modal4 @register="register4" /> | 26 | <Modal4 @register="register4" /> |
27 | - </div> | 27 | + </PageWrapper> |
28 | </template> | 28 | </template> |
29 | <script lang="ts"> | 29 | <script lang="ts"> |
30 | import { defineComponent } from 'vue'; | 30 | import { defineComponent } from 'vue'; |
@@ -34,8 +34,10 @@ | @@ -34,8 +34,10 @@ | ||
34 | import Modal2 from './Modal2.vue'; | 34 | import Modal2 from './Modal2.vue'; |
35 | import Modal3 from './Modal3.vue'; | 35 | import Modal3 from './Modal3.vue'; |
36 | import Modal4 from './Modal4.vue'; | 36 | import Modal4 from './Modal4.vue'; |
37 | + import { PageWrapper } from '/@/components/Page'; | ||
38 | + | ||
37 | export default defineComponent({ | 39 | export default defineComponent({ |
38 | - components: { Alert, Modal1, Modal2, Modal3, Modal4 }, | 40 | + components: { Alert, Modal1, Modal2, Modal3, Modal4, PageWrapper }, |
39 | setup() { | 41 | setup() { |
40 | const [register1, { openModal: openModal1, setModalProps }] = useModal(); | 42 | const [register1, { openModal: openModal1, setModalProps }] = useModal(); |
41 | const [register2, { openModal: openModal2 }] = useModal(); | 43 | const [register2, { openModal: openModal2 }] = useModal(); |
src/views/demo/comp/qrcode/index.vue
1 | <template> | 1 | <template> |
2 | - <div class="p-4 flex flex-wrap"> | ||
3 | - <CollapseContainer title="基础示例" :canExpan="true" class="text-center mb-6 qrcode-demo-item"> | ||
4 | - <QrCode :value="qrCodeUrl" /> | ||
5 | - </CollapseContainer> | 2 | + <PageWrapper title="二维码组件使用示例"> |
3 | + <div class="flex flex-wrap"> | ||
4 | + <CollapseContainer | ||
5 | + title="基础示例" | ||
6 | + :canExpan="true" | ||
7 | + class="text-center mb-6 qrcode-demo-item" | ||
8 | + > | ||
9 | + <QrCode :value="qrCodeUrl" /> | ||
10 | + </CollapseContainer> | ||
6 | 11 | ||
7 | - <CollapseContainer title="渲染成img标签示例" class="text-center mb-6 qrcode-demo-item"> | ||
8 | - <QrCode :value="qrCodeUrl" tag="img" /> | ||
9 | - </CollapseContainer> | 12 | + <CollapseContainer title="渲染成img标签示例" class="text-center mb-6 qrcode-demo-item"> |
13 | + <QrCode :value="qrCodeUrl" tag="img" /> | ||
14 | + </CollapseContainer> | ||
10 | 15 | ||
11 | - <CollapseContainer title="配置样式示例" class="text-center mb-6 qrcode-demo-item"> | ||
12 | - <QrCode | ||
13 | - :value="qrCodeUrl" | ||
14 | - :options="{ | ||
15 | - color: { dark: '#55D187' }, | ||
16 | - }" | ||
17 | - /> | ||
18 | - </CollapseContainer> | 16 | + <CollapseContainer title="配置样式示例" class="text-center mb-6 qrcode-demo-item"> |
17 | + <QrCode | ||
18 | + :value="qrCodeUrl" | ||
19 | + :options="{ | ||
20 | + color: { dark: '#55D187' }, | ||
21 | + }" | ||
22 | + /> | ||
23 | + </CollapseContainer> | ||
19 | 24 | ||
20 | - <CollapseContainer title="本地logo示例" class="text-center mb-6 qrcode-demo-item"> | ||
21 | - <QrCode :value="qrCodeUrl" :logo="LogoImg" /> | ||
22 | - </CollapseContainer> | 25 | + <CollapseContainer title="本地logo示例" class="text-center mb-6 qrcode-demo-item"> |
26 | + <QrCode :value="qrCodeUrl" :logo="LogoImg" /> | ||
27 | + </CollapseContainer> | ||
23 | 28 | ||
24 | - <CollapseContainer title="在线logo示例" class="text-center mb-6 qrcode-demo-item"> | ||
25 | - <QrCode | ||
26 | - :value="qrCodeUrl" | ||
27 | - logo="https://vebn.oss-cn-beijing.aliyuncs.com/vben/logo.png" | ||
28 | - :options="{ | ||
29 | - color: { dark: '#55D187' }, | ||
30 | - }" | ||
31 | - /> | ||
32 | - </CollapseContainer> | 29 | + <CollapseContainer title="在线logo示例" class="text-center mb-6 qrcode-demo-item"> |
30 | + <QrCode | ||
31 | + :value="qrCodeUrl" | ||
32 | + logo="https://vebn.oss-cn-beijing.aliyuncs.com/vben/logo.png" | ||
33 | + :options="{ | ||
34 | + color: { dark: '#55D187' }, | ||
35 | + }" | ||
36 | + /> | ||
37 | + </CollapseContainer> | ||
33 | 38 | ||
34 | - <CollapseContainer title="logo配置示例" class="text-center mb-6 qrcode-demo-item"> | ||
35 | - <QrCode | ||
36 | - :value="qrCodeUrl" | ||
37 | - :logo="{ | ||
38 | - src: 'https://vebn.oss-cn-beijing.aliyuncs.com/vben/logo.png', | ||
39 | - logoSize: 0.2, | ||
40 | - borderSize: 0.05, | ||
41 | - borderRadius: 50, | ||
42 | - bgColor: 'blue', | ||
43 | - }" | ||
44 | - /> | ||
45 | - </CollapseContainer> | 39 | + <CollapseContainer title="logo配置示例" class="text-center mb-6 qrcode-demo-item"> |
40 | + <QrCode | ||
41 | + :value="qrCodeUrl" | ||
42 | + :logo="{ | ||
43 | + src: 'https://vebn.oss-cn-beijing.aliyuncs.com/vben/logo.png', | ||
44 | + logoSize: 0.2, | ||
45 | + borderSize: 0.05, | ||
46 | + borderRadius: 50, | ||
47 | + bgColor: 'blue', | ||
48 | + }" | ||
49 | + /> | ||
50 | + </CollapseContainer> | ||
46 | 51 | ||
47 | - <CollapseContainer title="下载示例" class="text-center qrcode-demo-item"> | ||
48 | - <QrCode :value="qrCodeUrl" ref="qrRef" :logo="LogoImg" /> | ||
49 | - <a-button class="mb-2" type="primary" @click="download"> 下载 </a-button> | ||
50 | - <div class="msg">(在线logo会导致图片跨域,需要下载图片需要自行解决跨域问题)</div> | ||
51 | - </CollapseContainer> | 52 | + <CollapseContainer title="下载示例" class="text-center qrcode-demo-item"> |
53 | + <QrCode :value="qrCodeUrl" ref="qrRef" :logo="LogoImg" /> | ||
54 | + <a-button class="mb-2" type="primary" @click="download"> 下载 </a-button> | ||
55 | + <div class="msg">(在线logo会导致图片跨域,需要下载图片需要自行解决跨域问题)</div> | ||
56 | + </CollapseContainer> | ||
52 | 57 | ||
53 | - <CollapseContainer title="配置大小示例" class="text-center qrcode-demo-item"> | ||
54 | - <QrCode :value="qrCodeUrl" :width="300" /> | ||
55 | - </CollapseContainer> | ||
56 | - </div> | 58 | + <CollapseContainer title="配置大小示例" class="text-center qrcode-demo-item"> |
59 | + <QrCode :value="qrCodeUrl" :width="300" /> | ||
60 | + </CollapseContainer> | ||
61 | + </div> | ||
62 | + </PageWrapper> | ||
57 | </template> | 63 | </template> |
58 | <script lang="ts"> | 64 | <script lang="ts"> |
59 | import { defineComponent, ref, unref } from 'vue'; | 65 | import { defineComponent, ref, unref } from 'vue'; |
60 | import { QrCode, QrCodeActionType } from '/@/components/Qrcode/index'; | 66 | import { QrCode, QrCodeActionType } from '/@/components/Qrcode/index'; |
61 | import LogoImg from '/@/assets/images/logo.png'; | 67 | import LogoImg from '/@/assets/images/logo.png'; |
62 | import { CollapseContainer } from '/@/components/Container/index'; | 68 | import { CollapseContainer } from '/@/components/Container/index'; |
69 | + import { PageWrapper } from '/@/components/Page'; | ||
70 | + | ||
63 | const qrCodeUrl = 'https://www.vvbin.cn'; | 71 | const qrCodeUrl = 'https://www.vvbin.cn'; |
64 | export default defineComponent({ | 72 | export default defineComponent({ |
65 | - components: { CollapseContainer, QrCode }, | 73 | + components: { CollapseContainer, QrCode, PageWrapper }, |
66 | setup() { | 74 | setup() { |
67 | const qrRef = ref<Nullable<QrCodeActionType>>(null); | 75 | const qrRef = ref<Nullable<QrCodeActionType>>(null); |
68 | function download() { | 76 | function download() { |
src/views/demo/comp/scroll/Action.vue
1 | <template> | 1 | <template> |
2 | - <div class="p-4"> | ||
3 | - <Alert message="抽取el-scrollbar,并对其进行扩展,滚动条美化,适用于各个浏览器" type="info" /> | ||
4 | - | 2 | + <PageWrapper title="滚动组件函数示例" content="基于el-scrollbar"> |
5 | <div class="my-4"> | 3 | <div class="my-4"> |
6 | <a-button @click="scrollTo(100)" class="mr-2">滚动到100px位置</a-button> | 4 | <a-button @click="scrollTo(100)" class="mr-2">滚动到100px位置</a-button> |
7 | <a-button @click="scrollTo(800)" class="mr-2">滚动到800px位置</a-button> | 5 | <a-button @click="scrollTo(800)" class="mr-2">滚动到800px位置</a-button> |
@@ -17,15 +15,16 @@ | @@ -17,15 +15,16 @@ | ||
17 | </ul> | 15 | </ul> |
18 | </ScrollContainer> | 16 | </ScrollContainer> |
19 | </div> | 17 | </div> |
20 | - </div> | 18 | + </PageWrapper> |
21 | </template> | 19 | </template> |
22 | <script lang="ts"> | 20 | <script lang="ts"> |
23 | import { defineComponent, ref, unref } from 'vue'; | 21 | import { defineComponent, ref, unref } from 'vue'; |
24 | import { CollapseContainer } from '/@/components/Container/index'; | 22 | import { CollapseContainer } from '/@/components/Container/index'; |
25 | import { ScrollContainer, ScrollActionType } from '/@/components/Container/index'; | 23 | import { ScrollContainer, ScrollActionType } from '/@/components/Container/index'; |
26 | - import { Alert } from 'ant-design-vue'; | 24 | + import { PageWrapper } from '/@/components/Page'; |
25 | + | ||
27 | export default defineComponent({ | 26 | export default defineComponent({ |
28 | - components: { CollapseContainer, ScrollContainer, Alert }, | 27 | + components: { CollapseContainer, ScrollContainer, PageWrapper }, |
29 | setup() { | 28 | setup() { |
30 | const scrollRef = ref<Nullable<ScrollActionType>>(null); | 29 | const scrollRef = ref<Nullable<ScrollActionType>>(null); |
31 | const getScroll = () => { | 30 | const getScroll = () => { |
src/views/demo/comp/scroll/VirtualScroll.vue
1 | <template> | 1 | <template> |
2 | - <div class="p-4 virtual-scroll-demo"> | 2 | + <PageWrapper class="virtual-scroll-demo"> |
3 | <Divider>基础滚动示例</Divider> | 3 | <Divider>基础滚动示例</Divider> |
4 | <div class="virtual-scroll-demo-wrap"> | 4 | <div class="virtual-scroll-demo-wrap"> |
5 | <VScroll :itemHeight="41" :items="data" :height="300" :width="300"> | 5 | <VScroll :itemHeight="41" :items="data" :height="300" :width="300"> |
@@ -17,15 +17,16 @@ | @@ -17,15 +17,16 @@ | ||
17 | </template> | 17 | </template> |
18 | </VScroll> | 18 | </VScroll> |
19 | </div> | 19 | </div> |
20 | - </div> | 20 | + </PageWrapper> |
21 | </template> | 21 | </template> |
22 | <script lang="ts"> | 22 | <script lang="ts"> |
23 | import { defineComponent } from 'vue'; | 23 | import { defineComponent } from 'vue'; |
24 | import { VScroll } from '/@/components/VirtualScroll/index'; | 24 | import { VScroll } from '/@/components/VirtualScroll/index'; |
25 | 25 | ||
26 | import { Divider } from 'ant-design-vue'; | 26 | import { Divider } from 'ant-design-vue'; |
27 | - const data: any[] = (() => { | ||
28 | - const arr: any[] = []; | 27 | + import { PageWrapper } from '/@/components/Page'; |
28 | + const data: Recordable[] = (() => { | ||
29 | + const arr: Recordable[] = []; | ||
29 | for (let index = 1; index < 20000; index++) { | 30 | for (let index = 1; index < 20000; index++) { |
30 | arr.push({ | 31 | arr.push({ |
31 | title: '列表项' + index, | 32 | title: '列表项' + index, |
@@ -34,7 +35,7 @@ | @@ -34,7 +35,7 @@ | ||
34 | return arr; | 35 | return arr; |
35 | })(); | 36 | })(); |
36 | export default defineComponent({ | 37 | export default defineComponent({ |
37 | - components: { VScroll: VScroll, Divider }, | 38 | + components: { VScroll: VScroll, Divider, PageWrapper }, |
38 | setup() { | 39 | setup() { |
39 | return { data: data }; | 40 | return { data: data }; |
40 | }, | 41 | }, |
src/views/demo/comp/scroll/index.vue
1 | <template> | 1 | <template> |
2 | - <div class="p-4"> | ||
3 | - <Alert message="抽取el-scrollbar,并对其进行扩展,滚动条美化,适用于各个浏览器" type="info" /> | 2 | + <PageWrapper title="滚动组件示例" content="基于el-scrollbar"> |
4 | <div class="scroll-wrap"> | 3 | <div class="scroll-wrap"> |
5 | <ScrollContainer class="mt-4"> | 4 | <ScrollContainer class="mt-4"> |
6 | <ul class="p-3"> | 5 | <ul class="p-3"> |
@@ -10,18 +9,16 @@ | @@ -10,18 +9,16 @@ | ||
10 | </ul> | 9 | </ul> |
11 | </ScrollContainer> | 10 | </ScrollContainer> |
12 | </div> | 11 | </div> |
13 | - </div> | 12 | + </PageWrapper> |
14 | </template> | 13 | </template> |
15 | <script lang="ts"> | 14 | <script lang="ts"> |
16 | import { defineComponent } from 'vue'; | 15 | import { defineComponent } from 'vue'; |
17 | import { CollapseContainer } from '/@/components/Container/index'; | 16 | import { CollapseContainer } from '/@/components/Container/index'; |
18 | import { ScrollContainer } from '/@/components/Container/index'; | 17 | import { ScrollContainer } from '/@/components/Container/index'; |
19 | - import { Alert } from 'ant-design-vue'; | 18 | + import { PageWrapper } from '/@/components/Page'; |
19 | + | ||
20 | export default defineComponent({ | 20 | export default defineComponent({ |
21 | - components: { CollapseContainer, ScrollContainer, Alert }, | ||
22 | - setup() { | ||
23 | - return {}; | ||
24 | - }, | 21 | + components: { CollapseContainer, ScrollContainer, PageWrapper }, |
25 | }); | 22 | }); |
26 | </script> | 23 | </script> |
27 | <style lang="less" scoped> | 24 | <style lang="less" scoped> |
src/views/demo/comp/strength-meter/index.vue
1 | <template> | 1 | <template> |
2 | - <div class="p-4 flex justify-center"> | ||
3 | - <div class="demo-wrap p-10"> | ||
4 | - <StrengthMeter placeholder="默认" /> | ||
5 | - <StrengthMeter placeholder="禁用" disabled /> | ||
6 | - <br /> | ||
7 | - <StrengthMeter placeholder="隐藏input" :show-input="false" value="!@#qwe12345" /> | 2 | + <PageWrapper title="密码强度校验组件"> |
3 | + <div class="flex justify-center"> | ||
4 | + <div class="demo-wrap p-10"> | ||
5 | + <StrengthMeter placeholder="默认" /> | ||
6 | + <StrengthMeter placeholder="禁用" disabled /> | ||
7 | + <br /> | ||
8 | + <StrengthMeter placeholder="隐藏input" :show-input="false" value="!@#qwe12345" /> | ||
9 | + </div> | ||
8 | </div> | 10 | </div> |
9 | - </div> | 11 | + </PageWrapper> |
10 | </template> | 12 | </template> |
11 | 13 | ||
12 | <script lang="ts"> | 14 | <script lang="ts"> |
13 | import { defineComponent } from 'vue'; | 15 | import { defineComponent } from 'vue'; |
14 | import { StrengthMeter } from '/@/components/StrengthMeter'; | 16 | import { StrengthMeter } from '/@/components/StrengthMeter'; |
17 | + import { PageWrapper } from '/@/components/Page'; | ||
18 | + | ||
15 | export default defineComponent({ | 19 | export default defineComponent({ |
16 | components: { | 20 | components: { |
17 | StrengthMeter, | 21 | StrengthMeter, |
18 | - }, | ||
19 | - setup() { | ||
20 | - return {}; | 22 | + PageWrapper, |
21 | }, | 23 | }, |
22 | }); | 24 | }); |
23 | </script> | 25 | </script> |
src/views/demo/comp/transition/index.vue
1 | <template> | 1 | <template> |
2 | - <div class="p-4"> | 2 | + <PageWrapper title="动画组件示例"> |
3 | <div class="flex"> | 3 | <div class="flex"> |
4 | <Select | 4 | <Select |
5 | :options="options" | 5 | :options="options" |
@@ -12,11 +12,12 @@ | @@ -12,11 +12,12 @@ | ||
12 | <component :is="`${value}Transition`"> | 12 | <component :is="`${value}Transition`"> |
13 | <div class="box" v-show="show"></div> | 13 | <div class="box" v-show="show"></div> |
14 | </component> | 14 | </component> |
15 | - </div> | 15 | + </PageWrapper> |
16 | </template> | 16 | </template> |
17 | <script lang="ts"> | 17 | <script lang="ts"> |
18 | import { defineComponent, ref } from 'vue'; | 18 | import { defineComponent, ref } from 'vue'; |
19 | import { Select } from 'ant-design-vue'; | 19 | import { Select } from 'ant-design-vue'; |
20 | + import { PageWrapper } from '/@/components/Page'; | ||
20 | import { | 21 | import { |
21 | FadeTransition, | 22 | FadeTransition, |
22 | ScaleTransition, | 23 | ScaleTransition, |
@@ -57,6 +58,7 @@ | @@ -57,6 +58,7 @@ | ||
57 | export default defineComponent({ | 58 | export default defineComponent({ |
58 | components: { | 59 | components: { |
59 | Select, | 60 | Select, |
61 | + PageWrapper, | ||
60 | FadeTransition, | 62 | FadeTransition, |
61 | ScaleTransition, | 63 | ScaleTransition, |
62 | SlideYTransition, | 64 | SlideYTransition, |
@@ -89,6 +91,6 @@ | @@ -89,6 +91,6 @@ | ||
89 | width: 150px; | 91 | width: 150px; |
90 | height: 150px; | 92 | height: 150px; |
91 | margin-top: 20px; | 93 | margin-top: 20px; |
92 | - background: pink; | 94 | + background: rgb(126, 170, 236); |
93 | } | 95 | } |
94 | </style> | 96 | </style> |
src/views/demo/comp/upload/index.vue
1 | <template> | 1 | <template> |
2 | - <div class="p-4"> | 2 | + <PageWrapper title="上传组件示例"> |
3 | <a-alert message="基础示例" class="my-5"></a-alert> | 3 | <a-alert message="基础示例" class="my-5"></a-alert> |
4 | <BasicUpload :maxSize="20" :maxNumber="10" @change="handleChange" :api="uploadApi" /> | 4 | <BasicUpload :maxSize="20" :maxNumber="10" @change="handleChange" :api="uploadApi" /> |
5 | 5 | ||
6 | <a-alert message="嵌入表单,加入表单校验" class="my-5"></a-alert> | 6 | <a-alert message="嵌入表单,加入表单校验" class="my-5"></a-alert> |
7 | 7 | ||
8 | <BasicForm @register="register" /> | 8 | <BasicForm @register="register" /> |
9 | - </div> | 9 | + </PageWrapper> |
10 | </template> | 10 | </template> |
11 | <script lang="ts"> | 11 | <script lang="ts"> |
12 | import { defineComponent } from 'vue'; | 12 | import { defineComponent } from 'vue'; |
13 | import { BasicUpload } from '/@/components/Upload'; | 13 | import { BasicUpload } from '/@/components/Upload'; |
14 | import { useMessage } from '/@/hooks/web/useMessage'; | 14 | import { useMessage } from '/@/hooks/web/useMessage'; |
15 | import { BasicForm, FormSchema, useForm } from '/@/components/Form/index'; | 15 | import { BasicForm, FormSchema, useForm } from '/@/components/Form/index'; |
16 | + import { PageWrapper } from '/@/components/Page'; | ||
16 | 17 | ||
17 | import { uploadApi } from '/@/api/sys/upload'; | 18 | import { uploadApi } from '/@/api/sys/upload'; |
18 | 19 | ||
@@ -31,7 +32,7 @@ | @@ -31,7 +32,7 @@ | ||
31 | }, | 32 | }, |
32 | ]; | 33 | ]; |
33 | export default defineComponent({ | 34 | export default defineComponent({ |
34 | - components: { BasicUpload, BasicForm }, | 35 | + components: { BasicUpload, BasicForm, PageWrapper }, |
35 | setup() { | 36 | setup() { |
36 | const { createMessage } = useMessage(); | 37 | const { createMessage } = useMessage(); |
37 | const [register] = useForm({ | 38 | const [register] = useForm({ |
src/views/demo/comp/verify/Rotate.vue
1 | <template> | 1 | <template> |
2 | - <div class="p-10"> | 2 | + <PageWrapper title="旋转校验示例"> |
3 | <div class="flex justify-center p-4 items-center bg-gray-700"> | 3 | <div class="flex justify-center p-4 items-center bg-gray-700"> |
4 | <RotateDragVerify :src="img" ref="el" @success="handleSuccess" /> | 4 | <RotateDragVerify :src="img" ref="el" @success="handleSuccess" /> |
5 | </div> | 5 | </div> |
6 | - </div> | 6 | + </PageWrapper> |
7 | </template> | 7 | </template> |
8 | <script lang="ts"> | 8 | <script lang="ts"> |
9 | import { defineComponent } from 'vue'; | 9 | import { defineComponent } from 'vue'; |
10 | import { RotateDragVerify } from '/@/components/Verify/index'; | 10 | import { RotateDragVerify } from '/@/components/Verify/index'; |
11 | 11 | ||
12 | import img from '/@/assets/images/header.jpg'; | 12 | import img from '/@/assets/images/header.jpg'; |
13 | + | ||
14 | + import { PageWrapper } from '/@/components/Page'; | ||
15 | + | ||
13 | export default defineComponent({ | 16 | export default defineComponent({ |
14 | - components: { RotateDragVerify }, | 17 | + components: { RotateDragVerify, PageWrapper }, |
15 | setup() { | 18 | setup() { |
16 | const handleSuccess = () => { | 19 | const handleSuccess = () => { |
17 | console.log('success!'); | 20 | console.log('success!'); |
src/views/demo/comp/verify/index.vue
1 | <template> | 1 | <template> |
2 | - <div class="p-10"> | 2 | + <PageWrapper title="拖动校验示例"> |
3 | <div class="flex justify-center p-4 items-center bg-gray-700"> | 3 | <div class="flex justify-center p-4 items-center bg-gray-700"> |
4 | <BasicDragVerify ref="el1" @success="handleSuccess" /> | 4 | <BasicDragVerify ref="el1" @success="handleSuccess" /> |
5 | <a-button type="primary" class="ml-2" @click="handleBtnClick(el1)">还原</a-button> | 5 | <a-button type="primary" class="ml-2" @click="handleBtnClick(el1)">还原</a-button> |
@@ -48,15 +48,17 @@ | @@ -48,15 +48,17 @@ | ||
48 | </BasicDragVerify> | 48 | </BasicDragVerify> |
49 | <a-button type="primary" class="ml-2" @click="handleBtnClick(el5)">还原</a-button> | 49 | <a-button type="primary" class="ml-2" @click="handleBtnClick(el5)">还原</a-button> |
50 | </div> | 50 | </div> |
51 | - </div> | 51 | + </PageWrapper> |
52 | </template> | 52 | </template> |
53 | <script lang="ts"> | 53 | <script lang="ts"> |
54 | import { defineComponent, ref } from 'vue'; | 54 | import { defineComponent, ref } from 'vue'; |
55 | import { BasicDragVerify, DragVerifyActionType, PassingData } from '/@/components/Verify/index'; | 55 | import { BasicDragVerify, DragVerifyActionType, PassingData } from '/@/components/Verify/index'; |
56 | import { useMessage } from '/@/hooks/web/useMessage'; | 56 | import { useMessage } from '/@/hooks/web/useMessage'; |
57 | import { BugOutlined, RightOutlined } from '@ant-design/icons-vue'; | 57 | import { BugOutlined, RightOutlined } from '@ant-design/icons-vue'; |
58 | + import { PageWrapper } from '/@/components/Page'; | ||
59 | + | ||
58 | export default defineComponent({ | 60 | export default defineComponent({ |
59 | - components: { BasicDragVerify, BugOutlined, RightOutlined }, | 61 | + components: { BasicDragVerify, BugOutlined, RightOutlined, PageWrapper }, |
60 | setup() { | 62 | setup() { |
61 | const { createMessage } = useMessage(); | 63 | const { createMessage } = useMessage(); |
62 | const el1 = ref<Nullable<DragVerifyActionType>>(null); | 64 | const el1 = ref<Nullable<DragVerifyActionType>>(null); |
src/views/demo/editor/markdown/Editor.vue
1 | <template> | 1 | <template> |
2 | - <div class="m-4"> | 2 | + <PageWrapper title="MarkDown组件嵌入Form示例"> |
3 | <CollapseContainer title="MarkDown表单"> | 3 | <CollapseContainer title="MarkDown表单"> |
4 | <BasicForm | 4 | <BasicForm |
5 | :labelWidth="100" | 5 | :labelWidth="100" |
@@ -9,7 +9,7 @@ | @@ -9,7 +9,7 @@ | ||
9 | > | 9 | > |
10 | </BasicForm> | 10 | </BasicForm> |
11 | </CollapseContainer> | 11 | </CollapseContainer> |
12 | - </div> | 12 | + </PageWrapper> |
13 | </template> | 13 | </template> |
14 | <script lang="ts"> | 14 | <script lang="ts"> |
15 | import { defineComponent, h } from 'vue'; | 15 | import { defineComponent, h } from 'vue'; |
@@ -17,6 +17,7 @@ | @@ -17,6 +17,7 @@ | ||
17 | import { CollapseContainer } from '/@/components/Container/index'; | 17 | import { CollapseContainer } from '/@/components/Container/index'; |
18 | import { useMessage } from '/@/hooks/web/useMessage'; | 18 | import { useMessage } from '/@/hooks/web/useMessage'; |
19 | import { MarkDown } from '/@/components/Markdown'; | 19 | import { MarkDown } from '/@/components/Markdown'; |
20 | + import { PageWrapper } from '/@/components/Page'; | ||
20 | 21 | ||
21 | const schemas: FormSchema[] = [ | 22 | const schemas: FormSchema[] = [ |
22 | { | 23 | { |
@@ -43,7 +44,7 @@ | @@ -43,7 +44,7 @@ | ||
43 | }, | 44 | }, |
44 | ]; | 45 | ]; |
45 | export default defineComponent({ | 46 | export default defineComponent({ |
46 | - components: { BasicForm, CollapseContainer }, | 47 | + components: { BasicForm, CollapseContainer, PageWrapper }, |
47 | setup() { | 48 | setup() { |
48 | const { createMessage } = useMessage(); | 49 | const { createMessage } = useMessage(); |
49 | 50 |
src/views/demo/editor/markdown/index.vue
1 | <template> | 1 | <template> |
2 | - <div class="p-4"> | 2 | + <PageWrapper title="MarkDown组件示例"> |
3 | <a-button @click="toggleTheme" class="mb-2" type="primary">黑暗主题</a-button> | 3 | <a-button @click="toggleTheme" class="mb-2" type="primary">黑暗主题</a-button> |
4 | <MarkDown :value="value" @change="handleChange" ref="markDownRef" /> | 4 | <MarkDown :value="value" @change="handleChange" ref="markDownRef" /> |
5 | - </div> | 5 | + </PageWrapper> |
6 | </template> | 6 | </template> |
7 | <script lang="ts"> | 7 | <script lang="ts"> |
8 | import { defineComponent, ref, unref } from 'vue'; | 8 | import { defineComponent, ref, unref } from 'vue'; |
9 | import { MarkDown, MarkDownActionType } from '/@/components/Markdown'; | 9 | import { MarkDown, MarkDownActionType } from '/@/components/Markdown'; |
10 | + import { PageWrapper } from '/@/components/Page'; | ||
11 | + | ||
10 | export default defineComponent({ | 12 | export default defineComponent({ |
11 | - components: { MarkDown }, | 13 | + components: { MarkDown, PageWrapper }, |
12 | setup() { | 14 | setup() { |
13 | const markDownRef = ref<Nullable<MarkDownActionType>>(null); | 15 | const markDownRef = ref<Nullable<MarkDownActionType>>(null); |
14 | const valueRef = ref(` | 16 | const valueRef = ref(` |
src/views/demo/editor/tinymce/Editor.vue
1 | <template> | 1 | <template> |
2 | - <div class="m-4"> | 2 | + <PageWrapper title="富文本嵌入表单示例"> |
3 | <CollapseContainer title="富文本表单"> | 3 | <CollapseContainer title="富文本表单"> |
4 | <BasicForm | 4 | <BasicForm |
5 | :labelWidth="100" | 5 | :labelWidth="100" |
@@ -9,7 +9,7 @@ | @@ -9,7 +9,7 @@ | ||
9 | > | 9 | > |
10 | </BasicForm> | 10 | </BasicForm> |
11 | </CollapseContainer> | 11 | </CollapseContainer> |
12 | - </div> | 12 | + </PageWrapper> |
13 | </template> | 13 | </template> |
14 | <script lang="ts"> | 14 | <script lang="ts"> |
15 | import { defineComponent, h } from 'vue'; | 15 | import { defineComponent, h } from 'vue'; |
@@ -17,6 +17,7 @@ | @@ -17,6 +17,7 @@ | ||
17 | import { CollapseContainer } from '/@/components/Container/index'; | 17 | import { CollapseContainer } from '/@/components/Container/index'; |
18 | import { useMessage } from '/@/hooks/web/useMessage'; | 18 | import { useMessage } from '/@/hooks/web/useMessage'; |
19 | import { Tinymce } from '/@/components/Tinymce/index'; | 19 | import { Tinymce } from '/@/components/Tinymce/index'; |
20 | + import { PageWrapper } from '/@/components/Page'; | ||
20 | 21 | ||
21 | const schemas: FormSchema[] = [ | 22 | const schemas: FormSchema[] = [ |
22 | { | 23 | { |
@@ -43,7 +44,7 @@ | @@ -43,7 +44,7 @@ | ||
43 | }, | 44 | }, |
44 | ]; | 45 | ]; |
45 | export default defineComponent({ | 46 | export default defineComponent({ |
46 | - components: { BasicForm, CollapseContainer }, | 47 | + components: { BasicForm, CollapseContainer, PageWrapper }, |
47 | setup() { | 48 | setup() { |
48 | const { createMessage } = useMessage(); | 49 | const { createMessage } = useMessage(); |
49 | 50 |
src/views/demo/editor/tinymce/index.vue
1 | <template> | 1 | <template> |
2 | - <div class="p-4"> | 2 | + <PageWrapper title="富文本组件示例"> |
3 | <Tinymce v-model="value" @change="handleChange" width="100%" /> | 3 | <Tinymce v-model="value" @change="handleChange" width="100%" /> |
4 | - </div> | 4 | + </PageWrapper> |
5 | </template> | 5 | </template> |
6 | <script lang="ts"> | 6 | <script lang="ts"> |
7 | import { defineComponent, ref } from 'vue'; | 7 | import { defineComponent, ref } from 'vue'; |
8 | import { Tinymce } from '/@/components/Tinymce/index'; | 8 | import { Tinymce } from '/@/components/Tinymce/index'; |
9 | + import { PageWrapper } from '/@/components/Page'; | ||
9 | 10 | ||
10 | export default defineComponent({ | 11 | export default defineComponent({ |
11 | - components: { Tinymce }, | 12 | + components: { Tinymce, PageWrapper }, |
12 | setup() { | 13 | setup() { |
13 | const value = ref('hello world!'); | 14 | const value = ref('hello world!'); |
14 | function handleChange(value: string) { | 15 | function handleChange(value: string) { |
src/views/demo/excel/ArrayExport.vue
1 | <template> | 1 | <template> |
2 | - <div class="m-4"> | 2 | + <PageWrapper title="导出示例" content="根据数组格式的数据进行导出"> |
3 | <BasicTable title="基础表格" :columns="columns" :dataSource="data"> | 3 | <BasicTable title="基础表格" :columns="columns" :dataSource="data"> |
4 | <template #toolbar> | 4 | <template #toolbar> |
5 | <a-button @click="aoaToExcel">导出</a-button> | 5 | <a-button @click="aoaToExcel">导出</a-button> |
6 | </template> | 6 | </template> |
7 | </BasicTable> | 7 | </BasicTable> |
8 | - </div> | 8 | + </PageWrapper> |
9 | </template> | 9 | </template> |
10 | 10 | ||
11 | <script lang="ts"> | 11 | <script lang="ts"> |
@@ -13,9 +13,10 @@ | @@ -13,9 +13,10 @@ | ||
13 | import { BasicTable } from '/@/components/Table'; | 13 | import { BasicTable } from '/@/components/Table'; |
14 | import { aoaToSheetXlsx } from '/@/components/Excel'; | 14 | import { aoaToSheetXlsx } from '/@/components/Excel'; |
15 | import { arrHeader, arrData, columns, data } from './data'; | 15 | import { arrHeader, arrData, columns, data } from './data'; |
16 | + import { PageWrapper } from '/@/components/Page'; | ||
16 | 17 | ||
17 | export default defineComponent({ | 18 | export default defineComponent({ |
18 | - components: { BasicTable }, | 19 | + components: { BasicTable, PageWrapper }, |
19 | setup() { | 20 | setup() { |
20 | function aoaToExcel() { | 21 | function aoaToExcel() { |
21 | // 保证data顺序与header一致 | 22 | // 保证data顺序与header一致 |
src/views/demo/excel/CustomExport.vue
1 | <template> | 1 | <template> |
2 | - <div class="m-4"> | 2 | + <PageWrapper title="导出示例" content="可以选择导出格式"> |
3 | <BasicTable title="基础表格" :columns="columns" :dataSource="data"> | 3 | <BasicTable title="基础表格" :columns="columns" :dataSource="data"> |
4 | <template #toolbar> | 4 | <template #toolbar> |
5 | <a-button @click="openModal">导出</a-button> | 5 | <a-button @click="openModal">导出</a-button> |
6 | </template> | 6 | </template> |
7 | </BasicTable> | 7 | </BasicTable> |
8 | <ExpExcelModel @register="register" @success="defaultHeader" /> | 8 | <ExpExcelModel @register="register" @success="defaultHeader" /> |
9 | - </div> | 9 | + </PageWrapper> |
10 | </template> | 10 | </template> |
11 | 11 | ||
12 | <script lang="ts"> | 12 | <script lang="ts"> |
@@ -15,9 +15,10 @@ | @@ -15,9 +15,10 @@ | ||
15 | import { jsonToSheetXlsx, ExpExcelModel, ExportModalResult } from '/@/components/Excel'; | 15 | import { jsonToSheetXlsx, ExpExcelModel, ExportModalResult } from '/@/components/Excel'; |
16 | import { columns, data } from './data'; | 16 | import { columns, data } from './data'; |
17 | import { useModal } from '/@/components/Modal'; | 17 | import { useModal } from '/@/components/Modal'; |
18 | + import { PageWrapper } from '/@/components/Page'; | ||
18 | 19 | ||
19 | export default defineComponent({ | 20 | export default defineComponent({ |
20 | - components: { BasicTable, ExpExcelModel }, | 21 | + components: { BasicTable, ExpExcelModel, PageWrapper }, |
21 | setup() { | 22 | setup() { |
22 | function defaultHeader({ filename, bookType }: ExportModalResult) { | 23 | function defaultHeader({ filename, bookType }: ExportModalResult) { |
23 | // 默认Object.keys(data[0])作为header | 24 | // 默认Object.keys(data[0])作为header |
src/views/demo/excel/ImportExcel.vue
1 | <template> | 1 | <template> |
2 | - <div class="m-4"> | 2 | + <PageWrapper title="excel数据导入示例"> |
3 | <ImpExcel @success="loadDataSuccess"> | 3 | <ImpExcel @success="loadDataSuccess"> |
4 | <a-button class="m-3">导入Excel</a-button> | 4 | <a-button class="m-3">导入Excel</a-button> |
5 | </ImpExcel> | 5 | </ImpExcel> |
@@ -10,16 +10,17 @@ | @@ -10,16 +10,17 @@ | ||
10 | :columns="table.columns" | 10 | :columns="table.columns" |
11 | :dataSource="table.dataSource" | 11 | :dataSource="table.dataSource" |
12 | ></BasicTable> | 12 | ></BasicTable> |
13 | - </div> | 13 | + </PageWrapper> |
14 | </template> | 14 | </template> |
15 | <script lang="ts"> | 15 | <script lang="ts"> |
16 | import { defineComponent, ref } from 'vue'; | 16 | import { defineComponent, ref } from 'vue'; |
17 | 17 | ||
18 | import { ImpExcel, ExcelData } from '/@/components/Excel'; | 18 | import { ImpExcel, ExcelData } from '/@/components/Excel'; |
19 | import { BasicTable, BasicColumn } from '/@/components/Table'; | 19 | import { BasicTable, BasicColumn } from '/@/components/Table'; |
20 | + import { PageWrapper } from '/@/components/Page'; | ||
20 | 21 | ||
21 | export default defineComponent({ | 22 | export default defineComponent({ |
22 | - components: { BasicTable, ImpExcel }, | 23 | + components: { BasicTable, ImpExcel, PageWrapper }, |
23 | 24 | ||
24 | setup() { | 25 | setup() { |
25 | const tableListRef = ref< | 26 | const tableListRef = ref< |
src/views/demo/excel/JsonExport.vue
1 | <template> | 1 | <template> |
2 | - <div class="m-4"> | 2 | + <PageWrapper title="导出示例" content="根据JSON格式的数据进行导出"> |
3 | <BasicTable title="基础表格" :columns="columns" :dataSource="data"> | 3 | <BasicTable title="基础表格" :columns="columns" :dataSource="data"> |
4 | <template #toolbar> | 4 | <template #toolbar> |
5 | <a-button @click="defaultHeader">导出:默认头部</a-button> | 5 | <a-button @click="defaultHeader">导出:默认头部</a-button> |
6 | <a-button @click="customHeader">导出:自定义头部</a-button> | 6 | <a-button @click="customHeader">导出:自定义头部</a-button> |
7 | </template> | 7 | </template> |
8 | </BasicTable> | 8 | </BasicTable> |
9 | - </div> | 9 | + </PageWrapper> |
10 | </template> | 10 | </template> |
11 | 11 | ||
12 | <script lang="ts"> | 12 | <script lang="ts"> |
@@ -14,9 +14,10 @@ | @@ -14,9 +14,10 @@ | ||
14 | import { BasicTable } from '/@/components/Table'; | 14 | import { BasicTable } from '/@/components/Table'; |
15 | import { jsonToSheetXlsx } from '/@/components/Excel'; | 15 | import { jsonToSheetXlsx } from '/@/components/Excel'; |
16 | import { columns, data } from './data'; | 16 | import { columns, data } from './data'; |
17 | + import { PageWrapper } from '/@/components/Page'; | ||
17 | 18 | ||
18 | export default defineComponent({ | 19 | export default defineComponent({ |
19 | - components: { BasicTable }, | 20 | + components: { BasicTable, PageWrapper }, |
20 | setup() { | 21 | setup() { |
21 | function defaultHeader() { | 22 | function defaultHeader() { |
22 | // 默认Object.keys(data[0])作为header | 23 | // 默认Object.keys(data[0])作为header |
src/views/demo/feat/breadcrumb/ChildrenList.vue
1 | <template> | 1 | <template> |
2 | - <div class="p-5"> | 2 | + <PageWrapper title="层级面包屑示例" content="子级页面面包屑会添加到当前层级后面"> |
3 | <router-link to="/feat/breadcrumb/children/childrenDetail">进入子级详情页</router-link> | 3 | <router-link to="/feat/breadcrumb/children/childrenDetail">进入子级详情页</router-link> |
4 | - </div> | 4 | + </PageWrapper> |
5 | </template> | 5 | </template> |
6 | <script lang="ts"> | 6 | <script lang="ts"> |
7 | import { defineComponent } from 'vue'; | 7 | import { defineComponent } from 'vue'; |
8 | + import { PageWrapper } from '/@/components/Page'; | ||
8 | 9 | ||
9 | - export default defineComponent({}); | 10 | + export default defineComponent({ |
11 | + components: { PageWrapper }, | ||
12 | + }); | ||
10 | </script> | 13 | </script> |
src/views/demo/feat/breadcrumb/FlatList.vue
1 | <template> | 1 | <template> |
2 | - <div class="p-5"> | 2 | + <PageWrapper title="平级面包屑示例" content="子级页面面包屑会覆盖当前层级"> |
3 | <router-link to="/feat/breadcrumb/flatDetail">进入平级详情页</router-link> | 3 | <router-link to="/feat/breadcrumb/flatDetail">进入平级详情页</router-link> |
4 | - </div> | 4 | + </PageWrapper> |
5 | </template> | 5 | </template> |
6 | <script lang="ts"> | 6 | <script lang="ts"> |
7 | import { defineComponent } from 'vue'; | 7 | import { defineComponent } from 'vue'; |
8 | + import { PageWrapper } from '/@/components/Page'; | ||
8 | 9 | ||
9 | - export default defineComponent({}); | 10 | + export default defineComponent({ |
11 | + components: { PageWrapper }, | ||
12 | + }); | ||
10 | </script> | 13 | </script> |
src/views/demo/feat/click-out-side/index.vue
1 | <template> | 1 | <template> |
2 | - <div class="p-10"> | ||
3 | - <Alert message="点内外部触发事件" show-icon></Alert> | ||
4 | - <ClickOutSide @clickOutside="handleClickOutside" class="flex justify-center mt-10"> | 2 | + <PageWrapper title="点内外部触发事件"> |
3 | + <ClickOutSide @clickOutside="handleClickOutside" class="flex justify-center"> | ||
5 | <div @click="innerClick" class="demo-box"> | 4 | <div @click="innerClick" class="demo-box"> |
6 | {{ text }} | 5 | {{ text }} |
7 | </div> | 6 | </div> |
8 | </ClickOutSide> | 7 | </ClickOutSide> |
9 | - </div> | 8 | + </PageWrapper> |
10 | </template> | 9 | </template> |
11 | <script lang="ts"> | 10 | <script lang="ts"> |
12 | import { defineComponent, ref } from 'vue'; | 11 | import { defineComponent, ref } from 'vue'; |
13 | - import { Alert } from 'ant-design-vue'; | ||
14 | import { ClickOutSide } from '/@/components/ClickOutSide'; | 12 | import { ClickOutSide } from '/@/components/ClickOutSide'; |
13 | + import { PageWrapper } from '/@/components/Page'; | ||
14 | + | ||
15 | export default defineComponent({ | 15 | export default defineComponent({ |
16 | - components: { ClickOutSide, Alert }, | 16 | + components: { ClickOutSide, PageWrapper }, |
17 | setup() { | 17 | setup() { |
18 | const text = ref('Click'); | 18 | const text = ref('Click'); |
19 | function handleClickOutside() { | 19 | function handleClickOutside() { |
src/views/demo/feat/context-menu/index.vue
1 | <template> | 1 | <template> |
2 | - <div class="p-4"> | 2 | + <PageWrapper title="右键菜单示例"> |
3 | <CollapseContainer title="Simple"> | 3 | <CollapseContainer title="Simple"> |
4 | <a-button type="primary" @contextmenu="handleContext">Right Click on me</a-button> | 4 | <a-button type="primary" @contextmenu="handleContext">Right Click on me</a-button> |
5 | </CollapseContainer> | 5 | </CollapseContainer> |
@@ -7,15 +7,17 @@ | @@ -7,15 +7,17 @@ | ||
7 | <CollapseContainer title="Multiple" class="mt-4"> | 7 | <CollapseContainer title="Multiple" class="mt-4"> |
8 | <a-button type="primary" @contextmenu="handleMultipleContext">Right Click on me</a-button> | 8 | <a-button type="primary" @contextmenu="handleMultipleContext">Right Click on me</a-button> |
9 | </CollapseContainer> | 9 | </CollapseContainer> |
10 | - </div> | 10 | + </PageWrapper> |
11 | </template> | 11 | </template> |
12 | <script lang="ts"> | 12 | <script lang="ts"> |
13 | import { defineComponent } from 'vue'; | 13 | import { defineComponent } from 'vue'; |
14 | import { useContextMenu } from '/@/hooks/web/useContextMenu'; | 14 | import { useContextMenu } from '/@/hooks/web/useContextMenu'; |
15 | import { CollapseContainer } from '/@/components/Container'; | 15 | import { CollapseContainer } from '/@/components/Container'; |
16 | import { useMessage } from '/@/hooks/web/useMessage'; | 16 | import { useMessage } from '/@/hooks/web/useMessage'; |
17 | + import { PageWrapper } from '/@/components/Page'; | ||
18 | + | ||
17 | export default defineComponent({ | 19 | export default defineComponent({ |
18 | - components: { CollapseContainer }, | 20 | + components: { CollapseContainer, PageWrapper }, |
19 | setup() { | 21 | setup() { |
20 | const [createContextMenu] = useContextMenu(); | 22 | const [createContextMenu] = useContextMenu(); |
21 | const { createMessage } = useMessage(); | 23 | const { createMessage } = useMessage(); |
src/views/demo/feat/copy/index.vue
1 | <template> | 1 | <template> |
2 | - <div class="p-4"> | 2 | + <PageWrapper title="文本复制示例"> |
3 | <CollapseContainer class="px-20 bg-white w-full h-32 rounded-md" title="Copy Example"> | 3 | <CollapseContainer class="px-20 bg-white w-full h-32 rounded-md" title="Copy Example"> |
4 | <div class="flex justify-center"> | 4 | <div class="flex justify-center"> |
5 | <a-input placeholder="请输入" v-model:value="value" /> | 5 | <a-input placeholder="请输入" v-model:value="value" /> |
6 | <a-button type="primary" @click="handleCopy">Copy</a-button> | 6 | <a-button type="primary" @click="handleCopy">Copy</a-button> |
7 | </div> | 7 | </div> |
8 | </CollapseContainer> | 8 | </CollapseContainer> |
9 | - </div> | 9 | + </PageWrapper> |
10 | </template> | 10 | </template> |
11 | <script lang="ts"> | 11 | <script lang="ts"> |
12 | import { defineComponent, unref, ref } from 'vue'; | 12 | import { defineComponent, unref, ref } from 'vue'; |
13 | import { CollapseContainer } from '/@/components/Container/index'; | 13 | import { CollapseContainer } from '/@/components/Container/index'; |
14 | import { useCopyToClipboard } from '/@/hooks/web/useCopyToClipboard'; | 14 | import { useCopyToClipboard } from '/@/hooks/web/useCopyToClipboard'; |
15 | import { useMessage } from '/@/hooks/web/useMessage'; | 15 | import { useMessage } from '/@/hooks/web/useMessage'; |
16 | + import { PageWrapper } from '/@/components/Page'; | ||
16 | 17 | ||
17 | export default defineComponent({ | 18 | export default defineComponent({ |
18 | name: 'Copy', | 19 | name: 'Copy', |
19 | - components: { CollapseContainer }, | 20 | + components: { CollapseContainer, PageWrapper }, |
20 | setup() { | 21 | setup() { |
21 | const valueRef = ref(''); | 22 | const valueRef = ref(''); |
22 | const { createMessage } = useMessage(); | 23 | const { createMessage } = useMessage(); |
src/views/demo/feat/download/index.vue
1 | <template> | 1 | <template> |
2 | - <div class="m-5 demo-box"> | 2 | + <PageWrapper title="文件下载示例"> |
3 | <a-alert message="根据后台接口文件流下载" /> | 3 | <a-alert message="根据后台接口文件流下载" /> |
4 | <a-button type="primary" class="my-4" @click="handleDownByData"> 文件流下载 </a-button> | 4 | <a-button type="primary" class="my-4" @click="handleDownByData"> 文件流下载 </a-button> |
5 | 5 | ||
@@ -13,7 +13,7 @@ | @@ -13,7 +13,7 @@ | ||
13 | <a-button type="primary" class="my-4" @click="handleDownloadByOnlineUrl"> | 13 | <a-button type="primary" class="my-4" @click="handleDownloadByOnlineUrl"> |
14 | 图片Url下载 | 14 | 图片Url下载 |
15 | </a-button> | 15 | </a-button> |
16 | - </div> | 16 | + </PageWrapper> |
17 | </template> | 17 | </template> |
18 | <script lang="ts"> | 18 | <script lang="ts"> |
19 | import { defineComponent } from 'vue'; | 19 | import { defineComponent } from 'vue'; |
@@ -24,7 +24,10 @@ | @@ -24,7 +24,10 @@ | ||
24 | downloadByOnlineUrl, | 24 | downloadByOnlineUrl, |
25 | } from '/@/utils/file/download'; | 25 | } from '/@/utils/file/download'; |
26 | import imgBase64 from './imgBase64'; | 26 | import imgBase64 from './imgBase64'; |
27 | + import { PageWrapper } from '/@/components/Page'; | ||
28 | + | ||
27 | export default defineComponent({ | 29 | export default defineComponent({ |
30 | + components: { PageWrapper }, | ||
28 | setup() { | 31 | setup() { |
29 | function handleDownByData() { | 32 | function handleDownByData() { |
30 | downloadByData('text content', 'testName.txt'); | 33 | downloadByData('text content', 'testName.txt'); |
src/views/demo/feat/full-screen/index.vue
1 | <template> | 1 | <template> |
2 | - <div class="p-4"> | 2 | + <PageWrapper title="全屏示例"> |
3 | <CollapseContainer class="px-20 bg-white w-full h-32 rounded-md" title="Window Full Screen"> | 3 | <CollapseContainer class="px-20 bg-white w-full h-32 rounded-md" title="Window Full Screen"> |
4 | <a-button type="primary" @click="enterFullscreen" class="mr-2"> | 4 | <a-button type="primary" @click="enterFullscreen" class="mr-2"> |
5 | Enter Window Full Screen | 5 | Enter Window Full Screen |
@@ -25,14 +25,16 @@ | @@ -25,14 +25,16 @@ | ||
25 | > | 25 | > |
26 | <a-button type="primary" @click="toggleDom" class="mr-2"> Exit Dom Full Screen </a-button> | 26 | <a-button type="primary" @click="toggleDom" class="mr-2"> Exit Dom Full Screen </a-button> |
27 | </div> | 27 | </div> |
28 | - </div> | 28 | + </PageWrapper> |
29 | </template> | 29 | </template> |
30 | <script lang="ts"> | 30 | <script lang="ts"> |
31 | import { defineComponent, ref } from 'vue'; | 31 | import { defineComponent, ref } from 'vue'; |
32 | import { CollapseContainer } from '/@/components/Container/index'; | 32 | import { CollapseContainer } from '/@/components/Container/index'; |
33 | import { useFullscreen } from '/@/hooks/web/useFullScreen'; | 33 | import { useFullscreen } from '/@/hooks/web/useFullScreen'; |
34 | + import { PageWrapper } from '/@/components/Page'; | ||
35 | + | ||
34 | export default defineComponent({ | 36 | export default defineComponent({ |
35 | - components: { CollapseContainer }, | 37 | + components: { CollapseContainer, PageWrapper }, |
36 | setup() { | 38 | setup() { |
37 | const domRef = ref<Nullable<HTMLElement>>(null); | 39 | const domRef = ref<Nullable<HTMLElement>>(null); |
38 | const { | 40 | const { |
src/views/demo/feat/icon/index.vue
1 | <template> | 1 | <template> |
2 | - <div class="m-4"> | 2 | + <PageWrapper title="Icon组件示例"> |
3 | <CollapseContainer title="Antv Icon使用 (直接按需引入相应组件即可)"> | 3 | <CollapseContainer title="Antv Icon使用 (直接按需引入相应组件即可)"> |
4 | <div class="flex justify-around"> | 4 | <div class="flex justify-around"> |
5 | <GithubFilled :style="{ fontSize: '30px' }" /> | 5 | <GithubFilled :style="{ fontSize: '30px' }" /> |
@@ -27,7 +27,7 @@ | @@ -27,7 +27,7 @@ | ||
27 | description="Icon组件基本包含所有的图标,在下面网址内你可以查询到你想要的任何图标。并且打包只会打包所用到的图标。唯一不足的可能就是需要连接外网进行使用。" | 27 | description="Icon组件基本包含所有的图标,在下面网址内你可以查询到你想要的任何图标。并且打包只会打包所用到的图标。唯一不足的可能就是需要连接外网进行使用。" |
28 | /> | 28 | /> |
29 | <a-button type="link" @click="toIconify">Iconify 图标大全</a-button> | 29 | <a-button type="link" @click="toIconify">Iconify 图标大全</a-button> |
30 | - </div> | 30 | + </PageWrapper> |
31 | </template> | 31 | </template> |
32 | <script lang="ts"> | 32 | <script lang="ts"> |
33 | import { defineComponent } from 'vue'; | 33 | import { defineComponent } from 'vue'; |
@@ -46,9 +46,11 @@ | @@ -46,9 +46,11 @@ | ||
46 | import Icon from '/@/components/Icon/index'; | 46 | import Icon from '/@/components/Icon/index'; |
47 | 47 | ||
48 | import { openWindow } from '/@/utils'; | 48 | import { openWindow } from '/@/utils'; |
49 | + import { PageWrapper } from '/@/components/Page'; | ||
49 | 50 | ||
50 | export default defineComponent({ | 51 | export default defineComponent({ |
51 | components: { | 52 | components: { |
53 | + PageWrapper, | ||
52 | CollapseContainer, | 54 | CollapseContainer, |
53 | GithubFilled, | 55 | GithubFilled, |
54 | QqCircleFilled, | 56 | QqCircleFilled, |
src/views/demo/feat/img-preview/index.vue
1 | <template> | 1 | <template> |
2 | - <div class="p-4"> | 2 | + <PageWrapper title="图片预览示例"> |
3 | <Alert message="有预览图" type="info" /> | 3 | <Alert message="有预览图" type="info" /> |
4 | <div class="flex justify-center mt-4"> | 4 | <div class="flex justify-center mt-4"> |
5 | <img :src="img" v-for="img in imgList" :key="img" class="mr-2" @click="handleClick(img)" /> | 5 | <img :src="img" v-for="img in imgList" :key="img" class="mr-2" @click="handleClick(img)" /> |
6 | </div> | 6 | </div> |
7 | <Alert message="无预览图" type="info" /> | 7 | <Alert message="无预览图" type="info" /> |
8 | <a-button @click="handlePreview" type="primary" class="mt-4">预览图片</a-button> | 8 | <a-button @click="handlePreview" type="primary" class="mt-4">预览图片</a-button> |
9 | - </div> | 9 | + </PageWrapper> |
10 | </template> | 10 | </template> |
11 | <script lang="ts"> | 11 | <script lang="ts"> |
12 | import { defineComponent } from 'vue'; | 12 | import { defineComponent } from 'vue'; |
13 | import { Alert } from 'ant-design-vue'; | 13 | import { Alert } from 'ant-design-vue'; |
14 | import { createImgPreview } from '/@/components/Preview/index'; | 14 | import { createImgPreview } from '/@/components/Preview/index'; |
15 | + import { PageWrapper } from '/@/components/Page'; | ||
16 | + | ||
15 | const imgList: string[] = [ | 17 | const imgList: string[] = [ |
16 | 'https://picsum.photos/id/66/346/216', | 18 | 'https://picsum.photos/id/66/346/216', |
17 | 'https://picsum.photos/id/67/346/216', | 19 | 'https://picsum.photos/id/67/346/216', |
18 | 'https://picsum.photos/id/68/346/216', | 20 | 'https://picsum.photos/id/68/346/216', |
19 | ]; | 21 | ]; |
20 | export default defineComponent({ | 22 | export default defineComponent({ |
21 | - components: { Alert }, | 23 | + components: { Alert, PageWrapper }, |
22 | setup() { | 24 | setup() { |
23 | function handleClick(img: string) { | 25 | function handleClick(img: string) { |
24 | createImgPreview({ imageList: [img] }); | 26 | createImgPreview({ imageList: [img] }); |
src/views/demo/feat/msg/index.vue
1 | <template> | 1 | <template> |
2 | - <div class="p-4"> | 2 | + <PageWrapper title="消息示例"> |
3 | <CollapseContainer class="px-20 bg-white w-full h-32 rounded-md" title="Message"> | 3 | <CollapseContainer class="px-20 bg-white w-full h-32 rounded-md" title="Message"> |
4 | <a-button @click="infoMsg('Info message')" class="mr-2"> Info </a-button> | 4 | <a-button @click="infoMsg('Info message')" class="mr-2"> Info </a-button> |
5 | <a-button @click="successMsg('Success message')" class="mr-2" color="success"> | 5 | <a-button @click="successMsg('Success message')" class="mr-2" color="success"> |
@@ -32,14 +32,16 @@ | @@ -32,14 +32,16 @@ | ||
32 | > | 32 | > |
33 | <a-button @click="handleNotify" color="success" class="mr-2">Success</a-button> | 33 | <a-button @click="handleNotify" color="success" class="mr-2">Success</a-button> |
34 | </CollapseContainer> | 34 | </CollapseContainer> |
35 | - </div> | 35 | + </PageWrapper> |
36 | </template> | 36 | </template> |
37 | <script lang="ts"> | 37 | <script lang="ts"> |
38 | import { defineComponent } from 'vue'; | 38 | import { defineComponent } from 'vue'; |
39 | import { CollapseContainer } from '/@/components/Container/index'; | 39 | import { CollapseContainer } from '/@/components/Container/index'; |
40 | import { useMessage } from '/@/hooks/web/useMessage'; | 40 | import { useMessage } from '/@/hooks/web/useMessage'; |
41 | + import { PageWrapper } from '/@/components/Page'; | ||
42 | + | ||
41 | export default defineComponent({ | 43 | export default defineComponent({ |
42 | - components: { CollapseContainer }, | 44 | + components: { CollapseContainer, PageWrapper }, |
43 | setup() { | 45 | setup() { |
44 | const { | 46 | const { |
45 | createMessage, | 47 | createMessage, |
src/views/demo/feat/ripple/index.vue
1 | <template> | 1 | <template> |
2 | - <div class="p-4"> | 2 | + <PageWrapper title="Ripple示例"> |
3 | <div class="demo-box" v-ripple>content</div> | 3 | <div class="demo-box" v-ripple>content</div> |
4 | - </div> | 4 | + </PageWrapper> |
5 | </template> | 5 | </template> |
6 | <script lang="ts"> | 6 | <script lang="ts"> |
7 | import { defineComponent } from 'vue'; | 7 | import { defineComponent } from 'vue'; |
8 | - import { Alert } from 'ant-design-vue'; | ||
9 | import RippleDirective from '/@/directives/ripple'; | 8 | import RippleDirective from '/@/directives/ripple'; |
9 | + import { PageWrapper } from '/@/components/Page'; | ||
10 | + | ||
10 | export default defineComponent({ | 11 | export default defineComponent({ |
11 | - components: { Alert }, | 12 | + components: { PageWrapper }, |
12 | directives: { | 13 | directives: { |
13 | Ripple: RippleDirective, | 14 | Ripple: RippleDirective, |
14 | }, | 15 | }, |
15 | - setup() { | ||
16 | - return {}; | ||
17 | - }, | ||
18 | }); | 16 | }); |
19 | </script> | 17 | </script> |
20 | 18 |
src/views/demo/feat/tab-params/index.vue
1 | <template> | 1 | <template> |
2 | - <div class="p-4"> | 2 | + <PageWrapper title="带参数标签页" content="支持带参数多tab缓存"> |
3 | Current Param : {{ params }} | 3 | Current Param : {{ params }} |
4 | <br /> | 4 | <br /> |
5 | Keep Alive | 5 | Keep Alive |
6 | <input /> | 6 | <input /> |
7 | - </div> | 7 | + </PageWrapper> |
8 | </template> | 8 | </template> |
9 | <script lang="ts"> | 9 | <script lang="ts"> |
10 | import { computed, defineComponent, unref } from 'vue'; | 10 | import { computed, defineComponent, unref } from 'vue'; |
11 | import { useRouter } from 'vue-router'; | 11 | import { useRouter } from 'vue-router'; |
12 | + import { PageWrapper } from '/@/components/Page'; | ||
13 | + | ||
12 | export default defineComponent({ | 14 | export default defineComponent({ |
13 | name: 'TestTab', | 15 | name: 'TestTab', |
16 | + components: { PageWrapper }, | ||
14 | setup() { | 17 | setup() { |
15 | const { currentRoute } = useRouter(); | 18 | const { currentRoute } = useRouter(); |
16 | return { | 19 | return { |
src/views/demo/feat/tabs/index.vue
1 | <template> | 1 | <template> |
2 | - <div class="p-4"> | 2 | + <PageWrapper title="标签页操作示例"> |
3 | <CollapseContainer title="在下面输入框输入文本,切换后回来内容会保存"> | 3 | <CollapseContainer title="在下面输入框输入文本,切换后回来内容会保存"> |
4 | <a-input placeholder="请输入" /> | 4 | <a-input placeholder="请输入" /> |
5 | </CollapseContainer> | 5 | </CollapseContainer> |
@@ -12,15 +12,16 @@ | @@ -12,15 +12,16 @@ | ||
12 | <a-button class="mr-2" @click="closeCurrent">关闭当前</a-button> | 12 | <a-button class="mr-2" @click="closeCurrent">关闭当前</a-button> |
13 | <a-button class="mr-2" @click="refreshPage">刷新当前</a-button> | 13 | <a-button class="mr-2" @click="refreshPage">刷新当前</a-button> |
14 | </CollapseContainer> | 14 | </CollapseContainer> |
15 | - </div> | 15 | + </PageWrapper> |
16 | </template> | 16 | </template> |
17 | <script lang="ts"> | 17 | <script lang="ts"> |
18 | import { defineComponent } from 'vue'; | 18 | import { defineComponent } from 'vue'; |
19 | import { CollapseContainer } from '/@/components/Container/index'; | 19 | import { CollapseContainer } from '/@/components/Container/index'; |
20 | import { useTabs } from '/@/hooks/web/useTabs'; | 20 | import { useTabs } from '/@/hooks/web/useTabs'; |
21 | + import { PageWrapper } from '/@/components/Page'; | ||
21 | export default defineComponent({ | 22 | export default defineComponent({ |
22 | name: 'TabsDemo', | 23 | name: 'TabsDemo', |
23 | - components: { CollapseContainer }, | 24 | + components: { CollapseContainer, PageWrapper }, |
24 | setup() { | 25 | setup() { |
25 | const { closeAll, closeLeft, closeRight, closeOther, closeCurrent, refreshPage } = useTabs(); | 26 | const { closeAll, closeLeft, closeRight, closeOther, closeCurrent, refreshPage } = useTabs(); |
26 | 27 |
src/views/demo/feat/watermark/index.vue
1 | <template> | 1 | <template> |
2 | - <div class="p-4"> | 2 | + <PageWrapper title="水印示例"> |
3 | <CollapseContainer class="px-20 bg-white w-full h-32 rounded-md" title="Global WaterMark"> | 3 | <CollapseContainer class="px-20 bg-white w-full h-32 rounded-md" title="Global WaterMark"> |
4 | <a-button type="primary" class="mr-2" @click="setWatermark('WaterMark Info')"> | 4 | <a-button type="primary" class="mr-2" @click="setWatermark('WaterMark Info')"> |
5 | Create | 5 | Create |
@@ -9,15 +9,16 @@ | @@ -9,15 +9,16 @@ | ||
9 | Reset | 9 | Reset |
10 | </a-button> | 10 | </a-button> |
11 | </CollapseContainer> | 11 | </CollapseContainer> |
12 | - </div> | 12 | + </PageWrapper> |
13 | </template> | 13 | </template> |
14 | <script lang="ts"> | 14 | <script lang="ts"> |
15 | import { defineComponent, ref } from 'vue'; | 15 | import { defineComponent, ref } from 'vue'; |
16 | import { CollapseContainer } from '/@/components/Container/index'; | 16 | import { CollapseContainer } from '/@/components/Container/index'; |
17 | import { useWatermark } from '/@/hooks/web/useWatermark'; | 17 | import { useWatermark } from '/@/hooks/web/useWatermark'; |
18 | + import { PageWrapper } from '/@/components/Page'; | ||
18 | 19 | ||
19 | export default defineComponent({ | 20 | export default defineComponent({ |
20 | - components: { CollapseContainer }, | 21 | + components: { CollapseContainer, PageWrapper }, |
21 | setup() { | 22 | setup() { |
22 | const areaRef = ref<Nullable<HTMLElement>>(null); | 23 | const areaRef = ref<Nullable<HTMLElement>>(null); |
23 | const { setWatermark, clear } = useWatermark(); | 24 | const { setWatermark, clear } = useWatermark(); |
src/views/demo/form/AdvancedForm.vue
1 | <template> | 1 | <template> |
2 | - <div class="m-4"> | 2 | + <PageWrapper title="可折叠表单示例"> |
3 | <CollapseContainer title="基础收缩示例"> | 3 | <CollapseContainer title="基础收缩示例"> |
4 | <BasicForm @register="register" /> | 4 | <BasicForm @register="register" /> |
5 | </CollapseContainer> | 5 | </CollapseContainer> |
@@ -7,12 +7,13 @@ | @@ -7,12 +7,13 @@ | ||
7 | <CollapseContainer title="超过3行自动收起" class="mt-4"> | 7 | <CollapseContainer title="超过3行自动收起" class="mt-4"> |
8 | <BasicForm @register="register1" /> | 8 | <BasicForm @register="register1" /> |
9 | </CollapseContainer> | 9 | </CollapseContainer> |
10 | - </div> | 10 | + </PageWrapper> |
11 | </template> | 11 | </template> |
12 | <script lang="ts"> | 12 | <script lang="ts"> |
13 | import { defineComponent } from 'vue'; | 13 | import { defineComponent } from 'vue'; |
14 | import { BasicForm, FormSchema, useForm } from '/@/components/Form/index'; | 14 | import { BasicForm, FormSchema, useForm } from '/@/components/Form/index'; |
15 | import { CollapseContainer } from '/@/components/Container/index'; | 15 | import { CollapseContainer } from '/@/components/Container/index'; |
16 | + import { PageWrapper } from '/@/components/Page'; | ||
16 | 17 | ||
17 | const getSchamas = (): FormSchema[] => { | 18 | const getSchamas = (): FormSchema[] => { |
18 | return [ | 19 | return [ |
@@ -148,7 +149,7 @@ | @@ -148,7 +149,7 @@ | ||
148 | ]; | 149 | ]; |
149 | } | 150 | } |
150 | export default defineComponent({ | 151 | export default defineComponent({ |
151 | - components: { BasicForm, CollapseContainer }, | 152 | + components: { BasicForm, CollapseContainer, PageWrapper }, |
152 | setup() { | 153 | setup() { |
153 | const [register] = useForm({ | 154 | const [register] = useForm({ |
154 | labelWidth: 120, | 155 | labelWidth: 120, |
src/views/demo/form/CustomerForm.vue
1 | <template> | 1 | <template> |
2 | - <div class="m-4"> | 2 | + <PageWrapper title="自定义组件示例"> |
3 | <CollapseContainer title="自定义表单"> | 3 | <CollapseContainer title="自定义表单"> |
4 | <BasicForm @register="register" @submit="handleSubmit"> | 4 | <BasicForm @register="register" @submit="handleSubmit"> |
5 | <template #f3="{ model, field }"> | 5 | <template #f3="{ model, field }"> |
@@ -7,7 +7,7 @@ | @@ -7,7 +7,7 @@ | ||
7 | </template> | 7 | </template> |
8 | </BasicForm> | 8 | </BasicForm> |
9 | </CollapseContainer> | 9 | </CollapseContainer> |
10 | - </div> | 10 | + </PageWrapper> |
11 | </template> | 11 | </template> |
12 | <script lang="ts"> | 12 | <script lang="ts"> |
13 | import { defineComponent, h } from 'vue'; | 13 | import { defineComponent, h } from 'vue'; |
@@ -15,6 +15,8 @@ | @@ -15,6 +15,8 @@ | ||
15 | import { CollapseContainer } from '/@/components/Container/index'; | 15 | import { CollapseContainer } from '/@/components/Container/index'; |
16 | import { useMessage } from '/@/hooks/web/useMessage'; | 16 | import { useMessage } from '/@/hooks/web/useMessage'; |
17 | import { Input } from 'ant-design-vue'; | 17 | import { Input } from 'ant-design-vue'; |
18 | + import { PageWrapper } from '/@/components/Page'; | ||
19 | + | ||
18 | const schemas: FormSchema[] = [ | 20 | const schemas: FormSchema[] = [ |
19 | { | 21 | { |
20 | field: 'field1', | 22 | field: 'field1', |
@@ -60,7 +62,7 @@ | @@ -60,7 +62,7 @@ | ||
60 | }, | 62 | }, |
61 | ]; | 63 | ]; |
62 | export default defineComponent({ | 64 | export default defineComponent({ |
63 | - components: { BasicForm, CollapseContainer }, | 65 | + components: { BasicForm, CollapseContainer, PageWrapper }, |
64 | setup() { | 66 | setup() { |
65 | const { createMessage } = useMessage(); | 67 | const { createMessage } = useMessage(); |
66 | const [register, { setProps }] = useForm({ | 68 | const [register, { setProps }] = useForm({ |
src/views/demo/form/DynamicForm.vue
1 | <template> | 1 | <template> |
2 | - <div class="m-4"> | 2 | + <PageWrapper title="动态表单示例"> |
3 | <div class="mb-4"> | 3 | <div class="mb-4"> |
4 | <a-button @click="changeLabel3" class="mr-2">更改字段3label</a-button> | 4 | <a-button @click="changeLabel3" class="mr-2">更改字段3label</a-button> |
5 | <a-button @click="changeLabel34" class="mr-2">同时更改字段3,4label</a-button> | 5 | <a-button @click="changeLabel34" class="mr-2">同时更改字段3,4label</a-button> |
@@ -13,12 +13,14 @@ | @@ -13,12 +13,14 @@ | ||
13 | <CollapseContainer class="mt-5" title="componentProps动态改变"> | 13 | <CollapseContainer class="mt-5" title="componentProps动态改变"> |
14 | <BasicForm @register="register1" /> | 14 | <BasicForm @register="register1" /> |
15 | </CollapseContainer> | 15 | </CollapseContainer> |
16 | - </div> | 16 | + </PageWrapper> |
17 | </template> | 17 | </template> |
18 | <script lang="ts"> | 18 | <script lang="ts"> |
19 | import { defineComponent } from 'vue'; | 19 | import { defineComponent } from 'vue'; |
20 | import { BasicForm, FormSchema, useForm } from '/@/components/Form/index'; | 20 | import { BasicForm, FormSchema, useForm } from '/@/components/Form/index'; |
21 | import { CollapseContainer } from '/@/components/Container/index'; | 21 | import { CollapseContainer } from '/@/components/Container/index'; |
22 | + import { PageWrapper } from '/@/components/Page'; | ||
23 | + | ||
22 | const schemas: FormSchema[] = [ | 24 | const schemas: FormSchema[] = [ |
23 | { | 25 | { |
24 | field: 'field1', | 26 | field: 'field1', |
@@ -177,7 +179,7 @@ | @@ -177,7 +179,7 @@ | ||
177 | ]; | 179 | ]; |
178 | 180 | ||
179 | export default defineComponent({ | 181 | export default defineComponent({ |
180 | - components: { BasicForm, CollapseContainer }, | 182 | + components: { BasicForm, CollapseContainer, PageWrapper }, |
181 | setup() { | 183 | setup() { |
182 | const [ | 184 | const [ |
183 | register, | 185 | register, |
src/views/demo/form/RefForm.vue
1 | <template> | 1 | <template> |
2 | - <div class="m-4"> | 2 | + <PageWrapper title="Ref操作示例"> |
3 | <div class="mb-4"> | 3 | <div class="mb-4"> |
4 | <a-button @click="setProps({ labelWidth: 150 })" class="mr-2">更改labelWidth</a-button> | 4 | <a-button @click="setProps({ labelWidth: 150 })" class="mr-2">更改labelWidth</a-button> |
5 | <a-button @click="setProps({ labelWidth: 120 })" class="mr-2">还原labelWidth</a-button> | 5 | <a-button @click="setProps({ labelWidth: 120 })" class="mr-2">还原labelWidth</a-button> |
@@ -62,13 +62,15 @@ | @@ -62,13 +62,15 @@ | ||
62 | :actionColOptions="{ span: 24 }" | 62 | :actionColOptions="{ span: 24 }" |
63 | /> | 63 | /> |
64 | </CollapseContainer> | 64 | </CollapseContainer> |
65 | - </div> | 65 | + </PageWrapper> |
66 | </template> | 66 | </template> |
67 | <script lang="ts"> | 67 | <script lang="ts"> |
68 | import { defineComponent, ref } from 'vue'; | 68 | import { defineComponent, ref } from 'vue'; |
69 | import { BasicForm, FormSchema, FormActionType, FormProps } from '/@/components/Form/index'; | 69 | import { BasicForm, FormSchema, FormActionType, FormProps } from '/@/components/Form/index'; |
70 | import { CollapseContainer } from '/@/components/Container/index'; | 70 | import { CollapseContainer } from '/@/components/Container/index'; |
71 | import { useMessage } from '/@/hooks/web/useMessage'; | 71 | import { useMessage } from '/@/hooks/web/useMessage'; |
72 | + import { PageWrapper } from '/@/components/Page'; | ||
73 | + | ||
72 | const schemas: FormSchema[] = [ | 74 | const schemas: FormSchema[] = [ |
73 | { | 75 | { |
74 | field: 'field1', | 76 | field: 'field1', |
@@ -165,7 +167,7 @@ | @@ -165,7 +167,7 @@ | ||
165 | ]; | 167 | ]; |
166 | 168 | ||
167 | export default defineComponent({ | 169 | export default defineComponent({ |
168 | - components: { BasicForm, CollapseContainer }, | 170 | + components: { BasicForm, CollapseContainer, PageWrapper }, |
169 | setup() { | 171 | setup() { |
170 | const formElRef = ref<Nullable<FormActionType>>(null); | 172 | const formElRef = ref<Nullable<FormActionType>>(null); |
171 | const { createMessage } = useMessage(); | 173 | const { createMessage } = useMessage(); |
src/views/demo/form/RuleForm.vue
1 | <template> | 1 | <template> |
2 | - <div class="m-4"> | 2 | + <PageWrapper title="表单校验示例"> |
3 | <div class="mb-4"> | 3 | <div class="mb-4"> |
4 | <a-button @click="validateForm" class="mr-2">手动校验表单</a-button> | 4 | <a-button @click="validateForm" class="mr-2">手动校验表单</a-button> |
5 | <a-button @click="resetValidate" class="mr-2">清空校验信息</a-button> | 5 | <a-button @click="resetValidate" class="mr-2">清空校验信息</a-button> |
@@ -9,13 +9,15 @@ | @@ -9,13 +9,15 @@ | ||
9 | <CollapseContainer title="表单校验"> | 9 | <CollapseContainer title="表单校验"> |
10 | <BasicForm @register="register" @submit="handleSubmit" /> | 10 | <BasicForm @register="register" @submit="handleSubmit" /> |
11 | </CollapseContainer> | 11 | </CollapseContainer> |
12 | - </div> | 12 | + </PageWrapper> |
13 | </template> | 13 | </template> |
14 | <script lang="ts"> | 14 | <script lang="ts"> |
15 | import { defineComponent } from 'vue'; | 15 | import { defineComponent } from 'vue'; |
16 | import { BasicForm, FormSchema, useForm } from '/@/components/Form/index'; | 16 | import { BasicForm, FormSchema, useForm } from '/@/components/Form/index'; |
17 | import { CollapseContainer } from '/@/components/Container/index'; | 17 | import { CollapseContainer } from '/@/components/Container/index'; |
18 | import { useMessage } from '/@/hooks/web/useMessage'; | 18 | import { useMessage } from '/@/hooks/web/useMessage'; |
19 | + import { PageWrapper } from '/@/components/Page'; | ||
20 | + | ||
19 | const schemas: FormSchema[] = [ | 21 | const schemas: FormSchema[] = [ |
20 | { | 22 | { |
21 | field: 'field1', | 23 | field: 'field1', |
@@ -141,7 +143,7 @@ | @@ -141,7 +143,7 @@ | ||
141 | ]; | 143 | ]; |
142 | 144 | ||
143 | export default defineComponent({ | 145 | export default defineComponent({ |
144 | - components: { BasicForm, CollapseContainer }, | 146 | + components: { BasicForm, CollapseContainer, PageWrapper }, |
145 | setup() { | 147 | setup() { |
146 | const { createMessage } = useMessage(); | 148 | const { createMessage } = useMessage(); |
147 | const [register, { validateFields, clearValidate, getFieldsValue, setFieldsValue }] = useForm( | 149 | const [register, { validateFields, clearValidate, getFieldsValue, setFieldsValue }] = useForm( |
src/views/demo/form/UseForm.vue
1 | <template> | 1 | <template> |
2 | - <div class="m-4"> | 2 | + <PageWrapper title="UseForm操作示例"> |
3 | <div class="mb-4"> | 3 | <div class="mb-4"> |
4 | <a-button @click="setProps({ labelWidth: 150 })" class="mr-2">更改labelWidth</a-button> | 4 | <a-button @click="setProps({ labelWidth: 150 })" class="mr-2">更改labelWidth</a-button> |
5 | <a-button @click="setProps({ labelWidth: 120 })" class="mr-2">还原labelWidth</a-button> | 5 | <a-button @click="setProps({ labelWidth: 120 })" class="mr-2">还原labelWidth</a-button> |
@@ -56,13 +56,15 @@ | @@ -56,13 +56,15 @@ | ||
56 | <CollapseContainer title="useForm示例"> | 56 | <CollapseContainer title="useForm示例"> |
57 | <BasicForm @register="register" @submit="handleSubmit" /> | 57 | <BasicForm @register="register" @submit="handleSubmit" /> |
58 | </CollapseContainer> | 58 | </CollapseContainer> |
59 | - </div> | 59 | + </PageWrapper> |
60 | </template> | 60 | </template> |
61 | <script lang="ts"> | 61 | <script lang="ts"> |
62 | import { defineComponent } from 'vue'; | 62 | import { defineComponent } from 'vue'; |
63 | import { BasicForm, FormSchema, useForm } from '/@/components/Form/index'; | 63 | import { BasicForm, FormSchema, useForm } from '/@/components/Form/index'; |
64 | import { CollapseContainer } from '/@/components/Container/index'; | 64 | import { CollapseContainer } from '/@/components/Container/index'; |
65 | import { useMessage } from '/@/hooks/web/useMessage'; | 65 | import { useMessage } from '/@/hooks/web/useMessage'; |
66 | + import { PageWrapper } from '/@/components/Page'; | ||
67 | + | ||
66 | const schemas: FormSchema[] = [ | 68 | const schemas: FormSchema[] = [ |
67 | { | 69 | { |
68 | field: 'field1', | 70 | field: 'field1', |
@@ -159,7 +161,7 @@ | @@ -159,7 +161,7 @@ | ||
159 | ]; | 161 | ]; |
160 | 162 | ||
161 | export default defineComponent({ | 163 | export default defineComponent({ |
162 | - components: { BasicForm, CollapseContainer }, | 164 | + components: { BasicForm, CollapseContainer, PageWrapper }, |
163 | setup() { | 165 | setup() { |
164 | const { createMessage } = useMessage(); | 166 | const { createMessage } = useMessage(); |
165 | 167 |
src/views/demo/form/index.vue
1 | <template> | 1 | <template> |
2 | - <div class="m-4"> | 2 | + <PageWrapper title="表单基础示例"> |
3 | <CollapseContainer title="基础示例"> | 3 | <CollapseContainer title="基础示例"> |
4 | <BasicForm | 4 | <BasicForm |
5 | autoFocusFirstItem | 5 | autoFocusFirstItem |
@@ -9,13 +9,14 @@ | @@ -9,13 +9,14 @@ | ||
9 | @submit="handleSubmit" | 9 | @submit="handleSubmit" |
10 | /> | 10 | /> |
11 | </CollapseContainer> | 11 | </CollapseContainer> |
12 | - </div> | 12 | + </PageWrapper> |
13 | </template> | 13 | </template> |
14 | <script lang="ts"> | 14 | <script lang="ts"> |
15 | import { defineComponent, ref } from 'vue'; | 15 | import { defineComponent, ref } from 'vue'; |
16 | import { BasicForm, FormSchema } from '/@/components/Form/index'; | 16 | import { BasicForm, FormSchema } from '/@/components/Form/index'; |
17 | import { CollapseContainer } from '/@/components/Container/index'; | 17 | import { CollapseContainer } from '/@/components/Container/index'; |
18 | import { useMessage } from '/@/hooks/web/useMessage'; | 18 | import { useMessage } from '/@/hooks/web/useMessage'; |
19 | + import { PageWrapper } from '/@/components/Page'; | ||
19 | 20 | ||
20 | import { optionsListApi } from '/@/api/demo/select'; | 21 | import { optionsListApi } from '/@/api/demo/select'; |
21 | const schemas: FormSchema[] = [ | 22 | const schemas: FormSchema[] = [ |
@@ -238,7 +239,7 @@ | @@ -238,7 +239,7 @@ | ||
238 | ]; | 239 | ]; |
239 | 240 | ||
240 | export default defineComponent({ | 241 | export default defineComponent({ |
241 | - components: { BasicForm, CollapseContainer }, | 242 | + components: { BasicForm, CollapseContainer, PageWrapper }, |
242 | setup() { | 243 | setup() { |
243 | const check = ref(null); | 244 | const check = ref(null); |
244 | const { createMessage } = useMessage(); | 245 | const { createMessage } = useMessage(); |
src/views/demo/page/desc/basic/index.vue
1 | <template> | 1 | <template> |
2 | - <div> | ||
3 | - <a-page-header title="基础详情页" :ghost="false" /> | 2 | + <PageWrapper title="基础详情页" contentBackgrond> |
3 | + <Description | ||
4 | + size="middle" | ||
5 | + title="退款申请" | ||
6 | + :bordered="false" | ||
7 | + :column="3" | ||
8 | + :data="refundData" | ||
9 | + :schema="refundSchema" | ||
10 | + /> | ||
11 | + <a-divider /> | ||
12 | + <Description | ||
13 | + size="middle" | ||
14 | + title="用户信息" | ||
15 | + :bordered="false" | ||
16 | + :column="3" | ||
17 | + :data="personData" | ||
18 | + :schema="personSchema" | ||
19 | + /> | ||
20 | + <a-divider /> | ||
4 | 21 | ||
5 | - <div class="m-5 desc-wrap"> | ||
6 | - <Description | ||
7 | - size="middle" | ||
8 | - title="退款申请" | ||
9 | - :bordered="false" | ||
10 | - :column="3" | ||
11 | - :data="refundData" | ||
12 | - :schema="refundSchema" | ||
13 | - /> | ||
14 | - <a-divider /> | ||
15 | - <Description | ||
16 | - size="middle" | ||
17 | - title="用户信息" | ||
18 | - :bordered="false" | ||
19 | - :column="3" | ||
20 | - :data="personData" | ||
21 | - :schema="personSchema" | ||
22 | - /> | ||
23 | - <a-divider /> | ||
24 | - | ||
25 | - <BasicTable @register="registerRefundTable" /> | ||
26 | - <a-divider /> | ||
27 | - <BasicTable @register="registerTimeTable" /> | ||
28 | - </div> | ||
29 | - </div> | 22 | + <BasicTable @register="registerRefundTable" /> |
23 | + <a-divider /> | ||
24 | + <BasicTable @register="registerTimeTable" /> | ||
25 | + </PageWrapper> | ||
30 | </template> | 26 | </template> |
31 | <script lang="ts"> | 27 | <script lang="ts"> |
32 | import { defineComponent } from 'vue'; | 28 | import { defineComponent } from 'vue'; |
33 | import { Description } from '/@/components/Description/index'; | 29 | import { Description } from '/@/components/Description/index'; |
34 | import { BasicTable, useTable } from '/@/components/Table'; | 30 | import { BasicTable, useTable } from '/@/components/Table'; |
31 | + import { PageWrapper } from '/@/components/Page'; | ||
35 | 32 | ||
36 | import { | 33 | import { |
37 | refundSchema, | 34 | refundSchema, |
@@ -44,7 +41,7 @@ | @@ -44,7 +41,7 @@ | ||
44 | refundTimeTableData, | 41 | refundTimeTableData, |
45 | } from './data'; | 42 | } from './data'; |
46 | export default defineComponent({ | 43 | export default defineComponent({ |
47 | - components: { Description, BasicTable }, | 44 | + components: { Description, BasicTable, PageWrapper }, |
48 | setup() { | 45 | setup() { |
49 | const [registerRefundTable] = useTable({ | 46 | const [registerRefundTable] = useTable({ |
50 | title: '退货商品', | 47 | title: '退货商品', |
src/views/demo/page/desc/high/index.vue
1 | <template> | 1 | <template> |
2 | - <div> | ||
3 | - <a-page-header title="单号:234231029431" class="high-desc"> | ||
4 | - <template #extra> | ||
5 | - <a-button key="3"> 操作一 </a-button> | ||
6 | - <a-button key="2"> 操作二 </a-button> | ||
7 | - <a-button key="1" type="primary"> 主操作 </a-button> | ||
8 | - </template> | ||
9 | - <template #footer> | ||
10 | - <a-tabs default-active-key="1"> | ||
11 | - <a-tab-pane key="1" tab="详情" /> | ||
12 | - <a-tab-pane key="2" tab="规则" /> | ||
13 | - </a-tabs> | ||
14 | - </template> | 2 | + <PageWrapper title="单号:234231029431" contentBackgrond> |
3 | + <template #extra> | ||
4 | + <a-button key="3"> 操作一 </a-button> | ||
5 | + <a-button key="2"> 操作二 </a-button> | ||
6 | + <a-button key="1" type="primary"> 主操作 </a-button> | ||
7 | + </template> | ||
8 | + | ||
9 | + <template #footer> | ||
10 | + <a-tabs default-active-key="1"> | ||
11 | + <a-tab-pane key="1" tab="详情" /> | ||
12 | + <a-tab-pane key="2" tab="规则" /> | ||
13 | + </a-tabs> | ||
14 | + </template> | ||
15 | + | ||
16 | + <div class="m-4 pt-4 desc-wrap"> | ||
15 | <a-descriptions size="small" :column="2"> | 17 | <a-descriptions size="small" :column="2"> |
16 | <a-descriptions-item label="创建人"> 曲丽丽 </a-descriptions-item> | 18 | <a-descriptions-item label="创建人"> 曲丽丽 </a-descriptions-item> |
17 | <a-descriptions-item label="订购产品"> XX 服务 </a-descriptions-item> | 19 | <a-descriptions-item label="订购产品"> XX 服务 </a-descriptions-item> |
@@ -20,9 +22,6 @@ | @@ -20,9 +22,6 @@ | ||
20 | <a-descriptions-item label="生效日期"> 2017-07-07 ~ 2017-08-08 </a-descriptions-item> | 22 | <a-descriptions-item label="生效日期"> 2017-07-07 ~ 2017-08-08 </a-descriptions-item> |
21 | <a-descriptions-item label="备注"> 请于两个工作日内确认 </a-descriptions-item> | 23 | <a-descriptions-item label="备注"> 请于两个工作日内确认 </a-descriptions-item> |
22 | </a-descriptions> | 24 | </a-descriptions> |
23 | - </a-page-header> | ||
24 | - | ||
25 | - <div class="m-5 desc-wrap"> | ||
26 | <a-card title="流程进度" :bordered="false"> | 25 | <a-card title="流程进度" :bordered="false"> |
27 | <a-steps :current="1" progress-dot size="small"> | 26 | <a-steps :current="1" progress-dot size="small"> |
28 | <a-step title="创建项目"> | 27 | <a-step title="创建项目"> |
@@ -84,16 +83,17 @@ | @@ -84,16 +83,17 @@ | ||
84 | </a-card> | 83 | </a-card> |
85 | <BasicTable @register="registerTimeTable" /> | 84 | <BasicTable @register="registerTimeTable" /> |
86 | </div> | 85 | </div> |
87 | - </div> | 86 | + </PageWrapper> |
88 | </template> | 87 | </template> |
89 | <script lang="ts"> | 88 | <script lang="ts"> |
90 | import { defineComponent } from 'vue'; | 89 | import { defineComponent } from 'vue'; |
91 | import { Description } from '/@/components/Description/index'; | 90 | import { Description } from '/@/components/Description/index'; |
92 | import { BasicTable, useTable } from '/@/components/Table'; | 91 | import { BasicTable, useTable } from '/@/components/Table'; |
92 | + import { PageWrapper } from '/@/components/Page'; | ||
93 | 93 | ||
94 | import { refundTimeTableSchema, refundTimeTableData } from './data'; | 94 | import { refundTimeTableSchema, refundTimeTableData } from './data'; |
95 | export default defineComponent({ | 95 | export default defineComponent({ |
96 | - components: { Description, BasicTable }, | 96 | + components: { Description, BasicTable, PageWrapper }, |
97 | setup() { | 97 | setup() { |
98 | const [registerTimeTable] = useTable({ | 98 | const [registerTimeTable] = useTable({ |
99 | title: '退货进度', | 99 | title: '退货进度', |
@@ -110,8 +110,3 @@ | @@ -110,8 +110,3 @@ | ||
110 | }, | 110 | }, |
111 | }); | 111 | }); |
112 | </script> | 112 | </script> |
113 | -<style lang="less" scoped> | ||
114 | - .high-desc { | ||
115 | - background: #fff; | ||
116 | - } | ||
117 | -</style> |
src/views/demo/page/form/basic/index.vue
1 | <template> | 1 | <template> |
2 | - <div> | ||
3 | - <a-page-header title="基础表单" :ghost="false"> | ||
4 | - 表单页用于向用户收集或验证信息,基础表单常见于数据项较少的表单场景。 | ||
5 | - </a-page-header> | ||
6 | - | ||
7 | - <div class="m-5 form-wrap"> | ||
8 | - <BasicForm @register="register" /> | ||
9 | - </div> | ||
10 | - </div> | 2 | + <PageWrapper |
3 | + title="基础表单" | ||
4 | + contentBackgrond | ||
5 | + content=" 表单页用于向用户收集或验证信息,基础表单常见于数据项较少的表单场景。" | ||
6 | + > | ||
7 | + <BasicForm @register="register" /> | ||
8 | + </PageWrapper> | ||
11 | </template> | 9 | </template> |
12 | <script lang="ts"> | 10 | <script lang="ts"> |
13 | import { BasicForm, useForm } from '/@/components/Form'; | 11 | import { BasicForm, useForm } from '/@/components/Form'; |
14 | import { defineComponent } from 'vue'; | 12 | import { defineComponent } from 'vue'; |
15 | import { schemas } from './data'; | 13 | import { schemas } from './data'; |
16 | import { useMessage } from '/@/hooks/web/useMessage'; | 14 | import { useMessage } from '/@/hooks/web/useMessage'; |
15 | + import { PageWrapper } from '/@/components/Page'; | ||
16 | + | ||
17 | export default defineComponent({ | 17 | export default defineComponent({ |
18 | - components: { BasicForm }, | 18 | + components: { BasicForm, PageWrapper }, |
19 | setup() { | 19 | setup() { |
20 | const { createMessage } = useMessage(); | 20 | const { createMessage } = useMessage(); |
21 | const [register, { validate, setProps }] = useForm({ | 21 | const [register, { validate, setProps }] = useForm({ |
src/views/demo/page/form/high/index.vue
1 | <template> | 1 | <template> |
2 | - <div class="high-form"> | ||
3 | - <a-page-header title="高级表单" :ghost="false"> | ||
4 | - 高级表单常见于一次性输入和提交大批量数据的场景。 | ||
5 | - </a-page-header> | 2 | + <PageWrapper |
3 | + class="high-form" | ||
4 | + title="高级表单" | ||
5 | + contentBackgrond | ||
6 | + content=" 高级表单常见于一次性输入和提交大批量数据的场景。" | ||
7 | + > | ||
8 | + <a-card title="仓库管理" :bordered="false"> | ||
9 | + <BasicForm @register="register" /> | ||
10 | + </a-card> | ||
11 | + <a-card title="任务管理" :bordered="false" class="mt-5"> | ||
12 | + <BasicForm @register="registerTask" /> | ||
13 | + </a-card> | ||
14 | + <a-card title="成员管理" :bordered="false" class="mt-5"> | ||
15 | + <PersonTable ref="tableRef" /> | ||
16 | + </a-card> | ||
6 | 17 | ||
7 | - <div class="m-5"> | ||
8 | - <a-card title="仓库管理" :bordered="false"> | ||
9 | - <BasicForm @register="register" /> | ||
10 | - </a-card> | ||
11 | - <a-card title="任务管理" :bordered="false" class="mt-5"> | ||
12 | - <BasicForm @register="registerTask" /> | ||
13 | - </a-card> | ||
14 | - <a-card title="成员管理" :bordered="false" class="mt-5"> | ||
15 | - <PersonTable ref="tableRef" /> | ||
16 | - </a-card> | ||
17 | - </div> | ||
18 | - | ||
19 | - <PageFooter> | ||
20 | - <template #right> | ||
21 | - <a-button type="primary" @click="submitAll">提交</a-button> | ||
22 | - </template> | ||
23 | - </PageFooter> | ||
24 | - </div> | 18 | + <template #rightFooter> |
19 | + <a-button type="primary" @click="submitAll">提交</a-button> | ||
20 | + </template> | ||
21 | + </PageWrapper> | ||
25 | </template> | 22 | </template> |
26 | <script lang="ts"> | 23 | <script lang="ts"> |
27 | import { BasicForm, useForm } from '/@/components/Form'; | 24 | import { BasicForm, useForm } from '/@/components/Form'; |
28 | import { defineComponent, ref } from 'vue'; | 25 | import { defineComponent, ref } from 'vue'; |
29 | import PersonTable from './PersonTable.vue'; | 26 | import PersonTable from './PersonTable.vue'; |
30 | - import { PageFooter } from '/@/components/Page'; | ||
31 | - | 27 | + import { PageWrapper } from '/@/components/Page'; |
32 | import { schemas, taskSchemas } from './data'; | 28 | import { schemas, taskSchemas } from './data'; |
33 | 29 | ||
34 | export default defineComponent({ | 30 | export default defineComponent({ |
35 | - components: { BasicForm, PersonTable, PageFooter }, | 31 | + components: { BasicForm, PersonTable, PageWrapper }, |
36 | setup() { | 32 | setup() { |
37 | const tableRef = ref<{ getDataSource: () => any } | null>(null); | 33 | const tableRef = ref<{ getDataSource: () => any } | null>(null); |
38 | 34 |
src/views/demo/page/form/step/index.vue
1 | <template> | 1 | <template> |
2 | - <div> | ||
3 | - <a-page-header title="分步表单" :ghost="false"> | ||
4 | - 将一个冗长或用户不熟悉的表单任务分成多个步骤,指导用户完成。 | ||
5 | - </a-page-header> | ||
6 | - | ||
7 | - <div class="m-5 step-form-content"> | ||
8 | - <div class="step-form-form"> | ||
9 | - <a-steps :current="current"> | ||
10 | - <a-step title="填写转账信息"> </a-step> | ||
11 | - <a-step title="确认转账信息"> </a-step> | ||
12 | - <a-step title="完成"> </a-step> | ||
13 | - </a-steps> | ||
14 | - </div> | ||
15 | - <div class="mt-5"> | ||
16 | - <Step1 @next="handleStep1Next" v-show="current === 0" /> | ||
17 | - <Step2 | ||
18 | - @prev="handleStepPrev" | ||
19 | - @next="handleStep2Next" | ||
20 | - v-show="current === 1" | ||
21 | - v-if="initSetp2" | ||
22 | - /> | ||
23 | - <Step3 v-show="current === 2" @redo="handleRedo" v-if="initSetp3" /> | ||
24 | - </div> | 2 | + <PageWrapper |
3 | + title="分步表单" | ||
4 | + contentBackgrond | ||
5 | + content=" 将一个冗长或用户不熟悉的表单任务分成多个步骤,指导用户完成。" | ||
6 | + > | ||
7 | + <div class="step-form-form"> | ||
8 | + <a-steps :current="current"> | ||
9 | + <a-step title="填写转账信息"> </a-step> | ||
10 | + <a-step title="确认转账信息"> </a-step> | ||
11 | + <a-step title="完成"> </a-step> | ||
12 | + </a-steps> | ||
13 | + </div> | ||
14 | + <div class="mt-5"> | ||
15 | + <Step1 @next="handleStep1Next" v-show="current === 0" /> | ||
16 | + <Step2 | ||
17 | + @prev="handleStepPrev" | ||
18 | + @next="handleStep2Next" | ||
19 | + v-show="current === 1" | ||
20 | + v-if="initSetp2" | ||
21 | + /> | ||
22 | + <Step3 v-show="current === 2" @redo="handleRedo" v-if="initSetp3" /> | ||
25 | </div> | 23 | </div> |
26 | - </div> | 24 | + </PageWrapper> |
27 | </template> | 25 | </template> |
28 | <script lang="ts"> | 26 | <script lang="ts"> |
29 | import { defineComponent, ref, reactive, toRefs } from 'vue'; | 27 | import { defineComponent, ref, reactive, toRefs } from 'vue'; |
30 | import Step1 from './Step1.vue'; | 28 | import Step1 from './Step1.vue'; |
31 | import Step2 from './Step2.vue'; | 29 | import Step2 from './Step2.vue'; |
32 | import Step3 from './Step3.vue'; | 30 | import Step3 from './Step3.vue'; |
31 | + import { PageWrapper } from '/@/components/Page'; | ||
32 | + | ||
33 | export default defineComponent({ | 33 | export default defineComponent({ |
34 | - components: { Step1, Step2, Step3 }, | 34 | + components: { Step1, Step2, Step3, PageWrapper }, |
35 | setup() { | 35 | setup() { |
36 | const current = ref(0); | 36 | const current = ref(0); |
37 | 37 |
src/views/demo/page/list/basic/index.vue
1 | <template> | 1 | <template> |
2 | - <div :class="prefixCls"> | ||
3 | - <a-page-header title="标准列表" :ghost="false" /> | 2 | + <PageWrapper :class="prefixCls" title="标准列表"> |
4 | <div :class="`${prefixCls}__top`"> | 3 | <div :class="`${prefixCls}__top`"> |
5 | <a-row :gutter="12"> | 4 | <a-row :gutter="12"> |
6 | <a-col :span="8" :class="`${prefixCls}__top-col`"> | 5 | <a-col :span="8" :class="`${prefixCls}__top-col`"> |
@@ -47,16 +46,17 @@ | @@ -47,16 +46,17 @@ | ||
47 | </template> | 46 | </template> |
48 | </a-list> | 47 | </a-list> |
49 | </div> | 48 | </div> |
50 | - </div> | 49 | + </PageWrapper> |
51 | </template> | 50 | </template> |
52 | <script lang="ts"> | 51 | <script lang="ts"> |
53 | import { Progress } from 'ant-design-vue'; | 52 | import { Progress } from 'ant-design-vue'; |
54 | import { defineComponent } from 'vue'; | 53 | import { defineComponent } from 'vue'; |
55 | import Icon from '/@/components/Icon/index'; | 54 | import Icon from '/@/components/Icon/index'; |
56 | import { cardList } from './data'; | 55 | import { cardList } from './data'; |
56 | + import { PageWrapper } from '/@/components/Page'; | ||
57 | 57 | ||
58 | export default defineComponent({ | 58 | export default defineComponent({ |
59 | - components: { Icon, Progress }, | 59 | + components: { Icon, Progress, PageWrapper }, |
60 | setup() { | 60 | setup() { |
61 | return { | 61 | return { |
62 | prefixCls: 'list-basic', | 62 | prefixCls: 'list-basic', |
@@ -73,7 +73,6 @@ | @@ -73,7 +73,6 @@ | ||
73 | .list-basic { | 73 | .list-basic { |
74 | &__top { | 74 | &__top { |
75 | padding: 24px; | 75 | padding: 24px; |
76 | - margin: 24px 24px 0 24px; | ||
77 | text-align: center; | 76 | text-align: center; |
78 | background: #fff; | 77 | background: #fff; |
79 | 78 | ||
@@ -100,7 +99,7 @@ | @@ -100,7 +99,7 @@ | ||
100 | 99 | ||
101 | &__content { | 100 | &__content { |
102 | padding: 24px; | 101 | padding: 24px; |
103 | - margin: 12px 24px; | 102 | + margin-top: 12px; |
104 | background: #fff; | 103 | background: #fff; |
105 | 104 | ||
106 | .list { | 105 | .list { |
src/views/demo/page/list/card/data.tsx
@@ -3,7 +3,7 @@ export const cardList = (() => { | @@ -3,7 +3,7 @@ export const cardList = (() => { | ||
3 | for (let i = 0; i < 12; i++) { | 3 | for (let i = 0; i < 12; i++) { |
4 | result.push({ | 4 | result.push({ |
5 | title: 'Vben Admin', | 5 | title: 'Vben Admin', |
6 | - icon: 'logos:ant-design', | 6 | + icon: 'logos:vue', |
7 | color: '#1890ff', | 7 | color: '#1890ff', |
8 | active: '100', | 8 | active: '100', |
9 | new: '1,799', | 9 | new: '1,799', |
src/views/demo/page/list/card/index.vue
1 | <template> | 1 | <template> |
2 | - <div :class="prefixCls"> | ||
3 | - <a-page-header title="卡片列表" :ghost="false"> | 2 | + <PageWrapper :class="prefixCls" title="卡片列表"> |
3 | + <template #headerContent> | ||
4 | 基于Vue Next, TypeScript, Ant Design Vue实现的一套完整的企业级后台管理系统。 | 4 | 基于Vue Next, TypeScript, Ant Design Vue实现的一套完整的企业级后台管理系统。 |
5 | <div :class="`${prefixCls}__link`"> | 5 | <div :class="`${prefixCls}__link`"> |
6 | <a><Icon icon="bx:bx-paper-plane" color="#1890ff" /><span>开始</span></a> | 6 | <a><Icon icon="bx:bx-paper-plane" color="#1890ff" /><span>开始</span></a> |
7 | <a><Icon icon="carbon:warning" color="#1890ff" /><span>简介</span></a> | 7 | <a><Icon icon="carbon:warning" color="#1890ff" /><span>简介</span></a> |
8 | <a><Icon icon="gg:loadbar-doc" color="#1890ff" /><span>文档</span></a> | 8 | <a><Icon icon="gg:loadbar-doc" color="#1890ff" /><span>文档</span></a> |
9 | </div> | 9 | </div> |
10 | - </a-page-header> | 10 | + </template> |
11 | 11 | ||
12 | <div :class="`${prefixCls}__content`"> | 12 | <div :class="`${prefixCls}__content`"> |
13 | <a-list> | 13 | <a-list> |
@@ -30,15 +30,16 @@ | @@ -30,15 +30,16 @@ | ||
30 | </a-row> | 30 | </a-row> |
31 | </a-list> | 31 | </a-list> |
32 | </div> | 32 | </div> |
33 | - </div> | 33 | + </PageWrapper> |
34 | </template> | 34 | </template> |
35 | <script lang="ts"> | 35 | <script lang="ts"> |
36 | import { defineComponent } from 'vue'; | 36 | import { defineComponent } from 'vue'; |
37 | import Icon from '/@/components/Icon/index'; | 37 | import Icon from '/@/components/Icon/index'; |
38 | import { cardList } from './data'; | 38 | import { cardList } from './data'; |
39 | + import { PageWrapper } from '/@/components/Page'; | ||
39 | 40 | ||
40 | export default defineComponent({ | 41 | export default defineComponent({ |
41 | - components: { Icon }, | 42 | + components: { Icon, PageWrapper }, |
42 | setup() { | 43 | setup() { |
43 | return { | 44 | return { |
44 | prefixCls: 'list-card', | 45 | prefixCls: 'list-card', |
@@ -62,11 +63,6 @@ | @@ -62,11 +63,6 @@ | ||
62 | } | 63 | } |
63 | } | 64 | } |
64 | 65 | ||
65 | - &__content { | ||
66 | - padding: 12px 24px; | ||
67 | - // background: #fff; | ||
68 | - } | ||
69 | - | ||
70 | &__card { | 66 | &__card { |
71 | width: 100%; | 67 | width: 100%; |
72 | margin-bottom: -8px; | 68 | margin-bottom: -8px; |
src/views/demo/page/list/search/index.vue
1 | <template> | 1 | <template> |
2 | - <div :class="prefixCls"> | ||
3 | - <a-page-header title="搜索列表" :ghost="false" :class="`${prefixCls}__header`"> | 2 | + <PageWrapper :class="prefixCls" title="搜索列表"> |
3 | + <template #headerContent> | ||
4 | <BasicForm | 4 | <BasicForm |
5 | :class="`${prefixCls}__header-form`" | 5 | :class="`${prefixCls}__header-form`" |
6 | :labelWidth="100" | 6 | :labelWidth="100" |
7 | :schemas="schemas" | 7 | :schemas="schemas" |
8 | :showActionButtonGroup="false" | 8 | :showActionButtonGroup="false" |
9 | /> | 9 | /> |
10 | - </a-page-header> | 10 | + </template> |
11 | 11 | ||
12 | <div :class="`${prefixCls}__container`"> | 12 | <div :class="`${prefixCls}__container`"> |
13 | <a-list> | 13 | <a-list> |
@@ -44,7 +44,7 @@ | @@ -44,7 +44,7 @@ | ||
44 | </template> | 44 | </template> |
45 | </a-list> | 45 | </a-list> |
46 | </div> | 46 | </div> |
47 | - </div> | 47 | + </PageWrapper> |
48 | </template> | 48 | </template> |
49 | <script lang="ts"> | 49 | <script lang="ts"> |
50 | import { Tag } from 'ant-design-vue'; | 50 | import { Tag } from 'ant-design-vue'; |
@@ -52,9 +52,10 @@ | @@ -52,9 +52,10 @@ | ||
52 | import Icon from '/@/components/Icon/index'; | 52 | import Icon from '/@/components/Icon/index'; |
53 | import { BasicForm } from '/@/components/Form/index'; | 53 | import { BasicForm } from '/@/components/Form/index'; |
54 | import { actions, searchList, schemas } from './data'; | 54 | import { actions, searchList, schemas } from './data'; |
55 | + import { PageWrapper } from '/@/components/Page'; | ||
55 | 56 | ||
56 | export default defineComponent({ | 57 | export default defineComponent({ |
57 | - components: { Icon, Tag, BasicForm }, | 58 | + components: { Icon, Tag, BasicForm, PageWrapper }, |
58 | setup() { | 59 | setup() { |
59 | return { | 60 | return { |
60 | prefixCls: 'list-search', | 61 | prefixCls: 'list-search', |
@@ -75,7 +76,6 @@ | @@ -75,7 +76,6 @@ | ||
75 | 76 | ||
76 | &__container { | 77 | &__container { |
77 | padding: 12px; | 78 | padding: 12px; |
78 | - margin: 24px; | ||
79 | background: #fff; | 79 | background: #fff; |
80 | } | 80 | } |
81 | 81 |
src/views/demo/permission/back/Btn.vue
1 | <template> | 1 | <template> |
2 | - <div class="p-4 m-4 demo"> | 2 | + <PageWrapper contentBackgrond title="按钮权限控制" contentClass="p-4"> |
3 | <Alert message="刷新后会还原" show-icon /> | 3 | <Alert message="刷新后会还原" show-icon /> |
4 | 4 | ||
5 | <CurrentPermissionMode /> | 5 | <CurrentPermissionMode /> |
@@ -51,7 +51,7 @@ | @@ -51,7 +51,7 @@ | ||
51 | <a-button v-auth="['1000', '2000']" color="error" class="mx-4"> | 51 | <a-button v-auth="['1000', '2000']" color="error" class="mx-4"> |
52 | 拥有code ['1000','2000']角色权限可见 | 52 | 拥有code ['1000','2000']角色权限可见 |
53 | </a-button> | 53 | </a-button> |
54 | - </div> | 54 | + </PageWrapper> |
55 | </template> | 55 | </template> |
56 | <script lang="ts"> | 56 | <script lang="ts"> |
57 | import { defineComponent } from 'vue'; | 57 | import { defineComponent } from 'vue'; |
@@ -62,8 +62,10 @@ | @@ -62,8 +62,10 @@ | ||
62 | import { getPermCodeByUserId } from '/@/api/sys/user'; | 62 | import { getPermCodeByUserId } from '/@/api/sys/user'; |
63 | import { permissionStore } from '/@/store/modules/permission'; | 63 | import { permissionStore } from '/@/store/modules/permission'; |
64 | import { PermissionModeEnum } from '/@/enums/appEnum'; | 64 | import { PermissionModeEnum } from '/@/enums/appEnum'; |
65 | + import { PageWrapper } from '/@/components/Page'; | ||
66 | + | ||
65 | export default defineComponent({ | 67 | export default defineComponent({ |
66 | - components: { Alert, CurrentPermissionMode, Divider, Authority }, | 68 | + components: { Alert, PageWrapper, CurrentPermissionMode, Divider, Authority }, |
67 | setup() { | 69 | setup() { |
68 | const { hasPermission } = usePermission(); | 70 | const { hasPermission } = usePermission(); |
69 | 71 |
src/views/demo/permission/back/index.vue
1 | <template> | 1 | <template> |
2 | - <div class="p-4 m-4 demo"> | ||
3 | - <Alert | ||
4 | - message="目前mock了两组数据, id为1 和 2 具体返回的菜单可以在mock/sys/menu.ts内查看" | ||
5 | - show-icon | ||
6 | - /> | 2 | + <PageWrapper |
3 | + title="后台权限示例" | ||
4 | + contentBackgrond | ||
5 | + contentClass="p-4" | ||
6 | + content="目前mock了两组数据, id为1 和 2 具体返回的菜单可以在mock/sys/menu.ts内查看" | ||
7 | + > | ||
7 | <CurrentPermissionMode /> | 8 | <CurrentPermissionMode /> |
8 | 9 | ||
9 | <Alert class="mt-4" type="info" message="点击后请查看左侧菜单变化" show-icon /> | 10 | <Alert class="mt-4" type="info" message="点击后请查看左侧菜单变化" show-icon /> |
@@ -15,17 +16,17 @@ | @@ -15,17 +16,17 @@ | ||
15 | <a-button @click="changeMenu('2')"> 获取用户id为2的菜单 </a-button> | 16 | <a-button @click="changeMenu('2')"> 获取用户id为2的菜单 </a-button> |
16 | </a-button-group> | 17 | </a-button-group> |
17 | </div> | 18 | </div> |
18 | - </div> | 19 | + </PageWrapper> |
19 | </template> | 20 | </template> |
20 | <script lang="ts"> | 21 | <script lang="ts"> |
21 | import { defineComponent } from 'vue'; | 22 | import { defineComponent } from 'vue'; |
22 | - import { Alert } from 'ant-design-vue'; | ||
23 | import CurrentPermissionMode from '../CurrentPermissionMode.vue'; | 23 | import CurrentPermissionMode from '../CurrentPermissionMode.vue'; |
24 | import { RoleEnum } from '/@/enums/roleEnum'; | 24 | import { RoleEnum } from '/@/enums/roleEnum'; |
25 | import { usePermission } from '/@/hooks/web/usePermission'; | 25 | import { usePermission } from '/@/hooks/web/usePermission'; |
26 | - | 26 | + import { PageWrapper } from '/@/components/Page'; |
27 | + import { Alert } from 'ant-design-vue'; | ||
27 | export default defineComponent({ | 28 | export default defineComponent({ |
28 | - components: { Alert, CurrentPermissionMode }, | 29 | + components: { Alert, CurrentPermissionMode, PageWrapper }, |
29 | setup() { | 30 | setup() { |
30 | const { changeMenu } = usePermission(); | 31 | const { changeMenu } = usePermission(); |
31 | return { | 32 | return { |
src/views/demo/permission/front/Btn.vue
1 | <template> | 1 | <template> |
2 | - <div class="demo p-4 m-4"> | ||
3 | - <Alert | ||
4 | - message="由于刷新的时候会请求用户信息接口,会根据接口重置角色信息,所以刷新后界面会恢复原样,如果不需要,可以注释 src/layout/default/index内的获取用户信息接口" | ||
5 | - show-icon | ||
6 | - /> | 2 | + <PageWrapper |
3 | + title="前端权限按钮示例" | ||
4 | + contentBackgrond | ||
5 | + contentClass="p-4" | ||
6 | + content="由于刷新的时候会请求用户信息接口,会根据接口重置角色信息,所以刷新后界面会恢复原样,如果不需要,可以注释 src/layout/default/index内的获取用户信息接口" | ||
7 | + > | ||
7 | <CurrentPermissionMode /> | 8 | <CurrentPermissionMode /> |
8 | 9 | ||
9 | <p> | 10 | <p> |
@@ -56,7 +57,7 @@ | @@ -56,7 +57,7 @@ | ||
56 | <a-button v-auth="[RoleEnum.TEST, RoleEnum.SUPER]" color="error" class="mx-4"> | 57 | <a-button v-auth="[RoleEnum.TEST, RoleEnum.SUPER]" color="error" class="mx-4"> |
57 | 拥有[test,super]角色权限可见 | 58 | 拥有[test,super]角色权限可见 |
58 | </a-button> | 59 | </a-button> |
59 | - </div> | 60 | + </PageWrapper> |
60 | </template> | 61 | </template> |
61 | <script lang="ts"> | 62 | <script lang="ts"> |
62 | import { computed, defineComponent } from 'vue'; | 63 | import { computed, defineComponent } from 'vue'; |
@@ -66,9 +67,10 @@ | @@ -66,9 +67,10 @@ | ||
66 | import { RoleEnum } from '/@/enums/roleEnum'; | 67 | import { RoleEnum } from '/@/enums/roleEnum'; |
67 | import { usePermission } from '/@/hooks/web/usePermission'; | 68 | import { usePermission } from '/@/hooks/web/usePermission'; |
68 | import { Authority } from '/@/components/Authority'; | 69 | import { Authority } from '/@/components/Authority'; |
70 | + import { PageWrapper } from '/@/components/Page'; | ||
69 | 71 | ||
70 | export default defineComponent({ | 72 | export default defineComponent({ |
71 | - components: { Alert, CurrentPermissionMode, Divider, Authority }, | 73 | + components: { Alert, PageWrapper, CurrentPermissionMode, Divider, Authority }, |
72 | setup() { | 74 | setup() { |
73 | const { changeRole, hasPermission } = usePermission(); | 75 | const { changeRole, hasPermission } = usePermission(); |
74 | return { | 76 | return { |
src/views/demo/permission/front/index.vue
1 | <template> | 1 | <template> |
2 | - <div class="p-4 m-4 demo"> | ||
3 | - <Alert | ||
4 | - message="由于刷新的时候会请求用户信息接口,会根据接口重置角色信息,所以刷新后界面会恢复原样,如果不需要,可以注释 src/layout/default/index内的获取用户信息接口" | ||
5 | - show-icon | ||
6 | - /> | 2 | + <PageWrapper |
3 | + title="前端权限示例" | ||
4 | + contentBackgrond | ||
5 | + contentClass="p-4" | ||
6 | + content="由于刷新的时候会请求用户信息接口,会根据接口重置角色信息,所以刷新后界面会恢复原样,如果不需要,可以注释 src/layout/default/index内的获取用户信息接口" | ||
7 | + > | ||
7 | <CurrentPermissionMode /> | 8 | <CurrentPermissionMode /> |
8 | 9 | ||
9 | <p> | 10 | <p> |
@@ -22,7 +23,7 @@ | @@ -22,7 +23,7 @@ | ||
22 | </a-button> | 23 | </a-button> |
23 | </a-button-group> | 24 | </a-button-group> |
24 | </div> | 25 | </div> |
25 | - </div> | 26 | + </PageWrapper> |
26 | </template> | 27 | </template> |
27 | <script lang="ts"> | 28 | <script lang="ts"> |
28 | import { computed, defineComponent } from 'vue'; | 29 | import { computed, defineComponent } from 'vue'; |
@@ -31,9 +32,10 @@ | @@ -31,9 +32,10 @@ | ||
31 | import { userStore } from '/@/store/modules/user'; | 32 | import { userStore } from '/@/store/modules/user'; |
32 | import { RoleEnum } from '/@/enums/roleEnum'; | 33 | import { RoleEnum } from '/@/enums/roleEnum'; |
33 | import { usePermission } from '/@/hooks/web/usePermission'; | 34 | import { usePermission } from '/@/hooks/web/usePermission'; |
35 | + import { PageWrapper } from '/@/components/Page'; | ||
34 | 36 | ||
35 | export default defineComponent({ | 37 | export default defineComponent({ |
36 | - components: { Alert, CurrentPermissionMode }, | 38 | + components: { Alert, CurrentPermissionMode, PageWrapper }, |
37 | setup() { | 39 | setup() { |
38 | const { changeRole } = usePermission(); | 40 | const { changeRole } = usePermission(); |
39 | return { | 41 | return { |
src/views/demo/table/Basic.vue
@@ -31,9 +31,10 @@ | @@ -31,9 +31,10 @@ | ||
31 | import { defineComponent, ref } from 'vue'; | 31 | import { defineComponent, ref } from 'vue'; |
32 | import { BasicTable } from '/@/components/Table'; | 32 | import { BasicTable } from '/@/components/Table'; |
33 | import { getBasicColumns, getBasicData } from './tableData'; | 33 | import { getBasicColumns, getBasicData } from './tableData'; |
34 | + import { PageWrapper } from '/@/components/Page'; | ||
34 | 35 | ||
35 | export default defineComponent({ | 36 | export default defineComponent({ |
36 | - components: { BasicTable }, | 37 | + components: { BasicTable, PageWrapper }, |
37 | setup() { | 38 | setup() { |
38 | const canResize = ref(false); | 39 | const canResize = ref(false); |
39 | const loading = ref(false); | 40 | const loading = ref(false); |
src/views/demo/tree/ActionTree.vue
1 | <template> | 1 | <template> |
2 | - <div class="p-4"> | 2 | + <PageWrapper title="Tree函数操作示例" contentBackgrond contentClass="p-4"> |
3 | <div class="mb-4"> | 3 | <div class="mb-4"> |
4 | <a-button @click="handleLevel(2)" class="mr-2">显示到第2级</a-button> | 4 | <a-button @click="handleLevel(2)" class="mr-2">显示到第2级</a-button> |
5 | <a-button @click="handleLevel(1)" class="mr-2">显示到第1级</a-button> | 5 | <a-button @click="handleLevel(1)" class="mr-2">显示到第1级</a-button> |
@@ -20,7 +20,7 @@ | @@ -20,7 +20,7 @@ | ||
20 | <CollapseContainer title="函数操作" class="mr-4" :canExpan="false" :style="{ width: '33%' }"> | 20 | <CollapseContainer title="函数操作" class="mr-4" :canExpan="false" :style="{ width: '33%' }"> |
21 | <BasicTree :treeData="treeData" ref="treeRef" :checkable="true" /> | 21 | <BasicTree :treeData="treeData" ref="treeRef" :checkable="true" /> |
22 | </CollapseContainer> | 22 | </CollapseContainer> |
23 | - </div> | 23 | + </PageWrapper> |
24 | </template> | 24 | </template> |
25 | <script lang="ts"> | 25 | <script lang="ts"> |
26 | import { defineComponent, ref, unref } from 'vue'; | 26 | import { defineComponent, ref, unref } from 'vue'; |
@@ -28,9 +28,10 @@ | @@ -28,9 +28,10 @@ | ||
28 | import { treeData } from './data'; | 28 | import { treeData } from './data'; |
29 | import { CollapseContainer } from '/@/components/Container/index'; | 29 | import { CollapseContainer } from '/@/components/Container/index'; |
30 | import { useMessage } from '/@/hooks/web/useMessage'; | 30 | import { useMessage } from '/@/hooks/web/useMessage'; |
31 | + import { PageWrapper } from '/@/components/Page'; | ||
31 | 32 | ||
32 | export default defineComponent({ | 33 | export default defineComponent({ |
33 | - components: { BasicTree, CollapseContainer }, | 34 | + components: { BasicTree, CollapseContainer, PageWrapper }, |
34 | setup() { | 35 | setup() { |
35 | const treeRef = ref<Nullable<TreeActionType>>(null); | 36 | const treeRef = ref<Nullable<TreeActionType>>(null); |
36 | const { createMessage } = useMessage(); | 37 | const { createMessage } = useMessage(); |
src/views/demo/tree/EditTree.vue
1 | <template> | 1 | <template> |
2 | - <div class="flex p-4"> | ||
3 | - <CollapseContainer title="右侧操作按钮" class="mr-4" :style="{ width: '33%' }"> | ||
4 | - <BasicTree :treeData="treeData" :actionList="actionList" /> | ||
5 | - </CollapseContainer> | 2 | + <PageWrapper title="Tree函数操作示例"> |
3 | + <div class="flex"> | ||
4 | + <CollapseContainer title="右侧操作按钮" class="mr-4" :style="{ width: '33%' }"> | ||
5 | + <BasicTree :treeData="treeData" :actionList="actionList" /> | ||
6 | + </CollapseContainer> | ||
6 | 7 | ||
7 | - <CollapseContainer title="右键菜单" class="mr-4" :style="{ width: '33%' }"> | ||
8 | - <BasicTree :treeData="treeData" :beforeRightClick="getRightMenuList" /> | ||
9 | - </CollapseContainer> | ||
10 | - </div> | 8 | + <CollapseContainer title="右键菜单" class="mr-4" :style="{ width: '33%' }"> |
9 | + <BasicTree :treeData="treeData" :beforeRightClick="getRightMenuList" /> | ||
10 | + </CollapseContainer> | ||
11 | + </div> | ||
12 | + </PageWrapper> | ||
11 | </template> | 13 | </template> |
12 | <script lang="ts"> | 14 | <script lang="ts"> |
13 | import { defineComponent, h } from 'vue'; | 15 | import { defineComponent, h } from 'vue'; |
@@ -15,8 +17,10 @@ | @@ -15,8 +17,10 @@ | ||
15 | import { treeData } from './data'; | 17 | import { treeData } from './data'; |
16 | import { CollapseContainer } from '/@/components/Container/index'; | 18 | import { CollapseContainer } from '/@/components/Container/index'; |
17 | import { PlusOutlined, DeleteOutlined } from '@ant-design/icons-vue'; | 19 | import { PlusOutlined, DeleteOutlined } from '@ant-design/icons-vue'; |
20 | + import { PageWrapper } from '/@/components/Page'; | ||
21 | + | ||
18 | export default defineComponent({ | 22 | export default defineComponent({ |
19 | - components: { BasicTree, CollapseContainer }, | 23 | + components: { BasicTree, CollapseContainer, PageWrapper }, |
20 | setup() { | 24 | setup() { |
21 | function handlePlus(node: any) { | 25 | function handlePlus(node: any) { |
22 | console.log(node); | 26 | console.log(node); |
src/views/demo/tree/index.vue
1 | <template> | 1 | <template> |
2 | - <div class="flex p-4"> | ||
3 | - <CollapseContainer title="基础示例" :style="{ width: '33%' }" class="mr-4"> | ||
4 | - <BasicTree :treeData="treeData" /> | ||
5 | - </CollapseContainer> | 2 | + <PageWrapper title="Tree基础示例"> |
3 | + <div class="flex"> | ||
4 | + <CollapseContainer title="基础示例" :style="{ width: '33%' }" class="mr-4"> | ||
5 | + <BasicTree :treeData="treeData" /> | ||
6 | + </CollapseContainer> | ||
6 | 7 | ||
7 | - <CollapseContainer title="可勾选" class="mr-4" :style="{ width: '33%' }"> | ||
8 | - <BasicTree :treeData="treeData" :checkable="true" /> | ||
9 | - </CollapseContainer> | 8 | + <CollapseContainer title="可勾选" class="mr-4" :style="{ width: '33%' }"> |
9 | + <BasicTree :treeData="treeData" :checkable="true" /> | ||
10 | + </CollapseContainer> | ||
10 | 11 | ||
11 | - <CollapseContainer title="默认展开/勾选示例" :style="{ width: '33%' }"> | ||
12 | - <BasicTree | ||
13 | - :treeData="treeData" | ||
14 | - :checkable="true" | ||
15 | - :expandedKeys="['0-0']" | ||
16 | - :checkedKeys="['0-0']" | ||
17 | - /> | ||
18 | - </CollapseContainer> | ||
19 | - </div> | 12 | + <CollapseContainer title="默认展开/勾选示例" :style="{ width: '33%' }"> |
13 | + <BasicTree | ||
14 | + :treeData="treeData" | ||
15 | + :checkable="true" | ||
16 | + :expandedKeys="['0-0']" | ||
17 | + :checkedKeys="['0-0']" | ||
18 | + /> | ||
19 | + </CollapseContainer> | ||
20 | + </div> | ||
21 | + </PageWrapper> | ||
20 | </template> | 22 | </template> |
21 | <script lang="ts"> | 23 | <script lang="ts"> |
22 | import { defineComponent } from 'vue'; | 24 | import { defineComponent } from 'vue'; |
23 | import { BasicTree } from '/@/components/Tree/index'; | 25 | import { BasicTree } from '/@/components/Tree/index'; |
24 | import { treeData } from './data'; | 26 | import { treeData } from './data'; |
25 | import { CollapseContainer } from '/@/components/Container/index'; | 27 | import { CollapseContainer } from '/@/components/Container/index'; |
28 | + import { PageWrapper } from '/@/components/Page'; | ||
26 | 29 | ||
27 | export default defineComponent({ | 30 | export default defineComponent({ |
28 | - components: { BasicTree, CollapseContainer }, | 31 | + components: { BasicTree, CollapseContainer, PageWrapper }, |
29 | setup() { | 32 | setup() { |
30 | return { treeData }; | 33 | return { treeData }; |
31 | }, | 34 | }, |