zoukankan      html  css  js  c++  java
  • 获取后台数据,将其展现在页面上。

    this.search = function () {
      if ($scope.newModel.term == undefined || $scope.newModel.term == null || $scope.newModel.term == '') {
      initTable()
      }
     
      if ($scope.newModel.term != undefined && $scope.newModel.term != null && typeof $scope.newModel.term == 'object') {
     
    //获取上个月月末的日期,并将其设置为默认值展现在input中
        var term = $filter('date')($scope.newModel.term, 'yyyyMMdd');
        $http.get(path + "task/findBwztJk/" + term).success(function (res) {
        table.data = res.data;
        var i=1;
        table.data.forEach(function (e) {
            e.id=i;
            e.reportTemplateName=e.reportTemplateName;
            e.instName=e.institutionName;
            e.term=e.term;
            i++;
            });
        });
       }
      }
     
    //初始化表格数据
    initTable();
    function initTable() {
        var nowdays = new Date();
        var year = nowdays.getFullYear();
        var month = nowdays.getMonth();
        if(month==0)
          {
          month=12;
          year=year-1;
          }
        if (month < 10) {
          month = "0" + month;
          }
        var myDate = new Date(year, month, 0);
        var lastDay = year + "-" + month + "-" + myDate.getDate();
        $scope.newModel.term=lastDay;
        $http.get(path+"task/findBwztJk/"+lastDay)
        .success(function (res) {
              table.data = res.data;
                var i=1;
            table.data.forEach(function (e) {
            e.id=1;
            e.reportTemplateName=e.reportTemplateName;
            e.instName=e.institutionName;
            e.term=e.term;
            i++;
          });
        });

      

  • 相关阅读:
    spring读书笔记----Quartz Trigger JobStore出错解决
    Linux:Ubuntu16.04下创建Wifi热点
    Java:IDEA下使用JUNIT
    MYSQL:基础—存储过程
    StackExchange.Redis加载Lua脚本进行模糊查询的批量删除和修改
    EFCore执行Sql语句的方法:FromSql与ExecuteSqlCommand
    .NET Core配置文件加载与DI注入配置数据
    ASP.NET Core实现OAuth2.0的AuthorizationCode模式
    CSS实现的几款不错的菜单栏
    开发VS2008 AddIn 入门Sample
  • 原文地址:https://www.cnblogs.com/myicons/p/9088791.html
Copyright © 2011-2022 走看看