Commit 7ab62374 authored by 王's avatar

教研管理

parent adcf7d86
...@@ -24,7 +24,7 @@ ...@@ -24,7 +24,7 @@
</el-upload> </el-upload>
</el-form-item> </el-form-item>
<el-form-item label="课程类型"> <el-form-item label="课程类型">
<el-select v-model="form.type" placeholder="请选择课程类型" @change="selectedLesson = []"> <el-select v-model="form.type" placeholder="请选择课程类型" @change="selectedLesson = [],selectedLessonList = []">
<el-option label="月课" :value="0"></el-option> <el-option label="月课" :value="0"></el-option>
<el-option label="日课" :value="1"></el-option> <el-option label="日课" :value="1"></el-option>
</el-select> </el-select>
...@@ -139,11 +139,28 @@ ...@@ -139,11 +139,28 @@
let select = this.showLessonList.find(i=>{return i.id === data[0]}); let select = this.showLessonList.find(i=>{return i.id === data[0]});
select = select.children.find(i=>{return i.id === data[1]}); select = select.children.find(i=>{return i.id === data[1]});
if(data.length === 3)select = select.children.find(i=>{return i.id === data[2]}); if(data.length === 3)select = select.children.find(i=>{return i.id === data[2]});
let index = this.selectedLessonList.findIndex(val => val === select);
if (index === -1){
this.selectedLessonList.push(select) this.selectedLessonList.push(select)
} else {
this.$message({
type: 'info',
message: '不能重复添加!'
});
}
}, },
selectBox(data){ selectBox(data){
let select = this.showBoxList.find(i=>{return i.id === data[0]}); let select = this.showBoxList.find(i=>{return i.id === data[0]});
let index = this.selectedBoxList.findIndex(val => val === select);
if (index === -1){
this.selectedBoxList.push(select) this.selectedBoxList.push(select)
} else {
this.$message({
type: 'info',
message: '不能重复添加!'
});
}
}, },
sub(){ sub(){
this.selectedBoxList.forEach(i=>{this.form.item_category_ids.push(i.id)}); this.selectedBoxList.forEach(i=>{this.form.item_category_ids.push(i.id)});
...@@ -205,6 +222,7 @@ ...@@ -205,6 +222,7 @@
item_category_ids:[], item_category_ids:[],
cover:0, cover:0,
}; };
this.uploadShow = true;
this.imageList = []; this.imageList = [];
this.selectedLessonList = []; this.selectedLessonList = [];
this.selectedBoxList = []; this.selectedBoxList = [];
...@@ -245,14 +263,14 @@ ...@@ -245,14 +263,14 @@
this.show = this.dialogObj.show; this.show = this.dialogObj.show;
this.id = this.dialogObj.id; this.id = this.dialogObj.id;
this.type = 2; this.type = 2;
getTeacherDetailApi(this.id).then(res=>{ // getTeacherDetailApi(this.id).then(res=>{
this.form.name = res.name; // this.form.name = res.name;
this.form.alias = res.alias; // this.form.alias = res.alias;
this.form.qr = res.qr; // this.form.qr = res.qr;
this.form.type = res.type; // this.form.type = res.type;
this.form.status = res.status; // this.form.status = res.status;
this.loading = false // this.loading = false
}); // });
break break
} }
}, },
......
...@@ -16,15 +16,11 @@ ...@@ -16,15 +16,11 @@
</el-select> </el-select>
</el-form-item> </el-form-item>
</el-col> </el-col>
<el-col :span="4"> <el-col :span="3">
<el-form-item> <el-button style="margin-left: 16px;" type="primary" plain @click="getUser">搜索</el-button>
<el-button type="primary" plain @click="getUser">搜索</el-button>
</el-form-item>
</el-col> </el-col>
<el-col :span="4" :offset="8"> <el-col :span="5" :offset="8">
<el-form-item> <el-button style="float: right" type="success" plain @click="add">新增课程</el-button>
<el-button type="success" plain @click="add">新增课程</el-button>
</el-form-item>
</el-col> </el-col>
</el-row> </el-row>
</el-form> </el-form>
......
<template> <template>
<div> <div>
<el-container> <el-container>
<el-header height="80px">
<div class="head-top"> <div class="head-top">
缩放:<el-input-number v-model="bigNum" size="mini" :min="30" :max="150" :step="10"></el-input-number> 缩放:<el-input-number v-model="bigNum" size="mini" :min="30" :max="150" :step="10"></el-input-number>
<el-button size="mini" type="success" style="float: right" @click="setOpen()"> </div>
<el-button class="head-edit" type="default" @click="setOpen()">
编辑当前页参数 编辑当前页参数
</el-button> </el-button>
</div> <el-header>
<div class="head-content"> <div class="head-content">
<div v-if="selectedMould.length > 0"> <div v-if="selectedMould.length > 0">
{{ selectedMould[nowIndex].title }} {{ selectedMould[nowIndex].title }}
...@@ -17,8 +17,11 @@ ...@@ -17,8 +17,11 @@
<el-container> <el-container>
<el-aside width="150px"> <el-aside width="150px">
<div class="page-list"> <div class="page-list">
<div v-for="(data,index) in selectedMould" :key="index" @click="chooseThat(index)"> <div class="card-item" v-for="(data,index) in selectedMould" :key="index" @click="chooseThat(index)">
<el-card shadow="hover" class="box" :body-style="{ padding: '0px' }"> <div class="list2-btn">
<i class="iconfont icon-shanchu" @click="delMould(index)"></i>
</div>
<el-card shadow="hover" :class="nowIndex === index ? 'border' : ''" :body-style="{ padding: '0px' }">
<div class="dialog-card"> <div class="dialog-card">
序号:{{index}} 序号:{{index}}
</div> </div>
...@@ -29,7 +32,7 @@ ...@@ -29,7 +32,7 @@
</el-aside> </el-aside>
<el-main> <el-main>
<!--爸妈看一看1--> <!--爸妈看一看1-->
<div v-if="selectedMould[nowIndex] && selectedMould[nowIndex].key === 'look1'"> <div v-if="selectedMould.length > 0 && selectedMould[nowIndex] && selectedMould[nowIndex].key === 'look1'">
<div class="look1" :style="{backgroundImage:`url(${mouldImg.look1.bg}`,transform:`scale(${bigNum/100},${bigNum/100})`}"> <div class="look1" :style="{backgroundImage:`url(${mouldImg.look1.bg}`,transform:`scale(${bigNum/100},${bigNum/100})`}">
<div class="bg-block"> <div class="bg-block">
<img :src="mouldImg.look1.reqiqiu" class="reqiqiu"/> <img :src="mouldImg.look1.reqiqiu" class="reqiqiu"/>
...@@ -461,6 +464,10 @@ ...@@ -461,6 +464,10 @@
</el-select> </el-select>
</el-form-item> </el-form-item>
</el-form> </el-form>
<span slot="footer" class="dialog-footer" style="text-align: center">
<el-button type="default" @click="selectedMould[nowIndex].content = {};dialogVisible = false">取消</el-button>
<el-button type="primary" @click="dialogVisible = false">确 定</el-button>
</span>
</el-dialog> </el-dialog>
</div> </div>
</template> </template>
...@@ -477,7 +484,7 @@ ...@@ -477,7 +484,7 @@
data(){ data(){
return { return {
// 放大缩小参数 // 放大缩小参数
bigNum:100, bigNum:50,
// 弹窗参数 // 弹窗参数
dialogVisible:false, dialogVisible:false,
// 当前对象下标 // 当前对象下标
...@@ -505,7 +512,11 @@ ...@@ -505,7 +512,11 @@
}, },
// 打开设置弹窗 // 打开设置弹窗
setOpen(){ setOpen(){
if ( !this.selectedMould[this.nowIndex]){
this.$message.info('请先选泽模版!');
} else {
this.dialogVisible = true; this.dialogVisible = true;
}
}, },
// 上传Banner // 上传Banner
uploadFileVideo1Banner(a){ uploadFileVideo1Banner(a){
...@@ -545,6 +556,12 @@ ...@@ -545,6 +556,12 @@
// 源生上传成功音频回调 // 源生上传成功音频回调
uploadSuccessRadio1(a){ uploadSuccessRadio1(a){
this.selectedMould[this.nowIndex].content.radio.push({name:a.data.url,url:process.env.IMAGE_URL_HEAD + a.data.url,title:'',lable:''}) this.selectedMould[this.nowIndex].content.radio.push({name:a.data.url,url:process.env.IMAGE_URL_HEAD + a.data.url,title:'',lable:''})
},
delMould(index){
this.selectedMould.splice(index,1);
if(this.nowIndex > this.selectedMould.length - 1){
this.nowIndex = 0;
}
} }
}, },
watch:{ watch:{
...@@ -562,21 +579,37 @@ ...@@ -562,21 +579,37 @@
<style scoped lang="less"> <style scoped lang="less">
@import "../../util/public"; @import "../../util/public";
.el-container{ .el-container{
position: relative;
background: white; background: white;
.el-header{
padding: 0;
.head-top{ .head-top{
background: #f5f8ff; background: #f5f8ff;
font-size: 14px; font-size: 14px;
color: #333333; color: #333333;
padding: 5px; padding: 5px;
position: absolute;
top: -102px;
left: 50%;
width: 182px;
margin-left: -91px;
.page-type{ .page-type{
display: inline-block; display: inline-block;
padding: 0 10px; padding: 0 10px;
} }
} }
.head-edit{
position: absolute;
top: -49px;
left: 190px;
width: 182px;
margin-left: 0;
}
.el-header{
padding: 0;
.head-content{ .head-content{
padding: 10px; padding: 10px;
text-align: center;
line-height: 60px;
font-size: 18px;
} }
} }
.page-list{ .page-list{
...@@ -932,4 +965,32 @@ ...@@ -932,4 +965,32 @@
} }
} }
} }
.border {
border: 1px dashed red;
}
.box {
padding: 0px;
}
.list2-btn{
position: absolute;
top: 50%;
left: 50%;
transition: all 1s;
display: none;
i{
color: #444;
font-size: 26px;
margin-left: -13px;
&:hover{
color: #333;
}
}
z-index: 999;
}
.card-item {
position: relative;
}
.card-item:hover .list2-btn{
display: inline-block;
}
</style> </style>
...@@ -26,12 +26,14 @@ ...@@ -26,12 +26,14 @@
</div> </div>
</el-aside> </el-aside>
<el-main> <el-main>
<el-button @click="showDialog = true"> <div class="main-btns">
<el-button type="primary" @click="showDialog = true">
课程基本信息编辑 课程基本信息编辑
</el-button> </el-button>
<el-button type="success" @click="onSave()"> <el-button style="float: right;" type="success" @click="onSave()">
保存 保存
</el-button> </el-button>
</div>
<editor :selectedMould="selectedMould" :editorObj="editorObj"/> <editor :selectedMould="selectedMould" :editorObj="editorObj"/>
</el-main> </el-main>
</el-container> </el-container>
...@@ -111,6 +113,13 @@ ...@@ -111,6 +113,13 @@
}) })
}, },
onSave(){ onSave(){
if (!this.form.title) {
this.$message({
type: 'error',
message: '请完成基本信息编辑!'
});
return
}
this.form.content = JSON.stringify(this.selectedMould); this.form.content = JSON.stringify(this.selectedMould);
this.category_id = this.editorObj.category_id; this.category_id = this.editorObj.category_id;
switch (this.editorObj.type) { switch (this.editorObj.type) {
...@@ -176,6 +185,10 @@ ...@@ -176,6 +185,10 @@
padding: 10px; padding: 10px;
background: #f5f8ff; background: #f5f8ff;
} }
.main-btns {
margin-top: 68px;
margin-bottom: 10px;
}
.left-block{ .left-block{
font-size: 14px; font-size: 14px;
border: 1px solid #f0f0f0; border: 1px solid #f0f0f0;
......
...@@ -17,7 +17,7 @@ ...@@ -17,7 +17,7 @@
<i class="iconfont icon-shanchu" @click="delIndex(data)"></i> <i class="iconfont icon-shanchu" @click="delIndex(data)"></i>
</span> </span>
</template> </template>
<el-submenu class="list2" :index="item.name" v-for="item in data.children" :key="item.id"> <el-submenu v-if="data.children" class="list2" :index="item.name" v-for="item in data.children" :key="item.id">
<span slot="title"> <span slot="title">
{{item.name}} {{item.name}}
<div class="btn-block list2-btn"> <div class="btn-block list2-btn">
...@@ -39,11 +39,11 @@ ...@@ -39,11 +39,11 @@
</el-menu-item> </el-menu-item>
</div> </div>
<el-menu-item class="list3" index="new"> <el-menu-item class="list3" index="new">
<el-button type="success" round size="mini" plain style="width: 100%" @click="addItem(item.id)">+添加</el-button> <el-button type="success" round size="mini" plain style="width: 100%" @click="addItem(item.id)">+添加三级分类</el-button>
</el-menu-item> </el-menu-item>
</el-submenu> </el-submenu>
<el-menu-item class="list3" index="new"> <el-menu-item class="list3" index="new">
<el-button type="success" round size="mini" plain style="width: 100%" @click="addSec(data.id)">+添加</el-button> <el-button type="success" round size="mini" plain style="width: 100%" @click="addSec(data.id)">+添加二级分类</el-button>
</el-menu-item> </el-menu-item>
</el-submenu> </el-submenu>
</el-menu> </el-menu>
...@@ -95,6 +95,7 @@ ...@@ -95,6 +95,7 @@
getList(){ getList(){
getCategoryApi('').then(res=>{ getCategoryApi('').then(res=>{
res.forEach(i=>{ res.forEach(i=>{
i.children = i.children || [];
i.children.forEach(j=>{ i.children.forEach(j=>{
if(!j.children){ if(!j.children){
j.children = [] j.children = []
...@@ -102,10 +103,7 @@ ...@@ -102,10 +103,7 @@
}) })
}); });
this.leftList = res; this.leftList = res;
if(this.id === ''){
this.id = res[0].children[0].children[0].id;
this.index = res[0].children[0].children[0].name
}
this.$store.commit('mainCanShow'); this.$store.commit('mainCanShow');
this.menuLoading = false; this.menuLoading = false;
}) })
......
<template> <template>
<div> <div>
<div class="add-block"> <div class="add-block" v-if="id && list.length === 0">
<el-button class="add-btn" @click="onAdd">+新增课时</el-button> <el-button round type="success" @click="onAdd">+新增课时</el-button>
</div> </div>
<el-card v-for="data in list" :key="data.id" class="box-card"> <el-card v-for="data in list" :key="data.id" class="box-card">
<div class="id"> <div class="id">
...@@ -137,9 +137,10 @@ ...@@ -137,9 +137,10 @@
} }
.add-block{ .add-block{
.clear-both; .clear-both;
.add-btn{ display: flex;
float: right; justify-content: center;
} align-items: center;
margin-top: 30%;
} }
</style> </style>
...@@ -373,14 +373,14 @@ ...@@ -373,14 +373,14 @@
this.show = this.dialogObj.show; this.show = this.dialogObj.show;
this.id = this.dialogObj.id; this.id = this.dialogObj.id;
this.type = 2; this.type = 2;
getTeacherDetailApi(this.id).then(res=>{ // getTeacherDetailApi(this.id).then(res=>{
this.form.name = res.name; // this.form.name = res.name;
this.form.alias = res.alias; // this.form.alias = res.alias;
this.form.qr = res.qr; // this.form.qr = res.qr;
this.form.type = res.type; // this.form.type = res.type;
this.form.status = res.status; // this.form.status = res.status;
this.loading = false // this.loading = false
}); // });
break break
} }
......
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