@ibiz-template/vue3-components 0.7.41-alpha.151 → 0.7.41-alpha.152

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,4 +1,4 @@
1
- import { isVNode, defineComponent, createVNode, resolveComponent, withDirectives, resolveDirective, ref, computed, watch } from 'vue';
1
+ import { isVNode, defineComponent, createVNode, resolveComponent, mergeProps, withDirectives, resolveDirective, ref, computed, watch } from 'vue';
2
2
  import { hasEmptyPanelRenderer, IBizCustomRender, useControlController, useNamespace, useUIStore, useSemanticNode } from '@ibiz-template/vue3-util';
3
3
  import { CalendarController } from '@ibiz-template/runtime';
4
4
  import dayjs from 'dayjs';
@@ -470,16 +470,19 @@ const CalendarControl = /* @__PURE__ */ defineComponent({
470
470
  let content;
471
471
  if (!htmlCode)
472
472
  content = this.showDateRange ? date && (dayjs(date).isSame(item.beginTime, "day") || dayjs(date).day() === 0 || !item.beginTime && dayjs(date).isSame(item.endTime, "day")) ? item.text : "" : item.text;
473
- return createVNode("div", {
473
+ const vHtmlProps = htmlCode ? {
474
+ "v-html": htmlCode
475
+ } : {};
476
+ return createVNode("div", mergeProps({
474
477
  "class": itemClass,
475
478
  "style": style,
476
- "key": item.deData.srfkey,
477
- "innerHTML": htmlCode,
479
+ "key": item.deData.srfkey
480
+ }, vHtmlProps, {
478
481
  "title": showTitle(item.tips || item.text),
479
482
  "onClick": () => this.c.onRowClick(item),
480
483
  "onDblclick": () => this.c.onDbRowClick(item),
481
484
  "onContextmenu": (evt) => this.onNodeContextmenu(item, evt)
482
- }, [content]);
485
+ }), [content]);
483
486
  };
484
487
  const renderCalendarItem = (item, date) => {
485
488
  var _a, _b, _c;
@@ -355,9 +355,11 @@ class AIChatUtil {
355
355
  if (extParams && Object.keys(extParams).length > 0) {
356
356
  Object.assign(questionRequestData, { srfextparams: extParams });
357
357
  }
358
+ aiChat.addWaitingMessage(id);
358
359
  await deService.aiChatSse(
359
360
  (msg) => {
360
361
  if (msg.actionstate === 20 && msg.actionresult) {
362
+ aiChat.removeWaitingMessage(id);
361
363
  if (msg.asextparam && localMsgID && updateFlag) {
362
364
  aiChat.updateMsgRealMessageID(localMsgID, msg.asextparam);
363
365
  updateFlag = false;
@@ -428,6 +430,7 @@ class AIChatUtil {
428
430
  }
429
431
  abortController == null ? void 0 : abortController.abort();
430
432
  } finally {
433
+ aiChat.removeWaitingMessage(id);
431
434
  aiChat.completeMessage(id, true);
432
435
  aiChat.setActiveAsyncacitonId("");
433
436
  return true;
@@ -487,9 +490,11 @@ class AIChatUtil {
487
490
  srfproject: other.srfproject
488
491
  });
489
492
  try {
493
+ aiChat.addWaitingMessage(id);
490
494
  await deService.aiResumeSse(
491
495
  (msg) => {
492
496
  if (msg.actionstate === 20 && msg.actionresult) {
497
+ aiChat.removeWaitingMessage(id);
493
498
  aiChat.isLoading.value = true;
494
499
  if (!aiChat.getActiveAsyncacitonId()) {
495
500
  aiChat.setActiveAsyncacitonId(msg.asyncacitonid);
@@ -559,6 +564,7 @@ class AIChatUtil {
559
564
  }
560
565
  abortController == null ? void 0 : abortController.abort();
561
566
  } finally {
567
+ aiChat.removeWaitingMessage(id);
562
568
  aiChat.isLoading.value = false;
563
569
  aiChat.completeMessage(id, true);
564
570
  aiChat.setActiveAsyncacitonId("");
@@ -1150,9 +1156,11 @@ class AIChatUtil {
1150
1156
  if (extParams && Object.keys(extParams).length > 0) {
1151
1157
  Object.assign(questionRequestData, { srfextparams: extParams });
1152
1158
  }
1159
+ aiChat.addWaitingMessage(id);
1153
1160
  await deService.aiChatSse(
1154
1161
  (msg) => {
1155
1162
  if (msg.actionstate === 20 && msg.actionresult) {
1163
+ aiChat.removeWaitingMessage(id);
1156
1164
  if (msg.asextparam && localMsgID && updateFlag) {
1157
1165
  aiChat.updateMsgRealMessageID(localMsgID, msg.asextparam);
1158
1166
  updateFlag = false;
@@ -1223,6 +1231,7 @@ class AIChatUtil {
1223
1231
  }
1224
1232
  abortController == null ? void 0 : abortController.abort();
1225
1233
  } finally {
1234
+ aiChat.removeWaitingMessage(id);
1226
1235
  aiChat.setActiveAsyncacitonId("");
1227
1236
  aiChat.completeMessage(id, true);
1228
1237
  return true;
@@ -1282,9 +1291,11 @@ class AIChatUtil {
1282
1291
  srfproject: other.srfproject
1283
1292
  });
1284
1293
  try {
1294
+ aiChat.addWaitingMessage(id);
1285
1295
  await deService.aiResumeSse(
1286
1296
  (msg) => {
1287
1297
  if (msg.actionstate === 20 && msg.actionresult) {
1298
+ aiChat.removeWaitingMessage(id);
1288
1299
  aiChat.isLoading.value = true;
1289
1300
  if (!aiChat.getActiveAsyncacitonId()) {
1290
1301
  aiChat.setActiveAsyncacitonId(msg.asyncacitonid);
@@ -1354,6 +1365,7 @@ class AIChatUtil {
1354
1365
  }
1355
1366
  abortController == null ? void 0 : abortController.abort();
1356
1367
  } finally {
1368
+ aiChat.removeWaitingMessage(id);
1357
1369
  aiChat.isLoading.value = false;
1358
1370
  aiChat.completeMessage(id, true);
1359
1371
  aiChat.setActiveAsyncacitonId("");
@@ -472,16 +472,19 @@ const CalendarControl = /* @__PURE__ */ vue.defineComponent({
472
472
  let content;
473
473
  if (!htmlCode)
474
474
  content = this.showDateRange ? date && (dayjs(date).isSame(item.beginTime, "day") || dayjs(date).day() === 0 || !item.beginTime && dayjs(date).isSame(item.endTime, "day")) ? item.text : "" : item.text;
475
- return vue.createVNode("div", {
475
+ const vHtmlProps = htmlCode ? {
476
+ "v-html": htmlCode
477
+ } : {};
478
+ return vue.createVNode("div", vue.mergeProps({
476
479
  "class": itemClass,
477
480
  "style": style,
478
- "key": item.deData.srfkey,
479
- "innerHTML": htmlCode,
481
+ "key": item.deData.srfkey
482
+ }, vHtmlProps, {
480
483
  "title": core.showTitle(item.tips || item.text),
481
484
  "onClick": () => this.c.onRowClick(item),
482
485
  "onDblclick": () => this.c.onDbRowClick(item),
483
486
  "onContextmenu": (evt) => this.onNodeContextmenu(item, evt)
484
- }, [content]);
487
+ }), [content]);
485
488
  };
486
489
  const renderCalendarItem = (item, date) => {
487
490
  var _a, _b, _c;
@@ -357,9 +357,11 @@ class AIChatUtil {
357
357
  if (extParams && Object.keys(extParams).length > 0) {
358
358
  Object.assign(questionRequestData, { srfextparams: extParams });
359
359
  }
360
+ aiChat.addWaitingMessage(id);
360
361
  await deService.aiChatSse(
361
362
  (msg) => {
362
363
  if (msg.actionstate === 20 && msg.actionresult) {
364
+ aiChat.removeWaitingMessage(id);
363
365
  if (msg.asextparam && localMsgID && updateFlag) {
364
366
  aiChat.updateMsgRealMessageID(localMsgID, msg.asextparam);
365
367
  updateFlag = false;
@@ -430,6 +432,7 @@ class AIChatUtil {
430
432
  }
431
433
  abortController == null ? void 0 : abortController.abort();
432
434
  } finally {
435
+ aiChat.removeWaitingMessage(id);
433
436
  aiChat.completeMessage(id, true);
434
437
  aiChat.setActiveAsyncacitonId("");
435
438
  return true;
@@ -489,9 +492,11 @@ class AIChatUtil {
489
492
  srfproject: other.srfproject
490
493
  });
491
494
  try {
495
+ aiChat.addWaitingMessage(id);
492
496
  await deService.aiResumeSse(
493
497
  (msg) => {
494
498
  if (msg.actionstate === 20 && msg.actionresult) {
499
+ aiChat.removeWaitingMessage(id);
495
500
  aiChat.isLoading.value = true;
496
501
  if (!aiChat.getActiveAsyncacitonId()) {
497
502
  aiChat.setActiveAsyncacitonId(msg.asyncacitonid);
@@ -561,6 +566,7 @@ class AIChatUtil {
561
566
  }
562
567
  abortController == null ? void 0 : abortController.abort();
563
568
  } finally {
569
+ aiChat.removeWaitingMessage(id);
564
570
  aiChat.isLoading.value = false;
565
571
  aiChat.completeMessage(id, true);
566
572
  aiChat.setActiveAsyncacitonId("");
@@ -1152,9 +1158,11 @@ class AIChatUtil {
1152
1158
  if (extParams && Object.keys(extParams).length > 0) {
1153
1159
  Object.assign(questionRequestData, { srfextparams: extParams });
1154
1160
  }
1161
+ aiChat.addWaitingMessage(id);
1155
1162
  await deService.aiChatSse(
1156
1163
  (msg) => {
1157
1164
  if (msg.actionstate === 20 && msg.actionresult) {
1165
+ aiChat.removeWaitingMessage(id);
1158
1166
  if (msg.asextparam && localMsgID && updateFlag) {
1159
1167
  aiChat.updateMsgRealMessageID(localMsgID, msg.asextparam);
1160
1168
  updateFlag = false;
@@ -1225,6 +1233,7 @@ class AIChatUtil {
1225
1233
  }
1226
1234
  abortController == null ? void 0 : abortController.abort();
1227
1235
  } finally {
1236
+ aiChat.removeWaitingMessage(id);
1228
1237
  aiChat.setActiveAsyncacitonId("");
1229
1238
  aiChat.completeMessage(id, true);
1230
1239
  return true;
@@ -1284,9 +1293,11 @@ class AIChatUtil {
1284
1293
  srfproject: other.srfproject
1285
1294
  });
1286
1295
  try {
1296
+ aiChat.addWaitingMessage(id);
1287
1297
  await deService.aiResumeSse(
1288
1298
  (msg) => {
1289
1299
  if (msg.actionstate === 20 && msg.actionresult) {
1300
+ aiChat.removeWaitingMessage(id);
1290
1301
  aiChat.isLoading.value = true;
1291
1302
  if (!aiChat.getActiveAsyncacitonId()) {
1292
1303
  aiChat.setActiveAsyncacitonId(msg.asyncacitonid);
@@ -1356,6 +1367,7 @@ class AIChatUtil {
1356
1367
  }
1357
1368
  abortController == null ? void 0 : abortController.abort();
1358
1369
  } finally {
1370
+ aiChat.removeWaitingMessage(id);
1359
1371
  aiChat.isLoading.value = false;
1360
1372
  aiChat.completeMessage(id, true);
1361
1373
  aiChat.setActiveAsyncacitonId("");
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ibiz-template/vue3-components",
3
- "version": "0.7.41-alpha.151",
3
+ "version": "0.7.41-alpha.152",
4
4
  "description": "web端组件库(vue3)",
5
5
  "main": "lib/index.cjs",
6
6
  "module": "es/index.mjs",
@@ -31,7 +31,7 @@
31
31
  "dependencies": {
32
32
  "@amap/amap-jsapi-loader": "^1.0.1",
33
33
  "@floating-ui/dom": "^1.5.3",
34
- "@ibiz-template-plugin/ai-chat": "^0.0.116",
34
+ "@ibiz-template-plugin/ai-chat": "^0.0.117",
35
35
  "@ibiz-template-plugin/gantt": "0.1.8-alpha.468",
36
36
  "@ibiz-template-plugin/bi-report": "0.0.32",
37
37
  "@ibiz-template-plugin/data-view": "0.0.8",
@@ -697,12 +697,14 @@ export const CalendarControl = defineComponent({
697
697
  ? item.text
698
698
  : ''
699
699
  : item.text;
700
+ // htmlCode 有值时才传 v-html,否则传 children
701
+ const vHtmlProps = htmlCode ? { 'v-html': htmlCode } : {};
700
702
  return (
701
703
  <div
702
704
  class={itemClass}
703
705
  style={style}
704
706
  key={item.deData.srfkey}
705
- v-html={htmlCode}
707
+ {...vHtmlProps}
706
708
  title={showTitle(item.tips || item.text)}
707
709
  onClick={(): Promise<void> => this.c.onRowClick(item)}
708
710
  onDblclick={(): Promise<void> => this.c.onDbRowClick(item)}
@@ -508,10 +508,14 @@ export class AIChatUtil implements IApiAIChatUtil {
508
508
  if (extParams && Object.keys(extParams).length > 0) {
509
509
  Object.assign(questionRequestData, { srfextparams: extParams });
510
510
  }
511
+ // 新增等待回复消息(AI首条内容到达前显示loading气泡)
512
+ aiChat.addWaitingMessage(id);
511
513
  await deService.aiChatSse(
512
514
  (msg: IPortalAsyncAction) => {
513
515
  // 20: 持续回答中,消息会持续推送。同一个消息 id 会显示在同一个框内
514
516
  if (msg.actionstate === 20 && msg.actionresult) {
517
+ // 移除等待回复消息
518
+ aiChat.removeWaitingMessage(id);
515
519
  // 更新用户消息真实id
516
520
  if (msg.asextparam && localMsgID && updateFlag) {
517
521
  aiChat.updateMsgRealMessageID(localMsgID, msg.asextparam);
@@ -588,6 +592,8 @@ export class AIChatUtil implements IApiAIChatUtil {
588
592
  }
589
593
  abortController?.abort();
590
594
  } finally {
595
+ // 移除等待回复消息
596
+ aiChat.removeWaitingMessage(id);
591
597
  // 标记当前消息已经交互完成
592
598
  aiChat.completeMessage(id, true);
593
599
  // 清空异步消息任务
@@ -667,10 +673,14 @@ export class AIChatUtil implements IApiAIChatUtil {
667
673
  srfproject: other.srfproject,
668
674
  });
669
675
  try {
676
+ // 新增等待回复消息(AI首条内容到达前显示loading气泡)
677
+ aiChat.addWaitingMessage(id);
670
678
  await deService.aiResumeSse(
671
679
  (msg: IPortalAsyncAction) => {
672
680
  // 20: 持续回答中,消息会持续推送。同一个消息 id 会显示在同一个框内
673
681
  if (msg.actionstate === 20 && msg.actionresult) {
682
+ // 移除等待回复消息
683
+ aiChat.removeWaitingMessage(id);
674
684
  // 设置当前聊天在加载中
675
685
  aiChat.isLoading.value = true;
676
686
  // 不存在才设置,存在则不设置(下方设置的时候需要去存储话题数据中)
@@ -748,6 +758,8 @@ export class AIChatUtil implements IApiAIChatUtil {
748
758
  }
749
759
  abortController?.abort();
750
760
  } finally {
761
+ // 移除等待回复消息
762
+ aiChat.removeWaitingMessage(id);
751
763
  // 设置当前聊天加载状态已完成
752
764
  aiChat.isLoading.value = false;
753
765
  // 标记当前消息已经交互完成
@@ -1500,10 +1512,14 @@ export class AIChatUtil implements IApiAIChatUtil {
1500
1512
  if (extParams && Object.keys(extParams).length > 0) {
1501
1513
  Object.assign(questionRequestData, { srfextparams: extParams });
1502
1514
  }
1515
+ // 新增等待回复消息(AI首条内容到达前显示loading气泡)
1516
+ aiChat.addWaitingMessage(id);
1503
1517
  await deService.aiChatSse(
1504
1518
  (msg: IPortalAsyncAction) => {
1505
1519
  // 20: 持续回答中,消息会持续推送。同一个消息 id 会显示在同一个框内
1506
1520
  if (msg.actionstate === 20 && msg.actionresult) {
1521
+ // 移除等待回复消息
1522
+ aiChat.removeWaitingMessage(id);
1507
1523
  // 更新用户消息真实id
1508
1524
  if (msg.asextparam && localMsgID && updateFlag) {
1509
1525
  aiChat.updateMsgRealMessageID(localMsgID, msg.asextparam);
@@ -1580,6 +1596,8 @@ export class AIChatUtil implements IApiAIChatUtil {
1580
1596
  }
1581
1597
  abortController?.abort();
1582
1598
  } finally {
1599
+ // 移除等待回复消息
1600
+ aiChat.removeWaitingMessage(id);
1583
1601
  // 清空异步消息任务
1584
1602
  aiChat.setActiveAsyncacitonId('');
1585
1603
  // 标记当前消息已经交互完成
@@ -1659,10 +1677,14 @@ export class AIChatUtil implements IApiAIChatUtil {
1659
1677
  srfproject: other.srfproject,
1660
1678
  });
1661
1679
  try {
1680
+ // 新增等待回复消息(AI首条内容到达前显示loading气泡)
1681
+ aiChat.addWaitingMessage(id);
1662
1682
  await deService.aiResumeSse(
1663
1683
  (msg: IPortalAsyncAction) => {
1664
1684
  // 20: 持续回答中,消息会持续推送。同一个消息 id 会显示在同一个框内
1665
1685
  if (msg.actionstate === 20 && msg.actionresult) {
1686
+ // 移除等待回复消息
1687
+ aiChat.removeWaitingMessage(id);
1666
1688
  // 设置当前聊天在加载中
1667
1689
  aiChat.isLoading.value = true;
1668
1690
  // 不存在才设置,存在则不设置(下方设置的时候需要去存储话题数据中)
@@ -1740,6 +1762,8 @@ export class AIChatUtil implements IApiAIChatUtil {
1740
1762
  }
1741
1763
  abortController?.abort();
1742
1764
  } finally {
1765
+ // 移除等待回复消息
1766
+ aiChat.removeWaitingMessage(id);
1743
1767
  // 设置当前聊天加载状态已完成
1744
1768
  aiChat.isLoading.value = false;
1745
1769
  // 标记当前消息已经交互完成