@a2simcode/ui 0.0.157 → 0.0.158

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.
@@ -22,6 +22,38 @@ const formConfig = reactive({
22
22
  span: 24,
23
23
  })
24
24
 
25
+ const formatOptionsMap = {
26
+ 1: [
27
+ { value: 'mmdd', label: 'mmdd' },
28
+ { value: 'ddmm', label: 'ddmm' },
29
+ { value: 'mmyy', label: 'mmyy' },
30
+ { value: 'yymm', label: 'yymm' },
31
+ { value: 'yyyy', label: 'yyyy' },
32
+ { value: 'yy', label: 'yy' },
33
+ { value: 'yyyymm', label: 'yyyymm' },
34
+ { value: 'yymmdd', label: 'yymmdd' },
35
+ { value: 'yyyymmdd', label: 'yyyymmdd' },
36
+ ],
37
+ 2: [
38
+ { value: '000', label: '000' },
39
+ { value: '0000', label: '0000' },
40
+ { value: '00000', label: '00000' },
41
+ { value: '000000', label: '000000' },
42
+ ],
43
+ 3: [
44
+ { value: 'code', label: '公司编号' },
45
+ { value: 'name', label: '公司名称' },
46
+ ],
47
+ 4: [
48
+ { value: 'code', label: '部门编号' },
49
+ { value: 'name', label: '部门名称' },
50
+ ],
51
+ 5: [
52
+ { value: 'code', label: '用户编号' },
53
+ { value: 'name', label: '用户名称' },
54
+ ],
55
+ }
56
+
25
57
  const schema = [
26
58
  {
27
59
  id: 'j_Name',
@@ -84,11 +116,16 @@ const schema = [
84
116
  },
85
117
  {
86
118
  id: 'ruleFormat.formatStr',
87
- type: 'j-input',
88
119
  config: {
89
120
  field: 'formatStr',
90
121
  label: '格式',
91
122
  },
123
+ getCompType: ({ row }) => {
124
+ if (row?.itemType === '0') return 'j-input'
125
+ if (!row?.itemType || row?.itemType === '6') return 'span'
126
+ return 'j-select'
127
+ },
128
+ getCompConfig: ({ row }) => ({ options: formatOptionsMap[row?.itemType] }),
92
129
  },
93
130
  {
94
131
  id: 'ruleFormat.stepValue',
@@ -115,7 +152,7 @@ onMounted(() => {
115
152
  ruleFormat: [
116
153
  {
117
154
  itemType: '1',
118
- formatStr: 'yyyyMMdd',
155
+ formatStr: 'yymmdd',
119
156
  stepValue: 1,
120
157
  initValue: 1,
121
158
  },
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@a2simcode/ui",
3
- "version": "0.0.157",
3
+ "version": "0.0.158",
4
4
  "description": "A Vue 3 UI Component Library",
5
5
  "type": "module",
6
6
  "main": "./dist/simcode-ui.umd.js",