askbot-dragon 1.6.21-beta → 1.6.21

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 (72) hide show
  1. package/package.json +8 -11
  2. package/public/index.html +9 -8
  3. package/src/assets/image/default_avt_ui.png +0 -0
  4. package/src/assets/image/filtType/audio.png +0 -0
  5. package/src/assets/image/filtType/excel1.png +0 -0
  6. package/src/assets/image/filtType/general.png +0 -0
  7. package/src/assets/image/filtType/image1.png +0 -0
  8. package/src/assets/image/filtType/link.png +0 -0
  9. package/src/assets/image/filtType/md2.png +0 -0
  10. package/src/assets/image/filtType/mode.png +0 -0
  11. package/src/assets/image/filtType/news.png +0 -0
  12. package/src/assets/image/filtType/pdf1.png +0 -0
  13. package/src/assets/image/filtType/ppt1.png +0 -0
  14. package/src/assets/image/filtType/selfadd1.png +0 -0
  15. package/src/assets/image/filtType/txt1.png +0 -0
  16. package/src/assets/image/filtType/video.png +0 -0
  17. package/src/assets/image/filtType/wechat.png +0 -0
  18. package/src/assets/image/filtType/word1.png +0 -0
  19. package/src/assets/image/loading.gif +0 -0
  20. package/src/assets/js/AliyunlssUtil.js +35 -10
  21. package/src/assets/js/common.js +241 -0
  22. package/src/components/ActionAlertIframe.vue +1 -0
  23. package/src/components/AiGuide.vue +7 -4
  24. package/src/components/AnswerDocknowledge.vue +930 -389
  25. package/src/components/ConversationContainer.vue +7111 -1058
  26. package/src/components/MyEditor.vue +342 -0
  27. package/src/components/QwFeedback.vue +303 -0
  28. package/src/components/actionSatisfaction.vue +2 -2
  29. package/src/components/actionSendToBot.vue +2 -2
  30. package/src/components/answerRadio.vue +145 -64
  31. package/src/components/askVideo.vue +3 -6
  32. package/src/components/assetDetails.vue +14 -6
  33. package/src/components/assetMessage.vue +14 -13
  34. package/src/components/associationIntention.vue +31 -6
  35. package/src/components/fielListView.vue +1 -1
  36. package/src/components/file/AliyunOssComponents.vue +1 -1
  37. package/src/components/formTemplate.vue +1590 -1674
  38. package/src/components/imgView.vue +32 -0
  39. package/src/components/intelligentSummary.vue +231 -0
  40. package/src/components/markDownText.vue +198 -0
  41. package/src/components/myPopup.vue +14 -11
  42. package/src/components/pagination.vue +129 -0
  43. package/src/components/pdfPosition.vue +112 -90
  44. package/src/components/popup.vue +8 -7
  45. package/src/components/preview/docView.vue +114 -0
  46. package/src/components/preview/excelView.vue +187 -0
  47. package/src/components/preview/newPositionPreview.vue +370 -0
  48. package/src/components/preview/pdfView.vue +824 -0
  49. package/src/components/previewDoc.vue +6 -0
  50. package/src/components/previewPdf.vue +963 -200
  51. package/src/components/receiverMessagePlatform.vue +25 -21
  52. package/src/components/recommend.vue +2 -2
  53. package/src/components/senderMessagePlatform.vue +21 -13
  54. package/src/components/tree.vue +116 -103
  55. package/src/components/utils/AliyunIssUtil.js +35 -13
  56. package/src/components/utils/ckeditor.js +64 -56
  57. package/src/components/welcomeKnowledgeFile.vue +344 -0
  58. package/src/components/welcomeLlmCard.vue +141 -0
  59. package/src/components/welcomeSuggest.vue +98 -0
  60. package/src/locales/cn.json +62 -0
  61. package/src/locales/en.json +62 -0
  62. package/src/main.js +19 -3
  63. package/vue.config.js +0 -1
  64. package/src/assets/js/obsBrowser.js +0 -63
  65. package/src/components/utils/ckeditorImageUpload/command.js +0 -112
  66. package/src/components/utils/ckeditorImageUpload/editing.js +0 -12
  67. package/src/components/utils/ckeditorImageUpload/plugin-image.js +0 -12
  68. package/src/components/utils/ckeditorImageUpload/toolbar-ui.js +0 -41
  69. package/src/components/utils/ckeditorfileUpload/common.js +0 -175
  70. package/src/components/utils/ckeditorfileUpload/editing.js +0 -12
  71. package/src/components/utils/ckeditorfileUpload/plugin_file.js +0 -12
  72. package/src/components/utils/ckeditorfileUpload/toolbar_ui.js +0 -35
