Commit aa46537d authored by zhengke's avatar zhengke

修改

parent 0c85db10
......@@ -333,4 +333,14 @@ export function SetClassLessPlan(data) {
    data
  });
}
\ No newline at end of file
/**
 * 获取备课模板
 */
export function GetClassLessPlanList(data) {
  return request({
    url: '/Class/GetClassLessPlanList',
    method: 'post',
    data
  });
}
<template>
<q-dialog v-model="persistent" persistent transition-show="scale" transition-hide="scale">
<q-card style="width: 800px;max-width:900px;max-height:450px;">
<q-card-section>
<div class="text-h6">选择模板</div>
</q-card-section>
<el-table ref="multipleTable" :data="tableData" tooltip-effect="dark" highlight-current-row height="300"
style="width: 100%;" @selection-change="handleSelectionChange">
<el-table-column label="操作" width="55">
<template slot-scope="scope">
<el-checkbox v-model="scope.row.checked"></el-checkbox>
        <el-radio v-model="checked" :label="scope.row.ClassPlanId"></el-radio>
</template>
</el-table-column>
<el-table-column label="创建日期" width="200">
<template slot-scope="scope">{{ scope.row.CreateTime }}</template>
</el-table-column>
<el-table-column prop="name" label="模板名称">
<template slot-scope="scope">{{ scope.row.LessonPlan }}</template>
</el-table-column>
</el-table>
<q-card-actions align="right" class="bg-white">
<q-btn label="取消" flat color="grey-10" style="font-weight:400 !important" @click="closeCourseForm" />
<q-btn label="立即提交" color="accent q-px-md" style="font-weight:400 !important" :loading="saveCourseLoading"
@click="saveCourse" />
</q-card-actions>
</q-card>
</q-dialog>
</template>
<script>
import {
GetClassLessPlanList
} from '../../api/course/class'
export default {
data() {
return {
persistent: true,
optionTitle: "",
saveCourseLoading: false,
tableData: [],
checked: null, // 如果使用单选框,定义一个model值
currentSelectItem: {} // 当前选中的值
}
},
mounted() {
this.initObj()
},
methods: {
//初始化表单
initObj() {
GetClassLessPlanList({}).then(res => {
console.log(res, '数据来了');
if (res.Code == 1) {
this.tableData = res.Data;
this.tableData.forEach(x=>{
x.checked = false;
})
}
})
},
handleSelectionChange(row) {
// el-radio单选框,不需要这一步
this.tableData.forEach(item => {
// 排他,每次选择时把其他选项都清除
if (item.ClassPlanId !== row.ClassPlanId) {
item.checked = false
}
})
console.log(row)
// 如果使用单选框,这里可以把当前选中的这一项先保存起来
this.currentSelectItem = row
},
//选择保存
saveCourse() {
},
//关闭弹窗
closeCourseForm() {
this.$emit('close')
this.persistent = false
},
}
}
</script>
......@@ -88,6 +88,9 @@
.Less_Delete:hover{
opacity: 0.6;
}
.w60{
width:60px!important;
}
</style>
<template>
<div class="page-body lessonPreparation">
......@@ -96,8 +99,11 @@
<div style="margin:20px 0;">
<span class="Less_LeftIcon"></span>
教案名称:<el-input v-model="addMsg.LessonPlan" placeholder="教案名称" class="w260"></el-input>
<span style="margin-left:30px;">第几课:</span>
<el-input v-model="addMsg.CourseNum" placeholder="第几课" @keyup.native="checkInteger(addMsg,'CourseNum')" class="w180"></el-input>
<span style="margin-left:30px;">
<el-input v-model="addMsg.CourseNum" style="margin:0 5px;" placeholder="第几课" @keyup.native="checkInteger(addMsg,'CourseNum')" class="w60"></el-input></span>
<span style="float:right;display:inline-block;">
<q-btn color="accent" size="sm" class="q-mr-md" icon="add" label="选择模板" @click="getModule()" />
</span>
</div>
<div style="display:flex;">
<div>
......@@ -156,12 +162,16 @@
<q-btn label="提交" size="md" color="accent q-px-md" @click="saveInfo()" />
<!-- <span class="beikeBtn" @click="saveInfo(0)">提交</span> -->
</div>
<lessoncheck-form v-if="IsShowLessForm" @close="closeTeachSaveForm"
@success="refreshPage">
</lessoncheck-form>
</div>
</div>
</template>
<script>
import UeEditor from '../../components/editor/UeEditor'
import lessoncheckForm from '../../components/course/lessoncheck-form'
import {
SetClassLessPlan,
GetClassLessPlan
......@@ -172,7 +182,8 @@
},
props: {},
components: {
UeEditor
UeEditor,
lessoncheckForm
},
data() {
return {
......@@ -196,8 +207,7 @@
initialFrameWidth: null,
initialFrameHeight: 150,
},
inputVisible: false,
inputValue: ''
IsShowLessForm: false,
}
},
created() {},
......@@ -277,6 +287,18 @@
//删除整个教案
delLessOne(index){
this.addMsg.LessonPlanList.splice(index,1);
},
//关闭弹窗
closeTeachSaveForm() {
this.IsShowLessForm = false
},
//选择模板
getModule(){
this.IsShowLessForm=true;
},
//获取选择模板数据
refreshPage(){
},
//提交
saveInfo(num) {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment