Commit 4458daf1 authored by 黄奎's avatar 黄奎

页面修改

parent 7601d90b
......@@ -135,11 +135,33 @@ export function updateCourseTeacher(data) {
* 获取课程教案分页
* @param {JSON对象} data
*/
export function queryTeachPlanPage(data)
{
return request({
url: "/Course/GetCourseTeachPlanPage",
method: 'post',
data
})
export function queryTeachPlanPage(data) {
return request({
url: "/Course/GetCourseTeachPlanPage",
method: 'post',
data
})
}
/**
* 获取课程教案信息
*/
export function queryTeachPlanInfo(data) {
return request({
url: "/Course/GetTeachPlan",
method: 'post',
data
})
}
/**
* 保存课程教案
* @param {JSON数据} data
*/
export function saveTeachPlanInfo(data) {
return request({
url: "/Course/SetTeachPlan",
method: 'post',
data
})
}
<template>
<q-editor :toolbar="toolbar" :fonts="fonts" v-model="defaultMsg" :class="classStr"
:definitions="{bold: {label: 'Bold', icon: null, tip: 'My bold tooltip'}}" />
<q-editor :toolbar="toolbar" :fonts="fonts" v-model="editMsg" :class="classStr"
:definitions="{bold: {label: 'Bold', icon: null, tip: 'My bold tooltip'}}" @input="getEditorValue" />
</template>
<script>
import {
......@@ -8,7 +8,7 @@
} from '../../api/common/common'
export default {
props: {
//树形结构列表
//默认数据
defaultMsg: {
type: String,
default: ""
......@@ -20,17 +20,28 @@
},
data() {
return {
editMsg: "",
toolbar: [],
fonts: {},
}
},
watch: {
defaultMsg: {
handler(newValue) {
this.editMsg = this.defaultMsg;
},
immediate: true
}
},
mounted() {
this.initToolBar();
},
methods: {
//获取编辑器值
getEditorValue() {
this.$emit('getEditValue', this.editMsg);
},
//初始化配置
initToolBar() {
this.toolbar = [
[{
......@@ -98,7 +109,6 @@
];
this.fonts = getFontConfig();
},
}
}
......
......@@ -42,7 +42,6 @@
defaultArray: {
type: Array,
required: true,
},
//节点Key
nodeKey: {
......@@ -95,9 +94,9 @@
}
this.setTreeCheckNode()
},
defaultArray(val) {
if (val) {
if (this.defaultArray && Array.isArray(this.defaultArray) && this.defaultArray.length > 0) {
defaultArray: {
handler(newValue) {
if (this.defaultArray && this.defaultArray.length > 0) {
this.defaultArray.forEach(item => {
if (item != '') {
if (this.multiple) {
......@@ -109,11 +108,11 @@
})
}
this.setTreeCheckNode();
}
},
immediate: true
}
},
mounted() {
},
mounted() {},
methods: {
//全选
checkAll() {
......
......@@ -22,7 +22,7 @@
</div>
<div class="text-caption q-my-md q-px-xs text-grey-6">课程介绍
</div>
<editor :defaultMsg="objOption.CourseIntro" classStr="col-12"></editor>
<ext-editor :defaultMsg="objOption.CourseIntro" classStr="col-12" @getEditValue="getEditValue"></ext-editor>
</q-card-section>
<q-separator />
<q-card-actions align="right" class="bg-white">
......@@ -45,11 +45,11 @@
UploadSelfFile
} from '../../api/common/common'
import selectTree from '../common/select-tree'
import editor from '../common/editor'
import extEditor from '../common/ext-editor'
export default {
components: {
selectTree,
editor,
extEditor,
},
props: {
saveObj: {
......@@ -78,6 +78,10 @@
this.initObj()
},
methods: {
//获取编辑器值
getEditValue(obj) {
this.objOption.CourseIntro = obj;
},
getChild(obj) {
this.objOption.CateId = obj;
},
......
......@@ -7,18 +7,21 @@
<q-card-section class="q-pt-none scroll" style="max-height: 70vh">
<div class="text-caption q-mb-lg q-px-md text-grey-6">教案信息</div>
<div class="row wrap">
<q-input filled stack-label maxlength="20" :dense="false" v-model="objOption.CourseName" ref="CourseName"
<q-input filled stack-label maxlength="20" :dense="false" v-model="objOption.PlanName" ref="PlanName"
class="col-6 q-pr-lg q-pb-lg" label="教案名称" :rules="[val => !!val || '请填写教案名称']" />
<!-- <div class="col-6 q-pb-lg upload-assiatant-box">
<q-uploader :style="{backgroundImage:'url(' + objOption.CoverImg + ')'}" flat hide-upload-btn max-files="1"
label="课程封面" :max-file-size="512*1024" accept=".jpg, image/*" :factory="uploadFile" auto-upload>
</q-uploader>
</div> -->
</div>
<editor :defaultMsg="objOption.CourseIntro" classStr="col-12" >
</editor>
<div class="text-caption q-my-md q-px-xs text-grey-6">课前
</div>
<ext-editor :defaultMsg="objOption.ClassBefore" classStr="col-12" @getEditValue="getEditValue1">
</ext-editor>
<div class="text-caption q-my-md q-px-xs text-grey-6">课中
</div>
<ext-editor :defaultMsg="objOption.ClassIn" classStr="col-12" @getEditValue="getEditValue2">
</ext-editor>
<div class="text-caption q-my-md q-px-xs text-grey-6">课后
</div>
<ext-editor :defaultMsg="objOption.ClassAfter" classStr="col-12" @getEditValue="getEditValue3">
</ext-editor>
</q-card-section>
<q-separator />
<q-card-actions align="right" class="bg-white">
......@@ -32,15 +35,14 @@
<script>
import {
queryCourseCategoryTree,
saveCourseInfo,
queryCourseInfo,
queryTeachPlanInfo,
saveTeachPlanInfo
} from '../../api/course/index'
import editor from '../common/editor'
import extEditor from '../common/ext-editor'
export default {
components: {
editor
extEditor
},
props: {
saveObj: {
......@@ -53,18 +55,17 @@
persistent: true,
objOption: {
PlanId: 0, //教案编号
CourseId:0,//课程编辑
CourseId: 0, //课程编辑
PlanName: "", //教案名称
ClassBefore: "", //课前
ClassIn: "", //课中
ClassAfter:"",//课后
ParentPlanId:0,//父级节点编号
SourceUrl:"",//源文件路径
PlanFileExtension:"",//文件后缀名
PlanNodeType:0,//节点类型(0-文件,1-文件夹)
ExtUrl:"",//上传生成文件路径
Remark:"",//备注
CateId: 0, //课程编号
ClassAfter: "", //课后
ParentPlanId: 0, //父级节点编号
SourceUrl: "", //源文件路径
PlanFileExtension: "", //文件后缀名
PlanNodeType: 0, //节点类型(0-文件,1-文件夹)
ExtUrl: "", //上传生成文件路径
Remark: "", //备注
},
optionTitle: "",
saveCourseLoading: false,
......@@ -75,6 +76,15 @@
this.initObj()
},
methods: {
getEditValue1(obj) {
this.objOption.ClassBefore = obj;
},
getEditValue2(obj) {
this.objOption.ClassIn = obj;
},
getEditValue3(obj) {
this.objOption.ClassAfter = obj;
},
uploadFile(files) {
UploadSelfFile('course', files[0], res => {
if (res.resultCode == 1) {
......@@ -82,28 +92,28 @@
}
})
},
//初始化表单
initObj() {
if (this.saveObj && this.saveObj.CourseId > 0) {
queryCourseInfo({
CourseId: this.saveObj.CourseId
if (this.saveObj && this.saveObj.PlanId > 0) {
queryTeachPlanInfo({
PlanId: this.saveObj.PlanId
}).then(res => {
this.objOption.PlanName = res.Data.PlanName;
this.objOption.PlanId = res.Data.PlanId;
this.objOption.CourseId = res.Data.CourseId;
this.objOption.CoverImg = res.Data.CoverImg;
this.objOption.CourseName = res.Data.CourseName;
this.objOption.CourseIntro = res.Data.CourseIntro;
this.objOption.CateId = res.Data.CateId;
this.returnString = res.Data.CateId;
this.objOption.ClassBefore = res.Data.ClassBefore;
this.objOption.ClassIn = res.Data.ClassIn;
this.objOption.ClassAfter = res.Data.ClassAfter;
this.objOption.ParentPlanId = res.Data.ParentPlanId;
this.objOption.SourceUrl = res.Data.SourceUrl;
this.objOption.PlanFileExtension = res.Data.PlanFileExtension;
this.objOption.PlanNodeType = res.Data.PlanNodeType;
this.objOption.ExtUrl = res.Data.ExtUrl;
this.objOption.Remark = res.Data.Remark;
})
this.optionTitle = "修改课程信息"
this.optionTitle = "修改教案信息"
} else {
this.optionTitle = "新增课程"
this.objOption.CourseId = 0;
this.objOption.CoverImg = "";
this.objOption.CourseName = "";
this.objOption.CourseIntro = "";
this.objOption.CateId = 0;
this.optionTitle = "新增教案"
}
},
//关闭弹窗
......@@ -114,7 +124,7 @@
//保存菜单
saveCourse() {
this.saveCourseLoading = true
saveCourseInfo(this.objOption).then(res => {
saveTeachPlanInfo(this.objOption).then(res => {
this.saveCourseLoading = false
this.$q.notify({
icon: 'iconfont icon-chenggong',
......
......@@ -53,7 +53,8 @@
</q-td>
</template>
</q-table>
<course-form v-if="isShowCourseForm" :save-obj="courseObjOption" @close="closeMenuSaveForm" @success="refreshPage">
<course-form v-if="isShowCourseForm" :save-obj="courseObjOption" @close="closeMenuSaveForm"
@success="refreshPage">
</course-form>
</div>
</div>
......
......@@ -53,7 +53,8 @@
</q-td>
</template>
</q-table>
<teachplan-form v-if="isShowMenuForm" :save-obj="menuObjOption" @close="closeMenuSaveForm" @success="refreshPage">
<teachplan-form v-if="IsShowTeachForm" :save-obj="teachPlanObj" @close="closeTeachSaveForm"
@success="refreshPage">
</teachplan-form>
</div>
</div>
......@@ -88,7 +89,6 @@
align: 'left',
field: row => row.PlanName
},
{
name: 'CreateByName',
label: '创建人',
......@@ -121,12 +121,9 @@
rowsPerPage: 12,
CourseId: 1,
},
//课程分类树形列表
TreeCategoryList: [],
returnString: "", //返回字符串
pageCount: 0,
isShowMenuForm: false,
menuObjOption: null,
IsShowTeachForm: false,
teachPlanObj: null,
}
},
mounted() {
......@@ -157,21 +154,21 @@
},
//刷新页面
refreshPage() {
this.isShowMenuForm = false;
this.IsShowTeachForm = false;
this.getteachplanList();
},
//新增修改菜单
EditTeachPlan(obj) {
if (obj) {
this.menuObjOption = obj
this.teachPlanObj = obj
} else {
this.menuObjOption = null
this.teachPlanObj = null
}
this.isShowMenuForm = true
this.IsShowTeachForm = true
},
//关闭弹窗
closeMenuSaveForm() {
this.isShowMenuForm = false
closeTeachSaveForm() {
this.IsShowTeachForm = false
}
}
}
......
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