vue2-client 1.2.37 → 1.2.41

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 (63) hide show
  1. package/CHANGELOG.md +103 -90
  2. package/docs/notice.md +22 -22
  3. package/package.json +1 -1
  4. package/src/base-client/all.js +2 -0
  5. package/src/base-client/components/common/AmapMarker/AmapPointRendering.vue +104 -0
  6. package/src/base-client/components/common/AmapMarker/index.js +3 -0
  7. package/src/base-client/components/common/FormGroupEdit/FormGroupEdit.vue +149 -149
  8. package/src/base-client/components/common/XAddNativeForm/XAddNativeForm.vue +315 -315
  9. package/src/base-client/components/common/XForm/XForm.vue +275 -275
  10. package/src/base-client/components/iot/CustomerDetailsView/CustomerDetailsView.vue +225 -225
  11. package/src/base-client/components/iot/DataAnalysisView/DataAnalysisView.vue +244 -244
  12. package/src/base-client/components/iot/DeviceBrandDetailsView/DeviceBrandDetailsView.vue +452 -452
  13. package/src/base-client/components/iot/DeviceDetailsView/DeviceDetailsView.vue +8 -2
  14. package/src/base-client/components/iot/DeviceDetailsView/part/DeviceDetailsCount.vue +330 -330
  15. package/src/base-client/components/iot/DeviceDetailsView/part/DeviceDetailsException.vue +57 -57
  16. package/src/base-client/components/iot/DeviceDetailsView/part/DeviceDetailsInstructOperate.vue +121 -121
  17. package/src/base-client/components/iot/DeviceDetailsView/part/DeviceDetailsRead.vue +131 -131
  18. package/src/base-client/components/iot/DeviceTypeDetailsView/DeviceTypeDetailsView.vue +276 -276
  19. package/src/base-client/components/iot/InstructDetailsView/InstructDetailsView.vue +469 -469
  20. package/src/base-client/components/iot/LogDetailsView/LogDetailsView.vue +379 -379
  21. package/src/base-client/components/iot/MeterDetailsView/MeterDetailsView.vue +359 -359
  22. package/src/base-client/components/iot/MeterDetailsView/part/MeterDetailsCount.vue +335 -335
  23. package/src/base-client/components/iot/MeterDetailsView/part/MeterDetailsException.vue +184 -184
  24. package/src/base-client/components/iot/MeterDetailsView/part/MeterDetailsHandPlan.vue +291 -291
  25. package/src/base-client/components/iot/MeterDetailsView/part/MeterDetailsInstruct.vue +236 -236
  26. package/src/base-client/components/iot/MeterDetailsView/part/MeterDetailsMain.vue +256 -256
  27. package/src/base-client/components/iot/MeterDetailsView/part/MeterDetailsSellGas.vue +189 -189
  28. package/src/base-client/components/iot/WebmeterAnalysisView/WebmeterAnalysisView.vue +722 -722
  29. package/src/base-client/components/system/DictionaryDetailsView/DictionaryDetailsView.vue +231 -231
  30. package/src/base-client/components/system/QueryParamsDetailsView/QueryParamsDetailsView.vue +247 -247
  31. package/src/base-client/components/ticket/EmployeeDetailsView/EmployeeDetailsView.vue +370 -370
  32. package/src/base-client/components/ticket/TicketDetailsView/TicketDetailsView.vue +3 -3
  33. package/src/base-client/components/ticket/TicketDetailsView/part/TicketDetailsFlow.vue +260 -260
  34. package/src/base-client/components/ticket/TicketSubmitSuccessView/TicketSubmitSuccessView.vue +532 -532
  35. package/src/base-client/plugins/AppData.js +67 -67
  36. package/src/base-client/plugins/GetLoginInfoService.js +252 -252
  37. package/src/components/exception/ExceptionPage.vue +70 -70
  38. package/src/components/setting/Setting.vue +235 -237
  39. package/src/config/default/setting.config.js +6 -5
  40. package/src/config/index.js +3 -6
  41. package/src/layouts/SinglePageView.vue +13 -17
  42. package/src/layouts/header/HeaderNotice.vue +97 -97
  43. package/src/layouts/tabs/TabsView.vue +3 -5
  44. package/src/pages/login/Login.vue +4 -1
  45. package/src/pages/report/ReportTableHome.vue +28 -28
  46. package/src/pages/resourceManage/depListManage.vue +23 -23
  47. package/src/pages/resourceManage/funListManage.vue +23 -23
  48. package/src/pages/resourceManage/index.js +15 -15
  49. package/src/pages/resourceManage/orgListManage.vue +98 -98
  50. package/src/pages/resourceManage/roleListManage.vue +23 -23
  51. package/src/pages/resourceManage/staffListManage.vue +23 -23
  52. package/src/pages/system/ticket/index.vue +456 -440
  53. package/src/pages/system/ticket/submitTicketSuccess.vue +248 -248
  54. package/src/router/async/config.async.js +26 -26
  55. package/src/router/async/router.map.js +58 -59
  56. package/src/router/index.js +27 -27
  57. package/src/services/api/common.js +47 -47
  58. package/src/services/api/index.js +39 -39
  59. package/src/services/user.js +34 -34
  60. package/src/utils/indexedDB.js +146 -146
  61. package/src/utils/routerUtil.js +359 -360
  62. package/vue.config.js +2 -2
  63. package/src/config/config.js +0 -15
