cvmachine.com - 申博开户网

查找: 您的方位主页 > 网络频道 > 阅览资讯:前端页面(节目播出单修正)

前端页面(节目播出单修正)

2019-03-30 18:01:14 来历:www.cvmachine.com 【

前端页面(节目播出单修正)

款式相片

前端页面(节目播出单修正)
前端页面(节目播出单修正)

运用的插件与其他文件

  1. bootstrap.min.css
  2. font-awesome.min.css
  3. layer.min.js
  4. jquery.min.js
  5. bootstrap.min.js
  6. layui.js,laydate.js
  7. 等等…

主页代码

播出日期:   接连天数:   保存
敞开功放 文件转播 电台播音 封闭功放 中止播映
 
类型 节目编号 节目 节目文件 开端时刻 节目时长 操作
## 中心办法
 //文件转播挑选
  function doFile() {
    var baseTime = "08:00:00";
    if($("#broaddate").val() == ""){
      layer.tips('请挑选播出日期','#broaddate', {
        tips: [1, '#3595CC'],
        time: 4000
      });
      return false;
    }
    var data = $("#broaddate").val();
    var time = getTime(data+" "+baseTime);
    //console.log("timeFile="+time);
    var _url = "***";
    var _title = '文件挑选';
    var _width = "1200";
    var _height = ($(window).height() - 50);
    layer.open({
      type: 2,
      maxmin: true,
      shade: 0.3,
      title: _title,
      fix: false,
      area: [_width + 'px', _height + 'px'],
      content: _url,
      shadeClose: true,
      btn: ['<i class="fa fa-check"></i> 承认', '<i class="fa fa-close"></i> 封闭'],
      yes: function (index, layero) {
        layer.close(index);
        //获取子页面封闭前的回调函数获取到的值
        var res = $(layero).find("iframe")[0].contentWindow.callbackfile();
        console.log(">>>重复次数"+res.data_num+">>>文件id"+res.data_fileID+">>>节目"+res.data_filenames+">>>节目文件"+res.data_filename+">>>时长"+res.data_file+">>>距离时长"+res.data_time)
        for(var i=1;i<=res.data_num;i++){
          $("#tbody").append("<tr><td class='center'>文件转播</td> <td class='center'>"+res.data_fileID+"</td>"+
            "<td class='center'>"+res.data_filenames+"</td> <td class='center'>"+res.data_filename+"</td>"+
            "<td class='center'>"+time+"</td> <td class='center'>"+res.data_file+"</td>"+
            " <td class='center'>"+
            "<div class='action-buttons'>"+
            "<a class='green' onclick='editTime(this);'>"+
            "<i class='ace-icon fa fa-pencil-square-o bigger-130' title='修正'></i>"+
            "</a> <a class='red' onclick='deletePro(this);'>"+
            "<i class='ace-icon fa fa-trash-o bigger-120' title='删去'></i>"+
            "</a> </div>"+
            "</td></tr>");
          time = getTime(data+" "+baseTime);
        }
      }, cancel: function () {
        return true;
      }
    });
  }
  //时刻插件
  layui.use('laydate', function(){
    var laydate = layui.laydate;
    //履行一个laydate实例
    laydate.render({
      elem:"#broad",
      type: 'time',
    });
  });

//js日期格局化函数yyyy-MM-dd
function data_string(datetimeStr) {
  var mydateint = Date.parse(datetimeStr);//数值格局的时刻
  if (!isNaN(mydateint)) {
    var mydate = new Date(mydateint);
    return mydate;
  }
  var mydate = new Date(datetimeStr);//字符串格局时刻
  var monthstr = mydate.getMonth() + 1;
  if (!isNaN(monthstr)) {//转化成功
    return mydate;
  }//字符串格局时刻转化失利
  var dateParts = datetimeStr.split(" ");
  var dateToday = new Date();
  var year = dateToday.getFullYear();
  var month = dateToday.getMonth();
  var day = dateToday.getDate();
  if (dateParts.length >= 1) {
    var dataPart = dateParts[0].split("-");//yyyy-mm-dd 格局时刻
    if (dataPart.length == 1) {
      dataPart = dateParts[0].split("/");//yyyy/mm/dd格局时刻
    }
    if (dataPart.length == 3) {
      year = Math.floor(dataPart[0]);
      month = Math.floor(dataPart[1]) - 1;
      day = Math.floor(dataPart[2]);
    }
  }
  if (dateParts.length == 2) {//hh:mm:ss格局时刻
    var timePart = dateParts[1].split(":");//hh:mm:ss格局时刻 (笑脸是:)
    if (timePart.length == 3) {
      var hour = Math.floor(timePart[0]);
      var minute = Math.floor(timePart[1]);
      var second = Math.floor(timePart[2]);
      return new Date(year, month, day, hour, minute, second);
    }
  }
  else {
    return new Date(year, month, day);
  }

}
/**
 * 取得时刻
 * @Aut Ljolan
 * @returns {string}
 */
