vue2-client 1.2.49 → 1.2.50

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 (48) hide show
  1. package/CHANGELOG.md +130 -130
  2. package/package.json +1 -1
  3. package/src/base-client/all.js +61 -61
  4. package/src/base-client/components/common/AmapMarker/AmapPointRendering.vue +105 -104
  5. package/src/base-client/components/common/AmapMarker/index.js +3 -3
  6. package/src/base-client/components/common/ScrollList/SrcollList.vue +113 -113
  7. package/src/base-client/components/common/ScrollList/index.js +3 -3
  8. package/src/base-client/components/common/XAddForm/XAddForm.vue +339 -339
  9. package/src/base-client/components/common/XAddNativeForm/XAddNativeForm.vue +316 -316
  10. package/src/base-client/components/common/XForm/XFormItem.vue +6 -1
  11. package/src/base-client/components/common/XFormTable/XFormTable.vue +0 -2
  12. package/src/base-client/components/iot/CustomerDetailsView/index.md +1 -2
  13. package/src/base-client/components/iot/DeviceBrandDetailsView/DeviceBrandDetailsView.vue +1 -1
  14. package/src/base-client/components/iot/DeviceDetailsView/DeviceDetailsView.vue +2 -7
  15. package/src/base-client/components/iot/DeviceDetailsView/index.md +0 -2
  16. package/src/base-client/components/iot/DeviceDetailsView/part/DeviceDetailsException.vue +57 -57
  17. package/src/base-client/components/iot/DeviceDetailsView/part/DeviceDetailsMain.vue +240 -196
  18. package/src/base-client/components/iot/DeviceDetailsView/part/DeviceDetailsRead.vue +131 -131
  19. package/src/base-client/components/iot/DeviceTypeDetailsView/DeviceTypeDetailsView.vue +1 -5
  20. package/src/base-client/components/iot/InstructDetailsView/InstructDetailsView.vue +6 -14
  21. package/src/base-client/components/iot/InstructDetailsView/index.md +0 -2
  22. package/src/base-client/components/iot/LogDetailsView/LogDetailsView.vue +6 -13
  23. package/src/base-client/components/iot/LogDetailsView/index.md +0 -2
  24. package/src/base-client/components/iot/MeterDetailsView/MeterDetailsView.vue +17 -24
  25. package/src/base-client/components/iot/MeterDetailsView/index.md +0 -2
  26. package/src/base-client/components/iot/MeterDetailsView/part/MeterDetailsCount.vue +0 -5
  27. package/src/base-client/components/iot/MeterDetailsView/part/MeterDetailsException.vue +0 -5
  28. package/src/base-client/components/iot/MeterDetailsView/part/MeterDetailsHandPlan.vue +0 -6
  29. package/src/base-client/components/iot/MeterDetailsView/part/MeterDetailsInstruct.vue +0 -6
  30. package/src/base-client/components/iot/MeterDetailsView/part/MeterDetailsMain.vue +1 -6
  31. package/src/base-client/components/iot/MeterDetailsView/part/MeterDetailsSellGas.vue +1 -6
  32. package/src/base-client/components/iot/WebmeterAnalysisView/WebmeterAnalysisView.vue +8 -83
  33. package/src/base-client/components/iot/WebmeterAnalysisView/index.md +0 -6
  34. package/src/base-client/components/ticket/TicketDetailsView/TicketDetailsView.vue +853 -853
  35. package/src/base-client/components/ticket/TicketSubmitSuccessView/TicketSubmitSuccessView.vue +532 -532
  36. package/src/base-client/plugins/AppData.js +57 -57
  37. package/src/base-client/plugins/compatible/LoginServiceOA.js +19 -0
  38. package/src/config/default/setting.config.js +2 -2
  39. package/src/layouts/header/HeaderNotice.vue +96 -96
  40. package/src/layouts/tabs/TabsView.vue +0 -3
  41. package/src/pages/login/Login.vue +53 -22
  42. package/src/pages/system/ticket/submitTicketSuccess.vue +268 -268
  43. package/src/router/async/config.async.js +26 -26
  44. package/src/router/index.js +27 -27
  45. package/src/theme/default/style.less +47 -47
  46. package/src/utils/map-utils.js +28 -17
  47. package/src/utils/routerUtil.js +1 -10
  48. package/vue.config.js +143 -143
