var tmpl=`
  <el-date-picker
  :value="value"
  @input="oninput"
  type="datetimerange"
  range-separator="至"
  start-placeholder="开始日期"
  end-placeholder="结束日期"
  :picker-options="optionGet">
  </el-date-picker>
`
module.exports=
`{
   template:'${tmpl}',
   props:['isSimple','value'],
   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-datetimespan"
}`
