urit-qf-ui 0.1.7 → 0.1.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.
@@ -1,11 +1,8 @@
1
1
  /**
2
2
  * API 统一配置
3
3
  */
4
- declare function formOrTableCfgApi(formId: string): string;
5
4
  export declare const apis: {
6
- formCfgApi: typeof formOrTableCfgApi;
5
+ formCfgApi(formId: string): string;
7
6
  dictApi(key: string): string;
8
7
  cascaderApi(key: string): string;
9
- tableCfgApi: typeof formOrTableCfgApi;
10
8
  };
11
- export {};
package/dist/ts/dict.d.ts CHANGED
@@ -2,6 +2,41 @@
2
2
  * 全局字典缓存
3
3
  * 提供字典数据的缓存和翻译功能
4
4
  */
5
+ /**
6
+ * 把后端字典项规范化为 { label, value } 结构
7
+ *
8
+ * 后端 /api/dict/tree-list 返回的是 DictTreeInfo:
9
+ * { id, dict_type, dict_code, dict_value, sort, parent_id, info, children }
10
+ * 其中 dict_value 是展示文本(label),dict_code 是代号(value)。
11
+ * 同时兼容旧的 { label, value } 结构。
12
+ */
13
+ export declare function normalizeDictNode(node: any): {
14
+ label: string;
15
+ value: any;
16
+ [key: string]: any;
17
+ };
18
+ /**
19
+ * 将树形字典转换为带 children 的 { label, value } 树(供级联 el-select 使用)
20
+ * @param list 原始数组(可能是树)
21
+ * @returns 规范化后的树
22
+ */
23
+ export declare function mapDictTree(list: any): Array<{
24
+ label: string;
25
+ value: any;
26
+ children?: any[];
27
+ [key: string]: any;
28
+ }>;
29
+ /**
30
+ * 将树形字典扁平化为一维选项(供单一 el-select 使用)
31
+ * 新后端 /api/dict/tree-list 返回的是带 children 的树结构
32
+ * @param list 原始数组(可能是树)
33
+ * @returns 扁平后的选项数组
34
+ */
35
+ export declare function flattenDictTree(list: any): Array<{
36
+ label: string;
37
+ value: any;
38
+ [key: string]: any;
39
+ }>;
5
40
  /**
6
41
  * 获取字典数据
7
42
  * 先从缓存读取,如果没有则从后端获取并缓存
@@ -8,8 +8,6 @@ export interface FormMeta {
8
8
  }
9
9
  export interface FormApi {
10
10
  get?: string;
11
- post?: string;
12
- put?: string;
13
11
  add?: string;
14
12
  edit?: string;
15
13
  }
@@ -29,7 +27,7 @@ export interface FieldRule {
29
27
  }
30
28
  export interface FieldConfig {
31
29
  field: string;
32
- type: 'input' | 'number' | 'dict' | 'cascader' | 'multidict' | 'switch' | 'date' | 'datetime' | 'daterange' | 'upload' | 'dept' | 'role' | 'text';
30
+ type: 'input' | 'input-number' | 'number' | 'dict' | 'cascader' | 'multidict' | 'switch' | 'date' | 'datetime' | 'daterange' | 'upload' | 'dept' | 'role' | 'text';
33
31
  label: string;
34
32
  maxlength?: number;
35
33
  lineCount?: number;
@@ -38,16 +36,28 @@ export interface FieldConfig {
38
36
  required?: boolean;
39
37
  rules?: FieldRule[];
40
38
  colSpan?: number;
39
+ placeholder?: string;
40
+ readonly?: boolean;
41
41
  dictType?: string;
42
42
  parentId?: number;
43
+ min?: number;
44
+ max?: number;
45
+ step?: number;
46
+ precision?: number;
47
+ activeText?: string;
48
+ inactiveText?: string;
49
+ activeColor?: string;
50
+ inactiveColor?: string;
51
+ trueValue?: any;
52
+ falseValue?: any;
43
53
  cascaderKey?: string;
44
54
  cascaderDepth?: number;
45
55
  mode?: 'single' | 'multiple' | 'range';
46
56
  locale?: 'zh-CN' | 'en-US';
47
57
  format?: string;
48
58
  mask?: string;
49
- min?: string;
50
- max?: string;
59
+ dateMin?: string;
60
+ dateMax?: string;
51
61
  }
52
62
  export interface FormConfig {
53
63
  meta: FormMeta;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "urit-qf-ui",
3
- "version": "0.1.7",
3
+ "version": "0.1.8",
4
4
  "type": "module",
5
5
  "main": "./dist/index.umd.cjs",
6
6
  "module": "./dist/index.js",