vue2-client 1.6.13 → 1.6.15

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 (104) hide show
  1. package/CHANGELOG.md +562 -555
  2. package/index.js +30 -30
  3. package/package.json +78 -78
  4. package/src/base-client/components/common/AddressSearchCombobox/AddressSearchCombobox.vue +226 -226
  5. package/src/base-client/components/common/CitySelect/CitySelect.vue +247 -247
  6. package/src/base-client/components/common/CreateQuery/CreateQueryItem.vue +733 -733
  7. package/src/base-client/components/common/CreateSimpleFormQuery/CreateSimpleFormQueryItem.vue +508 -508
  8. package/src/base-client/components/common/FormGroupEdit/FormGroupEdit.vue +140 -140
  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/XAddForm/XAddForm.vue +326 -326
  12. package/src/base-client/components/common/XCard/XCard.vue +64 -64
  13. package/src/base-client/components/common/XForm/XForm.vue +180 -180
  14. package/src/base-client/components/common/XFormTable/XFormTable.vue +336 -334
  15. package/src/base-client/components/common/XFormTable/index.md +97 -97
  16. package/src/base-client/components/common/XTreeOne/XTreeOne.vue +109 -109
  17. package/src/base-client/components/system/QueryParamsDetailsView/QueryParamsDetailsView.vue +281 -281
  18. package/src/base-client/components/ticket/TicketDetailsView/TicketDetailsView.vue +807 -807
  19. package/src/base-client/components/ticket/TicketDetailsView/index.md +29 -29
  20. package/src/base-client/components/ticket/TicketDetailsView/part/TicketDetailsFlow.vue +260 -260
  21. package/src/base-client/components/ticket/TicketSubmitSuccessView/TicketSubmitSuccessView.vue +532 -532
  22. package/src/base-client/components/ticket/TicketSubmitSuccessView/index.md +29 -29
  23. package/src/base-client/plugins/AppData.js +76 -76
  24. package/src/base-client/plugins/GetLoginInfoService.js +179 -179
  25. package/src/base-client/plugins/PagedList.js +177 -177
  26. package/src/base-client/plugins/compatible/LoginServiceOA.js +20 -20
  27. package/src/base-client/plugins/i18n-extend.js +32 -32
  28. package/src/components/Ellipsis/Ellipsis.vue +65 -65
  29. package/src/components/Ellipsis/index.md +38 -38
  30. package/src/components/NumberInfo/index.md +43 -43
  31. package/src/components/STable/README.md +341 -341
  32. package/src/components/STable/index.js +318 -318
  33. package/src/components/Trend/index.md +45 -45
  34. package/src/components/checkbox/ColorCheckbox.vue +157 -157
  35. package/src/components/checkbox/ImgCheckbox.vue +163 -163
  36. package/src/components/exception/ExceptionPage.vue +70 -70
  37. package/src/components/form/FormRow.vue +52 -52
  38. package/src/components/index.js +36 -36
  39. package/src/components/menu/SideMenu.vue +62 -62
  40. package/src/components/menu/menu.js +273 -273
  41. package/src/components/page/header/index.less +40 -40
  42. package/src/components/setting/Setting.vue +235 -235
  43. package/src/components/table/StandardTable.vue +141 -141
  44. package/src/components/table/advance/ActionColumns.vue +158 -158
  45. package/src/components/table/advance/SearchArea.vue +355 -355
  46. package/src/components/tool/AStepItem.vue +60 -60
  47. package/src/components/tool/AvatarList.vue +68 -68
  48. package/src/components/tool/Drawer.vue +142 -142
  49. package/src/components/tool/TagSelect.vue +83 -83
  50. package/src/components/transition/PageToggleTransition.vue +97 -97
  51. package/src/config/default/admin.config.js +18 -18
  52. package/src/config/default/setting.config.js +44 -44
  53. package/src/config/replacer/resolve.config.js +67 -67
  54. package/src/layouts/CommonLayout.vue +42 -42
  55. package/src/layouts/ComponentLayoutOne.vue +47 -47
  56. package/src/layouts/PageLayout.vue +151 -151
  57. package/src/layouts/SinglePageView.vue +111 -111
  58. package/src/layouts/footer/PageFooter.vue +49 -49
  59. package/src/layouts/header/AdminHeader.vue +104 -104
  60. package/src/layouts/header/HeaderAvatar.vue +64 -64
  61. package/src/layouts/header/HeaderNotice.vue +176 -176
  62. package/src/layouts/header/HeaderSearch.vue +67 -67
  63. package/src/layouts/header/InstitutionDetail.vue +181 -181
  64. package/src/layouts/header/index.less +92 -92
  65. package/src/layouts/tabs/TabsHead.vue +190 -190
  66. package/src/layouts/tabs/TabsView.vue +379 -379
  67. package/src/mock/goods/index.js +108 -108
  68. package/src/pages/exception/404.vue +25 -25
  69. package/src/pages/login/Login.vue +363 -363
  70. package/src/pages/report/ReportTable.js +124 -124
  71. package/src/pages/report/ReportTableHome.vue +28 -28
  72. package/src/pages/resourceManage/orgListManage.vue +98 -98
  73. package/src/pages/system/dictionary/index.vue +80 -43
  74. package/src/pages/system/file/index.vue +317 -317
  75. package/src/pages/system/settings/index.vue +126 -126
  76. package/src/pages/system/settings/modifyPassword.vue +109 -109
  77. package/src/router/async/config.async.js +28 -28
  78. package/src/router/async/router.map.js +68 -68
  79. package/src/router/index.js +27 -27
  80. package/src/services/api/DictionaryDetailsViewApi.js +6 -6
  81. package/src/services/api/LogDetailsViewApi.js +10 -10
  82. package/src/services/api/QueryParamsDetailsViewApi.js +6 -6
  83. package/src/services/api/TicketDetailsViewApi.js +34 -34
  84. package/src/services/api/cas.js +79 -79
  85. package/src/services/api/commonTempTable.js +10 -10
  86. package/src/services/api/index.js +17 -17
  87. package/src/services/api/logininfor/index.js +6 -6
  88. package/src/services/api/manage.js +8 -8
  89. package/src/services/apiService.js +14 -14
  90. package/src/services/user.js +64 -64
  91. package/src/store/modules/index.js +4 -4
  92. package/src/theme/default/nprogress.less +76 -76
  93. package/src/theme/default/style.less +47 -47
  94. package/src/utils/colors.js +107 -107
  95. package/src/utils/excel/Blob.js +180 -180
  96. package/src/utils/excel/Export2Excel.js +141 -141
  97. package/src/utils/formatter.js +68 -68
  98. package/src/utils/i18n.js +80 -80
  99. package/src/utils/map-utils.js +8 -2
  100. package/src/utils/request.js +311 -311
  101. package/src/utils/theme-color-replacer-extend.js +91 -91
  102. package/src/utils/themeUtil.js +100 -100
  103. package/src/utils/util.js +230 -230
  104. package/vue.config.js +106 -106