function getTime(intervaltime){
  var basenum = 5; //5秒钟推迟播映
  var TimeNILL = data_string(intervaltime)
  var restData = intervaltime;
  //console.log("???"+TimeNILL); //字符串转时刻
  var trs = $("#tbody").find("tr");
  if(trs.length>1){
    var lasttime = trs[trs.length-1].cells[4].innerText;

    var timelenth = trs[trs.length-1].cells[5].innerText;
    if(timelenth.length==0){
      timelenth = "00:00:00";
    }
    //console.log(lasttime+"---"+timelenth)
    var seconds =0;
    if(lasttime!=null&&lasttime!=""){
      var H2 = parseInt(lasttime.split(":")[0]);
      var M2 = parseInt(lasttime.split(":")[1]);
      var S2 = parseInt(lasttime.split(":")[2]);
      //console.log("H2="+H2+"M2="+M2+"S2="+S2)
      seconds += H2 * 3600 + M2 * 60 + S2 ;
      //console.log("<<<1 前一个的播映开端时刻>>>"+lasttime+"---"+seconds)
    }
    if(timelenth!=null &&timelenth.length>0){
      var H = parseInt(timelenth.split(":")[0]);
      var M = parseInt(timelenth.split(":")[1]);
      var S = parseInt(timelenth.split(":")[2]);
      //console.log("H="+H+"M="+M+"S="+S)
      seconds += H * 3600 + M * 60 + S ;
      //console.log(">>>2 前一个的文件时长<<<"+timelenth+"---"+seconds)
    } //2017-11-11 80:00:00
    var Se = seconds-28800+basenum;
    restData = addTime(intervaltime,Se); //后边的是:前一个tr标签的播映开端时刻+文件时长-08:00:00(28800s)+距离时刻
    // console.log(Se+">>>"+restData);

  }
  var nule = restData.toString().split(" ")[1];
  if(nule!=null &&nule.length>0){
    var H,M,S;
    H = parseInt(nule.split(":")[0]);
    M = parseInt(nule.split(":")[1]);
    S = parseInt(nule.split(":")[2]);
    if(H<9){
      H = '0'+H;
    }
    if(M<9){
      M = '0'+M;
    }
    if(S<9){
      S = '0'+S;
    }
    nule = H+":"+M+":"+S;
  }
  return nule;
}

//时刻相加
function addTime(d,num) {
  var d = new Date(d.substring(0,4),
    d.substring(5,7)-1,
    d.substring(8,10),
    d.substring(11,13),
    d.substring(14,16),
    d.substring(17,19));
  d.setTime(d.getTime()+num*1000);
  //console.log(d.toLocaleString());
  return d.getFullYear()+"-"
    +(d.getMonth()+1)
    +"-"+d.getDate()
    +" "+d.getHours().toString()
    +":"+d.getMinutes().toString()
    +":"+d.getSeconds().toString();

}

##文件挑选弹框

<body class="gray-bg">
<div class="container-div ui-layout-center">
  <div class="row">
    <table style="margin-top:5px;">
      <tr>
        <td style="padding-left:2px;text-align: right;" id="fileid" class="" name="">重复次数:</td>
        <td style="padding-left:2px;">
          <input name="continuenum" id="continuenum" value="1" type="number" min="1" max="15" step="1" style="width:88px;height: 30px;border-radius:5%"
              placeholder="重复次数" title="重复次数"/></td>
        <td style="padding-left:2px;text-align: right;">时刻距离:</td>
        <td style="padding-left:2px;">
          <input class="laydate-icon form-control layer-date"
              name="broaddate"
              id="broaddate"
              value="00:00:00"
              readonly="readonly"
              style="width:160px;"
              placeholder="播出日期"
              title="播出日期"/>
        </td>
        <td style="padding-left:2px;text-align: right;">节目:</td>
        <td style="padding-left:2px;">
          <input name="" id="orgs" value="" type="text" readonly style="width:128px;height: 30px;border-radius:5%" /></td>

      </tr>
    </table>
    <div class="col-sm-12 search-collapse">
      <form id="formId">
        <div class="select-list">
          <ul>
            <li>
              节目称号:<input type="text" name="fname" style="width: 130px;"/>
            </li>

            <!--<li>-->
              <!--是否公共:<input type="text" name="ispublic" style="width: 50px;"/>-->
            <!--</li>-->
            <!--<li>时长规模:</li>-->
            <!--<li>-->
            <!--<input class="laydate-icon form-control layer-date"-->
                  <!--name="begindate"-->
                  <!--id="begindate"-->
                  <!--value="00:00:00"-->
                  <!--readonly="readonly"-->
                  <!--style="width:160px;"-->
                  <!--placeholder="开端时刻"-->
                  <!--title="开端时刻"/>-->
            <!--</li>-->
            <!--<li>&#45;&#45;</li>-->
            <!--<li>-->
            <!--<input class="laydate-icon form-control layer-date"-->
                  <!--name="enddate"-->
                  <!--id="enddate"-->
                  <!--value="00:00:00"-->
                  <!--readonly="readonly"-->
                  <!--style="width:160px;"-->
                  <!--placeholder="截止时刻"-->
                  <!--title="截止时刻"/>-->
            <!--</li>-->

            <li>
              <a class="btn btn-primary btn-rounded btn-sm" onclick="$.table.search()"><i class="fa fa-search"></i>&nbsp;查找</a>
              <a class="btn btn-warning btn-rounded btn-sm" onclick="$.form.reset()"><i class="fa fa-refresh"></i>&nbsp;重置</a>
            </li>
          </ul>
        </div>
      </form>
    </div>
    <div class="col-sm-12 select-table table-striped">
      <table id="bootstrap-table" data-mobile-responsive="true"></table>
    </div>
  </div>
