vue2-client 1.4.63 → 1.5.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (111) hide show
  1. package/CHANGELOG.md +498 -484
  2. package/index.js +30 -30
  3. package/package.json +78 -78
  4. package/src/base-client/components/common/AddressSearchCombobox/AddressSearchCombobox.vue +225 -225
  5. package/src/base-client/components/common/CreateQuery/CreateQuery.vue +602 -601
  6. package/src/base-client/components/common/CreateQuery/CreateQueryItem.vue +713 -782
  7. package/src/base-client/components/common/CreateSimpleFormQuery/CreateSimpleFormQuery.vue +436 -310
  8. package/src/base-client/components/common/CreateSimpleFormQuery/CreateSimpleFormQueryItem.vue +508 -553
  9. package/src/base-client/components/common/FormGroupEdit/FormGroupEdit.vue +151 -151
  10. package/src/base-client/components/common/FormGroupQuery/FormGroupQuery.vue +165 -165
  11. package/src/base-client/components/common/JSONToTree/jsontotree.vue +275 -275
  12. package/src/base-client/components/common/XAddForm/XAddForm.vue +325 -354
  13. package/src/base-client/components/common/XAddNativeForm/XAddNativeForm.vue +277 -327
  14. package/src/base-client/components/common/XCard/XCard.vue +64 -64
  15. package/src/base-client/components/common/XForm/XForm.vue +185 -274
  16. package/src/base-client/components/common/XForm/XFormItem.vue +485 -538
  17. package/src/base-client/components/common/XForm/index.md +177 -196
  18. package/src/base-client/components/common/XFormTable/XFormTable.vue +290 -570
  19. package/src/base-client/components/common/XFormTable/index.md +96 -96
  20. package/src/base-client/components/common/XTable/XTable.vue +504 -262
  21. package/src/base-client/components/common/XTreeOne/XTreeOne.vue +109 -109
  22. package/src/base-client/components/system/QueryParamsDetailsView/QueryParamsDetailsView.vue +281 -281
  23. package/src/base-client/components/ticket/TicketDetailsView/TicketDetailsView.vue +807 -807
  24. package/src/base-client/components/ticket/TicketDetailsView/index.md +29 -29
  25. package/src/base-client/components/ticket/TicketDetailsView/part/TicketDetailsFlow.vue +260 -260
  26. package/src/base-client/components/ticket/TicketSubmitSuccessView/TicketSubmitSuccessView.vue +532 -532
  27. package/src/base-client/components/ticket/TicketSubmitSuccessView/index.md +29 -29
  28. package/src/base-client/plugins/AppData.js +73 -73
  29. package/src/base-client/plugins/GetLoginInfoService.js +179 -179
  30. package/src/base-client/plugins/PagedList.js +177 -177
  31. package/src/base-client/plugins/compatible/LoginServiceOA.js +20 -20
  32. package/src/base-client/plugins/i18n-extend.js +32 -32
  33. package/src/components/Ellipsis/index.md +38 -38
  34. package/src/components/NumberInfo/index.md +43 -43
  35. package/src/components/STable/README.md +341 -341
  36. package/src/components/STable/index.js +318 -318
  37. package/src/components/Trend/index.md +45 -45
  38. package/src/components/checkbox/ColorCheckbox.vue +157 -157
  39. package/src/components/checkbox/ImgCheckbox.vue +163 -163
  40. package/src/components/exception/ExceptionPage.vue +70 -70
  41. package/src/components/form/FormRow.vue +52 -52
  42. package/src/components/index.js +36 -36
  43. package/src/components/menu/SideMenu.vue +62 -62
  44. package/src/components/menu/menu.js +273 -273
  45. package/src/components/page/header/index.less +40 -40
  46. package/src/components/setting/Setting.vue +235 -235
  47. package/src/components/table/StandardTable.vue +141 -141
  48. package/src/components/table/advance/ActionColumns.vue +158 -158
  49. package/src/components/table/advance/SearchArea.vue +355 -355
  50. package/src/components/tool/AStepItem.vue +60 -60
  51. package/src/components/tool/AvatarList.vue +68 -68
  52. package/src/components/tool/Drawer.vue +142 -142
  53. package/src/components/tool/TagSelect.vue +83 -83
  54. package/src/components/transition/PageToggleTransition.vue +97 -97
  55. package/src/config/CreateQueryConfig.js +307 -313
  56. package/src/config/default/admin.config.js +18 -18
  57. package/src/config/default/setting.config.js +44 -44
  58. package/src/config/replacer/resolve.config.js +67 -67
  59. package/src/layouts/AdminLayout.vue +174 -174
  60. package/src/layouts/CommonLayout.vue +42 -42
  61. package/src/layouts/ComponentLayoutOne.vue +47 -47
  62. package/src/layouts/PageLayout.vue +151 -151
  63. package/src/layouts/SinglePageView.vue +111 -111
  64. package/src/layouts/footer/PageFooter.vue +49 -49
  65. package/src/layouts/header/AdminHeader.vue +104 -104
  66. package/src/layouts/header/HeaderAvatar.vue +61 -60
  67. package/src/layouts/header/HeaderNotice.vue +167 -167
  68. package/src/layouts/header/HeaderSearch.vue +67 -67
  69. package/src/layouts/header/InstitutionDetail.vue +181 -181
  70. package/src/layouts/header/index.less +92 -92
  71. package/src/layouts/tabs/TabsHead.vue +190 -190
  72. package/src/layouts/tabs/TabsView.vue +379 -379
  73. package/src/mock/goods/index.js +108 -108
  74. package/src/pages/exception/404.vue +25 -25
  75. package/src/pages/login/Login.vue +363 -348
  76. package/src/pages/report/ReportTable.js +124 -124
  77. package/src/pages/report/ReportTableHome.vue +28 -28
  78. package/src/pages/resourceManage/orgListManage.vue +98 -98
  79. package/src/pages/system/dictionary/index.vue +43 -43
  80. package/src/pages/system/file/index.vue +317 -317
  81. package/src/pages/system/monitor/loginInfor/index.vue +36 -36
  82. package/src/pages/system/monitor/operLog/index.vue +36 -36
  83. package/src/pages/system/queryParams/index.vue +43 -43
  84. package/src/router/async/config.async.js +27 -27
  85. package/src/router/async/router.map.js +68 -68
  86. package/src/router/guards.js +113 -104
  87. package/src/router/index.js +27 -27
  88. package/src/services/api/DictionaryDetailsViewApi.js +6 -6
  89. package/src/services/api/LogDetailsViewApi.js +10 -10
  90. package/src/services/api/QueryParamsDetailsViewApi.js +6 -6
  91. package/src/services/api/TicketDetailsViewApi.js +34 -34
  92. package/src/services/api/cas.js +79 -79
  93. package/src/services/api/commonTempTable.js +10 -10
  94. package/src/services/api/index.js +17 -17
  95. package/src/services/api/logininfor/index.js +6 -6
  96. package/src/services/api/manage.js +8 -8
  97. package/src/services/apiService.js +13 -13
  98. package/src/services/user.js +53 -53
  99. package/src/store/modules/index.js +4 -4
  100. package/src/theme/default/nprogress.less +76 -76
  101. package/src/theme/default/style.less +47 -47
  102. package/src/utils/colors.js +107 -107
  103. package/src/utils/excel/Blob.js +180 -180
  104. package/src/utils/excel/Export2Excel.js +141 -141
  105. package/src/utils/formatter.js +68 -68
  106. package/src/utils/i18n.js +80 -80
  107. package/src/utils/indexedDB.js +145 -146
  108. package/src/utils/theme-color-replacer-extend.js +91 -91
  109. package/src/utils/themeUtil.js +100 -100
  110. package/src/utils/util.js +230 -230
  111. package/vue.config.js +106 -111
