发表于: 2017-10-26 00:16:01

1 618


今天完成的事情:

1.今天完善了搜索功能,参数没有传进去是因为在主页的ui-router配置URL的时候没有将请求的参数带上

.state("index.article-table", {
   url:"/article-table/:page/:size/:startAt/:endAt/:type/:status",
   templateUrl: "article-table.html",

2.写了清空的功能,就是在state go跳转传参的时候,传入参数为空的值

$scope.clear = function () {
   $state.go('index.article-table', {
       page: 1 ,
       size: 10,
       startAt: "",
       endAt: "",
       type: "",
       status:""
   }, {reload: true});
};

明天的计划:完善JS8,开始写新增页面

遇到的问题:搜索功能,跳转后时间条件不能保留,类型和状态条件可以很好的保留,已经在开头的时候进行了双向绑定,但还是跳转的时候输入框就变成空的

$scope.currentPage = $stateParams.page || 1;//当前页码
$scope.itemsPerPage = $stateParams.size || 10;
$scope.startTime = $stateParams.startAt || "";
$scope.endTime = $stateParams.endAt || "";
$scope.types = $stateParams.type || "";//将搜索之后的值在搜索后还显示出来
$scope.statuss = $stateParams.status || "";//将搜索之后的值在搜索后还显示出来

收获:解决了不能搜索传参的问题,写清空功能


返回列表 返回列表
评论

    分享到