课程、课件、题目

This commit is contained in:
18571350067 2021-09-18 15:30:49 +08:00
parent 15a836e28b
commit a7e8633c2e
7 changed files with 169 additions and 346 deletions

View File

@ -1,7 +1,7 @@
import request from '@/utils/request'
const courseApi = {
// add: 'sys/menu/add',
add: '/courseManagement/course/addOrUpdate',
get: '/courseManagement/course/details',
// update: 'sys/menu/update',
del: 'courseManagement/course/delete',
@ -12,13 +12,13 @@ const courseApi = {
}
// export function menuAdd (params) {
// return request({
// url: menuApi.add,
// method: 'post',
// data: params
// })
// }
export function courseAdd (params) {
return request({
url: courseApi.add,
method: 'post',
data: params
})
}
// export function menuGet (params) {
// return request({
// url: menuApi.get,

View File

@ -0,0 +1,153 @@
<template>
<a-card :bordered="false" title="系統新增">
<a-form-model :model="form">
<a-row>
<!-- 课程名称 -->
<a-col :span="18" :offset="3">
<a-form-model-item label="课程名称" :label-col="{ span: 4 }" :wrapper-col="{ span: 15 }">
<a-input
v-model="form.courseName"
v-decorator="['courseName', { rules: [{ required: true, message: '请填写课程名称' }] }]"
/>
</a-form-model-item>
</a-col>
<!-- 课程类别 -->
<a-col :span="9" :offset="3">
<a-form-model-item label="课程类别" :label-col="{ span: 8 }" :wrapper-col="{ span: 12 }">
<a-select v-model="form.courseType" placeholder="--请选择--">
<a-select-option value="1"> 商业 </a-select-option>
<a-select-option value="2"> 政务 </a-select-option>
</a-select>
</a-form-model-item>
</a-col>
<!-- 课时 -->
<a-col :span="9">
<a-form-item label="课时" :label-col="{ span: 4 }" :wrapper-col="{ span: 10 }">
<a-input-number
id="hour"
v-model="dataValue"
:min="1"
:max="1000"
@change="onChange"
:style="{ display: 'ln', width: '100%' }"
/>
{{ dataValue }}分钟
</a-form-item>
</a-col>
<!-- 学习内容简介 -->
<a-col :span="18" :offset="3">
<a-form-model-item label="学习内容" :label-col="{ span: 4 }" :wrapper-col="{ span: 15 }">
<a-input v-model="form.learningContent" type="textarea" />
</a-form-model-item>
</a-col>
<!-- 所属行业 -->
<a-col :span="9" :offset="3">
<a-form-model-item label="所属行业" :label-col="{ span: 8 }" :wrapper-col="{ span: 12 }">
<a-select v-model="form.industryInvolved" placeholder="--请选择--">
<a-select-option value="1"> 医疗 </a-select-option>
<a-select-option value="0"> 建筑 </a-select-option>
</a-select>
</a-form-model-item>
</a-col>
<!-- 是否为必修课程 -->
<a-col :span="9">
<a-form-model-item label="是否为必修" :label-col="{ span: 6 }" :wrapper-col="{ span: 6 }">
<a-select v-model="form.isRequired" placeholder="--请选择--">
<a-select-option value="1"> </a-select-option>
<a-select-option value="0"> </a-select-option>
</a-select>
</a-form-model-item>
</a-col>
<!-- 选择岗位-人员类型 -->
<a-col :span="9" :offset="3">
<a-form-model-item label="选择岗位" :label-col="{ span: 8 }" :wrapper-col="{ span: 12 }">
<a-select v-model="form.job" placeholder="--请选择--">
<a-select-option v-for="item in personType" :key="item.id"> {{ item.name }} </a-select-option>
</a-select>
</a-form-model-item>
</a-col>
<!-- 备注 -->
<a-col :span="18" :offset="3">
<a-form-model-item label="备注" :label-col="{ span: 4 }" :wrapper-col="{ span: 15 }">
<a-input v-model="form.remark" type="textarea" />
</a-form-model-item>
</a-col>
<a-button @click="save">保存</a-button>
<!-- 上传封面图片 -->
<!-- <a-col :span="18" :offset="3">
<a-form-model-item label="上传封面图片" :label-col="{ span: 4 }" :wrapper-col="{ span: 15 }">
<a-upload
name="avatar"
list-type="picture-card"
class="avatar-uploader"
:show-upload-list="false"
action="https://www.mocky.io/v2/5cc8019d300000980a055e76"
:before-upload="beforeUpload"
@change="handleChange"
>
<img v-if="imageUrl" :src="imageUrl" alt="avatar" />
<div v-else>
<a-icon :type="loading ? 'loading' : 'plus'" />
<div class="ant-upload-text">封面图片</div>
</div>
</a-upload>
</a-form-model-item>
</a-col> -->
</a-row>
</a-form-model>
</a-card>
</template>
<script>
import { courseAdd } from '@/api/course/course'
export default {
name: 'step1',
data() {
return {
dataValue: 1,
form: {},
personType: [
{ id: '1', name: '人员类别1' },
{ id: '2', name: '人员类别2' },
{ id: '3', name: '人员类别3' },
],
}
},
components: {
courseAdd,
},
created() {},
methods: {
//
// getPersonType() {
// return dictGet(Object.assign(parameter)).then((res) => {
// return res
// })
// },
//
onChange(dataValue) {
console.log('changed', dataValue)
},
save(){
console.log(this.form)
courseAdd(this.form)
.then(res => {
if(res.code == 200){
this.$message.info("保存成功")
}
}) }
},
}
</script>

View File

@ -1,61 +0,0 @@
<template>
<page-header-wrapper>
<a-card :bordered="false">
<a-steps class="steps" :current="currentTab">
<a-step title="课程基本信息" />
<a-step title="课件信息" />
<a-step title="完成" />
</a-steps>
<div class="content">
<step1 v-if="currentTab === 0" @nextStep="nextStep"/>
<step2 v-if="currentTab === 1" @nextStep="nextStep" @prevStep="prevStep"/>
<step3 v-if="currentTab === 2" @prevStep="prevStep" @finish="finish"/>
</div>
</a-card>
</page-header-wrapper>
</template>
<script>
import Step1 from './coursestep/Step1'
import Step2 from './coursestep/Step2'
import Step3 from '../form/stepForm/Step3'
export default {
name: 'StepForm',
components: {
Step1,
Step2,
Step3
},
data () {
return {
currentTab: 0,
form: {}
}
},
methods: {
// handler
nextStep () {
if (this.currentTab < 2) {
this.currentTab += 1
}
},
prevStep () {
if (this.currentTab > 0) {
this.currentTab -= 1
}
},
finish () {
this.currentTab = 0
}
}
}
</script>
<style lang="less" scoped>
.steps {
max-width: 750px;
margin: 16px auto;
}
</style>

View File

@ -1,10 +1,10 @@
<template>
<page-header-wrapper :title="false">
<a-card :bordered="false">
<a-card :bordered="false" title="课程列表">
<div class="table-page-search-wrapper">
<SearchCom :form="queryParam" :list="queryOptions" @search="handleRefresh" @reset="() => {queryParam = {}, handleRefresh()}" ></SearchCom>
<div style="width: 100%; height: 32px; margin-bottom: 8px;">
<a-button type="primary">新建课程</a-button>
<a-button type="primary" @click="courseAdd">新建课程</a-button>
</div>
</div>
<s-table ref="table" size="default" rowKey="id" :columns="columns" :data="loadData" :pageNum="Number(this.$route.query.PageNum) || 1">
@ -68,6 +68,12 @@ export default {
});
},
//
courseAdd(){
console.log("OK你已經死亡");
this.$router.push({ path : '/course/CourseAdd' , query : {}})
},
//
courseQuestion(record){
this.$router.push({

View File

@ -1,164 +0,0 @@
<template>
<a-form-model :model="form">
<a-row>
<!-- 课程名称 -->
<a-col :span="18" :offset="3">
<a-form-model-item label="课程名称" :label-col="{ span: 4 }" :wrapper-col="{ span: 15 }">
<a-input
v-model="form.courseName"
v-decorator="['courseName', { rules: [{ required: true, message: '请填写课程名称' }] }]"
/>
</a-form-model-item>
</a-col>
<!-- 课程类别 -->
<a-col :span="9" :offset="3">
<a-form-model-item label="课程类别" :label-col="{ span: 8 }" :wrapper-col="{ span: 12 }">
<a-select v-model="form.courseType" placeholder="--请选择--">
<a-select-option value="shangye"> 商业 </a-select-option>
<a-select-option value="zhengwu"> 政务 </a-select-option>
</a-select>
</a-form-model-item>
</a-col>
<!-- 课时 -->
<a-col :span="9">
<a-form-item label="课时" :label-col="{ span: 4 }" :wrapper-col="{ span: 10 }">
<a-input-number
id="hour"
v-model="dataValue"
:min="1"
:max="1000"
@change="onChange"
:style="{ display: 'ln', width: '100%' }"
/>
{{dataValue}}分钟
</a-form-item>
</a-col>
<!-- 学习内容简介 -->
<a-col :span="18" :offset="3">
<a-form-model-item label="学习内容" :label-col="{ span: 4 }" :wrapper-col="{ span: 15 }">
<a-input v-model="form.learningContent" type="textarea" />
</a-form-model-item>
</a-col>
<!-- 所属行业 -->
<a-col :span="9" :offset="3">
<a-form-model-item label="所属行业" :label-col="{ span: 8 }" :wrapper-col="{ span: 12 }">
<a-select v-model="form.industryInvolved" placeholder="--请选择--">
<a-select-option value="1"> 医疗 </a-select-option>
<a-select-option value="0"> 建筑 </a-select-option>
</a-select>
</a-form-model-item>
</a-col>
<!-- 是否为必修课程 -->
<a-col :span="9">
<a-form-model-item label="是否为必修" :label-col="{ span: 6 }" :wrapper-col="{ span: 6 }">
<a-select v-model="form.isRequired" placeholder="--请选择--">
<a-select-option value="1"> </a-select-option>
<a-select-option value="0"> </a-select-option>
</a-select>
</a-form-model-item>
</a-col>
<!-- 选择岗位-人员类型 -->
<a-col :span="9" :offset="3">
<a-form-model-item label="选择岗位" :label-col="{ span: 8 }" :wrapper-col="{ span: 12 }">
<a-select v-model="form.job" placeholder="--请选择--">
<a-select-option v-for="item in personType" :key="item.id"> {{ item.name }} </a-select-option>
</a-select>
</a-form-model-item>
</a-col>
<!-- 备注 -->
<a-col :span="18" :offset="3">
<a-form-model-item label="备注" :label-col="{ span: 4 }" :wrapper-col="{ span: 15 }">
<a-input v-model="form.remark" type="textarea" />
</a-form-model-item>
</a-col>
<!-- 上传封面图片 -->
<!-- <a-col :span="18" :offset="3">
<a-form-model-item label="上传封面图片" :label-col="{ span: 4 }" :wrapper-col="{ span: 15 }">
<a-upload
name="avatar"
list-type="picture-card"
class="avatar-uploader"
:show-upload-list="false"
action="https://www.mocky.io/v2/5cc8019d300000980a055e76"
:before-upload="beforeUpload"
@change="handleChange"
>
<img v-if="imageUrl" :src="imageUrl" alt="avatar" />
<div v-else>
<a-icon :type="loading ? 'loading' : 'plus'" />
<div class="ant-upload-text">封面图片</div>
</div>
</a-upload>
</a-form-model-item>
</a-col> -->
</a-row>
<a-col>
<a-form-model-item :wrapper-col="{ span: 14, offset: 10 }">
<a-button type="primary" @click="toNext"> 下一步 </a-button>
<a-button style="margin-left: 10px"> 取消 </a-button>
</a-form-model-item>
</a-col>
</a-form-model>
</template>
<script>
// import { dictGet } from '@/api/project/project'
export default {
name:'step1',
data() {
return {
dataValue: 1,
form: {},
personType: [
{id: '1', name: '人员类别1'},
{id: '2', name: '人员类别2'},
{id: '3', name: '人员类别3'}
]
}
},
components: {
// dictGet,
},
created () {},
methods: {
//
// getPersonType() {
// return dictGet(Object.assign(parameter)).then((res) => {
// return res
// })
// },
//
onChange(dataValue) {
console.log('changed', dataValue)
},
toNext () {
const { form: { validateFields } } = this
//
validateFields((err, values) => {
if (!err) {
this.$emit('toNext')
}
})
}
// //from
// toNext() {
// console.log('toNext', this.form)
// },
},
}
</script>

View File

@ -1,110 +0,0 @@
<template>
<div>
<a-form :form="form" style="max-width: 500px; margin: 40px auto 0;">
<a-alert
:closable="true"
message="确认转账后,资金将直接打入对方账户,无法退回。"
style="margin-bottom: 24px;"
/>
<a-form-item
label="付款账户"
:labelCol="labelCol"
:wrapperCol="wrapperCol"
class="stepFormText"
>
ant-design@alipay.com
</a-form-item>
<a-form-item
label="收款账户"
:labelCol="labelCol"
:wrapperCol="wrapperCol"
class="stepFormText"
>
test@example.com
</a-form-item>
<a-form-item
label="收款人姓名"
:labelCol="labelCol"
:wrapperCol="wrapperCol"
class="stepFormText"
>
Alex
</a-form-item>
<a-form-item
label="转账金额"
:labelCol="labelCol"
:wrapperCol="wrapperCol"
class="stepFormText"
>
5,000.00
</a-form-item>
<a-divider />
<a-form-item
label="支付密码"
:labelCol="labelCol"
:wrapperCol="wrapperCol"
class="stepFormText"
>
<a-input
type="password"
style="width: 80%;"
v-decorator="['paymentPassword', { initialValue: '123456', rules: [{required: true, message: '请输入支付密码'}] }]" />
</a-form-item>
<a-form-item :wrapperCol="{span: 19, offset: 5}">
<a-button :loading="loading" type="primary" @click="nextStep">提交</a-button>
<a-button style="margin-left: 8px" @click="prevStep">上一步</a-button>
</a-form-item>
</a-form>
</div>
</template>
<script>
export default {
name: 'Step2',
data () {
return {
labelCol: { lg: { span: 5 }, sm: { span: 5 } },
wrapperCol: { lg: { span: 19 }, sm: { span: 19 } },
form: this.$form.createForm(this),
loading: false,
timer: 0
}
},
methods: {
nextStep () {
const that = this
const { form: { validateFields } } = this
that.loading = true
validateFields((err, values) => {
if (!err) {
console.log('表单 values', values)
that.timer = setTimeout(function () {
that.loading = false
that.$emit('nextStep')
}, 1500)
} else {
that.loading = false
}
})
},
prevStep () {
this.$emit('prevStep')
}
},
beforeDestroy () {
clearTimeout(this.timer)
}
}
</script>
<style lang="less" scoped>
.stepFormText {
margin-bottom: 24px;
.ant-form-item-label,
.ant-form-item-control {
line-height: 22px;
}
}
</style>

View File

@ -40,7 +40,6 @@
<script>
import { getQuestionListByCourseId } from '@/api/course/course'
import { getQuestionDeatil } from '@/api/course/question/question'
import get from 'lodash.get'
export default {
data() {