mirror of
https://codeup.aliyun.com/67762337eccfc218f6110e0e/vue/fe-manage.git
synced 2025-12-11 20:06:47 +08:00
feat:增加新建阶段任务
This commit is contained in:
@@ -279,7 +279,7 @@
|
||||
</div>
|
||||
<div class="main_btns">
|
||||
<button class="btn1" @click="closeDrawer">取消</button>
|
||||
<button class="btn2" @click="createLiveBroadcast">确定</button>
|
||||
<button class="btn2" @click="done">确定</button>
|
||||
</div>
|
||||
</div>
|
||||
</a-drawer>
|
||||
@@ -288,6 +288,7 @@
|
||||
import { reactive, toRefs, ref } from "vue";
|
||||
import { message } from "ant-design-vue";
|
||||
import * as api from "../../api/indexLiveBroadcast";
|
||||
import * as apiTask from "../../api/indexTaskadd";
|
||||
import { toDate } from "@/api/method";
|
||||
|
||||
function getBase64(img, callback) {
|
||||
@@ -477,6 +478,7 @@ export default {
|
||||
checkedC1: "",
|
||||
checkedC2: true,
|
||||
playback: false,
|
||||
obj: {}, //要传的obj数据
|
||||
});
|
||||
const closeDrawer = () => {
|
||||
ctx.emit("update:addliveVisible", false);
|
||||
@@ -545,15 +547,25 @@ export default {
|
||||
|
||||
//创建直播
|
||||
const createLiveBroadcast = () => {
|
||||
if (!state.inputV1) return message.warning("请输入直播名称");
|
||||
if (!state.time) return message.warning("请输入直播时间");
|
||||
if (!state.inputV2) return message.warning("请输入直播时长");
|
||||
if (!state.inputV1) {
|
||||
message.destroy();
|
||||
return message.warning("请输入直播名称");
|
||||
}
|
||||
if (!state.time) {
|
||||
message.destroy();
|
||||
return message.warning("请输入直播时间");
|
||||
}
|
||||
if (!state.inputV2) {
|
||||
message.destroy();
|
||||
return message.warning("请输入直播时长");
|
||||
}
|
||||
const regular = /^[+]{0,1}(\d+)$/;
|
||||
if (!regular.test(state.inputV2)) {
|
||||
message.destroy();
|
||||
return message.warning("直播时长需大于0");
|
||||
}
|
||||
|
||||
// if (!state.inputV3) return message.info("请输入授课老师");
|
||||
if (!state.inputV3) return message.warning("请输入授课老师");
|
||||
let check = state.checkedC2 * 1;
|
||||
// let startTime = state.time[0].$d;
|
||||
// let endTime = state.time[1].$d;
|
||||
@@ -567,7 +579,7 @@ export default {
|
||||
new Date(state.time[1].$d).getTime() / 1000,
|
||||
"Y-M-D"
|
||||
);
|
||||
let obj = {
|
||||
state.obj = {
|
||||
afterSignIn: state.inputV6,
|
||||
beforeSignIn: state.inputV7,
|
||||
createTime: "",
|
||||
@@ -592,10 +604,10 @@ export default {
|
||||
updateUser: 0,
|
||||
};
|
||||
api
|
||||
.createLiveBroadcast(obj)
|
||||
.createLiveBroadcast(state.obj)
|
||||
.then((res) => {
|
||||
console.log(res.data.data, 1111);
|
||||
console.log(state, 2222);
|
||||
console.log("调用添加直播接口后", res.data.data);
|
||||
// console.log(state, 2222);
|
||||
message.success("提交成功");
|
||||
closeDrawer();
|
||||
|
||||
@@ -604,6 +616,33 @@ export default {
|
||||
.catch((err) => {
|
||||
console.log(err, 2222);
|
||||
});
|
||||
|
||||
apiTask
|
||||
.addTask({
|
||||
courseId: 0,
|
||||
duration: 0,
|
||||
flag: true,
|
||||
name: "",
|
||||
projectId: 22,
|
||||
projectTaskId: 0,
|
||||
stageId: 0,
|
||||
type: 0,
|
||||
})
|
||||
.then((res) => {
|
||||
console.log("调用项目添加接口后", res.data);
|
||||
})
|
||||
.catch((err) => {
|
||||
console.log(err);
|
||||
});
|
||||
};
|
||||
|
||||
//添加任务到数据库
|
||||
const addTask = () => {};
|
||||
|
||||
const done = () => {
|
||||
createLiveBroadcast();
|
||||
addTask();
|
||||
// api.getLiveBroadcastInfor({});
|
||||
};
|
||||
|
||||
return {
|
||||
@@ -618,6 +657,7 @@ export default {
|
||||
createLiveBroadcast,
|
||||
handleChange,
|
||||
beforeUpload,
|
||||
done,
|
||||
};
|
||||
},
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user