@gx-design-vue/create-gx-cli 0.0.5 → 0.0.6
Sign up to get free protection for your applications and to get access to all the features.
- package/package.json +1 -1
- package/src/cli.js +1 -1
- package/src/main.js +4 -0
- package/template-design-pro/.editorconfig +0 -19
- package/template-design-pro/.env +0 -2
- package/template-design-pro/.env.development +0 -18
- package/template-design-pro/.env.pro +0 -32
- package/template-design-pro/.env.production +0 -32
- package/template-design-pro/.env.test +0 -20
- package/template-design-pro/.eslintignore +0 -16
- package/template-design-pro/.eslintrc.js +0 -64
- package/template-design-pro/.gitpod.yml +0 -6
- package/template-design-pro/.husky/pre-commit +0 -4
- package/template-design-pro/.prettierignore +0 -9
- package/template-design-pro/.stylelintignore +0 -3
- package/template-design-pro/.yarnclean +0 -48
- package/template-design-pro/LICENSE +0 -21
- package/template-design-pro/README.md +0 -111
- package/template-design-pro/build/constant.ts +0 -6
- package/template-design-pro/build/generate/generateModifyVars.ts +0 -18
- package/template-design-pro/build/getConfigFileName.ts +0 -13
- package/template-design-pro/build/script/buildConf.ts +0 -44
- package/template-design-pro/build/script/postBuild.ts +0 -25
- package/template-design-pro/build/script/reSetRootHtml.ts +0 -20
- package/template-design-pro/build/utils.ts +0 -85
- package/template-design-pro/build/vite/cdn.ts +0 -7
- package/template-design-pro/build/vite/optimizer.ts +0 -22
- package/template-design-pro/build/vite/plugin/autoImport.ts +0 -18
- package/template-design-pro/build/vite/plugin/compress.ts +0 -35
- package/template-design-pro/build/vite/plugin/hmr.ts +0 -25
- package/template-design-pro/build/vite/plugin/html.ts +0 -47
- package/template-design-pro/build/vite/plugin/index.ts +0 -89
- package/template-design-pro/build/vite/plugin/mock.ts +0 -20
- package/template-design-pro/build/vite/plugin/pwa.ts +0 -37
- package/template-design-pro/build/vite/plugin/styleImport.ts +0 -129
- package/template-design-pro/build/vite/plugin/visualizer.ts +0 -17
- package/template-design-pro/build/vite/plugin/vite-plugin-antd-theme/index.ts +0 -24
- package/template-design-pro/build/vite/plugin/vite-plugin-mock/createMockServer.ts +0 -303
- package/template-design-pro/build/vite/plugin/vite-plugin-mock/createProdMockServer.ts +0 -93
- package/template-design-pro/build/vite/plugin/vite-plugin-mock/index.ts +0 -68
- package/template-design-pro/build/vite/plugin/vite-plugin-mock/types.ts +0 -30
- package/template-design-pro/build/vite/plugin/vite-plugin-mock/utils.ts +0 -26
- package/template-design-pro/commitlint.config.js +0 -32
- package/template-design-pro/config/config.ts +0 -14
- package/template-design-pro/config/default/animate.ts +0 -30
- package/template-design-pro/config/default/defaultSettings.ts +0 -75
- package/template-design-pro/config/default/network.ts +0 -16
- package/template-design-pro/config/default/proxy.ts +0 -26
- package/template-design-pro/config/default/theme.ts +0 -43
- package/template-design-pro/config/default/themeColor.ts +0 -62
- package/template-design-pro/index.html +0 -45
- package/template-design-pro/jest.config.mjs +0 -36
- package/template-design-pro/mock/_createProductionServer.ts +0 -19
- package/template-design-pro/mock/_util.ts +0 -55
- package/template-design-pro/mock/controller/menu.ts +0 -85
- package/template-design-pro/mock/controller/notices.ts +0 -114
- package/template-design-pro/mock/system/dict.ts +0 -60
- package/template-design-pro/mock/system/user.ts +0 -218
- package/template-design-pro/package.json +0 -151
- package/template-design-pro/pnpm-lock.yaml +0 -9913
- package/template-design-pro/postcss.config.js +0 -5
- package/template-design-pro/prettier.config.js +0 -18
- package/template-design-pro/public/resource/css/index.css +0 -171
- package/template-design-pro/public/resource/img/favicon.ico +0 -0
- package/template-design-pro/public/resource/img/logo.png +0 -0
- package/template-design-pro/public/resource/img/pro_icon.svg +0 -5
- package/template-design-pro/public/resource/img/pwa-192x192.png +0 -0
- package/template-design-pro/public/resource/img/pwa-512x512.png +0 -0
- package/template-design-pro/src/App.vue +0 -47
- package/template-design-pro/src/assets/error_images/403.png +0 -0
- package/template-design-pro/src/assets/error_images/404.png +0 -0
- package/template-design-pro/src/assets/error_images/cloud.png +0 -0
- package/template-design-pro/src/assets/login_images/login_background.svg +0 -69
- package/template-design-pro/src/assets/logo.png +0 -0
- package/template-design-pro/src/assets/menu_font/iconfont.css +0 -94
- package/template-design-pro/src/assets/menu_font/iconfont.eot +0 -0
- package/template-design-pro/src/assets/menu_font/iconfont.js +0 -1
- package/template-design-pro/src/assets/menu_font/iconfont.json +0 -142
- package/template-design-pro/src/assets/menu_font/iconfont.svg +0 -57
- package/template-design-pro/src/assets/menu_font/iconfont.ttf +0 -0
- package/template-design-pro/src/assets/menu_font/iconfont.woff +0 -0
- package/template-design-pro/src/assets/menu_font/iconfont.woff2 +0 -0
- package/template-design-pro/src/assets/menu_font/index.less +0 -94
- package/template-design-pro/src/common/global.ts +0 -1
- package/template-design-pro/src/components/GDesign/ProLayout/BasicLayout.less +0 -80
- package/template-design-pro/src/components/GDesign/ProLayout/BasicLayout.tsx +0 -342
- package/template-design-pro/src/components/GDesign/ProLayout/PageLoading.tsx +0 -20
- package/template-design-pro/src/components/GDesign/ProLayout/RenderTypings.ts +0 -31
- package/template-design-pro/src/components/GDesign/ProLayout/RouteContext.tsx +0 -82
- package/template-design-pro/src/components/GDesign/ProLayout/WrapContent.tsx +0 -69
- package/template-design-pro/src/components/GDesign/ProLayout/components/GlobalFooter/index.tsx +0 -88
- package/template-design-pro/src/components/GDesign/ProLayout/components/GlobalHeader/DefaultHeader.tsx +0 -189
- package/template-design-pro/src/components/GDesign/ProLayout/components/GlobalHeader/Header.less +0 -8
- package/template-design-pro/src/components/GDesign/ProLayout/components/GlobalHeader/index.tsx +0 -105
- package/template-design-pro/src/components/GDesign/ProLayout/components/GlobalHeader/props.ts +0 -69
- package/template-design-pro/src/components/GDesign/ProLayout/components/GlobalHeader/style.less +0 -144
- package/template-design-pro/src/components/GDesign/ProLayout/components/LogoContent/index.tsx +0 -81
- package/template-design-pro/src/components/GDesign/ProLayout/components/LogoContent/props.ts +0 -29
- package/template-design-pro/src/components/GDesign/ProLayout/components/MultiTab/index.tsx +0 -384
- package/template-design-pro/src/components/GDesign/ProLayout/components/MultiTab/props.ts +0 -15
- package/template-design-pro/src/components/GDesign/ProLayout/components/MultiTab/style.less +0 -79
- package/template-design-pro/src/components/GDesign/ProLayout/components/NoticeIcon/NoticeIcon.tsx +0 -148
- package/template-design-pro/src/components/GDesign/ProLayout/components/NoticeIcon/NoticeList.module.less +0 -115
- package/template-design-pro/src/components/GDesign/ProLayout/components/NoticeIcon/NoticeList.tsx +0 -154
- package/template-design-pro/src/components/GDesign/ProLayout/components/NoticeIcon/index.less +0 -39
- package/template-design-pro/src/components/GDesign/ProLayout/components/NoticeIcon/index.tsx +0 -133
- package/template-design-pro/src/components/GDesign/ProLayout/components/PageContainer/index.tsx +0 -190
- package/template-design-pro/src/components/GDesign/ProLayout/components/PageContainer/props.ts +0 -48
- package/template-design-pro/src/components/GDesign/ProLayout/components/PageContainer/style.less +0 -128
- package/template-design-pro/src/components/GDesign/ProLayout/components/PageContainer/typings.ts +0 -0
- package/template-design-pro/src/components/GDesign/ProLayout/components/RightContent/AvatarDropdown.tsx +0 -63
- package/template-design-pro/src/components/GDesign/ProLayout/components/RightContent/HeaderSearch.tsx +0 -122
- package/template-design-pro/src/components/GDesign/ProLayout/components/RightContent/headerSearch.less +0 -30
- package/template-design-pro/src/components/GDesign/ProLayout/components/RightContent/index.tsx +0 -95
- package/template-design-pro/src/components/GDesign/ProLayout/components/RightContent/style.less +0 -90
- package/template-design-pro/src/components/GDesign/ProLayout/components/SettingDrawer/BlockCheckbox.tsx +0 -70
- package/template-design-pro/src/components/GDesign/ProLayout/components/SettingDrawer/LayoutSetting.tsx +0 -107
- package/template-design-pro/src/components/GDesign/ProLayout/components/SettingDrawer/ThemeColor.tsx +0 -68
- package/template-design-pro/src/components/GDesign/ProLayout/components/SettingDrawer/index.tsx +0 -346
- package/template-design-pro/src/components/GDesign/ProLayout/components/SiderMenu/BaseMenu.tsx +0 -224
- package/template-design-pro/src/components/GDesign/ProLayout/components/SiderMenu/SiderMenu.tsx +0 -224
- package/template-design-pro/src/components/GDesign/ProLayout/components/SiderMenu/index.tsx +0 -43
- package/template-design-pro/src/components/GDesign/ProLayout/components/SiderMenu/props.ts +0 -112
- package/template-design-pro/src/components/GDesign/ProLayout/components/SiderMenu/style.less +0 -262
- package/template-design-pro/src/components/GDesign/ProLayout/components/SiderMenu/typings.ts +0 -44
- package/template-design-pro/src/components/GDesign/ProLayout/default.less +0 -2
- package/template-design-pro/src/components/GDesign/ProLayout/defaultSettings.ts +0 -121
- package/template-design-pro/src/components/GDesign/ProLayout/hooks/context/index.ts +0 -45
- package/template-design-pro/src/components/GDesign/ProLayout/index.ts +0 -43
- package/template-design-pro/src/components/GDesign/ProLayout/props.ts +0 -57
- package/template-design-pro/src/components/GDesign/ProLayout/style.less +0 -272
- package/template-design-pro/src/components/GDesign/ProLayout/typings.ts +0 -1
- package/template-design-pro/src/components/GDesign/ProLayout/utils/getMenuData.ts +0 -31
- package/template-design-pro/src/components/GDesign/ProLayout/utils/index.ts +0 -94
- package/template-design-pro/src/components/GDesign/ProLayout/utils/isImg/index.ts +0 -6
- package/template-design-pro/src/components/GDesign/ProLayout/utils/isUrl/index.ts +0 -5
- package/template-design-pro/src/components/GDesign/Result/index.tsx +0 -142
- package/template-design-pro/src/components/GDesign/Result/style.less +0 -140
- package/template-design-pro/src/components/GDesign/Scrollbars/components/Bar/index.tsx +0 -56
- package/template-design-pro/src/components/GDesign/Scrollbars/components/Bar/props.ts +0 -23
- package/template-design-pro/src/components/GDesign/Scrollbars/components/Thumb/index.tsx +0 -164
- package/template-design-pro/src/components/GDesign/Scrollbars/components/Thumb/props.ts +0 -11
- package/template-design-pro/src/components/GDesign/Scrollbars/context.ts +0 -10
- package/template-design-pro/src/components/GDesign/Scrollbars/index.tsx +0 -200
- package/template-design-pro/src/components/GDesign/Scrollbars/props.ts +0 -65
- package/template-design-pro/src/components/GDesign/Scrollbars/style.less +0 -85
- package/template-design-pro/src/components/GDesign/Scrollbars/util.ts +0 -40
- package/template-design-pro/src/components/GDesign/utils/index.ts +0 -7
- package/template-design-pro/src/components/PageLoading/index.tsx +0 -44
- package/template-design-pro/src/components/PageTransition/index.vue +0 -98
- package/template-design-pro/src/components/index.ts +0 -6
- package/template-design-pro/src/core/ant-design/index.ts +0 -14
- package/template-design-pro/src/core/gx-admin-design/index.ts +0 -7
- package/template-design-pro/src/core/gx-admin-directives/index.ts +0 -8
- package/template-design-pro/src/core/gx-admin-directives/permission.ts +0 -28
- package/template-design-pro/src/core/gx-design/index.ts +0 -7
- package/template-design-pro/src/core/gx-pro-design/index.ts +0 -10
- package/template-design-pro/src/core/index.ts +0 -27
- package/template-design-pro/src/design/ant-design/index.less +0 -4
- package/template-design-pro/src/design/ant-design/layout.less +0 -29
- package/template-design-pro/src/design/ant-design/menu.less +0 -55
- package/template-design-pro/src/design/ant-design/table.less +0 -67
- package/template-design-pro/src/design/ant-design/tooltip.less +0 -13
- package/template-design-pro/src/design/color.less +0 -1
- package/template-design-pro/src/design/config.less +0 -5
- package/template-design-pro/src/design/index.less +0 -41
- package/template-design-pro/src/design/mixin.less +0 -66
- package/template-design-pro/src/design/normalize.less +0 -390
- package/template-design-pro/src/global.less +0 -15
- package/template-design-pro/src/hooks/core/index.ts +0 -3
- package/template-design-pro/src/hooks/core/useRequest/index.ts +0 -70
- package/template-design-pro/src/hooks/core/useRequest/typings.ts +0 -0
- package/template-design-pro/src/hooks/event/index.ts +0 -3
- package/template-design-pro/src/hooks/event/useClipboard.ts +0 -14
- package/template-design-pro/src/hooks/system/index.ts +0 -5
- package/template-design-pro/src/hooks/system/useDict.ts +0 -62
- package/template-design-pro/src/hooks/system/usePermissions.ts +0 -39
- package/template-design-pro/src/hooks/typings.ts +0 -17
- package/template-design-pro/src/layout/BasicLayout.vue +0 -104
- package/template-design-pro/src/layout/BlankLayout.vue +0 -5
- package/template-design-pro/src/layout/ContentView.vue +0 -76
- package/template-design-pro/src/layout/IframeView.vue +0 -1
- package/template-design-pro/src/layout/UserLayout.vue +0 -7
- package/template-design-pro/src/main.ts +0 -34
- package/template-design-pro/src/plugins/index.ts +0 -3
- package/template-design-pro/src/router/guard/index.ts +0 -84
- package/template-design-pro/src/router/guard/permissions.ts +0 -73
- package/template-design-pro/src/router/guard/stateGuard.ts +0 -11
- package/template-design-pro/src/router/helper/routeHelper.ts +0 -244
- package/template-design-pro/src/router/helper/utils.ts +0 -19
- package/template-design-pro/src/router/index.ts +0 -30
- package/template-design-pro/src/router/routes/index.ts +0 -85
- package/template-design-pro/src/router/routes/modules/workplace.ts +0 -19
- package/template-design-pro/src/services/common/index.ts +0 -11
- package/template-design-pro/src/services/controller/router.ts +0 -10
- package/template-design-pro/src/services/controller/user.ts +0 -35
- package/template-design-pro/src/services/system/dictData.ts +0 -10
- package/template-design-pro/src/services/system/notices.ts +0 -9
- package/template-design-pro/src/store/index.ts +0 -32
- package/template-design-pro/src/store/modules/dict.ts +0 -27
- package/template-design-pro/src/store/modules/permission.ts +0 -19
- package/template-design-pro/src/store/modules/routes.ts +0 -110
- package/template-design-pro/src/store/modules/settings.ts +0 -102
- package/template-design-pro/src/store/modules/tabsRouter.ts +0 -73
- package/template-design-pro/src/store/modules/user.ts +0 -153
- package/template-design-pro/src/utils/accessToken.ts +0 -93
- package/template-design-pro/src/utils/crypto.ts +0 -39
- package/template-design-pro/src/utils/env.ts +0 -52
- package/template-design-pro/src/utils/fetchFile.ts +0 -79
- package/template-design-pro/src/utils/index.ts +0 -127
- package/template-design-pro/src/utils/pageTitle.ts +0 -17
- package/template-design-pro/src/utils/request/XHR.ts +0 -131
- package/template-design-pro/src/utils/request/axiosCancel.ts +0 -60
- package/template-design-pro/src/utils/request/checkStatus.ts +0 -26
- package/template-design-pro/src/utils/request/index.ts +0 -145
- package/template-design-pro/src/utils/request/typings.ts +0 -114
- package/template-design-pro/src/utils/storage.ts +0 -194
- package/template-design-pro/src/utils/uploadFile.ts +0 -26
- package/template-design-pro/src/utils/util.ts +0 -278
- package/template-design-pro/src/utils/validate.ts +0 -221
- package/template-design-pro/src/views/Iframe/index.vue +0 -76
- package/template-design-pro/src/views/MenuOne/index.vue +0 -15
- package/template-design-pro/src/views/MenuTwo/index.vue +0 -13
- package/template-design-pro/src/views/exception/403/index.vue +0 -9
- package/template-design-pro/src/views/exception/404/index.vue +0 -9
- package/template-design-pro/src/views/user/login/index.vue +0 -110
- package/template-design-pro/src/views/user/login/style.less +0 -38
- package/template-design-pro/stylelint.config.js +0 -106
- package/template-design-pro/tests/__mocks__/fileMock.ts +0 -1
- package/template-design-pro/tests/__mocks__/styleMock.ts +0 -1
- package/template-design-pro/tests/__mocks__/workerMock.ts +0 -5
- package/template-design-pro/tests/server/README.md +0 -15
- package/template-design-pro/tests/server/controller/FileController.ts +0 -18
- package/template-design-pro/tests/server/controller/UserController.ts +0 -15
- package/template-design-pro/tests/server/ecosystem.config.js +0 -18
- package/template-design-pro/tests/server/index.ts +0 -63
- package/template-design-pro/tests/server/nodemon.json +0 -8
- package/template-design-pro/tests/server/package.json +0 -36
- package/template-design-pro/tests/server/routes.ts +0 -23
- package/template-design-pro/tests/server/service/FileService.ts +0 -54
- package/template-design-pro/tests/server/service/UserService.ts +0 -25
- package/template-design-pro/tests/server/tsconfig.json +0 -15
- package/template-design-pro/tests/server/utils.ts +0 -9
- package/template-design-pro/tests/server/yarn.lock +0 -2955
- package/template-design-pro/tests/test.spec.ts +0 -16
- package/template-design-pro/tsconfig.json +0 -47
- package/template-design-pro/types/auto-imports.d.ts +0 -61
- package/template-design-pro/types/config.d.ts +0 -100
- package/template-design-pro/types/global.d.ts +0 -103
- package/template-design-pro/types/gx-components.d.ts +0 -24
- package/template-design-pro/types/index.d.ts +0 -13
- package/template-design-pro/types/mock.d.ts +0 -23
- package/template-design-pro/types/module.d.ts +0 -16
- package/template-design-pro/types/response.d.ts +0 -15
- package/template-design-pro/types/route.d.ts +0 -89
- package/template-design-pro/vite.config.ts +0 -136
- package/template-design-pro/yarn.lock +0 -9697
package/template-design-pro/src/components/GDesign/ProLayout/components/RightContent/style.less
DELETED
@@ -1,90 +0,0 @@
|
|
1
|
-
@import '../../default.less';
|
2
|
-
@import './headerSearch.less';
|
3
|
-
|
4
|
-
@pro-layout-header-right-prefix-cls: ~'@{gx-prefix-pro}-header-right';
|
5
|
-
|
6
|
-
@pro-header-hover-bg: rgba(0, 0, 0, 0.025);
|
7
|
-
|
8
|
-
.@{pro-layout-header-right-prefix-cls} {
|
9
|
-
&.ant-space {
|
10
|
-
display: flex;
|
11
|
-
float: right;
|
12
|
-
height: 48px;
|
13
|
-
margin-left: auto;
|
14
|
-
overflow: hidden;
|
15
|
-
}
|
16
|
-
|
17
|
-
.@{pro-layout-header-right-prefix-cls}-action {
|
18
|
-
display: flex;
|
19
|
-
align-items: center;
|
20
|
-
height: 48px;
|
21
|
-
padding-left: 12px;
|
22
|
-
cursor: pointer;
|
23
|
-
transition: all 0.3s;
|
24
|
-
|
25
|
-
> span {
|
26
|
-
vertical-align: middle;
|
27
|
-
}
|
28
|
-
|
29
|
-
&:hover {
|
30
|
-
background: @pro-header-hover-bg;
|
31
|
-
}
|
32
|
-
|
33
|
-
&:global(.opened) {
|
34
|
-
background: @pro-header-hover-bg;
|
35
|
-
}
|
36
|
-
}
|
37
|
-
|
38
|
-
.@{pro-layout-header-right-prefix-cls}-account {
|
39
|
-
.@{pro-layout-header-right-prefix-cls}-avatar {
|
40
|
-
margin-right: 8px;
|
41
|
-
color: var(--ant-primary-color);
|
42
|
-
vertical-align: top;
|
43
|
-
background: rgba(255, 255, 255, 0.85);
|
44
|
-
}
|
45
|
-
}
|
46
|
-
|
47
|
-
.@{pro-layout-header-right-prefix-cls}-search {
|
48
|
-
padding: 0 12px;
|
49
|
-
|
50
|
-
&:hover {
|
51
|
-
background: transparent;
|
52
|
-
}
|
53
|
-
}
|
54
|
-
|
55
|
-
&-menu {
|
56
|
-
.anticon {
|
57
|
-
margin-right: 8px;
|
58
|
-
}
|
59
|
-
}
|
60
|
-
}
|
61
|
-
|
62
|
-
.dark {
|
63
|
-
.@{pro-layout-header-right-prefix-cls}-action {
|
64
|
-
&:hover {
|
65
|
-
background: #252a3d;
|
66
|
-
}
|
67
|
-
}
|
68
|
-
}
|
69
|
-
|
70
|
-
@media only screen and (max-width: @screen-md) {
|
71
|
-
.ant-divider-vertical {
|
72
|
-
vertical-align: unset;
|
73
|
-
}
|
74
|
-
|
75
|
-
.@{pro-layout-header-right-prefix-cls}-name {
|
76
|
-
display: none;
|
77
|
-
}
|
78
|
-
|
79
|
-
.@{pro-layout-header-right-prefix-cls} {
|
80
|
-
position: absolute;
|
81
|
-
top: 0;
|
82
|
-
right: 12px;
|
83
|
-
|
84
|
-
.@{pro-layout-header-right-prefix-cls}-account {
|
85
|
-
.@{pro-layout-header-right-prefix-cls}-avatar {
|
86
|
-
margin-right: 0;
|
87
|
-
}
|
88
|
-
}
|
89
|
-
}
|
90
|
-
}
|
@@ -1,70 +0,0 @@
|
|
1
|
-
import { computed, defineComponent } from 'vue'
|
2
|
-
import { Tooltip } from 'ant-design-vue'
|
3
|
-
import { CheckOutlined } from '@ant-design/icons-vue'
|
4
|
-
import { PropTypes } from '@/utils'
|
5
|
-
|
6
|
-
const BlockCheckboxProps = {
|
7
|
-
value: PropTypes.string,
|
8
|
-
list: PropTypes.array,
|
9
|
-
className: PropTypes.string
|
10
|
-
}
|
11
|
-
|
12
|
-
const BlockCheckbox = defineComponent({
|
13
|
-
props: BlockCheckboxProps,
|
14
|
-
emits: ['change'],
|
15
|
-
setup(props, { emit }) {
|
16
|
-
const baseClassName = computed(() => `${props.className}-block-checbox`)
|
17
|
-
|
18
|
-
const items = computed(
|
19
|
-
() =>
|
20
|
-
props.list || [
|
21
|
-
{
|
22
|
-
key: 'side',
|
23
|
-
title: '侧边菜单布局'
|
24
|
-
},
|
25
|
-
{
|
26
|
-
key: 'mix',
|
27
|
-
title: '混合菜单布局'
|
28
|
-
},
|
29
|
-
{
|
30
|
-
key: 'simple',
|
31
|
-
title: '简单菜单布局'
|
32
|
-
}
|
33
|
-
]
|
34
|
-
)
|
35
|
-
|
36
|
-
const disableStyle = {
|
37
|
-
cursor: 'not-allowed'
|
38
|
-
}
|
39
|
-
|
40
|
-
const handleChange = (key: string) => {
|
41
|
-
emit('change', key)
|
42
|
-
}
|
43
|
-
|
44
|
-
return () => {
|
45
|
-
const { value } = props
|
46
|
-
return (
|
47
|
-
<div class={baseClassName.value} key={value} style={{ minHeight: '42px' }}>
|
48
|
-
{items.value.map((item: any) => (
|
49
|
-
<Tooltip title={item.title} key={item.title}>
|
50
|
-
<div
|
51
|
-
class={[`${baseClassName.value}-item`, `${baseClassName.value}-item-${item.key}`]}
|
52
|
-
style={item.disable && disableStyle}
|
53
|
-
onClick={() => !item.disabled && handleChange(item.key)}
|
54
|
-
>
|
55
|
-
<CheckOutlined
|
56
|
-
class={`${baseClassName.value}-selectIcon`}
|
57
|
-
style={{
|
58
|
-
display: value === item.key ? 'block' : 'none'
|
59
|
-
}}
|
60
|
-
/>
|
61
|
-
</div>
|
62
|
-
</Tooltip>
|
63
|
-
))}
|
64
|
-
</div>
|
65
|
-
)
|
66
|
-
}
|
67
|
-
}
|
68
|
-
})
|
69
|
-
|
70
|
-
export default BlockCheckbox
|
@@ -1,107 +0,0 @@
|
|
1
|
-
import { computed, defineComponent } from 'vue'
|
2
|
-
import { Switch, List, Tooltip, Select } from 'ant-design-vue'
|
3
|
-
import { PropTypes } from '@/utils'
|
4
|
-
|
5
|
-
const LayoutSettingProps = {
|
6
|
-
splitMenus: PropTypes.looseBool,
|
7
|
-
fixedHeader: PropTypes.looseBool,
|
8
|
-
fixSiderbar: PropTypes.looseBool,
|
9
|
-
layout: PropTypes.oneOf(['side', 'mix', 'simple']),
|
10
|
-
className: PropTypes.string
|
11
|
-
}
|
12
|
-
|
13
|
-
export const renderLayoutSettingItem = (item: any) => {
|
14
|
-
const action = { ...item.action }
|
15
|
-
return (
|
16
|
-
<Tooltip title={item.disabled ? item.disabledReason : ''} placement="left">
|
17
|
-
<List.Item actions={[action]}>
|
18
|
-
<span style={{ opacity: item.disabled ? 0.5 : 1 }}>{item.title}</span>
|
19
|
-
</List.Item>
|
20
|
-
</Tooltip>
|
21
|
-
)
|
22
|
-
}
|
23
|
-
|
24
|
-
const LayoutSetting = defineComponent({
|
25
|
-
props: LayoutSettingProps,
|
26
|
-
emits: ['change'],
|
27
|
-
setup(props, { emit }) {
|
28
|
-
const layoutList = computed(() => [
|
29
|
-
{
|
30
|
-
title: '内容区域宽度',
|
31
|
-
disabled: false,
|
32
|
-
action: (
|
33
|
-
<Select
|
34
|
-
value={props.layout === 'wide' ? 'wide' : 'mix'}
|
35
|
-
options={[
|
36
|
-
{
|
37
|
-
label: '定宽',
|
38
|
-
value: 'wide'
|
39
|
-
},
|
40
|
-
{
|
41
|
-
label: '流式',
|
42
|
-
value: 'mix'
|
43
|
-
}
|
44
|
-
]}
|
45
|
-
onChange={(value: any) => handleChange('layout', value)}
|
46
|
-
/>
|
47
|
-
)
|
48
|
-
},
|
49
|
-
{
|
50
|
-
title: '固定 Header',
|
51
|
-
disabled: props.layout === 'mix',
|
52
|
-
action: (
|
53
|
-
<Switch
|
54
|
-
size="small"
|
55
|
-
disabled={
|
56
|
-
props.layout === 'mix' || props.layout === 'simple' || props.layout === 'wide'
|
57
|
-
}
|
58
|
-
checked={!!props.fixedHeader}
|
59
|
-
onChange={(checked) => handleChange('fixedHeader', checked)}
|
60
|
-
/>
|
61
|
-
)
|
62
|
-
},
|
63
|
-
{
|
64
|
-
title: '固定侧边菜单',
|
65
|
-
disabled: props.layout === 'mix',
|
66
|
-
action: (
|
67
|
-
<Switch
|
68
|
-
size="small"
|
69
|
-
disabled={props.layout === 'mix' || props.layout === 'wide'}
|
70
|
-
checked={!!props.fixSiderbar}
|
71
|
-
onChange={(checked) => handleChange('fixSiderbar', checked)}
|
72
|
-
/>
|
73
|
-
)
|
74
|
-
},
|
75
|
-
{
|
76
|
-
title: '自动分割菜单',
|
77
|
-
disabled: props.layout === 'side',
|
78
|
-
action: (
|
79
|
-
<Switch
|
80
|
-
size="small"
|
81
|
-
disabled={
|
82
|
-
props.layout === 'side' || props.layout === 'simple' || props.layout === 'wide'
|
83
|
-
}
|
84
|
-
checked={!!props.splitMenus}
|
85
|
-
onChange={(checked) => handleChange('splitMenus', checked)}
|
86
|
-
/>
|
87
|
-
)
|
88
|
-
}
|
89
|
-
])
|
90
|
-
|
91
|
-
const handleChange = (type: string, value: boolean | string | number) => {
|
92
|
-
emit('change', { type, value })
|
93
|
-
}
|
94
|
-
|
95
|
-
return () => {
|
96
|
-
return (
|
97
|
-
<List
|
98
|
-
split={false}
|
99
|
-
dataSource={layoutList.value}
|
100
|
-
renderItem={({ item }) => renderLayoutSettingItem(item)}
|
101
|
-
/>
|
102
|
-
)
|
103
|
-
}
|
104
|
-
}
|
105
|
-
})
|
106
|
-
|
107
|
-
export default LayoutSetting
|
package/template-design-pro/src/components/GDesign/ProLayout/components/SettingDrawer/ThemeColor.tsx
DELETED
@@ -1,68 +0,0 @@
|
|
1
|
-
import type { FunctionalComponent } from 'vue'
|
2
|
-
import { computed, defineComponent } from 'vue'
|
3
|
-
import { Tooltip, ConfigProvider } from 'ant-design-vue'
|
4
|
-
import { CheckOutlined } from '@ant-design/icons-vue'
|
5
|
-
import { PropTypes } from '@/utils'
|
6
|
-
|
7
|
-
const ThemeColorProps = {
|
8
|
-
title: PropTypes.string,
|
9
|
-
value: PropTypes.string,
|
10
|
-
colors: PropTypes.array,
|
11
|
-
className: PropTypes.string
|
12
|
-
}
|
13
|
-
|
14
|
-
const Tag: FunctionalComponent<{ color: string; check: boolean; className: string }> = ({
|
15
|
-
color,
|
16
|
-
check,
|
17
|
-
className
|
18
|
-
}) => {
|
19
|
-
return (
|
20
|
-
<div class={`${className}-block`} style={{ backgroundColor: color }}>
|
21
|
-
{check ? <CheckOutlined /> : null}
|
22
|
-
</div>
|
23
|
-
)
|
24
|
-
}
|
25
|
-
|
26
|
-
const ThemeColor = defineComponent({
|
27
|
-
props: ThemeColorProps,
|
28
|
-
emits: ['change'],
|
29
|
-
setup(props, { emit }) {
|
30
|
-
const baseClassName = computed(() => `${props.className}-theme-color`)
|
31
|
-
|
32
|
-
const handleChange = (key: string) => {
|
33
|
-
emit('change', key)
|
34
|
-
ConfigProvider.config({
|
35
|
-
theme: {
|
36
|
-
primaryColor: key
|
37
|
-
}
|
38
|
-
})
|
39
|
-
}
|
40
|
-
|
41
|
-
return () => {
|
42
|
-
const { value, title, colors = [], className } = props
|
43
|
-
return (
|
44
|
-
<div class={baseClassName.value} style={{ marginBottom: '24px' }}>
|
45
|
-
<h3 class={`${className}-title`}>{title}</h3>
|
46
|
-
<div class={`${baseClassName.value}-content`}>
|
47
|
-
{colors.map((item: any) => {
|
48
|
-
const check = value === item.color
|
49
|
-
return (
|
50
|
-
<Tooltip key={item.color} title={item.fileName}>
|
51
|
-
<Tag
|
52
|
-
className={className}
|
53
|
-
class={`${baseClassName.value}-block`}
|
54
|
-
color={item.color}
|
55
|
-
check={check}
|
56
|
-
onClick={() => handleChange(item.color)}
|
57
|
-
/>
|
58
|
-
</Tooltip>
|
59
|
-
)
|
60
|
-
})}
|
61
|
-
</div>
|
62
|
-
</div>
|
63
|
-
)
|
64
|
-
}
|
65
|
-
}
|
66
|
-
})
|
67
|
-
|
68
|
-
export default ThemeColor
|
package/template-design-pro/src/components/GDesign/ProLayout/components/SettingDrawer/index.tsx
DELETED
@@ -1,346 +0,0 @@
|
|
1
|
-
import type { FunctionalComponent, Ref } from 'vue'
|
2
|
-
import { defineComponent, reactive, ref, watch } from 'vue'
|
3
|
-
import { message, Drawer, List, Switch, Select, Button, Alert, Divider } from 'ant-design-vue'
|
4
|
-
import {
|
5
|
-
CloseOutlined,
|
6
|
-
SettingOutlined,
|
7
|
-
NotificationOutlined,
|
8
|
-
CopyOutlined
|
9
|
-
} from '@ant-design/icons-vue'
|
10
|
-
import config from '/config/config'
|
11
|
-
import { themeConfig } from '/config/default/themeColor'
|
12
|
-
import { PropTypes } from '@/utils'
|
13
|
-
import { useClipboard } from '@gx-admin/hooks/event'
|
14
|
-
import { getPrefixCls } from '@gx-design-vue/pro-utils'
|
15
|
-
import BlockCheckbox from './BlockCheckbox'
|
16
|
-
import ThemeColor from './ThemeColor'
|
17
|
-
import LayoutSetting, { renderLayoutSettingItem } from './LayoutSetting'
|
18
|
-
import { ProSettingsProps } from '../../defaultSettings'
|
19
|
-
|
20
|
-
const { defaultSettings, animate } = config
|
21
|
-
|
22
|
-
const { preset } = animate
|
23
|
-
|
24
|
-
export const settingDrawerProps = {
|
25
|
-
hideLoading: PropTypes.bool,
|
26
|
-
root: PropTypes.string.def(defaultSettings.viewScrollRoot),
|
27
|
-
settings: Object as PropType<ProSettingsProps>
|
28
|
-
}
|
29
|
-
|
30
|
-
const Body: FunctionalComponent<{ title: string; className: string }> = (
|
31
|
-
{ title = '', className = '' },
|
32
|
-
{ slots }
|
33
|
-
) => {
|
34
|
-
return (
|
35
|
-
<div style={{ marginBottom: '24px' }}>
|
36
|
-
<h3 class={`${className}-title`}>{title}</h3>
|
37
|
-
{slots.default?.()}
|
38
|
-
</div>
|
39
|
-
)
|
40
|
-
}
|
41
|
-
|
42
|
-
const updateTheme = (_: boolean, color?: string, hideMessageLoading?: boolean) => {
|
43
|
-
let hide: any = () => null
|
44
|
-
if (!hideMessageLoading) {
|
45
|
-
hide = message.loading('正在加载主题颜色')
|
46
|
-
}
|
47
|
-
|
48
|
-
document.documentElement.className = color
|
49
|
-
|
50
|
-
// 模拟加载主题
|
51
|
-
setTimeout(() => hide(), 500)
|
52
|
-
|
53
|
-
// localStorage.setItem('gx-theme', dark ? 'dark' : 'light')
|
54
|
-
}
|
55
|
-
|
56
|
-
const SettingDrawer = defineComponent({
|
57
|
-
props: settingDrawerProps,
|
58
|
-
emits: ['change'],
|
59
|
-
setup(props, { emit, slots }) {
|
60
|
-
const baseClassName = getPrefixCls({
|
61
|
-
suffixCls: 'setting-drawer',
|
62
|
-
isPor: true
|
63
|
-
})
|
64
|
-
|
65
|
-
const show: Ref<boolean> = ref(false)
|
66
|
-
|
67
|
-
const innerHeight: Ref<number> = ref(window.innerHeight)
|
68
|
-
|
69
|
-
watch(innerHeight, (value: number) => {
|
70
|
-
innerHeight.value = value
|
71
|
-
})
|
72
|
-
|
73
|
-
const iconStyle = reactive({
|
74
|
-
color: '#fff',
|
75
|
-
fontSize: 20
|
76
|
-
})
|
77
|
-
|
78
|
-
const genCopySettingJson = (settings) => JSON.stringify(settings)
|
79
|
-
|
80
|
-
const getThemeList = () => {
|
81
|
-
const themeList = [
|
82
|
-
{
|
83
|
-
key: 'light',
|
84
|
-
title: '亮色菜单风格'
|
85
|
-
},
|
86
|
-
{
|
87
|
-
key: 'dark',
|
88
|
-
title: '暗色菜单风格'
|
89
|
-
}
|
90
|
-
]
|
91
|
-
|
92
|
-
return {
|
93
|
-
themeList
|
94
|
-
}
|
95
|
-
}
|
96
|
-
|
97
|
-
const setShow = (flag: boolean) => {
|
98
|
-
show.value = flag
|
99
|
-
}
|
100
|
-
|
101
|
-
const changeSetting = (type: string, value: any, hideMessageLoading?: boolean) => {
|
102
|
-
if (type === 'primaryColor') {
|
103
|
-
updateTheme(value === 'realDark', value as string, !!hideMessageLoading)
|
104
|
-
}
|
105
|
-
|
106
|
-
emit('change', { type, value })
|
107
|
-
}
|
108
|
-
|
109
|
-
const { copy } = useClipboard('拷贝成功,请到 config/default/theme.js 中替换默认配置')
|
110
|
-
|
111
|
-
return () => {
|
112
|
-
const { root, settings, hideLoading } = props
|
113
|
-
|
114
|
-
const {
|
115
|
-
theme,
|
116
|
-
primaryColor,
|
117
|
-
layout,
|
118
|
-
splitMenus,
|
119
|
-
fixedHeader,
|
120
|
-
fixSiderbar,
|
121
|
-
showTabsBar,
|
122
|
-
fixedMultiTab,
|
123
|
-
showProgressBar,
|
124
|
-
animate
|
125
|
-
} = settings as ProSettingsProps
|
126
|
-
|
127
|
-
return (
|
128
|
-
<Drawer
|
129
|
-
visible={show.value}
|
130
|
-
width={300}
|
131
|
-
bodyStyle={{ padding: 0 }}
|
132
|
-
onClose={() => setShow(false)}
|
133
|
-
placement="right"
|
134
|
-
getContainer={document.querySelector(root) as HTMLInputElement}
|
135
|
-
style={{
|
136
|
-
zIndex: 1001
|
137
|
-
}}
|
138
|
-
handle={
|
139
|
-
<div class={`${baseClassName}-handle`} onClick={() => setShow(!show.value)}>
|
140
|
-
{show.value ? (
|
141
|
-
<CloseOutlined style={iconStyle} />
|
142
|
-
) : (
|
143
|
-
<SettingOutlined style={iconStyle} />
|
144
|
-
)}
|
145
|
-
</div>
|
146
|
-
}
|
147
|
-
>
|
148
|
-
<div style={{ height: `${innerHeight.value - 34 * 2}px` }}>
|
149
|
-
<g-bars>
|
150
|
-
<div class={`${baseClassName}-content`}>
|
151
|
-
<Body title="整体风格设置" className={baseClassName}>
|
152
|
-
<BlockCheckbox
|
153
|
-
className={baseClassName}
|
154
|
-
list={getThemeList().themeList}
|
155
|
-
value={theme}
|
156
|
-
onChange={(val) => {
|
157
|
-
changeSetting('theme', val, hideLoading)
|
158
|
-
}}
|
159
|
-
/>
|
160
|
-
</Body>
|
161
|
-
|
162
|
-
<ThemeColor
|
163
|
-
title="主题色"
|
164
|
-
className={baseClassName}
|
165
|
-
value={primaryColor}
|
166
|
-
colors={themeConfig}
|
167
|
-
onChange={(color) => {
|
168
|
-
changeSetting('primaryColor', color, hideLoading)
|
169
|
-
}}
|
170
|
-
/>
|
171
|
-
|
172
|
-
<Divider />
|
173
|
-
|
174
|
-
<Body title="导航模式" className={baseClassName}>
|
175
|
-
<BlockCheckbox
|
176
|
-
className={baseClassName}
|
177
|
-
value={layout}
|
178
|
-
onChange={(val) => {
|
179
|
-
changeSetting('layout', val, hideLoading)
|
180
|
-
}}
|
181
|
-
/>
|
182
|
-
</Body>
|
183
|
-
|
184
|
-
<LayoutSetting
|
185
|
-
splitMenus={splitMenus}
|
186
|
-
fixedHeader={fixedHeader}
|
187
|
-
fixSiderbar={fixSiderbar}
|
188
|
-
layout={layout}
|
189
|
-
onChange={({ type, value }) => {
|
190
|
-
changeSetting(type, value)
|
191
|
-
}}
|
192
|
-
/>
|
193
|
-
|
194
|
-
<Divider />
|
195
|
-
|
196
|
-
<Body title="其他设置" className={baseClassName}>
|
197
|
-
<List
|
198
|
-
split={false}
|
199
|
-
renderItem={({ item }) => renderLayoutSettingItem(item)}
|
200
|
-
dataSource={[
|
201
|
-
{
|
202
|
-
title: '多标签',
|
203
|
-
action: (
|
204
|
-
<Switch
|
205
|
-
size="small"
|
206
|
-
disabled={layout === 'simple'}
|
207
|
-
checked={!!showTabsBar}
|
208
|
-
onChange={(checked) => changeSetting('showTabsBar', checked)}
|
209
|
-
/>
|
210
|
-
)
|
211
|
-
},
|
212
|
-
{
|
213
|
-
title: '固定多标签',
|
214
|
-
action: (
|
215
|
-
<Switch
|
216
|
-
size="small"
|
217
|
-
disabled={layout === 'simple'}
|
218
|
-
checked={!!fixedMultiTab}
|
219
|
-
onChange={(checked) => changeSetting('fixedMultiTab', checked)}
|
220
|
-
/>
|
221
|
-
)
|
222
|
-
},
|
223
|
-
{
|
224
|
-
title: '顶部进度条',
|
225
|
-
action: (
|
226
|
-
<Switch
|
227
|
-
size="small"
|
228
|
-
checked={!!showProgressBar}
|
229
|
-
onChange={(checked) => changeSetting('showProgressBar', checked)}
|
230
|
-
/>
|
231
|
-
)
|
232
|
-
}
|
233
|
-
]}
|
234
|
-
/>
|
235
|
-
</Body>
|
236
|
-
|
237
|
-
<Divider />
|
238
|
-
|
239
|
-
<Body title="页面切换动画" className={baseClassName}>
|
240
|
-
<List
|
241
|
-
split={false}
|
242
|
-
renderItem={({ item }) => renderLayoutSettingItem(item)}
|
243
|
-
dataSource={[
|
244
|
-
{
|
245
|
-
title: '禁用动画',
|
246
|
-
action: (
|
247
|
-
<Switch
|
248
|
-
size="small"
|
249
|
-
checked={!animate?.disabled}
|
250
|
-
onChange={(checked) => changeSetting('showAnimate', checked)}
|
251
|
-
/>
|
252
|
-
)
|
253
|
-
},
|
254
|
-
{
|
255
|
-
title: '动画效果',
|
256
|
-
disabled: animate?.disabled,
|
257
|
-
action: (
|
258
|
-
<Select
|
259
|
-
value={animate?.name}
|
260
|
-
size="small"
|
261
|
-
disabled={animate?.disabled}
|
262
|
-
getPopupContainer={(trigger) => {
|
263
|
-
if (trigger && trigger.parentNode) {
|
264
|
-
return trigger.parentNode
|
265
|
-
}
|
266
|
-
return trigger
|
267
|
-
}}
|
268
|
-
onSelect={(value) => changeSetting('changeAnimateMode', value)}
|
269
|
-
style={{ width: '120px' }}
|
270
|
-
>
|
271
|
-
{preset.map((item: any) => (
|
272
|
-
<Select.Option value={item.name}>{item.alias}</Select.Option>
|
273
|
-
))}
|
274
|
-
</Select>
|
275
|
-
)
|
276
|
-
},
|
277
|
-
{
|
278
|
-
title: '动画方向',
|
279
|
-
disabled: animate?.disabled,
|
280
|
-
action: (
|
281
|
-
<Select
|
282
|
-
value={animate?.direction}
|
283
|
-
size="small"
|
284
|
-
disabled={animate?.disabled}
|
285
|
-
getPopupContainer={(trigger) => {
|
286
|
-
if (trigger && trigger.parentNode) {
|
287
|
-
return trigger.parentNode
|
288
|
-
}
|
289
|
-
return trigger
|
290
|
-
}}
|
291
|
-
onSelect={(value) => changeSetting('changeAnimateDirections', value)}
|
292
|
-
style={{ width: '120px' }}
|
293
|
-
>
|
294
|
-
{preset
|
295
|
-
.find((el: any) => el.name === animate?.name)
|
296
|
-
?.directions.map((item: any) => (
|
297
|
-
<Select.Option value={item}>{item}</Select.Option>
|
298
|
-
))}
|
299
|
-
</Select>
|
300
|
-
)
|
301
|
-
}
|
302
|
-
]}
|
303
|
-
/>
|
304
|
-
</Body>
|
305
|
-
|
306
|
-
<Divider />
|
307
|
-
|
308
|
-
<Alert
|
309
|
-
type="warning"
|
310
|
-
message={'配置栏只在开发环境用于预览,生产环境不会展现,请拷贝后手动修改配置文件'}
|
311
|
-
icon={<NotificationOutlined />}
|
312
|
-
showIcon
|
313
|
-
style={{ marginBottom: '16px' }}
|
314
|
-
/>
|
315
|
-
|
316
|
-
<Button
|
317
|
-
block
|
318
|
-
onClick={() => {
|
319
|
-
copy(genCopySettingJson({
|
320
|
-
primaryColor,
|
321
|
-
layout,
|
322
|
-
splitMenus,
|
323
|
-
fixedHeader,
|
324
|
-
fixSiderbar,
|
325
|
-
showTabsBar,
|
326
|
-
fixedMultiTab,
|
327
|
-
showProgressBar,
|
328
|
-
animate
|
329
|
-
}))
|
330
|
-
}}
|
331
|
-
>
|
332
|
-
<CopyOutlined />
|
333
|
-
拷贝设置
|
334
|
-
</Button>
|
335
|
-
|
336
|
-
<div class={`${baseClassName}-content-footer`}>{slots.default?.()}</div>
|
337
|
-
</div>
|
338
|
-
</g-bars>
|
339
|
-
</div>
|
340
|
-
</Drawer>
|
341
|
-
)
|
342
|
-
}
|
343
|
-
}
|
344
|
-
})
|
345
|
-
|
346
|
-
export default SettingDrawer
|