|
|
|
@ -127,6 +127,13 @@ const rules = { |
|
|
|
|
trigger: 'change', |
|
|
|
|
}, |
|
|
|
|
], |
|
|
|
|
description: [ |
|
|
|
|
{ |
|
|
|
|
required: true, |
|
|
|
|
message: '请输入课程简介', |
|
|
|
|
trigger: 'blur', |
|
|
|
|
}, |
|
|
|
|
] |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
// 按钮禁用 |
|
|
|
@ -243,20 +250,11 @@ const upload = async (option: any) => { |
|
|
|
|
</script> |
|
|
|
|
|
|
|
|
|
<template> |
|
|
|
|
<el-drawer |
|
|
|
|
:before-close="handleClose" |
|
|
|
|
v-model="visibleDrawer" |
|
|
|
|
direction="rtl" |
|
|
|
|
:title="formModel.id ? '编辑课程' : '添加课程'" |
|
|
|
|
> |
|
|
|
|
<el-drawer :before-close="handleClose" v-model="visibleDrawer" direction="rtl" |
|
|
|
|
:title="formModel.id ? '编辑课程' : '添加课程'"> |
|
|
|
|
<el-form :model="formModel" :rules="rules" ref="formRef"> |
|
|
|
|
<el-form-item label="课程封面" prop="img"> |
|
|
|
|
<el-upload |
|
|
|
|
v-model="formModel.img" |
|
|
|
|
class="avatar-uploader" |
|
|
|
|
:http-request="upload" |
|
|
|
|
:show-file-list="false" |
|
|
|
|
> |
|
|
|
|
<el-upload v-model="formModel.img" class="avatar-uploader" :http-request="upload" :show-file-list="false"> |
|
|
|
|
<img v-if="imgUrl" :src="imgUrl" class="avatar" /> |
|
|
|
|
<el-icon v-else class="avatar-uploader-icon"> |
|
|
|
|
<Plus /> |
|
|
|
@ -295,12 +293,8 @@ const upload = async (option: any) => { |
|
|
|
|
</el-upload> --> |
|
|
|
|
</el-form-item> |
|
|
|
|
<el-form-item label="课程名称" prop="name"> |
|
|
|
|
<el-input |
|
|
|
|
:disabled="nameDisabled" |
|
|
|
|
style="width: 200px" |
|
|
|
|
v-model="formModel.name" |
|
|
|
|
@input="courseNameInput" |
|
|
|
|
></el-input> |
|
|
|
|
<el-input :disabled="nameDisabled" style="width: 200px" v-model="formModel.name" |
|
|
|
|
@input="courseNameInput"></el-input> |
|
|
|
|
</el-form-item> |
|
|
|
|
<el-form-item label="课程类别" prop="category"> |
|
|
|
|
<el-radio-group v-model="formModel.category"> |
|
|
|
@ -316,25 +310,18 @@ const upload = async (option: any) => { |
|
|
|
|
</el-radio-group> |
|
|
|
|
</el-form-item> |
|
|
|
|
<el-form-item label="课程编码" prop="code"> |
|
|
|
|
<el-input |
|
|
|
|
style="width: 200px" |
|
|
|
|
v-model="formModel.code" |
|
|
|
|
:disabled="codeDisabled" |
|
|
|
|
></el-input> |
|
|
|
|
<el-input style="width: 200px" v-model="formModel.code" :disabled="codeDisabled"></el-input> |
|
|
|
|
</el-form-item> |
|
|
|
|
<el-form-item label="课程学分" prop="credit"> |
|
|
|
|
<el-input style="width: 200px" v-model="formModel.credit"></el-input> |
|
|
|
|
</el-form-item> |
|
|
|
|
<el-form-item label="课程学时" prop="classhours"> |
|
|
|
|
<el-input |
|
|
|
|
style="width: 200px" |
|
|
|
|
v-model="formModel.classhours" |
|
|
|
|
></el-input> |
|
|
|
|
<el-input style="width: 200px" v-model="formModel.classhours"></el-input> |
|
|
|
|
</el-form-item> |
|
|
|
|
<el-form-item label="考核类型" prop="assessmenttype"> |
|
|
|
|
<el-radio-group v-model="formModel.assessmenttype"> |
|
|
|
|
<el-radio value="1">考试</el-radio> |
|
|
|
|
<el-radio value="2">考察</el-radio> |
|
|
|
|
<el-radio value="2">考查</el-radio> |
|
|
|
|
</el-radio-group> |
|
|
|
|
</el-form-item> |
|
|
|
|
<el-form-item label="考核方式" prop="assessmentway"> |
|
|
|
@ -344,14 +331,15 @@ const upload = async (option: any) => { |
|
|
|
|
<el-radio value="3">其他</el-radio> |
|
|
|
|
</el-radio-group> |
|
|
|
|
</el-form-item> |
|
|
|
|
<el-form-item label="教学方法" prop="teachermethod"> |
|
|
|
|
<!-- <el-form-item label="教学方法" prop="teachermethod"> |
|
|
|
|
<el-input type="textarea" v-model="formModel.teachermethod" /> |
|
|
|
|
</el-form-item> |
|
|
|
|
<el-form-item label="教学方式" prop="teacherway"> |
|
|
|
|
<el-input type="textarea" v-model="formModel.teacherway" /> |
|
|
|
|
</el-form-item> |
|
|
|
|
</el-form-item> --> |
|
|
|
|
<el-form-item label="课程简介" prop="description"> |
|
|
|
|
<el-input type="textarea" v-model="formModel.description" /> |
|
|
|
|
<textarea name="" id="" v-model="formModel.description"></textarea> |
|
|
|
|
<!-- <el-input class="brief_text" type="textarea" /> --> |
|
|
|
|
</el-form-item> |
|
|
|
|
</el-form> |
|
|
|
|
|
|
|
|
@ -367,6 +355,17 @@ const upload = async (option: any) => { |
|
|
|
|
</el-drawer> |
|
|
|
|
</template> |
|
|
|
|
<style lang="scss" scoped> |
|
|
|
|
textarea { |
|
|
|
|
width: 400px; |
|
|
|
|
height: 180px; |
|
|
|
|
resize: none; |
|
|
|
|
border: 1px solid #dcdfe6; |
|
|
|
|
color: #606266; |
|
|
|
|
line-height: 1.3; |
|
|
|
|
letter-spacing: 1px; |
|
|
|
|
border-radius: 6px; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
.avatar-uploader { |
|
|
|
|
:deep() { |
|
|
|
|
.avatar { |
|
|
|
|