@a2simcode/ui 0.0.69 → 0.0.70

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,67 +1,67 @@
1
- export default {
2
- "props": [
3
- {
4
- "name": "schema",
5
- "description": "模版",
6
- "type": "PageSchemaConfig[]",
7
- "default": "() => []"
8
- },
9
- {
10
- "name": "noPadding",
11
- "description": "是否有边距",
12
- "type": "boolean"
13
- },
14
- {
15
- "name": "actions",
16
- "description": "事件编排执行动作",
17
- "type": "Record<string, any>",
18
- "default": "() => ({})"
19
- }
20
- ],
21
- "events": [],
22
- "slots": [],
23
- "methods": [
24
- {
25
- "name": "init",
26
- "description": "",
27
- "type": "() => void"
28
- },
29
- {
30
- "name": "call",
31
- "description": "",
32
- "type": "() => void"
33
- },
34
- {
35
- "name": "on",
36
- "description": "",
37
- "type": "() => void"
38
- },
39
- {
40
- "name": "off",
41
- "description": "",
42
- "type": "() => void"
43
- }
44
- ],
45
- "types": [
46
- {
47
- "name": "PageSchemaConfig",
48
- "properties": [
49
- {
50
- "name": "id",
51
- "type": "string",
52
- "description": "id"
53
- },
54
- {
55
- "name": "type",
56
- "type": "string",
57
- "description": "类型"
58
- },
59
- {
60
- "name": "children",
61
- "type": "PageSchemaConfig[]",
62
- "description": "子集"
63
- }
64
- ]
65
- }
66
- ]
67
- }
1
+ export default {
2
+ "props": [
3
+ {
4
+ "name": "schema",
5
+ "description": "模版",
6
+ "type": "PageSchemaConfig[]",
7
+ "default": "() => []"
8
+ },
9
+ {
10
+ "name": "noPadding",
11
+ "description": "是否有边距",
12
+ "type": "boolean"
13
+ },
14
+ {
15
+ "name": "actions",
16
+ "description": "事件编排执行动作",
17
+ "type": "Record<string, any>",
18
+ "default": "() => ({})"
19
+ }
20
+ ],
21
+ "events": [],
22
+ "slots": [],
23
+ "methods": [
24
+ {
25
+ "name": "init",
26
+ "description": "",
27
+ "type": "() => void"
28
+ },
29
+ {
30
+ "name": "call",
31
+ "description": "",
32
+ "type": "() => void"
33
+ },
34
+ {
35
+ "name": "on",
36
+ "description": "",
37
+ "type": "() => void"
38
+ },
39
+ {
40
+ "name": "off",
41
+ "description": "",
42
+ "type": "() => void"
43
+ }
44
+ ],
45
+ "types": [
46
+ {
47
+ "name": "PageSchemaConfig",
48
+ "properties": [
49
+ {
50
+ "name": "id",
51
+ "type": "string",
52
+ "description": "id"
53
+ },
54
+ {
55
+ "name": "type",
56
+ "type": "string",
57
+ "description": "类型"
58
+ },
59
+ {
60
+ "name": "children",
61
+ "type": "PageSchemaConfig[]",
62
+ "description": "子集"
63
+ }
64
+ ]
65
+ }
66
+ ]
67
+ }
@@ -1,55 +1,55 @@
1
- export default {
2
- "props": [
3
- {
4
- "name": "modelValue",
5
- "description": "输入值",
6
- "type": "string | number",
7
- "default": "undefined"
8
- },
9
- {
10
- "name": "options",
11
- "description": "选项列表",
12
- "type": "{ label: string; value: string; color?: string }[]",
13
- "default": "() => []"
14
- },
15
- {
16
- "name": "size",
17
- "description": "尺寸",
18
- "type": "'large' | 'default' | 'small'",
19
- "default": "'default'"
20
- },
21
- {
22
- "name": "isButton",
23
- "description": "是否为按钮样式",
24
- "type": "boolean",
25
- "default": "false"
26
- },
27
- {
28
- "name": "isColor",
29
- "description": "是否显示颜色,",
30
- "type": "boolean",
31
- "default": "false"
32
- },
33
- {
34
- "name": "colors",
35
- "description": "颜色列表",
36
- "type": "string[]",
37
- "default": "() => []"
38
- },
39
- {
40
- "name": "readonly",
41
- "description": "是否禁用。",
42
- "type": "boolean"
43
- }
44
- ],
45
- "events": [
46
- {
47
- "name": "update:modelValue",
48
- "description": "",
49
- "type": "unknown"
50
- }
51
- ],
52
- "slots": [],
53
- "methods": [],
54
- "types": []
55
- }
1
+ export default {
2
+ "props": [
3
+ {
4
+ "name": "modelValue",
5
+ "description": "输入值",
6
+ "type": "string | number",
7
+ "default": "undefined"
8
+ },
9
+ {
10
+ "name": "options",
11
+ "description": "选项列表",
12
+ "type": "{ label: string; value: string; color?: string }[]",
13
+ "default": "() => []"
14
+ },
15
+ {
16
+ "name": "size",
17
+ "description": "尺寸",
18
+ "type": "'large' | 'default' | 'small'",
19
+ "default": "'default'"
20
+ },
21
+ {
22
+ "name": "isButton",
23
+ "description": "是否为按钮样式",
24
+ "type": "boolean",
25
+ "default": "false"
26
+ },
27
+ {
28
+ "name": "isColor",
29
+ "description": "是否显示颜色,",
30
+ "type": "boolean",
31
+ "default": "false"
32
+ },
33
+ {
34
+ "name": "colors",
35
+ "description": "颜色列表",
36
+ "type": "string[]",
37
+ "default": "() => []"
38
+ },
39
+ {
40
+ "name": "readonly",
41
+ "description": "是否禁用。",
42
+ "type": "boolean"
43
+ }
44
+ ],
45
+ "events": [
46
+ {
47
+ "name": "update:modelValue",
48
+ "description": "",
49
+ "type": "unknown"
50
+ }
51
+ ],
52
+ "slots": [],
53
+ "methods": [],
54
+ "types": []
55
+ }
@@ -1,154 +1,178 @@
1
- export default {
2
- "props": [
3
- {
4
- "name": "columns",
5
- "description": "表格列配置",
6
- "type": "SchemaConfig[]",
7
- "default": "() => []"
8
- },
9
- {
10
- "name": "isTree",
11
- "description": "是否是树形结构",
12
- "type": "boolean",
13
- "default": "false"
14
- },
15
- {
16
- "name": "isShowNumber",
17
- "description": "是否显示序号",
18
- "type": "boolean",
19
- "default": "true"
20
- },
21
- {
22
- "name": "isMultiple",
23
- "description": "是否开启多选",
24
- "type": "boolean",
25
- "default": "false"
26
- },
27
- {
28
- "name": "isPage",
29
- "description": "是否分页",
30
- "type": "boolean",
31
- "default": "false"
32
- },
33
- {
34
- "name": "pageSizes",
35
- "description": "每页显示个数选择器的选项设置",
36
- "type": "array"
37
- },
38
- {
39
- "name": "pageSize",
40
- "description": "当前显示页数",
41
- "type": "number",
42
- "default": "100"
43
- },
44
- {
45
- "name": "rowKey",
46
- "description": "行主键",
47
- "type": "string",
48
- "default": "undefined"
49
- },
50
- {
51
- "name": "sort",
52
- "description": "排序字段",
53
- "type": "string"
54
- },
55
- {
56
- "name": "buttons",
57
- "description": "面板按钮",
58
- "type": "ButtonCompType[]",
59
- "default": "() => []"
60
- },
61
- {
62
- "name": "batchButtons",
63
- "description": "批量操作按钮配置(选中记录后显示)",
64
- "type": "ButtonCompType[]",
65
- "default": "() => []"
66
- },
67
- {
68
- "name": "actions",
69
- "description": "行内操作按钮配置",
70
- "type": "ButtonCompType[]",
71
- "default": "() => []"
72
- },
73
- {
74
- "name": "actionsMaxCount",
75
- "description": "操作列最大显示按钮数量",
76
- "type": "number",
77
- "default": "3"
78
- },
79
- {
80
- "name": "actionsLabel",
81
- "description": "操作列标题",
82
- "type": "string",
83
- "default": "'操作'"
84
- },
85
- {
86
- "name": "loadData",
87
- "description": "加载数据方法",
88
- "type": "(params: Record<string, any>) => Promise<any>"
89
- },
90
- {
91
- "name": "immediate",
92
- "description": "是否立即执行加载数据",
93
- "type": "boolean",
94
- "default": "true"
95
- },
96
- {
97
- "name": "noPadding",
98
- "description": "不要边距",
99
- "type": "boolean"
100
- },
101
- {
102
- "name": "highlightMode",
103
- "description": "高亮模式 cross 十字 row 行 column 列 cell 单元格",
104
- "type": "'cross' | 'row' | 'column' | 'cell'",
105
- "default": "'row'"
106
- }
107
- ],
108
- "events": [
109
- {
110
- "name": "select",
111
- "description": "",
112
- "type": "unknown"
113
- },
114
- {
115
- "name": "ready",
116
- "description": "",
117
- "type": "unknown"
118
- }
119
- ],
120
- "slots": [],
121
- "methods": [
122
- {
123
- "name": "refreshData",
124
- "description": "",
125
- "type": "async () => Promise<any>"
126
- },
127
- {
128
- "name": "resetData",
129
- "description": "",
130
- "type": "async () => Promise<any>"
131
- },
132
- {
133
- "name": "getSelection",
134
- "description": "",
135
- "type": "() => void"
136
- },
137
- {
138
- "name": "setSelection",
139
- "description": "",
140
- "type": "() => void"
141
- },
142
- {
143
- "name": "clearSelection",
144
- "description": "",
145
- "type": "() => void"
146
- },
147
- {
148
- "name": "getInstance",
149
- "description": "",
150
- "type": "() => void"
151
- }
152
- ],
153
- "types": []
154
- }
1
+ export default {
2
+ "props": [
3
+ {
4
+ "name": "columns",
5
+ "description": "表格列配置",
6
+ "type": "SchemaConfig[]",
7
+ "default": "() => []"
8
+ },
9
+ {
10
+ "name": "isTree",
11
+ "description": "是否是树形结构",
12
+ "type": "boolean",
13
+ "default": "false"
14
+ },
15
+ {
16
+ "name": "isShowNumber",
17
+ "description": "是否显示序号",
18
+ "type": "boolean",
19
+ "default": "true"
20
+ },
21
+ {
22
+ "name": "isMultiple",
23
+ "description": "是否开启多选",
24
+ "type": "boolean",
25
+ "default": "false"
26
+ },
27
+ {
28
+ "name": "isPage",
29
+ "description": "是否分页",
30
+ "type": "boolean",
31
+ "default": "false"
32
+ },
33
+ {
34
+ "name": "pageSizes",
35
+ "description": "每页显示个数选择器的选项设置",
36
+ "type": "array"
37
+ },
38
+ {
39
+ "name": "pageSize",
40
+ "description": "当前显示页数",
41
+ "type": "number",
42
+ "default": "100"
43
+ },
44
+ {
45
+ "name": "subColumns",
46
+ "description": "子表列配置",
47
+ "type": "any[]",
48
+ "default": "() => []"
49
+ },
50
+ {
51
+ "name": "isSubShowNumber",
52
+ "description": "是否显示子表序号",
53
+ "type": "boolean",
54
+ "default": "true"
55
+ },
56
+ {
57
+ "name": "subActions",
58
+ "description": "子表行内操作按钮配置",
59
+ "type": "ButtonCompType[]",
60
+ "default": "() => []"
61
+ },
62
+ {
63
+ "name": "loadChildren",
64
+ "description": "懒加载子节点数据",
65
+ "type": "(record: Record<string, any>) => Promise<any[]>",
66
+ "default": "null"
67
+ },
68
+ {
69
+ "name": "rowKey",
70
+ "description": "行主键",
71
+ "type": "string",
72
+ "default": "undefined"
73
+ },
74
+ {
75
+ "name": "sort",
76
+ "description": "排序字段",
77
+ "type": "string"
78
+ },
79
+ {
80
+ "name": "buttons",
81
+ "description": "面板按钮",
82
+ "type": "ButtonCompType[]",
83
+ "default": "() => []"
84
+ },
85
+ {
86
+ "name": "batchButtons",
87
+ "description": "批量操作按钮配置(选中记录后显示)",
88
+ "type": "ButtonCompType[]",
89
+ "default": "() => []"
90
+ },
91
+ {
92
+ "name": "actions",
93
+ "description": "行内操作按钮配置",
94
+ "type": "ButtonCompType[]",
95
+ "default": "() => []"
96
+ },
97
+ {
98
+ "name": "actionsMaxCount",
99
+ "description": "操作列最大显示按钮数量",
100
+ "type": "number",
101
+ "default": "3"
102
+ },
103
+ {
104
+ "name": "actionsLabel",
105
+ "description": "操作列标题",
106
+ "type": "string",
107
+ "default": "'操作'"
108
+ },
109
+ {
110
+ "name": "loadData",
111
+ "description": "加载数据方法",
112
+ "type": "(params: Record<string, any>) => Promise<any>"
113
+ },
114
+ {
115
+ "name": "immediate",
116
+ "description": "是否立即执行加载数据",
117
+ "type": "boolean",
118
+ "default": "true"
119
+ },
120
+ {
121
+ "name": "noPadding",
122
+ "description": "不要边距",
123
+ "type": "boolean"
124
+ },
125
+ {
126
+ "name": "highlightMode",
127
+ "description": "高亮模式 cross 十字 row 行 column 列 cell 单元格",
128
+ "type": "'cross' | 'row' | 'column' | 'cell'",
129
+ "default": "'row'"
130
+ }
131
+ ],
132
+ "events": [
133
+ {
134
+ "name": "select",
135
+ "description": "",
136
+ "type": "unknown"
137
+ },
138
+ {
139
+ "name": "ready",
140
+ "description": "",
141
+ "type": "unknown"
142
+ }
143
+ ],
144
+ "slots": [],
145
+ "methods": [
146
+ {
147
+ "name": "refreshData",
148
+ "description": "",
149
+ "type": "async () => Promise<any>"
150
+ },
151
+ {
152
+ "name": "resetData",
153
+ "description": "",
154
+ "type": "async () => Promise<any>"
155
+ },
156
+ {
157
+ "name": "getSelection",
158
+ "description": "",
159
+ "type": "() => void"
160
+ },
161
+ {
162
+ "name": "setSelection",
163
+ "description": "",
164
+ "type": "() => void"
165
+ },
166
+ {
167
+ "name": "clearSelection",
168
+ "description": "",
169
+ "type": "() => void"
170
+ },
171
+ {
172
+ "name": "getInstance",
173
+ "description": "",
174
+ "type": "() => void"
175
+ }
176
+ ],
177
+ "types": []
178
+ }
@@ -163,7 +163,7 @@ export default {
163
163
  },