@@ -0,0 +1,342 @@
1
+ <template>
2
+ <div class="my_editor">
3
+ <div class="editor_head" v-if="havToolbar">
4
+ <button class="button" @click="handleUpdate">
5
+ <svg
6
+ t="1703581982515"
7
+ class="icon"
8
+ viewBox="0 0 1024 1024"
9
+ version="1.1"
10
+ xmlns="http://www.w3.org/2000/svg"
11
+ p-id="74840"
12
+ width="200"
13
+ height="200"
14
+ >
15
+ <path
16
+ d="M566.839921 866.857572V983.050833c0 22.522042-7.677969 33.271198-29.688146 37.877979-18.427125 4.094917-37.366115 3.583052-55.281375-2.047458-17.403396-5.63051-24.057636-15.867802-24.057636-33.271198v-410.003534c0-7.166104-1.535594-9.213563-9.213562-9.213562-80.36274 0.511865-330.152658 0-410.515399 0-19.450854 0-29.688146-7.166104-34.294927-26.105094-5.118646-19.450854-5.118646-39.925438 0.511865-58.864427 5.118646-16.891531 15.355938-23.545771 32.759333-23.545771h412.562857c7.166104 0 8.189833-1.535594 8.189833-8.189834V41.219994c0-25.081365 7.166104-34.806792 32.247469-38.901708 18.93899-3.583052 38.389844-3.583052 56.305105 4.094917 13.820344 5.63051 20.474583 15.867802 20.474583 30.711875v412.562856c0 6.65424 1.535594 8.189833 8.189833 8.189834h406.932346c23.545771 0 33.783063 7.677969 38.901709 30.711875 4.094917 18.427125 4.094917 37.366115-2.047458 55.281375-5.118646 16.379667-15.355938 23.033906-32.247469 23.033907h-410.515398c-7.166104 0-10.237292 1.023729-9.725428 9.725427 0.511865 40.437302 0.511865 249.789918 0.511865 290.22722z"
17
+ p-id="74841"
18
+ />
19
+ </svg>
20
+ {{$t('dragonCommon.uploadImgFile')}}
21
+ </button>
22
+ </div>
23
+ <div
24
+ class="editor_content"
25
+ id="my_editor_content"
26
+ v-html="text"
27
+ contenteditable
28
+ ref="editorContent"
29
+ @focus="ischecked = true"
30
+ @blur="blurFn"
31
+ @input="changeInput"
32
+ :data-placeholder="placeholder"
33
+ ></div>
34
+ </div>
35
+ </template>
36
+
37
+ <script>
38
+ import { v4 as uuidv4 } from "uuid";
39
+ import { multipartUpload, ossFileUrl } from "./utils/AliyunIssUtil";
40
+
41
+ export default {
42
+ props: ["value", "placeholder", "havToolbar"],
43
+ data () {
44
+ return {
45
+ ischecked: false,
46
+ text: ''
47
+ }
48
+ },
49
+ watch: {
50
+ value: {
51
+ handler () {
52
+ // 解决光标跳动BUG
53
+ if (!this.ischecked) {
54
+ this.text = this.value
55
+ }
56
+ },
57
+ deep: true,
58
+ immediate: true
59
+ }
60
+ },
61
+ methods: {
62
+ blurFn (e) {
63
+ this.ischecked = false
64
+ this.text = this.value
65
+ e.view.blur()
66
+ },
67
+ changeInput (e) {
68
+ this.$emit("input", e.target.innerHTML)
69
+ },
70
+ handleUpdate () {
71
+ let inputObj = document.createElement('input')
72
+ inputObj.setAttribute('id', '_ef');
73
+ inputObj.setAttribute('type', 'file');
74
+ inputObj.setAttribute('accept', '*')
75
+ inputObj.setAttribute('multiple', true)
76
+ inputObj.setAttribute("style", 'visibility:hidden');
77
+ document.body.appendChild(inputObj);
78
+ inputObj.click();
79
+ inputObj.onchange = () => {
80
+ // 循环上传文件
81
+ let files = inputObj.files;
82
+ for (let index = 0; index < files.length; index++) {
83
+ const file = files[index];
84
+ let uid = uuidv4()
85
+ // let command = this.editor.commands.get("insertAskComponent");
86
+ // const listeners = this.editor.config.get('askPluginListener');
87
+ // let beforeButtonInsert = findListener(listeners, "UPLOAD");
88
+ if (file.type.includes('image')) {
89
+ // if (this.editor.uploadImg) {
90
+ // this.editor.uploadImg.push(uid)
91
+ // } else {
92
+ // this.editor.uploadImg = []
93
+ // this.editor.uploadImg.push(uid)
94
+ // }
95
+ this.imgUploadCallback(file, uid, index)
96
+ } else {
97
+ this.fileUploadCallback(file, uid)
98
+ }
99
+ }
100
+ }
101
+ },
102
+ appenNode (type, uid, value) {
103
+ let node = document.createElement(type)
104
+ node.setAttribute("uid", uid)
105
+ if (type == 'img') {
106
+ node.setAttribute("src", value)
107
+ node.setAttribute("class", 'image')
108
+ setTimeout(() => {
109
+ this.appenNode('div', '', '')
110
+ })
111
+ }
112
+ if (type == 'div' && uid) {
113
+ node.innerText = value
114
+ node.setAttribute("class", 'loading')
115
+ setTimeout(() => {
116
+ this.appenNode('div', '', '')
117
+ })
118
+ }
119
+ if (type == 'div' && !uid) {
120
+ node.setAttribute("class", 'wrap')
121
+ }
122
+ this.$refs.editorContent.appendChild(node)
123
+ },
124
+ deleteNode (uid) {
125
+ console.log(uid);
126
+ try {
127
+ let node = document.querySelector("[uid=" + uid + ']')
128
+ if (node) {
129
+ this.$refs.editorContent.removeChild(node)
130
+ }
131
+ } catch {
132
+ console.error("未找到该节点");
133
+ }
134
+ },
135
+ imgUploadCallback (file, uid, index) {
136
+ console.log(file, uid, index);
137
+ this.appenNode("div", "div" + index + uid, file.name + "正在上传,请稍后...")
138
+ this.upload(file).then(res => {
139
+ this.appenNode('img', "img" + index + uid, res.default)
140
+ this.deleteNode("div" + index + uid)
141
+ this.$emit("input", this.$refs.editorContent.innerHTML)
142
+ })
143
+ },
144
+ upload (file) {
145
+ return new Promise((resolve) => {
146
+ this.uploadFile(file, resolve)
147
+ })
148
+ },
149
+ uploadFile (file, resolve) {
150
+ let imgInfo = {
151
+ url: '',
152
+ }
153
+ let res = multipartUpload(
154
+ file,
155
+ null,
156
+ imgInfo
157
+ );
158
+ res.then(resp => {
159
+ imgInfo.url = ossFileUrl(resp.name)
160
+ resolve({
161
+ name: resp.name,
162
+ default: imgInfo.url
163
+ })
164
+ })
165
+ },
166
+ fileUploadCallback (file, uid) {
167
+ this.$emit("fileUploadCallback", {
168
+ param: {
169
+ uid: uid,
170
+ type: 'pending',
171
+ name: file.name
172
+ }
173
+ })
174
+ this.upload(file).then(res => {
175
+ this.$emit("fileUploadCallback", {
176
+ param: {
177
+ uid: uid,
178
+ name: file.name,
179
+ type: 'success',
180
+ url: res.default
181
+ }
182
+ })
183
+ this.$emit("input", this.$refs.editorContent.innerHTML)
184
+ })
185
+ },
186
+
187
+ },
188
+ mounted () {
189
+ this.$nextTick(() => {
190
+ let myEditorContent = this.$refs.editorContent
191
+ console.log(myEditorContent, 'myEditorContent');
192
+ myEditorContent.addEventListener("paste", (e) => {
193
+ let { files } = e.clipboardData
194
+ console.log(files, e.clipboardData, 'filesfilesfilesfiles');
195
+ if (files.length > 0) {
196
+ for (let index = 0; index < files.length; index++) {
197
+ let uid = uuidv4()
198
+ if (files[index].type.indexOf('image') != -1) {
199
+ this.imgUploadCallback(files[index], uid, index)
200
+ e.preventDefault();
201
+ } else {
202
+ this.fileUploadCallback(files[index], uid)
203
+ e.preventDefault();
204
+ }
205
+ }
206
+ }
207
+ })
208
+ myEditorContent.addEventListener("dragenter", function () {
209
+ });
210
+ myEditorContent.addEventListener("dragover", function (e) {
211
+ e.preventDefault();
212
+ });
213
+ myEditorContent.addEventListener("drop", (e) => {
214
+ e.preventDefault();
215
+ let files = e.dataTransfer.files; // 这个就相当于文件上传组件
216
+ if (files.length > 0) {
217
+ for (let index = 0; index < files.length; index++) {
218
+ let uid = uuidv4()
219
+ if (files[index].type.indexOf('image') != -1) {
220
+ this.imgUploadCallback(files[index], uid, index)
221
+ e.preventDefault();
222
+ } else {
223
+ this.fileUploadCallback(files[index], uid)
224
+ e.preventDefault();
225
+ }
226
+ }
227
+ }
228
+ }, false);
229
+ })
230
+
231
+ }
232
+ }
233
+ </script>
234
+
235
+ <style lang="less" scoped>
236
+ .my_editor {
237
+ width: 100%;
238
+ border: 1px solid #e0e6f7;
239
+ border-radius: 9px !important;
240
+ background: #ffffff;
241
+ /deep/.editor_content {
242
+ border-bottom-left-radius: 9px !important;
243
+ border-bottom-right-radius: 9px !important;
244
+ padding: 10px;
245
+ box-sizing: border-box;
246
+ min-height: 150px !important;
247
+ font-size: 14px !important;
248
+ outline: none;
249
+ div {
250
+ margin-bottom: 8px;
251
+ white-space: pre-wrap;
252
+ }
253
+ .image {
254
+ height: 140px;
255
+ object-fit: contain;
256
+ }
257
+ // .image{
258
+ // outline: 3px solid #366aff;
259
+ // }
260
+ .loading {
261
+ background: rgba(0, 89, 255, 0.2);
262
+ display: inline-block;
263
+ padding: 2px 5px;
264
+ border-radius: 3px;
265
+ padding-left: 20px;
266
+ position: relative;
267
+ font-size: 12px;
268
+ -webkit-user-modify: read-only;
269
+ -moz-user-modify: read-only;
270
+ }
271
+ .loading::after {
272
+ content: '';
273
+ background-image: url(../assets/image/building.png);
274
+ background-size: 100%;
275
+ width: 15px;
276
+ height: 15px;
277
+ position: absolute;
278
+ top: 3px;
279
+ left: 2px;
280
+ color: #366aff;
281
+ -webkit-animation: rotate 1.5s linear infinite;
282
+ animation: rotate 1.5s linear infinite;
283
+ }
284
+ // .wrap {
285
+ // height: 1px;
286
+ // width: 100%;
287
+ // }
288
+ }
289
+ .editor_content:focus {
290
+ box-shadow: 2px 2px 3px rgba(0, 0, 0, 0.1) inset, 0, 0;
291
+ }
292
+ .editor_content:empty::before {
293
+ content: attr(data-placeholder);
294
+ color: #b3b3b3;
295
+ font-size: 14px;
296
+ }
297
+ .editor_head {
298
+ display: flex;
299
+ align-items: center;
300
+ width: 100%;
301
+ height: 38px;
302
+ padding: 0 10px;
303
+ padding-left: 3px;
304
+ box-sizing: border-box;
305
+ color: #366aff;
306
+ font-size: 14px;
307
+ border-bottom: 1px solid #e0e6f7;
308
+
309
+ .button {
310
+ padding: 5px 8px;
311
+ background: #ffffff;
312
+ border: none;
313
+ border-radius: 2px;
314
+ svg {
315
+ fill: #366aff;
316
+ width: 12px !important;
317
+ height: 12px !important;
318
+ }
319
+ }
320
+ .button:focus {
321
+ // box-shadow: var(--ck-focus-outer-shadow),0 0;
322
+ outline: none;
323
+ background: #f0f0f0;
324
+ transition: box-shadow 0.2s ease-in-out, border 0.2s ease-in-ou;
325
+ }
326
+ .button:active {
327
+ border: 1px solid #366aff;
328
+ }
329
+ }
330
+ }
331
+ @keyframes rotate {
332
+ 0% {
333
+ -webkit-transform: rotate(0deg);
334
+ transform: rotate(0deg);
335
+ }
336
+
337
+ 100% {
338
+ -webkit-transform: rotate(360deg);
339
+ transform: rotate(360deg);
340
+ }
341
+ }
342
+ </style>
@@ -0,0 +1,303 @@
1
+ <template>
2
+ <div class="qw-feedback">
3
+ <div class="qw-guide-text" v-if="msg.content.guideText">
4
+ <!-- 不要替换成图片地址或者字体 -->
5
+ <svg
6
+ t="1730450955692"
7
+ class="icon"
8
+ viewBox="0 0 1024 1024"
9
+ version="1.1"
10
+ xmlns="http://www.w3.org/2000/svg"
11
+ p-id="8682"
12
+ width="22"
13
+ height="22"
14
+ >
15
+ <path
16
+ d="M565.096296 289.185185s-0.948148 0 0 0c-110.933333-20.859259-208.592593 40.77037-237.985185 148.859259-14.222222 53.096296-24.651852 101.451852 44.562963 221.866667 14.222222 25.6 11.377778 70.162963 8.533333 95.762963-1.896296 14.222222 64.474074 36.02963 89.125926 42.666667l95.762963-509.155556z"
17
+ fill="#FDB813"
18
+ p-id="8683"
19
+ ></path>
20
+ <path
21
+ d="M732.918519 513.896296c11.377778-111.881481-56.888889-203.851852-166.874075-224.711111h-0.948148L469.333333 798.340741c25.6 2.844444 94.814815 6.637037 98.607408-7.585185 6.637037-25.6 20.859259-67.318519 42.666666-86.281482C719.644444 618.192593 727.22963 568.888889 732.918519 513.896296z"
22
+ fill="#FD9B13"
23
+ p-id="8684"
24
+ ></path>
25
+ <path
26
+ d="M467.437037 806.874074c-7.585185-0.948148-12.325926-7.585185-14.222222-14.222222l-38.874074-256c-0.948148-5.688889 0.948148-11.377778 4.74074-15.170371 3.792593-3.792593 9.481481-5.688889 15.170371-4.74074l167.822222 31.288889c5.688889 0.948148 10.42963 4.740741 12.325926 9.481481 1.896296 4.740741 1.896296 11.377778-0.948148 16.118519L486.4 798.340741c-3.792593 6.637037-11.377778 10.42963-18.962963 8.533333z m-14.222222-251.259259l27.496296 182.992592L572.681481 578.37037l-119.466666-22.755555z"
27
+ fill="#F12A3F"
28
+ p-id="8685"
29
+ ></path>
30
+ <path
31
+ d="M375.466667 709.214815l-25.6 137.481481c0 2.844444 1.896296 5.688889 7.585185 10.42963l65.422222 54.992593c5.688889 4.740741 15.17037 8.533333 23.703704 10.429629l36.029629-193.422222-107.14074-19.911111z"
32
+ fill="#2D4375"
33
+ p-id="8686"
34
+ ></path>
35
+ <path
36
+ d="M482.607407 729.125926l-36.029629 193.422222c9.481481 1.896296 18.014815 1.896296 25.6-0.948148l80.592592-27.496296c6.637037-1.896296 10.42963-4.740741 11.377778-6.637037L589.748148 749.037037l-107.140741-19.911111z"
37
+ fill="#1E2D4F"
38
+ p-id="8687"
39
+ ></path>
40
+ <path
41
+ d="M612.503704 217.125926c-3.792593 18.014815-20.859259 29.392593-38.874074 26.548148-18.014815-3.792593-30.340741-20.859259-26.548149-38.874074l18.962963-100.503704c3.792593-18.014815 20.859259-29.392593 38.874075-26.548148 18.014815 3.792593 30.340741 20.859259 26.548148 38.874074l-18.962963 100.503704z"
42
+ fill="#FDB813"
43
+ p-id="8688"
44
+ ></path>
45
+ <path
46
+ d="M382.103704 228.503704c10.42963 15.17037 6.637037 36.02963-8.533334 46.459259-15.17037 10.42963-36.02963 6.637037-46.459259-8.533333l-57.837037-84.385186c-10.42963-15.17037-6.637037-36.02963 8.533333-46.459259 15.17037-10.42963 36.02963-6.637037 46.45926 8.533334l57.837037 84.385185zM757.57037 298.666667c-15.17037 10.42963-18.962963 31.288889-8.533333 46.459259 10.42963 15.17037 31.288889 18.962963 46.459259 8.533333l84.385185-57.837037c15.17037-10.42963 18.962963-31.288889 8.533334-46.459259-10.42963-15.17037-31.288889-18.962963-46.459259-8.533333l-84.385186 57.837037z"
47
+ fill="#FDB813"
48
+ p-id="8689"
49
+ ></path>
50
+ <path
51
+ d="M252.207407 361.244444c18.014815 3.792593 30.340741 20.859259 26.548149 38.874075-3.792593 18.014815-20.859259 29.392593-38.874075 26.548148l-100.503703-18.962963c-18.014815-3.792593-30.340741-20.859259-26.548148-38.874074 3.792593-18.014815 20.859259-29.392593 38.874074-26.548149l100.503703 18.962963zM931.081481 488.296296c18.014815 3.792593 30.340741 20.859259 26.548149 38.874074-3.792593 18.014815-20.859259 29.392593-38.874074 26.548149l-100.503704-18.962963c-18.014815-3.792593-30.340741-20.859259-26.548148-38.874075 3.792593-18.014815 20.859259-29.392593 38.874074-26.548148l100.503703 18.962963z"
52
+ fill="#FDB813"
53
+ p-id="8690"
54
+ ></path>
55
+ <path
56
+ d="M593.540741 807.822222c1.896296-7.585185-3.792593-15.17037-11.377778-16.118518l-107.140741-19.911111-4.740741 27.496296 107.140741 19.911111c6.637037 0.948148 14.222222-3.792593 16.118519-11.377778z"
57
+ fill="#CEEFF6"
58
+ p-id="8691"
59
+ ></path>
60
+ <path
61
+ d="M366.933333 750.933333c-7.585185-1.896296-15.17037 3.792593-16.118518 11.377778-1.896296 7.585185 3.792593 15.17037 11.377778 16.118519l107.14074 19.911111 4.740741-27.496297-107.140741-19.911111zM356.503704 808.77037c-7.585185-1.896296-15.17037 3.792593-16.118519 11.377778-1.896296 7.585185 3.792593 15.17037 11.377778 16.118519l107.140741 19.911111 4.74074-27.496297-107.14074-19.911111z"
62
+ fill="#FFFFFF"
63
+ p-id="8692"
64
+ ></path>
65
+ <path
66
+ d="M570.785185 848.592593l-107.140741-19.911112-4.74074 27.496297 107.14074 19.911111c7.585185 1.896296 15.17037-3.792593 16.118519-11.377778 1.896296-7.585185-2.844444-15.17037-11.377778-16.118518z"
67
+ fill="#CEEFF6"
68
+ p-id="8693"
69
+ ></path>
70
+ </svg>
71
+ <!-- 不要替换成图片地址或者字体 -->
72
+ <p class="radio-description" v-html="msg.content.guideText"></p>
73
+ </div>
74
+
75
+ <div class="options-list">
76
+ <div
77
+ v-for="(option, index) in showOptions"
78
+ class="options-item"
79
+ :class="
80
+ index !== msg.content.questionList.length - 1
81
+ ? 'recommend-item'
82
+ : 'last-item'
83
+ "
84
+ :key="'qwfeedback_' + index"
85
+ @click="handleWelcome(option)"
86
+ >
87
+ <span> {{ getFilteredName(option) }}</span>
88
+ <i class="arsenal_icon arsenalangle-right-solid"></i>
89
+ </div>
90
+ </div>
91
+ <div v-if="showPage" class="switch-page">
92
+ <!-- <span @click="changeActivePage" class="switch-page-btn"
93
+ >换一批</span
94
+ > -->
95
+ <span @click="showMore" class="switch-page-btn">{{$t('dragonCommon.viewMore')}}</span>
96
+ </div>
97
+ </div>
98
+ </template>
99
+
100
+ <script>
101
+ export default {
102
+ name: "answerRadio",
103
+ data() {
104
+ return {
105
+ isMobile: false,
106
+ formatOptions: [],
107
+ activeIndex: 0,
108
+ pageSize: 5,
109
+ showPage: false,
110
+ showOptions: [],
111
+ };
112
+ },
113
+ props: ["msg"],
114
+ mounted() {
115
+ this.$i18n.locale = sessionStorage.getItem("systemLanguage") || 'cn';
116
+ console.log(this.msg, "msg");
117
+ // 关键词推荐 前端分页
118
+ this.msg.content.questionList = this.msg.content.questionList.slice(0, 20);
119
+ if (this.msg.content.questionList.length > this.pageSize) {
120
+ this.formatOptions = this.chunkArray(
121
+ this.msg.content.questionList,
122
+ this.pageSize
123
+ );
124
+ this.activeIndex = 0;
125
+ this.showPage = true;
126
+ } else {
127
+ this.formatOptions = [this.msg.content.questionList];
128
+ this.activeIndex = 0;
129
+ }
130
+ this.showOptions = this.formatOptions[0];
131
+ this.judgeIsMobile();
132
+ },
133
+ methods: {
134
+ getFilteredName(name) {
135
+ if (typeof name === "string") {
136
+ return name.replace(/<\/?p>/g, "");
137
+ } else {
138
+ return name;
139
+ }
140
+ },
141
+ showMore() {
142
+ if (this.activeIndex == this.formatOptions.length - 2) {
143
+ this.activeIndex++;
144
+ this.showPage = false;
145
+ } else {
146
+ this.activeIndex++;
147
+ }
148
+ this.showOptions = [
149
+ ...this.showOptions.concat(
150
+ this.formatOptions[this.activeIndex]
151
+ ),
152
+ ];
153
+ },
154
+ changeActivePage() {
155
+ if (this.activeIndex >= this.formatOptions.length - 1) {
156
+ this.activeIndex = 0;
157
+ } else {
158
+ this.activeIndex++;
159
+ }
160
+ this.showOptions = this.formatOptions[this.activeIndex];
161
+ },
162
+ chunkArray(array, size) {
163
+ let chunks = [];
164
+ for (let i = 0; i < array.length; i += size) {
165
+ let chunk = array.slice(i, i + size);
166
+ chunks.push(chunk);
167
+ }
168
+ return chunks;
169
+ },
170
+ judgeIsMobile() {
171
+ let flag = navigator.userAgent.match(
172
+ /(phone|pad|pod|iPhone|iPod|ios|iPad|Android|Mobile|BlackBerry|IEMobile|MQQBrowser|JUC|Fennec|wOSBrowser|BrowserNG|WebOS|Symbian|Windows Phone)/i
173
+ );
174
+ if (flag) {
175
+ this.isMobile = true;
176
+ } else {
177
+ this.isMobile = false;
178
+ }
179
+ console.log(this.isMobile, "this.isMobile");
180
+ },
181
+ handleWelcome (item) {
182
+ console.log(item, 'item');
183
+
184
+ this.$emit('handleWelcome', item)
185
+ },
186
+ radioClick(msg, option, index) {
187
+ let value = option.answerId
188
+ ? msg.id +
189
+ "_" +
190
+ index +
191
+ "_" +
192
+ option.value +
193
+ "_" +
194
+ option.name +
195
+ "_" +
196
+ option.answerId
197
+ : msg.id + "_" + index + "_" + option.value + "_" + option.name;
198
+ this.$emit(
199
+ "onRadioClick",
200
+ value,
201
+ option.name,
202
+ msg.apiKey,
203
+ msg.actionCategory,
204
+ msg.msgId ? msg.msgId : "",
205
+ option.apiKey
206
+ );
207
+ },
208
+ },
209
+ };
210
+ </script>
211
+
212
+ <style scoped lang="less">
213
+ .qw-feedback {
214
+ background-color: white;
215
+ padding-bottom: 16px;
216
+ .qw-guide-text {
217
+ display: flex;
218
+ justify-content: flex-start;
219
+ align-items: center;
220
+ background-color: #d9e3fa;
221
+ padding: 16px;
222
+ .radio-description {
223
+ margin-left: 6px;
224
+ }
225
+ }
226
+ .switch-page {
227
+ margin-top: 10px;
228
+ display: flex;
229
+ flex-direction: column;
230
+ align-items: center;
231
+ .switch-page-btn {
232
+ width: 80px;
233
+ height: 24px;
234
+ border-radius: 15px;
235
+ border: solid 1px #366aff;
236
+ color: #366aff;
237
+ line-height: 24px;
238
+ text-align: center;
239
+ cursor: pointer;
240
+ font-size: 12px;
241
+ }
242
+ }
243
+ .radio-description {
244
+ word-wrap: break-word;
245
+ word-break: break-all;
246
+ overflow: hidden;
247
+ /*padding: 8px 10px 10px 0;*/
248
+ height: auto;
249
+ /* border-bottom: 1px solid #EEEEEE;*/
250
+ }
251
+
252
+ .bottom-link {
253
+ height: 1px;
254
+ background-color: #eeeeee;
255
+ }
256
+
257
+ .options-list {
258
+ padding-top: 4px;
259
+ /* padding-top: 10px;*/
260
+ padding-left: 16px;
261
+ padding-right: 16px;
262
+
263
+ .options-item {
264
+ // height: 25px;
265
+ line-height: 25px;
266
+ background-color: #ffffff;
267
+ color: #366aff;
268
+ cursor: pointer;
269
+ display: flex;
270
+ align-items: center;
271
+ justify-content: space-between;
272
+
273
+ i {
274
+ padding-left: 10px;
275
+ }
276
+
277
+ .options-item-text {
278
+ text-overflow: ellipsis;
279
+ display: -webkit-box; //使用了flex,需要加
280
+ overflow: hidden; //超出隐藏
281
+ word-break: break-all; //纯英文、数字、中文
282
+ text-overflow: ellipsis; //省略号
283
+ -webkit-box-orient: vertical; //垂直
284
+ -webkit-line-clamp: 1; //显示一行
285
+ white-space: pre-line; //
286
+ }
287
+ }
288
+
289
+ .recommend-item {
290
+ padding: 8px 0;
291
+ }
292
+
293
+ .last-item {
294
+ padding-top: 8px;
295
+ }
296
+
297
+ .end {
298
+ border-bottom-left-radius: 25px !important;
299
+ border-bottom-right-radius: 25px !important;
300
+ }
301
+ }
302
+ }
303
+ </style>
@@ -17,7 +17,7 @@
17
17
  )
18
18
  "
19
19
  >
20
- 满意
20
+ {{$t('dragonCommon.satisfaction')}}
21
21
  </div>
22
22
  <div
23
23
  class="statisfaction-item"
@@ -32,7 +32,7 @@
32
32
  )
33
33
  "
34
34
  >
35
- 不满意
35
+ {{$t('dragonCommon.unsatisfied')}}
36
36
  </div>
37
37
  </div>
38
38
 
@@ -53,10 +53,10 @@
53
53
  }
54
54
  }
55
55
  .recommend-item{
56
- padding: 8px 0;
56
+ padding: 4px 0;
57
57
  }
58
58
  .last-item{
59
- padding-top: 8px;
59
+ padding-top: 4px;
60
60
  }
61
61
  }
62
62
  }