@oinone/kunlun-vue-admin-base 6.3.1 → 6.3.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.
@@ -24,7 +24,7 @@ export declare class FormTransferFieldWidget extends FormM2MFieldSelectWidget {
24
24
  submit(submitValue: SubmitValue): Promise<Record<string, unknown> | undefined>;
25
25
  protected queryPage<T = Record<string, unknown>>(option: IQueryPageOption, variables?: ObjectValue, context?: ObjectValue): Promise<QueryPageResult<T>>;
26
26
  protected generatorFullOptions(content: any): ActiveRecord[];
27
- protected originOptions: never[];
27
+ protected originOptions: ActiveRecord[];
28
28
  protected insertOptions(options: any, back?: boolean): void;
29
29
  protected backfillSelectedValues(): void;
30
30
  protected get leftColumns(): any;
@@ -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.1",
3
+ "version": "6.3.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.3.1",
18
- "@oinone/kunlun-vue-router": "6.3.1",
19
- "@oinone/kunlun-vue-ui": "6.3.1",
20
- "@oinone/kunlun-vue-ui-antd": "6.3.1",
21
- "@oinone/kunlun-vue-ui-common": "6.3.1",
22
- "@oinone/kunlun-vue-ui-el": "6.3.1",
23
- "@oinone/kunlun-vue-widget": "6.3.1",
17
+ "@oinone/kunlun-vue-admin-layout": "6.3.3",
18
+ "@oinone/kunlun-vue-router": "6.3.3",
19
+ "@oinone/kunlun-vue-ui": "6.3.3",
20
+ "@oinone/kunlun-vue-ui-antd": "6.3.3",
21
+ "@oinone/kunlun-vue-ui-common": "6.3.3",
22
+ "@oinone/kunlun-vue-ui-el": "6.3.3",
23
+ "@oinone/kunlun-vue-widget": "6.3.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",
@@ -218,7 +218,7 @@ export class FormTransferFieldWidget extends FormM2MFieldSelectWidget {
218
218
  return options;
219
219
  }
220
220
 
221
- protected originOptions = [];
221
+ protected originOptions: ActiveRecord[] = [];
222
222
 
223
223
  protected insertOptions(options, back = false) {
224
224
  if (!options?.length) {
@@ -233,7 +233,7 @@ export class FormTransferFieldWidget extends FormM2MFieldSelectWidget {
233
233
  });
234
234
  this.options = this.generatorFullOptions(finalOptions);
235
235
  if (!back) {
236
- this.originOptions = options;
236
+ this.originOptions = this.generatorFullOptions(options);
237
237
  }
238
238
  }
239
239
 
@@ -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
  }