修改
This commit is contained in:
parent
7f2d980da6
commit
eee433837d
@ -917,4 +917,10 @@ export async function liveinfo(id: number): Promise<any>{
|
||||
livenumber: liveinfo.livenumber,
|
||||
desc: liveinfo.desc
|
||||
}
|
||||
}
|
||||
|
||||
export async function setlive(data: any){
|
||||
const info = await put("live/" + data.id, data)
|
||||
console.log(info.data)
|
||||
|
||||
}
|
@ -161,8 +161,9 @@ import RankList from "./RankList.vue";
|
||||
import { previewCover } from "@/utils/common";
|
||||
import { FromSend, ImgInfo } from "@/types/index";
|
||||
import { uploadflie } from "@/utils/vod";
|
||||
import { liveadd, liveinfo } from "@/api";
|
||||
import { liveadd, liveinfo, setlive } from "@/api";
|
||||
import { useRoute } from 'vue-router';
|
||||
import dayjs from 'dayjs';
|
||||
|
||||
export default defineComponent({
|
||||
name: "ReleaseWebcast",
|
||||
@ -256,17 +257,20 @@ export default defineComponent({
|
||||
* 表单提交
|
||||
*/
|
||||
|
||||
const subdata = ref({
|
||||
title: "",
|
||||
img: "",
|
||||
fileid: "",
|
||||
fileurl: "",
|
||||
fileduration: "",
|
||||
dateline: "",
|
||||
livetime: "",
|
||||
livenumber: "",
|
||||
desc: "",
|
||||
});
|
||||
// const subdata = ref({
|
||||
// title: "",
|
||||
// img: "",
|
||||
// fileid: "",
|
||||
// fileurl: "",
|
||||
// fileduration: "",
|
||||
// dateline: "",
|
||||
// livetime: "",
|
||||
// livenumber: "",
|
||||
// desc: "",
|
||||
// });
|
||||
/**
|
||||
* todo 需要后台返回年份
|
||||
*/
|
||||
const id = useRoute().query.id
|
||||
if(id != null && typeof id == 'string'){
|
||||
liveinfo(parseInt(id)).then((res)=>{
|
||||
@ -278,10 +282,19 @@ export default defineComponent({
|
||||
validate()
|
||||
.then(() => {
|
||||
// console.log(toRaw(form),111);
|
||||
const subdata = toRaw(form);
|
||||
const subdata: any = toRaw(form.value);
|
||||
// subdata.fileid=picinfo.
|
||||
console.log(subdata);
|
||||
liveadd(subdata);
|
||||
if(id != undefined && id){
|
||||
/**
|
||||
* todo 提交会报错
|
||||
*/
|
||||
subdata.id = id;
|
||||
setlive(subdata)
|
||||
}else{
|
||||
console.log(subdata);
|
||||
liveadd(subdata);
|
||||
}
|
||||
|
||||
})
|
||||
.catch((err: unknown) => {
|
||||
console.log("error", err);
|
||||
@ -300,14 +313,13 @@ export default defineComponent({
|
||||
*/
|
||||
|
||||
function startchange(e: string): void {
|
||||
const month = new Date(e).getMonth()+1
|
||||
console.log(new Date(e).getFullYear()+"-"+month+'-'+new Date(e).getDate())
|
||||
form.value.dateline =
|
||||
new Date(e).getFullYear() +
|
||||
"-" +
|
||||
month +
|
||||
"-" +
|
||||
new Date(e).getDate();
|
||||
// const month = new Date(e).getMonth()+1
|
||||
// console.log(new Date(e).getFullYear()+"-"+month+'-'+new Date(e).getDate())
|
||||
// console.log(e.toString())
|
||||
const time = dayjs(new Date(e))
|
||||
const timestr = time.year() + "-" + (time.month() + 1) + "-" + time.date() + " " + time.hour() + ":" + time.minute() + ":" + time.second()
|
||||
console.log(timestr)
|
||||
form.value.dateline = timestr;
|
||||
}
|
||||
/**
|
||||
* 上传文件
|
||||
|
Loading…
x
Reference in New Issue
Block a user