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

页面修改

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