@@ -1,268 +1,268 @@
1
- <template>
2
- <a-card class="result-success" :bordered="false">
3
- <result :is-success="icon" :description="description" :title="title">
4
- <template slot="action">
5
- <span style="margin-right: 10px" v-if="countDown > 0">{{ countDownFormat() }}</span>
6
- <a-button type="primary" v-if="UrgentAvailable" :disabled="urgentAccess" style="margin-right: 20px" @click="urgent">请求加急处理</a-button>
7
- <a-button type="danger" @click="closeBtn" >撤销工单</a-button>
8
- </template>
9
- <a-modal
10
- title="关闭工单"
11
- :visible="closeVisible"
12
- @ok="handleCloseOk"
13
- @cancel="handleCloseCancel"
14
- :zIndex="1002"
15
- >
16
- <p>是否确认手动关闭工单?</p>
17
- <p style="color: red">(该操作不可撤销,请谨慎操作!)</p>
18
- </a-modal>
19
- <div>
20
- <div class="project-name">工单处理进度</div>
21
- <detail-list size="small" style="max-width: 800px; margin-bottom: 8px">
22
- <detail-list-item term="工单编号">{{ serialNumber }}</detail-list-item>
23
- <detail-list-item term="负责人">{{ details.name }}</detail-list-item>
24
- <detail-list-item term="提交时间">2016-12-12</detail-list-item>
25
- </detail-list>
26
- <a-steps :current="step" progressDot>
27
- <a-step title="工单提交">
28
- <a-step-item-group slot="description">
29
- <a-step-item :title="details.uploader" />
30
- <a-step-item :title="details.createdTime"/>
31
- </a-step-item-group>
32
- </a-step>
33
- <a-step title="工单处理中" >
34
- <a-step-item-group slot="description">
35
- <a-step-item :title="details.name" v-if="step >= 1" />
36
- <a-step-item :title="details.confirmTime" v-if="step >= 1"/>
37
- </a-step-item-group>
38
- </a-step>
39
- <a-step title="工单完成" >
40
- <a-step-item-group slot="description">
41
- <a-step-item :title="details.finishedTime" v-if="step >= 2"/>
42
- </a-step-item-group>
43
- </a-step>
44
- </a-steps>
45
- </div>
46
- </result>
47
- </a-card>
48
- </template>
49
-
50
- <script>
51
- import Result from '@vue2-client/components/result/Result'
52
- import DetailList from '@vue2-client/components/tool/DetailList'
53
- import AStepItem from '@vue2-client/components/tool/AStepItem'
54
- import { TicketDetailsViewApi, post } from '@vue2-client/services/api'
55
- import { formatDate } from '@vue2-client/utils/util'
56
-
57
- const AStepItemGroup = AStepItem.Group
58
- const DetailListItem = DetailList.Item
59
-
60
- export default {
61
- name: 'submitTicketSuccess',
62
- components: { AStepItemGroup, AStepItem, DetailListItem, DetailList, Result },
63
- data () {
64
- return {
65
- title: '提交成功',
66
- description: '您创建的工单已成功提交,请保持电话畅通,我们的工作人员将尽快与您取得联系。' +
67
- '如果需要加急,请在倒计时结束后点击加急按钮,加急后我们将优先处理您的工单',
68
- // 工单序列号
69
- serialNumber: '',
70
- // 工单详情
71
- details: {
72
- uploader: '',
73
- status: '',
74
- name: '',
75
- priority: undefined,
76
- createdTime: '',
77
- confirmTime: '',
78
- finishedTime: ''
79
- },
80
- // 控制加急按钮
81
- urgentAccess: true,
82
- // 倒计时
83
- countDown: 0,
84
- // 控制加急按钮显示
85
- UrgentAvailable: true,
86
- // 刷新页面的定时器
87
- time: undefined,
88
- timer: undefined,
89
- // 取消工单确认框可见性
90
- closeVisible: false,
91
- // 控制页面大图标
92
- icon: true
93
- }
94
- },
95
- mounted () {
96
- this.serialNumber = this.$route.query.serialNumber
97
- this.getTicketDetail()
98
- this.refresh()
99
- this.countDown = 0
100
- },
101
- beforeDestroy () {
102
- this.stopTimer()
103
- this.stopTimer2()
104
- },
105
- methods: {
106
- format (date, format) {
107
- return formatDate(date, format)
108
- },
109
- // 关闭工单确认后操作
110
- handleCloseOk () {
111
- return post(TicketDetailsViewApi.manualCloseTicketByCustomer, {
112
- serialNumber: this.serialNumber,
113
- time: new Date()
114
- })
115
- .then(res => {
116
- this.closeVisible = false
117
- this.title = '工单已关闭'
118
- this.description = ''
119
- this.icon = false
120
- this.stopTimer()
121
- }, err => {
122
- console.error(err)
123
- })
124
- },
125
- // 关闭工单取消后业务逻辑
126
- handleCloseCancel () {
127
- this.closeVisible = false
128
- },
129
- // 关闭工单按钮
130
- closeBtn () {
131
- this.closeVisible = true
132
- },
133
- // 过10s刷新一下页面数据
134
- refresh () {
135
- if (this.timer === undefined) {
136
- this.timer = setInterval(() => {
137
- this.getTicketDetail()
138
- }, 10 * 1000)
139
- }
140
- },
141
- // 对工单进行加急处理
142
- urgent () {
143
- return post(TicketDetailsViewApi.rushTicket, {
144
- serialNumber: this.serialNumber
145
- })
146
- .then(res => {
147
- if (res === 1) {
148
- this.$message.success(
149
- '操作成功',
150
- 5
151
- )
152
- this.description = '您的工单已经被加急处理,我们的工作人员会优先处理您的请求。'
153
- this.UrgentAvailable = false
154
- } else {
155
- this.$message.error(
156
- '操作失败',
157
- 5
158
- )
159
- }
160
- }, err => {
161
- console.log(err)
162
- })
163
- },
164
- // 格式化倒计时
165
- countDownFormat () {
166
- const hours = '00'
167
- let mins = Math.floor(this.countDown / 60)
168
- let secs = this.countDown % 60
169
- if (mins < 10) {
170
- mins = '0' + mins
171
- }
172
- if (secs < 10) {
173
- secs = '0' + secs
174
- }
175
- return hours + ':' + mins + ':' + secs
176
- },
177
- // 设置用于控制加急按钮倒计时定时器,加急按钮5分钟后才可点击
178
- setTimer () {
179
- this.countDown = 5
180
- if (this.time === undefined) {
181
- this.time = setInterval(() => {
182
- this.countDown--
183
- if (this.countDown <= 0) {
184
- this.urgentAccess = false
185
- this.stopTimer2()
186
- this.countDown = -1
187
- }
188
- }, 1000)
189
- }
190
- },
191
- // 获取工单详情
192
- getTicketDetail () {
193
- return post(TicketDetailsViewApi.getTicketDetailsForUploader, {
194
- serialNumber: this.serialNumber
195
- })
196
- .then(res => {
197
- this.details.uploader = res.uploader
198
- // 判断负责人有没有值
199
- if (res.name === undefined) {
200
- this.details.name = ''
201
- } else {
202
- this.details.name = res.name
203
- }
204
- // 判断工单被确认时间
205
- if (res.confirmtime === undefined) {
206
- this.details.confirmTime = ''
207
- } else {
208
- this.details.confirmTime = this.format(res.confirmtime, 'yyyy-MM-dd hh:mm:ss')
209
- }
210
- // 判断工单完成时间
211
- if (res.finishedtime === undefined) {
212
- this.details.finishedTime = ''
213
- } else {
214
- this.details.finishedTime = this.format(res.finishedtime, 'yyyy-MM-dd hh:mm:ss')
215
- }
216
- this.details.createdTime = this.format(res.createdtime, 'yyyy-MM-dd hh:mm:ss')
217
- this.details.status = res.status
218
- this.details.priority = res.priority
219
-
220
- // 如果当前状态为一般,设置定时器,五分钟后允许加急
221
- if (this.details.priority > 1 && this.countDown === 0) {
222
- this.setTimer()
223
- }
224
- }, err => {
225
- console.log(err)
226
- })
227
- },
228
- // 停止定时器
229
- stopTimer () {
230
- if (this.timer) {
231
- clearInterval(this.timer)
232
- this.timer = undefined
233
- }
234
- },
235
- // 停止定时器2
236
- stopTimer2 () {
237
- if (this.time) {
238
- clearInterval(this.time)
239
- this.time = undefined
240
- }
241
- }
242
- },
243
- computed: {
244
- // 用于进度条,进度显示控制
245
- step () {
246
- if (this.details.status !== 0 && this.details.status !== 1) {
247
- return 2
248
- } else {
249
- return this.details.status
250
- }
251
- }
252
- }
253
- }
254
- </script>
255
-
256
- <style scoped lang="less">
257
- .result-success{
258
- .action:not(:first-child){
259
- margin-left: 8px;
260
- }
261
- .project-name{
262
- font-size: 16px;
263
- color: @title-color;
264
- font-weight: 500;
265
- margin-bottom: 20px;
266
- }
267
- }
268
- </style>
1
+ <template>
2
+ <a-card class="result-success" :bordered="false">
3
+ <result :is-success="icon" :description="description" :title="title">
4
+ <template slot="action">
5
+ <span style="margin-right: 10px" v-if="countDown > 0">{{ countDownFormat() }}</span>
6
+ <a-button type="primary" v-if="UrgentAvailable" :disabled="urgentAccess" style="margin-right: 20px" @click="urgent">请求加急处理</a-button>
7
+ <a-button type="danger" @click="closeBtn" >撤销工单</a-button>
8
+ </template>
9
+ <a-modal
10
+ title="关闭工单"
11
+ :visible="closeVisible"
12
+ @ok="handleCloseOk"
13
+ @cancel="handleCloseCancel"
14
+ :zIndex="1002"
15
+ >
16
+ <p>是否确认手动关闭工单?</p>
17
+ <p style="color: red">(该操作不可撤销,请谨慎操作!)</p>
18
+ </a-modal>
19
+ <div>
20
+ <div class="project-name">工单处理进度</div>
21
+ <detail-list size="small" style="max-width: 800px; margin-bottom: 8px">
22
+ <detail-list-item term="工单编号">{{ serialNumber }}</detail-list-item>
23
+ <detail-list-item term="负责人">{{ details.name }}</detail-list-item>
24
+ <detail-list-item term="提交时间">2016-12-12</detail-list-item>
25
+ </detail-list>
26
+ <a-steps :current="step" progressDot>
27
+ <a-step title="工单提交">
28
+ <a-step-item-group slot="description">
29
+ <a-step-item :title="details.uploader" />
30
+ <a-step-item :title="details.createdTime"/>
31
+ </a-step-item-group>
32
+ </a-step>
33
+ <a-step title="工单处理中" >
34
+ <a-step-item-group slot="description">
35
+ <a-step-item :title="details.name" v-if="step >= 1" />
36
+ <a-step-item :title="details.confirmTime" v-if="step >= 1"/>
37
+ </a-step-item-group>
38
+ </a-step>
39
+ <a-step title="工单完成" >
40
+ <a-step-item-group slot="description">
41
+ <a-step-item :title="details.finishedTime" v-if="step >= 2"/>
42
+ </a-step-item-group>
43
+ </a-step>
44
+ </a-steps>
45
+ </div>
46
+ </result>
47
+ </a-card>
48
+ </template>
49
+
50
+ <script>
51
+ import Result from '@vue2-client/components/result/Result'
52
+ import DetailList from '@vue2-client/components/tool/DetailList'
53
+ import AStepItem from '@vue2-client/components/tool/AStepItem'
54
+ import { TicketDetailsViewApi, post } from '@vue2-client/services/api'
55
+ import { formatDate } from '@vue2-client/utils/util'
56
+
57
+ const AStepItemGroup = AStepItem.Group
58
+ const DetailListItem = DetailList.Item
59
+
60
+ export default {
61
+ name: 'submitTicketSuccess',
62
+ components: { AStepItemGroup, AStepItem, DetailListItem, DetailList, Result },
63
+ data () {
64
+ return {
65
+ title: '提交成功',
66
+ description: '您创建的工单已成功提交,请保持电话畅通,我们的工作人员将尽快与您取得联系。' +
67
+ '如果需要加急,请在倒计时结束后点击加急按钮,加急后我们将优先处理您的工单',
68
+ // 工单序列号
69
+ serialNumber: '',
70
+ // 工单详情
71
+ details: {
72
+ uploader: '',
73
+ status: '',
74
+ name: '',
75
+ priority: undefined,
76
+ createdTime: '',
77
+ confirmTime: '',
78
+ finishedTime: ''
79
+ },
80
+ // 控制加急按钮
81
+ urgentAccess: true,
82
+ // 倒计时
83
+ countDown: 0,
84
+ // 控制加急按钮显示
85
+ UrgentAvailable: true,
86
+ // 刷新页面的定时器
87
+ time: undefined,
88
+ timer: undefined,
89
+ // 取消工单确认框可见性
90
+ closeVisible: false,
91
+ // 控制页面大图标
92
+ icon: true
93
+ }
94
+ },
95
+ mounted () {
96
+ this.serialNumber = this.$route.query.serialNumber
97
+ this.getTicketDetail()
98
+ this.refresh()
99
+ this.countDown = 0
100
+ },
101
+ beforeDestroy () {
102
+ this.stopTimer()
103
+ this.stopTimer2()
104
+ },
105
+ methods: {
106
+ format (date, format) {
107
+ return formatDate(date, format)
108
+ },
109
+ // 关闭工单确认后操作
110
+ handleCloseOk () {
111
+ return post(TicketDetailsViewApi.manualCloseTicketByCustomer, {
112
+ serialNumber: this.serialNumber,
113
+ time: new Date()
114
+ })
115
+ .then(res => {
116
+ this.closeVisible = false
117
+ this.title = '工单已关闭'
118
+ this.description = ''
119
+ this.icon = false
120
+ this.stopTimer()
121
+ }, err => {
122
+ console.error(err)
123
+ })
124
+ },
125
+ // 关闭工单取消后业务逻辑
126
+ handleCloseCancel () {
127
+ this.closeVisible = false
128
+ },
129
+ // 关闭工单按钮
130
+ closeBtn () {
131
+ this.closeVisible = true
132
+ },
133
+ // 过10s刷新一下页面数据
134
+ refresh () {
135
+ if (this.timer === undefined) {
136
+ this.timer = setInterval(() => {
137
+ this.getTicketDetail()
138
+ }, 10 * 1000)
139
+ }
140
+ },
141
+ // 对工单进行加急处理
142
+ urgent () {
143
+ return post(TicketDetailsViewApi.rushTicket, {
144
+ serialNumber: this.serialNumber
145
+ })
146
+ .then(res => {
147
+ if (res === 1) {
148
+ this.$message.success(
149
+ '操作成功',
150
+ 5
151
+ )
152
+ this.description = '您的工单已经被加急处理,我们的工作人员会优先处理您的请求。'
153
+ this.UrgentAvailable = false
154
+ } else {
155
+ this.$message.error(
156
+ '操作失败',
157
+ 5
158
+ )
159
+ }
160
+ }, err => {
161
+ console.log(err)
162
+ })
163
+ },
164
+ // 格式化倒计时
165
+ countDownFormat () {
166
+ const hours = '00'
167
+ let mins = Math.floor(this.countDown / 60)
168
+ let secs = this.countDown % 60
169
+ if (mins < 10) {
170
+ mins = '0' + mins
171
+ }
172
+ if (secs < 10) {
173
+ secs = '0' + secs
174
+ }
175
+ return hours + ':' + mins + ':' + secs
176
+ },
177
+ // 设置用于控制加急按钮倒计时定时器,加急按钮5分钟后才可点击
178
+ setTimer () {
179
+ this.countDown = 5
180
+ if (this.time === undefined) {
181
+ this.time = setInterval(() => {
182
+ this.countDown--
183
+ if (this.countDown <= 0) {
184
+ this.urgentAccess = false
185
+ this.stopTimer2()
186
+ this.countDown = -1
187
+ }
188
+ }, 1000)
189
+ }
190
+ },
191
+ // 获取工单详情
192
+ getTicketDetail () {
193
+ return post(TicketDetailsViewApi.getTicketDetailsForUploader, {
194
+ serialNumber: this.serialNumber
195
+ })
196
+ .then(res => {
197
+ this.details.uploader = res.uploader
198
+ // 判断负责人有没有值
199
+ if (res.name === undefined) {
200
+ this.details.name = ''
201
+ } else {
202
+ this.details.name = res.name
203
+ }
204
+ // 判断工单被确认时间
205
+ if (res.confirmtime === undefined) {
206
+ this.details.confirmTime = ''
207
+ } else {
208
+ this.details.confirmTime = this.format(res.confirmtime, 'yyyy-MM-dd hh:mm:ss')
209
+ }
210
+ // 判断工单完成时间
211
+ if (res.finishedtime === undefined) {
212
+ this.details.finishedTime = ''
213
+ } else {
214
+ this.details.finishedTime = this.format(res.finishedtime, 'yyyy-MM-dd hh:mm:ss')
215
+ }
216
+ this.details.createdTime = this.format(res.createdtime, 'yyyy-MM-dd hh:mm:ss')
217
+ this.details.status = res.status
218
+ this.details.priority = res.priority
219
+
220
+ // 如果当前状态为一般,设置定时器,五分钟后允许加急
221
+ if (this.details.priority > 1 && this.countDown === 0) {
222
+ this.setTimer()
223
+ }
224
+ }, err => {
225
+ console.log(err)
226
+ })
227
+ },
228
+ // 停止定时器
229
+ stopTimer () {
230
+ if (this.timer) {
231
+ clearInterval(this.timer)
232
+ this.timer = undefined
233
+ }
234
+ },
235
+ // 停止定时器2
236
+ stopTimer2 () {
237
+ if (this.time) {
238
+ clearInterval(this.time)
239
+ this.time = undefined
240
+ }
241
+ }
242
+ },
243
+ computed: {
244
+ // 用于进度条,进度显示控制
245
+ step () {
246
+ if (this.details.status !== 0 && this.details.status !== 1) {
247
+ return 2
248
+ } else {
249
+ return this.details.status
250
+ }
251
+ }
252
+ }
253
+ }
254
+ </script>
255
+
256
+ <style scoped lang="less">
257
+ .result-success{
258
+ .action:not(:first-child){
259
+ margin-left: 8px;
260
+ }
261
+ .project-name{
262
+ font-size: 16px;
263
+ color: @title-color;
264
+ font-weight: 500;
265
+ margin-bottom: 20px;
266
+ }
267
+ }
268
+ </style>
@@ -1,26 +1,26 @@
1
- import routerMap from './router.map'
2
- import { parseRoutes } from '@vue2-client/utils/routerUtil'
3
-
4
- // 异步路由配置
5
- const routesConfig = [
6
- 'login',
7
- 'submitTicket',
8
- 'root',
9
- {
10
- router: 'exp404',
11
- path: '*',
12
- name: '404'
13
- },
14
- {
15
- router: 'exp403',
16
- path: '/403',
17
- name: '403'
18
- }
19
- ]
20
-
21
- const options = {
22
- mode: 'history',
23
- routes: parseRoutes(routesConfig, routerMap)
24
- }
25
-
26
- export default options
1
+ import routerMap from './router.map'
2
+ import { parseRoutes } from '@vue2-client/utils/routerUtil'
3
+
4
+ // 异步路由配置
5
+ const routesConfig = [
6
+ 'login',
7
+ 'submitTicket',
8
+ 'root',
9
+ {
10
+ router: 'exp404',
11
+ path: '*',
12
+ name: '404'
13
+ },
14
+ {
15
+ router: 'exp403',
16
+ path: '/403',
17
+ name: '403'
18
+ }
19
+ ]
20
+
21
+ const options = {
22
+ mode: 'history',
23
+ routes: parseRoutes(routesConfig, routerMap)
24
+ }
25
+
26
+ export default options
@@ -1,27 +1,27 @@
1
- import { formatRoutes } from '@vue2-client/utils/routerUtil'
2
-
3
- // 不需要登录拦截的路由配置
4
- const loginIgnore = {
5
- names: ['404', '403'], // 根据路由名称匹配
6
- paths: ['/login', '/submitTicket'], // 根据路由fullPath匹配
7
- /**
8
- * 判断路由是否包含在该配置中
9
- * @param route vue-router 的 route 对象
10
- * @returns {boolean}
11
- */
12
- includes (route) {
13
- return this.names.includes(route.name) || this.paths.includes(route.path)
14
- }
15
- }
16
-
17
- /**
18
- * 初始化路由实例
19
- * @param isAsync 是否异步路由模式
20
- * @returns {RouterOptions}
21
- */
22
- function initRouter (isAsync) {
23
- const options = require('./async/config.async').default
24
- formatRoutes(options.routes)
25
- return options
26
- }
27
- export { loginIgnore, initRouter }
1
+ import { formatRoutes } from '@vue2-client/utils/routerUtil'
2
+
3
+ // 不需要登录拦截的路由配置
4
+ const loginIgnore = {
5
+ names: ['404', '403'], // 根据路由名称匹配
6
+ paths: ['/login', '/submitTicket'], // 根据路由fullPath匹配
7
+ /**
8
+ * 判断路由是否包含在该配置中
9
+ * @param route vue-router 的 route 对象
10
+ * @returns {boolean}
11
+ */
12
+ includes (route) {
13
+ return this.names.includes(route.name) || this.paths.includes(route.path)
14
+ }
15
+ }
16
+
17
+ /**
18
+ * 初始化路由实例
19
+ * @param isAsync 是否异步路由模式
20
+ * @returns {RouterOptions}
21
+ */
22
+ function initRouter (isAsync) {
23
+ const options = require('./async/config.async').default
24
+ formatRoutes(options.routes)
25
+ return options
26
+ }
27
+ export { loginIgnore, initRouter }