@a2simcode/ui 0.0.166 → 0.0.167

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,113 +1,119 @@
1
- export default {
2
- "props": [
3
- {
4
- "name": "modelValue",
5
- "description": "输入值",
6
- "type": "Record<string, any>[]",
7
- "default": "() => []"
8
- },
9
- {
10
- "name": "columns",
11
- "description": "列配置",
12
- "type": "SchemaConfig[]",
13
- "default": "() => []"
14
- },
15
- {
16
- "name": "editConfig",
17
- "description": "编辑参数",
18
- "type": "EditConfigType",
19
- "default": "() => ({})"
20
- },
21
- {
22
- "name": "isCompact",
23
- "description": "是否紧凑模式",
24
- "type": "boolean",
25
- "default": "false"
26
- },
27
- {
28
- "name": "showNum",
29
- "description": "是否显示序号",
30
- "type": "boolean",
31
- "default": "false"
32
- },
33
- {
34
- "name": "showChar",
35
- "description": "是否显示字母",
36
- "type": "boolean",
37
- "default": "false"
38
- },
39
- {
40
- "name": "isWrap",
41
- "description": "是否换行",
42
- "type": "boolean",
43
- "default": "false"
44
- },
45
- {
46
- "name": "id",
47
- "description": "字段ID前缀",
48
- "type": "string",
49
- "default": "''"
50
- }
51
- ],
52
- "events": [
53
- {
54
- "name": "update:modelValue",
55
- "description": "v-model 双向绑定更新事件",
56
- "type": "Array"
57
- },
58
- {
59
- "name": "change",
60
- "description": "变更事件",
61
- "type": "{\n id: string\n value: any\n data: any\n formData: Record<string, any>\n tableData: Record<string, any>[]\n type: 'add' | 'delete' | 'update' | 'sort'\n}"
62
- },
63
- {
64
- "name": "rowChange",
65
- "description": "行变更事件",
66
- "type": "Record"
67
- }
68
- ],
69
- "slots": [],
70
- "methods": [],
71
- "types": [
72
- {
73
- "name": "EditConfigType",
74
- "properties": [
75
- {
76
- "name": "isAddBtn",
77
- "type": "boolean",
78
- "description": "是否显示添加按钮"
79
- },
80
- {
81
- "name": "addBtnText",
82
- "type": "string",
83
- "description": "添加按钮文本"
84
- },
85
- {
86
- "name": "buttonsAlign",
87
- "type": "'left' | 'center' | 'right'",
88
- "description": "按钮对齐方式【只支持input-rows组件】"
89
- },
90
- {
91
- "name": "isRemoveBtn",
92
- "type": "boolean",
93
- "description": "是否显示删除按钮"
94
- },
95
- {
96
- "name": "readonly",
97
- "type": "boolean",
98
- "description": "是否只读"
99
- },
100
- {
101
- "name": "drag",
102
- "type": "boolean",
103
- "description": "是否支持拖拽排序"
104
- },
105
- {
106
- "name": "isNullValue",
107
- "type": "boolean",
108
- "description": "是否为空值,默认true,为false时,不能为空值 【只支持input-rows组件】"
109
- }
110
- ]
111
- }
112
- ]
113
- }
1
+ export default {
2
+ "props": [
3
+ {
4
+ "name": "modelValue",
5
+ "description": "输入值",
6
+ "type": "Record<string, any>[]",
7
+ "default": "() => []"
8
+ },
9
+ {
10
+ "name": "columns",
11
+ "description": "列配置",
12
+ "type": "SchemaConfig[]",
13
+ "default": "() => []"
14
+ },
15
+ {
16
+ "name": "editConfig",
17
+ "description": "编辑参数",
18
+ "type": "EditConfigType",
19
+ "default": "() => ({})"
20
+ },
21
+ {
22
+ "name": "isCompact",
23
+ "description": "是否紧凑模式",
24
+ "type": "boolean",
25
+ "default": "false"
26
+ },
27
+ {
28
+ "name": "showNum",
29
+ "description": "是否显示序号",
30
+ "type": "boolean",
31
+ "default": "false"
32
+ },
33
+ {
34
+ "name": "showChar",
35
+ "description": "是否显示字母",
36
+ "type": "boolean",
37
+ "default": "false"
38
+ },
39
+ {
40
+ "name": "isWrap",
41
+ "description": "是否换行",
42
+ "type": "boolean",
43
+ "default": "false"
44
+ },
45
+ {
46
+ "name": "id",
47
+ "description": "字段ID前缀",
48
+ "type": "string",
49
+ "default": "''"
50
+ },
51
+ {
52
+ "name": "actions",
53
+ "description": "自定义按钮",
54
+ "type": "ButtonCompType[]",
55
+ "default": "() => []"
56
+ }
57
+ ],
58
+ "events": [
59
+ {
60
+ "name": "update:modelValue",
61
+ "description": "v-model 双向绑定更新事件",
62
+ "type": "Array"
63
+ },
64
+ {
65
+ "name": "change",
66
+ "description": "变更事件",
67
+ "type": "{\r\n id: string\r\n value: any\r\n data: any\r\n formData: Record<string, any>\r\n tableData: Record<string, any>[]\r\n type: 'add' | 'delete' | 'update' | 'sort'\r\n}"
68
+ },
69
+ {
70
+ "name": "rowChange",
71
+ "description": "行变更事件",
72
+ "type": "Record"
73
+ }
74
+ ],
75
+ "slots": [],
76
+ "methods": [],
77
+ "types": [
78
+ {
79
+ "name": "EditConfigType",
80
+ "properties": [
81
+ {
82
+ "name": "isAddBtn",
83
+ "type": "boolean",
84
+ "description": "是否显示添加按钮"
85
+ },
86
+ {
87
+ "name": "addBtnText",
88
+ "type": "string",
89
+ "description": "添加按钮文本"
90
+ },
91
+ {
92
+ "name": "buttonsAlign",
93
+ "type": "'left' | 'center' | 'right'",
94
+ "description": "按钮对齐方式【只支持input-rows组件】"
95
+ },
96
+ {
97
+ "name": "isRemoveBtn",
98
+ "type": "boolean",
99
+ "description": "是否显示删除按钮"
100
+ },
101
+ {
102
+ "name": "readonly",
103
+ "type": "boolean",
104
+ "description": "是否只读"
105
+ },
106
+ {
107
+ "name": "drag",
108
+ "type": "boolean",
109
+ "description": "是否支持拖拽排序"
110
+ },
111
+ {
112
+ "name": "isNullValue",
113
+ "type": "boolean",
114
+ "description": "是否为空值,默认true,为false时,不能为空值 【只支持input-rows组件】"
115
+ }
116
+ ]
117
+ }
118
+ ]
119
+ }
@@ -17,6 +17,7 @@
17
17
 
