修改Array.indexOf

This commit is contained in:
yjb 2021-09-22 18:54:10 +08:00
parent aaae404b2a
commit 492ee4fae5

View File

@ -25,7 +25,6 @@ export default {
methods: { methods: {
// //
expressionChange() { expressionChange() {
// - // -
this.isShow = false; this.isShow = false;
// [0123456] // [0123456]
@ -151,7 +150,6 @@ export default {
} }
continue; continue;
} }
// //
if (this.checkDate(YY + '-' + MM + '-' + thisDD + ' 00:00:00') !== true && this.dayRule !== 'workDay' && this.dayRule !== 'lastWeek' && this.dayRule !== 'lastDay') { if (this.checkDate(YY + '-' + MM + '-' + thisDD + ' 00:00:00') !== true && this.dayRule !== 'workDay' && this.dayRule !== 'lastWeek' && this.dayRule !== 'lastDay') {
resetDay(); resetDay();
@ -160,7 +158,6 @@ export default {
// //
if (this.dayRule == 'lastDay') { if (this.dayRule == 'lastDay') {
// //
if (this.checkDate(YY + '-' + MM + '-' + thisDD + ' 00:00:00') !== true) { if (this.checkDate(YY + '-' + MM + '-' + thisDD + ' 00:00:00') !== true) {
while (DD > 0 && this.checkDate(YY + '-' + MM + '-' + thisDD + ' 00:00:00') !== true) { while (DD > 0 && this.checkDate(YY + '-' + MM + '-' + thisDD + ' 00:00:00') !== true) {
DD--; DD--;
@ -200,7 +197,7 @@ export default {
// //
let thisWeek = this.formatDate(new Date(YY + '-' + MM + '-' + DD + ' 00:00:00'), 'week'); let thisWeek = this.formatDate(new Date(YY + '-' + MM + '-' + DD + ' 00:00:00'), 'week');
// dayRuleSup // dayRuleSup
if (Array.indexOf(this.dayRuleSup, thisWeek) < 0) { if (this.dayRuleSup.indexOf(thisWeek) < 0) {
// //
if (Di == DDate.length - 1) { if (Di == DDate.length - 1) {
resetDay(); resetDay();
@ -241,11 +238,9 @@ export default {
} }
// 1005 // 1005
DD = DD < 10 ? '0' + DD : DD; DD = DD < 10 ? '0' + DD : DD;
// //
goHour: for (let hi = hIdx; hi < hDate.length; hi++) { goHour: for (let hi = hIdx; hi < hDate.length; hi++) {
let hh = hDate[hi] < 10 ? '0' + hDate[hi] : hDate[hi] let hh = hDate[hi] < 10 ? '0' + hDate[hi] : hDate[hi]
// //
if (nMin > mDate[mDate.length - 1]) { if (nMin > mDate[mDate.length - 1]) {
resetMin(); resetMin();
@ -266,7 +261,6 @@ export default {
// "" // ""
goMin: for (let mi = mIdx; mi < mDate.length; mi++) { goMin: for (let mi = mIdx; mi < mDate.length; mi++) {
let mm = mDate[mi] < 10 ? '0' + mDate[mi] : mDate[mi]; let mm = mDate[mi] < 10 ? '0' + mDate[mi] : mDate[mi];
// //
if (nSecond > sDate[sDate.length - 1]) { if (nSecond > sDate[sDate.length - 1]) {
resetSecond(); resetSecond();