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