@aochuang/client-sdk 1.0.353 → 1.0.354

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.
@@ -28,6 +28,7 @@
28
28
  import FileIcon from './icons'
29
29
  import { parse } from '../../../utils/json'
30
30
  import { formatFileSize } from '../../../utils/file'
31
+ import { formatOssPath } from '@aochuang/common/utils/oss'
31
32
 
32
33
  export default {
33
34
  name: 'SdkChatControlFileUrl',
@@ -71,7 +72,8 @@ export default {
71
72
  },
72
73
  computed: {
73
74
  url () {
74
- return this.nextContent.resPath || this.nextContent.url || this.nextContent.resUrl
75
+ const url = this.nextContent.resPath || this.nextContent.url || this.nextContent.resUrl
76
+ return url ? formatOssPath(url) : url
75
77
  },
76
78
  name () {
77
79
  return this.nextContent.fileName || this.nextContent.title || this.url
@@ -47,6 +47,7 @@ export const chatControls = {
47
47
  [MESSAGE_TYPE.VIDEO]: video,
48
48
  [MESSAGE_TYPE.CUSTOM_EXPRESSION]: customExpression,
49
49
  [MESSAGE_TYPE.LOCATION]: location,
50
+ [MESSAGE_TYPE.URLFile]: fileUrl,
50
51
  [MESSAGE_TYPE.URL]: url,
51
52
  [MESSAGE_TYPE.URLNew]: fileUrl,
52
53
  // [MESSAGE_TYPE.CALLING]: calling,
@@ -2,6 +2,7 @@ export const MESSAGE_TYPE = {
2
2
  TEXT: 0,
3
3
  TEXT_W: 1,
4
4
  IMAGE: 14,
5
+ URLFile: 15,
5
6
  VOICE: 16,
6
7
  VIDEO: 22,
7
8
  CUSTOM_EXPRESSION: 29,
@@ -112,6 +113,7 @@ export function formatShortMessage (msgType, msgContent) {
112
113
  shortMessage = formatSystemMessage(msgContent)
113
114
  break
114
115
  case MESSAGE_TYPE.URL:
116
+ case MESSAGE_TYPE.URLFile:
115
117
  case MESSAGE_TYPE.URLNew:
116
118
  const jsonObj = toJson(msgContent)
117
119
  if (typeof jsonObj === 'object') {
@@ -289,6 +289,29 @@
289
289
  </template>
290
290
  </sdk-chat-panel-box>
291
291
  </template>
292
+ <template v-else-if="item.msgType == MESSAGE_TYPE.URLFile">
293
+ <sdk-chat-panel-box
294
+ :dir="dir"
295
+ :data="item"
296
+ :fetchUserMethod="fetchUserMethod"
297
+ bg-color="#fff"
298
+ br-color="#ddd"
299
+ @user-avatar-click="handleUserAvatarClick"
300
+ @user-avatar-contextmenu="handleUserAvatarContextmenu"
301
+ >
302
+ <template slot-scope="{ updateProp }">
303
+ <sdk-chat-control-file-url
304
+ v-bind="configData"
305
+ :id="item.id"
306
+ :content="msgContent"
307
+ :update-chat-box-prop="updateProp"
308
+ ></sdk-chat-control-file-url>
309
+ </template>
310
+ <template slot="append" slot-scope="{ updateProp }">
311
+ <slot name="chat-append" :item="item" :update-chat-box-prop="updateProp"></slot>
312
+ </template>
313
+ </sdk-chat-panel-box>
314
+ </template>
292
315
  <template v-else-if="item.msgType == MESSAGE_TYPE.URL || item.msgType == MESSAGE_TYPE.URLNew">
293
316
  <sdk-chat-panel-box
294
317
  :dir="dir"
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@aochuang/client-sdk",
3
- "version": "1.0.353",
3
+ "version": "1.0.354",
4
4
  "description": "",
5
5
  "files": [
6
6
  "common",