askbot-dragon 1.0.29 → 1.1.0

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.
@@ -2,7 +2,7 @@
2
2
  <div class="association-intention">
3
3
  <div v-if=" (msgType === 'answer_welcofmetext' || msgType === 'answer_text') && !(msg.recommend&& msg.recommend.status)">
4
4
  <!-- <p v-html="msg.content.replace(/\#[\u4E00-\u9FA5]{1,3}\;/gi, emotion)"></p>-->
5
- <template v-if="msgContent(msg.content)">
5
+ <template v-if="msg.dispatchServiceType === 'CHATGPT'">
6
6
  <p style="white-space: pre-wrap;">
7
7
  {{msg.content | msgHtmlContent}}
8
8
  </p>
@@ -12,7 +12,7 @@
12
12
  </template>
13
13
  </div>
14
14
  <div v-if=" (msgType === 'answer_welcofmetext' || msgType === 'answer_text') && (msg.recommend&& msg.recommend.status)">
15
- <template v-if="msgContent(msg.content)">
15
+ <template v-if="msg.dispatchServiceType === 'CHATGPT'">
16
16
  <p style="white-space: pre-wrap;">
17
17
  {{msg.content | msgHtmlContent}}
18
18
  </p>
@@ -23,10 +23,10 @@
23
23
  <Recommend :msg="msg" @onRadioClickReco="onRadioClickReco"></Recommend>
24
24
  </div>
25
25
  <div v-if="msg.type === 'answer_rich_text' && !(msg.content.recommend && msg.content.recommend.status)">
26
- <p v-html="$options.filters.imageStyle(msg.content.html)" @click="lookAttach($event)"></p>
26
+ <p v-html="$options.filters.imageStyle(msg.content.html)"></p>
27
27
  </div>
28
28
  <div v-else-if="msg.type == 'answer_rich_text' && (msg.content.recommend && msg.content.recommend.status)">
29
- <p v-html="$options.filters.imageStyle(msg.content.html)" class="answer-rich-text" @click="lookAttach($event)"></p>
29
+ <p v-html="$options.filters.imageStyle(msg.content.html)" class="answer-rich-text"></p>
30
30
  <Recommend :msg="msg.content" @onRadioClickReco="onRadioClickReco"></Recommend>
31
31
  </div>
32
32
  <div v-else-if="msgType === 'answer_image'" >
@@ -63,17 +63,15 @@
63
63
  </div>
64
64
  <Recommend v-if="msg.recommend && msg.recommend.list && msg.recommend.list.length > 0" :msg="msg" @onRadioClickReco="onRadioClickReco"></Recommend>
65
65
  </div>
66
- <previewDoc ref="previewDoc" :url="previewHref"></previewDoc>
67
66
  </div>
68
67
  </template>
69
68
 
70
69
  <script>
71
70
  import askVideo from "./askVideo";
72
71
  import Recommend from "./recommend";
73
- import previewDoc from "./previewDoc";
74
72
  export default {
75
73
  name: "associationIntention",
76
- components: {Recommend, askVideo, previewDoc},
74
+ components: {Recommend, askVideo},
77
75
  props: ["msg",'msgType','isOpen','sourceOhm','isOhmPc'],
78
76
  filters: {
79
77
  imageStyle: function (html) {
@@ -90,11 +88,6 @@
90
88
  return msg
91
89
  },
92
90
  },
93
- data() {
94
- return {
95
- previewHref: ""
96
- }
97
- },
98
91
  mounted() {
99
92
  },
100
93
  methods:{
@@ -227,25 +220,6 @@
227
220
  return reg.test(msg);
228
221
 
229
222
  },
230
- //预览图片
231
- lookAttach(e){
232
- if (e.target.localName == 'a'){
233
- console.debug('lookImage',e.target.href)
234
- this.previewHref = e.target.href
235
- this.$refs.previewDoc.previewShowPopup = true
236
- // let url = ''
237
- // try {
238
- // url = btoa(e.target.href)
239
- // }
240
- // catch {
241
- // url = encodeURIComponent(btoa(e.target.href))
242
- // }
243
- // window.open('https://test.open.askbot.cn/kkfileview/onlinePreview?url=' + url)
244
- // e.stopPropagation()
245
- // e.preventDefault()
246
- e.returnValue = false
247
- }
248
- },
249
223
  },
