var tmpl=`
  <el-date-picker
  :value="value"
  size="small"
  @input="oninput"
  type="datetime"
  :placeholder="placeholder"
  align="right"
  :default-time="defaultTime"
  :picker-options="optionGet">
  </el-date-picker>
`
module.exports=
`{
   template:'${tmpl}',
   props:['isSimple','value','placeholder','defaultTime'],
   data:function(){
     return {
         pickerOptions1: {
            shortcuts: [{
              text: '今天',
              onClick(picker) {
                picker.$emit('pick', new Date());
              }
            }, {
              text: '昨天',
              onClick(picker) {
                const date = new Date();
                date.setTime(date.getTime() - 3600 * 1000 * 24);
                picker.$emit('pick', date);
              }
            }, {
              text: '一周前',
              onClick(picker) {
                const date = new Date();
                date.setTime(date.getTime() - 3600 * 1000 * 24 * 7);
                picker.$emit('pick', date);
              }
            }]
          },
     };
   },
   computed:{
     optionGet:function(){
       if(this.isSimple){
         return "";
       }else{
         return this.pickerOptions1;
       }
     }
   },
   methods:{
     oninput:function(e){
       this.$emit("input",e);
     }
   },
   vname:"gsb-datetime"
}`
