日历修改
This commit is contained in:
parent
7bf5fc86de
commit
ad1c54fdc9
@ -372,3 +372,14 @@ export async function getliveinfo(id: number){
|
|||||||
const studentlist = (await get<StudentList[]>("studentLive",{id})).data;
|
const studentlist = (await get<StudentList[]>("studentLive",{id})).data;
|
||||||
return {...liveinfo,studentlist}
|
return {...liveinfo,studentlist}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 直播日历
|
||||||
|
*/
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
export async function getdatelist(start: string, end: string) {
|
||||||
|
return (await get("teacherCalendar")).data
|
||||||
|
}
|
||||||
|
@ -11,6 +11,8 @@ interface GetDate{
|
|||||||
yue: number;
|
yue: number;
|
||||||
day: number;
|
day: number;
|
||||||
zhou: number;
|
zhou: number;
|
||||||
|
start: string;
|
||||||
|
end: string;
|
||||||
}
|
}
|
||||||
|
|
||||||
export function getdate(yue?: number): GetDate{
|
export function getdate(yue?: number): GetDate{
|
||||||
@ -27,7 +29,8 @@ export function getdate(yue?: number): GetDate{
|
|||||||
now = now.date(0);
|
now = now.date(0);
|
||||||
const month = now.date(); // 当前月有几天
|
const month = now.date(); // 当前月有几天
|
||||||
const year = now.year()
|
const year = now.year()
|
||||||
|
const start = year + "-" + yue + '-01';
|
||||||
|
const end = year + "-" + yue + '-' + month;
|
||||||
console.log(day,week,month)
|
console.log(day,week,month)
|
||||||
let i = 0;
|
let i = 0;
|
||||||
let w = 0;
|
let w = 0;
|
||||||
@ -55,7 +58,7 @@ export function getdate(yue?: number): GetDate{
|
|||||||
}
|
}
|
||||||
console.log(date)
|
console.log(date)
|
||||||
|
|
||||||
return {date, year, yue, day, zhou};
|
return {date, year, yue, day, zhou, start, end};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -188,6 +188,7 @@
|
|||||||
<script lang="ts">
|
<script lang="ts">
|
||||||
import { defineComponent, ref } from 'vue';
|
import { defineComponent, ref } from 'vue';
|
||||||
import { getdate } from "@/utils/date"
|
import { getdate } from "@/utils/date"
|
||||||
|
import { getdatelist } from '@/api';
|
||||||
|
|
||||||
export default defineComponent({
|
export default defineComponent({
|
||||||
props:{
|
props:{
|
||||||
@ -202,11 +203,19 @@ export default defineComponent({
|
|||||||
function xia(){
|
function xia(){
|
||||||
yue.value = yue.value + 1;
|
yue.value = yue.value + 1;
|
||||||
month.value = getdate(yue.value)
|
month.value = getdate(yue.value)
|
||||||
|
getdates()
|
||||||
}
|
}
|
||||||
function shang(){
|
function shang(){
|
||||||
yue.value = yue.value - 1;
|
yue.value = yue.value - 1;
|
||||||
month.value = getdate(yue.value)
|
month.value = getdate(yue.value)
|
||||||
|
getdates()
|
||||||
}
|
}
|
||||||
|
async function getdates(){
|
||||||
|
getdatelist(month.value.start, month.value.end).then((res)=>{
|
||||||
|
console.log(res)
|
||||||
|
})
|
||||||
|
}
|
||||||
|
getdates()
|
||||||
return {
|
return {
|
||||||
month,
|
month,
|
||||||
xia,
|
xia,
|
||||||
|
Loading…
x
Reference in New Issue
Block a user