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