@ibiz-template/runtime 0.7.41-alpha.158 → 0.7.41-alpha.160
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.
- package/dist/index.esm.js +79 -10
- package/dist/index.system.min.js +1 -1
- package/out/config/global-config.d.ts.map +1 -1
- package/out/config/global-config.js +2 -0
- package/out/controller/common/control/md-control.controller.d.ts +7 -0
- package/out/controller/common/control/md-control.controller.d.ts.map +1 -1
- package/out/controller/common/control/md-control.controller.js +24 -7
- package/out/controller/control/data-view/data-view.controller.d.ts.map +1 -1
- package/out/controller/control/data-view/data-view.controller.js +4 -2
- package/out/controller/control/grid/grid/grid.controller.d.ts.map +1 -1
- package/out/controller/control/grid/grid/grid.controller.js +2 -0
- package/out/controller/control/list/list.controller.d.ts.map +1 -1
- package/out/controller/control/list/list.controller.js +4 -2
- package/out/interface/api/common/global-config/i-api-global-common-config.d.ts +17 -4
- package/out/interface/api/common/global-config/i-api-global-common-config.d.ts.map +1 -1
- package/out/interface/api/common/i-api-export-params.d.ts +5 -4
- package/out/interface/api/common/i-api-export-params.d.ts.map +1 -1
- package/out/interface/api/controller/control/i-api-drbar.controller.d.ts +1 -1
- package/out/interface/api/controller/control/i-api-drtab.controller.d.ts +1 -1
- package/out/interface/api/state/common/i-api-button-container.state.d.ts +2 -2
- package/out/interface/api/state/common/i-api-button-container.state.d.ts.map +1 -1
- package/out/interface/api/state/common/i-api-button.state.d.ts +2 -2
- package/out/interface/api/state/common/i-api-button.state.d.ts.map +1 -1
- package/out/interface/api/util/i-api-modal-util.d.ts +7 -0
- package/out/interface/api/util/i-api-modal-util.d.ts.map +1 -1
- package/out/service/service/util/ai-util.service.d.ts +11 -0
- package/out/service/service/util/ai-util.service.d.ts.map +1 -1
- package/out/service/service/util/ai-util.service.js +26 -0
- package/package.json +2 -2
- package/src/config/global-config.ts +2 -0
- package/src/controller/common/control/md-control.controller.ts +34 -7
- package/src/controller/control/data-view/data-view.controller.ts +6 -2
- package/src/controller/control/grid/grid/grid.controller.ts +2 -0
- package/src/controller/control/list/list.controller.ts +6 -2
- package/src/interface/api/common/global-config/i-api-global-common-config.ts +19 -4
- package/src/interface/api/common/i-api-export-params.ts +6 -4
- package/src/interface/api/controller/control/i-api-drbar.controller.ts +1 -1
- package/src/interface/api/controller/control/i-api-drtab.controller.ts +1 -1
- package/src/interface/api/state/common/i-api-button-container.state.ts +2 -2
- package/src/interface/api/state/common/i-api-button.state.ts +2 -2
- package/src/interface/api/util/i-api-modal-util.ts +7 -0
- package/src/service/service/util/ai-util.service.ts +41 -0
|
@@ -143,6 +143,24 @@ export class MDControlController<
|
|
|
143
143
|
return 'default';
|
|
144
144
|
}
|
|
145
145
|
|
|
146
|
+
/**
|
|
147
|
+
* @description 忽略排序缓存
|
|
148
|
+
* @readonly
|
|
149
|
+
* @type {boolean}
|
|
150
|
+
* @memberof MDControlController
|
|
151
|
+
*/
|
|
152
|
+
get ignoreSortCache(): boolean {
|
|
153
|
+
if (this.controlParams.ignoresortcache)
|
|
154
|
+
return (
|
|
155
|
+
this.controlParams.ignoresortcache === 'true' ||
|
|
156
|
+
this.controlParams.ignoresortcache === true
|
|
157
|
+
);
|
|
158
|
+
return (
|
|
159
|
+
ibiz.config.common.ignoreSortCache?.includes(this.model.controlType!) ??
|
|
160
|
+
false
|
|
161
|
+
);
|
|
162
|
+
}
|
|
163
|
+
|
|
146
164
|
protected get _evt(): ControllerEvent<IMDControlEvent> {
|
|
147
165
|
return this.evt;
|
|
148
166
|
}
|
|
@@ -357,6 +375,7 @@ export class MDControlController<
|
|
|
357
375
|
// 设置默认排序(localStorage的优先级高于配置)
|
|
358
376
|
const { minorSortAppDEFieldId, minorSortDir } = this.getSortModel();
|
|
359
377
|
if (
|
|
378
|
+
!this.ignoreSortCache &&
|
|
360
379
|
this.view &&
|
|
361
380
|
localStorage.getItem(`${this.view.model.id}.${this.model.name}.sort`)
|
|
362
381
|
) {
|
|
@@ -376,7 +395,7 @@ export class MDControlController<
|
|
|
376
395
|
this.state.sortQuery = '';
|
|
377
396
|
}
|
|
378
397
|
// 设置后更新localStorage里的
|
|
379
|
-
if (this.view) {
|
|
398
|
+
if (!this.ignoreSortCache && this.view) {
|
|
380
399
|
if (this.state.sortQuery) {
|
|
381
400
|
localStorage.setItem(
|
|
382
401
|
`${this.view.model.id}.${this.model.name}.sort`,
|
|
@@ -823,14 +842,18 @@ export class MDControlController<
|
|
|
823
842
|
* @param {MouseEvent} event
|
|
824
843
|
*/
|
|
825
844
|
async onRowClick(_data: IData, event?: MouseEvent): Promise<void> {
|
|
826
|
-
const
|
|
827
|
-
|
|
828
|
-
|
|
829
|
-
|
|
845
|
+
const isCreate = _data.srfuf === Srfuf.CREATE;
|
|
846
|
+
const compareKey = isCreate ? 'tempsrfkey' : 'srfkey';
|
|
847
|
+
const data = this.state.items.find(
|
|
848
|
+
item => item[compareKey] === _data[compareKey],
|
|
849
|
+
);
|
|
850
|
+
if (!data) return;
|
|
830
851
|
// 选中相关处理
|
|
831
852
|
const { selectedData } = this.state;
|
|
832
853
|
// 选中里没有则添加,有则删除
|
|
833
|
-
const filterArr = selectedData.filter(
|
|
854
|
+
const filterArr = selectedData.filter(
|
|
855
|
+
item => item[compareKey] !== data[compareKey],
|
|
856
|
+
);
|
|
834
857
|
if (filterArr.length === selectedData.length) {
|
|
835
858
|
this.setSelection(
|
|
836
859
|
this.state.singleSelect ? [data] : selectedData.concat([data]),
|
|
@@ -854,7 +877,11 @@ export class MDControlController<
|
|
|
854
877
|
* @param {IData} data 选中的单条数据
|
|
855
878
|
*/
|
|
856
879
|
async onDbRowClick(_data: IData): Promise<void> {
|
|
857
|
-
const
|
|
880
|
+
const isCreate = _data.srfuf === Srfuf.CREATE;
|
|
881
|
+
const compareKey = isCreate ? 'tempsrfkey' : 'srfkey';
|
|
882
|
+
const data = this.state.items.find(
|
|
883
|
+
item => item[compareKey] === _data[compareKey],
|
|
884
|
+
);
|
|
858
885
|
if (this.state.mdctrlActiveMode === 2 && data) {
|
|
859
886
|
await this.setActive(data);
|
|
860
887
|
}
|
|
@@ -23,7 +23,7 @@ import {
|
|
|
23
23
|
IDataViewControlEvent,
|
|
24
24
|
IDataViewControlController,
|
|
25
25
|
} from '../../../interface';
|
|
26
|
-
import { ControlVO } from '../../../service';
|
|
26
|
+
import { ControlVO, Srfuf } from '../../../service';
|
|
27
27
|
import { UIActionUtil } from '../../../ui-action';
|
|
28
28
|
import { MDControlController } from '../../common';
|
|
29
29
|
import {
|
|
@@ -282,7 +282,11 @@ export class DataViewControlController<
|
|
|
282
282
|
* @param {IData} _data 选中的单条数据
|
|
283
283
|
*/
|
|
284
284
|
async onRowClick(_data: IData): Promise<void> {
|
|
285
|
-
const
|
|
285
|
+
const isCreate = _data.srfuf === Srfuf.CREATE;
|
|
286
|
+
const compareKey = isCreate ? 'tempsrfkey' : 'srfkey';
|
|
287
|
+
const data = this.state.items.find(
|
|
288
|
+
item => item[compareKey] === _data[compareKey],
|
|
289
|
+
);
|
|
286
290
|
if (!data) return;
|
|
287
291
|
super.onRowClick(data);
|
|
288
292
|
const { groupAppDEFieldId } = this.model;
|
|
@@ -940,6 +940,7 @@ export class GridController<
|
|
|
940
940
|
// 删除this.state.rows里的表格行数据
|
|
941
941
|
const index = this.findRowStateIndex(data);
|
|
942
942
|
this.state.rows.splice(index, 1);
|
|
943
|
+
this.rowStateIndexMap.clear();
|
|
943
944
|
|
|
944
945
|
// 删除分组里的那条数据
|
|
945
946
|
this.state.groups.forEach(item => {
|
|
@@ -1006,6 +1007,7 @@ export class GridController<
|
|
|
1006
1007
|
this.state.items.unshift(draftData);
|
|
1007
1008
|
const newRow = new GridRowState(draftData, this);
|
|
1008
1009
|
this.state.rows.unshift(newRow);
|
|
1010
|
+
this.rowStateIndexMap.clear();
|
|
1009
1011
|
this.gridStateNotify(newRow, GridNotifyState.DRAFT);
|
|
1010
1012
|
|
|
1011
1013
|
if (this.editShowMode === 'row') {
|
|
@@ -33,7 +33,7 @@ import {
|
|
|
33
33
|
getAllUIActionItems,
|
|
34
34
|
getParentTextAppDEFieldId,
|
|
35
35
|
} from '../../../model';
|
|
36
|
-
import { ControlVO } from '../../../service';
|
|
36
|
+
import { ControlVO, Srfuf } from '../../../service';
|
|
37
37
|
import { formatDateByScale } from '../../../utils';
|
|
38
38
|
|
|
39
39
|
export class ListController
|
|
@@ -867,7 +867,11 @@ export class ListController
|
|
|
867
867
|
* @memberof ListController
|
|
868
868
|
*/
|
|
869
869
|
async onRowClick(_data: IData): Promise<void> {
|
|
870
|
-
const
|
|
870
|
+
const isCreate = _data.srfuf === Srfuf.CREATE;
|
|
871
|
+
const compareKey = isCreate ? 'tempsrfkey' : 'srfkey';
|
|
872
|
+
const data = this.state.items.find(
|
|
873
|
+
item => item[compareKey] === _data[compareKey],
|
|
874
|
+
);
|
|
871
875
|
if (!data) return;
|
|
872
876
|
super.onRowClick(data);
|
|
873
877
|
const { groupAppDEFieldId } = this.model;
|
|
@@ -337,6 +337,7 @@ export interface IApiGlobalCommonConfig {
|
|
|
337
337
|
/**
|
|
338
338
|
* @description AI输入框空白占位
|
|
339
339
|
* @type {string}
|
|
340
|
+
* @platform web
|
|
340
341
|
* @memberof IApiGlobalCommonConfig
|
|
341
342
|
*/
|
|
342
343
|
aiInputPlaceholder: string;
|
|
@@ -362,7 +363,6 @@ export interface IApiGlobalCommonConfig {
|
|
|
362
363
|
* @description AI会话消息分页数量
|
|
363
364
|
* @default 100
|
|
364
365
|
* @platform web
|
|
365
|
-
* @platform mob
|
|
366
366
|
* @type {number}
|
|
367
367
|
* @memberof IApiGlobalCommonConfig
|
|
368
368
|
*/
|
|
@@ -372,7 +372,6 @@ export interface IApiGlobalCommonConfig {
|
|
|
372
372
|
* @description AI聊天框工作模式,默认值,会话数据以列表显示; WORKSPACE:工作区,会话数据分为域(scope)、会话分组分层显示
|
|
373
373
|
* @default DEFAULT
|
|
374
374
|
* @platform web
|
|
375
|
-
* @platform mob
|
|
376
375
|
* @type {('DEFAULT' | 'WORKSPACE')}
|
|
377
376
|
* @memberof IApiGlobalCommonConfig
|
|
378
377
|
*/
|
|
@@ -381,7 +380,6 @@ export interface IApiGlobalCommonConfig {
|
|
|
381
380
|
/**
|
|
382
381
|
* @description AI聊天框工作模式为WORKSPACE时,域列表代码表ID
|
|
383
382
|
* @platform web
|
|
384
|
-
* @platform mob
|
|
385
383
|
* @type {string}
|
|
386
384
|
* @memberof IApiGlobalCommonConfig
|
|
387
385
|
*/
|
|
@@ -391,7 +389,6 @@ export interface IApiGlobalCommonConfig {
|
|
|
391
389
|
* @description AI聊天框工作模式为WORKSPACE时,是否禁用域选择,默认值为false
|
|
392
390
|
* @default false
|
|
393
391
|
* @platform web
|
|
394
|
-
* @platform mob
|
|
395
392
|
* @type {string}
|
|
396
393
|
* @memberof IApiGlobalCommonConfig
|
|
397
394
|
*/
|
|
@@ -445,7 +442,25 @@ export interface IApiGlobalCommonConfig {
|
|
|
445
442
|
/**
|
|
446
443
|
* @description AI知识库视图
|
|
447
444
|
* @type {(string | undefined)}
|
|
445
|
+
* @platform web
|
|
448
446
|
* @memberof IApiGlobalCommonConfig
|
|
449
447
|
*/
|
|
450
448
|
aiKnowledgeBaseView: string | undefined;
|
|
449
|
+
|
|
450
|
+
/**
|
|
451
|
+
* @description 忽略排序缓存配置,值使用部件类型,多个以 : 分隔(如:GRID:LIST:),需以 : 结尾
|
|
452
|
+
* @type {(string | undefined)}
|
|
453
|
+
* @platform web
|
|
454
|
+
* @platform mob
|
|
455
|
+
* @memberof IApiGlobalCommonConfig
|
|
456
|
+
*/
|
|
457
|
+
ignoreSortCache: string | undefined;
|
|
458
|
+
|
|
459
|
+
/**
|
|
460
|
+
* @description AI分享会话界面行为标记,用于指定ai分享会话执行界面行为
|
|
461
|
+
* @type {(string | undefined)}
|
|
462
|
+
* @platform web
|
|
463
|
+
* @memberof IApiGlobalCommonConfig
|
|
464
|
+
*/
|
|
465
|
+
aiSessionShareUIActionTag: string | undefined;
|
|
451
466
|
}
|
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
import { IApiData } from '@ibiz-template/core';
|
|
2
|
+
|
|
1
3
|
/**
|
|
2
4
|
* @description 导出参数
|
|
3
5
|
* @export
|
|
@@ -41,10 +43,10 @@ export interface IApiExportParams {
|
|
|
41
43
|
|
|
42
44
|
/**
|
|
43
45
|
* @description 自定义导出模型对象
|
|
44
|
-
* @type {
|
|
46
|
+
* @type {IApiData}
|
|
45
47
|
* @memberof IApiExportParams
|
|
46
48
|
*/
|
|
47
|
-
srfdataexport?:
|
|
49
|
+
srfdataexport?: IApiData;
|
|
48
50
|
|
|
49
51
|
/**
|
|
50
52
|
* @description 自定义导出数据类型
|
|
@@ -55,8 +57,8 @@ export interface IApiExportParams {
|
|
|
55
57
|
|
|
56
58
|
/**
|
|
57
59
|
* @description 自定义导出参数
|
|
58
|
-
* @type {
|
|
60
|
+
* @type {IApiData}
|
|
59
61
|
* @memberof IApiExportParams
|
|
60
62
|
*/
|
|
61
|
-
srfexportparams?:
|
|
63
|
+
srfexportparams?: IApiData;
|
|
62
64
|
}
|
|
@@ -11,7 +11,7 @@ import { IApiControlController } from './i-api-control.controller';
|
|
|
11
11
|
* @interface IDRBarController
|
|
12
12
|
* @extends {IApiControlController<T, S>}
|
|
13
13
|
* @ctrlparams {name:singleitemgroup,title:单项分组模式,parameterType:boolean,defaultvalue:false,description:当关系界面分组对应的菜单分组只有一个分组项时,该值为true则显示菜单分组,否则不显示菜单分组,effectPlatform:web}
|
|
14
|
-
* @ctrlparams {name:cacheitems,title
|
|
14
|
+
* @ctrlparams {"name":"cacheitems","title":"设置开启缓存的分页项","parameterType":"string","defaultvalue":"","description":"多个以,分割,适配部分需要缓存,部分无需缓存的场景","effectPlatform":"web"}
|
|
15
15
|
* @template T
|
|
16
16
|
* @template S
|
|
17
17
|
*/
|
|
@@ -17,7 +17,7 @@ import { IApiControlController } from './i-api-control.controller';
|
|
|
17
17
|
* @ctrlparams {name:navbarpos,title:导航栏位置,parameterType:string,defaultvalue:'TOPRIGHT',description:当enablenavbar=true时启用,用于决定导航栏的位置,默认位置在drtab整体的右上角,所有可选值为TOPLEFT:左上角,MIDDLELEFT:左侧中间,BOTTOMLEFT:左下角,TOPRIGHT:右上角,MIDDLERIGHT:右侧中间,BOTTOMRIGHT:右下角,effectPlatform:web}
|
|
18
18
|
* @ctrlparams {name:navbarwidth,title:导航栏宽度,parameterType:number,defaultvalue:200,description:当enablenavbar=true时启用,用于设置导航栏的占位宽度,默认是200px,effectPlatform:web}
|
|
19
19
|
* @ctrlparams {name:enablecollapse,title:启用折叠,parameterType:boolean,defaultvalue:false,description:enablecollapse=true时启用,用于流式布局开启折叠项功能,effectPlatform:web}
|
|
20
|
-
* @ctrlparams {name:cacheitems,title
|
|
20
|
+
* @ctrlparams {"name":"cacheitems","title":"设置开启缓存的分页项","parameterType":"string","defaultvalue":"","description":"多个以,分割,适配部分需要缓存,部分无需缓存的场景","effectPlatform":"web"}
|
|
21
21
|
* @template T
|
|
22
22
|
* @template S
|
|
23
23
|
*/
|
|
@@ -34,7 +34,7 @@ export interface IApiButtonContainerState {
|
|
|
34
34
|
* @param {IApiContext} context 上下文
|
|
35
35
|
* @param {IApiData} [data] 实体数据
|
|
36
36
|
* @param {string} [appDeId] 实体标识
|
|
37
|
-
* @param {
|
|
37
|
+
* @param {IApiData[]} [selections] 选中数据集合
|
|
38
38
|
* @returns {*} {Promise<void>}
|
|
39
39
|
* @memberof IApiButtonContainerState
|
|
40
40
|
*/
|
|
@@ -42,7 +42,7 @@ export interface IApiButtonContainerState {
|
|
|
42
42
|
context: IApiContext,
|
|
43
43
|
data?: IApiData,
|
|
44
44
|
appDeId?: string,
|
|
45
|
-
selections?:
|
|
45
|
+
selections?: IApiData[],
|
|
46
46
|
): Promise<void>;
|
|
47
47
|
|
|
48
48
|
[p: string]: any;
|
|
@@ -41,7 +41,7 @@ export interface IApiButtonState {
|
|
|
41
41
|
* @param {IApiContext} context 上下文
|
|
42
42
|
* @param {IApiData} [data] 实体数据
|
|
43
43
|
* @param {string} [appDeId] 实体标识
|
|
44
|
-
* @param {
|
|
44
|
+
* @param {IApiData[]} [selections] 选中数据集合
|
|
45
45
|
* @returns {*} {Promise<void>}
|
|
46
46
|
* @memberof IApiButtonState
|
|
47
47
|
*/
|
|
@@ -49,6 +49,6 @@ export interface IApiButtonState {
|
|
|
49
49
|
context: IApiContext,
|
|
50
50
|
data?: IApiData,
|
|
51
51
|
appDeId?: string,
|
|
52
|
-
selections?:
|
|
52
|
+
selections?: IApiData[],
|
|
53
53
|
): Promise<void>;
|
|
54
54
|
}
|
|
@@ -67,6 +67,13 @@ export interface IApiModalParams {
|
|
|
67
67
|
* @interface IApiModalUtil
|
|
68
68
|
*/
|
|
69
69
|
export interface IApiModalUtil {
|
|
70
|
+
/**
|
|
71
|
+
* @description 显示默认提示对话框,通常用于自定义对话框
|
|
72
|
+
* @param {IApiModalParams} params
|
|
73
|
+
* @returns {*} {Promise<void>}
|
|
74
|
+
* @memberof IApiModalUtil
|
|
75
|
+
*/
|
|
76
|
+
default(params: IApiModalParams): Promise<void>;
|
|
70
77
|
/**
|
|
71
78
|
* @description 显示普通信息提示对话框,通常用于展示说明性内容
|
|
72
79
|
* @param {IApiModalParams} params 确认框参数
|
|
@@ -23,6 +23,7 @@ export type IUtilParam = {
|
|
|
23
23
|
clearAllMessageSessionAppDEActionId: string | undefined;
|
|
24
24
|
sessionmodelMapping: IData | undefined;
|
|
25
25
|
messagemodelMapping: IData | undefined;
|
|
26
|
+
copySessionAppDEActionId: string | undefined;
|
|
26
27
|
};
|
|
27
28
|
|
|
28
29
|
/**
|
|
@@ -665,4 +666,44 @@ export class AIUtilService {
|
|
|
665
666
|
);
|
|
666
667
|
return true;
|
|
667
668
|
}
|
|
669
|
+
|
|
670
|
+
/**
|
|
671
|
+
* @description 拷贝会话
|
|
672
|
+
* @param {IContext} context
|
|
673
|
+
* @param {IParams} params
|
|
674
|
+
* @param {string} realID
|
|
675
|
+
* @param {IData} data
|
|
676
|
+
* @returns {*} {Promise<IData>}
|
|
677
|
+
* @memberof AIUtilService
|
|
678
|
+
*/
|
|
679
|
+
async copySession(
|
|
680
|
+
context: IContext,
|
|
681
|
+
params: IParams,
|
|
682
|
+
realID: string,
|
|
683
|
+
data: IData,
|
|
684
|
+
): Promise<IData> {
|
|
685
|
+
const copySessionAppDEActionId = this.utilParams?.copySessionAppDEActionId;
|
|
686
|
+
if (!copySessionAppDEActionId)
|
|
687
|
+
throw new RuntimeError('copySessionAppDEActionId is null');
|
|
688
|
+
if (!data || Object.keys(data).length === 0)
|
|
689
|
+
throw new RuntimeError('data is null');
|
|
690
|
+
const sessionService = await this.getSessionService(context);
|
|
691
|
+
if (!sessionService) throw new RuntimeError('sessionService is null');
|
|
692
|
+
const tempContext = context.clone();
|
|
693
|
+
tempContext[this.sessionAppEntityName!.toLowerCase()] = realID;
|
|
694
|
+
const tempData = this.handleUserRequestData(data, 'sessionmodelMapping');
|
|
695
|
+
const response = await sessionService.exec(
|
|
696
|
+
copySessionAppDEActionId,
|
|
697
|
+
tempContext,
|
|
698
|
+
{ ...tempData },
|
|
699
|
+
{
|
|
700
|
+
...params,
|
|
701
|
+
},
|
|
702
|
+
);
|
|
703
|
+
const result = this.handleUserResponse(
|
|
704
|
+
response,
|
|
705
|
+
'sessionmodelMapping',
|
|
706
|
+
) as IData[];
|
|
707
|
+
return result;
|
|
708
|
+
}
|
|
668
709
|
}
|