164
164
  {
165
165
  "name": "loadChildren",
166
- "description": "子表/树形数据懒加载函数(children 为 true 时触发)",
166
+ "description": "懒加载子节点数据",
167
167
  "type": "(record: Record<string, any>) => Promise<any[]>",
168
168
  "default": "null"
169
169
  }
@@ -28,6 +28,19 @@
28
28
  </template>
29
29
  </Demo>
30
30
 
31
+ ## 日志页面示例
32
+
33
+ 结合 Table Panel 的复杂页面示例。
34
+
35
+ <Demo :source-code="pageLogCode">
36
+ <template #source>
37
+ <page-log />
38
+ </template>
39
+ <template #description>
40
+ 展示了如何使用 `j-page` 配置一个包含表格、弹窗和自定义逻辑的完整页面。
41
+ </template>
42
+ </Demo>
43
+
31
44
  ## API
32
45
 
33
46
  <ApiTable :data="pageApi" componentName="page" />
@@ -35,8 +48,10 @@
35
48
  <script setup>
36
49
  import PageBasic from '../examples/page/basic.vue'
37
50
  import PageInit from '../examples/page/init.vue'
51
+ import PageLog from '../examples/page/log.vue'
38
52
  import pageApi from './meta/page'
39
53
 
40
54
  import pageBasicCode from '../examples/page/basic.vue?raw'
