askbot-dragon 1.7.14-beta → 1.7.16-beta

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 (87) 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 +72 -72
  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 +116 -92
  11. package/src/assets/js/Base64Util.js +22 -22
  12. package/src/assets/js/common.js +252 -252
  13. package/src/assets/js/hammer.js +100 -100
  14. package/src/assets/js/script.js +36 -36
  15. package/src/assets/less/common.css +6773 -6773
  16. package/src/assets/less/converSationContainer/common.less +199 -199
  17. package/src/assets/less/converSationContainer/converSatonContainer.less +493 -493
  18. package/src/assets/less/iconfont.css +37 -37
  19. package/src/assets/less/ticketMessage.less +294 -294
  20. package/src/components/ActionAlertIframe.vue +177 -177
  21. package/src/components/AiGuide.vue +438 -470
  22. package/src/components/AnswerDocknowledge.vue +1070 -1070
  23. package/src/components/AnswerVoice.vue +285 -285
  24. package/src/components/AskIFrame.vue +15 -15
  25. package/src/components/ConversationContainer.vue +4948 -4948
  26. package/src/components/FileType.vue +86 -86
  27. package/src/components/Message.vue +27 -27
  28. package/src/components/MyEditor.vue +351 -351
  29. package/src/components/actionSatisfaction.vue +107 -107
  30. package/src/components/actionSendToBot.vue +62 -62
  31. package/src/components/answerDissatisfaction.vue +62 -62
  32. package/src/components/answerRadio.vue +204 -203
  33. package/src/components/ask-components/DissatisfactionOptions.vue +57 -57
  34. package/src/components/ask-components/Msgloading.vue +37 -37
  35. package/src/components/ask-components/SatisfactionV2.vue +15 -15
  36. package/src/components/askVideo.vue +162 -162
  37. package/src/components/assetDetails.vue +378 -378
  38. package/src/components/assetMessage.vue +228 -228
  39. package/src/components/associationIntention.vue +378 -378
  40. package/src/components/attachmentPreview.vue +90 -90
  41. package/src/components/botActionSatisfactor.vue +68 -68
  42. package/src/components/chatContent.vue +513 -513
  43. package/src/components/feedBack.vue +136 -136
  44. package/src/components/fielListView.vue +351 -351
  45. package/src/components/file/AliyunOssComponents.vue +108 -108
  46. package/src/components/formTemplate.vue +3576 -3576
  47. package/src/components/intelligentSummary.vue +231 -231
  48. package/src/components/kkview.vue +1138 -1138
  49. package/src/components/loadingProcess.vue +164 -164
  50. package/src/components/message/ActionAlertIframe.vue +112 -112
  51. package/src/components/message/ShopMessage.vue +164 -164
  52. package/src/components/message/TextMessage.vue +928 -928
  53. package/src/components/message/TicketMessage.vue +201 -201
  54. package/src/components/message/swiper/index.js +4 -4
  55. package/src/components/message/swiper/ticketSwiper.vue +503 -503
  56. package/src/components/message/swiper/ticketSwiperItem.vue +61 -61
  57. package/src/components/msgLoading.vue +231 -231
  58. package/src/components/myPopup.vue +70 -70
  59. package/src/components/newPdfPosition.vue +877 -877
  60. package/src/components/pdfPosition.vue +1508 -1508
  61. package/src/components/popup.vue +227 -227
  62. package/src/components/previewDoc.vue +251 -251
  63. package/src/components/previewPdf.vue +804 -804
  64. package/src/components/receiverMessagePlatform.vue +65 -65
  65. package/src/components/recommend.vue +80 -80
  66. package/src/components/selector/hOption.vue +20 -20
  67. package/src/components/selector/hSelector.vue +199 -199
  68. package/src/components/selector/hWrapper.vue +216 -216
  69. package/src/components/senderMessagePlatform.vue +50 -50
  70. package/src/components/source/BotMessage.vue +24 -24
  71. package/src/components/source/CustomMessage.vue +24 -24
  72. package/src/components/test.vue +260 -260
  73. package/src/components/tree.vue +294 -294
  74. package/src/components/utils/ckeditor.js +174 -174
  75. package/src/components/utils/format_date.js +25 -25
  76. package/src/components/utils/index.js +6 -6
  77. package/src/components/utils/math_utils.js +29 -29
  78. package/src/components/voiceComponent.vue +119 -119
  79. package/src/components/welcomeKnowledgeFile.vue +344 -344
  80. package/src/components/welcomeLlmCard.vue +144 -144
  81. package/src/components/welcomeSuggest.vue +97 -97
  82. package/src/locales/cn.json +71 -71
  83. package/src/locales/en.json +72 -72
  84. package/src/locales/jp.json +72 -72
  85. package/src/main.js +75 -75
  86. package/vue.config.js +54 -54
  87. package/src/components/utils/AliyunIssUtil.js +0 -81
