Commit e1b0ccd6 authored by 黄奎's avatar 黄奎

新增页面

parent 1249f642
......@@ -130,3 +130,16 @@ export function updateCourseTeacher(data) {
data
})
}
/**
* 获取课程教案分页
* @param {JSON对象} data
*/
export function queryTeachPlanPage(data)
{
return request({
url: "/Course/GetCourseTeachPlanPage",
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'}}" />
</template>
<script>
import {
getFontConfig,
} from '../../api/common/common'
export default {
props: {
//树形结构列表
defaultMsg: {
type: String,
default: ""
},
classStr: {
type: String,
default: ""
}
},
data() {
return {
toolbar: [],
fonts: {},
}
},
watch: {
},
mounted() {
this.initToolBar();
},
methods: {
initToolBar() {
this.toolbar = [
[{
label: '对齐',
icon: this.$q.iconSet.editor.align,
fixedLabel: true,
list: 'only-icons',
options: ['left', 'center', 'right', 'justify']
}],
['bold', 'italic', 'strike', 'underline', 'subscript', 'superscript'],
[{
label: '格式',
icon: this.$q.iconSet.editor.formatting,
list: 'no-icons',
fixedLabel: true,
fixedIcon: true,
options: [
'p',
'h1',
'h2',
'h3',
'h4',
'h5',
'h6',
'code'
]
},
{
label: '字号',
icon: this.$q.iconSet.editor.fontSize,
fixedLabel: true,
fixedIcon: true,
list: 'no-icons',
options: [
'size-1',
'size-2',
'size-3',
'size-4',
'size-5',
'size-6',
'size-7'
]
},
{
label: '字体',
icon: this.$q.iconSet.editor.font,
fixedLabel: true,
fixedIcon: true,
list: 'no-icons',
options: [
'default_font',
'arial',
'arial_black',
'comic_sans',
'courier_new',
'impact',
'lucida_grande',
'times_new_roman',
'verdana'
]
},
'removeFormat'
],
['ordered', 'outdent', 'indent'],
];
this.fonts = getFontConfig();
},
}
}
</script>
......@@ -6,7 +6,7 @@
<q-btn round dense flat icon="search" />
</template>
</q-input>
<q-card style="width:100%;position:absolute;z-index:99999;background:#fff;border:1px solid rgba(0, 0, 0, 0.12);">
<q-card style="width:100%;position:absolute;z-index:100;background:#fff;border:1px solid rgba(0, 0, 0, 0.12);">
<q-btn-group push v-if="isShowSelect" :spread="true">
<q-btn v-if="multiple" push label="全选" @click="checkAll()" />
<q-btn push label="清空" @click="clearMsg()" />
......
......@@ -2,7 +2,7 @@
<q-dialog v-model="persistent" content-class="bg-grey-1" persistent transition-show="scale" transition-hide="scale">
<q-card style="width: 800px;max-width:900px;">
<q-card-section>
<div class="text-h6">{{objOption.MenuId==0?'新增课程分类信息':'修改课程分类信息'}}</div>
<div class="text-h6">{{objOption.CateId==0?'新增课程分类信息':'修改课程分类信息'}}</div>
</q-card-section>
<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>
......
......@@ -2,7 +2,7 @@
<q-dialog v-model="persistent" persistent transition-show="scale" transition-hide="scale">
<q-card style="width: 800px;max-width:900px;">
<q-card-section>
<div class="text-h6">{{objOption.MenuId==0?'新增课程信息':'修改课程信息'}}</div>
<div class="text-h6">{{objOption.CourseId==0?'新增课程信息':'修改课程信息'}}</div>
</q-card-section>
<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>
......
<template>
<q-dialog v-model="persistent" persistent transition-show="scale" transition-hide="scale">
<q-card style="width: 800px;max-width:900px;">
<q-card-section>
<div class="text-h6">{{objOption.MenuId==0?'新增教案信息':'修改教案信息'}}</div>
</q-card-section>
<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"
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>
</q-card-section>
<q-separator />
<q-card-actions align="right" class="bg-white">
<q-btn label="取消" color="dark" style="font-weight:400 !important" @click="closeCourseForm" />
<q-btn label="立即提交" color="accent q-px-md" style="font-weight:400 !important" :loading="saveCourseLoading"
@click="saveCourse" />
</q-card-actions>
</q-card>
</q-dialog>
</template>
<script>
import {
queryCourseCategoryTree,
saveCourseInfo,
queryCourseInfo,
} from '../../api/course/index'
import editor from '../common/editor'
export default {
components: {
editor
},
props: {
saveObj: {
type: Object,
default: null
}
},
data() {
return {
persistent: true,
objOption: {
PlanId: 0, //教案编号
CourseId:0,//课程编辑
PlanName: "", //教案名称
ClassBefore: "", //课前
ClassIn: "", //课中
ClassAfter:"",//课后
ParentPlanId:0,//父级节点编号
SourceUrl:"",//源文件路径
PlanFileExtension:"",//文件后缀名
PlanNodeType:0,//节点类型(0-文件,1-文件夹)
ExtUrl:"",//上传生成文件路径
Remark:"",//备注
CateId: 0, //课程编号
},
optionTitle: "",
saveCourseLoading: false,
TreeCategoryList: [], //课程分类树形列表
}
},
mounted() {
this.initObj()
},
methods: {
uploadFile(files) {
UploadSelfFile('course', files[0], res => {
if (res.resultCode == 1) {
this.objOption.CoverImg = res.FileUrl;
}
})
},
//初始化表单
initObj() {
if (this.saveObj && this.saveObj.CourseId > 0) {
queryCourseInfo({
CourseId: this.saveObj.CourseId
}).then(res => {
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.optionTitle = "修改课程信息"
} else {
this.optionTitle = "新增课程"
this.objOption.CourseId = 0;
this.objOption.CoverImg = "";
this.objOption.CourseName = "";
this.objOption.CourseIntro = "";
this.objOption.CateId = 0;
}
},
//关闭弹窗
closeCourseForm() {
this.$emit('close')
this.persistent = false
},
//保存菜单
saveCourse() {
this.saveCourseLoading = true
saveCourseInfo(this.objOption).then(res => {
this.saveCourseLoading = false
this.$q.notify({
icon: 'iconfont icon-chenggong',
color: 'accent',
timeout: 2000,
message: '数据保存成功!',
position: 'top'
})
this.$emit("success")
this.closeSaveForm()
}).catch(() => {
this.saveCourseLoading = false
})
}
},
}
</script>
......@@ -2,7 +2,7 @@
<q-dialog v-model="persistent" persistent transition-show="scale" transition-hide="scale">
<q-card style="width: 800px;max-width:900px;">
<q-card-section>
<div class="text-h6">{{objOption.MenuId==0?'新增角色信息':'修改角色信息'}}</div>
<div class="text-h6">{{objOption.RoleId==0?'新增角色信息':'修改角色信息'}}</div>
</q-card-section>
<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>
......
......@@ -53,7 +53,7 @@
</q-td>
</template>
</q-table>
<course-form v-if="isShowMenuForm" :save-obj="menuObjOption" @close="closeMenuSaveForm" @success="refreshPage">
<course-form v-if="isShowCourseForm" :save-obj="courseObjOption" @close="closeMenuSaveForm" @success="refreshPage">
</course-form>
</div>
</div>
......@@ -147,10 +147,6 @@
value: '1'
}
],
//菜单等级
MenuLevelOpts: [],
//菜单类型
MenuTypeOpts: [],
msg: {
pageIndex: 1,
pageSize: 12,
......@@ -163,8 +159,8 @@
TreeCategoryList: [],
returnString: "", //返回字符串
pageCount: 0,
isShowMenuForm: false,
menuObjOption: null,
isShowCourseForm: false,
courseObjOption: null,
}
},
mounted() {
......@@ -218,21 +214,21 @@
},
//刷新页面
refreshPage() {
this.isShowMenuForm = false;
this.isShowCourseForm = false;
this.getcourselist();
},
//新增修改菜单
EditCourse(obj) {
if (obj) {
this.menuObjOption = obj
this.courseObjOption = obj
} else {
this.menuObjOption = null
this.courseObjOption = null
}
this.isShowMenuForm = true
this.isShowCourseForm = true
},
//关闭弹窗
closeMenuSaveForm() {
this.isShowMenuForm = false
this.isShowCourseForm = false
}
}
}
......
<template>
<div class="page-body">
<div class="page-search row items-center">
<div class="col row wrap q-mr-lg q-col-gutter-md">
</div>
<div class="page-option">
<q-btn-dropdown outline color="dark" label="添加教案">
<q-list>
<q-item clickable v-close-popup>
<q-item-section>
<q-item-label @click="EditTeachPlan(null)">新增教案</q-item-label>
</q-item-section>
</q-item>
<q-item clickable v-close-popup>
<q-item-section>
<q-item-label>上传教案</q-item-label>
</q-item-section>
</q-item>
</q-list>
</q-btn-dropdown>
</div>
</div>
<div class="page-content">
<q-table :pagination="msg" :loading="loading" no-data-label="暂无相关数据" flat class="sticky-tow-column-table"
separator="none" title="课程信息" :data="data" :columns="columns" row-key="name">
<template v-slot:body-cell-CoverImg="props">
<q-td :props="props">
<q-avatar square size="100px">
<img :src="props.value" />
</q-avatar>
</q-td>
</template>
<template v-slot:body-cell-CourseIntro="props">
<q-td :props="props">
<span v-html="props.value"></span>
</q-td>
</template>
<template v-slot:body-cell-Status="props">
<q-td :props="props">
<q-badge :color="props.value==1?'negative':'primary'" :label="props.value==0?'正常':'禁用'" />
</q-td>
</template>
<template v-slot:bottom>
<q-pagination class="full-width justify-end" v-model="msg.pageIndex" color="primary" :max="pageCount"
:input="true" @input="changePage" />
</template>
<template v-slot:body-cell-optioned="props">
<q-td :props="props">
<q-btn flat size="xs" icon="iconfont icon-shanchu" color="accent" style="font-weight:400" label="删除"
@click="EditTeachPlan(props.row)"></q-btn>
<q-btn flat size="xs" icon="edit" color="accent" style="font-weight:400" label="编辑"
@click="EditTeachPlan(props.row)" />
</q-td>
</template>
</q-table>
<teachplan-form v-if="isShowMenuForm" :save-obj="menuObjOption" @close="closeMenuSaveForm" @success="refreshPage">
</teachplan-form>
</div>
</div>
</template>
<script>
import {
queryTeachPlanPage,
} from '../../api/course/index'
import teachplanForm from '../../components/course/teachplan-form'
export default {
meta: {
title: "教案管理"
},
components: {
teachplanForm,
},
data() {
return {
currentUrl: "",
columns: [{
name: 'PlanId',
label: '教案编号',
field: 'PlanId',
align: 'left'
},
{
name: 'PlanName',
required: true,
label: '教案名称',
align: 'left',
field: row => row.PlanName
},
{
name: 'CreateByName',
label: '创建人',
field: 'CreateByName',
align: 'left'
},
{
name: 'UpdateTimeStr',
label: '更新时间',
field: 'UpdateTimeStr',
align: 'left'
},
{
name: 'Status',
label: '状态',
align: 'left',
field: 'Status'
},
{
name: 'optioned',
label: '操作',
field: 'PlanId'
}
],
data: [],
loading: true,
msg: {
pageIndex: 1,
pageSize: 12,
rowsPerPage: 12,
CourseId: 1,
},
//课程分类树形列表
TreeCategoryList: [],
returnString: "", //返回字符串
pageCount: 0,
isShowMenuForm: false,
menuObjOption: null,
}
},
mounted() {
this.currentUrl = this.$route.path
this.getteachplanList();
},
methods: {
//重新查询
resetSearch() {
this.msg.pageIndex = 1;
this.getteachplanList();
},
//翻页
changePage(val) {
this.msg.pageIndex = val;
this.getteachplanList()
},
//获取菜单分页列表
getteachplanList() {
this.loading = true;
queryTeachPlanPage(this.msg).then(res => {
this.loading = false
this.data = res.Data.PageData
this.pageCount = res.Data.PageCount
}).catch(() => {
this.loading = false
})
},
//刷新页面
refreshPage() {
this.isShowMenuForm = false;
this.getteachplanList();
},
//新增修改菜单
EditTeachPlan(obj) {
if (obj) {
this.menuObjOption = obj
} else {
this.menuObjOption = null
}
this.isShowMenuForm = true
},
//关闭弹窗
closeMenuSaveForm() {
this.isShowMenuForm = false
}
}
}
</script>
<style lang="sass">
@import url('~assets/css/table.sass');
</style>
......@@ -52,6 +52,11 @@ const routes = [{
component: () =>
import ("pages/course/course.vue")
},
{
path: "/course/teachplan", //教案管理
component: () =>
import ("pages/course/teachplan.vue")
},
{
path: "/test", //API测试
component: () =>
......
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