@aochuang/client-sdk 1.0.316 → 1.0.317

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.
@@ -1,14 +1,14 @@
1
1
  <template>
2
2
  <ui-dialog
3
3
  v-model="visible"
4
- title="选择缩略图/原图"
4
+ title="拖拽图片到其他"
5
5
  size="mini"
6
6
  :closeable="!loading"
7
7
  :close-on-click-modal="false"
8
8
  @closed="handleClosed"
9
9
  >
10
10
  <div class="sdk-chat-control-image-dragable-confirm">
11
- <div class="sdk-chat-control-image-dragable-confirm__check">
11
+ <div v-if="isOriginImage" class="sdk-chat-control-image-dragable-confirm__check">
12
12
  <ui-radio-group v-model="currentType">
13
13
  <ui-radio label="thumb">使用缩略图</ui-radio>
14
14
  <ui-radio label="origin">使用原图</ui-radio>
@@ -17,7 +17,7 @@
17
17
  <div class="sdk-chat-control-image-dragable-confirm__preview">
18
18
  <ui-image :src="previewSrc" width="100%" height="100%" :enable-thumbnail="false"></ui-image>
19
19
  </div>
20
- <div class="sdk-chat-control-image-dragable-confirm__text">
20
+ <div v-if="isOriginImage" class="sdk-chat-control-image-dragable-confirm__text">
21
21
  <template v-if="currentType === 'thumb'">
22
22
  缩略图文件较小,拖拽更快,但显示可能失真。
23
23
  </template>
@@ -25,6 +25,9 @@
25
25
  原图显示效果更好,但文件较大,加载可能较慢。
26
26
  </template>
27
27
  </div>
28
+ <div v-else class="sdk-chat-control-image-dragable-confirm__text">
29
+ 请从此处拖拽图片到其他软件
30
+ </div>
28
31
  <div class="sdk-chat-control-image-dragable-confirm__actions">
29
32
  <ui-button :disabled="loading" @click="handleCancelClick">取消</ui-button>
30
33
  </div>
@@ -52,6 +55,10 @@ export default {
52
55
  loading: {
53
56
  type: Boolean,
54
57
  default: false
58
+ },
59
+ isOriginImage: {
60
+ type: Boolean,
61
+ default: false
55
62
  }
56
63
  },
57
64
  data () {
@@ -65,6 +72,9 @@ export default {
65
72
  computed: {
66
73
  innerSrc () {
67
74
  let src = this.src
75
+ if (!this.isOriginImage) {
76
+ return formatOssPath(src)
77
+ }
68
78
  if (this.currentType === 'origin') {
69
79
  src = getOriginImageSrc(src)
70
80
  } else {
@@ -85,12 +85,14 @@
85
85
  <image-dragable-confirm
86
86
  v-if="showDragOriginConfirm"
87
87
  :src="src"
88
+ :is-origin-image="isOriginImage"
88
89
  @closed="handleDragOriginConfirmClosed"
89
90
  ></image-dragable-confirm>
90
91
  </div>
91
92
  </template>
92
93
  <script>
93
94
  import { Image as UiImage, Button as UiButton, Icon as UiIcon } from '@aochuang/common/components'
95
+ import { formatOssPath } from '@aochuang/common/utils/oss'
94
96
  import { isOriginImage, getNewImageSrc, isNewImage } from './util'
95
97
  import BiTooltip from '@aochuang/common/common/tooltip'
96
98
  import ImageDragableConfirm from './image-dragable-confirm.vue'
@@ -258,6 +260,12 @@ export default {
258
260
  isOriginImage () {
259
261
  return isOriginImage(this.src)
260
262
  },
263
+ isPrivateOssImage () {
264
+ if (!this.src) {
265
+ return false
266
+ }
267
+ return formatOssPath(this.src) !== this.src
268
+ },
261
269
  allowDefrost () {
262
270
  return !!this.defrostMethod
263
271
  }
@@ -275,7 +283,7 @@ export default {
275
283
  this.imageClickMethod && this.imageClickMethod()
276
284
  },
277
285
  handleImageDragStart (event) {
278
- if (!this.enableDragOriginImage || !this.isOriginImage) {
286
+ if (!(this.enableDragOriginImage && this.isOriginImage) && !this.isPrivateOssImage) {
279
287
  return
280
288
  }
281
289
  event.preventDefault()
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@aochuang/client-sdk",
3
- "version": "1.0.316",
3
+ "version": "1.0.317",
4
4
  "description": "",
5
5
  "scripts": {
6
6
  "test": "echo \"Error: no test specified\" && exit 1"
@@ -769,7 +769,7 @@ class ClientChat {
769
769
  },
770
770
  onAccountLoaded: () => {
771
771
  this.socket.doHeartbeat()
772
- this.account.refreshAllAccountGreetingUnreadMsgCount().catch(() => {})
772
+ this.account.refreshAllAccountGreetingUnreadMsgCount()
773
773
  },
774
774
  onCurrentAccountChange: ({ currentAccount }) => {
775
775
  // // 如果群分组数据加载了再去刷成员数量,这样可以做到按需