|
@@ -24,6 +24,9 @@
|
|
|
<el-form-item>
|
|
|
<el-button type="primary" @click="batchManage" size="small">分类管理</el-button>
|
|
|
</el-form-item>
|
|
|
+ <el-form-item>
|
|
|
+ <el-button type="primary" @click="examinationManagement()" size="small">考试管理</el-button>
|
|
|
+ </el-form-item>
|
|
|
</el-form>
|
|
|
</el-col>
|
|
|
|
|
@@ -229,6 +232,22 @@
|
|
|
<viewer ref="imageWrapper" :images="previewImages" style="opacity: 1;position: absolute;top: -9999px;">
|
|
|
<img v-for="(image, index) in previewImages" :src="image" :key="index" />
|
|
|
</viewer>
|
|
|
+
|
|
|
+ <!-- 考试管理 -->
|
|
|
+ <el-dialog :visible.sync="examinationManagementVislable" title="考试管理" width="500px" top="6.5vh">
|
|
|
+ <div>
|
|
|
+ <el-form ref="form" :model="examinationManagementRow" label-width="120px">
|
|
|
+ <el-form-item label="设置考试次数">
|
|
|
+ <el-input-number v-model="examinationManagementRow.dailyQuizLimitValue" controls-position="right" @change="handleChange" :min="1" :precision="0" size="small"></el-input-number>
|
|
|
+ <span style="padding-left: 10px">次</span>
|
|
|
+ </el-form-item>
|
|
|
+ </el-form>
|
|
|
+ </div>
|
|
|
+ <span slot="footer" class="classificationOperation">
|
|
|
+ <el-button @click="examinationManagementVislable = false">关 闭</el-button>
|
|
|
+ <el-button type="primary" :disabled="!examinationManagementRow.dailyQuizLimitValue" @click="saveSysConfig()">保存</el-button>
|
|
|
+ </span>
|
|
|
+ </el-dialog>
|
|
|
</section>
|
|
|
</template>
|
|
|
|
|
@@ -345,10 +364,44 @@ export default {
|
|
|
newCategoryDialogVisible: false,
|
|
|
newCategoryDialogForm: {},
|
|
|
previewImages: [],
|
|
|
- newCategoryDialogLoading: false
|
|
|
+ newCategoryDialogLoading: false,
|
|
|
+
|
|
|
+ // 考试管理
|
|
|
+ examinationManagementVislable: false,
|
|
|
+ examinationManagementRow: {},
|
|
|
}
|
|
|
},
|
|
|
methods: {
|
|
|
+ examinationManagement() {
|
|
|
+ this.examinationManagementRow = {
|
|
|
+ ...this.examinationManagementRow,
|
|
|
+ dailyQuizLimitValue: this.examinationManagementRow.dailyQuizLimit
|
|
|
+ }
|
|
|
+ this.examinationManagementVislable = true;
|
|
|
+ },
|
|
|
+ saveSysConfig() {
|
|
|
+ const { id, dailyQuizLimitValue = 1 } = this.examinationManagementRow;
|
|
|
+ post('/sys-config/updateSysConfig', {
|
|
|
+ id, dailyQuizLimit: dailyQuizLimitValue
|
|
|
+ }).then(res => {
|
|
|
+ if (res.code == 'ok') {
|
|
|
+ this.$message.success('保存成功');
|
|
|
+ this.examinationManagementVislable = false
|
|
|
+ this.getExaminationManagement()
|
|
|
+ } else {
|
|
|
+ this.$message.error(res.msg);
|
|
|
+ }
|
|
|
+ })
|
|
|
+ },
|
|
|
+ getExaminationManagement() {
|
|
|
+ post('/sys-config/getSysConfig', {}).then(res => {
|
|
|
+ if (res.code == 'ok') {
|
|
|
+ this.examinationManagementRow = res.data;
|
|
|
+ } else {
|
|
|
+ this.$message.error(res.msg);
|
|
|
+ }
|
|
|
+ })
|
|
|
+ },
|
|
|
getUpList() {
|
|
|
post('/course-type/uplist', {}).then(res => {
|
|
|
if (res.code == 'ok') {
|
|
@@ -1014,6 +1067,7 @@ export default {
|
|
|
// 获取课程列表
|
|
|
this.getList();
|
|
|
this.getUpList()
|
|
|
+ this.getExaminationManagement()
|
|
|
}
|
|
|
}
|
|
|
</script>
|