41
55
  import pageInitCode from '../examples/page/init.vue?raw'
56
+ import pageLogCode from '../examples/page/log.vue?raw'
42
57
  </script>
@@ -43,6 +43,23 @@
43
43
  </template>
44
44
  </Demo>
45
45
 
46
+ ## 懒加载子表数据
47
+
48
+ 当子表数据量较大时,可以将主表记录的 `children` 设置为 `true` 作为“需要懒加载”的标识;在用户展开该行时,组件会调用 `loadChildren(record)` 异步获取子表数据,并自动写入并展开。
49
+
50
+ - 触发条件:展开行且 `originData.children === true`
51
+ - 成功后:会把返回的数组设置为该行的子数据(下次再展开不会重复请求)
52
+
53
+ <Demo :source-code="tablePanelSubTableLazyCode">
54
+ <template #source>
55
+ <table-panel-sub-table-lazy />
56
+ </template>
57
+ <template #description>
58
+ 将主表行的 <code>children</code> 设置为 <code>true</code> 作为懒加载标识;展开该行时会调用 <code>loadChildren(record)</code> 获取子表数据并写入。
59
+ </template>
60
+ </Demo>
61
+
62
+
46
63
  ## 多选功能
47
64
 
48
65
  通过 `is-multiple` 属性开启多选功能。多选功能支持两种使用场景:
@@ -189,6 +206,7 @@ import TablePanelFilter from '../examples/table-panel/filter.vue'
189
206
  import TablePanelPagination from '../examples/table-panel/pagination.vue'
190
207
  import TablePanelMultipleSelection from '../examples/table-panel/multiple-selection.vue'
191
208
  import TablePanelBatchOperations from '../examples/table-panel/batch-operations.vue'
209
+ import TablePanelSubTableLazy from '../examples/table-panel/sub-table-lazy.vue'
192
210
  import tablePanelApi from './meta/table-panel'
193
211
 
194
212
  import tablePanelBasicCode from '../examples/table-panel/basic.vue?raw'
@@ -196,4 +214,5 @@ import tablePanelFilterCode from '../examples/table-panel/filter.vue?raw'
196
214
  import tablePanelPaginationCode from '../examples/table-panel/pagination.vue?raw'
197
215
  import tablePanelMultipleSelectionCode from '../examples/table-panel/multiple-selection.vue?raw'
198
216
  import tablePanelBatchOperationsCode from '../examples/table-panel/batch-operations.vue?raw'
217
+ import tablePanelSubTableLazyCode from '../examples/table-panel/sub-table-lazy.vue?raw'
199
218
  </script>