sadais-piui 1.2.7-beta2 → 1.2.7-beta5

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.
@@ -13,6 +13,7 @@
13
13
  </template>
14
14
 
15
15
  <script>
16
+ import Emitter from '../../mixin/emitter'
16
17
  import ValueSync from '../../mixin/value-sync'
17
18
  import { parentInit } from '../../mixin/props-sync'
18
19
  import { getConfig } from '../../config'
@@ -24,6 +25,7 @@ export default {
24
25
  name: 'PiCheckboxGroup',
25
26
  // 混入自定义样式customStyle和customClass
26
27
  mixins: [
28
+ Emitter,
27
29
  ValueSync,
28
30
  parentInit([
29
31
  'value',
@@ -184,6 +186,8 @@ export default {
184
186
  })
185
187
  this.val = vals
186
188
  this.handleEmitChange()
189
+ this.dispatch('PiForm', 'form-change', this.val)
190
+ this.dispatch('PiFormItem', 'form-change', this.val)
187
191
  }
188
192
  }
189
193
  }
@@ -234,10 +234,11 @@ export default {
234
234
  },
235
235
  watch: {
236
236
  rules: {
237
- handler(val) {
238
- this.validRules = val
239
- },
240
- deep: true
237
+ deep: true,
238
+ immediate: true,
239
+ handler(value) {
240
+ this.setRules(value)
241
+ }
241
242
  }
242
243
  },
243
244
  methods: {
@@ -449,7 +449,10 @@ export default {
449
449
  resolve(_getResolve())
450
450
  })
451
451
  .catch(({ errors, fields }) => {
452
- console.log(TAG, '表单校验失败', this.prop, errors, fields)
452
+ console.log(TAG, '表单校验失败', `字段名:${this.prop},字段值:${fieldValue}`)
453
+ console.log(TAG, '字段值:', fieldValue)
454
+ console.log(TAG, '错误信息', errors)
455
+ console.log(TAG, '校验规则', fields)
453
456
  // 记录状态和报错信息
454
457
  this.validateState = 'error'
455
458
  this.validateMessage = errors ? errors[0].message : ''
@@ -328,8 +328,8 @@ export default {
328
328
  handleChange(value) {
329
329
  this.val = value
330
330
  this.handleEmitChange()
331
- this.dispatch('PiForm', 'form-change', value)
332
- this.dispatch('PiFormItem', 'form-change', value)
331
+ this.dispatch('PiForm', 'form-change', this.val)
332
+ this.dispatch('PiFormItem', 'form-change', this.val)
333
333
  }
334
334
  }
335
335
  }
@@ -15,6 +15,7 @@
15
15
  </template>
16
16
 
17
17
  <script>
18
+ import Emitter from '../../mixin/emitter'
18
19
  import ValueSync from '../../mixin/value-sync'
19
20
  import { parentInit } from '../../mixin/props-sync'
20
21
  import { getConfig } from '../../config'
@@ -26,6 +27,7 @@ export default {
26
27
  name: 'PiRadioGroup',
27
28
  // 混入自定义样式customStyle和customClass
28
29
  mixins: [
30
+ Emitter,
29
31
  ValueSync,
30
32
  // parentInit 混入子组件要继承的属性
31
33
  parentInit([
@@ -181,6 +183,8 @@ export default {
181
183
  this.val = childName
182
184
  }
183
185
  this.handleEmitChange()
186
+ this.dispatch('PiForm', 'form-change', this.val)
187
+ this.dispatch('PiFormItem', 'form-change', this.val)
184
188
  }
185
189
  }
186
190
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "sadais-piui",
3
- "version": "1.2.7beta2",
3
+ "version": "1.2.7beta5",
4
4
  "description": "piui组件库",
5
5
  "main": "index.js",
6
6
  "scripts": {