yx-web-sdk 0.0.19 → 0.0.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 (32) hide show
  1. package/dist/ait-person-popover/index.js +1 -1
  2. package/dist/chat-card/index.js +1 -1
  3. package/dist/chat-content/index.js +1 -1
  4. package/dist/chat-page/index.js +1 -1
  5. package/dist/chat-room/index.js +1 -1
  6. package/dist/common-avatar/index.js +1 -1
  7. package/dist/components/img-info-wrapper/index.d.ts +0 -0
  8. package/dist/components/img-info-wrapper/index.vue.d.ts +6 -0
  9. package/dist/img-info-wrapper/index.js +1 -0
  10. package/dist/index/style2.css +30 -162
  11. package/dist/index/style4.css +177 -125
  12. package/dist/index/style6.css +513 -25
  13. package/dist/index/style7.css +143 -466
  14. package/dist/{index-DHnPD8u9.mjs → index-BPnLB3av.mjs} +1 -1
  15. package/dist/{index-BjIqS2ZC.mjs → index-DME8_VYv.mjs} +2 -2
  16. package/dist/{index-D5gp5t2F.mjs → index-Dwglj7_M.mjs} +1 -1
  17. package/dist/index-entry/index.js +4 -4
  18. package/dist/{index.vue_vue_type_script_setup_true_lang-CkWszgC3.mjs → index.vue_vue_type_script_setup_true_lang-CD6o8jT4.mjs} +9 -3
  19. package/dist/{index.vue_vue_type_style_index_0_lang-C-imP01W.mjs → index.vue_vue_type_style_index_0_lang-BJGCxPce.mjs} +3 -3
  20. package/dist/{index.vue_vue_type_style_index_0_lang-CAZ44kgX.mjs → index.vue_vue_type_style_index_0_lang-BaKNB-4q.mjs} +33 -7
  21. package/dist/{index.vue_vue_type_style_index_0_lang-CA27kCm1.mjs → index.vue_vue_type_style_index_0_lang-CsNgkPt9.mjs} +101 -17
  22. package/dist/{index.vue_vue_type_style_index_0_lang-5DeqmRdw.mjs → index.vue_vue_type_style_index_0_lang-iBkYSdDj.mjs} +156 -38
  23. package/dist/members-sidebar/index.js +1 -1
  24. package/dist/notice-box/index.js +1 -1
  25. package/dist/server-channel-sidebar/index.js +1 -1
  26. package/dist/stores/channel.d.ts +18 -2
  27. package/dist/style.css +155 -70
  28. package/dist/utils/index.d.ts +10 -2
  29. package/dist/yx-web-sdk.es.js +321 -90
  30. package/dist/yx-web-sdk.umd.js +320 -89
  31. package/package.json +1 -1
  32. /package/dist/{index.vue_vue_type_style_index_0_lang-B2YRkoln.mjs → index.vue_vue_type_style_index_0_lang-BxXBf_VA.mjs} +0 -0
@@ -1,4 +1,4 @@
1
- import { inject, ref, getCurrentInstance, nextTick, h, reactive, defineComponent, createVNode, computed, openBlock, createElementBlock, normalizeStyle, createCommentVNode, toDisplayString, onBeforeUnmount, watch, normalizeClass, Fragment, createElementVNode, withModifiers, createBlock, unref, withCtx, withDirectives, vShow, Teleport, renderList, onMounted, onUnmounted, createTextVNode } from "vue";
1
+ import { inject, ref, getCurrentInstance, nextTick, h, reactive, defineComponent, createVNode, computed, openBlock, createElementBlock, normalizeStyle, createCommentVNode, toDisplayString, createElementVNode, unref, onBeforeUnmount, watch, normalizeClass, Fragment, withModifiers, createBlock, withCtx, withDirectives, vShow, Teleport, renderList, onMounted, onUnmounted, createTextVNode } from "vue";
2
2
  import { useClipboard, useEventListener, useDebounceFn, useLocalStorage } from "@vueuse/core";
3
3
  import { message, Image, Button, Input, Popover, Upload, List, Typography, Form, Tooltip, Badge, Modal, Spin as Spin$1, Result, Empty } from "ant-design-vue";
4
4
  import { defineStore, createPinia } from "pinia";
@@ -718,7 +718,7 @@ function updateCSS(css, key) {
718
718
  newNode.setAttribute(getMark(option), key);
719
719
  return newNode;
720
720
  }
721
- function _objectSpread$b(target) {
721
+ function _objectSpread$c(target) {
722
722
  for (var i = 1; i < arguments.length; i++) {
723
723
  var source = arguments[i] != null ? Object(arguments[i]) : {};
724
724
  var ownKeys = Object.keys(source);
@@ -728,12 +728,12 @@ function _objectSpread$b(target) {
728
728
  }));
729
729
  }
730
730
  ownKeys.forEach(function(key) {
731
- _defineProperty$b(target, key, source[key]);
731
+ _defineProperty$c(target, key, source[key]);
732
732
  });
733
733
  }
734
734
  return target;
735
735
  }
