vue2-client 1.3.19 → 1.3.20

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 (96) hide show
  1. package/CHANGELOG.md +318 -315
  2. package/index.js +30 -30
  3. package/package.json +76 -76
  4. package/src/base-client/components/common/AddressSearchCombobox/AddressSearchCombobox.vue +225 -225
  5. package/src/base-client/components/common/CreateQuery/CreateQuery.vue +551 -551
  6. package/src/base-client/components/common/CreateQuery/CreateQueryItem.vue +777 -777
  7. package/src/base-client/components/common/CreateSimpleFormQuery/CreateSimpleFormQueryItem.vue +553 -553
  8. package/src/base-client/components/common/CustomColumnsDrawer/index.md +46 -46
  9. package/src/base-client/components/common/FormGroupQuery/FormGroupQuery.vue +165 -165
  10. package/src/base-client/components/common/JSONToTree/jsontotree.vue +275 -275
  11. package/src/base-client/components/common/Upload/Upload.vue +162 -165
  12. package/src/base-client/components/common/XAddForm/XAddForm.vue +354 -354
  13. package/src/base-client/components/common/XAddNativeForm/XAddNativeForm.vue +327 -327
  14. package/src/base-client/components/common/XCard/XCard.vue +64 -64
  15. package/src/base-client/components/common/XForm/XForm.vue +274 -274
  16. package/src/base-client/components/common/XForm/XFormItem.vue +389 -389
  17. package/src/base-client/components/common/XFormTable/index.md +96 -96
  18. package/src/base-client/components/common/XTable/XTable.vue +278 -278
  19. package/src/base-client/components/system/LogDetailsView/LogDetailsView.vue +376 -376
  20. package/src/base-client/components/system/QueryParamsDetailsView/QueryParamsDetailsView.vue +281 -281
  21. package/src/base-client/components/ticket/TicketDetailsView/TicketDetailsView.vue +807 -807
  22. package/src/base-client/components/ticket/TicketDetailsView/index.md +29 -29
  23. package/src/base-client/components/ticket/TicketDetailsView/part/TicketDetailsFlow.vue +260 -260
  24. package/src/base-client/components/ticket/TicketSubmitSuccessView/TicketSubmitSuccessView.vue +532 -532
  25. package/src/base-client/components/ticket/TicketSubmitSuccessView/index.md +29 -29
  26. package/src/base-client/plugins/AppData.js +69 -69
  27. package/src/base-client/plugins/GetLoginInfoService.js +179 -179
  28. package/src/base-client/plugins/PagedList.js +177 -177
  29. package/src/base-client/plugins/compatible/LoginServiceOA.js +20 -20
  30. package/src/base-client/plugins/i18n-extend.js +32 -32
  31. package/src/components/Ellipsis/index.md +38 -38
  32. package/src/components/NumberInfo/index.md +43 -43
  33. package/src/components/STable/README.md +341 -341
  34. package/src/components/STable/index.js +318 -318
  35. package/src/components/Trend/index.md +45 -45
  36. package/src/components/checkbox/ColorCheckbox.vue +157 -157
  37. package/src/components/checkbox/ImgCheckbox.vue +163 -163
  38. package/src/components/exception/ExceptionPage.vue +70 -70
  39. package/src/components/form/FormRow.vue +52 -52
  40. package/src/components/index.js +36 -36
  41. package/src/components/menu/SideMenu.vue +62 -62
  42. package/src/components/menu/menu.js +273 -273
  43. package/src/components/setting/Setting.vue +235 -235
  44. package/src/components/table/StandardTable.vue +141 -141
  45. package/src/components/table/advance/ActionColumns.vue +158 -158
  46. package/src/components/table/advance/SearchArea.vue +355 -355
  47. package/src/components/tool/AStepItem.vue +60 -60
  48. package/src/components/tool/AvatarList.vue +68 -68
  49. package/src/components/tool/Drawer.vue +142 -142
  50. package/src/components/tool/TagSelect.vue +83 -83
  51. package/src/components/transition/PageToggleTransition.vue +97 -97
  52. package/src/config/default/setting.config.js +41 -41
  53. package/src/config/replacer/resolve.config.js +67 -67
  54. package/src/layouts/AdminLayout.vue +174 -174
  55. package/src/layouts/header/AdminHeader.vue +104 -104
  56. package/src/layouts/header/HeaderNotice.vue +167 -167
  57. package/src/layouts/header/HeaderSearch.vue +67 -67
  58. package/src/layouts/header/InstitutionDetail.vue +181 -181
  59. package/src/layouts/tabs/TabsHead.vue +190 -190
  60. package/src/layouts/tabs/TabsView.vue +379 -379
  61. package/src/mock/goods/index.js +108 -108
  62. package/src/pages/CreateQueryPage.vue +65 -65
  63. package/src/pages/login/Login.vue +277 -277
  64. package/src/pages/report/ReportTable.js +124 -124
  65. package/src/pages/report/ReportTableHome.vue +28 -28
  66. package/src/pages/resourceManage/orgListManage.vue +98 -98
  67. package/src/pages/system/dictionary/index.vue +43 -43
  68. package/src/pages/system/file/index.vue +317 -317
  69. package/src/pages/system/queryParams/index.vue +43 -43
  70. package/src/pages/system/ticket/index.vue +489 -461
  71. package/src/pages/system/ticket/submitTicketSuccess.vue +206 -206
  72. package/src/router/async/config.async.js +27 -27
  73. package/src/router/async/router.map.js +56 -56
  74. package/src/router/index.js +27 -27
  75. package/src/services/api/DictionaryDetailsViewApi.js +6 -6
  76. package/src/services/api/LogDetailsViewApi.js +10 -10
  77. package/src/services/api/QueryParamsDetailsViewApi.js +6 -6
  78. package/src/services/api/TicketDetailsViewApi.js +34 -34
  79. package/src/services/api/common.js +58 -58
  80. package/src/services/api/commonTempTable.js +10 -10
  81. package/src/services/api/index.js +17 -17
  82. package/src/services/api/manage.js +8 -8
  83. package/src/store/mutation-types.js +2 -2
  84. package/src/theme/default/nprogress.less +76 -76
  85. package/src/theme/default/style.less +47 -47
  86. package/src/utils/colors.js +103 -103
  87. package/src/utils/excel/Blob.js +180 -180
  88. package/src/utils/excel/Export2Excel.js +141 -141
  89. package/src/utils/formatter.js +68 -68
  90. package/src/utils/i18n.js +80 -80
  91. package/src/utils/request.js +225 -225
  92. package/src/utils/routerUtil.js +364 -364
  93. package/src/utils/theme-color-replacer-extend.js +91 -91
  94. package/src/utils/themeUtil.js +100 -100
  95. package/src/utils/util.js +230 -230
  96. package/vue.config.js +99 -99
