imm-element-ui 2.4.7 → 2.4.9

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.
@@ -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) => {
@@ -4493,8 +4650,8 @@ class CodeMirrorComponent {
4493
4650
  '.cm-activeLineGutter': {
4494
4651
  backgroundColor: 'transparent',
4495
4652
  },
4496
- '&': { minHeight: this.props.minHeight ?? '88px', maxHeight: this.props.maxHeight || '204px' },
4497
- '.cm-scroller': { overflow: 'auto', minHeight: this.props.minHeight ?? '88px' },
4653
+ '&': { minHeight: this.props.minHeight ?? '68px', maxHeight: this.props.maxHeight || '204px' },
4654
+ '.cm-scroller': { overflow: 'auto', minHeight: this.props.minHeight ?? '68px' },
4498
4655
  }),
4499
4656
  this.getLanguageExtension(),
4500
4657
  EditorView.updateListener.of((update) => {
@@ -5980,6 +6137,46 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.13", ngImpo
5980
6137
  }]
5981
6138
  }] });
5982
6139
 
6140
+ class AsyncLinkRenderer {
6141
+ constructor() {
6142
+ this.router = inject(Router);
6143
+ }
6144
+ agInit(params) {
6145
+ this.params = params;
6146
+ this.optionsHook = params.optionsHook;
6147
+ this.triggerOptionsHook(params.value);
6148
+ }
6149
+ triggerOptionsHook(value) {
6150
+ if (this.optionsHook) {
6151
+ this.optionsHook(value).subscribe((res) => {
6152
+ this.label = res?.find((item) => item.value === value)?.label || '';
6153
+ });
6154
+ }
6155
+ }
6156
+ onLink() {
6157
+ const { url, queryParam } = this.params;
6158
+ if (url) {
6159
+ let urlStr = typeof url == 'function' ? url(this.params.data) : '';
6160
+ let query = typeof queryParam === 'function' ? queryParam(this.params.data) : {};
6161
+ urlStr !== '' && this.router.navigate([urlStr], { queryParams: query });
6162
+ }
6163
+ }
6164
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: AsyncLinkRenderer, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
6165
+ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "18.2.13", type: AsyncLinkRenderer, isStandalone: true, selector: "ng-component", providers: [AsyncPipe], ngImport: i0, template: ` <span
6166
+ class="cell-link"
6167
+ (click)="onLink()"
6168
+ >{{ label }}</span
6169
+ >`, isInline: true, styles: [".cell-link{color:var(--p-primary-color);cursor:pointer}\n"], dependencies: [{ kind: "ngmodule", type: CommonModule }] }); }
6170
+ }
6171
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: AsyncLinkRenderer, decorators: [{
6172
+ type: Component,
6173
+ args: [{ standalone: true, imports: [CommonModule], providers: [AsyncPipe], template: ` <span
6174
+ class="cell-link"
6175
+ (click)="onLink()"
6176
+ >{{ label }}</span
6177
+ >`, styles: [".cell-link{color:var(--p-primary-color);cursor:pointer}\n"] }]
6178
+ }] });
6179
+
5983
6180
  // rowModelType 使用clientSide的最大值
5984
6181
  const CLIENTLIMIT = 9999;
