ai-form-field-picker.vue 932 B

123456789101112131415161718192021222324252627282930313233343536373839
  1. <script>
  2. import IeFormPickerSingle from "@/pages/ie/components/picker/ie-form-picker-single.vue";
  3. import AIFormRuleField from "@/pages/ie/components/ai-form/items/templates/AIFormRuleField";
  4. import AIFormRuleOptions from "@/pages/ie/components/ai-form/items/templates/AIFormRuleOptions";
  5. export default {
  6. name: "ai-form-field-picker",
  7. extends: IeFormPickerSingle,
  8. mixins: [AIFormRuleField, AIFormRuleOptions],
  9. data() {
  10. return {
  11. item: null
  12. }
  13. },
  14. computed: {
  15. pickerValue() {
  16. return this.formModel[this.rule.fieldName]
  17. },
  18. pickerLabel() {
  19. return this.rule.label
  20. },
  21. pickerRemark() {
  22. return this.rule.description || this.remark
  23. }
  24. },
  25. methods: {
  26. handleConfirm({value: [item]}) {
  27. this.item = item
  28. this.formModel[this.rule.fieldName] = this.getValue(item)
  29. this.show = false
  30. this.clearValidate()
  31. }
  32. }
  33. }
  34. </script>
  35. <style scoped>
  36. </style>