askbot-dragon 1.6.24-beta → 1.6.25-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.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "askbot-dragon",
3
- "version": "1.6.24-beta",
3
+ "version": "1.6.25-beta",
4
4
  "scripts": {
5
5
  "serve": "vue-cli-service serve",
6
6
  "build": "vue-cli-service build",
@@ -1,6 +1,7 @@
1
1
  <!-- 消息记录容器 -->
2
2
  <template>
3
3
  <div id="conversation">
4
+ <answer-radio :msg="answerRadiosPri"></answer-radio>
4
5
  <!-- <asser-deatils></asser-deatils> -->
5
6
  <!-- <msg-loading v-if="inLoading"></msg-loading>
6
7
  <div style="position: relative" class="img_div">
@@ -4751,6 +4752,74 @@ export default {
4751
4752
  }
4752
4753
  },
4753
4754
  answerRadios: { "content": { "options": [{ "scope": "KNOWLEDGE", "name": "本文提供了什么内容?", "value": "64915d6e098ec248701da267" }, { "scope": "KNOWLEDGE", "name": "什么是街舞穿搭指南?", "value": "64915d6e098ec248701da267" }, { "scope": "KNOWLEDGE", "name": "为什么街舞爱好者需要关注本文?", "value": "64915d6e098ec248701da267" }], "description": "了解更多", "isKnowledgeSummary": true }, "id": "knowledgeRecdNodeId", "type": "answer_radio", "sessionId": 1687251699065, "keyId": "139480f2-5af1-44fd-a7bd-a73dd7b566b7_________", "isKnowledgeSummary": true },
4755
+ answerRadiosPri: {
4756
+ "refAttrId": null,
4757
+ "createTime": null,
4758
+ "intentId": null,
4759
+ "refApiKey": null,
4760
+ "updateTime": null,
4761
+ "id": "recdNodeId",
4762
+ "refBotVersion": null,
4763
+ "type": "answer_radio",
4764
+ "nodeId": null,
4765
+ "version": null,
4766
+ "content": {
4767
+ "lastOptionName": "以上都不是",
4768
+ "options": [
4769
+ {
4770
+ "answerId": null,
4771
+ "apiKey": "14f02c001a29434d9aaa2c2e581a1a17",
4772
+ "scope": "INTENT",
4773
+ "name": "打印机卡纸怎么办",
4774
+ "value": "155539"
4775
+ },
4776
+ {
4777
+ "answerId": null,
4778
+ "apiKey": "14f02c001a29434d9aaa2c2e581a1a17",
4779
+ "scope": "INTENT",
4780
+ "name": "打印机打印模糊",
4781
+ "value": "155540"
4782
+ },
4783
+ {
4784
+ "answerId": null,
4785
+ "apiKey": "14f02c001a29434d9aaa2c2e581a1a17",
4786
+ "scope": "INTENT",
4787
+ "name": "SAP系统输入编码系统显示报错",
4788
+ "value": "155541"
4789
+ },
4790
+ {
4791
+ "answerId": null,
4792
+ "apiKey": "14f02c001a29434d9aaa2c2e581a1a17",
4793
+ "scope": "INTENT",
4794
+ "name": "合同已经上传影像归档了,但是在CE中还是关联不到合同",
4795
+ "value": "155542"
4796
+ },
4797
+ {
4798
+ "answerId": null,
4799
+ "apiKey": "14f02c001a29434d9aaa2c2e581a1a17",
4800
+ "scope": "INTENT",
4801
+ "name": "如何查询社保缴费基数",
4802
+ "value": "155543"
4803
+ },
4804
+ {
4805
+ "answerId": null,
4806
+ "apiKey": "14f02c001a29434d9aaa2c2e581a1a17",
4807
+ "scope": "INTENT",
4808
+ "name": "如何查询公积金缴费基数",
4809
+ "value": "155544"
4810
+ },
4811
+ {
4812
+ "answerId": null,
4813
+ "apiKey": "14f02c001a29434d9aaa2c2e581a1a17",
4814
+ "scope": "INTENT",
4815
+ "name": "以上都不是",
4816
+ "value": "155533"
4817
+ }
4818
+ ],
4819
+ "description": "猜您可能想问:"
4820
+ },
4821
+ "refAttrVersion": null
4822
+ },
4754
4823
  htmlContainer: '<input placeholder="请输入"></input>',
4755
4824
  isOpen: true,
