742a2726ed806c17403e2dc46b03e1539e3b7eea.svn-base 1.9 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465
  1. # JPopup 弹窗选择组件
  2. ## 参数配置
  3. | 参数 | 类型 | 必填 |说明|
  4. |--------------|---------|----|---------|
  5. | placeholder |string | | placeholder |
  6. | code |string | | online报表编码 |
  7. | orgFields |string | | online报表中显示的列,多个以逗号隔开 |
  8. | destFields |string | | 回调对象的属性,多个以逗号隔开,其顺序和orgFields一一对应 |
  9. | field |string | | v-model模式专用,表示从destFields中选择一个属性的值返回给当前组件 |
  10. | triggerChange |Boolean | | v-decorator模式下需设置成true |
  11. | callback(事件) |function | | 回调事件,v-decorator模式下用到,用于设置form控件的值 |
  12. 使用示例
  13. ----
  14. ```vue
  15. <template>
  16. <a-form :form="form">
  17. <a-form-item label="v-model模式指定一个值返回至当前组件" style="width: 300px">
  18. <j-popup
  19. v-model="selectValue"
  20. code="user_msg"
  21. org-fields="username,realname"
  22. dest-fields="popup,other"
  23. field="popup"/>
  24. {{ selectValue }}
  25. </a-form-item>
  26. <a-form-item label="v-decorator模式支持回调多个值至当前表单" style="width: 300px">
  27. <j-popup
  28. v-decorator="['one']"
  29. :trigger-change="true"
  30. code="user_msg"
  31. org-fields="username,realname"
  32. dest-fields="one,two"
  33. @callback="popupCallback"/>
  34. {{ getFormFieldValue('one') }}
  35. </a-form-item>
  36. <a-form-item label="v-decorator模式被回调的值" style="width: 300px">
  37. <a-input v-decorator="['two']"></a-input>
  38. </a-form-item>
  39. </a-form >
  40. </template>
  41. <script>
  42. export default {
  43. data() {
  44. return {
  45. form: this.$form.createForm(this),
  46. selectValue:"",
  47. }
  48. },
  49. methods:{
  50. getFormFieldValue(field){
  51. return this.form.getFieldValue(field)
  52. },
  53. popupCallback(row){
  54. this.form.setFieldsValue(row)
  55. }
  56. }
  57. }
  58. </script>