@oinone/kunlun-vue-admin-base 6.3.0 → 6.3.2

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.
@@ -7,7 +7,9 @@ export interface ExcelExportTask extends IdModel {
7
7
  workbookDefinition?: ExcelWorkDefinition;
8
8
  conditionWrapper?: QueryWrapper;
9
9
  exportMethod?: ExcelExportMethodEnum;
10
- selectedFields?: IModelField[];
10
+ selectedFields?: (IModelField & {
11
+ optionLabel?: string;
12
+ })[];
11
13
  requestId?: string;
12
14
  sync?: boolean;
13
15
  }
@@ -40,4 +40,5 @@ export declare class SearchWidget extends BaseSearchWidget {
40
40
  protected onSelectSearchPrefer(value: UserSearchPrefer): void;
41
41
  protected onUnselectSearchPrefer(): Promise<void>;
42
42
  protected $$mounted(): void;
43
+ protected childrenInvisibleProcess(): boolean;
43
44
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@oinone/kunlun-vue-admin-base",
3
- "version": "6.3.0",
3
+ "version": "6.3.2",
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.3.0",
18
- "@oinone/kunlun-vue-router": "6.3.0",
19
- "@oinone/kunlun-vue-ui": "6.3.0",
20
- "@oinone/kunlun-vue-ui-antd": "6.3.0",
21
- "@oinone/kunlun-vue-ui-common": "6.3.0",
22
- "@oinone/kunlun-vue-ui-el": "6.3.0",
23
- "@oinone/kunlun-vue-widget": "6.3.0",
17
+ "@oinone/kunlun-vue-admin-layout": "6.3.2",
18
+ "@oinone/kunlun-vue-router": "6.3.2",
19
+ "@oinone/kunlun-vue-ui": "6.3.2",
20
+ "@oinone/kunlun-vue-ui-antd": "6.3.2",
21
+ "@oinone/kunlun-vue-ui-common": "6.3.2",
22
+ "@oinone/kunlun-vue-ui-el": "6.3.2",
23
+ "@oinone/kunlun-vue-widget": "6.3.2",
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",
@@ -30,7 +30,8 @@ export class ExportFieldTransfer extends FormTransferFieldWidget {
30
30
  return {
31
31
  ...target,
32
32
  displayName: f.label || target.displayName,
33
- invisible: f.invisible
33
+ invisible: f.invisible,
34
+ optionLabel: f.template?.optionLabel
34
35
  };
35
36
  })
36
37
  .filter((v) => !!v && BooleanHelper.isFalse(v.invisible));
@@ -50,7 +51,8 @@ export class ExportFieldTransfer extends FormTransferFieldWidget {
50
51
  }
51
52
  return {
52
53
  ...o,
53
- displayName: target.label || o.displayName
54
+ displayName: target.label || o.displayName,
55
+ optionLabel: target.template?.optionLabel
54
56
  };
55
57
  })
56
58
  );
@@ -1,4 +1,10 @@
1
- import { RuntimeContext, RuntimeServerAction, SubmitValue } from '@oinone/kunlun-engine';
1
+ import {
2
+ ModelCache,
3
+ RuntimeContext,
4
+ RuntimeRelationField,
5
+ RuntimeServerAction,
6
+ SubmitValue
7
+ } from '@oinone/kunlun-engine';
2
8
  import { ModelDefaultActionName } from '@oinone/kunlun-meta';
3
9
  import { Condition, getSessionPath, GQL } from '@oinone/kunlun-request';
4
10
  import { DEFAULT_TRUE_CONDITION } from '@oinone/kunlun-service';
@@ -25,7 +31,7 @@ export class ExportWorkbookActionWidget extends AbstractTaskAction<ExcelExportTa
25
31
  return BooleanHelper.isTrue(this.metadataRuntimeContext.viewAction?.template?.sync);
26
32
  }
27
33
 
