askbot-dragon 0.9.11 → 0.9.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 (71) 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 +55 -55
  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 +3668 -1557
  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 +229 -229
  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/file/AliyunOssComponents.vue +108 -108
  39. package/src/components/formTemplate.vue +3101 -2888
  40. package/src/components/loadingProcess.vue +164 -164
  41. package/src/components/message/ActionAlertIframe.vue +112 -112
  42. package/src/components/message/ShopMessage.vue +164 -164
  43. package/src/components/message/TextMessage.vue +924 -924
  44. package/src/components/message/TicketMessage.vue +177 -177
  45. package/src/components/message/swiper/index.js +4 -4
  46. package/src/components/message/swiper/ticketSwiper.vue +502 -502
  47. package/src/components/message/swiper/ticketSwiperItem.vue +61 -61
  48. package/src/components/msgLoading.vue +231 -231
  49. package/src/components/myPopup.vue +70 -70
  50. package/src/components/popup.vue +227 -227
  51. package/src/components/recommend.vue +89 -89
  52. package/src/components/selector/hOption.vue +20 -20
  53. package/src/components/selector/hSelector.vue +199 -199
  54. package/src/components/selector/hWrapper.vue +216 -216
  55. package/src/components/senderMessagePlatform.vue +50 -0
  56. package/src/components/source/BotMessage.vue +24 -24
  57. package/src/components/source/CustomMessage.vue +24 -24
  58. package/src/components/test.vue +260 -260
  59. package/src/components/tree.vue +247 -185
  60. package/src/components/utils/AliyunIssUtil.js +72 -72
  61. package/src/components/utils/ckeditor.js +123 -123
  62. package/src/components/utils/command.js +87 -87
  63. package/src/components/utils/editing.js +11 -11
  64. package/src/components/utils/format_date.js +25 -25
  65. package/src/components/utils/index.js +6 -6
  66. package/src/components/utils/math_utils.js +29 -15
  67. package/src/components/utils/plugin-image.js +11 -11
  68. package/src/components/utils/toolbar-ui.js +41 -41
  69. package/src/components/voiceComponent.vue +119 -119
  70. package/src/main.js +45 -45
  71. package/vue.config.js +47 -47
