mutations.js 2.6 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192
  1. export default {
  2. setPlanList(state, planList) {
  3. planList.forEach((planId) => {
  4. if(!state.planList.some(p => p.id == planId)) {
  5. let plan = {};
  6. plan.id = planId;
  7. plan.checked = false;
  8. plan.carline = [];
  9. plan.case_list = [109, 110, 111, 112, 113]
  10. plan.cluster = 1
  11. plan.create_time = ""
  12. plan.creator = ""
  13. plan.delete_flag = 0
  14. plan.description = ""
  15. plan.function = [1, 2]
  16. plan.language = [1, 2]
  17. plan.level = [1, 2]
  18. plan.market = [1, 2]
  19. plan.name = ""
  20. plan.platform = [1, 2]
  21. plan.project = [1, 2]
  22. plan.sub_function = [1, 2]
  23. plan.update_time = ""
  24. plan.uuid = ""
  25. state.planList.push(plan)
  26. }
  27. });
  28. },
  29. setMaualPlanList(state, planList) {
  30. let maualPlanList = state.planList;
  31. maualPlanList.forEach(p => {
  32. let plan = planList.find(s => s.id == p.id);
  33. if (plan) {
  34. for(let key in p) {
  35. p[key] = plan[key];
  36. }
  37. }
  38. })
  39. },
  40. setAutoPlanList(state, planList) {
  41. planList.forEach((planId) => {
  42. if(!state.autoPlanList.some(p => p.id == planId)) {
  43. let plan = {}
  44. plan.id = planId < 100 ? planId + 101 : planId;
  45. plan.checked = false;
  46. plan.active_time = null
  47. plan.active_user = null
  48. plan.case_quantity = 5
  49. plan.comment = null
  50. plan.create_time = "2023-04-21T06:55:18.403Z"
  51. plan.create_user = "testserver@audi.com.cn"
  52. plan.create_user_name = "testserver@audi.com.cn"
  53. plan.description = ""
  54. plan.is_delete = 1
  55. plan.lastrun_time = null
  56. plan.modify_time = null
  57. plan.modify_user = null
  58. plan.modify_user_name = null
  59. plan.name = "testplan"
  60. plan.repeats = ["1", "1", "1", "1", "1"]
  61. plan.repository = "repo3"
  62. plan.skips = ["not", "not", "not", "not", "not"]
  63. plan.skips_count = 0
  64. plan.task_array = null
  65. plan.task_quantity = null
  66. plan.testcase_array = [2863, 2824, 2915, 2820, 2722]
  67. plan.type = null
  68. plan.auto = true;
  69. state.autoPlanList.push(plan)
  70. }
  71. });
  72. },
  73. setAutoPlanDetail(state, planDetail) {
  74. planDetail = planDetail.data;
  75. let id = planDetail.id;
  76. let detail = state.autoPlanList.find(p => p.id == id);
  77. if (detail) {
  78. for (let key in planDetail) {
  79. detail[key] = planDetail[key];
  80. }
  81. }
  82. },
  83. setTaskList(state, taskList) {
  84. taskList.forEach((task) => {
  85. if(!state.taskList.some(p => p.id == task.id)) {
  86. task.checked = false;
  87. state.taskList.push(task)
  88. }
  89. });
  90. },
  91. };