@ibiz-template/vue3-components 0.7.41-alpha.170 → 0.7.41-alpha.172

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 (47) hide show
  1. package/dist/{chart-D8ak71ob.js → chart-5YvW_6v1.js} +1 -1
  2. package/dist/{index-3TWmawfm.js → index-Djn5hsaB.js} +5 -5
  3. package/dist/{index.es-LxA_BfCY.js → index.es-DK-t7__C.js} +1 -1
  4. package/dist/index.min.css +1 -1
  5. package/dist/index.system.min.js +1 -1
  6. package/dist/{wang-editor-Cm91QEYy.js → wang-editor-0QMRlKbm.js} +1 -1
  7. package/dist/{xlsx-util-DSZIziO3.js → xlsx-util-CWqroKyj.js} +1 -1
  8. package/es/common/carousel/carousel.mjs +1 -1
  9. package/es/control/chart/chart.mjs +4 -4
  10. package/es/control/data-view/data-view.mjs +9 -3
  11. package/es/control/grid/grid/grid.mjs +4 -4
  12. package/es/control/list/list.mjs +9 -3
  13. package/es/control/tree-grid/tree-grid.mjs +4 -4
  14. package/es/control/tree-grid-ex/tree-grid-ex.mjs +4 -4
  15. package/es/editor/ai-chat/embed-ai-chat/embed-ai-chat.mjs +25 -10
  16. package/es/editor/ai-chat/embed-ai-chat-editor.controller.mjs +17 -8
  17. package/es/editor/data-picker/ibiz-transfer-picker/ibiz-transfer-picker.mjs +14 -14
  18. package/es/editor/dropdown-list/ibiz-dropdown/ibiz-dropdown.mjs +25 -28
  19. package/es/util/ai-chat-util/ai-chat-util.mjs +42 -1
  20. package/es/util/modal-util/modal-util.mjs +7 -0
  21. package/lib/common/carousel/carousel.cjs +1 -1
  22. package/lib/control/chart/chart.cjs +4 -4
  23. package/lib/control/data-view/data-view.cjs +8 -2
  24. package/lib/control/grid/grid/grid.cjs +4 -4
  25. package/lib/control/list/list.cjs +8 -2
  26. package/lib/control/tree-grid/tree-grid.cjs +4 -4
  27. package/lib/control/tree-grid-ex/tree-grid-ex.cjs +4 -4
  28. package/lib/editor/ai-chat/embed-ai-chat/embed-ai-chat.cjs +24 -9
  29. package/lib/editor/ai-chat/embed-ai-chat-editor.controller.cjs +17 -8
  30. package/lib/editor/data-picker/ibiz-transfer-picker/ibiz-transfer-picker.cjs +14 -14
  31. package/lib/editor/dropdown-list/ibiz-dropdown/ibiz-dropdown.cjs +25 -28
  32. package/lib/util/ai-chat-util/ai-chat-util.cjs +41 -0
  33. package/lib/util/modal-util/modal-util.cjs +7 -0
  34. package/package.json +5 -5
  35. package/src/common/carousel/carousel.tsx +1 -1
  36. package/src/control/chart/chart.tsx +4 -4
  37. package/src/control/data-view/data-view.tsx +11 -4
  38. package/src/control/grid/grid/grid.tsx +4 -4
  39. package/src/control/list/list.tsx +11 -4
  40. package/src/control/tree-grid/tree-grid.tsx +4 -4
  41. package/src/control/tree-grid-ex/tree-grid-ex.tsx +4 -4
  42. package/src/editor/ai-chat/embed-ai-chat/embed-ai-chat.tsx +32 -18
  43. package/src/editor/ai-chat/embed-ai-chat-editor.controller.ts +25 -13
  44. package/src/editor/data-picker/ibiz-transfer-picker/ibiz-transfer-picker.tsx +14 -14
  45. package/src/editor/dropdown-list/ibiz-dropdown/ibiz-dropdown.tsx +42 -63
  46. package/src/util/ai-chat-util/ai-chat-util.ts +43 -0
  47. package/src/util/modal-util/modal-util.ts +8 -0
