课程库bug

This commit is contained in:
zhangyc
2022-12-13 00:41:11 +08:00
parent 178b3fd212
commit 89e889506b
3 changed files with 75 additions and 10 deletions

View File

@@ -393,6 +393,7 @@ import {
// onMounted,
onUnmounted,
} from "vue";
import {validateName} from "@/api/index1";
import {message} from "ant-design-vue";
import {edit, detail, handle} from "@/api/indexCourse";
import {fileUp} from "../../api/indexEval";
@@ -405,6 +406,7 @@ import FJUpload from "@/components/common/FJUpload";
import * as moment from "moment";
import * as api2 from "../../api/indexAudit";
export default defineComponent({
components: {
Editor,
@@ -413,12 +415,18 @@ export default defineComponent({
NameInput,
ProjectManager,
},
props: {
xzinputV1: {
type: String,
default: null,
},
},
setup(props, {expose, emit}) {
const state = reactive({
hideshow: true,
ft_eidt: false,
attach: "",
validate: true,
validate:false,
ft_hs: false,
addLoading: false,
statusJuJue: 0,
@@ -575,6 +583,7 @@ export default defineComponent({
state.ft_hs = true;
state.ft_eidt = false;
state.qdms_inputV1 = name;
console.log(" state.qdms_inputV1 ",state.qdms_inputV1 );
}
};
const visibleClose = () => {
@@ -766,7 +775,8 @@ export default defineComponent({
};
//保存面授课
const handlePush = (param) => {
const handlePush = async (param) => {
let files = "";
if (state.imgList.length) {
state.imgList.forEach((item) => {
@@ -775,6 +785,15 @@ export default defineComponent({
}
files = files.slice(0, files.length - 1);
console.log("filesfiles", files);
const offName = await validateName({name: state.qdms_inputV1, type:2, id:state.offcourseId}).then(res => {
return res.data.data == 1;
});
if(offName){
message.destroy();
return message.warning("课程名称重复,请重新填写");
}
const postData = {
offcourseId: state.offcourseId, //不传代表新增
name: state.qdms_inputV1,
@@ -831,6 +850,9 @@ export default defineComponent({
//编辑面授课渲染绑定
const handleEditInfo = async (offcourseId) => {
console.log("jjjaj");
state.validate =true;
state.qdms_inputV1 = "";
const item = await detail({
offcourseId: Number(offcourseId),
}).then((res) => {