18
18
  <script setup>
19
19
  import { ref, reactive, h, onMounted } from 'vue'
20
+ import { ElMessage } from 'element-plus'
20
21
 
21
22
  const formRef = ref()
22
23
 
@@ -31,6 +32,37 @@ const formConfig = reactive({
31
32
  const handleGetFormData = () => {
32
33
  console.log(formRef.value.getFormData(), 'getFormData')
33
34
  }
35
+ const inputRowsActions = [
36
+ {
37
+ id: 'open',
38
+ label: '打开弹窗',
39
+ config: {
40
+ type: 'link',
41
+ icon: 'material-symbols-light:open-in-new',
42
+ },
43
+ click: ({ openLayer }) => {
44
+ openLayer({
45
+ title: '示例弹窗',
46
+ width: 600,
47
+ name: {
48
+ setup(props, { expose }) {
49
+ expose({
50
+ ok: () => {
51
+ ElMessage.success('点击了确定')
52
+ return { data: '123' }
53
+ },
54
+ })
55
+ return () =>
56
+ h('div', { style: 'padding: 16px' }, '这是一个通过 j-buttons 点击打开的弹窗。')
57
+ },
58
+ },
59
+ afterOk: (data)=> {
60
+ console.log(data, 'afterOk')
61
+ }
62
+ })
63
+ },
64
+ },
65
+ ]
34
66
 
35
67
  const initSchema = [
36
68
  {
@@ -426,12 +458,8 @@ const schema = [
426
458
  {
427
459
  type: 'j-input-rows',
428
460
  config: {
429
- // label: '字段信息',
430
461
  field: 'fields',
431
462
  labelWidth: '48px',
432
- // isRemoveBtn: false,
433
- // isAddBtn: false,
434
- // drag: false,
435
463
  },
436
464
  children: [
437
465
  {
@@ -475,6 +503,15 @@ const schema = [
475
503
  ],
476
504
  },
477
505
  ],
506
+ getCompConfig: ({ formData }) => {
507
+ let actions = []
508
+ if (formData.checkbox == '1') {
509
+ actions = inputRowsActions
510
+ }
511
+ return {
512
+ actions: actions,
513
+ }
514
+ },
478
515
  },
479
516
  ],
480
517
  },
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@a2simcode/ui",
3
- "version": "0.0.166",
3
+ "version": "0.0.167",
4
4
  "description": "A Vue 3 UI Component Library",
5
5
  "type": "module",
6
6
  "main": "./dist/simcode-ui.umd.js",