fastadmin 双击详情页上使用时间插件

fastadmin 双击详情页上使用时间插件

 **// html 代码**
 <form id="form1" action="" role="form" novalidate="novalidate" class="form-inline nice-validator n-default n-bootstrap" style="margin-top:10px;">
     <div class="input-group">
         <span class="input-group-addon"><i class="fa fa-calendar"></i></span>
         <input type="text" class="form-control input-inline datetimepicker" data-type="con" placeholder="请选择开始时间" style="width:270px;" data-date-format="YYYY-MM-DD" name="start_time">
     </div>
     <div style="margin:0 10px;">--</div>
     <div class="input-group">
         <span class="input-group-addon"><i class="fa fa-calendar"></i></span>
         <input type="text" class="form-control input-inline datetimepicker" data-type="con" placeholder="请选择结束时间" style="width:270px;" data-date-format="YYYY-MM-DD" name="end_time">
     </div>
     <div class="searchbtn">
         <img src="https://qiniu.haomachina.cn/uploads/20230222/b650487e18da24420ed0bbfb411ea6bf.png">
     </div>
 </form>


// js代码
双击详情
 table.off('dbl-click-row.bs.table');
 table.on('dbl-click-row.bs.table',function(e,row,element,field){
    layer.open({
         type:1,
         content:Template('itemtpl',{item:row}),
         area:["100%","100%"],
         title:"标题",
         maxmin:true,
     });
     var form = $("#form1");
     if($(".datetimepicker", form).size() > 0) {
         require(['bootstrap-datetimepicker'], function () {
             var options = {
                 format: 'YYYY-MM-DD HH:mm:ss',   //
                 icons: {
                     time: 'fa fa-clock-o',
                     date: 'fa fa-calendar',
                     up: 'fa fa-chevron-up',
                     down: 'fa fa-chevron-down',
                     previous: 'fa fa-chevron-left',
                     next: 'fa fa-chevron-right',
                     today: 'fa fa-history',
                     clear: 'fa fa-trash',
                     close: 'fa fa-remove'
                 },
                 showTodayButton: true,
                 showClose: true
             };
             $('.datetimepicker', form).parent().css('position', 'relative');
             $('.datetimepicker', form).datetimepicker(options);
         })
     }
 })
  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值