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