4756
4825
  chatMessageList:[
@@ -1,62 +1,107 @@
1
1
  <template>
2
2
  <div id="answer-radio">
3
- <p class="radio-description" v-html="msg.content.description" v-if="msg.content.description && !msg.content.isKnowledgeSummary"></p>
3
+ <p class="radio-description" v-html="msg.content.description"
4
+ v-if="msg.content.description && !msg.content.isKnowledgeSummary"></p>
4
5
  <div class="bottom-link" v-if="msg.content.description && !msg.content.isKnowledgeSummary"></div>
5
- <div :class="['options-list',msg.content.isKnowledgeSummary ? 'isKnowledgeSummary' : '']">
6
+ <div :class="['options-list', msg.content.isKnowledgeSummary ? 'isKnowledgeSummary' : '']">
6
7
  <div v-if="msg.content.isKnowledgeSummary" class="tips">AI为您推荐了以下内容</div>
7
- <div
8
- v-for="(option, index) in msg.content.options"
9
- class="options-item"
10
- :class="index!==msg.content.options.length -1?'recommend-item':'last-item'"
11
- :key="msg.nodeId + '_' + index"
12
- @click="radioClick(msg,option,index)">
13
-
14
- <!-- <el-tooltip class="item" effect="dark" :content="option.name" placement="bottom-start" v-if="!isMobile">
8
+ <div v-for="(option, index) in formatOptions[activeIndex]" class="options-item"
9
+ :class="index !== msg.content.options.length - 1 ? 'recommend-item' : 'last-item'" :key="msg.nodeId + '_' + index"
10
+ @click="radioClick(msg, option, index)">
11
+
12
+ <!-- <el-tooltip class="item" effect="dark" :content="option.name" placement="bottom-start" v-if="!isMobile">
15
13
  <span > {{ option.name }}</span>
16
14
  </el-tooltip> -->
17
- <span> {{ option.name }}</span>
15
+ <span> {{ option.name }}</span>
18
16
  <i class="arsenal_icon arsenalangle-right-solid"></i>
19
17
  </div>
20
18
  </div>
19
+ <div v-if="showPage" class="switch-page">
20
+ <span @click="changeActivePage" class="switch-page-btn">换一批</span>
21
+ </div>
21
22
  </div>
22
23
  </template>
23
24
 
24
25
  <script>
25
26
  export default {
26
- name: "answerRadio",
27
- data(){
28
- return{
29
- isMobile:false,
30
- }
31
- },
32
- props:['msg'],
33
- mounted(){
34
- console.log(this.msg,'msg');
35
- this.judgeIsMobile();
36
- },
37
- methods:{
38
- judgeIsMobile() {
39
- let flag = navigator.userAgent.match(
40
- /(phone|pad|pod|iPhone|iPod|ios|iPad|Android|Mobile|BlackBerry|IEMobile|MQQBrowser|JUC|Fennec|wOSBrowser|BrowserNG|WebOS|Symbian|Windows Phone)/i
41
- );
42
- if (flag) {
43
- this.isMobile = true;
44
- } else {
45
- this.isMobile = false;
46
- }
47
- console.log(this.isMobile,'this.isMobile');
48
- },
49
- radioClick(msg,option,index){
50
- let value = option.answerId ? msg.id +'_' + index + '_' + option.value + '_' + option.name + '_' + option.answerId : msg.id +'_' + index + '_' + option.value + '_' + option.name
51
- this.$emit('onRadioClick',value,option.name, msg.apiKey,msg.actionCategory, msg.msgId?msg.msgId:'',option.apiKey)
52
- }
53
- }
27
+ name: "answerRadio",
28
+ data() {
29
+ return {
30
+ isMobile: false,
31
+ formatOptions: [],
32
+ activeIndex: 0,
33
+ pageSize: 5,
34
+ showPage: false,
35
+ }
36
+ },
37
+ props: ['msg'],
38
+ mounted() {
39
+ console.log(this.msg, 'msg');
40
+ // 关键词推荐 前端分页
41
+ if (this.msg.id == "recdNodeId" && this.msg.content.options.length > this.pageSize) {
42
+ this.formatOptions = this.chunkArray(this.msg.content.options, this.pageSize);
43
+ this.activeIndex = 0;
44
+ this.showPage = true;
45
+ } else {
46
+ this.formatOptions = [this.msg.content.options];
47
+ this.activeIndex = 0;
48
+ }
49
+ this.judgeIsMobile();
50
+ },
51
+ methods: {
52
+ changeActivePage(){
53
+ if (this.activeIndex >= this.formatOptions.length - 1) {
54
+ this.activeIndex = 0;
55
+ } else {
56
+ this.activeIndex++;
57
+ }
58
+ },
59
+ chunkArray(array, size) {
60
+ let chunks = [];
61
+ for (let i = 0; i < array.length; i += size) {
62
+ let chunk = array.slice(i, i + size);
63
+ chunks.push(chunk);
64
+ }
65
+ return chunks;
66
+ },
67
+ judgeIsMobile() {
68
+ let flag = navigator.userAgent.match(
69
+ /(phone|pad|pod|iPhone|iPod|ios|iPad|Android|Mobile|BlackBerry|IEMobile|MQQBrowser|JUC|Fennec|wOSBrowser|BrowserNG|WebOS|Symbian|Windows Phone)/i
70
+ );
71
+ if (flag) {
72
+ this.isMobile = true;
73
+ } else {
74
+ this.isMobile = false;
75
+ }
76
+ console.log(this.isMobile, 'this.isMobile');
77
+ },
78
+ radioClick(msg, option, index) {
79
+ let value = option.answerId ? msg.id + '_' + index + '_' + option.value + '_' + option.name + '_' + option.answerId : msg.id + '_' + index + '_' + option.value + '_' + option.name
80
+ this.$emit('onRadioClick', value, option.name, msg.apiKey, msg.actionCategory, msg.msgId ? msg.msgId : '', option.apiKey)
81
+ }
82
+ }
54
83
 
55
84
  }
56
85
  </script>
57
86
 
58
87
  <style scoped lang="less">
59
- #answer-radio{
88
+ #answer-radio {
89
+ .switch-page {
90
+ margin-top: 10px;
91
+ display: flex;
92
+ flex-direction: column;
93
+ align-items: center;
94
+ .switch-page-btn {
95
+ width: 80px;
96
+ height: 30px;
97
+ border-radius: 15px;
98
+ border: solid 1px #366AFF;
99
+ color: #366AFF;
100
+ line-height: 30px;
101
+ text-align: center;
102
+ cursor: pointer;
103
+ }
104
+ }
60
105
  .radio-description {
61
106
  word-wrap: break-word;
62
107
  word-break: break-all;
@@ -64,51 +109,57 @@ export default {
64
109
  /*padding: 8px 10px 10px 0;*/
65
110
  padding-bottom: 10px;
66
111
  height: auto;
67
- /* border-bottom: 1px solid #EEEEEE;*/
112
+ /* border-bottom: 1px solid #EEEEEE;*/
68
113
  }
69
- .bottom-link{
114
+
115
+ .bottom-link {
70
116
  height: 1px;
71
- background-color:#EEEEEE;
117
+ background-color: #EEEEEE;
72
118
  }
73
- .options-list{
119
+
120
+ .options-list {
74
121
  padding-top: 4px;
75
- /* padding-top: 10px;*/
122
+ /* padding-top: 10px;*/
76
123
  /*padding-right: 10px;*/
77
-
78
- .options-item{
124
+
125
+ .options-item {
79
126
  // height: 25px;
80
127
  line-height: 25px;
81
128
  background-color: #ffffff;
82
129
  color: #366aff;
83
- cursor:pointer;
130
+ cursor: pointer;
84
131
  display: flex;
85
132
  align-items: center;
86
133
  justify-content: space-between;
87
-
88
134
 
89
- i{
135
+
136
+ i {
90
137
  padding-left: 10px;
91
138
  }
92
- .options-item-text{
139
+
140
+ .options-item-text {
93
141
  text-overflow: ellipsis;
94
142
  display: -webkit-box; //使用了flex,需要加
95
- overflow: hidden; //超出隐藏
143
+ overflow: hidden; //超出隐藏
96
144
  word-break: break-all; //纯英文、数字、中文
97
- text-overflow: ellipsis; //省略号
145
+ text-overflow: ellipsis; //省略号
98
146
  -webkit-box-orient: vertical; //垂直
99
- -webkit-line-clamp: 1; //显示一行
100
- white-space:pre-line; //
147
+ -webkit-line-clamp: 1; //显示一行
148
+ white-space: pre-line; //
101
149
  }
102
150
  }
103
- &.isKnowledgeSummary{
151
+
152
+ &.isKnowledgeSummary {
104
153
  background: #EEF1FF;
105
154
  border-radius: 10px;
106
155
  padding: 10px;
107
- .options-item{
156
+
157
+ .options-item {
108
158
  background: #EEF1FF;
109
159
  }
110
160
  }
111
- .tips{
161
+
162
+ .tips {
112
163
  width: 131px;
113
164
  height: 22px;
114
165
  background: #366AFF;
@@ -118,13 +169,16 @@ export default {
118
169
  color: #fff;
119
170
  font-size: 12px;
120
171
  }
121
- .recommend-item{
172
+
173
+ .recommend-item {
122
174
  padding: 8px 0;
123
175
  }
124
- .last-item{
176
+
177
+ .last-item {
125
178
  padding-top: 8px;
126
179
  }
127
- .end{
180
+
181
+ .end {
128
182
  border-bottom-left-radius: 25px !important;
129
183
  border-bottom-right-radius: 25px !important;
130
184
  }