vue2-client 1.0.0 → 1.2.1

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 (134) hide show
  1. package/.eslintrc.js +81 -81
  2. package/README.md +65 -55
  3. package/babel.config.js +15 -14
  4. package/docs/index.md +29 -29
  5. package/docs/notice.md +24 -0
  6. package/index.js +28 -0
  7. package/jest.config.js +3 -3
  8. package/package.json +1 -1
  9. package/public/index.html +27 -27
  10. package/src/App.vue +2 -2
  11. package/src/base-client/all.js +57 -57
  12. package/src/base-client/components/common/CreateQuery/CreateQuery.vue +1159 -1159
  13. package/src/base-client/components/common/CreateQuery/index.md +1 -1
  14. package/src/base-client/components/common/CreateSimpleFormQuery/CreateSimpleFormQuery.vue +540 -540
  15. package/src/base-client/components/common/CreateSimpleFormQuery/index.md +1 -1
  16. package/src/base-client/components/common/CustomColumnsDrawer/index.md +1 -1
  17. package/src/base-client/components/common/FormGroupEdit/FormGroupEdit.vue +150 -150
  18. package/src/base-client/components/common/FormGroupEdit/index.md +1 -1
  19. package/src/base-client/components/common/FormGroupQuery/index.md +1 -1
  20. package/src/base-client/components/common/XAddForm/XAddForm.vue +323 -323
  21. package/src/base-client/components/common/XAddForm/index.md +1 -1
  22. package/src/base-client/components/common/XBadge/index.md +1 -1
  23. package/src/base-client/components/common/XCard/index.md +1 -1
  24. package/src/base-client/components/common/XForm/XForm.vue +275 -275
  25. package/src/base-client/components/common/XForm/XFormItem.vue +217 -217
  26. package/src/base-client/components/common/XForm/index.md +196 -196
  27. package/src/base-client/components/common/XFormCol/index.md +1 -1
  28. package/src/base-client/components/common/XFormTable/XFormTable.vue +405 -405
  29. package/src/base-client/components/common/XFormTable/index.md +2 -2
  30. package/src/base-client/components/common/XTable/XTable.vue +262 -262
  31. package/src/base-client/components/common/XTable/index.md +255 -255
  32. package/src/base-client/components/common/XTreeOne/XTreeOne.vue +1 -1
  33. package/src/base-client/components/iot/CustomerDetailsView/CustomerDetailsView.vue +226 -226
  34. package/src/base-client/components/iot/CustomerDetailsView/index.md +2 -2
  35. package/src/base-client/components/iot/DataAnalysisUser/DataAnalysisUser.vue +1 -1
  36. package/src/base-client/components/iot/DataAnalysisViewGD/DataAnalysisViewGD.vue +548 -548
  37. package/src/base-client/components/iot/DeviceBrandDetailsView/DeviceBrandDetailsView.vue +453 -453
  38. package/src/base-client/components/iot/DeviceDetailsView/DeviceDetailsView.vue +231 -231
  39. package/src/base-client/components/iot/DeviceDetailsView/index.md +1 -1
  40. package/src/base-client/components/iot/DeviceDetailsView/part/DeviceDetailsCount.vue +330 -330
  41. package/src/base-client/components/iot/DeviceDetailsView/part/DeviceDetailsException.vue +1 -1
  42. package/src/base-client/components/iot/DeviceDetailsView/part/DeviceDetailsInstruct.vue +3 -3
  43. package/src/base-client/components/iot/DeviceDetailsView/part/DeviceDetailsInstructOperate.vue +122 -122
  44. package/src/base-client/components/iot/DeviceDetailsView/part/DeviceDetailsMain.vue +1 -1
  45. package/src/base-client/components/iot/DeviceDetailsView/part/DeviceDetailsRead.vue +3 -3
  46. package/src/base-client/components/iot/DeviceTypeDetailsView/DeviceTypeDetailsView.vue +277 -277
  47. package/src/base-client/components/iot/InstructDetailsView/InstructDetailsView.vue +472 -472
  48. package/src/base-client/components/iot/InstructDetailsView/index.md +1 -1
  49. package/src/base-client/components/iot/LogDetailsView/LogDetailsView.vue +380 -380
  50. package/src/base-client/components/iot/LogDetailsView/index.md +1 -1
  51. package/src/base-client/components/iot/MeterDetailsView/MeterDetailsView.vue +360 -360
  52. package/src/base-client/components/iot/MeterDetailsView/index.md +1 -1
  53. package/src/base-client/components/iot/MeterDetailsView/part/MeterDetailsCount.vue +335 -335
  54. package/src/base-client/components/iot/MeterDetailsView/part/MeterDetailsException.vue +185 -185
  55. package/src/base-client/components/iot/MeterDetailsView/part/MeterDetailsHandPlan.vue +292 -292
  56. package/src/base-client/components/iot/MeterDetailsView/part/MeterDetailsInstruct.vue +237 -237
  57. package/src/base-client/components/iot/MeterDetailsView/part/MeterDetailsMain.vue +257 -257
  58. package/src/base-client/components/iot/MeterDetailsView/part/MeterDetailsSellGas.vue +190 -190
  59. package/src/base-client/components/iot/WebmeterAnalysisView/WebmeterAnalysisView.vue +723 -723
  60. package/src/base-client/components/iot/WebmeterAnalysisView/index.md +1 -1
  61. package/src/base-client/components/system/DictionaryDetailsView/DictionaryDetailsView.vue +232 -232
  62. package/src/base-client/components/system/DictionaryDetailsView/index.md +1 -1
  63. package/src/base-client/components/system/QueryParamsDetailsView/QueryParamsDetailsView.vue +248 -248
  64. package/src/base-client/components/ticket/EmployeeDetailsView/EmployeeDetailsView.vue +406 -406
  65. package/src/base-client/components/ticket/TicketDetailsView/TicketDetailsView.vue +486 -486
  66. package/src/base-client/components/ticket/TicketDetailsView/part/TicketDetailsFlow.vue +184 -184
  67. package/src/base-client/components/ticket/TicketSubmitSuccessView/TicketSubmitSuccessView.vue +303 -303
  68. package/src/base-client/plugins/AppData.js +69 -69
  69. package/src/base-client/plugins/GetLoginInfoService.js +221 -222
  70. package/src/base-client/plugins/index.js +21 -21
  71. package/src/bootstrap.js +6 -4
  72. package/src/components/Ellipsis/Ellipsis.vue +1 -1
  73. package/src/components/Ellipsis/index.md +2 -2
  74. package/src/components/NumberInfo/index.md +1 -1
  75. package/src/components/STable/README.md +3 -3
  76. package/src/components/Trend/index.md +1 -1
  77. package/src/components/cache/AKeepAlive.js +1 -1
  78. package/src/components/checkbox/index.js +2 -2
  79. package/src/components/index.js +15 -15
  80. package/src/components/menu/menu.js +1 -1
  81. package/src/components/setting/Setting.vue +4 -4
  82. package/src/components/table/advance/AdvanceTable.vue +3 -3
  83. package/src/components/transition/PageToggleTransition.vue +1 -1
  84. package/src/config/default/setting.config.js +33 -33
  85. package/src/layouts/CommonLayout.vue +1 -1
  86. package/src/layouts/ComponentLayoutOne.vue +47 -47
  87. package/src/layouts/PageLayout.vue +2 -2
  88. package/src/layouts/SinglePageView.vue +1 -1
  89. package/src/layouts/header/AdminHeader.vue +2 -2
  90. package/src/layouts/header/HeaderAvatar.vue +1 -1
  91. package/src/layouts/header/HeaderNotice.vue +97 -97
  92. package/src/layouts/tabs/TabsHead.vue +1 -1
  93. package/src/layouts/tabs/TabsView.vue +6 -6
  94. package/src/main.js +20 -12
  95. package/src/mock/common/reportData.js +20 -20
  96. package/src/mock/goods/index.js +2 -2
  97. package/src/mock/index.js +6 -6
  98. package/src/mock/project/index.js +1 -1
  99. package/src/mock/user/current.js +1 -1
  100. package/src/mock/user/login.js +1 -1
  101. package/src/mock/user/routes.js +61 -61
  102. package/src/mock/workplace/index.js +1 -1
  103. package/src/pages/exception/403.vue +25 -25
  104. package/src/pages/exception/404.vue +25 -25
  105. package/src/pages/exception/500.vue +25 -25
  106. package/src/pages/login/Login.vue +194 -194
  107. package/src/pages/report/ReportTable.js +125 -125
  108. package/src/pages/report/ReportTableHome.vue +28 -28
  109. package/src/pages/resourceManage/resourceManageMain.vue +55 -55
  110. package/src/pages/system/applyInstallView/Core.vue +1 -1
  111. package/src/pages/system/applyInstallView/index.vue +1 -1
  112. package/src/pages/system/dictionary/index.vue +1 -1
  113. package/src/pages/system/queryParams/index.vue +1 -1
  114. package/src/router/async/config.async.js +1 -1
  115. package/src/router/async/router.map.js +59 -59
  116. package/src/router/guards.js +3 -3
  117. package/src/router/index.js +4 -8
  118. package/src/services/api/common.js +39 -39
  119. package/src/services/api/restTools.js +23 -23
  120. package/src/services/dataSource.js +1 -1
  121. package/src/services/user.js +2 -2
  122. package/src/store/index.js +3 -6
  123. package/src/store/modules/setting.js +5 -5
  124. package/src/theme/index.less +5 -5
  125. package/src/theme/reportTable.less +58 -58
  126. package/src/utils/i18n.js +2 -2
  127. package/src/utils/indexedDB.js +146 -146
  128. package/src/utils/request.js +3 -3
  129. package/src/utils/routerUtil.js +18 -5
  130. package/tests/unit/ReportTable.spec.js +15 -15
  131. package/vue.config.js +153 -152
  132. package/webpack.config.js +12 -0
  133. package/src/index.js +0 -29
  134. package/src/router/config.js +0 -23
