diff --git a/src/views/courselibrary/CoursewareManage.vue b/src/views/courselibrary/CoursewareManage.vue index 32c3c88c..00d716a1 100644 --- a/src/views/courselibrary/CoursewareManage.vue +++ b/src/views/courselibrary/CoursewareManage.vue @@ -138,7 +138,7 @@ v-model:validate="validate" :maxlength="20" show-count - :type="2" + :type="3" > @@ -839,12 +839,12 @@ 开课名称
- + >
@@ -1539,6 +1539,7 @@ import { newFile, getdateToDate, } from "../../utils/utils"; +import { validateName } from "@/api/index1"; import {fileUp} from "../../api/indexEval"; import * as api1 from "../../api/index1"; @@ -1949,7 +1950,7 @@ const columns6 = [ align: "center", ellipsis: true, customRender: ({text}) => { - return text ? text : "-"; + return text ? text : "0"; }, }, { @@ -3639,13 +3640,28 @@ export default defineComponent({ }; //保存开课 - const handleSureStu = () => { + const handleSureStu = async() => { let startTime, endTime = 0; if (state.xjkkinputV3) { startTime = dayjs(state.xjkkinputV3[0]).format('YYYY-MM-DD HH:mm') //parseInt(state.xjkkinputV3[0].$d.getTime() / 1000); endTime = dayjs(state.xjkkinputV3[1]).format('YYYY-MM-DD HH:mm') //parseInt(state.xjkkinputV3[1].$d.getTime() / 1000); } +// console.log("state.validate", state.validate); + +// if (!state.validate) { +// message.destroy(); +// return message.warning("该开课名称已存在"); +// } +const offName = await validateName({ name: state.xjkkinputV1, type: 5 }).then(res => { + console.log(res,res.data.data); + return res.data.data === 1; + }); + console.log('校验重复',offName) + if (offName) { + message.destroy(); + return message.warning("开课名称重复,请重新填写"); + } let t = state.signCom ? "1," : "0,"; let p = state.comLeave ? "1" : "0"; let type = t.concat(p); @@ -3767,7 +3783,7 @@ export default defineComponent({ const handelGuan = (itm) => { console.log("开课信息", itm); state.offcourseId = itm.id; - state.offcoursePlanId = itm.offcoursePlanId; + state.offcoursePlanId = itm.id; state.studentId = itm.studentId; state.studentItem = itm;