cc1-form 1.3.7 → 1.3.8

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.
@@ -10,6 +10,7 @@ import Expand from './icon/Expand.vue';
10
10
  import IconRefresh from './icon/refresh.vue';
11
11
  import type { CurdConfig } from './indexType';
12
12
  import TableColumn from './tableColumn.vue';
13
+ import questionFilled from './icon/questionFilled.vue';
13
14
  declare const EDialog: {
14
15
  Add: any;
15
16
  Update: any;
@@ -1378,13 +1379,125 @@ declare const conf: {
1378
1379
  list: any[];
1379
1380
  };
1380
1381
  };
1382
+ sortable: {
1383
+ mode: boolean;
1384
+ actionLoading: boolean;
1385
+ instance: {
1386
+ destroy: () => void;
1387
+ } | undefined;
1388
+ modulePromise: {
1389
+ then: <TResult1 = any, TResult2 = never>(onfulfilled?: ((value: any) => TResult1 | PromiseLike<TResult1>) | null | undefined, onrejected?: ((reason: any) => TResult2 | PromiseLike<TResult2>) | null | undefined) => Promise<TResult1 | TResult2>;
1390
+ catch: <TResult = never>(onrejected?: ((reason: any) => TResult | PromiseLike<TResult>) | null | undefined) => Promise<any>;
1391
+ finally: (onfinally?: (() => void) | null | undefined) => Promise<any>;
1392
+ readonly [Symbol.toStringTag]: string;
1393
+ } | undefined;
1394
+ getOption: () => Partial<{
1395
+ [key: string]: any;
1396
+ show: boolean;
1397
+ button: boolean;
1398
+ saveButton: boolean;
1399
+ width: any;
1400
+ label: string;
1401
+ fixed: "left" | "right";
1402
+ page: boolean;
1403
+ scroll: boolean;
1404
+ field: string;
1405
+ onEnd: (data: any[]) => any;
1406
+ rule: "index" | "value";
1407
+ api: Partial<{
1408
+ list: (param?: any, type?: "sortable") => any;
1409
+ update?: ((param?: any[] | undefined, type?: "sortable") => any) | undefined;
1410
+ }>;
1411
+ }>;
1412
+ showTriggerButton: () => boolean | undefined;
1413
+ showActionButton: () => boolean | undefined;
1414
+ showSaveButton: () => boolean | undefined;
1415
+ isActive: () => boolean;
1416
+ showPagination: () => boolean | undefined;
1417
+ disableScroll: () => boolean;
1418
+ getTableBindOption: () => {
1419
+ height?: undefined;
1420
+ maxHeight?: undefined;
1421
+ editMode?: boolean | undefined;
1422
+ rowKey?: string | undefined;
1423
+ border?: boolean | undefined;
1424
+ index?: boolean | Partial<{
1425
+ [key: string]: any;
1426
+ show: boolean | ((data: any) => boolean);
1427
+ on: any;
1428
+ }> | ((data: any) => boolean) | undefined;
1429
+ sortable?: Partial<{
1430
+ [key: string]: any;
1431
+ show: boolean;
1432
+ button: boolean;
1433
+ saveButton: boolean;
1434
+ width: any;
1435
+ label: string;
1436
+ fixed: "left" | "right";
1437
+ page: boolean;
1438
+ scroll: boolean;
1439
+ field: string;
1440
+ onEnd: (data: any[]) => any;
1441
+ rule: "index" | "value";
1442
+ api: Partial<{
1443
+ list: (param?: any, type?: "sortable") => any;
1444
+ update?: ((param?: any[] | undefined, type?: "sortable") => any) | undefined;
1445
+ }>;
1446
+ }> | undefined;
1447
+ selectable?: boolean | Partial<{
1448
+ [key: string]: any;
1449
+ show: boolean | ((data: any) => boolean);
1450
+ on: any;
1451
+ }> | ((data: any) => boolean) | undefined;
1452
+ column?: import("./indexType").CurdConfigColumn<any>[] | undefined;
1453
+ showOverflowTooltip?: boolean | undefined;
1454
+ showSummary?: boolean | undefined;
1455
+ summaryMethod?: ((data: {
1456
+ columns: any[];
1457
+ data: any[];
1458
+ }) => any[]) | undefined;
1459
+ inlineEdit?: boolean | undefined;
1460
+ operate?: {
1461
+ [key: string]: any;
1462
+ width?: any;
1463
+ } | undefined;
1464
+ add?: boolean | ((data: any) => boolean) | undefined;
1465
+ update?: boolean | ((data: any) => boolean) | undefined;
1466
+ delete?: boolean | ((data: any) => boolean) | undefined;
1467
+ view?: boolean | ((data: any) => boolean) | undefined;
1468
+ on?: Record<string, any> | undefined;
1469
+ fitHeight?: boolean | undefined;
1470
+ };
1471
+ getColumnBind: () => {
1472
+ [x: string]: any;
1473
+ };
1474
+ destroy: () => void;
1475
+ getBody: () => HTMLElement | null;
1476
+ loadModule: () => Promise<any>;
1477
+ applyRule: (data: any[], field: string, rule: "index" | "value", values: any[]) => void;
1478
+ sync: () => Promise<void>;
1479
+ refreshList: () => Promise<void>;
1480
+ fitHeight: boolean;
1481
+ start: () => Promise<void>;
1482
+ exit: () => Promise<void>;
1483
+ save: () => Promise<void>;
1484
+ command: (command: "save" | "exit") => Promise<void>;
1485
+ };
1381
1486
  header: {
1382
1487
  group: {
1383
1488
  expand: boolean;
1384
1489
  toggleExpandAll: () => void;
1385
1490
  };
1386
1491
  };