@@ -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,104 +1,104 @@
1
- <template>
2
- <a-layout-header :class="[headerTheme, 'admin-header']">
3
- <div :class="['admin-header-wide', layout, pageWidth]">
4
- <router-link v-if="isMobile || layout === 'head'" :class="['logo', isMobile ? null : 'pc', headerTheme]" to="/">
5
- <img src="@vue2-client/assets/img/logo.png" width="32" alt=""/>
6
- <h1 v-if="!isMobile">{{ systemName }}</h1>
7
- </router-link>
8
- <a-divider v-if="isMobile" type="vertical" />
9
- <a-icon v-if="layout !== 'head'" :type="collapsed ? 'menu-unfold' : 'menu-fold'" class="trigger" @click="toggleCollapse"/>
10
- <div v-if="layout !== 'side' && !isMobile" :style="`width: ${menuWidth};`" class="admin-header-menu">
11
- <i-menu :options="menuData" :theme="headerTheme" class="head-menu" mode="horizontal" @select="onSelect"/>
12
- </div>
13
- <div :class="['admin-header-right', headerTheme]">
14
- <header-search class="header-item" @active="val => searchActive = val" />
15
- <a-tooltip class="header-item" placement="bottom" title="清理查询缓存" >
16
- <a @click="handleToClearCache">
17
- <a-icon type="reload" />
18
- </a>
19
- </a-tooltip>
20
- <header-notice class="header-item"/>
21
- <header-avatar class="header-item"/>
22
- <a-dropdown class="lang header-item">
23
- <div>
24
- <a-icon type="global"/> {{ langAlias }}
25
- </div>
26
- <a-menu slot="overlay" :selected-keys="[lang]" @click="val => setLang(val.key)">
27
- <a-menu-item v-for=" lang in langList" :key="lang.key">{{ lang.key.toLowerCase() + ' ' + lang.name }}</a-menu-item>
28
- </a-menu>
29
- </a-dropdown>
30
- </div>
31
- </div>
32
- </a-layout-header>
33
- </template>
34
-
35
- <script>
36
- import HeaderSearch from './HeaderSearch'
37
- import HeaderNotice from './HeaderNotice'
38
- import HeaderAvatar from './HeaderAvatar'
39
- import IMenu from '@vue2-client/components/menu/menu'
40
- import { mapState, mapMutations } from 'vuex'
41
- import { Modal } from 'ant-design-vue'
42
- import { indexedDB } from '@vue2-client/utils/indexedDB'
43
-
44
- export default {
45
- name: 'AdminHeader',
46
- components: { IMenu, HeaderAvatar, HeaderNotice, HeaderSearch },
47
- // eslint-disable-next-line vue/require-prop-types
48
- props: ['collapsed', 'menuData'],
49
- data () {
50
- return {
51
- langList: [
52
- { key: 'CN', name: '简体中文', alias: '简体' },
53
- { key: 'HK', name: '繁體中文', alias: '繁體' },
54
- { key: 'US', name: 'English', alias: 'English' }
55
- ],
56
- searchActive: false
57
- }
58
- },
59
- computed: {
60
- ...mapState('setting', ['theme', 'isMobile', 'layout', 'systemName', 'lang', 'pageWidth']),
61
- headerTheme () {
62
- if (this.layout === 'side' && this.theme.mode === 'dark' && !this.isMobile) {
63
- return 'light'
64
- }
65
- return this.theme.mode
66
- },
67
- langAlias () {
68
- const lang = this.langList.find(item => item.key === this.lang)
69
- return lang.alias
70
- },
71
- menuWidth () {
72
- const { layout, searchActive } = this
73
- const headWidth = layout === 'head' ? '100% - 188px' : '100%'
74
- const extraWidth = searchActive ? '600px' : '400px'
75
- return `calc(${headWidth} - ${extraWidth})`
76
- }
77
- },
78
- methods: {
79
- toggleCollapse () {
80
- this.$emit('toggleCollapse')
81
- },
82
- onSelect (obj) {
83
- this.$emit('menuSelect', obj)
84
- },
85
- handleToClearCache () {
86
- Modal.confirm({
87
- title: '信息',
88
- content: '您确定要清除查询配置缓存吗?',
89
- onOk: () => {
90
- indexedDB.clear(() => {
91
- location.reload()
92
- })
93
- },
94
- onCancel () {}
95
- })
96
- },
97
- ...mapMutations('setting', ['setLang'])
98
- }
99
- }
100
- </script>
101
-
102
- <style lang="less" scoped>
103
- @import "index";
104
- </style>
1
+ <template>
2
+ <a-layout-header :class="[headerTheme, 'admin-header']">
3
+ <div :class="['admin-header-wide', layout, pageWidth]">
4
+ <router-link v-if="isMobile || layout === 'head'" :class="['logo', isMobile ? null : 'pc', headerTheme]" to="/">
5
+ <img src="@vue2-client/assets/img/logo.png" width="32" alt=""/>
6
+ <h1 v-if="!isMobile">{{ systemName }}</h1>
7
+ </router-link>
8
+ <a-divider v-if="isMobile" type="vertical" />
9
+ <a-icon v-if="layout !== 'head'" :type="collapsed ? 'menu-unfold' : 'menu-fold'" class="trigger" @click="toggleCollapse"/>
10
+ <div v-if="layout !== 'side' && !isMobile" :style="`width: ${menuWidth};`" class="admin-header-menu">
11
+ <i-menu :options="menuData" :theme="headerTheme" class="head-menu" mode="horizontal" @select="onSelect"/>
12
+ </div>
13
+ <div :class="['admin-header-right', headerTheme]">
14
+ <header-search class="header-item" @active="val => searchActive = val" />
15
+ <a-tooltip class="header-item" placement="bottom" title="清理查询缓存" >
16
+ <a @click="handleToClearCache">
17
+ <a-icon type="reload" />
18
+ </a>
19
+ </a-tooltip>
20
+ <header-notice class="header-item"/>
21
+ <header-avatar class="header-item"/>
22
+ <a-dropdown class="lang header-item">
23
+ <div>
24
+ <a-icon type="global"/> {{ langAlias }}
25
+ </div>
26
+ <a-menu slot="overlay" :selected-keys="[lang]" @click="val => setLang(val.key)">
27
+ <a-menu-item v-for=" lang in langList" :key="lang.key">{{ lang.key.toLowerCase() + ' ' + lang.name }}</a-menu-item>
28
+ </a-menu>
29
+ </a-dropdown>
30
+ </div>
31
+ </div>
32
+ </a-layout-header>
33
+ </template>
34
+
35
+ <script>
36
+ import HeaderSearch from './HeaderSearch'
37
+ import HeaderNotice from './HeaderNotice'
38
+ import HeaderAvatar from './HeaderAvatar'
39
+ import IMenu from '@vue2-client/components/menu/menu'
40
+ import { mapState, mapMutations } from 'vuex'
41
+ import { Modal } from 'ant-design-vue'
42
+ import { indexedDB } from '@vue2-client/utils/indexedDB'
43
+
44
+ export default {
45
+ name: 'AdminHeader',
46
+ components: { IMenu, HeaderAvatar, HeaderNotice, HeaderSearch },
47
+ // eslint-disable-next-line vue/require-prop-types
48
+ props: ['collapsed', 'menuData'],
49
+ data () {
50
+ return {
51
+ langList: [
52
+ { key: 'CN', name: '简体中文', alias: '简体' },
53
+ { key: 'HK', name: '繁體中文', alias: '繁體' },
54
+ { key: 'US', name: 'English', alias: 'English' }
55
+ ],
56
+ searchActive: false
57
+ }
58
+ },
59
+ computed: {
60
+ ...mapState('setting', ['theme', 'isMobile', 'layout', 'systemName', 'lang', 'pageWidth']),
61
+ headerTheme () {
62
+ if (this.layout === 'side' && this.theme.mode === 'dark' && !this.isMobile) {
63
+ return 'light'
64
+ }
65
+ return this.theme.mode
66
+ },
67
+ langAlias () {
68
+ const lang = this.langList.find(item => item.key === this.lang)
69
+ return lang.alias
70
+ },
71
+ menuWidth () {
72
+ const { layout, searchActive } = this
73
+ const headWidth = layout === 'head' ? '100% - 188px' : '100%'
74
+ const extraWidth = searchActive ? '600px' : '400px'
75
+ return `calc(${headWidth} - ${extraWidth})`
76
+ }
77
+ },
78
+ methods: {
79
+ toggleCollapse () {
80
+ this.$emit('toggleCollapse')
81
+ },
82
+ onSelect (obj) {
83
+ this.$emit('menuSelect', obj)
84
+ },
85
+ handleToClearCache () {
86
+ Modal.confirm({
87
+ title: '信息',
88
+ content: '您确定要清除查询配置缓存吗?',
89
+ onOk: () => {
90
+ indexedDB.clear(() => {
91
+ location.reload()
92
+ })
93
+ },
94
+ onCancel () {}
95
+ })
96
+ },
97
+ ...mapMutations('setting', ['setLang'])
98
+ }
99
+ }
100
+ </script>
101
+
102
+ <style lang="less" scoped>
103
+ @import "index";
104
+ </style>