Commit 9b45837d authored by Mac's avatar Mac
parents e183d215 27bdded4
...@@ -5,15 +5,14 @@ ...@@ -5,15 +5,14 @@
<div class="text-h6">选择模板</div> <div class="text-h6">选择模板</div>
</q-card-section> </q-card-section>
<el-table ref="multipleTable" :data="tableData" tooltip-effect="dark" highlight-current-row height="300" <el-table ref="multipleTable" :data="tableData" tooltip-effect="dark" highlight-current-row height="300"
style="width: 100%;" @selection-change="handleSelectionChange"> style="width: 100%;" @row-click="singleElection">
<el-table-column label="操作" width="55"> <el-table-column label="" width="65">
<template slot-scope="scope"> <template slot-scope="scope">
<el-checkbox v-model="scope.row.checked"></el-checkbox> <el-radio class="radio" v-model="templateSelection" :label="scope.$index">&nbsp;</el-radio>
        <el-radio v-model="checked" :label="scope.row.ClassPlanId"></el-radio>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column label="创建日期" width="200"> <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>
<el-table-column prop="name" label="模板名称"> <el-table-column prop="name" label="模板名称">
<template slot-scope="scope">{{ scope.row.LessonPlan }}</template> <template slot-scope="scope">{{ scope.row.LessonPlan }}</template>
...@@ -40,8 +39,8 @@ ...@@ -40,8 +39,8 @@
optionTitle: "", optionTitle: "",
saveCourseLoading: false, saveCourseLoading: false,
tableData: [], tableData: [],
checked: null, // 如果使用单选框,定义一个model值 checkedRow: {},
currentSelectItem: {} // 当前选中的值 templateSelection: ''
} }
}, },
mounted() { mounted() {
...@@ -54,27 +53,32 @@ ...@@ -54,27 +53,32 @@
console.log(res, '数据来了'); console.log(res, '数据来了');
if (res.Code == 1) { if (res.Code == 1) {
this.tableData = res.Data; this.tableData = res.Data;
this.tableData.forEach(x=>{ this.tableData.forEach(x => {
x.checked = false; x.checked = false;
}) })
} }
}) })
}, },
handleSelectionChange(row) { singleElection(row) {
// el-radio单选框,不需要这一步 console.log(row, 'row');
this.tableData.forEach(item => { this.templateSelection = this.tableData.indexOf(row);
// 排他,每次选择时把其他选项都清除 this.checkedRow = row;
if (item.ClassPlanId !== row.ClassPlanId) { },
item.checked = false
}
})
console.log(row)
// 如果使用单选框,这里可以把当前选中的这一项先保存起来
this.currentSelectItem = row
},
//选择保存 //选择保存
saveCourse() { 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() { closeCourseForm() {
......
...@@ -179,50 +179,6 @@ ...@@ -179,50 +179,6 @@
</div> </div>
</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;"> <div style="margin-top:30px;">
<span class="beikeModule" @click="saveInfo(1)">存为模板</span> <span class="beikeModule" @click="saveInfo(1)">存为模板</span>
<q-btn label="提交" size="md" color="accent q-px-md" @click="saveInfo()" /> <q-btn label="提交" size="md" color="accent q-px-md" @click="saveInfo()" />
...@@ -370,6 +326,7 @@ ...@@ -370,6 +326,7 @@
//获取选择模板数据 //获取选择模板数据
refreshPage(val){ refreshPage(val){
console.log(val,'val'); console.log(val,'val');
this.addMsg.LessonPlanList =val.LessonPlanList;
}, },
//提交 //提交
saveInfo(num) { saveInfo(num) {
......
...@@ -256,7 +256,7 @@ ...@@ -256,7 +256,7 @@
</div> </div>
<div style="margin:20px 0 30px 0;"> <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-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> </div>
</div> </div>
...@@ -290,6 +290,7 @@ ...@@ -290,6 +290,7 @@
}, },
dataList: [], dataList: [],
newDataList:[], newDataList:[],
AccountType:true
} }
}, },
created() {}, created() {},
...@@ -302,6 +303,8 @@ ...@@ -302,6 +303,8 @@
this.dataNum = this.mGetDate(this.tYear, this.tMonth); this.dataNum = this.mGetDate(this.tYear, this.tMonth);
this.msg.StartTime = this.tYear+'-'+this.tMonth+'-'+'01'; this.msg.StartTime = this.tYear+'-'+this.tMonth+'-'+'01';
this.msg.EndTime = this.tYear+'-'+this.tMonth+'-'+this.dataNum; this.msg.EndTime = this.tYear+'-'+this.tMonth+'-'+this.dataNum;
let userInfo = this.getLocalStorage();
// this.AccountType = userInfo.AccountType==2?true:false; //是否是教师
this.getList(); this.getList();
}, },
methods: { 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