Commit df8eba5d authored by zhengke's avatar zhengke

修改

parent 36ab9349
......@@ -5,15 +5,14 @@
<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">
style="width: 100%;" @row-click="singleElection">
<el-table-column label="" width="65">
<template slot-scope="scope">
<el-checkbox v-model="scope.row.checked"></el-checkbox>
        <el-radio v-model="checked" :label="scope.row.ClassPlanId"></el-radio>
<el-radio class="radio" v-model="templateSelection" :label="scope.$index">&nbsp;</el-radio>
</template>
</el-table-column>
<el-table-column label="创建日期" width="200">
<template slot-scope="scope">{{ scope.row.CreateTime }}</template>
<template slot-scope="scope">{{getCreatTime(scope.row.CreateTime)}}</template>
</el-table-column>
<el-table-column prop="name" label="模板名称">
<template slot-scope="scope">{{ scope.row.LessonPlan }}</template>
......@@ -40,8 +39,8 @@
optionTitle: "",
saveCourseLoading: false,
tableData: [],
checked: null, // 如果使用单选框,定义一个model值
currentSelectItem: {} // 当前选中的值
checkedRow: {},
templateSelection: ''
}
},
mounted() {
......@@ -54,27 +53,32 @@
console.log(res, '数据来了');
if (res.Code == 1) {
this.tableData = res.Data;
this.tableData.forEach(x=>{
x.checked = false;
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
},
singleElection(row) {
console.log(row, 'row');
this.templateSelection = this.tableData.indexOf(row);
this.checkedRow = row;
},
//选择保存
saveCourse() {
if (JSON.stringify(this.checkedRow) != "{}") {
this.$emit('success',this.checkedRow);
this.closeCourseForm();
} else {
this.$q.notify({
type: 'negative',
position: "top",
message: `请选择模板`
})
}
},
getCreatTime(time){
return time.replace("T", " ");
},
//关闭弹窗
closeCourseForm() {
......
......@@ -179,50 +179,6 @@
</div>
</div>
<!-- <div class="teach_Content">-->
<!-- 教案详情-->
<!-- </div>-->
<!-- <div class="teach_Lessback">-->
<!-- <q-btn color="accent" size="sm" class="q-mr-md" icon="add" label="新增教案" @click="addPlanList()" />-->
<!-- </div>-->
<!-- <div style="margin-top:20px;" v-for="(item,index) in addMsg.LessonPlanList">-->
<!-- <div class="row" style="width:908px;">-->
<!-- <q-input filled stack-label maxlength="20" v-model="item.CourseName" :dense="false"-->
<!-- class="col-3 q-pr-lg q-pb-lg" label="课程名称" />-->
<!-- <q-input filled stack-label maxlength="50" v-model="item.CourseTitle" :dense="false"-->
<!-- class="col-8 q-pb-lg" label="课程标题" />-->
<!-- <span class="Less_Delete" style="margin:10px 0 0 20px;" title="删除详情" @click="delLessOne(index)">-->
<!-- <i class="iconfont icon-shanchu"></i>-->
<!-- </span>-->
<!-- </div>-->
<!-- <div class="teach_Lessback" style="min-width:832px;">-->
<!-- <span class="add_Lesson" @click="addPlanDetailsList(index)" title="新增教案详情">-->
<!-- <i class="iconfont icon-add"></i>-->
<!-- </span>-->
<!-- </div>-->
<!-- <div class="row" v-for="(subItem,subIndex) in item.LessonPlanDetailsList"-->
<!-- style="margin-top:20px;align-items: self-end;width:908px;">-->
<!-- <UeEditor class="col-8" v-model="subItem.ProjectContent" :config="config"></UeEditor>-->
<!-- <q-input filled stack-label maxlength="20" v-model="subItem.Duration" @keyup.native="checkInteger(subItem,'Duration')" style="margin-left:10px;margin-top:5px;"-->
<!-- :dense="false" class="col-2 q-pr-lg q-pb-lg" label="时长" />-->
<!-- <span class="Less_Delete" title="删除详情" @click="delLessInfo(index,subIndex)">-->
<!-- <i class="iconfont icon-shanchu"></i>-->
<!-- </span>-->
<!-- </div>-->
<!-- <div style="margin-top:20px;border-bottom:1px dashed #d1d1d1;padding-bottom:20px;margin-right:90px;">-->
<!-- <el-tag :key="tag" style="margin-right:10px;" v-for="tag in item.LessonPlanProjectsList[0].ProjectContentList"-->
<!-- closable :disable-transitions="false" @close="handleClose(tag,index)">-->
<!-- {{tag}}-->
<!-- </el-tag>-->
<!-- <el-input class="input-new-tag w260" v-if="item.isShow" v-model="item.isValue" ref="saveTagInput" size="small"-->
<!-- @keyup.enter.native="handleInputConfirm(item,index)" @blur="handleInputConfirm(item,index)">-->
<!-- </el-input>-->
<!-- <el-button v-else class="button-new-tag" size="small" @click="showInput(item)">-->
<!-- 新增教案项目</el-button>-->
<!-- </div>-->
<!-- </div>-->
<div style="margin-top:30px;">
<span class="beikeModule" @click="saveInfo(1)">存为模板</span>
<q-btn label="提交" size="md" color="accent q-px-md" @click="saveInfo()" />
......@@ -370,6 +326,7 @@
//获取选择模板数据
refreshPage(val){
console.log(val,'val');
this.addMsg.LessonPlanList =val.LessonPlanList;
},
//提交
saveInfo(num) {
......
......@@ -256,7 +256,7 @@
</div>
<div style="margin:20px 0 30px 0;">
<span class="beikeBtn" v-if="item.LessonPlanNum>0" style="background:#3FC4FF;" @click="goyibeike(item)">已备课</span>
<span class="beikeBtn" v-else @click="goBeike(item)">备课</span>
<span class="beikeBtn" v-if="AccountType&&item.LessonPlanNum==0" @click="goBeike(item)">备课</span>
</div>
</div>
</div>
......@@ -290,6 +290,7 @@
},
dataList: [],
newDataList:[],
AccountType:true
}
},
created() {},
......@@ -302,6 +303,8 @@
this.dataNum = this.mGetDate(this.tYear, this.tMonth);
this.msg.StartTime = this.tYear+'-'+this.tMonth+'-'+'01';
this.msg.EndTime = this.tYear+'-'+this.tMonth+'-'+this.dataNum;
let userInfo = this.getLocalStorage();
// this.AccountType = userInfo.AccountType==2?true:false; //是否是教师
this.getList();
},
methods: {
......
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