|
@@ -137,39 +137,65 @@
|
|
|
</el-dialog>
|
|
|
|
|
|
<!-- 添加课程 -->
|
|
|
- <el-dialog :visible.sync="addDialogVisible" title="添加课程" width="800px" top="6.5vh">
|
|
|
- <el-form :model="courseForm" :rules="courseRules" ref="courseForm" label-width="120px">
|
|
|
- <el-form-item label="课程分类" prop="courseTypeId">
|
|
|
- <el-select v-model="courseForm.courseTypeId" placeholder="请选择" style="width:100%">
|
|
|
- <el-option v-for="item in categoryOptionsTwo" :key="item.value" :label="item.label"
|
|
|
- :value="item.value">
|
|
|
- </el-option>
|
|
|
- </el-select>
|
|
|
- </el-form-item>
|
|
|
- <el-form-item label="课程名称" prop="courseName">
|
|
|
- <el-input v-model="courseForm.courseName" placeholder="请输入课程名称"></el-input>
|
|
|
- </el-form-item>
|
|
|
- <el-form-item label="课程介绍" style="height: 200px;">
|
|
|
- <quill-editor style="height: 150px" ref="text" v-model="courseForm.courseDesc" class="myQuillEditor"
|
|
|
- :options="editorOption" />
|
|
|
- </el-form-item>
|
|
|
- <el-form-item label="课程价格">
|
|
|
- <el-input-number v-model="courseForm.coursePrice" :min="0" :precision="2" step-strictly :step="1"
|
|
|
- @blur="coursePriceBlur"></el-input-number>
|
|
|
- </el-form-item>
|
|
|
- <el-form-item label="课程时间(分钟)">
|
|
|
- <el-input-number v-model="courseForm.courseDuration" :min="1" step-strictly :step="1"
|
|
|
- @blur="courseDurationBlur"></el-input-number>
|
|
|
- </el-form-item>
|
|
|
- <el-form-item label="课程封面">
|
|
|
- <el-upload class="cover-uploader" action="#" :show-file-list="false"
|
|
|
- :on-change="handleCourseCoverChange" :auto-upload="false" :before-upload="beforeCoverUpload">
|
|
|
- <img v-if="courseForm.coverImageUrl" :src="courseForm.coverImageUrl" class="cover-image" />
|
|
|
- <i v-else class="el-icon-plus cover-uploader-icon"></i>
|
|
|
- </el-upload>
|
|
|
- <div class="cover-tip">建议尺寸 16:9,大小不超过2MB</div>
|
|
|
- </el-form-item>
|
|
|
- </el-form>
|
|
|
+ <el-dialog :visible.sync="addDialogVisible" title="添加课程" width="900px" top="6.5vh">
|
|
|
+ <div style="height: 60vh;overflow-y: auto; padding: 0 20px">
|
|
|
+ <el-form :model="courseForm" :rules="courseRules" ref="courseForm" label-width="120px">
|
|
|
+ <el-form-item label="课程分类" prop="courseTypeId">
|
|
|
+ <el-select v-model="courseForm.courseTypeId" placeholder="请选择" style="width:100%">
|
|
|
+ <el-option v-for="item in categoryOptionsTwo" :key="item.value" :label="item.label"
|
|
|
+ :value="item.value">
|
|
|
+ </el-option>
|
|
|
+ </el-select>
|
|
|
+ </el-form-item>
|
|
|
+ <el-form-item label="课程名称" prop="courseName">
|
|
|
+ <el-input v-model="courseForm.courseName" placeholder="请输入课程名称"></el-input>
|
|
|
+ </el-form-item>
|
|
|
+ <el-form-item label="课程介绍" style="height: 200px;">
|
|
|
+ <quill-editor style="height: 150px" ref="text" v-model="courseForm.courseDesc"
|
|
|
+ class="myQuillEditor" :options="editorOption" />
|
|
|
+ </el-form-item>
|
|
|
+ <div style="display: flex;flex-wrap: wrap;">
|
|
|
+ <el-form-item label="课程价格" style="width: 50%;">
|
|
|
+ <el-input-number v-model="courseForm.coursePrice" :min="0" :precision="2" step-strictly
|
|
|
+ :step="1" @blur="coursePriceBlur" controls-position="right"></el-input-number>
|
|
|
+ </el-form-item>
|
|
|
+ <el-form-item label="课程时间(分钟)" style="width: 50%;">
|
|
|
+ <el-input-number v-model="courseForm.courseDuration" :min="1" step-strictly :step="1"
|
|
|
+ @blur="courseDurationBlur" controls-position="right"></el-input-number>
|
|
|
+ </el-form-item>
|
|
|
+ <el-form-item label="培训学时" style="width: 50%;">
|
|
|
+ <el-input-number v-model="courseForm.teachDuration" :min="0" step-strictly
|
|
|
+ :step="1" controls-position="right"></el-input-number>
|
|
|
+ </el-form-item>
|
|
|
+ <el-form-item label="培训费/认证费" style="width: 50%;">
|
|
|
+ <el-input-number v-model="courseForm.teachVeriPrice" :min="0" step-strictly
|
|
|
+ :step="1" controls-position="right"></el-input-number>
|
|
|
+ </el-form-item>
|
|
|
+ <el-form-item label="资料费" style="width: 50%;">
|
|
|
+ <el-input-number v-model="courseForm.materialPrice" :min="0" step-strictly
|
|
|
+ :step="1" controls-position="right"></el-input-number>
|
|
|
+ </el-form-item>
|
|
|
+ <el-form-item label="其他费用1" style="width: 50%;">
|
|
|
+ <el-input-number v-model="courseForm.other1Price" :min="0" step-strictly
|
|
|
+ :step="1" controls-position="right"></el-input-number>
|
|
|
+ </el-form-item>
|
|
|
+ <el-form-item label="其他费用2" style="width: 50%;">
|
|
|
+ <el-input-number v-model="courseForm.other2Price" :min="0" step-strictly
|
|
|
+ :step="1" controls-position="right"></el-input-number>
|
|
|
+ </el-form-item>
|
|
|
+ </div>
|
|
|
+ <el-form-item label="课程封面">
|
|
|
+ <el-upload class="cover-uploader" action="#" :show-file-list="false"
|
|
|
+ :on-change="handleCourseCoverChange" :auto-upload="false"
|
|
|
+ :before-upload="beforeCoverUpload">
|
|
|
+ <img v-if="courseForm.coverImageUrl" :src="courseForm.coverImageUrl" class="cover-image" />
|
|
|
+ <i v-else class="el-icon-plus cover-uploader-icon"></i>
|
|
|
+ </el-upload>
|
|
|
+ <div class="cover-tip">建议尺寸 16:9,大小不超过2MB</div>
|
|
|
+ </el-form-item>
|
|
|
+ </el-form>
|
|
|
+ </div>
|
|
|
+
|
|
|
<span slot="footer" class="dialog-footer">
|
|
|
<el-button @click="addDialogVisible = false">取 消</el-button>
|
|
|
<el-button type="primary" @click="submitCourseForm">确 定</el-button>
|
|
@@ -440,6 +466,7 @@ export default {
|
|
|
message: `保存成功`,
|
|
|
type: 'success'
|
|
|
});
|
|
|
+ this.getList()
|
|
|
this.saveVideoLoading = false
|
|
|
this.addVideoVisable = false
|
|
|
}, err => {
|
|
@@ -763,13 +790,17 @@ export default {
|
|
|
coursePrice: 0,
|
|
|
courseDuration: 1,
|
|
|
coverImageUrl: '',
|
|
|
+ teachDuration: 0,
|
|
|
+ teachVeriPrice: 0,
|
|
|
+ materialPrice: 0,
|
|
|
+ other1Price: 0,
|
|
|
+ other2Price: 0
|
|
|
};
|
|
|
if (this.$refs.courseForm) {
|
|
|
this.$refs.courseForm.resetFields();
|
|
|
}
|
|
|
} else {
|
|
|
- console.log(row, '<==== 看看数据')
|
|
|
- const { courseTypeId, courseName, courseDesc, coursePrice, courseDuration, coverImage, id } = row
|
|
|
+ const { courseTypeId, courseName, courseDesc, coursePrice, courseDuration, coverImage, id, teachDuration, teachVeriPrice, materialPrice, other1Price, other2Price } = row
|
|
|
this.courseForm = {
|
|
|
id,
|
|
|
courseTypeId,
|
|
@@ -777,7 +808,8 @@ export default {
|
|
|
courseDesc,
|
|
|
coursePrice,
|
|
|
courseDuration,
|
|
|
- coverImageUrl: this.checkAndAddUpload(coverImage)
|
|
|
+ coverImageUrl: this.checkAndAddUpload(coverImage),
|
|
|
+ teachDuration, teachVeriPrice, materialPrice, other1Price, other2Price
|
|
|
}
|
|
|
}
|
|
|
},
|
|
@@ -799,6 +831,11 @@ export default {
|
|
|
formData.append('coursePrice', this.courseForm.coursePrice);
|
|
|
formData.append('courseDuration', this.courseForm.courseDuration);
|
|
|
formData.append('coverImage', this.courseForm.coverImageUrl);
|
|
|
+ formData.append('teachDuration', this.courseForm.teachDuration);
|
|
|
+ formData.append('teachVeriPrice', this.courseForm.teachVeriPrice);
|
|
|
+ formData.append('materialPrice', this.courseForm.materialPrice);
|
|
|
+ formData.append('other1Price', this.courseForm.other1Price);
|
|
|
+ formData.append('other2Price', this.courseForm.other2Price);
|
|
|
|
|
|
this.listLoading = true;
|
|
|
this.http.uploadFile('/course-info/saveOrUpdate', formData, res => {
|
|
@@ -1167,6 +1204,9 @@ export default {
|
|
|
width: 178px;
|
|
|
height: 100px;
|
|
|
margin-bottom: 10px;
|
|
|
+ display: flex;
|
|
|
+ justify-content: center;
|
|
|
+ align-items: center;
|
|
|
}
|
|
|
|
|
|
.cover-uploader:hover {
|