report-health-patient.ts 1.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647
  1. import DictionariesBehavior from "../../../../core/behavior/dictionaries.behavior";
  2. // module/health/components/report-health-patient/report-health-patient.ts
  3. Component({
  4. behaviors: [DictionariesBehavior],
  5. options: {
  6. multipleSlots: true,
  7. },
  8. properties: {
  9. dataset: { type: Object },
  10. loading: { type: Boolean, value: false },
  11. message: { type: String, value: '' },
  12. },
  13. data: {
  14. hobbyFlavor: [] as string[],
  15. foodAllergy: [] as string[],
  16. specialPeriod: [] as string[],
  17. job: [] as string[],
  18. phone: '',
  19. cardno: '',
  20. },
  21. observers: {
  22. // 'dataset.phone'(value: string) {
  23. // this.setData({ phone: value?.slice(0, 3).padEnd(12, '*') ?? '' })
  24. // },
  25. // 'dataset.cardno'(value: string) {
  26. // this.setData({ cardno: value?.slice(0, 3).padEnd(18, '*') ?? '' })
  27. // },
  28. 'dataset.womenSpecialPeriod'(value: string) {
  29. const values = value?.split(',') ?? []
  30. this.setData({ specialPeriod: values.filter(Boolean) })
  31. },
  32. 'dataset.job'(value: string) {
  33. const values = value?.split(',') ?? []
  34. this.setData({ job: values.filter(Boolean) })
  35. },
  36. 'dataset.hobbyFlavor'(value: string) {
  37. const values = value?.split(',') ?? []
  38. this.setData({ hobbyFlavor: values.filter(Boolean) })
  39. },
  40. 'dataset.foodAllergy'(value: string) {
  41. const values = value?.split(',') ?? []
  42. this.setData({ foodAllergy: values.filter(Boolean) })
  43. }
  44. }
  45. })