28
- protected generatorGQLByTask(task: ExcelExportTask, condition: string | Condition): Promise<string> {
34
+ protected async generatorGQLByTask(task: ExcelExportTask, condition: string | Condition): Promise<string> {
29
35
  let queryData = '{}';
30
36
  let rsql = condition;
31
37
  if (condition instanceof Condition) {
@@ -43,6 +49,11 @@ export class ExportWorkbookActionWidget extends AbstractTaskAction<ExcelExportTa
43
49
  : undefined;
44
50
 
45
51
  const modelName = this.model.name || 'excelExportTask';
52
+ const excelExportTaskModel = await ModelCache.get('file.ExcelExportTask');
53
+ const selectedFieldsField = excelExportTaskModel?.modelFields.find(
54
+ (v) => v.data === 'selectedFields'
55
+ ) as RuntimeRelationField;
56
+ const hasOptionLabel = selectedFieldsField.references === 'file.ExcelModelField';
46
57
  return GQL.mutation(`${modelName}Mutation`, 'createExportTask')
47
58
  .buildRequest((builder) => {
48
59
  builder.buildObjectParameter('data', (builder) => {
@@ -65,8 +76,11 @@ export class ExportWorkbookActionWidget extends AbstractTaskAction<ExcelExportTa
65
76
  }
66
77
  if (selectedFields?.length) {
67
78
  builder.buildArrayParameter('selectedFields', selectedFields, (builder, value) => {
68
- builder.stringParameter('field', value.field);
79
+ builder.stringParameter('field', value.data);
69
80
  builder.stringParameter('displayName', value.displayName);
81
+ if (hasOptionLabel) {
82
+ builder.stringParameter('optionLabel', value.optionLabel);
83
+ }
70
84
  });
71
85
  }
72
86
  });
@@ -115,7 +129,7 @@ export class ExportWorkbookActionWidget extends AbstractTaskAction<ExcelExportTa
115
129
  workbookDefinition: {
116
130
  id: workbookId
117
131
  }
118
- };
132
+ } as ExcelExportTask;
119
133
  break;
120
134
  }
121
135
  case ExcelExportMethodEnum.SELECT_TEMPLATE_FIELD: {
@@ -9,7 +9,7 @@ export interface ExcelExportTask extends IdModel {
9
9
  workbookDefinition?: ExcelWorkDefinition;
10
10
  conditionWrapper?: QueryWrapper;
11
11
  exportMethod?: ExcelExportMethodEnum;
12
- selectedFields?: IModelField[];
12
+ selectedFields?: (IModelField & { optionLabel?: string })[];
13
13
  requestId?: string;
14
14
  sync?: boolean;
15
15
  }
@@ -260,39 +260,43 @@ export default defineComponent({
260
260
 
261
261
  const finalExpandSize = props.invisibleSearch ? props.foldSize + 1 : props.foldSize;
262
262
  appendFieldDslDefinition(fields, widgets, finalExpandSize, props.foldSize, props.cateFields);
263
- hasExpandButton = fields.length > finalExpandSize;
264
- if (hasExpandButton) {
265
- fields = fields.slice(0, finalExpandSize);
266
- }
267
-
268
- if (!props.invisibleSearch) {
269
- const searchActionBar: VNode[] = createSearchBar(false, {
270
- hasExpandButton,
271
- showSearchPrefer: props.showSearchPrefer,
272
- onSearch,
273
- onReset,
274
- onExpand,
275
- translate: props.translate,
276
- preferProps: {
277
- selected: props.selectedPrefer,
278
- options: props.searchPreferOptions,
279
- onLoad: props.onLoadSearchPreferOptions,
280
- onCreate: props.onCreateSearchPrefer,
281
- onUpdate: props.onUpdateSearchPrefer,
282
- onRemove: props.onRemoveSearchPrefer,
283
- onSelect: props.onSelectSearchPrefer,
284
- onUnselect: props.onUnselectSearchPrefer
285
- }
286
- });
287
- invisible = !fields.length;
263
+ if (fields.length) {
264
+ hasExpandButton = fields.length > finalExpandSize;
265
+ if (hasExpandButton) {
266
+ fields = fields.slice(0, finalExpandSize);
267
+ }
268
+ if (!props.invisibleSearch) {
269
+ const searchActionBar: VNode[] = createSearchBar(false, {
270
+ hasExpandButton,
271
+ showSearchPrefer: props.showSearchPrefer,
272
+ onSearch,
273
+ onReset,
274
+ onExpand,
275
+ translate: props.translate,
276
+ preferProps: {
277
+ selected: props.selectedPrefer,
278
+ options: props.searchPreferOptions,
279
+ onLoad: props.onLoadSearchPreferOptions,
280
+ onCreate: props.onCreateSearchPrefer,
281
+ onUpdate: props.onUpdateSearchPrefer,
282
+ onRemove: props.onRemoveSearchPrefer,
283
+ onSelect: props.onSelectSearchPrefer,
284
+ onUnselect: props.onUnselectSearchPrefer
285
+ }
286
+ });
287
+ invisible = !fields.length;
288
288
 
289
- const searchBarCol = createSearchBarCol(
290
- searchActionBar,
291
- (props.foldSize - fields.length) * (DEFAULT_COLS / (props.foldSize + 1)),
292
- invisible,
293
- props.foldSize
294
- );
295
- fields.push(searchBarCol);
289
+ const searchBarCol = createSearchBarCol(
290
+ searchActionBar,
291
+ (props.foldSize - fields.length) * (DEFAULT_COLS / (props.foldSize + 1)),
292
+ invisible,
293
+ props.foldSize
294
+ );
295
+ fields.push(searchBarCol);
296
+ }
297
+ } else {
298
+ hasExpandButton = false;
299
+ fields = widgets;
296
300
  }
297
301
  defaultChildren.push(
298
302
  withDirectives(
@@ -9,9 +9,10 @@ import { getRouterInstance } from '@oinone/kunlun-router';
9
9
  import { BooleanHelper, NumberHelper } from '@oinone/kunlun-shared';
10
10
  import { SPI } from '@oinone/kunlun-spi';
11
11
  import { OioMessage } from '@oinone/kunlun-vue-ui-antd';
12
- import { Widget } from '@oinone/kunlun-vue-widget';
12
+ import { isAllInvisible, Widget } from '@oinone/kunlun-vue-widget';
13
13
  import { toString } from 'lodash-es';
14
14
  import { BaseElementWidget, BaseSearchWidget } from '../../basic';
15
+ import { DefaultRowWidget } from '../../container';
15
16
  import { UserPreferService } from '../../service';
16
17
  import { SEARCH_WIDGET, UserSearchPrefer, UserSearchPreferField } from '../../typing';
17
18
  import DefaultSearch from './DefaultSearch.vue';
@@ -244,4 +245,16 @@ export class SearchWidget extends BaseSearchWidget {
244
245
  super.$$mounted();
245
246
  this.isExpand = BooleanHelper.toBoolean(this.urlParameters.expand) || false;
246
247
  }
248
+
249
+ protected childrenInvisibleProcess(): boolean {
250
+ if (this.disabledExpand && !this.invisibleSearch) {
251
+ const children = this.getChildren();
252
+ const lastChild = children[children.length - 1];
253
+ if (children.length === 2 && lastChild instanceof DefaultRowWidget) {
254
+ return isAllInvisible(children.slice(0, children.length - 1));
255
+ }
256
+ return isAllInvisible(children);
257
+ }
258
+ return super.childrenInvisibleProcess();
259
+ }
247
260
  }