licp
2024-04-17 74a135c4f8b46d48a4997ac0e40ac86055b4a1a4
src/components/view/index-index.vue
@@ -220,6 +220,18 @@
    display: flex;
    flex-direction: column;
  }
  .search_thing {
      height: 50px;
    margin-bottom: 26px;
   }
   .search_label {
      width: 120px;
      font-size: 14px;
      text-align: left;
    margin-bottom: 10px;
   }
</style>
<template>
@@ -298,7 +310,7 @@
          <div class="right-2-title">
            <span style="color: #333333;font-size: 16px;">我的日程</span>
            <span style="cursor: pointer;font-size: 12px;
color: #3A7BFA;">添加我的日程</span>
color: #3A7BFA;" @click="dialogVisible=true">添加我的日程</span>
          </div>
          <div class="right-2-body">
            <div class="calendar" style="width: 49%;">
@@ -349,6 +361,36 @@
        </div>
      </el-col>
    </el-row>
    <el-dialog title="日程添加" :visible.sync="dialogVisible" width="400px">
         <div class="body" style="max-height: 60vh;">
            <el-row>
               <el-col class="search_thing" :span="22">
                  <div class="search_label">时间:</div>
                  <div class="search_input">
                     <el-date-picker
                v-model="query.time"
                type="datetime"
                placeholder="选择日期时间"
                size="small"
                style="width:100%">
              </el-date-picker>
                  </div>
               </el-col>
          <el-col class="search_thing" :span="22">
                  <div class="search_label">内容:</div>
                  <div class="search_input">
                     <el-input v-model="query.content" size="small" placeholder="请输入内容"></el-input>
                  </div>
               </el-col>
            </el-row>
         </div>
         <span slot="footer" class="dialog-footer">
            <el-row>
               <el-button @click="handleCancel">取 消</el-button>
               <el-button type="primary" @click="submit" :loading="loading">确 定</el-button>
            </el-row>
         </span>
      </el-dialog>
   </div>
</template>
@@ -360,6 +402,12 @@
            now: null,
        calendarValue: new Date(),
        currentIndex:0,
        dialogVisible:false,
        query:{
          time:'',
          content:''
        },
        loading:false
         }
      },
      mounted() {
@@ -458,6 +506,23 @@
        // 将得到的年月日格式转换为标准时间,与饿了么时间格式相同才能联动
        this.calendarValue = new Date(prevtime);
      },
      handleCancel(){
        this.dialogVisible = false;
        this.query = {
          time:'',
          content:''
        }
      },
      submit(){
        if(!this.query.time){
          this.$message.error('时间未填写')
          return
        }
        if(!this.query.content){
          this.$message.error('内容未填写')
          return
        }
      }
      }
   }
</script>