|
|
|
@ -149,6 +149,10 @@ export default {
|
|
|
|
8, 8, 9, 9, 10, 10, 11, 11, 12, 12, 13, 13, 14, 14, 15, 15, 16, 16, 17,
|
|
|
|
8, 8, 9, 9, 10, 10, 11, 11, 12, 12, 13, 13, 14, 14, 15, 15, 16, 16, 17,
|
|
|
|
17, 18, 18,
|
|
|
|
17, 18, 18,
|
|
|
|
],
|
|
|
|
],
|
|
|
|
|
|
|
|
hourListTmp: [
|
|
|
|
|
|
|
|
8, 8, 9, 9, 10, 10, 11, 11, 12, 12, 13, 13, 14, 14, 15, 15, 16, 16, 17,
|
|
|
|
|
|
|
|
17, 18, 18,
|
|
|
|
|
|
|
|
],
|
|
|
|
year: new Date().getFullYear(),
|
|
|
|
year: new Date().getFullYear(),
|
|
|
|
month: new Date().getMonth() + 1,
|
|
|
|
month: new Date().getMonth() + 1,
|
|
|
|
day: new Date().getDate(),
|
|
|
|
day: new Date().getDate(),
|
|
|
|
@ -181,8 +185,8 @@ export default {
|
|
|
|
let box = document.querySelector(".time-container");
|
|
|
|
let box = document.querySelector(".time-container");
|
|
|
|
box.style.opacity = 1;
|
|
|
|
box.style.opacity = 1;
|
|
|
|
if (this.isShow) {
|
|
|
|
if (this.isShow) {
|
|
|
|
|
|
|
|
this.initHours();
|
|
|
|
// console.log(this.selectHour);
|
|
|
|
// console.log(this.selectHour);
|
|
|
|
|
|
|
|
|
|
|
|
this.$nextTick(() => {
|
|
|
|
this.$nextTick(() => {
|
|
|
|
this.selectDate = new Date(
|
|
|
|
this.selectDate = new Date(
|
|
|
|
new Date(this.datetime || new Date()).format("yyyy-MM-dd 00:00")
|
|
|
|
new Date(this.datetime || new Date()).format("yyyy-MM-dd 00:00")
|
|
|
|
@ -198,7 +202,7 @@ export default {
|
|
|
|
? new Date(this.datetime || new Date()).getHours()
|
|
|
|
? new Date(this.datetime || new Date()).getHours()
|
|
|
|
: "8";
|
|
|
|
: "8";
|
|
|
|
let ind =
|
|
|
|
let ind =
|
|
|
|
(this.selectHour - 8) * 2 + (this.selectMinute === "0" ? 0 : 1);
|
|
|
|
(this.selectHour - 8 - (this.hourListTmp.length - this.hourList.length) / 2) * 2 + (this.selectMinute === "0" ? 0 : 1);
|
|
|
|
that.$emit(
|
|
|
|
that.$emit(
|
|
|
|
"update:datetime",
|
|
|
|
"update:datetime",
|
|
|
|
new Date(
|
|
|
|
new Date(
|
|
|
|
@ -220,6 +224,41 @@ export default {
|
|
|
|
},
|
|
|
|
},
|
|
|
|
},
|
|
|
|
},
|
|
|
|
methods: {
|
|
|
|
methods: {
|
|
|
|
|
|
|
|
initHours(timestr = '') {
|
|
|
|
|
|
|
|
var today = new Date();
|
|
|
|
|
|
|
|
var todayStr = `${today.getFullYear()}-${today.getMonth() < 10 ? ('0' + (today.getMonth() + 1)) : (today.getMonth() + 1)}-${today.getDate() < 10 ? ('0' + today.getDate()) : today.getDate()}`;
|
|
|
|
|
|
|
|
if(timestr != '' && timestr != todayStr) {
|
|
|
|
|
|
|
|
this.hourList = [
|
|
|
|
|
|
|
|
8, 8, 9, 9, 10, 10, 11, 11, 12, 12, 13, 13, 14, 14, 15, 15, 16, 16, 17,
|
|
|
|
|
|
|
|
17, 18, 18,
|
|
|
|
|
|
|
|
]
|
|
|
|
|
|
|
|
return;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
if(this.datetime.split(" ")[0] == todayStr || timestr == todayStr) {
|
|
|
|
|
|
|
|
var currhour = today.getHours();
|
|
|
|
|
|
|
|
if(currhour > 17) {
|
|
|
|
|
|
|
|
this.hourList = [];
|
|
|
|
|
|
|
|
} else if(currhour <= 7) {
|
|
|
|
|
|
|
|
this.hourList = [
|
|
|
|
|
|
|
|
8, 8, 9, 9, 10, 10, 11, 11, 12, 12, 13, 13, 14, 14, 15, 15, 16, 16, 17,
|
|
|
|
|
|
|
|
17, 18, 18,
|
|
|
|
|
|
|
|
]
|
|
|
|
|
|
|
|
} else {
|
|
|
|
|
|
|
|
var arr = [];
|
|
|
|
|
|
|
|
currhour += 1;
|
|
|
|
|
|
|
|
for(var i = currhour; i != 19; ++i) {
|
|
|
|
|
|
|
|
arr.push(i);
|
|
|
|
|
|
|
|
arr.push(i);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
this.hourList = arr;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
} else {
|
|
|
|
|
|
|
|
this.hourList = [
|
|
|
|
|
|
|
|
8, 8, 9, 9, 10, 10, 11, 11, 12, 12, 13, 13, 14, 14, 15, 15, 16, 16, 17,
|
|
|
|
|
|
|
|
17, 18, 18,
|
|
|
|
|
|
|
|
]
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
},
|
|
|
|
getLangText(item) {
|
|
|
|
getLangText(item) {
|
|
|
|
if (item) {
|
|
|
|
if (item) {
|
|
|
|
if (this.langType == "en") {
|
|
|
|
if (this.langType == "en") {
|
|
|
|
@ -397,7 +436,7 @@ export default {
|
|
|
|
this.year = new Date(time).getFullYear();
|
|
|
|
this.year = new Date(time).getFullYear();
|
|
|
|
this.month = new Date(time).getMonth() + 1;
|
|
|
|
this.month = new Date(time).getMonth() + 1;
|
|
|
|
this.day = new Date(time).getDate();
|
|
|
|
this.day = new Date(time).getDate();
|
|
|
|
console.log(this.selectMinute);
|
|
|
|
// console.log(this.selectMinute);
|
|
|
|
// console.log(this.year, "--------", this.month, "--------", this.day);
|
|
|
|
// console.log(this.year, "--------", this.month, "--------", this.day);
|
|
|
|
this.$emit(
|
|
|
|
this.$emit(
|
|
|
|
"update:datetime",
|
|
|
|
"update:datetime",
|
|
|
|
@ -410,6 +449,8 @@ export default {
|
|
|
|
// let data12 = this.getabandonDate(new Date("2022-03-25").getTime());
|
|
|
|
// let data12 = this.getabandonDate(new Date("2022-03-25").getTime());
|
|
|
|
// console.dir(this.getabandonDate);
|
|
|
|
// console.dir(this.getabandonDate);
|
|
|
|
// console.log(data12);
|
|
|
|
// console.log(data12);
|
|
|
|
|
|
|
|
var selDate = new Date(time);
|
|
|
|
|
|
|
|
this.initHours(`${selDate.getFullYear()}-${selDate.getMonth() < 10 ? ('0' + (selDate.getMonth() + 1)) : (selDate.getMonth() + 1)}-${selDate.getDate() < 10 ? ('0' + selDate.getDate()) : selDate.getDate()}`);
|
|
|
|
},
|
|
|
|
},
|
|
|
|
getabandonDate(date) {
|
|
|
|
getabandonDate(date) {
|
|
|
|
// 禁用日期的回调
|
|
|
|
// 禁用日期的回调
|
|
|
|
|