5985
6182
  const components = {
@@ -5994,7 +6191,8 @@ const components = {
5994
6191
  cellEditInputDateComponent: CellEditInputDateComponent,
5995
6192
  rowSpanRenderer: RowSpanRenderer,
5996
6193
  cellEditSelectFieldComponent: CellEditSelectFieldComponent,
5997
- primeActionsRenderer: PrimeActionsRenderer
6194
+ primeActionsRenderer: PrimeActionsRenderer,
6195
+ asyncLinkRenderer: AsyncLinkRenderer
5998
6196
  };
5999
6197
 
6000
6198
  const defaultOption = {
@@ -6070,10 +6268,10 @@ class GridComponent {
6070
6268
  this.noRows = true;
6071
6269
  this.showHorizontal = false;
6072
6270
  this.dragBeforeIndex = -1;
6073
- const searchPrm$ = toObservable(this.searchPrm).subscribe((searchPrm) => {
6271
+ this.searchPrmSub = toObservable(this.searchPrm).subscribe((searchPrm) => {
6074
6272
  if (searchPrm.modelName !== undefined) {
6075
6273
  this.rawPrm = searchPrm;
6076
- searchPrm$.unsubscribe();
6274
+ this.searchPrmSub.unsubscribe();
6077
6275
  }
6078
6276
  });
6079
6277
  effect(async () => {
@@ -6144,6 +6342,7 @@ class GridComponent {
6144
6342
  }
6145
6343
  ngAfterViewInit() { }
6146
6344
  ngOnDestroy() {
6345
+ this.searchPrmSub?.unsubscribe();
6147
6346
  if (this.horizontalScrollBarObserver) {
6148
6347
  this.horizontalScrollBarObserver.disconnect();
6149
6348
  }
@@ -8182,6 +8381,7 @@ class FormComponent {
8182
8381
  this.changedModel = {};
8183
8382
  this.hookObservers = [];
8184
8383
  this.labelMinWidth = signal(undefined);
8384
+ this.fallbackUpsert = { addData: {}, updData: {}, subsert: [], log: {} };
8185
8385
  this.isMain = true;
8186
8386
  this.extra = {};
8187
8387
  this.actions = inject(ActionService);
@@ -8198,7 +8398,8 @@ class FormComponent {
8198
8398
  effect(() => {
8199
8399
  let modelName = this.options().modelName || '';
8200
8400
  if (modelName != '') {
8201
- this.isMain = !this.upsert()?.subsert?.find((v) => v.subModelName === modelName);
8401
+ const upsert = this.getUpsertState();
8402
+ this.isMain = !upsert.subsert?.find((v) => v.subModelName === modelName);
8202
8403
  if (!this.isMain) {
8203
8404
  this.subsert = {
8204
8405
  subModelName: modelName,
@@ -8207,7 +8408,7 @@ class FormComponent {
8207
8408
  maptmp: new Map(),
8208
8409
  logtmp: new Map(),
8209
8410
  };
8210
- this.upsert()?.subsert?.push(this.subsert);
8411
+ upsert.subsert?.push(this.subsert);
8211
8412
  }
8212
8413
  }
8213
8414
  }, { allowSignalWrites: true });
@@ -8345,16 +8546,25 @@ class FormComponent {
8345
8546
  this.handleHideExpression();
8346
8547
  this.actions.saveSignal.set(true);
8347
8548
  }
8549
+ getUpsertState() {
8550
+ const upsert = this.upsert() ?? this.fallbackUpsert;
8551
+ upsert.addData ??= {};
8552
+ upsert.updData ??= {};
8553
+ upsert.subsert ??= [];
8554
+ upsert.log ??= {};
8555
+ return upsert;
8556
+ }
8348
8557
  handleUpsert(key, value, isLog) {
8558
+ const upsert = this.getUpsertState();
8349
8559
  if (this.isNew) {
8350
- fieldUtils.setModel(this.upsert().addData, key, value);
8560
+ fieldUtils.setModel(upsert.addData, key, value);
8351
8561
  }
8352
8562
  else {
8353
- fieldUtils.setModel(this.upsert().updData, key, value);
8563
+ fieldUtils.setModel(upsert.updData, key, value);
8354
8564
  }
8355
8565
  if (!isLog)
8356
8566
  return;
8357
- this.upsert().log.content = fieldUtils.transLog(this.rawModel, this.changedModel, this.model()[this.options().mainField], this.isNew, this.i18nService);
8567
+ upsert.log.content = fieldUtils.transLog(this.rawModel, this.changedModel, this.model()[this.options().mainField], this.isNew, this.i18nService);
8358
8568
  }
8359
8569
  handleSubsert(key, value, field) {
8360
8570
  const changedModel = Object.fromEntries(Object.entries(this.changedModel).map(([key, value]) => [key, value.value]));
@@ -9697,9 +9907,13 @@ class PageFormComponent extends AmComponent {
9697
9907
  this.selectionKeys = [];
9698
9908
  this.subDeleteIds = [];
9699
9909
  this.leftPanelItems = [];
9910
+ this.leftPanelTreeNodes = [];
9911
+ this.leftPanelSelectedNode = null;
9700
9912
  this.leftPanelSelectedValue = null;
9701
9913
  this.leftPanelSelectedItem = null;
9914
+ this.leftPanelExpandedKeys = {};
9702
9915
  this.leftPanelInitialized = false;
9916
+ this.leftPanelInitializedMode = null;
9703
9917
  this.baseGridListSnapshot = [];
9704
9918
  this.stepsVisible = true;
9705
9919
  this.destroy$ = new Subject();
@@ -9769,19 +9983,17 @@ class PageFormComponent extends AmComponent {
9769
9983
  }, { allowSignalWrites: true });
9770
9984
  effect(() => {
9771
9985
  const panel = this.leftPanel();
9772
- if (!panel?.enabled || panel.mode !== 'list') {
9773
- this.leftPanelInitialized = false;
9774
- this.leftPanelItems = [];
9775
- this.leftPanelSelectedValue = null;
9776
- this.leftPanelSelectedItem = null;
9777
- this.gridListOverridden = false;
9778
- this.internalGridList.set(this.gridList());
9779
- this.syncUpsertSubserts();
9986
+ if (!panel?.enabled) {
9987
+ this.resetLeftPanelState();
9780
9988
  return;
9781
9989
  }
9782
- if (this.leftPanelInitialized) {
9990
+ const currentMode = this.getLeftPanelMode();
9991
+ if (this.leftPanelInitialized && this.leftPanelInitializedMode === currentMode) {
9783
9992
  return;
9784
9993
  }
9994
+ if (this.leftPanelInitializedMode && this.leftPanelInitializedMode !== currentMode) {
9995
+ this.resetLeftPanelState();
9996
+ }
9785
9997
  queueMicrotask(() => {
9786
9998
  this.initializeLeftPanel();
9787
9999
  });
@@ -9804,29 +10016,51 @@ class PageFormComponent extends AmComponent {
9804
10016
  this.destroy$.next();
9805
10017
  this.destroy$.complete();
9806
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
+ }
9807
10033
  async initializeLeftPanel() {
9808
10034
  const panel = this.leftPanel();
9809
- if (!panel?.enabled || panel.mode !== 'list') {
10035
+ if (!panel?.enabled) {
9810
10036
  return;
9811
10037
  }
9812
10038
  this.leftPanelInitialized = true;
9813
- this.baseGridListSnapshot = deepClone(this.gridList(), this);
9814
- const dataSource = panel.list?.dataSource;
10039
+ this.leftPanelInitializedMode = this.getLeftPanelMode();
10040
+ this.baseGridListSnapshot = this.gridList().map((item) => item);
10041
+ const dataSource = this.getPanelDataSource();
9815
10042
  this.runLeftPanelEvent('onInit');
9816
10043
  const items = await this.loadLeftPanelItems(dataSource);
9817
10044
  this.leftPanelItems = items;
9818
- 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) {
9819
10053
  let defaultValue = await this.resolveMaybeAsync(typeof dataSource?.defaultSelect === 'function'
9820
10054
  ? dataSource.defaultSelect(this.createLeftPanelEventContext({ items }))
9821
10055
  : dataSource?.defaultSelect);
9822
10056
  if (defaultValue && typeof defaultValue === 'object') {
9823
- defaultValue = this.resolveLeftPanelValue(defaultValue);
10057
+ defaultValue = this.resolvePanelOptionValue(defaultValue);
9824
10058
  }
9825
- if ((defaultValue === undefined || defaultValue === null) && panel.list?.allowDeselect === false && items.length > 0) {
9826
- defaultValue = this.resolveLeftPanelValue(items[0]);
10059
+ if ((defaultValue === undefined || defaultValue === null) && this.getPanelAllowDeselect() === false && items.length > 0) {
10060
+ defaultValue = this.resolvePanelOptionValue(items[0]);
9827
10061
  }
9828
10062
  if (defaultValue !== undefined && defaultValue !== null) {
9829
- await this.applyLeftPanelSelection(defaultValue, items.find((item) => this.resolveLeftPanelValue(item) === defaultValue));
10063
+ await this.applyLeftPanelSelection(defaultValue, items.find((item) => this.resolvePanelOptionValue(item) === defaultValue));
9830
10064
  return;
9831
10065
  }
9832
10066
  this.cdr.markForCheck();
@@ -9847,6 +10081,39 @@ class PageFormComponent extends AmComponent {
9847
10081
  }
9848
10082
  return Array.isArray(result) ? result : [];
9849
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
+ }
9850
10117
  async resolveMaybeAsync(value) {
9851
10118
  if (isObservable(value)) {
9852
10119
  return await firstValueFrom(value);
@@ -9859,7 +10126,7 @@ class PageFormComponent extends AmComponent {
9859
10126
  createLeftPanelEventContext(extra = {}) {
9860
10127
  return {
9861
10128
  pageForm: this,
9862
- mode: this.leftPanel()?.mode,
10129
+ mode: this.getLeftPanelMode(),
9863
10130
  selectedItem: this.leftPanelSelectedItem,
9864
10131
  selectedValue: this.leftPanelSelectedValue,
9865
10132
  items: this.leftPanelItems,
@@ -9884,38 +10151,37 @@ class PageFormComponent extends AmComponent {
9884
10151
  }
9885
10152
  return handler(this.createLeftPanelEventContext(extra));
9886
10153
  }
9887
- resolveLeftPanelValue(option) {
9888
- const optionValue = this.leftPanel()?.list?.optionValue || 'value';
10154
+ resolvePanelOptionValue(option) {
10155
+ const optionValue = this.getPanelOptionValue();
9889
10156
  if (!optionValue) {
9890
10157
  return option;
9891
10158
  }
9892
10159
  return fieldUtils.getModel(option, optionValue);
9893
10160
  }
9894
10161
  async onLeftPanelSelectionChange(event) {
9895
- if (event.value == null) {
10162
+ if (event.value == null && this.getPanelAllowDeselect()) {
9896
10163
  return;
9897
10164
  }
9898
10165
  await this.applyLeftPanelSelection(event.value, event.option);
9899
10166
  }
9900
10167
  async applyLeftPanelSelection(value, option) {
9901
10168
  const panel = this.leftPanel();
9902
- if (!panel?.enabled || panel.mode !== 'list') {
10169
+ if (!panel?.enabled || this.getLeftPanelMode() !== 'list') {
9903
10170
  return;
9904
10171
  }
9905
- const selectedItem = option ?? this.leftPanelItems.find((item) => this.resolveLeftPanelValue(item) === value) ?? null;
10172
+ const selectedItem = option ?? this.leftPanelItems.find((item) => this.resolvePanelOptionValue(item) === value) ?? null;
9906
10173
  this.leftPanelSelectedValue = value;
9907
10174
  this.leftPanelSelectedItem = selectedItem;
9908
- if (!this.getPrm.data) {
9909
- this.getPrm.data = {};
9910
- }
9911
- if (panel.stateKey) {
9912
- fieldUtils.setModel(this.getPrm.data, panel.stateKey, value);
9913
- }
9914
- if (panel.panelSelectedDataKey) {
9915
- fieldUtils.setModel(this.getPrm.data, panel.panelSelectedDataKey, selectedItem);
9916
- }
10175
+ this.syncLeftPanelSelectionState(value, selectedItem);
9917
10176
  this.indexValue = 0;
9918
- this.runLeftPanelEvent('onSelectionChange', { selectedItem, selectedValue: value });
10177
+ this.runLeftPanelEvent('onSelectionChange', {
10178
+ selectedItem,
10179
+ selectedValue: value,
10180
+ node: null,
10181
+ rawNode: null,
10182
+ isParent: false,
10183
+ isLeaf: true,
10184
+ });
9919
10185
  this.syncGetPrmFiterPreloads();
9920
10186
  this.formOptions = this.buildFormOptions();
9921
10187
  if (this.id && this.modelName) {
@@ -9941,6 +10207,226 @@ class PageFormComponent extends AmComponent {
9941
10207
  }
9942
10208
  this.syncGetPrmFiterPreloads();
9943
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
+ }
9944
10430
  buildFormOptions() {
9945
10431
  try {
9946
10432
  const sourceForm = this.form();
@@ -10256,7 +10742,7 @@ class PageFormComponent extends AmComponent {
10256
10742
  dataSourceShow() {
10257
10743
  const grid = this.resolvedGridList()[this.indexValue];
10258
10744
  this.currentSelectModelCode = grid?.selectModelCode || null;
10259
- console.log(`dataSourceShow`, grid);
10745
+ console.log(`dataSourceShow`, this.gridList(), this.resolvedGridList());
10260
10746
  this.dialogSearchPrm = {};
10261
10747
  this.selectOptions = this.resolvedGridList()[this.indexValue]['selectOptions'];
10262
10748
  if (this.selectOptions?.searchPrm) {
@@ -10706,7 +11192,7 @@ class PageFormComponent extends AmComponent {
10706
11192
  }
10707
11193
  }
10708
11194
  static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: PageFormComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
10709
- 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"] }] }); }
10710
11196
  }
10711
11197
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: PageFormComponent, decorators: [{
10712
11198
  type: Component,
@@ -10725,7 +11211,8 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.13", ngImpo
10725
11211
  TranslatePipe,
10726
11212
  HrefBtnListComponent,
10727
11213
  SingleSelectListboxComponent,
10728
- ], 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"] }]
10729
11216
  }], ctorParameters: () => [], propDecorators: { cForm: [{
10730
11217
  type: ViewChild,
10731
11218
  args: ['cForm']