250
224
  watch:{
251
225
  isOpen:{
@@ -291,10 +265,6 @@
291
265
  /*padding-bottom: 10px;
292
266
  border-bottom: 1px solid #EEEEEE;*/
293
267
  }
294
- /deep/a{
295
- disabled:true
296
- //pointer-events: none;
297
- }
298
268
  }
299
269
 
300
270
  </style>
@@ -1,14 +1,44 @@
1
1
  <template>
2
2
  <div id="attachment-upload">
3
3
  <div v-if="attachmentList.length != 0" class="image-list">
4
+ <!-- <template v-if="items.field.type === 'IMAGE'">
5
+ <div v-for="(item, index) in attachmentList" class="image-item" :key="item.url + index">
6
+ <template v-if="typeof item == 'object'">
7
+ <el-image style="width: 60px; height: 60px" :src="item.url" :preview-src-list="[item.url]">
8
+ </el-image>
9
+ </template>
10
+ <template v-else>
11
+ <el-image style="width: 60px; height: 60px" :src="item"
12
+ :preview-src-list="attachmentList">
13
+ </el-image>
14
+ </template>
15
+ <span class="delete" @click="deleteAttch(index)"><i
16
+ class="iconfont guoran-tongyichicun-16-09-shanchu2"></i></span>
17
+ </div>
18
+ </template>
19
+ <template v-else-if="items.field.type === 'VIDEO'">
20
+ <div v-for="(item, index) in attachmentList" class="video-item" :key="item.url + index">
21
+ <template v-if="typeof item == 'object'">
22
+ <img src="../assets/image/play.png"
23
+ @click="openDialog(item.url, item.name)">
24
+ </template>
25
+ <template v-else>
26
+ <img src="../assets/images/play.png"
27
+ @click="openDialog(item, item.name)">
28
+ </template>
29
+ <span class="delete" @click="deleteAttch(index)"><i
30
+ class="iconfont guoran-tongyichicun-16-09-shanchu2"></i></span>
31
+ </div>
32
+ </template> -->
4
33
  <template>
5
34
  <div v-for="(item, index) in attachmentList" class="attch-item" :key="item.url + index"
6
35
  >
36
+ <!-- @click="openDialog(item, item.name)" -->
7
37
  <span @click.stop="deleteAttch(index)"><i class="iconfont guoran-a-16-09"></i></span>
8
- <div class="attch-item-left" @click="lookAttach(item.url)">
38
+ <div class="attch-item-left">
9
39
  <i v-if="item.url == ''" class="el-icon-loading" style="color:#366AFF;margin: 5px;"></i>
10
40
  <img src="../assets/image/video.png"
11
- v-else-if="setSrc(item.name) == 'video'"/>
41
+ v-else-if="setSrc(item.name) == 'video'" />
12
42
  <img src="../assets/image/image.png"
13
43
  v-else-if="setSrc(item.name) == 'image'" />
14
44
  <img src="../assets/image/txt.png"
@@ -47,28 +77,40 @@
47
77
  <embed :src="dialogUrl" width="100%" height="100%" />
48
78
  </div>
49
79
  </el-dialog> -->
50
- <previewDoc ref="previewDoc" :url="previewHref"></previewDoc>
51
80
  </div>
52
81
  </template>
53
82
 
54
83
  <script>
