|
@@ -22,7 +22,7 @@
|
|
|
</a-card>
|
|
|
</page-header-wrapper>
|
|
|
<a-modal
|
|
|
- title="新增课程"
|
|
|
+ title="新增课程: 普通课程"
|
|
|
:visible="visible"
|
|
|
:confirm-loading="confirmLoading"
|
|
|
@ok="submitForm"
|
|
@@ -33,10 +33,11 @@
|
|
|
:model="dynamicValidateForm"
|
|
|
v-bind="formItemLayoutWithOutLabel"
|
|
|
>
|
|
|
- <a-form-model-item label="课程类型" v-bind="formItemLayout ">
|
|
|
+ <!-- <a-form-model-item label="课程类型" v-bind="formItemLayout ">
|
|
|
<a-radio checked>普通课程</a-radio>
|
|
|
- </a-form-model-item>
|
|
|
+ </a-form-model-item> -->
|
|
|
<a-form-model-item
|
|
|
+ style="margin-bottom: 6px;"
|
|
|
v-for="(domain, index) in dynamicValidateForm.domains"
|
|
|
:key="domain.key"
|
|
|
v-bind=" formItemLayout "
|
|
@@ -51,7 +52,7 @@
|
|
|
<a-input
|
|
|
v-model="domain.value"
|
|
|
placeholder="请输入课程名"
|
|
|
- style="width: 60%; margin-right: 8px"
|
|
|
+ style="width: 60%; margin-right: 8px;margin-bottom: 6px;"
|
|
|
/>
|
|
|
<a-icon
|
|
|
v-if="index > 0 "
|
|
@@ -176,15 +177,12 @@ export default {
|
|
|
}
|
|
|
},
|
|
|
submitForm () {
|
|
|
- this.$refs.dynamicValidateForm.validate(valid => {
|
|
|
- console.log(valid)
|
|
|
- if (valid) {
|
|
|
- this.postCourse()
|
|
|
- } else {
|
|
|
- console.log('error submit!!')
|
|
|
- return false
|
|
|
- }
|
|
|
- })
|
|
|
+ const hasValue = this.dynamicValidateForm.domains.findIndex(item => item.value === '')
|
|
|
+ if (hasValue !== -1) {
|
|
|
+ this.$message.error('请输入课程名')
|
|
|
+ return false
|
|
|
+ }
|
|
|
+ this.postCourse()
|
|
|
},
|
|
|
// 添加课程
|
|
|
async postCourse () {
|