imm-element-ui 2.4.8 → 2.5.0
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/esm2022/lib/am/am.component.mjs +3 -1
- package/esm2022/lib/grid/cell-edit/cell-edit-selectField.component.mjs +3 -3
- package/esm2022/lib/page-form/page-form.component.mjs +314 -35
- package/esm2022/lib/page-form/page-form.interface.mjs +1 -1
- package/esm2022/lib/share/data-utils.mjs +156 -0
- package/fesm2022/imm-element-ui.mjs +470 -36
- package/fesm2022/imm-element-ui.mjs.map +1 -1
- package/lib/am/am.component.d.ts +2 -0
- package/lib/page-form/page-form.component.d.ts +43 -1
- package/lib/page-form/page-form.interface.d.ts +11 -0
- package/lib/share/data-utils.d.ts +49 -0
- package/package.json +1 -1
- package/src/lib/page-form/page-form.component.scss +18 -0
|
@@ -183,6 +183,162 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.13", ngImpo
|
|
|
183
183
|
}]
|
|
184
184
|
}], ctorParameters: () => [{ type: i1.TranslateService }, { type: i2.Platform }, { type: i3.PrimeNG }] });
|
|
185
185
|
|
|
186
|
+
/**
|
|
187
|
+
* 将扁平数组转换为 PrimeNG TreeNode 树形结构
|
|
188
|
+
* @param list 原始数据数组
|
|
189
|
+
* @param options 配置项
|
|
190
|
+
* @returns PrimeNG TreeNode 数组
|
|
191
|
+
*/
|
|
192
|
+
function toPrimeNGTree(list, options = {}) {
|
|
193
|
+
const { idKey = 'id', pidKey = 'pid', labelKey = 'orgName', childrenKey = 'children', rootPidValue = undefined, preserveData = true, } = options;
|
|
194
|
+
if (!Array.isArray(list) || list.length === 0) {
|
|
195
|
+
return [];
|
|
196
|
+
}
|
|
197
|
+
// 创建 id -> TreeNode 的映射
|
|
198
|
+
const nodeMap = new Map();
|
|
199
|
+
// 临时存储原始数据的映射
|
|
200
|
+
const originalDataMap = new Map();
|
|
201
|
+
// 判断是否为根节点的函数
|
|
202
|
+
const isRootNode = (item) => {
|
|
203
|
+
const pid = item[pidKey];
|
|
204
|
+
// 如果指定了 rootPidValue,则严格匹配
|
|
205
|
+
if (rootPidValue !== undefined) {
|
|
206
|
+
return pid === rootPidValue;
|
|
207
|
+
}
|
|
208
|
+
// 默认:pid 不存在、为 null、为 undefined 的作为根节点
|
|
209
|
+
return pid === undefined || pid === null || pid === '';
|
|
210
|
+
};
|
|
211
|
+
// 第一步:为每个原始数据创建 TreeNode 节点
|
|
212
|
+
list.forEach((item) => {
|
|
213
|
+
const id = item[idKey];
|
|
214
|
+
if (id === undefined || id === null)
|
|
215
|
+
return;
|
|
216
|
+
originalDataMap.set(id, item);
|
|
217
|
+
// 获取显示文本,如果 labelKey 对应的值不存在,则使用 id 作为备选
|
|
218
|
+
let label = item[labelKey];
|
|
219
|
+
if (label === undefined || label === null) {
|
|
220
|
+
// 支持多级备选字段
|
|
221
|
+
label = item['name'] || item['label'] || item['title'] || id.toString();
|
|
222
|
+
}
|
|
223
|
+
const treeNode = {
|
|
224
|
+
label: String(label),
|
|
225
|
+
data: preserveData ? { ...item } : { id, [labelKey]: label },
|
|
226
|
+
expandedIcon: 'pi pi-folder-open',
|
|
227
|
+
collapsedIcon: 'pi pi-folder',
|
|
228
|
+
leaf: true,
|
|
229
|
+
};
|
|
230
|
+
nodeMap.set(id, treeNode);
|
|
231
|
+
});
|
|
232
|
+
const roots = [];
|
|
233
|
+
// 第二步:根据 pid 建立父子关系
|
|
234
|
+
list.forEach((item) => {
|
|
235
|
+
const id = item[idKey];
|
|
236
|
+
const node = nodeMap.get(id);
|
|
237
|
+
if (!node)
|
|
238
|
+
return;
|
|
239
|
+
if (isRootNode(item)) {
|
|
240
|
+
// 根节点
|
|
241
|
+
roots.push(node);
|
|
242
|
+
}
|
|
243
|
+
else {
|
|
244
|
+
// 非根节点,找到父节点
|
|
245
|
+
const parentId = item[pidKey];
|
|
246
|
+
const parent = nodeMap.get(parentId);
|
|
247
|
+
if (parent) {
|
|
248
|
+
if (!parent.children) {
|
|
249
|
+
parent.children = [];
|
|
250
|
+
}
|
|
251
|
+
parent.children.push(node);
|
|
252
|
+
// 父节点不再是叶子节点
|
|
253
|
+
parent.leaf = false;
|
|
254
|
+
// 为父节点设置展开/折叠图标
|
|
255
|
+
parent.expandedIcon = 'pi pi-folder-open';
|
|
256
|
+
parent.collapsedIcon = 'pi pi-folder';
|
|
257
|
+
}
|
|
258
|
+
else {
|
|
259
|
+
// 父节点不存在(数据异常),作为根节点处理
|
|
260
|
+
console.warn(`Parent node not found: id=${id}, ${pidKey}=${parentId}`);
|
|
261
|
+
roots.push(node);
|
|
262
|
+
}
|
|
263
|
+
}
|
|
264
|
+
});
|
|
265
|
+
// 可选:对每个节点的 children 按某种规则排序
|
|
266
|
+
roots.forEach((root) => sortTreeChildren(root));
|
|
267
|
+
return roots;
|
|
268
|
+
}
|
|
269
|
+
/**
|
|
270
|
+
* 对树的子节点进行排序(可选)
|
|
271
|
+
*/
|
|
272
|
+
function sortTreeChildren(node, sortKey = 'label') {
|
|
273
|
+
if (node.children && node.children.length > 0) {
|
|
274
|
+
node.children.sort((a, b) => {
|
|
275
|
+
const aVal = a.data?.[sortKey] || a.label || '';
|
|
276
|
+
const bVal = b.data?.[sortKey] || b.label || '';
|
|
277
|
+
return String(aVal).localeCompare(String(bVal));
|
|
278
|
+
});
|
|
279
|
+
node.children.forEach((child) => sortTreeChildren(child, sortKey));
|
|
280
|
+
}
|
|
281
|
+
}
|
|
282
|
+
/**
|
|
283
|
+
* 简化版:只指定关键字段
|
|
284
|
+
* @param list 原始数据
|
|
285
|
+
* @param idField id字段名
|
|
286
|
+
* @param pidField 父id字段名
|
|
287
|
+
* @param labelField 显示文本字段名
|
|
288
|
+
*/
|
|
289
|
+
function toPrimeNGTreeSimple(list, idField = 'id', pidField = 'pid', labelField = 'orgName') {
|
|
290
|
+
return toPrimeNGTree(list, {
|
|
291
|
+
idKey: idField,
|
|
292
|
+
pidKey: pidField,
|
|
293
|
+
labelKey: labelField,
|
|
294
|
+
});
|
|
295
|
+
}
|
|
296
|
+
/**
|
|
297
|
+
* 从树中查找节点
|
|
298
|
+
* @param tree 树形数据
|
|
299
|
+
* @param predicate 查找条件
|
|
300
|
+
*/
|
|
301
|
+
function findTreeNode(tree, predicate) {
|
|
302
|
+
for (const node of tree) {
|
|
303
|
+
if (predicate(node))
|
|
304
|
+
return node;
|
|
305
|
+
if (node.children) {
|
|
306
|
+
const found = findTreeNode(node.children, predicate);
|
|
307
|
+
if (found)
|
|
308
|
+
return found;
|
|
309
|
+
}
|
|
310
|
+
}
|
|
311
|
+
return null;
|
|
312
|
+
}
|
|
313
|
+
/**
|
|
314
|
+
* 展开/折叠所有节点
|
|
315
|
+
* @param tree 树形数据
|
|
316
|
+
* @param expanded 是否展开
|
|
317
|
+
*/
|
|
318
|
+
function expandAllTreeNodes(tree, expanded = true) {
|
|
319
|
+
tree.forEach((node) => {
|
|
320
|
+
node.expanded = expanded;
|
|
321
|
+
if (node.children && node.children.length > 0) {
|
|
322
|
+
expandAllTreeNodes(node.children, expanded);
|
|
323
|
+
}
|
|
324
|
+
});
|
|
325
|
+
}
|
|
326
|
+
/**
|
|
327
|
+
* 获取树的所有叶子节点
|
|
328
|
+
*/
|
|
329
|
+
function getLeafNodes(tree) {
|
|
330
|
+
const leaves = [];
|
|
331
|
+
tree.forEach((node) => {
|
|
332
|
+
if (!node.children || node.children.length === 0) {
|
|
333
|
+
leaves.push(node);
|
|
334
|
+
}
|
|
335
|
+
else {
|
|
336
|
+
leaves.push(...getLeafNodes(node.children));
|
|
337
|
+
}
|
|
338
|
+
});
|
|
339
|
+
return leaves;
|
|
340
|
+
}
|
|
341
|
+
|
|
186
342
|
const apiPath = '';
|
|
187
343
|
class AmComponent {
|
|
188
344
|
constructor() {
|
|
@@ -224,6 +380,7 @@ class AmComponent {
|
|
|
224
380
|
this.route = inject(ActivatedRoute);
|
|
225
381
|
this.router = inject(Router);
|
|
226
382
|
this.i18n = inject(I18nService);
|
|
383
|
+
this.toPrimeNGTree = toPrimeNGTree;
|
|
227
384
|
}
|
|
228
385
|
rfd(prm) {
|
|
229
386
|
return this.http.post(apiPath + 'RFD', prm).pipe(map((response) => {
|
|
@@ -5158,7 +5315,7 @@ class CellEditSelectFieldComponent {
|
|
|
5158
5315
|
agInit(params) {
|
|
5159
5316
|
this.params = params;
|
|
5160
5317
|
if (!this.params.rawOptions && typeof this.params.getOptions === 'function') {
|
|
5161
|
-
this.params.options = this.params.getOptions() || [];
|
|
5318
|
+
this.params.options = this.params.getOptions(this.params.data) || [];
|
|
5162
5319
|
}
|
|
5163
5320
|
else {
|
|
5164
5321
|
this.params.options = this.params.rawOptions;
|
|
@@ -5191,7 +5348,7 @@ class CellEditSelectFieldComponent {
|
|
|
5191
5348
|
}
|
|
5192
5349
|
updateNameField(nameField, event) {
|
|
5193
5350
|
const oldValue = this.params.data[nameField.field];
|
|
5194
|
-
const item = this.params.
|
|
5351
|
+
const item = this.params.options.find((op) => op.value === event.value);
|
|
5195
5352
|
const newValue = item ? item[nameField.key] : null;
|
|
5196
5353
|
const grid = this.params.grid();
|
|
5197
5354
|
let e = {
|
|
@@ -9750,9 +9907,13 @@ class PageFormComponent extends AmComponent {
|
|
|
9750
9907
|
this.selectionKeys = [];
|
|
9751
9908
|
this.subDeleteIds = [];
|
|
9752
9909
|
this.leftPanelItems = [];
|
|
9910
|
+
this.leftPanelTreeNodes = [];
|
|
9911
|
+
this.leftPanelSelectedNode = null;
|
|
9753
9912
|
this.leftPanelSelectedValue = null;
|
|
9754
9913
|
this.leftPanelSelectedItem = null;
|
|
9914
|
+
this.leftPanelExpandedKeys = {};
|
|
9755
9915
|
this.leftPanelInitialized = false;
|
|
9916
|
+
this.leftPanelInitializedMode = null;
|
|
9756
9917
|
this.baseGridListSnapshot = [];
|
|
9757
9918
|
this.stepsVisible = true;
|
|
9758
9919
|
this.destroy$ = new Subject();
|
|
@@ -9822,19 +9983,17 @@ class PageFormComponent extends AmComponent {
|
|
|
9822
9983
|
}, { allowSignalWrites: true });
|
|
9823
9984
|
effect(() => {
|
|
9824
9985
|
const panel = this.leftPanel();
|
|
9825
|
-
if (!panel?.enabled
|
|
9826
|
-
this.
|
|
9827
|
-
this.leftPanelItems = [];
|
|
9828
|
-
this.leftPanelSelectedValue = null;
|
|
9829
|
-
this.leftPanelSelectedItem = null;
|
|
9830
|
-
this.gridListOverridden = false;
|
|
9831
|
-
this.internalGridList.set(this.gridList());
|
|
9832
|
-
this.syncUpsertSubserts();
|
|
9986
|
+
if (!panel?.enabled) {
|
|
9987
|
+
this.resetLeftPanelState();
|
|
9833
9988
|
return;
|
|
9834
9989
|
}
|
|
9835
|
-
|
|
9990
|
+
const currentMode = this.getLeftPanelMode();
|
|
9991
|
+
if (this.leftPanelInitialized && this.leftPanelInitializedMode === currentMode) {
|
|
9836
9992
|
return;
|
|
9837
9993
|
}
|
|
9994
|
+
if (this.leftPanelInitializedMode && this.leftPanelInitializedMode !== currentMode) {
|
|
9995
|
+
this.resetLeftPanelState();
|
|
9996
|
+
}
|
|
9838
9997
|
queueMicrotask(() => {
|
|
9839
9998
|
this.initializeLeftPanel();
|
|
9840
9999
|
});
|
|
@@ -9857,29 +10016,51 @@ class PageFormComponent extends AmComponent {
|
|
|
9857
10016
|
this.destroy$.next();
|
|
9858
10017
|
this.destroy$.complete();
|
|
9859
10018
|
}
|
|
10019
|
+
resetLeftPanelState() {
|
|
10020
|
+
this.leftPanelInitialized = false;
|
|
10021
|
+
this.leftPanelInitializedMode = null;
|
|
10022
|
+
this.leftPanelItems = [];
|
|
10023
|
+
this.leftPanelTreeNodes = [];
|
|
10024
|
+
this.leftPanelSelectedNode = null;
|
|
10025
|
+
this.leftPanelSelectedValue = null;
|
|
10026
|
+
this.leftPanelSelectedItem = null;
|
|
10027
|
+
this.leftPanelExpandedKeys = {};
|
|
10028
|
+
this.gridListOverridden = false;
|
|
10029
|
+
this.internalGridList.set(this.gridList());
|
|
10030
|
+
this.syncUpsertSubserts();
|
|
10031
|
+
this.cdr.markForCheck();
|
|
10032
|
+
}
|
|
9860
10033
|
async initializeLeftPanel() {
|
|
9861
10034
|
const panel = this.leftPanel();
|
|
9862
|
-
if (!panel?.enabled
|
|
10035
|
+
if (!panel?.enabled) {
|
|
9863
10036
|
return;
|
|
9864
10037
|
}
|
|
9865
10038
|
this.leftPanelInitialized = true;
|
|
10039
|
+
this.leftPanelInitializedMode = this.getLeftPanelMode();
|
|
9866
10040
|
this.baseGridListSnapshot = this.gridList().map((item) => item);
|
|
9867
|
-
const dataSource =
|
|
10041
|
+
const dataSource = this.getPanelDataSource();
|
|
9868
10042
|
this.runLeftPanelEvent('onInit');
|
|
9869
10043
|
const items = await this.loadLeftPanelItems(dataSource);
|
|
9870
10044
|
this.leftPanelItems = items;
|
|
9871
|
-
this.runLeftPanelEvent('onItemsLoaded');
|
|
10045
|
+
this.runLeftPanelEvent('onItemsLoaded', { items });
|
|
10046
|
+
if (this.getLeftPanelMode() === 'tree') {
|
|
10047
|
+
this.initializeLeftPanelTree(items);
|
|
10048
|
+
return;
|
|
10049
|
+
}
|
|
10050
|
+
await this.initializeLeftPanelList(items, dataSource);
|
|
10051
|
+
}
|
|
10052
|
+
async initializeLeftPanelList(items, dataSource) {
|
|
9872
10053
|
let defaultValue = await this.resolveMaybeAsync(typeof dataSource?.defaultSelect === 'function'
|
|
9873
10054
|
? dataSource.defaultSelect(this.createLeftPanelEventContext({ items }))
|
|
9874
10055
|
: dataSource?.defaultSelect);
|
|
9875
10056
|
if (defaultValue && typeof defaultValue === 'object') {
|
|
9876
|
-
defaultValue = this.
|
|
10057
|
+
defaultValue = this.resolvePanelOptionValue(defaultValue);
|
|
9877
10058
|
}
|
|
9878
|
-
if ((defaultValue === undefined || defaultValue === null) &&
|
|
9879
|
-
defaultValue = this.
|
|
10059
|
+
if ((defaultValue === undefined || defaultValue === null) && this.getPanelAllowDeselect() === false && items.length > 0) {
|
|
10060
|
+
defaultValue = this.resolvePanelOptionValue(items[0]);
|
|
9880
10061
|
}
|
|
9881
10062
|
if (defaultValue !== undefined && defaultValue !== null) {
|
|
9882
|
-
await this.applyLeftPanelSelection(defaultValue, items.find((item) => this.
|
|
10063
|
+
await this.applyLeftPanelSelection(defaultValue, items.find((item) => this.resolvePanelOptionValue(item) === defaultValue));
|
|
9883
10064
|
return;
|
|
9884
10065
|
}
|
|
9885
10066
|
this.cdr.markForCheck();
|
|
@@ -9900,6 +10081,39 @@ class PageFormComponent extends AmComponent {
|
|
|
9900
10081
|
}
|
|
9901
10082
|
return Array.isArray(result) ? result : [];
|
|
9902
10083
|
}
|
|
10084
|
+
getLeftPanelMode() {
|
|
10085
|
+
return this.leftPanel()?.mode === 'tree' ? 'tree' : 'list';
|
|
10086
|
+
}
|
|
10087
|
+
getPanelOptionLabel() {
|
|
10088
|
+
return this.leftPanel()?.optionLabel || this.leftPanel()?.list?.optionLabel || this.leftPanel()?.tree?.nodeLabel || 'label';
|
|
10089
|
+
}
|
|
10090
|
+
getPanelOptionValue() {
|
|
10091
|
+
return this.leftPanel()?.optionValue || this.leftPanel()?.list?.optionValue || this.leftPanel()?.tree?.nodeValue || 'value';
|
|
10092
|
+
}
|
|
10093
|
+
getPanelAllowDeselect() {
|
|
10094
|
+
return this.leftPanel()?.allowDeselect ?? this.leftPanel()?.list?.allowDeselect ?? true;
|
|
10095
|
+
}
|
|
10096
|
+
getPanelEmptyMessage() {
|
|
10097
|
+
return this.leftPanel()?.emptyMessage || this.leftPanel()?.list?.emptyMessage || this.leftPanel()?.tree?.emptyMessage || '暂无数据';
|
|
10098
|
+
}
|
|
10099
|
+
getPanelDataSource() {
|
|
10100
|
+
return this.leftPanel()?.dataSource || this.leftPanel()?.list?.dataSource || this.leftPanel()?.tree?.dataSource;
|
|
10101
|
+
}
|
|
10102
|
+
getTreeChildrenField() {
|
|
10103
|
+
return this.leftPanel()?.tree?.childrenField || 'children';
|
|
10104
|
+
}
|
|
10105
|
+
getTreeParentSelectable() {
|
|
10106
|
+
return this.leftPanel()?.tree?.parentSelectable ?? true;
|
|
10107
|
+
}
|
|
10108
|
+
getTreeExpandedKeysStateKey() {
|
|
10109
|
+
return this.leftPanel()?.tree?.expandedKeysStateKey;
|
|
10110
|
+
}
|
|
10111
|
+
getTreeFieldValue(item, field) {
|
|
10112
|
+
if (!field) {
|
|
10113
|
+
return undefined;
|
|
10114
|
+
}
|
|
10115
|
+
return fieldUtils.getModel(item, field);
|
|
10116
|
+
}
|
|
9903
10117
|
async resolveMaybeAsync(value) {
|
|
9904
10118
|
if (isObservable(value)) {
|
|
9905
10119
|
return await firstValueFrom(value);
|
|
@@ -9912,7 +10126,7 @@ class PageFormComponent extends AmComponent {
|
|
|
9912
10126
|
createLeftPanelEventContext(extra = {}) {
|
|
9913
10127
|
return {
|
|
9914
10128
|
pageForm: this,
|
|
9915
|
-
mode: this.
|
|
10129
|
+
mode: this.getLeftPanelMode(),
|
|
9916
10130
|
selectedItem: this.leftPanelSelectedItem,
|
|
9917
10131
|
selectedValue: this.leftPanelSelectedValue,
|
|
9918
10132
|
items: this.leftPanelItems,
|
|
@@ -9937,38 +10151,37 @@ class PageFormComponent extends AmComponent {
|
|
|
9937
10151
|
}
|
|
9938
10152
|
return handler(this.createLeftPanelEventContext(extra));
|
|
9939
10153
|
}
|
|
9940
|
-
|
|
9941
|
-
const optionValue = this.
|
|
10154
|
+
resolvePanelOptionValue(option) {
|
|
10155
|
+
const optionValue = this.getPanelOptionValue();
|
|
9942
10156
|
if (!optionValue) {
|
|
9943
10157
|
return option;
|
|
9944
10158
|
}
|
|
9945
10159
|
return fieldUtils.getModel(option, optionValue);
|
|
9946
10160
|
}
|
|
9947
10161
|
async onLeftPanelSelectionChange(event) {
|
|
9948
|
-
if (event.value == null) {
|
|
10162
|
+
if (event.value == null && this.getPanelAllowDeselect()) {
|
|
9949
10163
|
return;
|
|
9950
10164
|
}
|
|
9951
10165
|
await this.applyLeftPanelSelection(event.value, event.option);
|
|
9952
10166
|
}
|
|
9953
10167
|
async applyLeftPanelSelection(value, option) {
|
|
9954
10168
|
const panel = this.leftPanel();
|
|
9955
|
-
if (!panel?.enabled ||
|
|
10169
|
+
if (!panel?.enabled || this.getLeftPanelMode() !== 'list') {
|
|
9956
10170
|
return;
|
|
9957
10171
|
}
|
|
9958
|
-
const selectedItem = option ?? this.leftPanelItems.find((item) => this.
|
|
10172
|
+
const selectedItem = option ?? this.leftPanelItems.find((item) => this.resolvePanelOptionValue(item) === value) ?? null;
|
|
9959
10173
|
this.leftPanelSelectedValue = value;
|
|
9960
10174
|
this.leftPanelSelectedItem = selectedItem;
|
|
9961
|
-
|
|
9962
|
-
this.getPrm.data = {};
|
|
9963
|
-
}
|
|
9964
|
-
if (panel.stateKey) {
|
|
9965
|
-
fieldUtils.setModel(this.getPrm.data, panel.stateKey, value);
|
|
9966
|
-
}
|
|
9967
|
-
if (panel.panelSelectedDataKey) {
|
|
9968
|
-
fieldUtils.setModel(this.getPrm.data, panel.panelSelectedDataKey, selectedItem);
|
|
9969
|
-
}
|
|
10175
|
+
this.syncLeftPanelSelectionState(value, selectedItem);
|
|
9970
10176
|
this.indexValue = 0;
|
|
9971
|
-
this.runLeftPanelEvent('onSelectionChange', {
|
|
10177
|
+
this.runLeftPanelEvent('onSelectionChange', {
|
|
10178
|
+
selectedItem,
|
|
10179
|
+
selectedValue: value,
|
|
10180
|
+
node: null,
|
|
10181
|
+
rawNode: null,
|
|
10182
|
+
isParent: false,
|
|
10183
|
+
isLeaf: true,
|
|
10184
|
+
});
|
|
9972
10185
|
this.syncGetPrmFiterPreloads();
|
|
9973
10186
|
this.formOptions = this.buildFormOptions();
|
|
9974
10187
|
if (this.id && this.modelName) {
|
|
@@ -9994,6 +10207,226 @@ class PageFormComponent extends AmComponent {
|
|
|
9994
10207
|
}
|
|
9995
10208
|
this.syncGetPrmFiterPreloads();
|
|
9996
10209
|
}
|
|
10210
|
+
syncLeftPanelSelectionState(value, selectedItem) {
|
|
10211
|
+
const panel = this.leftPanel();
|
|
10212
|
+
if (!panel) {
|
|
10213
|
+
return;
|
|
10214
|
+
}
|
|
10215
|
+
if (!this.getPrm.data) {
|
|
10216
|
+
this.getPrm.data = {};
|
|
10217
|
+
}
|
|
10218
|
+
if (panel.stateKey) {
|
|
10219
|
+
fieldUtils.setModel(this.getPrm.data, panel.stateKey, value);
|
|
10220
|
+
}
|
|
10221
|
+
if (panel.panelSelectedDataKey) {
|
|
10222
|
+
fieldUtils.setModel(this.getPrm.data, panel.panelSelectedDataKey, selectedItem);
|
|
10223
|
+
}
|
|
10224
|
+
}
|
|
10225
|
+
initializeLeftPanelTree(items) {
|
|
10226
|
+
const expandedState = this.readTreeExpandedKeysState();
|
|
10227
|
+
this.leftPanelExpandedKeys = expandedState || {};
|
|
10228
|
+
this.leftPanelTreeNodes = this.buildTreeNodes(items);
|
|
10229
|
+
void this.applyTreeDefaultSelection();
|
|
10230
|
+
this.cdr.markForCheck();
|
|
10231
|
+
}
|
|
10232
|
+
buildTreeNodes(items, parentKey = 'root') {
|
|
10233
|
+
const childrenField = this.getTreeChildrenField();
|
|
10234
|
+
const iconField = this.leftPanel()?.tree?.iconField;
|
|
10235
|
+
const leafField = this.leftPanel()?.tree?.leafField;
|
|
10236
|
+
const disabledField = this.leftPanel()?.tree?.disabledField;
|
|
10237
|
+
return items.map((item, index) => {
|
|
10238
|
+
const key = this.buildTreeNodeKey(item, parentKey, index);
|
|
10239
|
+
const childItems = fieldUtils.getModel(item, childrenField);
|
|
10240
|
+
const children = Array.isArray(childItems) ? this.buildTreeNodes(childItems, key) : [];
|
|
10241
|
+
const isLeaf = leafField ? !!this.getTreeFieldValue(item, leafField) : children.length === 0;
|
|
10242
|
+
const isParent = children.length > 0;
|
|
10243
|
+
const selectable = this.getTreeParentSelectable() || !isParent;
|
|
10244
|
+
return {
|
|
10245
|
+
key,
|
|
10246
|
+
label: this.resolveTreeNodeLabel(item),
|
|
10247
|
+
data: item,
|
|
10248
|
+
children: children.length > 0 ? children : undefined,
|
|
10249
|
+
leaf: isLeaf,
|
|
10250
|
+
expanded: this.shouldExpandTreeNode(key, isParent),
|
|
10251
|
+
selectable,
|
|
10252
|
+
disabled: disabledField ? !!this.getTreeFieldValue(item, disabledField) : false,
|
|
10253
|
+
icon: iconField ? this.getTreeFieldValue(item, iconField) : undefined,
|
|
10254
|
+
};
|
|
10255
|
+
});
|
|
10256
|
+
}
|
|
10257
|
+
buildTreeNodeKey(item, parentKey, index) {
|
|
10258
|
+
const value = this.resolvePanelOptionValue(item);
|
|
10259
|
+
return `${parentKey}-${value ?? index}`;
|
|
10260
|
+
}
|
|
10261
|
+
resolveTreeNodeLabel(item) {
|
|
10262
|
+
const label = fieldUtils.getModel(item, this.getPanelOptionLabel());
|
|
10263
|
+
return label == null ? '' : String(label);
|
|
10264
|
+
}
|
|
10265
|
+
shouldExpandTreeNode(key, isParent) {
|
|
10266
|
+
if (!isParent) {
|
|
10267
|
+
return false;
|
|
10268
|
+
}
|
|
10269
|
+
if (Object.keys(this.leftPanelExpandedKeys).length > 0) {
|
|
10270
|
+
return !!this.leftPanelExpandedKeys[key];
|
|
10271
|
+
}
|
|
10272
|
+
return this.leftPanel()?.tree?.defaultExpand ?? false;
|
|
10273
|
+
}
|
|
10274
|
+
readTreeExpandedKeysState() {
|
|
10275
|
+
const stateKey = this.getTreeExpandedKeysStateKey();
|
|
10276
|
+
if (!stateKey) {
|
|
10277
|
+
return {};
|
|
10278
|
+
}
|
|
10279
|
+
return fieldUtils.getModel(this.getPrm.data, stateKey) || {};
|
|
10280
|
+
}
|
|
10281
|
+
syncTreeExpandedKeysState() {
|
|
10282
|
+
const stateKey = this.getTreeExpandedKeysStateKey();
|
|
10283
|
+
if (!stateKey) {
|
|
10284
|
+
return;
|
|
10285
|
+
}
|
|
10286
|
+
if (!this.getPrm.data) {
|
|
10287
|
+
this.getPrm.data = {};
|
|
10288
|
+
}
|
|
10289
|
+
fieldUtils.setModel(this.getPrm.data, stateKey, { ...this.leftPanelExpandedKeys });
|
|
10290
|
+
}
|
|
10291
|
+
async applyTreeDefaultSelection() {
|
|
10292
|
+
const dataSource = this.getPanelDataSource();
|
|
10293
|
+
let defaultValue = await this.resolveMaybeAsync(typeof dataSource?.defaultSelect === 'function'
|
|
10294
|
+
? dataSource.defaultSelect(this.createLeftPanelEventContext({ items: this.leftPanelItems }))
|
|
10295
|
+
: dataSource?.defaultSelect);
|
|
10296
|
+
if (defaultValue && typeof defaultValue === 'object' && !('key' in defaultValue)) {
|
|
10297
|
+
defaultValue = this.resolvePanelOptionValue(defaultValue);
|
|
10298
|
+
}
|
|
10299
|
+
if (defaultValue === undefined || defaultValue === null) {
|
|
10300
|
+
defaultValue = this.findFirstSelectableTreeNode(this.leftPanelTreeNodes)?.key ?? null;
|
|
10301
|
+
}
|
|
10302
|
+
if (defaultValue == null) {
|
|
10303
|
+
return;
|
|
10304
|
+
}
|
|
10305
|
+
const resolvedNode = this.resolveTreeNodeBySelection(defaultValue);
|
|
10306
|
+
const nextNode = this.isSelectableTreeNode(resolvedNode)
|
|
10307
|
+
? resolvedNode
|
|
10308
|
+
: this.findFirstSelectableTreeNode(this.leftPanelTreeNodes);
|
|
10309
|
+
if (nextNode) {
|
|
10310
|
+
await this.applyLeftPanelTreeSelection(nextNode);
|
|
10311
|
+
}
|
|
10312
|
+
}
|
|
10313
|
+
findFirstSelectableTreeNode(nodes) {
|
|
10314
|
+
for (const node of nodes) {
|
|
10315
|
+
if (this.isSelectableTreeNode(node)) {
|
|
10316
|
+
return node;
|
|
10317
|
+
}
|
|
10318
|
+
if (node.children?.length) {
|
|
10319
|
+
const match = this.findFirstSelectableTreeNode(node.children);
|
|
10320
|
+
if (match) {
|
|
10321
|
+
return match;
|
|
10322
|
+
}
|
|
10323
|
+
}
|
|
10324
|
+
}
|
|
10325
|
+
return null;
|
|
10326
|
+
}
|
|
10327
|
+
resolveTreeNodeBySelection(selection) {
|
|
10328
|
+
if (selection && typeof selection === 'object' && 'key' in selection) {
|
|
10329
|
+
return this.findTreeNodeByKey(this.leftPanelTreeNodes, selection.key) ?? null;
|
|
10330
|
+
}
|
|
10331
|
+
return this.findTreeNodeByValue(this.leftPanelTreeNodes, selection);
|
|
10332
|
+
}
|
|
10333
|
+
findTreeNodeByValue(nodes, value) {
|
|
10334
|
+
for (const node of nodes) {
|
|
10335
|
+
const nodeValue = this.resolvePanelOptionValue(node.data);
|
|
10336
|
+
if (nodeValue === value) {
|
|
10337
|
+
return node;
|
|
10338
|
+
}
|
|
10339
|
+
if (node.children?.length) {
|
|
10340
|
+
const match = this.findTreeNodeByValue(node.children, value);
|
|
10341
|
+
if (match) {
|
|
10342
|
+
return match;
|
|
10343
|
+
}
|
|
10344
|
+
}
|
|
10345
|
+
}
|
|
10346
|
+
return null;
|
|
10347
|
+
}
|
|
10348
|
+
findTreeNodeByKey(nodes, key) {
|
|
10349
|
+
for (const node of nodes) {
|
|
10350
|
+
if (node.key === key) {
|
|
10351
|
+
return node;
|
|
10352
|
+
}
|
|
10353
|
+
if (node.children?.length) {
|
|
10354
|
+
const match = this.findTreeNodeByKey(node.children, key);
|
|
10355
|
+
if (match) {
|
|
10356
|
+
return match;
|
|
10357
|
+
}
|
|
10358
|
+
}
|
|
10359
|
+
}
|
|
10360
|
+
return null;
|
|
10361
|
+
}
|
|
10362
|
+
isTreeParentNode(node) {
|
|
10363
|
+
return !!node?.children?.length;
|
|
10364
|
+
}
|
|
10365
|
+
isSelectableTreeNode(node) {
|
|
10366
|
+
if (!node || node.disabled) {
|
|
10367
|
+
return false;
|
|
10368
|
+
}
|
|
10369
|
+
if (this.getTreeParentSelectable()) {
|
|
10370
|
+
return true;
|
|
10371
|
+
}
|
|
10372
|
+
return !this.isTreeParentNode(node);
|
|
10373
|
+
}
|
|
10374
|
+
async onLeftPanelTreeNodeSelect(event) {
|
|
10375
|
+
const node = event?.node ?? null;
|
|
10376
|
+
if (!this.isSelectableTreeNode(node)) {
|
|
10377
|
+
this.leftPanelSelectedNode = this.resolveTreeNodeBySelection(this.leftPanelSelectedValue);
|
|
10378
|
+
this.cdr.markForCheck();
|
|
10379
|
+
return;
|
|
10380
|
+
}
|
|
10381
|
+
if (node) {
|
|
10382
|
+
await this.applyLeftPanelTreeSelection(node);
|
|
10383
|
+
}
|
|
10384
|
+
}
|
|
10385
|
+
onLeftPanelTreeNodeExpand(event) {
|
|
10386
|
+
const key = event?.node?.key;
|
|
10387
|
+
if (!key) {
|
|
10388
|
+
return;
|
|
10389
|
+
}
|
|
10390
|
+
this.leftPanelExpandedKeys[key] = true;
|
|
10391
|
+
this.syncTreeExpandedKeysState();
|
|
10392
|
+
}
|
|
10393
|
+
onLeftPanelTreeNodeCollapse(event) {
|
|
10394
|
+
const key = event?.node?.key;
|
|
10395
|
+
if (!key) {
|
|
10396
|
+
return;
|
|
10397
|
+
}
|
|
10398
|
+
delete this.leftPanelExpandedKeys[key];
|
|
10399
|
+
this.syncTreeExpandedKeysState();
|
|
10400
|
+
}
|
|
10401
|
+
async applyLeftPanelTreeSelection(node) {
|
|
10402
|
+
const panel = this.leftPanel();
|
|
10403
|
+
if (!panel?.enabled || this.getLeftPanelMode() !== 'tree') {
|
|
10404
|
+
return;
|
|
10405
|
+
}
|
|
10406
|
+
const rawNode = node.data;
|
|
10407
|
+
const selectedValue = this.resolvePanelOptionValue(rawNode);
|
|
10408
|
+
this.leftPanelSelectedNode = node;
|
|
10409
|
+
this.leftPanelSelectedValue = selectedValue;
|
|
10410
|
+
this.leftPanelSelectedItem = rawNode;
|
|
10411
|
+
this.syncLeftPanelSelectionState(selectedValue, rawNode);
|
|
10412
|
+
this.indexValue = 0;
|
|
10413
|
+
this.runLeftPanelEvent('onSelectionChange', {
|
|
10414
|
+
selectedItem: rawNode,
|
|
10415
|
+
selectedValue,
|
|
10416
|
+
node,
|
|
10417
|
+
rawNode,
|
|
10418
|
+
isParent: this.isTreeParentNode(node),
|
|
10419
|
+
isLeaf: !this.isTreeParentNode(node),
|
|
10420
|
+
});
|
|
10421
|
+
this.syncGetPrmFiterPreloads();
|
|
10422
|
+
this.formOptions = this.buildFormOptions();
|
|
10423
|
+
if (this.id && this.modelName) {
|
|
10424
|
+
typeof this.formDetail() == 'function' ? this.formDetail()(this.id) : this.getDetail(2);
|
|
10425
|
+
return;
|
|
10426
|
+
}
|
|
10427
|
+
this.refreshSlotRenderStates();
|
|
10428
|
+
this.cdr.markForCheck();
|
|
10429
|
+
}
|
|
9997
10430
|
buildFormOptions() {
|
|
9998
10431
|
try {
|
|
9999
10432
|
const sourceForm = this.form();
|
|
@@ -10759,7 +11192,7 @@ class PageFormComponent extends AmComponent {
|
|
|
10759
11192
|
}
|
|
10760
11193
|
}
|
|
10761
11194
|
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: PageFormComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
10762
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "18.2.13", type: PageFormComponent, isStandalone: true, selector: "app-page-form", inputs: { addVisible: { classPropertyName: "addVisible", publicName: "addVisible", isSignal: true, isRequired: false, transformFunction: null }, gridList: { classPropertyName: "gridList", publicName: "gridList", isSignal: true, isRequired: false, transformFunction: null }, form: { classPropertyName: "form", publicName: "form", isSignal: true, isRequired: true, transformFunction: null }, getPrmInput: { classPropertyName: "getPrmInput", publicName: "getPrmInput", isSignal: true, isRequired: true, transformFunction: null }, statusSteps: { classPropertyName: "statusSteps", publicName: "statusSteps", isSignal: true, isRequired: false, transformFunction: null }, statusKey: { classPropertyName: "statusKey", publicName: "statusKey", isSignal: true, isRequired: false, transformFunction: null }, hrefBtnList: { classPropertyName: "hrefBtnList", publicName: "hrefBtnList", isSignal: true, isRequired: false, transformFunction: null }, setTitle: { classPropertyName: "setTitle", publicName: "setTitle", isSignal: true, isRequired: false, transformFunction: null }, actionList: { classPropertyName: "actionList", publicName: "actionList", isSignal: true, isRequired: false, transformFunction: null }, modelLog: { classPropertyName: "modelLog", publicName: "modelLog", isSignal: true, isRequired: false, transformFunction: null }, formDisabled: { classPropertyName: "formDisabled", publicName: "formDisabled", isSignal: true, isRequired: false, transformFunction: null }, statusConf: { classPropertyName: "statusConf", publicName: "statusConf", isSignal: true, isRequired: false, transformFunction: null }, formDetail: { classPropertyName: "formDetail", publicName: "formDetail", isSignal: true, isRequired: false, transformFunction: null }, saveFunc: { classPropertyName: "saveFunc", publicName: "saveFunc", isSignal: true, isRequired: false, transformFunction: null }, showMainSaveButton: { classPropertyName: "showMainSaveButton", publicName: "showMainSaveButton", isSignal: true, isRequired: false, transformFunction: null }, configNewPath: { classPropertyName: "configNewPath", publicName: "configNewPath", isSignal: true, isRequired: false, transformFunction: null }, runtimeContextInput: { classPropertyName: "runtimeContextInput", publicName: "runtimeContextInput", isSignal: true, isRequired: false, transformFunction: null }, customLeftPanel: { classPropertyName: "customLeftPanel", publicName: "customLeftPanel", isSignal: true, isRequired: false, transformFunction: null }, customListFormTemplateMap: { classPropertyName: "customListFormTemplateMap", publicName: "customListFormTemplateMap", isSignal: true, isRequired: false, transformFunction: null }, customListFormInstanceMap: { classPropertyName: "customListFormInstanceMap", publicName: "customListFormInstanceMap", isSignal: true, isRequired: false, transformFunction: null }, leftPanel: { classPropertyName: "leftPanel", publicName: "leftPanel", isSignal: true, isRequired: false, transformFunction: null }, panelSelectedData: { classPropertyName: "panelSelectedData", publicName: "panelSelectedData", isSignal: true, isRequired: false, transformFunction: null }, authLevel: { classPropertyName: "authLevel", publicName: "authLevel", isSignal: true, isRequired: false, transformFunction: null } }, host: { listeners: { "window:resize": "onResize()" } }, providers: [], queries: [{ propertyName: "pageFormSlots", predicate: PageFormSlotDirective, descendants: true }], viewQueries: [{ propertyName: "cForm", first: true, predicate: ["cForm"], descendants: true }, { propertyName: "rowSelector", first: true, predicate: RowSelectorComponent$1, descendants: true }, { propertyName: "customGrid", predicate: ["customGrid"], descendants: true }, { propertyName: "tabForm", predicate: ["tabForm"], descendants: true }], usesInheritance: true, ngImport: i0, template: "<div class=\"md:overflow-hidden\">\n <!-- \u4FDD\u5B58\u65B0\u5EFA\u64CD\u4F5C\u533A -->\n\t<div class=\"flex md:flex-wrap lg:flex-nowrap items-center md:justify-between py-1 px-1 border-b-[1px] border-[#dbdbdb] bg-white\">\n\t\t<div class=\"lg:basis-1/3 order-1\">\n\t\t\t<app-crumb-action\n\t\t\t\t[addVisible]=\"addVisible()\"\n\t\t\t\t[newUrl]=\"newUrl\"\n\t\t\t\t[isShowCog]=\"true\"\n\t\t\t\t[outlined]=\"true\"\n\t\t\t\t[authLevel]=\"authLevel()\"\n\t\t\t\t[actionList]=\"actionList()\"\n\t\t\t\t[configNewPath]=\"configNewPath()\"\n\t\t\t\t[data]=\"getPrm.data ?? {}\"\n\t\t\t\t[saveBtnDisable]=\"saveBtnDisable\"\n\t\t\t\t[showSaveButton]=\"showMainSaveButton()\"\n\t\t\t\t(actionEvent)=\"authClick($event)\"\n\t\t\t\t(saveEvent)=\"submitForm()\">\n\t\t\t</app-crumb-action>\n\t\t</div>\n\n\t\t<div class=\"basis-1/5 lg:basis-2/3 order-2 lg:order-2 md:order-last md:basis-full md:mt-[6px]\">\n\t\t\t<href-btn-list\n\t\t\t\t[hrefs]=\"hrefBtnList()\"\n\t\t\t\t(hrefClick)=\"goRun($event)\"></href-btn-list>\n\t\t\t<!-- @if (id) {\n\t\t\t\t@for (btn of hrefBtnList(); track btn) {\n\t\t\t\t\t<p-button\n\t\t\t\t\t\t[variant]=\"btn?.variant\"\n\t\t\t\t\t\t[severity]=\"btn?.severity\"\n\t\t\t\t\t\tclass=\"mr-[6px]\"\n\t\t\t\t\t\tsize=\"small\"\n\t\t\t\t\t\t[icon]=\"btn?.icon\"\n\t\t\t\t\t\tlabel=\"{{ btn.i18nKey ? i18n.fanyi(btn.i18nKey) : btn.label }}\"\n\t\t\t\t\t\t(click)=\"goRun(btn)\">\n\t\t\t\t\t</p-button>\n\t\t\t\t}\n\t\t\t} -->\n\t\t</div>\n\t\t<div class=\"basis-1/3 order-3 flex flex-row-reverse\">\n\t\t\t@if (modelLog()) {\n\t\t\t\t<div class=\"hidden md:block\">\n\t\t\t\t\t<span\n\t\t\t\t\t\t[class]=\"'iconfont icon-sidebar icon-sidebar-' + sidebarMode()\"\n\t\t\t\t\t\t(click)=\"toggleLog()\"></span>\n\t\t\t\t</div>\n\t\t\t}\n\t\t</div>\n\t</div>\n\t<div class=\"flex\">\n\t\t<div class=\"px-2 flex flex-wrap items-center flex-1\">\n\t\t\t<div class=\"hidden md:basis-1/3 py-1 basis-full md:flex items-center flex-row order-1\">\n\t\t\t\t@for (action of actionList(); let i = $index; track action) {\n\t\t\t\t\t<p-button\n\t\t\t\t\t\tsize=\"small\"\n\t\t\t\t\t\t[icon]=\"getPrm.data?.icon\"\n\t\t\t\t\t\t[loading]=\"action.loading\"\n\t\t\t\t\t\t[label]=\"action.i18nKey ? (action.i18nKey | translate) : action.label\"\n\t\t\t\t\t\t[disabled]=\"action.btnDisabled ? action.btnDisabled(getPrm.data) : false\"\n\t\t\t\t\t\t[styleClass]=\"\n\t\t\t\t\t\t\t(action.auth || 0) > (authLevel() || 0) || !!action.btnHidden?.(getPrm.data)\n\t\t\t\t\t\t\t\t? 'form-action hidden'\n\t\t\t\t\t\t\t\t: 'form-action block mr-[.5rem]'\n\t\t\t\t\t\t\"\n\t\t\t\t\t\t(onClick)=\"action.onClick != '' && action.onClick?.(getPrm.data, action)\">\n\t\t\t\t\t</p-button>\n\t\t\t\t}\n\t\t\t</div>\n\t\t\t<div class=\"md:basis-2/3 basis-full flex md:flex-row-reverse flex-row md:order-2 order-first w-full\">\n\t\t\t\t@if (stepsVisible) {\n\t\t\t\t\t<custom-steps\n\t\t\t\t\t\t#customSteps\n\t\t\t\t\t\tclass=\"w-full\"\n\t\t\t\t\t\t[steps]=\"statusSteps()\"\n\t\t\t\t\t\t[modelLog]=\"showLog()\"\n\t\t\t\t\t\t[current]=\"getPrm.data && getPrm.data[statusKey()] !== undefined ? getPrm.data[statusKey()] : 0\"\n\t\t\t\t\t\t[authLevel]=\"authLevel()\"\n\t\t\t\t\t\t[isClick]=\"this.statusConf().isClick\"\n\t\t\t\t\t\t(change)=\"statusChange($event, customSteps)\">\n\t\t\t\t\t</custom-steps>\n\t\t\t\t}\n\t\t\t</div>\n\t\t</div>\n\t\t@if (showLog()) {\n\t\t\t<div class=\"lg:w-[400px] md:w-[300px] hidden md:block\"></div>\n\t\t}\n\t</div>\n <!-- form \u4E3B\u533A\u57DF-->\n @if(this.form().form) {\n <div class=\"main flex flex-wrap\">\n @if (customLeftPanel()) {\n <div class=\"hidden md:block md:h-full md:overflow-y-auto md:flex-none md:w-fit md:max-w-full\">\n <ng-container *ngTemplateOutlet=\"customLeftPanel()\"></ng-container>\n </div>\n } @else if (leftPanel()?.enabled && leftPanel()?.mode === 'list') {\n <div class=\"hidden md:block md:h-full md:overflow-y-auto md:flex-none md:w-[220px] md:max-w-full px-2\">\n <div class=\"page-form-left-panel\">\n <am-single-select-listbox\n [options]=\"leftPanelItems\"\n [ngModel]=\"leftPanelSelectedValue\"\n (onChange)=\"onLeftPanelSelectionChange($event)\"\n [optionValue]=\"leftPanel()?.list?.optionValue || 'value'\"\n [optionLabel]=\"leftPanel()?.list?.optionLabel || 'label'\"\n [emptyMessage]=\"leftPanel()?.list?.emptyMessage || '\u6682\u65E0\u6570\u636E'\"\n [allowDeselect]=\"leftPanel()?.list?.allowDeselect ?? true\" />\n </div>\n </div>\n }\n <div class=\"w-full md:min-w-0 md:flex-1 md:h-full md:overflow-y-auto\">\n <div class=\"bg-white mx-2 form-panel\">\n <div class=\"p-2 flex-1\">\n <form [formGroup]=\"form().form!\">\n <custom-form\n #cForm\n [options]=\"formOptions\"\n [upsert]=\"upsertPrm\"\n [model]=\"getPrm.data ?? {}\"></custom-form>\n </form>\n </div>\n @if (grids && grids.length > 0) {\n <div class=\"relative mb-2\">\n <p-tabs [(value)]=\"indexValue\">\n <p-tablist>\n @for (fchild of grids; let i = $index; track fchild) {\n <p-tab\n [value]=\"i\"\n (click)=\"tabClick()\">\n {{ fchild.i18nKey ? i18n.fanyi(fchild.i18nKey) : fchild.title }}\n </p-tab>\n }\n </p-tablist>\n </p-tabs>\n </div>\n }\n @for (grid of grids; let i = $index; track grid) {\n @let slotState = slotRenderStates[i];\n @let slot = slotState?.slot;\n <div [hidden]=\"indexValue != i\" [style.height]=\"slot ? grid.gridOptions.scrollHeight : null\">\n @if (slot) {\n <ng-container *ngTemplateOutlet=\"slot.templateRef; context: slotState.context\"> </ng-container>\n <div class=\"flex justify-end py-[5px] pr-[8px] bg-white\">\n @if (canShowCurrentTabSave(grid)) {\n <p-button\n icon=\"pi pi-cloud-upload\"\n [text]=\"true\"\n severity=\"primary\"\n [disabled]=\"gridDisable\"\n (onClick)=\"saveCurrentTab()\" />\n }\n @if (grid.subTableSource != 'none') {\n <p-button\n icon=\"pi pi-plus\"\n [text]=\"true\"\n severity=\"success\"\n [disabled]=\"gridDisable\"\n (onClick)=\"addRowClickHandler(grid)\" />\n }\n @if (grid.showDelete) {\n <p-button\n icon=\"pi pi-trash\"\n [text]=\"true\"\n severity=\"danger\"\n [disabled]=\"gridDisable\"\n (onClick)=\"delRowClickHandler(grid)\" />\n }\n\t\t\t\t\t\t\t\t\t<div #customGrid></div>\n </div>\n } @else {\n @if (grid.type == 'grid') {\n <custom-grid\n #customGrid\n [rowData]=\"getPrm.data?.[grid.subDataKey!]\"\n [upsert]=\"upsertPrm\"\n (deleteEmit)=\"delRows($event)\"\n [addType]=\"grid.subTableSource\"\n (addEmit)=\"dataSourceShow()\"\n [gridOptions]=\"grid.gridOptions\"\n [gridDisable]=\"gridDisable\"\n [authLevel]=\"authLevel()\"\n [showDelete]=\"grid.showDelete\"\n [subSaveVisible]=\"canShowCurrentTabSave(grid)\"\n [subSaveLabel]=\"getCurrentTabSaveLabel(grid)\"\n [subSaveDisabled]=\"gridDisable\"\n [selectData]=\"grid.selectData\"\n [addSort]=\"grid.addSort\"\n (subSaveEmit)=\"saveCurrentTab()\">\n </custom-grid>\n } @else {\n @if (canShowCurrentTabSave(grid)) {\n <div class=\"flex justify-end px-2 pt-2 bg-white\">\n <p-button\n icon=\"pi pi-cloud-upload\"\n [text]=\"true\"\n severity=\"primary\"\n [disabled]=\"gridDisable\"\n (onClick)=\"saveCurrentTab()\" />\n </div>\n }\n <custom-form\n #tabForm\n [options]=\"grid\"\n [upsert]=\"upsertPrm\"\n [model]=\"subFormModel[grid.subDataKey!] || {}\">\n </custom-form>\n }\n }\n </div>\n }\n </div>\n </div>\n @if (showLog()) {\n <div class=\"w-full lg:w-[400px] md:w-[300px] md:h-full md:overflow-y-auto hidden md:block\">\n <custom-log [logs]=\"getPrm.data?.log ?? []\"></custom-log>\n </div>\n }\n </div>\n }\n</div>\n<row-selector\n\t[(visible)]=\"visible\"\n\t[searchPrm]=\"dialogSearchPrm\"\n\t[gridOptions]=\"selectOptions\"\n\t[selectionKeys]=\"selectionKeys\"\n\t[selectModelCode]=\"currentSelectModelCode || undefined\"\n\t[customListFormByDialog]=\"currentCustomListFormTemplate\"\n\t[customListFormByDialogContext]=\"currentCustomListFormContext\"\n\t[customListDialogMap]=\"customListFormInstanceMap()\"\n\t(onOk)=\"onOk($event)\"\n\t(cancelSelect)=\"onCancelSelected($event)\">\n</row-selector>\n", styles: ["@charset \"UTF-8\";.main{height:calc(100vh - 128px)}:host ::ng-deep .main .ag-root-wrapper{border-left:none!important;border-right:none!important;border-bottom:none!important}:host ::ng-deep .form-action{background:#e7e9ed!important;color:var(--ag-text-color)!important;border-color:#e7e9ed!important}:host ::ng-deep .form-action:not(:disabled):hover{background-color:#d8dadd!important;border-color:#d8dadd}.form-panel{border:solid 1px #dbdbdb}.page-form-left-panel{height:100%}.icon-sidebar{color:#334155;padding:2.5px}.icon-sidebar:hover{color:var(--p-primary-color);cursor:pointer}\n"], dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "directive", type: i1$3.NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }, { kind: "ngmodule", type: ButtonModule }, { kind: "component", type: i2$3.Button, selector: "p-button", inputs: ["type", "iconPos", "icon", "badge", "label", "disabled", "loading", "loadingIcon", "raised", "rounded", "text", "plain", "severity", "outlined", "link", "tabindex", "size", "variant", "style", "styleClass", "badgeClass", "badgeSeverity", "ariaLabel", "autofocus", "fluid", "buttonProps"], outputs: ["onClick", "onFocus", "onBlur"] }, { kind: "ngmodule", type: FormsModule }, { kind: "directive", type: i3$1.ɵNgNoValidate, selector: "form:not([ngNoForm]):not([ngNativeValidate])" }, { kind: "directive", type: i3$1.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i3$1.NgControlStatusGroup, selector: "[formGroupName],[formArrayName],[ngModelGroup],[formGroup],form:not([ngNoForm]),[ngForm]" }, { kind: "directive", type: i3$1.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }, { kind: "ngmodule", type: ReactiveFormsModule }, { kind: "directive", type: i3$1.FormGroupDirective, selector: "[formGroup]", inputs: ["formGroup"], outputs: ["ngSubmit"], exportAs: ["ngForm"] }, { kind: "component", type: FormComponent, selector: "custom-form", inputs: ["options", "model", "upsert"] }, { kind: "component", type: LogComponent, selector: "custom-log", inputs: ["logs", "id"] }, { kind: "component", type: CrumbActionComponent, selector: "app-crumb-action", inputs: ["isShowCog", "addVisible", "importVisible", "exportVisible", "newUrl", "configNewPath", "onExport", "outlined", "isList", "authLevel", "actionList", "data", "menus", "saveBtnDisable", "showSaveButton"], outputs: ["saveEvent", "cancelEvent", "actionEvent"] }, { kind: "component", type: StepsComponent, selector: "custom-steps", inputs: ["modelLog", "needSelfAdjusting", "steps", "current", "authLevel", "isClick"], outputs: ["change"] }, { kind: "component", type: GridComponent, selector: "custom-grid", inputs: ["gridOptions", "selectionKeys", "upsert", "rowData", "searchPrm", "addType", "selectData", "showAct", "actPos", "authLevel", "showDelete", "gridDisable", "addSort", "subSaveVisible", "subSaveLabel", "subSaveDisabled"], outputs: ["deleteEmit", "addEmit", "subSaveEmit"] }, { kind: "ngmodule", type: TabsModule }, { kind: "component", type: i4.Tabs, selector: "p-tabs", inputs: ["value", "scrollable", "lazy", "selectOnFocus", "showNavigators", "tabindex"], outputs: ["valueChange"] }, { kind: "component", type: i4.TabList, selector: "p-tablist" }, { kind: "component", type: i4.Tab, selector: "p-tab", inputs: ["value", "disabled"], outputs: ["valueChange"] }, { kind: "component", type: RowSelectorComponent$1, selector: "row-selector", inputs: ["title", "selectionKeys", "gridOptions", "searchPrm", "visible", "showSearch", "selectModelCode", "customListFormByDialog", "customListFormByDialogContext", "customListDialogMap"], outputs: ["onOk", "visibleChange", "cancelSelect"] }, { kind: "pipe", type: TranslatePipe, name: "translate" }, { kind: "component", type: HrefBtnListComponent, selector: "href-btn-list", inputs: ["hrefs"], outputs: ["hrefClick"] }, { kind: "component", type: SingleSelectListboxComponent, selector: "am-single-select-listbox", inputs: ["options", "optionLabel", "optionValue", "disabled", "emptyMessage", "allowDeselect"], outputs: ["onChange"] }] }); }
|
|
11195
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "18.2.13", type: PageFormComponent, isStandalone: true, selector: "app-page-form", inputs: { addVisible: { classPropertyName: "addVisible", publicName: "addVisible", isSignal: true, isRequired: false, transformFunction: null }, gridList: { classPropertyName: "gridList", publicName: "gridList", isSignal: true, isRequired: false, transformFunction: null }, form: { classPropertyName: "form", publicName: "form", isSignal: true, isRequired: true, transformFunction: null }, getPrmInput: { classPropertyName: "getPrmInput", publicName: "getPrmInput", isSignal: true, isRequired: true, transformFunction: null }, statusSteps: { classPropertyName: "statusSteps", publicName: "statusSteps", isSignal: true, isRequired: false, transformFunction: null }, statusKey: { classPropertyName: "statusKey", publicName: "statusKey", isSignal: true, isRequired: false, transformFunction: null }, hrefBtnList: { classPropertyName: "hrefBtnList", publicName: "hrefBtnList", isSignal: true, isRequired: false, transformFunction: null }, setTitle: { classPropertyName: "setTitle", publicName: "setTitle", isSignal: true, isRequired: false, transformFunction: null }, actionList: { classPropertyName: "actionList", publicName: "actionList", isSignal: true, isRequired: false, transformFunction: null }, modelLog: { classPropertyName: "modelLog", publicName: "modelLog", isSignal: true, isRequired: false, transformFunction: null }, formDisabled: { classPropertyName: "formDisabled", publicName: "formDisabled", isSignal: true, isRequired: false, transformFunction: null }, statusConf: { classPropertyName: "statusConf", publicName: "statusConf", isSignal: true, isRequired: false, transformFunction: null }, formDetail: { classPropertyName: "formDetail", publicName: "formDetail", isSignal: true, isRequired: false, transformFunction: null }, saveFunc: { classPropertyName: "saveFunc", publicName: "saveFunc", isSignal: true, isRequired: false, transformFunction: null }, showMainSaveButton: { classPropertyName: "showMainSaveButton", publicName: "showMainSaveButton", isSignal: true, isRequired: false, transformFunction: null }, configNewPath: { classPropertyName: "configNewPath", publicName: "configNewPath", isSignal: true, isRequired: false, transformFunction: null }, runtimeContextInput: { classPropertyName: "runtimeContextInput", publicName: "runtimeContextInput", isSignal: true, isRequired: false, transformFunction: null }, customLeftPanel: { classPropertyName: "customLeftPanel", publicName: "customLeftPanel", isSignal: true, isRequired: false, transformFunction: null }, customListFormTemplateMap: { classPropertyName: "customListFormTemplateMap", publicName: "customListFormTemplateMap", isSignal: true, isRequired: false, transformFunction: null }, customListFormInstanceMap: { classPropertyName: "customListFormInstanceMap", publicName: "customListFormInstanceMap", isSignal: true, isRequired: false, transformFunction: null }, leftPanel: { classPropertyName: "leftPanel", publicName: "leftPanel", isSignal: true, isRequired: false, transformFunction: null }, panelSelectedData: { classPropertyName: "panelSelectedData", publicName: "panelSelectedData", isSignal: true, isRequired: false, transformFunction: null }, authLevel: { classPropertyName: "authLevel", publicName: "authLevel", isSignal: true, isRequired: false, transformFunction: null } }, host: { listeners: { "window:resize": "onResize()" } }, providers: [], queries: [{ propertyName: "pageFormSlots", predicate: PageFormSlotDirective, descendants: true }], viewQueries: [{ propertyName: "cForm", first: true, predicate: ["cForm"], descendants: true }, { propertyName: "rowSelector", first: true, predicate: RowSelectorComponent$1, descendants: true }, { propertyName: "customGrid", predicate: ["customGrid"], descendants: true }, { propertyName: "tabForm", predicate: ["tabForm"], descendants: true }], usesInheritance: true, ngImport: i0, template: "<div class=\"md:overflow-hidden\">\n <!-- \u4FDD\u5B58\u65B0\u5EFA\u64CD\u4F5C\u533A -->\n\t<div class=\"flex md:flex-wrap lg:flex-nowrap items-center md:justify-between py-1 px-1 border-b-[1px] border-[#dbdbdb] bg-white\">\n\t\t<div class=\"lg:basis-1/3 order-1\">\n\t\t\t<app-crumb-action\n\t\t\t\t[addVisible]=\"addVisible()\"\n\t\t\t\t[newUrl]=\"newUrl\"\n\t\t\t\t[isShowCog]=\"true\"\n\t\t\t\t[outlined]=\"true\"\n\t\t\t\t[authLevel]=\"authLevel()\"\n\t\t\t\t[actionList]=\"actionList()\"\n\t\t\t\t[configNewPath]=\"configNewPath()\"\n\t\t\t\t[data]=\"getPrm.data ?? {}\"\n\t\t\t\t[saveBtnDisable]=\"saveBtnDisable\"\n\t\t\t\t[showSaveButton]=\"showMainSaveButton()\"\n\t\t\t\t(actionEvent)=\"authClick($event)\"\n\t\t\t\t(saveEvent)=\"submitForm()\">\n\t\t\t</app-crumb-action>\n\t\t</div>\n\n\t\t<div class=\"basis-1/5 lg:basis-2/3 order-2 lg:order-2 md:order-last md:basis-full md:mt-[6px]\">\n\t\t\t<href-btn-list\n\t\t\t\t[hrefs]=\"hrefBtnList()\"\n\t\t\t\t(hrefClick)=\"goRun($event)\"></href-btn-list>\n\t\t\t<!-- @if (id) {\n\t\t\t\t@for (btn of hrefBtnList(); track btn) {\n\t\t\t\t\t<p-button\n\t\t\t\t\t\t[variant]=\"btn?.variant\"\n\t\t\t\t\t\t[severity]=\"btn?.severity\"\n\t\t\t\t\t\tclass=\"mr-[6px]\"\n\t\t\t\t\t\tsize=\"small\"\n\t\t\t\t\t\t[icon]=\"btn?.icon\"\n\t\t\t\t\t\tlabel=\"{{ btn.i18nKey ? i18n.fanyi(btn.i18nKey) : btn.label }}\"\n\t\t\t\t\t\t(click)=\"goRun(btn)\">\n\t\t\t\t\t</p-button>\n\t\t\t\t}\n\t\t\t} -->\n\t\t</div>\n\t\t<div class=\"basis-1/3 order-3 flex flex-row-reverse\">\n\t\t\t@if (modelLog()) {\n\t\t\t\t<div class=\"hidden md:block\">\n\t\t\t\t\t<span\n\t\t\t\t\t\t[class]=\"'iconfont icon-sidebar icon-sidebar-' + sidebarMode()\"\n\t\t\t\t\t\t(click)=\"toggleLog()\"></span>\n\t\t\t\t</div>\n\t\t\t}\n\t\t</div>\n\t</div>\n\t<div class=\"flex\">\n\t\t<div class=\"px-2 flex flex-wrap items-center flex-1\">\n\t\t\t<div class=\"hidden md:basis-1/3 py-1 basis-full md:flex items-center flex-row order-1\">\n\t\t\t\t@for (action of actionList(); let i = $index; track action) {\n\t\t\t\t\t<p-button\n\t\t\t\t\t\tsize=\"small\"\n\t\t\t\t\t\t[icon]=\"getPrm.data?.icon\"\n\t\t\t\t\t\t[loading]=\"action.loading\"\n\t\t\t\t\t\t[label]=\"action.i18nKey ? (action.i18nKey | translate) : action.label\"\n\t\t\t\t\t\t[disabled]=\"action.btnDisabled ? action.btnDisabled(getPrm.data) : false\"\n\t\t\t\t\t\t[styleClass]=\"\n\t\t\t\t\t\t\t(action.auth || 0) > (authLevel() || 0) || !!action.btnHidden?.(getPrm.data)\n\t\t\t\t\t\t\t\t? 'form-action hidden'\n\t\t\t\t\t\t\t\t: 'form-action block mr-[.5rem]'\n\t\t\t\t\t\t\"\n\t\t\t\t\t\t(onClick)=\"action.onClick != '' && action.onClick?.(getPrm.data, action)\">\n\t\t\t\t\t</p-button>\n\t\t\t\t}\n\t\t\t</div>\n\t\t\t<div class=\"md:basis-2/3 basis-full flex md:flex-row-reverse flex-row md:order-2 order-first w-full\">\n\t\t\t\t@if (stepsVisible) {\n\t\t\t\t\t<custom-steps\n\t\t\t\t\t\t#customSteps\n\t\t\t\t\t\tclass=\"w-full\"\n\t\t\t\t\t\t[steps]=\"statusSteps()\"\n\t\t\t\t\t\t[modelLog]=\"showLog()\"\n\t\t\t\t\t\t[current]=\"getPrm.data && getPrm.data[statusKey()] !== undefined ? getPrm.data[statusKey()] : 0\"\n\t\t\t\t\t\t[authLevel]=\"authLevel()\"\n\t\t\t\t\t\t[isClick]=\"this.statusConf().isClick\"\n\t\t\t\t\t\t(change)=\"statusChange($event, customSteps)\">\n\t\t\t\t\t</custom-steps>\n\t\t\t\t}\n\t\t\t</div>\n\t\t</div>\n\t\t@if (showLog()) {\n\t\t\t<div class=\"lg:w-[400px] md:w-[300px] hidden md:block\"></div>\n\t\t}\n\t</div>\n <!-- form \u4E3B\u533A\u57DF-->\n @if(this.form().form) {\n <div class=\"main flex flex-wrap\">\n @if (customLeftPanel()) {\n <div class=\"hidden md:block md:h-full md:overflow-y-auto md:flex-none md:w-fit md:max-w-full\">\n <ng-container *ngTemplateOutlet=\"customLeftPanel()\"></ng-container>\n </div>\n } @else if (leftPanel()?.enabled && leftPanel()?.mode === 'list') {\n <div class=\"hidden md:block md:h-full md:overflow-y-auto md:flex-none md:w-[220px] md:max-w-full px-2\">\n <div class=\"page-form-left-panel\">\n <am-single-select-listbox\n [options]=\"leftPanelItems\"\n [ngModel]=\"leftPanelSelectedValue\"\n (onChange)=\"onLeftPanelSelectionChange($event)\"\n [optionValue]=\"getPanelOptionValue()\"\n [optionLabel]=\"getPanelOptionLabel()\"\n [emptyMessage]=\"getPanelEmptyMessage()\"\n [allowDeselect]=\"getPanelAllowDeselect()\" />\n </div>\n </div>\n } @else if (leftPanel()?.enabled && leftPanel()?.mode === 'tree') {\n <div class=\"hidden md:block md:h-full md:overflow-y-auto md:flex-none md:w-[220px] md:max-w-full px-2\">\n <div class=\"page-form-left-panel page-form-tree-panel\">\n @if (leftPanelTreeNodes.length > 0) {\n <p-tree\n [value]=\"leftPanelTreeNodes\"\n selectionMode=\"single\"\n [(selection)]=\"leftPanelSelectedNode\"\n [emptyMessage]=\"getPanelEmptyMessage()\"\n styleClass=\"page-form-left-tree\"\n (onNodeSelect)=\"onLeftPanelTreeNodeSelect($event)\"\n (onNodeExpand)=\"onLeftPanelTreeNodeExpand($event)\"\n (onNodeCollapse)=\"onLeftPanelTreeNodeCollapse($event)\" />\n } @else {\n <div class=\"page-form-left-panel-empty\">{{ getPanelEmptyMessage() }}</div>\n }\n </div>\n </div>\n }\n <div class=\"w-full md:min-w-0 md:flex-1 md:h-full md:overflow-y-auto\">\n <div class=\"bg-white mx-2 form-panel\">\n <div class=\"p-2 flex-1\">\n <form [formGroup]=\"form().form!\">\n <custom-form\n #cForm\n [options]=\"formOptions\"\n [upsert]=\"upsertPrm\"\n [model]=\"getPrm.data ?? {}\"></custom-form>\n </form>\n </div>\n @if (grids && grids.length > 0) {\n <div class=\"relative mb-2\">\n <p-tabs [(value)]=\"indexValue\">\n <p-tablist>\n @for (fchild of grids; let i = $index; track fchild) {\n <p-tab\n [value]=\"i\"\n (click)=\"tabClick()\">\n {{ fchild.i18nKey ? i18n.fanyi(fchild.i18nKey) : fchild.title }}\n </p-tab>\n }\n </p-tablist>\n </p-tabs>\n </div>\n }\n @for (grid of grids; let i = $index; track grid) {\n @let slotState = slotRenderStates[i];\n @let slot = slotState?.slot;\n <div [hidden]=\"indexValue != i\" [style.height]=\"slot ? grid.gridOptions.scrollHeight : null\">\n @if (slot) {\n <ng-container *ngTemplateOutlet=\"slot.templateRef; context: slotState.context\"> </ng-container>\n <div class=\"flex justify-end py-[5px] pr-[8px] bg-white\">\n @if (canShowCurrentTabSave(grid)) {\n <p-button\n icon=\"pi pi-cloud-upload\"\n [text]=\"true\"\n severity=\"primary\"\n [disabled]=\"gridDisable\"\n (onClick)=\"saveCurrentTab()\" />\n }\n @if (grid.subTableSource != 'none') {\n <p-button\n icon=\"pi pi-plus\"\n [text]=\"true\"\n severity=\"success\"\n [disabled]=\"gridDisable\"\n (onClick)=\"addRowClickHandler(grid)\" />\n }\n @if (grid.showDelete) {\n <p-button\n icon=\"pi pi-trash\"\n [text]=\"true\"\n severity=\"danger\"\n [disabled]=\"gridDisable\"\n (onClick)=\"delRowClickHandler(grid)\" />\n }\n\t\t\t\t\t\t\t\t\t<div #customGrid></div>\n </div>\n } @else {\n @if (grid.type == 'grid') {\n <custom-grid\n #customGrid\n [rowData]=\"getPrm.data?.[grid.subDataKey!]\"\n [upsert]=\"upsertPrm\"\n (deleteEmit)=\"delRows($event)\"\n [addType]=\"grid.subTableSource\"\n (addEmit)=\"dataSourceShow()\"\n [gridOptions]=\"grid.gridOptions\"\n [gridDisable]=\"gridDisable\"\n [authLevel]=\"authLevel()\"\n [showDelete]=\"grid.showDelete\"\n [subSaveVisible]=\"canShowCurrentTabSave(grid)\"\n [subSaveLabel]=\"getCurrentTabSaveLabel(grid)\"\n [subSaveDisabled]=\"gridDisable\"\n [selectData]=\"grid.selectData\"\n [addSort]=\"grid.addSort\"\n (subSaveEmit)=\"saveCurrentTab()\">\n </custom-grid>\n } @else {\n @if (canShowCurrentTabSave(grid)) {\n <div class=\"flex justify-end px-2 pt-2 bg-white\">\n <p-button\n icon=\"pi pi-cloud-upload\"\n [text]=\"true\"\n severity=\"primary\"\n [disabled]=\"gridDisable\"\n (onClick)=\"saveCurrentTab()\" />\n </div>\n }\n <custom-form\n #tabForm\n [options]=\"grid\"\n [upsert]=\"upsertPrm\"\n [model]=\"subFormModel[grid.subDataKey!] || {}\">\n </custom-form>\n }\n }\n </div>\n }\n </div>\n </div>\n @if (showLog()) {\n <div class=\"w-full lg:w-[400px] md:w-[300px] md:h-full md:overflow-y-auto hidden md:block\">\n <custom-log [logs]=\"getPrm.data?.log ?? []\"></custom-log>\n </div>\n }\n </div>\n }\n</div>\n<row-selector\n\t[(visible)]=\"visible\"\n\t[searchPrm]=\"dialogSearchPrm\"\n\t[gridOptions]=\"selectOptions\"\n\t[selectionKeys]=\"selectionKeys\"\n\t[selectModelCode]=\"currentSelectModelCode || undefined\"\n\t[customListFormByDialog]=\"currentCustomListFormTemplate\"\n\t[customListFormByDialogContext]=\"currentCustomListFormContext\"\n\t[customListDialogMap]=\"customListFormInstanceMap()\"\n\t(onOk)=\"onOk($event)\"\n\t(cancelSelect)=\"onCancelSelected($event)\">\n</row-selector>\n", styles: ["@charset \"UTF-8\";.main{height:calc(100vh - 128px)}:host ::ng-deep .main .ag-root-wrapper{border-left:none!important;border-right:none!important;border-bottom:none!important}:host ::ng-deep .form-action{background:#e7e9ed!important;color:var(--ag-text-color)!important;border-color:#e7e9ed!important}:host ::ng-deep .form-action:not(:disabled):hover{background-color:#d8dadd!important;border-color:#d8dadd}:host ::ng-deep .page-form-left-tree{border:none!important;padding:0!important}.form-panel{border:solid 1px #dbdbdb}.page-form-left-panel{height:100%}.page-form-tree-panel{border:1px solid #e2e8f0;border-radius:4px;background:#fff;padding:4px}.page-form-left-panel-empty{display:flex;align-items:center;justify-content:center;min-height:160px;color:#94a3b8;font-size:12px}.icon-sidebar{color:#334155;padding:2.5px}.icon-sidebar:hover{color:var(--p-primary-color);cursor:pointer}\n"], dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "directive", type: i1$3.NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }, { kind: "ngmodule", type: ButtonModule }, { kind: "component", type: i2$3.Button, selector: "p-button", inputs: ["type", "iconPos", "icon", "badge", "label", "disabled", "loading", "loadingIcon", "raised", "rounded", "text", "plain", "severity", "outlined", "link", "tabindex", "size", "variant", "style", "styleClass", "badgeClass", "badgeSeverity", "ariaLabel", "autofocus", "fluid", "buttonProps"], outputs: ["onClick", "onFocus", "onBlur"] }, { kind: "ngmodule", type: FormsModule }, { kind: "directive", type: i3$1.ɵNgNoValidate, selector: "form:not([ngNoForm]):not([ngNativeValidate])" }, { kind: "directive", type: i3$1.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i3$1.NgControlStatusGroup, selector: "[formGroupName],[formArrayName],[ngModelGroup],[formGroup],form:not([ngNoForm]),[ngForm]" }, { kind: "directive", type: i3$1.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }, { kind: "ngmodule", type: ReactiveFormsModule }, { kind: "directive", type: i3$1.FormGroupDirective, selector: "[formGroup]", inputs: ["formGroup"], outputs: ["ngSubmit"], exportAs: ["ngForm"] }, { kind: "component", type: FormComponent, selector: "custom-form", inputs: ["options", "model", "upsert"] }, { kind: "component", type: LogComponent, selector: "custom-log", inputs: ["logs", "id"] }, { kind: "component", type: CrumbActionComponent, selector: "app-crumb-action", inputs: ["isShowCog", "addVisible", "importVisible", "exportVisible", "newUrl", "configNewPath", "onExport", "outlined", "isList", "authLevel", "actionList", "data", "menus", "saveBtnDisable", "showSaveButton"], outputs: ["saveEvent", "cancelEvent", "actionEvent"] }, { kind: "component", type: StepsComponent, selector: "custom-steps", inputs: ["modelLog", "needSelfAdjusting", "steps", "current", "authLevel", "isClick"], outputs: ["change"] }, { kind: "component", type: GridComponent, selector: "custom-grid", inputs: ["gridOptions", "selectionKeys", "upsert", "rowData", "searchPrm", "addType", "selectData", "showAct", "actPos", "authLevel", "showDelete", "gridDisable", "addSort", "subSaveVisible", "subSaveLabel", "subSaveDisabled"], outputs: ["deleteEmit", "addEmit", "subSaveEmit"] }, { kind: "ngmodule", type: TabsModule }, { kind: "component", type: i4.Tabs, selector: "p-tabs", inputs: ["value", "scrollable", "lazy", "selectOnFocus", "showNavigators", "tabindex"], outputs: ["valueChange"] }, { kind: "component", type: i4.TabList, selector: "p-tablist" }, { kind: "component", type: i4.Tab, selector: "p-tab", inputs: ["value", "disabled"], outputs: ["valueChange"] }, { kind: "component", type: RowSelectorComponent$1, selector: "row-selector", inputs: ["title", "selectionKeys", "gridOptions", "searchPrm", "visible", "showSearch", "selectModelCode", "customListFormByDialog", "customListFormByDialogContext", "customListDialogMap"], outputs: ["onOk", "visibleChange", "cancelSelect"] }, { kind: "pipe", type: TranslatePipe, name: "translate" }, { kind: "component", type: HrefBtnListComponent, selector: "href-btn-list", inputs: ["hrefs"], outputs: ["hrefClick"] }, { kind: "component", type: SingleSelectListboxComponent, selector: "am-single-select-listbox", inputs: ["options", "optionLabel", "optionValue", "disabled", "emptyMessage", "allowDeselect"], outputs: ["onChange"] }, { kind: "ngmodule", type: TreeModule }, { kind: "component", type: i2$8.Tree, selector: "p-tree", inputs: ["value", "selectionMode", "loadingMode", "selection", "style", "styleClass", "contextMenu", "draggableScope", "droppableScope", "draggableNodes", "droppableNodes", "metaKeySelection", "propagateSelectionUp", "propagateSelectionDown", "loading", "loadingIcon", "emptyMessage", "ariaLabel", "togglerAriaLabel", "ariaLabelledBy", "validateDrop", "filter", "filterBy", "filterMode", "filterOptions", "filterPlaceholder", "filteredNodes", "filterLocale", "scrollHeight", "lazy", "virtualScroll", "virtualScrollItemSize", "virtualScrollOptions", "indentation", "_templateMap", "trackBy", "highlightOnSelect", "virtualNodeHeight"], outputs: ["selectionChange", "onNodeSelect", "onNodeUnselect", "onNodeExpand", "onNodeCollapse", "onNodeContextMenuSelect", "onNodeDrop", "onLazyLoad", "onScroll", "onScrollIndexChange", "onFilter"] }] }); }
|
|
10763
11196
|
}
|
|
10764
11197
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: PageFormComponent, decorators: [{
|
|
10765
11198
|
type: Component,
|
|
@@ -10778,7 +11211,8 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.13", ngImpo
|
|
|
10778
11211
|
TranslatePipe,
|
|
10779
11212
|
HrefBtnListComponent,
|
|
10780
11213
|
SingleSelectListboxComponent,
|
|
10781
|
-
], providers: [], template: "<div class=\"md:overflow-hidden\">\n <!-- \u4FDD\u5B58\u65B0\u5EFA\u64CD\u4F5C\u533A -->\n\t<div class=\"flex md:flex-wrap lg:flex-nowrap items-center md:justify-between py-1 px-1 border-b-[1px] border-[#dbdbdb] bg-white\">\n\t\t<div class=\"lg:basis-1/3 order-1\">\n\t\t\t<app-crumb-action\n\t\t\t\t[addVisible]=\"addVisible()\"\n\t\t\t\t[newUrl]=\"newUrl\"\n\t\t\t\t[isShowCog]=\"true\"\n\t\t\t\t[outlined]=\"true\"\n\t\t\t\t[authLevel]=\"authLevel()\"\n\t\t\t\t[actionList]=\"actionList()\"\n\t\t\t\t[configNewPath]=\"configNewPath()\"\n\t\t\t\t[data]=\"getPrm.data ?? {}\"\n\t\t\t\t[saveBtnDisable]=\"saveBtnDisable\"\n\t\t\t\t[showSaveButton]=\"showMainSaveButton()\"\n\t\t\t\t(actionEvent)=\"authClick($event)\"\n\t\t\t\t(saveEvent)=\"submitForm()\">\n\t\t\t</app-crumb-action>\n\t\t</div>\n\n\t\t<div class=\"basis-1/5 lg:basis-2/3 order-2 lg:order-2 md:order-last md:basis-full md:mt-[6px]\">\n\t\t\t<href-btn-list\n\t\t\t\t[hrefs]=\"hrefBtnList()\"\n\t\t\t\t(hrefClick)=\"goRun($event)\"></href-btn-list>\n\t\t\t<!-- @if (id) {\n\t\t\t\t@for (btn of hrefBtnList(); track btn) {\n\t\t\t\t\t<p-button\n\t\t\t\t\t\t[variant]=\"btn?.variant\"\n\t\t\t\t\t\t[severity]=\"btn?.severity\"\n\t\t\t\t\t\tclass=\"mr-[6px]\"\n\t\t\t\t\t\tsize=\"small\"\n\t\t\t\t\t\t[icon]=\"btn?.icon\"\n\t\t\t\t\t\tlabel=\"{{ btn.i18nKey ? i18n.fanyi(btn.i18nKey) : btn.label }}\"\n\t\t\t\t\t\t(click)=\"goRun(btn)\">\n\t\t\t\t\t</p-button>\n\t\t\t\t}\n\t\t\t} -->\n\t\t</div>\n\t\t<div class=\"basis-1/3 order-3 flex flex-row-reverse\">\n\t\t\t@if (modelLog()) {\n\t\t\t\t<div class=\"hidden md:block\">\n\t\t\t\t\t<span\n\t\t\t\t\t\t[class]=\"'iconfont icon-sidebar icon-sidebar-' + sidebarMode()\"\n\t\t\t\t\t\t(click)=\"toggleLog()\"></span>\n\t\t\t\t</div>\n\t\t\t}\n\t\t</div>\n\t</div>\n\t<div class=\"flex\">\n\t\t<div class=\"px-2 flex flex-wrap items-center flex-1\">\n\t\t\t<div class=\"hidden md:basis-1/3 py-1 basis-full md:flex items-center flex-row order-1\">\n\t\t\t\t@for (action of actionList(); let i = $index; track action) {\n\t\t\t\t\t<p-button\n\t\t\t\t\t\tsize=\"small\"\n\t\t\t\t\t\t[icon]=\"getPrm.data?.icon\"\n\t\t\t\t\t\t[loading]=\"action.loading\"\n\t\t\t\t\t\t[label]=\"action.i18nKey ? (action.i18nKey | translate) : action.label\"\n\t\t\t\t\t\t[disabled]=\"action.btnDisabled ? action.btnDisabled(getPrm.data) : false\"\n\t\t\t\t\t\t[styleClass]=\"\n\t\t\t\t\t\t\t(action.auth || 0) > (authLevel() || 0) || !!action.btnHidden?.(getPrm.data)\n\t\t\t\t\t\t\t\t? 'form-action hidden'\n\t\t\t\t\t\t\t\t: 'form-action block mr-[.5rem]'\n\t\t\t\t\t\t\"\n\t\t\t\t\t\t(onClick)=\"action.onClick != '' && action.onClick?.(getPrm.data, action)\">\n\t\t\t\t\t</p-button>\n\t\t\t\t}\n\t\t\t</div>\n\t\t\t<div class=\"md:basis-2/3 basis-full flex md:flex-row-reverse flex-row md:order-2 order-first w-full\">\n\t\t\t\t@if (stepsVisible) {\n\t\t\t\t\t<custom-steps\n\t\t\t\t\t\t#customSteps\n\t\t\t\t\t\tclass=\"w-full\"\n\t\t\t\t\t\t[steps]=\"statusSteps()\"\n\t\t\t\t\t\t[modelLog]=\"showLog()\"\n\t\t\t\t\t\t[current]=\"getPrm.data && getPrm.data[statusKey()] !== undefined ? getPrm.data[statusKey()] : 0\"\n\t\t\t\t\t\t[authLevel]=\"authLevel()\"\n\t\t\t\t\t\t[isClick]=\"this.statusConf().isClick\"\n\t\t\t\t\t\t(change)=\"statusChange($event, customSteps)\">\n\t\t\t\t\t</custom-steps>\n\t\t\t\t}\n\t\t\t</div>\n\t\t</div>\n\t\t@if (showLog()) {\n\t\t\t<div class=\"lg:w-[400px] md:w-[300px] hidden md:block\"></div>\n\t\t}\n\t</div>\n <!-- form \u4E3B\u533A\u57DF-->\n @if(this.form().form) {\n <div class=\"main flex flex-wrap\">\n @if (customLeftPanel()) {\n <div class=\"hidden md:block md:h-full md:overflow-y-auto md:flex-none md:w-fit md:max-w-full\">\n <ng-container *ngTemplateOutlet=\"customLeftPanel()\"></ng-container>\n </div>\n } @else if (leftPanel()?.enabled && leftPanel()?.mode === 'list') {\n <div class=\"hidden md:block md:h-full md:overflow-y-auto md:flex-none md:w-[220px] md:max-w-full px-2\">\n <div class=\"page-form-left-panel\">\n <am-single-select-listbox\n [options]=\"leftPanelItems\"\n [ngModel]=\"leftPanelSelectedValue\"\n (onChange)=\"onLeftPanelSelectionChange($event)\"\n [optionValue]=\"leftPanel()?.list?.optionValue || 'value'\"\n [optionLabel]=\"leftPanel()?.list?.optionLabel || 'label'\"\n [emptyMessage]=\"leftPanel()?.list?.emptyMessage || '\u6682\u65E0\u6570\u636E'\"\n [allowDeselect]=\"leftPanel()?.list?.allowDeselect ?? true\" />\n </div>\n </div>\n }\n <div class=\"w-full md:min-w-0 md:flex-1 md:h-full md:overflow-y-auto\">\n <div class=\"bg-white mx-2 form-panel\">\n <div class=\"p-2 flex-1\">\n <form [formGroup]=\"form().form!\">\n <custom-form\n #cForm\n [options]=\"formOptions\"\n [upsert]=\"upsertPrm\"\n [model]=\"getPrm.data ?? {}\"></custom-form>\n </form>\n </div>\n @if (grids && grids.length > 0) {\n <div class=\"relative mb-2\">\n <p-tabs [(value)]=\"indexValue\">\n <p-tablist>\n @for (fchild of grids; let i = $index; track fchild) {\n <p-tab\n [value]=\"i\"\n (click)=\"tabClick()\">\n {{ fchild.i18nKey ? i18n.fanyi(fchild.i18nKey) : fchild.title }}\n </p-tab>\n }\n </p-tablist>\n </p-tabs>\n </div>\n }\n @for (grid of grids; let i = $index; track grid) {\n @let slotState = slotRenderStates[i];\n @let slot = slotState?.slot;\n <div [hidden]=\"indexValue != i\" [style.height]=\"slot ? grid.gridOptions.scrollHeight : null\">\n @if (slot) {\n <ng-container *ngTemplateOutlet=\"slot.templateRef; context: slotState.context\"> </ng-container>\n <div class=\"flex justify-end py-[5px] pr-[8px] bg-white\">\n @if (canShowCurrentTabSave(grid)) {\n <p-button\n icon=\"pi pi-cloud-upload\"\n [text]=\"true\"\n severity=\"primary\"\n [disabled]=\"gridDisable\"\n (onClick)=\"saveCurrentTab()\" />\n }\n @if (grid.subTableSource != 'none') {\n <p-button\n icon=\"pi pi-plus\"\n [text]=\"true\"\n severity=\"success\"\n [disabled]=\"gridDisable\"\n (onClick)=\"addRowClickHandler(grid)\" />\n }\n @if (grid.showDelete) {\n <p-button\n icon=\"pi pi-trash\"\n [text]=\"true\"\n severity=\"danger\"\n [disabled]=\"gridDisable\"\n (onClick)=\"delRowClickHandler(grid)\" />\n }\n\t\t\t\t\t\t\t\t\t<div #customGrid></div>\n </div>\n } @else {\n @if (grid.type == 'grid') {\n <custom-grid\n #customGrid\n [rowData]=\"getPrm.data?.[grid.subDataKey!]\"\n [upsert]=\"upsertPrm\"\n (deleteEmit)=\"delRows($event)\"\n [addType]=\"grid.subTableSource\"\n (addEmit)=\"dataSourceShow()\"\n [gridOptions]=\"grid.gridOptions\"\n [gridDisable]=\"gridDisable\"\n [authLevel]=\"authLevel()\"\n [showDelete]=\"grid.showDelete\"\n [subSaveVisible]=\"canShowCurrentTabSave(grid)\"\n [subSaveLabel]=\"getCurrentTabSaveLabel(grid)\"\n [subSaveDisabled]=\"gridDisable\"\n [selectData]=\"grid.selectData\"\n [addSort]=\"grid.addSort\"\n (subSaveEmit)=\"saveCurrentTab()\">\n </custom-grid>\n } @else {\n @if (canShowCurrentTabSave(grid)) {\n <div class=\"flex justify-end px-2 pt-2 bg-white\">\n <p-button\n icon=\"pi pi-cloud-upload\"\n [text]=\"true\"\n severity=\"primary\"\n [disabled]=\"gridDisable\"\n (onClick)=\"saveCurrentTab()\" />\n </div>\n }\n <custom-form\n #tabForm\n [options]=\"grid\"\n [upsert]=\"upsertPrm\"\n [model]=\"subFormModel[grid.subDataKey!] || {}\">\n </custom-form>\n }\n }\n </div>\n }\n </div>\n </div>\n @if (showLog()) {\n <div class=\"w-full lg:w-[400px] md:w-[300px] md:h-full md:overflow-y-auto hidden md:block\">\n <custom-log [logs]=\"getPrm.data?.log ?? []\"></custom-log>\n </div>\n }\n </div>\n }\n</div>\n<row-selector\n\t[(visible)]=\"visible\"\n\t[searchPrm]=\"dialogSearchPrm\"\n\t[gridOptions]=\"selectOptions\"\n\t[selectionKeys]=\"selectionKeys\"\n\t[selectModelCode]=\"currentSelectModelCode || undefined\"\n\t[customListFormByDialog]=\"currentCustomListFormTemplate\"\n\t[customListFormByDialogContext]=\"currentCustomListFormContext\"\n\t[customListDialogMap]=\"customListFormInstanceMap()\"\n\t(onOk)=\"onOk($event)\"\n\t(cancelSelect)=\"onCancelSelected($event)\">\n</row-selector>\n", styles: ["@charset \"UTF-8\";.main{height:calc(100vh - 128px)}:host ::ng-deep .main .ag-root-wrapper{border-left:none!important;border-right:none!important;border-bottom:none!important}:host ::ng-deep .form-action{background:#e7e9ed!important;color:var(--ag-text-color)!important;border-color:#e7e9ed!important}:host ::ng-deep .form-action:not(:disabled):hover{background-color:#d8dadd!important;border-color:#d8dadd}.form-panel{border:solid 1px #dbdbdb}.page-form-left-panel{height:100%}.icon-sidebar{color:#334155;padding:2.5px}.icon-sidebar:hover{color:var(--p-primary-color);cursor:pointer}\n"] }]
|
|
11214
|
+
TreeModule,
|
|
11215
|
+
], providers: [], template: "<div class=\"md:overflow-hidden\">\n <!-- \u4FDD\u5B58\u65B0\u5EFA\u64CD\u4F5C\u533A -->\n\t<div class=\"flex md:flex-wrap lg:flex-nowrap items-center md:justify-between py-1 px-1 border-b-[1px] border-[#dbdbdb] bg-white\">\n\t\t<div class=\"lg:basis-1/3 order-1\">\n\t\t\t<app-crumb-action\n\t\t\t\t[addVisible]=\"addVisible()\"\n\t\t\t\t[newUrl]=\"newUrl\"\n\t\t\t\t[isShowCog]=\"true\"\n\t\t\t\t[outlined]=\"true\"\n\t\t\t\t[authLevel]=\"authLevel()\"\n\t\t\t\t[actionList]=\"actionList()\"\n\t\t\t\t[configNewPath]=\"configNewPath()\"\n\t\t\t\t[data]=\"getPrm.data ?? {}\"\n\t\t\t\t[saveBtnDisable]=\"saveBtnDisable\"\n\t\t\t\t[showSaveButton]=\"showMainSaveButton()\"\n\t\t\t\t(actionEvent)=\"authClick($event)\"\n\t\t\t\t(saveEvent)=\"submitForm()\">\n\t\t\t</app-crumb-action>\n\t\t</div>\n\n\t\t<div class=\"basis-1/5 lg:basis-2/3 order-2 lg:order-2 md:order-last md:basis-full md:mt-[6px]\">\n\t\t\t<href-btn-list\n\t\t\t\t[hrefs]=\"hrefBtnList()\"\n\t\t\t\t(hrefClick)=\"goRun($event)\"></href-btn-list>\n\t\t\t<!-- @if (id) {\n\t\t\t\t@for (btn of hrefBtnList(); track btn) {\n\t\t\t\t\t<p-button\n\t\t\t\t\t\t[variant]=\"btn?.variant\"\n\t\t\t\t\t\t[severity]=\"btn?.severity\"\n\t\t\t\t\t\tclass=\"mr-[6px]\"\n\t\t\t\t\t\tsize=\"small\"\n\t\t\t\t\t\t[icon]=\"btn?.icon\"\n\t\t\t\t\t\tlabel=\"{{ btn.i18nKey ? i18n.fanyi(btn.i18nKey) : btn.label }}\"\n\t\t\t\t\t\t(click)=\"goRun(btn)\">\n\t\t\t\t\t</p-button>\n\t\t\t\t}\n\t\t\t} -->\n\t\t</div>\n\t\t<div class=\"basis-1/3 order-3 flex flex-row-reverse\">\n\t\t\t@if (modelLog()) {\n\t\t\t\t<div class=\"hidden md:block\">\n\t\t\t\t\t<span\n\t\t\t\t\t\t[class]=\"'iconfont icon-sidebar icon-sidebar-' + sidebarMode()\"\n\t\t\t\t\t\t(click)=\"toggleLog()\"></span>\n\t\t\t\t</div>\n\t\t\t}\n\t\t</div>\n\t</div>\n\t<div class=\"flex\">\n\t\t<div class=\"px-2 flex flex-wrap items-center flex-1\">\n\t\t\t<div class=\"hidden md:basis-1/3 py-1 basis-full md:flex items-center flex-row order-1\">\n\t\t\t\t@for (action of actionList(); let i = $index; track action) {\n\t\t\t\t\t<p-button\n\t\t\t\t\t\tsize=\"small\"\n\t\t\t\t\t\t[icon]=\"getPrm.data?.icon\"\n\t\t\t\t\t\t[loading]=\"action.loading\"\n\t\t\t\t\t\t[label]=\"action.i18nKey ? (action.i18nKey | translate) : action.label\"\n\t\t\t\t\t\t[disabled]=\"action.btnDisabled ? action.btnDisabled(getPrm.data) : false\"\n\t\t\t\t\t\t[styleClass]=\"\n\t\t\t\t\t\t\t(action.auth || 0) > (authLevel() || 0) || !!action.btnHidden?.(getPrm.data)\n\t\t\t\t\t\t\t\t? 'form-action hidden'\n\t\t\t\t\t\t\t\t: 'form-action block mr-[.5rem]'\n\t\t\t\t\t\t\"\n\t\t\t\t\t\t(onClick)=\"action.onClick != '' && action.onClick?.(getPrm.data, action)\">\n\t\t\t\t\t</p-button>\n\t\t\t\t}\n\t\t\t</div>\n\t\t\t<div class=\"md:basis-2/3 basis-full flex md:flex-row-reverse flex-row md:order-2 order-first w-full\">\n\t\t\t\t@if (stepsVisible) {\n\t\t\t\t\t<custom-steps\n\t\t\t\t\t\t#customSteps\n\t\t\t\t\t\tclass=\"w-full\"\n\t\t\t\t\t\t[steps]=\"statusSteps()\"\n\t\t\t\t\t\t[modelLog]=\"showLog()\"\n\t\t\t\t\t\t[current]=\"getPrm.data && getPrm.data[statusKey()] !== undefined ? getPrm.data[statusKey()] : 0\"\n\t\t\t\t\t\t[authLevel]=\"authLevel()\"\n\t\t\t\t\t\t[isClick]=\"this.statusConf().isClick\"\n\t\t\t\t\t\t(change)=\"statusChange($event, customSteps)\">\n\t\t\t\t\t</custom-steps>\n\t\t\t\t}\n\t\t\t</div>\n\t\t</div>\n\t\t@if (showLog()) {\n\t\t\t<div class=\"lg:w-[400px] md:w-[300px] hidden md:block\"></div>\n\t\t}\n\t</div>\n <!-- form \u4E3B\u533A\u57DF-->\n @if(this.form().form) {\n <div class=\"main flex flex-wrap\">\n @if (customLeftPanel()) {\n <div class=\"hidden md:block md:h-full md:overflow-y-auto md:flex-none md:w-fit md:max-w-full\">\n <ng-container *ngTemplateOutlet=\"customLeftPanel()\"></ng-container>\n </div>\n } @else if (leftPanel()?.enabled && leftPanel()?.mode === 'list') {\n <div class=\"hidden md:block md:h-full md:overflow-y-auto md:flex-none md:w-[220px] md:max-w-full px-2\">\n <div class=\"page-form-left-panel\">\n <am-single-select-listbox\n [options]=\"leftPanelItems\"\n [ngModel]=\"leftPanelSelectedValue\"\n (onChange)=\"onLeftPanelSelectionChange($event)\"\n [optionValue]=\"getPanelOptionValue()\"\n [optionLabel]=\"getPanelOptionLabel()\"\n [emptyMessage]=\"getPanelEmptyMessage()\"\n [allowDeselect]=\"getPanelAllowDeselect()\" />\n </div>\n </div>\n } @else if (leftPanel()?.enabled && leftPanel()?.mode === 'tree') {\n <div class=\"hidden md:block md:h-full md:overflow-y-auto md:flex-none md:w-[220px] md:max-w-full px-2\">\n <div class=\"page-form-left-panel page-form-tree-panel\">\n @if (leftPanelTreeNodes.length > 0) {\n <p-tree\n [value]=\"leftPanelTreeNodes\"\n selectionMode=\"single\"\n [(selection)]=\"leftPanelSelectedNode\"\n [emptyMessage]=\"getPanelEmptyMessage()\"\n styleClass=\"page-form-left-tree\"\n (onNodeSelect)=\"onLeftPanelTreeNodeSelect($event)\"\n (onNodeExpand)=\"onLeftPanelTreeNodeExpand($event)\"\n (onNodeCollapse)=\"onLeftPanelTreeNodeCollapse($event)\" />\n } @else {\n <div class=\"page-form-left-panel-empty\">{{ getPanelEmptyMessage() }}</div>\n }\n </div>\n </div>\n }\n <div class=\"w-full md:min-w-0 md:flex-1 md:h-full md:overflow-y-auto\">\n <div class=\"bg-white mx-2 form-panel\">\n <div class=\"p-2 flex-1\">\n <form [formGroup]=\"form().form!\">\n <custom-form\n #cForm\n [options]=\"formOptions\"\n [upsert]=\"upsertPrm\"\n [model]=\"getPrm.data ?? {}\"></custom-form>\n </form>\n </div>\n @if (grids && grids.length > 0) {\n <div class=\"relative mb-2\">\n <p-tabs [(value)]=\"indexValue\">\n <p-tablist>\n @for (fchild of grids; let i = $index; track fchild) {\n <p-tab\n [value]=\"i\"\n (click)=\"tabClick()\">\n {{ fchild.i18nKey ? i18n.fanyi(fchild.i18nKey) : fchild.title }}\n </p-tab>\n }\n </p-tablist>\n </p-tabs>\n </div>\n }\n @for (grid of grids; let i = $index; track grid) {\n @let slotState = slotRenderStates[i];\n @let slot = slotState?.slot;\n <div [hidden]=\"indexValue != i\" [style.height]=\"slot ? grid.gridOptions.scrollHeight : null\">\n @if (slot) {\n <ng-container *ngTemplateOutlet=\"slot.templateRef; context: slotState.context\"> </ng-container>\n <div class=\"flex justify-end py-[5px] pr-[8px] bg-white\">\n @if (canShowCurrentTabSave(grid)) {\n <p-button\n icon=\"pi pi-cloud-upload\"\n [text]=\"true\"\n severity=\"primary\"\n [disabled]=\"gridDisable\"\n (onClick)=\"saveCurrentTab()\" />\n }\n @if (grid.subTableSource != 'none') {\n <p-button\n icon=\"pi pi-plus\"\n [text]=\"true\"\n severity=\"success\"\n [disabled]=\"gridDisable\"\n (onClick)=\"addRowClickHandler(grid)\" />\n }\n @if (grid.showDelete) {\n <p-button\n icon=\"pi pi-trash\"\n [text]=\"true\"\n severity=\"danger\"\n [disabled]=\"gridDisable\"\n (onClick)=\"delRowClickHandler(grid)\" />\n }\n\t\t\t\t\t\t\t\t\t<div #customGrid></div>\n </div>\n } @else {\n @if (grid.type == 'grid') {\n <custom-grid\n #customGrid\n [rowData]=\"getPrm.data?.[grid.subDataKey!]\"\n [upsert]=\"upsertPrm\"\n (deleteEmit)=\"delRows($event)\"\n [addType]=\"grid.subTableSource\"\n (addEmit)=\"dataSourceShow()\"\n [gridOptions]=\"grid.gridOptions\"\n [gridDisable]=\"gridDisable\"\n [authLevel]=\"authLevel()\"\n [showDelete]=\"grid.showDelete\"\n [subSaveVisible]=\"canShowCurrentTabSave(grid)\"\n [subSaveLabel]=\"getCurrentTabSaveLabel(grid)\"\n [subSaveDisabled]=\"gridDisable\"\n [selectData]=\"grid.selectData\"\n [addSort]=\"grid.addSort\"\n (subSaveEmit)=\"saveCurrentTab()\">\n </custom-grid>\n } @else {\n @if (canShowCurrentTabSave(grid)) {\n <div class=\"flex justify-end px-2 pt-2 bg-white\">\n <p-button\n icon=\"pi pi-cloud-upload\"\n [text]=\"true\"\n severity=\"primary\"\n [disabled]=\"gridDisable\"\n (onClick)=\"saveCurrentTab()\" />\n </div>\n }\n <custom-form\n #tabForm\n [options]=\"grid\"\n [upsert]=\"upsertPrm\"\n [model]=\"subFormModel[grid.subDataKey!] || {}\">\n </custom-form>\n }\n }\n </div>\n }\n </div>\n </div>\n @if (showLog()) {\n <div class=\"w-full lg:w-[400px] md:w-[300px] md:h-full md:overflow-y-auto hidden md:block\">\n <custom-log [logs]=\"getPrm.data?.log ?? []\"></custom-log>\n </div>\n }\n </div>\n }\n</div>\n<row-selector\n\t[(visible)]=\"visible\"\n\t[searchPrm]=\"dialogSearchPrm\"\n\t[gridOptions]=\"selectOptions\"\n\t[selectionKeys]=\"selectionKeys\"\n\t[selectModelCode]=\"currentSelectModelCode || undefined\"\n\t[customListFormByDialog]=\"currentCustomListFormTemplate\"\n\t[customListFormByDialogContext]=\"currentCustomListFormContext\"\n\t[customListDialogMap]=\"customListFormInstanceMap()\"\n\t(onOk)=\"onOk($event)\"\n\t(cancelSelect)=\"onCancelSelected($event)\">\n</row-selector>\n", styles: ["@charset \"UTF-8\";.main{height:calc(100vh - 128px)}:host ::ng-deep .main .ag-root-wrapper{border-left:none!important;border-right:none!important;border-bottom:none!important}:host ::ng-deep .form-action{background:#e7e9ed!important;color:var(--ag-text-color)!important;border-color:#e7e9ed!important}:host ::ng-deep .form-action:not(:disabled):hover{background-color:#d8dadd!important;border-color:#d8dadd}:host ::ng-deep .page-form-left-tree{border:none!important;padding:0!important}.form-panel{border:solid 1px #dbdbdb}.page-form-left-panel{height:100%}.page-form-tree-panel{border:1px solid #e2e8f0;border-radius:4px;background:#fff;padding:4px}.page-form-left-panel-empty{display:flex;align-items:center;justify-content:center;min-height:160px;color:#94a3b8;font-size:12px}.icon-sidebar{color:#334155;padding:2.5px}.icon-sidebar:hover{color:var(--p-primary-color);cursor:pointer}\n"] }]
|
|
10782
11216
|
}], ctorParameters: () => [], propDecorators: { cForm: [{
|
|
10783
11217
|
type: ViewChild,
|
|
10784
11218
|
args: ['cForm']
|