acupoint-mixin.js 1.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
  1. /**
  2. * 穴位编辑与自定义模式 mixin
  3. * 负责:穴位图交互、时间选择、方案管理
  4. */
  5. export default {
  6. data() {
  7. return {
  8. picMode: 1, // 1设备 2穴位
  9. acupointIndex: -1,
  10. acupointList: [],
  11. curCase: [],
  12. curCaseIndex: 0,
  13. isShowTimeDrawer: false,
  14. timeRange: [[0, 1, 2, 3], [0, 5, 10, 15, 20, 25, 30, 35, 40, 45, 50, 55]],
  15. selectedHour: 0,
  16. selectedMinute: 0
  17. }
  18. },
  19. methods: {
  20. picModeChange(value) {
  21. this.picMode = value
  22. },
  23. showTimeDraw(inx) {
  24. this.acupointIndex = inx
  25. this.isShowTimeDrawer = true
  26. },
  27. bindTimeChange(e) {
  28. const val = e.detail.value
  29. this.selectedHour = this.timeRange[0][val[0]]
  30. this.selectedMinute = this.timeRange[1][val[1]]
  31. },
  32. cancelAijiuTime(val) {
  33. this.isShowTimeDrawer = false
  34. if (val == 1 && this.acupointIndex >= 0) {
  35. const sumMinutes = this.selectedHour * 60 + this.selectedMinute
  36. const point = this.acupointList[this.acupointIndex]
  37. this.curCase = [{
  38. id: point.id,
  39. time: sumMinutes,
  40. _x: point._x || 0,
  41. _y: point._y || 0
  42. }]
  43. this.curCaseIndex = this.acupointIndex
  44. }
  45. }
  46. }
  47. }