| | |
| | | <a-input v-model="form.title" placeholder="限 50字内" /> |
| | | </a-form-model-item> |
| | | |
| | | <a-form-model-item label="模式切换"> |
| | | <a-form-model-item label="模式切换" prop="common"> |
| | | <a-switch v-model="form.online" /> |
| | | <span class="myTip"> |
| | | 本地文件/由系统生成文件 |
| | |
| | | <a-icon type="upload" /> jpg/png/jpeg.. |
| | | </a-button> |
| | | </a-upload> |
| | | <span class="myTip"> |
| | | 自动转码,可以传高清图 |
| | | </span> |
| | | </a-form-model-item> |
| | | |
| | | <a-form-model-item label="定时"> |
| | | <a-date-picker v-model="form.publishDate" show-time type="<datetime></datetime>" placeholder="发布时间" |
| | | <a-date-picker v-model="form.publishDate" show-time type="datetime" placeholder="发布时间" |
| | | style="width: 100%;" :disabledDate="disabledDate" |
| | | :getCalendarContainer="getCalendarContainer()" /> |
| | | </a-form-model-item> |
| | | |
| | | <a-form-model-item label="置顶权重"> |
| | | <a-slider v-model="form.sliderValue" :default-value="20" :step="5" |
| | | :getTooltipPopupContainer="getCalendarContainer()" /> |
| | | <span class="myTip"> |
| | | 越大越靠前 |
| | | </span> |
| | | </a-form-model-item> |
| | | |
| | | |
| | |
| | | </a-form-model-item> |
| | | |
| | | <a-form-model-item label="授权密码" v-show="form.auth=='password'"> |
| | | <a-input v-model="form.password" type="password" placeholder="Password"> |
| | | <a-input v-model="form.password" type="password" placeholder="独立密码"> |
| | | <a-icon slot="prefix" type="lock" style="color:rgba(0,0,0,.25)" /> |
| | | </a-input> |
| | | </a-form-model-item> |
| | |
| | | import moment from "moment"; |
| | | export default { |
| | | data() { |
| | | |
| | | let validateContent = (rule, value, callback) => { |
| | | if (this.form.online) { |
| | | console.log("内容未填"); |
| | | this.$refs.myForm.validateField('content') |
| | | } else { |
| | | console.log("文件未传"); |
| | | this.$refs.myForm.validateField('blogFileList') |
| | | } |
| | | callback(); |
| | | }; |
| | | |
| | | return { |
| | | |
| | | blogFileList: [], |
| | |
| | | span: 13 |
| | | }, |
| | | form: { |
| | | online: false, |
| | | preference: false, |
| | | title: '', |
| | | content: '', |
| | |
| | | trigger: 'blur' |
| | | }, |
| | | ], |
| | | common: [{ |
| | | validator: validateContent, |
| | | trigger: [] |
| | | }], |
| | | content: [{ |
| | | max: 10, |
| | | required: true, |
| | | message: '至少选一个上传内容', |
| | | message: '至少填一下上传内容', |
| | | trigger: 'blur' |
| | | }, ], |
| | | blogFileList: [{ |
| | | min: 1, |
| | | required: true, |
| | | message: '文件未上传', |
| | | }, { |
| | | min: 1, |
| | | message: '文件未上传', |
| | | }, ], |
| | | }], |
| | | class: [{ |
| | | required: true, |
| | | message: '至少选一个分类', |