cc1-form 1.1.36 → 1.1.38

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.
@@ -430,6 +430,10 @@ export interface CurdConfigColumn<T = any> {
430
430
  options?: {
431
431
  /** 搜索栏配置 - 如果不配置,使用默认配置 */
432
432
  search?: CurdOptions<T>;
433
+ /** 新增编辑表单配置 - 如果不配置,使用默认配置 */
434
+ formAdd?: CurdOptions<T>;
435
+ /** 编辑表单配置 - 如果不配置,使用默认配置 */
436
+ formUpdate?: CurdOptions<T>;
433
437
  } & Partial<CurdOptions<T>>;
434
438
  /**
435
439
  * 新增编辑表单配置
@@ -450,9 +454,9 @@ export interface CurdConfigColumn<T = any> {
450
454
  /** 是否补充其他列空间 默认为false */
451
455
  spanCol: boolean;
452
456
  /**
453
- * 提示文本
457
+ * 提示文本 - 返回字符串或者富文本内容
454
458
  */
455
- tipText: string;
459
+ tipText: string | ((row: T, type: keyof typeof TSys.EDialog) => string);
456
460
  }>;
457
461
  /**
458
462
  * 字段控件类型,决定在搜索、表格、表单中使用哪种 UI 组件渲染
@@ -490,7 +494,7 @@ export interface CurdConfigColumn<T = any> {
490
494
  * options: { 'my-upload': { accept: 'image/*', limit: 1 } } }
491
495
  * ```
492
496
  */
493
- type?: 'input' | 'select' | 'switch' | 'radio' | 'checkbox' | 'date' | 'time' | 'datetime' | 'number' | 'color' | 'icon' | 'slider' | 'upload' | 'editor' | 'tree' | 'tree-select' | 'list';
497
+ type?: 'input' | 'select' | 'switch' | 'radio' | 'checkbox' | 'date' | 'time' | 'datetime' | 'number' | 'color' | 'icon' | 'slider' | 'upload' | 'editor' | 'tree' | 'treeSelect' | 'list';
494
498
  /**
495
499
  * 表格配置
496
500
  */
@@ -584,7 +588,7 @@ export interface CurdConfigColumn<T = any> {
584
588
  /**
585
589
  * 表单显示(新增、编辑、查看)
586
590
  */
587
- form?: ((data: T, type: typeof TSys.EDialog.Insert | typeof TSys.EDialog.Update | typeof TSys.EDialog.View) => boolean) | boolean;
591
+ form?: ((data: T, type: keyof typeof TSys.EDialog) => boolean) | boolean;
588
592
  };
589
593
  /**
590
594
  * 排序
@@ -3,6 +3,7 @@ import type { CurdConfig, CurdConfigColumn } from './indexType';
3
3
  import questionFilled from './icon/questionFilled.vue';
4
4
  import { ElInput, ElOption, ElSelect, ElSwitch, ElTableColumn } from 'element-plus';
5
5
  import TSys from '../../utils/TSys';
6
+ import TForm from '../../utils/TForm';
6
7
  declare const isFun: (fun: any, ...args: any[]) => any;
7
8
  type __VLS_Props = {
8
9
  conf: ReturnType<typeof curdConf>['conf'];
@@ -13,7 +14,7 @@ declare const self: any;
13
14
  declare const __VLS_ctx: InstanceType<__VLS_PickNotAny<typeof __VLS_self, new () => {}>>;
14
15
  declare var __VLS_6: string, __VLS_7: {
15
16
  item: CurdConfigColumn<any>;
16
- }, __VLS_21: string | number, __VLS_22: any, __VLS_41: string, __VLS_42: {
17
+ }, __VLS_21: string | number, __VLS_22: any, __VLS_37: string, __VLS_38: {
17
18
  row: any;
18
19
  item: CurdConfigColumn<any>;
19
20
  };
@@ -22,7 +23,7 @@ type __VLS_Slots = __VLS_PrettifyGlobal<__VLS_OmitStringIndex<typeof __VLS_ctx.$
22
23
  } & {
23
24
  [K in NonNullable<typeof __VLS_21>]?: (props: typeof __VLS_22) => any;
24
25
  } & {
25
- [K in NonNullable<typeof __VLS_41>]?: (props: typeof __VLS_42) => any;
26
+ [K in NonNullable<typeof __VLS_37>]?: (props: typeof __VLS_38) => any;
26
27
  }>;
27
28
  declare const __VLS_self: import("vue").DefineComponent<__VLS_Props, {
28
29
  questionFilled: typeof questionFilled;
@@ -32,6 +33,7 @@ declare const __VLS_self: import("vue").DefineComponent<__VLS_Props, {
32
33
  ElSwitch: typeof ElSwitch;
33
34
  ElTableColumn: typeof ElTableColumn;
34
35
  TSys: typeof TSys;
36
+ TForm: typeof TForm;
35
37
  isFun: typeof isFun;
36
38
  self: typeof self;
37
39
  }, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
@@ -17,6 +17,7 @@ export default class TForm {
17
17
  * 通常由插件安装时自动设置,也可手动注册:
18
18
  * ```ts
19
19
  * TForm.customComponent['my-editor'] = MyEditorComponent
20
+ * TForm.customComponent['my-editor'] = { form: MyEditorComponent, table: MyEditorComponent }
20
21
  * ```
21
22
  */
22
23
  static customComponent: {
@@ -308,6 +308,7 @@ export default class TFormConfig {
308
308
  */
309
309
  view: boolean;
310
310
  };
311
+ /** 表单组件配置,如果需要配置单个table配置,需要在组件名中加入比如:customCom:{clearable:false,table:{showOverflowTooltip:false}} */
311
312
  options: {
312
313
  switch: {
313
314
  activeValue: boolean;
@@ -38,7 +38,7 @@ export default class TSys {
38
38
  */
39
39
  static getRouterPath: () => any;
40
40
  static EDialog: {
41
- Insert: any;
41
+ Add: any;
42
42
  Update: any;
43
43
  View: any;
44
44
  Remove: any;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "cc1-form",
3
- "version": "1.1.36",
3
+ "version": "1.1.38",
4
4
  "description": "我来助你-表单组件库",
5
5
  "repository": {
6
6
  "type": "git",