@@ -1,44 +1,44 @@
1
- // 此配置为系统默认设置
2
- module.exports = {
3
- lang: 'CN', // 语言,可选 CN(简体)、HK(繁体)、US(英语),也可扩展其它语言
4
- theme: { // 主题
5
- color: '#1890ff', // 主题色
6
- mode: 'dark', // 主题模式 可选 dark、 light 和 night
7
- success: '#52c41a', // 成功色
8
- warning: '#faad14', // 警告色
9
- error: '#f5222f' // 错误色
10
- },
11
- layout: 'side', // 导航布局,可选 side 和 head,分别为侧边导航和顶部导航
12
- fixedHeader: true, // 固定头部状态栏,true:固定,false:不固定
13
- fixedSideBar: true, // 固定侧边栏,true:固定,false:不固定
14
- fixedTabs: true, // 固定页签头,true:固定,false:不固定
15
- pageWidth: 'fixed', // 内容区域宽度,fixed:固定宽度,fluid:流式宽度
16
- weekMode: false, // 色弱模式,true:开启,false:不开启
17
- multiPage: true, // 多页签模式,true:开启,false:不开启
18
- cachePage: true, // 是否缓存页面数据,仅多页签模式下生效,true 缓存, false 不缓存
19
- hideSetting: false, // 隐藏设置抽屉,true:隐藏,false:不隐藏
20
- homePage: '/dashboard/workplace', // 首页路由, 登陆后默认打开
21
- ticketPage: '/submitTicket', // 提交工单路由
22
- systemName: 'V4基础组件平台', // 系统名称
23
- logoSrc: '/defaultLogo.png', // LOGO路径
24
- systemNameFontSize: '20px', // 系统名称字体大小
25
- systemDesc: '为PC端中、后台系统业务开发提供支持', // 系统描述
26
- copyright: '2022 AoFengSoft', // copyright
27
- copyrightStyle: undefined,
28
- asyncRoutes: true, // 异步加载路由,true:开启,false:不开启
29
- showPageTitle: true, // 是否显示页面标题(PageLayout 布局中的页面标题),true:显示,false:不显示
30
- filterMenu: true, // 根据权限过滤菜单,true:过滤,false:不过滤
31
- animate: { // 动画设置
32
- disabled: true, // 禁用动画,true:禁用,false:启用
33
- name: 'lightSpeed', // 动画效果,支持的动画效果可参考 ./animate.config.js
34
- direction: 'left' // 动画方向,切换页面时动画的方向,参考 ./animate.config.js
35
- },
36
- footerLinks: [ // 页面底部链接,{link: '链接地址', name: '名称/显示文字', icon: '图标,支持 ant design vue 图标库'}
37
- ],
38
- // 旧系统路径
39
- iframeSrc: '../singlepage/page.html',
40
- // 兼容旧版本 V3(最新V3产品) OA(公司OA)
41
- compatible: 'V3',
42
- // 路由资源名称
43
- routeName: '智慧燃气'
44
- }
1
+ // 此配置为系统默认设置
2
+ module.exports = {
3
+ lang: 'CN', // 语言,可选 CN(简体)、HK(繁体)、US(英语),也可扩展其它语言
4
+ theme: { // 主题
5
+ color: '#1890ff', // 主题色
6
+ mode: 'dark', // 主题模式 可选 dark、 light 和 night
7
+ success: '#52c41a', // 成功色
8
+ warning: '#faad14', // 警告色
9
+ error: '#f5222f' // 错误色
10
+ },
11
+ layout: 'side', // 导航布局,可选 side 和 head,分别为侧边导航和顶部导航
12
+ fixedHeader: true, // 固定头部状态栏,true:固定,false:不固定
13
+ fixedSideBar: true, // 固定侧边栏,true:固定,false:不固定
14
+ fixedTabs: true, // 固定页签头,true:固定,false:不固定
15
+ pageWidth: 'fixed', // 内容区域宽度,fixed:固定宽度,fluid:流式宽度
16
+ weekMode: false, // 色弱模式,true:开启,false:不开启
17
+ multiPage: true, // 多页签模式,true:开启,false:不开启
18
+ cachePage: true, // 是否缓存页面数据,仅多页签模式下生效,true 缓存, false 不缓存
19
+ hideSetting: false, // 隐藏设置抽屉,true:隐藏,false:不隐藏
20
+ homePage: '/dashboard/workplace', // 首页路由, 登陆后默认打开
21
+ ticketPage: '/submitTicket', // 提交工单路由
22
+ systemName: 'V4基础组件平台', // 系统名称
23
+ logoSrc: '/defaultLogo.png', // LOGO路径
24
+ systemNameFontSize: '20px', // 系统名称字体大小
25
+ systemDesc: '为PC端中、后台系统业务开发提供支持', // 系统描述
26
+ copyright: '2022 AoFengSoft', // copyright
27
+ copyrightStyle: undefined,
28
+ asyncRoutes: true, // 异步加载路由,true:开启,false:不开启
29
+ showPageTitle: true, // 是否显示页面标题(PageLayout 布局中的页面标题),true:显示,false:不显示
30
+ filterMenu: true, // 根据权限过滤菜单,true:过滤,false:不过滤
31
+ animate: { // 动画设置
32
+ disabled: true, // 禁用动画,true:禁用,false:启用
33
+ name: 'lightSpeed', // 动画效果,支持的动画效果可参考 ./animate.config.js
34
+ direction: 'left' // 动画方向,切换页面时动画的方向,参考 ./animate.config.js
35
+ },
36
+ footerLinks: [ // 页面底部链接,{link: '链接地址', name: '名称/显示文字', icon: '图标,支持 ant design vue 图标库'}
37
+ ],
38
+ // 旧系统路径
39
+ iframeSrc: '../singlepage/page.html',
40
+ // 兼容旧版本 V3(最新V3产品) OA(公司OA)
41
+ compatible: 'V3',
42
+ // 路由资源名称
43
+ routeName: '智慧燃气'
44
+ }
@@ -1,67 +1,67 @@
1
- /**
2
- * webpack-theme-color-replacer 插件的 resolve 配置
3
- * 为特定的 css 选择器(selector)配置 resolve 规则。
4
- *
5
- * key 为 css selector 值或合法的正则表达式字符串
6
- * 当 key 设置 css selector 值时,会匹配对应的 css
7
- * 当 key 设置为正则表达式时,会匹配所有满足此正则表达式的的 css
8
- *
9
- * value 可以设置为 boolean 值 false 或 一个对象
10
- * 当 value 为 false 时,则会忽略此 css,即此 css 不纳入 webpack-theme-color-replacer 管理
11
- * 当 value 为 对象时,会调用该对象的 resolve 函数,并传入 cssText(原始的 css文本) 和 cssObj(css对象)参数; resolve函数应该返
12
- * 回一个处理后的、合法的 css字符串(包含 selector)
13
- * 注意: value 不能设置为 true
14
- */
15
- const cssResolve = {
16
- '.ant-checkbox-checked .ant-checkbox-inner::after': {
17
- resolve (cssText, cssObj) {
18
- cssObj.rules.push('border-top:0', 'border-left:0')
19
- return cssObj.toText()
20
- }
21
- },
22
- '.ant-tree-checkbox-checked .ant-tree-checkbox-inner::after': {
23
- resolve (cssText, cssObj) {
24
- cssObj.rules.push('border-top:0', 'border-left:0')
25
- return cssObj.toText()
26
- }
27
- },
28
- '.ant-checkbox-checked .ant-checkbox-inner:after': {
29
- resolve (cssText, cssObj) {
30
- cssObj.rules.push('border-top:0', 'border-left:0')
31
- return cssObj.toText()
32
- }
33
- },
34
- '.ant-tree-checkbox-checked .ant-tree-checkbox-inner:after': {
35
- resolve (cssText, cssObj) {
36
- cssObj.rules.push('border-top:0', 'border-left:0')
37
- return cssObj.toText()
38
- }
39
- },
40
- '.ant-menu-dark .ant-menu-inline.ant-menu-sub': {
41
- resolve (cssText, cssObj) {
42
- cssObj.rules = cssObj.rules.filter(rule => rule.indexOf('box-shadow') === -1)
43
- return cssObj.toText()
44
- }
45
- },
46
- '.ant-menu-horizontal>.ant-menu-item:hover,.ant-menu-horizontal>.ant-menu-submenu:hover,.ant-menu-horizontal>.ant-menu-item-active,.ant-menu-horizontal>.ant-menu-submenu-active,.ant-menu-horizontal>.ant-menu-item-open,.ant-menu-horizontal>.ant-menu-submenu-open,.ant-menu-horizontal>.ant-menu-item-selected,.ant-menu-horizontal>.ant-menu-submenu-selected': {
47
- resolve (cssText, cssObj) {
48
- cssObj.selector = cssObj.selector.replace(/.ant-menu-horizontal/g, '.ant-menu-horizontal:not(.ant-menu-dark)')
49
- return cssObj.toText()
50
- }
51
- },
52
- '.ant-menu-horizontal>.ant-menu-item-active,.ant-menu-horizontal>.ant-menu-item-open,.ant-menu-horizontal>.ant-menu-item-selected,.ant-menu-horizontal>.ant-menu-item:hover,.ant-menu-horizontal>.ant-menu-submenu-active,.ant-menu-horizontal>.ant-menu-submenu-open,.ant-menu-horizontal>.ant-menu-submenu-selected,.ant-menu-horizontal>.ant-menu-submenu:hover': {
53
- resolve (cssText, cssObj) {
54
- cssObj.selector = cssObj.selector.replace(/.ant-menu-horizontal/g, '.ant-menu-horizontal:not(.ant-menu-dark)')
55
- return cssObj.toText()
56
- }
57
- },
58
- '.ant-layout-sider': {
59
- resolve (cssText, cssObj) {
60
- cssObj.selector = '.ant-layout-sider-dark'
61
- return cssObj.toText()
62
- }
63
- },
64
- '/keyframes/': false
65
- }
66
-
67
- module.exports = cssResolve
1
+ /**
2
+ * webpack-theme-color-replacer 插件的 resolve 配置
3
+ * 为特定的 css 选择器(selector)配置 resolve 规则。
4
+ *
5
+ * key 为 css selector 值或合法的正则表达式字符串
6
+ * 当 key 设置 css selector 值时,会匹配对应的 css
7
+ * 当 key 设置为正则表达式时,会匹配所有满足此正则表达式的的 css
8
+ *
9
+ * value 可以设置为 boolean 值 false 或 一个对象
10
+ * 当 value 为 false 时,则会忽略此 css,即此 css 不纳入 webpack-theme-color-replacer 管理
11
+ * 当 value 为 对象时,会调用该对象的 resolve 函数,并传入 cssText(原始的 css文本) 和 cssObj(css对象)参数; resolve函数应该返
12
+ * 回一个处理后的、合法的 css字符串(包含 selector)
13
+ * 注意: value 不能设置为 true
14
+ */
15
+ const cssResolve = {
16
+ '.ant-checkbox-checked .ant-checkbox-inner::after': {
17
+ resolve (cssText, cssObj) {
18
+ cssObj.rules.push('border-top:0', 'border-left:0')
19
+ return cssObj.toText()
20
+ }
21
+ },
22
+ '.ant-tree-checkbox-checked .ant-tree-checkbox-inner::after': {
23
+ resolve (cssText, cssObj) {
24
+ cssObj.rules.push('border-top:0', 'border-left:0')
25
+ return cssObj.toText()
26
+ }
27
+ },
28
+ '.ant-checkbox-checked .ant-checkbox-inner:after': {
29
+ resolve (cssText, cssObj) {
30
+ cssObj.rules.push('border-top:0', 'border-left:0')
31
+ return cssObj.toText()
32
+ }
33
+ },
34
+ '.ant-tree-checkbox-checked .ant-tree-checkbox-inner:after': {
35
+ resolve (cssText, cssObj) {
36
+ cssObj.rules.push('border-top:0', 'border-left:0')
37
+ return cssObj.toText()
38
+ }
39
+ },
40
+ '.ant-menu-dark .ant-menu-inline.ant-menu-sub': {
41
+ resolve (cssText, cssObj) {
42
+ cssObj.rules = cssObj.rules.filter(rule => rule.indexOf('box-shadow') === -1)
43
+ return cssObj.toText()
44
+ }
45
+ },
46
+ '.ant-menu-horizontal>.ant-menu-item:hover,.ant-menu-horizontal>.ant-menu-submenu:hover,.ant-menu-horizontal>.ant-menu-item-active,.ant-menu-horizontal>.ant-menu-submenu-active,.ant-menu-horizontal>.ant-menu-item-open,.ant-menu-horizontal>.ant-menu-submenu-open,.ant-menu-horizontal>.ant-menu-item-selected,.ant-menu-horizontal>.ant-menu-submenu-selected': {
47
+ resolve (cssText, cssObj) {
48
+ cssObj.selector = cssObj.selector.replace(/.ant-menu-horizontal/g, '.ant-menu-horizontal:not(.ant-menu-dark)')
49
+ return cssObj.toText()
50
+ }
51
+ },
52
+ '.ant-menu-horizontal>.ant-menu-item-active,.ant-menu-horizontal>.ant-menu-item-open,.ant-menu-horizontal>.ant-menu-item-selected,.ant-menu-horizontal>.ant-menu-item:hover,.ant-menu-horizontal>.ant-menu-submenu-active,.ant-menu-horizontal>.ant-menu-submenu-open,.ant-menu-horizontal>.ant-menu-submenu-selected,.ant-menu-horizontal>.ant-menu-submenu:hover': {
53
+ resolve (cssText, cssObj) {
54
+ cssObj.selector = cssObj.selector.replace(/.ant-menu-horizontal/g, '.ant-menu-horizontal:not(.ant-menu-dark)')
55
+ return cssObj.toText()
56
+ }
57
+ },
58
+ '.ant-layout-sider': {
59
+ resolve (cssText, cssObj) {
60
+ cssObj.selector = '.ant-layout-sider-dark'
61
+ return cssObj.toText()
62
+ }
63
+ },
64
+ '/keyframes/': false
65
+ }
66
+
67
+ module.exports = cssResolve
@@ -1,174 +1,174 @@
1
- <template>
2
- <a-layout :class="['admin-layout', 'beauty-scroll']">
3
- <drawer v-if="isMobile" v-model="drawerOpen">
4
- <side-menu :theme="theme.mode" :menuData="menuData" :collapsed="false" :collapsible="false" @menuSelect="onMenuSelect"/>
5
- </drawer>
6
- <side-menu
7
- :class="[fixedSideBar ? 'fixed-side' : '']"
8
- :theme="theme.mode"
9
- v-else-if="layout === 'side' || layout === 'mix'"
10
- :menuData="sideMenuData"
11
- :collapsed="collapsed"
12
- :collapsible="true" />
13
- <div v-if="fixedSideBar && !isMobile" :style="`width: ${sideMenuWidth}; min-width: ${sideMenuWidth};max-width: ${sideMenuWidth};`" class="virtual-side"></div>
14
- <drawer v-if="!hideSetting" v-model="showSetting" placement="right">
15
- <div class="setting" slot="handler">
16
- <a-icon :type="showSetting ? 'close' : 'setting'"/>
17
- </div>
18
- <setting />
19
- </drawer>
20
- <a-layout class="admin-layout-main beauty-scroll">
21
- <admin-header :class="[{'fixed-tabs': fixedTabs, 'fixed-header': fixedHeader, 'multi-page': multiPage}]" :style="headerStyle" :menuData="headMenuData" :collapsed="collapsed" @toggleCollapse="toggleCollapse"/>
22
- <a-layout-header :class="['virtual-header', {'fixed-tabs' : fixedTabs, 'fixed-header': fixedHeader, 'multi-page': multiPage}]" v-show="fixedHeader"></a-layout-header>
23
- <a-layout-content class="admin-layout-content" :style="`min-height: ${minHeight}px;`">
24
- <div style="position: relative">
25
- <slot></slot>
26
- </div>
27
- </a-layout-content>
28
- <a-layout-footer style="padding: 0">
29
- <page-footer :link-list="footerLinks" :copyright="copyright" />
30
- </a-layout-footer>
31
- </a-layout>
32
- </a-layout>
33
- </template>
34
-
35
- <script>
36
- import AdminHeader from './header/AdminHeader'
37
- import PageFooter from './footer/PageFooter'
38
- import Drawer from '../components/tool/Drawer'
39
- import SideMenu from '../components/menu/SideMenu'
40
- import Setting from '../components/setting/Setting'
41
- import { mapState, mapMutations, mapGetters } from 'vuex'
42
-
43
- // const minHeight = window.innerHeight - 64 - 122
44
-
45
- export default {
46
- name: 'AdminLayout',
47
- components: { Setting, SideMenu, Drawer, PageFooter, AdminHeader },
48
- data () {
49
- return {
50
- minHeight: window.innerHeight - 64 - 1,
51
- collapsed: false,
52
- showSetting: false,
53
- drawerOpen: false
54
- }
55
- },
56
- provide () {
57
- return {
58
- adminLayout: this
59
- }
60
- },
61
- watch: {
62
- $route (val) {
63
- this.setActivated(val)
64
- },
65
- layout () {
66
- this.setActivated(this.$route)
67
- },
68
- isMobile (val) {
69
- if (!val) {
70
- this.drawerOpen = false
71
- }
72
- }
73
- },
74
- computed: {
75
- ...mapState('setting', ['isMobile', 'theme', 'layout', 'footerLinks', 'copyright', 'fixedHeader', 'fixedSideBar',
76
- 'fixedTabs', 'hideSetting', 'multiPage']),
77
- ...mapGetters('setting', ['firstMenu', 'subMenu', 'menuData']),
78
- sideMenuWidth () {
79
- return this.collapsed ? '80px' : '256px'
80
- },
81
- headerStyle () {
82
- const width = (this.fixedHeader && this.layout !== 'head' && !this.isMobile) ? `calc(100% - ${this.sideMenuWidth})` : '100%'
83
- const position = this.fixedHeader ? 'fixed' : 'static'
84
- return `width: ${width}; position: ${position};`
85
- },
86
- headMenuData () {
87
- const { layout, menuData, firstMenu } = this
88
- return layout === 'mix' ? firstMenu : menuData
89
- },
90
- sideMenuData () {
91
- const { layout, menuData, subMenu } = this
92
- return layout === 'mix' ? subMenu : menuData
93
- }
94
- },
95
- methods: {
96
- ...mapMutations('setting', ['correctPageMinHeight', 'setActivatedFirst']),
97
- toggleCollapse () {
98
- this.collapsed = !this.collapsed
99
- },
100
- onMenuSelect () {
101
- this.toggleCollapse()
102
- },
103
- setActivated (route) {
104
- if (this.layout === 'mix') {
105
- let matched = route.matched
106
- matched = matched.slice(0, matched.length - 1)
107
- const { firstMenu } = this
108
- for (const menu of firstMenu) {
109
- if (matched.findIndex(item => item.path === menu.fullPath) !== -1) {
110
- this.setActivatedFirst(menu.fullPath)
111
- break
112
- }
113
- }
114
- }
115
- }
116
- },
117
- created () {
118
- this.correctPageMinHeight(this.minHeight - 24)
119
- this.setActivated(this.$route)
120
- },
121
- beforeDestroy () {
122
- this.correctPageMinHeight(-this.minHeight + 24)
123
- }
124
- }
125
- </script>
126
-
127
- <style lang="less" scoped>
128
- .admin-layout{
129
- .side-menu{
130
- &.fixed-side{
131
- position: fixed;
132
- height: 100vh;
133
- left: 0;
134
- top: 0;
135
- }
136
- }
137
- .virtual-side{
138
- transition: all 0.2s;
139
- }
140
- .virtual-header{
141
- transition: all 0.2s;
142
- opacity: 0;
143
- &.fixed-tabs.multi-page:not(.fixed-header){
144
- height: 0;
145
- }
146
- }
147
- .admin-layout-main{
148
- .admin-header{
149
- top: 0;
150
- right: 0;
151
- overflow: hidden;
152
- transition: all 0.2s;
153
- &.fixed-tabs.multi-page:not(.fixed-header){
154
- height: 0;
155
- }
156
- }
157
- }
158
- .admin-layout-content{
159
- padding: 24px;
160
- /*overflow-x: hidden;*/
161
- /*min-height: calc(100vh - 64px - 122px);*/
162
- }
163
- .setting{
164
- background-color: @primary-color;
165
- color: @base-bg-color;
166
- border-radius: 5px 0 0 5px;
167
- line-height: 40px;
168
- font-size: 22px;
169
- width: 40px;
170
- height: 40px;
171
- box-shadow: -2px 0 8px @shadow-color;
172
- }
173
- }
174
- </style>
1
+ <template>
2
+ <a-layout :class="['admin-layout', 'beauty-scroll']">
3
+ <drawer v-if="isMobile" v-model="drawerOpen">
4
+ <side-menu :theme="theme.mode" :menuData="menuData" :collapsed="false" :collapsible="false" @menuSelect="onMenuSelect"/>
5
+ </drawer>
6
+ <side-menu
7
+ :class="[fixedSideBar ? 'fixed-side' : '']"
8
+ :theme="theme.mode"
9
+ v-else-if="layout === 'side' || layout === 'mix'"
10
+ :menuData="sideMenuData"
11
+ :collapsed="collapsed"
12
+ :collapsible="true" />
13
+ <div v-if="fixedSideBar && !isMobile" :style="`width: ${sideMenuWidth}; min-width: ${sideMenuWidth};max-width: ${sideMenuWidth};`" class="virtual-side"></div>
14
+ <drawer v-if="!hideSetting" v-model="showSetting" placement="right">
15
+ <div class="setting" slot="handler">
16
+ <a-icon :type="showSetting ? 'close' : 'setting'"/>
17
+ </div>
18
+ <setting />
19
+ </drawer>
20
+ <a-layout class="admin-layout-main beauty-scroll">
21
+ <admin-header :class="[{'fixed-tabs': fixedTabs, 'fixed-header': fixedHeader, 'multi-page': multiPage}]" :style="headerStyle" :menuData="headMenuData" :collapsed="collapsed" @toggleCollapse="toggleCollapse"/>
22
+ <a-layout-header :class="['virtual-header', {'fixed-tabs' : fixedTabs, 'fixed-header': fixedHeader, 'multi-page': multiPage}]" v-show="fixedHeader"></a-layout-header>
23
+ <a-layout-content class="admin-layout-content" :style="`min-height: ${minHeight}px;`">
24
+ <div style="position: relative">
25
+ <slot></slot>
26
+ </div>
27
+ </a-layout-content>
28
+ <a-layout-footer style="padding: 0">
29
+ <page-footer :link-list="footerLinks" :copyright="copyright" />
30
+ </a-layout-footer>
31
+ </a-layout>
32
+ </a-layout>
33
+ </template>
34
+
35
+ <script>
36
+ import AdminHeader from './header/AdminHeader'
37
+ import PageFooter from './footer/PageFooter'
38
+ import Drawer from '../components/tool/Drawer'
39
+ import SideMenu from '../components/menu/SideMenu'
40
+ import Setting from '../components/setting/Setting'
41
+ import { mapState, mapMutations, mapGetters } from 'vuex'
42
+
43
+ // const minHeight = window.innerHeight - 64 - 122
44
+
45
+ export default {
46
+ name: 'AdminLayout',
47
+ components: { Setting, SideMenu, Drawer, PageFooter, AdminHeader },
48
+ data () {
49
+ return {
50
+ minHeight: window.innerHeight - 64 - 1,
51
+ collapsed: false,
52
+ showSetting: false,
53
+ drawerOpen: false
54
+ }
55
+ },
56
+ provide () {
57
+ return {
58
+ adminLayout: this
59
+ }
60
+ },
61
+ watch: {
62
+ $route (val) {
63
+ this.setActivated(val)
64
+ },
65
+ layout () {
66
+ this.setActivated(this.$route)
67
+ },
68
+ isMobile (val) {
69
+ if (!val) {
70
+ this.drawerOpen = false
71
+ }
72
+ }
73
+ },
74
+ computed: {
75
+ ...mapState('setting', ['isMobile', 'theme', 'layout', 'footerLinks', 'copyright', 'fixedHeader', 'fixedSideBar',
76
+ 'fixedTabs', 'hideSetting', 'multiPage']),
77
+ ...mapGetters('setting', ['firstMenu', 'subMenu', 'menuData']),
78
+ sideMenuWidth () {
79
+ return this.collapsed ? '80px' : '256px'
80
+ },
81
+ headerStyle () {
82
+ const width = (this.fixedHeader && this.layout !== 'head' && !this.isMobile) ? `calc(100% - ${this.sideMenuWidth})` : '100%'
83
+ const position = this.fixedHeader ? 'fixed' : 'static'
84
+ return `width: ${width}; position: ${position};`
85
+ },
86
+ headMenuData () {
87
+ const { layout, menuData, firstMenu } = this
88
+ return layout === 'mix' ? firstMenu : menuData
89
+ },
90
+ sideMenuData () {
91
+ const { layout, menuData, subMenu } = this
92
+ return layout === 'mix' ? subMenu : menuData
93
+ }
94
+ },
95
+ methods: {
96
+ ...mapMutations('setting', ['correctPageMinHeight', 'setActivatedFirst']),
97
+ toggleCollapse () {
98
+ this.collapsed = !this.collapsed
99
+ },
100
+ onMenuSelect () {
101
+ this.toggleCollapse()
102
+ },
103
+ setActivated (route) {
104
+ if (this.layout === 'mix') {
105
+ let matched = route.matched
106
+ matched = matched.slice(0, matched.length - 1)
107
+ const { firstMenu } = this
108
+ for (const menu of firstMenu) {
109
+ if (matched.findIndex(item => item.path === menu.fullPath) !== -1) {
110
+ this.setActivatedFirst(menu.fullPath)
111
+ break
112
+ }
113
+ }
114
+ }
115
+ }
116
+ },
117
+ created () {
118
+ this.correctPageMinHeight(this.minHeight - 24)
119
+ this.setActivated(this.$route)
120
+ },
121
+ beforeDestroy () {
122
+ this.correctPageMinHeight(-this.minHeight + 24)
123
+ }
124
+ }
125
+ </script>
126
+
127
+ <style lang="less" scoped>
128
+ .admin-layout{
129
+ .side-menu{
130
+ &.fixed-side{
131
+ position: fixed;
132
+ height: 100vh;
133
+ left: 0;
134
+ top: 0;
135
+ }
136
+ }
137
+ .virtual-side{
138
+ transition: all 0.2s;
139
+ }
140
+ .virtual-header{
141
+ transition: all 0.2s;
142
+ opacity: 0;
143
+ &.fixed-tabs.multi-page:not(.fixed-header){
144
+ height: 0;
145
+ }
146
+ }
147
+ .admin-layout-main{
148
+ .admin-header{
149
+ top: 0;
150
+ right: 0;
151
+ overflow: hidden;
152
+ transition: all 0.2s;
153
+ &.fixed-tabs.multi-page:not(.fixed-header){
154
+ height: 0;
155
+ }
156
+ }
157
+ }
158
+ .admin-layout-content{
159
+ padding: 24px;
160
+ /*overflow-x: hidden;*/
161
+ /*min-height: calc(100vh - 64px - 122px);*/
162
+ }
163
+ .setting{
164
+ background-color: @primary-color;
165
+ color: @base-bg-color;
166
+ border-radius: 5px 0 0 5px;
167
+ line-height: 40px;
168
+ font-size: 22px;
169
+ width: 40px;
170
+ height: 40px;
171
+ box-shadow: -2px 0 8px @shadow-color;
172
+ }
173
+ }
174
+ </style>
@@ -1,42 +1,42 @@
1
- <template>
2
- <div class="common-layout">
3
- <div class="content"><slot></slot></div>
4
- <page-footer :link-list="footerLinks" :copyright="copyright" :copyrightStyle="copyrightStyle"></page-footer>
5
- </div>
6
- </template>
7
-
8
- <script>
9
- import PageFooter from '@vue2-client/layouts/footer/PageFooter'
10
- import { mapState } from 'vuex'
11
-
12
- export default {
13
- name: 'CommonLayout',
14
- components: { PageFooter },
15
- computed: {
16
- ...mapState('setting', ['footerLinks', 'copyright', 'copyrightStyle'])
17
- }
18
- }
19
- </script>
20
-
21
- <style scoped lang="less">
22
- .common-layout{
23
- display: flex;
24
- flex-direction: column;
25
- height: 100vh;
26
- overflow: auto;
27
- background-color: @layout-body-background;
28
- background-image: url('https://gw.alipayobjects.com/zos/rmsportal/TVYTbAXWheQpRcWDaDMu.svg');
29
- background-repeat: no-repeat;
30
- background-position-x: center;
31
- background-position-y: 110px;
32
- background-size: 100%;
33
- .content{
34
- padding: 32px 0;
35
- flex: 1;
36
- @media (min-width: 768px){
37
-
38
- padding: 112px 0 24px;
39
- }
40
- }
41
- }
42
- </style>
1
+ <template>
2
+ <div class="common-layout">
3
+ <div class="content"><slot></slot></div>
4
+ <page-footer :link-list="footerLinks" :copyright="copyright" :copyrightStyle="copyrightStyle"></page-footer>
5
+ </div>
6
+ </template>
7
+
8
+ <script>
9
+ import PageFooter from '@vue2-client/layouts/footer/PageFooter'
10
+ import { mapState } from 'vuex'
11
+
12
+ export default {
13
+ name: 'CommonLayout',
14
+ components: { PageFooter },
15
+ computed: {
16
+ ...mapState('setting', ['footerLinks', 'copyright', 'copyrightStyle'])
17
+ }
18
+ }
19
+ </script>
20
+
21
+ <style scoped lang="less">
22
+ .common-layout{
23
+ display: flex;
24
+ flex-direction: column;
25
+ height: 100vh;
26
+ overflow: auto;
27
+ background-color: @layout-body-background;
28
+ background-image: url('https://gw.alipayobjects.com/zos/rmsportal/TVYTbAXWheQpRcWDaDMu.svg');
29
+ background-repeat: no-repeat;
30
+ background-position-x: center;
31
+ background-position-y: 110px;
32
+ background-size: 100%;
33
+ .content{
34
+ padding: 32px 0;
35
+ flex: 1;
36
+ @media (min-width: 768px){
37
+
38
+ padding: 112px 0 24px;
39
+ }
40
+ }
41
+ }
42
+ </style>