From 279785b0686f3de1763056286a80360cdf5264f2 Mon Sep 17 00:00:00 2001 From: inleft <inleft@qq.com> Date: Thu, 10 Feb 2022 18:21:39 +0800 Subject: [PATCH] 添加api请求地址 --- src/components/mini/box10-add.vue | 43 +++++++++++++++++++++++++++++++++++-------- 1 files changed, 35 insertions(+), 8 deletions(-) diff --git a/src/components/mini/box10-add.vue b/src/components/mini/box10-add.vue index 1d314e1..32c4409 100644 --- a/src/components/mini/box10-add.vue +++ b/src/components/mini/box10-add.vue @@ -5,7 +5,7 @@ <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"> 本地文件/由系统生成文件 @@ -95,12 +95,23 @@ <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> @@ -127,7 +138,7 @@ </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> @@ -145,6 +156,18 @@ 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: [], @@ -167,6 +190,7 @@ span: 13 }, form: { + online: false, preference: false, title: '', content: '', @@ -193,18 +217,21 @@ 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: '至少选一个分类', -- Gitblit v1.9.1