@@ -1,230 +1,230 @@
1
- <template>
2
- <div class="association-intention">
3
- <div v-if=" (msgType === 'answer_welcofmetext' || msgType === 'answer_text') && !(msg.recommend&& msg.recommend.status)">
4
- <p v-html="msg.content.replace(/\#[\u4E00-\u9FA5]{1,3}\;/gi, emotion)"></p>
5
- </div>
6
- <div v-if=" (msgType === 'answer_welcofmetext' || msgType === 'answer_text') && (msg.recommend&& msg.recommend.status)">
7
- <p v-html="msg.content.replace(/\#[\u4E00-\u9FA5]{1,3}\;/gi, emotion)" class="answer-rich-text"></p>
8
- <Recommend :msg="msg" @onRadioClickReco="onRadioClickReco"></Recommend>
9
- </div>
10
- <div v-if="msg.type === 'answer_rich_text' && !(msg.content.recommend && msg.content.recommend.status)">
11
- <p v-html="$options.filters.imageStyle(msg.content.html)"></p>
12
- </div>
13
- <div v-else-if="msg.type == 'answer_rich_text' && (msg.content.recommend && msg.content.recommend.status)">
14
- <p v-html="$options.filters.imageStyle(msg.content.html)" class="answer-rich-text"></p>
15
- <Recommend :msg="msg.content" @onRadioClickReco="onRadioClickReco"></Recommend>
16
- </div>
17
- <div v-else-if="msgType === 'answer_image'" >
18
- <div
19
- class="association-img"
20
- v-if="msg.content.url"
21
- >
22
- <!-- LPY 原生宽度适配有bug,弃用 -->
23
- <img
24
- :src="msg.content.url"
25
- style="height: auto; width: calc(100vw - 137px);border-radius: 25px;max-width: 230px"
26
- @click="onImageClick(msg.content.url)"
27
- class="img-class"
28
- />
29
- </div>
30
- <Recommend :msg="msg" @onRadioClickReco="onRadioClickReco"></Recommend>
31
- </div>
32
- <div v-else-if="msgType === 'answer_video' || msgType === 'user_video' || msgType === 'VIDEO'">
33
- <div class="association-img" v-if="msg.content.url">
34
- <ask-video :msg="msg" :url="msg.content.url" :local-url="msg.content.localUrl"
35
- :progress="msg.content.progress"></ask-video>
36
- </div>
37
- <Recommend :msg="msg" @onRadioClickReco="onRadioClickReco"></Recommend>
38
- </div>
39
- </div>
40
- </template>
41
-
42
- <script>
43
- import askVideo from "./askVideo";
44
- import Recommend from "./recommend";
45
- export default {
46
- name: "associationIntention",
47
- components: {Recommend, askVideo},
48
- props: ["msg",'msgType','isOpen'],
49
- filters: {
50
- imageStyle: function (html) {
51
- //富文本内图片自适应高度宽度
52
- const regex = new RegExp("<img", "gi");
53
- return html.replace(
54
- regex,
55
- "<img style='max-width: 230px;border-radius: 25px;' onclick='imageOnClick(this)'"
56
- );
57
- },
58
- },
59
- mounted() {
60
- },
61
- methods:{
62
- // 将匹配结果替换表情图片
63
- emotion(res) {
64
- let word = res.replace(/#|;/gi, "");
65
- const list = [
66
- "微笑",
67
- "撇嘴",
68
- "色",
69
- "发呆",
70
- "得意",
71
- "流泪",
72
- "害羞",
73
- "闭嘴",
74
- "睡",
75
- "大哭",
76
- "尴尬",
77
- "发怒",
78
- "调皮",
79
- "呲牙",
80
- "惊讶",
81
- "难过",
82
- "酷",
83
- "冷汗",
84
- "抓狂",
85
- "吐",
86
- "偷笑",
87
- "可爱",
88
- "白眼",
89
- "傲慢",
90
- "饥饿",
91
- "困",
92
- "惊恐",
93
- "流汗",
94
- "憨笑",
95
- "大兵",
96
- "奋斗",
97
- "咒骂",
98
- "疑问",
99
- "嘘",
100
- "晕",
101
- "折磨",
102
- "衰",
103
- "骷髅",
104
- "敲打",
105
- "再见",
106
- "擦汗",
107
- "抠鼻",
108
- "鼓掌",
109
- "糗大了",
110
- "坏笑",
111
- "左哼哼",
112
- "右哼哼",
113
- "哈欠",
114
- "鄙视",
115
- "委屈",
116
- "快哭了",
117
- "阴险",
118
- "亲亲",
119
- "吓",
120
- "可怜",
121
- "菜刀",
122
- "西瓜",
123
- "啤酒",
124
- "篮球",
125
- "乒乓",
126
- "咖啡",
127
- "饭",
128
- "猪头",
129
- "玫瑰",
130
- "凋谢",
131
- "示爱",
132
- "爱心",
133
- "心碎",
134
- "蛋糕",
135
- "闪电",
136
- "炸弹",
137
- "刀",
138
- "足球",
139
- "瓢虫",
140
- "便便",
141
- "月亮",
142
- "太阳",
143
- "礼物",
144
- "拥抱",
145
- "强",
146
- "弱",
147
- "握手",
148
- "胜利",
149
- "抱拳",
150
- "勾引",
151
- "拳头",
152
- "差劲",
153
- "爱你",
154
- "不",
155
- "可以",
156
- "爱情",
157
- "飞吻",
158
- "跳跳",
159
- "发抖",
160
- "怄火",
161
- "转圈",
162
- "磕头",
163
- "回头",
164
- "跳绳",
165
- "挥手",
166
- "激动",
167
- "街舞",
168
- "献吻",
169
- "左太极",
170
- "右太极",
171
- ];
172
- let index = list.indexOf(word);
173
- return `<img height="20px" src="https://guoranim.oss-cn-beijing.aliyuncs.com/emoji/${
174
- index + 1
175
- }.png" align="middle">`;
176
- },
177
- onRadioClickReco(id, name, apikey) {
178
- this.$emit("onRadioClick", id, name, apikey);
179
- },
180
- onImageClick(url){
181
- this.$emit('onImageClick',url)
182
- },
183
- },
184
- watch:{
185
- isOpen:{
186
- handler(value){
187
- if (value){
188
- let reg = this.msg.content.html
189
- if (reg){
190
- reg = reg.replace('<a',"<span class='isReplace'")
191
- reg = reg.replace('</a>','</span>')
192
- console.debug('reg',reg)
193
- this.msg.content.html = reg
194
- }
195
-
196
- }
197
- else {
198
- let reg = this.msg.content.html
199
- console.debug('reg',reg)
200
- if (reg){
201
- reg = reg.replace("<span class='isReplace'","<a download")
202
- let reg2 = reg
203
- reg2 = reg2.replace('</span>','</a>')
204
- this.msg.content.html = reg2
205
- console.debug('reg',reg2)
206
- }
207
- }
208
- }
209
- }
210
- }
211
- }
212
- </script>
213
-
214
-
215
- <style scoped lang="less">
216
- @import "../assets/less/converSationContainer/common";
217
- .association-intention{
218
- .association-img{
219
- /*display: flex;
220
- align-items: center;
221
- justify-content: center;*/
222
-
223
- }
224
- .answer-rich-text{
225
- /*padding-bottom: 10px;
226
- border-bottom: 1px solid #EEEEEE;*/
227
- }
228
- }
229
-
1
+ <template>
2
+ <div class="association-intention">
3
+ <div v-if=" (msgType === 'answer_welcofmetext' || msgType === 'answer_text') && !(msg.recommend&& msg.recommend.status)">
4
+ <p v-html="msg.content.replace(/\#[\u4E00-\u9FA5]{1,3}\;/gi, emotion)"></p>
5
+ </div>
6
+ <div v-if=" (msgType === 'answer_welcofmetext' || msgType === 'answer_text') && (msg.recommend&& msg.recommend.status)">
7
+ <p v-html="msg.content.replace(/\#[\u4E00-\u9FA5]{1,3}\;/gi, emotion)" class="answer-rich-text"></p>
8
+ <Recommend :msg="msg" @onRadioClickReco="onRadioClickReco"></Recommend>
9
+ </div>
10
+ <div v-if="msg.type === 'answer_rich_text' && !(msg.content.recommend && msg.content.recommend.status)">
11
+ <p v-html="$options.filters.imageStyle(msg.content.html)"></p>
12
+ </div>
13
+ <div v-else-if="msg.type == 'answer_rich_text' && (msg.content.recommend && msg.content.recommend.status)">
14
+ <p v-html="$options.filters.imageStyle(msg.content.html)" class="answer-rich-text"></p>
15
+ <Recommend :msg="msg.content" @onRadioClickReco="onRadioClickReco"></Recommend>
16
+ </div>
17
+ <div v-else-if="msgType === 'answer_image'" >
18
+ <div
19
+ class="association-img"
20
+ v-if="msg.content.url"
21
+ >
22
+ <!-- LPY 原生宽度适配有bug,弃用 -->
23
+ <img
24
+ :src="msg.content.url"
25
+ style="height: auto; width: calc(100vw - 137px);border-radius: 25px;max-width: 230px"
26
+ @click="onImageClick(msg.content.url)"
27
+ class="img-class"
28
+ />
29
+ </div>
30
+ <Recommend :msg="msg" @onRadioClickReco="onRadioClickReco"></Recommend>
31
+ </div>
32
+ <div v-else-if="msgType === 'answer_video' || msgType === 'user_video' || msgType === 'VIDEO'">
33
+ <div class="association-img" v-if="msg.content.url">
34
+ <ask-video :msg="msg" :url="msg.content.url" :local-url="msg.content.localUrl"
35
+ :progress="msg.content.progress"></ask-video>
36
+ </div>
37
+ <Recommend :msg="msg" @onRadioClickReco="onRadioClickReco"></Recommend>
38
+ </div>
39
+ </div>
40
+ </template>
41
+
42
+ <script>
43
+ import askVideo from "./askVideo";
44
+ import Recommend from "./recommend";
45
+ export default {
46
+ name: "associationIntention",
47
+ components: {Recommend, askVideo},
48
+ props: ["msg",'msgType','isOpen'],
49
+ filters: {
50
+ imageStyle: function (html) {
51
+ //富文本内图片自适应高度宽度
52
+ const regex = new RegExp("<img", "gi");
53
+ return html.replace(
54
+ regex,
55
+ "<img style='max-width: 230px;border-radius: 25px;' onclick='imageOnClick(this)'"
56
+ );
57
+ },
58
+ },
59
+ mounted() {
60
+ },
61
+ methods:{
62
+ // 将匹配结果替换表情图片
63
+ emotion(res) {
64
+ let word = res.replace(/#|;/gi, "");
65
+ const list = [
66
+ "微笑",
67
+ "撇嘴",
68
+ "色",
69
+ "发呆",
70
+ "得意",
71
+ "流泪",
72
+ "害羞",
73
+ "闭嘴",
74
+ "睡",
75
+ "大哭",
76
+ "尴尬",
77
+ "发怒",
78
+ "调皮",
79
+ "呲牙",
80
+ "惊讶",
81
+ "难过",
82
+ "酷",
83
+ "冷汗",
84
+ "抓狂",
85
+ "吐",
86
+ "偷笑",
87
+ "可爱",
88
+ "白眼",
89
+ "傲慢",
90
+ "饥饿",
91
+ "困",
92
+ "惊恐",
93
+ "流汗",
94
+ "憨笑",
95
+ "大兵",
96
+ "奋斗",
97
+ "咒骂",
98
+ "疑问",
99
+ "嘘",
100
+ "晕",
101
+ "折磨",
102
+ "衰",
103
+ "骷髅",
104
+ "敲打",
105
+ "再见",
106
+ "擦汗",
107
+ "抠鼻",
108
+ "鼓掌",
109
+ "糗大了",
110
+ "坏笑",
111
+ "左哼哼",
112
+ "右哼哼",
113
+ "哈欠",
114
+ "鄙视",
115
+ "委屈",
116
+ "快哭了",
117
+ "阴险",
118
+ "亲亲",
119
+ "吓",
120
+ "可怜",
121
+ "菜刀",
122
+ "西瓜",
123
+ "啤酒",
124
+ "篮球",
125
+ "乒乓",
126
+ "咖啡",
127
+ "饭",
128
+ "猪头",
129
+ "玫瑰",
130
+ "凋谢",
131
+ "示爱",
132
+ "爱心",
133
+ "心碎",
134
+ "蛋糕",
135
+ "闪电",
136
+ "炸弹",
137
+ "刀",
138
+ "足球",
139
+ "瓢虫",
140
+ "便便",
141
+ "月亮",
142
+ "太阳",
143
+ "礼物",
144
+ "拥抱",
145
+ "强",
146
+ "弱",
147
+ "握手",
148
+ "胜利",
149
+ "抱拳",
150
+ "勾引",
151
+ "拳头",
152
+ "差劲",
153
+ "爱你",
154
+ "不",
155
+ "可以",
156
+ "爱情",
157
+ "飞吻",
158
+ "跳跳",
159
+ "发抖",
160
+ "怄火",
161
+ "转圈",
162
+ "磕头",
163
+ "回头",
164
+ "跳绳",
165
+ "挥手",
166
+ "激动",
167
+ "街舞",
168
+ "献吻",
169
+ "左太极",
170
+ "右太极",
171
+ ];
172
+ let index = list.indexOf(word);
173
+ return `<img height="20px" src="https://guoranim.oss-cn-beijing.aliyuncs.com/emoji/${
174
+ index + 1
175
+ }.png" align="middle">`;
176
+ },
177
+ onRadioClickReco(id, name, apikey) {
178
+ this.$emit("onRadioClick", id, name, apikey);
179
+ },
180
+ onImageClick(url){
181
+ this.$emit('onImageClick',url)
182
+ },
183
+ },
184
+ watch:{
185
+ isOpen:{
186
+ handler(value){
187
+ if (value){
188
+ let reg = this.msg.content.html
189
+ if (reg){
190
+ reg = reg.replace('<a',"<span class='isReplace'")
191
+ reg = reg.replace('</a>','</span>')
192
+ console.debug('reg',reg)
193
+ this.msg.content.html = reg
194
+ }
195
+
196
+ }
197
+ else {
198
+ let reg = this.msg.content.html
199
+ console.debug('reg',reg)
200
+ if (reg){
201
+ reg = reg.replace("<span class='isReplace'","<a download")
202
+ let reg2 = reg
203
+ reg2 = reg2.replace('</span>','</a>')
204
+ this.msg.content.html = reg2
205
+ console.debug('reg',reg2)
206
+ }
207
+ }
208
+ }
209
+ }
210
+ }
211
+ }
212
+ </script>
213
+
214
+
215
+ <style scoped lang="less">
216
+ @import "../assets/less/converSationContainer/common";
217
+ .association-intention{
218
+ .association-img{
219
+ /*display: flex;
220
+ align-items: center;
221
+ justify-content: center;*/
222
+
223
+ }
224
+ .answer-rich-text{
225
+ /*padding-bottom: 10px;
226
+ border-bottom: 1px solid #EEEEEE;*/
227
+ }
228
+ }
229
+
230
230
  </style>
@@ -1,69 +1,69 @@
1
- <template>
2
- <div class="bot-action-satisfator">
3
- <div class="replay">
4
- <p class="reply-text" v-html="msg.content.reply_text"></p>
5
- <div v-if="
6
- msg.content.reply_options != null &&
7
- msg.content.reply_options.length > 0
8
- ">
9
- <p
10
-
11
- v-for="(option, index) in msg.content.reply_options"
12
- class="statisfaction-item"
13
- :key="index"
14
- @click="
15
- onSatisfactionClick(
16
- 'user_action_to_unsatisfactory',
17
- option.name,
18
- option.answer, null,msg.apiKey
19
- )
20
- "
21
- >
22
- {{ option.name }}<i class="arsenal_icon arsenalangle-right-solid"></i>
23
- </p>
24
- </div>
25
-
26
- </div>
27
- </div>
28
- </template>
29
-
30
- <script>
31
- export default {
32
- name: "botActionSatisfactor",
33
- props:['msg'],
34
- methods:{
35
- onSatisfactionClick(type, choose, answer, answerRadio,answerApiKey) {
36
- this.$emit("onSatisfactionClick", type, choose, answer, answerRadio,answerApiKey);
37
- },
38
- }
39
- }
40
- </script>
41
-
42
- <style scoped lang="less">
43
- @import "../assets/less/converSationContainer/common";
44
- .bot-action-satisfator{
45
- .reply-text{
46
- word-wrap: break-word;
47
- word-break: break-all;
48
- overflow: hidden;
49
- padding: 8px 0 10px 0;
50
- height: auto;
51
- border-bottom: 1px solid #EEEEEE;
52
- }
53
- .statisfaction-item{
54
- padding: 8px 0;
55
- height: 25px;
56
- line-height: 25px;
57
- background-color: #ffffff;
58
- color: #366aff;
59
- cursor:pointer;
60
- display: flex;
61
- align-items: center;
62
- justify-content: space-between;
63
- }
64
- .end{
65
- border-bottom-left-radius: 25px !important;
66
- border-bottom-right-radius: 25px !important;
67
- }
68
- }
1
+ <template>
2
+ <div class="bot-action-satisfator">
3
+ <div class="replay">
4
+ <p class="reply-text" v-html="msg.content.reply_text"></p>
5
+ <div v-if="
6
+ msg.content.reply_options != null &&
7
+ msg.content.reply_options.length > 0
8
+ ">
9
+ <p
10
+
11
+ v-for="(option, index) in msg.content.reply_options"
12
+ class="statisfaction-item"
13
+ :key="index"
14
+ @click="
15
+ onSatisfactionClick(
16
+ 'user_action_to_unsatisfactory',
17
+ option.name,
18
+ option.answer, null,msg.apiKey
19
+ )
20
+ "
21
+ >
22
+ {{ option.name }}<i class="arsenal_icon arsenalangle-right-solid"></i>
23
+ </p>
24
+ </div>
25
+
26
+ </div>
27
+ </div>
28
+ </template>
29
+
30
+ <script>
31
+ export default {
32
+ name: "botActionSatisfactor",
33
+ props:['msg'],
34
+ methods:{
35
+ onSatisfactionClick(type, choose, answer, answerRadio,answerApiKey) {
36
+ this.$emit("onSatisfactionClick", type, choose, answer, answerRadio,answerApiKey);
37
+ },
38
+ }
39
+ }
40
+ </script>
41
+
42
+ <style scoped lang="less">
43
+ @import "../assets/less/converSationContainer/common";
44
+ .bot-action-satisfator{
45
+ .reply-text{
46
+ word-wrap: break-word;
47
+ word-break: break-all;
48
+ overflow: hidden;
49
+ padding: 8px 0 10px 0;
50
+ height: auto;
51
+ border-bottom: 1px solid #EEEEEE;
52
+ }
53
+ .statisfaction-item{
54
+ padding: 8px 0;
55
+ height: 25px;
56
+ line-height: 25px;
57
+ background-color: #ffffff;
58
+ color: #366aff;
59
+ cursor:pointer;
60
+ display: flex;
61
+ align-items: center;
62
+ justify-content: space-between;
63
+ }
64
+ .end{
65
+ border-bottom-left-radius: 25px !important;
66
+ border-bottom-right-radius: 25px !important;
67
+ }
68
+ }
69
69
  </style>