736
- function _defineProperty$b(obj, key, value) {
736
+ function _defineProperty$c(obj, key, value) {
737
737
  if (key in obj) {
738
738
  Object.defineProperty(obj, key, { value, enumerable: true, configurable: true, writable: true });
739
739
  } else {
@@ -754,13 +754,13 @@ function isIconDefinition(target) {
754
754
  }
755
755
  function generate(node, key, rootProps) {
756
756
  if (!rootProps) {
757
- return h(node.tag, _objectSpread$b({
757
+ return h(node.tag, _objectSpread$c({
758
758
  key
759
759
  }, node.attrs), (node.children || []).map(function(child, index2) {
760
760
  return generate(child, "".concat(key, "-").concat(node.tag, "-").concat(index2));
761
761
  }));
762
762
  }
763
- return h(node.tag, _objectSpread$b({
763
+ return h(node.tag, _objectSpread$c({
764
764
  key
765
765
  }, rootProps, node.attrs), (node.children || []).map(function(child, index2) {
766
766
  return generate(child, "".concat(key, "-").concat(node.tag, "-").concat(index2));
@@ -843,7 +843,7 @@ function _objectWithoutPropertiesLoose$3(source, excluded) {
843
843
  }
844
844
  return target;
845
845
  }
846
- function _objectSpread$a(target) {
846
+ function _objectSpread$b(target) {
847
847
  for (var i = 1; i < arguments.length; i++) {
848
848
  var source = arguments[i] != null ? Object(arguments[i]) : {};
849
849
  var ownKeys = Object.keys(source);
@@ -853,12 +853,12 @@ function _objectSpread$a(target) {
853
853
  }));
854
854
  }
855
855
  ownKeys.forEach(function(key) {
856
- _defineProperty$a(target, key, source[key]);
856
+ _defineProperty$b(target, key, source[key]);
857
857
  });
858
858
  }
859
859
  return target;
860
860
  }
861
- function _defineProperty$a(obj, key, value) {
861
+ function _defineProperty$b(obj, key, value) {
862
862
  if (key in obj) {
863
863
  Object.defineProperty(obj, key, { value, enumerable: true, configurable: true, writable: true });
864
864
  } else {
@@ -878,10 +878,10 @@ function setTwoToneColors(_ref) {
878
878
  twoToneColorPalette.calculated = !!secondaryColor;
879
879
  }
880
880
  function getTwoToneColors() {
881
- return _objectSpread$a({}, twoToneColorPalette);
881
+ return _objectSpread$b({}, twoToneColorPalette);
882
882
  }
883
883
  var IconBase = function IconBase2(props, context) {
884
- var _props$context$attrs = _objectSpread$a({}, props, context.attrs), icon = _props$context$attrs.icon, primaryColor = _props$context$attrs.primaryColor, secondaryColor = _props$context$attrs.secondaryColor, restProps = _objectWithoutProperties$3(_props$context$attrs, _excluded$3);
884
+ var _props$context$attrs = _objectSpread$b({}, props, context.attrs), icon = _props$context$attrs.icon, primaryColor = _props$context$attrs.primaryColor, secondaryColor = _props$context$attrs.secondaryColor, restProps = _objectWithoutProperties$3(_props$context$attrs, _excluded$3);
885
885
  var colors = twoToneColorPalette;
886
886
  if (primaryColor) {
887
887
  colors = {
@@ -895,11 +895,11 @@ var IconBase = function IconBase2(props, context) {
895
895
  }
896
896
  var target = icon;
897
897
  if (target && typeof target.icon === "function") {
898
- target = _objectSpread$a({}, target, {
898
+ target = _objectSpread$b({}, target, {
899
899
  icon: target.icon(colors.primaryColor, colors.secondaryColor)
900
900
  });
901
901
  }
902
- return generate(target.icon, "svg-".concat(target.name), _objectSpread$a({}, restProps, {
902
+ return generate(target.icon, "svg-".concat(target.name), _objectSpread$b({}, restProps, {
903
903
  "data-icon": target.name,
904
904
  width: "1em",
905
905
  height: "1em",
@@ -1037,7 +1037,7 @@ function _iterableToArrayLimit(arr, i) {
1037
1037
  function _arrayWithHoles(arr) {
1038
1038
  if (Array.isArray(arr)) return arr;
1039
1039
  }
1040
- function _objectSpread$9(target) {
1040
+ function _objectSpread$a(target) {
1041
1041
  for (var i = 1; i < arguments.length; i++) {
1042
1042
  var source = arguments[i] != null ? Object(arguments[i]) : {};
1043
1043
  var ownKeys = Object.keys(source);
@@ -1047,12 +1047,12 @@ function _objectSpread$9(target) {
1047
1047
  }));
1048
1048
  }
1049
1049
  ownKeys.forEach(function(key) {
1050
- _defineProperty$9(target, key, source[key]);
1050
+ _defineProperty$a(target, key, source[key]);
1051
1051
  });
1052
1052
  }
1053
1053
  return target;
1054
1054
  }
1055
- function _defineProperty$9(obj, key, value) {
1055
+ function _defineProperty$a(obj, key, value) {
1056
1056
  if (key in obj) {
1057
1057
  Object.defineProperty(obj, key, { value, enumerable: true, configurable: true, writable: true });
1058
1058
  } else {
@@ -1090,9 +1090,9 @@ function _objectWithoutPropertiesLoose$2(source, excluded) {
1090
1090
  setTwoToneColor(blue.primary);
1091
1091
  var Icon$1 = function Icon(props, context) {
1092
1092
  var _classObj;
1093
- var _props$context$attrs = _objectSpread$9({}, props, context.attrs), cls = _props$context$attrs["class"], icon = _props$context$attrs.icon, spin = _props$context$attrs.spin, rotate = _props$context$attrs.rotate, tabindex = _props$context$attrs.tabindex, twoToneColor = _props$context$attrs.twoToneColor, onClick = _props$context$attrs.onClick, restProps = _objectWithoutProperties$2(_props$context$attrs, _excluded$2);
1093
+ var _props$context$attrs = _objectSpread$a({}, props, context.attrs), cls = _props$context$attrs["class"], icon = _props$context$attrs.icon, spin = _props$context$attrs.spin, rotate = _props$context$attrs.rotate, tabindex = _props$context$attrs.tabindex, twoToneColor = _props$context$attrs.twoToneColor, onClick = _props$context$attrs.onClick, restProps = _objectWithoutProperties$2(_props$context$attrs, _excluded$2);
1094
1094
  var _useInjectIconContext = useInjectIconContext(), prefixCls = _useInjectIconContext.prefixCls, rootClassName = _useInjectIconContext.rootClassName;
1095
- var classObj = (_classObj = {}, _defineProperty$9(_classObj, rootClassName.value, !!rootClassName.value), _defineProperty$9(_classObj, prefixCls.value, true), _defineProperty$9(_classObj, "".concat(prefixCls.value, "-").concat(icon.name), Boolean(icon.name)), _defineProperty$9(_classObj, "".concat(prefixCls.value, "-spin"), !!spin || icon.name === "loading"), _classObj);
1095
+ var classObj = (_classObj = {}, _defineProperty$a(_classObj, rootClassName.value, !!rootClassName.value), _defineProperty$a(_classObj, prefixCls.value, true), _defineProperty$a(_classObj, "".concat(prefixCls.value, "-").concat(icon.name), Boolean(icon.name)), _defineProperty$a(_classObj, "".concat(prefixCls.value, "-spin"), !!spin || icon.name === "loading"), _classObj);
1096
1096
  var iconTabIndex = tabindex;
1097
1097
  if (iconTabIndex === void 0 && onClick) {
1098
1098
  iconTabIndex = -1;
@@ -1102,7 +1102,7 @@ var Icon$1 = function Icon(props, context) {
1102
1102
  transform: "rotate(".concat(rotate, "deg)")
1103
1103
  } : void 0;
1104
1104
  var _normalizeTwoToneColo = normalizeTwoToneColors(twoToneColor), _normalizeTwoToneColo2 = _slicedToArray(_normalizeTwoToneColo, 2), primaryColor = _normalizeTwoToneColo2[0], secondaryColor = _normalizeTwoToneColo2[1];
1105
- return createVNode("span", _objectSpread$9({
1105
+ return createVNode("span", _objectSpread$a({
1106
1106
  "role": "img",
1107
1107
  "aria-label": icon.name
1108
1108
  }, restProps, {
@@ -1127,7 +1127,7 @@ Icon$1.inheritAttrs = false;
1127
1127
  Icon$1.getTwoToneColor = getTwoToneColor;
1128
1128
  Icon$1.setTwoToneColor = setTwoToneColor;
1129
1129
  var CloseOutlined$1 = { "icon": { "tag": "svg", "attrs": { "fill-rule": "evenodd", "viewBox": "64 64 896 896", "focusable": "false" }, "children": [{ "tag": "path", "attrs": { "d": "M799.86 166.31c.02 0 .04.02.08.06l57.69 57.7c.04.03.05.05.06.08a.12.12 0 010 .06c0 .03-.02.05-.06.09L569.93 512l287.7 287.7c.04.04.05.06.06.09a.12.12 0 010 .07c0 .02-.02.04-.06.08l-57.7 57.69c-.03.04-.05.05-.07.06a.12.12 0 01-.07 0c-.03 0-.05-.02-.09-.06L512 569.93l-287.7 287.7c-.04.04-.06.05-.09.06a.12.12 0 01-.07 0c-.02 0-.04-.02-.08-.06l-57.69-57.7c-.04-.03-.05-.05-.06-.07a.12.12 0 010-.07c0-.03.02-.05.06-.09L454.07 512l-287.7-287.7c-.04-.04-.05-.06-.06-.09a.12.12 0 010-.07c0-.02.02-.04.06-.08l57.7-57.69c.03-.04.05-.05.07-.06a.12.12 0 01.07 0c.03 0 .05.02.09.06L512 454.07l287.7-287.7c.04-.04.06-.05.09-.06a.12.12 0 01.07 0z" } }] }, "name": "close", "theme": "outlined" };
1130
- function _objectSpread$8(target) {
1130
+ function _objectSpread$9(target) {
1131
1131
  for (var i = 1; i < arguments.length; i++) {
1132
1132
  var source = arguments[i] != null ? Object(arguments[i]) : {};
1133
1133
  var ownKeys = Object.keys(source);
@@ -1137,12 +1137,12 @@ function _objectSpread$8(target) {
1137
1137
  }));
1138
1138
  }
1139
1139
  ownKeys.forEach(function(key) {
1140
- _defineProperty$8(target, key, source[key]);
1140
+ _defineProperty$9(target, key, source[key]);
1141
1141
  });
1142
1142
  }
1143
1143
  return target;
1144
1144
  }
1145
- function _defineProperty$8(obj, key, value) {
1145
+ function _defineProperty$9(obj, key, value) {
1146
1146
  if (key in obj) {
1147
1147
  Object.defineProperty(obj, key, { value, enumerable: true, configurable: true, writable: true });
1148
1148
  } else {
@@ -1151,14 +1151,46 @@ function _defineProperty$8(obj, key, value) {
1151
1151
  return obj;
1152
1152
  }
1153
1153
  var CloseOutlined = function CloseOutlined2(props, context) {
1154
- var p = _objectSpread$8({}, props, context.attrs);
1155
- return createVNode(Icon$1, _objectSpread$8({}, p, {
1154
+ var p = _objectSpread$9({}, props, context.attrs);
1155
+ return createVNode(Icon$1, _objectSpread$9({}, p, {
1156
1156
  "icon": CloseOutlined$1
1157
1157
  }), null);
1158
1158
  };
1159
1159
  CloseOutlined.displayName = "CloseOutlined";
1160
1160
  CloseOutlined.inheritAttrs = false;
1161
1161
  var CrownOutlined$1 = { "icon": { "tag": "svg", "attrs": { "viewBox": "64 64 896 896", "focusable": "false" }, "children": [{ "tag": "path", "attrs": { "d": "M899.6 276.5L705 396.4 518.4 147.5a8.06 8.06 0 00-12.9 0L319 396.4 124.3 276.5c-5.7-3.5-13.1 1.2-12.2 7.9L188.5 865c1.1 7.9 7.9 14 16 14h615.1c8 0 14.9-6 15.9-14l76.4-580.6c.8-6.7-6.5-11.4-12.3-7.9zm-126 534.1H250.3l-53.8-409.4 139.8 86.1L512 252.9l175.7 234.4 139.8-86.1-53.9 409.4zM512 509c-62.1 0-112.6 50.5-112.6 112.6S449.9 734.2 512 734.2s112.6-50.5 112.6-112.6S574.1 509 512 509zm0 160.9c-26.6 0-48.2-21.6-48.2-48.3 0-26.6 21.6-48.3 48.2-48.3s48.2 21.6 48.2 48.3c0 26.6-21.6 48.3-48.2 48.3z" } }] }, "name": "crown", "theme": "outlined" };
1162
+ function _objectSpread$8(target) {
1163
+ for (var i = 1; i < arguments.length; i++) {
1164
+ var source = arguments[i] != null ? Object(arguments[i]) : {};
1165
+ var ownKeys = Object.keys(source);
1166
+ if (typeof Object.getOwnPropertySymbols === "function") {
1167
+ ownKeys = ownKeys.concat(Object.getOwnPropertySymbols(source).filter(function(sym) {
1168
+ return Object.getOwnPropertyDescriptor(source, sym).enumerable;
1169
+ }));
1170
+ }
1171
+ ownKeys.forEach(function(key) {
1172
+ _defineProperty$8(target, key, source[key]);
1173
+ });
1174
+ }
1175
+ return target;
1176
+ }
1177
+ function _defineProperty$8(obj, key, value) {
1178
+ if (key in obj) {
1179
+ Object.defineProperty(obj, key, { value, enumerable: true, configurable: true, writable: true });
1180
+ } else {
1181
+ obj[key] = value;
1182
+ }
1183
+ return obj;
1184
+ }
1185
+ var CrownOutlined = function CrownOutlined2(props, context) {
1186
+ var p = _objectSpread$8({}, props, context.attrs);
1187
+ return createVNode(Icon$1, _objectSpread$8({}, p, {
1188
+ "icon": CrownOutlined$1
1189
+ }), null);
1190
+ };
1191
+ CrownOutlined.displayName = "CrownOutlined";
1192
+ CrownOutlined.inheritAttrs = false;
1193
+ var DeleteOutlined$1 = { "icon": { "tag": "svg", "attrs": { "viewBox": "64 64 896 896", "focusable": "false" }, "children": [{ "tag": "path", "attrs": { "d": "M360 184h-8c4.4 0 8-3.6 8-8v8h304v-8c0 4.4 3.6 8 8 8h-8v72h72v-80c0-35.3-28.7-64-64-64H352c-35.3 0-64 28.7-64 64v80h72v-72zm504 72H160c-17.7 0-32 14.3-32 32v32c0 4.4 3.6 8 8 8h60.4l24.7 523c1.6 34.1 29.8 61 63.9 61h454c34.2 0 62.3-26.8 63.9-61l24.7-523H888c4.4 0 8-3.6 8-8v-32c0-17.7-14.3-32-32-32zM731.3 840H292.7l-24.2-512h487l-24.2 512z" } }] }, "name": "delete", "theme": "outlined" };
1162
1194
  function _objectSpread$7(target) {
1163
1195
  for (var i = 1; i < arguments.length; i++) {
1164
1196
  var source = arguments[i] != null ? Object(arguments[i]) : {};
@@ -1182,14 +1214,14 @@ function _defineProperty$7(obj, key, value) {
1182
1214
  }
1183
1215
  return obj;
1184
1216
  }
1185
- var CrownOutlined = function CrownOutlined2(props, context) {
1217
+ var DeleteOutlined = function DeleteOutlined2(props, context) {
1186
1218
  var p = _objectSpread$7({}, props, context.attrs);
1187
1219
  return createVNode(Icon$1, _objectSpread$7({}, p, {
1188
- "icon": CrownOutlined$1
1220
+ "icon": DeleteOutlined$1
1189
1221
  }), null);
1190
1222
  };
1191
- CrownOutlined.displayName = "CrownOutlined";
1192
- CrownOutlined.inheritAttrs = false;
1223
+ DeleteOutlined.displayName = "DeleteOutlined";
1224
+ DeleteOutlined.inheritAttrs = false;
1193
1225
  var ExclamationCircleFilled$1 = { "icon": { "tag": "svg", "attrs": { "viewBox": "64 64 896 896", "focusable": "false" }, "children": [{ "tag": "path", "attrs": { "d": "M512 64C264.6 64 64 264.6 64 512s200.6 448 448 448 448-200.6 448-448S759.4 64 512 64zm-32 232c0-4.4 3.6-8 8-8h48c4.4 0 8 3.6 8 8v272c0 4.4-3.6 8-8 8h-48c-4.4 0-8-3.6-8-8V296zm32 440a48.01 48.01 0 010-96 48.01 48.01 0 010 96z" } }] }, "name": "exclamation-circle", "theme": "filled" };
1194
1226
  function _objectSpread$6(target) {
1195
1227
  for (var i = 1; i < arguments.length; i++) {
@@ -1661,12 +1693,12 @@ const promiseDebounce = (func, wait) => {
1661
1693
  return function(...args) {
1662
1694
  return new Promise((resolve, reject) => {
1663
1695
  queue.push([resolve, reject]);
1664
- clearTimeout(timer);
1696
+ clearTimeout(timer != null ? timer : void 0);
1665
1697
  timer = setTimeout(() => {
1666
1698
  func.apply(this, args).then((res) => {
1667
- queue.map((item) => item[0]).forEach((item) => item(res));
1699
+ queue.forEach(([resolver]) => resolver(res));
1668
1700
  }).catch((err) => {
1669
- queue.map((item) => item[1]).forEach((item) => item(err));
1701
+ queue.forEach(([, rejecter]) => rejecter(err));
1670
1702
  }).finally(() => {
1671
1703
  queue.length = 0;
1672
1704
  timer = null;
@@ -1694,6 +1726,9 @@ function getImageMsgDisplaySize(attach) {
1694
1726
  h2 = Math.min(IMG_MSG_SIDE_MAX, h0 * scale);
1695
1727
  return { width: Math.round(w), height: Math.round(h2) };
1696
1728
  }
1729
+ const getMByteSize = (size) => {
1730
+ return (size / 1024 / 1024).toFixed(2);
1731
+ };
1697
1732
  const useGlobalStore = defineStore("global", {
1698
1733
  state: () => ({
1699
1734
  loginStatus: false
@@ -38302,7 +38337,27 @@ const useChannelStore = defineStore("channel", {
38302
38337
  });
38303
38338
  return msgs;
38304
38339
  },
38305
- // 发送文本消息
38340
+ /**
38341
+ * 上传图片
38342
+ * @param options - 上传选项,包含图片文件和回调函数
38343
+ * @returns Promise<UploadFileResult> 返回上传结果,包含图片URL、宽高等信息
38344
+ */
38345
+ async uploadImage(options) {
38346
+ if (!window.qchat) {
38347
+ throw new Error("QChat no login");
38348
+ }
38349
+ const uploadResult = await window.qchat.cloudStorage.uploadFile({
38350
+ type: "image",
38351
+ file: options.file,
38352
+ onUploadStart: options.onUploadStart,
38353
+ onUploadDone: options.onUploadDone
38354
+ });
38355
+ return uploadResult;
38356
+ },
38357
+ /**
38358
+ * 发送文本消息
38359
+ * @param options - 发送选项,包含消息内容和可选附件
38360
+ */
38306
38361
  async sendTextMsg(options) {
38307
38362
  var _a;
38308
38363
  if (!window.qchat) {
@@ -38317,6 +38372,8 @@ const useChannelStore = defineStore("channel", {
38317
38372
  channelId: this.currentChannel.channelId,
38318
38373
  type: "text",
38319
38374
  body: options.body,
38375
+ attach: options == null ? void 0 : options.attach,
38376
+ // 如果有附件,塞到attach字段
38320
38377
  ext: (options == null ? void 0 : options.ext) ? JSON.stringify(options == null ? void 0 : options.ext) : void 0,
38321
38378
  mentionAccids: options == null ? void 0 : options.mentionAccids,
38322
38379
  onSendBefore: (msg2) => {
@@ -38613,9 +38670,9 @@ const useUserStore = defineStore("user", {
38613
38670
  }
38614
38671
  });
38615
38672
  createPinia();
38616
- const _hoisted_1$9 = { class: "yx-common-avatar-container" };
38617
- const _hoisted_2$8 = ["src"];
38618
- const _sfc_main$9 = /* @__PURE__ */ defineComponent({
38673
+ const _hoisted_1$a = { class: "yx-common-avatar-container" };
38674
+ const _hoisted_2$9 = ["src"];
38675
+ const _sfc_main$a = /* @__PURE__ */ defineComponent({
38619
38676
  ...{
38620
38677
  name: "CommonAvatar"
38621
38678
  },
@@ -38671,14 +38728,14 @@ const _sfc_main$9 = /* @__PURE__ */ defineComponent({
38671
38728
  });
38672
38729
  return (_ctx, _cache) => {
38673
38730
  var _a, _b;
38674
- return openBlock(), createElementBlock("div", _hoisted_1$9, [
38731
+ return openBlock(), createElementBlock("div", _hoisted_1$a, [
38675
38732
  __props.avatar || ((_a = matchedMember.value) == null ? void 0 : _a.avatar) ? (openBlock(), createElementBlock("img", {
38676
38733
  key: 0,
38677
38734
  alt: "",
38678
38735
  class: "image",
38679
38736
  src: __props.avatar,
38680
38737
  style: normalizeStyle("width:" + widthAndHeight.value + "height:" + widthAndHeight.value + "border:" + borderStyle.value)
38681
- }, null, 12, _hoisted_2$8)) : createCommentVNode("", true),
38738
+ }, null, 12, _hoisted_2$9)) : createCommentVNode("", true),
38682
38739
  !__props.avatar && !((_b = matchedMember.value) == null ? void 0 : _b.avatar) ? (openBlock(), createElementBlock("div", {
38683
38740
  key: 1,
38684
38741
  class: "text",
@@ -38727,6 +38784,55 @@ const IconFont$1 = defineComponent({
38727
38784
  };
38728
38785
  }
38729
38786
  });
38787
+ const _hoisted_1$9 = { class: "yx-attach-box-img-info-wrapper" };
38788
+ const _hoisted_2$8 = {
38789
+ style: { "min-width": "21px", "min-height": "18px" },
38790
+ width: "21",
38791
+ height: "18",
38792
+ viewBox: "0 0 21 18",
38793
+ fill: "var(--theme-head-title-link, #3B3E55)",
38794
+ xmlns: "http://www.w3.org/2000/svg"
38795
+ };
38796
+ const _hoisted_3$8 = { class: "yx-attach-box-img-info-text" };
38797
+ const _hoisted_4$8 = { class: "yx-attach-box-img-info-text-name" };
38798
+ const _hoisted_5$7 = ["href", "download"];
38799
+ const _hoisted_6$7 = { class: "yx-attach-box-img-info-text-size" };
38800
+ const _sfc_main$9 = /* @__PURE__ */ defineComponent({
38801
+ ...{ name: "ImgInfoWrapper" },
38802
+ __name: "index",
38803
+ props: {
38804
+ attach: {}
38805
+ },
38806
+ setup(__props) {
38807
+ return (_ctx, _cache) => {
38808
+ var _a, _b, _c, _d;
38809
+ return openBlock(), createElementBlock("div", _hoisted_1$9, [
38810
+ (openBlock(), createElementBlock("svg", _hoisted_2$8, [..._cache[0] || (_cache[0] = [
38811
+ createElementVNode("path", {
38812
+ d: "M15.75 9C16.9926 9 18 7.99264 18 6.75C18 5.50736 16.9926 4.5 15.75 4.5C14.5074 4.5 13.5 5.50736 13.5 6.75C13.5 7.99264 14.5074 9 15.75 9Z",
38813
+ fill: "#9198A1"
38814
+ }, null, -1),
38815
+ createElementVNode("path", {
38816
+ "fill-rule": "evenodd",
38817
+ "clip-rule": "evenodd",
38818
+ d: "M3 0C1.34315 0 0 1.34315 0 3V15C0 16.6569 1.34315 18 3 18H18C19.6569 18 21 16.6569 21 15V3C21 1.34315 19.6569 0 18 0H3ZM18 1.5H3C2.17157 1.5 1.5 2.17157 1.5 3V8.68934L6 4.18934L18.2838 16.4732C18.9765 16.3405 19.5 15.7314 19.5 15V3C19.5 2.17157 18.8284 1.5 18 1.5ZM1.5 15V10.8107L6 6.31066L16.1893 16.5H3C2.17157 16.5 1.5 15.8284 1.5 15Z",
38819
+ fill: "#9198A1"
38820
+ }, null, -1)
38821
+ ])])),
38822
+ createElementVNode("div", _hoisted_3$8, [
38823
+ createElementVNode("div", _hoisted_4$8, [
38824
+ createElementVNode("a", {
38825
+ class: "yx-attach-box-img-info-text-name-link",
38826
+ href: (_a = __props.attach) == null ? void 0 : _a.url,
38827
+ download: (_b = __props.attach) == null ? void 0 : _b.name
38828
+ }, toDisplayString((_c = __props.attach) == null ? void 0 : _c.name), 9, _hoisted_5$7)
38829
+ ]),
38830
+ createElementVNode("div", _hoisted_6$7, toDisplayString(unref(getMByteSize)(((_d = __props.attach) == null ? void 0 : _d.size) || 0)) + "MB", 1)
38831
+ ])
38832
+ ]);
38833
+ };
38834
+ }
38835
+ });
38730
38836
  const _hoisted_1$8 = ["data-msg-id-client"];
38731
38837
  const _hoisted_2$7 = {
38732
38838
  key: 0,
@@ -38745,12 +38851,22 @@ const _hoisted_12$3 = { class: "fileMsgSize" };
38745
38851
  const _hoisted_13$3 = { class: "ant-image-mask-info" };
38746
38852
  const _hoisted_14$3 = {
38747
38853
  key: 4,
38854
+ class: "chatCardMainContent attach-box"
38855
+ };
38856
+ const _hoisted_15$3 = { class: "ant-image-mask-info" };
38857
+ const _hoisted_16$2 = {
38858
+ key: 5,
38748
38859
  class: "chatCardMainContent"
38749
38860
  };
38750
- const _hoisted_15$3 = { class: "chatCardQuoteMsgName" };
38751
- const _hoisted_16$2 = ["innerHTML"];
38752
- const _hoisted_17$2 = { class: "ant-image-mask-info" };
38753
- const _hoisted_18$1 = { class: "chatCardStatus" };
38861
+ const _hoisted_17$2 = {
38862
+ key: 0,
38863
+ class: "chatCardQuoteMsgAttachBox"
38864
+ };
38865
+ const _hoisted_18$2 = { class: "chatCardQuoteMsgName" };
38866
+ const _hoisted_19$2 = ["innerHTML"];
38867
+ const _hoisted_20$2 = { class: "ant-image-mask-info" };
38868
+ const _hoisted_21$2 = { class: "chatCardStatus" };
38869
+ const MAX_IMG_PREVIEW_SIZE = 2 * 1024 * 1024;
38754
38870
  const REVOCATION_INTERVAL = 120 * 1e3;
38755
38871
  const _sfc_main$8 = /* @__PURE__ */ defineComponent({
38756
38872
  ...{
@@ -38950,14 +39066,14 @@ const _sfc_main$8 = /* @__PURE__ */ defineComponent({
38950
39066
  }
38951
39067
  };
38952
39068
  return (_ctx, _cache) => {
38953
- var _a, _b, _c, _d, _e, _f, _g, _h, _i, _j;
39069
+ var _a, _b, _c, _d, _e, _f, _g, _h, _i, _j, _k, _l, _m, _n, _o, _p, _q, _r, _s;
38954
39070
  return openBlock(), createElementBlock("div", {
38955
39071
  class: normalizeClass(["yx-chatCardWrapper", { reverse: __props.msg.fromAccount === __props.myAccid }]),
38956
39072
  "data-msg-id-client": __props.msg.msgIdClient
38957
39073
  }, [
38958
39074
  ((_a = __props.msg.updateOperatorInfo) == null ? void 0 : _a.ps) ? (openBlock(), createElementBlock("div", _hoisted_2$7, toDisplayString(__props.msg.fromAccount === __props.myAccid ? "你" : `“${__props.msg.fromNick}”`) + " " + toDisplayString((_b = __props.msg.updateOperatorInfo) == null ? void 0 : _b.ps), 1)) : (openBlock(), createElementBlock(Fragment, { key: 1 }, [
38959
39075
  createElementVNode("div", _hoisted_3$7, [
38960
- createVNode(_sfc_main$9, {
39076
+ createVNode(_sfc_main$a, {
38961
39077
  avatar: myAvatar.value,
38962
39078
  nick: __props.msg.fromNick,
38963
39079
  accid: __props.msg.fromAccount,
@@ -39060,28 +39176,52 @@ const _sfc_main$8 = /* @__PURE__ */ defineComponent({
39060
39176
  }, [..._cache[1] || (_cache[1] = [
39061
39177
  createElementVNode("div", { class: "textMsg" }, toDisplayString("暂不支持该消息"), -1)
39062
39178
  ])], 2)),
39063
- ((_i = msgExt.value) == null ? void 0 : _i.quoteMsg) ? (openBlock(), createElementBlock("div", _hoisted_14$3, [
39179
+ __props.msg.type === "text" && ["jpg", "jpeg", "png", "gif"].includes(((_j = (_i = __props.msg) == null ? void 0 : _i.attach) == null ? void 0 : _j.ext) || "") ? (openBlock(), createElementBlock("div", _hoisted_14$3, [
39180
+ ((_l = (_k = __props.msg) == null ? void 0 : _k.attach) == null ? void 0 : _l.size) && ((_n = (_m = __props.msg) == null ? void 0 : _m.attach) == null ? void 0 : _n.size) < MAX_IMG_PREVIEW_SIZE ? (openBlock(), createBlock(unref(Image), {
39181
+ key: 0,
39182
+ class: "imgMsg",
39183
+ src: (_p = (_o = __props.msg) == null ? void 0 : _o.attach) == null ? void 0 : _p.url,
39184
+ width: imageMsgSize.value.width,
39185
+ height: imageMsgSize.value.height
39186
+ }, {
39187
+ previewMask: withCtx(() => [
39188
+ createElementVNode("div", _hoisted_15$3, [
39189
+ createVNode(unref(EyeOutlined))
39190
+ ])
39191
+ ]),
39192
+ _: 1
39193
+ }, 8, ["src", "width", "height"])) : (openBlock(), createBlock(_sfc_main$9, {
39194
+ key: 1,
39195
+ attach: (_q = __props.msg) == null ? void 0 : _q.attach
39196
+ }, null, 8, ["attach"]))
39197
+ ])) : createCommentVNode("", true),
39198
+ ((_r = msgExt.value) == null ? void 0 : _r.quoteMsg) ? (openBlock(), createElementBlock("div", _hoisted_16$2, [
39064
39199
  createElementVNode("div", {
39065
39200
  class: "chatCardQuoteMsg",
39066
39201
  onClick: onQuoteMsgClick
39067
39202
  }, [
39068
- createElementVNode("div", _hoisted_15$3, toDisplayString(msgExt.value.quoteMsg.fromNick) + "", 1),
39203
+ msgExt.value.quoteMsg.type === "text" && msgExt.value.quoteMsg.attach ? (openBlock(), createElementBlock("div", _hoisted_17$2, [
39204
+ createVNode(_sfc_main$9, {
39205
+ attach: msgExt.value.quoteMsg.attach
39206
+ }, null, 8, ["attach"])
39207
+ ])) : createCommentVNode("", true),
39208
+ createElementVNode("div", _hoisted_18$2, toDisplayString(msgExt.value.quoteMsg.fromNick) + ":", 1),
39069
39209
  msgExt.value.quoteMsg.body ? (openBlock(), createElementBlock("div", {
39070
- key: 0,
39210
+ key: 1,
39071
39211
  class: "quoteMsgText",
39072
39212
  innerHTML: msgExt.value.quoteMsg.body
39073
- }, null, 8, _hoisted_16$2)) : createCommentVNode("", true),
39213
+ }, null, 8, _hoisted_19$2)) : createCommentVNode("", true),
39074
39214
  msgExt.value.quoteMsg.type === "image" ? (openBlock(), createBlock(unref(Image), {
39075
- key: 1,
39215
+ key: 2,
39076
39216
  class: "imgMsg quoteMsgImg",
39077
- src: (_j = msgExt.value.quoteMsg.attach) == null ? void 0 : _j.url,
39217
+ src: (_s = msgExt.value.quoteMsg.attach) == null ? void 0 : _s.url,
39078
39218
  width: quoteImageMsgSize.value.width,
39079
39219
  height: quoteImageMsgSize.value.height,
39080
39220
  onClick: _cache[0] || (_cache[0] = withModifiers(() => {
39081
39221
  }, ["stop", "prevent"]))
39082
39222
  }, {
39083
39223
  previewMask: withCtx(() => [
39084
- createElementVNode("div", _hoisted_17$2, [
39224
+ createElementVNode("div", _hoisted_20$2, [
39085
39225
  createVNode(unref(EyeOutlined))
39086
39226
  ])
39087
39227
  ]),
@@ -39090,7 +39230,7 @@ const _sfc_main$8 = /* @__PURE__ */ defineComponent({
39090
39230
  ])
39091
39231
  ])) : createCommentVNode("", true)
39092
39232
  ]),
39093
- createElementVNode("div", _hoisted_18$1, [
39233
+ createElementVNode("div", _hoisted_21$2, [
39094
39234
  __props.msg.deliveryStatus === "failed" ? (openBlock(), createBlock(unref(Button), {
39095
39235
  key: 0,
39096
39236
  type: "text",
@@ -39245,7 +39385,7 @@ const _sfc_main$7 = /* @__PURE__ */ defineComponent({
39245
39385
  onMousedown: withModifiers(($event) => onSelect($event, index2), ["prevent"])
39246
39386
  }, [
39247
39387
  createElementVNode("div", _hoisted_3$6, [
39248
- createVNode(_sfc_main$9, {
39388
+ createVNode(_sfc_main$a, {
39249
39389
  avatar: item.avatar,
39250
39390
  nick: item.nick,
39251
39391
  accid: item.accid,
@@ -39787,19 +39927,32 @@ const _hoisted_8$3 = {
39787
39927
  key: 0,
39788
39928
  class: "chatroomInputQuoteWrapper"
39789
39929
  };
39790
- const _hoisted_9$2 = { class: "chatroomInputQuoteText" };
39791
- const _hoisted_10$2 = { class: "chatroomInputQuoteTextName" };
39792
- const _hoisted_11$2 = ["innerHTML"];
39793
- const _hoisted_12$2 = {
39930
+ const _hoisted_9$2 = {
39794
39931
  key: 0,
39932
+ class: "chatroomInputQuoteAttachBox"
39933
+ };
39934
+ const _hoisted_10$2 = { class: "chatroomInputQuoteText" };
39935
+ const _hoisted_11$2 = { class: "chatroomInputQuoteTextName" };
39936
+ const _hoisted_12$2 = ["innerHTML"];
39937
+ const _hoisted_13$2 = {
39938
+ key: 1,
39795
39939
  class: "chatroomInputQuoteWrapperImg"
39796
39940
  };
39797
- const _hoisted_13$2 = { class: "chatroomInputWrapper" };
39798
- const _hoisted_14$2 = { class: "chatroomInputLeft" };
39799
- const _hoisted_15$2 = { style: { "width": "400px" } };
39800
- const _hoisted_16$1 = ["onClick"];
39801
- const _hoisted_17$1 = { class: "chatroomController" };
39802
- const MAX_IMG_SIZE = 20;
39941
+ const _hoisted_14$2 = {
39942
+ key: 1,
39943
+ class: "chatroomInputAttachmentWrapper"
39944
+ };
39945
+ const _hoisted_15$2 = {
39946
+ key: 0,
39947
+ class: "chatroomInputAttachmentWrapperImg"
39948
+ };
39949
+ const _hoisted_16$1 = { class: "chatroomInputAttachmentWrapperImgMask" };
39950
+ const _hoisted_17$1 = { class: "chatroomInputWrapper" };
39951
+ const _hoisted_18$1 = { class: "chatroomInputLeft" };
39952
+ const _hoisted_19$1 = { style: { "width": "400px" } };
39953
+ const _hoisted_20$1 = ["onClick"];
39954
+ const _hoisted_21$1 = { class: "chatroomController" };
39955
+ const MAX_IMG_SIZE = 10;
39803
39956
  const _sfc_main$5 = /* @__PURE__ */ defineComponent({
39804
39957
  ...{
39805
39958
  name: "ChatContent"
@@ -39825,8 +39978,10 @@ const _sfc_main$5 = /* @__PURE__ */ defineComponent({
39825
39978
  const props = __props;
39826
39979
  const emit = __emit;
39827
39980
  const quoteMsg = ref();
39981
+ const attachment = ref();
39828
39982
  const curText = ref("");
39829
39983
  const cursorIndex = ref(0);
39984
+ const attachmentUploading = ref(false);
39830
39985
  const contentRef = ref();
39831
39986
  const contentScrollLocked = ref(false);
39832
39987
  const loadingMore = ref(false);
@@ -39922,6 +40077,10 @@ const _sfc_main$5 = /* @__PURE__ */ defineComponent({
39922
40077
  };
39923
40078
  const handleDeleteQuoteMsg = () => {
39924
40079
  quoteMsg.value = void 0;
40080
+ console.log("handleDeleteQuoteMsg", quoteMsg.value);
40081
+ };
40082
+ const handleDeleteAttachment = () => {
40083
+ attachment.value = void 0;
39925
40084
  };
39926
40085
  watch(
39927
40086
  () => props.msgs,
@@ -39959,15 +40118,21 @@ const _sfc_main$5 = /* @__PURE__ */ defineComponent({
39959
40118
  () => channelStore.currentChannel,
39960
40119
  (value, oldValue) => {
39961
40120
  if (oldValue == null ? void 0 : oldValue.channelId) {
39962
- inputMap.set(oldValue == null ? void 0 : oldValue.channelId, { input: curText.value, quoteMsg: quoteMsg.value });
40121
+ inputMap.set(oldValue == null ? void 0 : oldValue.channelId, {
40122
+ input: curText.value,
40123
+ quoteMsg: quoteMsg.value,
40124
+ attachment: attachment.value
40125
+ });
39963
40126
  }
39964
40127
  if ((value == null ? void 0 : value.channelId) && inputMap.has((value == null ? void 0 : value.channelId) || "")) {
39965
40128
  const mapValue = inputMap.get((value == null ? void 0 : value.channelId) || "");
39966
40129
  curText.value = (mapValue == null ? void 0 : mapValue.input) || "";
39967
40130
  quoteMsg.value = mapValue == null ? void 0 : mapValue.quoteMsg;
40131
+ attachment.value = mapValue == null ? void 0 : mapValue.attachment;
39968
40132
  } else {
39969
40133
  curText.value = "";
39970
40134
  quoteMsg.value = void 0;
40135
+ attachment.value = void 0;
39971
40136
  }
39972
40137
  }
39973
40138
  );
@@ -40004,10 +40169,13 @@ const _sfc_main$5 = /* @__PURE__ */ defineComponent({
40004
40169
  ext: {
40005
40170
  quoteMsg: quoteMsg.value
40006
40171
  },
40007
- mentionAccids: mentionAccids.value
40172
+ mentionAccids: mentionAccids.value,
40173
+ attach: attachment.value
40174
+ // 传递附件
40008
40175
  });
40009
40176
  curText.value = "";
40010
40177
  quoteMsg.value = void 0;
40178
+ attachment.value = void 0;
40011
40179
  scrollToBottomAfterSend();
40012
40180
  }
40013
40181
  }
@@ -40019,10 +40187,13 @@ const _sfc_main$5 = /* @__PURE__ */ defineComponent({
40019
40187
  ext: {
40020
40188
  quoteMsg: quoteMsg.value
40021
40189
  },
40022
- mentionAccids: mentionAccids.value
40190
+ mentionAccids: mentionAccids.value,
40191
+ attach: attachment.value
40192
+ // 传递附件
40023
40193
  });
40024
40194
  curText.value = "";
40025
40195
  quoteMsg.value = void 0;
40196
+ attachment.value = void 0;
40026
40197
  scrollToBottomAfterSend();
40027
40198
  }
40028
40199
  };
@@ -40044,8 +40215,8 @@ const _sfc_main$5 = /* @__PURE__ */ defineComponent({
40044
40215
  });
40045
40216
  }
40046
40217
  };
40047
- const handlePaste = (e) => {
40048
- if (props.sendDisabled) return;
40218
+ const handlePaste = async (e) => {
40219
+ if (props.sendDisabled || attachmentUploading.value) return;
40049
40220
  const clipboardData = e.clipboardData;
40050
40221
  if (!clipboardData) return;
40051
40222
  const items = clipboardData.items;
@@ -40059,20 +40230,51 @@ const _sfc_main$5 = /* @__PURE__ */ defineComponent({
40059
40230
  message.error("图片大小最大支持20M");
40060
40231
  return;
40061
40232
  }
40062
- emit("sendImg", file);
40063
- scrollToBottomAfterSend();
40233
+ attachmentUploading.value = true;
40234
+ try {
40235
+ const uploadResult = await channelStore.uploadImage({
40236
+ file,
40237
+ onUploadStart: () => {
40238
+ attachmentUploading.value = true;
40239
+ },
40240
+ onUploadDone: () => {
40241
+ attachmentUploading.value = false;
40242
+ }
40243
+ });
40244
+ attachment.value = uploadResult;
40245
+ } catch (error) {
40246
+ console.error("上传图片失败:", error);
40247
+ message.error("上传图片失败");
40248
+ attachmentUploading.value = false;
40249
+ }
40064
40250
  }
40065
40251
  return;
40066
40252
  }
40067
40253
  }
40068
40254
  };
40069
- const uploadImgHandler = (file) => {
40255
+ const uploadImgHandler = async (file) => {
40070
40256
  if (!isLt(file.size, MAX_IMG_SIZE)) {
40071
40257
  message.error(`图片大小最大支持${MAX_IMG_SIZE}M`);
40072
- return;
40258
+ return false;
40073
40259
  }
40074
- emit("sendImg", file);
40075
- scrollToBottomAfterSend();
40260
+ attachmentUploading.value = true;
40261
+ try {
40262
+ const uploadResult = await channelStore.uploadImage({
40263
+ file,
40264
+ onUploadStart: () => {
40265
+ attachmentUploading.value = true;
40266
+ },
40267
+ onUploadDone: () => {
40268
+ attachmentUploading.value = false;
40269
+ }
40270
+ });
40271
+ attachment.value = uploadResult;
40272
+ } catch (error) {
40273
+ console.error("上传图片失败:", error);
40274
+ message.error("上传图片失败");
40275
+ attachmentUploading.value = false;
40276
+ }
40277
+ return false;
40076
40278
  };
40077
40279
  const emjjData = [
40078
40280
  "😀",
@@ -40287,15 +40489,20 @@ const _sfc_main$5 = /* @__PURE__ */ defineComponent({
40287
40489
  size: "12px",
40288
40490
  onClick: handleDeleteQuoteMsg
40289
40491
  }),
40290
- createElementVNode("div", _hoisted_9$2, [
40291
- createElementVNode("div", _hoisted_10$2, toDisplayString(quoteMsg.value.fromNick) + ":", 1),
40492
+ quoteMsg.value.type === "text" && quoteMsg.value.attach ? (openBlock(), createElementBlock("div", _hoisted_9$2, [
40493
+ createVNode(_sfc_main$9, {
40494
+ attach: quoteMsg.value.attach
40495
+ }, null, 8, ["attach"])
40496
+ ])) : createCommentVNode("", true),
40497
+ createElementVNode("div", _hoisted_10$2, [
40498
+ createElementVNode("div", _hoisted_11$2, toDisplayString(quoteMsg.value.fromNick) + ":", 1),
40292
40499
  ((_d = quoteMsg.value) == null ? void 0 : _d.body) ? (openBlock(), createElementBlock("div", {
40293
40500
  key: 0,
40294
40501
  class: "chatroomInputQuoteTextBody",
40295
40502
  innerHTML: (_e = quoteMsg.value) == null ? void 0 : _e.body
40296
- }, null, 8, _hoisted_11$2)) : createCommentVNode("", true)
40503
+ }, null, 8, _hoisted_12$2)) : createCommentVNode("", true)
40297
40504
  ]),
40298
- quoteMsg.value.type === "image" ? (openBlock(), createElementBlock("div", _hoisted_12$2, [
40505
+ quoteMsg.value.type === "image" ? (openBlock(), createElementBlock("div", _hoisted_13$2, [
40299
40506
  createVNode(unref(Image), {
40300
40507
  preview: false,
40301
40508
  class: "imgMsg quoteImg",
@@ -40305,17 +40512,34 @@ const _sfc_main$5 = /* @__PURE__ */ defineComponent({
40305
40512
  }, null, 8, ["src", "width", "height"])
40306
40513
  ])) : createCommentVNode("", true)
40307
40514
  ])) : createCommentVNode("", true),
40308
- createElementVNode("div", _hoisted_13$2, [
40309
- createElementVNode("div", _hoisted_14$2, [
40515
+ attachment.value ? (openBlock(), createElementBlock("div", _hoisted_14$2, [
40516
+ ["jpg", "jpeg", "png", "gif"].includes(attachment.value.ext || "") && attachment.value.url ? (openBlock(), createElementBlock("div", _hoisted_15$2, [
40517
+ createElementVNode("div", _hoisted_16$1, [
40518
+ createVNode(unref(DeleteOutlined), {
40519
+ class: "chatroomInputAttachmentDeleteBtn",
40520
+ onClick: handleDeleteAttachment
40521
+ })
40522
+ ]),
40523
+ createVNode(unref(Image), {
40524
+ preview: false,
40525
+ class: "imgMsg quoteImg",
40526
+ src: attachment.value.url,
40527
+ width: 60,
40528
+ height: 60
40529
+ }, null, 8, ["src"])
40530
+ ])) : createCommentVNode("", true)
40531
+ ])) : createCommentVNode("", true),
40532
+ createElementVNode("div", _hoisted_17$1, [
40533
+ createElementVNode("div", _hoisted_18$1, [
40310
40534
  createVNode(unref(Popover), { placement: "topLeft" }, {
40311
40535
  content: withCtx(() => [
40312
- createElementVNode("div", _hoisted_15$2, [
40536
+ createElementVNode("div", _hoisted_19$1, [
40313
40537
  (openBlock(), createElementBlock(Fragment, null, renderList(emjjData, (value, i) => {
40314
40538
  return createElementVNode("span", {
40315
40539
  key: i,
40316
40540
  style: { "font-size": "16px", "cursor": "pointer" },
40317
40541
  onClick: ($event) => insertEmj(i)
40318
- }, toDisplayString(value), 9, _hoisted_16$1);
40542
+ }, toDisplayString(value), 9, _hoisted_20$1);
40319
40543
  }), 64))
40320
40544
  ])
40321
40545
  ]),
@@ -40360,19 +40584,20 @@ const _sfc_main$5 = /* @__PURE__ */ defineComponent({
40360
40584
  onBlur: handleInputBlur,
40361
40585
  onPaste: handlePaste
40362
40586
  }, null, 8, ["value", "placeholder", "disabled", "onKeydown", "onClick"]),
40363
- createElementVNode("div", _hoisted_17$1, [
40587
+ createElementVNode("div", _hoisted_21$1, [
40364
40588
  createVNode(unref(Upload), {
40365
40589
  "before-upload": uploadImgHandler,
40366
40590
  "show-upload-list": false,
40367
40591
  accept: ".jpg,.png,.jpeg",
40368
- disabled: __props.sendDisabled
40592
+ disabled: __props.sendDisabled || attachmentUploading.value,
40593
+ class: "chatroomInputUpload"
40369
40594
  }, {
40370
40595
  default: withCtx(() => [
40371
40596
  createVNode(unref(Button), {
40372
40597
  class: "chatroomButton",
40373
40598
  type: "text",
40374
- loading: __props.imgUploading,
40375
- disabled: __props.sendDisabled
40599
+ loading: attachmentUploading.value,
40600
+ disabled: __props.sendDisabled || attachmentUploading.value
40376
40601
  }, {
40377
40602
  icon: withCtx(() => [..._cache[4] || (_cache[4] = [
40378
40603
  createElementVNode("svg", {
@@ -40498,7 +40723,13 @@ const _sfc_main$4 = /* @__PURE__ */ defineComponent({
40498
40723
  );
40499
40724
  const sendMessage = (type, file, option) => {
40500
40725
  if (type === "textMsg") {
40501
- channelStore.sendTextMsg({ body: file, ext: option == null ? void 0 : option.ext, mentionAccids: option == null ? void 0 : option.mentionAccids });
40726
+ channelStore.sendTextMsg({
40727
+ body: file,
40728
+ ext: option == null ? void 0 : option.ext,
40729
+ mentionAccids: option == null ? void 0 : option.mentionAccids,
40730
+ attach: option == null ? void 0 : option.attach
40731
+ // 传递附件
40732
+ });
40502
40733
  return;
40503
40734
  }
40504
40735
  if (type === "SendImg") {
@@ -41264,7 +41495,7 @@ const _sfc_main$2 = /* @__PURE__ */ defineComponent({
41264
41495
  style: normalizeStyle({ width: userPanelWidth.value + "px" })
41265
41496
  }, [
41266
41497
  createElementVNode("div", _hoisted_15, [
41267
- createVNode(_sfc_main$9, {
41498
+ createVNode(_sfc_main$a, {
41268
41499
  avatar: userProfile.value.avatar,
41269
41500
  nick: userProfile.value.nick,
41270
41501
  accid: currentAccount.value,
@@ -41443,7 +41674,7 @@ const _sfc_main$2 = /* @__PURE__ */ defineComponent({
41443
41674
  };
41444
41675
  }
41445
41676
  });
41446
- const ServerChannelSidebar = /* @__PURE__ */ _export_sfc(_sfc_main$2, [["__scopeId", "data-v-2f397ece"]]);
41677
+ const ServerChannelSidebar = /* @__PURE__ */ _export_sfc(_sfc_main$2, [["__scopeId", "data-v-961f30d7"]]);
41447
41678
  const _hoisted_1$1 = { class: "members-header" };
41448
41679
  const _hoisted_2$1 = {
41449
41680
  key: 0,
@@ -41580,7 +41811,7 @@ const _sfc_main$1 = /* @__PURE__ */ defineComponent({
41580
41811
  }, {
41581
41812
  default: withCtx(() => [
41582
41813
  createElementVNode("div", _hoisted_4$1, [
41583
- createVNode(_sfc_main$9, {
41814
+ createVNode(_sfc_main$a, {
41584
41815
  avatar: member.avatar,
41585
41816
  nick: member.nick,
41586
41817
  accid: member.accid,
@@ -41974,7 +42205,7 @@ const components = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.definePr
41974
42205
  ChatContent: _sfc_main$5,
41975
42206
  ChatPage: _sfc_main$3,
41976
42207
  ChatRoom: _sfc_main$4,
41977
- CommonAvatar: _sfc_main$9,
42208
+ CommonAvatar: _sfc_main$a,
41978
42209
  IconFont: IconFont$1,
41979
42210
  IndexEntry,
41980
42211
  MembersSidebar,