Commit 6392b7f04839edf801f63a48cfe03461dbd160de
1 parent
c2f6542b
refactor: remove global import
Showing
38 changed files
with
256 additions
and
162 deletions
CHANGELOG.zh_CN.md
@@ -3,6 +3,7 @@ | @@ -3,6 +3,7 @@ | ||
3 | ### ✨ Refactor | 3 | ### ✨ Refactor |
4 | 4 | ||
5 | - 新增 `SimpleMenu`组件替代左侧菜单组件(顶部菜单没有替换,功能尽量做到简单不卡)。解决菜单卡顿问题。 | 5 | - 新增 `SimpleMenu`组件替代左侧菜单组件(顶部菜单没有替换,功能尽量做到简单不卡)。解决菜单卡顿问题。 |
6 | +- `ant-design-vue`组件不再全局注册。以便于更好配合 css 按需引入。如果需要全局注册,需要自己加 | ||
6 | 7 | ||
7 | ### ✨ Features | 8 | ### ✨ Features |
8 | 9 | ||
@@ -13,6 +14,7 @@ | @@ -13,6 +14,7 @@ | ||
13 | - 修复 `TableAction`图标问题 | 14 | - 修复 `TableAction`图标问题 |
14 | - 修复菜单折叠按钮丢失问题 | 15 | - 修复菜单折叠按钮丢失问题 |
15 | - 修复菜单相关问题 | 16 | - 修复菜单相关问题 |
17 | +- 修复 moment 多语言问题 | ||
16 | 18 | ||
17 | ## 2.0.0-rc.16 (2020-01-12) | 19 | ## 2.0.0-rc.16 (2020-01-12) |
18 | 20 |
build/vite/plugin/style-import.ts
@@ -5,20 +5,9 @@ export function configStyleImportConfig() { | @@ -5,20 +5,9 @@ export function configStyleImportConfig() { | ||
5 | libs: [ | 5 | libs: [ |
6 | { | 6 | { |
7 | libraryName: 'ant-design-vue', | 7 | libraryName: 'ant-design-vue', |
8 | + esModule: true, | ||
8 | resolveStyle: (name) => { | 9 | resolveStyle: (name) => { |
9 | - // ! col row popconfirm These three components have no corresponding css files after packaging. Need special treatment | ||
10 | - | ||
11 | - if (['col', 'row'].includes(name)) { | ||
12 | - return 'ant-design-vue/lib/grid/style/index.css'; | ||
13 | - } | ||
14 | - | ||
15 | - if (['popconfirm'].includes(name)) { | ||
16 | - return [ | ||
17 | - 'ant-design-vue/lib/popover/style/index.css', | ||
18 | - 'ant-design-vue/lib/button/style/index.css', | ||
19 | - ]; | ||
20 | - } | ||
21 | - return `ant-design-vue/lib/${name}/style/index.css`; | 10 | + return `ant-design-vue/es/${name}/style/css`; |
22 | }, | 11 | }, |
23 | }, | 12 | }, |
24 | ], | 13 | ], |
package.json
@@ -29,7 +29,6 @@ | @@ -29,7 +29,6 @@ | ||
29 | "echarts": "^4.9.0", | 29 | "echarts": "^4.9.0", |
30 | "lodash-es": "^4.17.20", | 30 | "lodash-es": "^4.17.20", |
31 | "mockjs": "^1.1.0", | 31 | "mockjs": "^1.1.0", |
32 | - "moment": "^2.29.1", | ||
33 | "nprogress": "^0.2.0", | 32 | "nprogress": "^0.2.0", |
34 | "path-to-regexp": "^6.2.0", | 33 | "path-to-regexp": "^6.2.0", |
35 | "qrcode": "^1.4.4", | 34 | "qrcode": "^1.4.4", |
@@ -98,12 +97,12 @@ | @@ -98,12 +97,12 @@ | ||
98 | "stylelint-order": "^4.1.0", | 97 | "stylelint-order": "^4.1.0", |
99 | "ts-node": "^9.1.0", | 98 | "ts-node": "^9.1.0", |
100 | "typescript": "^4.1.3", | 99 | "typescript": "^4.1.3", |
101 | - "vite": "^2.0.0-beta.30", | 100 | + "vite": "^2.0.0-beta.31", |
102 | "vite-plugin-html": "^2.0.0-beta.5", | 101 | "vite-plugin-html": "^2.0.0-beta.5", |
103 | "vite-plugin-mock": "^2.0.0-beta.3", | 102 | "vite-plugin-mock": "^2.0.0-beta.3", |
104 | "vite-plugin-purge-icons": "^0.5.1", | 103 | "vite-plugin-purge-icons": "^0.5.1", |
105 | "vite-plugin-pwa": "^0.3.8", | 104 | "vite-plugin-pwa": "^0.3.8", |
106 | - "vite-plugin-style-import": "^0.2.1", | 105 | + "vite-plugin-style-import": "^0.4.0", |
107 | "vue-eslint-parser": "^7.3.0", | 106 | "vue-eslint-parser": "^7.3.0", |
108 | "yargs": "^16.2.0" | 107 | "yargs": "^16.2.0" |
109 | }, | 108 | }, |
src/assets/images/sidebar/dark.png deleted
100644 → 0
24.8 KB
src/components/Application/src/search/AppSearchModal.vue
@@ -63,10 +63,11 @@ | @@ -63,10 +63,11 @@ | ||
63 | import { useI18n } from '/@/hooks/web/useI18n'; | 63 | import { useI18n } from '/@/hooks/web/useI18n'; |
64 | import { useAppInject } from '/@/hooks/web/useAppInject'; | 64 | import { useAppInject } from '/@/hooks/web/useAppInject'; |
65 | import clickOutside from '/@/directives/clickOutside'; | 65 | import clickOutside from '/@/directives/clickOutside'; |
66 | + import { Input } from 'ant-design-vue'; | ||
66 | 67 | ||
67 | export default defineComponent({ | 68 | export default defineComponent({ |
68 | name: 'AppSearchModal', | 69 | name: 'AppSearchModal', |
69 | - components: { SearchOutlined, AppSearchFooter }, | 70 | + components: { SearchOutlined, AppSearchFooter, [Input.name]: Input }, |
70 | emits: ['close'], | 71 | emits: ['close'], |
71 | 72 | ||
72 | props: { | 73 | props: { |
src/components/Form/src/components/FormAction.vue
@@ -42,7 +42,7 @@ | @@ -42,7 +42,7 @@ | ||
42 | import type { ButtonProps } from 'ant-design-vue/es/button/buttonTypes'; | 42 | import type { ButtonProps } from 'ant-design-vue/es/button/buttonTypes'; |
43 | 43 | ||
44 | import { defineComponent, computed, PropType } from 'vue'; | 44 | import { defineComponent, computed, PropType } from 'vue'; |
45 | - import { Form } from 'ant-design-vue'; | 45 | + import { Form, Col } from 'ant-design-vue'; |
46 | import { Button } from '/@/components/Button'; | 46 | import { Button } from '/@/components/Button'; |
47 | import { BasicArrow } from '/@/components/Basic/index'; | 47 | import { BasicArrow } from '/@/components/Basic/index'; |
48 | import { useFormContext } from '../hooks/useFormContext'; | 48 | import { useFormContext } from '../hooks/useFormContext'; |
@@ -58,6 +58,7 @@ | @@ -58,6 +58,7 @@ | ||
58 | FormItem: Form.Item, | 58 | FormItem: Form.Item, |
59 | Button, | 59 | Button, |
60 | BasicArrow, | 60 | BasicArrow, |
61 | + [Col.name]: Col, | ||
61 | }, | 62 | }, |
62 | props: { | 63 | props: { |
63 | showActionButtonGroup: propTypes.bool.def(true), | 64 | showActionButtonGroup: propTypes.bool.def(true), |
src/components/Page/src/PageWrapper.vue
@@ -51,6 +51,7 @@ | @@ -51,6 +51,7 @@ | ||
51 | setup(props, { slots }) { | 51 | setup(props, { slots }) { |
52 | const headerRef = ref<ComponentRef>(null); | 52 | const headerRef = ref<ComponentRef>(null); |
53 | const footerRef = ref<ComponentRef>(null); | 53 | const footerRef = ref<ComponentRef>(null); |
54 | + const footerHeight = ref(0); | ||
54 | const { prefixCls } = useDesign('page-wrapper'); | 55 | const { prefixCls } = useDesign('page-wrapper'); |
55 | const { contentHeight, setPageHeight, pageHeight } = usePageContext(); | 56 | const { contentHeight, setPageHeight, pageHeight } = usePageContext(); |
56 | 57 | ||
@@ -80,30 +81,33 @@ | @@ -80,30 +81,33 @@ | ||
80 | ...bg, | 81 | ...bg, |
81 | ...contentStyle, | 82 | ...contentStyle, |
82 | minHeight: `${unref(pageHeight)}px`, | 83 | minHeight: `${unref(pageHeight)}px`, |
84 | + paddingBottom: `${unref(footerHeight)}px`, | ||
83 | }; | 85 | }; |
84 | } | 86 | } |
85 | ); | 87 | ); |
86 | 88 | ||
87 | watch( | 89 | watch( |
88 | - () => contentHeight?.value, | ||
89 | - (height) => { | 90 | + () => [contentHeight?.value, getShowFooter.value], |
91 | + () => { | ||
90 | if (!props.contentFullHeight) { | 92 | if (!props.contentFullHeight) { |
91 | return; | 93 | return; |
92 | } | 94 | } |
93 | nextTick(() => { | 95 | nextTick(() => { |
94 | const footer = unref(footerRef); | 96 | const footer = unref(footerRef); |
95 | const header = unref(headerRef); | 97 | const header = unref(headerRef); |
96 | - let footetHeight = 0; | 98 | + footerHeight.value = 0; |
97 | const footerEl = footer?.$el; | 99 | const footerEl = footer?.$el; |
100 | + | ||
98 | if (footerEl) { | 101 | if (footerEl) { |
99 | - footetHeight += footerEl?.offsetHeight ?? 0; | 102 | + footerHeight.value += footerEl?.offsetHeight ?? 0; |
100 | } | 103 | } |
101 | let headerHeight = 0; | 104 | let headerHeight = 0; |
102 | const headerEl = header?.$el; | 105 | const headerEl = header?.$el; |
103 | if (headerEl) { | 106 | if (headerEl) { |
104 | headerHeight += headerEl?.offsetHeight ?? 0; | 107 | headerHeight += headerEl?.offsetHeight ?? 0; |
105 | } | 108 | } |
106 | - setPageHeight?.(height - footetHeight - headerHeight); | 109 | + |
110 | + setPageHeight?.(unref(contentHeight) - unref(footerHeight) - headerHeight); | ||
107 | }); | 111 | }); |
108 | }, | 112 | }, |
109 | { | 113 | { |
src/components/registerGlobComp.ts
@@ -5,48 +5,46 @@ import { | @@ -5,48 +5,46 @@ import { | ||
5 | Button as AntButton, | 5 | Button as AntButton, |
6 | 6 | ||
7 | // Optional | 7 | // Optional |
8 | - Select, | ||
9 | - Alert, | ||
10 | - Checkbox, | ||
11 | - DatePicker, | ||
12 | - Radio, | ||
13 | - Switch, | ||
14 | - Card, | ||
15 | - List, | ||
16 | - Tabs, | ||
17 | - Descriptions, | ||
18 | - Tree, | ||
19 | - Table, | ||
20 | - Divider, | ||
21 | - Modal, | ||
22 | - Drawer, | ||
23 | - Dropdown, | ||
24 | - Tag, | ||
25 | - Tooltip, | ||
26 | - Badge, | ||
27 | - Popover, | ||
28 | - Upload, | ||
29 | - Transfer, | ||
30 | - Steps, | ||
31 | - PageHeader, | ||
32 | - Result, | ||
33 | - Empty, | ||
34 | - Avatar, | ||
35 | - Menu, | ||
36 | - Breadcrumb, | ||
37 | - Form, | ||
38 | - Input, | ||
39 | - Row, | ||
40 | - Col, | ||
41 | - Spin, | 8 | + // Select, |
9 | + // Alert, | ||
10 | + // Checkbox, | ||
11 | + // DatePicker, | ||
12 | + // Radio, | ||
13 | + // Switch, | ||
14 | + // Card, | ||
15 | + // List, | ||
16 | + // Tabs, | ||
17 | + // Descriptions, | ||
18 | + // Tree, | ||
19 | + // Table, | ||
20 | + // Divider, | ||
21 | + // Modal, | ||
22 | + // Drawer, | ||
23 | + // Dropdown, | ||
24 | + // Tag, | ||
25 | + // Tooltip, | ||
26 | + // Badge, | ||
27 | + // Popover, | ||
28 | + // Upload, | ||
29 | + // Transfer, | ||
30 | + // Steps, | ||
31 | + // PageHeader, | ||
32 | + // Result, | ||
33 | + // Empty, | ||
34 | + // Avatar, | ||
35 | + // Menu, | ||
36 | + // Breadcrumb, | ||
37 | + // Form, | ||
38 | + // Input, | ||
39 | + // Row, | ||
40 | + // Col, | ||
41 | + // Spin, | ||
42 | } from 'ant-design-vue'; | 42 | } from 'ant-design-vue'; |
43 | -// import 'ant-design-vue/dist/antd.css'; | ||
44 | 43 | ||
45 | import { App } from 'vue'; | 44 | import { App } from 'vue'; |
46 | 45 | ||
47 | const compList = [Icon, Button, AntButton.Group]; | 46 | const compList = [Icon, Button, AntButton.Group]; |
48 | 47 | ||
49 | -// Fix hmr multiple registered components | ||
50 | export function registerGlobComp(app: App) { | 48 | export function registerGlobComp(app: App) { |
51 | compList.forEach((comp: any) => { | 49 | compList.forEach((comp: any) => { |
52 | app.component(comp.name, comp); | 50 | app.component(comp.name, comp); |
@@ -55,39 +53,39 @@ export function registerGlobComp(app: App) { | @@ -55,39 +53,39 @@ export function registerGlobComp(app: App) { | ||
55 | // Optional | 53 | // Optional |
56 | // If you need to customize global components, you can write here | 54 | // If you need to customize global components, you can write here |
57 | // If you don’t need it, you can delete it | 55 | // If you don’t need it, you can delete it |
58 | - app | ||
59 | - .use(Select) | ||
60 | - .use(Alert) | ||
61 | - .use(Breadcrumb) | ||
62 | - .use(Checkbox) | ||
63 | - .use(DatePicker) | ||
64 | - .use(Radio) | ||
65 | - .use(Switch) | ||
66 | - .use(Card) | ||
67 | - .use(List) | ||
68 | - .use(Descriptions) | ||
69 | - .use(Tree) | ||
70 | - .use(Table) | ||
71 | - .use(Divider) | ||
72 | - .use(Modal) | ||
73 | - .use(Drawer) | ||
74 | - .use(Dropdown) | ||
75 | - .use(Tag) | ||
76 | - .use(Tooltip) | ||
77 | - .use(Badge) | ||
78 | - .use(Popover) | ||
79 | - .use(Upload) | ||
80 | - .use(Transfer) | ||
81 | - .use(Steps) | ||
82 | - .use(PageHeader) | ||
83 | - .use(Result) | ||
84 | - .use(Empty) | ||
85 | - .use(Avatar) | ||
86 | - .use(Menu) | ||
87 | - .use(Tabs) | ||
88 | - .use(Form) | ||
89 | - .use(Input) | ||
90 | - .use(Row) | ||
91 | - .use(Col) | ||
92 | - .use(Spin); | 56 | + // app |
57 | + // .use(Select) | ||
58 | + // .use(Alert) | ||
59 | + // .use(Breadcrumb) | ||
60 | + // .use(Checkbox) | ||
61 | + // .use(DatePicker) | ||
62 | + // .use(Radio) | ||
63 | + // .use(Switch) | ||
64 | + // .use(Card) | ||
65 | + // .use(List) | ||
66 | + // .use(Descriptions) | ||
67 | + // .use(Tree) | ||
68 | + // .use(Table) | ||
69 | + // .use(Divider) | ||
70 | + // .use(Modal) | ||
71 | + // .use(Drawer) | ||
72 | + // .use(Dropdown) | ||
73 | + // .use(Tag) | ||
74 | + // .use(Tooltip) | ||
75 | + // .use(Badge) | ||
76 | + // .use(Popover) | ||
77 | + // .use(Upload) | ||
78 | + // .use(Transfer) | ||
79 | + // .use(Steps) | ||
80 | + // .use(PageHeader) | ||
81 | + // .use(Result) | ||
82 | + // .use(Empty) | ||
83 | + // .use(Avatar) | ||
84 | + // .use(Menu) | ||
85 | + // .use(Tabs) | ||
86 | + // .use(Form) | ||
87 | + // .use(Input) | ||
88 | + // .use(Row) | ||
89 | + // .use(Col) | ||
90 | + // .use(Spin); | ||
93 | } | 91 | } |
src/design/ant/pagination.less
@@ -19,7 +19,7 @@ | @@ -19,7 +19,7 @@ | ||
19 | .ant-pagination-prev, | 19 | .ant-pagination-prev, |
20 | .ant-pagination-next, | 20 | .ant-pagination-next, |
21 | .ant-pagination-item { | 21 | .ant-pagination-item { |
22 | - margin: 0 4px; | 22 | + margin: 0 4px !important; |
23 | background: #f4f4f5 !important; | 23 | background: #f4f4f5 !important; |
24 | border: none; | 24 | border: none; |
25 | border-radius: none !important; | 25 | border-radius: none !important; |
@@ -61,6 +61,6 @@ | @@ -61,6 +61,6 @@ | ||
61 | } | 61 | } |
62 | 62 | ||
63 | &-disabled { | 63 | &-disabled { |
64 | - display: none; | 64 | + display: none !important; |
65 | } | 65 | } |
66 | } | 66 | } |
src/layouts/default/header/components/Breadcrumb.vue
@@ -14,10 +14,12 @@ | @@ -14,10 +14,12 @@ | ||
14 | </div> | 14 | </div> |
15 | </template> | 15 | </template> |
16 | <script lang="ts"> | 16 | <script lang="ts"> |
17 | + import type { RouteLocationMatched } from 'vue-router'; | ||
18 | + | ||
17 | import { defineComponent, ref, toRaw, watchEffect } from 'vue'; | 19 | import { defineComponent, ref, toRaw, watchEffect } from 'vue'; |
20 | + import { Breadcrumb } from 'ant-design-vue'; | ||
18 | import { useI18n } from 'vue-i18n'; | 21 | import { useI18n } from 'vue-i18n'; |
19 | 22 | ||
20 | - import type { RouteLocationMatched } from 'vue-router'; | ||
21 | import { useRouter } from 'vue-router'; | 23 | import { useRouter } from 'vue-router'; |
22 | import { filter } from '/@/utils/helper/treeHelper'; | 24 | import { filter } from '/@/utils/helper/treeHelper'; |
23 | import { REDIRECT_NAME } from '/@/router/constant'; | 25 | import { REDIRECT_NAME } from '/@/router/constant'; |
@@ -35,7 +37,7 @@ | @@ -35,7 +37,7 @@ | ||
35 | 37 | ||
36 | export default defineComponent({ | 38 | export default defineComponent({ |
37 | name: 'LayoutBreadcrumb', | 39 | name: 'LayoutBreadcrumb', |
38 | - components: { HomeOutlined, Icon }, | 40 | + components: { HomeOutlined, Icon, [Breadcrumb.name]: Breadcrumb }, |
39 | props: { | 41 | props: { |
40 | theme: propTypes.oneOf(['dark', 'light']), | 42 | theme: propTypes.oneOf(['dark', 'light']), |
41 | }, | 43 | }, |
src/layouts/default/header/components/notify/NoticeList.vue
@@ -34,8 +34,15 @@ | @@ -34,8 +34,15 @@ | ||
34 | import { defineComponent, PropType } from 'vue'; | 34 | import { defineComponent, PropType } from 'vue'; |
35 | import { ListItem } from './data'; | 35 | import { ListItem } from './data'; |
36 | import { useDesign } from '/@/hooks/web/useDesign'; | 36 | import { useDesign } from '/@/hooks/web/useDesign'; |
37 | - | 37 | + import { List, Avatar, Tag } from 'ant-design-vue'; |
38 | export default defineComponent({ | 38 | export default defineComponent({ |
39 | + components: { | ||
40 | + [Avatar.name]: Avatar, | ||
41 | + [List.name]: List, | ||
42 | + [List.Item.name]: List.Item, | ||
43 | + AListItemMeta: List.Item.Meta, | ||
44 | + [Tag.name]: Tag, | ||
45 | + }, | ||
39 | props: { | 46 | props: { |
40 | list: { | 47 | list: { |
41 | type: Array as PropType<ListItem[]>, | 48 | type: Array as PropType<ListItem[]>, |
src/locales/useLocale.ts
@@ -7,10 +7,10 @@ import type { Ref } from 'vue'; | @@ -7,10 +7,10 @@ import type { Ref } from 'vue'; | ||
7 | import { unref, ref } from 'vue'; | 7 | import { unref, ref } from 'vue'; |
8 | import { useLocaleSetting } from '/@/hooks/setting/useLocaleSetting'; | 8 | import { useLocaleSetting } from '/@/hooks/setting/useLocaleSetting'; |
9 | 9 | ||
10 | -import { dateUtil } from '/@/utils/dateUtil'; | ||
11 | - | ||
12 | import { i18n } from './setupI18n'; | 10 | import { i18n } from './setupI18n'; |
13 | 11 | ||
12 | +import 'moment/locale/zh-cn'; | ||
13 | + | ||
14 | const antConfigLocaleRef = ref<any>(null); | 14 | const antConfigLocaleRef = ref<any>(null); |
15 | 15 | ||
16 | export function useLocale() { | 16 | export function useLocale() { |
@@ -34,14 +34,12 @@ export function useLocale() { | @@ -34,14 +34,12 @@ export function useLocale() { | ||
34 | antConfigLocaleRef.value = locale.default; | 34 | antConfigLocaleRef.value = locale.default; |
35 | }); | 35 | }); |
36 | 36 | ||
37 | - dateUtil.locale('cn'); | ||
38 | break; | 37 | break; |
39 | // English | 38 | // English |
40 | case 'en': | 39 | case 'en': |
41 | import('ant-design-vue/es/locale/en_US').then((locale) => { | 40 | import('ant-design-vue/es/locale/en_US').then((locale) => { |
42 | antConfigLocaleRef.value = locale.default; | 41 | antConfigLocaleRef.value = locale.default; |
43 | }); | 42 | }); |
44 | - dateUtil.locale('en-us'); | ||
45 | break; | 43 | break; |
46 | 44 | ||
47 | // other | 45 | // other |
src/views/dashboard/analysis/index.vue
@@ -49,7 +49,7 @@ | @@ -49,7 +49,7 @@ | ||
49 | import TaskCard from './components/TaskCard.vue'; | 49 | import TaskCard from './components/TaskCard.vue'; |
50 | import FlowAnalysis from './components/FlowAnalysis'; | 50 | import FlowAnalysis from './components/FlowAnalysis'; |
51 | import { CollapseContainer } from '/@/components/Container/index'; | 51 | import { CollapseContainer } from '/@/components/Container/index'; |
52 | - | 52 | + import { Row, Col } from 'ant-design-vue'; |
53 | import { growCardList, taskList } from './data'; | 53 | import { growCardList, taskList } from './data'; |
54 | export default defineComponent({ | 54 | export default defineComponent({ |
55 | components: { | 55 | components: { |
@@ -61,6 +61,8 @@ | @@ -61,6 +61,8 @@ | ||
61 | AnalysisBar, | 61 | AnalysisBar, |
62 | TaskCard, | 62 | TaskCard, |
63 | FlowAnalysis, | 63 | FlowAnalysis, |
64 | + [Row.name]: Row, | ||
65 | + [Col.name]: Col, | ||
64 | }, | 66 | }, |
65 | setup() { | 67 | setup() { |
66 | return { growCardList, taskList }; | 68 | return { growCardList, taskList }; |
src/views/dashboard/workbench/index.vue
@@ -19,9 +19,18 @@ | @@ -19,9 +19,18 @@ | ||
19 | import Week from './components/Week.vue'; | 19 | import Week from './components/Week.vue'; |
20 | import NewsList from './components/NewsList.vue'; | 20 | import NewsList from './components/NewsList.vue'; |
21 | import ShortCuts from './components/ShortCuts.vue'; | 21 | import ShortCuts from './components/ShortCuts.vue'; |
22 | + import { Row, Col } from 'ant-design-vue'; | ||
22 | 23 | ||
23 | export default defineComponent({ | 24 | export default defineComponent({ |
24 | - components: { ProdTotal, TodoList, Week, ShortCuts, NewsList }, | 25 | + components: { |
26 | + ProdTotal, | ||
27 | + TodoList, | ||
28 | + Week, | ||
29 | + ShortCuts, | ||
30 | + NewsList, | ||
31 | + [Row.name]: Row, | ||
32 | + [Col.name]: Col, | ||
33 | + }, | ||
25 | setup() { | 34 | setup() { |
26 | return {}; | 35 | return {}; |
27 | }, | 36 | }, |
src/views/demo/comp/button/index.vue
src/views/demo/comp/loading/index.vue
@@ -20,9 +20,10 @@ | @@ -20,9 +20,10 @@ | ||
20 | import { defineComponent, reactive, toRefs, ref } from 'vue'; | 20 | import { defineComponent, reactive, toRefs, ref } from 'vue'; |
21 | import { Loading, useLoading } from '/@/components/Loading'; | 21 | import { Loading, useLoading } from '/@/components/Loading'; |
22 | import { PageWrapper } from '/@/components/Page'; | 22 | import { PageWrapper } from '/@/components/Page'; |
23 | + import { Alert } from 'ant-design-vue'; | ||
23 | 24 | ||
24 | export default defineComponent({ | 25 | export default defineComponent({ |
25 | - components: { Loading, PageWrapper }, | 26 | + components: { Loading, PageWrapper, [Alert.name]: Alert }, |
26 | setup() { | 27 | setup() { |
27 | const wrapEl = ref<ElRef>(null); | 28 | const wrapEl = ref<ElRef>(null); |
28 | 29 |
src/views/demo/comp/upload/index.vue
@@ -14,6 +14,7 @@ | @@ -14,6 +14,7 @@ | ||
14 | import { useMessage } from '/@/hooks/web/useMessage'; | 14 | import { useMessage } from '/@/hooks/web/useMessage'; |
15 | import { BasicForm, FormSchema, useForm } from '/@/components/Form/index'; | 15 | import { BasicForm, FormSchema, useForm } from '/@/components/Form/index'; |
16 | import { PageWrapper } from '/@/components/Page'; | 16 | import { PageWrapper } from '/@/components/Page'; |
17 | + import { Alert } from 'ant-design-vue'; | ||
17 | 18 | ||
18 | import { uploadApi } from '/@/api/sys/upload'; | 19 | import { uploadApi } from '/@/api/sys/upload'; |
19 | 20 | ||
@@ -32,7 +33,7 @@ | @@ -32,7 +33,7 @@ | ||
32 | }, | 33 | }, |
33 | ]; | 34 | ]; |
34 | export default defineComponent({ | 35 | export default defineComponent({ |
35 | - components: { BasicUpload, BasicForm, PageWrapper }, | 36 | + components: { BasicUpload, BasicForm, PageWrapper, [Alert.name]: Alert }, |
36 | setup() { | 37 | setup() { |
37 | const { createMessage } = useMessage(); | 38 | const { createMessage } = useMessage(); |
38 | const [register] = useForm({ | 39 | const [register] = useForm({ |
src/views/demo/feat/copy/index.vue
@@ -14,10 +14,11 @@ | @@ -14,10 +14,11 @@ | ||
14 | import { useCopyToClipboard } from '/@/hooks/web/useCopyToClipboard'; | 14 | import { useCopyToClipboard } from '/@/hooks/web/useCopyToClipboard'; |
15 | import { useMessage } from '/@/hooks/web/useMessage'; | 15 | import { useMessage } from '/@/hooks/web/useMessage'; |
16 | import { PageWrapper } from '/@/components/Page'; | 16 | import { PageWrapper } from '/@/components/Page'; |
17 | + import { Input } from 'ant-design-vue'; | ||
17 | 18 | ||
18 | export default defineComponent({ | 19 | export default defineComponent({ |
19 | name: 'Copy', | 20 | name: 'Copy', |
20 | - components: { CollapseContainer, PageWrapper }, | 21 | + components: { CollapseContainer, PageWrapper, [Input.name]: Input }, |
21 | setup() { | 22 | setup() { |
22 | const valueRef = ref(''); | 23 | const valueRef = ref(''); |
23 | const { createMessage } = useMessage(); | 24 | const { createMessage } = useMessage(); |
src/views/demo/feat/download/index.vue
@@ -25,9 +25,10 @@ | @@ -25,9 +25,10 @@ | ||
25 | } from '/@/utils/file/download'; | 25 | } from '/@/utils/file/download'; |
26 | import imgBase64 from './imgBase64'; | 26 | import imgBase64 from './imgBase64'; |
27 | import { PageWrapper } from '/@/components/Page'; | 27 | import { PageWrapper } from '/@/components/Page'; |
28 | + import { Alert } from 'ant-design-vue'; | ||
28 | 29 | ||
29 | export default defineComponent({ | 30 | export default defineComponent({ |
30 | - components: { PageWrapper }, | 31 | + components: { PageWrapper, [Alert.name]: Alert }, |
31 | setup() { | 32 | setup() { |
32 | function handleDownByData() { | 33 | function handleDownByData() { |
33 | downloadByData('text content', 'testName.txt'); | 34 | downloadByData('text content', 'testName.txt'); |
src/views/demo/feat/tabs/index.vue
@@ -19,9 +19,11 @@ | @@ -19,9 +19,11 @@ | ||
19 | import { CollapseContainer } from '/@/components/Container/index'; | 19 | import { CollapseContainer } from '/@/components/Container/index'; |
20 | import { useTabs } from '/@/hooks/web/useTabs'; | 20 | import { useTabs } from '/@/hooks/web/useTabs'; |
21 | import { PageWrapper } from '/@/components/Page'; | 21 | import { PageWrapper } from '/@/components/Page'; |
22 | + import { Input } from 'ant-design-vue'; | ||
23 | + | ||
22 | export default defineComponent({ | 24 | export default defineComponent({ |
23 | name: 'TabsDemo', | 25 | name: 'TabsDemo', |
24 | - components: { CollapseContainer, PageWrapper }, | 26 | + components: { CollapseContainer, PageWrapper, [Input.name]: Input }, |
25 | setup() { | 27 | setup() { |
26 | const { closeAll, closeLeft, closeRight, closeOther, closeCurrent, refreshPage } = useTabs(); | 28 | const { closeAll, closeLeft, closeRight, closeOther, closeCurrent, refreshPage } = useTabs(); |
27 | 29 |
src/views/demo/form/CustomerForm.vue
@@ -62,7 +62,7 @@ | @@ -62,7 +62,7 @@ | ||
62 | }, | 62 | }, |
63 | ]; | 63 | ]; |
64 | export default defineComponent({ | 64 | export default defineComponent({ |
65 | - components: { BasicForm, CollapseContainer, PageWrapper }, | 65 | + components: { BasicForm, CollapseContainer, PageWrapper, [Input.name]: Input }, |
66 | setup() { | 66 | setup() { |
67 | const { createMessage } = useMessage(); | 67 | const { createMessage } = useMessage(); |
68 | const [register, { setProps }] = useForm({ | 68 | const [register, { setProps }] = useForm({ |
src/views/demo/page/account/center/Application.vue
@@ -29,7 +29,7 @@ | @@ -29,7 +29,7 @@ | ||
29 | </template> | 29 | </template> |
30 | <script lang="ts"> | 30 | <script lang="ts"> |
31 | import { defineComponent } from 'vue'; | 31 | import { defineComponent } from 'vue'; |
32 | - import { List, Card } from 'ant-design-vue'; | 32 | + import { List, Card, Row, Col } from 'ant-design-vue'; |
33 | import Icon from '/@/components/Icon/index'; | 33 | import Icon from '/@/components/Icon/index'; |
34 | import { applicationList } from './data'; | 34 | import { applicationList } from './data'; |
35 | 35 | ||
@@ -39,6 +39,8 @@ | @@ -39,6 +39,8 @@ | ||
39 | ListItem: List.Item, | 39 | ListItem: List.Item, |
40 | Card, | 40 | Card, |
41 | Icon, | 41 | Icon, |
42 | + [Row.name]: Row, | ||
43 | + [Col.name]: Col, | ||
42 | }, | 44 | }, |
43 | setup() { | 45 | setup() { |
44 | return { | 46 | return { |
src/views/demo/page/account/center/Project.vue
@@ -19,7 +19,7 @@ | @@ -19,7 +19,7 @@ | ||
19 | </template> | 19 | </template> |
20 | <script lang="ts"> | 20 | <script lang="ts"> |
21 | import { defineComponent } from 'vue'; | 21 | import { defineComponent } from 'vue'; |
22 | - import { List, Card } from 'ant-design-vue'; | 22 | + import { List, Card, Row, Col } from 'ant-design-vue'; |
23 | import demoImg from '/@/assets/images/demo.png'; | 23 | import demoImg from '/@/assets/images/demo.png'; |
24 | import { projectList } from './data'; | 24 | import { projectList } from './data'; |
25 | 25 | ||
@@ -28,6 +28,8 @@ | @@ -28,6 +28,8 @@ | ||
28 | List, | 28 | List, |
29 | ListItem: List.Item, | 29 | ListItem: List.Item, |
30 | Card, | 30 | Card, |
31 | + [Row.name]: Row, | ||
32 | + [Col.name]: Col, | ||
31 | }, | 33 | }, |
32 | setup() { | 34 | setup() { |
33 | return { | 35 | return { |
src/views/demo/page/account/center/index.vue
@@ -51,7 +51,7 @@ | @@ -51,7 +51,7 @@ | ||
51 | </template> | 51 | </template> |
52 | 52 | ||
53 | <script lang="ts"> | 53 | <script lang="ts"> |
54 | - import { Tag, Tabs } from 'ant-design-vue'; | 54 | + import { Tag, Tabs, Row, Col } from 'ant-design-vue'; |
55 | import { defineComponent } from 'vue'; | 55 | import { defineComponent } from 'vue'; |
56 | import { CollapseContainer } from '/@/components/Container/index'; | 56 | import { CollapseContainer } from '/@/components/Container/index'; |
57 | import Icon from '/@/components/Icon/index'; | 57 | import Icon from '/@/components/Icon/index'; |
@@ -72,6 +72,8 @@ | @@ -72,6 +72,8 @@ | ||
72 | Article, | 72 | Article, |
73 | Application, | 73 | Application, |
74 | Project, | 74 | Project, |
75 | + [Row.name]: Row, | ||
76 | + [Col.name]: Col, | ||
75 | }, | 77 | }, |
76 | setup() { | 78 | setup() { |
77 | return { | 79 | return { |
src/views/demo/page/account/setting/BaseSetting.vue
@@ -18,7 +18,7 @@ | @@ -18,7 +18,7 @@ | ||
18 | </CollapseContainer> | 18 | </CollapseContainer> |
19 | </template> | 19 | </template> |
20 | <script lang="ts"> | 20 | <script lang="ts"> |
21 | - import { Button, Upload } from 'ant-design-vue'; | 21 | + import { Button, Upload, Row, Col } from 'ant-design-vue'; |
22 | import { defineComponent, onMounted } from 'vue'; | 22 | import { defineComponent, onMounted } from 'vue'; |
23 | import { BasicForm, useForm } from '/@/components/Form/index'; | 23 | import { BasicForm, useForm } from '/@/components/Form/index'; |
24 | import { CollapseContainer } from '/@/components/Container/index'; | 24 | import { CollapseContainer } from '/@/components/Container/index'; |
@@ -31,7 +31,15 @@ | @@ -31,7 +31,15 @@ | ||
31 | import { baseSetschemas } from './data'; | 31 | import { baseSetschemas } from './data'; |
32 | 32 | ||
33 | export default defineComponent({ | 33 | export default defineComponent({ |
34 | - components: { BasicForm, CollapseContainer, Button, Upload, Icon }, | 34 | + components: { |
35 | + BasicForm, | ||
36 | + CollapseContainer, | ||
37 | + Button, | ||
38 | + Upload, | ||
39 | + Icon, | ||
40 | + [Row.name]: Row, | ||
41 | + [Col.name]: Col, | ||
42 | + }, | ||
35 | setup() { | 43 | setup() { |
36 | const { createMessage } = useMessage(); | 44 | const { createMessage } = useMessage(); |
37 | 45 |
src/views/demo/page/desc/basic/index.vue
@@ -29,6 +29,7 @@ | @@ -29,6 +29,7 @@ | ||
29 | import { Description } from '/@/components/Description/index'; | 29 | import { Description } from '/@/components/Description/index'; |
30 | import { BasicTable, useTable } from '/@/components/Table'; | 30 | import { BasicTable, useTable } from '/@/components/Table'; |
31 | import { PageWrapper } from '/@/components/Page'; | 31 | import { PageWrapper } from '/@/components/Page'; |
32 | + import { Divider } from 'ant-design-vue'; | ||
32 | 33 | ||
33 | import { | 34 | import { |
34 | refundSchema, | 35 | refundSchema, |
@@ -41,7 +42,7 @@ | @@ -41,7 +42,7 @@ | ||
41 | refundTimeTableData, | 42 | refundTimeTableData, |
42 | } from './data'; | 43 | } from './data'; |
43 | export default defineComponent({ | 44 | export default defineComponent({ |
44 | - components: { Description, BasicTable, PageWrapper }, | 45 | + components: { Description, BasicTable, PageWrapper, [Divider.name]: Divider }, |
45 | setup() { | 46 | setup() { |
46 | const [registerRefundTable] = useTable({ | 47 | const [registerRefundTable] = useTable({ |
47 | title: '退货商品', | 48 | title: '退货商品', |
src/views/demo/page/desc/high/index.vue
@@ -90,10 +90,24 @@ | @@ -90,10 +90,24 @@ | ||
90 | import { Description } from '/@/components/Description/index'; | 90 | import { Description } from '/@/components/Description/index'; |
91 | import { BasicTable, useTable } from '/@/components/Table'; | 91 | import { BasicTable, useTable } from '/@/components/Table'; |
92 | import { PageWrapper } from '/@/components/Page'; | 92 | import { PageWrapper } from '/@/components/Page'; |
93 | + import { Divider, Card, Empty, Descriptions, Steps, Tabs } from 'ant-design-vue'; | ||
93 | 94 | ||
94 | import { refundTimeTableSchema, refundTimeTableData } from './data'; | 95 | import { refundTimeTableSchema, refundTimeTableData } from './data'; |
95 | export default defineComponent({ | 96 | export default defineComponent({ |
96 | - components: { Description, BasicTable, PageWrapper }, | 97 | + components: { |
98 | + Description, | ||
99 | + BasicTable, | ||
100 | + PageWrapper, | ||
101 | + [Divider.name]: Divider, | ||
102 | + [Card.name]: Card, | ||
103 | + AEmpty: Empty, | ||
104 | + [Descriptions.name]: Descriptions, | ||
105 | + [Descriptions.Item.name]: Descriptions.Item, | ||
106 | + [Steps.name]: Steps, | ||
107 | + [Steps.Step.name]: Steps.Step, | ||
108 | + [Tabs.name]: Tabs, | ||
109 | + [Tabs.TabPane.name]: Tabs.TabPane, | ||
110 | + }, | ||
97 | setup() { | 111 | setup() { |
98 | const [registerTimeTable] = useTable({ | 112 | const [registerTimeTable] = useTable({ |
99 | title: '退货进度', | 113 | title: '退货进度', |
src/views/demo/page/form/high/index.vue
@@ -27,9 +27,10 @@ | @@ -27,9 +27,10 @@ | ||
27 | import PersonTable from './PersonTable.vue'; | 27 | import PersonTable from './PersonTable.vue'; |
28 | import { PageWrapper } from '/@/components/Page'; | 28 | import { PageWrapper } from '/@/components/Page'; |
29 | import { schemas, taskSchemas } from './data'; | 29 | import { schemas, taskSchemas } from './data'; |
30 | + import { Card } from 'ant-design-vue'; | ||
30 | 31 | ||
31 | export default defineComponent({ | 32 | export default defineComponent({ |
32 | - components: { BasicForm, PersonTable, PageWrapper }, | 33 | + components: { BasicForm, PersonTable, PageWrapper, [Card.name]: Card }, |
33 | setup() { | 34 | setup() { |
34 | const tableRef = ref<{ getDataSource: () => any } | null>(null); | 35 | const tableRef = ref<{ getDataSource: () => any } | null>(null); |
35 | 36 |
src/views/demo/page/form/step/Step1.vue
@@ -31,8 +31,16 @@ | @@ -31,8 +31,16 @@ | ||
31 | import { BasicForm, useForm } from '/@/components/Form'; | 31 | import { BasicForm, useForm } from '/@/components/Form'; |
32 | import { step1Schemas } from './data'; | 32 | import { step1Schemas } from './data'; |
33 | 33 | ||
34 | + import { Select, Input, Divider } from 'ant-design-vue'; | ||
34 | export default defineComponent({ | 35 | export default defineComponent({ |
35 | - components: { BasicForm }, | 36 | + components: { |
37 | + BasicForm, | ||
38 | + [Select.name]: Select, | ||
39 | + ASelectOption: Select.Option, | ||
40 | + [Input.name]: Input, | ||
41 | + [Input.Group.name]: Input.Group, | ||
42 | + [Divider.name]: Divider, | ||
43 | + }, | ||
36 | emits: ['next'], | 44 | emits: ['next'], |
37 | setup(_, { emit }) { | 45 | setup(_, { emit }) { |
38 | const [register, { validate }] = useForm({ | 46 | const [register, { validate }] = useForm({ |
src/views/demo/page/form/step/Step2.vue
@@ -15,9 +15,16 @@ | @@ -15,9 +15,16 @@ | ||
15 | import { defineComponent } from 'vue'; | 15 | import { defineComponent } from 'vue'; |
16 | import { BasicForm, useForm } from '/@/components/Form'; | 16 | import { BasicForm, useForm } from '/@/components/Form'; |
17 | import { step2Schemas } from './data'; | 17 | import { step2Schemas } from './data'; |
18 | + import { Alert, Divider, Descriptions } from 'ant-design-vue'; | ||
18 | 19 | ||
19 | export default defineComponent({ | 20 | export default defineComponent({ |
20 | - components: { BasicForm }, | 21 | + components: { |
22 | + BasicForm, | ||
23 | + [Alert.name]: Alert, | ||
24 | + [Divider.name]: Divider, | ||
25 | + [Descriptions.name]: Descriptions, | ||
26 | + [Descriptions.Item.name]: Descriptions.Item, | ||
27 | + }, | ||
21 | emits: ['next', 'prev'], | 28 | emits: ['next', 'prev'], |
22 | setup(_, { emit }) { | 29 | setup(_, { emit }) { |
23 | const [register, { validate, setProps }] = useForm({ | 30 | const [register, { validate, setProps }] = useForm({ |
src/views/demo/page/form/step/Step3.vue
@@ -18,9 +18,13 @@ | @@ -18,9 +18,13 @@ | ||
18 | </template> | 18 | </template> |
19 | <script lang="ts"> | 19 | <script lang="ts"> |
20 | import { defineComponent } from 'vue'; | 20 | import { defineComponent } from 'vue'; |
21 | - | 21 | + import { Result, Descriptions } from 'ant-design-vue'; |
22 | export default defineComponent({ | 22 | export default defineComponent({ |
23 | - components: {}, | 23 | + components: { |
24 | + [Result.name]: Result, | ||
25 | + [Descriptions.name]: Descriptions, | ||
26 | + [Descriptions.Item.name]: Descriptions.Item, | ||
27 | + }, | ||
24 | emits: ['redo'], | 28 | emits: ['redo'], |
25 | setup(_, { emit }) { | 29 | setup(_, { emit }) { |
26 | return { | 30 | return { |
src/views/demo/page/form/step/index.vue
@@ -30,9 +30,17 @@ | @@ -30,9 +30,17 @@ | ||
30 | import Step2 from './Step2.vue'; | 30 | import Step2 from './Step2.vue'; |
31 | import Step3 from './Step3.vue'; | 31 | import Step3 from './Step3.vue'; |
32 | import { PageWrapper } from '/@/components/Page'; | 32 | import { PageWrapper } from '/@/components/Page'; |
33 | + import { Steps } from 'ant-design-vue'; | ||
33 | 34 | ||
34 | export default defineComponent({ | 35 | export default defineComponent({ |
35 | - components: { Step1, Step2, Step3, PageWrapper }, | 36 | + components: { |
37 | + Step1, | ||
38 | + Step2, | ||
39 | + Step3, | ||
40 | + PageWrapper, | ||
41 | + [Steps.name]: Steps, | ||
42 | + [Steps.Step.name]: Steps.Step, | ||
43 | + }, | ||
36 | setup() { | 44 | setup() { |
37 | const current = ref(0); | 45 | const current = ref(0); |
38 | 46 |
src/views/demo/page/list/basic/index.vue
@@ -49,14 +49,24 @@ | @@ -49,14 +49,24 @@ | ||
49 | </PageWrapper> | 49 | </PageWrapper> |
50 | </template> | 50 | </template> |
51 | <script lang="ts"> | 51 | <script lang="ts"> |
52 | - import { Progress } from 'ant-design-vue'; | 52 | + import { Progress, Row, Col } from 'ant-design-vue'; |
53 | import { defineComponent } from 'vue'; | 53 | import { defineComponent } from 'vue'; |
54 | import Icon from '/@/components/Icon/index'; | 54 | import Icon from '/@/components/Icon/index'; |
55 | import { cardList } from './data'; | 55 | import { cardList } from './data'; |
56 | import { PageWrapper } from '/@/components/Page'; | 56 | import { PageWrapper } from '/@/components/Page'; |
57 | + import { List } from 'ant-design-vue'; | ||
57 | 58 | ||
58 | export default defineComponent({ | 59 | export default defineComponent({ |
59 | - components: { Icon, Progress, PageWrapper }, | 60 | + components: { |
61 | + Icon, | ||
62 | + Progress, | ||
63 | + PageWrapper, | ||
64 | + [List.name]: List, | ||
65 | + [List.Item.name]: List.Item, | ||
66 | + AListItemMeta: List.Item.Meta, | ||
67 | + [Row.name]: Row, | ||
68 | + [Col.name]: Col, | ||
69 | + }, | ||
60 | setup() { | 70 | setup() { |
61 | return { | 71 | return { |
62 | prefixCls: 'list-basic', | 72 | prefixCls: 'list-basic', |
src/views/demo/page/list/card/index.vue
@@ -37,9 +37,18 @@ | @@ -37,9 +37,18 @@ | ||
37 | import Icon from '/@/components/Icon/index'; | 37 | import Icon from '/@/components/Icon/index'; |
38 | import { cardList } from './data'; | 38 | import { cardList } from './data'; |
39 | import { PageWrapper } from '/@/components/Page'; | 39 | import { PageWrapper } from '/@/components/Page'; |
40 | + import { Card, Row, Col, List } from 'ant-design-vue'; | ||
40 | 41 | ||
41 | export default defineComponent({ | 42 | export default defineComponent({ |
42 | - components: { Icon, PageWrapper }, | 43 | + components: { |
44 | + Icon, | ||
45 | + PageWrapper, | ||
46 | + [Card.name]: Card, | ||
47 | + [List.name]: List, | ||
48 | + [List.Item.name]: List.Item, | ||
49 | + [Row.name]: Row, | ||
50 | + [Col.name]: Col, | ||
51 | + }, | ||
43 | setup() { | 52 | setup() { |
44 | return { | 53 | return { |
45 | prefixCls: 'list-card', | 54 | prefixCls: 'list-card', |
src/views/demo/page/list/search/index.vue
@@ -53,9 +53,18 @@ | @@ -53,9 +53,18 @@ | ||
53 | import { BasicForm } from '/@/components/Form/index'; | 53 | import { BasicForm } from '/@/components/Form/index'; |
54 | import { actions, searchList, schemas } from './data'; | 54 | import { actions, searchList, schemas } from './data'; |
55 | import { PageWrapper } from '/@/components/Page'; | 55 | import { PageWrapper } from '/@/components/Page'; |
56 | + import { List } from 'ant-design-vue'; | ||
56 | 57 | ||
57 | export default defineComponent({ | 58 | export default defineComponent({ |
58 | - components: { Icon, Tag, BasicForm, PageWrapper }, | 59 | + components: { |
60 | + Icon, | ||
61 | + Tag, | ||
62 | + BasicForm, | ||
63 | + PageWrapper, | ||
64 | + [List.name]: List, | ||
65 | + [List.Item.name]: List.Item, | ||
66 | + AListItemMeta: List.Item.Meta, | ||
67 | + }, | ||
59 | setup() { | 68 | setup() { |
60 | return { | 69 | return { |
61 | prefixCls: 'list-search', | 70 | prefixCls: 'list-search', |
src/views/sys/login/Login.vue
@@ -10,7 +10,7 @@ | @@ -10,7 +10,7 @@ | ||
10 | <h1>{{ title }}</h1> | 10 | <h1>{{ title }}</h1> |
11 | </header> | 11 | </header> |
12 | 12 | ||
13 | - <a-form class="mx-auto mt-10" :model="formData" :rules="formRules" ref="formRef"> | 13 | + <a-form class="login-form__main" :model="formData" :rules="formRules" ref="formRef"> |
14 | <a-form-item name="account"> | 14 | <a-form-item name="account"> |
15 | <a-input size="large" v-model:value="formData.account" placeholder="username: vben" /> | 15 | <a-input size="large" v-model:value="formData.account" placeholder="username: vben" /> |
16 | </a-form-item> | 16 | </a-form-item> |
@@ -23,9 +23,6 @@ | @@ -23,9 +23,6 @@ | ||
23 | /> | 23 | /> |
24 | </a-form-item> | 24 | </a-form-item> |
25 | 25 | ||
26 | - <!-- <a-form-item name="verify" v-if="openLoginVerify"> | ||
27 | - <BasicDragVerify v-model:value="formData.verify" ref="verifyRef" /> | ||
28 | - </a-form-item> --> | ||
29 | <a-row> | 26 | <a-row> |
30 | <a-col :span="12"> | 27 | <a-col :span="12"> |
31 | <a-form-item> | 28 | <a-form-item> |
@@ -61,15 +58,13 @@ | @@ -61,15 +58,13 @@ | ||
61 | </template> | 58 | </template> |
62 | <script lang="ts"> | 59 | <script lang="ts"> |
63 | import { defineComponent, reactive, ref, unref, toRaw } from 'vue'; | 60 | import { defineComponent, reactive, ref, unref, toRaw } from 'vue'; |
64 | - import { Checkbox } from 'ant-design-vue'; | 61 | + import { Checkbox, Form, Input, Row, Col } from 'ant-design-vue'; |
65 | 62 | ||
66 | import { Button } from '/@/components/Button'; | 63 | import { Button } from '/@/components/Button'; |
67 | import { AppLocalePicker } from '/@/components/Application'; | 64 | import { AppLocalePicker } from '/@/components/Application'; |
68 | - // import { BasicDragVerify, DragVerifyActionType } from '/@/components/Verify/index'; | ||
69 | 65 | ||
70 | import { userStore } from '/@/store/modules/user'; | 66 | import { userStore } from '/@/store/modules/user'; |
71 | 67 | ||
72 | - // import { appStore } from '/@/store/modules/app'; | ||
73 | import { useMessage } from '/@/hooks/web/useMessage'; | 68 | import { useMessage } from '/@/hooks/web/useMessage'; |
74 | import { useGlobSetting, useProjectSetting } from '/@/hooks/setting'; | 69 | import { useGlobSetting, useProjectSetting } from '/@/hooks/setting'; |
75 | import logo from '/@/assets/images/logo.png'; | 70 | import logo from '/@/assets/images/logo.png'; |
@@ -77,27 +72,28 @@ | @@ -77,27 +72,28 @@ | ||
77 | 72 | ||
78 | export default defineComponent({ | 73 | export default defineComponent({ |
79 | components: { | 74 | components: { |
80 | - // BasicDragVerify, | 75 | + [Checkbox.name]: Checkbox, |
76 | + [Form.name]: Form, | ||
77 | + [Form.Item.name]: Form.Item, | ||
78 | + [Input.name]: Input, | ||
79 | + [Input.Password.name]: Input.Password, | ||
81 | AButton: Button, | 80 | AButton: Button, |
82 | - ACheckbox: Checkbox, | ||
83 | AppLocalePicker, | 81 | AppLocalePicker, |
82 | + [Row.name]: Row, | ||
83 | + [Col.name]: Col, | ||
84 | }, | 84 | }, |
85 | setup() { | 85 | setup() { |
86 | const formRef = ref<any>(null); | 86 | const formRef = ref<any>(null); |
87 | const autoLoginRef = ref(false); | 87 | const autoLoginRef = ref(false); |
88 | - // const verifyRef = ref<RefInstanceType<DragVerifyActionType>>(null); | ||
89 | 88 | ||
90 | const globSetting = useGlobSetting(); | 89 | const globSetting = useGlobSetting(); |
91 | const { locale } = useProjectSetting(); | 90 | const { locale } = useProjectSetting(); |
92 | const { notification } = useMessage(); | 91 | const { notification } = useMessage(); |
93 | const { t } = useI18n(); | 92 | const { t } = useI18n(); |
94 | 93 | ||
95 | - // const openLoginVerifyRef = computed(() => appStore.getProjectConfig.openLoginVerify); | ||
96 | - | ||
97 | const formData = reactive({ | 94 | const formData = reactive({ |
98 | account: 'vben', | 95 | account: 'vben', |
99 | password: '123456', | 96 | password: '123456', |
100 | - // verify: undefined, | ||
101 | }); | 97 | }); |
102 | 98 | ||
103 | const formState = reactive({ | 99 | const formState = reactive({ |
@@ -109,16 +105,8 @@ | @@ -109,16 +105,8 @@ | ||
109 | password: [ | 105 | password: [ |
110 | { required: true, message: t('sys.login.passwordPlaceholder'), trigger: 'blur' }, | 106 | { required: true, message: t('sys.login.passwordPlaceholder'), trigger: 'blur' }, |
111 | ], | 107 | ], |
112 | - // verify: unref(openLoginVerifyRef) ? [{ required: true, message: '请通过验证码校验' }] : [], | ||
113 | }); | 108 | }); |
114 | 109 | ||
115 | - // function resetVerify() { | ||
116 | - // const verify = unref(verifyRef); | ||
117 | - // if (!verify) return; | ||
118 | - // formData.verify && verify.$.resume(); | ||
119 | - // formData.verify = undefined; | ||
120 | - // } | ||
121 | - | ||
122 | async function handleLogin() { | 110 | async function handleLogin() { |
123 | const form = unref(formRef); | 111 | const form = unref(formRef); |
124 | if (!form) return; | 112 | if (!form) return; |
@@ -140,19 +128,16 @@ | @@ -140,19 +128,16 @@ | ||
140 | } | 128 | } |
141 | } catch (error) { | 129 | } catch (error) { |
142 | } finally { | 130 | } finally { |
143 | - // resetVerify(); | ||
144 | formState.loading = false; | 131 | formState.loading = false; |
145 | } | 132 | } |
146 | } | 133 | } |
147 | return { | 134 | return { |
148 | formRef, | 135 | formRef, |
149 | - // verifyRef, | ||
150 | formData, | 136 | formData, |
151 | formState, | 137 | formState, |
152 | formRules, | 138 | formRules, |
153 | login: handleLogin, | 139 | login: handleLogin, |
154 | autoLogin: autoLoginRef, | 140 | autoLogin: autoLoginRef, |
155 | - // openLoginVerify: openLoginVerifyRef, | ||
156 | title: globSetting && globSetting.title, | 141 | title: globSetting && globSetting.title, |
157 | logo, | 142 | logo, |
158 | t, | 143 | t, |
@@ -196,6 +181,10 @@ | @@ -196,6 +181,10 @@ | ||
196 | background-clip: padding-box; | 181 | background-clip: padding-box; |
197 | .respond-to(xlarge, { margin: 0 120px 0 50px}); | 182 | .respond-to(xlarge, { margin: 0 120px 0 50px}); |
198 | 183 | ||
184 | + &__main { | ||
185 | + margin: 30px auto 0 auto !important; | ||
186 | + } | ||
187 | + | ||
199 | &-wrap { | 188 | &-wrap { |
200 | position: absolute; | 189 | position: absolute; |
201 | top: 0; | 190 | top: 0; |
vite.config.ts
@@ -88,10 +88,11 @@ export default ({ command, mode }: ConfigEnv): UserConfig => { | @@ -88,10 +88,11 @@ export default ({ command, mode }: ConfigEnv): UserConfig => { | ||
88 | 88 | ||
89 | optimizeDeps: { | 89 | optimizeDeps: { |
90 | include: [ | 90 | include: [ |
91 | + 'moment', | ||
91 | '@ant-design/icons-vue', | 92 | '@ant-design/icons-vue', |
92 | 'echarts/map/js/china', | 93 | 'echarts/map/js/china', |
93 | 'ant-design-vue/es/locale/zh_CN', | 94 | 'ant-design-vue/es/locale/zh_CN', |
94 | - 'moment/dist/locale/zh-cn', | 95 | + 'moment/locale/zh-cn', |
95 | 'ant-design-vue/es/locale/en_US', | 96 | 'ant-design-vue/es/locale/en_US', |
96 | ], | 97 | ], |
97 | }, | 98 | }, |
yarn.lock
@@ -5691,7 +5691,7 @@ modify-values@^1.0.0: | @@ -5691,7 +5691,7 @@ modify-values@^1.0.0: | ||
5691 | resolved "https://registry.npmjs.org/modify-values/-/modify-values-1.0.1.tgz#b3939fa605546474e3e3e3c63d64bd43b4ee6022" | 5691 | resolved "https://registry.npmjs.org/modify-values/-/modify-values-1.0.1.tgz#b3939fa605546474e3e3e3c63d64bd43b4ee6022" |
5692 | integrity sha512-xV2bxeN6F7oYjZWTe/YPAy6MN2M+sL4u/Rlm2AHCIVGfo2p1yGmBHQ6vHehl4bRTZBdHu3TSkWdYgkwpYzAGSw== | 5692 | integrity sha512-xV2bxeN6F7oYjZWTe/YPAy6MN2M+sL4u/Rlm2AHCIVGfo2p1yGmBHQ6vHehl4bRTZBdHu3TSkWdYgkwpYzAGSw== |
5693 | 5693 | ||
5694 | -moment@^2.27.0, moment@^2.29.1: | 5694 | +moment@^2.27.0: |
5695 | version "2.29.1" | 5695 | version "2.29.1" |
5696 | resolved "https://registry.npmjs.org/moment/-/moment-2.29.1.tgz#b2be769fa31940be9eeea6469c075e35006fa3d3" | 5696 | resolved "https://registry.npmjs.org/moment/-/moment-2.29.1.tgz#b2be769fa31940be9eeea6469c075e35006fa3d3" |
5697 | integrity sha512-kHmoybcPV8Sqy59DwNDY3Jefr64lK/by/da0ViFcuA4DH0vQg5Q6Ze5VimxkfQNSC+Mls/Kx53s7TjP1RhFEDQ== | 5697 | integrity sha512-kHmoybcPV8Sqy59DwNDY3Jefr64lK/by/da0ViFcuA4DH0vQg5Q6Ze5VimxkfQNSC+Mls/Kx53s7TjP1RhFEDQ== |
@@ -8086,10 +8086,10 @@ vite-plugin-pwa@^0.3.8: | @@ -8086,10 +8086,10 @@ vite-plugin-pwa@^0.3.8: | ||
8086 | pretty-bytes "^5.5.0" | 8086 | pretty-bytes "^5.5.0" |
8087 | workbox-build "^6.0.2" | 8087 | workbox-build "^6.0.2" |
8088 | 8088 | ||
8089 | -vite-plugin-style-import@^0.2.1: | ||
8090 | - version "0.2.1" | ||
8091 | - resolved "https://registry.npmjs.org/vite-plugin-style-import/-/vite-plugin-style-import-0.2.1.tgz#9ad5890697efe360853e6f2e0d7dc2c92227d2d6" | ||
8092 | - integrity sha512-mbRBOz4FMZseLQ5N+QUpFoG6tkIfdRfjIRykgfYn3s4SQCivdvkDWeqPsEQY8K8Q5valwCpqP9UAnNxc0dJbQQ== | 8089 | +vite-plugin-style-import@^0.4.0: |
8090 | + version "0.4.0" | ||
8091 | + resolved "https://registry.npmjs.org/vite-plugin-style-import/-/vite-plugin-style-import-0.4.0.tgz#050664a6d3ce78bb1a32f7ac8e971ee49ab889f4" | ||
8092 | + integrity sha512-OXQ0J9Mtndag0dmSKGKpu3T2NbVvKm6vbIa1M6RprVVThRAwBgX+LSwhK7GRQiSDGH5aI6yZuVQRloVFx+pK+Q== | ||
8093 | dependencies: | 8093 | dependencies: |
8094 | "@babel/core" "^7.12.10" | 8094 | "@babel/core" "^7.12.10" |
8095 | "@babel/helper-module-imports" "^7.12.5" | 8095 | "@babel/helper-module-imports" "^7.12.5" |
@@ -8097,10 +8097,10 @@ vite-plugin-style-import@^0.2.1: | @@ -8097,10 +8097,10 @@ vite-plugin-style-import@^0.2.1: | ||
8097 | "@rollup/pluginutils" "^4.1.0" | 8097 | "@rollup/pluginutils" "^4.1.0" |
8098 | change-case "^4.1.2" | 8098 | change-case "^4.1.2" |
8099 | 8099 | ||
8100 | -vite@^2.0.0-beta.30: | ||
8101 | - version "2.0.0-beta.30" | ||
8102 | - resolved "https://registry.npmjs.org/vite/-/vite-2.0.0-beta.30.tgz#d0c1056d1fb05c489614360f92363eebec41a6b4" | ||
8103 | - integrity sha512-wOeO64J3k4jGjCOkH/6RUcIyT/HOTaDZSiXE75aWYqV9hI7Q6uEeSXbAFtb9bG82RGLEWdsqtCvx5t7gaeqtsw== | 8100 | +vite@^2.0.0-beta.31: |
8101 | + version "2.0.0-beta.31" | ||
8102 | + resolved "https://registry.npmjs.org/vite/-/vite-2.0.0-beta.31.tgz#0ce5f6c496c29f72062f9f0ae70dd6dfb18b0916" | ||
8103 | + integrity sha512-tHBgSsSp0+dbz8tas6zOj2KbJSKOme62jXN13rk8BZdJEum5FDnwon9+7oas4db3NnVBLnciWa1r8QUNoOZjrA== | ||
8104 | dependencies: | 8104 | dependencies: |
8105 | esbuild "^0.8.26" | 8105 | esbuild "^0.8.26" |
8106 | postcss "^8.2.1" | 8106 | postcss "^8.2.1" |