@@ -1,928 +1,928 @@
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="$t('common.inputPlaceholder')" 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="$t('common.selectDate')"
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="$t('common.selectTime')"
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="$t('common.selectDateTime')"
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="$t('common.inputPlaceholder')" 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="$t('common.selectTime')"
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="$t('common.selectDateTime')"
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
- language:{
306
- type:String,
307
- default:"cn"
308
- }
309
- },
310
- mounted() {
311
- this.isMobile()
312
- let span=this.$el
313
- let defaults=span.getElementsByClassName('ask-component-placeholder-span')
314
- for (let i=0;i<defaults.length;i++)
315
- {
316
- this.values.push({})
317
- this.values[i]['key']=defaults[i].getAttribute('data')
318
- this.values[i]['value']=defaults[i].innerText
319
- this.values[i]['type']=defaults[i].getAttribute('type')
320
- }
321
- let text=this.$el
322
- let test=text.getElementsByClassName('ask-component-placeholder-span')
323
- let cpntain=text.getElementsByClassName('ask-component-placeholder-container')
324
- let icon=text.getElementsByClassName('arsenalkebianji')
325
- for (let i=0;i<icon.length;i++)
326
- {
327
- icon[i].style.color='#366aff'
328
- }
329
- for (let i=0;i<cpntain.length;i++)
330
- {
331
- if(this.type)
332
- {
333
- cpntain[i].style.paddingRight=0.2+'rem'
334
- cpntain[i].style.paddingLeft=0.2+'rem'
335
- }
336
- else
337
- {
338
- cpntain[i].style.paddingRight=4+'px'
339
- cpntain[i].style.paddingLeft=4+'px'
340
- }
341
-
342
- }
343
- for (let i=0;i<test.length;i++)
344
- {
345
- if(test[i].getAttribute('type')==='DATE_PICKER')
346
- {
347
- let date=Number(test[i].innerText)*1000
348
- test[i].innerText=new Date(date).Format("MM-dd")
349
- }
350
- if(test[i].getAttribute('type')==='TIME_PICKER')
351
- {
352
- let time=Number(test[i].innerText)*1000
353
- test[i].innerText=new Date(time).Format("hh:mm")
354
- }
355
- if(test[i].getAttribute('type') === 'DATE_TIME_PICKER'){
356
- let time=Number(test[i].innerText)*1000
357
- test[i].innerText=new Date(time).Format("yyyy-MM-dd hh:mm")
358
- }
359
- }
360
- },
361
- beforeMount() {
362
- if(this.disable===true)
363
- {
364
- this.disableds=true
365
-
366
- }
367
- else
368
- {
369
- this.disableds=false
370
-
371
- }
372
- if(this.submit===true)
373
- {
374
- this.submitValue=this.$t('common.confirmed')
375
- }
376
- else
377
- {
378
- this.submitValue=this.$t('common.confirm')
379
- }
380
- },
381
- methods:{
382
- dataclick(){
383
- if(this.checkValue.getAttribute('type') === 'DATE_PICKER')
384
- {
385
- for (let i=0;i<this.values.length;i++)
386
- {
387
- if(this.values[i].key === this.checkValue.getAttribute('data'))
388
- {
389
- if(this.dateValue!=='')
390
- {
391
- this.checkValue.innerText=new Date(this.dateValue).Format('MM-dd')
392
- this.values[i].value=new Date(this.dateValue).getTime()
393
- }
394
- else
395
- {
396
- this.values[i].value=this.checkValue.innerText
397
- }
398
- }
399
- }
400
- }
401
- if(this.checkValue.getAttribute('type') === 'TIME_PICKER')
402
- {
403
- for (let i=0;i<this.values.length;i++)
404
- {
405
- if(this.values[i].key === this.checkValue.getAttribute('data') )
406
- {
407
- if(this.timeValue!=='')
408
- {
409
-
410
- this.checkValue.innerText=new Date(this.timeValue).Format('hh:mm')
411
- this.values[i].value=new Date(this.timeValue).getTime()
412
- }
413
- else
414
- {
415
- this.values[i].value=this.checkValue.innerText
416
- }
417
- }
418
- }
419
- }
420
- if(this.checkValue.getAttribute('type') === 'DATE_TIME_PICKER')
421
- {
422
- for (let i=0;i<this.values.length;i++)
423
- {
424
- if(this.values[i].key === this.checkValue.getAttribute('data') )
425
- {
426
- if(this.dateTimeValue!=='')
427
- {
428
-
429
- this.checkValue.innerText=new Date(this.dateTimeValue).Format('yyyy-MM-dd hh:mm')
430
- this.values[i].value=new Date(this.dateTimeValue).getTime()
431
- }
432
- else
433
- {
434
- this.values[i].value=this.checkValue.innerText
435
- }
436
- }
437
- }
438
- }
439
- },
440
- clickClick(e){
441
- if(e.target.onclick!==null)
442
- {
443
- let that=this
444
- window._askEditValue=that._askEditValue;
445
- }
446
- },
447
- _askEditValue(a,b){
448
- let type=b.getAttribute('type')
449
- this.checkValue=b
450
- if(type === 'INPUT')
451
- {
452
- this.single=true
453
- this.date=false
454
- this.time=false
455
- this.dateTime=false
456
- this.input= b.innerText
457
- }
458
- if(type === 'DATE_PICKER')
459
- {
460
- this.single=false
461
- this.date=true
462
- this.time=false
463
- this.dateTime=false
464
- this.show=true
465
- for (let i=0;i<this.values.length;i++)
466
- {
467
- if(b.getAttribute('data') === this.values[i].key)
468
- {
469
- if(typeof this.values[i].value == 'string')
470
- {
471
- this.dateInnerText=Number(this.values[i].value)*1000
472
- }
473
- else
474
- {
475
- this.dateInnerText=Number(this.values[i].value)
476
- }
477
- this.dateValue=new Date(this.dateInnerText).Format("yyyy:MM-dd")
478
- this.defaultDate=new Date(this.dateInnerText)
479
- }
480
- return
481
- }
482
-
483
- }
484
- if(type === 'TIME_PICKER')
485
- {
486
- this.single=false
487
- this.date=false
488
- this.time=true
489
- this.dateTime=false
490
- this.showTimePicker=true
491
- for (let i=0;i<this.values.length;i++)
492
- {
493
- if(b.getAttribute('data') === this.values[i].key)
494
- {
495
- let time
496
- if(typeof this.values[i].value == 'string'){
497
- time=Number(this.values[i].value)*1000
498
- }
499
- else
500
- {
501
- time=Number(this.values[i].value)
502
- }
503
- if(this.isPhone ===true)
504
- {
505
- this.timeValue=new Date(time)
506
- }
507
- else
508
- {
509
- this.timeValue=new Date(time).Format("yyyy-MM-dd hh:mm")
510
- }
511
- }
512
- }
513
- }
514
- if(type === 'DATE_TIME_PICKER')
515
- {
516
- this.single=false
517
- this.date=false
518
- this.time=false
519
- this.dateTime=true
520
- this.showDateTimePicker=true
521
- for (let i=0;i<this.values.length;i++)
522
- {
523
- if(b.getAttribute('data') === this.values[i].key)
524
- {
525
- let time
526
- if(typeof this.values[i].value == 'string'){
527
- time=Number(this.values[i].value)*1000
528
- }
529
- else
530
- {
531
- time=Number(this.values[i].value)
532
- }
533
- if(this.isPhone===true)
534
- {
535
- this.dateTimeValue=new Date(time)
536
- }
537
- else
538
- {
539
- this.dateTimeValue=new Date(time).Format("yyyy-MM-dd hh:mm:ss")
540
- }
541
- }
542
- }
543
- }
544
-
545
- },
546
- formatter(type, value) {
547
- // 格式化选择器日期
548
- if (type === "year") {
549
- return `${value}年`;
550
- } else if (type === "month") {
551
- return `${value}月`;
552
- } else if (type === "day") {
553
- return `${value}日`;
554
- } else if (type === "hour") {
555
- return `${value}时`;
556
- } else if (type === "minute") {
557
- return `${value}分`;
558
- }
559
- return value;
560
- },
561
- //提交按钮
562
- submitClick(){
563
- this.single=false
564
- this.date=false
565
- this.time=false
566
- this.dateTime=false
567
- let infomation={}
568
- let obj = {}
569
- this.values.map(item => {
570
- obj[item.key] = item
571
- })
572
- let result = Object.values(obj)
573
- let text=this.$el
574
- let test=text.getElementsByClassName('ask-component-placeholder-span')
575
- for (let i=0;i<test.length;i++)
576
- {
577
- if(test[i].getAttribute('type')==='DATE_PICKER')
578
- {
579
- if(test[i].getAttribute('data')===result[i].key)
580
- {
581
- if(typeof result[i].value =='number'){
582
- result[i].value/=1000
583
- let resu=String(result[i].value)
584
- result[i].value=resu
585
- }
586
- }
587
- }
588
- if(test[i].getAttribute('type')==='TIME_PICKER')
589
- {
590
- if(test[i].getAttribute('data')===result[i].key)
591
- {
592
- if(typeof result[i].value =='number')
593
- {
594
- result[i].value/=1000
595
- let resu=String(result[i].value)
596
- result[i].value=resu
597
- }
598
- }
599
- }
600
- if(test[i].getAttribute('type')==='DATE_TIME_PICKER')
601
- {
602
- if(test[i].getAttribute('data')===result[i].key)
603
- {
604
- if(typeof result[i].value =='number')
605
- {
606
- result[i].value/=1000
607
- let resu=String(result[i].value)
608
- result[i].value=resu
609
- }
610
- }
611
- }
612
- }
613
- infomation['values']=result
614
- infomation['goToAction']=this.text.goToAction
615
- let innerhtml=this.$el
616
- infomation['template']=innerhtml.querySelector('#html').innerHTML
617
- infomation['apiKey']=this.text.apiKey
618
- this.$emit('submitClick',infomation,this.text.apiKey)
619
- this.submitValue=this.$t('common.confirmed')
620
- this.disableds=true
621
- },
622
- addZero(i){
623
- if (i<10) {
624
- i="0" + i;
625
- }
626
- return i;
627
- },
628
- formatDate(date) {
629
- if(typeof date == 'object')
630
- {
631
- const dateTime = new Date(date[0])
632
- const dateTime1=new Date(date[1])
633
- 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())}`;
634
- }
635
- else
636
- {
637
- const dateTime = new Date(date)
638
- return `${dateTime.getMonth() + 1}月${dateTime.getDate()}日`;
639
- }
640
-
641
- },
642
- //格式成时间
643
- formatDate1(date){
644
- const dateTime = new Date(date)
645
- return `${this.addZero(dateTime.getHours())}:${this.addZero(dateTime.getMinutes())}`;
646
- },
647
- //格式成日期
648
- formatDate2(date){
649
- const dateTime = new Date(date)
650
- return `${dateTime.getMonth() + 1} - ${dateTime.getDate()}`;
651
- },
652
- //日期范围
653
- formatDate3(date){
654
- const dateTime = new Date(date[0])
655
- const dateTime1=new Date(date[1])
656
- return `${dateTime.getMonth() + 1}月 ${dateTime.getDate()}日 - ${dateTime1.getMonth() + 1}月 ${dateTime1.getDate()}日`;
657
- },
658
- //时间范围
659
- formatDate4(date){
660
- const dateTime = new Date(date[0])
661
- const dateTime1=new Date(date[1])
662
- return `${dateTime.getHours()}: ${dateTime.getMinutes()} - ${dateTime1.getHours()}: ${dateTime1.getMinutes()}`;
663
- },
664
- testClick(value){
665
- if(this.checkValue.getAttribute('type') === 'INPUT')
666
- {
667
- for (let i=0;i<this.values.length;i++)
668
- {
669
- if(this.values[i].key === this.checkValue.getAttribute('data') )
670
- {
671
- this.checkValue.innerText=value
672
- this.values[i].value=this.checkValue.innerText
673
- }
674
- }
675
- }
676
- },
677
- inputBlur(){
678
- console.debug('inputBlur')
679
- this.single=false
680
- },
681
- quedingClick(){
682
- if(this.checkValue.getAttribute('type') === 'INPUT')
683
- {
684
- for (let i=0;i<this.values.length;i++)
685
- {
686
- if(this.values[i].key === this.checkValue.getAttribute('data') )
687
- {
688
- if(this.input!=='')
689
- {
690
- this.checkValue.innerText=this.input
691
- }
692
- this.values[i].value=this.checkValue.innerText
693
- }
694
- }
695
- this.single = false
696
- this.input=''
697
- }
698
- if(this.checkValue.getAttribute('type') === 'DATE_PICKER')
699
-
700
- {
701
- for (let i=0;i<this.values.length;i++)
702
- {
703
- if(this.values[i].key === this.checkValue.getAttribute('data'))
704
- {
705
- if(this.dateValue!=='')
706
- {
707
- this.checkValue.innerText=new Date(this.dateValue).Format('MM-dd')
708
- this.values[i].value=new Date(this.dateValue).getTime()
709
- }
710
- else
711
- {
712
- this.values[i].value=this.checkValue.innerText
713
- }
714
- }
715
- }
716
- this.date = false
717
- this.dateValue=''
718
- }
719
- if(this.checkValue.getAttribute('type') === 'TIME_PICKER')
720
- {
721
- for (let i=0;i<this.values.length;i++)
722
- {
723
- if(this.values[i].key === this.checkValue.getAttribute('data') )
724
- {
725
- if(this.timeValue!=='')
726
- {
727
-
728
- this.checkValue.innerText=new Date(this.timeValue).Format('hh:mm')
729
- this.values[i].value=new Date(this.timeValue).getTime()
730
- }
731
- else
732
- {
733
- this.values[i].value=this.checkValue.innerText
734
- }
735
- }
736
- }
737
- this.time = false
738
- this.timeValue=''
739
- }
740
- if(this.checkValue.getAttribute('type') === 'DATE_TIME_PICKER')
741
- {
742
- for (let i=0;i<this.values.length;i++)
743
- {
744
- if(this.values[i].key === this.checkValue.getAttribute('data') )
745
- {
746
- if(this.dateTimeValue!=='')
747
- {
748
-
749
- this.checkValue.innerText=new Date(this.dateTimeValue).Format('yyyy-MM-dd hh:mm')
750
- this.values[i].value=new Date(this.dateTimeValue).getTime()
751
- }
752
- else
753
- {
754
- this.values[i].value=this.checkValue.innerText
755
- }
756
- }
757
- }
758
- this.dateTime = false
759
- this.dateTimeValue=''
760
- }
761
-
762
- },
763
- isMobile() {
764
- 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);
765
- if (flag) {
766
- this.isPhone=true
767
- }
768
- else
769
- {
770
- this.isCompany=true
771
-
772
- }
773
- },
774
- onConfirmDateTime(){
775
- if(this.checkValue.getAttribute('type') === 'DATE_TIME_PICKER')
776
- {
777
- for (let i=0;i<this.values.length;i++)
778
- {
779
- if(this.values[i].key === this.checkValue.getAttribute('data') )
780
- {
781
- if(this.dateTimeValue!=='')
782
- {
783
-
784
- this.checkValue.innerText=new Date(this.dateTimeValue).Format('yyyy-MM-dd hh:mm')
785
- this.values[i].value=new Date(this.dateTimeValue).getTime()
786
- }
787
- else
788
- {
789
- this.values[i].value=this.checkValue.innerText
790
- }
791
- }
792
- }
793
- }
794
- this.showDateTimePicker = false;
795
- },
796
-
797
- onConfirm(date) {
798
- this.show = false;
799
- if(this.checkValue.getAttribute('type') === 'DATE_PICKER')
800
-
801
- {
802
- for (let i=0;i<this.values.length;i++)
803
- {
804
- if(this.values[i].key === this.checkValue.getAttribute('data'))
805
- {
806
- if(date!=='')
807
- {
808
- this.checkValue.innerText=new Date(date).Format('MM-dd')
809
- this.values[i].value=new Date(date).getTime()
810
- }
811
- else
812
- {
813
- this.values[i].value=this.checkValue.innerText
814
- }
815
- }
816
- }
817
- this.date = false
818
- this.dateValue=''
819
- }
820
-
821
- },
822
- onConfirmTime(){
823
- this.showTimePicker=false
824
- if(this.checkValue.getAttribute('type') === 'TIME_PICKER')
825
- {
826
- for (let i=0;i<this.values.length;i++)
827
- {
828
- if(this.values[i].key === this.checkValue.getAttribute('data') )
829
- {
830
- if(this.timeValue!=='')
831
- {
832
-
833
- this.checkValue.innerText=new Date(this.timeValue).Format('hh:mm')
834
- this.values[i].value=new Date(this.timeValue).getTime()
835
- }
836
- else
837
- {
838
- this.values[i].value=this.checkValue.innerText
839
- }
840
- }
841
- }
842
- }
843
- }
844
- }
845
- }
846
- </script>
847
-
848
-
849
- <style lang="less">
850
- @import "../../assets/less/common.css";
851
- #textMessage{
852
- min-width: 200px;
853
- .editMessage{
854
- display: flex;
855
- justify-content: space-between;
856
- margin-top: 10px;
857
- border-top: 1px dashed #ebebeb;
858
- }
859
- #submit{
860
- margin-top: 10px;
861
- display: flex;
862
- align-items: center;
863
- justify-content: center;
864
- .el-button{
865
- border: 1px solid #BBCDFF;
866
- border-radius: 14px;
867
- background-color: white;
868
- color: #366aff;
869
- font-weight: 400;
870
- }
871
- .el-button--small{
872
- padding: 9px 30px;
873
- font-size: 1em;
874
- }
875
- }
876
- #html{
877
- p{
878
- color:#A9B3C6;
879
- }
880
- .ask-component-placeholder-icon{
881
- padding-left: 12px;
882
- color: #366aff;
883
- font-size: 18px;
884
- }
885
- .ask-component-placeholder-span{
886
- color: #616161!important;
887
- }
888
- }
889
- }
890
- .remPhoneClass{
891
- margin: 0 auto;
892
- /*width: 80vw;*/
893
- .inputClass{
894
- margin-top: 8px;
895
- width: 100%;
896
- .el-input__inner{
897
- border-radius: 9px;
898
- }
899
- }
900
- .htmlClass{
901
- padding: 4px 0;
902
- }
903
-
904
- }
905
- .remCompanyClass{
906
-
907
- margin: 0 auto;
908
- /*width: 300px;*/
909
- .inputClass{
910
- padding: 10px 0 10px 0;
911
- width: 100%;
912
- .el-input__inner{
913
- border-radius: 9px;
914
- }
915
- }
916
-
917
-
918
- }
919
- .van-cell::after{
920
- content: none!important;
921
- }
922
- i{
923
- cursor: pointer;
924
- }
925
- .notClickClass{
926
- pointer-events: none;
927
- }
928
- </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="$t('common.inputPlaceholder')" 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="$t('common.selectDate')"
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="$t('common.selectTime')"
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="$t('common.selectDateTime')"
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="$t('common.inputPlaceholder')" 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="$t('common.selectTime')"
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="$t('common.selectDateTime')"
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
+ language:{
306
+ type:String,
307
+ default:"cn"
308
+ }
309
+ },
310
+ mounted() {
311
+ this.isMobile()
312
+ let span=this.$el
313
+ let defaults=span.getElementsByClassName('ask-component-placeholder-span')
314
+ for (let i=0;i<defaults.length;i++)
315
+ {
316
+ this.values.push({})
317
+ this.values[i]['key']=defaults[i].getAttribute('data')
318
+ this.values[i]['value']=defaults[i].innerText
319
+ this.values[i]['type']=defaults[i].getAttribute('type')
320
+ }
321
+ let text=this.$el
322
+ let test=text.getElementsByClassName('ask-component-placeholder-span')
323
+ let cpntain=text.getElementsByClassName('ask-component-placeholder-container')
324
+ let icon=text.getElementsByClassName('arsenalkebianji')
325
+ for (let i=0;i<icon.length;i++)
326
+ {
327
+ icon[i].style.color='#366aff'
328
+ }
329
+ for (let i=0;i<cpntain.length;i++)
330
+ {
331
+ if(this.type)
332
+ {
333
+ cpntain[i].style.paddingRight=0.2+'rem'
334
+ cpntain[i].style.paddingLeft=0.2+'rem'
335
+ }
336
+ else
337
+ {
338
+ cpntain[i].style.paddingRight=4+'px'
339
+ cpntain[i].style.paddingLeft=4+'px'
340
+ }
341
+
342
+ }
343
+ for (let i=0;i<test.length;i++)
344
+ {
345
+ if(test[i].getAttribute('type')==='DATE_PICKER')
346
+ {
347
+ let date=Number(test[i].innerText)*1000
348
+ test[i].innerText=new Date(date).Format("MM-dd")
349
+ }
350
+ if(test[i].getAttribute('type')==='TIME_PICKER')
351
+ {
352
+ let time=Number(test[i].innerText)*1000
353
+ test[i].innerText=new Date(time).Format("hh:mm")
354
+ }
355
+ if(test[i].getAttribute('type') === 'DATE_TIME_PICKER'){
356
+ let time=Number(test[i].innerText)*1000
357
+ test[i].innerText=new Date(time).Format("yyyy-MM-dd hh:mm")
358
+ }
359
+ }
360
+ },
361
+ beforeMount() {
362
+ if(this.disable===true)
363
+ {
364
+ this.disableds=true
365
+
366
+ }
367
+ else
368
+ {
369
+ this.disableds=false
370
+
371
+ }
372
+ if(this.submit===true)
373
+ {
374
+ this.submitValue=this.$t('common.confirmed')
375
+ }
376
+ else
377
+ {
378
+ this.submitValue=this.$t('common.confirm')
379
+ }
380
+ },
381
+ methods:{
382
+ dataclick(){
383
+ if(this.checkValue.getAttribute('type') === 'DATE_PICKER')
384
+ {
385
+ for (let i=0;i<this.values.length;i++)
386
+ {
387
+ if(this.values[i].key === this.checkValue.getAttribute('data'))
388
+ {
389
+ if(this.dateValue!=='')
390
+ {
391
+ this.checkValue.innerText=new Date(this.dateValue).Format('MM-dd')
392
+ this.values[i].value=new Date(this.dateValue).getTime()
393
+ }
394
+ else
395
+ {
396
+ this.values[i].value=this.checkValue.innerText
397
+ }
398
+ }
399
+ }
400
+ }
401
+ if(this.checkValue.getAttribute('type') === 'TIME_PICKER')
402
+ {
403
+ for (let i=0;i<this.values.length;i++)
404
+ {
405
+ if(this.values[i].key === this.checkValue.getAttribute('data') )
406
+ {
407
+ if(this.timeValue!=='')
408
+ {
409
+
410
+ this.checkValue.innerText=new Date(this.timeValue).Format('hh:mm')
411
+ this.values[i].value=new Date(this.timeValue).getTime()
412
+ }
413
+ else
414
+ {
415
+ this.values[i].value=this.checkValue.innerText
416
+ }
417
+ }
418
+ }
419
+ }
420
+ if(this.checkValue.getAttribute('type') === 'DATE_TIME_PICKER')
421
+ {
422
+ for (let i=0;i<this.values.length;i++)
423
+ {
424
+ if(this.values[i].key === this.checkValue.getAttribute('data') )
425
+ {
426
+ if(this.dateTimeValue!=='')
427
+ {
428
+
429
+ this.checkValue.innerText=new Date(this.dateTimeValue).Format('yyyy-MM-dd hh:mm')
430
+ this.values[i].value=new Date(this.dateTimeValue).getTime()
431
+ }
432
+ else
433
+ {
434
+ this.values[i].value=this.checkValue.innerText
435
+ }
436
+ }
437
+ }
438
+ }
439
+ },
440
+ clickClick(e){
441
+ if(e.target.onclick!==null)
442
+ {
443
+ let that=this
444
+ window._askEditValue=that._askEditValue;
445
+ }
446
+ },
447
+ _askEditValue(a,b){
448
+ let type=b.getAttribute('type')
449
+ this.checkValue=b
450
+ if(type === 'INPUT')
451
+ {
452
+ this.single=true
453
+ this.date=false
454
+ this.time=false
455
+ this.dateTime=false
456
+ this.input= b.innerText
457
+ }
458
+ if(type === 'DATE_PICKER')
459
+ {
460
+ this.single=false
461
+ this.date=true
462
+ this.time=false
463
+ this.dateTime=false
464
+ this.show=true
465
+ for (let i=0;i<this.values.length;i++)
466
+ {
467
+ if(b.getAttribute('data') === this.values[i].key)
468
+ {
469
+ if(typeof this.values[i].value == 'string')
470
+ {
471
+ this.dateInnerText=Number(this.values[i].value)*1000
472
+ }
473
+ else
474
+ {
475
+ this.dateInnerText=Number(this.values[i].value)
476
+ }
477
+ this.dateValue=new Date(this.dateInnerText).Format("yyyy:MM-dd")
478
+ this.defaultDate=new Date(this.dateInnerText)
479
+ }
480
+ return
481
+ }
482
+
483
+ }
484
+ if(type === 'TIME_PICKER')
485
+ {
486
+ this.single=false
487
+ this.date=false
488
+ this.time=true
489
+ this.dateTime=false
490
+ this.showTimePicker=true
491
+ for (let i=0;i<this.values.length;i++)
492
+ {
493
+ if(b.getAttribute('data') === this.values[i].key)
494
+ {
495
+ let time
496
+ if(typeof this.values[i].value == 'string'){
497
+ time=Number(this.values[i].value)*1000
498
+ }
499
+ else
500
+ {
501
+ time=Number(this.values[i].value)
502
+ }
503
+ if(this.isPhone ===true)
504
+ {
505
+ this.timeValue=new Date(time)
506
+ }
507
+ else
508
+ {
509
+ this.timeValue=new Date(time).Format("yyyy-MM-dd hh:mm")
510
+ }
511
+ }
512
+ }
513
+ }
514
+ if(type === 'DATE_TIME_PICKER')
515
+ {
516
+ this.single=false
517
+ this.date=false
518
+ this.time=false
519
+ this.dateTime=true
520
+ this.showDateTimePicker=true
521
+ for (let i=0;i<this.values.length;i++)
522
+ {
523
+ if(b.getAttribute('data') === this.values[i].key)
524
+ {
525
+ let time
526
+ if(typeof this.values[i].value == 'string'){
527
+ time=Number(this.values[i].value)*1000
528
+ }
529
+ else
530
+ {
531
+ time=Number(this.values[i].value)
532
+ }
533
+ if(this.isPhone===true)
534
+ {
535
+ this.dateTimeValue=new Date(time)
536
+ }
537
+ else
538
+ {
539
+ this.dateTimeValue=new Date(time).Format("yyyy-MM-dd hh:mm:ss")
540
+ }
541
+ }
542
+ }
543
+ }
544
+
545
+ },
546
+ formatter(type, value) {
547
+ // 格式化选择器日期
548
+ if (type === "year") {
549
+ return `${value}年`;
550
+ } else if (type === "month") {
551
+ return `${value}月`;
552
+ } else if (type === "day") {
553
+ return `${value}日`;
554
+ } else if (type === "hour") {
555
+ return `${value}时`;
556
+ } else if (type === "minute") {
557
+ return `${value}分`;
558
+ }
559
+ return value;
560
+ },
561
+ //提交按钮
562
+ submitClick(){
563
+ this.single=false
564
+ this.date=false
565
+ this.time=false
566
+ this.dateTime=false
567
+ let infomation={}
568
+ let obj = {}
569
+ this.values.map(item => {
570
+ obj[item.key] = item
571
+ })
572
+ let result = Object.values(obj)
573
+ let text=this.$el
574
+ let test=text.getElementsByClassName('ask-component-placeholder-span')
575
+ for (let i=0;i<test.length;i++)
576
+ {
577
+ if(test[i].getAttribute('type')==='DATE_PICKER')
578
+ {
579
+ if(test[i].getAttribute('data')===result[i].key)
580
+ {
581
+ if(typeof result[i].value =='number'){
582
+ result[i].value/=1000
583
+ let resu=String(result[i].value)
584
+ result[i].value=resu
585
+ }
586
+ }
587
+ }
588
+ if(test[i].getAttribute('type')==='TIME_PICKER')
589
+ {
590
+ if(test[i].getAttribute('data')===result[i].key)
591
+ {
592
+ if(typeof result[i].value =='number')
593
+ {
594
+ result[i].value/=1000
595
+ let resu=String(result[i].value)
596
+ result[i].value=resu
597
+ }
598
+ }
599
+ }
600
+ if(test[i].getAttribute('type')==='DATE_TIME_PICKER')
601
+ {
602
+ if(test[i].getAttribute('data')===result[i].key)
603
+ {
604
+ if(typeof result[i].value =='number')
605
+ {
606
+ result[i].value/=1000
607
+ let resu=String(result[i].value)
608
+ result[i].value=resu
609
+ }
610
+ }
611
+ }
612
+ }
613
+ infomation['values']=result
614
+ infomation['goToAction']=this.text.goToAction
615
+ let innerhtml=this.$el
616
+ infomation['template']=innerhtml.querySelector('#html').innerHTML
617
+ infomation['apiKey']=this.text.apiKey
618
+ this.$emit('submitClick',infomation,this.text.apiKey)
619
+ this.submitValue=this.$t('common.confirmed')
620
+ this.disableds=true
621
+ },
622
+ addZero(i){
623
+ if (i<10) {
624
+ i="0" + i;
625
+ }
626
+ return i;
627
+ },
628
+ formatDate(date) {
629
+ if(typeof date == 'object')
630
+ {
631
+ const dateTime = new Date(date[0])
632
+ const dateTime1=new Date(date[1])
633
+ 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())}`;
634
+ }
635
+ else
636
+ {
637
+ const dateTime = new Date(date)
638
+ return `${dateTime.getMonth() + 1}月${dateTime.getDate()}日`;
639
+ }
640
+
641
+ },
642
+ //格式成时间
643
+ formatDate1(date){
644
+ const dateTime = new Date(date)
645
+ return `${this.addZero(dateTime.getHours())}:${this.addZero(dateTime.getMinutes())}`;
646
+ },
647
+ //格式成日期
648
+ formatDate2(date){
649
+ const dateTime = new Date(date)
650
+ return `${dateTime.getMonth() + 1} - ${dateTime.getDate()}`;
651
+ },
652
+ //日期范围
653
+ formatDate3(date){
654
+ const dateTime = new Date(date[0])
655
+ const dateTime1=new Date(date[1])
656
+ return `${dateTime.getMonth() + 1}月 ${dateTime.getDate()}日 - ${dateTime1.getMonth() + 1}月 ${dateTime1.getDate()}日`;
657
+ },
658
+ //时间范围
659
+ formatDate4(date){
660
+ const dateTime = new Date(date[0])
661
+ const dateTime1=new Date(date[1])
662
+ return `${dateTime.getHours()}: ${dateTime.getMinutes()} - ${dateTime1.getHours()}: ${dateTime1.getMinutes()}`;
663
+ },
664
+ testClick(value){
665
+ if(this.checkValue.getAttribute('type') === 'INPUT')
666
+ {
667
+ for (let i=0;i<this.values.length;i++)
668
+ {
669
+ if(this.values[i].key === this.checkValue.getAttribute('data') )
670
+ {
671
+ this.checkValue.innerText=value
672
+ this.values[i].value=this.checkValue.innerText
673
+ }
674
+ }
675
+ }
676
+ },
677
+ inputBlur(){
678
+ console.debug('inputBlur')
679
+ this.single=false
680
+ },
681
+ quedingClick(){
682
+ if(this.checkValue.getAttribute('type') === 'INPUT')
683
+ {
684
+ for (let i=0;i<this.values.length;i++)
685
+ {
686
+ if(this.values[i].key === this.checkValue.getAttribute('data') )
687
+ {
688
+ if(this.input!=='')
689
+ {
690
+ this.checkValue.innerText=this.input
691
+ }
692
+ this.values[i].value=this.checkValue.innerText
693
+ }
694
+ }
695
+ this.single = false
696
+ this.input=''
697
+ }
698
+ if(this.checkValue.getAttribute('type') === 'DATE_PICKER')
699
+
700
+ {
701
+ for (let i=0;i<this.values.length;i++)
702
+ {
703
+ if(this.values[i].key === this.checkValue.getAttribute('data'))
704
+ {
705
+ if(this.dateValue!=='')
706
+ {
707
+ this.checkValue.innerText=new Date(this.dateValue).Format('MM-dd')
708
+ this.values[i].value=new Date(this.dateValue).getTime()
709
+ }
710
+ else
711
+ {
712
+ this.values[i].value=this.checkValue.innerText
713
+ }
714
+ }
715
+ }
716
+ this.date = false
717
+ this.dateValue=''
718
+ }
719
+ if(this.checkValue.getAttribute('type') === 'TIME_PICKER')
720
+ {
721
+ for (let i=0;i<this.values.length;i++)
722
+ {
723
+ if(this.values[i].key === this.checkValue.getAttribute('data') )
724
+ {
725
+ if(this.timeValue!=='')
726
+ {
727
+
728
+ this.checkValue.innerText=new Date(this.timeValue).Format('hh:mm')
729
+ this.values[i].value=new Date(this.timeValue).getTime()
730
+ }
731
+ else
732
+ {
733
+ this.values[i].value=this.checkValue.innerText
734
+ }
735
+ }
736
+ }
737
+ this.time = false
738
+ this.timeValue=''
739
+ }
740
+ if(this.checkValue.getAttribute('type') === 'DATE_TIME_PICKER')
741
+ {
742
+ for (let i=0;i<this.values.length;i++)
743
+ {
744
+ if(this.values[i].key === this.checkValue.getAttribute('data') )
745
+ {
746
+ if(this.dateTimeValue!=='')
747
+ {
748
+
749
+ this.checkValue.innerText=new Date(this.dateTimeValue).Format('yyyy-MM-dd hh:mm')
750
+ this.values[i].value=new Date(this.dateTimeValue).getTime()
751
+ }
752
+ else
753
+ {
754
+ this.values[i].value=this.checkValue.innerText
755
+ }
756
+ }
757
+ }
758
+ this.dateTime = false
759
+ this.dateTimeValue=''
760
+ }
761
+
762
+ },
763
+ isMobile() {
764
+ 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);
765
+ if (flag) {
766
+ this.isPhone=true
767
+ }
768
+ else
769
+ {
770
+ this.isCompany=true
771
+
772
+ }
773
+ },
774
+ onConfirmDateTime(){
775
+ if(this.checkValue.getAttribute('type') === 'DATE_TIME_PICKER')
776
+ {
777
+ for (let i=0;i<this.values.length;i++)
778
+ {
779
+ if(this.values[i].key === this.checkValue.getAttribute('data') )
780
+ {
781
+ if(this.dateTimeValue!=='')
782
+ {
783
+
784
+ this.checkValue.innerText=new Date(this.dateTimeValue).Format('yyyy-MM-dd hh:mm')
785
+ this.values[i].value=new Date(this.dateTimeValue).getTime()
786
+ }
787
+ else
788
+ {
789
+ this.values[i].value=this.checkValue.innerText
790
+ }
791
+ }
792
+ }
793
+ }
794
+ this.showDateTimePicker = false;
795
+ },
796
+
797
+ onConfirm(date) {
798
+ this.show = false;
799
+ if(this.checkValue.getAttribute('type') === 'DATE_PICKER')
800
+
801
+ {
802
+ for (let i=0;i<this.values.length;i++)
803
+ {
804
+ if(this.values[i].key === this.checkValue.getAttribute('data'))
805
+ {
806
+ if(date!=='')
807
+ {
808
+ this.checkValue.innerText=new Date(date).Format('MM-dd')
809
+ this.values[i].value=new Date(date).getTime()
810
+ }
811
+ else
812
+ {
813
+ this.values[i].value=this.checkValue.innerText
814
+ }
815
+ }
816
+ }
817
+ this.date = false
818
+ this.dateValue=''
819
+ }
820
+
821
+ },
822
+ onConfirmTime(){
823
+ this.showTimePicker=false
824
+ if(this.checkValue.getAttribute('type') === 'TIME_PICKER')
825
+ {
826
+ for (let i=0;i<this.values.length;i++)
827
+ {
828
+ if(this.values[i].key === this.checkValue.getAttribute('data') )
829
+ {
830
+ if(this.timeValue!=='')
831
+ {
832
+
833
+ this.checkValue.innerText=new Date(this.timeValue).Format('hh:mm')
834
+ this.values[i].value=new Date(this.timeValue).getTime()
835
+ }
836
+ else
837
+ {
838
+ this.values[i].value=this.checkValue.innerText
839
+ }
840
+ }
841
+ }
842
+ }
843
+ }
844
+ }
845
+ }
846
+ </script>
847
+
848
+
849
+ <style lang="less">
850
+ @import "../../assets/less/common.css";
851
+ #textMessage{
852
+ min-width: 200px;
853
+ .editMessage{
854
+ display: flex;
855
+ justify-content: space-between;
856
+ margin-top: 10px;
857
+ border-top: 1px dashed #ebebeb;
858
+ }
859
+ #submit{
860
+ margin-top: 10px;
861
+ display: flex;
862
+ align-items: center;
863
+ justify-content: center;
864
+ .el-button{
865
+ border: 1px solid #BBCDFF;
866
+ border-radius: 14px;
867
+ background-color: white;
868
+ color: #366aff;
869
+ font-weight: 400;
870
+ }
871
+ .el-button--small{
872
+ padding: 9px 30px;
873
+ font-size: 1em;
874
+ }
875
+ }
876
+ #html{
877
+ p{
878
+ color:#A9B3C6;
879
+ }
880
+ .ask-component-placeholder-icon{
881
+ padding-left: 12px;
882
+ color: #366aff;
883
+ font-size: 18px;
884
+ }
885
+ .ask-component-placeholder-span{
886
+ color: #616161!important;
887
+ }
888
+ }
889
+ }
890
+ .remPhoneClass{
891
+ margin: 0 auto;
892
+ /*width: 80vw;*/
893
+ .inputClass{
894
+ margin-top: 8px;
895
+ width: 100%;
896
+ .el-input__inner{
897
+ border-radius: 9px;
898
+ }
899
+ }
900
+ .htmlClass{
901
+ padding: 4px 0;
902
+ }
903
+
904
+ }
905
+ .remCompanyClass{
906
+
907
+ margin: 0 auto;
908
+ /*width: 300px;*/
909
+ .inputClass{
910
+ padding: 10px 0 10px 0;
911
+ width: 100%;
912
+ .el-input__inner{
913
+ border-radius: 9px;
914
+ }
915
+ }
916
+
917
+
918
+ }
919
+ .van-cell::after{
920
+ content: none!important;
921
+ }
922
+ i{
923
+ cursor: pointer;
924
+ }
925
+ .notClickClass{
926
+ pointer-events: none;
927
+ }
928
+ </style>