@@ -1,111 +1,111 @@
1
- <template>
2
- <page-toggle-transition :disabled="animate.disabled" :animate="animate.name" :direction="animate.direction">
3
- <template v-if="login">
4
- <a-spin tip="加载中,马上好" :spinning="!isLoaded">
5
- <a-card>
6
- <iframe
7
- ref="singlepage"
8
- :src="url"
9
- :name="this.fullPath"
10
- class="single-page-iframe"
11
- @load="load">
12
- </iframe>
13
- </a-card>
14
- </a-spin>
15
- </template>
16
- </page-toggle-transition>
17
- </template>
18
-
19
- <script>
20
- import PageToggleTransition from '@vue2-client/components/transition/PageToggleTransition'
21
- import { ACCESS_TOKEN } from '@vue2-client/store/mutation-types'
22
- import { mapState, mapMutations } from 'vuex'
23
- import { CASLogin, doOtherValidate } from '@vue2-client/services/api/cas'
24
-
25
- export default {
26
- name: 'SinglePageView',
27
- components: { PageToggleTransition },
28
- props: {
29
- singlePageUrl: {
30
- type: String,
31
- default: ''
32
- },
33
- fullPath: {
34
- type: String,
35
- default: ''
36
- }
37
- },
38
- data () {
39
- return {
40
- iframe: null,
41
- url: '',
42
- isLoaded: false,
43
- }
44
- },
45
- computed: {
46
- ...mapState('setting', ['animate', 'iframeSrc']),
47
- ...mapState('account', ['login'])
48
- },
49
- created () {
50
- this.isLoaded = false
51
- if (this.singlePageUrl.indexOf('sso:') !== -1) {
52
- const serviceKey = this.singlePageUrl.substring(4)
53
- CASLogin(serviceKey, true).then(res => {
54
- const redirectUrl = res.redirectUrl
55
- if (redirectUrl.indexOf('logic@') !== -1) {
56
- const logicName = redirectUrl.substring(6)
57
- doOtherValidate(logicName, res.st, serviceKey).then(validateRes => {
58
- this.url = validateRes.redirectUrl
59
- })
60
- } else {
61
- const join = redirectUrl.split('?')[1] ? '&' : '?'
62
- this.url = redirectUrl + join + 'ticket=' + res.st + '&timestrap=' + new Date().getTime()
63
- }
64
- }).catch(msg => {
65
- console.warn(msg)
66
- this.$message.error(msg)
67
- })
68
- } else {
69
- this.url = this.iframeSrc
70
- }
71
- },
72
- mounted () {
73
- if (!this.login) {
74
- this.setLogin(JSON.parse(sessionStorage.getItem(process.env.VUE_APP_LOGIN_KEY)))
75
- }
76
- this.iframe = this.$refs.singlepage.contentWindow
77
- this.path = this.$route.path
78
- },
79
- methods: {
80
- ...mapMutations('account', ['setLogin']),
81
- load () {
82
- if (this.singlePageUrl.indexOf('sso:') === -1) {
83
- const appdata = {
84
- singleValues: this.$appdata.getSingleValues(),
85
- params: this.$appdata.getParams()
86
- }
87
- const data = {
88
- token: localStorage.getItem(ACCESS_TOKEN),
89
- login: this.login,
90
- appdata: appdata,
91
- page: this.singlePageUrl
92
- }
93
- console.log('发送参数', data)
94
- if (this.iframe) {
95
- this.iframe.postMessage(data, '*')
96
- }
97
- }
98
- this.$emit('load', this.fullPath)
99
- this.isLoaded = true
100
- }
101
- }
102
- }
103
- </script>
104
-
105
- <style lang="less">
106
- .single-page-iframe {
107
- width: 100%;
108
- height: calc(100vh - 117px);
109
- border: none;
110
- }
111
- </style>
1
+ <template>
2
+ <page-toggle-transition :disabled="animate.disabled" :animate="animate.name" :direction="animate.direction">
3
+ <template v-if="login">
4
+ <a-spin tip="加载中,马上好" :spinning="!isLoaded">
5
+ <a-card>
6
+ <iframe
7
+ ref="singlepage"
8
+ :src="url"
9
+ :name="this.fullPath"
10
+ class="single-page-iframe"
11
+ @load="load">
12
+ </iframe>
13
+ </a-card>
14
+ </a-spin>
15
+ </template>
16
+ </page-toggle-transition>
17
+ </template>
18
+
19
+ <script>
20
+ import PageToggleTransition from '@vue2-client/components/transition/PageToggleTransition'
21
+ import { ACCESS_TOKEN } from '@vue2-client/store/mutation-types'
22
+ import { mapState, mapMutations } from 'vuex'
23
+ import { CASLogin, doOtherValidate } from '@vue2-client/services/api/cas'
24
+
25
+ export default {
26
+ name: 'SinglePageView',
27
+ components: { PageToggleTransition },
28
+ props: {
29
+ singlePageUrl: {
30
+ type: String,
31
+ default: ''
32
+ },
33
+ fullPath: {
34
+ type: String,
35
+ default: ''
36
+ }
37
+ },
38
+ data () {
39
+ return {
40
+ iframe: null,
41
+ url: '',
42
+ isLoaded: false,
43
+ }
44
+ },
45
+ computed: {
46
+ ...mapState('setting', ['animate', 'iframeSrc']),
47
+ ...mapState('account', ['login'])
48
+ },
49
+ created () {
50
+ this.isLoaded = false
51
+ if (this.singlePageUrl.indexOf('sso:') !== -1) {
52
+ const serviceKey = this.singlePageUrl.substring(4)
53
+ CASLogin(serviceKey, true).then(res => {
54
+ const redirectUrl = res.redirectUrl
55
+ if (redirectUrl.indexOf('logic@') !== -1) {
56
+ const logicName = redirectUrl.substring(6)
57
+ doOtherValidate(logicName, res.st, serviceKey).then(validateRes => {
58
+ this.url = validateRes.redirectUrl
59
+ })
60
+ } else {
61
+ const join = redirectUrl.split('?')[1] ? '&' : '?'
62
+ this.url = redirectUrl + join + 'ticket=' + res.st + '&timestrap=' + new Date().getTime()
63
+ }
64
+ }).catch(msg => {
65
+ console.warn(msg)
66
+ this.$message.error(msg)
67
+ })
68
+ } else {
69
+ this.url = this.iframeSrc
70
+ }
71
+ },
72
+ mounted () {
73
+ if (!this.login) {
74
+ this.setLogin(JSON.parse(sessionStorage.getItem(process.env.VUE_APP_LOGIN_KEY)))
75
+ }
76
+ this.iframe = this.$refs.singlepage.contentWindow
77
+ this.path = this.$route.path
78
+ },
79
+ methods: {
80
+ ...mapMutations('account', ['setLogin']),
81
+ load () {
82
+ if (this.singlePageUrl.indexOf('sso:') === -1) {
83
+ const appdata = {
84
+ singleValues: this.$appdata.getSingleValues(),
85
+ params: this.$appdata.getParams()
86
+ }
87
+ const data = {
88
+ token: localStorage.getItem(ACCESS_TOKEN),
89
+ login: this.login,
90
+ appdata: appdata,
91
+ page: this.singlePageUrl
92
+ }
93
+ console.log('发送参数', data)
94
+ if (this.iframe) {
95
+ this.iframe.postMessage(data, '*')
96
+ }
97
+ }
98
+ this.$emit('load', this.fullPath)
99
+ this.isLoaded = true
100
+ }
101
+ }
102
+ }
103
+ </script>
104
+
105
+ <style lang="less">
106
+ .single-page-iframe {
107
+ width: 100%;
108
+ height: calc(100vh - 117px);
109
+ border: none;
110
+ }
111
+ </style>
@@ -1,49 +1,49 @@
1
- <template>
2
- <div class="footer">
3
- <div class="links">
4
- <a target="_blank" :key="index" :href="item.link ? item.link : 'javascript: void(0)'" v-for="(item, index) in linkList">
5
- <a-icon v-if="item.icon" :type="item.icon"/>{{ item.name }}
6
- </a>
7
- </div>
8
- <div class="copyright" v-if="!copyrightStyle">
9
- Copyright<a-icon type="copyright" />{{ copyright }}
10
- </div>
11
- <div class="copyright2" :style="copyrightStyle" v-else>
12
- {{ copyright }}
13
- </div>
14
- </div>
15
- </template>
16
-
17
- <script>
18
- export default {
19
- name: 'PageFooter',
20
- // eslint-disable-next-line vue/require-prop-types
21
- props: ['copyright', 'linkList', 'copyrightStyle']
22
- }
23
- </script>
24
-
25
- <style lang="less" scoped>
26
- .footer{
27
- padding: 48px 16px 24px;
28
- /*margin: 48px 0 24px;*/
29
- text-align: center;
30
- .copyright{
31
- color: @text-color-second;
32
- font-size: 14px;
33
- i {
34
- margin: 0 4px;
35
- }
36
- }
37
- .links{
38
- margin-bottom: 8px;
39
- a:not(:last-child) {
40
- margin-right: 40px;
41
- }
42
- a{
43
- color: @text-color-second;
44
- -webkit-transition: all .3s;
45
- transition: all .3s;
46
- }
47
- }
48
- }
49
- </style>
1
+ <template>
2
+ <div class="footer">
3
+ <div class="links">
4
+ <a target="_blank" :key="index" :href="item.link ? item.link : 'javascript: void(0)'" v-for="(item, index) in linkList">
5
+ <a-icon v-if="item.icon" :type="item.icon"/>{{ item.name }}
6
+ </a>
7
+ </div>
8
+ <div class="copyright" v-if="!copyrightStyle">
9
+ Copyright<a-icon type="copyright" />{{ copyright }}
10
+ </div>
11
+ <div class="copyright2" :style="copyrightStyle" v-else>
12
+ {{ copyright }}
13
+ </div>
14
+ </div>
15
+ </template>
16
+
17
+ <script>
18
+ export default {
19
+ name: 'PageFooter',
20
+ // eslint-disable-next-line vue/require-prop-types
21
+ props: ['copyright', 'linkList', 'copyrightStyle']
22
+ }
23
+ </script>
24
+
25
+ <style lang="less" scoped>
26
+ .footer{
27
+ padding: 48px 16px 24px;
28
+ /*margin: 48px 0 24px;*/
29
+ text-align: center;
30
+ .copyright{
31
+ color: @text-color-second;
32
+ font-size: 14px;
33
+ i {
34
+ margin: 0 4px;
35
+ }
36
+ }
37
+ .links{
38
+ margin-bottom: 8px;
39
+ a:not(:last-child) {
40
+ margin-right: 40px;
41
+ }
42
+ a{
43
+ color: @text-color-second;
44
+ -webkit-transition: all .3s;
45
+ transition: all .3s;
46
+ }
47
+ }
48
+ }
49
+ </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="logoSrc" width="32" alt="logo"/>
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', 'logoSrc', '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="logoSrc" width="32" alt="logo"/>
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', 'logoSrc', '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,64 +1,64 @@
1
- <template>
2
- <a-dropdown>
3
- <div class="header-avatar" style="cursor: pointer">
4
- <a-avatar class="avatar" size="small" shape="circle" :src="user.avatar"/>
5
- <span class="name">{{ user.name }}</span>
6
- </div>
7
- <a-menu :class="['avatar-menu']" slot="overlay">
8
- <a-menu-item>
9
- <a-icon type="user" />
10
- <span>个人中心</span>
11
- </a-menu-item>
12
- <a-menu-item @click="handleToSettings">
13
- <a-icon type="setting"/>
14
- <span>设置</span>
15
- </a-menu-item>
16
- <a-menu-divider />
17
- <a-menu-item @click="logout">
18
- <a-icon style="margin-right: 8px;" type="poweroff" />
19
- <span>退出登录</span>
20
- </a-menu-item>
21
- </a-menu>
22
- </a-dropdown>
23
- </template>
24
-
25
- <script>
26
- import { mapGetters } from 'vuex'
27
- import { logout } from '@vue2-client/services/user'
28
-
29
- export default {
30
- name: 'HeaderAvatar',
31
- computed: {
32
- ...mapGetters('account', ['user'])
33
- },
34
- methods: {
35
- handleToSettings () {
36
- this.$router.push({ path: '/system/settings' })
37
- },
38
- logout () {
39
- logout().finally(res => {
40
- location.href = '/login'
41
- })
42
- }
43
- }
44
- }
45
- </script>
46
-
47
- <style lang="less">
48
- .header-avatar{
49
- display: inline-flex;
50
- .avatar, .name{
51
- align-self: center;
52
- }
53
- .avatar{
54
- margin-right: 8px;
55
- }
56
- .name{
57
- font-weight: 500;
58
- }
59
- }
60
- .avatar-menu{
61
- width: 150px;
62
- }
63
-
64
- </style>
1
+ <template>
2
+ <a-dropdown>
3
+ <div class="header-avatar" style="cursor: pointer">
4
+ <a-avatar class="avatar" size="small" shape="circle" :src="user.avatar"/>
5
+ <span class="name">{{ user.name }}</span>
6
+ </div>
7
+ <a-menu :class="['avatar-menu']" slot="overlay">
8
+ <a-menu-item>
9
+ <a-icon type="user" />
10
+ <span>个人中心</span>
11
+ </a-menu-item>
12
+ <a-menu-item @click="handleToSettings">
13
+ <a-icon type="setting"/>
14
+ <span>设置</span>
15
+ </a-menu-item>
16
+ <a-menu-divider />
17
+ <a-menu-item @click="logout">
18
+ <a-icon style="margin-right: 8px;" type="poweroff" />
19
+ <span>退出登录</span>
20
+ </a-menu-item>
21
+ </a-menu>
22
+ </a-dropdown>
23
+ </template>
24
+
25
+ <script>
26
+ import { mapGetters } from 'vuex'
27
+ import { logout } from '@vue2-client/services/user'
28
+
29
+ export default {
30
+ name: 'HeaderAvatar',
31
+ computed: {
32
+ ...mapGetters('account', ['user'])
33
+ },
34
+ methods: {
35
+ handleToSettings () {
36
+ this.$router.push({ path: '/system/settings' })
37
+ },
38
+ logout () {
39
+ logout().finally(res => {
40
+ location.href = '/login'
41
+ })
42
+ }
43
+ }
44
+ }
45
+ </script>
46
+
47
+ <style lang="less">
48
+ .header-avatar{
49
+ display: inline-flex;
50
+ .avatar, .name{
51
+ align-self: center;
52
+ }
53
+ .avatar{
54
+ margin-right: 8px;
55
+ }
56
+ .name{
57
+ font-weight: 500;
58
+ }
59
+ }
60
+ .avatar-menu{
61
+ width: 150px;
62
+ }
63
+
64
+ </style>