askbot-dragon 1.0.12 → 1.0.13

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 (77) hide show
  1. package/README.md +27 -27
  2. package/babel.config.js +6 -6
  3. package/dragon.iml +7 -7
  4. package/package.json +56 -56
  5. package/public/index.html +43 -43
  6. package/src/App.vue +31 -31
  7. package/src/api/index.js +1 -1
  8. package/src/api/mock.http +2 -2
  9. package/src/api/requestUrl.js +185 -185
  10. package/src/assets/js/AliyunlssUtil.js +92 -92
  11. package/src/assets/js/Base64Util.js +22 -22
  12. package/src/assets/js/script.js +36 -36
  13. package/src/assets/less/common.css +6773 -6773
  14. package/src/assets/less/converSationContainer/common.less +191 -191
  15. package/src/assets/less/converSationContainer/converSatonContainer.less +493 -493
  16. package/src/assets/less/iconfont.css +37 -37
  17. package/src/assets/less/ticketMessage.less +211 -211
  18. package/src/components/ActionAlertIframe.vue +112 -112
  19. package/src/components/AiGuide.vue +467 -467
  20. package/src/components/AskIFrame.vue +15 -15
  21. package/src/components/ConversationContainer.vue +4617 -4617
  22. package/src/components/FileType.vue +86 -86
  23. package/src/components/Message.vue +27 -27
  24. package/src/components/actionSatisfaction.vue +107 -107
  25. package/src/components/actionSendToBot.vue +62 -62
  26. package/src/components/answerDissatisfaction.vue +62 -62
  27. package/src/components/answerRadio.vue +76 -76
  28. package/src/components/ask-components/DissatisfactionOptions.vue +57 -57
  29. package/src/components/ask-components/Msgloading.vue +37 -37
  30. package/src/components/ask-components/SatisfactionV2.vue +15 -15
  31. package/src/components/askVideo.vue +138 -138
  32. package/src/components/assetDetails.vue +370 -370
  33. package/src/components/assetMessage.vue +228 -228
  34. package/src/components/associationIntention.vue +243 -241
  35. package/src/components/botActionSatisfactor.vue +68 -68
  36. package/src/components/chatContent.vue +513 -513
  37. package/src/components/feedBack.vue +136 -136
  38. package/src/components/fielListView.vue +346 -346
  39. package/src/components/file/AliyunOssComponents.vue +108 -108
  40. package/src/components/formTemplate.vue +3344 -3342
  41. package/src/components/loadingProcess.vue +164 -164
  42. package/src/components/message/ActionAlertIframe.vue +112 -112
  43. package/src/components/message/ShopMessage.vue +164 -164
  44. package/src/components/message/TextMessage.vue +924 -924
  45. package/src/components/message/TicketMessage.vue +177 -177
  46. package/src/components/message/swiper/index.js +4 -4
  47. package/src/components/message/swiper/ticketSwiper.vue +503 -503
  48. package/src/components/message/swiper/ticketSwiperItem.vue +61 -61
  49. package/src/components/msgLoading.vue +231 -231
  50. package/src/components/myPopup.vue +70 -70
  51. package/src/components/popup.vue +227 -227
  52. package/src/components/receiverMessagePlatform.vue +65 -65
  53. package/src/components/recommend.vue +89 -89
  54. package/src/components/selector/hOption.vue +20 -20
  55. package/src/components/selector/hSelector.vue +199 -199
  56. package/src/components/selector/hWrapper.vue +216 -216
  57. package/src/components/senderMessagePlatform.vue +50 -50
  58. package/src/components/source/BotMessage.vue +24 -24
  59. package/src/components/source/CustomMessage.vue +24 -24
  60. package/src/components/test.vue +260 -260
  61. package/src/components/tree.vue +247 -247
  62. package/src/components/utils/AliyunIssUtil.js +72 -72
  63. package/src/components/utils/ckeditor.js +155 -153
  64. package/src/components/utils/ckeditorImageUpload/command.js +109 -109
  65. package/src/components/utils/ckeditorImageUpload/editing.js +11 -11
  66. package/src/components/utils/ckeditorImageUpload/plugin-image.js +11 -11
  67. package/src/components/utils/ckeditorImageUpload/toolbar-ui.js +40 -40
  68. package/src/components/utils/ckeditorfileUpload/common.js +111 -111
  69. package/src/components/utils/ckeditorfileUpload/editing.js +11 -11
  70. package/src/components/utils/ckeditorfileUpload/plugin_file.js +11 -11
  71. package/src/components/utils/ckeditorfileUpload/toolbar_ui.js +34 -34
  72. package/src/components/utils/format_date.js +25 -25
  73. package/src/components/utils/index.js +6 -6
  74. package/src/components/utils/math_utils.js +29 -29
  75. package/src/components/voiceComponent.vue +119 -119
  76. package/src/main.js +60 -60
  77. package/vue.config.js +47 -47
