diff --git a/src/views/work/abnormal_process/index.vue b/src/views/work/abnormal_process/index.vue index 0c55a85..6639bc0 100644 --- a/src/views/work/abnormal_process/index.vue +++ b/src/views/work/abnormal_process/index.vue @@ -25,6 +25,8 @@ >{{ item.id }} {{ item.specification }} @@ -128,7 +130,7 @@
@@ -663,23 +665,8 @@ export default { let nowPass = this.nowPass let temp = nowPass.step % 8 - if (temp === 1) { - this.circleStart = 0 - } else if (temp === 2) { - this.circleStart = 45 - } else if (temp === 3) { - this.circleStart = 90 - } else if (temp === 0) { - this.circleStart = 315 - } else if (temp === 4) { - this.circleStart = 135 - } else if (temp === 5) { - this.circleStart = 180 - } else if (temp === 6) { - this.circleStart = 225 - } else if (temp === 7) { - this.circleStart = 270 - } + // 计算circleStart的角度,1~7分别对应0,45,90,135,180,225,270,0对应315 + this.circleStart = temp === 0 ? 315 : (temp - 1) * 45 }) }, diff --git a/src/views/work/process/index.vue b/src/views/work/process/index.vue index 3d2aa53..724d9d8 100644 --- a/src/views/work/process/index.vue +++ b/src/views/work/process/index.vue @@ -25,6 +25,8 @@ {{ item.specification }} @@ -127,7 +129,7 @@
@@ -666,23 +668,8 @@ export default { this.stepFlag = this.nowPass.state let nowPass = this.nowPass let temp = nowPass.step % 8 - if (temp === 1) { - this.circleStart = 0 - } else if (temp === 2) { - this.circleStart = 45 - } else if (temp === 3) { - this.circleStart = 90 - } else if (temp === 0) { - this.circleStart = 315 - } else if (temp === 4) { - this.circleStart = 135 - } else if (temp === 5) { - this.circleStart = 180 - } else if (temp === 6) { - this.circleStart = 225 - } else if (temp === 7) { - this.circleStart = 270 - } + // 计算circleStart的角度,1~7分别对应0,45,90,135,180,225,270,0对应315 + this.circleStart = temp === 0 ? 315 : (temp - 1) * 45 }) },