cnhis-design-vue 3.2.2 → 3.2.3-beta.10

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 (106) hide show
  1. package/es/components/biunique-chat/index.d.ts +217 -3
  2. package/es/components/biunique-chat/src/Index.vue.d.ts +217 -3
  3. package/es/components/biunique-chat/src/Index.vue2.js +1 -1
  4. package/es/components/biunique-chat/src/api/index.d.ts +1 -0
  5. package/es/components/biunique-chat/src/api/index.js +1 -1
  6. package/es/components/biunique-chat/src/components/ChatFooter.vue.d.ts +16 -1
  7. package/es/components/biunique-chat/src/components/ChatFooter.vue2.js +1 -1
  8. package/es/components/biunique-chat/src/components/ChatHeader.vue2.js +1 -1
  9. package/es/components/biunique-chat/src/components/ChatMain.vue.d.ts +201 -1
  10. package/es/components/biunique-chat/src/components/ChatMain.vue2.js +1 -1
  11. package/es/components/biunique-chat/src/components/SiderList.vue2.js +1 -1
  12. package/es/components/biunique-chat/src/hooks/useSession.js +1 -1
  13. package/es/components/biunique-chat/src/hooks/useState.js +1 -1
  14. package/es/components/biunique-chat/src/types/index.d.ts +1 -1
  15. package/es/components/biunique-chat/src/utils/emoji.d.ts +1 -1
  16. package/es/components/biunique-chat/src/utils/emoji.js +1 -1
  17. package/es/components/biunique-chat/src/utils/index.js +1 -1
  18. package/es/components/biunique-chat/style/index.css +1 -1
  19. package/es/components/button-print/index.d.ts +16 -1
  20. package/es/components/button-print/src/ButtonPrint.vue.d.ts +16 -1
  21. package/es/components/button-print/src/ButtonPrint.vue2.js +1 -1
  22. package/es/components/button-print/src/utils/print.js +1 -1
  23. package/es/components/callback/src/components/render/popupMaps.d.ts +30 -0
  24. package/es/components/fabric-chart/index.d.ts +123 -22
  25. package/es/components/fabric-chart/src/FabricChart.vue.d.ts +115 -26
  26. package/es/components/fabric-chart/src/FabricChart.vue2.js +1 -1
  27. package/es/components/fabric-chart/src/components/PopupMenu.js +1 -1
  28. package/es/components/fabric-chart/src/components/PopupTip.vue.d.ts +79 -19
  29. package/es/components/fabric-chart/src/components/PopupTip.vue2.js +1 -1
  30. package/es/components/fabric-chart/src/hooks/birthProcess/useBirthProcess.js +1 -1
  31. package/es/components/fabric-chart/src/hooks/index.d.ts +1 -0
  32. package/es/components/fabric-chart/src/hooks/index.js +1 -1
  33. package/es/components/fabric-chart/src/hooks/newBirthProcess/useNewBirthProcess.d.ts +7 -0
  34. package/es/components/fabric-chart/src/hooks/newBirthProcess/useNewBirthProcess.js +1 -0
  35. package/es/components/fabric-chart/src/hooks/newBirthProcess/useNewBirthProcessChart.d.ts +10 -0
  36. package/es/components/fabric-chart/src/hooks/newBirthProcess/useNewBirthProcessChart.js +1 -0
  37. package/es/components/fabric-chart/src/hooks/surgicalAnesthesia/useCenter.d.ts +1 -1
  38. package/es/components/fabric-chart/src/hooks/surgicalAnesthesia/useCenter.js +1 -1
  39. package/es/components/fabric-chart/src/hooks/surgicalAnesthesia/useOther.js +1 -1
  40. package/es/components/fabric-chart/src/hooks/surgicalAnesthesia/useSurgicalAnesthesiaChart.d.ts +1 -1
  41. package/es/components/fabric-chart/src/hooks/surgicalAnesthesia/useSurgicalAnesthesiaChart.js +1 -1
  42. package/es/components/fabric-chart/src/hooks/surgicalAnesthesia/useTop.js +1 -1
  43. package/es/components/fabric-chart/src/hooks/temperature/useCenter.js +1 -1
  44. package/es/components/fabric-chart/src/interface.d.ts +7 -3
  45. package/es/components/fabric-chart/style/index.css +1 -1
  46. package/es/components/form-config/index.d.ts +82 -0
  47. package/es/components/form-config/src/FormConfig.vue.d.ts +82 -0
  48. package/es/components/form-config/src/components/FormConfigCreator.vue.d.ts +28 -0
  49. package/es/components/form-config/src/components/FormConfigCreator.vue2.js +1 -1
  50. package/es/components/form-config/src/components/FormConfigEdit.vue.d.ts +40 -0
  51. package/es/components/form-config/src/components/FormConfigMaterialItem.js +1 -1
  52. package/es/components/form-config/src/components/renderer/ComplexNode.vue.d.ts +4 -1
  53. package/es/components/form-config/src/components/renderer/ComplexNode.vue2.js +1 -1
  54. package/es/components/form-config/src/constants/index.d.ts +1 -0
  55. package/es/components/form-config/src/constants/index.js +1 -1
  56. package/es/components/form-config/src/hooks/useConfigurationField.js +1 -1
  57. package/es/components/form-config/style/index.css +1 -1
  58. package/es/components/form-render/index.d.ts +28 -0
  59. package/es/components/form-render/src/FormRender.vue.d.ts +28 -0
  60. package/es/components/form-render/src/FormRender.vue2.js +1 -1
  61. package/es/components/form-render/src/FormRenderWrapper.vue.d.ts +28 -0
  62. package/es/components/form-render/src/components/renderer/formItem.js +1 -1
  63. package/es/components/form-render/src/components/renderer/lineBar/FormCollapse.vue.d.ts +129 -0
  64. package/es/components/form-render/src/components/renderer/lineBar/FormCollapse.vue2.js +1 -1
  65. package/es/components/form-render/src/components/renderer/lineBar/index.d.ts +128 -0
  66. package/es/components/form-render/src/components/renderer/textarea.d.ts +6 -0
  67. package/es/components/form-render/src/components/renderer/textarea.js +1 -1
  68. package/es/components/form-render/src/hooks/useFieldListAdaptor.js +1 -1
  69. package/es/components/form-render/src/hooks/useFieldNormalize.d.ts +4 -0
  70. package/es/components/form-render/src/hooks/useFieldNormalize.js +1 -1
  71. package/es/components/form-render/src/types/fieldItem.d.ts +2 -0
  72. package/es/components/form-render/src/types/index.d.ts +2 -0
  73. package/es/components/form-render/style/index.css +1 -1
  74. package/es/components/iho-table/index.d.ts +2 -0
  75. package/es/components/iho-table/src/IhoTable.vue.d.ts +2 -0
  76. package/es/components/iho-table/src/hooks/tapHooks/index.js +1 -1
  77. package/es/components/iho-table/src/plugins/rendererPlugins/editableWidgets/selectRendererPlugin/index.js +1 -1
  78. package/es/components/iho-table/src/plugins/rendererPlugins/widgets/checkRendererPlugin.js +1 -1
  79. package/es/components/iho-table/src/plugins/verticalTablePlugin/index.js +1 -1
  80. package/es/components/iho-table/src/plugins/verticalTablePlugin/src/hooks/index.d.ts +1 -24
  81. package/es/components/iho-table/src/plugins/verticalTablePlugin/src/hooks/index.js +1 -1
  82. package/es/components/iho-table/src/plugins/verticalTablePlugin/src/hooks/useCurrentColumn.js +1 -1
  83. package/es/components/iho-table/src/plugins/verticalTablePlugin/src/hooks/useEditCell.js +1 -1
  84. package/es/components/iho-table/src/plugins/verticalTablePlugin/src/hooks/useEventConvert.js +1 -1
  85. package/es/components/iho-table/src/plugins/verticalTablePlugin/src/hooks/useTriggerRow.js +1 -1
  86. package/es/components/iho-table/src/plugins/verticalTablePlugin/src/renderer.js +1 -1
  87. package/es/components/iho-table/src/plugins/verticalTablePlugin/src/utils.js +1 -1
  88. package/es/components/iho-table/src/types/index.d.ts +1 -0
  89. package/es/components/iho-table/style/index.css +1 -1
  90. package/es/components/index.css +1 -1
  91. package/es/components/info-header/index.d.ts +66 -0
  92. package/es/components/info-header/src/InfoHeader.vue.d.ts +66 -0
  93. package/es/components/info-header/src/components/infoDescription/DescriptionItem.vue.d.ts +2 -0
  94. package/es/components/info-header/src/components/infoDescription/DescriptionList.vue.d.ts +2 -0
  95. package/es/components/info-header/src/components/infoDescription/index.vue.d.ts +30 -0
  96. package/es/components/info-header/src/components/patientInfo/index.vue.d.ts +28 -0
  97. package/es/components/shortcut-setter/index.d.ts +30 -0
  98. package/es/components/shortcut-setter/src/ShortcutSetter.vue.d.ts +30 -0
  99. package/es/components/step-notice/index.d.ts +1538 -1
  100. package/es/components/step-notice/src/StepNotice.vue.d.ts +1538 -1
  101. package/es/components/step-notice/src/StepNotice.vue2.js +1 -1
  102. package/es/components/step-notice/style/index.css +1 -1
  103. package/es/shared/assets/img/emoji/666.gif.js +1 -0
  104. package/es/shared/components/InputNumberSlash/InputNumberSlash.js +1 -1
  105. package/es/shared/package.json.js +1 -1
  106. package/package.json +2 -2