55
- import previewDoc from './previewDoc.vue';
84
+
56
85
  export default {
57
86
  name: "customUpload",
58
- components: {previewDoc},
87
+ components: {},
59
88
  data () {
60
89
  return {
90
+ dialogUrl: "",
61
91
  dialogVisible: false,
62
- previewHref:""
92
+ fieldType: "",
63
93
  }
64
94
  },
65
95
  props: ["attachmentList"],
66
96
  methods: {
67
97
  //查看视频
68
- openDialog (item) {
98
+ openDialog (item, fileName) {
69
99
  let url = typeof item == 'object' ? item.url : item
70
- this.previewHref = url
71
- this.$refs.previewDoc.previewShowPopup = true
100
+ this.fieldType = ""
101
+ const fileType = fileName.substring(fileName.lastIndexOf('.'));
102
+ this.dialogUrl = url;
103
+ if (fileType === '.mp4' || fileType === '.MP4') {
104
+ this.fieldType = 'VIDEO'
105
+ this.dialogVisible = true;
106
+ }
107
+ else if (fileType === '.jpg' || fileType === '.png' || fileType === '.JPG' || fileType === '.PNG') {
108
+ this.fieldType = 'IMAGE'
109
+ this.dialogVisible = true;
110
+ }
111
+ else {
112
+ window.open(url, 'target');
113
+ }
72
114
  },
73
115
  deleteAttch (index) {
74
116
  this.$emit('attachDeleteAttch', index)
@@ -77,7 +119,7 @@ export default {
77
119
  setSrc (fileName) {
78
120
  let file = ""
79
121
  const fileType = fileName.substring(fileName.lastIndexOf('.'));
80
- if (fileType === '.mp4' || fileType === '.MP4' || fileType === '.mov' || fileType === '.MOV') {
122
+ if (fileType === '.mp4' || fileType === '.MP4') {
81
123
  file = 'video'
82
124
  }
83
125
  else if (fileType === '.jpg' || fileType === '.png' || fileType === '.JPG' || fileType === '.PNG') {
@@ -104,12 +146,6 @@ export default {
104
146
  updownload () {
105
147
  window.location.href = this.dialogUrl
106
148
  /*window.open(this.dialogUrl,'_black')*/
107
- },
108
- lookAttach(url){
109
- if(url !== '') {
110
- this.previewHref = url
111
- this.$refs.previewDoc.previewShowPopup = true
112
- }
113
149
  }
114
150
  }
115
151
  };
@@ -188,9 +224,7 @@ export default {
188
224
  align-items: center;
189
225
  flex: none;
190
226
  width: 97%;
191
- overflow: hidden;
192
- text-overflow: ellipsis;
193
- margin-left: 6px;
227
+
194
228
  img {
195
229
  margin-right: 4px;
196
230
  }
@@ -202,8 +202,8 @@
202
202
  v-else-if="item.formField.extInfo.cascadeDown.length != 0"
203
203
  ></el-cascader>-->
204
204
  </template>
205
- <template v-else-if="item.formField.type==='FILE' || item.formField.type === 'IMAGE' || item.formField.type === 'ATTACHMENT' || item.formField.type === 'VIDEO'">
206
- <div @click="checkUpload(item.fieldId,item.formField.extInfo)" @mouseover="checkUpload(item.fieldId,item.formField.extInfo)" class="form-field-file" style="display:flex;flex-direction: column">
205
+ <div v-else-if="item.formField.type==='FILE' || item.formField.type === 'IMAGE' || item.formField.type === 'ATTACHMENT' || item.formField.type === 'VIDEO'">
206
+ <div @click="checkUpload(item.fieldId,item.formField.extInfo)" @mouseover="checkUpload(item.fieldId,item.formField.extInfo)" style="flex: 0.75;display:flex;align-items: center;">
207
207
  <el-upload
208
208
 
209
209
  ref="upload"
@@ -220,16 +220,14 @@
220
220
  :http-request="aliyunOssRequest"
221
221
  :on-change="handleEditChange"
222
222
  :on-success="successUpload"
223
- :show-file-list="item.formField.type === 'IMAGE' ? true : false"
224
223
  >
225
224
  <div class="upload-demo">
226
225
  <i class="el-icon-plus"></i>
227
226
  </div>
228
227
  <!-- <el-button size="small" type="primary" v-else class="uploadBtn">点击上传</el-button>-->
229
228
  </el-upload>
230
- <file-list-view :attachmentList="extInfoFieldValue[item.fieldId]" v-if="extInfoFieldValue[item.fieldId] && item.formField.type !== 'IMAGE'" @attachDeleteAttch="attachDeleteFile($event,item.fieldId)"></file-list-view>
231
229
  </div>
232
- </template>
230
+ </div>
233
231
  <div v-else-if="item.formField.type == 'REF_TEMPLATE' || item.formField.type == 'REF'">
234
232
  <el-select
235
233
  v-model=item.value
@@ -658,13 +656,11 @@
658
656
  :after-read="afterRead"
659
657
  :accept="acceptFieldType(item.formField.type)"
660
658
  :multiple="item.formField.extInfo&&item.formField.extInfo.limitNum&&item.formField.extInfo.limitNum>1?true:false"
661
- :preview-image="item.formField.type === 'IMAGE' ? true : false"
662
659
  >
663
660
  <div class="vant-upload--picture-card">
664
661
  <i class="el-icon-plus"></i>
665
662
  </div>
666
663
  </van-uploader>
667
- <file-list-view :attachmentList="extInfoFieldValue[item.fieldId]" v-if="extInfoFieldValue[item.fieldId] && item.formField.type !== 'IMAGE' && !fileUpload" @attachDeleteAttch="attachDeleteFile($event,item.fieldId)"></file-list-view>
668
664
  </div>
669
665
  </div>
670
666
  </div>
@@ -961,10 +957,12 @@ export default {
961
957
  }
962
958
  })
963
959
  let newArr = arr.filter(item=>item.relationDisplay)
960
+ console.debug('formFieldRelation',arr,newArr)
964
961
  return newArr;
965
962
  },
966
963
  acceptFieldType(){
967
964
  return (type)=>{
965
+ console.debug('type',type)
968
966
  if (type == 'FILE'){
969
967
  return 'image/*'
970
968
  } else if( type == 'IMAGE') {
@@ -2386,7 +2384,7 @@ export default {
2386
2384
  }
2387
2385
  if (!this.extInfoFieldValue[this.filedId])
2388
2386
  {
2389
- this.$set(this.extInfoFieldValue,this.filedId,[])
2387
+ this.extInfoFieldValue[this.filedId] = []
2390
2388
  }
2391
2389
  this.extInfoFieldValue[this.filedId].push(imgInfo)
2392
2390
  this.loading.close()
@@ -2856,9 +2854,6 @@ export default {
2856
2854
  attachDeleteAttch (index) {
2857
2855
  this.attachments.splice(index, 1)
2858
2856
  this.attachmentList.splice(index, 1)
2859
- },
2860
- attachDeleteFile(index,fieldId){
2861
- this.extInfoFieldValue[fieldId].splice(index,1)
2862
2857
  }
2863
2858
  },
2864
2859
  watch:{
@@ -3001,13 +2996,6 @@ export default {
3001
2996
  font-size: 1em;
3002
2997
  padding-bottom: 8px;
3003
2998
  }
3004
- .form-field-file{
3005
- #attachment-upload{
3006
- /deep/.image-list{
3007
- padding: 0;
3008
- }
3009
- }
3010
- }
3011
2999
  }
3012
3000
  .pcFormClass{
3013
3001
  width: 400px;
@@ -3146,11 +3134,6 @@ export default {
3146
3134
  color: #A9B3C6;
3147
3135
  /* color: #000000;*/
3148
3136
  }
3149
- #attachment-upload{
3150
- /deep/.image-list{
3151
- padding: 0;
3152
- }
3153
- }
3154
3137
  }
3155
3138
  .workorder_description{
3156
3139
  /* padding: 8px 16px;*/
@@ -1,91 +0,0 @@
1
- <template>
2
- <view class="attachment">
3
- <view class="attachment-container">
4
- <iframe width="100%" height="100%" :src="iframeSrc"
5
- v-if="type!=='video'"
6
- id="iframePreview"
7
- frameborder="no"
8
- border="0"
9
- scrolling="no"
10
- seamless></iframe>
11
- <video :src="videoUrl" controls v-else></video>
12
- </view>
13
- </view>
14
-
15
- </template>
16
-
17
- <script>
18
- export default {
19
- name: "attachmentPreview",
20
- data(){
21
- return{
22
- iframeSrc:"",
23
- type:"",
24
- videoUrl:""
25
- }
26
- },
27
- mounted(){
28
- let option = {}
29
- this.iframeSrc = option.url ? option.url : "";
30
- this.type = option.type ? option.type : "";
31
- this.videoUrl = option.videoUrl ? option.videoUrl : ""
32
- },
33
- methods:{
34
-
35
- }
36
- };
37
- </script>
38
-
39
- <style scoped lang="less">
40
- video{
41
- width: 100%;
42
- height: 100%;
43
- }
44
- .attachment{
45
- height: 100%;
46
- .attachment-container{
47
- height: 100%;
48
- overflow: hidden;
49
- }
50
- }
51
- .attachment-footer{
52
- position: absolute;
53
- bottom: 0;
54
- padding: 10px 0;
55
- width:100%;
56
- background-color: white;
57
- display: flex;
58
- justify-content: space-around;
59
- align-items: center;
60
- box-shadow: 0px 0px 3px 1px rgba(0, 0, 0, 0.07);
61
- // z-index:0;
62
- .cacelBtn{
63
- flex: 0.3;
64
- height: 48px;
65
- background: #EFF2F5;
66
- color: #999999;
67
- border-radius: 28px;
68
- display: flex;
69
- align-items: center;
70
- justify-content: center;
71
- cursor: pointer;
72
- i{
73
- margin-right: 8px;
74
- }
75
- }
76
- .confirmBtn{
77
- background-color: #366AFF;
78
- color: white;
79
- flex: 0.5;
80
- height: 48px;
81
- display: flex;
82
- align-items: center;
83
- justify-content: center;
84
- border-radius: 28px;
85
- cursor: pointer;
86
- i{
87
- margin-right: 8px;
88
- }
89
- }
90
- }
91
- </style>
@@ -1,94 +0,0 @@
1
- <template>
2
- <van-popup v-model="previewShowPopup" position="bottom" :style="{ height: '100%', background:'#FFFFFF'}">
3
- <div v-if="fileType == 'VIDEO'" style="width: 100%;height: calc(100% - 70px)">
4
- <video :src="url" controls width="100%;" height="98%"></video>
5
- </div>
6
- <template v-else-if="url.includes('https://www') || url.includes('http://www')">
7
- <iframe class="preview_iframe"
8
- :src="url"
9
- width="100%"
10
- height="100%"
11
- scrolling="100%"
12
- frameborder="no"
13
- border="0"></iframe>
14
- </template>
15
- <template v-else>
16
- <iframe class="preview_iframe" :src="previewUrl" style="border:none;"></iframe>
17
- </template>
18
- <div class="footer">
19
- <section class="close_btn" @click="close">
20
- 关闭
21
- </section>
22
- </div>
23
- </van-popup>
24
- </template>
25
-
26
- <script>
27
- export default {
28
- data () {
29
- return {
30
- previewShowPopup: false
31
- }
32
- },
33
- props:{
34
- url:{
35
- type: String,
36
- required: true,
37
- }
38
- },
39
- computed:{
40
- previewUrl() {
41
- let url = 'https://test.open.askbot.cn/kkfileview/onlinePreview?url='
42
- if(this.url != '') {
43
- if(/[\u4E00-\u9FA5]+/g.test(this.url)) {
44
- console.log('123123');
45
- url += btoa(encodeURIComponent(this.url))
46
- } else {
47
- console.log('asdadasd');
48
- url += btoa(this.url)
49
- }
50
- }
51
- return url
52
- },
53
- fileType() {
54
- const fileType = this.url.substring(this.url.lastIndexOf('.'));
55
- if (fileType === '.mp4' || fileType === '.MP4' || fileType === '.MOV' || fileType === '.mov') {
56
- return 'VIDEO'
57
- } else {
58
- return 'OTHER'
59
- }
60
-
61
- }
62
- },
63
- methods :{
64
- close() {
65
- this.previewShowPopup = false
66
- }
67
- }
68
- }
69
- </script>
70
-
71
- <style lang="less" scoped>
72
- .preview_iframe {
73
- width: 100%;
74
- height: calc(100% - 60px);
75
- }
76
- .footer {
77
- width: 100%;
78
- height: 50px;
79
- display: flex;
80
- align-items: start ;
81
- justify-content: center;
82
- cursor: pointer;
83
- .close_btn {
84
- width: 80%;
85
- height: 50px;
86
- border-radius: 50px;
87
- background: #EFF2F5;
88
- color: #999999;
89
- font-size: 14px;
90
- line-height: 50px;
91
- text-align: center;
92
- }
93
- }
94
- </style>