@@ -1,924 +1,924 @@
1
- <!-- 消息记录容器 -->
2
- <template>
3
- <div class="media-body">
4
- <div class="textMessage" id="textMessage" :class="{remPhoneClass:isPhone,remCompanyClass:isCompany}">
5
- <div style="display: flex;height: auto;line-height: 2;" @mousemove="clickClick" class="htmlClass">
6
- <div v-html="text.template" id="html" :class="{notClickClass:disableds === true}">
7
- {{text.template}}
8
- </div>
9
- </div>
10
- <div id="submit">
11
- <el-button plain size="small" @click="submitClick" :disabled="disableds" >{{submitValue}}</el-button>
12
- </div>
13
- <div v-if="isCompany">
14
- <div v-if="single === true" class="editMessage">
15
- <el-input v-model="input" placeholder="请输入内容" class="inputClass" @input="testClick" @blur="inputBlur"></el-input>
16
- <!-- <span @click="quedingClick" style="display: flex;align-items: center"><i class="el-icon-success" style="color: #4C61E1;font-size: 32px;cursor: pointer"></i></span>
17
- --> </div>
18
- <div v-if="date" class="editMessage">
19
- <el-date-picker
20
- v-model="dateValue"
21
- type="date"
22
- placeholder="选择日期"
23
- style="width: 100%;margin: 10px 0 10px 0"
24
- :clearable=false
25
- @change="dataclick"
26
-
27
- >
28
- </el-date-picker>
29
- <!-- <span @click="quedingClick" style="display: flex;align-items: center"><i class="el-icon-success" style="color: #4C61E1;font-size: 32px;cursor: pointer"></i></span>
30
- --> </div>
31
- <div v-if="time" class="editMessage">
32
- <el-time-picker
33
- v-model="timeValue"
34
- placeholder="任意时间点"
35
- style="margin: 10px 0 10px 0;width: 100%"
36
- :clearable=false
37
- @change="dataclick"
38
- >
39
- </el-time-picker>
40
- <!-- <span @click="quedingClick" style="display: flex;align-items: center"><i class="el-icon-success" style="color: #4C61E1;font-size: 32px;cursor: pointer"></i></span>
41
- --> </div>
42
- <div v-if="dateTime" class="editMessage">
43
- <el-date-picker
44
- v-model="dateTimeValue"
45
- type="datetime"
46
- placeholder="选择日期时间"
47
- style="width: 100%;margin: 10px 0 10px 0"
48
- @change="dataclick"
49
- >
50
- </el-date-picker>
51
- <!-- <span @click="quedingClick(bianliangId)" style="display:flex;align-items:center;"><i class="el-icon-success" style="color: #4C61E1;font-size: 32px;cursor: pointer"></i></span>
52
- --> </div>
53
- <!--<div v-if="dateRange" style="border-top: 1px dashed #ebebeb;">
54
- <el-date-picker
55
- v-model="dateRangeValue"
56
- type="daterange"
57
- range-separator="至"
58
- start-placeholder="开始日期"
59
- end-placeholder="结束日期"
60
- style="margin: 10px 16px;width: 80%"
61
- >
62
- </el-date-picker>
63
- <span @click="quedingClick(bianliangId)" ><i class="el-icon-success" style="color: #409eff;font-size: 32px;text-align: center;vertical-align: middle;cursor: pointer"></i></span>
64
- </div>
65
- <div v-if="timeRange" style="border-top: 1px dashed #ebebeb;">
66
- <el-time-picker
67
- is-range
68
- v-model="timeRangeValue"
69
- range-separator="至"
70
- start-placeholder="开始时间"
71
- end-placeholder="结束时间"
72
- placeholder="选择时间范围"
73
- style="margin: 10px 16px;width: 80%"
74
- >
75
- </el-time-picker>
76
- <span @click="quedingClick(bianliangId)" ><i class="el-icon-success" style="color: #409eff;font-size: 32px;text-align: center;vertical-align: middle;cursor: pointer"></i></span>
77
-
78
- </div>
79
- <div v-if="dateTimeRange" style="border-top: 1px dashed #ebebeb;">
80
- <el-date-picker
81
- v-model="dateTimeValue"
82
- type="datetimerange"
83
- range-separator="至"
84
- start-placeholder="开始日期"
85
- end-placeholder="结束日期"
86
- style="width: 80%;margin: 10px 16px"
87
-
88
- >
89
- </el-date-picker>
90
- <span @click="quedingClick(bianliangId)" ><i class="el-icon-success" style="color: #409eff;font-size: 32px;text-align: center;vertical-align: middle;cursor: pointer"></i></span>
91
- </div>-->
92
- </div>
93
- <div v-if="isPhone">
94
- <div v-if="single" class="editMessage">
95
- <el-input v-model="input" placeholder="请输入内容" class="inputClass" @input="testClick" @blur="inputBlur"></el-input>
96
- <!-- <span @click="quedingClick" style="display: flex;align-items: center"><i class="el-icon-success" style="color: #4C61E1;font-size: 32px;cursor: pointer"></i></span>
97
- --> </div>
98
- <div v-if="date">
99
- <van-calendar v-model="show" @confirm="onConfirm" :default-date="defaultDate"/>
100
- <!-- <el-date-picker
101
- v-model="dateValue"
102
- type="date"
103
- placeholder="选择日期"
104
- style="width: 80%;margin: 10px 10px 10px 0"
105
- :editable=false
106
- >
107
- </el-date-picker>
108
- <span @click="quedingClick" style="display: flex;align-items: center"><i class="el-icon-success" style="color: #4C61E1;font-size: 32px;cursor: pointer"></i></span>
109
- --></div>
110
-
111
- <div v-if="time">
112
- <van-popup v-model="showTimePicker" position="bottom">
113
- <van-datetime-picker
114
- v-model="timeValue"
115
- type="datetime"
116
- title="选择时间"
117
- :min-date="minDate"
118
- :formatter="formatter"
119
- @cancel="showTimePicker = false"
120
- @confirm="onConfirmTime"
121
- />
122
- </van-popup>
123
- <!-- <el-time-picker
124
- v-model="timeValue"
125
- placeholder="任意时间点"
126
- style="margin: 10px 10px 10px 0;width: 80%"
127
- :editable=false
128
- >
129
- </el-time-picker>
130
- <span @click="quedingClick" style="display: flex;align-items: center"><i class="el-icon-success" style="color: #4C61E1;font-size: 32px;cursor: pointer"></i></span>
131
- --> </div>
132
- <div v-if="dateTime">
133
- <van-popup v-model="showDateTimePicker" position="bottom">
134
- <van-datetime-picker
135
- v-model="dateTimeValue"
136
- type="datetime"
137
- title="选择日期时间"
138
- :min-date="minDate"
139
- :formatter="formatter"
140
- @cancel="showDateTimePicker = false"
141
- @confirm="onConfirmDateTime"
142
- />
143
- </van-popup>
144
- <!-- <el-date-picker
145
- v-model="dateTimeValue"
146
- type="datetime"
147
- placeholder="选择日期时间"
148
- style="width: 80%;margin: 10px 10px 10px 0"
149
- :editable=false
150
-
151
- >
152
- </el-date-picker>
153
- <span @click="quedingClick(bianliangId)" style="display: flex;align-items: center"><i class="el-icon-success" style="color: #4C61E1;font-size: 32px;cursor: pointer"></i></span>
154
- --></div>
155
- <!-- <div v-if="dateRange" style="border-top: 1px dashed #ebebeb;display: flex">
156
- &lt;!&ndash;<el-date-picker
157
- v-model="dateRangeValue"
158
- type="daterange"
159
- range-separator="至"
160
- start-placeholder="开始日期"
161
- end-placeholder="结束日期"
162
- style="margin: 10px 16px;width: 80%"
163
- :editable=false
164
-
165
- >
166
- </el-date-picker>&ndash;&gt;
167
- <div style="width: 90%">
168
- <van-cell title="选择日期区间" :value="dateRangeValue" @click="show = true" />
169
- <van-calendar v-model="show" type="range" @confirm="onConfirm" />
170
- </div>
171
- <span @click="quedingClick(bianliangId)" ><i class="el-icon-success" style="color: #409eff;font-size: 32px;text-align: center;vertical-align: middle;cursor: pointer"></i></span>
172
-
173
-
174
-
175
- </div>
176
- <div v-if="timeRange" style="border-top: 1px dashed #ebebeb;">
177
- <el-time-picker
178
- is-range
179
- v-model="timeRangeValue"
180
- range-separator="至"
181
- start-placeholder="开始时间"
182
- end-placeholder="结束时间"
183
- placeholder="选择时间范围"
184
- style="margin: 10px 16px;width: 80%"
185
-
186
- :editable=false
187
- >
188
- </el-time-picker>
189
- <span @click="quedingClick(bianliangId)" ><i class="el-icon-success" style="color: #409eff;font-size: 32px;text-align: center;vertical-align: middle;cursor: pointer"></i></span>
190
-
191
- </div>
192
- <div v-if="dateTimeRange" style="border-top: 1px dashed #ebebeb;display: flex">
193
- &lt;!&ndash; <el-date-picker
194
- v-model="dateTimeValue"
195
- type="datetimerange"
196
- range-separator="至"
197
- start-placeholder="开始日期"
198
- end-placeholder="结束日期"
199
- style="width: 80%;margin: 10px 16px"
200
- :editable=false
201
-
202
-
203
- >
204
- </el-date-picker>&ndash;&gt;
205
- <div style="width: 90%">
206
- <van-field
207
- readonly
208
- clickable
209
- name="datetimePicker"
210
- :value=dateTimeValue[0]
211
- label='选择时间'
212
- placeholder="点击选择开始日期时间"
213
- @click="showDateTimePicker=true"
214
- />
215
- <van-popup v-model="showDateTimePicker" position="bottom">
216
- <van-datetime-picker
217
- v-model="currentDate"
218
- type="datetime"
219
- title="选择开始日期时间"
220
- @confirm="onConfirmDateTime($event)"
221
- @cancel="showDateTimePicker = false"
222
- :min-date="minDate"
223
- :formatter="formatter"
224
- />
225
- </van-popup>
226
- <van-field
227
- readonly
228
- clickable
229
- name="datetimePicker"
230
- :value=dateTimeValue1[0]
231
- label=" "
232
- placeholder="点击选择结束日期时间"
233
- @click="showDateTimePicker1=true"
234
- />
235
- <van-popup v-model="showDateTimePicker1" position="bottom">
236
- <van-datetime-picker
237
- v-model="currentDate"
238
- type="datetime"
239
- title="选择结束日期时间"
240
- @confirm="onConfirmDateTime1($event)"
241
- @cancel="showDateTimePicker1 = false"
242
- :min-date="minDate"
243
- :formatter="formatter"
244
- />
245
- </van-popup>
246
- </div>
247
-
248
- <span @click="quedingClick(bianliangId)" ><i class="el-icon-success" style="color: #409eff;font-size: 32px;text-align: center;vertical-align: middle;cursor: pointer"></i></span>
249
- </div>-->
250
- </div>
251
- </div>
252
- </div>
253
- </template>
254
-
255
- <script>
256
- /*import $ from 'jquery'*/
257
- export default {
258
- name: 'TextMessage',
259
- data(){
260
- return{
261
- show:false,
262
- single:false,
263
- date:false,
264
- time:false,
265
- dateTime:false,
266
- dateRange:false,
267
- timeRange:false,
268
- input:'',
269
- bianliangId:'',
270
- dateValue:'',
271
- message:[{content:'王亚欣',type:'SINGLE',value:'',id:1},{content:['2020-11-18T07:25:16.000+0000','2020-11-21T07:25:16.000+0000'],type:'DATE-RANGE',value:'',id:2},{content:'2020-11-18T07:25:16.000+0000',type:'TIME',value:'',id:3},{content:'2020-11-18T07:25:16.000+0000',type:'DATE',value:'',id:4},{content:['2020-11-18T07:25:16.000+0000','2020-11-21T07:25:16.000+0000'],type:'DATERANGE',value:'',id:5},{content:['2020-11-18T08:25:16.000+0000','2020-11-21T07:25:16.000+0000'],type:'TIMERANGE',value:'',id:6},],
272
- isPhone:false,
273
- isCompany:false,
274
- dateTimeValue:'',
275
- timeValue:'',
276
- dateRangeValue:'',
277
- dateRangeValues:'',
278
- timeRangeValue:[],
279
- dateTimeValue1:[],
280
- test:0,
281
- currentDate:new Date(),
282
- minDate: new Date(2020, 0, 1),
283
- showDateTimePicker1:false,
284
- showDateTimePicker:false,
285
- values:[],
286
- checkValue:'',
287
- disableds:false,
288
- submitValue:'确认',
289
- dateInnerText:'',
290
- defaultDate:'',
291
- showTimePicker:false,
292
-
293
- }
294
- },
295
- props:{
296
- text:{
297
- type:Object,
298
- default(){
299
- return {}
300
- }
301
- },
302
- type:String,
303
- disable:Boolean,
304
- submit:Boolean
305
- },
306
- mounted() {
307
- this.isMobile()
308
- let span=this.$el
309
- let defaults=span.getElementsByClassName('ask-component-placeholder-span')
310
- for (let i=0;i<defaults.length;i++)
311
- {
312
- this.values.push({})
313
- this.values[i]['key']=defaults[i].getAttribute('data')
314
- this.values[i]['value']=defaults[i].innerText
315
- this.values[i]['type']=defaults[i].getAttribute('type')
316
- }
317
- let text=this.$el
318
- let test=text.getElementsByClassName('ask-component-placeholder-span')
319
- let cpntain=text.getElementsByClassName('ask-component-placeholder-container')
320
- let icon=text.getElementsByClassName('arsenalkebianji')
321
- for (let i=0;i<icon.length;i++)
322
- {
323
- icon[i].style.color='#366aff'
324
- }
325
- for (let i=0;i<cpntain.length;i++)
326
- {
327
- if(this.type)
328
- {
329
- cpntain[i].style.paddingRight=0.2+'rem'
330
- cpntain[i].style.paddingLeft=0.2+'rem'
331
- }
332
- else
333
- {
334
- cpntain[i].style.paddingRight=4+'px'
335
- cpntain[i].style.paddingLeft=4+'px'
336
- }
337
-
338
- }
339
- for (let i=0;i<test.length;i++)
340
- {
341
- if(test[i].getAttribute('type')==='DATE_PICKER')
342
- {
343
- let date=Number(test[i].innerText)*1000
344
- test[i].innerText=new Date(date).Format("MM-dd")
345
- }
346
- if(test[i].getAttribute('type')==='TIME_PICKER')
347
- {
348
- let time=Number(test[i].innerText)*1000
349
- test[i].innerText=new Date(time).Format("hh:mm")
350
- }
351
- if(test[i].getAttribute('type') === 'DATE_TIME_PICKER'){
352
- let time=Number(test[i].innerText)*1000
353
- test[i].innerText=new Date(time).Format("yyyy-MM-dd hh:mm")
354
- }
355
- }
356
- },
357
- beforeMount() {
358
- if(this.disable===true)
359
- {
360
- this.disableds=true
361
-
362
- }
363
- else
364
- {
365
- this.disableds=false
366
-
367
- }
368
- if(this.submit===true)
369
- {
370
- this.submitValue='已确认'
371
- }
372
- else
373
- {
374
- this.submitValue='确认'
375
- }
376
- },
377
- methods:{
378
- dataclick(){
379
- if(this.checkValue.getAttribute('type') === 'DATE_PICKER')
380
- {
381
- for (let i=0;i<this.values.length;i++)
382
- {
383
- if(this.values[i].key === this.checkValue.getAttribute('data'))
384
- {
385
- if(this.dateValue!=='')
386
- {
387
- this.checkValue.innerText=new Date(this.dateValue).Format('MM-dd')
388
- this.values[i].value=new Date(this.dateValue).getTime()
389
- }
390
- else
391
- {
392
- this.values[i].value=this.checkValue.innerText
393
- }
394
- }
395
- }
396
- }
397
- if(this.checkValue.getAttribute('type') === 'TIME_PICKER')
398
- {
399
- for (let i=0;i<this.values.length;i++)
400
- {
401
- if(this.values[i].key === this.checkValue.getAttribute('data') )
402
- {
403
- if(this.timeValue!=='')
404
- {
405
-
406
- this.checkValue.innerText=new Date(this.timeValue).Format('hh:mm')
407
- this.values[i].value=new Date(this.timeValue).getTime()
408
- }
409
- else
410
- {
411
- this.values[i].value=this.checkValue.innerText
412
- }
413
- }
414
- }
415
- }
416
- if(this.checkValue.getAttribute('type') === 'DATE_TIME_PICKER')
417
- {
418
- for (let i=0;i<this.values.length;i++)
419
- {
420
- if(this.values[i].key === this.checkValue.getAttribute('data') )
421
- {
422
- if(this.dateTimeValue!=='')
423
- {
424
-
425
- this.checkValue.innerText=new Date(this.dateTimeValue).Format('yyyy-MM-dd hh:mm')
426
- this.values[i].value=new Date(this.dateTimeValue).getTime()
427
- }
428
- else
429
- {
430
- this.values[i].value=this.checkValue.innerText
431
- }
432
- }
433
- }
434
- }
435
- },
436
- clickClick(e){
437
- if(e.target.onclick!==null)
438
- {
439
- let that=this
440
- window._askEditValue=that._askEditValue;
441
- }
442
- },
443
- _askEditValue(a,b){
444
- let type=b.getAttribute('type')
445
- this.checkValue=b
446
- if(type === 'INPUT')
447
- {
448
- this.single=true
449
- this.date=false
450
- this.time=false
451
- this.dateTime=false
452
- this.input= b.innerText
453
- }
454
- if(type === 'DATE_PICKER')
455
- {
456
- this.single=false
457
- this.date=true
458
- this.time=false
459
- this.dateTime=false
460
- this.show=true
461
- for (let i=0;i<this.values.length;i++)
462
- {
463
- if(b.getAttribute('data') === this.values[i].key)
464
- {
465
- if(typeof this.values[i].value == 'string')
466
- {
467
- this.dateInnerText=Number(this.values[i].value)*1000
468
- }
469
- else
470
- {
471
- this.dateInnerText=Number(this.values[i].value)
472
- }
473
- this.dateValue=new Date(this.dateInnerText).Format("yyyy:MM-dd")
474
- this.defaultDate=new Date(this.dateInnerText)
475
- }
476
- return
477
- }
478
-
479
- }
480
- if(type === 'TIME_PICKER')
481
- {
482
- this.single=false
483
- this.date=false
484
- this.time=true
485
- this.dateTime=false
486
- this.showTimePicker=true
487
- for (let i=0;i<this.values.length;i++)
488
- {
489
- if(b.getAttribute('data') === this.values[i].key)
490
- {
491
- let time
492
- if(typeof this.values[i].value == 'string'){
493
- time=Number(this.values[i].value)*1000
494
- }
495
- else
496
- {
497
- time=Number(this.values[i].value)
498
- }
499
- if(this.isPhone ===true)
500
- {
501
- this.timeValue=new Date(time)
502
- }
503
- else
504
- {
505
- this.timeValue=new Date(time).Format("yyyy-MM-dd hh:mm")
506
- }
507
- }
508
- }
509
- }
510
- if(type === 'DATE_TIME_PICKER')
511
- {
512
- this.single=false
513
- this.date=false
514
- this.time=false
515
- this.dateTime=true
516
- this.showDateTimePicker=true
517
- for (let i=0;i<this.values.length;i++)
518
- {
519
- if(b.getAttribute('data') === this.values[i].key)
520
- {
521
- let time
522
- if(typeof this.values[i].value == 'string'){
523
- time=Number(this.values[i].value)*1000
524
- }
525
- else
526
- {
527
- time=Number(this.values[i].value)
528
- }
529
- if(this.isPhone===true)
530
- {
531
- this.dateTimeValue=new Date(time)
532
- }
533
- else
534
- {
535
- this.dateTimeValue=new Date(time).Format("yyyy-MM-dd hh:mm:ss")
536
- }
537
- }
538
- }
539
- }
540
-
541
- },
542
- formatter(type, value) {
543
- // 格式化选择器日期
544
- if (type === "year") {
545
- return `${value}年`;
546
- } else if (type === "month") {
547
- return `${value}月`;
548
- } else if (type === "day") {
549
- return `${value}日`;
550
- } else if (type === "hour") {
551
- return `${value}时`;
552
- } else if (type === "minute") {
553
- return `${value}分`;
554
- }
555
- return value;
556
- },
557
- //提交按钮
558
- submitClick(){
559
- this.single=false
560
- this.date=false
561
- this.time=false
562
- this.dateTime=false
563
- let infomation={}
564
- let obj = {}
565
- this.values.map(item => {
566
- obj[item.key] = item
567
- })
568
- let result = Object.values(obj)
569
- let text=this.$el
570
- let test=text.getElementsByClassName('ask-component-placeholder-span')
571
- for (let i=0;i<test.length;i++)
572
- {
573
- if(test[i].getAttribute('type')==='DATE_PICKER')
574
- {
575
- if(test[i].getAttribute('data')===result[i].key)
576
- {
577
- if(typeof result[i].value =='number'){
578
- result[i].value/=1000
579
- let resu=String(result[i].value)
580
- result[i].value=resu
581
- }
582
- }
583
- }
584
- if(test[i].getAttribute('type')==='TIME_PICKER')
585
- {
586
- if(test[i].getAttribute('data')===result[i].key)
587
- {
588
- if(typeof result[i].value =='number')
589
- {
590
- result[i].value/=1000
591
- let resu=String(result[i].value)
592
- result[i].value=resu
593
- }
594
- }
595
- }
596
- if(test[i].getAttribute('type')==='DATE_TIME_PICKER')
597
- {
598
- if(test[i].getAttribute('data')===result[i].key)
599
- {
600
- if(typeof result[i].value =='number')
601
- {
602
- result[i].value/=1000
603
- let resu=String(result[i].value)
604
- result[i].value=resu
605
- }
606
- }
607
- }
608
- }
609
- infomation['values']=result
610
- infomation['goToAction']=this.text.goToAction
611
- let innerhtml=this.$el
612
- infomation['template']=innerhtml.querySelector('#html').innerHTML
613
- infomation['apiKey']=this.text.apiKey
614
- this.$emit('submitClick',infomation,this.text.apiKey)
615
- this.submitValue='已确认'
616
- this.disableds=true
617
- },
618
- addZero(i){
619
- if (i<10) {
620
- i="0" + i;
621
- }
622
- return i;
623
- },
624
- formatDate(date) {
625
- if(typeof date == 'object')
626
- {
627
- const dateTime = new Date(date[0])
628
- const dateTime1=new Date(date[1])
629
- return `${dateTime.getMonth() + 1}月${dateTime.getDate()}日 ${this.addZero(dateTime.getHours())} : ${this.addZero(dateTime.getMinutes())} - ${dateTime1.getMonth() + 1}月${dateTime1.getDate()}日 ${this.addZero(dateTime1.getHours())} : ${this.addZero(dateTime1.getMinutes())}`;
630
- }
631
- else
632
- {
633
- const dateTime = new Date(date)
634
- return `${dateTime.getMonth() + 1}月${dateTime.getDate()}日`;
635
- }
636
-
637
- },
638
- //格式成时间
639
- formatDate1(date){
640
- const dateTime = new Date(date)
641
- return `${this.addZero(dateTime.getHours())}:${this.addZero(dateTime.getMinutes())}`;
642
- },
643
- //格式成日期
644
- formatDate2(date){
645
- const dateTime = new Date(date)
646
- return `${dateTime.getMonth() + 1} - ${dateTime.getDate()}`;
647
- },
648
- //日期范围
649
- formatDate3(date){
650
- const dateTime = new Date(date[0])
651
- const dateTime1=new Date(date[1])
652
- return `${dateTime.getMonth() + 1}月 ${dateTime.getDate()}日 - ${dateTime1.getMonth() + 1}月 ${dateTime1.getDate()}日`;
653
- },
654
- //时间范围
655
- formatDate4(date){
656
- const dateTime = new Date(date[0])
657
- const dateTime1=new Date(date[1])
658
- return `${dateTime.getHours()}: ${dateTime.getMinutes()} - ${dateTime1.getHours()}: ${dateTime1.getMinutes()}`;
659
- },
660
- testClick(value){
661
- if(this.checkValue.getAttribute('type') === 'INPUT')
662
- {
663
- for (let i=0;i<this.values.length;i++)
664
- {
665
- if(this.values[i].key === this.checkValue.getAttribute('data') )
666
- {
667
- this.checkValue.innerText=value
668
- this.values[i].value=this.checkValue.innerText
669
- }
670
- }
671
- }
672
- },
673
- inputBlur(){
674
- console.debug('inputBlur')
675
- this.single=false
676
- },
677
- quedingClick(){
678
- if(this.checkValue.getAttribute('type') === 'INPUT')
679
- {
680
- for (let i=0;i<this.values.length;i++)
681
- {
682
- if(this.values[i].key === this.checkValue.getAttribute('data') )
683
- {
684
- if(this.input!=='')
685
- {
686
- this.checkValue.innerText=this.input
687
- }
688
- this.values[i].value=this.checkValue.innerText
689
- }
690
- }
691
- this.single = false
692
- this.input=''
693
- }
694
- if(this.checkValue.getAttribute('type') === 'DATE_PICKER')
695
-
696
- {
697
- for (let i=0;i<this.values.length;i++)
698
- {
699
- if(this.values[i].key === this.checkValue.getAttribute('data'))
700
- {
701
- if(this.dateValue!=='')
702
- {
703
- this.checkValue.innerText=new Date(this.dateValue).Format('MM-dd')
704
- this.values[i].value=new Date(this.dateValue).getTime()
705
- }
706
- else
707
- {
708
- this.values[i].value=this.checkValue.innerText
709
- }
710
- }
711
- }
712
- this.date = false
713
- this.dateValue=''
714
- }
715
- if(this.checkValue.getAttribute('type') === 'TIME_PICKER')
716
- {
717
- for (let i=0;i<this.values.length;i++)
718
- {
719
- if(this.values[i].key === this.checkValue.getAttribute('data') )
720
- {
721
- if(this.timeValue!=='')
722
- {
723
-
724
- this.checkValue.innerText=new Date(this.timeValue).Format('hh:mm')
725
- this.values[i].value=new Date(this.timeValue).getTime()
726
- }
727
- else
728
- {
729
- this.values[i].value=this.checkValue.innerText
730
- }
731
- }
732
- }
733
- this.time = false
734
- this.timeValue=''
735
- }
736
- if(this.checkValue.getAttribute('type') === 'DATE_TIME_PICKER')
737
- {
738
- for (let i=0;i<this.values.length;i++)
739
- {
740
- if(this.values[i].key === this.checkValue.getAttribute('data') )
741
- {
742
- if(this.dateTimeValue!=='')
743
- {
744
-
745
- this.checkValue.innerText=new Date(this.dateTimeValue).Format('yyyy-MM-dd hh:mm')
746
- this.values[i].value=new Date(this.dateTimeValue).getTime()
747
- }
748
- else
749
- {
750
- this.values[i].value=this.checkValue.innerText
751
- }
752
- }
753
- }
754
- this.dateTime = false
755
- this.dateTimeValue=''
756
- }
757
-
758
- },
759
- isMobile() {
760
- let flag = navigator.userAgent.match(/(phone|pad|pod|iPhone|iPod|ios|iPad|Android|Mobile|BlackBerry|IEMobile|MQQBrowser|JUC|Fennec|wOSBrowser|BrowserNG|WebOS|Symbian|Windows Phone)/i);
761
- if (flag) {
762
- this.isPhone=true
763
- }
764
- else
765
- {
766
- this.isCompany=true
767
-
768
- }
769
- },
770
- onConfirmDateTime(){
771
- if(this.checkValue.getAttribute('type') === 'DATE_TIME_PICKER')
772
- {
773
- for (let i=0;i<this.values.length;i++)
774
- {
775
- if(this.values[i].key === this.checkValue.getAttribute('data') )
776
- {
777
- if(this.dateTimeValue!=='')
778
- {
779
-
780
- this.checkValue.innerText=new Date(this.dateTimeValue).Format('yyyy-MM-dd hh:mm')
781
- this.values[i].value=new Date(this.dateTimeValue).getTime()
782
- }
783
- else
784
- {
785
- this.values[i].value=this.checkValue.innerText
786
- }
787
- }
788
- }
789
- }
790
- this.showDateTimePicker = false;
791
- },
792
-
793
- onConfirm(date) {
794
- this.show = false;
795
- if(this.checkValue.getAttribute('type') === 'DATE_PICKER')
796
-
797
- {
798
- for (let i=0;i<this.values.length;i++)
799
- {
800
- if(this.values[i].key === this.checkValue.getAttribute('data'))
801
- {
802
- if(date!=='')
803
- {
804
- this.checkValue.innerText=new Date(date).Format('MM-dd')
805
- this.values[i].value=new Date(date).getTime()
806
- }
807
- else
808
- {
809
- this.values[i].value=this.checkValue.innerText
810
- }
811
- }
812
- }
813
- this.date = false
814
- this.dateValue=''
815
- }
816
-
817
- },
818
- onConfirmTime(){
819
- this.showTimePicker=false
820
- if(this.checkValue.getAttribute('type') === 'TIME_PICKER')
821
- {
822
- for (let i=0;i<this.values.length;i++)
823
- {
824
- if(this.values[i].key === this.checkValue.getAttribute('data') )
825
- {
826
- if(this.timeValue!=='')
827
- {
828
-
829
- this.checkValue.innerText=new Date(this.timeValue).Format('hh:mm')
830
- this.values[i].value=new Date(this.timeValue).getTime()
831
- }
832
- else
833
- {
834
- this.values[i].value=this.checkValue.innerText
835
- }
836
- }
837
- }
838
- }
839
- }
840
- }
841
- }
842
- </script>
843
-
844
-
845
- <style lang="less">
846
- @import "../../assets/less/common.css";
847
- #textMessage{
848
- min-width: 200px;
849
- .editMessage{
850
- display: flex;
851
- justify-content: space-between;
852
- margin-top: 10px;
853
- border-top: 1px dashed #ebebeb;
854
- }
855
- #submit{
856
- margin-top: 10px;
857
- display: flex;
858
- align-items: center;
859
- justify-content: center;
860
- .el-button{
861
- border: 1px solid #BBCDFF;
862
- border-radius: 14px;
863
- background-color: white;
864
- color: #366aff;
865
- font-weight: 400;
866
- }
867
- .el-button--small{
868
- padding: 9px 30px;
869
- font-size: 1em;
870
- }
871
- }
872
- #html{
873
- p{
874
- color:#A9B3C6;
875
- }
876
- .ask-component-placeholder-icon{
877
- padding-left: 12px;
878
- color: #366aff;
879
- font-size: 18px;
880
- }
881
- .ask-component-placeholder-span{
882
- color: #616161!important;
883
- }
884
- }
885
- }
886
- .remPhoneClass{
887
- margin: 0 auto;
888
- /*width: 80vw;*/
889
- .inputClass{
890
- margin-top: 8px;
891
- width: 100%;
892
- .el-input__inner{
893
- border-radius: 9px;
894
- }
895
- }
896
- .htmlClass{
897
- padding: 4px 0;
898
- }
899
-
900
- }
901
- .remCompanyClass{
902
-
903
- margin: 0 auto;
904
- /*width: 300px;*/
905
- .inputClass{
906
- padding: 10px 0 10px 0;
907
- width: 100%;
908
- .el-input__inner{
909
- border-radius: 9px;
910
- }
911
- }
912
-
913
-
914
- }
915
- .van-cell::after{
916
- content: none!important;
917
- }
918
- i{
919
- cursor: pointer;
920
- }
921
- .notClickClass{
922
- pointer-events: none;
923
- }
924
- </style>
1
+ <!-- 消息记录容器 -->
2
+ <template>
3
+ <div class="media-body">
4
+ <div class="textMessage" id="textMessage" :class="{remPhoneClass:isPhone,remCompanyClass:isCompany}">
5
+ <div style="display: flex;height: auto;line-height: 2;" @mousemove="clickClick" class="htmlClass">
6
+ <div v-html="text.template" id="html" :class="{notClickClass:disableds === true}">
7
+ {{text.template}}
8
+ </div>
9
+ </div>
10
+ <div id="submit">
11
+ <el-button plain size="small" @click="submitClick" :disabled="disableds" >{{submitValue}}</el-button>
12
+ </div>
13
+ <div v-if="isCompany">
14
+ <div v-if="single === true" class="editMessage">
15
+ <el-input v-model="input" placeholder="请输入内容" class="inputClass" @input="testClick" @blur="inputBlur"></el-input>
16
+ <!-- <span @click="quedingClick" style="display: flex;align-items: center"><i class="el-icon-success" style="color: #4C61E1;font-size: 32px;cursor: pointer"></i></span>
17
+ --> </div>
18
+ <div v-if="date" class="editMessage">
19
+ <el-date-picker
20
+ v-model="dateValue"
21
+ type="date"
22
+ placeholder="选择日期"
23
+ style="width: 100%;margin: 10px 0 10px 0"
24
+ :clearable=false
25
+ @change="dataclick"
26
+
27
+ >
28
+ </el-date-picker>
29
+ <!-- <span @click="quedingClick" style="display: flex;align-items: center"><i class="el-icon-success" style="color: #4C61E1;font-size: 32px;cursor: pointer"></i></span>
30
+ --> </div>
31
+ <div v-if="time" class="editMessage">
32
+ <el-time-picker
33
+ v-model="timeValue"
34
+ placeholder="任意时间点"
35
+ style="margin: 10px 0 10px 0;width: 100%"
36
+ :clearable=false
37
+ @change="dataclick"
38
+ >
39
+ </el-time-picker>
40
+ <!-- <span @click="quedingClick" style="display: flex;align-items: center"><i class="el-icon-success" style="color: #4C61E1;font-size: 32px;cursor: pointer"></i></span>
41
+ --> </div>
42
+ <div v-if="dateTime" class="editMessage">
43
+ <el-date-picker
44
+ v-model="dateTimeValue"
45
+ type="datetime"
46
+ placeholder="选择日期时间"
47
+ style="width: 100%;margin: 10px 0 10px 0"
48
+ @change="dataclick"
49
+ >
50
+ </el-date-picker>
51
+ <!-- <span @click="quedingClick(bianliangId)" style="display:flex;align-items:center;"><i class="el-icon-success" style="color: #4C61E1;font-size: 32px;cursor: pointer"></i></span>
52
+ --> </div>
53
+ <!--<div v-if="dateRange" style="border-top: 1px dashed #ebebeb;">
54
+ <el-date-picker
55
+ v-model="dateRangeValue"
56
+ type="daterange"
57
+ range-separator="至"
58
+ start-placeholder="开始日期"
59
+ end-placeholder="结束日期"
60
+ style="margin: 10px 16px;width: 80%"
61
+ >
62
+ </el-date-picker>
63
+ <span @click="quedingClick(bianliangId)" ><i class="el-icon-success" style="color: #409eff;font-size: 32px;text-align: center;vertical-align: middle;cursor: pointer"></i></span>
64
+ </div>
65
+ <div v-if="timeRange" style="border-top: 1px dashed #ebebeb;">
66
+ <el-time-picker
67
+ is-range
68
+ v-model="timeRangeValue"
69
+ range-separator="至"
70
+ start-placeholder="开始时间"
71
+ end-placeholder="结束时间"
72
+ placeholder="选择时间范围"
73
+ style="margin: 10px 16px;width: 80%"
74
+ >
75
+ </el-time-picker>
76
+ <span @click="quedingClick(bianliangId)" ><i class="el-icon-success" style="color: #409eff;font-size: 32px;text-align: center;vertical-align: middle;cursor: pointer"></i></span>
77
+
78
+ </div>
79
+ <div v-if="dateTimeRange" style="border-top: 1px dashed #ebebeb;">
80
+ <el-date-picker
81
+ v-model="dateTimeValue"
82
+ type="datetimerange"
83
+ range-separator="至"
84
+ start-placeholder="开始日期"
85
+ end-placeholder="结束日期"
86
+ style="width: 80%;margin: 10px 16px"
87
+
88
+ >
89
+ </el-date-picker>
90
+ <span @click="quedingClick(bianliangId)" ><i class="el-icon-success" style="color: #409eff;font-size: 32px;text-align: center;vertical-align: middle;cursor: pointer"></i></span>
91
+ </div>-->
92
+ </div>
93
+ <div v-if="isPhone">
94
+ <div v-if="single" class="editMessage">
95
+ <el-input v-model="input" placeholder="请输入内容" class="inputClass" @input="testClick" @blur="inputBlur"></el-input>
96
+ <!-- <span @click="quedingClick" style="display: flex;align-items: center"><i class="el-icon-success" style="color: #4C61E1;font-size: 32px;cursor: pointer"></i></span>
97
+ --> </div>
98
+ <div v-if="date">
99
+ <van-calendar v-model="show" @confirm="onConfirm" :default-date="defaultDate"/>
100
+ <!-- <el-date-picker
101
+ v-model="dateValue"
102
+ type="date"
103
+ placeholder="选择日期"
104
+ style="width: 80%;margin: 10px 10px 10px 0"
105
+ :editable=false
106
+ >
107
+ </el-date-picker>
108
+ <span @click="quedingClick" style="display: flex;align-items: center"><i class="el-icon-success" style="color: #4C61E1;font-size: 32px;cursor: pointer"></i></span>
109
+ --></div>
110
+
111
+ <div v-if="time">
112
+ <van-popup v-model="showTimePicker" position="bottom">
113
+ <van-datetime-picker
114
+ v-model="timeValue"
115
+ type="datetime"
116
+ title="选择时间"
117
+ :min-date="minDate"
118
+ :formatter="formatter"
119
+ @cancel="showTimePicker = false"
120
+ @confirm="onConfirmTime"
121
+ />
122
+ </van-popup>
123
+ <!-- <el-time-picker
124
+ v-model="timeValue"
125
+ placeholder="任意时间点"
126
+ style="margin: 10px 10px 10px 0;width: 80%"
127
+ :editable=false
128
+ >
129
+ </el-time-picker>
130
+ <span @click="quedingClick" style="display: flex;align-items: center"><i class="el-icon-success" style="color: #4C61E1;font-size: 32px;cursor: pointer"></i></span>
131
+ --> </div>
132
+ <div v-if="dateTime">
133
+ <van-popup v-model="showDateTimePicker" position="bottom">
134
+ <van-datetime-picker
135
+ v-model="dateTimeValue"
136
+ type="datetime"
137
+ title="选择日期时间"
138
+ :min-date="minDate"
139
+ :formatter="formatter"
140
+ @cancel="showDateTimePicker = false"
141
+ @confirm="onConfirmDateTime"
142
+ />
143
+ </van-popup>
144
+ <!-- <el-date-picker
145
+ v-model="dateTimeValue"
146
+ type="datetime"
147
+ placeholder="选择日期时间"
148
+ style="width: 80%;margin: 10px 10px 10px 0"
149
+ :editable=false
150
+
151
+ >
152
+ </el-date-picker>
153
+ <span @click="quedingClick(bianliangId)" style="display: flex;align-items: center"><i class="el-icon-success" style="color: #4C61E1;font-size: 32px;cursor: pointer"></i></span>
154
+ --></div>
155
+ <!-- <div v-if="dateRange" style="border-top: 1px dashed #ebebeb;display: flex">
156
+ &lt;!&ndash;<el-date-picker
157
+ v-model="dateRangeValue"
158
+ type="daterange"
159
+ range-separator="至"
160
+ start-placeholder="开始日期"
161
+ end-placeholder="结束日期"
162
+ style="margin: 10px 16px;width: 80%"
163
+ :editable=false
164
+
165
+ >
166
+ </el-date-picker>&ndash;&gt;
167
+ <div style="width: 90%">
168
+ <van-cell title="选择日期区间" :value="dateRangeValue" @click="show = true" />
169
+ <van-calendar v-model="show" type="range" @confirm="onConfirm" />
170
+ </div>
171
+ <span @click="quedingClick(bianliangId)" ><i class="el-icon-success" style="color: #409eff;font-size: 32px;text-align: center;vertical-align: middle;cursor: pointer"></i></span>
172
+
173
+
174
+
175
+ </div>
176
+ <div v-if="timeRange" style="border-top: 1px dashed #ebebeb;">
177
+ <el-time-picker
178
+ is-range
179
+ v-model="timeRangeValue"
180
+ range-separator="至"
181
+ start-placeholder="开始时间"
182
+ end-placeholder="结束时间"
183
+ placeholder="选择时间范围"
184
+ style="margin: 10px 16px;width: 80%"
185
+
186
+ :editable=false
187
+ >
188
+ </el-time-picker>
189
+ <span @click="quedingClick(bianliangId)" ><i class="el-icon-success" style="color: #409eff;font-size: 32px;text-align: center;vertical-align: middle;cursor: pointer"></i></span>
190
+
191
+ </div>
192
+ <div v-if="dateTimeRange" style="border-top: 1px dashed #ebebeb;display: flex">
193
+ &lt;!&ndash; <el-date-picker
194
+ v-model="dateTimeValue"
195
+ type="datetimerange"
196
+ range-separator="至"
197
+ start-placeholder="开始日期"
198
+ end-placeholder="结束日期"
199
+ style="width: 80%;margin: 10px 16px"
200
+ :editable=false
201
+
202
+
203
+ >
204
+ </el-date-picker>&ndash;&gt;
205
+ <div style="width: 90%">
206
+ <van-field
207
+ readonly
208
+ clickable
209
+ name="datetimePicker"
210
+ :value=dateTimeValue[0]
211
+ label='选择时间'
212
+ placeholder="点击选择开始日期时间"
213
+ @click="showDateTimePicker=true"
214
+ />
215
+ <van-popup v-model="showDateTimePicker" position="bottom">
216
+ <van-datetime-picker
217
+ v-model="currentDate"
218
+ type="datetime"
219
+ title="选择开始日期时间"
220
+ @confirm="onConfirmDateTime($event)"
221
+ @cancel="showDateTimePicker = false"
222
+ :min-date="minDate"
223
+ :formatter="formatter"
224
+ />
225
+ </van-popup>
226
+ <van-field
227
+ readonly
228
+ clickable
229
+ name="datetimePicker"
230
+ :value=dateTimeValue1[0]
231
+ label=" "
232
+ placeholder="点击选择结束日期时间"
233
+ @click="showDateTimePicker1=true"
234
+ />
235
+ <van-popup v-model="showDateTimePicker1" position="bottom">
236
+ <van-datetime-picker
237
+ v-model="currentDate"
238
+ type="datetime"
239
+ title="选择结束日期时间"
240
+ @confirm="onConfirmDateTime1($event)"
241
+ @cancel="showDateTimePicker1 = false"
242
+ :min-date="minDate"
243
+ :formatter="formatter"
244
+ />
245
+ </van-popup>
246
+ </div>
247
+
248
+ <span @click="quedingClick(bianliangId)" ><i class="el-icon-success" style="color: #409eff;font-size: 32px;text-align: center;vertical-align: middle;cursor: pointer"></i></span>
249
+ </div>-->
250
+ </div>
251
+ </div>
252
+ </div>
253
+ </template>
254
+
255
+ <script>
256
+ /*import $ from 'jquery'*/
257
+ export default {
258
+ name: 'TextMessage',
259
+ data(){
260
+ return{
261
+ show:false,
262
+ single:false,
263
+ date:false,
264
+ time:false,
265
+ dateTime:false,
266
+ dateRange:false,
267
+ timeRange:false,
268
+ input:'',
269
+ bianliangId:'',
270
+ dateValue:'',
271
+ message:[{content:'王亚欣',type:'SINGLE',value:'',id:1},{content:['2020-11-18T07:25:16.000+0000','2020-11-21T07:25:16.000+0000'],type:'DATE-RANGE',value:'',id:2},{content:'2020-11-18T07:25:16.000+0000',type:'TIME',value:'',id:3},{content:'2020-11-18T07:25:16.000+0000',type:'DATE',value:'',id:4},{content:['2020-11-18T07:25:16.000+0000','2020-11-21T07:25:16.000+0000'],type:'DATERANGE',value:'',id:5},{content:['2020-11-18T08:25:16.000+0000','2020-11-21T07:25:16.000+0000'],type:'TIMERANGE',value:'',id:6},],
272
+ isPhone:false,
273
+ isCompany:false,
274
+ dateTimeValue:'',
275
+ timeValue:'',
276
+ dateRangeValue:'',
277
+ dateRangeValues:'',
278
+ timeRangeValue:[],
279
+ dateTimeValue1:[],
280
+ test:0,
281
+ currentDate:new Date(),
282
+ minDate: new Date(2020, 0, 1),
283
+ showDateTimePicker1:false,
284
+ showDateTimePicker:false,
285
+ values:[],
286
+ checkValue:'',
287
+ disableds:false,
288
+ submitValue:'确认',
289
+ dateInnerText:'',
290
+ defaultDate:'',
291
+ showTimePicker:false,
292
+
293
+ }
294
+ },
295
+ props:{
296
+ text:{
297
+ type:Object,
298
+ default(){
299
+ return {}
300
+ }
301
+ },
302
+ type:String,
303
+ disable:Boolean,
304
+ submit:Boolean
305
+ },
306
+ mounted() {
307
+ this.isMobile()
308
+ let span=this.$el
309
+ let defaults=span.getElementsByClassName('ask-component-placeholder-span')
310
+ for (let i=0;i<defaults.length;i++)
311
+ {
312
+ this.values.push({})
313
+ this.values[i]['key']=defaults[i].getAttribute('data')
314
+ this.values[i]['value']=defaults[i].innerText
315
+ this.values[i]['type']=defaults[i].getAttribute('type')
316
+ }
317
+ let text=this.$el
318
+ let test=text.getElementsByClassName('ask-component-placeholder-span')
319
+ let cpntain=text.getElementsByClassName('ask-component-placeholder-container')
320
+ let icon=text.getElementsByClassName('arsenalkebianji')
321
+ for (let i=0;i<icon.length;i++)
322
+ {
323
+ icon[i].style.color='#366aff'
324
+ }
325
+ for (let i=0;i<cpntain.length;i++)
326
+ {
327
+ if(this.type)
328
+ {
329
+ cpntain[i].style.paddingRight=0.2+'rem'
330
+ cpntain[i].style.paddingLeft=0.2+'rem'
331
+ }
332
+ else
333
+ {
334
+ cpntain[i].style.paddingRight=4+'px'
335
+ cpntain[i].style.paddingLeft=4+'px'
336
+ }
337
+
338
+ }
339
+ for (let i=0;i<test.length;i++)
340
+ {
341
+ if(test[i].getAttribute('type')==='DATE_PICKER')
342
+ {
343
+ let date=Number(test[i].innerText)*1000
344
+ test[i].innerText=new Date(date).Format("MM-dd")
345
+ }
346
+ if(test[i].getAttribute('type')==='TIME_PICKER')
347
+ {
348
+ let time=Number(test[i].innerText)*1000
349
+ test[i].innerText=new Date(time).Format("hh:mm")
350
+ }
351
+ if(test[i].getAttribute('type') === 'DATE_TIME_PICKER'){
352
+ let time=Number(test[i].innerText)*1000
353
+ test[i].innerText=new Date(time).Format("yyyy-MM-dd hh:mm")
354
+ }
355
+ }
356
+ },
357
+ beforeMount() {
358
+ if(this.disable===true)
359
+ {
360
+ this.disableds=true
361
+
362
+ }
363
+ else
364
+ {
365
+ this.disableds=false
366
+
367
+ }
368
+ if(this.submit===true)
369
+ {
370
+ this.submitValue='已确认'
371
+ }
372
+ else
373
+ {
374
+ this.submitValue='确认'
375
+ }
376
+ },
377
+ methods:{
378
+ dataclick(){
379
+ if(this.checkValue.getAttribute('type') === 'DATE_PICKER')
380
+ {
381
+ for (let i=0;i<this.values.length;i++)
382
+ {
383
+ if(this.values[i].key === this.checkValue.getAttribute('data'))
384
+ {
385
+ if(this.dateValue!=='')
386
+ {
387
+ this.checkValue.innerText=new Date(this.dateValue).Format('MM-dd')
388
+ this.values[i].value=new Date(this.dateValue).getTime()
389
+ }
390
+ else
391
+ {
392
+ this.values[i].value=this.checkValue.innerText
393
+ }
394
+ }
395
+ }
396
+ }
397
+ if(this.checkValue.getAttribute('type') === 'TIME_PICKER')
398
+ {
399
+ for (let i=0;i<this.values.length;i++)
400
+ {
401
+ if(this.values[i].key === this.checkValue.getAttribute('data') )
402
+ {
403
+ if(this.timeValue!=='')
404
+ {
405
+
406
+ this.checkValue.innerText=new Date(this.timeValue).Format('hh:mm')
407
+ this.values[i].value=new Date(this.timeValue).getTime()
408
+ }
409
+ else
410
+ {
411
+ this.values[i].value=this.checkValue.innerText
412
+ }
413
+ }
414
+ }
415
+ }
416
+ if(this.checkValue.getAttribute('type') === 'DATE_TIME_PICKER')
417
+ {
418
+ for (let i=0;i<this.values.length;i++)
419
+ {
420
+ if(this.values[i].key === this.checkValue.getAttribute('data') )
421
+ {
422
+ if(this.dateTimeValue!=='')
423
+ {
424
+
425
+ this.checkValue.innerText=new Date(this.dateTimeValue).Format('yyyy-MM-dd hh:mm')
426
+ this.values[i].value=new Date(this.dateTimeValue).getTime()
427
+ }
428
+ else
429
+ {
430
+ this.values[i].value=this.checkValue.innerText
431
+ }
432
+ }
433
+ }
434
+ }
435
+ },
436
+ clickClick(e){
437
+ if(e.target.onclick!==null)
438
+ {
439
+ let that=this
440
+ window._askEditValue=that._askEditValue;
441
+ }
442
+ },
443
+ _askEditValue(a,b){
444
+ let type=b.getAttribute('type')
445
+ this.checkValue=b
446
+ if(type === 'INPUT')
447
+ {
448
+ this.single=true
449
+ this.date=false
450
+ this.time=false
451
+ this.dateTime=false
452
+ this.input= b.innerText
453
+ }
454
+ if(type === 'DATE_PICKER')
455
+ {
456
+ this.single=false
457
+ this.date=true
458
+ this.time=false
459
+ this.dateTime=false
460
+ this.show=true
461
+ for (let i=0;i<this.values.length;i++)
462
+ {
463
+ if(b.getAttribute('data') === this.values[i].key)
464
+ {
465
+ if(typeof this.values[i].value == 'string')
466
+ {
467
+ this.dateInnerText=Number(this.values[i].value)*1000
468
+ }
469
+ else
470
+ {
471
+ this.dateInnerText=Number(this.values[i].value)
472
+ }
473
+ this.dateValue=new Date(this.dateInnerText).Format("yyyy:MM-dd")
474
+ this.defaultDate=new Date(this.dateInnerText)
475
+ }
476
+ return
477
+ }
478
+
479
+ }
480
+ if(type === 'TIME_PICKER')
481
+ {
482
+ this.single=false
483
+ this.date=false
484
+ this.time=true
485
+ this.dateTime=false
486
+ this.showTimePicker=true
487
+ for (let i=0;i<this.values.length;i++)
488
+ {
489
+ if(b.getAttribute('data') === this.values[i].key)
490
+ {
491
+ let time
492
+ if(typeof this.values[i].value == 'string'){
493
+ time=Number(this.values[i].value)*1000
494
+ }
495
+ else
496
+ {
497
+ time=Number(this.values[i].value)
498
+ }
499
+ if(this.isPhone ===true)
500
+ {
501
+ this.timeValue=new Date(time)
502
+ }
503
+ else
504
+ {
505
+ this.timeValue=new Date(time).Format("yyyy-MM-dd hh:mm")
506
+ }
507
+ }
508
+ }
509
+ }
510
+ if(type === 'DATE_TIME_PICKER')
511
+ {
512
+ this.single=false
513
+ this.date=false
514
+ this.time=false
515
+ this.dateTime=true
516
+ this.showDateTimePicker=true
517
+ for (let i=0;i<this.values.length;i++)
518
+ {
519
+ if(b.getAttribute('data') === this.values[i].key)
520
+ {
521
+ let time
522
+ if(typeof this.values[i].value == 'string'){
523
+ time=Number(this.values[i].value)*1000
524
+ }
525
+ else
526
+ {
527
+ time=Number(this.values[i].value)
528
+ }
529
+ if(this.isPhone===true)
530
+ {
531
+ this.dateTimeValue=new Date(time)
532
+ }
533
+ else
534
+ {
535
+ this.dateTimeValue=new Date(time).Format("yyyy-MM-dd hh:mm:ss")
536
+ }
537
+ }
538
+ }
539
+ }
540
+
541
+ },
542
+ formatter(type, value) {
543
+ // 格式化选择器日期
544
+ if (type === "year") {
545
+ return `${value}年`;
546
+ } else if (type === "month") {
547
+ return `${value}月`;
548
+ } else if (type === "day") {
549
+ return `${value}日`;
550
+ } else if (type === "hour") {
551
+ return `${value}时`;
552
+ } else if (type === "minute") {
553
+ return `${value}分`;
554
+ }
555
+ return value;
556
+ },
557
+ //提交按钮
558
+ submitClick(){
559
+ this.single=false
560
+ this.date=false
561
+ this.time=false
562
+ this.dateTime=false
563
+ let infomation={}
564
+ let obj = {}
565
+ this.values.map(item => {
566
+ obj[item.key] = item
567
+ })
568
+ let result = Object.values(obj)
569
+ let text=this.$el
570
+ let test=text.getElementsByClassName('ask-component-placeholder-span')
571
+ for (let i=0;i<test.length;i++)
572
+ {
573
+ if(test[i].getAttribute('type')==='DATE_PICKER')
574
+ {
575
+ if(test[i].getAttribute('data')===result[i].key)
576
+ {
577
+ if(typeof result[i].value =='number'){
578
+ result[i].value/=1000
579
+ let resu=String(result[i].value)
580
+ result[i].value=resu
581
+ }
582
+ }
583
+ }
584
+ if(test[i].getAttribute('type')==='TIME_PICKER')
585
+ {
586
+ if(test[i].getAttribute('data')===result[i].key)
587
+ {
588
+ if(typeof result[i].value =='number')
589
+ {
590
+ result[i].value/=1000
591
+ let resu=String(result[i].value)
592
+ result[i].value=resu
593
+ }
594
+ }
595
+ }
596
+ if(test[i].getAttribute('type')==='DATE_TIME_PICKER')
597
+ {
598
+ if(test[i].getAttribute('data')===result[i].key)
599
+ {
600
+ if(typeof result[i].value =='number')
601
+ {
602
+ result[i].value/=1000
603
+ let resu=String(result[i].value)
604
+ result[i].value=resu
605
+ }
606
+ }
607
+ }
608
+ }
609
+ infomation['values']=result
610
+ infomation['goToAction']=this.text.goToAction
611
+ let innerhtml=this.$el
612
+ infomation['template']=innerhtml.querySelector('#html').innerHTML
613
+ infomation['apiKey']=this.text.apiKey
614
+ this.$emit('submitClick',infomation,this.text.apiKey)
615
+ this.submitValue='已确认'
616
+ this.disableds=true
617
+ },
618
+ addZero(i){
619
+ if (i<10) {
620
+ i="0" + i;
621
+ }
622
+ return i;
623
+ },
624
+ formatDate(date) {
625
+ if(typeof date == 'object')
626
+ {
627
+ const dateTime = new Date(date[0])
628
+ const dateTime1=new Date(date[1])
629
+ return `${dateTime.getMonth() + 1}月${dateTime.getDate()}日 ${this.addZero(dateTime.getHours())} : ${this.addZero(dateTime.getMinutes())} - ${dateTime1.getMonth() + 1}月${dateTime1.getDate()}日 ${this.addZero(dateTime1.getHours())} : ${this.addZero(dateTime1.getMinutes())}`;
630
+ }
631
+ else
632
+ {
633
+ const dateTime = new Date(date)
634
+ return `${dateTime.getMonth() + 1}月${dateTime.getDate()}日`;
635
+ }
636
+
637
+ },
638
+ //格式成时间
639
+ formatDate1(date){
640
+ const dateTime = new Date(date)
641
+ return `${this.addZero(dateTime.getHours())}:${this.addZero(dateTime.getMinutes())}`;
642
+ },
643
+ //格式成日期
644
+ formatDate2(date){
645
+ const dateTime = new Date(date)
646
+ return `${dateTime.getMonth() + 1} - ${dateTime.getDate()}`;
647
+ },
648
+ //日期范围
649
+ formatDate3(date){
650
+ const dateTime = new Date(date[0])
651
+ const dateTime1=new Date(date[1])
652
+ return `${dateTime.getMonth() + 1}月 ${dateTime.getDate()}日 - ${dateTime1.getMonth() + 1}月 ${dateTime1.getDate()}日`;
653
+ },
654
+ //时间范围
655
+ formatDate4(date){
656
+ const dateTime = new Date(date[0])
657
+ const dateTime1=new Date(date[1])
658
+ return `${dateTime.getHours()}: ${dateTime.getMinutes()} - ${dateTime1.getHours()}: ${dateTime1.getMinutes()}`;
659
+ },
660
+ testClick(value){
661
+ if(this.checkValue.getAttribute('type') === 'INPUT')
662
+ {
663
+ for (let i=0;i<this.values.length;i++)
664
+ {
665
+ if(this.values[i].key === this.checkValue.getAttribute('data') )
666
+ {
667
+ this.checkValue.innerText=value
668
+ this.values[i].value=this.checkValue.innerText
669
+ }
670
+ }
671
+ }
672
+ },
673
+ inputBlur(){
674
+ console.debug('inputBlur')
675
+ this.single=false
676
+ },
677
+ quedingClick(){
678
+ if(this.checkValue.getAttribute('type') === 'INPUT')
679
+ {
680
+ for (let i=0;i<this.values.length;i++)
681
+ {
682
+ if(this.values[i].key === this.checkValue.getAttribute('data') )
683
+ {
684
+ if(this.input!=='')
685
+ {
686
+ this.checkValue.innerText=this.input
687
+ }
688
+ this.values[i].value=this.checkValue.innerText
689
+ }
690
+ }
691
+ this.single = false
692
+ this.input=''
693
+ }
694
+ if(this.checkValue.getAttribute('type') === 'DATE_PICKER')
695
+
696
+ {
697
+ for (let i=0;i<this.values.length;i++)
698
+ {
699
+ if(this.values[i].key === this.checkValue.getAttribute('data'))
700
+ {
701
+ if(this.dateValue!=='')
702
+ {
703
+ this.checkValue.innerText=new Date(this.dateValue).Format('MM-dd')
704
+ this.values[i].value=new Date(this.dateValue).getTime()
705
+ }
706
+ else
707
+ {
708
+ this.values[i].value=this.checkValue.innerText
709
+ }
710
+ }
711
+ }
712
+ this.date = false
713
+ this.dateValue=''
714
+ }
715
+ if(this.checkValue.getAttribute('type') === 'TIME_PICKER')
716
+ {
717
+ for (let i=0;i<this.values.length;i++)
718
+ {
719
+ if(this.values[i].key === this.checkValue.getAttribute('data') )
720
+ {
721
+ if(this.timeValue!=='')
722
+ {
723
+
724
+ this.checkValue.innerText=new Date(this.timeValue).Format('hh:mm')
725
+ this.values[i].value=new Date(this.timeValue).getTime()
726
+ }
727
+ else
728
+ {
729
+ this.values[i].value=this.checkValue.innerText
730
+ }
731
+ }
732
+ }
733
+ this.time = false
734
+ this.timeValue=''
735
+ }
736
+ if(this.checkValue.getAttribute('type') === 'DATE_TIME_PICKER')
737
+ {
738
+ for (let i=0;i<this.values.length;i++)
739
+ {
740
+ if(this.values[i].key === this.checkValue.getAttribute('data') )
741
+ {
742
+ if(this.dateTimeValue!=='')
743
+ {
744
+
745
+ this.checkValue.innerText=new Date(this.dateTimeValue).Format('yyyy-MM-dd hh:mm')
746
+ this.values[i].value=new Date(this.dateTimeValue).getTime()
747
+ }
748
+ else
749
+ {
750
+ this.values[i].value=this.checkValue.innerText
751
+ }
752
+ }
753
+ }
754
+ this.dateTime = false
755
+ this.dateTimeValue=''
756
+ }
757
+
758
+ },
759
+ isMobile() {
760
+ let flag = navigator.userAgent.match(/(phone|pad|pod|iPhone|iPod|ios|iPad|Android|Mobile|BlackBerry|IEMobile|MQQBrowser|JUC|Fennec|wOSBrowser|BrowserNG|WebOS|Symbian|Windows Phone)/i);
761
+ if (flag) {
762
+ this.isPhone=true
763
+ }
764
+ else
765
+ {
766
+ this.isCompany=true
767
+
768
+ }
769
+ },
770
+ onConfirmDateTime(){
771
+ if(this.checkValue.getAttribute('type') === 'DATE_TIME_PICKER')
772
+ {
773
+ for (let i=0;i<this.values.length;i++)
774
+ {
775
+ if(this.values[i].key === this.checkValue.getAttribute('data') )
776
+ {
777
+ if(this.dateTimeValue!=='')
778
+ {
779
+
780
+ this.checkValue.innerText=new Date(this.dateTimeValue).Format('yyyy-MM-dd hh:mm')
781
+ this.values[i].value=new Date(this.dateTimeValue).getTime()
782
+ }
783
+ else
784
+ {
785
+ this.values[i].value=this.checkValue.innerText
786
+ }
787
+ }
788
+ }
789
+ }
790
+ this.showDateTimePicker = false;
791
+ },
792
+
793
+ onConfirm(date) {
794
+ this.show = false;
795
+ if(this.checkValue.getAttribute('type') === 'DATE_PICKER')
796
+
797
+ {
798
+ for (let i=0;i<this.values.length;i++)
799
+ {
800
+ if(this.values[i].key === this.checkValue.getAttribute('data'))
801
+ {
802
+ if(date!=='')
803
+ {
804
+ this.checkValue.innerText=new Date(date).Format('MM-dd')
805
+ this.values[i].value=new Date(date).getTime()
806
+ }
807
+ else
808
+ {
809
+ this.values[i].value=this.checkValue.innerText
810
+ }
811
+ }
812
+ }
813
+ this.date = false
814
+ this.dateValue=''
815
+ }
816
+
817
+ },
818
+ onConfirmTime(){
819
+ this.showTimePicker=false
820
+ if(this.checkValue.getAttribute('type') === 'TIME_PICKER')
821
+ {
822
+ for (let i=0;i<this.values.length;i++)
823
+ {
824
+ if(this.values[i].key === this.checkValue.getAttribute('data') )
825
+ {
826
+ if(this.timeValue!=='')
827
+ {
828
+
829
+ this.checkValue.innerText=new Date(this.timeValue).Format('hh:mm')
830
+ this.values[i].value=new Date(this.timeValue).getTime()
831
+ }
832
+ else
833
+ {
834
+ this.values[i].value=this.checkValue.innerText
835
+ }
836
+ }
837
+ }
838
+ }
839
+ }
840
+ }
841
+ }
842
+ </script>
843
+
844
+
845
+ <style lang="less">
846
+ @import "../../assets/less/common.css";
847
+ #textMessage{
848
+ min-width: 200px;
849
+ .editMessage{
850
+ display: flex;
851
+ justify-content: space-between;
852
+ margin-top: 10px;
853
+ border-top: 1px dashed #ebebeb;
854
+ }
855
+ #submit{
856
+ margin-top: 10px;
857
+ display: flex;
858
+ align-items: center;
859
+ justify-content: center;
860
+ .el-button{
861
+ border: 1px solid #BBCDFF;
862
+ border-radius: 14px;
863
+ background-color: white;
864
+ color: #366aff;
865
+ font-weight: 400;
866
+ }
867
+ .el-button--small{
868
+ padding: 9px 30px;
869
+ font-size: 1em;
870
+ }
871
+ }
872
+ #html{
873
+ p{
874
+ color:#A9B3C6;
875
+ }
876
+ .ask-component-placeholder-icon{
877
+ padding-left: 12px;
878
+ color: #366aff;
879
+ font-size: 18px;
880
+ }
881
+ .ask-component-placeholder-span{
882
+ color: #616161!important;
883
+ }
884
+ }
885
+ }
886
+ .remPhoneClass{
887
+ margin: 0 auto;
888
+ /*width: 80vw;*/
889
+ .inputClass{
890
+ margin-top: 8px;
891
+ width: 100%;
892
+ .el-input__inner{
893
+ border-radius: 9px;
894
+ }
895
+ }
896
+ .htmlClass{
897
+ padding: 4px 0;
898
+ }
899
+
900
+ }
901
+ .remCompanyClass{
902
+
903
+ margin: 0 auto;
904
+ /*width: 300px;*/
905
+ .inputClass{
906
+ padding: 10px 0 10px 0;
907
+ width: 100%;
908
+ .el-input__inner{
909
+ border-radius: 9px;
910
+ }
911
+ }
912
+
913
+
914
+ }
915
+ .van-cell::after{
916
+ content: none!important;
917
+ }
918
+ i{
919
+ cursor: pointer;
920
+ }
921
+ .notClickClass{
922
+ pointer-events: none;
923
+ }
924
+ </style>