</div>
<div th:include="include :: footer"></div>
<script th:src="@{/ajax/libs/jquery-layout/jquery.layout-latest.js}"></script>

<script th:inline="javascript">
  /**
   * 挑选文件
   * @param fid
   */
  function selectFiles(fname,fid,filename,flenth) {
    $("#orgs").attr("value",fname);
    $("#fileid").attr("class",fid);
    $("#fileid").attr("name",filename);
    $("#orgs").attr("name",flenth);
  }
  var prefix = ctx + "broad/proSinmanage";
  $(function() {
    var options = {
      url: prefix + "/listFile",
      modalName: "文件挑选",
      search: false,
      showExport: true,

      columns: [
        // {
        //   checkbox: true,
        // },
{
field : 'fid',
title : '文件id',
visible: false
},
        {
          field : 'fname',
          title : '节目称号',
          sortable: true,
          width: '20%'
        },
        {
          field : 'filename',
          title : '文件称号',
          sortable: true
        },
{
field : 'flenth',
title : '文件时长',
sortable: true
},
        {
          field : 'ispublic',
          title : '是否公共',
          formatter:function(value,row,index){
            var html = "";
            if(value == "0"){
              html += "<label style='color: #ff5909'>非公共</label>";
              return html;
            }else {
              html += "<label style='color: #02cd0d'>公共</label>";
              return html;
            }
          },
          sortable: true,
        },
{
field : 'createdtime',
title : '创立时刻',
sortable: true
},
    {
      title: '操作',
      align: 'center',
      formatter: function(value, row, index) {
      var actions = [];
      actions.push('<a class="btn btn-success btn-xs" href="#"><i class="fa fa-edit"></i>试听</a> ');
            actions.push('<a class="btn btn-success btn-xs" href="#" onclick="selectFiles(\''+ row.fname+'\',\''+ row.fid+'\',\''+row.filename+'\',\''+row.flenth+'\');"><i class="fa fa-edit"></i>挑选</a> ');
           return actions.join('');
      }
    }
      ]
    };
    $.table.init(options);
  });



   //供给给父页面获取选中的值
   function callbackfile() {
     /*在挑选终端前先获取一次文本框的值,为的是能够挑选多个小组的终端*/
     var fname = document.getElementById("orgs").value;
     var fileID = $("#fileid").attr("class");
     var filename = $("#fileid").attr("name");
     var flenth = $("#orgs").attr("name");
     var filenum = $("#continuenum").val();
     var time = $("#broaddate").val();
     datas = { //调用它的父页面A的input这个function
       data_filenames:fname, //把data传入父页面A中的data_role,这儿cllbackfile()是我别的核算data的一个函数,能够疏忽
       data_fileID:fileID,
       data_filename:filename,
       data_file:flenth,
       data_num:filenum,
       data_time:time
     }
     return datas;
   }
</script>
<script th:src="@{/js/jquery.min.js}"></script>
<script th:src="@{/js/bootstrap.min.js}"></script>
<script th:src="@{/js/jquery.tips.js}"></script>
<script th:src="@{/js/plugins/layer/layui-v2.4.5/layui/layui.js}"></script>

<!--时刻插件-->
<script>
  layui.use('laydate', function(){
    var laydate = layui.laydate;

    //履行一个laydate实例
    laydate.render({
      elem:"#broaddate",
      type: 'time',
    });
    //履行一个laydate实例
    laydate.render({
      elem:"#begindate",
      type: 'time',
    });
    //履行一个laydate实例
    laydate.render({
      elem:"#enddate",
      type: 'time',
    });
  });
</script>
<div th:include="include :: footer"></div>
</body>

 
 

本文地址:http://www.cvmachine.com/a/question/100080.html
Tags: 前端 页面 节目
修正:申博开户网
关于咱们 | 联络咱们 | 友情链接 | 网站地图 | Sitemap | App | 回来顶部