@@ -6,7 +6,7 @@ import {
6
6
  } from '@ibiz-template/runtime';
7
7
  import { Ref, ref } from 'vue';
8
8
  import { createUUID } from 'qx-util';
9
- import { IAppDEACMode, ITextArea, ITextBox } from '@ibiz/model-core';
9
+ import { IAppDEACMode, ITextArea } from '@ibiz/model-core';
10
10
 
11
11
  /**
12
12
  * @description 嵌入式AI聊天编辑器控制器
@@ -14,9 +14,9 @@ import { IAppDEACMode, ITextArea, ITextBox } from '@ibiz/model-core';
14
14
  * @date 2026-05-15 11:05:17
15
15
  * @export
16
16
  * @class EmbedAIChatEditorController
17
- * @extends {EditorController<ITextBox>}
17
+ * @extends {EditorController<ITextArea>}
18
18
  */
19
- export class EmbedAIChatEditorController extends EditorController<ITextBox> {
19
+ export class EmbedAIChatEditorController extends EditorController<ITextArea> {
20
20
  /**
21
21
  * @description 聊天框实例
22
22
  * @author tony001
@@ -45,12 +45,19 @@ export class EmbedAIChatEditorController extends EditorController<ITextBox> {
45
45
  deACMode?: IAppDEACMode;
46
46
 
47
47
  /**
48
- * @description
48
+ * @description 是否为简单模式
49
49
  * @type {boolean}
50
50
  * @memberof EmbedAIChatEditorController
51
51
  */
52
52
  isSimple: boolean = false;
53
53
 
54
+ /**
55
+ * @description 是否为分享模式
56
+ * @type {boolean}
57
+ * @memberof EmbedAIChatEditorController
58
+ */
59
+ isShare: boolean = false;
60
+
54
61
  /**
55
62
  * @description 编辑器唯一标识
56
63
  * @protected
@@ -69,7 +76,7 @@ export class EmbedAIChatEditorController extends EditorController<ITextBox> {
69
76
  */
70
77
  protected async onInit(): Promise<void> {
71
78
  await super.onInit();
72
- const model = this.model as ITextArea;
79
+ const model = this.model;
73
80
  if (model.appDEACModeId) {
74
81
  // 1.自填模式
75
82
  this.deACMode = await getDeACMode(
@@ -86,15 +93,20 @@ export class EmbedAIChatEditorController extends EditorController<ITextBox> {
86
93
  }
87
94
  }
88
95
  }
89
- // 3.创建聊天框实例
90
- const module = await import('@ibiz-template-plugin/ai-chat');
91
- if (module && module.createFlatChat) {
92
- this.chatInstance = module.createFlatChat();
93
- } else if (module && module.default && module.default.createFlatChat) {
94
- this.chatInstance = module.default.createFlatChat();
95
- }
96
- const { issimple } = this.editorParams;
96
+ const { issimple, share } = this.editorParams;
97
97
  if (issimple) this.isSimple = issimple === 'true';
98
+ this.isShare = share === 'true';
99
+ // 3. 创建聊天框实例
100
+ const module = await import('@ibiz-template-plugin/ai-chat');
101
+ if (!module) return;
102
+
103
+ // 统一获取工厂函数(兼容 default 导出)
104
+ const factory = module.default ?? module;
105
+ const createChat = this.isShare
106
+ ? factory.createReadonlyChat
107
+ : factory.createFlatChat;
108
+
109
+ if (createChat) this.chatInstance = createChat();
98
110
  }
99
111
 
100
112
  /**
@@ -110,59 +110,59 @@ export const IBizTransferPicker = defineComponent({
110
110
  // 子类样式透传
111
111
  const childStyle = [
112
112
  {
113
- class: semanticStyle('editor.content'),
113
+ style: semanticStyle('editor.content'),
114
114
  selector: `.ibiz-transfer`,
115
115
  },
116
116
  {
117
- class: semanticStyle('editor.section'),
117
+ style: semanticStyle('editor.section'),
118
118
  selector: `.ibiz-transfer-panel`,
119
119
  },
120
120
  {
121
- class: semanticStyle('editor.actions'),
121
+ style: semanticStyle('editor.actions'),
122
122
  selector: '.ibiz-transfer__buttons',
123
123
  },
124
124
  {
125
- class: semanticStyle('editor.actions.item'),
125
+ style: semanticStyle('editor.actions.item'),
126
126
  selector: '.ibiz-transfer__button',
127
127
  },
128
128
  {
129
- class: semanticStyle('editor.header'),
129
+ style: semanticStyle('editor.header'),
130
130
  selector: `.ibiz-transfer-panel__header`,
131
131
  },
132
132
  {
133
- class: semanticStyle('editor.title'),
133
+ style: semanticStyle('editor.title'),
134
134
  selector: `.ibiz-transfer-panel__header--title`,
135
135
  },
136
136
  {
137
- class: semanticStyle('editor.count'),
137
+ style: semanticStyle('editor.count'),
138
138
  selector: `.ibiz-transfer-panel__header--count`,
139
139
  },
140
140
  {
141
- class: semanticStyle('editor.body'),
141
+ style: semanticStyle('editor.body'),
142
142
  selector: '.ibiz-transfer-panel__body',
143
143
  },
144
144
  {
145
- class: semanticStyle('editor.search'),
145
+ style: semanticStyle('editor.search'),
146
146
  selector: '.el-input__inner',
147
147
  },
148
148
  {
149
- class: semanticStyle('editor.search.prefix'),
149
+ style: semanticStyle('editor.search.prefix'),
150
150
  selector: '.el-input__prefix',
151
151
  },
152
152
  {
153
- class: semanticStyle('editor.list'),
153
+ style: semanticStyle('editor.list'),
154
154
  selector: '.ibiz-transfer-panel__list',
155
155
  },
156
156
  {
157
- class: semanticStyle('editor.item'),
157
+ style: semanticStyle('editor.item'),
158
158
  selector: '.ibiz-transfer-panel__item',
159
159
  },
160
160
  {
161
- class: semanticStyle('editor.item.checkbox'),
161
+ style: semanticStyle('editor.item.checkbox'),
162
162
  selector: '.ibiz-transfer-panel__item .el-checkbox__inner',
163
163
  },
164
164
  {
165
- class: semanticStyle('editor.item.label'),
165
+ style: semanticStyle('editor.item.label'),
166
166
  selector: '.ibiz-transfer-panel__item .el-checkbox__label',
167
167
  },
168
168
  ];
@@ -634,38 +634,45 @@ export const IBizDropdown = defineComponent({
634
634
  }
635
635
  });
636
636
 
637
+ /**
638
+ * @description 获取项样式
639
+ * @param {IData} [item]
640
+ * @returns {*} {Record<string, string>}
641
+ */
642
+ const getItemStyle = (item?: IData): Record<string, string> => {
643
+ const isRound = c.editorParams.type === 'round';
644
+ return ns.cssVarBlock({
645
+ 'select-option-item-color': isRound
646
+ ? item?.color || `var(${ns.cssVarName('color-primary-text')})`
647
+ : item?.color,
648
+ 'select-option-item-bkcolor': isRound
649
+ ? item?.bkcolor || `var(${ns.cssVarName('color-primary')})`
650
+ : item?.bkcolor,
651
+ 'select-option-item-padding': isRound
652
+ ? `0 var(${ns.cssVarName('spacing-base')})`
653
+ : '',
654
+ });
655
+ };
656
+
637
657
  const prefix: { prefix?: () => JSX.Element[] | undefined } = {};
638
658
  if (c.editorParams.type === 'round') {
639
659
  Object.assign(prefix, {
640
660
  prefix: () => {
641
- return valueText.value.split(valueSeparator).map(text => {
642
- const codeListItem = getCodeListItem(text);
643
- return (
644
- <div
645
- class={[ns.b('select-option-text'), codeListItem?.textCls]}
646
- style={
647
- codeListItem?.color || codeListItem?.bkcolor
648
- ? ns.cssVarBlock({
649
- 'select-option-item-color': `${
650
- codeListItem.color || ''
651
- }`,
652
- 'select-option-item-bkcolor': `${
653
- codeListItem.bkcolor || ''
654
- }`,
655
- 'select-option-item-padding': `0 var(${ns.cssVarName(
656
- 'spacing-base',
657
- )})`,
658
- })
659
- : ''
660
- }
661
- >
662
- {codeListItem?.sysImage && (
663
- <iBizIcon icon={codeListItem?.sysImage}></iBizIcon>
664
- )}
665
- {text || ''}
666
- </div>
667
- );
668
- });
661
+ if (valueText.value)
662
+ return valueText.value.split(valueSeparator).map(text => {
663
+ const codeListItem = getCodeListItem(text);
664
+ return (
665
+ <div
666
+ class={[ns.b('select-option-text'), codeListItem?.textCls]}
667
+ style={getItemStyle(codeListItem)}
668
+ >
669
+ {codeListItem?.sysImage && (
670
+ <iBizIcon icon={codeListItem?.sysImage}></iBizIcon>
671
+ )}
672
+ {text}
673
+ </div>
674
+ );
675
+ });
669
676
  },
670
677
  });
671
678
  }
@@ -692,6 +699,7 @@ export const IBizDropdown = defineComponent({
692
699
  onFocus,
693
700
  setEditable,
694
701
  handleKeyUp,
702
+ getItemStyle,
695
703
  getCodeListItem,
696
704
  onVisibleChange,
697
705
  customNodeClass,
@@ -817,11 +825,9 @@ export const IBizDropdown = defineComponent({
817
825
  label={item.text}
818
826
  disabled={item.disableSelect === true}
819
827
  style={[
820
- item.bkcolor
821
- ? this.ns.cssVarBlock({
822
- 'select-option-item-bkcolor': `${item.bkcolor}`,
823
- })
824
- : '',
828
+ this.ns.cssVarBlock({
829
+ 'select-option-item-bkcolor': item.bkcolor,
830
+ }),
825
831
  this.semanticStyle('editor.popup.item', { item }),
826
832
  ]}
827
833
  class={[
@@ -841,13 +847,7 @@ export const IBizDropdown = defineComponent({
841
847
  this.ns.b('select-option-content'),
842
848
  item.textCls ? item.textCls : null,
843
849
  ]}
844
- style={
845
- item.color
846
- ? this.ns.cssVarBlock({
847
- 'select-option-item-color': `${item.color}`,
848
- })
849
- : ''
850
- }
850
+ style={this.getItemStyle(item)}
851
851
  >
852
852
  {item.sysImage && (
853
853
  <iBizIcon
@@ -891,17 +891,7 @@ export const IBizDropdown = defineComponent({
891
891
  this.semanticClass('editor.item', { item: codeListItem }),
892
892
  ]}
893
893
  style={[
894
- codeListItem?.color || codeListItem?.bkcolor
895
- ? this.ns.cssVarBlock({
896
- 'readonly-text-item-color': `${codeListItem.color || ''}`,
897
- 'select-option-item-color': `${codeListItem.color || ''}`,
898
- 'select-option-item-bkcolor': `${
899
- (this.c.editorParams.type === 'round'
900
- ? codeListItem.bkcolor
901
- : '') || ''
902
- }`,
903
- })
904
- : '',
894
+ this.getItemStyle(codeListItem),
905
895
  this.semanticStyle('editor.item', { item: codeListItem }),
906
896
  ]}
907
897
  v-child-class={this.getItemChildClass({ item: codeListItem })}
@@ -948,18 +938,7 @@ export const IBizDropdown = defineComponent({
948
938
  this.semanticClass('editor.item', { item: codeListItem }),
949
939
  ]}
950
940
  style={[
951
- codeListItem?.color || codeListItem?.bkcolor
952
- ? this.ns.cssVarBlock({
953
- 'select-option-item-color': `${
954
- codeListItem.color || ''
955
- }`,
956
- 'select-option-item-bkcolor': `${
957
- (this.c.editorParams.type === 'round'
958
- ? codeListItem.bkcolor
959
- : '') || ''
960
- }`,
961
- })
962
- : '',
941
+ this.getItemStyle(codeListItem),
963
942
  this.semanticStyle('editor.item', { item: codeListItem }),
964
943
  ]}
965
944
  v-child-class={this.getItemChildClass({ item: codeListItem })}
@@ -481,6 +481,21 @@ export class AIChatUtil implements IApiAIChatUtil {
481
481
  });
482
482
  return result;
483
483
  };
484
+ topicOptions.shareTopic = async (realID: string) => {
485
+ if (!ibiz.config.common.aiSessionShareUIActionTag) return;
486
+ await UIActionUtil.execAndResolved(
487
+ ibiz.config.common.aiSessionShareUIActionTag,
488
+ {
489
+ context,
490
+ params,
491
+ data: [{ id: realID }],
492
+ view: args.view,
493
+ ctrl: args.ctrl,
494
+ },
495
+ context.srfappid,
496
+ );
497
+ return true;
498
+ };
484
499
  topicOptions.action = async (
485
500
  action: string,
486
501
  context: IContext,
@@ -1442,6 +1457,21 @@ export class AIChatUtil implements IApiAIChatUtil {
1442
1457
  });
1443
1458
  return result;
1444
1459
  };
1460
+ topicOptions.shareTopic = async (realID: string) => {
1461
+ if (!ibiz.config.common.aiSessionShareUIActionTag) return;
1462
+ await UIActionUtil.execAndResolved(
1463
+ ibiz.config.common.aiSessionShareUIActionTag,
1464
+ {
1465
+ context,
1466
+ params,
1467
+ data: [{ id: realID }],
1468
+ view: args.view,
1469
+ ctrl: args.ctrl,
1470
+ },
1471
+ context.srfappid,
1472
+ );
1473
+ return true;
1474
+ };
1445
1475
  topicOptions.action = async (
1446
1476
  action: string,
1447
1477
  context: IContext,
@@ -2663,6 +2693,19 @@ export class AIChatUtil implements IApiAIChatUtil {
2663
2693
  );
2664
2694
  return result;
2665
2695
  };
2696
+ // 拷贝会话
2697
+ resourceOptions.copySession = async (
2698
+ realID: string,
2699
+ data: IData,
2700
+ ): Promise<IData> => {
2701
+ const result = await utilService.copySession(
2702
+ context,
2703
+ params,
2704
+ realID,
2705
+ data,
2706
+ );
2707
+ return result;
2708
+ };
2666
2709
  return resourceOptions;
2667
2710
  }
2668
2711
 
@@ -11,6 +11,14 @@ import { ElMessageBox } from 'element-plus';
11
11
  * @implements {IModalUtil}
12
12
  */
13
13
  export class ModalUtil implements IModalUtil {
14
+ async default(params: ModalParams): Promise<void> {
15
+ await ElMessageBox({
16
+ message: params.desc,
17
+ ...params,
18
+ ...params.options,
19
+ });
20
+ }
21
+
14
22
  async info(params: ModalParams): Promise<void> {
15
23
  await ElMessageBox.alert(params.desc, params.title, {
16
24
  ...params.options,