@oinone/kunlun-vue-admin-base 6.2.1 → 6.2.3

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.
@@ -16,6 +16,7 @@ export declare class ServerActionWidget extends ActionWidget<RuntimeServerAction
16
16
  protected clickAction(): Promise<ClickResult>;
17
17
  protected formValidateProcess(e: HttpClientError): void;
18
18
  protected convertFormValidateResults(e: HttpClientError): FormValidateResult[];
19
+ protected notifyValidateResults(e: HttpClientError): void;
19
20
  protected submit(action: RuntimeServerAction): Promise<SubmitValue>;
20
21
  protected clickActionAfter(result: ClickResult): Promise<ClickResult>;
21
22
  protected clickActionAfterRefreshData(result: ClickResult, refreshParent?: boolean): Promise<ClickResult>;
@@ -47,7 +47,7 @@ declare const _default: import("vue").DefineComponent<{
47
47
  default: boolean;
48
48
  };
49
49
  layout: {
50
- type: PropType<import("@oinone/kunlun-vue-ui-common").FormLayout>;
50
+ type: PropType<import("@oinone/kunlun-vue-ui-antd").FormLayout>;
51
51
  };
52
52
  label: {
53
53
  type: (BooleanConstructor | StringConstructor)[];
@@ -141,7 +141,7 @@ declare const _default: import("vue").DefineComponent<{
141
141
  default: boolean;
142
142
  };
143
143
  layout: {
144
- type: PropType<import("@oinone/kunlun-vue-ui-common").FormLayout>;
144
+ type: PropType<import("@oinone/kunlun-vue-ui-antd").FormLayout>;
145
145
  };
146
146
  label: {
147
147
  type: (BooleanConstructor | StringConstructor)[];
@@ -18,7 +18,10 @@ export declare class TableWidget<Props extends TableWidgetProps = TableWidgetPro
18
18
  protected get checkbox(): boolean;
19
19
  protected get lineHeight(): number | undefined;
20
20
  protected get minLineHeight(): number | undefined;
21
- protected get autoLineHeight(): boolean | undefined;
21
+ /**
22
+ * 表格行高是否自适应,默认开启
23
+ */
24
+ protected get autoLineHeight(): boolean;
22
25
  protected get enableSequence(): boolean;
23
26
  protected get defaultPageSize(): number;
24
27
  protected get activeCount(): number | undefined;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@oinone/kunlun-vue-admin-base",
3
- "version": "6.2.1",
3
+ "version": "6.2.3",
4
4
  "main": "index.ts",
5
5
  "scripts": {
6
6
  "prebuild": "rimraf dist",
@@ -14,13 +14,13 @@
14
14
  "doc": "typedoc --out docs src/index.ts"
15
15
  },
16
16
  "dependencies": {
17
- "@oinone/kunlun-vue-admin-layout": "6.2.1",
18
- "@oinone/kunlun-vue-router": "6.2.1",
19
- "@oinone/kunlun-vue-ui": "6.2.1",
20
- "@oinone/kunlun-vue-ui-antd": "6.2.1",
21
- "@oinone/kunlun-vue-ui-common": "6.2.1",
22
- "@oinone/kunlun-vue-ui-el": "6.2.1",
23
- "@oinone/kunlun-vue-widget": "6.2.1",
17
+ "@oinone/kunlun-vue-admin-layout": "6.2.3",
18
+ "@oinone/kunlun-vue-router": "6.2.3",
19
+ "@oinone/kunlun-vue-ui": "6.2.3",
20
+ "@oinone/kunlun-vue-ui-antd": "6.2.3",
21
+ "@oinone/kunlun-vue-ui-common": "6.2.3",
22
+ "@oinone/kunlun-vue-ui-el": "6.2.3",
23
+ "@oinone/kunlun-vue-widget": "6.2.3",
24
24
  "@wangeditor/editor": "5.1.23",
25
25
  "@wangeditor/editor-for-vue": "5.1.11",
26
26
  "@wangeditor/plugin-upload-attachment": "1.1.0",
@@ -61,5 +61,5 @@
61
61
  "element-plus": ">=2.2.17",
62
62
  "vue": ">=3.2.40"
63
63
  },
64
- "gitHead": "ad1e6c63539b7d6baf64cf209f100b1c0bcc2d53"
64
+ "gitHead": "2b4c0c7911626c105ca71c2d41e54af470e2e079"
65
65
  }
@@ -23,7 +23,7 @@ import {
23
23
  UpdateOneWithRelationsService
24
24
  } from '@oinone/kunlun-engine';
25
25
  import { ActionContextType, ActionType, ModelFieldType, ViewType } from '@oinone/kunlun-meta';
26
- import { HttpClientError, SystemErrorCode } from '@oinone/kunlun-request';
26
+ import { HttpClientError, MessageHub, RequestErrorInterceptor, SystemErrorCode } from '@oinone/kunlun-request';
27
27
  import { SPI } from '@oinone/kunlun-spi';
28
28
  import { BooleanHelper, CallChaining, debugConsole, OioNotification } from '@oinone/kunlun-vue-ui-antd';
29
29
  import { VueWidget, Widget, WidgetSubjection } from '@oinone/kunlun-vue-widget';
@@ -101,6 +101,7 @@ export class ServerActionWidget extends ActionWidget<RuntimeServerAction> {
101
101
 
102
102
  protected formValidateProcess(e: HttpClientError) {
103
103
  if (this.view?.type !== ViewType.Form) {
104
+ this.notifyValidateResults(e);
104
105
  return;
105
106
  }
106
107
  const { formValidateCallChaining } = this;
@@ -141,6 +142,21 @@ export class ServerActionWidget extends ActionWidget<RuntimeServerAction> {
141
142
  return results;
142
143
  }
143
144
 
145
+ protected notifyValidateResults(e: HttpClientError): void {
146
+ const error = e.errors?.[0];
147
+ if (!error) {
148
+ return;
149
+ }
150
+ if (error.extensions?.errorCode !== SystemErrorCode.FORM_VALIDATE_ERROR) {
151
+ return;
152
+ }
153
+ for (const messageItem of error.extensions?.messages || []) {
154
+ if (RequestErrorInterceptor.ignoredFormValidateMessage(messageItem)) {
155
+ MessageHub.error(messageItem.message);
156
+ }
157
+ }
158
+ }
159
+
144
160
  protected async submit(action: RuntimeServerAction): Promise<SubmitValue> {
145
161
  let records: ActiveRecords | undefined;
146
162
  let relationRecords: SubmitRelationValue[] | undefined;
@@ -58,11 +58,17 @@ export default defineComponent({
58
58
  origin: 'default',
59
59
  default: ({ realValue }) => {
60
60
  return [
61
- createVNode('div', {
62
- class: 'detail-common-field-value',
63
- title: realValue,
64
- innerHTML: realValue.replace(/\r?\n/g, '<br/>')
65
- })
61
+ createVNode(
62
+ 'div',
63
+ {
64
+ class: 'detail-common-field-value',
65
+ title: realValue,
66
+ style: {
67
+ whiteSpace: 'pre-line'
68
+ }
69
+ },
70
+ realValue
71
+ )
66
72
  ];
67
73
  }
68
74
  },
@@ -26,7 +26,7 @@ export class FormHtmlRichTextFieldWidget extends FormStringFieldWidget {
26
26
  protected get richTextToolbarExcludeKeys(): string[] | null {
27
27
  const { richTextToolbarExcludeKeys } = this.getDsl() as { richTextToolbarExcludeKeys?: string };
28
28
  if (!richTextToolbarExcludeKeys) {
29
- return null;
29
+ return [];
30
30
  }
31
31
 
32
32
  return richTextToolbarExcludeKeys.split(',').map((v) => v.trim());
@@ -18,10 +18,13 @@ export class TableTextFieldWidget extends TableStringFieldWidget {
18
18
  const value = this.compute(context);
19
19
 
20
20
  return [
21
- createVNode('span', {
22
- // innerHTML: value ? value.replace(/\r?\n/g, '<br/>') : ''
23
- innerHTML: value
24
- })
21
+ createVNode(
22
+ 'span',
23
+ {
24
+ class: 'table-text-field-value'
25
+ },
26
+ value
27
+ )
25
28
  ];
26
29
  }
27
30
  }
@@ -56,15 +56,16 @@
56
56
  align-items: center;
57
57
  }
58
58
 
59
- .ant-tree-treenode {
60
- width: 100%;
59
+ .ant-tree-list-holder-inner {
60
+ display: block !important;
61
61
  }
62
62
 
63
63
  .ant-tree-checkbox {
64
64
  margin-top: 12px;
65
65
  }
66
66
 
67
- .ant-tree-treenode-selected {
67
+ .permission-menu .ant-tree-treenode-selected,
68
+ .permission-menu .ant-tree-treenode:hover {
68
69
  background: var(--oio-menu-selected-background-color);
69
70
  border-radius: 4px;
70
71
  .ant-tree-title {
@@ -72,7 +73,7 @@
72
73
  }
73
74
  }
74
75
 
75
- .ant-tree .ant-tree-node-content-wrapper:hover {
76
+ .oio-tree.ant-tree .ant-tree-node-content-wrapper:hover {
76
77
  background-color: transparent;
77
78
  }
78
79
 
@@ -116,7 +117,7 @@
116
117
  margin-bottom: 10px;
117
118
  }
118
119
 
119
- .oio-tabs{
120
+ .oio-tabs {
120
121
  .oio-tab-content {
121
122
  padding: 0;
122
123
  }
@@ -486,11 +487,11 @@
486
487
  }
487
488
 
488
489
  .permission-dialog-content {
489
- .oio-modal{
490
+ .oio-modal {
490
491
  .ant-modal-body {
491
492
  padding: 0 0 var(--oio-margin-md) 0;
492
493
  position: relative;
493
-
494
+
494
495
  .oio-tabs.ant-tabs-top .ant-tabs-nav .ant-tabs-tab {
495
496
  padding: calc(var(--oio-padding) / 2);
496
497
  border-top: none;
@@ -498,7 +499,7 @@
498
499
  border-bottom: none;
499
500
  }
500
501
  }
501
-
502
+
502
503
  .permission-mode-switch {
503
504
  position: absolute;
504
505
  right: var(--oio-margin);
@@ -511,22 +512,27 @@
511
512
  }
512
513
  }
513
514
  }
514
-
515
+
516
+ .ant-spin-container {
517
+ width: 100%;
518
+ overflow-x: hidden;
519
+ }
520
+
515
521
  .oio-tree {
516
522
  max-height: 55vh;
517
523
  overflow-y: scroll;
518
524
  }
519
-
525
+
520
526
  .data-permission-tab {
521
527
  &-label {
522
528
  font-weight: bold;
523
529
  font-size: 16px;
524
530
  }
525
-
531
+
526
532
  .oio-tab {
527
533
  padding: var(--oio-padding) 0 var(--oio-padding) 0;
528
534
  }
529
-
535
+
530
536
  .data-permission-rsql,
531
537
  .data-permission-operator {
532
538
  color: var(--oio-text-color-secondary);
@@ -29,9 +29,9 @@ let titleCache: Record<string, string> | undefined;
29
29
  function getNotificationTitle(type: string): string {
30
30
  if (!titleCache) {
31
31
  titleCache = {};
32
- for (const item of typeof NotificationType) {
33
- const key = `kunlun.common.${type}`;
34
- titleCache[type] = translateValueByKey(getValue(zh_CN, key) as string);
32
+ for (const item in NotificationType) {
33
+ const key = `kunlun.common.${item}`;
34
+ titleCache[item] = translateValueByKey(getValue(zh_CN, key) as string);
35
35
  }
36
36
  }
37
37
  return titleCache[type] as string;
@@ -515,10 +515,14 @@ export default defineComponent({
515
515
 
516
516
  rows.forEach((row, index) => {
517
517
  const height = row.clientHeight;
518
+ row.style.height = 'auto';
518
519
 
519
520
  const leftFixedRow = leftFixedRows[index];
520
521
  const rightFixedRow = rightFixedRows[index];
521
522
 
523
+ leftFixedRow && (leftFixedRow.style.height = 'auto');
524
+ rightFixedRow && (rightFixedRow.style.height = 'auto');
525
+
522
526
  const maxHeight = Math.max(
523
527
  height || 0,
524
528
  leftFixedRow?.clientHeight || 0,
@@ -589,8 +593,6 @@ export default defineComponent({
589
593
  if (v && v.length) {
590
594
  nextTick(() => {
591
595
  calcTableColumnHeight();
592
-
593
- stop();
594
596
  });
595
597
  }
596
598
  },
@@ -114,11 +114,12 @@ export class TableWidget<Props extends TableWidgetProps = TableWidgetProps> exte
114
114
  return undefined;
115
115
  }
116
116
 
117
+ /**
118
+ * 表格行高是否自适应,默认开启
119
+ */
117
120
  @Widget.Reactive()
118
- protected get autoLineHeight(): boolean | undefined {
119
- const autoLineHeight = Optional.ofNullable(this.getDsl().autoLineHeight)
120
- .map(BooleanHelper.toBoolean)
121
- .orElse(undefined);
121
+ protected get autoLineHeight(): boolean {
122
+ const autoLineHeight = Optional.ofNullable(this.getDsl().autoLineHeight).map(BooleanHelper.toBoolean).orElse(true);
122
123
 
123
124
  if (typeof autoLineHeight === 'boolean') {
124
125
  return autoLineHeight;
@@ -128,7 +129,7 @@ export class TableWidget<Props extends TableWidgetProps = TableWidgetProps> exte
128
129
  return this.tableConfig.autoLineHeight;
129
130
  }
130
131
 
131
- return undefined;
132
+ return true;
132
133
  }
133
134
 
134
135
  @Widget.Reactive()