@@ -1,303 +1,303 @@
1
- <template>
2
- <a-drawer
3
- title="工单进度查询"
4
- placement="right"
5
- :width="isMobile ? screenWidth : screenWidth * 0.85"
6
- :visible="visible"
7
- @close="onClose"
8
- >
9
- <a-card class="result-success" :bordered="false">
10
- <result :is-success="icon" :description="description" :title="title" :title-class="titleClass">
11
- <template slot="action">
12
- <span style="margin-right: 10px" v-if="countDown > 0">{{ countDownFormat() }}</span>
13
- <a-tooltip placement="topLeft" :title="tip" arrow-point-at-center>
14
- <a-button type="primary" v-if="UrgentAvailable" :disabled="urgentAccess" style="margin-right: 20px" @click="urgent">请求加急处理</a-button>
15
- </a-tooltip>
16
- <a-button type="danger" @click="closeBtn" >撤销工单</a-button>
17
- </template>
18
- <a-modal
19
- title="关闭工单"
20
- :visible="closeVisible"
21
- @ok="handleCloseOk"
22
- @cancel="handleCloseCancel"
23
- :zIndex="1002"
24
- >
25
- <p>是否确认手动关闭工单?</p>
26
- <p style="color: red">(该操作不可撤销,请谨慎操作!)</p>
27
- </a-modal>
28
- <div>
29
- <div class="project-name">工单处理进度</div>
30
- <detail-list size="small" style="max-width: 800px; margin-bottom: 8px">
31
- <detail-list-item term="工单编号">{{ serialNumber }}</detail-list-item>
32
- <detail-list-item term="提交时间">{{ format(details.createdTime, 'yyyy-MM-dd') }}</detail-list-item>
33
- </detail-list>
34
- <a-steps :current="step" progressDot>
35
- <a-step title="工单提交">
36
- <a-step-item-group slot="description">
37
- <a-step-item :title="details.uploader" />
38
- <a-step-item :title="details.createdTime"/>
39
- </a-step-item-group>
40
- </a-step>
41
- <a-step title="工单处理中" >
42
- <a-step-item-group slot="description">
43
- <a-step-item :title="details.name" v-if="step >= 1" />
44
- <a-step-item :title="details.confirmTime" v-if="step >= 1"/>
45
- </a-step-item-group>
46
- </a-step>
47
- <a-step title="工单完成" >
48
- <a-step-item-group slot="description">
49
- <a-step-item :title="details.finishedTime" v-if="step >= 2"/>
50
- </a-step-item-group>
51
- </a-step>
52
- </a-steps>
53
- </div>
54
- </result>
55
- </a-card>
56
- </a-drawer>
57
- </template>
58
-
59
- <script>
60
- import Result from '@/components/result/Result'
61
- import DetailList from '@/components/tool/DetailList'
62
- import AStepItem from '@/components/tool/AStepItem'
63
- import { TicketDetailsViewApi } from '@/services/api/TicketDetailsViewApi'
64
- import { post } from '@/services/api/restTools'
65
- import { mapState } from 'vuex'
66
- import { formatDate } from '@/utils/util'
67
-
68
- const AStepItemGroup = AStepItem.Group
69
- const DetailListItem = DetailList.Item
70
- export default {
71
- name: 'submitTicketSuccess',
72
- components: { AStepItemGroup, AStepItem, DetailListItem, DetailList, Result },
73
- data () {
74
- return {
75
- // 页面宽度
76
- screenWidth: document.documentElement.clientWidth,
77
- title: '提交成功',
78
- description: '您创建的工单已成功提交,请保持电话畅通,我们的工作人员将尽快与您取得联系',
79
- // 加急按钮气泡文字
80
- tip: '如果需要加急,请在5分钟倒计时结束后点击加急按钮,加急后我们将优先处理您的工单',
81
- // 控制标题样式
82
- titleClass: 'title',
83
- // 工单详情
84
- details: {
85
- uploader: '',
86
- status: '',
87
- name: '',
88
- priority: undefined,
89
- createdTime: '',
90
- confirmTime: '',
91
- finishedTime: ''
92
- },
93
- // 控制加急按钮
94
- urgentAccess: true,
95
- // 倒计时
96
- countDown: 0,
97
- // 控制加急按钮显示
98
- UrgentAvailable: true,
99
- // 刷新页面的定时器
100
- timer: undefined,
101
- // 取消工单确认框可见性
102
- closeVisible: false,
103
- // 控制页面大图标
104
- icon: true,
105
- // 控制加急后定时器
106
- showTelephoneCountDown: 0
107
- }
108
- },
109
- props: {
110
- serialNumber: {
111
- type: String,
112
- required: true
113
- },
114
- visible: {
115
- type: Boolean,
116
- default: false
117
- }
118
- },
119
- mounted () {
120
- this.getTicketDetail()
121
- this.refresh()
122
- this.countDown = 0
123
- },
124
- methods: {
125
- // 关闭抽屉时回调
126
- onClose () {
127
- this.urgentAccess = true
128
- clearInterval(this.timer)
129
- this.$emit('update:visible', false)
130
- this.titleClass = 'title'
131
- this.description = '您创建的工单已成功提交,请保持电话畅通,我们的工作人员将尽快与您取得联系'
132
- this.title = '提交成功'
133
- this.UrgentAvailable = true
134
- },
135
- format (date, format) {
136
- return formatDate(date, format)
137
- },
138
- // 关闭工单确认后操作
139
- handleCloseOk () {
140
- return post(TicketDetailsViewApi.manualCloseTicketByCustomer, {
141
- serialNumber: this.serialNumber,
142
- time: new Date()
143
- })
144
- .then(res => {
145
- this.closeVisible = false
146
- this.title = '工单已关闭'
147
- this.description = ''
148
- this.icon = false
149
- clearInterval(this.timer)
150
- }, err => {
151
- console.error(err)
152
- })
153
- },
154
- // 关闭工单取消后业务逻辑
155
- handleCloseCancel () {
156
- this.closeVisible = false
157
- },
158
- // 关闭工单按钮
159
- closeBtn () {
160
- this.closeVisible = true
161
- },
162
- // 过10s刷新一下页面数据
163
- refresh () {
164
- this.timer = setInterval(() => {
165
- this.getTicketDetail()
166
- }, 10 * 1000)
167
- },
168
- // 对工单进行加急处理
169
- urgent () {
170
- return post(TicketDetailsViewApi.rushTicket, {
171
- serialNumber: this.serialNumber
172
- })
173
- .then(res => {
174
- if (res === 1) {
175
- this.$message.success(
176
- '操作成功',
177
- 5
178
- )
179
- this.title = '加急成功'
180
- this.titleClass = 'title_danger'
181
- this.description = '您的工单已经被加急处理,我们的工作人员会马上与您取得联系'
182
- this.UrgentAvailable = false
183
- this.showPhoneNumberTimer()
184
- } else {
185
- this.$message.error(
186
- '操作失败',
187
- 5
188
- )
189
- }
190
- }, err => {
191
- console.log(err)
192
- })
193
- },
194
- // 格式化倒计时
195
- countDownFormat () {
196
- const hours = '00'
197
- let mins = Math.floor(this.countDown / 60)
198
- let secs = this.countDown % 60
199
- if (mins < 10) {
200
- mins = '0' + mins
201
- }
202
- if (secs < 10) {
203
- secs = '0' + secs
204
- }
205
- return hours + ':' + mins + ':' + secs
206
- },
207
- // 设置用于控制加急按钮倒计时定时器,加急按钮5分钟后才可点击
208
- setTimer () {
209
- this.countDown = 5
210
- const time = setInterval(() => {
211
- this.countDown--
212
- if (this.countDown <= 0) {
213
- this.urgentAccess = false
214
- clearInterval(time)
215
- this.countDown = -1
216
- }
217
- }, 1000)
218
- },
219
- // 设定关于加急后的定时器,5分钟后仍没人联系,显示联系电话
220
- showPhoneNumberTimer () {
221
- this.showTelephoneCountDown = 5
222
- const time = setInterval(() => {
223
- this.showTelephoneCountDown--
224
- if (this.showTelephoneCountDown <= 0) {
225
- this.description = '很抱歉让您久等,029-88888888 您可以直接拨打此电话,与我们技术人员直接交谈!'
226
- clearInterval(time)
227
- this.showTelephoneCountDown = -1
228
- }
229
- }, 1000)
230
- },
231
- // 获取工单详情
232
- getTicketDetail () {
233
- return post(TicketDetailsViewApi.getTicketDetailsForUploader, {
234
- serialNumber: this.serialNumber
235
- })
236
- .then(res => {
237
- this.details.uploader = res.uploader
238
- // 判断负责人有没有值
239
- if (res.name === undefined) {
240
- this.details.name = ''
241
- } else {
242
- this.details.name = res.name
243
- }
244
- // 判断工单被确认时间
245
- if (res.confirmtime === undefined) {
246
- this.details.confirmTime = ''
247
- } else {
248
- this.details.confirmTime = this.format(res.confirmtime, 'yyyy-MM-dd hh:mm:ss')
249
- }
250
- // 判断工单完成时间
251
- if (res.finishedtime === undefined) {
252
- this.details.finishedTime = ''
253
- } else {
254
- this.details.finishedTime = this.format(res.finishedtime, 'yyyy-MM-dd hh:mm:ss')
255
- }
256
- this.details.createdTime = this.format(res.createdtime, 'yyyy-MM-dd hh:mm:ss')
257
- this.details.status = res.status
258
- this.details.priority = res.priority
259
-
260
- // 如果当前状态为一般,设置定时器,五分钟后允许加急
261
- if (this.details.priority > 1 && this.countDown === 0) {
262
- this.setTimer()
263
- }
264
- }, err => {
265
- console.log(err)
266
- })
267
- }
268
- },
269
- computed: {
270
- ...mapState('account', { currUser: 'user' }),
271
- ...mapState('setting', ['isMobile']),
272
- // 用于进度条,进度显示控制
273
- step () {
274
- if (this.details.status !== 0 && this.details.status !== 1) {
275
- return 2
276
- } else {
277
- return this.details.status
278
- }
279
- }
280
- },
281
- watch: {
282
- 'serialNumber' () {
283
- this.getTicketDetail()
284
- this.refresh()
285
- this.countDown = 0
286
- }
287
- }
288
- }
289
- </script>
290
-
291
- <style scoped lang="less">
292
- .result-success{
293
- .action:not(:first-child){
294
- margin-left: 8px;
295
- }
296
- .project-name{
297
- font-size: 16px;
298
- color: @title-color;
299
- font-weight: 500;
300
- margin-bottom: 20px;
301
- }
302
- }
303
- </style>
1
+ <template>
2
+ <a-drawer
3
+ title="工单进度查询"
4
+ placement="right"
5
+ :width="isMobile ? screenWidth : screenWidth * 0.85"
6
+ :visible="visible"
7
+ @close="onClose"
8
+ >
9
+ <a-card class="result-success" :bordered="false">
10
+ <result :is-success="icon" :description="description" :title="title" :title-class="titleClass">
11
+ <template slot="action">
12
+ <span style="margin-right: 10px" v-if="countDown > 0">{{ countDownFormat() }}</span>
13
+ <a-tooltip placement="topLeft" :title="tip" arrow-point-at-center>
14
+ <a-button type="primary" v-if="UrgentAvailable" :disabled="urgentAccess" style="margin-right: 20px" @click="urgent">请求加急处理</a-button>
15
+ </a-tooltip>
16
+ <a-button type="danger" @click="closeBtn" >撤销工单</a-button>
17
+ </template>
18
+ <a-modal
19
+ title="关闭工单"
20
+ :visible="closeVisible"
21
+ @ok="handleCloseOk"
22
+ @cancel="handleCloseCancel"
23
+ :zIndex="1002"
24
+ >
25
+ <p>是否确认手动关闭工单?</p>
26
+ <p style="color: red">(该操作不可撤销,请谨慎操作!)</p>
27
+ </a-modal>
28
+ <div>
29
+ <div class="project-name">工单处理进度</div>
30
+ <detail-list size="small" style="max-width: 800px; margin-bottom: 8px">
31
+ <detail-list-item term="工单编号">{{ serialNumber }}</detail-list-item>
32
+ <detail-list-item term="提交时间">{{ format(details.createdTime, 'yyyy-MM-dd') }}</detail-list-item>
33
+ </detail-list>
34
+ <a-steps :current="step" progressDot>
35
+ <a-step title="工单提交">
36
+ <a-step-item-group slot="description">
37
+ <a-step-item :title="details.uploader" />
38
+ <a-step-item :title="details.createdTime"/>
39
+ </a-step-item-group>
40
+ </a-step>
41
+ <a-step title="工单处理中" >
42
+ <a-step-item-group slot="description">
43
+ <a-step-item :title="details.name" v-if="step >= 1" />
44
+ <a-step-item :title="details.confirmTime" v-if="step >= 1"/>
45
+ </a-step-item-group>
46
+ </a-step>
47
+ <a-step title="工单完成" >
48
+ <a-step-item-group slot="description">
49
+ <a-step-item :title="details.finishedTime" v-if="step >= 2"/>
50
+ </a-step-item-group>
51
+ </a-step>
52
+ </a-steps>
53
+ </div>
54
+ </result>
55
+ </a-card>
56
+ </a-drawer>
57
+ </template>
58
+
59
+ <script>
60
+ import Result from '@vue2-client/components/result/Result'
61
+ import DetailList from '@vue2-client/components/tool/DetailList'
62
+ import AStepItem from '@vue2-client/components/tool/AStepItem'
63
+ import { TicketDetailsViewApi } from '@vue2-client/services/api/TicketDetailsViewApi'
64
+ import { post } from '@vue2-client/services/api/restTools'
65
+ import { mapState } from 'vuex'
66
+ import { formatDate } from '@vue2-client/utils/util'
67
+
68
+ const AStepItemGroup = AStepItem.Group
69
+ const DetailListItem = DetailList.Item
70
+ export default {
71
+ name: 'submitTicketSuccess',
72
+ components: { AStepItemGroup, AStepItem, DetailListItem, DetailList, Result },
73
+ data () {
74
+ return {
75
+ // 页面宽度
76
+ screenWidth: document.documentElement.clientWidth,
77
+ title: '提交成功',
78
+ description: '您创建的工单已成功提交,请保持电话畅通,我们的工作人员将尽快与您取得联系',
79
+ // 加急按钮气泡文字
80
+ tip: '如果需要加急,请在5分钟倒计时结束后点击加急按钮,加急后我们将优先处理您的工单',
81
+ // 控制标题样式
82
+ titleClass: 'title',
83
+ // 工单详情
84
+ details: {
85
+ uploader: '',
86
+ status: '',
87
+ name: '',
88
+ priority: undefined,
89
+ createdTime: '',
90
+ confirmTime: '',
91
+ finishedTime: ''
92
+ },
93
+ // 控制加急按钮
94
+ urgentAccess: true,
95
+ // 倒计时
96
+ countDown: 0,
97
+ // 控制加急按钮显示
98
+ UrgentAvailable: true,
99
+ // 刷新页面的定时器
100
+ timer: undefined,
101
+ // 取消工单确认框可见性
102
+ closeVisible: false,
103
+ // 控制页面大图标
104
+ icon: true,
105
+ // 控制加急后定时器
106
+ showTelephoneCountDown: 0
107
+ }
108
+ },
109
+ props: {
110
+ serialNumber: {
111
+ type: String,
112
+ required: true
113
+ },
114
+ visible: {
115
+ type: Boolean,
116
+ default: false
117
+ }
118
+ },
119
+ mounted () {
120
+ this.getTicketDetail()
121
+ this.refresh()
122
+ this.countDown = 0
123
+ },
124
+ methods: {
125
+ // 关闭抽屉时回调
126
+ onClose () {
127
+ this.urgentAccess = true
128
+ clearInterval(this.timer)
129
+ this.$emit('update:visible', false)
130
+ this.titleClass = 'title'
131
+ this.description = '您创建的工单已成功提交,请保持电话畅通,我们的工作人员将尽快与您取得联系'
132
+ this.title = '提交成功'
133
+ this.UrgentAvailable = true
134
+ },
135
+ format (date, format) {
136
+ return formatDate(date, format)
137
+ },
138
+ // 关闭工单确认后操作
139
+ handleCloseOk () {
140
+ return post(TicketDetailsViewApi.manualCloseTicketByCustomer, {
141
+ serialNumber: this.serialNumber,
142
+ time: new Date()
143
+ })
144
+ .then(res => {
145
+ this.closeVisible = false
146
+ this.title = '工单已关闭'
147
+ this.description = ''
148
+ this.icon = false
149
+ clearInterval(this.timer)
150
+ }, err => {
151
+ console.error(err)
152
+ })
153
+ },
154
+ // 关闭工单取消后业务逻辑
155
+ handleCloseCancel () {
156
+ this.closeVisible = false
157
+ },
158
+ // 关闭工单按钮
159
+ closeBtn () {
160
+ this.closeVisible = true
161
+ },
162
+ // 过10s刷新一下页面数据
163
+ refresh () {
164
+ this.timer = setInterval(() => {
165
+ this.getTicketDetail()
166
+ }, 10 * 1000)
167
+ },
168
+ // 对工单进行加急处理
169
+ urgent () {
170
+ return post(TicketDetailsViewApi.rushTicket, {
171
+ serialNumber: this.serialNumber
172
+ })
173
+ .then(res => {
174
+ if (res === 1) {
175
+ this.$message.success(
176
+ '操作成功',
177
+ 5
178
+ )
179
+ this.title = '加急成功'
180
+ this.titleClass = 'title_danger'
181
+ this.description = '您的工单已经被加急处理,我们的工作人员会马上与您取得联系'
182
+ this.UrgentAvailable = false
183
+ this.showPhoneNumberTimer()
184
+ } else {
185
+ this.$message.error(
186
+ '操作失败',
187
+ 5
188
+ )
189
+ }
190
+ }, err => {
191
+ console.log(err)
192
+ })
193
+ },
194
+ // 格式化倒计时
195
+ countDownFormat () {
196
+ const hours = '00'
197
+ let mins = Math.floor(this.countDown / 60)
198
+ let secs = this.countDown % 60
199
+ if (mins < 10) {
200
+ mins = '0' + mins
201
+ }
202
+ if (secs < 10) {
203
+ secs = '0' + secs
204
+ }
205
+ return hours + ':' + mins + ':' + secs
206
+ },
207
+ // 设置用于控制加急按钮倒计时定时器,加急按钮5分钟后才可点击
208
+ setTimer () {
209
+ this.countDown = 5
210
+ const time = setInterval(() => {
211
+ this.countDown--
212
+ if (this.countDown <= 0) {
213
+ this.urgentAccess = false
214
+ clearInterval(time)
215
+ this.countDown = -1
216
+ }
217
+ }, 1000)
218
+ },
219
+ // 设定关于加急后的定时器,5分钟后仍没人联系,显示联系电话
220
+ showPhoneNumberTimer () {
221
+ this.showTelephoneCountDown = 5
222
+ const time = setInterval(() => {
223
+ this.showTelephoneCountDown--
224
+ if (this.showTelephoneCountDown <= 0) {
225
+ this.description = '很抱歉让您久等,029-88888888 您可以直接拨打此电话,与我们技术人员直接交谈!'
226
+ clearInterval(time)
227
+ this.showTelephoneCountDown = -1
228
+ }
229
+ }, 1000)
230
+ },
231
+ // 获取工单详情
232
+ getTicketDetail () {
233
+ return post(TicketDetailsViewApi.getTicketDetailsForUploader, {
234
+ serialNumber: this.serialNumber
235
+ })
236
+ .then(res => {
237
+ this.details.uploader = res.uploader
238
+ // 判断负责人有没有值
239
+ if (res.name === undefined) {
240
+ this.details.name = ''
241
+ } else {
242
+ this.details.name = res.name
243
+ }
244
+ // 判断工单被确认时间
245
+ if (res.confirmtime === undefined) {
246
+ this.details.confirmTime = ''
247
+ } else {
248
+ this.details.confirmTime = this.format(res.confirmtime, 'yyyy-MM-dd hh:mm:ss')
249
+ }
250
+ // 判断工单完成时间
251
+ if (res.finishedtime === undefined) {
252
+ this.details.finishedTime = ''
253
+ } else {
254
+ this.details.finishedTime = this.format(res.finishedtime, 'yyyy-MM-dd hh:mm:ss')
255
+ }
256
+ this.details.createdTime = this.format(res.createdtime, 'yyyy-MM-dd hh:mm:ss')
257
+ this.details.status = res.status
258
+ this.details.priority = res.priority
259
+
260
+ // 如果当前状态为一般,设置定时器,五分钟后允许加急
261
+ if (this.details.priority > 1 && this.countDown === 0) {
262
+ this.setTimer()
263
+ }
264
+ }, err => {
265
+ console.log(err)
266
+ })
267
+ }
268
+ },
269
+ computed: {
270
+ ...mapState('account', { currUser: 'user' }),
271
+ ...mapState('setting', ['isMobile']),
272
+ // 用于进度条,进度显示控制
273
+ step () {
274
+ if (this.details.status !== 0 && this.details.status !== 1) {
275
+ return 2
276
+ } else {
277
+ return this.details.status
278
+ }
279
+ }
280
+ },
281
+ watch: {
282
+ 'serialNumber' () {
283
+ this.getTicketDetail()
284
+ this.refresh()
285
+ this.countDown = 0
286
+ }
287
+ }
288
+ }
289
+ </script>
290
+
291
+ <style scoped lang="less">
292
+ .result-success{
293
+ .action:not(:first-child){
294
+ margin-left: 8px;
295
+ }
296
+ .project-name{
297
+ font-size: 16px;
298
+ color: @title-color;
299
+ font-weight: 500;
300
+ margin-bottom: 20px;
301
+ }
302
+ }
303
+ </style>