|
@@ -116,9 +116,13 @@ export default {
|
116
|
116
|
if (Number(_stoptimeArr[1]) === 30) {
|
117
|
117
|
_stopHalfHour++;
|
118
|
118
|
}
|
119
|
|
- while (_startHalfHour <= _stopHalfHour) {
|
120
|
|
- _timeInfo[timeItem.week].push(_startHalfHour);
|
121
|
|
- _startHalfHour++;
|
|
119
|
+ if (_stopHalfHour === _startHalfHour + 1) {
|
|
120
|
+ _timeInfo[timeItem.week].push(_stopHalfHour);
|
|
121
|
+ } else {
|
|
122
|
+ while (_startHalfHour < _stopHalfHour) {
|
|
123
|
+ _startHalfHour++;
|
|
124
|
+ _timeInfo[timeItem.week].push(_startHalfHour);
|
|
125
|
+ }
|
122
|
126
|
}
|
123
|
127
|
}
|
124
|
128
|
this.timeInfo = _timeInfo;
|
|
@@ -137,12 +141,19 @@ export default {
|
137
|
141
|
prevHalfHour: null
|
138
|
142
|
};
|
139
|
143
|
for (let index = 0; index < _dayHalfHours.length; index++) {
|
140
|
|
- const _halfHour = _dayHalfHours[index];
|
|
144
|
+ let _halfHour = _dayHalfHours[index];
|
141
|
145
|
let _bigTime = Math.floor(_halfHour / 2);
|
142
|
146
|
_bigTime = _bigTime > 9 ? _bigTime : `0${_bigTime}`;
|
143
|
147
|
let _time = `${_bigTime}:${_halfHour % 2 === 0 ? "00" : "30"}`;
|
|
148
|
+ let _startHalfHour = _halfHour - 1;
|
|
149
|
+ let _startBigTime = Math.floor((_halfHour - 1) / 2);
|
|
150
|
+ _startBigTime =
|
|
151
|
+ _startBigTime > 9 ? _startBigTime : `0${_startBigTime}`;
|
|
152
|
+ let _startTime = `${_startBigTime}:${
|
|
153
|
+ _startHalfHour % 2 === 0 ? "00" : "30"
|
|
154
|
+ }`;
|
144
|
155
|
if (!_dayTimeInfo.starttime) {
|
145
|
|
- _dayTimeInfo.starttime = _time;
|
|
156
|
+ _dayTimeInfo.starttime = _startTime;
|
146
|
157
|
_dayTimeInfo.stoptime = _time;
|
147
|
158
|
_dayTimeInfo.prevHalfHour = _halfHour;
|
148
|
159
|
} else {
|
|
@@ -150,9 +161,12 @@ export default {
|
150
|
161
|
_times.push({
|
151
|
162
|
week: weekValue,
|
152
|
163
|
starttime: _dayTimeInfo.starttime,
|
153
|
|
- stoptime: _dayTimeInfo.stoptime
|
|
164
|
+ stoptime:
|
|
165
|
+ _dayTimeInfo.stoptime === "24:00"
|
|
166
|
+ ? "23:59"
|
|
167
|
+ : _dayTimeInfo.stoptime
|
154
|
168
|
});
|
155
|
|
- _dayTimeInfo.starttime = _time;
|
|
169
|
+ _dayTimeInfo.starttime = _startTime;
|
156
|
170
|
_dayTimeInfo.stoptime = _time;
|
157
|
171
|
_dayTimeInfo.prevHalfHour = _halfHour;
|
158
|
172
|
} else {
|
|
@@ -175,13 +189,26 @@ export default {
|
175
|
189
|
},
|
176
|
190
|
// 显示每个单元格标题
|
177
|
191
|
getTimeTitle(weekItemLabel, halfHour) {
|
|
192
|
+ let _startTime = "";
|
|
193
|
+ let _endTime = "";
|
|
194
|
+ let _startHalfHour = parseInt((halfHour - 1) / 2);
|
|
195
|
+ _startHalfHour =
|
|
196
|
+ _startHalfHour > 9 ? _startHalfHour : `0${_startHalfHour}`;
|
|
197
|
+ let _startMinute = (halfHour - 1) % 2 === 0 ? "00" : "30";
|
|
198
|
+ if (_startHalfHour === 24 && _startMinute === "00") {
|
|
199
|
+ _startTime = "23:59";
|
|
200
|
+ } else {
|
|
201
|
+ _startTime = `${_startHalfHour}:${_startMinute}`;
|
|
202
|
+ }
|
178
|
203
|
let _hour = parseInt(halfHour / 2);
|
179
|
204
|
_hour = _hour > 9 ? _hour : `0${_hour}`;
|
180
|
205
|
let _minute = halfHour % 2 === 0 ? "00" : "30";
|
181
|
206
|
if (_hour === 24 && _minute === "00") {
|
182
|
|
- return `${weekItemLabel} 23:59`;
|
|
207
|
+ _endTime = "23:59";
|
|
208
|
+ } else {
|
|
209
|
+ _endTime = `${_hour}:${_minute}`;
|
183
|
210
|
}
|
184
|
|
- return `${weekItemLabel} ${_hour}:${_minute}`;
|
|
211
|
+ return `${weekItemLabel} ${_startTime}-${_endTime}`;
|
185
|
212
|
},
|
186
|
213
|
// 设置时间策略
|
187
|
214
|
toSetTimeStrategy(weekIndex, halfHour) {
|