@ibiz-template/runtime 0.7.18 → 0.7.19-alpha.1
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 +247 -66
- package/dist/index.system.min.js +1 -1
- package/out/controller/common/control/control.controller.d.ts +11 -1
- package/out/controller/common/control/control.controller.d.ts.map +1 -1
- package/out/controller/common/control/control.controller.js +32 -18
- package/out/controller/common/control/md-control.controller.d.ts.map +1 -1
- package/out/controller/common/control/md-control.controller.js +20 -11
- package/out/controller/control/form/edit-form/edit-form.controller.d.ts +7 -0
- package/out/controller/control/form/edit-form/edit-form.controller.d.ts.map +1 -1
- package/out/controller/control/form/edit-form/edit-form.controller.js +48 -10
- package/out/controller/control/gantt/gantt.controller.d.ts.map +1 -1
- package/out/controller/control/gantt/gantt.controller.js +17 -8
- package/out/controller/control/grid/grid/grid.controller.d.ts +7 -0
- package/out/controller/control/grid/grid/grid.controller.d.ts.map +1 -1
- package/out/controller/control/grid/grid/grid.controller.js +29 -0
- package/out/controller/control/search-bar/search-bar.controller.d.ts +23 -0
- package/out/controller/control/search-bar/search-bar.controller.d.ts.map +1 -1
- package/out/controller/control/search-bar/search-bar.controller.js +58 -0
- package/out/controller/utils/button-state/ui-action-button.state.d.ts +9 -0
- package/out/controller/utils/button-state/ui-action-button.state.d.ts.map +1 -1
- package/out/controller/utils/button-state/ui-action-button.state.js +5 -0
- package/out/interface/controller/controller/control/i-edit-form.controller.d.ts +14 -0
- package/out/interface/controller/controller/control/i-edit-form.controller.d.ts.map +1 -1
- package/out/interface/controller/state/control/i-grid.state.d.ts +14 -0
- package/out/interface/controller/state/control/i-grid.state.d.ts.map +1 -1
- package/out/interface/service/service/i-app-de-authority.service.d.ts +30 -0
- package/out/interface/service/service/i-app-de-authority.service.d.ts.map +1 -1
- package/out/service/service/authority/authority.service.d.ts +13 -1
- package/out/service/service/authority/authority.service.d.ts.map +1 -1
- package/out/service/service/authority/authority.service.js +39 -1
- package/out/service/service/authority/de-authority.service.d.ts +5 -5
- package/out/service/service/authority/de-authority.service.d.ts.map +1 -1
- package/out/service/service/authority/de-authority.service.js +5 -9
- package/out/service/utils/app-counter/app-counter.js +1 -1
- package/out/service/utils/dynamic-code-list/dynamic-code-list.d.ts.map +1 -1
- package/out/service/utils/dynamic-code-list/dynamic-code-list.js +1 -1
- package/package.json +4 -4
package/dist/index.esm.js
CHANGED
|
@@ -8364,7 +8364,7 @@ var AppCounter = class {
|
|
|
8364
8364
|
if (this.evt.getSize("change") > 0) {
|
|
8365
8365
|
this.load();
|
|
8366
8366
|
}
|
|
8367
|
-
}, this.model.timer ||
|
|
8367
|
+
}, this.model.timer || 6e4);
|
|
8368
8368
|
}
|
|
8369
8369
|
/**
|
|
8370
8370
|
* 销毁定时器自动刷新
|
|
@@ -8666,7 +8666,7 @@ var DynamicCodeListCache = class {
|
|
|
8666
8666
|
* @date 2024-04-15 17:08:06
|
|
8667
8667
|
* @type {Promise<void>}
|
|
8668
8668
|
*/
|
|
8669
|
-
this.commonKeys = ["query", "queryconds"];
|
|
8669
|
+
this.commonKeys = ["query", "queryconds", "searchconds"];
|
|
8670
8670
|
this.codeList = codeList;
|
|
8671
8671
|
if (this.codeList.enableCache) {
|
|
8672
8672
|
this.codelistChange = this.codelistChange.bind(this);
|
|
@@ -11763,8 +11763,8 @@ var DeAuthorityService = class {
|
|
|
11763
11763
|
*
|
|
11764
11764
|
* 0:无控制 不计算实体数据权限
|
|
11765
11765
|
* 1:自控制 根据实体数据中的权限标识计算
|
|
11766
|
-
* 2:附属主实体控制
|
|
11767
|
-
* 3
|
|
11766
|
+
* 2:附属主实体控制 先从自身权限标识数据查找,若未找到,再从父权限标识数据查找
|
|
11767
|
+
* 3:附属主实体控制(未映射自控)先从自身权限标识数据查找,若未找到,再从父权限标识数据查找
|
|
11768
11768
|
* @param {string} dataAccessAction 操作标识
|
|
11769
11769
|
* @param {IData} data 实体数据
|
|
11770
11770
|
* @param {IContext} context 上下文
|
|
@@ -11779,19 +11779,13 @@ var DeAuthorityService = class {
|
|
|
11779
11779
|
tempDataAccObject = (data == null ? void 0 : data.srfdataaccaction) ? convertToObject(data.srfdataaccaction) : void 0;
|
|
11780
11780
|
break;
|
|
11781
11781
|
case 2:
|
|
11782
|
-
tempDataAccObject = convertToObject(
|
|
11783
|
-
await this.calcMajorDataAccAction(context)
|
|
11784
|
-
);
|
|
11785
|
-
break;
|
|
11786
11782
|
case 3:
|
|
11787
11783
|
tempDataAccObject = convertToObject(
|
|
11788
11784
|
await this.calcMajorDataAccAction(context)
|
|
11789
11785
|
);
|
|
11790
|
-
if (
|
|
11791
|
-
|
|
11792
|
-
|
|
11793
|
-
) && data && data.srfdataaccaction) {
|
|
11794
|
-
tempDataAccObject = convertToObject(data.srfdataaccaction);
|
|
11786
|
+
if (data && data.srfdataaccaction) {
|
|
11787
|
+
const curDataAccObject = convertToObject(data.srfdataaccaction);
|
|
11788
|
+
Object.assign(tempDataAccObject, curDataAccObject);
|
|
11795
11789
|
}
|
|
11796
11790
|
break;
|
|
11797
11791
|
default:
|
|
@@ -11966,7 +11960,38 @@ var AuthorityService = class {
|
|
|
11966
11960
|
return !this.enablePermission || this.resCodes.includes(resCode);
|
|
11967
11961
|
}
|
|
11968
11962
|
/**
|
|
11969
|
-
*
|
|
11963
|
+
* 通过操作标识计算权限(无数据)
|
|
11964
|
+
*
|
|
11965
|
+
* @author tony001
|
|
11966
|
+
* @date 2024-05-29 16:05:33
|
|
11967
|
+
* @param {string} dataAccessAction
|
|
11968
|
+
* @param {IContext} context
|
|
11969
|
+
* @param {IData} [data]
|
|
11970
|
+
* @param {string} [appDeId]
|
|
11971
|
+
* @return {*} {Promise<boolean>}
|
|
11972
|
+
*/
|
|
11973
|
+
async calcByNoDataAccessAction(dataAccessAction, context, appDeId) {
|
|
11974
|
+
const result = true;
|
|
11975
|
+
if (this.enablePermission) {
|
|
11976
|
+
const app = await ibiz.hub.getApp(this.appModel.appId);
|
|
11977
|
+
const opPriv = await app.getOPPriv(dataAccessAction, appDeId);
|
|
11978
|
+
if (this.enablePermission && (opPriv == null ? void 0 : opPriv.mapSysUniResCode) && !this.calcByResCode(opPriv.mapSysUniResCode)) {
|
|
11979
|
+
return false;
|
|
11980
|
+
}
|
|
11981
|
+
}
|
|
11982
|
+
if (appDeId) {
|
|
11983
|
+
const service = await this.getService(appDeId);
|
|
11984
|
+
const majorAccObject = convertToObject(
|
|
11985
|
+
await service.calcMajorDataAccAction(context)
|
|
11986
|
+
);
|
|
11987
|
+
if (majorAccObject && dataAccessAction && !majorAccObject[dataAccessAction]) {
|
|
11988
|
+
return false;
|
|
11989
|
+
}
|
|
11990
|
+
}
|
|
11991
|
+
return result;
|
|
11992
|
+
}
|
|
11993
|
+
/**
|
|
11994
|
+
* 通过操作标识计算权限(非无数据)
|
|
11970
11995
|
* @author lxm
|
|
11971
11996
|
* @date 2023-05-10 12:33:10
|
|
11972
11997
|
* @param {string} dataAccessAction 操作标识
|
|
@@ -15803,6 +15828,7 @@ var UIActionButtonState = class {
|
|
|
15803
15828
|
uiactionTag
|
|
15804
15829
|
} = uiAction;
|
|
15805
15830
|
this.dataAccessAction = dataAccessAction;
|
|
15831
|
+
this.actionTarget = actionTarget;
|
|
15806
15832
|
if (noPrivDisplayMode === 1) {
|
|
15807
15833
|
this.noPermissionHidden = false;
|
|
15808
15834
|
} else if (noPrivDisplayMode === 6) {
|
|
@@ -15840,6 +15866,14 @@ var UIActionButtonState = class {
|
|
|
15840
15866
|
return;
|
|
15841
15867
|
}
|
|
15842
15868
|
const app = await ibiz.hub.getApp(this.appId);
|
|
15869
|
+
if (this.actionTarget && this.actionTarget === "NONE") {
|
|
15870
|
+
this.permitted = await app.authority.calcByNoDataAccessAction(
|
|
15871
|
+
this.dataAccessAction,
|
|
15872
|
+
context,
|
|
15873
|
+
appDeId
|
|
15874
|
+
);
|
|
15875
|
+
return;
|
|
15876
|
+
}
|
|
15843
15877
|
if (this.appDeName && appDeId && !appDeId.includes(this.appDeName)) {
|
|
15844
15878
|
ibiz.log.warn(
|
|
15845
15879
|
ibiz.i18n.t(
|
|
@@ -18369,6 +18403,23 @@ var ControlController = class extends BaseController {
|
|
|
18369
18403
|
return this.getEventArgs();
|
|
18370
18404
|
};
|
|
18371
18405
|
}
|
|
18406
|
+
/**
|
|
18407
|
+
* 获取指定标识部件消息
|
|
18408
|
+
*
|
|
18409
|
+
* @author tony001
|
|
18410
|
+
* @date 2024-05-29 17:05:52
|
|
18411
|
+
* @protected
|
|
18412
|
+
* @param {string} tag
|
|
18413
|
+
* @return {*} {(ICtrlMsgItem | undefined)}
|
|
18414
|
+
*/
|
|
18415
|
+
findCtrlMsgByTag(tag) {
|
|
18416
|
+
let targetCtrlMsg;
|
|
18417
|
+
const { ctrlMsg } = this.model;
|
|
18418
|
+
if (ctrlMsg && ctrlMsg.ctrlMsgItems) {
|
|
18419
|
+
targetCtrlMsg = ctrlMsg.ctrlMsgItems.find((item) => item.name === tag);
|
|
18420
|
+
}
|
|
18421
|
+
return targetCtrlMsg;
|
|
18422
|
+
}
|
|
18372
18423
|
/**
|
|
18373
18424
|
* 执行对应部件行为消息提示
|
|
18374
18425
|
* @author lxm
|
|
@@ -18380,30 +18431,25 @@ var ControlController = class extends BaseController {
|
|
|
18380
18431
|
actionNotification(tag, opts) {
|
|
18381
18432
|
let message = "";
|
|
18382
18433
|
let duration;
|
|
18383
|
-
const
|
|
18384
|
-
if (
|
|
18385
|
-
|
|
18386
|
-
|
|
18387
|
-
|
|
18388
|
-
|
|
18389
|
-
|
|
18434
|
+
const hiddenSsgItem = this.findCtrlMsgByTag("".concat(tag, "_HIDDEN"));
|
|
18435
|
+
if (hiddenSsgItem) {
|
|
18436
|
+
return;
|
|
18437
|
+
}
|
|
18438
|
+
const msgItem = this.findCtrlMsgByTag(tag);
|
|
18439
|
+
if (msgItem && msgItem.content) {
|
|
18440
|
+
duration = isNil23(msgItem.timeout) ? void 0 : msgItem.timeout / 1e3;
|
|
18441
|
+
const scriptParams = { ...this.getEventArgs() };
|
|
18442
|
+
if (opts == null ? void 0 : opts.data) {
|
|
18443
|
+
scriptParams.data = opts.data;
|
|
18390
18444
|
}
|
|
18391
|
-
|
|
18392
|
-
|
|
18393
|
-
|
|
18394
|
-
|
|
18395
|
-
|
|
18396
|
-
|
|
18445
|
+
message = ScriptFactory.execScriptFn(
|
|
18446
|
+
scriptParams,
|
|
18447
|
+
"`".concat(msgItem.content, "`"),
|
|
18448
|
+
{
|
|
18449
|
+
isAsync: false,
|
|
18450
|
+
singleRowReturn: true
|
|
18397
18451
|
}
|
|
18398
|
-
|
|
18399
|
-
scriptParams,
|
|
18400
|
-
"`".concat(msgItem.content, "`"),
|
|
18401
|
-
{
|
|
18402
|
-
isAsync: false,
|
|
18403
|
-
singleRowReturn: true
|
|
18404
|
-
}
|
|
18405
|
-
);
|
|
18406
|
-
}
|
|
18452
|
+
);
|
|
18407
18453
|
}
|
|
18408
18454
|
if (!message && ibiz.i18n) {
|
|
18409
18455
|
const resTag = "CONTROL.".concat(this.model.controlType, ".").concat(tag).toUpperCase();
|
|
@@ -18770,12 +18816,18 @@ var MDControlController = class extends ControlController {
|
|
|
18770
18816
|
);
|
|
18771
18817
|
}
|
|
18772
18818
|
if ((args == null ? void 0 : args.silent) !== true) {
|
|
18773
|
-
|
|
18774
|
-
|
|
18775
|
-
|
|
18776
|
-
|
|
18777
|
-
|
|
18778
|
-
|
|
18819
|
+
let del = false;
|
|
18820
|
+
const hiddenSsgItem = this.findCtrlMsgByTag("BEFOREREMOVE_HIDDEN");
|
|
18821
|
+
if (hiddenSsgItem) {
|
|
18822
|
+
del = true;
|
|
18823
|
+
} else {
|
|
18824
|
+
del = await ibiz.confirm.error({
|
|
18825
|
+
title: ibiz.i18n.t("runtime.controller.common.control.dataDeletion"),
|
|
18826
|
+
desc: ibiz.i18n.t(
|
|
18827
|
+
"runtime.controller.common.control.confirmDataDeletion"
|
|
18828
|
+
)
|
|
18829
|
+
});
|
|
18830
|
+
}
|
|
18779
18831
|
if (!del) {
|
|
18780
18832
|
return;
|
|
18781
18833
|
}
|
|
@@ -18793,7 +18845,9 @@ var MDControlController = class extends ControlController {
|
|
|
18793
18845
|
if ((args == null ? void 0 : args.silent) !== true) {
|
|
18794
18846
|
this.actionNotification("REMOVESUCCESS", {
|
|
18795
18847
|
data,
|
|
18796
|
-
default:
|
|
18848
|
+
default: ibiz.i18n.t("runtime.controller.control.gantt.dataDeleted", {
|
|
18849
|
+
str: data.map((item) => item.srfmajortext).join("\u3001")
|
|
18850
|
+
})
|
|
18797
18851
|
});
|
|
18798
18852
|
}
|
|
18799
18853
|
if (needRefresh && !(args == null ? void 0 : args.notRefresh)) {
|
|
@@ -18801,10 +18855,12 @@ var MDControlController = class extends ControlController {
|
|
|
18801
18855
|
}
|
|
18802
18856
|
} catch (error) {
|
|
18803
18857
|
await this._evt.emit("onRemoveError", void 0);
|
|
18804
|
-
|
|
18805
|
-
|
|
18806
|
-
|
|
18807
|
-
|
|
18858
|
+
if ((args == null ? void 0 : args.silent) !== true) {
|
|
18859
|
+
this.actionNotification("REMOVEERROR", {
|
|
18860
|
+
error,
|
|
18861
|
+
data
|
|
18862
|
+
});
|
|
18863
|
+
}
|
|
18808
18864
|
throw error;
|
|
18809
18865
|
} finally {
|
|
18810
18866
|
await this.endLoading();
|
|
@@ -29137,21 +29193,30 @@ var EditFormController = class extends FormController {
|
|
|
29137
29193
|
let ok = false;
|
|
29138
29194
|
await this.evt.emit("onBeforeRemove", { args: this.data });
|
|
29139
29195
|
if (this.data.srfuf === 1 /* UPDATE */) {
|
|
29140
|
-
|
|
29141
|
-
|
|
29142
|
-
|
|
29143
|
-
|
|
29144
|
-
|
|
29145
|
-
|
|
29196
|
+
if ((args == null ? void 0 : args.silent) !== true) {
|
|
29197
|
+
const hiddenSsgItem = this.findCtrlMsgByTag("BEFOREREMOVE_HIDDEN");
|
|
29198
|
+
if (hiddenSsgItem) {
|
|
29199
|
+
ok = true;
|
|
29200
|
+
} else {
|
|
29201
|
+
ok = await ibiz.modal.confirm({
|
|
29202
|
+
title: ibiz.i18n.t("runtime.controller.control.form.prompt"),
|
|
29203
|
+
desc: ibiz.i18n.t("runtime.controller.control.form.deletion")
|
|
29204
|
+
});
|
|
29205
|
+
}
|
|
29206
|
+
if (!ok) {
|
|
29207
|
+
return false;
|
|
29208
|
+
}
|
|
29146
29209
|
}
|
|
29147
29210
|
await this.startLoading();
|
|
29148
29211
|
try {
|
|
29149
29212
|
res = await this.service.remove(context, params);
|
|
29150
29213
|
} catch (error) {
|
|
29151
29214
|
await this.evt.emit("onRemoveError", { args: error });
|
|
29152
|
-
|
|
29153
|
-
|
|
29154
|
-
|
|
29215
|
+
if ((args == null ? void 0 : args.silent) !== true) {
|
|
29216
|
+
this.actionNotification("REMOVEERROR", {
|
|
29217
|
+
error
|
|
29218
|
+
});
|
|
29219
|
+
}
|
|
29155
29220
|
throw error;
|
|
29156
29221
|
} finally {
|
|
29157
29222
|
await this.endLoading();
|
|
@@ -29346,6 +29411,31 @@ var EditFormController = class extends FormController {
|
|
|
29346
29411
|
ibiz.log.error(error);
|
|
29347
29412
|
}
|
|
29348
29413
|
}
|
|
29414
|
+
/**
|
|
29415
|
+
* 立即执行自动保存
|
|
29416
|
+
*
|
|
29417
|
+
* @return {*} {Promise<void>}
|
|
29418
|
+
* @memberof EditFormController
|
|
29419
|
+
*/
|
|
29420
|
+
async immediateAutoSave() {
|
|
29421
|
+
if (!this.model.enableAutoSave) {
|
|
29422
|
+
return;
|
|
29423
|
+
}
|
|
29424
|
+
const { autoSaveMode } = this.model;
|
|
29425
|
+
const saveParam = { silent: true, noFillBack: true };
|
|
29426
|
+
switch (autoSaveMode) {
|
|
29427
|
+
case 3:
|
|
29428
|
+
saveParam.data = this.getDiffData();
|
|
29429
|
+
saveParam.context = IBizContext6.create({ srfsimple: true });
|
|
29430
|
+
break;
|
|
29431
|
+
default:
|
|
29432
|
+
}
|
|
29433
|
+
try {
|
|
29434
|
+
await this.save(saveParam);
|
|
29435
|
+
} catch (error) {
|
|
29436
|
+
ibiz.log.error(error);
|
|
29437
|
+
}
|
|
29438
|
+
}
|
|
29349
29439
|
/**
|
|
29350
29440
|
* 比较旧数据跟当前数据的差异返回差异数据
|
|
29351
29441
|
*
|
|
@@ -30007,6 +30097,9 @@ var GridController = class extends MDControlController {
|
|
|
30007
30097
|
this.state.columnStates = [];
|
|
30008
30098
|
this.state.aggResult = {};
|
|
30009
30099
|
this.state.rowEditOpen = false;
|
|
30100
|
+
const { hideHeader, enablePagingBar } = this.model;
|
|
30101
|
+
this.state.hideHeader = hideHeader;
|
|
30102
|
+
this.state.enablePagingBar = enablePagingBar;
|
|
30010
30103
|
}
|
|
30011
30104
|
/**
|
|
30012
30105
|
* 初始化方法
|
|
@@ -30033,6 +30126,28 @@ var GridController = class extends MDControlController {
|
|
|
30033
30126
|
await this.initGroup();
|
|
30034
30127
|
await this.initExportData();
|
|
30035
30128
|
}
|
|
30129
|
+
/**
|
|
30130
|
+
* 计算表格展示模式
|
|
30131
|
+
* @author fzh
|
|
30132
|
+
* @date 2024-05-29 19:18:42
|
|
30133
|
+
* @return {*} {void}
|
|
30134
|
+
*/
|
|
30135
|
+
calcShowMode(tableData) {
|
|
30136
|
+
const { hideHeader, enablePagingBar } = this.model;
|
|
30137
|
+
this.state.hideHeader = hideHeader;
|
|
30138
|
+
this.state.enablePagingBar = enablePagingBar;
|
|
30139
|
+
const showmode = this.controlParams.showmode || "DEFAULT";
|
|
30140
|
+
if (showmode === "ONLYDATA") {
|
|
30141
|
+
this.state.hideHeader = true;
|
|
30142
|
+
this.state.enablePagingBar = false;
|
|
30143
|
+
}
|
|
30144
|
+
if (showmode === "MIXIN") {
|
|
30145
|
+
if (tableData.length === 0) {
|
|
30146
|
+
this.state.hideHeader = true;
|
|
30147
|
+
this.state.enablePagingBar = false;
|
|
30148
|
+
}
|
|
30149
|
+
}
|
|
30150
|
+
}
|
|
30036
30151
|
/**
|
|
30037
30152
|
* 根据jsonschema初始化自定义表格列
|
|
30038
30153
|
* @author lxm
|
|
@@ -33747,6 +33862,14 @@ var SearchBarController = class extends ControlController {
|
|
|
33747
33862
|
* @date 2024-01-05 10:10:37
|
|
33748
33863
|
*/
|
|
33749
33864
|
this.addSchemaFilters = false;
|
|
33865
|
+
/**
|
|
33866
|
+
* 是否启用存储
|
|
33867
|
+
*
|
|
33868
|
+
* @author zhanghengfeng
|
|
33869
|
+
* @date 2024-05-29 20:05:47
|
|
33870
|
+
* @type {boolean}
|
|
33871
|
+
*/
|
|
33872
|
+
this.enableStorage = false;
|
|
33750
33873
|
}
|
|
33751
33874
|
/**
|
|
33752
33875
|
* 启用自定义过滤项
|
|
@@ -33775,6 +33898,16 @@ var SearchBarController = class extends ControlController {
|
|
|
33775
33898
|
get grid() {
|
|
33776
33899
|
return this.ctx.getController("grid") || this.ctx.getController("treegrid");
|
|
33777
33900
|
}
|
|
33901
|
+
/**
|
|
33902
|
+
* 设置生成存储key的函数
|
|
33903
|
+
*
|
|
33904
|
+
* @author zhanghengfeng
|
|
33905
|
+
* @date 2024-05-29 16:05:35
|
|
33906
|
+
* @param {(() => string | undefined)} fn
|
|
33907
|
+
*/
|
|
33908
|
+
setStorageKeyFn(fn) {
|
|
33909
|
+
this.storageKeyFn = fn;
|
|
33910
|
+
}
|
|
33778
33911
|
initState() {
|
|
33779
33912
|
super.initState();
|
|
33780
33913
|
this.state.query = "";
|
|
@@ -33791,6 +33924,7 @@ var SearchBarController = class extends ControlController {
|
|
|
33791
33924
|
async onCreated() {
|
|
33792
33925
|
await this.initByEntitySchema();
|
|
33793
33926
|
await super.onCreated();
|
|
33927
|
+
this.enableStorage = this.controlParams.storage === "true";
|
|
33794
33928
|
const appDataEntity = await ibiz.hub.getAppDataEntity(
|
|
33795
33929
|
this.model.appDataEntityId,
|
|
33796
33930
|
this.context.srfappid
|
|
@@ -34048,6 +34182,7 @@ var SearchBarController = class extends ControlController {
|
|
|
34048
34182
|
* @Date: 2023-12-19 14:43:46
|
|
34049
34183
|
*/
|
|
34050
34184
|
async initSearBarGroups(firstInit = false) {
|
|
34185
|
+
var _a;
|
|
34051
34186
|
this.state.searchBarGroups = [];
|
|
34052
34187
|
if (this.isBackendSearchGroup) {
|
|
34053
34188
|
if (this.model.searchBarGroups && this.model.searchBarGroups.length > 0) {
|
|
@@ -34127,6 +34262,21 @@ var SearchBarController = class extends ControlController {
|
|
|
34127
34262
|
item.order = (index + 1) * 100;
|
|
34128
34263
|
});
|
|
34129
34264
|
if (firstInit && this.state.searchBarGroups && this.state.searchBarGroups.length > 0) {
|
|
34265
|
+
if (this.enableStorage) {
|
|
34266
|
+
const key = (_a = this.storageKeyFn) == null ? void 0 : _a.call(this);
|
|
34267
|
+
if (key) {
|
|
34268
|
+
const name = localStorage.getItem(key);
|
|
34269
|
+
if (name) {
|
|
34270
|
+
const selectedGroup = this.state.searchBarGroups.find((group) => {
|
|
34271
|
+
return group.name === name;
|
|
34272
|
+
});
|
|
34273
|
+
if (selectedGroup) {
|
|
34274
|
+
this.hasDefaultSelect = true;
|
|
34275
|
+
return;
|
|
34276
|
+
}
|
|
34277
|
+
}
|
|
34278
|
+
}
|
|
34279
|
+
}
|
|
34130
34280
|
const defaultSelectedGroup = this.state.searchBarGroups.find((group) => {
|
|
34131
34281
|
return group.defaultSelect;
|
|
34132
34282
|
});
|
|
@@ -34143,7 +34293,23 @@ var SearchBarController = class extends ControlController {
|
|
|
34143
34293
|
* @Date: 2024-01-24 11:12:43
|
|
34144
34294
|
*/
|
|
34145
34295
|
setDefaultSelect() {
|
|
34296
|
+
var _a;
|
|
34146
34297
|
if (this.state.searchBarGroups && this.state.searchBarGroups.length > 0) {
|
|
34298
|
+
if (this.enableStorage) {
|
|
34299
|
+
const key = (_a = this.storageKeyFn) == null ? void 0 : _a.call(this);
|
|
34300
|
+
if (key) {
|
|
34301
|
+
const name = localStorage.getItem(key);
|
|
34302
|
+
if (name) {
|
|
34303
|
+
const selectedGroup = this.state.searchBarGroups.find((group) => {
|
|
34304
|
+
return group.name === name;
|
|
34305
|
+
});
|
|
34306
|
+
if (selectedGroup) {
|
|
34307
|
+
this.handleGroupClick(selectedGroup);
|
|
34308
|
+
return;
|
|
34309
|
+
}
|
|
34310
|
+
}
|
|
34311
|
+
}
|
|
34312
|
+
}
|
|
34147
34313
|
const defaultSelectedGroup = this.state.searchBarGroups.find((group) => {
|
|
34148
34314
|
return group.defaultSelect;
|
|
34149
34315
|
});
|
|
@@ -34206,6 +34372,13 @@ var SearchBarController = class extends ControlController {
|
|
|
34206
34372
|
* @Date: 2023-12-21 10:29:24
|
|
34207
34373
|
*/
|
|
34208
34374
|
async handleGroupClick(groupItem) {
|
|
34375
|
+
var _a;
|
|
34376
|
+
if (this.enableStorage) {
|
|
34377
|
+
const key = (_a = this.storageKeyFn) == null ? void 0 : _a.call(this);
|
|
34378
|
+
if (key && groupItem.name) {
|
|
34379
|
+
localStorage.setItem(key, groupItem.name);
|
|
34380
|
+
}
|
|
34381
|
+
}
|
|
34209
34382
|
this.state.selectedSearchGroupItem = groupItem;
|
|
34210
34383
|
if (groupItem.saved) {
|
|
34211
34384
|
const res = await this.service.get(groupItem.id);
|
|
@@ -39565,12 +39738,18 @@ var GanttController = class extends TreeGridExController {
|
|
|
39565
39738
|
);
|
|
39566
39739
|
}
|
|
39567
39740
|
if ((args == null ? void 0 : args.silent) !== true) {
|
|
39568
|
-
|
|
39569
|
-
|
|
39570
|
-
|
|
39571
|
-
|
|
39572
|
-
|
|
39573
|
-
|
|
39741
|
+
let del = false;
|
|
39742
|
+
const hiddenSsgItem = this.findCtrlMsgByTag("BEFOREREMOVE_HIDDEN");
|
|
39743
|
+
if (hiddenSsgItem) {
|
|
39744
|
+
del = true;
|
|
39745
|
+
} else {
|
|
39746
|
+
del = await ibiz.confirm.error({
|
|
39747
|
+
title: ibiz.i18n.t("runtime.controller.common.control.dataDeletion"),
|
|
39748
|
+
desc: ibiz.i18n.t(
|
|
39749
|
+
"runtime.controller.common.control.confirmDataDeletion"
|
|
39750
|
+
)
|
|
39751
|
+
});
|
|
39752
|
+
}
|
|
39574
39753
|
if (!del) {
|
|
39575
39754
|
return;
|
|
39576
39755
|
}
|
|
@@ -39621,10 +39800,12 @@ var GanttController = class extends TreeGridExController {
|
|
|
39621
39800
|
}
|
|
39622
39801
|
} catch (error) {
|
|
39623
39802
|
await this.evt.emit("onRemoveError", void 0);
|
|
39624
|
-
|
|
39625
|
-
|
|
39626
|
-
|
|
39627
|
-
|
|
39803
|
+
if ((args == null ? void 0 : args.silent) !== true) {
|
|
39804
|
+
this.actionNotification("REMOVEERROR", {
|
|
39805
|
+
error,
|
|
39806
|
+
data
|
|
39807
|
+
});
|
|
39808
|
+
}
|
|
39628
39809
|
throw error;
|
|
39629
39810
|
} finally {
|
|
39630
39811
|
await this.endLoading();
|