1387
- getList: () => Promise<void>;
1492
+ parseListResult: (res: any) => Promise<{
1493
+ data: any;
1494
+ total: any;
1495
+ }>;
1496
+ applyListResult: (res: any, total?: number) => Promise<{
1497
+ data: any;
1498
+ total: any;
1499
+ }>;
1500
+ getList: (type?: "sortable") => Promise<void>;
1388
1501
  selection: {
1389
1502
  list: any[];
1390
1503
  change: (selection: any[]) => void;
@@ -1890,6 +2003,24 @@ declare const conf: {
1890
2003
  show?: boolean | ((data: any) => boolean) | undefined;
1891
2004
  on?: any;
1892
2005
  } | undefined;
2006
+ sortable?: {
2007
+ [x: string]: any;
2008
+ show?: boolean | undefined;
2009
+ button?: boolean | undefined;
2010
+ saveButton?: boolean | undefined;
2011
+ width?: any;
2012
+ label?: string | undefined;
2013
+ fixed?: "left" | "right" | undefined;
2014
+ page?: boolean | undefined;
2015
+ scroll?: boolean | undefined;
2016
+ field?: string | undefined;
2017
+ onEnd?: ((data: any[]) => any) | undefined;
2018
+ rule?: "index" | "value" | undefined;
2019
+ api?: {
2020
+ list?: ((param?: any, type?: "sortable") => any) | undefined;
2021
+ update?: ((param?: any[] | undefined, type?: "sortable") => any) | undefined;
2022
+ } | undefined;
2023
+ } | undefined;
1893
2024
  selectable?: boolean | ((data: any) => boolean) | {
1894
2025
  [x: string]: any;
1895
2026
  show?: boolean | ((data: any) => boolean) | undefined;
@@ -2795,9 +2926,9 @@ declare const conf: {
2795
2926
  } | undefined;
2796
2927
  }[];
2797
2928
  api: {
2798
- list: (param?: any) => any;
2929
+ list: (param?: any, type?: "sortable") => any;
2799
2930
  create?: ((param?: any) => any) | undefined;
2800
- update?: ((param?: any, type?: "switch") => any) | undefined;
2931
+ update?: ((param?: any, type?: "switch" | "sortable") => any) | undefined;
2801
2932
  delete?: ((param?: ({
2802
2933
  items: any[];
2803
2934
  } & Record<string, any>) | undefined) => any) | undefined;
@@ -2832,13 +2963,13 @@ declare var __VLS_1: {}, __VLS_7: {
2832
2963
  row: Record<string, any>;
2833
2964
  }, __VLS_61: {
2834
2965
  row: Record<string, any>;
2835
- }, __VLS_123: {}, __VLS_125: {}, __VLS_173: string | number, __VLS_174: any, __VLS_180: {}, __VLS_186: {
2966
+ }, __VLS_123: {}, __VLS_125: {}, __VLS_213: {}, __VLS_226: string | number, __VLS_227: any, __VLS_233: {}, __VLS_239: {
2836
2967
  row: any;
2837
- }, __VLS_204: {
2968
+ }, __VLS_257: {
2838
2969
  row: any;
2839
- }, __VLS_238: {
2970
+ }, __VLS_291: {
2840
2971
  row: any;
2841
- }, __VLS_249: {}, __VLS_255: {
2972
+ }, __VLS_302: {}, __VLS_308: {
2842
2973
  row: {
2843
2974
  title: string;
2844
2975
  rules: any;
@@ -3728,10 +3859,10 @@ declare var __VLS_1: {}, __VLS_7: {
3728
3859
  submit: () => Promise<void>;
3729
3860
  close: () => void;
3730
3861
  };
3731
- }, __VLS_267: string | number, __VLS_268: {
3862
+ }, __VLS_320: string | number, __VLS_321: {
3732
3863
  row: Record<string, any>;
3733
3864
  item: import("./indexType").CurdConfigColumn<any>;
3734
- }, __VLS_270: {
3865
+ }, __VLS_323: {
3735
3866
  row: {
3736
3867
  title: string;
3737
3868
  rules: any;
@@ -4621,7 +4752,7 @@ declare var __VLS_1: {}, __VLS_7: {
4621
4752
  submit: () => Promise<void>;
4622
4753
  close: () => void;
4623
4754
  };
4624
- }, __VLS_276: {
4755
+ }, __VLS_329: {
4625
4756
  row: {
4626
4757
  title: string;
4627
4758
  rules: any;
@@ -5523,9 +5654,9 @@ type __VLS_Slots = __VLS_PrettifyGlobal<__VLS_OmitStringIndex<typeof __VLS_ctx.$
5523
5654
  } & {
5524
5655
  [K in NonNullable<typeof __VLS_36>]?: (props: typeof __VLS_37) => any;
5525
5656
  } & {
5526
- [K in NonNullable<typeof __VLS_173>]?: (props: typeof __VLS_174) => any;
5657
+ [K in NonNullable<typeof __VLS_226>]?: (props: typeof __VLS_227) => any;
5527
5658
  } & {
5528
- [K in NonNullable<typeof __VLS_267>]?: (props: typeof __VLS_268) => any;
5659
+ [K in NonNullable<typeof __VLS_320>]?: (props: typeof __VLS_321) => any;
5529
5660
  } & {
5530
5661
  'box-left'?: (props: typeof __VLS_1) => any;
5531
5662
  } & {
@@ -5539,21 +5670,23 @@ type __VLS_Slots = __VLS_PrettifyGlobal<__VLS_OmitStringIndex<typeof __VLS_ctx.$
5539
5670
  } & {
5540
5671
  'tools-right'?: (props: typeof __VLS_125) => any;
5541
5672
  } & {
5542
- 'table-header-op'?: (props: typeof __VLS_180) => any;
5673
+ 'table-header-sortable'?: (props: typeof __VLS_213) => any;
5543
5674
  } & {
5544
- 'table-op-left'?: (props: typeof __VLS_186) => any;
5675
+ 'table-header-op'?: (props: typeof __VLS_233) => any;
5545
5676
  } & {
5546
- 'table-op-edit-right'?: (props: typeof __VLS_204) => any;
5677
+ 'table-op-left'?: (props: typeof __VLS_239) => any;
5547
5678
  } & {
5548
- 'table-op-right'?: (props: typeof __VLS_238) => any;
5679
+ 'table-op-edit-right'?: (props: typeof __VLS_257) => any;
5549
5680
  } & {
5550
- 'box-right'?: (props: typeof __VLS_249) => any;
5681
+ 'table-op-right'?: (props: typeof __VLS_291) => any;
5551
5682
  } & {
5552
- 'dialog-start'?: (props: typeof __VLS_255) => any;
5683
+ 'box-right'?: (props: typeof __VLS_302) => any;
5553
5684
  } & {
5554
- 'dialog-end'?: (props: typeof __VLS_270) => any;
5685
+ 'dialog-start'?: (props: typeof __VLS_308) => any;
5555
5686
  } & {
5556
- 'dialog-footer'?: (props: typeof __VLS_276) => any;
5687
+ 'dialog-end'?: (props: typeof __VLS_323) => any;
5688
+ } & {
5689
+ 'dialog-footer'?: (props: typeof __VLS_329) => any;
5557
5690
  }>;
5558
5691
  declare const __VLS_self: import("vue").DefineComponent<import("vue").ExtractPropTypes<{
5559
5692
  /**
@@ -5594,6 +5727,7 @@ declare const __VLS_self: import("vue").DefineComponent<import("vue").ExtractPro
5594
5727
  Expand: typeof Expand;
5595
5728
  IconRefresh: typeof IconRefresh;
5596
5729
  TableColumn: typeof TableColumn;
5730
+ questionFilled: typeof questionFilled;
5597
5731
  EDialog: typeof EDialog;
5598
5732
  isFun: typeof isFun;
5599
5733
  conf: typeof conf;
@@ -7005,13 +7139,125 @@ declare const __VLS_component: import("vue").DefineComponent<import("vue").Extra
7005
7139
  list: any[];
7006
7140
  };
7007
7141
  };
7142
+ sortable: {
7143
+ mode: boolean;
7144
+ actionLoading: boolean;
7145
+ instance: {
7146
+ destroy: () => void;
7147
+ } | undefined;
7148
+ modulePromise: {
7149
+ then: <TResult1 = any, TResult2 = never>(onfulfilled?: ((value: any) => TResult1 | PromiseLike<TResult1>) | null | undefined, onrejected?: ((reason: any) => TResult2 | PromiseLike<TResult2>) | null | undefined) => Promise<TResult1 | TResult2>;
7150
+ catch: <TResult = never>(onrejected?: ((reason: any) => TResult | PromiseLike<TResult>) | null | undefined) => Promise<any>;
7151
+ finally: (onfinally?: (() => void) | null | undefined) => Promise<any>;
7152
+ readonly [Symbol.toStringTag]: string;
7153
+ } | undefined;
7154
+ getOption: () => Partial<{
7155
+ [key: string]: any;
7156
+ show: boolean;
7157
+ button: boolean;
7158
+ saveButton: boolean;
7159
+ width: any;
7160
+ label: string;
7161
+ fixed: "left" | "right";
7162
+ page: boolean;
7163
+ scroll: boolean;
7164
+ field: string;
7165
+ onEnd: (data: any[]) => any;
7166
+ rule: "index" | "value";
7167
+ api: Partial<{
7168
+ list: (param?: any, type?: "sortable") => any;
7169
+ update?: ((param?: any[] | undefined, type?: "sortable") => any) | undefined;
7170
+ }>;
7171
+ }>;
7172
+ showTriggerButton: () => boolean | undefined;
7173
+ showActionButton: () => boolean | undefined;
7174
+ showSaveButton: () => boolean | undefined;
7175
+ isActive: () => boolean;
7176
+ showPagination: () => boolean | undefined;
7177
+ disableScroll: () => boolean;
7178
+ getTableBindOption: () => {
7179
+ height?: undefined;
7180
+ maxHeight?: undefined;
7181
+ editMode?: boolean | undefined;
7182
+ rowKey?: string | undefined;
7183
+ border?: boolean | undefined;
7184
+ index?: boolean | Partial<{
7185
+ [key: string]: any;
7186
+ show: boolean | ((data: any) => boolean);
7187
+ on: any;
7188
+ }> | ((data: any) => boolean) | undefined;
7189
+ sortable?: Partial<{
7190
+ [key: string]: any;
7191
+ show: boolean;
7192
+ button: boolean;
7193
+ saveButton: boolean;
7194
+ width: any;
7195
+ label: string;
7196
+ fixed: "left" | "right";
7197
+ page: boolean;
7198
+ scroll: boolean;
7199
+ field: string;
7200
+ onEnd: (data: any[]) => any;
7201
+ rule: "index" | "value";
7202
+ api: Partial<{
7203
+ list: (param?: any, type?: "sortable") => any;
7204
+ update?: ((param?: any[] | undefined, type?: "sortable") => any) | undefined;
7205
+ }>;
7206
+ }> | undefined;
7207
+ selectable?: boolean | Partial<{
7208
+ [key: string]: any;
7209
+ show: boolean | ((data: any) => boolean);
7210
+ on: any;
7211
+ }> | ((data: any) => boolean) | undefined;
7212
+ column?: import("./indexType").CurdConfigColumn<any>[] | undefined;
7213
+ showOverflowTooltip?: boolean | undefined;
7214
+ showSummary?: boolean | undefined;
7215
+ summaryMethod?: ((data: {
7216
+ columns: any[];
7217
+ data: any[];
7218
+ }) => any[]) | undefined;
7219
+ inlineEdit?: boolean | undefined;
7220
+ operate?: {
7221
+ [key: string]: any;
7222
+ width?: any;
7223
+ } | undefined;
7224
+ add?: boolean | ((data: any) => boolean) | undefined;
7225
+ update?: boolean | ((data: any) => boolean) | undefined;
7226
+ delete?: boolean | ((data: any) => boolean) | undefined;
7227
+ view?: boolean | ((data: any) => boolean) | undefined;
7228
+ on?: Record<string, any> | undefined;
7229
+ fitHeight?: boolean | undefined;
7230
+ };
7231
+ getColumnBind: () => {
7232
+ [x: string]: any;
7233
+ };
7234
+ destroy: () => void;
7235
+ getBody: () => HTMLElement | null;
7236
+ loadModule: () => Promise<any>;
7237
+ applyRule: (data: any[], field: string, rule: "index" | "value", values: any[]) => void;
7238
+ sync: () => Promise<void>;
7239
+ refreshList: () => Promise<void>;
7240
+ fitHeight: boolean;
7241
+ start: () => Promise<void>;
7242
+ exit: () => Promise<void>;
7243
+ save: () => Promise<void>;
7244
+ command: (command: "save" | "exit") => Promise<void>;
7245
+ };
7008
7246
  header: {
7009
7247
  group: {
7010
7248
  expand: boolean;
7011
7249
  toggleExpandAll: () => void;
7012
7250
  };
7013
7251
  };
7014
- getList: () => Promise<void>;
7252
+ parseListResult: (res: any) => Promise<{
7253
+ data: any;
7254
+ total: any;
7255
+ }>;
7256
+ applyListResult: (res: any, total?: number) => Promise<{
7257
+ data: any;
7258
+ total: any;
7259
+ }>;
7260
+ getList: (type?: "sortable") => Promise<void>;
7015
7261
  selection: {
7016
7262
  list: any[];
7017
7263
  change: (selection: any[]) => void;
@@ -7517,6 +7763,24 @@ declare const __VLS_component: import("vue").DefineComponent<import("vue").Extra
7517
7763
  show?: boolean | ((data: any) => boolean) | undefined;
7518
7764
  on?: any;
7519
7765
  } | undefined;
7766
+ sortable?: {
7767
+ [x: string]: any;
7768
+ show?: boolean | undefined;
7769
+ button?: boolean | undefined;
7770
+ saveButton?: boolean | undefined;
7771
+ width?: any;
7772
+ label?: string | undefined;
7773
+ fixed?: "left" | "right" | undefined;
7774
+ page?: boolean | undefined;
7775
+ scroll?: boolean | undefined;
7776
+ field?: string | undefined;
7777
+ onEnd?: ((data: any[]) => any) | undefined;
7778
+ rule?: "index" | "value" | undefined;
7779
+ api?: {
7780
+ list?: ((param?: any, type?: "sortable") => any) | undefined;
7781
+ update?: ((param?: any[] | undefined, type?: "sortable") => any) | undefined;
7782
+ } | undefined;
7783
+ } | undefined;
7520
7784
  selectable?: boolean | ((data: any) => boolean) | {
7521
7785
  [x: string]: any;
7522
7786
  show?: boolean | ((data: any) => boolean) | undefined;
@@ -8422,9 +8686,9 @@ declare const __VLS_component: import("vue").DefineComponent<import("vue").Extra
8422
8686
  } | undefined;
8423
8687
  }[];
8424
8688
  api: {
8425
- list: (param?: any) => any;
8689
+ list: (param?: any, type?: "sortable") => any;
8426
8690
  create?: ((param?: any) => any) | undefined;
8427
- update?: ((param?: any, type?: "switch") => any) | undefined;
8691
+ update?: ((param?: any, type?: "switch" | "sortable") => any) | undefined;
8428
8692
  delete?: ((param?: ({
8429
8693
  items: any[];
8430
8694
  } & Record<string, any>) | undefined) => any) | undefined;
@@ -185,6 +185,43 @@ export interface CurdConfig<T = any> {
185
185
  /** 选择事件 */
186
186
  on: any;
187
187
  }> | ((data: T) => boolean) | boolean;
188
+ /**
189
+ * 是否显示拖动排序列
190
+ * 开启后会按需加载 Sortable,并支持拖动调整当前表格数据顺序
191
+ * 默认不显示
192
+ */
193
+ sortable: Partial<{
194
+ [key: string]: any;
195
+ /** 是否显示拖拽排序列 */
196
+ show: boolean;
197
+ /** 是否显示操作排序按钮,如果显示,使show属性失效,则默认不显示拖拽排序列,也不会直接加载sortablejs,点击排序按钮后才开始加载sortablejs */
198
+ button: boolean;
199
+ /** 是否显示保存排序按钮 - 默认开启 当button关闭时使用 */
200
+ saveButton: boolean;
201
+ /** 拖拽列宽度,默认54 */
202
+ width: any;
203
+ /** 拖拽列标题 */
204
+ label: string;
205
+ /** 拖拽列固定位置,默认left */
206
+ fixed: 'left' | 'right';
207
+ /** 排序时是否显示分页 - 默认不显示 */
208
+ page: boolean;
209
+ /** 没有分页时是否需要滚动条 - 默认没有 */
210
+ scroll: boolean;
211
+ /** 排序字段名 - 默认sortNo */
212
+ field: string;
213
+ /** 拖拽排序结束自定义排序,使rule字段失效 */
214
+ onEnd: (data: T[]) => any;
215
+ /** 排序规则 - index:按照当前索引自动从1开始排序 value:按照原有值重新分配排序 默认按照索引排序 */
216
+ rule: 'index' | 'value';
217
+ /** 操作的api */
218
+ api: Partial<{
219
+ /** 获取操作的列表数据 - 默认调用api.list,调用后会覆盖当前显示表格列表数据,会传入额外参数类型 */
220
+ list: (param?: T & Record<string, any>, type?: 'sortable') => any;
221
+ /** 更新操作的列表数据 - 仅在启用button时会调用 - 默认取api.update,调用后会覆盖当前显示表格列表数据,会传入额外参数类型 */
222
+ update?: (param?: T[], type?: 'sortable') => any;
223
+ }>;
224
+ }>;
188
225
  /**
189
226
  * 是否可多选 - 通过conf.table.selection.list获取已选数据
190
227
  * 默认不显示
@@ -389,7 +426,7 @@ export interface CurdConfig<T = any> {
389
426
  * @param param 搜索参数-分页和搜索参数
390
427
  * @returns 列表数据
391
428
  */
392
- list: (param?: T & Record<string, any>) => any;
429
+ list: (param?: T & Record<string, any>, type?: 'sortable') => any;
393
430
  /**
394
431
  * 新增
395
432
  */
@@ -397,7 +434,7 @@ export interface CurdConfig<T = any> {
397
434
  /**
398
435
  * 编辑 - 如果有switch类型可以在table中直接修改并没有传入api接口,默认调用更新接口,会传入第二个参数type: 'switch'
399
436
  */
400
- update?: (param?: T, type?: 'switch') => any;
437
+ update?: (param?: T | T[], type?: 'switch' | 'sortable') => any;
401
438
  /**
402
439
  * 删除
403
440
  */