field.d.ts 3.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132
  1. type QueryField = {
  2. key: any;
  3. name: any;
  4. title: any;
  5. type: any;
  6. dict: any;
  7. url: any;
  8. query: any;
  9. boolean?: any;
  10. show: boolean;
  11. stable: boolean;
  12. }
  13. declare type QueryFields<T extends QueryField = any> = T[];
  14. type IPage = {
  15. pageNum: number,
  16. pageSize: number,
  17. total?: number
  18. }
  19. type IBaseField = {
  20. label: string,
  21. prop: string,
  22. width?:number,
  23. minWidth?:number,
  24. fixed?:string,
  25. }
  26. /**
  27. *
  28. *type 字段类型,不同类型字段在查询、列表、编辑页表现形式不同,取值范围
  29. * render|text|textarea|number|dict|radio|checkbox|rich|image|attach|
  30. * dept|user|calendar|datetime|date|time|daterange|table|map|rate|
  31. * progress|color|search|cascade|title|split|select|treeselect|switch|
  32. * slide|button|tip|bool|divider|cron
  33. * <br>
  34. * label 字段名称
  35. * <br>
  36. * prop 字段key
  37. * <br>
  38. * rules 校验规则
  39. * <br>
  40. * placeholder 提示语
  41. * <br>
  42. * readonly 只读
  43. * <br>
  44. * rules 校验规则
  45. * <br>
  46. * conf 高级配置 (长度、可选值等)
  47. * <br>
  48. * tips 浮层提示
  49. *
  50. */
  51. type IField = {
  52. fixed?:string,
  53. query?:boolean,
  54. xs?: number,
  55. sm?: number,
  56. md?: number,
  57. lg?: number,
  58. xl?: number,
  59. width?:number,
  60. autoWidth?:boolean,
  61. label: string,
  62. prop: string,
  63. type: string,
  64. queryType?: string, //查询渲染,优先级比type高
  65. rules?: [],
  66. placeholder?: string,
  67. readonly?: boolean,
  68. hide?: boolean,
  69. // config?: IFieldConfig,
  70. conf?: IFieldConfig,
  71. tips?: string, //提示语句,在表单中使用
  72. render?: Function, //组件渲染 列表中使用
  73. renderHeader?: Function, //表头渲染 列表中使用
  74. }
  75. type IFieldConfig = {
  76. dict?:string, //数据字典key , 同range
  77. format?: Function, //显示的格式化方法
  78. range?: Array<IFieldRange>,
  79. min?: number, //最小值 长度
  80. max?: number, //最大值 长度
  81. require?: boolean, // 是否必填
  82. rowspan?: number, //行高
  83. deft?: any, //默认值
  84. password?: boolean, //显示密码
  85. clearable?: boolean, //是否可以清除
  86. multiple?: boolean, //多选
  87. direction?: string, //展示方向
  88. url?:string, //搜索
  89. query?:object, //搜索参数
  90. op?:string, //操作符,控制查询条件的展示方式
  91. fmt?:string, //组件中展示的格式 set
  92. vfmt?:string , //v-model返回值的格式 get
  93. }
  94. /**
  95. * 字段取值范围定义
  96. */
  97. type IFieldRange = {
  98. deft?: boolean,
  99. label: string,
  100. color?: string,
  101. value: number
  102. }
  103. /*
  104. <!-- public static final int FIELD_文本 = 1;-->
  105. <!-- public static final int FIELD_文本域 = 2;-->
  106. <!-- public static final int FIELD_数字 = 3;-->
  107. <!-- public static final int FIELD_单选 = 4;-->
  108. <!-- public static final int FIELD_复选 = 5;-->
  109. <!-- public static final int FIELD_富文本 = 6;-->
  110. <!-- public static final int FIELD_图片 = 7;-->
  111. <!-- public static final int FIELD_附件 = 8;-->
  112. <!-- public static final int FIELD_部门选择 = 9;-->
  113. <!-- public static final int FIELD_成员选择 = 10;-->
  114. <!-- public static final int FIELD_日期选择 = 11;-->
  115. <!-- public static final int FIELD_区间日期选择 = 12;-->
  116. <!-- public static final int FIELD_表格 = 13;-->
  117. <!-- public static final int FIELD_地图 = 14;-->
  118. <!-- public static final int FIELD_评分 = 15;-->
  119. <!-- public static final int FIELD_取色 = 16;-->
  120. <!-- public static final int FIELD_下拉选择 = 17;-->
  121. <!-- public static final int FIELD_级联城市 = 18;-->
  122. <!-- public static final int FIELD_模块标题= 19;-->
  123. <!-- public static final int FIELD_分割线= 20;-->*/