@ibiz-template/runtime 0.7.19-alpha.0 → 0.7.19
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 +272 -93
- 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.map +1 -1
- package/out/controller/control/form/edit-form/edit-form.controller.js +20 -10
- package/out/controller/control/gantt/gantt.controller.d.ts +9 -0
- package/out/controller/control/gantt/gantt.controller.d.ts.map +1 -1
- package/out/controller/control/gantt/gantt.controller.js +41 -16
- package/out/controller/control/gantt/gantt.service.js +1 -1
- 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 +39 -3
- 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/control/tree/tree.service.js +1 -1
- package/out/controller/control/tree-grid-ex/tree-grid-ex.controller.d.ts.map +1 -1
- package/out/controller/control/tree-grid-ex/tree-grid-ex.controller.js +4 -4
- 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/state/control/i-drbar.state.d.ts +8 -0
- package/out/interface/controller/state/control/i-drbar.state.d.ts.map +1 -1
- package/out/interface/controller/state/control/i-drtab.state.d.ts +8 -0
- package/out/interface/controller/state/control/i-drtab.state.d.ts.map +1 -1
- package/out/interface/controller/state/control/i-gantt.state.d.ts +4 -0
- package/out/interface/controller/state/control/i-gantt.state.d.ts.map +1 -1
- package/out/interface/controller/state/control/i-grid.state.d.ts +21 -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/locale/en/index.d.ts +1 -1
- package/out/locale/en/index.js +1 -1
- package/out/locale/zh-CN/index.d.ts +1 -1
- package/out/locale/zh-CN/index.js +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 +42 -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.d.ts.map +1 -1
- package/out/service/utils/app-counter/app-counter.js +8 -6
- 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
|
@@ -8360,11 +8360,13 @@ var AppCounter = class {
|
|
|
8360
8360
|
*/
|
|
8361
8361
|
interval() {
|
|
8362
8362
|
this.destroyInterval();
|
|
8363
|
-
this.
|
|
8364
|
-
|
|
8365
|
-
this.
|
|
8366
|
-
|
|
8367
|
-
|
|
8363
|
+
if (this.model.timer) {
|
|
8364
|
+
this.intervalTimer = setInterval(() => {
|
|
8365
|
+
if (this.evt.getSize("change") > 0) {
|
|
8366
|
+
this.load();
|
|
8367
|
+
}
|
|
8368
|
+
}, this.model.timer);
|
|
8369
|
+
}
|
|
8368
8370
|
}
|
|
8369
8371
|
/**
|
|
8370
8372
|
* 销毁定时器自动刷新
|
|
@@ -8666,7 +8668,7 @@ var DynamicCodeListCache = class {
|
|
|
8666
8668
|
* @date 2024-04-15 17:08:06
|
|
8667
8669
|
* @type {Promise<void>}
|
|
8668
8670
|
*/
|
|
8669
|
-
this.commonKeys = ["query", "queryconds"];
|
|
8671
|
+
this.commonKeys = ["query", "queryconds", "searchconds"];
|
|
8670
8672
|
this.codeList = codeList;
|
|
8671
8673
|
if (this.codeList.enableCache) {
|
|
8672
8674
|
this.codelistChange = this.codelistChange.bind(this);
|
|
@@ -11763,8 +11765,8 @@ var DeAuthorityService = class {
|
|
|
11763
11765
|
*
|
|
11764
11766
|
* 0:无控制 不计算实体数据权限
|
|
11765
11767
|
* 1:自控制 根据实体数据中的权限标识计算
|
|
11766
|
-
* 2:附属主实体控制
|
|
11767
|
-
* 3
|
|
11768
|
+
* 2:附属主实体控制 先从自身权限标识数据查找,若未找到,再从父权限标识数据查找
|
|
11769
|
+
* 3:附属主实体控制(未映射自控)先从自身权限标识数据查找,若未找到,再从父权限标识数据查找
|
|
11768
11770
|
* @param {string} dataAccessAction 操作标识
|
|
11769
11771
|
* @param {IData} data 实体数据
|
|
11770
11772
|
* @param {IContext} context 上下文
|
|
@@ -11779,19 +11781,13 @@ var DeAuthorityService = class {
|
|
|
11779
11781
|
tempDataAccObject = (data == null ? void 0 : data.srfdataaccaction) ? convertToObject(data.srfdataaccaction) : void 0;
|
|
11780
11782
|
break;
|
|
11781
11783
|
case 2:
|
|
11782
|
-
tempDataAccObject = convertToObject(
|
|
11783
|
-
await this.calcMajorDataAccAction(context)
|
|
11784
|
-
);
|
|
11785
|
-
break;
|
|
11786
11784
|
case 3:
|
|
11787
11785
|
tempDataAccObject = convertToObject(
|
|
11788
11786
|
await this.calcMajorDataAccAction(context)
|
|
11789
11787
|
);
|
|
11790
|
-
if (
|
|
11791
|
-
|
|
11792
|
-
|
|
11793
|
-
) && data && data.srfdataaccaction) {
|
|
11794
|
-
tempDataAccObject = convertToObject(data.srfdataaccaction);
|
|
11788
|
+
if (data && data.srfdataaccaction) {
|
|
11789
|
+
const curDataAccObject = convertToObject(data.srfdataaccaction);
|
|
11790
|
+
Object.assign(tempDataAccObject, curDataAccObject);
|
|
11795
11791
|
}
|
|
11796
11792
|
break;
|
|
11797
11793
|
default:
|
|
@@ -11966,7 +11962,41 @@ var AuthorityService = class {
|
|
|
11966
11962
|
return !this.enablePermission || this.resCodes.includes(resCode);
|
|
11967
11963
|
}
|
|
11968
11964
|
/**
|
|
11969
|
-
*
|
|
11965
|
+
* 通过操作标识计算权限(无数据)
|
|
11966
|
+
*
|
|
11967
|
+
* @author tony001
|
|
11968
|
+
* @date 2024-05-29 16:05:33
|
|
11969
|
+
* @param {string} dataAccessAction
|
|
11970
|
+
* @param {IContext} context
|
|
11971
|
+
* @param {IData} [data]
|
|
11972
|
+
* @param {string} [appDeId]
|
|
11973
|
+
* @return {*} {Promise<boolean>}
|
|
11974
|
+
*/
|
|
11975
|
+
async calcByNoDataAccessAction(dataAccessAction, context, appDeId) {
|
|
11976
|
+
const result = true;
|
|
11977
|
+
if (this.enablePermission) {
|
|
11978
|
+
const app = await ibiz.hub.getApp(this.appModel.appId);
|
|
11979
|
+
const opPriv = await app.getOPPriv(dataAccessAction, appDeId);
|
|
11980
|
+
if (this.enablePermission && (opPriv == null ? void 0 : opPriv.mapSysUniResCode)) {
|
|
11981
|
+
if (!this.calcByResCode(opPriv.mapSysUniResCode)) {
|
|
11982
|
+
return false;
|
|
11983
|
+
}
|
|
11984
|
+
} else {
|
|
11985
|
+
if (appDeId) {
|
|
11986
|
+
const service = await this.getService(appDeId);
|
|
11987
|
+
const majorAccObject = convertToObject(
|
|
11988
|
+
await service.calcMajorDataAccAction(context)
|
|
11989
|
+
);
|
|
11990
|
+
if (majorAccObject && dataAccessAction && !majorAccObject[dataAccessAction]) {
|
|
11991
|
+
return false;
|
|
11992
|
+
}
|
|
11993
|
+
}
|
|
11994
|
+
}
|
|
11995
|
+
}
|
|
11996
|
+
return result;
|
|
11997
|
+
}
|
|
11998
|
+
/**
|
|
11999
|
+
* 通过操作标识计算权限(非无数据)
|
|
11970
12000
|
* @author lxm
|
|
11971
12001
|
* @date 2023-05-10 12:33:10
|
|
11972
12002
|
* @param {string} dataAccessAction 操作标识
|
|
@@ -15803,6 +15833,7 @@ var UIActionButtonState = class {
|
|
|
15803
15833
|
uiactionTag
|
|
15804
15834
|
} = uiAction;
|
|
15805
15835
|
this.dataAccessAction = dataAccessAction;
|
|
15836
|
+
this.actionTarget = actionTarget;
|
|
15806
15837
|
if (noPrivDisplayMode === 1) {
|
|
15807
15838
|
this.noPermissionHidden = false;
|
|
15808
15839
|
} else if (noPrivDisplayMode === 6) {
|
|
@@ -15840,6 +15871,14 @@ var UIActionButtonState = class {
|
|
|
15840
15871
|
return;
|
|
15841
15872
|
}
|
|
15842
15873
|
const app = await ibiz.hub.getApp(this.appId);
|
|
15874
|
+
if (this.actionTarget && this.actionTarget === "NONE") {
|
|
15875
|
+
this.permitted = await app.authority.calcByNoDataAccessAction(
|
|
15876
|
+
this.dataAccessAction,
|
|
15877
|
+
context,
|
|
15878
|
+
appDeId
|
|
15879
|
+
);
|
|
15880
|
+
return;
|
|
15881
|
+
}
|
|
15843
15882
|
if (this.appDeName && appDeId && !appDeId.includes(this.appDeName)) {
|
|
15844
15883
|
ibiz.log.warn(
|
|
15845
15884
|
ibiz.i18n.t(
|
|
@@ -18369,6 +18408,23 @@ var ControlController = class extends BaseController {
|
|
|
18369
18408
|
return this.getEventArgs();
|
|
18370
18409
|
};
|
|
18371
18410
|
}
|
|
18411
|
+
/**
|
|
18412
|
+
* 获取指定标识部件消息
|
|
18413
|
+
*
|
|
18414
|
+
* @author tony001
|
|
18415
|
+
* @date 2024-05-29 17:05:52
|
|
18416
|
+
* @protected
|
|
18417
|
+
* @param {string} tag
|
|
18418
|
+
* @return {*} {(ICtrlMsgItem | undefined)}
|
|
18419
|
+
*/
|
|
18420
|
+
findCtrlMsgByTag(tag) {
|
|
18421
|
+
let targetCtrlMsg;
|
|
18422
|
+
const { ctrlMsg } = this.model;
|
|
18423
|
+
if (ctrlMsg && ctrlMsg.ctrlMsgItems) {
|
|
18424
|
+
targetCtrlMsg = ctrlMsg.ctrlMsgItems.find((item) => item.name === tag);
|
|
18425
|
+
}
|
|
18426
|
+
return targetCtrlMsg;
|
|
18427
|
+
}
|
|
18372
18428
|
/**
|
|
18373
18429
|
* 执行对应部件行为消息提示
|
|
18374
18430
|
* @author lxm
|
|
@@ -18380,30 +18436,25 @@ var ControlController = class extends BaseController {
|
|
|
18380
18436
|
actionNotification(tag, opts) {
|
|
18381
18437
|
let message = "";
|
|
18382
18438
|
let duration;
|
|
18383
|
-
const
|
|
18384
|
-
if (
|
|
18385
|
-
|
|
18386
|
-
|
|
18387
|
-
|
|
18388
|
-
|
|
18389
|
-
|
|
18439
|
+
const hiddenSsgItem = this.findCtrlMsgByTag("".concat(tag, "_HIDDEN"));
|
|
18440
|
+
if (hiddenSsgItem) {
|
|
18441
|
+
return;
|
|
18442
|
+
}
|
|
18443
|
+
const msgItem = this.findCtrlMsgByTag(tag);
|
|
18444
|
+
if (msgItem && msgItem.content) {
|
|
18445
|
+
duration = isNil23(msgItem.timeout) ? void 0 : msgItem.timeout / 1e3;
|
|
18446
|
+
const scriptParams = { ...this.getEventArgs() };
|
|
18447
|
+
if (opts == null ? void 0 : opts.data) {
|
|
18448
|
+
scriptParams.data = opts.data;
|
|
18390
18449
|
}
|
|
18391
|
-
|
|
18392
|
-
|
|
18393
|
-
|
|
18394
|
-
|
|
18395
|
-
|
|
18396
|
-
|
|
18450
|
+
message = ScriptFactory.execScriptFn(
|
|
18451
|
+
scriptParams,
|
|
18452
|
+
"`".concat(msgItem.content, "`"),
|
|
18453
|
+
{
|
|
18454
|
+
isAsync: false,
|
|
18455
|
+
singleRowReturn: true
|
|
18397
18456
|
}
|
|
18398
|
-
|
|
18399
|
-
scriptParams,
|
|
18400
|
-
"`".concat(msgItem.content, "`"),
|
|
18401
|
-
{
|
|
18402
|
-
isAsync: false,
|
|
18403
|
-
singleRowReturn: true
|
|
18404
|
-
}
|
|
18405
|
-
);
|
|
18406
|
-
}
|
|
18457
|
+
);
|
|
18407
18458
|
}
|
|
18408
18459
|
if (!message && ibiz.i18n) {
|
|
18409
18460
|
const resTag = "CONTROL.".concat(this.model.controlType, ".").concat(tag).toUpperCase();
|
|
@@ -18770,12 +18821,18 @@ var MDControlController = class extends ControlController {
|
|
|
18770
18821
|
);
|
|
18771
18822
|
}
|
|
18772
18823
|
if ((args == null ? void 0 : args.silent) !== true) {
|
|
18773
|
-
|
|
18774
|
-
|
|
18775
|
-
|
|
18776
|
-
|
|
18777
|
-
|
|
18778
|
-
|
|
18824
|
+
let del = false;
|
|
18825
|
+
const hiddenSsgItem = this.findCtrlMsgByTag("BEFOREREMOVE_HIDDEN");
|
|
18826
|
+
if (hiddenSsgItem) {
|
|
18827
|
+
del = true;
|
|
18828
|
+
} else {
|
|
18829
|
+
del = await ibiz.confirm.error({
|
|
18830
|
+
title: ibiz.i18n.t("runtime.controller.common.control.dataDeletion"),
|
|
18831
|
+
desc: ibiz.i18n.t(
|
|
18832
|
+
"runtime.controller.common.control.confirmDataDeletion"
|
|
18833
|
+
)
|
|
18834
|
+
});
|
|
18835
|
+
}
|
|
18779
18836
|
if (!del) {
|
|
18780
18837
|
return;
|
|
18781
18838
|
}
|
|
@@ -18793,7 +18850,9 @@ var MDControlController = class extends ControlController {
|
|
|
18793
18850
|
if ((args == null ? void 0 : args.silent) !== true) {
|
|
18794
18851
|
this.actionNotification("REMOVESUCCESS", {
|
|
18795
18852
|
data,
|
|
18796
|
-
default:
|
|
18853
|
+
default: ibiz.i18n.t("runtime.controller.control.md.dataDeleted", {
|
|
18854
|
+
str: data.map((item) => item.srfmajortext).join("\u3001")
|
|
18855
|
+
})
|
|
18797
18856
|
});
|
|
18798
18857
|
}
|
|
18799
18858
|
if (needRefresh && !(args == null ? void 0 : args.notRefresh)) {
|
|
@@ -18801,10 +18860,12 @@ var MDControlController = class extends ControlController {
|
|
|
18801
18860
|
}
|
|
18802
18861
|
} catch (error) {
|
|
18803
18862
|
await this._evt.emit("onRemoveError", void 0);
|
|
18804
|
-
|
|
18805
|
-
|
|
18806
|
-
|
|
18807
|
-
|
|
18863
|
+
if ((args == null ? void 0 : args.silent) !== true) {
|
|
18864
|
+
this.actionNotification("REMOVEERROR", {
|
|
18865
|
+
error,
|
|
18866
|
+
data
|
|
18867
|
+
});
|
|
18868
|
+
}
|
|
18808
18869
|
throw error;
|
|
18809
18870
|
} finally {
|
|
18810
18871
|
await this.endLoading();
|
|
@@ -29137,21 +29198,30 @@ var EditFormController = class extends FormController {
|
|
|
29137
29198
|
let ok = false;
|
|
29138
29199
|
await this.evt.emit("onBeforeRemove", { args: this.data });
|
|
29139
29200
|
if (this.data.srfuf === 1 /* UPDATE */) {
|
|
29140
|
-
|
|
29141
|
-
|
|
29142
|
-
|
|
29143
|
-
|
|
29144
|
-
|
|
29145
|
-
|
|
29201
|
+
if ((args == null ? void 0 : args.silent) !== true) {
|
|
29202
|
+
const hiddenSsgItem = this.findCtrlMsgByTag("BEFOREREMOVE_HIDDEN");
|
|
29203
|
+
if (hiddenSsgItem) {
|
|
29204
|
+
ok = true;
|
|
29205
|
+
} else {
|
|
29206
|
+
ok = await ibiz.modal.confirm({
|
|
29207
|
+
title: ibiz.i18n.t("runtime.controller.control.form.prompt"),
|
|
29208
|
+
desc: ibiz.i18n.t("runtime.controller.control.form.deletion")
|
|
29209
|
+
});
|
|
29210
|
+
}
|
|
29211
|
+
if (!ok) {
|
|
29212
|
+
return false;
|
|
29213
|
+
}
|
|
29146
29214
|
}
|
|
29147
29215
|
await this.startLoading();
|
|
29148
29216
|
try {
|
|
29149
29217
|
res = await this.service.remove(context, params);
|
|
29150
29218
|
} catch (error) {
|
|
29151
29219
|
await this.evt.emit("onRemoveError", { args: error });
|
|
29152
|
-
|
|
29153
|
-
|
|
29154
|
-
|
|
29220
|
+
if ((args == null ? void 0 : args.silent) !== true) {
|
|
29221
|
+
this.actionNotification("REMOVEERROR", {
|
|
29222
|
+
error
|
|
29223
|
+
});
|
|
29224
|
+
}
|
|
29155
29225
|
throw error;
|
|
29156
29226
|
} finally {
|
|
29157
29227
|
await this.endLoading();
|
|
@@ -30032,6 +30102,10 @@ var GridController = class extends MDControlController {
|
|
|
30032
30102
|
this.state.columnStates = [];
|
|
30033
30103
|
this.state.aggResult = {};
|
|
30034
30104
|
this.state.rowEditOpen = false;
|
|
30105
|
+
const { hideHeader, enablePagingBar } = this.model;
|
|
30106
|
+
this.state.hideHeader = hideHeader;
|
|
30107
|
+
this.state.enablePagingBar = enablePagingBar;
|
|
30108
|
+
this.state.hideNoDataImage = false;
|
|
30035
30109
|
}
|
|
30036
30110
|
/**
|
|
30037
30111
|
* 初始化方法
|
|
@@ -30058,6 +30132,33 @@ var GridController = class extends MDControlController {
|
|
|
30058
30132
|
await this.initGroup();
|
|
30059
30133
|
await this.initExportData();
|
|
30060
30134
|
}
|
|
30135
|
+
/**
|
|
30136
|
+
* 计算表格展示模式
|
|
30137
|
+
* @author fzh
|
|
30138
|
+
* @date 2024-05-29 19:18:42
|
|
30139
|
+
* @return {*} {void}
|
|
30140
|
+
*/
|
|
30141
|
+
calcShowMode(tableData) {
|
|
30142
|
+
const { hideHeader, enablePagingBar } = this.model;
|
|
30143
|
+
this.state.hideNoDataImage = false;
|
|
30144
|
+
this.state.hideHeader = hideHeader;
|
|
30145
|
+
this.state.enablePagingBar = enablePagingBar;
|
|
30146
|
+
const showmode = this.controlParams.showmode || "DEFAULT";
|
|
30147
|
+
if (showmode === "ONLYDATA") {
|
|
30148
|
+
this.state.hideHeader = true;
|
|
30149
|
+
this.state.enablePagingBar = false;
|
|
30150
|
+
if (tableData.length === 0) {
|
|
30151
|
+
this.state.hideNoDataImage = true;
|
|
30152
|
+
}
|
|
30153
|
+
}
|
|
30154
|
+
if (showmode === "MIXIN") {
|
|
30155
|
+
if (tableData.length === 0) {
|
|
30156
|
+
this.state.hideHeader = true;
|
|
30157
|
+
this.state.enablePagingBar = false;
|
|
30158
|
+
this.state.hideNoDataImage = true;
|
|
30159
|
+
}
|
|
30160
|
+
}
|
|
30161
|
+
}
|
|
30061
30162
|
/**
|
|
30062
30163
|
* 根据jsonschema初始化自定义表格列
|
|
30063
30164
|
* @author lxm
|
|
@@ -30277,6 +30378,7 @@ var GridController = class extends MDControlController {
|
|
|
30277
30378
|
await this.updateRows(this.state.rows);
|
|
30278
30379
|
this.calcGroupData(items);
|
|
30279
30380
|
this.calcAggResult(items);
|
|
30381
|
+
this.calcShowMode(items);
|
|
30280
30382
|
return items;
|
|
30281
30383
|
}
|
|
30282
30384
|
/**
|
|
@@ -30434,7 +30536,7 @@ var GridController = class extends MDControlController {
|
|
|
30434
30536
|
const editingRow = this.state.rows.find((item) => item.showRowEdit);
|
|
30435
30537
|
if (editingRow) {
|
|
30436
30538
|
throw new RuntimeError56(
|
|
30437
|
-
ibiz.i18n.t("runtime.controller.control.
|
|
30539
|
+
ibiz.i18n.t("runtime.controller.control.md.firstComplete")
|
|
30438
30540
|
);
|
|
30439
30541
|
}
|
|
30440
30542
|
}
|
|
@@ -30477,11 +30579,11 @@ var GridController = class extends MDControlController {
|
|
|
30477
30579
|
const rowState = this.findRowState(data);
|
|
30478
30580
|
if (!rowState) {
|
|
30479
30581
|
throw new RuntimeError56(
|
|
30480
|
-
ibiz.i18n.t("runtime.controller.control.
|
|
30582
|
+
ibiz.i18n.t("runtime.controller.control.md.rowData")
|
|
30481
30583
|
);
|
|
30482
30584
|
}
|
|
30483
30585
|
if (!rowState.modified) {
|
|
30484
|
-
ibiz.log.debug(ibiz.i18n.t("runtime.controller.control.
|
|
30586
|
+
ibiz.log.debug(ibiz.i18n.t("runtime.controller.control.md.noChange"));
|
|
30485
30587
|
return;
|
|
30486
30588
|
}
|
|
30487
30589
|
if (rowState.processing) {
|
|
@@ -33772,6 +33874,14 @@ var SearchBarController = class extends ControlController {
|
|
|
33772
33874
|
* @date 2024-01-05 10:10:37
|
|
33773
33875
|
*/
|
|
33774
33876
|
this.addSchemaFilters = false;
|
|
33877
|
+
/**
|
|
33878
|
+
* 是否启用存储
|
|
33879
|
+
*
|
|
33880
|
+
* @author zhanghengfeng
|
|
33881
|
+
* @date 2024-05-29 20:05:47
|
|
33882
|
+
* @type {boolean}
|
|
33883
|
+
*/
|
|
33884
|
+
this.enableStorage = false;
|
|
33775
33885
|
}
|
|
33776
33886
|
/**
|
|
33777
33887
|
* 启用自定义过滤项
|
|
@@ -33800,6 +33910,16 @@ var SearchBarController = class extends ControlController {
|
|
|
33800
33910
|
get grid() {
|
|
33801
33911
|
return this.ctx.getController("grid") || this.ctx.getController("treegrid");
|
|
33802
33912
|
}
|
|
33913
|
+
/**
|
|
33914
|
+
* 设置生成存储key的函数
|
|
33915
|
+
*
|
|
33916
|
+
* @author zhanghengfeng
|
|
33917
|
+
* @date 2024-05-29 16:05:35
|
|
33918
|
+
* @param {(() => string | undefined)} fn
|
|
33919
|
+
*/
|
|
33920
|
+
setStorageKeyFn(fn) {
|
|
33921
|
+
this.storageKeyFn = fn;
|
|
33922
|
+
}
|
|
33803
33923
|
initState() {
|
|
33804
33924
|
super.initState();
|
|
33805
33925
|
this.state.query = "";
|
|
@@ -33816,6 +33936,7 @@ var SearchBarController = class extends ControlController {
|
|
|
33816
33936
|
async onCreated() {
|
|
33817
33937
|
await this.initByEntitySchema();
|
|
33818
33938
|
await super.onCreated();
|
|
33939
|
+
this.enableStorage = this.controlParams.storage === "true";
|
|
33819
33940
|
const appDataEntity = await ibiz.hub.getAppDataEntity(
|
|
33820
33941
|
this.model.appDataEntityId,
|
|
33821
33942
|
this.context.srfappid
|
|
@@ -34073,6 +34194,7 @@ var SearchBarController = class extends ControlController {
|
|
|
34073
34194
|
* @Date: 2023-12-19 14:43:46
|
|
34074
34195
|
*/
|
|
34075
34196
|
async initSearBarGroups(firstInit = false) {
|
|
34197
|
+
var _a;
|
|
34076
34198
|
this.state.searchBarGroups = [];
|
|
34077
34199
|
if (this.isBackendSearchGroup) {
|
|
34078
34200
|
if (this.model.searchBarGroups && this.model.searchBarGroups.length > 0) {
|
|
@@ -34152,6 +34274,21 @@ var SearchBarController = class extends ControlController {
|
|
|
34152
34274
|
item.order = (index + 1) * 100;
|
|
34153
34275
|
});
|
|
34154
34276
|
if (firstInit && this.state.searchBarGroups && this.state.searchBarGroups.length > 0) {
|
|
34277
|
+
if (this.enableStorage) {
|
|
34278
|
+
const key = (_a = this.storageKeyFn) == null ? void 0 : _a.call(this);
|
|
34279
|
+
if (key) {
|
|
34280
|
+
const name = localStorage.getItem(key);
|
|
34281
|
+
if (name) {
|
|
34282
|
+
const selectedGroup = this.state.searchBarGroups.find((group) => {
|
|
34283
|
+
return group.name === name;
|
|
34284
|
+
});
|
|
34285
|
+
if (selectedGroup) {
|
|
34286
|
+
this.hasDefaultSelect = true;
|
|
34287
|
+
return;
|
|
34288
|
+
}
|
|
34289
|
+
}
|
|
34290
|
+
}
|
|
34291
|
+
}
|
|
34155
34292
|
const defaultSelectedGroup = this.state.searchBarGroups.find((group) => {
|
|
34156
34293
|
return group.defaultSelect;
|
|
34157
34294
|
});
|
|
@@ -34168,7 +34305,23 @@ var SearchBarController = class extends ControlController {
|
|
|
34168
34305
|
* @Date: 2024-01-24 11:12:43
|
|
34169
34306
|
*/
|
|
34170
34307
|
setDefaultSelect() {
|
|
34308
|
+
var _a;
|
|
34171
34309
|
if (this.state.searchBarGroups && this.state.searchBarGroups.length > 0) {
|
|
34310
|
+
if (this.enableStorage) {
|
|
34311
|
+
const key = (_a = this.storageKeyFn) == null ? void 0 : _a.call(this);
|
|
34312
|
+
if (key) {
|
|
34313
|
+
const name = localStorage.getItem(key);
|
|
34314
|
+
if (name) {
|
|
34315
|
+
const selectedGroup = this.state.searchBarGroups.find((group) => {
|
|
34316
|
+
return group.name === name;
|
|
34317
|
+
});
|
|
34318
|
+
if (selectedGroup) {
|
|
34319
|
+
this.handleGroupClick(selectedGroup);
|
|
34320
|
+
return;
|
|
34321
|
+
}
|
|
34322
|
+
}
|
|
34323
|
+
}
|
|
34324
|
+
}
|
|
34172
34325
|
const defaultSelectedGroup = this.state.searchBarGroups.find((group) => {
|
|
34173
34326
|
return group.defaultSelect;
|
|
34174
34327
|
});
|
|
@@ -34231,6 +34384,13 @@ var SearchBarController = class extends ControlController {
|
|
|
34231
34384
|
* @Date: 2023-12-21 10:29:24
|
|
34232
34385
|
*/
|
|
34233
34386
|
async handleGroupClick(groupItem) {
|
|
34387
|
+
var _a;
|
|
34388
|
+
if (this.enableStorage) {
|
|
34389
|
+
const key = (_a = this.storageKeyFn) == null ? void 0 : _a.call(this);
|
|
34390
|
+
if (key && groupItem.name) {
|
|
34391
|
+
localStorage.setItem(key, groupItem.name);
|
|
34392
|
+
}
|
|
34393
|
+
}
|
|
34234
34394
|
this.state.selectedSearchGroupItem = groupItem;
|
|
34235
34395
|
if (groupItem.saved) {
|
|
34236
34396
|
const res = await this.service.get(groupItem.id);
|
|
@@ -34666,7 +34826,7 @@ var TreeService = class extends MDControlService {
|
|
|
34666
34826
|
default:
|
|
34667
34827
|
throw new ModelError30(
|
|
34668
34828
|
nodeModel,
|
|
34669
|
-
ibiz.i18n.t("runtime.controller.control.
|
|
34829
|
+
ibiz.i18n.t("runtime.controller.control.md.noSupport", {
|
|
34670
34830
|
treeNodeType: nodeModel.treeNodeType
|
|
34671
34831
|
})
|
|
34672
34832
|
);
|
|
@@ -37300,24 +37460,22 @@ var TreeGridExController = class extends TreeController {
|
|
|
37300
37460
|
}
|
|
37301
37461
|
async save(nodeData) {
|
|
37302
37462
|
if (this.state.isSimple) {
|
|
37303
|
-
ibiz.log.debug(
|
|
37304
|
-
ibiz.i18n.t("runtime.controller.control.gantt.simpleMode")
|
|
37305
|
-
);
|
|
37463
|
+
ibiz.log.debug(ibiz.i18n.t("runtime.controller.control.md.simpleMode"));
|
|
37306
37464
|
return;
|
|
37307
37465
|
}
|
|
37308
37466
|
if (nodeData._nodeType !== "DE") {
|
|
37309
37467
|
throw new RuntimeError63(
|
|
37310
|
-
ibiz.i18n.t("runtime.controller.control.
|
|
37468
|
+
ibiz.i18n.t("runtime.controller.control.md.nonentity")
|
|
37311
37469
|
);
|
|
37312
37470
|
}
|
|
37313
37471
|
const rowState = this.state.rows[nodeData._uuid];
|
|
37314
37472
|
if (!rowState) {
|
|
37315
37473
|
throw new RuntimeError63(
|
|
37316
|
-
ibiz.i18n.t("runtime.controller.control.
|
|
37474
|
+
ibiz.i18n.t("runtime.controller.control.md.rowData")
|
|
37317
37475
|
);
|
|
37318
37476
|
}
|
|
37319
37477
|
if (!rowState.modified) {
|
|
37320
|
-
ibiz.log.debug(ibiz.i18n.t("runtime.controller.control.
|
|
37478
|
+
ibiz.log.debug(ibiz.i18n.t("runtime.controller.control.md.noChange"));
|
|
37321
37479
|
return;
|
|
37322
37480
|
}
|
|
37323
37481
|
if (rowState.processing) {
|
|
@@ -39120,7 +39278,7 @@ var GanttService = class extends TreeService {
|
|
|
39120
39278
|
default:
|
|
39121
39279
|
throw new ModelError31(
|
|
39122
39280
|
nodeModel,
|
|
39123
|
-
ibiz.i18n.t("runtime.controller.control.
|
|
39281
|
+
ibiz.i18n.t("runtime.controller.control.md.noSupport", {
|
|
39124
39282
|
treeNodeType: nodeModel.treeNodeType
|
|
39125
39283
|
})
|
|
39126
39284
|
);
|
|
@@ -39265,6 +39423,21 @@ var GanttController = class extends TreeGridExController {
|
|
|
39265
39423
|
initState() {
|
|
39266
39424
|
super.initState();
|
|
39267
39425
|
this.state.ganttStyle = {};
|
|
39426
|
+
this.state.sliderDraggable = true;
|
|
39427
|
+
}
|
|
39428
|
+
/**
|
|
39429
|
+
* 部件参数解析
|
|
39430
|
+
*
|
|
39431
|
+
* @author ljx
|
|
39432
|
+
* @date 2024-05-30 17:09:08
|
|
39433
|
+
* @protected
|
|
39434
|
+
* @memberof ControlController
|
|
39435
|
+
*/
|
|
39436
|
+
handleControlParams() {
|
|
39437
|
+
super.handleControlParams();
|
|
39438
|
+
if (this.controlParams.sliderdraggable) {
|
|
39439
|
+
this.state.sliderDraggable = this.controlParams.sliderdraggable === "true";
|
|
39440
|
+
}
|
|
39268
39441
|
}
|
|
39269
39442
|
/**
|
|
39270
39443
|
* 当数据放生变更时,若为当前应用实体数据。则多数据部件进行刷新
|
|
@@ -39500,13 +39673,13 @@ var GanttController = class extends TreeGridExController {
|
|
|
39500
39673
|
async modifyNodeTime(nodeData, { begin, end }) {
|
|
39501
39674
|
if (nodeData._nodeType !== "DE") {
|
|
39502
39675
|
throw new RuntimeError66(
|
|
39503
|
-
ibiz.i18n.t("runtime.controller.control.
|
|
39676
|
+
ibiz.i18n.t("runtime.controller.control.md.noNode")
|
|
39504
39677
|
);
|
|
39505
39678
|
}
|
|
39506
39679
|
const rowState = this.getRowState(nodeData._id);
|
|
39507
39680
|
if (!rowState) {
|
|
39508
39681
|
throw new RuntimeError66(
|
|
39509
|
-
ibiz.i18n.t("runtime.controller.control.
|
|
39682
|
+
ibiz.i18n.t("runtime.controller.control.md.rowData")
|
|
39510
39683
|
);
|
|
39511
39684
|
}
|
|
39512
39685
|
const { beginDataItemName, endDataItemName } = this.model;
|
|
@@ -39523,24 +39696,22 @@ var GanttController = class extends TreeGridExController {
|
|
|
39523
39696
|
*/
|
|
39524
39697
|
async save(nodeData) {
|
|
39525
39698
|
if (this.state.isSimple) {
|
|
39526
|
-
ibiz.log.debug(
|
|
39527
|
-
ibiz.i18n.t("runtime.controller.control.gantt.simpleMode")
|
|
39528
|
-
);
|
|
39699
|
+
ibiz.log.debug(ibiz.i18n.t("runtime.controller.control.md.simpleMode"));
|
|
39529
39700
|
return;
|
|
39530
39701
|
}
|
|
39531
39702
|
if (nodeData._nodeType !== "DE") {
|
|
39532
39703
|
throw new RuntimeError66(
|
|
39533
|
-
ibiz.i18n.t("runtime.controller.control.
|
|
39704
|
+
ibiz.i18n.t("runtime.controller.control.md.nonentity")
|
|
39534
39705
|
);
|
|
39535
39706
|
}
|
|
39536
39707
|
const rowState = this.state.rows[nodeData._uuid];
|
|
39537
39708
|
if (!rowState) {
|
|
39538
39709
|
throw new RuntimeError66(
|
|
39539
|
-
ibiz.i18n.t("runtime.controller.control.
|
|
39710
|
+
ibiz.i18n.t("runtime.controller.control.md.rowData")
|
|
39540
39711
|
);
|
|
39541
39712
|
}
|
|
39542
39713
|
if (!rowState.modified) {
|
|
39543
|
-
ibiz.log.debug(ibiz.i18n.t("runtime.controller.control.
|
|
39714
|
+
ibiz.log.debug(ibiz.i18n.t("runtime.controller.control.md.noChange"));
|
|
39544
39715
|
return;
|
|
39545
39716
|
}
|
|
39546
39717
|
if (rowState.processing) {
|
|
@@ -39590,12 +39761,18 @@ var GanttController = class extends TreeGridExController {
|
|
|
39590
39761
|
);
|
|
39591
39762
|
}
|
|
39592
39763
|
if ((args == null ? void 0 : args.silent) !== true) {
|
|
39593
|
-
|
|
39594
|
-
|
|
39595
|
-
|
|
39596
|
-
|
|
39597
|
-
|
|
39598
|
-
|
|
39764
|
+
let del = false;
|
|
39765
|
+
const hiddenSsgItem = this.findCtrlMsgByTag("BEFOREREMOVE_HIDDEN");
|
|
39766
|
+
if (hiddenSsgItem) {
|
|
39767
|
+
del = true;
|
|
39768
|
+
} else {
|
|
39769
|
+
del = await ibiz.confirm.error({
|
|
39770
|
+
title: ibiz.i18n.t("runtime.controller.common.control.dataDeletion"),
|
|
39771
|
+
desc: ibiz.i18n.t(
|
|
39772
|
+
"runtime.controller.common.control.confirmDataDeletion"
|
|
39773
|
+
)
|
|
39774
|
+
});
|
|
39775
|
+
}
|
|
39599
39776
|
if (!del) {
|
|
39600
39777
|
return;
|
|
39601
39778
|
}
|
|
@@ -39636,7 +39813,7 @@ var GanttController = class extends TreeGridExController {
|
|
|
39636
39813
|
if ((args == null ? void 0 : args.silent) !== true) {
|
|
39637
39814
|
this.actionNotification("REMOVESUCCESS", {
|
|
39638
39815
|
data,
|
|
39639
|
-
default: ibiz.i18n.t("runtime.controller.control.
|
|
39816
|
+
default: ibiz.i18n.t("runtime.controller.control.md.dataDeleted", {
|
|
39640
39817
|
str: data.map((item) => item.srfmajortext).join("\u3001")
|
|
39641
39818
|
})
|
|
39642
39819
|
});
|
|
@@ -39646,10 +39823,12 @@ var GanttController = class extends TreeGridExController {
|
|
|
39646
39823
|
}
|
|
39647
39824
|
} catch (error) {
|
|
39648
39825
|
await this.evt.emit("onRemoveError", void 0);
|
|
39649
|
-
|
|
39650
|
-
|
|
39651
|
-
|
|
39652
|
-
|
|
39826
|
+
if ((args == null ? void 0 : args.silent) !== true) {
|
|
39827
|
+
this.actionNotification("REMOVEERROR", {
|
|
39828
|
+
error,
|
|
39829
|
+
data
|
|
39830
|
+
});
|
|
39831
|
+
}
|
|
39653
39832
|
throw error;
|
|
39654
39833
|
} finally {
|
|
39655
39834
|
await this.endLoading();
|
|
@@ -39701,7 +39880,7 @@ var GanttController = class extends TreeGridExController {
|
|
|
39701
39880
|
);
|
|
39702
39881
|
if (editingRow) {
|
|
39703
39882
|
throw new RuntimeError66(
|
|
39704
|
-
ibiz.i18n.t("runtime.controller.control.
|
|
39883
|
+
ibiz.i18n.t("runtime.controller.control.md.firstComplete")
|
|
39705
39884
|
);
|
|
39706
39885
|
}
|
|
39707
39886
|
}
|
|
@@ -43026,7 +43205,7 @@ var en = {
|
|
|
43026
43205
|
searchTerms: "No search terms found to apply",
|
|
43027
43206
|
saveSearch: "No saved search criteria found"
|
|
43028
43207
|
},
|
|
43029
|
-
|
|
43208
|
+
md: {
|
|
43030
43209
|
noNode: "Not entity gantt node data",
|
|
43031
43210
|
rowData: "Row data does not exist",
|
|
43032
43211
|
simpleMode: "Simple mode, no saving",
|
|
@@ -43599,7 +43778,7 @@ var zhCn = {
|
|
|
43599
43778
|
searchTerms: "\u6CA1\u6709\u627E\u5230\u53EF\u4EE5\u5E94\u7528\u7684\u641C\u7D22\u6761\u4EF6",
|
|
43600
43779
|
saveSearch: "\u6CA1\u6709\u627E\u5230\u4FDD\u5B58\u7684\u641C\u7D22\u6761\u4EF6"
|
|
43601
43780
|
},
|
|
43602
|
-
|
|
43781
|
+
md: {
|
|
43603
43782
|
noNode: "\u4E0D\u662F\u5B9E\u4F53\u7518\u7279\u8282\u70B9\u6570\u636E",
|
|
43604
43783
|
rowData: "\u884C\u6570\u636E\u4E0D\u5B58\u5728",
|
|
43605
43784
|
simpleMode: "\u7B80\u5355\u6A21\u5F0F\uFF0C\u4E0D\u4FDD\u5B58",
|