@@ -1,70 +1,70 @@
1
- <template>
2
- <div class="exception-page">
3
- <div class="img">
4
- <img :src="config[type].img" />
5
- </div>
6
- <div class="content">
7
- <h1>{{ config[type].title }}</h1>
8
- <div class="desc">{{ config[type].desc }}</div>
9
- <div class="action">
10
- <!--<a-button type="primary" @click="backHome">返回首页</a-button>-->
11
- </div>
12
- </div>
13
- </div>
14
- </template>
15
-
16
- <script>
17
- import Config from './typeConfig'
18
-
19
- export default {
20
- name: 'ExceptionPage',
21
- // eslint-disable-next-line vue/require-prop-types
22
- props: ['type', 'homeRoute'],
23
- data () {
24
- return {
25
- config: Config
26
- }
27
- },
28
- methods: {
29
- backHome () {
30
- if (this.homeRoute) {
31
- this.$router.push(this.homeRoute)
32
- }
33
- this.$emit('backHome', this.type)
34
- }
35
- }
36
- }
37
- </script>
38
-
39
- <style lang="less" scoped>
40
- .exception-page{
41
- border-radius: 4px;
42
- display: flex;
43
- justify-content: center;
44
- align-items: center;
45
- background-color: @base-bg-color;
46
- .img{
47
- padding-right: 52px;
48
- zoom: 1;
49
- img{
50
- max-width: 430px;
51
- }
52
- }
53
- .content{
54
- h1{
55
- color: #434e59;
56
- font-size: 72px;
57
- font-weight: 600;
58
- line-height: 72px;
59
- margin-bottom: 24px;
60
- }
61
- .desc{
62
- color: @text-color-second;
63
- font-size: 20px;
64
- line-height: 28px;
65
- margin-bottom: 16px;
66
- }
67
- }
68
- }
69
-
70
- </style>
1
+ <template>
2
+ <div class="exception-page">
3
+ <div class="img">
4
+ <img :src="config[type].img" />
5
+ </div>
6
+ <div class="content">
7
+ <h1>{{ config[type].title }}</h1>
8
+ <div class="desc">{{ config[type].desc }}</div>
9
+ <div class="action">
10
+ <!--<a-button type="primary" @click="backHome">返回首页</a-button>-->
11
+ </div>
12
+ </div>
13
+ </div>
14
+ </template>
15
+
16
+ <script>
17
+ import Config from './typeConfig'
18
+
19
+ export default {
20
+ name: 'ExceptionPage',
21
+ // eslint-disable-next-line vue/require-prop-types
22
+ props: ['type', 'homeRoute'],
23
+ data () {
24
+ return {
25
+ config: Config
26
+ }
27
+ },
28
+ methods: {
29
+ backHome () {
30
+ if (this.homeRoute) {
31
+ this.$router.push(this.homeRoute)
32
+ }
33
+ this.$emit('backHome', this.type)
34
+ }
35
+ }
36
+ }
37
+ </script>
38
+
39
+ <style lang="less" scoped>
40
+ .exception-page{
41
+ border-radius: 4px;
42
+ display: flex;
43
+ justify-content: center;
44
+ align-items: center;
45
+ background-color: @base-bg-color;
46
+ .img{
47
+ padding-right: 52px;
48
+ zoom: 1;
49
+ img{
50
+ max-width: 430px;
51
+ }
52
+ }
53
+ .content{
54
+ h1{
55
+ color: #434e59;
56
+ font-size: 72px;
57
+ font-weight: 600;
58
+ line-height: 72px;
59
+ margin-bottom: 24px;
60
+ }
61
+ .desc{
62
+ color: @text-color-second;
63
+ font-size: 20px;
64
+ line-height: 28px;
65
+ margin-bottom: 16px;
66
+ }
67
+ }
68
+ }
69
+
70
+ </style>
@@ -1,237 +1,235 @@
1
- <template>
2
- <div class="side-setting">
3
- <setting-item>
4
- <a-button @click="saveSetting" type="primary" icon="save">{{ $t('save') }}</a-button>
5
- <a-button @click="resetSetting" type="dashed" icon="redo" style="float: right">{{ $t('reset') }}</a-button>
6
- </setting-item>
7
- <setting-item :title="$t('theme.title')">
8
- <img-checkbox-group
9
- @change="values => setTheme({...theme, mode: values[0]})"
10
- :default-values="[theme.mode]"
11
- >
12
- <img-checkbox :title="$t('theme.dark')" img="https://gw.alipayobjects.com/zos/rmsportal/LCkqqYNmvBEbokSDscrm.svg" value="dark"/>
13
- <img-checkbox :title="$t('theme.light')" img="https://gw.alipayobjects.com/zos/rmsportal/jpRkZQMyYRryryPNtyIC.svg" value="light"/>
14
- <img-checkbox :title="$t('theme.night')" img="https://gw.alipayobjects.com/zos/antfincdn/hmKaLQvmY2/LCkqqYNmvBEbokSDscrm.svg" value="night"/>
15
- </img-checkbox-group>
16
- </setting-item>
17
- <setting-item :title="$t('theme.color')">
18
- <color-checkbox-group
19
- @change="(values, colors) => setTheme({...theme, color: colors[0]})"
20
- :defaultValues="[palettes.indexOf(theme.color)]"
21
- :multiple="false"
22
- >
23
- <color-checkbox v-for="(color, index) in palettes" :key="index" :color="color" :value="index" />
24
- </color-checkbox-group>
25
- </setting-item>
26
- <a-divider/>
27
- <setting-item :title="$t('navigate.title')">
28
- <img-checkbox-group
29
- @change="values => setLayout(values[0])"
30
- :default-values="[layout]"
31
- >
32
- <img-checkbox :title="$t('navigate.side')" img="https://gw.alipayobjects.com/zos/rmsportal/JopDzEhOqwOjeNTXkoje.svg" value="side"/>
33
- <img-checkbox :title="$t('navigate.head')" img="https://gw.alipayobjects.com/zos/rmsportal/KDNDBbriJhLwuqMoxcAr.svg" value="head"/>
34
- <img-checkbox :title="$t('navigate.mix')" img="https://gw.alipayobjects.com/zos/antfincdn/x8Ob%26B8cy8/LCkqqYNmvBEbokSDscrm.svg" value="mix"/>
35
- </img-checkbox-group>
36
- </setting-item>
37
- <setting-item>
38
- <a-list :split="false">
39
- <a-list-item>
40
- {{ $t('navigate.content.title') }}
41
- <a-select
42
- :getPopupContainer="getPopupContainer"
43
- :value="pageWidth"
44
- @change="setPageWidth"
45
- class="select-item"
46
- size="small"
47
- slot="actions"
48
- >
49
- <a-select-option value="fluid">{{ $t('navigate.content.fluid') }}</a-select-option>
50
- <a-select-option value="fixed">{{ $t('navigate.content.fixed') }}</a-select-option>
51
- </a-select>
52
- </a-list-item>
53
- <a-list-item>
54
- {{ $t('navigate.fixedHeader') }}
55
- <a-switch :checked="fixedHeader" slot="actions" size="small" @change="setFixedHeader" />
56
- </a-list-item>
57
- <a-list-item>
58
- {{ $t('navigate.fixedSideBar') }}
59
- <a-switch :checked="fixedSideBar" slot="actions" size="small" @change="setFixedSideBar" />
60
- </a-list-item>
61
- </a-list>
62
- </setting-item>
63
- <a-divider />
64
- <setting-item :title="$t('other.title')">
65
- <a-list :split="false">
66
- <a-list-item>
67
- {{ $t('other.weekMode') }}
68
- <a-switch :checked="weekMode" slot="actions" size="small" @change="setWeekMode" />
69
- </a-list-item>
70
- <a-list-item>
71
- {{ $t('other.multiPages') }}
72
- <a-switch :checked="multiPage" slot="actions" size="small" @change="setMultiPage" />
73
- </a-list-item>
74
- <a-list-item>
75
- {{ $t('other.hideSetting') }}
76
- <a-switch :checked="hideSetting" slot="actions" size="small" @change="setHideSetting" />
77
- </a-list-item>
78
- </a-list>
79
- </setting-item>
80
- <a-divider />
81
- <setting-item :title="$t('animate.title')">
82
- <a-list :split="false">
83
- <a-list-item>
84
- {{ $t('animate.disable') }}
85
- <a-switch :checked="animate.disabled" slot="actions" size="small" @change="val => setAnimate({...animate, disabled: val})" />
86
- </a-list-item>
87
- <a-list-item>
88
- {{ $t('animate.effect') }}
89
- <a-select
90
- :value="animate.name"
91
- :getPopupContainer="getPopupContainer"
92
- @change="val => setAnimate({...animate, name: val})"
93
- class="select-item"
94
- size="small"
95
- slot="actions"
96
- >
97
- <a-select-option :key="index" :value="item.name" v-for="(item, index) in animates">{{ item.alias }}</a-select-option>
98
- </a-select>
99
- </a-list-item>
100
- <a-list-item>
101
- {{ $t('animate.direction') }}
102
- <a-select
103
- :value="animate.direction"
104
- :getPopupContainer="getPopupContainer"
105
- @change="val => setAnimate({...animate, direction: val})"
106
- class="select-item"
107
- size="small"
108
- slot="actions"
109
- >
110
- <a-select-option :key="index" :value="item" v-for="(item, index) in directions">{{ item }}</a-select-option>
111
- </a-select>
112
- </a-list-item>
113
- </a-list>
114
- </setting-item>
115
- <a-alert
116
- v-if="isDev"
117
- style="max-width: 240px; margin: -16px 0 8px; word-break: break-all"
118
- type="warning"
119
- :message="$t('alert')"
120
- >
121
- </a-alert>
122
- <a-button
123
- v-if="isDev"
124
- id="copyBtn"
125
- :data-clipboard-text="copyConfig"
126
- @click="copyCode"
127
- style="width: 100%"
128
- icon="copy" >{{ $t('copy') }}</a-button>
129
- </div>
130
- </template>
131
-
132
- <script>
133
- import SettingItem from './SettingItem'
134
- import { ColorCheckbox, ImgCheckbox } from '@vue2-client/components/checkbox'
135
- import Clipboard from 'clipboard'
136
- import { mapState, mapMutations } from 'vuex'
137
- import { formatConfig } from '@vue2-client/utils/formatter'
138
- import { setting } from '@vue2-client/config/default'
139
- import sysConfig from '@vue2-client/config/config'
140
- import fastEqual from 'fast-deep-equal'
141
- import deepMerge from 'deepmerge'
142
-
143
- const ColorCheckboxGroup = ColorCheckbox.Group
144
- const ImgCheckboxGroup = ImgCheckbox.Group
145
- export default {
146
- name: 'Setting',
147
- i18n: require('./i18n'),
148
- components: { ImgCheckboxGroup, ImgCheckbox, ColorCheckboxGroup, ColorCheckbox, SettingItem },
149
- data () {
150
- return {
151
- copyConfig: 'Sorry, you have copied nothing O(∩_∩)O~',
152
- isDev: process.env.NODE_ENV === 'development'
153
- }
154
- },
155
- computed: {
156
- directions () {
157
- return this.animates.find(item => item.name == this.animate.name).directions
158
- },
159
- ...mapState('setting', ['theme', 'layout', 'animate', 'animates', 'palettes', 'multiPage', 'weekMode', 'fixedHeader', 'fixedSideBar', 'hideSetting', 'pageWidth'])
160
- },
161
- watch: {
162
- 'animate.name': function (val) {
163
- this.setAnimate({ name: val, direction: this.directions[0] })
164
- }
165
- },
166
- methods: {
167
- getPopupContainer () {
168
- return this.$el.parentNode
169
- },
170
- copyCode () {
171
- const config = this.extractConfig(false)
172
- this.copyConfig = `// 自定义配置,参考 ./default/setting.config.js,需要自定义的属性在这里配置即可
173
- module.exports = ${formatConfig(config)}
174
- `
175
- const clipboard = new Clipboard('#copyBtn')
176
- clipboard.on('success', () => {
177
- this.$message.success(`复制成功,覆盖文件 src/config/config.js 然后重启项目即可生效`).then(() => {
178
- const localConfig = localStorage.getItem(process.env.VUE_APP_SETTING_KEY)
179
- if (localConfig) {
180
- console.warn('检测到本地有历史保存的主题配置,想要要拷贝的配置代码生效,您可能需要先重置配置')
181
- this.$message.warn('检测到本地有历史保存的主题配置,想要要拷贝的配置代码生效,您可能需要先重置配置', 5)
182
- }
183
- })
184
- clipboard.destroy()
185
- })
186
- },
187
- saveSetting () {
188
- const closeMessage = this.$message.loading('正在保存到本地,请稍后...', 0)
189
- const config = this.extractConfig(true)
190
- localStorage.setItem(process.env.VUE_APP_SETTING_KEY, JSON.stringify(config))
191
- setTimeout(closeMessage, 800)
192
- },
193
- resetSetting () {
194
- this.$confirm({
195
- title: '重置主题会刷新页面,当前页面内容不会保留,确认重置?',
196
- onOk () {
197
- localStorage.removeItem(process.env.VUE_APP_SETTING_KEY)
198
- window.location.reload()
199
- }
200
- })
201
- },
202
- // 提取配置
203
- extractConfig (local = false) {
204
- const config = {}
205
- const mySetting = this.$store.state.setting
206
- const dftSetting = local ? deepMerge(setting, sysConfig) : setting
207
- Object.keys(mySetting).forEach(key => {
208
- const dftValue = dftSetting[key]; const myValue = mySetting[key]
209
- if (dftValue != undefined && !fastEqual(dftValue, myValue)) {
210
- config[key] = myValue
211
- }
212
- })
213
- return config
214
- },
215
- ...mapMutations('setting', ['setTheme', 'setLayout', 'setMultiPage', 'setWeekMode',
216
- 'setFixedSideBar', 'setFixedHeader', 'setAnimate', 'setHideSetting', 'setPageWidth'])
217
- }
218
- }
219
- </script>
220
-
221
- <style lang="less" scoped>
222
- .side-setting{
223
- min-height: 100%;
224
- background-color: @base-bg-color;
225
- padding: 24px;
226
- font-size: 14px;
227
- line-height: 1.5;
228
- word-wrap: break-word;
229
- position: relative;
230
- .flex{
231
- display: flex;
232
- }
233
- .select-item{
234
- width: 80px;
235
- }
236
- }
237
- </style>
1
+ <template>
2
+ <div class="side-setting">
3
+ <setting-item>
4
+ <a-button @click="saveSetting" type="primary" icon="save">{{ $t('save') }}</a-button>
5
+ <a-button @click="resetSetting" type="dashed" icon="redo" style="float: right">{{ $t('reset') }}</a-button>
6
+ </setting-item>
7
+ <setting-item :title="$t('theme.title')">
8
+ <img-checkbox-group
9
+ @change="values => setTheme({...theme, mode: values[0]})"
10
+ :default-values="[theme.mode]"
11
+ >
12
+ <img-checkbox :title="$t('theme.dark')" img="https://gw.alipayobjects.com/zos/rmsportal/LCkqqYNmvBEbokSDscrm.svg" value="dark"/>
13
+ <img-checkbox :title="$t('theme.light')" img="https://gw.alipayobjects.com/zos/rmsportal/jpRkZQMyYRryryPNtyIC.svg" value="light"/>
14
+ <img-checkbox :title="$t('theme.night')" img="https://gw.alipayobjects.com/zos/antfincdn/hmKaLQvmY2/LCkqqYNmvBEbokSDscrm.svg" value="night"/>
15
+ </img-checkbox-group>
16
+ </setting-item>
17
+ <setting-item :title="$t('theme.color')">
18
+ <color-checkbox-group
19
+ @change="(values, colors) => setTheme({...theme, color: colors[0]})"
20
+ :defaultValues="[palettes.indexOf(theme.color)]"
21
+ :multiple="false"
22
+ >
23
+ <color-checkbox v-for="(color, index) in palettes" :key="index" :color="color" :value="index" />
24
+ </color-checkbox-group>
25
+ </setting-item>
26
+ <a-divider/>
27
+ <setting-item :title="$t('navigate.title')">
28
+ <img-checkbox-group
29
+ @change="values => setLayout(values[0])"
30
+ :default-values="[layout]"
31
+ >
32
+ <img-checkbox :title="$t('navigate.side')" img="https://gw.alipayobjects.com/zos/rmsportal/JopDzEhOqwOjeNTXkoje.svg" value="side"/>
33
+ <img-checkbox :title="$t('navigate.head')" img="https://gw.alipayobjects.com/zos/rmsportal/KDNDBbriJhLwuqMoxcAr.svg" value="head"/>
34
+ <img-checkbox :title="$t('navigate.mix')" img="https://gw.alipayobjects.com/zos/antfincdn/x8Ob%26B8cy8/LCkqqYNmvBEbokSDscrm.svg" value="mix"/>
35
+ </img-checkbox-group>
36
+ </setting-item>
37
+ <setting-item>
38
+ <a-list :split="false">
39
+ <a-list-item>
40
+ {{ $t('navigate.content.title') }}
41
+ <a-select
42
+ :getPopupContainer="getPopupContainer"
43
+ :value="pageWidth"
44
+ @change="setPageWidth"
45
+ class="select-item"
46
+ size="small"
47
+ slot="actions"
48
+ >
49
+ <a-select-option value="fluid">{{ $t('navigate.content.fluid') }}</a-select-option>
50
+ <a-select-option value="fixed">{{ $t('navigate.content.fixed') }}</a-select-option>
51
+ </a-select>
52
+ </a-list-item>
53
+ <a-list-item>
54
+ {{ $t('navigate.fixedHeader') }}
55
+ <a-switch :checked="fixedHeader" slot="actions" size="small" @change="setFixedHeader" />
56
+ </a-list-item>
57
+ <a-list-item>
58
+ {{ $t('navigate.fixedSideBar') }}
59
+ <a-switch :checked="fixedSideBar" slot="actions" size="small" @change="setFixedSideBar" />
60
+ </a-list-item>
61
+ </a-list>
62
+ </setting-item>
63
+ <a-divider />
64
+ <setting-item :title="$t('other.title')">
65
+ <a-list :split="false">
66
+ <a-list-item>
67
+ {{ $t('other.weekMode') }}
68
+ <a-switch :checked="weekMode" slot="actions" size="small" @change="setWeekMode" />
69
+ </a-list-item>
70
+ <a-list-item>
71
+ {{ $t('other.multiPages') }}
72
+ <a-switch :checked="multiPage" slot="actions" size="small" @change="setMultiPage" />
73
+ </a-list-item>
74
+ <a-list-item>
75
+ {{ $t('other.hideSetting') }}
76
+ <a-switch :checked="hideSetting" slot="actions" size="small" @change="setHideSetting" />
77
+ </a-list-item>
78
+ </a-list>
79
+ </setting-item>
80
+ <a-divider />
81
+ <setting-item :title="$t('animate.title')">
82
+ <a-list :split="false">
83
+ <a-list-item>
84
+ {{ $t('animate.disable') }}
85
+ <a-switch :checked="animate.disabled" slot="actions" size="small" @change="val => setAnimate({...animate, disabled: val})" />
86
+ </a-list-item>
87
+ <a-list-item>
88
+ {{ $t('animate.effect') }}
89
+ <a-select
90
+ :value="animate.name"
91
+ :getPopupContainer="getPopupContainer"
92
+ @change="val => setAnimate({...animate, name: val})"
93
+ class="select-item"
94
+ size="small"
95
+ slot="actions"
96
+ >
97
+ <a-select-option :key="index" :value="item.name" v-for="(item, index) in animates">{{ item.alias }}</a-select-option>
98
+ </a-select>
99
+ </a-list-item>
100
+ <a-list-item>
101
+ {{ $t('animate.direction') }}
102
+ <a-select
103
+ :value="animate.direction"
104
+ :getPopupContainer="getPopupContainer"
105
+ @change="val => setAnimate({...animate, direction: val})"
106
+ class="select-item"
107
+ size="small"
108
+ slot="actions"
109
+ >
110
+ <a-select-option :key="index" :value="item" v-for="(item, index) in directions">{{ item }}</a-select-option>
111
+ </a-select>
112
+ </a-list-item>
113
+ </a-list>
114
+ </setting-item>
115
+ <a-alert
116
+ v-if="isDev"
117
+ style="max-width: 240px; margin: -16px 0 8px; word-break: break-all"
118
+ type="warning"
119
+ :message="$t('alert')"
120
+ >
121
+ </a-alert>
122
+ <a-button
123
+ v-if="isDev"
124
+ id="copyBtn"
125
+ :data-clipboard-text="copyConfig"
126
+ @click="copyCode"
127
+ style="width: 100%"
128
+ icon="copy" >{{ $t('copy') }}</a-button>
129
+ </div>
130
+ </template>
131
+
132
+ <script>
133
+ import SettingItem from './SettingItem'
134
+ import { ColorCheckbox, ImgCheckbox } from '@vue2-client/components/checkbox'
135
+ import Clipboard from 'clipboard'
136
+ import { mapState, mapMutations } from 'vuex'
137
+ import { formatConfig } from '@vue2-client/utils/formatter'
138
+ import { setting } from '@vue2-client/config/default'
139
+ import fastEqual from 'fast-deep-equal'
140
+
141
+ const ColorCheckboxGroup = ColorCheckbox.Group
142
+ const ImgCheckboxGroup = ImgCheckbox.Group
143
+ export default {
144
+ name: 'Setting',
145
+ i18n: require('./i18n'),
146
+ components: { ImgCheckboxGroup, ImgCheckbox, ColorCheckboxGroup, ColorCheckbox, SettingItem },
147
+ data () {
148
+ return {
149
+ copyConfig: 'Sorry, you have copied nothing O(∩_∩)O~',
150
+ isDev: process.env.NODE_ENV === 'development'
151
+ }
152
+ },
153
+ computed: {
154
+ directions () {
155
+ return this.animates.find(item => item.name == this.animate.name).directions
156
+ },
157
+ ...mapState('setting', ['theme', 'layout', 'animate', 'animates', 'palettes', 'multiPage', 'weekMode', 'fixedHeader', 'fixedSideBar', 'hideSetting', 'pageWidth'])
158
+ },
159
+ watch: {
160
+ 'animate.name': function (val) {
161
+ this.setAnimate({ name: val, direction: this.directions[0] })
162
+ }
163
+ },
164
+ methods: {
165
+ getPopupContainer () {
166
+ return this.$el.parentNode
167
+ },
168
+ copyCode () {
169
+ const config = this.extractConfig()
170
+ this.copyConfig = `// 自定义配置,参考 ./default/setting.config.js,需要自定义的属性在这里配置即可
171
+ module.exports = ${formatConfig(config)}
172
+ `
173
+ const clipboard = new Clipboard('#copyBtn')
174
+ clipboard.on('success', () => {
175
+ this.$message.success(`复制成功,覆盖文件 src/config/config.js 然后重启项目即可生效`).then(() => {
176
+ const localConfig = localStorage.getItem(process.env.VUE_APP_SETTING_KEY)
177
+ if (localConfig) {
178
+ console.warn('检测到本地有历史保存的主题配置,想要要拷贝的配置代码生效,您可能需要先重置配置')
179
+ this.$message.warn('检测到本地有历史保存的主题配置,想要要拷贝的配置代码生效,您可能需要先重置配置', 5)
180
+ }
181
+ })
182
+ clipboard.destroy()
183
+ })
184
+ },
185
+ saveSetting () {
186
+ const closeMessage = this.$message.loading('正在保存到本地,请稍后...', 0)
187
+ const config = this.extractConfig()
188
+ localStorage.setItem(process.env.VUE_APP_SETTING_KEY, JSON.stringify(config))
189
+ setTimeout(closeMessage, 800)
190
+ },
191
+ resetSetting () {
192
+ this.$confirm({
193
+ title: '重置主题会刷新页面,当前页面内容不会保留,确认重置?',
194
+ onOk () {
195
+ localStorage.removeItem(process.env.VUE_APP_SETTING_KEY)
196
+ window.location.reload()
197
+ }
198
+ })
199
+ },
200
+ // 提取配置
201
+ extractConfig () {
202
+ const config = {}
203
+ const mySetting = this.$store.state.setting
204
+ const dftSetting = setting
205
+ Object.keys(mySetting).forEach(key => {
206
+ const dftValue = dftSetting[key]; const myValue = mySetting[key]
207
+ if (dftValue != undefined && !fastEqual(dftValue, myValue)) {
208
+ config[key] = myValue
209
+ }
210
+ })
211
+ return config
212
+ },
213
+ ...mapMutations('setting', ['setTheme', 'setLayout', 'setMultiPage', 'setWeekMode',
214
+ 'setFixedSideBar', 'setFixedHeader', 'setAnimate', 'setHideSetting', 'setPageWidth'])
215
+ }
216
+ }
217
+ </script>
218
+
219
+ <style lang="less" scoped>
220
+ .side-setting{
221
+ min-height: 100%;
222
+ background-color: @base-bg-color;
223
+ padding: 24px;
224
+ font-size: 14px;
225
+ line-height: 1.5;
226
+ word-wrap: break-word;
227
+ position: relative;
228
+ .flex{
229
+ display: flex;
230
+ }
231
+ .select-item{
232
+ width: 80px;
233
+ }
234
+ }
235
+ </style>
@@ -1,4 +1,4 @@
1
- // 此配置为系统默认设置,需修改的设置项,在src/config/config.js中添加修改项即可。也可直接在此文件中修改。
1
+ // 此配置为系统默认设置
2
2
  module.exports = {
3
3
  lang: 'CN', // 语言,可选 CN(简体)、HK(繁体)、US(英语),也可扩展其它语言
4
4
  theme: { // 主题
@@ -9,9 +9,9 @@ module.exports = {
9
9
  error: '#f5222f' // 错误色
10
10
  },
11
11
  layout: 'side', // 导航布局,可选 side 和 head,分别为侧边导航和顶部导航
12
- fixedHeader: false, // 固定头部状态栏,true:固定,false:不固定
12
+ fixedHeader: true, // 固定头部状态栏,true:固定,false:不固定
13
13
  fixedSideBar: true, // 固定侧边栏,true:固定,false:不固定
14
- fixedTabs: false, // 固定页签头,true:固定,false:不固定
14
+ fixedTabs: true, // 固定页签头,true:固定,false:不固定
15
15
  pageWidth: 'fixed', // 内容区域宽度,fixed:固定宽度,fluid:流式宽度
16
16
  weekMode: false, // 色弱模式,true:开启,false:不开启
17
17
  multiPage: true, // 多页签模式,true:开启,false:不开启
@@ -19,8 +19,9 @@ module.exports = {
19
19
  hideSetting: false, // 隐藏设置抽屉,true:隐藏,false:不隐藏
20
20
  homePage: '/system/dictionaryManage', // 首页路由, 登陆后默认打开
21
21
  ticketPage: '/submitTicket', // 提交工单路由
22
- systemName: '物联网监控平台', // 系统名称
23
- copyright: '2021 Mr.Jiang', // copyright
22
+ systemName: '基础组件平台', // 系统名称
23
+ systemDesc: '为PC端中、后台系统业务开发提供支持', // 系统描述
24
+ copyright: '2022 AoFengSoft', // copyright
24
25
  asyncRoutes: true, // 异步加载路由,true:开启,false:不开启
25
26
  showPageTitle: true, // 是否显示页面标题(PageLayout 布局中的页面标题),true:显示,false:不显示
26
27
  filterMenu: true, // 根据权限过滤菜单,true:过滤,false:不过滤