lijh
2022-01-19 06ee76d0a83854ad7a044689627e0f00a66e5ce5
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">
               本地文件/由系统生成文件
@@ -101,9 +101,17 @@
            </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>
@@ -130,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>
@@ -148,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: [],
@@ -170,6 +190,7 @@
               span: 13
            },
            form: {
               online: false,
               preference: false,
               title: '',
               content: '',
@@ -196,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: '至少选一个分类',