@@ -28,7 +28,7 @@ declare const BiuniqueChat: SFCWithInstall<import("vue").DefineComponent<{
28
28
  stompClient: import("vue").Ref<import("./src/utils/chatSock").ChatSock | undefined>;
29
29
  state: {
30
30
  currentSessionItem: import("../../shared/types").AnyObject;
31
- sessionKey: string;
31
+ id: string;
32
32
  userInfo: import("../../shared/types").AnyObject;
33
33
  msgList: import("../../shared/types").AnyObject[];
34
34
  currentMsg: import("../../shared/types").AnyObject;
@@ -1137,6 +1137,206 @@ declare const BiuniqueChat: SFCWithInstall<import("vue").DefineComponent<{
1137
1137
  setScrollToButtom: () => Promise<void>;
1138
1138
  getIntervalMsgTime: (time: string) => string;
1139
1139
  NAvatar: any;
1140
+ NImageGroup: import("vue").DefineComponent<{
1141
+ showToolbar: {
1142
+ type: BooleanConstructor;
1143
+ default: boolean;
1144
+ };
1145
+ showToolbarTooltip: BooleanConstructor;
1146
+ theme: import("vue").PropType<import("naive-ui/es/_mixins").Theme<"Image", {
1147
+ toolbarIconColor: string;
1148
+ toolbarColor: string;
1149
+ toolbarBoxShadow: string;
1150
+ toolbarBorderRadius: string;
1151
+ }, {
1152
+ Tooltip: import("naive-ui/es/_mixins").Theme<"Tooltip", {
1153
+ borderRadius: string;
1154
+ boxShadow: string;
1155
+ color: string;
1156
+ textColor: string;
1157
+ padding: string;
1158
+ }, {
1159
+ Popover: import("naive-ui/es/_mixins").Theme<"Popover", {
1160
+ fontSize: string;
1161
+ borderRadius: string;
1162
+ color: string;
1163
+ dividerColor: string;
1164
+ textColor: string;
1165
+ boxShadow: string;
1166
+ space: string;
1167
+ spaceArrow: string;
1168
+ arrowOffset: string;
1169
+ arrowOffsetVertical: string;
1170
+ arrowHeight: string;
1171
+ padding: string;
1172
+ }, any>;
1173
+ }>;
1174
+ }>>;
1175
+ themeOverrides: import("vue").PropType<import("naive-ui/es/_mixins/use-theme").ExtractThemeOverrides<import("naive-ui/es/_mixins").Theme<"Image", {
1176
+ toolbarIconColor: string;
1177
+ toolbarColor: string;
1178
+ toolbarBoxShadow: string;
1179
+ toolbarBorderRadius: string;
1180
+ }, {
1181
+ Tooltip: import("naive-ui/es/_mixins").Theme<"Tooltip", {
1182
+ borderRadius: string;
1183
+ boxShadow: string;
1184
+ color: string;
1185
+ textColor: string;
1186
+ padding: string;
1187
+ }, {
1188
+ Popover: import("naive-ui/es/_mixins").Theme<"Popover", {
1189
+ fontSize: string;
1190
+ borderRadius: string;
1191
+ color: string;
1192
+ dividerColor: string;
1193
+ textColor: string;
1194
+ boxShadow: string;
1195
+ space: string;
1196
+ spaceArrow: string;
1197
+ arrowOffset: string;
1198
+ arrowOffsetVertical: string;
1199
+ arrowHeight: string;
1200
+ padding: string;
1201
+ }, any>;
1202
+ }>;
1203
+ }>>>;
1204
+ builtinThemeOverrides: import("vue").PropType<import("naive-ui/es/_mixins/use-theme").ExtractThemeOverrides<import("naive-ui/es/_mixins").Theme<"Image", {
1205
+ toolbarIconColor: string;
1206
+ toolbarColor: string;
1207
+ toolbarBoxShadow: string;
1208
+ toolbarBorderRadius: string;
1209
+ }, {
1210
+ Tooltip: import("naive-ui/es/_mixins").Theme<"Tooltip", {
1211
+ borderRadius: string;
1212
+ boxShadow: string;
1213
+ color: string;
1214
+ textColor: string;
1215
+ padding: string;
1216
+ }, {
1217
+ Popover: import("naive-ui/es/_mixins").Theme<"Popover", {
1218
+ fontSize: string;
1219
+ borderRadius: string;
1220
+ color: string;
1221
+ dividerColor: string;
1222
+ textColor: string;
1223
+ boxShadow: string;
1224
+ space: string;
1225
+ spaceArrow: string;
1226
+ arrowOffset: string;
1227
+ arrowOffsetVertical: string;
1228
+ arrowHeight: string;
1229
+ padding: string;
1230
+ }, any>;
1231
+ }>;
1232
+ }>>>;
1233
+ }, {
1234
+ mergedClsPrefix: import("vue").ComputedRef<string>;
1235
+ previewInstRef: import("vue").Ref<{
1236
+ setThumbnailEl: (e: HTMLImageElement | null) => void;
1237
+ setPreviewSrc: (src?: string | undefined) => void;
1238
+ toggleShow: () => void;
1239
+ } | null>;
1240
+ next: () => void;
1241
+ prev: () => void;
1242
+ }, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{
1243
+ showToolbar: {
1244
+ type: BooleanConstructor;
1245
+ default: boolean;
1246
+ };
1247
+ showToolbarTooltip: BooleanConstructor;
1248
+ theme: import("vue").PropType<import("naive-ui/es/_mixins").Theme<"Image", {
1249
+ toolbarIconColor: string;
1250
+ toolbarColor: string;
1251
+ toolbarBoxShadow: string;
1252
+ toolbarBorderRadius: string;
1253
+ }, {
1254
+ Tooltip: import("naive-ui/es/_mixins").Theme<"Tooltip", {
1255
+ borderRadius: string;
1256
+ boxShadow: string;
1257
+ color: string;
1258
+ textColor: string;
1259
+ padding: string;
1260
+ }, {
1261
+ Popover: import("naive-ui/es/_mixins").Theme<"Popover", {
1262
+ fontSize: string;
1263
+ borderRadius: string;
1264
+ color: string;
1265
+ dividerColor: string;
1266
+ textColor: string;
1267
+ boxShadow: string;
1268
+ space: string;
1269
+ spaceArrow: string;
1270
+ arrowOffset: string;
1271
+ arrowOffsetVertical: string;
1272
+ arrowHeight: string;
1273
+ padding: string;
1274
+ }, any>;
1275
+ }>;
1276
+ }>>;
1277
+ themeOverrides: import("vue").PropType<import("naive-ui/es/_mixins/use-theme").ExtractThemeOverrides<import("naive-ui/es/_mixins").Theme<"Image", {
1278
+ toolbarIconColor: string;
1279
+ toolbarColor: string;
1280
+ toolbarBoxShadow: string;
1281
+ toolbarBorderRadius: string;
1282
+ }, {
1283
+ Tooltip: import("naive-ui/es/_mixins").Theme<"Tooltip", {
1284
+ borderRadius: string;
1285
+ boxShadow: string;
1286
+ color: string;
1287
+ textColor: string;
1288
+ padding: string;
1289
+ }, {
1290
+ Popover: import("naive-ui/es/_mixins").Theme<"Popover", {
1291
+ fontSize: string;
1292
+ borderRadius: string;
1293
+ color: string;
1294
+ dividerColor: string;
1295
+ textColor: string;
1296
+ boxShadow: string;
1297
+ space: string;
1298
+ spaceArrow: string;
1299
+ arrowOffset: string;
1300
+ arrowOffsetVertical: string;
1301
+ arrowHeight: string;
1302
+ padding: string;
1303
+ }, any>;
1304
+ }>;
1305
+ }>>>;
1306
+ builtinThemeOverrides: import("vue").PropType<import("naive-ui/es/_mixins/use-theme").ExtractThemeOverrides<import("naive-ui/es/_mixins").Theme<"Image", {
1307
+ toolbarIconColor: string;
1308
+ toolbarColor: string;
1309
+ toolbarBoxShadow: string;
1310
+ toolbarBorderRadius: string;
1311
+ }, {
1312
+ Tooltip: import("naive-ui/es/_mixins").Theme<"Tooltip", {
1313
+ borderRadius: string;
1314
+ boxShadow: string;
1315
+ color: string;
1316
+ textColor: string;
1317
+ padding: string;
1318
+ }, {
1319
+ Popover: import("naive-ui/es/_mixins").Theme<"Popover", {
1320
+ fontSize: string;
1321
+ borderRadius: string;
1322
+ color: string;
1323
+ dividerColor: string;
1324
+ textColor: string;
1325
+ boxShadow: string;
1326
+ space: string;
1327
+ spaceArrow: string;
1328
+ arrowOffset: string;
1329
+ arrowOffsetVertical: string;
1330
+ arrowHeight: string;
1331
+ padding: string;
1332
+ }, any>;
1333
+ }>;
1334
+ }>>>;
1335
+ }>>, {
1336
+ showToolbar: boolean;
1337
+ showToolbarTooltip: boolean;
1338
+ }>;
1339
+ NImage: any;
1140
1340
  PersonProfile: import("vue").DefineComponent<{
1141
1341
  userInfo: {
1142
1342
  type: import("vue").PropType<import("../../shared/types").AnyObject>;
@@ -1266,7 +1466,7 @@ declare const BiuniqueChat: SFCWithInstall<import("vue").DefineComponent<{
1266
1466
  required: true;
1267
1467
  };
1268
1468
  }>>, {}>;
1269
- images: any[];
1469
+ images: import("vue").Ref<any[]>;
1270
1470
  MESSAGE_TYPE: typeof import("./src/constants").MESSAGE_TYPE;
1271
1471
  }, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{}>>, {}>;
1272
1472
  ChatFooter: import("vue").DefineComponent<{}, {
@@ -1278,12 +1478,26 @@ declare const BiuniqueChat: SFCWithInstall<import("vue").DefineComponent<{
1278
1478
  handleKeyDown: (event: KeyboardEvent) => void;
1279
1479
  isWrap: (event: KeyboardEvent) => boolean;
1280
1480
  handleInput: () => void;
1481
+ onChange: (options: {
1482
+ file: import("naive-ui").UploadFileInfo;
1483
+ fileList: import("naive-ui").UploadFileInfo[];
1484
+ }, chatMessageType: import("./src/constants").MESSAGE_TYPE) => Promise<void>;
1281
1485
  handleMsgSend: () => void;
1282
1486
  sendMessage: (contentInfo: import("../../shared/types").AnyObject) => Promise<void>;
1283
1487
  NButton: any;
1284
1488
  NPopover: any;
1285
1489
  NTooltip: any;
1286
- images: any[];
1490
+ NUpload: any;
1491
+ NUploadTrigger: import("vue").DefineComponent<{
1492
+ abstract: BooleanConstructor;
1493
+ }, () => JSX.Element | import("vue").VNode<import("vue").RendererNode, import("vue").RendererElement, {
1494
+ [key: string]: any;
1495
+ }>[] | undefined, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{
1496
+ abstract: BooleanConstructor;
1497
+ }>>, {
1498
+ abstract: boolean;
1499
+ }>;
1500
+ images: import("vue").Ref<any[]>;
1287
1501
  alt: string[];
1288
1502
  MESSAGE_TYPE: typeof import("./src/constants").MESSAGE_TYPE;
1289
1503
  }, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{}>>, {}>;
@@ -31,7 +31,7 @@ declare const _default: import("vue").DefineComponent<{
31
31
  stompClient: import("vue").Ref<ChatSock | undefined>;
32
32
  state: {
33
33
  currentSessionItem: AnyObject;
34
- sessionKey: string;
34
+ id: string;
35
35
  userInfo: AnyObject;
36
36
  msgList: AnyObject[];
37
37
  currentMsg: AnyObject;
@@ -1140,6 +1140,206 @@ declare const _default: import("vue").DefineComponent<{
1140
1140
  setScrollToButtom: () => Promise<void>;
1141
1141
  getIntervalMsgTime: (time: string) => string;
1142
1142
  NAvatar: any;
1143
+ NImageGroup: import("vue").DefineComponent<{
1144
+ showToolbar: {
1145
+ type: BooleanConstructor;
1146
+ default: boolean;
1147
+ };
1148
+ showToolbarTooltip: BooleanConstructor;
1149
+ theme: PropType<import("naive-ui/es/_mixins").Theme<"Image", {
1150
+ toolbarIconColor: string;
1151
+ toolbarColor: string;
1152
+ toolbarBoxShadow: string;
1153
+ toolbarBorderRadius: string;
1154
+ }, {
1155
+ Tooltip: import("naive-ui/es/_mixins").Theme<"Tooltip", {
1156
+ borderRadius: string;
1157
+ boxShadow: string;
1158
+ color: string;
1159
+ textColor: string;
1160
+ padding: string;
1161
+ }, {
1162
+ Popover: import("naive-ui/es/_mixins").Theme<"Popover", {
1163
+ fontSize: string;
1164
+ borderRadius: string;
1165
+ color: string;
1166
+ dividerColor: string;
1167
+ textColor: string;
1168
+ boxShadow: string;
1169
+ space: string;
1170
+ spaceArrow: string;
1171
+ arrowOffset: string;
1172
+ arrowOffsetVertical: string;
1173
+ arrowHeight: string;
1174
+ padding: string;
1175
+ }, any>;
1176
+ }>;
1177
+ }>>;
1178
+ themeOverrides: PropType<import("naive-ui/es/_mixins/use-theme").ExtractThemeOverrides<import("naive-ui/es/_mixins").Theme<"Image", {
1179
+ toolbarIconColor: string;
1180
+ toolbarColor: string;
1181
+ toolbarBoxShadow: string;
1182
+ toolbarBorderRadius: string;
1183
+ }, {
1184
+ Tooltip: import("naive-ui/es/_mixins").Theme<"Tooltip", {
1185
+ borderRadius: string;
1186
+ boxShadow: string;
1187
+ color: string;
1188
+ textColor: string;
1189
+ padding: string;
1190
+ }, {
1191
+ Popover: import("naive-ui/es/_mixins").Theme<"Popover", {
1192
+ fontSize: string;
1193
+ borderRadius: string;
1194
+ color: string;
1195
+ dividerColor: string;
1196
+ textColor: string;
1197
+ boxShadow: string;
1198
+ space: string;
1199
+ spaceArrow: string;
1200
+ arrowOffset: string;
1201
+ arrowOffsetVertical: string;
1202
+ arrowHeight: string;
1203
+ padding: string;
1204
+ }, any>;
1205
+ }>;
1206
+ }>>>;
1207
+ builtinThemeOverrides: PropType<import("naive-ui/es/_mixins/use-theme").ExtractThemeOverrides<import("naive-ui/es/_mixins").Theme<"Image", {
1208
+ toolbarIconColor: string;
1209
+ toolbarColor: string;
1210
+ toolbarBoxShadow: string;
1211
+ toolbarBorderRadius: string;
1212
+ }, {
1213
+ Tooltip: import("naive-ui/es/_mixins").Theme<"Tooltip", {
1214
+ borderRadius: string;
1215
+ boxShadow: string;
1216
+ color: string;
1217
+ textColor: string;
1218
+ padding: string;
1219
+ }, {
1220
+ Popover: import("naive-ui/es/_mixins").Theme<"Popover", {
1221
+ fontSize: string;
1222
+ borderRadius: string;
1223
+ color: string;
1224
+ dividerColor: string;
1225
+ textColor: string;
1226
+ boxShadow: string;
1227
+ space: string;
1228
+ spaceArrow: string;
1229
+ arrowOffset: string;
1230
+ arrowOffsetVertical: string;
1231
+ arrowHeight: string;
1232
+ padding: string;
1233
+ }, any>;
1234
+ }>;
1235
+ }>>>;
1236
+ }, {
1237
+ mergedClsPrefix: import("vue").ComputedRef<string>;
1238
+ previewInstRef: import("vue").Ref<{
1239
+ setThumbnailEl: (e: HTMLImageElement | null) => void;
1240
+ setPreviewSrc: (src?: string | undefined) => void;
1241
+ toggleShow: () => void;
1242
+ } | null>;
1243
+ next: () => void;
1244
+ prev: () => void;
1245
+ }, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{
1246
+ showToolbar: {
1247
+ type: BooleanConstructor;
1248
+ default: boolean;
1249
+ };
1250
+ showToolbarTooltip: BooleanConstructor;
1251
+ theme: PropType<import("naive-ui/es/_mixins").Theme<"Image", {
1252
+ toolbarIconColor: string;
1253
+ toolbarColor: string;
1254
+ toolbarBoxShadow: string;
1255
+ toolbarBorderRadius: string;
1256
+ }, {
1257
+ Tooltip: import("naive-ui/es/_mixins").Theme<"Tooltip", {
1258
+ borderRadius: string;
1259
+ boxShadow: string;
1260
+ color: string;
1261
+ textColor: string;
1262
+ padding: string;
1263
+ }, {
1264
+ Popover: import("naive-ui/es/_mixins").Theme<"Popover", {
1265
+ fontSize: string;
1266
+ borderRadius: string;
1267
+ color: string;
1268
+ dividerColor: string;
1269
+ textColor: string;
1270
+ boxShadow: string;
1271
+ space: string;
1272
+ spaceArrow: string;
1273
+ arrowOffset: string;
1274
+ arrowOffsetVertical: string;
1275
+ arrowHeight: string;
1276
+ padding: string;
1277
+ }, any>;
1278
+ }>;
1279
+ }>>;
1280
+ themeOverrides: PropType<import("naive-ui/es/_mixins/use-theme").ExtractThemeOverrides<import("naive-ui/es/_mixins").Theme<"Image", {
1281
+ toolbarIconColor: string;
1282
+ toolbarColor: string;
1283
+ toolbarBoxShadow: string;
1284
+ toolbarBorderRadius: string;
1285
+ }, {
1286
+ Tooltip: import("naive-ui/es/_mixins").Theme<"Tooltip", {
1287
+ borderRadius: string;
1288
+ boxShadow: string;
1289
+ color: string;
1290
+ textColor: string;
1291
+ padding: string;
1292
+ }, {
1293
+ Popover: import("naive-ui/es/_mixins").Theme<"Popover", {
1294
+ fontSize: string;
1295
+ borderRadius: string;
1296
+ color: string;
1297
+ dividerColor: string;
1298
+ textColor: string;
1299
+ boxShadow: string;
1300
+ space: string;
1301
+ spaceArrow: string;
1302
+ arrowOffset: string;
1303
+ arrowOffsetVertical: string;
1304
+ arrowHeight: string;
1305
+ padding: string;
1306
+ }, any>;
1307
+ }>;
1308
+ }>>>;
1309
+ builtinThemeOverrides: PropType<import("naive-ui/es/_mixins/use-theme").ExtractThemeOverrides<import("naive-ui/es/_mixins").Theme<"Image", {
1310
+ toolbarIconColor: string;
1311
+ toolbarColor: string;
1312
+ toolbarBoxShadow: string;
1313
+ toolbarBorderRadius: string;
1314
+ }, {
1315
+ Tooltip: import("naive-ui/es/_mixins").Theme<"Tooltip", {
1316
+ borderRadius: string;
1317
+ boxShadow: string;
1318
+ color: string;
1319
+ textColor: string;
1320
+ padding: string;
1321
+ }, {
1322
+ Popover: import("naive-ui/es/_mixins").Theme<"Popover", {
1323
+ fontSize: string;
1324
+ borderRadius: string;
1325
+ color: string;
1326
+ dividerColor: string;
1327
+ textColor: string;
1328
+ boxShadow: string;
1329
+ space: string;
1330
+ spaceArrow: string;
1331
+ arrowOffset: string;
1332
+ arrowOffsetVertical: string;
1333
+ arrowHeight: string;
1334
+ padding: string;
1335
+ }, any>;
1336
+ }>;
1337
+ }>>>;
1338
+ }>>, {
1339
+ showToolbar: boolean;
1340
+ showToolbarTooltip: boolean;
1341
+ }>;
1342
+ NImage: any;
1143
1343
  PersonProfile: import("vue").DefineComponent<{
1144
1344
  userInfo: {
1145
1345
  type: PropType<AnyObject>;
@@ -1269,7 +1469,7 @@ declare const _default: import("vue").DefineComponent<{
1269
1469
  required: true;
1270
1470
  };
1271
1471
  }>>, {}>;
1272
- images: any[];
1472
+ images: import("vue").Ref<any[]>;
1273
1473
  MESSAGE_TYPE: typeof import("./constants").MESSAGE_TYPE;
1274
1474
  }, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{}>>, {}>;
1275
1475
  ChatFooter: import("vue").DefineComponent<{}, {
@@ -1281,12 +1481,26 @@ declare const _default: import("vue").DefineComponent<{
1281
1481
  handleKeyDown: (event: KeyboardEvent) => void;
1282
1482
  isWrap: (event: KeyboardEvent) => boolean;
1283
1483
  handleInput: () => void;
1484
+ onChange: (options: {
1485
+ file: import("naive-ui").UploadFileInfo;
1486
+ fileList: import("naive-ui").UploadFileInfo[];
1487
+ }, chatMessageType: import("./constants").MESSAGE_TYPE) => Promise<void>;
1284
1488
  handleMsgSend: () => void;
1285
1489
  sendMessage: (contentInfo: AnyObject) => Promise<void>;
1286
1490
  NButton: any;
1287
1491
  NPopover: any;
1288
1492
  NTooltip: any;
1289
- images: any[];
1493
+ NUpload: any;
1494
+ NUploadTrigger: import("vue").DefineComponent<{
1495
+ abstract: BooleanConstructor;
1496
+ }, () => JSX.Element | import("vue").VNode<import("vue").RendererNode, import("vue").RendererElement, {
1497
+ [key: string]: any;
1498
+ }>[] | undefined, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{
1499
+ abstract: BooleanConstructor;
1500
+ }>>, {
1501
+ abstract: boolean;
1502
+ }>;
1503
+ images: import("vue").Ref<any[]>;
1290
1504
  alt: string[];
1291
1505
  MESSAGE_TYPE: typeof import("./constants").MESSAGE_TYPE;
1292
1506
  }, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{}>>, {}>;
@@ -1 +1 @@
1
- import{defineComponent as e,ref as s,reactive as t,provide as o,onBeforeUnmount as n,openBlock as r,createElementBlock as i,normalizeStyle as a,unref as c,createVNode as u,withCtx as m,createBlock as d,Fragment as p,createElementVNode as l,renderSlot as h}from"vue";import{NConfigProvider as f,NSpin as v,NLayout as S,NLayoutContent as g}from"naive-ui";import b from"./components/SiderList.vue.js";import y from"./components/ChatHeader.vue.js";import j from"./components/ChatMain.vue.js";import I from"./components/ChatFooter.vue.js";import{ChatSock as _}from"./utils/chatSock.js";import{instanceAxios as k}from"./api/index.js";import{useTheme as M}from"../../../shared/hooks/useTheme.js";import"@vueuse/core";import"date-fns";import{isNumber as L}from"lodash-es";import"@vue/shared";import"../../../shared/utils/index.js";import"@vueuse/shared";import"../../../shared/hooks/selectHooks/useSearchContent.js";import"@vicons/ionicons5";import{SUBSCRIBE_MESSAGE_TYPE as U}from"./constants/index.js";import{InjectionIChatState as x,InjectionIChatStompClient as C,InjectionIChatEmits as N}from"./types/index.js";import"./utils/emoji.js";import{useSession as T}from"./hooks/useSession.js";const q={class:"c-biunique-chat__header"},E={class:"toolbar"};var O=e({__name:"Index",props:{userId:{type:String,required:!0},baseURL:{type:String,default:"/fdp-chat"}},emits:["template-click","unread-message-update"],setup(e,{expose:O,emit:V}){const w=e;k.defaults.baseURL=w.baseURL+"/chat";const A=M(),J=s(!1),R=s(),F=t({currentSessionItem:{},sessionKey:"",userInfo:{},msgList:[],currentMsg:{},isAppendMsg:!1,sessionList:[],isChangeSession:!1,updateSessionItem:{},isUpdateSession:!1});function H(){const e={headers:{UserId:w.userId},heartbeatFn:()=>{try{R.value.send("test")}catch(e){R.value.disconnect(),H()}},connectCb:()=>{console.log("连接成功"),R.value.subscribe("/user/topic/single",(({body:e})=>{try{console.log(JSON.parse(e),"订阅新增消息");const s=JSON.parse(e),{messageVo:t,sessionVo:o}=s;switch(s.event){case U.MESSAGE:if(s.messageVo.sender===F.userInfo.id)return;t.sender===F.currentSessionItem.receiver&&(F.currentMsg=t,F.isAppendMsg=!0),F.updateSessionItem={receiver:t.sender,lastMessageSendTime:t.sendTime,sortTime:t.sendTime,lastMessage:t.content.msg,chatMessageType:t.content.chatMessageType},F.isUpdateSession=!0;break;case U.NEW_SESSION:F.updateSessionItem=o,F.isUpdateSession=!0}}catch(e){console.log(e)}})),R.value.subscribe("/app/sessionList",(({body:e})=>{try{const s=JSON.parse(e),{currentUser:t,sessionVos:o}=s;if(console.log("body",s),F.userInfo=t,!(null==o?void 0:o.length))return;F.sessionList=o}catch(e){console.log(e)}}))},errorCb:(e,s)=>{console.log("断线了,正在重连...")}};R.value=new _("/fdp-chat/websocket",e)}return o(x,F),o(C,R),o(N,V),async function(){H()}(),n((()=>{var e;null==(e=R.value)||e.disconnect()})),O({getUnreadData:function(){return F.sessionList.filter((e=>L(e.unreadNum)&&e.unreadNum>0))},entrySession:T(F).entrySession}),(e,s)=>(r(),i("div",{class:"c-biunique-chat",style:a(c(A))},[u(c(f),{abstract:"",namespace:"c-biunique-chat__popover"},{default:m((()=>[J.value?(r(),d(c(v),{key:0,stroke:"#5585f5"})):(r(),i(p,{key:1},[l("div",q,[l("div",E,[h(e.$slots,"toolbar")])]),u(c(S),{class:"c-biunique-chat__body","has-sider":""},{default:m((()=>[u(b),u(c(g),{class:"chat-content"},{default:m((()=>[u(y),u(j),u(I)])),_:1}),h(e.$slots,"external")])),_:3})],64))])),_:3})],4))}});export{O as default};
1
+ import{defineComponent as e,ref as s,reactive as t,provide as o,onBeforeUnmount as n,openBlock as r,createElementBlock as i,normalizeStyle as a,unref as c,createVNode as u,withCtx as d,createBlock as m,Fragment as p,createElementVNode as l,renderSlot as h}from"vue";import{NConfigProvider as f,NSpin as v,NLayout as S,NLayoutContent as g}from"naive-ui";import b from"./components/SiderList.vue.js";import y from"./components/ChatHeader.vue.js";import j from"./components/ChatMain.vue.js";import I from"./components/ChatFooter.vue.js";import{ChatSock as _}from"./utils/chatSock.js";import{instanceAxios as k}from"./api/index.js";import{useTheme as M}from"../../../shared/hooks/useTheme.js";import"@vueuse/core";import"date-fns";import{isNumber as L}from"lodash-es";import"@vue/shared";import"../../../shared/utils/index.js";import"@vueuse/shared";import"../../../shared/hooks/selectHooks/useSearchContent.js";import"@vicons/ionicons5";import{SUBSCRIBE_MESSAGE_TYPE as U}from"./constants/index.js";import{InjectionIChatState as x,InjectionIChatStompClient as C,InjectionIChatEmits as N}from"./types/index.js";import"./utils/emoji.js";import{useSession as T}from"./hooks/useSession.js";const q={class:"c-biunique-chat__header"},E={class:"toolbar"};var O=e({__name:"Index",props:{userId:{type:String,required:!0},baseURL:{type:String,default:"/fdp-chat"}},emits:["template-click","unread-message-update"],setup(e,{expose:O,emit:V}){const w=e;k.defaults.baseURL=w.baseURL+"/chat";const A=M(),J=s(!1),R=s(),F=t({currentSessionItem:{},id:"",userInfo:{},msgList:[],currentMsg:{},isAppendMsg:!1,sessionList:[],isChangeSession:!1,updateSessionItem:{},isUpdateSession:!1});function H(){const e={headers:{UserId:w.userId},heartbeatFn:()=>{try{R.value.send("test")}catch(e){R.value.disconnect(),H()}},connectCb:()=>{console.log("连接成功"),R.value.subscribe("/user/topic/single",(({body:e})=>{try{console.log(JSON.parse(e),"订阅新增消息");const s=JSON.parse(e),{messageVo:t,sessionVo:o}=s;switch(s.event){case U.MESSAGE:if(s.messageVo.sender===F.userInfo.id)return;t.sender===F.currentSessionItem.receiver&&(F.currentMsg=t,F.isAppendMsg=!0),F.updateSessionItem={receiver:t.sender,lastMessageSendTime:t.sendTime,sortTime:t.sendTime,lastMessage:t.content.msg,chatMessageType:t.content.chatMessageType},F.isUpdateSession=!0;break;case U.NEW_SESSION:F.updateSessionItem=o,F.isUpdateSession=!0}}catch(e){console.log(e)}})),R.value.subscribe("/app/sessionList",(({body:e})=>{try{const s=JSON.parse(e),{currentUser:t,sessionVos:o}=s;if(console.log("body",s),F.userInfo=t,!(null==o?void 0:o.length))return;F.sessionList=o}catch(e){console.log(e)}}))},errorCb:(e,s)=>{console.log("断线了,正在重连...")}};R.value=new _("/fdp-chat/websocket",e)}return o(x,F),o(C,R),o(N,V),async function(){H()}(),n((()=>{var e;null==(e=R.value)||e.disconnect()})),O({getUnreadData:function(){return F.sessionList.filter((e=>L(e.unreadNum)&&e.unreadNum>0))},entrySession:T(F).entrySession}),(e,s)=>(r(),i("div",{class:"c-biunique-chat",style:a(c(A))},[u(c(f),{abstract:"",namespace:"c-biunique-chat__popover"},{default:d((()=>[J.value?(r(),m(c(v),{key:0,stroke:"#5585f5"})):(r(),i(p,{key:1},[l("div",q,[l("div",E,[h(e.$slots,"toolbar")])]),u(c(S),{class:"c-biunique-chat__body","has-sider":""},{default:d((()=>[u(b),u(c(g),{class:"chat-content"},{default:d((()=>[u(y),u(j),u(I)])),_:1}),h(e.$slots,"external")])),_:3})],64))])),_:3})],4))}});export{O as default};
@@ -3,3 +3,4 @@ export declare const instanceAxios: import("axios").AxiosInstance;
3
3
  export declare function accessSessionApi(params: AnyObject): import("axios").AxiosPromise<any>;
4
4
  export declare function getHistoryRecordApi(params: AnyObject): import("axios").AxiosPromise<any>;
5
5
  export declare function toppingSessionApi(params: AnyObject): import("axios").AxiosPromise<any>;
6
+ export declare function uploadFileApi(params: FormData): import("axios").AxiosPromise<any>;
@@ -1 +1 @@
1
- import o from"axios";function e(o){const e=[];for(const n in o){const t=o[n];Array.isArray(t)?t.forEach((o=>{e.push(`${encodeURIComponent(n)}=${encodeURIComponent(o)}`)})):e.push(`${encodeURIComponent(n)}=${encodeURIComponent(t)}`)}return e.join("&")}const n=o.create({withCredentials:!0,timeout:5e3});function t(o){return n({headers:{"Content-Type":"application/x-www-form-urlencoded"},method:"post",url:"/openSession",data:e(o)})}function r(o){return n({method:"get",url:"/recordList",params:o})}function s(o){return n({method:"post",url:"/toppingSession",data:o})}n.interceptors.response.use((o=>{var e,n;if(null==(e=o.data)?void 0:e.result)return null==(n=o.data)?void 0:n.data;console.log("请求错误")}));export{t as accessSessionApi,r as getHistoryRecordApi,n as instanceAxios,s as toppingSessionApi};
1
+ import o from"axios";function t(o){const t=[];for(const e in o){const n=o[e];Array.isArray(n)?n.forEach((o=>{t.push(`${encodeURIComponent(e)}=${encodeURIComponent(o)}`)})):t.push(`${encodeURIComponent(e)}=${encodeURIComponent(n)}`)}return t.join("&")}const e=o.create({withCredentials:!0,timeout:5e3});function n(o){return e({headers:{"Content-Type":"application/x-www-form-urlencoded"},method:"post",url:"/openSession",data:t(o)})}function r(o){return e({method:"get",url:"/recordList",params:o})}function a(o){return e({method:"post",url:"/toppingSession",data:o})}function s(o){return e({headers:{"Content-Type":"multipart/form-data"},method:"post",url:"/uploadFile",data:o})}e.interceptors.response.use((o=>{var t,e;if(null==(t=o.data)?void 0:t.result)return null==(e=o.data)?void 0:e.data;console.log("请求错误")}));export{n as accessSessionApi,r as getHistoryRecordApi,e as instanceAxios,a as toppingSessionApi,s as uploadFileApi};
@@ -1,3 +1,4 @@
1
+ import { UploadFileInfo } from 'naive-ui';
1
2
  import { AnyObject } from '../../../../shared/types';
2
3
  import { MESSAGE_TYPE } from '../constants';
3
4
  declare const _default: import("vue").DefineComponent<{}, {
@@ -9,12 +10,26 @@ declare const _default: import("vue").DefineComponent<{}, {
9
10
  handleKeyDown: (event: KeyboardEvent) => void;
10
11
  isWrap: (event: KeyboardEvent) => boolean;
11
12
  handleInput: () => void;
13
+ onChange: (options: {
14
+ file: UploadFileInfo;
15
+ fileList: Array<UploadFileInfo>;
16
+ }, chatMessageType: MESSAGE_TYPE) => Promise<void>;
12
17
  handleMsgSend: () => void;
13
18
  sendMessage: (contentInfo: AnyObject) => Promise<void>;
14
19
  NButton: any;
15
20
  NPopover: any;
16
21
  NTooltip: any;
17
- images: any[];
22
+ NUpload: any;
23
+ NUploadTrigger: import("vue").DefineComponent<{
24
+ abstract: BooleanConstructor;
25
+ }, () => JSX.Element | import("vue").VNode<import("vue").RendererNode, import("vue").RendererElement, {
26
+ [key: string]: any;
27
+ }>[] | undefined, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{
28
+ abstract: BooleanConstructor;
29
+ }>>, {
30
+ abstract: boolean;
31
+ }>;
32
+ images: import("vue").Ref<any[]>;
18
33
  alt: string[];
19
34
  MESSAGE_TYPE: typeof MESSAGE_TYPE;
20
35
  }, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{}>>, {}>;
@@ -1 +1 @@
1
- import{defineComponent as t,ref as e,openBlock as s,createElementBlock as n,normalizeStyle as i,unref as a,createElementVNode as o,createVNode as r,withCtx as l,createCommentVNode as c,Fragment as u,renderList as g,createBlock as d,createTextVNode as m,toDisplayString as p,withDirectives as f,vShow as y}from"vue";import{NPopover as h,NTooltip as v,NButton as M}from"naive-ui";import{format as T}from"date-fns";import{useState as k}from"../hooks/useState.js";import{useSession as x}from"../hooks/useSession.js";import{images as b,alt as S}from"../utils/emoji.js";import{MESSAGE_TYPE as w}from"../constants/index.js";const E={class:"tool-box"},C=o("span",null,[o("i",{class:"chat--iconfont chat--icon-face"})],-1),K={class:"emoji-box"},j=o("span",null,"默认表情",-1),I={class:"list-box"},_=["onClick"],D=["src"],H=o("span",null,[o("i",{class:"chat--iconfont chat--icon-good"})],-1),L=o("span",null,[o("i",{class:"chat--iconfont chat--icon-image"})],-1),N=o("span",null,[o("i",{class:"chat--iconfont chat--icon-folder"})],-1),J={class:"btn-box"},O=o("span",{class:"tip"},"Enter 发送, Shift + Enter 换行",-1);var X=t({__name:"ChatFooter",setup(t){const X=e(),A=e(""),{state:B,stompClient:F}=k(),{setCurrentSessionItem:G}=x(B);function R(t){["Enter"].includes(t.key)&&(function(t){return t.altKey||t.ctrlKey||t.metaKey||t.shiftKey}(t)||(t.preventDefault(),z()))}function q(){var t,e;A.value=(null==(e=null==(t=X.value)?void 0:t.innerText)?void 0:e.trim())||""}function z(){if(!(A.value.length>2e3))return A.value?void P({msg:A.value}):console.log("请输入内容");console.log("请控制在2000字以内")}async function P(t){const{chatMessageType:e=w.TEXT,msg:s}=t,n={msg:s,chatMessageType:e};[w.TEXT,w.BLEND].includes(e)&&(X.value.innerHTML="",A.value="");const i=T(new Date,"yyyy-MM-dd HH:mm:ss");B.currentMsg={content:n,sender:B.userInfo.id,id:"",sendTime:i,sending:!0,fail:!1},B.isAppendMsg=!0,G({lastMessageSendTime:i,lastMessage:n.msg,sortTime:i,chatMessageType:n.chatMessageType}),B.isChangeSession=!0;try{F.value.send("/app/chat/send",{},JSON.stringify({chatType:"SINGLE",content:{chatMessageType:n.chatMessageType,msg:n.msg},receiver:B.currentSessionItem.receiver})),B.currentMsg={...B.currentMsg,fail:!1}}catch(t){B.currentMsg={...B.currentMsg,fail:!0}}finally{B.currentMsg={...B.currentMsg,sending:!1}}}return(t,e)=>(s(),n("section",{class:"chat-footer",style:i({cursor:a(B).sessionKey?"default":"not-allowed"})},[o("div",E,[r(a(h),{placement:"top",trigger:"click","show-arrow":!1,"display-directive":"show"},{trigger:l((()=>[C])),default:l((()=>[o("div",K,[c(' <span>最近使用</span>\n\t\t\t\t\t<div class="list-box">\n\t\t\t\t\t\t<template v-for="(img, index) in images" :key="index">\n\t\t\t\t\t\t\t<i>\n\t\t\t\t\t\t\t\t<img :src="img" />\n\t\t\t\t\t\t\t</i>\n\t\t\t\t\t\t</template>\n\t\t\t\t\t</div> '),j,o("div",I,[(s(!0),n(u,null,g(a(b),((t,e)=>(s(),n(u,{key:e},[e>0?(s(),d(a(v),{key:0,"show-arrow":!1,trigger:"hover"},{trigger:l((()=>[o("i",{onClick:()=>P({chatMessageType:a(w).EMOJI,msg:e})},[o("img",{src:t},null,8,D)],8,_)])),default:l((()=>[m(" "+p(a(S)[e-1]||"微笑"),1)])),_:2},1024)):c("v-if",!0)],64)))),128))])])])),_:1}),H,L,N]),f(o("div",{ref_key:"inputRef",ref:X,class:"input-box",contenteditable:"",onKeydown:R,onInput:q},null,544),[[y,a(B).sessionKey]]),o("div",J,[O,r(a(M),{type:"primary",round:"",disabled:!A.value,onClick:z},{default:l((()=>[m("发送")])),_:1},8,["disabled"])])],4))}});export{X as default};
1
+ import{defineComponent as t,ref as e,withDirectives as n,openBlock as s,createElementBlock as i,normalizeStyle as a,unref as o,createElementVNode as l,createVNode as c,withCtx as r,createCommentVNode as u,Fragment as d,renderList as p,createBlock as f,createTextVNode as g,toDisplayString as m,vShow as h}from"vue";import{NPopover as v,NTooltip as y,NUpload as M,NUploadTrigger as k,NButton as T}from"naive-ui";import{format as x}from"date-fns";import{useState as C}from"../hooks/useState.js";import{useSession as b}from"../hooks/useSession.js";import{images as E,alt as I}from"../utils/emoji.js";import{MESSAGE_TYPE as w}from"../constants/index.js";import{uploadFileApi as _}from"../api/index.js";const S={class:"tool-box"},j=l("span",null,[l("i",{class:"chat--iconfont chat--icon-face"})],-1),L={class:"emoji-box"},F=l("span",null,"默认表情",-1),K={class:"list-box"},D=["onClick"],H=["src"],J=[l("i",{class:"chat--iconfont chat--icon-good"},null,-1)],N=["onClick"],O=[l("i",{class:"chat--iconfont chat--icon-image"},null,-1)],A=["onClick"],G=[l("i",{class:"chat--iconfont chat--icon-folder"},null,-1)],X={class:"btn-box"},z=l("span",{class:"tip"},"Enter 发送, Shift + Enter 换行",-1);var B=t({__name:"ChatFooter",setup(t){const B=e(),R=e(""),{state:U,stompClient:q}=C(),{setCurrentSessionItem:P}=b(U);function Q(t){["Enter"].includes(t.key)&&(function(t){return t.altKey||t.ctrlKey||t.metaKey||t.shiftKey}(t)||(t.preventDefault(),Y()))}function V(){var t,e;R.value=(null==(e=null==(t=B.value)?void 0:t.innerText)?void 0:e.trim())||""}async function W(t,e){console.log(W,t);const{file:n,name:s}=t.file,i=new FormData;i.append("sender",U.userInfo.id),i.append("file",n);const a=await _(i);if(!a)return console.log("上传失败");Z({chatMessageType:e,msg:e===w.FILE?s:a,url:a})}function Y(){if(!(R.value.length>2e3))return R.value?void Z({msg:R.value}):console.log("请输入内容");console.log("请控制在2000字以内")}async function Z(t){const{chatMessageType:e=w.TEXT,msg:n,url:s}=t,i={msg:n,chatMessageType:e};e===w.FILE&&(i.fileUrl=s),[w.TEXT,w.BLEND].includes(e)&&(B.value.innerHTML="",R.value="");const a=x(new Date,"yyyy-MM-dd HH:mm:ss");U.currentMsg={content:i,sender:U.userInfo.id,id:"",sendTime:a,sending:!0,fail:!1},U.isAppendMsg=!0,P({lastMessageSendTime:a,lastMessage:i.msg,sortTime:a,chatMessageType:i.chatMessageType}),U.isChangeSession=!0;try{q.value.send("/app/chat/send",{},JSON.stringify({chatType:"SINGLE",content:i,receiver:U.currentSessionItem.receiver})),U.currentMsg={...U.currentMsg,fail:!1}}catch(t){U.currentMsg={...U.currentMsg,fail:!0}}finally{U.currentMsg={...U.currentMsg,sending:!1}}}return(t,e)=>n((s(),i("section",{class:"chat-footer",style:a({cursor:o(U).id?"default":"not-allowed"})},[l("div",S,[c(o(v),{placement:"top",trigger:"click","show-arrow":!1,"display-directive":"show"},{trigger:r((()=>[j])),default:r((()=>[l("div",L,[u(' <span>最近使用</span>\n\t\t\t\t\t<div class="list-box">\n\t\t\t\t\t\t<template v-for="(img, index) in images" :key="index">\n\t\t\t\t\t\t\t<i>\n\t\t\t\t\t\t\t\t<img :src="img" />\n\t\t\t\t\t\t\t</i>\n\t\t\t\t\t\t</template>\n\t\t\t\t\t</div> '),F,l("div",K,[(s(!0),i(d,null,p(o(E),((t,e)=>(s(),i(d,{key:e},[e>0?(s(),f(o(y),{key:0,"show-arrow":!1,trigger:"hover"},{trigger:r((()=>[l("i",{onClick:()=>Z({chatMessageType:o(w).EMOJI,msg:e})},[l("img",{src:t},null,8,H)],8,D)])),default:r((()=>[g(" "+m(o(I)[e-1]||"微笑"),1)])),_:2},1024)):u("v-if",!0)],64)))),128))])])])),_:1}),l("span",{onClick:e[0]||(e[0]=()=>Z({chatMessageType:o(w).EMOJI,msg:0}))},J),c(o(M),{abstract:"",multiple:"",accept:"image/*",onChange:e[1]||(e[1]=t=>W(t,o(w).IMAGE))},{default:r((()=>[c(o(k),{abstract:""},{default:r((({handleClick:t})=>[l("span",{onClick:t},O,8,N)])),_:1})])),_:1}),c(o(M),{abstract:"",multiple:"",accept:"video/*,.pdf,.doc.docx,,.zip,.xlsx,.txt",onChange:e[2]||(e[2]=t=>W(t,o(w).FILE))},{default:r((()=>[c(o(k),{abstract:""},{default:r((({handleClick:t})=>[l("span",{onClick:t},G,8,A)])),_:1})])),_:1})]),n(l("div",{ref_key:"inputRef",ref:B,class:"input-box",contenteditable:"",onKeydown:Q,onInput:V},null,544),[[h,o(U).id]]),l("div",X,[z,c(o(T),{type:"primary",round:"",disabled:!R.value,onClick:Y},{default:r((()=>[g("发送")])),_:1},8,["disabled"])])],4)),[[h,o(U).id]])}});export{B as default};
@@ -1 +1 @@
1
- import{defineComponent as e,ref as o,computed as a,openBlock as s,createElementBlock as t,Fragment as i,unref as n,createElementVNode as c,createVNode as r,withCtx as l,toDisplayString as u,createCommentVNode as h}from"vue";import{NAvatar as m}from"naive-ui";import{useState as v}from"../hooks/useState.js";import f from"./PersonProfile.vue.js";import p from"./ChatSet.vue.js";import d from"./ChatFile.vue.js";import w from"./ChatRecord.vue.js";const C={key:0,class:"chat-header box-shadow"},_={class:"chat-header__left"},g={class:"name"},k={class:"chat-header__right"};var j=e({__name:"ChatHeader",setup(e){const{state:j}=v(),S=o(!1),y=o(!1),I=o("image"),U=o(!1),x=a((()=>j.currentSessionItem.name||""));function P(e){I.value=e,y.value=!0}return(e,o)=>(s(),t(i,null,[n(j).sessionKey?(s(),t("section",C,[c("div",_,[r(f,{"user-info":n(j).currentSessionItem},{trigger:l((()=>[r(n(m),{round:"",size:30,src:n(j).currentSessionItem.avatar},null,8,["src"])])),_:1},8,["user-info"]),c("span",g,u(n(x)),1)]),c("div",k,[c("i",{class:"chat--iconfont chat--icon-image",onClick:o[0]||(o[0]=()=>P("image"))}),c("i",{class:"chat--iconfont chat--icon-folder",onClick:o[1]||(o[1]=()=>P("file"))}),c("i",{class:"chat--iconfont chat--icon-list-search",onClick:o[2]||(o[2]=e=>U.value=!0)}),c("i",{class:"chat--iconfont chat--icon-set",onClick:o[3]||(o[3]=e=>S.value=!0)})])])):h("v-if",!0),r(p,{show:S.value,"onUpdate:show":o[4]||(o[4]=e=>S.value=e)},null,8,["show"]),r(d,{show:y.value,"onUpdate:show":o[5]||(o[5]=e=>y.value=e),type:I.value},null,8,["show","type"]),r(w,{show:U.value,"onUpdate:show":o[6]||(o[6]=e=>U.value=e)},null,8,["show"])],64))}});export{j as default};
1
+ import{defineComponent as e,ref as o,computed as a,openBlock as t,createElementBlock as s,Fragment as i,unref as n,createElementVNode as c,createVNode as r,withCtx as l,toDisplayString as u,createCommentVNode as h}from"vue";import{NAvatar as m}from"naive-ui";import{useState as v}from"../hooks/useState.js";import f from"./PersonProfile.vue.js";import d from"./ChatSet.vue.js";import p from"./ChatFile.vue.js";import w from"./ChatRecord.vue.js";const C={key:0,class:"chat-header box-shadow"},_={class:"chat-header__left"},g={class:"name"},k={class:"chat-header__right"};var j=e({__name:"ChatHeader",setup(e){const{state:j}=v(),S=o(!1),y=o(!1),I=o("image"),U=o(!1),x=a((()=>j.currentSessionItem.name||""));function P(e){I.value=e,y.value=!0}return(e,o)=>(t(),s(i,null,[n(j).id?(t(),s("section",C,[c("div",_,[r(f,{"user-info":n(j).currentSessionItem},{trigger:l((()=>[r(n(m),{round:"",size:30,src:n(j).currentSessionItem.avatar},null,8,["src"])])),_:1},8,["user-info"]),c("span",g,u(n(x)),1)]),c("div",k,[c("i",{class:"chat--iconfont chat--icon-image",onClick:o[0]||(o[0]=()=>P("image"))}),c("i",{class:"chat--iconfont chat--icon-folder",onClick:o[1]||(o[1]=()=>P("file"))}),c("i",{class:"chat--iconfont chat--icon-list-search",onClick:o[2]||(o[2]=e=>U.value=!0)}),c("i",{class:"chat--iconfont chat--icon-set",onClick:o[3]||(o[3]=e=>S.value=!0)})])])):h("v-if",!0),r(d,{show:S.value,"onUpdate:show":o[4]||(o[4]=e=>S.value=e)},null,8,["show"]),r(p,{show:y.value,"onUpdate:show":o[5]||(o[5]=e=>y.value=e),type:I.value},null,8,["show","type"]),r(w,{show:U.value,"onUpdate:show":o[6]||(o[6]=e=>U.value=e)},null,8,["show"])],64))}});export{j as default};