cc1-form 1.1.26 → 1.1.28

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.
@@ -117,7 +117,7 @@ export interface CurdConfig<T = any> {
117
117
  */
118
118
  table?: Partial<{
119
119
  /**
120
- * 行键
120
+ * 行键 默认_id
121
121
  */
122
122
  rowKey: string;
123
123
  /**
@@ -126,14 +126,15 @@ export interface CurdConfig<T = any> {
126
126
  border: boolean;
127
127
  /**
128
128
  * 是否可多选 - 通过conf.table.selection.list获取已选数据
129
+ * 默认不显示
129
130
  */
130
131
  selectable: ((data: T) => boolean) | boolean;
131
132
  /**
132
133
  * 额外的表格列信息,可配置是否可搜索,不参与新增编辑表单
133
134
  */
134
- column: CurdConfigColumn[];
135
+ column: CurdConfigColumn<T>[];
135
136
  /**
136
- * 是否显示溢出提示
137
+ * 是否显示溢出提示 默认显示
137
138
  */
138
139
  showOverflowTooltip: boolean;
139
140
  /** 是否显示合计行 默认不显示 配合summaryMethod进行使用 */
@@ -148,7 +149,7 @@ export interface CurdConfig<T = any> {
148
149
  /** 操作列配置 */
149
150
  operate: {
150
151
  /** 操作列宽度-默认使用内容宽度 */
151
- width?: number;
152
+ width?: any;
152
153
  };
153
154
  /**
154
155
  * 是否显示新增 - 默认不显示
@@ -167,7 +168,7 @@ export interface CurdConfig<T = any> {
167
168
  */
168
169
  view: ((data: T) => boolean) | boolean;
169
170
  /**
170
- * 表格事件
171
+ * 表格事件 文档:https://element-plus.org/zh-CN/component/table#table-%E4%BA%8B%E4%BB%B6
171
172
  */
172
173
  on: Record<string, any>;
173
174
  }>;
@@ -180,15 +181,15 @@ export interface CurdConfig<T = any> {
180
181
  */
181
182
  refresh: boolean;
182
183
  /**
183
- * 是否显示展开/收缩
184
+ * 是否显示展开/收缩 默认不显示
184
185
  */
185
186
  expand: boolean;
186
187
  /**
187
- * 是否显示搜索
188
+ * 是否显示搜索 默认显示
188
189
  */
189
190
  search: boolean;
190
191
  /**
191
- * 是否显示重置
192
+ * 是否显示重置 默认显示
192
193
  */
193
194
  reset: boolean;
194
195
  /**
@@ -204,7 +205,7 @@ export interface CurdConfig<T = any> {
204
205
  */
205
206
  export: Partial<{
206
207
  /**
207
- * 是否显示导出
208
+ * 是否显示导出 默认显示
208
209
  */
209
210
  show: boolean;
210
211
  /**
@@ -216,7 +217,7 @@ export interface CurdConfig<T = any> {
216
217
  */
217
218
  before: (param: {
218
219
  data: T[];
219
- columns: CurdConfigColumn[];
220
+ columns: CurdConfigColumn<T>[];
220
221
  }) => void;
221
222
  /**
222
223
  * 导出所有数据钩子
@@ -229,7 +230,7 @@ export interface CurdConfig<T = any> {
229
230
  */
230
231
  form?: Partial<{
231
232
  /**
232
- * 是否使用斑马纹
233
+ * 是否使用斑马纹 默认使用
233
234
  */
234
235
  stripe?: boolean;
235
236
  /**
@@ -280,7 +281,7 @@ export interface CurdConfig<T = any> {
280
281
  /**
281
282
  * 表格列和新增编辑表单字段
282
283
  */
283
- column: CurdConfigColumn[];
284
+ column: CurdConfigColumn<T>[];
284
285
  /**
285
286
  * 接口
286
287
  */
@@ -290,7 +291,7 @@ export interface CurdConfig<T = any> {
290
291
  * @param param 搜索参数-分页和搜索参数
291
292
  * @returns 列表数据
292
293
  */
293
- list: (param?: T & Record<string, any>) => T[] | Promise<T[]>;
294
+ list: (param?: T & Record<string, any>) => any;
294
295
  /**
295
296
  * 新增
296
297
  */
@@ -351,7 +352,7 @@ export interface CurdConfigColumn<T = any> {
351
352
  /**
352
353
  * 表头存在子字段时,子字段列表配置
353
354
  */
354
- children?: CurdConfigColumn<any>[];
355
+ children?: CurdConfigColumn<T>[];
355
356
  /**
356
357
  * 是否禁止操作
357
358
  */
@@ -383,7 +384,7 @@ export interface CurdConfigColumn<T = any> {
383
384
  input?: Partial<{
384
385
  [key: string]: any;
385
386
  /**
386
- * 事件
387
+ * 事件 文档:https://element-plus.org/zh-CN/component/input#events
387
388
  */
388
389
  on: any;
389
390
  }>;
@@ -392,7 +393,7 @@ export interface CurdConfigColumn<T = any> {
392
393
  */
393
394
  switch?: Partial<{
394
395
  /**
395
- * 事件
396
+ * 事件 文档:https://element-plus.org/zh-CN/component/switch#%E4%BA%8B%E4%BB%B6
396
397
  */
397
398
  on: Record<string, any>;
398
399
  /**
@@ -422,7 +423,7 @@ export interface CurdConfigColumn<T = any> {
422
423
  select?: Partial<{
423
424
  [key: string]: any;
424
425
  /**
425
- * 事件
426
+ * 事件 文档:https://element-plus.org/zh-CN/component/select#select-events
426
427
  */
427
428
  on: any;
428
429
  /**
@@ -453,7 +454,7 @@ export interface CurdConfigColumn<T = any> {
453
454
  treeSelect?: Partial<{
454
455
  [key: string]: any;
455
456
  /**
456
- * 事件
457
+ * 事件 文档:https://element-plus.org/zh-CN/component/time-picker#%E4%BA%8B%E4%BB%B6
457
458
  */
458
459
  on: any;
459
460
  }>;
@@ -463,7 +464,7 @@ export interface CurdConfigColumn<T = any> {
463
464
  datetime?: Partial<{
464
465
  [key: string]: any;
465
466
  /**
466
- * 事件
467
+ * 事件 文档:https://element-plus.org/zh-CN/component/time-picker#%E4%BA%8B%E4%BB%B6
467
468
  */
468
469
  on: any;
469
470
  }>;
@@ -488,25 +489,15 @@ export interface CurdConfigColumn<T = any> {
488
489
  /**
489
490
  * 输入的值字段,默认value,label为空时,使用value作为placeholder显示
490
491
  */
491
- value: string;
492
+ value: any;
492
493
  /**
493
494
  * 对象字段列表,默认提供label和value字段,配置时覆盖默认值
494
495
  */
495
- itemFields: Partial<{
496
- [key: string]: string;
497
- /**
498
- * 标签
499
- */
500
- label: string;
501
- /**
502
- * 值
503
- */
504
- value: string;
505
- }[]>;
496
+ itemFields: CurdSelectData[];
506
497
  /**
507
498
  * 输入框宽度
508
499
  */
509
- inputWidth: string;
500
+ inputWidth: any;
510
501
  /**
511
502
  * 输入框类名
512
503
  */
@@ -525,7 +516,7 @@ export interface CurdConfigColumn<T = any> {
525
516
  radio?: Partial<{
526
517
  [key: string]: any;
527
518
  /**
528
- * 事件
519
+ * 事件 文档:https://element-plus.org/zh-CN/component/radio#radio-events
529
520
  */
530
521
  on: any;
531
522
  /**
@@ -567,6 +558,12 @@ export interface CurdConfigColumn<T = any> {
567
558
  * 栅格占比-一行最多12列,0为铺满剩余空间
568
559
  */
569
560
  span: number;
561
+ /** 是否补充其他列空间 默认为false */
562
+ spanCol: boolean;
563
+ /**
564
+ * 提示文本
565
+ */
566
+ tipText: string;
570
567
  }>;
571
568
  /**
572
569
  * 字段控件类型,决定在搜索、表格、表单中使用哪种 UI 组件渲染
@@ -616,11 +613,11 @@ export interface CurdConfigColumn<T = any> {
616
613
  /**
617
614
  * 最小宽度
618
615
  */
619
- minWidth: string;
616
+ minWidth: any;
620
617
  /**
621
618
  * 宽度
622
619
  */
623
- width: string;
620
+ width: any;
624
621
  /**
625
622
  * 固定
626
623
  */
@@ -778,6 +775,6 @@ export type CurdSelectData = {
778
775
  /** 名称 */
779
776
  label: string;
780
777
  /** 值 */
781
- value: string;
778
+ value: any;
782
779
  };
783
780
  export {};
@@ -149,7 +149,7 @@ export default class TFormConfig {
149
149
  */
150
150
  border: boolean;
151
151
  /**
152
- * 是否可多选
152
+ * 是否可多选 默认不显示
153
153
  */
154
154
  selectable: boolean;
155
155
  /**
@@ -157,7 +157,7 @@ export default class TFormConfig {
157
157
  */
158
158
  column: never[];
159
159
  /**
160
- * 是否显示溢出提示
160
+ * 是否显示溢出提示 默认显示
161
161
  */
162
162
  showOverflowTooltip: boolean;
163
163
  /** 是否显示合计行 默认不显示 配合summaryMethod进行使用 */
@@ -223,6 +223,10 @@ export default class TFormConfig {
223
223
  * 宽度
224
224
  */
225
225
  width: string;
226
+ /**
227
+ * 是否补充其他列空间 默认为false
228
+ */
229
+ spanCol: boolean;
226
230
  };
227
231
  table: {
228
232
  /**
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "cc1-form",
3
- "version": "1.1.26",
3
+ "version": "1.1.28",
4
4
  "description": "我来助你-表单组件库",
5
5
  "repository": {
6
6
  "type": "git",
@@ -32,26 +32,36 @@
32
32
  "typecheck": "vue-tsc --noEmit",
33
33
  "addtype": "tsx ./build/buildTypes.ts"
34
34
  },
35
+ "peerDependencies": {
36
+ "cc1-js": "*",
37
+ "cc1-vue3": "*",
38
+ "element-plus": "*",
39
+ "vue": "*",
40
+ "vue-router": "*",
41
+ "xlsx": "*"
42
+ },
43
+ "peerDependenciesMeta": {
44
+ "xlsx": {
45
+ "optional": true
46
+ }
47
+ },
35
48
  "devDependencies": {
36
49
  "@types/node": "22.15.2",
37
50
  "@vitejs/plugin-vue": "5.2.1",
38
51
  "@vue/tsconfig": "0.7.0",
52
+ "cc1-js": "*",
53
+ "cc1-vue3": "*",
54
+ "element-plus": "2.9.7",
39
55
  "less": "4.3.0",
40
56
  "prettier": "3.2.5",
41
57
  "tsc-alias": "1.8.11",
42
58
  "tsx": "4.19.4",
43
59
  "typescript": "5.8.2",
44
60
  "vite": "6.2.2",
45
- "vue-tsc": "2.2.8"
46
- },
47
- "dependencies": {
48
- "@vueuse/core": "12.8.2",
49
- "element-plus": "2.9.7",
50
- "cc1-js": "*",
51
- "cc1-vue3": "*",
61
+ "vue": "3.5.13",
52
62
  "vue-router": "4.5.1",
53
- "xlsx": "0.18.5",
54
- "vue": "3.5.x"
63
+ "vue-tsc": "2.2.8",
64
+ "xlsx": "0.18.5"
55
65
  },
56
66
  "engines": {
57
67
  "node": ">=18.x",